diff --git a/.gitignore b/.gitignore index e7a3dcd..30c24e3 100644 --- a/.gitignore +++ b/.gitignore @@ -103,7 +103,6 @@ example/ft_job_artifacts/ example/mcq_dataset.jsonl openweights/jobs/unsloth/logp.ipynb -openweights/dashboard/backend/static/ example/_* .logs openweights/jobs/unsloth/check.ipynb diff --git a/openweights/dashboard/backend/static/assets/LogProbVisualization-B6jQtzzK.js b/openweights/dashboard/backend/static/assets/LogProbVisualization-B6jQtzzK.js new file mode 100644 index 0000000..4c9c6d5 --- /dev/null +++ b/openweights/dashboard/backend/static/assets/LogProbVisualization-B6jQtzzK.js @@ -0,0 +1,20 @@ +var ir=Object.defineProperty;var sr=(i,t,e)=>t in i?ir(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var F=(i,t,e)=>sr(i,typeof t!="symbol"?t+"":t,e);import{a as I,u as nr,c as _e,d as or,e as Fs,f as rr,h as Xi,o as ui,i as Ki,_ as Y,k as fi,l as ar,m as lr,n as ue,j as L,s as ne,p as Yt,q as de,t as no,v as cr,w as hr,x as dr,y as Wt,z as ur,R as ms,B as Pt,F as Hs,I as Bs,S as js,M as Ns,A as fr,D as gr,T as Xe,P as pr,E as mr,G as br,H as xr,C as _r}from"./index-KCoSzXrZ.js";const yr={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function vr(i,t,e=(s,n)=>s===n){return i.length===t.length&&i.every((s,n)=>e(s,t[n]))}const kr=2;function oo(i,t){return i-t}function Ws(i,t){var e;const{index:s}=(e=i.reduce((n,o,r)=>{const a=Math.abs(t-o);return n===null||a({left:`${i}%`}),leap:i=>({width:`${i}%`})},"horizontal-reverse":{offset:i=>({right:`${i}%`}),leap:i=>({width:`${i}%`})},vertical:{offset:i=>({bottom:`${i}%`}),leap:i=>({height:`${i}%`})}},Pr=i=>i;let Ze;function Vs(){return Ze===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Ze=CSS.supports("touch-action","none"):Ze=!0),Ze}function Tr(i){const{"aria-labelledby":t,defaultValue:e,disabled:s=!1,disableSwap:n=!1,isRtl:o=!1,marks:r=!1,max:a=100,min:l=0,name:c,onChange:h,onChangeCommitted:d,orientation:u="horizontal",rootRef:f,scale:p=Pr,step:g=1,shiftStep:m=10,tabIndex:b,value:y}=i,k=I.useRef(void 0),[S,x]=I.useState(-1),[C,w]=I.useState(-1),[v,P]=I.useState(!1),E=I.useRef(0),[D,z]=nr({controlled:y,default:e??l,name:"Slider"}),G=h&&((_,M,O)=>{const $=_.nativeEvent||_,V=new $.constructor($.type,$);Object.defineProperty(V,"target",{writable:!0,value:{value:M,name:c}}),h(V,M,O)}),nt=Array.isArray(D);let R=nt?D.slice().sort(oo):[D];R=R.map(_=>_==null?l:_e(_,l,a));const Q=r===!0&&g!==null?[...Array(Math.floor((a-l)/g)+1)].map((_,M)=>({value:l+g*M})):r||[],j=Q.map(_=>_.value),{isFocusVisibleRef:rt,onBlur:A,onFocus:T,ref:Z}=or(),[X,H]=I.useState(-1),B=I.useRef(null),ht=Fs(Z,B),gt=Fs(f,ht),re=_=>M=>{var O;const $=Number(M.currentTarget.getAttribute("data-index"));T(M),rt.current===!0&&H($),w($),_==null||(O=_.onFocus)==null||O.call(_,M)},ae=_=>M=>{var O;A(M),rt.current===!1&&H(-1),w(-1),_==null||(O=_.onBlur)==null||O.call(_,M)},Ve=(_,M)=>{const O=Number(_.currentTarget.getAttribute("data-index")),$=R[O],V=j.indexOf($);let N=M;if(Q&&g==null){const Ct=j[j.length-1];N>Ct?N=Ct:NM=>{var O;if(g!==null){const $=Number(M.currentTarget.getAttribute("data-index")),V=R[$];let N=null;(M.key==="ArrowLeft"||M.key==="ArrowDown")&&M.shiftKey||M.key==="PageDown"?N=Math.max(V-m,l):((M.key==="ArrowRight"||M.key==="ArrowUp")&&M.shiftKey||M.key==="PageUp")&&(N=Math.min(V+m,a)),N!==null&&(Ve(M,N),M.preventDefault())}_==null||(O=_.onKeyDown)==null||O.call(_,M)};rr(()=>{if(s&&B.current.contains(document.activeElement)){var _;(_=document.activeElement)==null||_.blur()}},[s]),s&&S!==-1&&x(-1),s&&X!==-1&&H(-1);const Li=_=>M=>{var O;(O=_.onChange)==null||O.call(_,M),Ve(M,M.target.valueAsNumber)},Ye=I.useRef(void 0);let Rt=u;o&&u==="horizontal"&&(Rt+="-reverse");const it=({finger:_,move:M=!1})=>{const{current:O}=B,{width:$,height:V,bottom:N,left:Ct}=O.getBoundingClientRect();let Ot;Rt.indexOf("vertical")===0?Ot=(N-_.y)/V:Ot=(_.x-Ct)/$,Rt.indexOf("-reverse")!==-1&&(Ot=1-Ot);let K;if(K=Sr(Ot,l,a),g)K=Mr(K,g,l);else{const ce=Ws(j,K);K=j[ce]}K=_e(K,l,a);let bt=0;if(nt){M?bt=Ye.current:bt=Ws(R,K),n&&(K=_e(K,R[bt-1]||-1/0,R[bt+1]||1/0));const ce=K;K=$s({values:R,newValue:K,index:bt}),n&&M||(bt=K.indexOf(ce),Ye.current=bt)}return{newValue:K,activeIndex:bt}},et=Xi(_=>{const M=Ke(_,k);if(!M)return;if(E.current+=1,_.type==="mousemove"&&_.buttons===0){wt(_);return}const{newValue:O,activeIndex:$}=it({finger:M,move:!0});qe({sliderRef:B,activeIndex:$,setActive:x}),z(O),!v&&E.current>kr&&P(!0),G&&!Ge(O,D)&&G(_,O,$)}),wt=Xi(_=>{const M=Ke(_,k);if(P(!1),!M)return;const{newValue:O}=it({finger:M,move:!0});x(-1),_.type==="touchend"&&w(-1),d&&d(_,O),k.current=void 0,Mt()}),Nt=Xi(_=>{if(s)return;Vs()||_.preventDefault();const M=_.changedTouches[0];M!=null&&(k.current=M.identifier);const O=Ke(_,k);if(O!==!1){const{newValue:V,activeIndex:N}=it({finger:O});qe({sliderRef:B,activeIndex:N,setActive:x}),z(V),G&&!Ge(V,D)&&G(_,V,N)}E.current=0;const $=ui(B.current);$.addEventListener("touchmove",et,{passive:!0}),$.addEventListener("touchend",wt,{passive:!0})}),Mt=I.useCallback(()=>{const _=ui(B.current);_.removeEventListener("mousemove",et),_.removeEventListener("mouseup",wt),_.removeEventListener("touchmove",et),_.removeEventListener("touchend",wt)},[wt,et]);I.useEffect(()=>{const{current:_}=B;return _.addEventListener("touchstart",Nt,{passive:Vs()}),()=>{_.removeEventListener("touchstart",Nt),Mt()}},[Mt,Nt]),I.useEffect(()=>{s&&Mt()},[s,Mt]);const Ai=_=>M=>{var O;if((O=_.onMouseDown)==null||O.call(_,M),s||M.defaultPrevented||M.button!==0)return;M.preventDefault();const $=Ke(M,k);if($!==!1){const{newValue:N,activeIndex:Ct}=it({finger:$});qe({sliderRef:B,activeIndex:Ct,setActive:x}),z(N),G&&!Ge(N,D)&&G(M,N,Ct)}E.current=0;const V=ui(B.current);V.addEventListener("mousemove",et,{passive:!0}),V.addEventListener("mouseup",wt)},dt=xi(nt?R[0]:l,l,a),le=xi(R[R.length-1],l,a)-dt,Ii=(_={})=>{const M=Ki(_),O={onMouseDown:Ai(M||{})},$=Y({},M,O);return Y({},_,{ref:gt},$)},Ri=_=>M=>{var O;(O=_.onMouseOver)==null||O.call(_,M);const $=Number(M.currentTarget.getAttribute("data-index"));w($)},Ei=_=>M=>{var O;(O=_.onMouseLeave)==null||O.call(_,M),w(-1)};return{active:S,axis:Rt,axisProps:Cr,dragging:v,focusedThumbIndex:X,getHiddenInputProps:(_={})=>{var M;const O=Ki(_),$={onChange:Li(O||{}),onFocus:re(O||{}),onBlur:ae(O||{}),onKeyDown:Di(O||{})},V=Y({},O,$);return Y({tabIndex:b,"aria-labelledby":t,"aria-orientation":u,"aria-valuemax":p(a),"aria-valuemin":p(l),name:c,type:"range",min:i.min,max:i.max,step:i.step===null&&i.marks?"any":(M=i.step)!=null?M:void 0,disabled:s},_,V,{style:Y({},yr,{direction:o?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:Ii,getThumbProps:(_={})=>{const M=Ki(_),O={onMouseOver:Ri(M||{}),onMouseLeave:Ei(M||{})};return Y({},_,M,O)},marks:Q,open:C,range:nt,rootRef:gt,trackLeap:le,trackOffset:dt,values:R,getThumbStyle:_=>({pointerEvents:S!==-1&&S!==_?"none":void 0})}}const Or=i=>!i||!fi(i);function Dr(i){return lr("MuiSlider",i)}const _t=ar("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),Lr=i=>{const{open:t}=i;return{offset:ue(t&&_t.valueLabelOpen),circle:_t.valueLabelCircle,label:_t.valueLabelLabel}};function Ar(i){const{children:t,className:e,value:s}=i,n=Lr(i);return t?I.cloneElement(t,{className:ue(t.props.className)},L.jsxs(I.Fragment,{children:[t.props.children,L.jsx("span",{className:ue(n.offset,e),"aria-hidden":!0,children:L.jsx("span",{className:n.circle,children:L.jsx("span",{className:n.label,children:s})})})]})):null}const Ir=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","shiftStep","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"];function Ys(i){return i}const Rr=ne("span",{name:"MuiSlider",slot:"Root",overridesResolver:(i,t)=>{const{ownerState:e}=i;return[t.root,t[`color${Yt(e.color)}`],e.size!=="medium"&&t[`size${Yt(e.size)}`],e.marked&&t.marked,e.orientation==="vertical"&&t.vertical,e.track==="inverted"&&t.trackInverted,e.track===!1&&t.trackFalse]}})(({theme:i})=>{var t;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${_t.disabled}`]:{pointerEvents:"none",cursor:"default",color:(i.vars||i).palette.grey[400]},[`&.${_t.dragging}`]:{[`& .${_t.thumb}, & .${_t.track}`]:{transition:"none"}},variants:[...Object.keys(((t=i.vars)!=null?t:i).palette).filter(e=>{var s;return((s=i.vars)!=null?s:i).palette[e].main}).map(e=>({props:{color:e},style:{color:(i.vars||i).palette[e].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}}),Er=ne("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(i,t)=>t.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),zr=ne("span",{name:"MuiSlider",slot:"Track",overridesResolver:(i,t)=>t.track})(({theme:i})=>{var t;return{display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:i.transitions.create(["left","width","bottom","height"],{duration:i.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.keys(((t=i.vars)!=null?t:i).palette).filter(e=>{var s;return((s=i.vars)!=null?s:i).palette[e].main}).map(e=>({props:{color:e,track:"inverted"},style:Y({},i.vars?{backgroundColor:i.vars.palette.Slider[`${e}Track`],borderColor:i.vars.palette.Slider[`${e}Track`]}:Y({backgroundColor:de.lighten(i.palette[e].main,.62),borderColor:de.lighten(i.palette[e].main,.62)},i.applyStyles("dark",{backgroundColor:de.darken(i.palette[e].main,.5)}),i.applyStyles("dark",{borderColor:de.darken(i.palette[e].main,.5)})))}))]}}),Fr=ne("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(i,t)=>{const{ownerState:e}=i;return[t.thumb,t[`thumbColor${Yt(e.color)}`],e.size!=="medium"&&t[`thumbSize${Yt(e.size)}`]]}})(({theme:i})=>{var t;return{position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:i.transitions.create(["box-shadow","left","bottom"],{duration:i.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(i.vars||i).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${_t.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.keys(((t=i.vars)!=null?t:i).palette).filter(e=>{var s;return((s=i.vars)!=null?s:i).palette[e].main}).map(e=>({props:{color:e},style:{[`&:hover, &.${_t.focusVisible}`]:Y({},i.vars?{boxShadow:`0px 0px 0px 8px rgba(${i.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${de.alpha(i.palette[e].main,.16)}`},{"@media (hover: none)":{boxShadow:"none"}}),[`&.${_t.active}`]:Y({},i.vars?{boxShadow:`0px 0px 0px 14px rgba(${i.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${de.alpha(i.palette[e].main,.16)}`})}}))]}}),Hr=ne(Ar,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(i,t)=>t.valueLabel})(({theme:i})=>Y({zIndex:1,whiteSpace:"nowrap"},i.typography.body2,{fontWeight:500,transition:i.transitions.create(["transform"],{duration:i.transitions.duration.shortest}),position:"absolute",backgroundColor:(i.vars||i).palette.grey[600],borderRadius:2,color:(i.vars||i).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${_t.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${_t.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:i.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})),Br=ne("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:i=>no(i)&&i!=="markActive",overridesResolver:(i,t)=>{const{markActive:e}=i;return[t.mark,e&&t.markActive]}})(({theme:i})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(i.vars||i).palette.background.paper,opacity:.8}}]})),jr=ne("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:i=>no(i)&&i!=="markLabelActive",overridesResolver:(i,t)=>t.markLabel})(({theme:i})=>Y({},i.typography.body2,{color:(i.vars||i).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(i.vars||i).palette.text.primary}}]})),Nr=i=>{const{disabled:t,dragging:e,marked:s,orientation:n,track:o,classes:r,color:a,size:l}=i,c={root:["root",t&&"disabled",e&&"dragging",s&&"marked",n==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",a&&`color${Yt(a)}`,l&&`size${Yt(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${Yt(l)}`,a&&`thumbColor${Yt(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return ur(c,Dr,r)},Wr=({children:i})=>i,$r=I.forwardRef(function(t,e){var s,n,o,r,a,l,c,h,d,u,f,p,g,m,b,y,k,S,x,C,w,v,P,E;const D=cr({props:t,name:"MuiSlider"}),z=hr(),{"aria-label":G,"aria-valuetext":nt,"aria-labelledby":R,component:Q="span",components:j={},componentsProps:rt={},color:A="primary",classes:T,className:Z,disableSwap:X=!1,disabled:H=!1,getAriaLabel:B,getAriaValueText:ht,marks:gt=!1,max:re=100,min:ae=0,orientation:Ve="horizontal",shiftStep:Di=10,size:Li="medium",step:Ye=1,scale:Rt=Ys,slotProps:it,slots:et,track:wt="normal",valueLabelDisplay:Nt="off",valueLabelFormat:Mt=Ys}=D,Ai=dr(D,Ir),dt=Y({},D,{isRtl:z,max:re,min:ae,classes:T,disabled:H,disableSwap:X,orientation:Ve,marks:gt,color:A,size:Li,step:Ye,shiftStep:Di,scale:Rt,track:wt,valueLabelDisplay:Nt,valueLabelFormat:Mt}),{axisProps:le,getRootProps:Ii,getHiddenInputProps:Ri,getThumbProps:Ei,open:As,active:zi,axis:xe,focusedThumbIndex:_,range:M,dragging:O,marks:$,values:V,trackOffset:N,trackLeap:Ct,getThumbStyle:Ot}=Tr(Y({},dt,{rootRef:e}));dt.marked=$.length>0&&$.some(ot=>ot.label),dt.dragging=O,dt.focusedThumbIndex=_;const K=Nr(dt),bt=(s=(n=et==null?void 0:et.root)!=null?n:j.Root)!=null?s:Rr,ce=(o=(r=et==null?void 0:et.rail)!=null?r:j.Rail)!=null?o:Er,Is=(a=(l=et==null?void 0:et.track)!=null?l:j.Track)!=null?a:zr,Rs=(c=(h=et==null?void 0:et.thumb)!=null?h:j.Thumb)!=null?c:Fr,Es=(d=(u=et==null?void 0:et.valueLabel)!=null?u:j.ValueLabel)!=null?d:Hr,Fi=(f=(p=et==null?void 0:et.mark)!=null?p:j.Mark)!=null?f:Br,Hi=(g=(m=et==null?void 0:et.markLabel)!=null?m:j.MarkLabel)!=null?g:jr,zs=(b=(y=et==null?void 0:et.input)!=null?y:j.Input)!=null?b:"input",Bi=(k=it==null?void 0:it.root)!=null?k:rt.root,Xo=(S=it==null?void 0:it.rail)!=null?S:rt.rail,ji=(x=it==null?void 0:it.track)!=null?x:rt.track,Ni=(C=it==null?void 0:it.thumb)!=null?C:rt.thumb,Wi=(w=it==null?void 0:it.valueLabel)!=null?w:rt.valueLabel,Ko=(v=it==null?void 0:it.mark)!=null?v:rt.mark,qo=(P=it==null?void 0:it.markLabel)!=null?P:rt.markLabel,Go=(E=it==null?void 0:it.input)!=null?E:rt.input,Zo=Wt({elementType:bt,getSlotProps:Ii,externalSlotProps:Bi,externalForwardedProps:Ai,additionalProps:Y({},Or(bt)&&{as:Q}),ownerState:Y({},dt,Bi==null?void 0:Bi.ownerState),className:[K.root,Z]}),Qo=Wt({elementType:ce,externalSlotProps:Xo,ownerState:dt,className:K.rail}),Jo=Wt({elementType:Is,externalSlotProps:ji,additionalProps:{style:Y({},le[xe].offset(N),le[xe].leap(Ct))},ownerState:Y({},dt,ji==null?void 0:ji.ownerState),className:K.track}),$i=Wt({elementType:Rs,getSlotProps:Ei,externalSlotProps:Ni,ownerState:Y({},dt,Ni==null?void 0:Ni.ownerState),className:K.thumb}),tr=Wt({elementType:Es,externalSlotProps:Wi,ownerState:Y({},dt,Wi==null?void 0:Wi.ownerState),className:K.valueLabel}),Vi=Wt({elementType:Fi,externalSlotProps:Ko,ownerState:dt,className:K.mark}),Yi=Wt({elementType:Hi,externalSlotProps:qo,ownerState:dt,className:K.markLabel}),er=Wt({elementType:zs,getSlotProps:Ri,externalSlotProps:Go,ownerState:dt});return L.jsxs(bt,Y({},Zo,{children:[L.jsx(ce,Y({},Qo)),L.jsx(Is,Y({},Jo)),$.filter(ot=>ot.value>=ae&&ot.value<=re).map((ot,ct)=>{const Ui=xi(ot.value,ae,re),Ue=le[xe].offset(Ui);let Et;return wt===!1?Et=V.indexOf(ot.value)!==-1:Et=wt==="normal"&&(M?ot.value>=V[0]&&ot.value<=V[V.length-1]:ot.value<=V[0])||wt==="inverted"&&(M?ot.value<=V[0]||ot.value>=V[V.length-1]:ot.value>=V[0]),L.jsxs(I.Fragment,{children:[L.jsx(Fi,Y({"data-index":ct},Vi,!fi(Fi)&&{markActive:Et},{style:Y({},Ue,Vi.style),className:ue(Vi.className,Et&&K.markActive)})),ot.label!=null?L.jsx(Hi,Y({"aria-hidden":!0,"data-index":ct},Yi,!fi(Hi)&&{markLabelActive:Et},{style:Y({},Ue,Yi.style),className:ue(K.markLabel,Yi.className,Et&&K.markLabelActive),children:ot.label})):null]},ct)}),V.map((ot,ct)=>{const Ui=xi(ot,ae,re),Ue=le[xe].offset(Ui),Et=Nt==="off"?Wr:Es;return L.jsx(Et,Y({},!fi(Et)&&{valueLabelFormat:Mt,valueLabelDisplay:Nt,value:typeof Mt=="function"?Mt(Rt(ot),ct):Mt,index:ct,open:As===ct||zi===ct||Nt==="on",disabled:H},tr,{children:L.jsx(Rs,Y({"data-index":ct},$i,{className:ue(K.thumb,$i.className,zi===ct&&K.active,_===ct&&K.focusVisible),style:Y({},Ue,Ot(ct),$i.style),children:L.jsx(zs,Y({"data-index":ct,"aria-label":B?B(ct):G,"aria-valuenow":Rt(ot),"aria-labelledby":R,"aria-valuetext":ht?ht(Rt(ot),ct):nt,value:V[ct]},er))}))}),ct)})]}))});/*! + * @kurkle/color v0.3.4 + * https://github.com/kurkle/color#readme + * (c) 2024 Jukka Kurkela + * Released under the MIT License + */function We(i){return i+.5|0}const Ut=(i,t,e)=>Math.max(Math.min(i,e),t);function Me(i){return Ut(We(i*2.55),0,255)}function Xt(i){return Ut(We(i*255),0,255)}function Bt(i){return Ut(We(i/2.55)/100,0,1)}function Us(i){return Ut(We(i*100),0,100)}const xt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ns=[..."0123456789ABCDEF"],Vr=i=>ns[i&15],Yr=i=>ns[(i&240)>>4]+ns[i&15],Qe=i=>(i&240)>>4===(i&15),Ur=i=>Qe(i.r)&&Qe(i.g)&&Qe(i.b)&&Qe(i.a);function Xr(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&xt[i[1]]*17,g:255&xt[i[2]]*17,b:255&xt[i[3]]*17,a:t===5?xt[i[4]]*17:255}:(t===7||t===9)&&(e={r:xt[i[1]]<<4|xt[i[2]],g:xt[i[3]]<<4|xt[i[4]],b:xt[i[5]]<<4|xt[i[6]],a:t===9?xt[i[7]]<<4|xt[i[8]]:255})),e}const Kr=(i,t)=>i<255?t(i):"";function qr(i){var t=Ur(i)?Vr:Yr;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Kr(i.a,t):void 0}const Gr=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ro(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function Zr(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function Qr(i,t,e){const s=ro(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function Jr(i,t,e,s,n){return i===n?(t-e)/s+(t.5?h/(2-o-r):h/(o+r),l=Jr(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function xs(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(Xt)}function _s(i,t,e){return xs(ro,i,t,e)}function ta(i,t,e){return xs(Qr,i,t,e)}function ea(i,t,e){return xs(Zr,i,t,e)}function ao(i){return(i%360+360)%360}function ia(i){const t=Gr.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Me(+t[5]):Xt(+t[5]));const n=ao(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=ta(n,o,r):t[1]==="hsv"?s=ea(n,o,r):s=_s(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function sa(i,t){var e=bs(i);e[0]=ao(e[0]+t),e=_s(e),i.r=e[0],i.g=e[1],i.b=e[2]}function na(i){if(!i)return;const t=bs(i),e=t[0],s=Us(t[1]),n=Us(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${Bt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const Xs={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Ks={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function oa(){const i={},t=Object.keys(Ks),e=Object.keys(Xs);let s,n,o,r,a;for(s=0;s>16&255,o>>8&255,o&255]}return i}let Je;function ra(i){Je||(Je=oa(),Je.transparent=[0,0,0,0]);const t=Je[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const aa=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function la(i){const t=aa.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const r=+t[7];e=t[8]?Me(r):Ut(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Me(s):Ut(s,0,255)),n=255&(t[4]?Me(n):Ut(n,0,255)),o=255&(t[6]?Me(o):Ut(o,0,255)),{r:s,g:n,b:o,a:e}}}function ca(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Bt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const qi=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,he=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function ha(i,t,e){const s=he(Bt(i.r)),n=he(Bt(i.g)),o=he(Bt(i.b));return{r:Xt(qi(s+e*(he(Bt(t.r))-s))),g:Xt(qi(n+e*(he(Bt(t.g))-n))),b:Xt(qi(o+e*(he(Bt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function ti(i,t,e){if(i){let s=bs(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=_s(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function lo(i,t){return i&&Object.assign(t||{},i)}function qs(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=Xt(i[3]))):(t=lo(i,{r:0,g:0,b:0,a:1}),t.a=Xt(t.a)),t}function da(i){return i.charAt(0)==="r"?la(i):ia(i)}class ze{constructor(t){if(t instanceof ze)return t;const e=typeof t;let s;e==="object"?s=qs(t):e==="string"&&(s=Xr(t)||ra(t)||da(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=lo(this._rgb);return t&&(t.a=Bt(t.a)),t}set rgb(t){this._rgb=qs(t)}rgbString(){return this._valid?ca(this._rgb):void 0}hexString(){return this._valid?qr(this._rgb):void 0}hslString(){return this._valid?na(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=ha(this._rgb,t._rgb,e)),this}clone(){return new ze(this.rgb)}alpha(t){return this._rgb.a=Xt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=We(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ti(this._rgb,2,t),this}darken(t){return ti(this._rgb,2,-t),this}saturate(t){return ti(this._rgb,1,t),this}desaturate(t){return ti(this._rgb,1,-t),this}rotate(t){return sa(this._rgb,t),this}}/*! + * Chart.js v4.4.8 + * https://www.chartjs.org + * (c) 2025 Chart.js Contributors + * Released under the MIT License + */function zt(){}const ua=(()=>{let i=0;return()=>i++})();function J(i){return i==null}function at(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function U(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function kt(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function Dt(i,t){return kt(i)?i:t}function W(i,t){return typeof i>"u"?t:i}const fa=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function tt(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function q(i,t,e,s){let n,o,r;if(at(i))for(o=i.length,n=0;ni,x:i=>i.x,y:i=>i.y};function ma(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function ba(i){const t=ma(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function vi(i,t){return(Gs[t]||(Gs[t]=ba(t)))(i)}function ys(i){return i.charAt(0).toUpperCase()+i.slice(1)}const ki=i=>typeof i<"u",Kt=i=>typeof i=="function",Zs=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function xa(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const lt=Math.PI,It=2*lt,_a=It+lt,Si=Number.POSITIVE_INFINITY,ya=lt/180,Tt=lt/2,qt=lt/4,Qs=lt*2/3,os=Math.log10,ge=Math.sign;function Le(i,t,e){return Math.abs(i-t)n-o).pop(),t}function ka(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function He(i){return!ka(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function Sa(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function wa(i,t,e){let s,n,o;for(s=0,n=i.length;sl&&c=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function vs(i,t,e){e=e||(r=>i[r]1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const ee=(i,t,e,s)=>vs(i,e,s?n=>{const o=i[n][t];return oi[n][t]vs(i,e,s=>i[s][t]>=e);function Da(i,t,e){let s=0,n=i.length;for(;ss&&i[n-1]>e;)n--;return s>0||n{const s="_onData"+ys(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function en(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(uo.forEach(o=>{delete i[o]}),delete i._chartjs)}function Aa(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const fo=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function go(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,fo.call(window,()=>{s=!1,i.apply(t,e)}))}}function Ia(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const ks=i=>i==="start"?"left":i==="end"?"right":"center",ut=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Ra=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function Ea(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:r,vScale:a,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(n=Math.min(ee(l,h,d).lo,e?s:ee(t,h,r.getPixelForValue(d)).lo),c){const g=l.slice(0,n+1).reverse().findIndex(m=>!J(m[a.axis]));n-=Math.max(0,g)}n=yt(n,0,s-1)}if(p){let g=Math.max(ee(l,r.axis,u,!0).hi+1,e?0:ee(t,h,r.getPixelForValue(u),!0).hi+1);if(c){const m=l.slice(g-1).findIndex(b=>!J(b[a.axis]));g+=Math.max(0,m)}o=yt(g,n,s)-n}else o=s-n}return{start:n,count:o}}function za(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const ei=i=>i===0||i===1,sn=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*It/e)),nn=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*It/e)+1,Ae={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*Tt)+1,easeOutSine:i=>Math.sin(i*Tt),easeInOutSine:i=>-.5*(Math.cos(lt*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>ei(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>ei(i)?i:sn(i,.075,.3),easeOutElastic:i=>ei(i)?i:nn(i,.075,.3),easeInOutElastic(i){return ei(i)?i:i<.5?.5*sn(i*2,.1125,.45):.5+.5*nn(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Ae.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Ae.easeInBounce(i*2)*.5:Ae.easeOutBounce(i*2-1)*.5+.5};function Ss(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function on(i){return Ss(i)?i:new ze(i)}function Gi(i){return Ss(i)?i:new ze(i).saturate(.5).darken(.1).hexString()}const Fa=["x","y","borderWidth","radius","tension"],Ha=["color","borderColor","backgroundColor"];function Ba(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:Ha},numbers:{type:"number",properties:Fa}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function ja(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const rn=new Map;function Na(i,t){t=t||{};const e=i+JSON.stringify(t);let s=rn.get(e);return s||(s=new Intl.NumberFormat(i,t),rn.set(e,s)),s}function po(i,t,e){return Na(t,e).format(i)}const mo={values(i){return at(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=Wa(i,e)}const r=os(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),po(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";const s=e[t].significand||i/Math.pow(10,Math.floor(os(i)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?mo.numeric.call(this,i,t,e):""}};function Wa(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var bo={formatters:mo};function $a(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:bo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const se=Object.create(null),as=Object.create(null);function Ie(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;ss.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>Gi(n.backgroundColor),this.hoverBorderColor=(s,n)=>Gi(n.borderColor),this.hoverColor=(s,n)=>Gi(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Zi(this,t,e)}get(t){return Ie(this,t)}describe(t,e){return Zi(as,t,e)}override(t,e){return Zi(se,t,e)}route(t,e,s,n){const o=Ie(this,t),r=Ie(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return U(l)?Object.assign({},c,l):W(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var st=new Va({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ba,ja,$a]);function Ya(i){return!i||J(i.size)||J(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function an(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function Gt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function ln(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function ls(i,t,e,s){xo(i,t,e,s,null)}function xo(i,t,e,s,n){let o,r,a,l,c,h,d,u;const f=t.pointStyle,p=t.rotation,g=t.radius;let m=(p||0)*ya;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(m),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(g)||g<=0)){switch(i.beginPath(),f){default:n?i.ellipse(e,s,n/2,g,0,0,It):i.arc(e,s,g,0,It),i.closePath();break;case"triangle":h=n?n/2:g,i.moveTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=Qs,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=Qs,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),i.closePath();break;case"rectRounded":c=g*.516,l=g-c,r=Math.cos(m+qt)*l,d=Math.cos(m+qt)*(n?n/2-c:l),a=Math.sin(m+qt)*l,u=Math.sin(m+qt)*(n?n/2-c:l),i.arc(e-d,s-a,c,m-lt,m-Tt),i.arc(e+u,s-r,c,m-Tt,m),i.arc(e+d,s+a,c,m,m+Tt),i.arc(e-u,s+r,c,m+Tt,m+lt),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}m+=qt;case"rectRot":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+u,s-r),i.lineTo(e+d,s+a),i.lineTo(e-u,s+r),i.closePath();break;case"crossRot":m+=qt;case"cross":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r);break;case"star":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r),m+=qt,d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r);break;case"line":r=n?n/2:Math.cos(m)*g,a=Math.sin(m)*g,i.moveTo(e-r,s-a),i.lineTo(e+r,s+a);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function Be(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,Ka(i,o),l=0;l+i||0;function _o(i,t){const e={},s=U(t),n=s?Object.keys(t):t,o=U(i)?s?r=>W(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=tl(o(r));return e}function el(i){return _o(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Re(i){return _o(i,["topLeft","topRight","bottomLeft","bottomRight"])}function St(i){const t=el(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ft(i,t){i=i||{},t=t||st.font;let e=W(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=W(i.style,t.style);s&&!(""+s).match(Qa)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:W(i.family,t.family),lineHeight:Ja(W(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:W(i.weight,t.weight),string:""};return n.string=Ya(n),n}function ii(i,t,e,s){let n,o,r;for(n=0,o=i.length;ne&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function oe(i,t){return Object.assign(Object.create(i),t)}function Cs(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=So("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:a=>Cs([a,...i],t,o,s)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return vo(a,l,()=>hl(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return hn(a).includes(l)},ownKeys(a){return hn(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function pe(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:yo(i,s),setContext:o=>pe(i,o,e,s),override:o=>pe(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return vo(o,r,()=>nl(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function yo(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:Kt(e)?e:()=>e,isIndexable:Kt(s)?s:()=>s}}const sl=(i,t)=>i?i+ys(t):t,Ps=(i,t)=>U(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function vo(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function nl(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return Kt(a)&&r.isScriptable(t)&&(a=ol(t,a,i,e)),at(a)&&a.length&&(a=rl(t,a,i,r.isIndexable)),Ps(t,a)&&(a=pe(a,n,o&&o[t],r)),a}function ol(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||s);return a.delete(i),Ps(i,l)&&(l=Ts(n._scopes,n,i,l)),l}function rl(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(U(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=Ts(c,n,i,h);t.push(pe(d,o,r&&r[i],a))}}return t}function ko(i,t,e){return Kt(i)?i(t,e):i}const al=(i,t)=>i===!0?t:typeof i=="string"?vi(t,i):void 0;function ll(i,t,e,s,n){for(const o of t){const r=al(e,o);if(r){i.add(r);const a=ko(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==s)return a}else if(r===!1&&typeof s<"u"&&e!==s)return null}return!1}function Ts(i,t,e,s){const n=t._rootScopes,o=ko(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=cn(a,r,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=cn(a,r,o,l,s),l===null)?!1:Cs(Array.from(a),[""],n,o,()=>cl(t,e,s))}function cn(i,t,e,s,n){for(;e;)e=ll(i,t,e,s,n);return e}function cl(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return at(n)&&U(e)?e:n||{}}function hl(i,t,e,s){let n;for(const o of t)if(n=So(sl(o,i),e),typeof n<"u")return Ps(i,n)?Ts(e,s,i,n):n}function So(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function hn(i){let t=i._keys;return t||(t=i._keys=dl(i._scopes)),t}function dl(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}const ul=Number.EPSILON||1e-14,me=(i,t)=>ti==="x"?"y":"x";function fl(i,t,e,s){const n=i.skip?t:i,o=t,r=e.skip?t:e,a=rs(o,n),l=rs(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,u=s*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function gl(i,t,e){const s=i.length;let n,o,r,a,l,c=me(i,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")ml(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,r=i.length;oi.ownerDocument.defaultView.getComputedStyle(i,null);function _l(i,t){return Pi(i).getPropertyValue(t)}const yl=["top","right","bottom","left"];function ie(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=yl[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const vl=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function kl(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(vl(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Qt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Pi(e),o=n.boxSizing==="border-box",r=ie(n,"padding"),a=ie(n,"border","width"),{x:l,y:c,box:h}=kl(i,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=t;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*e.width/s),y:Math.round((c-u)/p*e.height/s)}}function Sl(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&Ds(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Pi(o),l=ie(a,"border","width"),c=ie(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=wi(a.maxWidth,o,"clientWidth"),n=wi(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||Si,maxHeight:n||Si}}const ni=i=>Math.round(i*10)/10;function wl(i,t,e,s){const n=Pi(i),o=ie(n,"margin"),r=wi(n.maxWidth,i,"clientWidth")||Si,a=wi(n.maxHeight,i,"clientHeight")||Si,l=Sl(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const u=ie(n,"border","width"),f=ie(n,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=ni(Math.min(c,r,l.maxWidth)),h=ni(Math.min(h,a,l.maxHeight)),c&&!h&&(h=ni(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=ni(Math.floor(h*s))),{width:c,height:h}}function dn(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Ml=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Os()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function un(i,t){const e=_l(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Jt(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Cl(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Pl(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=Jt(i,n,e),a=Jt(n,o,e),l=Jt(o,t,e),c=Jt(r,a,e),h=Jt(a,l,e);return Jt(c,h,e)}const Tl=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Ol=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function fe(i,t,e){return i?Tl(t,e):Ol()}function Mo(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Co(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Po(i){return i==="angle"?{between:ho,compare:Pa,normalize:Vt}:{between:Ce,compare:(t,e)=>t-e,normalize:t=>t}}function fn({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function Dl(i,t,e){const{property:s,start:n,end:o}=e,{between:r,normalize:a}=Po(s),l=t.length;let{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;ul(n,k,b)&&a(n,k)!==0,x=()=>a(o,b)===0||l(o,k,b),C=()=>g||S(),w=()=>!g||x();for(let v=h,P=h;v<=d;++v)y=t[v%r],!y.skip&&(b=c(y[s]),b!==k&&(g=l(b,n,o),m===null&&C()&&(m=a(b,n)===0?v:P),m!==null&&w()&&(p.push(fn({start:m,end:v,loop:u,count:r,style:f})),m=null),P=v,k=b));return m!==null&&p.push(fn({start:m,end:d,loop:u,count:r,style:f})),p}function Al(i,t){const e=[],s=i.segments;for(let n=0;nn&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function Rl(i,t,e,s){const n=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?a.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:s}),o}function El(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:r,end:a}=Il(e,n,o,s);if(s===!0)return gn(i,[{start:r,end:a,loop:o}],e,t);const l=aa({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=fo.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ft=new Hl;const mn="transparent",Bl={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=on(i||mn),n=s.valid&&on(t||mn);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class jl{constructor(t,e,s,n){const o=e[s];n=ii([t.to,n,o,t.from]);const r=ii([t.from,o,n]);this._active=!0,this._fn=t.fn||Bl[t.type||typeof r],this._easing=Ae[t.easing]||Ae.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ii([t.to,e,n,t.from]),this._from=ii([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n{const o=t[n];if(!U(o))return;const r={};for(const a of e)r[a]=o[a];(at(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=Wl(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&Nl(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new jl(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return Ft.add(this._chart,s),!0}}function Nl(i,t){const e=[],s=Object.keys(t);for(let n=0;n0||!e&&o<0)return n.index}return null}function yn(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=Ul(o,r,s),d=t.length;let u;for(let f=0;fe[s].axis===t).shift()}function ql(i,t){return oe(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Gl(i,t,e){return oe(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ye(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const ts=i=>i==="reset"||i==="none",vn=(i,t)=>t?i:Object.assign({},i),Zl=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Oo(e,!0),values:null};class Ee{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Qi(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ye(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,u,f,p)=>d==="x"?u:d==="r"?p:f,o=e.xAxisID=W(s.xAxisID,Ji(t,"x")),r=e.yAxisID=W(s.yAxisID,Ji(t,"y")),a=e.rAxisID=W(s.rAxisID,Ji(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&en(this._data,this),t._stacked&&ye(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(U(e)){const n=this._cachedMeta;this._data=Yl(e,n)}else if(s!==e){if(s){en(s,this);const n=this._cachedMeta;ye(n),n._parsed=[]}e&&Object.isExtensible(e)&&La(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Qi(e.vScale,e),e.stack!==s.stack&&(n=!0,ye(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(yn(this,e._parsed),e._stacked=Qi(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,u;if(this._parsing===!1)s._parsed=n,s._sorted=!0,u=n;else{at(n[t])?u=this.parseArrayData(s,n,t,e):U(n[t])?u=this.parseObjectData(s,n,t,e):u=this.parsePrimitiveData(s,n,t,e);const f=()=>d[a]===null||c&&d[a]g||d=0;--u)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n=0&&tthis.getContext(s,n,e),g=c.resolveNamedOptions(u,f,p,d);return g.$shared&&(g.$shared=l,o[r]=Object.freeze(vn(g,l))),g}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,s,e))}const c=new To(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ts(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){ts(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!ts(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a0&&this.getParsed(e-1);for(let x=0;x=y){w.skip=!0;continue}const v=this.getParsed(x),P=J(v[f]),E=w[u]=r.getPixelForValue(v[u],x),D=w[f]=o||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,v,l):v[f],x);w.skip=isNaN(E)||isNaN(D)||P,w.stop=x>0&&Math.abs(v[u]-S[u])>m,g&&(w.parsed=v,w.raw=c.data[x]),d&&(w.options=h||this.resolveDataElementOptions(x,C.active?"active":n)),b||this.updateElement(C,x,w,n),S=v}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}F(gi,"id","line"),F(gi,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),F(gi,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Zt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ls{constructor(t){F(this,"options");this.options=t||{}}static override(t){Object.assign(Ls.prototype,t)}init(){}formats(){return Zt()}parse(){return Zt()}format(){return Zt()}add(){return Zt()}diff(){return Zt()}startOf(){return Zt()}endOf(){return Zt()}}var Ql={_date:Ls};function Jl(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?Oa:ee;if(s){if(n._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const u=c(o,t,e-d),f=c(o,t,e+d);return{lo:u.lo,hi:f.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=n._cachedMeta,{_parsed:u}=i,f=u.slice(0,h.lo+1).reverse().findIndex(g=>!J(g[d.axis]));h.lo-=Math.max(0,f);const p=u.slice(h.hi).findIndex(g=>!J(g[d.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function $e(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a{l[r]&&l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var sc={evaluateInteractionItems:$e,modes:{index(i,t,e,s){const n=Qt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?es(i,n,o,s,r):is(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=Qt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?es(i,n,o,s,r):is(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;he.pos===t)}function Sn(i,t){return i.filter(e=>Do.indexOf(e.pos)===-1&&e.box.axis===t)}function ke(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function nc(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;ec.box.fullSize),!0),s=ke(ve(t,"left"),!0),n=ke(ve(t,"right")),o=ke(ve(t,"top"),!0),r=ke(ve(t,"bottom")),a=Sn(t,"x"),l=Sn(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:ve(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function wn(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function Lo(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function lc(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!U(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&Lo(r,o.getPadding());const a=Math.max(0,t.outerWidth-wn(r,i,"left","right")),l=Math.max(0,t.outerHeight-wn(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function cc(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function hc(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function Pe(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},n);Lo(u,St(s));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),p=rc(l.concat(c),d);Pe(a.fullSize,f,d,p),Pe(l,f,d,p),Pe(c,f,d,p)&&Pe(l,f,d,p),cc(f),Mn(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,Mn(a.rightAndBottom,f,d,p),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},q(a.chartArea,g=>{const m=g.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Ao{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class dc extends Ao{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pi="$chartjs",uc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Cn=i=>i===null||i==="";function fc(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[pi]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Cn(n)){const o=un(i,"width");o!==void 0&&(i.width=o)}if(Cn(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=un(i,"height");o!==void 0&&(i.height=o)}return i}const Io=Ml?{passive:!0}:!1;function gc(i,t,e){i&&i.addEventListener(t,e,Io)}function pc(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,Io)}function mc(i,t){const e=uc[i.type]||i.type,{x:s,y:n}=Qt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Mi(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function bc(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Mi(a.addedNodes,s),r=r&&!Mi(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function xc(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Mi(a.removedNodes,s),r=r&&!Mi(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Ne=new Map;let Pn=0;function Ro(){const i=window.devicePixelRatio;i!==Pn&&(Pn=i,Ne.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function _c(i,t){Ne.size||window.addEventListener("resize",Ro),Ne.set(i,t)}function yc(i){Ne.delete(i),Ne.size||window.removeEventListener("resize",Ro)}function vc(i,t,e){const s=i.canvas,n=s&&Ds(s);if(!n)return;const o=go((a,l)=>{const c=n.clientWidth;e(a,l),c{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),_c(i,o),r}function ss(i,t,e){e&&e.disconnect(),t==="resize"&&yc(i)}function kc(i,t,e){const s=i.canvas,n=go(o=>{i.ctx!==null&&e(mc(o,i))},i);return gc(s,t,n),n}class Sc extends Ao{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(fc(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[pi])return!1;const s=e[pi].initial;["height","width"].forEach(o=>{const r=s[o];J(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[pi],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:bc,detach:xc,resize:vc}[e]||kc;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:ss,detach:ss,resize:ss}[e]||pc)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return wl(t,e,s,n)}isAttached(t){const e=t&&Ds(t);return!!(e&&e.isConnected)}}function wc(i){return!Os()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?dc:Sc}class jt{constructor(){F(this,"x");F(this,"y");F(this,"active",!1);F(this,"options");F(this,"$animations")}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return He(this.x)&&He(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}F(jt,"defaults",{}),F(jt,"defaultRoutes");function Mc(i,t){const e=i.options.ticks,s=Cc(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Tc(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return Oc(t,c,o,r/n),c;const h=Pc(o,t,n);if(r>0){let d,u;const f=r>1?Math.round((l-a)/(r-1)):null;for(ri(t,c,h,J(f)?0:a-f,a),d=0,u=r-1;dn)return l}return Math.max(n,1)}function Tc(i){const t=[];let e,s;for(e=0,s=i.length;ei==="left"?"right":i==="right"?"left":i,Tn=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,On=(i,t)=>Math.min(t||i,i);function Dn(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;or+a)))return l}function Ic(i,t){q(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;os?s:e,s=n&&e>s?e:s,{min:Dt(e,Dt(s,e)),max:Dt(s,Dt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){tt(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=il(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=yt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),d+6>a&&(a=f/(s-(t.offset?.5:1)),l=this.maxHeight-Se(t.grid)-e.padding-Ln(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=Ma(Math.min(Math.asin(yt((h.highest.height+6)/a,-1,1)),Math.asin(yt(l/c,-1,1))-Math.asin(yt(u/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){tt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){tt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Ln(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Se(o)+l):(t.height=this.maxHeight,t.width=Se(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,p=te(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(a){const b=s.mirror?0:m*d.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=s.mirror?0:g*d.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,m,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=n*t.width,f=s*e.height):(u=s*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){tt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e({width:r[P]||0,height:a[P]||0});return{first:v(0),last:v(e-1),widest:v(C),highest:v(w),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Ta(this._alignToPixels?Gt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*n?a/s:l/n:l*n0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=Se(o),f=[],p=a.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(Q){return Gt(s,Q,g)};let y,k,S,x,C,w,v,P,E,D,z,G;if(r==="top")y=b(this.bottom),w=this.bottom-u,P=y-m,D=b(t.top)+m,G=t.bottom;else if(r==="bottom")y=b(this.top),D=t.top,G=b(t.bottom)-m,w=y+m,P=this.top+u;else if(r==="left")y=b(this.right),C=this.right-u,v=y-m,E=b(t.left)+m,z=t.right;else if(r==="right")y=b(this.left),E=t.left,z=b(t.right)-m,C=y+m,v=this.left+u;else if(e==="x"){if(r==="center")y=b((t.top+t.bottom)/2+.5);else if(U(r)){const Q=Object.keys(r)[0],j=r[Q];y=b(this.chart.scales[Q].getPixelForValue(j))}D=t.top,G=t.bottom,w=y+m,P=w+u}else if(e==="y"){if(r==="center")y=b((t.left+t.right)/2);else if(U(r)){const Q=Object.keys(r)[0],j=r[Q];y=b(this.chart.scales[Q].getPixelForValue(j))}C=y-m,v=C-u,E=t.left,z=t.right}const nt=W(n.ticks.maxTicksLimit,d),R=Math.max(1,Math.ceil(d/nt));for(k=0;k0&&(gt-=B/2);break}Z={left:gt,top:ht,width:B+X.width,height:H+X.height,color:R.backdropColor}}m.push({label:S,font:P,textOffset:z,options:{rotation:g,color:j,strokeColor:rt,strokeWidth:A,textAlign:T,textBaseline:G,translation:[x,C],backdrop:Z}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-te(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");st.route(o,n,l,a)})}function jc(i){return"id"in i&&"defaults"in i}class Nc{constructor(){this.controllers=new ai(Ee,"datasets",!0),this.elements=new ai(jt,"elements"),this.plugins=new ai(Object,"plugins"),this.scales=new ai(be,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):q(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=ys(t);tt(s["before"+n],[],s),e[t](s),tt(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;eo.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function $c(i){const t={},e=[],s=Object.keys(At.plugins.items);for(let o=0;o1&&An(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function In(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Gc(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return In(i,"x",e[0])||In(i,"y",e[0])}return{}}function Zc(i,t){const e=se[i.type]||{scales:{}},s=t.scales||{},n=hs(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!U(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=ds(r,a,Gc(r,i),st.scales[a.type]),c=Kc(l,n),h=e.scales||{};o[r]=De(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||hs(a,t),h=(se[a]||{}).scales||{};Object.keys(h).forEach(d=>{const u=Xc(d,l),f=r[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),De(o[f],[{axis:u},s[f],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];De(a,[st.scales[a.type],st.scale])}),o}function Eo(i){const t=i.options||(i.options={});t.plugins=W(t.plugins,{}),t.scales=Zc(i,t)}function zo(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Qc(i){return i=i||{},i.data=zo(i.data),Eo(i),i}const Rn=new Map,Fo=new Set;function li(i,t){let e=Rn.get(i);return e||(e=t(),Rn.set(i,e),Fo.add(e)),e}const we=(i,t,e)=>{const s=vi(t,e);s!==void 0&&i.add(s)};class Jc{constructor(t){this._config=Qc(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=zo(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Eo(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return li(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return li(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return li(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return li(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>we(l,t,d))),h.forEach(d=>we(l,n,d)),h.forEach(d=>we(l,se[o]||{},d)),h.forEach(d=>we(l,st,d)),h.forEach(d=>we(l,as,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Fo.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,se[e]||{},st.datasets[e]||{},{type:e},st,as]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=En(this._resolverCache,t,n);let l=r;if(eh(r,e)){o.$shared=!1,s=Kt(s)?s():s;const c=this.createResolver(t,s,a);l=pe(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=En(this._resolverCache,t,s);return U(e)?pe(o,e,void 0,n):o}}function En(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:Cs(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const th=i=>U(i)&&Object.getOwnPropertyNames(i).some(t=>Kt(i[t]));function eh(i,t){const{isScriptable:e,isIndexable:s}=yo(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(Kt(a)||th(a))||r&&at(a))return!0}return!1}var ih="4.4.8";const sh=["top","bottom","left","right","chartArea"];function zn(i,t){return i==="top"||i==="bottom"||sh.indexOf(i)===-1&&t==="x"}function Fn(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Hn(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),tt(e&&e.onComplete,[i],t)}function nh(i){const t=i.chart,e=t.options.animation;tt(e&&e.onProgress,[i],t)}function Ho(i){return Os()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const mi={},Bn=i=>{const t=Ho(i);return Object.values(mi).filter(e=>e.canvas===t).pop()};function oh(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function rh(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}function ci(i,t,e){return i.options.clip?i[e]:t[e]}function ah(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:ci(e,t,"left"),right:ci(e,t,"right"),top:ci(s,t,"top"),bottom:ci(s,t,"bottom")}:t}var $t;let Ti=($t=class{static register(...t){At.add(...t),jn()}static unregister(...t){At.remove(...t),jn()}constructor(t,e){const s=this.config=new Jc(e),n=Ho(t),o=Bn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||wc(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=ua(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Wc,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ia(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],mi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ft.listen(this,"complete",Hn),Ft.listen(this,"progress",nh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return J(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return At}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():dn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ln(this.canvas,this.ctx),this}stop(){return Ft.stop(this),this}resize(t,e){Ft.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,dn(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),tt(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};q(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=ds(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),q(o,r=>{const a=r.options,l=a.id,c=ds(l,a),h=W(a.type,r.dtype);(a.position===void 0||zn(a.position,c)!==zn(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const u=At.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),q(n,(r,a)=>{r||delete s[a]}),q(s,r=>{vt.configure(this,r,r.options),vt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Fn("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){q(this.scales,t=>{vt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Zs(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;oh(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;vt.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],q(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,n=!s.disabled,o=ah(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&ws(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&Ms(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Be(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=sc.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=oe(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);ki(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Ft.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};q(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){q(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},q(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!_i(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=xa(t),c=rh(t,this._lastEvent,s,l);s&&(this._lastEvent=null,tt(o.onHover,[t,a,this],this),l&&tt(o.onClick,[t,a,this],this));const h=!_i(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}},F($t,"defaults",st),F($t,"instances",mi),F($t,"overrides",se),F($t,"registry",At),F($t,"version",ih),F($t,"getChart",Bn),$t);function jn(){return q(Ti.instances,i=>i._plugins.invalidate())}function Bo(i,t,e=t){i.lineCap=W(e.borderCapStyle,t.borderCapStyle),i.setLineDash(W(e.borderDash,t.borderDash)),i.lineDashOffset=W(e.borderDashOffset,t.borderDashOffset),i.lineJoin=W(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=W(e.borderWidth,t.borderWidth),i.strokeStyle=W(e.borderColor,t.borderColor)}function lh(i,t,e){i.lineTo(e.x,e.y)}function ch(i){return i.stepped?Ua:i.tension||i.cubicInterpolationMode==="monotone"?Xa:lh}function jo(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=na&&o>a;return{count:s,start:l,loop:t.loop,ilen:c(r+(c?a-S:S))%o,k=()=>{g!==m&&(i.lineTo(h,m),i.lineTo(h,g),i.lineTo(h,b))};for(l&&(f=n[y(0)],i.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=n[y(u)],f.skip)continue;const S=f.x,x=f.y,C=S|0;C===p?(xm&&(m=x),h=(d*h+S)/++d):(k(),i.lineTo(S,x),p=C,d=0,g=m=x),b=x}k()}function us(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?dh:hh}function uh(i){return i.stepped?Cl:i.tension||i.cubicInterpolationMode==="monotone"?Pl:Jt}function fh(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Bo(i,t.options),i.stroke(n)}function gh(i,t,e,s){const{segments:n,options:o}=t,r=us(t);for(const a of n)Bo(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const ph=typeof Path2D=="function";function mh(i,t,e,s){ph&&!t.options.segment?fh(i,t,e,s):gh(i,t,e,s)}class Te extends jt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;xl(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=El(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,r=Al(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=uh(s);let c,h;for(c=0,h=r.length;ct!=="borderDash"&&t!=="fill"});function Nn(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o){let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},bh=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class $n extends jt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=tt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=ft(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Wn(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((p,g)=>{const m=s+e/2+o.measureText(p.text).width;(g===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(g>0?0:1)]=0,f+=h,u++),l[g]={left:0,top:f,row:u,width:m,height:n},c[c.length-1]+=m+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,u=0,f=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:y,itemHeight:k}=xh(s,e,o,m,n);b>0&&f+k+2*a>h&&(d+=u+a,c.push({width:u,height:f}),p+=u+a,g++,u=f=0),l[b]={left:p,top:f,col:g,width:y,height:k},u=Math.max(u,y),f+=k+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=fe(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=ut(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=ut(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=ut(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=ut(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ws(t,this),this._draw(),Ms(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=st.color,l=fe(t.rtl,this.left,this.width),c=ft(r.font),{padding:h}=r,d=c.size,u=d/2;let f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=Wn(r,d),b=function(C,w,v){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();const P=W(v.lineWidth,1);if(n.fillStyle=W(v.fillStyle,a),n.lineCap=W(v.lineCap,"butt"),n.lineDashOffset=W(v.lineDashOffset,0),n.lineJoin=W(v.lineJoin,"miter"),n.lineWidth=P,n.strokeStyle=W(v.strokeStyle,a),n.setLineDash(W(v.lineDash,[])),r.usePointStyle){const E={radius:g*Math.SQRT2/2,pointStyle:v.pointStyle,rotation:v.rotation,borderWidth:P},D=l.xPlus(C,p/2),z=w+u;xo(n,E,D,z,r.pointStyleWidth&&p)}else{const E=w+Math.max((d-g)/2,0),D=l.leftForLtr(C,p),z=Re(v.borderRadius);n.beginPath(),Object.values(z).some(G=>G!==0)?cs(n,{x:D,y:E,w:p,h:g,radius:z}):n.rect(D,E,p,g),n.fill(),P!==0&&n.stroke()}n.restore()},y=function(C,w,v){je(n,v.text,C,w+m/2,c,{strikethrough:v.hidden,textAlign:l.textAlign(v.textAlign)})},k=this.isHorizontal(),S=this._computeTitleHeight();k?f={x:ut(o,this.left+h,this.right-s[0]),y:this.top+h+S,line:0}:f={x:this.left+h,y:ut(o,this.top+S+h,this.bottom-e[0].height),line:0},Mo(this.ctx,t.textDirection);const x=m+h;this.legendItems.forEach((C,w)=>{n.strokeStyle=C.fontColor,n.fillStyle=C.fontColor;const v=n.measureText(C.text).width,P=l.textAlign(C.textAlign||(C.textAlign=r.textAlign)),E=p+u+v;let D=f.x,z=f.y;l.setWidth(this.width),k?w>0&&D+E+h>this.right&&(z=f.y+=x,f.line++,D=f.x=ut(o,this.left+h,this.right-s[f.line])):w>0&&z+x>this.bottom&&(D=f.x=D+e[f.line].width+h,f.line++,z=f.y=ut(o,this.top+S+h,this.bottom-e[f.line].height));const G=l.x(D);if(b(G,z,C),D=Ra(P,D+p+u,k?D+E:this.right,t.rtl),y(l.x(D),z,C),k)f.x+=E+h;else if(typeof C.text!="string"){const nt=c.lineHeight;f.y+=No(C,nt)+h}else f.y+=x}),Co(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=ft(e.font),n=St(e.padding);if(!e.display)return;const o=fe(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=ut(t.align,d,this.right-u);else{const p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);h=c+ut(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=ut(a,d,d+u);r.textAlign=o.textAlign(ks(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,je(r,e.text,f,h,s)}_computeTitleHeight(){const t=this.options.title,e=ft(t.font),s=St(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(Ce(t,this.left,this.right)&&Ce(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;so.length>r.length?o:r)),t+e.size/2+s.measureText(n).width}function yh(i,t,e){let s=i;return typeof t.text!="string"&&(s=No(t,e)),s}function No(i,t){const e=i.text?i.text.length:0;return t*e}function vh(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var kh={id:"legend",_element:$n,start(i,t,e){const s=i.legend=new $n({ctx:i.ctx,options:e,chart:i});vt.configure(i,s,e),vt.addBox(i,s)},stop(i){vt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;vt.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=St(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class Wo extends jt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=at(s.text)?s.text.length:1;this._padding=St(s.padding);const o=n*ft(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=ut(a,s,o),d=e+t,c=o-s):(r.position==="left"?(h=s+t,d=ut(a,n,e),l=lt*-.5):(h=o-t,d=ut(a,e,n),l=lt*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=ft(e.font),o=s.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);je(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:ks(e.align),textBaseline:"middle",translation:[r,a]})}}function Sh(i,t){const e=new Wo({ctx:i.ctx,options:t,chart:i});vt.configure(i,e,t),vt.addBox(i,e),i.titleBlock=e}var wh={id:"title",_element:Wo,start(i,t,e){Sh(i,e)},stop(i){const t=i.titleBlock;vt.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;vt.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Oe={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;ta+l)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o-1?i.split(` +`):i}function Mh(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function Vn(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=ft(t.bodyFont),c=ft(t.titleFont),h=ft(t.footerFont),d=o.length,u=n.length,f=s.length,p=St(t.padding);let g=p.height,m=0,b=s.reduce((S,x)=>S+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*S+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}u&&(g+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const k=function(S){m=Math.max(m,e.measureText(S).width+y)};return e.save(),e.font=c.string,q(i.title,k),e.font=l.string,q(i.beforeBody.concat(i.afterBody),k),y=t.displayColors?r+2+t.boxPadding:0,q(s,S=>{q(S.before,k),q(S.lines,k),q(S.after,k)}),y=0,e.font=h.string,q(i.footer,k),e.restore(),m+=p.width,{width:m,height:g}}function Ch(i,t){const{y:e,height:s}=t;return ei.height-s/2?"bottom":"center"}function Ph(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function Th(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),Ph(c,i,t,e)&&(c="center"),c}function Yn(i,t,e){const s=e.yAlign||t.yAlign||Ch(i,e);return{xAlign:e.xAlign||t.xAlign||Th(i,t,e,s),yAlign:s}}function Oh(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Dh(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Un(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Re(r);let p=Oh(t,a);const g=Dh(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,u)+n:a==="right"&&(p+=Math.max(d,f)+n),{x:yt(p,0,s.width-t.width),y:yt(g,0,s.height-t.height)}}function hi(i,t,e){const s=St(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Xn(i){return Lt([],Ht(i))}function Lh(i,t,e){return oe(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Kn(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const $o={beforeTitle:zt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex"u"?$o[t].call(e,s):n}class fs extends jt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new To(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Lh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=pt(s,"beforeTitle",this,t),o=pt(s,"title",this,t),r=pt(s,"afterTitle",this,t);let a=[];return a=Lt(a,Ht(n)),a=Lt(a,Ht(o)),a=Lt(a,Ht(r)),a}getBeforeBody(t,e){return Xn(pt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return q(t,o=>{const r={before:[],lines:[],after:[]},a=Kn(s,o);Lt(r.before,Ht(pt(a,"beforeLabel",this,o))),Lt(r.lines,pt(a,"label",this,o)),Lt(r.after,Ht(pt(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return Xn(pt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=pt(s,"beforeFooter",this,t),o=pt(s,"footer",this,t),r=pt(s,"afterFooter",this,t);let a=[];return a=Lt(a,Ht(n)),a=Lt(a,Ht(o)),a=Lt(a,Ht(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;lt.filter(h,d,u,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),q(a,h=>{const d=Kn(t.callbacks,h);n.push(pt(d,"labelColor",this,h)),o.push(pt(d,"labelPointStyle",this,h)),r.push(pt(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=Oe[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=Vn(this,s),c=Object.assign({},a,l),h=Yn(this.chart,s,c),d=Un(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Re(a),{x:u,y:f}=t,{width:p,height:g}=e;let m,b,y,k,S,x;return o==="center"?(S=f+g/2,n==="left"?(m=u,b=m-r,k=S+r,x=S-r):(m=u+p,b=m+r,k=S-r,x=S+r),y=m):(n==="left"?b=u+Math.max(l,h)+r:n==="right"?b=u+p-Math.max(c,d)-r:b=this.caretX,o==="top"?(k=f,S=k-r,m=b-r,y=b+r):(k=f+g,S=k+r,m=b+r,y=b-r),x=k),{x1:m,x2:b,x3:y,y1:k,y2:S,y3:x}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=fe(s.rtl,this.x,this.width);for(t.x=hi(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=ft(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,cs(t,{x:g,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),cs(t,{x:m,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,c,l),t.strokeRect(g,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=ft(s.bodyFont);let u=d.lineHeight,f=0;const p=fe(s.rtl,this.x,this.width),g=function(v){e.fillText(v,p.x(t.x+f),t.y+u/2),t.y+=u+o},m=p.textAlign(r);let b,y,k,S,x,C,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=hi(this,m,s),e.fillStyle=s.bodyColor,q(this.beforeBody,g),f=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,S=0,C=n.length;S0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=Oe[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Vn(this,t),l=Object.assign({},r,this._size),c=Yn(e,t,l),h=Un(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=St(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),Mo(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Co(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!_i(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!_i(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=Oe[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}F(fs,"positioners",Oe);var Ah={id:"tooltip",_element:fs,positioners:Oe,afterInit(i,t,e){e&&(i.tooltip=new fs({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:$o},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Ih=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Rh(i,t,e,s){const n=i.indexOf(t);if(n===-1)return Ih(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const Eh=(i,t)=>i===null?null:yt(Math.round(i),0,t);function qn(i){const t=this.getLabels();return i>=0&&ie.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}F(gs,"id","category"),F(gs,"defaults",{ticks:{callback:qn}});function zh(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,p=h-1,{min:g,max:m}=t,b=!J(r),y=!J(a),k=!J(c),S=(m-g)/(d+1);let x=Js((m-g)/p/f)*f,C,w,v,P;if(x<1e-14&&!b&&!y)return[{value:g},{value:m}];P=Math.ceil(m/x)-Math.floor(g/x),P>p&&(x=Js(P*x/p/f)*f),J(l)||(C=Math.pow(10,l),x=Math.ceil(x*C)/C),n==="ticks"?(w=Math.floor(g/x)*x,v=Math.ceil(m/x)*x):(w=g,v=m),b&&y&&o&&Sa((a-r)/o,x/1e3)?(P=Math.round(Math.min((a-r)/x,h)),x=(a-r)/P,w=r,v=a):k?(w=b?r:w,v=y?a:v,P=c-1,x=(v-w)/P):(P=(v-w)/x,Le(P,Math.round(P),x/1e3)?P=Math.round(P):P=Math.ceil(P));const E=Math.max(tn(x),tn(w));C=Math.pow(10,J(l)?E:l),w=Math.round(w*C)/C,v=Math.round(v*C)/C;let D=0;for(b&&(u&&w!==r?(e.push({value:r}),wa)break;e.push({value:z})}return y&&u&&v!==a?e.length&&Le(e[e.length-1].value,a,Gn(a,S,i))?e[e.length-1].value=a:e.push({value:a}):(!y||v===a)&&e.push({value:v}),e}function Gn(i,t,{horizontal:e,minRotation:s}){const n=te(s),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class Fh extends be{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return J(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=s?o:l;if(t){const l=ge(n),c=ge(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=zh(n,o);return t.bounds==="ticks"&&wa(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return po(t,this.chart.options.locale,this.options.ticks.format)}}class ps extends Fh{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=kt(t)?t:0,this.max=kt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=te(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}F(ps,"id","linear"),F(ps,"defaults",{ticks:{callback:bo.formatters.numeric}});const Oi={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},mt=Object.keys(Oi);function Zn(i,t){return i-t}function Qn(i,t){if(J(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),kt(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(He(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function Jn(i,t,e,s){const n=mt.length;for(let o=mt.indexOf(i);o=mt.indexOf(e);o--){const r=mt[o];if(Oi[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return mt[e?mt.indexOf(e):0]}function Bh(i){for(let t=mt.indexOf(i)+1,e=mt.length;t=t?e[s]:e[n];i[o]=!0}}function jh(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function eo(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=yt(e,0,r),s=yt(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||Jn(o.minUnit,e,s,this._getLabelCapacity(e)),a=W(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=He(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const p=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.ticks.callback;if(r)return tt(r,[t,e,s],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],u=s[e],f=c&&d&&u&&u.major;return this._adapter.format(t,n||(f?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=ee(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=ee(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class io extends Ci{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=di(e,this.min),this._tableRange=di(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;rn-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(di(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return di(this._table,s*this._tableRange+this._minPos,!0)}}F(io,"id","timeseries"),F(io,"defaults",Ci.defaults);const Vo="label";function so(i,t){typeof i=="function"?i(t):i&&(i.current=t)}function Nh(i,t){const e=i.options;e&&t&&Object.assign(e,t)}function Yo(i,t){i.labels=t}function Uo(i,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vo;const s=[];i.datasets=t.map(n=>{const o=i.datasets.find(r=>r[e]===n[e]);return!o||!n.data||s.includes(o)?{...n}:(s.push(o),Object.assign(o,n),o)})}function Wh(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vo;const e={labels:[],datasets:[]};return Yo(e,i.labels),Uo(e,i.datasets,t),e}function $h(i,t){const{height:e=150,width:s=300,redraw:n=!1,datasetIdKey:o,type:r,data:a,options:l,plugins:c=[],fallbackContent:h,updateMode:d,...u}=i,f=I.useRef(null),p=I.useRef(null),g=()=>{f.current&&(p.current=new Ti(f.current,{type:r,data:Wh(a,o),options:l&&{...l},plugins:c}),so(t,p.current))},m=()=>{so(t,null),p.current&&(p.current.destroy(),p.current=null)};return I.useEffect(()=>{!n&&p.current&&l&&Nh(p.current,l)},[n,l]),I.useEffect(()=>{!n&&p.current&&Yo(p.current.config.data,a.labels)},[n,a.labels]),I.useEffect(()=>{!n&&p.current&&a.datasets&&Uo(p.current.config.data,a.datasets,o)},[n,a.datasets]),I.useEffect(()=>{p.current&&(n?(m(),setTimeout(g)):p.current.update(d))},[n,l,a.labels,a.datasets,d]),I.useEffect(()=>{p.current&&(m(),setTimeout(g))},[r]),I.useEffect(()=>(g(),()=>m()),[]),ms.createElement("canvas",{ref:f,role:"img",height:e,width:s,...u},h)}const Vh=I.forwardRef($h);function Yh(i,t){return Ti.register(t),I.forwardRef((e,s)=>ms.createElement(Vh,{...e,ref:s,type:i}))}const Uh=Yh("line",gi);Ti.register(gs,ps,bi,Te,wh,Ah,kh);const Gh=({events:i,getFileContent:t})=>{var R,Q,j,rt;const[e,s]=I.useState(""),[n,o]=I.useState(0),[r,a]=I.useState(0),[l,c]=I.useState({}),[h,d]=I.useState(null),[u,f]=I.useState(!1),[p,g]=I.useState({steps:[],logprobs:[]}),[m,b]=I.useState(!1),[y,k]=I.useState(!0),[S,x]=I.useState(!1),C=I.useRef(null),w=I.useRef(null),v=I.useMemo(()=>{const A=new Set;return i.forEach(T=>{const Z=Object.keys(T).find(X=>X!=="type"&&X!=="loss"&&X!=="step"&&X!=="file");Z&&A.add(Z)}),Array.from(A)},[i]),P=I.useMemo(()=>i.filter(A=>A.type==="logprobs").map(A=>A.step).sort((A,T)=>A-T),[i]),E=async A=>{try{const T=await t(A.file),Z=JSON.parse(T),X=Object.keys(A).find(H=>H!=="type"&&H!=="loss"&&H!=="step"&&H!=="file")||"";c(H=>({...H,[X]:{...H[X]||{},[A.step]:Z}}))}catch(T){console.error("Error loading log prob data:",T)}};I.useEffect(()=>{if(!e)return;i.filter(T=>Object.keys(T).find(X=>X!=="type"&&X!=="loss"&&X!=="step"&&X!=="file")===e).forEach(T=>{var Z;(Z=l[e])!=null&&Z[T.step]||E(T)})},[e]),I.useEffect(()=>{v.length>0&&!e&&s(v[0]),P.length>0&&!r&&a(P[0])},[v,P]),I.useEffect(()=>{if(!C.current)return;const A={root:null,rootMargin:"0px",threshold:.1},T=new IntersectionObserver(Z=>{Z.forEach(X=>{k(X.isIntersecting)})},A);return T.observe(C.current),()=>T.disconnect()},[]),I.useEffect(()=>{u&&h&&(async()=>{if(!h||!e)return;b(!0);const T={steps:[],logprobs:[]};try{Object.keys(l[e]||{}).map(Number).sort((H,B)=>H-B).forEach(H=>{const B=l[e][H];if(!B||!B[n])return;const ht=B[n];if(h.position({step:H,logp:T.logprobs[B]})).sort((H,B)=>H.step-B.step);g({steps:X.map(H=>H.step),logprobs:X.map(H=>H.logp)})}finally{b(!1)}})()},[u,h,e,l,n]);const D=A=>{if(S){const T=Math.max(0,Math.min(1,(A+20)/20));return`rgba(255, ${Math.floor(255*T)}, ${Math.floor(255*T)}, 0.3)`}else{const T=Math.exp(A);return`rgba(255, ${Math.floor(255*T)}, ${Math.floor(255*T)}, 0.3)`}},z=e&&r&&((Q=(R=l[e])==null?void 0:R[r])==null?void 0:Q[n]),G=e&&r&&((rt=(j=l[e])==null?void 0:j[r])==null?void 0:rt.length)||0,nt=A=>A.map((T,Z)=>{if(T.token.includes(` +`)){const H=T.token.split(/(\n)/);return L.jsx(ms.Fragment,{children:H.map((B,ht)=>B===` +`?L.jsx(Pt,{sx:{width:"100%",height:0}},`${Z}-${ht}`):B&&L.jsx(Pt,{onClick:()=>{d({token:T.token,tokenId:T.token_id,position:Z}),f(!0)},sx:{cursor:"pointer",p:.5,borderRadius:1,backgroundColor:D(T.logp),"&:hover":{outline:"1px solid blue"}},children:L.jsx(Xe,{variant:"body2",component:"span",children:B})},`${Z}-${ht}`))},Z)}return L.jsx(Pt,{onClick:()=>{d({token:T.token,tokenId:T.token_id,position:Z}),f(!0)},sx:{cursor:"pointer",p:.5,borderRadius:1,backgroundColor:D(T.logp),"&:hover":{outline:"1px solid blue"}},children:L.jsx(Xe,{variant:"body2",component:"span",children:T.token})},Z)});return L.jsxs(Pt,{sx:{mt:2},children:[L.jsxs(Pt,{ref:w,sx:{position:y?"sticky":"static",top:0,zIndex:1,backgroundColor:"white",pb:2,borderBottom:y?"1px solid rgba(0, 0, 0, 0.12)":"none"},children:[L.jsxs(Pt,{sx:{display:"flex",gap:2,mb:2,alignItems:"center"},children:[L.jsxs(Hs,{sx:{minWidth:200},children:[L.jsx(Bs,{children:"Dataset"}),L.jsx(js,{value:e,onChange:A=>s(A.target.value),label:"Dataset",children:v.map(A=>L.jsx(Ns,{value:A,children:A},A))})]}),L.jsxs(Hs,{sx:{minWidth:200},children:[L.jsx(Bs,{children:"Sequence Index"}),L.jsx(js,{value:n,onChange:A=>o(Number(A.target.value)),label:"Sequence Index",children:[...Array(G)].map((A,T)=>L.jsx(Ns,{value:T,children:T},T))})]}),L.jsx(fr,{control:L.jsx(gr,{checked:S,onChange:A=>x(A.target.checked)}),label:"Use LogProb Colors"})]}),L.jsxs(Pt,{sx:{px:2},children:[L.jsxs(Xe,{gutterBottom:!0,children:["Step: ",r]}),L.jsx($r,{value:r,onChange:(A,T)=>a(T),min:Math.min(...P),max:Math.max(...P),step:null,marks:P.map(A=>({value:A,label:A.toString()}))})]})]}),L.jsx(Pt,{ref:C,children:z?L.jsx(pr,{sx:{p:2,mt:2},children:L.jsx(Pt,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:nt(z.tokens)})}):L.jsx(Xe,{children:"No data available for the selected parameters"})}),L.jsxs(mr,{open:u,onClose:()=>f(!1),maxWidth:"md",fullWidth:!0,children:[L.jsxs(br,{children:["Token History: ",h==null?void 0:h.token," (Position: ",h==null?void 0:h.position,")"]}),L.jsx(xr,{children:m?L.jsx(Pt,{sx:{display:"flex",justifyContent:"center",p:4},children:L.jsx(_r,{})}):h&&L.jsx(Pt,{sx:{height:400},children:L.jsx(Uh,{data:{labels:p.steps,datasets:[{label:"Log Probability",data:p.logprobs,borderColor:"rgb(75, 192, 192)",tension:.1}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{title:{display:!0,text:`Log Probability Evolution for Token: ${h.token} at Position ${h.position}`}},scales:{y:{title:{display:!0,text:"Log Probability"}},x:{title:{display:!0,text:"Training Step"}}}}})})})]})]})};export{Gh as LogProbVisualization}; diff --git a/openweights/dashboard/backend/static/assets/LogProbVisualization-CnEzdbXa.js b/openweights/dashboard/backend/static/assets/LogProbVisualization-CnEzdbXa.js new file mode 100644 index 0000000..cb338f4 --- /dev/null +++ b/openweights/dashboard/backend/static/assets/LogProbVisualization-CnEzdbXa.js @@ -0,0 +1,20 @@ +var ir=Object.defineProperty;var sr=(i,t,e)=>t in i?ir(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var F=(i,t,e)=>sr(i,typeof t!="symbol"?t+"":t,e);import{a as I,u as nr,c as _e,d as or,e as Fs,f as rr,h as Xi,o as ui,i as Ki,_ as Y,k as fi,l as ar,m as lr,n as ue,j as L,s as ne,p as Yt,q as de,t as no,v as cr,w as hr,x as dr,y as Wt,z as ur,R as ms,B as Pt,F as Hs,I as Bs,S as js,M as Ns,A as fr,D as gr,T as Xe,P as pr,E as mr,G as br,H as xr,C as _r}from"./index-CL2BTY-B.js";const yr={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function vr(i,t,e=(s,n)=>s===n){return i.length===t.length&&i.every((s,n)=>e(s,t[n]))}const kr=2;function oo(i,t){return i-t}function Ws(i,t){var e;const{index:s}=(e=i.reduce((n,o,r)=>{const a=Math.abs(t-o);return n===null||a({left:`${i}%`}),leap:i=>({width:`${i}%`})},"horizontal-reverse":{offset:i=>({right:`${i}%`}),leap:i=>({width:`${i}%`})},vertical:{offset:i=>({bottom:`${i}%`}),leap:i=>({height:`${i}%`})}},Pr=i=>i;let Ze;function Vs(){return Ze===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Ze=CSS.supports("touch-action","none"):Ze=!0),Ze}function Tr(i){const{"aria-labelledby":t,defaultValue:e,disabled:s=!1,disableSwap:n=!1,isRtl:o=!1,marks:r=!1,max:a=100,min:l=0,name:c,onChange:h,onChangeCommitted:d,orientation:u="horizontal",rootRef:f,scale:p=Pr,step:g=1,shiftStep:m=10,tabIndex:b,value:y}=i,k=I.useRef(void 0),[S,x]=I.useState(-1),[C,w]=I.useState(-1),[v,P]=I.useState(!1),E=I.useRef(0),[D,z]=nr({controlled:y,default:e??l,name:"Slider"}),G=h&&((_,M,O)=>{const $=_.nativeEvent||_,V=new $.constructor($.type,$);Object.defineProperty(V,"target",{writable:!0,value:{value:M,name:c}}),h(V,M,O)}),nt=Array.isArray(D);let R=nt?D.slice().sort(oo):[D];R=R.map(_=>_==null?l:_e(_,l,a));const Q=r===!0&&g!==null?[...Array(Math.floor((a-l)/g)+1)].map((_,M)=>({value:l+g*M})):r||[],j=Q.map(_=>_.value),{isFocusVisibleRef:rt,onBlur:A,onFocus:T,ref:Z}=or(),[X,H]=I.useState(-1),B=I.useRef(null),ht=Fs(Z,B),gt=Fs(f,ht),re=_=>M=>{var O;const $=Number(M.currentTarget.getAttribute("data-index"));T(M),rt.current===!0&&H($),w($),_==null||(O=_.onFocus)==null||O.call(_,M)},ae=_=>M=>{var O;A(M),rt.current===!1&&H(-1),w(-1),_==null||(O=_.onBlur)==null||O.call(_,M)},Ve=(_,M)=>{const O=Number(_.currentTarget.getAttribute("data-index")),$=R[O],V=j.indexOf($);let N=M;if(Q&&g==null){const Ct=j[j.length-1];N>Ct?N=Ct:NM=>{var O;if(g!==null){const $=Number(M.currentTarget.getAttribute("data-index")),V=R[$];let N=null;(M.key==="ArrowLeft"||M.key==="ArrowDown")&&M.shiftKey||M.key==="PageDown"?N=Math.max(V-m,l):((M.key==="ArrowRight"||M.key==="ArrowUp")&&M.shiftKey||M.key==="PageUp")&&(N=Math.min(V+m,a)),N!==null&&(Ve(M,N),M.preventDefault())}_==null||(O=_.onKeyDown)==null||O.call(_,M)};rr(()=>{if(s&&B.current.contains(document.activeElement)){var _;(_=document.activeElement)==null||_.blur()}},[s]),s&&S!==-1&&x(-1),s&&X!==-1&&H(-1);const Li=_=>M=>{var O;(O=_.onChange)==null||O.call(_,M),Ve(M,M.target.valueAsNumber)},Ye=I.useRef(void 0);let Rt=u;o&&u==="horizontal"&&(Rt+="-reverse");const it=({finger:_,move:M=!1})=>{const{current:O}=B,{width:$,height:V,bottom:N,left:Ct}=O.getBoundingClientRect();let Ot;Rt.indexOf("vertical")===0?Ot=(N-_.y)/V:Ot=(_.x-Ct)/$,Rt.indexOf("-reverse")!==-1&&(Ot=1-Ot);let K;if(K=Sr(Ot,l,a),g)K=Mr(K,g,l);else{const ce=Ws(j,K);K=j[ce]}K=_e(K,l,a);let bt=0;if(nt){M?bt=Ye.current:bt=Ws(R,K),n&&(K=_e(K,R[bt-1]||-1/0,R[bt+1]||1/0));const ce=K;K=$s({values:R,newValue:K,index:bt}),n&&M||(bt=K.indexOf(ce),Ye.current=bt)}return{newValue:K,activeIndex:bt}},et=Xi(_=>{const M=Ke(_,k);if(!M)return;if(E.current+=1,_.type==="mousemove"&&_.buttons===0){wt(_);return}const{newValue:O,activeIndex:$}=it({finger:M,move:!0});qe({sliderRef:B,activeIndex:$,setActive:x}),z(O),!v&&E.current>kr&&P(!0),G&&!Ge(O,D)&&G(_,O,$)}),wt=Xi(_=>{const M=Ke(_,k);if(P(!1),!M)return;const{newValue:O}=it({finger:M,move:!0});x(-1),_.type==="touchend"&&w(-1),d&&d(_,O),k.current=void 0,Mt()}),Nt=Xi(_=>{if(s)return;Vs()||_.preventDefault();const M=_.changedTouches[0];M!=null&&(k.current=M.identifier);const O=Ke(_,k);if(O!==!1){const{newValue:V,activeIndex:N}=it({finger:O});qe({sliderRef:B,activeIndex:N,setActive:x}),z(V),G&&!Ge(V,D)&&G(_,V,N)}E.current=0;const $=ui(B.current);$.addEventListener("touchmove",et,{passive:!0}),$.addEventListener("touchend",wt,{passive:!0})}),Mt=I.useCallback(()=>{const _=ui(B.current);_.removeEventListener("mousemove",et),_.removeEventListener("mouseup",wt),_.removeEventListener("touchmove",et),_.removeEventListener("touchend",wt)},[wt,et]);I.useEffect(()=>{const{current:_}=B;return _.addEventListener("touchstart",Nt,{passive:Vs()}),()=>{_.removeEventListener("touchstart",Nt),Mt()}},[Mt,Nt]),I.useEffect(()=>{s&&Mt()},[s,Mt]);const Ai=_=>M=>{var O;if((O=_.onMouseDown)==null||O.call(_,M),s||M.defaultPrevented||M.button!==0)return;M.preventDefault();const $=Ke(M,k);if($!==!1){const{newValue:N,activeIndex:Ct}=it({finger:$});qe({sliderRef:B,activeIndex:Ct,setActive:x}),z(N),G&&!Ge(N,D)&&G(M,N,Ct)}E.current=0;const V=ui(B.current);V.addEventListener("mousemove",et,{passive:!0}),V.addEventListener("mouseup",wt)},dt=xi(nt?R[0]:l,l,a),le=xi(R[R.length-1],l,a)-dt,Ii=(_={})=>{const M=Ki(_),O={onMouseDown:Ai(M||{})},$=Y({},M,O);return Y({},_,{ref:gt},$)},Ri=_=>M=>{var O;(O=_.onMouseOver)==null||O.call(_,M);const $=Number(M.currentTarget.getAttribute("data-index"));w($)},Ei=_=>M=>{var O;(O=_.onMouseLeave)==null||O.call(_,M),w(-1)};return{active:S,axis:Rt,axisProps:Cr,dragging:v,focusedThumbIndex:X,getHiddenInputProps:(_={})=>{var M;const O=Ki(_),$={onChange:Li(O||{}),onFocus:re(O||{}),onBlur:ae(O||{}),onKeyDown:Di(O||{})},V=Y({},O,$);return Y({tabIndex:b,"aria-labelledby":t,"aria-orientation":u,"aria-valuemax":p(a),"aria-valuemin":p(l),name:c,type:"range",min:i.min,max:i.max,step:i.step===null&&i.marks?"any":(M=i.step)!=null?M:void 0,disabled:s},_,V,{style:Y({},yr,{direction:o?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:Ii,getThumbProps:(_={})=>{const M=Ki(_),O={onMouseOver:Ri(M||{}),onMouseLeave:Ei(M||{})};return Y({},_,M,O)},marks:Q,open:C,range:nt,rootRef:gt,trackLeap:le,trackOffset:dt,values:R,getThumbStyle:_=>({pointerEvents:S!==-1&&S!==_?"none":void 0})}}const Or=i=>!i||!fi(i);function Dr(i){return lr("MuiSlider",i)}const _t=ar("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),Lr=i=>{const{open:t}=i;return{offset:ue(t&&_t.valueLabelOpen),circle:_t.valueLabelCircle,label:_t.valueLabelLabel}};function Ar(i){const{children:t,className:e,value:s}=i,n=Lr(i);return t?I.cloneElement(t,{className:ue(t.props.className)},L.jsxs(I.Fragment,{children:[t.props.children,L.jsx("span",{className:ue(n.offset,e),"aria-hidden":!0,children:L.jsx("span",{className:n.circle,children:L.jsx("span",{className:n.label,children:s})})})]})):null}const Ir=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","shiftStep","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"];function Ys(i){return i}const Rr=ne("span",{name:"MuiSlider",slot:"Root",overridesResolver:(i,t)=>{const{ownerState:e}=i;return[t.root,t[`color${Yt(e.color)}`],e.size!=="medium"&&t[`size${Yt(e.size)}`],e.marked&&t.marked,e.orientation==="vertical"&&t.vertical,e.track==="inverted"&&t.trackInverted,e.track===!1&&t.trackFalse]}})(({theme:i})=>{var t;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${_t.disabled}`]:{pointerEvents:"none",cursor:"default",color:(i.vars||i).palette.grey[400]},[`&.${_t.dragging}`]:{[`& .${_t.thumb}, & .${_t.track}`]:{transition:"none"}},variants:[...Object.keys(((t=i.vars)!=null?t:i).palette).filter(e=>{var s;return((s=i.vars)!=null?s:i).palette[e].main}).map(e=>({props:{color:e},style:{color:(i.vars||i).palette[e].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}}),Er=ne("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(i,t)=>t.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),zr=ne("span",{name:"MuiSlider",slot:"Track",overridesResolver:(i,t)=>t.track})(({theme:i})=>{var t;return{display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:i.transitions.create(["left","width","bottom","height"],{duration:i.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.keys(((t=i.vars)!=null?t:i).palette).filter(e=>{var s;return((s=i.vars)!=null?s:i).palette[e].main}).map(e=>({props:{color:e,track:"inverted"},style:Y({},i.vars?{backgroundColor:i.vars.palette.Slider[`${e}Track`],borderColor:i.vars.palette.Slider[`${e}Track`]}:Y({backgroundColor:de.lighten(i.palette[e].main,.62),borderColor:de.lighten(i.palette[e].main,.62)},i.applyStyles("dark",{backgroundColor:de.darken(i.palette[e].main,.5)}),i.applyStyles("dark",{borderColor:de.darken(i.palette[e].main,.5)})))}))]}}),Fr=ne("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(i,t)=>{const{ownerState:e}=i;return[t.thumb,t[`thumbColor${Yt(e.color)}`],e.size!=="medium"&&t[`thumbSize${Yt(e.size)}`]]}})(({theme:i})=>{var t;return{position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:i.transitions.create(["box-shadow","left","bottom"],{duration:i.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(i.vars||i).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${_t.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.keys(((t=i.vars)!=null?t:i).palette).filter(e=>{var s;return((s=i.vars)!=null?s:i).palette[e].main}).map(e=>({props:{color:e},style:{[`&:hover, &.${_t.focusVisible}`]:Y({},i.vars?{boxShadow:`0px 0px 0px 8px rgba(${i.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${de.alpha(i.palette[e].main,.16)}`},{"@media (hover: none)":{boxShadow:"none"}}),[`&.${_t.active}`]:Y({},i.vars?{boxShadow:`0px 0px 0px 14px rgba(${i.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${de.alpha(i.palette[e].main,.16)}`})}}))]}}),Hr=ne(Ar,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(i,t)=>t.valueLabel})(({theme:i})=>Y({zIndex:1,whiteSpace:"nowrap"},i.typography.body2,{fontWeight:500,transition:i.transitions.create(["transform"],{duration:i.transitions.duration.shortest}),position:"absolute",backgroundColor:(i.vars||i).palette.grey[600],borderRadius:2,color:(i.vars||i).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${_t.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${_t.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:i.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})),Br=ne("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:i=>no(i)&&i!=="markActive",overridesResolver:(i,t)=>{const{markActive:e}=i;return[t.mark,e&&t.markActive]}})(({theme:i})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(i.vars||i).palette.background.paper,opacity:.8}}]})),jr=ne("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:i=>no(i)&&i!=="markLabelActive",overridesResolver:(i,t)=>t.markLabel})(({theme:i})=>Y({},i.typography.body2,{color:(i.vars||i).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(i.vars||i).palette.text.primary}}]})),Nr=i=>{const{disabled:t,dragging:e,marked:s,orientation:n,track:o,classes:r,color:a,size:l}=i,c={root:["root",t&&"disabled",e&&"dragging",s&&"marked",n==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",a&&`color${Yt(a)}`,l&&`size${Yt(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${Yt(l)}`,a&&`thumbColor${Yt(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return ur(c,Dr,r)},Wr=({children:i})=>i,$r=I.forwardRef(function(t,e){var s,n,o,r,a,l,c,h,d,u,f,p,g,m,b,y,k,S,x,C,w,v,P,E;const D=cr({props:t,name:"MuiSlider"}),z=hr(),{"aria-label":G,"aria-valuetext":nt,"aria-labelledby":R,component:Q="span",components:j={},componentsProps:rt={},color:A="primary",classes:T,className:Z,disableSwap:X=!1,disabled:H=!1,getAriaLabel:B,getAriaValueText:ht,marks:gt=!1,max:re=100,min:ae=0,orientation:Ve="horizontal",shiftStep:Di=10,size:Li="medium",step:Ye=1,scale:Rt=Ys,slotProps:it,slots:et,track:wt="normal",valueLabelDisplay:Nt="off",valueLabelFormat:Mt=Ys}=D,Ai=dr(D,Ir),dt=Y({},D,{isRtl:z,max:re,min:ae,classes:T,disabled:H,disableSwap:X,orientation:Ve,marks:gt,color:A,size:Li,step:Ye,shiftStep:Di,scale:Rt,track:wt,valueLabelDisplay:Nt,valueLabelFormat:Mt}),{axisProps:le,getRootProps:Ii,getHiddenInputProps:Ri,getThumbProps:Ei,open:As,active:zi,axis:xe,focusedThumbIndex:_,range:M,dragging:O,marks:$,values:V,trackOffset:N,trackLeap:Ct,getThumbStyle:Ot}=Tr(Y({},dt,{rootRef:e}));dt.marked=$.length>0&&$.some(ot=>ot.label),dt.dragging=O,dt.focusedThumbIndex=_;const K=Nr(dt),bt=(s=(n=et==null?void 0:et.root)!=null?n:j.Root)!=null?s:Rr,ce=(o=(r=et==null?void 0:et.rail)!=null?r:j.Rail)!=null?o:Er,Is=(a=(l=et==null?void 0:et.track)!=null?l:j.Track)!=null?a:zr,Rs=(c=(h=et==null?void 0:et.thumb)!=null?h:j.Thumb)!=null?c:Fr,Es=(d=(u=et==null?void 0:et.valueLabel)!=null?u:j.ValueLabel)!=null?d:Hr,Fi=(f=(p=et==null?void 0:et.mark)!=null?p:j.Mark)!=null?f:Br,Hi=(g=(m=et==null?void 0:et.markLabel)!=null?m:j.MarkLabel)!=null?g:jr,zs=(b=(y=et==null?void 0:et.input)!=null?y:j.Input)!=null?b:"input",Bi=(k=it==null?void 0:it.root)!=null?k:rt.root,Xo=(S=it==null?void 0:it.rail)!=null?S:rt.rail,ji=(x=it==null?void 0:it.track)!=null?x:rt.track,Ni=(C=it==null?void 0:it.thumb)!=null?C:rt.thumb,Wi=(w=it==null?void 0:it.valueLabel)!=null?w:rt.valueLabel,Ko=(v=it==null?void 0:it.mark)!=null?v:rt.mark,qo=(P=it==null?void 0:it.markLabel)!=null?P:rt.markLabel,Go=(E=it==null?void 0:it.input)!=null?E:rt.input,Zo=Wt({elementType:bt,getSlotProps:Ii,externalSlotProps:Bi,externalForwardedProps:Ai,additionalProps:Y({},Or(bt)&&{as:Q}),ownerState:Y({},dt,Bi==null?void 0:Bi.ownerState),className:[K.root,Z]}),Qo=Wt({elementType:ce,externalSlotProps:Xo,ownerState:dt,className:K.rail}),Jo=Wt({elementType:Is,externalSlotProps:ji,additionalProps:{style:Y({},le[xe].offset(N),le[xe].leap(Ct))},ownerState:Y({},dt,ji==null?void 0:ji.ownerState),className:K.track}),$i=Wt({elementType:Rs,getSlotProps:Ei,externalSlotProps:Ni,ownerState:Y({},dt,Ni==null?void 0:Ni.ownerState),className:K.thumb}),tr=Wt({elementType:Es,externalSlotProps:Wi,ownerState:Y({},dt,Wi==null?void 0:Wi.ownerState),className:K.valueLabel}),Vi=Wt({elementType:Fi,externalSlotProps:Ko,ownerState:dt,className:K.mark}),Yi=Wt({elementType:Hi,externalSlotProps:qo,ownerState:dt,className:K.markLabel}),er=Wt({elementType:zs,getSlotProps:Ri,externalSlotProps:Go,ownerState:dt});return L.jsxs(bt,Y({},Zo,{children:[L.jsx(ce,Y({},Qo)),L.jsx(Is,Y({},Jo)),$.filter(ot=>ot.value>=ae&&ot.value<=re).map((ot,ct)=>{const Ui=xi(ot.value,ae,re),Ue=le[xe].offset(Ui);let Et;return wt===!1?Et=V.indexOf(ot.value)!==-1:Et=wt==="normal"&&(M?ot.value>=V[0]&&ot.value<=V[V.length-1]:ot.value<=V[0])||wt==="inverted"&&(M?ot.value<=V[0]||ot.value>=V[V.length-1]:ot.value>=V[0]),L.jsxs(I.Fragment,{children:[L.jsx(Fi,Y({"data-index":ct},Vi,!fi(Fi)&&{markActive:Et},{style:Y({},Ue,Vi.style),className:ue(Vi.className,Et&&K.markActive)})),ot.label!=null?L.jsx(Hi,Y({"aria-hidden":!0,"data-index":ct},Yi,!fi(Hi)&&{markLabelActive:Et},{style:Y({},Ue,Yi.style),className:ue(K.markLabel,Yi.className,Et&&K.markLabelActive),children:ot.label})):null]},ct)}),V.map((ot,ct)=>{const Ui=xi(ot,ae,re),Ue=le[xe].offset(Ui),Et=Nt==="off"?Wr:Es;return L.jsx(Et,Y({},!fi(Et)&&{valueLabelFormat:Mt,valueLabelDisplay:Nt,value:typeof Mt=="function"?Mt(Rt(ot),ct):Mt,index:ct,open:As===ct||zi===ct||Nt==="on",disabled:H},tr,{children:L.jsx(Rs,Y({"data-index":ct},$i,{className:ue(K.thumb,$i.className,zi===ct&&K.active,_===ct&&K.focusVisible),style:Y({},Ue,Ot(ct),$i.style),children:L.jsx(zs,Y({"data-index":ct,"aria-label":B?B(ct):G,"aria-valuenow":Rt(ot),"aria-labelledby":R,"aria-valuetext":ht?ht(Rt(ot),ct):nt,value:V[ct]},er))}))}),ct)})]}))});/*! + * @kurkle/color v0.3.4 + * https://github.com/kurkle/color#readme + * (c) 2024 Jukka Kurkela + * Released under the MIT License + */function We(i){return i+.5|0}const Ut=(i,t,e)=>Math.max(Math.min(i,e),t);function Me(i){return Ut(We(i*2.55),0,255)}function Xt(i){return Ut(We(i*255),0,255)}function Bt(i){return Ut(We(i/2.55)/100,0,1)}function Us(i){return Ut(We(i*100),0,100)}const xt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ns=[..."0123456789ABCDEF"],Vr=i=>ns[i&15],Yr=i=>ns[(i&240)>>4]+ns[i&15],Qe=i=>(i&240)>>4===(i&15),Ur=i=>Qe(i.r)&&Qe(i.g)&&Qe(i.b)&&Qe(i.a);function Xr(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&xt[i[1]]*17,g:255&xt[i[2]]*17,b:255&xt[i[3]]*17,a:t===5?xt[i[4]]*17:255}:(t===7||t===9)&&(e={r:xt[i[1]]<<4|xt[i[2]],g:xt[i[3]]<<4|xt[i[4]],b:xt[i[5]]<<4|xt[i[6]],a:t===9?xt[i[7]]<<4|xt[i[8]]:255})),e}const Kr=(i,t)=>i<255?t(i):"";function qr(i){var t=Ur(i)?Vr:Yr;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Kr(i.a,t):void 0}const Gr=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ro(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function Zr(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function Qr(i,t,e){const s=ro(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function Jr(i,t,e,s,n){return i===n?(t-e)/s+(t.5?h/(2-o-r):h/(o+r),l=Jr(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function xs(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(Xt)}function _s(i,t,e){return xs(ro,i,t,e)}function ta(i,t,e){return xs(Qr,i,t,e)}function ea(i,t,e){return xs(Zr,i,t,e)}function ao(i){return(i%360+360)%360}function ia(i){const t=Gr.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Me(+t[5]):Xt(+t[5]));const n=ao(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=ta(n,o,r):t[1]==="hsv"?s=ea(n,o,r):s=_s(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function sa(i,t){var e=bs(i);e[0]=ao(e[0]+t),e=_s(e),i.r=e[0],i.g=e[1],i.b=e[2]}function na(i){if(!i)return;const t=bs(i),e=t[0],s=Us(t[1]),n=Us(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${Bt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const Xs={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Ks={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function oa(){const i={},t=Object.keys(Ks),e=Object.keys(Xs);let s,n,o,r,a;for(s=0;s>16&255,o>>8&255,o&255]}return i}let Je;function ra(i){Je||(Je=oa(),Je.transparent=[0,0,0,0]);const t=Je[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const aa=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function la(i){const t=aa.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const r=+t[7];e=t[8]?Me(r):Ut(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Me(s):Ut(s,0,255)),n=255&(t[4]?Me(n):Ut(n,0,255)),o=255&(t[6]?Me(o):Ut(o,0,255)),{r:s,g:n,b:o,a:e}}}function ca(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Bt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const qi=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,he=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function ha(i,t,e){const s=he(Bt(i.r)),n=he(Bt(i.g)),o=he(Bt(i.b));return{r:Xt(qi(s+e*(he(Bt(t.r))-s))),g:Xt(qi(n+e*(he(Bt(t.g))-n))),b:Xt(qi(o+e*(he(Bt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function ti(i,t,e){if(i){let s=bs(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=_s(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function lo(i,t){return i&&Object.assign(t||{},i)}function qs(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=Xt(i[3]))):(t=lo(i,{r:0,g:0,b:0,a:1}),t.a=Xt(t.a)),t}function da(i){return i.charAt(0)==="r"?la(i):ia(i)}class ze{constructor(t){if(t instanceof ze)return t;const e=typeof t;let s;e==="object"?s=qs(t):e==="string"&&(s=Xr(t)||ra(t)||da(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=lo(this._rgb);return t&&(t.a=Bt(t.a)),t}set rgb(t){this._rgb=qs(t)}rgbString(){return this._valid?ca(this._rgb):void 0}hexString(){return this._valid?qr(this._rgb):void 0}hslString(){return this._valid?na(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=ha(this._rgb,t._rgb,e)),this}clone(){return new ze(this.rgb)}alpha(t){return this._rgb.a=Xt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=We(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ti(this._rgb,2,t),this}darken(t){return ti(this._rgb,2,-t),this}saturate(t){return ti(this._rgb,1,t),this}desaturate(t){return ti(this._rgb,1,-t),this}rotate(t){return sa(this._rgb,t),this}}/*! + * Chart.js v4.4.8 + * https://www.chartjs.org + * (c) 2025 Chart.js Contributors + * Released under the MIT License + */function zt(){}const ua=(()=>{let i=0;return()=>i++})();function J(i){return i==null}function at(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function U(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function kt(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function Dt(i,t){return kt(i)?i:t}function W(i,t){return typeof i>"u"?t:i}const fa=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function tt(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function q(i,t,e,s){let n,o,r;if(at(i))for(o=i.length,n=0;ni,x:i=>i.x,y:i=>i.y};function ma(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function ba(i){const t=ma(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function vi(i,t){return(Gs[t]||(Gs[t]=ba(t)))(i)}function ys(i){return i.charAt(0).toUpperCase()+i.slice(1)}const ki=i=>typeof i<"u",Kt=i=>typeof i=="function",Zs=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function xa(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const lt=Math.PI,It=2*lt,_a=It+lt,Si=Number.POSITIVE_INFINITY,ya=lt/180,Tt=lt/2,qt=lt/4,Qs=lt*2/3,os=Math.log10,ge=Math.sign;function Le(i,t,e){return Math.abs(i-t)n-o).pop(),t}function ka(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function He(i){return!ka(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function Sa(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function wa(i,t,e){let s,n,o;for(s=0,n=i.length;sl&&c=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function vs(i,t,e){e=e||(r=>i[r]1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const ee=(i,t,e,s)=>vs(i,e,s?n=>{const o=i[n][t];return oi[n][t]vs(i,e,s=>i[s][t]>=e);function Da(i,t,e){let s=0,n=i.length;for(;ss&&i[n-1]>e;)n--;return s>0||n{const s="_onData"+ys(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function en(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(uo.forEach(o=>{delete i[o]}),delete i._chartjs)}function Aa(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const fo=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function go(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,fo.call(window,()=>{s=!1,i.apply(t,e)}))}}function Ia(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const ks=i=>i==="start"?"left":i==="end"?"right":"center",ut=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Ra=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function Ea(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:r,vScale:a,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(n=Math.min(ee(l,h,d).lo,e?s:ee(t,h,r.getPixelForValue(d)).lo),c){const g=l.slice(0,n+1).reverse().findIndex(m=>!J(m[a.axis]));n-=Math.max(0,g)}n=yt(n,0,s-1)}if(p){let g=Math.max(ee(l,r.axis,u,!0).hi+1,e?0:ee(t,h,r.getPixelForValue(u),!0).hi+1);if(c){const m=l.slice(g-1).findIndex(b=>!J(b[a.axis]));g+=Math.max(0,m)}o=yt(g,n,s)-n}else o=s-n}return{start:n,count:o}}function za(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const ei=i=>i===0||i===1,sn=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*It/e)),nn=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*It/e)+1,Ae={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*Tt)+1,easeOutSine:i=>Math.sin(i*Tt),easeInOutSine:i=>-.5*(Math.cos(lt*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>ei(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>ei(i)?i:sn(i,.075,.3),easeOutElastic:i=>ei(i)?i:nn(i,.075,.3),easeInOutElastic(i){return ei(i)?i:i<.5?.5*sn(i*2,.1125,.45):.5+.5*nn(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Ae.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Ae.easeInBounce(i*2)*.5:Ae.easeOutBounce(i*2-1)*.5+.5};function Ss(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function on(i){return Ss(i)?i:new ze(i)}function Gi(i){return Ss(i)?i:new ze(i).saturate(.5).darken(.1).hexString()}const Fa=["x","y","borderWidth","radius","tension"],Ha=["color","borderColor","backgroundColor"];function Ba(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:Ha},numbers:{type:"number",properties:Fa}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function ja(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const rn=new Map;function Na(i,t){t=t||{};const e=i+JSON.stringify(t);let s=rn.get(e);return s||(s=new Intl.NumberFormat(i,t),rn.set(e,s)),s}function po(i,t,e){return Na(t,e).format(i)}const mo={values(i){return at(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=Wa(i,e)}const r=os(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),po(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";const s=e[t].significand||i/Math.pow(10,Math.floor(os(i)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?mo.numeric.call(this,i,t,e):""}};function Wa(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var bo={formatters:mo};function $a(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:bo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const se=Object.create(null),as=Object.create(null);function Ie(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;ss.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>Gi(n.backgroundColor),this.hoverBorderColor=(s,n)=>Gi(n.borderColor),this.hoverColor=(s,n)=>Gi(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Zi(this,t,e)}get(t){return Ie(this,t)}describe(t,e){return Zi(as,t,e)}override(t,e){return Zi(se,t,e)}route(t,e,s,n){const o=Ie(this,t),r=Ie(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return U(l)?Object.assign({},c,l):W(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var st=new Va({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ba,ja,$a]);function Ya(i){return!i||J(i.size)||J(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function an(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function Gt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function ln(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function ls(i,t,e,s){xo(i,t,e,s,null)}function xo(i,t,e,s,n){let o,r,a,l,c,h,d,u;const f=t.pointStyle,p=t.rotation,g=t.radius;let m=(p||0)*ya;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(m),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(g)||g<=0)){switch(i.beginPath(),f){default:n?i.ellipse(e,s,n/2,g,0,0,It):i.arc(e,s,g,0,It),i.closePath();break;case"triangle":h=n?n/2:g,i.moveTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=Qs,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=Qs,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),i.closePath();break;case"rectRounded":c=g*.516,l=g-c,r=Math.cos(m+qt)*l,d=Math.cos(m+qt)*(n?n/2-c:l),a=Math.sin(m+qt)*l,u=Math.sin(m+qt)*(n?n/2-c:l),i.arc(e-d,s-a,c,m-lt,m-Tt),i.arc(e+u,s-r,c,m-Tt,m),i.arc(e+d,s+a,c,m,m+Tt),i.arc(e-u,s+r,c,m+Tt,m+lt),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}m+=qt;case"rectRot":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+u,s-r),i.lineTo(e+d,s+a),i.lineTo(e-u,s+r),i.closePath();break;case"crossRot":m+=qt;case"cross":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r);break;case"star":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r),m+=qt,d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r);break;case"line":r=n?n/2:Math.cos(m)*g,a=Math.sin(m)*g,i.moveTo(e-r,s-a),i.lineTo(e+r,s+a);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function Be(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,Ka(i,o),l=0;l+i||0;function _o(i,t){const e={},s=U(t),n=s?Object.keys(t):t,o=U(i)?s?r=>W(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=tl(o(r));return e}function el(i){return _o(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Re(i){return _o(i,["topLeft","topRight","bottomLeft","bottomRight"])}function St(i){const t=el(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ft(i,t){i=i||{},t=t||st.font;let e=W(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=W(i.style,t.style);s&&!(""+s).match(Qa)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:W(i.family,t.family),lineHeight:Ja(W(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:W(i.weight,t.weight),string:""};return n.string=Ya(n),n}function ii(i,t,e,s){let n,o,r;for(n=0,o=i.length;ne&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function oe(i,t){return Object.assign(Object.create(i),t)}function Cs(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=So("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:a=>Cs([a,...i],t,o,s)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return vo(a,l,()=>hl(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return hn(a).includes(l)},ownKeys(a){return hn(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function pe(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:yo(i,s),setContext:o=>pe(i,o,e,s),override:o=>pe(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return vo(o,r,()=>nl(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function yo(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:Kt(e)?e:()=>e,isIndexable:Kt(s)?s:()=>s}}const sl=(i,t)=>i?i+ys(t):t,Ps=(i,t)=>U(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function vo(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function nl(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return Kt(a)&&r.isScriptable(t)&&(a=ol(t,a,i,e)),at(a)&&a.length&&(a=rl(t,a,i,r.isIndexable)),Ps(t,a)&&(a=pe(a,n,o&&o[t],r)),a}function ol(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||s);return a.delete(i),Ps(i,l)&&(l=Ts(n._scopes,n,i,l)),l}function rl(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(U(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=Ts(c,n,i,h);t.push(pe(d,o,r&&r[i],a))}}return t}function ko(i,t,e){return Kt(i)?i(t,e):i}const al=(i,t)=>i===!0?t:typeof i=="string"?vi(t,i):void 0;function ll(i,t,e,s,n){for(const o of t){const r=al(e,o);if(r){i.add(r);const a=ko(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==s)return a}else if(r===!1&&typeof s<"u"&&e!==s)return null}return!1}function Ts(i,t,e,s){const n=t._rootScopes,o=ko(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=cn(a,r,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=cn(a,r,o,l,s),l===null)?!1:Cs(Array.from(a),[""],n,o,()=>cl(t,e,s))}function cn(i,t,e,s,n){for(;e;)e=ll(i,t,e,s,n);return e}function cl(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return at(n)&&U(e)?e:n||{}}function hl(i,t,e,s){let n;for(const o of t)if(n=So(sl(o,i),e),typeof n<"u")return Ps(i,n)?Ts(e,s,i,n):n}function So(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function hn(i){let t=i._keys;return t||(t=i._keys=dl(i._scopes)),t}function dl(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}const ul=Number.EPSILON||1e-14,me=(i,t)=>ti==="x"?"y":"x";function fl(i,t,e,s){const n=i.skip?t:i,o=t,r=e.skip?t:e,a=rs(o,n),l=rs(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,u=s*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function gl(i,t,e){const s=i.length;let n,o,r,a,l,c=me(i,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")ml(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,r=i.length;oi.ownerDocument.defaultView.getComputedStyle(i,null);function _l(i,t){return Pi(i).getPropertyValue(t)}const yl=["top","right","bottom","left"];function ie(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=yl[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const vl=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function kl(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(vl(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Qt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Pi(e),o=n.boxSizing==="border-box",r=ie(n,"padding"),a=ie(n,"border","width"),{x:l,y:c,box:h}=kl(i,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=t;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*e.width/s),y:Math.round((c-u)/p*e.height/s)}}function Sl(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&Ds(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Pi(o),l=ie(a,"border","width"),c=ie(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=wi(a.maxWidth,o,"clientWidth"),n=wi(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||Si,maxHeight:n||Si}}const ni=i=>Math.round(i*10)/10;function wl(i,t,e,s){const n=Pi(i),o=ie(n,"margin"),r=wi(n.maxWidth,i,"clientWidth")||Si,a=wi(n.maxHeight,i,"clientHeight")||Si,l=Sl(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const u=ie(n,"border","width"),f=ie(n,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=ni(Math.min(c,r,l.maxWidth)),h=ni(Math.min(h,a,l.maxHeight)),c&&!h&&(h=ni(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=ni(Math.floor(h*s))),{width:c,height:h}}function dn(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Ml=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Os()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function un(i,t){const e=_l(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Jt(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Cl(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Pl(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=Jt(i,n,e),a=Jt(n,o,e),l=Jt(o,t,e),c=Jt(r,a,e),h=Jt(a,l,e);return Jt(c,h,e)}const Tl=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Ol=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function fe(i,t,e){return i?Tl(t,e):Ol()}function Mo(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Co(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Po(i){return i==="angle"?{between:ho,compare:Pa,normalize:Vt}:{between:Ce,compare:(t,e)=>t-e,normalize:t=>t}}function fn({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function Dl(i,t,e){const{property:s,start:n,end:o}=e,{between:r,normalize:a}=Po(s),l=t.length;let{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;ul(n,k,b)&&a(n,k)!==0,x=()=>a(o,b)===0||l(o,k,b),C=()=>g||S(),w=()=>!g||x();for(let v=h,P=h;v<=d;++v)y=t[v%r],!y.skip&&(b=c(y[s]),b!==k&&(g=l(b,n,o),m===null&&C()&&(m=a(b,n)===0?v:P),m!==null&&w()&&(p.push(fn({start:m,end:v,loop:u,count:r,style:f})),m=null),P=v,k=b));return m!==null&&p.push(fn({start:m,end:d,loop:u,count:r,style:f})),p}function Al(i,t){const e=[],s=i.segments;for(let n=0;nn&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function Rl(i,t,e,s){const n=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?a.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:s}),o}function El(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:r,end:a}=Il(e,n,o,s);if(s===!0)return gn(i,[{start:r,end:a,loop:o}],e,t);const l=aa({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=fo.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ft=new Hl;const mn="transparent",Bl={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=on(i||mn),n=s.valid&&on(t||mn);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class jl{constructor(t,e,s,n){const o=e[s];n=ii([t.to,n,o,t.from]);const r=ii([t.from,o,n]);this._active=!0,this._fn=t.fn||Bl[t.type||typeof r],this._easing=Ae[t.easing]||Ae.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ii([t.to,e,n,t.from]),this._from=ii([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n{const o=t[n];if(!U(o))return;const r={};for(const a of e)r[a]=o[a];(at(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=Wl(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&Nl(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new jl(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return Ft.add(this._chart,s),!0}}function Nl(i,t){const e=[],s=Object.keys(t);for(let n=0;n0||!e&&o<0)return n.index}return null}function yn(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=Ul(o,r,s),d=t.length;let u;for(let f=0;fe[s].axis===t).shift()}function ql(i,t){return oe(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Gl(i,t,e){return oe(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ye(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const ts=i=>i==="reset"||i==="none",vn=(i,t)=>t?i:Object.assign({},i),Zl=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Oo(e,!0),values:null};class Ee{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Qi(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ye(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,u,f,p)=>d==="x"?u:d==="r"?p:f,o=e.xAxisID=W(s.xAxisID,Ji(t,"x")),r=e.yAxisID=W(s.yAxisID,Ji(t,"y")),a=e.rAxisID=W(s.rAxisID,Ji(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&en(this._data,this),t._stacked&&ye(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(U(e)){const n=this._cachedMeta;this._data=Yl(e,n)}else if(s!==e){if(s){en(s,this);const n=this._cachedMeta;ye(n),n._parsed=[]}e&&Object.isExtensible(e)&&La(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Qi(e.vScale,e),e.stack!==s.stack&&(n=!0,ye(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(yn(this,e._parsed),e._stacked=Qi(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,u;if(this._parsing===!1)s._parsed=n,s._sorted=!0,u=n;else{at(n[t])?u=this.parseArrayData(s,n,t,e):U(n[t])?u=this.parseObjectData(s,n,t,e):u=this.parsePrimitiveData(s,n,t,e);const f=()=>d[a]===null||c&&d[a]g||d=0;--u)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n=0&&tthis.getContext(s,n,e),g=c.resolveNamedOptions(u,f,p,d);return g.$shared&&(g.$shared=l,o[r]=Object.freeze(vn(g,l))),g}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,s,e))}const c=new To(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ts(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){ts(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!ts(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a0&&this.getParsed(e-1);for(let x=0;x=y){w.skip=!0;continue}const v=this.getParsed(x),P=J(v[f]),E=w[u]=r.getPixelForValue(v[u],x),D=w[f]=o||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,v,l):v[f],x);w.skip=isNaN(E)||isNaN(D)||P,w.stop=x>0&&Math.abs(v[u]-S[u])>m,g&&(w.parsed=v,w.raw=c.data[x]),d&&(w.options=h||this.resolveDataElementOptions(x,C.active?"active":n)),b||this.updateElement(C,x,w,n),S=v}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}F(gi,"id","line"),F(gi,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),F(gi,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Zt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ls{constructor(t){F(this,"options");this.options=t||{}}static override(t){Object.assign(Ls.prototype,t)}init(){}formats(){return Zt()}parse(){return Zt()}format(){return Zt()}add(){return Zt()}diff(){return Zt()}startOf(){return Zt()}endOf(){return Zt()}}var Ql={_date:Ls};function Jl(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?Oa:ee;if(s){if(n._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const u=c(o,t,e-d),f=c(o,t,e+d);return{lo:u.lo,hi:f.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=n._cachedMeta,{_parsed:u}=i,f=u.slice(0,h.lo+1).reverse().findIndex(g=>!J(g[d.axis]));h.lo-=Math.max(0,f);const p=u.slice(h.hi).findIndex(g=>!J(g[d.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function $e(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a{l[r]&&l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var sc={evaluateInteractionItems:$e,modes:{index(i,t,e,s){const n=Qt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?es(i,n,o,s,r):is(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=Qt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?es(i,n,o,s,r):is(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;he.pos===t)}function Sn(i,t){return i.filter(e=>Do.indexOf(e.pos)===-1&&e.box.axis===t)}function ke(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function nc(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;ec.box.fullSize),!0),s=ke(ve(t,"left"),!0),n=ke(ve(t,"right")),o=ke(ve(t,"top"),!0),r=ke(ve(t,"bottom")),a=Sn(t,"x"),l=Sn(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:ve(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function wn(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function Lo(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function lc(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!U(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&Lo(r,o.getPadding());const a=Math.max(0,t.outerWidth-wn(r,i,"left","right")),l=Math.max(0,t.outerHeight-wn(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function cc(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function hc(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function Pe(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},n);Lo(u,St(s));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),p=rc(l.concat(c),d);Pe(a.fullSize,f,d,p),Pe(l,f,d,p),Pe(c,f,d,p)&&Pe(l,f,d,p),cc(f),Mn(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,Mn(a.rightAndBottom,f,d,p),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},q(a.chartArea,g=>{const m=g.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Ao{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class dc extends Ao{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pi="$chartjs",uc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Cn=i=>i===null||i==="";function fc(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[pi]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Cn(n)){const o=un(i,"width");o!==void 0&&(i.width=o)}if(Cn(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=un(i,"height");o!==void 0&&(i.height=o)}return i}const Io=Ml?{passive:!0}:!1;function gc(i,t,e){i&&i.addEventListener(t,e,Io)}function pc(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,Io)}function mc(i,t){const e=uc[i.type]||i.type,{x:s,y:n}=Qt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Mi(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function bc(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Mi(a.addedNodes,s),r=r&&!Mi(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function xc(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Mi(a.removedNodes,s),r=r&&!Mi(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Ne=new Map;let Pn=0;function Ro(){const i=window.devicePixelRatio;i!==Pn&&(Pn=i,Ne.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function _c(i,t){Ne.size||window.addEventListener("resize",Ro),Ne.set(i,t)}function yc(i){Ne.delete(i),Ne.size||window.removeEventListener("resize",Ro)}function vc(i,t,e){const s=i.canvas,n=s&&Ds(s);if(!n)return;const o=go((a,l)=>{const c=n.clientWidth;e(a,l),c{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),_c(i,o),r}function ss(i,t,e){e&&e.disconnect(),t==="resize"&&yc(i)}function kc(i,t,e){const s=i.canvas,n=go(o=>{i.ctx!==null&&e(mc(o,i))},i);return gc(s,t,n),n}class Sc extends Ao{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(fc(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[pi])return!1;const s=e[pi].initial;["height","width"].forEach(o=>{const r=s[o];J(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[pi],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:bc,detach:xc,resize:vc}[e]||kc;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:ss,detach:ss,resize:ss}[e]||pc)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return wl(t,e,s,n)}isAttached(t){const e=t&&Ds(t);return!!(e&&e.isConnected)}}function wc(i){return!Os()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?dc:Sc}class jt{constructor(){F(this,"x");F(this,"y");F(this,"active",!1);F(this,"options");F(this,"$animations")}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return He(this.x)&&He(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}F(jt,"defaults",{}),F(jt,"defaultRoutes");function Mc(i,t){const e=i.options.ticks,s=Cc(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Tc(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return Oc(t,c,o,r/n),c;const h=Pc(o,t,n);if(r>0){let d,u;const f=r>1?Math.round((l-a)/(r-1)):null;for(ri(t,c,h,J(f)?0:a-f,a),d=0,u=r-1;dn)return l}return Math.max(n,1)}function Tc(i){const t=[];let e,s;for(e=0,s=i.length;ei==="left"?"right":i==="right"?"left":i,Tn=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,On=(i,t)=>Math.min(t||i,i);function Dn(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;or+a)))return l}function Ic(i,t){q(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;os?s:e,s=n&&e>s?e:s,{min:Dt(e,Dt(s,e)),max:Dt(s,Dt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){tt(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=il(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=yt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),d+6>a&&(a=f/(s-(t.offset?.5:1)),l=this.maxHeight-Se(t.grid)-e.padding-Ln(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=Ma(Math.min(Math.asin(yt((h.highest.height+6)/a,-1,1)),Math.asin(yt(l/c,-1,1))-Math.asin(yt(u/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){tt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){tt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Ln(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Se(o)+l):(t.height=this.maxHeight,t.width=Se(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,p=te(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(a){const b=s.mirror?0:m*d.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=s.mirror?0:g*d.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,m,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=n*t.width,f=s*e.height):(u=s*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){tt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e({width:r[P]||0,height:a[P]||0});return{first:v(0),last:v(e-1),widest:v(C),highest:v(w),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Ta(this._alignToPixels?Gt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*n?a/s:l/n:l*n0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=Se(o),f=[],p=a.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(Q){return Gt(s,Q,g)};let y,k,S,x,C,w,v,P,E,D,z,G;if(r==="top")y=b(this.bottom),w=this.bottom-u,P=y-m,D=b(t.top)+m,G=t.bottom;else if(r==="bottom")y=b(this.top),D=t.top,G=b(t.bottom)-m,w=y+m,P=this.top+u;else if(r==="left")y=b(this.right),C=this.right-u,v=y-m,E=b(t.left)+m,z=t.right;else if(r==="right")y=b(this.left),E=t.left,z=b(t.right)-m,C=y+m,v=this.left+u;else if(e==="x"){if(r==="center")y=b((t.top+t.bottom)/2+.5);else if(U(r)){const Q=Object.keys(r)[0],j=r[Q];y=b(this.chart.scales[Q].getPixelForValue(j))}D=t.top,G=t.bottom,w=y+m,P=w+u}else if(e==="y"){if(r==="center")y=b((t.left+t.right)/2);else if(U(r)){const Q=Object.keys(r)[0],j=r[Q];y=b(this.chart.scales[Q].getPixelForValue(j))}C=y-m,v=C-u,E=t.left,z=t.right}const nt=W(n.ticks.maxTicksLimit,d),R=Math.max(1,Math.ceil(d/nt));for(k=0;k0&&(gt-=B/2);break}Z={left:gt,top:ht,width:B+X.width,height:H+X.height,color:R.backdropColor}}m.push({label:S,font:P,textOffset:z,options:{rotation:g,color:j,strokeColor:rt,strokeWidth:A,textAlign:T,textBaseline:G,translation:[x,C],backdrop:Z}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-te(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");st.route(o,n,l,a)})}function jc(i){return"id"in i&&"defaults"in i}class Nc{constructor(){this.controllers=new ai(Ee,"datasets",!0),this.elements=new ai(jt,"elements"),this.plugins=new ai(Object,"plugins"),this.scales=new ai(be,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):q(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=ys(t);tt(s["before"+n],[],s),e[t](s),tt(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;eo.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function $c(i){const t={},e=[],s=Object.keys(At.plugins.items);for(let o=0;o1&&An(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function In(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Gc(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return In(i,"x",e[0])||In(i,"y",e[0])}return{}}function Zc(i,t){const e=se[i.type]||{scales:{}},s=t.scales||{},n=hs(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!U(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=ds(r,a,Gc(r,i),st.scales[a.type]),c=Kc(l,n),h=e.scales||{};o[r]=De(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||hs(a,t),h=(se[a]||{}).scales||{};Object.keys(h).forEach(d=>{const u=Xc(d,l),f=r[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),De(o[f],[{axis:u},s[f],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];De(a,[st.scales[a.type],st.scale])}),o}function Eo(i){const t=i.options||(i.options={});t.plugins=W(t.plugins,{}),t.scales=Zc(i,t)}function zo(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Qc(i){return i=i||{},i.data=zo(i.data),Eo(i),i}const Rn=new Map,Fo=new Set;function li(i,t){let e=Rn.get(i);return e||(e=t(),Rn.set(i,e),Fo.add(e)),e}const we=(i,t,e)=>{const s=vi(t,e);s!==void 0&&i.add(s)};class Jc{constructor(t){this._config=Qc(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=zo(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Eo(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return li(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return li(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return li(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return li(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>we(l,t,d))),h.forEach(d=>we(l,n,d)),h.forEach(d=>we(l,se[o]||{},d)),h.forEach(d=>we(l,st,d)),h.forEach(d=>we(l,as,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Fo.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,se[e]||{},st.datasets[e]||{},{type:e},st,as]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=En(this._resolverCache,t,n);let l=r;if(eh(r,e)){o.$shared=!1,s=Kt(s)?s():s;const c=this.createResolver(t,s,a);l=pe(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=En(this._resolverCache,t,s);return U(e)?pe(o,e,void 0,n):o}}function En(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:Cs(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const th=i=>U(i)&&Object.getOwnPropertyNames(i).some(t=>Kt(i[t]));function eh(i,t){const{isScriptable:e,isIndexable:s}=yo(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(Kt(a)||th(a))||r&&at(a))return!0}return!1}var ih="4.4.8";const sh=["top","bottom","left","right","chartArea"];function zn(i,t){return i==="top"||i==="bottom"||sh.indexOf(i)===-1&&t==="x"}function Fn(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Hn(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),tt(e&&e.onComplete,[i],t)}function nh(i){const t=i.chart,e=t.options.animation;tt(e&&e.onProgress,[i],t)}function Ho(i){return Os()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const mi={},Bn=i=>{const t=Ho(i);return Object.values(mi).filter(e=>e.canvas===t).pop()};function oh(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function rh(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}function ci(i,t,e){return i.options.clip?i[e]:t[e]}function ah(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:ci(e,t,"left"),right:ci(e,t,"right"),top:ci(s,t,"top"),bottom:ci(s,t,"bottom")}:t}var $t;let Ti=($t=class{static register(...t){At.add(...t),jn()}static unregister(...t){At.remove(...t),jn()}constructor(t,e){const s=this.config=new Jc(e),n=Ho(t),o=Bn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||wc(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=ua(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Wc,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ia(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],mi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ft.listen(this,"complete",Hn),Ft.listen(this,"progress",nh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return J(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return At}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():dn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ln(this.canvas,this.ctx),this}stop(){return Ft.stop(this),this}resize(t,e){Ft.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,dn(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),tt(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};q(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=ds(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),q(o,r=>{const a=r.options,l=a.id,c=ds(l,a),h=W(a.type,r.dtype);(a.position===void 0||zn(a.position,c)!==zn(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const u=At.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),q(n,(r,a)=>{r||delete s[a]}),q(s,r=>{vt.configure(this,r,r.options),vt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Fn("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){q(this.scales,t=>{vt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Zs(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;oh(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;vt.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],q(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,n=!s.disabled,o=ah(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&ws(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&Ms(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Be(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=sc.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=oe(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);ki(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Ft.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};q(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){q(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},q(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!_i(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=xa(t),c=rh(t,this._lastEvent,s,l);s&&(this._lastEvent=null,tt(o.onHover,[t,a,this],this),l&&tt(o.onClick,[t,a,this],this));const h=!_i(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}},F($t,"defaults",st),F($t,"instances",mi),F($t,"overrides",se),F($t,"registry",At),F($t,"version",ih),F($t,"getChart",Bn),$t);function jn(){return q(Ti.instances,i=>i._plugins.invalidate())}function Bo(i,t,e=t){i.lineCap=W(e.borderCapStyle,t.borderCapStyle),i.setLineDash(W(e.borderDash,t.borderDash)),i.lineDashOffset=W(e.borderDashOffset,t.borderDashOffset),i.lineJoin=W(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=W(e.borderWidth,t.borderWidth),i.strokeStyle=W(e.borderColor,t.borderColor)}function lh(i,t,e){i.lineTo(e.x,e.y)}function ch(i){return i.stepped?Ua:i.tension||i.cubicInterpolationMode==="monotone"?Xa:lh}function jo(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=na&&o>a;return{count:s,start:l,loop:t.loop,ilen:c(r+(c?a-S:S))%o,k=()=>{g!==m&&(i.lineTo(h,m),i.lineTo(h,g),i.lineTo(h,b))};for(l&&(f=n[y(0)],i.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=n[y(u)],f.skip)continue;const S=f.x,x=f.y,C=S|0;C===p?(xm&&(m=x),h=(d*h+S)/++d):(k(),i.lineTo(S,x),p=C,d=0,g=m=x),b=x}k()}function us(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?dh:hh}function uh(i){return i.stepped?Cl:i.tension||i.cubicInterpolationMode==="monotone"?Pl:Jt}function fh(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Bo(i,t.options),i.stroke(n)}function gh(i,t,e,s){const{segments:n,options:o}=t,r=us(t);for(const a of n)Bo(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const ph=typeof Path2D=="function";function mh(i,t,e,s){ph&&!t.options.segment?fh(i,t,e,s):gh(i,t,e,s)}class Te extends jt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;xl(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=El(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,r=Al(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=uh(s);let c,h;for(c=0,h=r.length;ct!=="borderDash"&&t!=="fill"});function Nn(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o){let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},bh=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class $n extends jt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=tt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=ft(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Wn(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((p,g)=>{const m=s+e/2+o.measureText(p.text).width;(g===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(g>0?0:1)]=0,f+=h,u++),l[g]={left:0,top:f,row:u,width:m,height:n},c[c.length-1]+=m+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,u=0,f=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:y,itemHeight:k}=xh(s,e,o,m,n);b>0&&f+k+2*a>h&&(d+=u+a,c.push({width:u,height:f}),p+=u+a,g++,u=f=0),l[b]={left:p,top:f,col:g,width:y,height:k},u=Math.max(u,y),f+=k+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=fe(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=ut(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=ut(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=ut(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=ut(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ws(t,this),this._draw(),Ms(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=st.color,l=fe(t.rtl,this.left,this.width),c=ft(r.font),{padding:h}=r,d=c.size,u=d/2;let f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=Wn(r,d),b=function(C,w,v){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();const P=W(v.lineWidth,1);if(n.fillStyle=W(v.fillStyle,a),n.lineCap=W(v.lineCap,"butt"),n.lineDashOffset=W(v.lineDashOffset,0),n.lineJoin=W(v.lineJoin,"miter"),n.lineWidth=P,n.strokeStyle=W(v.strokeStyle,a),n.setLineDash(W(v.lineDash,[])),r.usePointStyle){const E={radius:g*Math.SQRT2/2,pointStyle:v.pointStyle,rotation:v.rotation,borderWidth:P},D=l.xPlus(C,p/2),z=w+u;xo(n,E,D,z,r.pointStyleWidth&&p)}else{const E=w+Math.max((d-g)/2,0),D=l.leftForLtr(C,p),z=Re(v.borderRadius);n.beginPath(),Object.values(z).some(G=>G!==0)?cs(n,{x:D,y:E,w:p,h:g,radius:z}):n.rect(D,E,p,g),n.fill(),P!==0&&n.stroke()}n.restore()},y=function(C,w,v){je(n,v.text,C,w+m/2,c,{strikethrough:v.hidden,textAlign:l.textAlign(v.textAlign)})},k=this.isHorizontal(),S=this._computeTitleHeight();k?f={x:ut(o,this.left+h,this.right-s[0]),y:this.top+h+S,line:0}:f={x:this.left+h,y:ut(o,this.top+S+h,this.bottom-e[0].height),line:0},Mo(this.ctx,t.textDirection);const x=m+h;this.legendItems.forEach((C,w)=>{n.strokeStyle=C.fontColor,n.fillStyle=C.fontColor;const v=n.measureText(C.text).width,P=l.textAlign(C.textAlign||(C.textAlign=r.textAlign)),E=p+u+v;let D=f.x,z=f.y;l.setWidth(this.width),k?w>0&&D+E+h>this.right&&(z=f.y+=x,f.line++,D=f.x=ut(o,this.left+h,this.right-s[f.line])):w>0&&z+x>this.bottom&&(D=f.x=D+e[f.line].width+h,f.line++,z=f.y=ut(o,this.top+S+h,this.bottom-e[f.line].height));const G=l.x(D);if(b(G,z,C),D=Ra(P,D+p+u,k?D+E:this.right,t.rtl),y(l.x(D),z,C),k)f.x+=E+h;else if(typeof C.text!="string"){const nt=c.lineHeight;f.y+=No(C,nt)+h}else f.y+=x}),Co(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=ft(e.font),n=St(e.padding);if(!e.display)return;const o=fe(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=ut(t.align,d,this.right-u);else{const p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);h=c+ut(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=ut(a,d,d+u);r.textAlign=o.textAlign(ks(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,je(r,e.text,f,h,s)}_computeTitleHeight(){const t=this.options.title,e=ft(t.font),s=St(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(Ce(t,this.left,this.right)&&Ce(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;so.length>r.length?o:r)),t+e.size/2+s.measureText(n).width}function yh(i,t,e){let s=i;return typeof t.text!="string"&&(s=No(t,e)),s}function No(i,t){const e=i.text?i.text.length:0;return t*e}function vh(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var kh={id:"legend",_element:$n,start(i,t,e){const s=i.legend=new $n({ctx:i.ctx,options:e,chart:i});vt.configure(i,s,e),vt.addBox(i,s)},stop(i){vt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;vt.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=St(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class Wo extends jt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=at(s.text)?s.text.length:1;this._padding=St(s.padding);const o=n*ft(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=ut(a,s,o),d=e+t,c=o-s):(r.position==="left"?(h=s+t,d=ut(a,n,e),l=lt*-.5):(h=o-t,d=ut(a,e,n),l=lt*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=ft(e.font),o=s.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);je(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:ks(e.align),textBaseline:"middle",translation:[r,a]})}}function Sh(i,t){const e=new Wo({ctx:i.ctx,options:t,chart:i});vt.configure(i,e,t),vt.addBox(i,e),i.titleBlock=e}var wh={id:"title",_element:Wo,start(i,t,e){Sh(i,e)},stop(i){const t=i.titleBlock;vt.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;vt.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Oe={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;ta+l)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o-1?i.split(` +`):i}function Mh(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function Vn(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=ft(t.bodyFont),c=ft(t.titleFont),h=ft(t.footerFont),d=o.length,u=n.length,f=s.length,p=St(t.padding);let g=p.height,m=0,b=s.reduce((S,x)=>S+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*S+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}u&&(g+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const k=function(S){m=Math.max(m,e.measureText(S).width+y)};return e.save(),e.font=c.string,q(i.title,k),e.font=l.string,q(i.beforeBody.concat(i.afterBody),k),y=t.displayColors?r+2+t.boxPadding:0,q(s,S=>{q(S.before,k),q(S.lines,k),q(S.after,k)}),y=0,e.font=h.string,q(i.footer,k),e.restore(),m+=p.width,{width:m,height:g}}function Ch(i,t){const{y:e,height:s}=t;return ei.height-s/2?"bottom":"center"}function Ph(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function Th(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),Ph(c,i,t,e)&&(c="center"),c}function Yn(i,t,e){const s=e.yAlign||t.yAlign||Ch(i,e);return{xAlign:e.xAlign||t.xAlign||Th(i,t,e,s),yAlign:s}}function Oh(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Dh(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Un(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Re(r);let p=Oh(t,a);const g=Dh(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,u)+n:a==="right"&&(p+=Math.max(d,f)+n),{x:yt(p,0,s.width-t.width),y:yt(g,0,s.height-t.height)}}function hi(i,t,e){const s=St(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Xn(i){return Lt([],Ht(i))}function Lh(i,t,e){return oe(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Kn(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const $o={beforeTitle:zt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex"u"?$o[t].call(e,s):n}class fs extends jt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new To(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Lh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=pt(s,"beforeTitle",this,t),o=pt(s,"title",this,t),r=pt(s,"afterTitle",this,t);let a=[];return a=Lt(a,Ht(n)),a=Lt(a,Ht(o)),a=Lt(a,Ht(r)),a}getBeforeBody(t,e){return Xn(pt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return q(t,o=>{const r={before:[],lines:[],after:[]},a=Kn(s,o);Lt(r.before,Ht(pt(a,"beforeLabel",this,o))),Lt(r.lines,pt(a,"label",this,o)),Lt(r.after,Ht(pt(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return Xn(pt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=pt(s,"beforeFooter",this,t),o=pt(s,"footer",this,t),r=pt(s,"afterFooter",this,t);let a=[];return a=Lt(a,Ht(n)),a=Lt(a,Ht(o)),a=Lt(a,Ht(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;lt.filter(h,d,u,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),q(a,h=>{const d=Kn(t.callbacks,h);n.push(pt(d,"labelColor",this,h)),o.push(pt(d,"labelPointStyle",this,h)),r.push(pt(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=Oe[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=Vn(this,s),c=Object.assign({},a,l),h=Yn(this.chart,s,c),d=Un(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Re(a),{x:u,y:f}=t,{width:p,height:g}=e;let m,b,y,k,S,x;return o==="center"?(S=f+g/2,n==="left"?(m=u,b=m-r,k=S+r,x=S-r):(m=u+p,b=m+r,k=S-r,x=S+r),y=m):(n==="left"?b=u+Math.max(l,h)+r:n==="right"?b=u+p-Math.max(c,d)-r:b=this.caretX,o==="top"?(k=f,S=k-r,m=b-r,y=b+r):(k=f+g,S=k+r,m=b+r,y=b-r),x=k),{x1:m,x2:b,x3:y,y1:k,y2:S,y3:x}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=fe(s.rtl,this.x,this.width);for(t.x=hi(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=ft(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,cs(t,{x:g,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),cs(t,{x:m,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,c,l),t.strokeRect(g,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=ft(s.bodyFont);let u=d.lineHeight,f=0;const p=fe(s.rtl,this.x,this.width),g=function(v){e.fillText(v,p.x(t.x+f),t.y+u/2),t.y+=u+o},m=p.textAlign(r);let b,y,k,S,x,C,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=hi(this,m,s),e.fillStyle=s.bodyColor,q(this.beforeBody,g),f=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,S=0,C=n.length;S0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=Oe[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Vn(this,t),l=Object.assign({},r,this._size),c=Yn(e,t,l),h=Un(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=St(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),Mo(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Co(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!_i(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!_i(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=Oe[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}F(fs,"positioners",Oe);var Ah={id:"tooltip",_element:fs,positioners:Oe,afterInit(i,t,e){e&&(i.tooltip=new fs({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:$o},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Ih=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Rh(i,t,e,s){const n=i.indexOf(t);if(n===-1)return Ih(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const Eh=(i,t)=>i===null?null:yt(Math.round(i),0,t);function qn(i){const t=this.getLabels();return i>=0&&ie.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}F(gs,"id","category"),F(gs,"defaults",{ticks:{callback:qn}});function zh(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,p=h-1,{min:g,max:m}=t,b=!J(r),y=!J(a),k=!J(c),S=(m-g)/(d+1);let x=Js((m-g)/p/f)*f,C,w,v,P;if(x<1e-14&&!b&&!y)return[{value:g},{value:m}];P=Math.ceil(m/x)-Math.floor(g/x),P>p&&(x=Js(P*x/p/f)*f),J(l)||(C=Math.pow(10,l),x=Math.ceil(x*C)/C),n==="ticks"?(w=Math.floor(g/x)*x,v=Math.ceil(m/x)*x):(w=g,v=m),b&&y&&o&&Sa((a-r)/o,x/1e3)?(P=Math.round(Math.min((a-r)/x,h)),x=(a-r)/P,w=r,v=a):k?(w=b?r:w,v=y?a:v,P=c-1,x=(v-w)/P):(P=(v-w)/x,Le(P,Math.round(P),x/1e3)?P=Math.round(P):P=Math.ceil(P));const E=Math.max(tn(x),tn(w));C=Math.pow(10,J(l)?E:l),w=Math.round(w*C)/C,v=Math.round(v*C)/C;let D=0;for(b&&(u&&w!==r?(e.push({value:r}),wa)break;e.push({value:z})}return y&&u&&v!==a?e.length&&Le(e[e.length-1].value,a,Gn(a,S,i))?e[e.length-1].value=a:e.push({value:a}):(!y||v===a)&&e.push({value:v}),e}function Gn(i,t,{horizontal:e,minRotation:s}){const n=te(s),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class Fh extends be{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return J(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=s?o:l;if(t){const l=ge(n),c=ge(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=zh(n,o);return t.bounds==="ticks"&&wa(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return po(t,this.chart.options.locale,this.options.ticks.format)}}class ps extends Fh{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=kt(t)?t:0,this.max=kt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=te(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}F(ps,"id","linear"),F(ps,"defaults",{ticks:{callback:bo.formatters.numeric}});const Oi={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},mt=Object.keys(Oi);function Zn(i,t){return i-t}function Qn(i,t){if(J(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),kt(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(He(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function Jn(i,t,e,s){const n=mt.length;for(let o=mt.indexOf(i);o=mt.indexOf(e);o--){const r=mt[o];if(Oi[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return mt[e?mt.indexOf(e):0]}function Bh(i){for(let t=mt.indexOf(i)+1,e=mt.length;t=t?e[s]:e[n];i[o]=!0}}function jh(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function eo(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=yt(e,0,r),s=yt(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||Jn(o.minUnit,e,s,this._getLabelCapacity(e)),a=W(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=He(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const p=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.ticks.callback;if(r)return tt(r,[t,e,s],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],u=s[e],f=c&&d&&u&&u.major;return this._adapter.format(t,n||(f?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=ee(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=ee(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class io extends Ci{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=di(e,this.min),this._tableRange=di(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;rn-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(di(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return di(this._table,s*this._tableRange+this._minPos,!0)}}F(io,"id","timeseries"),F(io,"defaults",Ci.defaults);const Vo="label";function so(i,t){typeof i=="function"?i(t):i&&(i.current=t)}function Nh(i,t){const e=i.options;e&&t&&Object.assign(e,t)}function Yo(i,t){i.labels=t}function Uo(i,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vo;const s=[];i.datasets=t.map(n=>{const o=i.datasets.find(r=>r[e]===n[e]);return!o||!n.data||s.includes(o)?{...n}:(s.push(o),Object.assign(o,n),o)})}function Wh(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vo;const e={labels:[],datasets:[]};return Yo(e,i.labels),Uo(e,i.datasets,t),e}function $h(i,t){const{height:e=150,width:s=300,redraw:n=!1,datasetIdKey:o,type:r,data:a,options:l,plugins:c=[],fallbackContent:h,updateMode:d,...u}=i,f=I.useRef(null),p=I.useRef(null),g=()=>{f.current&&(p.current=new Ti(f.current,{type:r,data:Wh(a,o),options:l&&{...l},plugins:c}),so(t,p.current))},m=()=>{so(t,null),p.current&&(p.current.destroy(),p.current=null)};return I.useEffect(()=>{!n&&p.current&&l&&Nh(p.current,l)},[n,l]),I.useEffect(()=>{!n&&p.current&&Yo(p.current.config.data,a.labels)},[n,a.labels]),I.useEffect(()=>{!n&&p.current&&a.datasets&&Uo(p.current.config.data,a.datasets,o)},[n,a.datasets]),I.useEffect(()=>{p.current&&(n?(m(),setTimeout(g)):p.current.update(d))},[n,l,a.labels,a.datasets,d]),I.useEffect(()=>{p.current&&(m(),setTimeout(g))},[r]),I.useEffect(()=>(g(),()=>m()),[]),ms.createElement("canvas",{ref:f,role:"img",height:e,width:s,...u},h)}const Vh=I.forwardRef($h);function Yh(i,t){return Ti.register(t),I.forwardRef((e,s)=>ms.createElement(Vh,{...e,ref:s,type:i}))}const Uh=Yh("line",gi);Ti.register(gs,ps,bi,Te,wh,Ah,kh);const Gh=({events:i,getFileContent:t})=>{var R,Q,j,rt;const[e,s]=I.useState(""),[n,o]=I.useState(0),[r,a]=I.useState(0),[l,c]=I.useState({}),[h,d]=I.useState(null),[u,f]=I.useState(!1),[p,g]=I.useState({steps:[],logprobs:[]}),[m,b]=I.useState(!1),[y,k]=I.useState(!0),[S,x]=I.useState(!1),C=I.useRef(null),w=I.useRef(null),v=I.useMemo(()=>{const A=new Set;return i.forEach(T=>{const Z=Object.keys(T).find(X=>X!=="type"&&X!=="loss"&&X!=="step"&&X!=="file");Z&&A.add(Z)}),Array.from(A)},[i]),P=I.useMemo(()=>i.filter(A=>A.type==="logprobs").map(A=>A.step).sort((A,T)=>A-T),[i]),E=async A=>{try{const T=await t(A.file),Z=JSON.parse(T),X=Object.keys(A).find(H=>H!=="type"&&H!=="loss"&&H!=="step"&&H!=="file")||"";c(H=>({...H,[X]:{...H[X]||{},[A.step]:Z}}))}catch(T){console.error("Error loading log prob data:",T)}};I.useEffect(()=>{if(!e)return;i.filter(T=>Object.keys(T).find(X=>X!=="type"&&X!=="loss"&&X!=="step"&&X!=="file")===e).forEach(T=>{var Z;(Z=l[e])!=null&&Z[T.step]||E(T)})},[e]),I.useEffect(()=>{v.length>0&&!e&&s(v[0]),P.length>0&&!r&&a(P[0])},[v,P]),I.useEffect(()=>{if(!C.current)return;const A={root:null,rootMargin:"0px",threshold:.1},T=new IntersectionObserver(Z=>{Z.forEach(X=>{k(X.isIntersecting)})},A);return T.observe(C.current),()=>T.disconnect()},[]),I.useEffect(()=>{u&&h&&(async()=>{if(!h||!e)return;b(!0);const T={steps:[],logprobs:[]};try{Object.keys(l[e]||{}).map(Number).sort((H,B)=>H-B).forEach(H=>{const B=l[e][H];if(!B||!B[n])return;const ht=B[n];if(h.position({step:H,logp:T.logprobs[B]})).sort((H,B)=>H.step-B.step);g({steps:X.map(H=>H.step),logprobs:X.map(H=>H.logp)})}finally{b(!1)}})()},[u,h,e,l,n]);const D=A=>{if(S){const T=Math.max(0,Math.min(1,(A+20)/20));return`rgba(255, ${Math.floor(255*T)}, ${Math.floor(255*T)}, 0.3)`}else{const T=Math.exp(A);return`rgba(255, ${Math.floor(255*T)}, ${Math.floor(255*T)}, 0.3)`}},z=e&&r&&((Q=(R=l[e])==null?void 0:R[r])==null?void 0:Q[n]),G=e&&r&&((rt=(j=l[e])==null?void 0:j[r])==null?void 0:rt.length)||0,nt=A=>A.map((T,Z)=>{if(T.token.includes(` +`)){const H=T.token.split(/(\n)/);return L.jsx(ms.Fragment,{children:H.map((B,ht)=>B===` +`?L.jsx(Pt,{sx:{width:"100%",height:0}},`${Z}-${ht}`):B&&L.jsx(Pt,{onClick:()=>{d({token:T.token,tokenId:T.token_id,position:Z}),f(!0)},sx:{cursor:"pointer",p:.5,borderRadius:1,backgroundColor:D(T.logp),"&:hover":{outline:"1px solid blue"}},children:L.jsx(Xe,{variant:"body2",component:"span",children:B})},`${Z}-${ht}`))},Z)}return L.jsx(Pt,{onClick:()=>{d({token:T.token,tokenId:T.token_id,position:Z}),f(!0)},sx:{cursor:"pointer",p:.5,borderRadius:1,backgroundColor:D(T.logp),"&:hover":{outline:"1px solid blue"}},children:L.jsx(Xe,{variant:"body2",component:"span",children:T.token})},Z)});return L.jsxs(Pt,{sx:{mt:2},children:[L.jsxs(Pt,{ref:w,sx:{position:y?"sticky":"static",top:0,zIndex:1,backgroundColor:"white",pb:2,borderBottom:y?"1px solid rgba(0, 0, 0, 0.12)":"none"},children:[L.jsxs(Pt,{sx:{display:"flex",gap:2,mb:2,alignItems:"center"},children:[L.jsxs(Hs,{sx:{minWidth:200},children:[L.jsx(Bs,{children:"Dataset"}),L.jsx(js,{value:e,onChange:A=>s(A.target.value),label:"Dataset",children:v.map(A=>L.jsx(Ns,{value:A,children:A},A))})]}),L.jsxs(Hs,{sx:{minWidth:200},children:[L.jsx(Bs,{children:"Sequence Index"}),L.jsx(js,{value:n,onChange:A=>o(Number(A.target.value)),label:"Sequence Index",children:[...Array(G)].map((A,T)=>L.jsx(Ns,{value:T,children:T},T))})]}),L.jsx(fr,{control:L.jsx(gr,{checked:S,onChange:A=>x(A.target.checked)}),label:"Use LogProb Colors"})]}),L.jsxs(Pt,{sx:{px:2},children:[L.jsxs(Xe,{gutterBottom:!0,children:["Step: ",r]}),L.jsx($r,{value:r,onChange:(A,T)=>a(T),min:Math.min(...P),max:Math.max(...P),step:null,marks:P.map(A=>({value:A,label:A.toString()}))})]})]}),L.jsx(Pt,{ref:C,children:z?L.jsx(pr,{sx:{p:2,mt:2},children:L.jsx(Pt,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:nt(z.tokens)})}):L.jsx(Xe,{children:"No data available for the selected parameters"})}),L.jsxs(mr,{open:u,onClose:()=>f(!1),maxWidth:"md",fullWidth:!0,children:[L.jsxs(br,{children:["Token History: ",h==null?void 0:h.token," (Position: ",h==null?void 0:h.position,")"]}),L.jsx(xr,{children:m?L.jsx(Pt,{sx:{display:"flex",justifyContent:"center",p:4},children:L.jsx(_r,{})}):h&&L.jsx(Pt,{sx:{height:400},children:L.jsx(Uh,{data:{labels:p.steps,datasets:[{label:"Log Probability",data:p.logprobs,borderColor:"rgb(75, 192, 192)",tension:.1}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{title:{display:!0,text:`Log Probability Evolution for Token: ${h.token} at Position ${h.position}`}},scales:{y:{title:{display:!0,text:"Log Probability"}},x:{title:{display:!0,text:"Training Step"}}}}})})})]})]})};export{Gh as LogProbVisualization}; diff --git a/openweights/dashboard/backend/static/assets/LogProbVisualization-DChAruH-.js b/openweights/dashboard/backend/static/assets/LogProbVisualization-DChAruH-.js new file mode 100644 index 0000000..4dfd9ee --- /dev/null +++ b/openweights/dashboard/backend/static/assets/LogProbVisualization-DChAruH-.js @@ -0,0 +1,20 @@ +var ir=Object.defineProperty;var sr=(i,t,e)=>t in i?ir(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var F=(i,t,e)=>sr(i,typeof t!="symbol"?t+"":t,e);import{a as I,u as nr,c as _e,d as or,e as Fs,f as rr,h as Xi,o as ui,i as Ki,_ as Y,k as fi,l as ar,m as lr,n as ue,j as L,s as ne,p as Yt,q as de,t as no,v as cr,w as hr,x as dr,y as Wt,z as ur,R as ms,B as Pt,F as Hs,I as Bs,S as js,M as Ns,A as fr,D as gr,T as Xe,P as pr,E as mr,G as br,H as xr,C as _r}from"./index-CmfXCDny.js";const yr={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function vr(i,t,e=(s,n)=>s===n){return i.length===t.length&&i.every((s,n)=>e(s,t[n]))}const kr=2;function oo(i,t){return i-t}function Ws(i,t){var e;const{index:s}=(e=i.reduce((n,o,r)=>{const a=Math.abs(t-o);return n===null||a({left:`${i}%`}),leap:i=>({width:`${i}%`})},"horizontal-reverse":{offset:i=>({right:`${i}%`}),leap:i=>({width:`${i}%`})},vertical:{offset:i=>({bottom:`${i}%`}),leap:i=>({height:`${i}%`})}},Pr=i=>i;let Ze;function Vs(){return Ze===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Ze=CSS.supports("touch-action","none"):Ze=!0),Ze}function Tr(i){const{"aria-labelledby":t,defaultValue:e,disabled:s=!1,disableSwap:n=!1,isRtl:o=!1,marks:r=!1,max:a=100,min:l=0,name:c,onChange:h,onChangeCommitted:d,orientation:u="horizontal",rootRef:f,scale:p=Pr,step:g=1,shiftStep:m=10,tabIndex:b,value:y}=i,k=I.useRef(void 0),[S,x]=I.useState(-1),[C,w]=I.useState(-1),[v,P]=I.useState(!1),E=I.useRef(0),[D,z]=nr({controlled:y,default:e??l,name:"Slider"}),G=h&&((_,M,O)=>{const $=_.nativeEvent||_,V=new $.constructor($.type,$);Object.defineProperty(V,"target",{writable:!0,value:{value:M,name:c}}),h(V,M,O)}),nt=Array.isArray(D);let R=nt?D.slice().sort(oo):[D];R=R.map(_=>_==null?l:_e(_,l,a));const Q=r===!0&&g!==null?[...Array(Math.floor((a-l)/g)+1)].map((_,M)=>({value:l+g*M})):r||[],j=Q.map(_=>_.value),{isFocusVisibleRef:rt,onBlur:A,onFocus:T,ref:Z}=or(),[X,H]=I.useState(-1),B=I.useRef(null),ht=Fs(Z,B),gt=Fs(f,ht),re=_=>M=>{var O;const $=Number(M.currentTarget.getAttribute("data-index"));T(M),rt.current===!0&&H($),w($),_==null||(O=_.onFocus)==null||O.call(_,M)},ae=_=>M=>{var O;A(M),rt.current===!1&&H(-1),w(-1),_==null||(O=_.onBlur)==null||O.call(_,M)},Ve=(_,M)=>{const O=Number(_.currentTarget.getAttribute("data-index")),$=R[O],V=j.indexOf($);let N=M;if(Q&&g==null){const Ct=j[j.length-1];N>Ct?N=Ct:NM=>{var O;if(g!==null){const $=Number(M.currentTarget.getAttribute("data-index")),V=R[$];let N=null;(M.key==="ArrowLeft"||M.key==="ArrowDown")&&M.shiftKey||M.key==="PageDown"?N=Math.max(V-m,l):((M.key==="ArrowRight"||M.key==="ArrowUp")&&M.shiftKey||M.key==="PageUp")&&(N=Math.min(V+m,a)),N!==null&&(Ve(M,N),M.preventDefault())}_==null||(O=_.onKeyDown)==null||O.call(_,M)};rr(()=>{if(s&&B.current.contains(document.activeElement)){var _;(_=document.activeElement)==null||_.blur()}},[s]),s&&S!==-1&&x(-1),s&&X!==-1&&H(-1);const Li=_=>M=>{var O;(O=_.onChange)==null||O.call(_,M),Ve(M,M.target.valueAsNumber)},Ye=I.useRef(void 0);let Rt=u;o&&u==="horizontal"&&(Rt+="-reverse");const it=({finger:_,move:M=!1})=>{const{current:O}=B,{width:$,height:V,bottom:N,left:Ct}=O.getBoundingClientRect();let Ot;Rt.indexOf("vertical")===0?Ot=(N-_.y)/V:Ot=(_.x-Ct)/$,Rt.indexOf("-reverse")!==-1&&(Ot=1-Ot);let K;if(K=Sr(Ot,l,a),g)K=Mr(K,g,l);else{const ce=Ws(j,K);K=j[ce]}K=_e(K,l,a);let bt=0;if(nt){M?bt=Ye.current:bt=Ws(R,K),n&&(K=_e(K,R[bt-1]||-1/0,R[bt+1]||1/0));const ce=K;K=$s({values:R,newValue:K,index:bt}),n&&M||(bt=K.indexOf(ce),Ye.current=bt)}return{newValue:K,activeIndex:bt}},et=Xi(_=>{const M=Ke(_,k);if(!M)return;if(E.current+=1,_.type==="mousemove"&&_.buttons===0){wt(_);return}const{newValue:O,activeIndex:$}=it({finger:M,move:!0});qe({sliderRef:B,activeIndex:$,setActive:x}),z(O),!v&&E.current>kr&&P(!0),G&&!Ge(O,D)&&G(_,O,$)}),wt=Xi(_=>{const M=Ke(_,k);if(P(!1),!M)return;const{newValue:O}=it({finger:M,move:!0});x(-1),_.type==="touchend"&&w(-1),d&&d(_,O),k.current=void 0,Mt()}),Nt=Xi(_=>{if(s)return;Vs()||_.preventDefault();const M=_.changedTouches[0];M!=null&&(k.current=M.identifier);const O=Ke(_,k);if(O!==!1){const{newValue:V,activeIndex:N}=it({finger:O});qe({sliderRef:B,activeIndex:N,setActive:x}),z(V),G&&!Ge(V,D)&&G(_,V,N)}E.current=0;const $=ui(B.current);$.addEventListener("touchmove",et,{passive:!0}),$.addEventListener("touchend",wt,{passive:!0})}),Mt=I.useCallback(()=>{const _=ui(B.current);_.removeEventListener("mousemove",et),_.removeEventListener("mouseup",wt),_.removeEventListener("touchmove",et),_.removeEventListener("touchend",wt)},[wt,et]);I.useEffect(()=>{const{current:_}=B;return _.addEventListener("touchstart",Nt,{passive:Vs()}),()=>{_.removeEventListener("touchstart",Nt),Mt()}},[Mt,Nt]),I.useEffect(()=>{s&&Mt()},[s,Mt]);const Ai=_=>M=>{var O;if((O=_.onMouseDown)==null||O.call(_,M),s||M.defaultPrevented||M.button!==0)return;M.preventDefault();const $=Ke(M,k);if($!==!1){const{newValue:N,activeIndex:Ct}=it({finger:$});qe({sliderRef:B,activeIndex:Ct,setActive:x}),z(N),G&&!Ge(N,D)&&G(M,N,Ct)}E.current=0;const V=ui(B.current);V.addEventListener("mousemove",et,{passive:!0}),V.addEventListener("mouseup",wt)},dt=xi(nt?R[0]:l,l,a),le=xi(R[R.length-1],l,a)-dt,Ii=(_={})=>{const M=Ki(_),O={onMouseDown:Ai(M||{})},$=Y({},M,O);return Y({},_,{ref:gt},$)},Ri=_=>M=>{var O;(O=_.onMouseOver)==null||O.call(_,M);const $=Number(M.currentTarget.getAttribute("data-index"));w($)},Ei=_=>M=>{var O;(O=_.onMouseLeave)==null||O.call(_,M),w(-1)};return{active:S,axis:Rt,axisProps:Cr,dragging:v,focusedThumbIndex:X,getHiddenInputProps:(_={})=>{var M;const O=Ki(_),$={onChange:Li(O||{}),onFocus:re(O||{}),onBlur:ae(O||{}),onKeyDown:Di(O||{})},V=Y({},O,$);return Y({tabIndex:b,"aria-labelledby":t,"aria-orientation":u,"aria-valuemax":p(a),"aria-valuemin":p(l),name:c,type:"range",min:i.min,max:i.max,step:i.step===null&&i.marks?"any":(M=i.step)!=null?M:void 0,disabled:s},_,V,{style:Y({},yr,{direction:o?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:Ii,getThumbProps:(_={})=>{const M=Ki(_),O={onMouseOver:Ri(M||{}),onMouseLeave:Ei(M||{})};return Y({},_,M,O)},marks:Q,open:C,range:nt,rootRef:gt,trackLeap:le,trackOffset:dt,values:R,getThumbStyle:_=>({pointerEvents:S!==-1&&S!==_?"none":void 0})}}const Or=i=>!i||!fi(i);function Dr(i){return lr("MuiSlider",i)}const _t=ar("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),Lr=i=>{const{open:t}=i;return{offset:ue(t&&_t.valueLabelOpen),circle:_t.valueLabelCircle,label:_t.valueLabelLabel}};function Ar(i){const{children:t,className:e,value:s}=i,n=Lr(i);return t?I.cloneElement(t,{className:ue(t.props.className)},L.jsxs(I.Fragment,{children:[t.props.children,L.jsx("span",{className:ue(n.offset,e),"aria-hidden":!0,children:L.jsx("span",{className:n.circle,children:L.jsx("span",{className:n.label,children:s})})})]})):null}const Ir=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","shiftStep","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"];function Ys(i){return i}const Rr=ne("span",{name:"MuiSlider",slot:"Root",overridesResolver:(i,t)=>{const{ownerState:e}=i;return[t.root,t[`color${Yt(e.color)}`],e.size!=="medium"&&t[`size${Yt(e.size)}`],e.marked&&t.marked,e.orientation==="vertical"&&t.vertical,e.track==="inverted"&&t.trackInverted,e.track===!1&&t.trackFalse]}})(({theme:i})=>{var t;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${_t.disabled}`]:{pointerEvents:"none",cursor:"default",color:(i.vars||i).palette.grey[400]},[`&.${_t.dragging}`]:{[`& .${_t.thumb}, & .${_t.track}`]:{transition:"none"}},variants:[...Object.keys(((t=i.vars)!=null?t:i).palette).filter(e=>{var s;return((s=i.vars)!=null?s:i).palette[e].main}).map(e=>({props:{color:e},style:{color:(i.vars||i).palette[e].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}}),Er=ne("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(i,t)=>t.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),zr=ne("span",{name:"MuiSlider",slot:"Track",overridesResolver:(i,t)=>t.track})(({theme:i})=>{var t;return{display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:i.transitions.create(["left","width","bottom","height"],{duration:i.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.keys(((t=i.vars)!=null?t:i).palette).filter(e=>{var s;return((s=i.vars)!=null?s:i).palette[e].main}).map(e=>({props:{color:e,track:"inverted"},style:Y({},i.vars?{backgroundColor:i.vars.palette.Slider[`${e}Track`],borderColor:i.vars.palette.Slider[`${e}Track`]}:Y({backgroundColor:de.lighten(i.palette[e].main,.62),borderColor:de.lighten(i.palette[e].main,.62)},i.applyStyles("dark",{backgroundColor:de.darken(i.palette[e].main,.5)}),i.applyStyles("dark",{borderColor:de.darken(i.palette[e].main,.5)})))}))]}}),Fr=ne("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(i,t)=>{const{ownerState:e}=i;return[t.thumb,t[`thumbColor${Yt(e.color)}`],e.size!=="medium"&&t[`thumbSize${Yt(e.size)}`]]}})(({theme:i})=>{var t;return{position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:i.transitions.create(["box-shadow","left","bottom"],{duration:i.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(i.vars||i).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${_t.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.keys(((t=i.vars)!=null?t:i).palette).filter(e=>{var s;return((s=i.vars)!=null?s:i).palette[e].main}).map(e=>({props:{color:e},style:{[`&:hover, &.${_t.focusVisible}`]:Y({},i.vars?{boxShadow:`0px 0px 0px 8px rgba(${i.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${de.alpha(i.palette[e].main,.16)}`},{"@media (hover: none)":{boxShadow:"none"}}),[`&.${_t.active}`]:Y({},i.vars?{boxShadow:`0px 0px 0px 14px rgba(${i.vars.palette[e].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${de.alpha(i.palette[e].main,.16)}`})}}))]}}),Hr=ne(Ar,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(i,t)=>t.valueLabel})(({theme:i})=>Y({zIndex:1,whiteSpace:"nowrap"},i.typography.body2,{fontWeight:500,transition:i.transitions.create(["transform"],{duration:i.transitions.duration.shortest}),position:"absolute",backgroundColor:(i.vars||i).palette.grey[600],borderRadius:2,color:(i.vars||i).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${_t.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${_t.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:i.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})),Br=ne("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:i=>no(i)&&i!=="markActive",overridesResolver:(i,t)=>{const{markActive:e}=i;return[t.mark,e&&t.markActive]}})(({theme:i})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(i.vars||i).palette.background.paper,opacity:.8}}]})),jr=ne("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:i=>no(i)&&i!=="markLabelActive",overridesResolver:(i,t)=>t.markLabel})(({theme:i})=>Y({},i.typography.body2,{color:(i.vars||i).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(i.vars||i).palette.text.primary}}]})),Nr=i=>{const{disabled:t,dragging:e,marked:s,orientation:n,track:o,classes:r,color:a,size:l}=i,c={root:["root",t&&"disabled",e&&"dragging",s&&"marked",n==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",a&&`color${Yt(a)}`,l&&`size${Yt(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${Yt(l)}`,a&&`thumbColor${Yt(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return ur(c,Dr,r)},Wr=({children:i})=>i,$r=I.forwardRef(function(t,e){var s,n,o,r,a,l,c,h,d,u,f,p,g,m,b,y,k,S,x,C,w,v,P,E;const D=cr({props:t,name:"MuiSlider"}),z=hr(),{"aria-label":G,"aria-valuetext":nt,"aria-labelledby":R,component:Q="span",components:j={},componentsProps:rt={},color:A="primary",classes:T,className:Z,disableSwap:X=!1,disabled:H=!1,getAriaLabel:B,getAriaValueText:ht,marks:gt=!1,max:re=100,min:ae=0,orientation:Ve="horizontal",shiftStep:Di=10,size:Li="medium",step:Ye=1,scale:Rt=Ys,slotProps:it,slots:et,track:wt="normal",valueLabelDisplay:Nt="off",valueLabelFormat:Mt=Ys}=D,Ai=dr(D,Ir),dt=Y({},D,{isRtl:z,max:re,min:ae,classes:T,disabled:H,disableSwap:X,orientation:Ve,marks:gt,color:A,size:Li,step:Ye,shiftStep:Di,scale:Rt,track:wt,valueLabelDisplay:Nt,valueLabelFormat:Mt}),{axisProps:le,getRootProps:Ii,getHiddenInputProps:Ri,getThumbProps:Ei,open:As,active:zi,axis:xe,focusedThumbIndex:_,range:M,dragging:O,marks:$,values:V,trackOffset:N,trackLeap:Ct,getThumbStyle:Ot}=Tr(Y({},dt,{rootRef:e}));dt.marked=$.length>0&&$.some(ot=>ot.label),dt.dragging=O,dt.focusedThumbIndex=_;const K=Nr(dt),bt=(s=(n=et==null?void 0:et.root)!=null?n:j.Root)!=null?s:Rr,ce=(o=(r=et==null?void 0:et.rail)!=null?r:j.Rail)!=null?o:Er,Is=(a=(l=et==null?void 0:et.track)!=null?l:j.Track)!=null?a:zr,Rs=(c=(h=et==null?void 0:et.thumb)!=null?h:j.Thumb)!=null?c:Fr,Es=(d=(u=et==null?void 0:et.valueLabel)!=null?u:j.ValueLabel)!=null?d:Hr,Fi=(f=(p=et==null?void 0:et.mark)!=null?p:j.Mark)!=null?f:Br,Hi=(g=(m=et==null?void 0:et.markLabel)!=null?m:j.MarkLabel)!=null?g:jr,zs=(b=(y=et==null?void 0:et.input)!=null?y:j.Input)!=null?b:"input",Bi=(k=it==null?void 0:it.root)!=null?k:rt.root,Xo=(S=it==null?void 0:it.rail)!=null?S:rt.rail,ji=(x=it==null?void 0:it.track)!=null?x:rt.track,Ni=(C=it==null?void 0:it.thumb)!=null?C:rt.thumb,Wi=(w=it==null?void 0:it.valueLabel)!=null?w:rt.valueLabel,Ko=(v=it==null?void 0:it.mark)!=null?v:rt.mark,qo=(P=it==null?void 0:it.markLabel)!=null?P:rt.markLabel,Go=(E=it==null?void 0:it.input)!=null?E:rt.input,Zo=Wt({elementType:bt,getSlotProps:Ii,externalSlotProps:Bi,externalForwardedProps:Ai,additionalProps:Y({},Or(bt)&&{as:Q}),ownerState:Y({},dt,Bi==null?void 0:Bi.ownerState),className:[K.root,Z]}),Qo=Wt({elementType:ce,externalSlotProps:Xo,ownerState:dt,className:K.rail}),Jo=Wt({elementType:Is,externalSlotProps:ji,additionalProps:{style:Y({},le[xe].offset(N),le[xe].leap(Ct))},ownerState:Y({},dt,ji==null?void 0:ji.ownerState),className:K.track}),$i=Wt({elementType:Rs,getSlotProps:Ei,externalSlotProps:Ni,ownerState:Y({},dt,Ni==null?void 0:Ni.ownerState),className:K.thumb}),tr=Wt({elementType:Es,externalSlotProps:Wi,ownerState:Y({},dt,Wi==null?void 0:Wi.ownerState),className:K.valueLabel}),Vi=Wt({elementType:Fi,externalSlotProps:Ko,ownerState:dt,className:K.mark}),Yi=Wt({elementType:Hi,externalSlotProps:qo,ownerState:dt,className:K.markLabel}),er=Wt({elementType:zs,getSlotProps:Ri,externalSlotProps:Go,ownerState:dt});return L.jsxs(bt,Y({},Zo,{children:[L.jsx(ce,Y({},Qo)),L.jsx(Is,Y({},Jo)),$.filter(ot=>ot.value>=ae&&ot.value<=re).map((ot,ct)=>{const Ui=xi(ot.value,ae,re),Ue=le[xe].offset(Ui);let Et;return wt===!1?Et=V.indexOf(ot.value)!==-1:Et=wt==="normal"&&(M?ot.value>=V[0]&&ot.value<=V[V.length-1]:ot.value<=V[0])||wt==="inverted"&&(M?ot.value<=V[0]||ot.value>=V[V.length-1]:ot.value>=V[0]),L.jsxs(I.Fragment,{children:[L.jsx(Fi,Y({"data-index":ct},Vi,!fi(Fi)&&{markActive:Et},{style:Y({},Ue,Vi.style),className:ue(Vi.className,Et&&K.markActive)})),ot.label!=null?L.jsx(Hi,Y({"aria-hidden":!0,"data-index":ct},Yi,!fi(Hi)&&{markLabelActive:Et},{style:Y({},Ue,Yi.style),className:ue(K.markLabel,Yi.className,Et&&K.markLabelActive),children:ot.label})):null]},ct)}),V.map((ot,ct)=>{const Ui=xi(ot,ae,re),Ue=le[xe].offset(Ui),Et=Nt==="off"?Wr:Es;return L.jsx(Et,Y({},!fi(Et)&&{valueLabelFormat:Mt,valueLabelDisplay:Nt,value:typeof Mt=="function"?Mt(Rt(ot),ct):Mt,index:ct,open:As===ct||zi===ct||Nt==="on",disabled:H},tr,{children:L.jsx(Rs,Y({"data-index":ct},$i,{className:ue(K.thumb,$i.className,zi===ct&&K.active,_===ct&&K.focusVisible),style:Y({},Ue,Ot(ct),$i.style),children:L.jsx(zs,Y({"data-index":ct,"aria-label":B?B(ct):G,"aria-valuenow":Rt(ot),"aria-labelledby":R,"aria-valuetext":ht?ht(Rt(ot),ct):nt,value:V[ct]},er))}))}),ct)})]}))});/*! + * @kurkle/color v0.3.4 + * https://github.com/kurkle/color#readme + * (c) 2024 Jukka Kurkela + * Released under the MIT License + */function We(i){return i+.5|0}const Ut=(i,t,e)=>Math.max(Math.min(i,e),t);function Me(i){return Ut(We(i*2.55),0,255)}function Xt(i){return Ut(We(i*255),0,255)}function Bt(i){return Ut(We(i/2.55)/100,0,1)}function Us(i){return Ut(We(i*100),0,100)}const xt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ns=[..."0123456789ABCDEF"],Vr=i=>ns[i&15],Yr=i=>ns[(i&240)>>4]+ns[i&15],Qe=i=>(i&240)>>4===(i&15),Ur=i=>Qe(i.r)&&Qe(i.g)&&Qe(i.b)&&Qe(i.a);function Xr(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&xt[i[1]]*17,g:255&xt[i[2]]*17,b:255&xt[i[3]]*17,a:t===5?xt[i[4]]*17:255}:(t===7||t===9)&&(e={r:xt[i[1]]<<4|xt[i[2]],g:xt[i[3]]<<4|xt[i[4]],b:xt[i[5]]<<4|xt[i[6]],a:t===9?xt[i[7]]<<4|xt[i[8]]:255})),e}const Kr=(i,t)=>i<255?t(i):"";function qr(i){var t=Ur(i)?Vr:Yr;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Kr(i.a,t):void 0}const Gr=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ro(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function Zr(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function Qr(i,t,e){const s=ro(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function Jr(i,t,e,s,n){return i===n?(t-e)/s+(t.5?h/(2-o-r):h/(o+r),l=Jr(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function xs(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(Xt)}function _s(i,t,e){return xs(ro,i,t,e)}function ta(i,t,e){return xs(Qr,i,t,e)}function ea(i,t,e){return xs(Zr,i,t,e)}function ao(i){return(i%360+360)%360}function ia(i){const t=Gr.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Me(+t[5]):Xt(+t[5]));const n=ao(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=ta(n,o,r):t[1]==="hsv"?s=ea(n,o,r):s=_s(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function sa(i,t){var e=bs(i);e[0]=ao(e[0]+t),e=_s(e),i.r=e[0],i.g=e[1],i.b=e[2]}function na(i){if(!i)return;const t=bs(i),e=t[0],s=Us(t[1]),n=Us(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${Bt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const Xs={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Ks={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function oa(){const i={},t=Object.keys(Ks),e=Object.keys(Xs);let s,n,o,r,a;for(s=0;s>16&255,o>>8&255,o&255]}return i}let Je;function ra(i){Je||(Je=oa(),Je.transparent=[0,0,0,0]);const t=Je[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const aa=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function la(i){const t=aa.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const r=+t[7];e=t[8]?Me(r):Ut(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Me(s):Ut(s,0,255)),n=255&(t[4]?Me(n):Ut(n,0,255)),o=255&(t[6]?Me(o):Ut(o,0,255)),{r:s,g:n,b:o,a:e}}}function ca(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Bt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const qi=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,he=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function ha(i,t,e){const s=he(Bt(i.r)),n=he(Bt(i.g)),o=he(Bt(i.b));return{r:Xt(qi(s+e*(he(Bt(t.r))-s))),g:Xt(qi(n+e*(he(Bt(t.g))-n))),b:Xt(qi(o+e*(he(Bt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function ti(i,t,e){if(i){let s=bs(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=_s(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function lo(i,t){return i&&Object.assign(t||{},i)}function qs(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=Xt(i[3]))):(t=lo(i,{r:0,g:0,b:0,a:1}),t.a=Xt(t.a)),t}function da(i){return i.charAt(0)==="r"?la(i):ia(i)}class ze{constructor(t){if(t instanceof ze)return t;const e=typeof t;let s;e==="object"?s=qs(t):e==="string"&&(s=Xr(t)||ra(t)||da(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=lo(this._rgb);return t&&(t.a=Bt(t.a)),t}set rgb(t){this._rgb=qs(t)}rgbString(){return this._valid?ca(this._rgb):void 0}hexString(){return this._valid?qr(this._rgb):void 0}hslString(){return this._valid?na(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=ha(this._rgb,t._rgb,e)),this}clone(){return new ze(this.rgb)}alpha(t){return this._rgb.a=Xt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=We(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ti(this._rgb,2,t),this}darken(t){return ti(this._rgb,2,-t),this}saturate(t){return ti(this._rgb,1,t),this}desaturate(t){return ti(this._rgb,1,-t),this}rotate(t){return sa(this._rgb,t),this}}/*! + * Chart.js v4.4.8 + * https://www.chartjs.org + * (c) 2025 Chart.js Contributors + * Released under the MIT License + */function zt(){}const ua=(()=>{let i=0;return()=>i++})();function J(i){return i==null}function at(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function U(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function kt(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function Dt(i,t){return kt(i)?i:t}function W(i,t){return typeof i>"u"?t:i}const fa=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function tt(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function q(i,t,e,s){let n,o,r;if(at(i))for(o=i.length,n=0;ni,x:i=>i.x,y:i=>i.y};function ma(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function ba(i){const t=ma(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function vi(i,t){return(Gs[t]||(Gs[t]=ba(t)))(i)}function ys(i){return i.charAt(0).toUpperCase()+i.slice(1)}const ki=i=>typeof i<"u",Kt=i=>typeof i=="function",Zs=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function xa(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const lt=Math.PI,It=2*lt,_a=It+lt,Si=Number.POSITIVE_INFINITY,ya=lt/180,Tt=lt/2,qt=lt/4,Qs=lt*2/3,os=Math.log10,ge=Math.sign;function Le(i,t,e){return Math.abs(i-t)n-o).pop(),t}function ka(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function He(i){return!ka(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function Sa(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function wa(i,t,e){let s,n,o;for(s=0,n=i.length;sl&&c=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function vs(i,t,e){e=e||(r=>i[r]1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const ee=(i,t,e,s)=>vs(i,e,s?n=>{const o=i[n][t];return oi[n][t]vs(i,e,s=>i[s][t]>=e);function Da(i,t,e){let s=0,n=i.length;for(;ss&&i[n-1]>e;)n--;return s>0||n{const s="_onData"+ys(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function en(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(uo.forEach(o=>{delete i[o]}),delete i._chartjs)}function Aa(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const fo=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function go(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,fo.call(window,()=>{s=!1,i.apply(t,e)}))}}function Ia(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const ks=i=>i==="start"?"left":i==="end"?"right":"center",ut=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Ra=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function Ea(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:r,vScale:a,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=r.axis,{min:d,max:u,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(n=Math.min(ee(l,h,d).lo,e?s:ee(t,h,r.getPixelForValue(d)).lo),c){const g=l.slice(0,n+1).reverse().findIndex(m=>!J(m[a.axis]));n-=Math.max(0,g)}n=yt(n,0,s-1)}if(p){let g=Math.max(ee(l,r.axis,u,!0).hi+1,e?0:ee(t,h,r.getPixelForValue(u),!0).hi+1);if(c){const m=l.slice(g-1).findIndex(b=>!J(b[a.axis]));g+=Math.max(0,m)}o=yt(g,n,s)-n}else o=s-n}return{start:n,count:o}}function za(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const ei=i=>i===0||i===1,sn=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*It/e)),nn=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*It/e)+1,Ae={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*Tt)+1,easeOutSine:i=>Math.sin(i*Tt),easeInOutSine:i=>-.5*(Math.cos(lt*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>ei(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>ei(i)?i:sn(i,.075,.3),easeOutElastic:i=>ei(i)?i:nn(i,.075,.3),easeInOutElastic(i){return ei(i)?i:i<.5?.5*sn(i*2,.1125,.45):.5+.5*nn(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Ae.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Ae.easeInBounce(i*2)*.5:Ae.easeOutBounce(i*2-1)*.5+.5};function Ss(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function on(i){return Ss(i)?i:new ze(i)}function Gi(i){return Ss(i)?i:new ze(i).saturate(.5).darken(.1).hexString()}const Fa=["x","y","borderWidth","radius","tension"],Ha=["color","borderColor","backgroundColor"];function Ba(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:Ha},numbers:{type:"number",properties:Fa}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function ja(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const rn=new Map;function Na(i,t){t=t||{};const e=i+JSON.stringify(t);let s=rn.get(e);return s||(s=new Intl.NumberFormat(i,t),rn.set(e,s)),s}function po(i,t,e){return Na(t,e).format(i)}const mo={values(i){return at(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=Wa(i,e)}const r=os(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),po(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";const s=e[t].significand||i/Math.pow(10,Math.floor(os(i)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?mo.numeric.call(this,i,t,e):""}};function Wa(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var bo={formatters:mo};function $a(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:bo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const se=Object.create(null),as=Object.create(null);function Ie(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;ss.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>Gi(n.backgroundColor),this.hoverBorderColor=(s,n)=>Gi(n.borderColor),this.hoverColor=(s,n)=>Gi(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Zi(this,t,e)}get(t){return Ie(this,t)}describe(t,e){return Zi(as,t,e)}override(t,e){return Zi(se,t,e)}route(t,e,s,n){const o=Ie(this,t),r=Ie(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return U(l)?Object.assign({},c,l):W(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var st=new Va({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ba,ja,$a]);function Ya(i){return!i||J(i.size)||J(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function an(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function Gt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function ln(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function ls(i,t,e,s){xo(i,t,e,s,null)}function xo(i,t,e,s,n){let o,r,a,l,c,h,d,u;const f=t.pointStyle,p=t.rotation,g=t.radius;let m=(p||0)*ya;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(m),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(g)||g<=0)){switch(i.beginPath(),f){default:n?i.ellipse(e,s,n/2,g,0,0,It):i.arc(e,s,g,0,It),i.closePath();break;case"triangle":h=n?n/2:g,i.moveTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=Qs,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=Qs,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),i.closePath();break;case"rectRounded":c=g*.516,l=g-c,r=Math.cos(m+qt)*l,d=Math.cos(m+qt)*(n?n/2-c:l),a=Math.sin(m+qt)*l,u=Math.sin(m+qt)*(n?n/2-c:l),i.arc(e-d,s-a,c,m-lt,m-Tt),i.arc(e+u,s-r,c,m-Tt,m),i.arc(e+d,s+a,c,m,m+Tt),i.arc(e-u,s+r,c,m+Tt,m+lt),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}m+=qt;case"rectRot":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+u,s-r),i.lineTo(e+d,s+a),i.lineTo(e-u,s+r),i.closePath();break;case"crossRot":m+=qt;case"cross":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r);break;case"star":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r),m+=qt,d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+u,s-r),i.lineTo(e-u,s+r);break;case"line":r=n?n/2:Math.cos(m)*g,a=Math.sin(m)*g,i.moveTo(e-r,s-a),i.lineTo(e+r,s+a);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function Be(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,Ka(i,o),l=0;l+i||0;function _o(i,t){const e={},s=U(t),n=s?Object.keys(t):t,o=U(i)?s?r=>W(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=tl(o(r));return e}function el(i){return _o(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Re(i){return _o(i,["topLeft","topRight","bottomLeft","bottomRight"])}function St(i){const t=el(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ft(i,t){i=i||{},t=t||st.font;let e=W(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=W(i.style,t.style);s&&!(""+s).match(Qa)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:W(i.family,t.family),lineHeight:Ja(W(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:W(i.weight,t.weight),string:""};return n.string=Ya(n),n}function ii(i,t,e,s){let n,o,r;for(n=0,o=i.length;ne&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function oe(i,t){return Object.assign(Object.create(i),t)}function Cs(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=So("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:a=>Cs([a,...i],t,o,s)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return vo(a,l,()=>hl(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return hn(a).includes(l)},ownKeys(a){return hn(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function pe(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:yo(i,s),setContext:o=>pe(i,o,e,s),override:o=>pe(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return vo(o,r,()=>nl(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function yo(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:Kt(e)?e:()=>e,isIndexable:Kt(s)?s:()=>s}}const sl=(i,t)=>i?i+ys(t):t,Ps=(i,t)=>U(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function vo(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function nl(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return Kt(a)&&r.isScriptable(t)&&(a=ol(t,a,i,e)),at(a)&&a.length&&(a=rl(t,a,i,r.isIndexable)),Ps(t,a)&&(a=pe(a,n,o&&o[t],r)),a}function ol(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||s);return a.delete(i),Ps(i,l)&&(l=Ts(n._scopes,n,i,l)),l}function rl(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(U(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=Ts(c,n,i,h);t.push(pe(d,o,r&&r[i],a))}}return t}function ko(i,t,e){return Kt(i)?i(t,e):i}const al=(i,t)=>i===!0?t:typeof i=="string"?vi(t,i):void 0;function ll(i,t,e,s,n){for(const o of t){const r=al(e,o);if(r){i.add(r);const a=ko(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==s)return a}else if(r===!1&&typeof s<"u"&&e!==s)return null}return!1}function Ts(i,t,e,s){const n=t._rootScopes,o=ko(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=cn(a,r,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=cn(a,r,o,l,s),l===null)?!1:Cs(Array.from(a),[""],n,o,()=>cl(t,e,s))}function cn(i,t,e,s,n){for(;e;)e=ll(i,t,e,s,n);return e}function cl(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return at(n)&&U(e)?e:n||{}}function hl(i,t,e,s){let n;for(const o of t)if(n=So(sl(o,i),e),typeof n<"u")return Ps(i,n)?Ts(e,s,i,n):n}function So(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function hn(i){let t=i._keys;return t||(t=i._keys=dl(i._scopes)),t}function dl(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}const ul=Number.EPSILON||1e-14,me=(i,t)=>ti==="x"?"y":"x";function fl(i,t,e,s){const n=i.skip?t:i,o=t,r=e.skip?t:e,a=rs(o,n),l=rs(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,u=s*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function gl(i,t,e){const s=i.length;let n,o,r,a,l,c=me(i,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")ml(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,r=i.length;oi.ownerDocument.defaultView.getComputedStyle(i,null);function _l(i,t){return Pi(i).getPropertyValue(t)}const yl=["top","right","bottom","left"];function ie(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=yl[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const vl=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function kl(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(vl(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Qt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Pi(e),o=n.boxSizing==="border-box",r=ie(n,"padding"),a=ie(n,"border","width"),{x:l,y:c,box:h}=kl(i,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:p}=t;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/f*e.width/s),y:Math.round((c-u)/p*e.height/s)}}function Sl(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&Ds(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Pi(o),l=ie(a,"border","width"),c=ie(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=wi(a.maxWidth,o,"clientWidth"),n=wi(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||Si,maxHeight:n||Si}}const ni=i=>Math.round(i*10)/10;function wl(i,t,e,s){const n=Pi(i),o=ie(n,"margin"),r=wi(n.maxWidth,i,"clientWidth")||Si,a=wi(n.maxHeight,i,"clientHeight")||Si,l=Sl(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const u=ie(n,"border","width"),f=ie(n,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=ni(Math.min(c,r,l.maxWidth)),h=ni(Math.min(h,a,l.maxHeight)),c&&!h&&(h=ni(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=ni(Math.floor(h*s))),{width:c,height:h}}function dn(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Ml=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Os()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function un(i,t){const e=_l(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Jt(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Cl(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Pl(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=Jt(i,n,e),a=Jt(n,o,e),l=Jt(o,t,e),c=Jt(r,a,e),h=Jt(a,l,e);return Jt(c,h,e)}const Tl=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Ol=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function fe(i,t,e){return i?Tl(t,e):Ol()}function Mo(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Co(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Po(i){return i==="angle"?{between:ho,compare:Pa,normalize:Vt}:{between:Ce,compare:(t,e)=>t-e,normalize:t=>t}}function fn({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function Dl(i,t,e){const{property:s,start:n,end:o}=e,{between:r,normalize:a}=Po(s),l=t.length;let{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;ul(n,k,b)&&a(n,k)!==0,x=()=>a(o,b)===0||l(o,k,b),C=()=>g||S(),w=()=>!g||x();for(let v=h,P=h;v<=d;++v)y=t[v%r],!y.skip&&(b=c(y[s]),b!==k&&(g=l(b,n,o),m===null&&C()&&(m=a(b,n)===0?v:P),m!==null&&w()&&(p.push(fn({start:m,end:v,loop:u,count:r,style:f})),m=null),P=v,k=b));return m!==null&&p.push(fn({start:m,end:d,loop:u,count:r,style:f})),p}function Al(i,t){const e=[],s=i.segments;for(let n=0;nn&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function Rl(i,t,e,s){const n=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?a.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:s}),o}function El(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:r,end:a}=Il(e,n,o,s);if(s===!0)return gn(i,[{start:r,end:a,loop:o}],e,t);const l=aa({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=fo.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ft=new Hl;const mn="transparent",Bl={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=on(i||mn),n=s.valid&&on(t||mn);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class jl{constructor(t,e,s,n){const o=e[s];n=ii([t.to,n,o,t.from]);const r=ii([t.from,o,n]);this._active=!0,this._fn=t.fn||Bl[t.type||typeof r],this._easing=Ae[t.easing]||Ae.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ii([t.to,e,n,t.from]),this._from=ii([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n{const o=t[n];if(!U(o))return;const r={};for(const a of e)r[a]=o[a];(at(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=Wl(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&Nl(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new jl(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return Ft.add(this._chart,s),!0}}function Nl(i,t){const e=[],s=Object.keys(t);for(let n=0;n0||!e&&o<0)return n.index}return null}function yn(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=Ul(o,r,s),d=t.length;let u;for(let f=0;fe[s].axis===t).shift()}function ql(i,t){return oe(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Gl(i,t,e){return oe(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ye(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const ts=i=>i==="reset"||i==="none",vn=(i,t)=>t?i:Object.assign({},i),Zl=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Oo(e,!0),values:null};class Ee{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Qi(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ye(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,u,f,p)=>d==="x"?u:d==="r"?p:f,o=e.xAxisID=W(s.xAxisID,Ji(t,"x")),r=e.yAxisID=W(s.yAxisID,Ji(t,"y")),a=e.rAxisID=W(s.rAxisID,Ji(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&en(this._data,this),t._stacked&&ye(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(U(e)){const n=this._cachedMeta;this._data=Yl(e,n)}else if(s!==e){if(s){en(s,this);const n=this._cachedMeta;ye(n),n._parsed=[]}e&&Object.isExtensible(e)&&La(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Qi(e.vScale,e),e.stack!==s.stack&&(n=!0,ye(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(yn(this,e._parsed),e._stacked=Qi(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,u;if(this._parsing===!1)s._parsed=n,s._sorted=!0,u=n;else{at(n[t])?u=this.parseArrayData(s,n,t,e):U(n[t])?u=this.parseObjectData(s,n,t,e):u=this.parsePrimitiveData(s,n,t,e);const f=()=>d[a]===null||c&&d[a]g||d=0;--u)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n=0&&tthis.getContext(s,n,e),g=c.resolveNamedOptions(u,f,p,d);return g.$shared&&(g.$shared=l,o[r]=Object.freeze(vn(g,l))),g}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,s,e))}const c=new To(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ts(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){ts(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!ts(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a0&&this.getParsed(e-1);for(let x=0;x=y){w.skip=!0;continue}const v=this.getParsed(x),P=J(v[f]),E=w[u]=r.getPixelForValue(v[u],x),D=w[f]=o||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,v,l):v[f],x);w.skip=isNaN(E)||isNaN(D)||P,w.stop=x>0&&Math.abs(v[u]-S[u])>m,g&&(w.parsed=v,w.raw=c.data[x]),d&&(w.options=h||this.resolveDataElementOptions(x,C.active?"active":n)),b||this.updateElement(C,x,w,n),S=v}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}F(gi,"id","line"),F(gi,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),F(gi,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Zt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ls{constructor(t){F(this,"options");this.options=t||{}}static override(t){Object.assign(Ls.prototype,t)}init(){}formats(){return Zt()}parse(){return Zt()}format(){return Zt()}add(){return Zt()}diff(){return Zt()}startOf(){return Zt()}endOf(){return Zt()}}var Ql={_date:Ls};function Jl(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?Oa:ee;if(s){if(n._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const u=c(o,t,e-d),f=c(o,t,e+d);return{lo:u.lo,hi:f.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=n._cachedMeta,{_parsed:u}=i,f=u.slice(0,h.lo+1).reverse().findIndex(g=>!J(g[d.axis]));h.lo-=Math.max(0,f);const p=u.slice(h.hi).findIndex(g=>!J(g[d.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function $e(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a{l[r]&&l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var sc={evaluateInteractionItems:$e,modes:{index(i,t,e,s){const n=Qt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?es(i,n,o,s,r):is(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=Qt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?es(i,n,o,s,r):is(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;he.pos===t)}function Sn(i,t){return i.filter(e=>Do.indexOf(e.pos)===-1&&e.box.axis===t)}function ke(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function nc(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;ec.box.fullSize),!0),s=ke(ve(t,"left"),!0),n=ke(ve(t,"right")),o=ke(ve(t,"top"),!0),r=ke(ve(t,"bottom")),a=Sn(t,"x"),l=Sn(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:ve(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function wn(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function Lo(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function lc(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!U(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&Lo(r,o.getPadding());const a=Math.max(0,t.outerWidth-wn(r,i,"left","right")),l=Math.max(0,t.outerHeight-wn(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function cc(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function hc(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function Pe(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},n);Lo(u,St(s));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),p=rc(l.concat(c),d);Pe(a.fullSize,f,d,p),Pe(l,f,d,p),Pe(c,f,d,p)&&Pe(l,f,d,p),cc(f),Mn(a.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,Mn(a.rightAndBottom,f,d,p),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},q(a.chartArea,g=>{const m=g.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Ao{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class dc extends Ao{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const pi="$chartjs",uc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Cn=i=>i===null||i==="";function fc(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[pi]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Cn(n)){const o=un(i,"width");o!==void 0&&(i.width=o)}if(Cn(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=un(i,"height");o!==void 0&&(i.height=o)}return i}const Io=Ml?{passive:!0}:!1;function gc(i,t,e){i&&i.addEventListener(t,e,Io)}function pc(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,Io)}function mc(i,t){const e=uc[i.type]||i.type,{x:s,y:n}=Qt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Mi(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function bc(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Mi(a.addedNodes,s),r=r&&!Mi(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function xc(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Mi(a.removedNodes,s),r=r&&!Mi(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Ne=new Map;let Pn=0;function Ro(){const i=window.devicePixelRatio;i!==Pn&&(Pn=i,Ne.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function _c(i,t){Ne.size||window.addEventListener("resize",Ro),Ne.set(i,t)}function yc(i){Ne.delete(i),Ne.size||window.removeEventListener("resize",Ro)}function vc(i,t,e){const s=i.canvas,n=s&&Ds(s);if(!n)return;const o=go((a,l)=>{const c=n.clientWidth;e(a,l),c{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),_c(i,o),r}function ss(i,t,e){e&&e.disconnect(),t==="resize"&&yc(i)}function kc(i,t,e){const s=i.canvas,n=go(o=>{i.ctx!==null&&e(mc(o,i))},i);return gc(s,t,n),n}class Sc extends Ao{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(fc(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[pi])return!1;const s=e[pi].initial;["height","width"].forEach(o=>{const r=s[o];J(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[pi],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:bc,detach:xc,resize:vc}[e]||kc;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:ss,detach:ss,resize:ss}[e]||pc)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return wl(t,e,s,n)}isAttached(t){const e=t&&Ds(t);return!!(e&&e.isConnected)}}function wc(i){return!Os()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?dc:Sc}class jt{constructor(){F(this,"x");F(this,"y");F(this,"active",!1);F(this,"options");F(this,"$animations")}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return He(this.x)&&He(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}F(jt,"defaults",{}),F(jt,"defaultRoutes");function Mc(i,t){const e=i.options.ticks,s=Cc(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Tc(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return Oc(t,c,o,r/n),c;const h=Pc(o,t,n);if(r>0){let d,u;const f=r>1?Math.round((l-a)/(r-1)):null;for(ri(t,c,h,J(f)?0:a-f,a),d=0,u=r-1;dn)return l}return Math.max(n,1)}function Tc(i){const t=[];let e,s;for(e=0,s=i.length;ei==="left"?"right":i==="right"?"left":i,Tn=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,On=(i,t)=>Math.min(t||i,i);function Dn(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;or+a)))return l}function Ic(i,t){q(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;os?s:e,s=n&&e>s?e:s,{min:Dt(e,Dt(s,e)),max:Dt(s,Dt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){tt(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=il(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=yt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),d+6>a&&(a=f/(s-(t.offset?.5:1)),l=this.maxHeight-Se(t.grid)-e.padding-Ln(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=Ma(Math.min(Math.asin(yt((h.highest.height+6)/a,-1,1)),Math.asin(yt(l/c,-1,1))-Math.asin(yt(u/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){tt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){tt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Ln(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Se(o)+l):(t.height=this.maxHeight,t.width=Se(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,p=te(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(a){const b=s.mirror?0:m*d.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=s.mirror?0:g*d.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,m,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=n*t.width,f=s*e.height):(u=s*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){tt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e({width:r[P]||0,height:a[P]||0});return{first:v(0),last:v(e-1),widest:v(C),highest:v(w),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Ta(this._alignToPixels?Gt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*n?a/s:l/n:l*n0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=Se(o),f=[],p=a.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(Q){return Gt(s,Q,g)};let y,k,S,x,C,w,v,P,E,D,z,G;if(r==="top")y=b(this.bottom),w=this.bottom-u,P=y-m,D=b(t.top)+m,G=t.bottom;else if(r==="bottom")y=b(this.top),D=t.top,G=b(t.bottom)-m,w=y+m,P=this.top+u;else if(r==="left")y=b(this.right),C=this.right-u,v=y-m,E=b(t.left)+m,z=t.right;else if(r==="right")y=b(this.left),E=t.left,z=b(t.right)-m,C=y+m,v=this.left+u;else if(e==="x"){if(r==="center")y=b((t.top+t.bottom)/2+.5);else if(U(r)){const Q=Object.keys(r)[0],j=r[Q];y=b(this.chart.scales[Q].getPixelForValue(j))}D=t.top,G=t.bottom,w=y+m,P=w+u}else if(e==="y"){if(r==="center")y=b((t.left+t.right)/2);else if(U(r)){const Q=Object.keys(r)[0],j=r[Q];y=b(this.chart.scales[Q].getPixelForValue(j))}C=y-m,v=C-u,E=t.left,z=t.right}const nt=W(n.ticks.maxTicksLimit,d),R=Math.max(1,Math.ceil(d/nt));for(k=0;k0&&(gt-=B/2);break}Z={left:gt,top:ht,width:B+X.width,height:H+X.height,color:R.backdropColor}}m.push({label:S,font:P,textOffset:z,options:{rotation:g,color:j,strokeColor:rt,strokeWidth:A,textAlign:T,textBaseline:G,translation:[x,C],backdrop:Z}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-te(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");st.route(o,n,l,a)})}function jc(i){return"id"in i&&"defaults"in i}class Nc{constructor(){this.controllers=new ai(Ee,"datasets",!0),this.elements=new ai(jt,"elements"),this.plugins=new ai(Object,"plugins"),this.scales=new ai(be,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):q(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=ys(t);tt(s["before"+n],[],s),e[t](s),tt(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;eo.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function $c(i){const t={},e=[],s=Object.keys(At.plugins.items);for(let o=0;o1&&An(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function In(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Gc(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return In(i,"x",e[0])||In(i,"y",e[0])}return{}}function Zc(i,t){const e=se[i.type]||{scales:{}},s=t.scales||{},n=hs(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!U(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=ds(r,a,Gc(r,i),st.scales[a.type]),c=Kc(l,n),h=e.scales||{};o[r]=De(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||hs(a,t),h=(se[a]||{}).scales||{};Object.keys(h).forEach(d=>{const u=Xc(d,l),f=r[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),De(o[f],[{axis:u},s[f],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];De(a,[st.scales[a.type],st.scale])}),o}function Eo(i){const t=i.options||(i.options={});t.plugins=W(t.plugins,{}),t.scales=Zc(i,t)}function zo(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Qc(i){return i=i||{},i.data=zo(i.data),Eo(i),i}const Rn=new Map,Fo=new Set;function li(i,t){let e=Rn.get(i);return e||(e=t(),Rn.set(i,e),Fo.add(e)),e}const we=(i,t,e)=>{const s=vi(t,e);s!==void 0&&i.add(s)};class Jc{constructor(t){this._config=Qc(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=zo(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Eo(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return li(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return li(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return li(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return li(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>we(l,t,d))),h.forEach(d=>we(l,n,d)),h.forEach(d=>we(l,se[o]||{},d)),h.forEach(d=>we(l,st,d)),h.forEach(d=>we(l,as,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Fo.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,se[e]||{},st.datasets[e]||{},{type:e},st,as]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=En(this._resolverCache,t,n);let l=r;if(eh(r,e)){o.$shared=!1,s=Kt(s)?s():s;const c=this.createResolver(t,s,a);l=pe(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=En(this._resolverCache,t,s);return U(e)?pe(o,e,void 0,n):o}}function En(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:Cs(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const th=i=>U(i)&&Object.getOwnPropertyNames(i).some(t=>Kt(i[t]));function eh(i,t){const{isScriptable:e,isIndexable:s}=yo(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(Kt(a)||th(a))||r&&at(a))return!0}return!1}var ih="4.4.8";const sh=["top","bottom","left","right","chartArea"];function zn(i,t){return i==="top"||i==="bottom"||sh.indexOf(i)===-1&&t==="x"}function Fn(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Hn(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),tt(e&&e.onComplete,[i],t)}function nh(i){const t=i.chart,e=t.options.animation;tt(e&&e.onProgress,[i],t)}function Ho(i){return Os()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const mi={},Bn=i=>{const t=Ho(i);return Object.values(mi).filter(e=>e.canvas===t).pop()};function oh(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function rh(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}function ci(i,t,e){return i.options.clip?i[e]:t[e]}function ah(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:ci(e,t,"left"),right:ci(e,t,"right"),top:ci(s,t,"top"),bottom:ci(s,t,"bottom")}:t}var $t;let Ti=($t=class{static register(...t){At.add(...t),jn()}static unregister(...t){At.remove(...t),jn()}constructor(t,e){const s=this.config=new Jc(e),n=Ho(t),o=Bn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||wc(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=ua(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Wc,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ia(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],mi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ft.listen(this,"complete",Hn),Ft.listen(this,"progress",nh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return J(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return At}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():dn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ln(this.canvas,this.ctx),this}stop(){return Ft.stop(this),this}resize(t,e){Ft.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,dn(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),tt(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};q(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=ds(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),q(o,r=>{const a=r.options,l=a.id,c=ds(l,a),h=W(a.type,r.dtype);(a.position===void 0||zn(a.position,c)!==zn(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const u=At.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),q(n,(r,a)=>{r||delete s[a]}),q(s,r=>{vt.configure(this,r,r.options),vt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Fn("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){q(this.scales,t=>{vt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Zs(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;oh(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;vt.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],q(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,n=!s.disabled,o=ah(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&ws(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&Ms(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Be(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=sc.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=oe(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);ki(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Ft.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};q(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){q(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},q(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!_i(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=xa(t),c=rh(t,this._lastEvent,s,l);s&&(this._lastEvent=null,tt(o.onHover,[t,a,this],this),l&&tt(o.onClick,[t,a,this],this));const h=!_i(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}},F($t,"defaults",st),F($t,"instances",mi),F($t,"overrides",se),F($t,"registry",At),F($t,"version",ih),F($t,"getChart",Bn),$t);function jn(){return q(Ti.instances,i=>i._plugins.invalidate())}function Bo(i,t,e=t){i.lineCap=W(e.borderCapStyle,t.borderCapStyle),i.setLineDash(W(e.borderDash,t.borderDash)),i.lineDashOffset=W(e.borderDashOffset,t.borderDashOffset),i.lineJoin=W(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=W(e.borderWidth,t.borderWidth),i.strokeStyle=W(e.borderColor,t.borderColor)}function lh(i,t,e){i.lineTo(e.x,e.y)}function ch(i){return i.stepped?Ua:i.tension||i.cubicInterpolationMode==="monotone"?Xa:lh}function jo(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=na&&o>a;return{count:s,start:l,loop:t.loop,ilen:c(r+(c?a-S:S))%o,k=()=>{g!==m&&(i.lineTo(h,m),i.lineTo(h,g),i.lineTo(h,b))};for(l&&(f=n[y(0)],i.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=n[y(u)],f.skip)continue;const S=f.x,x=f.y,C=S|0;C===p?(xm&&(m=x),h=(d*h+S)/++d):(k(),i.lineTo(S,x),p=C,d=0,g=m=x),b=x}k()}function us(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?dh:hh}function uh(i){return i.stepped?Cl:i.tension||i.cubicInterpolationMode==="monotone"?Pl:Jt}function fh(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Bo(i,t.options),i.stroke(n)}function gh(i,t,e,s){const{segments:n,options:o}=t,r=us(t);for(const a of n)Bo(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const ph=typeof Path2D=="function";function mh(i,t,e,s){ph&&!t.options.segment?fh(i,t,e,s):gh(i,t,e,s)}class Te extends jt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;xl(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=El(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,r=Al(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=uh(s);let c,h;for(c=0,h=r.length;ct!=="borderDash"&&t!=="fill"});function Nn(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o){let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},bh=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class $n extends jt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=tt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=ft(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Wn(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((p,g)=>{const m=s+e/2+o.measureText(p.text).width;(g===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(g>0?0:1)]=0,f+=h,u++),l[g]={left:0,top:f,row:u,width:m,height:n},c[c.length-1]+=m+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,u=0,f=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:y,itemHeight:k}=xh(s,e,o,m,n);b>0&&f+k+2*a>h&&(d+=u+a,c.push({width:u,height:f}),p+=u+a,g++,u=f=0),l[b]={left:p,top:f,col:g,width:y,height:k},u=Math.max(u,y),f+=k+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=fe(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=ut(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=ut(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=ut(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=ut(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ws(t,this),this._draw(),Ms(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=st.color,l=fe(t.rtl,this.left,this.width),c=ft(r.font),{padding:h}=r,d=c.size,u=d/2;let f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=Wn(r,d),b=function(C,w,v){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();const P=W(v.lineWidth,1);if(n.fillStyle=W(v.fillStyle,a),n.lineCap=W(v.lineCap,"butt"),n.lineDashOffset=W(v.lineDashOffset,0),n.lineJoin=W(v.lineJoin,"miter"),n.lineWidth=P,n.strokeStyle=W(v.strokeStyle,a),n.setLineDash(W(v.lineDash,[])),r.usePointStyle){const E={radius:g*Math.SQRT2/2,pointStyle:v.pointStyle,rotation:v.rotation,borderWidth:P},D=l.xPlus(C,p/2),z=w+u;xo(n,E,D,z,r.pointStyleWidth&&p)}else{const E=w+Math.max((d-g)/2,0),D=l.leftForLtr(C,p),z=Re(v.borderRadius);n.beginPath(),Object.values(z).some(G=>G!==0)?cs(n,{x:D,y:E,w:p,h:g,radius:z}):n.rect(D,E,p,g),n.fill(),P!==0&&n.stroke()}n.restore()},y=function(C,w,v){je(n,v.text,C,w+m/2,c,{strikethrough:v.hidden,textAlign:l.textAlign(v.textAlign)})},k=this.isHorizontal(),S=this._computeTitleHeight();k?f={x:ut(o,this.left+h,this.right-s[0]),y:this.top+h+S,line:0}:f={x:this.left+h,y:ut(o,this.top+S+h,this.bottom-e[0].height),line:0},Mo(this.ctx,t.textDirection);const x=m+h;this.legendItems.forEach((C,w)=>{n.strokeStyle=C.fontColor,n.fillStyle=C.fontColor;const v=n.measureText(C.text).width,P=l.textAlign(C.textAlign||(C.textAlign=r.textAlign)),E=p+u+v;let D=f.x,z=f.y;l.setWidth(this.width),k?w>0&&D+E+h>this.right&&(z=f.y+=x,f.line++,D=f.x=ut(o,this.left+h,this.right-s[f.line])):w>0&&z+x>this.bottom&&(D=f.x=D+e[f.line].width+h,f.line++,z=f.y=ut(o,this.top+S+h,this.bottom-e[f.line].height));const G=l.x(D);if(b(G,z,C),D=Ra(P,D+p+u,k?D+E:this.right,t.rtl),y(l.x(D),z,C),k)f.x+=E+h;else if(typeof C.text!="string"){const nt=c.lineHeight;f.y+=No(C,nt)+h}else f.y+=x}),Co(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=ft(e.font),n=St(e.padding);if(!e.display)return;const o=fe(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=ut(t.align,d,this.right-u);else{const p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);h=c+ut(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=ut(a,d,d+u);r.textAlign=o.textAlign(ks(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,je(r,e.text,f,h,s)}_computeTitleHeight(){const t=this.options.title,e=ft(t.font),s=St(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(Ce(t,this.left,this.right)&&Ce(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;so.length>r.length?o:r)),t+e.size/2+s.measureText(n).width}function yh(i,t,e){let s=i;return typeof t.text!="string"&&(s=No(t,e)),s}function No(i,t){const e=i.text?i.text.length:0;return t*e}function vh(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var kh={id:"legend",_element:$n,start(i,t,e){const s=i.legend=new $n({ctx:i.ctx,options:e,chart:i});vt.configure(i,s,e),vt.addBox(i,s)},stop(i){vt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;vt.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=St(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class Wo extends jt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=at(s.text)?s.text.length:1;this._padding=St(s.padding);const o=n*ft(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=ut(a,s,o),d=e+t,c=o-s):(r.position==="left"?(h=s+t,d=ut(a,n,e),l=lt*-.5):(h=o-t,d=ut(a,e,n),l=lt*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=ft(e.font),o=s.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);je(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:ks(e.align),textBaseline:"middle",translation:[r,a]})}}function Sh(i,t){const e=new Wo({ctx:i.ctx,options:t,chart:i});vt.configure(i,e,t),vt.addBox(i,e),i.titleBlock=e}var wh={id:"title",_element:Wo,start(i,t,e){Sh(i,e)},stop(i){const t=i.titleBlock;vt.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;vt.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Oe={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;ta+l)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o-1?i.split(` +`):i}function Mh(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function Vn(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=ft(t.bodyFont),c=ft(t.titleFont),h=ft(t.footerFont),d=o.length,u=n.length,f=s.length,p=St(t.padding);let g=p.height,m=0,b=s.reduce((S,x)=>S+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=f*S+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}u&&(g+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const k=function(S){m=Math.max(m,e.measureText(S).width+y)};return e.save(),e.font=c.string,q(i.title,k),e.font=l.string,q(i.beforeBody.concat(i.afterBody),k),y=t.displayColors?r+2+t.boxPadding:0,q(s,S=>{q(S.before,k),q(S.lines,k),q(S.after,k)}),y=0,e.font=h.string,q(i.footer,k),e.restore(),m+=p.width,{width:m,height:g}}function Ch(i,t){const{y:e,height:s}=t;return ei.height-s/2?"bottom":"center"}function Ph(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function Th(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),Ph(c,i,t,e)&&(c="center"),c}function Yn(i,t,e){const s=e.yAlign||t.yAlign||Ch(i,e);return{xAlign:e.xAlign||t.xAlign||Th(i,t,e,s),yAlign:s}}function Oh(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Dh(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Un(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Re(r);let p=Oh(t,a);const g=Dh(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,u)+n:a==="right"&&(p+=Math.max(d,f)+n),{x:yt(p,0,s.width-t.width),y:yt(g,0,s.height-t.height)}}function hi(i,t,e){const s=St(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Xn(i){return Lt([],Ht(i))}function Lh(i,t,e){return oe(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Kn(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const $o={beforeTitle:zt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex"u"?$o[t].call(e,s):n}class fs extends jt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new To(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Lh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=pt(s,"beforeTitle",this,t),o=pt(s,"title",this,t),r=pt(s,"afterTitle",this,t);let a=[];return a=Lt(a,Ht(n)),a=Lt(a,Ht(o)),a=Lt(a,Ht(r)),a}getBeforeBody(t,e){return Xn(pt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return q(t,o=>{const r={before:[],lines:[],after:[]},a=Kn(s,o);Lt(r.before,Ht(pt(a,"beforeLabel",this,o))),Lt(r.lines,pt(a,"label",this,o)),Lt(r.after,Ht(pt(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return Xn(pt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=pt(s,"beforeFooter",this,t),o=pt(s,"footer",this,t),r=pt(s,"afterFooter",this,t);let a=[];return a=Lt(a,Ht(n)),a=Lt(a,Ht(o)),a=Lt(a,Ht(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;lt.filter(h,d,u,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),q(a,h=>{const d=Kn(t.callbacks,h);n.push(pt(d,"labelColor",this,h)),o.push(pt(d,"labelPointStyle",this,h)),r.push(pt(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=Oe[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=Vn(this,s),c=Object.assign({},a,l),h=Yn(this.chart,s,c),d=Un(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Re(a),{x:u,y:f}=t,{width:p,height:g}=e;let m,b,y,k,S,x;return o==="center"?(S=f+g/2,n==="left"?(m=u,b=m-r,k=S+r,x=S-r):(m=u+p,b=m+r,k=S-r,x=S+r),y=m):(n==="left"?b=u+Math.max(l,h)+r:n==="right"?b=u+p-Math.max(c,d)-r:b=this.caretX,o==="top"?(k=f,S=k-r,m=b-r,y=b+r):(k=f+g,S=k+r,m=b+r,y=b-r),x=k),{x1:m,x2:b,x3:y,y1:k,y2:S,y3:x}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=fe(s.rtl,this.x,this.width);for(t.x=hi(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=ft(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,cs(t,{x:g,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),cs(t,{x:m,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,c,l),t.strokeRect(g,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=ft(s.bodyFont);let u=d.lineHeight,f=0;const p=fe(s.rtl,this.x,this.width),g=function(v){e.fillText(v,p.x(t.x+f),t.y+u/2),t.y+=u+o},m=p.textAlign(r);let b,y,k,S,x,C,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=hi(this,m,s),e.fillStyle=s.bodyColor,q(this.beforeBody,g),f=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,S=0,C=n.length;S0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=Oe[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Vn(this,t),l=Object.assign({},r,this._size),c=Yn(e,t,l),h=Un(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=St(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),Mo(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Co(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!_i(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!_i(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=Oe[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}F(fs,"positioners",Oe);var Ah={id:"tooltip",_element:fs,positioners:Oe,afterInit(i,t,e){e&&(i.tooltip=new fs({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:$o},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Ih=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Rh(i,t,e,s){const n=i.indexOf(t);if(n===-1)return Ih(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const Eh=(i,t)=>i===null?null:yt(Math.round(i),0,t);function qn(i){const t=this.getLabels();return i>=0&&ie.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}F(gs,"id","category"),F(gs,"defaults",{ticks:{callback:qn}});function zh(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,p=h-1,{min:g,max:m}=t,b=!J(r),y=!J(a),k=!J(c),S=(m-g)/(d+1);let x=Js((m-g)/p/f)*f,C,w,v,P;if(x<1e-14&&!b&&!y)return[{value:g},{value:m}];P=Math.ceil(m/x)-Math.floor(g/x),P>p&&(x=Js(P*x/p/f)*f),J(l)||(C=Math.pow(10,l),x=Math.ceil(x*C)/C),n==="ticks"?(w=Math.floor(g/x)*x,v=Math.ceil(m/x)*x):(w=g,v=m),b&&y&&o&&Sa((a-r)/o,x/1e3)?(P=Math.round(Math.min((a-r)/x,h)),x=(a-r)/P,w=r,v=a):k?(w=b?r:w,v=y?a:v,P=c-1,x=(v-w)/P):(P=(v-w)/x,Le(P,Math.round(P),x/1e3)?P=Math.round(P):P=Math.ceil(P));const E=Math.max(tn(x),tn(w));C=Math.pow(10,J(l)?E:l),w=Math.round(w*C)/C,v=Math.round(v*C)/C;let D=0;for(b&&(u&&w!==r?(e.push({value:r}),wa)break;e.push({value:z})}return y&&u&&v!==a?e.length&&Le(e[e.length-1].value,a,Gn(a,S,i))?e[e.length-1].value=a:e.push({value:a}):(!y||v===a)&&e.push({value:v}),e}function Gn(i,t,{horizontal:e,minRotation:s}){const n=te(s),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class Fh extends be{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return J(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=s?o:l;if(t){const l=ge(n),c=ge(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=zh(n,o);return t.bounds==="ticks"&&wa(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return po(t,this.chart.options.locale,this.options.ticks.format)}}class ps extends Fh{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=kt(t)?t:0,this.max=kt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=te(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}F(ps,"id","linear"),F(ps,"defaults",{ticks:{callback:bo.formatters.numeric}});const Oi={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},mt=Object.keys(Oi);function Zn(i,t){return i-t}function Qn(i,t){if(J(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),kt(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(He(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function Jn(i,t,e,s){const n=mt.length;for(let o=mt.indexOf(i);o=mt.indexOf(e);o--){const r=mt[o];if(Oi[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return mt[e?mt.indexOf(e):0]}function Bh(i){for(let t=mt.indexOf(i)+1,e=mt.length;t=t?e[s]:e[n];i[o]=!0}}function jh(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function eo(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=yt(e,0,r),s=yt(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||Jn(o.minUnit,e,s,this._getLabelCapacity(e)),a=W(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=He(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const p=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.ticks.callback;if(r)return tt(r,[t,e,s],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],u=s[e],f=c&&d&&u&&u.major;return this._adapter.format(t,n||(f?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=ee(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=ee(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class io extends Ci{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=di(e,this.min),this._tableRange=di(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;rn-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(di(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return di(this._table,s*this._tableRange+this._minPos,!0)}}F(io,"id","timeseries"),F(io,"defaults",Ci.defaults);const Vo="label";function so(i,t){typeof i=="function"?i(t):i&&(i.current=t)}function Nh(i,t){const e=i.options;e&&t&&Object.assign(e,t)}function Yo(i,t){i.labels=t}function Uo(i,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vo;const s=[];i.datasets=t.map(n=>{const o=i.datasets.find(r=>r[e]===n[e]);return!o||!n.data||s.includes(o)?{...n}:(s.push(o),Object.assign(o,n),o)})}function Wh(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vo;const e={labels:[],datasets:[]};return Yo(e,i.labels),Uo(e,i.datasets,t),e}function $h(i,t){const{height:e=150,width:s=300,redraw:n=!1,datasetIdKey:o,type:r,data:a,options:l,plugins:c=[],fallbackContent:h,updateMode:d,...u}=i,f=I.useRef(null),p=I.useRef(null),g=()=>{f.current&&(p.current=new Ti(f.current,{type:r,data:Wh(a,o),options:l&&{...l},plugins:c}),so(t,p.current))},m=()=>{so(t,null),p.current&&(p.current.destroy(),p.current=null)};return I.useEffect(()=>{!n&&p.current&&l&&Nh(p.current,l)},[n,l]),I.useEffect(()=>{!n&&p.current&&Yo(p.current.config.data,a.labels)},[n,a.labels]),I.useEffect(()=>{!n&&p.current&&a.datasets&&Uo(p.current.config.data,a.datasets,o)},[n,a.datasets]),I.useEffect(()=>{p.current&&(n?(m(),setTimeout(g)):p.current.update(d))},[n,l,a.labels,a.datasets,d]),I.useEffect(()=>{p.current&&(m(),setTimeout(g))},[r]),I.useEffect(()=>(g(),()=>m()),[]),ms.createElement("canvas",{ref:f,role:"img",height:e,width:s,...u},h)}const Vh=I.forwardRef($h);function Yh(i,t){return Ti.register(t),I.forwardRef((e,s)=>ms.createElement(Vh,{...e,ref:s,type:i}))}const Uh=Yh("line",gi);Ti.register(gs,ps,bi,Te,wh,Ah,kh);const Gh=({events:i,getFileContent:t})=>{var R,Q,j,rt;const[e,s]=I.useState(""),[n,o]=I.useState(0),[r,a]=I.useState(0),[l,c]=I.useState({}),[h,d]=I.useState(null),[u,f]=I.useState(!1),[p,g]=I.useState({steps:[],logprobs:[]}),[m,b]=I.useState(!1),[y,k]=I.useState(!0),[S,x]=I.useState(!1),C=I.useRef(null),w=I.useRef(null),v=I.useMemo(()=>{const A=new Set;return i.forEach(T=>{const Z=Object.keys(T).find(X=>X!=="type"&&X!=="loss"&&X!=="step"&&X!=="file");Z&&A.add(Z)}),Array.from(A)},[i]),P=I.useMemo(()=>i.filter(A=>A.type==="logprobs").map(A=>A.step).sort((A,T)=>A-T),[i]),E=async A=>{try{const T=await t(A.file),Z=JSON.parse(T),X=Object.keys(A).find(H=>H!=="type"&&H!=="loss"&&H!=="step"&&H!=="file")||"";c(H=>({...H,[X]:{...H[X]||{},[A.step]:Z}}))}catch(T){console.error("Error loading log prob data:",T)}};I.useEffect(()=>{if(!e)return;i.filter(T=>Object.keys(T).find(X=>X!=="type"&&X!=="loss"&&X!=="step"&&X!=="file")===e).forEach(T=>{var Z;(Z=l[e])!=null&&Z[T.step]||E(T)})},[e]),I.useEffect(()=>{v.length>0&&!e&&s(v[0]),P.length>0&&!r&&a(P[0])},[v,P]),I.useEffect(()=>{if(!C.current)return;const A={root:null,rootMargin:"0px",threshold:.1},T=new IntersectionObserver(Z=>{Z.forEach(X=>{k(X.isIntersecting)})},A);return T.observe(C.current),()=>T.disconnect()},[]),I.useEffect(()=>{u&&h&&(async()=>{if(!h||!e)return;b(!0);const T={steps:[],logprobs:[]};try{Object.keys(l[e]||{}).map(Number).sort((H,B)=>H-B).forEach(H=>{const B=l[e][H];if(!B||!B[n])return;const ht=B[n];if(h.position({step:H,logp:T.logprobs[B]})).sort((H,B)=>H.step-B.step);g({steps:X.map(H=>H.step),logprobs:X.map(H=>H.logp)})}finally{b(!1)}})()},[u,h,e,l,n]);const D=A=>{if(S){const T=Math.max(0,Math.min(1,(A+20)/20));return`rgba(255, ${Math.floor(255*T)}, ${Math.floor(255*T)}, 0.3)`}else{const T=Math.exp(A);return`rgba(255, ${Math.floor(255*T)}, ${Math.floor(255*T)}, 0.3)`}},z=e&&r&&((Q=(R=l[e])==null?void 0:R[r])==null?void 0:Q[n]),G=e&&r&&((rt=(j=l[e])==null?void 0:j[r])==null?void 0:rt.length)||0,nt=A=>A.map((T,Z)=>{if(T.token.includes(` +`)){const H=T.token.split(/(\n)/);return L.jsx(ms.Fragment,{children:H.map((B,ht)=>B===` +`?L.jsx(Pt,{sx:{width:"100%",height:0}},`${Z}-${ht}`):B&&L.jsx(Pt,{onClick:()=>{d({token:T.token,tokenId:T.token_id,position:Z}),f(!0)},sx:{cursor:"pointer",p:.5,borderRadius:1,backgroundColor:D(T.logp),"&:hover":{outline:"1px solid blue"}},children:L.jsx(Xe,{variant:"body2",component:"span",children:B})},`${Z}-${ht}`))},Z)}return L.jsx(Pt,{onClick:()=>{d({token:T.token,tokenId:T.token_id,position:Z}),f(!0)},sx:{cursor:"pointer",p:.5,borderRadius:1,backgroundColor:D(T.logp),"&:hover":{outline:"1px solid blue"}},children:L.jsx(Xe,{variant:"body2",component:"span",children:T.token})},Z)});return L.jsxs(Pt,{sx:{mt:2},children:[L.jsxs(Pt,{ref:w,sx:{position:y?"sticky":"static",top:0,zIndex:1,backgroundColor:"white",pb:2,borderBottom:y?"1px solid rgba(0, 0, 0, 0.12)":"none"},children:[L.jsxs(Pt,{sx:{display:"flex",gap:2,mb:2,alignItems:"center"},children:[L.jsxs(Hs,{sx:{minWidth:200},children:[L.jsx(Bs,{children:"Dataset"}),L.jsx(js,{value:e,onChange:A=>s(A.target.value),label:"Dataset",children:v.map(A=>L.jsx(Ns,{value:A,children:A},A))})]}),L.jsxs(Hs,{sx:{minWidth:200},children:[L.jsx(Bs,{children:"Sequence Index"}),L.jsx(js,{value:n,onChange:A=>o(Number(A.target.value)),label:"Sequence Index",children:[...Array(G)].map((A,T)=>L.jsx(Ns,{value:T,children:T},T))})]}),L.jsx(fr,{control:L.jsx(gr,{checked:S,onChange:A=>x(A.target.checked)}),label:"Use LogProb Colors"})]}),L.jsxs(Pt,{sx:{px:2},children:[L.jsxs(Xe,{gutterBottom:!0,children:["Step: ",r]}),L.jsx($r,{value:r,onChange:(A,T)=>a(T),min:Math.min(...P),max:Math.max(...P),step:null,marks:P.map(A=>({value:A,label:A.toString()}))})]})]}),L.jsx(Pt,{ref:C,children:z?L.jsx(pr,{sx:{p:2,mt:2},children:L.jsx(Pt,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:nt(z.tokens)})}):L.jsx(Xe,{children:"No data available for the selected parameters"})}),L.jsxs(mr,{open:u,onClose:()=>f(!1),maxWidth:"md",fullWidth:!0,children:[L.jsxs(br,{children:["Token History: ",h==null?void 0:h.token," (Position: ",h==null?void 0:h.position,")"]}),L.jsx(xr,{children:m?L.jsx(Pt,{sx:{display:"flex",justifyContent:"center",p:4},children:L.jsx(_r,{})}):h&&L.jsx(Pt,{sx:{height:400},children:L.jsx(Uh,{data:{labels:p.steps,datasets:[{label:"Log Probability",data:p.logprobs,borderColor:"rgb(75, 192, 192)",tension:.1}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{title:{display:!0,text:`Log Probability Evolution for Token: ${h.token} at Position ${h.position}`}},scales:{y:{title:{display:!0,text:"Log Probability"}},x:{title:{display:!0,text:"Training Step"}}}}})})})]})]})};export{Gh as LogProbVisualization}; diff --git a/openweights/dashboard/backend/static/assets/MetricsPlots-BzYzp0RD.js b/openweights/dashboard/backend/static/assets/MetricsPlots-BzYzp0RD.js new file mode 100644 index 0000000..a39c85b --- /dev/null +++ b/openweights/dashboard/backend/static/assets/MetricsPlots-BzYzp0RD.js @@ -0,0 +1,3855 @@ +import{r as L8,g as P8,a as Gm,j as yv,B as C0,C as I8,T as nb,b as R8}from"./index-CL2BTY-B.js";var ib={exports:{}},ob,ZA;function D8(){if(ZA)return ob;ZA=1;var uh="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ob=uh,ob}var sb,XA;function z8(){if(XA)return sb;XA=1;var uh=D8();function Th(){}function Ch(){}return Ch.resetWarningCache=Th,sb=function(){function qs(Zh,wp,Lh,Bh,Nv,rv){if(rv!==uh){var mv=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw mv.name="Invariant Violation",mv}}qs.isRequired=qs;function vf(){return qs}var Wh={array:qs,bigint:qs,bool:qs,func:qs,number:qs,object:qs,string:qs,symbol:qs,any:qs,arrayOf:vf,element:qs,elementType:qs,instanceOf:vf,node:qs,objectOf:vf,oneOf:vf,oneOfType:vf,shape:vf,exact:vf,checkPropTypes:Ch,resetWarningCache:Th};return Wh.PropTypes=Wh,Wh},sb}var YA;function F8(){return YA||(YA=1,ib.exports=z8()()),ib.exports}var lb={},ub={},KA;function O8(){return KA||(KA=1,function(uh){function Th(Go){"@babel/helpers - typeof";return Th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Fs){return typeof Fs}:function(Fs){return Fs&&typeof Symbol=="function"&&Fs.constructor===Symbol&&Fs!==Symbol.prototype?"symbol":typeof Fs},Th(Go)}Object.defineProperty(uh,"__esModule",{value:!0}),uh.default=Zm;var Ch=Zh(L8()),qs=vf(F8());function vf(Go){return Go&&Go.__esModule?Go:{default:Go}}function Wh(Go){if(typeof WeakMap!="function")return null;var Fs=new WeakMap,Tc=new WeakMap;return(Wh=function(Bf){return Bf?Tc:Fs})(Go)}function Zh(Go,Fs){if(Go&&Go.__esModule)return Go;if(Go===null||Th(Go)!=="object"&&typeof Go!="function")return{default:Go};var Tc=Wh(Fs);if(Tc&&Tc.has(Go))return Tc.get(Go);var Qn={},Bf=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Xl in Go)if(Xl!=="default"&&Object.prototype.hasOwnProperty.call(Go,Xl)){var co=Bf?Object.getOwnPropertyDescriptor(Go,Xl):null;co&&(co.get||co.set)?Object.defineProperty(Qn,Xl,co):Qn[Xl]=Go[Xl]}return Qn.default=Go,Tc&&Tc.set(Go,Qn),Qn}function wp(Go,Fs){if(!(Go instanceof Fs))throw new TypeError("Cannot call a class as a function")}function Lh(Go,Fs){for(var Tc=0;Tc"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ks(Go){return ks=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Tc){return Tc.__proto__||Object.getPrototypeOf(Tc)},ks(Go)}var He=["AfterExport","AfterPlot","Animated","AnimatingFrame","AnimationInterrupted","AutoSize","BeforeExport","BeforeHover","ButtonClicked","Click","ClickAnnotation","Deselect","DoubleClick","Framework","Hover","LegendClick","LegendDoubleClick","Relayout","Relayouting","Restyle","Redraw","Selected","Selecting","SliderChange","SliderEnd","SliderStart","SunburstClick","Transitioning","TransitionInterrupted","Unhover","WebGlContextLost"],L0=["plotly_restyle","plotly_redraw","plotly_relayout","plotly_relayouting","plotly_doubleclick","plotly_animated","plotly_sunburstclick"],Tp=typeof window<"u";function Zm(Go){var Fs=function(Tc){Nv(Bf,Tc);var Qn=mv(Bf);function Bf(Xl){var co;return wp(this,Bf),co=Qn.call(this,Xl),co.p=Promise.resolve(),co.resizeHandler=null,co.handlers={},co.syncWindowResize=co.syncWindowResize.bind(Sf(co)),co.syncEventHandlers=co.syncEventHandlers.bind(Sf(co)),co.attachUpdateEvents=co.attachUpdateEvents.bind(Sf(co)),co.getRef=co.getRef.bind(Sf(co)),co.handleUpdate=co.handleUpdate.bind(Sf(co)),co.figureCallback=co.figureCallback.bind(Sf(co)),co.updatePlotly=co.updatePlotly.bind(Sf(co)),co}return Bh(Bf,[{key:"updatePlotly",value:function(co,Ac,Hi){var lo=this;this.p=this.p.then(function(){if(!lo.unmounting){if(!lo.el)throw new Error("Missing element reference");return Go.react(lo.el,{data:lo.props.data,layout:lo.props.layout,config:lo.props.config,frames:lo.props.frames})}}).then(function(){lo.unmounting||(lo.syncWindowResize(co),lo.syncEventHandlers(),lo.figureCallback(Ac),Hi&&lo.attachUpdateEvents())}).catch(function(Uh){lo.props.onError&&lo.props.onError(Uh)})}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(co){this.unmounting=!1;var Ac=co.frames&&co.frames.length?co.frames.length:0,Hi=this.props.frames&&this.props.frames.length?this.props.frames.length:0,lo=!(co.layout===this.props.layout&&co.data===this.props.data&&co.config===this.props.config&&Hi===Ac),Uh=co.revision!==void 0,Xh=co.revision!==this.props.revision;!lo&&(!Uh||Uh&&!Xh)||this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&Tp&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),Go.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var co=this;!this.el||!this.el.removeListener||L0.forEach(function(Ac){co.el.on(Ac,co.handleUpdate)})}},{key:"removeUpdateEvents",value:function(){var co=this;!this.el||!this.el.removeListener||L0.forEach(function(Ac){co.el.removeListener(Ac,co.handleUpdate)})}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(co){if(typeof co=="function"){var Ac=this.el,Hi=Ac.data,lo=Ac.layout,Uh=this.el._transitionData?this.el._transitionData._frames:null,Xh={data:Hi,layout:lo,frames:Uh};co(Xh,this.el)}}},{key:"syncWindowResize",value:function(co){var Ac=this;Tp&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return Go.Plots.resize(Ac.el)},window.addEventListener("resize",this.resizeHandler),co&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(co){this.el=co,this.props.debug&&Tp&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var co=this;He.forEach(function(Ac){var Hi=co.props["on"+Ac],lo=co.handlers[Ac],Uh=!!lo;Hi&&!Uh?co.addEventHandler(Ac,Hi):!Hi&&Uh?co.removeEventHandler(Ac):Hi&&Uh&&Hi!==lo&&(co.removeEventHandler(Ac),co.addEventHandler(Ac,Hi))})}},{key:"addEventHandler",value:function(co,Ac){this.handlers[co]=Ac,this.el.on(this.getPlotlyEventName(co),this.handlers[co])}},{key:"removeEventHandler",value:function(co){this.el.removeListener(this.getPlotlyEventName(co),this.handlers[co]),delete this.handlers[co]}},{key:"getPlotlyEventName",value:function(co){return"plotly_"+co.toLowerCase()}},{key:"render",value:function(){return Ch.default.createElement("div",{id:this.props.divId,style:this.props.style,ref:this.getRef,className:this.props.className})}}]),Bf}(Ch.Component);return Fs.propTypes={data:qs.default.arrayOf(qs.default.object),config:qs.default.object,layout:qs.default.object,frames:qs.default.arrayOf(qs.default.object),revision:qs.default.number,onInitialized:qs.default.func,onPurge:qs.default.func,onError:qs.default.func,onUpdate:qs.default.func,debug:qs.default.bool,style:qs.default.object,className:qs.default.string,useResizeHandler:qs.default.bool,divId:qs.default.string},He.forEach(function(Tc){Fs.propTypes["on"+Tc]=qs.default.func}),Fs.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},Fs}}(ub)),ub}var Wm={exports:{}},B8=Wm.exports,JA;function N8(){return JA||(JA=1,function(uh){var Th={};(function(Ch,qs){uh.exports?uh.exports=qs():Ch.moduleName=qs()})(typeof self<"u"?self:B8,()=>{var Ch=(()=>{var qs=Object.create,vf=Object.defineProperty,Wh=Object.defineProperties,Zh=Object.getOwnPropertyDescriptor,wp=Object.getOwnPropertyDescriptors,Lh=Object.getOwnPropertyNames,Bh=Object.getOwnPropertySymbols,Nv=Object.getPrototypeOf,rv=Object.prototype.hasOwnProperty,mv=Object.prototype.propertyIsEnumerable,Nh=(Y,G,d)=>G in Y?vf(Y,G,{enumerable:!0,configurable:!0,writable:!0,value:d}):Y[G]=d,Sf=(Y,G)=>{for(var d in G||(G={}))rv.call(G,d)&&Nh(Y,d,G[d]);if(Bh)for(var d of Bh(G))mv.call(G,d)&&Nh(Y,d,G[d]);return Y},av=(Y,G)=>Wh(Y,wp(G)),ks=(Y,G)=>function(){return Y&&(G=(0,Y[Lh(Y)[0]])(Y=0)),G},He=(Y,G)=>function(){return G||(0,Y[Lh(Y)[0]])((G={exports:{}}).exports,G),G.exports},L0=(Y,G)=>{for(var d in G)vf(Y,d,{get:G[d],enumerable:!0})},Tp=(Y,G,d,x)=>{if(G&&typeof G=="object"||typeof G=="function")for(let A of Lh(G))!rv.call(Y,A)&&A!==d&&vf(Y,A,{get:()=>G[A],enumerable:!(x=Zh(G,A))||x.enumerable});return Y},Zm=(Y,G,d)=>(d=Y!=null?qs(Nv(Y)):{},Tp(vf(d,"default",{value:Y,enumerable:!0}),Y)),Go=Y=>Tp(vf({},"__esModule",{value:!0}),Y),Fs=He({"src/version.js"(Y){Y.version="3.0.1"}}),Tc=He({"node_modules/native-promise-only/lib/npo.src.js"(Y,G){(function(x,A,E){A[x]=A[x]||E(),typeof G<"u"&&G.exports&&(G.exports=A[x])})("Promise",typeof window<"u"?window:Y,function(){var x,A,E,e=Object.prototype.toString,t=typeof setImmediate<"u"?function(y){return setImmediate(y)}:setTimeout;try{Object.defineProperty({},"x",{}),x=function(y,b,S,M){return Object.defineProperty(y,b,{value:S,writable:!0,configurable:M!==!1})}}catch{x=function(b,S,M){return b[S]=M,b}}E=function(){var y,b,S;function M(_,w){this.fn=_,this.self=w,this.next=void 0}return{add:function(w,p){S=new M(w,p),b?b.next=S:y=S,b=S,S=void 0},drain:function(){var w=y;for(y=b=A=void 0;w;)w.fn.call(w.self),w=w.next}}}();function r(l,y){E.add(l,y),A||(A=t(E.drain))}function o(l){var y,b=typeof l;return l!=null&&(b=="object"||b=="function")&&(y=l.then),typeof y=="function"?y:!1}function a(){for(var l=0;l0&&r(a,b))}catch(S){s.call(new f(b),S)}}}function s(l){var y=this;y.triggered||(y.triggered=!0,y.def&&(y=y.def),y.msg=l,y.state=2,y.chain.length>0&&r(a,y))}function c(l,y,b,S){for(var M=0;MLe?1:pe>=Le?0:NaN}d.descending=function(pe,Le){return Lepe?1:Le>=pe?0:NaN},d.min=function(pe,Le){var Ye=-1,ut=pe.length,ht,xt;if(arguments.length===1){for(;++Ye=xt){ht=xt;break}for(;++Yext&&(ht=xt)}else{for(;++Ye=xt){ht=xt;break}for(;++Yext&&(ht=xt)}return ht},d.max=function(pe,Le){var Ye=-1,ut=pe.length,ht,xt;if(arguments.length===1){for(;++Ye=xt){ht=xt;break}for(;++Yeht&&(ht=xt)}else{for(;++Ye=xt){ht=xt;break}for(;++Yeht&&(ht=xt)}return ht},d.extent=function(pe,Le){var Ye=-1,ut=pe.length,ht,xt,zt;if(arguments.length===1){for(;++Ye=xt){ht=zt=xt;break}for(;++Yext&&(ht=xt),zt=xt){ht=zt=xt;break}for(;++Yext&&(ht=xt),zt1)return zt/($t-1)},d.deviation=function(){var pe=d.variance.apply(this,arguments);return pe&&Math.sqrt(pe)};function v(pe){return{left:function(Le,Ye,ut,ht){for(arguments.length<3&&(ut=0),arguments.length<4&&(ht=Le.length);ut>>1;pe(Le[xt],Ye)<0?ut=xt+1:ht=xt}return ut},right:function(Le,Ye,ut,ht){for(arguments.length<3&&(ut=0),arguments.length<4&&(ht=Le.length);ut>>1;pe(Le[xt],Ye)>0?ht=xt:ut=xt+1}return ut}}}var h=v(s);d.bisectLeft=h.left,d.bisect=d.bisectRight=h.right,d.bisector=function(pe){return v(pe.length===1?function(Le,Ye){return s(pe(Le),Ye)}:pe)},d.shuffle=function(pe,Le,Ye){(ut=arguments.length)<3&&(Ye=pe.length,ut<2&&(Le=0));for(var ut=Ye-Le,ht,xt;ut;)xt=Math.random()*ut--|0,ht=pe[ut+Le],pe[ut+Le]=pe[xt+Le],pe[xt+Le]=ht;return pe},d.permute=function(pe,Le){for(var Ye=Le.length,ut=new Array(Ye);Ye--;)ut[Ye]=pe[Le[Ye]];return ut},d.pairs=function(pe){for(var Le=0,Ye=pe.length-1,ut=pe[0],ht=new Array(Ye<0?0:Ye);Le=0;)for(zt=pe[Le],Ye=zt.length;--Ye>=0;)xt[--ht]=zt[Ye];return xt};var l=Math.abs;d.range=function(pe,Le,Ye){if(arguments.length<3&&(Ye=1,arguments.length<2&&(Le=pe,pe=0)),(Le-pe)/Ye===1/0)throw new Error("infinite range");var ut=[],ht=y(l(Ye)),xt=-1,zt;if(pe*=ht,Le*=ht,Ye*=ht,Ye<0)for(;(zt=pe+Ye*++xt)>Le;)ut.push(zt/ht);else for(;(zt=pe+Ye*++xt)=Le.length)return ht?ht.call(pe,$t):ut?$t.sort(ut):$t;for(var Ar=-1,Vr=$t.length,Kr=Le[Cr++],aa,Ua,la,Ta=new S,ka;++Ar=Le.length)return Dt;var Cr=[],Ar=Ye[$t++];return Dt.forEach(function(Vr,Kr){Cr.push({key:Vr,values:zt(Kr,$t)})}),Ar?Cr.sort(function(Vr,Kr){return Ar(Vr.key,Kr.key)}):Cr}return pe.map=function(Dt,$t){return xt($t,Dt,0)},pe.entries=function(Dt){return zt(xt(d.map,Dt,0),0)},pe.key=function(Dt){return Le.push(Dt),pe},pe.sortKeys=function(Dt){return Ye[Le.length-1]=Dt,pe},pe.sortValues=function(Dt){return ut=Dt,pe},pe.rollup=function(Dt){return ht=Dt,pe},pe},d.set=function(pe){var Le=new z;if(pe)for(var Ye=0,ut=pe.length;Ye=0&&(ut=pe.slice(Ye+1),pe=pe.slice(0,Ye)),pe)return arguments.length<2?this[pe].on(ut):this[pe].on(ut,Le);if(arguments.length===2){if(Le==null)for(pe in this)this.hasOwnProperty(pe)&&this[pe].on(ut,null);return this}};function Z(pe){var Le=[],Ye=new S;function ut(){for(var ht=Le,xt=-1,zt=ht.length,Dt;++xt=0&&(Ye=pe.slice(0,Le))!=="xmlns"&&(pe=pe.slice(Le+1)),fe.hasOwnProperty(Ye)?{space:fe[Ye],local:pe}:pe}},ee.attr=function(pe,Le){if(arguments.length<2){if(typeof pe=="string"){var Ye=this.node();return pe=d.ns.qualify(pe),pe.local?Ye.getAttributeNS(pe.space,pe.local):Ye.getAttribute(pe)}for(Le in pe)this.each(we(Le,pe[Le]));return this}return this.each(we(pe,Le))};function we(pe,Le){pe=d.ns.qualify(pe);function Ye(){this.removeAttribute(pe)}function ut(){this.removeAttributeNS(pe.space,pe.local)}function ht(){this.setAttribute(pe,Le)}function xt(){this.setAttributeNS(pe.space,pe.local,Le)}function zt(){var $t=Le.apply(this,arguments);$t==null?this.removeAttribute(pe):this.setAttribute(pe,$t)}function Dt(){var $t=Le.apply(this,arguments);$t==null?this.removeAttributeNS(pe.space,pe.local):this.setAttributeNS(pe.space,pe.local,$t)}return Le==null?pe.local?ut:Ye:typeof Le=="function"?pe.local?Dt:zt:pe.local?xt:ht}function Ae(pe){return pe.trim().replace(/\s+/g," ")}ee.classed=function(pe,Le){if(arguments.length<2){if(typeof pe=="string"){var Ye=this.node(),ut=(pe=Ce(pe)).length,ht=-1;if(Le=Ye.classList){for(;++ht=0;)(xt=Ye[ut])&&(ht&&ht!==xt.nextSibling&&ht.parentNode.insertBefore(xt,ht),ht=xt);return this},ee.sort=function(pe){pe=Re.apply(this,arguments);for(var Le=-1,Ye=this.length;++Le=Le&&(Le=ht+1);!($t=zt[Le])&&++Le0&&(pe=pe.slice(0,ht));var zt=Rt.get(pe);zt&&(pe=zt,xt=ir);function Dt(){var Ar=this[ut];Ar&&(this.removeEventListener(pe,Ar,Ar.$),delete this[ut])}function $t(){var Ar=xt(Le,A(arguments));Dt.call(this),this.addEventListener(pe,this[ut]=Ar,Ar.$=Ye),Ar._=Le}function Cr(){var Ar=new RegExp("^__on([^.]+)"+d.requote(pe)+"$"),Vr;for(var Kr in this)if(Vr=Kr.match(Ar)){var aa=this[Kr];this.removeEventListener(Vr[1],aa,aa.$),delete this[Kr]}}return ht?Le?$t:Dt:Le?N:Cr}var Rt=d.map({mouseenter:"mouseover",mouseleave:"mouseout"});E&&Rt.forEach(function(pe){"on"+pe in E&&Rt.remove(pe)});function Ut(pe,Le){return function(Ye){var ut=d.event;d.event=Ye,Le[0]=this.__data__;try{pe.apply(this,Le)}finally{d.event=ut}}}function ir(pe,Le){var Ye=Ut(pe,Le);return function(ut){var ht=this,xt=ut.relatedTarget;(!xt||xt!==ht&&!(xt.compareDocumentPosition(ht)&8))&&Ye.call(ht,ut)}}var ar,Mr=0;function fr(pe){var Le=".dragsuppress-"+ ++Mr,Ye="click"+Le,ut=d.select(t(pe)).on("touchmove"+Le,Q).on("dragstart"+Le,Q).on("selectstart"+Le,Q);if(ar==null&&(ar="onselectstart"in pe?!1:O(pe.style,"userSelect")),ar){var ht=e(pe).style,xt=ht[ar];ht[ar]="none"}return function(zt){if(ut.on(Le,null),ar&&(ht[ar]=xt),zt){var Dt=function(){ut.on(Ye,null)};ut.on(Ye,function(){Q(),Dt()},!0),setTimeout(Dt,0)}}}d.mouse=function(pe){return pt(pe,ue())};var dr=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function pt(pe,Le){Le.changedTouches&&(Le=Le.changedTouches[0]);var Ye=pe.ownerSVGElement||pe;if(Ye.createSVGPoint){var ut=Ye.createSVGPoint();if(dr<0){var ht=t(pe);if(ht.scrollX||ht.scrollY){Ye=d.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var xt=Ye[0][0].getScreenCTM();dr=!(xt.f||xt.e),Ye.remove()}}return dr?(ut.x=Le.pageX,ut.y=Le.pageY):(ut.x=Le.clientX,ut.y=Le.clientY),ut=ut.matrixTransform(pe.getScreenCTM().inverse()),[ut.x,ut.y]}var zt=pe.getBoundingClientRect();return[Le.clientX-zt.left-pe.clientLeft,Le.clientY-zt.top-pe.clientTop]}d.touch=function(pe,Le,Ye){if(arguments.length<3&&(Ye=Le,Le=ue().changedTouches),Le){for(var ut=0,ht=Le.length,xt;ut1?Pe:pe<-1?-Pe:Math.asin(pe)}function Nt(pe){return((pe=Math.exp(pe))-1/pe)/2}function Bt(pe){return((pe=Math.exp(pe))+1/pe)/2}function qt(pe){return((pe=Math.exp(2*pe))-1)/(pe+1)}var Zt=Math.SQRT2,lr=2,ta=4;d.interpolateZoom=function(pe,Le){var Ye=pe[0],ut=pe[1],ht=pe[2],xt=Le[0],zt=Le[1],Dt=Le[2],$t=xt-Ye,Cr=zt-ut,Ar=$t*$t+Cr*Cr,Vr,Kr;if(Ar0&&(Kn=Kn.transition().duration(zt)),Kn.call(Va.event)}function hi(){Ta&&Ta.domain(la.range().map(function(Kn){return(Kn-pe.x)/pe.k}).map(la.invert)),Ba&&Ba.domain(ka.range().map(function(Kn){return(Kn-pe.y)/pe.k}).map(ka.invert))}function _i(Kn){Dt++||Kn({type:"zoomstart"})}function Po(Kn){hi(),Kn({type:"zoom",scale:pe.k,translate:[pe.x,pe.y]})}function wi(Kn){--Dt||(Kn({type:"zoomend"}),Ye=null)}function Ji(){var Kn=this,go=Ua.of(Kn,arguments),Do=0,Es=d.select(t(Kn)).on(Cr,Qo).on(Ar,_s),hs=Ma(d.mouse(Kn)),Hl=fr(Kn);za.call(Kn),_i(go);function Qo(){Do=1,jn(d.mouse(Kn),hs),Po(go)}function _s(){Es.on(Cr,null).on(Ar,null),Hl(Do),wi(go)}}function Vo(){var Kn=this,go=Ua.of(Kn,arguments),Do={},Es=0,hs,Hl=".zoom-"+d.event.changedTouches[0].identifier,Qo="touchmove"+Hl,_s="touchend"+Hl,gu=[],el=d.select(Kn),cr=fr(Kn);xa(),_i(go),el.on($t,null).on(Kr,xa);function fa(){var Da=d.touches(Kn);return hs=pe.k,Da.forEach(function(Na){Na.identifier in Do&&(Do[Na.identifier]=Ma(Na))}),Da}function xa(){var Da=d.event.target;d.select(Da).on(Qo,cn).on(_s,In),gu.push(Da);for(var Na=d.event.changedTouches,Hn=0,Un=Na.length;Hn1){var Wi=Gn[0],Ti=Gn[1],si=Wi[0]-Ti[0],Fn=Wi[1]-Ti[1];Es=si*si+Fn*Fn}}function cn(){var Da=d.touches(Kn),Na,Hn,Un,Gn;za.call(Kn);for(var ti=0,Wi=Da.length;ti1?1:Le,Ye=Ye<0?0:Ye>1?1:Ye,ht=Ye<=.5?Ye*(1+Le):Ye+Le-Ye*Le,ut=2*Ye-ht;function xt(Dt){return Dt>360?Dt-=360:Dt<0&&(Dt+=360),Dt<60?ut+(ht-ut)*Dt/60:Dt<180?ht:Dt<240?ut+(ht-ut)*(240-Dt)/60:ut}function zt(Dt){return Math.round(xt(Dt)*255)}return new vt(zt(pe+120),zt(pe),zt(pe-120))}d.hcl=Vt;function Vt(pe,Le,Ye){return this instanceof Vt?(this.h=+pe,this.c=+Le,void(this.l=+Ye)):arguments.length<2?pe instanceof Vt?new Vt(pe.h,pe.c,pe.l):pe instanceof Ot?Pa(pe.l,pe.a,pe.b):Pa((pe=Pr((pe=d.rgb(pe)).r,pe.g,pe.b)).l,pe.a,pe.b):new Vt(pe,Le,Ye)}var Lt=Vt.prototype=new Ia;Lt.brighter=function(pe){return new Vt(this.h,this.c,Math.min(100,this.l+gr*(arguments.length?pe:1)))},Lt.darker=function(pe){return new Vt(this.h,this.c,Math.max(0,this.l-gr*(arguments.length?pe:1)))},Lt.rgb=function(){return jt(this.h,this.c,this.l).rgb()};function jt(pe,Le,Ye){return isNaN(pe)&&(pe=0),isNaN(Le)&&(Le=0),new Ot(Ye,Math.cos(pe*=We)*Le,Math.sin(pe)*Le)}d.lab=Ot;function Ot(pe,Le,Ye){return this instanceof Ot?(this.l=+pe,this.a=+Le,void(this.b=+Ye)):arguments.length<2?pe instanceof Ot?new Ot(pe.l,pe.a,pe.b):pe instanceof Vt?jt(pe.h,pe.c,pe.l):Pr((pe=vt(pe)).r,pe.g,pe.b):new Ot(pe,Le,Ye)}var gr=18,Br=.95047,na=1,Ur=1.08883,ga=Ot.prototype=new Ia;ga.brighter=function(pe){return new Ot(Math.min(100,this.l+gr*(arguments.length?pe:1)),this.a,this.b)},ga.darker=function(pe){return new Ot(Math.max(0,this.l-gr*(arguments.length?pe:1)),this.a,this.b)},ga.rgb=function(){return Aa(this.l,this.a,this.b)};function Aa(pe,Le,Ye){var ut=(pe+16)/116,ht=ut+Le/500,xt=ut-Ye/200;return ht=sa(ht)*Br,ut=sa(ut)*na,xt=sa(xt)*Ur,new vt(dt(3.2404542*ht-1.5371385*ut-.4985314*xt),dt(-.969266*ht+1.8760108*ut+.041556*xt),dt(.0556434*ht-.2040259*ut+1.0572252*xt))}function Pa(pe,Le,Ye){return pe>0?new Vt(Math.atan2(Ye,Le)*ct,Math.sqrt(Le*Le+Ye*Ye),pe):new Vt(NaN,NaN,pe)}function sa(pe){return pe>.206893034?pe*pe*pe:(pe-4/29)/7.787037}function Oa(pe){return pe>.008856?Math.pow(pe,1/3):7.787037*pe+4/29}function dt(pe){return Math.round(255*(pe<=.00304?12.92*pe:1.055*Math.pow(pe,1/2.4)-.055))}d.rgb=vt;function vt(pe,Le,Ye){return this instanceof vt?(this.r=~~pe,this.g=~~Le,void(this.b=~~Ye)):arguments.length<2?pe instanceof vt?new vt(pe.r,pe.g,pe.b):kr(""+pe,vt,Ka):new vt(pe,Le,Ye)}function Lr(pe){return new vt(pe>>16,pe>>8&255,pe&255)}function Er(pe){return Lr(pe)+""}var _r=vt.prototype=new Ia;_r.brighter=function(pe){pe=Math.pow(.7,arguments.length?pe:1);var Le=this.r,Ye=this.g,ut=this.b,ht=30;return!Le&&!Ye&&!ut?new vt(ht,ht,ht):(Le&&Le>4,ut=ut>>4|ut,ht=$t&240,ht=ht>>4|ht,xt=$t&15,xt=xt<<4|xt):pe.length===7&&(ut=($t&16711680)>>16,ht=($t&65280)>>8,xt=$t&255)),Le(ut,ht,xt))}function zr(pe,Le,Ye){var ut=Math.min(pe/=255,Le/=255,Ye/=255),ht=Math.max(pe,Le,Ye),xt=ht-ut,zt,Dt,$t=(ht+ut)/2;return xt?(Dt=$t<.5?xt/(ht+ut):xt/(2-ht-ut),pe==ht?zt=(Le-Ye)/xt+(Le0&&$t<1?0:zt),new va(zt,Dt,$t)}function Pr(pe,Le,Ye){pe=Hr(pe),Le=Hr(Le),Ye=Hr(Ye);var ut=Oa((.4124564*pe+.3575761*Le+.1804375*Ye)/Br),ht=Oa((.2126729*pe+.7151522*Le+.072175*Ye)/na),xt=Oa((.0193339*pe+.119192*Le+.9503041*Ye)/Ur);return Ot(116*ht-16,500*(ut-ht),200*(ht-xt))}function Hr(pe){return(pe/=255)<=.04045?pe/12.92:Math.pow((pe+.055)/1.055,2.4)}function Zr(pe){var Le=parseFloat(pe);return pe.charAt(pe.length-1)==="%"?Math.round(Le*2.55):Le}var Jr=d.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Jr.forEach(function(pe,Le){Jr.set(pe,Lr(Le))});function wt(pe){return typeof pe=="function"?pe:function(){return pe}}d.functor=wt,d.xhr=Qt(F);function Qt(pe){return function(Le,Ye,ut){return arguments.length===2&&typeof Ye=="function"&&(ut=Ye,Ye=null),mr(Le,Ye,pe,ut)}}function mr(pe,Le,Ye,ut){var ht={},xt=d.dispatch("beforesend","progress","load","error"),zt={},Dt=new XMLHttpRequest,$t=null;self.XDomainRequest&&!("withCredentials"in Dt)&&/^(http(s)?:)?\/\//.test(pe)&&(Dt=new XDomainRequest),"onload"in Dt?Dt.onload=Dt.onerror=Cr:Dt.onreadystatechange=function(){Dt.readyState>3&&Cr()};function Cr(){var Ar=Dt.status,Vr;if(!Ar&&oa(Dt)||Ar>=200&&Ar<300||Ar===304){try{Vr=Ye.call(ht,Dt)}catch(Kr){xt.error.call(ht,Kr);return}xt.load.call(ht,Vr)}else xt.error.call(ht,Dt)}return Dt.onprogress=function(Ar){var Vr=d.event;d.event=Ar;try{xt.progress.call(ht,Dt)}finally{d.event=Vr}},ht.header=function(Ar,Vr){return Ar=(Ar+"").toLowerCase(),arguments.length<2?zt[Ar]:(Vr==null?delete zt[Ar]:zt[Ar]=Vr+"",ht)},ht.mimeType=function(Ar){return arguments.length?(Le=Ar==null?null:Ar+"",ht):Le},ht.responseType=function(Ar){return arguments.length?($t=Ar,ht):$t},ht.response=function(Ar){return Ye=Ar,ht},["get","post"].forEach(function(Ar){ht[Ar]=function(){return ht.send.apply(ht,[Ar].concat(A(arguments)))}}),ht.send=function(Ar,Vr,Kr){if(arguments.length===2&&typeof Vr=="function"&&(Kr=Vr,Vr=null),Dt.open(Ar,pe,!0),Le!=null&&!("accept"in zt)&&(zt.accept=Le+",*/*"),Dt.setRequestHeader)for(var aa in zt)Dt.setRequestHeader(aa,zt[aa]);return Le!=null&&Dt.overrideMimeType&&Dt.overrideMimeType(Le),$t!=null&&(Dt.responseType=$t),Kr!=null&&ht.on("error",Kr).on("load",function(Ua){Kr(null,Ua)}),xt.beforesend.call(ht,Dt),Dt.send(Vr??null),ht},ht.abort=function(){return Dt.abort(),ht},d.rebind(ht,xt,"on"),ut==null?ht:ht.get($r(ut))}function $r(pe){return pe.length===1?function(Le,Ye){pe(Le==null?Ye:null)}:pe}function oa(pe){var Le=pe.responseType;return Le&&Le!=="text"?pe.response:pe.responseText}d.dsv=function(pe,Le){var Ye=new RegExp('["'+pe+` +]`),ut=pe.charCodeAt(0);function ht(Cr,Ar,Vr){arguments.length<3&&(Vr=Ar,Ar=null);var Kr=mr(Cr,Le,Ar==null?xt:zt(Ar),Vr);return Kr.row=function(aa){return arguments.length?Kr.response((Ar=aa)==null?xt:zt(aa)):Ar},Kr}function xt(Cr){return ht.parse(Cr.responseText)}function zt(Cr){return function(Ar){return ht.parse(Ar.responseText,Cr)}}ht.parse=function(Cr,Ar){var Vr;return ht.parseRows(Cr,function(Kr,aa){if(Vr)return Vr(Kr,aa-1);var Ua=function(la){for(var Ta={},ka=Kr.length,Ba=0;Ba=Ua)return Kr;if(Ba)return Ba=!1,Vr;var mn=la;if(Cr.charCodeAt(mn)===34){for(var Wn=mn;Wn++24?(isFinite(Le)&&(clearTimeout(pa),pa=setTimeout(qn,Le)),ra=0):(ra=1,pn(qn))}d.timer.flush=function(){Vn(),di()};function Vn(){for(var pe=Date.now(),Le=Sa;Le;)pe>=Le.t&&Le.c(pe-Le.t)&&(Le.c=null),Le=Le.n;return pe}function di(){for(var pe,Le=Sa,Ye=1/0;Le;)Le.c?(Le.t=0;--Dt)la.push(ht[Cr[Vr[Dt]][2]]);for(Dt=+aa;Dt1&&_t(pe[Ye[ut-2]],pe[Ye[ut-1]],pe[ht])<=0;)--ut;Ye[ut++]=ht}return Ye.slice(0,ut)}function ei(pe,Le){return pe[0]-Le[0]||pe[1]-Le[1]}d.geom.polygon=function(pe){return j(pe,mi),pe};var mi=d.geom.polygon.prototype=[];mi.area=function(){for(var pe=-1,Le=this.length,Ye,ut=this[Le-1],ht=0;++peGe)Dt=Dt.L;else if(zt=Le-Jn(Dt,Ye),zt>Ge){if(!Dt.R){ut=Dt;break}Dt=Dt.R}else{xt>-Ge?(ut=Dt.P,ht=Dt):zt>-Ge?(ut=Dt,ht=Dt.N):ut=ht=Dt;break}var $t=bs(pe);if(xi.insert(ut,$t),!(!ut&&!ht)){if(ut===ht){ws(ut),ht=bs(ut.site),xi.insert($t,ht),$t.edge=ht.edge=zo(ut.site,$t.site),Mo(ut),Mo(ht);return}if(!ht){$t.edge=zo(ut.site,$t.site);return}ws(ut),ws(ht);var Cr=ut.site,Ar=Cr.x,Vr=Cr.y,Kr=pe.x-Ar,aa=pe.y-Vr,Ua=ht.site,la=Ua.x-Ar,Ta=Ua.y-Vr,ka=2*(Kr*Ta-aa*la),Ba=Kr*Kr+aa*aa,Va=la*la+Ta*Ta,Ma={x:(Ta*Ba-aa*Va)/ka+Ar,y:(Kr*Va-la*Ba)/ka+Vr};bi(ht.edge,Cr,Ua,Ma),$t.edge=zo(Cr,pe,null,Ma),ht.edge=zo(pe,Ua,null,Ma),Mo(ut),Mo(ht)}}function Qa(pe,Le){var Ye=pe.site,ut=Ye.x,ht=Ye.y,xt=ht-Le;if(!xt)return ut;var zt=pe.P;if(!zt)return-1/0;Ye=zt.site;var Dt=Ye.x,$t=Ye.y,Cr=$t-Le;if(!Cr)return Dt;var Ar=Dt-ut,Vr=1/xt-1/Cr,Kr=Ar/Cr;return Vr?(-Kr+Math.sqrt(Kr*Kr-2*Vr*(Ar*Ar/(-2*Cr)-$t+Cr/2+ht-xt/2)))/Vr+ut:(ut+Dt)/2}function Jn(pe,Le){var Ye=pe.N;if(Ye)return Qa(Ye,Le);var ut=pe.site;return ut.y===Le?ut.x:1/0}function Os(pe){this.site=pe,this.edges=[]}Os.prototype.prepare=function(){for(var pe=this.edges,Le=pe.length,Ye;Le--;)Ye=pe[Le].edge,(!Ye.b||!Ye.a)&&pe.splice(Le,1);return pe.sort(Ui),pe.length};function ds(pe){for(var Le=pe[0][0],Ye=pe[1][0],ut=pe[0][1],ht=pe[1][1],xt,zt,Dt,$t,Cr=Ii,Ar=Cr.length,Vr,Kr,aa,Ua,la,Ta;Ar--;)if(Vr=Cr[Ar],!(!Vr||!Vr.prepare()))for(aa=Vr.edges,Ua=aa.length,Kr=0;KrGe||l($t-zt)>Ge)&&(aa.splice(Kr,0,new wl(wo(Vr.site,Ta,l(Dt-Le)Ge?{x:Le,y:l(xt-Le)Ge?{x:l(zt-ht)Ge?{x:Ye,y:l(xt-Ye)Ge?{x:l(zt-ut)=-Oe)){var Kr=$t*$t+Cr*Cr,aa=Ar*Ar+Ta*Ta,Ua=(Ta*Kr-Cr*aa)/Vr,la=($t*aa-Ar*Kr)/Vr,Ta=la+Dt,ka=Li.pop()||new ms;ka.arc=pe,ka.site=ht,ka.x=Ua+zt,ka.y=Ta+Math.sqrt(Ua*Ua+la*la),ka.cy=Ta,pe.circle=ka;for(var Ba=null,Va=Ro._;Va;)if(ka.y0)){if(la/=aa,aa<0){if(la0){if(la>Kr)return;la>Vr&&(Vr=la)}if(la=Ye-Dt,!(!aa&&la<0)){if(la/=aa,aa<0){if(la>Kr)return;la>Vr&&(Vr=la)}else if(aa>0){if(la0)){if(la/=Ua,Ua<0){if(la0){if(la>Kr)return;la>Vr&&(Vr=la)}if(la=ut-$t,!(!Ua&&la<0)){if(la/=Ua,Ua<0){if(la>Kr)return;la>Vr&&(Vr=la)}else if(Ua>0){if(la0&&(ht.a={x:Dt+Vr*aa,y:$t+Vr*Ua}),Kr<1&&(ht.b={x:Dt+Kr*aa,y:$t+Kr*Ua}),ht}}}}}}function Rn(pe){for(var Le=li,Ye=Ks(pe[0][0],pe[0][1],pe[1][0],pe[1][1]),ut=Le.length,ht;ut--;)ht=Le[ut],(!fo(ht,pe)||!Ye(ht)||l(ht.a.x-ht.b.x)=xt)return;if(Ar>Kr){if(!ut)ut={x:Ua,y:zt};else if(ut.y>=Dt)return;Ye={x:Ua,y:Dt}}else{if(!ut)ut={x:Ua,y:Dt};else if(ut.y1)if(Ar>Kr){if(!ut)ut={x:(zt-ka)/Ta,y:zt};else if(ut.y>=Dt)return;Ye={x:(Dt-ka)/Ta,y:Dt}}else{if(!ut)ut={x:(Dt-ka)/Ta,y:Dt};else if(ut.y=xt)return;Ye={x:xt,y:Ta*xt+ka}}else{if(!ut)ut={x:xt,y:Ta*xt+ka};else if(ut.x=Ar&&ka.x<=Kr&&ka.y>=Vr&&ka.y<=aa?[[Ar,aa],[Kr,aa],[Kr,Vr],[Ar,Vr]]:[];Ba.point=$t[la]}),Cr}function Dt($t){return $t.map(function(Cr,Ar){return{x:Math.round(ut(Cr,Ar)/Ge)*Ge,y:Math.round(ht(Cr,Ar)/Ge)*Ge,i:Ar}})}return zt.links=function($t){return Dl(Dt($t)).edges.filter(function(Cr){return Cr.l&&Cr.r}).map(function(Cr){return{source:$t[Cr.l.i],target:$t[Cr.r.i]}})},zt.triangles=function($t){var Cr=[];return Dl(Dt($t)).cells.forEach(function(Ar,Vr){for(var Kr=Ar.site,aa=Ar.edges.sort(Ui),Ua=-1,la=aa.length,Ta,ka=aa[la-1].edge,Ba=ka.l===Kr?ka.r:ka.l;++UaVa&&(Va=Ar.x),Ar.y>Ma&&(Ma=Ar.y),aa.push(Ar.x),Ua.push(Ar.y);else for(la=0;laVa&&(Va=mn),Wn>Ma&&(Ma=Wn),aa.push(mn),Ua.push(Wn)}var jn=Va-ka,Zn=Ma-Ba;jn>Zn?Ma=Ba+jn:Va=ka+Zn;function hi(wi,Ji,Vo,sl,Ms,Kn,go,Do){if(!(isNaN(Vo)||isNaN(sl)))if(wi.leaf){var Es=wi.x,hs=wi.y;if(Es!=null)if(l(Es-Vo)+l(hs-sl)<.01)_i(wi,Ji,Vo,sl,Ms,Kn,go,Do);else{var Hl=wi.point;wi.x=wi.y=wi.point=null,_i(wi,Hl,Es,hs,Ms,Kn,go,Do),_i(wi,Ji,Vo,sl,Ms,Kn,go,Do)}else wi.x=Vo,wi.y=sl,wi.point=Ji}else _i(wi,Ji,Vo,sl,Ms,Kn,go,Do)}function _i(wi,Ji,Vo,sl,Ms,Kn,go,Do){var Es=(Ms+go)*.5,hs=(Kn+Do)*.5,Hl=Vo>=Es,Qo=sl>=hs,_s=Qo<<1|Hl;wi.leaf=!1,wi=wi.nodes[_s]||(wi.nodes[_s]=ns()),Hl?Ms=Es:go=Es,Qo?Kn=hs:Do=hs,hi(wi,Ji,Vo,sl,Ms,Kn,go,Do)}var Po=ns();if(Po.add=function(wi){hi(Po,wi,+Vr(wi,++la),+Kr(wi,la),ka,Ba,Va,Ma)},Po.visit=function(wi){_u(wi,Po,ka,Ba,Va,Ma)},Po.find=function(wi){return Nc(Po,wi[0],wi[1],ka,Ba,Va,Ma)},la=-1,Le==null){for(;++laxt||Kr>zt||aa=mn,Zn=Ye>=Wn,hi=Zn<<1|jn,_i=hi+4;hi<_i;++hi)if(Ar=Ma[hi&3])switch(hi&3){case 0:Cr(Ar,Vr,Kr,mn,Wn);break;case 1:Cr(Ar,mn,Kr,aa,Wn);break;case 2:Cr(Ar,Vr,Wn,mn,Ua);break;case 3:Cr(Ar,mn,Wn,aa,Ua);break}}}(pe,ut,ht,xt,zt),$t}d.interpolateRgb=ml;function ml(pe,Le){pe=d.rgb(pe),Le=d.rgb(Le);var Ye=pe.r,ut=pe.g,ht=pe.b,xt=Le.r-Ye,zt=Le.g-ut,Dt=Le.b-ht;return function($t){return"#"+yr(Math.round(Ye+xt*$t))+yr(Math.round(ut+zt*$t))+yr(Math.round(ht+Dt*$t))}}d.interpolateObject=fl;function fl(pe,Le){var Ye={},ut={},ht;for(ht in pe)ht in Le?Ye[ht]=Ko(pe[ht],Le[ht]):ut[ht]=pe[ht];for(ht in Le)ht in pe||(ut[ht]=Le[ht]);return function(xt){for(ht in Ye)ut[ht]=Ye[ht](xt);return ut}}d.interpolateNumber=_l;function _l(pe,Le){return pe=+pe,Le=+Le,function(Ye){return pe*(1-Ye)+Le*Ye}}d.interpolateString=Yu;function Yu(pe,Le){var Ye=Ts.lastIndex=Tl.lastIndex=0,ut,ht,xt,zt=-1,Dt=[],$t=[];for(pe=pe+"",Le=Le+"";(ut=Ts.exec(pe))&&(ht=Tl.exec(Le));)(xt=ht.index)>Ye&&(xt=Le.slice(Ye,xt),Dt[zt]?Dt[zt]+=xt:Dt[++zt]=xt),(ut=ut[0])===(ht=ht[0])?Dt[zt]?Dt[zt]+=ht:Dt[++zt]=ht:(Dt[++zt]=null,$t.push({i:zt,x:_l(ut,ht)})),Ye=Tl.lastIndex;return Ye=0&&!(ut=d.interpolators[Ye](pe,Le)););return ut}d.interpolators=[function(pe,Le){var Ye=typeof Le;return(Ye==="string"?Jr.has(Le.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Le)?ml:Yu:Le instanceof Ia?ml:Array.isArray(Le)?Cs:Ye==="object"&&isNaN(Le)?fl:_l)(pe,Le)}],d.interpolateArray=Cs;function Cs(pe,Le){var Ye=[],ut=[],ht=pe.length,xt=Le.length,zt=Math.min(pe.length,Le.length),Dt;for(Dt=0;Dt=0?pe.slice(0,Le):pe,ut=Le>=0?pe.slice(Le+1):"in";return Ye=Ul.get(Ye)||Nu,ut=Ku.get(ut)||F,Bs(ut(Ye.apply(null,x.call(arguments,1))))};function Bs(pe){return function(Le){return Le<=0?0:Le>=1?1:pe(Le)}}function Gf(pe){return function(Le){return 1-pe(1-Le)}}function Eo(pe){return function(Le){return .5*(Le<.5?pe(2*Le):2-pe(2-2*Le))}}function Wf(pe){return pe*pe}function is(pe){return pe*pe*pe}function oo(pe){if(pe<=0)return 0;if(pe>=1)return 1;var Le=pe*pe,Ye=Le*pe;return 4*(pe<.5?Ye:3*(pe-Le)+Ye-.75)}function pc(pe){return function(Le){return Math.pow(Le,pe)}}function xu(pe){return 1-Math.cos(pe*Pe)}function zl(pe){return Math.pow(2,10*(pe-1))}function Kc(pe){return 1-Math.sqrt(1-pe*pe)}function Ju(pe,Le){var Ye;return arguments.length<2&&(Le=.45),arguments.length?Ye=Le/ge*Math.asin(1/pe):(pe=1,Ye=Le/4),function(ut){return 1+pe*Math.pow(2,-10*ut)*Math.sin((ut-Ye)*ge/Le)}}function gc(pe){return pe||(pe=1.70158),function(Le){return Le*Le*((pe+1)*Le-pe)}}function hl(pe){return pe<1/2.75?7.5625*pe*pe:pe<2/2.75?7.5625*(pe-=1.5/2.75)*pe+.75:pe<2.5/2.75?7.5625*(pe-=2.25/2.75)*pe+.9375:7.5625*(pe-=2.625/2.75)*pe+.984375}d.interpolateHcl=yf;function yf(pe,Le){pe=d.hcl(pe),Le=d.hcl(Le);var Ye=pe.h,ut=pe.c,ht=pe.l,xt=Le.h-Ye,zt=Le.c-ut,Dt=Le.l-ht;return isNaN(zt)&&(zt=0,ut=isNaN(ut)?Le.c:ut),isNaN(xt)?(xt=0,Ye=isNaN(Ye)?Le.h:Ye):xt>180?xt-=360:xt<-180&&(xt+=360),function($t){return jt(Ye+xt*$t,ut+zt*$t,ht+Dt*$t)+""}}d.interpolateHsl=Jc;function Jc(pe,Le){pe=d.hsl(pe),Le=d.hsl(Le);var Ye=pe.h,ut=pe.s,ht=pe.l,xt=Le.h-Ye,zt=Le.s-ut,Dt=Le.l-ht;return isNaN(zt)&&(zt=0,ut=isNaN(ut)?Le.s:ut),isNaN(xt)?(xt=0,Ye=isNaN(Ye)?Le.h:Ye):xt>180?xt-=360:xt<-180&&(xt+=360),function($t){return Ka(Ye+xt*$t,ut+zt*$t,ht+Dt*$t)+""}}d.interpolateLab=Uc;function Uc(pe,Le){pe=d.lab(pe),Le=d.lab(Le);var Ye=pe.l,ut=pe.a,ht=pe.b,xt=Le.l-Ye,zt=Le.a-ut,Dt=Le.b-ht;return function($t){return Aa(Ye+xt*$t,ut+zt*$t,ht+Dt*$t)+""}}d.interpolateRound=$u;function $u(pe,Le){return Le-=pe,function(Ye){return Math.round(pe+Le*Ye)}}d.transform=function(pe){var Le=E.createElementNS(d.ns.prefix.svg,"g");return(d.transform=function(Ye){if(Ye!=null){Le.setAttribute("transform",Ye);var ut=Le.transform.baseVal.consolidate()}return new jc(ut?ut.matrix:sc)})(pe)};function jc(pe){var Le=[pe.a,pe.b],Ye=[pe.c,pe.d],ut=bu(Le),ht=$c(Le,Ye),xt=bu(Qc(Ye,Le,-ht))||0;Le[0]*Ye[1]180?Le+=360:Le-pe>180&&(pe+=360),ut.push({i:Ye.push(wu(Ye)+"rotate(",null,")")-2,x:_l(pe,Le)})):Le&&Ye.push(wu(Ye)+"rotate("+Le+")")}function ef(pe,Le,Ye,ut){pe!==Le?ut.push({i:Ye.push(wu(Ye)+"skewX(",null,")")-2,x:_l(pe,Le)}):Le&&Ye.push(wu(Ye)+"skewX("+Le+")")}function ps(pe,Le,Ye,ut){if(pe[0]!==Le[0]||pe[1]!==Le[1]){var ht=Ye.push(wu(Ye)+"scale(",null,",",null,")");ut.push({i:ht-4,x:_l(pe[0],Le[0])},{i:ht-2,x:_l(pe[1],Le[1])})}else(Le[0]!==1||Le[1]!==1)&&Ye.push(wu(Ye)+"scale("+Le+")")}function Vc(pe,Le){var Ye=[],ut=[];return pe=d.transform(pe),Le=d.transform(Le),eu(pe.translate,Le.translate,Ye,ut),Sc(pe.rotate,Le.rotate,Ye,ut),ef(pe.skew,Le.skew,Ye,ut),ps(pe.scale,Le.scale,Ye,ut),pe=Le=null,function(ht){for(var xt=-1,zt=ut.length,Dt;++xt0?xt=Ma:(Ye.c=null,Ye.t=NaN,Ye=null,Le.end({type:"end",alpha:xt=0})):Ma>0&&(Le.start({type:"start",alpha:xt=Ma}),Ye=Ga(pe.tick)),pe):xt},pe.start=function(){var Ma,mn=aa.length,Wn=Ua.length,jn=ut[0],Zn=ut[1],hi,_i;for(Ma=0;Ma=0;)xt.push(Ar=Cr[$t]),Ar.parent=Dt,Ar.depth=Dt.depth+1;Ye&&(Dt.value=0),Dt.children=Cr}else Ye&&(Dt.value=+Ye.call(ut,Dt,Dt.depth)||0),delete Dt.children;return Pu(ht,function(Vr){var Kr,aa;pe&&(Kr=Vr.children)&&Kr.sort(pe),Ye&&(aa=Vr.parent)&&(aa.value+=Vr.value)}),zt}return ut.sort=function(ht){return arguments.length?(pe=ht,ut):pe},ut.children=function(ht){return arguments.length?(Le=ht,ut):Le},ut.value=function(ht){return arguments.length?(Ye=ht,ut):Ye},ut.revalue=function(ht){return Ye&&(yc(ht,function(xt){xt.children&&(xt.value=0)}),Pu(ht,function(xt){var zt;xt.children||(xt.value=+Ye.call(ut,xt,xt.depth)||0),(zt=xt.parent)&&(zt.value+=xt.value)})),ht},ut};function Ns(pe,Le){return d.rebind(pe,Le,"sort","children","value"),pe.nodes=pe,pe.links=nh,pe}function yc(pe,Le){for(var Ye=[pe];(pe=Ye.pop())!=null;)if(Le(pe),(ht=pe.children)&&(ut=ht.length))for(var ut,ht;--ut>=0;)Ye.push(ht[ut])}function Pu(pe,Le){for(var Ye=[pe],ut=[];(pe=Ye.pop())!=null;)if(ut.push(pe),(zt=pe.children)&&(xt=zt.length))for(var ht=-1,xt,zt;++htht&&(ht=Dt),ut.push(Dt)}for(zt=0;ztut&&(Ye=Le,ut=ht);return Ye}function vu(pe){return pe.reduce(du,0)}function du(pe,Le){return pe+Le[1]}d.layout.histogram=function(){var pe=!0,Le=Number,Ye=_c,ut=af;function ht(xt,Kr){for(var Dt=[],$t=xt.map(Le,this),Cr=Ye.call(this,$t,Kr),Ar=ut.call(this,Cr,$t,Kr),Vr,Kr=-1,aa=$t.length,Ua=Ar.length-1,la=pe?1:1/aa,Ta;++Kr0)for(Kr=-1;++Kr=Cr[0]&&Ta<=Cr[1]&&(Vr=Dt[d.bisect(Ar,Ta,1,Ua)-1],Vr.y+=la,Vr.push(xt[Kr]));return Dt}return ht.value=function(xt){return arguments.length?(Le=xt,ht):Le},ht.range=function(xt){return arguments.length?(Ye=wt(xt),ht):Ye},ht.bins=function(xt){return arguments.length?(ut=typeof xt=="number"?function(zt){return Rs(zt,xt)}:wt(xt),ht):ut},ht.frequency=function(xt){return arguments.length?(pe=!!xt,ht):pe},ht};function af(pe,Le){return Rs(pe,Math.ceil(Math.log(Le.length)/Math.LN2+1))}function Rs(pe,Le){for(var Ye=-1,ut=+pe[0],ht=(pe[1]-ut)/Le,xt=[];++Ye<=Le;)xt[Ye]=ht*Ye+ut;return xt}function _c(pe){return[d.min(pe),d.max(pe)]}d.layout.pack=function(){var pe=d.layout.hierarchy().sort(ju),Le=0,Ye=[1,1],ut;function ht(xt,zt){var Dt=pe.call(this,xt,zt),$t=Dt[0],Cr=Ye[0],Ar=Ye[1],Vr=ut==null?Math.sqrt:typeof ut=="function"?ut:function(){return ut};if($t.x=$t.y=0,Pu($t,function(aa){aa.r=+Vr(aa.value)}),Pu($t,bc),Le){var Kr=Le*(ut?1:Math.max(2*$t.r/Cr,2*$t.r/Ar))/2;Pu($t,function(aa){aa.r+=Kr}),Pu($t,bc),Pu($t,function(aa){aa.r-=Kr})}return nf($t,Cr/2,Ar/2,ut?1:1/Math.max(2*$t.r/Cr,2*$t.r/Ar)),Dt}return ht.size=function(xt){return arguments.length?(Ye=xt,ht):Ye},ht.radius=function(xt){return arguments.length?(ut=xt==null||typeof xt=="function"?xt:+xt,ht):ut},ht.padding=function(xt){return arguments.length?(Le=+xt,ht):Le},Ns(ht,pe)};function ju(pe,Le){return pe.value-Le.value}function iu(pe,Le){var Ye=pe._pack_next;pe._pack_next=Le,Le._pack_prev=pe,Le._pack_next=Ye,Ye._pack_prev=Le}function xc(pe,Le){pe._pack_next=Le,Le._pack_prev=pe}function Iu(pe,Le){var Ye=Le.x-pe.x,ut=Le.y-pe.y,ht=pe.r+Le.r;return .999*ht*ht>Ye*Ye+ut*ut}function bc(pe){if(!(Le=pe.children)||!(Kr=Le.length))return;var Le,Ye=1/0,ut=-1/0,ht=1/0,xt=-1/0,zt,Dt,$t,Cr,Ar,Vr,Kr;function aa(Ma){Ye=Math.min(Ma.x-Ma.r,Ye),ut=Math.max(Ma.x+Ma.r,ut),ht=Math.min(Ma.y-Ma.r,ht),xt=Math.max(Ma.y+Ma.r,xt)}if(Le.forEach(Lf),zt=Le[0],zt.x=-zt.r,zt.y=0,aa(zt),Kr>1&&(Dt=Le[1],Dt.x=Dt.r,Dt.y=0,aa(Dt),Kr>2))for($t=Le[2],ou(zt,Dt,$t),aa($t),iu(zt,$t),zt._pack_prev=$t,iu($t,Dt),Dt=zt._pack_next,Cr=3;CrTa.x&&(Ta=mn),mn.depth>ka.depth&&(ka=mn)});var Ba=Le(la,Ta)/2-la.x,Va=Ye[0]/(Ta.x+Le(Ta,la)/2+Ba),Ma=Ye[1]/(ka.depth||1);yc(aa,function(mn){mn.x=(mn.x+Ba)*Va,mn.y=mn.depth*Ma})}return Kr}function xt(Ar){for(var Vr={A:null,children:[Ar]},Kr=[Vr],aa;(aa=Kr.pop())!=null;)for(var Ua=aa.children,la,Ta=0,ka=Ua.length;Ta0&&(Ol(tc(la,Ar,Kr),Ar,mn),ka+=mn,Ba+=mn),Va+=la.m,ka+=aa.m,Ma+=Ta.m,Ba+=Ua.m;la&&!Zs(Ua)&&(Ua.t=la,Ua.m+=Va-Ba),aa&&!Au(Ta)&&(Ta.t=aa,Ta.m+=ka-Ma,Kr=Ar)}return Kr}function Cr(Ar){Ar.x*=Ye[0],Ar.y=Ar.depth*Ye[1]}return ht.separation=function(Ar){return arguments.length?(Le=Ar,ht):Le},ht.size=function(Ar){return arguments.length?(ut=(Ye=Ar)==null?Cr:null,ht):ut?null:Ye},ht.nodeSize=function(Ar){return arguments.length?(ut=(Ye=Ar)==null?null:Cr,ht):ut?Ye:null},Ns(ht,pe)};function Ru(pe,Le){return pe.parent==Le.parent?1:2}function Au(pe){var Le=pe.children;return Le.length?Le[0]:pe.t}function Zs(pe){var Le=pe.children,Ye;return(Ye=Le.length)?Le[Ye-1]:pe.t}function Ol(pe,Le,Ye){var ut=Ye/(Le.i-pe.i);Le.c-=ut,Le.s+=Ye,pe.c+=ut,Le.z+=Ye,Le.m+=Ye}function bl(pe){for(var Le=0,Ye=0,ut=pe.children,ht=ut.length,xt;--ht>=0;)xt=ut[ht],xt.z+=Le,xt.m+=Le,Le+=xt.s+(Ye+=xt.c)}function tc(pe,Le,Ye){return pe.a.parent===Le.parent?pe.a:Ye}d.layout.cluster=function(){var pe=d.layout.hierarchy().sort(null).value(null),Le=Ru,Ye=[1,1],ut=!1;function ht(xt,zt){var Dt=pe.call(this,xt,zt),$t=Dt[0],Cr,Ar=0;Pu($t,function(la){var Ta=la.children;Ta&&Ta.length?(la.x=Cc(Ta),la.y=Su(Ta)):(la.x=Cr?Ar+=Le(la,Cr):0,la.y=0,Cr=la)});var Vr=Ht($t),Kr=ur($t),aa=Vr.x-Le(Vr,Kr)/2,Ua=Kr.x+Le(Kr,Vr)/2;return Pu($t,ut?function(la){la.x=(la.x-$t.x)*Ye[0],la.y=($t.y-la.y)*Ye[1]}:function(la){la.x=(la.x-aa)/(Ua-aa)*Ye[0],la.y=(1-($t.y?la.y/$t.y:1))*Ye[1]}),Dt}return ht.separation=function(xt){return arguments.length?(Le=xt,ht):Le},ht.size=function(xt){return arguments.length?(ut=(Ye=xt)==null,ht):ut?null:Ye},ht.nodeSize=function(xt){return arguments.length?(ut=(Ye=xt)!=null,ht):ut?Ye:null},Ns(ht,pe)};function Su(pe){return 1+d.max(pe,function(Le){return Le.y})}function Cc(pe){return pe.reduce(function(Le,Ye){return Le+Ye.x},0)/pe.length}function Ht(pe){var Le=pe.children;return Le&&Le.length?Ht(Le[0]):pe}function ur(pe){var Le=pe.children,Ye;return Le&&(Ye=Le.length)?ur(Le[Ye-1]):pe}d.layout.treemap=function(){var pe=d.layout.hierarchy(),Le=Math.round,Ye=[1,1],ut=null,ht=qr,xt=!1,zt,Dt="squarify",$t=.5*(1+Math.sqrt(5));function Cr(la,Ta){for(var ka=-1,Ba=la.length,Va,Ma;++ka0;)Ba.push(Ma=Va[Zn-1]),Ba.area+=Ma.area,Dt!=="squarify"||(Wn=Kr(Ba,jn))<=mn?(Va.pop(),mn=Wn):(Ba.area-=Ba.pop().area,aa(Ba,jn,ka,!1),jn=Math.min(ka.dx,ka.dy),Ba.length=Ba.area=0,mn=1/0);Ba.length&&(aa(Ba,jn,ka,!0),Ba.length=Ba.area=0),Ta.forEach(Ar)}}function Vr(la){var Ta=la.children;if(Ta&&Ta.length){var ka=ht(la),Ba=Ta.slice(),Va,Ma=[];for(Cr(Ba,ka.dx*ka.dy/la.value),Ma.area=0;Va=Ba.pop();)Ma.push(Va),Ma.area+=Va.area,Va.z!=null&&(aa(Ma,Va.z?ka.dx:ka.dy,ka,!Ba.length),Ma.length=Ma.area=0);Ta.forEach(Vr)}}function Kr(la,Ta){for(var ka=la.area,Ba,Va=0,Ma=1/0,mn=-1,Wn=la.length;++mnVa&&(Va=Ba));return ka*=ka,Ta*=Ta,ka?Math.max(Ta*Va*$t/ka,ka/(Ta*Ma*$t)):1/0}function aa(la,Ta,ka,Ba){var Va=-1,Ma=la.length,mn=ka.x,Wn=ka.y,jn=Ta?Le(la.area/Ta):0,Zn;if(Ta==ka.dx){for((Ba||jn>ka.dy)&&(jn=ka.dy);++Vaka.dx)&&(jn=ka.dx);++Va1);return pe+Le*ut*Math.sqrt(-2*Math.log(xt)/xt)}},logNormal:function(){var pe=d.random.normal.apply(d,arguments);return function(){return Math.exp(pe())}},bates:function(pe){var Le=d.random.irwinHall(pe);return function(){return Le()/pe}},irwinHall:function(pe){return function(){for(var Le=0,Ye=0;Ye2?Ja:ja,Cr=ut?mf:Zf;return ht=$t(pe,Le,Cr,Ye),xt=$t(Le,pe,Cr,Ko),Dt}function Dt($t){return ht($t)}return Dt.invert=function($t){return xt($t)},Dt.domain=function($t){return arguments.length?(pe=$t.map(Number),zt()):pe},Dt.range=function($t){return arguments.length?(Le=$t,zt()):Le},Dt.rangeRound=function($t){return Dt.range($t).interpolate($u)},Dt.clamp=function($t){return arguments.length?(ut=$t,zt()):ut},Dt.interpolate=function($t){return arguments.length?(Ye=$t,zt()):Ye},Dt.ticks=function($t){return zi(pe,$t)},Dt.tickFormat=function($t,Cr){return d3_scale_linearTickFormat(pe,$t,Cr)},Dt.nice=function($t){return Wa(pe,$t),zt()},Dt.copy=function(){return _n(pe,Le,Ye,ut)},zt()}function on(pe,Le){return d.rebind(pe,Le,"range","rangeRound","interpolate","clamp")}function Wa(pe,Le){return sn(pe,gn(On(pe,Le)[2])),sn(pe,gn(On(pe,Le)[2])),pe}function On(pe,Le){Le==null&&(Le=10);var Ye=ua(pe),ut=Ye[1]-Ye[0],ht=Math.pow(10,Math.floor(Math.log(ut/Le)/Math.LN10)),xt=Le/ut*ht;return xt<=.15?ht*=10:xt<=.35?ht*=5:xt<=.75&&(ht*=2),Ye[0]=Math.ceil(Ye[0]/ht)*ht,Ye[1]=Math.floor(Ye[1]/ht)*ht+ht*.5,Ye[2]=ht,Ye}function zi(pe,Le){return d.range.apply(d,On(pe,Le))}d.scale.log=function(){return ki(d.scale.linear().domain([0,1]),10,!0,[1,10])};function ki(pe,Le,Ye,ut){function ht(Dt){return(Ye?Math.log(Dt<0?0:Dt):-Math.log(Dt>0?0:-Dt))/Math.log(Le)}function xt(Dt){return Ye?Math.pow(Le,Dt):-Math.pow(Le,-Dt)}function zt(Dt){return pe(ht(Dt))}return zt.invert=function(Dt){return xt(pe.invert(Dt))},zt.domain=function(Dt){return arguments.length?(Ye=Dt[0]>=0,pe.domain((ut=Dt.map(Number)).map(ht)),zt):ut},zt.base=function(Dt){return arguments.length?(Le=+Dt,pe.domain(ut.map(ht)),zt):Le},zt.nice=function(){var Dt=sn(ut.map(ht),Ye?Math:ji);return pe.domain(Dt),ut=Dt.map(xt),zt},zt.ticks=function(){var Dt=ua(ut),$t=[],Cr=Dt[0],Ar=Dt[1],Vr=Math.floor(ht(Cr)),Kr=Math.ceil(ht(Ar)),aa=Le%1?2:Le;if(isFinite(Kr-Vr)){if(Ye){for(;Vr0;Ua--)$t.push(xt(Vr)*Ua);for(Vr=0;$t[Vr]Ar;Kr--);$t=$t.slice(Vr,Kr)}return $t},zt.copy=function(){return ki(pe.copy(),Le,Ye,ut)},on(zt,pe)}var ji={floor:function(pe){return-Math.ceil(-pe)},ceil:function(pe){return-Math.floor(-pe)}};d.scale.pow=function(){return Ni(d.scale.linear(),1,[0,1])};function Ni(pe,Le,Ye){var ut=Bn(Le),ht=Bn(1/Le);function xt(zt){return pe(ut(zt))}return xt.invert=function(zt){return ht(pe.invert(zt))},xt.domain=function(zt){return arguments.length?(pe.domain((Ye=zt.map(Number)).map(ut)),xt):Ye},xt.ticks=function(zt){return zi(Ye,zt)},xt.tickFormat=function(zt,Dt){return d3_scale_linearTickFormat(Ye,zt,Dt)},xt.nice=function(zt){return xt.domain(Wa(Ye,zt))},xt.exponent=function(zt){return arguments.length?(ut=Bn(Le=zt),ht=Bn(1/Le),pe.domain(Ye.map(ut)),xt):Le},xt.copy=function(){return Ni(pe.copy(),Le,Ye)},on(xt,pe)}function Bn(pe){return function(Le){return Le<0?-Math.pow(-Le,pe):Math.pow(Le,pe)}}d.scale.sqrt=function(){return d.scale.pow().exponent(.5)},d.scale.ordinal=function(){return An([],{t:"range",a:[[]]})};function An(pe,Le){var Ye,ut,ht;function xt(Dt){return ut[((Ye.get(Dt)||(Le.t==="range"?Ye.set(Dt,pe.push(Dt)):NaN))-1)%ut.length]}function zt(Dt,$t){return d.range(pe.length).map(function(Cr){return Dt+$t*Cr})}return xt.domain=function(Dt){if(!arguments.length)return pe;pe=[],Ye=new S;for(var $t=-1,Cr=Dt.length,Ar;++$t0?Ye[xt-1]:pe[0],xtKr?0:1;if(Ar=be)return $t(Ar,Ua)+(Cr?$t(Cr,1-Ua):"")+"Z";var la,Ta,ka,Ba,Va=0,Ma=0,mn,Wn,jn,Zn,hi,_i,Po,wi,Ji=[];if((Ba=(+zt.apply(this,arguments)||0)/2)&&(ka=ut===Ss?Math.sqrt(Cr*Cr+Ar*Ar):+ut.apply(this,arguments),Ua||(Ma*=-1),Ar&&(Ma=Mt(ka/Ar*Math.sin(Ba))),Cr&&(Va=Mt(ka/Cr*Math.sin(Ba)))),Ar){mn=Ar*Math.cos(Vr+Ma),Wn=Ar*Math.sin(Vr+Ma),jn=Ar*Math.cos(Kr-Ma),Zn=Ar*Math.sin(Kr-Ma);var Vo=Math.abs(Kr-Vr-2*Ma)<=ve?0:1;if(Ma&&jl(mn,Wn,jn,Zn)===Ua^Vo){var sl=(Vr+Kr)/2;mn=Ar*Math.cos(sl),Wn=Ar*Math.sin(sl),jn=Zn=null}}else mn=Wn=0;if(Cr){hi=Cr*Math.cos(Kr-Va),_i=Cr*Math.sin(Kr-Va),Po=Cr*Math.cos(Vr+Va),wi=Cr*Math.sin(Vr+Va);var Ms=Math.abs(Vr-Kr+2*Va)<=ve?0:1;if(Va&&jl(hi,_i,Po,wi)===1-Ua^Ms){var Kn=(Vr+Kr)/2;hi=Cr*Math.cos(Kn),_i=Cr*Math.sin(Kn),Po=wi=null}}else hi=_i=0;if(aa>Ge&&(la=Math.min(Math.abs(Ar-Cr)/2,+Ye.apply(this,arguments)))>.001){Ta=Cr0?0:1}function Vl(pe,Le,Ye,ut,ht){var xt=pe[0]-Le[0],zt=pe[1]-Le[1],Dt=(ht?ut:-ut)/Math.sqrt(xt*xt+zt*zt),$t=Dt*zt,Cr=-Dt*xt,Ar=pe[0]+$t,Vr=pe[1]+Cr,Kr=Le[0]+$t,aa=Le[1]+Cr,Ua=(Ar+Kr)/2,la=(Vr+aa)/2,Ta=Kr-Ar,ka=aa-Vr,Ba=Ta*Ta+ka*ka,Va=Ye-ut,Ma=Ar*aa-Kr*Vr,mn=(ka<0?-1:1)*Math.sqrt(Math.max(0,Va*Va*Ba-Ma*Ma)),Wn=(Ma*ka-Ta*mn)/Ba,jn=(-Ma*Ta-ka*mn)/Ba,Zn=(Ma*ka+Ta*mn)/Ba,hi=(-Ma*Ta+ka*mn)/Ba,_i=Wn-Ua,Po=jn-la,wi=Zn-Ua,Ji=hi-la;return _i*_i+Po*Po>wi*wi+Ji*Ji&&(Wn=Zn,jn=hi),[[Wn-$t,jn-Cr],[Wn*Ye/Va,jn*Ye/Va]]}function cc(){return!0}function ql(pe){var Le=yi,Ye=Ci,ut=cc,ht=ol,xt=ht.key,zt=.7;function Dt($t){var Cr=[],Ar=[],Vr=-1,Kr=$t.length,aa,Ua=wt(Le),la=wt(Ye);function Ta(){Cr.push("M",ht(pe(Ar),zt))}for(;++Vr1?pe.join("L"):pe+"Z"}function rc(pe){return pe.join("L")+"Z"}function Vi(pe){for(var Le=0,Ye=pe.length,ut=pe[0],ht=[ut[0],",",ut[1]];++Le1&&ht.push("H",ut[0]),ht.join("")}function eo(pe){for(var Le=0,Ye=pe.length,ut=pe[0],ht=[ut[0],",",ut[1]];++Le1){Dt=Le[1],xt=pe[$t],$t++,ut+="C"+(ht[0]+zt[0])+","+(ht[1]+zt[1])+","+(xt[0]-Dt[0])+","+(xt[1]-Dt[1])+","+xt[0]+","+xt[1];for(var Cr=2;Cr9&&(xt=Ye*3/Math.sqrt(xt),zt[Dt]=xt*ut,zt[Dt+1]=xt*ht));for(Dt=-1;++Dt<=$t;)xt=(pe[Math.min($t,Dt+1)][0]-pe[Math.max(0,Dt-1)][0])/(6*(1+zt[Dt]*zt[Dt])),Le.push([xt||0,zt[Dt]*xt||0]);return Le}function Ze(pe){return pe.length<3?ol(pe):pe[0]+I(pe,je(pe))}d.svg.line.radial=function(){var pe=ql(at);return pe.radius=pe.x,delete pe.x,pe.angle=pe.y,delete pe.y,pe};function at(pe){for(var Le,Ye=-1,ut=pe.length,ht,xt;++Yeve)+",1 "+Vr}function Cr(Ar,Vr,Kr,aa){return"Q 0,0 "+aa}return xt.radius=function(Ar){return arguments.length?(Ye=wt(Ar),xt):Ye},xt.source=function(Ar){return arguments.length?(pe=wt(Ar),xt):pe},xt.target=function(Ar){return arguments.length?(Le=wt(Ar),xt):Le},xt.startAngle=function(Ar){return arguments.length?(ut=wt(Ar),xt):ut},xt.endAngle=function(Ar){return arguments.length?(ht=wt(Ar),xt):ht},xt};function Et(pe){return pe.radius}d.svg.diagonal=function(){var pe=Tt,Le=gt,Ye=Yt;function ut(ht,xt){var zt=pe.call(this,ht,xt),Dt=Le.call(this,ht,xt),$t=(zt.y+Dt.y)/2,Cr=[zt,{x:zt.x,y:$t},{x:Dt.x,y:$t},Dt];return Cr=Cr.map(Ye),"M"+Cr[0]+"C"+Cr[1]+" "+Cr[2]+" "+Cr[3]}return ut.source=function(ht){return arguments.length?(pe=wt(ht),ut):pe},ut.target=function(ht){return arguments.length?(Le=wt(ht),ut):Le},ut.projection=function(ht){return arguments.length?(Ye=ht,ut):Ye},ut};function Yt(pe){return[pe.x,pe.y]}d.svg.diagonal.radial=function(){var pe=d.svg.diagonal(),Le=Yt,Ye=pe.projection;return pe.projection=function(ut){return arguments.length?Ye(rr(Le=ut)):Le},pe};function rr(pe){return function(){var Le=pe.apply(this,arguments),Ye=Le[0],ut=Le[1]-Pe;return[Ye*Math.cos(ut),Ye*Math.sin(ut)]}}d.svg.symbol=function(){var pe=Sr,Le=sr;function Ye(ut,ht){return(Qr.get(pe.call(this,ut,ht))||Nr)(Le.call(this,ut,ht))}return Ye.type=function(ut){return arguments.length?(pe=wt(ut),Ye):pe},Ye.size=function(ut){return arguments.length?(Le=wt(ut),Ye):Le},Ye};function sr(){return 64}function Sr(){return"circle"}function Nr(pe){var Le=Math.sqrt(pe/ve);return"M0,"+Le+"A"+Le+","+Le+" 0 1,1 0,"+-Le+"A"+Le+","+Le+" 0 1,1 0,"+Le+"Z"}var Qr=d.map({circle:Nr,cross:function(pe){var Le=Math.sqrt(pe/5)/2;return"M"+-3*Le+","+-Le+"H"+-Le+"V"+-3*Le+"H"+Le+"V"+-Le+"H"+3*Le+"V"+Le+"H"+Le+"V"+3*Le+"H"+-Le+"V"+Le+"H"+-3*Le+"Z"},diamond:function(pe){var Le=Math.sqrt(pe/(2*_a)),Ye=Le*_a;return"M0,"+-Le+"L"+Ye+",0 0,"+Le+" "+-Ye+",0Z"},square:function(pe){var Le=Math.sqrt(pe)/2;return"M"+-Le+","+-Le+"L"+Le+","+-Le+" "+Le+","+Le+" "+-Le+","+Le+"Z"},"triangle-down":function(pe){var Le=Math.sqrt(pe/ia),Ye=Le*ia/2;return"M0,"+Ye+"L"+Le+","+-Ye+" "+-Le+","+-Ye+"Z"},"triangle-up":function(pe){var Le=Math.sqrt(pe/ia),Ye=Le*ia/2;return"M0,"+-Ye+"L"+Le+","+Ye+" "+-Le+","+Ye+"Z"}});d.svg.symbolTypes=Qr.keys();var ia=Math.sqrt(3),_a=Math.tan(30*We);ee.transition=function(pe){for(var Le=pi||++Nn,Ye=No(pe),ut=[],ht,xt,zt=ii||{time:Date.now(),ease:oo,delay:0,duration:250},Dt=-1,$t=this.length;++Dt<$t;){ut.push(ht=[]);for(var Cr=this[Dt],Ar=-1,Vr=Cr.length;++Ar0;)Vr[--Ba].call(pe,ka);if(Ta>=1)return zt.event&&zt.event.end.call(pe,pe.__data__,Le),--xt.count?delete xt[ut]:delete pe[Ye],1}zt||(Dt=ht.time,$t=Ga(Kr,0,Dt),zt=xt[ut]={tween:new S,time:Dt,timer:$t,delay:ht.delay,duration:ht.duration,ease:ht.ease,index:Le},ht=null,++xt.count)}d.svg.axis=function(){var pe=d.scale.linear(),Le=Zo,Ye=6,ut=6,ht=3,xt=[10],zt=null,Dt;function $t(Cr){Cr.each(function(){var Ar=d.select(this),Vr=this.__chart__||pe,Kr=this.__chart__=pe.copy(),aa=zt??(Kr.ticks?Kr.ticks.apply(Kr,xt):Kr.domain()),Ua=Dt??(Kr.tickFormat?Kr.tickFormat.apply(Kr,xt):F),la=Ar.selectAll(".tick").data(aa,Kr),Ta=la.enter().insert("g",".domain").attr("class","tick").style("opacity",Ge),ka=d.transition(la.exit()).style("opacity",Ge).remove(),Ba=d.transition(la.order()).style("opacity",1),Va=Math.max(Ye,0)+ht,Ma,mn=Fa(Kr),Wn=Ar.selectAll(".domain").data([0]),jn=(Wn.enter().append("path").attr("class","domain"),d.transition(Wn));Ta.append("line"),Ta.append("text");var Zn=Ta.select("line"),hi=Ba.select("line"),_i=la.select("text").text(Ua),Po=Ta.select("text"),wi=Ba.select("text"),Ji=Le==="top"||Le==="left"?-1:1,Vo,sl,Ms,Kn;if(Le==="bottom"||Le==="top"?(Ma=zs,Vo="x",Ms="y",sl="x2",Kn="y2",_i.attr("dy",Ji<0?"0em":".71em").style("text-anchor","middle"),jn.attr("d","M"+mn[0]+","+Ji*ut+"V0H"+mn[1]+"V"+Ji*ut)):(Ma=xo,Vo="y",Ms="x",sl="y2",Kn="x2",_i.attr("dy",".32em").style("text-anchor",Ji<0?"end":"start"),jn.attr("d","M"+Ji*ut+","+mn[0]+"H0V"+mn[1]+"H"+Ji*ut)),Zn.attr(Kn,Ji*Ye),Po.attr(Ms,Ji*Va),hi.attr(sl,0).attr(Kn,Ji*Ye),wi.attr(Vo,0).attr(Ms,Ji*Va),Kr.rangeBand){var go=Kr,Do=go.rangeBand()/2;Vr=Kr=function(Es){return go(Es)+Do}}else Vr.rangeBand?Vr=Kr:ka.call(Ma,Kr,Vr);Ta.call(Ma,Vr,Kr),Ba.call(Ma,Kr,Kr)})}return $t.scale=function(Cr){return arguments.length?(pe=Cr,$t):pe},$t.orient=function(Cr){return arguments.length?(Le=Cr in Hs?Cr+"":Zo,$t):Le},$t.ticks=function(){return arguments.length?(xt=A(arguments),$t):xt},$t.tickValues=function(Cr){return arguments.length?(zt=Cr,$t):zt},$t.tickFormat=function(Cr){return arguments.length?(Dt=Cr,$t):Dt},$t.tickSize=function(Cr){var Ar=arguments.length;return Ar?(Ye=+Cr,ut=+arguments[Ar-1],$t):Ye},$t.innerTickSize=function(Cr){return arguments.length?(Ye=+Cr,$t):Ye},$t.outerTickSize=function(Cr){return arguments.length?(ut=+Cr,$t):ut},$t.tickPadding=function(Cr){return arguments.length?(ht=+Cr,$t):ht},$t.tickSubdivide=function(){return arguments.length&&$t},$t};var Zo="bottom",Hs={top:1,right:1,bottom:1,left:1};function zs(pe,Le,Ye){pe.attr("transform",function(ut){var ht=Le(ut);return"translate("+(isFinite(ht)?ht:Ye(ut))+",0)"})}function xo(pe,Le,Ye){pe.attr("transform",function(ut){var ht=Le(ut);return"translate(0,"+(isFinite(ht)?ht:Ye(ut))+")"})}d.svg.brush=function(){var pe=oe(Ar,"brushstart","brush","brushend"),Le=null,Ye=null,ut=[0,0],ht=[0,0],xt,zt,Dt=!0,$t=!0,Cr=vl[0];function Ar(la){la.each(function(){var Ta=d.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",Ua).on("touchstart.brush",Ua),ka=Ta.selectAll(".background").data([0]);ka.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),Ta.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Ba=Ta.selectAll(".resize").data(Cr,F);Ba.exit().remove(),Ba.enter().append("g").attr("class",function(Wn){return"resize "+Wn}).style("cursor",function(Wn){return bo[Wn]}).append("rect").attr("x",function(Wn){return/[ew]$/.test(Wn)?-3:null}).attr("y",function(Wn){return/^[ns]/.test(Wn)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Ba.style("display",Ar.empty()?"none":null);var Va=d.transition(Ta),Ma=d.transition(ka),mn;Le&&(mn=Fa(Le),Ma.attr("x",mn[0]).attr("width",mn[1]-mn[0]),Kr(Va)),Ye&&(mn=Fa(Ye),Ma.attr("y",mn[0]).attr("height",mn[1]-mn[0]),aa(Va)),Vr(Va)})}Ar.event=function(la){la.each(function(){var Ta=pe.of(this,arguments),ka={x:ut,y:ht,i:xt,j:zt},Ba=this.__chart__||ka;this.__chart__=ka,pi?d.select(this).transition().each("start.brush",function(){xt=Ba.i,zt=Ba.j,ut=Ba.x,ht=Ba.y,Ta({type:"brushstart"})}).tween("brush:brush",function(){var Va=Cs(ut,ka.x),Ma=Cs(ht,ka.y);return xt=zt=null,function(mn){ut=ka.x=Va(mn),ht=ka.y=Ma(mn),Ta({type:"brush",mode:"resize"})}}).each("end.brush",function(){xt=ka.i,zt=ka.j,Ta({type:"brush",mode:"resize"}),Ta({type:"brushend"})}):(Ta({type:"brushstart"}),Ta({type:"brush",mode:"resize"}),Ta({type:"brushend"}))})};function Vr(la){la.selectAll(".resize").attr("transform",function(Ta){return"translate("+ut[+/e$/.test(Ta)]+","+ht[+/^s/.test(Ta)]+")"})}function Kr(la){la.select(".extent").attr("x",ut[0]),la.selectAll(".extent,.n>rect,.s>rect").attr("width",ut[1]-ut[0])}function aa(la){la.select(".extent").attr("y",ht[0]),la.selectAll(".extent,.e>rect,.w>rect").attr("height",ht[1]-ht[0])}function Ua(){var la=this,Ta=d.select(d.event.target),ka=pe.of(la,arguments),Ba=d.select(la),Va=Ta.datum(),Ma=!/^(n|s)$/.test(Va)&&Le,mn=!/^(e|w)$/.test(Va)&&Ye,Wn=Ta.classed("extent"),jn=fr(la),Zn,hi=d.mouse(la),_i,Po=d.select(t(la)).on("keydown.brush",Vo).on("keyup.brush",sl);if(d.event.changedTouches?Po.on("touchmove.brush",Ms).on("touchend.brush",go):Po.on("mousemove.brush",Ms).on("mouseup.brush",go),Ba.interrupt().selectAll("*").interrupt(),Wn)hi[0]=ut[0]-hi[0],hi[1]=ht[0]-hi[1];else if(Va){var wi=+/w$/.test(Va),Ji=+/^n/.test(Va);_i=[ut[1-wi]-hi[0],ht[1-Ji]-hi[1]],hi[0]=ut[wi],hi[1]=ht[Ji]}else d.event.altKey&&(Zn=hi.slice());Ba.style("pointer-events","none").selectAll(".resize").style("display",null),d.select("body").style("cursor",Ta.style("cursor")),ka({type:"brushstart"}),Ms();function Vo(){d.event.keyCode==32&&(Wn||(Zn=null,hi[0]-=ut[1],hi[1]-=ht[1],Wn=2),Q())}function sl(){d.event.keyCode==32&&Wn==2&&(hi[0]+=ut[1],hi[1]+=ht[1],Wn=0,Q())}function Ms(){var Do=d.mouse(la),Es=!1;_i&&(Do[0]+=_i[0],Do[1]+=_i[1]),Wn||(d.event.altKey?(Zn||(Zn=[(ut[0]+ut[1])/2,(ht[0]+ht[1])/2]),hi[0]=ut[+(Do[0]0))return Ut;do Ut.push(ir=new Date(+At)),Re(At,Rt),ce(At);while(ir=St)for(;ce(St),!At(St);)St.setTime(St-1)},function(St,Rt){if(St>=St)if(Rt<0)for(;++Rt<=0;)for(;Re(St,-1),!At(St););else for(;--Rt>=0;)for(;Re(St,1),!At(St););})},$e&&(Je.count=function(At,St){return x.setTime(+At),A.setTime(+St),ce(x),ce(A),Math.floor($e(x,A))},Je.every=function(At){return At=Math.floor(At),!isFinite(At)||!(At>0)?null:At>1?Je.filter(rt?function(St){return rt(St)%At===0}:function(St){return Je.count(0,St)%At===0}):Je}),Je}var e=E(function(){},function(ce,Re){ce.setTime(+ce+Re)},function(ce,Re){return Re-ce});e.every=function(ce){return ce=Math.floor(ce),!isFinite(ce)||!(ce>0)?null:ce>1?E(function(Re){Re.setTime(Math.floor(Re/ce)*ce)},function(Re,$e){Re.setTime(+Re+$e*ce)},function(Re,$e){return($e-Re)/ce}):e};var t=e.range,r=1e3,o=6e4,a=36e5,i=864e5,n=6048e5,s=E(function(ce){ce.setTime(ce-ce.getMilliseconds())},function(ce,Re){ce.setTime(+ce+Re*r)},function(ce,Re){return(Re-ce)/r},function(ce){return ce.getUTCSeconds()}),c=s.range,f=E(function(ce){ce.setTime(ce-ce.getMilliseconds()-ce.getSeconds()*r)},function(ce,Re){ce.setTime(+ce+Re*o)},function(ce,Re){return(Re-ce)/o},function(ce){return ce.getMinutes()}),v=f.range,h=E(function(ce){ce.setTime(ce-ce.getMilliseconds()-ce.getSeconds()*r-ce.getMinutes()*o)},function(ce,Re){ce.setTime(+ce+Re*a)},function(ce,Re){return(Re-ce)/a},function(ce){return ce.getHours()}),T=h.range,l=E(function(ce){ce.setHours(0,0,0,0)},function(ce,Re){ce.setDate(ce.getDate()+Re)},function(ce,Re){return(Re-ce-(Re.getTimezoneOffset()-ce.getTimezoneOffset())*o)/i},function(ce){return ce.getDate()-1}),y=l.range;function b(ce){return E(function(Re){Re.setDate(Re.getDate()-(Re.getDay()+7-ce)%7),Re.setHours(0,0,0,0)},function(Re,$e){Re.setDate(Re.getDate()+$e*7)},function(Re,$e){return($e-Re-($e.getTimezoneOffset()-Re.getTimezoneOffset())*o)/n})}var S=b(0),M=b(1),_=b(2),w=b(3),p=b(4),u=b(5),g=b(6),m=S.range,R=M.range,P=_.range,z=w.range,F=p.range,B=u.range,O=g.range,L=E(function(ce){ce.setDate(1),ce.setHours(0,0,0,0)},function(ce,Re){ce.setMonth(ce.getMonth()+Re)},function(ce,Re){return Re.getMonth()-ce.getMonth()+(Re.getFullYear()-ce.getFullYear())*12},function(ce){return ce.getMonth()}),N=L.range,U=E(function(ce){ce.setMonth(0,1),ce.setHours(0,0,0,0)},function(ce,Re){ce.setFullYear(ce.getFullYear()+Re)},function(ce,Re){return Re.getFullYear()-ce.getFullYear()},function(ce){return ce.getFullYear()});U.every=function(ce){return!isFinite(ce=Math.floor(ce))||!(ce>0)?null:E(function(Re){Re.setFullYear(Math.floor(Re.getFullYear()/ce)*ce),Re.setMonth(0,1),Re.setHours(0,0,0,0)},function(Re,$e){Re.setFullYear(Re.getFullYear()+$e*ce)})};var Z=U.range,Q=E(function(ce){ce.setUTCSeconds(0,0)},function(ce,Re){ce.setTime(+ce+Re*o)},function(ce,Re){return(Re-ce)/o},function(ce){return ce.getUTCMinutes()}),ue=Q.range,oe=E(function(ce){ce.setUTCMinutes(0,0,0)},function(ce,Re){ce.setTime(+ce+Re*a)},function(ce,Re){return(Re-ce)/a},function(ce){return ce.getUTCHours()}),le=oe.range,j=E(function(ce){ce.setUTCHours(0,0,0,0)},function(ce,Re){ce.setUTCDate(ce.getUTCDate()+Re)},function(ce,Re){return(Re-ce)/i},function(ce){return ce.getUTCDate()-1}),J=j.range;function $(ce){return E(function(Re){Re.setUTCDate(Re.getUTCDate()-(Re.getUTCDay()+7-ce)%7),Re.setUTCHours(0,0,0,0)},function(Re,$e){Re.setUTCDate(Re.getUTCDate()+$e*7)},function(Re,$e){return($e-Re)/n})}var X=$(0),re=$(1),ee=$(2),q=$(3),ae=$(4),ie=$(5),fe=$(6),we=X.range,Ae=re.range,Fe=ee.range,Ce=q.range,qe=ae.range,et=ie.range,Qe=fe.range,Ke=E(function(ce){ce.setUTCDate(1),ce.setUTCHours(0,0,0,0)},function(ce,Re){ce.setUTCMonth(ce.getUTCMonth()+Re)},function(ce,Re){return Re.getUTCMonth()-ce.getUTCMonth()+(Re.getUTCFullYear()-ce.getUTCFullYear())*12},function(ce){return ce.getUTCMonth()}),Xe=Ke.range,Me=E(function(ce){ce.setUTCMonth(0,1),ce.setUTCHours(0,0,0,0)},function(ce,Re){ce.setUTCFullYear(ce.getUTCFullYear()+Re)},function(ce,Re){return Re.getUTCFullYear()-ce.getUTCFullYear()},function(ce){return ce.getUTCFullYear()});Me.every=function(ce){return!isFinite(ce=Math.floor(ce))||!(ce>0)?null:E(function(Re){Re.setUTCFullYear(Math.floor(Re.getUTCFullYear()/ce)*ce),Re.setUTCMonth(0,1),Re.setUTCHours(0,0,0,0)},function(Re,$e){Re.setUTCFullYear(Re.getUTCFullYear()+$e*ce)})};var xe=Me.range;d.timeDay=l,d.timeDays=y,d.timeFriday=u,d.timeFridays=B,d.timeHour=h,d.timeHours=T,d.timeInterval=E,d.timeMillisecond=e,d.timeMilliseconds=t,d.timeMinute=f,d.timeMinutes=v,d.timeMonday=M,d.timeMondays=R,d.timeMonth=L,d.timeMonths=N,d.timeSaturday=g,d.timeSaturdays=O,d.timeSecond=s,d.timeSeconds=c,d.timeSunday=S,d.timeSundays=m,d.timeThursday=p,d.timeThursdays=F,d.timeTuesday=_,d.timeTuesdays=P,d.timeWednesday=w,d.timeWednesdays=z,d.timeWeek=S,d.timeWeeks=m,d.timeYear=U,d.timeYears=Z,d.utcDay=j,d.utcDays=J,d.utcFriday=ie,d.utcFridays=et,d.utcHour=oe,d.utcHours=le,d.utcMillisecond=e,d.utcMilliseconds=t,d.utcMinute=Q,d.utcMinutes=ue,d.utcMonday=re,d.utcMondays=Ae,d.utcMonth=Ke,d.utcMonths=Xe,d.utcSaturday=fe,d.utcSaturdays=Qe,d.utcSecond=s,d.utcSeconds=c,d.utcSunday=X,d.utcSundays=we,d.utcThursday=ae,d.utcThursdays=qe,d.utcTuesday=ee,d.utcTuesdays=Fe,d.utcWednesday=q,d.utcWednesdays=Ce,d.utcWeek=X,d.utcWeeks=we,d.utcYear=Me,d.utcYears=xe,Object.defineProperty(d,"__esModule",{value:!0})})}}),Xl=He({"node_modules/d3-time-format/dist/d3-time-format.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y,Bf()):(d=d||self,x(d.d3=d.d3||{},d.d3))})(Y,function(d,x){function A(ze){if(0<=ze.y&&ze.y<100){var Ge=new Date(-1,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L);return Ge.setFullYear(ze.y),Ge}return new Date(ze.y,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L)}function E(ze){if(0<=ze.y&&ze.y<100){var Ge=new Date(Date.UTC(-1,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L));return Ge.setUTCFullYear(ze.y),Ge}return new Date(Date.UTC(ze.y,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L))}function e(ze,Ge,Oe){return{y:ze,m:Ge,d:Oe,H:0,M:0,S:0,L:0}}function t(ze){var Ge=ze.dateTime,Oe=ze.date,ve=ze.time,ge=ze.periods,be=ze.days,Pe=ze.shortDays,We=ze.months,ct=ze.shortMonths,_t=c(ge),Mt=f(ge),Nt=c(be),Bt=f(be),qt=c(Pe),Zt=f(Pe),lr=c(We),ta=f(We),da=c(ct),wa=f(ct),ma={a:Aa,A:Pa,b:sa,B:Oa,c:null,d:L,e:L,f:ue,H:N,I:U,j:Z,L:Q,m:oe,M:le,p:dt,q:vt,Q:St,s:Rt,S:j,u:J,U:$,V:X,w:re,W:ee,x:null,X:null,y:q,Y:ae,Z:ie,"%":At},Ia={a:Lr,A:Er,b:_r,B:yr,c:null,d:fe,e:fe,f:qe,H:we,I:Ae,j:Fe,L:Ce,m:et,M:Qe,p:kr,q:zr,Q:St,s:Rt,S:Ke,u:Xe,U:Me,V:xe,w:ce,W:Re,x:null,X:null,y:$e,Y:rt,Z:Je,"%":At},va={a:jt,A:Ot,b:gr,B:Br,c:na,d:p,e:p,f:z,H:g,I:g,j:u,L:P,m:w,M:m,p:Lt,q:_,Q:B,s:O,S:R,u:h,U:T,V:l,w:v,W:y,x:Ur,X:ga,y:S,Y:b,Z:M,"%":F};ma.x=La(Oe,ma),ma.X=La(ve,ma),ma.c=La(Ge,ma),Ia.x=La(Oe,Ia),Ia.X=La(ve,Ia),Ia.c=La(Ge,Ia);function La(Pr,Hr){return function(Zr){var Jr=[],wt=-1,Qt=0,mr=Pr.length,$r,oa,Sa;for(Zr instanceof Date||(Zr=new Date(+Zr));++wt53)return null;"w"in Jr||(Jr.w=1),"Z"in Jr?(Qt=E(e(Jr.y,0,1)),mr=Qt.getUTCDay(),Qt=mr>4||mr===0?x.utcMonday.ceil(Qt):x.utcMonday(Qt),Qt=x.utcDay.offset(Qt,(Jr.V-1)*7),Jr.y=Qt.getUTCFullYear(),Jr.m=Qt.getUTCMonth(),Jr.d=Qt.getUTCDate()+(Jr.w+6)%7):(Qt=A(e(Jr.y,0,1)),mr=Qt.getDay(),Qt=mr>4||mr===0?x.timeMonday.ceil(Qt):x.timeMonday(Qt),Qt=x.timeDay.offset(Qt,(Jr.V-1)*7),Jr.y=Qt.getFullYear(),Jr.m=Qt.getMonth(),Jr.d=Qt.getDate()+(Jr.w+6)%7)}else("W"in Jr||"U"in Jr)&&("w"in Jr||(Jr.w="u"in Jr?Jr.u%7:"W"in Jr?1:0),mr="Z"in Jr?E(e(Jr.y,0,1)).getUTCDay():A(e(Jr.y,0,1)).getDay(),Jr.m=0,Jr.d="W"in Jr?(Jr.w+6)%7+Jr.W*7-(mr+5)%7:Jr.w+Jr.U*7-(mr+6)%7);return"Z"in Jr?(Jr.H+=Jr.Z/100|0,Jr.M+=Jr.Z%100,E(Jr)):A(Jr)}}function Vt(Pr,Hr,Zr,Jr){for(var wt=0,Qt=Hr.length,mr=Zr.length,$r,oa;wt=mr)return-1;if($r=Hr.charCodeAt(wt++),$r===37){if($r=Hr.charAt(wt++),oa=va[$r in r?Hr.charAt(wt++):$r],!oa||(Jr=oa(Pr,Zr,Jr))<0)return-1}else if($r!=Zr.charCodeAt(Jr++))return-1}return Jr}function Lt(Pr,Hr,Zr){var Jr=_t.exec(Hr.slice(Zr));return Jr?(Pr.p=Mt[Jr[0].toLowerCase()],Zr+Jr[0].length):-1}function jt(Pr,Hr,Zr){var Jr=qt.exec(Hr.slice(Zr));return Jr?(Pr.w=Zt[Jr[0].toLowerCase()],Zr+Jr[0].length):-1}function Ot(Pr,Hr,Zr){var Jr=Nt.exec(Hr.slice(Zr));return Jr?(Pr.w=Bt[Jr[0].toLowerCase()],Zr+Jr[0].length):-1}function gr(Pr,Hr,Zr){var Jr=da.exec(Hr.slice(Zr));return Jr?(Pr.m=wa[Jr[0].toLowerCase()],Zr+Jr[0].length):-1}function Br(Pr,Hr,Zr){var Jr=lr.exec(Hr.slice(Zr));return Jr?(Pr.m=ta[Jr[0].toLowerCase()],Zr+Jr[0].length):-1}function na(Pr,Hr,Zr){return Vt(Pr,Ge,Hr,Zr)}function Ur(Pr,Hr,Zr){return Vt(Pr,Oe,Hr,Zr)}function ga(Pr,Hr,Zr){return Vt(Pr,ve,Hr,Zr)}function Aa(Pr){return Pe[Pr.getDay()]}function Pa(Pr){return be[Pr.getDay()]}function sa(Pr){return ct[Pr.getMonth()]}function Oa(Pr){return We[Pr.getMonth()]}function dt(Pr){return ge[+(Pr.getHours()>=12)]}function vt(Pr){return 1+~~(Pr.getMonth()/3)}function Lr(Pr){return Pe[Pr.getUTCDay()]}function Er(Pr){return be[Pr.getUTCDay()]}function _r(Pr){return ct[Pr.getUTCMonth()]}function yr(Pr){return We[Pr.getUTCMonth()]}function kr(Pr){return ge[+(Pr.getUTCHours()>=12)]}function zr(Pr){return 1+~~(Pr.getUTCMonth()/3)}return{format:function(Pr){var Hr=La(Pr+="",ma);return Hr.toString=function(){return Pr},Hr},parse:function(Pr){var Hr=Ka(Pr+="",!1);return Hr.toString=function(){return Pr},Hr},utcFormat:function(Pr){var Hr=La(Pr+="",Ia);return Hr.toString=function(){return Pr},Hr},utcParse:function(Pr){var Hr=Ka(Pr+="",!0);return Hr.toString=function(){return Pr},Hr}}}var r={"-":"",_:" ",0:"0"},o=/^\s*\d+/,a=/^%/,i=/[\\^$*+?|[\]().{}]/g;function n(ze,Ge,Oe){var ve=ze<0?"-":"",ge=(ve?-ze:ze)+"",be=ge.length;return ve+(be68?1900:2e3),Oe+ve[0].length):-1}function M(ze,Ge,Oe){var ve=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(Ge.slice(Oe,Oe+6));return ve?(ze.Z=ve[1]?0:-(ve[2]+(ve[3]||"00")),Oe+ve[0].length):-1}function _(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+1));return ve?(ze.q=ve[0]*3-3,Oe+ve[0].length):-1}function w(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+2));return ve?(ze.m=ve[0]-1,Oe+ve[0].length):-1}function p(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+2));return ve?(ze.d=+ve[0],Oe+ve[0].length):-1}function u(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+3));return ve?(ze.m=0,ze.d=+ve[0],Oe+ve[0].length):-1}function g(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+2));return ve?(ze.H=+ve[0],Oe+ve[0].length):-1}function m(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+2));return ve?(ze.M=+ve[0],Oe+ve[0].length):-1}function R(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+2));return ve?(ze.S=+ve[0],Oe+ve[0].length):-1}function P(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+3));return ve?(ze.L=+ve[0],Oe+ve[0].length):-1}function z(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+6));return ve?(ze.L=Math.floor(ve[0]/1e3),Oe+ve[0].length):-1}function F(ze,Ge,Oe){var ve=a.exec(Ge.slice(Oe,Oe+1));return ve?Oe+ve[0].length:-1}function B(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe));return ve?(ze.Q=+ve[0],Oe+ve[0].length):-1}function O(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe));return ve?(ze.s=+ve[0],Oe+ve[0].length):-1}function L(ze,Ge){return n(ze.getDate(),Ge,2)}function N(ze,Ge){return n(ze.getHours(),Ge,2)}function U(ze,Ge){return n(ze.getHours()%12||12,Ge,2)}function Z(ze,Ge){return n(1+x.timeDay.count(x.timeYear(ze),ze),Ge,3)}function Q(ze,Ge){return n(ze.getMilliseconds(),Ge,3)}function ue(ze,Ge){return Q(ze,Ge)+"000"}function oe(ze,Ge){return n(ze.getMonth()+1,Ge,2)}function le(ze,Ge){return n(ze.getMinutes(),Ge,2)}function j(ze,Ge){return n(ze.getSeconds(),Ge,2)}function J(ze){var Ge=ze.getDay();return Ge===0?7:Ge}function $(ze,Ge){return n(x.timeSunday.count(x.timeYear(ze)-1,ze),Ge,2)}function X(ze,Ge){var Oe=ze.getDay();return ze=Oe>=4||Oe===0?x.timeThursday(ze):x.timeThursday.ceil(ze),n(x.timeThursday.count(x.timeYear(ze),ze)+(x.timeYear(ze).getDay()===4),Ge,2)}function re(ze){return ze.getDay()}function ee(ze,Ge){return n(x.timeMonday.count(x.timeYear(ze)-1,ze),Ge,2)}function q(ze,Ge){return n(ze.getFullYear()%100,Ge,2)}function ae(ze,Ge){return n(ze.getFullYear()%1e4,Ge,4)}function ie(ze){var Ge=ze.getTimezoneOffset();return(Ge>0?"-":(Ge*=-1,"+"))+n(Ge/60|0,"0",2)+n(Ge%60,"0",2)}function fe(ze,Ge){return n(ze.getUTCDate(),Ge,2)}function we(ze,Ge){return n(ze.getUTCHours(),Ge,2)}function Ae(ze,Ge){return n(ze.getUTCHours()%12||12,Ge,2)}function Fe(ze,Ge){return n(1+x.utcDay.count(x.utcYear(ze),ze),Ge,3)}function Ce(ze,Ge){return n(ze.getUTCMilliseconds(),Ge,3)}function qe(ze,Ge){return Ce(ze,Ge)+"000"}function et(ze,Ge){return n(ze.getUTCMonth()+1,Ge,2)}function Qe(ze,Ge){return n(ze.getUTCMinutes(),Ge,2)}function Ke(ze,Ge){return n(ze.getUTCSeconds(),Ge,2)}function Xe(ze){var Ge=ze.getUTCDay();return Ge===0?7:Ge}function Me(ze,Ge){return n(x.utcSunday.count(x.utcYear(ze)-1,ze),Ge,2)}function xe(ze,Ge){var Oe=ze.getUTCDay();return ze=Oe>=4||Oe===0?x.utcThursday(ze):x.utcThursday.ceil(ze),n(x.utcThursday.count(x.utcYear(ze),ze)+(x.utcYear(ze).getUTCDay()===4),Ge,2)}function ce(ze){return ze.getUTCDay()}function Re(ze,Ge){return n(x.utcMonday.count(x.utcYear(ze)-1,ze),Ge,2)}function $e(ze,Ge){return n(ze.getUTCFullYear()%100,Ge,2)}function rt(ze,Ge){return n(ze.getUTCFullYear()%1e4,Ge,4)}function Je(){return"+0000"}function At(){return"%"}function St(ze){return+ze}function Rt(ze){return Math.floor(+ze/1e3)}var Ut;ir({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 ir(ze){return Ut=t(ze),d.timeFormat=Ut.format,d.timeParse=Ut.parse,d.utcFormat=Ut.utcFormat,d.utcParse=Ut.utcParse,Ut}var ar="%Y-%m-%dT%H:%M:%S.%LZ";function Mr(ze){return ze.toISOString()}var fr=Date.prototype.toISOString?Mr:d.utcFormat(ar);function dr(ze){var Ge=new Date(ze);return isNaN(Ge)?null:Ge}var pt=+new Date("2000-01-01T00:00:00.000Z")?dr:d.utcParse(ar);d.isoFormat=fr,d.isoParse=pt,d.timeFormatDefaultLocale=ir,d.timeFormatLocale=t,Object.defineProperty(d,"__esModule",{value:!0})})}}),co=He({"node_modules/d3-format/dist/d3-format.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y):(d=typeof globalThis<"u"?globalThis:d||self,x(d.d3=d.d3||{}))})(Y,function(d){function x(w){return Math.abs(w=Math.round(w))>=1e21?w.toLocaleString("en").replace(/,/g,""):w.toString(10)}function A(w,p){if((u=(w=p?w.toExponential(p-1):w.toExponential()).indexOf("e"))<0)return null;var u,g=w.slice(0,u);return[g.length>1?g[0]+g.slice(2):g,+w.slice(u+1)]}function E(w){return w=A(Math.abs(w)),w?w[1]:NaN}function e(w,p){return function(u,g){for(var m=u.length,R=[],P=0,z=w[0],F=0;m>0&&z>0&&(F+z+1>g&&(z=Math.max(1,g-F)),R.push(u.substring(m-=z,m+z)),!((F+=z+1)>g));)z=w[P=(P+1)%w.length];return R.reverse().join(p)}}function t(w){return function(p){return p.replace(/[0-9]/g,function(u){return w[+u]})}}var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(w){if(!(p=r.exec(w)))throw new Error("invalid format: "+w);var p;return new a({fill:p[1],align:p[2],sign:p[3],symbol:p[4],zero:p[5],width:p[6],comma:p[7],precision:p[8]&&p[8].slice(1),trim:p[9],type:p[10]})}o.prototype=a.prototype;function a(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+""}a.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function i(w){e:for(var p=w.length,u=1,g=-1,m;u0&&(g=0);break}return g>0?w.slice(0,g)+w.slice(m+1):w}var n;function s(w,p){var u=A(w,p);if(!u)return w+"";var g=u[0],m=u[1],R=m-(n=Math.max(-8,Math.min(8,Math.floor(m/3)))*3)+1,P=g.length;return R===P?g:R>P?g+new Array(R-P+1).join("0"):R>0?g.slice(0,R)+"."+g.slice(R):"0."+new Array(1-R).join("0")+A(w,Math.max(0,p+R-1))[0]}function c(w,p){var u=A(w,p);if(!u)return w+"";var g=u[0],m=u[1];return m<0?"0."+new Array(-m).join("0")+g:g.length>m+1?g.slice(0,m+1)+"."+g.slice(m+1):g+new Array(m-g.length+2).join("0")}var f={"%":function(w,p){return(w*100).toFixed(p)},b:function(w){return Math.round(w).toString(2)},c:function(w){return w+""},d:x,e:function(w,p){return w.toExponential(p)},f:function(w,p){return w.toFixed(p)},g:function(w,p){return w.toPrecision(p)},o:function(w){return Math.round(w).toString(8)},p:function(w,p){return c(w*100,p)},r:c,s,X:function(w){return Math.round(w).toString(16).toUpperCase()},x:function(w){return Math.round(w).toString(16)}};function v(w){return w}var h=Array.prototype.map,T=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function l(w){var p=w.grouping===void 0||w.thousands===void 0?v:e(h.call(w.grouping,Number),w.thousands+""),u=w.currency===void 0?"":w.currency[0]+"",g=w.currency===void 0?"":w.currency[1]+"",m=w.decimal===void 0?".":w.decimal+"",R=w.numerals===void 0?v:t(h.call(w.numerals,String)),P=w.percent===void 0?"%":w.percent+"",z=w.minus===void 0?"-":w.minus+"",F=w.nan===void 0?"NaN":w.nan+"";function B(L){L=o(L);var N=L.fill,U=L.align,Z=L.sign,Q=L.symbol,ue=L.zero,oe=L.width,le=L.comma,j=L.precision,J=L.trim,$=L.type;$==="n"?(le=!0,$="g"):f[$]||(j===void 0&&(j=12),J=!0,$="g"),(ue||N==="0"&&U==="=")&&(ue=!0,N="0",U="=");var X=Q==="$"?u:Q==="#"&&/[boxX]/.test($)?"0"+$.toLowerCase():"",re=Q==="$"?g:/[%p]/.test($)?P:"",ee=f[$],q=/[defgprs%]/.test($);j=j===void 0?6:/[gprs]/.test($)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function ae(ie){var fe=X,we=re,Ae,Fe,Ce;if($==="c")we=ee(ie)+we,ie="";else{ie=+ie;var qe=ie<0||1/ie<0;if(ie=isNaN(ie)?F:ee(Math.abs(ie),j),J&&(ie=i(ie)),qe&&+ie==0&&Z!=="+"&&(qe=!1),fe=(qe?Z==="("?Z:z:Z==="-"||Z==="("?"":Z)+fe,we=($==="s"?T[8+n/3]:"")+we+(qe&&Z==="("?")":""),q){for(Ae=-1,Fe=ie.length;++AeCe||Ce>57){we=(Ce===46?m+ie.slice(Ae+1):ie.slice(Ae))+we,ie=ie.slice(0,Ae);break}}}le&&!ue&&(ie=p(ie,1/0));var et=fe.length+ie.length+we.length,Qe=et>1)+fe+ie+we+Qe.slice(et);break;default:ie=Qe+fe+ie+we;break}return R(ie)}return ae.toString=function(){return L+""},ae}function O(L,N){var U=B((L=o(L),L.type="f",L)),Z=Math.max(-8,Math.min(8,Math.floor(E(N)/3)))*3,Q=Math.pow(10,-Z),ue=T[8+Z/3];return function(oe){return U(Q*oe)+ue}}return{format:B,formatPrefix:O}}var y;b({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function b(w){return y=l(w),d.format=y.format,d.formatPrefix=y.formatPrefix,y}function S(w){return Math.max(0,-E(Math.abs(w)))}function M(w,p){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(E(p)/3)))*3-E(Math.abs(w)))}function _(w,p){return w=Math.abs(w),p=Math.abs(p)-w,Math.max(0,E(p)-E(w))+1}d.FormatSpecifier=a,d.formatDefaultLocale=b,d.formatLocale=l,d.formatSpecifier=o,d.precisionFixed=S,d.precisionPrefix=M,d.precisionRound=_,Object.defineProperty(d,"__esModule",{value:!0})})}}),Ac=He({"node_modules/is-string-blank/index.js"(Y,G){G.exports=function(d){for(var x=d.length,A,E=0;E13)&&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}}}),Hi=He({"node_modules/fast-isnumeric/index.js"(Y,G){var d=Ac();G.exports=function(x){var A=typeof x;if(A==="string"){var E=x;if(x=+x,x===0&&d(E))return!1}else if(A!=="number")return!1;return x-x<1}}}),lo=He({"src/constants/numerical.js"(Y,G){G.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,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,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}}}),Uh=He({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y):(d=typeof globalThis<"u"?globalThis:d||self,x(d["base64-arraybuffer"]={}))})(Y,function(d){for(var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=typeof Uint8Array>"u"?[]:new Uint8Array(256),E=0;E>2],n+=x[(o[a]&3)<<4|o[a+1]>>4],n+=x[(o[a+1]&15)<<2|o[a+2]>>6],n+=x[o[a+2]&63];return i%3===2?n=n.substring(0,n.length-1)+"=":i%3===1&&(n=n.substring(0,n.length-2)+"=="),n},t=function(r){var o=r.length*.75,a=r.length,i,n=0,s,c,f,v;r[r.length-1]==="="&&(o--,r[r.length-2]==="="&&o--);var h=new ArrayBuffer(o),T=new Uint8Array(h);for(i=0;i>4,T[n++]=(c&15)<<4|f>>2,T[n++]=(f&3)<<6|v&63;return h};d.decode=t,d.encode=e,Object.defineProperty(d,"__esModule",{value:!0})})}}),Xh=He({"src/lib/is_plain_object.js"(Y,G){G.exports=function(x){return window&&window.process&&window.process.versions?Object.prototype.toString.call(x)==="[object Object]":Object.prototype.toString.call(x)==="[object Object]"&&Object.getPrototypeOf(x).hasOwnProperty("hasOwnProperty")}}}),ch=He({"src/lib/array.js"(Y){var G=Uh().decode,d=Xh(),x=Array.isArray,A=ArrayBuffer,E=DataView;function e(s){return A.isView(s)&&!(s instanceof E)}Y.isTypedArray=e;function t(s){return x(s)||e(s)}Y.isArrayOrTypedArray=t;function r(s){return!t(s[0])}Y.isArray1D=r,Y.ensureArray=function(s,c){return x(s)||(s=[]),s.length=c,s};var o={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};o.uint8c=o.u1c,o.uint8=o.u1,o.int8=o.i1,o.uint16=o.u2,o.int16=o.i2,o.uint32=o.u4,o.int32=o.i4,o.float32=o.f4,o.float64=o.f8;function a(s){return s.constructor===ArrayBuffer}Y.isArrayBuffer=a,Y.decodeTypedArraySpec=function(s){var c=[],f=i(s),v=f.dtype,h=o[v];if(!h)throw new Error('Error in dtype: "'+v+'"');var T=h.BYTES_PER_ELEMENT,l=f.bdata;a(l)||(l=G(l));var y=f.shape===void 0?[l.byteLength/T]:(""+f.shape).split(",");y.reverse();var b=y.length,S,M,_=+y[0],w=T*_,p=0;if(b===1)c=new h(l);else if(b===2)for(S=+y[1],M=0;M2)return h[S]=h[S]|e,y.set(b,null);if(l){for(c=S;c0)return Math.log(A)/Math.LN10;var e=Math.log(Math.min(E[0],E[1]))/Math.LN10;return d(e)||(e=Math.log(Math.max(E[0],E[1]))/Math.LN10-6),e}}}),rS=He({"src/lib/relink_private.js"(Y,G){var d=ch().isArrayOrTypedArray,x=Xh();G.exports=function A(E,e){for(var t in e){var r=e[t],o=E[t];if(o!==r)if(t.charAt(0)==="_"||typeof r=="function"){if(t in E)continue;E[t]=r}else if(d(r)&&d(o)&&x(r[0])){if(t==="customdata"||t==="ids")continue;for(var a=Math.min(r.length,o.length),i=0;iE/2?A-Math.round(A/E)*E:A}G.exports={mod:d,modHalf:x}}}),Mf=He({"node_modules/tinycolor2/tinycolor.js"(Y,G){(function(d){var x=/^\s+/,A=/\s+$/,E=0,e=d.round,t=d.min,r=d.max,o=d.random;function a(q,ae){if(q=q||"",ae=ae||{},q instanceof a)return q;if(!(this instanceof a))return new a(q,ae);var ie=i(q);this._originalInput=q,this._r=ie.r,this._g=ie.g,this._b=ie.b,this._a=ie.a,this._roundA=e(100*this._a)/100,this._format=ae.format||ie.format,this._gradientType=ae.gradientType,this._r<1&&(this._r=e(this._r)),this._g<1&&(this._g=e(this._g)),this._b<1&&(this._b=e(this._b)),this._ok=ie.ok,this._tc_id=E++}a.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 q=this.toRgb();return(q.r*299+q.g*587+q.b*114)/1e3},getLuminance:function(){var q=this.toRgb(),ae,ie,fe,we,Ae,Fe;return ae=q.r/255,ie=q.g/255,fe=q.b/255,ae<=.03928?we=ae/12.92:we=d.pow((ae+.055)/1.055,2.4),ie<=.03928?Ae=ie/12.92:Ae=d.pow((ie+.055)/1.055,2.4),fe<=.03928?Fe=fe/12.92:Fe=d.pow((fe+.055)/1.055,2.4),.2126*we+.7152*Ae+.0722*Fe},setAlpha:function(q){return this._a=L(q),this._roundA=e(100*this._a)/100,this},toHsv:function(){var q=f(this._r,this._g,this._b);return{h:q.h*360,s:q.s,v:q.v,a:this._a}},toHsvString:function(){var q=f(this._r,this._g,this._b),ae=e(q.h*360),ie=e(q.s*100),fe=e(q.v*100);return this._a==1?"hsv("+ae+", "+ie+"%, "+fe+"%)":"hsva("+ae+", "+ie+"%, "+fe+"%, "+this._roundA+")"},toHsl:function(){var q=s(this._r,this._g,this._b);return{h:q.h*360,s:q.s,l:q.l,a:this._a}},toHslString:function(){var q=s(this._r,this._g,this._b),ae=e(q.h*360),ie=e(q.s*100),fe=e(q.l*100);return this._a==1?"hsl("+ae+", "+ie+"%, "+fe+"%)":"hsla("+ae+", "+ie+"%, "+fe+"%, "+this._roundA+")"},toHex:function(q){return h(this._r,this._g,this._b,q)},toHexString:function(q){return"#"+this.toHex(q)},toHex8:function(q){return T(this._r,this._g,this._b,this._a,q)},toHex8String:function(q){return"#"+this.toHex8(q)},toRgb:function(){return{r:e(this._r),g:e(this._g),b:e(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+e(this._r)+", "+e(this._g)+", "+e(this._b)+")":"rgba("+e(this._r)+", "+e(this._g)+", "+e(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:e(N(this._r,255)*100)+"%",g:e(N(this._g,255)*100)+"%",b:e(N(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+e(N(this._r,255)*100)+"%, "+e(N(this._g,255)*100)+"%, "+e(N(this._b,255)*100)+"%)":"rgba("+e(N(this._r,255)*100)+"%, "+e(N(this._g,255)*100)+"%, "+e(N(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:B[h(this._r,this._g,this._b,!0)]||!1},toFilter:function(q){var ae="#"+l(this._r,this._g,this._b,this._a),ie=ae,fe=this._gradientType?"GradientType = 1, ":"";if(q){var we=a(q);ie="#"+l(we._r,we._g,we._b,we._a)}return"progid:DXImageTransform.Microsoft.gradient("+fe+"startColorstr="+ae+",endColorstr="+ie+")"},toString:function(q){var ae=!!q;q=q||this._format;var ie=!1,fe=this._a<1&&this._a>=0,we=!ae&&fe&&(q==="hex"||q==="hex6"||q==="hex3"||q==="hex4"||q==="hex8"||q==="name");return we?q==="name"&&this._a===0?this.toName():this.toRgbString():(q==="rgb"&&(ie=this.toRgbString()),q==="prgb"&&(ie=this.toPercentageRgbString()),(q==="hex"||q==="hex6")&&(ie=this.toHexString()),q==="hex3"&&(ie=this.toHexString(!0)),q==="hex4"&&(ie=this.toHex8String(!0)),q==="hex8"&&(ie=this.toHex8String()),q==="name"&&(ie=this.toName()),q==="hsl"&&(ie=this.toHslString()),q==="hsv"&&(ie=this.toHsvString()),ie||this.toHexString())},clone:function(){return a(this.toString())},_applyModification:function(q,ae){var ie=q.apply(null,[this].concat([].slice.call(ae)));return this._r=ie._r,this._g=ie._g,this._b=ie._b,this.setAlpha(ie._a),this},lighten:function(){return this._applyModification(M,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(y,arguments)},saturate:function(){return this._applyModification(b,arguments)},greyscale:function(){return this._applyModification(S,arguments)},spin:function(){return this._applyModification(p,arguments)},_applyCombination:function(q,ae){return q.apply(null,[this].concat([].slice.call(ae)))},analogous:function(){return this._applyCombination(P,arguments)},complement:function(){return this._applyCombination(u,arguments)},monochromatic:function(){return this._applyCombination(z,arguments)},splitcomplement:function(){return this._applyCombination(R,arguments)},triad:function(){return this._applyCombination(g,arguments)},tetrad:function(){return this._applyCombination(m,arguments)}},a.fromRatio=function(q,ae){if(typeof q=="object"){var ie={};for(var fe in q)q.hasOwnProperty(fe)&&(fe==="a"?ie[fe]=q[fe]:ie[fe]=le(q[fe]));q=ie}return a(q,ae)};function i(q){var ae={r:0,g:0,b:0},ie=1,fe=null,we=null,Ae=null,Fe=!1,Ce=!1;return typeof q=="string"&&(q=re(q)),typeof q=="object"&&(X(q.r)&&X(q.g)&&X(q.b)?(ae=n(q.r,q.g,q.b),Fe=!0,Ce=String(q.r).substr(-1)==="%"?"prgb":"rgb"):X(q.h)&&X(q.s)&&X(q.v)?(fe=le(q.s),we=le(q.v),ae=v(q.h,fe,we),Fe=!0,Ce="hsv"):X(q.h)&&X(q.s)&&X(q.l)&&(fe=le(q.s),Ae=le(q.l),ae=c(q.h,fe,Ae),Fe=!0,Ce="hsl"),q.hasOwnProperty("a")&&(ie=q.a)),ie=L(ie),{ok:Fe,format:q.format||Ce,r:t(255,r(ae.r,0)),g:t(255,r(ae.g,0)),b:t(255,r(ae.b,0)),a:ie}}function n(q,ae,ie){return{r:N(q,255)*255,g:N(ae,255)*255,b:N(ie,255)*255}}function s(q,ae,ie){q=N(q,255),ae=N(ae,255),ie=N(ie,255);var fe=r(q,ae,ie),we=t(q,ae,ie),Ae,Fe,Ce=(fe+we)/2;if(fe==we)Ae=Fe=0;else{var qe=fe-we;switch(Fe=Ce>.5?qe/(2-fe-we):qe/(fe+we),fe){case q:Ae=(ae-ie)/qe+(ae1&&(Ke-=1),Ke<1/6?et+(Qe-et)*6*Ke:Ke<1/2?Qe:Ke<2/3?et+(Qe-et)*(2/3-Ke)*6:et}if(ae===0)fe=we=Ae=ie;else{var Ce=ie<.5?ie*(1+ae):ie+ae-ie*ae,qe=2*ie-Ce;fe=Fe(qe,Ce,q+1/3),we=Fe(qe,Ce,q),Ae=Fe(qe,Ce,q-1/3)}return{r:fe*255,g:we*255,b:Ae*255}}function f(q,ae,ie){q=N(q,255),ae=N(ae,255),ie=N(ie,255);var fe=r(q,ae,ie),we=t(q,ae,ie),Ae,Fe,Ce=fe,qe=fe-we;if(Fe=fe===0?0:qe/fe,fe==we)Ae=0;else{switch(fe){case q:Ae=(ae-ie)/qe+(ae>1)+720)%360;--ae;)fe.h=(fe.h+we)%360,Ae.push(a(fe));return Ae}function z(q,ae){ae=ae||6;for(var ie=a(q).toHsv(),fe=ie.h,we=ie.s,Ae=ie.v,Fe=[],Ce=1/ae;ae--;)Fe.push(a({h:fe,s:we,v:Ae})),Ae=(Ae+Ce)%1;return Fe}a.mix=function(q,ae,ie){ie=ie===0?0:ie||50;var fe=a(q).toRgb(),we=a(ae).toRgb(),Ae=ie/100,Fe={r:(we.r-fe.r)*Ae+fe.r,g:(we.g-fe.g)*Ae+fe.g,b:(we.b-fe.b)*Ae+fe.b,a:(we.a-fe.a)*Ae+fe.a};return a(Fe)},a.readability=function(q,ae){var ie=a(q),fe=a(ae);return(d.max(ie.getLuminance(),fe.getLuminance())+.05)/(d.min(ie.getLuminance(),fe.getLuminance())+.05)},a.isReadable=function(q,ae,ie){var fe=a.readability(q,ae),we,Ae;switch(Ae=!1,we=ee(ie),we.level+we.size){case"AAsmall":case"AAAlarge":Ae=fe>=4.5;break;case"AAlarge":Ae=fe>=3;break;case"AAAsmall":Ae=fe>=7;break}return Ae},a.mostReadable=function(q,ae,ie){var fe=null,we=0,Ae,Fe,Ce,qe;ie=ie||{},Fe=ie.includeFallbackColors,Ce=ie.level,qe=ie.size;for(var et=0;etwe&&(we=Ae,fe=a(ae[et]));return a.isReadable(q,fe,{level:Ce,size:qe})||!Fe?fe:(ie.includeFallbackColors=!1,a.mostReadable(q,["#fff","#000"],ie))};var F=a.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"},B=a.hexNames=O(F);function O(q){var ae={};for(var ie in q)q.hasOwnProperty(ie)&&(ae[q[ie]]=ie);return ae}function L(q){return q=parseFloat(q),(isNaN(q)||q<0||q>1)&&(q=1),q}function N(q,ae){Q(q)&&(q="100%");var ie=ue(q);return q=t(ae,r(0,parseFloat(q))),ie&&(q=parseInt(q*ae,10)/100),d.abs(q-ae)<1e-6?1:q%ae/parseFloat(ae)}function U(q){return t(1,r(0,q))}function Z(q){return parseInt(q,16)}function Q(q){return typeof q=="string"&&q.indexOf(".")!=-1&&parseFloat(q)===1}function ue(q){return typeof q=="string"&&q.indexOf("%")!=-1}function oe(q){return q.length==1?"0"+q:""+q}function le(q){return q<=1&&(q=q*100+"%"),q}function j(q){return d.round(parseFloat(q)*255).toString(16)}function J(q){return Z(q)/255}var $=function(){var q="[-\\+]?\\d+%?",ae="[-\\+]?\\d*\\.\\d+%?",ie="(?:"+ae+")|(?:"+q+")",fe="[\\s|\\(]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")\\s*\\)?",we="[\\s|\\(]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")\\s*\\)?";return{CSS_UNIT:new RegExp(ie),rgb:new RegExp("rgb"+fe),rgba:new RegExp("rgba"+we),hsl:new RegExp("hsl"+fe),hsla:new RegExp("hsla"+we),hsv:new RegExp("hsv"+fe),hsva:new RegExp("hsva"+we),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 X(q){return!!$.CSS_UNIT.exec(q)}function re(q){q=q.replace(x,"").replace(A,"").toLowerCase();var ae=!1;if(F[q])q=F[q],ae=!0;else if(q=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ie;return(ie=$.rgb.exec(q))?{r:ie[1],g:ie[2],b:ie[3]}:(ie=$.rgba.exec(q))?{r:ie[1],g:ie[2],b:ie[3],a:ie[4]}:(ie=$.hsl.exec(q))?{h:ie[1],s:ie[2],l:ie[3]}:(ie=$.hsla.exec(q))?{h:ie[1],s:ie[2],l:ie[3],a:ie[4]}:(ie=$.hsv.exec(q))?{h:ie[1],s:ie[2],v:ie[3]}:(ie=$.hsva.exec(q))?{h:ie[1],s:ie[2],v:ie[3],a:ie[4]}:(ie=$.hex8.exec(q))?{r:Z(ie[1]),g:Z(ie[2]),b:Z(ie[3]),a:J(ie[4]),format:ae?"name":"hex8"}:(ie=$.hex6.exec(q))?{r:Z(ie[1]),g:Z(ie[2]),b:Z(ie[3]),format:ae?"name":"hex"}:(ie=$.hex4.exec(q))?{r:Z(ie[1]+""+ie[1]),g:Z(ie[2]+""+ie[2]),b:Z(ie[3]+""+ie[3]),a:J(ie[4]+""+ie[4]),format:ae?"name":"hex8"}:(ie=$.hex3.exec(q))?{r:Z(ie[1]+""+ie[1]),g:Z(ie[2]+""+ie[2]),b:Z(ie[3]+""+ie[3]),format:ae?"name":"hex"}:!1}function ee(q){var ae,ie;return q=q||{level:"AA",size:"small"},ae=(q.level||"AA").toUpperCase(),ie=(q.size||"small").toLowerCase(),ae!=="AA"&&ae!=="AAA"&&(ae="AA"),ie!=="small"&&ie!=="large"&&(ie="small"),{level:ae,size:ie}}typeof G<"u"&&G.exports?G.exports=a:window.tinycolor=a})(Math)}}),ho=He({"src/lib/extend.js"(Y){var G=Xh(),d=Array.isArray;function x(E,e){var t,r;for(t=0;t=0)))return a;if(f===3)s[f]>1&&(s[f]=1);else if(s[f]>=1)return a}var v=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return c?"rgba("+v+", "+s[3]+")":"rgb("+v+")"}}}),Bd=He({"src/constants/interactions.js"(Y,G){G.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}}),R0=He({"src/lib/regex.js"(Y){Y.counter=function(G,d,x,A){var E=(d||"")+(x?"":"$"),e=A===!1?"":"^";return G==="xy"?new RegExp(e+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+E):new RegExp(e+G+"([2-9]|[1-9][0-9]+)?"+E)}}}),aS=He({"src/lib/coerce.js"(Y){var G=Hi(),d=Mf(),x=ho().extendFlat,A=cl(),E=Ap(),e=Ai(),t=Bd().DESELECTDIM,r=Hg(),o=R0().counter,a=P0().modHalf,i=ch().isArrayOrTypedArray,n=ch().isTypedArraySpec,s=ch().decodeTypedArraySpec;Y.valObjectMeta={data_array:{coerceFunction:function(f,v,h){v.set(i(f)?f:n(f)?s(f):h)}},enumerated:{coerceFunction:function(f,v,h,T){T.coerceNumber&&(f=+f),T.values.indexOf(f)===-1?v.set(h):v.set(f)},validateFunction:function(f,v){v.coerceNumber&&(f=+f);for(var h=v.values,T=0;TT.max?v.set(h):v.set(+f)}},integer:{coerceFunction:function(f,v,h,T){if((T.extras||[]).indexOf(f)!==-1){v.set(f);return}n(f)&&(f=s(f)),f%1||!G(f)||T.min!==void 0&&fT.max?v.set(h):v.set(+f)}},string:{coerceFunction:function(f,v,h,T){if(typeof f!="string"){var l=typeof f=="number";T.strict===!0||!l?v.set(h):v.set(String(f))}else T.noBlank&&!f?v.set(h):v.set(f)}},color:{coerceFunction:function(f,v,h){n(f)&&(f=s(f)),d(f).isValid()?v.set(f):v.set(h)}},colorlist:{coerceFunction:function(f,v,h){function T(l){return d(l).isValid()}!Array.isArray(f)||!f.length?v.set(h):f.every(T)?v.set(f):v.set(h)}},colorscale:{coerceFunction:function(f,v,h){v.set(E.get(f,h))}},angle:{coerceFunction:function(f,v,h){n(f)&&(f=s(f)),f==="auto"?v.set("auto"):G(f)?v.set(a(+f,360)):v.set(h)}},subplotid:{coerceFunction:function(f,v,h,T){var l=T.regex||o(h);if(typeof f=="string"&&l.test(f)){v.set(f);return}v.set(h)},validateFunction:function(f,v){var h=v.dflt;return f===h?!0:typeof f!="string"?!1:!!o(h).test(f)}},flaglist:{coerceFunction:function(f,v,h,T){if((T.extras||[]).indexOf(f)!==-1){v.set(f);return}if(typeof f!="string"){v.set(h);return}for(var l=f.split("+"),y=0;y/g),f=0;f1){var e=["LOG:"];for(E=0;E1){var t=[];for(E=0;E"),"long")}},A.warn=function(){var E;if(d.logging>0){var e=["WARN:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}},A.error=function(){var E;if(d.logging>0){var e=["ERROR:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}}}}),Ym=He({"src/lib/noop.js"(Y,G){G.exports=function(){}}}),fb=He({"src/lib/push_unique.js"(Y,G){G.exports=function(x,A){if(A instanceof RegExp){for(var E=A.toString(),e=0;e0){for(var e=[],t=0;t=l&&F<=y?F:e}if(typeof F!="string"&&typeof F!="number")return e;F=String(F);var U=h(B),Z=F.charAt(0);U&&(Z==="G"||Z==="g")&&(F=F.substr(1),B="");var Q=U&&B.substr(0,7)==="chinese",ue=F.match(Q?f:c);if(!ue)return e;var oe=ue[1],le=ue[3]||"1",j=Number(ue[5]||1),J=Number(ue[7]||0),$=Number(ue[9]||0),X=Number(ue[11]||0);if(U){if(oe.length===2)return e;oe=Number(oe);var re;try{var ee=n.getComponentMethod("calendars","getCal")(B);if(Q){var q=le.charAt(le.length-1)==="i";le=parseInt(le,10),re=ee.newDate(oe,ee.toMonthIndex(oe,le,q),j)}else re=ee.newDate(oe,Number(le),j)}catch{return e}return re?(re.toJD()-i)*t+J*r+$*o+X*a:e}oe.length===2?oe=(Number(oe)+2e3-v)%100+v:oe=Number(oe),le-=1;var ae=new Date(Date.UTC(2e3,le,j,J,$));return ae.setUTCFullYear(oe),ae.getUTCMonth()!==le||ae.getUTCDate()!==j?e:ae.getTime()+X*a},l=Y.MIN_MS=Y.dateTime2ms("-9999"),y=Y.MAX_MS=Y.dateTime2ms("9999-12-31 23:59:59.9999"),Y.isDateTime=function(F,B){return Y.dateTime2ms(F,B)!==e};function b(F,B){return String(F+Math.pow(10,B)).substr(1)}var S=90*t,M=3*r,_=5*o;Y.ms2DateTime=function(F,B,O){if(typeof F!="number"||!(F>=l&&F<=y))return e;B||(B=0);var L=Math.floor(A(F+.05,1)*10),N=Math.round(F-L/10),U,Z,Q,ue,oe,le;if(h(O)){var j=Math.floor(N/t)+i,J=Math.floor(A(F,t));try{U=n.getComponentMethod("calendars","getCal")(O).fromJD(j).formatDate("yyyy-mm-dd")}catch{U=s("G%Y-%m-%d")(new Date(N))}if(U.charAt(0)==="-")for(;U.length<11;)U="-0"+U.substr(1);else for(;U.length<10;)U="0"+U;Z=B=l+t&&F<=y-t))return e;var B=Math.floor(A(F+.05,1)*10),O=new Date(Math.round(F-B/10)),L=G("%Y-%m-%d")(O),N=O.getHours(),U=O.getMinutes(),Z=O.getSeconds(),Q=O.getUTCMilliseconds()*10+B;return w(L,N,U,Z,Q)};function w(F,B,O,L,N){if((B||O||L||N)&&(F+=" "+b(B,2)+":"+b(O,2),(L||N)&&(F+=":"+b(L,2),N))){for(var U=4;N%10===0;)U-=1,N/=10;F+="."+b(N,U)}return F}Y.cleanDate=function(F,B,O){if(F===e)return B;if(Y.isJSDate(F)||typeof F=="number"&&isFinite(F)){if(h(O))return x.error("JS Dates and milliseconds are incompatible with world calendars",F),B;if(F=Y.ms2DateTimeLocal(+F),!F&&B!==void 0)return B}else if(!Y.isDateTime(F,O))return x.error("unrecognized date",F),B;return F};var p=/%\d?f/g,u=/%h/g,g={1:"1",2:"1",3:"2",4:"2"};function m(F,B,O,L){F=F.replace(p,function(U){var Z=Math.min(+U.charAt(1)||6,6),Q=(B/1e3%1+2).toFixed(Z).substr(2).replace(/0+$/,"")||"0";return Q});var N=new Date(Math.floor(B+.05));if(F=F.replace(u,function(){return g[O("%q")(N)]}),h(L))try{F=n.getComponentMethod("calendars","worldCalFmt")(F,B,L)}catch{return"Invalid"}return O(F)(N)}var R=[59,59.9,59.99,59.999,59.9999];function P(F,B){var O=A(F+.05,t),L=b(Math.floor(O/r),2)+":"+b(A(Math.floor(O/o),60),2);if(B!=="M"){d(B)||(B=0);var N=Math.min(A(F/a,60),R[B]),U=(100+N).toFixed(B).substr(1);B>0&&(U=U.replace(/0+$/,"").replace(/[\.]$/,"")),L+=":"+U}return L}Y.formatDate=function(F,B,O,L,N,U){if(N=h(N)&&N,!B)if(O==="y")B=U.year;else if(O==="m")B=U.month;else if(O==="d")B=U.dayMonth+` +`+U.year;else return P(F,O)+` +`+m(U.dayMonthYear,F,L,N);return m(B,F,L,N)};var z=3*t;Y.incrementMonth=function(F,B,O){O=h(O)&&O;var L=A(F,t);if(F=Math.round(F-L),O)try{var N=Math.round(F/t)+i,U=n.getComponentMethod("calendars","getCal")(O),Z=U.fromJD(N);return B%12?U.add(Z,B,"m"):U.add(Z,B/12,"y"),(Z.toJD()-i)*t+L}catch{x.error("invalid ms "+F+" in calendar "+O)}var Q=new Date(F+z);return Q.setUTCMonth(Q.getUTCMonth()+B)+L-z},Y.findExactDates=function(F,B){for(var O=0,L=0,N=0,U=0,Z,Q,ue=h(B)&&n.getComponentMethod("calendars","getCal")(B),oe=0;oe1?(i[c-1]-i[0])/(c-1):1,h,T;for(v>=0?T=n?e:t:T=n?o:r,a+=v*E*(n?-1:1)*(v>=0?1:-1);s90&&d.log("Long binary search..."),s-1};function e(a,i){return ai}function o(a,i){return a>=i}Y.sorterAsc=function(a,i){return a-i},Y.sorterDes=function(a,i){return i-a},Y.distinctVals=function(a){var i=a.slice();i.sort(Y.sorterAsc);var n;for(n=i.length-1;n>-1&&i[n]===A;n--);for(var s=i[n]-i[0]||1,c=s/(n||1)/1e4,f=[],v,h=0;h<=n;h++){var T=i[h],l=T-v;v===void 0?(f.push(T),v=T):l>c&&(s=Math.min(s,l),f.push(T),v=T)}return{vals:f,minDiff:s}},Y.roundUp=function(a,i,n){for(var s=0,c=i.length-1,f,v=0,h=n?0:1,T=n?1:0,l=n?Math.ceil:Math.floor;s0&&(s=1),n&&s)return a.sort(i)}return s?a:a.reverse()},Y.findIndexOfMin=function(a,i){i=i||x;for(var n=1/0,s,c=0;cE.length)&&(e=E.length),G(A)||(A=!1),d(E[0])){for(r=new Array(e),t=0;tx.length-1)return x[x.length-1];var E=A%1;return E*x[Math.ceil(A)]+(1-E)*x[Math.floor(A)]}}}),OS=He({"src/lib/angles.js"(Y,G){var d=P0(),x=d.mod,A=d.modHalf,E=Math.PI,e=2*E;function t(T){return T/180*E}function r(T){return T/E*180}function o(T){return Math.abs(T[1]-T[0])>e-1e-14}function a(T,l){return A(l-T,e)}function i(T,l){return Math.abs(a(T,l))}function n(T,l){if(o(l))return!0;var y,b;l[0]b&&(b+=e);var S=x(T,e),M=S+e;return S>=y&&S<=b||M>=y&&M<=b}function s(T,l,y,b){if(!n(l,b))return!1;var S,M;return y[0]=S&&T<=M}function c(T,l,y,b,S,M,_){S=S||0,M=M||0;var w=o([y,b]),p,u,g,m,R;w?(p=0,u=E,g=e):y1/3&&d.x<2/3},Y.isRightAnchor=function(d){return d.xanchor==="right"||d.xanchor==="auto"&&d.x>=2/3},Y.isTopAnchor=function(d){return d.yanchor==="top"||d.yanchor==="auto"&&d.y>=2/3},Y.isMiddleAnchor=function(d){return d.yanchor==="middle"||d.yanchor==="auto"&&d.y>1/3&&d.y<2/3},Y.isBottomAnchor=function(d){return d.yanchor==="bottom"||d.yanchor==="auto"&&d.y<=1/3}}}),NS=He({"src/lib/geometry2d.js"(Y){var G=P0().mod;Y.segmentsIntersect=d;function d(t,r,o,a,i,n,s,c){var f=o-t,v=i-t,h=s-i,T=a-r,l=n-r,y=c-n,b=f*y-h*T;if(b===0)return null;var S=(v*y-h*l)/b,M=(v*T-f*l)/b;return M<0||M>1||S<0||S>1?null:{x:t+f*S,y:r+T*S}}Y.segmentDistance=function(r,o,a,i,n,s,c,f){if(d(r,o,a,i,n,s,c,f))return 0;var v=a-r,h=i-o,T=c-n,l=f-s,y=v*v+h*h,b=T*T+l*l,S=Math.min(x(v,h,y,n-r,s-o),x(v,h,y,c-r,f-o),x(T,l,b,r-n,o-s),x(T,l,b,a-n,i-s));return Math.sqrt(S)};function x(t,r,o,a,i){var n=a*t+i*r;if(n<0)return a*a+i*i;if(n>o){var s=a-t,c=i-r;return s*s+c*c}else{var f=a*r-i*t;return f*f/o}}var A,E,e;Y.getTextLocation=function(r,o,a,i){if((r!==E||i!==e)&&(A={},E=r,e=i),A[a])return A[a];var n=r.getPointAtLength(G(a-i/2,o)),s=r.getPointAtLength(G(a+i/2,o)),c=Math.atan((s.y-n.y)/(s.x-n.x)),f=r.getPointAtLength(G(a,o)),v=(f.x*4+n.x+s.x)/6,h=(f.y*4+n.y+s.y)/6,T={x:v,y:h,theta:c};return A[a]=T,T},Y.clearLocationCache=function(){E=null},Y.getVisibleSegment=function(r,o,a){var i=o.left,n=o.right,s=o.top,c=o.bottom,f=0,v=r.getTotalLength(),h=v,T,l;function y(S){var M=r.getPointAtLength(S);S===0?T=M:S===v&&(l=M);var _=M.xn?M.x-n:0,w=M.yc?M.y-c:0;return Math.sqrt(_*_+w*w)}for(var b=y(f);b;){if(f+=b+a,f>h)return;b=y(f)}for(b=y(h);b;){if(h-=b+a,f>h)return;b=y(h)}return{min:f,max:h,len:h-f,total:v,isClosed:f===0&&h===v&&Math.abs(T.x-l.x)<.1&&Math.abs(T.y-l.y)<.1}},Y.findPointOnPath=function(r,o,a,i){i=i||{};for(var n=i.pathLength||r.getTotalLength(),s=i.tolerance||.001,c=i.iterationLimit||30,f=r.getPointAtLength(0)[a]>r.getPointAtLength(n)[a]?-1:1,v=0,h=0,T=n,l,y,b;v0?T=l:h=l,v++}return y}}}),e1=He({"src/lib/throttle.js"(Y){var G={};Y.throttle=function(A,E,e){var t=G[A],r=Date.now();if(!t){for(var o in G)G[o].tst.ts+E){a();return}t.timer=setTimeout(function(){a(),t.timer=null},E)},Y.done=function(x){var A=G[x];return!A||!A.timer?Promise.resolve():new Promise(function(E){var e=A.onDone;A.onDone=function(){e&&e(),E(),A.onDone=null}})},Y.clear=function(x){if(x)d(G[x]),delete G[x];else for(var A in G)Y.clear(A)};function d(x){x&&x.timer!==null&&(clearTimeout(x.timer),x.timer=null)}}}),US=He({"src/lib/clear_responsive.js"(Y,G){G.exports=function(x){x._responsiveChartHandler&&(window.removeEventListener("resize",x._responsiveChartHandler),delete x._responsiveChartHandler)}}}),jS=He({"node_modules/is-mobile/index.js"(Y,G){G.exports=E,G.exports.isMobile=E,G.exports.default=E;var d=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,x=/CrOS/,A=/android|ipad|playbook|silk/i;function E(e){e||(e={});let t=e.ua;if(!t&&typeof navigator<"u"&&(t=navigator.userAgent),t&&t.headers&&typeof t.headers["user-agent"]=="string"&&(t=t.headers["user-agent"]),typeof t!="string")return!1;let r=d.test(t)&&!x.test(t)||!!e.tablet&&A.test(t);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(r=!0),r}}}),VS=He({"src/lib/preserve_drawing_buffer.js"(Y,G){var d=Hi(),x=jS();G.exports=function(e){var t;if(e&&e.hasOwnProperty("userAgent")?t=e.userAgent:t=A(),typeof t!="string")return!0;var r=x({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var o=t.split(" "),a=1;a-1;n--){var s=o[n];if(s.substr(0,8)==="Version/"){var c=s.substr(8).split(".")[0];if(d(c)&&(c=+c),c>=13)return!0}}}return r};function A(){var E;return typeof navigator<"u"&&(E=navigator.userAgent),E&&E.headers&&typeof E.headers["user-agent"]=="string"&&(E=E.headers["user-agent"]),E}}}),qS=He({"src/lib/make_trace_groups.js"(Y,G){var d=Qn();G.exports=function(A,E,e){var t=A.selectAll("g."+e.replace(/\s/g,".")).data(E,function(o){return o[0].trace.uid});t.exit().remove(),t.enter().append("g").attr("class",e),t.order();var r=A.classed("rangeplot")?"nodeRangePlot3":"node3";return t.each(function(o){o[0][r]=d.select(this)}),t}}}),HS=He({"src/lib/localize.js"(Y,G){var d=Ei();G.exports=function(A,E){for(var e=A._context.locale,t=0;t<2;t++){for(var r=A._context.locales,o=0;o<2;o++){var a=(r[e]||{}).dictionary;if(a){var i=a[E];if(i)return i}r=d.localeRegistry}var n=e.split("-")[0];if(n===e)break;e=n}return E}}}),gb=He({"src/lib/filter_unique.js"(Y,G){G.exports=function(x){for(var A={},E=[],e=0,t=0;t1?(E*x+E*A)/E:x+A,t=String(e).length;if(t>16){var r=String(A).length,o=String(x).length;if(t>=o+r){var a=parseFloat(e).toPrecision(12);a.indexOf("e+")===-1&&(e=+a)}}return e}}}),ZS=He({"src/lib/clean_number.js"(Y,G){var d=Hi(),x=lo().BADNUM,A=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;G.exports=function(e){return typeof e=="string"&&(e=e.replace(A,"")),d(e)?Number(e):x}}}),Gr=He({"src/lib/index.js"(Y,G){var d=Qn(),x=Xl().utcFormat,A=co().format,E=Hi(),e=lo(),t=e.FP_SAFE,r=-t,o=e.BADNUM,a=G.exports={};a.adjustFormat=function(ee){return!ee||/^\d[.]\df/.test(ee)||/[.]\d%/.test(ee)?ee:ee==="0.f"?"~f":/^\d%/.test(ee)?"~%":/^\ds/.test(ee)?"~s":!/^[~,.0$]/.test(ee)&&/[&fps]/.test(ee)?"~"+ee:ee};var i={};a.warnBadFormat=function(re){var ee=String(re);i[ee]||(i[ee]=1,a.warn('encountered bad format: "'+ee+'"'))},a.noFormat=function(re){return String(re)},a.numberFormat=function(re){var ee;try{ee=A(a.adjustFormat(re))}catch{return a.warnBadFormat(re),a.noFormat}return ee},a.nestedProperty=Hg(),a.keyedContainer=eS(),a.relativeAttr=tS(),a.isPlainObject=Xh(),a.toLogRange=Xm(),a.relinkPrivateKeys=rS();var n=ch();a.isArrayBuffer=n.isArrayBuffer,a.isTypedArray=n.isTypedArray,a.isArrayOrTypedArray=n.isArrayOrTypedArray,a.isArray1D=n.isArray1D,a.ensureArray=n.ensureArray,a.concat=n.concat,a.maxRowLength=n.maxRowLength,a.minRowLength=n.minRowLength;var s=P0();a.mod=s.mod,a.modHalf=s.modHalf;var c=aS();a.valObjectMeta=c.valObjectMeta,a.coerce=c.coerce,a.coerce2=c.coerce2,a.coerceFont=c.coerceFont,a.coercePattern=c.coercePattern,a.coerceHoverinfo=c.coerceHoverinfo,a.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,a.validate=c.validate;var f=zS();a.dateTime2ms=f.dateTime2ms,a.isDateTime=f.isDateTime,a.ms2DateTime=f.ms2DateTime,a.ms2DateTimeLocal=f.ms2DateTimeLocal,a.cleanDate=f.cleanDate,a.isJSDate=f.isJSDate,a.formatDate=f.formatDate,a.incrementMonth=f.incrementMonth,a.dateTick0=f.dateTick0,a.dfltRange=f.dfltRange,a.findExactDates=f.findExactDates,a.MIN_MS=f.MIN_MS,a.MAX_MS=f.MAX_MS;var v=Qm();a.findBin=v.findBin,a.sorterAsc=v.sorterAsc,a.sorterDes=v.sorterDes,a.distinctVals=v.distinctVals,a.roundUp=v.roundUp,a.sort=v.sort,a.findIndexOfMin=v.findIndexOfMin,a.sortObjectKeys=Ud();var h=FS();a.aggNums=h.aggNums,a.len=h.len,a.mean=h.mean,a.geometricMean=h.geometricMean,a.median=h.median,a.midRange=h.midRange,a.variance=h.variance,a.stdev=h.stdev,a.interp=h.interp;var T=Km();a.init2dArray=T.init2dArray,a.transposeRagged=T.transposeRagged,a.dot=T.dot,a.translationMatrix=T.translationMatrix,a.rotationMatrix=T.rotationMatrix,a.rotationXYMatrix=T.rotationXYMatrix,a.apply3DTransform=T.apply3DTransform,a.apply2DTransform=T.apply2DTransform,a.apply2DTransform2=T.apply2DTransform2,a.convertCssMatrix=T.convertCssMatrix,a.inverseTransformMatrix=T.inverseTransformMatrix;var l=OS();a.deg2rad=l.deg2rad,a.rad2deg=l.rad2deg,a.angleDelta=l.angleDelta,a.angleDist=l.angleDist,a.isFullCircle=l.isFullCircle,a.isAngleInsideSector=l.isAngleInsideSector,a.isPtInsideSector=l.isPtInsideSector,a.pathArc=l.pathArc,a.pathSector=l.pathSector,a.pathAnnulus=l.pathAnnulus;var y=BS();a.isLeftAnchor=y.isLeftAnchor,a.isCenterAnchor=y.isCenterAnchor,a.isRightAnchor=y.isRightAnchor,a.isTopAnchor=y.isTopAnchor,a.isMiddleAnchor=y.isMiddleAnchor,a.isBottomAnchor=y.isBottomAnchor;var b=NS();a.segmentsIntersect=b.segmentsIntersect,a.segmentDistance=b.segmentDistance,a.getTextLocation=b.getTextLocation,a.clearLocationCache=b.clearLocationCache,a.getVisibleSegment=b.getVisibleSegment,a.findPointOnPath=b.findPointOnPath;var S=ho();a.extendFlat=S.extendFlat,a.extendDeep=S.extendDeep,a.extendDeepAll=S.extendDeepAll,a.extendDeepNoArrays=S.extendDeepNoArrays;var M=Nd();a.log=M.log,a.warn=M.warn,a.error=M.error;var _=R0();a.counterRegex=_.counter;var w=e1();a.throttle=w.throttle,a.throttleDone=w.done,a.clearThrottle=w.clear;var p=Wg();a.getGraphDiv=p.getGraphDiv,a.isPlotDiv=p.isPlotDiv,a.removeElement=p.removeElement,a.addStyleRule=p.addStyleRule,a.addRelatedStyleRule=p.addRelatedStyleRule,a.deleteRelatedStyleRule=p.deleteRelatedStyleRule,a.setStyleOnHover=p.setStyleOnHover,a.getFullTransformMatrix=p.getFullTransformMatrix,a.getElementTransformMatrix=p.getElementTransformMatrix,a.getElementAndAncestors=p.getElementAndAncestors,a.equalDomRects=p.equalDomRects,a.clearResponsive=US(),a.preserveDrawingBuffer=VS(),a.makeTraceGroups=qS(),a._=HS(),a.notifier=cb(),a.filterUnique=gb(),a.filterVisible=GS(),a.pushUnique=fb(),a.increment=WS(),a.cleanNumber=ZS(),a.ensureNumber=function(ee){return E(ee)?(ee=Number(ee),ee>t||ee=ee?!1:E(re)&&re>=0&&re%1===0},a.noop=Ym(),a.identity=Xg(),a.repeat=function(re,ee){for(var q=new Array(ee),ae=0;aeq?Math.max(q,Math.min(ee,re)):Math.max(ee,Math.min(q,re))},a.bBoxIntersect=function(re,ee,q){return q=q||0,re.left<=ee.right+q&&ee.left<=re.right+q&&re.top<=ee.bottom+q&&ee.top<=re.bottom+q},a.simpleMap=function(re,ee,q,ae,ie){for(var fe=re.length,we=new Array(fe),Ae=0;Ae=Math.pow(2,q)?ie>10?(a.warn("randstr failed uniqueness"),we):re(ee,q,ae,(ie||0)+1):we},a.OptionControl=function(re,ee){re||(re={}),ee||(ee="opt");var q={};return q.optionList=[],q._newoption=function(ae){ae[ee]=re,q[ae.name]=ae,q.optionList.push(ae)},q["_"+ee]=re,q},a.smooth=function(re,ee){if(ee=Math.round(ee)||0,ee<2)return re;var q=re.length,ae=2*q,ie=2*ee-1,fe=new Array(ie),we=new Array(q),Ae,Fe,Ce,qe;for(Ae=0;Ae=ae&&(Ce-=ae*Math.floor(Ce/ae)),Ce<0?Ce=-1-Ce:Ce>=q&&(Ce=ae-1-Ce),qe+=re[Ce]*fe[Fe];we[Ae]=qe}return we},a.syncOrAsync=function(re,ee,q){var ae,ie;function fe(){return a.syncOrAsync(re,ee,q)}for(;re.length;)if(ie=re.splice(0,1)[0],ae=ie(ee),ae&&ae.then)return ae.then(fe);return q&&q(ee)},a.stripTrailingSlash=function(re){return re.substr(-1)==="/"?re.substr(0,re.length-1):re},a.noneOrAll=function(re,ee,q){if(re){var ae=!1,ie=!0,fe,we;for(fe=0;fe0?ie:0})},a.fillArray=function(re,ee,q,ae){if(ae=ae||a.identity,a.isArrayOrTypedArray(re))for(var ie=0;ie1?ie+we[1]:"";if(fe&&(we.length>1||Ae.length>4||q))for(;ae.test(Ae);)Ae=Ae.replace(ae,"$1"+fe+"$2");return Ae+Fe},a.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var O=/^\w*$/;a.templateString=function(re,ee){var q={};return re.replace(a.TEMPLATE_STRING_REGEX,function(ae,ie){var fe;return O.test(ie)?fe=ee[ie]:(q[ie]=q[ie]||a.nestedProperty(ee,ie).get,fe=q[ie](!0)),fe!==void 0?fe:""})};var L={max:10,count:0,name:"hovertemplate"};a.hovertemplateString=function(){return oe.apply(L,arguments)};var N={max:10,count:0,name:"texttemplate"};a.texttemplateString=function(){return oe.apply(N,arguments)};var U=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function Z(re){var ee=re.match(U);return ee?{key:ee[1],op:ee[2],number:Number(ee[3])}:{key:re,op:null,number:null}}var Q={max:10,count:0,name:"texttemplate",parseMultDiv:!0};a.texttemplateStringForShapes=function(){return oe.apply(Q,arguments)};var ue=/^[:|\|]/;function oe(re,ee,q){var ae=this,ie=arguments;return ee||(ee={}),re.replace(a.TEMPLATE_STRING_REGEX,function(fe,we,Ae){var Fe=we==="xother"||we==="yother",Ce=we==="_xother"||we==="_yother",qe=we==="_xother_"||we==="_yother_",et=we==="xother_"||we==="yother_",Qe=Fe||Ce||et||qe,Ke=we;(Ce||qe)&&(Ke=Ke.substring(1)),(et||qe)&&(Ke=Ke.substring(0,Ke.length-1));var Xe=null,Me=null;if(ae.parseMultDiv){var xe=Z(Ke);Ke=xe.key,Xe=xe.op,Me=xe.number}var ce;if(Qe){if(ce=ee[Ke],ce===void 0)return""}else{var Re,$e;for($e=3;$e=le&&we<=j,Ce=Ae>=le&&Ae<=j;if(Fe&&(ae=10*ae+we-le),Ce&&(ie=10*ie+Ae-le),!Fe||!Ce){if(ae!==ie)return ae-ie;if(we!==Ae)return we-Ae}}return ie-ae};var J=2e9;a.seedPseudoRandom=function(){J=2e9},a.pseudoRandom=function(){var re=J;return J=(69069*J+1)%4294967296,Math.abs(J-re)<429496729?a.pseudoRandom():J/4294967296},a.fillText=function(re,ee,q){var ae=Array.isArray(q)?function(we){q.push(we)}:function(we){q.text=we},ie=a.extractOption(re,ee,"htx","hovertext");if(a.isValidTextValue(ie))return ae(ie);var fe=a.extractOption(re,ee,"tx","text");if(a.isValidTextValue(fe))return ae(fe)},a.isValidTextValue=function(re){return re||re===0},a.formatPercent=function(re,ee){ee=ee||0;for(var q=(Math.round(100*re*Math.pow(10,ee))*Math.pow(.1,ee)).toFixed(ee)+"%",ae=0;ae1&&(Ce=1):Ce=0,a.strTranslate(ie-Ce*(q+we),fe-Ce*(ae+Ae))+a.strScale(Ce)+(Fe?"rotate("+Fe+(ee?"":" "+q+" "+ae)+")":"")},a.setTransormAndDisplay=function(re,ee){re.attr("transform",a.getTextTransform(ee)),re.style("display",ee.scale?null:"none")},a.ensureUniformFontSize=function(re,ee){var q=a.extendFlat({},ee);return q.size=Math.max(ee.size,re._fullLayout.uniformtext.minsize||0),q},a.join2=function(re,ee,q){var ae=re.length;return ae>1?re.slice(0,-1).join(ee)+q+re[ae-1]:re.join(ee)},a.bigFont=function(re){return Math.round(1.2*re)};var $=a.getFirefoxVersion(),X=$!==null&&$<86;a.getPositionFromD3Event=function(){return X?[d.event.layerX,d.event.layerY]:[d.event.offsetX,d.event.offsetY]}}}),XS=He({"build/plotcss.js"(){var Y=Gr(),G={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(x in G)d=x.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),Y.addStyleRule(d,G[x]);var d,x}}),yb=He({"node_modules/is-browser/client.js"(Y,G){G.exports=!0}}),mb=He({"node_modules/has-hover/index.js"(Y,G){var d=yb(),x;typeof window.matchMedia=="function"?x=!window.matchMedia("(hover: none)").matches:x=d,G.exports=x}}),Mp=He({"node_modules/events/events.js"(Y,G){var d=typeof Reflect=="object"?Reflect:null,x=d&&typeof d.apply=="function"?d.apply:function(M,_,w){return Function.prototype.apply.call(M,_,w)},A;d&&typeof d.ownKeys=="function"?A=d.ownKeys:Object.getOwnPropertySymbols?A=function(M){return Object.getOwnPropertyNames(M).concat(Object.getOwnPropertySymbols(M))}:A=function(M){return Object.getOwnPropertyNames(M)};function E(S){console&&console.warn&&console.warn(S)}var e=Number.isNaN||function(M){return M!==M};function t(){t.init.call(this)}G.exports=t,G.exports.once=l,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var r=10;function o(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(S){if(typeof S!="number"||S<0||e(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");r=S}}),t.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(M){if(typeof M!="number"||M<0||e(M))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+M+".");return this._maxListeners=M,this};function a(S){return S._maxListeners===void 0?t.defaultMaxListeners:S._maxListeners}t.prototype.getMaxListeners=function(){return a(this)},t.prototype.emit=function(M){for(var _=[],w=1;w0&&(g=_[0]),g instanceof Error)throw g;var m=new Error("Unhandled error."+(g?" ("+g.message+")":""));throw m.context=g,m}var R=u[M];if(R===void 0)return!1;if(typeof R=="function")x(R,this,_);else for(var P=R.length,z=v(R,P),w=0;w0&&g.length>p&&!g.warned){g.warned=!0;var m=new Error("Possible EventEmitter memory leak detected. "+g.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");m.name="MaxListenersExceededWarning",m.emitter=S,m.type=M,m.count=g.length,E(m)}return S}t.prototype.addListener=function(M,_){return i(this,M,_,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(M,_){return i(this,M,_,!0)};function n(){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 s(S,M,_){var w={fired:!1,wrapFn:void 0,target:S,type:M,listener:_},p=n.bind(w);return p.listener=_,w.wrapFn=p,p}t.prototype.once=function(M,_){return o(_),this.on(M,s(this,M,_)),this},t.prototype.prependOnceListener=function(M,_){return o(_),this.prependListener(M,s(this,M,_)),this},t.prototype.removeListener=function(M,_){var w,p,u,g,m;if(o(_),p=this._events,p===void 0)return this;if(w=p[M],w===void 0)return this;if(w===_||w.listener===_)--this._eventsCount===0?this._events=Object.create(null):(delete p[M],p.removeListener&&this.emit("removeListener",M,w.listener||_));else if(typeof w!="function"){for(u=-1,g=w.length-1;g>=0;g--)if(w[g]===_||w[g].listener===_){m=w[g].listener,u=g;break}if(u<0)return this;u===0?w.shift():h(w,u),w.length===1&&(p[M]=w[0]),p.removeListener!==void 0&&this.emit("removeListener",M,m||_)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(M){var _,w,p;if(w=this._events,w===void 0)return this;if(w.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):w[M]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete w[M]),this;if(arguments.length===0){var u=Object.keys(w),g;for(p=0;p=0;p--)this.removeListener(M,_[p]);return this};function c(S,M,_){var w=S._events;if(w===void 0)return[];var p=w[M];return p===void 0?[]:typeof p=="function"?_?[p.listener||p]:[p]:_?T(p):v(p,p.length)}t.prototype.listeners=function(M){return c(this,M,!0)},t.prototype.rawListeners=function(M){return c(this,M,!1)},t.listenerCount=function(S,M){return typeof S.listenerCount=="function"?S.listenerCount(M):f.call(S,M)},t.prototype.listenerCount=f;function f(S){var M=this._events;if(M!==void 0){var _=M[S];if(typeof _=="function")return 1;if(_!==void 0)return _.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]};function v(S,M){for(var _=new Array(M),w=0;wx.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--)},E.startSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},E.stopSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},E.undo=function(t){var r,o;if(!(t.undoQueue===void 0||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=t.undoQueue.queue.length)){for(r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=L.length)return!1;if(P.dimensions===2){if(F++,z.length===F)return P;var N=z[F];if(!b(N))return!1;P=L[O][N]}else P=L[O]}else P=L}}return P}function b(P){return P===Math.round(P)&&P>=0}function S(P){var z,F;z=G.modules[P]._module,F=z.basePlotModule;var B={};B.type=null;var O=o({},x),L=o({},z.attributes);Y.crawl(L,function(Z,Q,ue,oe,le){n(O,le).set(void 0),Z===void 0&&n(L,le).set(void 0)}),o(B,O),G.traceIs(P,"noOpacity")&&delete B.opacity,G.traceIs(P,"showLegend")||(delete B.showlegend,delete B.legendgroup),G.traceIs(P,"noHover")&&(delete B.hoverinfo,delete B.hoverlabel),z.selectPoints||delete B.selectedpoints,o(B,L),F.attributes&&o(B,F.attributes),B.type=P;var N={meta:z.meta||{},categories:z.categories||{},animatable:!!z.animatable,type:P,attributes:w(B)};if(z.layoutAttributes){var U={};o(U,z.layoutAttributes),N.layoutAttributes=w(U)}return z.animatable||Y.crawl(N,function(Z){Y.isValObject(Z)&&"anim"in Z&&delete Z.anim}),N}function M(){var P={},z,F;o(P,A);for(z in G.subplotsRegistry)if(F=G.subplotsRegistry[z],!!F.layoutAttributes)if(Array.isArray(F.attr))for(var B=0;B=a&&(o._input||{})._templateitemname;n&&(i=a);var s=r+"["+i+"]",c;function f(){c={},n&&(c[s]={},c[s][x]=n)}f();function v(y,b){c[y]=b}function h(y,b){n?G.nestedProperty(c[s],y).set(b):c[s+"."+y]=b}function T(){var y=c;return f(),y}function l(y,b){y&&h(y,b);var S=T();for(var M in S)G.nestedProperty(t,M).set(S[M])}return{modifyBase:v,modifyItem:h,getUpdateObj:T,applyUpdate:l}}}}),Ef=He({"src/plots/cartesian/constants.js"(Y,G){var d=R0().counter;G.exports={idRegex:{x:d("x","( domain)?"),y:d("y","( domain)?")},attrRegex:d("[xy]axis"),xAxisMatch:d("xaxis"),yAxisMatch:d("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),oc=He({"src/plots/cartesian/axis_ids.js"(Y){var G=Ei(),d=Ef();Y.id2name=function(E){if(!(typeof E!="string"||!E.match(d.AX_ID_PATTERN))){var e=E.split(" ")[0].substr(1);return e==="1"&&(e=""),E.charAt(0)+"axis"+e}},Y.name2id=function(E){if(E.match(d.AX_NAME_PATTERN)){var e=E.substr(5);return e==="1"&&(e=""),E.charAt(0)+e}},Y.cleanId=function(E,e,t){var r=/( domain)$/.test(E);if(!(typeof E!="string"||!E.match(d.AX_ID_PATTERN))&&!(e&&E.charAt(0)!==e)&&!(r&&!t)){var o=E.split(" ")[0].substr(1).replace(/^0+/,"");return o==="1"&&(o=""),E.charAt(0)+o+(r&&t?" domain":"")}},Y.list=function(A,E,e){var t=A._fullLayout;if(!t)return[];var r=Y.listIds(A,E),o=new Array(r.length),a;for(a=0;at?1:-1:+(A.substr(1)||1)-+(E.substr(1)||1)},Y.ref2id=function(A){return/^[xyz]/.test(A)?A.split(" ")[0]:!1};function x(A,E){if(E&&E.length){for(var e=0;e0?".":"")+n;d.isPlainObject(s)?t(s,o,c,i+1):o(c,n,s)}})}}}),yu=He({"src/plots/plots.js"(Y,G){var d=Qn(),x=Xl().timeFormatLocale,A=co().formatLocale,E=Hi(),e=Uh(),t=Ei(),r=F0(),o=Gs(),a=Gr(),i=Ai(),n=lo().BADNUM,s=oc(),c=jd().clearOutline,f=t1(),v=Zg(),h=_b(),T=Uf().getModuleCalcData,l=a.relinkPrivateKeys,y=a._,b=G.exports={};a.extendFlat(b,t),b.attributes=cl(),b.attributes.type.values=b.allTypes,b.fontAttrs=Yl(),b.layoutAttributes=D0();var S=KS();b.executeAPICommand=S.executeAPICommand,b.computeAPICommandBindings=S.computeAPICommandBindings,b.manageCommandObserver=S.manageCommandObserver,b.hasSimpleAPICommandBindings=S.hasSimpleAPICommandBindings,b.redrawText=function(j){return j=a.getGraphDiv(j),new Promise(function(J){setTimeout(function(){j._fullLayout&&(t.getComponentMethod("annotations","draw")(j),t.getComponentMethod("legend","draw")(j),t.getComponentMethod("colorbar","draw")(j),J(b.previousPromises(j)))},300)})},b.resize=function(j){j=a.getGraphDiv(j);var J,$=new Promise(function(X,re){(!j||a.isHidden(j))&&re(new Error("Resize must be passed a displayed plot div element.")),j._redrawTimer&&clearTimeout(j._redrawTimer),j._resolveResize&&(J=j._resolveResize),j._resolveResize=X,j._redrawTimer=setTimeout(function(){if(!j.layout||j.layout.width&&j.layout.height||a.isHidden(j)){X(j);return}delete j.layout.width,delete j.layout.height;var ee=j.changed;j.autoplay=!0,t.call("relayout",j,{autosize:!0}).then(function(){j.changed=ee,j._resolveResize===X&&(delete j._resolveResize,X(j))})},100)});return J&&J($),$},b.previousPromises=function(j){if((j._promises||[]).length)return Promise.all(j._promises).then(function(){j._promises=[]})},b.addLinks=function(j){if(!(!j._context.showLink&&!j._context.showSources)){var J=j._fullLayout,$=a.ensureSingle(J._paper,"text","js-plot-link-container",function(ie){ie.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:i.defaultLine,"pointer-events":"all"}).each(function(){var fe=d.select(this);fe.append("tspan").classed("js-link-to-tool",!0),fe.append("tspan").classed("js-link-spacer",!0),fe.append("tspan").classed("js-sourcelinks",!0)})}),X=$.node(),re={y:J._paper.attr("height")-9};document.body.contains(X)&&X.getComputedTextLength()>=J.width-20?(re["text-anchor"]="start",re.x=5):(re["text-anchor"]="end",re.x=J._paper.attr("width")-7),$.attr(re);var ee=$.select(".js-link-to-tool"),q=$.select(".js-link-spacer"),ae=$.select(".js-sourcelinks");j._context.showSources&&j._context.showSources(j),j._context.showLink&&M(j,ee),q.text(ee.text()&&ae.text()?" - ":"")}};function M(j,J){J.text("");var $=J.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(j._context.linkText+" »");if(j._context.sendData)$.on("click",function(){b.sendDataToCloud(j)});else{var X=window.location.pathname.split("/"),re=window.location.search;$.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+X[2].split(".")[0]+"/"+X[1]+re})}}b.sendDataToCloud=function(j){var J=(window.PLOTLYENV||{}).BASE_URL||j._context.plotlyServerURL;if(J){j.emit("plotly_beforeexport");var $=d.select(j).append("div").attr("id","hiddenform").style("display","none"),X=$.append("form").attr({action:J+"/external",method:"post",target:"_blank"}),re=X.append("input").attr({type:"text",name:"data"});return re.node().value=b.graphJson(j,!1,"keepdata"),X.node().submit(),$.remove(),j.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];b.supplyDefaults=function(j,J){var $=J&&J.skipUpdateCalc,X=j._fullLayout||{};if(X._skipDefaults){delete X._skipDefaults;return}var re=j._fullLayout={},ee=j.layout||{},q=j._fullData||[],ae=j._fullData=[],ie=j.data||[],fe=j.calcdata||[],we=j._context||{},Ae;j._transitionData||b.createTransitionData(j),re._dfltTitle={plot:y(j,"Click to enter Plot title"),subtitle:y(j,"Click to enter Plot subtitle"),x:y(j,"Click to enter X axis title"),y:y(j,"Click to enter Y axis title"),colorbar:y(j,"Click to enter Colorscale title"),annotation:y(j,"new text")},re._traceWord=y(j,"trace");var Fe=g(j,_);if(re._mapboxAccessToken=we.mapboxAccessToken,X._initialAutoSizeIsDone){var Ce=X.width,qe=X.height;b.supplyLayoutGlobalDefaults(ee,re,Fe),ee.width||(re.width=Ce),ee.height||(re.height=qe),b.sanitizeMargins(re)}else{b.supplyLayoutGlobalDefaults(ee,re,Fe);var et=!ee.width||!ee.height,Qe=re.autosize,Ke=we.autosizable,Xe=et&&(Qe||Ke);Xe?b.plotAutoSize(j,ee,re):et&&b.sanitizeMargins(re),!Qe&&et&&(ee.width=re.width,ee.height=re.height)}re._d3locale=m(Fe,re.separators),re._extraFormat=g(j,w),re._initialAutoSizeIsDone=!0,re._dataLength=ie.length,re._modules=[],re._visibleModules=[],re._basePlotModules=[];var Me=re._subplots=u(),xe=re._splomAxes={x:{},y:{}},ce=re._splomSubplots={};re._splomGridDflt={},re._scatterStackOpts={},re._firstScatter={},re._alignmentOpts={},re._colorAxes={},re._requestRangeslider={},re._traceUids=p(q,ie),b.supplyDataDefaults(ie,ae,ee,re);var Re=Object.keys(xe.x),$e=Object.keys(xe.y);if(Re.length>1&&$e.length>1){for(t.getComponentMethod("grid","sizeDefaults")(ee,re),Ae=0;Ae15&&$e.length>15&&re.shapes.length===0&&re.images.length===0,b.linkSubplots(ae,re,q,X),b.cleanPlot(ae,re,q,X);var Rt=!!(X._has&&X._has("cartesian")),Ut=!!(re._has&&re._has("cartesian")),ir=Rt,ar=Ut;ir&&!ar?X._bgLayer.remove():ar&&!ir&&(re._shouldCreateBgLayer=!0),X._zoomlayer&&!j._dragging&&c({_fullLayout:X}),R(ae,re),l(re,X),t.getComponentMethod("colorscale","crossTraceDefaults")(ae,re),re._preGUI||(re._preGUI={}),re._tracePreGUI||(re._tracePreGUI={});var Mr=re._tracePreGUI,fr={},dr;for(dr in Mr)fr[dr]="old";for(Ae=0;Ae0){var we=1-2*ee;q=Math.round(we*q),ae=Math.round(we*ae)}}var Ae=b.layoutAttributes.width.min,Fe=b.layoutAttributes.height.min;q1,qe=!$.height&&Math.abs(X.height-ae)>1;(qe||Ce)&&(Ce&&(X.width=q),qe&&(X.height=ae)),J._initialAutoSize||(J._initialAutoSize={width:q,height:ae}),b.sanitizeMargins(X)},b.supplyLayoutModuleDefaults=function(j,J,$,X){var re=t.componentsRegistry,ee=J._basePlotModules,q,ae,ie,fe=t.subplotsRegistry.cartesian;for(q in re)ie=re[q],ie.includeBasePlot&&ie.includeBasePlot(j,J);ee.length||ee.push(fe),J._has("cartesian")&&(t.getComponentMethod("grid","contentDefaults")(j,J),fe.finalizeSubplots(j,J));for(var we in J._subplots)J._subplots[we].sort(a.subplotSort);for(ae=0;ae1&&($.l/=Qe,$.r/=Qe)}if(Fe){var Ke=($.t+$.b)/Fe;Ke>1&&($.t/=Ke,$.b/=Ke)}var Xe=$.xl!==void 0?$.xl:$.x,Me=$.xr!==void 0?$.xr:$.x,xe=$.yt!==void 0?$.yt:$.y,ce=$.yb!==void 0?$.yb:$.y;Ce[J]={l:{val:Xe,size:$.l+et},r:{val:Me,size:$.r+et},b:{val:ce,size:$.b+et},t:{val:xe,size:$.t+et}},qe[J]=1}if(!X._replotting)return b.doAutoMargin(j)}};function L(j){if("_redrawFromAutoMarginCount"in j._fullLayout)return!1;var J=s.list(j,"",!0);for(var $ in J)if(J[$].autoshift||J[$].shift)return!0;return!1}b.doAutoMargin=function(j){var J=j._fullLayout,$=J.width,X=J.height;J._size||(J._size={}),F(J);var re=J._size,ee=J.margin,q={t:0,b:0,l:0,r:0},ae=a.extendFlat({},re),ie=ee.l,fe=ee.r,we=ee.t,Ae=ee.b,Fe=J._pushmargin,Ce=J._pushmarginIds,qe=J.minreducedwidth,et=J.minreducedheight;if(ee.autoexpand!==!1){for(var Qe in Fe)Ce[Qe]||delete Fe[Qe];var Ke=j._fullLayout._reservedMargin;for(var Xe in Ke)for(var Me in Ke[Xe]){var xe=Ke[Xe][Me];q[Me]=Math.max(q[Me],xe)}Fe.base={l:{val:0,size:ie},r:{val:1,size:fe},t:{val:1,size:we},b:{val:0,size:Ae}};for(var ce in q){var Re=0;for(var $e in Fe)$e!=="base"&&E(Fe[$e][ce].size)&&(Re=Fe[$e][ce].size>Re?Fe[$e][ce].size:Re);var rt=Math.max(0,ee[ce]-Re);q[ce]=Math.max(0,q[ce]-rt)}for(var Je in Fe){var At=Fe[Je].l||{},St=Fe[Je].b||{},Rt=At.val,Ut=At.size,ir=St.val,ar=St.size,Mr=$-q.r-q.l,fr=X-q.t-q.b;for(var dr in Fe){if(E(Ut)&&Fe[dr].r){var pt=Fe[dr].r.val,ze=Fe[dr].r.size;if(pt>Rt){var Ge=(Ut*pt+(ze-Mr)*Rt)/(pt-Rt),Oe=(ze*(1-Rt)+(Ut-Mr)*(1-pt))/(pt-Rt);Ge+Oe>ie+fe&&(ie=Ge,fe=Oe)}}if(E(ar)&&Fe[dr].t){var ve=Fe[dr].t.val,ge=Fe[dr].t.size;if(ve>ir){var be=(ar*ve+(ge-fr)*ir)/(ve-ir),Pe=(ge*(1-ir)+(ar-fr)*(1-ve))/(ve-ir);be+Pe>Ae+we&&(Ae=be,we=Pe)}}}}}var We=a.constrain($-ee.l-ee.r,B,qe),ct=a.constrain(X-ee.t-ee.b,O,et),_t=Math.max(0,$-We),Mt=Math.max(0,X-ct);if(_t){var Nt=(ie+fe)/_t;Nt>1&&(ie/=Nt,fe/=Nt)}if(Mt){var Bt=(Ae+we)/Mt;Bt>1&&(Ae/=Bt,we/=Bt)}if(re.l=Math.round(ie)+q.l,re.r=Math.round(fe)+q.r,re.t=Math.round(we)+q.t,re.b=Math.round(Ae)+q.b,re.p=Math.round(ee.pad),re.w=Math.round($)-re.l-re.r,re.h=Math.round(X)-re.t-re.b,!J._replotting&&(b.didMarginChange(ae,re)||L(j))){"_redrawFromAutoMarginCount"in J?J._redrawFromAutoMarginCount++:J._redrawFromAutoMarginCount=1;var qt=3*(1+Object.keys(Ce).length);if(J._redrawFromAutoMarginCount1)return!0}return!1},b.graphJson=function(j,J,$,X,re,ee){(re&&J&&!j._fullData||re&&!J&&!j._fullLayout)&&b.supplyDefaults(j);var q=re?j._fullData:j.data,ae=re?j._fullLayout:j.layout,ie=(j._transitionData||{})._frames;function fe(Fe,Ce){if(typeof Fe=="function")return Ce?"_function_":null;if(a.isPlainObject(Fe)){var qe={},et;return Object.keys(Fe).sort().forEach(function(Me){if(["_","["].indexOf(Me.charAt(0))===-1){if(typeof Fe[Me]=="function"){Ce&&(qe[Me]="_function");return}if($==="keepdata"){if(Me.substr(Me.length-3)==="src")return}else if($==="keepstream"){if(et=Fe[Me+"src"],typeof et=="string"&&et.indexOf(":")>0&&!a.isPlainObject(Fe.stream))return}else if($!=="keepall"&&(et=Fe[Me+"src"],typeof et=="string"&&et.indexOf(":")>0))return;qe[Me]=fe(Fe[Me],Ce)}}),qe}var Qe=Array.isArray(Fe),Ke=a.isTypedArray(Fe);if((Qe||Ke)&&Fe.dtype&&Fe.shape){var Xe=Fe.bdata;return fe({dtype:Fe.dtype,shape:Fe.shape,bdata:a.isArrayBuffer(Xe)?e.encode(Xe):Xe},Ce)}return Qe?Fe.map(function(Me){return fe(Me,Ce)}):Ke?a.simpleMap(Fe,a.identity):a.isJSDate(Fe)?a.ms2DateTimeLocal(+Fe):Fe}var we={data:(q||[]).map(function(Fe){var Ce=fe(Fe);return J&&delete Ce.fit,Ce})};if(!J&&(we.layout=fe(ae),re)){var Ae=ae._size;we.layout.computed={margin:{b:Ae.b,l:Ae.l,r:Ae.r,t:Ae.t}}}return ie&&(we.frames=fe(ie)),ee&&(we.config=fe(j._context,!0)),X==="object"?we:JSON.stringify(we)},b.modifyFrames=function(j,J){var $,X,re,ee=j._transitionData._frames,q=j._transitionData._frameHash;for($=0;$0&&(j._transitioningWithDuration=!0),j._transitionData._interruptCallbacks.push(function(){X=!0}),$.redraw&&j._transitionData._interruptCallbacks.push(function(){return t.call("redraw",j)}),j._transitionData._interruptCallbacks.push(function(){j.emit("plotly_transitioninterrupted",[])});var Fe=0,Ce=0;function qe(){return Fe++,function(){Ce++,!X&&Ce===Fe&&ae(Ae)}}$.runFn(qe),setTimeout(qe())})}function ae(Ae){if(j._transitionData)return ee(j._transitionData._interruptCallbacks),Promise.resolve().then(function(){if($.redraw)return t.call("redraw",j)}).then(function(){j._transitioning=!1,j._transitioningWithDuration=!1,j.emit("plotly_transitioned",[])}).then(Ae)}function ie(){if(j._transitionData)return j._transitioning=!1,re(j._transitionData._interruptCallbacks)}var fe=[b.previousPromises,ie,$.prepareFn,b.rehover,b.reselect,q],we=a.syncOrAsync(fe,j);return(!we||!we.then)&&(we=Promise.resolve()),we.then(function(){return j})}b.doCalcdata=function(j,J){var $=s.list(j),X=j._fullData,re=j._fullLayout,ee,q,ae,ie,fe=new Array(X.length),we=(j.calcdata||[]).slice();for(j.calcdata=fe,re._numBoxes=0,re._numViolins=0,re._violinScaleGroupStats={},j._hmpixcount=0,j._hmlumcount=0,re._piecolormap={},re._sunburstcolormap={},re._treemapcolormap={},re._iciclecolormap={},re._funnelareacolormap={},ae=0;ae=0;ie--)if(ce[ie].enabled){ee._indexToPoints=ce[ie]._indexToPoints;break}q&&q.calc&&(xe=q.calc(j,ee))}(!Array.isArray(xe)||!xe[0])&&(xe=[{x:n,y:n}]),xe[0].t||(xe[0].t={}),xe[0].trace=ee,fe[Xe]=xe}}for(oe($,X,re),ae=0;aeae||Ce>ie)&&(ee.style("overflow","hidden"),Ae=ee.node().getBoundingClientRect(),Fe=Ae.width,Ce=Ae.height);var qe=+O.attr("x"),et=+O.attr("y"),Qe=j||O.node().getBoundingClientRect().height,Ke=-Qe/4;if(ue[0]==="y")q.attr({transform:"rotate("+[-90,qe,et]+")"+x(-Fe/2,Ke-Ce/2)});else if(ue[0]==="l")et=Ke-Ce/2;else if(ue[0]==="a"&&ue.indexOf("atitle")!==0)qe=0,et=Ke;else{var Xe=O.attr("text-anchor");qe=qe-Fe*(Xe==="middle"?.5:Xe==="end"?1:0),et=et+Ke-Ce/2}ee.attr({x:qe,y:et}),N&&N.call(O,q),le(q)})})):oe(),O};var t=/(<|<|<)/g,r=/(>|>|>)/g;function o(O){return O.replace(t,"\\lt ").replace(r,"\\gt ")}var a=[["$","$"],["\\(","\\)"]];function i(O,L,N){var U=parseInt((MathJax.version||"").split(".")[0]);if(U!==2&&U!==3){d.warn("No MathJax version:",MathJax.version);return}var Z,Q,ue,oe,le=function(){return Q=d.extendDeepAll({},MathJax.Hub.config),ue=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:a},displayAlign:"left"})},j=function(){Q=d.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=a},J=function(){if(Z=MathJax.Hub.config.menuSettings.renderer,Z!=="SVG")return MathJax.Hub.setRenderer("SVG")},$=function(){Z=MathJax.config.startup.output,Z!=="svg"&&(MathJax.config.startup.output="svg")},X=function(){var fe="math-output-"+d.randstr({},64);oe=G.select("body").append("div").attr({id:fe}).style({visibility:"hidden",position:"absolute","font-size":L.fontSize+"px"}).text(o(O));var we=oe.node();return U===2?MathJax.Hub.Typeset(we):MathJax.typeset([we])},re=function(){var fe=oe.select(U===2?".MathJax_SVG":".MathJax"),we=!fe.empty()&&oe.select("svg").node();if(!we)d.log("There was an error in the tex syntax.",O),N();else{var Ae=we.getBoundingClientRect(),Fe;U===2?Fe=G.select("body").select("#MathJax_SVG_glyphs"):Fe=fe.select("defs"),N(fe,Fe,Ae)}oe.remove()},ee=function(){if(Z!=="SVG")return MathJax.Hub.setRenderer(Z)},q=function(){Z!=="svg"&&(MathJax.config.startup.output=Z)},ae=function(){return ue!==void 0&&(MathJax.Hub.processSectionDelay=ue),MathJax.Hub.Config(Q)},ie=function(){MathJax.config=Q};U===2?MathJax.Hub.Queue(le,J,X,re,ee,ae):U===3&&(j(),$(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){X(),re(),q(),ie()}))}var n={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},s={sub:"0.3em",sup:"-0.6em"},c={sub:"-0.21em",sup:"0.42em"},f="​",v=["http:","https:","mailto:","",void 0,":"],h=Y.NEWLINES=/(\r\n?|\n)/g,T=/(<[^<>]*>)/,l=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;Y.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,S=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,M=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,_=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function w(O,L){if(!O)return null;var N=O.match(L),U=N&&(N[3]||N[4]);return U&&m(U)}var p=/(^|;)\s*color:/;Y.plainText=function(O,L){L=L||{};for(var N=L.len!==void 0&&L.len!==-1?L.len:1/0,U=L.allowedTags!==void 0?L.allowedTags:["br"],Z="...",Q=Z.length,ue=O.split(T),oe=[],le="",j=0,J=0;JQ?oe.push($.substr(0,q-Q)+Z):oe.push($.substr(0,q));break}le=""}}return oe.join("")};var u={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},g=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function m(O){return O.replace(g,function(L,N){var U;return N.charAt(0)==="#"?U=R(N.charAt(1)==="x"?parseInt(N.substr(2),16):parseInt(N.substr(1),10)):U=u[N],U||L})}Y.convertEntities=m;function R(O){if(!(O>1114111)){var L=String.fromCodePoint;if(L)return L(O);var N=String.fromCharCode;return O<=65535?N(O):N((O>>10)+55232,O%1024+56320)}}function P(O,L){L=L.replace(h," ");var N=!1,U=[],Z,Q=-1;function ue(){Q++;var Ce=document.createElementNS(A.svg,"tspan");G.select(Ce).attr({class:"line",dy:Q*E+"em"}),O.appendChild(Ce),Z=Ce;var qe=U;if(U=[{node:Ce}],qe.length>1)for(var et=1;et.",L);return}var qe=U.pop();Ce!==qe.type&&d.log("Start tag <"+qe.type+"> doesnt match end tag <"+Ce+">. Pretending it did match.",L),Z=U[U.length-1].node}var J=y.test(L);J?ue():(Z=O,U=[{node:O}]);for(var $=L.split(T),X=0;X<$.length;X++){var re=$[X],ee=re.match(l),q=ee&&ee[2].toLowerCase(),ae=n[q];if(q==="br")ue();else if(ae===void 0)le(Z,m(re));else if(ee[1])j(q);else{var ie=ee[4],fe={type:q},we=w(ie,b);if(we?(we=we.replace(p,"$1 fill:"),ae&&(we+=";"+ae)):ae&&(we=ae),we&&(fe.style=we),q==="a"){N=!0;var Ae=w(ie,S);if(Ae){var Fe=z(Ae);Fe&&(fe.href=Fe,fe.target=w(ie,M)||"_blank",fe.popup=w(ie,_))}}oe(fe)}}return N}function z(O){var L=encodeURI(decodeURI(O)),N=document.createElement("a"),U=document.createElement("a");N.href=O,U.href=L;var Z=N.protocol,Q=U.protocol;return v.indexOf(Z)!==-1&&v.indexOf(Q)!==-1?L:""}Y.sanitizeHTML=function(L){L=L.replace(h," ");for(var N=document.createElement("p"),U=N,Z=[],Q=L.split(T),ue=0;ue=0;y--,b++){var S=h[y];l[b]=[1-S[0],S[1]]}return l}function c(h,T){T=T||{};for(var l=h.domain,y=h.range,b=y.length,S=new Array(b),M=0;Mh-f?f=h-(v-h):v-h=0?y=o.colorscale.sequential:y=o.colorscale.sequentialminus,s._sync("colorscale",y)}}}}),Kl=He({"src/components/colorscale/index.js"(Y,G){var d=Ap(),x=Ah();G.exports={moduleType:"component",name:"colorscale",attributes:kl(),layoutAttributes:xb(),supplyLayoutDefaults:JS(),handleDefaults:pf(),crossTraceDefaults:$S(),calc:Sh(),scales:d.scales,defaultScale:d.defaultScale,getScale:d.get,isValidScale:d.isValid,hasColorscale:x.hasColorscale,extractOpts:x.extractOpts,extractScale:x.extractScale,flipScale:x.flipScale,makeColorScaleFunc:x.makeColorScaleFunc,makeColorScaleFuncFromTrace:x.makeColorScaleFuncFromTrace}}}),Rl=He({"src/traces/scatter/subtypes.js"(Y,G){var d=Gr(),x=ch().isTypedArraySpec;G.exports={hasLines:function(A){return A.visible&&A.mode&&A.mode.indexOf("lines")!==-1},hasMarkers:function(A){return A.visible&&(A.mode&&A.mode.indexOf("markers")!==-1||A.type==="splom")},hasText:function(A){return A.visible&&A.mode&&A.mode.indexOf("text")!==-1},isBubble:function(A){var E=A.marker;return d.isPlainObject(E)&&(d.isArrayOrTypedArray(E.size)||x(E.size))}}}}),B0=He({"src/traces/scatter/make_bubble_size_func.js"(Y,G){var d=Hi();G.exports=function(A,E){E||(E=2);var e=A.marker,t=e.sizeref||1,r=e.sizemin||0,o=e.sizemode==="area"?function(a){return Math.sqrt(a/t)}:function(a){return a/t};return function(a){var i=o(a/E);return d(i)&&i>0?Math.max(i,r):0}}}}),Ph=He({"src/components/fx/helpers.js"(Y){var G=Gr();Y.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},Y.isTraceInSubplots=function(t,r){if(t.type==="splom"){for(var o=t.xaxes||[],a=t.yaxes||[],i=0;i=0&&o.index2&&(r.push([a].concat(i.splice(0,2))),n="l",a=a=="m"?"l":"L");;){if(i.length==d[n])return i.unshift(a),r.push(i);if(i.length0&&(xe=100,Me=Me.replace("-open","")),Me.indexOf("-dot")>0&&(xe+=200,Me=Me.replace("-dot","")),Me=l.symbolNames.indexOf(Me),Me>=0&&(Me+=xe)}return Me%100>=p||Me>=400?0:Math.floor(Math.max(Me,0))};function g(Me,xe,ce,Re){var $e=Me%100;return l.symbolFuncs[$e](xe,ce,Re)+(Me>=200?u:"")}var m=A("~f"),R={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};l.gradient=function(Me,xe,ce,Re,$e,rt){var Je=R[Re];return P(Me,xe,ce,Je.type,$e,rt,Je.start,Je.stop,!1,Je.reversed)};function P(Me,xe,ce,Re,$e,rt,Je,At,St,Rt){var Ut=$e.length,ir;Re==="linear"?ir={node:"linearGradient",attrs:{x1:Je.x,y1:Je.y,x2:At.x,y2:At.y,gradientUnits:St?"userSpaceOnUse":"objectBoundingBox"},reversed:Rt}:Re==="radial"&&(ir={node:"radialGradient",reversed:Rt});for(var ar=new Array(Ut),Mr=0;Mr=0&&Me.i===void 0&&(Me.i=rt.i),xe.style("opacity",Re.selectedOpacityFn?Re.selectedOpacityFn(Me):Me.mo===void 0?Je.opacity:Me.mo),Re.ms2mrc){var St;Me.ms==="various"||Je.size==="various"?St=3:St=Re.ms2mrc(Me.ms),Me.mrc=St,Re.selectedSizeFn&&(St=Me.mrc=Re.selectedSizeFn(Me));var Rt=l.symbolNumber(Me.mx||Je.symbol)||0;Me.om=Rt%200>=100;var Ut=Xe(Me,ce),ir=ae(Me,ce);xe.attr("d",g(Rt,St,Ut,ir))}var ar=!1,Mr,fr,dr;if(Me.so)dr=At.outlierwidth,fr=At.outliercolor,Mr=Je.outliercolor;else{var pt=(At||{}).width;dr=(Me.mlw+1||pt+1||(Me.trace?(Me.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in Me?fr=Me.mlcc=Re.lineScale(Me.mlc):x.isArrayOrTypedArray(At.color)?fr=r.defaultLine:fr=At.color,x.isArrayOrTypedArray(Je.color)&&(Mr=r.defaultLine,ar=!0),"mc"in Me?Mr=Me.mcc=Re.markerScale(Me.mc):Mr=Je.color||Je.colors||"rgba(0,0,0,0)",Re.selectedColorFn&&(Mr=Re.selectedColorFn(Me))}if(Me.om)xe.call(r.stroke,Mr).style({"stroke-width":(dr||1)+"px",fill:"none"});else{xe.style("stroke-width",(Me.isBlank?0:dr)+"px");var ze=Je.gradient,Ge=Me.mgt;Ge?ar=!0:Ge=ze&&ze.type,x.isArrayOrTypedArray(Ge)&&(Ge=Ge[0],R[Ge]||(Ge=0));var Oe=Je.pattern,ve=Oe&&l.getPatternAttr(Oe.shape,Me.i,"");if(Ge&&Ge!=="none"){var ge=Me.mgc;ge?ar=!0:ge=ze.color;var be=ce.uid;ar&&(be+="-"+Me.i),l.gradient(xe,$e,be,Ge,[[0,ge],[1,Mr]],"fill")}else if(ve){var Pe=!1,We=Oe.fgcolor;!We&&rt&&rt.color&&(We=rt.color,Pe=!0);var ct=l.getPatternAttr(We,Me.i,rt&&rt.color||null),_t=l.getPatternAttr(Oe.bgcolor,Me.i,null),Mt=Oe.fgopacity,Nt=l.getPatternAttr(Oe.size,Me.i,8),Bt=l.getPatternAttr(Oe.solidity,Me.i,.3);Pe=Pe||Me.mcc||x.isArrayOrTypedArray(Oe.shape)||x.isArrayOrTypedArray(Oe.bgcolor)||x.isArrayOrTypedArray(Oe.fgcolor)||x.isArrayOrTypedArray(Oe.size)||x.isArrayOrTypedArray(Oe.solidity);var qt=ce.uid;Pe&&(qt+="-"+Me.i),l.pattern(xe,"point",$e,qt,ve,Nt,Bt,Me.mcc,Oe.fillmode,_t,ct,Mt)}else x.isArrayOrTypedArray(Mr)?r.fill(xe,Mr[Me.i]):r.fill(xe,Mr);dr&&r.stroke(xe,fr)}},l.makePointStyleFns=function(Me){var xe={},ce=Me.marker;return xe.markerScale=l.tryColorscale(ce,""),xe.lineScale=l.tryColorscale(ce,"line"),t.traceIs(Me,"symbols")&&(xe.ms2mrc=v.isBubble(Me)?h(Me):function(){return(ce.size||6)/2}),Me.selectedpoints&&x.extendFlat(xe,l.makeSelectedPointStyleFns(Me)),xe},l.makeSelectedPointStyleFns=function(Me){var xe={},ce=Me.selected||{},Re=Me.unselected||{},$e=Me.marker||{},rt=ce.marker||{},Je=Re.marker||{},At=$e.opacity,St=rt.opacity,Rt=Je.opacity,Ut=St!==void 0,ir=Rt!==void 0;(x.isArrayOrTypedArray(At)||Ut||ir)&&(xe.selectedOpacityFn=function(ve){var ge=ve.mo===void 0?$e.opacity:ve.mo;return ve.selected?Ut?St:ge:ir?Rt:f*ge});var ar=$e.color,Mr=rt.color,fr=Je.color;(Mr||fr)&&(xe.selectedColorFn=function(ve){var ge=ve.mcc||ar;return ve.selected?Mr||ge:fr||ge});var dr=$e.size,pt=rt.size,ze=Je.size,Ge=pt!==void 0,Oe=ze!==void 0;return t.traceIs(Me,"symbols")&&(Ge||Oe)&&(xe.selectedSizeFn=function(ve){var ge=ve.mrc||dr/2;return ve.selected?Ge?pt/2:ge:Oe?ze/2:ge}),xe},l.makeSelectedTextStyleFns=function(Me){var xe={},ce=Me.selected||{},Re=Me.unselected||{},$e=Me.textfont||{},rt=ce.textfont||{},Je=Re.textfont||{},At=$e.color,St=rt.color,Rt=Je.color;return xe.selectedTextColorFn=function(Ut){var ir=Ut.tc||At;return Ut.selected?St||ir:Rt||(St?ir:r.addOpacity(ir,f))},xe},l.selectedPointStyle=function(Me,xe){if(!(!Me.size()||!xe.selectedpoints)){var ce=l.makeSelectedPointStyleFns(xe),Re=xe.marker||{},$e=[];ce.selectedOpacityFn&&$e.push(function(rt,Je){rt.style("opacity",ce.selectedOpacityFn(Je))}),ce.selectedColorFn&&$e.push(function(rt,Je){r.fill(rt,ce.selectedColorFn(Je))}),ce.selectedSizeFn&&$e.push(function(rt,Je){var At=Je.mx||Re.symbol||0,St=ce.selectedSizeFn(Je);rt.attr("d",g(l.symbolNumber(At),St,Xe(Je,xe),ae(Je,xe))),Je.mrc2=St}),$e.length&&Me.each(function(rt){for(var Je=d.select(this),At=0;At<$e.length;At++)$e[At](Je,rt)})}},l.tryColorscale=function(Me,xe){var ce=xe?x.nestedProperty(Me,xe).get():Me;if(ce){var Re=ce.color;if((ce.colorscale||ce._colorAx)&&x.isArrayOrTypedArray(Re))return o.makeColorScaleFuncFromTrace(ce)}return x.identity};var z={start:1,end:-1,middle:0,bottom:1,top:-1};function F(Me,xe,ce,Re,$e){var rt=d.select(Me.node().parentNode),Je=xe.indexOf("top")!==-1?"top":xe.indexOf("bottom")!==-1?"bottom":"middle",At=xe.indexOf("left")!==-1?"end":xe.indexOf("right")!==-1?"start":"middle",St=Re?Re/.8+1:0,Rt=(i.lineCount(Me)-1)*c+1,Ut=z[At]*St,ir=ce*.75+z[Je]*St+(z[Je]-1)*Rt*ce/2;Me.attr("text-anchor",At),$e||rt.attr("transform",a(Ut,ir))}function B(Me,xe){var ce=Me.ts||xe.textfont.size;return E(ce)&&ce>0?ce:0}l.textPointStyle=function(Me,xe,ce){if(Me.size()){var Re;if(xe.selectedpoints){var $e=l.makeSelectedTextStyleFns(xe);Re=$e.selectedTextColorFn}var rt=xe.texttemplate,Je=ce._fullLayout;Me.each(function(At){var St=d.select(this),Rt=rt?x.extractOption(At,xe,"txt","texttemplate"):x.extractOption(At,xe,"tx","text");if(!Rt&&Rt!==0){St.remove();return}if(rt){var Ut=xe._module.formatLabels,ir=Ut?Ut(At,xe,Je):{},ar={};T(ar,xe,At.i);var Mr=xe._meta||{};Rt=x.texttemplateString(Rt,ir,Je._d3locale,ar,At,Mr)}var fr=At.tp||xe.textposition,dr=B(At,xe),pt=Re?Re(At):At.tc||xe.textfont.color;St.call(l.font,{family:At.tf||xe.textfont.family,weight:At.tw||xe.textfont.weight,style:At.ty||xe.textfont.style,variant:At.tv||xe.textfont.variant,textcase:At.tC||xe.textfont.textcase,lineposition:At.tE||xe.textfont.lineposition,shadow:At.tS||xe.textfont.shadow,size:dr,color:pt}).text(Rt).call(i.convertToTspans,ce).call(F,fr,dr,At.mrc)})}},l.selectedTextStyle=function(Me,xe){if(!(!Me.size()||!xe.selectedpoints)){var ce=l.makeSelectedTextStyleFns(xe);Me.each(function(Re){var $e=d.select(this),rt=ce.selectedTextColorFn(Re),Je=Re.tp||xe.textposition,At=B(Re,xe);r.fill($e,rt);var St=t.traceIs(xe,"bar-like");F($e,Je,At,Re.mrc2||Re.mrc,St)})}};var O=.5;l.smoothopen=function(Me,xe){if(Me.length<3)return"M"+Me.join("L");var ce="M"+Me[0],Re=[],$e;for($e=1;$e=St||ve>=Ut&&ve<=St)&&(ge<=ir&&ge>=Rt||ge>=ir&&ge<=Rt)&&(Me=[ve,ge])}return Me}l.applyBackoff=j,l.makeTester=function(){var Me=x.ensureSingleById(d.select("body"),"svg","js-plotly-tester",function(ce){ce.attr(n.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),xe=x.ensureSingle(Me,"path","js-reference-point",function(ce){ce.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});l.tester=Me,l.testref=xe},l.savedBBoxes={};var J=0,$=1e4;l.bBox=function(Me,xe,ce){ce||(ce=X(Me));var Re;if(ce){if(Re=l.savedBBoxes[ce],Re)return x.extendFlat({},Re)}else if(Me.childNodes.length===1){var $e=Me.childNodes[0];if(ce=X($e),ce){var rt=+$e.getAttribute("x")||0,Je=+$e.getAttribute("y")||0,At=$e.getAttribute("transform");if(!At){var St=l.bBox($e,!1,ce);return rt&&(St.left+=rt,St.right+=rt),Je&&(St.top+=Je,St.bottom+=Je),St}if(ce+="~"+rt+"~"+Je+"~"+At,Re=l.savedBBoxes[ce],Re)return x.extendFlat({},Re)}}var Rt,Ut;xe?Rt=Me:(Ut=l.tester.node(),Rt=Me.cloneNode(!0),Ut.appendChild(Rt)),d.select(Rt).attr("transform",null).call(i.positionText,0,0);var ir=Rt.getBoundingClientRect(),ar=l.testref.node().getBoundingClientRect();xe||Ut.removeChild(Rt);var Mr={height:ir.height,width:ir.width,left:ir.left-ar.left,top:ir.top-ar.top,right:ir.right-ar.left,bottom:ir.bottom-ar.top};return J>=$&&(l.savedBBoxes={},J=0),ce&&(l.savedBBoxes[ce]=Mr),J++,x.extendFlat({},Mr)};function X(Me){var xe=Me.getAttribute("data-unformatted");if(xe!==null)return xe+Me.getAttribute("data-math")+Me.getAttribute("text-anchor")+Me.getAttribute("style")}l.setClipUrl=function(Me,xe,ce){Me.attr("clip-path",re(xe,ce))};function re(Me,xe){if(!Me)return null;var ce=xe._context,Re=ce._exportedPlot?"":ce._baseUrl||"";return Re?"url('"+Re+"#"+Me+"')":"url(#"+Me+")"}l.getTranslate=function(Me){var xe=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,ce=Me.attr?"attr":"getAttribute",Re=Me[ce]("transform")||"",$e=Re.replace(xe,function(rt,Je,At){return[Je,At].join(" ")}).split(" ");return{x:+$e[0]||0,y:+$e[1]||0}},l.setTranslate=function(Me,xe,ce){var Re=/(\btranslate\(.*?\);?)/,$e=Me.attr?"attr":"getAttribute",rt=Me.attr?"attr":"setAttribute",Je=Me[$e]("transform")||"";return xe=xe||0,ce=ce||0,Je=Je.replace(Re,"").trim(),Je+=a(xe,ce),Je=Je.trim(),Me[rt]("transform",Je),Je},l.getScale=function(Me){var xe=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,ce=Me.attr?"attr":"getAttribute",Re=Me[ce]("transform")||"",$e=Re.replace(xe,function(rt,Je,At){return[Je,At].join(" ")}).split(" ");return{x:+$e[0]||1,y:+$e[1]||1}},l.setScale=function(Me,xe,ce){var Re=/(\bscale\(.*?\);?)/,$e=Me.attr?"attr":"getAttribute",rt=Me.attr?"attr":"setAttribute",Je=Me[$e]("transform")||"";return xe=xe||1,ce=ce||1,Je=Je.replace(Re,"").trim(),Je+="scale("+xe+","+ce+")",Je=Je.trim(),Me[rt]("transform",Je),Je};var ee=/\s*sc.*/;l.setPointGroupScale=function(Me,xe,ce){if(xe=xe||1,ce=ce||1,!!Me){var Re=xe===1&&ce===1?"":"scale("+xe+","+ce+")";Me.each(function(){var $e=(this.getAttribute("transform")||"").replace(ee,"");$e+=Re,$e=$e.trim(),this.setAttribute("transform",$e)})}};var q=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(Me,xe,ce){Me&&Me.each(function(){var Re,$e=d.select(this),rt=$e.select("text");if(rt.node()){var Je=parseFloat(rt.attr("x")||0),At=parseFloat(rt.attr("y")||0),St=($e.attr("transform")||"").match(q);xe===1&&ce===1?Re=[]:Re=[a(Je,At),"scale("+xe+","+ce+")",a(-Je,-At)],St&&Re.push(St),$e.attr("transform",Re.join(""))}})};function ae(Me,xe){var ce;return Me&&(ce=Me.mf),ce===void 0&&(ce=xe.marker&&xe.marker.standoff||0),!xe._geo&&!xe._xA?-ce:ce}l.getMarkerStandoff=ae;var ie=Math.atan2,fe=Math.cos,we=Math.sin;function Ae(Me,xe){var ce=xe[0],Re=xe[1];return[ce*fe(Me)-Re*we(Me),ce*we(Me)+Re*fe(Me)]}var Fe,Ce,qe,et,Qe,Ke;function Xe(Me,xe){var ce=Me.ma;ce===void 0&&(ce=xe.marker.angle,(!ce||x.isArrayOrTypedArray(ce))&&(ce=0));var Re,$e,rt=xe.marker.angleref;if(rt==="previous"||rt==="north"){if(xe._geo){var Je=xe._geo.project(Me.lonlat);Re=Je[0],$e=Je[1]}else{var At=xe._xA,St=xe._yA;if(At&&St)Re=At.c2p(Me.x),$e=St.c2p(Me.y);else return 90}if(xe._geo){var Rt=Me.lonlat[0],Ut=Me.lonlat[1],ir=xe._geo.project([Rt,Ut+1e-5]),ar=xe._geo.project([Rt+1e-5,Ut]),Mr=ie(ar[1]-$e,ar[0]-Re),fr=ie(ir[1]-$e,ir[0]-Re),dr;if(rt==="north")dr=ce/180*Math.PI;else if(rt==="previous"){var pt=Rt/180*Math.PI,ze=Ut/180*Math.PI,Ge=Fe/180*Math.PI,Oe=Ce/180*Math.PI,ve=Ge-pt,ge=fe(Oe)*we(ve),be=we(Oe)*fe(ze)-fe(Oe)*we(ze)*fe(ve);dr=-ie(ge,be)-Math.PI,Fe=Rt,Ce=Ut}var Pe=Ae(Mr,[fe(dr),0]),We=Ae(fr,[we(dr),0]);ce=ie(Pe[1]+We[1],Pe[0]+We[0])/Math.PI*180,rt==="previous"&&!(Ke===xe.uid&&Me.i===Qe+1)&&(ce=null)}if(rt==="previous"&&!xe._geo)if(Ke===xe.uid&&Me.i===Qe+1&&E(Re)&&E($e)){var ct=Re-qe,_t=$e-et,Mt=xe.line&&xe.line.shape||"",Nt=Mt.slice(Mt.length-1);Nt==="h"&&(_t=0),Nt==="v"&&(ct=0),ce+=ie(_t,ct)/Math.PI*180+90}else ce=null}return qe=Re,et=$e,Qe=Me.i,Ke=xe.uid,ce}l.getMarkerAngle=Xe}}),kp=He({"src/components/titles/index.js"(Y,G){var d=Qn(),x=Hi(),A=yu(),E=Ei(),e=Gr(),t=e.strTranslate,r=vo(),o=Ai(),a=yl(),i=Bd(),n=df().OPPOSITE_SIDE,s=/ [XY][0-9]* /,c=1.6,f=1.6;function v(h,T,l){var y=h._fullLayout,b=l.propContainer,S=l.propName,M=l.placeholder,_=l.traceIndex,w=l.avoid||{},p=l.attributes,u=l.transform,g=l.containerGroup,m=1,R=b.title,P=(R&&R.text?R.text:"").trim(),z=!1,F=R&&R.font?R.font:{},B=F.family,O=F.size,L=F.color,N=F.weight,U=F.style,Z=F.variant,Q=F.textcase,ue=F.lineposition,oe=F.shadow,le=l.subtitlePropName,j=!!le,J=l.subtitlePlaceholder,$=(b.title||{}).subtitle||{text:"",font:{}},X=$.text.trim(),re=!1,ee=1,q=$.font,ae=q.family,ie=q.size,fe=q.color,we=q.weight,Ae=q.style,Fe=q.variant,Ce=q.textcase,qe=q.lineposition,et=q.shadow,Qe;S==="title.text"?Qe="titleText":S.indexOf("axis")!==-1?Qe="axisTitleText":S.indexOf("colorbar"!==-1)&&(Qe="colorbarTitleText");var Ke=h._context.edits[Qe];function Xe(ar,Mr){return ar===void 0||Mr===void 0?!1:ar.replace(s," % ")===Mr.replace(s," % ")}P===""?m=0:Xe(P,M)&&(Ke||(P=""),m=.2,z=!0),j&&(X===""?ee=0:Xe(X,J)&&(Ke||(X=""),ee=.2,re=!0)),l._meta?P=e.templateString(P,l._meta):y._meta&&(P=e.templateString(P,y._meta));var Me=P||X||Ke,xe;g||(g=e.ensureSingle(y._infolayer,"g","g-"+T),xe=y._hColorbarMoveTitle);var ce=g.selectAll("text."+T).data(Me?[0]:[]);ce.enter().append("text"),ce.text(P).attr("class",T),ce.exit().remove();var Re=null,$e=T+"-subtitle",rt=X||Ke;if(j&&rt&&(Re=g.selectAll("text."+$e).data(rt?[0]:[]),Re.enter().append("text"),Re.text(X).attr("class",$e),Re.exit().remove()),!Me)return g;function Je(ar,Mr){e.syncOrAsync([At,St],{title:ar,subtitle:Mr})}function At(ar){var Mr=ar.title,fr=ar.subtitle,dr;!u&&xe&&(u={}),u?(dr="",u.rotate&&(dr+="rotate("+[u.rotate,p.x,p.y]+")"),(u.offset||xe)&&(dr+=t(0,(u.offset||0)-(xe||0)))):dr=null,Mr.attr("transform",dr);function pt(be){if(be){var Pe=d.select(be.node().parentNode).select("."+$e);if(!Pe.empty()){var We=be.node().getBBox();if(We.height){var ct=We.y+We.height+c*ie;Pe.attr("y",ct)}}}}if(Mr.style("opacity",m*o.opacity(L)).call(r.font,{color:o.rgb(L),size:d.round(O,2),family:B,weight:N,style:U,variant:Z,textcase:Q,shadow:oe,lineposition:ue}).attr(p).call(a.convertToTspans,h,pt),fr){var ze=g.select("."+T+"-math-group"),Ge=Mr.node().getBBox(),Oe=ze.node()?ze.node().getBBox():void 0,ve=Oe?Oe.y+Oe.height+c*ie:Ge.y+Ge.height+f*ie,ge=e.extendFlat({},p,{y:ve});fr.attr("transform",dr),fr.style("opacity",ee*o.opacity(fe)).call(r.font,{color:o.rgb(fe),size:d.round(ie,2),family:ae,weight:we,style:Ae,variant:Fe,textcase:Ce,shadow:et,lineposition:qe}).attr(ge).call(a.convertToTspans,h)}return A.previousPromises(h)}function St(ar){var Mr=ar.title,fr=d.select(Mr.node().parentNode);if(w&&w.selection&&w.side&&P){fr.attr("transform",null);var dr=n[w.side],pt=w.side==="left"||w.side==="top"?-1:1,ze=x(w.pad)?w.pad:2,Ge=r.bBox(fr.node()),Oe={t:0,b:0,l:0,r:0},ve=h._fullLayout._reservedMargin;for(var ge in ve)for(var be in ve[ge]){var Pe=ve[ge][be];Oe[be]=Math.max(Oe[be],Pe)}var We={left:Oe.l,top:Oe.t,right:y.width-Oe.r,bottom:y.height-Oe.b},ct=w.maxShift||pt*(We[w.side]-Ge[w.side]),_t=0;if(ct<0)_t=ct;else{var Mt=w.offsetLeft||0,Nt=w.offsetTop||0;Ge.left-=Mt,Ge.right-=Mt,Ge.top-=Nt,Ge.bottom-=Nt,w.selection.each(function(){var qt=r.bBox(this);e.bBoxIntersect(Ge,qt,ze)&&(_t=Math.max(_t,pt*(qt[w.side]-Ge[dr])+ze))}),_t=Math.min(ct,_t),b._titleScoot=Math.abs(_t)}if(_t>0||ct<0){var Bt={left:[-_t,0],right:[_t,0],top:[0,-_t],bottom:[0,_t]}[w.side];fr.attr("transform",t(Bt[0],Bt[1]))}}}ce.call(Je,Re);function Rt(ar,Mr){ar.text(Mr).on("mouseover.opacity",function(){d.select(this).transition().duration(i.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){d.select(this).transition().duration(i.HIDE_PLACEHOLDER).style("opacity",0)})}if(Ke&&(P?ce.on(".opacity",null):(Rt(ce,M),z=!0),ce.call(a.makeEditable,{gd:h}).on("edit",function(ar){_!==void 0?E.call("_guiRestyle",h,S,ar,_):E.call("_guiRelayout",h,S,ar)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Je)}).on("input",function(ar){this.text(ar||" ").call(a.positionText,p.x,p.y)}),j)){if(j&&!P){var Ut=ce.node().getBBox(),ir=Ut.y+Ut.height+f*ie;Re.attr("y",ir)}X?Re.on(".opacity",null):(Rt(Re,J),re=!0),Re.call(a.makeEditable,{gd:h}).on("edit",function(ar){E.call("_guiRelayout",h,"title.subtitle.text",ar)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Je)}).on("input",function(ar){this.text(ar||" ").call(a.positionText,Re.attr("x"),Re.attr("y"))})}return ce.classed("js-placeholder",z),Re&&Re.classed("js-placeholder",re),g}G.exports={draw:v,SUBTITLE_PADDING_EM:f,SUBTITLE_PADDING_MATHJAX_EM:c}}}),Uv=He({"src/plots/cartesian/set_convert.js"(Y,G){var d=Qn(),x=Xl().utcFormat,A=Gr(),E=A.numberFormat,e=Hi(),t=A.cleanNumber,r=A.ms2DateTime,o=A.dateTime2ms,a=A.ensureNumber,i=A.isArrayOrTypedArray,n=lo(),s=n.FP_SAFE,c=n.BADNUM,f=n.LOG_CLIP,v=n.ONEWEEK,h=n.ONEDAY,T=n.ONEHOUR,l=n.ONEMIN,y=n.ONESEC,b=oc(),S=Ef(),M=S.HOUR_PATTERN,_=S.WEEKDAY_PATTERN;function w(u){return Math.pow(10,u)}function p(u){return u!=null}G.exports=function(g,m){m=m||{};var R=g._id||"x",P=R.charAt(0);function z(X,re){if(X>0)return Math.log(X)/Math.LN10;if(X<=0&&re&&g.range&&g.range.length===2){var ee=g.range[0],q=g.range[1];return .5*(ee+q-2*f*Math.abs(ee-q))}else return c}function F(X,re,ee,q){if((q||{}).msUTC&&e(X))return+X;var ae=o(X,ee||g.calendar);if(ae===c)if(e(X)){X=+X;var ie=Math.floor(A.mod(X+.05,1)*10),fe=Math.round(X-ie/10);ae=o(new Date(fe))+ie/10}else return c;return ae}function B(X,re,ee){return r(X,re,ee||g.calendar)}function O(X){return g._categories[Math.round(X)]}function L(X){if(p(X)){if(g._categoriesMap===void 0&&(g._categoriesMap={}),g._categoriesMap[X]!==void 0)return g._categoriesMap[X];g._categories.push(typeof X=="number"?String(X):X);var re=g._categories.length-1;return g._categoriesMap[X]=re,re}return c}function N(X,re){for(var ee=new Array(re),q=0;qg.range[1]&&(ee=!ee);for(var q=ee?-1:1,ae=q*X,ie=0,fe=0;feAe)ie=fe+1;else{ie=ae<(we+Ae)/2?fe:fe+1;break}}var Fe=g._B[ie]||0;return isFinite(Fe)?ue(X,g._m2,Fe):0},j=function(X){var re=g._rangebreaks.length;if(!re)return oe(X,g._m,g._b);for(var ee=0,q=0;qg._rangebreaks[q].pmax&&(ee=q+1);return oe(X,g._m2,g._B[ee])}}g.c2l=g.type==="log"?z:a,g.l2c=g.type==="log"?w:a,g.l2p=le,g.p2l=j,g.c2p=g.type==="log"?function(X,re){return le(z(X,re))}:le,g.p2c=g.type==="log"?function(X){return w(j(X))}:j,["linear","-"].indexOf(g.type)!==-1?(g.d2r=g.r2d=g.d2c=g.r2c=g.d2l=g.r2l=t,g.c2d=g.c2r=g.l2d=g.l2r=a,g.d2p=g.r2p=function(X){return g.l2p(t(X))},g.p2d=g.p2r=j,g.cleanPos=a):g.type==="log"?(g.d2r=g.d2l=function(X,re){return z(t(X),re)},g.r2d=g.r2c=function(X){return w(t(X))},g.d2c=g.r2l=t,g.c2d=g.l2r=a,g.c2r=z,g.l2d=w,g.d2p=function(X,re){return g.l2p(g.d2r(X,re))},g.p2d=function(X){return w(j(X))},g.r2p=function(X){return g.l2p(t(X))},g.p2r=j,g.cleanPos=a):g.type==="date"?(g.d2r=g.r2d=A.identity,g.d2c=g.r2c=g.d2l=g.r2l=F,g.c2d=g.c2r=g.l2d=g.l2r=B,g.d2p=g.r2p=function(X,re,ee){return g.l2p(F(X,0,ee))},g.p2d=g.p2r=function(X,re,ee){return B(j(X),re,ee)},g.cleanPos=function(X){return A.cleanDate(X,c,g.calendar)}):g.type==="category"?(g.d2c=g.d2l=L,g.r2d=g.c2d=g.l2d=O,g.d2r=g.d2l_noadd=Z,g.r2c=function(X){var re=Q(X);return re!==void 0?re:g.fraction2r(.5)},g.l2r=g.c2r=a,g.r2l=Q,g.d2p=function(X){return g.l2p(g.r2c(X))},g.p2d=function(X){return O(j(X))},g.r2p=g.d2p,g.p2r=j,g.cleanPos=function(X){return typeof X=="string"&&X!==""?X:a(X)}):g.type==="multicategory"&&(g.r2d=g.c2d=g.l2d=O,g.d2r=g.d2l_noadd=Z,g.r2c=function(X){var re=Z(X);return re!==void 0?re:g.fraction2r(.5)},g.r2c_just_indices=U,g.l2r=g.c2r=a,g.r2l=Z,g.d2p=function(X){return g.l2p(g.r2c(X))},g.p2d=function(X){return O(j(X))},g.r2p=g.d2p,g.p2r=j,g.cleanPos=function(X){return Array.isArray(X)||typeof X=="string"&&X!==""?X:a(X)},g.setupMultiCategory=function(X){var re=g._traceIndices,ee,q,ae=g._matchGroup;if(ae&&g._categories.length===0){for(var ie in ae)if(ie!==R){var fe=m[b.id2name(ie)];re=re.concat(fe._traceIndices)}}var we=[[0,{}],[0,{}]],Ae=[];for(ee=0;eefe[1]&&(q[ie?0:1]=ee),q[0]===q[1]){var we=g.l2r(re),Ae=g.l2r(ee);if(re!==void 0){var Fe=we+1;ee!==void 0&&(Fe=Math.min(Fe,Ae)),q[ie?1:0]=Fe}if(ee!==void 0){var Ce=Ae+1;re!==void 0&&(Ce=Math.max(Ce,we)),q[ie?0:1]=Ce}}}},g.cleanRange=function(X,re){g._cleanRange(X,re),g.limitRange(X)},g._cleanRange=function(X,re){re||(re={}),X||(X="range");var ee=A.nestedProperty(g,X).get(),q,ae;if(g.type==="date"?ae=A.dfltRange(g.calendar):P==="y"?ae=S.DFLTRANGEY:g._name==="realaxis"?ae=[0,1]:ae=re.dfltRange||S.DFLTRANGEX,ae=ae.slice(),(g.rangemode==="tozero"||g.rangemode==="nonnegative")&&(ae[0]=0),!ee||ee.length!==2){A.nestedProperty(g,X).set(ae);return}var ie=ee[0]===null,fe=ee[1]===null;for(g.type==="date"&&!g.autorange&&(ee[0]=A.cleanDate(ee[0],c,g.calendar),ee[1]=A.cleanDate(ee[1],c,g.calendar)),q=0;q<2;q++)if(g.type==="date"){if(!A.isDateTime(ee[q],g.calendar)){g[X]=ae;break}if(g.r2l(ee[0])===g.r2l(ee[1])){var we=A.constrain(g.r2l(ee[0]),A.MIN_MS+1e3,A.MAX_MS-1e3);ee[0]=g.l2r(we-1e3),ee[1]=g.l2r(we+1e3);break}}else{if(!e(ee[q]))if(!(ie||fe)&&e(ee[1-q]))ee[q]=ee[1-q]*(q?10:.1);else{g[X]=ae;break}if(ee[q]<-s?ee[q]=-s:ee[q]>s&&(ee[q]=s),ee[0]===ee[1]){var Ae=Math.max(1,Math.abs(ee[0]*1e-6));ee[0]-=Ae,ee[1]+=Ae}}},g.setScale=function(X){var re=m._size;if(g.overlaying){var ee=b.getFromId({_fullLayout:m},g.overlaying);g.domain=ee.domain}var q=X&&g._r?"_r":"range",ae=g.calendar;g.cleanRange(q);var ie=g.r2l(g[q][0],ae),fe=g.r2l(g[q][1],ae),we=P==="y";if(we?(g._offset=re.t+(1-g.domain[1])*re.h,g._length=re.h*(g.domain[1]-g.domain[0]),g._m=g._length/(ie-fe),g._b=-g._m*fe):(g._offset=re.l+g.domain[0]*re.w,g._length=re.w*(g.domain[1]-g.domain[0]),g._m=g._length/(fe-ie),g._b=-g._m*ie),g._rangebreaks=[],g._lBreaks=0,g._m2=0,g._B=[],g.rangebreaks){var Ae,Fe;if(g._rangebreaks=g.locateBreaks(Math.min(ie,fe),Math.max(ie,fe)),g._rangebreaks.length){for(Ae=0;Aefe&&(Ce=!Ce),Ce&&g._rangebreaks.reverse();var qe=Ce?-1:1;for(g._m2=qe*g._length/(Math.abs(fe-ie)-g._lBreaks),g._B.push(-g._m2*(we?fe:ie)),Ae=0;Aeae&&(ae+=7,ieae&&(ae+=24,ie=q&&ie=q&&X=Je.min&&(ceJe.max&&(Je.max=Re),$e=!1)}$e&&fe.push({min:ce,max:Re})}};for(ee=0;eey*2}function n(f){return Math.max(1,(f-1)/1e3)}function s(f,v){for(var h=f.length,T=n(h),l=0,y=0,b={},S=0;Sl*2}function c(f){return E(f[0])&&E(f[1])}}}),_v=He({"src/plots/cartesian/autorange.js"(Y,G){var d=Qn(),x=Hi(),A=Gr(),E=lo().FP_SAFE,e=Ei(),t=vo(),r=oc(),o=r.getFromId,a=r.isLinked;G.exports={applyAutorangeOptions:g,getAutoRange:i,makePadFn:s,doAutoRange:h,findExtremes:T,concatExtremes:v};function i(m,R){var P,z,F=[],B=m._fullLayout,O=s(B,R,0),L=s(B,R,1),N=v(m,R),U=N.min,Z=N.max;if(U.length===0||Z.length===0)return A.simpleMap(R.range,R.r2l);var Q=U[0].val,ue=Z[0].val;for(P=1;P0&&(Ae=re-O(ae)-L(ie),Ae>ee?Fe/Ae>q&&(fe=ae,we=ie,q=Fe/Ae):Fe/re>q&&(fe={val:ae.val,nopad:1},we={val:ie.val,nopad:1},q=Fe/re));function Ce(Xe,Me){return Math.max(Xe,L(Me))}if(Q===ue){var qe=Q-1,et=Q+1;if($)if(Q===0)F=[0,1];else{var Qe=(Q>0?Z:U).reduce(Ce,0),Ke=Q/(1-Math.min(.5,Qe/re));F=Q>0?[0,Ke]:[Ke,0]}else X?F=[Math.max(0,qe),Math.max(1,et)]:F=[qe,et]}else $?(fe.val>=0&&(fe={val:0,nopad:1}),we.val<=0&&(we={val:0,nopad:1})):X&&(fe.val-q*O(fe)<0&&(fe={val:0,nopad:1}),we.val<=0&&(we={val:1,nopad:1})),q=(we.val-fe.val-n(R,ae.val,ie.val))/(re-O(fe)-L(we)),F=[fe.val-q*O(fe),we.val+q*L(we)];return F=g(F,R),R.limitRange&&R.limitRange(),le&&F.reverse(),A.simpleMap(F,R.l2r||Number)}function n(m,R,P){var z=0;if(m.rangebreaks)for(var F=m.locateBreaks(R,P),B=0;B0?P.ppadplus:P.ppadminus)||P.ppad||0),ae=ee((m._m>0?P.ppadminus:P.ppadplus)||P.ppad||0),ie=ee(P.vpadplus||P.vpad),fe=ee(P.vpadminus||P.vpad);if(!U){if(X=1/0,re=-1/0,N)for(Q=0;Q0&&(X=ue),ue>re&&ue-E&&(X=ue),ue>re&&ue=Fe;Q--)Ae(Q);return{min:z,max:F,opts:P}}function l(m,R,P,z){b(m,R,P,z,M)}function y(m,R,P,z){b(m,R,P,z,_)}function b(m,R,P,z,F){for(var B=z.tozero,O=z.extrapad,L=!0,N=0;N=P&&(U.extrapad||!O)){L=!1;break}else F(R,U.val)&&U.pad<=P&&(O||!U.extrapad)&&(m.splice(N,1),N--)}if(L){var Z=B&&R===0;m.push({val:R,pad:Z?0:P,extrapad:Z?!1:O})}}function S(m){return x(m)&&Math.abs(m)=R}function w(m,R){var P=R.autorangeoptions;return P&&P.minallowed!==void 0&&u(R,P.minallowed,P.maxallowed)?P.minallowed:P&&P.clipmin!==void 0&&u(R,P.clipmin,P.clipmax)?Math.max(m,R.d2l(P.clipmin)):m}function p(m,R){var P=R.autorangeoptions;return P&&P.maxallowed!==void 0&&u(R,P.minallowed,P.maxallowed)?P.maxallowed:P&&P.clipmax!==void 0&&u(R,P.clipmin,P.clipmax)?Math.min(m,R.d2l(P.clipmax)):m}function u(m,R,P){return R!==void 0&&P!==void 0?(R=m.d2l(R),P=m.d2l(P),R=N&&(B=N,P=N),O<=N&&(O=N,z=N)}}return P=w(P,R),z=p(z,R),[P,z]}}}),io=He({"src/plots/cartesian/axes.js"(Y,G){var d=Qn(),x=Hi(),A=yu(),E=Ei(),e=Gr(),t=e.strTranslate,r=yl(),o=kp(),a=Ai(),i=vo(),n=jf(),s=wb(),c=lo(),f=c.ONEMAXYEAR,v=c.ONEAVGYEAR,h=c.ONEMINYEAR,T=c.ONEMAXQUARTER,l=c.ONEAVGQUARTER,y=c.ONEMINQUARTER,b=c.ONEMAXMONTH,S=c.ONEAVGMONTH,M=c.ONEMINMONTH,_=c.ONEWEEK,w=c.ONEDAY,p=w/2,u=c.ONEHOUR,g=c.ONEMIN,m=c.ONESEC,R=c.ONEMILLI,P=c.ONEMICROSEC,z=c.MINUS_SIGN,F=c.BADNUM,B={K:"zeroline"},O={K:"gridline",L:"path"},L={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},U={K:"tick",L:"text"},Z={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},Q=df(),ue=Q.MID_SHIFT,oe=Q.CAP_SHIFT,le=Q.LINE_SPACING,j=Q.OPPOSITE_SIDE,J=3,$=G.exports={};$.setConvert=Uv();var X=N0(),re=oc(),ee=re.idSort,q=re.isLinked;$.id2name=re.id2name,$.name2id=re.name2id,$.cleanId=re.cleanId,$.list=re.list,$.listIds=re.listIds,$.getFromId=re.getFromId,$.getFromTrace=re.getFromTrace;var ae=_v();$.getAutoRange=ae.getAutoRange,$.findExtremes=ae.findExtremes;var ie=1e-4;function fe(dt){var vt=(dt[1]-dt[0])*ie;return[dt[0]-vt,dt[1]+vt]}$.coerceRef=function(dt,vt,Lr,Er,_r,yr){var kr=Er.charAt(Er.length-1),zr=Lr._fullLayout._subplots[kr+"axis"],Pr=Er+"ref",Hr={};return _r||(_r=zr[0]||(typeof yr=="string"?yr:yr[0])),yr||(yr=_r),zr=zr.concat(zr.map(function(Zr){return Zr+" domain"})),Hr[Pr]={valType:"enumerated",values:zr.concat(yr?typeof yr=="string"?[yr]:yr:[]),dflt:_r},e.coerce(dt,vt,Hr,Pr)},$.getRefType=function(dt){return dt===void 0?dt:dt==="paper"?"paper":dt==="pixel"?"pixel":/( domain)$/.test(dt)?"domain":"range"},$.coercePosition=function(dt,vt,Lr,Er,_r,yr){var kr,zr,Pr=$.getRefType(Er);if(Pr!=="range")kr=e.ensureNumber,zr=Lr(_r,yr);else{var Hr=$.getFromId(vt,Er);yr=Hr.fraction2r(yr),zr=Lr(_r,yr),kr=Hr.cleanPos}dt[_r]=kr(zr)},$.cleanPosition=function(dt,vt,Lr){var Er=Lr==="paper"||Lr==="pixel"?e.ensureNumber:$.getFromId(vt,Lr).cleanPos;return Er(dt)},$.redrawComponents=function(dt,vt){vt=vt||$.listIds(dt);var Lr=dt._fullLayout;function Er(_r,yr,kr,zr){for(var Pr=E.getComponentMethod(_r,yr),Hr={},Zr=0;Zr2e-6||((Lr-dt._forceTick0)/dt._minDtick%1+1.000001)%1>2e-6)&&(dt._minDtick=0))},$.saveRangeInitial=function(dt,vt){for(var Lr=$.list(dt,"",!0),Er=!1,_r=0;_rJr*.3||Hr(Er)||Hr(_r))){var wt=Lr.dtick/2;dt+=dt+wtkr){var zr=Number(Lr.substr(1));yr.exactYears>kr&&zr%12===0?dt=$.tickIncrement(dt,"M6","reverse")+w*1.5:yr.exactMonths>kr?dt=$.tickIncrement(dt,"M1","reverse")+w*15.5:dt-=p;var Pr=$.tickIncrement(dt,Lr);if(Pr<=Er)return Pr}return dt}$.prepMinorTicks=function(dt,vt,Lr){if(!vt.minor.dtick){delete dt.dtick;var Er=vt.dtick&&x(vt._tmin),_r;if(Er){var yr=$.tickIncrement(vt._tmin,vt.dtick,!0);_r=[vt._tmin,yr*.99+vt._tmin*.01]}else{var kr=e.simpleMap(vt.range,vt.r2l);_r=[kr[0],.8*kr[0]+.2*kr[1]]}if(dt.range=e.simpleMap(_r,vt.l2r),dt._isMinor=!0,$.prepTicks(dt,Lr),Er){var zr=x(vt.dtick),Pr=x(dt.dtick),Hr=zr?vt.dtick:+vt.dtick.substring(1),Zr=Pr?dt.dtick:+dt.dtick.substring(1);zr&&Pr?et(Hr,Zr)?Hr===2*_&&Zr===2*w&&(dt.dtick=_):Hr===2*_&&Zr===3*w?dt.dtick=_:Hr===_&&!(vt._input.minor||{}).nticks?dt.dtick=w:Qe(Hr/Zr,2.5)?dt.dtick=Hr/2:dt.dtick=Hr:String(vt.dtick).charAt(0)==="M"?Pr?dt.dtick="M1":et(Hr,Zr)?Hr>=12&&Zr===2&&(dt.dtick="M3"):dt.dtick=vt.dtick:String(dt.dtick).charAt(0)==="L"?String(vt.dtick).charAt(0)==="L"?et(Hr,Zr)||(dt.dtick=Qe(Hr/Zr,2.5)?vt.dtick/2:vt.dtick):dt.dtick="D1":dt.dtick==="D2"&&+vt.dtick>1&&(dt.dtick=1)}dt.range=vt.range}vt.minor._tick0Init===void 0&&(dt.tick0=vt.tick0)};function et(dt,vt){return Math.abs((dt/vt+.5)%1-.5)<.001}function Qe(dt,vt){return Math.abs(dt/vt-1)<.001}$.prepTicks=function(dt,vt){var Lr=e.simpleMap(dt.range,dt.r2l,void 0,void 0,vt);if(dt.tickmode==="auto"||!dt.dtick){var Er=dt.nticks,_r;Er||(dt.type==="category"||dt.type==="multicategory"?(_r=dt.tickfont?e.bigFont(dt.tickfont.size||12):15,Er=dt._length/_r):(_r=dt._id.charAt(0)==="y"?40:80,Er=e.constrain(dt._length/_r,4,9)+1),dt._name==="radialaxis"&&(Er*=2)),dt.minor&&dt.minor.tickmode!=="array"||dt.tickmode==="array"&&(Er*=100),dt._roughDTick=Math.abs(Lr[1]-Lr[0])/Er,$.autoTicks(dt,dt._roughDTick),dt._minDtick>0&&dt.dtick0?(yr=Er-1,kr=Er):(yr=Er,kr=Er);var zr=dt[yr].value,Pr=dt[kr].value,Hr=Math.abs(Pr-zr),Zr=Lr||Hr,Jr=0;Zr>=h?Hr>=h&&Hr<=f?Jr=Hr:Jr=v:Lr===l&&Zr>=y?Hr>=y&&Hr<=T?Jr=Hr:Jr=l:Zr>=M?Hr>=M&&Hr<=b?Jr=Hr:Jr=S:Lr===_&&Zr>=_?Jr=_:Zr>=w?Jr=w:Lr===p&&Zr>=p?Jr=p:Lr===u&&Zr>=u&&(Jr=u);var wt;Jr>=Hr&&(Jr=Hr,wt=!0);var Qt=_r+Jr;if(vt.rangebreaks&&Jr>0){for(var mr=84,$r=0,oa=0;oa_&&(Jr=Hr)}(Jr>0||Er===0)&&(dt[Er].periodX=_r+Jr/2)}}$.calcTicks=function(vt,Lr){for(var Er=vt.type,_r=vt.calendar,yr=vt.ticklabelstep,kr=vt.ticklabelmode==="period",zr=vt.range[0]>vt.range[1],Pr=!vt.ticklabelindex||e.isArrayOrTypedArray(vt.ticklabelindex)?vt.ticklabelindex:[vt.ticklabelindex],Hr=e.simpleMap(vt.range,vt.r2l,void 0,void 0,Lr),Zr=Hr[1]=(ra?0:1);pa--){var pn=!pa;pa?(vt._dtickInit=vt.dtick,vt._tick0Init=vt.tick0):(vt.minor._dtickInit=vt.minor.dtick,vt.minor._tick0Init=vt.minor.tick0);var Ga=pa?vt:e.extendFlat({},vt,vt.minor);if(pn?$.prepMinorTicks(Ga,vt,Lr):$.prepTicks(Ga,Lr),Ga.tickmode==="array"){pa?(oa=[],mr=Re(vt,!pn)):(Sa=[],$r=Re(vt,!pn));continue}if(Ga.tickmode==="sync"){oa=[],mr=ce(vt);continue}var qn=fe(Hr),Vn=qn[0],di=qn[1],yi=x(Ga.dtick),Ci=Er==="log"&&!(yi||Ga.dtick.charAt(0)==="L"),ci=$.tickFirst(Ga,Lr);if(pa){if(vt._tmin=ci,ci=di:mi<=di;mi=$.tickIncrement(mi,Wo,Zr,_r)){if(pa&&uo++,Ga.rangebreaks&&!Zr){if(mi=wt)break}if(oa.length>Qt||mi===ei)break;ei=mi;var li={value:mi};pa?(Ci&&mi!==(mi|0)&&(li.simpleLabel=!0),yr>1&&uo%yr&&(li.skipLabel=!0),oa.push(li)):(li.minor=!0,Sa.push(li))}}if(!Sa||Sa.length<2)Pr=!1;else{var Ii=(Sa[1].value-Sa[0].value)*(zr?-1:1);Oa(Ii,vt.tickformat)||(Pr=!1)}if(!Pr)ya=oa;else{var xi=oa.concat(Sa);kr&&oa.length&&(xi=xi.slice(1)),xi=xi.sort(function(Pi,zo){return Pi.value-zo.value}).filter(function(Pi,zo,wo){return zo===0||Pi.value!==wo[zo-1].value});var Ao=xi.map(function(Pi,zo){return Pi.minor===void 0&&!Pi.skipLabel?zo:null}).filter(function(Pi){return Pi!==null});Ao.forEach(function(Pi){Pr.map(function(zo){var wo=Pi+zo;wo>=0&&wo-1;Qa--){if(oa[Qa].drop){oa.splice(Qa,1);continue}oa[Qa].value=Ur(oa[Qa].value,vt);var Ui=vt.c2p(oa[Qa].value);(Jn?ds>Ui-Os:dswt||biwt&&(wo.periodX=wt),bi_r&&wtv)vt/=v,Er=_r(10),dt.dtick="M"+12*ir(vt,Er,$e);else if(yr>S)vt/=S,dt.dtick="M"+ir(vt,1,rt);else if(yr>w){if(dt.dtick=ir(vt,w,dt._hasDayOfWeekBreaks?[1,2,7,14]:At),!Lr){var kr=$.getTickFormat(dt),zr=dt.ticklabelmode==="period";zr&&(dt._rawTick0=dt.tick0),/%[uVW]/.test(kr)?dt.tick0=e.dateTick0(dt.calendar,2):dt.tick0=e.dateTick0(dt.calendar,1),zr&&(dt._dowTick0=dt.tick0)}}else yr>u?dt.dtick=ir(vt,u,rt):yr>g?dt.dtick=ir(vt,g,Je):yr>m?dt.dtick=ir(vt,m,Je):(Er=_r(10),dt.dtick=ir(vt,Er,$e))}else if(dt.type==="log"){dt.tick0=0;var Pr=e.simpleMap(dt.range,dt.r2l);if(dt._isMinor&&(vt*=1.5),vt>.7)dt.dtick=Math.ceil(vt);else if(Math.abs(Pr[1]-Pr[0])<1){var Hr=1.5*Math.abs((Pr[1]-Pr[0])/vt);vt=Math.abs(Math.pow(10,Pr[1])-Math.pow(10,Pr[0]))/Hr,Er=_r(10),dt.dtick="L"+ir(vt,Er,$e)}else dt.dtick=vt>.3?"D2":"D1"}else dt.type==="category"||dt.type==="multicategory"?(dt.tick0=0,dt.dtick=Math.ceil(Math.max(vt,1))):na(dt)?(dt.tick0=0,Er=1,dt.dtick=ir(vt,Er,Ut)):(dt.tick0=0,Er=_r(10),dt.dtick=ir(vt,Er,$e));if(dt.dtick===0&&(dt.dtick=1),!x(dt.dtick)&&typeof dt.dtick!="string"){var Zr=dt.dtick;throw dt.dtick=1,"ax.dtick error: "+String(Zr)}};function ar(dt){var vt=dt.dtick;if(dt._tickexponent=0,!x(vt)&&typeof vt!="string"&&(vt=1),(dt.type==="category"||dt.type==="multicategory")&&(dt._tickround=null),dt.type==="date"){var Lr=dt.r2l(dt.tick0),Er=dt.l2r(Lr).replace(/(^-|i)/g,""),_r=Er.length;if(String(vt).charAt(0)==="M")_r>10||Er.substr(5)!=="01-01"?dt._tickround="d":dt._tickround=+vt.substr(1)%12===0?"y":"m";else if(vt>=w&&_r<=10||vt>=w*15)dt._tickround="d";else if(vt>=g&&_r<=16||vt>=u)dt._tickround="M";else if(vt>=m&&_r<=19||vt>=g)dt._tickround="S";else{var yr=dt.l2r(Lr+vt).replace(/^-/,"").length;dt._tickround=Math.max(_r,yr)-20,dt._tickround<0&&(dt._tickround=4)}}else if(x(vt)||vt.charAt(0)==="L"){var kr=dt.range.map(dt.r2d||Number);x(vt)||(vt=Number(vt.substr(1))),dt._tickround=2-Math.floor(Math.log(vt)/Math.LN10+.01);var zr=Math.max(Math.abs(kr[0]),Math.abs(kr[1])),Pr=Math.floor(Math.log(zr)/Math.LN10+.01),Hr=dt.minexponent===void 0?3:dt.minexponent;Math.abs(Pr)>Hr&&(be(dt.exponentformat)&&!Pe(Pr)?dt._tickexponent=3*Math.round((Pr-1)/3):dt._tickexponent=Pr)}else dt._tickround=null}$.tickIncrement=function(dt,vt,Lr,Er){var _r=Lr?-1:1;if(x(vt))return e.increment(dt,_r*vt);var yr=vt.charAt(0),kr=_r*Number(vt.substr(1));if(yr==="M")return e.incrementMonth(dt,kr,Er);if(yr==="L")return Math.log(Math.pow(10,dt)+kr)/Math.LN10;if(yr==="D"){var zr=vt==="D2"?Rt:St,Pr=dt+_r*.01,Hr=e.roundUp(e.mod(Pr,1),zr,Lr);return Math.floor(Pr)+Math.log(d.round(Math.pow(10,Hr),1))/Math.LN10}throw"unrecognized dtick "+String(vt)},$.tickFirst=function(dt,vt){var Lr=dt.r2l||Number,Er=e.simpleMap(dt.range,Lr,void 0,void 0,vt),_r=Er[1]=0&&Sa<=dt._length?oa:null};if(yr&&e.isArrayOrTypedArray(dt.ticktext)){var Jr=e.simpleMap(dt.range,dt.r2l),wt=(Math.abs(Jr[1]-Jr[0])-(dt._lBreaks||0))/1e4;for(Hr=0;Hr"+zr;else{var Hr=ga(dt),Zr=dt._trueSide||dt.side;(!Hr&&Zr==="top"||Hr&&Zr==="bottom")&&(kr+="
")}vt.text=kr}function dr(dt,vt,Lr,Er,_r){var yr=dt.dtick,kr=vt.x,zr=dt.tickformat,Pr=typeof yr=="string"&&yr.charAt(0);if(_r==="never"&&(_r=""),Er&&Pr!=="L"&&(yr="L3",Pr="L"),zr||Pr==="L")vt.text=We(Math.pow(10,kr),dt,_r,Er);else if(x(yr)||Pr==="D"&&e.mod(kr+.01,1)<.1){var Hr=Math.round(kr),Zr=Math.abs(Hr),Jr=dt.exponentformat;Jr==="power"||be(Jr)&&Pe(Hr)?(Hr===0?vt.text=1:Hr===1?vt.text="10":vt.text="10"+(Hr>1?"":z)+Zr+"",vt.fontSize*=1.25):(Jr==="e"||Jr==="E")&&Zr>2?vt.text="1"+Jr+(Hr>0?"+":z)+Zr:(vt.text=We(Math.pow(10,kr),dt,"","fakehover"),yr==="D1"&&dt._id.charAt(0)==="y"&&(vt.dy-=vt.fontSize/6))}else if(Pr==="D")vt.text=String(Math.round(Math.pow(10,e.mod(kr,1)))),vt.fontSize*=.75;else throw"unrecognized dtick "+String(yr);if(dt.dtick==="D1"){var wt=String(vt.text).charAt(0);(wt==="0"||wt==="1")&&(dt._id.charAt(0)==="y"?vt.dx-=vt.fontSize/4:(vt.dy+=vt.fontSize/2,vt.dx+=(dt.range[1]>dt.range[0]?1:-1)*vt.fontSize*(kr<0?.5:.25)))}}function pt(dt,vt){var Lr=dt._categories[Math.round(vt.x)];Lr===void 0&&(Lr=""),vt.text=String(Lr)}function ze(dt,vt,Lr){var Er=Math.round(vt.x),_r=dt._categories[Er]||[],yr=_r[1]===void 0?"":String(_r[1]),kr=_r[0]===void 0?"":String(_r[0]);Lr?vt.text=kr+" - "+yr:(vt.text=yr,vt.text2=kr)}function Ge(dt,vt,Lr,Er,_r){_r==="never"?_r="":dt.showexponent==="all"&&Math.abs(vt.x/dt.dtick)<1e-6&&(_r="hide"),vt.text=We(vt.x,dt,_r,Er)}function Oe(dt,vt,Lr,Er,_r){if(dt.thetaunit==="radians"&&!Lr){var yr=vt.x/180;if(yr===0)vt.text="0";else{var kr=ve(yr);if(kr[1]>=100)vt.text=We(e.deg2rad(vt.x),dt,_r,Er);else{var zr=vt.x<0;kr[1]===1?kr[0]===1?vt.text="π":vt.text=kr[0]+"π":vt.text=["",kr[0],"","⁄","",kr[1],"","π"].join(""),zr&&(vt.text=z+vt.text)}}}else vt.text=We(vt.x,dt,_r,Er)}function ve(dt){function vt(zr,Pr){return Math.abs(zr-Pr)<=1e-6}function Lr(zr,Pr){return vt(Pr,0)?zr:Lr(Pr,zr%Pr)}function Er(zr){for(var Pr=1;!vt(Math.round(zr*Pr)/Pr,zr);)Pr*=10;return Pr}var _r=Er(dt),yr=dt*_r,kr=Math.abs(Lr(yr,_r));return[Math.round(yr/kr),Math.round(_r/kr)]}var ge=["f","p","n","μ","m","","k","M","G","T"];function be(dt){return dt==="SI"||dt==="B"}function Pe(dt){return dt>14||dt<-15}function We(dt,vt,Lr,Er){var _r=dt<0,yr=vt._tickround,kr=Lr||vt.exponentformat||"B",zr=vt._tickexponent,Pr=$.getTickFormat(vt),Hr=vt.separatethousands;if(Er){var Zr={exponentformat:kr,minexponent:vt.minexponent,dtick:vt.showexponent==="none"?vt.dtick:x(dt)&&Math.abs(dt)||1,range:vt.showexponent==="none"?vt.range.map(vt.r2d):[0,dt||1]};ar(Zr),yr=(Number(Zr._tickround)||0)+4,zr=Zr._tickexponent,vt.hoverformat&&(Pr=vt.hoverformat)}if(Pr)return vt._numFormat(Pr)(dt).replace(/-/g,z);var Jr=Math.pow(10,-yr)/2;if(kr==="none"&&(zr=0),dt=Math.abs(dt),dt"+mr+"":kr==="B"&&zr===9?dt+="B":be(kr)&&(dt+=ge[zr/3+5])}return _r?z+dt:dt}$.getTickFormat=function(dt){var vt;function Lr(Pr){return typeof Pr!="string"?Pr:Number(Pr.replace("M",""))*S}function Er(Pr,Hr){var Zr=["L","D"];if(typeof Pr==typeof Hr){if(typeof Pr=="number")return Pr-Hr;var Jr=Zr.indexOf(Pr.charAt(0)),wt=Zr.indexOf(Hr.charAt(0));return Jr===wt?Number(Pr.replace(/(L|D)/g,""))-Number(Hr.replace(/(L|D)/g,"")):Jr-wt}else return typeof Pr=="number"?1:-1}function _r(Pr,Hr,Zr){var Jr=Zr||function(mr){return mr},wt=Hr[0],Qt=Hr[1];return(!wt&&typeof wt!="number"||Jr(wt)<=Jr(Pr))&&(!Qt&&typeof Qt!="number"||Jr(Qt)>=Jr(Pr))}function yr(Pr,Hr){var Zr=Hr[0]===null,Jr=Hr[1]===null,wt=Er(Pr,Hr[0])>=0,Qt=Er(Pr,Hr[1])<=0;return(Zr||wt)&&(Jr||Qt)}var kr,zr;if(dt.tickformatstops&&dt.tickformatstops.length>0)switch(dt.type){case"date":case"linear":{for(vt=0;vt=0&&_r.unshift(_r.splice(Zr,1).shift())}});var zr={false:{left:0,right:0}};return e.syncOrAsync(_r.map(function(Pr){return function(){if(Pr){var Hr=$.getFromId(dt,Pr);Lr||(Lr={}),Lr.axShifts=zr,Lr.overlayingShiftedAx=kr;var Zr=$.drawOne(dt,Hr,Lr);return Hr._shiftPusher&&Pa(Hr,Hr._fullDepth||0,zr,!0),Hr._r=Hr.range.slice(),Hr._rl=e.simpleMap(Hr._r,Hr.r2l),Zr}}}))},$.drawOne=function(dt,vt,Lr){Lr=Lr||{};var Er=Lr.axShifts||{},_r=Lr.overlayingShiftedAx||[],yr,kr,zr;vt.setScale();var Pr=dt._fullLayout,Hr=vt._id,Zr=Hr.charAt(0),Jr=$.counterLetter(Hr),wt=Pr._plots[vt._mainSubplot];if(!wt)return;if(vt._shiftPusher=vt.autoshift||_r.indexOf(vt._id)!==-1||_r.indexOf(vt.overlaying)!==-1,vt._shiftPusher&vt.anchor==="free"){var Qt=vt.linewidth/2||0;vt.ticks==="inside"&&(Qt+=vt.ticklen),Pa(vt,Qt,Er,!0),Pa(vt,vt.shift||0,Er,!1)}(Lr.skipTitle!==!0||vt._shift===void 0)&&(vt._shift=sa(vt,Er));var mr=wt[Zr+"axislayer"],$r=vt._mainLinePosition,oa=$r+=vt._shift,Sa=vt._mainMirrorPosition,ya=vt._vals=$.calcTicks(vt),ra=[vt.mirror,oa,Sa].join("_");for(yr=0;yr0?wo.bottom-Pi:0,zo))));var Js=0,Ql=0;if(vt._shiftPusher&&(Js=Math.max(zo,wo.height>0?Rn==="l"?Pi-wo.left:wo.right-Pi:0),vt.title.text!==Pr._dfltTitle[Zr]&&(Ql=(vt._titleStandoff||0)+(vt._titleScoot||0),Rn==="l"&&(Ql+=da(vt))),vt._fullDepth=Math.max(Js,Ql)),vt.automargin){bi={x:0,y:0,r:0,l:0,t:0,b:0};var Ws=[0,1],Is=typeof vt._shift=="number"?vt._shift:0;if(Zr==="x"){if(Rn==="b"?bi[Rn]=vt._depth:(bi[Rn]=vt._depth=Math.max(wo.width>0?Pi-wo.top:0,zo),Ws.reverse()),wo.width>0){var Dl=wo.right-(vt._offset+vt._length);Dl>0&&(bi.xr=1,bi.r=Dl);var Xu=vt._offset-wo.left;Xu>0&&(bi.xl=0,bi.l=Xu)}}else if(Rn==="l"?(vt._depth=Math.max(wo.height>0?Pi-wo.left:0,zo),bi[Rn]=vt._depth-Is):(vt._depth=Math.max(wo.height>0?wo.right-Pi:0,zo),bi[Rn]=vt._depth+Is,Ws.reverse()),wo.height>0){var Lu=wo.bottom-(vt._offset+vt._length);Lu>0&&(bi.yb=0,bi.b=Lu);var Bu=vt._offset-wo.top;Bu>0&&(bi.yt=1,bi.t=Bu)}bi[Jr]=vt.anchor==="free"?vt.position:vt._anchorAxis.domain[Ws[0]],vt.title.text!==Pr._dfltTitle[Zr]&&(bi[Rn]+=da(vt)+(vt.title.standoff||0)),vt.mirror&&vt.anchor!=="free"&&(wl={x:0,y:0,r:0,l:0,t:0,b:0},wl[fo]=vt.linewidth,vt.mirror&&vt.mirror!==!0&&(wl[fo]+=zo),vt.mirror===!0||vt.mirror==="ticks"?wl[Jr]=vt._anchorAxis.domain[Ws[1]]:(vt.mirror==="all"||vt.mirror==="allticks")&&(wl[Jr]=[vt._counterDomainMin,vt._counterDomainMax][Ws[1]]))}Ks&&($l=E.getComponentMethod("rangeslider","autoMarginOpts")(dt,vt)),typeof vt.automargin=="string"&&(ct(bi,vt.automargin),ct(wl,vt.automargin)),A.autoMargin(dt,Ka(vt),bi),A.autoMargin(dt,Vt(vt),wl),A.autoMargin(dt,Lt(vt),$l)}),e.syncOrAsync(Mo)}};function ct(dt,vt){if(dt){var Lr=Object.keys(Z).reduce(function(Er,_r){return vt.indexOf(_r)!==-1&&Z[_r].forEach(function(yr){Er[yr]=1}),Er},{});Object.keys(dt).forEach(function(Er){Lr[Er]||(Er.length===1?dt[Er]=0:delete dt[Er])})}}function _t(dt,vt){var Lr=[],Er,_r=function(yr,kr){var zr=yr.xbnd[kr];zr!==null&&Lr.push(e.extendFlat({},yr,{x:zr}))};if(vt.length){for(Er=0;Erdt.range[1],zr=dt.ticklabelposition&&dt.ticklabelposition.indexOf("inside")!==-1,Pr=!zr;if(Lr){var Hr=kr?-1:1;Lr=Lr*Hr}if(Er){var Zr=dt.side,Jr=zr&&(Zr==="top"||Zr==="left")||Pr&&(Zr==="bottom"||Zr==="right")?1:-1;Er=Er*Jr}return dt._id.charAt(0)==="x"?function(wt){return t(_r+dt._offset+dt.l2p(qt(wt))+Lr,yr+Er)}:function(wt){return t(yr+Er,_r+dt._offset+dt.l2p(qt(wt))+Lr)}};function qt(dt){return dt.periodX!==void 0?dt.periodX:dt.x}function Zt(dt){var vt=dt.ticklabelposition||"",Lr=function(Qt){return vt.indexOf(Qt)!==-1},Er=Lr("top"),_r=Lr("left"),yr=Lr("right"),kr=Lr("bottom"),zr=Lr("inside"),Pr=kr||_r||Er||yr;if(!Pr&&!zr)return[0,0];var Hr=dt.side,Zr=Pr?(dt.tickwidth||0)/2:0,Jr=J,wt=dt.tickfont?dt.tickfont.size:12;return(kr||Er)&&(Zr+=wt*oe,Jr+=(dt.linewidth||0)/2),(_r||yr)&&(Zr+=(dt.linewidth||0)/2,Jr+=J),zr&&Hr==="top"&&(Jr-=wt*(1-oe)),(_r||Er)&&(Zr=-Zr),(Hr==="bottom"||Hr==="right")&&(Jr=-Jr),[Pr?Zr:0,zr?Jr:0]}$.makeTickPath=function(dt,vt,Lr,Er){Er||(Er={});var _r=Er.minor;if(_r&&!dt.minor)return"";var yr=Er.len!==void 0?Er.len:_r?dt.minor.ticklen:dt.ticklen,kr=dt._id.charAt(0),zr=(dt.linewidth||1)/2;return kr==="x"?"M0,"+(vt+zr*Lr)+"v"+yr*Lr:"M"+(vt+zr*Lr)+",0h"+yr*Lr},$.makeLabelFns=function(dt,vt,Lr){var Er=dt.ticklabelposition||"",_r=function(ci){return Er.indexOf(ci)!==-1},yr=_r("top"),kr=_r("left"),zr=_r("right"),Pr=_r("bottom"),Hr=Pr||kr||yr||zr,Zr=_r("inside"),Jr=Er==="inside"&&dt.ticks==="inside"||!Zr&&dt.ticks==="outside"&&dt.tickson!=="boundaries",wt=0,Qt=0,mr=Jr?dt.ticklen:0;if(Zr?mr*=-1:Hr&&(mr=0),Jr&&(wt+=mr,Lr)){var $r=e.deg2rad(Lr);wt=mr*Math.cos($r)+1,Qt=mr*Math.sin($r)}dt.showticklabels&&(Jr||dt.showline)&&(wt+=.2*dt.tickfont.size),wt+=(dt.linewidth||1)/2*(Zr?-1:1);var oa={labelStandoff:wt,labelShift:Qt},Sa,ya,ra,pa,pn=0,Ga=dt.side,qn=dt._id.charAt(0),Vn=dt.tickangle,di;if(qn==="x")di=!Zr&&Ga==="bottom"||Zr&&Ga==="top",pa=di?1:-1,Zr&&(pa*=-1),Sa=Qt*pa,ya=vt+wt*pa,ra=di?1:-.2,Math.abs(Vn)===90&&(Zr?ra+=ue:Vn===-90&&Ga==="bottom"?ra=oe:Vn===90&&Ga==="top"?ra=ue:ra=.5,pn=ue/2*(Vn/90)),oa.xFn=function(ci){return ci.dx+Sa+pn*ci.fontSize},oa.yFn=function(ci){return ci.dy+ya+ci.fontSize*ra},oa.anchorFn=function(ci,ei){if(Hr){if(kr)return"end";if(zr)return"start"}return!x(ei)||ei===0||ei===180?"middle":ei*pa<0!==Zr?"end":"start"},oa.heightFn=function(ci,ei,mi){return ei<-60||ei>60?-.5*mi:dt.side==="top"!==Zr?-mi:0};else if(qn==="y"){if(di=!Zr&&Ga==="left"||Zr&&Ga==="right",pa=di?1:-1,Zr&&(pa*=-1),Sa=wt,ya=Qt*pa,ra=0,!Zr&&Math.abs(Vn)===90&&(Vn===-90&&Ga==="left"||Vn===90&&Ga==="right"?ra=oe:ra=.5),Zr){var yi=x(Vn)?+Vn:0;if(yi!==0){var Ci=e.deg2rad(yi);pn=Math.abs(Math.sin(Ci))*oe*pa,ra=0}}oa.xFn=function(ci){return ci.dx+vt-(Sa+ci.fontSize*ra)*pa+pn*ci.fontSize},oa.yFn=function(ci){return ci.dy+ya+ci.fontSize*ue},oa.anchorFn=function(ci,ei){return x(ei)&&Math.abs(ei)===90?"middle":di?"end":"start"},oa.heightFn=function(ci,ei,mi){return dt.side==="right"&&(ei*=-1),ei<-30?-mi:ei<30?-.5*mi:0}}return oa};function lr(dt){return[dt.text,dt.x,dt.axInfo,dt.font,dt.fontSize,dt.fontColor].join("_")}$.drawTicks=function(dt,vt,Lr){Lr=Lr||{};var Er=vt._id+"tick",_r=[].concat(vt.minor&&vt.minor.ticks?Lr.vals.filter(function(kr){return kr.minor&&!kr.noTick}):[]).concat(vt.ticks?Lr.vals.filter(function(kr){return!kr.minor&&!kr.noTick}):[]),yr=Lr.layer.selectAll("path."+Er).data(_r,lr);yr.exit().remove(),yr.enter().append("path").classed(Er,1).classed("ticks",1).classed("crisp",Lr.crisp!==!1).each(function(kr){return a.stroke(d.select(this),kr.minor?vt.minor.tickcolor:vt.tickcolor)}).style("stroke-width",function(kr){return i.crispRound(dt,kr.minor?vt.minor.tickwidth:vt.tickwidth,1)+"px"}).attr("d",Lr.path).style("display",null),Aa(vt,[N]),yr.attr("transform",Lr.transFn)},$.drawGrid=function(dt,vt,Lr){if(Lr=Lr||{},vt.tickmode!=="sync"){var Er=vt._id+"grid",_r=vt.minor&&vt.minor.showgrid,yr=_r?Lr.vals.filter(function(Sa){return Sa.minor}):[],kr=vt.showgrid?Lr.vals.filter(function(Sa){return!Sa.minor}):[],zr=Lr.counterAxis;if(zr&&$.shouldShowZeroLine(dt,vt,zr))for(var Pr=vt.tickmode==="array",Hr=0;Hr=0;mr--){var $r=mr?wt:Qt;if($r){var oa=$r.selectAll("path."+Er).data(mr?kr:yr,lr);oa.exit().remove(),oa.enter().append("path").classed(Er,1).classed("crisp",Lr.crisp!==!1),oa.attr("transform",Lr.transFn).attr("d",Lr.path).each(function(Sa){return a.stroke(d.select(this),Sa.minor?vt.minor.gridcolor:vt.gridcolor||"#ddd")}).style("stroke-dasharray",function(Sa){return i.dashStyle(Sa.minor?vt.minor.griddash:vt.griddash,Sa.minor?vt.minor.gridwidth:vt.gridwidth)}).style("stroke-width",function(Sa){return(Sa.minor?Jr:vt._gw)+"px"}).style("display",null),typeof Lr.path=="function"&&oa.attr("d",Lr.path)}}Aa(vt,[O,L])}},$.drawZeroLine=function(dt,vt,Lr){Lr=Lr||Lr;var Er=vt._id+"zl",_r=$.shouldShowZeroLine(dt,vt,Lr.counterAxis),yr=Lr.layer.selectAll("path."+Er).data(_r?[{x:0,id:vt._id}]:[]);yr.exit().remove(),yr.enter().append("path").classed(Er,1).classed("zl",1).classed("crisp",Lr.crisp!==!1).each(function(){Lr.layer.selectAll("path").sort(function(kr,zr){return ee(kr.id,zr.id)})}),yr.attr("transform",Lr.transFn).attr("d",Lr.path).call(a.stroke,vt.zerolinecolor||a.defaultLine).style("stroke-width",i.crispRound(dt,vt.zerolinewidth,vt._gw||1)+"px").style("display",null),Aa(vt,[B])},$.drawLabels=function(dt,vt,Lr){Lr=Lr||{};var Er=dt._fullLayout,_r=vt._id,yr=Lr.cls||_r+"tick",kr=Lr.vals.filter(function(li){return li.text}),zr=Lr.labelFns,Pr=Lr.secondary?0:vt.tickangle,Hr=(vt._prevTickAngles||{})[yr],Zr=Lr.layer.selectAll("g."+yr).data(vt.showticklabels?kr:[],lr),Jr=[];Zr.enter().append("g").classed(yr,1).append("text").attr("text-anchor","middle").each(function(li){var Ii=d.select(this),xi=dt._promises.length;Ii.call(r.positionText,zr.xFn(li),zr.yFn(li)).call(i.font,{family:li.font,size:li.fontSize,color:li.fontColor,weight:li.fontWeight,style:li.fontStyle,variant:li.fontVariant,textcase:li.fontTextcase,lineposition:li.fontLineposition,shadow:li.fontShadow}).text(li.text).call(r.convertToTspans,dt),dt._promises[xi]?Jr.push(dt._promises.pop().then(function(){wt(Ii,Pr)})):wt(Ii,Pr)}),Aa(vt,[U]),Zr.exit().remove(),Lr.repositionOnUpdate&&Zr.each(function(li){d.select(this).select("text").call(r.positionText,zr.xFn(li),zr.yFn(li))});function wt(li,Ii){li.each(function(xi){var Ao=d.select(this),So=Ao.select(".text-math-group"),Ro=zr.anchorFn(xi,Ii),Li=Lr.transFn.call(Ao.node(),xi)+(x(Ii)&&+Ii!=0?" rotate("+Ii+","+zr.xFn(xi)+","+(zr.yFn(xi)-xi.fontSize/2)+")":""),Yi=r.lineCount(Ao),bs=le*xi.fontSize,as=zr.heightFn(xi,x(Ii)?+Ii:0,(Yi-1)*bs);if(as&&(Li+=t(0,as)),So.empty()){var fs=Ao.select("text");fs.attr({transform:Li,"text-anchor":Ro}),fs.style("opacity",1),vt._adjustTickLabelsOverflow&&vt._adjustTickLabelsOverflow()}else{var Co=i.bBox(So.node()).width,Qa=Co*{end:-.5,start:.5}[Ro];So.attr("transform",Li+t(Qa,0))}})}vt._adjustTickLabelsOverflow=function(){var li=vt.ticklabeloverflow;if(!(!li||li==="allow")){var Ii=li.indexOf("hide")!==-1,xi=vt._id.charAt(0)==="x",Ao=0,So=xi?dt._fullLayout.width:dt._fullLayout.height;if(li.indexOf("domain")!==-1){var Ro=e.simpleMap(vt.range,vt.r2l);Ao=vt.l2p(Ro[0])+vt._offset,So=vt.l2p(Ro[1])+vt._offset}var Li=Math.min(Ao,So),Yi=Math.max(Ao,So),bs=vt.side,as=1/0,fs=-1/0;Zr.each(function(Os){var ds=d.select(this),Ui=ds.select(".text-math-group");if(Ui.empty()){var ms=i.bBox(ds.node()),Mo=0;xi?(ms.right>Yi||ms.leftYi||ms.top+(vt.tickangle?0:Os.fontSize/4)vt["_visibleLabelMin_"+Ro._id]?Os.style("display","none"):Yi.K==="tick"&&!Li&&Os.style("display",null)})})})})},wt(Zr,Hr+1?Hr:Pr);function Qt(){return Jr.length&&Promise.all(Jr)}var mr=null;function $r(){if(wt(Zr,Pr),kr.length&&vt.autotickangles&&(vt.type!=="log"||String(vt.dtick).charAt(0)!=="D")){mr=vt.autotickangles[0];var li=0,Ii=[],xi,Ao=1;Zr.each(function(wo){li=Math.max(li,wo.fontSize);var bi=vt.l2p(wo.x),wl=La(this),$l=i.bBox(wl.node());Ao=Math.max(Ao,r.lineCount(wl)),Ii.push({top:0,bottom:10,height:10,left:bi-$l.width/2,right:bi+$l.width/2+2,width:$l.width+2})});var So=(vt.tickson==="boundaries"||vt.showdividers)&&!Lr.secondary,Ro=kr.length,Li=Math.abs((kr[Ro-1].x-kr[0].x)*vt._m)/(Ro-1),Yi=So?Li/2:Li,bs=So?vt.ticklen:li*1.25*Ao,as=Math.sqrt(Math.pow(Yi,2)+Math.pow(bs,2)),fs=Yi/as,Co=vt.autotickangles.map(function(wo){return wo*Math.PI/180}),Qa=Co.find(function(wo){return Math.abs(Math.cos(wo))<=fs});Qa===void 0&&(Qa=Co.reduce(function(wo,bi){return Math.abs(Math.cos(wo))uo*mi&&(Ci=mi,Vn[qn]=di[qn]=ci[qn])}var Lo=Math.abs(Ci-yi);Lo-pa>0?(Lo-=pa,pa*=1+pa/Lo):pa=0,vt._id.charAt(0)!=="y"&&(pa=-pa),Vn[Ga]=ya.p2r(ya.r2p(di[Ga])+pn*pa),ya.autorange==="min"||ya.autorange==="max reversed"?(Vn[0]=null,ya._rangeInitial0=void 0,ya._rangeInitial1=void 0):(ya.autorange==="max"||ya.autorange==="min reversed")&&(Vn[1]=null,ya._rangeInitial0=void 0,ya._rangeInitial1=void 0),Er._insideTickLabelsUpdaterange[ya._name+".range"]=Vn}var Wo=e.syncOrAsync(oa);return Wo&&Wo.then&&dt._promises.push(Wo),Wo};function ta(dt,vt,Lr){var Er=vt._id+"divider",_r=Lr.vals,yr=Lr.layer.selectAll("path."+Er).data(_r,lr);yr.exit().remove(),yr.enter().insert("path",":first-child").classed(Er,1).classed("crisp",1).call(a.stroke,vt.dividercolor).style("stroke-width",i.crispRound(dt,vt.dividerwidth,1)+"px"),yr.attr("transform",Lr.transFn).attr("d",Lr.path)}$.getPxPosition=function(dt,vt){var Lr=dt._fullLayout._size,Er=vt._id.charAt(0),_r=vt.side,yr;if(vt.anchor!=="free"?yr=vt._anchorAxis:Er==="x"?yr={_offset:Lr.t+(1-(vt.position||0))*Lr.h,_length:0}:Er==="y"&&(yr={_offset:Lr.l+(vt.position||0)*Lr.w+vt._shift,_length:0}),_r==="top"||_r==="left")return yr._offset;if(_r==="bottom"||_r==="right")return yr._offset+yr._length};function da(dt){var vt=dt.title.font.size,Lr=(dt.title.text.match(r.BR_TAG_ALL)||[]).length;return dt.title.hasOwnProperty("standoff")?vt*(oe+Lr*le):Lr?vt*(Lr+1)*le:vt}function wa(dt,vt){var Lr=dt._fullLayout,Er=vt._id,_r=Er.charAt(0),yr=vt.title.font.size,kr,zr=(vt.title.text.match(r.BR_TAG_ALL)||[]).length;if(vt.title.hasOwnProperty("standoff"))vt.side==="bottom"||vt.side==="right"?kr=vt._depth+vt.title.standoff+yr*oe:(vt.side==="top"||vt.side==="left")&&(kr=vt._depth+vt.title.standoff+yr*(ue+zr*le));else{var Pr=ga(vt);if(vt.type==="multicategory")kr=vt._depth;else{var Hr=1.5*yr;Pr&&(Hr=.5*yr,vt.ticks==="outside"&&(Hr+=vt.ticklen)),kr=10+Hr+(vt.linewidth?vt.linewidth-1:0)}Pr||(_r==="x"?kr+=vt.side==="top"?yr*(vt.showticklabels?1:0):yr*(vt.showticklabels?1.5:.5):kr+=vt.side==="right"?yr*(vt.showticklabels?1:.5):yr*(vt.showticklabels?.5:0))}var Zr=$.getPxPosition(dt,vt),Jr,wt,Qt;_r==="x"?(wt=vt._offset+vt._length/2,Qt=vt.side==="top"?Zr-kr:Zr+kr):(Qt=vt._offset+vt._length/2,wt=vt.side==="right"?Zr+kr:Zr-kr,Jr={rotate:"-90",offset:0});var mr;if(vt.type!=="multicategory"){var $r=vt._selections[vt._id+"tick"];if(mr={selection:$r,side:vt.side},$r&&$r.node()&&$r.node().parentNode){var oa=i.getTranslate($r.node().parentNode);mr.offsetLeft=oa.x,mr.offsetTop=oa.y}vt.title.hasOwnProperty("standoff")&&(mr.pad=0)}return vt._titleStandoff=kr,o.draw(dt,Er+"title",{propContainer:vt,propName:vt._name+".title.text",placeholder:Lr._dfltTitle[_r],avoid:mr,transform:Jr,attributes:{x:wt,y:Qt,"text-anchor":"middle"}})}$.shouldShowZeroLine=function(dt,vt,Lr){var Er=e.simpleMap(vt.range,vt.r2l);return Er[0]*Er[1]<=0&&vt.zeroline&&(vt.type==="linear"||vt.type==="-")&&!(vt.rangebreaks&&vt.maskBreaks(0)===F)&&(ma(vt,0)||!Ia(dt,vt,Lr,Er)||va(dt,vt))},$.clipEnds=function(dt,vt){return vt.filter(function(Lr){return ma(dt,Lr.x)})};function ma(dt,vt){var Lr=dt.l2p(vt);return Lr>1&&Lr1)for(_r=1;_r=_r.min&&dt<_r.max)return _r.max}return dt}function ga(dt){return(dt.ticklabelposition||"").indexOf("inside")!==-1}function Aa(dt,vt){ga(dt._anchorAxis||{})&&dt._hideCounterAxisInsideTickLabels&&dt._hideCounterAxisInsideTickLabels(vt)}function Pa(dt,vt,Lr,Er){var _r=dt.anchor!=="free"&&(dt.overlaying===void 0||dt.overlaying===!1)?dt._id:dt.overlaying,yr;Er?yr=dt.side==="right"?vt:-vt:yr=vt,_r in Lr||(Lr[_r]={}),dt.side in Lr[_r]||(Lr[_r][dt.side]=0),Lr[_r][dt.side]+=yr}function sa(dt,vt){return dt.autoshift?vt[dt.overlaying][dt.side]:dt.shift||0}function Oa(dt,vt){return/%f/.test(vt)?dt>=P:/%L/.test(vt)?dt>=R:/%[SX]/.test(vt)?dt>=m:/%M/.test(vt)?dt>=g:/%[HI]/.test(vt)?dt>=u:/%p/.test(vt)?dt>=p:/%[Aadejuwx]/.test(vt)?dt>=w:/%[UVW]/.test(vt)?dt>=_:/%[Bbm]/.test(vt)?dt>=M:/%[q]/.test(vt)?dt>=y:/%[Yy]/.test(vt)?dt>=h:!0}}}),Sb=He({"src/plots/cartesian/autorange_options_defaults.js"(Y,G){G.exports=function(x,A,E){var e,t;if(E){var r=A==="reversed"||A==="min reversed"||A==="max reversed";e=E[r?1:0],t=E[r?0:1]}var o=x("autorangeoptions.minallowed",t===null?e:void 0),a=x("autorangeoptions.maxallowed",e===null?t:void 0);o===void 0&&x("autorangeoptions.clipmin"),a===void 0&&x("autorangeoptions.clipmax"),x("autorangeoptions.include")}}}),Mb=He({"src/plots/cartesian/range_defaults.js"(Y,G){var d=Sb();G.exports=function(A,E,e,t){var r=E._template||{},o=E.type||r.type||"-";e("minallowed"),e("maxallowed");var a=e("range");if(!a){var i;!t.noInsiderange&&o!=="log"&&(i=e("insiderange"),i&&(i[0]===null||i[1]===null)&&(E.insiderange=!1,i=void 0),i&&(a=e("range",i)))}var n=E.getAutorangeDflt(a,t),s=e("autorange",n),c;a&&(a[0]===null&&a[1]===null||(a[0]===null||a[1]===null)&&(s==="reversed"||s===!0)||a[0]!==null&&(s==="min"||s==="max reversed")||a[1]!==null&&(s==="max"||s==="min reversed"))&&(a=void 0,delete E.range,E.autorange=!0,c=!0),c||(n=E.getAutorangeDflt(a,t),s=e("autorange",n)),s&&(d(e,s,a),(o==="linear"||o==="-")&&e("rangemode")),E.cleanRange()}}}),eM=He({"node_modules/mouse-event-offset/index.js"(Y,G){var d={left:0,top:0};G.exports=x;function x(E,e,t){e=e||E.currentTarget||E.srcElement,Array.isArray(t)||(t=[0,0]);var r=E.clientX||0,o=E.clientY||0,a=A(e);return t[0]=r-a.left,t[1]=o-a.top,t}function A(E){return E===window||E===document||E===document.body?d:E.getBoundingClientRect()}}}),a1=He({"node_modules/has-passive-events/index.js"(Y,G){var d=yb();function x(){var A=!1;try{var E=Object.defineProperty({},"passive",{get:function(){A=!0}});window.addEventListener("test",null,E),window.removeEventListener("test",null,E)}catch{A=!1}return A}G.exports=d&&x()}}),tM=He({"src/components/dragelement/align.js"(Y,G){G.exports=function(x,A,E,e,t){var r=(x-E)/(e-E),o=r+A/(e-E),a=(r+o)/2;return t==="left"||t==="bottom"?r:t==="center"||t==="middle"?a:t==="right"||t==="top"?o:r<2/3-a?r:o>4/3-a?o:a}}}),rM=He({"src/components/dragelement/cursor.js"(Y,G){var d=Gr(),x=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];G.exports=function(E,e,t,r){return t==="left"?E=0:t==="center"?E=1:t==="right"?E=2:E=d.constrain(Math.floor(E*3),0,2),r==="bottom"?e=0:r==="middle"?e=1:r==="top"?e=2:e=d.constrain(Math.floor(e*3),0,2),x[e][E]}}}),aM=He({"src/components/dragelement/unhover.js"(Y,G){var d=z0(),x=e1(),A=Wg().getGraphDiv,E=Gg(),e=G.exports={};e.wrapped=function(t,r,o){t=A(t),t._fullLayout&&x.clear(t._fullLayout._uid+E.HOVERID),e.raw(t,r,o)},e.raw=function(r,o){var a=r._fullLayout,i=r._hoverdata;o||(o={}),!(o.target&&!r._dragged&&d.triggerHandler(r,"plotly_beforehover",o)===!1)&&(a._hoverlayer.selectAll("g").remove(),a._hoverlayer.selectAll("line").remove(),a._hoverlayer.selectAll("circle").remove(),r._hoverdata=void 0,o.target&&i&&r.emit("plotly_unhover",{event:o,points:i}))}}}),fh=He({"src/components/dragelement/index.js"(Y,G){var d=eM(),x=mb(),A=a1(),E=Gr().removeElement,e=Ef(),t=G.exports={};t.align=tM(),t.getCursor=rM();var r=aM();t.unhover=r.wrapped,t.unhoverRaw=r.raw,t.init=function(n){var s=n.gd,c=1,f=s._context.doubleClickDelay,v=n.element,h,T,l,y,b,S,M,_;s._mouseDownTime||(s._mouseDownTime=0),v.style.pointerEvents="all",v.onmousedown=u,A?(v._ontouchstart&&v.removeEventListener("touchstart",v._ontouchstart),v._ontouchstart=u,v.addEventListener("touchstart",u,{passive:!1})):v.ontouchstart=u;function w(R,P,z){return Math.abs(R)"u"&&typeof R.clientY>"u"&&(R.clientX=h,R.clientY=T),l=new Date().getTime(),l-s._mouseDownTimef&&(c=Math.max(c-1,1)),s._dragged)n.doneFn&&n.doneFn();else{var P;S.target===M?P=S:(P={target:M,srcElement:M,toElement:M},Object.keys(S).concat(Object.keys(S.__proto__)).forEach(z=>{var F=S[z];!P[z]&&typeof F!="function"&&(P[z]=F)})),n.clickFn&&n.clickFn(c,P),_||M.dispatchEvent(new MouseEvent("click",R))}s._dragging=!1,s._dragged=!1}};function o(){var i=document.createElement("div");i.className="dragcover";var n=i.style;return n.position="fixed",n.left=0,n.right=0,n.top=0,n.bottom=0,n.zIndex=999999999,n.background="none",document.body.appendChild(i),i}t.coverSlip=o;function a(i){return d(i.changedTouches?i.changedTouches[0]:i,document.body)}}}),xv=He({"src/lib/setcursor.js"(Y,G){G.exports=function(x,A){(x.attr("class")||"").split(" ").forEach(function(E){E.indexOf("cursor-")===0&&x.classed(E,!1)}),A&&x.classed("cursor-"+A,!0)}}}),nM=He({"src/lib/override_cursor.js"(Y,G){var d=xv(),x="data-savedcursor",A="!!";G.exports=function(e,t){var r=e.attr(x);if(t){if(!r){for(var o=(e.attr("class")||"").split(" "),a=0;a(a==="legend"?1:0));if(R===!1&&(n[a]=void 0),!(R===!1&&!c.uirevision)&&(v("uirevision",n.uirevision),R!==!1)){v("borderwidth");var P=v("orientation"),z=v("yref"),F=v("xref"),B=P==="h",O=z==="paper",L=F==="paper",N,U,Z,Q="left";B?(N=0,d.getComponentMethod("rangeslider","isVisible")(i.xaxis)?O?(U=1.1,Z="bottom"):(U=1,Z="top"):O?(U=-.1,Z="top"):(U=0,Z="bottom")):(U=1,Z="auto",L?N=1.02:(N=1,Q="right")),x.coerce(c,f,{x:{valType:"number",editType:"legend",min:L?-2:0,max:L?3:1,dflt:N}},"x"),x.coerce(c,f,{y:{valType:"number",editType:"legend",min:O?-2:0,max:O?3:1,dflt:U}},"y"),v("traceorder",w),r.isGrouped(n[a])&&v("tracegroupgap"),v("entrywidth"),v("entrywidthmode"),v("indentation"),v("itemsizing"),v("itemwidth"),v("itemclick"),v("itemdoubleclick"),v("groupclick"),v("xanchor",Q),v("yanchor",Z),v("valign"),x.noneOrAll(c,f,["x","y"]);var ue=v("title.text");if(ue){v("title.side",B?"left":"top");var oe=x.extendFlat({},h,{size:x.bigFont(h.size)});x.coerceFont(v,"title.font",oe)}}}}G.exports=function(i,n,s){var c,f=s.slice(),v=n.shapes;if(v)for(c=0;cR&&(m=R)}u[h][0]._groupMinRank=m,u[h][0]._preGroupSort=h}var P=function(N,U){return N[0]._groupMinRank-U[0]._groupMinRank||N[0]._preGroupSort-U[0]._preGroupSort},z=function(N,U){return N.trace.legendrank-U.trace.legendrank||N._preSort-U._preSort};for(u.forEach(function(N,U){N[0]._preGroupSort=U}),u.sort(P),h=0;h0)re=J.width;else return 0;return p?X:Math.min(re,$)};S.each(function(j){var J=d.select(this),$=A.ensureSingle(J,"g","layers");$.style("opacity",j[0].trace.opacity);var X=_.indentation,re=_.valign,ee=j[0].lineHeight,q=j[0].height;if(re==="middle"&&X===0||!ee||!q)$.attr("transform",null);else{var ae={top:1,bottom:-1}[re],ie=ae*(.5*(ee-q+3))||0,fe=_.indentation;$.attr("transform",E(fe,ie))}var we=$.selectAll("g.legendfill").data([j]);we.enter().append("g").classed("legendfill",!0);var Ae=$.selectAll("g.legendlines").data([j]);Ae.enter().append("g").classed("legendlines",!0);var Fe=$.selectAll("g.legendsymbols").data([j]);Fe.enter().append("g").classed("legendsymbols",!0),Fe.selectAll("g.legendpoints").data([j]).enter().append("g").classed("legendpoints",!0)}).each(le).each(F).each(O).each(B).each(N).each(ue).each(Q).each(P).each(z).each(U).each(Z);function P(j){var J=l(j),$=J.showFill,X=J.showLine,re=J.showGradientLine,ee=J.showGradientFill,q=J.anyFill,ae=J.anyLine,ie=j[0],fe=ie.trace,we,Ae,Fe=r(fe),Ce=Fe.colorscale,qe=Fe.reversescale,et=function(Re){if(Re.size())if($)e.fillGroupStyle(Re,M,!0);else{var $e="legendfill-"+fe.uid;e.gradient(Re,M,$e,T(qe),Ce,"fill")}},Qe=function(Re){if(Re.size()){var $e="legendline-"+fe.uid;e.lineGroupStyle(Re),e.gradient(Re,M,$e,T(qe),Ce,"stroke")}},Ke=o.hasMarkers(fe)||!q?"M5,0":ae?"M5,-2":"M5,-3",Xe=d.select(this),Me=Xe.select(".legendfill").selectAll("path").data($||ee?[j]:[]);if(Me.enter().append("path").classed("js-fill",!0),Me.exit().remove(),Me.attr("d",Ke+"h"+u+"v6h-"+u+"z").call(et),X||re){var xe=R(void 0,fe.line,v,c);Ae=A.minExtend(fe,{line:{width:xe}}),we=[A.minExtend(ie,{trace:Ae})]}var ce=Xe.select(".legendlines").selectAll("path").data(X||re?[we]:[]);ce.enter().append("path").classed("js-line",!0),ce.exit().remove(),ce.attr("d",Ke+(re?"l"+u+",0.0001":"h"+u)).call(X?e.lineGroupStyle:Qe)}function z(j){var J=l(j),$=J.anyFill,X=J.anyLine,re=J.showLine,ee=J.showMarker,q=j[0],ae=q.trace,ie=!ee&&!X&&!$&&o.hasText(ae),fe,we;function Ae(Me,xe,ce,Re){var $e=A.nestedProperty(ae,Me).get(),rt=A.isArrayOrTypedArray($e)&&xe?xe($e):$e;if(p&&rt&&Re!==void 0&&(rt=Re),ce){if(rtce[1])return ce[1]}return rt}function Fe(Me){return q._distinct&&q.index&&Me[q.index]?Me[q.index]:Me[0]}if(ee||ie||re){var Ce={},qe={};if(ee){Ce.mc=Ae("marker.color",Fe),Ce.mx=Ae("marker.symbol",Fe),Ce.mo=Ae("marker.opacity",A.mean,[.2,1]),Ce.mlc=Ae("marker.line.color",Fe),Ce.mlw=Ae("marker.line.width",A.mean,[0,5],f),qe.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var et=Ae("marker.size",A.mean,[2,16],s);Ce.ms=et,qe.marker.size=et}re&&(qe.line={width:Ae("line.width",Fe,[0,10],c)}),ie&&(Ce.tx="Aa",Ce.tp=Ae("textposition",Fe),Ce.ts=10,Ce.tc=Ae("textfont.color",Fe),Ce.tf=Ae("textfont.family",Fe),Ce.tw=Ae("textfont.weight",Fe),Ce.ty=Ae("textfont.style",Fe),Ce.tv=Ae("textfont.variant",Fe),Ce.tC=Ae("textfont.textcase",Fe),Ce.tE=Ae("textfont.lineposition",Fe),Ce.tS=Ae("textfont.shadow",Fe)),fe=[A.minExtend(q,Ce)],we=A.minExtend(ae,qe),we.selectedpoints=null,we.texttemplate=null}var Qe=d.select(this).select("g.legendpoints"),Ke=Qe.selectAll("path.scatterpts").data(ee?fe:[]);Ke.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",m),Ke.exit().remove(),Ke.call(e.pointStyle,we,M),ee&&(fe[0].mrc=3);var Xe=Qe.selectAll("g.pointtext").data(ie?fe:[]);Xe.enter().append("g").classed("pointtext",!0).append("text").attr("transform",m),Xe.exit().remove(),Xe.selectAll("text").call(e.textPointStyle,we,M)}function F(j){var J=j[0].trace,$=J.type==="waterfall";if(j[0]._distinct&&$){var X=j[0].trace[j[0].dir].marker;return j[0].mc=X.color,j[0].mlw=X.line.width,j[0].mlc=X.line.color,L(j,this,"waterfall")}var re=[];J.visible&&$&&(re=j[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 ee=d.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(re);ee.enter().append("path").classed("legendwaterfall",!0).attr("transform",m).style("stroke-miterlimit",1),ee.exit().remove(),ee.each(function(q){var ae=d.select(this),ie=J[q[0]].marker,fe=R(void 0,ie.line,h,f);ae.attr("d",q[1]).style("stroke-width",fe+"px").call(t.fill,ie.color),fe&&ae.call(t.stroke,ie.line.color)})}function B(j){L(j,this)}function O(j){L(j,this,"funnel")}function L(j,J,$){var X=j[0].trace,re=X.marker||{},ee=re.line||{},q=re.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",ae=$?X.visible&&X.type===$:x.traceIs(X,"bar"),ie=d.select(J).select("g.legendpoints").selectAll("path.legend"+$).data(ae?[j]:[]);ie.enter().append("path").classed("legend"+$,!0).attr("d",q).attr("transform",m),ie.exit().remove(),ie.each(function(fe){var we=d.select(this),Ae=fe[0],Fe=R(Ae.mlw,re.line,h,f);we.style("stroke-width",Fe+"px");var Ce=Ae.mcc;if(!_._inHover&&"mc"in Ae){var qe=r(re),et=qe.mid;et===void 0&&(et=(qe.max+qe.min)/2),Ce=e.tryColorscale(re,"")(et)}var Qe=Ce||Ae.mc||re.color,Ke=re.pattern,Xe=Ke&&e.getPatternAttr(Ke.shape,0,"");if(Xe){var Me=e.getPatternAttr(Ke.bgcolor,0,null),xe=e.getPatternAttr(Ke.fgcolor,0,null),ce=Ke.fgopacity,Re=y(Ke.size,8,10),$e=y(Ke.solidity,.5,1),rt="legend-"+X.uid;we.call(e.pattern,"legend",M,rt,Xe,Re,$e,Ce,Ke.fillmode,Me,xe,ce)}else we.call(t.fill,Qe);Fe&&t.stroke(we,Ae.mlc||ee.color)})}function N(j){var J=j[0].trace,$=d.select(this).select("g.legendpoints").selectAll("path.legendbox").data(J.visible&&x.traceIs(J,"box-violin")?[j]:[]);$.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",m),$.exit().remove(),$.each(function(){var X=d.select(this);if((J.boxpoints==="all"||J.points==="all")&&t.opacity(J.fillcolor)===0&&t.opacity((J.line||{}).color)===0){var re=A.minExtend(J,{marker:{size:p?s:A.constrain(J.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});$.call(e.pointStyle,re,M)}else{var ee=R(void 0,J.line,h,f);X.style("stroke-width",ee+"px").call(t.fill,J.fillcolor),ee&&t.stroke(X,J.line.color)}})}function U(j){var J=j[0].trace,$=d.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(J.visible&&J.type==="candlestick"?[j,j]:[]);$.enter().append("path").classed("legendcandle",!0).attr("d",function(X,re){return re?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",m).style("stroke-miterlimit",1),$.exit().remove(),$.each(function(X,re){var ee=d.select(this),q=J[re?"increasing":"decreasing"],ae=R(void 0,q.line,h,f);ee.style("stroke-width",ae+"px").call(t.fill,q.fillcolor),ae&&t.stroke(ee,q.line.color)})}function Z(j){var J=j[0].trace,$=d.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(J.visible&&J.type==="ohlc"?[j,j]:[]);$.enter().append("path").classed("legendohlc",!0).attr("d",function(X,re){return re?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",m).style("stroke-miterlimit",1),$.exit().remove(),$.each(function(X,re){var ee=d.select(this),q=J[re?"increasing":"decreasing"],ae=R(void 0,q.line,h,f);ee.style("fill","none").call(e.dashLine,q.line.dash,ae),ae&&t.stroke(ee,q.line.color)})}function Q(j){oe(j,this,"pie")}function ue(j){oe(j,this,"funnelarea")}function oe(j,J,$){var X=j[0],re=X.trace,ee=$?re.visible&&re.type===$:x.traceIs(re,$),q=d.select(J).select("g.legendpoints").selectAll("path.legend"+$).data(ee?[j]:[]);if(q.enter().append("path").classed("legend"+$,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",m),q.exit().remove(),q.size()){var ae=re.marker||{},ie=R(i(ae.line.width,X.pts),ae.line,h,f),fe="pieLike",we=A.minExtend(re,{marker:{line:{width:ie}}},fe),Ae=A.minExtend(X,{trace:we},fe);a(q,Ae,we,M)}}function le(j){var J=j[0].trace,$,X=[];if(J.visible)switch(J.type){case"histogram2d":case"heatmap":X=[["M-15,-2V4H15V-2Z"]],$=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":X=[["M-6,-6V6H6V-6Z"]],$=!0;break;case"densitymapbox":case"densitymap":X=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],$="radial";break;case"cone":X=[["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"]],$=!1;break;case"streamtube":X=[["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"]],$=!1;break;case"surface":X=[["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"]],$=!0;break;case"mesh3d":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],$=!1;break;case"volume":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],$=!0;break;case"isosurface":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],$=!1;break}var re=d.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(X);re.enter().append("path").classed("legend3dandfriends",!0).attr("transform",m).style("stroke-miterlimit",1),re.exit().remove(),re.each(function(ee,q){var ae=d.select(this),ie=r(J),fe=ie.colorscale,we=ie.reversescale,Ae=function(et){if(et.size()){var Qe="legendfill-"+J.uid;e.gradient(et,M,Qe,T(we,$==="radial"),fe,"fill")}},Fe;if(fe){if(!$){var qe=fe.length;Fe=q===0?fe[we?qe-1:0][1]:q===1?fe[we?0:qe-1][1]:fe[Math.floor((qe-1)/2)][1]}}else{var Ce=J.vertexcolor||J.facecolor||J.color;Fe=A.isArrayOrTypedArray(Ce)?Ce[q]||Ce[0]:Ce}ae.attr("d",ee[0]),Fe?ae.call(t.fill,Fe):ae.call(Ae)})}};function T(b,S){var M=S?"radial":"horizontal";return M+(b?"":"reversed")}function l(b){var S=b[0].trace,M=S.contours,_=o.hasLines(S),w=o.hasMarkers(S),p=S.visible&&S.fill&&S.fill!=="none",u=!1,g=!1;if(M){var m=M.coloring;m==="lines"?u=!0:_=m==="none"||m==="heatmap"||M.showlines,M.type==="constraint"?p=M._operation!=="=":(m==="fill"||m==="heatmap")&&(g=!0)}return{showMarker:w,showLine:_,showFill:p,showGradientLine:u,showGradientFill:g,anyLine:_||u,anyFill:p||g}}function y(b,S,M){return b&&A.isArrayOrTypedArray(b)?S:b>M?M:b}}}),Pb=He({"src/components/legend/draw.js"(Y,G){var d=Qn(),x=Gr(),A=yu(),E=Ei(),e=z0(),t=fh(),r=vo(),o=Ai(),a=yl(),i=iM(),n=Cb(),s=df(),c=s.LINE_SPACING,f=s.FROM_TL,v=s.FROM_BR,h=oM(),T=Lb(),l=n1(),y=1,b=/^legend[0-9]*$/;G.exports=function(U,Z){if(Z)M(U,Z);else{var Q=U._fullLayout,ue=Q._legends,oe=Q._infolayer.selectAll('[class^="legend"]');oe.each(function(){var $=d.select(this),X=$.attr("class"),re=X.split(" ")[0];re.match(b)&&ue.indexOf(re)===-1&&$.remove()});for(var le=0;le1)}var ae=Q.hiddenlabels||[];if(!j&&(!Q.showlegend||!J.length))return le.selectAll("."+ue).remove(),Q._topdefs.select("#"+oe).remove(),A.autoMargin(N,ue);var ie=x.ensureSingle(le,"g",ue,function(Ke){j||Ke.attr("pointer-events","all")}),fe=x.ensureSingleById(Q._topdefs,"clipPath",oe,function(Ke){Ke.append("rect")}),we=x.ensureSingle(ie,"rect","bg",function(Ke){Ke.attr("shape-rendering","crispEdges")});we.call(o.stroke,Z.bordercolor).call(o.fill,Z.bgcolor).style("stroke-width",Z.borderwidth+"px");var Ae=x.ensureSingle(ie,"g","scrollbox"),Fe=Z.title;Z._titleWidth=0,Z._titleHeight=0;var Ce;Fe.text?(Ce=x.ensureSingle(Ae,"text",ue+"titletext"),Ce.attr("text-anchor","start").call(r.font,Fe.font).text(Fe.text),m(Ce,Ae,N,Z,y)):Ae.selectAll("."+ue+"titletext").remove();var qe=x.ensureSingle(ie,"rect","scrollbar",function(Ke){Ke.attr(n.scrollBarEnterAttrs).call(o.fill,n.scrollBarColor)}),et=Ae.selectAll("g.groups").data(J);et.enter().append("g").attr("class","groups"),et.exit().remove();var Qe=et.selectAll("g.traces").data(x.identity);Qe.enter().append("g").attr("class","traces"),Qe.exit().remove(),Qe.style("opacity",function(Ke){var Xe=Ke[0].trace;return E.traceIs(Xe,"pie-like")?ae.indexOf(Ke[0].label)!==-1?.5:1:Xe.visible==="legendonly"?.5:1}).each(function(){d.select(this).call(p,N,Z)}).call(T,N,Z).each(function(){j||d.select(this).call(g,N,ue)}),x.syncOrAsync([A.previousPromises,function(){return z(N,et,Qe,Z)},function(){var Ke=Q._size,Xe=Z.borderwidth,Me=Z.xref==="paper",xe=Z.yref==="paper";if(Fe.text&&S(Ce,Z,Xe),!j){var ce,Re;Me?ce=Ke.l+Ke.w*Z.x-f[B(Z)]*Z._width:ce=Q.width*Z.x-f[B(Z)]*Z._width,xe?Re=Ke.t+Ke.h*(1-Z.y)-f[O(Z)]*Z._effHeight:Re=Q.height*(1-Z.y)-f[O(Z)]*Z._effHeight;var $e=F(N,ue,ce,Re);if($e)return;if(Q.margin.autoexpand){var rt=ce,Je=Re;ce=Me?x.constrain(ce,0,Q.width-Z._width):rt,Re=xe?x.constrain(Re,0,Q.height-Z._effHeight):Je,ce!==rt&&x.log("Constrain "+ue+".x to make legend fit inside graph"),Re!==Je&&x.log("Constrain "+ue+".y to make legend fit inside graph")}r.setTranslate(ie,ce,Re)}if(qe.on(".drag",null),ie.on("wheel",null),j||Z._height<=Z._maxHeight||N._context.staticPlot){var At=Z._effHeight;j&&(At=Z._height),we.attr({width:Z._width-Xe,height:At-Xe,x:Xe/2,y:Xe/2}),r.setTranslate(Ae,0,0),fe.select("rect").attr({width:Z._width-2*Xe,height:At-2*Xe,x:Xe,y:Xe}),r.setClipUrl(Ae,oe,N),r.setRect(qe,0,0,0,0),delete Z._scrollY}else{var St=Math.max(n.scrollBarMinHeight,Z._effHeight*Z._effHeight/Z._height),Rt=Z._effHeight-St-2*n.scrollBarMargin,Ut=Z._height-Z._effHeight,ir=Rt/Ut,ar=Math.min(Z._scrollY||0,Ut);we.attr({width:Z._width-2*Xe+n.scrollBarWidth+n.scrollBarMargin,height:Z._effHeight-Xe,x:Xe/2,y:Xe/2}),fe.select("rect").attr({width:Z._width-2*Xe+n.scrollBarWidth+n.scrollBarMargin,height:Z._effHeight-2*Xe,x:Xe,y:Xe+ar}),r.setClipUrl(Ae,oe,N),ve(ar,St,ir),ie.on("wheel",function(){ar=x.constrain(Z._scrollY+d.event.deltaY/Rt*Ut,0,Ut),ve(ar,St,ir),ar!==0&&ar!==Ut&&d.event.preventDefault()});var Mr,fr,dr,pt=function(ct,_t,Mt){var Nt=(Mt-_t)/ir+ct;return x.constrain(Nt,0,Ut)},ze=function(ct,_t,Mt){var Nt=(_t-Mt)/ir+ct;return x.constrain(Nt,0,Ut)},Ge=d.behavior.drag().on("dragstart",function(){var ct=d.event.sourceEvent;ct.type==="touchstart"?Mr=ct.changedTouches[0].clientY:Mr=ct.clientY,dr=ar}).on("drag",function(){var ct=d.event.sourceEvent;ct.buttons===2||ct.ctrlKey||(ct.type==="touchmove"?fr=ct.changedTouches[0].clientY:fr=ct.clientY,ar=pt(dr,Mr,fr),ve(ar,St,ir))});qe.call(Ge);var Oe=d.behavior.drag().on("dragstart",function(){var ct=d.event.sourceEvent;ct.type==="touchstart"&&(Mr=ct.changedTouches[0].clientY,dr=ar)}).on("drag",function(){var ct=d.event.sourceEvent;ct.type==="touchmove"&&(fr=ct.changedTouches[0].clientY,ar=ze(dr,Mr,fr),ve(ar,St,ir))});Ae.call(Oe)}function ve(ct,_t,Mt){Z._scrollY=N._fullLayout[ue]._scrollY=ct,r.setTranslate(Ae,0,-ct),r.setRect(qe,Z._width,n.scrollBarMargin+ct*Mt,n.scrollBarWidth,_t),fe.select("rect").attr("y",Xe+ct)}if(N._context.edits.legendPosition){var ge,be,Pe,We;ie.classed("cursor-move",!0),t.init({element:ie.node(),gd:N,prepFn:function(ct){if(ct.target!==qe.node()){var _t=r.getTranslate(ie);Pe=_t.x,We=_t.y}},moveFn:function(ct,_t){if(Pe!==void 0&&We!==void 0){var Mt=Pe+ct,Nt=We+_t;r.setTranslate(ie,Mt,Nt),ge=t.align(Mt,Z._width,Ke.l,Ke.l+Ke.w,Z.xanchor),be=t.align(Nt+Z._height,-Z._height,Ke.t+Ke.h,Ke.t,Z.yanchor)}},doneFn:function(){if(ge!==void 0&&be!==void 0){var ct={};ct[ue+".x"]=ge,ct[ue+".y"]=be,E.call("_guiRelayout",N,ct)}},clickFn:function(ct,_t){var Mt=le.selectAll("g.traces").filter(function(){var Nt=this.getBoundingClientRect();return _t.clientX>=Nt.left&&_t.clientX<=Nt.right&&_t.clientY>=Nt.top&&_t.clientY<=Nt.bottom});Mt.size()>0&&w(N,ie,Mt,ct,_t)}})}}],N)}}function _(N,U,Z){var Q=N[0],ue=Q.width,oe=U.entrywidthmode,le=Q.trace.legendwidth||U.entrywidth;return oe==="fraction"?U._maxWidth*le:Z+(le||ue)}function w(N,U,Z,Q,ue){var oe=Z.data()[0][0].trace,le={event:ue,node:Z.node(),curveNumber:oe.index,expandedIndex:oe.index,data:N.data,layout:N.layout,frames:N._transitionData._frames,config:N._context,fullData:N._fullData,fullLayout:N._fullLayout};oe._group&&(le.group=oe._group),E.traceIs(oe,"pie-like")&&(le.label=Z.datum()[0].label);var j=e.triggerHandler(N,"plotly_legendclick",le);if(Q===1){if(j===!1)return;U._clickTimeout=setTimeout(function(){N._fullLayout&&i(Z,N,Q)},N._context.doubleClickDelay)}else if(Q===2){U._clickTimeout&&clearTimeout(U._clickTimeout),N._legendMouseDownTime=0;var J=e.triggerHandler(N,"plotly_legenddoubleclick",le);J!==!1&&j!==!1&&i(Z,N,Q)}}function p(N,U,Z){var Q=L(Z),ue=N.data()[0][0],oe=ue.trace,le=E.traceIs(oe,"pie-like"),j=!Z._inHover&&U._context.edits.legendText&&!le,J=Z._maxNameLength,$,X;ue.groupTitle?($=ue.groupTitle.text,X=ue.groupTitle.font):(X=Z.font,Z.entries?$=ue.text:($=le?ue.label:oe.name,oe._meta&&($=x.templateString($,oe._meta))));var re=x.ensureSingle(N,"text",Q+"text");re.attr("text-anchor","start").call(r.font,X).text(j?u($,J):$);var ee=Z.indentation+Z.itemwidth+n.itemGap*2;a.positionText(re,ee,0),j?re.call(a.makeEditable,{gd:U,text:$}).call(m,N,U,Z).on("edit",function(q){this.text(u(q,J)).call(m,N,U,Z);var ae=ue.trace._fullInput||{},ie={};return ie.name=q,ae._isShape?E.call("_guiRelayout",U,"shapes["+oe.index+"].name",ie.name):E.call("_guiRestyle",U,ie,oe.index)}):m(re,N,U,Z)}function u(N,U){var Z=Math.max(4,U);if(N&&N.trim().length>=Z/2)return N;N=N||"";for(var Q=Z-N.length;Q>0;Q--)N+=" ";return N}function g(N,U,Z){var Q=U._context.doubleClickDelay,ue,oe=1,le=x.ensureSingle(N,"rect",Z+"toggle",function(j){U._context.staticPlot||j.style("cursor","pointer").attr("pointer-events","all"),j.call(o.fill,"rgba(0,0,0,0)")});U._context.staticPlot||(le.on("mousedown",function(){ue=new Date().getTime(),ue-U._legendMouseDownTimeQ&&(oe=Math.max(oe-1,1)),w(U,j,N,oe,d.event)}}))}function m(N,U,Z,Q,ue){Q._inHover&&N.attr("data-notex",!0),a.convertToTspans(N,Z,function(){R(U,Z,Q,ue)})}function R(N,U,Z,Q){var ue=N.data()[0][0];if(!Z._inHover&&ue&&!ue.trace.showlegend){N.remove();return}var oe=N.select("g[class*=math-group]"),le=oe.node(),j=L(Z);Z||(Z=U._fullLayout[j]);var J=Z.borderwidth,$;Q===y?$=Z.title.font:ue.groupTitle?$=ue.groupTitle.font:$=Z.font;var X=$.size*c,re,ee;if(le){var q=r.bBox(le);re=q.height,ee=q.width,Q===y?r.setTranslate(oe,J,J+re*.75):r.setTranslate(oe,0,re*.25)}else{var ae="."+j+(Q===y?"title":"")+"text",ie=N.select(ae),fe=a.lineCount(ie),we=ie.node();if(re=X*fe,ee=we?r.bBox(we).width:0,Q===y)Z.title.side==="left"&&(ee+=n.itemGap*2),a.positionText(ie,J+n.titlePad,J+X);else{var Ae=n.itemGap*2+Z.indentation+Z.itemwidth;ue.groupTitle&&(Ae=n.itemGap,ee-=Z.indentation+Z.itemwidth),a.positionText(ie,Ae,-X*((fe-1)/2-.3))}}Q===y?(Z._titleWidth=ee,Z._titleHeight=re):(ue.lineHeight=X,ue.height=Math.max(re,16)+3,ue.width=ee)}function P(N){var U=0,Z=0,Q=N.title.side;return Q&&(Q.indexOf("left")!==-1&&(U=N._titleWidth),Q.indexOf("top")!==-1&&(Z=N._titleHeight)),[U,Z]}function z(N,U,Z,Q){var ue=N._fullLayout,oe=L(Q);Q||(Q=ue[oe]);var le=ue._size,j=l.isVertical(Q),J=l.isGrouped(Q),$=Q.entrywidthmode==="fraction",X=Q.borderwidth,re=2*X,ee=n.itemGap,q=Q.indentation+Q.itemwidth+ee*2,ae=2*(X+ee),ie=O(Q),fe=Q.y<0||Q.y===0&&ie==="top",we=Q.y>1||Q.y===1&&ie==="bottom",Ae=Q.tracegroupgap,Fe={};Q._maxHeight=Math.max(fe||we?ue.height/2:le.h,30);var Ce=0;Q._width=0,Q._height=0;var qe=P(Q);if(j)Z.each(function(dr){var pt=dr[0].height;r.setTranslate(this,X+qe[0],X+qe[1]+Q._height+pt/2+ee),Q._height+=pt,Q._width=Math.max(Q._width,dr[0].width)}),Ce=q+Q._width,Q._width+=ee+q+re,Q._height+=ae,J&&(U.each(function(dr,pt){r.setTranslate(this,0,pt*Q.tracegroupgap)}),Q._height+=(Q._lgroupsLength-1)*Q.tracegroupgap);else{var et=B(Q),Qe=Q.x<0||Q.x===0&&et==="right",Ke=Q.x>1||Q.x===1&&et==="left",Xe=we||fe,Me=ue.width/2;Q._maxWidth=Math.max(Qe?Xe&&et==="left"?le.l+le.w:Me:Ke?Xe&&et==="right"?le.r+le.w:Me:le.w,2*q);var xe=0,ce=0;Z.each(function(dr){var pt=_(dr,Q,q);xe=Math.max(xe,pt),ce+=pt}),Ce=null;var Re=0;if(J){var $e=0,rt=0,Je=0;U.each(function(){var dr=0,pt=0;d.select(this).selectAll("g.traces").each(function(Ge){var Oe=_(Ge,Q,q),ve=Ge[0].height;r.setTranslate(this,qe[0],qe[1]+X+ee+ve/2+pt),pt+=ve,dr=Math.max(dr,Oe),Fe[Ge[0].trace.legendgroup]=dr});var ze=dr+ee;rt>0&&ze+X+rt>Q._maxWidth?(Re=Math.max(Re,rt),rt=0,Je+=$e+Ae,$e=pt):$e=Math.max($e,pt),r.setTranslate(this,rt,Je),rt+=ze}),Q._width=Math.max(Re,rt)+X,Q._height=Je+$e+ae}else{var At=Z.size(),St=ce+re+(At-1)*ee=Q._maxWidth&&(Re=Math.max(Re,ar),Ut=0,ir+=Rt,Q._height+=Rt,Rt=0),r.setTranslate(this,qe[0]+X+Ut,qe[1]+X+ir+pt/2+ee),ar=Ut+ze+ee,Ut+=Ge,Rt=Math.max(Rt,pt)}),St?(Q._width=Ut+re,Q._height=Rt+ae):(Q._width=Math.max(Re,ar)+re,Q._height+=Rt+ae)}}Q._width=Math.ceil(Math.max(Q._width+qe[0],Q._titleWidth+2*(X+n.titlePad))),Q._height=Math.ceil(Math.max(Q._height+qe[1],Q._titleHeight+2*(X+n.itemGap))),Q._effHeight=Math.min(Q._height,Q._maxHeight);var Mr=N._context.edits,fr=Mr.legendText||Mr.legendPosition;Z.each(function(dr){var pt=d.select(this).select("."+oe+"toggle"),ze=dr[0].height,Ge=dr[0].trace.legendgroup,Oe=_(dr,Q,q);J&&Ge!==""&&(Oe=Fe[Ge]);var ve=fr?q:Ce||Oe;!j&&!$&&(ve+=ee/2),r.setRect(pt,0,-ze/2,ve,ze)})}function F(N,U,Z,Q){var ue=N._fullLayout,oe=ue[U],le=B(oe),j=O(oe),J=oe.xref==="paper",$=oe.yref==="paper";N._fullLayout._reservedMargin[U]={};var X=oe.y<.5?"b":"t",re=oe.x<.5?"l":"r",ee={r:ue.width-Z,l:Z+oe._width,b:ue.height-Q,t:Q+oe._effHeight};if(J&&$)return A.autoMargin(N,U,{x:oe.x,y:oe.y,l:oe._width*f[le],r:oe._width*v[le],b:oe._effHeight*v[j],t:oe._effHeight*f[j]});J?N._fullLayout._reservedMargin[U][X]=ee[X]:$||oe.orientation==="v"?N._fullLayout._reservedMargin[U][re]=ee[re]:N._fullLayout._reservedMargin[U][X]=ee[X]}function B(N){return x.isRightAnchor(N)?"right":x.isCenterAnchor(N)?"center":"left"}function O(N){return x.isBottomAnchor(N)?"bottom":x.isMiddleAnchor(N)?"middle":"top"}function L(N){return N._id||"legend"}}}),Ib=He({"src/components/fx/hover.js"(Y){var G=Qn(),d=Hi(),x=Mf(),A=Gr(),E=A.pushUnique,e=A.strTranslate,t=A.strRotate,r=z0(),o=yl(),a=nM(),i=vo(),n=Ai(),s=fh(),c=io(),f=Ef().zindexSeparator,v=Ei(),h=Ph(),T=Gg(),l=kb(),y=Pb(),b=T.YANGLE,S=Math.PI*b/180,M=1/Math.sin(S),_=Math.cos(S),w=Math.sin(S),p=T.HOVERARROWSIZE,u=T.HOVERTEXTPAD,g={box:!0,ohlc:!0,violin:!0,candlestick:!0},m={scatter:!0,scattergl:!0,splom:!0};function R(q,ae){return q.distance-ae.distance}Y.hover=function(ae,ie,fe,we){ae=A.getGraphDiv(ae);var Ae=ie.target;A.throttle(ae._fullLayout._uid+T.HOVERID,T.HOVERMINTIME,function(){P(ae,ie,fe,we,Ae)})},Y.loneHover=function(ae,ie){var fe=!0;Array.isArray(ae)||(fe=!1,ae=[ae]);var we=ie.gd,Ae=X(we),Fe=re(we),Ce=ae.map(function(Re){var $e=Re._x0||Re.x0||Re.x||0,rt=Re._x1||Re.x1||Re.x||0,Je=Re._y0||Re.y0||Re.y||0,At=Re._y1||Re.y1||Re.y||0,St=Re.eventData;if(St){var Rt=Math.min($e,rt),Ut=Math.max($e,rt),ir=Math.min(Je,At),ar=Math.max(Je,At),Mr=Re.trace;if(v.traceIs(Mr,"gl3d")){var fr=we._fullLayout[Mr.scene]._scene.container,dr=fr.offsetLeft,pt=fr.offsetTop;Rt+=dr,Ut+=dr,ir+=pt,ar+=pt}St.bbox={x0:Rt+Fe,x1:Ut+Fe,y0:ir+Ae,y1:ar+Ae},ie.inOut_bbox&&ie.inOut_bbox.push(St.bbox)}else St=!1;return{color:Re.color||n.defaultLine,x0:Re.x0||Re.x||0,x1:Re.x1||Re.x||0,y0:Re.y0||Re.y||0,y1:Re.y1||Re.y||0,xLabel:Re.xLabel,yLabel:Re.yLabel,zLabel:Re.zLabel,text:Re.text,name:Re.name,idealAlign:Re.idealAlign,borderColor:Re.borderColor,fontFamily:Re.fontFamily,fontSize:Re.fontSize,fontColor:Re.fontColor,fontWeight:Re.fontWeight,fontStyle:Re.fontStyle,fontVariant:Re.fontVariant,nameLength:Re.nameLength,textAlign:Re.textAlign,trace:Re.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Re.hovertemplate||!1,hovertemplateLabels:Re.hovertemplateLabels||!1,eventData:St}}),qe=!1,et=B(Ce,{gd:we,hovermode:"closest",rotateLabels:qe,bgColor:ie.bgColor||n.background,container:G.select(ie.container),outerContainer:ie.outerContainer||ie.container}),Qe=et.hoverLabels,Ke=5,Xe=0,Me=0;Qe.sort(function(Re,$e){return Re.y0-$e.y0}).each(function(Re,$e){var rt=Re.y0-Re.by/2;rt-KeUt[0]._length||Ia<0||Ia>ir[0]._length)return s.unhoverRaw(q,ae)}if(ae.pointerX=ma+Ut[0]._offset,ae.pointerY=Ia+ir[0]._offset,"xval"in ae?Oe=h.flat(Ae,ae.xval):Oe=h.p2c(Ut,ma),"yval"in ae?ve=h.flat(Ae,ae.yval):ve=h.p2c(ir,Ia),!d(Oe[0])||!d(ve[0]))return A.warn("Fx.hover failed",ae,q),s.unhoverRaw(q,ae)}var Ka=1/0;function Vt(ei,mi){for(be=0;beZt&&(ze.splice(0,Zt),Ka=ze[0].distance),Ke&&pt!==0&&ze.length===0){qt.distance=pt,qt.index=!1;var Ii=We._module.hoverPoints(qt,Nt,Bt,"closest",{hoverLayer:Ce._hoverlayer});if(Ii&&(Ii=Ii.filter(function(Yi){return Yi.spikeDistance<=pt})),Ii&&Ii.length){var xi,Ao=Ii.filter(function(Yi){return Yi.xa.showspikes&&Yi.xa.spikesnap!=="hovered data"});if(Ao.length){var So=Ao[0];d(So.x0)&&d(So.y0)&&(xi=jt(So),(!lr.vLinePoint||lr.vLinePoint.spikeDistance>xi.spikeDistance)&&(lr.vLinePoint=xi))}var Ro=Ii.filter(function(Yi){return Yi.ya.showspikes&&Yi.ya.spikesnap!=="hovered data"});if(Ro.length){var Li=Ro[0];d(Li.x0)&&d(Li.y0)&&(xi=jt(Li),(!lr.hLinePoint||lr.hLinePoint.spikeDistance>xi.spikeDistance)&&(lr.hLinePoint=xi))}}}}}Vt();function Lt(ei,mi,uo){for(var Lo=null,Wo=1/0,li,Ii=0;Ii0&&Math.abs(ei.distance)vt-1;Pr--)zr(ze[Pr]);ze=_r,Br()}var Hr=q._hoverdata,Zr=[],Jr=X(q),wt=re(q);for(ge=0;ge1||ze.length>1)||Xe==="closest"&&ta&&ze.length>1,di=n.combine(Ce.plot_bgcolor||n.background,Ce.paper_bgcolor),yi=B(ze,{gd:q,hovermode:Xe,rotateLabels:Vn,bgColor:di,container:Ce._hoverlayer,outerContainer:Ce._paper.node(),commonLabelOpts:Ce.hoverlabel,hoverdistance:Ce.hoverdistance}),Ci=yi.hoverLabels;if(h.isUnifiedHover(Xe)||(L(Ci,Vn,Ce,yi.commonLabelBoundingBox),Z(Ci,Vn,Ce._invScaleX,Ce._invScaleY)),we&&we.tagName){var ci=v.getComponentMethod("annotations","hasClickToShow")(q,Zr);a(G.select(we),ci?"pointer":"")}!we||fe||!oe(q,ae,Hr)||(Hr&&q.emit("plotly_unhover",{event:ae,points:Hr}),q.emit("plotly_hover",{event:ae,points:q._hoverdata,xaxes:Ut,yaxes:ir,xvals:Oe,yvals:ve}))}function z(q){return[q.trace.index,q.index,q.x0,q.y0,q.name,q.attr,q.xa?q.xa._id:"",q.ya?q.ya._id:""].join(",")}var F=/([\s\S]*)<\/extra>/;function B(q,ae){var ie=ae.gd,fe=ie._fullLayout,we=ae.hovermode,Ae=ae.rotateLabels,Fe=ae.bgColor,Ce=ae.container,qe=ae.outerContainer,et=ae.commonLabelOpts||{};if(q.length===0)return[[]];var Qe=ae.fontFamily||T.HOVERFONT,Ke=ae.fontSize||T.HOVERFONTSIZE,Xe=ae.fontWeight||fe.font.weight,Me=ae.fontStyle||fe.font.style,xe=ae.fontVariant||fe.font.variant,ce=ae.fontTextcase||fe.font.textcase,Re=ae.fontLineposition||fe.font.lineposition,$e=ae.fontShadow||fe.font.shadow,rt=q[0],Je=rt.xa,At=rt.ya,St=we.charAt(0),Rt=St+"Label",Ut=rt[Rt];if(Ut===void 0&&Je.type==="multicategory")for(var ir=0;irfe.width-Zr&&(Jr=fe.width-Zr),Oa.attr("d","M"+(zr-Jr)+",0L"+(zr-Jr+p)+","+Hr+p+"H"+Zr+"v"+Hr+(u*2+kr.height)+"H"+-Zr+"V"+Hr+p+"H"+(zr-Jr-p)+"Z"),zr=Jr,be.minX=zr-Zr,be.maxX=zr+Zr,Je.side==="top"?(be.minY=Pr-(u*2+kr.height),be.maxY=Pr-u):(be.minY=Pr+u,be.maxY=Pr+(u*2+kr.height))}else{var wt,Qt,mr;At.side==="right"?(wt="start",Qt=1,mr="",zr=Je._offset+Je._length):(wt="end",Qt=-1,mr="-",zr=Je._offset),Pr=At._offset+(rt.y0+rt.y1)/2,dt.attr("text-anchor",wt),Oa.attr("d","M0,0L"+mr+p+","+p+"V"+(u+kr.height/2)+"h"+mr+(u*2+kr.width)+"V-"+(u+kr.height/2)+"H"+mr+p+"V-"+p+"Z"),be.minY=Pr-(u+kr.height/2),be.maxY=Pr+(u+kr.height/2),At.side==="right"?(be.minX=zr+p,be.maxX=zr+p+(u*2+kr.width)):(be.minX=zr-p-(u*2+kr.width),be.maxX=zr-p);var $r=kr.height/2,oa=Mr-kr.top-$r,Sa="clip"+fe._uid+"commonlabel"+At._id,ya;if(zr=0?ga=gr:Br+Ia=0?ga=Br:na+Ia=0?Aa=jt:Ot+va=0?Aa=Ot:Ur+va=0,(sa.idealAlign==="top"||!pn)&&Ga?(mr-=oa/2,sa.anchor="end"):pn?(mr+=oa/2,sa.anchor="start"):sa.anchor="middle",sa.crossPos=mr;else{if(sa.pos=mr,pn=Qt+$r/2+pa<=fr,Ga=Qt-$r/2-pa>=0,(sa.idealAlign==="left"||!pn)&&Ga)Qt-=$r/2,sa.anchor="end";else if(pn)Qt+=$r/2,sa.anchor="start";else{sa.anchor="middle";var qn=pa/2,Vn=Qt+qn-fr,di=Qt-qn;Vn>0&&(Qt-=Vn),di<0&&(Qt+=-di)}sa.crossPos=Qt}Pr.attr("text-anchor",sa.anchor),Zr&&Hr.attr("text-anchor",sa.anchor),Oa.attr("transform",e(Qt,mr)+(Ae?t(b):""))}),{hoverLabels:Pa,commonLabelBoundingBox:be}}function O(q,ae,ie,fe,we,Ae){var Fe="",Ce="";q.nameOverride!==void 0&&(q.name=q.nameOverride),q.name&&(q.trace._meta&&(q.name=A.templateString(q.name,q.trace._meta)),Fe=j(q.name,q.nameLength));var qe=ie.charAt(0),et=qe==="x"?"y":"x";q.zLabel!==void 0?(q.xLabel!==void 0&&(Ce+="x: "+q.xLabel+"
"),q.yLabel!==void 0&&(Ce+="y: "+q.yLabel+"
"),q.trace.type!=="choropleth"&&q.trace.type!=="choroplethmapbox"&&q.trace.type!=="choroplethmap"&&(Ce+=(Ce?"z: ":"")+q.zLabel)):ae&&q[qe+"Label"]===we?Ce=q[et+"Label"]||"":q.xLabel===void 0?q.yLabel!==void 0&&q.trace.type!=="scattercarpet"&&(Ce=q.yLabel):q.yLabel===void 0?Ce=q.xLabel:Ce="("+q.xLabel+", "+q.yLabel+")",(q.text||q.text===0)&&!Array.isArray(q.text)&&(Ce+=(Ce?"
":"")+q.text),q.extraText!==void 0&&(Ce+=(Ce?"
":"")+q.extraText),Ae&&Ce===""&&!q.hovertemplate&&(Fe===""&&Ae.remove(),Ce=Fe);var Qe=q.hovertemplate||!1;if(Qe){var Ke=q.hovertemplateLabels||q;q[qe+"Label"]!==we&&(Ke[qe+"other"]=Ke[qe+"Val"],Ke[qe+"otherLabel"]=Ke[qe+"Label"]),Ce=A.hovertemplateString(Qe,Ke,fe._d3locale,q.eventData[0]||{},q.trace._meta),Ce=Ce.replace(F,function(Xe,Me){return Fe=j(Me,q.nameLength),""})}return[Ce,Fe]}function L(q,ae,ie,fe){var we=ae?"xa":"ya",Ae=ae?"ya":"xa",Fe=0,Ce=1,qe=q.size(),et=new Array(qe),Qe=0,Ke=fe.minX,Xe=fe.maxX,Me=fe.minY,xe=fe.maxY,ce=function(Oe){return Oe*ie._invScaleX},Re=function(Oe){return Oe*ie._invScaleY};q.each(function(Oe){var ve=Oe[we],ge=Oe[Ae],be=ve._id.charAt(0)==="x",Pe=ve.range;Qe===0&&Pe&&Pe[0]>Pe[1]!==be&&(Ce=-1);var We=0,ct=be?ie.width:ie.height;if(ie.hovermode==="x"||ie.hovermode==="y"){var _t=N(Oe,ae),Mt=Oe.anchor,Nt=Mt==="end"?-1:1,Bt,qt;if(Mt==="middle")Bt=Oe.crossPos+(be?Re(_t.y-Oe.by/2):ce(Oe.bx/2+Oe.tx2width/2)),qt=Bt+(be?Re(Oe.by):ce(Oe.bx));else if(be)Bt=Oe.crossPos+Re(p+_t.y)-Re(Oe.by/2-p),qt=Bt+Re(Oe.by);else{var Zt=ce(Nt*p+_t.x),lr=Zt+ce(Nt*Oe.bx);Bt=Oe.crossPos+Math.min(Zt,lr),qt=Oe.crossPos+Math.max(Zt,lr)}be?Me!==void 0&&xe!==void 0&&Math.min(qt,xe)-Math.max(Bt,Me)>1&&(ge.side==="left"?(We=ge._mainLinePosition,ct=ie.width):ct=ge._mainLinePosition):Ke!==void 0&&Xe!==void 0&&Math.min(qt,Xe)-Math.max(Bt,Ke)>1&&(ge.side==="top"?(We=ge._mainLinePosition,ct=ie.height):ct=ge._mainLinePosition)}et[Qe++]=[{datum:Oe,traceIndex:Oe.trace.index,dp:0,pos:Oe.pos,posref:Oe.posref,size:Oe.by*(be?M:1)/2,pmin:We,pmax:ct}]}),et.sort(function(Oe,ve){return Oe[0].posref-ve[0].posref||Ce*(ve[0].traceIndex-Oe[0].traceIndex)});var $e,rt,Je,At,St,Rt,Ut;function ir(Oe){var ve=Oe[0],ge=Oe[Oe.length-1];if(rt=ve.pmin-ve.pos-ve.dp+ve.size,Je=ge.pos+ge.dp+ge.size-ve.pmax,rt>.01){for(St=Oe.length-1;St>=0;St--)Oe[St].dp+=rt;$e=!1}if(!(Je<.01)){if(rt<-.01){for(St=Oe.length-1;St>=0;St--)Oe[St].dp-=Je;$e=!1}if($e){var be=0;for(At=0;Atve.pmax&&be++;for(At=Oe.length-1;At>=0&&!(be<=0);At--)Rt=Oe[At],Rt.pos>ve.pmax-1&&(Rt.del=!0,be--);for(At=0;At=0;St--)Oe[St].dp-=Je;for(At=Oe.length-1;At>=0&&!(be<=0);At--)Rt=Oe[At],Rt.pos+Rt.dp+Rt.size>ve.pmax&&(Rt.del=!0,be--)}}}for(;!$e&&Fe<=qe;){for(Fe++,$e=!0,At=0;At.01){for(St=Mr.length-1;St>=0;St--)Mr[St].dp+=rt;for(ar.push.apply(ar,Mr),et.splice(At+1,1),Ut=0,St=ar.length-1;St>=0;St--)Ut+=ar[St].dp;for(Je=Ut/ar.length,St=ar.length-1;St>=0;St--)ar[St].dp-=Je;$e=!1}else At++}et.forEach(ir)}for(At=et.length-1;At>=0;At--){var pt=et[At];for(St=pt.length-1;St>=0;St--){var ze=pt[St],Ge=ze.datum;Ge.offset=ze.dp,Ge.del=ze.del}}}function N(q,ae){var ie=0,fe=q.offset;return ae&&(fe*=-w,ie=q.offset*_),{x:ie,y:fe}}function U(q){var ae={start:1,end:-1,middle:0}[q.anchor],ie=ae*(p+u),fe=ie+ae*(q.txwidth+u),we=q.anchor==="middle";return we&&(ie-=q.tx2width/2,fe+=q.txwidth/2+u),{alignShift:ae,textShiftX:ie,text2ShiftX:fe}}function Z(q,ae,ie,fe){var we=function(Fe){return Fe*ie},Ae=function(Fe){return Fe*fe};q.each(function(Fe){var Ce=G.select(this);if(Fe.del)return Ce.remove();var qe=Ce.select("text.nums"),et=Fe.anchor,Qe=et==="end"?-1:1,Ke=U(Fe),Xe=N(Fe,ae),Me=Xe.x,xe=Xe.y,ce=et==="middle";Ce.select("path").attr("d",ce?"M-"+we(Fe.bx/2+Fe.tx2width/2)+","+Ae(xe-Fe.by/2)+"h"+we(Fe.bx)+"v"+Ae(Fe.by)+"h-"+we(Fe.bx)+"Z":"M0,0L"+we(Qe*p+Me)+","+Ae(p+xe)+"v"+Ae(Fe.by/2-p)+"h"+we(Qe*Fe.bx)+"v-"+Ae(Fe.by)+"H"+we(Qe*p+Me)+"V"+Ae(xe-p)+"Z");var Re=Me+Ke.textShiftX,$e=xe+Fe.ty0-Fe.by/2+u,rt=Fe.textAlign||"auto";rt!=="auto"&&(rt==="left"&&et!=="start"?(qe.attr("text-anchor","start"),Re=ce?-Fe.bx/2-Fe.tx2width/2+u:-Fe.bx-u):rt==="right"&&et!=="end"&&(qe.attr("text-anchor","end"),Re=ce?Fe.bx/2-Fe.tx2width/2-u:Fe.bx+u)),qe.call(o.positionText,we(Re),Ae($e)),Fe.tx2width&&(Ce.select("text.name").call(o.positionText,we(Ke.text2ShiftX+Ke.alignShift*u+Me),Ae(xe+Fe.ty0-Fe.by/2+u)),Ce.select("rect").call(i.setRect,we(Ke.text2ShiftX+(Ke.alignShift-1)*Fe.tx2width/2+Me),Ae(xe-Fe.by/2-1),we(Fe.tx2width),Ae(Fe.by+2)))})}function Q(q,ae){var ie=q.index,fe=q.trace||{},we=q.cd[0],Ae=q.cd[ie]||{};function Fe(Xe){return Xe||d(Xe)&&Xe===0}var Ce=Array.isArray(ie)?function(Xe,Me){var xe=A.castOption(we,ie,Xe);return Fe(xe)?xe:A.extractOption({},fe,"",Me)}:function(Xe,Me){return A.extractOption(Ae,fe,Xe,Me)};function qe(Xe,Me,xe){var ce=Ce(Me,xe);Fe(ce)&&(q[Xe]=ce)}if(qe("hoverinfo","hi","hoverinfo"),qe("bgcolor","hbg","hoverlabel.bgcolor"),qe("borderColor","hbc","hoverlabel.bordercolor"),qe("fontFamily","htf","hoverlabel.font.family"),qe("fontSize","hts","hoverlabel.font.size"),qe("fontColor","htc","hoverlabel.font.color"),qe("fontWeight","htw","hoverlabel.font.weight"),qe("fontStyle","hty","hoverlabel.font.style"),qe("fontVariant","htv","hoverlabel.font.variant"),qe("nameLength","hnl","hoverlabel.namelength"),qe("textAlign","hta","hoverlabel.align"),q.posref=ae==="y"||ae==="closest"&&fe.orientation==="h"?q.xa._offset+(q.x0+q.x1)/2:q.ya._offset+(q.y0+q.y1)/2,q.x0=A.constrain(q.x0,0,q.xa._length),q.x1=A.constrain(q.x1,0,q.xa._length),q.y0=A.constrain(q.y0,0,q.ya._length),q.y1=A.constrain(q.y1,0,q.ya._length),q.xLabelVal!==void 0&&(q.xLabel="xLabel"in q?q.xLabel:c.hoverLabelText(q.xa,q.xLabelVal,fe.xhoverformat),q.xVal=q.xa.c2d(q.xLabelVal)),q.yLabelVal!==void 0&&(q.yLabel="yLabel"in q?q.yLabel:c.hoverLabelText(q.ya,q.yLabelVal,fe.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 et=c.tickText(q.xa,q.xa.c2l(q.xerr),"hover").text;q.xerrneg!==void 0?q.xLabel+=" +"+et+" / -"+c.tickText(q.xa,q.xa.c2l(q.xerrneg),"hover").text:q.xLabel+=" ± "+et,ae==="x"&&(q.distance+=1)}if(!isNaN(q.yerr)&&!(q.ya.type==="log"&&q.yerr<=0)){var Qe=c.tickText(q.ya,q.ya.c2l(q.yerr),"hover").text;q.yerrneg!==void 0?q.yLabel+=" +"+Qe+" / -"+c.tickText(q.ya,q.ya.c2l(q.yerrneg),"hover").text:q.yLabel+=" ± "+Qe,ae==="y"&&(q.distance+=1)}var Ke=q.hoverinfo||q.trace.hoverinfo;return Ke&&Ke!=="all"&&(Ke=Array.isArray(Ke)?Ke:Ke.split("+"),Ke.indexOf("x")===-1&&(q.xLabel=void 0),Ke.indexOf("y")===-1&&(q.yLabel=void 0),Ke.indexOf("z")===-1&&(q.zLabel=void 0),Ke.indexOf("text")===-1&&(q.text=void 0),Ke.indexOf("name")===-1&&(q.name=void 0)),q}function ue(q,ae,ie){var fe=ie.container,we=ie.fullLayout,Ae=we._size,Fe=ie.event,Ce=!!ae.hLinePoint,qe=!!ae.vLinePoint,et,Qe;if(fe.selectAll(".spikeline").remove(),!!(qe||Ce)){var Ke=n.combine(we.plot_bgcolor,we.paper_bgcolor);if(Ce){var Xe=ae.hLinePoint,Me,xe;et=Xe&&Xe.xa,Qe=Xe&&Xe.ya;var ce=Qe.spikesnap;ce==="cursor"?(Me=Fe.pointerX,xe=Fe.pointerY):(Me=et._offset+Xe.x,xe=Qe._offset+Xe.y);var Re=x.readability(Xe.color,Ke)<1.5?n.contrast(Ke):Xe.color,$e=Qe.spikemode,rt=Qe.spikethickness,Je=Qe.spikecolor||Re,At=c.getPxPosition(q,Qe),St,Rt;if($e.indexOf("toaxis")!==-1||$e.indexOf("across")!==-1){if($e.indexOf("toaxis")!==-1&&(St=At,Rt=Me),$e.indexOf("across")!==-1){var Ut=Qe._counterDomainMin,ir=Qe._counterDomainMax;Qe.anchor==="free"&&(Ut=Math.min(Ut,Qe.position),ir=Math.max(ir,Qe.position)),St=Ae.l+Ut*Ae.w,Rt=Ae.l+ir*Ae.w}fe.insert("line",":first-child").attr({x1:St,x2:Rt,y1:xe,y2:xe,"stroke-width":rt,stroke:Je,"stroke-dasharray":i.dashStyle(Qe.spikedash,rt)}).classed("spikeline",!0).classed("crisp",!0),fe.insert("line",":first-child").attr({x1:St,x2:Rt,y1:xe,y2:xe,"stroke-width":rt+2,stroke:Ke}).classed("spikeline",!0).classed("crisp",!0)}$e.indexOf("marker")!==-1&&fe.insert("circle",":first-child").attr({cx:At+(Qe.side!=="right"?rt:-rt),cy:xe,r:rt,fill:Je}).classed("spikeline",!0)}if(qe){var ar=ae.vLinePoint,Mr,fr;et=ar&&ar.xa,Qe=ar&&ar.ya;var dr=et.spikesnap;dr==="cursor"?(Mr=Fe.pointerX,fr=Fe.pointerY):(Mr=et._offset+ar.x,fr=Qe._offset+ar.y);var pt=x.readability(ar.color,Ke)<1.5?n.contrast(Ke):ar.color,ze=et.spikemode,Ge=et.spikethickness,Oe=et.spikecolor||pt,ve=c.getPxPosition(q,et),ge,be;if(ze.indexOf("toaxis")!==-1||ze.indexOf("across")!==-1){if(ze.indexOf("toaxis")!==-1&&(ge=ve,be=fr),ze.indexOf("across")!==-1){var Pe=et._counterDomainMin,We=et._counterDomainMax;et.anchor==="free"&&(Pe=Math.min(Pe,et.position),We=Math.max(We,et.position)),ge=Ae.t+(1-We)*Ae.h,be=Ae.t+(1-Pe)*Ae.h}fe.insert("line",":first-child").attr({x1:Mr,x2:Mr,y1:ge,y2:be,"stroke-width":Ge,stroke:Oe,"stroke-dasharray":i.dashStyle(et.spikedash,Ge)}).classed("spikeline",!0).classed("crisp",!0),fe.insert("line",":first-child").attr({x1:Mr,x2:Mr,y1:ge,y2:be,"stroke-width":Ge+2,stroke:Ke}).classed("spikeline",!0).classed("crisp",!0)}ze.indexOf("marker")!==-1&&fe.insert("circle",":first-child").attr({cx:Mr,cy:ve-(et.side!=="top"?Ge:-Ge),r:Ge,fill:Oe}).classed("spikeline",!0)}}}function oe(q,ae,ie){if(!ie||ie.length!==q._hoverdata.length)return!0;for(var fe=ie.length-1;fe>=0;fe--){var we=ie[fe],Ae=q._hoverdata[fe];if(we.curveNumber!==Ae.curveNumber||String(we.pointNumber)!==String(Ae.pointNumber)||String(we.pointNumbers)!==String(Ae.pointNumbers))return!0}return!1}function le(q,ae){return!0}function j(q,ae){return o.plainText(q||"",{len:ae,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function J(q,ae){for(var ie=ae.charAt(0),fe=[],we=[],Ae=[],Fe=0;Fe"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),o1=He({"src/components/shapes/draw_newshape/constants.js"(Y,G){var d=32;G.exports={CIRCLE_SIDES:d,i000:0,i090:d/4,i180:d/2,i270:d/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),s1=He({"src/components/selections/helpers.js"(Y,G){var d=Gr().strTranslate;function x(t,r){switch(t.type){case"log":return t.p2d(r);case"date":return t.p2r(r,0,t.calendar);default:return t.p2r(r)}}function A(t,r){switch(t.type){case"log":return t.d2p(r);case"date":return t.r2p(r,0,t.calendar);default:return t.r2p(r)}}function E(t){var r=t._id.charAt(0)==="y"?1:0;return function(o){return x(t,o[r])}}function e(t){return d(t.xaxis._offset,t.yaxis._offset)}G.exports={p2r:x,r2p:A,axValue:E,getTransform:e}}}),Gd=He({"src/components/shapes/draw_newshape/helpers.js"(Y){var G=Yg(),d=o1(),x=d.CIRCLE_SIDES,A=d.SQRT2,E=s1(),e=E.p2r,t=E.r2p,r=[0,3,4,5,6,1,2],o=[0,3,4,1,2];Y.writePaths=function(n){var s=n.length;if(!s)return"M0,0Z";for(var c="",f=0;f0&&yl&&(b="X"),b});return f>l&&(y=y.replace(/[\s,]*X.*/,""),d.log("Ignoring extra params in segment "+c)),v+y})}function E(e,t){t=t||0;var r=0;return t&&e&&(e.type==="category"||e.type==="multicategory")&&(r=(e.r2p(1)-e.r2p(0))*t),r}}}),zb=He({"src/components/shapes/display_labels.js"(Y,G){var d=Gr(),x=io(),A=yl(),E=vo(),e=Gd().readPaths,t=Wd(),r=t.getPathString,o=Jm(),a=df().FROM_TL;G.exports=function(c,f,v,h){if(h.selectAll(".shape-label").remove(),!!(v.label.text||v.label.texttemplate)){var T;if(v.label.texttemplate){var l={};if(v.type!=="path"){var y=x.getFromId(c,v.xref),b=x.getFromId(c,v.yref);for(var S in o){var M=o[S](v,y,b);M!==void 0&&(l[S]=M)}}T=d.texttemplateStringForShapes(v.label.texttemplate,{},c._fullLayout._d3locale,l)}else T=v.label.text;var _={"data-index":f},w=v.label.font,p={"data-notex":1},u=h.append("g").attr(_).classed("shape-label",!0),g=u.append("text").attr(p).classed("shape-label-text",!0).text(T),m,R,P,z;if(v.path){var F=r(c,v),B=e(F,c);m=1/0,P=1/0,R=-1/0,z=-1/0;for(var O=0;O=s?h=c-v:h=v-c,-180/Math.PI*Math.atan2(h,T)}function n(s,c,f,v,h,T,l){var y=h.label.textposition,b=h.label.textangle,S=h.label.padding,M=h.type,_=Math.PI/180*T,w=Math.sin(_),p=Math.cos(_),u=h.label.xanchor,g=h.label.yanchor,m,R,P,z;if(M==="line"){y==="start"?(m=s,R=c):y==="end"?(m=f,R=v):(m=(s+f)/2,R=(c+v)/2),u==="auto"&&(y==="start"?b==="auto"?f>s?u="left":fs?u="right":fs?u="right":fs?u="left":f1&&!(Ke.length===2&&Ke[1][0]==="Z")&&(j===0&&(Ke[0][0]="M"),m[le]=Ke,B(),O())}}function fe(Ke,Xe){if(Ke===2){le=+Xe.srcElement.getAttribute("data-i"),j=+Xe.srcElement.getAttribute("data-j");var Me=m[le];!T(Me)&&!l(Me)&&ie()}}function we(Ke){ue=[];for(var Xe=0;XeB&&Pe>O&&!ve.shiftKey?s.getCursor(We/be,1-ct/Pe):"move";c(m,_t),St=_t.split("-")[0]}}function ar(ve){l(g)||(L&&(J=ce(R.xanchor)),N&&($=Re(R.yanchor)),R.type==="path"?Ae=R.path:(ue=L?R.x0:ce(R.x0),oe=N?R.y0:Re(R.y0),le=L?R.x1:ce(R.x1),j=N?R.y1:Re(R.y1)),uej?(X=oe,ae="y0",re=j,ie="y1"):(X=j,ae="y1",re=oe,ie="y0"),ir(ve),ze(z,R),Oe(m,R,g),At.moveFn=St==="move"?dr:pt,At.altKey=ve.altKey)}function Mr(){l(g)||(c(m),Ge(z),S(m,g,R),x.call("_guiRelayout",g,F.getUpdateObj()))}function fr(){l(g)||Ge(z)}function dr(ve,ge){if(R.type==="path"){var be=function(ct){return ct},Pe=be,We=be;L?Q("xanchor",R.xanchor=$e(J+ve)):(Pe=function(_t){return $e(ce(_t)+ve)},Ce&&Ce.type==="date"&&(Pe=v.encodeDate(Pe))),N?Q("yanchor",R.yanchor=rt($+ge)):(We=function(_t){return rt(Re(_t)+ge)},et&&et.type==="date"&&(We=v.encodeDate(We))),Q("path",R.path=_(Ae,Pe,We))}else L?Q("xanchor",R.xanchor=$e(J+ve)):(Q("x0",R.x0=$e(ue+ve)),Q("x1",R.x1=$e(le+ve))),N?Q("yanchor",R.yanchor=rt($+ge)):(Q("y0",R.y0=rt(oe+ge)),Q("y1",R.y1=rt(j+ge)));m.attr("d",h(g,R)),ze(z,R),r(g,P,R,Fe)}function pt(ve,ge){if(Z){var be=function(va){return va},Pe=be,We=be;L?Q("xanchor",R.xanchor=$e(J+ve)):(Pe=function(La){return $e(ce(La)+ve)},Ce&&Ce.type==="date"&&(Pe=v.encodeDate(Pe))),N?Q("yanchor",R.yanchor=rt($+ge)):(We=function(La){return rt(Re(La)+ge)},et&&et.type==="date"&&(We=v.encodeDate(We))),Q("path",R.path=_(Ae,Pe,We))}else if(U){if(St==="resize-over-start-point"){var ct=ue+ve,_t=N?oe-ge:oe+ge;Q("x0",R.x0=L?ct:$e(ct)),Q("y0",R.y0=N?_t:rt(_t))}else if(St==="resize-over-end-point"){var Mt=le+ve,Nt=N?j-ge:j+ge;Q("x1",R.x1=L?Mt:$e(Mt)),Q("y1",R.y1=N?Nt:rt(Nt))}}else{var Bt=function(va){return St.indexOf(va)!==-1},qt=Bt("n"),Zt=Bt("s"),lr=Bt("w"),ta=Bt("e"),da=qt?X+ge:X,wa=Zt?re+ge:re,ma=lr?ee+ve:ee,Ia=ta?q+ve:q;N&&(qt&&(da=X-ge),Zt&&(wa=re-ge)),(!N&&wa-da>O||N&&da-wa>O)&&(Q(ae,R[ae]=N?da:rt(da)),Q(ie,R[ie]=N?wa:rt(wa))),Ia-ma>B&&(Q(fe,R[fe]=L?ma:$e(ma)),Q(we,R[we]=L?Ia:$e(Ia)))}m.attr("d",h(g,R)),ze(z,R),r(g,P,R,Fe)}function ze(ve,ge){(L||N)&&be();function be(){var Pe=ge.type!=="path",We=ve.selectAll(".visual-cue").data([0]),ct=1;We.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":ct}).classed("visual-cue",!0);var _t=ce(L?ge.xanchor:A.midRange(Pe?[ge.x0,ge.x1]:v.extractPathCoords(ge.path,f.paramIsX))),Mt=Re(N?ge.yanchor:A.midRange(Pe?[ge.y0,ge.y1]:v.extractPathCoords(ge.path,f.paramIsY)));if(_t=v.roundPositionForSharpStrokeRendering(_t,ct),Mt=v.roundPositionForSharpStrokeRendering(Mt,ct),L&&N){var Nt="M"+(_t-1-ct)+","+(Mt-1-ct)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";We.attr("d",Nt)}else if(L){var Bt="M"+(_t-1-ct)+","+(Mt-9-ct)+"v18 h2 v-18 Z";We.attr("d",Bt)}else{var qt="M"+(_t-9-ct)+","+(Mt-1-ct)+"h18 v2 h-18 Z";We.attr("d",qt)}}}function Ge(ve){ve.selectAll(".visual-cue").remove()}function Oe(ve,ge,be){var Pe=ge.xref,We=ge.yref,ct=E.getFromId(be,Pe),_t=E.getFromId(be,We),Mt="";Pe!=="paper"&&!ct.autorange&&(Mt+=Pe),We!=="paper"&&!_t.autorange&&(Mt+=We),i.setClipUrl(ve,Mt?"clip"+be._fullLayout._uid+Mt:null,be)}}function _(g,m,R){return g.replace(f.segmentRE,function(P){var z=0,F=P.charAt(0),B=f.paramIsX[F],O=f.paramIsY[F],L=f.numParams[F],N=P.substr(1).replace(f.paramRE,function(U){return z>=L||(B[z]?U=m(U):O[z]&&(U=R(U)),z++),U});return F+N})}function w(g,m){if(y(g)){var R=m.node(),P=+R.getAttribute("data-index");if(P>=0){if(P===g._fullLayout._activeShapeIndex){p(g);return}g._fullLayout._activeShapeIndex=P,g._fullLayout._deactivateShape=p,T(g)}}}function p(g){if(y(g)){var m=g._fullLayout._activeShapeIndex;m>=0&&(o(g),delete g._fullLayout._activeShapeIndex,T(g))}}function u(g){if(y(g)){o(g);var m=g._fullLayout._activeShapeIndex,R=(g.layout||{}).shapes||[];if(m1?(oe=["toggleHover"],le=["resetViews"]):u?(ue=["zoomInGeo","zoomOutGeo"],oe=["hoverClosestGeo"],le=["resetGeo"]):p?(oe=["hoverClosest3d"],le=["resetCameraDefault3d","resetCameraLastSave3d"]):P?(ue=["zoomInMapbox","zoomOutMapbox"],oe=["toggleHover"],le=["resetViewMapbox"]):z?(ue=["zoomInMap","zoomOutMap"],oe=["toggleHover"],le=["resetViewMap"]):g?oe=["hoverClosestPie"]:O?(oe=["hoverClosestCartesian","hoverCompareCartesian"],le=["resetViewSankey"]):oe=["toggleHover"],w&&oe.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(s(T)||N)&&(oe=[]),w&&!L&&(ue=["zoomIn2d","zoomOut2d","autoScale2d"],le[0]!=="resetViews"&&(le=["resetScale2d"])),p?j=["zoom3d","pan3d","orbitRotation","tableRotation"]:w&&!L||R?j=["zoom2d","pan2d"]:P||z||u?j=["pan2d"]:F&&(j=["zoom2d"]),n(T)&&j.push("select2d","lasso2d");var J=[],$=function(q){J.indexOf(q)===-1&&oe.indexOf(q)!==-1&&J.push(q)};if(Array.isArray(M)){for(var X=[],re=0;reb?T.substr(b):l.substr(y))+S}function c(v,h){for(var T=h._size,l=T.h/T.w,y={},b=Object.keys(v),S=0;St*R&&!B)){for(b=0;bj&&ieoe&&(oe=ie);var we=(oe-ue)/(2*le);u/=we,ue=_.l2r(ue),oe=_.l2r(oe),_.range=_._input.range=U=O[1]||Z[1]<=O[0])&&Q[0]L[0])return!0}return!1}function S(O){var L=O._fullLayout,N=L._size,U=N.p,Z=i.list(O,"",!0),Q,ue,oe,le,j,J;if(L._paperdiv.style({width:O._context.responsive&&L.autosize&&!O._context._hasZeroWidth&&!O.layout.width?"100%":L.width+"px",height:O._context.responsive&&L.autosize&&!O._context._hasZeroHeight&&!O.layout.height?"100%":L.height+"px"}).selectAll(".main-svg").call(r.setSize,L.width,L.height),O._context.setBackground(O,L.paper_bgcolor),Y.drawMainTitle(O),a.manage(O),!L._has("cartesian"))return x.previousPromises(O);function $(Oe,ve,ge){var be=Oe._lw/2;if(Oe._id.charAt(0)==="x"){if(ve){if(ge==="top")return ve._offset-U-be}else return N.t+N.h*(1-(Oe.position||0))+be%1;return ve._offset+ve._length+U+be}if(ve){if(ge==="right")return ve._offset+ve._length+U+be}else return N.l+N.w*(Oe.position||0)+be%1;return ve._offset-U-be}for(Q=0;Q0){m(O,Q,j,le),oe.attr({x:ue,y:Q,"text-anchor":U,dy:z(L.yanchor)}).call(E.positionText,ue,Q);var J=(L.text.match(E.BR_TAG_ALL)||[]).length;if(J){var $=n.LINE_SPACING*J+n.MID_SHIFT;L.y===0&&($=-$),oe.selectAll(".line").each(function(){var ae=+this.getAttribute("dy").slice(0,-2)-$+"em";this.setAttribute("dy",ae)})}var X=G.selectAll(".gtitle-subtitle");if(X.node()){var re=oe.node().getBBox(),ee=re.y+re.height,q=ee+o.SUBTITLE_PADDING_EM*L.subtitle.font.size;X.attr({x:ue,y:q,"text-anchor":U,dy:z(L.yanchor)}).call(E.positionText,ue,q)}}}};function p(O,L,N,U,Z){var Q=L.yref==="paper"?O._fullLayout._size.h:O._fullLayout.height,ue=A.isTopAnchor(L)?U:U-Z,oe=N==="b"?Q-ue:ue;return A.isTopAnchor(L)&&N==="t"||A.isBottomAnchor(L)&&N==="b"?!1:oe.5?"t":"b",ue=O._fullLayout.margin[Q],oe=0;return L.yref==="paper"?oe=N+L.pad.t+L.pad.b:L.yref==="container"&&(oe=u(Q,U,Z,O._fullLayout.height,N)+L.pad.t+L.pad.b),oe>ue?oe:0}function m(O,L,N,U){var Z="title.automargin",Q=O._fullLayout.title,ue=Q.y>.5?"t":"b",oe={x:Q.x,y:Q.y,t:0,b:0},le={};Q.yref==="paper"&&p(O,Q,ue,L,U)?oe[ue]=N:Q.yref==="container"&&(le[ue]=N,O._fullLayout._reservedMargin[Z]=le),x.allowAutoMargin(O,Z),x.autoMargin(O,Z,oe)}function R(O,L){var N=O.title,U=O._size,Z=0;switch(L===h?Z=N.pad.l:L===l&&(Z=-N.pad.r),N.xref){case"paper":return U.l+U.w*N.x+Z;case"container":default:return O.width*N.x+Z}}function P(O,L){var N=O.title,U=O._size,Z=0;if(L==="0em"||!L?Z=-N.pad.b:L===n.CAP_SHIFT+"em"&&(Z=N.pad.t),N.y==="auto")return U.t/2;switch(N.yref){case"paper":return U.t+U.h-U.h*N.y+Z;case"container":default:return O.height-O.height*N.y+Z}}function z(O){return O==="top"?n.CAP_SHIFT+.3+"em":O==="bottom"?"-0.3em":n.MID_SHIFT+"em"}function F(O){var L=O.title,N=T;return A.isRightAnchor(L)?N=l:A.isLeftAnchor(L)&&(N=h),N}function B(O){var L=O.title,N="0em";return A.isTopAnchor(L)?N=n.CAP_SHIFT+"em":A.isMiddleAnchor(L)&&(N=n.MID_SHIFT+"em"),N}Y.doTraceStyle=function(O){var L=O.calcdata,N=[],U;for(U=0;U=0;F--){var B=M.append("path").attr(w).style("opacity",F?.1:p).call(E.stroke,g).call(E.fill,u).call(e.dashLine,F?"solid":R,F?4+m:m);if(s(B,h,y),P){var O=t(h.layout,"selections",y);B.style({cursor:"move"});var L={element:B.node(),plotinfo:b,gd:h,editHelpers:O,isActiveSelection:!0},N=d(_,h);x(N,B,L)}else B.style("pointer-events",F?"all":"none");z[F]=B}var U=z[0],Z=z[1];Z.node().addEventListener("click",function(){return c(h,U)})}}function s(h,T,l){var y=l.xref+l.yref;e.setClipUrl(h,"clip"+T._fullLayout._uid+y,T)}function c(h,T){if(i(h)){var l=T.node(),y=+l.getAttribute("data-index");if(y>=0){if(y===h._fullLayout._activeSelectionIndex){v(h);return}h._fullLayout._activeSelectionIndex=y,h._fullLayout._deactivateSelection=v,a(h)}}}function f(h){if(i(h)){var T=h._fullLayout.selections.length-1;h._fullLayout._activeSelectionIndex=T,h._fullLayout._deactivateSelection=v,a(h)}}function v(h){if(i(h)){var T=h._fullLayout._activeSelectionIndex;T>=0&&(A(h),delete h._fullLayout._activeSelectionIndex,a(h))}}}}),gM=He({"node_modules/polybooljs/lib/build-log.js"(Y,G){function d(){var x,A=0,E=!1;function e(t,r){return x.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),x}return x={list:[],segmentId:function(){return A++},checkIntersection:function(t,r){return e("check",{seg1:t,seg2:r})},segmentChop:function(t,r){return e("div_seg",{seg:t,pt:r}),e("chop",{seg:t,pt:r})},statusRemove:function(t){return e("pop_seg",{seg:t})},segmentUpdate:function(t){return e("seg_update",{seg:t})},segmentNew:function(t,r){return e("new_seg",{seg:t,primary:r})},segmentRemove:function(t){return e("rem_seg",{seg:t})},tempStatus:function(t,r,o){return e("temp_status",{seg:t,above:r,below:o})},rewind:function(t){return e("rewind",{seg:t})},status:function(t,r,o){return e("status",{seg:t,above:r,below:o})},vert:function(t){return t===E?x:(E=t,e("vert",{x:t}))},log:function(t){return typeof t!="string"&&(t=JSON.stringify(t,!1," ")),e("log",{txt:t})},reset:function(){return e("reset")},selected:function(t){return e("selected",{segs:t})},chainStart:function(t){return e("chain_start",{seg:t})},chainRemoveHead:function(t,r){return e("chain_rem_head",{index:t,pt:r})},chainRemoveTail:function(t,r){return e("chain_rem_tail",{index:t,pt:r})},chainNew:function(t,r){return e("chain_new",{pt1:t,pt2:r})},chainMatch:function(t){return e("chain_match",{index:t})},chainClose:function(t){return e("chain_close",{index:t})},chainAddHead:function(t,r){return e("chain_add_head",{index:t,pt:r})},chainAddTail:function(t,r){return e("chain_add_tail",{index:t,pt:r})},chainConnect:function(t,r){return e("chain_con",{index1:t,index2:r})},chainReverse:function(t){return e("chain_rev",{index:t})},chainJoin:function(t,r){return e("chain_join",{index1:t,index2:r})},done:function(){return e("done")}},x}G.exports=d}}),yM=He({"node_modules/polybooljs/lib/epsilon.js"(Y,G){function d(x){typeof x!="number"&&(x=1e-10);var A={epsilon:function(E){return typeof E=="number"&&(x=E),x},pointAboveOrOnLine:function(E,e,t){var r=e[0],o=e[1],a=t[0],i=t[1],n=E[0],s=E[1];return(a-r)*(s-o)-(i-o)*(n-r)>=-x},pointBetween:function(E,e,t){var r=E[1]-e[1],o=t[0]-e[0],a=E[0]-e[0],i=t[1]-e[1],n=a*o+r*i;if(n-x)},pointsSameX:function(E,e){return Math.abs(E[0]-e[0])x!=a-r>x&&(o-s)*(r-c)/(a-c)+s-t>x&&(i=!i),o=s,a=c}return i}};return A}G.exports=d}}),mM=He({"node_modules/polybooljs/lib/linked-list.js"(Y,G){var d={create:function(){var x={root:{root:!0,next:null},exists:function(A){return!(A===null||A===x.root)},isEmpty:function(){return x.root.next===null},getHead:function(){return x.root.next},insertBefore:function(A,E){for(var e=x.root,t=x.root.next;t!==null;){if(E(t)){A.prev=t.prev,A.next=t,t.prev.next=A,t.prev=A;return}e=t,t=t.next}e.next=A,A.prev=e,A.next=null},findTransition:function(A){for(var E=x.root,e=x.root.next;e!==null&&!A(e);)E=e,e=e.next;return{before:E===x.root?null:E,after:e,insert:function(t){return t.prev=E,t.next=e,E.next=t,e!==null&&(e.prev=t),t}}}};return x},node:function(x){return x.prev=null,x.next=null,x.remove=function(){x.prev.next=x.next,x.next&&(x.next.prev=x.prev),x.prev=null,x.next=null},x}};G.exports=d}}),_M=He({"node_modules/polybooljs/lib/intersecter.js"(Y,G){var d=mM();function x(A,E,e){function t(T,l){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:null,below:null},otherFill:null}}function r(T,l,y){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:y.myFill.above,below:y.myFill.below},otherFill:null}}var o=d.create();function a(T,l,y,b,S,M){var _=E.pointsCompare(l,S);return _!==0?_:E.pointsSame(y,M)?0:T!==b?T?1:-1:E.pointAboveOrOnLine(y,b?S:M,b?M:S)?1:-1}function i(T,l){o.insertBefore(T,function(y){var b=a(T.isStart,T.pt,l,y.isStart,y.pt,y.other.pt);return b<0})}function n(T,l){var y=d.node({isStart:!0,pt:T.start,seg:T,primary:l,other:null,status:null});return i(y,T.end),y}function s(T,l,y){var b=d.node({isStart:!1,pt:l.end,seg:l,primary:y,other:T,status:null});T.other=b,i(b,T.pt)}function c(T,l){var y=n(T,l);return s(y,T,l),y}function f(T,l){e&&e.segmentChop(T.seg,l),T.other.remove(),T.seg.end=l,T.other.pt=l,i(T.other,T.pt)}function v(T,l){var y=r(l,T.seg.end,T.seg);return f(T,l),c(y,T.primary)}function h(T,l){var y=d.create();function b(B,O){var L=B.seg.start,N=B.seg.end,U=O.seg.start,Z=O.seg.end;return E.pointsCollinear(L,U,Z)?E.pointsCollinear(N,U,Z)||E.pointAboveOrOnLine(N,U,Z)?1:-1:E.pointAboveOrOnLine(L,U,Z)?1:-1}function S(B){return y.findTransition(function(O){var L=b(B,O.ev);return L>0})}function M(B,O){var L=B.seg,N=O.seg,U=L.start,Z=L.end,Q=N.start,ue=N.end;e&&e.checkIntersection(L,N);var oe=E.linesIntersect(U,Z,Q,ue);if(oe===!1){if(!E.pointsCollinear(U,Z,Q)||E.pointsSame(U,ue)||E.pointsSame(Z,Q))return!1;var le=E.pointsSame(U,Q),j=E.pointsSame(Z,ue);if(le&&j)return O;var J=!le&&E.pointBetween(U,Q,ue),$=!j&&E.pointBetween(Z,Q,ue);if(le)return $?v(O,Z):v(B,ue),O;J&&(j||($?v(O,Z):v(B,ue)),v(O,U))}else oe.alongA===0&&(oe.alongB===-1?v(B,Q):oe.alongB===0?v(B,oe.pt):oe.alongB===1&&v(B,ue)),oe.alongB===0&&(oe.alongA===-1?v(O,U):oe.alongA===0?v(O,oe.pt):oe.alongA===1&&v(O,Z));return!1}for(var _=[];!o.isEmpty();){var w=o.getHead();if(e&&e.vert(w.pt[0]),w.isStart){let B=function(){if(u){var O=M(w,u);if(O)return O}return g?M(w,g):!1};e&&e.segmentNew(w.seg,w.primary);var p=S(w),u=p.before?p.before.ev:null,g=p.after?p.after.ev:null;e&&e.tempStatus(w.seg,u?u.seg:!1,g?g.seg:!1);var m=B();if(m){if(A){var R;w.seg.myFill.below===null?R=!0:R=w.seg.myFill.above!==w.seg.myFill.below,R&&(m.seg.myFill.above=!m.seg.myFill.above)}else m.seg.otherFill=w.seg.myFill;e&&e.segmentUpdate(m.seg),w.other.remove(),w.remove()}if(o.getHead()!==w){e&&e.rewind(w.seg);continue}if(A){var R;w.seg.myFill.below===null?R=!0:R=w.seg.myFill.above!==w.seg.myFill.below,g?w.seg.myFill.below=g.seg.myFill.above:w.seg.myFill.below=T,R?w.seg.myFill.above=!w.seg.myFill.below:w.seg.myFill.above=w.seg.myFill.below}else if(w.seg.otherFill===null){var P;g?w.primary===g.primary?P=g.seg.otherFill.above:P=g.seg.myFill.above:P=w.primary?l:T,w.seg.otherFill={above:P,below:P}}e&&e.status(w.seg,u?u.seg:!1,g?g.seg:!1),w.other.status=p.insert(d.node({ev:w}))}else{var z=w.status;if(z===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(y.exists(z.prev)&&y.exists(z.next)&&M(z.prev.ev,z.next.ev),e&&e.statusRemove(z.ev.seg),z.remove(),!w.primary){var F=w.seg.myFill;w.seg.myFill=w.seg.otherFill,w.seg.otherFill=F}_.push(w.seg)}o.getHead().remove()}return e&&e.done(),_}return A?{addRegion:function(T){for(var l,y=T[T.length-1],b=0;br!=v>r&&t<(f-s)*(r-c)/(v-c)+s;h&&(o=!o)}return o}}}),ey=He({"src/lib/polygon.js"(Y,G){var d=Km().dot,x=lo().BADNUM,A=G.exports={};A.tester=function(e){var t=e.slice(),r=t[0][0],o=r,a=t[0][1],i=a,n;for((t[t.length-1][0]!==t[0][0]||t[t.length-1][1]!==t[0][1])&&t.push(t[0]),n=1;no||S===x||Si||y&&c(l))}function v(l,y){var b=l[0],S=l[1];if(b===x||bo||S===x||Si)return!1;var M=t.length,_=t[0][0],w=t[0][1],p=0,u,g,m,R,P;for(u=1;uMath.max(g,_)||S>Math.max(m,w)))if(Sn||Math.abs(d(v,c))>o)return!0;return!1},A.filter=function(e,t){var r=[e[0]],o=0,a=0;function i(s){e.push(s);var c=r.length,f=o;r.splice(a+1);for(var v=f+1;v1){var n=e.pop();i(n)}return{addPt:i,raw:e,filtered:r}}}}),SM=He({"src/components/selections/constants.js"(Y,G){G.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),MM=He({"src/components/selections/select.js"(Y,G){var d=TM(),x=AM(),A=Ei(),E=vo().dashStyle,e=Ai(),t=Wu(),r=Ph().makeEventData,o=bv(),a=o.freeMode,i=o.rectMode,n=o.drawMode,s=o.openMode,c=o.selectMode,f=Wd(),v=$g(),h=u1(),T=jd().clearOutline,l=Gd(),y=l.handleEllipse,b=l.readPaths,S=l1().newShapes,M=Db(),_=jb().activateLastSelection,w=Gr(),p=w.sorterAsc,u=ey(),g=e1(),m=oc().getFromId,R=Jg(),P=Qg().redrawReglTraces,z=SM(),F=z.MINSELECT,B=u.filter,O=u.tester,L=s1(),N=L.p2r,U=L.axValue,Z=L.getTransform;function Q(ze){return ze.subplot!==void 0}function ue(ze,Ge,Oe,ve,ge){var be=!Q(ve),Pe=a(ge),We=i(ge),ct=s(ge),_t=n(ge),Mt=c(ge),Nt=ge==="drawline",Bt=ge==="drawcircle",qt=Nt||Bt,Zt=ve.gd,lr=Zt._fullLayout,ta=Mt&&lr.newselection.mode==="immediate"&&be,da=lr._zoomlayer,wa=ve.element.getBoundingClientRect(),ma=ve.plotinfo,Ia=Z(ma),va=Ge-wa.left,La=Oe-wa.top;lr._calcInverseTransform(Zt);var Ka=w.apply3DTransform(lr._invTransform)(va,La);va=Ka[0],La=Ka[1];var Vt=lr._invScaleX,Lt=lr._invScaleY,jt=va,Ot=La,gr="M"+va+","+La,Br=ve.xaxes[0],na=ve.yaxes[0],Ur=Br._length,ga=na._length,Aa=ze.altKey&&!(n(ge)&&ct),Pa,sa,Oa,dt,vt,Lr,Er;X(ze,Zt,ve),Pe&&(Pa=B([[va,La]],z.BENDPX));var _r=da.selectAll("path.select-outline-"+ma.id).data([1]),yr=_t?lr.newshape:lr.newselection;_t&&(ve.hasText=yr.label.text||yr.label.texttemplate);var kr=_t&&!ct?yr.fillcolor:"rgba(0,0,0,0)",zr=yr.line.color||(be?e.contrast(Zt._fullLayout.plot_bgcolor):"#7f7f7f");_r.enter().append("path").attr("class","select-outline select-outline-"+ma.id).style({opacity:_t?yr.opacity/2:1,"stroke-dasharray":E(yr.line.dash,yr.line.width),"stroke-width":yr.line.width+"px","shape-rendering":"crispEdges"}).call(e.stroke,zr).call(e.fill,kr).attr("fill-rule","evenodd").classed("cursor-move",!!_t).attr("transform",Ia).attr("d",gr+"Z");var Pr=da.append("path").attr("class","zoombox-corners").style({fill:e.background,stroke:e.defaultLine,"stroke-width":1}).attr("transform",Ia).attr("d","M0,0Z");if(_t&&ve.hasText){var Hr=da.select(".label-temp");Hr.empty()&&(Hr=da.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Zr=lr._uid+z.SELECTID,Jr=[],wt=ie(Zt,ve.xaxes,ve.yaxes,ve.subplot);ta&&!ze.shiftKey&&(ve._clearSubplotSelections=function(){if(be){var mr=Br._id,$r=na._id;rt(Zt,mr,$r,wt);for(var oa=(Zt.layout||{}).selections||[],Sa=[],ya=!1,ra=0;ra=0){Zt._fullLayout._deactivateShape(Zt);return}if(!_t){var oa=lr.clickmode;g.done(Zr).then(function(){if(g.clear(Zr),mr===2){for(_r.remove(),vt=0;vt-1&&oe($r,Zt,ve.xaxes,ve.yaxes,ve.subplot,ve,_r),oa==="event"&&dr(Zt,void 0);t.click(Zt,$r,ma.id)}).catch(w.error)}},ve.doneFn=function(){Pr.remove(),g.done(Zr).then(function(){g.clear(Zr),!ta&&dt&&ve.selectionDefs&&(dt.subtract=Aa,ve.selectionDefs.push(dt),ve.mergedPolygons.length=0,[].push.apply(ve.mergedPolygons,Oa)),(ta||_t)&&q(ve,ta),ve.doneFnCompleted&&ve.doneFnCompleted(Jr),Mt&&dr(Zt,Er)}).catch(w.error)}}function oe(ze,Ge,Oe,ve,ge,be,Pe){var We=Ge._hoverdata,ct=Ge._fullLayout,_t=ct.clickmode,Mt=_t.indexOf("event")>-1,Nt=[],Bt,qt,Zt,lr,ta,da,wa,ma,Ia,va;if(we(We)){X(ze,Ge,be),Bt=ie(Ge,Oe,ve,ge);var La=Ae(We,Bt),Ka=La.pointNumbers.length>0;if(Ka?Ce(Bt,La):qe(Bt)&&(wa=Fe(La))){for(Pe&&Pe.remove(),va=0;va=0}function ee(ze){return ze._fullLayout._activeSelectionIndex>=0}function q(ze,Ge){var Oe=ze.dragmode,ve=ze.plotinfo,ge=ze.gd;re(ge)&&ge._fullLayout._deactivateShape(ge),ee(ge)&&ge._fullLayout._deactivateSelection(ge);var be=ge._fullLayout,Pe=be._zoomlayer,We=n(Oe),ct=c(Oe);if(We||ct){var _t=Pe.selectAll(".select-outline-"+ve.id);if(_t&&ge._fullLayout._outlining){var Mt;We&&(Mt=S(_t,ze)),Mt&&A.call("_guiRelayout",ge,{shapes:Mt});var Nt;ct&&!Q(ze)&&(Nt=M(_t,ze)),Nt&&(ge._fullLayout._noEmitSelectedAtStart=!0,A.call("_guiRelayout",ge,{selections:Nt}).then(function(){Ge&&_(ge)})),ge._fullLayout._outlining=!1}}ve.selection={},ve.selection.selectionDefs=ze.selectionDefs=[],ve.selection.mergedPolygons=ze.mergedPolygons=[]}function ae(ze){return ze._id}function ie(ze,Ge,Oe,ve){if(!ze.calcdata)return[];var ge=[],be=Ge.map(ae),Pe=Oe.map(ae),We,ct,_t;for(_t=0;_t0,be=ge?ve[0]:Oe;return Ge.selectedpoints?Ge.selectedpoints.indexOf(be)>-1:!1}function Ce(ze,Ge){var Oe=[],ve,ge,be,Pe;for(Pe=0;Pe0&&Oe.push(ve);if(Oe.length===1&&(be=Oe[0]===Ge.searchInfo,be&&(ge=Ge.searchInfo.cd[0].trace,ge.selectedpoints.length===Ge.pointNumbers.length))){for(Pe=0;Pe1||(Ge+=ve.selectedpoints.length,Ge>1)))return!1;return Ge===1}function et(ze,Ge,Oe){var ve;for(ve=0;ve-1&&Ge;if(!Pe&&Ge){var mr=At(ze,!0);if(mr.length){var $r=mr[0].xref,oa=mr[0].yref;if($r&&oa){var Sa=Ut(mr),ya=ar([m(ze,$r,"x"),m(ze,oa,"y")]);ya(Jr,Sa)}}ze._fullLayout._noEmitSelectedAtStart?ze._fullLayout._noEmitSelectedAtStart=!1:Qt&&dr(ze,Jr),Bt._reselect=!1}if(!Pe&&Bt._deselect){var ra=Bt._deselect;We=ra.xref,ct=ra.yref,$e(We,ct,Mt)||rt(ze,We,ct,ve),Qt&&(Jr.points.length?dr(ze,Jr):pt(ze)),Bt._deselect=!1}return{eventData:Jr,selectionTesters:Oe}}function Re(ze){var Ge=ze.calcdata;if(Ge)for(var Oe=0;Oe=0){kr._fullLayout._deactivateShape(kr);return}var zr=kr._fullLayout.clickmode;if(J(kr),_r===2&&!Me&&sa(),Xe)zr.indexOf("select")>-1&&p(yr,kr,rt,Je,we.id,Mt),zr.indexOf("event")>-1&&n.click(kr,yr,we.id);else if(_r===1&&Me){var Pr=et?ce:xe,Hr=et==="s"||Qe==="w"?0:1,Zr=Pr._name+".range["+Hr+"]",Jr=L(Pr,Hr),wt="left",Qt="middle";if(Pr.fixedrange)return;et?(Qt=et==="n"?"top":"bottom",Pr.side==="right"&&(wt="right")):Qe==="e"&&(wt="right"),kr._context.showAxisRangeEntryBoxes&&d.select(_t).call(o.makeEditable,{gd:kr,immediate:!0,background:kr._fullLayout.paper_bgcolor,text:String(Jr),fill:Pr.tickfont?Pr.tickfont.color:"#444",horizontalAlign:wt,verticalAlign:Qt}).on("edit",function(mr){var $r=Pr.d2r(mr);$r!==void 0&&t.call("_guiRelayout",kr,Zr,$r)})}}f.init(Mt);var qt,Zt,lr,ta,da,wa,ma,Ia,va,La;function Ka(_r,yr,kr){var zr=_t.getBoundingClientRect();qt=yr-zr.left,Zt=kr-zr.top,fe._fullLayout._calcInverseTransform(fe);var Pr=x.apply3DTransform(fe._fullLayout._invTransform)(qt,Zt);qt=Pr[0],Zt=Pr[1],lr={l:qt,r:qt,w:0,t:Zt,b:Zt,h:0},ta=fe._hmpixcount?fe._hmlumcount/fe._hmpixcount:E(fe._fullLayout.plot_bgcolor).getLuminance(),da="M0,0H"+Rt+"V"+Ut+"H0V0",wa=!1,ma="xy",La=!1,Ia=ue(Ke,ta,At,St,da),va=oe(Ke,At,St)}function Vt(_r,yr){if(fe._transitioningWithDuration)return!1;var kr=Math.max(0,Math.min(Rt,be*_r+qt)),zr=Math.max(0,Math.min(Ut,Pe*yr+Zt)),Pr=Math.abs(kr-qt),Hr=Math.abs(zr-Zt);lr.l=Math.min(qt,kr),lr.r=Math.max(qt,kr),lr.t=Math.min(Zt,zr),lr.b=Math.max(Zt,zr);function Zr(){ma="",lr.r=lr.l,lr.t=lr.b,va.attr("d","M0,0Z")}if(ir.isSubplotConstrained)Pr>R||Hr>R?(ma="xy",Pr/Rt>Hr/Ut?(Hr=Pr*Ut/Rt,Zt>zr?lr.t=Zt-Hr:lr.b=Zt+Hr):(Pr=Hr*Rt/Ut,qt>kr?lr.l=qt-Pr:lr.r=qt+Pr),va.attr("d",ee(lr))):Zr();else if(ar.isSubplotConstrained)if(Pr>R||Hr>R){ma="xy";var Jr=Math.min(lr.l/Rt,(Ut-lr.b)/Ut),wt=Math.max(lr.r/Rt,(Ut-lr.t)/Ut);lr.l=Jr*Rt,lr.r=wt*Rt,lr.b=(1-Jr)*Ut,lr.t=(1-wt)*Ut,va.attr("d",ee(lr))}else Zr();else!fr||Hr0){var mr;if(ar.isSubplotConstrained||!Mr&&fr.length===1){for(mr=0;mr1&&(Zr.maxallowed!==void 0&&pt===(Zr.range[0]1&&(Jr.maxallowed!==void 0&&ze===(Jr.range[0]=0?Math.min(fe,.9):1/(1/Math.max(fe,-.3)+3.222))}function Q(fe,we,Ae){return fe?fe==="nsew"?Ae?"":we==="pan"?"move":"crosshair":fe.toLowerCase()+"-resize":"pointer"}function ue(fe,we,Ae,Fe,Ce){return fe.append("path").attr("class","zoombox").style({fill:we>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",r(Ae,Fe)).attr("d",Ce+"Z")}function oe(fe,we,Ae){return fe.append("path").attr("class","zoombox-corners").style({fill:a.background,stroke:a.defaultLine,"stroke-width":1,opacity:0}).attr("transform",r(we,Ae)).attr("d","M0,0Z")}function le(fe,we,Ae,Fe,Ce,qe){fe.attr("d",Fe+"M"+Ae.l+","+Ae.t+"v"+Ae.h+"h"+Ae.w+"v-"+Ae.h+"h-"+Ae.w+"Z"),j(fe,we,Ce,qe)}function j(fe,we,Ae,Fe){Ae||(fe.transition().style("fill",Fe>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),we.transition().style("opacity",1).duration(200))}function J(fe){d.select(fe).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function $(fe){P&&fe.data&&fe._context.showTips&&(x.notifier(x._(fe,"Double-click to zoom back out"),"long"),P=!1)}function X(fe,we){return"M"+(fe.l-.5)+","+(we-R-.5)+"h-3v"+(2*R+1)+"h3ZM"+(fe.r+.5)+","+(we-R-.5)+"h3v"+(2*R+1)+"h-3Z"}function re(fe,we){return"M"+(we-R-.5)+","+(fe.t-.5)+"v-3h"+(2*R+1)+"v3ZM"+(we-R-.5)+","+(fe.b+.5)+"v3h"+(2*R+1)+"v-3Z"}function ee(fe){var we=Math.floor(Math.min(fe.b-fe.t,fe.r-fe.l,R)/2);return"M"+(fe.l-3.5)+","+(fe.t-.5+we)+"h3v"+-we+"h"+we+"v-3h-"+(we+3)+"ZM"+(fe.r+3.5)+","+(fe.t-.5+we)+"h-3v"+-we+"h"+-we+"v-3h"+(we+3)+"ZM"+(fe.r+3.5)+","+(fe.b+.5-we)+"h-3v"+we+"h"+-we+"v3h"+(we+3)+"ZM"+(fe.l-3.5)+","+(fe.b+.5-we)+"h3v"+we+"h"+we+"v3h-"+(we+3)+"Z"}function q(fe,we,Ae,Fe,Ce){for(var qe=!1,et={},Qe={},Ke,Xe,Me,xe,ce=(Ce||{}).xaHash,Re=(Ce||{}).yaHash,$e=0;$e1&&x.warn("Full array edits are incompatible with other edits",c);var b=i[""][""];if(t(b))a.set(null);else if(Array.isArray(b))a.set(b);else return x.warn("Unrecognized full array edit value",c,b),!0;return T?!1:(f(l,y),v(o),!0)}var S=Object.keys(i).map(Number).sort(A),M=a.get(),_=M||[],w=s(y,c).get(),p=[],u=-1,g=_.length,m,R,P,z,F,B,O,L;for(m=0;m_.length-(O?0:1)){x.warn("index out of range",c,P);continue}if(B!==void 0)F.length>1&&x.warn("Insertion & removal are incompatible with edits to the same index.",c,P),t(B)?p.push(P):O?(B==="add"&&(B={}),_.splice(P,0,B),w&&w.splice(P,0,{})):x.warn("Unrecognized full object edit value",c,P,B),u===-1&&(u=P);else for(R=0;R=0;m--)_.splice(p[m],1),w&&w.splice(p[m],1);if(_.length?M||a.set(_):a.set(null),T)return!1;if(f(l,y),h!==d){var N;if(u===-1)N=S;else{for(g=Math.max(_.length,g),N=[],m=0;m=u));m++)N.push(P);for(m=u;m0&&x.log("Clearing previous rejected promises from queue."),T._promises=[]},Y.cleanLayout=function(T){var l;T||(T={}),T.xaxis1&&(T.xaxis||(T.xaxis=T.xaxis1),delete T.xaxis1),T.yaxis1&&(T.yaxis||(T.yaxis=T.yaxis1),delete T.yaxis1),T.scene1&&(T.scene||(T.scene=T.scene1),delete T.scene1);var y=(A.subplotsRegistry.cartesian||{}).attrRegex;(A.subplotsRegistry.polar||{}).attrRegex,(A.subplotsRegistry.ternary||{}).attrRegex,(A.subplotsRegistry.gl3d||{}).attrRegex;var b=Object.keys(T);for(l=0;l3?(R.x=1.02,R.xanchor="left"):R.x<-2&&(R.x=-.02,R.xanchor="right"),R.y>3?(R.y=1.02,R.yanchor="bottom"):R.y<-2&&(R.y=-.02,R.yanchor="top")),T.dragmode==="rotate"&&(T.dragmode="orbit"),e.clean(T),T.template&&T.template.layout&&Y.cleanLayout(T.template.layout),T};function a(T,l){var y=T[l],b=l.charAt(0);y&&y!=="paper"&&(T[l]=t(y,b,!0))}Y.cleanData=function(T){for(var l=0;l0)return T.substr(0,l)}Y.hasParent=function(T,l){for(var y=v(l);y;){if(y in T)return!0;y=v(y)}return!1};var h=["x","y","z"];Y.clearAxisTypes=function(T,l,y){for(var b=0;b=ve.data.length||We<-ve.data.length)throw new Error(be+" must be valid indices for gd.data.");if(ge.indexOf(We,Pe+1)>-1||We>=0&&ge.indexOf(-ve.data.length+We)>-1||We<0&&ge.indexOf(ve.data.length+We)>-1)throw new Error("each index in "+be+" must be unique.")}}function N(ve,ge,be){if(!Array.isArray(ve.data))throw new Error("gd.data must be an array.");if(typeof ge>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(ge)||(ge=[ge]),L(ve,ge,"currentIndices"),typeof be<"u"&&!Array.isArray(be)&&(be=[be]),typeof be<"u"&&L(ve,be,"newIndices"),typeof be<"u"&&ge.length!==be.length)throw new Error("current and new indices must be of equal length.")}function U(ve,ge,be){var Pe,We;if(!Array.isArray(ve.data))throw new Error("gd.data must be an array.");if(typeof ge>"u")throw new Error("traces must be defined.");for(Array.isArray(ge)||(ge=[ge]),Pe=0;Pe"u")throw new Error("indices must be an integer or array of integers");L(ve,be,"indices");for(var ct in ge){if(!Array.isArray(ge[ct])||ge[ct].length!==be.length)throw new Error("attribute "+ct+" must be an array of length equal to indices array length");if(We&&(!(ct in Pe)||!Array.isArray(Pe[ct])||Pe[ct].length!==ge[ct].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}function Q(ve,ge,be,Pe){var We=A.isPlainObject(Pe),ct=[],_t,Mt,Nt,Bt,qt;Array.isArray(be)||(be=[be]),be=O(be,ve.data.length-1);for(var Zt in ge)for(var lr=0;lr=0&&qt=0&&qt"u")return Bt=Y.redraw(ve),t.add(ve,We,_t,ct,Mt),Bt;Array.isArray(be)||(be=[be]);try{N(ve,Pe,be)}catch(qt){throw ve.data.splice(ve.data.length-ge.length,ge.length),qt}return t.startSequence(ve),t.add(ve,We,_t,ct,Mt),Bt=Y.moveTraces(ve,Pe,be),t.stopSequence(ve),Bt}function $(ve,ge){ve=A.getGraphDiv(ve);var be=[],Pe=Y.addTraces,We=$,ct=[ve,be,ge],_t=[ve,ge],Mt,Nt;if(typeof ge>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(ge)||(ge=[ge]),L(ve,ge,"indices"),ge=O(ge,ve.data.length-1),ge.sort(A.sorterDes),Mt=0;Mt"u")for(be=[],Bt=0;Bt0&&typeof Ot.parts[na]!="string";)na--;var Ur=Ot.parts[na],ga=Ot.parts[na-1]+"."+Ur,Aa=Ot.parts.slice(0,na).join("."),Pa=E(ve.layout,Aa).get(),sa=E(Pe,Aa).get(),Oa=Ot.get();if(gr!==void 0){Ia[jt]=gr,va[jt]=Ur==="reverse"?gr:ee(Oa);var dt=o.getLayoutValObject(Pe,Ot.parts);if(dt&&dt.impliedEdits&&gr!==null)for(var vt in dt.impliedEdits)La(A.relativeAttr(jt,vt),dt.impliedEdits[vt]);if(["width","height"].indexOf(jt)!==-1)if(gr){La("autosize",null);var Lr=jt==="height"?"width":"height";La(Lr,Pe[Lr])}else Pe[jt]=ve._initialAutoSize[jt];else if(jt==="autosize")La("width",gr?null:Pe.width),La("height",gr?null:Pe.height);else if(ga.match(Ce))Lt(ga),E(Pe,Aa+"._inputRange").set(null);else if(ga.match(qe)){Lt(ga),E(Pe,Aa+"._inputRange").set(null);var Er=E(Pe,Aa).get();Er._inputDomain&&(Er._input.domain=Er._inputDomain.slice())}else ga.match(et)&&E(Pe,Aa+"._inputDomain").set(null);if(Ur==="type"){Vt=Pa;var _r=sa.type==="linear"&&gr==="log",yr=sa.type==="log"&&gr==="linear";if(_r||yr){if(!Vt||!Vt.range)La(Aa+".autorange",!0);else if(sa.autorange)_r&&(Vt.range=Vt.range[1]>Vt.range[0]?[1,2]:[2,1]);else{var kr=Vt.range[0],zr=Vt.range[1];_r?(kr<=0&&zr<=0&&La(Aa+".autorange",!0),kr<=0?kr=zr/1e6:zr<=0&&(zr=kr/1e6),La(Aa+".range[0]",Math.log(kr)/Math.LN10),La(Aa+".range[1]",Math.log(zr)/Math.LN10)):(La(Aa+".range[0]",Math.pow(10,kr)),La(Aa+".range[1]",Math.pow(10,zr)))}Array.isArray(Pe._subplots.polar)&&Pe._subplots.polar.length&&Pe[Ot.parts[0]]&&Ot.parts[1]==="radialaxis"&&delete Pe[Ot.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(ve,sa,gr,La),r.getComponentMethod("images","convertCoords")(ve,sa,gr,La)}else La(Aa+".autorange",!0),La(Aa+".range",null);E(Pe,Aa+"._inputRange").set(null)}else if(Ur.match(_)){var Pr=E(Pe,jt).get(),Hr=(gr||{}).type;(!Hr||Hr==="-")&&(Hr="linear"),r.getComponentMethod("annotations","convertCoords")(ve,Pr,Hr,La),r.getComponentMethod("images","convertCoords")(ve,Pr,Hr,La)}var Zr=y.containerArrayMatch(jt);if(Zr){qt=Zr.array,Zt=Zr.index;var Jr=Zr.property,wt=dt||{editType:"calc"};Zt!==""&&Jr===""&&(y.isAddVal(gr)?va[jt]=null:y.isRemoveVal(gr)?va[jt]=(E(be,qt).get()||[])[Zt]:A.warn("unrecognized full object value",ge)),M.update(ma,wt),Bt[qt]||(Bt[qt]={});var Qt=Bt[qt][Zt];Qt||(Qt=Bt[qt][Zt]={}),Qt[Jr]=gr,delete ge[jt]}else Ur==="reverse"?(Pa.range?Pa.range.reverse():(La(Aa+".autorange",!0),Pa.range=[1,0]),sa.autorange?ma.calc=!0:ma.plot=!0):(jt==="dragmode"&&(gr===!1&&Oa!==!1||gr!==!1&&Oa===!1)||Pe._has("scatter-like")&&Pe._has("regl")&&jt==="dragmode"&&(gr==="lasso"||gr==="select")&&!(Oa==="lasso"||Oa==="select")?ma.plot=!0:dt?M.update(ma,dt):ma.calc=!0,Ot.set(gr))}}for(qt in Bt){var mr=y.applyContainerArrayChanges(ve,ct(be,qt),Bt[qt],ma,ct);mr||(ma.plot=!0)}for(var $r in Ka){Vt=i.getFromId(ve,$r);var oa=Vt&&Vt._constraintGroup;if(oa){ma.calc=!0;for(var Sa in oa)Ka[Sa]||(i.getFromId(ve,Sa)._constraintShrinkable=!0)}}(Ke(ve)||ge.height||ge.width)&&(ma.plot=!0);var ya=Pe.shapes;for(Zt=0;Zt1;)if(Pe.pop(),be=E(ge,Pe.join(".")+".uirevision").get(),be!==void 0)return be;return ge.uirevision}function rt(ve,ge){for(var be=0;be=We.length?We[0]:We[Bt]:We}function Mt(Bt){return Array.isArray(ct)?Bt>=ct.length?ct[0]:ct[Bt]:ct}function Nt(Bt,qt){var Zt=0;return function(){if(Bt&&++Zt===qt)return Bt()}}return new Promise(function(Bt,qt){function Zt(){if(Pe._frameQueue.length!==0){for(;Pe._frameQueue.length;){var Ur=Pe._frameQueue.pop();Ur.onInterrupt&&Ur.onInterrupt()}ve.emit("plotly_animationinterrupted",[])}}function lr(Ur){if(Ur.length!==0){for(var ga=0;gaPe._timeToNext&&da()};Ur()}var ma=0;function Ia(Ur){return Array.isArray(We)?ma>=We.length?Ur.transitionOpts=We[ma]:Ur.transitionOpts=We[0]:Ur.transitionOpts=We,ma++,Ur}var va,La,Ka=[],Vt=ge==null,Lt=Array.isArray(ge),jt=!Vt&&!Lt&&A.isPlainObject(ge);if(jt)Ka.push({type:"object",data:Ia(A.extendFlat({},ge))});else if(Vt||["string","number"].indexOf(typeof ge)!==-1)for(va=0;va0&&BrBr)&&na.push(La);Ka=na}}Ka.length>0?lr(Ka):(ve.emit("plotly_animated"),Bt())})}function dr(ve,ge,be){if(ve=A.getGraphDiv(ve),ge==null)return Promise.resolve();if(!A.isPlotDiv(ve))throw new Error("This element is not a Plotly plot: "+ve+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var Pe,We,ct,_t,Mt=ve._transitionData._frames,Nt=ve._transitionData._frameHash;if(!Array.isArray(ge))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+ge);var Bt=Mt.length+ge.length*2,qt=[],Zt={};for(Pe=ge.length-1;Pe>=0;Pe--)if(A.isPlainObject(ge[Pe])){var lr=ge[Pe].name,ta=(Nt[lr]||Zt[lr]||{}).name,da=ge[Pe].name,wa=Nt[ta]||Zt[ta];ta&&da&&typeof da=="number"&&wa&&wOt.index?-1:jt.index=0;Pe--){if(We=qt[Pe].frame,typeof We.name=="number"&&A.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!We.name)for(;Nt[We.name="frame "+ve._transitionData._counter++];);if(Nt[We.name]){for(ct=0;ct=0;be--)Pe=ge[be],ct.push({type:"delete",index:Pe}),_t.unshift({type:"insert",index:Pe,value:We[Pe]});var Mt=a.modifyFrames,Nt=a.modifyFrames,Bt=[ve,_t],qt=[ve,ct];return t&&t.add(ve,Mt,Bt,Nt,qt),a.modifyFrames(ve,ct)}function ze(ve){ve=A.getGraphDiv(ve);var ge=ve._fullLayout||{},be=ve._fullData||[];return a.cleanPlot([],{},be,ge),a.purge(ve),e.purge(ve),ge._container&&ge._container.remove(),delete ve._context,ve}function Ge(ve){var ge=ve._fullLayout,be=ve.getBoundingClientRect();if(!A.equalDomRects(be,ge._lastBBox)){var Pe=ge._invTransform=A.inverseTransformMatrix(A.getFullTransformMatrix(ve));ge._invScaleX=Math.sqrt(Pe[0][0]*Pe[0][0]+Pe[0][1]*Pe[0][1]+Pe[0][2]*Pe[0][2]),ge._invScaleY=Math.sqrt(Pe[1][0]*Pe[1][0]+Pe[1][1]*Pe[1][1]+Pe[1][2]*Pe[1][2]),ge._lastBBox=be}}function Oe(ve){var ge=G.select(ve),be=ve._fullLayout;if(be._calcInverseTransform=Ge,be._calcInverseTransform(ve),be._container=ge.selectAll(".plot-container").data([0]),be._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),be._paperdiv=be._container.selectAll(".svg-container").data([0]),be._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),be._glcontainer=be._paperdiv.selectAll(".gl-container").data([{}]),be._glcontainer.enter().append("div").classed("gl-container",!0),be._paperdiv.selectAll(".main-svg").remove(),be._paperdiv.select(".modebar-container").remove(),be._paper=be._paperdiv.insert("svg",":first-child").classed("main-svg",!0),be._toppaper=be._paperdiv.append("svg").classed("main-svg",!0),be._modebardiv=be._paperdiv.append("div"),delete be._modeBar,be._hoverpaper=be._paperdiv.append("svg").classed("main-svg",!0),!be._uid){var Pe={};G.selectAll("defs").each(function(){this.id&&(Pe[this.id.split("-")[1]]=1)}),be._uid=A.randstr(Pe)}be._paperdiv.selectAll(".main-svg").attr(h.svgAttrs),be._defs=be._paper.append("defs").attr("id","defs-"+be._uid),be._clips=be._defs.append("g").classed("clips",!0),be._topdefs=be._toppaper.append("defs").attr("id","topdefs-"+be._uid),be._topclips=be._topdefs.append("g").classed("clips",!0),be._bgLayer=be._paper.append("g").classed("bglayer",!0),be._draggers=be._paper.append("g").classed("draglayer",!0);var We=be._paper.append("g").classed("layer-below",!0);be._imageLowerLayer=We.append("g").classed("imagelayer",!0),be._shapeLowerLayer=We.append("g").classed("shapelayer",!0),be._cartesianlayer=be._paper.append("g").classed("cartesianlayer",!0),be._polarlayer=be._paper.append("g").classed("polarlayer",!0),be._smithlayer=be._paper.append("g").classed("smithlayer",!0),be._ternarylayer=be._paper.append("g").classed("ternarylayer",!0),be._geolayer=be._paper.append("g").classed("geolayer",!0),be._funnelarealayer=be._paper.append("g").classed("funnelarealayer",!0),be._pielayer=be._paper.append("g").classed("pielayer",!0),be._iciclelayer=be._paper.append("g").classed("iciclelayer",!0),be._treemaplayer=be._paper.append("g").classed("treemaplayer",!0),be._sunburstlayer=be._paper.append("g").classed("sunburstlayer",!0),be._indicatorlayer=be._toppaper.append("g").classed("indicatorlayer",!0),be._glimages=be._paper.append("g").classed("glimages",!0);var ct=be._toppaper.append("g").classed("layer-above",!0);be._imageUpperLayer=ct.append("g").classed("imagelayer",!0),be._shapeUpperLayer=ct.append("g").classed("shapelayer",!0),be._selectionLayer=be._toppaper.append("g").classed("selectionlayer",!0),be._infolayer=be._toppaper.append("g").classed("infolayer",!0),be._menulayer=be._toppaper.append("g").classed("menulayer",!0),be._zoomlayer=be._toppaper.append("g").classed("zoomlayer",!0),be._hoverlayer=be._hoverpaper.append("g").classed("hoverlayer",!0),be._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),ve.emit("plotly_framework")}Y.animate=fr,Y.addFrames=dr,Y.deleteFrames=pt,Y.addTraces=J,Y.deleteTraces=$,Y.extendTraces=le,Y.moveTraces=X,Y.prependTraces=j,Y.newPlot=B,Y._doPlot=u,Y.purge=ze,Y.react=Rt,Y.redraw=F,Y.relayout=we,Y.restyle=re,Y.setPlotConfig=m,Y.update=Xe,Y._guiRelayout=Me(we),Y._guiRestyle=Me(re),Y._guiUpdate=Me(Xe),Y._storeDirectGUIEdit=ie}}),id=He({"src/snapshot/helpers.js"(Y){var G=Ei();Y.getDelay=function(A){return A._has&&(A._has("gl3d")||A._has("mapbox")||A._has("map"))?500:0},Y.getRedrawFunc=function(A){return function(){G.getComponentMethod("colorbar","draw")(A)}},Y.encodeSVG=function(A){return"data:image/svg+xml,"+encodeURIComponent(A)},Y.encodeJSON=function(A){return"data:application/json,"+encodeURIComponent(A)};var d=window.URL||window.webkitURL;Y.createObjectURL=function(A){return d.createObjectURL(A)},Y.revokeObjectURL=function(A){return d.revokeObjectURL(A)},Y.createBlob=function(A,E){if(E==="svg")return new window.Blob([A],{type:"image/svg+xml;charset=utf-8"});if(E==="full-json")return new window.Blob([A],{type:"application/json;charset=utf-8"});var e=x(window.atob(A));return new window.Blob([e],{type:"image/"+E})},Y.octetStream=function(A){document.location.href="data:application/octet-stream"+A};function x(A){for(var E=A.length,e=new ArrayBuffer(E),t=new Uint8Array(e),r=0;r")!==-1?"":i.html(s).text()});return i.remove(),n}function o(a){return a.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}G.exports=function(i,n,s){var c=i._fullLayout,f=c._paper,v=c._toppaper,h=c.width,T=c.height,l;f.insert("rect",":first-child").call(x.setRect,0,0,h,T).call(A.fill,c.paper_bgcolor);var y=c._basePlotModules||[];for(l=0;l1&&M.push(s("object","layout"))),x.supplyDefaults(_);for(var u=_._fullData,g=w.length,m=0;mR.length&&S.push(s("unused",M,g.concat(R.length)));var L=R.length,N=Array.isArray(O);N&&(L=Math.min(L,O.length));var U,Z,Q,ue,oe;if(P.dimensions===2)for(Z=0;ZR[Z].length&&S.push(s("unused",M,g.concat(Z,R[Z].length)));var le=R[Z].length;for(U=0;U<(N?Math.min(le,O[Z].length):le);U++)Q=N?O[Z][U]:O,ue=m[Z][U],oe=R[Z][U],d.validate(ue,Q)?oe!==ue&&oe!==+ue&&S.push(s("dynamic",M,g.concat(Z,U),ue,oe)):S.push(s("value",M,g.concat(Z,U),ue))}else S.push(s("array",M,g.concat(Z),m[Z]));else for(Z=0;ZF?S.push({code:"unused",traceType:m,templateCount:z,dataCount:F}):F>z&&S.push({code:"reused",traceType:m,templateCount:z,dataCount:F})}}function B(O,L){for(var N in O)if(N.charAt(0)!=="_"){var U=O[N],Z=s(O,N,L);d(U)?(Array.isArray(O)&&U._template===!1&&U.templateitemname&&S.push({code:"missing",path:Z,templateitemname:U.templateitemname}),B(U,Z)):Array.isArray(U)&&c(U)&&B(U,Z)}}if(B({data:_,layout:M},""),S.length)return S.map(f)};function c(v){for(var h=0;h=0;f--){var v=e[f];if(v.type==="scatter"&&v.xaxis===s.xaxis&&v.yaxis===s.yaxis){v.opacity=void 0;break}}}}}}}),BM=He({"src/traces/scatter/layout_defaults.js"(Y,G){var d=Gr(),x=t1();G.exports=function(A,E){function e(r,o){return d.coerce(A,E,x,r,o)}var t=E.barmode==="group";E.scattermode==="group"&&e("scattergap",t?E.bargap:.2)}}}),Sv=He({"src/plots/cartesian/align_period.js"(Y,G){var d=Hi(),x=Gr(),A=x.dateTime2ms,E=x.incrementMonth,e=lo(),t=e.ONEAVGMONTH;G.exports=function(o,a,i,n){if(a.type!=="date")return{vals:n};var s=o[i+"periodalignment"];if(!s)return{vals:n};var c=o[i+"period"],f;if(d(c)){if(c=+c,c<=0)return{vals:n}}else if(typeof c=="string"&&c.charAt(0)==="M"){var v=+c.substring(1);if(v>0&&Math.round(v)===v)f=v;else return{vals:n}}for(var h=a.calendar,T=s==="start",l=s==="end",y=o[i+"period0"],b=A(y,h)||0,S=[],M=[],_=[],w=n.length,p=0;pu;)R=E(R,-f,h);for(;R<=u;)R=E(R,f,h);m=E(R,-f,h)}else{for(g=Math.round((u-b)/c),R=b+g*c;R>u;)R-=c;for(;R<=u;)R+=c;m=R-c}S[p]=T?m:l?R:(m+R)/2,M[p]=m,_[p]=R}return{vals:S,starts:M,ends:_}}}}),ov=He({"src/traces/scatter/colorscale_calc.js"(Y,G){var d=Ah().hasColorscale,x=Sh(),A=Rl();G.exports=function(e,t){A.hasLines(t)&&d(t,"line")&&x(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),A.hasMarkers(t)&&(d(t,"marker")&&x(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),d(t,"marker.line")&&x(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),Vv=He({"src/traces/scatter/arrays_to_calcdata.js"(Y,G){var d=Gr();G.exports=function(A,E){for(var e=0;eB&&m[L].gap;)L--;for(U=m[L].s,O=m.length-1;O>L;O--)m[O].s=U;for(;BN+O||!d(L))}for(var Z=0;Zz[h]&&h0?e:t)/(h._m*y*(h._m>0?e:t)))),Nt*=1e3}if(Bt===A){if(l&&(Bt=h.c2p(Mt.y,!0)),Bt===A)return!1;Bt*=1e3}return[Nt,Bt]}function ae(_t,Mt,Nt,Bt){var qt=Nt-_t,Zt=Bt-Mt,lr=.5-_t,ta=.5-Mt,da=qt*qt+Zt*Zt,wa=qt*lr+Zt*ta;if(wa>0&&wa1||Math.abs(lr.y-Nt[0][1])>1)&&(lr=[lr.x,lr.y],Bt&&Ae(lr,_t)qe||_t[1]Qe)return[a(_t[0],Ce,qe),a(_t[1],et,Qe)]}function At(_t,Mt){if(_t[0]===Mt[0]&&(_t[0]===Ce||_t[0]===qe)||_t[1]===Mt[1]&&(_t[1]===et||_t[1]===Qe))return!0}function St(_t,Mt){var Nt=[],Bt=Je(_t),qt=Je(Mt);return Bt&&qt&&At(Bt,qt)||(Bt&&Nt.push(Bt),qt&&Nt.push(qt)),Nt}function Rt(_t,Mt,Nt){return function(Bt,qt){var Zt=Je(Bt),lr=Je(qt),ta=[];if(Zt&&lr&&At(Zt,lr))return ta;Zt&&ta.push(Zt),lr&&ta.push(lr);var da=2*r.constrain((Bt[_t]+qt[_t])/2,Mt,Nt)-((Zt||Bt)[_t]+(lr||qt)[_t]);if(da){var wa;Zt&&lr?wa=da>0==Zt[_t]>lr[_t]?Zt:lr:wa=Zt||lr,wa[_t]+=da}return ta}}var Ut;p==="linear"||p==="spline"?Ut=rt:p==="hv"||p==="vh"?Ut=St:p==="hvh"?Ut=Rt(0,Ce,qe):p==="vhv"&&(Ut=Rt(1,et,Qe));function ir(_t,Mt){var Nt=Mt[0]-_t[0],Bt=(Mt[1]-_t[1])/Nt,qt=(_t[1]*Mt[0]-Mt[1]*_t[0])/Nt;return qt>0?[Bt>0?Ce:qe,Qe]:[Bt>0?qe:Ce,et]}function ar(_t){var Mt=_t[0],Nt=_t[1],Bt=Mt===z[F-1][0],qt=Nt===z[F-1][1];if(!(Bt&&qt))if(F>1){var Zt=Mt===z[F-2][0],lr=Nt===z[F-2][1];Bt&&(Mt===Ce||Mt===qe)&&Zt?lr?F--:z[F-1]=_t:qt&&(Nt===et||Nt===Qe)&&lr?Zt?F--:z[F-1]=_t:z[F++]=_t}else z[F++]=_t}function Mr(_t){z[F-1][0]!==_t[0]&&z[F-1][1]!==_t[1]&&ar([xe,ce]),ar(_t),Re=null,xe=ce=0}var fr=r.isArrayOrTypedArray(M);function dr(_t){if(_t&&S&&(_t.i=B,_t.d=s,_t.trace=f,_t.marker=fr?M[_t.i]:M,_t.backoff=S),ie=_t[0]/y,fe=_t[1]/b,Xe=_t[0]qe?qe:0,Me=_t[1]Qe?Qe:0,Xe||Me){if(!F)z[F++]=[Xe||_t[0],Me||_t[1]];else if(Re){var Mt=Ut(Re,_t);Mt.length>1&&(Mr(Mt[0]),z[F++]=Mt[1])}else $e=Ut(z[F-1],_t)[0],z[F++]=$e;var Nt=z[F-1];Xe&&Me&&(Nt[0]!==Xe||Nt[1]!==Me)?(Re&&(xe!==Xe&&ce!==Me?ar(xe&&ce?ir(Re,_t):[xe||Xe,ce||Me]):xe&&ce&&ar([xe,ce])),ar([Xe,Me])):xe-Xe&&ce-Me&&ar([Xe||xe,Me||ce]),Re=_t,xe=Xe,ce=Me}else Re&&Mr(Ut(Re,_t)[0]),z[F++]=_t}for(B=0;Bwe(Z,pt))break;L=Z,$=oe[0]*ue[0]+oe[1]*ue[1],$>j?(j=$,N=Z,Q=!1):$=s.length||!Z)break;dr(Z),O=Z}}Re&&ar([xe||Re[0],ce||Re[1]]),m.push(z.slice(0,F))}var ze=p.slice(p.length-1);if(S&&ze!=="h"&&ze!=="v"){for(var Ge=!1,Oe=-1,ve=[],ge=0;ge=0?i=v:(i=v=f,f++),i0,p=a(v,h,T);if(S=l.selectAll("g.trace").data(p,function(g){return g[0].trace.uid}),S.enter().append("g").attr("class",function(g){return"trace scatter trace"+g[0].trace.uid}).style("stroke-miterlimit",2),S.order(),n(v,S,h),w){b&&(M=b());var u=d.transition().duration(y.duration).ease(y.easing).each("end",function(){M&&M()}).each("interrupt",function(){M&&M()});u.each(function(){l.selectAll("g.trace").each(function(g,m){s(v,m,h,g,p,this,y)})})}else S.each(function(g,m){s(v,m,h,g,p,this,y)});_&&S.exit().remove(),l.selectAll("path:not([d])").remove()};function n(f,v,h){v.each(function(T){var l=E(d.select(this),"g","fills");t.setClipUrl(l,h.layerClipId,f);var y=T[0].trace,b=[];y._ownfill&&b.push("_ownFill"),y._nexttrace&&b.push("_nextFill");var S=l.selectAll("g").data(b,e);S.enter().append("g"),S.exit().each(function(M){y[M]=null}).remove(),S.order().each(function(M){y[M]=E(d.select(this),"path","js-fill")})})}function s(f,v,h,T,l,y,b){var S=f._context.staticPlot,M;c(f,v,h,T,l);var _=!!b&&b.duration>0;function w(ar){return _?ar.transition():ar}var p=h.xaxis,u=h.yaxis,g=T[0].trace,m=g.line,R=d.select(y),P=E(R,"g","errorbars"),z=E(R,"g","lines"),F=E(R,"g","points"),B=E(R,"g","text");if(x.getComponentMethod("errorbars","plot")(f,P,h,b),g.visible!==!0)return;w(R).style("opacity",g.opacity);var O,L,N=g.fill.charAt(g.fill.length-1);N!=="x"&&N!=="y"&&(N="");var U,Z;N==="y"?(U=1,Z=u.c2p(0,!0)):N==="x"&&(U=0,Z=p.c2p(0,!0)),T[0][h.isRangePlot?"nodeRangePlot3":"node3"]=R;var Q="",ue=[],oe=g._prevtrace,le=null,j=null;oe&&(Q=oe._prevRevpath||"",L=oe._nextFill,ue=oe._ownPolygons,le=oe._fillsegments,j=oe._fillElement);var J,$,X="",re="",ee,q,ae,ie,fe,we,Ae=[];g._polygons=[];var Fe=[],Ce=[],qe=A.noop;if(O=g._ownFill,r.hasLines(g)||g.fill!=="none"){L&&L.datum(T),["hv","vh","hvh","vhv"].indexOf(m.shape)!==-1?(ee=t.steps(m.shape),q=t.steps(m.shape.split("").reverse().join(""))):m.shape==="spline"?ee=q=function(ar){var Mr=ar[ar.length-1];return ar.length>1&&ar[0][0]===Mr[0]&&ar[0][1]===Mr[1]?t.smoothclosed(ar.slice(1),m.smoothing):t.smoothopen(ar,m.smoothing)}:ee=q=function(ar){return"M"+ar.join("L")},ae=function(ar){return q(ar.reverse())},Ce=o(T,{xaxis:p,yaxis:u,trace:g,connectGaps:g.connectgaps,baseTolerance:Math.max(m.width||1,3)/4,shape:m.shape,backoff:m.backoff,simplify:m.simplify,fill:g.fill}),Fe=new Array(Ce.length);var et=0;for(M=0;M=S[0]&&R.x<=S[1]&&R.y>=M[0]&&R.y<=M[1]}),u=Math.ceil(p.length/w),g=0;l.forEach(function(R,P){var z=R[0].trace;r.hasMarkers(z)&&z.marker.maxdisplayed>0&&P=Math.min(oe,le)&&h<=Math.max(oe,le)?0:1/0}var j=Math.max(3,ue.mrc||0),J=1-1/j,$=Math.abs(f.c2p(ue.x)-h);return $=Math.min(oe,le)&&T<=Math.max(oe,le)?0:1/0}var j=Math.max(3,ue.mrc||0),J=1-1/j,$=Math.abs(v.c2p(ue.y)-T);return $re!=Fe>=re&&(fe=ae[q-1][0],we=ae[q][0],Fe-Ae&&(ie=fe+(we-fe)*(re-Ae)/(Fe-Ae),j=Math.min(j,ie),J=Math.max(J,ie)));return j=Math.max(j,0),J=Math.min(J,f._length),{x0:j,x1:J,y0:re,y1:re}}if(y.indexOf("fills")!==-1&&c._fillElement){var U=L(c._fillElement)&&!L(c._fillExclusionElement);if(U){var Z=N(c._polygons);Z===null&&(Z={x0:l[0],x1:l[0],y0:l[1],y1:l[1]});var Q=e.defaultLine;return e.opacity(c.fillcolor)?Q=c.fillcolor:e.opacity((c.line||{}).color)&&(Q=c.line.color),d.extendFlat(o,{distance:o.maxHoverDistance,x0:Z.x0,x1:Z.x1,y0:Z.y0,y1:Z.y1,color:Q,hovertemplate:!1}),delete o.index,c.text&&!d.isArrayOrTypedArray(c.text)?o.text=String(c.text):o.text=c.name,[o]}}}}}),W0=He({"src/traces/scatter/select.js"(Y,G){var d=Rl();G.exports=function(A,E){var e=A.cd,t=A.xaxis,r=A.yaxis,o=[],a=e[0].trace,i,n,s,c,f=!d.hasMarkers(a)&&!d.hasText(a);if(f)return[];if(E===!1)for(i=0;i0&&(n["_"+a+"axes"]||{})[o])return n;if((n[a+"axis"]||a)===o){if(t(n,a))return n;if((n[a]||[]).length||n[a+"0"])return n}}}function e(r){return{v:"x",h:"y"}[r.orientation||"v"]}function t(r,o){var a=e(r),i=d(r,"box-violin"),n=d(r._fullInput||{},"candlestick");return i&&!n&&o===a&&r[a]===void 0&&r[a+"0"]===void 0}}}),p1=He({"src/plots/cartesian/category_order_defaults.js"(Y,G){var d=ch().isTypedArraySpec;function x(A,E){var e=E.dataAttr||A._id.charAt(0),t={},r,o,a;if(E.axData)r=E.axData;else for(r=[],o=0;o0||d(o),i;a&&(i="array");var n=t("categoryorder",i),s;n==="array"&&(s=t("categoryarray")),!a&&n==="array"&&(n=e.categoryorder="trace"),n==="trace"?e._initialCategories=[]:n==="array"?e._initialCategories=s.slice():(s=x(e,r).sort(),n==="category ascending"?e._initialCategories=s:n==="category descending"&&(e._initialCategories=s.reverse()))}}}}),ay=He({"src/plots/cartesian/line_grid_defaults.js"(Y,G){var d=Mf().mix,x=Xc(),A=Gr();G.exports=function(e,t,r,o){o=o||{};var a=o.dfltColor;function i(g,m){return A.coerce2(e,t,o.attributes,g,m)}var n=i("linecolor",a),s=i("linewidth"),c=r("showline",o.showLine||!!n||!!s);c||(delete t.linecolor,delete t.linewidth);var f=d(a,o.bgColor,o.blend||x.lightFraction).toRgbString(),v=i("gridcolor",f),h=i("gridwidth"),T=i("griddash"),l=r("showgrid",o.showGrid||!!v||!!h||!!T);if(l||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),o.hasMinor){var y=d(t.gridcolor,o.bgColor,67).toRgbString(),b=i("minor.gridcolor",y),S=i("minor.gridwidth",t.gridwidth||1),M=i("minor.griddash",t.griddash||"solid"),_=r("minor.showgrid",!!b||!!S||!!M);_||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!o.noZeroLine){var w=i("zerolinecolor",a),p=i("zerolinewidth"),u=r("zeroline",o.showGrid||!!w||!!p);u||(delete t.zerolinecolor,delete t.zerolinewidth)}}}}),ny=He({"src/plots/cartesian/axis_defaults.js"(Y,G){var d=Hi(),x=Ei(),A=Gr(),E=Gs(),e=rh(),t=jf(),r=Ep(),o=O0(),a=Vd(),i=qd(),n=p1(),s=ay(),c=Mb(),f=Uv(),v=Ef().WEEKDAY_PATTERN,h=Ef().HOUR_PATTERN;G.exports=function(S,M,_,w,p){var u=w.letter,g=w.font||{},m=w.splomStash||{},R=_("visible",!w.visibleDflt),P=M._template||{},z=M.type||P.type||"-",F;if(z==="date"){var B=x.getComponentMethod("calendars","handleDefaults");B(S,M,"calendar",w.calendar),w.noTicklabelmode||(F=_("ticklabelmode"))}!w.noTicklabelindex&&(z==="date"||z==="linear")&&_("ticklabelindex");var O="";(!w.noTicklabelposition||z==="multicategory")&&(O=A.coerce(S,M,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:F==="period"?["outside","inside"]:u==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),w.noTicklabeloverflow||_("ticklabeloverflow",O.indexOf("inside")!==-1?"hide past domain":z==="category"||z==="multicategory"?"allow":"hide past div"),f(M,p),c(S,M,_,w),n(S,M,_,w),z!=="category"&&!w.noHover&&_("hoverformat");var L=_("color"),N=L!==t.color.dflt?L:g.color,U=m.label||p._dfltTitle[u];if(i(S,M,_,z,w),!R)return M;_("title.text",U),A.coerceFont(_,"title.font",g,{overrideDflt:{size:A.bigFont(g.size),color:N}}),r(S,M,_,z);var Z=w.hasMinor;if(Z&&(E.newContainer(M,"minor"),r(S,M,_,z,{isMinor:!0})),a(S,M,_,z,w),o(S,M,_,w),Z){var Q=w.isMinor;w.isMinor=!0,o(S,M,_,w),w.isMinor=Q}s(S,M,_,{dfltColor:L,bgColor:w.bgColor,showGrid:w.showGrid,hasMinor:Z,attributes:t}),Z&&!M.minor.ticks&&!M.minor.showgrid&&delete M.minor,(M.showline||M.ticks)&&_("mirror");var ue=z==="multicategory";if(!w.noTickson&&(z==="category"||ue)&&(M.ticks||M.showgrid)){var oe;ue&&(oe="boundaries");var le=_("tickson",oe);le==="boundaries"&&delete M.ticklabelposition}if(ue){var j=_("showdividers");j&&(_("dividercolor"),_("dividerwidth"))}if(z==="date")if(e(S,M,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:T}),!M.rangebreaks.length)delete M.rangebreaks;else{for(var J=0;J=2){var u="",g,m;if(p.length===2){for(g=0;g<2;g++)if(m=y(p[g]),m){u=v;break}}var R=_("pattern",u);if(R===v)for(g=0;g<2;g++)m=y(p[g]),m&&(S.bounds[g]=p[g]=m-1);if(R)for(g=0;g<2;g++)switch(m=p[g],R){case v:if(!d(m)){S.enabled=!1;return}if(m=+m,m!==Math.floor(m)||m<0||m>=7){S.enabled=!1;return}S.bounds[g]=p[g]=m;break;case h:if(!d(m)){S.enabled=!1;return}if(m=+m,m<0||m>24){S.enabled=!1;return}S.bounds[g]=p[g]=m;break}if(M.autorange===!1){var P=M.range;if(P[0]P[1]){S.enabled=!1;return}}else if(p[0]>P[0]&&p[1]_[1]-1/4096&&(e.domain=f),x.noneOrAll(E.domain,e.domain,f),e.tickmode==="sync"&&(e.tickmode="auto")}return t("layer"),e}}}),VM=He({"src/plots/cartesian/layout_defaults.js"(Y,G){var d=Gr(),x=Ai(),A=Ph().isUnifiedHover,E=Rb(),e=Gs(),t=D0(),r=jf(),o=Jb(),a=ny(),i=Cp(),n=g1(),s=oc(),c=s.id2name,f=s.name2id,v=Ef().AX_ID_PATTERN,h=Ei(),T=h.traceIs,l=h.getComponentMethod;function y(b,S,M){Array.isArray(b[S])?b[S].push(M):b[S]=[M]}G.exports=function(S,M,_){var w=M.autotypenumbers,p={},u={},g={},m={},R={},P={},z={},F={},B={},O={},L,N;for(L=0;L<_.length;L++){var U=_[L];if(T(U,"cartesian")){var Z;if(U.xaxis)Z=c(U.xaxis),y(p,Z,U);else if(U.xaxes)for(N=0;N rect").call(E.setTranslate,0,0).call(E.setScale,1,1),M.plot.call(E.setTranslate,_._offset,w._offset).call(E.setScale,1,1);var p=M.plot.selectAll(".scatterlayer .trace");p.selectAll(".point").call(E.setPointGroupScale,1,1),p.selectAll(".textpoint").call(E.setTextPointsScale,1,1),p.call(E.hideOutsideRangePoints,M)}function c(M,_){var w=M.plotinfo,p=w.xaxis,u=w.yaxis,g=p._length,m=u._length,R=!!M.xr1,P=!!M.yr1,z=[];if(R){var F=A.simpleMap(M.xr0,p.r2l),B=A.simpleMap(M.xr1,p.r2l),O=F[1]-F[0],L=B[1]-B[0];z[0]=(F[0]*(1-_)+_*B[0]-F[0])/(F[1]-F[0])*g,z[2]=g*(1-_+_*L/O),p.range[0]=p.l2r(F[0]*(1-_)+_*B[0]),p.range[1]=p.l2r(F[1]*(1-_)+_*B[1])}else z[0]=0,z[2]=g;if(P){var N=A.simpleMap(M.yr0,u.r2l),U=A.simpleMap(M.yr1,u.r2l),Z=N[1]-N[0],Q=U[1]-U[0];z[1]=(N[1]*(1-_)+_*U[1]-N[1])/(N[0]-N[1])*m,z[3]=m*(1-_+_*Q/Z),u.range[0]=p.l2r(N[0]*(1-_)+_*U[0]),u.range[1]=u.l2r(N[1]*(1-_)+_*U[1])}else z[1]=0,z[3]=m;e.drawOne(r,p,{skipTitle:!0}),e.drawOne(r,u,{skipTitle:!0}),e.redrawComponents(r,[p._id,u._id]);var ue=R?g/z[2]:1,oe=P?m/z[3]:1,le=R?z[0]:0,j=P?z[1]:0,J=R?z[0]/z[2]*g:0,$=P?z[1]/z[3]*m:0,X=p._offset-J,re=u._offset-$;w.clipRect.call(E.setTranslate,le,j).call(E.setScale,1/ue,1/oe),w.plot.call(E.setTranslate,X,re).call(E.setScale,ue,oe),E.setPointGroupScale(w.zoomScalePts,1/ue,1/oe),E.setTextPointsScale(w.zoomScaleTxt,1/ue,1/oe)}var f;i&&(f=i());function v(){for(var M={},_=0;_a.duration?(v(),y=window.cancelAnimationFrame(S)):y=window.requestAnimationFrame(S)}return T=Date.now(),y=window.requestAnimationFrame(S),Promise.resolve()}}}),Bc=He({"src/plots/cartesian/index.js"(Y){var G=Qn(),d=Ei(),x=Gr(),A=yu(),E=vo(),e=Uf().getModuleCalcData,t=oc(),r=Ef(),o=Yh(),a=x.ensureSingle;function i(T,l,y){return x.ensureSingle(T,l,y,function(b){b.datum(y)})}var n=r.zindexSeparator;Y.name="cartesian",Y.attr=["xaxis","yaxis"],Y.idRoot=["x","y"],Y.idRegex=r.idRegex,Y.attrRegex=r.attrRegex,Y.attributes=jM(),Y.layoutAttributes=jf(),Y.supplyLayoutDefaults=VM(),Y.transitionAxes=qM(),Y.finalizeSubplots=function(T,l){var y=l._subplots,b=y.xaxis,S=y.yaxis,M=y.cartesian,_=M,w={},p={},u,g,m;for(u=0;u<_.length;u++){var R=_[u].split("y");w[R[0]]=1,p["y"+R[1]]=1}for(u=0;u0){var P=R.id;if(P.indexOf(n)!==-1)continue;P+=n+(u+1),R=x.extendFlat({},R,{id:P,plot:S._cartesianlayer.selectAll(".subplot").select("."+P)})}for(var z=[],F,B=0;B<_.length;B++){var O=_[B],L=O[0].trace;g===(L.zorder||0)&&L.xaxis+L.yaxis===m&&((l.indexOf(L.index)!==-1||L.carpet)&&(F&&F[0].trace.xaxis+F[0].trace.yaxis===m&&["tonextx","tonexty","tonext"].indexOf(L.fill)!==-1&&z.indexOf(F)===-1&&z.push(F),z.push(O)),F=O)}s(T,R,z,y,b)}}};function s(T,l,y,b,S){for(var M=r.traceLayerClasses,_=T._fullLayout,w=_._zindices,p=_._modules,u,g,m,R=[],P=[],z=0;z1&&(Z+=n+U),N.push(w+Z),_=0;_1,m=l.mainplotinfo;if(!l.mainplot||g)if(u)l.xlines=a(b,"path","xlines-above"),l.ylines=a(b,"path","ylines-above"),l.xaxislayer=a(b,"g","xaxislayer-above"),l.yaxislayer=a(b,"g","yaxislayer-above");else{if(!_){var R=a(b,"g","layer-subplot");l.shapelayer=a(R,"g","shapelayer"),l.imagelayer=a(R,"g","imagelayer"),m&&g?(l.minorGridlayer=m.minorGridlayer,l.gridlayer=m.gridlayer,l.zerolinelayer=m.zerolinelayer):(l.minorGridlayer=a(b,"g","minor-gridlayer"),l.gridlayer=a(b,"g","gridlayer"),l.zerolinelayer=a(b,"g","zerolinelayer"));var P=a(b,"g","layer-between");l.shapelayerBetween=a(P,"g","shapelayer"),l.imagelayerBetween=a(P,"g","imagelayer"),a(b,"path","xlines-below"),a(b,"path","ylines-below"),l.overlinesBelow=a(b,"g","overlines-below"),a(b,"g","xaxislayer-below"),a(b,"g","yaxislayer-below"),l.overaxesBelow=a(b,"g","overaxes-below")}l.overplot=a(b,"g","overplot"),l.plot=a(l.overplot,"g",S),_||(l.xlines=a(b,"path","xlines-above"),l.ylines=a(b,"path","ylines-above"),l.overlinesAbove=a(b,"g","overlines-above"),a(b,"g","xaxislayer-above"),a(b,"g","yaxislayer-above"),l.overaxesAbove=a(b,"g","overaxes-above"),l.xlines=b.select(".xlines-"+w),l.ylines=b.select(".ylines-"+p),l.xaxislayer=b.select(".xaxislayer-"+w),l.yaxislayer=b.select(".yaxislayer-"+p))}else{var z=m.plotgroup,F=S+"-x",B=S+"-y";l.minorGridlayer=m.minorGridlayer,l.gridlayer=m.gridlayer,l.zerolinelayer=m.zerolinelayer,a(m.overlinesBelow,"path",F),a(m.overlinesBelow,"path",B),a(m.overaxesBelow,"g",F),a(m.overaxesBelow,"g",B),l.plot=a(m.overplot,"g",S),a(m.overlinesAbove,"path",F),a(m.overlinesAbove,"path",B),a(m.overaxesAbove,"g",F),a(m.overaxesAbove,"g",B),l.xlines=z.select(".overlines-"+w).select("."+F),l.ylines=z.select(".overlines-"+p).select("."+B),l.xaxislayer=z.select(".overaxes-"+w).select("."+F),l.yaxislayer=z.select(".overaxes-"+p).select("."+B)}_||(u||(i(l.minorGridlayer,"g",l.xaxis._id),i(l.minorGridlayer,"g",l.yaxis._id),l.minorGridlayer.selectAll("g").map(function(O){return O[0]}).sort(t.idSort),i(l.gridlayer,"g",l.xaxis._id),i(l.gridlayer,"g",l.yaxis._id),l.gridlayer.selectAll("g").map(function(O){return O[0]}).sort(t.idSort)),l.xlines.style("fill","none").classed("crisp",!0),l.ylines.style("fill","none").classed("crisp",!0))}function v(T,l){if(T){var y={};T.each(function(p){var u=p[0],g=G.select(this);g.remove(),h(u,l),y[u]=!0});for(var b in l._plots)for(var S=l._plots[b],M=S.overlays||[],_=0;_=0,l=i.indexOf("end")>=0,y=c.backoff*v+n.standoff,b=f.backoff*h+n.startstandoff,S,M,_,w;if(s.nodeName==="line"){S={x:+a.attr("x1"),y:+a.attr("y1")},M={x:+a.attr("x2"),y:+a.attr("y2")};var p=S.x-M.x,u=S.y-M.y;if(_=Math.atan2(u,p),w=_+Math.PI,y&&b&&y+b>Math.sqrt(p*p+u*u)){Z();return}if(y){if(y*y>p*p+u*u){Z();return}var g=y*Math.cos(_),m=y*Math.sin(_);M.x+=g,M.y+=m,a.attr({x2:M.x,y2:M.y})}if(b){if(b*b>p*p+u*u){Z();return}var R=b*Math.cos(_),P=b*Math.sin(_);S.x-=R,S.y-=P,a.attr({x1:S.x,y1:S.y})}}else if(s.nodeName==="path"){var z=s.getTotalLength(),F="";if(z2/3?va="right":va="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[va]}for(var $e=!1,rt=["x","y"],Je=0;Je1)&&(Rt===St?(We=Ut.r2fraction(b["a"+At]),(We<0||We>1)&&($e=!0)):$e=!0),Ge=Ut._offset+Ut.r2p(b[At]),ge=.5}else{var ct=Pe==="domain";At==="x"?(ve=b[At],Ge=ct?Ut._offset+Ut._length*ve:Ge=u.l+u.w*ve):(ve=1-b[At],Ge=ct?Ut._offset+Ut._length*ve:Ge=u.t+u.h*ve),ge=b.showarrow?.5:ve}if(b.showarrow){ze.head=Ge;var _t=b["a"+At];if(be=ar*Re(.5,b.xanchor)-Mr*Re(.5,b.yanchor),Rt===St){var Mt=t.getRefType(Rt);Mt==="domain"?(At==="y"&&(_t=1-_t),ze.tail=Ut._offset+Ut._length*_t):Mt==="paper"?At==="y"?(_t=1-_t,ze.tail=u.t+u.h*_t):ze.tail=u.l+u.w*_t:ze.tail=Ut._offset+Ut.r2p(_t),Oe=be}else ze.tail=Ge+_t,Oe=be+_t;ze.text=ze.tail+be;var Nt=p[At==="x"?"width":"height"];if(St==="paper"&&(ze.head=E.constrain(ze.head,1,Nt-1)),Rt==="pixel"){var Bt=-Math.max(ze.tail-3,ze.text),qt=Math.min(ze.tail+3,ze.text)-Nt;Bt>0?(ze.tail+=Bt,ze.text+=Bt):qt>0&&(ze.tail-=qt,ze.text-=qt)}ze.tail+=pt,ze.head+=pt}else be=fr*Re(ge,dr),Oe=be,ze.text=Ge+be;ze.text+=pt,be+=pt,Oe+=pt,b["_"+At+"padplus"]=fr/2+Oe,b["_"+At+"padminus"]=fr/2-Oe,b["_"+At+"size"]=fr,b["_"+At+"shift"]=be}if($e){le.remove();return}var Zt=0,lr=0;if(b.align!=="left"&&(Zt=(Xe-Qe)*(b.align==="center"?.5:1)),b.valign!=="top"&&(lr=(Me-Ke)*(b.valign==="middle"?.5:1)),qe)Ce.select("svg").attr({x:$+Zt-1,y:$+lr}).call(o.setClipUrl,re?O:null,y);else{var ta=$+lr-et.top,da=$+Zt-et.left;ie.call(i.positionText,da,ta).call(o.setClipUrl,re?O:null,y)}ee.select("rect").call(o.setRect,$,$,Xe,Me),X.call(o.setRect,j/2,j/2,xe-j,ce-j),le.call(o.setTranslate,Math.round(L.x.text-xe/2),Math.round(L.y.text-ce/2)),Z.attr({transform:"rotate("+N+","+L.x.text+","+L.y.text+")"});var wa=function(Ia,va){U.selectAll(".annotation-arrow-g").remove();var La=L.x.head,Ka=L.y.head,Vt=L.x.tail+Ia,Lt=L.y.tail+va,jt=L.x.text+Ia,Ot=L.y.text+va,gr=E.rotationXYMatrix(N,jt,Ot),Br=E.apply2DTransform(gr),na=E.apply2DTransform2(gr),Ur=+X.attr("width"),ga=+X.attr("height"),Aa=jt-.5*Ur,Pa=Aa+Ur,sa=Ot-.5*ga,Oa=sa+ga,dt=[[Aa,sa,Aa,Oa],[Aa,Oa,Pa,Oa],[Pa,Oa,Pa,sa],[Pa,sa,Aa,sa]].map(na);if(!dt.reduce(function(wt,Qt){return wt^!!E.segmentsIntersect(La,Ka,La+1e6,Ka+1e6,Qt[0],Qt[1],Qt[2],Qt[3])},!1)){dt.forEach(function(wt){var Qt=E.segmentsIntersect(Vt,Lt,La,Ka,wt[0],wt[1],wt[2],wt[3]);Qt&&(Vt=Qt.x,Lt=Qt.y)});var vt=b.arrowwidth,Lr=b.arrowcolor,Er=b.arrowside,_r=U.append("g").style({opacity:r.opacity(Lr)}).classed("annotation-arrow-g",!0),yr=_r.append("path").attr("d","M"+Vt+","+Lt+"L"+La+","+Ka).style("stroke-width",vt+"px").call(r.stroke,r.rgb(Lr));if(f(yr,Er,b),g.annotationPosition&&yr.node().parentNode&&!M){var kr=La,zr=Ka;if(b.standoff){var Pr=Math.sqrt(Math.pow(La-Vt,2)+Math.pow(Ka-Lt,2));kr+=b.standoff*(Vt-La)/Pr,zr+=b.standoff*(Lt-Ka)/Pr}var Hr=_r.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(Vt-kr)+","+(Lt-zr),transform:e(kr,zr)}).style("stroke-width",vt+6+"px").call(r.stroke,"rgba(0,0,0,0)").call(r.fill,"rgba(0,0,0,0)"),Zr,Jr;s.init({element:Hr.node(),gd:y,prepFn:function(){var wt=o.getTranslate(le);Zr=wt.x,Jr=wt.y,_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0)},moveFn:function(wt,Qt){var mr=Br(Zr,Jr),$r=mr[0]+wt,oa=mr[1]+Qt;le.call(o.setTranslate,$r,oa),F("x",T(_,wt,"x",u,b)),F("y",T(w,Qt,"y",u,b)),b.axref===b.xref&&F("ax",T(_,wt,"ax",u,b)),b.ayref===b.yref&&F("ay",T(w,Qt,"ay",u,b)),_r.attr("transform",e(wt,Qt)),Z.attr({transform:"rotate("+N+","+$r+","+oa+")"})},doneFn:function(){x.call("_guiRelayout",y,B());var wt=document.querySelector(".js-notes-box-panel");wt&&wt.redraw(wt.selectedObj)}})}}};if(b.showarrow&&wa(0,0),Q){var ma;s.init({element:le.node(),gd:y,prepFn:function(){ma=Z.attr("transform")},moveFn:function(Ia,va){var La="pointer";if(b.showarrow)b.axref===b.xref?F("ax",T(_,Ia,"ax",u,b)):F("ax",b.ax+Ia),b.ayref===b.yref?F("ay",T(w,va,"ay",u.w,b)):F("ay",b.ay+va),wa(Ia,va);else{if(M)return;var Ka,Vt;if(_)Ka=T(_,Ia,"x",u,b);else{var Lt=b._xsize/u.w,jt=b.x+(b._xshift-b.xshift)/u.w-Lt/2;Ka=s.align(jt+Ia/u.w,Lt,0,1,b.xanchor)}if(w)Vt=T(w,va,"y",u,b);else{var Ot=b._ysize/u.h,gr=b.y-(b._yshift+b.yshift)/u.h-Ot/2;Vt=s.align(gr-va/u.h,Ot,0,1,b.yanchor)}F("x",Ka),F("y",Vt),(!_||!w)&&(La=s.getCursor(_?.5:Ka,w?.5:Vt,b.xanchor,b.yanchor))}Z.attr({transform:e(Ia,va)+ma}),n(le,La)},clickFn:function(Ia,va){b.captureevents&&y.emit("plotly_clickannotation",oe(va))},doneFn:function(){n(le),x.call("_guiRelayout",y,B());var Ia=document.querySelector(".js-notes-box-panel");Ia&&Ia.redraw(Ia.selectedObj)}})}}g.annotationText?ie.call(i.makeEditable,{delegate:le,gd:y}).call(fe).on("edit",function(Ae){b.text=Ae,this.call(fe),F("text",Ae),_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0),x.call("_guiRelayout",y,B())}):ie.call(fe)}}}),WM=He({"src/components/annotations/click.js"(Y,G){var d=Gr(),x=Ei(),A=Gs().arrayEditor;G.exports={hasClickToShow:E,onClick:e};function E(o,a){var i=t(o,a);return i.on.length>0||i.explicitOff.length>0}function e(o,a){var i=t(o,a),n=i.on,s=i.off.concat(i.explicitOff),c={},f=o._fullLayout.annotations,v,h;if(n.length||s.length){for(v=0;v1){n=!0;break}}n?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+a+'"]').remove():(i._pdata=x(e.glplot.cameraParams,[t.xaxis.r2l(i.x)*r[0],t.yaxis.r2l(i.y)*r[1],t.zaxis.r2l(i.z)*r[2]]),d(e.graphDiv,i,a,e.id,i._xa,i._ya))}}}}),e5=He({"src/components/annotations3d/index.js"(Y,G){var d=Ei(),x=Gr();G.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:m1()}}},layoutAttributes:m1(),handleDefaults:JM(),includeBasePlot:A,convert:$M(),draw:QM()};function A(E,e){var t=d.subplotsRegistry.gl3d;if(t)for(var r=t.attrRegex,o=Object.keys(E),a=0;a0?l+v:v;return{ppad:v,ppadplus:h?b:S,ppadminus:h?S:b}}else return{ppad:v}}function o(a,i,n){var s=a._id.charAt(0)==="x"?"x":"y",c=a.type==="category"||a.type==="multicategory",f,v,h=0,T=0,l=c?a.r2c:a.d2c,y=i[s+"sizemode"]==="scaled";if(y?(f=i[s+"0"],v=i[s+"1"],c&&(h=i[s+"0shift"],T=i[s+"1shift"])):(f=i[s+"anchor"],v=i[s+"anchor"]),f!==void 0)return[l(f)+h,l(v)+T];if(i.path){var b=1/0,S=-1/0,M=i.path.match(A.segmentRE),_,w,p,u,g;for(a.type==="date"&&(l=E.decodeDate(l)),_=0;_S&&(S=g)));if(S>=b)return[b,S]}}}}),n5=He({"src/components/shapes/index.js"(Y,G){var d=c1();G.exports={moduleType:"component",name:"shapes",layoutAttributes:ew(),supplyLayoutDefaults:t5(),supplyDrawNewShapeDefaults:r5(),includeBasePlot:ry()("shapes"),calcAutorange:a5(),draw:d.draw,drawOne:d.drawOne}}}),tw=He({"src/components/images/attributes.js"(Y,G){var d=Ef(),x=Gs().templatedArray;ty(),G.exports=x("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",d.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",d.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),i5=He({"src/components/images/defaults.js"(Y,G){var d=Gr(),x=io(),A=rh(),E=tw(),e="images";G.exports=function(o,a){var i={name:e,handleItemDefaults:t};A(o,a,i)};function t(r,o,a){function i(y,b){return d.coerce(r,o,E,y,b)}var n=i("source"),s=i("visible",!!n);if(!s)return o;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var c={_fullLayout:a},f=["x","y"],v=0;v<2;v++){var h=f[v],T=x.coerceRef(r,o,c,h,"paper",void 0);if(T!=="paper"){var l=x.getFromId(c,T);l._imgIndices.push(o._index)}x.coercePosition(o,c,i,T,h,0)}return o}}}),o5=He({"src/components/images/draw.js"(Y,G){var d=Qn(),x=vo(),A=io(),E=oc(),e=Yh();G.exports=function(r){var o=r._fullLayout,a=[],i={},n=[],s,c;for(c=0;c0);f&&(s("active"),s("direction"),s("type"),s("showactive"),s("x"),s("y"),d.noneOrAll(a,i,["x","y"]),s("xanchor"),s("yanchor"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),d.coerceFont(s,"font",n.font),s("bgcolor",n.paper_bgcolor),s("bordercolor"),s("borderwidth"))}function o(a,i){function n(c,f){return d.coerce(a,i,t,c,f)}var s=n("visible",a.method==="skip"||Array.isArray(a.args));s&&(n("method"),n("args"),n("args2"),n("label"),n("execute"))}}}),c5=He({"src/components/updatemenus/scrollbox.js"(Y,G){G.exports=e;var d=Qn(),x=Ai(),A=vo(),E=Gr();function e(t,r,o){this.gd=t,this.container=r,this.id=o,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}e.barWidth=2,e.barLength=20,e.barRadius=2,e.barPad=1,e.barColor="#808BA4",e.prototype.enable=function(r,o,a){var i=this.gd._fullLayout,n=i.width,s=i.height;this.position=r;var c=this.position.l,f=this.position.w,v=this.position.t,h=this.position.h,T=this.position.direction,l=T==="down",y=T==="left",b=T==="right",S=T==="up",M=f,_=h,w,p,u,g;!l&&!y&&!b&&!S&&(this.position.direction="down",l=!0);var m=l||S;m?(w=c,p=w+M,l?(u=v,g=Math.min(u+_,s),_=g-u):(g=v+_,u=Math.max(g-_,0),_=g-u)):(u=v,g=u+_,y?(p=c+M,w=Math.max(p-M,0),M=p-w):(w=c,p=Math.min(w+M,n),M=p-w)),this._box={l:w,t:u,w:M,h:_};var R=f>M,P=e.barLength+2*e.barPad,z=e.barWidth+2*e.barPad,F=c,B=v+h;B+z>s&&(B=s-z);var O=this.container.selectAll("rect.scrollbar-horizontal").data(R?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-horizontal",!0).call(x.fill,e.barColor),R?(this.hbar=O.attr({rx:e.barRadius,ry:e.barRadius,x:F,y:B,width:P,height:z}),this._hbarXMin=F+P/2,this._hbarTranslateMax=M-P):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=h>_,N=e.barWidth+2*e.barPad,U=e.barLength+2*e.barPad,Z=c+f,Q=v;Z+N>n&&(Z=n-N);var ue=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);ue.exit().on(".drag",null).remove(),ue.enter().append("rect").classed("scrollbar-vertical",!0).call(x.fill,e.barColor),L?(this.vbar=ue.attr({rx:e.barRadius,ry:e.barRadius,x:Z,y:Q,width:N,height:U}),this._vbarYMin=Q+U/2,this._vbarTranslateMax=_-U):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var oe=this.id,le=w-.5,j=L?p+N+.5:p+.5,J=u-.5,$=R?g+z+.5:g+.5,X=i._topdefs.selectAll("#"+oe).data(R||L?[0]:[]);if(X.exit().remove(),X.enter().append("clipPath").attr("id",oe).append("rect"),R||L?(this._clipRect=X.select("rect").attr({x:Math.floor(le),y:Math.floor(J),width:Math.ceil(j)-Math.floor(le),height:Math.ceil($)-Math.floor(J)}),this.container.call(A.setClipUrl,oe,this.gd),this.bg.attr({x:c,y:v,width:f,height:h})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(A.setClipUrl,null),delete this._clipRect),R||L){var re=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(re);var ee=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault(),d.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));R&&this.hbar.on(".drag",null).call(ee),L&&this.vbar.on(".drag",null).call(ee)}this.setTranslate(o,a)},e.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(A.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},e.prototype._onBoxDrag=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r-=d.event.dx),this.vbar&&(o-=d.event.dy),this.setTranslate(r,o)},e.prototype._onBoxWheel=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r+=d.event.deltaY),this.vbar&&(o+=d.event.deltaY),this.setTranslate(r,o)},e.prototype._onBarDrag=function(){var r=this.translateX,o=this.translateY;if(this.hbar){var a=r+this._hbarXMin,i=a+this._hbarTranslateMax,n=E.constrain(d.event.x,a,i),s=(n-a)/(i-a),c=this.position.w-this._box.w;r=s*c}if(this.vbar){var f=o+this._vbarYMin,v=f+this._vbarTranslateMax,h=E.constrain(d.event.y,f,v),T=(h-f)/(v-f),l=this.position.h-this._box.h;o=T*l}this.setTranslate(r,o)},e.prototype.setTranslate=function(r,o){var a=this.position.w-this._box.w,i=this.position.h-this._box.h;if(r=E.constrain(r||0,0,a),o=E.constrain(o||0,0,i),this.translateX=r,this.translateY=o,this.container.call(A.setTranslate,this._box.l-this.position.l-r,this._box.t-this.position.t-o),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+r-.5),y:Math.floor(this.position.t+o-.5)}),this.hbar){var n=r/a;this.hbar.call(A.setTranslate,r+n*this._hbarTranslateMax,o)}if(this.vbar){var s=o/i;this.vbar.call(A.setTranslate,r,o+s*this._vbarTranslateMax)}}}}),f5=He({"src/components/updatemenus/draw.js"(Y,G){var d=Qn(),x=yu(),A=Ai(),E=vo(),e=Gr(),t=yl(),r=Gs().arrayEditor,o=df().LINE_SPACING,a=_1(),i=c5();G.exports=function(P){var z=P._fullLayout,F=e.filterVisible(z[a.name]);function B(oe){x.autoMargin(P,u(oe))}var O=z._menulayer.selectAll("g."+a.containerClassName).data(F.length>0?[0]:[]);if(O.enter().append("g").classed(a.containerClassName,!0).style("cursor","pointer"),O.exit().each(function(){d.select(this).selectAll("g."+a.headerGroupClassName).each(B)}).remove(),F.length!==0){var L=O.selectAll("g."+a.headerGroupClassName).data(F,n);L.enter().append("g").classed(a.headerGroupClassName,!0);for(var N=e.ensureSingle(O,"g",a.dropdownButtonGroupClassName,function(oe){oe.style("pointer-events","all")}),U=0;U0?[0]:[]);Z.enter().append("g").classed(a.containerClassName,!0).style("cursor",L?null:"ew-resize");function Q(j){j._commandObserver&&(j._commandObserver.remove(),delete j._commandObserver),x.autoMargin(O,f(j))}if(Z.exit().each(function(){d.select(this).selectAll("g."+a.groupClassName).each(Q)}).remove(),U.length!==0){var ue=Z.selectAll("g."+a.groupClassName).data(U,h);ue.enter().append("g").classed(a.groupClassName,!0),ue.exit().each(Q).remove();for(var oe=0;oe0&&(ue=ue.transition().duration(O.transition.duration).ease(O.transition.easing)),ue.attr("transform",t(Q-a.gripWidth*.5,O._dims.currentValueTotalHeight))}}function R(B,O){var L=B._dims;return L.inputAreaStart+a.stepInset+(L.inputAreaLength-2*a.stepInset)*Math.min(1,Math.max(0,O))}function P(B,O){var L=B._dims;return Math.min(1,Math.max(0,(O-a.stepInset-L.inputAreaStart)/(L.inputAreaLength-2*a.stepInset-2*L.inputAreaStart)))}function z(B,O,L){var N=L._dims,U=e.ensureSingle(B,"rect",a.railTouchRectClass,function(Z){Z.call(p,O,B,L).style("pointer-events","all")});U.attr({width:N.inputAreaLength,height:Math.max(N.inputAreaWidth,a.tickOffset+L.ticklen+N.labelHeight)}).call(A.fill,L.bgcolor).attr("opacity",0),E.setTranslate(U,0,N.currentValueTotalHeight)}function F(B,O){var L=O._dims,N=L.inputAreaLength-a.railInset*2,U=e.ensureSingle(B,"rect",a.railRectClass);U.attr({width:N,height:a.railWidth,rx:a.railRadius,ry:a.railRadius,"shape-rendering":"crispEdges"}).call(A.stroke,O.bordercolor).call(A.fill,O.bgcolor).style("stroke-width",O.borderwidth+"px"),E.setTranslate(U,a.railInset,(L.inputAreaWidth-a.railWidth)*.5+L.currentValueTotalHeight)}}}),p5=He({"src/components/sliders/index.js"(Y,G){var d=iy();G.exports={moduleType:"component",name:d.name,layoutAttributes:aw(),supplyLayoutDefaults:v5(),draw:d5()}}}),x1=He({"src/components/rangeslider/attributes.js"(Y,G){var d=Xc();G.exports={bgcolor:{valType:"color",dflt:d.background,editType:"plot"},bordercolor:{valType:"color",dflt:d.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}}),nw=He({"src/components/rangeslider/oppaxis_attributes.js"(Y,G){G.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}}),b1=He({"src/components/rangeslider/constants.js"(Y,G){G.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}}),g5=He({"src/components/rangeslider/helpers.js"(Y){var G=oc(),d=yl(),x=b1(),A=df().LINE_SPACING,E=x.name;function e(t){var r=t&&t[E];return r&&r.visible}Y.isVisible=e,Y.makeData=function(t){for(var r=G.list({_fullLayout:t},"x",!0),o=t.margin,a=[],i=0;i=Qe.max)qe=fe[et+1];else if(Ce=Qe.pmax)qe=fe[et+1];else if(Ce0?p.touches[0].clientX:0}function v(p,u,g,m){if(u._context.staticPlot)return;var R=p.select("rect."+c.slideBoxClassName).node(),P=p.select("rect."+c.grabAreaMinClassName).node(),z=p.select("rect."+c.grabAreaMaxClassName).node();function F(){var B=d.event,O=B.target,L=f(B),N=L-p.node().getBoundingClientRect().left,U=m.d2p(g._rl[0]),Z=m.d2p(g._rl[1]),Q=n.coverSlip();this.addEventListener("touchmove",ue),this.addEventListener("touchend",oe),Q.addEventListener("mousemove",ue),Q.addEventListener("mouseup",oe);function ue(le){var j=f(le),J=+j-L,$,X,re;switch(O){case R:if(re="ew-resize",U+J>g._length||Z+J<0)return;$=U+J,X=Z+J;break;case P:if(re="col-resize",U+J>g._length)return;$=U+J,X=Z;break;case z:if(re="col-resize",Z+J<0)return;$=U,X=Z+J;break;default:re="ew-resize",$=N,X=N+J;break}if(X<$){var ee=X;X=$,$=ee}m._pixelMin=$,m._pixelMax=X,s(d.select(Q),re),h(p,u,g,m)}function oe(){Q.removeEventListener("mousemove",ue),Q.removeEventListener("mouseup",oe),this.removeEventListener("touchmove",ue),this.removeEventListener("touchend",oe),E.removeElement(Q)}}p.on("mousedown",F),p.on("touchstart",F)}function h(p,u,g,m){function R(F){return g.l2r(E.constrain(F,m._rl[0],m._rl[1]))}var P=R(m.p2d(m._pixelMin)),z=R(m.p2d(m._pixelMax));window.requestAnimationFrame(function(){x.call("_guiRelayout",u,g._name+".range",[P,z])})}function T(p,u,g,m,R,P){var z=c.handleWidth/2;function F(le){return E.constrain(le,0,m._width)}function B(le){return E.constrain(le,0,m._height)}function O(le){return E.constrain(le,-z,m._width+z)}var L=F(m.d2p(g._rl[0])),N=F(m.d2p(g._rl[1]));if(p.select("rect."+c.slideBoxClassName).attr("x",L).attr("width",N-L),p.select("rect."+c.maskMinClassName).attr("width",L),p.select("rect."+c.maskMaxClassName).attr("x",N).attr("width",m._width-N),P.rangemode!=="match"){var U=m._height-B(m.d2pOppAxis(R._rl[1])),Z=m._height-B(m.d2pOppAxis(R._rl[0]));p.select("rect."+c.maskMinOppAxisClassName).attr("x",L).attr("height",U).attr("width",N-L),p.select("rect."+c.maskMaxOppAxisClassName).attr("x",L).attr("y",Z).attr("height",m._height-Z).attr("width",N-L),p.select("rect."+c.slideBoxClassName).attr("y",U).attr("height",Z-U)}var Q=.5,ue=Math.round(O(L-z))-Q,oe=Math.round(O(N-z))+Q;p.select("g."+c.grabberMinClassName).attr("transform",e(ue,Q)),p.select("g."+c.grabberMaxClassName).attr("transform",e(oe,Q))}function l(p,u,g,m){var R=E.ensureSingle(p,"rect",c.bgClassName,function(B){B.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),P=m.borderwidth%2===0?m.borderwidth:m.borderwidth-1,z=-m._offsetShift,F=t.crispRound(u,m.borderwidth);R.attr({width:m._width+P,height:m._height+P,transform:e(z,z),"stroke-width":F}).call(r.stroke,m.bordercolor).call(r.fill,m.bgcolor)}function y(p,u,g,m){var R=u._fullLayout,P=E.ensureSingleById(R._topdefs,"clipPath",m._clipId,function(z){z.append("rect").attr({x:0,y:0})});P.select("rect").attr({width:m._width,height:m._height})}function b(p,u,g,m){var R=u.calcdata,P=p.selectAll("g."+c.rangePlotClassName).data(g._subplotsWith,E.identity);P.enter().append("g").attr("class",function(F){return c.rangePlotClassName+" "+F}).call(t.setClipUrl,m._clipId,u),P.order(),P.exit().remove();var z;P.each(function(F,B){var O=d.select(this),L=B===0,N=i.getFromId(u,F,"y"),U=N._name,Z=m[U],Q={data:[],layout:{xaxis:{type:g.type,domain:[0,1],range:m.range.slice(),calendar:g.calendar},width:m._width,height:m._height,margin:{t:0,b:0,l:0,r:0}},_context:u._context};g.rangebreaks&&(Q.layout.xaxis.rangebreaks=g.rangebreaks),Q.layout[U]={type:N.type,domain:[0,1],range:Z.rangemode!=="match"?Z.range.slice():N.range.slice(),calendar:N.calendar},N.rangebreaks&&(Q.layout[U].rangebreaks=N.rangebreaks),A.supplyDefaults(Q);var ue=Q._fullLayout.xaxis,oe=Q._fullLayout[U];ue.clearCalc(),ue.setScale(),oe.clearCalc(),oe.setScale();var le={id:F,plotgroup:O,xaxis:ue,yaxis:oe,isRangePlot:!0};L?z=le:(le.mainplot="xy",le.mainplotinfo=z),a.rangePlot(u,le,S(R,F))})}function S(p,u){for(var g=[],m=0;m0);if(y){var b=o(n,s,c);T("x",b[0]),T("y",b[1]),d.noneOrAll(i,n,["x","y"]),T("xanchor"),T("yanchor"),d.coerceFont(T,"font",s.font);var S=T("bgcolor");T("activecolor",x.contrast(S,t.lightAmount,t.darkAmount)),T("bordercolor"),T("borderwidth")}};function r(a,i,n,s){var c=s.calendar;function f(T,l){return d.coerce(a,i,e.buttons,T,l)}var v=f("visible");if(v){var h=f("step");h!=="all"&&(c&&c!=="gregorian"&&(h==="month"||h==="year")?i.stepmode="backward":f("stepmode"),f("count")),f("label")}}function o(a,i,n){for(var s=n.filter(function(h){return i[h].anchor===a._id}),c=0,f=0;f1)){delete c.grid;return}if(!T&&!l&&!y){var g=w("pattern")==="independent";g&&(T=!0)}_._hasSubplotGrid=T;var m=w("roworder"),R=m==="top to bottom",P=T?.2:.1,z=T?.3:.1,F,B;b&&c._splomGridDflt&&(F=c._splomGridDflt.xside,B=c._splomGridDflt.yside),_._domains={x:a("x",w,P,F,u),y:a("y",w,z,B,p,R)}}function a(s,c,f,v,h,T){var l=c(s+"gap",f),y=c("domain."+s);c(s+"side",v);for(var b=new Array(h),S=y[0],M=(y[1]-S)/(h-l),_=M*(1-l),w=0;w0,v=r._context.staticPlot;o.each(function(h){var T=h[0].trace,l=T.error_x||{},y=T.error_y||{},b;T.ids&&(b=function(w){return w.id});var S=E.hasMarkers(T)&&T.marker.maxdisplayed>0;!y.visible&&!l.visible&&(h=[]);var M=d.select(this).selectAll("g.errorbar").data(h,b);if(M.exit().remove(),!!h.length){l.visible||M.selectAll("path.xerror").remove(),y.visible||M.selectAll("path.yerror").remove(),M.style("opacity",1);var _=M.enter().append("g").classed("errorbar",!0);f&&_.style("opacity",0).transition().duration(i.duration).style("opacity",1),A.setClipUrl(M,a.layerClipId,r),M.each(function(w){var p=d.select(this),u=e(w,s,c);if(!(S&&!w.vis)){var g,m=p.select("path.yerror");if(y.visible&&x(u.x)&&x(u.yh)&&x(u.ys)){var R=y.width;g="M"+(u.x-R)+","+u.yh+"h"+2*R+"m-"+R+",0V"+u.ys,u.noYS||(g+="m-"+R+",0h"+2*R),n=!m.size(),n?m=p.append("path").style("vector-effect",v?"none":"non-scaling-stroke").classed("yerror",!0):f&&(m=m.transition().duration(i.duration).ease(i.easing)),m.attr("d",g)}else m.remove();var P=p.select("path.xerror");if(l.visible&&x(u.y)&&x(u.xh)&&x(u.xs)){var z=(l.copy_ystyle?y:l).width;g="M"+u.xh+","+(u.y-z)+"v"+2*z+"m0,-"+z+"H"+u.xs,u.noXS||(g+="m0,-"+z+"v"+2*z),n=!P.size(),n?P=p.append("path").style("vector-effect",v?"none":"non-scaling-stroke").classed("xerror",!0):f&&(P=P.transition().duration(i.duration).ease(i.easing)),P.attr("d",g)}else P.remove()}})}})};function e(t,r,o){var a={x:r.c2p(t.x),y:o.c2p(t.y)};return t.yh!==void 0&&(a.yh=o.c2p(t.yh),a.ys=o.c2p(t.ys),x(a.ys)||(a.noYS=!0,a.ys=o.c2p(t.ys,!0))),t.xh!==void 0&&(a.xh=r.c2p(t.xh),a.xs=r.c2p(t.xs),x(a.xs)||(a.noXS=!0,a.xs=r.c2p(t.xs,!0))),a}}}),k5=He({"src/components/errorbars/style.js"(Y,G){var d=Qn(),x=Ai();G.exports=function(E){E.each(function(e){var t=e[0].trace,r=t.error_y||{},o=t.error_x||{},a=d.select(this);a.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(x.stroke,r.color),o.copy_ystyle&&(o=r),a.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(x.stroke,o.color)})}}}),C5=He({"src/components/errorbars/index.js"(Y,G){var d=Gr(),x=hu().overrideAll,A=sw(),E={error_x:d.extendFlat({},A),error_y:d.extendFlat({},A)};delete E.error_x.copy_zstyle,delete E.error_y.copy_zstyle,delete E.error_y.copy_ystyle;var e={error_x:d.extendFlat({},A),error_y:d.extendFlat({},A),error_z:d.extendFlat({},A)};delete e.error_x.copy_ystyle,delete e.error_y.copy_ystyle,delete e.error_z.copy_ystyle,delete e.error_z.copy_zstyle,G.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:E,bar:E,histogram:E,scatter3d:x(e,"calc","nested"),scattergl:x(E,"calc","nested")}},supplyDefaults:S5(),calc:M5(),makeComputeError:lw(),plot:E5(),style:k5(),hoverInfo:t};function t(r,o,a){(o.error_y||{}).visible&&(a.yerr=r.yh-r.y,o.error_y.symmetric||(a.yerrneg=r.y-r.ys)),(o.error_x||{}).visible&&(a.xerr=r.xh-r.x,o.error_x.symmetric||(a.xerrneg=r.x-r.xs))}}}),L5=He({"src/components/colorbar/constants.js"(Y,G){G.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),P5=He({"src/components/colorbar/draw.js"(Y,G){var d=Qn(),x=Mf(),A=yu(),E=Ei(),e=io(),t=fh(),r=Gr(),o=r.strTranslate,a=ho().extendFlat,i=xv(),n=vo(),s=Ai(),c=kp(),f=yl(),v=Ah().flipScale,h=ny(),T=g1(),l=jf(),y=df(),b=y.LINE_SPACING,S=y.FROM_TL,M=y.FROM_BR,_=L5().cn;function w(P){var z=P._fullLayout,F=z._infolayer.selectAll("g."+_.colorbar).data(p(P),function(B){return B._id});F.enter().append("g").attr("class",function(B){return B._id}).classed(_.colorbar,!0),F.each(function(B){var O=d.select(this);r.ensureSingle(O,"rect",_.cbbg),r.ensureSingle(O,"g",_.cbfills),r.ensureSingle(O,"g",_.cblines),r.ensureSingle(O,"g",_.cbaxis,function(N){N.classed(_.crisp,!0)}),r.ensureSingle(O,"g",_.cbtitleunshift,function(N){N.append("g").classed(_.cbtitle,!0)}),r.ensureSingle(O,"rect",_.cboutline);var L=u(O,B,P);L&&L.then&&(P._promises||[]).push(L),P._context.edits.colorbarPosition&&g(O,B,P)}),F.exit().each(function(B){A.autoMargin(P,B._id)}).remove(),F.order()}function p(P){var z=P._fullLayout,F=P.calcdata,B=[],O,L,N,U;function Z(q){return a(q,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function Q(){typeof U.calc=="function"?U.calc(P,N,O):(O._fillgradient=L.reversescale?v(L.colorscale):L.colorscale,O._zrange=[L[U.min],L[U.max]])}for(var ue=0;ue1){var ze=Math.pow(10,Math.floor(Math.log(pt)/Math.LN10));fr*=ze*r.roundUp(pt/ze,[2,5,10]),(Math.abs(et.start)/et.size+1e-6)%1<2e-6&&(ar.tick0=0)}ar.dtick=fr}ar.domain=B?[Ut+J/ae.h,Ut+Re-J/ae.h]:[Ut+j/ae.w,Ut+Re-j/ae.w],ar.setScale(),P.attr("transform",o(Math.round(ae.l),Math.round(ae.t)));var Ge=P.select("."+_.cbtitleunshift).attr("transform",o(-Math.round(ae.l),-Math.round(ae.t))),Oe=ar.ticklabelposition,ve=ar.title.font.size,ge=P.select("."+_.cbaxis),be,Pe=0,We=0;function ct(qt,Zt){var lr={propContainer:ar,propName:z._propPrefix+"title",traceIndex:z._traceIndex,_meta:z._meta,placeholder:q._dfltTitle.colorbar,containerGroup:P.select("."+_.cbtitle)},ta=qt.charAt(0)==="h"?qt.substr(1):"h"+qt;P.selectAll("."+ta+",."+ta+"-math-group").remove(),c.draw(F,qt,a(lr,Zt||{}))}function _t(){if(B&&Mr||!B&&!Mr){var qt,Zt;Ae==="top"&&(qt=j+ae.l+$e*$,Zt=J+ae.t+rt*(1-Ut-Re)+3+ve*.75),Ae==="bottom"&&(qt=j+ae.l+$e*$,Zt=J+ae.t+rt*(1-Ut)-3-ve*.25),Ae==="right"&&(Zt=J+ae.t+rt*X+3+ve*.75,qt=j+ae.l+$e*Ut),ct(ar._id+"title",{attributes:{x:qt,y:Zt,"text-anchor":B?"start":"middle"}})}}function Mt(){if(B&&!Mr||!B&&Mr){var qt=ar.position||0,Zt=ar._offset+ar._length/2,lr,ta;if(Ae==="right")ta=Zt,lr=ae.l+$e*qt+10+ve*(ar.showticklabels?1:.5);else if(lr=Zt,Ae==="bottom"&&(ta=ae.t+rt*qt+10+(Oe.indexOf("inside")===-1?ar.tickfont.size:0)+(ar.ticks!=="intside"&&z.ticklen||0)),Ae==="top"){var da=we.text.split("
").length;ta=ae.t+rt*qt+10-Me-b*ve*da}ct((B?"h":"v")+ar._id+"title",{avoid:{selection:d.select(F).selectAll("g."+ar._id+"tick"),side:Ae,offsetTop:B?0:ae.t,offsetLeft:B?ae.l:0,maxShift:B?q.width:q.height},attributes:{x:lr,y:ta,"text-anchor":"middle"},transform:{rotate:B?-90:0,offset:0}})}}function Nt(){if(!B&&!Mr||B&&Mr){var qt=P.select("."+_.cbtitle),Zt=qt.select("text"),lr=[-Z/2,Z/2],ta=qt.select(".h"+ar._id+"title-math-group").node(),da=15.6;Zt.node()&&(da=parseInt(Zt.node().style.fontSize,10)*b);var wa;if(ta?(wa=n.bBox(ta),We=wa.width,Pe=wa.height,Pe>da&&(lr[1]-=(Pe-da)/2)):Zt.node()&&!Zt.classed(_.jsPlaceholder)&&(wa=n.bBox(Zt.node()),We=wa.width,Pe=wa.height),B){if(Pe){if(Pe+=5,Ae==="top")ar.domain[1]-=Pe/ae.h,lr[1]*=-1;else{ar.domain[0]+=Pe/ae.h;var ma=f.lineCount(Zt);lr[1]+=(1-ma)*da}qt.attr("transform",o(lr[0],lr[1])),ar.setScale()}}else We&&(Ae==="right"&&(ar.domain[0]+=(We+ve/2)/ae.w),qt.attr("transform",o(lr[0],lr[1])),ar.setScale())}P.selectAll("."+_.cbfills+",."+_.cblines).attr("transform",B?o(0,Math.round(ae.h*(1-ar.domain[1]))):o(Math.round(ae.w*ar.domain[0]),0)),ge.attr("transform",B?o(0,Math.round(-ae.t)):o(Math.round(-ae.l),0));var Ia=P.select("."+_.cbfills).selectAll("rect."+_.cbfill).attr("style","").data(Ke);Ia.enter().append("rect").classed(_.cbfill,!0).attr("style",""),Ia.exit().remove();var va=Fe.map(ar.c2p).map(Math.round).sort(function(jt,Ot){return jt-Ot});Ia.each(function(jt,Ot){var gr=[Ot===0?Fe[0]:(Ke[Ot]+Ke[Ot-1])/2,Ot===Ke.length-1?Fe[1]:(Ke[Ot]+Ke[Ot+1])/2].map(ar.c2p).map(Math.round);B&&(gr[1]=r.constrain(gr[1]+(gr[1]>gr[0])?1:-1,va[0],va[1]));var Br=d.select(this).attr(B?"x":"y",Je).attr(B?"y":"x",d.min(gr)).attr(B?"width":"height",Math.max(Me,2)).attr(B?"height":"width",Math.max(d.max(gr)-d.min(gr),2));if(z._fillgradient)n.gradient(Br,F,z._id,B?"vertical":"horizontalreversed",z._fillgradient,"fill");else{var na=qe(jt).replace("e-","");Br.attr("fill",x(na).toHexString())}});var La=P.select("."+_.cblines).selectAll("path."+_.cbline).data(fe.color&&fe.width?Xe:[]);La.enter().append("path").classed(_.cbline,!0),La.exit().remove(),La.each(function(jt){var Ot=Je,gr=Math.round(ar.c2p(jt))+fe.width/2%1;d.select(this).attr("d","M"+(B?Ot+","+gr:gr+","+Ot)+(B?"h":"v")+Me).call(n.lineGroupStyle,fe.width,Ce(jt),fe.dash)}),ge.selectAll("g."+ar._id+"tick,path").remove();var Ka=Je+Me+(Z||0)/2-(z.ticks==="outside"?1:0),Vt=e.calcTicks(ar),Lt=e.getTickSigns(ar)[2];return e.drawTicks(F,ar,{vals:ar.ticks==="inside"?e.clipEnds(ar,Vt):Vt,layer:ge,path:e.makeTickPath(ar,Ka,Lt),transFn:e.makeTransTickFn(ar)}),e.drawLabels(F,ar,{vals:Vt,layer:ge,transFn:e.makeTransTickLabelFn(ar),labelFns:e.makeLabelFns(ar,Ka)})}function Bt(){var qt,Zt=Me+Z/2;Oe.indexOf("inside")===-1&&(qt=n.bBox(ge.node()),Zt+=B?qt.width:qt.height),be=Ge.select("text");var lr=0,ta=B&&Ae==="top",da=!B&&Ae==="right",wa=0;if(be.node()&&!be.classed(_.jsPlaceholder)){var ma,Ia=Ge.select(".h"+ar._id+"title-math-group").node();Ia&&(B&&Mr||!B&&!Mr)?(qt=n.bBox(Ia),lr=qt.width,ma=qt.height):(qt=n.bBox(Ge.node()),lr=qt.right-ae.l-(B?Je:ir),ma=qt.bottom-ae.t-(B?ir:Je),!B&&Ae==="top"&&(Zt+=qt.height,wa=qt.height)),da&&(be.attr("transform",o(lr/2+ve/2,0)),lr*=2),Zt=Math.max(Zt,B?lr:ma)}var va=(B?j:J)*2+Zt+Q+Z/2,La=0;!B&&we.text&&le==="bottom"&&X<=0&&(La=va/2,va+=La,wa+=La),q._hColorbarMoveTitle=La,q._hColorbarMoveCBTitle=wa;var Ka=Q+Z,Vt=(B?Je:ir)-Ka/2-(B?j:0),Lt=(B?ir:Je)-(B?ce:J+wa-La);P.select("."+_.cbbg).attr("x",Vt).attr("y",Lt).attr(B?"width":"height",Math.max(va-La,2)).attr(B?"height":"width",Math.max(ce+Ka,2)).call(s.fill,ue).call(s.stroke,z.bordercolor).style("stroke-width",Q);var jt=da?Math.max(lr-10,0):0;P.selectAll("."+_.cboutline).attr("x",(B?Je:ir+j)+jt).attr("y",(B?ir+J-ce:Je)+(ta?Pe:0)).attr(B?"width":"height",Math.max(Me,2)).attr(B?"height":"width",Math.max(ce-(B?2*J+Pe:2*j+jt),2)).call(s.stroke,z.outlinecolor).style({fill:"none","stroke-width":Z});var Ot=B?At*va:0,gr=B?0:(1-St)*va-wa;if(Ot=ee?ae.l-Ot:-Ot,gr=re?ae.t-gr:-gr,P.attr("transform",o(Ot,gr)),!B&&(Q||x(ue).getAlpha()&&!x.equals(q.paper_bgcolor,ue))){var Br=ge.selectAll("text"),na=Br[0].length,Ur=P.select("."+_.cbbg).node(),ga=n.bBox(Ur),Aa=n.getTranslate(P),Pa=2;Br.each(function(zr,Pr){var Hr=0,Zr=na-1;if(Pr===Hr||Pr===Zr){var Jr=n.bBox(this),wt=n.getTranslate(this),Qt;if(Pr===Zr){var mr=Jr.right+wt.x,$r=ga.right+Aa.x+ir-Q-Pa+$;Qt=$r-mr,Qt>0&&(Qt=0)}else if(Pr===Hr){var oa=Jr.left+wt.x,Sa=ga.left+Aa.x+ir+Q+Pa;Qt=Sa-oa,Qt<0&&(Qt=0)}Qt&&(na<3?this.setAttribute("transform","translate("+Qt+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var sa={},Oa=S[oe],dt=M[oe],vt=S[le],Lr=M[le],Er=va-Me;B?(L==="pixels"?(sa.y=X,sa.t=ce*vt,sa.b=ce*Lr):(sa.t=sa.b=0,sa.yt=X+O*vt,sa.yb=X-O*Lr),U==="pixels"?(sa.x=$,sa.l=va*Oa,sa.r=va*dt):(sa.l=Er*Oa,sa.r=Er*dt,sa.xl=$-N*Oa,sa.xr=$+N*dt)):(L==="pixels"?(sa.x=$,sa.l=ce*Oa,sa.r=ce*dt):(sa.l=sa.r=0,sa.xl=$+O*Oa,sa.xr=$-O*dt),U==="pixels"?(sa.y=1-X,sa.t=va*vt,sa.b=va*Lr):(sa.t=Er*vt,sa.b=Er*Lr,sa.yt=X-N*vt,sa.yb=X+N*Lr));var _r=z.y<.5?"b":"t",yr=z.x<.5?"l":"r";F._fullLayout._reservedMargin[z._id]={};var kr={r:q.width-Vt-Ot,l:Vt+sa.r,b:q.height-Lt-gr,t:Lt+sa.b};ee&&re?A.autoMargin(F,z._id,sa):ee?F._fullLayout._reservedMargin[z._id][_r]=kr[_r]:re||B?F._fullLayout._reservedMargin[z._id][yr]=kr[yr]:F._fullLayout._reservedMargin[z._id][_r]=kr[_r]}return r.syncOrAsync([A.previousPromises,_t,Nt,Mt,A.previousPromises,Bt],F)}function g(P,z,F){var B=z.orientation==="v",O=F._fullLayout,L=O._size,N,U,Z;t.init({element:P.node(),gd:F,prepFn:function(){N=P.attr("transform"),i(P)},moveFn:function(Q,ue){P.attr("transform",N+o(Q,ue)),U=t.align((B?z._uFrac:z._vFrac)+Q/L.w,B?z._thickFrac:z._lenFrac,0,1,z.xanchor),Z=t.align((B?z._vFrac:1-z._uFrac)-ue/L.h,B?z._lenFrac:z._thickFrac,0,1,z.yanchor);var oe=t.getCursor(U,Z,z.xanchor,z.yanchor);i(P,oe)},doneFn:function(){if(i(P),U!==void 0&&Z!==void 0){var Q={};Q[z._propPrefix+"x"]=U,Q[z._propPrefix+"y"]=Z,z._traceIndex!==void 0?E.call("_guiRestyle",F,Q,z._traceIndex):E.call("_guiRelayout",F,Q)}}})}function m(P,z,F){var B=z._levels,O=[],L=[],N,U,Z=B.end+B.size/100,Q=B.size,ue=1.001*F[0]-.001*F[1],oe=1.001*F[1]-.001*F[0];for(U=0;U<1e5&&(N=B.start+U*Q,!(Q>0?N>=Z:N<=Z));U++)N>ue&&N0?N>=Z:N<=Z));U++)N>F[0]&&N-1}G.exports=function(o,a){var i,n=o.data,s=o.layout,c=E([],n),f=E({},s,e(a.tileClass)),v=o._context||{};if(a.width&&(f.width=a.width),a.height&&(f.height=a.height),a.tileClass==="thumbnail"||a.tileClass==="themes__thumb"){f.annotations=[];var h=Object.keys(f);for(i=0;i=0)return v}else if(typeof v=="string"&&(v=v.trim(),v.slice(-1)==="%"&&d(v.slice(0,-1))&&(v=+v.slice(0,-1),v>=0)))return v+"%"}function f(v,h,T,l,y,b){b=b||{};var S=b.moduleHasSelected!==!1,M=b.moduleHasUnselected!==!1,_=b.moduleHasConstrain!==!1,w=b.moduleHasCliponaxis!==!1,p=b.moduleHasTextangle!==!1,u=b.moduleHasInsideanchor!==!1,g=!!b.hasPathbar,m=Array.isArray(y)||y==="auto",R=m||y==="inside",P=m||y==="outside";if(R||P){var z=i(l,"textfont",T.font),F=x.extendFlat({},z),B=v.textfont&&v.textfont.color,O=!B;if(O&&delete F.color,i(l,"insidetextfont",F),g){var L=x.extendFlat({},z);O&&delete L.color,i(l,"pathbar.textfont",L)}P&&i(l,"outsidetextfont",z),S&&l("selected.textfont.color"),M&&l("unselected.textfont.color"),_&&l("constraintext"),w&&l("cliponaxis"),p&&l("textangle"),l("texttemplate")}R&&u&&l("insidetextanchor")}G.exports={supplyDefaults:n,crossTraceDefaults:s,handleText:f,validateCornerradius:c}}}),cw=He({"src/traces/bar/layout_defaults.js"(Y,G){var d=Ei(),x=io(),A=Gr(),E=T1(),e=Jh().validateCornerradius;G.exports=function(t,r,o){function a(S,M){return A.coerce(t,r,E,S,M)}for(var i=!1,n=!1,s=!1,c={},f=a("barmode"),v=f==="group",h=0;h0&&!c[l]&&(s=!0),c[l]=!0),T.visible&&T.type==="histogram"){var y=x.getFromId({_fullLayout:r},T[T.orientation==="v"?"xaxis":"yaxis"]);y.type!=="category"&&(n=!0)}}if(!i){delete r.barmode;return}f!=="overlay"&&a("barnorm"),a("bargap",n&&!s?0:.2),a("bargroupgap");var b=a("barcornerradius");r.barcornerradius=e(b)}}}),oy=He({"src/traces/bar/arrays_to_calcdata.js"(Y,G){var d=Gr();G.exports=function(A,E){for(var e=0;er;if(!o)return E}return e!==void 0?e:A.dflt},Y.coerceColor=function(A,E,e){return d(E).isValid()?E:e!==void 0?e:A.dflt},Y.coerceEnumerated=function(A,E,e){return A.coerceNumber&&(E=+E),A.values.indexOf(E)!==-1?E:e!==void 0?e:A.dflt},Y.getValue=function(A,E){var e;return x(A)?E1||g.bargap===0&&g.bargroupgap===0&&!m[0].trace.marker.line.width)&&d.select(this).attr("shape-rendering","crispEdges")}),p.selectAll("g.points").each(function(m){var R=d.select(this),P=m[0].trace;c(R,P,w)}),e.getComponentMethod("errorbars","style")(p)}function c(w,p,u){A.pointStyle(w.selectAll("path"),p,u),f(w,p,u)}function f(w,p,u){w.selectAll("text").each(function(g){var m=d.select(this),R=E.ensureUniformFontSize(u,l(m,g,p,u));A.font(m,R)})}function v(w,p,u){var g=p[0].trace;g.selectedpoints?h(u,g,w):(c(u,g,w),e.getComponentMethod("errorbars","style")(u))}function h(w,p,u){A.selectedPointStyle(w.selectAll("path"),p),T(w.selectAll("text"),p,u)}function T(w,p,u){w.each(function(g){var m=d.select(this),R;if(g.selected){R=E.ensureUniformFontSize(u,l(m,g,p,u));var P=p.selected.textfont&&p.selected.textfont.color;P&&(R.color=P),A.font(m,R)}else A.selectedTextStyle(m,p)})}function l(w,p,u,g){var m=g._fullLayout.font,R=u.textfont;if(w.classed("bartext-inside")){var P=_(p,u);R=b(u,p.i,m,P)}else w.classed("bartext-outside")&&(R=S(u,p.i,m));return R}function y(w,p,u){return M(o,w.textfont,p,u)}function b(w,p,u,g){var m=y(w,p,u),R=w._input.textfont===void 0||w._input.textfont.color===void 0||Array.isArray(w.textfont.color)&&w.textfont.color[p]===void 0;return R&&(m={color:x.contrast(g),family:m.family,size:m.size,weight:m.weight,style:m.style,variant:m.variant,textcase:m.textcase,lineposition:m.lineposition,shadow:m.shadow}),M(a,w.insidetextfont,p,m)}function S(w,p,u){var g=y(w,p,u);return M(i,w.outsidetextfont,p,g)}function M(w,p,u,g){p=p||{};var m=n.getValue(p.family,u),R=n.getValue(p.size,u),P=n.getValue(p.color,u),z=n.getValue(p.weight,u),F=n.getValue(p.style,u),B=n.getValue(p.variant,u),O=n.getValue(p.textcase,u),L=n.getValue(p.lineposition,u),N=n.getValue(p.shadow,u);return{family:n.coerceString(w.family,m,g.family),size:n.coerceNumber(w.size,R,g.size),color:n.coerceColor(w.color,P,g.color),weight:n.coerceString(w.weight,z,g.weight),style:n.coerceString(w.style,F,g.style),variant:n.coerceString(w.variant,B,g.variant),textcase:n.coerceString(w.variant,O,g.textcase),lineposition:n.coerceString(w.variant,L,g.lineposition),shadow:n.coerceString(w.variant,N,g.shadow)}}function _(w,p){return p.type==="waterfall"?p[w.dir].marker.color:w.mcc||w.mc||p.marker.color}G.exports={style:s,styleTextPoints:f,styleOnSelect:v,getInsideTextFont:b,getOutsideTextFont:S,getBarColor:_,resizeText:t}}}),Dp=He({"src/traces/bar/plot.js"(Y,G){var d=Qn(),x=Hi(),A=Gr(),E=yl(),e=Ai(),t=vo(),r=Ei(),o=io().tickText,a=hh(),i=a.recordMinTextSize,n=a.clearMinTextSize,s=uv(),c=S1(),f=Rp(),v=qv(),h=v.text,T=v.textposition,l=Ph().appendArrayPointValue,y=f.TEXTPAD;function b(Q){return Q.id}function S(Q){if(Q.ids)return b}function M(Q){return(Q>0)-(Q<0)}function _(Q,ue){return Q0}function g(Q,ue,oe,le,j,J){var $=ue.xaxis,X=ue.yaxis,re=Q._fullLayout,ee=Q._context.staticPlot;j||(j={mode:re.barmode,norm:re.barmode,gap:re.bargap,groupgap:re.bargroupgap},n("bar",re));var q=A.makeTraceGroups(le,oe,"trace bars").each(function(ae){var ie=d.select(this),fe=ae[0].trace,we=ae[0].t,Ae=fe.type==="waterfall",Fe=fe.type==="funnel",Ce=fe.type==="histogram",qe=fe.type==="bar",et=qe||Fe,Qe=0;Ae&&fe.connector.visible&&fe.connector.mode==="between"&&(Qe=fe.connector.line.width/2);var Ke=fe.orientation==="h",Xe=u(j),Me=A.ensureSingle(ie,"g","points"),xe=S(fe),ce=Me.selectAll("g.point").data(A.identity,xe);ce.enter().append("g").classed("point",!0),ce.exit().remove(),ce.each(function($e,rt){var Je=d.select(this),At=w($e,$,X,Ke),St=At[0][0],Rt=At[0][1],Ut=At[1][0],ir=At[1][1],ar=(Ke?Rt-St:ir-Ut)===0;ar&&et&&c.getLineWidth(fe,$e)&&(ar=!1),ar||(ar=!x(St)||!x(Rt)||!x(Ut)||!x(ir)),$e.isBlank=ar,ar&&(Ke?Rt=St:ir=Ut),Qe&&!ar&&(Ke?(St-=_(St,Rt)*Qe,Rt+=_(St,Rt)*Qe):(Ut-=_(Ut,ir)*Qe,ir+=_(Ut,ir)*Qe));var Mr,fr;if(fe.type==="waterfall"){if(!ar){var dr=fe[$e.dir].marker;Mr=dr.line.width,fr=dr.color}}else Mr=c.getLineWidth(fe,$e),fr=$e.mc||fe.marker.color;function pt(Ka){var Vt=d.round(Mr/2%1,2);return j.gap===0&&j.groupgap===0?d.round(Math.round(Ka)-Vt,2):Ka}function ze(Ka,Vt,Lt){return Lt&&Ka===Vt?Ka:Math.abs(Ka-Vt)>=2?pt(Ka):Ka>Vt?Math.ceil(Ka):Math.floor(Ka)}var Ge=e.opacity(fr),Oe=Ge<1||Mr>.01?pt:ze;Q._context.staticPlot||(St=Oe(St,Rt,Ke),Rt=Oe(Rt,St,Ke),Ut=Oe(Ut,ir,!Ke),ir=Oe(ir,Ut,!Ke));var ve=Ke?$.c2p:X.c2p,ge;$e.s0>0?ge=$e._sMax:$e.s0<0?ge=$e._sMin:ge=$e.s1>0?$e._sMax:$e._sMin;function be(Ka,Vt){if(!Ka)return 0;var Lt=Math.abs(Ke?ir-Ut:Rt-St),jt=Math.abs(Ke?Rt-St:ir-Ut),Ot=Oe(Math.abs(ve(ge,!0)-ve(0,!0))),gr=$e.hasB?Math.min(Lt/2,jt/2):Math.min(Lt/2,Ot),Br;if(Vt==="%"){var na=Math.min(50,Ka);Br=Lt*(na/100)}else Br=Ka;return Oe(Math.max(Math.min(Br,gr),0))}var Pe=qe||Ce?be(we.cornerradiusvalue,we.cornerradiusform):0,We,ct,_t="M"+St+","+Ut+"V"+ir+"H"+Rt+"V"+Ut+"Z",Mt=0;if(Pe&&$e.s){var Nt=M($e.s0)===0||M($e.s)===M($e.s0)?$e.s1:$e.s0;if(Mt=Oe($e.hasB?0:Math.abs(ve(ge,!0)-ve(Nt,!0))),Mt0?Math.sqrt(Mt*(2*Pe-Mt)):0,da=Bt>0?Math.max:Math.min;We="M"+St+","+Ut+"V"+(ir-lr*qt)+"H"+da(Rt-(Pe-Mt)*Bt,St)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+Rt+","+(ir-Pe*qt-ta)+"V"+(Ut+Pe*qt+ta)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+da(Rt-(Pe-Mt)*Bt,St)+","+(Ut+lr*qt)+"Z"}else if($e.hasB)We="M"+(St+Pe*Bt)+","+Ut+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+St+","+(Ut+Pe*qt)+"V"+(ir-Pe*qt)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+(St+Pe*Bt)+","+ir+"H"+(Rt-Pe*Bt)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+Rt+","+(ir-Pe*qt)+"V"+(Ut+Pe*qt)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+(Rt-Pe*Bt)+","+Ut+"Z";else{ct=Math.abs(ir-Ut)+Mt;var wa=ct0?Math.sqrt(Mt*(2*Pe-Mt)):0,Ia=qt>0?Math.max:Math.min;We="M"+(St+wa*Bt)+","+Ut+"V"+Ia(ir-(Pe-Mt)*qt,Ut)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+(St+Pe*Bt-ma)+","+ir+"H"+(Rt-Pe*Bt+ma)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+(Rt-wa*Bt)+","+Ia(ir-(Pe-Mt)*qt,Ut)+"V"+Ut+"Z"}}else We=_t}else We=_t;var va=p(A.ensureSingle(Je,"path"),re,j,J);if(va.style("vector-effect",ee?"none":"non-scaling-stroke").attr("d",isNaN((Rt-St)*(ir-Ut))||ar&&Q._context.staticPlot?"M0,0Z":We).call(t.setClipUrl,ue.layerClipId,Q),!re.uniformtext.mode&&Xe){var La=t.makePointStyleFns(fe);t.singlePointStyle($e,va,fe,La,Q)}m(Q,ue,Je,ae,rt,St,Rt,Ut,ir,Pe,Mt,j,J),ue.layerClipId&&t.hideOutsideRangePoint($e,Je.select("text"),$,X,fe.xcalendar,fe.ycalendar)});var Re=fe.cliponaxis===!1;t.setClipUrl(ie,Re?null:ue.layerClipId,Q)});r.getComponentMethod("errorbars","plot")(Q,q,ue,j)}function m(Q,ue,oe,le,j,J,$,X,re,ee,q,ae,ie){var fe=ue.xaxis,we=ue.yaxis,Ae=Q._fullLayout,Fe;function Ce(ct,_t,Mt){var Nt=A.ensureSingle(ct,"text").text(_t).attr({class:"bartext bartext-"+Fe,"text-anchor":"middle","data-notex":1}).call(t.font,Mt).call(E.convertToTspans,Q);return Nt}var qe=le[0].trace,et=qe.orientation==="h",Qe=L(Ae,le,j,fe,we);Fe=N(qe,j);var Ke=ae.mode==="stack"||ae.mode==="relative",Xe=le[j],Me=!Ke||Xe._outmost,xe=Xe.hasB,ce=ee&&ee-q>y;if(!Qe||Fe==="none"||(Xe.isBlank||J===$||X===re)&&(Fe==="auto"||Fe==="inside")){oe.select("text").remove();return}var Re=Ae.font,$e=s.getBarColor(le[j],qe),rt=s.getInsideTextFont(qe,j,Re,$e),Je=s.getOutsideTextFont(qe,j,Re),At=qe.insidetextanchor||"end",St=oe.datum();et?fe.type==="log"&&St.s0<=0&&(fe.range[0]0&&pt>0,Oe;ce?xe?Oe=R(ir-2*ee,ar,dr,pt,et)||R(ir,ar-2*ee,dr,pt,et):et?Oe=R(ir-(ee-q),ar,dr,pt,et)||R(ir,ar-2*(ee-q),dr,pt,et):Oe=R(ir,ar-(ee-q),dr,pt,et)||R(ir-2*(ee-q),ar,dr,pt,et):Oe=R(ir,ar,dr,pt,et),Ge&&Oe?Fe="inside":(Fe="outside",Mr.remove(),Mr=null)}else Fe="inside";if(!Mr){ze=A.ensureUniformFontSize(Q,Fe==="outside"?Je:rt),Mr=Ce(oe,Qe,ze);var ve=Mr.attr("transform");if(Mr.attr("transform",""),fr=t.bBox(Mr.node()),dr=fr.width,pt=fr.height,Mr.attr("transform",ve),dr<=0||pt<=0){Mr.remove();return}}var ge=qe.textangle,be,Pe;Fe==="outside"?(Pe=qe.constraintext==="both"||qe.constraintext==="outside",be=O(J,$,X,re,fr,{isHorizontal:et,constrained:Pe,angle:ge})):(Pe=qe.constraintext==="both"||qe.constraintext==="inside",be=F(J,$,X,re,fr,{isHorizontal:et,constrained:Pe,angle:ge,anchor:At,hasB:xe,r:ee,overhead:q})),be.fontSize=ze.size,i(qe.type==="histogram"?"bar":qe.type,be,Ae),Xe.transform=be;var We=p(Mr,Ae,ae,ie);A.setTransormAndDisplay(We,be)}function R(Q,ue,oe,le,j){if(Q<0||ue<0)return!1;var J=oe<=Q&&le<=ue,$=oe<=ue&&le<=Q,X=j?Q>=oe*(ue/le):ue>=le*(Q/oe);return J||$||X}function P(Q){return Q==="auto"?0:Q}function z(Q,ue){var oe=Math.PI/180*ue,le=Math.abs(Math.sin(oe)),j=Math.abs(Math.cos(oe));return{x:Q.width*j+Q.height*le,y:Q.width*le+Q.height*j}}function F(Q,ue,oe,le,j,J){var $=!!J.isHorizontal,X=!!J.constrained,re=J.angle||0,ee=J.anchor,q=ee==="end",ae=ee==="start",ie=J.leftToRight||0,fe=(ie+1)/2,we=1-fe,Ae=J.hasB,Fe=J.r,Ce=J.overhead,qe=j.width,et=j.height,Qe=Math.abs(ue-Q),Ke=Math.abs(le-oe),Xe=Qe>2*y&&Ke>2*y?y:0;Qe-=2*Xe,Ke-=2*Xe;var Me=P(re);re==="auto"&&!(qe<=Qe&&et<=Ke)&&(qe>Qe||et>Ke)&&(!(qe>Ke||et>Qe)||qey){var $e=B(Q,ue,oe,le,xe,Fe,Ce,$,Ae);ce=$e.scale,Re=$e.pad}else ce=1,X&&(ce=Math.min(1,Qe/xe.x,Ke/xe.y)),Re=0;var rt=j.left*we+j.right*fe,Je=(j.top+j.bottom)/2,At=(Q+y)*we+(ue-y)*fe,St=(oe+le)/2,Rt=0,Ut=0;if(ae||q){var ir=($?xe.x:xe.y)/2;Fe&&(q||Ae)&&(Xe+=Re);var ar=$?_(Q,ue):_(oe,le);$?ae?(At=Q+ar*Xe,Rt=-ar*ir):(At=ue-ar*Xe,Rt=ar*ir):ae?(St=oe+ar*Xe,Ut=-ar*ir):(St=le-ar*Xe,Ut=ar*ir)}return{textX:rt,textY:Je,targetX:At,targetY:St,anchorX:Rt,anchorY:Ut,scale:ce,rotate:Me}}function B(Q,ue,oe,le,j,J,$,X,re){var ee=Math.max(0,Math.abs(ue-Q)-2*y),q=Math.max(0,Math.abs(le-oe)-2*y),ae=J-y,ie=$?ae-Math.sqrt(ae*ae-(ae-$)*(ae-$)):ae,fe=re?ae*2:X?ae-$:2*ie,we=re?ae*2:X?2*ie:ae-$,Ae,Fe,Ce,qe,et;return j.y/j.x>=q/(ee-fe)?qe=q/j.y:j.y/j.x<=(q-we)/ee?qe=ee/j.x:!re&&X?(Ae=j.x*j.x+j.y*j.y/4,Fe=-2*j.x*(ee-ae)-j.y*(q/2-ae),Ce=(ee-ae)*(ee-ae)+(q/2-ae)*(q/2-ae)-ae*ae,qe=(-Fe+Math.sqrt(Fe*Fe-4*Ae*Ce))/(2*Ae)):re?(Ae=(j.x*j.x+j.y*j.y)/4,Fe=-j.x*(ee/2-ae)-j.y*(q/2-ae),Ce=(ee/2-ae)*(ee/2-ae)+(q/2-ae)*(q/2-ae)-ae*ae,qe=(-Fe+Math.sqrt(Fe*Fe-4*Ae*Ce))/(2*Ae)):(Ae=j.x*j.x/4+j.y*j.y,Fe=-j.x*(ee/2-ae)-2*j.y*(q-ae),Ce=(ee/2-ae)*(ee/2-ae)+(q-ae)*(q-ae)-ae*ae,qe=(-Fe+Math.sqrt(Fe*Fe-4*Ae*Ce))/(2*Ae)),qe=Math.min(1,qe),X?et=Math.max(0,ae-Math.sqrt(Math.max(0,ae*ae-(ae-(q-j.y*qe)/2)*(ae-(q-j.y*qe)/2)))-$):et=Math.max(0,ae-Math.sqrt(Math.max(0,ae*ae-(ae-(ee-j.x*qe)/2)*(ae-(ee-j.x*qe)/2)))-$),{scale:qe,pad:et}}function O(Q,ue,oe,le,j,J){var $=!!J.isHorizontal,X=!!J.constrained,re=J.angle||0,ee=j.width,q=j.height,ae=Math.abs(ue-Q),ie=Math.abs(le-oe),fe;$?fe=ie>2*y?y:0:fe=ae>2*y?y:0;var we=1;X&&(we=$?Math.min(1,ie/q):Math.min(1,ae/ee));var Ae=P(re),Fe=z(j,Ae),Ce=($?Fe.x:Fe.y)/2,qe=(j.left+j.right)/2,et=(j.top+j.bottom)/2,Qe=(Q+ue)/2,Ke=(oe+le)/2,Xe=0,Me=0,xe=$?_(ue,Q):_(oe,le);return $?(Qe=ue-xe*fe,Xe=xe*Ce):(Ke=le+xe*fe,Me=-xe*Ce),{textX:qe,textY:et,targetX:Qe,targetY:Ke,anchorX:Xe,anchorY:Me,scale:we,rotate:Ae}}function L(Q,ue,oe,le,j){var J=ue[0].trace,$=J.texttemplate,X;return $?X=U(Q,ue,oe,le,j):J.textinfo?X=Z(ue,oe,le,j):X=c.getValue(J.text,oe),c.coerceString(h,X)}function N(Q,ue){var oe=c.getValue(Q.textposition,ue);return c.coerceEnumerated(T,oe)}function U(Q,ue,oe,le,j){var J=ue[0].trace,$=A.castOption(J,oe,"texttemplate");if(!$)return"";var X=J.type==="histogram",re=J.type==="waterfall",ee=J.type==="funnel",q=J.orientation==="h",ae,ie,fe,we;q?(ae="y",ie=j,fe="x",we=le):(ae="x",ie=le,fe="y",we=j);function Ae(Xe){return o(ie,ie.c2l(Xe),!0).text}function Fe(Xe){return o(we,we.c2l(Xe),!0).text}var Ce=ue[oe],qe={};qe.label=Ce.p,qe.labelLabel=qe[ae+"Label"]=Ae(Ce.p);var et=A.castOption(J,Ce.i,"text");(et===0||et)&&(qe.text=et),qe.value=Ce.s,qe.valueLabel=qe[fe+"Label"]=Fe(Ce.s);var Qe={};l(Qe,J,Ce.i),(X||Qe.x===void 0)&&(Qe.x=q?qe.value:qe.label),(X||Qe.y===void 0)&&(Qe.y=q?qe.label:qe.value),(X||Qe.xLabel===void 0)&&(Qe.xLabel=q?qe.valueLabel:qe.labelLabel),(X||Qe.yLabel===void 0)&&(Qe.yLabel=q?qe.labelLabel:qe.valueLabel),re&&(qe.delta=+Ce.rawS||Ce.s,qe.deltaLabel=Fe(qe.delta),qe.final=Ce.v,qe.finalLabel=Fe(qe.final),qe.initial=qe.final-qe.delta,qe.initialLabel=Fe(qe.initial)),ee&&(qe.value=Ce.s,qe.valueLabel=Fe(qe.value),qe.percentInitial=Ce.begR,qe.percentInitialLabel=A.formatPercent(Ce.begR),qe.percentPrevious=Ce.difR,qe.percentPreviousLabel=A.formatPercent(Ce.difR),qe.percentTotal=Ce.sumR,qe.percenTotalLabel=A.formatPercent(Ce.sumR));var Ke=A.castOption(J,Ce.i,"customdata");return Ke&&(qe.customdata=Ke),A.texttemplateString($,qe,Q._d3locale,Qe,qe,J._meta||{})}function Z(Q,ue,oe,le){var j=Q[0].trace,J=j.orientation==="h",$=j.type==="waterfall",X=j.type==="funnel";function re(Ke){var Xe=J?le:oe;return o(Xe,Ke,!0).text}function ee(Ke){var Xe=J?oe:le;return o(Xe,+Ke,!0).text}var q=j.textinfo,ae=Q[ue],ie=q.split("+"),fe=[],we,Ae=function(Ke){return ie.indexOf(Ke)!==-1};if(Ae("label")&&fe.push(re(Q[ue].p)),Ae("text")&&(we=A.castOption(j,ae.i,"text"),(we===0||we)&&fe.push(we)),$){var Fe=+ae.rawS||ae.s,Ce=ae.v,qe=Ce-Fe;Ae("initial")&&fe.push(ee(qe)),Ae("delta")&&fe.push(ee(Fe)),Ae("final")&&fe.push(ee(Ce))}if(X){Ae("value")&&fe.push(ee(ae.s));var et=0;Ae("percent initial")&&et++,Ae("percent previous")&&et++,Ae("percent total")&&et++;var Qe=et>1;Ae("percent initial")&&(we=A.formatPercent(ae.begR),Qe&&(we+=" of initial"),fe.push(we)),Ae("percent previous")&&(we=A.formatPercent(ae.difR),Qe&&(we+=" of previous"),fe.push(we)),Ae("percent total")&&(we=A.formatPercent(ae.sumR),Qe&&(we+=" of total"),fe.push(we))}return fe.join("
")}G.exports={plot:g,toMoveInsideBar:F}}}),Z0=He({"src/traces/bar/hover.js"(Y,G){var d=Wu(),x=Ei(),A=Ai(),E=Gr().fillText,e=S1().getLineWidth,t=io().hoverLabelText,r=lo().BADNUM;function o(n,s,c,f,v){var h=a(n,s,c,f,v);if(h){var T=h.cd,l=T[0].trace,y=T[h.index];return h.color=i(l,y),x.getComponentMethod("errorbars","hoverInfo")(y,l,h),[h]}}function a(n,s,c,f,v){var h=n.cd,T=h[0].trace,l=h[0].t,y=f==="closest",b=T.type==="waterfall",S=n.maxHoverDistance,M=n.maxSpikeDistance,_,w,p,u,g,m,R;T.orientation==="h"?(_=c,w=s,p="y",u="x",g=le,m=Q):(_=s,w=c,p="x",u="y",m=le,g=Q);var P=T[p+"period"],z=y||P;function F(we){return O(we,-1)}function B(we){return O(we,1)}function O(we,Ae){var Fe=we.w;return we[p]+Ae*Fe/2}function L(we){return we[p+"End"]-we[p+"Start"]}var N=y?F:P?function(we){return we.p-L(we)/2}:function(we){return Math.min(F(we),we.p-l.bardelta/2)},U=y?B:P?function(we){return we.p+L(we)/2}:function(we){return Math.max(B(we),we.p+l.bardelta/2)};function Z(we,Ae,Fe){return v.finiteRange&&(Fe=0),d.inbox(we-_,Ae-_,Fe+Math.min(1,Math.abs(Ae-we)/R)-1)}function Q(we){return Z(N(we),U(we),S)}function ue(we){return Z(F(we),B(we),M)}function oe(we){var Ae=we[u];if(b){var Fe=Math.abs(we.rawS)||0;w>0?Ae+=Fe:w<0&&(Ae-=Fe)}return Ae}function le(we){var Ae=w,Fe=we.b,Ce=oe(we);return d.inbox(Fe-Ae,Ce-Ae,S+(Ce-Ae)/(Ce-Fe)-1)}function j(we){var Ae=w,Fe=we.b,Ce=oe(we);return d.inbox(Fe-Ae,Ce-Ae,M+(Ce-Ae)/(Ce-Fe)-1)}var J=n[p+"a"],$=n[u+"a"];R=Math.abs(J.r2c(J.range[1])-J.r2c(J.range[0]));function X(we){return(g(we)+m(we))/2}var re=d.getDistanceFunction(f,g,m,X);if(d.getClosest(h,re,n),n.index!==!1&&h[n.index].p!==r){z||(N=function(we){return Math.min(F(we),we.p-l.bargroupwidth/2)},U=function(we){return Math.max(B(we),we.p+l.bargroupwidth/2)});var ee=n.index,q=h[ee],ae=T.base?q.b+q.s:q.s;n[u+"0"]=n[u+"1"]=$.c2p(q[u],!0),n[u+"LabelVal"]=ae;var ie=l.extents[l.extents.round(q.p)];n[p+"0"]=J.c2p(y?N(q):ie[0],!0),n[p+"1"]=J.c2p(y?U(q):ie[1],!0);var fe=q.orig_p!==void 0;return n[p+"LabelVal"]=fe?q.orig_p:q.p,n.labelLabel=t(J,n[p+"LabelVal"],T[p+"hoverformat"]),n.valueLabel=t($,n[u+"LabelVal"],T[u+"hoverformat"]),n.baseLabel=t($,q.b,T[u+"hoverformat"]),n.spikeDistance=(j(q)+ue(q))/2,n[p+"Spike"]=J.c2p(q.p,!0),E(q,T,n),n.hovertemplate=T.hovertemplate,n}}function i(n,s){var c=s.mcc||n.marker.color,f=s.mlcc||n.marker.line.color,v=e(n,s);if(A.opacity(c))return c;if(A.opacity(f)&&v)return f}G.exports={hoverPoints:o,hoverOnBars:a,getTraceColor:i}}}),j5=He({"src/traces/bar/event_data.js"(Y,G){G.exports=function(x,A,E){return x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),E.orientation==="h"?(x.label=x.y,x.value=x.x):(x.label=x.x,x.value=x.y),x}}}),X0=He({"src/traces/bar/select.js"(Y,G){G.exports=function(A,E){var e=A.cd,t=A.xaxis,r=A.yaxis,o=e[0].trace,a=o.type==="funnel",i=o.orientation==="h",n=[],s;if(E===!1)for(s=0;s0?(P="v",p>0?z=Math.min(g,u):z=Math.min(u)):p>0?(P="h",z=Math.min(g)):z=0;if(!z){c.visible=!1;return}c._length=z;var N=f("orientation",P);c._hasPreCompStats?N==="v"&&p===0?(f("x0",0),f("dx",1)):N==="h"&&w===0&&(f("y0",0),f("dy",1)):N==="v"&&p===0?f("x0"):N==="h"&&w===0&&f("y0");var U=x.getComponentMethod("calendars","handleTraceDefaults");U(s,c,["x","y"],v)}function i(s,c,f,v){var h=v.prefix,T=d.coerce2(s,c,r,"marker.outliercolor"),l=f("marker.line.outliercolor"),y="outliers";c._hasPreCompStats?y="all":(T||l)&&(y="suspectedoutliers");var b=f(h+"points",y);b?(f("jitter",b==="all"?.3:0),f("pointpos",b==="all"?-1.5:0),f("marker.symbol"),f("marker.opacity"),f("marker.size"),f("marker.angle"),f("marker.color",c.line.color),f("marker.line.color"),f("marker.line.width"),b==="suspectedoutliers"&&(f("marker.line.outliercolor",c.marker.color),f("marker.line.outlierwidth")),f("selected.marker.color"),f("unselected.marker.color"),f("selected.marker.size"),f("unselected.marker.size"),f("text"),f("hovertext")):delete c.marker;var S=f("hoveron");(S==="all"||S.indexOf("points")!==-1)&&f("hovertemplate"),d.coerceSelectionMarkerOpacity(c,f)}function n(s,c){var f,v;function h(b){return d.coerce(v._input,v,r,b)}for(var T=0;Toe.uf};if(M._hasPreCompStats){var ee=M[z],q=function(ar){return P.d2c((M[ar]||[])[m])},ae=1/0,ie=-1/0;for(m=0;m=oe.q1&&oe.q3>=oe.med){var we=q("lowerfence");oe.lf=we!==e&&we<=oe.q1?we:v(oe,j,J);var Ae=q("upperfence");oe.uf=Ae!==e&&Ae>=oe.q3?Ae:h(oe,j,J);var Fe=q("mean");oe.mean=Fe!==e?Fe:J?E.mean(j,J):(oe.q1+oe.q3)/2;var Ce=q("sd");oe.sd=Fe!==e&&Ce>=0?Ce:J?E.stdev(j,J,oe.mean):oe.q3-oe.q1,oe.lo=T(oe),oe.uo=l(oe);var qe=q("notchspan");qe=qe!==e&&qe>0?qe:y(oe,J),oe.ln=oe.med-qe,oe.un=oe.med+qe;var et=oe.lf,Qe=oe.uf;M.boxpoints&&j.length&&(et=Math.min(et,j[0]),Qe=Math.max(Qe,j[J-1])),M.notched&&(et=Math.min(et,oe.ln),Qe=Math.max(Qe,oe.un)),oe.min=et,oe.max=Qe}else{E.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+oe.q1,"median = "+oe.med,"q3 = "+oe.q3].join(` +`));var Ke;oe.med!==e?Ke=oe.med:oe.q1!==e?oe.q3!==e?Ke=(oe.q1+oe.q3)/2:Ke=oe.q1:oe.q3!==e?Ke=oe.q3:Ke=0,oe.med=Ke,oe.q1=oe.q3=Ke,oe.lf=oe.uf=Ke,oe.mean=oe.sd=Ke,oe.ln=oe.un=Ke,oe.min=oe.max=Ke}ae=Math.min(ae,oe.min),ie=Math.max(ie,oe.max),oe.pts2=le.filter(re),u.push(oe)}}M._extremes[P._id]=x.findExtremes(P,[ae,ie],{padded:!0})}else{var Xe=P.makeCalcdata(M,z),Me=o(Q,ue),xe=Q.length,ce=a(xe);for(m=0;m=0&&Re0){if(oe={},oe.pos=oe[B]=Q[m],le=oe.pts=ce[m].sort(c),j=oe[z]=le.map(f),J=j.length,oe.min=j[0],oe.max=j[J-1],oe.mean=E.mean(j,J),oe.sd=E.stdev(j,J,oe.mean)*M.sdmultiple,oe.med=E.interp(j,.5),J%2&&(At||St)){var Rt,Ut;At?(Rt=j.slice(0,J/2),Ut=j.slice(J/2+1)):St&&(Rt=j.slice(0,J/2+1),Ut=j.slice(J/2)),oe.q1=E.interp(Rt,.5),oe.q3=E.interp(Ut,.5)}else oe.q1=E.interp(j,.25),oe.q3=E.interp(j,.75);oe.lf=v(oe,j,J),oe.uf=h(oe,j,J),oe.lo=T(oe),oe.uo=l(oe);var ir=y(oe,J);oe.ln=oe.med-ir,oe.un=oe.med+ir,$e=Math.min($e,oe.ln),rt=Math.max(rt,oe.un),oe.pts2=le.filter(re),u.push(oe)}M.notched&&E.isTypedArray(Xe)&&(Xe=Array.from(Xe)),M._extremes[P._id]=x.findExtremes(P,M.notched?Xe.concat([$e,rt]):Xe,{padded:!0})}return s(u,M),u.length>0?(u[0].t={num:_[g],dPos:ue,posLetter:B,valLetter:z,labels:{med:t(S,"median:"),min:t(S,"min:"),q1:t(S,"q1:"),q3:t(S,"q3:"),max:t(S,"max:"),mean:M.boxmean==="sd"||M.sizemode==="sd"?t(S,"mean ± σ:").replace("σ",M.sdmultiple===1?"σ":M.sdmultiple+"σ"):t(S,"mean:"),lf:t(S,"lower fence:"),uf:t(S,"upper fence:")}},_[g]++,u):[{t:{empty:!0}}]};function r(b,S,M,_){var w=S in b,p=S+"0"in b,u="d"+S in b;if(w||p&&u){var g=M.makeCalcdata(b,S),m=A(b,M,S,g).vals;return[m,g]}var R;p?R=b[S+"0"]:"name"in b&&(M.type==="category"||d(b.name)&&["linear","log"].indexOf(M.type)!==-1||E.isDateTime(b.name)&&M.type==="date")?R=b.name:R=_;for(var P=M.type==="multicategory"?M.r2c_just_indices(R):M.d2c(R,0,b[S+"calendar"]),z=b._length,F=new Array(z),B=0;B1,p=1-s[r+"gap"],u=1-s[r+"groupgap"];for(v=0;v0;if(P==="positive"?(oe=z*(R?1:.5),J=j,le=J=B):P==="negative"?(oe=J=B,le=z*(R?1:.5),$=j):(oe=le=z,J=$=j),ie){var fe=g.pointpos,we=g.jitter,Ae=g.marker.size/2,Fe=0;fe+we>=0&&(Fe=j*(fe+we),Fe>oe?(ae=!0,ee=Ae,X=Fe):Fe>J&&(ee=Ae,X=oe)),Fe<=oe&&(X=oe);var Ce=0;fe-we<=0&&(Ce=-j*(fe-we),Ce>le?(ae=!0,q=Ae,re=Ce):Ce>$&&(q=Ae,re=le)),Ce<=le&&(re=le)}else X=oe,re=le;var qe=new Array(T.length);for(h=0;hM.lo&&(N.so=!0)}return w});S.enter().append("path").classed("point",!0),S.exit().remove(),S.call(A.translatePoints,f,v)}function a(i,n,s,c){var f=n.val,v=n.pos,h=!!v.rangebreaks,T=c.bPos,l=c.bPosPxOffset||0,y=s.boxmean||(s.meanline||{}).visible,b,S;Array.isArray(c.bdPos)?(b=c.bdPos[0],S=c.bdPos[1]):(b=c.bdPos,S=c.bdPos);var M=i.selectAll("path.mean").data(s.type==="box"&&s.boxmean||s.type==="violin"&&s.box.visible&&s.meanline.visible?x.identity:[]);M.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),M.exit().remove(),M.each(function(_){var w=v.c2l(_.pos+T,!0),p=v.l2p(w-b)+l,u=v.l2p(w+S)+l,g=h?(p+u)/2:v.l2p(w)+l,m=f.c2p(_.mean,!0),R=f.c2p(_.mean-_.sd,!0),P=f.c2p(_.mean+_.sd,!0);s.orientation==="h"?d.select(this).attr("d","M"+m+","+p+"V"+u+(y==="sd"?"m0,0L"+R+","+g+"L"+m+","+p+"L"+P+","+g+"Z":"")):d.select(this).attr("d","M"+p+","+m+"H"+u+(y==="sd"?"m0,0L"+g+","+R+"L"+p+","+m+"L"+g+","+P+"Z":""))})}G.exports={plot:t,plotBoxAndWhiskers:r,plotPoints:o,plotBoxMean:a}}}),C1=He({"src/traces/box/style.js"(Y,G){var d=Qn(),x=Ai(),A=vo();function E(t,r,o){var a=o||d.select(t).selectAll("g.trace.boxes");a.style("opacity",function(i){return i[0].trace.opacity}),a.each(function(i){var n=d.select(this),s=i[0].trace,c=s.line.width;function f(T,l,y,b){T.style("stroke-width",l+"px").call(x.stroke,y).call(x.fill,b)}var v=n.selectAll("path.box");if(s.type==="candlestick")v.each(function(T){if(!T.empty){var l=d.select(this),y=s[T.dir];f(l,y.line.width,y.line.color,y.fillcolor),l.style("opacity",s.selectedpoints&&!T.selected?.3:1)}});else{f(v,c,s.line.color,s.fillcolor),n.selectAll("path.mean").style({"stroke-width":c,"stroke-dasharray":2*c+"px,"+c+"px"}).call(x.stroke,s.line.color);var h=n.selectAll("path.point");A.pointStyle(h,s,t)}})}function e(t,r,o){var a=r[0].trace,i=o.selectAll("path.point");a.selectedpoints?A.selectedPointStyle(i,a):A.pointStyle(i,a,t)}G.exports={style:E,styleOnSelect:e}}}),hw=He({"src/traces/box/hover.js"(Y,G){var d=io(),x=Gr(),A=Wu(),E=Ai(),e=x.fillText;function t(a,i,n,s){var c=a.cd,f=c[0].trace,v=f.hoveron,h=[],T;return v.indexOf("boxes")!==-1&&(h=h.concat(r(a,i,n,s))),v.indexOf("points")!==-1&&(T=o(a,i,n)),s==="closest"?T?[T]:h:(T&&h.push(T),h)}function r(a,i,n,s){var c=a.cd,f=a.xa,v=a.ya,h=c[0].trace,T=c[0].t,l=h.type==="violin",y,b,S,M,_,w,p,u,g,m,R,P=T.bdPos,z,F,B=T.wHover,O=function(Ce){return S.c2l(Ce.pos)+T.bPos-S.c2l(w)};l&&h.side!=="both"?(h.side==="positive"&&(g=function(Ce){var qe=O(Ce);return A.inbox(qe,qe+B,m)},z=P,F=0),h.side==="negative"&&(g=function(Ce){var qe=O(Ce);return A.inbox(qe-B,qe,m)},z=0,F=P)):(g=function(Ce){var qe=O(Ce);return A.inbox(qe-B,qe+B,m)},z=F=P);var L;l?L=function(Ce){return A.inbox(Ce.span[0]-_,Ce.span[1]-_,m)}:L=function(Ce){return A.inbox(Ce.min-_,Ce.max-_,m)},h.orientation==="h"?(_=i,w=n,p=L,u=g,y="y",S=v,b="x",M=f):(_=n,w=i,p=g,u=L,y="x",S=f,b="y",M=v);var N=Math.min(1,P/Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0])));m=a.maxHoverDistance-N,R=a.maxSpikeDistance-N;function U(Ce){return(p(Ce)+u(Ce))/2}var Z=A.getDistanceFunction(s,p,u,U);if(A.getClosest(c,Z,a),a.index===!1)return[];var Q=c[a.index],ue=h.line.color,oe=(h.marker||{}).color;E.opacity(ue)&&h.line.width?a.color=ue:E.opacity(oe)&&h.boxpoints?a.color=oe:a.color=h.fillcolor,a[y+"0"]=S.c2p(Q.pos+T.bPos-F,!0),a[y+"1"]=S.c2p(Q.pos+T.bPos+z,!0),a[y+"LabelVal"]=Q.orig_p!==void 0?Q.orig_p:Q.pos;var le=y+"Spike";a.spikeDistance=U(Q)*R/m,a[le]=S.c2p(Q.pos,!0);var j=h.boxmean||h.sizemode==="sd"||(h.meanline||{}).visible,J=h.boxpoints||h.points,$=J&&j?["max","uf","q3","med","mean","q1","lf","min"]:J&&!j?["max","uf","q3","med","q1","lf","min"]:!J&&j?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],X=M.range[1]0&&(o=!0);for(var s=0;st){var r=t-E[x];return E[x]=t,r}}else return E[x]=t,t;return 0},max:function(x,A,E,e){var t=e[A];if(d(t))if(t=Number(t),d(E[x])){if(E[x]p&&pE){var m=u===x?1:6,R=u===x?"M12":"M1";return function(P,z){var F=T.c2d(P,x,l),B=F.indexOf("-",m);B>0&&(F=F.substr(0,B));var O=T.d2c(F,0,l);if(Or?c>E?c>x*1.1?x:c>A*1.1?A:E:c>e?e:c>t?t:r:Math.pow(10,Math.floor(Math.log(c)/Math.LN10))}function n(c,f,v,h,T,l){if(h&&c>E){var y=s(f,T,l),b=s(v,T,l),S=c===x?0:1;return y[S]!==b[S]}return Math.floor(v/c)-Math.floor(f/c)>.1}function s(c,f,v){var h=f.c2d(c,x,v).split("-");return h[0]===""&&(h.unshift(),h[0]="-"+h[0]),h}}}),_w=He({"src/traces/histogram/calc.js"(Y,G){var d=Hi(),x=Gr(),A=Ei(),E=io(),e=oy(),t=pw(),r=gw(),o=yw(),a=mw();function i(v,h){var T=[],l=[],y=h.orientation==="h",b=E.getFromId(v,y?h.yaxis:h.xaxis),S=y?"y":"x",M={x:"y",y:"x"}[S],_=h[S+"calendar"],w=h.cumulative,p,u=n(v,h,b,S),g=u[0],m=u[1],R=typeof g.size=="string",P=[],z=R?P:g,F=[],B=[],O=[],L=0,N=h.histnorm,U=h.histfunc,Z=N.indexOf("density")!==-1,Q,ue,oe;w.enabled&&Z&&(N=N.replace(/ ?density$/,""),Z=!1);var le=U==="max"||U==="min",j=le?null:0,J=t.count,$=r[N],X=!1,re=function(xe){return b.r2c(xe,0,_)},ee;for(x.isArrayOrTypedArray(h[M])&&U!=="count"&&(ee=h[M],X=U==="avg",J=t[U]),p=re(g.start),ue=re(g.end)+(p-E.tickIncrement(p,g.size,!1,_))/1e6;p=0&&oe=Ke;p--)if(l[p]){Xe=p;break}for(p=Ke;p<=Xe;p++)if(d(T[p])&&d(l[p])){var Me={p:T[p],s:l[p],b:0};w.enabled||(Me.pts=O[p],fe?Me.ph0=Me.ph1=O[p].length?m[O[p][0]]:T[p]:(h._computePh=!0,Me.ph0=qe(P[p]),Me.ph1=qe(P[p+1],!0))),Qe.push(Me)}return Qe.length===1&&(Qe[0].width1=E.tickIncrement(Qe[0].p,g.size,!1,_)-Qe[0].p),e(Qe,h),x.isArrayOrTypedArray(h.selectedpoints)&&x.tagSelected(Qe,h,Fe),Qe}function n(v,h,T,l,y){var b=l+"bins",S=v._fullLayout,M=h["_"+l+"bingroup"],_=S._histogramBinOpts[M],w=S.barmode==="overlay",p,u,g,m,R,P,z,F=function(Ce){return T.r2c(Ce,0,m)},B=function(Ce){return T.c2r(Ce,0,m)},O=T.type==="date"?function(Ce){return Ce||Ce===0?x.cleanDate(Ce,null,m):null}:function(Ce){return d(Ce)?Number(Ce):null};function L(Ce,qe,et){qe[Ce+"Found"]?(qe[Ce]=O(qe[Ce]),qe[Ce]===null&&(qe[Ce]=et[Ce])):(P[Ce]=qe[Ce]=et[Ce],x.nestedProperty(u[0],b+"."+Ce).set(et[Ce]))}if(h["_"+l+"autoBinFinished"])delete h["_"+l+"autoBinFinished"];else{u=_.traces;var N=[],U=!0,Z=!1,Q=!1;for(p=0;p"u"){if(y)return[oe,R,!0];oe=s(v,h,T,l,b)}z=g.cumulative||{},z.enabled&&z.currentbin!=="include"&&(z.direction==="decreasing"?oe.start=B(E.tickIncrement(F(oe.start),oe.size,!0,m)):oe.end=B(E.tickIncrement(F(oe.end),oe.size,!1,m))),_.size=oe.size,_.sizeFound||(P.size=oe.size,x.nestedProperty(u[0],b+".size").set(oe.size)),L("start",_,oe),L("end",_,oe)}R=h["_"+l+"pos0"],delete h["_"+l+"pos0"];var j=h._input[b]||{},J=x.extendFlat({},_),$=_.start,X=T.r2l(j.start),re=X!==void 0;if((_.startFound||re)&&X!==T.r2l($)){var ee=re?X:x.aggNums(Math.min,null,R),q={type:T.type==="category"||T.type==="multicategory"?"linear":T.type,r2l:T.r2l,dtick:_.size,tick0:$,calendar:m,range:[ee,E.tickIncrement(ee,_.size,!1,m)].map(T.l2r)},ae=E.tickFirst(q);ae>T.r2l(ee)&&(ae=E.tickIncrement(ae,_.size,!0,m)),J.start=T.l2r(ae),re||x.nestedProperty(h,b+".start").set(J.start)}var ie=_.end,fe=T.r2l(j.end),we=fe!==void 0;if((_.endFound||we)&&fe!==T.r2l(ie)){var Ae=we?fe:x.aggNums(Math.max,null,R);J.end=T.l2r(Ae),we||x.nestedProperty(h,b+".start").set(J.end)}var Fe="autobin"+l;return h._input[Fe]===!1&&(h._input[b]=x.extendFlat({},h[b]||{}),delete h._input[Fe],delete h[Fe]),[J,R]}function s(v,h,T,l,y){var b=v._fullLayout,S=c(v,h),M=!1,_=1/0,w=[h],p,u,g;for(p=0;p=0;l--)M(l);else if(h==="increasing"){for(l=1;l=0;l--)v[l]+=v[l+1];T==="exclude"&&(v.push(0),v.shift())}}G.exports={calc:i,calcAllAutoBins:n}}}),X5=He({"src/traces/histogram2d/calc.js"(Y,G){var d=Gr(),x=io(),A=pw(),E=gw(),e=yw(),t=mw(),r=_w().calcAllAutoBins;G.exports=function(s,c){var f=x.getFromId(s,c.xaxis),v=x.getFromId(s,c.yaxis),h=c.xcalendar,T=c.ycalendar,l=function(ze){return f.r2c(ze,0,h)},y=function(ze){return v.r2c(ze,0,T)},b=function(ze){return f.c2r(ze,0,h)},S=function(ze){return v.c2r(ze,0,T)},M,_,w,p,u=r(s,c,f,"x"),g=u[0],m=u[1],R=r(s,c,v,"y"),P=R[0],z=R[1],F=c._length;m.length>F&&m.splice(F,m.length-F),z.length>F&&z.splice(F,z.length-F);var B=[],O=[],L=[],N=typeof g.size=="string",U=typeof P.size=="string",Z=[],Q=[],ue=N?Z:g,oe=U?Q:P,le=0,j=[],J=[],$=c.histnorm,X=c.histfunc,re=$.indexOf("density")!==-1,ee=X==="max"||X==="min",q=ee?null:0,ae=A.count,ie=E[$],fe=!1,we=[],Ae=[],Fe="z"in c?c.z:"marker"in c&&Array.isArray(c.marker.color)?c.marker.color:"";Fe&&X!=="count"&&(fe=X==="avg",ae=A[X]);var Ce=g.size,qe=l(g.start),et=l(g.end)+(qe-x.tickIncrement(qe,Ce,!1,h))/1e6;for(M=qe;M=0&&w=0&&p<$e&&(le+=ae(w,M,B[p],Fe,j[p]),J[p][w].push(M),At&&(Rt[w]===void 0?Rt[w]=dr:Rt[w]!==dr&&(At=!1)),St&&(Ut[p]===void 0?Ut[p]=pt:Ut[p]!==pt&&(St=!1)),ir=Math.min(ir,dr-Z[w]),ar=Math.min(ar,Z[w+1]-dr),Mr=Math.min(Mr,pt-Q[p]),fr=Math.min(fr,Q[p+1]-pt))}if(fe)for(p=0;p<$e;p++)le+=e(B[p],j[p]);if(ie)for(p=0;p<$e;p++)ie(B[p],le,we,Ae[p]);return{x:m,xRanges:i(Z,At&&Rt,ir,ar,f,h),x0:Xe,dx:Ke,y:z,yRanges:i(Q,St&&Ut,Mr,fr,v,T),y0:Je,dy:rt,z:B,pts:J}};function o(n,s,c,f){var v=new Array(n),h;if(f)for(h=0;hx;i++)a=e(r,o,E(a));return a>x&&d.log("interp2d didn't converge quickly",a),r};function e(t,r,o){var a=0,i,n,s,c,f,v,h,T,l,y,b,S,M;for(c=0;cS&&(a=Math.max(a,Math.abs(t[n][s]-b)/(M-S))))}return a}}}),D1=He({"src/traces/heatmap/find_empties.js"(Y,G){var d=Gr().maxRowLength;G.exports=function(A){var E=[],e={},t=[],r=A[0],o=[],a=[0,0,0],i=d(A),n,s,c,f,v,h,T,l;for(s=0;s=0;v--)f=t[v],s=f[0],c=f[1],h=((e[[s-1,c]]||a)[2]+(e[[s+1,c]]||a)[2]+(e[[s,c-1]]||a)[2]+(e[[s,c+1]]||a)[2])/20,h&&(T[f]=[s,c,h],t.splice(v,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(f in T)e[f]=T[f],E.push(T[f])}return E.sort(function(y,b){return b[2]-y[2]})}}}),xw=He({"src/traces/heatmap/make_bound_array.js"(Y,G){var d=Ei(),x=Gr().isArrayOrTypedArray;G.exports=function(E,e,t,r,o,a){var i=[],n=d.traceIs(E,"contour"),s=d.traceIs(E,"histogram"),c,f,v,h=x(e)&&e.length>1;if(h&&!s&&a.type!=="category"){var T=e.length;if(T<=o){if(n)i=Array.from(e).slice(0,o);else if(o===1)a.type==="log"?i=[.5*e[0],2*e[0]]:i=[e[0]-.5,e[0]+.5];else if(a.type==="log"){for(i=[Math.pow(e[0],1.5)/Math.pow(e[1],.5)],v=1;v1){var $=(J[J.length-1]-J[0])/(J.length-1),X=Math.abs($/100);for(F=0;FX)return!1}return!0}T._islinear=!1,l.type==="log"||y.type==="log"?M==="fast"&&L("log axis found"):N(_)?N(g)?T._islinear=!0:M==="fast"&&L("y scale is not linear"):M==="fast"&&L("x scale is not linear");var U=x.maxRowLength(z),Z=T.xtype==="scaled"?"":_,Q=n(T,Z,w,p,U,l),ue=T.ytype==="scaled"?"":g,oe=n(T,ue,m,R,z.length,y);T._extremes[l._id]=A.findExtremes(l,Q),T._extremes[y._id]=A.findExtremes(y,oe);var le={x:Q,y:oe,z,text:T._text||T.text,hovertext:T._hovertext||T.hovertext};if(T.xperiodalignment&&u&&(le.orig_x=u),T.yperiodalignment&&P&&(le.orig_y=P),Z&&Z.length===Q.length-1&&(le.xCenter=Z),ue&&ue.length===oe.length-1&&(le.yCenter=ue),S&&(le.xRanges=B.xRanges,le.yRanges=B.yRanges,le.pts=B.pts),b||t(h,T,{vals:z,cLetter:"z"}),b&&T.contours&&T.contours.coloring==="heatmap"){var j={type:T.type==="contour"?"heatmap":"histogram2d",xcalendar:T.xcalendar,ycalendar:T.ycalendar};le.xfill=n(j,Z,w,p,U,l),le.yfill=n(j,ue,m,R,z.length,y)}return[le]};function c(v){for(var h=[],T=v.length,l=0;l0;)re=g.c2p(N[ie]),ie--;for(re0;)ae=m.c2p(U[ie]),ie--;ae=g._length||re<=0||q>=m._length||ae<=0;if(et){var Qe=P.selectAll("image").data([]);Qe.exit().remove(),y(P);return}var Ke,Xe;Ae==="fast"?(Ke=j,Xe=le):(Ke=Ce,Xe=qe);var Me=document.createElement("canvas");Me.width=Ke,Me.height=Xe;var xe=Me.getContext("2d",{willReadFrequently:!0}),ce=n(F,{noNumericCheck:!0,returnArray:!0}),Re,$e;Ae==="fast"?(Re=J?function(pa){return j-1-pa}:t.identity,$e=$?function(pa){return le-1-pa}:t.identity):(Re=function(pa){return t.constrain(Math.round(g.c2p(N[pa])-X),0,Ce)},$e=function(pa){return t.constrain(Math.round(m.c2p(U[pa])-q),0,qe)});var rt=$e(0),Je=[rt,rt],At=J?0:1,St=$?0:1,Rt=0,Ut=0,ir=0,ar=0,Mr,fr,dr,pt,ze;function Ge(pa,pn){if(pa!==void 0){var Ga=ce(pa);return Ga[0]=Math.round(Ga[0]),Ga[1]=Math.round(Ga[1]),Ga[2]=Math.round(Ga[2]),Rt+=pn,Ut+=Ga[0]*pn,ir+=Ga[1]*pn,ar+=Ga[2]*pn,Ga}return[0,0,0,0]}function Oe(pa,pn,Ga,qn){var Vn=pa[Ga.bin0];if(Vn===void 0)return Ge(void 0,1);var di=pa[Ga.bin1],yi=pn[Ga.bin0],Ci=pn[Ga.bin1],ci=di-Vn||0,ei=yi-Vn||0,mi;return di===void 0?Ci===void 0?mi=0:yi===void 0?mi=2*(Ci-Vn):mi=(2*Ci-yi-Vn)*2/3:Ci===void 0?yi===void 0?mi=0:mi=(2*Vn-di-yi)*2/3:yi===void 0?mi=(2*Ci-di-Vn)*2/3:mi=Ci+Vn-di-yi,Ge(Vn+Ga.frac*ci+qn.frac*(ei+Ga.frac*mi))}if(Ae!=="default"){var ve=0,ge;try{ge=new Uint8Array(Ke*Xe*4)}catch{ge=new Array(Ke*Xe*4)}if(Ae==="smooth"){var be=Z||N,Pe=Q||U,We=new Array(be.length),ct=new Array(Pe.length),_t=new Array(Ce),Mt=Z?S:b,Nt=Q?S:b,Bt,qt,Zt;for(ie=0;ieAa||Aa>m._length))for(fe=Br;fesa||sa>g._length)){var Oa=o({x:Pa,y:ga},F,_._fullLayout);Oa.x=Pa,Oa.y=ga;var dt=z.z[ie][fe];dt===void 0?(Oa.z="",Oa.zLabel=""):(Oa.z=dt,Oa.zLabel=e.tickText(Vt,dt,"hover").text);var vt=z.text&&z.text[ie]&&z.text[ie][fe];(vt===void 0||vt===!1)&&(vt=""),Oa.text=vt;var Lr=t.texttemplateString(La,Oa,_._fullLayout._d3locale,Oa,F._meta||{});if(Lr){var Er=Lr.split("
"),_r=Er.length,yr=0;for(we=0;we<_r;we++)yr=Math.max(yr,Er[we].length);Ur.push({l:_r,c:yr,t:Lr,x:sa,y:Aa,z:dt})}}}}var kr=F.textfont,zr=kr.size,Pr=_._fullLayout.font.size;if(!zr||zr==="auto"){var Hr=1/0,Zr=1/0,Jr=0,wt=0;for(we=0;we=y[0].length||R<0||R>y.length)return}else{if(d.inbox(o-T[0],o-T[T.length-1],0)>0||d.inbox(a-l[0],a-l[l.length-1],0)>0)return;if(s){var P;for(w=[2*T[0]-T[1]],P=1;P=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),fy=He({"src/traces/contour/attributes.js"(Y,G){var d=Y0(),x=Zu(),A=Gu(),E=A.axisHoverFormat,e=A.descriptionOnlyNumbers,t=kl(),r=Nf().dash,o=Yl(),a=ho().extendFlat,i=q1(),n=i.COMPARISON_OPS2,s=i.INTERVAL_OPS,c=x.line;G.exports=a({z:d.z,x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:x.xperiod0,yperiod0:x.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,text:d.text,hovertext:d.hovertext,transpose:d.transpose,xtype:d.xtype,ytype:d.ytype,xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:d.hovertemplate,texttemplate:a({},d.texttemplate,{}),textfont:a({},d.textfont,{}),hoverongaps:d.hoverongaps,connectgaps:a({},d.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:o({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:e("contour label")},operation:{valType:"enumerated",values:[].concat(n).concat(s),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:a({},c.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:r,smoothing:a({},c.smoothing,{}),editType:"plot"},zorder:x.zorder},t("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),Sw=He({"src/traces/histogram2dcontour/attributes.js"(Y,G){var d=V1(),x=fy(),A=kl(),E=Gu().axisHoverFormat,e=ho().extendFlat;G.exports=e({x:d.x,y:d.y,z:d.z,marker:d.marker,histnorm:d.histnorm,histfunc:d.histfunc,nbinsx:d.nbinsx,xbins:d.xbins,nbinsy:d.nbinsy,ybins:d.ybins,autobinx:d.autobinx,autobiny:d.autobiny,bingroup:d.bingroup,xbingroup:d.xbingroup,ybingroup:d.ybingroup,autocontour:x.autocontour,ncontours:x.ncontours,contours:x.contours,line:{color:x.line.color,width:e({},x.line.width,{dflt:.5}),dash:x.line.dash,smoothing:x.line.smoothing,editType:"plot"},xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:d.hovertemplate,texttemplate:x.texttemplate,textfont:x.textfont},A("",{cLetter:"z",editTypeOverride:"calc"}))}}),H1=He({"src/traces/contour/contours_defaults.js"(Y,G){G.exports=function(x,A,E,e){var t=e("contours.start"),r=e("contours.end"),o=t===!1||r===!1,a=E("contours.size"),i;o?i=A.autocontour=!0:i=E("autocontour",!1),(i||!a)&&E("ncontours")}}}),Mw=He({"src/traces/contour/label_defaults.js"(Y,G){var d=Gr();G.exports=function(A,E,e,t){t||(t={});var r=A("contours.showlabels");if(r){var o=E.font;d.coerceFont(A,"contours.labelfont",o,{overrideDflt:{color:e}}),A("contours.labelformat")}t.hasHover!==!1&&A("zhoverformat")}}}),G1=He({"src/traces/contour/style_defaults.js"(Y,G){var d=pf(),x=Mw();G.exports=function(E,e,t,r,o){var a=t("contours.coloring"),i,n="";a==="fill"&&(i=t("contours.showlines")),i!==!1&&(a!=="lines"&&(n=t("line.color","#000")),t("line.width",.5),t("line.dash")),a!=="none"&&(E.showlegend!==!0&&(e.showlegend=!1),e._dfltShowLegend=!1,d(E,e,r,t,{prefix:"",cLetter:"z"})),t("line.smoothing"),x(t,r,n,o)}}}),oE=He({"src/traces/histogram2dcontour/defaults.js"(Y,G){var d=Gr(),x=Aw(),A=H1(),E=G1(),e=cy(),t=Sw();G.exports=function(o,a,i,n){function s(f,v){return d.coerce(o,a,t,f,v)}function c(f){return d.coerce2(o,a,t,f)}x(o,a,s,n),a.visible!==!1&&(A(o,a,s,c),E(o,a,s,n),s("xhoverformat"),s("yhoverformat"),s("hovertemplate"),a.contours&&a.contours.coloring==="heatmap"&&e(s,n))}}}),Ew=He({"src/traces/contour/set_contours.js"(Y,G){var d=io(),x=Gr();G.exports=function(e,t){var r=e.contours;if(e.autocontour){var o=e.zmin,a=e.zmax;(e.zauto||o===void 0)&&(o=x.aggNums(Math.min,null,t)),(e.zauto||a===void 0)&&(a=x.aggNums(Math.max,null,t));var i=A(o,a,e.ncontours);r.size=i.dtick,r.start=d.tickFirst(i),i.range.reverse(),r.end=d.tickFirst(i),r.start===o&&(r.start+=r.size),r.end===a&&(r.end-=r.size),r.start>r.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),x.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if(r.type!=="constraint"){var n=r.start,s=r.end,c=e._input.contours;if(n>s&&(r.start=c.start=s,s=r.end=c.end=n,n=r.start),!(r.size>0)){var f;n===s?f=1:f=A(n,s,e.ncontours).dtick,c.size=r.size=f}}};function A(E,e,t){var r={type:"linear",range:[E,e]};return d.autoTicks(r,(e-E)/(t||15)),r}}}),hy=He({"src/traces/contour/end_plus.js"(Y,G){G.exports=function(x){return x.end+x.size/1e6}}}),kw=He({"src/traces/contour/calc.js"(Y,G){var d=Kl(),x=z1(),A=Ew(),E=hy();G.exports=function(t,r){var o=x(t,r),a=o[0].z;A(r,a);var i=r.contours,n=d.extractOpts(r),s;if(i.coloring==="heatmap"&&n.auto&&r.autocontour===!1){var c=i.start,f=E(i),v=i.size||1,h=Math.floor((f-c)/v)+1;isFinite(v)||(v=1,h=1);var T=c-v/2,l=T+h*v;s=[T,l]}else s=a;return d.calc(t,r,{vals:s,cLetter:"z"}),o}}}),vy=He({"src/traces/contour/constants.js"(Y,G){G.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}}}}),Cw=He({"src/traces/contour/make_crossings.js"(Y,G){var d=vy();G.exports=function(E){var e=E[0].z,t=e.length,r=e[0].length,o=t===2||r===2,a,i,n,s,c,f,v,h,T;for(i=0;iA?0:1)+(E[0][1]>A?0:2)+(E[1][1]>A?0:4)+(E[1][0]>A?0:8);if(e===5||e===10){var t=(E[0][0]+E[0][1]+E[1][0]+E[1][1])/4;return A>t?e===5?713:1114:e===5?104:208}return e===15?0:e}}}),Lw=He({"src/traces/contour/find_all_paths.js"(Y,G){var d=Gr(),x=vy();G.exports=function(a,i,n){var s,c,f,v,h;for(i=i||.01,n=n||.01,f=0;f20?(f=x.CHOOSESADDLE[f][(v[0]||v[1])<0?0:1],o.crossings[c]=x.SADDLEREMAINDER[f]):delete o.crossings[c],v=x.NEWDELTA[f],!v){d.log("Found bad marching index:",f,a,o.level);break}h.push(r(o,a,v)),a[0]+=v[0],a[1]+=v[1],c=a.join(","),A(h[h.length-1],h[h.length-2],n,s)&&h.pop();var M=v[0]&&(a[0]<0||a[0]>l-2)||v[1]&&(a[1]<0||a[1]>T-2),_=a[0]===y[0]&&a[1]===y[1]&&v[0]===b[0]&&v[1]===b[1];if(_||i&&M)break;f=o.crossings[c]}S===1e4&&d.log("Infinite loop in contour?");var w=A(h[0],h[h.length-1],n,s),p=0,u=.2*o.smoothing,g=[],m=0,R,P,z,F,B,O,L,N,U,Z,Q;for(S=1;S=m;S--)if(R=g[S],R=m&&R+g[P]N&&U--,o.edgepaths[U]=Q.concat(h,Z));break}j||(o.edgepaths[N]=h.concat(Z))}for(N=0;N20&&a?o===208||o===1114?n=i[0]===0?1:-1:s=i[1]===0?1:-1:x.BOTTOMSTART.indexOf(o)!==-1?s=1:x.LEFTSTART.indexOf(o)!==-1?n=1:x.TOPSTART.indexOf(o)!==-1?s=-1:n=-1,[n,s]}function r(o,a,i){var n=a[0]+Math.max(i[0],0),s=a[1]+Math.max(i[1],0),c=o.z[s][n],f=o.xaxis,v=o.yaxis;if(i[1]){var h=(o.level-c)/(o.z[s][n+1]-c),T=(h!==1?(1-h)*f.c2l(o.x[n]):0)+(h!==0?h*f.c2l(o.x[n+1]):0);return[f.c2p(f.l2c(T),!0),v.c2p(o.y[s],!0),n+h,s]}else{var l=(o.level-c)/(o.z[s+1][n]-c),y=(l!==1?(1-l)*v.c2l(o.y[s]):0)+(l!==0?l*v.c2l(o.y[s+1]):0);return[f.c2p(o.x[n],!0),v.c2p(v.l2c(y),!0),n,s+l]}}}}),sE=He({"src/traces/contour/constraint_mapping.js"(Y,G){var d=q1(),x=Hi();G.exports={"[]":E("[]"),"][":E("]["),">":e(">"),"<":e("<"),"=":e("=")};function A(t,r){var o=Array.isArray(r),a;function i(n){return x(n)?+n:null}return d.COMPARISON_OPS2.indexOf(t)!==-1?a=i(o?r[0]:r):d.INTERVAL_OPS.indexOf(t)!==-1?a=o?[i(r[0]),i(r[1])]:[i(r),i(r)]:d.SET_OPS.indexOf(t)!==-1&&(a=o?r.map(i):[i(r)]),a}function E(t){return function(r){r=A(t,r);var o=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return{start:o,end:a,size:a-o}}}function e(t){return function(r){return r=A(t,r),{start:r,end:1/0,size:1/0}}}}}),Pw=He({"src/traces/contour/empty_pathinfo.js"(Y,G){var d=Gr(),x=sE(),A=hy();G.exports=function(e,t,r){for(var o=e.type==="constraint"?x[e._operation](e.value):e,a=o.size,i=[],n=A(o),s=r.trace._carpetTrace,c=s?{xaxis:s.aaxis,yaxis:s.baxis,x:r.a,y:r.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:r.x,y:r.y},f=o.start;f1e3){d.warn("Too many contours, clipping at 1000",e);break}return i}}}),Iw=He({"src/traces/contour/convert_to_constraints.js"(Y,G){var d=Gr();G.exports=function(A,E){var e,t,r,o=function(n){return n.reverse()},a=function(n){return n};switch(E){case"=":case"<":return A;case">":for(A.length!==1&&d.warn("Contour data invalid for the specified inequality operation."),t=A[0],e=0;er.level||r.starts.length&&t===r.level)}break;case"constraint":if(A.prefixBoundary=!1,A.edgepaths.length)return;var o=A.x.length,a=A.y.length,i=-1/0,n=1/0;for(e=0;e":s>i&&(A.prefixBoundary=!0);break;case"<":(si||A.starts.length&&f===n)&&(A.prefixBoundary=!0);break;case"][":c=Math.min(s[0],s[1]),f=Math.max(s[0],s[1]),ci&&(A.prefixBoundary=!0);break}break}}}}),W1=He({"src/traces/contour/plot.js"(Y){var G=Qn(),d=Gr(),x=vo(),A=Kl(),E=yl(),e=io(),t=Uv(),r=O1(),o=Cw(),a=Lw(),i=Pw(),n=Iw(),s=Rw(),c=vy(),f=c.LABELOPTIMIZER;Y.plot=function(_,w,p,u){var g=w.xaxis,m=w.yaxis;d.makeTraceGroups(u,p,"contour").each(function(R){var P=G.select(this),z=R[0],F=z.trace,B=z.x,O=z.y,L=F.contours,N=i(L,w,z),U=d.ensureSingle(P,"g","heatmapcoloring"),Z=[];L.coloring==="heatmap"&&(Z=[R]),r(_,w,Z,U),o(N),a(N);var Q=g.c2p(B[0],!0),ue=g.c2p(B[B.length-1],!0),oe=m.c2p(O[0],!0),le=m.c2p(O[O.length-1],!0),j=[[Q,le],[ue,le],[ue,oe],[Q,oe]],J=N;L.type==="constraint"&&(J=n(N,L._operation)),v(P,j,L),h(P,J,j,L),l(P,N,_,z,L),b(P,w,_,z,j)})};function v(M,_,w){var p=d.ensureSingle(M,"g","contourbg"),u=p.selectAll("path").data(w.coloring==="fill"?[0]:[]);u.enter().append("path"),u.exit().remove(),u.attr("d","M"+_.join("L")+"Z").style("stroke","none")}function h(M,_,w,p){var u=p.coloring==="fill"||p.type==="constraint"&&p._operation!=="=",g="M"+w.join("L")+"Z";u&&s(_,p);var m=d.ensureSingle(M,"g","contourfill"),R=m.selectAll("path").data(u?_:[]);R.enter().append("path"),R.exit().remove(),R.each(function(P){var z=(P.prefixBoundary?g:"")+T(P,w);z?G.select(this).attr("d",z).style("stroke","none"):G.select(this).remove()})}function T(M,_){var w="",p=0,u=M.edgepaths.map(function(Q,ue){return ue}),g=!0,m,R,P,z,F,B;function O(Q){return Math.abs(Q[1]-_[0][1])<.01}function L(Q){return Math.abs(Q[1]-_[2][1])<.01}function N(Q){return Math.abs(Q[0]-_[0][0])<.01}function U(Q){return Math.abs(Q[0]-_[2][0])<.01}for(;u.length;){for(B=x.smoothopen(M.edgepaths[p],M.smoothing),w+=g?B:B.replace(/^M/,"L"),u.splice(u.indexOf(p),1),m=M.edgepaths[p][M.edgepaths[p].length-1],z=-1,P=0;P<4;P++){if(!m){d.log("Missing end?",p,M);break}for(O(m)&&!U(m)?R=_[1]:N(m)?R=_[0]:L(m)?R=_[3]:U(m)&&(R=_[2]),F=0;F=0&&(R=Z,z=F):Math.abs(m[1]-R[1])<.01?Math.abs(m[1]-Z[1])<.01&&(Z[0]-m[0])*(R[0]-Z[0])>=0&&(R=Z,z=F):d.log("endpt to newendpt is not vert. or horz.",m,R,Z)}if(m=R,z>=0)break;w+="L"+R}if(z===M.edgepaths.length){d.log("unclosed perimeter path");break}p=z,g=u.indexOf(p)===-1,g&&(p=u[0],w+="Z")}for(p=0;pf.MAXCOST*2)break;O&&(R/=2),m=z-R/2,P=m+R*1.5}if(B<=f.MAXCOST)return F};function y(M,_,w,p){var u=_.width/2,g=_.height/2,m=M.x,R=M.y,P=M.theta,z=Math.cos(P)*u,F=Math.sin(P)*u,B=(m>p.center?p.right-m:m-p.left)/(z+Math.abs(Math.sin(P)*g)),O=(R>p.middle?p.bottom-R:R-p.top)/(Math.abs(F)+Math.cos(P)*g);if(B<1||O<1)return 1/0;var L=f.EDGECOST*(1/(B-1)+1/(O-1));L+=f.ANGLECOST*P*P;for(var N=m-z,U=R-F,Z=m+z,Q=R+F,ue=0;ue=b)&&(r<=y&&(r=y),o>=b&&(o=b),i=Math.floor((o-r)/a)+1,n=0),l=0;ly&&(v.unshift(y),h.unshift(h[0])),v[v.length-1]2?s.value=s.value.slice(2):s.length===0?s.value=[0,1]:s.length<2?(c=parseFloat(s.value[0]),s.value=[c,c+1]):s.value=[parseFloat(s.value[0]),parseFloat(s.value[1])]:d(s.value)&&(c=parseFloat(s.value),s.value=[c,c+1])):(n("contours.value",0),d(s.value)||(r(s.value)?s.value=parseFloat(s.value[0]):s.value=0))}}}),cE=He({"src/traces/contour/defaults.js"(Y,G){var d=Gr(),x=L1(),A=Tv(),E=Fw(),e=H1(),t=G1(),r=cy(),o=fy();G.exports=function(i,n,s,c){function f(l,y){return d.coerce(i,n,o,l,y)}function v(l){return d.coerce2(i,n,o,l)}var h=x(i,n,f,c);if(!h){n.visible=!1;return}A(i,n,c,f),f("xhoverformat"),f("yhoverformat"),f("text"),f("hovertext"),f("hoverongaps"),f("hovertemplate");var T=f("contours.type")==="constraint";f("connectgaps",d.isArray1D(n.z)),T?E(i,n,f,c,s):(e(i,n,f,v),t(i,n,f,c)),n.contours&&n.contours.coloring==="heatmap"&&r(f,c),f("zorder")}}}),fE=He({"src/traces/contour/index.js"(Y,G){G.exports={attributes:fy(),supplyDefaults:cE(),calc:kw(),plot:W1().plot,style:Z1(),colorbar:X1(),hoverPoints:zw(),moduleType:"trace",name:"contour",basePlotModule:Bc(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),hE=He({"lib/contour.js"(Y,G){G.exports=fE()}}),Ow=He({"src/traces/scatterternary/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=Yo().texttemplateAttrs,A=wv(),E=Zu(),e=cl(),t=kl(),r=Nf().dash,o=ho().extendFlat,a=E.marker,i=E.line,n=a.line;G.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:o({},E.mode,{dflt:"markers"}),text:o({},E.text,{}),texttemplate:x({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:o({},E.hovertext,{}),line:{color:i.color,width:i.width,dash:r,backoff:i.backoff,shape:o({},i.shape,{values:["linear","spline"]}),smoothing:i.smoothing,editType:"calc"},connectgaps:E.connectgaps,cliponaxis:E.cliponaxis,fill:o({},E.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:A(),marker:o({symbol:a.symbol,opacity:a.opacity,angle:a.angle,angleref:a.angleref,standoff:a.standoff,maxdisplayed:a.maxdisplayed,size:a.size,sizeref:a.sizeref,sizemin:a.sizemin,sizemode:a.sizemode,line:o({width:n.width,editType:"calc"},t("marker.line")),gradient:a.gradient,editType:"calc"},t("marker")),textfont:E.textfont,textposition:E.textposition,selected:E.selected,unselected:E.unselected,hoverinfo:o({},e.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:E.hoveron,hovertemplate:d()}}}),vE=He({"src/traces/scatterternary/defaults.js"(Y,G){var d=Gr(),x=jv(),A=Rl(),E=Kh(),e=nv(),t=V0(),r=iv(),o=Av(),a=Ow();G.exports=function(n,s,c,f){function v(M,_){return d.coerce(n,s,a,M,_)}var h=v("a"),T=v("b"),l=v("c"),y;if(h?(y=h.length,T?(y=Math.min(y,T.length),l&&(y=Math.min(y,l.length))):l?y=Math.min(y,l.length):y=0):T&&l&&(y=Math.min(T.length,l.length)),!y){s.visible=!1;return}s._length=y,v("sum"),v("text"),v("hovertext"),s.hoveron!=="fills"&&v("hovertemplate");var b=y"),o.hovertemplate=f.hovertemplate,r}}}),mE=He({"src/traces/scatterternary/event_data.js"(Y,G){G.exports=function(x,A,E,e,t){if(A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),e[t]){var r=e[t];x.a=r.a,x.b=r.b,x.c=r.c}else x.a=A.a,x.b=A.b,x.c=A.c;return x}}}),_E=He({"src/plots/ternary/ternary.js"(Y,G){var d=Qn(),x=Mf(),A=Ei(),E=Gr(),e=E.strTranslate,t=E._,r=Ai(),o=vo(),a=Uv(),i=ho().extendFlat,n=yu(),s=io(),c=fh(),f=Wu(),v=bv(),h=v.freeMode,T=v.rectMode,l=kp(),y=dc().prepSelect,b=dc().selectOnClick,S=dc().clearOutline,M=dc().clearSelectionsCache,_=Ef();function w(L,N){this.id=L.id,this.graphDiv=L.graphDiv,this.init(N),this.makeFramework(N),this.updateFx(N),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}G.exports=w;var p=w.prototype;p.init=function(L){this.container=L._ternarylayer,this.defs=L._defs,this.layoutId=L._uid,this.traceHash={},this.layers={}},p.plot=function(L,N){var U=this,Z=N[U.id],Q=N._size;U._hasClipOnAxisFalse=!1;for(var ue=0;ueu*J?(fe=J,ie=fe*u):(ie=j,fe=ie/u),we=oe*ie/j,Ae=le*fe/J,q=N.l+N.w*Q-ie/2,ae=N.t+N.h*(1-ue)-fe/2,U.x0=q,U.y0=ae,U.w=ie,U.h=fe,U.sum=$,U.xaxis={type:"linear",range:[X+2*ee-$,$-X-2*re],domain:[Q-we/2,Q+we/2],_id:"x"},a(U.xaxis,U.graphDiv._fullLayout),U.xaxis.setScale(),U.xaxis.isPtWithinRange=function(Re){return Re.a>=U.aaxis.range[0]&&Re.a<=U.aaxis.range[1]&&Re.b>=U.baxis.range[1]&&Re.b<=U.baxis.range[0]&&Re.c>=U.caxis.range[1]&&Re.c<=U.caxis.range[0]},U.yaxis={type:"linear",range:[X,$-re-ee],domain:[ue-Ae/2,ue+Ae/2],_id:"y"},a(U.yaxis,U.graphDiv._fullLayout),U.yaxis.setScale(),U.yaxis.isPtWithinRange=function(){return!0};var Fe=U.yaxis.domain[0],Ce=U.aaxis=i({},L.aaxis,{range:[X,$-re-ee],side:"left",tickangle:(+L.aaxis.tickangle||0)-30,domain:[Fe,Fe+Ae*u],anchor:"free",position:0,_id:"y",_length:ie});a(Ce,U.graphDiv._fullLayout),Ce.setScale();var qe=U.baxis=i({},L.baxis,{range:[$-X-ee,re],side:"bottom",domain:U.xaxis.domain,anchor:"free",position:0,_id:"x",_length:ie});a(qe,U.graphDiv._fullLayout),qe.setScale();var et=U.caxis=i({},L.caxis,{range:[$-X-re,ee],side:"right",tickangle:(+L.caxis.tickangle||0)+30,domain:[Fe,Fe+Ae*u],anchor:"free",position:0,_id:"y",_length:ie});a(et,U.graphDiv._fullLayout),et.setScale();var Qe="M"+q+","+(ae+fe)+"h"+ie+"l-"+ie/2+",-"+fe+"Z";U.clipDef.select("path").attr("d",Qe),U.layers.plotbg.select("path").attr("d",Qe);var Ke="M0,"+fe+"h"+ie+"l-"+ie/2+",-"+fe+"Z";U.clipDefRelative.select("path").attr("d",Ke);var Xe=e(q,ae);U.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Xe),U.clipDefRelative.select("path").attr("transform",null);var Me=e(q-qe._offset,ae+fe);U.layers.baxis.attr("transform",Me),U.layers.bgrid.attr("transform",Me);var xe=e(q+ie/2,ae)+"rotate(30)"+e(0,-Ce._offset);U.layers.aaxis.attr("transform",xe),U.layers.agrid.attr("transform",xe);var ce=e(q+ie/2,ae)+"rotate(-30)"+e(0,-et._offset);U.layers.caxis.attr("transform",ce),U.layers.cgrid.attr("transform",ce),U.drawAxes(!0),U.layers.aline.select("path").attr("d",Ce.showline?"M"+q+","+(ae+fe)+"l"+ie/2+",-"+fe:"M0,0").call(r.stroke,Ce.linecolor||"#000").style("stroke-width",(Ce.linewidth||0)+"px"),U.layers.bline.select("path").attr("d",qe.showline?"M"+q+","+(ae+fe)+"h"+ie:"M0,0").call(r.stroke,qe.linecolor||"#000").style("stroke-width",(qe.linewidth||0)+"px"),U.layers.cline.select("path").attr("d",et.showline?"M"+(q+ie/2)+","+ae+"l"+ie/2+","+fe:"M0,0").call(r.stroke,et.linecolor||"#000").style("stroke-width",(et.linewidth||0)+"px"),U.graphDiv._context.staticPlot||U.initInteractions(),o.setClipUrl(U.layers.frontplot,U._hasClipOnAxisFalse?null:U.clipId,U.graphDiv)},p.drawAxes=function(L){var N=this,U=N.graphDiv,Z=N.id.substr(7)+"title",Q=N.layers,ue=N.aaxis,oe=N.baxis,le=N.caxis;if(N.drawAx(ue),N.drawAx(oe),N.drawAx(le),L){var j=Math.max(ue.showticklabels?ue.tickfont.size/2:0,(le.showticklabels?le.tickfont.size*.75:0)+(le.ticks==="outside"?le.ticklen*.87:0)),J=(oe.showticklabels?oe.tickfont.size:0)+(oe.ticks==="outside"?oe.ticklen:0)+3;Q["a-title"]=l.draw(U,"a"+Z,{propContainer:ue,propName:N.id+".aaxis.title",placeholder:t(U,"Click to enter Component A title"),attributes:{x:N.x0+N.w/2,y:N.y0-ue.title.font.size/3-j,"text-anchor":"middle"}}),Q["b-title"]=l.draw(U,"b"+Z,{propContainer:oe,propName:N.id+".baxis.title",placeholder:t(U,"Click to enter Component B title"),attributes:{x:N.x0-J,y:N.y0+N.h+oe.title.font.size*.83+J,"text-anchor":"middle"}}),Q["c-title"]=l.draw(U,"c"+Z,{propContainer:le,propName:N.id+".caxis.title",placeholder:t(U,"Click to enter Component C title"),attributes:{x:N.x0+N.w+J,y:N.y0+N.h+le.title.font.size*.83+J,"text-anchor":"middle"}})}},p.drawAx=function(L){var N=this,U=N.graphDiv,Z=L._name,Q=Z.charAt(0),ue=L._id,oe=N.layers[Z],le=30,j=Q+"tickLayout",J=g(L);N[j]!==J&&(oe.selectAll("."+ue+"tick").remove(),N[j]=J),L.setScale();var $=s.calcTicks(L),X=s.clipEnds(L,$),re=s.makeTransTickFn(L),ee=s.getTickSigns(L)[2],q=E.deg2rad(le),ae=ee*(L.linewidth||1)/2,ie=ee*L.ticklen,fe=N.w,we=N.h,Ae=Q==="b"?"M0,"+ae+"l"+Math.sin(q)*ie+","+Math.cos(q)*ie:"M"+ae+",0l"+Math.cos(q)*ie+","+-Math.sin(q)*ie,Fe={a:"M0,0l"+we+",-"+fe/2,b:"M0,0l-"+fe/2+",-"+we,c:"M0,0l-"+we+","+fe/2}[Q];s.drawTicks(U,L,{vals:L.ticks==="inside"?X:$,layer:oe,path:Ae,transFn:re,crisp:!1}),s.drawGrid(U,L,{vals:X,layer:N.layers[Q+"grid"],path:Fe,transFn:re,crisp:!1}),s.drawLabels(U,L,{vals:$,layer:oe,transFn:re,labelFns:s.makeLabelFns(L,0,le)})};function g(L){return L.ticks+String(L.ticklen)+String(L.showticklabels)}var m=_.MINZOOM/2+.87,R="m-0.87,.5h"+m+"v3h-"+(m+5.2)+"l"+(m/2+2.6)+",-"+(m*.87+4.5)+"l2.6,1.5l-"+m/2+","+m*.87+"Z",P="m0.87,.5h-"+m+"v3h"+(m+5.2)+"l-"+(m/2+2.6)+",-"+(m*.87+4.5)+"l-2.6,1.5l"+m/2+","+m*.87+"Z",z="m0,1l"+m/2+","+m*.87+"l2.6,-1.5l-"+(m/2+2.6)+",-"+(m*.87+4.5)+"l-"+(m/2+2.6)+","+(m*.87+4.5)+"l2.6,1.5l"+m/2+",-"+m*.87+"Z",F="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",B=!0;p.clearOutline=function(){M(this.dragOptions),S(this.dragOptions.gd)},p.initInteractions=function(){var L=this,N=L.layers.plotbg.select("path").node(),U=L.graphDiv,Z=U._fullLayout._zoomlayer,Q,ue;this.dragOptions={element:N,gd:U,plotinfo:{id:L.id,domain:U._fullLayout[L.id].domain,xaxis:L.xaxis,yaxis:L.yaxis},subplot:L.id,prepFn:function(Me,xe,ce){L.dragOptions.xaxes=[L.xaxis],L.dragOptions.yaxes=[L.yaxis],Q=U._fullLayout._invScaleX,ue=U._fullLayout._invScaleY;var Re=L.dragOptions.dragmode=U._fullLayout.dragmode;h(Re)?L.dragOptions.minDrag=1:L.dragOptions.minDrag=void 0,Re==="zoom"?(L.dragOptions.moveFn=qe,L.dragOptions.clickFn=fe,L.dragOptions.doneFn=et,we(Me,xe,ce)):Re==="pan"?(L.dragOptions.moveFn=Ke,L.dragOptions.clickFn=fe,L.dragOptions.doneFn=Xe,Qe(),L.clearOutline(U)):(T(Re)||h(Re))&&y(Me,xe,ce,L.dragOptions,Re)}};var oe,le,j,J,$,X,re,ee,q,ae;function ie(Me){var xe={};return xe[L.id+".aaxis.min"]=Me.a,xe[L.id+".baxis.min"]=Me.b,xe[L.id+".caxis.min"]=Me.c,xe}function fe(Me,xe){var ce=U._fullLayout.clickmode;O(U),Me===2&&(U.emit("plotly_doubleclick",null),A.call("_guiRelayout",U,ie({a:0,b:0,c:0}))),ce.indexOf("select")>-1&&Me===1&&b(xe,U,[L.xaxis],[L.yaxis],L.id,L.dragOptions),ce.indexOf("event")>-1&&f.click(U,xe,L.id)}function we(Me,xe,ce){var Re=N.getBoundingClientRect();oe=xe-Re.left,le=ce-Re.top,U._fullLayout._calcInverseTransform(U);var $e=U._fullLayout._invTransform,rt=E.apply3DTransform($e)(oe,le);oe=rt[0],le=rt[1],j={a:L.aaxis.range[0],b:L.baxis.range[1],c:L.caxis.range[1]},$=j,J=L.aaxis.range[1]-j.a,X=x(L.graphDiv._fullLayout[L.id].bgcolor).getLuminance(),re="M0,"+L.h+"L"+L.w/2+", 0L"+L.w+","+L.h+"Z",ee=!1,q=Z.append("path").attr("class","zoombox").attr("transform",e(L.x0,L.y0)).style({fill:X>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",re),ae=Z.append("path").attr("class","zoombox-corners").attr("transform",e(L.x0,L.y0)).style({fill:r.background,stroke:r.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),L.clearOutline(U)}function Ae(Me,xe){return 1-xe/L.h}function Fe(Me,xe){return 1-(Me+(L.h-xe)/Math.sqrt(3))/L.w}function Ce(Me,xe){return(Me-(L.h-xe)/Math.sqrt(3))/L.w}function qe(Me,xe){var ce=oe+Me*Q,Re=le+xe*ue,$e=Math.max(0,Math.min(1,Ae(oe,le),Ae(ce,Re))),rt=Math.max(0,Math.min(1,Fe(oe,le),Fe(ce,Re))),Je=Math.max(0,Math.min(1,Ce(oe,le),Ce(ce,Re))),At=($e/2+Je)*L.w,St=(1-$e/2-rt)*L.w,Rt=(At+St)/2,Ut=St-At,ir=(1-$e)*L.h,ar=ir-Ut/u;Ut<_.MINZOOM?($=j,q.attr("d",re),ae.attr("d","M0,0Z")):($={a:j.a+$e*J,b:j.b+rt*J,c:j.c+Je*J},q.attr("d",re+"M"+At+","+ir+"H"+St+"L"+Rt+","+ar+"L"+At+","+ir+"Z"),ae.attr("d","M"+oe+","+le+F+"M"+At+","+ir+R+"M"+St+","+ir+P+"M"+Rt+","+ar+z)),ee||(q.transition().style("fill",X>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ae.transition().style("opacity",1).duration(200),ee=!0),U.emit("plotly_relayouting",ie($))}function et(){O(U),$!==j&&(A.call("_guiRelayout",U,ie($)),B&&U.data&&U._context.showTips&&(E.notifier(t(U,"Double-click to zoom back out"),"long"),B=!1))}function Qe(){j={a:L.aaxis.range[0],b:L.baxis.range[1],c:L.caxis.range[1]},$=j}function Ke(Me,xe){var ce=Me/L.xaxis._m,Re=xe/L.yaxis._m;$={a:j.a-Re,b:j.b+(ce+Re)/2,c:j.c-(ce-Re)/2};var $e=[$.a,$.b,$.c].sort(E.sorterAsc),rt={a:$e.indexOf($.a),b:$e.indexOf($.b),c:$e.indexOf($.c)};$e[0]<0&&($e[1]+$e[0]/2<0?($e[2]+=$e[0]+$e[1],$e[0]=$e[1]=0):($e[2]+=$e[0]/2,$e[1]+=$e[0]/2,$e[0]=0),$={a:$e[rt.a],b:$e[rt.b],c:$e[rt.c]},xe=(j.a-$.a)*L.yaxis._m,Me=(j.c-$.c-j.b+$.b)*L.xaxis._m);var Je=e(L.x0+Me,L.y0+xe);L.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Je);var At=e(-Me,-xe);L.clipDefRelative.select("path").attr("transform",At),L.aaxis.range=[$.a,L.sum-$.b-$.c],L.baxis.range=[L.sum-$.a-$.c,$.b],L.caxis.range=[L.sum-$.a-$.b,$.c],L.drawAxes(!1),L._hasClipOnAxisFalse&&L.plotContainer.select(".scatterlayer").selectAll(".trace").call(o.hideOutsideRangePoints,L),U.emit("plotly_relayouting",ie($))}function Xe(){A.call("_guiRelayout",U,ie($))}N.onmousemove=function(Me){f.hover(U,Me,L.id),U._fullLayout._lasthover=N,U._fullLayout._hoversubplot=L.id},N.onmouseout=function(Me){U._dragging||c.unhover(U,Me)},c.init(this.dragOptions)};function O(L){d.select(L).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}}),Bw=He({"src/plots/ternary/layout_attributes.js"(Y,G){var d=Xc(),x=mu().attributes,A=jf(),E=hu().overrideAll,e=ho().extendFlat,t={title:{text:A.title.text,font:A.title.font},color:A.color,tickmode:A.minor.tickmode,nticks:e({},A.nticks,{dflt:6,min:1}),tick0:A.tick0,dtick:A.dtick,tickvals:A.tickvals,ticktext:A.ticktext,ticks:A.ticks,ticklen:A.ticklen,tickwidth:A.tickwidth,tickcolor:A.tickcolor,ticklabelstep:A.ticklabelstep,showticklabels:A.showticklabels,labelalias:A.labelalias,showtickprefix:A.showtickprefix,tickprefix:A.tickprefix,showticksuffix:A.showticksuffix,ticksuffix:A.ticksuffix,showexponent:A.showexponent,exponentformat:A.exponentformat,minexponent:A.minexponent,separatethousands:A.separatethousands,tickfont:A.tickfont,tickangle:A.tickangle,tickformat:A.tickformat,tickformatstops:A.tickformatstops,hoverformat:A.hoverformat,showline:e({},A.showline,{dflt:!0}),linecolor:A.linecolor,linewidth:A.linewidth,showgrid:e({},A.showgrid,{dflt:!0}),gridcolor:A.gridcolor,gridwidth:A.gridwidth,griddash:A.griddash,layer:A.layer,min:{valType:"number",dflt:0,min:0}},r=G.exports=E({domain:x({name:"ternary"}),bgcolor:{valType:"color",dflt:d.background},sum:{valType:"number",dflt:1,min:0},aaxis:t,baxis:t,caxis:t},"plot","from-root");r.uirevision={valType:"any",editType:"none"},r.aaxis.uirevision=r.baxis.uirevision=r.caxis.uirevision={valType:"any",editType:"none"}}}),Xd=He({"src/plots/subplot_defaults.js"(Y,G){var d=Gr(),x=Gs(),A=mu().defaults;G.exports=function(e,t,r,o){var a=o.type,i=o.attributes,n=o.handleDefaults,s=o.partition||"x",c=t._subplots[a],f=c.length,v=f&&c[0].replace(/\d+$/,""),h,T;function l(M,_){return d.coerce(h,T,i,M,_)}for(var y=0;y=y&&(w.min=0,p.min=0,u.min=0,f.aaxis&&delete f.aaxis.min,f.baxis&&delete f.baxis.min,f.caxis&&delete f.caxis.min)}function c(f,v,h,T){var l=i[v._name];function y(g,m){return A.coerce(f,v,l,g,m)}y("uirevision",T.uirevision),v.type="linear";var b=y("color"),S=b!==l.color.dflt?b:h.font.color,M=v._name,_=M.charAt(0).toUpperCase(),w="Component "+_,p=y("title.text",w);v._hovertitle=p===w?p:_,A.coerceFont(y,"title.font",h.font,{overrideDflt:{size:A.bigFont(h.font.size),color:S}}),y("min"),o(f,v,y,"linear"),t(f,v,y,"linear"),e(f,v,y,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),r(f,v,y,{outerTicks:!0});var u=y("showticklabels");u&&(A.coerceFont(y,"tickfont",h.font,{overrideDflt:{color:S}}),y("tickangle"),y("tickformat")),a(f,v,y,{dfltColor:b,bgColor:h.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:l}),y("hoverformat"),y("layer")}}}),bE=He({"src/plots/ternary/index.js"(Y){var G=_E(),d=Uf().getSubplotCalcData,x=Gr().counterRegex,A="ternary";Y.name=A;var E=Y.attr="subplot";Y.idRoot=A,Y.idRegex=Y.attrRegex=x(A);var e=Y.attributes={};e[E]={valType:"subplotid",dflt:"ternary",editType:"calc"},Y.layoutAttributes=Bw(),Y.supplyLayoutDefaults=xE(),Y.plot=function(r){for(var o=r._fullLayout,a=r.calcdata,i=o._subplots[A],n=0;n0){var M=r.xa,_=r.ya,w,p,u,g,m;f.orientation==="h"?(m=o,w="y",u=_,p="x",g=M):(m=a,w="x",u=M,p="y",g=_);var R=c[r.index];if(m>=R.span[0]&&m<=R.span[1]){var P=x.extendFlat({},r),z=g.c2p(m,!0),F=e.getKdeValue(R,f,m),B=e.getPositionOnKdePath(R,f,z),O=u._offset,L=u._length;P[w+"0"]=B[0],P[w+"1"]=B[1],P[p+"0"]=P[p+"1"]=z,P[p+"Label"]=p+": "+A.hoverLabelText(g,m,f[p+"hoverformat"])+", "+c[0].t.labels.kde+" "+F.toFixed(3);for(var N=0,U=0;U path").each(function(h){if(!h.isBlank){var T=v.marker;d.select(this).call(A.fill,h.mc||T.color).call(A.stroke,h.mlc||T.line.color).call(x.dashLine,T.line.dash,h.mlw||T.line.width).style("opacity",v.selectedpoints&&!h.selected?E:1)}}),r(f,v,a),f.selectAll(".regions").each(function(){d.select(this).selectAll("path").style("stroke-width",0).call(A.fill,v.connector.fillcolor)}),f.selectAll(".lines").each(function(){var h=v.connector.line;x.lineGroupStyle(d.select(this).selectAll("path"),h.width,h.color,h.dash)})})}G.exports={style:o}}}),UE=He({"src/traces/funnel/hover.js"(Y,G){var d=Ai().opacity,x=Z0().hoverOnBars,A=Gr().formatPercent;G.exports=function(t,r,o,a,i){var n=x(t,r,o,a,i);if(n){var s=n.cd,c=s[0].trace,f=c.orientation==="h",v=n.index,h=s[v],T=f?"x":"y";n[T+"LabelVal"]=h.s,n.percentInitial=h.begR,n.percentInitialLabel=A(h.begR,1),n.percentPrevious=h.difR,n.percentPreviousLabel=A(h.difR,1),n.percentTotal=h.sumR,n.percentTotalLabel=A(h.sumR,1);var l=h.hi||c.hoverinfo,y=[];if(l&&l!=="none"&&l!=="skip"){var b=l==="all",S=l.split("+"),M=function(_){return b||S.indexOf(_)!==-1};M("percent initial")&&y.push(n.percentInitialLabel+" of initial"),M("percent previous")&&y.push(n.percentPreviousLabel+" of previous"),M("percent total")&&y.push(n.percentTotalLabel+" of total")}return n.extraText=y.join("
"),n.color=E(c,h),[n]}};function E(e,t){var r=e.marker,o=t.mc||r.color,a=t.mlc||r.line.color,i=t.mlw||r.line.width;if(d(o))return o;if(d(a)&&i)return a}}}),jE=He({"src/traces/funnel/event_data.js"(Y,G){G.exports=function(x,A){return x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,"percentInitial"in A&&(x.percentInitial=A.percentInitial),"percentPrevious"in A&&(x.percentPrevious=A.percentPrevious),"percentTotal"in A&&(x.percentTotal=A.percentTotal),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),x}}}),VE=He({"src/traces/funnel/index.js"(Y,G){G.exports={attributes:jw(),layoutAttributes:Vw(),supplyDefaults:qw().supplyDefaults,crossTraceDefaults:qw().crossTraceDefaults,supplyLayoutDefaults:DE(),calc:FE(),crossTraceCalc:OE(),plot:BE(),style:NE().style,hoverPoints:UE(),eventData:jE(),selectPoints:X0(),moduleType:"trace",name:"funnel",basePlotModule:Bc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),qE=He({"lib/funnel.js"(Y,G){G.exports=VE()}}),HE=He({"src/traces/waterfall/constants.js"(Y,G){G.exports={eventDataKeys:["initial","delta","final"]}}}),Hw=He({"src/traces/waterfall/attributes.js"(Y,G){var d=qv(),x=Zu().line,A=cl(),E=Gu().axisHoverFormat,e=Yo().hovertemplateAttrs,t=Yo().texttemplateAttrs,r=HE(),o=ho().extendFlat,a=Ai();function i(n){return{marker:{color:o({},d.marker.color,{arrayOk:!1,editType:"style"}),line:{color:o({},d.marker.line.color,{arrayOk:!1,editType:"style"}),width:o({},d.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}G.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,xhoverformat:E("x"),yhoverformat:E("y"),hovertext:d.hovertext,hovertemplate:e({},{keys:r.eventDataKeys}),hoverinfo:o({},A.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:t({editType:"plot"},{keys:r.eventDataKeys.concat(["label"])}),text:d.text,textposition:d.textposition,insidetextanchor:d.insidetextanchor,textangle:d.textangle,textfont:d.textfont,insidetextfont:d.insidetextfont,outsidetextfont:d.outsidetextfont,constraintext:d.constraintext,cliponaxis:d.cliponaxis,orientation:d.orientation,offset:d.offset,width:d.width,increasing:i(),decreasing:i(),totals:i(),connector:{line:{color:o({},x.color,{dflt:a.defaultLine}),width:o({},x.width,{editType:"plot"}),dash:x.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,zorder:d.zorder}}}),Gw=He({"src/traces/waterfall/layout_attributes.js"(Y,G){G.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"}}}}),K0=He({"src/constants/delta.js"(Y,G){G.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}}),Ww=He({"src/traces/waterfall/defaults.js"(Y,G){var d=Gr(),x=Pp(),A=Jh().handleText,E=j0(),e=Tv(),t=Hw(),r=Ai(),o=K0(),a=o.INCREASING.COLOR,i=o.DECREASING.COLOR,n="#4499FF";function s(v,h,T){v(h+".marker.color",T),v(h+".marker.line.color",r.defaultLine),v(h+".marker.line.width")}function c(v,h,T,l){function y(w,p){return d.coerce(v,h,t,w,p)}var b=E(v,h,l,y);if(!b){h.visible=!1;return}e(v,h,l,y),y("xhoverformat"),y("yhoverformat"),y("measure"),y("orientation",h.x&&!h.y?"h":"v"),y("base"),y("offset"),y("width"),y("text"),y("hovertext"),y("hovertemplate");var S=y("textposition");A(v,h,l,y,S,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),h.textposition!=="none"&&(y("texttemplate"),h.texttemplate||y("textinfo")),s(y,"increasing",a),s(y,"decreasing",i),s(y,"totals",n);var M=y("connector.visible");if(M){y("connector.mode");var _=y("connector.line.width");_&&(y("connector.line.color"),y("connector.line.dash"))}y("zorder")}function f(v,h){var T,l;function y(S){return d.coerce(l._input,l,t,S)}if(h.waterfallmode==="group")for(var b=0;b0&&(y?m+="M"+u[0]+","+g[1]+"V"+g[0]:m+="M"+u[1]+","+g[0]+"H"+u[0]),b!=="between"&&(_.isSum||w path").each(function(h){if(!h.isBlank){var T=v[h.dir].marker;d.select(this).call(A.fill,T.color).call(A.stroke,T.line.color).call(x.dashLine,T.line.dash,T.line.width).style("opacity",v.selectedpoints&&!h.selected?E:1)}}),r(f,v,a),f.selectAll(".lines").each(function(){var h=v.connector.line;x.lineGroupStyle(d.select(this).selectAll("path"),h.width,h.color,h.dash)})})}G.exports={style:o}}}),KE=He({"src/traces/waterfall/hover.js"(Y,G){var d=io().hoverLabelText,x=Ai().opacity,A=Z0().hoverOnBars,E=K0(),e={increasing:E.INCREASING.SYMBOL,decreasing:E.DECREASING.SYMBOL};G.exports=function(o,a,i,n,s){var c=A(o,a,i,n,s);if(!c)return;var f=c.cd,v=f[0].trace,h=v.orientation==="h",T=h?"x":"y",l=h?o.xa:o.ya;function y(R){return d(l,R,v[T+"hoverformat"])}var b=c.index,S=f[b],M=S.isSum?S.b+S.s:S.rawS;c.initial=S.b+S.s-M,c.delta=M,c.final=c.initial+c.delta;var _=y(Math.abs(c.delta));c.deltaLabel=M<0?"("+_+")":_,c.finalLabel=y(c.final),c.initialLabel=y(c.initial);var w=S.hi||v.hoverinfo,p=[];if(w&&w!=="none"&&w!=="skip"){var u=w==="all",g=w.split("+"),m=function(R){return u||g.indexOf(R)!==-1};S.isSum||(m("final")&&(h?!m("x"):!m("y"))&&p.push(c.finalLabel),m("delta")&&(M<0?p.push(c.deltaLabel+" "+e.decreasing):p.push(c.deltaLabel+" "+e.increasing)),m("initial")&&p.push("Initial: "+c.initialLabel))}return p.length&&(c.extraText=p.join("
")),c.color=t(v,S),[c]};function t(r,o){var a=r[o.dir].marker,i=a.color,n=a.line.color,s=a.line.width;if(x(i))return i;if(x(n)&&s)return n}}}),JE=He({"src/traces/waterfall/event_data.js"(Y,G){G.exports=function(x,A){return x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,"initial"in A&&(x.initial=A.initial),"delta"in A&&(x.delta=A.delta),"final"in A&&(x.final=A.final),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),x}}}),$E=He({"src/traces/waterfall/index.js"(Y,G){G.exports={attributes:Hw(),layoutAttributes:Gw(),supplyDefaults:Ww().supplyDefaults,crossTraceDefaults:Ww().crossTraceDefaults,supplyLayoutDefaults:GE(),calc:WE(),crossTraceCalc:ZE(),plot:XE(),style:YE().style,hoverPoints:KE(),eventData:JE(),selectPoints:X0(),moduleType:"trace",name:"waterfall",basePlotModule:Bc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),QE=He({"lib/waterfall.js"(Y,G){G.exports=$E()}}),J0=He({"src/traces/image/constants.js"(Y,G){G.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(d){return d.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(d){var x=d.slice(0,3);return x[1]=x[1]+"%",x[2]=x[2]+"%",x},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(d){var x=d.slice(0,4);return x[1]=x[1]+"%",x[2]=x[2]+"%",x},suffix:["°","%","%",""]}}}}}),Zw=He({"src/traces/image/attributes.js"(Y,G){var d=cl(),x=Zu().zorder,A=Yo().hovertemplateAttrs,E=ho().extendFlat,e=J0().colormodel,t=["rgb","rgba","rgba256","hsl","hsla"],r=[],o=[];for(i=0;i0)throw new Error("Invalid string. Length must be a multiple of 4");var v=c.indexOf("=");v===-1&&(v=f);var h=v===f?0:4-v%4;return[v,h]}function r(c){var f=t(c),v=f[0],h=f[1];return(v+h)*3/4-h}function o(c,f,v){return(f+v)*3/4-v}function a(c){var f,v=t(c),h=v[0],T=v[1],l=new x(o(c,h,T)),y=0,b=T>0?h-4:h,S;for(S=0;S>16&255,l[y++]=f>>8&255,l[y++]=f&255;return T===2&&(f=d[c.charCodeAt(S)]<<2|d[c.charCodeAt(S+1)]>>4,l[y++]=f&255),T===1&&(f=d[c.charCodeAt(S)]<<10|d[c.charCodeAt(S+1)]<<4|d[c.charCodeAt(S+2)]>>2,l[y++]=f>>8&255,l[y++]=f&255),l}function i(c){return G[c>>18&63]+G[c>>12&63]+G[c>>6&63]+G[c&63]}function n(c,f,v){for(var h,T=[],l=f;lb?b:y+l));return h===1?(f=c[v-1],T.push(G[f>>2]+G[f<<4&63]+"==")):h===2&&(f=(c[v-2]<<8)+c[v-1],T.push(G[f>>10]+G[f>>4&63]+G[f<<2&63]+"=")),T.join("")}}}),rk=He({"node_modules/ieee754/index.js"(Y){Y.read=function(G,d,x,A,E){var e,t,r=E*8-A-1,o=(1<>1,i=-7,n=x?E-1:0,s=x?-1:1,c=G[d+n];for(n+=s,e=c&(1<<-i)-1,c>>=-i,i+=r;i>0;e=e*256+G[d+n],n+=s,i-=8);for(t=e&(1<<-i)-1,e>>=-i,i+=A;i>0;t=t*256+G[d+n],n+=s,i-=8);if(e===0)e=1-a;else{if(e===o)return t?NaN:(c?-1:1)*(1/0);t=t+Math.pow(2,A),e=e-a}return(c?-1:1)*t*Math.pow(2,e-A)},Y.write=function(G,d,x,A,E,e){var t,r,o,a=e*8-E-1,i=(1<>1,s=E===23?Math.pow(2,-24)-Math.pow(2,-77):0,c=A?0:e-1,f=A?1:-1,v=d<0||d===0&&1/d<0?1:0;for(d=Math.abs(d),isNaN(d)||d===1/0?(r=isNaN(d)?1:0,t=i):(t=Math.floor(Math.log(d)/Math.LN2),d*(o=Math.pow(2,-t))<1&&(t--,o*=2),t+n>=1?d+=s/o:d+=s*Math.pow(2,1-n),d*o>=2&&(t++,o/=2),t+n>=i?(r=0,t=i):t+n>=1?(r=(d*o-1)*Math.pow(2,E),t=t+n):(r=d*Math.pow(2,n-1)*Math.pow(2,E),t=0));E>=8;G[x+c]=r&255,c+=f,r/=256,E-=8);for(t=t<0;G[x+c]=t&255,c+=f,t/=256,a-=8);G[x+c-f]|=v*128}}}),zp=He({"node_modules/buffer/index.js"(Y){var G=tk(),d=rk(),x=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Y.Buffer=t,Y.SlowBuffer=T,Y.INSPECT_MAX_BYTES=50;var A=2147483647;Y.kMaxLength=A,t.TYPED_ARRAY_SUPPORT=E(),!t.TYPED_ARRAY_SUPPORT&&typeof console<"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.");function E(){try{const Me=new Uint8Array(1),xe={foo:function(){return 42}};return Object.setPrototypeOf(xe,Uint8Array.prototype),Object.setPrototypeOf(Me,xe),Me.foo()===42}catch{return!1}}Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}});function e(Me){if(Me>A)throw new RangeError('The value "'+Me+'" is invalid for option "size"');const xe=new Uint8Array(Me);return Object.setPrototypeOf(xe,t.prototype),xe}function t(Me,xe,ce){if(typeof Me=="number"){if(typeof xe=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return i(Me)}return r(Me,xe,ce)}t.poolSize=8192;function r(Me,xe,ce){if(typeof Me=="string")return n(Me,xe);if(ArrayBuffer.isView(Me))return c(Me);if(Me==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Me);if(qe(Me,ArrayBuffer)||Me&&qe(Me.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(qe(Me,SharedArrayBuffer)||Me&&qe(Me.buffer,SharedArrayBuffer)))return f(Me,xe,ce);if(typeof Me=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Re=Me.valueOf&&Me.valueOf();if(Re!=null&&Re!==Me)return t.from(Re,xe,ce);const $e=v(Me);if($e)return $e;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Me[Symbol.toPrimitive]=="function")return t.from(Me[Symbol.toPrimitive]("string"),xe,ce);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Me)}t.from=function(Me,xe,ce){return r(Me,xe,ce)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array);function o(Me){if(typeof Me!="number")throw new TypeError('"size" argument must be of type number');if(Me<0)throw new RangeError('The value "'+Me+'" is invalid for option "size"')}function a(Me,xe,ce){return o(Me),Me<=0?e(Me):xe!==void 0?typeof ce=="string"?e(Me).fill(xe,ce):e(Me).fill(xe):e(Me)}t.alloc=function(Me,xe,ce){return a(Me,xe,ce)};function i(Me){return o(Me),e(Me<0?0:h(Me)|0)}t.allocUnsafe=function(Me){return i(Me)},t.allocUnsafeSlow=function(Me){return i(Me)};function n(Me,xe){if((typeof xe!="string"||xe==="")&&(xe="utf8"),!t.isEncoding(xe))throw new TypeError("Unknown encoding: "+xe);const ce=l(Me,xe)|0;let Re=e(ce);const $e=Re.write(Me,xe);return $e!==ce&&(Re=Re.slice(0,$e)),Re}function s(Me){const xe=Me.length<0?0:h(Me.length)|0,ce=e(xe);for(let Re=0;Re=A)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A.toString(16)+" bytes");return Me|0}function T(Me){return+Me!=Me&&(Me=0),t.alloc(+Me)}t.isBuffer=function(xe){return xe!=null&&xe._isBuffer===!0&&xe!==t.prototype},t.compare=function(xe,ce){if(qe(xe,Uint8Array)&&(xe=t.from(xe,xe.offset,xe.byteLength)),qe(ce,Uint8Array)&&(ce=t.from(ce,ce.offset,ce.byteLength)),!t.isBuffer(xe)||!t.isBuffer(ce))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(xe===ce)return 0;let Re=xe.length,$e=ce.length;for(let rt=0,Je=Math.min(Re,$e);rt$e.length?(t.isBuffer(Je)||(Je=t.from(Je)),Je.copy($e,rt)):Uint8Array.prototype.set.call($e,Je,rt);else if(t.isBuffer(Je))Je.copy($e,rt);else throw new TypeError('"list" argument must be an Array of Buffers');rt+=Je.length}return $e};function l(Me,xe){if(t.isBuffer(Me))return Me.length;if(ArrayBuffer.isView(Me)||qe(Me,ArrayBuffer))return Me.byteLength;if(typeof Me!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Me);const ce=Me.length,Re=arguments.length>2&&arguments[2]===!0;if(!Re&&ce===0)return 0;let $e=!1;for(;;)switch(xe){case"ascii":case"latin1":case"binary":return ce;case"utf8":case"utf-8":return fe(Me).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce*2;case"hex":return ce>>>1;case"base64":return Fe(Me).length;default:if($e)return Re?-1:fe(Me).length;xe=(""+xe).toLowerCase(),$e=!0}}t.byteLength=l;function y(Me,xe,ce){let Re=!1;if((xe===void 0||xe<0)&&(xe=0),xe>this.length||((ce===void 0||ce>this.length)&&(ce=this.length),ce<=0)||(ce>>>=0,xe>>>=0,ce<=xe))return"";for(Me||(Me="utf8");;)switch(Me){case"hex":return O(this,xe,ce);case"utf8":case"utf-8":return R(this,xe,ce);case"ascii":return F(this,xe,ce);case"latin1":case"binary":return B(this,xe,ce);case"base64":return m(this,xe,ce);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,xe,ce);default:if(Re)throw new TypeError("Unknown encoding: "+Me);Me=(Me+"").toLowerCase(),Re=!0}}t.prototype._isBuffer=!0;function b(Me,xe,ce){const Re=Me[xe];Me[xe]=Me[ce],Me[ce]=Re}t.prototype.swap16=function(){const xe=this.length;if(xe%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let ce=0;cece&&(xe+=" ... "),""},x&&(t.prototype[x]=t.prototype.inspect),t.prototype.compare=function(xe,ce,Re,$e,rt){if(qe(xe,Uint8Array)&&(xe=t.from(xe,xe.offset,xe.byteLength)),!t.isBuffer(xe))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof xe);if(ce===void 0&&(ce=0),Re===void 0&&(Re=xe?xe.length:0),$e===void 0&&($e=0),rt===void 0&&(rt=this.length),ce<0||Re>xe.length||$e<0||rt>this.length)throw new RangeError("out of range index");if($e>=rt&&ce>=Re)return 0;if($e>=rt)return-1;if(ce>=Re)return 1;if(ce>>>=0,Re>>>=0,$e>>>=0,rt>>>=0,this===xe)return 0;let Je=rt-$e,At=Re-ce;const St=Math.min(Je,At),Rt=this.slice($e,rt),Ut=xe.slice(ce,Re);for(let ir=0;ir2147483647?ce=2147483647:ce<-2147483648&&(ce=-2147483648),ce=+ce,et(ce)&&(ce=$e?0:Me.length-1),ce<0&&(ce=Me.length+ce),ce>=Me.length){if($e)return-1;ce=Me.length-1}else if(ce<0)if($e)ce=0;else return-1;if(typeof xe=="string"&&(xe=t.from(xe,Re)),t.isBuffer(xe))return xe.length===0?-1:M(Me,xe,ce,Re,$e);if(typeof xe=="number")return xe=xe&255,typeof Uint8Array.prototype.indexOf=="function"?$e?Uint8Array.prototype.indexOf.call(Me,xe,ce):Uint8Array.prototype.lastIndexOf.call(Me,xe,ce):M(Me,[xe],ce,Re,$e);throw new TypeError("val must be string, number or Buffer")}function M(Me,xe,ce,Re,$e){let rt=1,Je=Me.length,At=xe.length;if(Re!==void 0&&(Re=String(Re).toLowerCase(),Re==="ucs2"||Re==="ucs-2"||Re==="utf16le"||Re==="utf-16le")){if(Me.length<2||xe.length<2)return-1;rt=2,Je/=2,At/=2,ce/=2}function St(Ut,ir){return rt===1?Ut[ir]:Ut.readUInt16BE(ir*rt)}let Rt;if($e){let Ut=-1;for(Rt=ce;RtJe&&(ce=Je-At),Rt=ce;Rt>=0;Rt--){let Ut=!0;for(let ir=0;ir$e&&(Re=$e)):Re=$e;const rt=xe.length;Re>rt/2&&(Re=rt/2);let Je;for(Je=0;Je>>0,isFinite(Re)?(Re=Re>>>0,$e===void 0&&($e="utf8")):($e=Re,Re=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const rt=this.length-ce;if((Re===void 0||Re>rt)&&(Re=rt),xe.length>0&&(Re<0||ce<0)||ce>this.length)throw new RangeError("Attempt to write outside buffer bounds");$e||($e="utf8");let Je=!1;for(;;)switch($e){case"hex":return _(this,xe,ce,Re);case"utf8":case"utf-8":return w(this,xe,ce,Re);case"ascii":case"latin1":case"binary":return p(this,xe,ce,Re);case"base64":return u(this,xe,ce,Re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,xe,ce,Re);default:if(Je)throw new TypeError("Unknown encoding: "+$e);$e=(""+$e).toLowerCase(),Je=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function m(Me,xe,ce){return xe===0&&ce===Me.length?G.fromByteArray(Me):G.fromByteArray(Me.slice(xe,ce))}function R(Me,xe,ce){ce=Math.min(Me.length,ce);const Re=[];let $e=xe;for(;$e239?4:rt>223?3:rt>191?2:1;if($e+At<=ce){let St,Rt,Ut,ir;switch(At){case 1:rt<128&&(Je=rt);break;case 2:St=Me[$e+1],(St&192)===128&&(ir=(rt&31)<<6|St&63,ir>127&&(Je=ir));break;case 3:St=Me[$e+1],Rt=Me[$e+2],(St&192)===128&&(Rt&192)===128&&(ir=(rt&15)<<12|(St&63)<<6|Rt&63,ir>2047&&(ir<55296||ir>57343)&&(Je=ir));break;case 4:St=Me[$e+1],Rt=Me[$e+2],Ut=Me[$e+3],(St&192)===128&&(Rt&192)===128&&(Ut&192)===128&&(ir=(rt&15)<<18|(St&63)<<12|(Rt&63)<<6|Ut&63,ir>65535&&ir<1114112&&(Je=ir))}}Je===null?(Je=65533,At=1):Je>65535&&(Je-=65536,Re.push(Je>>>10&1023|55296),Je=56320|Je&1023),Re.push(Je),$e+=At}return z(Re)}var P=4096;function z(Me){const xe=Me.length;if(xe<=P)return String.fromCharCode.apply(String,Me);let ce="",Re=0;for(;ReRe)&&(ce=Re);let $e="";for(let rt=xe;rtRe&&(xe=Re),ce<0?(ce+=Re,ce<0&&(ce=0)):ce>Re&&(ce=Re),cece)throw new RangeError("Trying to access beyond buffer length")}t.prototype.readUintLE=t.prototype.readUIntLE=function(xe,ce,Re){xe=xe>>>0,ce=ce>>>0,Re||N(xe,ce,this.length);let $e=this[xe],rt=1,Je=0;for(;++Je>>0,ce=ce>>>0,Re||N(xe,ce,this.length);let $e=this[xe+--ce],rt=1;for(;ce>0&&(rt*=256);)$e+=this[xe+--ce]*rt;return $e},t.prototype.readUint8=t.prototype.readUInt8=function(xe,ce){return xe=xe>>>0,ce||N(xe,1,this.length),this[xe]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(xe,ce){return xe=xe>>>0,ce||N(xe,2,this.length),this[xe]|this[xe+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(xe,ce){return xe=xe>>>0,ce||N(xe,2,this.length),this[xe]<<8|this[xe+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(xe,ce){return xe=xe>>>0,ce||N(xe,4,this.length),(this[xe]|this[xe+1]<<8|this[xe+2]<<16)+this[xe+3]*16777216},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(xe,ce){return xe=xe>>>0,ce||N(xe,4,this.length),this[xe]*16777216+(this[xe+1]<<16|this[xe+2]<<8|this[xe+3])},t.prototype.readBigUInt64LE=Ke(function(xe){xe=xe>>>0,ee(xe,"offset");const ce=this[xe],Re=this[xe+7];(ce===void 0||Re===void 0)&&q(xe,this.length-8);const $e=ce+this[++xe]*2**8+this[++xe]*2**16+this[++xe]*2**24,rt=this[++xe]+this[++xe]*2**8+this[++xe]*2**16+Re*2**24;return BigInt($e)+(BigInt(rt)<>>0,ee(xe,"offset");const ce=this[xe],Re=this[xe+7];(ce===void 0||Re===void 0)&&q(xe,this.length-8);const $e=ce*2**24+this[++xe]*2**16+this[++xe]*2**8+this[++xe],rt=this[++xe]*2**24+this[++xe]*2**16+this[++xe]*2**8+Re;return(BigInt($e)<>>0,ce=ce>>>0,Re||N(xe,ce,this.length);let $e=this[xe],rt=1,Je=0;for(;++Je=rt&&($e-=Math.pow(2,8*ce)),$e},t.prototype.readIntBE=function(xe,ce,Re){xe=xe>>>0,ce=ce>>>0,Re||N(xe,ce,this.length);let $e=ce,rt=1,Je=this[xe+--$e];for(;$e>0&&(rt*=256);)Je+=this[xe+--$e]*rt;return rt*=128,Je>=rt&&(Je-=Math.pow(2,8*ce)),Je},t.prototype.readInt8=function(xe,ce){return xe=xe>>>0,ce||N(xe,1,this.length),this[xe]&128?(255-this[xe]+1)*-1:this[xe]},t.prototype.readInt16LE=function(xe,ce){xe=xe>>>0,ce||N(xe,2,this.length);const Re=this[xe]|this[xe+1]<<8;return Re&32768?Re|4294901760:Re},t.prototype.readInt16BE=function(xe,ce){xe=xe>>>0,ce||N(xe,2,this.length);const Re=this[xe+1]|this[xe]<<8;return Re&32768?Re|4294901760:Re},t.prototype.readInt32LE=function(xe,ce){return xe=xe>>>0,ce||N(xe,4,this.length),this[xe]|this[xe+1]<<8|this[xe+2]<<16|this[xe+3]<<24},t.prototype.readInt32BE=function(xe,ce){return xe=xe>>>0,ce||N(xe,4,this.length),this[xe]<<24|this[xe+1]<<16|this[xe+2]<<8|this[xe+3]},t.prototype.readBigInt64LE=Ke(function(xe){xe=xe>>>0,ee(xe,"offset");const ce=this[xe],Re=this[xe+7];(ce===void 0||Re===void 0)&&q(xe,this.length-8);const $e=this[xe+4]+this[xe+5]*2**8+this[xe+6]*2**16+(Re<<24);return(BigInt($e)<>>0,ee(xe,"offset");const ce=this[xe],Re=this[xe+7];(ce===void 0||Re===void 0)&&q(xe,this.length-8);const $e=(ce<<24)+this[++xe]*2**16+this[++xe]*2**8+this[++xe];return(BigInt($e)<>>0,ce||N(xe,4,this.length),d.read(this,xe,!0,23,4)},t.prototype.readFloatBE=function(xe,ce){return xe=xe>>>0,ce||N(xe,4,this.length),d.read(this,xe,!1,23,4)},t.prototype.readDoubleLE=function(xe,ce){return xe=xe>>>0,ce||N(xe,8,this.length),d.read(this,xe,!0,52,8)},t.prototype.readDoubleBE=function(xe,ce){return xe=xe>>>0,ce||N(xe,8,this.length),d.read(this,xe,!1,52,8)};function U(Me,xe,ce,Re,$e,rt){if(!t.isBuffer(Me))throw new TypeError('"buffer" argument must be a Buffer instance');if(xe>$e||xeMe.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(xe,ce,Re,$e){if(xe=+xe,ce=ce>>>0,Re=Re>>>0,!$e){const At=Math.pow(2,8*Re)-1;U(this,xe,ce,Re,At,0)}let rt=1,Je=0;for(this[ce]=xe&255;++Je>>0,Re=Re>>>0,!$e){const At=Math.pow(2,8*Re)-1;U(this,xe,ce,Re,At,0)}let rt=Re-1,Je=1;for(this[ce+rt]=xe&255;--rt>=0&&(Je*=256);)this[ce+rt]=xe/Je&255;return ce+Re},t.prototype.writeUint8=t.prototype.writeUInt8=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,1,255,0),this[ce]=xe&255,ce+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,2,65535,0),this[ce]=xe&255,this[ce+1]=xe>>>8,ce+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,2,65535,0),this[ce]=xe>>>8,this[ce+1]=xe&255,ce+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,4,4294967295,0),this[ce+3]=xe>>>24,this[ce+2]=xe>>>16,this[ce+1]=xe>>>8,this[ce]=xe&255,ce+4},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,4,4294967295,0),this[ce]=xe>>>24,this[ce+1]=xe>>>16,this[ce+2]=xe>>>8,this[ce+3]=xe&255,ce+4};function Z(Me,xe,ce,Re,$e){re(xe,Re,$e,Me,ce,7);let rt=Number(xe&BigInt(4294967295));Me[ce++]=rt,rt=rt>>8,Me[ce++]=rt,rt=rt>>8,Me[ce++]=rt,rt=rt>>8,Me[ce++]=rt;let Je=Number(xe>>BigInt(32)&BigInt(4294967295));return Me[ce++]=Je,Je=Je>>8,Me[ce++]=Je,Je=Je>>8,Me[ce++]=Je,Je=Je>>8,Me[ce++]=Je,ce}function Q(Me,xe,ce,Re,$e){re(xe,Re,$e,Me,ce,7);let rt=Number(xe&BigInt(4294967295));Me[ce+7]=rt,rt=rt>>8,Me[ce+6]=rt,rt=rt>>8,Me[ce+5]=rt,rt=rt>>8,Me[ce+4]=rt;let Je=Number(xe>>BigInt(32)&BigInt(4294967295));return Me[ce+3]=Je,Je=Je>>8,Me[ce+2]=Je,Je=Je>>8,Me[ce+1]=Je,Je=Je>>8,Me[ce]=Je,ce+8}t.prototype.writeBigUInt64LE=Ke(function(xe,ce=0){return Z(this,xe,ce,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeBigUInt64BE=Ke(function(xe,ce=0){return Q(this,xe,ce,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeIntLE=function(xe,ce,Re,$e){if(xe=+xe,ce=ce>>>0,!$e){const St=Math.pow(2,8*Re-1);U(this,xe,ce,Re,St-1,-St)}let rt=0,Je=1,At=0;for(this[ce]=xe&255;++rt>0)-At&255;return ce+Re},t.prototype.writeIntBE=function(xe,ce,Re,$e){if(xe=+xe,ce=ce>>>0,!$e){const St=Math.pow(2,8*Re-1);U(this,xe,ce,Re,St-1,-St)}let rt=Re-1,Je=1,At=0;for(this[ce+rt]=xe&255;--rt>=0&&(Je*=256);)xe<0&&At===0&&this[ce+rt+1]!==0&&(At=1),this[ce+rt]=(xe/Je>>0)-At&255;return ce+Re},t.prototype.writeInt8=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,1,127,-128),xe<0&&(xe=255+xe+1),this[ce]=xe&255,ce+1},t.prototype.writeInt16LE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,2,32767,-32768),this[ce]=xe&255,this[ce+1]=xe>>>8,ce+2},t.prototype.writeInt16BE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,2,32767,-32768),this[ce]=xe>>>8,this[ce+1]=xe&255,ce+2},t.prototype.writeInt32LE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,4,2147483647,-2147483648),this[ce]=xe&255,this[ce+1]=xe>>>8,this[ce+2]=xe>>>16,this[ce+3]=xe>>>24,ce+4},t.prototype.writeInt32BE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,4,2147483647,-2147483648),xe<0&&(xe=4294967295+xe+1),this[ce]=xe>>>24,this[ce+1]=xe>>>16,this[ce+2]=xe>>>8,this[ce+3]=xe&255,ce+4},t.prototype.writeBigInt64LE=Ke(function(xe,ce=0){return Z(this,xe,ce,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),t.prototype.writeBigInt64BE=Ke(function(xe,ce=0){return Q(this,xe,ce,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ue(Me,xe,ce,Re,$e,rt){if(ce+Re>Me.length)throw new RangeError("Index out of range");if(ce<0)throw new RangeError("Index out of range")}function oe(Me,xe,ce,Re,$e){return xe=+xe,ce=ce>>>0,$e||ue(Me,xe,ce,4),d.write(Me,xe,ce,Re,23,4),ce+4}t.prototype.writeFloatLE=function(xe,ce,Re){return oe(this,xe,ce,!0,Re)},t.prototype.writeFloatBE=function(xe,ce,Re){return oe(this,xe,ce,!1,Re)};function le(Me,xe,ce,Re,$e){return xe=+xe,ce=ce>>>0,$e||ue(Me,xe,ce,8),d.write(Me,xe,ce,Re,52,8),ce+8}t.prototype.writeDoubleLE=function(xe,ce,Re){return le(this,xe,ce,!0,Re)},t.prototype.writeDoubleBE=function(xe,ce,Re){return le(this,xe,ce,!1,Re)},t.prototype.copy=function(xe,ce,Re,$e){if(!t.isBuffer(xe))throw new TypeError("argument should be a Buffer");if(Re||(Re=0),!$e&&$e!==0&&($e=this.length),ce>=xe.length&&(ce=xe.length),ce||(ce=0),$e>0&&$e=this.length)throw new RangeError("Index out of range");if($e<0)throw new RangeError("sourceEnd out of bounds");$e>this.length&&($e=this.length),xe.length-ce<$e-Re&&($e=xe.length-ce+Re);const rt=$e-Re;return this===xe&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(ce,Re,$e):Uint8Array.prototype.set.call(xe,this.subarray(Re,$e),ce),rt},t.prototype.fill=function(xe,ce,Re,$e){if(typeof xe=="string"){if(typeof ce=="string"?($e=ce,ce=0,Re=this.length):typeof Re=="string"&&($e=Re,Re=this.length),$e!==void 0&&typeof $e!="string")throw new TypeError("encoding must be a string");if(typeof $e=="string"&&!t.isEncoding($e))throw new TypeError("Unknown encoding: "+$e);if(xe.length===1){const Je=xe.charCodeAt(0);($e==="utf8"&&Je<128||$e==="latin1")&&(xe=Je)}}else typeof xe=="number"?xe=xe&255:typeof xe=="boolean"&&(xe=Number(xe));if(ce<0||this.length>>0,Re=Re===void 0?this.length:Re>>>0,xe||(xe=0);let rt;if(typeof xe=="number")for(rt=ce;rt2**32?$e=$(String(ce)):typeof ce=="bigint"&&($e=String(ce),(ce>BigInt(2)**BigInt(32)||ce<-(BigInt(2)**BigInt(32)))&&($e=$($e)),$e+="n"),Re+=` It must be ${xe}. Received ${$e}`,Re},RangeError);function $(Me){let xe="",ce=Me.length;const Re=Me[0]==="-"?1:0;for(;ce>=Re+4;ce-=3)xe=`_${Me.slice(ce-3,ce)}${xe}`;return`${Me.slice(0,ce)}${xe}`}function X(Me,xe,ce){ee(xe,"offset"),(Me[xe]===void 0||Me[xe+ce]===void 0)&&q(xe,Me.length-(ce+1))}function re(Me,xe,ce,Re,$e,rt){if(Me>ce||Me= 0${Je} and < 2${Je} ** ${(rt+1)*8}${Je}`:At=`>= -(2${Je} ** ${(rt+1)*8-1}${Je}) and < 2 ** ${(rt+1)*8-1}${Je}`,new j.ERR_OUT_OF_RANGE("value",At,Me)}X(Re,$e,rt)}function ee(Me,xe){if(typeof Me!="number")throw new j.ERR_INVALID_ARG_TYPE(xe,"number",Me)}function q(Me,xe,ce){throw Math.floor(Me)!==Me?(ee(Me,ce),new j.ERR_OUT_OF_RANGE("offset","an integer",Me)):xe<0?new j.ERR_BUFFER_OUT_OF_BOUNDS:new j.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${xe}`,Me)}var ae=/[^+/0-9A-Za-z-_]/g;function ie(Me){if(Me=Me.split("=")[0],Me=Me.trim().replace(ae,""),Me.length<2)return"";for(;Me.length%4!==0;)Me=Me+"=";return Me}function fe(Me,xe){xe=xe||1/0;let ce;const Re=Me.length;let $e=null;const rt=[];for(let Je=0;Je55295&&ce<57344){if(!$e){if(ce>56319){(xe-=3)>-1&&rt.push(239,191,189);continue}else if(Je+1===Re){(xe-=3)>-1&&rt.push(239,191,189);continue}$e=ce;continue}if(ce<56320){(xe-=3)>-1&&rt.push(239,191,189),$e=ce;continue}ce=($e-55296<<10|ce-56320)+65536}else $e&&(xe-=3)>-1&&rt.push(239,191,189);if($e=null,ce<128){if((xe-=1)<0)break;rt.push(ce)}else if(ce<2048){if((xe-=2)<0)break;rt.push(ce>>6|192,ce&63|128)}else if(ce<65536){if((xe-=3)<0)break;rt.push(ce>>12|224,ce>>6&63|128,ce&63|128)}else if(ce<1114112){if((xe-=4)<0)break;rt.push(ce>>18|240,ce>>12&63|128,ce>>6&63|128,ce&63|128)}else throw new Error("Invalid code point")}return rt}function we(Me){const xe=[];for(let ce=0;ce>8,$e=ce%256,rt.push($e),rt.push(Re);return rt}function Fe(Me){return G.toByteArray(ie(Me))}function Ce(Me,xe,ce,Re){let $e;for($e=0;$e=xe.length||$e>=Me.length);++$e)xe[$e+ce]=Me[$e];return $e}function qe(Me,xe){return Me instanceof xe||Me!=null&&Me.constructor!=null&&Me.constructor.name!=null&&Me.constructor.name===xe.name}function et(Me){return Me!==Me}var Qe=function(){const Me="0123456789abcdef",xe=new Array(256);for(let ce=0;ce<16;++ce){const Re=ce*16;for(let $e=0;$e<16;++$e)xe[Re+$e]=Me[ce]+Me[$e]}return xe}();function Ke(Me){return typeof BigInt>"u"?Xe:Me}function Xe(){throw new Error("BigInt not supported")}}}),K1=He({"node_modules/has-symbols/shams.js"(Y,G){G.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var x={},A=Symbol("test"),E=Object(A);if(typeof A=="string"||Object.prototype.toString.call(A)!=="[object Symbol]"||Object.prototype.toString.call(E)!=="[object Symbol]")return!1;var e=42;x[A]=e;for(A in x)return!1;if(typeof Object.keys=="function"&&Object.keys(x).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(x).length!==0)return!1;var t=Object.getOwnPropertySymbols(x);if(t.length!==1||t[0]!==A||!Object.prototype.propertyIsEnumerable.call(x,A))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var r=Object.getOwnPropertyDescriptor(x,A);if(r.value!==e||r.enumerable!==!0)return!1}return!0}}}),dy=He({"node_modules/has-tostringtag/shams.js"(Y,G){var d=K1();G.exports=function(){return d()&&!!Symbol.toStringTag}}}),ak=He({"node_modules/es-errors/index.js"(Y,G){G.exports=Error}}),nk=He({"node_modules/es-errors/eval.js"(Y,G){G.exports=EvalError}}),ik=He({"node_modules/es-errors/range.js"(Y,G){G.exports=RangeError}}),ok=He({"node_modules/es-errors/ref.js"(Y,G){G.exports=ReferenceError}}),Yw=He({"node_modules/es-errors/syntax.js"(Y,G){G.exports=SyntaxError}}),py=He({"node_modules/es-errors/type.js"(Y,G){G.exports=TypeError}}),sk=He({"node_modules/es-errors/uri.js"(Y,G){G.exports=URIError}}),lk=He({"node_modules/has-symbols/index.js"(Y,G){var d=typeof Symbol<"u"&&Symbol,x=K1();G.exports=function(){return typeof d!="function"||typeof Symbol!="function"||typeof d("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:x()}}}),uk=He({"node_modules/has-proto/index.js"(Y,G){var d={foo:{}},x=Object;G.exports=function(){return{__proto__:d}.foo===d.foo&&!({__proto__:null}instanceof x)}}}),ck=He({"node_modules/function-bind/implementation.js"(Y,G){var d="Function.prototype.bind called on incompatible ",x=Object.prototype.toString,A=Math.max,E="[object Function]",e=function(a,i){for(var n=[],s=0;s"u"||!h?d:h(Uint8Array),y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?d:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?d:ArrayBuffer,"%ArrayIteratorPrototype%":f&&h?h([][Symbol.iterator]()):d,"%AsyncFromSyncIteratorPrototype%":d,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%Atomics%":typeof Atomics>"u"?d:Atomics,"%BigInt%":typeof BigInt>"u"?d:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?d:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?d:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?d:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":x,"%eval%":eval,"%EvalError%":A,"%Float32Array%":typeof Float32Array>"u"?d:Float32Array,"%Float64Array%":typeof Float64Array>"u"?d:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?d:FinalizationRegistry,"%Function%":a,"%GeneratorFunction%":T,"%Int8Array%":typeof Int8Array>"u"?d:Int8Array,"%Int16Array%":typeof Int16Array>"u"?d:Int16Array,"%Int32Array%":typeof Int32Array>"u"?d:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f&&h?h(h([][Symbol.iterator]())):d,"%JSON%":typeof JSON=="object"?JSON:d,"%Map%":typeof Map>"u"?d:Map,"%MapIteratorPrototype%":typeof Map>"u"||!f||!h?d:h(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?d:Promise,"%Proxy%":typeof Proxy>"u"?d:Proxy,"%RangeError%":E,"%ReferenceError%":e,"%Reflect%":typeof Reflect>"u"?d:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?d:Set,"%SetIteratorPrototype%":typeof Set>"u"||!f||!h?d:h(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?d:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f&&h?h(""[Symbol.iterator]()):d,"%Symbol%":f?Symbol:d,"%SyntaxError%":t,"%ThrowTypeError%":c,"%TypedArray%":l,"%TypeError%":r,"%Uint8Array%":typeof Uint8Array>"u"?d:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?d:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?d:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?d:Uint32Array,"%URIError%":o,"%WeakMap%":typeof WeakMap>"u"?d:WeakMap,"%WeakRef%":typeof WeakRef>"u"?d:WeakRef,"%WeakSet%":typeof WeakSet>"u"?d:WeakSet};if(h)try{null.error}catch(O){b=h(h(O)),y["%Error.prototype%"]=b}var b,S=function O(L){var N;if(L==="%AsyncFunction%")N=i("async function () {}");else if(L==="%GeneratorFunction%")N=i("function* () {}");else if(L==="%AsyncGeneratorFunction%")N=i("async function* () {}");else if(L==="%AsyncGenerator%"){var U=O("%AsyncGeneratorFunction%");U&&(N=U.prototype)}else if(L==="%AsyncIteratorPrototype%"){var Z=O("%AsyncGenerator%");Z&&h&&(N=h(Z.prototype))}return y[L]=N,N},M={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=J1(),w=fk(),p=_.call(Function.call,Array.prototype.concat),u=_.call(Function.apply,Array.prototype.splice),g=_.call(Function.call,String.prototype.replace),m=_.call(Function.call,String.prototype.slice),R=_.call(Function.call,RegExp.prototype.exec),P=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,z=/\\(\\)?/g,F=function(L){var N=m(L,0,1),U=m(L,-1);if(N==="%"&&U!=="%")throw new t("invalid intrinsic syntax, expected closing `%`");if(U==="%"&&N!=="%")throw new t("invalid intrinsic syntax, expected opening `%`");var Z=[];return g(L,P,function(Q,ue,oe,le){Z[Z.length]=oe?g(le,z,"$1"):ue||Q}),Z},B=function(L,N){var U=L,Z;if(w(M,U)&&(Z=M[U],U="%"+Z[0]+"%"),w(y,U)){var Q=y[U];if(Q===T&&(Q=S(U)),typeof Q>"u"&&!N)throw new r("intrinsic "+L+" exists, but is not available. Please file an issue!");return{alias:Z,name:U,value:Q}}throw new t("intrinsic "+L+" does not exist!")};G.exports=function(L,N){if(typeof L!="string"||L.length===0)throw new r("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof N!="boolean")throw new r('"allowMissing" argument must be a boolean');if(R(/^%?[^%]*%?$/,L)===null)throw new t("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var U=F(L),Z=U.length>0?U[0]:"",Q=B("%"+Z+"%",N),ue=Q.name,oe=Q.value,le=!1,j=Q.alias;j&&(Z=j[0],u(U,p([0,1],j)));for(var J=1,$=!0;J=U.length){var q=n(oe,X);$=!!q,$&&"get"in q&&!("originalValue"in q.get)?oe=q.get:oe=oe[X]}else $=w(oe,X),oe=oe[X];$&&!le&&(y[ue]=oe)}}return oe}}}),$1=He({"node_modules/es-define-property/index.js"(Y,G){var d=$0(),x=d("%Object.defineProperty%",!0)||!1;if(x)try{x({},"a",{value:1})}catch{x=!1}G.exports=x}}),gy=He({"node_modules/gopd/index.js"(Y,G){var d=$0(),x=d("%Object.getOwnPropertyDescriptor%",!0);if(x)try{x([],"length")}catch{x=null}G.exports=x}}),hk=He({"node_modules/define-data-property/index.js"(Y,G){var d=$1(),x=Yw(),A=py(),E=gy();G.exports=function(t,r,o){if(!t||typeof t!="object"&&typeof t!="function")throw new A("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new A("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new A("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new A("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new A("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new A("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,n=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,c=!!E&&E(t,r);if(d)d(t,r,{configurable:n===null&&c?c.configurable:!n,enumerable:a===null&&c?c.enumerable:!a,value:o,writable:i===null&&c?c.writable:!i});else if(s||!a&&!i&&!n)t[r]=o;else throw new x("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}}),Kw=He({"node_modules/has-property-descriptors/index.js"(Y,G){var d=$1(),x=function(){return!!d};x.hasArrayLengthDefineBug=function(){if(!d)return null;try{return d([],"length",{value:1}).length!==1}catch{return!0}},G.exports=x}}),vk=He({"node_modules/set-function-length/index.js"(Y,G){var d=$0(),x=hk(),A=Kw()(),E=gy(),e=py(),t=d("%Math.floor%");G.exports=function(o,a){if(typeof o!="function")throw new e("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||t(a)!==a)throw new e("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in o&&E){var c=E(o,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(s=!1)}return(n||s||!i)&&(A?x(o,"length",a,!0,!0):x(o,"length",a)),o}}}),yy=He({"node_modules/call-bind/index.js"(Y,G){var d=J1(),x=$0(),A=vk(),E=py(),e=x("%Function.prototype.apply%"),t=x("%Function.prototype.call%"),r=x("%Reflect.apply%",!0)||d.call(t,e),o=$1(),a=x("%Math.max%");G.exports=function(s){if(typeof s!="function")throw new E("a function is required");var c=r(d,t,arguments);return A(c,1+a(0,s.length-(arguments.length-1)),!0)};var i=function(){return r(d,e,arguments)};o?o(G.exports,"apply",{value:i}):G.exports.apply=i}}),Q0=He({"node_modules/call-bind/callBound.js"(Y,G){var d=$0(),x=yy(),A=x(d("String.prototype.indexOf"));G.exports=function(e,t){var r=d(e,!!t);return typeof r=="function"&&A(e,".prototype.")>-1?x(r):r}}}),dk=He({"node_modules/is-arguments/index.js"(Y,G){var d=dy()(),x=Q0(),A=x("Object.prototype.toString"),E=function(o){return d&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:A(o)==="[object Arguments]"},e=function(o){return E(o)?!0:o!==null&&typeof o=="object"&&typeof o.length=="number"&&o.length>=0&&A(o)!=="[object Array]"&&A(o.callee)==="[object Function]"},t=function(){return E(arguments)}();E.isLegacyArguments=e,G.exports=t?E:e}}),pk=He({"node_modules/is-generator-function/index.js"(Y,G){var d=Object.prototype.toString,x=Function.prototype.toString,A=/^\s*(?:function)?\*/,E=dy()(),e=Object.getPrototypeOf,t=function(){if(!E)return!1;try{return Function("return function*() {}")()}catch{}},r;G.exports=function(a){if(typeof a!="function")return!1;if(A.test(x.call(a)))return!0;if(!E){var i=d.call(a);return i==="[object GeneratorFunction]"}if(!e)return!1;if(typeof r>"u"){var n=t();r=n?e(n):!1}return e(a)===r}}}),gk=He({"node_modules/is-callable/index.js"(Y,G){var d=Function.prototype.toString,x=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,A,E;if(typeof x=="function"&&typeof Object.defineProperty=="function")try{A=Object.defineProperty({},"length",{get:function(){throw E}}),E={},x(function(){throw 42},null,A)}catch(y){y!==E&&(x=null)}else x=null;var e=/^\s*class\b/,t=function(b){try{var S=d.call(b);return e.test(S)}catch{return!1}},r=function(b){try{return t(b)?!1:(d.call(b),!0)}catch{return!1}},o=Object.prototype.toString,a="[object Object]",i="[object Function]",n="[object GeneratorFunction]",s="[object HTMLAllCollection]",c="[object HTML document.all class]",f="[object HTMLCollection]",v=typeof Symbol=="function"&&!!Symbol.toStringTag,h=!(0 in[,]),T=function(){return!1};typeof document=="object"&&(l=document.all,o.call(l)===o.call(document.all)&&(T=function(b){if((h||!b)&&(typeof b>"u"||typeof b=="object"))try{var S=o.call(b);return(S===s||S===c||S===f||S===a)&&b("")==null}catch{}return!1}));var l;G.exports=x?function(b){if(T(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;try{x(b,null,A)}catch(S){if(S!==E)return!1}return!t(b)&&r(b)}:function(b){if(T(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;if(v)return r(b);if(t(b))return!1;var S=o.call(b);return S!==i&&S!==n&&!/^\[object HTML/.test(S)?!1:r(b)}}}),Jw=He({"node_modules/for-each/index.js"(Y,G){var d=gk(),x=Object.prototype.toString,A=Object.prototype.hasOwnProperty,E=function(a,i,n){for(var s=0,c=a.length;s=3&&(s=n),x.call(a)==="[object Array]"?E(a,i,s):typeof a=="string"?e(a,i,s):t(a,i,s)};G.exports=r}}),$w=He({"node_modules/available-typed-arrays/index.js"(Y,G){var d=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],x=typeof globalThis>"u"?window:globalThis;G.exports=function(){for(var E=[],e=0;e"u"?window:globalThis,a=x(),i=E("String.prototype.slice"),n=Object.getPrototypeOf,s=E("Array.prototype.indexOf",!0)||function(T,l){for(var y=0;y-1?l:l!=="Object"?!1:v(T)}return e?f(T):null}}}),mk=He({"node_modules/is-typed-array/index.js"(Y,G){var d=Jw(),x=$w(),A=Q0(),E=A("Object.prototype.toString"),e=dy()(),t=gy(),r=typeof globalThis>"u"?window:globalThis,o=x(),a=A("Array.prototype.indexOf",!0)||function(v,h){for(var T=0;T-1}return t?c(v):!1}}}),Qw=He({"node_modules/util/support/types.js"(Y){var G=dk(),d=pk(),x=yk(),A=mk();function E(Ae){return Ae.call.bind(Ae)}var e=typeof BigInt<"u",t=typeof Symbol<"u",r=E(Object.prototype.toString),o=E(Number.prototype.valueOf),a=E(String.prototype.valueOf),i=E(Boolean.prototype.valueOf);e&&(n=E(BigInt.prototype.valueOf));var n;t&&(s=E(Symbol.prototype.valueOf));var s;function c(Ae,Fe){if(typeof Ae!="object")return!1;try{return Fe(Ae),!0}catch{return!1}}Y.isArgumentsObject=G,Y.isGeneratorFunction=d,Y.isTypedArray=A;function f(Ae){return typeof Promise<"u"&&Ae instanceof Promise||Ae!==null&&typeof Ae=="object"&&typeof Ae.then=="function"&&typeof Ae.catch=="function"}Y.isPromise=f;function v(Ae){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Ae):A(Ae)||Z(Ae)}Y.isArrayBufferView=v;function h(Ae){return x(Ae)==="Uint8Array"}Y.isUint8Array=h;function T(Ae){return x(Ae)==="Uint8ClampedArray"}Y.isUint8ClampedArray=T;function l(Ae){return x(Ae)==="Uint16Array"}Y.isUint16Array=l;function y(Ae){return x(Ae)==="Uint32Array"}Y.isUint32Array=y;function b(Ae){return x(Ae)==="Int8Array"}Y.isInt8Array=b;function S(Ae){return x(Ae)==="Int16Array"}Y.isInt16Array=S;function M(Ae){return x(Ae)==="Int32Array"}Y.isInt32Array=M;function _(Ae){return x(Ae)==="Float32Array"}Y.isFloat32Array=_;function w(Ae){return x(Ae)==="Float64Array"}Y.isFloat64Array=w;function p(Ae){return x(Ae)==="BigInt64Array"}Y.isBigInt64Array=p;function u(Ae){return x(Ae)==="BigUint64Array"}Y.isBigUint64Array=u;function g(Ae){return r(Ae)==="[object Map]"}g.working=typeof Map<"u"&&g(new Map);function m(Ae){return typeof Map>"u"?!1:g.working?g(Ae):Ae instanceof Map}Y.isMap=m;function R(Ae){return r(Ae)==="[object Set]"}R.working=typeof Set<"u"&&R(new Set);function P(Ae){return typeof Set>"u"?!1:R.working?R(Ae):Ae instanceof Set}Y.isSet=P;function z(Ae){return r(Ae)==="[object WeakMap]"}z.working=typeof WeakMap<"u"&&z(new WeakMap);function F(Ae){return typeof WeakMap>"u"?!1:z.working?z(Ae):Ae instanceof WeakMap}Y.isWeakMap=F;function B(Ae){return r(Ae)==="[object WeakSet]"}B.working=typeof WeakSet<"u"&&B(new WeakSet);function O(Ae){return B(Ae)}Y.isWeakSet=O;function L(Ae){return r(Ae)==="[object ArrayBuffer]"}L.working=typeof ArrayBuffer<"u"&&L(new ArrayBuffer);function N(Ae){return typeof ArrayBuffer>"u"?!1:L.working?L(Ae):Ae instanceof ArrayBuffer}Y.isArrayBuffer=N;function U(Ae){return r(Ae)==="[object DataView]"}U.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&U(new DataView(new ArrayBuffer(1),0,1));function Z(Ae){return typeof DataView>"u"?!1:U.working?U(Ae):Ae instanceof DataView}Y.isDataView=Z;var Q=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ue(Ae){return r(Ae)==="[object SharedArrayBuffer]"}function oe(Ae){return typeof Q>"u"?!1:(typeof ue.working>"u"&&(ue.working=ue(new Q)),ue.working?ue(Ae):Ae instanceof Q)}Y.isSharedArrayBuffer=oe;function le(Ae){return r(Ae)==="[object AsyncFunction]"}Y.isAsyncFunction=le;function j(Ae){return r(Ae)==="[object Map Iterator]"}Y.isMapIterator=j;function J(Ae){return r(Ae)==="[object Set Iterator]"}Y.isSetIterator=J;function $(Ae){return r(Ae)==="[object Generator]"}Y.isGeneratorObject=$;function X(Ae){return r(Ae)==="[object WebAssembly.Module]"}Y.isWebAssemblyCompiledModule=X;function re(Ae){return c(Ae,o)}Y.isNumberObject=re;function ee(Ae){return c(Ae,a)}Y.isStringObject=ee;function q(Ae){return c(Ae,i)}Y.isBooleanObject=q;function ae(Ae){return e&&c(Ae,n)}Y.isBigIntObject=ae;function ie(Ae){return t&&c(Ae,s)}Y.isSymbolObject=ie;function fe(Ae){return re(Ae)||ee(Ae)||q(Ae)||ae(Ae)||ie(Ae)}Y.isBoxedPrimitive=fe;function we(Ae){return typeof Uint8Array<"u"&&(N(Ae)||oe(Ae))}Y.isAnyArrayBuffer=we,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Ae){Object.defineProperty(Y,Ae,{enumerable:!1,value:function(){throw new Error(Ae+" is not supported in userland")}})})}}),e2=He({"node_modules/util/support/isBufferBrowser.js"(Y,G){G.exports=function(x){return x&&typeof x=="object"&&typeof x.copy=="function"&&typeof x.fill=="function"&&typeof x.readUInt8=="function"}}}),t2=He({"(disabled):node_modules/util/util.js"(Y){var G=Object.getOwnPropertyDescriptors||function(Z){for(var Q=Object.keys(Z),ue={},oe=0;oe=oe)return J;switch(J){case"%s":return String(ue[Q++]);case"%d":return Number(ue[Q++]);case"%j":try{return JSON.stringify(ue[Q++])}catch{return"[Circular]"}default:return J}}),j=ue[Q];Q"u")return function(){return Y.deprecate(U,Z).apply(this,arguments)};var Q=!1;function ue(){if(!Q){if(process.throwDeprecation)throw new Error(Z);process.traceDeprecation?console.trace(Z):console.error(Z),Q=!0}return U.apply(this,arguments)}return ue};var x={},A=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),A=new RegExp("^"+E+"$","i");var E;Y.debuglog=function(U){if(U=U.toUpperCase(),!x[U])if(A.test(U)){var Z=process.pid;x[U]=function(){var Q=Y.format.apply(Y,arguments);console.error("%s %d: %s",U,Z,Q)}}else x[U]=function(){};return x[U]};function e(U,Z){var Q={seen:[],stylize:r};return arguments.length>=3&&(Q.depth=arguments[2]),arguments.length>=4&&(Q.colors=arguments[3]),h(Z)?Q.showHidden=Z:Z&&Y._extend(Q,Z),M(Q.showHidden)&&(Q.showHidden=!1),M(Q.depth)&&(Q.depth=2),M(Q.colors)&&(Q.colors=!1),M(Q.customInspect)&&(Q.customInspect=!0),Q.colors&&(Q.stylize=t),a(Q,U,Q.depth)}Y.inspect=e,e.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]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(U,Z){var Q=e.styles[Z];return Q?"\x1B["+e.colors[Q][0]+"m"+U+"\x1B["+e.colors[Q][1]+"m":U}function r(U,Z){return U}function o(U){var Z={};return U.forEach(function(Q,ue){Z[Q]=!0}),Z}function a(U,Z,Q){if(U.customInspect&&Z&&g(Z.inspect)&&Z.inspect!==Y.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var ue=Z.inspect(Q,U);return b(ue)||(ue=a(U,ue,Q)),ue}var oe=i(U,Z);if(oe)return oe;var le=Object.keys(Z),j=o(le);if(U.showHidden&&(le=Object.getOwnPropertyNames(Z)),u(Z)&&(le.indexOf("message")>=0||le.indexOf("description")>=0))return n(Z);if(le.length===0){if(g(Z)){var J=Z.name?": "+Z.name:"";return U.stylize("[Function"+J+"]","special")}if(_(Z))return U.stylize(RegExp.prototype.toString.call(Z),"regexp");if(p(Z))return U.stylize(Date.prototype.toString.call(Z),"date");if(u(Z))return n(Z)}var $="",X=!1,re=["{","}"];if(v(Z)&&(X=!0,re=["[","]"]),g(Z)){var ee=Z.name?": "+Z.name:"";$=" [Function"+ee+"]"}if(_(Z)&&($=" "+RegExp.prototype.toString.call(Z)),p(Z)&&($=" "+Date.prototype.toUTCString.call(Z)),u(Z)&&($=" "+n(Z)),le.length===0&&(!X||Z.length==0))return re[0]+$+re[1];if(Q<0)return _(Z)?U.stylize(RegExp.prototype.toString.call(Z),"regexp"):U.stylize("[Object]","special");U.seen.push(Z);var q;return X?q=s(U,Z,Q,j,le):q=le.map(function(ae){return c(U,Z,Q,j,ae,X)}),U.seen.pop(),f(q,$,re)}function i(U,Z){if(M(Z))return U.stylize("undefined","undefined");if(b(Z)){var Q="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize(Q,"string")}if(y(Z))return U.stylize(""+Z,"number");if(h(Z))return U.stylize(""+Z,"boolean");if(T(Z))return U.stylize("null","null")}function n(U){return"["+Error.prototype.toString.call(U)+"]"}function s(U,Z,Q,ue,oe){for(var le=[],j=0,J=Z.length;j-1&&(le?J=J.split(` +`).map(function(X){return" "+X}).join(` +`).slice(2):J=` +`+J.split(` +`).map(function(X){return" "+X}).join(` +`))):J=U.stylize("[Circular]","special")),M(j)){if(le&&oe.match(/^\d+$/))return J;j=JSON.stringify(""+oe),j.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(j=j.slice(1,-1),j=U.stylize(j,"name")):(j=j.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),j=U.stylize(j,"string"))}return j+": "+J}function f(U,Z,Q){var ue=U.reduce(function(oe,le){return le.indexOf(` +`)>=0,oe+le.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ue>60?Q[0]+(Z===""?"":Z+` + `)+" "+U.join(`, + `)+" "+Q[1]:Q[0]+Z+" "+U.join(", ")+" "+Q[1]}Y.types=Qw();function v(U){return Array.isArray(U)}Y.isArray=v;function h(U){return typeof U=="boolean"}Y.isBoolean=h;function T(U){return U===null}Y.isNull=T;function l(U){return U==null}Y.isNullOrUndefined=l;function y(U){return typeof U=="number"}Y.isNumber=y;function b(U){return typeof U=="string"}Y.isString=b;function S(U){return typeof U=="symbol"}Y.isSymbol=S;function M(U){return U===void 0}Y.isUndefined=M;function _(U){return w(U)&&R(U)==="[object RegExp]"}Y.isRegExp=_,Y.types.isRegExp=_;function w(U){return typeof U=="object"&&U!==null}Y.isObject=w;function p(U){return w(U)&&R(U)==="[object Date]"}Y.isDate=p,Y.types.isDate=p;function u(U){return w(U)&&(R(U)==="[object Error]"||U instanceof Error)}Y.isError=u,Y.types.isNativeError=u;function g(U){return typeof U=="function"}Y.isFunction=g;function m(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Y.isPrimitive=m,Y.isBuffer=e2();function R(U){return Object.prototype.toString.call(U)}function P(U){return U<10?"0"+U.toString(10):U.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var U=new Date,Z=[P(U.getHours()),P(U.getMinutes()),P(U.getSeconds())].join(":");return[U.getDate(),z[U.getMonth()],Z].join(" ")}Y.log=function(){console.log("%s - %s",F(),Y.format.apply(Y,arguments))},Y.inherits=od(),Y._extend=function(U,Z){if(!Z||!w(Z))return U;for(var Q=Object.keys(Z),ue=Q.length;ue--;)U[Q[ue]]=Z[Q[ue]];return U};function B(U,Z){return Object.prototype.hasOwnProperty.call(U,Z)}var O=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Y.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if(O&&Z[O]){var Q=Z[O];if(typeof Q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Q}function Q(){for(var ue,oe,le=new Promise(function($,X){ue=$,oe=X}),j=[],J=0;J0?this.tail.next=h:this.head=h,this.tail=h,++this.length}},{key:"unshift",value:function(v){var h={data:v,next:this.head};this.length===0&&(this.tail=h),this.head=h,++this.length}},{key:"shift",value:function(){if(this.length!==0){var v=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,v}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(v){if(this.length===0)return"";for(var h=this.head,T=""+h.data;h=h.next;)T+=v+h.data;return T}},{key:"concat",value:function(v){if(this.length===0)return o.alloc(0);for(var h=o.allocUnsafe(v>>>0),T=this.head,l=0;T;)s(T.data,h,l),l+=T.data.length,T=T.next;return h}},{key:"consume",value:function(v,h){var T;return vy.length?y.length:v;if(b===y.length?l+=y:l+=y.slice(0,v),v-=b,v===0){b===y.length?(++T,h.next?this.head=h.next:this.head=this.tail=null):(this.head=h,h.data=y.slice(b));break}++T}return this.length-=T,l}},{key:"_getBuffer",value:function(v){var h=o.allocUnsafe(v),T=this.head,l=1;for(T.data.copy(h),v-=T.data.length;T=T.next;){var y=T.data,b=v>y.length?y.length:v;if(y.copy(h,h.length-v,0,b),v-=b,v===0){b===y.length?(++l,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=y.slice(b));break}++l}return this.length-=l,h}},{key:n,value:function(v,h){return i(this,x({},h,{depth:0,customInspect:!1}))}}]),c}()}}),r2=He({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"(Y,G){function d(r,o){var a=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(o?o(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(e,this,r)):process.nextTick(e,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(s){!o&&s?a._writableState?a._writableState.errorEmitted?process.nextTick(A,a):(a._writableState.errorEmitted=!0,process.nextTick(x,a,s)):process.nextTick(x,a,s):o?(process.nextTick(A,a),o(s)):process.nextTick(A,a)}),this)}function x(r,o){e(r,o),A(r)}function A(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function E(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function e(r,o){r.emit("error",o)}function t(r,o){var a=r._readableState,i=r._writableState;a&&a.autoDestroy||i&&i.autoDestroy?r.destroy(o):r.emit("error",o)}G.exports={destroy:d,undestroy:E,errorOrDestroy:t}}}),Fp=He({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"(Y,G){function d(o,a){o.prototype=Object.create(a.prototype),o.prototype.constructor=o,o.__proto__=a}var x={};function A(o,a,i){i||(i=Error);function n(c,f,v){return typeof a=="string"?a:a(c,f,v)}var s=function(c){d(f,c);function f(v,h,T){return c.call(this,n(v,h,T))||this}return f}(i);s.prototype.name=i.name,s.prototype.code=o,x[o]=s}function E(o,a){if(Array.isArray(o)){var i=o.length;return o=o.map(function(n){return String(n)}),i>2?"one of ".concat(a," ").concat(o.slice(0,i-1).join(", "),", or ")+o[i-1]:i===2?"one of ".concat(a," ").concat(o[0]," or ").concat(o[1]):"of ".concat(a," ").concat(o[0])}else return"of ".concat(a," ").concat(String(o))}function e(o,a,i){return o.substr(0,a.length)===a}function t(o,a,i){return(i===void 0||i>o.length)&&(i=o.length),o.substring(i-a.length,i)===a}function r(o,a,i){return typeof i!="number"&&(i=0),i+a.length>o.length?!1:o.indexOf(a,i)!==-1}A("ERR_INVALID_OPT_VALUE",function(o,a){return'The value "'+a+'" is invalid for option "'+o+'"'},TypeError),A("ERR_INVALID_ARG_TYPE",function(o,a,i){var n;typeof a=="string"&&e(a,"not ")?(n="must not be",a=a.replace(/^not /,"")):n="must be";var s;if(t(o," argument"))s="The ".concat(o," ").concat(n," ").concat(E(a,"type"));else{var c=r(o,".")?"property":"argument";s='The "'.concat(o,'" ').concat(c," ").concat(n," ").concat(E(a,"type"))}return s+=". Received type ".concat(typeof i),s},TypeError),A("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),A("ERR_METHOD_NOT_IMPLEMENTED",function(o){return"The "+o+" method is not implemented"}),A("ERR_STREAM_PREMATURE_CLOSE","Premature close"),A("ERR_STREAM_DESTROYED",function(o){return"Cannot call "+o+" 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(o){return"Unknown encoding: "+o},TypeError),A("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),G.exports.codes=x}}),a2=He({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(Y,G){var d=Fp().codes.ERR_INVALID_OPT_VALUE;function x(E,e,t){return E.highWaterMark!=null?E.highWaterMark:e?E[t]:null}function A(E,e,t,r){var o=x(e,r,t);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var a=r?t:"highWaterMark";throw new d(a,o)}return Math.floor(o)}return E.objectMode?16:16*1024}G.exports={getHighWaterMark:A}}}),xk=He({"node_modules/util-deprecate/browser.js"(Y,G){G.exports=d;function d(A,E){if(x("noDeprecation"))return A;var e=!1;function t(){if(!e){if(x("throwDeprecation"))throw new Error(E);x("traceDeprecation")?console.trace(E):console.warn(E),e=!0}return A.apply(this,arguments)}return t}function x(A){try{if(!window.localStorage)return!1}catch{return!1}var E=window.localStorage[A];return E==null?!1:String(E).toLowerCase()==="true"}}}),n2=He({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(Y,G){G.exports=p;function d(j){var J=this;this.next=null,this.entry=null,this.finish=function(){le(J,j)}}var x;p.WritableState=_;var A={deprecate:xk()},E=Xw(),e=zp().Buffer,t=window.Uint8Array||function(){};function r(j){return e.from(j)}function o(j){return e.isBuffer(j)||j instanceof t}var a=r2(),i=a2(),n=i.getHighWaterMark,s=Fp().codes,c=s.ERR_INVALID_ARG_TYPE,f=s.ERR_METHOD_NOT_IMPLEMENTED,v=s.ERR_MULTIPLE_CALLBACK,h=s.ERR_STREAM_CANNOT_PIPE,T=s.ERR_STREAM_DESTROYED,l=s.ERR_STREAM_NULL_VALUES,y=s.ERR_STREAM_WRITE_AFTER_END,b=s.ERR_UNKNOWN_ENCODING,S=a.errorOrDestroy;od()(p,E);function M(){}function _(j,J,$){x=x||Op(),j=j||{},typeof $!="boolean"&&($=J instanceof x),this.objectMode=!!j.objectMode,$&&(this.objectMode=this.objectMode||!!j.writableObjectMode),this.highWaterMark=n(this,j,"writableHighWaterMark",$),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var X=j.decodeStrings===!1;this.decodeStrings=!X,this.defaultEncoding=j.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(re){B(J,re)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=j.emitClose!==!1,this.autoDestroy=!!j.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}_.prototype.getBuffer=function(){for(var J=this.bufferedRequest,$=[];J;)$.push(J),J=J.next;return $},function(){try{Object.defineProperty(_.prototype,"buffer",{get:A.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var w;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(w=Function.prototype[Symbol.hasInstance],Object.defineProperty(p,Symbol.hasInstance,{value:function(J){return w.call(this,J)?!0:this!==p?!1:J&&J._writableState instanceof _}})):w=function(J){return J instanceof this};function p(j){x=x||Op();var J=this instanceof x;if(!J&&!w.call(p,this))return new p(j);this._writableState=new _(j,this,J),this.writable=!0,j&&(typeof j.write=="function"&&(this._write=j.write),typeof j.writev=="function"&&(this._writev=j.writev),typeof j.destroy=="function"&&(this._destroy=j.destroy),typeof j.final=="function"&&(this._final=j.final)),E.call(this)}p.prototype.pipe=function(){S(this,new h)};function u(j,J){var $=new y;S(j,$),process.nextTick(J,$)}function g(j,J,$,X){var re;return $===null?re=new l:typeof $!="string"&&!J.objectMode&&(re=new c("chunk",["string","Buffer"],$)),re?(S(j,re),process.nextTick(X,re),!1):!0}p.prototype.write=function(j,J,$){var X=this._writableState,re=!1,ee=!X.objectMode&&o(j);return ee&&!e.isBuffer(j)&&(j=r(j)),typeof J=="function"&&($=J,J=null),ee?J="buffer":J||(J=X.defaultEncoding),typeof $!="function"&&($=M),X.ending?u(this,$):(ee||g(this,X,j,$))&&(X.pendingcb++,re=R(this,X,ee,j,J,$)),re},p.prototype.cork=function(){this._writableState.corked++},p.prototype.uncork=function(){var j=this._writableState;j.corked&&(j.corked--,!j.writing&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&N(this,j))},p.prototype.setDefaultEncoding=function(J){if(typeof J=="string"&&(J=J.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((J+"").toLowerCase())>-1))throw new b(J);return this._writableState.defaultEncoding=J,this},Object.defineProperty(p.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function m(j,J,$){return!j.objectMode&&j.decodeStrings!==!1&&typeof J=="string"&&(J=e.from(J,$)),J}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function R(j,J,$,X,re,ee){if(!$){var q=m(J,X,re);X!==q&&($=!0,re="buffer",X=q)}var ae=J.objectMode?1:X.length;J.length+=ae;var ie=J.length>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function t(T,l,y){var b=l.length-1;if(b=0?(S>0&&(T.lastNeed=S-1),S):--b=0?(S>0&&(T.lastNeed=S-2),S):--b=0?(S>0&&(S===2?S=0:T.lastNeed=S-3),S):0))}function r(T,l,y){if((l[0]&192)!==128)return T.lastNeed=0,"�";if(T.lastNeed>1&&l.length>1){if((l[1]&192)!==128)return T.lastNeed=1,"�";if(T.lastNeed>2&&l.length>2&&(l[2]&192)!==128)return T.lastNeed=2,"�"}}function o(T){var l=this.lastTotal-this.lastNeed,y=r(this,T);if(y!==void 0)return y;if(this.lastNeed<=T.length)return T.copy(this.lastChar,l,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,l,0,T.length),this.lastNeed-=T.length}function a(T,l){var y=t(this,T,l);if(!this.lastNeed)return T.toString("utf8",l);this.lastTotal=y;var b=T.length-(y-this.lastNeed);return T.copy(this.lastChar,0,b),T.toString("utf8",l,b)}function i(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+"�":l}function n(T,l){if((T.length-l)%2===0){var y=T.toString("utf16le",l);if(y){var b=y.charCodeAt(y.length-1);if(b>=55296&&b<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],y.slice(0,-1)}return y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",l,T.length-1)}function s(T){var l=T&&T.length?this.write(T):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return l+this.lastChar.toString("utf16le",0,y)}return l}function c(T,l){var y=(T.length-l)%3;return y===0?T.toString("base64",l):(this.lastNeed=3-y,this.lastTotal=3,y===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",l,T.length-y))}function f(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+this.lastChar.toString("base64",0,3-this.lastNeed):l}function v(T){return T.toString(this.encoding)}function h(T){return T&&T.length?this.write(T):""}}}),Q1=He({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(Y,G){var d=Fp().codes.ERR_STREAM_PREMATURE_CLOSE;function x(t){var r=!1;return function(){if(!r){r=!0;for(var o=arguments.length,a=new Array(o),i=0;i0)if(typeof q!="string"&&!we.objectMode&&Object.getPrototypeOf(q)!==E.prototype&&(q=t(q)),ie)we.endEmitted?M(ee,new l):m(ee,we,q,!0);else if(we.ended)M(ee,new h);else{if(we.destroyed)return!1;we.reading=!1,we.decoder&&!ae?(q=we.decoder.write(q),we.objectMode||q.length!==0?m(ee,we,q,!1):N(ee,we)):m(ee,we,q,!1)}else ie||(we.reading=!1,N(ee,we))}return!we.ended&&(we.length=P?ee=P:(ee--,ee|=ee>>>1,ee|=ee>>>2,ee|=ee>>>4,ee|=ee>>>8,ee|=ee>>>16,ee++),ee}function F(ee,q){return ee<=0||q.length===0&&q.ended?0:q.objectMode?1:ee!==ee?q.flowing&&q.length?q.buffer.head.data.length:q.length:(ee>q.highWaterMark&&(q.highWaterMark=z(ee)),ee<=q.length?ee:q.ended?q.length:(q.needReadable=!0,0))}u.prototype.read=function(ee){a("read",ee),ee=parseInt(ee,10);var q=this._readableState,ae=ee;if(ee!==0&&(q.emittedReadable=!1),ee===0&&q.needReadable&&((q.highWaterMark!==0?q.length>=q.highWaterMark:q.length>0)||q.ended))return a("read: emitReadable",q.length,q.ended),q.length===0&&q.ended?$(this):O(this),null;if(ee=F(ee,q),ee===0&&q.ended)return q.length===0&&$(this),null;var ie=q.needReadable;a("need readable",ie),(q.length===0||q.length-ee0?fe=J(ee,q):fe=null,fe===null?(q.needReadable=q.length<=q.highWaterMark,ee=0):(q.length-=ee,q.awaitDrain=0),q.length===0&&(q.ended||(q.needReadable=!0),ae!==ee&&q.ended&&$(this)),fe!==null&&this.emit("data",fe),fe};function B(ee,q){if(a("onEofChunk"),!q.ended){if(q.decoder){var ae=q.decoder.end();ae&&ae.length&&(q.buffer.push(ae),q.length+=q.objectMode?1:ae.length)}q.ended=!0,q.sync?O(ee):(q.needReadable=!1,q.emittedReadable||(q.emittedReadable=!0,L(ee)))}}function O(ee){var q=ee._readableState;a("emitReadable",q.needReadable,q.emittedReadable),q.needReadable=!1,q.emittedReadable||(a("emitReadable",q.flowing),q.emittedReadable=!0,process.nextTick(L,ee))}function L(ee){var q=ee._readableState;a("emitReadable_",q.destroyed,q.length,q.ended),!q.destroyed&&(q.length||q.ended)&&(ee.emit("readable"),q.emittedReadable=!1),q.needReadable=!q.flowing&&!q.ended&&q.length<=q.highWaterMark,j(ee)}function N(ee,q){q.readingMore||(q.readingMore=!0,process.nextTick(U,ee,q))}function U(ee,q){for(;!q.reading&&!q.ended&&(q.length1&&re(ie.pipes,ee)!==-1)&&!qe&&(a("false write response, pause",ie.awaitDrain),ie.awaitDrain++),ae.pause())}function Ke(ce){a("onerror",ce),xe(),ee.removeListener("error",Ke),x(ee,"error")===0&&M(ee,ce)}w(ee,"error",Ke);function Xe(){ee.removeListener("finish",Me),xe()}ee.once("close",Xe);function Me(){a("onfinish"),ee.removeListener("close",Xe),xe()}ee.once("finish",Me);function xe(){a("unpipe"),ae.unpipe(ee)}return ee.emit("pipe",ae),ie.flowing||(a("pipe resume"),ae.resume()),ee};function Z(ee){return function(){var ae=ee._readableState;a("pipeOnDrain",ae.awaitDrain),ae.awaitDrain&&ae.awaitDrain--,ae.awaitDrain===0&&x(ee,"data")&&(ae.flowing=!0,j(ee))}}u.prototype.unpipe=function(ee){var q=this._readableState,ae={hasUnpiped:!1};if(q.pipesCount===0)return this;if(q.pipesCount===1)return ee&&ee!==q.pipes?this:(ee||(ee=q.pipes),q.pipes=null,q.pipesCount=0,q.flowing=!1,ee&&ee.emit("unpipe",this,ae),this);if(!ee){var ie=q.pipes,fe=q.pipesCount;q.pipes=null,q.pipesCount=0,q.flowing=!1;for(var we=0;we0,ie.flowing!==!1&&this.resume()):ee==="readable"&&!ie.endEmitted&&!ie.readableListening&&(ie.readableListening=ie.needReadable=!0,ie.flowing=!1,ie.emittedReadable=!1,a("on readable",ie.length,ie.reading),ie.length?O(this):ie.reading||process.nextTick(ue,this)),ae},u.prototype.addListener=u.prototype.on,u.prototype.removeListener=function(ee,q){var ae=A.prototype.removeListener.call(this,ee,q);return ee==="readable"&&process.nextTick(Q,this),ae},u.prototype.removeAllListeners=function(ee){var q=A.prototype.removeAllListeners.apply(this,arguments);return(ee==="readable"||ee===void 0)&&process.nextTick(Q,this),q};function Q(ee){var q=ee._readableState;q.readableListening=ee.listenerCount("readable")>0,q.resumeScheduled&&!q.paused?q.flowing=!0:ee.listenerCount("data")>0&&ee.resume()}function ue(ee){a("readable nexttick read 0"),ee.read(0)}u.prototype.resume=function(){var ee=this._readableState;return ee.flowing||(a("resume"),ee.flowing=!ee.readableListening,oe(this,ee)),ee.paused=!1,this};function oe(ee,q){q.resumeScheduled||(q.resumeScheduled=!0,process.nextTick(le,ee,q))}function le(ee,q){a("resume",q.reading),q.reading||ee.read(0),q.resumeScheduled=!1,ee.emit("resume"),j(ee),q.flowing&&!q.reading&&ee.read(0)}u.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function j(ee){var q=ee._readableState;for(a("flow",q.flowing);q.flowing&&ee.read()!==null;);}u.prototype.wrap=function(ee){var q=this,ae=this._readableState,ie=!1;ee.on("end",function(){if(a("wrapped end"),ae.decoder&&!ae.ended){var Ae=ae.decoder.end();Ae&&Ae.length&&q.push(Ae)}q.push(null)}),ee.on("data",function(Ae){if(a("wrapped data"),ae.decoder&&(Ae=ae.decoder.write(Ae)),!(ae.objectMode&&Ae==null)&&!(!ae.objectMode&&(!Ae||!Ae.length))){var Fe=q.push(Ae);Fe||(ie=!0,ee.pause())}});for(var fe in ee)this[fe]===void 0&&typeof ee[fe]=="function"&&(this[fe]=function(Fe){return function(){return ee[Fe].apply(ee,arguments)}}(fe));for(var we=0;we<_.length;we++)ee.on(_[we],this.emit.bind(this,_[we]));return this._read=function(Ae){a("wrapped _read",Ae),ie&&(ie=!1,ee.resume())},this},typeof Symbol=="function"&&(u.prototype[Symbol.asyncIterator]=function(){return b===void 0&&(b=wk()),b(this)}),Object.defineProperty(u.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(u.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(u.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(q){this._readableState&&(this._readableState.flowing=q)}}),u._fromList=J,Object.defineProperty(u.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function J(ee,q){if(q.length===0)return null;var ae;return q.objectMode?ae=q.buffer.shift():!ee||ee>=q.length?(q.decoder?ae=q.buffer.join(""):q.buffer.length===1?ae=q.buffer.first():ae=q.buffer.concat(q.length),q.buffer.clear()):ae=q.buffer.consume(ee,q.decoder),ae}function $(ee){var q=ee._readableState;a("endReadable",q.endEmitted),q.endEmitted||(q.ended=!0,process.nextTick(X,q,ee))}function X(ee,q){if(a("endReadableNT",ee.endEmitted,ee.length),!ee.endEmitted&&ee.length===0&&(ee.endEmitted=!0,q.readable=!1,q.emit("end"),ee.autoDestroy)){var ae=q._writableState;(!ae||ae.autoDestroy&&ae.finished)&&q.destroy()}}typeof Symbol=="function"&&(u.from=function(ee,q){return S===void 0&&(S=Tk()),S(u,ee,q)});function re(ee,q){for(var ae=0,ie=ee.length;ae0;return o(y,S,M,function(_){T||(T=_),_&&l.forEach(a),!S&&(l.forEach(a),h(T))})});return f.reduce(i)}G.exports=s}}),Mk=He({"node_modules/stream-browserify/index.js"(Y,G){G.exports=A;var d=Mp().EventEmitter,x=od();x(A,d),A.Readable=o2(),A.Writable=n2(),A.Duplex=Op(),A.Transform=s2(),A.PassThrough=Ak(),A.finished=Q1(),A.pipeline=Sk(),A.Stream=A;function A(){d.call(this)}A.prototype.pipe=function(E,e){var t=this;function r(f){E.writable&&E.write(f)===!1&&t.pause&&t.pause()}t.on("data",r);function o(){t.readable&&t.resume&&t.resume()}E.on("drain",o),!E._isStdio&&(!e||e.end!==!1)&&(t.on("end",i),t.on("close",n));var a=!1;function i(){a||(a=!0,E.end())}function n(){a||(a=!0,typeof E.destroy=="function"&&E.destroy())}function s(f){if(c(),d.listenerCount(this,"error")===0)throw f}t.on("error",s),E.on("error",s);function c(){t.removeListener("data",r),E.removeListener("drain",o),t.removeListener("end",i),t.removeListener("close",n),t.removeListener("error",s),E.removeListener("error",s),t.removeListener("end",c),t.removeListener("close",c),E.removeListener("close",c)}return t.on("end",c),t.on("close",c),E.on("close",c),E.emit("pipe",t),E}}}),eg=He({"node_modules/util/util.js"(Y){var G=Object.getOwnPropertyDescriptors||function(Z){for(var Q=Object.keys(Z),ue={},oe=0;oe=oe)return J;switch(J){case"%s":return String(ue[Q++]);case"%d":return Number(ue[Q++]);case"%j":try{return JSON.stringify(ue[Q++])}catch{return"[Circular]"}default:return J}}),j=ue[Q];Q"u")return function(){return Y.deprecate(U,Z).apply(this,arguments)};var Q=!1;function ue(){if(!Q){if(process.throwDeprecation)throw new Error(Z);process.traceDeprecation?console.trace(Z):console.error(Z),Q=!0}return U.apply(this,arguments)}return ue};var x={},A=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),A=new RegExp("^"+E+"$","i");var E;Y.debuglog=function(U){if(U=U.toUpperCase(),!x[U])if(A.test(U)){var Z=process.pid;x[U]=function(){var Q=Y.format.apply(Y,arguments);console.error("%s %d: %s",U,Z,Q)}}else x[U]=function(){};return x[U]};function e(U,Z){var Q={seen:[],stylize:r};return arguments.length>=3&&(Q.depth=arguments[2]),arguments.length>=4&&(Q.colors=arguments[3]),h(Z)?Q.showHidden=Z:Z&&Y._extend(Q,Z),M(Q.showHidden)&&(Q.showHidden=!1),M(Q.depth)&&(Q.depth=2),M(Q.colors)&&(Q.colors=!1),M(Q.customInspect)&&(Q.customInspect=!0),Q.colors&&(Q.stylize=t),a(Q,U,Q.depth)}Y.inspect=e,e.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]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(U,Z){var Q=e.styles[Z];return Q?"\x1B["+e.colors[Q][0]+"m"+U+"\x1B["+e.colors[Q][1]+"m":U}function r(U,Z){return U}function o(U){var Z={};return U.forEach(function(Q,ue){Z[Q]=!0}),Z}function a(U,Z,Q){if(U.customInspect&&Z&&g(Z.inspect)&&Z.inspect!==Y.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var ue=Z.inspect(Q,U);return b(ue)||(ue=a(U,ue,Q)),ue}var oe=i(U,Z);if(oe)return oe;var le=Object.keys(Z),j=o(le);if(U.showHidden&&(le=Object.getOwnPropertyNames(Z)),u(Z)&&(le.indexOf("message")>=0||le.indexOf("description")>=0))return n(Z);if(le.length===0){if(g(Z)){var J=Z.name?": "+Z.name:"";return U.stylize("[Function"+J+"]","special")}if(_(Z))return U.stylize(RegExp.prototype.toString.call(Z),"regexp");if(p(Z))return U.stylize(Date.prototype.toString.call(Z),"date");if(u(Z))return n(Z)}var $="",X=!1,re=["{","}"];if(v(Z)&&(X=!0,re=["[","]"]),g(Z)){var ee=Z.name?": "+Z.name:"";$=" [Function"+ee+"]"}if(_(Z)&&($=" "+RegExp.prototype.toString.call(Z)),p(Z)&&($=" "+Date.prototype.toUTCString.call(Z)),u(Z)&&($=" "+n(Z)),le.length===0&&(!X||Z.length==0))return re[0]+$+re[1];if(Q<0)return _(Z)?U.stylize(RegExp.prototype.toString.call(Z),"regexp"):U.stylize("[Object]","special");U.seen.push(Z);var q;return X?q=s(U,Z,Q,j,le):q=le.map(function(ae){return c(U,Z,Q,j,ae,X)}),U.seen.pop(),f(q,$,re)}function i(U,Z){if(M(Z))return U.stylize("undefined","undefined");if(b(Z)){var Q="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize(Q,"string")}if(y(Z))return U.stylize(""+Z,"number");if(h(Z))return U.stylize(""+Z,"boolean");if(T(Z))return U.stylize("null","null")}function n(U){return"["+Error.prototype.toString.call(U)+"]"}function s(U,Z,Q,ue,oe){for(var le=[],j=0,J=Z.length;j-1&&(le?J=J.split(` +`).map(function(X){return" "+X}).join(` +`).slice(2):J=` +`+J.split(` +`).map(function(X){return" "+X}).join(` +`))):J=U.stylize("[Circular]","special")),M(j)){if(le&&oe.match(/^\d+$/))return J;j=JSON.stringify(""+oe),j.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(j=j.slice(1,-1),j=U.stylize(j,"name")):(j=j.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),j=U.stylize(j,"string"))}return j+": "+J}function f(U,Z,Q){var ue=U.reduce(function(oe,le){return le.indexOf(` +`)>=0,oe+le.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ue>60?Q[0]+(Z===""?"":Z+` + `)+" "+U.join(`, + `)+" "+Q[1]:Q[0]+Z+" "+U.join(", ")+" "+Q[1]}Y.types=Qw();function v(U){return Array.isArray(U)}Y.isArray=v;function h(U){return typeof U=="boolean"}Y.isBoolean=h;function T(U){return U===null}Y.isNull=T;function l(U){return U==null}Y.isNullOrUndefined=l;function y(U){return typeof U=="number"}Y.isNumber=y;function b(U){return typeof U=="string"}Y.isString=b;function S(U){return typeof U=="symbol"}Y.isSymbol=S;function M(U){return U===void 0}Y.isUndefined=M;function _(U){return w(U)&&R(U)==="[object RegExp]"}Y.isRegExp=_,Y.types.isRegExp=_;function w(U){return typeof U=="object"&&U!==null}Y.isObject=w;function p(U){return w(U)&&R(U)==="[object Date]"}Y.isDate=p,Y.types.isDate=p;function u(U){return w(U)&&(R(U)==="[object Error]"||U instanceof Error)}Y.isError=u,Y.types.isNativeError=u;function g(U){return typeof U=="function"}Y.isFunction=g;function m(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Y.isPrimitive=m,Y.isBuffer=e2();function R(U){return Object.prototype.toString.call(U)}function P(U){return U<10?"0"+U.toString(10):U.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var U=new Date,Z=[P(U.getHours()),P(U.getMinutes()),P(U.getSeconds())].join(":");return[U.getDate(),z[U.getMonth()],Z].join(" ")}Y.log=function(){console.log("%s - %s",F(),Y.format.apply(Y,arguments))},Y.inherits=od(),Y._extend=function(U,Z){if(!Z||!w(Z))return U;for(var Q=Object.keys(Z),ue=Q.length;ue--;)U[Q[ue]]=Z[Q[ue]];return U};function B(U,Z){return Object.prototype.hasOwnProperty.call(U,Z)}var O=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Y.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if(O&&Z[O]){var Q=Z[O];if(typeof Q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Q}function Q(){for(var ue,oe,le=new Promise(function($,X){ue=$,oe=X}),j=[],J=0;J"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function i(y){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},i(y)}var n={},s,c;function f(y,b,S){S||(S=Error);function M(w,p,u){return typeof b=="string"?b:b(w,p,u)}var _=function(w){E(u,w);var p=t(u);function u(g,m,R){var P;return A(this,u),P=p.call(this,M(g,m,R)),P.code=y,P}return x(u)}(S);n[y]=_}function v(y,b){if(Array.isArray(y)){var S=y.length;return y=y.map(function(M){return String(M)}),S>2?"one of ".concat(b," ").concat(y.slice(0,S-1).join(", "),", or ")+y[S-1]:S===2?"one of ".concat(b," ").concat(y[0]," or ").concat(y[1]):"of ".concat(b," ").concat(y[0])}else return"of ".concat(b," ").concat(String(y))}function h(y,b,S){return y.substr(0,b.length)===b}function T(y,b,S){return(S===void 0||S>y.length)&&(S=y.length),y.substring(S-b.length,S)===b}function l(y,b,S){return typeof S!="number"&&(S=0),S+b.length>y.length?!1:y.indexOf(b,S)!==-1}f("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),f("ERR_INVALID_ARG_TYPE",function(y,b,S){s===void 0&&(s=_y()),s(typeof y=="string","'name' must be a string");var M;typeof b=="string"&&h(b,"not ")?(M="must not be",b=b.replace(/^not /,"")):M="must be";var _;if(T(y," argument"))_="The ".concat(y," ").concat(M," ").concat(v(b,"type"));else{var w=l(y,".")?"property":"argument";_='The "'.concat(y,'" ').concat(w," ").concat(M," ").concat(v(b,"type"))}return _+=". Received type ".concat(d(S)),_},TypeError),f("ERR_INVALID_ARG_VALUE",function(y,b){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";c===void 0&&(c=eg());var M=c.inspect(b);return M.length>128&&(M="".concat(M.slice(0,128),"...")),"The argument '".concat(y,"' ").concat(S,". Received ").concat(M)},TypeError),f("ERR_INVALID_RETURN_VALUE",function(y,b,S){var M;return S&&S.constructor&&S.constructor.name?M="instance of ".concat(S.constructor.name):M="type ".concat(d(S)),"Expected ".concat(y,' to be returned from the "').concat(b,'"')+" function but got ".concat(M,".")},TypeError),f("ERR_MISSING_ARGS",function(){for(var y=arguments.length,b=new Array(y),S=0;S0,"At least one arg needs to be specified");var M="The ",_=b.length;switch(b=b.map(function(w){return'"'.concat(w,'"')}),_){case 1:M+="".concat(b[0]," argument");break;case 2:M+="".concat(b[0]," and ").concat(b[1]," arguments");break;default:M+=b.slice(0,_-1).join(", "),M+=", and ".concat(b[_-1]," arguments");break}return"".concat(M," must be specified")},TypeError),G.exports.codes=n}}),Ek=He({"node_modules/assert/build/internal/assert/assertion_error.js"(Y,G){function d(N,U){var Z=Object.keys(N);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(N);U&&(Q=Q.filter(function(ue){return Object.getOwnPropertyDescriptor(N,ue).enumerable})),Z.push.apply(Z,Q)}return Z}function x(N){for(var U=1;U"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function h(N){return Function.toString.call(N).indexOf("[native code]")!==-1}function T(N,U){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Q,ue){return Q.__proto__=ue,Q},T(N,U)}function l(N){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Z){return Z.__proto__||Object.getPrototypeOf(Z)},l(N)}function y(N){"@babel/helpers - typeof";return y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},y(N)}var b=eg(),S=b.inspect,M=l2(),_=M.codes.ERR_INVALID_ARG_TYPE;function w(N,U,Z){return(Z===void 0||Z>N.length)&&(Z=N.length),N.substring(Z-U.length,Z)===U}function p(N,U){if(U=Math.floor(U),N.length==0||U==0)return"";var Z=N.length*U;for(U=Math.floor(Math.log(U)/Math.log(2));U;)N+=N,U--;return N+=N.substring(0,Z-N.length),N}var u="",g="",m="",R="",P={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},z=10;function F(N){var U=Object.keys(N),Z=Object.create(Object.getPrototypeOf(N));return U.forEach(function(Q){Z[Q]=N[Q]}),Object.defineProperty(Z,"message",{value:N.message}),Z}function B(N){return S(N,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function O(N,U,Z){var Q="",ue="",oe=0,le="",j=!1,J=B(N),$=J.split(` +`),X=B(U).split(` +`),re=0,ee="";if(Z==="strictEqual"&&y(N)==="object"&&y(U)==="object"&&N!==null&&U!==null&&(Z="strictEqualObject"),$.length===1&&X.length===1&&$[0]!==X[0]){var q=$[0].length+X[0].length;if(q<=z){if((y(N)!=="object"||N===null)&&(y(U)!=="object"||U===null)&&(N!==0||U!==0))return"".concat(P[Z],` + +`)+"".concat($[0]," !== ").concat(X[0],` +`)}else if(Z!=="strictEqualObject"){var ae=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(q2&&(ee=` + `.concat(p(" ",re),"^"),re=0)}}}for(var ie=$[$.length-1],fe=X[X.length-1];ie===fe&&(re++<2?le=` + `.concat(ie).concat(le):Q=ie,$.pop(),X.pop(),!($.length===0||X.length===0));)ie=$[$.length-1],fe=X[X.length-1];var we=Math.max($.length,X.length);if(we===0){var Ae=J.split(` +`);if(Ae.length>30)for(Ae[26]="".concat(u,"...").concat(R);Ae.length>27;)Ae.pop();return"".concat(P.notIdentical,` + +`).concat(Ae.join(` +`),` +`)}re>3&&(le=` +`.concat(u,"...").concat(R).concat(le),j=!0),Q!==""&&(le=` + `.concat(Q).concat(le),Q="");var Fe=0,Ce=P[Z]+` +`.concat(g,"+ actual").concat(R," ").concat(m,"- expected").concat(R),qe=" ".concat(u,"...").concat(R," Lines skipped");for(re=0;re1&&re>2&&(et>4?(ue+=` +`.concat(u,"...").concat(R),j=!0):et>3&&(ue+=` + `.concat(X[re-2]),Fe++),ue+=` + `.concat(X[re-1]),Fe++),oe=re,Q+=` +`.concat(m,"-").concat(R," ").concat(X[re]),Fe++;else if(X.length1&&re>2&&(et>4?(ue+=` +`.concat(u,"...").concat(R),j=!0):et>3&&(ue+=` + `.concat($[re-2]),Fe++),ue+=` + `.concat($[re-1]),Fe++),oe=re,ue+=` +`.concat(g,"+").concat(R," ").concat($[re]),Fe++;else{var Qe=X[re],Ke=$[re],Xe=Ke!==Qe&&(!w(Ke,",")||Ke.slice(0,-1)!==Qe);Xe&&w(Qe,",")&&Qe.slice(0,-1)===Ke&&(Xe=!1,Ke+=","),Xe?(et>1&&re>2&&(et>4?(ue+=` +`.concat(u,"...").concat(R),j=!0):et>3&&(ue+=` + `.concat($[re-2]),Fe++),ue+=` + `.concat($[re-1]),Fe++),oe=re,ue+=` +`.concat(g,"+").concat(R," ").concat(Ke),Q+=` +`.concat(m,"-").concat(R," ").concat(Qe),Fe+=2):(ue+=Q,Q="",(et===1||re===0)&&(ue+=` + `.concat(Ke),Fe++))}if(Fe>20&&re30)for(q[26]="".concat(u,"...").concat(R);q.length>27;)q.pop();q.length===1?oe=Z.call(this,"".concat(ee," ").concat(q[0])):oe=Z.call(this,"".concat(ee,` + +`).concat(q.join(` +`),` +`))}else{var ae=B($),ie="",fe=P[j];j==="notDeepEqual"||j==="notEqual"?(ae="".concat(P[j],` + +`).concat(ae),ae.length>1024&&(ae="".concat(ae.slice(0,1021),"..."))):(ie="".concat(B(X)),ae.length>512&&(ae="".concat(ae.slice(0,509),"...")),ie.length>512&&(ie="".concat(ie.slice(0,509),"...")),j==="deepEqual"||j==="equal"?ae="".concat(fe,` + +`).concat(ae,` + +should equal + +`):ie=" ".concat(j," ").concat(ie)),oe=Z.call(this,"".concat(ae).concat(ie))}return Error.stackTraceLimit=re,oe.generatedMessage=!le,Object.defineProperty(s(oe),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),oe.code="ERR_ASSERTION",oe.actual=$,oe.expected=X,oe.operator=j,Error.captureStackTrace&&Error.captureStackTrace(s(oe),J),oe.stack,oe.name="AssertionError",n(oe)}return t(Q,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:U,value:function(oe,le){return S(this,x(x({},le),{},{customInspect:!1,depth:0}))}}]),Q}(c(Error),S.custom);G.exports=L}}),u2=He({"node_modules/object-keys/isArguments.js"(Y,G){var d=Object.prototype.toString;G.exports=function(A){var E=d.call(A),e=E==="[object Arguments]";return e||(e=E!=="[object Array]"&&A!==null&&typeof A=="object"&&typeof A.length=="number"&&A.length>=0&&d.call(A.callee)==="[object Function]"),e}}}),kk=He({"node_modules/object-keys/implementation.js"(Y,G){var d;Object.keys||(x=Object.prototype.hasOwnProperty,A=Object.prototype.toString,E=u2(),e=Object.prototype.propertyIsEnumerable,t=!e.call({toString:null},"toString"),r=e.call(function(){},"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=function(c){var f=c.constructor;return f&&f.prototype===c},i={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},n=function(){if(typeof window>"u")return!1;for(var c in window)try{if(!i["$"+c]&&x.call(window,c)&&window[c]!==null&&typeof window[c]=="object")try{a(window[c])}catch{return!0}}catch{return!0}return!1}(),s=function(c){if(typeof window>"u"||!n)return a(c);try{return a(c)}catch{return!1}},d=function(f){var v=f!==null&&typeof f=="object",h=A.call(f)==="[object Function]",T=E(f),l=v&&A.call(f)==="[object String]",y=[];if(!v&&!h&&!T)throw new TypeError("Object.keys called on a non-object");var b=r&&h;if(l&&f.length>0&&!x.call(f,0))for(var S=0;S0)for(var M=0;M2?arguments[2]:{},f=d(s);x&&(f=E.call(f,Object.getOwnPropertySymbols(s)));for(var v=0;vXe.length)&&(Me=Xe.length);for(var xe=0,ce=new Array(Me);xe10)return!0;for(var Me=0;Me57)return!0}return Xe.length===10&&Xe>=Math.pow(2,32)}function L(Xe){return Object.keys(Xe).filter(O).concat(s(Xe).filter(Object.prototype.propertyIsEnumerable.bind(Xe)))}function N(Xe,Me){if(Xe===Me)return 0;for(var xe=Xe.length,ce=Me.length,Re=0,$e=Math.min(xe,ce);Re<$e;++Re)if(Xe[Re]!==Me[Re]){xe=Xe[Re],ce=Me[Re];break}return xe1?j-1:0),$=1;$1?j-1:0),$=1;$1?j-1:0),$=1;$1?j-1:0),$=1;$0)return t(i);if(s==="number"&&isNaN(i)===!1)return n.long?o(i):r(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function t(i){if(i=String(i),!(i.length>100)){var n=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(n){var s=parseFloat(n[1]),c=(n[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return s*e;case"days":case"day":case"d":return s*E;case"hours":case"hour":case"hrs":case"hr":case"h":return s*A;case"minutes":case"minute":case"mins":case"min":case"m":return s*x;case"seconds":case"second":case"secs":case"sec":case"s":return s*d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function r(i){return i>=E?Math.round(i/E)+"d":i>=A?Math.round(i/A)+"h":i>=x?Math.round(i/x)+"m":i>=d?Math.round(i/d)+"s":i+"ms"}function o(i){return a(i,E,"day")||a(i,A,"hour")||a(i,x,"minute")||a(i,d,"second")||i+" ms"}function a(i,n,s){if(!(i=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}Y.formatters.j=function(r){try{return JSON.stringify(r)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}};function x(r){var o=this.useColors;if(r[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+r[0]+(o?"%c ":" ")+"+"+Y.humanize(this.diff),!!o){var a="color: "+this.color;r.splice(1,0,a,"color: inherit");var i=0,n=0;r[0].replace(/%[a-zA-Z%]/g,function(s){s!=="%%"&&(i++,s==="%c"&&(n=i))}),r.splice(n,0,a)}}function A(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function E(r){try{r==null?Y.storage.removeItem("debug"):Y.storage.debug=r}catch{}}function e(){var r;try{r=Y.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=Th.DEBUG),r}Y.enable(e());function t(){try{return window.localStorage}catch{}}}}),Nk=He({"node_modules/stream-parser/index.js"(Y,G){var d=_y(),x=Bk()("stream-parser");G.exports=r;var A=-1,E=0,e=1,t=2;function r(l){var y=l&&typeof l._transform=="function",b=l&&typeof l._write=="function";if(!y&&!b)throw new Error("must pass a Writable or Transform stream in");x("extending Parser into stream"),l._bytes=a,l._skipBytes=i,y&&(l._passthrough=n),y?l._transform=c:l._write=s}function o(l){x("initializing parser stream"),l._parserBytesLeft=0,l._parserBuffers=[],l._parserBuffered=0,l._parserState=A,l._parserCallback=null,typeof l.push=="function"&&(l._parserOutput=l.push.bind(l)),l._parserInit=!0}function a(l,y){d(!this._parserCallback,'there is already a "callback" set!'),d(isFinite(l)&&l>0,'can only buffer a finite number of bytes > 0, got "'+l+'"'),this._parserInit||o(this),x("buffering %o bytes",l),this._parserBytesLeft=l,this._parserCallback=y,this._parserState=E}function i(l,y){d(!this._parserCallback,'there is already a "callback" set!'),d(l>0,'can only skip > 0 bytes, got "'+l+'"'),this._parserInit||o(this),x("skipping %o bytes",l),this._parserBytesLeft=l,this._parserCallback=y,this._parserState=e}function n(l,y){d(!this._parserCallback,'There is already a "callback" set!'),d(l>0,'can only pass through > 0 bytes, got "'+l+'"'),this._parserInit||o(this),x("passing through %o bytes",l),this._parserBytesLeft=l,this._parserCallback=y,this._parserState=t}function s(l,y,b){this._parserInit||o(this),x("write(%o bytes)",l.length),typeof y=="function"&&(b=y),h(this,l,null,b)}function c(l,y,b){this._parserInit||o(this),x("transform(%o bytes)",l.length),typeof y!="function"&&(y=this._parserOutput),h(this,l,y,b)}function f(l,y,b,S){return l._parserBytesLeft<=0?S(new Error("got data but not currently parsing anything")):y.length<=l._parserBytesLeft?function(){return v(l,y,b,S)}:function(){var M=y.slice(0,l._parserBytesLeft);return v(l,M,b,function(_){if(_)return S(_);if(y.length>M.length)return function(){return f(l,y.slice(M.length),b,S)}})}}function v(l,y,b,S){if(l._parserBytesLeft-=y.length,x("%o bytes left for stream piece",l._parserBytesLeft),l._parserState===E?(l._parserBuffers.push(y),l._parserBuffered+=y.length):l._parserState===t&&b(y),l._parserBytesLeft===0){var M=l._parserCallback;if(M&&l._parserState===E&&l._parserBuffers.length>1&&(y=Buffer.concat(l._parserBuffers,l._parserBuffered)),l._parserState!==E&&(y=null),l._parserCallback=null,l._parserBuffered=0,l._parserState=A,l._parserBuffers.splice(0),M){var _=[];y&&_.push(y),b&&_.push(b);var w=M.length>_.length;w&&_.push(T(S));var p=M.apply(l,_);if(!w||S===p)return S}}else return S}var h=T(f);function T(l){return function(){for(var y=l.apply(this,arguments);typeof y=="function";)y=y();return y}}}}),Jl=He({"node_modules/probe-image-size/lib/common.js"(Y){var G=Mk().Transform,d=Nk();function x(){G.call(this,{readableObjectMode:!0})}x.prototype=Object.create(G.prototype),x.prototype.constructor=x,d(x.prototype),Y.ParserStream=x,Y.sliceEq=function(E,e,t){for(var r=e,o=0;o>4&15,f=n[4]&15,v=n[5]>>4&15,h=d(n,6),T=8,l=0;lh.width||v.width===h.width&&v.height>h.height?v:h}),c=n.reduce(function(v,h){return v.height>h.height||v.height===h.height&&v.width>h.width?v:h}),f;return s.width>c.height||s.width===c.height&&s.height>c.width?f=s:f=c,f}G.exports.readSizeFromMeta=function(n){var s={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(a(n,s),!!s.sizes.length){var c=i(s.sizes),f=1;s.transforms.forEach(function(h){var T={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},l={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(h.type==="imir"&&(h.value===0?f=l[f]:(f=l[f],f=T[f],f=T[f])),h.type==="irot")for(var y=0;y0&&!this.aborted;){var t=this.ifds_to_read.shift();t.offset&&this.scan_ifd(t.id,t.offset,E)}},A.prototype.read_uint16=function(E){var e=this.input;if(E+2>e.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?e[E]*256+e[E+1]:e[E]+e[E+1]*256},A.prototype.read_uint32=function(E){var e=this.input;if(E+4>e.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?e[E]*16777216+e[E+1]*65536+e[E+2]*256+e[E+3]:e[E]+e[E+1]*256+e[E+2]*65536+e[E+3]*16777216},A.prototype.is_subifd_link=function(E,e){return E===0&&e===34665||E===0&&e===34853||E===34665&&e===40965},A.prototype.exif_format_length=function(E){switch(E){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},A.prototype.exif_format_read=function(E,e){var t;switch(E){case 1:case 2:return t=this.input[e],t;case 6:return t=this.input[e],t|(t&128)*33554430;case 3:return t=this.read_uint16(e),t;case 8:return t=this.read_uint16(e),t|(t&32768)*131070;case 4:return t=this.read_uint32(e),t;case 9:return t=this.read_uint32(e),t|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},A.prototype.scan_ifd=function(E,e,t){var r=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw d("unexpected EOF","EBADDATA");for(var h=[],T=f,l=0;l0&&(this.ifds_to_read.push({id:a,offset:h[0]}),v=!0);var b={is_big_endian:this.big_endian,ifd:E,tag:a,format:i,count:n,entry_offset:e+this.start,data_length:c,data_offset:f+this.start,value:h,is_subifd_link:v};if(t(b)===!1){this.aborted=!0;return}e+=12}E===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},G.exports.ExifParser=A,G.exports.get_orientation=function(E){var e=0;try{return new A(E,0,E.length).each(function(t){if(t.ifd===0&&t.tag===274&&Array.isArray(t.value))return e=t.value[0],!1}),e}catch{return-1}}}}),jk=He({"node_modules/probe-image-size/lib/parse_sync/avif.js"(Y,G){var d=Jl().str2arr,x=Jl().sliceEq,A=Jl().readUInt32BE,E=Uk(),e=t_(),t=d("ftyp");G.exports=function(r){if(x(r,4,t)){var o=E.unbox(r,0);if(o){var a=E.getMimeType(o.data);if(a){for(var i,n=o.end;;){var s=E.unbox(r,n);if(!s)break;if(n=s.end,s.boxtype==="mdat")return;if(s.boxtype==="meta"){i=s.data;break}}if(i){var c=E.readSizeFromMeta(i);if(c){var f={width:c.width,height:c.height,type:a.type,mime:a.mime,wUnits:"px",hUnits:"px"};if(c.variants.length>1&&(f.variants=c.variants),c.orientation&&(f.orientation=c.orientation),c.exif_location&&c.exif_location.offset+c.exif_location.length<=r.length){var v=A(r,c.exif_location.offset),h=r.slice(c.exif_location.offset+v+4,c.exif_location.offset+c.exif_location.length),T=e.get_orientation(h);T>0&&(f.orientation=T)}return f}}}}}}}}),Vk=He({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(Y,G){var d=Jl().str2arr,x=Jl().sliceEq,A=Jl().readUInt16LE,E=d("BM");G.exports=function(e){if(!(e.length<26)&&x(e,0,E))return{width:A(e,18),height:A(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),qk=He({"node_modules/probe-image-size/lib/parse_sync/gif.js"(Y,G){var d=Jl().str2arr,x=Jl().sliceEq,A=Jl().readUInt16LE,E=d("GIF87a"),e=d("GIF89a");G.exports=function(t){if(!(t.length<10)&&!(!x(t,0,E)&&!x(t,0,e)))return{width:A(t,6),height:A(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),Hk=He({"node_modules/probe-image-size/lib/parse_sync/ico.js"(Y,G){var d=Jl().readUInt16LE,x=0,A=1,E=16;G.exports=function(e){var t=d(e,0),r=d(e,2),o=d(e,4);if(!(t!==x||r!==A||!o)){for(var a=[],i={width:0,height:0},n=0;ni.width||c>i.height)&&(i=f)}return{width:i.width,height:i.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),Gk=He({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(Y,G){var d=Jl().readUInt16BE,x=Jl().str2arr,A=Jl().sliceEq,E=t_(),e=x("Exif\0\0");G.exports=function(t){if(!(t.length<2)&&!(t[0]!==255||t[1]!==216||t[2]!==255))for(var r=2;;){for(;;){if(t.length-r<2)return;if(t[r++]===255)break}for(var o=t[r++],a;o===255;)o=t[r++];if(208<=o&&o<=217||o===1)a=0;else if(192<=o&&o<=254){if(t.length-r<2)return;a=d(t,r)-2,r+=2}else return;if(o===217||o===218)return;var i;if(o===225&&a>=10&&A(t,r,e)&&(i=E.get_orientation(t.slice(r+6,r+a))),a>=5&&192<=o&&o<=207&&o!==196&&o!==200&&o!==204){if(t.length-r0&&(n.orientation=i),n}r+=a}}}}),Wk=He({"node_modules/probe-image-size/lib/parse_sync/png.js"(Y,G){var d=Jl().str2arr,x=Jl().sliceEq,A=Jl().readUInt32BE,E=d(`‰PNG\r + +`),e=d("IHDR");G.exports=function(t){if(!(t.length<24)&&x(t,0,E)&&x(t,12,e))return{width:A(t,16),height:A(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),Zk=He({"node_modules/probe-image-size/lib/parse_sync/psd.js"(Y,G){var d=Jl().str2arr,x=Jl().sliceEq,A=Jl().readUInt32BE,E=d("8BPS\0");G.exports=function(e){if(!(e.length<22)&&x(e,0,E))return{width:A(e,18),height:A(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),Xk=He({"node_modules/probe-image-size/lib/parse_sync/svg.js"(Y,G){function d(s){return s===32||s===9||s===13||s===10}function x(s){return typeof s=="number"&&isFinite(s)&&s>0}function A(s){var c=0,f=s.length;for(s[0]===239&&s[1]===187&&s[2]===191&&(c=3);c]*>/,e=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,t=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,r=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,o=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,a=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function i(s){var c=s.match(t),f=s.match(r),v=s.match(o);return{width:c&&(c[1]||c[2]),height:f&&(f[1]||f[2]),viewbox:v&&(v[1]||v[2])}}function n(s){return a.test(s)?s.match(a)[0]:"px"}G.exports=function(s){if(A(s)){for(var c="",f=0;f>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function i(n,s){return{width:(n[s+6]<<16|n[s+5]<<8|n[s+4])+1,height:(n[s+9]<n.length)){for(;s+8=10?c=c||o(n,s+8):h==="VP8L"&&T>=9?c=c||a(n,s+8):h==="VP8X"&&T>=10?c=c||i(n,s+8):h==="EXIF"&&(f=e.get_orientation(n.slice(s+8,s+8+T)),s=1/0),s+=8+T}if(c)return f>0&&(c.orientation=f),c}}}}}),Jk=He({"node_modules/probe-image-size/lib/parsers_sync.js"(Y,G){G.exports={avif:jk(),bmp:Vk(),gif:qk(),ico:Hk(),jpeg:Gk(),png:Wk(),psd:Zk(),svg:Xk(),tiff:Yk(),webp:Kk()}}}),$k=He({"node_modules/probe-image-size/sync.js"(Y,G){var d=Jk();function x(A){for(var E=Object.keys(d),e=0;e0;)R=c.c2p(M+B*u),B--;for(B=0;z===void 0&&B0;)F=f.c2p(_+B*g),B--;if(Rj[0];if(J||$){var X=m+L/2,re=z+N/2;oe+="transform:"+A(X+"px",re+"px")+"scale("+(J?-1:1)+","+($?-1:1)+")"+A(-X+"px",-re+"px")+";"}}ue.attr("style",oe);var ee=new Promise(function(q){if(y._hasZ)q();else if(y._hasSource)if(y._canvas&&y._canvas.el.width===w&&y._canvas.el.height===p&&y._canvas.source===y.source)q();else{var ae=document.createElement("canvas");ae.width=w,ae.height=p;var ie=ae.getContext("2d",{willReadFrequently:!0});y._image=y._image||new Image;var fe=y._image;fe.onload=function(){ie.drawImage(fe,0,0),y._canvas={el:ae,source:y.source},q()},fe.setAttribute("src",y.source)}}).then(function(){var q,ae;if(y._hasZ)ae=Q(function(we,Ae){var Fe=S[Ae][we];return x.isTypedArray(Fe)&&(Fe=Array.from(Fe)),Fe}),q=ae.toDataURL("image/png");else if(y._hasSource)if(b)q=y.source;else{var ie=y._canvas.el.getContext("2d",{willReadFrequently:!0}),fe=ie.getImageData(0,0,w,p).data;ae=Q(function(we,Ae){var Fe=4*(Ae*w+we);return[fe[Fe],fe[Fe+1],fe[Fe+2],fe[Fe+3]]}),q=ae.toDataURL("image/png")}ue.attr({"xlink:href":q,height:N,width:L,x:m,y:z})});a._promises.push(ee)})}}}),rC=He({"src/traces/image/style.js"(Y,G){var d=Qn();G.exports=function(A){d.select(A).selectAll(".im image").style("opacity",function(E){return E[0].trace.opacity})}}}),aC=He({"src/traces/image/hover.js"(Y,G){var d=Wu(),x=Gr(),A=x.isArrayOrTypedArray,E=J0();G.exports=function(t,r,o){var a=t.cd[0],i=a.trace,n=t.xa,s=t.ya;if(!(d.inbox(r-a.x0,r-(a.x0+a.w*i.dx),0)>0||d.inbox(o-a.y0,o-(a.y0+a.h*i.dy),0)>0)){var c=Math.floor((r-a.x0)/i.dx),f=Math.floor(Math.abs(o-a.y0)/i.dy),v;if(i._hasZ?v=a.z[f][c]:i._hasSource&&(v=i._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(c,f,1,1).data),!!v){var h=a.hi||i.hoverinfo,T;if(h){var l=h.split("+");l.indexOf("all")!==-1&&(l=["color"]),l.indexOf("color")!==-1&&(T=!0)}var y=E.colormodel[i.colormodel],b=y.colormodel||i.colormodel,S=b.length,M=i._scaler(v),_=y.suffix,w=[];(i.hovertemplate||T)&&(w.push("["+[M[0]+_[0],M[1]+_[1],M[2]+_[2]].join(", ")),S===4&&w.push(", "+M[3]+_[3]),w.push("]"),w=w.join(""),t.extraText=b.toUpperCase()+": "+w);var p;A(i.hovertext)&&A(i.hovertext[f])?p=i.hovertext[f][c]:A(i.text)&&A(i.text[f])&&(p=i.text[f][c]);var u=s.c2p(a.y0+(f+.5)*i.dy),g=a.x0+(c+.5)*i.dx,m=a.y0+(f+.5)*i.dy,R="["+v.slice(0,i.colormodel.length).join(", ")+"]";return[x.extendFlat(t,{index:[f,c],x0:n.c2p(a.x0+c*i.dx),x1:n.c2p(a.x0+(c+1)*i.dx),y0:u,y1:u,color:M,xVal:g,xLabelVal:g,yVal:m,yLabelVal:m,zLabelVal:R,text:p,hovertemplateLabels:{zLabel:R,colorLabel:w,"color[0]Label":M[0]+_[0],"color[1]Label":M[1]+_[1],"color[2]Label":M[2]+_[2],"color[3]Label":M[3]+_[3]}})]}}}}}),nC=He({"src/traces/image/event_data.js"(Y,G){G.exports=function(x,A){return"xVal"in A&&(x.x=A.xVal),"yVal"in A&&(x.y=A.yVal),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),x.color=A.color,x.colormodel=A.trace.colormodel,x.z||(x.z=A.color),x}}}),iC=He({"src/traces/image/index.js"(Y,G){G.exports={attributes:Zw(),supplyDefaults:ek(),calc:eC(),plot:tC(),style:rC(),hoverPoints:aC(),eventData:nC(),moduleType:"trace",name:"image",basePlotModule:Bc(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),oC=He({"lib/image.js"(Y,G){G.exports=iC()}}),Bp=He({"src/traces/pie/attributes.js"(Y,G){var d=cl(),x=mu().attributes,A=Yl(),E=Xc(),e=Yo().hovertemplateAttrs,t=Yo().texttemplateAttrs,r=ho().extendFlat,o=Nf().pattern,a=A({editType:"plot",arrayOk:!0,colorEditType:"plot"});G.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:E.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:o,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:r({},d.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:e({},{keys:["label","color","value","percent","text"]}),texttemplate:t({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:r({},a,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:r({},a,{}),outsidetextfont:r({},a,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:r({},a,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:x({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),Np=He({"src/traces/pie/defaults.js"(Y,G){var d=Hi(),x=Gr(),A=Bp(),E=mu().defaults,e=Jh().handleText,t=Gr().coercePattern;function r(i,n){var s=x.isArrayOrTypedArray(i),c=x.isArrayOrTypedArray(n),f=Math.min(s?i.length:1/0,c?n.length:1/0);if(isFinite(f)||(f=0),f&&c){for(var v,h=0;h0){v=!0;break}}v||(f=0)}return{hasLabels:s,hasValues:c,len:f}}function o(i,n,s,c,f){var v=c("marker.line.width");v&&c("marker.line.color",f?void 0:s.paper_bgcolor);var h=c("marker.colors");t(c,"marker.pattern",h),i.marker&&!n.marker.pattern.fgcolor&&(n.marker.pattern.fgcolor=i.marker.colors),n.marker.pattern.bgcolor||(n.marker.pattern.bgcolor=s.paper_bgcolor)}function a(i,n,s,c){function f(m,R){return x.coerce(i,n,A,m,R)}var v=f("labels"),h=f("values"),T=r(v,h),l=T.len;if(n._hasLabels=T.hasLabels,n._hasValues=T.hasValues,!n._hasLabels&&n._hasValues&&(f("label0"),f("dlabel")),!l){n.visible=!1;return}n._length=l,o(i,n,c,f,!0),f("scalegroup");var y=f("text"),b=f("texttemplate"),S;if(b||(S=f("textinfo",x.isArrayOrTypedArray(y)?"text+percent":"percent")),f("hovertext"),f("hovertemplate"),b||S&&S!=="none"){var M=f("textposition");e(i,n,c,f,M,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var _=Array.isArray(M)||M==="auto",w=_||M==="outside";w&&f("automargin"),(M==="inside"||M==="auto"||Array.isArray(M))&&f("insidetextorientation")}else S==="none"&&f("textposition","none");E(n,c,f);var p=f("hole"),u=f("title.text");if(u){var g=f("title.position",p?"middle center":"top center");!p&&g==="middle center"&&(n.title.position="top center"),x.coerceFont(f,"title.font",c.font)}f("sort"),f("direction"),f("rotation"),f("pull")}G.exports={handleLabelsAndValues:r,handleMarkerDefaults:o,supplyDefaults:a}}}),r_=He({"src/traces/pie/layout_attributes.js"(Y,G){G.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),sC=He({"src/traces/pie/layout_defaults.js"(Y,G){var d=Gr(),x=r_();G.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("hiddenlabels"),t("piecolorway",e.colorway),t("extendpiecolors")}}}),tg=He({"src/traces/pie/calc.js"(Y,G){var d=Hi(),x=Mf(),A=Ai(),E={};function e(a,i){var n=[],s=a._fullLayout,c=s.hiddenlabels||[],f=i.labels,v=i.marker.colors||[],h=i.values,T=i._length,l=i._hasValues&&T,y,b;if(i.dlabel)for(f=new Array(T),y=0;y=0});var R=i.type==="funnelarea"?w:i.sort;return R&&n.sort(function(P,z){return z.v-P.v}),n[0]&&(n[0].vTotal=_),n}function t(a){return function(n,s){return!n||(n=x(n),!n.isValid())?!1:(n=A.addOpacity(n,n.getAlpha()),a[s]||(a[s]=n),n)}}function r(a,i){var n=(i||{}).type;n||(n="pie");var s=a._fullLayout,c=a.calcdata,f=s[n+"colorway"],v=s["_"+n+"colormap"];s["extend"+n+"colors"]&&(f=o(f,E));for(var h=0,T=0;T0&&($e+=St*ce.pxmid[0],rt+=St*ce.pxmid[1])}ce.cxFinal=$e,ce.cyFinal=rt;function Rt(pt,ze,Ge,Oe){var ve=Oe*(ze[0]-pt[0]),ge=Oe*(ze[1]-pt[1]);return"a"+Oe*fe.r+","+Oe*fe.r+" 0 "+ce.largeArc+(Ge?" 1 ":" 0 ")+ve+","+ge}var Ut=we.hole;if(ce.v===fe.vTotal){var ir="M"+($e+ce.px0[0])+","+(rt+ce.px0[1])+Rt(ce.px0,ce.pxmid,!0,1)+Rt(ce.pxmid,ce.px0,!0,1)+"Z";Ut?At.attr("d","M"+($e+Ut*ce.px0[0])+","+(rt+Ut*ce.px0[1])+Rt(ce.px0,ce.pxmid,!1,Ut)+Rt(ce.pxmid,ce.px0,!1,Ut)+"Z"+ir):At.attr("d",ir)}else{var ar=Rt(ce.px0,ce.px1,!0,1);if(Ut){var Mr=1-Ut;At.attr("d","M"+($e+Ut*ce.px1[0])+","+(rt+Ut*ce.px1[1])+Rt(ce.px1,ce.px0,!1,Ut)+"l"+Mr*ce.px0[0]+","+Mr*ce.px0[1]+ar+"Z")}else At.attr("d","M"+$e+","+rt+"l"+ce.px0[0]+","+ce.px0[1]+ar+"Z")}le(J,ce,fe);var fr=f.castOption(we.textposition,ce.pts),dr=Je.selectAll("g.slicetext").data(ce.text&&fr!=="none"?[0]:[]);dr.enter().append("g").classed("slicetext",!0),dr.exit().remove(),dr.each(function(){var pt=t.ensureSingle(d.select(this),"text","",function(We){We.attr("data-notex",1)}),ze=t.ensureUniformFontSize(J,fr==="outside"?b(we,ce,re.font):S(we,ce,re.font));pt.text(ce.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(e.font,ze).call(a.convertToTspans,J);var Ge=e.bBox(pt.node()),Oe;if(fr==="outside")Oe=z(Ge,ce);else if(Oe=_(Ge,ce,fe),fr==="auto"&&Oe.scale<1){var ve=t.ensureUniformFontSize(J,we.outsidetextfont);pt.call(e.font,ve),Ge=e.bBox(pt.node()),Oe=z(Ge,ce)}var ge=Oe.textPosAngle,be=ge===void 0?ce.pxmid:oe(fe.r,ge);if(Oe.targetX=$e+be[0]*Oe.rCenter+(Oe.x||0),Oe.targetY=rt+be[1]*Oe.rCenter+(Oe.y||0),j(Oe,Ge),Oe.outside){var Pe=Oe.targetY;ce.yLabelMin=Pe-Ge.height/2,ce.yLabelMid=Pe,ce.yLabelMax=Pe+Ge.height/2,ce.labelExtraX=0,ce.labelExtraY=0,Ce=!0}Oe.fontSize=ze.size,n(we.type,Oe,re),ae[Re].transform=Oe,t.setTransormAndDisplay(pt,Oe)})});var qe=d.select(this).selectAll("g.titletext").data(we.title.text?[0]:[]);if(qe.enter().append("g").classed("titletext",!0),qe.exit().remove(),qe.each(function(){var ce=t.ensureSingle(d.select(this),"text","",function(rt){rt.attr("data-notex",1)}),Re=we.title.text;we._meta&&(Re=t.templateString(Re,we._meta)),ce.text(Re).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(e.font,we.title.font).call(a.convertToTspans,J);var $e;we.title.position==="middle center"?$e=F(fe):$e=B(fe,ee),ce.attr("transform",o($e.x,$e.y)+r(Math.min(1,$e.scale))+o($e.tx,$e.ty))}),Ce&&U(Fe,we),l(Ae,we),Ce&&we.automargin){var et=e.bBox(ie.node()),Qe=we.domain,Ke=ee.w*(Qe.x[1]-Qe.x[0]),Xe=ee.h*(Qe.y[1]-Qe.y[0]),Me=(.5*Ke-fe.r)/ee.w,xe=(.5*Xe-fe.r)/ee.h;x.autoMargin(J,"pie."+we.uid+".automargin",{xl:Qe.x[0]-Me,xr:Qe.x[1]+Me,yb:Qe.y[0]-xe,yt:Qe.y[1]+xe,l:Math.max(fe.cx-fe.r-et.left,0),r:Math.max(et.right-(fe.cx+fe.r),0),b:Math.max(et.bottom-(fe.cy+fe.r),0),t:Math.max(fe.cy-fe.r-et.top,0),pad:5})}})});setTimeout(function(){q.selectAll("tspan").each(function(){var ae=d.select(this);ae.attr("dy")&&ae.attr("dy",ae.attr("dy"))})},0)}function l(J,$){J.each(function(X){var re=d.select(this);if(!X.labelExtraX&&!X.labelExtraY){re.select("path.textline").remove();return}var ee=re.select("g.slicetext text");X.transform.targetX+=X.labelExtraX,X.transform.targetY+=X.labelExtraY,t.setTransormAndDisplay(ee,X.transform);var q=X.cxFinal+X.pxmid[0],ae=X.cyFinal+X.pxmid[1],ie="M"+q+","+ae,fe=(X.yLabelMax-X.yLabelMin)*(X.pxmid[0]<0?-1:1)/4;if(X.labelExtraX){var we=X.labelExtraX*X.pxmid[1]/X.pxmid[0],Ae=X.yLabelMid+X.labelExtraY-(X.cyFinal+X.pxmid[1]);Math.abs(we)>Math.abs(Ae)?ie+="l"+Ae*X.pxmid[0]/X.pxmid[1]+","+Ae+"H"+(q+X.labelExtraX+fe):ie+="l"+X.labelExtraX+","+we+"v"+(Ae-we)+"h"+fe}else ie+="V"+(X.yLabelMid+X.labelExtraY)+"h"+fe;t.ensureSingle(re,"path","textline").call(E.stroke,$.outsidetextfont.color).attr({"stroke-width":Math.min(2,$.outsidetextfont.size/8),d:ie,fill:"none"})})}function y(J,$,X){var re=X[0],ee=re.cx,q=re.cy,ae=re.trace,ie=ae.type==="funnelarea";"_hasHoverLabel"in ae||(ae._hasHoverLabel=!1),"_hasHoverEvent"in ae||(ae._hasHoverEvent=!1),J.on("mouseover",function(fe){var we=$._fullLayout,Ae=$._fullData[ae.index];if(!($._dragging||we.hovermode===!1)){var Fe=Ae.hoverinfo;if(Array.isArray(Fe)&&(Fe=A.castHoverinfo({hoverinfo:[f.castOption(Fe,fe.pts)],_module:ae._module},we,0)),Fe==="all"&&(Fe="label+text+value+percent+name"),Ae.hovertemplate||Fe!=="none"&&Fe!=="skip"&&Fe){var Ce=fe.rInscribed||0,qe=ee+fe.pxmid[0]*(1-Ce),et=q+fe.pxmid[1]*(1-Ce),Qe=we.separators,Ke=[];if(Fe&&Fe.indexOf("label")!==-1&&Ke.push(fe.label),fe.text=f.castOption(Ae.hovertext||Ae.text,fe.pts),Fe&&Fe.indexOf("text")!==-1){var Xe=fe.text;t.isValidTextValue(Xe)&&Ke.push(Xe)}fe.value=fe.v,fe.valueLabel=f.formatPieValue(fe.v,Qe),Fe&&Fe.indexOf("value")!==-1&&Ke.push(fe.valueLabel),fe.percent=fe.v/re.vTotal,fe.percentLabel=f.formatPiePercent(fe.percent,Qe),Fe&&Fe.indexOf("percent")!==-1&&Ke.push(fe.percentLabel);var Me=Ae.hoverlabel,xe=Me.font,ce=[];A.loneHover({trace:ae,x0:qe-Ce*re.r,x1:qe+Ce*re.r,y:et,_x0:ie?ee+fe.TL[0]:qe-Ce*re.r,_x1:ie?ee+fe.TR[0]:qe+Ce*re.r,_y0:ie?q+fe.TL[1]:et-Ce*re.r,_y1:ie?q+fe.BL[1]:et+Ce*re.r,text:Ke.join("
"),name:Ae.hovertemplate||Fe.indexOf("name")!==-1?Ae.name:void 0,idealAlign:fe.pxmid[0]<0?"left":"right",color:f.castOption(Me.bgcolor,fe.pts)||fe.color,borderColor:f.castOption(Me.bordercolor,fe.pts),fontFamily:f.castOption(xe.family,fe.pts),fontSize:f.castOption(xe.size,fe.pts),fontColor:f.castOption(xe.color,fe.pts),nameLength:f.castOption(Me.namelength,fe.pts),textAlign:f.castOption(Me.align,fe.pts),hovertemplate:f.castOption(Ae.hovertemplate,fe.pts),hovertemplateLabels:fe,eventData:[v(fe,Ae)]},{container:we._hoverlayer.node(),outerContainer:we._paper.node(),gd:$,inOut_bbox:ce}),fe.bbox=ce[0],ae._hasHoverLabel=!0}ae._hasHoverEvent=!0,$.emit("plotly_hover",{points:[v(fe,Ae)],event:d.event})}}),J.on("mouseout",function(fe){var we=$._fullLayout,Ae=$._fullData[ae.index],Fe=d.select(this).datum();ae._hasHoverEvent&&(fe.originalEvent=d.event,$.emit("plotly_unhover",{points:[v(Fe,Ae)],event:d.event}),ae._hasHoverEvent=!1),ae._hasHoverLabel&&(A.loneUnhover(we._hoverlayer.node()),ae._hasHoverLabel=!1)}),J.on("click",function(fe){var we=$._fullLayout,Ae=$._fullData[ae.index];$._dragging||we.hovermode===!1||($._hoverdata=[v(fe,Ae)],A.click($,d.event))})}function b(J,$,X){var re=f.castOption(J.outsidetextfont.color,$.pts)||f.castOption(J.textfont.color,$.pts)||X.color,ee=f.castOption(J.outsidetextfont.family,$.pts)||f.castOption(J.textfont.family,$.pts)||X.family,q=f.castOption(J.outsidetextfont.size,$.pts)||f.castOption(J.textfont.size,$.pts)||X.size,ae=f.castOption(J.outsidetextfont.weight,$.pts)||f.castOption(J.textfont.weight,$.pts)||X.weight,ie=f.castOption(J.outsidetextfont.style,$.pts)||f.castOption(J.textfont.style,$.pts)||X.style,fe=f.castOption(J.outsidetextfont.variant,$.pts)||f.castOption(J.textfont.variant,$.pts)||X.variant,we=f.castOption(J.outsidetextfont.textcase,$.pts)||f.castOption(J.textfont.textcase,$.pts)||X.textcase,Ae=f.castOption(J.outsidetextfont.lineposition,$.pts)||f.castOption(J.textfont.lineposition,$.pts)||X.lineposition,Fe=f.castOption(J.outsidetextfont.shadow,$.pts)||f.castOption(J.textfont.shadow,$.pts)||X.shadow;return{color:re,family:ee,size:q,weight:ae,style:ie,variant:fe,textcase:we,lineposition:Ae,shadow:Fe}}function S(J,$,X){var re=f.castOption(J.insidetextfont.color,$.pts);!re&&J._input.textfont&&(re=f.castOption(J._input.textfont.color,$.pts));var ee=f.castOption(J.insidetextfont.family,$.pts)||f.castOption(J.textfont.family,$.pts)||X.family,q=f.castOption(J.insidetextfont.size,$.pts)||f.castOption(J.textfont.size,$.pts)||X.size,ae=f.castOption(J.insidetextfont.weight,$.pts)||f.castOption(J.textfont.weight,$.pts)||X.weight,ie=f.castOption(J.insidetextfont.style,$.pts)||f.castOption(J.textfont.style,$.pts)||X.style,fe=f.castOption(J.insidetextfont.variant,$.pts)||f.castOption(J.textfont.variant,$.pts)||X.variant,we=f.castOption(J.insidetextfont.textcase,$.pts)||f.castOption(J.textfont.textcase,$.pts)||X.textcase,Ae=f.castOption(J.insidetextfont.lineposition,$.pts)||f.castOption(J.textfont.lineposition,$.pts)||X.lineposition,Fe=f.castOption(J.insidetextfont.shadow,$.pts)||f.castOption(J.textfont.shadow,$.pts)||X.shadow;return{color:re||E.contrast($.color),family:ee,size:q,weight:ae,style:ie,variant:fe,textcase:we,lineposition:Ae,shadow:Fe}}function M(J,$){for(var X,re,ee=0;ee=-4;Me-=2)Xe(Math.PI*Me,"tan");for(Me=4;Me>=-4;Me-=2)Xe(Math.PI*(Me+1),"tan")}if(Fe||qe){for(Me=4;Me>=-4;Me-=2)Xe(Math.PI*(Me+1.5),"rad");for(Me=4;Me>=-4;Me-=2)Xe(Math.PI*(Me+.5),"rad")}}if(ie||et||Fe){var xe=Math.sqrt(J.width*J.width+J.height*J.height);if(Ke={scale:ee*re*2/xe,rCenter:1-ee,rotate:0},Ke.textPosAngle=($.startangle+$.stopangle)/2,Ke.scale>=1)return Ke;Qe.push(Ke)}(et||qe)&&(Ke=p(J,re,ae,fe,we),Ke.textPosAngle=($.startangle+$.stopangle)/2,Qe.push(Ke)),(et||Ce)&&(Ke=u(J,re,ae,fe,we),Ke.textPosAngle=($.startangle+$.stopangle)/2,Qe.push(Ke));for(var ce=0,Re=0,$e=0;$e=1)break}return Qe[ce]}function w(J,$){var X=J.startangle,re=J.stopangle;return X>$&&$>re||X<$&&$0?1:-1)/2,y:q/(1+X*X/(re*re)),outside:!0}}function F(J){var $=Math.sqrt(J.titleBox.width*J.titleBox.width+J.titleBox.height*J.titleBox.height);return{x:J.cx,y:J.cy,scale:J.trace.hole*J.r*2/$,tx:0,ty:-J.titleBox.height/2+J.trace.title.font.size}}function B(J,$){var X=1,re=1,ee,q=J.trace,ae={x:J.cx,y:J.cy},ie={tx:0,ty:0};ie.ty+=q.title.font.size,ee=N(q),q.title.position.indexOf("top")!==-1?(ae.y-=(1+ee)*J.r,ie.ty-=J.titleBox.height):q.title.position.indexOf("bottom")!==-1&&(ae.y+=(1+ee)*J.r);var fe=O(J.r,J.trace.aspectratio),we=$.w*(q.domain.x[1]-q.domain.x[0])/2;return q.title.position.indexOf("left")!==-1?(we=we+fe,ae.x-=(1+ee)*fe,ie.tx+=J.titleBox.width/2):q.title.position.indexOf("center")!==-1?we*=2:q.title.position.indexOf("right")!==-1&&(we=we+fe,ae.x+=(1+ee)*fe,ie.tx-=J.titleBox.width/2),X=we/J.titleBox.width,re=L(J,$)/J.titleBox.height,{x:ae.x,y:ae.y,scale:Math.min(X,re),tx:ie.tx,ty:ie.ty}}function O(J,$){return J/($===void 0?1:$)}function L(J,$){var X=J.trace,re=$.h*(X.domain.y[1]-X.domain.y[0]);return Math.min(J.titleBox.height,re/2)}function N(J){var $=J.pull;if(!$)return 0;var X;if(t.isArrayOrTypedArray($))for($=0,X=0;X$&&($=J.pull[X]);return $}function U(J,$){var X,re,ee,q,ae,ie,fe,we,Ae,Fe,Ce,qe,et;function Qe(xe,ce){return xe.pxmid[1]-ce.pxmid[1]}function Ke(xe,ce){return ce.pxmid[1]-xe.pxmid[1]}function Xe(xe,ce){ce||(ce={});var Re=ce.labelExtraY+(re?ce.yLabelMax:ce.yLabelMin),$e=re?xe.yLabelMin:xe.yLabelMax,rt=re?xe.yLabelMax:xe.yLabelMin,Je=xe.cyFinal+ae(xe.px0[1],xe.px1[1]),At=Re-$e,St,Rt,Ut,ir,ar,Mr;if(At*fe>0&&(xe.labelExtraY=At),!!t.isArrayOrTypedArray($.pull))for(Rt=0;Rt=(f.castOption($.pull,Ut.pts)||0))&&((xe.pxmid[1]-Ut.pxmid[1])*fe>0?(ir=Ut.cyFinal+ae(Ut.px0[1],Ut.px1[1]),At=ir-$e-xe.labelExtraY,At*fe>0&&(xe.labelExtraY+=At)):(rt+xe.labelExtraY-Je)*fe>0&&(St=3*ie*Math.abs(Rt-Fe.indexOf(xe)),ar=Ut.cxFinal+q(Ut.px0[0],Ut.px1[0]),Mr=ar+St-(xe.cxFinal+xe.pxmid[0])-xe.labelExtraX,Mr*ie>0&&(xe.labelExtraX+=Mr)))}for(re=0;re<2;re++)for(ee=re?Qe:Ke,ae=re?Math.max:Math.min,fe=re?1:-1,X=0;X<2;X++){for(q=X?Math.max:Math.min,ie=X?1:-1,we=J[re][X],we.sort(ee),Ae=J[1-re][X],Fe=Ae.concat(we),qe=[],Ce=0;Ce1?(we=X.r,Ae=we/ee.aspectratio):(Ae=X.r,we=Ae*ee.aspectratio),we*=(1+ee.baseratio)/2,fe=we*Ae}ae=Math.min(ae,fe/X.vTotal)}for(re=0;re$.vTotal/2?1:0,we.halfangle=Math.PI*Math.min(we.v/$.vTotal,.5),we.ring=1-re.hole,we.rInscribed=P(we,$))}function oe(J,$){return[J*Math.sin($),-J*Math.cos($)]}function le(J,$,X){var re=J._fullLayout,ee=X.trace,q=ee.texttemplate,ae=ee.textinfo;if(!q&&ae&&ae!=="none"){var ie=ae.split("+"),fe=function(ce){return ie.indexOf(ce)!==-1},we=fe("label"),Ae=fe("text"),Fe=fe("value"),Ce=fe("percent"),qe=re.separators,et;if(et=we?[$.label]:[],Ae){var Qe=f.getFirstFilled(ee.text,$.pts);h(Qe)&&et.push(Qe)}Fe&&et.push(f.formatPieValue($.v,qe)),Ce&&et.push(f.formatPiePercent($.v/X.vTotal,qe)),$.text=et.join("
")}function Ke(ce){return{label:ce.label,value:ce.v,valueLabel:f.formatPieValue(ce.v,re.separators),percent:ce.v/X.vTotal,percentLabel:f.formatPiePercent(ce.v/X.vTotal,re.separators),color:ce.color,text:ce.text,customdata:t.castOption(ee,ce.i,"customdata")}}if(q){var Xe=t.castOption(ee,$.i,"texttemplate");if(!Xe)$.text="";else{var Me=Ke($),xe=f.getFirstFilled(ee.text,$.pts);(h(xe)||xe==="")&&(Me.text=xe),$.text=t.texttemplateString(Xe,Me,J._fullLayout._d3locale,Me,ee._meta||{})}}}function j(J,$){var X=J.rotate*Math.PI/180,re=Math.cos(X),ee=Math.sin(X),q=($.left+$.right)/2,ae=($.top+$.bottom)/2;J.textX=q*re-ae*ee,J.textY=q*ee+ae*re,J.noCenter=!0}G.exports={plot:T,formatSliceLabel:le,transformInsideText:_,determineInsideTextFont:S,positionTitleOutside:B,prerenderTitles:M,layoutAreas:Z,attachFxHandlers:y,computeTransform:j}}}),uC=He({"src/traces/pie/style.js"(Y,G){var d=Qn(),x=U0(),A=hh().resizeText;G.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");A(e,t,"pie"),t.each(function(r){var o=r[0],a=o.trace,i=d.select(this);i.style({opacity:a.opacity}),i.selectAll("path.surface").each(function(n){d.select(this).call(x,n,a,e)})})}}}),cC=He({"src/traces/pie/base_plot.js"(Y){var G=yu();Y.name="pie",Y.plot=function(d,x,A,E){G.plotBasePlot(Y.name,d,x,A,E)},Y.clean=function(d,x,A,E){G.cleanBasePlot(Y.name,d,x,A,E)}}}),fC=He({"src/traces/pie/index.js"(Y,G){G.exports={attributes:Bp(),supplyDefaults:Np().supplyDefaults,supplyLayoutDefaults:sC(),layoutAttributes:r_(),calc:tg().calc,crossTraceCalc:tg().crossTraceCalc,plot:a_().plot,style:uC(),styleOne:U0(),moduleType:"trace",name:"pie",basePlotModule:cC(),categories:["pie-like","pie","showLegend"],meta:{}}}}),hC=He({"lib/pie.js"(Y,G){G.exports=fC()}}),vC=He({"src/traces/sunburst/base_plot.js"(Y){var G=yu();Y.name="sunburst",Y.plot=function(d,x,A,E){G.plotBasePlot(Y.name,d,x,A,E)},Y.clean=function(d,x,A,E){G.cleanBasePlot(Y.name,d,x,A,E)}}}),d2=He({"src/traces/sunburst/constants.js"(Y,G){G.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),xy=He({"src/traces/sunburst/attributes.js"(Y,G){var d=cl(),x=Yo().hovertemplateAttrs,A=Yo().texttemplateAttrs,E=kl(),e=mu().attributes,t=Bp(),r=d2(),o=ho().extendFlat,a=Nf().pattern;G.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:o({colors:{valType:"data_array",editType:"calc"},line:{color:o({},t.marker.line.color,{dflt:null}),width:o({},t.marker.line.width,{dflt:1}),editType:"calc"},pattern:a,editType:"calc"},E("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:t.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:A({editType:"plot"},{keys:r.eventDataKeys.concat(["label","value"])}),hovertext:t.hovertext,hoverinfo:o({},d.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:x({},{keys:r.eventDataKeys}),textfont:t.textfont,insidetextorientation:t.insidetextorientation,insidetextfont:t.insidetextfont,outsidetextfont:o({},t.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:t.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:e({name:"sunburst",trace:!0,editType:"calc"})}}}),p2=He({"src/traces/sunburst/layout_attributes.js"(Y,G){G.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),dC=He({"src/traces/sunburst/defaults.js"(Y,G){var d=Gr(),x=xy(),A=mu().defaults,E=Jh().handleText,e=Np().handleMarkerDefaults,t=Kl(),r=t.hasColorscale,o=t.handleDefaults;G.exports=function(i,n,s,c){function f(S,M){return d.coerce(i,n,x,S,M)}var v=f("labels"),h=f("parents");if(!v||!v.length||!h||!h.length){n.visible=!1;return}var T=f("values");T&&T.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),e(i,n,c,f);var l=n._hasColorscale=r(i,"marker","colors")||(i.marker||{}).coloraxis;l&&o(i,n,c,f,{prefix:"marker.",cLetter:"c"}),f("leaf.opacity",l?1:.7);var y=f("text");f("texttemplate"),n.texttemplate||f("textinfo",d.isArrayOrTypedArray(y)?"text+label":"label"),f("hovertext"),f("hovertemplate");var b="auto";E(i,n,c,f,b,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("insidetextorientation"),f("sort"),f("rotation"),f("root.color"),A(n,c,f),n._length=null}}}),pC=He({"src/traces/sunburst/layout_defaults.js"(Y,G){var d=Gr(),x=p2();G.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("sunburstcolorway",e.colorway),t("extendsunburstcolors")}}}),by=He({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y):(d=d||self,x(d.d3=d.d3||{}))})(Y,function(d){function x(Oe,ve){return Oe.parent===ve.parent?1:2}function A(Oe){return Oe.reduce(E,0)/Oe.length}function E(Oe,ve){return Oe+ve.x}function e(Oe){return 1+Oe.reduce(t,0)}function t(Oe,ve){return Math.max(Oe,ve.y)}function r(Oe){for(var ve;ve=Oe.children;)Oe=ve[0];return Oe}function o(Oe){for(var ve;ve=Oe.children;)Oe=ve[ve.length-1];return Oe}function a(){var Oe=x,ve=1,ge=1,be=!1;function Pe(We){var ct,_t=0;We.eachAfter(function(Zt){var lr=Zt.children;lr?(Zt.x=A(lr),Zt.y=e(lr)):(Zt.x=ct?_t+=Oe(Zt,ct):0,Zt.y=0,ct=Zt)});var Mt=r(We),Nt=o(We),Bt=Mt.x-Oe(Mt,Nt)/2,qt=Nt.x+Oe(Nt,Mt)/2;return We.eachAfter(be?function(Zt){Zt.x=(Zt.x-We.x)*ve,Zt.y=(We.y-Zt.y)*ge}:function(Zt){Zt.x=(Zt.x-Bt)/(qt-Bt)*ve,Zt.y=(1-(We.y?Zt.y/We.y:1))*ge})}return Pe.separation=function(We){return arguments.length?(Oe=We,Pe):Oe},Pe.size=function(We){return arguments.length?(be=!1,ve=+We[0],ge=+We[1],Pe):be?null:[ve,ge]},Pe.nodeSize=function(We){return arguments.length?(be=!0,ve=+We[0],ge=+We[1],Pe):be?[ve,ge]:null},Pe}function i(Oe){var ve=0,ge=Oe.children,be=ge&&ge.length;if(!be)ve=1;else for(;--be>=0;)ve+=ge[be].value;Oe.value=ve}function n(){return this.eachAfter(i)}function s(Oe){var ve=this,ge,be=[ve],Pe,We,ct;do for(ge=be.reverse(),be=[];ve=ge.pop();)if(Oe(ve),Pe=ve.children,Pe)for(We=0,ct=Pe.length;We=0;--Pe)ge.push(be[Pe]);return this}function f(Oe){for(var ve=this,ge=[ve],be=[],Pe,We,ct;ve=ge.pop();)if(be.push(ve),Pe=ve.children,Pe)for(We=0,ct=Pe.length;We=0;)ge+=be[Pe].value;ve.value=ge})}function h(Oe){return this.eachBefore(function(ve){ve.children&&ve.children.sort(Oe)})}function T(Oe){for(var ve=this,ge=l(ve,Oe),be=[ve];ve!==ge;)ve=ve.parent,be.push(ve);for(var Pe=be.length;Oe!==ge;)be.splice(Pe,0,Oe),Oe=Oe.parent;return be}function l(Oe,ve){if(Oe===ve)return Oe;var ge=Oe.ancestors(),be=ve.ancestors(),Pe=null;for(Oe=ge.pop(),ve=be.pop();Oe===ve;)Pe=Oe,Oe=ge.pop(),ve=be.pop();return Pe}function y(){for(var Oe=this,ve=[Oe];Oe=Oe.parent;)ve.push(Oe);return ve}function b(){var Oe=[];return this.each(function(ve){Oe.push(ve)}),Oe}function S(){var Oe=[];return this.eachBefore(function(ve){ve.children||Oe.push(ve)}),Oe}function M(){var Oe=this,ve=[];return Oe.each(function(ge){ge!==Oe&&ve.push({source:ge.parent,target:ge})}),ve}function _(Oe,ve){var ge=new m(Oe),be=+Oe.value&&(ge.value=Oe.value),Pe,We=[ge],ct,_t,Mt,Nt;for(ve==null&&(ve=p);Pe=We.pop();)if(be&&(Pe.value=+Pe.data.value),(_t=ve(Pe.data))&&(Nt=_t.length))for(Pe.children=new Array(Nt),Mt=Nt-1;Mt>=0;--Mt)We.push(ct=Pe.children[Mt]=new m(_t[Mt])),ct.parent=Pe,ct.depth=Pe.depth+1;return ge.eachBefore(g)}function w(){return _(this).eachBefore(u)}function p(Oe){return Oe.children}function u(Oe){Oe.data=Oe.data.data}function g(Oe){var ve=0;do Oe.height=ve;while((Oe=Oe.parent)&&Oe.height<++ve)}function m(Oe){this.data=Oe,this.depth=this.height=0,this.parent=null}m.prototype=_.prototype={constructor:m,count:n,each:s,eachAfter:f,eachBefore:c,sum:v,sort:h,path:T,ancestors:y,descendants:b,leaves:S,links:M,copy:w};var R=Array.prototype.slice;function P(Oe){for(var ve=Oe.length,ge,be;ve;)be=Math.random()*ve--|0,ge=Oe[ve],Oe[ve]=Oe[be],Oe[be]=ge;return Oe}function z(Oe){for(var ve=0,ge=(Oe=P(R.call(Oe))).length,be=[],Pe,We;ve0&&ge*ge>be*be+Pe*Pe}function L(Oe,ve){for(var ge=0;geMt?(Pe=(Nt+Mt-We)/(2*Nt),_t=Math.sqrt(Math.max(0,Mt/Nt-Pe*Pe)),ge.x=Oe.x-Pe*be-_t*ct,ge.y=Oe.y-Pe*ct+_t*be):(Pe=(Nt+We-Mt)/(2*Nt),_t=Math.sqrt(Math.max(0,We/Nt-Pe*Pe)),ge.x=ve.x+Pe*be-_t*ct,ge.y=ve.y+Pe*ct+_t*be)):(ge.x=ve.x+ge.r,ge.y=ve.y)}function oe(Oe,ve){var ge=Oe.r+ve.r-1e-6,be=ve.x-Oe.x,Pe=ve.y-Oe.y;return ge>0&&ge*ge>be*be+Pe*Pe}function le(Oe){var ve=Oe._,ge=Oe.next._,be=ve.r+ge.r,Pe=(ve.x*ge.r+ge.x*ve.r)/be,We=(ve.y*ge.r+ge.y*ve.r)/be;return Pe*Pe+We*We}function j(Oe){this._=Oe,this.next=null,this.previous=null}function J(Oe){if(!(Pe=Oe.length))return 0;var ve,ge,be,Pe,We,ct,_t,Mt,Nt,Bt,qt;if(ve=Oe[0],ve.x=0,ve.y=0,!(Pe>1))return ve.r;if(ge=Oe[1],ve.x=-ge.r,ge.x=ve.r,ge.y=0,!(Pe>2))return ve.r+ge.r;ue(ge,ve,be=Oe[2]),ve=new j(ve),ge=new j(ge),be=new j(be),ve.next=be.previous=ge,ge.next=ve.previous=be,be.next=ge.previous=ve;e:for(_t=3;_t0)throw new Error("cycle");return _t}return ge.id=function(be){return arguments.length?(Oe=re(be),ge):Oe},ge.parentId=function(be){return arguments.length?(ve=re(be),ge):ve},ge}function ce(Oe,ve){return Oe.parent===ve.parent?1:2}function Re(Oe){var ve=Oe.children;return ve?ve[0]:Oe.t}function $e(Oe){var ve=Oe.children;return ve?ve[ve.length-1]:Oe.t}function rt(Oe,ve,ge){var be=ge/(ve.i-Oe.i);ve.c-=be,ve.s+=ge,Oe.c+=be,ve.z+=ge,ve.m+=ge}function Je(Oe){for(var ve=0,ge=0,be=Oe.children,Pe=be.length,We;--Pe>=0;)We=be[Pe],We.z+=ve,We.m+=ve,ve+=We.s+(ge+=We.c)}function At(Oe,ve,ge){return Oe.a.parent===ve.parent?Oe.a:ge}function St(Oe,ve){this._=Oe,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=ve}St.prototype=Object.create(m.prototype);function Rt(Oe){for(var ve=new St(Oe,0),ge,be=[ve],Pe,We,ct,_t;ge=be.pop();)if(We=ge._.children)for(ge.children=new Array(_t=We.length),ct=_t-1;ct>=0;--ct)be.push(Pe=ge.children[ct]=new St(We[ct],ct)),Pe.parent=ge;return(ve.parent=new St(null,0)).children=[ve],ve}function Ut(){var Oe=ce,ve=1,ge=1,be=null;function Pe(Nt){var Bt=Rt(Nt);if(Bt.eachAfter(We),Bt.parent.m=-Bt.z,Bt.eachBefore(ct),be)Nt.eachBefore(Mt);else{var qt=Nt,Zt=Nt,lr=Nt;Nt.eachBefore(function(Ia){Ia.xZt.x&&(Zt=Ia),Ia.depth>lr.depth&&(lr=Ia)});var ta=qt===Zt?1:Oe(qt,Zt)/2,da=ta-qt.x,wa=ve/(Zt.x+ta+da),ma=ge/(lr.depth||1);Nt.eachBefore(function(Ia){Ia.x=(Ia.x+da)*wa,Ia.y=Ia.depth*ma})}return Nt}function We(Nt){var Bt=Nt.children,qt=Nt.parent.children,Zt=Nt.i?qt[Nt.i-1]:null;if(Bt){Je(Nt);var lr=(Bt[0].z+Bt[Bt.length-1].z)/2;Zt?(Nt.z=Zt.z+Oe(Nt._,Zt._),Nt.m=Nt.z-lr):Nt.z=lr}else Zt&&(Nt.z=Zt.z+Oe(Nt._,Zt._));Nt.parent.A=_t(Nt,Zt,Nt.parent.A||qt[0])}function ct(Nt){Nt._.x=Nt.z+Nt.parent.m,Nt.m+=Nt.parent.m}function _t(Nt,Bt,qt){if(Bt){for(var Zt=Nt,lr=Nt,ta=Bt,da=Zt.parent.children[0],wa=Zt.m,ma=lr.m,Ia=ta.m,va=da.m,La;ta=$e(ta),Zt=Re(Zt),ta&&Zt;)da=Re(da),lr=$e(lr),lr.a=Nt,La=ta.z+Ia-Zt.z-wa+Oe(ta._,Zt._),La>0&&(rt(At(ta,Nt,qt),Nt,La),wa+=La,ma+=La),Ia+=ta.m,wa+=Zt.m,va+=da.m,ma+=lr.m;ta&&!$e(lr)&&(lr.t=ta,lr.m+=Ia-ma),Zt&&!Re(da)&&(da.t=Zt,da.m+=wa-va,qt=Nt)}return qt}function Mt(Nt){Nt.x*=ve,Nt.y=Nt.depth*ge}return Pe.separation=function(Nt){return arguments.length?(Oe=Nt,Pe):Oe},Pe.size=function(Nt){return arguments.length?(be=!1,ve=+Nt[0],ge=+Nt[1],Pe):be?null:[ve,ge]},Pe.nodeSize=function(Nt){return arguments.length?(be=!0,ve=+Nt[0],ge=+Nt[1],Pe):be?[ve,ge]:null},Pe}function ir(Oe,ve,ge,be,Pe){for(var We=Oe.children,ct,_t=-1,Mt=We.length,Nt=Oe.value&&(Pe-ge)/Oe.value;++_tIa&&(Ia=Nt),Vt=wa*wa*Ka,va=Math.max(Ia/Vt,Vt/ma),va>La){wa-=Nt;break}La=va}ct.push(Mt={value:wa,dice:lr1?be:1)},ge}(ar);function dr(){var Oe=fr,ve=!1,ge=1,be=1,Pe=[0],We=ee,ct=ee,_t=ee,Mt=ee,Nt=ee;function Bt(Zt){return Zt.x0=Zt.y0=0,Zt.x1=ge,Zt.y1=be,Zt.eachBefore(qt),Pe=[0],ve&&Zt.eachBefore(Fe),Zt}function qt(Zt){var lr=Pe[Zt.depth],ta=Zt.x0+lr,da=Zt.y0+lr,wa=Zt.x1-lr,ma=Zt.y1-lr;wa=Zt-1){var Ia=We[qt];Ia.x0=ta,Ia.y0=da,Ia.x1=wa,Ia.y1=ma;return}for(var va=Nt[qt],La=lr/2+va,Ka=qt+1,Vt=Zt-1;Ka>>1;Nt[Lt]ma-da){var gr=(ta*Ot+wa*jt)/lr;Bt(qt,Ka,jt,ta,da,gr,ma),Bt(Ka,Zt,Ot,gr,da,wa,ma)}else{var Br=(da*Ot+ma*jt)/lr;Bt(qt,Ka,jt,ta,da,wa,Br),Bt(Ka,Zt,Ot,ta,Br,wa,ma)}}}function ze(Oe,ve,ge,be,Pe){(Oe.depth&1?ir:Ce)(Oe,ve,ge,be,Pe)}var Ge=function Oe(ve){function ge(be,Pe,We,ct,_t){if((Mt=be._squarify)&&Mt.ratio===ve)for(var Mt,Nt,Bt,qt,Zt=-1,lr,ta=Mt.length,da=be.value;++Zt1?be:1)},ge}(ar);d.cluster=a,d.hierarchy=_,d.pack=ie,d.packEnclose=z,d.packSiblings=$,d.partition=qe,d.stratify=xe,d.tree=Ut,d.treemap=dr,d.treemapBinary=pt,d.treemapDice=Ce,d.treemapResquarify=Ge,d.treemapSlice=ir,d.treemapSliceDice=ze,d.treemapSquarify=fr,Object.defineProperty(d,"__esModule",{value:!0})})}}),wy=He({"src/traces/sunburst/calc.js"(Y){var G=by(),d=Hi(),x=Gr(),A=Kl().makeColorScaleFuncFromTrace,E=tg().makePullColorFn,e=tg().generateExtendedColors,t=Kl().calc,r=lo().ALMOST_EQUAL,o={},a={},i={};Y.calc=function(s,c){var f=s._fullLayout,v=c.ids,h=x.isArrayOrTypedArray(v),T=c.labels,l=c.parents,y=c.values,b=x.isArrayOrTypedArray(y),S=[],M={},_={},w=function($,X){M[$]?M[$].push(X):M[$]=[X],_[X]=1},p=function($){return $||typeof $=="number"},u=function($){return!b||d(y[$])&&y[$]>=0},g,m,R;h?(g=Math.min(v.length,l.length),m=function($){return p(v[$])&&u($)},R=function($){return String(v[$])}):(g=Math.min(T.length,l.length),m=function($){return p(T[$])&&u($)},R=function($){return String(T[$])}),b&&(g=Math.min(g,y.length));for(var P=0;P1){for(var N=x.randstr(),U=0;U>8&15|G>>4&240,G>>4&15|G&240,(G&15)<<4|G&15,1):d===8?Ty(G>>24&255,G>>16&255,G>>8&255,(G&255)/255):d===4?Ty(G>>12&15|G>>8&240,G>>8&15|G>>4&240,G>>4&15|G&240,((G&15)<<4|G&15)/255):null):(G=S2.exec(Y))?new Vf(G[1],G[2],G[3],1):(G=M2.exec(Y))?new Vf(G[1]*255/100,G[2]*255/100,G[3]*255/100,1):(G=E2.exec(Y))?Ty(G[1],G[2],G[3],G[4]):(G=k2.exec(Y))?Ty(G[1]*255/100,G[2]*255/100,G[3]*255/100,G[4]):(G=C2.exec(Y))?b2(G[1],G[2]/100,G[3]/100,1):(G=L2.exec(Y))?b2(G[1],G[2]/100,G[3]/100,G[4]):l_.hasOwnProperty(Y)?m2(l_[Y]):Y==="transparent"?new Vf(NaN,NaN,NaN,0):null}function m2(Y){return new Vf(Y>>16&255,Y>>8&255,Y&255,1)}function Ty(Y,G,d,x){return x<=0&&(Y=G=d=NaN),new Vf(Y,G,d,x)}function i_(Y){return Y instanceof sd||(Y=ag(Y)),Y?(Y=Y.rgb(),new Vf(Y.r,Y.g,Y.b,Y.opacity)):new Vf}function Ay(Y,G,d,x){return arguments.length===1?i_(Y):new Vf(Y,G,d,x??1)}function Vf(Y,G,d,x){this.r=+Y,this.g=+G,this.b=+d,this.opacity=+x}function _2(){return`#${Kd(this.r)}${Kd(this.g)}${Kd(this.b)}`}function mC(){return`#${Kd(this.r)}${Kd(this.g)}${Kd(this.b)}${Kd((isNaN(this.opacity)?1:this.opacity)*255)}`}function x2(){const Y=Sy(this.opacity);return`${Y===1?"rgb(":"rgba("}${Yd(this.r)}, ${Yd(this.g)}, ${Yd(this.b)}${Y===1?")":`, ${Y})`}`}function Sy(Y){return isNaN(Y)?1:Math.max(0,Math.min(1,Y))}function Yd(Y){return Math.max(0,Math.min(255,Math.round(Y)||0))}function Kd(Y){return Y=Yd(Y),(Y<16?"0":"")+Y.toString(16)}function b2(Y,G,d,x){return x<=0?Y=G=d=NaN:d<=0||d>=1?Y=G=NaN:G<=0&&(Y=NaN),new cv(Y,G,d,x)}function w2(Y){if(Y instanceof cv)return new cv(Y.h,Y.s,Y.l,Y.opacity);if(Y instanceof sd||(Y=ag(Y)),!Y)return new cv;if(Y instanceof cv)return Y;Y=Y.rgb();var G=Y.r/255,d=Y.g/255,x=Y.b/255,A=Math.min(G,d,x),E=Math.max(G,d,x),e=NaN,t=E-A,r=(E+A)/2;return t?(G===E?e=(d-x)/t+(d0&&r<1?0:e,new cv(e,t,r,Y.opacity)}function o_(Y,G,d,x){return arguments.length===1?w2(Y):new cv(Y,G,d,x??1)}function cv(Y,G,d,x){this.h=+Y,this.s=+G,this.l=+d,this.opacity=+x}function T2(Y){return Y=(Y||0)%360,Y<0?Y+360:Y}function My(Y){return Math.max(0,Math.min(1,Y||0))}function s_(Y,G,d){return(Y<60?G+(d-G)*Y/60:Y<180?d:Y<240?G+(d-G)*(240-Y)/60:G)*255}var ld,Jd,$d,jp,fv,A2,S2,M2,E2,k2,C2,L2,l_,u_=ks({"node_modules/d3-color/src/color.js"(){n_(),ld=.7,Jd=1/ld,$d="\\s*([+-]?\\d+)\\s*",jp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",A2=/^#([0-9a-f]{3,8})$/,S2=new RegExp(`^rgb\\(${$d},${$d},${$d}\\)$`),M2=new RegExp(`^rgb\\(${fv},${fv},${fv}\\)$`),E2=new RegExp(`^rgba\\(${$d},${$d},${$d},${jp}\\)$`),k2=new RegExp(`^rgba\\(${fv},${fv},${fv},${jp}\\)$`),C2=new RegExp(`^hsl\\(${jp},${fv},${fv}\\)$`),L2=new RegExp(`^hsla\\(${jp},${fv},${fv},${jp}\\)$`),l_={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},Up(sd,ag,{copy(Y){return Object.assign(new this.constructor,this,Y)},displayable(){return this.rgb().displayable()},hex:g2,formatHex:g2,formatHex8:gC,formatHsl:yC,formatRgb:y2,toString:y2}),Up(Vf,Ay,rg(sd,{brighter(Y){return Y=Y==null?Jd:Math.pow(Jd,Y),new Vf(this.r*Y,this.g*Y,this.b*Y,this.opacity)},darker(Y){return Y=Y==null?ld:Math.pow(ld,Y),new Vf(this.r*Y,this.g*Y,this.b*Y,this.opacity)},rgb(){return this},clamp(){return new Vf(Yd(this.r),Yd(this.g),Yd(this.b),Sy(this.opacity))},displayable(){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:_2,formatHex:_2,formatHex8:mC,formatRgb:x2,toString:x2})),Up(cv,o_,rg(sd,{brighter(Y){return Y=Y==null?Jd:Math.pow(Jd,Y),new cv(this.h,this.s,this.l*Y,this.opacity)},darker(Y){return Y=Y==null?ld:Math.pow(ld,Y),new cv(this.h,this.s,this.l*Y,this.opacity)},rgb(){var Y=this.h%360+(this.h<0)*360,G=isNaN(Y)||isNaN(this.s)?0:this.s,d=this.l,x=d+(d<.5?d:1-d)*G,A=2*d-x;return new Vf(s_(Y>=240?Y-240:Y+120,A,x),s_(Y,A,x),s_(Y<120?Y+240:Y-120,A,x),this.opacity)},clamp(){return new cv(T2(this.h),My(this.s),My(this.l),Sy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const Y=Sy(this.opacity);return`${Y===1?"hsl(":"hsla("}${T2(this.h)}, ${My(this.s)*100}%, ${My(this.l)*100}%${Y===1?")":`, ${Y})`}`}}))}}),c_,f_,P2=ks({"node_modules/d3-color/src/math.js"(){c_=Math.PI/180,f_=180/Math.PI}});function I2(Y){if(Y instanceof Mv)return new Mv(Y.l,Y.a,Y.b,Y.opacity);if(Y instanceof Hv)return R2(Y);Y instanceof Vf||(Y=i_(Y));var G=g_(Y.r),d=g_(Y.g),x=g_(Y.b),A=v_((.2225045*G+.7168786*d+.0606169*x)/__),E,e;return G===d&&d===x?E=e=A:(E=v_((.4360747*G+.3850649*d+.1430804*x)/m_),e=v_((.0139322*G+.0971045*d+.7141733*x)/x_)),new Mv(116*A-16,500*(E-A),200*(A-e),Y.opacity)}function h_(Y,G,d,x){return arguments.length===1?I2(Y):new Mv(Y,G,d,x??1)}function Mv(Y,G,d,x){this.l=+Y,this.a=+G,this.b=+d,this.opacity=+x}function v_(Y){return Y>D2?Math.pow(Y,.3333333333333333):Y/w_+b_}function d_(Y){return Y>Qd?Y*Y*Y:w_*(Y-b_)}function p_(Y){return 255*(Y<=.0031308?12.92*Y:1.055*Math.pow(Y,.4166666666666667)-.055)}function g_(Y){return(Y/=255)<=.04045?Y/12.92:Math.pow((Y+.055)/1.055,2.4)}function _C(Y){if(Y instanceof Hv)return new Hv(Y.h,Y.c,Y.l,Y.opacity);if(Y instanceof Mv||(Y=I2(Y)),Y.a===0&&Y.b===0)return new Hv(NaN,0=1?(d=1,G-1):Math.floor(d*G),A=Y[x],E=Y[x+1],e=x>0?Y[x-1]:2*A-E,t=x()=>Y}});function U2(Y,G){return function(d){return Y+d*G}}function TC(Y,G,d){return Y=Math.pow(Y,d),G=Math.pow(G,d)-Y,d=1/d,function(x){return Math.pow(Y+x*G,d)}}function Cy(Y,G){var d=G-Y;return d?U2(Y,d>180||d<-180?d-360*Math.round(d/360):d):og(isNaN(Y)?G:Y)}function AC(Y){return(Y=+Y)==1?qf:function(G,d){return d-G?TC(G,d,Y):og(isNaN(G)?d:G)}}function qf(Y,G){var d=G-Y;return d?U2(Y,d):og(isNaN(Y)?G:Y)}var Hp=ks({"node_modules/d3-interpolate/src/color.js"(){N2()}});function j2(Y){return function(G){var d=G.length,x=new Array(d),A=new Array(d),E=new Array(d),e,t;for(e=0;ed&&(E=G.slice(d,E),t[e]?t[e]+=E:t[++e]=E),(x=x[0])===(A=A[0])?t[e]?t[e]+=A:t[++e]=A:(t[++e]=null,r.push({i:e,x:Ev(x,A)})),d=Ry.lastIndex;return d180?a+=360:a-o>180&&(o+=360),n.push({i:i.push(A(i)+"rotate(",null,x)-2,x:Ev(o,a)})):a&&i.push(A(i)+"rotate("+a+x)}function t(o,a,i,n){o!==a?n.push({i:i.push(A(i)+"skewX(",null,x)-2,x:Ev(o,a)}):a&&i.push(A(i)+"skewX("+a+x)}function r(o,a,i,n,s,c){if(o!==i||a!==n){var f=s.push(A(s)+"scale(",null,",",null,")");c.push({i:f-4,x:Ev(o,i)},{i:f-2,x:Ev(a,n)})}else(i!==1||n!==1)&&s.push(A(s)+"scale("+i+","+n+")")}return function(o,a){var i=[],n=[];return o=Y(o),a=Y(a),E(o.translateX,o.translateY,a.translateX,a.translateY,i,n),e(o.rotate,a.rotate,i,n),t(o.skewX,a.skewX,i,n),r(o.scaleX,o.scaleY,a.scaleX,a.scaleY,i,n),o=a=null,function(s){for(var c=-1,f=n.length,v;++cDy,interpolateArray:()=>SC,interpolateBasis:()=>F2,interpolateBasisClosed:()=>O2,interpolateCubehelix:()=>d3,interpolateCubehelixLong:()=>p3,interpolateDate:()=>X2,interpolateDiscrete:()=>kC,interpolateHcl:()=>f3,interpolateHclLong:()=>h3,interpolateHsl:()=>l3,interpolateHslLong:()=>u3,interpolateHue:()=>LC,interpolateLab:()=>qC,interpolateNumber:()=>Ev,interpolateNumberArray:()=>C_,interpolateObject:()=>K2,interpolateRgb:()=>Ly,interpolateRgbBasis:()=>V2,interpolateRgbBasisClosed:()=>q2,interpolateRound:()=>IC,interpolateString:()=>$2,interpolateTransformCss:()=>r3,interpolateTransformSvg:()=>a3,interpolateZoom:()=>o3,piecewise:()=>ZC,quantize:()=>YC});var Gp=ks({"node_modules/d3-interpolate/src/index.js"(){zy(),Z2(),k_(),B2(),Y2(),CC(),PC(),Py(),L_(),J2(),RC(),Q2(),BC(),jC(),H2(),VC(),HC(),GC(),WC(),XC(),KC()}}),I_=He({"src/traces/sunburst/fill_one.js"(Y,G){var d=vo(),x=Ai();G.exports=function(E,e,t,r,o){var a=e.data.data,i=a.i,n=o||a.color;if(i>=0){e.i=a.i;var s=t.marker;s.pattern?(!s.colors||!s.pattern.shape)&&(s.color=n,e.color=n):(s.color=n,e.color=n),d.pointStyle(E,t,r,e)}else x.fill(E,n)}}}),g3=He({"src/traces/sunburst/style.js"(Y,G){var d=Qn(),x=Ai(),A=Gr(),E=hh().resizeText,e=I_();function t(o){var a=o._fullLayout._sunburstlayer.selectAll(".trace");E(o,a,"sunburst"),a.each(function(i){var n=d.select(this),s=i[0],c=s.trace;n.style("opacity",c.opacity),n.selectAll("path.surface").each(function(f){d.select(this).call(r,f,c,o)})})}function r(o,a,i,n){var s=a.data.data,c=!a.children,f=s.i,v=A.castOption(i,f,"marker.line.color")||x.defaultLine,h=A.castOption(i,f,"marker.line.width")||0;o.call(e,a,i,n).style("stroke-width",h).call(x.stroke,v).style("opacity",c?i.leaf.opacity:null)}G.exports={style:t,styleOne:r}}}),ud=He({"src/traces/sunburst/helpers.js"(Y){var G=Gr(),d=Ai(),x=xv(),A=Hd();Y.findEntryWithLevel=function(r,o){var a;return o&&r.eachAfter(function(i){if(Y.getPtId(i)===o)return a=i.copy()}),a||r},Y.findEntryWithChild=function(r,o){var a;return r.eachAfter(function(i){for(var n=i.children||[],s=0;s0)},Y.getMaxDepth=function(r){return r.maxdepth>=0?r.maxdepth:1/0},Y.isHeader=function(r,o){return!(Y.isLeaf(r)||r.depth===o._maxDepth-1)};function t(r){return r.data.data.pid}Y.getParent=function(r,o){return Y.findEntryWithLevel(r,t(o))},Y.listPath=function(r,o){var a=r.parent;if(!a)return[];var i=o?[a.data[o]]:[a];return Y.listPath(a,o).concat(i)},Y.getPath=function(r){return Y.listPath(r,"label").join("/")+"/"},Y.formatValue=A.formatPieValue,Y.formatPercent=function(r,o){var a=G.formatPercent(r,0);return a==="0%"&&(a=A.formatPiePercent(r,o)),a}}}),By=He({"src/traces/sunburst/fx.js"(Y,G){var d=Qn(),x=Ei(),A=Ph().appendArrayPointValue,E=Wu(),e=Gr(),t=z0(),r=ud(),o=Hd(),a=o.formatPieValue;G.exports=function(s,c,f,v,h){var T=v[0],l=T.trace,y=T.hierarchy,b=l.type==="sunburst",S=l.type==="treemap"||l.type==="icicle";"_hasHoverLabel"in l||(l._hasHoverLabel=!1),"_hasHoverEvent"in l||(l._hasHoverEvent=!1);var M=function(p){var u=f._fullLayout;if(!(f._dragging||u.hovermode===!1)){var g=f._fullData[l.index],m=p.data.data,R=m.i,P=r.isHierarchyRoot(p),z=r.getParent(y,p),F=r.getValue(p),B=function(ae){return e.castOption(g,R,ae)},O=B("hovertemplate"),L=E.castHoverinfo(g,u,R),N=u.separators,U;if(O||L&&L!=="none"&&L!=="skip"){var Z,Q;b&&(Z=T.cx+p.pxmid[0]*(1-p.rInscribed),Q=T.cy+p.pxmid[1]*(1-p.rInscribed)),S&&(Z=p._hoverX,Q=p._hoverY);var ue={},oe=[],le=[],j=function(ae){return oe.indexOf(ae)!==-1};L&&(oe=L==="all"?g._module.attributes.hoverinfo.flags:L.split("+")),ue.label=m.label,j("label")&&ue.label&&le.push(ue.label),m.hasOwnProperty("v")&&(ue.value=m.v,ue.valueLabel=a(ue.value,N),j("value")&&le.push(ue.valueLabel)),ue.currentPath=p.currentPath=r.getPath(p.data),j("current path")&&!P&&le.push(ue.currentPath);var J,$=[],X=function(){$.indexOf(J)===-1&&(le.push(J),$.push(J))};ue.percentParent=p.percentParent=F/r.getValue(z),ue.parent=p.parentString=r.getPtLabel(z),j("percent parent")&&(J=r.formatPercent(ue.percentParent,N)+" of "+ue.parent,X()),ue.percentEntry=p.percentEntry=F/r.getValue(c),ue.entry=p.entry=r.getPtLabel(c),j("percent entry")&&!P&&!p.onPathbar&&(J=r.formatPercent(ue.percentEntry,N)+" of "+ue.entry,X()),ue.percentRoot=p.percentRoot=F/r.getValue(y),ue.root=p.root=r.getPtLabel(y),j("percent root")&&!P&&(J=r.formatPercent(ue.percentRoot,N)+" of "+ue.root,X()),ue.text=B("hovertext")||B("text"),j("text")&&(J=ue.text,e.isValidTextValue(J)&&le.push(J)),U=[i(p,g,h.eventDataKeys)];var re={trace:g,y:Q,_x0:p._x0,_x1:p._x1,_y0:p._y0,_y1:p._y1,text:le.join("
"),name:O||j("name")?g.name:void 0,color:B("hoverlabel.bgcolor")||m.color,borderColor:B("hoverlabel.bordercolor"),fontFamily:B("hoverlabel.font.family"),fontSize:B("hoverlabel.font.size"),fontColor:B("hoverlabel.font.color"),fontWeight:B("hoverlabel.font.weight"),fontStyle:B("hoverlabel.font.style"),fontVariant:B("hoverlabel.font.variant"),nameLength:B("hoverlabel.namelength"),textAlign:B("hoverlabel.align"),hovertemplate:O,hovertemplateLabels:ue,eventData:U};b&&(re.x0=Z-p.rInscribed*p.rpx1,re.x1=Z+p.rInscribed*p.rpx1,re.idealAlign=p.pxmid[0]<0?"left":"right"),S&&(re.x=Z,re.idealAlign=Z<0?"left":"right");var ee=[];E.loneHover(re,{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:f,inOut_bbox:ee}),U[0].bbox=ee[0],l._hasHoverLabel=!0}if(S){var q=s.select("path.surface");h.styleOne(q,p,g,f,{hovered:!0})}l._hasHoverEvent=!0,f.emit("plotly_hover",{points:U||[i(p,g,h.eventDataKeys)],event:d.event})}},_=function(p){var u=f._fullLayout,g=f._fullData[l.index],m=d.select(this).datum();if(l._hasHoverEvent&&(p.originalEvent=d.event,f.emit("plotly_unhover",{points:[i(m,g,h.eventDataKeys)],event:d.event}),l._hasHoverEvent=!1),l._hasHoverLabel&&(E.loneUnhover(u._hoverlayer.node()),l._hasHoverLabel=!1),S){var R=s.select("path.surface");h.styleOne(R,m,g,f,{hovered:!1})}},w=function(p){var u=f._fullLayout,g=f._fullData[l.index],m=b&&(r.isHierarchyRoot(p)||r.isLeaf(p)),R=r.getPtId(p),P=r.isEntry(p)?r.findEntryWithChild(y,R):r.findEntryWithLevel(y,R),z=r.getPtId(P),F={points:[i(p,g,h.eventDataKeys)],event:d.event};m||(F.nextLevel=z);var B=t.triggerHandler(f,"plotly_"+l.type+"click",F);if(B!==!1&&u.hovermode&&(f._hoverdata=[i(p,g,h.eventDataKeys)],E.click(f,d.event)),!m&&B!==!1&&!f._dragging&&!f._transitioning){x.call("_storeDirectGUIEdit",g,u._tracePreGUI[g.uid],{level:g.level});var O={data:[{level:z}],traces:[l.index]},L={frame:{redraw:!1,duration:h.transitionTime},transition:{duration:h.transitionTime,easing:h.transitionEasing},mode:"immediate",fromcurrent:!0};E.loneUnhover(u._hoverlayer.node()),x.call("animate",f,O,L)}};s.on("mouseover",M),s.on("mouseout",_),s.on("click",w)};function i(n,s,c){for(var f=n.data.data,v={curveNumber:s.index,pointNumber:f.i,data:s._input,fullData:s},h=0;hrt.x1?2*Math.PI:0)+ae;Je=ce.rpx1qe?2*Math.PI:0)+ae;$e={x0:Je,x1:Je}}else $e={rpx0:oe,rpx1:oe},E.extendFlat($e,xe(ce));else $e={rpx0:0,rpx1:0};else $e={x0:ae,x1:ae};return x($e,rt)}function Me(ce){var Re=$[T.getPtId(ce)],$e,rt=ce.transform;if(Re)$e=Re;else if($e={rpx1:ce.rpx1,transform:{textPosAngle:rt.textPosAngle,scale:0,rotate:rt.rotate,rCenter:rt.rCenter,x:rt.x,y:rt.y}},J)if(ce.parent)if(qe){var Je=ce.x1>qe?2*Math.PI:0;$e.x0=$e.x1=Je}else E.extendFlat($e,xe(ce));else $e.x0=$e.x1=ae;else $e.x0=$e.x1=ae;var At=x($e.transform.textPosAngle,ce.transform.textPosAngle),St=x($e.rpx1,ce.rpx1),Rt=x($e.x0,ce.x0),Ut=x($e.x1,ce.x1),ir=x($e.transform.scale,rt.scale),ar=x($e.transform.rotate,rt.rotate),Mr=rt.rCenter===0?3:$e.transform.rCenter===0?1/3:1,fr=x($e.transform.rCenter,rt.rCenter),dr=function(pt){return fr(Math.pow(pt,Mr))};return function(pt){var ze=St(pt),Ge=Rt(pt),Oe=Ut(pt),ve=dr(pt),ge=we(ze,(Ge+Oe)/2),be=At(pt),Pe={pxmid:ge,rpx1:ze,transform:{textPosAngle:be,rCenter:ve,x:rt.x,y:rt.y}};return r(B.type,rt,m),{transform:{targetX:Fe(Pe),targetY:Ce(Pe),scale:ir(pt),rotate:ar(pt),rCenter:ve}}}}function xe(ce){var Re=ce.parent,$e=$[T.getPtId(Re)],rt={};if($e){var Je=Re.children,At=Je.indexOf(ce),St=Je.length,Rt=x($e.x0,$e.x1);rt.x0=Rt(At/St),rt.x1=Rt(At/St)}else rt.x0=rt.x1=0;return rt}}function y(_){return d.partition().size([2*Math.PI,_.height+1])(_)}Y.formatSliceLabel=function(_,w,p,u,g){var m=p.texttemplate,R=p.textinfo;if(!m&&(!R||R==="none"))return"";var P=g.separators,z=u[0],F=_.data.data,B=z.hierarchy,O=T.isHierarchyRoot(_),L=T.getParent(B,_),N=T.getValue(_);if(!m){var U=R.split("+"),Z=function(ee){return U.indexOf(ee)!==-1},Q=[],ue;if(Z("label")&&F.label&&Q.push(F.label),F.hasOwnProperty("v")&&Z("value")&&Q.push(T.formatValue(F.v,P)),!O){Z("current path")&&Q.push(T.getPath(_.data));var oe=0;Z("percent parent")&&oe++,Z("percent entry")&&oe++,Z("percent root")&&oe++;var le=oe>1;if(oe){var j,J=function(ee){ue=T.formatPercent(j,P),le&&(ue+=" of "+ee),Q.push(ue)};Z("percent parent")&&!O&&(j=N/T.getValue(L),J("parent")),Z("percent entry")&&(j=N/T.getValue(w),J("entry")),Z("percent root")&&(j=N/T.getValue(B),J("root"))}}return Z("text")&&(ue=E.castOption(p,F.i,"text"),E.isValidTextValue(ue)&&Q.push(ue)),Q.join("
")}var $=E.castOption(p,F.i,"texttemplate");if(!$)return"";var X={};F.label&&(X.label=F.label),F.hasOwnProperty("v")&&(X.value=F.v,X.valueLabel=T.formatValue(F.v,P)),X.currentPath=T.getPath(_.data),O||(X.percentParent=N/T.getValue(L),X.percentParentLabel=T.formatPercent(X.percentParent,P),X.parent=T.getPtLabel(L)),X.percentEntry=N/T.getValue(w),X.percentEntryLabel=T.formatPercent(X.percentEntry,P),X.entry=T.getPtLabel(w),X.percentRoot=N/T.getValue(B),X.percentRootLabel=T.formatPercent(X.percentRoot,P),X.root=T.getPtLabel(B),F.hasOwnProperty("color")&&(X.color=F.color);var re=E.castOption(p,F.i,"text");return(E.isValidTextValue(re)||re==="")&&(X.text=re),X.customdata=E.castOption(p,F.i,"customdata"),E.texttemplateString($,X,g._d3locale,X,p._meta||{})};function b(_){return _.rpx0===0&&E.isFullCircle([_.x0,_.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(_.halfangle)),_.ring/2))}function S(_){return M(_.rpx1,_.transform.textPosAngle)}function M(_,w){return[_*Math.sin(w),-_*Math.cos(w)]}}}),JC=He({"src/traces/sunburst/index.js"(Y,G){G.exports={moduleType:"trace",name:"sunburst",basePlotModule:vC(),categories:[],animatable:!0,attributes:xy(),layoutAttributes:p2(),supplyDefaults:dC(),supplyLayoutDefaults:pC(),calc:wy().calc,crossTraceCalc:wy().crossTraceCalc,plot:R_().plot,style:g3().style,colorbar:ah(),meta:{}}}}),$C=He({"lib/sunburst.js"(Y,G){G.exports=JC()}}),QC=He({"src/traces/treemap/base_plot.js"(Y){var G=yu();Y.name="treemap",Y.plot=function(d,x,A,E){G.plotBasePlot(Y.name,d,x,A,E)},Y.clean=function(d,x,A,E){G.cleanBasePlot(Y.name,d,x,A,E)}}}),Wp=He({"src/traces/treemap/constants.js"(Y,G){G.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),D_=He({"src/traces/treemap/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=Yo().texttemplateAttrs,A=kl(),E=mu().attributes,e=Bp(),t=xy(),r=Wp(),o=ho().extendFlat,a=Nf().pattern;G.exports={labels:t.labels,parents:t.parents,values:t.values,branchvalues:t.branchvalues,count:t.count,level:t.level,maxdepth:t.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:o({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:t.marker.colors,pattern:a,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:t.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},A("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:o({},e.textfont,{}),editType:"calc"},text:e.text,textinfo:t.textinfo,texttemplate:x({editType:"plot"},{keys:r.eventDataKeys.concat(["label","value"])}),hovertext:e.hovertext,hoverinfo:t.hoverinfo,hovertemplate:d({},{keys:r.eventDataKeys}),textfont:e.textfont,insidetextfont:e.insidetextfont,outsidetextfont:o({},e.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:e.sort,root:t.root,domain:E({name:"treemap",trace:!0,editType:"calc"})}}}),y3=He({"src/traces/treemap/layout_attributes.js"(Y,G){G.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),eL=He({"src/traces/treemap/defaults.js"(Y,G){var d=Gr(),x=D_(),A=Ai(),E=mu().defaults,e=Jh().handleText,t=Rp().TEXTPAD,r=Np().handleMarkerDefaults,o=Kl(),a=o.hasColorscale,i=o.handleDefaults;G.exports=function(s,c,f,v){function h(g,m){return d.coerce(s,c,x,g,m)}var T=h("labels"),l=h("parents");if(!T||!T.length||!l||!l.length){c.visible=!1;return}var y=h("values");y&&y.length?h("branchvalues"):h("count"),h("level"),h("maxdepth");var b=h("tiling.packing");b==="squarify"&&h("tiling.squarifyratio"),h("tiling.flip"),h("tiling.pad");var S=h("text");h("texttemplate"),c.texttemplate||h("textinfo",d.isArrayOrTypedArray(S)?"text+label":"label"),h("hovertext"),h("hovertemplate");var M=h("pathbar.visible"),_="auto";e(s,c,v,h,_,{hasPathbar:M,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("textposition");var w=c.textposition.indexOf("bottom")!==-1;r(s,c,v,h);var p=c._hasColorscale=a(s,"marker","colors")||(s.marker||{}).coloraxis;p?i(s,c,v,h,{prefix:"marker.",cLetter:"c"}):h("marker.depthfade",!(c.marker.colors||[]).length);var u=c.textfont.size*2;h("marker.pad.t",w?u/4:u),h("marker.pad.l",u/4),h("marker.pad.r",u/4),h("marker.pad.b",w?u:u/4),h("marker.cornerradius"),c._hovered={marker:{line:{width:2,color:A.contrast(v.paper_bgcolor)}}},M&&(h("pathbar.thickness",c.pathbar.textfont.size+2*t),h("pathbar.side"),h("pathbar.edgeshape")),h("sort"),h("root.color"),E(c,v,h),c._length=null}}}),tL=He({"src/traces/treemap/layout_defaults.js"(Y,G){var d=Gr(),x=y3();G.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("treemapcolorway",e.colorway),t("extendtreemapcolors")}}}),m3=He({"src/traces/treemap/calc.js"(Y){var G=wy();Y.calc=function(d,x){return G.calc(d,x)},Y.crossTraceCalc=function(d){return G._runCrossTraceCalc("treemap",d)}}}),_3=He({"src/traces/treemap/flip_tree.js"(Y,G){G.exports=function d(x,A,E){var e;E.swapXY&&(e=x.x0,x.x0=x.y0,x.y0=e,e=x.x1,x.x1=x.y1,x.y1=e),E.flipX&&(e=x.x0,x.x0=A[0]-x.x1,x.x1=A[0]-e),E.flipY&&(e=x.y0,x.y0=A[1]-x.y1,x.y1=A[1]-e);var t=x.children;if(t)for(var r=0;r0)for(var u=0;u").join(" ")||"";var le=x.ensureSingle(ue,"g","slicetext"),j=x.ensureSingle(le,"text","",function($){$.attr("data-notex",1)}),J=x.ensureUniformFontSize(s,o.determineTextFont(B,Q,z.font,{onPathbar:!0}));j.text(Q._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(A.font,J).call(E.convertToTspans,s),Q.textBB=A.bBox(j.node()),Q.transform=_(Q,{fontSize:J.size,onPathbar:!0}),Q.transform.fontSize=J.size,p?j.transition().attrTween("transform",function($){var X=m($,i,R,[l,y]);return function(re){return w(X(re))}}):j.attr("transform",w(Q))})}}}),aL=He({"src/traces/treemap/plot_one.js"(Y,G){var d=Qn(),x=(Gp(),Go(tp)).interpolate,A=ud(),E=Gr(),e=Rp().TEXTPAD,t=Dp(),r=t.toMoveInsideBar,o=hh(),a=o.recordMinTextSize,i=Wp(),n=rL();function s(c){return A.isHierarchyRoot(c)?"":A.getPtId(c)}G.exports=function(f,v,h,T,l){var y=f._fullLayout,b=v[0],S=b.trace,M=S.type,_=M==="icicle",w=b.hierarchy,p=A.findEntryWithLevel(w,S.level),u=d.select(h),g=u.selectAll("g.pathbar"),m=u.selectAll("g.slice");if(!p){g.remove(),m.remove();return}var R=A.isHierarchyRoot(p),P=!y.uniformtext.mode&&A.hasTransition(T),z=A.getMaxDepth(S),F=function(fr){return fr.data.depth-p.data.depth-1?N+Q:-(Z+Q):0,oe={x0:U,x1:U,y0:ue,y1:ue+Z},le=function(fr,dr,pt){var ze=S.tiling.pad,Ge=function(be){return be-ze<=dr.x0},Oe=function(be){return be+ze>=dr.x1},ve=function(be){return be-ze<=dr.y0},ge=function(be){return be+ze>=dr.y1};return fr.x0===dr.x0&&fr.x1===dr.x1&&fr.y0===dr.y0&&fr.y1===dr.y1?{x0:fr.x0,x1:fr.x1,y0:fr.y0,y1:fr.y1}:{x0:Ge(fr.x0-ze)?0:Oe(fr.x0-ze)?pt[0]:fr.x0,x1:Ge(fr.x1+ze)?0:Oe(fr.x1+ze)?pt[0]:fr.x1,y0:ve(fr.y0-ze)?0:ge(fr.y0-ze)?pt[1]:fr.y0,y1:ve(fr.y1+ze)?0:ge(fr.y1+ze)?pt[1]:fr.y1}},j=null,J={},$={},X=null,re=function(fr,dr){return dr?J[s(fr)]:$[s(fr)]},ee=function(fr,dr,pt,ze){if(dr)return J[s(w)]||oe;var Ge=$[S.level]||pt;return F(fr)?le(fr,Ge,ze):{}};b.hasMultipleRoots&&R&&z++,S._maxDepth=z,S._backgroundColor=y.paper_bgcolor,S._entryDepth=p.data.depth,S._atRootLevel=R;var q=-L/2+B.l+B.w*(O.x[1]+O.x[0])/2,ae=-N/2+B.t+B.h*(1-(O.y[1]+O.y[0])/2),ie=function(fr){return q+fr},fe=function(fr){return ae+fr},we=fe(0),Ae=ie(0),Fe=function(fr){return Ae+fr},Ce=function(fr){return we+fr};function qe(fr,dr){return fr+","+dr}var et=Fe(0),Qe=function(fr){fr.x=Math.max(et,fr.x)},Ke=S.pathbar.edgeshape,Xe=function(fr){var dr=Fe(Math.max(Math.min(fr.x0,fr.x0),0)),pt=Fe(Math.min(Math.max(fr.x1,fr.x1),U)),ze=Ce(fr.y0),Ge=Ce(fr.y1),Oe=Z/2,ve={},ge={};ve.x=dr,ge.x=pt,ve.y=ge.y=(ze+Ge)/2;var be={x:dr,y:ze},Pe={x:pt,y:ze},We={x:pt,y:Ge},ct={x:dr,y:Ge};return Ke===">"?(be.x-=Oe,Pe.x-=Oe,We.x-=Oe,ct.x-=Oe):Ke==="/"?(We.x-=Oe,ct.x-=Oe,ve.x-=Oe/2,ge.x-=Oe/2):Ke==="\\"?(be.x-=Oe,Pe.x-=Oe,ve.x-=Oe/2,ge.x-=Oe/2):Ke==="<"&&(ve.x-=Oe,ge.x-=Oe),Qe(be),Qe(ct),Qe(ve),Qe(Pe),Qe(We),Qe(ge),"M"+qe(be.x,be.y)+"L"+qe(Pe.x,Pe.y)+"L"+qe(ge.x,ge.y)+"L"+qe(We.x,We.y)+"L"+qe(ct.x,ct.y)+"L"+qe(ve.x,ve.y)+"Z"},Me=S[_?"tiling":"marker"].pad,xe=function(fr){return S.textposition.indexOf(fr)!==-1},ce=xe("top"),Re=xe("left"),$e=xe("right"),rt=xe("bottom"),Je=function(fr){var dr=ie(fr.x0),pt=ie(fr.x1),ze=fe(fr.y0),Ge=fe(fr.y1),Oe=pt-dr,ve=Ge-ze;if(!Oe||!ve)return"";var ge=S.marker.cornerradius||0,be=Math.min(ge,Oe/2,ve/2);be&&fr.data&&fr.data.data&&fr.data.data.label&&(ce&&(be=Math.min(be,Me.t)),Re&&(be=Math.min(be,Me.l)),$e&&(be=Math.min(be,Me.r)),rt&&(be=Math.min(be,Me.b)));var Pe=function(We,ct){return be?"a"+qe(be,be)+" 0 0 1 "+qe(We,ct):""};return"M"+qe(dr,ze+be)+Pe(be,-be)+"L"+qe(pt-be,ze)+Pe(be,be)+"L"+qe(pt,Ge-be)+Pe(-be,be)+"L"+qe(dr+be,Ge)+Pe(-be,-be)+"Z"},At=function(fr,dr){var pt=fr.x0,ze=fr.x1,Ge=fr.y0,Oe=fr.y1,ve=fr.textBB,ge=ce||dr.isHeader&&!rt,be=ge?"start":rt?"end":"middle",Pe=xe("right"),We=xe("left")||dr.onPathbar,ct=We?-1:Pe?1:0;if(dr.isHeader){if(pt+=(_?Me:Me.l)-e,ze-=(_?Me:Me.r)-e,pt>=ze){var _t=(pt+ze)/2;pt=_t,ze=_t}var Mt;rt?(Mt=Oe-(_?Me:Me.b),Ge-1,flipY:O.tiling.flip.indexOf("y")>-1,pad:{inner:O.tiling.pad,top:O.marker.pad.t,left:O.marker.pad.l,right:O.marker.pad.r,bottom:O.marker.pad.b}}),ue=Q.descendants(),oe=1/0,le=-1/0;ue.forEach(function(re){var ee=re.depth;ee>=O._maxDepth?(re.x0=re.x1=(re.x0+re.x1)/2,re.y0=re.y1=(re.y0+re.y1)/2):(oe=Math.min(oe,ee),le=Math.max(le,ee))}),h=h.data(ue,o.getPtId),O._maxVisibleLayers=isFinite(le)?le-oe+1:0,h.enter().append("g").classed("slice",!0),u(h,n,P,[l,y],M),h.order();var j=null;if(p&&R){var J=o.getPtId(R);h.each(function(re){j===null&&o.getPtId(re)===J&&(j={x0:re.x0,x1:re.x1,y0:re.y0,y1:re.y1})})}var $=function(){return j||{x0:0,x1:l,y0:0,y1:y}},X=h;return p&&(X=X.transition().each("end",function(){var re=d.select(this);o.setSliceCursor(re,c,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),X.each(function(re){var ee=o.isHeader(re,O);re._x0=b(re.x0),re._x1=b(re.x1),re._y0=S(re.y0),re._y1=S(re.y1),re._hoverX=b(re.x1-O.marker.pad.r),re._hoverY=S(U?re.y1-O.marker.pad.b/2:re.y0+O.marker.pad.t/2);var q=d.select(this),ae=x.ensureSingle(q,"path","surface",function(Ce){Ce.style("pointer-events",z?"none":"all")});p?ae.transition().attrTween("d",function(Ce){var qe=g(Ce,n,$(),[l,y]);return function(et){return M(qe(et))}}):ae.attr("d",M),q.call(a,v,c,f,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,c,{isTransitioning:c._transitioning}),ae.call(t,re,O,c,{hovered:!1}),re.x0===re.x1||re.y0===re.y1?re._text="":ee?re._text=Z?"":o.getPtLabel(re)||"":re._text=i(re,v,O,f,F)||"";var ie=x.ensureSingle(q,"g","slicetext"),fe=x.ensureSingle(ie,"text","",function(Ce){Ce.attr("data-notex",1)}),we=x.ensureUniformFontSize(c,o.determineTextFont(O,re,F.font)),Ae=re._text||" ",Fe=ee&&Ae.indexOf("
")===-1;fe.text(Ae).classed("slicetext",!0).attr("text-anchor",N?"end":L||Fe?"start":"middle").call(A.font,we).call(E.convertToTspans,c),re.textBB=A.bBox(fe.node()),re.transform=_(re,{fontSize:we.size,isHeader:ee}),re.transform.fontSize=we.size,p?fe.transition().attrTween("transform",function(Ce){var qe=m(Ce,n,$(),[l,y]);return function(et){return w(qe(et))}}):fe.attr("transform",w(re))}),j}}}),iL=He({"src/traces/treemap/plot.js"(Y,G){var d=b3(),x=nL();G.exports=function(E,e,t,r){return d(E,e,t,r,{type:"treemap",drawDescendants:x})}}}),oL=He({"src/traces/treemap/index.js"(Y,G){G.exports={moduleType:"trace",name:"treemap",basePlotModule:QC(),categories:[],animatable:!0,attributes:D_(),layoutAttributes:y3(),supplyDefaults:eL(),supplyLayoutDefaults:tL(),calc:m3().calc,crossTraceCalc:m3().crossTraceCalc,plot:iL(),style:z_().style,colorbar:ah(),meta:{}}}}),sL=He({"lib/treemap.js"(Y,G){G.exports=oL()}}),lL=He({"src/traces/icicle/base_plot.js"(Y){var G=yu();Y.name="icicle",Y.plot=function(d,x,A,E){G.plotBasePlot(Y.name,d,x,A,E)},Y.clean=function(d,x,A,E){G.cleanBasePlot(Y.name,d,x,A,E)}}}),w3=He({"src/traces/icicle/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=Yo().texttemplateAttrs,A=kl(),E=mu().attributes,e=Bp(),t=xy(),r=D_(),o=Wp(),a=ho().extendFlat,i=Nf().pattern;G.exports={labels:t.labels,parents:t.parents,values:t.values,branchvalues:t.branchvalues,count:t.count,level:t.level,maxdepth:t.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:r.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:a({colors:t.marker.colors,line:t.marker.line,pattern:i,editType:"calc"},A("marker",{colorAttr:"colors",anim:!1})),leaf:t.leaf,pathbar:r.pathbar,text:e.text,textinfo:t.textinfo,texttemplate:x({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),hovertext:e.hovertext,hoverinfo:t.hoverinfo,hovertemplate:d({},{keys:o.eventDataKeys}),textfont:e.textfont,insidetextfont:e.insidetextfont,outsidetextfont:r.outsidetextfont,textposition:r.textposition,sort:e.sort,root:t.root,domain:E({name:"icicle",trace:!0,editType:"calc"})}}}),T3=He({"src/traces/icicle/layout_attributes.js"(Y,G){G.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),uL=He({"src/traces/icicle/defaults.js"(Y,G){var d=Gr(),x=w3(),A=Ai(),E=mu().defaults,e=Jh().handleText,t=Rp().TEXTPAD,r=Np().handleMarkerDefaults,o=Kl(),a=o.hasColorscale,i=o.handleDefaults;G.exports=function(s,c,f,v){function h(w,p){return d.coerce(s,c,x,w,p)}var T=h("labels"),l=h("parents");if(!T||!T.length||!l||!l.length){c.visible=!1;return}var y=h("values");y&&y.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),h("tiling.orientation"),h("tiling.flip"),h("tiling.pad");var b=h("text");h("texttemplate"),c.texttemplate||h("textinfo",d.isArrayOrTypedArray(b)?"text+label":"label"),h("hovertext"),h("hovertemplate");var S=h("pathbar.visible"),M="auto";e(s,c,v,h,M,{hasPathbar:S,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("textposition"),r(s,c,v,h);var _=c._hasColorscale=a(s,"marker","colors")||(s.marker||{}).coloraxis;_&&i(s,c,v,h,{prefix:"marker.",cLetter:"c"}),h("leaf.opacity",_?1:.7),c._hovered={marker:{line:{width:2,color:A.contrast(v.paper_bgcolor)}}},S&&(h("pathbar.thickness",c.pathbar.textfont.size+2*t),h("pathbar.side"),h("pathbar.edgeshape")),h("sort"),h("root.color"),E(c,v,h),c._length=null}}}),cL=He({"src/traces/icicle/layout_defaults.js"(Y,G){var d=Gr(),x=T3();G.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("iciclecolorway",e.colorway),t("extendiciclecolors")}}}),A3=He({"src/traces/icicle/calc.js"(Y){var G=wy();Y.calc=function(d,x){return G.calc(d,x)},Y.crossTraceCalc=function(d){return G._runCrossTraceCalc("icicle",d)}}}),fL=He({"src/traces/icicle/partition.js"(Y,G){var d=by(),x=_3();G.exports=function(E,e,t){var r=t.flipX,o=t.flipY,a=t.orientation==="h",i=t.maxDepth,n=e[0],s=e[1];i&&(n=(E.height+1)*e[0]/Math.min(E.height+1,i),s=(E.height+1)*e[1]/Math.min(E.height+1,i));var c=d.partition().padding(t.pad.inner).size(a?[e[1],n]:[e[0],s])(E);return(a||r||o)&&x(c,e,{swapXY:a,flipX:r,flipY:o}),c}}}),S3=He({"src/traces/icicle/style.js"(Y,G){var d=Qn(),x=Ai(),A=Gr(),E=hh().resizeText,e=I_();function t(o){var a=o._fullLayout._iciclelayer.selectAll(".trace");E(o,a,"icicle"),a.each(function(i){var n=d.select(this),s=i[0],c=s.trace;n.style("opacity",c.opacity),n.selectAll("path.surface").each(function(f){d.select(this).call(r,f,c,o)})})}function r(o,a,i,n){var s=a.data.data,c=!a.children,f=s.i,v=A.castOption(i,f,"marker.line.color")||x.defaultLine,h=A.castOption(i,f,"marker.line.width")||0;o.call(e,a,i,n).style("stroke-width",h).call(x.stroke,v).style("opacity",c?i.leaf.opacity:null)}G.exports={style:t,styleOne:r}}}),hL=He({"src/traces/icicle/draw_descendants.js"(Y,G){var d=Qn(),x=Gr(),A=vo(),E=yl(),e=fL(),t=S3().styleOne,r=Wp(),o=ud(),a=By(),i=R_().formatSliceLabel,n=!1;G.exports=function(c,f,v,h,T){var l=T.width,y=T.height,b=T.viewX,S=T.viewY,M=T.pathSlice,_=T.toMoveInsideSlice,w=T.strTransform,p=T.hasTransition,u=T.handleSlicesExit,g=T.makeUpdateSliceInterpolator,m=T.makeUpdateTextInterpolator,R=T.prevEntry,P={},z=c._context.staticPlot,F=c._fullLayout,B=f[0],O=B.trace,L=O.textposition.indexOf("left")!==-1,N=O.textposition.indexOf("right")!==-1,U=O.textposition.indexOf("bottom")!==-1,Z=e(v,[l,y],{flipX:O.tiling.flip.indexOf("x")>-1,flipY:O.tiling.flip.indexOf("y")>-1,orientation:O.tiling.orientation,pad:{inner:O.tiling.pad},maxDepth:O._maxDepth}),Q=Z.descendants(),ue=1/0,oe=-1/0;Q.forEach(function(X){var re=X.depth;re>=O._maxDepth?(X.x0=X.x1=(X.x0+X.x1)/2,X.y0=X.y1=(X.y0+X.y1)/2):(ue=Math.min(ue,re),oe=Math.max(oe,re))}),h=h.data(Q,o.getPtId),O._maxVisibleLayers=isFinite(oe)?oe-ue+1:0,h.enter().append("g").classed("slice",!0),u(h,n,P,[l,y],M),h.order();var le=null;if(p&&R){var j=o.getPtId(R);h.each(function(X){le===null&&o.getPtId(X)===j&&(le={x0:X.x0,x1:X.x1,y0:X.y0,y1:X.y1})})}var J=function(){return le||{x0:0,x1:l,y0:0,y1:y}},$=h;return p&&($=$.transition().each("end",function(){var X=d.select(this);o.setSliceCursor(X,c,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),$.each(function(X){X._x0=b(X.x0),X._x1=b(X.x1),X._y0=S(X.y0),X._y1=S(X.y1),X._hoverX=b(X.x1-O.tiling.pad),X._hoverY=S(U?X.y1-O.tiling.pad/2:X.y0+O.tiling.pad/2);var re=d.select(this),ee=x.ensureSingle(re,"path","surface",function(fe){fe.style("pointer-events",z?"none":"all")});p?ee.transition().attrTween("d",function(fe){var we=g(fe,n,J(),[l,y],{orientation:O.tiling.orientation,flipX:O.tiling.flip.indexOf("x")>-1,flipY:O.tiling.flip.indexOf("y")>-1});return function(Ae){return M(we(Ae))}}):ee.attr("d",M),re.call(a,v,c,f,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,c,{isTransitioning:c._transitioning}),ee.call(t,X,O,c,{hovered:!1}),X.x0===X.x1||X.y0===X.y1?X._text="":X._text=i(X,v,O,f,F)||"";var q=x.ensureSingle(re,"g","slicetext"),ae=x.ensureSingle(q,"text","",function(fe){fe.attr("data-notex",1)}),ie=x.ensureUniformFontSize(c,o.determineTextFont(O,X,F.font));ae.text(X._text||" ").classed("slicetext",!0).attr("text-anchor",N?"end":L?"start":"middle").call(A.font,ie).call(E.convertToTspans,c),X.textBB=A.bBox(ae.node()),X.transform=_(X,{fontSize:ie.size}),X.transform.fontSize=ie.size,p?ae.transition().attrTween("transform",function(fe){var we=m(fe,n,J(),[l,y]);return function(Ae){return w(we(Ae))}}):ae.attr("transform",w(X))}),le}}}),vL=He({"src/traces/icicle/plot.js"(Y,G){var d=b3(),x=hL();G.exports=function(E,e,t,r){return d(E,e,t,r,{type:"icicle",drawDescendants:x})}}}),dL=He({"src/traces/icicle/index.js"(Y,G){G.exports={moduleType:"trace",name:"icicle",basePlotModule:lL(),categories:[],animatable:!0,attributes:w3(),layoutAttributes:T3(),supplyDefaults:uL(),supplyLayoutDefaults:cL(),calc:A3().calc,crossTraceCalc:A3().crossTraceCalc,plot:vL(),style:S3().style,colorbar:ah(),meta:{}}}}),pL=He({"lib/icicle.js"(Y,G){G.exports=dL()}}),gL=He({"src/traces/funnelarea/base_plot.js"(Y){var G=yu();Y.name="funnelarea",Y.plot=function(d,x,A,E){G.plotBasePlot(Y.name,d,x,A,E)},Y.clean=function(d,x,A,E){G.cleanBasePlot(Y.name,d,x,A,E)}}}),M3=He({"src/traces/funnelarea/attributes.js"(Y,G){var d=Bp(),x=cl(),A=mu().attributes,E=Yo().hovertemplateAttrs,e=Yo().texttemplateAttrs,t=ho().extendFlat;G.exports={labels:d.labels,label0:d.label0,dlabel:d.dlabel,values:d.values,marker:{colors:d.marker.colors,line:{color:t({},d.marker.line.color,{dflt:null}),width:t({},d.marker.line.width,{dflt:1}),editType:"calc"},pattern:d.marker.pattern,editType:"calc"},text:d.text,hovertext:d.hovertext,scalegroup:t({},d.scalegroup,{}),textinfo:t({},d.textinfo,{flags:["label","text","value","percent"]}),texttemplate:e({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:t({},x.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:E({},{keys:["label","color","value","text","percent"]}),textposition:t({},d.textposition,{values:["inside","none"],dflt:"inside"}),textfont:d.textfont,insidetextfont:d.insidetextfont,title:{text:d.title.text,font:d.title.font,position:t({},d.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:A({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),E3=He({"src/traces/funnelarea/layout_attributes.js"(Y,G){var d=r_().hiddenlabels;G.exports={hiddenlabels:d,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),yL=He({"src/traces/funnelarea/defaults.js"(Y,G){var d=Gr(),x=M3(),A=mu().defaults,E=Jh().handleText,e=Np().handleLabelsAndValues,t=Np().handleMarkerDefaults;G.exports=function(o,a,i,n){function s(M,_){return d.coerce(o,a,x,M,_)}var c=s("labels"),f=s("values"),v=e(c,f),h=v.len;if(a._hasLabels=v.hasLabels,a._hasValues=v.hasValues,!a._hasLabels&&a._hasValues&&(s("label0"),s("dlabel")),!h){a.visible=!1;return}a._length=h,t(o,a,n,s),s("scalegroup");var T=s("text"),l=s("texttemplate"),y;if(l||(y=s("textinfo",Array.isArray(T)?"text+percent":"percent")),s("hovertext"),s("hovertemplate"),l||y&&y!=="none"){var b=s("textposition");E(o,a,n,s,b,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else y==="none"&&s("textposition","none");A(a,n,s);var S=s("title.text");S&&(s("title.position"),d.coerceFont(s,"title.font",n.font)),s("aspectratio"),s("baseratio")}}}),mL=He({"src/traces/funnelarea/layout_defaults.js"(Y,G){var d=Gr(),x=E3();G.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("hiddenlabels"),t("funnelareacolorway",e.colorway),t("extendfunnelareacolors")}}}),k3=He({"src/traces/funnelarea/calc.js"(Y,G){var d=tg();function x(E,e){return d.calc(E,e)}function A(E){d.crossTraceCalc(E,{type:"funnelarea"})}G.exports={calc:x,crossTraceCalc:A}}}),_L=He({"src/traces/funnelarea/plot.js"(Y,G){var d=Qn(),x=vo(),A=Gr(),E=A.strScale,e=A.strTranslate,t=yl(),r=Dp(),o=r.toMoveInsideBar,a=hh(),i=a.recordMinTextSize,n=a.clearMinTextSize,s=Hd(),c=a_(),f=c.attachFxHandlers,v=c.determineInsideTextFont,h=c.layoutAreas,T=c.prerenderTitles,l=c.positionTitleOutside,y=c.formatSliceLabel;G.exports=function(w,p){var u=w._context.staticPlot,g=w._fullLayout;n("funnelarea",g),T(p,w),h(p,g._size),A.makeTraceGroups(g._funnelarealayer,p,"trace").each(function(m){var R=d.select(this),P=m[0],z=P.trace;M(m),R.each(function(){var F=d.select(this).selectAll("g.slice").data(m);F.enter().append("g").classed("slice",!0),F.exit().remove(),F.each(function(O,L){if(O.hidden){d.select(this).selectAll("path,g").remove();return}O.pointNumber=O.i,O.curveNumber=z.index;var N=P.cx,U=P.cy,Z=d.select(this),Q=Z.selectAll("path.surface").data([O]);Q.enter().append("path").classed("surface",!0).style({"pointer-events":u?"none":"all"}),Z.call(f,w,m);var ue="M"+(N+O.TR[0])+","+(U+O.TR[1])+b(O.TR,O.BR)+b(O.BR,O.BL)+b(O.BL,O.TL)+"Z";Q.attr("d",ue),y(w,O,P);var oe=s.castOption(z.textposition,O.pts),le=Z.selectAll("g.slicetext").data(O.text&&oe!=="none"?[0]:[]);le.enter().append("g").classed("slicetext",!0),le.exit().remove(),le.each(function(){var j=A.ensureSingle(d.select(this),"text","",function(ie){ie.attr("data-notex",1)}),J=A.ensureUniformFontSize(w,v(z,O,g.font));j.text(O.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(x.font,J).call(t.convertToTspans,w);var $=x.bBox(j.node()),X,re,ee,q=Math.min(O.BL[1],O.BR[1])+U,ae=Math.max(O.TL[1],O.TR[1])+U;re=Math.max(O.TL[0],O.BL[0])+N,ee=Math.min(O.TR[0],O.BR[0])+N,X=o(re,ee,q,ae,$,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),X.fontSize=J.size,i(z.type,X,g),m[L].transform=X,A.setTransormAndDisplay(j,X)})});var B=d.select(this).selectAll("g.titletext").data(z.title.text?[0]:[]);B.enter().append("g").classed("titletext",!0),B.exit().remove(),B.each(function(){var O=A.ensureSingle(d.select(this),"text","",function(U){U.attr("data-notex",1)}),L=z.title.text;z._meta&&(L=A.templateString(L,z._meta)),O.text(L).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(x.font,z.title.font).call(t.convertToTspans,w);var N=l(P,g._size);O.attr("transform",e(N.x,N.y)+E(Math.min(1,N.scale))+e(N.tx,N.ty))})})})};function b(_,w){var p=w[0]-_[0],u=w[1]-_[1];return"l"+p+","+u}function S(_,w){return[.5*(_[0]+w[0]),.5*(_[1]+w[1])]}function M(_){if(!_.length)return;var w=_[0],p=w.trace,u=p.aspectratio,g=p.baseratio;g>.999&&(g=.999);var m=Math.pow(g,2),R=w.vTotal,P=R*m/(1-m),z=R,F=P/R;function B(){var fe=Math.sqrt(F);return{x:fe,y:-fe}}function O(){var fe=B();return[fe.x,fe.y]}var L,N=[];N.push(O());var U,Z;for(U=_.length-1;U>-1;U--)if(Z=_[U],!Z.hidden){var Q=Z.v/z;F+=Q,N.push(O())}var ue=1/0,oe=-1/0;for(U=0;U-1;U--)if(Z=_[U],!Z.hidden){q+=1;var ae=N[q][0],ie=N[q][1];Z.TL=[-ae,ie],Z.TR=[ae,ie],Z.BL=re,Z.BR=ee,Z.pxmid=S(Z.TR,Z.BR),re=Z.TL,ee=Z.TR}}}}),xL=He({"src/traces/funnelarea/style.js"(Y,G){var d=Qn(),x=U0(),A=hh().resizeText;G.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");A(e,t,"funnelarea"),t.each(function(r){var o=r[0],a=o.trace,i=d.select(this);i.style({opacity:a.opacity}),i.selectAll("path.surface").each(function(n){d.select(this).call(x,n,a,e)})})}}}),bL=He({"src/traces/funnelarea/index.js"(Y,G){G.exports={moduleType:"trace",name:"funnelarea",basePlotModule:gL(),categories:["pie-like","funnelarea","showLegend"],attributes:M3(),layoutAttributes:E3(),supplyDefaults:yL(),supplyLayoutDefaults:mL(),calc:k3().calc,crossTraceCalc:k3().crossTraceCalc,plot:_L(),style:xL(),styleOne:U0(),meta:{}}}}),wL=He({"lib/funnelarea.js"(Y,G){G.exports=bL()}}),Hf=He({"stackgl_modules/index.js"(Y,G){(function(){var d={1964:function(e,t,r){e.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot3d:r(4100),gl_scatter3d:r(8418),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}},4793:function(e,t,r){function o(ve,ge){if(!(ve instanceof ge))throw new TypeError("Cannot call a class as a function")}function a(ve,ge){for(var be=0;bew)throw new RangeError('The value "'+ve+'" is invalid for option "size"');var ge=new Uint8Array(ve);return Object.setPrototypeOf(ge,g.prototype),ge}function g(ve,ge,be){if(typeof ve=="number"){if(typeof ge=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return z(ve)}return m(ve,ge,be)}g.poolSize=8192;function m(ve,ge,be){if(typeof ve=="string")return F(ve,ge);if(ArrayBuffer.isView(ve))return O(ve);if(ve==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+b(ve));if(dr(ve,ArrayBuffer)||ve&&dr(ve.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(dr(ve,SharedArrayBuffer)||ve&&dr(ve.buffer,SharedArrayBuffer)))return L(ve,ge,be);if(typeof ve=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var Pe=ve.valueOf&&ve.valueOf();if(Pe!=null&&Pe!==ve)return g.from(Pe,ge,be);var We=N(ve);if(We)return We;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ve[Symbol.toPrimitive]=="function")return g.from(ve[Symbol.toPrimitive]("string"),ge,be);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+b(ve))}g.from=function(ve,ge,be){return m(ve,ge,be)},Object.setPrototypeOf(g.prototype,Uint8Array.prototype),Object.setPrototypeOf(g,Uint8Array);function R(ve){if(typeof ve!="number")throw new TypeError('"size" argument must be of type number');if(ve<0)throw new RangeError('The value "'+ve+'" is invalid for option "size"')}function P(ve,ge,be){return R(ve),ve<=0?u(ve):ge!==void 0?typeof be=="string"?u(ve).fill(ge,be):u(ve).fill(ge):u(ve)}g.alloc=function(ve,ge,be){return P(ve,ge,be)};function z(ve){return R(ve),u(ve<0?0:U(ve)|0)}g.allocUnsafe=function(ve){return z(ve)},g.allocUnsafeSlow=function(ve){return z(ve)};function F(ve,ge){if((typeof ge!="string"||ge==="")&&(ge="utf8"),!g.isEncoding(ge))throw new TypeError("Unknown encoding: "+ge);var be=Z(ve,ge)|0,Pe=u(be),We=Pe.write(ve,ge);return We!==be&&(Pe=Pe.slice(0,We)),Pe}function B(ve){for(var ge=ve.length<0?0:U(ve.length)|0,be=u(ge),Pe=0;Pe=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return ve|0}g.isBuffer=function(ge){return ge!=null&&ge._isBuffer===!0&&ge!==g.prototype},g.compare=function(ge,be){if(dr(ge,Uint8Array)&&(ge=g.from(ge,ge.offset,ge.byteLength)),dr(be,Uint8Array)&&(be=g.from(be,be.offset,be.byteLength)),!g.isBuffer(ge)||!g.isBuffer(be))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ge===be)return 0;for(var Pe=ge.length,We=be.length,ct=0,_t=Math.min(Pe,We);ct<_t;++ct)if(ge[ct]!==be[ct]){Pe=ge[ct],We=be[ct];break}return PeWe.length?(g.isBuffer(_t)||(_t=g.from(_t)),_t.copy(We,ct)):Uint8Array.prototype.set.call(We,_t,ct);else if(g.isBuffer(_t))_t.copy(We,ct);else throw new TypeError('"list" argument must be an Array of Buffers');ct+=_t.length}return We};function Z(ve,ge){if(g.isBuffer(ve))return ve.length;if(ArrayBuffer.isView(ve)||dr(ve,ArrayBuffer))return ve.byteLength;if(typeof ve!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+b(ve));var be=ve.length,Pe=arguments.length>2&&arguments[2]===!0;if(!Pe&&be===0)return 0;for(var We=!1;;)switch(ge){case"ascii":case"latin1":case"binary":return be;case"utf8":case"utf-8":return Ut(ve).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return be*2;case"hex":return be>>>1;case"base64":return Mr(ve).length;default:if(We)return Pe?-1:Ut(ve).length;ge=(""+ge).toLowerCase(),We=!0}}g.byteLength=Z;function Q(ve,ge,be){var Pe=!1;if((ge===void 0||ge<0)&&(ge=0),ge>this.length||((be===void 0||be>this.length)&&(be=this.length),be<=0)||(be>>>=0,ge>>>=0,be<=ge))return"";for(ve||(ve="utf8");;)switch(ve){case"hex":return Ae(this,ge,be);case"utf8":case"utf-8":return q(this,ge,be);case"ascii":return fe(this,ge,be);case"latin1":case"binary":return we(this,ge,be);case"base64":return ee(this,ge,be);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fe(this,ge,be);default:if(Pe)throw new TypeError("Unknown encoding: "+ve);ve=(ve+"").toLowerCase(),Pe=!0}}g.prototype._isBuffer=!0;function ue(ve,ge,be){var Pe=ve[ge];ve[ge]=ve[be],ve[be]=Pe}g.prototype.swap16=function(){var ge=this.length;if(ge%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var be=0;bebe&&(ge+=" ... "),""},_&&(g.prototype[_]=g.prototype.inspect),g.prototype.compare=function(ge,be,Pe,We,ct){if(dr(ge,Uint8Array)&&(ge=g.from(ge,ge.offset,ge.byteLength)),!g.isBuffer(ge))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+b(ge));if(be===void 0&&(be=0),Pe===void 0&&(Pe=ge?ge.length:0),We===void 0&&(We=0),ct===void 0&&(ct=this.length),be<0||Pe>ge.length||We<0||ct>this.length)throw new RangeError("out of range index");if(We>=ct&&be>=Pe)return 0;if(We>=ct)return-1;if(be>=Pe)return 1;if(be>>>=0,Pe>>>=0,We>>>=0,ct>>>=0,this===ge)return 0;for(var _t=ct-We,Mt=Pe-be,Nt=Math.min(_t,Mt),Bt=this.slice(We,ct),qt=ge.slice(be,Pe),Zt=0;Zt2147483647?be=2147483647:be<-2147483648&&(be=-2147483648),be=+be,pt(be)&&(be=We?0:ve.length-1),be<0&&(be=ve.length+be),be>=ve.length){if(We)return-1;be=ve.length-1}else if(be<0)if(We)be=0;else return-1;if(typeof ge=="string"&&(ge=g.from(ge,Pe)),g.isBuffer(ge))return ge.length===0?-1:le(ve,ge,be,Pe,We);if(typeof ge=="number")return ge=ge&255,typeof Uint8Array.prototype.indexOf=="function"?We?Uint8Array.prototype.indexOf.call(ve,ge,be):Uint8Array.prototype.lastIndexOf.call(ve,ge,be):le(ve,[ge],be,Pe,We);throw new TypeError("val must be string, number or Buffer")}function le(ve,ge,be,Pe,We){var ct=1,_t=ve.length,Mt=ge.length;if(Pe!==void 0&&(Pe=String(Pe).toLowerCase(),Pe==="ucs2"||Pe==="ucs-2"||Pe==="utf16le"||Pe==="utf-16le")){if(ve.length<2||ge.length<2)return-1;ct=2,_t/=2,Mt/=2,be/=2}function Nt(ta,da){return ct===1?ta[da]:ta.readUInt16BE(da*ct)}var Bt;if(We){var qt=-1;for(Bt=be;Bt<_t;Bt++)if(Nt(ve,Bt)===Nt(ge,qt===-1?0:Bt-qt)){if(qt===-1&&(qt=Bt),Bt-qt+1===Mt)return qt*ct}else qt!==-1&&(Bt-=Bt-qt),qt=-1}else for(be+Mt>_t&&(be=_t-Mt),Bt=be;Bt>=0;Bt--){for(var Zt=!0,lr=0;lrWe&&(Pe=We)):Pe=We;var ct=ge.length;Pe>ct/2&&(Pe=ct/2);var _t;for(_t=0;_t>>0,isFinite(Pe)?(Pe=Pe>>>0,We===void 0&&(We="utf8")):(We=Pe,Pe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ct=this.length-be;if((Pe===void 0||Pe>ct)&&(Pe=ct),ge.length>0&&(Pe<0||be<0)||be>this.length)throw new RangeError("Attempt to write outside buffer bounds");We||(We="utf8");for(var _t=!1;;)switch(We){case"hex":return j(this,ge,be,Pe);case"utf8":case"utf-8":return J(this,ge,be,Pe);case"ascii":case"latin1":case"binary":return $(this,ge,be,Pe);case"base64":return X(this,ge,be,Pe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,ge,be,Pe);default:if(_t)throw new TypeError("Unknown encoding: "+We);We=(""+We).toLowerCase(),_t=!0}},g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ee(ve,ge,be){return ge===0&&be===ve.length?S.fromByteArray(ve):S.fromByteArray(ve.slice(ge,be))}function q(ve,ge,be){be=Math.min(ve.length,be);for(var Pe=[],We=ge;We239?4:ct>223?3:ct>191?2:1;if(We+Mt<=be){var Nt=void 0,Bt=void 0,qt=void 0,Zt=void 0;switch(Mt){case 1:ct<128&&(_t=ct);break;case 2:Nt=ve[We+1],(Nt&192)===128&&(Zt=(ct&31)<<6|Nt&63,Zt>127&&(_t=Zt));break;case 3:Nt=ve[We+1],Bt=ve[We+2],(Nt&192)===128&&(Bt&192)===128&&(Zt=(ct&15)<<12|(Nt&63)<<6|Bt&63,Zt>2047&&(Zt<55296||Zt>57343)&&(_t=Zt));break;case 4:Nt=ve[We+1],Bt=ve[We+2],qt=ve[We+3],(Nt&192)===128&&(Bt&192)===128&&(qt&192)===128&&(Zt=(ct&15)<<18|(Nt&63)<<12|(Bt&63)<<6|qt&63,Zt>65535&&Zt<1114112&&(_t=Zt))}}_t===null?(_t=65533,Mt=1):_t>65535&&(_t-=65536,Pe.push(_t>>>10&1023|55296),_t=56320|_t&1023),Pe.push(_t),We+=Mt}return ie(Pe)}var ae=4096;function ie(ve){var ge=ve.length;if(ge<=ae)return String.fromCharCode.apply(String,ve);for(var be="",Pe=0;PePe)&&(be=Pe);for(var We="",ct=ge;ctPe&&(ge=Pe),be<0?(be+=Pe,be<0&&(be=0)):be>Pe&&(be=Pe),bebe)throw new RangeError("Trying to access beyond buffer length")}g.prototype.readUintLE=g.prototype.readUIntLE=function(ge,be,Pe){ge=ge>>>0,be=be>>>0,Pe||Ce(ge,be,this.length);for(var We=this[ge],ct=1,_t=0;++_t>>0,be=be>>>0,Pe||Ce(ge,be,this.length);for(var We=this[ge+--be],ct=1;be>0&&(ct*=256);)We+=this[ge+--be]*ct;return We},g.prototype.readUint8=g.prototype.readUInt8=function(ge,be){return ge=ge>>>0,be||Ce(ge,1,this.length),this[ge]},g.prototype.readUint16LE=g.prototype.readUInt16LE=function(ge,be){return ge=ge>>>0,be||Ce(ge,2,this.length),this[ge]|this[ge+1]<<8},g.prototype.readUint16BE=g.prototype.readUInt16BE=function(ge,be){return ge=ge>>>0,be||Ce(ge,2,this.length),this[ge]<<8|this[ge+1]},g.prototype.readUint32LE=g.prototype.readUInt32LE=function(ge,be){return ge=ge>>>0,be||Ce(ge,4,this.length),(this[ge]|this[ge+1]<<8|this[ge+2]<<16)+this[ge+3]*16777216},g.prototype.readUint32BE=g.prototype.readUInt32BE=function(ge,be){return ge=ge>>>0,be||Ce(ge,4,this.length),this[ge]*16777216+(this[ge+1]<<16|this[ge+2]<<8|this[ge+3])},g.prototype.readBigUInt64LE=Ge(function(ge){ge=ge>>>0,Je(ge,"offset");var be=this[ge],Pe=this[ge+7];(be===void 0||Pe===void 0)&&At(ge,this.length-8);var We=be+this[++ge]*Math.pow(2,8)+this[++ge]*Math.pow(2,16)+this[++ge]*Math.pow(2,24),ct=this[++ge]+this[++ge]*Math.pow(2,8)+this[++ge]*Math.pow(2,16)+Pe*Math.pow(2,24);return BigInt(We)+(BigInt(ct)<>>0,Je(ge,"offset");var be=this[ge],Pe=this[ge+7];(be===void 0||Pe===void 0)&&At(ge,this.length-8);var We=be*Math.pow(2,24)+this[++ge]*Math.pow(2,16)+this[++ge]*Math.pow(2,8)+this[++ge],ct=this[++ge]*Math.pow(2,24)+this[++ge]*Math.pow(2,16)+this[++ge]*Math.pow(2,8)+Pe;return(BigInt(We)<>>0,be=be>>>0,Pe||Ce(ge,be,this.length);for(var We=this[ge],ct=1,_t=0;++_t=ct&&(We-=Math.pow(2,8*be)),We},g.prototype.readIntBE=function(ge,be,Pe){ge=ge>>>0,be=be>>>0,Pe||Ce(ge,be,this.length);for(var We=be,ct=1,_t=this[ge+--We];We>0&&(ct*=256);)_t+=this[ge+--We]*ct;return ct*=128,_t>=ct&&(_t-=Math.pow(2,8*be)),_t},g.prototype.readInt8=function(ge,be){return ge=ge>>>0,be||Ce(ge,1,this.length),this[ge]&128?(255-this[ge]+1)*-1:this[ge]},g.prototype.readInt16LE=function(ge,be){ge=ge>>>0,be||Ce(ge,2,this.length);var Pe=this[ge]|this[ge+1]<<8;return Pe&32768?Pe|4294901760:Pe},g.prototype.readInt16BE=function(ge,be){ge=ge>>>0,be||Ce(ge,2,this.length);var Pe=this[ge+1]|this[ge]<<8;return Pe&32768?Pe|4294901760:Pe},g.prototype.readInt32LE=function(ge,be){return ge=ge>>>0,be||Ce(ge,4,this.length),this[ge]|this[ge+1]<<8|this[ge+2]<<16|this[ge+3]<<24},g.prototype.readInt32BE=function(ge,be){return ge=ge>>>0,be||Ce(ge,4,this.length),this[ge]<<24|this[ge+1]<<16|this[ge+2]<<8|this[ge+3]},g.prototype.readBigInt64LE=Ge(function(ge){ge=ge>>>0,Je(ge,"offset");var be=this[ge],Pe=this[ge+7];(be===void 0||Pe===void 0)&&At(ge,this.length-8);var We=this[ge+4]+this[ge+5]*Math.pow(2,8)+this[ge+6]*Math.pow(2,16)+(Pe<<24);return(BigInt(We)<>>0,Je(ge,"offset");var be=this[ge],Pe=this[ge+7];(be===void 0||Pe===void 0)&&At(ge,this.length-8);var We=(be<<24)+this[++ge]*Math.pow(2,16)+this[++ge]*Math.pow(2,8)+this[++ge];return(BigInt(We)<>>0,be||Ce(ge,4,this.length),M.read(this,ge,!0,23,4)},g.prototype.readFloatBE=function(ge,be){return ge=ge>>>0,be||Ce(ge,4,this.length),M.read(this,ge,!1,23,4)},g.prototype.readDoubleLE=function(ge,be){return ge=ge>>>0,be||Ce(ge,8,this.length),M.read(this,ge,!0,52,8)},g.prototype.readDoubleBE=function(ge,be){return ge=ge>>>0,be||Ce(ge,8,this.length),M.read(this,ge,!1,52,8)};function qe(ve,ge,be,Pe,We,ct){if(!g.isBuffer(ve))throw new TypeError('"buffer" argument must be a Buffer instance');if(ge>We||geve.length)throw new RangeError("Index out of range")}g.prototype.writeUintLE=g.prototype.writeUIntLE=function(ge,be,Pe,We){if(ge=+ge,be=be>>>0,Pe=Pe>>>0,!We){var ct=Math.pow(2,8*Pe)-1;qe(this,ge,be,Pe,ct,0)}var _t=1,Mt=0;for(this[be]=ge&255;++Mt>>0,Pe=Pe>>>0,!We){var ct=Math.pow(2,8*Pe)-1;qe(this,ge,be,Pe,ct,0)}var _t=Pe-1,Mt=1;for(this[be+_t]=ge&255;--_t>=0&&(Mt*=256);)this[be+_t]=ge/Mt&255;return be+Pe},g.prototype.writeUint8=g.prototype.writeUInt8=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,1,255,0),this[be]=ge&255,be+1},g.prototype.writeUint16LE=g.prototype.writeUInt16LE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,2,65535,0),this[be]=ge&255,this[be+1]=ge>>>8,be+2},g.prototype.writeUint16BE=g.prototype.writeUInt16BE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,2,65535,0),this[be]=ge>>>8,this[be+1]=ge&255,be+2},g.prototype.writeUint32LE=g.prototype.writeUInt32LE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,4,4294967295,0),this[be+3]=ge>>>24,this[be+2]=ge>>>16,this[be+1]=ge>>>8,this[be]=ge&255,be+4},g.prototype.writeUint32BE=g.prototype.writeUInt32BE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,4,4294967295,0),this[be]=ge>>>24,this[be+1]=ge>>>16,this[be+2]=ge>>>8,this[be+3]=ge&255,be+4};function et(ve,ge,be,Pe,We){rt(ge,Pe,We,ve,be,7);var ct=Number(ge&BigInt(4294967295));ve[be++]=ct,ct=ct>>8,ve[be++]=ct,ct=ct>>8,ve[be++]=ct,ct=ct>>8,ve[be++]=ct;var _t=Number(ge>>BigInt(32)&BigInt(4294967295));return ve[be++]=_t,_t=_t>>8,ve[be++]=_t,_t=_t>>8,ve[be++]=_t,_t=_t>>8,ve[be++]=_t,be}function Qe(ve,ge,be,Pe,We){rt(ge,Pe,We,ve,be,7);var ct=Number(ge&BigInt(4294967295));ve[be+7]=ct,ct=ct>>8,ve[be+6]=ct,ct=ct>>8,ve[be+5]=ct,ct=ct>>8,ve[be+4]=ct;var _t=Number(ge>>BigInt(32)&BigInt(4294967295));return ve[be+3]=_t,_t=_t>>8,ve[be+2]=_t,_t=_t>>8,ve[be+1]=_t,_t=_t>>8,ve[be]=_t,be+8}g.prototype.writeBigUInt64LE=Ge(function(ge){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return et(this,ge,be,BigInt(0),BigInt("0xffffffffffffffff"))}),g.prototype.writeBigUInt64BE=Ge(function(ge){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Qe(this,ge,be,BigInt(0),BigInt("0xffffffffffffffff"))}),g.prototype.writeIntLE=function(ge,be,Pe,We){if(ge=+ge,be=be>>>0,!We){var ct=Math.pow(2,8*Pe-1);qe(this,ge,be,Pe,ct-1,-ct)}var _t=0,Mt=1,Nt=0;for(this[be]=ge&255;++_t>0)-Nt&255;return be+Pe},g.prototype.writeIntBE=function(ge,be,Pe,We){if(ge=+ge,be=be>>>0,!We){var ct=Math.pow(2,8*Pe-1);qe(this,ge,be,Pe,ct-1,-ct)}var _t=Pe-1,Mt=1,Nt=0;for(this[be+_t]=ge&255;--_t>=0&&(Mt*=256);)ge<0&&Nt===0&&this[be+_t+1]!==0&&(Nt=1),this[be+_t]=(ge/Mt>>0)-Nt&255;return be+Pe},g.prototype.writeInt8=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,1,127,-128),ge<0&&(ge=255+ge+1),this[be]=ge&255,be+1},g.prototype.writeInt16LE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,2,32767,-32768),this[be]=ge&255,this[be+1]=ge>>>8,be+2},g.prototype.writeInt16BE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,2,32767,-32768),this[be]=ge>>>8,this[be+1]=ge&255,be+2},g.prototype.writeInt32LE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,4,2147483647,-2147483648),this[be]=ge&255,this[be+1]=ge>>>8,this[be+2]=ge>>>16,this[be+3]=ge>>>24,be+4},g.prototype.writeInt32BE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,4,2147483647,-2147483648),ge<0&&(ge=4294967295+ge+1),this[be]=ge>>>24,this[be+1]=ge>>>16,this[be+2]=ge>>>8,this[be+3]=ge&255,be+4},g.prototype.writeBigInt64LE=Ge(function(ge){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return et(this,ge,be,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),g.prototype.writeBigInt64BE=Ge(function(ge){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Qe(this,ge,be,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ke(ve,ge,be,Pe,We,ct){if(be+Pe>ve.length)throw new RangeError("Index out of range");if(be<0)throw new RangeError("Index out of range")}function Xe(ve,ge,be,Pe,We){return ge=+ge,be=be>>>0,We||Ke(ve,ge,be,4),M.write(ve,ge,be,Pe,23,4),be+4}g.prototype.writeFloatLE=function(ge,be,Pe){return Xe(this,ge,be,!0,Pe)},g.prototype.writeFloatBE=function(ge,be,Pe){return Xe(this,ge,be,!1,Pe)};function Me(ve,ge,be,Pe,We){return ge=+ge,be=be>>>0,We||Ke(ve,ge,be,8),M.write(ve,ge,be,Pe,52,8),be+8}g.prototype.writeDoubleLE=function(ge,be,Pe){return Me(this,ge,be,!0,Pe)},g.prototype.writeDoubleBE=function(ge,be,Pe){return Me(this,ge,be,!1,Pe)},g.prototype.copy=function(ge,be,Pe,We){if(!g.isBuffer(ge))throw new TypeError("argument should be a Buffer");if(Pe||(Pe=0),!We&&We!==0&&(We=this.length),be>=ge.length&&(be=ge.length),be||(be=0),We>0&&We=this.length)throw new RangeError("Index out of range");if(We<0)throw new RangeError("sourceEnd out of bounds");We>this.length&&(We=this.length),ge.length-be>>0,Pe=Pe===void 0?this.length:Pe>>>0,ge||(ge=0);var _t;if(typeof ge=="number")for(_t=be;_tMath.pow(2,32)?We=Re(String(be)):typeof be=="bigint"&&(We=String(be),(be>Math.pow(BigInt(2),BigInt(32))||be<-Math.pow(BigInt(2),BigInt(32)))&&(We=Re(We)),We+="n"),Pe+=" It must be ".concat(ge,". Received ").concat(We),Pe},RangeError);function Re(ve){for(var ge="",be=ve.length,Pe=ve[0]==="-"?1:0;be>=Pe+4;be-=3)ge="_".concat(ve.slice(be-3,be)).concat(ge);return"".concat(ve.slice(0,be)).concat(ge)}function $e(ve,ge,be){Je(ge,"offset"),(ve[ge]===void 0||ve[ge+be]===void 0)&&At(ge,ve.length-(be+1))}function rt(ve,ge,be,Pe,We,ct){if(ve>be||ve= 0".concat(_t," and < 2").concat(_t," ** ").concat((ct+1)*8).concat(_t):Mt=">= -(2".concat(_t," ** ").concat((ct+1)*8-1).concat(_t,") and < 2 ** ")+"".concat((ct+1)*8-1).concat(_t),new xe.ERR_OUT_OF_RANGE("value",Mt,ve)}$e(Pe,We,ct)}function Je(ve,ge){if(typeof ve!="number")throw new xe.ERR_INVALID_ARG_TYPE(ge,"number",ve)}function At(ve,ge,be){throw Math.floor(ve)!==ve?(Je(ve,be),new xe.ERR_OUT_OF_RANGE("offset","an integer",ve)):ge<0?new xe.ERR_BUFFER_OUT_OF_BOUNDS:new xe.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(ge),ve)}var St=/[^+/0-9A-Za-z-_]/g;function Rt(ve){if(ve=ve.split("=")[0],ve=ve.trim().replace(St,""),ve.length<2)return"";for(;ve.length%4!==0;)ve=ve+"=";return ve}function Ut(ve,ge){ge=ge||1/0;for(var be,Pe=ve.length,We=null,ct=[],_t=0;_t55295&&be<57344){if(!We){if(be>56319){(ge-=3)>-1&&ct.push(239,191,189);continue}else if(_t+1===Pe){(ge-=3)>-1&&ct.push(239,191,189);continue}We=be;continue}if(be<56320){(ge-=3)>-1&&ct.push(239,191,189),We=be;continue}be=(We-55296<<10|be-56320)+65536}else We&&(ge-=3)>-1&&ct.push(239,191,189);if(We=null,be<128){if((ge-=1)<0)break;ct.push(be)}else if(be<2048){if((ge-=2)<0)break;ct.push(be>>6|192,be&63|128)}else if(be<65536){if((ge-=3)<0)break;ct.push(be>>12|224,be>>6&63|128,be&63|128)}else if(be<1114112){if((ge-=4)<0)break;ct.push(be>>18|240,be>>12&63|128,be>>6&63|128,be&63|128)}else throw new Error("Invalid code point")}return ct}function ir(ve){for(var ge=[],be=0;be>8,We=be%256,ct.push(We),ct.push(Pe);return ct}function Mr(ve){return S.toByteArray(Rt(ve))}function fr(ve,ge,be,Pe){var We;for(We=0;We=ge.length||We>=ve.length);++We)ge[We+be]=ve[We];return We}function dr(ve,ge){return ve instanceof ge||ve!=null&&ve.constructor!=null&&ve.constructor.name!=null&&ve.constructor.name===ge.name}function pt(ve){return ve!==ve}var ze=function(){for(var ve="0123456789abcdef",ge=new Array(256),be=0;be<16;++be)for(var Pe=be*16,We=0;We<16;++We)ge[Pe+We]=ve[be]+ve[We];return ge}();function Ge(ve){return typeof BigInt>"u"?Oe:ve}function Oe(){throw new Error("BigInt not supported")}},9216:function(e){e.exports=a,e.exports.isMobile=a,e.exports.default=a;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,o=/android|ipad|playbook|silk/i;function a(i){i||(i={});var n=i.ua;if(!n&&typeof navigator<"u"&&(n=navigator.userAgent),n&&n.headers&&typeof n.headers["user-agent"]=="string"&&(n=n.headers["user-agent"]),typeof n!="string")return!1;var s=t.test(n)&&!r.test(n)||!!i.tablet&&o.test(n);return!s&&i.tablet&&i.featureDetect&&navigator&&navigator.maxTouchPoints>1&&n.indexOf("Macintosh")!==-1&&n.indexOf("Safari")!==-1&&(s=!0),s}},6296:function(e,t,r){e.exports=c;var o=r(7261),a=r(9977),i=r(1811);function n(f,v){this._controllerNames=Object.keys(f),this._controllerList=this._controllerNames.map(function(h){return f[h]}),this._mode=v,this._active=f[v],this._active||(this._mode="turntable",this._active=f.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=n.prototype;s.flush=function(f){for(var v=this._controllerList,h=0;h"u"?r(1538):WeakMap,a=r(2762),i=r(8116),n=new o;function s(c){var f=n.get(c),v=f&&(f._triangleBuffer.handle||f._triangleBuffer.buffer);if(!v||!c.isBuffer(v)){var h=a(c,new Float32Array([-1,-1,-1,4,4,-1]));f=i(c,[{buffer:h,type:c.FLOAT,size:2}]),f._triangleBuffer=h,n.set(c,f)}f.bind(),c.drawArrays(c.TRIANGLES,0,3),f.unbind()}e.exports=s},1085:function(e,t,r){var o=r(1371);e.exports=a;function a(i,n,s){n=typeof n=="number"?n:1,s=s||": ";var c=i.split(/\r?\n/),f=String(c.length+n-1).length;return c.map(function(v,h){var T=h+n,l=String(T).length,y=o(T,f-l);return y+s+v}).join(` +`)}},3952:function(e,t,r){e.exports=i;var o=r(3250);function a(n,s){for(var c=new Array(s+1),f=0;f0)throw new Error("Invalid string. Length must be a multiple of 4");var M=b.indexOf("=");M===-1&&(M=S);var _=M===S?0:4-M%4;return[M,_]}function f(b){var S=c(b),M=S[0],_=S[1];return(M+_)*3/4-_}function v(b,S,M){return(S+M)*3/4-M}function h(b){var S,M=c(b),_=M[0],w=M[1],p=new a(v(b,_,w)),u=0,g=w>0?_-4:_,m;for(m=0;m>16&255,p[u++]=S>>8&255,p[u++]=S&255;return w===2&&(S=o[b.charCodeAt(m)]<<2|o[b.charCodeAt(m+1)]>>4,p[u++]=S&255),w===1&&(S=o[b.charCodeAt(m)]<<10|o[b.charCodeAt(m+1)]<<4|o[b.charCodeAt(m+2)]>>2,p[u++]=S>>8&255,p[u++]=S&255),p}function T(b){return r[b>>18&63]+r[b>>12&63]+r[b>>6&63]+r[b&63]}function l(b,S,M){for(var _,w=[],p=S;pg?g:u+p));return _===1?(S=b[M-1],w.push(r[S>>2]+r[S<<4&63]+"==")):_===2&&(S=(b[M-2]<<8)+b[M-1],w.push(r[S>>10]+r[S>>4&63]+r[S<<2&63]+"=")),w.join("")}},3865:function(e,t,r){var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]).add(n[0].mul(i[1])),i[1].mul(n[1]))}},1318:function(e){e.exports=t;function t(r,o){return r[0].mul(o[1]).cmp(o[0].mul(r[1]))}},8697:function(e,t,r){var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]),i[1].mul(n[0]))}},7842:function(e,t,r){var o=r(6330),a=r(1533),i=r(2651),n=r(6768),s=r(869),c=r(8697);e.exports=f;function f(v,h){if(o(v))return h?c(v,f(h)):[v[0].clone(),v[1].clone()];var T=0,l,y;if(a(v))l=v.clone();else if(typeof v=="string")l=n(v);else{if(v===0)return[i(0),i(1)];if(v===Math.floor(v))l=i(v);else{for(;v!==Math.floor(v);)v=v*Math.pow(2,256),T-=256;l=i(v)}}if(o(h))l.mul(h[1]),y=h[0].clone();else if(a(h))y=h.clone();else if(typeof h=="string")y=n(h);else if(!h)y=i(1);else if(h===Math.floor(h))y=i(h);else{for(;h!==Math.floor(h);)h=h*Math.pow(2,256),T+=256;y=i(h)}return T>0?l=l.ushln(T):T<0&&(y=y.ushln(-T)),s(l,y)}},6330:function(e,t,r){var o=r(1533);e.exports=a;function a(i){return Array.isArray(i)&&i.length===2&&o(i[0])&&o(i[1])}},5716:function(e,t,r){var o=r(6859);e.exports=a;function a(i){return i.cmp(new o(0))}},1369:function(e,t,r){var o=r(5716);e.exports=a;function a(i){var n=i.length,s=i.words,c=0;if(n===1)c=s[0];else if(n===2)c=s[0]+s[1]*67108864;else for(var f=0;f20?52:c+32}},1533:function(e,t,r){r(6859),e.exports=o;function o(a){return a&&typeof a=="object"&&!!a.words}},2651:function(e,t,r){var o=r(6859),a=r(2361);e.exports=i;function i(n){var s=a.exponent(n);return s<52?new o(n):new o(n*Math.pow(2,52-s)).ushln(s-52)}},869:function(e,t,r){var o=r(2651),a=r(5716);e.exports=i;function i(n,s){var c=a(n),f=a(s);if(c===0)return[o(0),o(1)];if(f===0)return[o(0),o(0)];f<0&&(n=n.neg(),s=s.neg());var v=n.gcd(s);return v.cmpn(1)?[n.div(v),s.div(v)]:[n,s]}},6768:function(e,t,r){var o=r(6859);e.exports=a;function a(i){return new o(i)}},6504:function(e,t,r){var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[0]),i[1].mul(n[1]))}},7721:function(e,t,r){var o=r(5716);e.exports=a;function a(i){return o(i[0])*o(i[1])}},5572:function(e,t,r){var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]).sub(i[1].mul(n[0])),i[1].mul(n[1]))}},946:function(e,t,r){var o=r(1369),a=r(4025);e.exports=i;function i(n){var s=n[0],c=n[1];if(s.cmpn(0)===0)return 0;var f=s.abs().divmod(c.abs()),v=f.div,h=o(v),T=f.mod,l=s.negative!==c.negative?-1:1;if(T.cmpn(0)===0)return l*h;if(h){var y=a(h)+4,b=o(T.ushln(y).divRound(c));return l*(h+b*Math.pow(2,-y))}else{var S=c.bitLength()-T.bitLength()+53,b=o(T.ushln(S).divRound(c));return S<1023?l*b*Math.pow(2,-S):(b*=Math.pow(2,-1023),l*b*Math.pow(2,1023-S))}}},2478:function(e){function t(s,c,f,v,h){for(var T=h+1;v<=h;){var l=v+h>>>1,y=s[l],b=f!==void 0?f(y,c):y-c;b>=0?(T=l,h=l-1):v=l+1}return T}function r(s,c,f,v,h){for(var T=h+1;v<=h;){var l=v+h>>>1,y=s[l],b=f!==void 0?f(y,c):y-c;b>0?(T=l,h=l-1):v=l+1}return T}function o(s,c,f,v,h){for(var T=v-1;v<=h;){var l=v+h>>>1,y=s[l],b=f!==void 0?f(y,c):y-c;b<0?(T=l,v=l+1):h=l-1}return T}function a(s,c,f,v,h){for(var T=v-1;v<=h;){var l=v+h>>>1,y=s[l],b=f!==void 0?f(y,c):y-c;b<=0?(T=l,v=l+1):h=l-1}return T}function i(s,c,f,v,h){for(;v<=h;){var T=v+h>>>1,l=s[T],y=f!==void 0?f(l,c):l-c;if(y===0)return T;y<=0?v=T+1:h=T-1}return-1}function n(s,c,f,v,h,T){return typeof f=="function"?T(s,c,f,v===void 0?0:v|0,h===void 0?s.length-1:h|0):T(s,c,void 0,f===void 0?0:f|0,v===void 0?s.length-1:v|0)}e.exports={ge:function(s,c,f,v,h){return n(s,c,f,v,h,t)},gt:function(s,c,f,v,h){return n(s,c,f,v,h,r)},lt:function(s,c,f,v,h){return n(s,c,f,v,h,o)},le:function(s,c,f,v,h){return n(s,c,f,v,h,a)},eq:function(s,c,f,v,h){return n(s,c,f,v,h,i)}}},8828:function(e,t){"use restrict";var r=32;t.INT_BITS=r,t.INT_MAX=2147483647,t.INT_MIN=-1<0)-(i<0)},t.abs=function(i){var n=i>>r-1;return(i^n)-n},t.min=function(i,n){return n^(i^n)&-(i65535)<<4,i>>>=n,s=(i>255)<<3,i>>>=s,n|=s,s=(i>15)<<2,i>>>=s,n|=s,s=(i>3)<<1,i>>>=s,n|=s,n|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var n=32;return i&=-i,i&&n--,i&65535&&(n-=16),i&16711935&&(n-=8),i&252645135&&(n-=4),i&858993459&&(n-=2),i&1431655765&&(n-=1),n}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var a=new Array(256);(function(i){for(var n=0;n<256;++n){var s=n,c=n,f=7;for(s>>>=1;s;s>>>=1)c<<=1,c|=s&1,--f;i[n]=c<>>8&255]<<16|a[i>>>16&255]<<8|a[i>>>24&255]},t.interleave2=function(i,n){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,n&=65535,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,i|n<<1},t.deinterleave2=function(i,n){return i=i>>>n&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,n,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,i|=n<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,n){return i=i>>>n&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var n=i|i-1;return n+1|(~n&-~n)-1>>>o(i)+1}},6859:function(e,t,r){e=r.nmd(e),function(o,a){function i(O,L){if(!O)throw new Error(L||"Assertion failed")}function n(O,L){O.super_=L;var N=function(){};N.prototype=L.prototype,O.prototype=new N,O.prototype.constructor=O}function s(O,L,N){if(s.isBN(O))return O;this.negative=0,this.words=null,this.length=0,this.red=null,O!==null&&((L==="le"||L==="be")&&(N=L,L=10),this._init(O||0,L||10,N||"be"))}typeof o=="object"?o.exports=s:a.BN=s,s.BN=s,s.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=r(7790).Buffer}catch{}s.isBN=function(L){return L instanceof s?!0:L!==null&&typeof L=="object"&&L.constructor.wordSize===s.wordSize&&Array.isArray(L.words)},s.max=function(L,N){return L.cmp(N)>0?L:N},s.min=function(L,N){return L.cmp(N)<0?L:N},s.prototype._init=function(L,N,U){if(typeof L=="number")return this._initNumber(L,N,U);if(typeof L=="object")return this._initArray(L,N,U);N==="hex"&&(N=16),i(N===(N|0)&&N>=2&&N<=36),L=L.toString().replace(/\s+/g,"");var Z=0;L[0]==="-"&&(Z++,this.negative=1),Z=0;Z-=3)ue=L[Z]|L[Z-1]<<8|L[Z-2]<<16,this.words[Q]|=ue<>>26-oe&67108863,oe+=24,oe>=26&&(oe-=26,Q++);else if(U==="le")for(Z=0,Q=0;Z>>26-oe&67108863,oe+=24,oe>=26&&(oe-=26,Q++);return this.strip()};function f(O,L){var N=O.charCodeAt(L);return N>=65&&N<=70?N-55:N>=97&&N<=102?N-87:N-48&15}function v(O,L,N){var U=f(O,N);return N-1>=L&&(U|=f(O,N-1)<<4),U}s.prototype._parseHex=function(L,N,U){this.length=Math.ceil((L.length-N)/6),this.words=new Array(this.length);for(var Z=0;Z=N;Z-=2)oe=v(L,N,Z)<=18?(Q-=18,ue+=1,this.words[ue]|=oe>>>26):Q+=8;else{var le=L.length-N;for(Z=le%2===0?N+1:N;Z=18?(Q-=18,ue+=1,this.words[ue]|=oe>>>26):Q+=8}this.strip()};function h(O,L,N,U){for(var Z=0,Q=Math.min(O.length,N),ue=L;ue=49?Z+=oe-49+10:oe>=17?Z+=oe-17+10:Z+=oe}return Z}s.prototype._parseBase=function(L,N,U){this.words=[0],this.length=1;for(var Z=0,Q=1;Q<=67108863;Q*=N)Z++;Z--,Q=Q/N|0;for(var ue=L.length-U,oe=ue%Z,le=Math.min(ue,ue-oe)+U,j=0,J=U;J1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var T=["","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"],l=[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],y=[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];s.prototype.toString=function(L,N){L=L||10,N=N|0||1;var U;if(L===16||L==="hex"){U="";for(var Z=0,Q=0,ue=0;ue>>24-Z&16777215,Q!==0||ue!==this.length-1?U=T[6-le.length]+le+U:U=le+U,Z+=2,Z>=26&&(Z-=26,ue--)}for(Q!==0&&(U=Q.toString(16)+U);U.length%N!==0;)U="0"+U;return this.negative!==0&&(U="-"+U),U}if(L===(L|0)&&L>=2&&L<=36){var j=l[L],J=y[L];U="";var $=this.clone();for($.negative=0;!$.isZero();){var X=$.modn(J).toString(L);$=$.idivn(J),$.isZero()?U=X+U:U=T[j-X.length]+X+U}for(this.isZero()&&(U="0"+U);U.length%N!==0;)U="0"+U;return this.negative!==0&&(U="-"+U),U}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var L=this.words[0];return this.length===2?L+=this.words[1]*67108864:this.length===3&&this.words[2]===1?L+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-L:L},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(L,N){return i(typeof c<"u"),this.toArrayLike(c,L,N)},s.prototype.toArray=function(L,N){return this.toArrayLike(Array,L,N)},s.prototype.toArrayLike=function(L,N,U){var Z=this.byteLength(),Q=U||Math.max(1,Z);i(Z<=Q,"byte array longer than desired length"),i(Q>0,"Requested array length <= 0"),this.strip();var ue=N==="le",oe=new L(Q),le,j,J=this.clone();if(ue){for(j=0;!J.isZero();j++)le=J.andln(255),J.iushrn(8),oe[j]=le;for(;j=4096&&(U+=13,N>>>=13),N>=64&&(U+=7,N>>>=7),N>=8&&(U+=4,N>>>=4),N>=2&&(U+=2,N>>>=2),U+N},s.prototype._zeroBits=function(L){if(L===0)return 26;var N=L,U=0;return N&8191||(U+=13,N>>>=13),N&127||(U+=7,N>>>=7),N&15||(U+=4,N>>>=4),N&3||(U+=2,N>>>=2),N&1||U++,U},s.prototype.bitLength=function(){var L=this.words[this.length-1],N=this._countBits(L);return(this.length-1)*26+N};function b(O){for(var L=new Array(O.bitLength()),N=0;N>>Z}return L}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var L=0,N=0;NL.length?this.clone().ior(L):L.clone().ior(this)},s.prototype.uor=function(L){return this.length>L.length?this.clone().iuor(L):L.clone().iuor(this)},s.prototype.iuand=function(L){var N;this.length>L.length?N=L:N=this;for(var U=0;UL.length?this.clone().iand(L):L.clone().iand(this)},s.prototype.uand=function(L){return this.length>L.length?this.clone().iuand(L):L.clone().iuand(this)},s.prototype.iuxor=function(L){var N,U;this.length>L.length?(N=this,U=L):(N=L,U=this);for(var Z=0;ZL.length?this.clone().ixor(L):L.clone().ixor(this)},s.prototype.uxor=function(L){return this.length>L.length?this.clone().iuxor(L):L.clone().iuxor(this)},s.prototype.inotn=function(L){i(typeof L=="number"&&L>=0);var N=Math.ceil(L/26)|0,U=L%26;this._expand(N),U>0&&N--;for(var Z=0;Z0&&(this.words[Z]=~this.words[Z]&67108863>>26-U),this.strip()},s.prototype.notn=function(L){return this.clone().inotn(L)},s.prototype.setn=function(L,N){i(typeof L=="number"&&L>=0);var U=L/26|0,Z=L%26;return this._expand(U+1),N?this.words[U]=this.words[U]|1<L.length?(U=this,Z=L):(U=L,Z=this);for(var Q=0,ue=0;ue>>26;for(;Q!==0&&ue>>26;if(this.length=U.length,Q!==0)this.words[this.length]=Q,this.length++;else if(U!==this)for(;ueL.length?this.clone().iadd(L):L.clone().iadd(this)},s.prototype.isub=function(L){if(L.negative!==0){L.negative=0;var N=this.iadd(L);return L.negative=1,N._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(L),this.negative=1,this._normSign();var U=this.cmp(L);if(U===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,Q;U>0?(Z=this,Q=L):(Z=L,Q=this);for(var ue=0,oe=0;oe>26,this.words[oe]=N&67108863;for(;ue!==0&&oe>26,this.words[oe]=N&67108863;if(ue===0&&oe>>26,$=le&67108863,X=Math.min(j,L.length-1),re=Math.max(0,j-O.length+1);re<=X;re++){var ee=j-re|0;Z=O.words[ee]|0,Q=L.words[re]|0,ue=Z*Q+$,J+=ue/67108864|0,$=ue&67108863}N.words[j]=$|0,le=J|0}return le!==0?N.words[j]=le|0:N.length--,N.strip()}var M=function(L,N,U){var Z=L.words,Q=N.words,ue=U.words,oe=0,le,j,J,$=Z[0]|0,X=$&8191,re=$>>>13,ee=Z[1]|0,q=ee&8191,ae=ee>>>13,ie=Z[2]|0,fe=ie&8191,we=ie>>>13,Ae=Z[3]|0,Fe=Ae&8191,Ce=Ae>>>13,qe=Z[4]|0,et=qe&8191,Qe=qe>>>13,Ke=Z[5]|0,Xe=Ke&8191,Me=Ke>>>13,xe=Z[6]|0,ce=xe&8191,Re=xe>>>13,$e=Z[7]|0,rt=$e&8191,Je=$e>>>13,At=Z[8]|0,St=At&8191,Rt=At>>>13,Ut=Z[9]|0,ir=Ut&8191,ar=Ut>>>13,Mr=Q[0]|0,fr=Mr&8191,dr=Mr>>>13,pt=Q[1]|0,ze=pt&8191,Ge=pt>>>13,Oe=Q[2]|0,ve=Oe&8191,ge=Oe>>>13,be=Q[3]|0,Pe=be&8191,We=be>>>13,ct=Q[4]|0,_t=ct&8191,Mt=ct>>>13,Nt=Q[5]|0,Bt=Nt&8191,qt=Nt>>>13,Zt=Q[6]|0,lr=Zt&8191,ta=Zt>>>13,da=Q[7]|0,wa=da&8191,ma=da>>>13,Ia=Q[8]|0,va=Ia&8191,La=Ia>>>13,Ka=Q[9]|0,Vt=Ka&8191,Lt=Ka>>>13;U.negative=L.negative^N.negative,U.length=19,le=Math.imul(X,fr),j=Math.imul(X,dr),j=j+Math.imul(re,fr)|0,J=Math.imul(re,dr);var jt=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(jt>>>26)|0,jt&=67108863,le=Math.imul(q,fr),j=Math.imul(q,dr),j=j+Math.imul(ae,fr)|0,J=Math.imul(ae,dr),le=le+Math.imul(X,ze)|0,j=j+Math.imul(X,Ge)|0,j=j+Math.imul(re,ze)|0,J=J+Math.imul(re,Ge)|0;var Ot=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,le=Math.imul(fe,fr),j=Math.imul(fe,dr),j=j+Math.imul(we,fr)|0,J=Math.imul(we,dr),le=le+Math.imul(q,ze)|0,j=j+Math.imul(q,Ge)|0,j=j+Math.imul(ae,ze)|0,J=J+Math.imul(ae,Ge)|0,le=le+Math.imul(X,ve)|0,j=j+Math.imul(X,ge)|0,j=j+Math.imul(re,ve)|0,J=J+Math.imul(re,ge)|0;var gr=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(gr>>>26)|0,gr&=67108863,le=Math.imul(Fe,fr),j=Math.imul(Fe,dr),j=j+Math.imul(Ce,fr)|0,J=Math.imul(Ce,dr),le=le+Math.imul(fe,ze)|0,j=j+Math.imul(fe,Ge)|0,j=j+Math.imul(we,ze)|0,J=J+Math.imul(we,Ge)|0,le=le+Math.imul(q,ve)|0,j=j+Math.imul(q,ge)|0,j=j+Math.imul(ae,ve)|0,J=J+Math.imul(ae,ge)|0,le=le+Math.imul(X,Pe)|0,j=j+Math.imul(X,We)|0,j=j+Math.imul(re,Pe)|0,J=J+Math.imul(re,We)|0;var Br=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Br>>>26)|0,Br&=67108863,le=Math.imul(et,fr),j=Math.imul(et,dr),j=j+Math.imul(Qe,fr)|0,J=Math.imul(Qe,dr),le=le+Math.imul(Fe,ze)|0,j=j+Math.imul(Fe,Ge)|0,j=j+Math.imul(Ce,ze)|0,J=J+Math.imul(Ce,Ge)|0,le=le+Math.imul(fe,ve)|0,j=j+Math.imul(fe,ge)|0,j=j+Math.imul(we,ve)|0,J=J+Math.imul(we,ge)|0,le=le+Math.imul(q,Pe)|0,j=j+Math.imul(q,We)|0,j=j+Math.imul(ae,Pe)|0,J=J+Math.imul(ae,We)|0,le=le+Math.imul(X,_t)|0,j=j+Math.imul(X,Mt)|0,j=j+Math.imul(re,_t)|0,J=J+Math.imul(re,Mt)|0;var na=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(na>>>26)|0,na&=67108863,le=Math.imul(Xe,fr),j=Math.imul(Xe,dr),j=j+Math.imul(Me,fr)|0,J=Math.imul(Me,dr),le=le+Math.imul(et,ze)|0,j=j+Math.imul(et,Ge)|0,j=j+Math.imul(Qe,ze)|0,J=J+Math.imul(Qe,Ge)|0,le=le+Math.imul(Fe,ve)|0,j=j+Math.imul(Fe,ge)|0,j=j+Math.imul(Ce,ve)|0,J=J+Math.imul(Ce,ge)|0,le=le+Math.imul(fe,Pe)|0,j=j+Math.imul(fe,We)|0,j=j+Math.imul(we,Pe)|0,J=J+Math.imul(we,We)|0,le=le+Math.imul(q,_t)|0,j=j+Math.imul(q,Mt)|0,j=j+Math.imul(ae,_t)|0,J=J+Math.imul(ae,Mt)|0,le=le+Math.imul(X,Bt)|0,j=j+Math.imul(X,qt)|0,j=j+Math.imul(re,Bt)|0,J=J+Math.imul(re,qt)|0;var Ur=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,le=Math.imul(ce,fr),j=Math.imul(ce,dr),j=j+Math.imul(Re,fr)|0,J=Math.imul(Re,dr),le=le+Math.imul(Xe,ze)|0,j=j+Math.imul(Xe,Ge)|0,j=j+Math.imul(Me,ze)|0,J=J+Math.imul(Me,Ge)|0,le=le+Math.imul(et,ve)|0,j=j+Math.imul(et,ge)|0,j=j+Math.imul(Qe,ve)|0,J=J+Math.imul(Qe,ge)|0,le=le+Math.imul(Fe,Pe)|0,j=j+Math.imul(Fe,We)|0,j=j+Math.imul(Ce,Pe)|0,J=J+Math.imul(Ce,We)|0,le=le+Math.imul(fe,_t)|0,j=j+Math.imul(fe,Mt)|0,j=j+Math.imul(we,_t)|0,J=J+Math.imul(we,Mt)|0,le=le+Math.imul(q,Bt)|0,j=j+Math.imul(q,qt)|0,j=j+Math.imul(ae,Bt)|0,J=J+Math.imul(ae,qt)|0,le=le+Math.imul(X,lr)|0,j=j+Math.imul(X,ta)|0,j=j+Math.imul(re,lr)|0,J=J+Math.imul(re,ta)|0;var ga=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(ga>>>26)|0,ga&=67108863,le=Math.imul(rt,fr),j=Math.imul(rt,dr),j=j+Math.imul(Je,fr)|0,J=Math.imul(Je,dr),le=le+Math.imul(ce,ze)|0,j=j+Math.imul(ce,Ge)|0,j=j+Math.imul(Re,ze)|0,J=J+Math.imul(Re,Ge)|0,le=le+Math.imul(Xe,ve)|0,j=j+Math.imul(Xe,ge)|0,j=j+Math.imul(Me,ve)|0,J=J+Math.imul(Me,ge)|0,le=le+Math.imul(et,Pe)|0,j=j+Math.imul(et,We)|0,j=j+Math.imul(Qe,Pe)|0,J=J+Math.imul(Qe,We)|0,le=le+Math.imul(Fe,_t)|0,j=j+Math.imul(Fe,Mt)|0,j=j+Math.imul(Ce,_t)|0,J=J+Math.imul(Ce,Mt)|0,le=le+Math.imul(fe,Bt)|0,j=j+Math.imul(fe,qt)|0,j=j+Math.imul(we,Bt)|0,J=J+Math.imul(we,qt)|0,le=le+Math.imul(q,lr)|0,j=j+Math.imul(q,ta)|0,j=j+Math.imul(ae,lr)|0,J=J+Math.imul(ae,ta)|0,le=le+Math.imul(X,wa)|0,j=j+Math.imul(X,ma)|0,j=j+Math.imul(re,wa)|0,J=J+Math.imul(re,ma)|0;var Aa=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Aa>>>26)|0,Aa&=67108863,le=Math.imul(St,fr),j=Math.imul(St,dr),j=j+Math.imul(Rt,fr)|0,J=Math.imul(Rt,dr),le=le+Math.imul(rt,ze)|0,j=j+Math.imul(rt,Ge)|0,j=j+Math.imul(Je,ze)|0,J=J+Math.imul(Je,Ge)|0,le=le+Math.imul(ce,ve)|0,j=j+Math.imul(ce,ge)|0,j=j+Math.imul(Re,ve)|0,J=J+Math.imul(Re,ge)|0,le=le+Math.imul(Xe,Pe)|0,j=j+Math.imul(Xe,We)|0,j=j+Math.imul(Me,Pe)|0,J=J+Math.imul(Me,We)|0,le=le+Math.imul(et,_t)|0,j=j+Math.imul(et,Mt)|0,j=j+Math.imul(Qe,_t)|0,J=J+Math.imul(Qe,Mt)|0,le=le+Math.imul(Fe,Bt)|0,j=j+Math.imul(Fe,qt)|0,j=j+Math.imul(Ce,Bt)|0,J=J+Math.imul(Ce,qt)|0,le=le+Math.imul(fe,lr)|0,j=j+Math.imul(fe,ta)|0,j=j+Math.imul(we,lr)|0,J=J+Math.imul(we,ta)|0,le=le+Math.imul(q,wa)|0,j=j+Math.imul(q,ma)|0,j=j+Math.imul(ae,wa)|0,J=J+Math.imul(ae,ma)|0,le=le+Math.imul(X,va)|0,j=j+Math.imul(X,La)|0,j=j+Math.imul(re,va)|0,J=J+Math.imul(re,La)|0;var Pa=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Pa>>>26)|0,Pa&=67108863,le=Math.imul(ir,fr),j=Math.imul(ir,dr),j=j+Math.imul(ar,fr)|0,J=Math.imul(ar,dr),le=le+Math.imul(St,ze)|0,j=j+Math.imul(St,Ge)|0,j=j+Math.imul(Rt,ze)|0,J=J+Math.imul(Rt,Ge)|0,le=le+Math.imul(rt,ve)|0,j=j+Math.imul(rt,ge)|0,j=j+Math.imul(Je,ve)|0,J=J+Math.imul(Je,ge)|0,le=le+Math.imul(ce,Pe)|0,j=j+Math.imul(ce,We)|0,j=j+Math.imul(Re,Pe)|0,J=J+Math.imul(Re,We)|0,le=le+Math.imul(Xe,_t)|0,j=j+Math.imul(Xe,Mt)|0,j=j+Math.imul(Me,_t)|0,J=J+Math.imul(Me,Mt)|0,le=le+Math.imul(et,Bt)|0,j=j+Math.imul(et,qt)|0,j=j+Math.imul(Qe,Bt)|0,J=J+Math.imul(Qe,qt)|0,le=le+Math.imul(Fe,lr)|0,j=j+Math.imul(Fe,ta)|0,j=j+Math.imul(Ce,lr)|0,J=J+Math.imul(Ce,ta)|0,le=le+Math.imul(fe,wa)|0,j=j+Math.imul(fe,ma)|0,j=j+Math.imul(we,wa)|0,J=J+Math.imul(we,ma)|0,le=le+Math.imul(q,va)|0,j=j+Math.imul(q,La)|0,j=j+Math.imul(ae,va)|0,J=J+Math.imul(ae,La)|0,le=le+Math.imul(X,Vt)|0,j=j+Math.imul(X,Lt)|0,j=j+Math.imul(re,Vt)|0,J=J+Math.imul(re,Lt)|0;var sa=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(sa>>>26)|0,sa&=67108863,le=Math.imul(ir,ze),j=Math.imul(ir,Ge),j=j+Math.imul(ar,ze)|0,J=Math.imul(ar,Ge),le=le+Math.imul(St,ve)|0,j=j+Math.imul(St,ge)|0,j=j+Math.imul(Rt,ve)|0,J=J+Math.imul(Rt,ge)|0,le=le+Math.imul(rt,Pe)|0,j=j+Math.imul(rt,We)|0,j=j+Math.imul(Je,Pe)|0,J=J+Math.imul(Je,We)|0,le=le+Math.imul(ce,_t)|0,j=j+Math.imul(ce,Mt)|0,j=j+Math.imul(Re,_t)|0,J=J+Math.imul(Re,Mt)|0,le=le+Math.imul(Xe,Bt)|0,j=j+Math.imul(Xe,qt)|0,j=j+Math.imul(Me,Bt)|0,J=J+Math.imul(Me,qt)|0,le=le+Math.imul(et,lr)|0,j=j+Math.imul(et,ta)|0,j=j+Math.imul(Qe,lr)|0,J=J+Math.imul(Qe,ta)|0,le=le+Math.imul(Fe,wa)|0,j=j+Math.imul(Fe,ma)|0,j=j+Math.imul(Ce,wa)|0,J=J+Math.imul(Ce,ma)|0,le=le+Math.imul(fe,va)|0,j=j+Math.imul(fe,La)|0,j=j+Math.imul(we,va)|0,J=J+Math.imul(we,La)|0,le=le+Math.imul(q,Vt)|0,j=j+Math.imul(q,Lt)|0,j=j+Math.imul(ae,Vt)|0,J=J+Math.imul(ae,Lt)|0;var Oa=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Oa>>>26)|0,Oa&=67108863,le=Math.imul(ir,ve),j=Math.imul(ir,ge),j=j+Math.imul(ar,ve)|0,J=Math.imul(ar,ge),le=le+Math.imul(St,Pe)|0,j=j+Math.imul(St,We)|0,j=j+Math.imul(Rt,Pe)|0,J=J+Math.imul(Rt,We)|0,le=le+Math.imul(rt,_t)|0,j=j+Math.imul(rt,Mt)|0,j=j+Math.imul(Je,_t)|0,J=J+Math.imul(Je,Mt)|0,le=le+Math.imul(ce,Bt)|0,j=j+Math.imul(ce,qt)|0,j=j+Math.imul(Re,Bt)|0,J=J+Math.imul(Re,qt)|0,le=le+Math.imul(Xe,lr)|0,j=j+Math.imul(Xe,ta)|0,j=j+Math.imul(Me,lr)|0,J=J+Math.imul(Me,ta)|0,le=le+Math.imul(et,wa)|0,j=j+Math.imul(et,ma)|0,j=j+Math.imul(Qe,wa)|0,J=J+Math.imul(Qe,ma)|0,le=le+Math.imul(Fe,va)|0,j=j+Math.imul(Fe,La)|0,j=j+Math.imul(Ce,va)|0,J=J+Math.imul(Ce,La)|0,le=le+Math.imul(fe,Vt)|0,j=j+Math.imul(fe,Lt)|0,j=j+Math.imul(we,Vt)|0,J=J+Math.imul(we,Lt)|0;var dt=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(dt>>>26)|0,dt&=67108863,le=Math.imul(ir,Pe),j=Math.imul(ir,We),j=j+Math.imul(ar,Pe)|0,J=Math.imul(ar,We),le=le+Math.imul(St,_t)|0,j=j+Math.imul(St,Mt)|0,j=j+Math.imul(Rt,_t)|0,J=J+Math.imul(Rt,Mt)|0,le=le+Math.imul(rt,Bt)|0,j=j+Math.imul(rt,qt)|0,j=j+Math.imul(Je,Bt)|0,J=J+Math.imul(Je,qt)|0,le=le+Math.imul(ce,lr)|0,j=j+Math.imul(ce,ta)|0,j=j+Math.imul(Re,lr)|0,J=J+Math.imul(Re,ta)|0,le=le+Math.imul(Xe,wa)|0,j=j+Math.imul(Xe,ma)|0,j=j+Math.imul(Me,wa)|0,J=J+Math.imul(Me,ma)|0,le=le+Math.imul(et,va)|0,j=j+Math.imul(et,La)|0,j=j+Math.imul(Qe,va)|0,J=J+Math.imul(Qe,La)|0,le=le+Math.imul(Fe,Vt)|0,j=j+Math.imul(Fe,Lt)|0,j=j+Math.imul(Ce,Vt)|0,J=J+Math.imul(Ce,Lt)|0;var vt=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(vt>>>26)|0,vt&=67108863,le=Math.imul(ir,_t),j=Math.imul(ir,Mt),j=j+Math.imul(ar,_t)|0,J=Math.imul(ar,Mt),le=le+Math.imul(St,Bt)|0,j=j+Math.imul(St,qt)|0,j=j+Math.imul(Rt,Bt)|0,J=J+Math.imul(Rt,qt)|0,le=le+Math.imul(rt,lr)|0,j=j+Math.imul(rt,ta)|0,j=j+Math.imul(Je,lr)|0,J=J+Math.imul(Je,ta)|0,le=le+Math.imul(ce,wa)|0,j=j+Math.imul(ce,ma)|0,j=j+Math.imul(Re,wa)|0,J=J+Math.imul(Re,ma)|0,le=le+Math.imul(Xe,va)|0,j=j+Math.imul(Xe,La)|0,j=j+Math.imul(Me,va)|0,J=J+Math.imul(Me,La)|0,le=le+Math.imul(et,Vt)|0,j=j+Math.imul(et,Lt)|0,j=j+Math.imul(Qe,Vt)|0,J=J+Math.imul(Qe,Lt)|0;var Lr=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Lr>>>26)|0,Lr&=67108863,le=Math.imul(ir,Bt),j=Math.imul(ir,qt),j=j+Math.imul(ar,Bt)|0,J=Math.imul(ar,qt),le=le+Math.imul(St,lr)|0,j=j+Math.imul(St,ta)|0,j=j+Math.imul(Rt,lr)|0,J=J+Math.imul(Rt,ta)|0,le=le+Math.imul(rt,wa)|0,j=j+Math.imul(rt,ma)|0,j=j+Math.imul(Je,wa)|0,J=J+Math.imul(Je,ma)|0,le=le+Math.imul(ce,va)|0,j=j+Math.imul(ce,La)|0,j=j+Math.imul(Re,va)|0,J=J+Math.imul(Re,La)|0,le=le+Math.imul(Xe,Vt)|0,j=j+Math.imul(Xe,Lt)|0,j=j+Math.imul(Me,Vt)|0,J=J+Math.imul(Me,Lt)|0;var Er=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Er>>>26)|0,Er&=67108863,le=Math.imul(ir,lr),j=Math.imul(ir,ta),j=j+Math.imul(ar,lr)|0,J=Math.imul(ar,ta),le=le+Math.imul(St,wa)|0,j=j+Math.imul(St,ma)|0,j=j+Math.imul(Rt,wa)|0,J=J+Math.imul(Rt,ma)|0,le=le+Math.imul(rt,va)|0,j=j+Math.imul(rt,La)|0,j=j+Math.imul(Je,va)|0,J=J+Math.imul(Je,La)|0,le=le+Math.imul(ce,Vt)|0,j=j+Math.imul(ce,Lt)|0,j=j+Math.imul(Re,Vt)|0,J=J+Math.imul(Re,Lt)|0;var _r=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(_r>>>26)|0,_r&=67108863,le=Math.imul(ir,wa),j=Math.imul(ir,ma),j=j+Math.imul(ar,wa)|0,J=Math.imul(ar,ma),le=le+Math.imul(St,va)|0,j=j+Math.imul(St,La)|0,j=j+Math.imul(Rt,va)|0,J=J+Math.imul(Rt,La)|0,le=le+Math.imul(rt,Vt)|0,j=j+Math.imul(rt,Lt)|0,j=j+Math.imul(Je,Vt)|0,J=J+Math.imul(Je,Lt)|0;var yr=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(yr>>>26)|0,yr&=67108863,le=Math.imul(ir,va),j=Math.imul(ir,La),j=j+Math.imul(ar,va)|0,J=Math.imul(ar,La),le=le+Math.imul(St,Vt)|0,j=j+Math.imul(St,Lt)|0,j=j+Math.imul(Rt,Vt)|0,J=J+Math.imul(Rt,Lt)|0;var kr=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(kr>>>26)|0,kr&=67108863,le=Math.imul(ir,Vt),j=Math.imul(ir,Lt),j=j+Math.imul(ar,Vt)|0,J=Math.imul(ar,Lt);var zr=(oe+le|0)+((j&8191)<<13)|0;return oe=(J+(j>>>13)|0)+(zr>>>26)|0,zr&=67108863,ue[0]=jt,ue[1]=Ot,ue[2]=gr,ue[3]=Br,ue[4]=na,ue[5]=Ur,ue[6]=ga,ue[7]=Aa,ue[8]=Pa,ue[9]=sa,ue[10]=Oa,ue[11]=dt,ue[12]=vt,ue[13]=Lr,ue[14]=Er,ue[15]=_r,ue[16]=yr,ue[17]=kr,ue[18]=zr,oe!==0&&(ue[19]=oe,U.length++),U};Math.imul||(M=S);function _(O,L,N){N.negative=L.negative^O.negative,N.length=O.length+L.length;for(var U=0,Z=0,Q=0;Q>>26)|0,Z+=ue>>>26,ue&=67108863}N.words[Q]=oe,U=ue,ue=Z}return U!==0?N.words[Q]=U:N.length--,N.strip()}function w(O,L,N){var U=new p;return U.mulp(O,L,N)}s.prototype.mulTo=function(L,N){var U,Z=this.length+L.length;return this.length===10&&L.length===10?U=M(this,L,N):Z<63?U=S(this,L,N):Z<1024?U=_(this,L,N):U=w(this,L,N),U};function p(O,L){this.x=O,this.y=L}p.prototype.makeRBT=function(L){for(var N=new Array(L),U=s.prototype._countBits(L)-1,Z=0;Z>=1;return Z},p.prototype.permute=function(L,N,U,Z,Q,ue){for(var oe=0;oe>>1)Q++;return 1<>>13,U[2*ue+1]=Q&8191,Q=Q>>>13;for(ue=2*N;ue>=26,N+=Z/67108864|0,N+=Q>>>26,this.words[U]=Q&67108863}return N!==0&&(this.words[U]=N,this.length++),this},s.prototype.muln=function(L){return this.clone().imuln(L)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(L){var N=b(L);if(N.length===0)return new s(1);for(var U=this,Z=0;Z=0);var N=L%26,U=(L-N)/26,Z=67108863>>>26-N<<26-N,Q;if(N!==0){var ue=0;for(Q=0;Q>>26-N}ue&&(this.words[Q]=ue,this.length++)}if(U!==0){for(Q=this.length-1;Q>=0;Q--)this.words[Q+U]=this.words[Q];for(Q=0;Q=0);var Z;N?Z=(N-N%26)/26:Z=0;var Q=L%26,ue=Math.min((L-Q)/26,this.length),oe=67108863^67108863>>>Q<ue)for(this.length-=ue,j=0;j=0&&(J!==0||j>=Z);j--){var $=this.words[j]|0;this.words[j]=J<<26-Q|$>>>Q,J=$&oe}return le&&J!==0&&(le.words[le.length++]=J),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(L,N,U){return i(this.negative===0),this.iushrn(L,N,U)},s.prototype.shln=function(L){return this.clone().ishln(L)},s.prototype.ushln=function(L){return this.clone().iushln(L)},s.prototype.shrn=function(L){return this.clone().ishrn(L)},s.prototype.ushrn=function(L){return this.clone().iushrn(L)},s.prototype.testn=function(L){i(typeof L=="number"&&L>=0);var N=L%26,U=(L-N)/26,Z=1<=0);var N=L%26,U=(L-N)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=U)return this;if(N!==0&&U++,this.length=Math.min(U,this.length),N!==0){var Z=67108863^67108863>>>N<=67108864;N++)this.words[N]-=67108864,N===this.length-1?this.words[N+1]=1:this.words[N+1]++;return this.length=Math.max(this.length,N+1),this},s.prototype.isubn=function(L){if(i(typeof L=="number"),i(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 N=0;N>26)-(le/67108864|0),this.words[Q+U]=ue&67108863}for(;Q>26,this.words[Q+U]=ue&67108863;if(oe===0)return this.strip();for(i(oe===-1),oe=0,Q=0;Q>26,this.words[Q]=ue&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(L,N){var U=this.length-L.length,Z=this.clone(),Q=L,ue=Q.words[Q.length-1]|0,oe=this._countBits(ue);U=26-oe,U!==0&&(Q=Q.ushln(U),Z.iushln(U),ue=Q.words[Q.length-1]|0);var le=Z.length-Q.length,j;if(N!=="mod"){j=new s(null),j.length=le+1,j.words=new Array(j.length);for(var J=0;J=0;X--){var re=(Z.words[Q.length+X]|0)*67108864+(Z.words[Q.length+X-1]|0);for(re=Math.min(re/ue|0,67108863),Z._ishlnsubmul(Q,re,X);Z.negative!==0;)re--,Z.negative=0,Z._ishlnsubmul(Q,1,X),Z.isZero()||(Z.negative^=1);j&&(j.words[X]=re)}return j&&j.strip(),Z.strip(),N!=="div"&&U!==0&&Z.iushrn(U),{div:j||null,mod:Z}},s.prototype.divmod=function(L,N,U){if(i(!L.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var Z,Q,ue;return this.negative!==0&&L.negative===0?(ue=this.neg().divmod(L,N),N!=="mod"&&(Z=ue.div.neg()),N!=="div"&&(Q=ue.mod.neg(),U&&Q.negative!==0&&Q.iadd(L)),{div:Z,mod:Q}):this.negative===0&&L.negative!==0?(ue=this.divmod(L.neg(),N),N!=="mod"&&(Z=ue.div.neg()),{div:Z,mod:ue.mod}):this.negative&L.negative?(ue=this.neg().divmod(L.neg(),N),N!=="div"&&(Q=ue.mod.neg(),U&&Q.negative!==0&&Q.isub(L)),{div:ue.div,mod:Q}):L.length>this.length||this.cmp(L)<0?{div:new s(0),mod:this}:L.length===1?N==="div"?{div:this.divn(L.words[0]),mod:null}:N==="mod"?{div:null,mod:new s(this.modn(L.words[0]))}:{div:this.divn(L.words[0]),mod:new s(this.modn(L.words[0]))}:this._wordDiv(L,N)},s.prototype.div=function(L){return this.divmod(L,"div",!1).div},s.prototype.mod=function(L){return this.divmod(L,"mod",!1).mod},s.prototype.umod=function(L){return this.divmod(L,"mod",!0).mod},s.prototype.divRound=function(L){var N=this.divmod(L);if(N.mod.isZero())return N.div;var U=N.div.negative!==0?N.mod.isub(L):N.mod,Z=L.ushrn(1),Q=L.andln(1),ue=U.cmp(Z);return ue<0||Q===1&&ue===0?N.div:N.div.negative!==0?N.div.isubn(1):N.div.iaddn(1)},s.prototype.modn=function(L){i(L<=67108863);for(var N=(1<<26)%L,U=0,Z=this.length-1;Z>=0;Z--)U=(N*U+(this.words[Z]|0))%L;return U},s.prototype.idivn=function(L){i(L<=67108863);for(var N=0,U=this.length-1;U>=0;U--){var Z=(this.words[U]|0)+N*67108864;this.words[U]=Z/L|0,N=Z%L}return this.strip()},s.prototype.divn=function(L){return this.clone().idivn(L)},s.prototype.egcd=function(L){i(L.negative===0),i(!L.isZero());var N=this,U=L.clone();N.negative!==0?N=N.umod(L):N=N.clone();for(var Z=new s(1),Q=new s(0),ue=new s(0),oe=new s(1),le=0;N.isEven()&&U.isEven();)N.iushrn(1),U.iushrn(1),++le;for(var j=U.clone(),J=N.clone();!N.isZero();){for(var $=0,X=1;!(N.words[0]&X)&&$<26;++$,X<<=1);if($>0)for(N.iushrn($);$-- >0;)(Z.isOdd()||Q.isOdd())&&(Z.iadd(j),Q.isub(J)),Z.iushrn(1),Q.iushrn(1);for(var re=0,ee=1;!(U.words[0]&ee)&&re<26;++re,ee<<=1);if(re>0)for(U.iushrn(re);re-- >0;)(ue.isOdd()||oe.isOdd())&&(ue.iadd(j),oe.isub(J)),ue.iushrn(1),oe.iushrn(1);N.cmp(U)>=0?(N.isub(U),Z.isub(ue),Q.isub(oe)):(U.isub(N),ue.isub(Z),oe.isub(Q))}return{a:ue,b:oe,gcd:U.iushln(le)}},s.prototype._invmp=function(L){i(L.negative===0),i(!L.isZero());var N=this,U=L.clone();N.negative!==0?N=N.umod(L):N=N.clone();for(var Z=new s(1),Q=new s(0),ue=U.clone();N.cmpn(1)>0&&U.cmpn(1)>0;){for(var oe=0,le=1;!(N.words[0]&le)&&oe<26;++oe,le<<=1);if(oe>0)for(N.iushrn(oe);oe-- >0;)Z.isOdd()&&Z.iadd(ue),Z.iushrn(1);for(var j=0,J=1;!(U.words[0]&J)&&j<26;++j,J<<=1);if(j>0)for(U.iushrn(j);j-- >0;)Q.isOdd()&&Q.iadd(ue),Q.iushrn(1);N.cmp(U)>=0?(N.isub(U),Z.isub(Q)):(U.isub(N),Q.isub(Z))}var $;return N.cmpn(1)===0?$=Z:$=Q,$.cmpn(0)<0&&$.iadd(L),$},s.prototype.gcd=function(L){if(this.isZero())return L.abs();if(L.isZero())return this.abs();var N=this.clone(),U=L.clone();N.negative=0,U.negative=0;for(var Z=0;N.isEven()&&U.isEven();Z++)N.iushrn(1),U.iushrn(1);do{for(;N.isEven();)N.iushrn(1);for(;U.isEven();)U.iushrn(1);var Q=N.cmp(U);if(Q<0){var ue=N;N=U,U=ue}else if(Q===0||U.cmpn(1)===0)break;N.isub(U)}while(!0);return U.iushln(Z)},s.prototype.invm=function(L){return this.egcd(L).a.umod(L)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(L){return this.words[0]&L},s.prototype.bincn=function(L){i(typeof L=="number");var N=L%26,U=(L-N)/26,Z=1<>>26,oe&=67108863,this.words[ue]=oe}return Q!==0&&(this.words[ue]=Q,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(L){var N=L<0;if(this.negative!==0&&!N)return-1;if(this.negative===0&&N)return 1;this.strip();var U;if(this.length>1)U=1;else{N&&(L=-L),i(L<=67108863,"Number is too big");var Z=this.words[0]|0;U=Z===L?0:ZL.length)return 1;if(this.length=0;U--){var Z=this.words[U]|0,Q=L.words[U]|0;if(Z!==Q){ZQ&&(N=1);break}}return N},s.prototype.gtn=function(L){return this.cmpn(L)===1},s.prototype.gt=function(L){return this.cmp(L)===1},s.prototype.gten=function(L){return this.cmpn(L)>=0},s.prototype.gte=function(L){return this.cmp(L)>=0},s.prototype.ltn=function(L){return this.cmpn(L)===-1},s.prototype.lt=function(L){return this.cmp(L)===-1},s.prototype.lten=function(L){return this.cmpn(L)<=0},s.prototype.lte=function(L){return this.cmp(L)<=0},s.prototype.eqn=function(L){return this.cmpn(L)===0},s.prototype.eq=function(L){return this.cmp(L)===0},s.red=function(L){return new F(L)},s.prototype.toRed=function(L){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),L.convertTo(this)._forceRed(L)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(L){return this.red=L,this},s.prototype.forceRed=function(L){return i(!this.red,"Already a number in reduction context"),this._forceRed(L)},s.prototype.redAdd=function(L){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,L)},s.prototype.redIAdd=function(L){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,L)},s.prototype.redSub=function(L){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,L)},s.prototype.redISub=function(L){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,L)},s.prototype.redShl=function(L){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,L)},s.prototype.redMul=function(L){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,L),this.red.mul(this,L)},s.prototype.redIMul=function(L){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,L),this.red.imul(this,L)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(L){return i(this.red&&!L.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,L)};var u={k256:null,p224:null,p192:null,p25519:null};function g(O,L){this.name=O,this.p=new s(L,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}g.prototype._tmp=function(){var L=new s(null);return L.words=new Array(Math.ceil(this.n/13)),L},g.prototype.ireduce=function(L){var N=L,U;do this.split(N,this.tmp),N=this.imulK(N),N=N.iadd(this.tmp),U=N.bitLength();while(U>this.n);var Z=U0?N.isub(this.p):N.strip!==void 0?N.strip():N._strip(),N},g.prototype.split=function(L,N){L.iushrn(this.n,0,N)},g.prototype.imulK=function(L){return L.imul(this.k)};function m(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(m,g),m.prototype.split=function(L,N){for(var U=4194303,Z=Math.min(L.length,9),Q=0;Q>>22,ue=oe}ue>>>=22,L.words[Q-10]=ue,ue===0&&L.length>10?L.length-=10:L.length-=9},m.prototype.imulK=function(L){L.words[L.length]=0,L.words[L.length+1]=0,L.length+=2;for(var N=0,U=0;U>>=26,L.words[U]=Q,N=Z}return N!==0&&(L.words[L.length++]=N),L},s._prime=function(L){if(u[L])return u[L];var N;if(L==="k256")N=new m;else if(L==="p224")N=new R;else if(L==="p192")N=new P;else if(L==="p25519")N=new z;else throw new Error("Unknown prime "+L);return u[L]=N,N};function F(O){if(typeof O=="string"){var L=s._prime(O);this.m=L.p,this.prime=L}else i(O.gtn(1),"modulus must be greater than 1"),this.m=O,this.prime=null}F.prototype._verify1=function(L){i(L.negative===0,"red works only with positives"),i(L.red,"red works only with red numbers")},F.prototype._verify2=function(L,N){i((L.negative|N.negative)===0,"red works only with positives"),i(L.red&&L.red===N.red,"red works only with red numbers")},F.prototype.imod=function(L){return this.prime?this.prime.ireduce(L)._forceRed(this):L.umod(this.m)._forceRed(this)},F.prototype.neg=function(L){return L.isZero()?L.clone():this.m.sub(L)._forceRed(this)},F.prototype.add=function(L,N){this._verify2(L,N);var U=L.add(N);return U.cmp(this.m)>=0&&U.isub(this.m),U._forceRed(this)},F.prototype.iadd=function(L,N){this._verify2(L,N);var U=L.iadd(N);return U.cmp(this.m)>=0&&U.isub(this.m),U},F.prototype.sub=function(L,N){this._verify2(L,N);var U=L.sub(N);return U.cmpn(0)<0&&U.iadd(this.m),U._forceRed(this)},F.prototype.isub=function(L,N){this._verify2(L,N);var U=L.isub(N);return U.cmpn(0)<0&&U.iadd(this.m),U},F.prototype.shl=function(L,N){return this._verify1(L),this.imod(L.ushln(N))},F.prototype.imul=function(L,N){return this._verify2(L,N),this.imod(L.imul(N))},F.prototype.mul=function(L,N){return this._verify2(L,N),this.imod(L.mul(N))},F.prototype.isqr=function(L){return this.imul(L,L.clone())},F.prototype.sqr=function(L){return this.mul(L,L)},F.prototype.sqrt=function(L){if(L.isZero())return L.clone();var N=this.m.andln(3);if(i(N%2===1),N===3){var U=this.m.add(new s(1)).iushrn(2);return this.pow(L,U)}for(var Z=this.m.subn(1),Q=0;!Z.isZero()&&Z.andln(1)===0;)Q++,Z.iushrn(1);i(!Z.isZero());var ue=new s(1).toRed(this),oe=ue.redNeg(),le=this.m.subn(1).iushrn(1),j=this.m.bitLength();for(j=new s(2*j*j).toRed(this);this.pow(j,le).cmp(oe)!==0;)j.redIAdd(oe);for(var J=this.pow(j,Z),$=this.pow(L,Z.addn(1).iushrn(1)),X=this.pow(L,Z),re=Q;X.cmp(ue)!==0;){for(var ee=X,q=0;ee.cmp(ue)!==0;q++)ee=ee.redSqr();i(q=0;Q--){for(var J=N.words[Q],$=j-1;$>=0;$--){var X=J>>$&1;if(ue!==Z[0]&&(ue=this.sqr(ue)),X===0&&oe===0){le=0;continue}oe<<=1,oe|=X,le++,!(le!==U&&(Q!==0||$!==0))&&(ue=this.mul(ue,Z[oe]),le=0,oe=0)}j=26}return ue},F.prototype.convertTo=function(L){var N=L.umod(this.m);return N===L?N.clone():N},F.prototype.convertFrom=function(L){var N=L.clone();return N.red=null,N},s.mont=function(L){return new B(L)};function B(O){F.call(this,O),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(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)}n(B,F),B.prototype.convertTo=function(L){return this.imod(L.ushln(this.shift))},B.prototype.convertFrom=function(L){var N=this.imod(L.mul(this.rinv));return N.red=null,N},B.prototype.imul=function(L,N){if(L.isZero()||N.isZero())return L.words[0]=0,L.length=1,L;var U=L.imul(N),Z=U.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Q=U.isub(Z).iushrn(this.shift),ue=Q;return Q.cmp(this.m)>=0?ue=Q.isub(this.m):Q.cmpn(0)<0&&(ue=Q.iadd(this.m)),ue._forceRed(this)},B.prototype.mul=function(L,N){if(L.isZero()||N.isZero())return new s(0)._forceRed(this);var U=L.mul(N),Z=U.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Q=U.isub(Z).iushrn(this.shift),ue=Q;return Q.cmp(this.m)>=0?ue=Q.isub(this.m):Q.cmpn(0)<0&&(ue=Q.iadd(this.m)),ue._forceRed(this)},B.prototype.invm=function(L){var N=this.imod(L._invmp(this.m).mul(this.r2));return N._forceRed(this)}}(e,this)},6204:function(e){e.exports=t;function t(r){var o,a,i,n=r.length,s=0;for(o=0;o>>1;if(!(p<=0)){var u,g=o.mallocDouble(2*p*_),m=o.mallocInt32(_);if(_=s(y,p,g,m),_>0){if(p===1&&M)a.init(_),u=a.sweepComplete(p,S,0,_,g,m,0,_,g,m);else{var R=o.mallocDouble(2*p*w),P=o.mallocInt32(w);w=s(b,p,R,P),w>0&&(a.init(_+w),p===1?u=a.sweepBipartite(p,S,0,_,g,m,0,w,R,P):u=i(p,S,M,_,g,m,w,R,P),o.free(R),o.free(P))}o.free(g),o.free(m)}return u}}}var f;function v(y,b){f.push([y,b])}function h(y){return f=[],c(y,y,v,!0),f}function T(y,b){return f=[],c(y,b,v,!1),f}function l(y,b,S){switch(arguments.length){case 1:return h(y);case 2:return typeof b=="function"?c(y,y,b,!0):T(y,b);case 3:return c(y,b,S,!1);default:throw new Error("box-intersect: Invalid arguments")}}},2455:function(e,t){function r(){function i(c,f,v,h,T,l,y,b,S,M,_){for(var w=2*c,p=h,u=w*h;pS-b?i(c,f,v,h,T,l,y,b,S,M,_):n(c,f,v,h,T,l,y,b,S,M,_)}return s}function o(){function i(v,h,T,l,y,b,S,M,_,w,p){for(var u=2*v,g=l,m=u*l;gw-_?l?i(v,h,T,y,b,S,M,_,w,p,u):n(v,h,T,y,b,S,M,_,w,p,u):l?s(v,h,T,y,b,S,M,_,w,p,u):c(v,h,T,y,b,S,M,_,w,p,u)}return f}function a(i){return i?r():o()}t.partial=a(!1),t.full=a(!0)},7150:function(e,t,r){e.exports=O;var o=r(1888),a=r(8828),i=r(2455),n=i.partial,s=i.full,c=r(855),f=r(3545),v=r(8105),h=128,T=1<<22,l=1<<22,y=v("!(lo>=p0)&&!(p1>=hi)"),b=v("lo===p0"),S=v("lo0;){J-=1;var re=J*p,ee=m[re],q=m[re+1],ae=m[re+2],ie=m[re+3],fe=m[re+4],we=m[re+5],Ae=J*u,Fe=R[Ae],Ce=R[Ae+1],qe=we&1,et=!!(we&16),Qe=Q,Ke=ue,Xe=le,Me=j;if(qe&&(Qe=le,Ke=j,Xe=Q,Me=ue),!(we&2&&(ae=S(L,ee,q,ae,Qe,Ke,Ce),q>=ae))&&!(we&4&&(q=M(L,ee,q,ae,Qe,Ke,Fe),q>=ae))){var xe=ae-q,ce=fe-ie;if(et){if(L*xe*(xe+ce)v&&T[w+f]>M;--_,w-=y){for(var p=w,u=w+y,g=0;g>>1,M=2*c,_=S,w=T[M*S+f];y=R?(_=m,w=R):g>=z?(_=u,w=g):(_=P,w=z):R>=z?(_=m,w=R):z>=g?(_=u,w=g):(_=P,w=z);for(var O=M*(b-1),L=M*_,F=0;F=p0)&&!(p1>=hi)":f};function r(v){return t[v]}function o(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+u];if(R===S)if(p===m)p+=1,w+=M;else{for(var P=0;M>P;++P){var z=y[_+P];y[_+P]=y[w],y[w++]=z}var F=b[m];b[m]=b[p],b[p++]=F}}return p}function a(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+u];if(RP;++P){var z=y[_+P];y[_+P]=y[w],y[w++]=z}var F=b[m];b[m]=b[p],b[p++]=F}}return p}function i(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+g];if(R<=S)if(p===m)p+=1,w+=M;else{for(var P=0;M>P;++P){var z=y[_+P];y[_+P]=y[w],y[w++]=z}var F=b[m];b[m]=b[p],b[p++]=F}}return p}function n(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+g];if(R<=S)if(p===m)p+=1,w+=M;else{for(var P=0;M>P;++P){var z=y[_+P];y[_+P]=y[w],y[w++]=z}var F=b[m];b[m]=b[p],b[p++]=F}}return p}function s(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+u],P=y[_+g];if(R<=S&&S<=P)if(p===m)p+=1,w+=M;else{for(var z=0;M>z;++z){var F=y[_+z];y[_+z]=y[w],y[w++]=F}var B=b[m];b[m]=b[p],b[p++]=B}}return p}function c(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+u],P=y[_+g];if(Rz;++z){var F=y[_+z];y[_+z]=y[w],y[w++]=F}var B=b[m];b[m]=b[p],b[p++]=B}}return p}function f(v,h,T,l,y,b,S,M){for(var _=2*v,w=_*T,p=w,u=T,g=h,m=v+h,R=T;l>R;++R,w+=_){var P=y[w+g],z=y[w+m];if(!(P>=S)&&!(M>=z))if(u===R)u+=1,p+=_;else{for(var F=0;_>F;++F){var B=y[w+F];y[w+F]=y[p],y[p++]=B}var O=b[R];b[R]=b[u],b[u++]=O}}return u}},4192:function(e){e.exports=r;var t=32;function r(h,T){T<=4*t?o(0,T-1,h):v(0,T-1,h)}function o(h,T,l){for(var y=2*(h+1),b=h+1;b<=T;++b){for(var S=l[y++],M=l[y++],_=b,w=y-2;_-- >h;){var p=l[w-2],u=l[w-1];if(pl[T+1]:!0}function f(h,T,l,y){h*=2;var b=y[h];return b>1,_=M-y,w=M+y,p=b,u=_,g=M,m=w,R=S,P=h+1,z=T-1,F=0;c(p,u,l)&&(F=p,p=u,u=F),c(m,R,l)&&(F=m,m=R,R=F),c(p,g,l)&&(F=p,p=g,g=F),c(u,g,l)&&(F=u,u=g,g=F),c(p,m,l)&&(F=p,p=m,m=F),c(g,m,l)&&(F=g,g=m,m=F),c(u,R,l)&&(F=u,u=R,R=F),c(u,g,l)&&(F=u,u=g,g=F),c(m,R,l)&&(F=m,m=R,R=F);for(var B=l[2*u],O=l[2*u+1],L=l[2*m],N=l[2*m+1],U=2*p,Z=2*g,Q=2*R,ue=2*b,oe=2*M,le=2*S,j=0;j<2;++j){var J=l[U+j],$=l[Z+j],X=l[Q+j];l[ue+j]=J,l[oe+j]=$,l[le+j]=X}i(_,h,l),i(w,T,l);for(var re=P;re<=z;++re)if(f(re,B,O,l))re!==P&&a(re,P,l),++P;else if(!f(re,L,N,l))for(;;)if(f(z,L,N,l)){f(z,B,O,l)?(n(re,P,z,l),++P,--z):(a(re,z,l),--z);break}else{if(--z>>1;i(y,$);for(var X=0,re=0,oe=0;oe<$;++oe){var ee=y[2*oe+1]|0;if(ee>=n)ee=ee-n|0,S(v,h,re--,ee);else if(ee>=0)S(c,f,X--,ee);else if(ee<=-n){ee=-ee-n|0;for(var q=0;q>>1;i(y,$);for(var X=0,re=0,ee=0,oe=0;oe<$;++oe){var q=y[2*oe+1]|0,ae=q&1;if(oe<$-1&&q>>1===y[2*oe+3]>>1&&(ae=2,oe+=1),q<0){for(var ie=-(q>>1)-1,fe=0;fe>1)-1;ae===0?S(c,f,X--,ie):ae===1?S(v,h,re--,ie):ae===2&&S(T,l,ee--,ie)}}}function p(g,m,R,P,z,F,B,O,L,N,U,Z){var Q=0,ue=2*g,oe=m,le=m+g,j=1,J=1;P?J=n:j=n;for(var $=z;$>>1;i(y,q);for(var ae=0,$=0;$=n?(fe=!P,X-=n):(fe=!!P,X-=1),fe)M(c,f,ae++,X);else{var we=Z[X],Ae=ue*X,Fe=U[Ae+m+1],Ce=U[Ae+m+1+g];e:for(var qe=0;qe>>1;i(y,X);for(var re=0,le=0;le=n)c[re++]=j-n;else{j-=1;var q=U[j],ae=Q*j,ie=N[ae+m+1],fe=N[ae+m+1+g];e:for(var we=0;we=0;--we)if(c[we]===j){for(var qe=we+1;qe0;){for(var y=c.pop(),h=c.pop(),b=-1,S=-1,T=v[h],_=1;_=0||(s.flip(h,y),a(n,s,c,b,h,S),a(n,s,c,h,S,b),a(n,s,c,S,y,b),a(n,s,c,y,b,S))}}},5023:function(e,t,r){var o=r(2478);e.exports=f;function a(v,h,T,l,y,b,S){this.cells=v,this.neighbor=h,this.flags=l,this.constraint=T,this.active=y,this.next=b,this.boundary=S}var i=a.prototype;function n(v,h){return v[0]-h[0]||v[1]-h[1]||v[2]-h[2]}i.locate=function(){var v=[0,0,0];return function(h,T,l){var y=h,b=T,S=l;return T0||S.length>0;){for(;b.length>0;){var u=b.pop();if(M[u]!==-y){M[u]=y,_[u];for(var g=0;g<3;++g){var m=p[3*u+g];m>=0&&M[m]===0&&(w[3*u+g]?S.push(m):(b.push(m),M[m]=y))}}}var R=S;S=b,b=R,S.length=0,y=-y}var P=c(_,M,h);return T?P.concat(l.boundary):P}},8902:function(e,t,r){var o=r(2478),a=r(3250)[3],i=0,n=1,s=2;e.exports=S;function c(M,_,w,p,u){this.a=M,this.b=_,this.idx=w,this.lowerIds=p,this.upperIds=u}function f(M,_,w,p){this.a=M,this.b=_,this.type=w,this.idx=p}function v(M,_){var w=M.a[0]-_.a[0]||M.a[1]-_.a[1]||M.type-_.type;return w||M.type!==i&&(w=a(M.a,M.b,_.b),w)?w:M.idx-_.idx}function h(M,_){return a(M.a,M.b,_)}function T(M,_,w,p,u){for(var g=o.lt(_,p,h),m=o.gt(_,p,h),R=g;R1&&a(w[z[B-2]],w[z[B-1]],p)>0;)M.push([z[B-1],z[B-2],u]),B-=1;z.length=B,z.push(u);for(var F=P.upperIds,B=F.length;B>1&&a(w[F[B-2]],w[F[B-1]],p)<0;)M.push([F[B-2],F[B-1],u]),B-=1;F.length=B,F.push(u)}}function l(M,_){var w;return M.a[0]<_.a[0]?w=a(M.a,M.b,_.a):w=a(_.b,_.a,M.a),w||(_.b[0]P[0]&&u.push(new f(P,R,s,g),new f(R,P,n,g))}u.sort(v);for(var z=u[0].a[0]-(1+Math.abs(u[0].a[0]))*Math.pow(2,-52),F=[new c([z,1],[z,0],-1,[],[])],B=[],g=0,O=u.length;g=0}}(),i.removeTriangle=function(c,f,v){var h=this.stars;n(h[c],f,v),n(h[f],v,c),n(h[v],c,f)},i.addTriangle=function(c,f,v){var h=this.stars;h[c].push(f,v),h[f].push(v,c),h[v].push(c,f)},i.opposite=function(c,f){for(var v=this.stars[f],h=1,T=v.length;h=0;--L){var J=B[L];N=J[0];var $=z[N],X=$[0],re=$[1],ee=P[X],q=P[re];if((ee[0]-q[0]||ee[1]-q[1])<0){var ae=X;X=re,re=ae}$[0]=X;var ie=$[1]=J[1],fe;for(O&&(fe=$[2]);L>0&&B[L-1][0]===N;){var J=B[--L],we=J[1];O?z.push([ie,we,fe]):z.push([ie,we]),ie=we}O?z.push([ie,re,fe]):z.push([ie,re])}return U}function _(P,z,F){for(var B=z.length,O=new o(B),L=[],N=0;Nz[2]?1:0)}function u(P,z,F){if(P.length!==0){if(z)for(var B=0;B0||N.length>0}function R(P,z,F){var B;if(F){B=z;for(var O=new Array(z.length),L=0;LM+1)throw new Error(b+" map requires nshades to be at least size "+y.length);Array.isArray(f.alpha)?f.alpha.length!==2?_=[1,1]:_=f.alpha.slice():typeof f.alpha=="number"?_=[f.alpha,f.alpha]:_=[1,1],v=y.map(function(R){return Math.round(R.index*M)}),_[0]=Math.min(Math.max(_[0],0),1),_[1]=Math.min(Math.max(_[1],0),1);var p=y.map(function(R,P){var z=y[P].index,F=y[P].rgb.slice();return F.length===4&&F[3]>=0&&F[3]<=1||(F[3]=_[0]+(_[1]-_[0])*z),F}),u=[];for(w=0;w=0}function f(v,h,T,l){var y=o(h,T,l);if(y===0){var b=a(o(v,h,T)),S=a(o(v,h,l));if(b===S){if(b===0){var M=c(v,h,T),_=c(v,h,l);return M===_?0:M?1:-1}return 0}else{if(S===0)return b>0||c(v,h,l)?-1:1;if(b===0)return S>0||c(v,h,T)?1:-1}return a(S-b)}var w=o(v,h,T);if(w>0)return y>0&&o(v,h,l)>0?1:-1;if(w<0)return y>0||o(v,h,l)>0?1:-1;var p=o(v,h,l);return p>0||c(v,h,T)?1:-1}},8572:function(e){e.exports=function(r){return r<0?-1:r>0?1:0}},8507:function(e){e.exports=o;var t=Math.min;function r(a,i){return a-i}function o(a,i){var n=a.length,s=a.length-i.length;if(s)return s;switch(n){case 0:return 0;case 1:return a[0]-i[0];case 2:return a[0]+a[1]-i[0]-i[1]||t(a[0],a[1])-t(i[0],i[1]);case 3:var c=a[0]+a[1],f=i[0]+i[1];if(s=c+a[2]-(f+i[2]),s)return s;var v=t(a[0],a[1]),h=t(i[0],i[1]);return t(v,a[2])-t(h,i[2])||t(v+a[2],c)-t(h+i[2],f);case 4:var T=a[0],l=a[1],y=a[2],b=a[3],S=i[0],M=i[1],_=i[2],w=i[3];return T+l+y+b-(S+M+_+w)||t(T,l,y,b)-t(S,M,_,w,S)||t(T+l,T+y,T+b,l+y,l+b,y+b)-t(S+M,S+_,S+w,M+_,M+w,_+w)||t(T+l+y,T+l+b,T+y+b,l+y+b)-t(S+M+_,S+M+w,S+_+w,M+_+w);default:for(var p=a.slice().sort(r),u=i.slice().sort(r),g=0;gr[a][0]&&(a=i);return oa?[[a],[o]]:[[o]]}},4750:function(e,t,r){e.exports=a;var o=r(3090);function a(i){var n=o(i),s=n.length;if(s<=2)return[];for(var c=new Array(s),f=n[s-1],v=0;v=f[S]&&(b+=1);l[y]=b}}return c}function s(c,f){try{return o(c,!0)}catch{var v=a(c);if(v.length<=f)return[];var h=i(c,v),T=o(h,!0);return n(T,v)}}},4769:function(e){function t(o,a,i,n,s,c){var f=6*s*s-6*s,v=3*s*s-4*s+1,h=-6*s*s+6*s,T=3*s*s-2*s;if(o.length){c||(c=new Array(o.length));for(var l=o.length-1;l>=0;--l)c[l]=f*o[l]+v*a[l]+h*i[l]+T*n[l];return c}return f*o+v*a+h*i[l]+T*n}function r(o,a,i,n,s,c){var f=s-1,v=s*s,h=f*f,T=(1+2*s)*h,l=s*h,y=v*(3-2*s),b=v*f;if(o.length){c||(c=new Array(o.length));for(var S=o.length-1;S>=0;--S)c[S]=T*o[S]+l*a[S]+y*i[S]+b*n[S];return c}return T*o+l*a+y*i+b*n}e.exports=r,e.exports.derivative=t},7642:function(e,t,r){var o=r(8954),a=r(1682);e.exports=c;function i(f,v){this.point=f,this.index=v}function n(f,v){for(var h=f.point,T=v.point,l=h.length,y=0;y=2)return!1;F[O]=L}return!0}):z=z.filter(function(F){for(var B=0;B<=T;++B){var O=g[F[B]];if(O<0)return!1;F[B]=O}return!0}),T&1)for(var b=0;b>>31},e.exports.exponent=function(i){var n=e.exports.hi(i);return(n<<1>>>21)-1023},e.exports.fraction=function(i){var n=e.exports.lo(i),s=e.exports.hi(i),c=s&(1<<20)-1;return s&2146435072&&(c+=1048576),[n,c]},e.exports.denormalized=function(i){var n=e.exports.hi(i);return!(n&2146435072)}},1338:function(e){function t(a,i,n){var s=a[n]|0;if(s<=0)return[];var c=new Array(s),f;if(n===a.length-1)for(f=0;f"u"&&(i=0),typeof a){case"number":if(a>0)return r(a|0,i);break;case"object":if(typeof a.length=="number")return t(a,i,0);break}return[]}e.exports=o},3134:function(e,t,r){e.exports=a;var o=r(1682);function a(i,n){var s=i.length;if(typeof n!="number"){n=0;for(var c=0;c=T-1)for(var w=b.length-1,u=v-h[T-1],p=0;p=T-1){var _=b.length-1;v-h[T-1];for(var w=0;w=0;--T)if(v[--h])return!1;return!0},s.jump=function(v){var h=this.lastT(),T=this.dimension;if(!(v0;--p)l.push(i(M[p-1],_[p-1],arguments[p])),y.push(0)}},s.push=function(v){var h=this.lastT(),T=this.dimension;if(!(v1e-6?1/S:0;this._time.push(v);for(var u=T;u>0;--u){var g=i(_[u-1],w[u-1],arguments[u]);l.push(g),y.push((g-l[b++])*p)}}},s.set=function(v){var h=this.dimension;if(!(v0;--M)T.push(i(b[M-1],S[M-1],arguments[M])),l.push(0)}},s.move=function(v){var h=this.lastT(),T=this.dimension;if(!(v<=h||arguments.length!==T+1)){var l=this._state,y=this._velocity,b=l.length-this.dimension,S=this.bounds,M=S[0],_=S[1],w=v-h,p=w>1e-6?1/w:0;this._time.push(v);for(var u=T;u>0;--u){var g=arguments[u];l.push(i(M[u-1],_[u-1],l[b++]+g)),y.push(g*p)}}},s.idle=function(v){var h=this.lastT();if(!(v=0;--p)l.push(i(M[p],_[p],l[b]+w*y[b])),y.push(0),b+=1}};function c(v){for(var h=new Array(v),T=0;T=0;--P){var u=g[P];m[P]<=0?g[P]=new o(u._color,u.key,u.value,g[P+1],u.right,u._count+1):g[P]=new o(u._color,u.key,u.value,u.left,g[P+1],u._count+1)}for(var P=g.length-1;P>1;--P){var z=g[P-1],u=g[P];if(z._color===r||u._color===r)break;var F=g[P-2];if(F.left===z)if(z.left===u){var B=F.right;if(B&&B._color===t)z._color=r,F.right=i(r,B),F._color=t,P-=1;else{if(F._color=t,F.left=z.right,z._color=r,z.right=F,g[P-2]=z,g[P-1]=u,n(F),n(z),P>=3){var O=g[P-3];O.left===F?O.left=z:O.right=z}break}}else{var B=F.right;if(B&&B._color===t)z._color=r,F.right=i(r,B),F._color=t,P-=1;else{if(z.right=u.left,F._color=t,F.left=u.right,u._color=r,u.left=z,u.right=F,g[P-2]=u,g[P-1]=z,n(F),n(z),n(u),P>=3){var O=g[P-3];O.left===F?O.left=u:O.right=u}break}}else if(z.right===u){var B=F.left;if(B&&B._color===t)z._color=r,F.left=i(r,B),F._color=t,P-=1;else{if(F._color=t,F.right=z.left,z._color=r,z.left=F,g[P-2]=z,g[P-1]=u,n(F),n(z),P>=3){var O=g[P-3];O.right===F?O.right=z:O.left=z}break}}else{var B=F.left;if(B&&B._color===t)z._color=r,F.left=i(r,B),F._color=t,P-=1;else{if(z.left=u.right,F._color=t,F.right=u.left,u._color=r,u.right=z,u.left=F,g[P-2]=u,g[P-1]=z,n(F),n(z),n(u),P>=3){var O=g[P-3];O.right===F?O.right=u:O.left=u}break}}}return g[0]._color=r,new s(p,g[0])};function f(_,w){if(w.left){var p=f(_,w.left);if(p)return p}var p=_(w.key,w.value);if(p)return p;if(w.right)return f(_,w.right)}function v(_,w,p,u){var g=w(_,u.key);if(g<=0){if(u.left){var m=v(_,w,p,u.left);if(m)return m}var m=p(u.key,u.value);if(m)return m}if(u.right)return v(_,w,p,u.right)}function h(_,w,p,u,g){var m=p(_,g.key),R=p(w,g.key),P;if(m<=0&&(g.left&&(P=h(_,w,p,u,g.left),P)||R>0&&(P=u(g.key,g.value),P)))return P;if(R>0&&g.right)return h(_,w,p,u,g.right)}c.forEach=function(w,p,u){if(this.root)switch(arguments.length){case 1:return f(w,this.root);case 2:return v(p,this._compare,w,this.root);case 3:return this._compare(p,u)>=0?void 0:h(p,u,this._compare,w,this.root)}},Object.defineProperty(c,"begin",{get:function(){for(var _=[],w=this.root;w;)_.push(w),w=w.left;return new T(this,_)}}),Object.defineProperty(c,"end",{get:function(){for(var _=[],w=this.root;w;)_.push(w),w=w.right;return new T(this,_)}}),c.at=function(_){if(_<0)return new T(this,[]);for(var w=this.root,p=[];;){if(p.push(w),w.left){if(_=w.right._count)break;w=w.right}else break}return new T(this,[])},c.ge=function(_){for(var w=this._compare,p=this.root,u=[],g=0;p;){var m=w(_,p.key);u.push(p),m<=0&&(g=u.length),m<=0?p=p.left:p=p.right}return u.length=g,new T(this,u)},c.gt=function(_){for(var w=this._compare,p=this.root,u=[],g=0;p;){var m=w(_,p.key);u.push(p),m<0&&(g=u.length),m<0?p=p.left:p=p.right}return u.length=g,new T(this,u)},c.lt=function(_){for(var w=this._compare,p=this.root,u=[],g=0;p;){var m=w(_,p.key);u.push(p),m>0&&(g=u.length),m<=0?p=p.left:p=p.right}return u.length=g,new T(this,u)},c.le=function(_){for(var w=this._compare,p=this.root,u=[],g=0;p;){var m=w(_,p.key);u.push(p),m>=0&&(g=u.length),m<0?p=p.left:p=p.right}return u.length=g,new T(this,u)},c.find=function(_){for(var w=this._compare,p=this.root,u=[];p;){var g=w(_,p.key);if(u.push(p),g===0)return new T(this,u);g<=0?p=p.left:p=p.right}return new T(this,[])},c.remove=function(_){var w=this.find(_);return w?w.remove():this},c.get=function(_){for(var w=this._compare,p=this.root;p;){var u=w(_,p.key);if(u===0)return p.value;u<=0?p=p.left:p=p.right}};function T(_,w){this.tree=_,this._stack=w}var l=T.prototype;Object.defineProperty(l,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(l,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),l.clone=function(){return new T(this.tree,this._stack.slice())};function y(_,w){_.key=w.key,_.value=w.value,_.left=w.left,_.right=w.right,_._color=w._color,_._count=w._count}function b(_){for(var w,p,u,g,m=_.length-1;m>=0;--m){if(w=_[m],m===0){w._color=r;return}if(p=_[m-1],p.left===w){if(u=p.right,u.right&&u.right._color===t){if(u=p.right=a(u),g=u.right=a(u.right),p.right=u.left,u.left=p,u.right=g,u._color=p._color,w._color=r,p._color=r,g._color=r,n(p),n(u),m>1){var R=_[m-2];R.left===p?R.left=u:R.right=u}_[m-1]=u;return}else if(u.left&&u.left._color===t){if(u=p.right=a(u),g=u.left=a(u.left),p.right=g.left,u.left=g.right,g.left=p,g.right=u,g._color=p._color,p._color=r,u._color=r,w._color=r,n(p),n(u),n(g),m>1){var R=_[m-2];R.left===p?R.left=g:R.right=g}_[m-1]=g;return}if(u._color===r)if(p._color===t){p._color=r,p.right=i(t,u);return}else{p.right=i(t,u);continue}else{if(u=a(u),p.right=u.left,u.left=p,u._color=p._color,p._color=t,n(p),n(u),m>1){var R=_[m-2];R.left===p?R.left=u:R.right=u}_[m-1]=u,_[m]=p,m+1<_.length?_[m+1]=w:_.push(w),m=m+2}}else{if(u=p.left,u.left&&u.left._color===t){if(u=p.left=a(u),g=u.left=a(u.left),p.left=u.right,u.right=p,u.left=g,u._color=p._color,w._color=r,p._color=r,g._color=r,n(p),n(u),m>1){var R=_[m-2];R.right===p?R.right=u:R.left=u}_[m-1]=u;return}else if(u.right&&u.right._color===t){if(u=p.left=a(u),g=u.right=a(u.right),p.left=g.right,u.right=g.left,g.right=p,g.left=u,g._color=p._color,p._color=r,u._color=r,w._color=r,n(p),n(u),n(g),m>1){var R=_[m-2];R.right===p?R.right=g:R.left=g}_[m-1]=g;return}if(u._color===r)if(p._color===t){p._color=r,p.left=i(t,u);return}else{p.left=i(t,u);continue}else{if(u=a(u),p.left=u.right,u.right=p,u._color=p._color,p._color=t,n(p),n(u),m>1){var R=_[m-2];R.right===p?R.right=u:R.left=u}_[m-1]=u,_[m]=p,m+1<_.length?_[m+1]=w:_.push(w),m=m+2}}}}l.remove=function(){var _=this._stack;if(_.length===0)return this.tree;var w=new Array(_.length),p=_[_.length-1];w[w.length-1]=new o(p._color,p.key,p.value,p.left,p.right,p._count);for(var u=_.length-2;u>=0;--u){var p=_[u];p.left===_[u+1]?w[u]=new o(p._color,p.key,p.value,w[u+1],p.right,p._count):w[u]=new o(p._color,p.key,p.value,p.left,w[u+1],p._count)}if(p=w[w.length-1],p.left&&p.right){var g=w.length;for(p=p.left;p.right;)w.push(p),p=p.right;var m=w[g-1];w.push(new o(p._color,m.key,m.value,p.left,p.right,p._count)),w[g-1].key=p.key,w[g-1].value=p.value;for(var u=w.length-2;u>=g;--u)p=w[u],w[u]=new o(p._color,p.key,p.value,p.left,w[u+1],p._count);w[g-1].left=w[g]}if(p=w[w.length-1],p._color===t){var R=w[w.length-2];R.left===p?R.left=null:R.right===p&&(R.right=null),w.pop();for(var u=0;u0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(l,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(l,"index",{get:function(){var _=0,w=this._stack;if(w.length===0){var p=this.tree.root;return p?p._count:0}else w[w.length-1].left&&(_=w[w.length-1].left._count);for(var u=w.length-2;u>=0;--u)w[u+1]===w[u].right&&(++_,w[u].left&&(_+=w[u].left._count));return _},enumerable:!0}),l.next=function(){var _=this._stack;if(_.length!==0){var w=_[_.length-1];if(w.right)for(w=w.right;w;)_.push(w),w=w.left;else for(_.pop();_.length>0&&_[_.length-1].right===w;)w=_[_.length-1],_.pop()}},Object.defineProperty(l,"hasNext",{get:function(){var _=this._stack;if(_.length===0)return!1;if(_[_.length-1].right)return!0;for(var w=_.length-1;w>0;--w)if(_[w-1].left===_[w])return!0;return!1}}),l.update=function(_){var w=this._stack;if(w.length===0)throw new Error("Can't update empty node!");var p=new Array(w.length),u=w[w.length-1];p[p.length-1]=new o(u._color,u.key,_,u.left,u.right,u._count);for(var g=w.length-2;g>=0;--g)u=w[g],u.left===w[g+1]?p[g]=new o(u._color,u.key,u.value,p[g+1],u.right,u._count):p[g]=new o(u._color,u.key,u.value,u.left,p[g+1],u._count);return new s(this.tree._compare,p[0])},l.prev=function(){var _=this._stack;if(_.length!==0){var w=_[_.length-1];if(w.left)for(w=w.left;w;)_.push(w),w=w.right;else for(_.pop();_.length>0&&_[_.length-1].left===w;)w=_[_.length-1],_.pop()}},Object.defineProperty(l,"hasPrev",{get:function(){var _=this._stack;if(_.length===0)return!1;if(_[_.length-1].left)return!0;for(var w=_.length-1;w>0;--w)if(_[w-1].right===_[w])return!0;return!1}});function S(_,w){return _w?1:0}function M(_){return new s(_||S,null)}},3837:function(e,t,r){e.exports=P;var o=r(4935),a=r(501),i=r(5304),n=r(6429),s=r(6444),c=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),f=ArrayBuffer,v=DataView;function h(z){return f.isView(z)&&!(z instanceof v)}function T(z){return Array.isArray(z)||h(z)}function l(z,F){return z[0]=F[0],z[1]=F[1],z[2]=F[2],z}function y(z){this.gl=z,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=i(z)}var b=y.prototype;b.update=function(z){z=z||{};function F(X,re,ee){if(ee in z){var q=z[ee],ae=this[ee],ie;(X?T(q)&&T(q[0]):T(q))?this[ee]=ie=[re(q[0]),re(q[1]),re(q[2])]:this[ee]=ie=[re(q),re(q),re(q)];for(var fe=0;fe<3;++fe)if(ie[fe]!==ae[fe])return!0}return!1}var B=F.bind(this,!1,Number),O=F.bind(this,!1,Boolean),L=F.bind(this,!1,String),N=F.bind(this,!0,function(X){if(T(X)){if(X.length===3)return[+X[0],+X[1],+X[2],1];if(X.length===4)return[+X[0],+X[1],+X[2],+X[3]]}return[0,0,0,1]}),U,Z=!1,Q=!1;if("bounds"in z)for(var ue=z.bounds,oe=0;oe<2;++oe)for(var le=0;le<3;++le)ue[oe][le]!==this.bounds[oe][le]&&(Q=!0),this.bounds[oe][le]=ue[oe][le];if("ticks"in z){U=z.ticks,Z=!0,this.autoTicks=!1;for(var oe=0;oe<3;++oe)this.tickSpacing[oe]=0}else B("tickSpacing")&&(this.autoTicks=!0,Q=!0);if(this._firstInit&&("ticks"in z||"tickSpacing"in z||(this.autoTicks=!0),Q=!0,Z=!0,this._firstInit=!1),Q&&this.autoTicks&&(U=s.create(this.bounds,this.tickSpacing),Z=!0),Z){for(var oe=0;oe<3;++oe)U[oe].sort(function(re,ee){return re.x-ee.x});s.equal(U,this.ticks)?Z=!1:this.ticks=U}O("tickEnable"),L("tickFont")&&(Z=!0),L("tickFontStyle")&&(Z=!0),L("tickFontWeight")&&(Z=!0),L("tickFontVariant")&&(Z=!0),B("tickSize"),B("tickAngle"),B("tickPad"),N("tickColor");var j=L("labels");L("labelFont")&&(j=!0),L("labelFontStyle")&&(j=!0),L("labelFontWeight")&&(j=!0),L("labelFontVariant")&&(j=!0),O("labelEnable"),B("labelSize"),B("labelPad"),N("labelColor"),O("lineEnable"),O("lineMirror"),B("lineWidth"),N("lineColor"),O("lineTickEnable"),O("lineTickMirror"),B("lineTickLength"),B("lineTickWidth"),N("lineTickColor"),O("gridEnable"),B("gridWidth"),N("gridColor"),O("zeroEnable"),N("zeroLineColor"),B("zeroLineWidth"),O("backgroundEnable"),N("backgroundColor");var J=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],$=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(j||Z)&&this._text.update(this.bounds,this.labels,J,this.ticks,$):this._text=o(this.gl,this.bounds,this.labels,J,this.ticks,$),this._lines&&Z&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=a(this.gl,this.bounds,this.ticks))};function S(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var M=[new S,new S,new S];function _(z,F,B,O,L){for(var N=z.primalOffset,U=z.primalMinor,Z=z.mirrorOffset,Q=z.mirrorMinor,ue=O[F],oe=0;oe<3;++oe)if(F!==oe){var le=N,j=Z,J=U,$=Q;ue&1<0?(J[oe]=-1,$[oe]=0):(J[oe]=0,$[oe]=1)}}var w=[0,0,0],p={model:c,view:c,projection:c,_ortho:!1};b.isOpaque=function(){return!0},b.isTransparent=function(){return!1},b.drawTransparent=function(z){};var u=0,g=[0,0,0],m=[0,0,0],R=[0,0,0];b.draw=function(z){z=z||p;for(var ee=this.gl,F=z.model||c,B=z.view||c,O=z.projection||c,L=this.bounds,N=z._ortho||!1,U=n(F,B,O,L,N),Z=U.cubeEdges,Q=U.axis,ue=B[12],oe=B[13],le=B[14],j=B[15],J=N?2:1,$=J*this.pixelRatio*(O[3]*ue+O[7]*oe+O[11]*le+O[15]*j)/ee.drawingBufferHeight,X=0;X<3;++X)this.lastCubeProps.cubeEdges[X]=Z[X],this.lastCubeProps.axis[X]=Q[X];for(var re=M,X=0;X<3;++X)_(M[X],X,this.bounds,Z,Q);for(var ee=this.gl,q=w,X=0;X<3;++X)this.backgroundEnable[X]?q[X]=Q[X]:q[X]=0;this._background.draw(F,B,O,L,q,this.backgroundColor),this._lines.bind(F,B,O,this);for(var X=0;X<3;++X){var ae=[0,0,0];Q[X]>0?ae[X]=L[1][X]:ae[X]=L[0][X];for(var ie=0;ie<2;++ie){var fe=(X+1+ie)%3,we=(X+1+(ie^1))%3;this.gridEnable[fe]&&this._lines.drawGrid(fe,we,this.bounds,ae,this.gridColor[fe],this.gridWidth[fe]*this.pixelRatio)}for(var ie=0;ie<2;++ie){var fe=(X+1+ie)%3,we=(X+1+(ie^1))%3;this.zeroEnable[we]&&Math.min(L[0][we],L[1][we])<=0&&Math.max(L[0][we],L[1][we])>=0&&this._lines.drawZero(fe,we,this.bounds,ae,this.zeroLineColor[we],this.zeroLineWidth[we]*this.pixelRatio)}}for(var X=0;X<3;++X){this.lineEnable[X]&&this._lines.drawAxisLine(X,this.bounds,re[X].primalOffset,this.lineColor[X],this.lineWidth[X]*this.pixelRatio),this.lineMirror[X]&&this._lines.drawAxisLine(X,this.bounds,re[X].mirrorOffset,this.lineColor[X],this.lineWidth[X]*this.pixelRatio);for(var Ae=l(g,re[X].primalMinor),Fe=l(m,re[X].mirrorMinor),Ce=this.lineTickLength,ie=0;ie<3;++ie){var qe=$/F[5*ie];Ae[ie]*=Ce[ie]*qe,Fe[ie]*=Ce[ie]*qe}this.lineTickEnable[X]&&this._lines.drawAxisTicks(X,re[X].primalOffset,Ae,this.lineTickColor[X],this.lineTickWidth[X]*this.pixelRatio),this.lineTickMirror[X]&&this._lines.drawAxisTicks(X,re[X].mirrorOffset,Fe,this.lineTickColor[X],this.lineTickWidth[X]*this.pixelRatio)}this._lines.unbind(),this._text.bind(F,B,O,this.pixelRatio);var et,Qe=.5,Ke,Xe;function Me(Je){Xe=[0,0,0],Xe[Je]=1}function xe(Je,At,St){var Rt=(Je+1)%3,Ut=(Je+2)%3,ir=At[Rt],ar=At[Ut],Mr=St[Rt],fr=St[Ut];if(ir>0&&fr>0){Me(Rt);return}else if(ir>0&&fr<0){Me(Rt);return}else if(ir<0&&fr>0){Me(Rt);return}else if(ir<0&&fr<0){Me(Rt);return}else if(ar>0&&Mr>0){Me(Ut);return}else if(ar>0&&Mr<0){Me(Ut);return}else if(ar<0&&Mr>0){Me(Ut);return}else if(ar<0&&Mr<0){Me(Ut);return}}for(var X=0;X<3;++X){for(var ce=re[X].primalMinor,Re=re[X].mirrorMinor,$e=l(R,re[X].primalOffset),ie=0;ie<3;++ie)this.lineTickEnable[X]&&($e[ie]+=$*ce[ie]*Math.max(this.lineTickLength[ie],0)/F[5*ie]);var rt=[0,0,0];if(rt[X]=1,this.tickEnable[X]){this.tickAngle[X]===-3600?(this.tickAngle[X]=0,this.tickAlign[X]="auto"):this.tickAlign[X]=-1,Ke=1,et=[this.tickAlign[X],Qe,Ke],et[0]==="auto"?et[0]=u:et[0]=parseInt(""+et[0]),Xe=[0,0,0],xe(X,ce,Re);for(var ie=0;ie<3;++ie)$e[ie]+=$*ce[ie]*this.tickPad[ie]/F[5*ie];this._text.drawTicks(X,this.tickSize[X],this.tickAngle[X],$e,this.tickColor[X],rt,Xe,et)}if(this.labelEnable[X]){Ke=0,Xe=[0,0,0],this.labels[X].length>4&&(Me(X),Ke=1),et=[this.labelAlign[X],Qe,Ke],et[0]==="auto"?et[0]=u:et[0]=parseInt(""+et[0]);for(var ie=0;ie<3;++ie)$e[ie]+=$*ce[ie]*this.labelPad[ie]/F[5*ie];$e[X]+=.5*(L[0][X]+L[1][X]),this._text.drawLabel(X,this.labelSize[X],this.labelAngle[X],$e,this.labelColor[X],[0,0,0],Xe,et)}}this._text.unbind()},b.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function P(z,F){var B=new y(z);return B.update(F),B}},5304:function(e,t,r){e.exports=c;var o=r(2762),a=r(8116),i=r(1879).bg;function n(f,v,h,T){this.gl=f,this.buffer=v,this.vao=h,this.shader=T}var s=n.prototype;s.draw=function(f,v,h,T,l,y){for(var b=!1,S=0;S<3;++S)b=b||l[S];if(b){var M=this.gl;M.enable(M.POLYGON_OFFSET_FILL),M.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:f,view:v,projection:h,bounds:T,enable:l,colors:y},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),M.disable(M.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function c(f){for(var v=[],h=[],T=0,l=0;l<3;++l)for(var y=(l+1)%3,b=(l+2)%3,S=[0,0,0],M=[0,0,0],_=-1;_<=1;_+=2){h.push(T,T+2,T+1,T+1,T+2,T+3),S[l]=_,M[l]=_;for(var w=-1;w<=1;w+=2){S[y]=w;for(var p=-1;p<=1;p+=2)S[b]=p,v.push(S[0],S[1],S[2],M[0],M[1],M[2]),T+=1}var u=y;y=b,b=u}var g=o(f,new Float32Array(v)),m=o(f,new Uint16Array(h),f.ELEMENT_ARRAY_BUFFER),R=a(f,[{buffer:g,type:f.FLOAT,size:3,offset:0,stride:24},{buffer:g,type:f.FLOAT,size:3,offset:12,stride:24}],m),P=i(f);return P.attributes.position.location=0,P.attributes.normal.location=1,new n(f,g,R,P)}},6429:function(e,t,r){e.exports=_;var o=r(8828),a=r(6760),i=r(5202),n=r(3250),s=new Array(16),c=new Array(8),f=new Array(8),v=new Array(3),h=[0,0,0];(function(){for(var w=0;w<8;++w)c[w]=[1,1,1,1],f[w]=[1,1,1]})();function T(w,p,u){for(var g=0;g<4;++g){w[g]=u[12+g];for(var m=0;m<3;++m)w[g]+=p[m]*u[4*m+g]}}var l=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]];function y(w){for(var p=0;pQ&&(B|=1<Q){B|=1<f[P][1])&&(re=P);for(var ee=-1,P=0;P<3;++P){var q=re^1<f[ae][0]&&(ae=q)}}var ie=b;ie[0]=ie[1]=ie[2]=0,ie[o.log2(ee^re)]=re&ee,ie[o.log2(re^ae)]=re&ae;var fe=ae^7;fe===B||fe===X?(fe=ee^7,ie[o.log2(ae^fe)]=fe&ae):ie[o.log2(ee^fe)]=feⅇfor(var we=S,Ae=B,N=0;N<3;++N)Ae&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); +} +`]),c=o([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 color; +void main() { + gl_FragColor = color; +}`]);t.Q=function(h){return a(h,s,c,null,[{name:"position",type:"vec3"}])};var f=o([`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); +} +`]),v=o([`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]; +}`]);t.bg=function(h){return a(h,f,v,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(e,t,r){e.exports=y;var o=r(2762),a=r(8116),i=r(4359),n=r(1879).Q,s=window||process.global||{},c=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var f=3;function v(b,S,M,_){this.gl=b,this.shader=S,this.buffer=M,this.vao=_,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var h=v.prototype,T=[0,0];h.bind=function(b,S,M,_){this.vao.bind(),this.shader.bind();var w=this.shader.uniforms;w.model=b,w.view=S,w.projection=M,w.pixelScale=_,T[0]=this.gl.drawingBufferWidth,T[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=T},h.unbind=function(){this.vao.unbind()},h.update=function(b,S,M,_,w){var p=[];function u(N,U,Z,Q,ue,oe){var le=[Z.style,Z.weight,Z.variant,Z.family].join("_"),j=c[le];j||(j=c[le]={});var J=j[U];J||(J=j[U]=l(U,{triangles:!0,font:Z.family,fontStyle:Z.style,fontWeight:Z.weight,fontVariant:Z.variant,textAlign:"center",textBaseline:"middle",lineSpacing:ue,styletags:oe}));for(var $=(Q||12)/12,X=J.positions,re=J.cells,ee=0,q=re.length;ee=0;--ie){var fe=X[ae[ie]];p.push($*fe[0],-$*fe[1],N)}}for(var g=[0,0,0],m=[0,0,0],R=[0,0,0],P=[0,0,0],z=1.25,F={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},B=0;B<3;++B){R[B]=p.length/f|0,u(.5*(b[0][B]+b[1][B]),S[B],M[B],12,z,F),P[B]=(p.length/f|0)-R[B],g[B]=p.length/f|0;for(var O=0;O<_[B].length;++O)if(_[B][O].text){var L={family:_[B][O].font||w[B].family,style:w[B].fontStyle||w[B].style,weight:w[B].fontWeight||w[B].weight,variant:w[B].fontVariant||w[B].variant};u(_[B][O].x,_[B][O].text,L,_[B][O].fontSize||12,z,F)}m[B]=(p.length/f|0)-g[B]}this.buffer.update(p),this.tickOffset=g,this.tickCount=m,this.labelOffset=R,this.labelCount=P},h.drawTicks=function(b,S,M,_,w,p,u,g){this.tickCount[b]&&(this.shader.uniforms.axis=p,this.shader.uniforms.color=w,this.shader.uniforms.angle=M,this.shader.uniforms.scale=S,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=g,this.vao.draw(this.gl.TRIANGLES,this.tickCount[b],this.tickOffset[b]))},h.drawLabel=function(b,S,M,_,w,p,u,g){this.labelCount[b]&&(this.shader.uniforms.axis=p,this.shader.uniforms.color=w,this.shader.uniforms.angle=M,this.shader.uniforms.scale=S,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=g,this.vao.draw(this.gl.TRIANGLES,this.labelCount[b],this.labelOffset[b]))},h.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()};function l(b,S){try{return i(b,S)}catch(M){return console.warn('error vectorizing text:"'+b+'" error:',M),{cells:[],positions:[]}}}function y(b,S,M,_,w,p){var u=o(b),g=a(b,[{buffer:u,size:3}]),m=n(b);m.attributes.position.location=0;var R=new v(b,m,u,g);return R.update(S,M,_,w,p),R}},6444:function(e,t){t.create=o,t.equal=a;function r(i,n){var s=i+"",c=s.indexOf("."),f=0;c>=0&&(f=s.length-c-1);var v=Math.pow(10,f),h=Math.round(i*n*v),T=h+"";if(T.indexOf("e")>=0)return T;var l=h/v,y=h%v;h<0?(l=-Math.ceil(l)|0,y=-y|0):(l=Math.floor(l)|0,y=y|0);var b=""+l;if(h<0&&(b="-"+b),f){for(var S=""+y;S.length=i[0][c];--v)f.push({x:v*n[c],text:r(n[c],v)});s.push(f)}return s}function a(i,n){for(var s=0;s<3;++s){if(i[s].length!==n[s].length)return!1;for(var c=0;cb)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return l.bufferSubData(y,_,M),b}function v(l,y){for(var b=o.malloc(l.length,y),S=l.length,M=0;M=0;--S){if(y[S]!==b)return!1;b*=l[S]}return!0}c.update=function(l,y){if(typeof y!="number"&&(y=-1),this.bind(),typeof l=="object"&&typeof l.shape<"u"){var b=l.dtype;if(n.indexOf(b)<0&&(b="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var S=gl.getExtension("OES_element_index_uint");S&&b!=="uint16"?b="uint32":b="uint16"}if(b===l.dtype&&h(l.shape,l.stride))l.offset===0&&l.data.length===l.shape[0]?this.length=f(this.gl,this.type,this.length,this.usage,l.data,y):this.length=f(this.gl,this.type,this.length,this.usage,l.data.subarray(l.offset,l.shape[0]),y);else{var M=o.malloc(l.size,b),_=i(M,l.shape);a.assign(_,l),y<0?this.length=f(this.gl,this.type,this.length,this.usage,M,y):this.length=f(this.gl,this.type,this.length,this.usage,M.subarray(0,l.size),y),o.free(M)}}else if(Array.isArray(l)){var w;this.type===this.gl.ELEMENT_ARRAY_BUFFER?w=v(l,"uint16"):w=v(l,"float32"),y<0?this.length=f(this.gl,this.type,this.length,this.usage,w,y):this.length=f(this.gl,this.type,this.length,this.usage,w.subarray(0,l.length),y),o.free(w)}else if(typeof l=="object"&&typeof l.length=="number")this.length=f(this.gl,this.type,this.length,this.usage,l,y);else if(typeof l=="number"||l===void 0){if(y>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");l=l|0,l<=0&&(l=1),this.gl.bufferData(this.type,l|0,this.usage),this.length=l}else throw new Error("gl-buffer: Invalid data type")};function T(l,y,b,S){if(b=b||l.ARRAY_BUFFER,S=S||l.DYNAMIC_DRAW,b!==l.ARRAY_BUFFER&&b!==l.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(S!==l.DYNAMIC_DRAW&&S!==l.STATIC_DRAW&&S!==l.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 M=l.createBuffer(),_=new s(l,b,M,0,S);return _.update(y),_}e.exports=T},6405:function(e,t,r){var o=r(2931);e.exports=function(i,n){var s=i.positions,c=i.vectors,f={positions:[],vertexIntensity:[],vertexIntensityBounds:i.vertexIntensityBounds,vectors:[],cells:[],coneOffset:i.coneOffset,colormap:i.colormap};if(i.positions.length===0)return n&&(n[0]=[0,0,0],n[1]=[0,0,0]),f;for(var v=0,h=1/0,T=-1/0,l=1/0,y=-1/0,b=1/0,S=-1/0,M=null,_=null,w=[],p=1/0,u=!1,g=i.coneSizemode==="raw",m=0;mv&&(v=o.length(P)),m&&!g){var z=2*o.distance(M,R)/(o.length(_)+o.length(P));z?(p=Math.min(p,z),u=!1):u=!0}u||(M=R,_=P),w.push(P)}var F=[h,l,b],B=[T,y,S];n&&(n[0]=F,n[1]=B),v===0&&(v=1);var O=1/v;isFinite(p)||(p=1),f.vectorScale=p;var L=i.coneSize||(g?1:.5);i.absoluteConeSize&&(L=i.absoluteConeSize*O),f.coneScale=L;for(var m=0,N=0;m=1},l.isTransparent=function(){return this.opacity<1},l.pickSlots=1,l.setPickBase=function(w){this.pickId=w};function y(w){for(var p=v({colormap:w,nshades:256,format:"rgba"}),u=new Uint8Array(256*4),g=0;g<256;++g){for(var m=p[g],R=0;R<3;++R)u[4*g+R]=m[R];u[4*g+3]=m[3]*255}return f(u,[256,256,4],[4,0,1])}function b(w){for(var p=w.length,u=new Array(p),g=0;g0){var N=this.triShader;N.bind(),N.uniforms=z,this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},l.drawPick=function(w){w=w||{};for(var p=this.gl,u=w.model||h,g=w.view||h,m=w.projection||h,R=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],P=0;P<3;++P)R[0][P]=Math.max(R[0][P],this.clipBounds[0][P]),R[1][P]=Math.min(R[1][P],this.clipBounds[1][P]);this._model=[].slice.call(u),this._view=[].slice.call(g),this._projection=[].slice.call(m),this._resolution=[p.drawingBufferWidth,p.drawingBufferHeight];var z={model:u,view:g,projection:m,clipBounds:R,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},F=this.pickShader;F.bind(),F.uniforms=z,this.triangleCount>0&&(this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},l.pick=function(w){if(!w||w.id!==this.pickId)return null;var p=w.value[0]+256*w.value[1]+65536*w.value[2],u=this.cells[p],g=this.positions[u[1]].slice(0,3),m={position:g,dataCoordinate:g,index:Math.floor(u[1]/48)};return this.traceType==="cone"?m.index=Math.floor(u[1]/48):this.traceType==="streamtube"&&(m.intensity=this.intensity[u[1]],m.velocity=this.vectors[u[1]].slice(0,3),m.divergence=this.vectors[u[1]][3],m.index=p),m},l.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()};function S(w,p){var u=o(w,p.meshShader.vertex,p.meshShader.fragment,null,p.meshShader.attributes);return u.attributes.position.location=0,u.attributes.color.location=2,u.attributes.uv.location=3,u.attributes.vector.location=4,u}function M(w,p){var u=o(w,p.pickShader.vertex,p.pickShader.fragment,null,p.pickShader.attributes);return u.attributes.position.location=0,u.attributes.id.location=1,u.attributes.vector.location=4,u}function _(w,p,u){var g=u.shaders;arguments.length===1&&(p=w,w=p.gl);var m=S(w,g),R=M(w,g),P=n(w,f(new Uint8Array([255,255,255,255]),[1,1,4]));P.generateMipmap(),P.minFilter=w.LINEAR_MIPMAP_LINEAR,P.magFilter=w.LINEAR;var z=a(w),F=a(w),B=a(w),O=a(w),L=a(w),N=i(w,[{buffer:z,type:w.FLOAT,size:4},{buffer:L,type:w.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:B,type:w.FLOAT,size:4},{buffer:O,type:w.FLOAT,size:2},{buffer:F,type:w.FLOAT,size:4}]),U=new T(w,P,m,R,z,F,L,B,O,N,u.traceType||"cone");return U.update(p),U}e.exports=_},614:function(e,t,r){var o=r(3236),a=o([`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; +} +`]),i=o([`#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; +} +`]),n=o([`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; +} +`]),s=o([`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); +}`]);t.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:n,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(e){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171:function(e,t,r){var o=r(737);e.exports=function(i){return o[i]}},9165:function(e,t,r){e.exports=T;var o=r(2762),a=r(8116),i=r(3436),n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,y,b,S){this.gl=l,this.shader=S,this.buffer=y,this.vao=b,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 c=s.prototype;c.isOpaque=function(){return!this.hasAlpha},c.isTransparent=function(){return this.hasAlpha},c.drawTransparent=c.draw=function(l){var y=this.gl,b=this.shader.uniforms;this.shader.bind();var S=b.view=l.view||n,M=b.projection=l.projection||n;b.model=l.model||n,b.clipBounds=this.clipBounds,b.opacity=this.opacity;var _=S[12],w=S[13],p=S[14],u=S[15],g=l._ortho||!1,m=g?2:1,R=m*this.pixelRatio*(M[3]*_+M[7]*w+M[11]*p+M[15]*u)/y.drawingBufferHeight;this.vao.bind();for(var P=0;P<3;++P)y.lineWidth(this.lineWidth[P]*this.pixelRatio),b.capSize=this.capSize[P]*R,this.lineCount[P]&&y.drawArrays(y.LINES,this.lineOffset[P],this.lineCount[P]);this.vao.unbind()};function f(l,y){for(var b=0;b<3;++b)l[0][b]=Math.min(l[0][b],y[b]),l[1][b]=Math.max(l[1][b],y[b])}var v=function(){for(var l=new Array(3),y=0;y<3;++y){for(var b=[],S=1;S<=2;++S)for(var M=-1;M<=1;M+=2){var _=(S+y)%3,w=[0,0,0];w[_]=M,b.push(w)}l[y]=b}return l}();function h(l,y,b,S){for(var M=v[S],_=0;_0){var z=g.slice();z[p]+=R[1][p],M.push(g[0],g[1],g[2],P[0],P[1],P[2],P[3],0,0,0,z[0],z[1],z[2],P[0],P[1],P[2],P[3],0,0,0),f(this.bounds,z),w+=2+h(M,z,P,p)}}}this.lineCount[p]=w-this.lineOffset[p]}this.buffer.update(M)}},c.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function T(l){var y=l.gl,b=o(y),S=a(y,[{buffer:b,type:y.FLOAT,size:3,offset:0,stride:40},{buffer:b,type:y.FLOAT,size:4,offset:12,stride:40},{buffer:b,type:y.FLOAT,size:3,offset:28,stride:40}]),M=i(y);M.attributes.position.location=0,M.attributes.color.location=1,M.attributes.offset.location=2;var _=new s(y,b,S,M);return _.update(l),_}},3436:function(e,t,r){var o=r(3236),a=r(9405),i=o([`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; +}`]),n=o([`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; +}`]);e.exports=function(s){return a(s,i,n,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(e,t,r){var o=r(7766);e.exports=w;var a=null,i,n,s,c;function f(p){var u=p.getParameter(p.FRAMEBUFFER_BINDING),g=p.getParameter(p.RENDERBUFFER_BINDING),m=p.getParameter(p.TEXTURE_BINDING_2D);return[u,g,m]}function v(p,u){p.bindFramebuffer(p.FRAMEBUFFER,u[0]),p.bindRenderbuffer(p.RENDERBUFFER,u[1]),p.bindTexture(p.TEXTURE_2D,u[2])}function h(p,u){var g=p.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL);a=new Array(g+1);for(var m=0;m<=g;++m){for(var R=new Array(g),P=0;P1&&F.drawBuffersWEBGL(a[z]);var U=g.getExtension("WEBGL_depth_texture");U?B?p.depth=l(g,R,P,U.UNSIGNED_INT_24_8_WEBGL,g.DEPTH_STENCIL,g.DEPTH_STENCIL_ATTACHMENT):O&&(p.depth=l(g,R,P,g.UNSIGNED_SHORT,g.DEPTH_COMPONENT,g.DEPTH_ATTACHMENT)):O&&B?p._depth_rb=y(g,R,P,g.DEPTH_STENCIL,g.DEPTH_STENCIL_ATTACHMENT):O?p._depth_rb=y(g,R,P,g.DEPTH_COMPONENT16,g.DEPTH_ATTACHMENT):B&&(p._depth_rb=y(g,R,P,g.STENCIL_INDEX,g.STENCIL_ATTACHMENT));var Z=g.checkFramebufferStatus(g.FRAMEBUFFER);if(Z!==g.FRAMEBUFFER_COMPLETE){p._destroyed=!0,g.bindFramebuffer(g.FRAMEBUFFER,null),g.deleteFramebuffer(p.handle),p.handle=null,p.depth&&(p.depth.dispose(),p.depth=null),p._depth_rb&&(g.deleteRenderbuffer(p._depth_rb),p._depth_rb=null);for(var N=0;NR||g<0||g>R)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");p._shape[0]=u,p._shape[1]=g;for(var P=f(m),z=0;zP||g<0||g>P)throw new Error("gl-fbo: Parameters are too large for FBO");m=m||{};var z=1;if("color"in m){if(z=Math.max(m.color|0,0),z<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(z>1)if(R){if(z>p.getParameter(R.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+z+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var F=p.UNSIGNED_BYTE,B=p.getExtension("OES_texture_float");if(m.float&&z>0){if(!B)throw new Error("gl-fbo: Context does not support floating point textures");F=p.FLOAT}else m.preferFloat&&z>0&&B&&(F=p.FLOAT);var O=!0;"depth"in m&&(O=!!m.depth);var L=!1;return"stencil"in m&&(L=!!m.stencil),new S(p,u,g,F,z,O,L,R)}},2992:function(e,t,r){var o=r(3387).sprintf,a=r(5171),i=r(1848),n=r(1085);e.exports=s;function s(c,f,v){var h=i(f)||"of unknown name (see npm glsl-shader-name)",T="unknown type";v!==void 0&&(T=v===a.FRAGMENT_SHADER?"fragment":"vertex");for(var l=o(`Error compiling %s shader %s: +`,T,h),y=o("%s%s",l,c),b=c.split(` +`),S={},M=0;M 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; +} +`]),s=o([`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); +}`]),c=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(f){return a(f,i,n,null,c)},t.createPickShader=function(f){return a(f,i,s,null,c)}},5714:function(e,t,r){e.exports=p;var o=r(2762),a=r(8116),i=r(7766),n=new Uint8Array(4),s=new Float32Array(n.buffer);function c(u,g,m,R){return n[0]=R,n[1]=m,n[2]=g,n[3]=u,s[0]}var f=r(2478),v=r(9618),h=r(7319),T=h.createShader,l=h.createPickShader,y=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function b(u,g){for(var m=0,R=0;R<3;++R){var P=u[R]-g[R];m+=P*P}return Math.sqrt(m)}function S(u){for(var g=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],m=0;m<3;++m)g[0][m]=Math.max(u[0][m],g[0][m]),g[1][m]=Math.min(u[1][m],g[1][m]);return g}function M(u,g,m,R){this.arcLength=u,this.position=g,this.index=m,this.dataCoordinate=R}function _(u,g,m,R,P,z){this.gl=u,this.shader=g,this.pickShader=m,this.buffer=R,this.vao=P,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=z,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var w=_.prototype;w.isTransparent=function(){return this.hasAlpha},w.isOpaque=function(){return!this.hasAlpha},w.pickSlots=1,w.setPickBase=function(u){this.pickId=u},w.drawTransparent=w.draw=function(u){if(this.vertexCount){var g=this.gl,m=this.shader,R=this.vao;m.bind(),m.uniforms={model:u.model||y,view:u.view||y,projection:u.projection||y,clipBounds:S(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[g.drawingBufferWidth,g.drawingBufferHeight],pixelRatio:this.pixelRatio},R.bind(),R.draw(g.TRIANGLE_STRIP,this.vertexCount),R.unbind()}},w.drawPick=function(u){if(this.vertexCount){var g=this.gl,m=this.pickShader,R=this.vao;m.bind(),m.uniforms={model:u.model||y,view:u.view||y,projection:u.projection||y,pickId:this.pickId,clipBounds:S(this.clipBounds),screenShape:[g.drawingBufferWidth,g.drawingBufferHeight],pixelRatio:this.pixelRatio},R.bind(),R.draw(g.TRIANGLE_STRIP,this.vertexCount),R.unbind()}},w.update=function(u){var g,m;this.dirty=!0;var R=!!u.connectGaps;"dashScale"in u&&(this.dashScale=u.dashScale),this.hasAlpha=!1,"opacity"in u&&(this.opacity=+u.opacity,this.opacity<1&&(this.hasAlpha=!0));var P=[],z=[],F=[],B=0,O=0,L=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],N=u.position||u.positions;if(N){var U=u.color||u.colors||[0,0,0,1],Z=u.lineWidth||1,Q=!1;e:for(g=1;g0){for(var le=0;le<24;++le)P.push(P[P.length-12]);O+=2,Q=!0}continue e}L[0][m]=Math.min(L[0][m],ue[m],oe[m]),L[1][m]=Math.max(L[1][m],ue[m],oe[m])}var j,J;Array.isArray(U[0])?(j=U.length>g-1?U[g-1]:U.length>0?U[U.length-1]:[0,0,0,1],J=U.length>g?U[g]:U.length>0?U[U.length-1]:[0,0,0,1]):j=J=U,j.length===3&&(j=[j[0],j[1],j[2],1]),J.length===3&&(J=[J[0],J[1],J[2],1]),!this.hasAlpha&&j[3]<1&&(this.hasAlpha=!0);var $;Array.isArray(Z)?$=Z.length>g-1?Z[g-1]:Z.length>0?Z[Z.length-1]:[0,0,0,1]:$=Z;var X=B;if(B+=b(ue,oe),Q){for(m=0;m<2;++m)P.push(ue[0],ue[1],ue[2],oe[0],oe[1],oe[2],X,$,j[0],j[1],j[2],j[3]);O+=2,Q=!1}P.push(ue[0],ue[1],ue[2],oe[0],oe[1],oe[2],X,$,j[0],j[1],j[2],j[3],ue[0],ue[1],ue[2],oe[0],oe[1],oe[2],X,-$,j[0],j[1],j[2],j[3],oe[0],oe[1],oe[2],ue[0],ue[1],ue[2],B,-$,J[0],J[1],J[2],J[3],oe[0],oe[1],oe[2],ue[0],ue[1],ue[2],B,$,J[0],J[1],J[2],J[3]),O+=4}}if(this.buffer.update(P),z.push(B),F.push(N[N.length-1].slice()),this.bounds=L,this.vertexCount=O,this.points=F,this.arcLength=z,"dashes"in u){var re=u.dashes,ee=re.slice();for(ee.unshift(0),g=1;g1.0001)return null;m+=g[M]}return Math.abs(m-1)>.001?null:[_,c(v,g),g]}},840:function(e,t,r){var o=r(3236),a=o([`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; +} +`]),i=o([`#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; +} +`]),n=o([`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; +}`]),s=o([`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; +}`]),c=o([`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; +}`]),f=o([`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; +}`]),v=o([`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; +}`]),h=o([`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); +}`]),T=o([`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; +}`]),l=o([`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))); +}`]),y=o([`precision highp float; +#define GLSLIFY 1 + +uniform vec3 contourColor; + +void main() { + gl_FragColor = vec4(contourColor, 1.0); +} +`]);t.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:n,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:v,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:T,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},t.contourShader={vertex:l,fragment:y,attributes:[{name:"position",type:"vec3"}]}},7201:function(e,t,r){var o=1e-6,a=1e-6,i=r(9405),n=r(2762),s=r(8116),c=r(7766),f=r(8406),v=r(6760),h=r(7608),T=r(9618),l=r(6729),y=r(7765),b=r(1888),S=r(840),M=r(7626),_=S.meshShader,w=S.wireShader,p=S.pointShader,u=S.pickShader,g=S.pointPickShader,m=S.contourShader,R=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function P(le,j,J,$,X,re,ee,q,ae,ie,fe,we,Ae,Fe,Ce,qe,et,Qe,Ke,Xe,Me,xe,ce,Re,$e,rt,Je){this.gl=le,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=j,this.dirty=!0,this.triShader=J,this.lineShader=$,this.pointShader=X,this.pickShader=re,this.pointPickShader=ee,this.contourShader=q,this.trianglePositions=ae,this.triangleColors=fe,this.triangleNormals=Ae,this.triangleUVs=we,this.triangleIds=ie,this.triangleVAO=Fe,this.triangleCount=0,this.lineWidth=1,this.edgePositions=Ce,this.edgeColors=et,this.edgeUVs=Qe,this.edgeIds=qe,this.edgeVAO=Ke,this.edgeCount=0,this.pointPositions=Xe,this.pointColors=xe,this.pointUVs=ce,this.pointSizes=Re,this.pointIds=Me,this.pointVAO=$e,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=rt,this.contourVAO=Je,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=R,this._view=R,this._projection=R,this._resolution=[1,1]}var z=P.prototype;z.isOpaque=function(){return!this.hasAlpha},z.isTransparent=function(){return this.hasAlpha},z.pickSlots=1,z.setPickBase=function(le){this.pickId=le};function F(le,j){if(!j||!j.length)return 1;for(var J=0;Jle&&J>0){var $=(j[J][0]-le)/(j[J][0]-j[J-1][0]);return j[J][1]*(1-$)+$*j[J-1][1]}}return 1}function B(le,j){for(var J=l({colormap:le,nshades:256,format:"rgba"}),$=new Uint8Array(256*4),X=0;X<256;++X){for(var re=J[X],ee=0;ee<3;++ee)$[4*X+ee]=re[ee];j?$[4*X+3]=255*F(X/255,j):$[4*X+3]=255*re[3]}return T($,[256,256,4],[4,0,1])}function O(le){for(var j=le.length,J=new Array(j),$=0;$0){var Ae=this.triShader;Ae.bind(),Ae.uniforms=q,this.triangleVAO.bind(),j.drawArrays(j.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var Ae=this.lineShader;Ae.bind(),Ae.uniforms=q,this.edgeVAO.bind(),j.lineWidth(this.lineWidth*this.pixelRatio),j.drawArrays(j.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var Ae=this.pointShader;Ae.bind(),Ae.uniforms=q,this.pointVAO.bind(),j.drawArrays(j.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var Ae=this.contourShader;Ae.bind(),Ae.uniforms=q,this.contourVAO.bind(),j.drawArrays(j.LINES,0,this.contourCount),this.contourVAO.unbind()}},z.drawPick=function(le){le=le||{};for(var j=this.gl,J=le.model||R,$=le.view||R,X=le.projection||R,re=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],ee=0;ee<3;++ee)re[0][ee]=Math.max(re[0][ee],this.clipBounds[0][ee]),re[1][ee]=Math.min(re[1][ee],this.clipBounds[1][ee]);this._model=[].slice.call(J),this._view=[].slice.call($),this._projection=[].slice.call(X),this._resolution=[j.drawingBufferWidth,j.drawingBufferHeight];var q={model:J,view:$,projection:X,clipBounds:re,pickId:this.pickId/255},ae=this.pickShader;if(ae.bind(),ae.uniforms=q,this.triangleCount>0&&(this.triangleVAO.bind(),j.drawArrays(j.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),j.lineWidth(this.lineWidth*this.pixelRatio),j.drawArrays(j.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var ae=this.pointPickShader;ae.bind(),ae.uniforms=q,this.pointVAO.bind(),j.drawArrays(j.POINTS,0,this.pointCount),this.pointVAO.unbind()}},z.pick=function(le){if(!le||le.id!==this.pickId)return null;for(var j=le.value[0]+256*le.value[1]+65536*le.value[2],J=this.cells[j],$=this.positions,X=new Array(J.length),re=0;reMath.abs(u))l.rotate(R,0,0,-p*g*Math.PI*_.rotateSpeed/window.innerWidth);else if(!_._ortho){var P=-_.zoomSpeed*m*u/window.innerHeight*(R-l.lastT())/20;l.pan(R,0,0,b*(Math.exp(P)-1))}}},!0)},_.enableMouseListeners(),_}},799:function(e,t,r){var o=r(3236),a=r(9405),i=o([`precision mediump float; +#define GLSLIFY 1 +attribute vec2 position; +varying vec2 uv; +void main() { + uv = position; + gl_Position = vec4(position, 0, 1); +}`]),n=o([`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); +}`]);e.exports=function(s){return a(s,i,n,null,[{name:"position",type:"vec2"}])}},4100:function(e,t,r){var o=r(4437),a=r(3837),i=r(5445),n=r(4449),s=r(3589),c=r(2260),f=r(7169),v=r(351),h=r(4772),T=r(4040),l=r(799),y=r(9216)({tablet:!0,featureDetect:!0});e.exports={createScene:w,createCamera:o};function b(){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 S(u,g){var m=null;try{m=u.getContext("webgl",g),m||(m=u.getContext("experimental-webgl",g))}catch{return null}return m}function M(u){var g=Math.round(Math.log(Math.abs(u))/Math.log(10));if(g<0){var m=Math.round(Math.pow(10,-g));return Math.ceil(u*m)/m}else if(g>0){var m=Math.round(Math.pow(10,g));return Math.ceil(u/m)*m}return Math.ceil(u)}function _(u){return typeof u=="boolean"?u:!0}function w(u){u=u||{},u.camera=u.camera||{};var g=u.canvas;if(!g)if(g=document.createElement("canvas"),u.container){var m=u.container;m.appendChild(g)}else document.body.appendChild(g);var R=u.gl;if(R||(u.glOptions&&(y=!!u.glOptions.preserveDrawingBuffer),R=S(g,u.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:y})),!R)throw new Error("webgl not supported");var P=u.bounds||[[-10,-10,-10],[10,10,10]],z=new b,F=c(R,R.drawingBufferWidth,R.drawingBufferHeight,{preferFloat:!y}),B=l(R),O=u.cameraObject&&u.cameraObject._ortho===!0||u.camera.projection&&u.camera.projection.type==="orthographic"||!1,L={eye:u.camera.eye||[2,0,0],center:u.camera.center||[0,0,0],up:u.camera.up||[0,1,0],zoomMin:u.camera.zoomMax||.1,zoomMax:u.camera.zoomMin||100,mode:u.camera.mode||"turntable",_ortho:O},N=u.axes||{},U=a(R,N);U.enable=!N.disable;var Z=u.spikes||{},Q=n(R,Z),ue=[],oe=[],le=[],j=[],J=!0,ee=!0,$=new Array(16),X=new Array(16),re={view:null,projection:$,model:X,_ortho:!1},ee=!0,q=[R.drawingBufferWidth,R.drawingBufferHeight],ae=u.cameraObject||o(g,L),ie={gl:R,contextLost:!1,pixelRatio:u.pixelRatio||1,canvas:g,selection:z,camera:ae,axes:U,axesPixels:null,spikes:Q,bounds:P,objects:ue,shape:q,aspect:u.aspectRatio||[1,1,1],pickRadius:u.pickRadius||10,zNear:u.zNear||.01,zFar:u.zFar||1e3,fovy:u.fovy||Math.PI/4,clearColor:u.clearColor||[0,0,0,0],autoResize:_(u.autoResize),autoBounds:_(u.autoBounds),autoScale:!!u.autoScale,autoCenter:_(u.autoCenter),clipToBounds:_(u.clipToBounds),snapToData:!!u.snapToData,onselect:u.onselect||null,onrender:u.onrender||null,onclick:u.onclick||null,cameraParams:re,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(Xe){this.aspect[0]=Xe.x,this.aspect[1]=Xe.y,this.aspect[2]=Xe.z,ee=!0},setBounds:function(Xe,Me){this.bounds[0][Xe]=Me.min,this.bounds[1][Xe]=Me.max},setClearColor:function(Xe){this.clearColor=Xe},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)}},fe=[R.drawingBufferWidth/ie.pixelRatio|0,R.drawingBufferHeight/ie.pixelRatio|0];function we(){if(!ie._stopped&&ie.autoResize){var Xe=g.parentNode,Me=1,xe=1;Xe&&Xe!==document.body?(Me=Xe.clientWidth,xe=Xe.clientHeight):(Me=window.innerWidth,xe=window.innerHeight);var ce=Math.ceil(Me*ie.pixelRatio)|0,Re=Math.ceil(xe*ie.pixelRatio)|0;if(ce!==g.width||Re!==g.height){g.width=ce,g.height=Re;var $e=g.style;$e.position=$e.position||"absolute",$e.left="0px",$e.top="0px",$e.width=Me+"px",$e.height=xe+"px",J=!0}}}ie.autoResize&&we(),window.addEventListener("resize",we);function Ae(){for(var Xe=ue.length,Me=j.length,xe=0;xe0&&le[Me-1]===0;)le.pop(),j.pop().dispose()}ie.update=function(Xe){ie._stopped||(J=!0,ee=!0)},ie.add=function(Xe){ie._stopped||(Xe.axes=U,ue.push(Xe),oe.push(-1),J=!0,ee=!0,Ae())},ie.remove=function(Xe){if(!ie._stopped){var Me=ue.indexOf(Xe);Me<0||(ue.splice(Me,1),oe.pop(),J=!0,ee=!0,Ae())}},ie.dispose=function(){if(!ie._stopped&&(ie._stopped=!0,window.removeEventListener("resize",we),g.removeEventListener("webglcontextlost",Fe),ie.mouseListener.enabled=!1,!ie.contextLost)){U.dispose(),Q.dispose();for(var Xe=0;Xez.distance)continue;for(var St=0;St1e-6?(y=Math.acos(b),S=Math.sin(y),M=Math.sin((1-i)*y)/S,_=Math.sin(i*y)/S):(M=1-i,_=i),r[0]=M*n+_*v,r[1]=M*s+_*h,r[2]=M*c+_*T,r[3]=M*f+_*l,r}},5964:function(e){e.exports=function(t){return!t&&t!==0?"":t.toString()}},9366:function(e,t,r){var o=r(4359);e.exports=i;var a={};function i(n,s,c){var f=[s.style,s.weight,s.variant,s.family].join("_"),v=a[f];if(v||(v=a[f]={}),n in v)return v[n];var h={textAlign:"center",textBaseline:"middle",lineHeight:1,font:s.family,fontStyle:s.style,fontWeight:s.weight,fontVariant:s.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}};h.triangles=!0;var T=o(n,h);h.triangles=!1;var l=o(n,h),y,b;if(c&&c!==1){for(y=0;y 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; + } +}`]),n=a([`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; + } +}`]),s=a([`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; + } +} +`]),c=a([`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; +} +`]),f=a([`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); +}`]),v=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:i,fragment:c,attributes:v},T={vertex:n,fragment:c,attributes:v},l={vertex:s,fragment:c,attributes:v},y={vertex:i,fragment:f,attributes:v},b={vertex:n,fragment:f,attributes:v},S={vertex:s,fragment:f,attributes:v};function M(_,w){var p=o(_,w),u=p.attributes;return u.position.location=0,u.color.location=1,u.glyph.location=2,u.id.location=3,p}t.createPerspective=function(_){return M(_,h)},t.createOrtho=function(_){return M(_,T)},t.createProject=function(_){return M(_,l)},t.createPickPerspective=function(_){return M(_,y)},t.createPickOrtho=function(_){return M(_,b)},t.createPickProject=function(_){return M(_,S)}},8418:function(e,t,r){var o=r(5219),a=r(2762),i=r(8116),n=r(1888),s=r(6760),c=r(1283),f=r(9366),v=r(5964),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=ArrayBuffer,l=DataView;function y(X){return T.isView(X)&&!(X instanceof l)}function b(X){return Array.isArray(X)||y(X)}e.exports=$;function S(X,re){var ee=X[0],q=X[1],ae=X[2],ie=X[3];return X[0]=re[0]*ee+re[4]*q+re[8]*ae+re[12]*ie,X[1]=re[1]*ee+re[5]*q+re[9]*ae+re[13]*ie,X[2]=re[2]*ee+re[6]*q+re[10]*ae+re[14]*ie,X[3]=re[3]*ee+re[7]*q+re[11]*ae+re[15]*ie,X}function M(X,re,ee,q){return S(q,q),S(q,q),S(q,q)}function _(X,re){this.index=X,this.dataCoordinate=this.position=re}function w(X){return X===!0||X>1?1:X}function p(X,re,ee,q,ae,ie,fe,we,Ae,Fe,Ce,qe){this.gl=X,this.pixelRatio=1,this.shader=re,this.orthoShader=ee,this.projectShader=q,this.pointBuffer=ae,this.colorBuffer=ie,this.glyphBuffer=fe,this.idBuffer=we,this.vao=Ae,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=Fe,this.pickOrthoShader=Ce,this.pickProjectShader=qe,this.points=[],this._selectResult=new _(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}var u=p.prototype;u.pickSlots=1,u.setPickBase=function(X){this.pickId=X},u.isTransparent=function(){if(this.hasAlpha)return!0;for(var X=0;X<3;++X)if(this.axesProject[X]&&this.projectHasAlpha)return!0;return!1},u.isOpaque=function(){if(!this.hasAlpha)return!0;for(var X=0;X<3;++X)if(this.axesProject[X]&&!this.projectHasAlpha)return!0;return!1};var g=[0,0],m=[0,0,0],R=[0,0,0],P=[0,0,0,1],z=[0,0,0,1],F=h.slice(),B=[0,0,0],O=[[0,0,0],[0,0,0]];function L(X){return X[0]=X[1]=X[2]=0,X}function N(X,re){return X[0]=re[0],X[1]=re[1],X[2]=re[2],X[3]=1,X}function U(X,re,ee,q){return X[0]=re[0],X[1]=re[1],X[2]=re[2],X[ee]=q,X}function Z(X){for(var re=O,ee=0;ee<2;++ee)for(var q=0;q<3;++q)re[ee][q]=Math.max(Math.min(X[ee][q],1e8),-1e8);return re}function Q(X,re,ee,q){var ae=re.axesProject,ie=re.gl,fe=X.uniforms,we=ee.model||h,Ae=ee.view||h,Fe=ee.projection||h,Ce=re.axesBounds,qe=Z(re.clipBounds),et;re.axes&&re.axes.lastCubeProps?et=re.axes.lastCubeProps.axis:et=[1,1,1],g[0]=2/ie.drawingBufferWidth,g[1]=2/ie.drawingBufferHeight,X.bind(),fe.view=Ae,fe.projection=Fe,fe.screenSize=g,fe.highlightId=re.highlightId,fe.highlightScale=re.highlightScale,fe.clipBounds=qe,fe.pickGroup=re.pickId/255,fe.pixelRatio=q;for(var Qe=0;Qe<3;++Qe)if(ae[Qe]){fe.scale=re.projectScale[Qe],fe.opacity=re.projectOpacity[Qe];for(var Ke=F,Xe=0;Xe<16;++Xe)Ke[Xe]=0;for(var Xe=0;Xe<4;++Xe)Ke[5*Xe]=1;Ke[5*Qe]=0,et[Qe]<0?Ke[12+Qe]=Ce[0][Qe]:Ke[12+Qe]=Ce[1][Qe],s(Ke,we,Ke),fe.model=Ke;var Me=(Qe+1)%3,xe=(Qe+2)%3,ce=L(m),Re=L(R);ce[Me]=1,Re[xe]=1;var $e=M(Fe,Ae,we,N(P,ce)),rt=M(Fe,Ae,we,N(z,Re));if(Math.abs($e[1])>Math.abs(rt[1])){var Je=$e;$e=rt,rt=Je,Je=ce,ce=Re,Re=Je;var At=Me;Me=xe,xe=At}$e[0]<0&&(ce[Me]=-1),rt[1]>0&&(Re[xe]=-1);for(var St=0,Rt=0,Xe=0;Xe<4;++Xe)St+=Math.pow(we[4*Me+Xe],2),Rt+=Math.pow(we[4*xe+Xe],2);ce[Me]/=Math.sqrt(St),Re[xe]/=Math.sqrt(Rt),fe.axes[0]=ce,fe.axes[1]=Re,fe.fragClipBounds[0]=U(B,qe[0],Qe,-1e8),fe.fragClipBounds[1]=U(B,qe[1],Qe,1e8),re.vao.bind(),re.vao.draw(ie.TRIANGLES,re.vertexCount),re.lineWidth>0&&(ie.lineWidth(re.lineWidth*q),re.vao.draw(ie.LINES,re.lineVertexCount,re.vertexCount)),re.vao.unbind()}}var ue=[-1e8,-1e8,-1e8],oe=[1e8,1e8,1e8],le=[ue,oe];function j(X,re,ee,q,ae,ie,fe){var we=ee.gl;if((ie===ee.projectHasAlpha||fe)&&Q(re,ee,q,ae),ie===ee.hasAlpha||fe){X.bind();var Ae=X.uniforms;Ae.model=q.model||h,Ae.view=q.view||h,Ae.projection=q.projection||h,g[0]=2/we.drawingBufferWidth,g[1]=2/we.drawingBufferHeight,Ae.screenSize=g,Ae.highlightId=ee.highlightId,Ae.highlightScale=ee.highlightScale,Ae.fragClipBounds=le,Ae.clipBounds=ee.axes.bounds,Ae.opacity=ee.opacity,Ae.pickGroup=ee.pickId/255,Ae.pixelRatio=ae,ee.vao.bind(),ee.vao.draw(we.TRIANGLES,ee.vertexCount),ee.lineWidth>0&&(we.lineWidth(ee.lineWidth*ae),ee.vao.draw(we.LINES,ee.lineVertexCount,ee.vertexCount)),ee.vao.unbind()}}u.draw=function(X){var re=this.useOrtho?this.orthoShader:this.shader;j(re,this.projectShader,this,X,this.pixelRatio,!1,!1)},u.drawTransparent=function(X){var re=this.useOrtho?this.orthoShader:this.shader;j(re,this.projectShader,this,X,this.pixelRatio,!0,!1)},u.drawPick=function(X){var re=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;j(re,this.pickProjectShader,this,X,1,!0,!0)},u.pick=function(X){if(!X||X.id!==this.pickId)return null;var re=X.value[2]+(X.value[1]<<8)+(X.value[0]<<16);if(re>=this.pointCount||re<0)return null;var ee=this.points[re],q=this._selectResult;q.index=re;for(var ae=0;ae<3;++ae)q.position[ae]=q.dataCoordinate[ae]=ee[ae];return q},u.highlight=function(X){if(!X)this.highlightId=[1,1,1,1];else{var re=X.index,ee=re&255,q=re>>8&255,ae=re>>16&255;this.highlightId=[ee/255,q/255,ae/255,0]}};function J(X,re,ee,q){var ae;b(X)?re0){var dr=0,pt=xe,ze=[0,0,0,1],Ge=[0,0,0,1],Oe=b(et)&&b(et[0]),ve=b(Xe)&&b(Xe[0]);e:for(var q=0;q0?1-Rt[0][0]:Mt<0?1+Rt[1][0]:1,Nt*=Nt>0?1-Rt[0][1]:Nt<0?1+Rt[1][1]:1;for(var Bt=[Mt,Nt],da=At.cells||[],wa=At.positions||[],rt=0;rtthis.buffer.length){a.free(this.buffer);for(var b=this.buffer=a.mallocUint8(n(y*l*4)),S=0;Sb)for(l=b;ly)for(l=y;l=0){for(var O=B.type.charAt(B.type.length-1)|0,L=new Array(O),N=0;N=0;)U+=1;z[F]=U}var Z=new Array(b.length);function Q(){_.program=n.program(w,_._vref,_._fref,P,z);for(var ue=0;ue=0){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+_+": "+w);s(v,h,p[0],l,u,y,_)}else if(w.indexOf("mat")>=0){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+_+": "+w);c(v,h,p,l,u,y,_)}else throw new o("","Unknown data type for attribute "+_+": "+w);break}}return y}},3327:function(e,t,r){var o=r(216),a=r(8866);e.exports=s;function i(c){return function(){return c}}function n(c,f){for(var v=new Array(c),h=0;h4)throw new a("","Invalid data type");switch(U.charAt(0)){case"b":case"i":c["uniform"+Z+"iv"](h[z],F);break;case"v":c["uniform"+Z+"fv"](h[z],F);break;default:throw new a("","Unrecognized data type for vector "+name+": "+U)}}else if(U.indexOf("mat")===0&&U.length===4){if(Z=U.charCodeAt(U.length-1)-48,Z<2||Z>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+U);c["uniformMatrix"+Z+"fv"](h[z],!1,F);break}else throw new a("","Unknown uniform data type for "+name+": "+U)}}}}}function y(w,p){if(typeof p!="object")return[[w,p]];var u=[];for(var g in p){var m=p[g],R=w;parseInt(g)+""===g?R+="["+g+"]":R+="."+g,typeof m=="object"?u.push.apply(u,y(R,m)):u.push([R,m])}return u}function b(w){switch(w){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var p=w.indexOf("vec");if(0<=p&&p<=1&&w.length===4+p){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new a("","Invalid data type");return w.charAt(0)==="b"?n(u,!1):n(u,0)}else if(w.indexOf("mat")===0&&w.length===4){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+w);return n(u*u,0)}else throw new a("","Unknown uniform data type for "+name+": "+w)}}function S(w,p,u){if(typeof u=="object"){var g=M(u);Object.defineProperty(w,p,{get:i(g),set:l(u),enumerable:!0,configurable:!1})}else h[u]?Object.defineProperty(w,p,{get:T(u),set:l(u),enumerable:!0,configurable:!1}):w[p]=b(v[u].type)}function M(w){var p;if(Array.isArray(w)){p=new Array(w.length);for(var u=0;u1){v[0]in c||(c[v[0]]=[]),c=c[v[0]];for(var h=1;h1)for(var y=0;y"u"?r(606):WeakMap,n=new i,s=0;function c(S,M,_,w,p,u,g){this.id=S,this.src=M,this.type=_,this.shader=w,this.count=u,this.programs=[],this.cache=g}c.prototype.dispose=function(){if(--this.count===0){for(var S=this.cache,M=S.gl,_=this.programs,w=0,p=_.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; +} +`]),i=o([`#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; +} +`]),n=o([`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; +} +`]),s=o([`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); +}`]);t.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:n,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(e,t,r){var o=r(2931),a=r(9970),i=["xyz","xzy","yxz","yzx","zxy","zyx"],n=function(b,S,M,_){for(var w=b.points,p=b.velocities,u=b.divergences,g=[],m=[],R=[],P=[],z=[],F=[],B=0,O=0,L=a.create(),N=a.create(),U=8,Z=0;Z0)for(var le=0;leS)return _-1}return _},f=function(b,S,M){return bM?M:b},v=function(b,S,M){var _=S.vectors,w=S.meshgrid,p=b[0],u=b[1],g=b[2],m=w[0].length,R=w[1].length,P=w[2].length,z=c(w[0],p),F=c(w[1],u),B=c(w[2],g),O=z+1,L=F+1,N=B+1;if(z=f(z,0,m-1),O=f(O,0,m-1),F=f(F,0,R-1),L=f(L,0,R-1),B=f(B,0,P-1),N=f(N,0,P-1),z<0||F<0||B<0||O>m-1||L>R-1||N>P-1)return o.create();var U=w[0][z],Z=w[0][O],Q=w[1][F],ue=w[1][L],oe=w[2][B],le=w[2][N],j=(p-U)/(Z-U),J=(u-Q)/(ue-Q),$=(g-oe)/(le-oe);isFinite(j)||(j=.5),isFinite(J)||(J=.5),isFinite($)||($=.5);var X,re,ee,q,ae,ie;switch(M.reversedX&&(z=m-1-z,O=m-1-O),M.reversedY&&(F=R-1-F,L=R-1-L),M.reversedZ&&(B=P-1-B,N=P-1-N),M.filled){case 5:ae=B,ie=N,ee=F*P,q=L*P,X=z*P*R,re=O*P*R;break;case 4:ae=B,ie=N,X=z*P,re=O*P,ee=F*P*m,q=L*P*m;break;case 3:ee=F,q=L,ae=B*R,ie=N*R,X=z*R*P,re=O*R*P;break;case 2:ee=F,q=L,X=z*R,re=O*R,ae=B*R*m,ie=N*R*m;break;case 1:X=z,re=O,ae=B*m,ie=N*m,ee=F*m*P,q=L*m*P;break;default:X=z,re=O,ee=F*m,q=L*m,ae=B*m*R,ie=N*m*R;break}var fe=_[X+ee+ae],we=_[X+ee+ie],Ae=_[X+q+ae],Fe=_[X+q+ie],Ce=_[re+ee+ae],qe=_[re+ee+ie],et=_[re+q+ae],Qe=_[re+q+ie],Ke=o.create(),Xe=o.create(),Me=o.create(),xe=o.create();o.lerp(Ke,fe,Ce,j),o.lerp(Xe,we,qe,j),o.lerp(Me,Ae,et,j),o.lerp(xe,Fe,Qe,j);var ce=o.create(),Re=o.create();o.lerp(ce,Ke,Me,J),o.lerp(Re,Xe,xe,J);var $e=o.create();return o.lerp($e,ce,Re,$),$e},h=function(b){var S=1/0;b.sort(function(p,u){return p-u});for(var M=b.length,_=1;_O||QeL||KeN)},Z=o.distance(S[0],S[1]),Q=10*Z/_,ue=Q*Q,oe=1,le=0,j=M.length;j>1&&(oe=T(M));for(var J=0;Jle&&(le=fe),ae.push(fe),P.push({points:X,velocities:re,divergences:ae});for(var we=0;we<_*100&&X.length<_&&U($);){we++;var Ae=o.clone(ee),Fe=o.squaredLength(Ae);if(Fe===0)break;if(Fe>ue&&o.scale(Ae,Ae,Q/Math.sqrt(Fe)),o.add(Ae,Ae,$),ee=m(Ae),o.squaredDistance(q,Ae)-ue>-1e-4*ue){X.push(Ae),q=Ae,re.push(ee);var ie=R(Ae,ee),fe=o.length(ie);isFinite(fe)&&fe>le&&(le=fe),ae.push(fe)}$=Ae}}var Ce=s(P,b.colormap,le,oe);return p?Ce.tubeScale=p:(le===0&&(le=1),Ce.tubeScale=w*.5*oe/le),Ce};var l=r(6740),y=r(6405).createMesh;e.exports.createTubeMesh=function(b,S){return y(b,S,{shaders:l,traceType:"streamtube"})}},990:function(e,t,r){var o=r(9405),a=r(3236),i=a([`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; + mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); + vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 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); +} +`]),n=a([`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 — 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; +} +`]),s=a([`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; + mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); + vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 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); +} +`]),c=a([`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)); +} +`]);t.createShader=function(f){var v=o(f,i,n,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v.attributes.normal.location=2,v},t.createPickShader=function(f){var v=o(f,i,c,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v.attributes.normal.location=2,v},t.createContourShader=function(f){var v=o(f,s,n,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v},t.createPickContourShader=function(f){var v=o(f,s,c,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v}},9499:function(e,t,r){e.exports=re;var o=r(8828),a=r(2762),i=r(8116),n=r(7766),s=r(1888),c=r(6729),f=r(5298),v=r(9994),h=r(9618),T=r(3711),l=r(6760),y=r(7608),b=r(2478),S=r(6199),M=r(990),_=M.createShader,w=M.createContourShader,p=M.createPickShader,u=M.createPickContourShader,g=4*10,m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],R=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],P=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];(function(){for(var ee=0;ee<3;++ee){var q=P[ee],ae=(ee+1)%3,ie=(ee+2)%3;q[ae+0]=1,q[ie+3]=1,q[ee+6]=1}})();function z(ee,q,ae,ie,fe){this.position=ee,this.index=q,this.uv=ae,this.level=ie,this.dataCoordinate=fe}var F=256;function B(ee,q,ae,ie,fe,we,Ae,Fe,Ce,qe,et,Qe,Ke,Xe,Me){this.gl=ee,this.shape=q,this.bounds=ae,this.objectOffset=Me,this.intensityBounds=[],this._shader=ie,this._pickShader=fe,this._coordinateBuffer=we,this._vao=Ae,this._colorMap=Fe,this._contourShader=Ce,this._contourPickShader=qe,this._contourBuffer=et,this._contourVAO=Qe,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new z([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=Ke,this._dynamicVAO=Xe,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=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var O=B.prototype;O.genColormap=function(ee,q){var ae=!1,ie=v([c({colormap:ee,nshades:F,format:"rgba"}).map(function(fe,we){var Ae=q?L(we/255,q):fe[3];return Ae<1&&(ae=!0),[fe[0],fe[1],fe[2],255*Ae]})]);return f.divseq(ie,255),this.hasAlphaScale=ae,ie},O.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},O.isOpaque=function(){return!this.isTransparent()},O.pickSlots=1,O.setPickBase=function(ee){this.pickId=ee};function L(ee,q){if(!q||!q.length)return 1;for(var ae=0;aeee&&ae>0){var ie=(q[ae][0]-ee)/(q[ae][0]-q[ae-1][0]);return q[ae][1]*(1-ie)+ie*q[ae-1][1]}}return 1}var N=[0,0,0],U={showSurface:!1,showContour:!1,projections:[m.slice(),m.slice(),m.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function Z(ee,q){var ae,ie,fe,we=q.axes&&q.axes.lastCubeProps.axis||N,Ae=q.showSurface,Fe=q.showContour;for(ae=0;ae<3;++ae)for(Ae=Ae||q.surfaceProject[ae],ie=0;ie<3;++ie)Fe=Fe||q.contourProject[ae][ie];for(ae=0;ae<3;++ae){var Ce=U.projections[ae];for(ie=0;ie<16;++ie)Ce[ie]=0;for(ie=0;ie<4;++ie)Ce[5*ie]=1;Ce[5*ae]=0,Ce[12+ae]=q.axesBounds[+(we[ae]>0)][ae],l(Ce,ee.model,Ce);var qe=U.clipBounds[ae];for(fe=0;fe<2;++fe)for(ie=0;ie<3;++ie)qe[fe][ie]=ee.clipBounds[fe][ie];qe[0][ae]=-1e8,qe[1][ae]=1e8}return U.showSurface=Ae,U.showContour=Fe,U}var Q={model:m,view:m,projection:m,inverseModel:m.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},ue=m.slice(),oe=[1,0,0,0,1,0,0,0,1];function le(ee,q){ee=ee||{};var ae=this.gl;ae.disable(ae.CULL_FACE),this._colorMap.bind(0);var ie=Q;ie.model=ee.model||m,ie.view=ee.view||m,ie.projection=ee.projection||m,ie.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],ie.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],ie.objectOffset=this.objectOffset,ie.contourColor=this.contourColor[0],ie.inverseModel=y(ie.inverseModel,ie.model);for(var fe=0;fe<2;++fe)for(var we=ie.clipBounds[fe],Ae=0;Ae<3;++Ae)we[Ae]=Math.min(Math.max(this.clipBounds[fe][Ae],-1e8),1e8);ie.kambient=this.ambientLight,ie.kdiffuse=this.diffuseLight,ie.kspecular=this.specularLight,ie.roughness=this.roughness,ie.fresnel=this.fresnel,ie.opacity=this.opacity,ie.height=0,ie.permutation=oe,ie.vertexColor=this.vertexColor;var Fe=ue;for(l(Fe,ie.view,ie.model),l(Fe,ie.projection,Fe),y(Fe,Fe),fe=0;fe<3;++fe)ie.eyePosition[fe]=Fe[12+fe]/Fe[15];var Ce=Fe[15];for(fe=0;fe<3;++fe)Ce+=this.lightPosition[fe]*Fe[4*fe+3];for(fe=0;fe<3;++fe){var qe=Fe[12+fe];for(Ae=0;Ae<3;++Ae)qe+=Fe[4*Ae+fe]*this.lightPosition[Ae];ie.lightPosition[fe]=qe/Ce}var et=Z(ie,this);if(et.showSurface){for(this._shader.bind(),this._shader.uniforms=ie,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(ae.TRIANGLES,this._vertexCount),fe=0;fe<3;++fe)!this.surfaceProject[fe]||!this.vertexCount||(this._shader.uniforms.model=et.projections[fe],this._shader.uniforms.clipBounds=et.clipBounds[fe],this._vao.draw(ae.TRIANGLES,this._vertexCount));this._vao.unbind()}if(et.showContour){var Qe=this._contourShader;ie.kambient=1,ie.kdiffuse=0,ie.kspecular=0,ie.opacity=1,Qe.bind(),Qe.uniforms=ie;var Ke=this._contourVAO;for(Ke.bind(),fe=0;fe<3;++fe)for(Qe.uniforms.permutation=P[fe],ae.lineWidth(this.contourWidth[fe]*this.pixelRatio),Ae=0;Ae>4)/16)/255,fe=Math.floor(ie),we=ie-fe,Ae=q[1]*(ee.value[1]+(ee.value[2]&15)/16)/255,Fe=Math.floor(Ae),Ce=Ae-Fe;fe+=1,Fe+=1;var qe=ae.position;qe[0]=qe[1]=qe[2]=0;for(var et=0;et<2;++et)for(var Qe=et?we:1-we,Ke=0;Ke<2;++Ke)for(var Xe=Ke?Ce:1-Ce,Me=fe+et,xe=Fe+Ke,ce=Qe*Xe,Re=0;Re<3;++Re)qe[Re]+=this._field[Re].get(Me,xe)*ce;for(var $e=this._pickResult.level,rt=0;rt<3;++rt)if($e[rt]=b.le(this.contourLevels[rt],qe[rt]),$e[rt]<0)this.contourLevels[rt].length>0&&($e[rt]=0);else if($e[rt]Math.abs(At-qe[rt])&&($e[rt]+=1)}for(ae.index[0]=we<.5?fe:fe+1,ae.index[1]=Ce<.5?Fe:Fe+1,ae.uv[0]=ie/q[0],ae.uv[1]=Ae/q[1],Re=0;Re<3;++Re)ae.dataCoordinate[Re]=this._field[Re].get(ae.index[0],ae.index[1]);return ae},O.padField=function(ee,q){var ae=q.shape.slice(),ie=ee.shape.slice();f.assign(ee.lo(1,1).hi(ae[0],ae[1]),q),f.assign(ee.lo(1).hi(ae[0],1),q.hi(ae[0],1)),f.assign(ee.lo(1,ie[1]-1).hi(ae[0],1),q.lo(0,ae[1]-1).hi(ae[0],1)),f.assign(ee.lo(0,1).hi(1,ae[1]),q.hi(1)),f.assign(ee.lo(ie[0]-1,1).hi(1,ae[1]),q.lo(ae[0]-1)),ee.set(0,0,q.get(0,0)),ee.set(0,ie[1]-1,q.get(0,ae[1]-1)),ee.set(ie[0]-1,0,q.get(ae[0]-1,0)),ee.set(ie[0]-1,ie[1]-1,q.get(ae[0]-1,ae[1]-1))};function J(ee,q){return Array.isArray(ee)?[q(ee[0]),q(ee[1]),q(ee[2])]:[q(ee),q(ee),q(ee)]}function $(ee){return Array.isArray(ee)?ee.length===3?[ee[0],ee[1],ee[2],1]:[ee[0],ee[1],ee[2],ee[3]]:[0,0,0,1]}function X(ee){if(Array.isArray(ee)){if(Array.isArray(ee))return[$(ee[0]),$(ee[1]),$(ee[2])];var q=$(ee);return[q.slice(),q.slice(),q.slice()]}}O.update=function(ee){ee=ee||{},this.objectOffset=ee.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in ee&&(this.contourWidth=J(ee.contourWidth,Number)),"showContour"in ee&&(this.showContour=J(ee.showContour,Boolean)),"showSurface"in ee&&(this.showSurface=!!ee.showSurface),"contourTint"in ee&&(this.contourTint=J(ee.contourTint,Boolean)),"contourColor"in ee&&(this.contourColor=X(ee.contourColor)),"contourProject"in ee&&(this.contourProject=J(ee.contourProject,function(Oa){return J(Oa,Boolean)})),"surfaceProject"in ee&&(this.surfaceProject=ee.surfaceProject),"dynamicColor"in ee&&(this.dynamicColor=X(ee.dynamicColor)),"dynamicTint"in ee&&(this.dynamicTint=J(ee.dynamicTint,Number)),"dynamicWidth"in ee&&(this.dynamicWidth=J(ee.dynamicWidth,Number)),"opacity"in ee&&(this.opacity=ee.opacity),"opacityscale"in ee&&(this.opacityscale=ee.opacityscale),"colorBounds"in ee&&(this.colorBounds=ee.colorBounds),"vertexColor"in ee&&(this.vertexColor=ee.vertexColor?1:0),"colormap"in ee&&this._colorMap.setPixels(this.genColormap(ee.colormap,this.opacityscale));var q=ee.field||ee.coords&&ee.coords[2]||null,ae=!1;if(q||(this._field[2].shape[0]||this._field[2].shape[2]?q=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):q=this._field[2].hi(0,0)),"field"in ee||"coords"in ee){var ie=(q.shape[0]+2)*(q.shape[1]+2);ie>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(o.nextPow2(ie))),this._field[2]=h(this._field[2].data,[q.shape[0]+2,q.shape[1]+2]),this.padField(this._field[2],q),this.shape=q.shape.slice();for(var fe=this.shape,we=0;we<2;++we)this._field[2].size>this._field[we].data.length&&(s.freeFloat(this._field[we].data),this._field[we].data=s.mallocFloat(this._field[2].size)),this._field[we]=h(this._field[we].data,[fe[0]+2,fe[1]+2]);if(ee.coords){var Ae=ee.coords;if(!Array.isArray(Ae)||Ae.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(we=0;we<2;++we){var Fe=Ae[we];for(Ke=0;Ke<2;++Ke)if(Fe.shape[Ke]!==fe[Ke])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[we],Fe)}}else if(ee.ticks){var Ce=ee.ticks;if(!Array.isArray(Ce)||Ce.length!==2)throw new Error("gl-surface: invalid ticks");for(we=0;we<2;++we){var qe=Ce[we];if((Array.isArray(qe)||qe.length)&&(qe=h(qe)),qe.shape[0]!==fe[we])throw new Error("gl-surface: invalid tick length");var et=h(qe.data,fe);et.stride[we]=qe.stride[0],et.stride[we^1]=0,this.padField(this._field[we],et)}}else{for(we=0;we<2;++we){var Qe=[0,0];Qe[we]=1,this._field[we]=h(this._field[we].data,[fe[0]+2,fe[1]+2],Qe,0)}this._field[0].set(0,0,0);for(var Ke=0;Ke0){for(var Pa=0;Pa<5;++Pa)qt.pop();Oe-=1}continue e}}}da.push(Oe)}this._contourOffsets[Zt]=ta,this._contourCounts[Zt]=da}var sa=s.mallocFloat(qt.length);for(we=0;wez||R<0||R>z)throw new Error("gl-texture2d: Invalid texture size");return g._shape=[m,R],g.bind(),P.texImage2D(P.TEXTURE_2D,0,g.format,m,R,0,g.format,g.type,null),g._mipLevels=[0],g}function l(g,m,R,P,z,F){this.gl=g,this.handle=m,this.format=z,this.type=F,this._shape=[R,P],this._mipLevels=[0],this._magFilter=g.NEAREST,this._minFilter=g.NEAREST,this._wrapS=g.CLAMP_TO_EDGE,this._wrapT=g.CLAMP_TO_EDGE,this._anisoSamples=1;var B=this,O=[this._wrapS,this._wrapT];Object.defineProperties(O,[{get:function(){return B._wrapS},set:function(N){return B.wrapS=N}},{get:function(){return B._wrapT},set:function(N){return B.wrapT=N}}]),this._wrapVector=O;var L=[this._shape[0],this._shape[1]];Object.defineProperties(L,[{get:function(){return B._shape[0]},set:function(N){return B.width=N}},{get:function(){return B._shape[1]},set:function(N){return B.height=N}}]),this._shapeVector=L}var y=l.prototype;Object.defineProperties(y,{minFilter:{get:function(){return this._minFilter},set:function(g){this.bind();var m=this.gl;if(this.type===m.FLOAT&&n.indexOf(g)>=0&&(m.getExtension("OES_texture_float_linear")||(g=m.NEAREST)),s.indexOf(g)<0)throw new Error("gl-texture2d: Unknown filter mode "+g);return m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,g),this._minFilter=g}},magFilter:{get:function(){return this._magFilter},set:function(g){this.bind();var m=this.gl;if(this.type===m.FLOAT&&n.indexOf(g)>=0&&(m.getExtension("OES_texture_float_linear")||(g=m.NEAREST)),s.indexOf(g)<0)throw new Error("gl-texture2d: Unknown filter mode "+g);return m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,g),this._magFilter=g}},mipSamples:{get:function(){return this._anisoSamples},set:function(g){var m=this._anisoSamples;if(this._anisoSamples=Math.max(g,1)|0,m!==this._anisoSamples){var R=this.gl.getExtension("EXT_texture_filter_anisotropic");R&&this.gl.texParameterf(this.gl.TEXTURE_2D,R.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(g){if(this.bind(),c.indexOf(g)<0)throw new Error("gl-texture2d: Unknown wrap mode "+g);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,g),this._wrapS=g}},wrapT:{get:function(){return this._wrapT},set:function(g){if(this.bind(),c.indexOf(g)<0)throw new Error("gl-texture2d: Unknown wrap mode "+g);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,g),this._wrapT=g}},wrap:{get:function(){return this._wrapVector},set:function(g){if(Array.isArray(g)||(g=[g,g]),g.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var m=0;m<2;++m)if(c.indexOf(g[m])<0)throw new Error("gl-texture2d: Unknown wrap mode "+g);this._wrapS=g[0],this._wrapT=g[1];var R=this.gl;return this.bind(),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,this._wrapS),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,this._wrapT),g}},shape:{get:function(){return this._shapeVector},set:function(g){if(!Array.isArray(g))g=[g|0,g|0];else if(g.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return T(this,g[0]|0,g[1]|0),[g[0]|0,g[1]|0]}},width:{get:function(){return this._shape[0]},set:function(g){return g=g|0,T(this,g,this._shape[1]),g}},height:{get:function(){return this._shape[1]},set:function(g){return g=g|0,T(this,this._shape[0],g),g}}}),y.bind=function(g){var m=this.gl;return g!==void 0&&m.activeTexture(m.TEXTURE0+(g|0)),m.bindTexture(m.TEXTURE_2D,this.handle),g!==void 0?g|0:m.getParameter(m.ACTIVE_TEXTURE)-m.TEXTURE0},y.dispose=function(){this.gl.deleteTexture(this.handle)},y.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var g=Math.min(this._shape[0],this._shape[1]),m=0;g>0;++m,g>>>=1)this._mipLevels.indexOf(m)<0&&this._mipLevels.push(m)},y.setPixels=function(g,m,R,P){var z=this.gl;this.bind(),Array.isArray(m)?(P=R,R=m[1]|0,m=m[0]|0):(m=m||0,R=R||0),P=P||0;var F=v(g)?g:g.raw;if(F){var B=this._mipLevels.indexOf(P)<0;B?(z.texImage2D(z.TEXTURE_2D,0,this.format,this.format,this.type,F),this._mipLevels.push(P)):z.texSubImage2D(z.TEXTURE_2D,P,m,R,this.format,this.type,F)}else if(g.shape&&g.stride&&g.data){if(g.shape.length<2||m+g.shape[1]>this._shape[1]>>>P||R+g.shape[0]>this._shape[0]>>>P||m<0||R<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");S(z,m,R,P,this.format,this.type,this._mipLevels,g)}else throw new Error("gl-texture2d: Unsupported data type")};function b(g,m){return g.length===3?m[2]===1&&m[1]===g[0]*g[2]&&m[0]===g[2]:m[0]===1&&m[1]===g[0]}function S(g,m,R,P,z,F,B,O){var L=O.dtype,N=O.shape.slice();if(N.length<2||N.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var U=0,Z=0,Q=b(N,O.stride.slice());if(L==="float32"?U=g.FLOAT:L==="float64"?(U=g.FLOAT,Q=!1,L="float32"):L==="uint8"?U=g.UNSIGNED_BYTE:(U=g.UNSIGNED_BYTE,Q=!1,L="uint8"),N.length===2)Z=g.LUMINANCE,N=[N[0],N[1],1],O=o(O.data,N,[O.stride[0],O.stride[1],1],O.offset);else if(N.length===3){if(N[2]===1)Z=g.ALPHA;else if(N[2]===2)Z=g.LUMINANCE_ALPHA;else if(N[2]===3)Z=g.RGB;else if(N[2]===4)Z=g.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");N[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((Z===g.LUMINANCE||Z===g.ALPHA)&&(z===g.LUMINANCE||z===g.ALPHA)&&(Z=z),Z!==z)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var ue=O.size,oe=B.indexOf(P)<0;if(oe&&B.push(P),U===F&&Q)O.offset===0&&O.data.length===ue?oe?g.texImage2D(g.TEXTURE_2D,P,z,N[0],N[1],0,z,F,O.data):g.texSubImage2D(g.TEXTURE_2D,P,m,R,N[0],N[1],z,F,O.data):oe?g.texImage2D(g.TEXTURE_2D,P,z,N[0],N[1],0,z,F,O.data.subarray(O.offset,O.offset+ue)):g.texSubImage2D(g.TEXTURE_2D,P,m,R,N[0],N[1],z,F,O.data.subarray(O.offset,O.offset+ue));else{var le;F===g.FLOAT?le=i.mallocFloat32(ue):le=i.mallocUint8(ue);var j=o(le,N,[N[2],N[2]*N[0],1]);U===g.FLOAT&&F===g.UNSIGNED_BYTE?h(j,O):a.assign(j,O),oe?g.texImage2D(g.TEXTURE_2D,P,z,N[0],N[1],0,z,F,le.subarray(0,ue)):g.texSubImage2D(g.TEXTURE_2D,P,m,R,N[0],N[1],z,F,le.subarray(0,ue)),F===g.FLOAT?i.freeFloat32(le):i.freeUint8(le)}}function M(g){var m=g.createTexture();return g.bindTexture(g.TEXTURE_2D,m),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.NEAREST),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.NEAREST),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),m}function _(g,m,R,P,z){var F=g.getParameter(g.MAX_TEXTURE_SIZE);if(m<0||m>F||R<0||R>F)throw new Error("gl-texture2d: Invalid texture shape");if(z===g.FLOAT&&!g.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var B=M(g);return g.texImage2D(g.TEXTURE_2D,0,P,m,R,0,P,z,null),new l(g,B,m,R,P,z)}function w(g,m,R,P,z,F){var B=M(g);return g.texImage2D(g.TEXTURE_2D,0,z,z,F,m),new l(g,B,R,P,z,F)}function p(g,m){var R=m.dtype,P=m.shape.slice(),z=g.getParameter(g.MAX_TEXTURE_SIZE);if(P[0]<0||P[0]>z||P[1]<0||P[1]>z)throw new Error("gl-texture2d: Invalid texture size");var F=b(P,m.stride.slice()),B=0;R==="float32"?B=g.FLOAT:R==="float64"?(B=g.FLOAT,F=!1,R="float32"):R==="uint8"?B=g.UNSIGNED_BYTE:(B=g.UNSIGNED_BYTE,F=!1,R="uint8");var O=0;if(P.length===2)O=g.LUMINANCE,P=[P[0],P[1],1],m=o(m.data,P,[m.stride[0],m.stride[1],1],m.offset);else if(P.length===3)if(P[2]===1)O=g.ALPHA;else if(P[2]===2)O=g.LUMINANCE_ALPHA;else if(P[2]===3)O=g.RGB;else if(P[2]===4)O=g.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");B===g.FLOAT&&!g.getExtension("OES_texture_float")&&(B=g.UNSIGNED_BYTE,F=!1);var L,N,U=m.size;if(F)m.offset===0&&m.data.length===U?L=m.data:L=m.data.subarray(m.offset,m.offset+U);else{var Z=[P[2],P[2]*P[0],1];N=i.malloc(U,R);var Q=o(N,P,Z,0);(R==="float32"||R==="float64")&&B===g.UNSIGNED_BYTE?h(Q,m):a.assign(Q,m),L=N.subarray(0,U)}var ue=M(g);return g.texImage2D(g.TEXTURE_2D,0,O,P[0],P[1],0,O,B,L),F||i.free(N),new l(g,ue,P[0],P[1],O,B)}function u(g){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(n||f(g),typeof arguments[1]=="number")return _(g,arguments[1],arguments[2],arguments[3]||g.RGBA,arguments[4]||g.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return _(g,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||g.RGBA,arguments[3]||g.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var m=arguments[1],R=v(m)?m:m.raw;if(R)return w(g,R,m.width|0,m.height|0,arguments[2]||g.RGBA,arguments[3]||g.UNSIGNED_BYTE);if(m.shape&&m.data&&m.stride)return p(g,m)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}},1433:function(e){function t(r,o,a){o?o.bind():r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,null);var i=r.getParameter(r.MAX_VERTEX_ATTRIBS)|0;if(a){if(a.length>i)throw new Error("gl-vao: Too many vertex attributes");for(var n=0;n1?0:Math.acos(h)}},9226:function(e){e.exports=t;function t(r,o){return r[0]=Math.ceil(o[0]),r[1]=Math.ceil(o[1]),r[2]=Math.ceil(o[2]),r}},3126:function(e){e.exports=t;function t(r){var o=new Float32Array(3);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o}},3990:function(e){e.exports=t;function t(r,o){return r[0]=o[0],r[1]=o[1],r[2]=o[2],r}},1091:function(e){e.exports=t;function t(){var r=new Float32Array(3);return r[0]=0,r[1]=0,r[2]=0,r}},5911:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[0],f=a[1],v=a[2];return r[0]=n*v-s*f,r[1]=s*c-i*v,r[2]=i*f-n*c,r}},5455:function(e,t,r){e.exports=r(7056)},7056:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2];return Math.sqrt(a*a+i*i+n*n)}},4008:function(e,t,r){e.exports=r(6690)},6690:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]/a[0],r[1]=o[1]/a[1],r[2]=o[2]/a[2],r}},244:function(e){e.exports=t;function t(r,o){return r[0]*o[0]+r[1]*o[1]+r[2]*o[2]}},2613:function(e){e.exports=1e-6},9922:function(e,t,r){e.exports=a;var o=r(2613);function a(i,n){var s=i[0],c=i[1],f=i[2],v=n[0],h=n[1],T=n[2];return Math.abs(s-v)<=o*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(c-h)<=o*Math.max(1,Math.abs(c),Math.abs(h))&&Math.abs(f-T)<=o*Math.max(1,Math.abs(f),Math.abs(T))}},9265:function(e){e.exports=t;function t(r,o){return r[0]===o[0]&&r[1]===o[1]&&r[2]===o[2]}},2681:function(e){e.exports=t;function t(r,o){return r[0]=Math.floor(o[0]),r[1]=Math.floor(o[1]),r[2]=Math.floor(o[2]),r}},5137:function(e,t,r){e.exports=a;var o=r(1091)();function a(i,n,s,c,f,v){var h,T;for(n||(n=3),s||(s=0),c?T=Math.min(c*n+s,i.length):T=i.length,h=s;h0&&(s=1/Math.sqrt(s),r[0]=o[0]*s,r[1]=o[1]*s,r[2]=o[2]*s),r}},7636:function(e){e.exports=t;function t(r,o){o=o||1;var a=Math.random()*2*Math.PI,i=Math.random()*2-1,n=Math.sqrt(1-i*i)*o;return r[0]=Math.cos(a)*n,r[1]=Math.sin(a)*n,r[2]=i*o,r}},6894:function(e){e.exports=t;function t(r,o,a,i){var n=a[1],s=a[2],c=o[1]-n,f=o[2]-s,v=Math.sin(i),h=Math.cos(i);return r[0]=o[0],r[1]=n+c*h-f*v,r[2]=s+c*v+f*h,r}},109:function(e){e.exports=t;function t(r,o,a,i){var n=a[0],s=a[2],c=o[0]-n,f=o[2]-s,v=Math.sin(i),h=Math.cos(i);return r[0]=n+f*v+c*h,r[1]=o[1],r[2]=s+f*h-c*v,r}},8692:function(e){e.exports=t;function t(r,o,a,i){var n=a[0],s=a[1],c=o[0]-n,f=o[1]-s,v=Math.sin(i),h=Math.cos(i);return r[0]=n+c*h-f*v,r[1]=s+c*v+f*h,r[2]=o[2],r}},2447:function(e){e.exports=t;function t(r,o){return r[0]=Math.round(o[0]),r[1]=Math.round(o[1]),r[2]=Math.round(o[2]),r}},6621:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a,r[1]=o[1]*a,r[2]=o[2]*a,r}},8489:function(e){e.exports=t;function t(r,o,a,i){return r[0]=o[0]+a[0]*i,r[1]=o[1]+a[1]*i,r[2]=o[2]+a[2]*i,r}},1463:function(e){e.exports=t;function t(r,o,a,i){return r[0]=o,r[1]=a,r[2]=i,r}},6141:function(e,t,r){e.exports=r(2953)},5486:function(e,t,r){e.exports=r(3066)},2953:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2];return a*a+i*i+n*n}},3066:function(e){e.exports=t;function t(r){var o=r[0],a=r[1],i=r[2];return o*o+a*a+i*i}},2229:function(e,t,r){e.exports=r(6843)},6843:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]-a[0],r[1]=o[1]-a[1],r[2]=o[2]-a[2],r}},492:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2];return r[0]=i*a[0]+n*a[3]+s*a[6],r[1]=i*a[1]+n*a[4]+s*a[7],r[2]=i*a[2]+n*a[5]+s*a[8],r}},5673:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[3]*i+a[7]*n+a[11]*s+a[15];return c=c||1,r[0]=(a[0]*i+a[4]*n+a[8]*s+a[12])/c,r[1]=(a[1]*i+a[5]*n+a[9]*s+a[13])/c,r[2]=(a[2]*i+a[6]*n+a[10]*s+a[14])/c,r}},264:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[0],f=a[1],v=a[2],h=a[3],T=h*i+f*s-v*n,l=h*n+v*i-c*s,y=h*s+c*n-f*i,b=-c*i-f*n-v*s;return r[0]=T*h+b*-c+l*-v-y*-f,r[1]=l*h+b*-f+y*-c-T*-v,r[2]=y*h+b*-v+T*-f-l*-c,r}},4361:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]+a[0],r[1]=o[1]+a[1],r[2]=o[2]+a[2],r[3]=o[3]+a[3],r}},2335:function(e){e.exports=t;function t(r){var o=new Float32Array(4);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o}},2933:function(e){e.exports=t;function t(r,o){return r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=o[3],r}},7536:function(e){e.exports=t;function t(){var r=new Float32Array(4);return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}},4691:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2],s=o[3]-r[3];return Math.sqrt(a*a+i*i+n*n+s*s)}},1373:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]/a[0],r[1]=o[1]/a[1],r[2]=o[2]/a[2],r[3]=o[3]/a[3],r}},3750:function(e){e.exports=t;function t(r,o){return r[0]*o[0]+r[1]*o[1]+r[2]*o[2]+r[3]*o[3]}},3390:function(e){e.exports=t;function t(r,o,a,i){var n=new Float32Array(4);return n[0]=r,n[1]=o,n[2]=a,n[3]=i,n}},9970:function(e,t,r){e.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(e){e.exports=t;function t(r,o){return r[0]=1/o[0],r[1]=1/o[1],r[2]=1/o[2],r[3]=1/o[3],r}},6808:function(e){e.exports=t;function t(r){var o=r[0],a=r[1],i=r[2],n=r[3];return Math.sqrt(o*o+a*a+i*i+n*n)}},2573:function(e){e.exports=t;function t(r,o,a,i){var n=o[0],s=o[1],c=o[2],f=o[3];return r[0]=n+i*(a[0]-n),r[1]=s+i*(a[1]-s),r[2]=c+i*(a[2]-c),r[3]=f+i*(a[3]-f),r}},160:function(e){e.exports=t;function t(r,o,a){return r[0]=Math.max(o[0],a[0]),r[1]=Math.max(o[1],a[1]),r[2]=Math.max(o[2],a[2]),r[3]=Math.max(o[3],a[3]),r}},2334:function(e){e.exports=t;function t(r,o,a){return r[0]=Math.min(o[0],a[0]),r[1]=Math.min(o[1],a[1]),r[2]=Math.min(o[2],a[2]),r[3]=Math.min(o[3],a[3]),r}},3576:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a[0],r[1]=o[1]*a[1],r[2]=o[2]*a[2],r[3]=o[3]*a[3],r}},1498:function(e){e.exports=t;function t(r,o){return r[0]=-o[0],r[1]=-o[1],r[2]=-o[2],r[3]=-o[3],r}},5177:function(e){e.exports=t;function t(r,o){var a=o[0],i=o[1],n=o[2],s=o[3],c=a*a+i*i+n*n+s*s;return c>0&&(c=1/Math.sqrt(c),r[0]=a*c,r[1]=i*c,r[2]=n*c,r[3]=s*c),r}},9131:function(e,t,r){var o=r(5177),a=r(9288);e.exports=i;function i(n,s){return s=s||1,n[0]=Math.random(),n[1]=Math.random(),n[2]=Math.random(),n[3]=Math.random(),o(n,n),a(n,n,s),n}},9288:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a,r[1]=o[1]*a,r[2]=o[2]*a,r[3]=o[3]*a,r}},4844:function(e){e.exports=t;function t(r,o,a,i){return r[0]=o[0]+a[0]*i,r[1]=o[1]+a[1]*i,r[2]=o[2]+a[2]*i,r[3]=o[3]+a[3]*i,r}},4578:function(e){e.exports=t;function t(r,o,a,i,n){return r[0]=o,r[1]=a,r[2]=i,r[3]=n,r}},7960:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2],s=o[3]-r[3];return a*a+i*i+n*n+s*s}},483:function(e){e.exports=t;function t(r){var o=r[0],a=r[1],i=r[2],n=r[3];return o*o+a*a+i*i+n*n}},6860:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]-a[0],r[1]=o[1]-a[1],r[2]=o[2]-a[2],r[3]=o[3]-a[3],r}},5352:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=o[3];return r[0]=a[0]*i+a[4]*n+a[8]*s+a[12]*c,r[1]=a[1]*i+a[5]*n+a[9]*s+a[13]*c,r[2]=a[2]*i+a[6]*n+a[10]*s+a[14]*c,r[3]=a[3]*i+a[7]*n+a[11]*s+a[15]*c,r}},4041:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[0],f=a[1],v=a[2],h=a[3],T=h*i+f*s-v*n,l=h*n+v*i-c*s,y=h*s+c*n-f*i,b=-c*i-f*n-v*s;return r[0]=T*h+b*-c+l*-v-y*-f,r[1]=l*h+b*-f+y*-c-T*-v,r[2]=y*h+b*-v+T*-f-l*-c,r[3]=o[3],r}},1848:function(e,t,r){var o=r(4905),a=r(6468);e.exports=i;function i(n){for(var s=Array.isArray(n)?n:o(n),c=0;c0)continue;Re=Me.slice(0,1).join("")}return ee(Re),Q+=Re.length,L=L.slice(Re.length),L.length}while(!0)}function et(){return/[^a-fA-F0-9]/.test(B)?(ee(L.join("")),F=c,P):(L.push(B),O=B,P+1)}function Qe(){return B==="."||/[eE]/.test(B)?(L.push(B),F=b,O=B,P+1):B==="x"&&L.length===1&&L[0]==="0"?(F=u,L.push(B),O=B,P+1):/[^\d]/.test(B)?(ee(L.join("")),F=c,P):(L.push(B),O=B,P+1)}function Ke(){return B==="f"&&(L.push(B),O=B,P+=1),/[eE]/.test(B)||(B==="-"||B==="+")&&/[eE]/.test(O)?(L.push(B),O=B,P+1):/[^\d]/.test(B)?(ee(L.join("")),F=c,P):(L.push(B),O=B,P+1)}function Xe(){if(/[^\d\w_]/.test(B)){var Me=L.join("");return re[Me]?F=_:X[Me]?F=M:F=S,ee(L.join("")),F=c,P}return L.push(B),O=B,P+1}}},3508:function(e,t,r){var o=r(6852);o=o.slice().filter(function(a){return!/^(gl\_|texture)/.test(a)}),e.exports=o.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(e){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932:function(e,t,r){var o=r(620);e.exports=o.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(e){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827:function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(e,t,r){var o=r(5874);e.exports=a;function a(i,n){var s=o(n),c=[];return c=c.concat(s(i)),c=c.concat(s(null)),c}},3236:function(e){e.exports=function(t){typeof t=="string"&&(t=[t]);for(var r=[].slice.call(arguments,1),o=[],a=0;a>1,T=-7,l=a?n-1:0,y=a?-1:1,b=r[o+l];for(l+=y,s=b&(1<<-T)-1,b>>=-T,T+=f;T>0;s=s*256+r[o+l],l+=y,T-=8);for(c=s&(1<<-T)-1,s>>=-T,T+=i;T>0;c=c*256+r[o+l],l+=y,T-=8);if(s===0)s=1-h;else{if(s===v)return c?NaN:(b?-1:1)*(1/0);c=c+Math.pow(2,i),s=s-h}return(b?-1:1)*c*Math.pow(2,s-i)},t.write=function(r,o,a,i,n,s){var c,f,v,h=s*8-n-1,T=(1<>1,y=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=i?0:s-1,S=i?1:-1,M=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(f=isNaN(o)?1:0,c=T):(c=Math.floor(Math.log(o)/Math.LN2),o*(v=Math.pow(2,-c))<1&&(c--,v*=2),c+l>=1?o+=y/v:o+=y*Math.pow(2,1-l),o*v>=2&&(c++,v/=2),c+l>=T?(f=0,c=T):c+l>=1?(f=(o*v-1)*Math.pow(2,n),c=c+l):(f=o*Math.pow(2,l-1)*Math.pow(2,n),c=0));n>=8;r[a+b]=f&255,b+=S,f/=256,n-=8);for(c=c<0;r[a+b]=c&255,b+=S,c/=256,h-=8);r[a+b-S]|=M*128}},8954:function(e,t,r){e.exports=l;var o=r(3250),a=r(6803).Fw;function i(y,b,S){this.vertices=y,this.adjacent=b,this.boundary=S,this.lastVisited=-1}i.prototype.flip=function(){var y=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=y;var b=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=b};function n(y,b,S){this.vertices=y,this.cell=b,this.index=S}function s(y,b){return a(y.vertices,b.vertices)}function c(y){return function(){var b=this.tuple;return y.apply(this,b)}}function f(y){var b=o[y+1];return b||(b=o),c(b)}var v=[];function h(y,b,S){this.dimension=y,this.vertices=b,this.simplices=S,this.interior=S.filter(function(w){return!w.boundary}),this.tuple=new Array(y+1);for(var M=0;M<=y;++M)this.tuple[M]=this.vertices[M];var _=v[y];_||(_=v[y]=f(y)),this.orient=_}var T=h.prototype;T.handleBoundaryDegeneracy=function(y,b){var S=this.dimension,M=this.vertices.length-1,_=this.tuple,w=this.vertices,p=[y];for(y.lastVisited=-M;p.length>0;){y=p.pop();for(var u=y.adjacent,g=0;g<=S;++g){var m=u[g];if(!(!m.boundary||m.lastVisited<=-M)){for(var R=m.vertices,P=0;P<=S;++P){var z=R[P];z<0?_[P]=b:_[P]=w[z]}var F=this.orient();if(F>0)return m;m.lastVisited=-M,F===0&&p.push(m)}}}return null},T.walk=function(y,b){var S=this.vertices.length-1,M=this.dimension,_=this.vertices,w=this.tuple,p=b?this.interior.length*Math.random()|0:this.interior.length-1,u=this.interior[p];e:for(;!u.boundary;){for(var g=u.vertices,m=u.adjacent,R=0;R<=M;++R)w[R]=_[g[R]];u.lastVisited=S;for(var R=0;R<=M;++R){var P=m[R];if(!(P.lastVisited>=S)){var z=w[R];w[R]=y;var F=this.orient();if(w[R]=z,F<0){u=P;continue e}else P.boundary?P.lastVisited=-S:P.lastVisited=S}}return}return u},T.addPeaks=function(y,b){var S=this.vertices.length-1,M=this.dimension,_=this.vertices,w=this.tuple,p=this.interior,u=this.simplices,g=[b];b.lastVisited=S,b.vertices[b.vertices.indexOf(-1)]=S,b.boundary=!1,p.push(b);for(var m=[];g.length>0;){var b=g.pop(),R=b.vertices,P=b.adjacent,z=R.indexOf(S);if(!(z<0)){for(var F=0;F<=M;++F)if(F!==z){var B=P[F];if(!(!B.boundary||B.lastVisited>=S)){var O=B.vertices;if(B.lastVisited!==-S){for(var L=0,N=0;N<=M;++N)O[N]<0?(L=N,w[N]=y):w[N]=_[O[N]];var U=this.orient();if(U>0){O[L]=S,B.boundary=!1,p.push(B),g.push(B),B.lastVisited=S;continue}else B.lastVisited=-S}var Z=B.adjacent,Q=R.slice(),ue=P.slice(),oe=new i(Q,ue,!0);u.push(oe);var le=Z.indexOf(b);if(!(le<0)){Z[le]=oe,ue[z]=B,Q[F]=-1,ue[F]=b,P[F]=oe,oe.flip();for(var N=0;N<=M;++N){var j=Q[N];if(!(j<0||j===S)){for(var J=new Array(M-1),$=0,X=0;X<=M;++X){var re=Q[X];re<0||X===N||(J[$++]=re)}m.push(new n(J,oe,N))}}}}}}}m.sort(s);for(var F=0;F+1=0?p[g++]=u[R]:m=R&1;if(m===(y&1)){var P=p[0];p[0]=p[1],p[1]=P}b.push(p)}}return b};function l(y,b){var S=y.length;if(S===0)throw new Error("Must have at least d+1 points");var M=y[0].length;if(S<=M)throw new Error("Must input at least d+1 points");var _=y.slice(0,M+1),w=o.apply(void 0,_);if(w===0)throw new Error("Input not in general position");for(var p=new Array(M+1),u=0;u<=M;++u)p[u]=u;w<0&&(p[0]=1,p[1]=0);for(var g=new i(p,new Array(M+1),!1),m=g.adjacent,R=new Array(M+2),u=0;u<=M;++u){for(var P=p.slice(),z=0;z<=M;++z)z===u&&(P[z]=-1);var F=P[0];P[0]=P[1],P[1]=F;var B=new i(P,new Array(M+1),!0);m[u]=B,R[u]=B}R[M+1]=g;for(var u=0;u<=M;++u)for(var P=m[u].vertices,O=m[u].adjacent,z=0;z<=M;++z){var L=P[z];if(L<0){O[z]=g;continue}for(var N=0;N<=M;++N)m[N].vertices.indexOf(L)<0&&(O[z]=m[N])}for(var U=new h(M,_,R),Z=!!b,u=M+1;u3*(R+1)?h(this,m):this.left.insert(m):this.left=w([m]);else if(m[0]>this.mid)this.right?4*(this.right.count+1)>3*(R+1)?h(this,m):this.right.insert(m):this.right=w([m]);else{var P=o.ge(this.leftPoints,m,M),z=o.ge(this.rightPoints,m,_);this.leftPoints.splice(P,0,m),this.rightPoints.splice(z,0,m)}},c.remove=function(m){var R=this.count-this.leftPoints;if(m[1]3*(R-1))return T(this,m);var z=this.left.remove(m);return z===n?(this.left=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else if(m[0]>this.mid){if(!this.right)return a;var F=this.left?this.left.count:0;if(4*F>3*(R-1))return T(this,m);var z=this.right.remove(m);return z===n?(this.right=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else{if(this.count===1)return this.leftPoints[0]===m?n:a;if(this.leftPoints.length===1&&this.leftPoints[0]===m){if(this.left&&this.right){for(var B=this,O=this.left;O.right;)B=O,O=O.right;if(B===this)O.right=this.right;else{var L=this.left,z=this.right;B.count-=O.count,B.right=O.left,O.left=L,O.right=z}f(this,O),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?f(this,this.left):f(this,this.right);return i}for(var L=o.ge(this.leftPoints,m,M);L=0&&m[z][1]>=R;--z){var F=P(m[z]);if(F)return F}}function b(m,R){for(var P=0;Pthis.mid){if(this.right){var P=this.right.queryPoint(m,R);if(P)return P}return y(this.rightPoints,m,R)}else return b(this.leftPoints,R)},c.queryInterval=function(m,R,P){if(mthis.mid&&this.right){var z=this.right.queryInterval(m,R,P);if(z)return z}return Rthis.mid?y(this.rightPoints,m,P):b(this.leftPoints,P)};function S(m,R){return m-R}function M(m,R){var P=m[0]-R[0];return P||m[1]-R[1]}function _(m,R){var P=m[1]-R[1];return P||m[0]-R[0]}function w(m){if(m.length===0)return null;for(var R=[],P=0;P>1],F=[],B=[],O=[],P=0;P13)&&o!==32&&o!==133&&o!==160&&o!==5760&&o!==6158&&(o<8192||o>8205)&&o!==8232&&o!==8233&&o!==8239&&o!==8287&&o!==8288&&o!==12288&&o!==65279)return!1;return!0}},395:function(e){function t(r,o,a){return r*(1-a)+o*a}e.exports=t},2652:function(e,t,r){var o=r(4335),a=r(6864),i=r(1903),n=r(9921),s=r(7608),c=r(5665),f={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},v=a(),h=a(),T=[0,0,0,0],l=[[0,0,0],[0,0,0],[0,0,0]],y=[0,0,0];e.exports=function(w,p,u,g,m,R){if(p||(p=[0,0,0]),u||(u=[0,0,0]),g||(g=[0,0,0]),m||(m=[0,0,0,1]),R||(R=[0,0,0,1]),!o(v,w)||(i(h,v),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(n(h)<1e-8)))return!1;var P=v[3],z=v[7],F=v[11],B=v[12],O=v[13],L=v[14],N=v[15];if(P!==0||z!==0||F!==0){T[0]=P,T[1]=z,T[2]=F,T[3]=N;var U=s(h,h);if(!U)return!1;c(h,h),b(m,T,h)}else m[0]=m[1]=m[2]=0,m[3]=1;if(p[0]=B,p[1]=O,p[2]=L,S(l,v),u[0]=f.length(l[0]),f.normalize(l[0],l[0]),g[0]=f.dot(l[0],l[1]),M(l[1],l[1],l[0],1,-g[0]),u[1]=f.length(l[1]),f.normalize(l[1],l[1]),g[0]/=u[1],g[1]=f.dot(l[0],l[2]),M(l[2],l[2],l[0],1,-g[1]),g[2]=f.dot(l[1],l[2]),M(l[2],l[2],l[1],1,-g[2]),u[2]=f.length(l[2]),f.normalize(l[2],l[2]),g[1]/=u[2],g[2]/=u[2],f.cross(y,l[1],l[2]),f.dot(l[0],y)<0)for(var Z=0;Z<3;Z++)u[Z]*=-1,l[Z][0]*=-1,l[Z][1]*=-1,l[Z][2]*=-1;return R[0]=.5*Math.sqrt(Math.max(1+l[0][0]-l[1][1]-l[2][2],0)),R[1]=.5*Math.sqrt(Math.max(1-l[0][0]+l[1][1]-l[2][2],0)),R[2]=.5*Math.sqrt(Math.max(1-l[0][0]-l[1][1]+l[2][2],0)),R[3]=.5*Math.sqrt(Math.max(1+l[0][0]+l[1][1]+l[2][2],0)),l[2][1]>l[1][2]&&(R[0]=-R[0]),l[0][2]>l[2][0]&&(R[1]=-R[1]),l[1][0]>l[0][1]&&(R[2]=-R[2]),!0};function b(_,w,p){var u=w[0],g=w[1],m=w[2],R=w[3];return _[0]=p[0]*u+p[4]*g+p[8]*m+p[12]*R,_[1]=p[1]*u+p[5]*g+p[9]*m+p[13]*R,_[2]=p[2]*u+p[6]*g+p[10]*m+p[14]*R,_[3]=p[3]*u+p[7]*g+p[11]*m+p[15]*R,_}function S(_,w){_[0][0]=w[0],_[0][1]=w[1],_[0][2]=w[2],_[1][0]=w[4],_[1][1]=w[5],_[1][2]=w[6],_[2][0]=w[8],_[2][1]=w[9],_[2][2]=w[10]}function M(_,w,p,u,g){_[0]=w[0]*u+p[0]*g,_[1]=w[1]*u+p[1]*g,_[2]=w[2]*u+p[2]*g}},4335:function(e){e.exports=function(r,o){var a=o[15];if(a===0)return!1;for(var i=1/a,n=0;n<16;n++)r[n]=o[n]*i;return!0}},7442:function(e,t,r){var o=r(6658),a=r(7182),i=r(2652),n=r(9921),s=r(8648),c=T(),f=T(),v=T();e.exports=h;function h(b,S,M,_){if(n(S)===0||n(M)===0)return!1;var w=i(S,c.translate,c.scale,c.skew,c.perspective,c.quaternion),p=i(M,f.translate,f.scale,f.skew,f.perspective,f.quaternion);return!w||!p?!1:(o(v.translate,c.translate,f.translate,_),o(v.skew,c.skew,f.skew,_),o(v.scale,c.scale,f.scale,_),o(v.perspective,c.perspective,f.perspective,_),s(v.quaternion,c.quaternion,f.quaternion,_),a(b,v.translate,v.scale,v.skew,v.perspective,v.quaternion),!0)}function T(){return{translate:l(),scale:l(1),skew:l(),perspective:y(),quaternion:y()}}function l(b){return[b||0,b||0,b||0]}function y(){return[0,0,0,1]}},7182:function(e,t,r){var o={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)};o.create();var a=o.create();e.exports=function(n,s,c,f,v,h){return o.identity(n),o.fromRotationTranslation(n,h,s),n[3]=v[0],n[7]=v[1],n[11]=v[2],n[15]=v[3],o.identity(a),f[2]!==0&&(a[9]=f[2],o.multiply(n,n,a)),f[1]!==0&&(a[9]=0,a[8]=f[1],o.multiply(n,n,a)),f[0]!==0&&(a[8]=0,a[4]=f[0],o.multiply(n,n,a)),o.scale(n,n,c),n}},1811:function(e,t,r){var o=r(2478),a=r(7442),i=r(7608),n=r(5567),s=r(2408),c=r(7089),f=r(6582),v=r(7656);r(2504);var h=r(3536),T=[0,0,0];e.exports=S;function l(M){this._components=M.slice(),this._time=[0],this.prevMatrix=M.slice(),this.nextMatrix=M.slice(),this.computedMatrix=M.slice(),this.computedInverse=M.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]}var y=l.prototype;y.recalcMatrix=function(M){var _=this._time,w=o.le(_,M),p=this.computedMatrix;if(!(w<0)){var u=this._components;if(w===_.length-1)for(var g=16*w,m=0;m<16;++m)p[m]=u[g++];else{for(var R=_[w+1]-_[w],g=16*w,P=this.prevMatrix,z=!0,m=0;m<16;++m)P[m]=u[g++];for(var F=this.nextMatrix,m=0;m<16;++m)F[m]=u[g++],z=z&&P[m]===F[m];if(R<1e-6||z)for(var m=0;m<16;++m)p[m]=P[m];else a(p,P,F,(M-_[w])/R)}var B=this.computedUp;B[0]=p[1],B[1]=p[5],B[2]=p[9],h(B,B);var O=this.computedInverse;i(O,p);var L=this.computedEye,N=O[15];L[0]=O[12]/N,L[1]=O[13]/N,L[2]=O[14]/N;for(var U=this.computedCenter,Z=Math.exp(this.computedRadius[0]),m=0;m<3;++m)U[m]=L[m]-p[2+4*m]*Z}},y.idle=function(M){if(!(M1&&o(i[f[l-2]],i[f[l-1]],T)<=0;)l-=1,f.pop();for(f.push(h),l=v.length;l>1&&o(i[v[l-2]],i[v[l-1]],T)>=0;)l-=1,v.pop();v.push(h)}for(var y=new Array(v.length+f.length-2),b=0,s=0,S=f.length;s0;--M)y[b++]=v[M];return y}},351:function(e,t,r){e.exports=a;var o=r(4687);function a(i,n){n||(n=i,i=window);var s=0,c=0,f=0,v={shift:!1,alt:!1,control:!1,meta:!1},h=!1;function T(m){var R=!1;return"altKey"in m&&(R=R||m.altKey!==v.alt,v.alt=!!m.altKey),"shiftKey"in m&&(R=R||m.shiftKey!==v.shift,v.shift=!!m.shiftKey),"ctrlKey"in m&&(R=R||m.ctrlKey!==v.control,v.control=!!m.ctrlKey),"metaKey"in m&&(R=R||m.metaKey!==v.meta,v.meta=!!m.metaKey),R}function l(m,R){var P=o.x(R),z=o.y(R);"buttons"in R&&(m=R.buttons|0),(m!==s||P!==c||z!==f||T(R))&&(s=m|0,c=P||0,f=z||0,n&&n(s,c,f,v))}function y(m){l(0,m)}function b(){(s||c||f||v.shift||v.alt||v.meta||v.control)&&(c=f=0,s=0,v.shift=v.alt=v.control=v.meta=!1,n&&n(0,0,0,v))}function S(m){T(m)&&n&&n(s,c,f,v)}function M(m){o.buttons(m)===0?l(0,m):l(s,m)}function _(m){l(s|o.buttons(m),m)}function w(m){l(s&~o.buttons(m),m)}function p(){h||(h=!0,i.addEventListener("mousemove",M),i.addEventListener("mousedown",_),i.addEventListener("mouseup",w),i.addEventListener("mouseleave",y),i.addEventListener("mouseenter",y),i.addEventListener("mouseout",y),i.addEventListener("mouseover",y),i.addEventListener("blur",b),i.addEventListener("keyup",S),i.addEventListener("keydown",S),i.addEventListener("keypress",S),i!==window&&(window.addEventListener("blur",b),window.addEventListener("keyup",S),window.addEventListener("keydown",S),window.addEventListener("keypress",S)))}function u(){h&&(h=!1,i.removeEventListener("mousemove",M),i.removeEventListener("mousedown",_),i.removeEventListener("mouseup",w),i.removeEventListener("mouseleave",y),i.removeEventListener("mouseenter",y),i.removeEventListener("mouseout",y),i.removeEventListener("mouseover",y),i.removeEventListener("blur",b),i.removeEventListener("keyup",S),i.removeEventListener("keydown",S),i.removeEventListener("keypress",S),i!==window&&(window.removeEventListener("blur",b),window.removeEventListener("keyup",S),window.removeEventListener("keydown",S),window.removeEventListener("keypress",S)))}p();var g={element:i};return Object.defineProperties(g,{enabled:{get:function(){return h},set:function(m){m?p():u()},enumerable:!0},buttons:{get:function(){return s},enumerable:!0},x:{get:function(){return c},enumerable:!0},y:{get:function(){return f},enumerable:!0},mods:{get:function(){return v},enumerable:!0}}),g}},24:function(e){var t={left:0,top:0};e.exports=r;function r(a,i,n){i=i||a.currentTarget||a.srcElement,Array.isArray(n)||(n=[0,0]);var s=a.clientX||0,c=a.clientY||0,f=o(i);return n[0]=s-f.left,n[1]=c-f.top,n}function o(a){return a===window||a===document||a===document.body?t:a.getBoundingClientRect()}},4687:function(e,t){function r(n){if(typeof n=="object"){if("buttons"in n)return n.buttons;if("which"in n){var s=n.which;if(s===2)return 4;if(s===3)return 2;if(s>0)return 1<=0)return 1<0){if(ue=1,j[$++]=v(p[R],b,S,M),R+=U,_>0)for(Q=1,P=p[R],X=j[$]=v(P,b,S,M),q=j[$+re],fe=j[$+ae],Fe=j[$+we],(X!==q||X!==fe||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,q,fe,Fe,b,S,M),Ce=J[$]=oe++),$+=1,R+=U,Q=2;Q<_;++Q)P=p[R],X=j[$]=v(P,b,S,M),q=j[$+re],fe=j[$+ae],Fe=j[$+we],(X!==q||X!==fe||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,q,fe,Fe,b,S,M),Ce=J[$]=oe++,Fe!==q&&f(J[$+re],Ce,N,F,Fe,q,b,S,M)),$+=1,R+=U;for(R+=Z,$=0,qe=re,re=ee,ee=qe,qe=ae,ae=ie,ie=qe,qe=we,we=Ae,Ae=qe,ue=2;ue0)for(Q=1,P=p[R],X=j[$]=v(P,b,S,M),q=j[$+re],fe=j[$+ae],Fe=j[$+we],(X!==q||X!==fe||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,q,fe,Fe,b,S,M),Ce=J[$]=oe++,Fe!==fe&&f(J[$+ae],Ce,O,N,fe,Fe,b,S,M)),$+=1,R+=U,Q=2;Q<_;++Q)P=p[R],X=j[$]=v(P,b,S,M),q=j[$+re],fe=j[$+ae],Fe=j[$+we],(X!==q||X!==fe||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,q,fe,Fe,b,S,M),Ce=J[$]=oe++,Fe!==fe&&f(J[$+ae],Ce,O,N,fe,Fe,b,S,M),Fe!==q&&f(J[$+re],Ce,N,F,Fe,q,b,S,M)),$+=1,R+=U;ue&1&&($=0),qe=re,re=ee,ee=qe,qe=ae,ae=ie,ie=qe,qe=we,we=Ae,Ae=qe,R+=Z}}T(J),T(j)}},"false,1,0":function(c,f,v,h,T){return function(y,b,S,M){var _=y.shape[0]|0,w=y.shape[1]|0,p=y.data,u=y.offset|0,g=y.stride[0]|0,m=y.stride[1]|0,R=u,P,z=-g|0,F=0,B=-m|0,O=0,L=-g-m|0,N=0,U=m|0,Z=g-m*w|0,Q=0,ue=0,oe=0,le=2*w|0,j=h(le),J=h(le),$=0,X=0,re=-1,ee=-1,q=0,ae=-w|0,ie=w|0,fe=0,we=-w-1|0,Ae=w-1|0,Fe=0,Ce=0,qe=0;for(ue=0;ue0){if(Q=1,j[$++]=v(p[R],b,S,M),R+=U,w>0)for(ue=1,P=p[R],X=j[$]=v(P,b,S,M),fe=j[$+ae],q=j[$+re],Fe=j[$+we],(X!==fe||X!==q||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,fe,q,Fe,b,S,M),Ce=J[$]=oe++),$+=1,R+=U,ue=2;ue0)for(ue=1,P=p[R],X=j[$]=v(P,b,S,M),fe=j[$+ae],q=j[$+re],Fe=j[$+we],(X!==fe||X!==q||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,fe,q,Fe,b,S,M),Ce=J[$]=oe++,Fe!==fe&&f(J[$+ae],Ce,N,F,Fe,fe,b,S,M)),$+=1,R+=U,ue=2;ue 0"),typeof s.vertex!="function"&&c("Must specify vertex creation function"),typeof s.cell!="function"&&c("Must specify cell creation function"),typeof s.phase!="function"&&c("Must specify phase function");for(var T=s.getters||[],l=new Array(v),y=0;y=0?l[y]=!0:l[y]=!1;return i(s.vertex,s.cell,s.phase,h,f,l)}},6199:function(e,t,r){var o=r(1338),a={zero:function(S,M,_,w){var p=S[0],u=_[0];w|=0;var g=0,m=u;for(g=0;g2&&g[1]>2&&w(u.pick(-1,-1).lo(1,1).hi(g[0]-2,g[1]-2),p.pick(-1,-1,0).lo(1,1).hi(g[0]-2,g[1]-2),p.pick(-1,-1,1).lo(1,1).hi(g[0]-2,g[1]-2)),g[1]>2&&(_(u.pick(0,-1).lo(1).hi(g[1]-2),p.pick(0,-1,1).lo(1).hi(g[1]-2)),M(p.pick(0,-1,0).lo(1).hi(g[1]-2))),g[1]>2&&(_(u.pick(g[0]-1,-1).lo(1).hi(g[1]-2),p.pick(g[0]-1,-1,1).lo(1).hi(g[1]-2)),M(p.pick(g[0]-1,-1,0).lo(1).hi(g[1]-2))),g[0]>2&&(_(u.pick(-1,0).lo(1).hi(g[0]-2),p.pick(-1,0,0).lo(1).hi(g[0]-2)),M(p.pick(-1,0,1).lo(1).hi(g[0]-2))),g[0]>2&&(_(u.pick(-1,g[1]-1).lo(1).hi(g[0]-2),p.pick(-1,g[1]-1,0).lo(1).hi(g[0]-2)),M(p.pick(-1,g[1]-1,1).lo(1).hi(g[0]-2))),p.set(0,0,0,0),p.set(0,0,1,0),p.set(g[0]-1,0,0,0),p.set(g[0]-1,0,1,0),p.set(0,g[1]-1,0,0),p.set(0,g[1]-1,1,0),p.set(g[0]-1,g[1]-1,0,0),p.set(g[0]-1,g[1]-1,1,0),p}}function b(S){var M=S.join(),g=v[M];if(g)return g;for(var _=S.length,w=[h,T],p=1;p<=_;++p)w.push(l(p));var u=y,g=u.apply(void 0,w);return v[M]=g,g}e.exports=function(M,_,w){if(Array.isArray(w)||(typeof w=="string"?w=o(_.dimension,w):w=o(_.dimension,"clamp")),_.size===0)return M;if(_.dimension===0)return M.set(0),M;var p=b(w);return p(M,_)}},4317:function(e){function t(n,s){var c=Math.floor(s),f=s-c,v=0<=c&&c0;){O<64?(_=O,O=0):(_=64,O-=64);for(var L=v[1]|0;L>0;){L<64?(w=L,L=0):(w=64,L-=64),l=F+O*u+L*g,S=B+O*R+L*P;var N=0,U=0,Z=0,Q=m,ue=u-p*m,oe=g-_*u,le=z,j=R-p*z,J=P-_*R;for(Z=0;Z0;){P<64?(_=P,P=0):(_=64,P-=64);for(var z=v[0]|0;z>0;){z<64?(M=z,z=0):(M=64,z-=64),l=m+P*p+z*w,S=R+P*g+z*u;var F=0,B=0,O=p,L=w-_*p,N=g,U=u-_*g;for(B=0;B0;){B<64?(w=B,B=0):(w=64,B-=64);for(var O=v[0]|0;O>0;){O<64?(M=O,O=0):(M=64,O-=64);for(var L=v[1]|0;L>0;){L<64?(_=L,L=0):(_=64,L-=64),l=z+B*g+O*p+L*u,S=F+B*P+O*m+L*R;var N=0,U=0,Z=0,Q=g,ue=p-w*g,oe=u-M*p,le=P,j=m-w*P,J=R-M*m;for(Z=0;Z<_;++Z){for(U=0;Uy;){N=0,U=F-_;t:for(O=0;OQ)break t;U+=m,N+=R}for(N=F,U=F-_,O=0;O>1,L=O-z,N=O+z,U=F,Z=L,Q=O,ue=N,oe=B,le=b+1,j=S-1,J=!0,$,X,re,ee,q,ae,ie,fe,we,Ae=0,Fe=0,Ce=0,qe,et,Qe,Ke,Xe,Me,xe,ce,Re,$e,rt,Je,At,St,Rt,Ut,ir=g,ar=T(ir),Mr=T(ir);et=w*U,Qe=w*Z,Ut=_;e:for(qe=0;qe0){X=U,U=Z,Z=X;break e}if(Ce<0)break e;Ut+=R}et=w*ue,Qe=w*oe,Ut=_;e:for(qe=0;qe0){X=ue,ue=oe,oe=X;break e}if(Ce<0)break e;Ut+=R}et=w*U,Qe=w*Q,Ut=_;e:for(qe=0;qe0){X=U,U=Q,Q=X;break e}if(Ce<0)break e;Ut+=R}et=w*Z,Qe=w*Q,Ut=_;e:for(qe=0;qe0){X=Z,Z=Q,Q=X;break e}if(Ce<0)break e;Ut+=R}et=w*U,Qe=w*ue,Ut=_;e:for(qe=0;qe0){X=U,U=ue,ue=X;break e}if(Ce<0)break e;Ut+=R}et=w*Q,Qe=w*ue,Ut=_;e:for(qe=0;qe0){X=Q,Q=ue,ue=X;break e}if(Ce<0)break e;Ut+=R}et=w*Z,Qe=w*oe,Ut=_;e:for(qe=0;qe0){X=Z,Z=oe,oe=X;break e}if(Ce<0)break e;Ut+=R}et=w*Z,Qe=w*Q,Ut=_;e:for(qe=0;qe0){X=Z,Z=Q,Q=X;break e}if(Ce<0)break e;Ut+=R}et=w*ue,Qe=w*oe,Ut=_;e:for(qe=0;qe0){X=ue,ue=oe,oe=X;break e}if(Ce<0)break e;Ut+=R}for(et=w*U,Qe=w*Z,Ke=w*Q,Xe=w*ue,Me=w*oe,xe=w*F,ce=w*O,Re=w*B,Rt=0,Ut=_,qe=0;qe0)j--;else if(Ce<0){for(et=w*ae,Qe=w*le,Ke=w*j,Ut=_,qe=0;qe0)for(;;){ie=_+j*w,Rt=0;e:for(qe=0;qe0){if(--jB){e:for(;;){for(ie=_+le*w,Rt=0,Ut=_,qe=0;qe1&&y?S(l,y[0],y[1]):S(l)}var f={"uint32,1,0":function(h,T){return function(l){var y=l.data,b=l.offset|0,S=l.shape,M=l.stride,_=M[0]|0,w=S[0]|0,p=M[1]|0,u=S[1]|0,g=p,m=p,R=1;w<=32?h(0,w-1,y,b,_,p,w,u,g,m,R):T(0,w-1,y,b,_,p,w,u,g,m,R)}}};function v(h,T){var l=[T,h].join(","),y=f[l],b=n(h,T),S=c(h,T,b);return y(b,S)}e.exports=v},446:function(e,t,r){var o=r(7640),a={};function i(n){var s=n.order,c=n.dtype,f=[s,c],v=f.join(":"),h=a[v];return h||(a[v]=h=o(s,c)),h(n),n}e.exports=i},9618:function(e,t,r){var o=r(7163),a=typeof Float64Array<"u";function i(T,l){return T[0]-l[0]}function n(){var T=this.stride,l=new Array(T.length),y;for(y=0;y=0&&(p=_|0,w+=g*p,u-=p),new b(this.data,u,g,w)},S.step=function(_){var w=this.shape[0],p=this.stride[0],u=this.offset,g=0,m=Math.ceil;return typeof _=="number"&&(g=_|0,g<0?(u+=p*(w-1),w=m(-w/g)):w=m(w/g),p*=g),new b(this.data,w,p,u)},S.transpose=function(_){_=_===void 0?0:_|0;var w=this.shape,p=this.stride;return new b(this.data,w[_],p[_],this.offset)},S.pick=function(_){var w=[],p=[],u=this.offset;typeof _=="number"&&_>=0?u=u+this.stride[0]*_|0:(w.push(this.shape[0]),p.push(this.stride[0]));var g=l[w.length+1];return g(this.data,w,p,u)},function(_,w,p,u){return new b(_,w[0],p[0],u)}},2:function(T,l,y){function b(M,_,w,p,u,g){this.data=M,this.shape=[_,w],this.stride=[p,u],this.offset=g|0}var S=b.prototype;return S.dtype=T,S.dimension=2,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(S,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),S.set=function(_,w,p){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w,p):this.data[this.offset+this.stride[0]*_+this.stride[1]*w]=p},S.get=function(_,w){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w):this.data[this.offset+this.stride[0]*_+this.stride[1]*w]},S.index=function(_,w){return this.offset+this.stride[0]*_+this.stride[1]*w},S.hi=function(_,w){return new b(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,this.stride[0],this.stride[1],this.offset)},S.lo=function(_,w){var p=this.offset,u=0,g=this.shape[0],m=this.shape[1],R=this.stride[0],P=this.stride[1];return typeof _=="number"&&_>=0&&(u=_|0,p+=R*u,g-=u),typeof w=="number"&&w>=0&&(u=w|0,p+=P*u,m-=u),new b(this.data,g,m,R,P,p)},S.step=function(_,w){var p=this.shape[0],u=this.shape[1],g=this.stride[0],m=this.stride[1],R=this.offset,P=0,z=Math.ceil;return typeof _=="number"&&(P=_|0,P<0?(R+=g*(p-1),p=z(-p/P)):p=z(p/P),g*=P),typeof w=="number"&&(P=w|0,P<0?(R+=m*(u-1),u=z(-u/P)):u=z(u/P),m*=P),new b(this.data,p,u,g,m,R)},S.transpose=function(_,w){_=_===void 0?0:_|0,w=w===void 0?1:w|0;var p=this.shape,u=this.stride;return new b(this.data,p[_],p[w],u[_],u[w],this.offset)},S.pick=function(_,w){var p=[],u=[],g=this.offset;typeof _=="number"&&_>=0?g=g+this.stride[0]*_|0:(p.push(this.shape[0]),u.push(this.stride[0])),typeof w=="number"&&w>=0?g=g+this.stride[1]*w|0:(p.push(this.shape[1]),u.push(this.stride[1]));var m=l[p.length+1];return m(this.data,p,u,g)},function(_,w,p,u){return new b(_,w[0],w[1],p[0],p[1],u)}},3:function(T,l,y){function b(M,_,w,p,u,g,m,R){this.data=M,this.shape=[_,w,p],this.stride=[u,g,m],this.offset=R|0}var S=b.prototype;return S.dtype=T,S.dimension=3,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(S,"order",{get:function(){var _=Math.abs(this.stride[0]),w=Math.abs(this.stride[1]),p=Math.abs(this.stride[2]);return _>w?w>p?[2,1,0]:_>p?[1,2,0]:[1,0,2]:_>p?[2,0,1]:p>w?[0,1,2]:[0,2,1]}}),S.set=function(_,w,p,u){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p,u):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p]=u},S.get=function(_,w,p){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p]},S.index=function(_,w,p){return this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p},S.hi=function(_,w,p){return new b(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,typeof p!="number"||p<0?this.shape[2]:p|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},S.lo=function(_,w,p){var u=this.offset,g=0,m=this.shape[0],R=this.shape[1],P=this.shape[2],z=this.stride[0],F=this.stride[1],B=this.stride[2];return typeof _=="number"&&_>=0&&(g=_|0,u+=z*g,m-=g),typeof w=="number"&&w>=0&&(g=w|0,u+=F*g,R-=g),typeof p=="number"&&p>=0&&(g=p|0,u+=B*g,P-=g),new b(this.data,m,R,P,z,F,B,u)},S.step=function(_,w,p){var u=this.shape[0],g=this.shape[1],m=this.shape[2],R=this.stride[0],P=this.stride[1],z=this.stride[2],F=this.offset,B=0,O=Math.ceil;return typeof _=="number"&&(B=_|0,B<0?(F+=R*(u-1),u=O(-u/B)):u=O(u/B),R*=B),typeof w=="number"&&(B=w|0,B<0?(F+=P*(g-1),g=O(-g/B)):g=O(g/B),P*=B),typeof p=="number"&&(B=p|0,B<0?(F+=z*(m-1),m=O(-m/B)):m=O(m/B),z*=B),new b(this.data,u,g,m,R,P,z,F)},S.transpose=function(_,w,p){_=_===void 0?0:_|0,w=w===void 0?1:w|0,p=p===void 0?2:p|0;var u=this.shape,g=this.stride;return new b(this.data,u[_],u[w],u[p],g[_],g[w],g[p],this.offset)},S.pick=function(_,w,p){var u=[],g=[],m=this.offset;typeof _=="number"&&_>=0?m=m+this.stride[0]*_|0:(u.push(this.shape[0]),g.push(this.stride[0])),typeof w=="number"&&w>=0?m=m+this.stride[1]*w|0:(u.push(this.shape[1]),g.push(this.stride[1])),typeof p=="number"&&p>=0?m=m+this.stride[2]*p|0:(u.push(this.shape[2]),g.push(this.stride[2]));var R=l[u.length+1];return R(this.data,u,g,m)},function(_,w,p,u){return new b(_,w[0],w[1],w[2],p[0],p[1],p[2],u)}},4:function(T,l,y){function b(M,_,w,p,u,g,m,R,P,z){this.data=M,this.shape=[_,w,p,u],this.stride=[g,m,R,P],this.offset=z|0}var S=b.prototype;return S.dtype=T,S.dimension=4,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(S,"order",{get:y}),S.set=function(_,w,p,u,g){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p+this.stride[3]*u,g):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p+this.stride[3]*u]=g},S.get=function(_,w,p,u){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p+this.stride[3]*u):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p+this.stride[3]*u]},S.index=function(_,w,p,u){return this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p+this.stride[3]*u},S.hi=function(_,w,p,u){return new b(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,typeof p!="number"||p<0?this.shape[2]:p|0,typeof u!="number"||u<0?this.shape[3]:u|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},S.lo=function(_,w,p,u){var g=this.offset,m=0,R=this.shape[0],P=this.shape[1],z=this.shape[2],F=this.shape[3],B=this.stride[0],O=this.stride[1],L=this.stride[2],N=this.stride[3];return typeof _=="number"&&_>=0&&(m=_|0,g+=B*m,R-=m),typeof w=="number"&&w>=0&&(m=w|0,g+=O*m,P-=m),typeof p=="number"&&p>=0&&(m=p|0,g+=L*m,z-=m),typeof u=="number"&&u>=0&&(m=u|0,g+=N*m,F-=m),new b(this.data,R,P,z,F,B,O,L,N,g)},S.step=function(_,w,p,u){var g=this.shape[0],m=this.shape[1],R=this.shape[2],P=this.shape[3],z=this.stride[0],F=this.stride[1],B=this.stride[2],O=this.stride[3],L=this.offset,N=0,U=Math.ceil;return typeof _=="number"&&(N=_|0,N<0?(L+=z*(g-1),g=U(-g/N)):g=U(g/N),z*=N),typeof w=="number"&&(N=w|0,N<0?(L+=F*(m-1),m=U(-m/N)):m=U(m/N),F*=N),typeof p=="number"&&(N=p|0,N<0?(L+=B*(R-1),R=U(-R/N)):R=U(R/N),B*=N),typeof u=="number"&&(N=u|0,N<0?(L+=O*(P-1),P=U(-P/N)):P=U(P/N),O*=N),new b(this.data,g,m,R,P,z,F,B,O,L)},S.transpose=function(_,w,p,u){_=_===void 0?0:_|0,w=w===void 0?1:w|0,p=p===void 0?2:p|0,u=u===void 0?3:u|0;var g=this.shape,m=this.stride;return new b(this.data,g[_],g[w],g[p],g[u],m[_],m[w],m[p],m[u],this.offset)},S.pick=function(_,w,p,u){var g=[],m=[],R=this.offset;typeof _=="number"&&_>=0?R=R+this.stride[0]*_|0:(g.push(this.shape[0]),m.push(this.stride[0])),typeof w=="number"&&w>=0?R=R+this.stride[1]*w|0:(g.push(this.shape[1]),m.push(this.stride[1])),typeof p=="number"&&p>=0?R=R+this.stride[2]*p|0:(g.push(this.shape[2]),m.push(this.stride[2])),typeof u=="number"&&u>=0?R=R+this.stride[3]*u|0:(g.push(this.shape[3]),m.push(this.stride[3]));var P=l[g.length+1];return P(this.data,g,m,R)},function(_,w,p,u){return new b(_,w[0],w[1],w[2],w[3],p[0],p[1],p[2],p[3],u)}},5:function(l,y,b){function S(_,w,p,u,g,m,R,P,z,F,B,O){this.data=_,this.shape=[w,p,u,g,m],this.stride=[R,P,z,F,B],this.offset=O|0}var M=S.prototype;return M.dtype=l,M.dimension=5,Object.defineProperty(M,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(M,"order",{get:b}),M.set=function(w,p,u,g,m,R){return l==="generic"?this.data.set(this.offset+this.stride[0]*w+this.stride[1]*p+this.stride[2]*u+this.stride[3]*g+this.stride[4]*m,R):this.data[this.offset+this.stride[0]*w+this.stride[1]*p+this.stride[2]*u+this.stride[3]*g+this.stride[4]*m]=R},M.get=function(w,p,u,g,m){return l==="generic"?this.data.get(this.offset+this.stride[0]*w+this.stride[1]*p+this.stride[2]*u+this.stride[3]*g+this.stride[4]*m):this.data[this.offset+this.stride[0]*w+this.stride[1]*p+this.stride[2]*u+this.stride[3]*g+this.stride[4]*m]},M.index=function(w,p,u,g,m){return this.offset+this.stride[0]*w+this.stride[1]*p+this.stride[2]*u+this.stride[3]*g+this.stride[4]*m},M.hi=function(w,p,u,g,m){return new S(this.data,typeof w!="number"||w<0?this.shape[0]:w|0,typeof p!="number"||p<0?this.shape[1]:p|0,typeof u!="number"||u<0?this.shape[2]:u|0,typeof g!="number"||g<0?this.shape[3]:g|0,typeof m!="number"||m<0?this.shape[4]:m|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},M.lo=function(w,p,u,g,m){var R=this.offset,P=0,z=this.shape[0],F=this.shape[1],B=this.shape[2],O=this.shape[3],L=this.shape[4],N=this.stride[0],U=this.stride[1],Z=this.stride[2],Q=this.stride[3],ue=this.stride[4];return typeof w=="number"&&w>=0&&(P=w|0,R+=N*P,z-=P),typeof p=="number"&&p>=0&&(P=p|0,R+=U*P,F-=P),typeof u=="number"&&u>=0&&(P=u|0,R+=Z*P,B-=P),typeof g=="number"&&g>=0&&(P=g|0,R+=Q*P,O-=P),typeof m=="number"&&m>=0&&(P=m|0,R+=ue*P,L-=P),new S(this.data,z,F,B,O,L,N,U,Z,Q,ue,R)},M.step=function(w,p,u,g,m){var R=this.shape[0],P=this.shape[1],z=this.shape[2],F=this.shape[3],B=this.shape[4],O=this.stride[0],L=this.stride[1],N=this.stride[2],U=this.stride[3],Z=this.stride[4],Q=this.offset,ue=0,oe=Math.ceil;return typeof w=="number"&&(ue=w|0,ue<0?(Q+=O*(R-1),R=oe(-R/ue)):R=oe(R/ue),O*=ue),typeof p=="number"&&(ue=p|0,ue<0?(Q+=L*(P-1),P=oe(-P/ue)):P=oe(P/ue),L*=ue),typeof u=="number"&&(ue=u|0,ue<0?(Q+=N*(z-1),z=oe(-z/ue)):z=oe(z/ue),N*=ue),typeof g=="number"&&(ue=g|0,ue<0?(Q+=U*(F-1),F=oe(-F/ue)):F=oe(F/ue),U*=ue),typeof m=="number"&&(ue=m|0,ue<0?(Q+=Z*(B-1),B=oe(-B/ue)):B=oe(B/ue),Z*=ue),new S(this.data,R,P,z,F,B,O,L,N,U,Z,Q)},M.transpose=function(w,p,u,g,m){w=w===void 0?0:w|0,p=p===void 0?1:p|0,u=u===void 0?2:u|0,g=g===void 0?3:g|0,m=m===void 0?4:m|0;var R=this.shape,P=this.stride;return new S(this.data,R[w],R[p],R[u],R[g],R[m],P[w],P[p],P[u],P[g],P[m],this.offset)},M.pick=function(w,p,u,g,m){var R=[],P=[],z=this.offset;typeof w=="number"&&w>=0?z=z+this.stride[0]*w|0:(R.push(this.shape[0]),P.push(this.stride[0])),typeof p=="number"&&p>=0?z=z+this.stride[1]*p|0:(R.push(this.shape[1]),P.push(this.stride[1])),typeof u=="number"&&u>=0?z=z+this.stride[2]*u|0:(R.push(this.shape[2]),P.push(this.stride[2])),typeof g=="number"&&g>=0?z=z+this.stride[3]*g|0:(R.push(this.shape[3]),P.push(this.stride[3])),typeof m=="number"&&m>=0?z=z+this.stride[4]*m|0:(R.push(this.shape[4]),P.push(this.stride[4]));var F=y[R.length+1];return F(this.data,R,P,z)},function(w,p,u,g){return new S(w,p[0],p[1],p[2],p[3],p[4],u[0],u[1],u[2],u[3],u[4],g)}}};function c(T,l){var y=l===-1?"T":String(l),b=s[y];return l===-1?b(T):l===0?b(T,v[T][0]):b(T,v[T],n)}function f(T){if(o(T))return"buffer";if(a)switch(Object.prototype.toString.call(T)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(T)?"array":"generic"}var v={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function h(T,l,y,b){if(T===void 0){var u=v.array[0];return u([])}else typeof T=="number"&&(T=[T]);l===void 0&&(l=[T.length]);var S=l.length;if(y===void 0){y=new Array(S);for(var M=S-1,_=1;M>=0;--M)y[M]=_,_*=l[M]}if(b===void 0){b=0;for(var M=0;M>>0;e.exports=n;function n(s,c){if(isNaN(s)||isNaN(c))return NaN;if(s===c)return s;if(s===0)return c<0?-a:a;var f=o.hi(s),v=o.lo(s);return c>s==s>0?v===i?(f+=1,v=0):v+=1:v===0?(v=i,f-=1):v-=1,o.pack(v,f)}},8406:function(e,t){var r=1e-6,o=1e-6;t.vertexNormals=function(a,i,n){for(var s=i.length,c=new Array(s),f=n===void 0?r:n,v=0;vf)for(var R=c[l],P=1/Math.sqrt(p*g),m=0;m<3;++m){var z=(m+1)%3,F=(m+2)%3;R[m]+=P*(u[z]*w[F]-u[F]*w[z])}}for(var v=0;vf)for(var P=1/Math.sqrt(B),m=0;m<3;++m)R[m]*=P;else for(var m=0;m<3;++m)R[m]=0}return c},t.faceNormals=function(a,i,n){for(var s=a.length,c=new Array(s),f=n===void 0?o:n,v=0;vf?M=1/Math.sqrt(M):M=0;for(var l=0;l<3;++l)S[l]*=M;c[v]=S}return c}},4081:function(e){e.exports=t;function t(r,o,a,i,n,s,c,f,v,h){var T=o+s+h;if(l>0){var l=Math.sqrt(T+1);r[0]=.5*(c-v)/l,r[1]=.5*(f-i)/l,r[2]=.5*(a-s)/l,r[3]=.5*l}else{var y=Math.max(o,s,h),l=Math.sqrt(2*y-T+1);o>=y?(r[0]=.5*l,r[1]=.5*(n+a)/l,r[2]=.5*(f+i)/l,r[3]=.5*(c-v)/l):s>=y?(r[0]=.5*(a+n)/l,r[1]=.5*l,r[2]=.5*(v+c)/l,r[3]=.5*(f-i)/l):(r[0]=.5*(i+f)/l,r[1]=.5*(c+v)/l,r[2]=.5*l,r[3]=.5*(a-n)/l)}return r}},9977:function(e,t,r){e.exports=l;var o=r(9215),a=r(6582),i=r(7399),n=r(7608),s=r(4081);function c(y,b,S){return Math.sqrt(Math.pow(y,2)+Math.pow(b,2)+Math.pow(S,2))}function f(y,b,S,M){return Math.sqrt(Math.pow(y,2)+Math.pow(b,2)+Math.pow(S,2)+Math.pow(M,2))}function v(y,b){var S=b[0],M=b[1],_=b[2],w=b[3],p=f(S,M,_,w);p>1e-6?(y[0]=S/p,y[1]=M/p,y[2]=_/p,y[3]=w/p):(y[0]=y[1]=y[2]=0,y[3]=1)}function h(y,b,S){this.radius=o([S]),this.center=o(b),this.rotation=o(y),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 T=h.prototype;T.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},T.recalcMatrix=function(y){this.radius.curve(y),this.center.curve(y),this.rotation.curve(y);var b=this.computedRotation;v(b,b);var S=this.computedMatrix;i(S,b);var M=this.computedCenter,_=this.computedEye,w=this.computedUp,p=Math.exp(this.computedRadius[0]);_[0]=M[0]+p*S[2],_[1]=M[1]+p*S[6],_[2]=M[2]+p*S[10],w[0]=S[1],w[1]=S[5],w[2]=S[9];for(var u=0;u<3;++u){for(var g=0,m=0;m<3;++m)g+=S[u+4*m]*_[m];S[12+u]=-g}},T.getMatrix=function(y,b){this.recalcMatrix(y);var S=this.computedMatrix;if(b){for(var M=0;M<16;++M)b[M]=S[M];return b}return S},T.idle=function(y){this.center.idle(y),this.radius.idle(y),this.rotation.idle(y)},T.flush=function(y){this.center.flush(y),this.radius.flush(y),this.rotation.flush(y)},T.pan=function(y,b,S,M){b=b||0,S=S||0,M=M||0,this.recalcMatrix(y);var _=this.computedMatrix,w=_[1],p=_[5],u=_[9],g=c(w,p,u);w/=g,p/=g,u/=g;var m=_[0],R=_[4],P=_[8],z=m*w+R*p+P*u;m-=w*z,R-=p*z,P-=u*z;var F=c(m,R,P);m/=F,R/=F,P/=F,_[2],_[6],_[10];var B=m*b+w*S,O=R*b+p*S,L=P*b+u*S;this.center.move(y,B,O,L);var N=Math.exp(this.computedRadius[0]);N=Math.max(1e-4,N+M),this.radius.set(y,Math.log(N))},T.rotate=function(y,b,S,M){this.recalcMatrix(y),b=b||0,S=S||0;var _=this.computedMatrix,w=_[0],p=_[4],u=_[8],g=_[1],m=_[5],R=_[9],P=_[2],z=_[6],F=_[10],B=b*w+S*g,O=b*p+S*m,L=b*u+S*R,N=-(z*L-F*O),U=-(F*B-P*L),Z=-(P*O-z*B),Q=Math.sqrt(Math.max(0,1-Math.pow(N,2)-Math.pow(U,2)-Math.pow(Z,2))),ue=f(N,U,Z,Q);ue>1e-6?(N/=ue,U/=ue,Z/=ue,Q/=ue):(N=U=Z=0,Q=1);var oe=this.computedRotation,le=oe[0],j=oe[1],J=oe[2],$=oe[3],X=le*Q+$*N+j*Z-J*U,re=j*Q+$*U+J*N-le*Z,ee=J*Q+$*Z+le*U-j*N,q=$*Q-le*N-j*U-J*Z;if(M){N=P,U=z,Z=F;var ae=Math.sin(M)/c(N,U,Z);N*=ae,U*=ae,Z*=ae,Q=Math.cos(b),X=X*Q+q*N+re*Z-ee*U,re=re*Q+q*U+ee*N-X*Z,ee=ee*Q+q*Z+X*U-re*N,q=q*Q-X*N-re*U-ee*Z}var ie=f(X,re,ee,q);ie>1e-6?(X/=ie,re/=ie,ee/=ie,q/=ie):(X=re=ee=0,q=1),this.rotation.set(y,X,re,ee,q)},T.lookAt=function(y,b,S,M){this.recalcMatrix(y),S=S||this.computedCenter,b=b||this.computedEye,M=M||this.computedUp;var _=this.computedMatrix;a(_,b,S,M);var w=this.computedRotation;s(w,_[0],_[1],_[2],_[4],_[5],_[6],_[8],_[9],_[10]),v(w,w),this.rotation.set(y,w[0],w[1],w[2],w[3]);for(var p=0,u=0;u<3;++u)p+=Math.pow(S[u]-b[u],2);this.radius.set(y,.5*Math.log(Math.max(p,1e-6))),this.center.set(y,S[0],S[1],S[2])},T.translate=function(y,b,S,M){this.center.move(y,b||0,S||0,M||0)},T.setMatrix=function(y,b){var S=this.computedRotation;s(S,b[0],b[1],b[2],b[4],b[5],b[6],b[8],b[9],b[10]),v(S,S),this.rotation.set(y,S[0],S[1],S[2],S[3]);var M=this.computedMatrix;n(M,b);var _=M[15];if(Math.abs(_)>1e-6){var w=M[12]/_,p=M[13]/_,u=M[14]/_;this.recalcMatrix(y);var g=Math.exp(this.computedRadius[0]);this.center.set(y,w-M[2]*g,p-M[6]*g,u-M[10]*g),this.radius.idle(y)}else this.center.idle(y),this.radius.idle(y)},T.setDistance=function(y,b){b>0&&this.radius.set(y,Math.log(b))},T.setDistanceLimits=function(y,b){y>0?y=Math.log(y):y=-1/0,b>0?b=Math.log(b):b=1/0,b=Math.max(b,y),this.radius.bounds[0][0]=y,this.radius.bounds[1][0]=b},T.getDistanceLimits=function(y){var b=this.radius.bounds;return y?(y[0]=Math.exp(b[0][0]),y[1]=Math.exp(b[1][0]),y):[Math.exp(b[0][0]),Math.exp(b[1][0])]},T.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]}},T.fromJSON=function(y){var b=this.lastT(),S=y.center;S&&this.center.set(b,S[0],S[1],S[2]);var M=y.rotation;M&&this.rotation.set(b,M[0],M[1],M[2],M[3]);var _=y.distance;_&&_>0&&this.radius.set(b,Math.log(_)),this.setDistanceLimits(y.zoomMin,y.zoomMax)};function l(y){y=y||{};var b=y.center||[0,0,0],S=y.rotation||[0,0,0,1],M=y.radius||1;b=[].slice.call(b,0,3),S=[].slice.call(S,0,4),v(S,S);var _=new h(S,b,Math.log(M));return _.setDistanceLimits(y.zoomMin,y.zoomMax),("eye"in y||"up"in y)&&_.lookAt(0,y.eye,y.center,y.up),_}},1371:function(e,t,r){var o=r(3233);e.exports=function(i,n,s){return s=typeof s<"u"?s+"":" ",o(s,n)+i}},3202:function(e){e.exports=function(r,o){o||(o=[0,""]),r=String(r);var a=parseFloat(r,10);return o[0]=a,o[1]=r.match(/[\d.\-\+]*\s*(.*)/)[1]||"",o}},3088:function(e,t,r){e.exports=a;var o=r(3140);function a(i,n){for(var s=n.length|0,c=i.length,f=[new Array(s),new Array(s)],v=0;v0){m=f[z][u][0],P=z;break}R=m[P^1];for(var F=0;F<2;++F)for(var B=f[F][u],O=0;O0&&(m=L,R=N,P=F)}return g||m&&l(m,P),R}function b(p,u){var g=f[u][p][0],m=[p];l(g,u);for(var R=g[u^1];;){for(;R!==p;)m.push(R),R=y(m[m.length-2],R,!1);if(f[0][p].length+f[1][p].length===0)break;var P=m[m.length-1],z=p,F=m[1],B=y(P,z,!0);if(o(n[P],n[z],n[F],n[B])<0)break;m.push(p),R=y(P,z)}return m}function S(p,u){return u[1]===u[u.length-1]}for(var v=0;v0;){f[0][v].length;var w=b(v,M);S(_,w)?_.push.apply(_,w):(_.length>0&&T.push(_),_=w)}_.length>0&&T.push(_)}return T}},5609:function(e,t,r){e.exports=a;var o=r(3134);function a(i,n){for(var s=o(i,n.length),c=new Array(n.length),f=new Array(n.length),v=[],h=0;h0;){var l=v.pop();c[l]=!1;for(var y=s[l],h=0;h0}_=_.filter(w);for(var p=_.length,u=new Array(p),g=new Array(p),M=0;M0;){var ae=re.pop(),ie=Q[ae];c(ie,function(Ce,qe){return Ce-qe});var fe=ie.length,we=ee[ae],Ae;if(we===0){var B=_[ae];Ae=[B]}for(var M=0;M=0)&&(ee[Fe]=we^1,re.push(Fe),we===0)){var B=_[Fe];X(B)||(B.reverse(),Ae.push(B))}}we===0&&q.push(Ae)}return q}},5085:function(e,t,r){e.exports=y;var o=r(3250)[3],a=r(4209),i=r(3352),n=r(2478);function s(){return!0}function c(b){return function(S,M){var _=b[S];return _?!!_.queryPoint(M,s):!1}}function f(b){for(var S={},M=0;M0&&S[_]===M[0])w=b[_-1];else return 1;for(var p=1;w;){var u=w.key,g=o(M,u[0],u[1]);if(u[0][0]0)p=-1,w=w.right;else return 0;else if(g>0)w=w.left;else if(g<0)p=1,w=w.right;else return 0}return p}}function h(b){return 1}function T(b){return function(M){return b(M[0],M[1])?0:1}}function l(b,S){return function(_){return b(_[0],_[1])?0:S(_)}}function y(b){for(var S=b.length,M=[],_=[],w=0;w=h?(u=1,m=h+2*y+S):(u=-y/h,m=y*u+S)):(u=0,b>=0?(g=0,m=S):-b>=l?(g=1,m=l+2*b+S):(g=-b/l,m=b*g+S));else if(g<0)g=0,y>=0?(u=0,m=S):-y>=h?(u=1,m=h+2*y+S):(u=-y/h,m=y*u+S);else{var R=1/p;u*=R,g*=R,m=u*(h*u+T*g+2*y)+g*(T*u+l*g+2*b)+S}else{var P,z,F,B;u<0?(P=T+y,z=l+b,z>P?(F=z-P,B=h-2*T+l,F>=B?(u=1,g=0,m=h+2*y+S):(u=F/B,g=1-u,m=u*(h*u+T*g+2*y)+g*(T*u+l*g+2*b)+S)):(u=0,z<=0?(g=1,m=l+2*b+S):b>=0?(g=0,m=S):(g=-b/l,m=b*g+S))):g<0?(P=T+b,z=h+y,z>P?(F=z-P,B=h-2*T+l,F>=B?(g=1,u=0,m=l+2*b+S):(g=F/B,u=1-g,m=u*(h*u+T*g+2*y)+g*(T*u+l*g+2*b)+S)):(g=0,z<=0?(u=1,m=h+2*y+S):y>=0?(u=0,m=S):(u=-y/h,m=y*u+S))):(F=l+b-T-y,F<=0?(u=0,g=1,m=l+2*b+S):(B=h-2*T+l,F>=B?(u=1,g=0,m=h+2*y+S):(u=F/B,g=1-u,m=u*(h*u+T*g+2*y)+g*(T*u+l*g+2*b)+S)))}for(var O=1-u-g,v=0;v0){var l=s[f-1];if(o(h,l)===0&&i(l)!==T){f-=1;continue}}s[f++]=h}}return s.length=f,s}},3233:function(e){var t="",r;e.exports=o;function o(a,i){if(typeof a!="string")throw new TypeError("expected a string");if(i===1)return a;if(i===2)return a+a;var n=a.length*i;if(r!==a||typeof r>"u")r=a,t="";else if(t.length>=n)return t.substr(0,n);for(;n>t.length&&i>1;)i&1&&(t+=a),i>>=1,a+=a;return t+=a,t=t.substr(0,n),t}},3025:function(e,t,r){e.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(e){e.exports=t;function t(r){for(var o=r.length,a=r[r.length-1],i=o,n=o-2;n>=0;--n){var s=a,c=r[n];a=s+c;var f=a-s,v=c-f;v&&(r[--i]=a,a=v)}for(var h=0,n=i;n0){if(z<=0)return F;B=P+z}else if(P<0){if(z>=0)return F;B=-(P+z)}else return F;var O=f*B;return F>=O||F<=-O?F:b(g,m,R)},function(g,m,R,P){var z=g[0]-P[0],F=m[0]-P[0],B=R[0]-P[0],O=g[1]-P[1],L=m[1]-P[1],N=R[1]-P[1],U=g[2]-P[2],Z=m[2]-P[2],Q=R[2]-P[2],ue=F*N,oe=B*L,le=B*O,j=z*N,J=z*L,$=F*O,X=U*(ue-oe)+Z*(le-j)+Q*(J-$),re=(Math.abs(ue)+Math.abs(oe))*Math.abs(U)+(Math.abs(le)+Math.abs(j))*Math.abs(Z)+(Math.abs(J)+Math.abs($))*Math.abs(Q),ee=v*re;return X>ee||-X>ee?X:S(g,m,R,P)}];function _(u){var g=M[u.length];return g||(g=M[u.length]=y(u.length)),g.apply(void 0,u)}function w(u,g,m,R,P,z,F){return function(O,L,N,U,Z){switch(arguments.length){case 0:case 1:return 0;case 2:return R(O,L);case 3:return P(O,L,N);case 4:return z(O,L,N,U);case 5:return F(O,L,N,U,Z)}for(var Q=new Array(arguments.length),ue=0;ue0&&h>0||v<0&&h<0)return!1;var T=o(c,n,s),l=o(f,n,s);return T>0&&l>0||T<0&&l<0?!1:v===0&&h===0&&T===0&&l===0?a(n,s,c,f):!0}},8545:function(e){e.exports=r;function t(o,a){var i=o+a,n=i-o,s=i-n,c=a-n,f=o-s,v=f+c;return v?[v,i]:[i]}function r(o,a){var i=o.length|0,n=a.length|0;if(i===1&&n===1)return t(o[0],-a[0]);var s=i+n,c=new Array(s),f=0,v=0,h=0,T=Math.abs,l=o[v],y=T(l),b=-a[h],S=T(b),M,_;y=n?(M=l,v+=1,v=n?(M=l,v+=1,v"u"&&(M=s(y));var _=y.length;if(_===0||M<1)return{cells:[],vertexIds:[],vertexWeights:[]};var w=c(b,+S),p=f(y,M),u=v(p,b,w,+S),g=h(p,b.length|0),m=n(M)(y,p.data,g,w),R=T(p),P=[].slice.call(u.data,0,u.shape[0]);return a.free(w),a.free(p.data),a.free(u.data),a.free(g),{cells:m,vertexIds:R,vertexWeights:P}}},1570:function(e){e.exports=r;var t=[function(){function a(i,n,s,c){for(var f=i.length,v=[],h=0;h>1,b=s[2*y+1];if(b===h)return y;h>1,b=s[2*y+1];if(b===h)return y;h>1,b=s[2*y+1];if(b===h)return y;h0)-(i<0)},t.abs=function(i){var n=i>>r-1;return(i^n)-n},t.min=function(i,n){return n^(i^n)&-(i65535)<<4,i>>>=n,s=(i>255)<<3,i>>>=s,n|=s,s=(i>15)<<2,i>>>=s,n|=s,s=(i>3)<<1,i>>>=s,n|=s,n|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var n=32;return i&=-i,i&&n--,i&65535&&(n-=16),i&16711935&&(n-=8),i&252645135&&(n-=4),i&858993459&&(n-=2),i&1431655765&&(n-=1),n}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var a=new Array(256);(function(i){for(var n=0;n<256;++n){var s=n,c=n,f=7;for(s>>>=1;s;s>>>=1)c<<=1,c|=s&1,--f;i[n]=c<>>8&255]<<16|a[i>>>16&255]<<8|a[i>>>24&255]},t.interleave2=function(i,n){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,n&=65535,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,i|n<<1},t.deinterleave2=function(i,n){return i=i>>>n&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,n,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,i|=n<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,n){return i=i>>>n&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var n=i|i-1;return n+1|(~n&-~n)-1>>>o(i)+1}},2014:function(e,t,r){"use restrict";var o=r(3105),a=r(4623);function i(u){for(var g=0,m=Math.max,R=0,P=u.length;R>1,F=c(u[z],g);F<=0?(F===0&&(P=z),m=z+1):F>0&&(R=z-1)}return P}t.findCell=T;function l(u,g){for(var m=new Array(u.length),R=0,P=m.length;R=u.length||c(u[Q],z)!==0););}return m}t.incidence=l;function y(u,g){if(!g)return l(h(S(u,0)),u);for(var m=new Array(g),R=0;R>>L&1&&O.push(P[L]);g.push(O)}return v(g)}t.explode=b;function S(u,g){if(g<0)return[];for(var m=[],R=(1<>1:(le>>1)-1}function R(le){for(var j=g(le);;){var J=j,$=2*le+1,X=2*(le+1),re=le;if($0;){var J=m(le);if(J>=0){var $=g(J);if(j<$){u(le,J),le=J;continue}}return le}}function z(){if(U>0){var le=O[0];return u(0,U-1),U-=1,R(0),le}return-1}function F(le,j){var J=O[le];return y[J]===j?le:(y[J]=-1/0,P(le),z(),y[J]=j,U+=1,P(U-1))}function B(le){if(!b[le]){b[le]=!0;var j=T[le],J=l[le];T[J]>=0&&(T[J]=j),l[j]>=0&&(l[j]=J),L[j]>=0&&F(L[j],p(j)),L[J]>=0&&F(L[J],p(J))}}for(var O=[],L=new Array(v),S=0;S>1;S>=0;--S)R(S);for(;;){var Z=z();if(Z<0||y[Z]>f)break;B(Z)}for(var Q=[],S=0;S=0&&J>=0&&j!==J){var $=L[j],X=L[J];$!==X&&oe.push([$,X])}}),a.unique(a.normalize(oe)),{positions:Q,edges:oe}}},1303:function(e,t,r){e.exports=i;var o=r(3250);function a(n,s){var c,f;if(s[0][0]s[1][0])c=s[1],f=s[0];else{var v=Math.min(n[0][1],n[1][1]),h=Math.max(n[0][1],n[1][1]),T=Math.min(s[0][1],s[1][1]),l=Math.max(s[0][1],s[1][1]);return hl?v-l:h-l}var y,b;n[0][1]s[1][0])c=s[1],f=s[0];else return a(s,n);var v,h;if(n[0][0]n[1][0])v=n[1],h=n[0];else return-a(n,s);var T=o(c,f,h),l=o(c,f,v);if(T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;if(T=o(h,v,f),l=o(h,v,c),T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;return f[0]-h[0]}},4209:function(e,t,r){e.exports=l;var o=r(2478),a=r(3840),i=r(3250),n=r(1303);function s(y,b,S){this.slabs=y,this.coordinates=b,this.horizontal=S}var c=s.prototype;function f(y,b){return y.y-b}function v(y,b){for(var S=null;y;){var M=y.key,_,w;M[0][0]0)if(b[0]!==M[1][0])S=y,y=y.right;else{var u=v(y.right,b);if(u)return u;y=y.left}else{if(b[0]!==M[1][0])return y;var u=v(y.right,b);if(u)return u;y=y.left}}return S}c.castUp=function(y){var b=o.le(this.coordinates,y[0]);if(b<0)return-1;this.slabs[b];var S=v(this.slabs[b],y),M=-1;if(S&&(M=S.value),this.coordinates[b]===y[0]){var _=null;if(S&&(_=S.key),b>0){var w=v(this.slabs[b-1],y);w&&(_?n(w.key,_)>0&&(_=w.key,M=w.value):(M=w.value,_=w.key))}var p=this.horizontal[b];if(p.length>0){var u=o.ge(p,y[1],f);if(u=p.length)return M;g=p[u]}}if(g.start)if(_){var m=i(_[0],_[1],[y[0],g.y]);_[0][0]>_[1][0]&&(m=-m),m>0&&(M=g.index)}else M=g.index;else g.y!==y[1]&&(M=g.index)}}}return M};function h(y,b,S,M){this.y=y,this.index=b,this.start=S,this.closed=M}function T(y,b,S,M){this.x=y,this.segment=b,this.create=S,this.index=M}function l(y){for(var b=y.length,S=2*b,M=new Array(S),_=0;_1&&(b=1);for(var S=1-b,M=v.length,_=new Array(M),w=0;w0||y>0&&_<0){var w=n(b,_,S,y);T.push(w),l.push(w.slice())}_<0?l.push(S.slice()):_>0?T.push(S.slice()):(T.push(S.slice()),l.push(S.slice())),y=_}return{positive:T,negative:l}}function c(v,h){for(var T=[],l=i(v[v.length-1],h),y=v[v.length-1],b=v[0],S=0;S0||l>0&&M<0)&&T.push(n(y,M,b,l)),M>=0&&T.push(b.slice()),l=M}return T}function f(v,h){for(var T=[],l=i(v[v.length-1],h),y=v[v.length-1],b=v[0],S=0;S0||l>0&&M<0)&&T.push(n(y,M,b,l)),M<=0&&T.push(b.slice()),l=M}return T}},3387:function(e,t,r){var o;(function(){var a={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 i(v){return s(f(v),arguments)}function n(v,h){return i.apply(null,[v].concat(h||[]))}function s(v,h){var T=1,l=v.length,y,b="",S,M,_,w,p,u,g,m;for(S=0;S=0),_.type){case"b":y=parseInt(y,10).toString(2);break;case"c":y=String.fromCharCode(parseInt(y,10));break;case"d":case"i":y=parseInt(y,10);break;case"j":y=JSON.stringify(y,null,_.width?parseInt(_.width):0);break;case"e":y=_.precision?parseFloat(y).toExponential(_.precision):parseFloat(y).toExponential();break;case"f":y=_.precision?parseFloat(y).toFixed(_.precision):parseFloat(y);break;case"g":y=_.precision?String(Number(y.toPrecision(_.precision))):parseFloat(y);break;case"o":y=(parseInt(y,10)>>>0).toString(8);break;case"s":y=String(y),y=_.precision?y.substring(0,_.precision):y;break;case"t":y=String(!!y),y=_.precision?y.substring(0,_.precision):y;break;case"T":y=Object.prototype.toString.call(y).slice(8,-1).toLowerCase(),y=_.precision?y.substring(0,_.precision):y;break;case"u":y=parseInt(y,10)>>>0;break;case"v":y=y.valueOf(),y=_.precision?y.substring(0,_.precision):y;break;case"x":y=(parseInt(y,10)>>>0).toString(16);break;case"X":y=(parseInt(y,10)>>>0).toString(16).toUpperCase();break}a.json.test(_.type)?b+=y:(a.number.test(_.type)&&(!g||_.sign)?(m=g?"+":"-",y=y.toString().replace(a.sign,"")):m="",p=_.pad_char?_.pad_char==="0"?"0":_.pad_char.charAt(1):" ",u=_.width-(m+y).length,w=_.width&&u>0?p.repeat(u):"",b+=_.align?m+y+w:p==="0"?m+w+y:w+m+y)}return b}var c=Object.create(null);function f(v){if(c[v])return c[v];for(var h=v,T,l=[],y=0;h;){if((T=a.text.exec(h))!==null)l.push(T[0]);else if((T=a.modulo.exec(h))!==null)l.push("%");else if((T=a.placeholder.exec(h))!==null){if(T[2]){y|=1;var b=[],S=T[2],M=[];if((M=a.key.exec(S))!==null)for(b.push(M[1]);(S=S.substring(M[0].length))!=="";)if((M=a.key_access.exec(S))!==null)b.push(M[1]);else if((M=a.index_access.exec(S))!==null)b.push(M[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");T[2]=b}else y|=2;if(y===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");l.push({placeholder:T[0],param_no:T[1],keys:T[2],sign:T[3],pad_char:T[4],align:T[5],width:T[6],precision:T[7],type:T[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");h=h.substring(T[0].length)}return c[v]=l}t.sprintf=i,t.vsprintf=n,typeof window<"u"&&(window.sprintf=i,window.vsprintf=n,o=(function(){return{sprintf:i,vsprintf:n}}).call(t,r,t,e),o!==void 0&&(e.exports=o))})()},3711:function(e,t,r){e.exports=f;var o=r(2640),a=r(781),i={"2d":function(v,h,T){var l=v({order:h,scalarArguments:3,getters:T==="generic"?[0]:void 0,phase:function(b,S,M,_){return b>_|0},vertex:function(b,S,M,_,w,p,u,g,m,R,P,z,F){var B=(u<<0)+(g<<1)+(m<<2)+(R<<3)|0;if(!(B===0||B===15))switch(B){case 0:P.push([b-.5,S-.5]);break;case 1:P.push([b-.25-.25*(_+M-2*F)/(M-_),S-.25-.25*(w+M-2*F)/(M-w)]);break;case 2:P.push([b-.75-.25*(-_-M+2*F)/(_-M),S-.25-.25*(p+_-2*F)/(_-p)]);break;case 3:P.push([b-.5,S-.5-.5*(w+M+p+_-4*F)/(M-w+_-p)]);break;case 4:P.push([b-.25-.25*(p+w-2*F)/(w-p),S-.75-.25*(-w-M+2*F)/(w-M)]);break;case 5:P.push([b-.5-.5*(_+M+p+w-4*F)/(M-_+w-p),S-.5]);break;case 6:P.push([b-.5-.25*(-_-M+p+w)/(_-M+w-p),S-.5-.25*(-w-M+p+_)/(w-M+_-p)]);break;case 7:P.push([b-.75-.25*(p+w-2*F)/(w-p),S-.75-.25*(p+_-2*F)/(_-p)]);break;case 8:P.push([b-.75-.25*(-p-w+2*F)/(p-w),S-.75-.25*(-p-_+2*F)/(p-_)]);break;case 9:P.push([b-.5-.25*(_+M+-p-w)/(M-_+p-w),S-.5-.25*(w+M+-p-_)/(M-w+p-_)]);break;case 10:P.push([b-.5-.5*(-_-M+-p-w+4*F)/(_-M+p-w),S-.5]);break;case 11:P.push([b-.25-.25*(-p-w+2*F)/(p-w),S-.75-.25*(w+M-2*F)/(M-w)]);break;case 12:P.push([b-.5,S-.5-.5*(-w-M+-p-_+4*F)/(w-M+p-_)]);break;case 13:P.push([b-.75-.25*(_+M-2*F)/(M-_),S-.25-.25*(-p-_+2*F)/(p-_)]);break;case 14:P.push([b-.25-.25*(-_-M+2*F)/(_-M),S-.25-.25*(-w-M+2*F)/(w-M)]);break;case 15:P.push([b-.5,S-.5]);break}},cell:function(b,S,M,_,w,p,u,g,m){w?g.push([b,S]):g.push([S,b])}});return function(y,b){var S=[],M=[];return l(y,S,M,b),{positions:S,cells:M}}}};function n(v,h){var T=v.length+"d",l=i[T];if(l)return l(o,v,h)}function s(v,h){for(var T=a(v,h),l=T.length,y=new Array(l),b=new Array(l),S=0;SMath.max(_,w)?p[2]=1:_>Math.max(M,w)?p[0]=1:p[1]=1;for(var u=0,g=0,m=0;m<3;++m)u+=S[m]*S[m],g+=p[m]*S[m];for(var m=0;m<3;++m)p[m]-=g/u*S[m];return s(p,p),p}function T(S,M,_,w,p,u,g,m){this.center=o(_),this.up=o(w),this.right=o(p),this.radius=o([u]),this.angle=o([g,m]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(S,M),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 R=0;R<16;++R)this.computedMatrix[R]=.5;this.recalcMatrix(0)}var l=T.prototype;l.setDistanceLimits=function(S,M){S>0?S=Math.log(S):S=-1/0,M>0?M=Math.log(M):M=1/0,M=Math.max(M,S),this.radius.bounds[0][0]=S,this.radius.bounds[1][0]=M},l.getDistanceLimits=function(S){var M=this.radius.bounds[0];return S?(S[0]=Math.exp(M[0][0]),S[1]=Math.exp(M[1][0]),S):[Math.exp(M[0][0]),Math.exp(M[1][0])]},l.recalcMatrix=function(S){this.center.curve(S),this.up.curve(S),this.right.curve(S),this.radius.curve(S),this.angle.curve(S);for(var M=this.computedUp,_=this.computedRight,w=0,p=0,u=0;u<3;++u)p+=M[u]*_[u],w+=M[u]*M[u];for(var g=Math.sqrt(w),m=0,u=0;u<3;++u)_[u]-=M[u]*p/w,m+=_[u]*_[u],M[u]/=g;for(var R=Math.sqrt(m),u=0;u<3;++u)_[u]/=R;var P=this.computedToward;n(P,M,_),s(P,P);for(var z=Math.exp(this.computedRadius[0]),F=this.computedAngle[0],B=this.computedAngle[1],O=Math.cos(F),L=Math.sin(F),N=Math.cos(B),U=Math.sin(B),Z=this.computedCenter,Q=O*N,ue=L*N,oe=U,le=-O*U,j=-L*U,J=N,$=this.computedEye,X=this.computedMatrix,u=0;u<3;++u){var re=Q*_[u]+ue*P[u]+oe*M[u];X[4*u+1]=le*_[u]+j*P[u]+J*M[u],X[4*u+2]=re,X[4*u+3]=0}var ee=X[1],q=X[5],ae=X[9],ie=X[2],fe=X[6],we=X[10],Ae=q*we-ae*fe,Fe=ae*ie-ee*we,Ce=ee*fe-q*ie,qe=f(Ae,Fe,Ce);Ae/=qe,Fe/=qe,Ce/=qe,X[0]=Ae,X[4]=Fe,X[8]=Ce;for(var u=0;u<3;++u)$[u]=Z[u]+X[2+4*u]*z;for(var u=0;u<3;++u){for(var m=0,et=0;et<3;++et)m+=X[u+4*et]*$[et];X[12+u]=-m}X[15]=1},l.getMatrix=function(S,M){this.recalcMatrix(S);var _=this.computedMatrix;if(M){for(var w=0;w<16;++w)M[w]=_[w];return M}return _};var y=[0,0,0];l.rotate=function(S,M,_,w){if(this.angle.move(S,M,_),w){this.recalcMatrix(S);var p=this.computedMatrix;y[0]=p[2],y[1]=p[6],y[2]=p[10];for(var u=this.computedUp,g=this.computedRight,m=this.computedToward,R=0;R<3;++R)p[4*R]=u[R],p[4*R+1]=g[R],p[4*R+2]=m[R];i(p,p,w,y);for(var R=0;R<3;++R)u[R]=p[4*R],g[R]=p[4*R+1];this.up.set(S,u[0],u[1],u[2]),this.right.set(S,g[0],g[1],g[2])}},l.pan=function(S,M,_,w){M=M||0,_=_||0,w=w||0,this.recalcMatrix(S);var p=this.computedMatrix;Math.exp(this.computedRadius[0]);var u=p[1],g=p[5],m=p[9],R=f(u,g,m);u/=R,g/=R,m/=R;var P=p[0],z=p[4],F=p[8],B=P*u+z*g+F*m;P-=u*B,z-=g*B,F-=m*B;var O=f(P,z,F);P/=O,z/=O,F/=O;var L=P*M+u*_,N=z*M+g*_,U=F*M+m*_;this.center.move(S,L,N,U);var Z=Math.exp(this.computedRadius[0]);Z=Math.max(1e-4,Z+w),this.radius.set(S,Math.log(Z))},l.translate=function(S,M,_,w){this.center.move(S,M||0,_||0,w||0)},l.setMatrix=function(S,M,_,w){var p=1;typeof _=="number"&&(p=_|0),(p<0||p>3)&&(p=1);var u=(p+2)%3;M||(this.recalcMatrix(S),M=this.computedMatrix);var g=M[p],m=M[p+4],R=M[p+8];if(w){var z=Math.abs(g),F=Math.abs(m),B=Math.abs(R),O=Math.max(z,F,B);z===O?(g=g<0?-1:1,m=R=0):B===O?(R=R<0?-1:1,g=m=0):(m=m<0?-1:1,g=R=0)}else{var P=f(g,m,R);g/=P,m/=P,R/=P}var L=M[u],N=M[u+4],U=M[u+8],Z=L*g+N*m+U*R;L-=g*Z,N-=m*Z,U-=R*Z;var Q=f(L,N,U);L/=Q,N/=Q,U/=Q;var ue=m*U-R*N,oe=R*L-g*U,le=g*N-m*L,j=f(ue,oe,le);ue/=j,oe/=j,le/=j,this.center.jump(S,Me,xe,ce),this.radius.idle(S),this.up.jump(S,g,m,R),this.right.jump(S,L,N,U);var J,$;if(p===2){var X=M[1],re=M[5],ee=M[9],q=X*L+re*N+ee*U,ae=X*ue+re*oe+ee*le;Ae<0?J=-Math.PI/2:J=Math.PI/2,$=Math.atan2(ae,q)}else{var ie=M[2],fe=M[6],we=M[10],Ae=ie*g+fe*m+we*R,Fe=ie*L+fe*N+we*U,Ce=ie*ue+fe*oe+we*le;J=Math.asin(v(Ae)),$=Math.atan2(Ce,Fe)}this.angle.jump(S,$,J),this.recalcMatrix(S);var qe=M[2],et=M[6],Qe=M[10],Ke=this.computedMatrix;a(Ke,M);var Xe=Ke[15],Me=Ke[12]/Xe,xe=Ke[13]/Xe,ce=Ke[14]/Xe,Re=Math.exp(this.computedRadius[0]);this.center.jump(S,Me-qe*Re,xe-et*Re,ce-Qe*Re)},l.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},l.idle=function(S){this.center.idle(S),this.up.idle(S),this.right.idle(S),this.radius.idle(S),this.angle.idle(S)},l.flush=function(S){this.center.flush(S),this.up.flush(S),this.right.flush(S),this.radius.flush(S),this.angle.flush(S)},l.setDistance=function(S,M){M>0&&this.radius.set(S,Math.log(M))},l.lookAt=function(S,M,_,w){this.recalcMatrix(S),M=M||this.computedEye,_=_||this.computedCenter,w=w||this.computedUp;var p=w[0],u=w[1],g=w[2],m=f(p,u,g);if(!(m<1e-6)){p/=m,u/=m,g/=m;var R=M[0]-_[0],P=M[1]-_[1],z=M[2]-_[2],F=f(R,P,z);if(!(F<1e-6)){R/=F,P/=F,z/=F;var B=this.computedRight,O=B[0],L=B[1],N=B[2],U=p*O+u*L+g*N;O-=U*p,L-=U*u,N-=U*g;var Z=f(O,L,N);if(!(Z<.01&&(O=u*z-g*P,L=g*R-p*z,N=p*P-u*R,Z=f(O,L,N),Z<1e-6))){O/=Z,L/=Z,N/=Z,this.up.set(S,p,u,g),this.right.set(S,O,L,N),this.center.set(S,_[0],_[1],_[2]),this.radius.set(S,Math.log(F));var Q=u*N-g*L,ue=g*O-p*N,oe=p*L-u*O,le=f(Q,ue,oe);Q/=le,ue/=le,oe/=le;var j=p*R+u*P+g*z,J=O*R+L*P+N*z,$=Q*R+ue*P+oe*z,X=Math.asin(v(j)),re=Math.atan2($,J),ee=this.angle._state,q=ee[ee.length-1],ae=ee[ee.length-2];q=q%(2*Math.PI);var ie=Math.abs(q+2*Math.PI-re),fe=Math.abs(q-re),we=Math.abs(q-2*Math.PI-re);ie0?N.pop():new ArrayBuffer(O)}t.mallocArrayBuffer=y;function b(B){return new Uint8Array(y(B),0,B)}t.mallocUint8=b;function S(B){return new Uint16Array(y(2*B),0,B)}t.mallocUint16=S;function M(B){return new Uint32Array(y(4*B),0,B)}t.mallocUint32=M;function _(B){return new Int8Array(y(B),0,B)}t.mallocInt8=_;function w(B){return new Int16Array(y(2*B),0,B)}t.mallocInt16=w;function p(B){return new Int32Array(y(4*B),0,B)}t.mallocInt32=p;function u(B){return new Float32Array(y(4*B),0,B)}t.mallocFloat32=t.mallocFloat=u;function g(B){return new Float64Array(y(8*B),0,B)}t.mallocFloat64=t.mallocDouble=g;function m(B){return n?new Uint8ClampedArray(y(B),0,B):b(B)}t.mallocUint8Clamped=m;function R(B){return s?new BigUint64Array(y(8*B),0,B):null}t.mallocBigUint64=R;function P(B){return c?new BigInt64Array(y(8*B),0,B):null}t.mallocBigInt64=P;function z(B){return new DataView(y(B),0,B)}t.mallocDataView=z;function F(B){B=o.nextPow2(B);var O=o.log2(B),L=h[O];return L.length>0?L.pop():new i(B)}t.mallocBuffer=F,t.clearCache=function(){for(var O=0;O<32;++O)f.UINT8[O].length=0,f.UINT16[O].length=0,f.UINT32[O].length=0,f.INT8[O].length=0,f.INT16[O].length=0,f.INT32[O].length=0,f.FLOAT[O].length=0,f.DOUBLE[O].length=0,f.BIGUINT64[O].length=0,f.BIGINT64[O].length=0,f.UINT8C[O].length=0,v[O].length=0,h[O].length=0}},1755:function(e){"use restrict";e.exports=t;function t(o){this.roots=new Array(o),this.ranks=new Array(o);for(var a=0;a",N="",U=L.length,Z=N.length,Q=F[0]===y||F[0]===M,ue=0,oe=-Z;ue>-1&&(ue=B.indexOf(L,ue),!(ue===-1||(oe=B.indexOf(N,ue+U),oe===-1)||oe<=ue));){for(var le=ue;le=oe)O[le]=null,B=B.substr(0,le)+" "+B.substr(le+1);else if(O[le]!==null){var j=O[le].indexOf(F[0]);j===-1?O[le]+=F:Q&&(O[le]=O[le].substr(0,j+1)+(1+parseInt(O[le][j+1]))+O[le].substr(j+2))}var J=ue+U,$=B.substr(J,oe-J),X=$.indexOf(L);X!==-1?ue=X:ue=oe+Z}return O}function p(z,F,B){for(var O=F.textAlign||"start",L=F.textBaseline||"alphabetic",N=[1<<30,1<<30],U=[0,0],Z=z.length,Q=0;Q/g,` +`):B=B.replace(/\/g," ");var U="",Z=[];for(q=0;q-1?parseInt(ce[1+rt]):0,St=Je>-1?parseInt(Re[1+Je]):0;At!==St&&($e=$e.replace(Ce(),"?px "),fe*=Math.pow(.75,St-At),$e=$e.replace("?px ",Ce())),ie+=.25*j*(St-At)}if(N.superscripts===!0){var Rt=ce.indexOf(y),Ut=Re.indexOf(y),ir=Rt>-1?parseInt(ce[1+Rt]):0,ar=Ut>-1?parseInt(Re[1+Ut]):0;ir!==ar&&($e=$e.replace(Ce(),"?px "),fe*=Math.pow(.75,ar-ir),$e=$e.replace("?px ",Ce())),ie-=.25*j*(ar-ir)}if(N.bolds===!0){var Mr=ce.indexOf(v)>-1,fr=Re.indexOf(v)>-1;!Mr&&fr&&(dr?$e=$e.replace("italic ","italic bold "):$e="bold "+$e),Mr&&!fr&&($e=$e.replace("bold ",""))}if(N.italics===!0){var dr=ce.indexOf(T)>-1,pt=Re.indexOf(T)>-1;!dr&&pt&&($e="italic "+$e),dr&&!pt&&($e=$e.replace("italic ",""))}F.font=$e}for(ee=0;ee0&&(L=O.size),O.lineSpacing&&O.lineSpacing>0&&(N=O.lineSpacing),O.styletags&&O.styletags.breaklines&&(U.breaklines=!!O.styletags.breaklines),O.styletags&&O.styletags.bolds&&(U.bolds=!!O.styletags.bolds),O.styletags&&O.styletags.italics&&(U.italics=!!O.styletags.italics),O.styletags&&O.styletags.subscripts&&(U.subscripts=!!O.styletags.subscripts),O.styletags&&O.styletags.superscripts&&(U.superscripts=!!O.styletags.superscripts)),B.font=[O.fontStyle,O.fontVariant,O.fontWeight,L+"px",O.font].filter(function(Q){return Q}).join(" "),B.textAlign="start",B.textBaseline="alphabetic",B.direction="ltr";var Z=u(F,B,z,L,N,U);return R(Z,O,L)}},1538:function(e){(function(){if(typeof ses<"u"&&ses.ok&&!ses.ok())return;function r(g){g.permitHostObjects___&&g.permitHostObjects___(r)}typeof ses<"u"&&(ses.weakMapPermitHostObjects=r);var o=!1;if(typeof WeakMap=="function"){var a=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var i=new a,n=Object.freeze({});if(i.set(n,1),i.get(n)!==1)o=!0;else{e.exports=WeakMap;return}}}var s=Object.getOwnPropertyNames,c=Object.defineProperty,f=Object.isExtensible,v="weakmap:",h=v+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var T=new ArrayBuffer(25),l=new Uint8Array(T);crypto.getRandomValues(l),h=v+"rand:"+Array.prototype.map.call(l,function(g){return(g%36).toString(36)}).join("")+"___"}function y(g){return!(g.substr(0,v.length)==v&&g.substr(g.length-3)==="___")}if(c(Object,"getOwnPropertyNames",{value:function(m){return s(m).filter(y)}}),"getPropertyNames"in Object){var b=Object.getPropertyNames;c(Object,"getPropertyNames",{value:function(m){return b(m).filter(y)}})}function S(g){if(g!==Object(g))throw new TypeError("Not an object: "+g);var m=g[h];if(m&&m.key===g)return m;if(f(g)){m={key:g};try{return c(g,h,{value:m,writable:!1,enumerable:!1,configurable:!1}),m}catch{return}}}(function(){var g=Object.freeze;c(Object,"freeze",{value:function(z){return S(z),g(z)}});var m=Object.seal;c(Object,"seal",{value:function(z){return S(z),m(z)}});var R=Object.preventExtensions;c(Object,"preventExtensions",{value:function(z){return S(z),R(z)}})})();function M(g){return g.prototype=null,Object.freeze(g)}var _=!1;function w(){!_&&typeof console<"u"&&(_=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}var p=0,u=function(){this instanceof u||w();var g=[],m=[],R=p++;function P(O,L){var N,U=S(O);return U?R in U?U[R]:L:(N=g.indexOf(O),N>=0?m[N]:L)}function z(O){var L=S(O);return L?R in L:g.indexOf(O)>=0}function F(O,L){var N,U=S(O);return U?U[R]=L:(N=g.indexOf(O),N>=0?m[N]=L:(N=g.length,m[N]=L,g[N]=O)),this}function B(O){var L=S(O),N,U;return L?R in L&&delete L[R]:(N=g.indexOf(O),N<0?!1:(U=g.length-1,g[N]=void 0,m[N]=m[U],g[N]=g[U],g.length=U,m.length=U,!0))}return Object.create(u.prototype,{get___:{value:M(P)},has___:{value:M(z)},set___:{value:M(F)},delete___:{value:M(B)}})};u.prototype=Object.create(Object.prototype,{get:{value:function(m,R){return this.get___(m,R)},writable:!0,configurable:!0},has:{value:function(m){return this.has___(m)},writable:!0,configurable:!0},set:{value:function(m,R){return this.set___(m,R)},writable:!0,configurable:!0},delete:{value:function(m){return this.delete___(m)},writable:!0,configurable:!0}}),typeof a=="function"?function(){o&&typeof Proxy<"u"&&(Proxy=void 0);function g(){this instanceof u||w();var m=new a,R=void 0,P=!1;function z(L,N){return R?m.has(L)?m.get(L):R.get___(L,N):m.get(L,N)}function F(L){return m.has(L)||(R?R.has___(L):!1)}var B;o?B=function(L,N){return m.set(L,N),m.has(L)||(R||(R=new u),R.set(L,N)),this}:B=function(L,N){if(P)try{m.set(L,N)}catch{R||(R=new u),R.set___(L,N)}else m.set(L,N);return this};function O(L){var N=!!m.delete(L);return R&&R.delete___(L)||N}return Object.create(u.prototype,{get___:{value:M(z)},has___:{value:M(F)},set___:{value:M(B)},delete___:{value:M(O)},permitHostObjects___:{value:M(function(L){if(L===r)P=!0;else throw new Error("bogus call to permitHostObjects___")})}})}g.prototype=u.prototype,e.exports=g,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(Proxy=void 0),e.exports=u)})()},236:function(e,t,r){var o=r(8284);e.exports=a;function a(){var i={};return function(n){if((typeof n!="object"||n===null)&&typeof n!="function")throw new Error("Weakmap-shim: Key must be object");var s=n.valueOf(i);return s&&s.identity===i?s:o(n,i)}}},8284:function(e){e.exports=t;function t(r,o){var a={identity:o},i=r.valueOf;return Object.defineProperty(r,"valueOf",{value:function(n){return n!==o?i.apply(this,arguments):a},writable:!0}),a}},606:function(e,t,r){var o=r(236);e.exports=a;function a(){var i=o();return{get:function(n,s){var c=i(n);return c.hasOwnProperty("value")?c.value:s},set:function(n,s){return i(n).value=s,this},has:function(n){return"value"in i(n)},delete:function(n){return delete i(n).value}}}},3349:function(e){function t(){return function(s,c,f,v,h,T){var l=s[0],y=f[0],b=[0],S=y;v|=0;var M=0,_=y;for(M=0;M=0!=p>=0&&h.push(b[0]+.5+.5*(w+p)/(w-p))}v+=_,++b[0]}}}function r(){return t()}var o=r;function a(s){var c={};return function(v,h,T){var l=v.dtype,y=v.order,b=[l,y.join()].join(),S=c[b];return S||(c[b]=S=s([l,y])),S(v.shape.slice(0),v.data,v.stride,v.offset|0,h,T)}}function i(s){return a(o.bind(void 0,s))}function n(s){return i({funcName:s.funcName})}e.exports=n({funcName:"zeroCrossings"})},781:function(e,t,r){e.exports=a;var o=r(3349);function a(i,n){var s=[];return n=+n||0,o(i.hi(i.shape[0]-1),s,n),s}},7790:function(){}},x={};function A(e){var t=x[e];if(t!==void 0)return t.exports;var r=x[e]={id:e,loaded:!1,exports:{}};return d[e].call(r.exports,r,r.exports,A),r.loaded=!0,r.exports}(function(){A.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}()})(),function(){A.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}();var E=A(1964);G.exports=E})()}}),C3=He({"node_modules/color-name/index.js"(Y,G){G.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]}}}),TL=He({"node_modules/color-normalize/node_modules/color-parse/index.js"(Y,G){var d=C3();G.exports=A;var x={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function A(E){var e,t=[],r=1,o;if(typeof E=="string")if(E=E.toLowerCase(),d[E])t=d[E].slice(),o="rgb";else if(E==="transparent")r=0,o="rgb",t=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(E)){var a=E.slice(1),i=a.length,n=i<=4;r=1,n?(t=[parseInt(a[0]+a[0],16),parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16)],i===4&&(r=parseInt(a[3]+a[3],16)/255)):(t=[parseInt(a[0]+a[1],16),parseInt(a[2]+a[3],16),parseInt(a[4]+a[5],16)],i===8&&(r=parseInt(a[6]+a[7],16)/255)),t[0]||(t[0]=0),t[1]||(t[1]=0),t[2]||(t[2]=0),o="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(E)){var s=e[1],c=s==="rgb",a=s.replace(/a$/,"");o=a;var i=a==="cmyk"?4:a==="gray"?1:3;t=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(h,T){if(/%$/.test(h))return T===i?parseFloat(h)/100:a==="rgb"?parseFloat(h)*255/100:parseFloat(h);if(a[T]==="h"){if(/deg$/.test(h))return parseFloat(h);if(x[h]!==void 0)return x[h]}return parseFloat(h)}),s===a&&t.push(1),r=c||t[i]===void 0?1:t[i],t=t.slice(0,i)}else E.length>10&&/[0-9](?:\s|\/)/.test(E)&&(t=E.match(/([0-9]+)/g).map(function(f){return parseFloat(f)}),o=E.match(/([a-z])/ig).join("").toLowerCase());else isNaN(E)?Array.isArray(E)||E.length?(t=[E[0],E[1],E[2]],o="rgb",r=E.length===4?E[3]:1):E instanceof Object&&(E.r!=null||E.red!=null||E.R!=null?(o="rgb",t=[E.r||E.red||E.R||0,E.g||E.green||E.G||0,E.b||E.blue||E.B||0]):(o="hsl",t=[E.h||E.hue||E.H||0,E.s||E.saturation||E.S||0,E.l||E.lightness||E.L||E.b||E.brightness]),r=E.a||E.alpha||E.opacity||1,E.opacity!=null&&(r/=100)):(o="rgb",t=[E>>>16,(E&65280)>>>8,E&255]);return{space:o,values:t,alpha:r}}}}),AL=He({"node_modules/color-normalize/node_modules/color-rgba/index.js"(Y,G){var d=TL();G.exports=function(E){Array.isArray(E)&&E.raw&&(E=String.raw.apply(null,arguments));var e,t=d(E);if(!t.space)return[];var r=[0,0,0],o=t.space[0]==="h"?[360,100,100]:[255,255,255];return e=Array(3),e[0]=Math.min(Math.max(t.values[0],r[0]),o[0]),e[1]=Math.min(Math.max(t.values[1],r[1]),o[1]),e[2]=Math.min(Math.max(t.values[2],r[2]),o[2]),t.space[0]==="h"&&(e=x(e)),e.push(Math.min(Math.max(t.alpha,0),1)),e};function x(A){var E=A[0]/360,e=A[1]/100,t=A[2]/100,r,o,a,i,n,s=0;if(e===0)return n=t*255,[n,n,n];for(o=t<.5?t*(1+e):t+e-t*e,r=2*t-o,i=[0,0,0];s<3;)a=E+1/3*-(s-1),a<0?a++:a>1&&a--,n=6*a<1?r+(o-r)*6*a:2*a<1?o:3*a<2?r+(o-r)*(2/3-a)*6:r,i[s++]=n*255;return i}}}),Ny=He({"node_modules/clamp/index.js"(Y,G){G.exports=d;function d(x,A,E){return AE?E:x:xA?A:x}}}),F_=He({"node_modules/dtype/index.js"(Y,G){G.exports=function(d){switch(d){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),rp=He({"node_modules/color-normalize/index.js"(Y,G){var d=AL(),x=Ny(),A=F_();G.exports=function(t,r){(r==="float"||!r)&&(r="array"),r==="uint"&&(r="uint8"),r==="uint_clamped"&&(r="uint8_clamped");var o=A(r),a=new o(4),i=r!=="uint8"&&r!=="uint8_clamped";return(!t.length||typeof t=="string")&&(t=d(t),t[0]/=255,t[1]/=255,t[2]/=255),E(t)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3]!=null?t[3]:255,i&&(a[0]/=255,a[1]/=255,a[2]/=255,a[3]/=255),a):(i?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3]!=null?t[3]:1):(a[0]=x(Math.floor(t[0]*255),0,255),a[1]=x(Math.floor(t[1]*255),0,255),a[2]=x(Math.floor(t[2]*255),0,255),a[3]=t[3]==null?255:x(Math.floor(t[3]*255),0,255)),a)};function E(e){return!!(e instanceof Uint8Array||e instanceof Uint8ClampedArray||Array.isArray(e)&&(e[0]>1||e[0]===0)&&(e[1]>1||e[1]===0)&&(e[2]>1||e[2]===0)&&(!e[3]||e[3]>1))}}}),cd=He({"src/lib/str2rgbarray.js"(Y,G){var d=rp();function x(A){return A?d(A):[0,0,0,1]}G.exports=x}}),fd=He({"src/lib/gl_format_color.js"(Y,G){var d=Hi(),x=Mf(),A=rp(),E=Kl(),e=Xc().defaultLine,t=ch().isArrayOrTypedArray,r=A(e),o=1;function a(f,v){var h=f;return h[3]*=v,h}function i(f){if(d(f))return r;var v=A(f);return v.length?v:r}function n(f){return d(f)?f:o}function s(f,v,h){var T=f.color;T&&T._inputArray&&(T=T._inputArray);var l=t(T),y=t(v),b=E.extractOpts(f),S=[],M,_,w,p,u;if(b.colorscale!==void 0?M=E.makeColorScaleFuncFromTrace(f):M=i,l?_=function(m,R){return m[R]===void 0?r:A(M(m[R]))}:_=i,y?w=function(m,R){return m[R]===void 0?o:n(m[R])}:w=n,l||y)for(var g=0;g0){var h=o.c2l(f);o._lowerLogErrorBound||(o._lowerLogErrorBound=h),o._lowerErrorBound=Math.min(o._lowerLogErrorBound,h)}}else i[n]=[-s[0]*r,s[1]*r]}return i}function A(e){for(var t=0;t-1?-1:R.indexOf("right")>-1?1:0}function b(R){return R==null?0:R.indexOf("top")>-1?-1:R.indexOf("bottom")>-1?1:0}function S(R){var P=0,z=0,F=[P,z];if(Array.isArray(R))for(var B=0;B=0){var Z=T(N.position,N.delaunayColor,N.delaunayAxis);Z.opacity=R.opacity,this.delaunayMesh?this.delaunayMesh.update(Z):(Z.gl=P,this.delaunayMesh=E(Z),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},h.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function m(R,P){var z=new v(R,P.uid);return z.update(P),z}G.exports=m}}),P3=He({"src/traces/scatter3d/attributes.js"(Y,G){var d=Zu(),x=Yl(),A=kl(),E=Gu().axisHoverFormat,e=Yo().hovertemplateAttrs,t=Yo().texttemplateAttrs,r=cl(),o=L3(),a=O_(),i=ho().extendFlat,n=hu().overrideAll,s=Ud(),c=d.line,f=d.marker,v=f.line,h=i({width:c.width,dash:{valType:"enumerated",values:s(o),dflt:"solid"}},A("line"));function T(y){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var l=G.exports=n({x:d.x,y:d.y,z:{valType:"data_array"},text:i({},d.text,{}),texttemplate:t({},{}),hovertext:i({},d.hovertext,{}),hovertemplate:e(),xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z"),mode:i({},d.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:T(),y:T(),z:T()},connectgaps:d.connectgaps,line:h,marker:i({symbol:{valType:"enumerated",values:s(a),dflt:"circle",arrayOk:!0},size:i({},f.size,{dflt:8}),sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode,opacity:i({},f.opacity,{arrayOk:!1}),colorbar:f.colorbar,line:i({width:i({},v.width,{arrayOk:!1})},A("marker.line"))},A("marker")),textposition:i({},d.textposition,{dflt:"top center"}),textfont:x({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:r.opacity,hoverinfo:i({},r.hoverinfo)},"calc","nested");l.x.editType=l.y.editType=l.z.editType="calc+clearAxisTypes"}}),EL=He({"src/traces/scatter3d/defaults.js"(Y,G){var d=Ei(),x=Gr(),A=Rl(),E=Kh(),e=nv(),t=iv(),r=P3();G.exports=function(i,n,s,c){function f(M,_){return x.coerce(i,n,r,M,_)}var v=o(i,n,f,c);if(!v){n.visible=!1;return}f("text"),f("hovertext"),f("hovertemplate"),f("xhoverformat"),f("yhoverformat"),f("zhoverformat"),f("mode"),A.hasMarkers(n)&&E(i,n,s,c,f,{noSelect:!0,noAngle:!0}),A.hasLines(n)&&(f("connectgaps"),e(i,n,s,c,f)),A.hasText(n)&&(f("texttemplate"),t(i,n,c,f,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var h=(n.line||{}).color,T=(n.marker||{}).color;f("surfaceaxis")>=0&&f("surfacecolor",h||T);for(var l=["x","y","z"],y=0;y<3;++y){var b="projection."+l[y];f(b+".show")&&(f(b+".opacity"),f(b+".scale"))}var S=d.getComponentMethod("errorbars","supplyDefaults");S(i,n,h||T||s,{axis:"z"}),S(i,n,h||T||s,{axis:"y",inherit:"z"}),S(i,n,h||T||s,{axis:"x",inherit:"z"})};function o(a,i,n,s){var c=0,f=n("x"),v=n("y"),h=n("z"),T=d.getComponentMethod("calendars","handleTraceDefaults");return T(a,i,["x","y","z"],s),f&&v&&h&&(c=Math.min(f.length,v.length,h.length),i._length=i._xlength=i._ylength=i._zlength=c),c}}}),kL=He({"src/traces/scatter3d/calc.js"(Y,G){var d=Vv(),x=ov();G.exports=function(E,e){var t=[{x:!1,y:!1,trace:e,t:{}}];return d(t,e),x(E,e),t}}}),CL=He({"node_modules/get-canvas-context/index.js"(Y,G){G.exports=d;function d(x,A){if(typeof x!="string")throw new TypeError("must specify type string");if(A=A||{},typeof document>"u"&&!A.canvas)return null;var E=A.canvas||document.createElement("canvas");typeof A.width=="number"&&(E.width=A.width),typeof A.height=="number"&&(E.height=A.height);var e=A,t;try{var r=[x];x.indexOf("webgl")===0&&r.push("experimental-"+x);for(var o=0;o/g," "));i[n]=v,s.tickmode=c}}r.ticks=i;for(var n=0;n<3;++n){.5*(t.glplot.bounds[0][n]+t.glplot.bounds[1][n]);for(var h=0;h<2;++h)r.bounds[h][n]=t.glplot.bounds[h][n]}t.contourLevels=E(i)}}}),DL=He({"src/plots/gl3d/scene.js"(Y,G){var d=Hf().gl_plot3d,x=d.createCamera,A=d.createScene,E=LL(),e=a1(),t=Ei(),r=Gr(),o=r.preserveDrawingBuffer(),a=io(),i=Wu(),n=cd(),s=I3(),c=Qb(),f=PL(),v=IL(),h=RL(),T=_v().applyAutorangeOptions,l,y,b=!1;function S(z,F){var B=document.createElement("div"),O=z.container;this.graphDiv=z.graphDiv;var L=document.createElementNS("http://www.w3.org/2000/svg","svg");L.style.position="absolute",L.style.top=L.style.left="0px",L.style.width=L.style.height="100%",L.style["z-index"]=20,L.style["pointer-events"]="none",B.appendChild(L),this.svgContainer=L,B.id=z.id,B.style.position="absolute",B.style.top=B.style.left="0px",B.style.width=B.style.height="100%",O.appendChild(B),this.fullLayout=F,this.id=z.id||"scene",this.fullSceneLayout=F[this.id],this.plotArgs=[[],{},{}],this.axesOptions=f(F,F[this.id]),this.spikeOptions=v(F[this.id]),this.container=B,this.staticMode=!!z.staticPlot,this.pixelRatio=this.pixelRatio||z.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=t.getComponentMethod("annotations3d","convert"),this.drawAnnotations=t.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var M=S.prototype;M.prepareOptions=function(){var z=this,F={canvas:z.canvas,gl:z.gl,glOptions:{preserveDrawingBuffer:o,premultipliedAlpha:!0,antialias:!0},container:z.container,axes:z.axesOptions,spikes:z.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:z.camera,pixelRatio:z.pixelRatio};if(z.staticMode){if(!y&&(l=document.createElement("canvas"),y=E({canvas:l,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!y))throw new Error("error creating static canvas/context for image server");F.gl=y,F.canvas=l}return F};var _=!0;M.tryCreatePlot=function(){var z=this,F=z.prepareOptions(),B=!0;try{z.glplot=A(F)}catch{if(z.staticMode||!_||o)B=!1;else{r.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{o=F.glOptions.preserveDrawingBuffer=!0,z.glplot=A(F)}catch{o=F.glOptions.preserveDrawingBuffer=!1,B=!1}}}return _=!1,B},M.initializeGLCamera=function(){var z=this,F=z.fullSceneLayout.camera,B=F.projection.type==="orthographic";z.camera=x(z.container,{center:[F.center.x,F.center.y,F.center.z],eye:[F.eye.x,F.eye.y,F.eye.z],up:[F.up.x,F.up.y,F.up.z],_ortho:B,zoomMin:.01,zoomMax:100,mode:"orbit"})},M.initializeGLPlot=function(){var z=this;z.initializeGLCamera();var F=z.tryCreatePlot();if(!F)return s(z);z.traces={},z.make4thDimension();var B=z.graphDiv,O=B.layout,L=function(){var U={};return z.isCameraChanged(O)&&(U[z.id+".camera"]=z.getCamera()),z.isAspectChanged(O)&&(U[z.id+".aspectratio"]=z.glplot.getAspectratio(),O[z.id].aspectmode!=="manual"&&(z.fullSceneLayout.aspectmode=O[z.id].aspectmode=U[z.id+".aspectmode"]="manual")),U},N=function(U){if(U.fullSceneLayout.dragmode!==!1){var Z=L();U.saveLayout(O),U.graphDiv.emit("plotly_relayout",Z)}};return z.glplot.canvas&&(z.glplot.canvas.addEventListener("mouseup",function(){N(z)}),z.glplot.canvas.addEventListener("touchstart",function(){b=!0}),z.glplot.canvas.addEventListener("wheel",function(U){if(B._context._scrollZoom.gl3d){if(z.camera._ortho){var Z=U.deltaX>U.deltaY?1.1:.9090909090909091,Q=z.glplot.getAspectratio();z.glplot.setAspectratio({x:Z*Q.x,y:Z*Q.y,z:Z*Q.z})}N(z)}},e?{passive:!1}:!1),z.glplot.canvas.addEventListener("mousemove",function(){if(z.fullSceneLayout.dragmode!==!1&&z.camera.mouseListener.buttons!==0){var U=L();z.graphDiv.emit("plotly_relayouting",U)}}),z.staticMode||z.glplot.canvas.addEventListener("webglcontextlost",function(U){B&&B.emit&&B.emit("plotly_webglcontextlost",{event:U,layer:z.id})},!1)),z.glplot.oncontextloss=function(){z.recoverContext()},z.glplot.onrender=function(){z.render()},!0},M.render=function(){var z=this,F=z.graphDiv,B,O=z.svgContainer,L=z.container.getBoundingClientRect();F._fullLayout._calcInverseTransform(F);var N=F._fullLayout._invScaleX,U=F._fullLayout._invScaleY,Z=L.width*N,Q=L.height*U;O.setAttributeNS(null,"viewBox","0 0 "+Z+" "+Q),O.setAttributeNS(null,"width",Z),O.setAttributeNS(null,"height",Q),h(z),z.glplot.axes.update(z.axesOptions);for(var ue=Object.keys(z.traces),oe=null,le=z.glplot.selection,j=0;j")):B.type==="isosurface"||B.type==="volume"?(ee.valueLabel=a.hoverLabelText(z._mockAxis,z._mockAxis.d2l(le.traceCoordinate[3]),B.valuehoverformat),we.push("value: "+ee.valueLabel),le.textLabel&&we.push(le.textLabel),fe=we.join("
")):fe=le.textLabel;var Ae={x:le.traceCoordinate[0],y:le.traceCoordinate[1],z:le.traceCoordinate[2],data:X._input,fullData:X,curveNumber:X.index,pointNumber:re};i.appendArrayPointValue(Ae,X,re),B._module.eventData&&(Ae=X._module.eventData(Ae,le,X,{},re));var Fe={points:[Ae]};if(z.fullSceneLayout.hovermode){var Ce=[];i.loneHover({trace:X,x:(.5+.5*$[0]/$[3])*Z,y:(.5-.5*$[1]/$[3])*Q,xLabel:ee.xLabel,yLabel:ee.yLabel,zLabel:ee.zLabel,text:fe,name:oe.name,color:i.castHoverOption(X,re,"bgcolor")||oe.color,borderColor:i.castHoverOption(X,re,"bordercolor"),fontFamily:i.castHoverOption(X,re,"font.family"),fontSize:i.castHoverOption(X,re,"font.size"),fontColor:i.castHoverOption(X,re,"font.color"),nameLength:i.castHoverOption(X,re,"namelength"),textAlign:i.castHoverOption(X,re,"align"),hovertemplate:r.castOption(X,re,"hovertemplate"),hovertemplateLabels:r.extendFlat({},Ae,ee),eventData:[Ae]},{container:O,gd:F,inOut_bbox:Ce}),Ae.bbox=Ce[0]}le.distance<5&&(le.buttons||b)?F.emit("plotly_click",Fe):F.emit("plotly_hover",Fe),this.oldEventData=Fe}else i.loneUnhover(O),this.oldEventData&&F.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;z.drawAnnotations(z)},M.recoverContext=function(){var z=this;z.glplot.dispose();var F=function(){if(z.glplot.gl.isContextLost()){requestAnimationFrame(F);return}if(!z.initializeGLPlot()){r.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}z.plot.apply(z,z.plotArgs)};requestAnimationFrame(F)};var w=["xaxis","yaxis","zaxis"];function p(z,F,B){for(var O=z.fullSceneLayout,L=0;L<3;L++){var N=w[L],U=N.charAt(0),Z=O[N],Q=F[U],ue=F[U+"calendar"],oe=F["_"+U+"length"];if(!r.isArrayOrTypedArray(Q))B[0][L]=Math.min(B[0][L],0),B[1][L]=Math.max(B[1][L],oe-1);else for(var le,j=0;j<(oe||Q.length);j++)if(r.isArrayOrTypedArray(Q[j]))for(var J=0;JX[1][U])X[0][U]=-1,X[1][U]=1;else{var qe=X[1][U]-X[0][U];X[0][U]-=qe/32,X[1][U]+=qe/32}if(ee=[X[0][U],X[1][U]],ee=T(ee,Q),X[0][U]=ee[0],X[1][U]=ee[1],Q.isReversed()){var et=X[0][U];X[0][U]=X[1][U],X[1][U]=et}}else ee=Q.range,X[0][U]=Q.r2l(ee[0]),X[1][U]=Q.r2l(ee[1]);X[0][U]===X[1][U]&&(X[0][U]-=1,X[1][U]+=1),Q.range=[X[0][U],X[1][U]],Q.limitRange(),O.glplot.setBounds(U,{min:Q.range[0]*J[U],max:Q.range[1]*J[U]})}var Qe,Ke=oe.aspectmode;if(Ke==="cube")Qe=[1,1,1];else if(Ke==="manual"){var Xe=oe.aspectratio;Qe=[Xe.x,Xe.y,Xe.z]}else if(Ke==="auto"||Ke==="data"){var Me=[1,1,1];for(U=0;U<3;++U){Q=oe[w[U]],ue=Q.type;var xe=re[ue];Me[U]=Math.pow(xe.acc,1/xe.count)/J[U]}Ke==="data"||Math.max.apply(null,Me)/Math.min.apply(null,Me)<=4?Qe=Me:Qe=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");oe.aspectratio.x=le.aspectratio.x=Qe[0],oe.aspectratio.y=le.aspectratio.y=Qe[1],oe.aspectratio.z=le.aspectratio.z=Qe[2],O.glplot.setAspectratio(oe.aspectratio),O.viewInitial.aspectratio||(O.viewInitial.aspectratio={x:oe.aspectratio.x,y:oe.aspectratio.y,z:oe.aspectratio.z}),O.viewInitial.aspectmode||(O.viewInitial.aspectmode=oe.aspectmode);var ce=oe.domain||null,Re=F._size||null;if(ce&&Re){var $e=O.container.style;$e.position="absolute",$e.left=Re.l+ce.x[0]*Re.w+"px",$e.top=Re.t+(1-ce.y[1])*Re.h+"px",$e.width=Re.w*(ce.x[1]-ce.x[0])+"px",$e.height=Re.h*(ce.y[1]-ce.y[0])+"px"}O.glplot.redraw()}},M.destroy=function(){var z=this;z.glplot&&(z.camera.mouseListener.enabled=!1,z.container.removeEventListener("wheel",z.camera.wheelListener),z.camera=null,z.glplot.dispose(),z.container.parentNode.removeChild(z.container),z.glplot=null)};function g(z){return[[z.eye.x,z.eye.y,z.eye.z],[z.center.x,z.center.y,z.center.z],[z.up.x,z.up.y,z.up.z]]}function m(z){return{up:{x:z.up[0],y:z.up[1],z:z.up[2]},center:{x:z.center[0],y:z.center[1],z:z.center[2]},eye:{x:z.eye[0],y:z.eye[1],z:z.eye[2]},projection:{type:z._ortho===!0?"orthographic":"perspective"}}}M.getCamera=function(){var z=this;return z.camera.view.recalcMatrix(z.camera.view.lastT()),m(z.camera)},M.setViewport=function(z){var F=this,B=z.camera;F.camera.lookAt.apply(this,g(B)),F.glplot.setAspectratio(z.aspectratio);var O=B.projection.type==="orthographic",L=F.camera._ortho;O!==L&&(F.glplot.redraw(),F.glplot.clearRGBA(),F.glplot.dispose(),F.initializeGLPlot())},M.isCameraChanged=function(z){var F=this,B=F.getCamera(),O=r.nestedProperty(z,F.id+".camera"),L=O.get();function N(ue,oe,le,j){var J=["up","center","eye"],$=["x","y","z"];return oe[J[le]]&&ue[J[le]][$[j]]===oe[J[le]][$[j]]}var U=!1;if(L===void 0)U=!0;else{for(var Z=0;Z<3;Z++)for(var Q=0;Q<3;Q++)if(!N(B,L,Z,Q)){U=!0;break}(!L.projection||B.projection&&B.projection.type!==L.projection.type)&&(U=!0)}return U},M.isAspectChanged=function(z){var F=this,B=F.glplot.getAspectratio(),O=r.nestedProperty(z,F.id+".aspectratio"),L=O.get();return L===void 0||L.x!==B.x||L.y!==B.y||L.z!==B.z},M.saveLayout=function(z){var F=this,B=F.fullLayout,O,L,N,U,Z,Q,ue=F.isCameraChanged(z),oe=F.isAspectChanged(z),le=ue||oe;if(le){var j={};if(ue&&(O=F.getCamera(),L=r.nestedProperty(z,F.id+".camera"),N=L.get(),j[F.id+".camera"]=N),oe&&(U=F.glplot.getAspectratio(),Z=r.nestedProperty(z,F.id+".aspectratio"),Q=Z.get(),j[F.id+".aspectratio"]=Q),t.call("_storeDirectGUIEdit",z,B._preGUI,j),ue){L.set(O);var J=r.nestedProperty(B,F.id+".camera");J.set(O)}if(oe){Z.set(U);var $=r.nestedProperty(B,F.id+".aspectratio");$.set(U),F.glplot.redraw()}}return le},M.updateFx=function(z,F){var B=this,O=B.camera;if(O)if(z==="orbit")O.mode="orbit",O.keyBindingMode="rotate";else if(z==="turntable"){O.up=[0,0,1],O.mode="turntable",O.keyBindingMode="rotate";var L=B.graphDiv,N=L._fullLayout,U=B.fullSceneLayout.camera,Z=U.up.x,Q=U.up.y,ue=U.up.z;if(ue/Math.sqrt(Z*Z+Q*Q+ue*ue)<.999){var oe=B.id+".camera.up",le={x:0,y:0,z:1},j={};j[oe]=le;var J=L.layout;t.call("_storeDirectGUIEdit",J,N._preGUI,j),U.up=le,r.nestedProperty(J,oe).set(le)}}else O.keyBindingMode=z;B.fullSceneLayout.hovermode=F};function R(z,F,B){for(var O=0,L=B-1;O0)for(var Z=255/U,Q=0;Q<3;++Q)z[N+Q]=Math.min(Z*z[N+Q],255)}}M.toImage=function(z){var F=this;z||(z="png"),F.staticMode&&F.container.appendChild(l),F.glplot.redraw();var B=F.glplot.gl,O=B.drawingBufferWidth,L=B.drawingBufferHeight;B.bindFramebuffer(B.FRAMEBUFFER,null);var N=new Uint8Array(O*L*4);B.readPixels(0,0,O,L,B.RGBA,B.UNSIGNED_BYTE,N),R(N,O,L),P(N,O,L);var U=document.createElement("canvas");U.width=O,U.height=L;var Z=U.getContext("2d",{willReadFrequently:!0}),Q=Z.createImageData(O,L);Q.data.set(N),Z.putImageData(Q,0,0);var ue;switch(z){case"jpeg":ue=U.toDataURL("image/jpeg");break;case"webp":ue=U.toDataURL("image/webp");break;default:ue=U.toDataURL("image/png")}return F.staticMode&&F.container.removeChild(l),ue},M.setConvert=function(){for(var z=this,F=0;F<3;F++){var B=z.fullSceneLayout[w[F]];a.setConvert(B,z.fullLayout),B.setScale=r.noop}},M.make4thDimension=function(){var z=this,F=z.graphDiv,B=F._fullLayout;z._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},a.setConvert(z._mockAxis,B)},G.exports=S}}),zL=He({"src/plots/gl3d/layout/attributes.js"(Y,G){G.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),R3=He({"src/plots/gl3d/layout/axis_attributes.js"(Y,G){var d=Ai(),x=jf(),A=ho().extendFlat,E=hu().overrideAll;G.exports=E({visible:x.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:d.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:x.color,categoryorder:x.categoryorder,categoryarray:x.categoryarray,title:{text:x.title.text,font:x.title.font},type:A({},x.type,{values:["-","linear","log","date","category"]}),autotypenumbers:x.autotypenumbers,autorange:x.autorange,autorangeoptions:{minallowed:x.autorangeoptions.minallowed,maxallowed:x.autorangeoptions.maxallowed,clipmin:x.autorangeoptions.clipmin,clipmax:x.autorangeoptions.clipmax,include:x.autorangeoptions.include,editType:"plot"},rangemode:x.rangemode,minallowed:x.minallowed,maxallowed:x.maxallowed,range:A({},x.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:x.minor.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,mirror:x.mirror,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,showticklabels:x.showticklabels,labelalias:x.labelalias,tickfont:x.tickfont,tickangle:x.tickangle,tickprefix:x.tickprefix,showtickprefix:x.showtickprefix,ticksuffix:x.ticksuffix,showticksuffix:x.showticksuffix,showexponent:x.showexponent,exponentformat:x.exponentformat,minexponent:x.minexponent,separatethousands:x.separatethousands,tickformat:x.tickformat,tickformatstops:x.tickformatstops,hoverformat:x.hoverformat,showline:x.showline,linecolor:x.linecolor,linewidth:x.linewidth,showgrid:x.showgrid,gridcolor:A({},x.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:x.gridwidth,zeroline:x.zeroline,zerolinecolor:x.zerolinecolor,zerolinewidth:x.zerolinewidth},"plot","from-root")}}),D3=He({"src/plots/gl3d/layout/layout_attributes.js"(Y,G){var d=R3(),x=mu().attributes,A=ho().extendFlat,E=Gr().counterRegex;function e(t,r,o){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:r,editType:"camera"},z:{valType:"number",dflt:o,editType:"camera"},editType:"camera"}}G.exports={_arrayAttrRegexps:[E("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:A(e(0,0,1),{}),center:A(e(0,0,0),{}),eye:A(e(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:x({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:d,yaxis:d,zaxis:d,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"}}}),FL=He({"src/plots/gl3d/layout/axis_defaults.js"(Y,G){var d=Mf().mix,x=Gr(),A=Gs(),E=R3(),e=Jb(),t=ny(),r=["xaxis","yaxis","zaxis"],o=100*136/187;G.exports=function(i,n,s){var c,f;function v(l,y){return x.coerce(c,f,E,l,y)}for(var h=0;h1;function v(h){if(!f){var T=d.validate(n[h],t[h]);if(T)return n[h]}}E(n,s,c,{type:o,attributes:t,handleDefaults:a,fullLayout:s,font:s.font,fullData:c,getDfltFromLayout:v,autotypenumbersDflt:s.autotypenumbers,paper_bgcolor:s.paper_bgcolor,calendar:s.calendar})};function a(i,n,s,c){for(var f=s("bgcolor"),v=x.combine(f,c.paper_bgcolor),h=["up","center","eye"],T=0;T.999)&&(M="turntable")}else M="turntable";s("dragmode",M),s("hovermode",c.getDfltFromLayout("hovermode"))}}}),ap=He({"src/plots/gl3d/index.js"(Y){var G=hu().overrideAll,d=Od(),x=DL(),A=Uf().getSubplotData,E=Gr(),e=Yh(),t="gl3d",r="scene";Y.name=t,Y.attr=r,Y.idRoot=r,Y.idRegex=Y.attrRegex=E.counterRegex("scene"),Y.attributes=zL(),Y.layoutAttributes=D3(),Y.baseLayoutAttrOverrides=G({hoverlabel:d.hoverlabel},"plot","nested"),Y.supplyLayoutDefaults=OL(),Y.plot=function(a){for(var i=a._fullLayout,n=a._fullData,s=i._subplots[t],c=0;c0){R=c[P];break}return R}function T(g,m){if(!(g<1||m<1)){for(var R=v(g),P=v(m),z=1,F=0;FS;)P--,P/=h(P),P++,P1?z:1};function M(g,m,R){var P=R[8]+R[2]*m[0]+R[5]*m[1];return g[0]=(R[6]+R[0]*m[0]+R[3]*m[1])/P,g[1]=(R[7]+R[1]*m[0]+R[4]*m[1])/P,g}function _(g,m,R){return w(g,m,M,R),g}function w(g,m,R,P){for(var z=[0,0],F=g.shape[0],B=g.shape[1],O=0;O0&&this.contourStart[P]!==null&&this.contourEnd[P]!==null&&this.contourEnd[P]>this.contourStart[P]))for(m[P]=!0,z=this.contourStart[P];zQ&&(this.minValues[N]=Q),this.maxValues[N]c&&(o.isomin=null,o.isomax=null);var f=n("x"),v=n("y"),h=n("z"),T=n("value");if(!f||!f.length||!v||!v.length||!h||!h.length||!T||!T.length){o.visible=!1;return}var l=x.getComponentMethod("calendars","handleTraceDefaults");l(r,o,["x","y","z"],i),n("valuehoverformat"),["x","y","z"].forEach(function(M){n(M+"hoverformat");var _="caps."+M,w=n(_+".show");w&&n(_+".fill");var p="slices."+M,u=n(p+".show");u&&(n(p+".fill"),n(p+".locations"))});var y=n("spaceframe.show");y&&n("spaceframe.fill");var b=n("surface.show");b&&(n("surface.count"),n("surface.fill"),n("surface.pattern"));var S=n("contour.show");S&&(n("contour.color"),n("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(M){n(M)}),E(r,o,i,n,{prefix:"",cLetter:"c"}),o._length=null}G.exports={supplyDefaults:e,supplyIsoDefaults:t}}}),N_=He({"src/traces/streamtube/calc.js"(Y,G){var d=Gr(),x=Sh();function A(r,o){o._len=Math.min(o.u.length,o.v.length,o.w.length,o.x.length,o.y.length,o.z.length),o._u=t(o.u,o._len),o._v=t(o.v,o._len),o._w=t(o.w,o._len),o._x=t(o.x,o._len),o._y=t(o.y,o._len),o._z=t(o.z,o._len);var a=E(o);o._gridFill=a.fill,o._Xs=a.Xs,o._Ys=a.Ys,o._Zs=a.Zs,o._len=a.len;var i=0,n,s,c;o.starts&&(n=t(o.starts.x||[]),s=t(o.starts.y||[]),c=t(o.starts.z||[]),i=Math.min(n.length,s.length,c.length)),o._startsX=n||[],o._startsY=s||[],o._startsZ=c||[];var f=0,v=1/0,h;for(h=0;h1&&(u=o[n-1],m=a[n-1],P=i[n-1]),s=0;su?"-":"+")+"x"),S=S.replace("y",(g>m?"-":"+")+"y"),S=S.replace("z",(R>P?"-":"+")+"z");var O=function(){n=0,z=[],F=[],B=[]};(!n||n0;v--){var h=Math.min(f[v],f[v-1]),T=Math.max(f[v],f[v-1]);if(T>h&&h-1}function ae(pt,ze){return pt===null?ze:pt}function ie(pt,ze,Ge){ue();var Oe=[ze],ve=[Ge];if(X>=1)Oe=[ze],ve=[Ge];else if(X>0){var ge=ee(ze,Ge);Oe=ge.xyzv,ve=ge.abc}for(var be=0;be-1?Ge[We]:Q(ct,_t,Mt);Bt>-1?Pe[We]=Bt:Pe[We]=le(ct,_t,Mt,ae(pt,Nt))}j(Pe[0],Pe[1],Pe[2])}}function fe(pt,ze,Ge){var Oe=function(ve,ge,be){ie(pt,[ze[ve],ze[ge],ze[be]],[Ge[ve],Ge[ge],Ge[be]])};Oe(0,1,2),Oe(2,3,0)}function we(pt,ze,Ge){var Oe=function(ve,ge,be){ie(pt,[ze[ve],ze[ge],ze[be]],[Ge[ve],Ge[ge],Ge[be]])};Oe(0,1,2),Oe(3,0,1),Oe(2,3,0),Oe(1,2,3)}function Ae(pt,ze,Ge,Oe){var ve=pt[3];veOe&&(ve=Oe);for(var ge=(pt[3]-ve)/(pt[3]-ze[3]+1e-9),be=[],Pe=0;Pe<4;Pe++)be[Pe]=(1-ge)*pt[Pe]+ge*ze[Pe];return be}function Fe(pt,ze,Ge){return pt>=ze&&pt<=Ge}function Ce(pt){var ze=.001*(O-B);return pt>=B-ze&&pt<=O+ze}function qe(pt){for(var ze=[],Ge=0;Ge<4;Ge++){var Oe=pt[Ge];ze.push([c._x[Oe],c._y[Oe],c._z[Oe],c._value[Oe]])}return ze}var et=3;function Qe(pt,ze,Ge,Oe,ve,ge){ge||(ge=1),Ge=[-1,-1,-1];var be=!1,Pe=[Fe(ze[0][3],Oe,ve),Fe(ze[1][3],Oe,ve),Fe(ze[2][3],Oe,ve)];if(!Pe[0]&&!Pe[1]&&!Pe[2])return!1;var We=function(_t,Mt,Nt){return Ce(Mt[0][3])&&Ce(Mt[1][3])&&Ce(Mt[2][3])?(ie(_t,Mt,Nt),!0):gePe?[z,ge]:[ge,F];Rt(ze,We[0],We[1])}}var ct=[[Math.min(B,F),Math.max(B,F)],[Math.min(z,O),Math.max(z,O)]];["x","y","z"].forEach(function(_t){for(var Mt=[],Nt=0;Nt0&&(da.push(Ia.id),_t==="x"?wa.push([Ia.distRatio,0,0]):_t==="y"?wa.push([0,Ia.distRatio,0]):wa.push([0,0,Ia.distRatio]))}else _t==="x"?ta=Mr(1,u-1):_t==="y"?ta=Mr(1,g-1):ta=Mr(1,m-1);da.length>0&&(_t==="x"?Mt[Bt]=Ut(pt,da,qt,Zt,wa,Mt[Bt]):_t==="y"?Mt[Bt]=ir(pt,da,qt,Zt,wa,Mt[Bt]):Mt[Bt]=ar(pt,da,qt,Zt,wa,Mt[Bt]),Bt++),ta.length>0&&(_t==="x"?Mt[Bt]=$e(pt,ta,qt,Zt,Mt[Bt]):_t==="y"?Mt[Bt]=rt(pt,ta,qt,Zt,Mt[Bt]):Mt[Bt]=Je(pt,ta,qt,Zt,Mt[Bt]),Bt++)}var va=c.caps[_t];va.show&&va.fill&&(re(va.fill),_t==="x"?Mt[Bt]=$e(pt,[0,u-1],qt,Zt,Mt[Bt]):_t==="y"?Mt[Bt]=rt(pt,[0,g-1],qt,Zt,Mt[Bt]):Mt[Bt]=Je(pt,[0,m-1],qt,Zt,Mt[Bt]),Bt++)}}),b===0&&oe(),c._meshX=L,c._meshY=N,c._meshZ=U,c._meshIntensity=Z,c._Xs=_,c._Ys=w,c._Zs=p}return dr(),c}function s(c,f){var v=c.glplot.gl,h=d({gl:v}),T=new o(c,h,f.uid);return h._trace=T,T.update(f),c.glplot.add(h),T}G.exports={findNearestOnAxis:r,generateIsoMeshes:n,createIsosurfaceTrace:s}}}),HL=He({"src/traces/isosurface/index.js"(Y,G){G.exports={attributes:B_(),supplyDefaults:F3().supplyDefaults,calc:O3(),colorbar:{min:"cmin",max:"cmax"},plot:U_().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:ap(),categories:["gl3d","showLegend"],meta:{}}}}),GL=He({"lib/isosurface.js"(Y,G){G.exports=HL()}}),B3=He({"src/traces/volume/attributes.js"(Y,G){var d=kl(),x=B_(),A=Uy(),E=cl(),e=ho().extendFlat,t=hu().overrideAll,r=G.exports=t(e({x:x.x,y:x.y,z:x.z,value:x.value,isomin:x.isomin,isomax:x.isomax,surface:x.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:x.slices,caps:x.caps,text:x.text,hovertext:x.hovertext,xhoverformat:x.xhoverformat,yhoverformat:x.yhoverformat,zhoverformat:x.zhoverformat,valuehoverformat:x.valuehoverformat,hovertemplate:x.hovertemplate},d("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:x.colorbar,opacity:x.opacity,opacityscale:A.opacityscale,lightposition:x.lightposition,lighting:x.lighting,flatshading:x.flatshading,contour:x.contour,hoverinfo:e({},E.hoverinfo),showlegend:e({},E.showlegend,{dflt:!1})}),"calc","nested");r.x.editType=r.y.editType=r.z.editType=r.value.editType="calc+clearAxisTypes"}}),WL=He({"src/traces/volume/defaults.js"(Y,G){var d=Gr(),x=B3(),A=F3().supplyIsoDefaults,E=z3().opacityscaleDefaults;G.exports=function(t,r,o,a){function i(n,s){return d.coerce(t,r,x,n,s)}A(t,r,o,a,i),E(t,r,a,i)}}}),ZL=He({"src/traces/volume/convert.js"(Y,G){var d=Hf().gl_mesh3d,x=fd().parseColorScale,A=Gr().isArrayOrTypedArray,E=cd(),e=Kl().extractOpts,t=lg(),r=U_().findNearestOnAxis,o=U_().generateIsoMeshes;function a(s,c,f){this.scene=s,this.uid=f,this.mesh=c,this.name="",this.data=null,this.showContour=!1}var i=a.prototype;i.handlePick=function(s){if(s.object===this.mesh){var c=s.data.index,f=this.data._meshX[c],v=this.data._meshY[c],h=this.data._meshZ[c],T=this.data._Ys.length,l=this.data._Zs.length,y=r(f,this.data._Xs).id,b=r(v,this.data._Ys).id,S=r(h,this.data._Zs).id,M=s.index=S+l*b+l*T*y;s.traceCoordinate=[this.data._meshX[M],this.data._meshY[M],this.data._meshZ[M],this.data._value[M]];var _=this.data.hovertext||this.data.text;return A(_)&&_[M]!==void 0?s.textLabel=_[M]:_&&(s.textLabel=_),!0}},i.update=function(s){var c=this.scene,f=c.fullSceneLayout;this.data=o(s);function v(b,S,M,_){return S.map(function(w){return b.d2l(w,0,_)*M})}var h=t(v(f.xaxis,s._meshX,c.dataScale[0],s.xcalendar),v(f.yaxis,s._meshY,c.dataScale[1],s.ycalendar),v(f.zaxis,s._meshZ,c.dataScale[2],s.zcalendar)),T=t(s._meshI,s._meshJ,s._meshK),l={positions:h,cells:T,lightPosition:[s.lightposition.x,s.lightposition.y,s.lightposition.z],ambient:s.lighting.ambient,diffuse:s.lighting.diffuse,specular:s.lighting.specular,roughness:s.lighting.roughness,fresnel:s.lighting.fresnel,vertexNormalsEpsilon:s.lighting.vertexnormalsepsilon,faceNormalsEpsilon:s.lighting.facenormalsepsilon,opacity:s.opacity,opacityscale:s.opacityscale,contourEnable:s.contour.show,contourColor:E(s.contour.color).slice(0,3),contourWidth:s.contour.width,useFacetNormals:s.flatshading},y=e(s);l.vertexIntensity=s._meshIntensity,l.vertexIntensityBounds=[y.min,y.max],l.colormap=x(s),this.mesh.update(l)},i.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function n(s,c){var f=s.glplot.gl,v=d({gl:f}),h=new a(s,v,c.uid);return v._trace=h,h.update(c),s.glplot.add(v),h}G.exports=n}}),XL=He({"src/traces/volume/index.js"(Y,G){G.exports={attributes:B3(),supplyDefaults:WL(),calc:O3(),colorbar:{min:"cmin",max:"cmax"},plot:ZL(),moduleType:"trace",name:"volume",basePlotModule:ap(),categories:["gl3d","showLegend"],meta:{}}}}),YL=He({"lib/volume.js"(Y,G){G.exports=XL()}}),KL=He({"src/traces/mesh3d/defaults.js"(Y,G){var d=Ei(),x=Gr(),A=pf(),E=sg();G.exports=function(t,r,o,a){function i(v,h){return x.coerce(t,r,E,v,h)}function n(v){var h=v.map(function(T){var l=i(T);return l&&x.isArrayOrTypedArray(l)?l:null});return h.every(function(T){return T&&T.length===h[0].length})&&h}var s=n(["x","y","z"]);if(!s){r.visible=!1;return}if(n(["i","j","k"]),r.i&&(!r.j||!r.k)||r.j&&(!r.k||!r.i)||r.k&&(!r.i||!r.j)){r.visible=!1;return}var c=d.getComponentMethod("calendars","handleTraceDefaults");c(t,r,["x","y","z"],a),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(v){i(v)});var f=i("contour.show");f&&(i("contour.color"),i("contour.width")),"intensity"in t?(i("intensity"),i("intensitymode"),A(t,r,a,i,{prefix:"",cLetter:"c"})):(r.showscale=!1,"facecolor"in t?i("facecolor"):"vertexcolor"in t?i("vertexcolor"):i("color",o)),i("text"),i("hovertext"),i("hovertemplate"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),r._length=null}}}),JL=He({"src/traces/mesh3d/calc.js"(Y,G){var d=Sh();G.exports=function(A,E){E.intensity&&d(A,E,{vals:E.intensity,containerStr:"",cLetter:"c"})}}}),$L=He({"src/traces/mesh3d/convert.js"(Y,G){var d=Hf().gl_mesh3d,x=Hf().delaunay_triangulate,A=Hf().alpha_shape,E=Hf().convex_hull,e=fd().parseColorScale,t=Gr().isArrayOrTypedArray,r=cd(),o=Kl().extractOpts,a=lg();function i(l,y,b){this.scene=l,this.uid=b,this.mesh=y,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var n=i.prototype;n.handlePick=function(l){if(l.object===this.mesh){var y=l.index=l.data.index;l.data._cellCenter?l.traceCoordinate=l.data.dataCoordinate:l.traceCoordinate=[this.data.x[y],this.data.y[y],this.data.z[y]];var b=this.data.hovertext||this.data.text;return t(b)&&b[y]!==void 0?l.textLabel=b[y]:b&&(l.textLabel=b),!0}};function s(l){for(var y=[],b=l.length,S=0;S=y-.5)return!1;return!0}n.update=function(l){var y=this.scene,b=y.fullSceneLayout;this.data=l;var S=l.x.length,M=a(c(b.xaxis,l.x,y.dataScale[0],l.xcalendar),c(b.yaxis,l.y,y.dataScale[1],l.ycalendar),c(b.zaxis,l.z,y.dataScale[2],l.zcalendar)),_;if(l.i&&l.j&&l.k){if(l.i.length!==l.j.length||l.j.length!==l.k.length||!h(l.i,S)||!h(l.j,S)||!h(l.k,S))return;_=a(f(l.i),f(l.j),f(l.k))}else l.alphahull===0?_=E(M):l.alphahull>0?_=A(l.alphahull,M):_=v(l.delaunayaxis,M);var w={positions:M,cells:_,lightPosition:[l.lightposition.x,l.lightposition.y,l.lightposition.z],ambient:l.lighting.ambient,diffuse:l.lighting.diffuse,specular:l.lighting.specular,roughness:l.lighting.roughness,fresnel:l.lighting.fresnel,vertexNormalsEpsilon:l.lighting.vertexnormalsepsilon,faceNormalsEpsilon:l.lighting.facenormalsepsilon,opacity:l.opacity,contourEnable:l.contour.show,contourColor:r(l.contour.color).slice(0,3),contourWidth:l.contour.width,useFacetNormals:l.flatshading};if(l.intensity){var p=o(l);this.color="#fff";var u=l.intensitymode;w[u+"Intensity"]=l.intensity,w[u+"IntensityBounds"]=[p.min,p.max],w.colormap=e(l)}else l.vertexcolor?(this.color=l.vertexcolor[0],w.vertexColors=s(l.vertexcolor)):l.facecolor?(this.color=l.facecolor[0],w.cellColors=s(l.facecolor)):(this.color=l.color,w.meshColor=r(l.color));this.mesh.update(w)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function T(l,y){var b=l.glplot.gl,S=d({gl:b}),M=new i(l,S,y.uid);return S._trace=M,M.update(y),l.glplot.add(S),M}G.exports=T}}),QL=He({"src/traces/mesh3d/index.js"(Y,G){G.exports={attributes:sg(),supplyDefaults:KL(),calc:JL(),colorbar:{min:"cmin",max:"cmax"},plot:$L(),moduleType:"trace",name:"mesh3d",basePlotModule:ap(),categories:["gl3d","showLegend"],meta:{}}}}),eP=He({"lib/mesh3d.js"(Y,G){G.exports=QL()}}),N3=He({"src/traces/cone/attributes.js"(Y,G){var d=kl(),x=Gu().axisHoverFormat,A=Yo().hovertemplateAttrs,E=sg(),e=cl(),t=ho().extendFlat,r={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:A({editType:"calc"},{keys:["norm"]}),uhoverformat:x("u",1),vhoverformat:x("v",1),whoverformat:x("w",1),xhoverformat:x("x"),yhoverformat:x("y"),zhoverformat:x("z"),showlegend:t({},e.showlegend,{dflt:!1})};t(r,d("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var o=["opacity","lightposition","lighting"];o.forEach(function(a){r[a]=E[a]}),r.hoverinfo=t({},e.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),G.exports=r}}),tP=He({"src/traces/cone/defaults.js"(Y,G){var d=Gr(),x=pf(),A=N3();G.exports=function(e,t,r,o){function a(T,l){return d.coerce(e,t,A,T,l)}var i=a("u"),n=a("v"),s=a("w"),c=a("x"),f=a("y"),v=a("z");if(!i||!i.length||!n||!n.length||!s||!s.length||!c||!c.length||!f||!f.length||!v||!v.length){t.visible=!1;return}var h=a("sizemode");a("sizeref",h==="raw"?1:.5),a("anchor"),a("lighting.ambient"),a("lighting.diffuse"),a("lighting.specular"),a("lighting.roughness"),a("lighting.fresnel"),a("lightposition.x"),a("lightposition.y"),a("lightposition.z"),x(e,t,o,a,{prefix:"",cLetter:"c"}),a("text"),a("hovertext"),a("hovertemplate"),a("uhoverformat"),a("vhoverformat"),a("whoverformat"),a("xhoverformat"),a("yhoverformat"),a("zhoverformat"),t._length=null}}}),rP=He({"src/traces/cone/calc.js"(Y,G){var d=Sh();G.exports=function(A,E){for(var e=E.u,t=E.v,r=E.w,o=Math.min(E.x.length,E.y.length,E.z.length,e.length,t.length,r.length),a=-1/0,i=1/0,n=0;n2?h=f.slice(1,v-1):v===2?h=[(f[0]+f[1])/2]:h=f,h}function n(f){var v=f.length;return v===1?[.5,.5]:[f[1]-f[0],f[v-1]-f[v-2]]}function s(f,v){var h=f.fullSceneLayout,T=f.dataScale,l=v._len,y={};function b(le,j){var J=h[j],$=T[r[j]];return A.simpleMap(le,function(X){return J.d2l(X)*$})}if(y.vectors=t(b(v._u,"xaxis"),b(v._v,"yaxis"),b(v._w,"zaxis"),l),!l)return{positions:[],cells:[]};var S=b(v._Xs,"xaxis"),M=b(v._Ys,"yaxis"),_=b(v._Zs,"zaxis");y.meshgrid=[S,M,_],y.gridFill=v._gridFill;var w=v._slen;if(w)y.startingPositions=t(b(v._startsX,"xaxis"),b(v._startsY,"yaxis"),b(v._startsZ,"zaxis"));else{for(var p=M[0],u=i(S),g=i(_),m=new Array(u.length*g.length),R=0,P=0;Pp&&(p=R[0]),R[1]u&&(u=R[1])}function m(R){switch(R.type){case"GeometryCollection":R.geometries.forEach(m);break;case"Point":g(R.coordinates);break;case"MultiPoint":R.coordinates.forEach(g);break}}b.arcs.forEach(function(R){for(var P=-1,z=R.length,F;++Pp&&(p=F[0]),F[1]u&&(u=F[1])});for(M in b.objects)m(b.objects[M]);return[_,w,p,u]}function e(b,S){for(var M,_=b.length,w=_-S;w<--_;)M=b[w],b[w++]=b[_],b[_]=M}function t(b,S){return typeof S=="string"&&(S=b.objects[S]),S.type==="GeometryCollection"?{type:"FeatureCollection",features:S.geometries.map(function(M){return r(b,M)})}:r(b,S)}function r(b,S){var M=S.id,_=S.bbox,w=S.properties==null?{}:S.properties,p=o(b,S);return M==null&&_==null?{type:"Feature",properties:w,geometry:p}:_==null?{type:"Feature",id:M,properties:w,geometry:p}:{type:"Feature",id:M,bbox:_,properties:w,geometry:p}}function o(b,S){var M=A(b.transform),_=b.arcs;function w(P,z){z.length&&z.pop();for(var F=_[P<0?~P:P],B=0,O=F.length;B1)_=s(b,S,M);else for(w=0,_=new Array(p=b.arcs.length);w1)for(var z=1,F=g(R[0]),B,O;zF&&(O=R[0],R[0]=R[z],R[z]=O,F=B);return R}).filter(function(m){return m.length>0})}}function h(b,S){for(var M=0,_=b.length;M<_;){var w=M+_>>>1;b[w]=2))throw new Error("n must be ≥2");m=b.bbox||E(b);var M=m[0],_=m[1],w=m[2],p=m[3],u;S={scale:[w-M?(w-M)/(u-1):1,p-_?(p-_)/(u-1):1],translate:[M,_]}}else m=b.bbox;var g=l(S),m,R,P=b.objects,z={};function F(L){return g(L)}function B(L){var N;switch(L.type){case"GeometryCollection":N={type:"GeometryCollection",geometries:L.geometries.map(B)};break;case"Point":N={type:"Point",coordinates:F(L.coordinates)};break;case"MultiPoint":N={type:"MultiPoint",coordinates:L.coordinates.map(F)};break;default:return L}return L.id!=null&&(N.id=L.id),L.bbox!=null&&(N.bbox=L.bbox),L.properties!=null&&(N.properties=L.properties),N}function O(L){var N=0,U=1,Z=L.length,Q,ue=new Array(Z);for(ue[0]=g(L[0],0);++N0&&(E.push(e),e=[])}return e.length>0&&E.push(e),E},Y.makeLine=function(d){return d.length===1?{type:"LineString",coordinates:d[0]}:{type:"MultiLineString",coordinates:d}},Y.makePolygon=function(d){if(d.length===1)return{type:"Polygon",coordinates:d};for(var x=new Array(d.length),A=0;Ae(B,z)),F)}function r(P,z,F={}){for(const O of P){if(O.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(O[O.length-1].length!==O[0].length)throw new Error("First and last Position are not equivalent.");for(let L=0;Lr(B,z)),F)}function a(P,z,F={}){if(P.length<2)throw new Error("coordinates must be an array of two or more positions");return A({type:"LineString",coordinates:P},z,F)}function i(P,z,F={}){return n(P.map(B=>a(B,z)),F)}function n(P,z={}){const F={type:"FeatureCollection"};return z.id&&(F.id=z.id),z.bbox&&(F.bbox=z.bbox),F.features=P,F}function s(P,z,F={}){return A({type:"MultiLineString",coordinates:P},z,F)}function c(P,z,F={}){return A({type:"MultiPoint",coordinates:P},z,F)}function f(P,z,F={}){return A({type:"MultiPolygon",coordinates:P},z,F)}function v(P,z,F={}){return A({type:"GeometryCollection",geometries:P},z,F)}function h(P,z=0){if(z&&!(z>=0))throw new Error("precision must be a positive number");const F=Math.pow(10,z||0);return Math.round(P*F)/F}function T(P,z="kilometers"){const F=d[z];if(!F)throw new Error(z+" units is invalid");return P*F}function l(P,z="kilometers"){const F=d[z];if(!F)throw new Error(z+" units is invalid");return P/F}function y(P,z){return M(l(P,z))}function b(P){let z=P%360;return z<0&&(z+=360),z}function S(P){return P=P%360,P>0?P>180?P-360:P:P<-180?P+360:P}function M(P){return P%(2*Math.PI)*180/Math.PI}function _(P){return P%360*Math.PI/180}function w(P,z="kilometers",F="kilometers"){if(!(P>=0))throw new Error("length must be a positive number");return T(l(P,z),F)}function p(P,z="meters",F="kilometers"){if(!(P>=0))throw new Error("area must be a positive number");const B=x[z];if(!B)throw new Error("invalid original units");const O=x[F];if(!O)throw new Error("invalid final units");return P/B*O}function u(P){return!isNaN(P)&&P!==null&&!Array.isArray(P)}function g(P){return P!==null&&typeof P=="object"&&!Array.isArray(P)}function m(P){if(!P)throw new Error("bbox is required");if(!Array.isArray(P))throw new Error("bbox must be an Array");if(P.length!==4&&P.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");P.forEach(z=>{if(!u(z))throw new Error("bbox must only contain numbers")})}function R(P){if(!P)throw new Error("id is required");if(["string","number"].indexOf(typeof P)===-1)throw new Error("id must be a number or a string")}Y.areaFactors=x,Y.azimuthToBearing=S,Y.bearingToAzimuth=b,Y.convertArea=p,Y.convertLength=w,Y.degreesToRadians=_,Y.earthRadius=G,Y.factors=d,Y.feature=A,Y.featureCollection=n,Y.geometry=E,Y.geometryCollection=v,Y.isNumber=u,Y.isObject=g,Y.lengthToDegrees=y,Y.lengthToRadians=l,Y.lineString=a,Y.lineStrings=i,Y.multiLineString=s,Y.multiPoint=c,Y.multiPolygon=f,Y.point=e,Y.points=t,Y.polygon=r,Y.polygons=o,Y.radiansToDegrees=M,Y.radiansToLength=T,Y.round=h,Y.validateBBox=m,Y.validateId=R}}),H_=He({"node_modules/@turf/meta/dist/cjs/index.cjs"(Y){Object.defineProperty(Y,"__esModule",{value:!0});var G=q_();function d(l,y,b){if(l!==null)for(var S,M,_,w,p,u,g,m=0,R=0,P,z=l.type,F=z==="FeatureCollection",B=z==="Feature",O=F?l.features.length:1,L=0;Lu||F>g||B>m){p=R,u=S,g=F,m=B,_=0;return}var O=G.lineString.call(void 0,[p,R],b.properties);if(y(O,S,M,B,_)===!1)return!1;_++,p=R})===!1)return!1}}})}function c(l,y,b){var S=b,M=!1;return s(l,function(_,w,p,u,g){M===!1&&b===void 0?S=_:S=y(S,_,w,p,u,g),M=!0}),S}function f(l,y){if(!l)throw new Error("geojson is required");i(l,function(b,S,M){if(b.geometry!==null){var _=b.geometry.type,w=b.geometry.coordinates;switch(_){case"LineString":if(y(b,S,M,0,0)===!1)return!1;break;case"Polygon":for(var p=0;pi+A(n),0)}function A(a){let i=0,n;switch(a.type){case"Polygon":return E(a.coordinates);case"MultiPolygon":for(n=0;n0){i+=Math.abs(r(a[0]));for(let n=1;n=i?(s+2)%i:s+2],h=c[0]*t,T=f[1]*t,l=v[0]*t;n+=(l-h)*Math.sin(T),s++}return n*e}var o=x;Y.area=x,Y.default=o}}),dP=He({"node_modules/@turf/centroid/dist/cjs/index.cjs"(Y){Object.defineProperty(Y,"__esModule",{value:!0});var G=q_(),d=H_();function x(E,e={}){let t=0,r=0,o=0;return d.coordEach.call(void 0,E,function(a){t+=a[0],r+=a[1],o++},!0),G.point.call(void 0,[t/o,r/o],e.properties)}var A=x;Y.centroid=x,Y.default=A}}),pP=He({"node_modules/@turf/bbox/dist/cjs/index.cjs"(Y){Object.defineProperty(Y,"__esModule",{value:!0});var G=H_();function d(A,E={}){if(A.bbox!=null&&E.recompute!==!0)return A.bbox;const e=[1/0,1/0,-1/0,-1/0];return G.coordEach.call(void 0,A,t=>{e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]0&&z[F+1][0]<0)return F;return null}switch(w==="RUS"||w==="FJI"?u=function(z){var F;if(P(z)===null)F=z;else for(F=new Array(z.length),R=0;RF?B[O++]=[z[R][0]+360,z[R][1]]:R===F?(B[O++]=z[R],B[O++]=[z[R][0],-90]):B[O++]=z[R];var L=i.tester(B);L.pts.pop(),p.push(L)}:u=function(z){p.push(i.tester(z))},M.type){case"MultiPolygon":for(g=0;g<_.length;g++)for(m=0;m<_[g].length;m++)u(_[g][m]);break;case"Polygon":for(g=0;g<_.length;g++)u(_[g]);break}return p}function h(S){var M=S.geojson,_=window.PlotlyGeoAssets||{},w=typeof M=="string"?_[M]:M;return o(w)?w:(r.error("Oops ... something went wrong when fetching "+M),!1)}function T(S){var M=S[0].trace,_=h(M);if(!_)return!1;var w={},p=[],u;for(u=0;u0?L.properties.ct=l(L):L.properties.ct=[NaN,NaN],B.fIn=z,B.fOut=L,p.push(L)}else r.log(["Location",B.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete w[F]}switch(_.type){case"FeatureCollection":var R=_.features;for(u=0;up&&(p=m,_=g)}else _=M;return E(_).geometry.coordinates}function y(S){var M=window.PlotlyGeoAssets||{},_=[];function w(R){return new Promise(function(P,z){d.json(R,function(F,B){if(F){delete M[R];var O=F.status===404?'GeoJSON at URL "'+R+'" does not exist.':"Unexpected error while fetching from "+R;return z(new Error(O))}return M[R]=B,P(B)})})}function p(R){return new Promise(function(P,z){var F=0,B=setInterval(function(){if(M[R]&&M[R]!=="pending")return clearInterval(B),P(M[R]);if(F>100)return clearInterval(B),z("Unexpected error while fetching from "+R);F++},50)})}for(var u=0;u")}}}),yP=He({"src/traces/scattergeo/event_data.js"(Y,G){G.exports=function(x,A,E,e,t){x.lon=A.lon,x.lat=A.lat,x.location=A.loc?A.loc:null;var r=e[t];return r.fIn&&r.fIn.properties&&(x.properties=r.fIn.properties),x}}}),mP=He({"src/traces/scattergeo/select.js"(Y,G){var d=Rl(),x=lo().BADNUM;G.exports=function(E,e){var t=E.cd,r=E.xaxis,o=E.yaxis,a=[],i=t[0].trace,n,s,c,f,v,h=!d.hasMarkers(i)&&!d.hasText(i);if(h)return[];if(e===!1)for(v=0;vX?1:$>=X?0:NaN}function A($){return $.length===1&&($=E($)),{left:function(X,re,ee,q){for(ee==null&&(ee=0),q==null&&(q=X.length);ee>>1;$(X[ae],re)<0?ee=ae+1:q=ae}return ee},right:function(X,re,ee,q){for(ee==null&&(ee=0),q==null&&(q=X.length);ee>>1;$(X[ae],re)>0?q=ae:ee=ae+1}return ee}}}function E($){return function(X,re){return x($(X),re)}}var e=A(x),t=e.right,r=e.left;function o($,X){X==null&&(X=a);for(var re=0,ee=$.length-1,q=$[0],ae=new Array(ee<0?0:ee);re$?1:X>=$?0:NaN}function s($){return $===null?NaN:+$}function c($,X){var re=$.length,ee=0,q=-1,ae=0,ie,fe,we=0;if(X==null)for(;++q1)return we/(ee-1)}function f($,X){var re=c($,X);return re&&Math.sqrt(re)}function v($,X){var re=$.length,ee=-1,q,ae,ie;if(X==null){for(;++ee=q)for(ae=ie=q;++eeq&&(ae=q),ie=q)for(ae=ie=q;++eeq&&(ae=q),ie0)return[$];if((ee=X<$)&&(ae=$,$=X,X=ae),(fe=u($,X,re))===0||!isFinite(fe))return[];if(fe>0)for($=Math.ceil($/fe),X=Math.floor(X/fe),ie=new Array(ae=Math.ceil(X-$+1));++q=0?(ae>=M?10:ae>=_?5:ae>=w?2:1)*Math.pow(10,q):-Math.pow(10,-q)/(ae>=M?10:ae>=_?5:ae>=w?2:1)}function g($,X,re){var ee=Math.abs(X-$)/Math.max(0,re),q=Math.pow(10,Math.floor(Math.log(ee)/Math.LN10)),ae=ee/q;return ae>=M?q*=10:ae>=_?q*=5:ae>=w&&(q*=2),X<$?-q:q}function m($){return Math.ceil(Math.log($.length)/Math.LN2)+1}function R(){var $=b,X=v,re=m;function ee(q){var ae,ie=q.length,fe,we=new Array(ie);for(ae=0;aeCe;)qe.pop(),--et;var Qe=new Array(et+1),Ke;for(ae=0;ae<=et;++ae)Ke=Qe[ae]=[],Ke.x0=ae>0?qe[ae-1]:Fe,Ke.x1=ae=1)return+re($[ee-1],ee-1,$);var ee,q=(ee-1)*X,ae=Math.floor(q),ie=+re($[ae],ae,$),fe=+re($[ae+1],ae+1,$);return ie+(fe-ie)*(q-ae)}}function z($,X,re){return $=l.call($,s).sort(x),Math.ceil((re-X)/(2*(P($,.75)-P($,.25))*Math.pow($.length,-1/3)))}function F($,X,re){return Math.ceil((re-X)/(3.5*f($)*Math.pow($.length,-1/3)))}function B($,X){var re=$.length,ee=-1,q,ae;if(X==null){for(;++ee=q)for(ae=q;++eeae&&(ae=q)}else for(;++ee=q)for(ae=q;++eeae&&(ae=q);return ae}function O($,X){var re=$.length,ee=re,q=-1,ae,ie=0;if(X==null)for(;++q=0;)for(ie=$[X],re=ie.length;--re>=0;)ae[--q]=ie[re];return ae}function U($,X){var re=$.length,ee=-1,q,ae;if(X==null){for(;++ee=q)for(ae=q;++eeq&&(ae=q)}else for(;++ee=q)for(ae=q;++eeq&&(ae=q);return ae}function Z($,X){for(var re=X.length,ee=new Array(re);re--;)ee[re]=$[X[re]];return ee}function Q($,X){if(re=$.length){var re,ee=0,q=0,ae,ie=$[q];for(X==null&&(X=x);++ee0?1:Ht<0?-1:0},p=Math.sqrt,u=Math.tan;function g(Ht){return Ht>1?0:Ht<-1?a:Math.acos(Ht)}function m(Ht){return Ht>1?i:Ht<-1?-i:Math.asin(Ht)}function R(Ht){return(Ht=_(Ht/2))*Ht}function P(){}function z(Ht,ur){Ht&&B.hasOwnProperty(Ht.type)&&B[Ht.type](Ht,ur)}var F={Feature:function(Ht,ur){z(Ht.geometry,ur)},FeatureCollection:function(Ht,ur){for(var qr=Ht.features,Or=-1,ua=qr.length;++Or=0?1:-1,ua=Or*qr,Fa=l(ur),ja=_(ur),sn=j*ja,gn=le*Fa+sn*l(ua),kn=sn*Or*_(ua);U.add(T(kn,gn)),oe=Ht,le=Fa,j=ja}function q(Ht){return Z.reset(),N(Ht,J),Z*2}function ae(Ht){return[T(Ht[1],Ht[0]),m(Ht[2])]}function ie(Ht){var ur=Ht[0],qr=Ht[1],Or=l(qr);return[Or*l(ur),Or*_(ur),_(qr)]}function fe(Ht,ur){return Ht[0]*ur[0]+Ht[1]*ur[1]+Ht[2]*ur[2]}function we(Ht,ur){return[Ht[1]*ur[2]-Ht[2]*ur[1],Ht[2]*ur[0]-Ht[0]*ur[2],Ht[0]*ur[1]-Ht[1]*ur[0]]}function Ae(Ht,ur){Ht[0]+=ur[0],Ht[1]+=ur[1],Ht[2]+=ur[2]}function Fe(Ht,ur){return[Ht[0]*ur,Ht[1]*ur,Ht[2]*ur]}function Ce(Ht){var ur=p(Ht[0]*Ht[0]+Ht[1]*Ht[1]+Ht[2]*Ht[2]);Ht[0]/=ur,Ht[1]/=ur,Ht[2]/=ur}var qe,et,Qe,Ke,Xe,Me,xe,ce,Re=A(),$e,rt,Je={point:At,lineStart:Rt,lineEnd:Ut,polygonStart:function(){Je.point=ir,Je.lineStart=ar,Je.lineEnd=Mr,Re.reset(),J.polygonStart()},polygonEnd:function(){J.polygonEnd(),Je.point=At,Je.lineStart=Rt,Je.lineEnd=Ut,U<0?(qe=-(Qe=180),et=-(Ke=90)):Re>r?Ke=90:Re<-r&&(et=-90),rt[0]=qe,rt[1]=Qe},sphere:function(){qe=-(Qe=180),et=-(Ke=90)}};function At(Ht,ur){$e.push(rt=[qe=Ht,Qe=Ht]),urKe&&(Ke=ur)}function St(Ht,ur){var qr=ie([Ht*f,ur*f]);if(ce){var Or=we(ce,qr),ua=[Or[1],-Or[0],0],Fa=we(ua,Or);Ce(Fa),Fa=ae(Fa);var ja=Ht-Xe,sn=ja>0?1:-1,gn=Fa[0]*c*sn,kn,Ja=v(ja)>180;Ja^(sn*XeKe&&(Ke=kn)):(gn=(gn+360)%360-180,Ja^(sn*XeKe&&(Ke=ur))),Ja?Htfr(qe,Qe)&&(Qe=Ht):fr(Ht,Qe)>fr(qe,Qe)&&(qe=Ht):Qe>=qe?(HtQe&&(Qe=Ht)):Ht>Xe?fr(qe,Ht)>fr(qe,Qe)&&(Qe=Ht):fr(Ht,Qe)>fr(qe,Qe)&&(qe=Ht)}else $e.push(rt=[qe=Ht,Qe=Ht]);urKe&&(Ke=ur),ce=qr,Xe=Ht}function Rt(){Je.point=St}function Ut(){rt[0]=qe,rt[1]=Qe,Je.point=At,ce=null}function ir(Ht,ur){if(ce){var qr=Ht-Xe;Re.add(v(qr)>180?qr+(qr>0?360:-360):qr)}else Me=Ht,xe=ur;J.point(Ht,ur),St(Ht,ur)}function ar(){J.lineStart()}function Mr(){ir(Me,xe),J.lineEnd(),v(Re)>r&&(qe=-(Qe=180)),rt[0]=qe,rt[1]=Qe,ce=null}function fr(Ht,ur){return(ur-=Ht)<0?ur+360:ur}function dr(Ht,ur){return Ht[0]-ur[0]}function pt(Ht,ur){return Ht[0]<=Ht[1]?Ht[0]<=ur&&ur<=Ht[1]:urfr(Or[0],Or[1])&&(Or[1]=ua[1]),fr(ua[0],Or[1])>fr(Or[0],Or[1])&&(Or[0]=ua[0])):Fa.push(Or=ua);for(ja=-1/0,qr=Fa.length-1,ur=0,Or=Fa[qr];ur<=qr;Or=ua,++ur)ua=Fa[ur],(sn=fr(Or[1],ua[0]))>ja&&(ja=sn,qe=ua[0],Qe=Or[1])}return $e=rt=null,qe===1/0||et===1/0?[[NaN,NaN],[NaN,NaN]]:[[qe,et],[Qe,Ke]]}var Ge,Oe,ve,ge,be,Pe,We,ct,_t,Mt,Nt,Bt,qt,Zt,lr,ta,da={sphere:P,point:wa,lineStart:Ia,lineEnd:Ka,polygonStart:function(){da.lineStart=Vt,da.lineEnd=Lt},polygonEnd:function(){da.lineStart=Ia,da.lineEnd=Ka}};function wa(Ht,ur){Ht*=f,ur*=f;var qr=l(ur);ma(qr*l(Ht),qr*_(Ht),_(ur))}function ma(Ht,ur,qr){++Ge,ve+=(Ht-ve)/Ge,ge+=(ur-ge)/Ge,be+=(qr-be)/Ge}function Ia(){da.point=va}function va(Ht,ur){Ht*=f,ur*=f;var qr=l(ur);Zt=qr*l(Ht),lr=qr*_(Ht),ta=_(ur),da.point=La,ma(Zt,lr,ta)}function La(Ht,ur){Ht*=f,ur*=f;var qr=l(ur),Or=qr*l(Ht),ua=qr*_(Ht),Fa=_(ur),ja=T(p((ja=lr*Fa-ta*ua)*ja+(ja=ta*Or-Zt*Fa)*ja+(ja=Zt*ua-lr*Or)*ja),Zt*Or+lr*ua+ta*Fa);Oe+=ja,Pe+=ja*(Zt+(Zt=Or)),We+=ja*(lr+(lr=ua)),ct+=ja*(ta+(ta=Fa)),ma(Zt,lr,ta)}function Ka(){da.point=wa}function Vt(){da.point=jt}function Lt(){Ot(Bt,qt),da.point=wa}function jt(Ht,ur){Bt=Ht,qt=ur,Ht*=f,ur*=f,da.point=Ot;var qr=l(ur);Zt=qr*l(Ht),lr=qr*_(Ht),ta=_(ur),ma(Zt,lr,ta)}function Ot(Ht,ur){Ht*=f,ur*=f;var qr=l(ur),Or=qr*l(Ht),ua=qr*_(Ht),Fa=_(ur),ja=lr*Fa-ta*ua,sn=ta*Or-Zt*Fa,gn=Zt*ua-lr*Or,kn=p(ja*ja+sn*sn+gn*gn),Ja=m(kn),_n=kn&&-Ja/kn;_t+=_n*ja,Mt+=_n*sn,Nt+=_n*gn,Oe+=Ja,Pe+=Ja*(Zt+(Zt=Or)),We+=Ja*(lr+(lr=ua)),ct+=Ja*(ta+(ta=Fa)),ma(Zt,lr,ta)}function gr(Ht){Ge=Oe=ve=ge=be=Pe=We=ct=_t=Mt=Nt=0,N(Ht,da);var ur=_t,qr=Mt,Or=Nt,ua=ur*ur+qr*qr+Or*Or;return uaa?Ht+Math.round(-Ht/s)*s:Ht,ur]}Ur.invert=Ur;function ga(Ht,ur,qr){return(Ht%=s)?ur||qr?na(Pa(Ht),sa(ur,qr)):Pa(Ht):ur||qr?sa(ur,qr):Ur}function Aa(Ht){return function(ur,qr){return ur+=Ht,[ur>a?ur-s:ur<-a?ur+s:ur,qr]}}function Pa(Ht){var ur=Aa(Ht);return ur.invert=Aa(-Ht),ur}function sa(Ht,ur){var qr=l(Ht),Or=_(Ht),ua=l(ur),Fa=_(ur);function ja(sn,gn){var kn=l(gn),Ja=l(sn)*kn,_n=_(sn)*kn,on=_(gn),Wa=on*qr+Ja*Or;return[T(_n*ua-Wa*Fa,Ja*qr-on*Or),m(Wa*ua+_n*Fa)]}return ja.invert=function(sn,gn){var kn=l(gn),Ja=l(sn)*kn,_n=_(sn)*kn,on=_(gn),Wa=on*ua-_n*Fa;return[T(_n*ua+on*Fa,Ja*qr+Wa*Or),m(Wa*qr-Ja*Or)]},ja}function Oa(Ht){Ht=ga(Ht[0]*f,Ht[1]*f,Ht.length>2?Ht[2]*f:0);function ur(qr){return qr=Ht(qr[0]*f,qr[1]*f),qr[0]*=c,qr[1]*=c,qr}return ur.invert=function(qr){return qr=Ht.invert(qr[0]*f,qr[1]*f),qr[0]*=c,qr[1]*=c,qr},ur}function dt(Ht,ur,qr,Or,ua,Fa){if(qr){var ja=l(ur),sn=_(ur),gn=Or*qr;ua==null?(ua=ur+Or*s,Fa=ur-gn/2):(ua=vt(ja,ua),Fa=vt(ja,Fa),(Or>0?uaFa)&&(ua+=Or*s));for(var kn,Ja=ua;Or>0?Ja>Fa:Ja1&&Ht.push(Ht.pop().concat(Ht.shift()))},result:function(){var qr=Ht;return Ht=[],ur=null,qr}}}function _r(Ht,ur){return v(Ht[0]-ur[0])=0;--sn)ua.point((_n=Ja[sn])[0],_n[1]);else Or(on.x,on.p.x,-1,ua);on=on.p}on=on.o,Ja=on.z,Wa=!Wa}while(!on.v);ua.lineEnd()}}}function zr(Ht){if(ur=Ht.length){for(var ur,qr=0,Or=Ht[0],ua;++qr=0?1:-1,os=Ls*$o,As=os>a,jo=zi*Ki;if(Pr.add(T(jo*Ls*_(os),ki*ko+jo*l(os))),ja+=As?$o+Ls*s:$o,As^Wa>=qr^Bn>=qr){var il=we(ie(on),ie(Ni));Ce(il);var Qs=we(Fa,il);Ce(Qs);var Ss=(As^$o>=0?-1:1)*m(Qs[2]);(Or>Ss||Or===Ss&&(il[0]||il[1]))&&(sn+=As^$o>=0?1:-1)}}return(ja<-r||ja0){for(gn||(ua.polygonStart(),gn=!0),ua.lineStart(),ko=0;ko1&&An&2&&Ki.push(Ki.pop().concat(Ki.shift())),Ja.push(Ki.filter(wt))}}return on}}function wt(Ht){return Ht.length>1}function Qt(Ht,ur){return((Ht=Ht.x)[0]<0?Ht[1]-i-r:i-Ht[1])-((ur=ur.x)[0]<0?ur[1]-i-r:i-ur[1])}var mr=Jr(function(){return!0},$r,Sa,[-a,-i]);function $r(Ht){var ur=NaN,qr=NaN,Or=NaN,ua;return{lineStart:function(){Ht.lineStart(),ua=1},point:function(Fa,ja){var sn=Fa>0?a:-a,gn=v(Fa-ur);v(gn-a)0?i:-i),Ht.point(Or,qr),Ht.lineEnd(),Ht.lineStart(),Ht.point(sn,qr),Ht.point(Fa,qr),ua=0):Or!==sn&&gn>=a&&(v(ur-Or)r?h((_(ur)*(Fa=l(Or))*_(qr)-_(Or)*(ua=l(ur))*_(Ht))/(ua*Fa*ja)):(ur+Or)/2}function Sa(Ht,ur,qr,Or){var ua;if(Ht==null)ua=qr*i,Or.point(-a,ua),Or.point(0,ua),Or.point(a,ua),Or.point(a,0),Or.point(a,-ua),Or.point(0,-ua),Or.point(-a,-ua),Or.point(-a,0),Or.point(-a,ua);else if(v(Ht[0]-ur[0])>r){var Fa=Ht[0]0,ua=v(ur)>r;function Fa(Ja,_n,on,Wa){dt(Wa,Ht,qr,on,Ja,_n)}function ja(Ja,_n){return l(Ja)*l(_n)>ur}function sn(Ja){var _n,on,Wa,On,zi;return{lineStart:function(){On=Wa=!1,zi=1},point:function(ki,ji){var Ni=[ki,ji],Bn,An=ja(ki,ji),Ki=Or?An?0:kn(ki,ji):An?kn(ki+(ki<0?a:-a),ji):0;if(!_n&&(On=Wa=An)&&Ja.lineStart(),An!==Wa&&(Bn=gn(_n,Ni),(!Bn||_r(_n,Bn)||_r(Ni,Bn))&&(Ni[2]=1)),An!==Wa)zi=0,An?(Ja.lineStart(),Bn=gn(Ni,_n),Ja.point(Bn[0],Bn[1])):(Bn=gn(_n,Ni),Ja.point(Bn[0],Bn[1],2),Ja.lineEnd()),_n=Bn;else if(ua&&_n&&Or^An){var ko;!(Ki&on)&&(ko=gn(Ni,_n,!0))&&(zi=0,Or?(Ja.lineStart(),Ja.point(ko[0][0],ko[0][1]),Ja.point(ko[1][0],ko[1][1]),Ja.lineEnd()):(Ja.point(ko[1][0],ko[1][1]),Ja.lineEnd(),Ja.lineStart(),Ja.point(ko[0][0],ko[0][1],3)))}An&&(!_n||!_r(_n,Ni))&&Ja.point(Ni[0],Ni[1]),_n=Ni,Wa=An,on=Ki},lineEnd:function(){Wa&&Ja.lineEnd(),_n=null},clean:function(){return zi|(On&&Wa)<<1}}}function gn(Ja,_n,on){var Wa=ie(Ja),On=ie(_n),zi=[1,0,0],ki=we(Wa,On),ji=fe(ki,ki),Ni=ki[0],Bn=ji-Ni*Ni;if(!Bn)return!on&&Ja;var An=ur*ji/Bn,Ki=-ur*Ni/Bn,ko=we(zi,ki),$o=Fe(zi,An),Ls=Fe(ki,Ki);Ae($o,Ls);var os=ko,As=fe($o,os),jo=fe(os,os),il=As*As-jo*(fe($o,$o)-1);if(!(il<0)){var Qs=p(il),Ss=Fe(os,(-As-Qs)/jo);if(Ae(Ss,$o),Ss=ae(Ss),!on)return Ss;var fi=Ja[0],ao=_n[0],gs=Ja[1],Jo=_n[1],Bl;ao0^Ss[1]<(v(Ss[0]-fi)a^(fi<=Ss[0]&&Ss[0]<=ao)){var ql=Fe(os,(-As+Qs)/jo);return Ae(ql,$o),[Ss,ae(ql)]}}}function kn(Ja,_n){var on=Or?Ht:a-Ht,Wa=0;return Ja<-on?Wa|=1:Ja>on&&(Wa|=2),_n<-on?Wa|=4:_n>on&&(Wa|=8),Wa}return Jr(ja,sn,Fa,Or?[0,-Ht]:[-a,Ht-a])}function ra(Ht,ur,qr,Or,ua,Fa){var ja=Ht[0],sn=Ht[1],gn=ur[0],kn=ur[1],Ja=0,_n=1,on=gn-ja,Wa=kn-sn,On;if(On=qr-ja,!(!on&&On>0)){if(On/=on,on<0){if(On0){if(On>_n)return;On>Ja&&(Ja=On)}if(On=ua-ja,!(!on&&On<0)){if(On/=on,on<0){if(On>_n)return;On>Ja&&(Ja=On)}else if(on>0){if(On0)){if(On/=Wa,Wa<0){if(On0){if(On>_n)return;On>Ja&&(Ja=On)}if(On=Fa-sn,!(!Wa&&On<0)){if(On/=Wa,Wa<0){if(On>_n)return;On>Ja&&(Ja=On)}else if(Wa>0){if(On0&&(Ht[0]=ja+Ja*on,Ht[1]=sn+Ja*Wa),_n<1&&(ur[0]=ja+_n*on,ur[1]=sn+_n*Wa),!0}}}}}var pa=1e9,pn=-pa;function Ga(Ht,ur,qr,Or){function ua(kn,Ja){return Ht<=kn&&kn<=qr&&ur<=Ja&&Ja<=Or}function Fa(kn,Ja,_n,on){var Wa=0,On=0;if(kn==null||(Wa=ja(kn,_n))!==(On=ja(Ja,_n))||gn(kn,Ja)<0^_n>0)do on.point(Wa===0||Wa===3?Ht:qr,Wa>1?Or:ur);while((Wa=(Wa+_n+4)%4)!==On);else on.point(Ja[0],Ja[1])}function ja(kn,Ja){return v(kn[0]-Ht)0?0:3:v(kn[0]-qr)0?2:1:v(kn[1]-ur)0?1:0:Ja>0?3:2}function sn(kn,Ja){return gn(kn.x,Ja.x)}function gn(kn,Ja){var _n=ja(kn,1),on=ja(Ja,1);return _n!==on?_n-on:_n===0?Ja[1]-kn[1]:_n===1?kn[0]-Ja[0]:_n===2?kn[1]-Ja[1]:Ja[0]-kn[0]}return function(kn){var Ja=kn,_n=Er(),on,Wa,On,zi,ki,ji,Ni,Bn,An,Ki,ko,$o={point:Ls,lineStart:il,lineEnd:Qs,polygonStart:As,polygonEnd:jo};function Ls(fi,ao){ua(fi,ao)&&Ja.point(fi,ao)}function os(){for(var fi=0,ao=0,gs=Wa.length;aoOr&&(Vu-cc)*(Or-ql)>(ol-ql)*(Ht-cc)&&++fi:ol<=Or&&(Vu-cc)*(Or-ql)<(ol-ql)*(Ht-cc)&&--fi;return fi}function As(){Ja=_n,on=[],Wa=[],ko=!0}function jo(){var fi=os(),ao=ko&&fi,gs=(on=x.merge(on)).length;(ao||gs)&&(kn.polygonStart(),ao&&(kn.lineStart(),Fa(null,null,1,kn),kn.lineEnd()),gs&&kr(on,sn,fi,Fa,kn),kn.polygonEnd()),Ja=kn,on=Wa=On=null}function il(){$o.point=Ss,Wa&&Wa.push(On=[]),Ki=!0,An=!1,Ni=Bn=NaN}function Qs(){on&&(Ss(zi,ki),ji&&An&&_n.rejoin(),on.push(_n.result())),$o.point=Ls,An&&Ja.lineEnd()}function Ss(fi,ao){var gs=ua(fi,ao);if(Wa&&On.push([fi,ao]),Ki)zi=fi,ki=ao,ji=gs,Ki=!1,gs&&(Ja.lineStart(),Ja.point(fi,ao));else if(gs&&An)Ja.point(fi,ao);else{var Jo=[Ni=Math.max(pn,Math.min(pa,Ni)),Bn=Math.max(pn,Math.min(pa,Bn))],Bl=[fi=Math.max(pn,Math.min(pa,fi)),ao=Math.max(pn,Math.min(pa,ao))];ra(Jo,Bl,Ht,ur,qr,Or)?(An||(Ja.lineStart(),Ja.point(Jo[0],Jo[1])),Ja.point(Bl[0],Bl[1]),gs||Ja.lineEnd(),ko=!1):gs&&(Ja.lineStart(),Ja.point(fi,ao),ko=!1)}Ni=fi,Bn=ao,An=gs}return $o}}function qn(){var Ht=0,ur=0,qr=960,Or=500,ua,Fa,ja;return ja={stream:function(sn){return ua&&Fa===sn?ua:ua=Ga(Ht,ur,qr,Or)(Fa=sn)},extent:function(sn){return arguments.length?(Ht=+sn[0][0],ur=+sn[0][1],qr=+sn[1][0],Or=+sn[1][1],ua=Fa=null,ja):[[Ht,ur],[qr,Or]]}}}var Vn=A(),di,yi,Ci,ci={sphere:P,point:P,lineStart:ei,lineEnd:P,polygonStart:P,polygonEnd:P};function ei(){ci.point=uo,ci.lineEnd=mi}function mi(){ci.point=ci.lineEnd=P}function uo(Ht,ur){Ht*=f,ur*=f,di=Ht,yi=_(ur),Ci=l(ur),ci.point=Lo}function Lo(Ht,ur){Ht*=f,ur*=f;var qr=_(ur),Or=l(ur),ua=v(Ht-di),Fa=l(ua),ja=_(ua),sn=Or*ja,gn=Ci*qr-yi*Or*Fa,kn=yi*qr+Ci*Or*Fa;Vn.add(T(p(sn*sn+gn*gn),kn)),di=Ht,yi=qr,Ci=Or}function Wo(Ht){return Vn.reset(),N(Ht,ci),+Vn}var li=[null,null],Ii={type:"LineString",coordinates:li};function xi(Ht,ur){return li[0]=Ht,li[1]=ur,Wo(Ii)}var Ao={Feature:function(Ht,ur){return Ro(Ht.geometry,ur)},FeatureCollection:function(Ht,ur){for(var qr=Ht.features,Or=-1,ua=qr.length;++Or0&&(ua=xi(Ht[Fa],Ht[Fa-1]),ua>0&&qr<=ua&&Or<=ua&&(qr+Or-ua)*(1-Math.pow((qr-Or)/ua,2))r}).map(on)).concat(x.range(y(Fa/kn)*kn,ua,kn).filter(function(Bn){return v(Bn%_n)>r}).map(Wa))}return ji.lines=function(){return Ni().map(function(Bn){return{type:"LineString",coordinates:Bn}})},ji.outline=function(){return{type:"Polygon",coordinates:[On(Or).concat(zi(ja).slice(1),On(qr).reverse().slice(1),zi(sn).reverse().slice(1))]}},ji.extent=function(Bn){return arguments.length?ji.extentMajor(Bn).extentMinor(Bn):ji.extentMinor()},ji.extentMajor=function(Bn){return arguments.length?(Or=+Bn[0][0],qr=+Bn[1][0],sn=+Bn[0][1],ja=+Bn[1][1],Or>qr&&(Bn=Or,Or=qr,qr=Bn),sn>ja&&(Bn=sn,sn=ja,ja=Bn),ji.precision(ki)):[[Or,sn],[qr,ja]]},ji.extentMinor=function(Bn){return arguments.length?(ur=+Bn[0][0],Ht=+Bn[1][0],Fa=+Bn[0][1],ua=+Bn[1][1],ur>Ht&&(Bn=ur,ur=Ht,Ht=Bn),Fa>ua&&(Bn=Fa,Fa=ua,ua=Bn),ji.precision(ki)):[[ur,Fa],[Ht,ua]]},ji.step=function(Bn){return arguments.length?ji.stepMajor(Bn).stepMinor(Bn):ji.stepMinor()},ji.stepMajor=function(Bn){return arguments.length?(Ja=+Bn[0],_n=+Bn[1],ji):[Ja,_n]},ji.stepMinor=function(Bn){return arguments.length?(gn=+Bn[0],kn=+Bn[1],ji):[gn,kn]},ji.precision=function(Bn){return arguments.length?(ki=+Bn,on=Qa(Fa,ua,90),Wa=Jn(ur,Ht,ki),On=Qa(sn,ja,90),zi=Jn(Or,qr,ki),ji):ki},ji.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function ds(){return Os()()}function Ui(Ht,ur){var qr=Ht[0]*f,Or=Ht[1]*f,ua=ur[0]*f,Fa=ur[1]*f,ja=l(Or),sn=_(Or),gn=l(Fa),kn=_(Fa),Ja=ja*l(qr),_n=ja*_(qr),on=gn*l(ua),Wa=gn*_(ua),On=2*m(p(R(Fa-Or)+ja*gn*R(ua-qr))),zi=_(On),ki=On?function(ji){var Ni=_(ji*=On)/zi,Bn=_(On-ji)/zi,An=Bn*Ja+Ni*on,Ki=Bn*_n+Ni*Wa,ko=Bn*sn+Ni*kn;return[T(Ki,An)*c,T(ko,p(An*An+Ki*Ki))*c]}:function(){return[qr*c,Or*c]};return ki.distance=On,ki}function ms(Ht){return Ht}var Mo=A(),ws=A(),Ks,Rn,fo,Pi,zo={point:P,lineStart:P,lineEnd:P,polygonStart:function(){zo.lineStart=wo,zo.lineEnd=$l},polygonEnd:function(){zo.lineStart=zo.lineEnd=zo.point=P,Mo.add(v(ws)),ws.reset()},result:function(){var Ht=Mo/2;return Mo.reset(),Ht}};function wo(){zo.point=bi}function bi(Ht,ur){zo.point=wl,Ks=fo=Ht,Rn=Pi=ur}function wl(Ht,ur){ws.add(Pi*Ht-fo*ur),fo=Ht,Pi=ur}function $l(){wl(Ks,Rn)}var Js=1/0,Ql=Js,Ws=-Js,Is=Ws,Dl={point:Xu,lineStart:P,lineEnd:P,polygonStart:P,polygonEnd:P,result:function(){var Ht=[[Js,Ql],[Ws,Is]];return Ws=Is=-(Ql=Js=1/0),Ht}};function Xu(Ht,ur){HtWs&&(Ws=Ht),urIs&&(Is=ur)}var Lu=0,Bu=0,kf=0,gf=0,ns=0,_u=0,Nc=0,ml=0,fl=0,_l,Yu,Ts,Tl,Ko={point:Cs,lineStart:Nu,lineEnd:Bs,polygonStart:function(){Ko.lineStart=Gf,Ko.lineEnd=Eo},polygonEnd:function(){Ko.point=Cs,Ko.lineStart=Nu,Ko.lineEnd=Bs},result:function(){var Ht=fl?[Nc/fl,ml/fl]:_u?[gf/_u,ns/_u]:kf?[Lu/kf,Bu/kf]:[NaN,NaN];return Lu=Bu=kf=gf=ns=_u=Nc=ml=fl=0,Ht}};function Cs(Ht,ur){Lu+=Ht,Bu+=ur,++kf}function Nu(){Ko.point=Ul}function Ul(Ht,ur){Ko.point=Ku,Cs(Ts=Ht,Tl=ur)}function Ku(Ht,ur){var qr=Ht-Ts,Or=ur-Tl,ua=p(qr*qr+Or*Or);gf+=ua*(Ts+Ht)/2,ns+=ua*(Tl+ur)/2,_u+=ua,Cs(Ts=Ht,Tl=ur)}function Bs(){Ko.point=Cs}function Gf(){Ko.point=Wf}function Eo(){is(_l,Yu)}function Wf(Ht,ur){Ko.point=is,Cs(_l=Ts=Ht,Yu=Tl=ur)}function is(Ht,ur){var qr=Ht-Ts,Or=ur-Tl,ua=p(qr*qr+Or*Or);gf+=ua*(Ts+Ht)/2,ns+=ua*(Tl+ur)/2,_u+=ua,ua=Tl*Ht-Ts*ur,Nc+=ua*(Ts+Ht),ml+=ua*(Tl+ur),fl+=ua*3,Cs(Ts=Ht,Tl=ur)}function oo(Ht){this._context=Ht}oo.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,ur){switch(this._point){case 0:{this._context.moveTo(Ht,ur),this._point=1;break}case 1:{this._context.lineTo(Ht,ur);break}default:{this._context.moveTo(Ht+this._radius,ur),this._context.arc(Ht,ur,this._radius,0,s);break}}},result:P};var pc=A(),xu,zl,Kc,Ju,gc,hl={point:P,lineStart:function(){hl.point=yf},lineEnd:function(){xu&&Jc(zl,Kc),hl.point=P},polygonStart:function(){xu=!0},polygonEnd:function(){xu=null},result:function(){var Ht=+pc;return pc.reset(),Ht}};function yf(Ht,ur){hl.point=Jc,zl=Ju=Ht,Kc=gc=ur}function Jc(Ht,ur){Ju-=Ht,gc-=ur,pc.add(p(Ju*Ju+gc*gc)),Ju=Ht,gc=ur}function Uc(){this._string=[]}Uc.prototype={_radius:4.5,_circle:$u(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,ur){switch(this._point){case 0:{this._string.push("M",Ht,",",ur),this._point=1;break}case 1:{this._string.push("L",Ht,",",ur);break}default:{this._circle==null&&(this._circle=$u(this._radius)),this._string.push("M",Ht,",",ur,this._circle);break}}},result:function(){if(this._string.length){var Ht=this._string.join("");return this._string=[],Ht}else return null}};function $u(Ht){return"m0,"+Ht+"a"+Ht+","+Ht+" 0 1,1 0,"+-2*Ht+"a"+Ht+","+Ht+" 0 1,1 0,"+2*Ht+"z"}function jc(Ht,ur){var qr=4.5,Or,ua;function Fa(ja){return ja&&(typeof qr=="function"&&ua.pointRadius(+qr.apply(this,arguments)),N(ja,Or(ua))),ua.result()}return Fa.area=function(ja){return N(ja,Or(zo)),zo.result()},Fa.measure=function(ja){return N(ja,Or(hl)),hl.result()},Fa.bounds=function(ja){return N(ja,Or(Dl)),Dl.result()},Fa.centroid=function(ja){return N(ja,Or(Ko)),Ko.result()},Fa.projection=function(ja){return arguments.length?(Or=ja==null?(Ht=null,ms):(Ht=ja).stream,Fa):Ht},Fa.context=function(ja){return arguments.length?(ua=ja==null?(ur=null,new Uc):new oo(ur=ja),typeof qr!="function"&&ua.pointRadius(qr),Fa):ur},Fa.pointRadius=function(ja){return arguments.length?(qr=typeof ja=="function"?ja:(ua.pointRadius(+ja),+ja),Fa):qr},Fa.projection(Ht).context(ur)}function $c(Ht){return{stream:bu(Ht)}}function bu(Ht){return function(ur){var qr=new Qc;for(var Or in Ht)qr[Or]=Ht[Or];return qr.stream=ur,qr}}function Qc(){}Qc.prototype={constructor:Qc,point:function(Ht,ur){this.stream.point(Ht,ur)},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 sc(Ht,ur,qr){var Or=Ht.clipExtent&&Ht.clipExtent();return Ht.scale(150).translate([0,0]),Or!=null&&Ht.clipExtent(null),N(qr,Ht.stream(Dl)),ur(Dl.result()),Or!=null&&Ht.clipExtent(Or),Ht}function wu(Ht,ur,qr){return sc(Ht,function(Or){var ua=ur[1][0]-ur[0][0],Fa=ur[1][1]-ur[0][1],ja=Math.min(ua/(Or[1][0]-Or[0][0]),Fa/(Or[1][1]-Or[0][1])),sn=+ur[0][0]+(ua-ja*(Or[1][0]+Or[0][0]))/2,gn=+ur[0][1]+(Fa-ja*(Or[1][1]+Or[0][1]))/2;Ht.scale(150*ja).translate([sn,gn])},qr)}function eu(Ht,ur,qr){return wu(Ht,[[0,0],ur],qr)}function Sc(Ht,ur,qr){return sc(Ht,function(Or){var ua=+ur,Fa=ua/(Or[1][0]-Or[0][0]),ja=(ua-Fa*(Or[1][0]+Or[0][0]))/2,sn=-Fa*Or[0][1];Ht.scale(150*Fa).translate([ja,sn])},qr)}function ef(Ht,ur,qr){return sc(Ht,function(Or){var ua=+ur,Fa=ua/(Or[1][1]-Or[0][1]),ja=-Fa*Or[0][0],sn=(ua-Fa*(Or[1][1]+Or[0][1]))/2;Ht.scale(150*Fa).translate([ja,sn])},qr)}var ps=16,Vc=l(30*f);function Zf(Ht,ur){return+ur?Mc(Ht,ur):mf(Ht)}function mf(Ht){return bu({point:function(ur,qr){ur=Ht(ur,qr),this.stream.point(ur[0],ur[1])}})}function Mc(Ht,ur){function qr(Or,ua,Fa,ja,sn,gn,kn,Ja,_n,on,Wa,On,zi,ki){var ji=kn-Or,Ni=Ja-ua,Bn=ji*ji+Ni*Ni;if(Bn>4*ur&&zi--){var An=ja+on,Ki=sn+Wa,ko=gn+On,$o=p(An*An+Ki*Ki+ko*ko),Ls=m(ko/=$o),os=v(v(ko)-1)ur||v((ji*Qs+Ni*Ss)/Bn-.5)>.3||ja*on+sn*Wa+gn*On2?fi[2]%360*f:0,Qs()):[sn*c,gn*c,kn*c]},jo.angle=function(fi){return arguments.length?(_n=fi%360*f,Qs()):_n*c},jo.reflectX=function(fi){return arguments.length?(on=fi?-1:1,Qs()):on<0},jo.reflectY=function(fi){return arguments.length?(Wa=fi?-1:1,Qs()):Wa<0},jo.precision=function(fi){return arguments.length?(ko=Zf($o,Ki=fi*fi),Ss()):p(Ki)},jo.fitExtent=function(fi,ao){return wu(jo,fi,ao)},jo.fitSize=function(fi,ao){return eu(jo,fi,ao)},jo.fitWidth=function(fi,ao){return Sc(jo,fi,ao)},jo.fitHeight=function(fi,ao){return ef(jo,fi,ao)};function Qs(){var fi=Fl(qr,0,0,on,Wa,_n).apply(null,ur(Fa,ja)),ao=(_n?Fl:xf)(qr,Or-fi[0],ua-fi[1],on,Wa,_n);return Ja=ga(sn,gn,kn),$o=na(ur,ao),Ls=na(Ja,$o),ko=Zf($o,Ki),Ss()}function Ss(){return os=As=null,jo}return function(){return ur=Ht.apply(this,arguments),jo.invert=ur.invert&&il,Qs()}}function $s(Ht){var ur=0,qr=a/3,Or=Uu(Ht),ua=Or(ur,qr);return ua.parallels=function(Fa){return arguments.length?Or(ur=Fa[0]*f,qr=Fa[1]*f):[ur*c,qr*c]},ua}function Qu(Ht){var ur=l(Ht);function qr(Or,ua){return[Or*ur,_(ua)/ur]}return qr.invert=function(Or,ua){return[Or/ur,m(ua*ur)]},qr}function Tu(Ht,ur){var qr=_(Ht),Or=(qr+_(ur))/2;if(v(Or)=.12&&ki<.234&&zi>=-.425&&zi<-.214?ua:ki>=.166&&ki<.234&&zi>=-.214&&zi<-.115?ja:qr).invert(on)},Ja.stream=function(on){return Ht&&ur===on?Ht:Ht=yc([qr.stream(ur=on),ua.stream(on),ja.stream(on)])},Ja.precision=function(on){return arguments.length?(qr.precision(on),ua.precision(on),ja.precision(on),_n()):qr.precision()},Ja.scale=function(on){return arguments.length?(qr.scale(on),ua.scale(on*.35),ja.scale(on),Ja.translate(qr.translate())):qr.scale()},Ja.translate=function(on){if(!arguments.length)return qr.translate();var Wa=qr.scale(),On=+on[0],zi=+on[1];return Or=qr.translate(on).clipExtent([[On-.455*Wa,zi-.238*Wa],[On+.455*Wa,zi+.238*Wa]]).stream(kn),Fa=ua.translate([On-.307*Wa,zi+.201*Wa]).clipExtent([[On-.425*Wa+r,zi+.12*Wa+r],[On-.214*Wa-r,zi+.234*Wa-r]]).stream(kn),sn=ja.translate([On-.205*Wa,zi+.212*Wa]).clipExtent([[On-.214*Wa+r,zi+.166*Wa+r],[On-.115*Wa-r,zi+.234*Wa-r]]).stream(kn),_n()},Ja.fitExtent=function(on,Wa){return wu(Ja,on,Wa)},Ja.fitSize=function(on,Wa){return eu(Ja,on,Wa)},Ja.fitWidth=function(on,Wa){return Sc(Ja,on,Wa)},Ja.fitHeight=function(on,Wa){return ef(Ja,on,Wa)};function _n(){return Ht=ur=null,Ja}return Ja.scale(1070)}function ec(Ht){return function(ur,qr){var Or=l(ur),ua=l(qr),Fa=Ht(Or*ua);return[Fa*ua*_(ur),Fa*_(qr)]}}function Ec(Ht){return function(ur,qr){var Or=p(ur*ur+qr*qr),ua=Ht(Or),Fa=_(ua),ja=l(ua);return[T(ur*Fa,Or*ja),m(Or&&qr*Fa/Or)]}}var Cf=ec(function(Ht){return p(2/(1+Ht))});Cf.invert=Ec(function(Ht){return 2*m(Ht/2)});function nh(){return ru(Cf).scale(124.75).clipAngle(180-.001)}var lc=ec(function(Ht){return(Ht=g(Ht))&&Ht/_(Ht)});lc.invert=Ec(function(Ht){return Ht});function kc(){return ru(lc).scale(79.4188).clipAngle(180-.001)}function nu(Ht,ur){return[Ht,S(u((i+ur)/2))]}nu.invert=function(Ht,ur){return[Ht,2*h(b(ur))-i]};function tf(){return Cl(nu).scale(961/s)}function Cl(Ht){var ur=ru(Ht),qr=ur.center,Or=ur.scale,ua=ur.translate,Fa=ur.clipExtent,ja=null,sn,gn,kn;ur.scale=function(_n){return arguments.length?(Or(_n),Ja()):Or()},ur.translate=function(_n){return arguments.length?(ua(_n),Ja()):ua()},ur.center=function(_n){return arguments.length?(qr(_n),Ja()):qr()},ur.clipExtent=function(_n){return arguments.length?(_n==null?ja=sn=gn=kn=null:(ja=+_n[0][0],sn=+_n[0][1],gn=+_n[1][0],kn=+_n[1][1]),Ja()):ja==null?null:[[ja,sn],[gn,kn]]};function Ja(){var _n=a*Or(),on=ur(Oa(ur.rotate()).invert([0,0]));return Fa(ja==null?[[on[0]-_n,on[1]-_n],[on[0]+_n,on[1]+_n]]:Ht===nu?[[Math.max(on[0]-_n,ja),sn],[Math.min(on[0]+_n,gn),kn]]:[[ja,Math.max(on[1]-_n,sn)],[gn,Math.min(on[1]+_n,kn)]])}return Ja()}function uc(Ht){return u((i+Ht)/2)}function rf(Ht,ur){var qr=l(Ht),Or=Ht===ur?_(Ht):S(qr/l(ur))/S(uc(ur)/uc(Ht)),ua=qr*M(uc(Ht),Or)/Or;if(!Or)return nu;function Fa(ja,sn){ua>0?sn<-i+r&&(sn=-i+r):sn>i-r&&(sn=i-r);var gn=ua/M(uc(sn),Or);return[gn*_(Or*ja),ua-gn*l(Or*ja)]}return Fa.invert=function(ja,sn){var gn=ua-sn,kn=w(Or)*p(ja*ja+gn*gn),Ja=T(ja,v(gn))*w(gn);return gn*Or<0&&(Ja-=a*w(ja)*w(gn)),[Ja/Or,2*h(M(ua/kn,1/Or))-i]},Fa}function mc(){return $s(rf).scale(109.5).parallels([30,30])}function Us(Ht,ur){return[Ht,ur]}Us.invert=Us;function vu(){return ru(Us).scale(152.63)}function du(Ht,ur){var qr=l(Ht),Or=Ht===ur?_(Ht):(qr-l(ur))/(ur-Ht),ua=qr/Or+Ht;if(v(Or)r&&--Or>0);return[Ht/(.8707+(Fa=qr*qr)*(-.131979+Fa*(-.013791+Fa*Fa*Fa*(.003971-.001529*Fa)))),qr]};function Au(){return ru(Ru).scale(175.295)}function Zs(Ht,ur){return[l(ur)*_(Ht),_(ur)]}Zs.invert=Ec(m);function Ol(){return ru(Zs).scale(249.5).clipAngle(90+r)}function bl(Ht,ur){var qr=l(ur),Or=1+l(Ht)*qr;return[qr*_(Ht)/Or,_(ur)/Or]}bl.invert=Ec(function(Ht){return 2*h(Ht)});function tc(){return ru(bl).scale(250).clipAngle(142)}function Su(Ht,ur){return[S(u((i+ur)/2)),-Ht]}Su.invert=function(Ht,ur){return[-ur,2*h(b(Ht))-i]};function Cc(){var Ht=Cl(Su),ur=Ht.center,qr=Ht.rotate;return Ht.center=function(Or){return arguments.length?ur([-Or[1],Or[0]]):(Or=ur(),[Or[1],-Or[0]])},Ht.rotate=function(Or){return arguments.length?qr([Or[0],Or[1],Or.length>2?Or[2]+90:90]):(Or=qr(),[Or[0],Or[1],Or[2]-90])},qr([0,0,90]).scale(159.155)}d.geoAlbers=Ns,d.geoAlbersUsa=Pu,d.geoArea=q,d.geoAzimuthalEqualArea=nh,d.geoAzimuthalEqualAreaRaw=Cf,d.geoAzimuthalEquidistant=kc,d.geoAzimuthalEquidistantRaw=lc,d.geoBounds=ze,d.geoCentroid=gr,d.geoCircle=Lr,d.geoClipAntimeridian=mr,d.geoClipCircle=ya,d.geoClipExtent=qn,d.geoClipRectangle=Ga,d.geoConicConformal=mc,d.geoConicConformalRaw=rf,d.geoConicEqualArea=au,d.geoConicEqualAreaRaw=Tu,d.geoConicEquidistant=af,d.geoConicEquidistantRaw=du,d.geoContains=Co,d.geoDistance=xi,d.geoEqualEarth=Lf,d.geoEqualEarthRaw=bc,d.geoEquirectangular=vu,d.geoEquirectangularRaw=Us,d.geoGnomonic=nf,d.geoGnomonicRaw=xl,d.geoGraticule=Os,d.geoGraticule10=ds,d.geoIdentity=ou,d.geoInterpolate=Ui,d.geoLength=Wo,d.geoMercator=tf,d.geoMercatorRaw=nu,d.geoNaturalEarth1=Au,d.geoNaturalEarth1Raw=Ru,d.geoOrthographic=Ol,d.geoOrthographicRaw=Zs,d.geoPath=jc,d.geoProjection=ru,d.geoProjectionMutator=Uu,d.geoRotation=Oa,d.geoStereographic=tc,d.geoStereographicRaw=bl,d.geoStream=N,d.geoTransform=$c,d.geoTransverseMercator=Cc,d.geoTransverseMercatorRaw=Su,Object.defineProperty(d,"__esModule",{value:!0})})}}),_P=He({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y,H3(),Vy()):x(d.d3=d.d3||{},d.d3,d.d3)})(Y,function(d,x,A){var E=Math.abs,e=Math.atan,t=Math.atan2,r=Math.cos,o=Math.exp,a=Math.floor,i=Math.log,n=Math.max,s=Math.min,c=Math.pow,f=Math.round,v=Math.sign||function(je){return je>0?1:je<0?-1:0},h=Math.sin,T=Math.tan,l=1e-6,y=1e-12,b=Math.PI,S=b/2,M=b/4,_=Math.SQRT1_2,w=F(2),p=F(b),u=b*2,g=180/b,m=b/180;function R(je){return je?je/Math.sin(je):1}function P(je){return je>1?S:je<-1?-S:Math.asin(je)}function z(je){return je>1?0:je<-1?b:Math.acos(je)}function F(je){return je>0?Math.sqrt(je):0}function B(je){return je=o(2*je),(je-1)/(je+1)}function O(je){return(o(je)-o(-je))/2}function L(je){return(o(je)+o(-je))/2}function N(je){return i(je+F(je*je+1))}function U(je){return i(je+F(je*je-1))}function Z(je){var Ze=T(je/2),at=2*i(r(je/2))/(Ze*Ze);function lt(Tt,gt){var Et=r(Tt),Yt=r(gt),rr=h(gt),sr=Yt*Et,Sr=-((1-sr?i((1+sr)/2)/(1-sr):-.5)+at/(1+sr));return[Sr*Yt*h(Tt),Sr*rr]}return lt.invert=function(Tt,gt){var Et=F(Tt*Tt+gt*gt),Yt=-je/2,rr=50,sr;if(!Et)return[0,0];do{var Sr=Yt/2,Nr=r(Sr),Qr=h(Sr),ia=Qr/Nr,_a=-i(E(Nr));Yt-=sr=(2/ia*_a-at*ia-Et)/(-_a/(Qr*Qr)+1-at/(2*Nr*Nr))*(Nr<0?.7:1)}while(E(sr)>l&&--rr>0);var za=h(Yt);return[t(Tt*za,Et*r(Yt)),P(gt*za/Et)]},lt}function Q(){var je=S,Ze=x.geoProjectionMutator(Z),at=Ze(je);return at.radius=function(lt){return arguments.length?Ze(je=lt*m):je*g},at.scale(179.976).clipAngle(147)}function ue(je,Ze){var at=r(Ze),lt=R(z(at*r(je/=2)));return[2*at*h(je)*lt,h(Ze)*lt]}ue.invert=function(je,Ze){if(!(je*je+4*Ze*Ze>b*b+l)){var at=je,lt=Ze,Tt=25;do{var gt=h(at),Et=h(at/2),Yt=r(at/2),rr=h(lt),sr=r(lt),Sr=h(2*lt),Nr=rr*rr,Qr=sr*sr,ia=Et*Et,_a=1-Qr*Yt*Yt,za=_a?z(sr*Yt)*F(nn=1/_a):nn=0,nn,en=2*za*sr*Et-je,ln=za*rr-Ze,Nn=nn*(Qr*ia+za*sr*Yt*Nr),pi=nn*(.5*gt*Sr-za*2*rr*Et),ii=nn*.25*(Sr*Et-za*rr*Qr*gt),Gi=nn*(Nr*Yt+za*ia*sr),Bo=pi*ii-Gi*Nn;if(!Bo)break;var No=(ln*pi-en*Gi)/Bo,po=(en*ii-ln*Nn)/Bo;at-=No,lt-=po}while((E(No)>l||E(po)>l)&&--Tt>0);return[at,lt]}};function oe(){return x.geoProjection(ue).scale(152.63)}function le(je){var Ze=h(je),at=r(je),lt=je>=0?1:-1,Tt=T(lt*je),gt=(1+Ze-at)/2;function Et(Yt,rr){var sr=r(rr),Sr=r(Yt/=2);return[(1+sr)*h(Yt),(lt*rr>-t(Sr,Tt)-.001?0:-lt*10)+gt+h(rr)*at-(1+sr)*Ze*Sr]}return Et.invert=function(Yt,rr){var sr=0,Sr=0,Nr=50;do{var Qr=r(sr),ia=h(sr),_a=r(Sr),za=h(Sr),nn=1+_a,en=nn*ia-Yt,ln=gt+za*at-nn*Ze*Qr-rr,Nn=nn*Qr/2,pi=-ia*za,ii=Ze*nn*ia/2,Gi=at*_a+Ze*Qr*za,Bo=pi*ii-Gi*Nn,No=(ln*pi-en*Gi)/Bo/2,po=(en*ii-ln*Nn)/Bo;E(po)>2&&(po/=2),sr-=No,Sr-=po}while((E(No)>l||E(po)>l)&&--Nr>0);return lt*Sr>-t(r(sr),Tt)-.001?[sr*2,Sr]:null},Et}function j(){var je=20*m,Ze=je>=0?1:-1,at=T(Ze*je),lt=x.geoProjectionMutator(le),Tt=lt(je),gt=Tt.stream;return Tt.parallel=function(Et){return arguments.length?(at=T((Ze=(je=Et*m)>=0?1:-1)*je),lt(je)):je*g},Tt.stream=function(Et){var Yt=Tt.rotate(),rr=gt(Et),sr=(Tt.rotate([0,0]),gt(Et)),Sr=Tt.precision();return Tt.rotate(Yt),rr.sphere=function(){sr.polygonStart(),sr.lineStart();for(var Nr=Ze*-180;Ze*Nr<180;Nr+=Ze*90)sr.point(Nr,Ze*90);if(je)for(;Ze*(Nr-=3*Ze*Sr)>=-180;)sr.point(Nr,Ze*-t(r(Nr*m/2),at)*g);sr.lineEnd(),sr.polygonEnd()},rr},Tt.scale(218.695).center([0,28.0974])}function J(je,Ze){var at=T(Ze/2),lt=F(1-at*at),Tt=1+lt*r(je/=2),gt=h(je)*lt/Tt,Et=at/Tt,Yt=gt*gt,rr=Et*Et;return[4/3*gt*(3+Yt-3*rr),4/3*Et*(3+3*Yt-rr)]}J.invert=function(je,Ze){if(je*=3/8,Ze*=3/8,!je&&E(Ze)>1)return null;var at=je*je,lt=Ze*Ze,Tt=1+at+lt,gt=F((Tt-F(Tt*Tt-4*Ze*Ze))/2),Et=P(gt)/3,Yt=gt?U(E(Ze/gt))/3:N(E(je))/3,rr=r(Et),sr=L(Yt),Sr=sr*sr-rr*rr;return[v(je)*2*t(O(Yt)*rr,.25-Sr),v(Ze)*2*t(sr*h(Et),.25+Sr)]};function $(){return x.geoProjection(J).scale(66.1603)}var X=F(8),re=i(1+w);function ee(je,Ze){var at=E(Ze);return aty&&--lt>0);return[je/(r(at)*(X-1/h(at))),v(Ze)*at]};function q(){return x.geoProjection(ee).scale(112.314)}function ae(je){var Ze=2*b/je;function at(lt,Tt){var gt=x.geoAzimuthalEquidistantRaw(lt,Tt);if(E(lt)>S){var Et=t(gt[1],gt[0]),Yt=F(gt[0]*gt[0]+gt[1]*gt[1]),rr=Ze*f((Et-S)/Ze)+S,sr=t(h(Et-=rr),2-r(Et));Et=rr+P(b/Yt*h(sr))-sr,gt[0]=Yt*r(Et),gt[1]=Yt*h(Et)}return gt}return at.invert=function(lt,Tt){var gt=F(lt*lt+Tt*Tt);if(gt>S){var Et=t(Tt,lt),Yt=Ze*f((Et-S)/Ze)+S,rr=Et>Yt?-1:1,sr=gt*r(Yt-Et),Sr=1/T(rr*z((sr-b)/F(b*(b-2*sr)+gt*gt)));Et=Yt+2*e((Sr+rr*F(Sr*Sr-3))/3),lt=gt*r(Et),Tt=gt*h(Et)}return x.geoAzimuthalEquidistantRaw.invert(lt,Tt)},at}function ie(){var je=5,Ze=x.geoProjectionMutator(ae),at=Ze(je),lt=at.stream,Tt=.01,gt=-r(Tt*m),Et=h(Tt*m);return at.lobes=function(Yt){return arguments.length?Ze(je=+Yt):je},at.stream=function(Yt){var rr=at.rotate(),sr=lt(Yt),Sr=(at.rotate([0,0]),lt(Yt));return at.rotate(rr),sr.sphere=function(){Sr.polygonStart(),Sr.lineStart();for(var Nr=0,Qr=360/je,ia=2*b/je,_a=90-180/je,za=S;Nr0&&E(Tt)>l);return lt<0?NaN:at}function Ce(je,Ze,at){return Ze===void 0&&(Ze=40),at===void 0&&(at=y),function(lt,Tt,gt,Et){var Yt,rr,sr;gt=gt===void 0?0:+gt,Et=Et===void 0?0:+Et;for(var Sr=0;SrYt){gt-=rr/=2,Et-=sr/=2;continue}Yt=_a;var za=(gt>0?-1:1)*at,nn=(Et>0?-1:1)*at,en=je(gt+za,Et),ln=je(gt,Et+nn),Nn=(en[0]-Nr[0])/za,pi=(en[1]-Nr[1])/za,ii=(ln[0]-Nr[0])/nn,Gi=(ln[1]-Nr[1])/nn,Bo=Gi*Nn-pi*ii,No=(E(Bo)<.5?.5:1)/Bo;if(rr=(ia*ii-Qr*Gi)*No,sr=(Qr*pi-ia*Nn)*No,gt+=rr,Et+=sr,E(rr)0&&(Yt[1]*=1+rr/1.5*Yt[0]*Yt[0]),Yt}return lt.invert=Ce(lt),lt}function et(){return x.geoProjection(qe()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function Qe(je,Ze){var at=je*h(Ze),lt=30,Tt;do Ze-=Tt=(Ze+h(Ze)-at)/(1+r(Ze));while(E(Tt)>l&&--lt>0);return Ze/2}function Ke(je,Ze,at){function lt(Tt,gt){return[je*Tt*r(gt=Qe(at,gt)),Ze*h(gt)]}return lt.invert=function(Tt,gt){return gt=P(gt/Ze),[Tt/(je*r(gt)),P((2*gt+h(2*gt))/at)]},lt}var Xe=Ke(w/S,w,b);function Me(){return x.geoProjection(Xe).scale(169.529)}var xe=2.00276,ce=1.11072;function Re(je,Ze){var at=Qe(b,Ze);return[xe*je/(1/r(Ze)+ce/r(at)),(Ze+w*h(at))/xe]}Re.invert=function(je,Ze){var at=xe*Ze,lt=Ze<0?-M:M,Tt=25,gt,Et;do Et=at-w*h(lt),lt-=gt=(h(2*lt)+2*lt-b*h(Et))/(2*r(2*lt)+2+b*r(Et)*w*r(lt));while(E(gt)>l&&--Tt>0);return Et=at-w*h(lt),[je*(1/r(Et)+ce/r(lt))/xe,Et]};function $e(){return x.geoProjection(Re).scale(160.857)}function rt(je){var Ze=0,at=x.geoProjectionMutator(je),lt=at(Ze);return lt.parallel=function(Tt){return arguments.length?at(Ze=Tt*m):Ze*g},lt}function Je(je,Ze){return[je*r(Ze),Ze]}Je.invert=function(je,Ze){return[je/r(Ze),Ze]};function At(){return x.geoProjection(Je).scale(152.63)}function St(je){if(!je)return Je;var Ze=1/T(je);function at(lt,Tt){var gt=Ze+je-Tt,Et=gt&<*r(Tt)/gt;return[gt*h(Et),Ze-gt*r(Et)]}return at.invert=function(lt,Tt){var gt=F(lt*lt+(Tt=Ze-Tt)*Tt),Et=Ze+je-gt;return[gt/r(Et)*t(lt,Tt),Et]},at}function Rt(){return rt(St).scale(123.082).center([0,26.1441]).parallel(45)}function Ut(je){function Ze(at,lt){var Tt=S-lt,gt=Tt&&at*je*h(Tt)/Tt;return[Tt*h(gt)/je,S-Tt*r(gt)]}return Ze.invert=function(at,lt){var Tt=at*je,gt=S-lt,Et=F(Tt*Tt+gt*gt),Yt=t(Tt,gt);return[(Et?Et/h(Et):1)*Yt/je,S-Et]},Ze}function ir(){var je=.5,Ze=x.geoProjectionMutator(Ut),at=Ze(je);return at.fraction=function(lt){return arguments.length?Ze(je=+lt):je},at.scale(158.837)}var ar=Ke(1,4/b,b);function Mr(){return x.geoProjection(ar).scale(152.63)}function fr(je,Ze,at,lt,Tt,gt){var Et=r(gt),Yt;if(E(je)>1||E(gt)>1)Yt=z(at*Tt+Ze*lt*Et);else{var rr=h(je/2),sr=h(gt/2);Yt=2*P(F(rr*rr+Ze*lt*sr*sr))}return E(Yt)>l?[Yt,t(lt*h(gt),Ze*Tt-at*lt*Et)]:[0,0]}function dr(je,Ze,at){return z((je*je+Ze*Ze-at*at)/(2*je*Ze))}function pt(je){return je-2*b*a((je+b)/(2*b))}function ze(je,Ze,at){for(var lt=[[je[0],je[1],h(je[1]),r(je[1])],[Ze[0],Ze[1],h(Ze[1]),r(Ze[1])],[at[0],at[1],h(at[1]),r(at[1])]],Tt=lt[2],gt,Et=0;Et<3;++Et,Tt=gt)gt=lt[Et],Tt.v=fr(gt[1]-Tt[1],Tt[3],Tt[2],gt[3],gt[2],gt[0]-Tt[0]),Tt.point=[0,0];var Yt=dr(lt[0].v[0],lt[2].v[0],lt[1].v[0]),rr=dr(lt[0].v[0],lt[1].v[0],lt[2].v[0]),sr=b-Yt;lt[2].point[1]=0,lt[0].point[0]=-(lt[1].point[0]=lt[0].v[0]/2);var Sr=[lt[2].point[0]=lt[0].point[0]+lt[2].v[0]*r(Yt),2*(lt[0].point[1]=lt[1].point[1]=lt[2].v[0]*h(Yt))];function Nr(Qr,ia){var _a=h(ia),za=r(ia),nn=new Array(3),en;for(en=0;en<3;++en){var ln=lt[en];if(nn[en]=fr(ia-ln[1],ln[3],ln[2],za,_a,Qr-ln[0]),!nn[en][0])return ln.point;nn[en][1]=pt(nn[en][1]-ln.v[1])}var Nn=Sr.slice();for(en=0;en<3;++en){var pi=en==2?0:en+1,ii=dr(lt[en].v[0],nn[en][0],nn[pi][0]);nn[en][1]<0&&(ii=-ii),en?en==1?(ii=rr-ii,Nn[0]-=nn[en][0]*r(ii),Nn[1]-=nn[en][0]*h(ii)):(ii=sr-ii,Nn[0]+=nn[en][0]*r(ii),Nn[1]+=nn[en][0]*h(ii)):(Nn[0]+=nn[en][0]*r(ii),Nn[1]-=nn[en][0]*h(ii))}return Nn[0]/=3,Nn[1]/=3,Nn}return Nr}function Ge(je){return je[0]*=m,je[1]*=m,je}function Oe(){return ve([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function ve(je,Ze,at){var lt=x.geoCentroid({type:"MultiPoint",coordinates:[je,Ze,at]}),Tt=[-lt[0],-lt[1]],gt=x.geoRotation(Tt),Et=ze(Ge(gt(je)),Ge(gt(Ze)),Ge(gt(at)));Et.invert=Ce(Et);var Yt=x.geoProjection(Et).rotate(Tt),rr=Yt.center;return delete Yt.rotate,Yt.center=function(sr){return arguments.length?rr(gt(sr)):gt.invert(rr())},Yt.clipAngle(90)}function ge(je,Ze){var at=F(1-h(Ze));return[2/p*je*at,p*(1-at)]}ge.invert=function(je,Ze){var at=(at=Ze/p-1)*at;return[at>0?je*F(b/at)/2:0,P(1-at)]};function be(){return x.geoProjection(ge).scale(95.6464).center([0,30])}function Pe(je){var Ze=T(je);function at(lt,Tt){return[lt,(lt?lt/h(lt):1)*(h(Tt)*r(lt)-Ze*r(Tt))]}return at.invert=Ze?function(lt,Tt){lt&&(Tt*=h(lt)/lt);var gt=r(lt);return[lt,2*t(F(gt*gt+Ze*Ze-Tt*Tt)-gt,Ze-Tt)]}:function(lt,Tt){return[lt,P(lt?Tt*T(lt)/lt:Tt)]},at}function We(){return rt(Pe).scale(249.828).clipAngle(90)}var ct=F(3);function _t(je,Ze){return[ct*je*(2*r(2*Ze/3)-1)/p,ct*p*h(Ze/3)]}_t.invert=function(je,Ze){var at=3*P(Ze/(ct*p));return[p*je/(ct*(2*r(2*at/3)-1)),at]};function Mt(){return x.geoProjection(_t).scale(156.19)}function Nt(je){var Ze=r(je);function at(lt,Tt){return[lt*Ze,h(Tt)/Ze]}return at.invert=function(lt,Tt){return[lt/Ze,P(Tt*Ze)]},at}function Bt(){return rt(Nt).parallel(38.58).scale(195.044)}function qt(je){var Ze=r(je);function at(lt,Tt){return[lt*Ze,(1+Ze)*T(Tt/2)]}return at.invert=function(lt,Tt){return[lt/Ze,e(Tt/(1+Ze))*2]},at}function Zt(){return rt(qt).scale(124.75)}function lr(je,Ze){var at=F(8/(3*b));return[at*je*(1-E(Ze)/b),at*Ze]}lr.invert=function(je,Ze){var at=F(8/(3*b)),lt=Ze/at;return[je/(at*(1-E(lt)/b)),lt]};function ta(){return x.geoProjection(lr).scale(165.664)}function da(je,Ze){var at=F(4-3*h(E(Ze)));return[2/F(6*b)*je*at,v(Ze)*F(2*b/3)*(2-at)]}da.invert=function(je,Ze){var at=2-E(Ze)/F(2*b/3);return[je*F(6*b)/(2*at),v(Ze)*P((4-at*at)/3)]};function wa(){return x.geoProjection(da).scale(165.664)}function ma(je,Ze){var at=F(b*(4+b));return[2/at*je*(1+F(1-4*Ze*Ze/(b*b))),4/at*Ze]}ma.invert=function(je,Ze){var at=F(b*(4+b))/2;return[je*at/(1+F(1-Ze*Ze*(4+b)/(4*b))),Ze*at/2]};function Ia(){return x.geoProjection(ma).scale(180.739)}function va(je,Ze){var at=(2+S)*h(Ze);Ze/=2;for(var lt=0,Tt=1/0;lt<10&&E(Tt)>l;lt++){var gt=r(Ze);Ze-=Tt=(Ze+h(Ze)*(gt+2)-at)/(2*gt*(1+gt))}return[2/F(b*(4+b))*je*(1+r(Ze)),2*F(b/(4+b))*h(Ze)]}va.invert=function(je,Ze){var at=Ze*F((4+b)/b)/2,lt=P(at),Tt=r(lt);return[je/(2/F(b*(4+b))*(1+Tt)),P((lt+at*(Tt+2))/(2+S))]};function La(){return x.geoProjection(va).scale(180.739)}function Ka(je,Ze){return[je*(1+r(Ze))/F(2+b),2*Ze/F(2+b)]}Ka.invert=function(je,Ze){var at=F(2+b),lt=Ze*at/2;return[at*je/(1+r(lt)),lt]};function Vt(){return x.geoProjection(Ka).scale(173.044)}function Lt(je,Ze){for(var at=(1+S)*h(Ze),lt=0,Tt=1/0;lt<10&&E(Tt)>l;lt++)Ze-=Tt=(Ze+h(Ze)-at)/(1+r(Ze));return at=F(2+b),[je*(1+r(Ze))/at,2*Ze/at]}Lt.invert=function(je,Ze){var at=1+S,lt=F(at/2);return[je*2*lt/(1+r(Ze*=lt)),P((Ze+h(Ze))/at)]};function jt(){return x.geoProjection(Lt).scale(173.044)}var Ot=3+2*w;function gr(je,Ze){var at=h(je/=2),lt=r(je),Tt=F(r(Ze)),gt=r(Ze/=2),Et=h(Ze)/(gt+w*lt*Tt),Yt=F(2/(1+Et*Et)),rr=F((w*gt+(lt+at)*Tt)/(w*gt+(lt-at)*Tt));return[Ot*(Yt*(rr-1/rr)-2*i(rr)),Ot*(Yt*Et*(rr+1/rr)-2*e(Et))]}gr.invert=function(je,Ze){if(!(gt=J.invert(je/1.2,Ze*1.065)))return null;var at=gt[0],lt=gt[1],Tt=20,gt;je/=Ot,Ze/=Ot;do{var Et=at/2,Yt=lt/2,rr=h(Et),sr=r(Et),Sr=h(Yt),Nr=r(Yt),Qr=r(lt),ia=F(Qr),_a=Sr/(Nr+w*sr*ia),za=_a*_a,nn=F(2/(1+za)),en=w*Nr+(sr+rr)*ia,ln=w*Nr+(sr-rr)*ia,Nn=en/ln,pi=F(Nn),ii=pi-1/pi,Gi=pi+1/pi,Bo=nn*ii-2*i(pi)-je,No=nn*_a*Gi-2*e(_a)-Ze,po=Sr&&_*ia*rr*za/Sr,Zo=(w*sr*Nr+ia)/(2*(Nr+w*sr*ia)*(Nr+w*sr*ia)*ia),Hs=-.5*_a*nn*nn*nn,zs=Hs*po,xo=Hs*Zo,bo=(bo=2*Nr+w*ia*(sr-rr))*bo*pi,vl=(w*sr*Nr*ia+Qr)/bo,Al=-(w*rr*Sr)/(ia*bo),pu=ii*zs-2*vl/pi+nn*(vl+vl/Nn),pe=ii*xo-2*Al/pi+nn*(Al+Al/Nn),Le=_a*Gi*zs-2*po/(1+za)+nn*Gi*po+nn*_a*(vl-vl/Nn),Ye=_a*Gi*xo-2*Zo/(1+za)+nn*Gi*Zo+nn*_a*(Al-Al/Nn),ut=pe*Le-Ye*pu;if(!ut)break;var ht=(No*pe-Bo*Ye)/ut,xt=(Bo*Le-No*pu)/ut;at-=ht,lt=n(-S,s(S,lt-xt))}while((E(ht)>l||E(xt)>l)&&--Tt>0);return E(E(lt)-S)lt){var Nr=F(Sr),Qr=t(sr,rr),ia=at*f(Qr/at),_a=Qr-ia,za=je*r(_a),nn=(je*h(_a)-_a*h(za))/(S-za),en=_r(_a,nn),ln=(b-je)/yr(en,za,b);rr=Nr;var Nn=50,pi;do rr-=pi=(je+yr(en,za,rr)*ln-Nr)/(en(rr)*ln);while(E(pi)>l&&--Nn>0);sr=_a*h(rr),rrlt){var rr=F(Yt),sr=t(Et,gt),Sr=at*f(sr/at),Nr=sr-Sr;gt=rr*r(Nr),Et=rr*h(Nr);for(var Qr=gt-S,ia=h(gt),_a=Et/ia,za=gtl||E(_a)>l)&&--za>0);return[Nr,Qr]},rr}var Pr=zr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function Hr(){return x.geoProjection(Pr).scale(149.995)}var Zr=zr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Jr(){return x.geoProjection(Zr).scale(153.93)}var wt=zr(5/6*b,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Qt(){return x.geoProjection(wt).scale(130.945)}function mr(je,Ze){var at=je*je,lt=Ze*Ze;return[je*(1-.162388*lt)*(.87-952426e-9*at*at),Ze*(1+lt/12)]}mr.invert=function(je,Ze){var at=je,lt=Ze,Tt=50,gt;do{var Et=lt*lt;lt-=gt=(lt*(1+Et/12)-Ze)/(1+Et/4)}while(E(gt)>l&&--Tt>0);Tt=50,je/=1-.162388*Et;do{var Yt=(Yt=at*at)*Yt;at-=gt=(at*(.87-952426e-9*Yt)-je)/(.87-.00476213*Yt)}while(E(gt)>l&&--Tt>0);return[at,lt]};function $r(){return x.geoProjection(mr).scale(131.747)}var oa=zr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Sa(){return x.geoProjection(oa).scale(131.087)}function ya(je){var Ze=je(S,0)[0]-je(-S,0)[0];function at(lt,Tt){var gt=lt>0?-.5:.5,Et=je(lt+gt*b,Tt);return Et[0]-=gt*Ze,Et}return je.invert&&(at.invert=function(lt,Tt){var gt=lt>0?-.5:.5,Et=je.invert(lt+gt*Ze,Tt),Yt=Et[0]-gt*b;return Yt<-b?Yt+=2*b:Yt>b&&(Yt-=2*b),Et[0]=Yt,Et}),at}function ra(je,Ze){var at=v(je),lt=v(Ze),Tt=r(Ze),gt=r(je)*Tt,Et=h(je)*Tt,Yt=h(lt*Ze);je=E(t(Et,Yt)),Ze=P(gt),E(je-S)>l&&(je%=S);var rr=pa(je>b/4?S-je:je,Ze);return je>b/4&&(Yt=rr[0],rr[0]=-rr[1],rr[1]=-Yt),rr[0]*=at,rr[1]*=-lt,rr}ra.invert=function(je,Ze){E(je)>1&&(je=v(je)*2-je),E(Ze)>1&&(Ze=v(Ze)*2-Ze);var at=v(je),lt=v(Ze),Tt=-at*je,gt=-lt*Ze,Et=gt/Tt<1,Yt=pn(Et?gt:Tt,Et?Tt:gt),rr=Yt[0],sr=Yt[1],Sr=r(sr);return Et&&(rr=-S-rr),[at*(t(h(rr)*Sr,-h(sr))+b),lt*P(r(rr)*Sr)]};function pa(je,Ze){if(Ze===S)return[0,0];var at=h(Ze),lt=at*at,Tt=lt*lt,gt=1+Tt,Et=1+3*Tt,Yt=1-Tt,rr=P(1/F(gt)),sr=Yt+lt*gt*rr,Sr=(1-at)/sr,Nr=F(Sr),Qr=Sr*gt,ia=F(Qr),_a=Nr*Yt,za,nn;if(je===0)return[0,-(_a+lt*ia)];var en=r(Ze),ln=1/en,Nn=2*at*en,pi=(-3*lt+rr*Et)*Nn,ii=(-sr*en-(1-at)*pi)/(sr*sr),Gi=.5*ii/Nr,Bo=Yt*Gi-2*lt*Nr*Nn,No=lt*gt*ii+Sr*Et*Nn,po=-ln*Nn,Zo=-ln*No,Hs=-2*ln*Bo,zs=4*je/b,xo;if(je>.222*b||Ze.175*b){if(za=(_a+lt*F(Qr*(1+Tt)-_a*_a))/(1+Tt),je>b/4)return[za,za];var bo=za,vl=.5*za;za=.5*(vl+bo),nn=50;do{var Al=F(Qr-za*za),pu=za*(Hs+po*Al)+Zo*P(za/ia)-zs;if(!pu)break;pu<0?vl=za:bo=za,za=.5*(vl+bo)}while(E(bo-vl)>l&&--nn>0)}else{za=l,nn=25;do{var pe=za*za,Le=F(Qr-pe),Ye=Hs+po*Le,ut=za*Ye+Zo*P(za/ia)-zs,ht=Ye+(Zo-po*pe)/Le;za-=xo=Le?ut/ht:0}while(E(xo)>l&&--nn>0)}return[za,-_a-lt*F(Qr-za*za)]}function pn(je,Ze){for(var at=0,lt=1,Tt=.5,gt=50;;){var Et=Tt*Tt,Yt=F(Tt),rr=P(1/F(1+Et)),sr=1-Et+Tt*(1+Et)*rr,Sr=(1-Yt)/sr,Nr=F(Sr),Qr=Sr*(1+Et),ia=Nr*(1-Et),_a=Qr-je*je,za=F(_a),nn=Ze+ia+Tt*za;if(E(lt-at)0?at=Tt:lt=Tt,Tt=.5*(at+lt)}if(!gt)return null;var en=P(Yt),ln=r(en),Nn=1/ln,pi=2*Yt*ln,ii=(-3*Tt+rr*(1+3*Et))*pi,Gi=(-sr*ln-(1-Yt)*ii)/(sr*sr),Bo=.5*Gi/Nr,No=(1-Et)*Bo-2*Tt*Nr*pi,po=-2*Nn*No,Zo=-Nn*pi,Hs=-Nn*(Tt*(1+Et)*Gi+Sr*(1+3*Et)*pi);return[b/4*(je*(po+Zo*za)+Hs*P(je/F(Qr))),en]}function Ga(){return x.geoProjection(ya(ra)).scale(239.75)}function qn(je,Ze,at){var lt,Tt,gt;return je?(lt=Vn(je,at),Ze?(Tt=Vn(Ze,1-at),gt=Tt[1]*Tt[1]+at*lt[0]*lt[0]*Tt[0]*Tt[0],[[lt[0]*Tt[2]/gt,lt[1]*lt[2]*Tt[0]*Tt[1]/gt],[lt[1]*Tt[1]/gt,-lt[0]*lt[2]*Tt[0]*Tt[2]/gt],[lt[2]*Tt[1]*Tt[2]/gt,-at*lt[0]*lt[1]*Tt[0]/gt]]):[[lt[0],0],[lt[1],0],[lt[2],0]]):(Tt=Vn(Ze,1-at),[[0,Tt[0]/Tt[1]],[1/Tt[1],0],[Tt[2]/Tt[1],0]])}function Vn(je,Ze){var at,lt,Tt,gt,Et;if(Ze=1-l)return at=(1-Ze)/4,lt=L(je),gt=B(je),Tt=1/lt,Et=lt*O(je),[gt+at*(Et-je)/(lt*lt),Tt-at*gt*Tt*(Et-je),Tt+at*gt*Tt*(Et+je),2*e(o(je))-S+at*(Et-je)/lt];var Yt=[1,0,0,0,0,0,0,0,0],rr=[F(Ze),0,0,0,0,0,0,0,0],sr=0;for(lt=F(1-Ze),Et=1;E(rr[sr]/Yt[sr])>l&&sr<8;)at=Yt[sr++],rr[sr]=(at-lt)/2,Yt[sr]=(at+lt)/2,lt=F(at*lt),Et*=2;Tt=Et*Yt[sr]*je;do gt=rr[sr]*h(lt=Tt)/Yt[sr],Tt=(P(gt)+Tt)/2;while(--sr);return[h(Tt),gt=r(Tt),gt/r(Tt-lt),Tt]}function di(je,Ze,at){var lt=E(je),Tt=E(Ze),gt=O(Tt);if(lt){var Et=1/h(lt),Yt=1/(T(lt)*T(lt)),rr=-(Yt+at*(gt*gt*Et*Et)-1+at),sr=(at-1)*Yt,Sr=(-rr+F(rr*rr-4*sr))/2;return[yi(e(1/F(Sr)),at)*v(je),yi(e(F((Sr/Yt-1)/at)),1-at)*v(Ze)]}return[0,yi(e(gt),1-at)*v(Ze)]}function yi(je,Ze){if(!Ze)return je;if(Ze===1)return i(T(je/2+M));for(var at=1,lt=F(1-Ze),Tt=F(Ze),gt=0;E(Tt)>l;gt++){if(je%b){var Et=e(lt*T(je)/at);Et<0&&(Et+=b),je+=Et+~~(je/b)*b}else je+=je;Tt=(at+lt)/2,lt=F(at*lt),Tt=((at=Tt)-lt)/2}return je/(c(2,gt)*at)}function Ci(je,Ze){var at=(w-1)/(w+1),lt=F(1-at*at),Tt=yi(S,lt*lt),gt=-1,Et=i(T(b/4+E(Ze)/2)),Yt=o(gt*Et)/F(at),rr=ci(Yt*r(gt*je),Yt*h(gt*je)),sr=di(rr[0],rr[1],lt*lt);return[-sr[1],(Ze>=0?1:-1)*(.5*Tt-sr[0])]}function ci(je,Ze){var at=je*je,lt=Ze+1,Tt=1-at-Ze*Ze;return[.5*((je>=0?S:-S)-t(Tt,2*je)),-.25*i(Tt*Tt+4*at)+.5*i(lt*lt+at)]}function ei(je,Ze){var at=Ze[0]*Ze[0]+Ze[1]*Ze[1];return[(je[0]*Ze[0]+je[1]*Ze[1])/at,(je[1]*Ze[0]-je[0]*Ze[1])/at]}Ci.invert=function(je,Ze){var at=(w-1)/(w+1),lt=F(1-at*at),Tt=yi(S,lt*lt),gt=-1,Et=qn(.5*Tt-Ze,-je,lt*lt),Yt=ei(Et[0],Et[1]),rr=t(Yt[1],Yt[0])/gt;return[rr,2*e(o(.5/gt*i(at*Yt[0]*Yt[0]+at*Yt[1]*Yt[1])))-S]};function mi(){return x.geoProjection(ya(Ci)).scale(151.496)}function uo(je){var Ze=h(je),at=r(je),lt=Lo(je);lt.invert=Lo(-je);function Tt(gt,Et){var Yt=lt(gt,Et);gt=Yt[0],Et=Yt[1];var rr=h(Et),sr=r(Et),Sr=r(gt),Nr=z(Ze*rr+at*sr*Sr),Qr=h(Nr),ia=E(Qr)>l?Nr/Qr:1;return[ia*at*h(gt),(E(gt)>S?ia:-ia)*(Ze*sr-at*rr*Sr)]}return Tt.invert=function(gt,Et){var Yt=F(gt*gt+Et*Et),rr=-h(Yt),sr=r(Yt),Sr=Yt*sr,Nr=-Et*rr,Qr=Yt*Ze,ia=F(Sr*Sr+Nr*Nr-Qr*Qr),_a=t(Sr*Qr+Nr*ia,Nr*Qr-Sr*ia),za=(Yt>S?-1:1)*t(gt*rr,Yt*r(_a)*sr+Et*h(_a)*rr);return lt.invert(za,_a)},Tt}function Lo(je){var Ze=h(je),at=r(je);return function(lt,Tt){var gt=r(Tt),Et=r(lt)*gt,Yt=h(lt)*gt,rr=h(Tt);return[t(Yt,Et*at-rr*Ze),P(rr*at+Et*Ze)]}}function Wo(){var je=0,Ze=x.geoProjectionMutator(uo),at=Ze(je),lt=at.rotate,Tt=at.stream,gt=x.geoCircle();return at.parallel=function(Et){if(!arguments.length)return je*g;var Yt=at.rotate();return Ze(je=Et*m).rotate(Yt)},at.rotate=function(Et){return arguments.length?(lt.call(at,[Et[0],Et[1]-je*g]),gt.center([-Et[0],-Et[1]]),at):(Et=lt.call(at),Et[1]+=je*g,Et)},at.stream=function(Et){return Et=Tt(Et),Et.sphere=function(){Et.polygonStart();var Yt=.01,rr=gt.radius(90-Yt)().coordinates[0],sr=rr.length-1,Sr=-1,Nr;for(Et.lineStart();++Sr=0;)Et.point((Nr=rr[Sr])[0],Nr[1]);Et.lineEnd(),Et.polygonEnd()},Et},at.scale(79.4187).parallel(45).clipAngle(180-.001)}var li=3,Ii=P(1-1/li)*g,xi=Nt(0);function Ao(je){var Ze=Ii*m,at=ge(b,Ze)[0]-ge(-b,Ze)[0],lt=xi(0,Ze)[1],Tt=ge(0,Ze)[1],gt=p-Tt,Et=u/je,Yt=4/u,rr=lt+gt*gt*4/u;function sr(Sr,Nr){var Qr,ia=E(Nr);if(ia>Ze){var _a=s(je-1,n(0,a((Sr+b)/Et)));Sr+=b*(je-1)/je-_a*Et,Qr=ge(Sr,ia),Qr[0]=Qr[0]*u/at-u*(je-1)/(2*je)+_a*u/je,Qr[1]=lt+(Qr[1]-Tt)*4*gt/u,Nr<0&&(Qr[1]=-Qr[1])}else Qr=xi(Sr,Nr);return Qr[0]*=Yt,Qr[1]/=rr,Qr}return sr.invert=function(Sr,Nr){Sr/=Yt,Nr*=rr;var Qr=E(Nr);if(Qr>lt){var ia=s(je-1,n(0,a((Sr+b)/Et)));Sr=(Sr+b*(je-1)/je-ia*Et)*at/u;var _a=ge.invert(Sr,.25*(Qr-lt)*u/gt+Tt);return _a[0]-=b*(je-1)/je-ia*Et,Nr<0&&(_a[1]=-_a[1]),_a}return xi.invert(Sr,Nr)},sr}function So(je,Ze){return[je,Ze&1?90-l:Ii]}function Ro(je,Ze){return[je,Ze&1?-90+l:-Ii]}function Li(je){return[je[0]*(1-l),je[1]]}function Yi(je){var Ze=[].concat(A.range(-180,180+je/2,je).map(So),A.range(180,-180-je/2,-je).map(Ro));return{type:"Polygon",coordinates:[je===180?Ze.map(Li):Ze]}}function bs(){var je=4,Ze=x.geoProjectionMutator(Ao),at=Ze(je),lt=at.stream;return at.lobes=function(Tt){return arguments.length?Ze(je=+Tt):je},at.stream=function(Tt){var gt=at.rotate(),Et=lt(Tt),Yt=(at.rotate([0,0]),lt(Tt));return at.rotate(gt),Et.sphere=function(){x.geoStream(Yi(180/je),Yt)},Et},at.scale(239.75)}function as(je){var Ze=1+je,at=h(1/Ze),lt=P(at),Tt=2*F(b/(gt=b+4*lt*Ze)),gt,Et=.5*Tt*(Ze+F(je*(2+je))),Yt=je*je,rr=Ze*Ze;function sr(Sr,Nr){var Qr=1-h(Nr),ia,_a;if(Qr&&Qr<2){var za=S-Nr,nn=25,en;do{var ln=h(za),Nn=r(za),pi=lt+t(ln,Ze-Nn),ii=1+rr-2*Ze*Nn;za-=en=(za-Yt*lt-Ze*ln+ii*pi-.5*Qr*gt)/(2*Ze*ln*pi)}while(E(en)>y&&--nn>0);ia=Tt*F(ii),_a=Sr*pi/b}else ia=Tt*(je+Qr),_a=Sr*lt/b;return[ia*h(_a),Et-ia*r(_a)]}return sr.invert=function(Sr,Nr){var Qr=Sr*Sr+(Nr-=Et)*Nr,ia=(1+rr-Qr/(Tt*Tt))/(2*Ze),_a=z(ia),za=h(_a),nn=lt+t(za,Ze-ia);return[P(Sr/F(Qr))*b/nn,P(1-2*(_a-Yt*lt-Ze*za+(1+rr-2*Ze*ia)*nn)/gt)]},sr}function fs(){var je=1,Ze=x.geoProjectionMutator(as),at=Ze(je);return at.ratio=function(lt){return arguments.length?Ze(je=+lt):je},at.scale(167.774).center([0,18.67])}var Co=.7109889596207567,Qa=.0528035274542;function Jn(je,Ze){return Ze>-Co?(je=Xe(je,Ze),je[1]+=Qa,je):Je(je,Ze)}Jn.invert=function(je,Ze){return Ze>-Co?Xe.invert(je,Ze-Qa):Je.invert(je,Ze)};function Os(){return x.geoProjection(Jn).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function ds(je,Ze){return E(Ze)>Co?(je=Xe(je,Ze),je[1]-=Ze>0?Qa:-Qa,je):Je(je,Ze)}ds.invert=function(je,Ze){return E(Ze)>Co?Xe.invert(je,Ze+(Ze>0?Qa:-Qa)):Je.invert(je,Ze)};function Ui(){return x.geoProjection(ds).scale(152.63)}function ms(je,Ze,at,lt){var Tt=F(4*b/(2*at+(1+je-Ze/2)*h(2*at)+(je+Ze)/2*h(4*at)+Ze/2*h(6*at))),gt=F(lt*h(at)*F((1+je*r(2*at)+Ze*r(4*at))/(1+je+Ze))),Et=at*rr(1);function Yt(Nr){return F(1+je*r(2*Nr)+Ze*r(4*Nr))}function rr(Nr){var Qr=Nr*at;return(2*Qr+(1+je-Ze/2)*h(2*Qr)+(je+Ze)/2*h(4*Qr)+Ze/2*h(6*Qr))/at}function sr(Nr){return Yt(Nr)*h(Nr)}var Sr=function(Nr,Qr){var ia=at*Fe(rr,Et*h(Qr)/at,Qr/b);isNaN(ia)&&(ia=at*v(Qr));var _a=Tt*Yt(ia);return[_a*gt*Nr/b*r(ia),_a/gt*h(ia)]};return Sr.invert=function(Nr,Qr){var ia=Fe(sr,Qr*gt/Tt);return[Nr*b/(r(ia)*Tt*gt*Yt(ia)),P(at*rr(ia/at)/Et)]},at===0&&(Tt=F(lt/b),Sr=function(Nr,Qr){return[Nr*Tt,h(Qr)/Tt]},Sr.invert=function(Nr,Qr){return[Nr/Tt,P(Qr*Tt)]}),Sr}function Mo(){var je=1,Ze=0,at=45*m,lt=2,Tt=x.geoProjectionMutator(ms),gt=Tt(je,Ze,at,lt);return gt.a=function(Et){return arguments.length?Tt(je=+Et,Ze,at,lt):je},gt.b=function(Et){return arguments.length?Tt(je,Ze=+Et,at,lt):Ze},gt.psiMax=function(Et){return arguments.length?Tt(je,Ze,at=+Et*m,lt):at*g},gt.ratio=function(Et){return arguments.length?Tt(je,Ze,at,lt=+Et):lt},gt.scale(180.739)}function ws(je,Ze,at,lt,Tt,gt,Et,Yt,rr,sr,Sr){if(Sr.nanEncountered)return NaN;var Nr,Qr,ia,_a,za,nn,en,ln,Nn,pi;if(Nr=at-Ze,Qr=je(Ze+Nr*.25),ia=je(at-Nr*.25),isNaN(Qr)){Sr.nanEncountered=!0;return}if(isNaN(ia)){Sr.nanEncountered=!0;return}return _a=Nr*(lt+4*Qr+Tt)/12,za=Nr*(Tt+4*ia+gt)/12,nn=_a+za,pi=(nn-Et)/15,sr>rr?(Sr.maxDepthCount++,nn+pi):Math.abs(pi)>1;do rr[nn]>ia?za=nn:_a=nn,nn=_a+za>>1;while(nn>_a);var en=rr[nn+1]-rr[nn];return en&&(en=(ia-rr[nn+1])/en),(nn+1+en)/Et}var Nr=2*Sr(1)/b*gt/at,Qr=function(ia,_a){var za=Sr(E(h(_a))),nn=lt(za)*ia;return za/=Nr,[nn,_a>=0?za:-za]};return Qr.invert=function(ia,_a){var za;return _a*=Nr,E(_a)<1&&(za=v(_a)*P(Tt(E(_a))*gt)),[ia/lt(E(_a)),za]},Qr}function fo(){var je=0,Ze=2.5,at=1.183136,lt=x.geoProjectionMutator(Rn),Tt=lt(je,Ze,at);return Tt.alpha=function(gt){return arguments.length?lt(je=+gt,Ze,at):je},Tt.k=function(gt){return arguments.length?lt(je,Ze=+gt,at):Ze},Tt.gamma=function(gt){return arguments.length?lt(je,Ze,at=+gt):at},Tt.scale(152.63)}function Pi(je,Ze){return E(je[0]-Ze[0])=0;--rr)at=je[1][rr],lt=at[0][0],Tt=at[0][1],gt=at[1][1],Et=at[2][0],Yt=at[2][1],Ze.push(zo([[Et-l,Yt-l],[Et-l,gt+l],[lt+l,gt+l],[lt+l,Tt-l]],30));return{type:"Polygon",coordinates:[A.merge(Ze)]}}function bi(je,Ze,at){var lt,Tt;function gt(rr,sr){for(var Sr=sr<0?-1:1,Nr=Ze[+(sr<0)],Qr=0,ia=Nr.length-1;QrNr[Qr][2][0];++Qr);var _a=je(rr-Nr[Qr][1][0],sr);return _a[0]+=je(Nr[Qr][1][0],Sr*sr>Sr*Nr[Qr][0][1]?Nr[Qr][0][1]:sr)[0],_a}at?gt.invert=at(gt):je.invert&&(gt.invert=function(rr,sr){for(var Sr=Tt[+(sr<0)],Nr=Ze[+(sr<0)],Qr=0,ia=Sr.length;Qr_a&&(za=ia,ia=_a,_a=za),[[Nr,ia],[Qr,_a]]})}),Et):Ze.map(function(sr){return sr.map(function(Sr){return[[Sr[0][0]*g,Sr[0][1]*g],[Sr[1][0]*g,Sr[1][1]*g],[Sr[2][0]*g,Sr[2][1]*g]]})})},Ze!=null&&Et.lobes(Ze),Et}var wl=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function $l(){return bi(Re,wl).scale(160.857)}var Js=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Ql(){return bi(ds,Js).scale(152.63)}var Ws=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Is(){return bi(Xe,Ws).scale(169.529)}var Dl=[[[[-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 Xu(){return bi(Xe,Dl).scale(169.529).rotate([20,0])}var Lu=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function Bu(){return bi(Jn,Lu,Ce).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var kf=[[[[-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 gf(){return bi(Je,kf).scale(152.63).rotate([-20,0])}function ns(je,Ze){return[3/u*je*F(b*b/3-Ze*Ze),Ze]}ns.invert=function(je,Ze){return[u/3*je/F(b*b/3-Ze*Ze),Ze]};function _u(){return x.geoProjection(ns).scale(158.837)}function Nc(je){function Ze(at,lt){if(E(E(lt)-S)2)return null;at/=2,lt/=2;var gt=at*at,Et=lt*lt,Yt=2*lt/(1+gt+Et);return Yt=c((1+Yt)/(1-Yt),1/je),[t(2*at,1-gt-Et)/je,P((Yt-1)/(Yt+1))]},Ze}function ml(){var je=.5,Ze=x.geoProjectionMutator(Nc),at=Ze(je);return at.spacing=function(lt){return arguments.length?Ze(je=+lt):je},at.scale(124.75)}var fl=b/w;function _l(je,Ze){return[je*(1+F(r(Ze)))/2,Ze/(r(Ze/2)*r(je/6))]}_l.invert=function(je,Ze){var at=E(je),lt=E(Ze),Tt=l,gt=S;ltl||E(nn)>l)&&--Tt>0);return Tt&&[at,lt]};function Tl(){return x.geoProjection(Ts).scale(139.98)}function Ko(je,Ze){return[h(je)/r(Ze),T(Ze)*r(je)]}Ko.invert=function(je,Ze){var at=je*je,lt=Ze*Ze,Tt=lt+1,gt=at+Tt,Et=je?_*F((gt-F(gt*gt-4*at))/at):1/F(Tt);return[P(je*Et),v(Ze)*z(Et)]};function Cs(){return x.geoProjection(Ko).scale(144.049).clipAngle(90-.001)}function Nu(je){var Ze=r(je),at=T(M+je/2);function lt(Tt,gt){var Et=gt-je,Yt=E(Et)=0;)Sr=je[sr],Nr=Sr[0]+Yt*(ia=Nr)-rr*Qr,Qr=Sr[1]+Yt*Qr+rr*ia;return Nr=Yt*(ia=Nr)-rr*Qr,Qr=Yt*Qr+rr*ia,[Nr,Qr]}return at.invert=function(lt,Tt){var gt=20,Et=lt,Yt=Tt;do{for(var rr=Ze,sr=je[rr],Sr=sr[0],Nr=sr[1],Qr=0,ia=0,_a;--rr>=0;)sr=je[rr],Qr=Sr+Et*(_a=Qr)-Yt*ia,ia=Nr+Et*ia+Yt*_a,Sr=sr[0]+Et*(_a=Sr)-Yt*Nr,Nr=sr[1]+Et*Nr+Yt*_a;Qr=Sr+Et*(_a=Qr)-Yt*ia,ia=Nr+Et*ia+Yt*_a,Sr=Et*(_a=Sr)-Yt*Nr-lt,Nr=Et*Nr+Yt*_a-Tt;var za=Qr*Qr+ia*ia,nn,en;Et-=nn=(Sr*Qr+Nr*ia)/za,Yt-=en=(Nr*Qr-Sr*ia)/za}while(E(nn)+E(en)>l*l&&--gt>0);if(gt){var ln=F(Et*Et+Yt*Yt),Nn=2*e(ln*.5),pi=h(Nn);return[t(Et*pi,ln*r(Nn)),ln?P(Yt*pi/ln):0]}},at}var Eo=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Wf=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],is=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],oo=[[.9245,0],[0,0],[.01943,0]],pc=[[.721316,0],[0,0],[-.00881625,-.00617325]];function xu(){return hl(Eo,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function zl(){return hl(Wf,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Kc(){return hl(is,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Ju(){return hl(oo,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function gc(){return hl(pc,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function hl(je,Ze){var at=x.geoProjection(Gf(je)).rotate(Ze).clipAngle(90),lt=x.geoRotation(Ze),Tt=at.center;return delete at.rotate,at.center=function(gt){return arguments.length?Tt(lt(gt)):lt.invert(Tt())},at}var yf=F(6),Jc=F(7);function Uc(je,Ze){var at=P(7*h(Ze)/(3*yf));return[yf*je*(2*r(2*at/3)-1)/Jc,9*h(at/3)/Jc]}Uc.invert=function(je,Ze){var at=3*P(Ze*Jc/9);return[je*Jc/(yf*(2*r(2*at/3)-1)),P(h(at)*3*yf/7)]};function $u(){return x.geoProjection(Uc).scale(164.859)}function jc(je,Ze){for(var at=(1+_)*h(Ze),lt=Ze,Tt=0,gt;Tt<25&&(lt-=gt=(h(lt/2)+h(lt)-at)/(.5*r(lt/2)+r(lt)),!(E(gt)y&&--lt>0);return gt=at*at,Et=gt*gt,Yt=gt*Et,[je/(.84719-.13063*gt+Yt*Yt*(-.04515+.05494*gt-.02326*Et+.00331*Yt)),at]};function wu(){return x.geoProjection(sc).scale(175.295)}function eu(je,Ze){return[je*(1+r(Ze))/2,2*(Ze-T(Ze/2))]}eu.invert=function(je,Ze){for(var at=Ze/2,lt=0,Tt=1/0;lt<10&&E(Tt)>l;++lt){var gt=r(Ze/2);Ze-=Tt=(Ze-T(Ze/2)-at)/(1-.5/(gt*gt))}return[2*je/(1+r(Ze)),Ze]};function Sc(){return x.geoProjection(eu).scale(152.63)}var ef=[[[[-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 ps(){return bi(fe(1/0),ef).rotate([20,0]).scale(152.63)}function Vc(je,Ze){var at=h(Ze),lt=r(Ze),Tt=v(je);if(je===0||E(Ze)===S)return[0,Ze];if(Ze===0)return[je,0];if(E(je)===S)return[je*lt,S*at];var gt=b/(2*je)-2*je/b,Et=2*Ze/b,Yt=(1-Et*Et)/(at-Et),rr=gt*gt,sr=Yt*Yt,Sr=1+rr/sr,Nr=1+sr/rr,Qr=(gt*at/Yt-gt/2)/Sr,ia=(sr*at/rr+Yt/2)/Nr,_a=Qr*Qr+lt*lt/Sr,za=ia*ia-(sr*at*at/rr+Yt*at-1)/Nr;return[S*(Qr+F(_a)*Tt),S*(ia+F(za<0?0:za)*v(-Ze*gt)*Tt)]}Vc.invert=function(je,Ze){je/=S,Ze/=S;var at=je*je,lt=Ze*Ze,Tt=at+lt,gt=b*b;return[je?(Tt-1+F((1-Tt)*(1-Tt)+4*at))/(2*je)*S:0,Fe(function(Et){return Tt*(b*h(Et)-2*Et)*b+4*Et*Et*(Ze-h(Et))+2*b*Et-gt*Ze},0)]};function Zf(){return x.geoProjection(Vc).scale(127.267)}var mf=1.0148,Mc=.23185,_f=-.14499,tu=.02406,xf=mf,Fl=5*Mc,ru=7*_f,Uu=9*tu,$s=1.790857183;function Qu(je,Ze){var at=Ze*Ze;return[je,Ze*(mf+at*at*(Mc+at*(_f+tu*at)))]}Qu.invert=function(je,Ze){Ze>$s?Ze=$s:Ze<-$s&&(Ze=-$s);var at=Ze,lt;do{var Tt=at*at;at-=lt=(at*(mf+Tt*Tt*(Mc+Tt*(_f+tu*Tt)))-Ze)/(xf+Tt*Tt*(Fl+Tt*(ru+Uu*Tt)))}while(E(lt)>l);return[je,at]};function Tu(){return x.geoProjection(Qu).scale(139.319)}function au(je,Ze){if(E(Ze)l&&--Tt>0);return Et=T(lt),[(E(Ze)=0;)if(lt=Ze[Yt],at[0]===lt[0]&&at[1]===lt[1]){if(gt)return[gt,at];gt=at}}}function Cl(je){for(var Ze=je.length,at=[],lt=je[Ze-1],Tt=0;Tt0?[-lt[0],0]:[180-lt[0],180])};var Ze=mc.map(function(at){return{face:at,project:je(at)}});return[-1,0,0,1,0,1,4,5].forEach(function(at,lt){var Tt=Ze[at];Tt&&(Tt.children||(Tt.children=[])).push(Ze[lt])}),lc(Ze[0],function(at,lt){return Ze[at<-b/2?lt<0?6:4:at<0?lt<0?2:0:atlt^ia>lt&&at<(Qr-sr)*(lt-Sr)/(ia-Sr)+sr&&(Tt=!Tt)}return Tt}function xl(je,Ze){var at=Ze.stream,lt;if(!at)throw new Error("invalid projection");switch(je&&je.type){case"Feature":lt=ou;break;case"FeatureCollection":lt=nf;break;default:lt=Au;break}return lt(je,at)}function nf(je,Ze){return{type:"FeatureCollection",features:je.features.map(function(at){return ou(at,Ze)})}}function ou(je,Ze){return{type:"Feature",id:je.id,properties:je.properties,geometry:Au(je.geometry,Ze)}}function Ru(je,Ze){return{type:"GeometryCollection",geometries:je.geometries.map(function(at){return Au(at,Ze)})}}function Au(je,Ze){if(!je)return null;if(je.type==="GeometryCollection")return Ru(je,Ze);var at;switch(je.type){case"Point":at=bl;break;case"MultiPoint":at=bl;break;case"LineString":at=tc;break;case"MultiLineString":at=tc;break;case"Polygon":at=Su;break;case"MultiPolygon":at=Su;break;case"Sphere":at=Su;break;default:return null}return x.geoStream(je,Ze(at)),at.result()}var Zs=[],Ol=[],bl={point:function(je,Ze){Zs.push([je,Ze])},result:function(){var je=Zs.length?Zs.length<2?{type:"Point",coordinates:Zs[0]}:{type:"MultiPoint",coordinates:Zs}:null;return Zs=[],je}},tc={lineStart:Iu,point:function(je,Ze){Zs.push([je,Ze])},lineEnd:function(){Zs.length&&(Ol.push(Zs),Zs=[])},result:function(){var je=Ol.length?Ol.length<2?{type:"LineString",coordinates:Ol[0]}:{type:"MultiLineString",coordinates:Ol}:null;return Ol=[],je}},Su={polygonStart:Iu,lineStart:Iu,point:function(je,Ze){Zs.push([je,Ze])},lineEnd:function(){var je=Zs.length;if(je){do Zs.push(Zs[0].slice());while(++je<4);Ol.push(Zs),Zs=[]}},polygonEnd:Iu,result:function(){if(!Ol.length)return null;var je=[],Ze=[];return Ol.forEach(function(at){bc(at)?je.push([at]):Ze.push(at)}),Ze.forEach(function(at){var lt=at[0];je.some(function(Tt){if(Lf(Tt[0],lt))return Tt.push(at),!0})||je.push([at])}),Ol=[],je.length?je.length>1?{type:"MultiPolygon",coordinates:je}:{type:"Polygon",coordinates:je[0]}:null}};function Cc(je){var Ze=je(S,0)[0]-je(-S,0)[0];function at(lt,Tt){var gt=E(lt)0?lt-b:lt+b,Tt),Yt=(Et[0]-Et[1])*_,rr=(Et[0]+Et[1])*_;if(gt)return[Yt,rr];var sr=Ze*_,Sr=Yt>0^rr>0?-1:1;return[Sr*Yt-v(rr)*sr,Sr*rr-v(Yt)*sr]}return je.invert&&(at.invert=function(lt,Tt){var gt=(lt+Tt)*_,Et=(Tt-lt)*_,Yt=E(gt)<.5*Ze&&E(Et)<.5*Ze;if(!Yt){var rr=Ze*_,sr=gt>0^Et>0?-1:1,Sr=-sr*lt+(Et>0?1:-1)*rr,Nr=-sr*Tt+(gt>0?1:-1)*rr;gt=(-Sr-Nr)*_,Et=(Sr-Nr)*_}var Qr=je.invert(gt,Et);return Yt||(Qr[0]+=gt>0?b:-b),Qr}),x.geoProjection(at).rotate([-90,-90,45]).clipAngle(180-.001)}function Ht(){return Cc(ra).scale(176.423)}function ur(){return Cc(Ci).scale(111.48)}function qr(je,Ze){if(!(0<=(Ze=+Ze)&&Ze<=20))throw new Error("invalid digits");function at(sr){var Sr=sr.length,Nr=2,Qr=new Array(Sr);for(Qr[0]=+sr[0].toFixed(Ze),Qr[1]=+sr[1].toFixed(Ze);Nr2||ia[0]!=Sr[0]||ia[1]!=Sr[1])&&(Nr.push(ia),Sr=ia)}return Nr.length===1&&sr.length>1&&Nr.push(at(sr[sr.length-1])),Nr}function gt(sr){return sr.map(Tt)}function Et(sr){if(sr==null)return sr;var Sr;switch(sr.type){case"GeometryCollection":Sr={type:"GeometryCollection",geometries:sr.geometries.map(Et)};break;case"Point":Sr={type:"Point",coordinates:at(sr.coordinates)};break;case"MultiPoint":Sr={type:sr.type,coordinates:lt(sr.coordinates)};break;case"LineString":Sr={type:sr.type,coordinates:Tt(sr.coordinates)};break;case"MultiLineString":case"Polygon":Sr={type:sr.type,coordinates:gt(sr.coordinates)};break;case"MultiPolygon":Sr={type:"MultiPolygon",coordinates:sr.coordinates.map(gt)};break;default:return sr}return sr.bbox!=null&&(Sr.bbox=sr.bbox),Sr}function Yt(sr){var Sr={type:"Feature",properties:sr.properties,geometry:Et(sr.geometry)};return sr.id!=null&&(Sr.id=sr.id),sr.bbox!=null&&(Sr.bbox=sr.bbox),Sr}if(je!=null)switch(je.type){case"Feature":return Yt(je);case"FeatureCollection":{var rr={type:"FeatureCollection",features:je.features.map(Yt)};return je.bbox!=null&&(rr.bbox=je.bbox),rr}default:return Et(je)}return je}function Or(je){var Ze=h(je);function at(lt,Tt){var gt=Ze?T(lt*Ze/2)/Ze:lt/2;if(!Tt)return[2*gt,-je];var Et=2*e(gt*h(Tt)),Yt=1/T(Tt);return[h(Et)*Yt,Tt+(1-r(Et))*Yt-je]}return at.invert=function(lt,Tt){if(E(Tt+=je)l&&--Yt>0);var Qr=lt*(sr=T(Et)),ia=T(E(Tt)0?S:-S)*(rr+Tt*(Sr-Et)/2+Tt*Tt*(Sr-2*rr+Et)/2)]}ja.invert=function(je,Ze){var at=Ze/S,lt=at*90,Tt=s(18,E(lt/5)),gt=n(0,a(Tt));do{var Et=Fa[gt][1],Yt=Fa[gt+1][1],rr=Fa[s(19,gt+2)][1],sr=rr-Et,Sr=rr-2*Yt+Et,Nr=2*(E(at)-Yt)/sr,Qr=Sr/sr,ia=Nr*(1-Qr*Nr*(1-2*Qr*Nr));if(ia>=0||gt===1){lt=(Ze>=0?5:-5)*(ia+Tt);var _a=50,za;do Tt=s(18,E(lt)/5),gt=a(Tt),ia=Tt-gt,Et=Fa[gt][1],Yt=Fa[gt+1][1],rr=Fa[s(19,gt+2)][1],lt-=(za=(Ze>=0?S:-S)*(Yt+ia*(rr-Et)/2+ia*ia*(rr-2*Yt+Et)/2)-Ze)*g;while(E(za)>y&&--_a>0);break}}while(--gt>=0);var nn=Fa[gt][0],en=Fa[gt+1][0],ln=Fa[s(19,gt+2)][0];return[je/(en+ia*(ln-nn)/2+ia*ia*(ln-2*en+nn)/2),lt*m]};function sn(){return x.geoProjection(ja).scale(152.63)}function gn(je){function Ze(at,lt){var Tt=r(lt),gt=(je-1)/(je-Tt*r(at));return[gt*Tt*h(at),gt*h(lt)]}return Ze.invert=function(at,lt){var Tt=at*at+lt*lt,gt=F(Tt),Et=(je-F(1-Tt*(je+1)/(je-1)))/((je-1)/gt+gt/(je-1));return[t(at*Et,gt*F(1-Et*Et)),gt?P(lt*Et/gt):0]},Ze}function kn(je,Ze){var at=gn(je);if(!Ze)return at;var lt=r(Ze),Tt=h(Ze);function gt(Et,Yt){var rr=at(Et,Yt),sr=rr[1],Sr=sr*Tt/(je-1)+lt;return[rr[0]*lt/Sr,sr/Sr]}return gt.invert=function(Et,Yt){var rr=(je-1)/(je-1-Yt*Tt);return at.invert(rr*Et,rr*Yt*lt)},gt}function Ja(){var je=2,Ze=0,at=x.geoProjectionMutator(kn),lt=at(je,Ze);return lt.distance=function(Tt){return arguments.length?at(je=+Tt,Ze):je},lt.tilt=function(Tt){return arguments.length?at(je,Ze=Tt*m):Ze*g},lt.scale(432.147).clipAngle(z(1/je)*g-1e-6)}var _n=1e-4,on=1e4,Wa=-180,On=Wa+_n,zi=180,ki=zi-_n,ji=-90,Ni=ji+_n,Bn=90,An=Bn-_n;function Ki(je){return je.length>0}function ko(je){return Math.floor(je*on)/on}function $o(je){return je===ji||je===Bn?[0,je]:[Wa,ko(je)]}function Ls(je){var Ze=je[0],at=je[1],lt=!1;return Ze<=On?(Ze=Wa,lt=!0):Ze>=ki&&(Ze=zi,lt=!0),at<=Ni?(at=ji,lt=!0):at>=An&&(at=Bn,lt=!0),lt?[Ze,at]:je}function os(je){return je.map(Ls)}function As(je,Ze,at){for(var lt=0,Tt=je.length;lt=ki||Sr<=Ni||Sr>=An){gt[Et]=Ls(rr);for(var Nr=Et+1;NrOn&&iaNi&&_a=Yt)break;at.push({index:-1,polygon:Ze,ring:gt=gt.slice(Nr-1)}),gt[0]=$o(gt[0][1]),Et=-1,Yt=gt.length}}}}function jo(je){var Ze,at=je.length,lt={},Tt={},gt,Et,Yt,rr,sr;for(Ze=0;Ze0?b-Yt:Yt)*g],sr=x.geoProjection(je(Et)).rotate(rr),Sr=x.geoRotation(rr),Nr=sr.center;return delete sr.rotate,sr.center=function(Qr){return arguments.length?Nr(Sr(Qr)):Sr.invert(Nr())},sr.clipAngle(90)}function Jo(je){var Ze=r(je);function at(lt,Tt){var gt=x.geoGnomonicRaw(lt,Tt);return gt[0]*=Ze,gt}return at.invert=function(lt,Tt){return x.geoGnomonicRaw.invert(lt/Ze,Tt)},at}function Bl(){return jl([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function jl(je,Ze){return gs(Jo,je,Ze)}function Vl(je){if(!(je*=2))return x.geoAzimuthalEquidistantRaw;var Ze=-je/2,at=-Ze,lt=je*je,Tt=T(at),gt=.5/h(at);function Et(Yt,rr){var sr=z(r(rr)*r(Yt-Ze)),Sr=z(r(rr)*r(Yt-at)),Nr=rr<0?-1:1;return sr*=sr,Sr*=Sr,[(sr-Sr)/(2*je),Nr*F(4*lt*Sr-(lt-sr+Sr)*(lt-sr+Sr))/(2*je)]}return Et.invert=function(Yt,rr){var sr=rr*rr,Sr=r(F(sr+(Qr=Yt+Ze)*Qr)),Nr=r(F(sr+(Qr=Yt+at)*Qr)),Qr,ia;return[t(ia=Sr-Nr,Qr=(Sr+Nr)*Tt),(rr<0?-1:1)*z(F(Qr*Qr+ia*ia)*gt)]},Et}function cc(){return ql([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function ql(je,Ze){return gs(Vl,je,Ze)}function Vu(je,Ze){if(E(Ze)l&&--Yt>0);return[v(je)*(F(Tt*Tt+4)+Tt)*b/4,S*Et]};function wc(){return x.geoProjection(Du).scale(127.16)}function De(je,Ze,at,lt,Tt){function gt(Et,Yt){var rr=at*h(lt*Yt),sr=F(1-rr*rr),Sr=F(2/(1+sr*r(Et*=Tt)));return[je*sr*Sr*h(Et),Ze*rr*Sr]}return gt.invert=function(Et,Yt){var rr=Et/je,sr=Yt/Ze,Sr=F(rr*rr+sr*sr),Nr=2*P(Sr/2);return[t(Et*T(Nr),je*Sr)/Tt,Sr&&P(Yt*h(Nr)/(Ze*at*Sr))/lt]},gt}function I(je,Ze,at,lt){var Tt=b/3;je=n(je,l),Ze=n(Ze,l),je=s(je,S),Ze=s(Ze,b-l),at=n(at,0),at=s(at,100-l),lt=n(lt,l);var gt=at/100+1,Et=lt/100,Yt=z(gt*r(Tt))/Tt,rr=h(je)/h(Yt*S),sr=Ze/b,Sr=F(Et*h(je/2)/h(Ze/2)),Nr=Sr/F(sr*rr*Yt),Qr=1/(Sr*F(sr*rr*Yt));return De(Nr,Qr,rr,Yt,sr)}function ne(){var je=65*m,Ze=60*m,at=20,lt=200,Tt=x.geoProjectionMutator(I),gt=Tt(je,Ze,at,lt);return gt.poleline=function(Et){return arguments.length?Tt(je=+Et*m,Ze,at,lt):je*g},gt.parallels=function(Et){return arguments.length?Tt(je,Ze=+Et*m,at,lt):Ze*g},gt.inflation=function(Et){return arguments.length?Tt(je,Ze,at=+Et,lt):at},gt.ratio=function(Et){return arguments.length?Tt(je,Ze,at,lt=+Et):lt},gt.scale(163.775)}function Te(){return ne().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var Se=4*b+3*F(3),Ie=2*F(2*b*F(3)/Se),ot=Ke(Ie*F(3)/b,Ie,Se/6);function yt(){return x.geoProjection(ot).scale(176.84)}function Ct(je,Ze){return[je*F(1-3*Ze*Ze/(b*b)),Ze]}Ct.invert=function(je,Ze){return[je/F(1-3*Ze*Ze/(b*b)),Ze]};function Wt(){return x.geoProjection(Ct).scale(152.63)}function nr(je,Ze){var at=r(Ze),lt=r(je)*at,Tt=1-lt,gt=r(je=t(h(je)*at,-h(Ze))),Et=h(je);return at=F(1-lt*lt),[Et*at-gt*Tt,-gt*at-Et*Tt]}nr.invert=function(je,Ze){var at=(je*je+Ze*Ze)/-2,lt=F(-at*(2+at)),Tt=Ze*at+je*lt,gt=je*at-Ze*lt,Et=F(gt*gt+Tt*Tt);return[t(lt*Tt,Et*(1+at)),Et?-P(lt*gt/Et):0]};function or(){return x.geoProjection(nr).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function Fr(je,Ze){var at=ue(je,Ze);return[(at[0]+je/S)/2,(at[1]+Ze)/2]}Fr.invert=function(je,Ze){var at=je,lt=Ze,Tt=25;do{var gt=r(lt),Et=h(lt),Yt=h(2*lt),rr=Et*Et,sr=gt*gt,Sr=h(at),Nr=r(at/2),Qr=h(at/2),ia=Qr*Qr,_a=1-sr*Nr*Nr,za=_a?z(gt*Nr)*F(nn=1/_a):nn=0,nn,en=.5*(2*za*gt*Qr+at/S)-je,ln=.5*(za*Et+lt)-Ze,Nn=.5*nn*(sr*ia+za*gt*Nr*rr)+.5/S,pi=nn*(Sr*Yt/4-za*Et*Qr),ii=.125*nn*(Yt*Qr-za*Et*sr*Sr),Gi=.5*nn*(rr*Nr+za*ia*gt)+.5,Bo=pi*ii-Gi*Nn,No=(ln*pi-en*Gi)/Bo,po=(en*ii-ln*Nn)/Bo;at-=No,lt-=po}while((E(No)>l||E(po)>l)&&--Tt>0);return[at,lt]};function Wr(){return x.geoProjection(Fr).scale(158.837)}d.geoNaturalEarth=x.geoNaturalEarth1,d.geoNaturalEarthRaw=x.geoNaturalEarth1Raw,d.geoAiry=Q,d.geoAiryRaw=Z,d.geoAitoff=oe,d.geoAitoffRaw=ue,d.geoArmadillo=j,d.geoArmadilloRaw=le,d.geoAugust=$,d.geoAugustRaw=J,d.geoBaker=q,d.geoBakerRaw=ee,d.geoBerghaus=ie,d.geoBerghausRaw=ae,d.geoBertin1953=et,d.geoBertin1953Raw=qe,d.geoBoggs=$e,d.geoBoggsRaw=Re,d.geoBonne=Rt,d.geoBonneRaw=St,d.geoBottomley=ir,d.geoBottomleyRaw=Ut,d.geoBromley=Mr,d.geoBromleyRaw=ar,d.geoChamberlin=ve,d.geoChamberlinRaw=ze,d.geoChamberlinAfrica=Oe,d.geoCollignon=be,d.geoCollignonRaw=ge,d.geoCraig=We,d.geoCraigRaw=Pe,d.geoCraster=Mt,d.geoCrasterRaw=_t,d.geoCylindricalEqualArea=Bt,d.geoCylindricalEqualAreaRaw=Nt,d.geoCylindricalStereographic=Zt,d.geoCylindricalStereographicRaw=qt,d.geoEckert1=ta,d.geoEckert1Raw=lr,d.geoEckert2=wa,d.geoEckert2Raw=da,d.geoEckert3=Ia,d.geoEckert3Raw=ma,d.geoEckert4=La,d.geoEckert4Raw=va,d.geoEckert5=Vt,d.geoEckert5Raw=Ka,d.geoEckert6=jt,d.geoEckert6Raw=Lt,d.geoEisenlohr=Br,d.geoEisenlohrRaw=gr,d.geoFahey=ga,d.geoFaheyRaw=Ur,d.geoFoucaut=Pa,d.geoFoucautRaw=Aa,d.geoFoucautSinusoidal=Oa,d.geoFoucautSinusoidalRaw=sa,d.geoGilbert=Lr,d.geoGingery=kr,d.geoGingeryRaw=Er,d.geoGinzburg4=Hr,d.geoGinzburg4Raw=Pr,d.geoGinzburg5=Jr,d.geoGinzburg5Raw=Zr,d.geoGinzburg6=Qt,d.geoGinzburg6Raw=wt,d.geoGinzburg8=$r,d.geoGinzburg8Raw=mr,d.geoGinzburg9=Sa,d.geoGinzburg9Raw=oa,d.geoGringorten=Ga,d.geoGringortenRaw=ra,d.geoGuyou=mi,d.geoGuyouRaw=Ci,d.geoHammer=Ae,d.geoHammerRaw=fe,d.geoHammerRetroazimuthal=Wo,d.geoHammerRetroazimuthalRaw=uo,d.geoHealpix=bs,d.geoHealpixRaw=Ao,d.geoHill=fs,d.geoHillRaw=as,d.geoHomolosine=Ui,d.geoHomolosineRaw=ds,d.geoHufnagel=Mo,d.geoHufnagelRaw=ms,d.geoHyperelliptical=fo,d.geoHyperellipticalRaw=Rn,d.geoInterrupt=bi,d.geoInterruptedBoggs=$l,d.geoInterruptedHomolosine=Ql,d.geoInterruptedMollweide=Is,d.geoInterruptedMollweideHemispheres=Xu,d.geoInterruptedSinuMollweide=Bu,d.geoInterruptedSinusoidal=gf,d.geoKavrayskiy7=_u,d.geoKavrayskiy7Raw=ns,d.geoLagrange=ml,d.geoLagrangeRaw=Nc,d.geoLarrivee=Yu,d.geoLarriveeRaw=_l,d.geoLaskowski=Tl,d.geoLaskowskiRaw=Ts,d.geoLittrow=Cs,d.geoLittrowRaw=Ko,d.geoLoximuthal=Ul,d.geoLoximuthalRaw=Nu,d.geoMiller=Bs,d.geoMillerRaw=Ku,d.geoModifiedStereographic=hl,d.geoModifiedStereographicRaw=Gf,d.geoModifiedStereographicAlaska=xu,d.geoModifiedStereographicGs48=zl,d.geoModifiedStereographicGs50=Kc,d.geoModifiedStereographicMiller=Ju,d.geoModifiedStereographicLee=gc,d.geoMollweide=Me,d.geoMollweideRaw=Xe,d.geoMtFlatPolarParabolic=$u,d.geoMtFlatPolarParabolicRaw=Uc,d.geoMtFlatPolarQuartic=$c,d.geoMtFlatPolarQuarticRaw=jc,d.geoMtFlatPolarSinusoidal=Qc,d.geoMtFlatPolarSinusoidalRaw=bu,d.geoNaturalEarth2=wu,d.geoNaturalEarth2Raw=sc,d.geoNellHammer=Sc,d.geoNellHammerRaw=eu,d.geoInterruptedQuarticAuthalic=ps,d.geoNicolosi=Zf,d.geoNicolosiRaw=Vc,d.geoPatterson=Tu,d.geoPattersonRaw=Qu,d.geoPolyconic=Ns,d.geoPolyconicRaw=au,d.geoPolyhedral=lc,d.geoPolyhedralButterfly=Us,d.geoPolyhedralCollignon=af,d.geoPolyhedralWaterman=Rs,d.geoProject=xl,d.geoGringortenQuincuncial=Ht,d.geoPeirceQuincuncial=ur,d.geoPierceQuincuncial=ur,d.geoQuantize=qr,d.geoQuincuncial=Cc,d.geoRectangularPolyconic=ua,d.geoRectangularPolyconicRaw=Or,d.geoRobinson=sn,d.geoRobinsonRaw=ja,d.geoSatellite=Ja,d.geoSatelliteRaw=kn,d.geoSinuMollweide=Os,d.geoSinuMollweideRaw=Jn,d.geoSinusoidal=At,d.geoSinusoidalRaw=Je,d.geoStitch=Ss,d.geoTimes=ao,d.geoTimesRaw=fi,d.geoTwoPointAzimuthal=jl,d.geoTwoPointAzimuthalRaw=Jo,d.geoTwoPointAzimuthalUsa=Bl,d.geoTwoPointEquidistant=ql,d.geoTwoPointEquidistantRaw=Vl,d.geoTwoPointEquidistantUsa=cc,d.geoVanDerGrinten=ol,d.geoVanDerGrintenRaw=Vu,d.geoVanDerGrinten2=Vi,d.geoVanDerGrinten2Raw=rc,d.geoVanDerGrinten3=qu,d.geoVanDerGrinten3Raw=eo,d.geoVanDerGrinten4=wc,d.geoVanDerGrinten4Raw=Du,d.geoWagner=ne,d.geoWagner7=Te,d.geoWagnerRaw=I,d.geoWagner4=yt,d.geoWagner4Raw=ot,d.geoWagner6=Wt,d.geoWagner6Raw=Ct,d.geoWiechel=or,d.geoWiechelRaw=nr,d.geoWinkel3=Wr,d.geoWinkel3Raw=Fr,Object.defineProperty(d,"__esModule",{value:!0})})}}),xP=He({"src/plots/geo/zoom.js"(Y,G){var d=Qn(),x=Gr(),A=Ei(),E=Math.PI/180,e=180/Math.PI,t={cursor:"pointer"},r={cursor:"auto"};function o(g,m){var R=g.projection,P;return m._isScoped?P=n:m._isClipped?P=c:P=s,P(g,R)}G.exports=o;function a(g,m){return d.behavior.zoom().translate(m.translate()).scale(m.scale())}function i(g,m,R){var P=g.id,z=g.graphDiv,F=z.layout,B=F[P],O=z._fullLayout,L=O[P],N={},U={};function Z(Q,ue){N[P+"."+Q]=x.nestedProperty(B,Q).get(),A.call("_storeDirectGUIEdit",F,O._preGUI,N);var oe=x.nestedProperty(L,Q);oe.get()!==ue&&(oe.set(ue),x.nestedProperty(B,Q).set(ue),U[P+"."+Q]=ue)}R(Z),Z("projection.scale",m.scale()/g.fitScale),Z("fitbounds",!1),z.emit("plotly_relayout",U)}function n(g,m){var R=a(g,m);function P(){d.select(this).style(t)}function z(){m.scale(d.event.scale).translate(d.event.translate),g.render(!0);var O=m.invert(g.midPt);g.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":m.scale()/g.fitScale,"geo.center.lon":O[0],"geo.center.lat":O[1]})}function F(O){var L=m.invert(g.midPt);O("center.lon",L[0]),O("center.lat",L[1])}function B(){d.select(this).style(r),i(g,m,F)}return R.on("zoomstart",P).on("zoom",z).on("zoomend",B),R}function s(g,m){var R=a(g,m),P=2,z,F,B,O,L,N,U,Z,Q;function ue(X){return m.invert(X)}function oe(X){var re=ue(X);if(!re)return!0;var ee=m(re);return Math.abs(ee[0]-X[0])>P||Math.abs(ee[1]-X[1])>P}function le(){d.select(this).style(t),z=d.mouse(this),F=m.rotate(),B=m.translate(),O=F,L=ue(z)}function j(){if(N=d.mouse(this),oe(z)){R.scale(m.scale()),R.translate(m.translate());return}m.scale(d.event.scale),m.translate([B[0],d.event.translate[1]]),L?ue(N)&&(Z=ue(N),U=[O[0]+(Z[0]-L[0]),F[1],F[2]],m.rotate(U),O=U):(z=N,L=ue(z)),Q=!0,g.render(!0);var X=m.rotate(),re=m.invert(g.midPt);g.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":m.scale()/g.fitScale,"geo.center.lon":re[0],"geo.center.lat":re[1],"geo.projection.rotation.lon":-X[0]})}function J(){d.select(this).style(r),Q&&i(g,m,$)}function $(X){var re=m.rotate(),ee=m.invert(g.midPt);X("projection.rotation.lon",-re[0]),X("center.lon",ee[0]),X("center.lat",ee[1])}return R.on("zoomstart",le).on("zoom",j).on("zoomend",J),R}function c(g,m){m.rotate(),m.scale();var R=a(g,m),P=u(R,"zoomstart","zoom","zoomend"),z=0,F=R.on,B;R.on("zoomstart",function(){d.select(this).style(t);var Z=d.mouse(this),Q=m.rotate(),ue=Q,oe=m.translate(),le=v(Q);B=f(m,Z),F.call(R,"zoom",function(){var j=d.mouse(this);if(m.scale(d.event.scale),!B)Z=j,B=f(m,Z);else if(f(m,j)){m.rotate(Q).translate(oe);var J=f(m,j),$=T(B,J),X=M(h(le,$)),re=l(X,B,ue);(!isFinite(re[0])||!isFinite(re[1])||!isFinite(re[2]))&&(re=ue),m.rotate(re),ue=re}L(P.of(this,arguments))}),O(P.of(this,arguments))}).on("zoomend",function(){d.select(this).style(r),F.call(R,"zoom",null),N(P.of(this,arguments)),i(g,m,U)}).on("zoom.redraw",function(){g.render(!0);var Z=m.rotate();g.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":m.scale()/g.fitScale,"geo.projection.rotation.lon":-Z[0],"geo.projection.rotation.lat":-Z[1]})});function O(Z){z++||Z({type:"zoomstart"})}function L(Z){Z({type:"zoom"})}function N(Z){--z||Z({type:"zoomend"})}function U(Z){var Q=m.rotate();Z("projection.rotation.lon",-Q[0]),Z("projection.rotation.lat",-Q[1])}return d.rebind(R,P,"on")}function f(g,m){var R=g.invert(m);return R&&isFinite(R[0])&&isFinite(R[1])&&_(R)}function v(g){var m=.5*g[0]*E,R=.5*g[1]*E,P=.5*g[2]*E,z=Math.sin(m),F=Math.cos(m),B=Math.sin(R),O=Math.cos(R),L=Math.sin(P),N=Math.cos(P);return[F*O*N+z*B*L,z*O*N-F*B*L,F*B*N+z*O*L,F*O*L-z*B*N]}function h(g,m){var R=g[0],P=g[1],z=g[2],F=g[3],B=m[0],O=m[1],L=m[2],N=m[3];return[R*B-P*O-z*L-F*N,R*O+P*B+z*N-F*L,R*L-P*N+z*B+F*O,R*N+P*L-z*O+F*B]}function T(g,m){if(!(!g||!m)){var R=p(g,m),P=Math.sqrt(w(R,R)),z=.5*Math.acos(Math.max(-1,Math.min(1,w(g,m)))),F=Math.sin(z)/P;return P&&[Math.cos(z),R[2]*F,-R[1]*F,R[0]*F]}}function l(g,m,R){var P=S(m,2,g[0]);P=S(P,1,g[1]),P=S(P,0,g[2]-R[2]);var z=m[0],F=m[1],B=m[2],O=P[0],L=P[1],N=P[2],U=Math.atan2(F,z)*e,Z=Math.sqrt(z*z+F*F),Q,ue;Math.abs(L)>Z?(ue=(L>0?90:-90)-U,Q=0):(ue=Math.asin(L/Z)*e-U,Q=Math.sqrt(Z*Z-L*L));var oe=180-ue-2*U,le=(Math.atan2(N,O)-Math.atan2(B,Q))*e,j=(Math.atan2(N,O)-Math.atan2(B,-Q))*e,J=y(R[0],R[1],ue,le),$=y(R[0],R[1],oe,j);return J<=$?[ue,le,R[2]]:[oe,j,R[2]]}function y(g,m,R,P){var z=b(R-g),F=b(P-m);return Math.sqrt(z*z+F*F)}function b(g){return(g%360+540)%360-180}function S(g,m,R){var P=R*E,z=g.slice(),F=m===0?1:0,B=m===2?1:2,O=Math.cos(P),L=Math.sin(P);return z[F]=g[F]*O-g[B]*L,z[B]=g[B]*O+g[F]*L,z}function M(g){return[Math.atan2(2*(g[0]*g[1]+g[2]*g[3]),1-2*(g[1]*g[1]+g[2]*g[2]))*e,Math.asin(Math.max(-1,Math.min(1,2*(g[0]*g[2]-g[3]*g[1]))))*e,Math.atan2(2*(g[0]*g[3]+g[1]*g[2]),1-2*(g[2]*g[2]+g[3]*g[3]))*e]}function _(g){var m=g[0]*E,R=g[1]*E,P=Math.cos(R);return[P*Math.cos(m),P*Math.sin(m),Math.sin(R)]}function w(g,m){for(var R=0,P=0,z=g.length;P0&&L._module.calcGeoJSON(O,P)}if(!z){var N=this.updateProjection(R,P);if(N)return;(!this.viewInitial||this.scope!==F.scope)&&this.saveViewInitial(F)}this.scope=F.scope,this.updateBaseLayers(P,F),this.updateDims(P,F),this.updateFx(P,F),s.generalUpdatePerTraceModule(this.graphDiv,this,R,F);var U=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=U.selectAll(".point"),this.dataPoints.text=U.selectAll("text"),this.dataPaths.line=U.selectAll(".js-line");var Z=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=Z.selectAll("path"),this._render()},p.updateProjection=function(R,P){var z=this.graphDiv,F=P[this.id],B=P._size,O=F.domain,L=F.projection,N=F.lonaxis,U=F.lataxis,Z=N._ax,Q=U._ax,ue=this.projection=u(F),oe=[[B.l+B.w*O.x[0],B.t+B.h*(1-O.y[1])],[B.l+B.w*O.x[1],B.t+B.h*(1-O.y[0])]],le=F.center||{},j=L.rotation||{},J=N.range||[],$=U.range||[];if(F.fitbounds){Z._length=oe[1][0]-oe[0][0],Q._length=oe[1][1]-oe[0][1],Z.range=f(z,Z),Q.range=f(z,Q);var X=(Z.range[0]+Z.range[1])/2,re=(Q.range[0]+Q.range[1])/2;if(F._isScoped)le={lon:X,lat:re};else if(F._isClipped){le={lon:X,lat:re},j={lon:X,lat:re,roll:j.roll};var ee=L.type,q=b.lonaxisSpan[ee]/2||180,ae=b.lataxisSpan[ee]/2||90;J=[X-q,X+q],$=[re-ae,re+ae]}else le={lon:X,lat:re},j={lon:X,lat:j.lat,roll:j.roll}}ue.center([le.lon-j.lon,le.lat-j.lat]).rotate([-j.lon,-j.lat,j.roll]).parallels(L.parallels);var ie=m(J,$);ue.fitExtent(oe,ie);var fe=this.bounds=ue.getBounds(ie),we=this.fitScale=ue.scale(),Ae=ue.translate();if(F.fitbounds){var Fe=ue.getBounds(m(Z.range,Q.range)),Ce=Math.min((fe[1][0]-fe[0][0])/(Fe[1][0]-Fe[0][0]),(fe[1][1]-fe[0][1])/(Fe[1][1]-Fe[0][1]));isFinite(Ce)?ue.scale(Ce*we):r.warn("Something went wrong during"+this.id+"fitbounds computations.")}else ue.scale(L.scale*we);var qe=this.midPt=[(fe[0][0]+fe[1][0])/2,(fe[0][1]+fe[1][1])/2];if(ue.translate([Ae[0]+(qe[0]-Ae[0]),Ae[1]+(qe[1]-Ae[1])]).clipExtent(fe),F._isAlbersUsa){var et=ue([le.lon,le.lat]),Qe=ue.translate();ue.translate([Qe[0]-(et[0]-Qe[0]),Qe[1]-(et[1]-Qe[1])])}},p.updateBaseLayers=function(R,P){var z=this,F=z.topojson,B=z.layers,O=z.basePaths;function L(oe){return oe==="lonaxis"||oe==="lataxis"}function N(oe){return!!b.lineLayers[oe]}function U(oe){return!!b.fillLayers[oe]}var Z=this.hasChoropleth?b.layersForChoropleth:b.layers,Q=Z.filter(function(oe){return N(oe)||U(oe)?P["show"+oe]:L(oe)?P[oe].showgrid:!0}),ue=z.framework.selectAll(".layer").data(Q,String);ue.exit().each(function(oe){delete B[oe],delete O[oe],d.select(this).remove()}),ue.enter().append("g").attr("class",function(oe){return"layer "+oe}).each(function(oe){var le=B[oe]=d.select(this);oe==="bg"?z.bgRect=le.append("rect").style("pointer-events","all"):L(oe)?O[oe]=le.append("path").style("fill","none"):oe==="backplot"?le.append("g").classed("choroplethlayer",!0):oe==="frontplot"?le.append("g").classed("scatterlayer",!0):N(oe)?O[oe]=le.append("path").style("fill","none").style("stroke-miterlimit",2):U(oe)&&(O[oe]=le.append("path").style("stroke","none"))}),ue.order(),ue.each(function(oe){var le=O[oe],j=b.layerNameToAdjective[oe];oe==="frame"?le.datum(b.sphereSVG):N(oe)||U(oe)?le.datum(_(F,F.objects[oe])):L(oe)&&le.datum(g(oe,P,R)).call(a.stroke,P[oe].gridcolor).call(i.dashLine,P[oe].griddash,P[oe].gridwidth),N(oe)?le.call(a.stroke,P[j+"color"]).call(i.dashLine,"",P[j+"width"]):U(oe)&&le.call(a.fill,P[j+"color"])})},p.updateDims=function(R,P){var z=this.bounds,F=(P.framewidth||0)/2,B=z[0][0]-F,O=z[0][1]-F,L=z[1][0]-B+F,N=z[1][1]-O+F;i.setRect(this.clipRect,B,O,L,N),this.bgRect.call(i.setRect,B,O,L,N).call(a.fill,P.bgcolor),this.xaxis._offset=B,this.xaxis._length=L,this.yaxis._offset=O,this.yaxis._length=N},p.updateFx=function(R,P){var z=this,F=z.graphDiv,B=z.bgRect,O=R.dragmode,L=R.clickmode;if(z.isStatic)return;function N(){var ue=z.viewInitial,oe={};for(var le in ue)oe[z.id+"."+le]=ue[le];t.call("_guiRelayout",F,oe),F.emit("plotly_doubleclick",null)}function U(ue){return z.projection.invert([ue[0]+z.xaxis._offset,ue[1]+z.yaxis._offset])}var Z=function(ue,oe){if(oe.isRect){var le=ue.range={};le[z.id]=[U([oe.xmin,oe.ymin]),U([oe.xmax,oe.ymax])]}else{var j=ue.lassoPoints={};j[z.id]=oe.map(U)}},Q={element:z.bgRect.node(),gd:F,plotinfo:{id:z.id,xaxis:z.xaxis,yaxis:z.yaxis,fillRangeItems:Z},xaxes:[z.xaxis],yaxes:[z.yaxis],subplot:z.id,clickFn:function(ue){ue===2&&T(F)}};O==="pan"?(B.node().onmousedown=null,B.call(y(z,P)),B.on("dblclick.zoom",N),F._context._scrollZoom.geo||B.on("wheel.zoom",null)):(O==="select"||O==="lasso")&&(B.on(".zoom",null),Q.prepFn=function(ue,oe,le){h(ue,oe,le,Q,O)},v.init(Q)),B.on("mousemove",function(){var ue=z.projection.invert(r.getPositionFromD3Event());if(!ue)return v.unhover(F,d.event);z.xaxis.p2c=function(){return ue[0]},z.yaxis.p2c=function(){return ue[1]},n.hover(F,d.event,z.id)}),B.on("mouseout",function(){F._dragging||v.unhover(F,d.event)}),B.on("click",function(){O!=="select"&&O!=="lasso"&&(L.indexOf("select")>-1&&l(d.event,F,[z.xaxis],[z.yaxis],z.id,Q),L.indexOf("event")>-1&&n.click(F,d.event))})},p.makeFramework=function(){var R=this,P=R.graphDiv,z=P._fullLayout,F="clip"+z._uid+R.id;R.clipDef=z._clips.append("clipPath").attr("id",F),R.clipRect=R.clipDef.append("rect"),R.framework=d.select(R.container).append("g").attr("class","geo "+R.id).call(i.setClipUrl,F,P),R.project=function(B){var O=R.projection(B);return O?[O[0]-R.xaxis._offset,O[1]-R.yaxis._offset]:[null,null]},R.xaxis={_id:"x",c2p:function(B){return R.project(B)[0]}},R.yaxis={_id:"y",c2p:function(B){return R.project(B)[1]}},R.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},c.setConvert(R.mockAxis,z)},p.saveViewInitial=function(R){var P=R.center||{},z=R.projection,F=z.rotation||{};this.viewInitial={fitbounds:R.fitbounds,"projection.scale":z.scale};var B;R._isScoped?B={"center.lon":P.lon,"center.lat":P.lat}:R._isClipped?B={"projection.rotation.lon":F.lon,"projection.rotation.lat":F.lat}:B={"center.lon":P.lon,"center.lat":P.lat,"projection.rotation.lon":F.lon},r.extendFlat(this.viewInitial,B)},p.render=function(R){this._hasMarkerAngles&&R?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},p._render=function(){var R=this.projection,P=R.getPath(),z;function F(O){var L=R(O.lonlat);return L?o(L[0],L[1]):null}function B(O){return R.isLonLatOverEdges(O.lonlat)?"none":null}for(z in this.basePaths)this.basePaths[z].attr("d",P);for(z in this.dataPaths)this.dataPaths[z].attr("d",function(O){return P(O.geojson)});for(z in this.dataPoints)this.dataPoints[z].attr("display",B).attr("transform",F)};function u(R){var P=R.projection,z=P.type,F=b.projNames[z];F="geo"+r.titleCase(F);for(var B=x[F]||e[F],O=B(),L=R._isSatellite?Math.acos(1/P.distance)*180/Math.PI:R._isClipped?b.lonaxisSpan[z]/2:null,N=["center","rotate","parallels","clipExtent"],U=function(ue){return ue?O:[]},Z=0;Zj}else return!1},O.getPath=function(){return A().projection(O)},O.getBounds=function(ue){return O.getPath().bounds(ue)},O.precision(b.precision),R._isSatellite&&O.tilt(P.tilt).distance(P.distance),L&&O.clipAngle(L-b.clipPad),O}function g(R,P,z){var F=1e-6,B=2.5,O=P[R],L=b.scopeDefaults[P.scope],N,U,Z;R==="lonaxis"?(N=L.lonaxisRange,U=L.lataxisRange,Z=function(re,ee){return[re,ee]}):R==="lataxis"&&(N=L.lataxisRange,U=L.lonaxisRange,Z=function(re,ee){return[ee,re]});var Q={type:"linear",range:[N[0],N[1]-F],tick0:O.tick0,dtick:O.dtick};c.setConvert(Q,z);var ue=c.calcTicks(Q);!P.isScoped&&R==="lonaxis"&&ue.pop();for(var oe=ue.length,le=new Array(oe),j=0;j0&&B<0&&(B+=360);var N=(B-F)/4;return{type:"Polygon",coordinates:[[[F,O],[F,L],[F+N,L],[F+2*N,L],[F+3*N,L],[B,L],[B,O],[B-N,O],[B-2*N,O],[B-3*N,O],[F,O]]]}}}}),G3=He({"src/plots/geo/layout_attributes.js"(Y,G){var d=Xc(),x=mu().attributes,A=Nf().dash,E=jy(),e=hu().overrideAll,t=Ud(),r={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:d.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:A},o=G.exports=e({domain:x({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:t(E.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:t(E.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:d.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:E.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:E.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:E.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:E.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:d.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:d.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:d.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:d.background},lonaxis:r,lataxis:r},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}}),wP=He({"src/plots/geo/layout_defaults.js"(Y,G){var d=Gr(),x=Xd(),A=Uf().getSubplotData,E=jy(),e=G3(),t=E.axesNames;G.exports=function(a,i,n){x(a,i,n,{type:"geo",attributes:e,handleDefaults:r,fullData:n,partition:"y"})};function r(o,a,i,n){var s=A(n.fullData,"geo",n.id),c=s.map(function($){return $.index}),f=i("resolution"),v=i("scope"),h=E.scopeDefaults[v],T=i("projection.type",h.projType),l=a._isAlbersUsa=T==="albers usa";l&&(v=a.scope="usa");var y=a._isScoped=v!=="world",b=a._isSatellite=T==="satellite",S=a._isConic=T.indexOf("conic")!==-1||T==="albers",M=a._isClipped=!!E.lonaxisSpan[T];if(o.visible===!1){var _=d.extendDeep({},a._template);_.showcoastlines=!1,_.showcountries=!1,_.showframe=!1,_.showlakes=!1,_.showland=!1,_.showocean=!1,_.showrivers=!1,_.showsubunits=!1,_.lonaxis&&(_.lonaxis.showgrid=!1),_.lataxis&&(_.lataxis.showgrid=!1),a._template=_}for(var w=i("visible"),p,u=0;u0&&U<0&&(U+=360);var Z=(N+U)/2,Q;if(!l){var ue=y?h.projRotate:[Z,0,0];Q=i("projection.rotation.lon",ue[0]),i("projection.rotation.lat",ue[1]),i("projection.rotation.roll",ue[2]),p=i("showcoastlines",!y&&w),p&&(i("coastlinecolor"),i("coastlinewidth")),p=i("showocean",w?void 0:!1),p&&i("oceancolor")}var oe,le;if(l?(oe=-96.6,le=38.7):(oe=y?Z:Q,le=(L[0]+L[1])/2),i("center.lon",oe),i("center.lat",le),b&&(i("projection.tilt"),i("projection.distance")),S){var j=h.projParallels||[0,60];i("projection.parallels",j)}i("projection.scale"),p=i("showland",w?void 0:!1),p&&i("landcolor"),p=i("showlakes",w?void 0:!1),p&&i("lakecolor"),p=i("showrivers",w?void 0:!1),p&&(i("rivercolor"),i("riverwidth")),p=i("showcountries",y&&v!=="usa"&&w),p&&(i("countrycolor"),i("countrywidth")),(v==="usa"||v==="north america"&&f===50)&&(i("showsubunits",w),i("subunitcolor"),i("subunitwidth")),y||(p=i("showframe",w),p&&(i("framecolor"),i("framewidth"))),i("bgcolor");var J=i("fitbounds");J&&(delete a.projection.scale,y?(delete a.center.lon,delete a.center.lat):M?(delete a.center.lon,delete a.center.lat,delete a.projection.rotation.lon,delete a.projection.rotation.lat,delete a.lonaxis.range,delete a.lataxis.range):(delete a.center.lon,delete a.center.lat,delete a.projection.rotation.lon))}}}),W3=He({"src/plots/geo/index.js"(Y,G){var d=Uf().getSubplotCalcData,x=Gr().counterRegex,A=bP(),E="geo",e=x(E),t={};t[E]={valType:"subplotid",dflt:E,editType:"calc"};function r(i){for(var n=i._fullLayout,s=i.calcdata,c=n._subplots[E],f=0;f")}}}}),X_=He({"src/traces/choropleth/event_data.js"(Y,G){G.exports=function(x,A,E,e,t){x.location=A.location,x.z=A.z;var r=e[t];return r.fIn&&r.fIn.properties&&(x.properties=r.fIn.properties),x.ct=r.ct,x}}}),Y_=He({"src/traces/choropleth/select.js"(Y,G){G.exports=function(x,A){var E=x.cd,e=x.xaxis,t=x.yaxis,r=[],o,a,i,n,s;if(A===!1)for(o=0;o=Math.min(U,Z)&&T<=Math.max(U,Z)?0:1/0}if(P=Math.min(Q,ue)&&l<=Math.max(Q,ue)?0:1/0}B=Math.sqrt(P*P+z*z),u=b[R]}}}else for(R=b.length-1;R>-1;R--)p=b[R],g=v[p],m=h[p],P=c.c2p(g)-T,z=f.c2p(m)-l,F=Math.sqrt(P*P+z*z),F100},Y.isDotSymbol=function(d){return typeof d=="string"?G.DOT_RE.test(d):d>200}}}),kP=He({"src/traces/scattergl/defaults.js"(Y,G){var d=Gr(),x=Ei(),A=J_(),E=qy(),e=jv(),t=Rl(),r=j0(),o=Tv(),a=Kh(),i=nv(),n=Av(),s=iv();G.exports=function(f,v,h,T){function l(u,g){return d.coerce(f,v,E,u,g)}var y=f.marker?A.isOpenSymbol(f.marker.symbol):!1,b=t.isBubble(f),S=r(f,v,T,l);if(!S){v.visible=!1;return}o(f,v,T,l),l("xhoverformat"),l("yhoverformat");var M=S>>1,f=r[c],v=a!==void 0?a(f,o):f-o;v>=0?(s=c,n=c-1):i=c+1}return s}function x(r,o,a,i,n){for(var s=n+1;i<=n;){var c=i+n>>>1,f=r[c],v=a!==void 0?a(f,o):f-o;v>0?(s=c,n=c-1):i=c+1}return s}function A(r,o,a,i,n){for(var s=i-1;i<=n;){var c=i+n>>>1,f=r[c],v=a!==void 0?a(f,o):f-o;v<0?(s=c,i=c+1):n=c-1}return s}function E(r,o,a,i,n){for(var s=i-1;i<=n;){var c=i+n>>>1,f=r[c],v=a!==void 0?a(f,o):f-o;v<=0?(s=c,i=c+1):n=c-1}return s}function e(r,o,a,i,n){for(;i<=n;){var s=i+n>>>1,c=r[s],f=a!==void 0?a(c,o):c-o;if(f===0)return s;f<=0?i=s+1:n=s-1}return-1}function t(r,o,a,i,n,s){return typeof a=="function"?s(r,o,a,i===void 0?0:i|0,n===void 0?r.length-1:n|0):s(r,o,void 0,a===void 0?0:a|0,i===void 0?r.length-1:i|0)}G.exports={ge:function(r,o,a,i,n){return t(r,o,a,i,n,d)},gt:function(r,o,a,i,n){return t(r,o,a,i,n,x)},lt:function(r,o,a,i,n){return t(r,o,a,i,n,A)},le:function(r,o,a,i,n){return t(r,o,a,i,n,E)},eq:function(r,o,a,i,n){return t(r,o,a,i,n,e)}}}}),Gv=He({"node_modules/pick-by-alias/index.js"(Y,G){G.exports=function(E,e,t){var r={},o,a;if(typeof e=="string"&&(e=x(e)),Array.isArray(e)){var i={};for(a=0;a1&&(A=arguments),typeof A=="string"?A=A.split(/\s/).map(parseFloat):typeof A=="number"&&(A=[A]),A.length&&typeof A[0]=="number"?A.length===1?E={width:A[0],height:A[0],x:0,y:0}:A.length===2?E={width:A[0],height:A[1],x:0,y:0}:E={x:A[0],y:A[1],width:A[2]-A[0]||0,height:A[3]-A[1]||0}:A&&(A=d(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"}),E={x:A.left||0,y:A.top||0},A.width==null?A.right?E.width=A.right-E.x:E.width=0:E.width=A.width,A.height==null?A.bottom?E.height=A.bottom-E.y:E.height=0:E.height=A.height),E}}}),Xp=He({"node_modules/array-bounds/index.js"(Y,G){G.exports=d;function d(x,A){if(!x||x.length==null)throw Error("Argument should be an array");A==null?A=1:A=Math.floor(A);for(var E=Array(A*2),e=0;et&&(t=x[o]),x[o]>>1,b;v.dtype||(v.dtype="array"),typeof v.dtype=="string"?b=new(a(v.dtype))(y):v.dtype&&(b=v.dtype,Array.isArray(b)&&(b.length=y));for(let P=0;Ph||L>n){for(let re=0;reie||Z>fe||Q<$||ue=oe||q===ae)return;let we=S[ee];ae===void 0&&(ae=we.length);for(let Me=q;Me=B&&ce<=L&&Re>=O&&Re<=N&&le.push(xe)}let Ae=M[ee],Fe=Ae[q*4+0],Ce=Ae[q*4+1],qe=Ae[q*4+2],et=Ae[q*4+3],Qe=J(Ae,q+1),Ke=re*.5,Xe=ee+1;j($,X,Ke,Xe,Fe,Ce||qe||et||Qe),j($,X+Ke,Ke,Xe,Ce,qe||et||Qe),j($+Ke,X,Ke,Xe,qe,et||Qe),j($+Ke,X+Ke,Ke,Xe,et,Qe)}function J($,X){let re=null,ee=0;for(;re===null;)if(re=$[X*4+ee],ee++,ee>$.length)return null;return re}return le}function m(P,z,F,B,O){let L=[];for(let N=0;N1&&(f=1),f<-1&&(f=-1),c*Math.acos(f)},t=function(a,i,n,s,c,f,v,h,T,l,y,b){var S=Math.pow(c,2),M=Math.pow(f,2),_=Math.pow(y,2),w=Math.pow(b,2),p=S*M-S*w-M*_;p<0&&(p=0),p/=S*w+M*_,p=Math.sqrt(p)*(v===h?-1:1);var u=p*c/f*b,g=p*-f/c*y,m=l*u-T*g+(a+n)/2,R=T*u+l*g+(i+s)/2,P=(y-u)/c,z=(b-g)/f,F=(-y-u)/c,B=(-b-g)/f,O=e(1,0,P,z),L=e(P,z,F,B);return h===0&&L>0&&(L-=x),h===1&&L<0&&(L+=x),[m,R,O,L]},r=function(a){var i=a.px,n=a.py,s=a.cx,c=a.cy,f=a.rx,v=a.ry,h=a.xAxisRotation,T=h===void 0?0:h,l=a.largeArcFlag,y=l===void 0?0:l,b=a.sweepFlag,S=b===void 0?0:b,M=[];if(f===0||v===0)return[];var _=Math.sin(T*x/360),w=Math.cos(T*x/360),p=w*(i-s)/2+_*(n-c)/2,u=-_*(i-s)/2+w*(n-c)/2;if(p===0&&u===0)return[];f=Math.abs(f),v=Math.abs(v);var g=Math.pow(p,2)/Math.pow(f,2)+Math.pow(u,2)/Math.pow(v,2);g>1&&(f*=Math.sqrt(g),v*=Math.sqrt(g));var m=t(i,n,s,c,f,v,y,S,_,w,p,u),R=d(m,4),P=R[0],z=R[1],F=R[2],B=R[3],O=Math.abs(B)/(x/4);Math.abs(1-O)<1e-7&&(O=1);var L=Math.max(Math.ceil(O),1);B/=L;for(var N=0;N4?(o=l[l.length-4],a=l[l.length-3]):(o=f,a=v),r.push(l)}return r}function A(e,t,r,o){return["C",e,t,r,o,r,o]}function E(e,t,r,o,a,i){return["C",e/3+2/3*r,t/3+2/3*o,a/3+2/3*r,i/3+2/3*o,a,i]}}}),Y3=He({"node_modules/is-svg-path/index.js"(Y,G){G.exports=function(x){return typeof x!="string"?!1:(x=x.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(x)&&/[\dz]$/i.test(x)&&x.length>4))}}}),OP=He({"node_modules/svg-path-bounds/index.js"(Y,G){var d=Yg(),x=X3(),A=FP(),E=Y3(),e=_y();G.exports=t;function t(r){if(Array.isArray(r)&&r.length===1&&typeof r[0]=="string"&&(r=r[0]),typeof r=="string"&&(e(E(r),"String is not an SVG path."),r=d(r)),e(Array.isArray(r),"Argument should be a string or an array of path segments."),r=x(r),r=A(r),!r.length)return[0,0,0,0];for(var o=[1/0,1/0,-1/0,-1/0],a=0,i=r.length;ao[2]&&(o[2]=n[s+0]),n[s+1]>o[3]&&(o[3]=n[s+1]);return o}}}),BP=He({"node_modules/normalize-svg-path/index.js"(Y,G){var d=Math.PI,x=o(120);G.exports=A;function A(a){for(var i,n=[],s=0,c=0,f=0,v=0,h=null,T=null,l=0,y=0,b=0,S=a.length;b7&&(n.push(M.splice(0,7)),M.unshift("C"));break;case"S":var w=l,p=y;(i=="C"||i=="S")&&(w+=w-s,p+=p-c),M=["C",w,p,M[1],M[2],M[3],M[4]];break;case"T":i=="Q"||i=="T"?(h=l*2-h,T=y*2-T):(h=l,T=y),M=e(l,y,h,T,M[1],M[2]);break;case"Q":h=M[1],T=M[2],M=e(l,y,M[1],M[2],M[3],M[4]);break;case"L":M=E(l,y,M[1],M[2]);break;case"H":M=E(l,y,M[1],y);break;case"V":M=E(l,y,l,M[1]);break;case"Z":M=E(l,y,f,v);break}i=_,l=M[M.length-2],y=M[M.length-1],M.length>4?(s=M[M.length-4],c=M[M.length-3]):(s=l,c=y),n.push(M)}return n}function E(a,i,n,s){return["C",a,i,n,s,n,s]}function e(a,i,n,s,c,f){return["C",a/3+2/3*n,i/3+2/3*s,c/3+2/3*n,f/3+2/3*s,c,f]}function t(a,i,n,s,c,f,v,h,T,l){if(l)m=l[0],R=l[1],u=l[2],g=l[3];else{var y=r(a,i,-c);a=y.x,i=y.y,y=r(h,T,-c),h=y.x,T=y.y;var b=(a-h)/2,S=(i-T)/2,M=b*b/(n*n)+S*S/(s*s);M>1&&(M=Math.sqrt(M),n=M*n,s=M*s);var _=n*n,w=s*s,p=(f==v?-1:1)*Math.sqrt(Math.abs((_*w-_*S*S-w*b*b)/(_*S*S+w*b*b)));p==1/0&&(p=1);var u=p*n*S/s+(a+h)/2,g=p*-s*b/n+(i+T)/2,m=Math.asin(((i-g)/s).toFixed(9)),R=Math.asin(((T-g)/s).toFixed(9));m=aR&&(m=m-d*2),!v&&R>m&&(R=R-d*2)}if(Math.abs(R-m)>x){var P=R,z=h,F=T;R=m+x*(v&&R>m?1:-1),h=u+n*Math.cos(R),T=g+s*Math.sin(R);var B=t(h,T,n,s,c,0,v,z,F,[R,P,u,g])}var O=Math.tan((R-m)/4),L=4/3*n*O,N=4/3*s*O,U=[2*a-(a+L*Math.sin(m)),2*i-(i-N*Math.cos(m)),h+L*Math.sin(R),T-N*Math.cos(R),h,T];if(l)return U;B&&(U=U.concat(B));for(var Z=0;Z0?r.strokeStyle="white":r.strokeStyle="black",r.lineWidth=Math.abs(h)),r.translate(c*.5,f*.5),r.scale(y,y),i()){var b=new Path2D(n);r.fill(b),h&&r.stroke(b)}else{var S=x(n);A(r,S),r.fill(),h&&r.stroke()}r.setTransform(1,0,0,1,0,0);var M=e(r,{cutoff:s.cutoff!=null?s.cutoff:.5,radius:s.radius!=null?s.radius:v*.5});return M}var a;function i(){if(a!=null)return a;var n=document.createElement("canvas").getContext("2d");if(n.canvas.width=n.canvas.height=1,!window.Path2D)return a=!1;var s=new Path2D("M0,0h1v1h-1v-1Z");n.fillStyle="black",n.fill(s);var c=n.getImageData(0,0,1,1);return a=c&&c.data&&c.data[3]===255}}}),Kp=He({"src/traces/scattergl/convert.js"(Y,G){var d=Hi(),x=jP(),A=rp(),E=Ei(),e=Gr(),t=e.isArrayOrTypedArray,r=vo(),o=oc(),a=fd().formatColor,i=Rl(),n=B0(),s=J_(),c=op(),f=Bd().DESELECTDIM,v={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},h=Ph().appendArrayPointValue;function T(B,O){var L,N={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},U=B._context.plotGlPixelRatio;if(O.visible!==!0)return N;if(i.hasText(O)&&(N.text=l(B,O),N.textSel=M(B,O,O.selected),N.textUnsel=M(B,O,O.unselected)),i.hasMarkers(O)&&(N.marker=b(B,O),N.markerSel=S(B,O,O.selected),N.markerUnsel=S(B,O,O.unselected),!O.unselected&&t(O.marker.opacity))){var Z=O.marker.opacity;for(N.markerUnsel.opacity=new Array(Z.length),L=0;L500?"bold":"normal":B}function b(B,O){var L=O._length,N=O.marker,U={},Z,Q=t(N.symbol),ue=t(N.angle),oe=t(N.color),le=t(N.line.color),j=t(N.opacity),J=t(N.size),$=t(N.line.width),X;if(Q||(X=s.isOpenSymbol(N.symbol)),Q||oe||le||j||ue){U.symbols=new Array(L),U.angles=new Array(L),U.colors=new Array(L),U.borderColors=new Array(L);var re=N.symbol,ee=N.angle,q=a(N,N.opacity,L),ae=a(N.line,N.opacity,L);if(!t(ae[0])){var ie=ae;for(ae=Array(L),Z=0;Zc.TOO_MANY_POINTS||i.hasMarkers(O)?"rect":"round";if(le&&O.connectgaps){var J=Z[0],$=Z[1];for(Q=0;Q1?oe[Q]:oe[0]:oe,X=t(le)?le.length>1?le[Q]:le[0]:le,re=v[$],ee=v[X],q=j?j/.8+1:0,ae=-ee*q-ee*.5;Z.offset[Q]=[re*q/J,ae/J]}}return Z}G.exports={style:T,markerStyle:b,markerSelection:S,linePositions:P,errorBarPositions:z,textPosition:F}}}),K3=He({"src/traces/scattergl/scene_update.js"(Y,G){var d=Gr();G.exports=function(A,E){var e=E._scene,t={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},r={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return E._scene||(e=E._scene={},e.init=function(){d.extendFlat(e,r,t)},e.init(),e.update=function(a){var i=d.repeat(a,e.count);if(e.fill2d&&e.fill2d.update(i),e.scatter2d&&e.scatter2d.update(i),e.line2d&&e.line2d.update(i),e.error2d&&e.error2d.update(i.concat(i)),e.select2d&&e.select2d.update(i),e.glText)for(var n=0;n=f,u=w*2,g={},m,R=S.makeCalcdata(y,"x"),P=M.makeCalcdata(y,"y"),z=e(y,S,"x",R),F=e(y,M,"y",P),B=z.vals,O=F.vals;y._x=B,y._y=O,y.xperiodalignment&&(y._origX=R,y._xStarts=z.starts,y._xEnds=z.ends),y.yperiodalignment&&(y._origY=P,y._yStarts=F.starts,y._yEnds=F.ends);var L=new Array(u),N=new Array(w);for(m=0;m1&&x.extendFlat(_.line,n.linePositions(T,y,b)),_.errorX||_.errorY){var w=n.errorBarPositions(T,y,b,S,M);_.errorX&&x.extendFlat(_.errorX,w.x),_.errorY&&x.extendFlat(_.errorY,w.y)}return _.text&&(x.extendFlat(_.text,{positions:b},n.textPosition(T,y,_.text,_.marker)),x.extendFlat(_.textSel,{positions:b},n.textPosition(T,y,_.text,_.markerSel)),x.extendFlat(_.textUnsel,{positions:b},n.textPosition(T,y,_.text,_.markerUnsel))),_}}}),J3=He({"src/traces/scattergl/edit_style.js"(Y,G){var d=Gr(),x=Ai(),A=Bd().DESELECTDIM;function E(e){var t=e[0],r=t.trace,o=t.t,a=o._scene,i=o.index,n=a.selectBatch[i],s=a.unselectBatch[i],c=a.textOptions[i],f=a.textSelectedOptions[i]||{},v=a.textUnselectedOptions[i]||{},h=d.extendFlat({},c),T,l;if(n.length||s.length){var y=f.color,b=v.color,S=c.color,M=d.isArrayOrTypedArray(S);for(h.color=new Array(r._length),T=0;T>>24,r=(E&16711680)>>>16,o=(E&65280)>>>8,a=E&255;return e===!1?[t,r,o,a]:[t/255,r/255,o/255,a/255]}}}),Yc=He({"node_modules/object-assign/index.js"(Y,G){var d=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;function E(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function e(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var r={},o=0;o<10;o++)r["_"+String.fromCharCode(o)]=o;var a=Object.getOwnPropertyNames(r).map(function(n){return r[n]});if(a.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(n){i[n]=n}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}G.exports=e()?Object.assign:function(t,r){for(var o,a=E(t),i,n=1;ng.length)&&(m=g.length);for(var R=0,P=new Array(m);R 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; +} +`]),oe.vert=h([`precision highp float; +#define GLSLIFY 1 + +attribute float x, y, xFract, yFract; +attribute float size, borderSize; +attribute vec4 colorId, borderColorId; +attribute float isActive; + +// \`invariant\` effectively turns off optimizations for the position. +// We need this because -fast-math on M1 Macs is re-ordering +// floating point operations in a way that causes floating point +// precision limits to put points in the wrong locations. +invariant gl_Position; + +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; +} +`]),b&&(oe.frag=oe.frag.replace("smoothstep","smoothStep"),ue.frag=ue.frag.replace("smoothstep","smoothStep")),this.drawCircle=g(oe)}w.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},w.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},w.prototype.draw=function(){for(var g=this,m=arguments.length,R=new Array(m),P=0;Pxe)?Xe.tree=f(Ke,{bounds:Je}):xe&&xe.length&&(Xe.tree=xe),Xe.tree){var At={primitive:"points",usage:"static",data:Xe.tree,type:"uint32"};Xe.elements?Xe.elements(At):Xe.elements=B.elements(At)}var St=S.float32(Ke);ce({data:St,usage:"dynamic"});var Rt=S.fract32(Ke,St);return Re({data:Rt,usage:"dynamic"}),$e({data:new Uint8Array(rt),type:"uint8",usage:"stream"}),Ke}},{marker:function(Ke,Xe,Me){var xe=Xe.activation;if(xe.forEach(function(Rt){return Rt&&Rt.destroy&&Rt.destroy()}),xe.length=0,!Ke||typeof Ke[0]=="number"){var ce=g.addMarker(Ke);xe[ce]=!0}else{for(var Re=[],$e=0,rt=Math.min(Ke.length,Xe.count);$e=0)return z;var F;if(g instanceof Uint8Array||g instanceof Uint8ClampedArray)F=g;else{F=new Uint8Array(g.length);for(var B=0,O=g.length;BP*4&&(this.tooManyColors=!0),this.updatePalette(R),z.length===1?z[0]:z},w.prototype.updatePalette=function(g){if(!this.tooManyColors){var m=this.maxColors,R=this.paletteTexture,P=Math.ceil(g.length*.25/m);if(P>1){g=g.slice();for(var z=g.length*.25%m;z80*L){ue=le=B[0],oe=j=B[1];for(var re=L;rele&&(le=J),$>j&&(j=$);X=Math.max(le-ue,j-oe),X=X!==0?32767/X:0}return E(Z,Q,L,ue,oe,X,0),Q}function x(B,O,L,N,U){var Z,Q;if(U===F(B,O,L,N)>0)for(Z=O;Z=O;Z-=N)Q=R(Z,B[Z],B[Z+1],Q);return Q&&S(Q,Q.next)&&(P(Q),Q=Q.next),Q}function A(B,O){if(!B)return B;O||(O=B);var L=B,N;do if(N=!1,!L.steiner&&(S(L,L.next)||b(L.prev,L,L.next)===0)){if(P(L),L=O=L.prev,L===L.next)break;N=!0}else L=L.next;while(N||L!==O);return O}function E(B,O,L,N,U,Z,Q){if(B){!Q&&Z&&f(B,N,U,Z);for(var ue=B,oe,le;B.prev!==B.next;){if(oe=B.prev,le=B.next,Z?t(B,N,U,Z):e(B)){O.push(oe.i/L|0),O.push(B.i/L|0),O.push(le.i/L|0),P(B),B=le.next,ue=le.next;continue}if(B=le,B===ue){Q?Q===1?(B=r(A(B),O,L),E(B,O,L,N,U,Z,2)):Q===2&&o(B,O,L,N,U,Z):E(A(B),O,L,N,U,Z,1);break}}}}function e(B){var O=B.prev,L=B,N=B.next;if(b(O,L,N)>=0)return!1;for(var U=O.x,Z=L.x,Q=N.x,ue=O.y,oe=L.y,le=N.y,j=UZ?U>Q?U:Q:Z>Q?Z:Q,X=ue>oe?ue>le?ue:le:oe>le?oe:le,re=N.next;re!==O;){if(re.x>=j&&re.x<=$&&re.y>=J&&re.y<=X&&l(U,ue,Z,oe,Q,le,re.x,re.y)&&b(re.prev,re,re.next)>=0)return!1;re=re.next}return!0}function t(B,O,L,N){var U=B.prev,Z=B,Q=B.next;if(b(U,Z,Q)>=0)return!1;for(var ue=U.x,oe=Z.x,le=Q.x,j=U.y,J=Z.y,$=Q.y,X=ueoe?ue>le?ue:le:oe>le?oe:le,q=j>J?j>$?j:$:J>$?J:$,ae=h(X,re,O,L,N),ie=h(ee,q,O,L,N),fe=B.prevZ,we=B.nextZ;fe&&fe.z>=ae&&we&&we.z<=ie;){if(fe.x>=X&&fe.x<=ee&&fe.y>=re&&fe.y<=q&&fe!==U&&fe!==Q&&l(ue,j,oe,J,le,$,fe.x,fe.y)&&b(fe.prev,fe,fe.next)>=0||(fe=fe.prevZ,we.x>=X&&we.x<=ee&&we.y>=re&&we.y<=q&&we!==U&&we!==Q&&l(ue,j,oe,J,le,$,we.x,we.y)&&b(we.prev,we,we.next)>=0))return!1;we=we.nextZ}for(;fe&&fe.z>=ae;){if(fe.x>=X&&fe.x<=ee&&fe.y>=re&&fe.y<=q&&fe!==U&&fe!==Q&&l(ue,j,oe,J,le,$,fe.x,fe.y)&&b(fe.prev,fe,fe.next)>=0)return!1;fe=fe.prevZ}for(;we&&we.z<=ie;){if(we.x>=X&&we.x<=ee&&we.y>=re&&we.y<=q&&we!==U&&we!==Q&&l(ue,j,oe,J,le,$,we.x,we.y)&&b(we.prev,we,we.next)>=0)return!1;we=we.nextZ}return!0}function r(B,O,L){var N=B;do{var U=N.prev,Z=N.next.next;!S(U,Z)&&M(U,N,N.next,Z)&&u(U,Z)&&u(Z,U)&&(O.push(U.i/L|0),O.push(N.i/L|0),O.push(Z.i/L|0),P(N),P(N.next),N=B=Z),N=N.next}while(N!==B);return A(N)}function o(B,O,L,N,U,Z){var Q=B;do{for(var ue=Q.next.next;ue!==Q.prev;){if(Q.i!==ue.i&&y(Q,ue)){var oe=m(Q,ue);Q=A(Q,Q.next),oe=A(oe,oe.next),E(Q,O,L,N,U,Z,0),E(oe,O,L,N,U,Z,0);return}ue=ue.next}Q=Q.next}while(Q!==B)}function a(B,O,L,N){var U=[],Z,Q,ue,oe,le;for(Z=0,Q=O.length;Z=L.next.y&&L.next.y!==L.y){var ue=L.x+(U-L.y)*(L.next.x-L.x)/(L.next.y-L.y);if(ue<=N&&ue>Z&&(Z=ue,Q=L.x=L.x&&L.x>=le&&N!==L.x&&l(UQ.x||L.x===Q.x&&c(Q,L)))&&(Q=L,J=$)),L=L.next;while(L!==oe);return Q}function c(B,O){return b(B.prev,B,O.prev)<0&&b(O.next,B,B.next)<0}function f(B,O,L,N){var U=B;do U.z===0&&(U.z=h(U.x,U.y,O,L,N)),U.prevZ=U.prev,U.nextZ=U.next,U=U.next;while(U!==B);U.prevZ.nextZ=null,U.prevZ=null,v(U)}function v(B){var O,L,N,U,Z,Q,ue,oe,le=1;do{for(L=B,B=null,Z=null,Q=0;L;){for(Q++,N=L,ue=0,O=0;O0||oe>0&&N;)ue!==0&&(oe===0||!N||L.z<=N.z)?(U=L,L=L.nextZ,ue--):(U=N,N=N.nextZ,oe--),Z?Z.nextZ=U:B=U,U.prevZ=Z,Z=U;L=N}Z.nextZ=null,le*=2}while(Q>1);return B}function h(B,O,L,N,U){return B=(B-L)*U|0,O=(O-N)*U|0,B=(B|B<<8)&16711935,B=(B|B<<4)&252645135,B=(B|B<<2)&858993459,B=(B|B<<1)&1431655765,O=(O|O<<8)&16711935,O=(O|O<<4)&252645135,O=(O|O<<2)&858993459,O=(O|O<<1)&1431655765,B|O<<1}function T(B){var O=B,L=B;do(O.x=(B-Q)*(Z-ue)&&(B-Q)*(N-ue)>=(L-Q)*(O-ue)&&(L-Q)*(Z-ue)>=(U-Q)*(N-ue)}function y(B,O){return B.next.i!==O.i&&B.prev.i!==O.i&&!p(B,O)&&(u(B,O)&&u(O,B)&&g(B,O)&&(b(B.prev,B,O.prev)||b(B,O.prev,O))||S(B,O)&&b(B.prev,B,B.next)>0&&b(O.prev,O,O.next)>0)}function b(B,O,L){return(O.y-B.y)*(L.x-O.x)-(O.x-B.x)*(L.y-O.y)}function S(B,O){return B.x===O.x&&B.y===O.y}function M(B,O,L,N){var U=w(b(B,O,L)),Z=w(b(B,O,N)),Q=w(b(L,N,B)),ue=w(b(L,N,O));return!!(U!==Z&&Q!==ue||U===0&&_(B,L,O)||Z===0&&_(B,N,O)||Q===0&&_(L,B,N)||ue===0&&_(L,O,N))}function _(B,O,L){return O.x<=Math.max(B.x,L.x)&&O.x>=Math.min(B.x,L.x)&&O.y<=Math.max(B.y,L.y)&&O.y>=Math.min(B.y,L.y)}function w(B){return B>0?1:B<0?-1:0}function p(B,O){var L=B;do{if(L.i!==B.i&&L.next.i!==B.i&&L.i!==O.i&&L.next.i!==O.i&&M(L,L.next,B,O))return!0;L=L.next}while(L!==B);return!1}function u(B,O){return b(B.prev,B,B.next)<0?b(B,O,B.next)>=0&&b(B,B.prev,O)>=0:b(B,O,B.prev)<0||b(B,B.next,O)<0}function g(B,O){var L=B,N=!1,U=(B.x+O.x)/2,Z=(B.y+O.y)/2;do L.y>Z!=L.next.y>Z&&L.next.y!==L.y&&U<(L.next.x-L.x)*(Z-L.y)/(L.next.y-L.y)+L.x&&(N=!N),L=L.next;while(L!==B);return N}function m(B,O){var L=new z(B.i,B.x,B.y),N=new z(O.i,O.x,O.y),U=B.next,Z=O.prev;return B.next=O,O.prev=B,L.next=U,U.prev=L,N.next=L,L.prev=N,Z.next=N,N.prev=Z,N}function R(B,O,L,N){var U=new z(B,O,L);return N?(U.next=N.next,U.prev=N,N.next.prev=U,N.next=U):(U.prev=U,U.next=U),U}function P(B){B.next.prev=B.prev,B.prev.next=B.next,B.prevZ&&(B.prevZ.nextZ=B.nextZ),B.nextZ&&(B.nextZ.prevZ=B.prevZ)}function z(B,O,L){this.i=B,this.x=O,this.y=L,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}d.deviation=function(B,O,L,N){var U=O&&O.length,Z=U?O[0]*L:B.length,Q=Math.abs(F(B,0,Z,L));if(U)for(var ue=0,oe=O.length;ue0&&(N+=B[U-1].length,L.holes.push(N))}return L}}}),XP=He({"node_modules/array-normalize/index.js"(Y,G){var d=Xp();G.exports=x;function x(A,E,e){if(!A||A.length==null)throw Error("Argument should be an array");E==null&&(E=1),e==null&&(e=d(A,E));for(var t=0;t-1}}}),oT=He({"node_modules/es5-ext/string/#/contains/index.js"(Y,G){G.exports=s6()()?String.prototype.contains:l6()}}),vd=He({"node_modules/d/index.js"(Y,G){var d=Jp(),x=nT(),A=rx(),E=iT(),e=oT(),t=G.exports=function(r,o){var a,i,n,s,c;return arguments.length<2||typeof r!="string"?(s=o,o=r,r=null):s=arguments[2],d(r)?(a=e.call(r,"c"),i=e.call(r,"e"),n=e.call(r,"w")):(a=n=!0,i=!1),c={value:o,configurable:a,enumerable:i,writable:n},s?A(E(s),c):c};t.gs=function(r,o,a){var i,n,s,c;return typeof r!="string"?(s=a,a=o,o=r,r=null):s=arguments[3],d(o)?x(o)?d(a)?x(a)||(s=a,a=void 0):a=void 0:(s=o,o=a=void 0):o=void 0,d(r)?(i=e.call(r,"c"),n=e.call(r,"e")):(i=!0,n=!1),c={get:o,set:a,configurable:i,enumerable:n},s?A(E(s),c):c}}}),Hy=He({"node_modules/es5-ext/function/is-arguments.js"(Y,G){var d=Object.prototype.toString,x=d.call(function(){return arguments}());G.exports=function(A){return d.call(A)===x}}}),Gy=He({"node_modules/es5-ext/string/is-string.js"(Y,G){var d=Object.prototype.toString,x=d.call("");G.exports=function(A){return typeof A=="string"||A&&typeof A=="object"&&(A instanceof String||d.call(A)===x)||!1}}}),u6=He({"node_modules/ext/global-this/is-implemented.js"(Y,G){G.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}}),c6=He({"node_modules/ext/global-this/implementation.js"(Y,G){var d=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};G.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return d()}try{return __global__||d()}finally{delete Object.prototype.__global__}}()}}),Wy=He({"node_modules/ext/global-this/index.js"(Y,G){G.exports=u6()()?globalThis:c6()}}),f6=He({"node_modules/es6-symbol/is-implemented.js"(Y,G){var d=Wy(),x={object:!0,symbol:!0};G.exports=function(){var A=d.Symbol,E;if(typeof A!="function")return!1;E=A("test symbol");try{String(E)}catch{return!1}return!(!x[typeof A.iterator]||!x[typeof A.toPrimitive]||!x[typeof A.toStringTag])}}}),h6=He({"node_modules/es6-symbol/is-symbol.js"(Y,G){G.exports=function(d){return d?typeof d=="symbol"?!0:!d.constructor||d.constructor.name!=="Symbol"?!1:d[d.constructor.toStringTag]==="Symbol":!1}}}),sT=He({"node_modules/es6-symbol/validate-symbol.js"(Y,G){var d=h6();G.exports=function(x){if(!d(x))throw new TypeError(x+" is not a symbol");return x}}}),v6=He({"node_modules/es6-symbol/lib/private/generate-name.js"(Y,G){var d=vd(),x=Object.create,A=Object.defineProperty,E=Object.prototype,e=x(null);G.exports=function(t){for(var r=0,o,a;e[t+(r||"")];)++r;return t+=r||"",e[t]=!0,o="@@"+t,A(E,o,d.gs(null,function(i){a||(a=!0,A(this,o,d(i)),a=!1)})),o}}}),d6=He({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(Y,G){var d=vd(),x=Wy().Symbol;G.exports=function(A){return Object.defineProperties(A,{hasInstance:d("",x&&x.hasInstance||A("hasInstance")),isConcatSpreadable:d("",x&&x.isConcatSpreadable||A("isConcatSpreadable")),iterator:d("",x&&x.iterator||A("iterator")),match:d("",x&&x.match||A("match")),replace:d("",x&&x.replace||A("replace")),search:d("",x&&x.search||A("search")),species:d("",x&&x.species||A("species")),split:d("",x&&x.split||A("split")),toPrimitive:d("",x&&x.toPrimitive||A("toPrimitive")),toStringTag:d("",x&&x.toStringTag||A("toStringTag")),unscopables:d("",x&&x.unscopables||A("unscopables"))})}}}),p6=He({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(Y,G){var d=vd(),x=sT(),A=Object.create(null);G.exports=function(E){return Object.defineProperties(E,{for:d(function(e){return A[e]?A[e]:A[e]=E(String(e))}),keyFor:d(function(e){var t;x(e);for(t in A)if(A[t]===e)return t})})}}}),g6=He({"node_modules/es6-symbol/polyfill.js"(Y,G){var d=vd(),x=sT(),A=Wy().Symbol,E=v6(),e=d6(),t=p6(),r=Object.create,o=Object.defineProperties,a=Object.defineProperty,i,n,s;if(typeof A=="function")try{String(A()),s=!0}catch{}else A=null;n=function(f){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return i(f)},G.exports=i=function c(f){var v;if(this instanceof c)throw new TypeError("Symbol is not a constructor");return s?A(f):(v=r(n.prototype),f=f===void 0?"":String(f),o(v,{__description__:d("",f),__name__:d("",E(f))}))},e(i),t(i),o(n.prototype,{constructor:d(i),toString:d("",function(){return this.__name__})}),o(i.prototype,{toString:d(function(){return"Symbol ("+x(this).__description__+")"}),valueOf:d(function(){return x(this)})}),a(i.prototype,i.toPrimitive,d("",function(){var c=x(this);return typeof c=="symbol"?c:c.toString()})),a(i.prototype,i.toStringTag,d("c","Symbol")),a(n.prototype,i.toStringTag,d("c",i.prototype[i.toStringTag])),a(n.prototype,i.toPrimitive,d("c",i.prototype[i.toPrimitive]))}}),lp=He({"node_modules/es6-symbol/index.js"(Y,G){G.exports=f6()()?Wy().Symbol:g6()}}),y6=He({"node_modules/es5-ext/array/#/clear.js"(Y,G){var d=hd();G.exports=function(){return d(this).length=0,this}}}),fg=He({"node_modules/es5-ext/object/valid-callable.js"(Y,G){G.exports=function(d){if(typeof d!="function")throw new TypeError(d+" is not a function");return d}}}),m6=He({"node_modules/type/string/coerce.js"(Y,G){var d=Jp(),x=tx(),A=Object.prototype.toString;G.exports=function(E){if(!d(E))return null;if(x(E)){var e=E.toString;if(typeof e!="function"||e===A)return null}try{return""+E}catch{return null}}}}),_6=He({"node_modules/type/lib/safe-to-string.js"(Y,G){G.exports=function(d){try{return d.toString()}catch{try{return String(d)}catch{return null}}}}}),x6=He({"node_modules/type/lib/to-short-string.js"(Y,G){var d=_6(),x=/[\n\r\u2028\u2029]/g;G.exports=function(A){var E=d(A);return E===null?"":(E.length>100&&(E=E.slice(0,99)+"…"),E=E.replace(x,function(e){switch(e){case` +`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),E)}}}),lT=He({"node_modules/type/lib/resolve-exception.js"(Y,G){var d=Jp(),x=tx(),A=m6(),E=x6(),e=function(t,r){return t.replace("%v",E(r))};G.exports=function(t,r,o){if(!x(o))throw new TypeError(e(r,t));if(!d(t)){if("default"in o)return o.default;if(o.isOptional)return null}var a=A(o.errorMessage);throw d(a)||(a=r),new TypeError(e(a,t))}}}),b6=He({"node_modules/type/value/ensure.js"(Y,G){var d=lT(),x=Jp();G.exports=function(A){return x(A)?A:d(A,"Cannot use %v",arguments[1])}}}),w6=He({"node_modules/type/plain-function/ensure.js"(Y,G){var d=lT(),x=nT();G.exports=function(A){return x(A)?A:d(A,"%v is not a plain function",arguments[1])}}}),T6=He({"node_modules/es5-ext/array/from/is-implemented.js"(Y,G){G.exports=function(){var d=Array.from,x,A;return typeof d!="function"?!1:(x=["raz","dwa"],A=d(x),!!(A&&A!==x&&A[1]==="dwa"))}}}),A6=He({"node_modules/es5-ext/function/is-function.js"(Y,G){var d=Object.prototype.toString,x=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);G.exports=function(A){return typeof A=="function"&&x(d.call(A))}}}),S6=He({"node_modules/es5-ext/math/sign/is-implemented.js"(Y,G){G.exports=function(){var d=Math.sign;return typeof d!="function"?!1:d(10)===1&&d(-20)===-1}}}),M6=He({"node_modules/es5-ext/math/sign/shim.js"(Y,G){G.exports=function(d){return d=Number(d),isNaN(d)||d===0?d:d>0?1:-1}}}),E6=He({"node_modules/es5-ext/math/sign/index.js"(Y,G){G.exports=S6()()?Math.sign:M6()}}),k6=He({"node_modules/es5-ext/number/to-integer.js"(Y,G){var d=E6(),x=Math.abs,A=Math.floor;G.exports=function(E){return isNaN(E)?0:(E=Number(E),E===0||!isFinite(E)?E:d(E)*A(x(E)))}}}),C6=He({"node_modules/es5-ext/number/to-pos-integer.js"(Y,G){var d=k6(),x=Math.max;G.exports=function(A){return x(0,d(A))}}}),L6=He({"node_modules/es5-ext/array/from/shim.js"(Y,G){var d=lp().iterator,x=Hy(),A=A6(),E=C6(),e=fg(),t=hd(),r=sp(),o=Gy(),a=Array.isArray,i=Function.prototype.call,n={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;G.exports=function(c){var f=arguments[1],v=arguments[2],h,T,l,y,b,S,M,_,w,p;if(c=Object(t(c)),r(f)&&e(f),!this||this===Array||!A(this)){if(!f){if(x(c))return b=c.length,b!==1?Array.apply(null,c):(y=new Array(1),y[0]=c[0],y);if(a(c)){for(y=new Array(b=c.length),T=0;T=55296&&S<=56319&&(p+=c[++T])),p=f?i.call(f,v,p,l):p,h?(n.value=p,s(y,l,n)):y[l]=p,++l;b=l}}if(b===void 0)for(b=E(c.length),h&&(y=new h(b)),T=0;T=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){o(this,"__redo__",e("c",[n]));return}this.__redo__.forEach(function(s,c){s>=n&&(this.__redo__[c]=++s)},this),this.__redo__.push(n)}}),_onDelete:e(function(n){var s;n>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(s=this.__redo__.indexOf(n),s!==-1&&this.__redo__.splice(s,1),this.__redo__.forEach(function(c,f){c>n&&(this.__redo__[f]=--c)},this)))}),_onClear:e(function(){this.__redo__&&d.call(this.__redo__),this.__nextIndex__=0})}))),o(i.prototype,r.iterator,e(function(){return this}))}}),O6=He({"node_modules/es6-iterator/array.js"(Y,G){var d=ex(),x=oT(),A=vd(),E=lp(),e=uT(),t=Object.defineProperty,r;r=G.exports=function(o,a){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e.call(this,o),a?x.call(a,"key+value")?a="key+value":x.call(a,"key")?a="key":a="value":a="value",t(this,"__kind__",A("",a))},d&&d(r,e),delete r.prototype.constructor,r.prototype=Object.create(e.prototype,{_resolve:A(function(o){return this.__kind__==="value"?this.__list__[o]:this.__kind__==="key+value"?[o,this.__list__[o]]:o})}),t(r.prototype,E.toStringTag,A("c","Array Iterator"))}}),B6=He({"node_modules/es6-iterator/string.js"(Y,G){var d=ex(),x=vd(),A=lp(),E=uT(),e=Object.defineProperty,t;t=G.exports=function(r){if(!(this instanceof t))throw new TypeError("Constructor requires 'new'");r=String(r),E.call(this,r),e(this,"__length__",x("",r.length))},d&&d(t,E),delete t.prototype.constructor,t.prototype=Object.create(E.prototype,{_next:x(function(){if(this.__list__){if(this.__nextIndex__=55296&&a<=56319?o+this.__list__[this.__nextIndex__++]:o)})}),e(t.prototype,A.toStringTag,x("c","String Iterator"))}}),N6=He({"node_modules/es6-iterator/is-iterable.js"(Y,G){var d=Hy(),x=sp(),A=Gy(),E=lp().iterator,e=Array.isArray;G.exports=function(t){return x(t)?e(t)||A(t)||d(t)?!0:typeof t[E]=="function":!1}}}),U6=He({"node_modules/es6-iterator/valid-iterable.js"(Y,G){var d=N6();G.exports=function(x){if(!d(x))throw new TypeError(x+" is not iterable");return x}}}),cT=He({"node_modules/es6-iterator/get.js"(Y,G){var d=Hy(),x=Gy(),A=O6(),E=B6(),e=U6(),t=lp().iterator;G.exports=function(r){return typeof e(r)[t]=="function"?r[t]():d(r)?new A(r):x(r)?new E(r):new A(r)}}}),j6=He({"node_modules/es6-iterator/for-of.js"(Y,G){var d=Hy(),x=fg(),A=Gy(),E=cT(),e=Array.isArray,t=Function.prototype.call,r=Array.prototype.some;G.exports=function(o,a){var i,n=arguments[2],s,c,f,v,h,T,l;if(e(o)||d(o)?i="array":A(o)?i="string":o=E(o),x(a),c=function(){f=!0},i==="array"){r.call(o,function(y){return t.call(a,n,y,c),f});return}if(i==="string"){for(h=o.length,v=0;v=55296&&l<=56319&&(T+=o[++v])),t.call(a,n,T,c),!f);++v);return}for(s=o.next();!s.done;){if(t.call(a,n,s.value,c),f)return;s=o.next()}}}}),V6=He({"node_modules/es6-weak-map/is-native-implemented.js"(Y,G){G.exports=function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"}()}}),q6=He({"node_modules/es6-weak-map/polyfill.js"(Y,G){var d=sp(),x=ex(),A=$P(),E=hd(),e=QP(),t=vd(),r=cT(),o=j6(),a=lp().toStringTag,i=V6(),n=Array.isArray,s=Object.defineProperty,c=Object.prototype.hasOwnProperty,f=Object.getPrototypeOf,v;G.exports=v=function(){var h=arguments[0],T;if(!(this instanceof v))throw new TypeError("Constructor requires 'new'");return T=i&&x&&WeakMap!==v?x(new WeakMap,f(this)):this,d(h)&&(n(h)||(h=r(h))),s(T,"__weakMapData__",t("c","$weakMap$"+e())),h&&o(h,function(l){E(l),T.set(l[0],l[1])}),T},i&&(x&&x(v,WeakMap),v.prototype=Object.create(WeakMap.prototype,{constructor:t(v)})),Object.defineProperties(v.prototype,{delete:t(function(h){return c.call(A(h),this.__weakMapData__)?(delete h[this.__weakMapData__],!0):!1}),get:t(function(h){if(c.call(A(h),this.__weakMapData__))return h[this.__weakMapData__]}),has:t(function(h){return c.call(A(h),this.__weakMapData__)}),set:t(function(h,T){return s(A(h),this.__weakMapData__,t("c",T)),this}),toString:t(function(){return"[object WeakMap]"})}),s(v.prototype,a,t("c","WeakMap"))}}),fT=He({"node_modules/es6-weak-map/index.js"(Y,G){G.exports=YP()()?WeakMap:q6()}}),H6=He({"node_modules/array-find-index/index.js"(Y,G){G.exports=function(d,x,A){if(typeof Array.prototype.findIndex=="function")return d.findIndex(x,A);if(typeof x!="function")throw new TypeError("predicate must be a function");var E=Object(d),e=E.length;if(e===0)return-1;for(var t=0;t 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; + } + } +} +`,l=` +precision highp float; + +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; +} +`;G.exports=y;function y(b,S){if(!(this instanceof y))return new y(b,S);if(typeof b=="function"?(S||(S={}),S.regl=b):S=b,S.length&&(S.positions=S),b=S.regl,!b.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=b._gl,this.regl=b,this.passes=[],this.shaders=y.shaders.has(b)?y.shaders.get(b):y.shaders.set(b,y.createShaders(b)).get(b),this.update(S)}y.dashMult=2,y.maxPatternLength=256,y.precisionThreshold=3e6,y.maxPoints=1e4,y.maxLines=2048,y.shaders=new i,y.createShaders=function(b){let S=b.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),M={primitive:"triangle strip",instances:b.prop("count"),count:4,offset:0,uniforms:{miterMode:(u,g)=>g.join==="round"?2:1,miterLimit:b.prop("miterLimit"),scale:b.prop("scale"),scaleFract:b.prop("scaleFract"),translateFract:b.prop("translateFract"),translate:b.prop("translate"),thickness:b.prop("thickness"),dashTexture:b.prop("dashTexture"),opacity:b.prop("opacity"),pixelRatio:b.context("pixelRatio"),id:b.prop("id"),dashLength:b.prop("dashLength"),viewport:(u,g)=>[g.viewport.x,g.viewport.y,u.viewportWidth,u.viewportHeight],depth:b.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(u,g)=>!g.overlay},stencil:{enable:!1},scissor:{enable:!0,box:b.prop("viewport")},viewport:b.prop("viewport")},_=b(A({vert:c,frag:f,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:b.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:b.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:b.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},M)),w;try{w=b(A({cull:{enable:!0,face:"back"},vert:T,frag:l,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aColor:{buffer:b.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:b.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},M))}catch{w=_}return{fill:b({primitive:"triangle",elements:(u,g)=>g.triangles,offset:0,vert:v,frag:h,uniforms:{scale:b.prop("scale"),color:b.prop("fill"),scaleFract:b.prop("scaleFract"),translateFract:b.prop("translateFract"),translate:b.prop("translate"),opacity:b.prop("opacity"),pixelRatio:b.context("pixelRatio"),id:b.prop("id"),viewport:(u,g)=>[g.viewport.x,g.viewport.y,u.viewportWidth,u.viewportHeight]},attributes:{position:{buffer:b.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:b.prop("positionFractBuffer"),stride:8,offset:8}},blend:M.blend,depth:{enable:!1},scissor:M.scissor,stencil:M.stencil,viewport:M.viewport}),rect:_,miter:w}},y.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},y.prototype.render=function(...b){b.length&&this.update(...b),this.draw()},y.prototype.draw=function(...b){return(b.length?b:this.passes).forEach((S,M)=>{if(S&&Array.isArray(S))return this.draw(...S);typeof S=="number"&&(S=this.passes[S]),S&&S.count>1&&S.opacity&&(this.regl._refresh(),S.fill&&S.triangles&&S.triangles.length>2&&this.shaders.fill(S),S.thickness&&(S.scale[0]*S.viewport.width>y.precisionThreshold||S.scale[1]*S.viewport.height>y.precisionThreshold?this.shaders.rect(S):S.join==="rect"||!S.join&&(S.thickness<=2||S.count>=y.maxPoints)?this.shaders.rect(S):this.shaders.miter(S)))}),this},y.prototype.update=function(b){if(!b)return;b.length!=null?typeof b[0]=="number"&&(b=[{positions:b}]):Array.isArray(b)||(b=[b]);let{regl:S,gl:M}=this;if(b.forEach((w,p)=>{let u=this.passes[p];if(w!==void 0){if(w===null){this.passes[p]=null;return}if(typeof w[0]=="number"&&(w={positions:w}),w=E(w,{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"}),u||(this.passes[p]=u={id:p,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:S.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:S.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:S.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:S.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},w=A({},y.defaults,w)),w.thickness!=null&&(u.thickness=parseFloat(w.thickness)),w.opacity!=null&&(u.opacity=parseFloat(w.opacity)),w.miterLimit!=null&&(u.miterLimit=parseFloat(w.miterLimit)),w.overlay!=null&&(u.overlay=!!w.overlay,poe-le),Z=[],Q=0,ue=u.hole!=null?u.hole[0]:null;if(ue!=null){let oe=s(U,le=>le>=ue);U=U.slice(0,oe),U.push(ue)}for(let oe=0;oe$-ue+(U[oe]-Q)),J=t(le,j);J=J.map($=>$+Q+($+Q{b.colorBuffer.destroy(),b.positionBuffer.destroy(),b.dashTexture.destroy()}),this.passes.length=0,this}}}),G6=He({"node_modules/regl-error2d/index.js"(Y,G){var d=Xp(),x=rp(),A=Q3(),E=Gv(),e=Yc(),t=Yp(),{float32:r,fract32:o}=Q_();G.exports=i;var a=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function i(n,s){if(typeof n=="function"?(s||(s={}),s.regl=n):s=n,s.length&&(s.positions=s),n=s.regl,!n.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let c=n._gl,f,v,h,T,l,y,b={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},S=[];return T=n.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),v=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),h=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),l=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),y=n.buffer({usage:"static",type:"float",data:a}),p(s),f=n({vert:` + precision highp float; + + attribute vec2 position, positionFract; + attribute vec4 error; + attribute vec4 color; + + attribute vec2 direction, lineOffset, capOffset; + + uniform vec4 viewport; + uniform float lineWidth, capSize; + uniform vec2 scale, scaleFract, translate, translateFract; + + varying vec4 fragColor; + + void main() { + fragColor = color / 255.; + + vec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset; + + vec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw; + + vec2 position = position + dxy; + + vec2 pos = (position + translate) * scale + + (positionFract + translateFract) * scale + + (position + translate) * scaleFract + + (positionFract + translateFract) * scaleFract; + + pos += pixelOffset / viewport.zw; + + gl_Position = vec4(pos * 2. - 1., 0, 1); + } + `,frag:` + precision highp float; + + varying vec4 fragColor; + + uniform float opacity; + + void main() { + gl_FragColor = fragColor; + gl_FragColor.a *= opacity; + } + `,uniforms:{range:n.prop("range"),lineWidth:n.prop("lineWidth"),capSize:n.prop("capSize"),opacity:n.prop("opacity"),scale:n.prop("scale"),translate:n.prop("translate"),scaleFract:n.prop("scaleFract"),translateFract:n.prop("translateFract"),viewport:(g,m)=>[m.viewport.x,m.viewport.y,g.viewportWidth,g.viewportHeight]},attributes:{color:{buffer:T,offset:(g,m)=>m.offset*4,divisor:1},position:{buffer:v,offset:(g,m)=>m.offset*8,divisor:1},positionFract:{buffer:h,offset:(g,m)=>m.offset*8,divisor:1},error:{buffer:l,offset:(g,m)=>m.offset*16,divisor:1},direction:{buffer:y,stride:24,offset:0},lineOffset:{buffer:y,stride:24,offset:8},capOffset:{buffer:y,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:n.prop("viewport")},viewport:n.prop("viewport"),stencil:!1,instances:n.prop("count"),count:a.length}),e(M,{update:p,draw:_,destroy:u,regl:n,gl:c,canvas:c.canvas,groups:S}),M;function M(g){g?p(g):g===null&&u(),_()}function _(g){if(typeof g=="number")return w(g);g&&!Array.isArray(g)&&(g=[g]),n._refresh(),S.forEach((m,R)=>{if(m){if(g&&(g[R]?m.draw=!0:m.draw=!1),!m.draw){m.draw=!0;return}w(R)}})}function w(g){typeof g=="number"&&(g=S[g]),g!=null&&g&&g.count&&g.color&&g.opacity&&g.positions&&g.positions.length>1&&(g.scaleRatio=[g.scale[0]*g.viewport.width,g.scale[1]*g.viewport.height],f(g),g.after&&g.after(g))}function p(g){if(!g)return;g.length!=null?typeof g[0]=="number"&&(g=[{positions:g}]):Array.isArray(g)||(g=[g]);let m=0,R=0;if(M.groups=S=g.map((F,B)=>{let O=S[B];if(F)typeof F=="function"?F={after:F}:typeof F[0]=="number"&&(F={positions:F});else return O;return F=E(F,{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"}),O||(S[B]=O={id:B,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},F=e({},b,F)),A(O,F,[{lineWidth:L=>+L*.5,capSize:L=>+L*.5,opacity:parseFloat,errors:L=>(L=t(L),R+=L.length,L),positions:(L,N)=>(L=t(L,"float64"),N.count=Math.floor(L.length/2),N.bounds=d(L,2),N.offset=m,m+=N.count,L)},{color:(L,N)=>{let U=N.count;if(L||(L="transparent"),!Array.isArray(L)||typeof L[0]=="number"){let Q=L;L=Array(U);for(let ue=0;ue{let Z=N.bounds;return L||(L=Z),N.scale=[1/(L[2]-L[0]),1/(L[3]-L[1])],N.translate=[-L[0],-L[1]],N.scaleFract=o(N.scale),N.translateFract=o(N.translate),L},viewport:L=>{let N;return Array.isArray(L)?N={x:L[0],y:L[1],width:L[2]-L[0],height:L[3]-L[1]}:L?(N={x:L.x||L.left||0,y:L.y||L.top||0},L.right?N.width=L.right-N.x:N.width=L.w||L.width||0,L.bottom?N.height=L.bottom-N.y:N.height=L.h||L.height||0):N={x:0,y:0,width:c.drawingBufferWidth,height:c.drawingBufferHeight},N}}]),O}),m||R){let F=S.reduce((N,U,Z)=>N+(U?U.count:0),0),B=new Float64Array(F*2),O=new Uint8Array(F*4),L=new Float32Array(F*4);S.forEach((N,U)=>{if(!N)return;let{positions:Z,count:Q,offset:ue,color:oe,errors:le}=N;Q&&(O.set(oe,ue*4),L.set(le,ue*4),B.set(Z,ue*2))});var P=r(B);v(P);var z=o(B,P);h(z),T(O),l(L)}}function u(){v.destroy(),h.destroy(),T.destroy(),l.destroy(),y.destroy()}}}}),W6=He({"node_modules/unquote/index.js"(Y,G){var d=/[\'\"]/;G.exports=function(A){return A?(d.test(A.charAt(0))&&(A=A.substr(1)),d.test(A.charAt(A.length-1))&&(A=A.substr(0,A.length-1)),A):""}}}),vT=He({"node_modules/css-global-keywords/index.json"(){}}),dT=He({"node_modules/css-system-font-keywords/index.json"(){}}),pT=He({"node_modules/css-font-weight-keywords/index.json"(){}}),gT=He({"node_modules/css-font-style-keywords/index.json"(){}}),yT=He({"node_modules/css-font-stretch-keywords/index.json"(){}}),Z6=He({"node_modules/parenthesis/index.js"(Y,G){function d(E,e){if(typeof E!="string")return[E];var t=[E];typeof e=="string"||Array.isArray(e)?e={brackets:e}:e||(e={});var r=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],o=e.escape||"___",a=!!e.flat;r.forEach(function(s){var c=new RegExp(["\\",s[0],"[^\\",s[0],"\\",s[1],"]*\\",s[1]].join("")),f=[];function v(h,T,l){var y=t.push(h.slice(s[0].length,-s[1].length))-1;return f.push(y),o+y+o}t.forEach(function(h,T){for(var l,y=0;h!=l;)if(l=h,h=h.replace(c,v),y++>1e4)throw Error("References have circular dependency. Please, check them.");t[T]=h}),f=f.reverse(),t=t.map(function(h){return f.forEach(function(T){h=h.replace(new RegExp("(\\"+o+T+"\\"+o+")","g"),s[0]+"$1"+s[1])}),h})});var i=new RegExp("\\"+o+"([0-9]+)\\"+o);function n(s,c,f){for(var v=[],h,T=0;h=i.exec(s);){if(T++>1e4)throw Error("Circular references in parenthesis");v.push(s.slice(0,h.index)),v.push(n(c[h[1]],c)),s=s.slice(h.index+h[0].length)}return v.push(s),v}return a?t:n(t[0],t)}function x(E,e){if(e&&e.flat){var t=e&&e.escape||"___",r=E[0],o;if(!r)return"";for(var a=new RegExp("\\"+t+"([0-9]+)\\"+t),i=0;r!=o;){if(i++>1e4)throw Error("Circular references in "+E);o=r,r=r.replace(a,n)}return r}return E.reduce(function s(c,f){return Array.isArray(f)&&(f=f.reduce(s,"")),c+f},"");function n(s,c){if(E[c]==null)throw Error("Reference "+c+"is undefined");return E[c]}}function A(E,e){return Array.isArray(E)?x(E,e):d(E,e)}A.parse=d,A.stringify=x,G.exports=A}}),X6=He({"node_modules/string-split-by/index.js"(Y,G){var d=Z6();G.exports=function(A,E,e){if(A==null)throw Error("First argument should be a string");if(E==null)throw Error("Separator should be a string or a RegExp");e?(typeof e=="string"||Array.isArray(e))&&(e={ignore:e}):e={},e.escape==null&&(e.escape=!0),e.ignore==null?e.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof e.ignore=="string"&&(e.ignore=[e.ignore]),e.ignore=e.ignore.map(function(c){return c.length===1&&(c=c+c),c}));var t=d.parse(A,{flat:!0,brackets:e.ignore}),r=t[0],o=r.split(E);if(e.escape){for(var a=[],i=0;i1&&fa===xa&&(fa==='"'||fa==="'"))return['"'+r(cr.substr(1,cr.length-2))+'"'];var cn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(cr);if(cn)return o(cr.substr(0,cn.index)).concat(o(cn[1])).concat(o(cr.substr(cn.index+cn[0].length)));var In=cr.split(".");if(In.length===1)return['"'+r(cr)+'"'];for(var Da=[],Na=0;Na"u"?1:window.devicePixelRatio,ti=!1,Wi={},Ti=function(qa){},si=function(){};if(typeof fa=="string"?xa=document.querySelector(fa):typeof fa=="object"&&(y(fa)?xa=fa:b(fa)?(Da=fa,In=Da.canvas):("gl"in fa?Da=fa.gl:"canvas"in fa?In=M(fa.canvas):"container"in fa&&(cn=M(fa.container)),"attributes"in fa&&(Na=fa.attributes),"extensions"in fa&&(Hn=S(fa.extensions)),"optionalExtensions"in fa&&(Un=S(fa.optionalExtensions)),"onDone"in fa&&(Ti=fa.onDone),"profile"in fa&&(ti=!!fa.profile),"pixelRatio"in fa&&(Gn=+fa.pixelRatio),"cachedCode"in fa&&(Wi=fa.cachedCode))),xa&&(xa.nodeName.toLowerCase()==="canvas"?In=xa:cn=xa),!Da){if(!In){var Fn=T(cn||document.body,Ti,Gn);if(!Fn)return null;In=Fn.canvas,si=Fn.onDestroy}Na.premultipliedAlpha===void 0&&(Na.premultipliedAlpha=!0),Da=l(In,Na)}return Da?{gl:Da,canvas:In,container:cn,extensions:Hn,optionalExtensions:Un,pixelRatio:Gn,profile:ti,cachedCode:Wi,onDone:Ti,onDestroy:si}:(si(),Ti("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function w(cr,fa){var xa={};function cn(Na){var Hn=Na.toLowerCase(),Un;try{Un=xa[Hn]=cr.getExtension(Hn)}catch{}return!!Un}for(var In=0;In65535)<<4,cr>>>=fa,xa=(cr>255)<<3,cr>>>=xa,fa|=xa,xa=(cr>15)<<2,cr>>>=xa,fa|=xa,xa=(cr>3)<<1,cr>>>=xa,fa|=xa,fa|cr>>1}function L(){var cr=p(8,function(){return[]});function fa(Da){var Na=B(Da),Hn=cr[O(Na)>>2];return Hn.length>0?Hn.pop():new ArrayBuffer(Na)}function xa(Da){cr[O(Da.byteLength)>>2].push(Da)}function cn(Da,Na){var Hn=null;switch(Da){case u:Hn=new Int8Array(fa(Na),0,Na);break;case g:Hn=new Uint8Array(fa(Na),0,Na);break;case m:Hn=new Int16Array(fa(2*Na),0,Na);break;case R:Hn=new Uint16Array(fa(2*Na),0,Na);break;case P:Hn=new Int32Array(fa(4*Na),0,Na);break;case z:Hn=new Uint32Array(fa(4*Na),0,Na);break;case F:Hn=new Float32Array(fa(4*Na),0,Na);break;default:return null}return Hn.length!==Na?Hn.subarray(0,Na):Hn}function In(Da){xa(Da.buffer)}return{alloc:fa,free:xa,allocType:cn,freeType:In}}var N=L();N.zero=L();var U=3408,Z=3410,Q=3411,ue=3412,oe=3413,le=3414,j=3415,J=33901,$=33902,X=3379,re=3386,ee=34921,q=36347,ae=36348,ie=35661,fe=35660,we=34930,Ae=36349,Fe=34076,Ce=34024,qe=7936,et=7937,Qe=7938,Ke=35724,Xe=34047,Me=36063,xe=34852,ce=3553,Re=34067,$e=34069,rt=33984,Je=6408,At=5126,St=5121,Rt=36160,Ut=36053,ir=36064,ar=16384,Mr=function(cr,fa){var xa=1;fa.ext_texture_filter_anisotropic&&(xa=cr.getParameter(Xe));var cn=1,In=1;fa.webgl_draw_buffers&&(cn=cr.getParameter(xe),In=cr.getParameter(Me));var Da=!!fa.oes_texture_float;if(Da){var Na=cr.createTexture();cr.bindTexture(ce,Na),cr.texImage2D(ce,0,Je,1,1,0,Je,At,null);var Hn=cr.createFramebuffer();if(cr.bindFramebuffer(Rt,Hn),cr.framebufferTexture2D(Rt,ir,ce,Na,0),cr.bindTexture(ce,null),cr.checkFramebufferStatus(Rt)!==Ut)Da=!1;else{cr.viewport(0,0,1,1),cr.clearColor(1,0,0,1),cr.clear(ar);var Un=N.allocType(At,4);cr.readPixels(0,0,1,1,Je,At,Un),cr.getError()?Da=!1:(cr.deleteFramebuffer(Hn),cr.deleteTexture(Na),Da=Un[0]===1),N.freeType(Un)}}var Gn=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),ti=!0;if(!Gn){var Wi=cr.createTexture(),Ti=N.allocType(St,36);cr.activeTexture(rt),cr.bindTexture(Re,Wi),cr.texImage2D($e,0,Je,3,3,0,Je,St,Ti),N.freeType(Ti),cr.bindTexture(Re,null),cr.deleteTexture(Wi),ti=!cr.getError()}return{colorBits:[cr.getParameter(Z),cr.getParameter(Q),cr.getParameter(ue),cr.getParameter(oe)],depthBits:cr.getParameter(le),stencilBits:cr.getParameter(j),subpixelBits:cr.getParameter(U),extensions:Object.keys(fa).filter(function(si){return!!fa[si]}),maxAnisotropic:xa,maxDrawbuffers:cn,maxColorAttachments:In,pointSizeDims:cr.getParameter(J),lineWidthDims:cr.getParameter($),maxViewportDims:cr.getParameter(re),maxCombinedTextureUnits:cr.getParameter(ie),maxCubeMapSize:cr.getParameter(Fe),maxRenderbufferSize:cr.getParameter(Ce),maxTextureUnits:cr.getParameter(we),maxTextureSize:cr.getParameter(X),maxAttributes:cr.getParameter(ee),maxVertexUniforms:cr.getParameter(q),maxVertexTextureUnits:cr.getParameter(fe),maxVaryingVectors:cr.getParameter(ae),maxFragmentUniforms:cr.getParameter(Ae),glsl:cr.getParameter(Ke),renderer:cr.getParameter(et),vendor:cr.getParameter(qe),version:cr.getParameter(Qe),readFloat:Da,npotTextureCube:ti}},fr=function(cr){return cr instanceof Uint8Array||cr instanceof Uint16Array||cr instanceof Uint32Array||cr instanceof Int8Array||cr instanceof Int16Array||cr instanceof Int32Array||cr instanceof Float32Array||cr instanceof Float64Array||cr instanceof Uint8ClampedArray};function dr(cr){return!!cr&&typeof cr=="object"&&Array.isArray(cr.shape)&&Array.isArray(cr.stride)&&typeof cr.offset=="number"&&cr.shape.length===cr.stride.length&&(Array.isArray(cr.data)||fr(cr.data))}var pt=function(cr){return Object.keys(cr).map(function(fa){return cr[fa]})},ze={shape:Pe,flatten:be};function Ge(cr,fa,xa){for(var cn=0;cn0){var $i;if(Array.isArray(wn[0])){Xn=va(wn);for(var Cn=1,Mn=1;Mn0){if(typeof Cn[0]=="number"){var gi=N.allocType(Pn.dtype,Cn.length);gr(gi,Cn),Xn(gi,Si),N.freeType(gi)}else if(Array.isArray(Cn[0])||fr(Cn[0])){yn=va(Cn);var ri=Ia(Cn,yn,Pn.dtype);Xn(ri,Si),N.freeType(ri)}}}else if(dr(Cn)){yn=Cn.shape;var ro=Cn.stride,es=0,Fi=0,no=0,oi=0;yn.length===1?(es=yn[0],Fi=1,no=ro[0],oi=0):yn.length===2&&(es=yn[0],Fi=yn[1],no=ro[0],oi=ro[1]);var Xo=Array.isArray(Cn.data)?Pn.dtype:Ot(Cn.data),ys=N.allocType(Xo,es*Fi);Br(ys,Cn.data,es,Fi,no,oi,Cn.offset),Xn(ys,Si),N.freeType(ys)}return Ri}return Tn||Ri(qa),Ri._reglType="buffer",Ri._buffer=Pn,Ri.subdata=$i,xa.profile&&(Ri.stats=Pn.stats),Ri.destroy=function(){Ti(Pn)},Ri}function Fn(){pt(Da).forEach(function(qa){qa.buffer=cr.createBuffer(),cr.bindBuffer(qa.type,qa.buffer),cr.bufferData(qa.type,qa.persistentData||qa.byteLength,qa.usage)})}return xa.profile&&(fa.getTotalBufferSize=function(){var qa=0;return Object.keys(Da).forEach(function(wn){qa+=Da[wn].stats.size}),qa}),{create:si,createStream:Un,destroyStream:Gn,clear:function(){pt(Da).forEach(Ti),Hn.forEach(Ti)},getBuffer:function(qa){return qa&&qa._buffer instanceof Na?qa._buffer:null},restore:Fn,_initBuffer:Wi}}var Ur=0,ga=0,Aa=1,Pa=1,sa=4,Oa=4,dt={points:Ur,point:ga,lines:Aa,line:Pa,triangles:sa,triangle:Oa,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},vt=0,Lr=1,Er=4,_r=5120,yr=5121,kr=5122,zr=5123,Pr=5124,Hr=5125,Zr=34963,Jr=35040,wt=35044;function Qt(cr,fa,xa,cn){var In={},Da=0,Na={uint8:yr,uint16:zr};fa.oes_element_index_uint&&(Na.uint32=Hr);function Hn(Fn){this.id=Da++,In[this.id]=this,this.buffer=Fn,this.primType=Er,this.vertCount=0,this.type=0}Hn.prototype.bind=function(){this.buffer.bind()};var Un=[];function Gn(Fn){var qa=Un.pop();return qa||(qa=new Hn(xa.create(null,Zr,!0,!1)._buffer)),Wi(qa,Fn,Jr,-1,-1,0,0),qa}function ti(Fn){Un.push(Fn)}function Wi(Fn,qa,wn,Tn,Ln,Pn,Ri){Fn.buffer.bind();var Xn;if(qa){var $i=Ri;!Ri&&(!fr(qa)||dr(qa)&&!fr(qa.data))&&($i=fa.oes_element_index_uint?Hr:zr),xa._initBuffer(Fn.buffer,qa,wn,$i,3)}else cr.bufferData(Zr,Pn,wn),Fn.buffer.dtype=Xn||yr,Fn.buffer.usage=wn,Fn.buffer.dimension=3,Fn.buffer.byteLength=Pn;if(Xn=Ri,!Ri){switch(Fn.buffer.dtype){case yr:case _r:Xn=yr;break;case zr:case kr:Xn=zr;break;case Hr:case Pr:Xn=Hr;break}Fn.buffer.dtype=Xn}Fn.type=Xn;var Cn=Ln;Cn<0&&(Cn=Fn.buffer.byteLength,Xn===zr?Cn>>=1:Xn===Hr&&(Cn>>=2)),Fn.vertCount=Cn;var Mn=Tn;if(Tn<0){Mn=Er;var Si=Fn.buffer.dimension;Si===1&&(Mn=vt),Si===2&&(Mn=Lr),Si===3&&(Mn=Er)}Fn.primType=Mn}function Ti(Fn){cn.elementsCount--,delete In[Fn.id],Fn.buffer.destroy(),Fn.buffer=null}function si(Fn,qa){var wn=xa.create(null,Zr,!0),Tn=new Hn(wn._buffer);cn.elementsCount++;function Ln(Pn){if(!Pn)wn(),Tn.primType=Er,Tn.vertCount=0,Tn.type=yr;else if(typeof Pn=="number")wn(Pn),Tn.primType=Er,Tn.vertCount=Pn|0,Tn.type=yr;else{var Ri=null,Xn=wt,$i=-1,Cn=-1,Mn=0,Si=0;Array.isArray(Pn)||fr(Pn)||dr(Pn)?Ri=Pn:("data"in Pn&&(Ri=Pn.data),"usage"in Pn&&(Xn=ma[Pn.usage]),"primitive"in Pn&&($i=dt[Pn.primitive]),"count"in Pn&&(Cn=Pn.count|0),"type"in Pn&&(Si=Na[Pn.type]),"length"in Pn?Mn=Pn.length|0:(Mn=Cn,Si===zr||Si===kr?Mn*=2:(Si===Hr||Si===Pr)&&(Mn*=4))),Wi(Tn,Ri,Xn,$i,Cn,Mn,Si)}return Ln}return Ln(Fn),Ln._reglType="elements",Ln._elements=Tn,Ln.subdata=function(Pn,Ri){return wn.subdata(Pn,Ri),Ln},Ln.destroy=function(){Ti(Tn)},Ln}return{create:si,createStream:Gn,destroyStream:ti,getElements:function(Fn){return typeof Fn=="function"&&Fn._elements instanceof Hn?Fn._elements:null},clear:function(){pt(In).forEach(Ti)}}}var mr=new Float32Array(1),$r=new Uint32Array(mr.buffer),oa=5123;function Sa(cr){for(var fa=N.allocType(oa,cr.length),xa=0;xa>>31<<15,Da=(cn<<1>>>24)-127,Na=cn>>13&1023;if(Da<-24)fa[xa]=In;else if(Da<-14){var Hn=-14-Da;fa[xa]=In+(Na+1024>>Hn)}else Da>15?fa[xa]=In+31744:fa[xa]=In+(Da+15<<10)+Na}return fa}function ya(cr){return Array.isArray(cr)||fr(cr)}var ra=34467,pa=3553,pn=34067,Ga=34069,qn=6408,Vn=6406,di=6407,yi=6409,Ci=6410,ci=32854,ei=32855,mi=36194,uo=32819,Lo=32820,Wo=33635,li=34042,Ii=6402,xi=34041,Ao=35904,So=35906,Ro=36193,Li=33776,Yi=33777,bs=33778,as=33779,fs=35986,Co=35987,Qa=34798,Jn=35840,Os=35841,ds=35842,Ui=35843,ms=36196,Mo=5121,ws=5123,Ks=5125,Rn=5126,fo=10242,Pi=10243,zo=10497,wo=33071,bi=33648,wl=10240,$l=10241,Js=9728,Ql=9729,Ws=9984,Is=9985,Dl=9986,Xu=9987,Lu=33170,Bu=4352,kf=4353,gf=4354,ns=34046,_u=3317,Nc=37440,ml=37441,fl=37443,_l=37444,Yu=33984,Ts=[Ws,Dl,Is,Xu],Tl=[0,yi,Ci,di,qn],Ko={};Ko[yi]=Ko[Vn]=Ko[Ii]=1,Ko[xi]=Ko[Ci]=2,Ko[di]=Ko[Ao]=3,Ko[qn]=Ko[So]=4;function Cs(cr){return"[object "+cr+"]"}var Nu=Cs("HTMLCanvasElement"),Ul=Cs("OffscreenCanvas"),Ku=Cs("CanvasRenderingContext2D"),Bs=Cs("ImageBitmap"),Gf=Cs("HTMLImageElement"),Eo=Cs("HTMLVideoElement"),Wf=Object.keys(We).concat([Nu,Ul,Ku,Bs,Gf,Eo]),is=[];is[Mo]=1,is[Rn]=4,is[Ro]=2,is[ws]=2,is[Ks]=4;var oo=[];oo[ci]=2,oo[ei]=2,oo[mi]=2,oo[xi]=4,oo[Li]=.5,oo[Yi]=.5,oo[bs]=1,oo[as]=1,oo[fs]=.5,oo[Co]=1,oo[Qa]=1,oo[Jn]=.5,oo[Os]=.25,oo[ds]=.5,oo[Ui]=.25,oo[ms]=.5;function pc(cr){return Array.isArray(cr)&&(cr.length===0||typeof cr[0]=="number")}function xu(cr){if(!Array.isArray(cr))return!1;var fa=cr.length;return!(fa===0||!ya(cr[0]))}function zl(cr){return Object.prototype.toString.call(cr)}function Kc(cr){return zl(cr)===Nu}function Ju(cr){return zl(cr)===Ul}function gc(cr){return zl(cr)===Ku}function hl(cr){return zl(cr)===Bs}function yf(cr){return zl(cr)===Gf}function Jc(cr){return zl(cr)===Eo}function Uc(cr){if(!cr)return!1;var fa=zl(cr);return Wf.indexOf(fa)>=0?!0:pc(cr)||xu(cr)||dr(cr)}function $u(cr){return We[Object.prototype.toString.call(cr)]|0}function jc(cr,fa){var xa=fa.length;switch(cr.type){case Mo:case ws:case Ks:case Rn:var cn=N.allocType(cr.type,xa);cn.set(fa),cr.data=cn;break;case Ro:cr.data=Sa(fa);break}}function $c(cr,fa){return N.allocType(cr.type===Ro?Rn:cr.type,fa)}function bu(cr,fa){cr.type===Ro?(cr.data=Sa(fa),N.freeType(fa)):cr.data=fa}function Qc(cr,fa,xa,cn,In,Da){for(var Na=cr.width,Hn=cr.height,Un=cr.channels,Gn=Na*Hn*Un,ti=$c(cr,Gn),Wi=0,Ti=0;Ti=1;)Hn+=Na*Un*Un,Un/=2;return Hn}else return Na*xa*cn}function wu(cr,fa,xa,cn,In,Da,Na){var Hn={"don't care":Bu,"dont care":Bu,nice:gf,fast:kf},Un={repeat:zo,clamp:wo,mirror:bi},Gn={nearest:Js,linear:Ql},ti=d({mipmap:Xu,"nearest mipmap nearest":Ws,"linear mipmap nearest":Is,"nearest mipmap linear":Dl,"linear mipmap linear":Xu},Gn),Wi={none:0,browser:_l},Ti={uint8:Mo,rgba4:uo,rgb565:Wo,"rgb5 a1":Lo},si={alpha:Vn,luminance:yi,"luminance alpha":Ci,rgb:di,rgba:qn,rgba4:ci,"rgb5 a1":ei,rgb565:mi},Fn={};fa.ext_srgb&&(si.srgb=Ao,si.srgba=So),fa.oes_texture_float&&(Ti.float32=Ti.float=Rn),fa.oes_texture_half_float&&(Ti.float16=Ti["half float"]=Ro),fa.webgl_depth_texture&&(d(si,{depth:Ii,"depth stencil":xi}),d(Ti,{uint16:ws,uint32:Ks,"depth stencil":li})),fa.webgl_compressed_texture_s3tc&&d(Fn,{"rgb s3tc dxt1":Li,"rgba s3tc dxt1":Yi,"rgba s3tc dxt3":bs,"rgba s3tc dxt5":as}),fa.webgl_compressed_texture_atc&&d(Fn,{"rgb atc":fs,"rgba atc explicit alpha":Co,"rgba atc interpolated alpha":Qa}),fa.webgl_compressed_texture_pvrtc&&d(Fn,{"rgb pvrtc 4bppv1":Jn,"rgb pvrtc 2bppv1":Os,"rgba pvrtc 4bppv1":ds,"rgba pvrtc 2bppv1":Ui}),fa.webgl_compressed_texture_etc1&&(Fn["rgb etc1"]=ms);var qa=Array.prototype.slice.call(cr.getParameter(ra));Object.keys(Fn).forEach(function(W){var de=Fn[W];qa.indexOf(de)>=0&&(si[W]=de)});var wn=Object.keys(si);xa.textureFormats=wn;var Tn=[];Object.keys(si).forEach(function(W){var de=si[W];Tn[de]=W});var Ln=[];Object.keys(Ti).forEach(function(W){var de=Ti[W];Ln[de]=W});var Pn=[];Object.keys(Gn).forEach(function(W){var de=Gn[W];Pn[de]=W});var Ri=[];Object.keys(ti).forEach(function(W){var de=ti[W];Ri[de]=W});var Xn=[];Object.keys(Un).forEach(function(W){var de=Un[W];Xn[de]=W});var $i=wn.reduce(function(W,de){var te=si[de];return te===yi||te===Vn||te===yi||te===Ci||te===Ii||te===xi||fa.ext_srgb&&(te===Ao||te===So)?W[te]=te:te===ei||de.indexOf("rgba")>=0?W[te]=qn:W[te]=di,W},{});function Cn(){this.internalformat=qn,this.format=qn,this.type=Mo,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=_l,this.width=0,this.height=0,this.channels=0}function Mn(W,de){W.internalformat=de.internalformat,W.format=de.format,W.type=de.type,W.compressed=de.compressed,W.premultiplyAlpha=de.premultiplyAlpha,W.flipY=de.flipY,W.unpackAlignment=de.unpackAlignment,W.colorSpace=de.colorSpace,W.width=de.width,W.height=de.height,W.channels=de.channels}function Si(W,de){if(!(typeof de!="object"||!de)){if("premultiplyAlpha"in de&&(W.premultiplyAlpha=de.premultiplyAlpha),"flipY"in de&&(W.flipY=de.flipY),"alignment"in de&&(W.unpackAlignment=de.alignment),"colorSpace"in de&&(W.colorSpace=Wi[de.colorSpace]),"type"in de){var te=de.type;W.type=Ti[te]}var me=W.width,Ue=W.height,tt=W.channels,ft=!1;"shape"in de?(me=de.shape[0],Ue=de.shape[1],de.shape.length===3&&(tt=de.shape[2],ft=!0)):("radius"in de&&(me=Ue=de.radius),"width"in de&&(me=de.width),"height"in de&&(Ue=de.height),"channels"in de&&(tt=de.channels,ft=!0)),W.width=me|0,W.height=Ue|0,W.channels=tt|0;var st=!1;if("format"in de){var bt=de.format,It=W.internalformat=si[bt];W.format=$i[It],bt in Ti&&("type"in de||(W.type=Ti[bt])),bt in Fn&&(W.compressed=!0),st=!0}!ft&&st?W.channels=Ko[W.format]:ft&&!st&&W.channels!==Tl[W.format]&&(W.format=W.internalformat=Tl[W.channels])}}function yn(W){cr.pixelStorei(Nc,W.flipY),cr.pixelStorei(ml,W.premultiplyAlpha),cr.pixelStorei(fl,W.colorSpace),cr.pixelStorei(_u,W.unpackAlignment)}function gi(){Cn.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function ri(W,de){var te=null;if(Uc(de)?te=de:de&&(Si(W,de),"x"in de&&(W.xOffset=de.x|0),"y"in de&&(W.yOffset=de.y|0),Uc(de.data)&&(te=de.data)),de.copy){var me=In.viewportWidth,Ue=In.viewportHeight;W.width=W.width||me-W.xOffset,W.height=W.height||Ue-W.yOffset,W.needsCopy=!0}else if(!te)W.width=W.width||1,W.height=W.height||1,W.channels=W.channels||4;else if(fr(te))W.channels=W.channels||4,W.data=te,!("type"in de)&&W.type===Mo&&(W.type=$u(te));else if(pc(te))W.channels=W.channels||4,jc(W,te),W.alignment=1,W.needsFree=!0;else if(dr(te)){var tt=te.data;!Array.isArray(tt)&&W.type===Mo&&(W.type=$u(tt));var ft=te.shape,st=te.stride,bt,It,Jt,Kt,vr,Tr;ft.length===3?(Jt=ft[2],Tr=st[2]):(Jt=1,Tr=1),bt=ft[0],It=ft[1],Kt=st[0],vr=st[1],W.alignment=1,W.width=bt,W.height=It,W.channels=Jt,W.format=W.internalformat=Tl[Jt],W.needsFree=!0,Qc(W,tt,Kt,vr,Tr,te.offset)}else if(Kc(te)||Ju(te)||gc(te))Kc(te)||Ju(te)?W.element=te:W.element=te.canvas,W.width=W.element.width,W.height=W.element.height,W.channels=4;else if(hl(te))W.element=te,W.width=te.width,W.height=te.height,W.channels=4;else if(yf(te))W.element=te,W.width=te.naturalWidth,W.height=te.naturalHeight,W.channels=4;else if(Jc(te))W.element=te,W.width=te.videoWidth,W.height=te.videoHeight,W.channels=4;else if(xu(te)){var wr=W.width||te[0].length,tr=W.height||te.length,pr=W.channels;ya(te[0][0])?pr=pr||te[0][0].length:pr=pr||1;for(var xr=ze.shape(te),ea=1,ha=0;ha>=Ue,te.height>>=Ue,ri(te,me[Ue]),W.mipmask|=1<=0&&!("faces"in de)&&(W.genMipmaps=!0)}if("mag"in de){var me=de.mag;W.magFilter=Gn[me]}var Ue=W.wrapS,tt=W.wrapT;if("wrap"in de){var ft=de.wrap;typeof ft=="string"?Ue=tt=Un[ft]:Array.isArray(ft)&&(Ue=Un[ft[0]],tt=Un[ft[1]])}else{if("wrapS"in de){var st=de.wrapS;Ue=Un[st]}if("wrapT"in de){var bt=de.wrapT;tt=Un[bt]}}if(W.wrapS=Ue,W.wrapT=tt,"anisotropic"in de&&(de.anisotropic,W.anisotropic=de.anisotropic),"mipmap"in de){var It=!1;switch(typeof de.mipmap){case"string":W.mipmapHint=Hn[de.mipmap],W.genMipmaps=!0,It=!0;break;case"boolean":It=W.genMipmaps=de.mipmap;break;case"object":W.genMipmaps=!1,It=!0;break}It&&!("min"in de)&&(W.minFilter=Ws)}}function Lc(W,de){cr.texParameteri(de,$l,W.minFilter),cr.texParameteri(de,wl,W.magFilter),cr.texParameteri(de,fo,W.wrapS),cr.texParameteri(de,Pi,W.wrapT),fa.ext_texture_filter_anisotropic&&cr.texParameteri(de,ns,W.anisotropic),W.genMipmaps&&(cr.hint(Lu,W.mipmapHint),cr.generateMipmap(de))}var Pf=0,su={},zu=xa.maxTextureUnits,Fo=Array(zu).map(function(){return null});function nc(W){Cn.call(this),this.mipmask=0,this.internalformat=qn,this.id=Pf++,this.refCount=1,this.target=W,this.texture=cr.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Eu,Na.profile&&(this.stats={size:0})}function ll(W){cr.activeTexture(Yu),cr.bindTexture(W.target,W.texture)}function Sl(){var W=Fo[0];W?cr.bindTexture(W.target,W.texture):cr.bindTexture(pa,null)}function qc(W){var de=W.texture,te=W.unit,me=W.target;te>=0&&(cr.activeTexture(Yu+te),cr.bindTexture(me,null),Fo[te]=null),cr.deleteTexture(de),W.texture=null,W.params=null,W.pixels=null,W.refCount=0,delete su[W.id],Da.textureCount--}d(nc.prototype,{bind:function(){var W=this;W.bindCount+=1;var de=W.unit;if(de<0){for(var te=0;te0)continue;me.unit=-1}Fo[te]=W,de=te;break}Na.profile&&Da.maxTextureUnits>vr)-Jt,Tr.height=Tr.height||(te.height>>vr)-Kt,ll(te),es(Tr,pa,Jt,Kt,vr),Sl(),oi(Tr),me}function tt(ft,st){var bt=ft|0,It=st|0||bt;if(bt===te.width&&It===te.height)return me;me.width=te.width=bt,me.height=te.height=It,ll(te);for(var Jt=0;te.mipmask>>Jt;++Jt){var Kt=bt>>Jt,vr=It>>Jt;if(!Kt||!vr)break;cr.texImage2D(pa,Jt,te.format,Kt,vr,0,te.format,te.type,null)}return Sl(),Na.profile&&(te.stats.size=sc(te.internalformat,te.type,bt,It,!1,!1)),me}return me(W,de),me.subimage=Ue,me.resize=tt,me._reglType="texture2d",me._texture=te,Na.profile&&(me.stats=te.stats),me.destroy=function(){te.decRef()},me}function ss(W,de,te,me,Ue,tt){var ft=new nc(pn);su[ft.id]=ft,Da.cubeCount++;var st=new Array(6);function bt(Kt,vr,Tr,wr,tr,pr){var xr,ea=ft.texInfo;for(Eu.call(ea),xr=0;xr<6;++xr)st[xr]=Mu();if(typeof Kt=="number"||!Kt){var ha=Kt|0||1;for(xr=0;xr<6;++xr)ys(st[xr],ha,ha)}else if(typeof Kt=="object")if(vr)xs(st[0],Kt),xs(st[1],vr),xs(st[2],Tr),xs(st[3],wr),xs(st[4],tr),xs(st[5],pr);else if(ac(ea,Kt),Si(ft,Kt),"faces"in Kt){var Ea=Kt.faces;for(xr=0;xr<6;++xr)Mn(st[xr],ft),xs(st[xr],Ea[xr])}else for(xr=0;xr<6;++xr)xs(st[xr],Kt);for(Mn(ft,st[0]),ea.genMipmaps?ft.mipmask=(st[0].width<<1)-1:ft.mipmask=st[0].mipmask,ft.internalformat=st[0].internalformat,bt.width=st[0].width,bt.height=st[0].height,ll(ft),xr=0;xr<6;++xr)Xs(st[xr],Ga+xr);for(Lc(ea,pn),Sl(),Na.profile&&(ft.stats.size=sc(ft.internalformat,ft.type,bt.width,bt.height,ea.genMipmaps,!0)),bt.format=Tn[ft.internalformat],bt.type=Ln[ft.type],bt.mag=Pn[ea.magFilter],bt.min=Ri[ea.minFilter],bt.wrapS=Xn[ea.wrapS],bt.wrapT=Xn[ea.wrapT],xr=0;xr<6;++xr)dl(st[xr]);return bt}function It(Kt,vr,Tr,wr,tr){var pr=Tr|0,xr=wr|0,ea=tr|0,ha=no();return Mn(ha,ft),ha.width=0,ha.height=0,ri(ha,vr),ha.width=ha.width||(ft.width>>ea)-pr,ha.height=ha.height||(ft.height>>ea)-xr,ll(ft),es(ha,Ga+Kt,pr,xr,ea),Sl(),oi(ha),bt}function Jt(Kt){var vr=Kt|0;if(vr!==ft.width){bt.width=ft.width=vr,bt.height=ft.height=vr,ll(ft);for(var Tr=0;Tr<6;++Tr)for(var wr=0;ft.mipmask>>wr;++wr)cr.texImage2D(Ga+Tr,wr,ft.format,vr>>wr,vr>>wr,0,ft.format,ft.type,null);return Sl(),Na.profile&&(ft.stats.size=sc(ft.internalformat,ft.type,bt.width,bt.height,!1,!0)),bt}}return bt(W,de,te,me,Ue,tt),bt.subimage=It,bt.resize=Jt,bt._reglType="textureCube",bt._texture=ft,Na.profile&&(bt.stats=ft.stats),bt.destroy=function(){ft.decRef()},bt}function js(){for(var W=0;W>me,te.height>>me,0,te.internalformat,te.type,null);else for(var Ue=0;Ue<6;++Ue)cr.texImage2D(Ga+Ue,me,te.internalformat,te.width>>me,te.height>>me,0,te.internalformat,te.type,null);Lc(te.texInfo,te.target)})}function ye(){for(var W=0;W=0?Mu=!0:Un.indexOf(dl)>=0&&(Mu=!1))),("depthTexture"in Fo||"depthStencilTexture"in Fo)&&(zu=!!(Fo.depthTexture||Fo.depthStencilTexture)),"depth"in Fo&&(typeof Fo.depth=="boolean"?xs=Fo.depth:(Lc=Fo.depth,Xs=!1)),"stencil"in Fo&&(typeof Fo.stencil=="boolean"?Xs=Fo.stencil:(Pf=Fo.stencil,xs=!1)),"depthStencil"in Fo&&(typeof Fo.depthStencil=="boolean"?xs=Xs=Fo.depthStencil:(su=Fo.depthStencil,xs=!1,Xs=!1))}var ll=null,Sl=null,qc=null,Hc=null;if(Array.isArray(Ps))ll=Ps.map(si);else if(Ps)ll=[si(Ps)];else for(ll=new Array(ac),oi=0;oi0&&(no.depth=gi[0].depth,no.stencil=gi[0].stencil,no.depthStencil=gi[0].depthStencil),gi[Fi]?gi[Fi](no):gi[Fi]=Cn(no)}return d(ri,{width:oi,height:oi,color:dl})}function ro(es){var Fi,no=es|0;if(no===ri.width)return ri;var oi=ri.color;for(Fi=0;Fi=Xo.byteLength?ys.subdata(Xo):(ys.destroy(),Mn.buffers[Fi]=null)),Mn.buffers[Fi]||(ys=Mn.buffers[Fi]=In.create(no,mc,!1,!0)),oi.buffer=In.getBuffer(ys),oi.size=oi.buffer.dimension|0,oi.normalized=!1,oi.type=oi.buffer.dtype,oi.offset=0,oi.stride=0,oi.divisor=0,oi.state=1,ro[Fi]=1}else In.getBuffer(no)?(oi.buffer=In.getBuffer(no),oi.size=oi.buffer.dimension|0,oi.normalized=!1,oi.type=oi.buffer.dtype,oi.offset=0,oi.stride=0,oi.divisor=0,oi.state=1):In.getBuffer(no.buffer)?(oi.buffer=In.getBuffer(no.buffer),oi.size=(+no.size||oi.buffer.dimension)|0,oi.normalized=!!no.normalized||!1,"type"in no?oi.type=ta[no.type]:oi.type=oi.buffer.dtype,oi.offset=(no.offset||0)|0,oi.stride=(no.stride||0)|0,oi.divisor=(no.divisor||0)|0,oi.state=1):"x"in no&&(oi.x=+no.x||0,oi.y=+no.y||0,oi.z=+no.z||0,oi.w=+no.w||0,oi.state=2)}for(var xs=0;xs1)for(var yn=0;ynqa&&(qa=wn.stats.uniformsCount)}),qa},xa.getMaxAttributesCount=function(){var qa=0;return ti.forEach(function(wn){wn.stats.attributesCount>qa&&(qa=wn.stats.attributesCount)}),qa});function Fn(){In={},Da={};for(var qa=0;qa>>4&15)+fa.charAt(cn&15);return xa}function Au(cr){for(var fa="",xa=-1,cn,In;++xa>>6&31,128|cn&63):cn<=65535?fa+=String.fromCharCode(224|cn>>>12&15,128|cn>>>6&63,128|cn&63):cn<=2097151&&(fa+=String.fromCharCode(240|cn>>>18&7,128|cn>>>12&63,128|cn>>>6&63,128|cn&63));return fa}function Zs(cr){for(var fa=Array(cr.length>>2),xa=0;xa>5]|=(cr.charCodeAt(xa/8)&255)<<24-xa%32;return fa}function Ol(cr){for(var fa="",xa=0;xa>5]>>>24-xa%32&255);return fa}function bl(cr,fa){return cr>>>fa|cr<<32-fa}function tc(cr,fa){return cr>>>fa}function Su(cr,fa,xa){return cr&fa^~cr&xa}function Cc(cr,fa,xa){return cr&fa^cr&xa^fa&xa}function Ht(cr){return bl(cr,2)^bl(cr,13)^bl(cr,22)}function ur(cr){return bl(cr,6)^bl(cr,11)^bl(cr,25)}function qr(cr){return bl(cr,7)^bl(cr,18)^tc(cr,3)}function Or(cr){return bl(cr,17)^bl(cr,19)^tc(cr,10)}var ua=new Array(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);function Fa(cr,fa){var xa=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),cn=new Array(64),In,Da,Na,Hn,Un,Gn,ti,Wi,Ti,si,Fn,qa;for(cr[fa>>5]|=128<<24-fa%32,cr[(fa+64>>9<<4)+15]=fa,Ti=0;Ti>16)+(fa>>16)+(xa>>16);return cn<<16|xa&65535}function sn(cr){return Array.prototype.slice.call(cr)}function gn(cr){return sn(cr).join("")}function kn(cr){var fa=cr&&cr.cache,xa=0,cn=[],In=[],Da=[];function Na(Fn,qa){var wn=qa&&qa.stable;if(!wn){for(var Tn=0;Tn0&&(Fn.push(Ln,"="),Fn.push.apply(Fn,sn(arguments)),Fn.push(";")),Ln}return d(qa,{def:Tn,toString:function(){return gn([wn.length>0?"var "+wn.join(",")+";":"",gn(Fn)])}})}function Un(){var Fn=Hn(),qa=Hn(),wn=Fn.toString,Tn=qa.toString;function Ln(Pn,Ri){qa(Pn,Ri,"=",Fn.def(Pn,Ri),";")}return d(function(){Fn.apply(Fn,sn(arguments))},{def:Fn.def,entry:Fn,exit:qa,save:Ln,set:function(Pn,Ri,Xn){Ln(Pn,Ri),Fn(Pn,Ri,"=",Xn,";")},toString:function(){return wn()+Tn()}})}function Gn(){var Fn=gn(arguments),qa=Un(),wn=Un(),Tn=qa.toString,Ln=wn.toString;return d(qa,{then:function(){return qa.apply(qa,sn(arguments)),this},else:function(){return wn.apply(wn,sn(arguments)),this},toString:function(){var Pn=Ln();return Pn&&(Pn="else{"+Pn+"}"),gn(["if(",Fn,"){",Tn(),"}",Pn])}})}var ti=Hn(),Wi={};function Ti(Fn,qa){var wn=[];function Tn(){var $i="a"+wn.length;return wn.push($i),$i}qa=qa||0;for(var Ln=0;Ln":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},ka={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ba={cw:ut,ccw:ht};function Va(cr){return Array.isArray(cr)||fr(cr)||dr(cr)}function Ma(cr){return cr.sort(function(fa,xa){return fa===wc?-1:xa===wc?1:fa=1,cn>=2,fa)}else if(xa===Ni){var In=cr.data;return new mn(In.thisDep,In.contextDep,In.propDep,fa)}else{if(xa===Bn)return new mn(!1,!1,!1,fa);if(xa===An){for(var Da=!1,Na=!1,Hn=!1,Un=0;Un=1&&(Na=!0),ti>=2&&(Hn=!0)}else Gn.type===Ni&&(Da=Da||Gn.data.thisDep,Na=Na||Gn.data.contextDep,Hn=Hn||Gn.data.propDep)}return new mn(Da,Na,Hn,fa)}else return new mn(xa===ji,xa===ki,xa===zi,fa)}}var hi=new mn(!1,!1,!1,function(){});function _i(cr,fa,xa,cn,In,Da,Na,Hn,Un,Gn,ti,Wi,Ti,si,Fn,qa){var wn=Gn.Record,Tn={add:32774,subtract:32778,"reverse subtract":32779};xa.ext_blend_minmax&&(Tn.min=xt,Tn.max=zt);var Ln=xa.angle_instanced_arrays,Pn=xa.webgl_draw_buffers,Ri=xa.oes_vertex_array_object,Xn={dirty:!0,profile:qa.profile},$i={},Cn=[],Mn={},Si={};function yn(st){return st.replace(".","_")}function gi(st,bt,It){var Jt=yn(st);Cn.push(st),$i[Jt]=Xn[Jt]=!!It,Mn[Jt]=bt}function ri(st,bt,It){var Jt=yn(st);Cn.push(st),Array.isArray(It)?(Xn[Jt]=It.slice(),$i[Jt]=It.slice()):Xn[Jt]=$i[Jt]=It,Si[Jt]=bt}function ro(st){return!!isNaN(st)}gi(Ki,Sr),gi(ko,sr),ri($o,"blendColor",[0,0,0,0]),ri(Ls,"blendEquationSeparate",[Vr,Vr]),ri(os,"blendFuncSeparate",[Ar,Cr,Ar,Cr]),gi(As,Qr,!0),ri(jo,"depthFunc",Kr),ri(il,"depthRange",[0,1]),ri(Qs,"depthMask",!0),ri(Ss,Ss,[!0,!0,!0,!0]),gi(fi,rr),ri(ao,"cullFace",Ye),ri(gs,gs,ht),ri(Jo,Jo,1),gi(Bl,_a),ri(jl,"polygonOffset",[0,0]),gi(Vl,za),gi(cc,nn),ri(ql,"sampleCoverage",[1,!1]),gi(Vu,Nr),ri(ol,"stencilMask",-1),ri(rc,"stencilFunc",[Dt,0,-1]),ri(Vi,"stencilOpSeparate",[Le,$t,$t,$t]),ri(eo,"stencilOpSeparate",[Ye,$t,$t,$t]),gi(qu,ia),ri(Du,"scissor",[0,0,cr.drawingBufferWidth,cr.drawingBufferHeight]),ri(wc,wc,[0,0,cr.drawingBufferWidth,cr.drawingBufferHeight]);var es={gl:cr,context:Ti,strings:fa,next:$i,current:Xn,draw:Wi,elements:Da,buffer:In,shader:ti,attributes:Gn.state,vao:Gn,uniforms:Un,framebuffer:Hn,extensions:xa,timer:si,isBufferArgs:Va},Fi={primTypes:dt,compareFuncs:Ta,blendFuncs:la,blendEquations:Tn,stencilOps:ka,glTypes:ta,orientationType:Ba};Pn&&(Fi.backBuffer=[Ye],Fi.drawBuffer=p(cn.maxDrawbuffers,function(st){return st===0?[0]:p(st,function(bt){return Ua+bt})}));var no=0;function oi(){var st=kn({cache:Fn}),bt=st.link,It=st.global;st.id=no++,st.batchId="0";var Jt=bt(es),Kt=st.shared={props:"a0"};Object.keys(es).forEach(function(pr){Kt[pr]=It.def(Jt,".",pr)});var vr=st.next={},Tr=st.current={};Object.keys(Si).forEach(function(pr){Array.isArray(Xn[pr])&&(vr[pr]=It.def(Kt.next,".",pr),Tr[pr]=It.def(Kt.current,".",pr))});var wr=st.constants={};Object.keys(Fi).forEach(function(pr){wr[pr]=It.def(JSON.stringify(Fi[pr]))}),st.invoke=function(pr,xr){switch(xr.type){case On:var ea=["this",Kt.context,Kt.props,st.batchId];return pr.def(bt(xr.data),".call(",ea.slice(0,Math.max(xr.data.length+1,4)),")");case zi:return pr.def(Kt.props,xr.data);case ki:return pr.def(Kt.context,xr.data);case ji:return pr.def("this",xr.data);case Ni:return xr.data.append(st,pr),xr.data.ref;case Bn:return xr.data.toString();case An:return xr.data.map(function(ha){return st.invoke(pr,ha)})}},st.attribCache={};var tr={};return st.scopeAttrib=function(pr){var xr=fa.id(pr);if(xr in tr)return tr[xr];var ea=Gn.scope[xr];ea||(ea=Gn.scope[xr]=new wn);var ha=tr[xr]=bt(ea);return ha},st}function Xo(st){var bt=st.static,It=st.dynamic,Jt;if(De in bt){var Kt=!!bt[De];Jt=jn(function(Tr,wr){return Kt}),Jt.enable=Kt}else if(De in It){var vr=It[De];Jt=Zn(vr,function(Tr,wr){return Tr.invoke(wr,vr)})}return Jt}function ys(st,bt){var It=st.static,Jt=st.dynamic;if(I in It){var Kt=It[I];return Kt?(Kt=Hn.getFramebuffer(Kt),jn(function(Tr,wr){var tr=Tr.link(Kt),pr=Tr.shared;wr.set(pr.framebuffer,".next",tr);var xr=pr.context;return wr.set(xr,"."+Fr,tr+".width"),wr.set(xr,"."+Wr,tr+".height"),tr})):jn(function(Tr,wr){var tr=Tr.shared;wr.set(tr.framebuffer,".next","null");var pr=tr.context;return wr.set(pr,"."+Fr,pr+"."+lt),wr.set(pr,"."+Wr,pr+"."+Tt),"null"})}else if(I in Jt){var vr=Jt[I];return Zn(vr,function(Tr,wr){var tr=Tr.invoke(wr,vr),pr=Tr.shared,xr=pr.framebuffer,ea=wr.def(xr,".getFramebuffer(",tr,")");wr.set(xr,".next",ea);var ha=pr.context;return wr.set(ha,"."+Fr,ea+"?"+ea+".width:"+ha+"."+lt),wr.set(ha,"."+Wr,ea+"?"+ea+".height:"+ha+"."+Tt),ea})}else return null}function xs(st,bt,It){var Jt=st.static,Kt=st.dynamic;function vr(tr){if(tr in Jt){var pr=Jt[tr],xr=!0,ea=pr.x|0,ha=pr.y|0,Ea,tn;return"width"in pr?Ea=pr.width|0:xr=!1,"height"in pr?tn=pr.height|0:xr=!1,new mn(!xr&&bt&&bt.thisDep,!xr&&bt&&bt.contextDep,!xr&&bt&&bt.propDep,function(an,hn){var xn=an.shared.context,fn=Ea;"width"in pr||(fn=hn.def(xn,".",Fr,"-",ea));var En=tn;return"height"in pr||(En=hn.def(xn,".",Wr,"-",ha)),[ea,ha,fn,En]})}else if(tr in Kt){var Xa=Kt[tr],Ya=Zn(Xa,function(an,hn){var xn=an.invoke(hn,Xa),fn=an.shared.context,En=hn.def(xn,".x|0"),Yn=hn.def(xn,".y|0"),vi=hn.def('"width" in ',xn,"?",xn,".width|0:","(",fn,".",Fr,"-",En,")"),ai=hn.def('"height" in ',xn,"?",xn,".height|0:","(",fn,".",Wr,"-",Yn,")");return[En,Yn,vi,ai]});return bt&&(Ya.thisDep=Ya.thisDep||bt.thisDep,Ya.contextDep=Ya.contextDep||bt.contextDep,Ya.propDep=Ya.propDep||bt.propDep),Ya}else return bt?new mn(bt.thisDep,bt.contextDep,bt.propDep,function(an,hn){var xn=an.shared.context;return[0,0,hn.def(xn,".",Fr),hn.def(xn,".",Wr)]}):null}var Tr=vr(wc);if(Tr){var wr=Tr;Tr=new mn(Tr.thisDep,Tr.contextDep,Tr.propDep,function(tr,pr){var xr=wr.append(tr,pr),ea=tr.shared.context;return pr.set(ea,"."+je,xr[2]),pr.set(ea,"."+Ze,xr[3]),xr})}return{viewport:Tr,scissor_box:vr(Du)}}function Xs(st,bt){var It=st.static,Jt=typeof It[Te]=="string"&&typeof It[ne]=="string";if(Jt){if(Object.keys(bt.dynamic).length>0)return null;var Kt=bt.static,vr=Object.keys(Kt);if(vr.length>0&&typeof Kt[vr[0]]=="number"){for(var Tr=[],wr=0;wr"+En+"?"+xr+".constant["+En+"]:0;"}).join(""),"}}else{","if(",Ea,"(",xr,".buffer)){",an,"=",tn,".createStream(",Et,",",xr,".buffer);","}else{",an,"=",tn,".getBuffer(",xr,".buffer);","}",hn,'="type" in ',xr,"?",ha.glTypes,"[",xr,".type]:",an,".dtype;",Xa.normalized,"=!!",xr,".normalized;");function xn(fn){pr(Xa[fn],"=",xr,".",fn,"|0;")}return xn("size"),xn("offset"),xn("stride"),xn("divisor"),pr("}}"),pr.exit("if(",Xa.isStream,"){",tn,".destroyStream(",an,");","}"),Xa}Kt[vr]=Zn(Tr,wr)}),Kt}function Lc(st){var bt=st.static,It=st.dynamic,Jt={};return Object.keys(bt).forEach(function(Kt){var vr=bt[Kt];Jt[Kt]=jn(function(Tr,wr){return typeof vr=="number"||typeof vr=="boolean"?""+vr:Tr.link(vr)})}),Object.keys(It).forEach(function(Kt){var vr=It[Kt];Jt[Kt]=Zn(vr,function(Tr,wr){return Tr.invoke(wr,vr)})}),Jt}function Pf(st,bt,It,Jt,Kt){st.static,st.dynamic;var vr=Xs(st,bt),Tr=ys(st),wr=xs(st,Tr),tr=Mu(st),pr=dl(st),xr=Ps(st,Kt,vr);function ea(an){var hn=wr[an];hn&&(pr[an]=hn)}ea(wc),ea(yn(Du));var ha=Object.keys(pr).length>0,Ea={framebuffer:Tr,draw:tr,shader:xr,state:pr,dirty:ha,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Ea.profile=Xo(st),Ea.uniforms=Eu(It),Ea.drawVAO=Ea.scopeVAO=tr.vao,!Ea.drawVAO&&xr.program&&!vr&&xa.angle_instanced_arrays&&tr.static.elements){var tn=!0,Xa=xr.program.attributes.map(function(an){var hn=bt.static[an];return tn=tn&&!!hn,hn});if(tn&&Xa.length>0){var Ya=Gn.getVAO(Gn.createVAO({attributes:Xa,elements:tr.static.elements}));Ea.drawVAO=new mn(null,null,null,function(an,hn){return an.link(Ya)}),Ea.useVAO=!0}}return vr?Ea.useVAO=!0:Ea.attributes=ac(bt),Ea.context=Lc(Jt),Ea}function su(st,bt,It){var Jt=st.shared,Kt=Jt.context,vr=st.scope();Object.keys(It).forEach(function(Tr){bt.save(Kt,"."+Tr);var wr=It[Tr],tr=wr.append(st,bt);Array.isArray(tr)?vr(Kt,".",Tr,"=[",tr.join(),"];"):vr(Kt,".",Tr,"=",tr,";")}),bt(vr)}function zu(st,bt,It,Jt){var Kt=st.shared,vr=Kt.gl,Tr=Kt.framebuffer,wr;Pn&&(wr=bt.def(Kt.extensions,".webgl_draw_buffers"));var tr=st.constants,pr=tr.drawBuffer,xr=tr.backBuffer,ea;It?ea=It.append(st,bt):ea=bt.def(Tr,".next"),Jt||bt("if(",ea,"!==",Tr,".cur){"),bt("if(",ea,"){",vr,".bindFramebuffer(",aa,",",ea,".framebuffer);"),Pn&&bt(wr,".drawBuffersWEBGL(",pr,"[",ea,".colorAttachments.length]);"),bt("}else{",vr,".bindFramebuffer(",aa,",null);"),Pn&&bt(wr,".drawBuffersWEBGL(",xr,");"),bt("}",Tr,".cur=",ea,";"),Jt||bt("}")}function Fo(st,bt,It){var Jt=st.shared,Kt=Jt.gl,vr=st.current,Tr=st.next,wr=Jt.current,tr=Jt.next,pr=st.cond(wr,".dirty");Cn.forEach(function(xr){var ea=yn(xr);if(!(ea in It.state)){var ha,Ea;if(ea in Tr){ha=Tr[ea],Ea=vr[ea];var tn=p(Xn[ea].length,function(Ya){return pr.def(ha,"[",Ya,"]")});pr(st.cond(tn.map(function(Ya,an){return Ya+"!=="+Ea+"["+an+"]"}).join("||")).then(Kt,".",Si[ea],"(",tn,");",tn.map(function(Ya,an){return Ea+"["+an+"]="+Ya}).join(";"),";"))}else{ha=pr.def(tr,".",ea);var Xa=st.cond(ha,"!==",wr,".",ea);pr(Xa),ea in Mn?Xa(st.cond(ha).then(Kt,".enable(",Mn[ea],");").else(Kt,".disable(",Mn[ea],");"),wr,".",ea,"=",ha,";"):Xa(Kt,".",Si[ea],"(",ha,");",wr,".",ea,"=",ha,";")}}}),Object.keys(It.state).length===0&&pr(wr,".dirty=false;"),bt(pr)}function nc(st,bt,It,Jt){var Kt=st.shared,vr=st.current,Tr=Kt.current,wr=Kt.gl,tr;Ma(Object.keys(It)).forEach(function(pr){var xr=It[pr];if(!(Jt&&!Jt(xr))){var ea=xr.append(st,bt);if(Mn[pr]){var ha=Mn[pr];Wn(xr)?(tr=st.link(ea,{stable:!0}),bt(st.cond(tr).then(wr,".enable(",ha,");").else(wr,".disable(",ha,");")),bt(Tr,".",pr,"=",tr,";")):(bt(st.cond(ea).then(wr,".enable(",ha,");").else(wr,".disable(",ha,");")),bt(Tr,".",pr,"=",ea,";"))}else if(ya(ea)){var Ea=vr[pr];bt(wr,".",Si[pr],"(",ea,");",ea.map(function(tn,Xa){return Ea+"["+Xa+"]="+tn}).join(";"),";")}else Wn(xr)?(tr=st.link(ea,{stable:!0}),bt(wr,".",Si[pr],"(",tr,");",Tr,".",pr,"=",tr,";")):bt(wr,".",Si[pr],"(",ea,");",Tr,".",pr,"=",ea,";")}})}function ll(st,bt){Ln&&(st.instancing=bt.def(st.shared.extensions,".angle_instanced_arrays"))}function Sl(st,bt,It,Jt,Kt){var vr=st.shared,Tr=st.stats,wr=vr.current,tr=vr.timer,pr=It.profile;function xr(){return typeof performance>"u"?"Date.now()":"performance.now()"}var ea,ha;function Ea(xn){ea=bt.def(),xn(ea,"=",xr(),";"),typeof Kt=="string"?xn(Tr,".count+=",Kt,";"):xn(Tr,".count++;"),si&&(Jt?(ha=bt.def(),xn(ha,"=",tr,".getNumPendingQueries();")):xn(tr,".beginQuery(",Tr,");"))}function tn(xn){xn(Tr,".cpuTime+=",xr(),"-",ea,";"),si&&(Jt?xn(tr,".pushScopeStats(",ha,",",tr,".getNumPendingQueries(),",Tr,");"):xn(tr,".endQuery();"))}function Xa(xn){var fn=bt.def(wr,".profile");bt(wr,".profile=",xn,";"),bt.exit(wr,".profile=",fn,";")}var Ya;if(pr){if(Wn(pr)){pr.enable?(Ea(bt),tn(bt.exit),Xa("true")):Xa("false");return}Ya=pr.append(st,bt),Xa(Ya)}else Ya=bt.def(wr,".profile");var an=st.block();Ea(an),bt("if(",Ya,"){",an,"}");var hn=st.block();tn(hn),bt.exit("if(",Ya,"){",hn,"}")}function qc(st,bt,It,Jt,Kt){var vr=st.shared;function Tr(tr){switch(tr){case ln:case Gi:case Zo:return 2;case Nn:case Bo:case Hs:return 3;case pi:case No:case zs:return 4;default:return 1}}function wr(tr,pr,xr){var ea=vr.gl,ha=bt.def(tr,".location"),Ea=bt.def(vr.attributes,"[",ha,"]"),tn=xr.state,Xa=xr.buffer,Ya=[xr.x,xr.y,xr.z,xr.w],an=["buffer","normalized","offset","stride"];function hn(){bt("if(!",Ea,".buffer){",ea,".enableVertexAttribArray(",ha,");}");var fn=xr.type,En;if(xr.size?En=bt.def(xr.size,"||",pr):En=pr,bt("if(",Ea,".type!==",fn,"||",Ea,".size!==",En,"||",an.map(function(vi){return Ea+"."+vi+"!=="+xr[vi]}).join("||"),"){",ea,".bindBuffer(",Et,",",Xa,".buffer);",ea,".vertexAttribPointer(",[ha,En,fn,xr.normalized,xr.stride,xr.offset],");",Ea,".type=",fn,";",Ea,".size=",En,";",an.map(function(vi){return Ea+"."+vi+"="+xr[vi]+";"}).join(""),"}"),Ln){var Yn=xr.divisor;bt("if(",Ea,".divisor!==",Yn,"){",st.instancing,".vertexAttribDivisorANGLE(",[ha,Yn],");",Ea,".divisor=",Yn,";}")}}function xn(){bt("if(",Ea,".buffer){",ea,".disableVertexAttribArray(",ha,");",Ea,".buffer=null;","}if(",Ja.map(function(fn,En){return Ea+"."+fn+"!=="+Ya[En]}).join("||"),"){",ea,".vertexAttrib4f(",ha,",",Ya,");",Ja.map(function(fn,En){return Ea+"."+fn+"="+Ya[En]+";"}).join(""),"}")}tn===on?hn():tn===Wa?xn():(bt("if(",tn,"===",on,"){"),hn(),bt("}else{"),xn(),bt("}"))}Jt.forEach(function(tr){var pr=tr.name,xr=It.attributes[pr],ea;if(xr){if(!Kt(xr))return;ea=xr.append(st,bt)}else{if(!Kt(hi))return;var ha=st.scopeAttrib(pr);ea={},Object.keys(new wn).forEach(function(Ea){ea[Ea]=bt.def(ha,".",Ea)})}wr(st.link(tr),Tr(tr.info.type),ea)})}function Hc(st,bt,It,Jt,Kt,vr){for(var Tr=st.shared,wr=Tr.gl,tr,pr=0;pr1){for(var Io=[],yo=[],vs=0;vs>1)",Xa],");")}function Yn(){It(Ya,".drawArraysInstancedANGLE(",[ha,Ea,tn,Xa],");")}xr&&xr!=="null"?hn?En():(It("if(",xr,"){"),En(),It("}else{"),Yn(),It("}")):Yn()}function fn(){function En(){It(vr+".drawElements("+[ha,tn,an,Ea+"<<(("+an+"-"+_n+")>>1)"]+");")}function Yn(){It(vr+".drawArrays("+[ha,Ea,tn]+");")}xr&&xr!=="null"?hn?En():(It("if(",xr,"){"),En(),It("}else{"),Yn(),It("}")):Yn()}Ln&&(typeof Xa!="number"||Xa>=0)?typeof Xa=="string"?(It("if(",Xa,">0){"),xn(),It("}else if(",Xa,"<0){"),fn(),It("}")):xn():fn()}function js(st,bt,It,Jt,Kt){var vr=oi(),Tr=vr.proc("body",Kt);return Ln&&(vr.instancing=Tr.def(vr.shared.extensions,".angle_instanced_arrays")),st(vr,Tr,It,Jt),vr.compile().body}function ls(st,bt,It,Jt){ll(st,bt),It.useVAO?It.drawVAO?bt(st.shared.vao,".setVAO(",It.drawVAO.append(st,bt),");"):bt(st.shared.vao,".setVAO(",st.shared.vao,".targetVAO);"):(bt(st.shared.vao,".setVAO(null);"),qc(st,bt,It,Jt.attributes,function(){return!0})),Hc(st,bt,It,Jt.uniforms,function(){return!0},!1),ss(st,bt,bt,It)}function ye(st,bt){var It=st.proc("draw",1);ll(st,It),su(st,It,bt.context),zu(st,It,bt.framebuffer),Fo(st,It,bt),nc(st,It,bt.state),Sl(st,It,bt,!1,!0);var Jt=bt.shader.progVar.append(st,It);if(It(st.shared.gl,".useProgram(",Jt,".program);"),bt.shader.program)ls(st,It,bt,bt.shader.program);else{It(st.shared.vao,".setVAO(null);");var Kt=st.global.def("{}"),vr=It.def(Jt,".id"),Tr=It.def(Kt,"[",vr,"]");It(st.cond(Tr).then(Tr,".call(this,a0);").else(Tr,"=",Kt,"[",vr,"]=",st.link(function(wr){return js(ls,st,bt,wr,1)}),"(",Jt,");",Tr,".call(this,a0);"))}Object.keys(bt.state).length>0&&It(st.shared.current,".dirty=true;"),st.shared.vao&&It(st.shared.vao,".setVAO(null);")}function W(st,bt,It,Jt){st.batchId="a1",ll(st,bt);function Kt(){return!0}qc(st,bt,It,Jt.attributes,Kt),Hc(st,bt,It,Jt.uniforms,Kt,!1),ss(st,bt,bt,It)}function de(st,bt,It,Jt){ll(st,bt);var Kt=It.contextDep,vr=bt.def(),Tr="a0",wr="a1",tr=bt.def();st.shared.props=tr,st.batchId=vr;var pr=st.scope(),xr=st.scope();bt(pr.entry,"for(",vr,"=0;",vr,"<",wr,";++",vr,"){",tr,"=",Tr,"[",vr,"];",xr,"}",pr.exit);function ea(an){return an.contextDep&&Kt||an.propDep}function ha(an){return!ea(an)}if(It.needsContext&&su(st,xr,It.context),It.needsFramebuffer&&zu(st,xr,It.framebuffer),nc(st,xr,It.state,ea),It.profile&&ea(It.profile)&&Sl(st,xr,It,!1,!0),Jt)It.useVAO?It.drawVAO?ea(It.drawVAO)?xr(st.shared.vao,".setVAO(",It.drawVAO.append(st,xr),");"):pr(st.shared.vao,".setVAO(",It.drawVAO.append(st,pr),");"):pr(st.shared.vao,".setVAO(",st.shared.vao,".targetVAO);"):(pr(st.shared.vao,".setVAO(null);"),qc(st,pr,It,Jt.attributes,ha),qc(st,xr,It,Jt.attributes,ea)),Hc(st,pr,It,Jt.uniforms,ha,!1),Hc(st,xr,It,Jt.uniforms,ea,!0),ss(st,pr,xr,It);else{var Ea=st.global.def("{}"),tn=It.shader.progVar.append(st,xr),Xa=xr.def(tn,".id"),Ya=xr.def(Ea,"[",Xa,"]");xr(st.shared.gl,".useProgram(",tn,".program);","if(!",Ya,"){",Ya,"=",Ea,"[",Xa,"]=",st.link(function(an){return js(W,st,It,an,2)}),"(",tn,");}",Ya,".call(this,a0[",vr,"],",vr,");")}}function te(st,bt){var It=st.proc("batch",2);st.batchId="0",ll(st,It);var Jt=!1,Kt=!0;Object.keys(bt.context).forEach(function(Ea){Jt=Jt||bt.context[Ea].propDep}),Jt||(su(st,It,bt.context),Kt=!1);var vr=bt.framebuffer,Tr=!1;vr?(vr.propDep?Jt=Tr=!0:vr.contextDep&&Jt&&(Tr=!0),Tr||zu(st,It,vr)):zu(st,It,null),bt.state.viewport&&bt.state.viewport.propDep&&(Jt=!0);function wr(Ea){return Ea.contextDep&&Jt||Ea.propDep}Fo(st,It,bt),nc(st,It,bt.state,function(Ea){return!wr(Ea)}),(!bt.profile||!wr(bt.profile))&&Sl(st,It,bt,!1,"a1"),bt.contextDep=Jt,bt.needsContext=Kt,bt.needsFramebuffer=Tr;var tr=bt.shader.progVar;if(tr.contextDep&&Jt||tr.propDep)de(st,It,bt,null);else{var pr=tr.append(st,It);if(It(st.shared.gl,".useProgram(",pr,".program);"),bt.shader.program)de(st,It,bt,bt.shader.program);else{It(st.shared.vao,".setVAO(null);");var xr=st.global.def("{}"),ea=It.def(pr,".id"),ha=It.def(xr,"[",ea,"]");It(st.cond(ha).then(ha,".call(this,a0,a1);").else(ha,"=",xr,"[",ea,"]=",st.link(function(Ea){return js(de,st,bt,Ea,2)}),"(",pr,");",ha,".call(this,a0,a1);"))}}Object.keys(bt.state).length>0&&It(st.shared.current,".dirty=true;"),st.shared.vao&&It(st.shared.vao,".setVAO(null);")}function me(st,bt){var It=st.proc("scope",3);st.batchId="a2";var Jt=st.shared,Kt=Jt.current;if(su(st,It,bt.context),bt.framebuffer&&bt.framebuffer.append(st,It),Ma(Object.keys(bt.state)).forEach(function(wr){var tr=bt.state[wr],pr=tr.append(st,It);ya(pr)?pr.forEach(function(xr,ea){ro(xr)?It.set(st.next[wr],"["+ea+"]",xr):It.set(st.next[wr],"["+ea+"]",st.link(xr,{stable:!0}))}):Wn(tr)?It.set(Jt.next,"."+wr,st.link(pr,{stable:!0})):It.set(Jt.next,"."+wr,pr)}),Sl(st,It,bt,!0,!0),[Se,yt,ot,Ct,Ie].forEach(function(wr){var tr=bt.draw[wr];if(tr){var pr=tr.append(st,It);ro(pr)?It.set(Jt.draw,"."+wr,pr):It.set(Jt.draw,"."+wr,st.link(pr),{stable:!0})}}),Object.keys(bt.uniforms).forEach(function(wr){var tr=bt.uniforms[wr].append(st,It);Array.isArray(tr)&&(tr="["+tr.map(function(pr){return ro(pr)?pr:st.link(pr,{stable:!0})})+"]"),It.set(Jt.uniforms,"["+st.link(fa.id(wr),{stable:!0})+"]",tr)}),Object.keys(bt.attributes).forEach(function(wr){var tr=bt.attributes[wr].append(st,It),pr=st.scopeAttrib(wr);Object.keys(new wn).forEach(function(xr){It.set(pr,"."+xr,tr[xr])})}),bt.scopeVAO){var vr=bt.scopeVAO.append(st,It);ro(vr)?It.set(Jt.vao,".targetVAO",vr):It.set(Jt.vao,".targetVAO",st.link(vr,{stable:!0}))}function Tr(wr){var tr=bt.shader[wr];if(tr){var pr=tr.append(st,It);ro(pr)?It.set(Jt.shader,"."+wr,pr):It.set(Jt.shader,"."+wr,st.link(pr,{stable:!0}))}}Tr(ne),Tr(Te),Object.keys(bt.state).length>0&&(It(Kt,".dirty=true;"),It.exit(Kt,".dirty=true;")),It("a1(",st.shared.context,",a0,",st.batchId,");")}function Ue(st){if(!(typeof st!="object"||ya(st))){for(var bt=Object.keys(st),It=0;It=0;--ss){var js=ro[ss];js&&js(si,null,0)}xa.flush(),Gn&&Gn.update()}function ys(){!oi&&ro.length>0&&(oi=f.next(Xo))}function xs(){oi&&(f.cancel(Xo),oi=null)}function Xs(ss){ss.preventDefault(),xs(),es.forEach(function(js){js()})}function Ps(ss){xa.getError(),In.restore(),Xn.restore(),Tn.restore(),$i.restore(),Cn.restore(),Mn.restore(),Pn.restore(),Gn&&Gn.restore(),Si.procs.refresh(),ys(),Fi.forEach(function(js){js()})}ri&&(ri.addEventListener(Es,Xs,!1),ri.addEventListener(hs,Ps,!1));function Mu(){ro.length=0,xs(),ri&&(ri.removeEventListener(Es,Xs),ri.removeEventListener(hs,Ps)),Xn.clear(),Mn.clear(),Cn.clear(),Pn.clear(),$i.clear(),Ln.clear(),Tn.clear(),Gn&&Gn.clear(),no.forEach(function(ss){ss()})}function dl(ss){function js(Kt){var vr=d({},Kt);delete vr.uniforms,delete vr.attributes,delete vr.context,delete vr.vao,"stencil"in vr&&vr.stencil.op&&(vr.stencil.opBack=vr.stencil.opFront=vr.stencil.op,delete vr.stencil.op);function Tr(wr){if(wr in vr){var tr=vr[wr];delete vr[wr],Object.keys(tr).forEach(function(pr){vr[wr+"."+pr]=tr[pr]})}}return Tr("blend"),Tr("depth"),Tr("cull"),Tr("stencil"),Tr("polygonOffset"),Tr("scissor"),Tr("sample"),"vao"in Kt&&(vr.vao=Kt.vao),vr}function ls(Kt,vr){var Tr={},wr={};return Object.keys(Kt).forEach(function(tr){var pr=Kt[tr];if(c.isDynamic(pr)){wr[tr]=c.unbox(pr,tr);return}else if(vr&&Array.isArray(pr)){for(var xr=0;xr0)return ft.call(this,It(Kt|0),Kt|0)}else if(Array.isArray(Kt)){if(Kt.length)return ft.call(this,Kt,Kt.length)}else return tt.call(this,Kt)}return d(Jt,{stats:me,destroy:function(){Ue.destroy()}})}var Eu=Mn.setFBO=dl({framebuffer:c.define.call(null,Hl,"framebuffer")});function ac(ss,js){var ls=0;Si.procs.poll();var ye=js.color;ye&&(xa.clearColor(+ye[0]||0,+ye[1]||0,+ye[2]||0,+ye[3]||0),ls|=Ms),"depth"in js&&(xa.clearDepth(+js.depth),ls|=Kn),"stencil"in js&&(xa.clearStencil(js.stencil|0),ls|=go),xa.clear(ls)}function Lc(ss){if("framebuffer"in ss)if(ss.framebuffer&&ss.framebuffer_reglType==="framebufferCube")for(var js=0;js<6;++js)Eu(d({framebuffer:ss.framebuffer.faces[js]},ss),ac);else Eu(ss,ac);else ac(null,ss)}function Pf(ss){ro.push(ss);function js(){var ls=gu(ro,ss);function ye(){var W=gu(ro,ye);ro[W]=ro[ro.length-1],ro.length-=1,ro.length<=0&&xs()}ro[ls]=ye}return ys(),{cancel:js}}function su(){var ss=gi.viewport,js=gi.scissor_box;ss[0]=ss[1]=js[0]=js[1]=0,si.viewportWidth=si.framebufferWidth=si.drawingBufferWidth=ss[2]=js[2]=xa.drawingBufferWidth,si.viewportHeight=si.framebufferHeight=si.drawingBufferHeight=ss[3]=js[3]=xa.drawingBufferHeight}function zu(){si.tick+=1,si.time=nc(),su(),Si.procs.poll()}function Fo(){$i.refresh(),su(),Si.procs.refresh(),Gn&&Gn.update()}function nc(){return(v()-ti)/1e3}Fo();function ll(ss,js){var ls;switch(ss){case"frame":return Pf(js);case"lost":ls=es;break;case"restore":ls=Fi;break;case"destroy":ls=no;break}return ls.push(js),{cancel:function(){for(var ye=0;ye=0},read:yn,destroy:Mu,_gl:xa,_refresh:Fo,poll:function(){zu(),Gn&&Gn.update()},now:nc,stats:Na,getCachedCode:Sl,preloadCachedCode:qc});return fa.onDone(null,Hc),Hc}return el})}}),$6=He({"node_modules/gl-util/context.js"(Y,G){var d=Gv();G.exports=function(o){if(o?typeof o=="string"&&(o={container:o}):o={},A(o)?o={container:o}:E(o)?o={container:o}:e(o)?o={gl:o}:o=d(o,{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),o.pixelRatio||(o.pixelRatio=window.pixelRatio||1),o.gl)return o.gl;if(o.canvas&&(o.container=o.canvas.parentNode),o.container){if(typeof o.container=="string"){var a=document.querySelector(o.container);if(!a)throw Error("Element "+o.container+" is not found");o.container=a}A(o.container)?(o.canvas=o.container,o.container=o.canvas.parentNode):o.canvas||(o.canvas=t(),o.container.appendChild(o.canvas),x(o))}else if(!o.canvas)if(typeof document<"u")o.container=document.body||document.documentElement,o.canvas=t(),o.container.appendChild(o.canvas),x(o);else throw Error("Not DOM environment. Use headless-gl.");return o.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(i){try{o.gl=o.canvas.getContext(i,o.attrs)}catch{}return o.gl}),o.gl};function x(r){if(r.container)if(r.container==document.body)document.body.style.width||(r.canvas.width=r.width||r.pixelRatio*window.innerWidth),document.body.style.height||(r.canvas.height=r.height||r.pixelRatio*window.innerHeight);else{var o=r.container.getBoundingClientRect();r.canvas.width=r.width||o.right-o.left,r.canvas.height=r.height||o.bottom-o.top}}function A(r){return typeof r.getContext=="function"&&"width"in r&&"height"in r}function E(r){return typeof r.nodeName=="string"&&typeof r.appendChild=="function"&&typeof r.getBoundingClientRect=="function"}function e(r){return typeof r.drawArrays=="function"||typeof r.drawElements=="function"}function t(){var r=document.createElement("canvas");return r.style.position="absolute",r.style.top=0,r.style.left=0,r}}}),Q6=He({"node_modules/font-atlas/index.js"(Y,G){var d=_T(),x=[32,126];G.exports=A;function A(E){E=E||{};var e=E.shape?E.shape:E.canvas?[E.canvas.width,E.canvas.height]:[512,512],t=E.canvas||document.createElement("canvas"),r=E.font,o=typeof E.step=="number"?[E.step,E.step]:E.step||[32,32],a=E.chars||x;if(r&&typeof r!="string"&&(r=d(r)),!Array.isArray(a))a=String(a).split("");else if(a.length===2&&typeof a[0]=="number"&&typeof a[1]=="number"){for(var i=[],n=a[0],s=0;n<=a[1];n++)i[s++]=String.fromCharCode(n);a=i}e=e.slice(),t.width=e[0],t.height=e[1];var c=t.getContext("2d");c.fillStyle="#000",c.fillRect(0,0,t.width,t.height),c.font=r,c.textAlign="center",c.textBaseline="middle",c.fillStyle="#fff";for(var f=o[0]/2,v=o[1]/2,n=0;ne[0]-o[0]/2&&(f=o[0]/2,v+=o[1]);return t}}}),bT=He({"node_modules/bit-twiddle/twiddle.js"(Y){"use restrict";var G=32;Y.INT_BITS=G,Y.INT_MAX=2147483647,Y.INT_MIN=-1<0)-(A<0)},Y.abs=function(A){var E=A>>G-1;return(A^E)-E},Y.min=function(A,E){return E^(A^E)&-(A65535)<<4,A>>>=E,e=(A>255)<<3,A>>>=e,E|=e,e=(A>15)<<2,A>>>=e,E|=e,e=(A>3)<<1,A>>>=e,E|=e,E|A>>1},Y.log10=function(A){return A>=1e9?9:A>=1e8?8:A>=1e7?7:A>=1e6?6:A>=1e5?5:A>=1e4?4:A>=1e3?3:A>=100?2:A>=10?1:0},Y.popCount=function(A){return A=A-(A>>>1&1431655765),A=(A&858993459)+(A>>>2&858993459),(A+(A>>>4)&252645135)*16843009>>>24};function d(A){var E=32;return A&=-A,A&&E--,A&65535&&(E-=16),A&16711935&&(E-=8),A&252645135&&(E-=4),A&858993459&&(E-=2),A&1431655765&&(E-=1),E}Y.countTrailingZeros=d,Y.nextPow2=function(A){return A+=A===0,--A,A|=A>>>1,A|=A>>>2,A|=A>>>4,A|=A>>>8,A|=A>>>16,A+1},Y.prevPow2=function(A){return A|=A>>>1,A|=A>>>2,A|=A>>>4,A|=A>>>8,A|=A>>>16,A-(A>>>1)},Y.parity=function(A){return A^=A>>>16,A^=A>>>8,A^=A>>>4,A&=15,27030>>>A&1};var x=new Array(256);(function(A){for(var E=0;E<256;++E){var e=E,t=E,r=7;for(e>>>=1;e;e>>>=1)t<<=1,t|=e&1,--r;A[E]=t<>>8&255]<<16|x[A>>>16&255]<<8|x[A>>>24&255]},Y.interleave2=function(A,E){return A&=65535,A=(A|A<<8)&16711935,A=(A|A<<4)&252645135,A=(A|A<<2)&858993459,A=(A|A<<1)&1431655765,E&=65535,E=(E|E<<8)&16711935,E=(E|E<<4)&252645135,E=(E|E<<2)&858993459,E=(E|E<<1)&1431655765,A|E<<1},Y.deinterleave2=function(A,E){return A=A>>>E&1431655765,A=(A|A>>>1)&858993459,A=(A|A>>>2)&252645135,A=(A|A>>>4)&16711935,A=(A|A>>>16)&65535,A<<16>>16},Y.interleave3=function(A,E,e){return A&=1023,A=(A|A<<16)&4278190335,A=(A|A<<8)&251719695,A=(A|A<<4)&3272356035,A=(A|A<<2)&1227133513,E&=1023,E=(E|E<<16)&4278190335,E=(E|E<<8)&251719695,E=(E|E<<4)&3272356035,E=(E|E<<2)&1227133513,A|=E<<1,e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,A|e<<2},Y.deinterleave3=function(A,E){return A=A>>>E&1227133513,A=(A|A>>>2)&3272356035,A=(A|A>>>4)&251719695,A=(A|A>>>8)&4278190335,A=(A|A>>>16)&1023,A<<22>>22},Y.nextCombination=function(A){var E=A|A-1;return E+1|(~E&-~E)-1>>>d(A)+1}}}),eI=He({"node_modules/dup/dup.js"(Y,G){function d(E,e,t){var r=E[t]|0;if(r<=0)return[];var o=new Array(r),a;if(t===E.length-1)for(a=0;a"u"&&(e=0),typeof E){case"number":if(E>0)return x(E|0,e);break;case"object":if(typeof E.length=="number")return d(E,e,0);break}return[]}G.exports=A}}),tI=He({"node_modules/typedarray-pool/pool.js"(Y){var G=bT(),d=eI(),x=zp().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:d([32,0]),UINT16:d([32,0]),UINT32:d([32,0]),BIGUINT64:d([32,0]),INT8:d([32,0]),INT16:d([32,0]),INT32:d([32,0]),BIGINT64:d([32,0]),FLOAT:d([32,0]),DOUBLE:d([32,0]),DATA:d([32,0]),UINT8C:d([32,0]),BUFFER:d([32,0])});var A=typeof Uint8ClampedArray<"u",E=typeof BigUint64Array<"u",e=typeof BigInt64Array<"u",t=window.__TYPEDARRAY_POOL;t.UINT8C||(t.UINT8C=d([32,0])),t.BIGUINT64||(t.BIGUINT64=d([32,0])),t.BIGINT64||(t.BIGINT64=d([32,0])),t.BUFFER||(t.BUFFER=d([32,0]));var r=t.DATA,o=t.BUFFER;Y.free=function(u){if(x.isBuffer(u))o[G.log2(u.length)].push(u);else{if(Object.prototype.toString.call(u)!=="[object ArrayBuffer]"&&(u=u.buffer),!u)return;var g=u.length||u.byteLength,m=G.log2(g)|0;r[m].push(u)}};function a(p){if(p){var u=p.length||p.byteLength,g=G.log2(u);r[g].push(p)}}function i(p){a(p.buffer)}Y.freeUint8=Y.freeUint16=Y.freeUint32=Y.freeBigUint64=Y.freeInt8=Y.freeInt16=Y.freeInt32=Y.freeBigInt64=Y.freeFloat32=Y.freeFloat=Y.freeFloat64=Y.freeDouble=Y.freeUint8Clamped=Y.freeDataView=i,Y.freeArrayBuffer=a,Y.freeBuffer=function(u){o[G.log2(u.length)].push(u)},Y.malloc=function(u,g){if(g===void 0||g==="arraybuffer")return n(u);switch(g){case"uint8":return s(u);case"uint16":return c(u);case"uint32":return f(u);case"int8":return v(u);case"int16":return h(u);case"int32":return T(u);case"float":case"float32":return l(u);case"double":case"float64":return y(u);case"uint8_clamped":return b(u);case"bigint64":return M(u);case"biguint64":return S(u);case"buffer":return w(u);case"data":case"dataview":return _(u);default:return null}return null};function n(u){var u=G.nextPow2(u),g=G.log2(u),m=r[g];return m.length>0?m.pop():new ArrayBuffer(u)}Y.mallocArrayBuffer=n;function s(p){return new Uint8Array(n(p),0,p)}Y.mallocUint8=s;function c(p){return new Uint16Array(n(2*p),0,p)}Y.mallocUint16=c;function f(p){return new Uint32Array(n(4*p),0,p)}Y.mallocUint32=f;function v(p){return new Int8Array(n(p),0,p)}Y.mallocInt8=v;function h(p){return new Int16Array(n(2*p),0,p)}Y.mallocInt16=h;function T(p){return new Int32Array(n(4*p),0,p)}Y.mallocInt32=T;function l(p){return new Float32Array(n(4*p),0,p)}Y.mallocFloat32=Y.mallocFloat=l;function y(p){return new Float64Array(n(8*p),0,p)}Y.mallocFloat64=Y.mallocDouble=y;function b(p){return A?new Uint8ClampedArray(n(p),0,p):s(p)}Y.mallocUint8Clamped=b;function S(p){return E?new BigUint64Array(n(8*p),0,p):null}Y.mallocBigUint64=S;function M(p){return e?new BigInt64Array(n(8*p),0,p):null}Y.mallocBigInt64=M;function _(p){return new DataView(n(p),0,p)}Y.mallocDataView=_;function w(p){p=G.nextPow2(p);var u=G.log2(p),g=o[u];return g.length>0?g.pop():new x(p)}Y.mallocBuffer=w,Y.clearCache=function(){for(var u=0;u<32;++u)t.UINT8[u].length=0,t.UINT16[u].length=0,t.UINT32[u].length=0,t.INT8[u].length=0,t.INT16[u].length=0,t.INT32[u].length=0,t.FLOAT[u].length=0,t.DOUBLE[u].length=0,t.BIGUINT64[u].length=0,t.BIGINT64[u].length=0,t.UINT8C[u].length=0,r[u].length=0,o[u].length=0}}}),rI=He({"node_modules/is-plain-obj/index.js"(Y,G){var d=Object.prototype.toString;G.exports=function(x){var A;return d.call(x)==="[object Object]"&&(A=Object.getPrototypeOf(x),A===null||A===Object.getPrototypeOf({}))}}}),wT=He({"node_modules/parse-unit/index.js"(Y,G){G.exports=function(x,A){A||(A=[0,""]),x=String(x);var E=parseFloat(x,10);return A[0]=E,A[1]=x.match(/[\d.\-\+]*\s*(.*)/)[1]||"",A}}}),aI=He({"node_modules/to-px/topx.js"(Y,G){var d=wT();G.exports=e;var x=96;function A(t,r){var o=d(getComputedStyle(t).getPropertyValue(r));return o[0]*e(o[1],t)}function E(t,r){var o=document.createElement("div");o.style["font-size"]="128"+t,r.appendChild(o);var a=A(o,"font-size")/128;return r.removeChild(o),a}function e(t,r){switch(r=r||document.body,t=(t||"px").trim().toLowerCase(),(r===window||r===document)&&(r=document.body),t){case"%":return r.clientHeight/100;case"ch":case"ex":return E(t,r);case"em":return A(r,"font-size");case"rem":return A(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return x;case"cm":return x/2.54;case"mm":return x/25.4;case"pt":return x/72;case"pc":return x/6}return 1}}}),nI=He({"node_modules/detect-kerning/index.js"(Y,G){G.exports=E;var d=E.canvas=document.createElement("canvas"),x=d.getContext("2d"),A=e([32,126]);E.createPairs=e,E.ascii=A;function E(t,r){Array.isArray(t)&&(t=t.join(", "));var o={},a,i=16,n=.05;r&&(r.length===2&&typeof r[0]=="number"?a=e(r):Array.isArray(r)?a=r:(r.o?a=e(r.o):r.pairs&&(a=r.pairs),r.fontSize&&(i=r.fontSize),r.threshold!=null&&(n=r.threshold))),a||(a=A),x.font=i+"px "+t;for(var s=0;si*n){var h=(v-f)/i;o[c]=h*1e3}}return o}function e(t){for(var r=[],o=t[0];o<=t[1];o++)for(var a=String.fromCharCode(o),i=t[0];i0;o-=4)if(r[o]!==0)return Math.floor((o-3)*.25/t)}}}),oI=He({"node_modules/gl-text/dist.js"(Y,G){var d=J6(),x=Gv(),A=xT(),E=$6(),e=fT(),t=rp(),r=Q6(),o=tI(),a=cg(),i=rI(),n=wT(),s=aI(),c=nI(),f=Yc(),v=iI(),h=Yp(),T=bT(),l=T.nextPow2,y=new e,b=!1;document.body&&(S=document.body.appendChild(document.createElement("div")),S.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(S).fontStretch&&(b=!0),document.body.removeChild(S));var S,M=function(p){_(p)?(p={regl:p},this.gl=p.regl._gl):this.gl=E(p),this.shader=y.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=p.regl||A({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),y.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(i(p)?p:{})};M.prototype.createShader=function(){var p=this.regl,u=p({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:p.prop("count"),offset:p.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:p.this("sizeBuffer")},width:{offset:0,stride:8,buffer:p.this("sizeBuffer")},char:p.this("charBuffer"),position:p.this("position")},uniforms:{atlasSize:function(m,R){return[R.atlas.width,R.atlas.height]},atlasDim:function(m,R){return[R.atlas.cols,R.atlas.rows]},atlas:function(m,R){return R.atlas.texture},charStep:function(m,R){return R.atlas.step},em:function(m,R){return R.atlas.em},color:p.prop("color"),opacity:p.prop("opacity"),viewport:p.this("viewportArray"),scale:p.this("scale"),align:p.prop("align"),baseline:p.prop("baseline"),translate:p.this("translate"),positionOffset:p.prop("positionOffset")},primitive:"points",viewport:p.this("viewport"),vert:` + precision highp float; + attribute float width, charOffset, char; + attribute vec2 position; + uniform float fontSize, charStep, em, align, baseline; + uniform vec4 viewport; + uniform vec4 color; + uniform vec2 atlasSize, atlasDim, scale, translate, positionOffset; + varying vec2 charCoord, charId; + varying float charWidth; + varying vec4 fontColor; + void main () { + vec2 offset = floor(em * (vec2(align + charOffset, baseline) + + vec2(positionOffset.x, -positionOffset.y))) + / (viewport.zw * scale.xy); + + vec2 position = (position + translate) * scale; + position += offset * scale; + + charCoord = position * viewport.zw + viewport.xy; + + gl_Position = vec4(position * 2. - 1., 0, 1); + + gl_PointSize = charStep; + + charId.x = mod(char, atlasDim.x); + charId.y = floor(char / atlasDim.x); + + charWidth = width * em; + + fontColor = color / 255.; + }`,frag:` + precision highp float; + uniform float fontSize, charStep, opacity; + uniform vec2 atlasSize; + uniform vec4 viewport; + uniform sampler2D atlas; + varying vec4 fontColor; + varying vec2 charCoord, charId; + varying float charWidth; + + float lightness(vec4 color) { + return color.r * 0.299 + color.g * 0.587 + color.b * 0.114; + } + + void main () { + vec2 uv = gl_FragCoord.xy - charCoord + charStep * .5; + float halfCharStep = floor(charStep * .5 + .5); + + // invert y and shift by 1px (FF expecially needs that) + uv.y = charStep - uv.y; + + // ignore points outside of character bounding box + float halfCharWidth = ceil(charWidth * .5); + if (floor(uv.x) > 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; + }`}),g={};return{regl:p,draw:u,atlas:g}},M.prototype.update=function(p){var u=this;if(typeof p=="string")p={text:p};else if(!p)return;p=x(p,{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),p.opacity!=null&&(Array.isArray(p.opacity)?this.opacity=p.opacity.map(function(ce){return parseFloat(ce)}):this.opacity=parseFloat(p.opacity)),p.viewport!=null&&(this.viewport=a(p.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]),p.kerning!=null&&(this.kerning=p.kerning),p.offset!=null&&(typeof p.offset=="number"&&(p.offset=[p.offset,0]),this.positionOffset=h(p.offset)),p.direction&&(this.direction=p.direction),p.range&&(this.range=p.range,this.scale=[1/(p.range[2]-p.range[0]),1/(p.range[3]-p.range[1])],this.translate=[-p.range[0],-p.range[1]]),p.scale&&(this.scale=p.scale),p.translate&&(this.translate=p.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!p.font&&(p.font=M.baseFontSize+"px sans-serif");var g=!1,m=!1;if(p.font&&(Array.isArray(p.font)?p.font:[p.font]).forEach(function(ce,Re){if(typeof ce=="string")try{ce=d.parse(ce)}catch{ce=d.parse(M.baseFontSize+"px "+ce)}else{var $e=ce.style,rt=ce.weight,Je=ce.stretch,At=ce.variant;ce=d.parse(d.stringify(ce)),$e&&(ce.style=$e),rt&&(ce.weight=rt),Je&&(ce.stretch=Je),At&&(ce.variant=At)}var St=d.stringify({size:M.baseFontSize,family:ce.family,stretch:b?ce.stretch:void 0,variant:ce.variant,weight:ce.weight,style:ce.style}),Rt=n(ce.size),Ut=Math.round(Rt[0]*s(Rt[1]));if(Ut!==u.fontSize[Re]&&(m=!0,u.fontSize[Re]=Ut),(!u.font[Re]||St!=u.font[Re].baseString)&&(g=!0,u.font[Re]=M.fonts[St],!u.font[Re])){var ir=ce.family.join(", "),ar=[ce.style];ce.style!=ce.variant&&ar.push(ce.variant),ce.variant!=ce.weight&&ar.push(ce.weight),b&&ce.weight!=ce.stretch&&ar.push(ce.stretch),u.font[Re]={baseString:St,family:ir,weight:ce.weight,stretch:ce.stretch,style:ce.style,variant:ce.variant,width:{},kerning:{},metrics:v(ir,{origin:"top",fontSize:M.baseFontSize,fontStyle:ar.join(" ")})},M.fonts[St]=u.font[Re]}}),(g||m)&&this.font.forEach(function(ce,Re){var $e=d.stringify({size:u.fontSize[Re],family:ce.family,stretch:b?ce.stretch:void 0,variant:ce.variant,weight:ce.weight,style:ce.style});if(u.fontAtlas[Re]=u.shader.atlas[$e],!u.fontAtlas[Re]){var rt=ce.metrics;u.shader.atlas[$e]=u.fontAtlas[Re]={fontString:$e,step:Math.ceil(u.fontSize[Re]*rt.bottom*.5)*2,em:u.fontSize[Re],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:u.regl.texture()}}p.text==null&&(p.text=u.text)}),typeof p.text=="string"&&p.position&&p.position.length>2){for(var R=Array(p.position.length*.5),P=0;P2){for(var B=!p.position[0].length,O=o.mallocFloat(this.count*2),L=0,N=0;L1?u.align[Re]:u.align[0]:u.align;if(typeof $e=="number")return $e;switch($e){case"right":case"end":return-ce;case"center":case"centre":case"middle":return-ce*.5}return 0})),this.baseline==null&&p.baseline==null&&(p.baseline=0),p.baseline!=null&&(this.baseline=p.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(ce,Re){var $e=(u.font[Re]||u.font[0]).metrics,rt=0;return rt+=$e.bottom*.5,typeof ce=="number"?rt+=ce-$e.baseline:rt+=-$e[ce],rt*=-1,rt})),p.color!=null)if(p.color||(p.color="transparent"),typeof p.color=="string"||!isNaN(p.color))this.color=t(p.color,"uint8");else{var Fe;if(typeof p.color[0]=="number"&&p.color.length>this.counts.length){var Ce=p.color.length;Fe=o.mallocUint8(Ce);for(var qe=(p.color.subarray||p.color.slice).bind(p.color),et=0;et4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(Xe){var Me=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(Me);for(var xe=0;xe1?this.counts[xe]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[xe]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(xe*4,xe*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[xe]:this.opacity,baseline:this.baselineOffset[xe]!=null?this.baselineOffset[xe]:this.baselineOffset[0],align:this.align?this.alignOffset[xe]!=null?this.alignOffset[xe]:this.alignOffset[0]:0,atlas:this.fontAtlas[xe]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(xe*2,xe*2+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={};function _(w){return typeof w=="function"&&w._gl&&w.prop&&w.texture&&w.buffer}G.exports=M}}),ax=He({"src/lib/prepare_regl.js"(Y,G){var d=I3(),x=xT();G.exports=function(E,e,t){var r=E._fullLayout,o=!0;return r._glcanvas.each(function(a){if(a.regl){a.regl.preloadCachedCode(t);return}if(!(a.pick&&!r._has("parcoords"))){try{a.regl=x({canvas:this,attributes:{antialias:!a.pick,preserveDrawingBuffer:!0},pixelRatio:E._context.plotGlPixelRatio||window.devicePixelRatio,extensions:e||[],cachedCode:t||{}})}catch{o=!1}a.regl||(o=!1),o&&this.addEventListener("webglcontextlost",function(i){E&&E.emit&&E.emit("plotly_webglcontextlost",{event:i,layer:a.key})},!1)}}),o||d({container:r._glcontainer.node()}),o}}}),TT=He({"src/traces/scattergl/plot.js"(c,G){var d=eT(),x=hT(),A=G6(),E=oI(),e=Gr(),t=bv().selectMode,r=ax(),o=Rl(),a=Kb(),i=J3().styleTextSelection,n={};function s(f,v,h,T){var l=f._size,y=f.width*T,b=f.height*T,S=l.l*T,M=l.b*T,_=l.r*T,w=l.t*T,p=l.w*T,u=l.h*T;return[S+v.domain[0]*p,M+h.domain[0]*u,y-_-(1-v.domain[1])*p,b-w-(1-h.domain[1])*u]}var c=G.exports=function(v,h,T){if(T.length){var l=v._fullLayout,y=h._scene,b=h.xaxis,S=h.yaxis,M,_;if(y){var w=r(v,["ANGLE_instanced_arrays","OES_element_index_uint"],n);if(!w){y.init();return}var p=y.count,u=l._glcanvas.data()[0].regl;if(a(v,h,T),y.dirty){if((y.line2d||y.error2d)&&!(y.scatter2d||y.fill2d||y.glText)&&u.clear({}),y.error2d===!0&&(y.error2d=A(u)),y.line2d===!0&&(y.line2d=x(u)),y.scatter2d===!0&&(y.scatter2d=d(u)),y.fill2d===!0&&(y.fill2d=x(u)),y.glText===!0)for(y.glText=new Array(p),M=0;My.glText.length){var g=p-y.glText.length;for(M=0;Mie&&(isNaN(ae[fe])||isNaN(ae[fe+1]));)fe-=2;q.positions=ae.slice(ie,fe+2)}return q}),y.line2d.update(y.lineOptions)),y.error2d){var P=(y.errorXOptions||[]).concat(y.errorYOptions||[]);y.error2d.update(P)}y.scatter2d&&y.scatter2d.update(y.markerOptions),y.fillOrder=e.repeat(null,p),y.fill2d&&(y.fillOptions=y.fillOptions.map(function(q,ae){var ie=T[ae];if(!(!q||!ie||!ie[0]||!ie[0].trace)){var fe=ie[0],we=fe.trace,Ae=fe.t,Fe=y.lineOptions[ae],Ce,qe,et=[];we._ownfill&&et.push(ae),we._nexttrace&&et.push(ae+1),et.length&&(y.fillOrder[ae]=et);var Qe=[],Ke=Fe&&Fe.positions||Ae.positions,Xe,Me;if(we.fill==="tozeroy"){for(Xe=0;XeXe&&isNaN(Ke[Me+1]);)Me-=2;Ke[Xe+1]!==0&&(Qe=[Ke[Xe],0]),Qe=Qe.concat(Ke.slice(Xe,Me+2)),Ke[Me+1]!==0&&(Qe=Qe.concat([Ke[Me],0]))}else if(we.fill==="tozerox"){for(Xe=0;XeXe&&isNaN(Ke[Me]);)Me-=2;Ke[Xe]!==0&&(Qe=[0,Ke[Xe+1]]),Qe=Qe.concat(Ke.slice(Xe,Me+2)),Ke[Me]!==0&&(Qe=Qe.concat([0,Ke[Me+1]]))}else if(we.fill==="toself"||we.fill==="tonext"){for(Qe=[],Ce=0,q.splitNull=!0,qe=0;qe-1;for(M=0;Mb&&h||yi,m;for(g?m=h.sizeAvg||Math.max(h.size,3):m=A(c,v),S=0;S{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,E(()=>{this.dirty=!1})),this)},o.prototype.update=function(...s){if(!s.length)return;for(let v=0;vm||!h.lower&&g{c[T+y]=v})}this.scatter.draw(...c)}return this},o.prototype.destroy=function(){return this.traces.forEach(s=>{s.buffer&&s.buffer.destroy&&s.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function a(s,c,f){let v=s.id!=null?s.id:s,h=c,T=f;return v<<16|(h&255)<<8|T&255}function i(s,c,f){let v,h,T,l,y=s[c],b=s[f];return y.length>2?(y[0],y[2],v=y[1],h=y[3]):y.length?(v=y[0],h=y[1]):(y.x,v=y.y,y.x+y.width,h=y.y+y.height),b.length>2?(T=b[0],l=b[2],b[1],b[3]):b.length?(T=b[0],l=b[1]):(T=b.x,b.y,l=b.x+b.width,b.y+b.height),[T,v,l,h]}function n(s){if(typeof s=="number")return[s,s,s,s];if(s.length===2)return[s[0],s[1],s[0],s[1]];{let c=t(s);return[c.x,c.y,c.x+c.width,c.y+c.height]}}}}),gI=He({"src/traces/splom/plot.js"(Y,G){var d=pI(),x=Gr(),A=oc(),E=bv().selectMode;G.exports=function(r,o,a){if(a.length)for(var i=0;i-1,B=E(h)||!!i.selectedpoints||F,O=!0;if(B){var L=i._length;if(i.selectedpoints){s.selectBatch=i.selectedpoints;var N=i.selectedpoints,U={};for(y=0;y=Z[Q][0]&&U<=Z[Q][1])return!0;return!1}function c(U){U.attr("x",-d.bar.captureWidth/2).attr("width",d.bar.captureWidth)}function f(U){U.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function v(U){if(!U.brush.filterSpecified)return"0,"+U.height;for(var Z=h(U.brush.filter.getConsolidated(),U.height),Q=[0],ue,oe,le,j=Z.length?Z[0][0]:null,J=0;JU[1]+Q||Z=.9*U[1]+.1*U[0]?"n":Z<=.9*U[0]+.1*U[1]?"s":"ns"}function l(){x.select(document.body).style("cursor",null)}function y(U){U.attr("stroke-dasharray",v)}function b(U,Z){var Q=x.select(U).selectAll(".highlight, .highlight-shadow"),ue=Z?Q.transition().duration(d.bar.snapDuration).each("end",Z):Q;y(ue)}function S(U,Z){var Q=U.brush,ue=Q.filterSpecified,oe=NaN,le={},j;if(ue){var J=U.height,$=Q.filter.getConsolidated(),X=h($,J),re=NaN,ee=NaN,q=NaN;for(j=0;j<=X.length;j++){var ae=X[j];if(ae&&ae[0]<=Z&&Z<=ae[1]){re=j;break}else if(ee=j?j-1:NaN,ae&&ae[0]>Z){q=j;break}}if(oe=re,isNaN(oe)&&(isNaN(ee)||isNaN(q)?oe=isNaN(ee)?q:ee:oe=Z-X[ee][1]=Fe[0]&&Ae<=Fe[1]){le.clickableOrdinalRange=Fe;break}}}return le}function M(U,Z){x.event.sourceEvent.stopPropagation();var Q=Z.height-x.mouse(U)[1]-2*d.verticalPadding,ue=Z.unitToPaddedPx.invert(Q),oe=Z.brush,le=S(Z,Q),j=le.interval,J=oe.svgBrush;if(J.wasDragged=!1,J.grabbingBar=le.region==="ns",J.grabbingBar){var $=j.map(Z.unitToPaddedPx);J.grabPoint=Q-$[0]-d.verticalPadding,J.barLength=$[1]-$[0]}J.clickableOrdinalRange=le.clickableOrdinalRange,J.stayingIntervals=Z.multiselect&&oe.filterSpecified?oe.filter.getConsolidated():[],j&&(J.stayingIntervals=J.stayingIntervals.filter(function(X){return X[0]!==j[0]&&X[1]!==j[1]})),J.startExtent=le.region?j[le.region==="s"?1:0]:ue,Z.parent.inBrushDrag=!0,J.brushStartCallback()}function _(U,Z){x.event.sourceEvent.stopPropagation();var Q=Z.height-x.mouse(U)[1]-2*d.verticalPadding,ue=Z.brush.svgBrush;ue.wasDragged=!0,ue._dragging=!0,ue.grabbingBar?ue.newExtent=[Q-ue.grabPoint,Q+ue.barLength-ue.grabPoint].map(Z.unitToPaddedPx.invert):ue.newExtent=[ue.startExtent,Z.unitToPaddedPx.invert(Q)].sort(e),Z.brush.filterSpecified=!0,ue.extent=ue.stayingIntervals.concat([ue.newExtent]),ue.brushCallback(Z),b(U.parentNode)}function w(U,Z){var Q=Z.brush,ue=Q.filter,oe=Q.svgBrush;oe._dragging||(p(U,Z),_(U,Z),Z.brush.svgBrush.wasDragged=!1),oe._dragging=!1;var le=x.event;le.sourceEvent.stopPropagation();var j=oe.grabbingBar;if(oe.grabbingBar=!1,oe.grabLocation=void 0,Z.parent.inBrushDrag=!1,l(),!oe.wasDragged){oe.wasDragged=void 0,oe.clickableOrdinalRange?Q.filterSpecified&&Z.multiselect?oe.extent.push(oe.clickableOrdinalRange):(oe.extent=[oe.clickableOrdinalRange],Q.filterSpecified=!0):j?(oe.extent=oe.stayingIntervals,oe.extent.length===0&&z(Q)):z(Q),oe.brushCallback(Z),b(U.parentNode),oe.brushEndCallback(Q.filterSpecified?ue.getConsolidated():[]);return}var J=function(){ue.set(ue.getConsolidated())};if(Z.ordinal){var $=Z.unitTickvals;$[$.length-1]<$[0]&&$.reverse(),oe.newExtent=[n(0,$,oe.newExtent[0],oe.stayingIntervals),n(1,$,oe.newExtent[1],oe.stayingIntervals)];var X=oe.newExtent[1]>oe.newExtent[0];oe.extent=oe.stayingIntervals.concat(X?[oe.newExtent]:[]),oe.extent.length||z(Q),oe.brushCallback(Z),X?b(U.parentNode,J):(J(),b(U.parentNode))}else J();oe.brushEndCallback(Q.filterSpecified?ue.getConsolidated():[])}function p(U,Z){var Q=Z.height-x.mouse(U)[1]-2*d.verticalPadding,ue=S(Z,Q),oe="crosshair";ue.clickableOrdinalRange?oe="pointer":ue.region&&(oe=ue.region+"-resize"),x.select(document.body).style("cursor",oe)}function u(U){U.on("mousemove",function(Z){x.event.preventDefault(),Z.parent.inBrushDrag||p(this,Z)}).on("mouseleave",function(Z){Z.parent.inBrushDrag||l()}).call(x.behavior.drag().on("dragstart",function(Z){M(this,Z)}).on("drag",function(Z){_(this,Z)}).on("dragend",function(Z){w(this,Z)}))}function g(U,Z){return U[0]-Z[0]}function m(U,Z,Q){var ue=Q._context.staticPlot,oe=U.selectAll(".background").data(E);oe.enter().append("rect").classed("background",!0).call(c).call(f).style("pointer-events",ue?"none":"auto").attr("transform",t(0,d.verticalPadding)),oe.call(u).attr("height",function(J){return J.height-d.verticalPadding});var le=U.selectAll(".highlight-shadow").data(E);le.enter().append("line").classed("highlight-shadow",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width+d.bar.strokeWidth).attr("stroke",Z).attr("opacity",d.bar.strokeOpacity).attr("stroke-linecap","butt"),le.attr("y1",function(J){return J.height}).call(y);var j=U.selectAll(".highlight").data(E);j.enter().append("line").classed("highlight",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width-d.bar.strokeWidth).attr("stroke",d.bar.fillColor).attr("opacity",d.bar.fillOpacity).attr("stroke-linecap","butt"),j.attr("y1",function(J){return J.height}).call(y)}function R(U,Z,Q){var ue=U.selectAll("."+d.cn.axisBrush).data(E,A);ue.enter().append("g").classed(d.cn.axisBrush,!0),m(ue,Z,Q)}function P(U){return U.svgBrush.extent.map(function(Z){return Z.slice()})}function z(U){U.filterSpecified=!1,U.svgBrush.extent=[[-1/0,1/0]]}function F(U){return function(Q){var ue=Q.brush,oe=P(ue),le=oe.slice();ue.filter.set(le),U()}}function B(U){for(var Z=U.slice(),Q=[],ue,oe=Z.shift();oe;){for(ue=oe.slice();(oe=Z.shift())&&oe[0]<=ue[1];)ue[1]=Math.max(ue[1],oe[1]);Q.push(ue)}return Q.length===1&&Q[0][0]>Q[0][1]&&(Q=[]),Q}function O(){var U=[],Z,Q;return{set:function(ue){U=ue.map(function(oe){return oe.slice().sort(e)}).sort(g),U.length===1&&U[0][0]===-1/0&&U[0][1]===1/0&&(U=[[0,-1]]),Z=B(U),Q=U.reduce(function(oe,le){return[Math.min(oe[0],le[0]),Math.max(oe[1],le[1])]},[1/0,-1/0])},get:function(){return U.slice()},getConsolidated:function(){return Z},getBounds:function(){return Q}}}function L(U,Z,Q,ue,oe,le){var j=O();return j.set(Q),{filter:j,filterSpecified:Z,svgBrush:{extent:[],brushStartCallback:ue,brushCallback:F(oe),brushEndCallback:le}}}function N(U,Z){if(Array.isArray(U[0])?(U=U.map(function(ue){return ue.sort(e)}),Z.multiselect?U=B(U.sort(g)):U=[U[0]]):U=[U.sort(e)],Z.tickvals){var Q=Z.tickvals.slice().sort(e);if(U=U.map(function(ue){var oe=[n(0,Q,ue[0],[]),n(1,Q,ue[1],[])];if(oe[1]>oe[0])return oe}).filter(function(ue){return ue}),!U.length)return}return U.length>1?U:U[0]}G.exports={makeBrush:L,ensureAxisBrush:R,cleanRanges:N}}}),AI=He({"src/traces/parcoords/defaults.js"(Y,G){var d=Gr(),x=Ah().hasColorscale,A=pf(),E=mu().defaults,e=rh(),t=io(),r=MT(),o=ET(),a=Zy().maxDimensionCount,i=nx();function n(c,f,v,h,T){var l=T("line.color",v);if(x(c,"line")&&d.isArrayOrTypedArray(l)){if(l.length)return T("line.colorscale"),A(c,f,h,T,{prefix:"line.",cLetter:"c"}),l.length;f.line.color=v}return 1/0}function s(c,f,v,h){function T(M,_){return d.coerce(c,f,r.dimensions,M,_)}var l=T("values"),y=T("visible");if(l&&l.length||(y=f.visible=!1),y){T("label"),T("tickvals"),T("ticktext"),T("tickformat");var b=T("range");f._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:b},t.setConvert(f._ax,h.layout),T("multiselect");var S=T("constraintrange");S&&(f.constraintrange=o.cleanRanges(S,f))}}G.exports=function(f,v,h,T){function l(_,w){return d.coerce(f,v,r,_,w)}var y=f.dimensions;Array.isArray(y)&&y.length>a&&(d.log("parcoords traces support up to "+a+" dimensions at the moment"),y.splice(a));var b=e(f,v,{name:"dimensions",layout:T,handleItemDefaults:s}),S=n(f,v,h,T,l);E(v,T,l),(!Array.isArray(b)||!b.length)&&(v.visible=!1),i(v,b,"values",S);var M=d.extendFlat({},T.font,{size:Math.round(T.font.size/1.2)});d.coerceFont(l,"labelfont",M),d.coerceFont(l,"tickfont",M,{autoShadowDflt:!0}),d.coerceFont(l,"rangefont",M),l("labelangle"),l("labelside"),l("unselected.line.color"),l("unselected.line.opacity")}}}),SI=He({"src/traces/parcoords/calc.js"(Y,G){var d=Gr().isArrayOrTypedArray,x=Kl(),A=Wv().wrap;G.exports=function(t,r){var o,a;return x.hasColorscale(r,"line")&&d(r.line.color)?(o=r.line.color,a=x.extractOpts(r.line).colorscale,x.calc(t,r,{vals:o,containerStr:"line",cLetter:"c"})):(o=E(r._length),a=[[0,r.line.color],[1,r.line.color]]),A({lineColor:o,cscale:a})};function E(e){for(var t=new Array(e),r=0;r>>16,(Y&65280)>>>8,Y&255],alpha:1};if(typeof Y=="number")return{space:"rgb",values:[Y>>>16,(Y&65280)>>>8,Y&255],alpha:1};if(Y=String(Y).toLowerCase(),ix.default[Y])A=ix.default[Y].slice(),e="rgb";else if(Y==="transparent")E=0,e="rgb",A=[0,0,0];else if(Y[0]==="#"){var t=Y.slice(1),r=t.length,o=r<=4;E=1,o?(A=[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16)],r===4&&(E=parseInt(t[3]+t[3],16)/255)):(A=[parseInt(t[0]+t[1],16),parseInt(t[2]+t[3],16),parseInt(t[4]+t[5],16)],r===8&&(E=parseInt(t[6]+t[7],16)/255)),A[0]||(A[0]=0),A[1]||(A[1]=0),A[2]||(A[2]=0),e="rgb"}else if(x=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(Y)){var a=x[1];e=a.replace(/a$/,"");var i=e==="cmyk"?4:e==="gray"?1:3;A=x[2].trim().split(/\s*[,\/]\s*|\s+/),e==="color"&&(e=A.shift()),A=A.map(function(n,s){if(n[n.length-1]==="%")return n=parseFloat(n)/100,s===3?n:e==="rgb"?n*255:e[0]==="h"||e[0]==="l"&&!s?n*100:e==="lab"?n*125:e==="lch"?s<2?n*150:n*360:e[0]==="o"&&!s?n:e==="oklab"?n*.4:e==="oklch"?s<2?n*.4:n*360:n;if(e[s]==="h"||s===2&&e[e.length-1]==="h"){if(ox[n]!==void 0)return ox[n];if(n.endsWith("deg"))return parseFloat(n);if(n.endsWith("turn"))return parseFloat(n)*360;if(n.endsWith("grad"))return parseFloat(n)*360/400;if(n.endsWith("rad"))return parseFloat(n)*180/Math.PI}return n==="none"?0:parseFloat(n)}),E=A.length>i?A.pop():1}else/[0-9](?:\s|\/|,)/.test(Y)&&(A=Y.match(/([0-9]+)/g).map(function(n){return parseFloat(n)}),e=((d=(G=Y.match(/([a-z])/ig))==null?void 0:G.join(""))==null?void 0:d.toLowerCase())||"rgb");return{space:e,values:A,alpha:E}}var ix,kT,ox,EI=ks({"node_modules/color-parse/index.js"(){ix=Zm(C3()),kT=MI,ox={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Xy,CT=ks({"node_modules/color-space/rgb.js"(){Xy={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),Yy,kI=ks({"node_modules/color-space/hsl.js"(){CT(),Yy={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(Y){var G=Y[0]/360,d=Y[1]/100,x=Y[2]/100,A,E,e,t,r,o=0;if(d===0)return r=x*255,[r,r,r];for(E=x<.5?x*(1+d):x+d-x*d,A=2*x-E,t=[0,0,0];o<3;)e=G+1/3*-(o-1),e<0?e++:e>1&&e--,r=6*e<1?A+(E-A)*6*e:2*e<1?E:3*e<2?A+(E-A)*(2/3-e)*6:A,t[o++]=r*255;return t}},Xy.hsl=function(Y){var G=Y[0]/255,d=Y[1]/255,x=Y[2]/255,A=Math.min(G,d,x),E=Math.max(G,d,x),e=E-A,t,r,o;return E===A?t=0:G===E?t=(d-x)/e:d===E?t=2+(x-G)/e:x===E&&(t=4+(G-d)/e),t=Math.min(t*60,360),t<0&&(t+=360),o=(A+E)/2,E===A?r=0:o<=.5?r=e/(E+A):r=e/(2-E-A),[t,r*100,o*100]}}}),LT={};L0(LT,{default:()=>CI});function CI(Y){Array.isArray(Y)&&Y.raw&&(Y=String.raw(...arguments)),Y instanceof Number&&(Y=+Y);var G,d=kT(Y);if(!d.space)return[];const x=d.space[0]==="h"?Yy.min:Xy.min,A=d.space[0]==="h"?Yy.max:Xy.max;return G=Array(3),G[0]=Math.min(Math.max(d.values[0],x[0]),A[0]),G[1]=Math.min(Math.max(d.values[1],x[1]),A[1]),G[2]=Math.min(Math.max(d.values[2],x[2]),A[2]),d.space[0]==="h"&&(G=Yy.rgb(G)),G.push(Math.min(Math.max(d.alpha,0),1)),G}var LI=ks({"node_modules/color-rgba/index.js"(){EI(),CT(),kI()}}),PT=He({"src/traces/parcoords/helpers.js"(Y){var G=Gr().isTypedArray;Y.convertTypedArray=function(d){return G(d)?Array.prototype.slice.call(d):d},Y.isOrdinal=function(d){return!!d.tickvals},Y.isVisible=function(d){return d.visible||!("visible"in d)}}}),PI=He({"src/traces/parcoords/lines.js"(Y,G){var d=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` +`),x=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` +`),A=Zy().maxDimensionCount,E=Gr(),e=1e-6,t=2048,r=new Uint8Array(4),o=new Uint8Array(4),a={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function i(w){w.read({x:0,y:0,width:1,height:1,data:r})}function n(w,p,u,g,m){var R=w._gl;R.enable(R.SCISSOR_TEST),R.scissor(p,u,g,m),w.clear({color:[0,0,0,0],depth:1})}function s(w,p,u,g,m,R){var P=R.key;function z(F){var B=Math.min(g,m-F*g);F===0&&(window.cancelAnimationFrame(u.currentRafs[P]),delete u.currentRafs[P],n(w,R.scissorX,R.scissorY,R.scissorWidth,R.viewBoxSize[1])),!u.clearOnly&&(R.count=2*B,R.offset=2*F*g,p(R),F*g+B>>8*p)%256/255}function h(w,p,u){for(var g=new Array(w*(A+4)),m=0,R=0;RCe&&(Ce=ee[fe].dim1.canvasX,Ae=fe);ie===0&&n(m,0,0,B.canvasWidth,B.canvasHeight);var qe=j(u);for(fe=0;fefe._length&&(Xe=Xe.slice(0,fe._length));var Me=fe.tickvals,xe;function ce(At,St){return{val:At,text:xe[St]}}function Re(At,St){return At.val-St.val}if(A(Me)&&Me.length){x.isTypedArray(Me)&&(Me=Array.from(Me)),xe=fe.ticktext,!A(xe)||!xe.length?xe=Me.map(E(fe.tickformat)):xe.length>Me.length?xe=xe.slice(0,Me.length):Me.length>xe.length&&(Me=Me.slice(0,xe.length));for(var $e=1;$e=St||ar>=Rt)return;var Mr=Je.lineLayer.readPixel(ir,Rt-1-ar),fr=Mr[3]!==0,dr=fr?Mr[2]+256*(Mr[1]+256*Mr[0]):null,pt={x:ir,y:ar,clientX:At.clientX,clientY:At.clientY,dataIndex:Je.model.key,curveNumber:dr};dr!==Ae&&(fr?J.hover(pt):J.unhover&&J.unhover(pt),Ae=dr)}}),we.style("opacity",function(Je){return Je.pick?0:1}),re.style("background","rgba(255, 255, 255, 0)");var Ce=re.selectAll("."+T.cn.parcoords).data(fe,c);Ce.exit().remove(),Ce.enter().append("g").classed(T.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),Ce.attr("transform",function(Je){return o(Je.model.translateX,Je.model.translateY)});var qe=Ce.selectAll("."+T.cn.parcoordsControlView).data(f,c);qe.enter().append("g").classed(T.cn.parcoordsControlView,!0),qe.attr("transform",function(Je){return o(Je.model.pad.l,Je.model.pad.t)});var et=qe.selectAll("."+T.cn.yAxis).data(function(Je){return Je.dimensions},c);et.enter().append("g").classed(T.cn.yAxis,!0),qe.each(function(Je){N(et,Je,q)}),we.each(function(Je){if(Je.viewModel){!Je.lineLayer||J?Je.lineLayer=y(this,Je):Je.lineLayer.update(Je),(Je.key||Je.key===0)&&(Je.viewModel[Je.key]=Je.lineLayer);var At=!Je.context||J;Je.lineLayer.render(Je.viewModel.panels,At)}}),et.attr("transform",function(Je){return o(Je.xScale(Je.xIndex),0)}),et.call(d.behavior.drag().origin(function(Je){return Je}).on("drag",function(Je){var At=Je.parent;ie.linePickActive(!1),Je.x=Math.max(-T.overdrag,Math.min(Je.model.width+T.overdrag,d.event.x)),Je.canvasX=Je.x*Je.model.canvasPixelRatio,et.sort(function(St,Rt){return St.x-Rt.x}).each(function(St,Rt){St.xIndex=Rt,St.x=Je===St?St.x:St.xScale(St.xIndex),St.canvasX=St.x*St.model.canvasPixelRatio}),N(et,At,q),et.filter(function(St){return Math.abs(Je.xIndex-St.xIndex)!==0}).attr("transform",function(St){return o(St.xScale(St.xIndex),0)}),d.select(this).attr("transform",o(Je.x,0)),et.each(function(St,Rt,Ut){Ut===Je.parent.key&&(At.dimensions[Rt]=St)}),At.contextLayer&&At.contextLayer.render(At.panels,!1,!P(At)),At.focusLayer.render&&At.focusLayer.render(At.panels)}).on("dragend",function(Je){var At=Je.parent;Je.x=Je.xScale(Je.xIndex),Je.canvasX=Je.x*Je.model.canvasPixelRatio,N(et,At,q),d.select(this).attr("transform",function(St){return o(St.x,0)}),At.contextLayer&&At.contextLayer.render(At.panels,!1,!P(At)),At.focusLayer&&At.focusLayer.render(At.panels),At.pickLayer&&At.pickLayer.render(At.panels,!0),ie.linePickActive(!0),J&&J.axesMoved&&J.axesMoved(At.key,At.dimensions.map(function(St){return St.crossfilterDimensionIndex}))})),et.exit().remove();var Qe=et.selectAll("."+T.cn.axisOverlays).data(f,c);Qe.enter().append("g").classed(T.cn.axisOverlays,!0),Qe.selectAll("."+T.cn.axis).remove();var Ke=Qe.selectAll("."+T.cn.axis).data(f,c);Ke.enter().append("g").classed(T.cn.axis,!0),Ke.each(function(Je){var At=Je.model.height/Je.model.tickDistance,St=Je.domainScale,Rt=St.domain();d.select(this).call(d.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(At,Je.tickFormat).tickValues(Je.ordinal?Rt:null).tickFormat(function(Ut){return h.isOrdinal(Je)?Ut:Z(Je.model.dimensions[Je.visibleIndex],Ut)}).scale(St)),i.font(Ke.selectAll("text"),Je.model.tickFont)}),Ke.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),Ke.selectAll("text").style("cursor","default");var Xe=Qe.selectAll("."+T.cn.axisHeading).data(f,c);Xe.enter().append("g").classed(T.cn.axisHeading,!0);var Me=Xe.selectAll("."+T.cn.axisTitle).data(f,c);Me.enter().append("text").classed(T.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",$?"none":"auto"),Me.text(function(Je){return Je.label}).each(function(Je){var At=d.select(this);i.font(At,Je.model.labelFont),a.convertToTspans(At,oe)}).attr("transform",function(Je){var At=L(Je.model.labelAngle,Je.model.labelSide),St=T.axisTitleOffset;return(At.dir>0?"":o(0,2*St+Je.model.height))+r(At.degrees)+o(-St*At.dx,-St*At.dy)}).attr("text-anchor",function(Je){var At=L(Je.model.labelAngle,Je.model.labelSide),St=Math.abs(At.dx),Rt=Math.abs(At.dy);return 2*St>Rt?At.dir*At.dx<0?"start":"end":"middle"});var xe=Qe.selectAll("."+T.cn.axisExtent).data(f,c);xe.enter().append("g").classed(T.cn.axisExtent,!0);var ce=xe.selectAll("."+T.cn.axisExtentTop).data(f,c);ce.enter().append("g").classed(T.cn.axisExtentTop,!0),ce.attr("transform",o(0,-T.axisExtentOffset));var Re=ce.selectAll("."+T.cn.axisExtentTopText).data(f,c);Re.enter().append("text").classed(T.cn.axisExtentTopText,!0).call(B),Re.text(function(Je){return Q(Je,!0)}).each(function(Je){i.font(d.select(this),Je.model.rangeFont)});var $e=xe.selectAll("."+T.cn.axisExtentBottom).data(f,c);$e.enter().append("g").classed(T.cn.axisExtentBottom,!0),$e.attr("transform",function(Je){return o(0,Je.model.height+T.axisExtentOffset)});var rt=$e.selectAll("."+T.cn.axisExtentBottomText).data(f,c);rt.enter().append("text").classed(T.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(B),rt.text(function(Je){return Q(Je,!1)}).each(function(Je){i.font(d.select(this),Je.model.rangeFont)}),l.ensureAxisBrush(Qe,ae,oe)}}}),IT=He({"src/traces/parcoords/plot.js"(r,G){var d=II(),x=ax(),A=PT().isVisible,E={};function e(o,a,i){var n=a.indexOf(i),s=o.indexOf(n);return s===-1&&(s+=a.length),s}function t(o,a){return function(n,s){return e(o,a,n)-e(o,a,s)}}var r=G.exports=function(a,i){var n=a._fullLayout,s=x(a,[],E);if(s){var c={},f={},v={},h={},T=n._size;i.forEach(function(M,_){var w=M[0].trace;v[_]=w.index;var p=h[_]=w.index;c[_]=a.data[p].dimensions,f[_]=a.data[p].dimensions.slice()});var l=function(M,_,w){var p=f[M][_],u=w.map(function(F){return F.slice()}),g="dimensions["+_+"].constraintrange",m=n._tracePreGUI[a._fullData[v[M]]._fullInput.uid];if(m[g]===void 0){var R=p.constraintrange;m[g]=R||null}var P=a._fullData[v[M]].dimensions[_];u.length?(u.length===1&&(u=u[0]),p.constraintrange=u,P.constraintrange=u.slice(),u=[u]):(delete p.constraintrange,delete P.constraintrange,u=null);var z={};z[g]=u,a.emit("plotly_restyle",[z,[h[M]]])},y=function(M){a.emit("plotly_hover",M)},b=function(M){a.emit("plotly_unhover",M)},S=function(M,_){var w=t(_,f[M].filter(A));c[M].sort(w),f[M].filter(function(p){return!A(p)}).sort(function(p){return f[M].indexOf(p)}).forEach(function(p){c[M].splice(c[M].indexOf(p),1),c[M].splice(f[M].indexOf(p),0,p)}),a.emit("plotly_restyle",[{dimensions:[c[M]]},[h[M]]])};d(a,i,{width:T.w,height:T.h,margin:{t:T.t,r:T.r,b:T.b,l:T.l}},{filterChanged:l,hover:y,unhover:b,axesMoved:S})}};r.reglPrecompiled=E}}),RI=He({"src/traces/parcoords/base_plot.js"(Y){var G=Qn(),d=Uf().getModuleCalcData,x=IT(),A=Yh();Y.name="parcoords",Y.plot=function(E){var e=d(E.calcdata,"parcoords")[0];e.length&&x(E,e)},Y.clean=function(E,e,t,r){var o=r._has&&r._has("parcoords"),a=e._has&&e._has("parcoords");o&&!a&&(r._paperdiv.selectAll(".parcoords").remove(),r._glimages.selectAll("*").remove())},Y.toSVG=function(E){var e=E._fullLayout._glimages,t=G.select(E).selectAll(".svg-container"),r=t.filter(function(a,i){return i===t.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function o(){var a=this,i=a.toDataURL("image/png"),n=e.append("svg:image");n.attr({xmlns:A.svg,"xlink:href":i,preserveAspectRatio:"none",x:0,y:0,width:a.style.width,height:a.style.height})}r.each(o),window.setTimeout(function(){G.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),DI=He({"src/traces/parcoords/base_index.js"(Y,G){G.exports={attributes:MT(),supplyDefaults:AI(),calc:SI(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:RI(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),zI=He({"src/traces/parcoords/index.js"(Y,G){var d=DI();d.plot=IT(),G.exports=d}}),FI=He({"lib/parcoords.js"(Y,G){G.exports=zI()}}),RT=He({"src/traces/parcats/attributes.js"(Y,G){var d=ho().extendFlat,x=cl(),A=Yl(),E=kl(),e=Yo().hovertemplateAttrs,t=mu().attributes,r=d({editType:"calc"},E("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability"]})});G.exports={domain:t({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:d({},x.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:A({editType:"calc"}),tickfont:A({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:r,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),OI=He({"src/traces/parcats/defaults.js"(Y,G){var d=Gr(),x=Ah().hasColorscale,A=pf(),E=mu().defaults,e=rh(),t=RT(),r=nx(),o=ch().isTypedArraySpec;function a(n,s,c,f,v){v("line.shape"),v("line.hovertemplate");var h=v("line.color",f.colorway[0]);if(x(n,"line")&&d.isArrayOrTypedArray(h)){if(h.length)return v("line.colorscale"),A(n,s,f,v,{prefix:"line.",cLetter:"c"}),h.length;s.line.color=c}return 1/0}function i(n,s){function c(b,S){return d.coerce(n,s,t.dimensions,b,S)}var f=c("values"),v=c("visible");if(f&&f.length||(v=s.visible=!1),v){c("label"),c("displayindex",s._index);var h=n.categoryarray,T=d.isArrayOrTypedArray(h)&&h.length>0||o(h),l;T&&(l="array");var y=c("categoryorder",l);y==="array"?(c("categoryarray"),c("ticktext")):(delete n.categoryarray,delete n.ticktext),!T&&y==="array"&&(s.categoryorder="trace")}}G.exports=function(s,c,f,v){function h(b,S){return d.coerce(s,c,t,b,S)}var T=e(s,c,{name:"dimensions",handleItemDefaults:i}),l=a(s,c,f,v,h);E(c,v,h),(!Array.isArray(T)||!T.length)&&(c.visible=!1),r(c,T,"values",l),h("hoveron"),h("hovertemplate"),h("arrangement"),h("bundlecolors"),h("sortpaths"),h("counts");var y=v.font;d.coerceFont(h,"labelfont",y,{overrideDflt:{size:Math.round(y.size)}}),d.coerceFont(h,"tickfont",y,{autoShadowDflt:!0,overrideDflt:{size:Math.round(y.size/1.2)}})}}}),BI=He({"src/traces/parcats/calc.js"(Y,G){var d=Wv().wrap,x=Ah().hasColorscale,A=Sh(),E=gb(),e=vo(),t=Gr(),r=Hi();G.exports=function(y,b){var S=t.filterVisible(b.dimensions);if(S.length===0)return[];var M=S.map(function(j){var J;if(j.categoryorder==="trace")J=null;else if(j.categoryorder==="array")J=j.categoryarray;else{J=E(j.values);for(var $=!0,X=0;X=l.length||y[l[b]]!==void 0)return!1;y[l[b]]=!0}return!0}}}),NI=He({"src/traces/parcats/parcats.js"(Y,G){var d=Qn(),x=(Gp(),Go(tp)).interpolateNumber,A=f1(),E=Wu(),e=Gr(),t=e.strTranslate,r=vo(),o=Mf(),a=yl();function i(X,re,ee,q){var ae=re._context.staticPlot,ie=X.map(oe.bind(0,re,ee)),fe=q.selectAll("g.parcatslayer").data([null]);fe.enter().append("g").attr("class","parcatslayer").style("pointer-events",ae?"none":"all");var we=fe.selectAll("g.trace.parcats").data(ie,n),Ae=we.enter().append("g").attr("class","trace parcats");we.attr("transform",function(ce){return t(ce.x,ce.y)}),Ae.append("g").attr("class","paths");var Fe=we.select("g.paths"),Ce=Fe.selectAll("path.path").data(function(ce){return ce.paths},n);Ce.attr("fill",function(ce){return ce.model.color});var qe=Ce.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(ce){return ce.model.color}).attr("fill-opacity",0);y(qe),Ce.attr("d",function(ce){return ce.svgD}),qe.empty()||Ce.sort(c),Ce.exit().remove(),Ce.on("mouseover",f).on("mouseout",v).on("click",l),Ae.append("g").attr("class","dimensions");var et=we.select("g.dimensions"),Qe=et.selectAll("g.dimension").data(function(ce){return ce.dimensions},n);Qe.enter().append("g").attr("class","dimension"),Qe.attr("transform",function(ce){return t(ce.x,0)}),Qe.exit().remove();var Ke=Qe.selectAll("g.category").data(function(ce){return ce.categories},n),Xe=Ke.enter().append("g").attr("class","category");Ke.attr("transform",function(ce){return t(0,ce.y)}),Xe.append("rect").attr("class","catrect").attr("pointer-events","none"),Ke.select("rect.catrect").attr("fill","none").attr("width",function(ce){return ce.width}).attr("height",function(ce){return ce.height}),M(Xe);var Me=Ke.selectAll("rect.bandrect").data(function(ce){return ce.bands},n);Me.each(function(){e.raiseToTop(this)}),Me.attr("fill",function(ce){return ce.color});var xe=Me.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(ce){return ce.color}).attr("fill-opacity",0);Me.attr("fill",function(ce){return ce.color}).attr("width",function(ce){return ce.width}).attr("height",function(ce){return ce.height}).attr("y",function(ce){return ce.y}).attr("cursor",function(ce){return ce.parcatsViewModel.arrangement==="fixed"?"default":ce.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),w(xe),Me.exit().remove(),Xe.append("text").attr("class","catlabel").attr("pointer-events","none"),Ke.select("text.catlabel").attr("text-anchor",function(ce){return s(ce)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(ce){return s(ce)?ce.width+5:-5}).attr("y",function(ce){return ce.height/2}).text(function(ce){return ce.model.categoryLabel}).each(function(ce){r.font(d.select(this),ce.parcatsViewModel.categorylabelfont),a.convertToTspans(d.select(this),re)}),Xe.append("text").attr("class","dimlabel"),Ke.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(ce){return ce.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(ce){return ce.width/2}).attr("y",-5).text(function(ce,Re){return Re===0?ce.parcatsViewModel.model.dimensions[ce.model.dimensionInd].dimensionLabel:null}).each(function(ce){r.font(d.select(this),ce.parcatsViewModel.labelfont)}),Ke.selectAll("rect.bandrect").on("mouseover",B).on("mouseout",O),Ke.exit().remove(),Qe.call(d.behavior.drag().origin(function(ce){return{x:ce.x,y:0}}).on("dragstart",L).on("drag",N).on("dragend",U)),we.each(function(ce){ce.traceSelection=d.select(this),ce.pathSelection=d.select(this).selectAll("g.paths").selectAll("path.path"),ce.dimensionSelection=d.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),we.exit().remove()}G.exports=function(X,re,ee,q){i(ee,X,q,re)};function n(X){return X.key}function s(X){var re=X.parcatsViewModel.dimensions.length,ee=X.parcatsViewModel.dimensions[re-1].model.dimensionInd;return X.model.dimensionInd===ee}function c(X,re){return X.model.rawColor>re.model.rawColor?1:X.model.rawColor"),Je=d.mouse(ae)[0];E.loneHover({trace:ie,x:Ke-we.left+Ae.left,y:Xe-we.top+Ae.top,text:rt,color:X.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Me,idealAlign:Je1&&Fe.displayInd===Ae.dimensions.length-1?(et=fe.left,Qe="left"):(et=fe.left+fe.width,Qe="right");var Ke=we.model.count,Xe=we.model.categoryLabel,Me=Ke/we.parcatsViewModel.model.count,xe={countLabel:Ke,categoryLabel:Xe,probabilityLabel:Me.toFixed(3)},ce=[];we.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&ce.push(["Count:",xe.countLabel].join(" ")),we.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&ce.push(["P("+xe.categoryLabel+"):",xe.probabilityLabel].join(" "));var Re=ce.join("
");return{trace:Ce,x:q*(et-re.left),y:ae*(qe-re.top),text:Re,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:Qe,hovertemplate:Ce.hovertemplate,hovertemplateLabels:xe,eventData:[{data:Ce._input,fullData:Ce,count:Ke,category:Xe,probability:Me}]}}function z(X,re,ee){var q=[];return d.select(ee.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var ae=this;q.push(P(X,re,ae))}),q}function F(X,re,ee){X._fullLayout._calcInverseTransform(X);var q=X._fullLayout._invScaleX,ae=X._fullLayout._invScaleY,ie=ee.getBoundingClientRect(),fe=d.select(ee).datum(),we=fe.categoryViewModel,Ae=we.parcatsViewModel,Fe=Ae.model.dimensions[we.model.dimensionInd],Ce=Ae.trace,qe=ie.y+ie.height/2,et,Qe;Ae.dimensions.length>1&&Fe.displayInd===Ae.dimensions.length-1?(et=ie.left,Qe="left"):(et=ie.left+ie.width,Qe="right");var Ke=we.model.categoryLabel,Xe=fe.parcatsViewModel.model.count,Me=0;fe.categoryViewModel.bands.forEach(function(Ut){Ut.color===fe.color&&(Me+=Ut.count)});var xe=we.model.count,ce=0;Ae.pathSelection.each(function(Ut){Ut.model.color===fe.color&&(ce+=Ut.model.count)});var Re=Me/Xe,$e=Me/ce,rt=Me/xe,Je={countLabel:Me,categoryLabel:Ke,probabilityLabel:Re.toFixed(3)},At=[];we.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&At.push(["Count:",Je.countLabel].join(" ")),we.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(At.push("P(color ∩ "+Ke+"): "+Je.probabilityLabel),At.push("P("+Ke+" | color): "+$e.toFixed(3)),At.push("P(color | "+Ke+"): "+rt.toFixed(3)));var St=At.join("
"),Rt=o.mostReadable(fe.color,["black","white"]);return{trace:Ce,x:q*(et-re.left),y:ae*(qe-re.top),text:St,color:fe.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:Rt,fontSize:10,idealAlign:Qe,hovertemplate:Ce.hovertemplate,hovertemplateLabels:Je,eventData:[{data:Ce._input,fullData:Ce,category:Ke,count:Xe,probability:Re,categorycount:xe,colorcount:ce,bandcolorcount:Me}]}}function B(X){if(!X.parcatsViewModel.dragDimension&&X.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var re=d.mouse(this)[1];if(re<-1)return;var ee=X.parcatsViewModel.graphDiv,q=ee._fullLayout,ae=q._paperdiv.node().getBoundingClientRect(),ie=X.parcatsViewModel.hoveron,fe=this;if(ie==="color"?(g(fe),R(fe,"plotly_hover",d.event)):(u(fe),m(fe,"plotly_hover",d.event)),X.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var we;ie==="category"?we=P(ee,ae,fe):ie==="color"?we=F(ee,ae,fe):ie==="dimension"&&(we=z(ee,ae,fe)),we&&E.loneHover(we,{container:q._hoverlayer.node(),outerContainer:q._paper.node(),gd:ee})}}}function O(X){var re=X.parcatsViewModel;if(!re.dragDimension&&(y(re.pathSelection),M(re.dimensionSelection.selectAll("g.category")),w(re.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),E.loneUnhover(re.graphDiv._fullLayout._hoverlayer.node()),re.pathSelection.sort(c),re.hoverinfoItems.indexOf("skip")===-1)){var ee=X.parcatsViewModel.hoveron,q=this;ee==="color"?R(q,"plotly_unhover",d.event):m(q,"plotly_unhover",d.event)}}function L(X){X.parcatsViewModel.arrangement!=="fixed"&&(X.dragDimensionDisplayInd=X.model.displayInd,X.initialDragDimensionDisplayInds=X.parcatsViewModel.model.dimensions.map(function(re){return re.displayInd}),X.dragHasMoved=!1,X.dragCategoryDisplayInd=null,d.select(this).selectAll("g.category").select("rect.catrect").each(function(re){var ee=d.mouse(this)[0],q=d.mouse(this)[1];-2<=ee&&ee<=re.width+2&&-2<=q&&q<=re.height+2&&(X.dragCategoryDisplayInd=re.model.displayInd,X.initialDragCategoryDisplayInds=X.model.categories.map(function(ae){return ae.displayInd}),re.model.dragY=re.y,e.raiseToTop(this.parentNode),d.select(this.parentNode).selectAll("rect.bandrect").each(function(ae){ae.yCe.y+Ce.height/2&&(ie.model.displayInd=Ce.model.displayInd,Ce.model.displayInd=we),X.dragCategoryDisplayInd=ie.model.displayInd}if(X.dragCategoryDisplayInd===null||X.parcatsViewModel.arrangement==="freeform"){ae.model.dragX=d.event.x;var qe=X.parcatsViewModel.dimensions[ee],et=X.parcatsViewModel.dimensions[q];qe!==void 0&&ae.model.dragXet.x&&(ae.model.displayInd=et.model.displayInd,et.model.displayInd=X.dragDimensionDisplayInd),X.dragDimensionDisplayInd=ae.model.displayInd}J(X.parcatsViewModel),j(X.parcatsViewModel),ue(X.parcatsViewModel),Q(X.parcatsViewModel)}}function U(X){if(X.parcatsViewModel.arrangement!=="fixed"&&X.dragDimensionDisplayInd!==null){d.select(this).selectAll("text").attr("font-weight","normal");var re={},ee=Z(X.parcatsViewModel),q=X.parcatsViewModel.model.dimensions.map(function(et){return et.displayInd}),ae=X.initialDragDimensionDisplayInds.some(function(et,Qe){return et!==q[Qe]});ae&&q.forEach(function(et,Qe){var Ke=X.parcatsViewModel.model.dimensions[Qe].containerInd;re["dimensions["+Ke+"].displayindex"]=et});var ie=!1;if(X.dragCategoryDisplayInd!==null){var fe=X.model.categories.map(function(et){return et.displayInd});if(ie=X.initialDragCategoryDisplayInds.some(function(et,Qe){return et!==fe[Qe]}),ie){var we=X.model.categories.slice().sort(function(et,Qe){return et.displayInd-Qe.displayInd}),Ae=we.map(function(et){return et.categoryValue}),Fe=we.map(function(et){return et.categoryLabel});re["dimensions["+X.model.containerInd+"].categoryarray"]=[Ae],re["dimensions["+X.model.containerInd+"].ticktext"]=[Fe],re["dimensions["+X.model.containerInd+"].categoryorder"]="array"}}if(X.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!X.dragHasMoved&&X.potentialClickBand&&(X.parcatsViewModel.hoveron==="color"?R(X.potentialClickBand,"plotly_click",d.event.sourceEvent):m(X.potentialClickBand,"plotly_click",d.event.sourceEvent)),X.model.dragX=null,X.dragCategoryDisplayInd!==null){var Ce=X.parcatsViewModel.dimensions[X.dragDimensionDisplayInd].categories[X.dragCategoryDisplayInd];Ce.model.dragY=null,X.dragCategoryDisplayInd=null}X.dragDimensionDisplayInd=null,X.parcatsViewModel.dragDimension=null,X.dragHasMoved=null,X.potentialClickBand=null,J(X.parcatsViewModel),j(X.parcatsViewModel);var qe=d.transition().duration(300).ease("cubic-in-out");qe.each(function(){ue(X.parcatsViewModel,!0),Q(X.parcatsViewModel,!0)}).each("end",function(){(ae||ie)&&A.restyle(X.parcatsViewModel.graphDiv,re,[ee])})}}function Z(X){for(var re,ee=X.graphDiv._fullData,q=0;q=0;Ae--)Fe+="C"+fe[Ae]+","+(re[Ae+1]+q)+" "+ie[Ae]+","+(re[Ae]+q)+" "+(X[Ae]+ee[Ae])+","+(re[Ae]+q),Fe+="l-"+ee[Ae]+",0 ";return Fe+="Z",Fe}function j(X){var re=X.dimensions,ee=X.model,q=re.map(function(Mr){return Mr.categories.map(function(fr){return fr.y})}),ae=X.model.dimensions.map(function(Mr){return Mr.categories.map(function(fr){return fr.displayInd})}),ie=X.model.dimensions.map(function(Mr){return Mr.displayInd}),fe=X.dimensions.map(function(Mr){return Mr.model.dimensionInd}),we=re.map(function(Mr){return Mr.x}),Ae=re.map(function(Mr){return Mr.width}),Fe=[];for(var Ce in ee.paths)ee.paths.hasOwnProperty(Ce)&&Fe.push(ee.paths[Ce]);function qe(Mr){var fr=Mr.categoryInds.map(function(pt,ze){return ae[ze][pt]}),dr=fe.map(function(pt){return fr[pt]});return dr}Fe.sort(function(Mr,fr){var dr=qe(Mr),pt=qe(fr);return X.sortpaths==="backward"&&(dr.reverse(),pt.reverse()),dr.push(Mr.valueInds[0]),pt.push(fr.valueInds[0]),X.bundlecolors&&(dr.unshift(Mr.rawColor),pt.unshift(fr.rawColor)),drpt?1:0});for(var et=new Array(Fe.length),Qe=re[0].model.count,Ke=re[0].categories.map(function(Mr){return Mr.height}).reduce(function(Mr,fr){return Mr+fr}),Xe=0;Xe0?xe=Ke*(Me.count/Qe):xe=0;for(var ce=new Array(q.length),Re=0;Re1?fe=(X.width-2*ee-q)/(ae-1):fe=0,we=ee,Ae=we+fe*ie;var Fe=[],Ce=X.model.maxCats,qe=re.categories.length,et=8,Qe=re.count,Ke=X.height-et*(Ce-1),Xe,Me,xe,ce,Re,$e=(Ce-qe)*et/2,rt=re.categories.map(function(Je){return{displayInd:Je.displayInd,categoryInd:Je.categoryInd}});for(rt.sort(function(Je,At){return Je.displayInd-At.displayInd}),Re=0;Re0?Xe=Me.count/Qe*Ke:Xe=0,xe={key:Me.valueInds[0],model:Me,width:q,height:Xe,y:Me.dragY!==null?Me.dragY:$e,bands:[],parcatsViewModel:X},$e=$e+Xe+et,Fe.push(xe);return{key:re.dimensionInd,x:re.dragX!==null?re.dragX:Ae,y:0,width:q,model:re,categories:Fe,parcatsViewModel:X,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}}),DT=He({"src/traces/parcats/plot.js"(Y,G){var d=NI();G.exports=function(A,E,e,t){var r=A._fullLayout,o=r._paper,a=r._size;d(A,o,E,{width:a.w,height:a.h,margin:{t:a.t,r:a.r,b:a.b,l:a.l}},e,t)}}}),UI=He({"src/traces/parcats/base_plot.js"(Y){var G=Uf().getModuleCalcData,d=DT(),x="parcats";Y.name=x,Y.plot=function(A,E,e,t){var r=G(A.calcdata,x);if(r.length){var o=r[0];d(A,o,e,t)}},Y.clean=function(A,E,e,t){var r=t._has&&t._has("parcats"),o=E._has&&E._has("parcats");r&&!o&&t._paperdiv.selectAll(".parcats").remove()}}}),jI=He({"src/traces/parcats/index.js"(Y,G){G.exports={attributes:RT(),supplyDefaults:OI(),calc:BI(),plot:DT(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:UI(),categories:["noOpacity"],meta:{}}}}),VI=He({"lib/parcats.js"(Y,G){G.exports=jI()}}),dd=He({"src/plots/mapbox/constants.js"(Y,G){var d=Ud(),x="1.13.4",A='© OpenStreetMap contributors',E=['© Carto',A].join(" "),e=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),t=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),r={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:A,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:E,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:E,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:t,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},o=d(r);G.exports={requiredVersion:x,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:r,styleValuesNonMapbox:o,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+x+"."].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:",o.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')`}}}}),Ky=He({"src/plots/mapbox/layout_attributes.js"(Y,G){var d=Gr(),x=Ai().defaultLine,A=mu().attributes,E=Yl(),e=Zu().textposition,t=hu().overrideAll,r=Gs().templatedArray,o=dd(),a=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});a.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=G.exports=t({_arrayAttrRegexps:[d.counterRegex("mapbox",".layers",!0)],domain:A({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:o.styleValuesMapbox.concat(o.styleValuesNonMapbox),dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:x},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:x}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:a,textposition:d.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),sx=He({"src/traces/scattermapbox/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=Yo().texttemplateAttrs,A=wv(),E=Zp(),e=Zu(),t=Ky(),r=cl(),o=kl(),a=ho().extendFlat,i=hu().overrideAll,n=Ky(),s=E.line,c=E.marker;G.exports=i({lon:E.lon,lat:E.lat,cluster:{enabled:{valType:"boolean"},maxzoom:a({},n.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:a({},c.opacity,{dflt:1})},mode:a({},e.mode,{dflt:"markers"}),text:a({},e.text,{}),texttemplate:x({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:a({},e.hovertext,{}),line:{color:s.color,width:s.width},connectgaps:e.connectgaps,marker:a({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode},o("marker")),fill:E.fill,fillcolor:A(),textfont:t.layers.symbol.textfont,textposition:t.layers.symbol.textposition,below:{valType:"string"},selected:{marker:e.selected.marker},unselected:{marker:e.unselected.marker},hoverinfo:a({},r.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d()},"calc","nested")}}),zT=He({"src/traces/scattermapbox/constants.js"(Y,G){var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];G.exports={isSupportedFont:function(x){return d.indexOf(x)!==-1}}}}),qI=He({"src/traces/scattermapbox/defaults.js"(Y,G){var d=Gr(),x=Rl(),A=Kh(),E=nv(),e=iv(),t=Av(),r=sx(),o=zT().isSupportedFont;G.exports=function(n,s,c,f){function v(g,m){return d.coerce(n,s,r,g,m)}function h(g,m){return d.coerce2(n,s,r,g,m)}var T=a(n,s,v);if(!T){s.visible=!1;return}if(v("text"),v("texttemplate"),v("hovertext"),v("hovertemplate"),v("mode"),v("below"),x.hasMarkers(s)){A(n,s,c,f,v,{noLine:!0,noAngle:!0}),v("marker.allowoverlap"),v("marker.angle");var l=s.marker;l.symbol!=="circle"&&(d.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),d.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}x.hasLines(s)&&(E(n,s,c,f,v,{noDash:!0}),v("connectgaps"));var y=h("cluster.maxzoom"),b=h("cluster.step"),S=h("cluster.color",s.marker&&s.marker.color||c),M=h("cluster.size"),_=h("cluster.opacity"),w=y!==!1||b!==!1||S!==!1||M!==!1||_!==!1,p=v("cluster.enabled",w);if(p||x.hasText(s)){var u=f.font.family;e(n,s,f,v,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}v("fill"),s.fill!=="none"&&t(n,s,c,v),d.coerceSelectionMarkerOpacity(s,v)};function a(i,n,s){var c=s("lon")||[],f=s("lat")||[],v=Math.min(c.length,f.length);return n._length=v,v}}}),FT=He({"src/traces/scattermapbox/format_labels.js"(Y,G){var d=io();G.exports=function(A,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,a=A.lonlat;return t.lonLabel=d.tickText(o,o.c2l(a[0]),!0).text,t.latLabel=d.tickText(o,o.c2l(a[1]),!0).text,t}}}),OT=He({"src/plots/mapbox/convert_text_opts.js"(Y,G){var d=Gr();G.exports=function(A,E){var e=A.split(" "),t=e[0],r=e[1],o=d.isArrayOrTypedArray(E)?d.mean(E):E,a=.5+o/100,i=1.5+o/100,n=["",""],s=[0,0];switch(t){case"top":n[0]="top",s[1]=-i;break;case"bottom":n[0]="bottom",s[1]=i;break}switch(r){case"left":n[1]="right",s[0]=-a;break;case"right":n[1]="left",s[0]=a;break}var c;return n[0]&&n[1]?c=n.join("-"):n[0]?c=n[0]:n[1]?c=n[1]:c="center",{anchor:c,offset:s}}}}),HI=He({"src/traces/scattermapbox/convert.js"(Y,G){var d=Hi(),x=Gr(),A=lo().BADNUM,E=np(),e=Kl(),t=vo(),r=B0(),o=Rl(),a=zT().isSupportedFont,i=OT(),n=Ph().appendArrayPointValue,s=yl().NEWLINES,c=yl().BR_TAG_ALL;G.exports=function(_,w){var p=w[0].trace,u=p.visible===!0&&p._length!==0,g=p.fill!=="none",m=o.hasLines(p),R=o.hasMarkers(p),P=o.hasText(p),z=R&&p.marker.symbol==="circle",F=R&&p.marker.symbol!=="circle",B=p.cluster&&p.cluster.enabled,O=f("fill"),L=f("line"),N=f("circle"),U=f("symbol"),Z={fill:O,line:L,circle:N,symbol:U};if(!u)return Z;var Q;if((g||m)&&(Q=E.calcTraceToLineCoords(w)),g&&(O.geojson=E.makePolygon(Q),O.layout.visibility="visible",x.extendFlat(O.paint,{"fill-color":p.fillcolor})),m&&(L.geojson=E.makeLine(Q),L.layout.visibility="visible",x.extendFlat(L.paint,{"line-width":p.line.width,"line-color":p.line.color,"line-opacity":p.opacity})),z){var ue=v(w);N.geojson=ue.geojson,N.layout.visibility="visible",B&&(N.filter=["!",["has","point_count"]],Z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":b(p.cluster.color,p.cluster.step),"circle-radius":b(p.cluster.size,p.cluster.step),"circle-opacity":b(p.cluster.opacity,p.cluster.step)}},Z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(p),"text-size":12}}),x.extendFlat(N.paint,{"circle-color":ue.mcc,"circle-radius":ue.mrc,"circle-opacity":ue.mo})}if(z&&B&&(N.filter=["!",["has","point_count"]]),(F||P)&&(U.geojson=h(w,_),x.extendFlat(U.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(x.extendFlat(U.layout,{"icon-size":p.marker.size/10}),"angle"in p.marker&&p.marker.angle!=="auto"&&x.extendFlat(U.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),U.layout["icon-allow-overlap"]=p.marker.allowoverlap,x.extendFlat(U.paint,{"icon-opacity":p.opacity*p.marker.opacity,"icon-color":p.marker.color})),P)){var oe=(p.marker||{}).size,le=i(p.textposition,oe);x.extendFlat(U.layout,{"text-size":p.textfont.size,"text-anchor":le.anchor,"text-offset":le.offset,"text-font":S(p)}),x.extendFlat(U.paint,{"text-color":p.textfont.color,"text-opacity":p.opacity})}return Z};function f(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function v(M){var _=M[0].trace,w=_.marker,p=_.selectedpoints,u=x.isArrayOrTypedArray(w.color),g=x.isArrayOrTypedArray(w.size),m=x.isArrayOrTypedArray(w.opacity),R;function P(oe){return _.opacity*oe}function z(oe){return oe/2}var F;u&&(e.hasColorscale(_,"marker")?F=e.makeColorScaleFuncFromTrace(w):F=x.identity);var B;g&&(B=r(_));var O;m&&(O=function(oe){var le=d(oe)?+x.constrain(oe,0,1):0;return P(le)});var L=[];for(R=0;R850?R+=" Black":u>750?R+=" Extra Bold":u>650?R+=" Bold":u>550?R+=" Semi Bold":u>450?R+=" Medium":u>350?R+=" Regular":u>250?R+=" Light":u>150?R+=" Extra Light":R+=" Thin"):g.slice(0,2).join(" ")==="Open Sans"?(R="Open Sans",u>750?R+=" Extrabold":u>650?R+=" Bold":u>550?R+=" Semibold":u>350?R+=" Regular":R+=" Light"):g.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(R="Klokantech Noto Sans",g[3]==="CJK"&&(R+=" CJK"),R+=u>500?" Bold":" Regular")),m&&(R+=" Italic"),R==="Open Sans Regular Italic"?R="Open Sans Italic":R==="Open Sans Regular Bold"?R="Open Sans Bold":R==="Open Sans Regular Bold Italic"?R="Open Sans Bold Italic":R==="Klokantech Noto Sans Regular Italic"&&(R="Klokantech Noto Sans Italic"),a(R)||(R=w);var P=R.split(", ");return P}}}),GI=He({"src/traces/scattermapbox/plot.js"(Y,G){var d=Gr(),x=HI(),A=dd().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,a,i){this.type="scattermapbox",this.subplot=r,this.uid=o,this.clusterEnabled=a,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:A+o+"-fill",line:A+o+"-line",circle:A+o+"-circle",symbol:A+o+"-symbol",cluster:A+o+"-cluster",clusterCount:A+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,a){var i={type:"geojson",data:o.geojson};a&&a.enabled&&d.extendFlat(i,{cluster:!0,clusterMaxZoom:a.maxzoom});var n=this.subplot.map.getSource(this.sourceIds[r]);n?n.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,a){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var n=this.layerIds[r],s,c=this.subplot.getMapLayers(),f=0;f=0;m--){var R=g[m];n.removeLayer(h.layerIds[R])}u||n.removeSource(h.sourceIds.circle)}function y(u){for(var g=E.nonCluster,m=0;m=0;m--){var R=g[m];n.removeLayer(h.layerIds[R]),u||n.removeSource(h.sourceIds[R])}}function S(u){v?l(u):b(u)}function M(u){f?T(u):y(u)}function _(){for(var u=f?E.cluster:E.nonCluster,g=0;g=0;i--){var n=a[i];o.removeLayer(this.layerIds[n]),o.removeSource(this.sourceIds[n])}},G.exports=function(o,a){var i=a[0].trace,n=i.cluster&&i.cluster.enabled,s=i.visible!==!0,c=new e(o,i.uid,n,s),f=x(o.gd,a),v=c.below=o.belowLookup["trace-"+i.uid],h,T,l;if(n)for(c.addSource("circle",f.circle,i.cluster),h=0;h=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=S*360,_=i-M;function w(B){var O=B.lonlat;if(O[0]===e||y&&T.indexOf(B.i+1)===-1)return 1/0;var L=x.modHalf(O[0],360),N=O[1],U=h.project([L,N]),Z=U.x-f.c2p([_,N]),Q=U.y-v.c2p([L,n]),ue=Math.max(3,B.mrc||0);return Math.max(Math.sqrt(Z*Z+Q*Q)-ue,1-3/ue)}if(d.getClosest(s,w,a),a.index!==!1){var p=s[a.index],u=p.lonlat,g=[x.modHalf(u[0],360)+M,u[1]],m=f.c2p(g),R=v.c2p(g),P=p.mrc||1;a.x0=m-P,a.x1=m+P,a.y0=R-P,a.y1=R+P;var z={};z[c.subplot]={_subplot:h};var F=c._module.formatLabels(p,c,z);return a.lonLabel=F.lonLabel,a.latLabel=F.latLabel,a.color=A(c,p),a.extraText=o(c,p,s[0].t.labels),a.hovertemplate=c.hovertemplate,[a]}}function o(a,i,n){if(a.hovertemplate)return;var s=i.hi||a.hoverinfo,c=s.split("+"),f=c.indexOf("all")!==-1,v=c.indexOf("lon")!==-1,h=c.indexOf("lat")!==-1,T=i.lonlat,l=[];function y(b){return b+"°"}return f||v&&h?l.push("("+y(T[1])+", "+y(T[0])+")"):v?l.push(n.lon+y(T[0])):h&&l.push(n.lat+y(T[1])),(f||c.indexOf("text")!==-1)&&E(i,a,l),l.join("
")}G.exports={hoverPoints:r,getExtraText:o}}}),WI=He({"src/traces/scattermapbox/event_data.js"(Y,G){G.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x}}}),ZI=He({"src/traces/scattermapbox/select.js"(Y,G){var d=Gr(),x=Rl(),A=lo().BADNUM;G.exports=function(e,t){var r=e.cd,o=e.xaxis,a=e.yaxis,i=[],n=r[0].trace,s;if(!x.hasMarkers(n))return[];if(t===!1)for(s=0;s"u"&&(C=1e-6);var V,se,_e,ke,Ne;for(_e=k,Ne=0;Ne<8;Ne++){if(ke=this.sampleCurveX(_e)-k,Math.abs(ke)se)return se;for(;Vke?V=_e:se=_e,_e=(se-V)*.5+V}return _e},a.prototype.solve=function(k,C){return this.sampleCurveY(this.solveCurveX(k,C))};var i=n;function n(k,C){this.x=k,this.y=C}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(k){return this.clone()._add(k)},sub:function(k){return this.clone()._sub(k)},multByPoint:function(k){return this.clone()._multByPoint(k)},divByPoint:function(k){return this.clone()._divByPoint(k)},mult:function(k){return this.clone()._mult(k)},div:function(k){return this.clone()._div(k)},rotate:function(k){return this.clone()._rotate(k)},rotateAround:function(k,C){return this.clone()._rotateAround(k,C)},matMult:function(k){return this.clone()._matMult(k)},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(k){return this.x===k.x&&this.y===k.y},dist:function(k){return Math.sqrt(this.distSqr(k))},distSqr:function(k){var C=k.x-this.x,V=k.y-this.y;return C*C+V*V},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(k){return Math.atan2(this.y-k.y,this.x-k.x)},angleWith:function(k){return this.angleWithSep(k.x,k.y)},angleWithSep:function(k,C){return Math.atan2(this.x*C-this.y*k,this.x*k+this.y*C)},_matMult:function(k){var C=k[0]*this.x+k[1]*this.y,V=k[2]*this.x+k[3]*this.y;return this.x=C,this.y=V,this},_add:function(k){return this.x+=k.x,this.y+=k.y,this},_sub:function(k){return this.x-=k.x,this.y-=k.y,this},_mult:function(k){return this.x*=k,this.y*=k,this},_div:function(k){return this.x/=k,this.y/=k,this},_multByPoint:function(k){return this.x*=k.x,this.y*=k.y,this},_divByPoint:function(k){return this.x/=k.x,this.y/=k.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var k=this.y;return this.y=this.x,this.x=-k,this},_rotate:function(k){var C=Math.cos(k),V=Math.sin(k),se=C*this.x-V*this.y,_e=V*this.x+C*this.y;return this.x=se,this.y=_e,this},_rotateAround:function(k,C){var V=Math.cos(k),se=Math.sin(k),_e=C.x+V*(this.x-C.x)-se*(this.y-C.y),ke=C.y+se*(this.x-C.x)+V*(this.y-C.y);return this.x=_e,this.y=ke,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(k){return k instanceof n?k:Array.isArray(k)?new n(k[0],k[1]):k};var s=typeof self<"u"?self:{};function c(k,C){if(Array.isArray(k)){if(!Array.isArray(C)||k.length!==C.length)return!1;for(var V=0;V=1)return 1;var C=k*k,V=C*k;return 4*(k<.5?V:3*(k-C)+V-.75)}function h(k,C,V,se){var _e=new o(k,C,V,se);return function(ke){return _e.solve(ke)}}var T=h(.25,.1,.25,1);function l(k,C,V){return Math.min(V,Math.max(C,k))}function y(k,C,V){var se=V-C,_e=((k-C)%se+se)%se+C;return _e===C?V:_e}function b(k,C,V){if(!k.length)return V(null,[]);var se=k.length,_e=new Array(k.length),ke=null;k.forEach(function(Ne,it){C(Ne,function(kt,Ft){kt&&(ke=kt),_e[it]=Ft,--se===0&&V(ke,_e)})})}function S(k){var C=[];for(var V in k)C.push(k[V]);return C}function M(k,C){var V=[];for(var se in k)se in C||V.push(se);return V}function _(k){for(var C=[],V=arguments.length-1;V-- >0;)C[V]=arguments[V+1];for(var se=0,_e=C;se<_e.length;se+=1){var ke=_e[se];for(var Ne in ke)k[Ne]=ke[Ne]}return k}function w(k,C){for(var V={},se=0;se>C/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,k)}return k()}function m(k){return k<=1?1:Math.pow(2,Math.ceil(Math.log(k)/Math.LN2))}function R(k){return k?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(k):!1}function P(k,C){k.forEach(function(V){C[V]&&(C[V]=C[V].bind(C))})}function z(k,C){return k.indexOf(C,k.length-C.length)!==-1}function F(k,C,V){var se={};for(var _e in k)se[_e]=C.call(V||this,k[_e],_e,k);return se}function B(k,C,V){var se={};for(var _e in k)C.call(V||this,k[_e],_e,k)&&(se[_e]=k[_e]);return se}function O(k){return Array.isArray(k)?k.map(O):typeof k=="object"&&k?F(k,O):k}function L(k,C){for(var V=0;V=0)return!0;return!1}var N={};function U(k){N[k]||(typeof console<"u"&&console.warn(k),N[k]=!0)}function Z(k,C,V){return(V.y-k.y)*(C.x-k.x)>(C.y-k.y)*(V.x-k.x)}function Q(k){for(var C=0,V=0,se=k.length,_e=se-1,ke=void 0,Ne=void 0;V@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,V={};if(k.replace(C,function(_e,ke,Ne,it){var kt=Ne||it;return V[ke]=kt?kt.toLowerCase():!0,""}),V["max-age"]){var se=parseInt(V["max-age"],10);isNaN(se)?delete V["max-age"]:V["max-age"]=se}return V}var j=null;function J(k){if(j==null){var C=k.navigator?k.navigator.userAgent:null;j=!!k.safari||!!(C&&(/\b(iPad|iPhone|iPod)\b/.test(C)||C.match("Safari")&&!C.match("Chrome")))}return j}function $(k){try{var C=s[k];return C.setItem("_mapbox_test_",1),C.removeItem("_mapbox_test_"),!0}catch{return!1}}function X(k){return s.btoa(encodeURIComponent(k).replace(/%([0-9A-F]{2})/g,function(C,V){return String.fromCharCode(+("0x"+V))}))}function re(k){return decodeURIComponent(s.atob(k).split("").map(function(C){return"%"+("00"+C.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var ee=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),q=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,ae=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,ie,fe,we={now:ee,frame:function(C){var V=q(C);return{cancel:function(){return ae(V)}}},getImageData:function(C,V){V===void 0&&(V=0);var se=s.document.createElement("canvas"),_e=se.getContext("2d");if(!_e)throw new Error("failed to create canvas 2d context");return se.width=C.width,se.height=C.height,_e.drawImage(C,0,0,C.width,C.height),_e.getImageData(-V,-V,C.width+2*V,C.height+2*V)},resolveURL:function(C){return ie||(ie=s.document.createElement("a")),ie.href=C,ie.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(fe==null&&(fe=s.matchMedia("(prefers-reduced-motion: reduce)")),fe.matches):!1}},Ae={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},Fe={supported:!1,testSupport:Ke},Ce,qe=!1,et,Qe=!1;s.document&&(et=s.document.createElement("img"),et.onload=function(){Ce&&Xe(Ce),Ce=null,Qe=!0},et.onerror=function(){qe=!0,Ce=null},et.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function Ke(k){qe||!et||(Qe?Xe(k):Ce=k)}function Xe(k){var C=k.createTexture();k.bindTexture(k.TEXTURE_2D,C);try{if(k.texImage2D(k.TEXTURE_2D,0,k.RGBA,k.RGBA,k.UNSIGNED_BYTE,et),k.isContextLost())return;Fe.supported=!0}catch{}k.deleteTexture(C),qe=!0}var Me="01";function xe(){for(var k="1",C="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",V="",se=0;se<10;se++)V+=C[Math.floor(Math.random()*62)];var _e=12*60*60*1e3,ke=[k,Me,V].join(""),Ne=Date.now()+_e;return{token:ke,tokenExpiresAt:Ne}}var ce=function(C,V){this._transformRequestFn=C,this._customAccessToken=V,this._createSkuToken()};ce.prototype._createSkuToken=function(){var C=xe();this._skuToken=C.token,this._skuTokenExpiresAt=C.tokenExpiresAt},ce.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},ce.prototype.transformRequest=function(C,V){return this._transformRequestFn?this._transformRequestFn(C,V)||{url:C}:{url:C}},ce.prototype.normalizeStyleURL=function(C,V){if(!Re(C))return C;var se=Rt(C);return se.path="/styles/v1"+se.path,this._makeAPIURL(se,this._customAccessToken||V)},ce.prototype.normalizeGlyphsURL=function(C,V){if(!Re(C))return C;var se=Rt(C);return se.path="/fonts/v1"+se.path,this._makeAPIURL(se,this._customAccessToken||V)},ce.prototype.normalizeSourceURL=function(C,V){if(!Re(C))return C;var se=Rt(C);return se.path="/v4/"+se.authority+".json",se.params.push("secure"),this._makeAPIURL(se,this._customAccessToken||V)},ce.prototype.normalizeSpriteURL=function(C,V,se,_e){var ke=Rt(C);return Re(C)?(ke.path="/styles/v1"+ke.path+"/sprite"+V+se,this._makeAPIURL(ke,this._customAccessToken||_e)):(ke.path+=""+V+se,Ut(ke))},ce.prototype.normalizeTileURL=function(C,V){if(this._isSkuTokenExpired()&&this._createSkuToken(),C&&!Re(C))return C;var se=Rt(C),_e=/(\.(png|jpg)\d*)(?=$)/,ke=/^.+\/v4\//,Ne=we.devicePixelRatio>=2||V===512?"@2x":"",it=Fe.supported?".webp":"$1";se.path=se.path.replace(_e,""+Ne+it),se.path=se.path.replace(ke,"/"),se.path="/v4"+se.path;var kt=this._customAccessToken||At(se.params)||Ae.ACCESS_TOKEN;return Ae.REQUIRE_ACCESS_TOKEN&&kt&&this._skuToken&&se.params.push("sku="+this._skuToken),this._makeAPIURL(se,kt)},ce.prototype.canonicalizeTileURL=function(C,V){var se="/v4/",_e=/\.[\w]+$/,ke=Rt(C);if(!ke.path.match(/(^\/v4\/)/)||!ke.path.match(_e))return C;var Ne="mapbox://tiles/";Ne+=ke.path.replace(se,"");var it=ke.params;return V&&(it=it.filter(function(kt){return!kt.match(/^access_token=/)})),it.length&&(Ne+="?"+it.join("&")),Ne},ce.prototype.canonicalizeTileset=function(C,V){for(var se=V?Re(V):!1,_e=[],ke=0,Ne=C.tiles||[];ke=0&&C.params.splice(ke,1)}if(_e.path!=="/"&&(C.path=""+_e.path+C.path),!Ae.REQUIRE_ACCESS_TOKEN)return Ut(C);if(V=V||Ae.ACCESS_TOKEN,!V)throw new Error("An API access token is required to use Mapbox GL. "+se);if(V[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+se);return C.params=C.params.filter(function(Ne){return Ne.indexOf("access_token")===-1}),C.params.push("access_token="+V),Ut(C)};function Re(k){return k.indexOf("mapbox:")===0}var $e=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function rt(k){return $e.test(k)}function Je(k){return k.indexOf("sku=")>0&&rt(k)}function At(k){for(var C=0,V=k;C=1&&s.localStorage.setItem(V,JSON.stringify(this.eventData))}catch{U("Unable to write to LocalStorage")}},Mr.prototype.processRequests=function(C){},Mr.prototype.postEvent=function(C,V,se,_e){var ke=this;if(Ae.EVENTS_URL){var Ne=Rt(Ae.EVENTS_URL);Ne.params.push("access_token="+(_e||Ae.ACCESS_TOKEN||""));var it={event:this.type,created:new Date(C).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:Me,userId:this.anonId},kt=V?_(it,V):it,Ft={url:Ut(Ne),headers:{"Content-Type":"text/plain"},body:JSON.stringify([kt])};this.pendingRequest=Ur(Ft,function(Gt){ke.pendingRequest=null,se(Gt),ke.saveEventData(),ke.processRequests(_e)})}},Mr.prototype.queueRequest=function(C,V){this.queue.push(C),this.processRequests(V)};var fr=function(k){function C(){k.call(this,"map.load"),this.success={},this.skuToken=""}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postMapLoadEvent=function(se,_e,ke,Ne){this.skuToken=ke,(Ae.EVENTS_URL&&Ne||Ae.ACCESS_TOKEN&&Array.isArray(se)&&se.some(function(it){return Re(it)||rt(it)}))&&this.queueRequest({id:_e,timestamp:Date.now()},Ne)},C.prototype.processRequests=function(se){var _e=this;if(!(this.pendingRequest||this.queue.length===0)){var ke=this.queue.shift(),Ne=ke.id,it=ke.timestamp;Ne&&this.success[Ne]||(this.anonId||this.fetchEventData(),R(this.anonId)||(this.anonId=g()),this.postEvent(it,{skuToken:this.skuToken},function(kt){kt||Ne&&(_e.success[Ne]=!0)},se))}},C}(Mr),dr=function(k){function C(V){k.call(this,"appUserTurnstile"),this._customAccessToken=V}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postTurnstileEvent=function(se,_e){Ae.EVENTS_URL&&Ae.ACCESS_TOKEN&&Array.isArray(se)&&se.some(function(ke){return Re(ke)||rt(ke)})&&this.queueRequest(Date.now(),_e)},C.prototype.processRequests=function(se){var _e=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var ke=ar(Ae.ACCESS_TOKEN),Ne=ke?ke.u:Ae.ACCESS_TOKEN,it=Ne!==this.eventData.tokenU;R(this.anonId)||(this.anonId=g(),it=!0);var kt=this.queue.shift();if(this.eventData.lastSuccess){var Ft=new Date(this.eventData.lastSuccess),Gt=new Date(kt),hr=(kt-this.eventData.lastSuccess)/(24*60*60*1e3);it=it||hr>=1||hr<-1||Ft.getDate()!==Gt.getDate()}else it=!0;if(!it)return this.processRequests();this.postEvent(kt,{"enabled.telemetry":!1},function(Dr){Dr||(_e.eventData.lastSuccess=kt,_e.eventData.tokenU=Ne)},se)}},C}(Mr),pt=new dr,ze=pt.postTurnstileEvent.bind(pt),Ge=new fr,Oe=Ge.postMapLoadEvent.bind(Ge),ve="mapbox-tiles",ge=500,be=50,Pe=1e3*60*7,We;function ct(){s.caches&&!We&&(We=s.caches.open(ve))}var _t;function Mt(k,C){if(_t===void 0)try{new Response(new ReadableStream),_t=!0}catch{_t=!1}_t?C(k.body):k.blob().then(C)}function Nt(k,C,V){if(ct(),!!We){var se={status:C.status,statusText:C.statusText,headers:new s.Headers};C.headers.forEach(function(Ne,it){return se.headers.set(it,Ne)});var _e=le(C.headers.get("Cache-Control")||"");if(!_e["no-store"]){_e["max-age"]&&se.headers.set("Expires",new Date(V+_e["max-age"]*1e3).toUTCString());var ke=new Date(se.headers.get("Expires")).getTime()-V;keDate.now()&&!V["no-cache"]}var lr=1/0;function ta(k){lr++,lr>be&&(k.getActor().send("enforceCacheSizeLimit",ge),lr=0)}function da(k){ct(),We&&We.then(function(C){C.keys().then(function(V){for(var se=0;se=200&&V.status<300||V.status===0)&&V.response!==null){var _e=V.response;if(k.type==="json")try{_e=JSON.parse(V.response)}catch(ke){return C(ke)}C(null,_e,V.getResponseHeader("Cache-Control"),V.getResponseHeader("Expires"))}else C(new Ka(V.statusText,V.status,k.url))},V.send(k.body),{cancel:function(){return V.abort()}}}var gr=function(k,C){if(!Lt(k.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return jt(k,C);if(oe()&&self.worker&&self.worker.actor){var V=!0;return self.worker.actor.send("getResource",k,C,void 0,V)}}return Ot(k,C)},Br=function(k,C){return gr(_(k,{type:"json"}),C)},na=function(k,C){return gr(_(k,{type:"arrayBuffer"}),C)},Ur=function(k,C){return gr(_(k,{method:"POST"}),C)};function ga(k){var C=s.document.createElement("a");return C.href=k,C.protocol===s.document.location.protocol&&C.host===s.document.location.host}var Aa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Pa(k,C,V,se){var _e=new s.Image,ke=s.URL;_e.onload=function(){C(null,_e),ke.revokeObjectURL(_e.src),_e.onload=null,s.requestAnimationFrame(function(){_e.src=Aa})},_e.onerror=function(){return C(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 Ne=new s.Blob([new Uint8Array(k)],{type:"image/png"});_e.cacheControl=V,_e.expires=se,_e.src=k.byteLength?ke.createObjectURL(Ne):Aa}function sa(k,C){var V=new s.Blob([new Uint8Array(k)],{type:"image/png"});s.createImageBitmap(V).then(function(se){C(null,se)}).catch(function(se){C(new Error("Could not load image because of "+se.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var Oa,dt,vt=function(){Oa=[],dt=0};vt();var Lr=function(k,C){if(Fe.supported&&(k.headers||(k.headers={}),k.headers.accept="image/webp,*/*"),dt>=Ae.MAX_PARALLEL_IMAGE_REQUESTS){var V={requestParameters:k,callback:C,cancelled:!1,cancel:function(){this.cancelled=!0}};return Oa.push(V),V}dt++;var se=!1,_e=function(){if(!se)for(se=!0,dt--;Oa.length&&dt0||this._oneTimeListeners&&this._oneTimeListeners[C]&&this._oneTimeListeners[C].length>0||this._eventedParent&&this._eventedParent.listens(C)},Pr.prototype.setEventedParent=function(C,V){return this._eventedParent=C,this._eventedParentData=V,this};var Hr=8,Zr={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"}},Jr={"*":{type:"source"}},wt=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Qt={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},mr={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},$r={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},oa={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},Sa={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"}}},ya={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"}}},ra={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"}},pa=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],pn={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ga={"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"}},qn={"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"}},Vn={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},di={"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"}},yi={"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"}},Ci={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ci={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ei={type:"array",value:"*"},mi={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},uo={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Lo={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Wo={type:"array",value:"*",minimum:1},li={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}},Ii=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],xi={"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"}},Ao={"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"}},So={"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"}},Ro={"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"}},Li={"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"}},Yi={"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"}},bs={"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"}},as={"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"}},fs={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Co={"*":{type:"string"}},Qa={$version:Hr,$root:Zr,sources:Jr,source:wt,source_vector:Qt,source_raster:mr,source_raster_dem:$r,source_geojson:oa,source_video:Sa,source_image:ya,layer:ra,layout:pa,layout_background:pn,layout_fill:Ga,layout_circle:qn,layout_heatmap:Vn,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:di,layout_symbol:yi,layout_raster:Ci,layout_hillshade:ci,filter:ei,filter_operator:mi,geometry_type:uo,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:Lo,expression:Wo,light:li,paint:Ii,paint_fill:xi,"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:Ao,paint_circle:So,paint_heatmap:Ro,paint_symbol:Li,paint_raster:Yi,paint_hillshade:bs,paint_background:as,transition:fs,"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:Co},Jn=function(C,V,se,_e){this.message=(C?C+": ":"")+se,_e&&(this.identifier=_e),V!=null&&V.__line__&&(this.line=V.__line__)};function Os(k){var C=k.key,V=k.value;return V?[new Jn(C,V,"constants have been deprecated as of v8")]:[]}function ds(k){for(var C=[],V=arguments.length-1;V-- >0;)C[V]=arguments[V+1];for(var se=0,_e=C;se<_e.length;se+=1){var ke=_e[se];for(var Ne in ke)k[Ne]=ke[Ne]}return k}function Ui(k){return k instanceof Number||k instanceof String||k instanceof Boolean?k.valueOf():k}function ms(k){if(Array.isArray(k))return k.map(ms);if(k instanceof Object&&!(k instanceof Number||k instanceof String||k instanceof Boolean)){var C={};for(var V in k)C[V]=ms(k[V]);return C}return Ui(k)}var Mo=function(k){function C(V,se){k.call(this,se),this.message=se,this.key=V}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C}(Error),ws=function(C,V){V===void 0&&(V=[]),this.parent=C,this.bindings={};for(var se=0,_e=V;se<_e.length;se+=1){var ke=_e[se],Ne=ke[0],it=ke[1];this.bindings[Ne]=it}};ws.prototype.concat=function(C){return new ws(this,C)},ws.prototype.get=function(C){if(this.bindings[C])return this.bindings[C];if(this.parent)return this.parent.get(C);throw new Error(C+" not found in scope.")},ws.prototype.has=function(C){return this.bindings[C]?!0:this.parent?this.parent.has(C):!1};var Ks={kind:"null"},Rn={kind:"number"},fo={kind:"string"},Pi={kind:"boolean"},zo={kind:"color"},wo={kind:"object"},bi={kind:"value"},wl={kind:"error"},$l={kind:"collator"},Js={kind:"formatted"},Ql={kind:"resolvedImage"};function Ws(k,C){return{kind:"array",itemType:k,N:C}}function Is(k){if(k.kind==="array"){var C=Is(k.itemType);return typeof k.N=="number"?"array<"+C+", "+k.N+">":k.itemType.kind==="value"?"array":"array<"+C+">"}else return k.kind}var Dl=[Ks,Rn,fo,Pi,zo,Js,wo,Ws(bi),Ql];function Xu(k,C){if(C.kind==="error")return null;if(k.kind==="array"){if(C.kind==="array"&&(C.N===0&&C.itemType.kind==="value"||!Xu(k.itemType,C.itemType))&&(typeof k.N!="number"||k.N===C.N))return null}else{if(k.kind===C.kind)return null;if(k.kind==="value")for(var V=0,se=Dl;V255?255:Ft}function _e(Ft){return Ft<0?0:Ft>1?1:Ft}function ke(Ft){return Ft[Ft.length-1]==="%"?se(parseFloat(Ft)/100*255):se(parseInt(Ft))}function Ne(Ft){return Ft[Ft.length-1]==="%"?_e(parseFloat(Ft)/100):_e(parseFloat(Ft))}function it(Ft,Gt,hr){return hr<0?hr+=1:hr>1&&(hr-=1),hr*6<1?Ft+(Gt-Ft)*hr*6:hr*2<1?Gt:hr*3<2?Ft+(Gt-Ft)*(2/3-hr)*6:Ft}function kt(Ft){var Gt=Ft.replace(/ /g,"").toLowerCase();if(Gt in V)return V[Gt].slice();if(Gt[0]==="#"){if(Gt.length===4){var hr=parseInt(Gt.substr(1),16);return hr>=0&&hr<=4095?[(hr&3840)>>4|(hr&3840)>>8,hr&240|(hr&240)>>4,hr&15|(hr&15)<<4,1]:null}else if(Gt.length===7){var hr=parseInt(Gt.substr(1),16);return hr>=0&&hr<=16777215?[(hr&16711680)>>16,(hr&65280)>>8,hr&255,1]:null}return null}var Dr=Gt.indexOf("("),Ir=Gt.indexOf(")");if(Dr!==-1&&Ir+1===Gt.length){var Xr=Gt.substr(0,Dr),ba=Gt.substr(Dr+1,Ir-(Dr+1)).split(","),Za=1;switch(Xr){case"rgba":if(ba.length!==4)return null;Za=Ne(ba.pop());case"rgb":return ba.length!==3?null:[ke(ba[0]),ke(ba[1]),ke(ba[2]),Za];case"hsla":if(ba.length!==4)return null;Za=Ne(ba.pop());case"hsl":if(ba.length!==3)return null;var Ra=(parseFloat(ba[0])%360+360)%360/360,dn=Ne(ba[1]),$a=Ne(ba[2]),vn=$a<=.5?$a*(dn+1):$a+dn-$a*dn,bn=$a*2-vn;return[se(it(bn,vn,Ra+1/3)*255),se(it(bn,vn,Ra)*255),se(it(bn,vn,Ra-1/3)*255),Za];default:return null}}return null}try{C.parseCSSColor=kt}catch{}}),gf=kf.parseCSSColor,ns=function(C,V,se,_e){_e===void 0&&(_e=1),this.r=C,this.g=V,this.b=se,this.a=_e};ns.parse=function(C){if(C){if(C instanceof ns)return C;if(typeof C=="string"){var V=gf(C);if(V)return new ns(V[0]/255*V[3],V[1]/255*V[3],V[2]/255*V[3],V[3])}}},ns.prototype.toString=function(){var C=this.toArray(),V=C[0],se=C[1],_e=C[2],ke=C[3];return"rgba("+Math.round(V)+","+Math.round(se)+","+Math.round(_e)+","+ke+")"},ns.prototype.toArray=function(){var C=this,V=C.r,se=C.g,_e=C.b,ke=C.a;return ke===0?[0,0,0,0]:[V*255/ke,se*255/ke,_e*255/ke,ke]},ns.black=new ns(0,0,0,1),ns.white=new ns(1,1,1,1),ns.transparent=new ns(0,0,0,0),ns.red=new ns(1,0,0,1);var _u=function(C,V,se){C?this.sensitivity=V?"variant":"case":this.sensitivity=V?"accent":"base",this.locale=se,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};_u.prototype.compare=function(C,V){return this.collator.compare(C,V)},_u.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Nc=function(C,V,se,_e,ke){this.text=C,this.image=V,this.scale=se,this.fontStack=_e,this.textColor=ke},ml=function(C){this.sections=C};ml.fromString=function(C){return new ml([new Nc(C,null,null,null,null)])},ml.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(C){return C.text.length!==0||C.image&&C.image.name.length!==0})},ml.factory=function(C){return C instanceof ml?C:ml.fromString(C)},ml.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(C){return C.text}).join("")},ml.prototype.serialize=function(){for(var C=["format"],V=0,se=this.sections;V=0&&k<=255&&typeof C=="number"&&C>=0&&C<=255&&typeof V=="number"&&V>=0&&V<=255)){var _e=typeof se=="number"?[k,C,V,se]:[k,C,V];return"Invalid rgba value ["+_e.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof se>"u"||typeof se=="number"&&se>=0&&se<=1?null:"Invalid rgba value ["+[k,C,V,se].join(", ")+"]: 'a' must be between 0 and 1."}function Yu(k){if(k===null)return!0;if(typeof k=="string")return!0;if(typeof k=="boolean")return!0;if(typeof k=="number")return!0;if(k instanceof ns)return!0;if(k instanceof _u)return!0;if(k instanceof ml)return!0;if(k instanceof fl)return!0;if(Array.isArray(k)){for(var C=0,V=k;C2){var it=C[1];if(typeof it!="string"||!(it in Nu)||it==="object")return V.error('The item type argument of "array" must be one of string, number, boolean',1);Ne=Nu[it],se++}else Ne=bi;var kt;if(C.length>3){if(C[2]!==null&&(typeof C[2]!="number"||C[2]<0||C[2]!==Math.floor(C[2])))return V.error('The length argument to "array" must be a positive integer literal',2);kt=C[2],se++}_e=Ws(Ne,kt)}else _e=Nu[ke];for(var Ft=[];se1)&&V.push(_e)}}return V.concat(this.args.map(function(ke){return ke.serialize()}))};var Ku=function(C){this.type=Js,this.sections=C};Ku.parse=function(C,V){if(C.length<2)return V.error("Expected at least one argument.");var se=C[1];if(!Array.isArray(se)&&typeof se=="object")return V.error("First argument must be an image or text section.");for(var _e=[],ke=!1,Ne=1;Ne<=C.length-1;++Ne){var it=C[Ne];if(ke&&typeof it=="object"&&!Array.isArray(it)){ke=!1;var kt=null;if(it["font-scale"]&&(kt=V.parse(it["font-scale"],1,Rn),!kt))return null;var Ft=null;if(it["text-font"]&&(Ft=V.parse(it["text-font"],1,Ws(fo)),!Ft))return null;var Gt=null;if(it["text-color"]&&(Gt=V.parse(it["text-color"],1,zo),!Gt))return null;var hr=_e[_e.length-1];hr.scale=kt,hr.font=Ft,hr.textColor=Gt}else{var Dr=V.parse(C[Ne],1,bi);if(!Dr)return null;var Ir=Dr.type.kind;if(Ir!=="string"&&Ir!=="value"&&Ir!=="null"&&Ir!=="resolvedImage")return V.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");ke=!0,_e.push({content:Dr,scale:null,font:null,textColor:null})}}return new Ku(_e)},Ku.prototype.evaluate=function(C){var V=function(se){var _e=se.content.evaluate(C);return Ts(_e)===Ql?new Nc("",_e,null,null,null):new Nc(Tl(_e),null,se.scale?se.scale.evaluate(C):null,se.font?se.font.evaluate(C).join(","):null,se.textColor?se.textColor.evaluate(C):null)};return new ml(this.sections.map(V))},Ku.prototype.eachChild=function(C){for(var V=0,se=this.sections;V-1),se},Bs.prototype.eachChild=function(C){C(this.input)},Bs.prototype.outputDefined=function(){return!1},Bs.prototype.serialize=function(){return["image",this.input.serialize()]};var Gf={"to-boolean":Pi,"to-color":zo,"to-number":Rn,"to-string":fo},Eo=function(C,V){this.type=C,this.args=V};Eo.parse=function(C,V){if(C.length<2)return V.error("Expected at least one argument.");var se=C[0];if((se==="to-boolean"||se==="to-string")&&C.length!==2)return V.error("Expected one argument.");for(var _e=Gf[se],ke=[],Ne=1;Ne4?se="Invalid rbga value "+JSON.stringify(V)+": expected an array containing either three or four numeric values.":se=_l(V[0],V[1],V[2],V[3]),!se))return new ns(V[0]/255,V[1]/255,V[2]/255,V[3])}throw new Cs(se||"Could not parse color from value '"+(typeof V=="string"?V:String(JSON.stringify(V)))+"'")}else if(this.type.kind==="number"){for(var kt=null,Ft=0,Gt=this.args;Ft=C[2]||k[1]<=C[1]||k[3]>=C[3])}function yf(k,C){var V=Ju(k[0]),se=gc(k[1]),_e=Math.pow(2,C.z);return[Math.round(V*_e*zl),Math.round(se*_e*zl)]}function Jc(k,C,V){var se=k[0]-C[0],_e=k[1]-C[1],ke=k[0]-V[0],Ne=k[1]-V[1];return se*Ne-ke*_e===0&&se*ke<=0&&_e*Ne<=0}function Uc(k,C,V){return C[1]>k[1]!=V[1]>k[1]&&k[0]<(V[0]-C[0])*(k[1]-C[1])/(V[1]-C[1])+C[0]}function $u(k,C){for(var V=!1,se=0,_e=C.length;se<_e;se++)for(var ke=C[se],Ne=0,it=ke.length;Ne0&&hr<0||Gt<0&&hr>0}function Qc(k,C,V,se){var _e=[C[0]-k[0],C[1]-k[1]],ke=[se[0]-V[0],se[1]-V[1]];return $c(ke,_e)===0?!1:!!(bu(k,C,V,se)&&bu(V,se,k,C))}function sc(k,C,V){for(var se=0,_e=V;se<_e.length;se+=1)for(var ke=_e[se],Ne=0;NeV[2]){var _e=se*.5,ke=k[0]-V[0]>_e?-se:V[0]-k[0]>_e?se:0;ke===0&&(ke=k[0]-V[2]>_e?-se:V[2]-k[0]>_e?se:0),k[0]+=ke}Kc(C,k)}function Vc(k){k[0]=k[1]=1/0,k[2]=k[3]=-1/0}function Zf(k,C,V,se){for(var _e=Math.pow(2,se.z)*zl,ke=[se.x*zl,se.y*zl],Ne=[],it=0,kt=k;it=0)return!1;var V=!0;return k.eachChild(function(se){V&&!ru(se,C)&&(V=!1)}),V}var Uu=function(C,V){this.type=V.type,this.name=C,this.boundExpression=V};Uu.parse=function(C,V){if(C.length!==2||typeof C[1]!="string")return V.error("'var' expression requires exactly one string literal argument.");var se=C[1];return V.scope.has(se)?new Uu(se,V.scope.get(se)):V.error('Unknown variable "'+se+'". Make sure "'+se+'" has been bound in an enclosing "let" expression before using it.',1)},Uu.prototype.evaluate=function(C){return this.boundExpression.evaluate(C)},Uu.prototype.eachChild=function(){},Uu.prototype.outputDefined=function(){return!1},Uu.prototype.serialize=function(){return["var",this.name]};var $s=function(C,V,se,_e,ke){V===void 0&&(V=[]),_e===void 0&&(_e=new ws),ke===void 0&&(ke=[]),this.registry=C,this.path=V,this.key=V.map(function(Ne){return"["+Ne+"]"}).join(""),this.scope=_e,this.errors=ke,this.expectedType=se};$s.prototype.parse=function(C,V,se,_e,ke){return ke===void 0&&(ke={}),V?this.concat(V,se,_e)._parse(C,ke):this._parse(C,ke)},$s.prototype._parse=function(C,V){(C===null||typeof C=="string"||typeof C=="boolean"||typeof C=="number")&&(C=["literal",C]);function se(Gt,hr,Dr){return Dr==="assert"?new Ul(hr,[Gt]):Dr==="coerce"?new Eo(hr,[Gt]):Gt}if(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 _e=C[0];if(typeof _e!="string")return this.error("Expression name must be a string, but found "+typeof _e+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var ke=this.registry[_e];if(ke){var Ne=ke.parse(C,this);if(!Ne)return null;if(this.expectedType){var it=this.expectedType,kt=Ne.type;if((it.kind==="string"||it.kind==="number"||it.kind==="boolean"||it.kind==="object"||it.kind==="array")&&kt.kind==="value")Ne=se(Ne,it,V.typeAnnotation||"assert");else if((it.kind==="color"||it.kind==="formatted"||it.kind==="resolvedImage")&&(kt.kind==="value"||kt.kind==="string"))Ne=se(Ne,it,V.typeAnnotation||"coerce");else if(this.checkSubtype(it,kt))return null}if(!(Ne instanceof Ko)&&Ne.type.kind!=="resolvedImage"&&Qu(Ne)){var Ft=new is;try{Ne=new Ko(Ne.type,Ne.evaluate(Ft))}catch(Gt){return this.error(Gt.message),null}}return Ne}return this.error('Unknown expression "'+_e+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof C>"u"?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.")},$s.prototype.concat=function(C,V,se){var _e=typeof C=="number"?this.path.concat(C):this.path,ke=se?this.scope.concat(se):this.scope;return new $s(this.registry,_e,V||null,ke,this.errors)},$s.prototype.error=function(C){for(var V=[],se=arguments.length-1;se-- >0;)V[se]=arguments[se+1];var _e=""+this.key+V.map(function(ke){return"["+ke+"]"}).join("");this.errors.push(new Mo(_e,C))},$s.prototype.checkSubtype=function(C,V){var se=Xu(C,V);return se&&this.error(se),se};function Qu(k){if(k instanceof Uu)return Qu(k.boundExpression);if(k instanceof oo&&k.name==="error")return!1;if(k instanceof xu)return!1;if(k instanceof tu)return!1;var C=k instanceof Eo||k instanceof Ul,V=!0;return k.eachChild(function(se){C?V=V&&Qu(se):V=V&&se instanceof Ko}),V?xf(k)&&ru(k,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Tu(k,C){for(var V=k.length-1,se=0,_e=V,ke=0,Ne,it;se<=_e;)if(ke=Math.floor((se+_e)/2),Ne=k[ke],it=k[ke+1],Ne<=C){if(ke===V||CC)_e=ke-1;else throw new Cs("Input is not a number.");return 0}var au=function(C,V,se){this.type=C,this.input=V,this.labels=[],this.outputs=[];for(var _e=0,ke=se;_e=it)return V.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Ft);var hr=V.parse(kt,Gt,ke);if(!hr)return null;ke=ke||hr.type,_e.push([it,hr])}return new au(ke,se,_e)},au.prototype.evaluate=function(C){var V=this.labels,se=this.outputs;if(V.length===1)return se[0].evaluate(C);var _e=this.input.evaluate(C);if(_e<=V[0])return se[0].evaluate(C);var ke=V.length;if(_e>=V[ke-1])return se[ke-1].evaluate(C);var Ne=Tu(V,_e);return se[Ne].evaluate(C)},au.prototype.eachChild=function(C){C(this.input);for(var V=0,se=this.outputs;V0&&C.push(this.labels[V]),C.push(this.outputs[V].serialize());return C};function Ns(k,C,V){return k*(1-V)+C*V}function yc(k,C,V){return new ns(Ns(k.r,C.r,V),Ns(k.g,C.g,V),Ns(k.b,C.b,V),Ns(k.a,C.a,V))}function Pu(k,C,V){return k.map(function(se,_e){return Ns(se,C[_e],V)})}var ec=Object.freeze({__proto__:null,number:Ns,color:yc,array:Pu}),Ec=.95047,Cf=1,nh=1.08883,lc=4/29,kc=6/29,nu=3*kc*kc,tf=kc*kc*kc,Cl=Math.PI/180,uc=180/Math.PI;function rf(k){return k>tf?Math.pow(k,1/3):k/nu+lc}function mc(k){return k>kc?k*k*k:nu*(k-lc)}function Us(k){return 255*(k<=.0031308?12.92*k:1.055*Math.pow(k,1/2.4)-.055)}function vu(k){return k/=255,k<=.04045?k/12.92:Math.pow((k+.055)/1.055,2.4)}function du(k){var C=vu(k.r),V=vu(k.g),se=vu(k.b),_e=rf((.4124564*C+.3575761*V+.1804375*se)/Ec),ke=rf((.2126729*C+.7151522*V+.072175*se)/Cf),Ne=rf((.0193339*C+.119192*V+.9503041*se)/nh);return{l:116*ke-16,a:500*(_e-ke),b:200*(ke-Ne),alpha:k.a}}function af(k){var C=(k.l+16)/116,V=isNaN(k.a)?C:C+k.a/500,se=isNaN(k.b)?C:C-k.b/200;return C=Cf*mc(C),V=Ec*mc(V),se=nh*mc(se),new ns(Us(3.2404542*V-1.5371385*C-.4985314*se),Us(-.969266*V+1.8760108*C+.041556*se),Us(.0556434*V-.2040259*C+1.0572252*se),k.alpha)}function Rs(k,C,V){return{l:Ns(k.l,C.l,V),a:Ns(k.a,C.a,V),b:Ns(k.b,C.b,V),alpha:Ns(k.alpha,C.alpha,V)}}function _c(k){var C=du(k),V=C.l,se=C.a,_e=C.b,ke=Math.atan2(_e,se)*uc;return{h:ke<0?ke+360:ke,c:Math.sqrt(se*se+_e*_e),l:V,alpha:k.a}}function ju(k){var C=k.h*Cl,V=k.c,se=k.l;return af({l:se,a:Math.cos(C)*V,b:Math.sin(C)*V,alpha:k.alpha})}function iu(k,C,V){var se=C-k;return k+V*(se>180||se<-180?se-360*Math.round(se/360):se)}function xc(k,C,V){return{h:iu(k.h,C.h,V),c:Ns(k.c,C.c,V),l:Ns(k.l,C.l,V),alpha:Ns(k.alpha,C.alpha,V)}}var Iu={forward:du,reverse:af,interpolate:Rs},bc={forward:_c,reverse:ju,interpolate:xc},Lf=Object.freeze({__proto__:null,lab:Iu,hcl:bc}),xl=function(C,V,se,_e,ke){this.type=C,this.operator=V,this.interpolation=se,this.input=_e,this.labels=[],this.outputs=[];for(var Ne=0,it=ke;Ne1}))return V.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_e={name:"cubic-bezier",controlPoints:kt}}else return V.error("Unknown interpolation type "+String(_e[0]),1,0);if(C.length-1<4)return V.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if((C.length-1)%2!==0)return V.error("Expected an even number of arguments.");if(ke=V.parse(ke,2,Rn),!ke)return null;var Ft=[],Gt=null;se==="interpolate-hcl"||se==="interpolate-lab"?Gt=zo:V.expectedType&&V.expectedType.kind!=="value"&&(Gt=V.expectedType);for(var hr=0;hr=Dr)return V.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Xr);var Za=V.parse(Ir,ba,Gt);if(!Za)return null;Gt=Gt||Za.type,Ft.push([Dr,Za])}return Gt.kind!=="number"&&Gt.kind!=="color"&&!(Gt.kind==="array"&&Gt.itemType.kind==="number"&&typeof Gt.N=="number")?V.error("Type "+Is(Gt)+" is not interpolatable."):new xl(Gt,se,_e,ke,Ft)},xl.prototype.evaluate=function(C){var V=this.labels,se=this.outputs;if(V.length===1)return se[0].evaluate(C);var _e=this.input.evaluate(C);if(_e<=V[0])return se[0].evaluate(C);var ke=V.length;if(_e>=V[ke-1])return se[ke-1].evaluate(C);var Ne=Tu(V,_e),it=V[Ne],kt=V[Ne+1],Ft=xl.interpolationFactor(this.interpolation,_e,it,kt),Gt=se[Ne].evaluate(C),hr=se[Ne+1].evaluate(C);return this.operator==="interpolate"?ec[this.type.kind.toLowerCase()](Gt,hr,Ft):this.operator==="interpolate-hcl"?bc.reverse(bc.interpolate(bc.forward(Gt),bc.forward(hr),Ft)):Iu.reverse(Iu.interpolate(Iu.forward(Gt),Iu.forward(hr),Ft))},xl.prototype.eachChild=function(C){C(this.input);for(var V=0,se=this.outputs;V=se.length)throw new Cs("Array index out of bounds: "+V+" > "+(se.length-1)+".");if(V!==Math.floor(V))throw new Cs("Array index must be an integer, but found "+V+" instead.");return se[V]},Au.prototype.eachChild=function(C){C(this.index),C(this.input)},Au.prototype.outputDefined=function(){return!1},Au.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Zs=function(C,V){this.type=Pi,this.needle=C,this.haystack=V};Zs.parse=function(C,V){if(C.length!==3)return V.error("Expected 2 arguments, but found "+(C.length-1)+" instead.");var se=V.parse(C[1],1,bi),_e=V.parse(C[2],2,bi);return!se||!_e?null:Lu(se.type,[Pi,fo,Rn,Ks,bi])?new Zs(se,_e):V.error("Expected first argument to be of type boolean, string, number or null, but found "+Is(se.type)+" instead")},Zs.prototype.evaluate=function(C){var V=this.needle.evaluate(C),se=this.haystack.evaluate(C);if(!se)return!1;if(!Bu(V,["boolean","string","number","null"]))throw new Cs("Expected first argument to be of type boolean, string, number or null, but found "+Is(Ts(V))+" instead.");if(!Bu(se,["string","array"]))throw new Cs("Expected second argument to be of type array or string, but found "+Is(Ts(se))+" instead.");return se.indexOf(V)>=0},Zs.prototype.eachChild=function(C){C(this.needle),C(this.haystack)},Zs.prototype.outputDefined=function(){return!0},Zs.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Ol=function(C,V,se){this.type=Rn,this.needle=C,this.haystack=V,this.fromIndex=se};Ol.parse=function(C,V){if(C.length<=2||C.length>=5)return V.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var se=V.parse(C[1],1,bi),_e=V.parse(C[2],2,bi);if(!se||!_e)return null;if(!Lu(se.type,[Pi,fo,Rn,Ks,bi]))return V.error("Expected first argument to be of type boolean, string, number or null, but found "+Is(se.type)+" instead");if(C.length===4){var ke=V.parse(C[3],3,Rn);return ke?new Ol(se,_e,ke):null}else return new Ol(se,_e)},Ol.prototype.evaluate=function(C){var V=this.needle.evaluate(C),se=this.haystack.evaluate(C);if(!Bu(V,["boolean","string","number","null"]))throw new Cs("Expected first argument to be of type boolean, string, number or null, but found "+Is(Ts(V))+" instead.");if(!Bu(se,["string","array"]))throw new Cs("Expected second argument to be of type array or string, but found "+Is(Ts(se))+" instead.");if(this.fromIndex){var _e=this.fromIndex.evaluate(C);return se.indexOf(V,_e)}return se.indexOf(V)},Ol.prototype.eachChild=function(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)},Ol.prototype.outputDefined=function(){return!1},Ol.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 bl=function(C,V,se,_e,ke,Ne){this.inputType=C,this.type=V,this.input=se,this.cases=_e,this.outputs=ke,this.otherwise=Ne};bl.parse=function(C,V){if(C.length<5)return V.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if(C.length%2!==1)return V.error("Expected an even number of arguments.");var se,_e;V.expectedType&&V.expectedType.kind!=="value"&&(_e=V.expectedType);for(var ke={},Ne=[],it=2;itNumber.MAX_SAFE_INTEGER)return Gt.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof Ir=="number"&&Math.floor(Ir)!==Ir)return Gt.error("Numeric branch labels must be integer values.");if(!se)se=Ts(Ir);else if(Gt.checkSubtype(se,Ts(Ir)))return null;if(typeof ke[String(Ir)]<"u")return Gt.error("Branch labels must be unique.");ke[String(Ir)]=Ne.length}var Xr=V.parse(Ft,it,_e);if(!Xr)return null;_e=_e||Xr.type,Ne.push(Xr)}var ba=V.parse(C[1],1,bi);if(!ba)return null;var Za=V.parse(C[C.length-1],C.length-1,_e);return!Za||ba.type.kind!=="value"&&V.concat(1).checkSubtype(se,ba.type)?null:new bl(se,_e,ba,ke,Ne,Za)},bl.prototype.evaluate=function(C){var V=this.input.evaluate(C),se=Ts(V)===this.inputType&&this.outputs[this.cases[V]]||this.otherwise;return se.evaluate(C)},bl.prototype.eachChild=function(C){C(this.input),this.outputs.forEach(C),C(this.otherwise)},bl.prototype.outputDefined=function(){return this.outputs.every(function(C){return C.outputDefined()})&&this.otherwise.outputDefined()},bl.prototype.serialize=function(){for(var C=this,V=["match",this.input.serialize()],se=Object.keys(this.cases).sort(),_e=[],ke={},Ne=0,it=se;Ne=5)return V.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var se=V.parse(C[1],1,bi),_e=V.parse(C[2],2,Rn);if(!se||!_e)return null;if(!Lu(se.type,[Ws(bi),fo,bi]))return V.error("Expected first argument to be of type array or string, but found "+Is(se.type)+" instead");if(C.length===4){var ke=V.parse(C[3],3,Rn);return ke?new Su(se.type,se,_e,ke):null}else return new Su(se.type,se,_e)},Su.prototype.evaluate=function(C){var V=this.input.evaluate(C),se=this.beginIndex.evaluate(C);if(!Bu(V,["string","array"]))throw new Cs("Expected first argument to be of type array or string, but found "+Is(Ts(V))+" instead.");if(this.endIndex){var _e=this.endIndex.evaluate(C);return V.slice(se,_e)}return V.slice(se)},Su.prototype.eachChild=function(C){C(this.input),C(this.beginIndex),this.endIndex&&C(this.endIndex)},Su.prototype.outputDefined=function(){return!1},Su.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()]};function Cc(k,C){return k==="=="||k==="!="?C.kind==="boolean"||C.kind==="string"||C.kind==="number"||C.kind==="null"||C.kind==="value":C.kind==="string"||C.kind==="number"||C.kind==="value"}function Ht(k,C,V){return C===V}function ur(k,C,V){return C!==V}function qr(k,C,V){return CV}function ua(k,C,V){return C<=V}function Fa(k,C,V){return C>=V}function ja(k,C,V,se){return se.compare(C,V)===0}function sn(k,C,V,se){return!ja(k,C,V,se)}function gn(k,C,V,se){return se.compare(C,V)<0}function kn(k,C,V,se){return se.compare(C,V)>0}function Ja(k,C,V,se){return se.compare(C,V)<=0}function _n(k,C,V,se){return se.compare(C,V)>=0}function on(k,C,V){var se=k!=="=="&&k!=="!=";return function(){function _e(ke,Ne,it){this.type=Pi,this.lhs=ke,this.rhs=Ne,this.collator=it,this.hasUntypedArgument=ke.type.kind==="value"||Ne.type.kind==="value"}return _e.parse=function(Ne,it){if(Ne.length!==3&&Ne.length!==4)return it.error("Expected two or three arguments.");var kt=Ne[0],Ft=it.parse(Ne[1],1,bi);if(!Ft)return null;if(!Cc(kt,Ft.type))return it.concat(1).error('"'+kt+`" comparisons are not supported for type '`+Is(Ft.type)+"'.");var Gt=it.parse(Ne[2],2,bi);if(!Gt)return null;if(!Cc(kt,Gt.type))return it.concat(2).error('"'+kt+`" comparisons are not supported for type '`+Is(Gt.type)+"'.");if(Ft.type.kind!==Gt.type.kind&&Ft.type.kind!=="value"&&Gt.type.kind!=="value")return it.error("Cannot compare types '"+Is(Ft.type)+"' and '"+Is(Gt.type)+"'.");se&&(Ft.type.kind==="value"&&Gt.type.kind!=="value"?Ft=new Ul(Gt.type,[Ft]):Ft.type.kind!=="value"&&Gt.type.kind==="value"&&(Gt=new Ul(Ft.type,[Gt])));var hr=null;if(Ne.length===4){if(Ft.type.kind!=="string"&&Gt.type.kind!=="string"&&Ft.type.kind!=="value"&&Gt.type.kind!=="value")return it.error("Cannot use collator to compare non-string types.");if(hr=it.parse(Ne[3],3,$l),!hr)return null}return new _e(Ft,Gt,hr)},_e.prototype.evaluate=function(Ne){var it=this.lhs.evaluate(Ne),kt=this.rhs.evaluate(Ne);if(se&&this.hasUntypedArgument){var Ft=Ts(it),Gt=Ts(kt);if(Ft.kind!==Gt.kind||!(Ft.kind==="string"||Ft.kind==="number"))throw new Cs('Expected arguments for "'+k+'" to be (string, string) or (number, number), but found ('+Ft.kind+", "+Gt.kind+") instead.")}if(this.collator&&!se&&this.hasUntypedArgument){var hr=Ts(it),Dr=Ts(kt);if(hr.kind!=="string"||Dr.kind!=="string")return C(Ne,it,kt)}return this.collator?V(Ne,it,kt,this.collator.evaluate(Ne)):C(Ne,it,kt)},_e.prototype.eachChild=function(Ne){Ne(this.lhs),Ne(this.rhs),this.collator&&Ne(this.collator)},_e.prototype.outputDefined=function(){return!0},_e.prototype.serialize=function(){var Ne=[k];return this.eachChild(function(it){Ne.push(it.serialize())}),Ne},_e}()}var Wa=on("==",Ht,ja),On=on("!=",ur,sn),zi=on("<",qr,gn),ki=on(">",Or,kn),ji=on("<=",ua,Ja),Ni=on(">=",Fa,_n),Bn=function(C,V,se,_e,ke){this.type=fo,this.number=C,this.locale=V,this.currency=se,this.minFractionDigits=_e,this.maxFractionDigits=ke};Bn.parse=function(C,V){if(C.length!==3)return V.error("Expected two arguments.");var se=V.parse(C[1],1,Rn);if(!se)return null;var _e=C[2];if(typeof _e!="object"||Array.isArray(_e))return V.error("NumberFormat options argument must be an object.");var ke=null;if(_e.locale&&(ke=V.parse(_e.locale,1,fo),!ke))return null;var Ne=null;if(_e.currency&&(Ne=V.parse(_e.currency,1,fo),!Ne))return null;var it=null;if(_e["min-fraction-digits"]&&(it=V.parse(_e["min-fraction-digits"],1,Rn),!it))return null;var kt=null;return _e["max-fraction-digits"]&&(kt=V.parse(_e["max-fraction-digits"],1,Rn),!kt)?null:new Bn(se,ke,Ne,it,kt)},Bn.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))},Bn.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)},Bn.prototype.outputDefined=function(){return!1},Bn.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 An=function(C){this.type=Rn,this.input=C};An.parse=function(C,V){if(C.length!==2)return V.error("Expected 1 argument, but found "+(C.length-1)+" instead.");var se=V.parse(C[1],1);return se?se.type.kind!=="array"&&se.type.kind!=="string"&&se.type.kind!=="value"?V.error("Expected argument of type string or array, but found "+Is(se.type)+" instead."):new An(se):null},An.prototype.evaluate=function(C){var V=this.input.evaluate(C);if(typeof V=="string")return V.length;if(Array.isArray(V))return V.length;throw new Cs("Expected value to be of type string or array, but found "+Is(Ts(V))+" instead.")},An.prototype.eachChild=function(C){C(this.input)},An.prototype.outputDefined=function(){return!1},An.prototype.serialize=function(){var C=["length"];return this.eachChild(function(V){C.push(V.serialize())}),C};var Ki={"==":Wa,"!=":On,">":ki,"<":zi,">=":Ni,"<=":ji,array:Ul,at:Au,boolean:Ul,case:tc,coalesce:ou,collator:xu,format:Ku,image:Bs,in:Zs,"index-of":Ol,interpolate:xl,"interpolate-hcl":xl,"interpolate-lab":xl,length:An,let:Ru,literal:Ko,match:bl,number:Ul,"number-format":Bn,object:Ul,slice:Su,step:au,string:Ul,"to-boolean":Eo,"to-color":Eo,"to-number":Eo,"to-string":Eo,var:Uu,within:tu};function ko(k,C){var V=C[0],se=C[1],_e=C[2],ke=C[3];V=V.evaluate(k),se=se.evaluate(k),_e=_e.evaluate(k);var Ne=ke?ke.evaluate(k):1,it=_l(V,se,_e,Ne);if(it)throw new Cs(it);return new ns(V/255*Ne,se/255*Ne,_e/255*Ne,Ne)}function $o(k,C){return k in C}function Ls(k,C){var V=C[k];return typeof V>"u"?null:V}function os(k,C,V,se){for(;V<=se;){var _e=V+se>>1;if(C[_e]===k)return!0;C[_e]>k?se=_e-1:V=_e+1}return!1}function As(k){return{type:k}}oo.register(Ki,{error:[wl,[fo],function(k,C){var V=C[0];throw new Cs(V.evaluate(k))}],typeof:[fo,[bi],function(k,C){var V=C[0];return Is(Ts(V.evaluate(k)))}],"to-rgba":[Ws(Rn,4),[zo],function(k,C){var V=C[0];return V.evaluate(k).toArray()}],rgb:[zo,[Rn,Rn,Rn],ko],rgba:[zo,[Rn,Rn,Rn,Rn],ko],has:{type:Pi,overloads:[[[fo],function(k,C){var V=C[0];return $o(V.evaluate(k),k.properties())}],[[fo,wo],function(k,C){var V=C[0],se=C[1];return $o(V.evaluate(k),se.evaluate(k))}]]},get:{type:bi,overloads:[[[fo],function(k,C){var V=C[0];return Ls(V.evaluate(k),k.properties())}],[[fo,wo],function(k,C){var V=C[0],se=C[1];return Ls(V.evaluate(k),se.evaluate(k))}]]},"feature-state":[bi,[fo],function(k,C){var V=C[0];return Ls(V.evaluate(k),k.featureState||{})}],properties:[wo,[],function(k){return k.properties()}],"geometry-type":[fo,[],function(k){return k.geometryType()}],id:[bi,[],function(k){return k.id()}],zoom:[Rn,[],function(k){return k.globals.zoom}],"heatmap-density":[Rn,[],function(k){return k.globals.heatmapDensity||0}],"line-progress":[Rn,[],function(k){return k.globals.lineProgress||0}],accumulated:[bi,[],function(k){return k.globals.accumulated===void 0?null:k.globals.accumulated}],"+":[Rn,As(Rn),function(k,C){for(var V=0,se=0,_e=C;se<_e.length;se+=1){var ke=_e[se];V+=ke.evaluate(k)}return V}],"*":[Rn,As(Rn),function(k,C){for(var V=1,se=0,_e=C;se<_e.length;se+=1){var ke=_e[se];V*=ke.evaluate(k)}return V}],"-":{type:Rn,overloads:[[[Rn,Rn],function(k,C){var V=C[0],se=C[1];return V.evaluate(k)-se.evaluate(k)}],[[Rn],function(k,C){var V=C[0];return-V.evaluate(k)}]]},"/":[Rn,[Rn,Rn],function(k,C){var V=C[0],se=C[1];return V.evaluate(k)/se.evaluate(k)}],"%":[Rn,[Rn,Rn],function(k,C){var V=C[0],se=C[1];return V.evaluate(k)%se.evaluate(k)}],ln2:[Rn,[],function(){return Math.LN2}],pi:[Rn,[],function(){return Math.PI}],e:[Rn,[],function(){return Math.E}],"^":[Rn,[Rn,Rn],function(k,C){var V=C[0],se=C[1];return Math.pow(V.evaluate(k),se.evaluate(k))}],sqrt:[Rn,[Rn],function(k,C){var V=C[0];return Math.sqrt(V.evaluate(k))}],log10:[Rn,[Rn],function(k,C){var V=C[0];return Math.log(V.evaluate(k))/Math.LN10}],ln:[Rn,[Rn],function(k,C){var V=C[0];return Math.log(V.evaluate(k))}],log2:[Rn,[Rn],function(k,C){var V=C[0];return Math.log(V.evaluate(k))/Math.LN2}],sin:[Rn,[Rn],function(k,C){var V=C[0];return Math.sin(V.evaluate(k))}],cos:[Rn,[Rn],function(k,C){var V=C[0];return Math.cos(V.evaluate(k))}],tan:[Rn,[Rn],function(k,C){var V=C[0];return Math.tan(V.evaluate(k))}],asin:[Rn,[Rn],function(k,C){var V=C[0];return Math.asin(V.evaluate(k))}],acos:[Rn,[Rn],function(k,C){var V=C[0];return Math.acos(V.evaluate(k))}],atan:[Rn,[Rn],function(k,C){var V=C[0];return Math.atan(V.evaluate(k))}],min:[Rn,As(Rn),function(k,C){return Math.min.apply(Math,C.map(function(V){return V.evaluate(k)}))}],max:[Rn,As(Rn),function(k,C){return Math.max.apply(Math,C.map(function(V){return V.evaluate(k)}))}],abs:[Rn,[Rn],function(k,C){var V=C[0];return Math.abs(V.evaluate(k))}],round:[Rn,[Rn],function(k,C){var V=C[0],se=V.evaluate(k);return se<0?-Math.round(-se):Math.round(se)}],floor:[Rn,[Rn],function(k,C){var V=C[0];return Math.floor(V.evaluate(k))}],ceil:[Rn,[Rn],function(k,C){var V=C[0];return Math.ceil(V.evaluate(k))}],"filter-==":[Pi,[fo,bi],function(k,C){var V=C[0],se=C[1];return k.properties()[V.value]===se.value}],"filter-id-==":[Pi,[bi],function(k,C){var V=C[0];return k.id()===V.value}],"filter-type-==":[Pi,[fo],function(k,C){var V=C[0];return k.geometryType()===V.value}],"filter-<":[Pi,[fo,bi],function(k,C){var V=C[0],se=C[1],_e=k.properties()[V.value],ke=se.value;return typeof _e==typeof ke&&_e":[Pi,[fo,bi],function(k,C){var V=C[0],se=C[1],_e=k.properties()[V.value],ke=se.value;return typeof _e==typeof ke&&_e>ke}],"filter-id->":[Pi,[bi],function(k,C){var V=C[0],se=k.id(),_e=V.value;return typeof se==typeof _e&&se>_e}],"filter-<=":[Pi,[fo,bi],function(k,C){var V=C[0],se=C[1],_e=k.properties()[V.value],ke=se.value;return typeof _e==typeof ke&&_e<=ke}],"filter-id-<=":[Pi,[bi],function(k,C){var V=C[0],se=k.id(),_e=V.value;return typeof se==typeof _e&&se<=_e}],"filter->=":[Pi,[fo,bi],function(k,C){var V=C[0],se=C[1],_e=k.properties()[V.value],ke=se.value;return typeof _e==typeof ke&&_e>=ke}],"filter-id->=":[Pi,[bi],function(k,C){var V=C[0],se=k.id(),_e=V.value;return typeof se==typeof _e&&se>=_e}],"filter-has":[Pi,[bi],function(k,C){var V=C[0];return V.value in k.properties()}],"filter-has-id":[Pi,[],function(k){return k.id()!==null&&k.id()!==void 0}],"filter-type-in":[Pi,[Ws(fo)],function(k,C){var V=C[0];return V.value.indexOf(k.geometryType())>=0}],"filter-id-in":[Pi,[Ws(bi)],function(k,C){var V=C[0];return V.value.indexOf(k.id())>=0}],"filter-in-small":[Pi,[fo,Ws(bi)],function(k,C){var V=C[0],se=C[1];return se.value.indexOf(k.properties()[V.value])>=0}],"filter-in-large":[Pi,[fo,Ws(bi)],function(k,C){var V=C[0],se=C[1];return os(k.properties()[V.value],se.value,0,se.value.length-1)}],all:{type:Pi,overloads:[[[Pi,Pi],function(k,C){var V=C[0],se=C[1];return V.evaluate(k)&&se.evaluate(k)}],[As(Pi),function(k,C){for(var V=0,se=C;V-1}function fi(k){return!!k.expression&&k.expression.interpolated}function ao(k){return k instanceof Number?"number":k instanceof String?"string":k instanceof Boolean?"boolean":Array.isArray(k)?"array":k===null?"null":typeof k}function gs(k){return typeof k=="object"&&k!==null&&!Array.isArray(k)}function Jo(k){return k}function Bl(k,C){var V=C.type==="color",se=k.stops&&typeof k.stops[0][0]=="object",_e=se||k.property!==void 0,ke=se||!_e,Ne=k.type||(fi(C)?"exponential":"interval");if(V&&(k=ds({},k),k.stops&&(k.stops=k.stops.map(function(ni){return[ni[0],ns.parse(ni[1])]})),k.default?k.default=ns.parse(k.default):k.default=ns.parse(C.default)),k.colorSpace&&k.colorSpace!=="rgb"&&!Lf[k.colorSpace])throw new Error("Unknown color space: "+k.colorSpace);var it,kt,Ft;if(Ne==="exponential")it=ql;else if(Ne==="interval")it=cc;else if(Ne==="categorical"){it=Vl,kt=Object.create(null);for(var Gt=0,hr=k.stops;Gt=k.stops[se-1][0])return k.stops[se-1][1];var _e=Tu(k.stops.map(function(ke){return ke[0]}),V);return k.stops[_e][1]}function ql(k,C,V){var se=k.base!==void 0?k.base:1;if(ao(V)!=="number")return jl(k.default,C.default);var _e=k.stops.length;if(_e===1||V<=k.stops[0][0])return k.stops[0][1];if(V>=k.stops[_e-1][0])return k.stops[_e-1][1];var ke=Tu(k.stops.map(function(hr){return hr[0]}),V),Ne=ol(V,se,k.stops[ke][0],k.stops[ke+1][0]),it=k.stops[ke][1],kt=k.stops[ke+1][1],Ft=ec[C.type]||Jo;if(k.colorSpace&&k.colorSpace!=="rgb"){var Gt=Lf[k.colorSpace];Ft=function(hr,Dr){return Gt.reverse(Gt.interpolate(Gt.forward(hr),Gt.forward(Dr),Ne))}}return typeof it.evaluate=="function"?{evaluate:function(){for(var Dr=[],Ir=arguments.length;Ir--;)Dr[Ir]=arguments[Ir];var Xr=it.evaluate.apply(void 0,Dr),ba=kt.evaluate.apply(void 0,Dr);if(!(Xr===void 0||ba===void 0))return Ft(Xr,ba,Ne)}}:Ft(it,kt,Ne)}function Vu(k,C,V){return C.type==="color"?V=ns.parse(V):C.type==="formatted"?V=ml.fromString(V.toString()):C.type==="resolvedImage"?V=fl.fromString(V.toString()):ao(V)!==C.type&&(C.type!=="enum"||!C.values[V])&&(V=void 0),jl(V,k.default,C.default)}function ol(k,C,V,se){var _e=se-V,ke=k-V;return _e===0?0:C===1?ke/_e:(Math.pow(C,ke)-1)/(Math.pow(C,_e)-1)}var rc=function(C,V){this.expression=C,this._warningHistory={},this._evaluator=new is,this._defaultValue=V?Se(V):null,this._enumValues=V&&V.type==="enum"?V.values:null};rc.prototype.evaluateWithoutErrorHandling=function(C,V,se,_e,ke,Ne){return this._evaluator.globals=C,this._evaluator.feature=V,this._evaluator.featureState=se,this._evaluator.canonical=_e,this._evaluator.availableImages=ke||null,this._evaluator.formattedSection=Ne,this.expression.evaluate(this._evaluator)},rc.prototype.evaluate=function(C,V,se,_e,ke,Ne){this._evaluator.globals=C,this._evaluator.feature=V||null,this._evaluator.featureState=se||null,this._evaluator.canonical=_e,this._evaluator.availableImages=ke||null,this._evaluator.formattedSection=Ne||null;try{var it=this.expression.evaluate(this._evaluator);if(it==null||typeof it=="number"&&it!==it)return this._defaultValue;if(this._enumValues&&!(it in this._enumValues))throw new Cs("Expected value to be one of "+Object.keys(this._enumValues).map(function(kt){return JSON.stringify(kt)}).join(", ")+", but found "+JSON.stringify(it)+" instead.");return it}catch(kt){return this._warningHistory[kt.message]||(this._warningHistory[kt.message]=!0,typeof console<"u"&&console.warn(kt.message)),this._defaultValue}};function Vi(k){return Array.isArray(k)&&k.length>0&&typeof k[0]=="string"&&k[0]in Ki}function eo(k,C){var V=new $s(Ki,[],C?Te(C):void 0),se=V.parse(k,void 0,void 0,void 0,C&&C.type==="string"?{typeAnnotation:"coerce"}:void 0);return se?jo(new rc(se,C)):il(V.errors)}var qu=function(C,V){this.kind=C,this._styleExpression=V,this.isStateDependent=C!=="constant"&&!Fl(V.expression)};qu.prototype.evaluateWithoutErrorHandling=function(C,V,se,_e,ke,Ne){return this._styleExpression.evaluateWithoutErrorHandling(C,V,se,_e,ke,Ne)},qu.prototype.evaluate=function(C,V,se,_e,ke,Ne){return this._styleExpression.evaluate(C,V,se,_e,ke,Ne)};var Du=function(C,V,se,_e){this.kind=C,this.zoomStops=se,this._styleExpression=V,this.isStateDependent=C!=="camera"&&!Fl(V.expression),this.interpolationType=_e};Du.prototype.evaluateWithoutErrorHandling=function(C,V,se,_e,ke,Ne){return this._styleExpression.evaluateWithoutErrorHandling(C,V,se,_e,ke,Ne)},Du.prototype.evaluate=function(C,V,se,_e,ke,Ne){return this._styleExpression.evaluate(C,V,se,_e,ke,Ne)},Du.prototype.interpolationFactor=function(C,V,se){return this.interpolationType?xl.interpolationFactor(this.interpolationType,C,V,se):0};function wc(k,C){if(k=eo(k,C),k.result==="error")return k;var V=k.value.expression,se=xf(V);if(!se&&!Qs(C))return il([new Mo("","data expressions not supported")]);var _e=ru(V,["zoom"]);if(!_e&&!Ss(C))return il([new Mo("","zoom expressions not supported")]);var ke=ne(V);if(!ke&&!_e)return il([new Mo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(ke instanceof Mo)return il([ke]);if(ke instanceof xl&&!fi(C))return il([new Mo("",'"interpolate" expressions cannot be used with this property')]);if(!ke)return jo(se?new qu("constant",k.value):new qu("source",k.value));var Ne=ke instanceof xl?ke.interpolation:void 0;return jo(se?new Du("camera",k.value,ke.labels,Ne):new Du("composite",k.value,ke.labels,Ne))}var De=function(C,V){this._parameters=C,this._specification=V,ds(this,Bl(this._parameters,this._specification))};De.deserialize=function(C){return new De(C._parameters,C._specification)},De.serialize=function(C){return{_parameters:C._parameters,_specification:C._specification}};function I(k,C){if(gs(k))return new De(k,C);if(Vi(k)){var V=wc(k,C);if(V.result==="error")throw new Error(V.value.map(function(_e){return _e.key+": "+_e.message}).join(", "));return V.value}else{var se=k;return typeof k=="string"&&C.type==="color"&&(se=ns.parse(k)),{kind:"constant",evaluate:function(){return se}}}}function ne(k){var C=null;if(k instanceof Ru)C=ne(k.result);else if(k instanceof ou)for(var V=0,se=k.args;Vse.maximum?[new Jn(C,V,V+" is greater than the maximum value "+se.maximum)]:[]}function Ct(k){var C=k.valueSpec,V=Ui(k.value.type),se,_e={},ke,Ne,it=V!=="categorical"&&k.value.property===void 0,kt=!it,Ft=ao(k.value.stops)==="array"&&ao(k.value.stops[0])==="array"&&ao(k.value.stops[0][0])==="object",Gt=Ie({key:k.key,value:k.value,valueSpec:k.styleSpec.function,style:k.style,styleSpec:k.styleSpec,objectElementValidators:{stops:hr,default:Xr}});return V==="identity"&&it&&Gt.push(new Jn(k.key,k.value,'missing required property "property"')),V!=="identity"&&!k.value.stops&&Gt.push(new Jn(k.key,k.value,'missing required property "stops"')),V==="exponential"&&k.valueSpec.expression&&!fi(k.valueSpec)&&Gt.push(new Jn(k.key,k.value,"exponential functions not supported")),k.styleSpec.$version>=8&&(kt&&!Qs(k.valueSpec)?Gt.push(new Jn(k.key,k.value,"property functions not supported")):it&&!Ss(k.valueSpec)&&Gt.push(new Jn(k.key,k.value,"zoom functions not supported"))),(V==="categorical"||Ft)&&k.value.property===void 0&&Gt.push(new Jn(k.key,k.value,'"property" property is required')),Gt;function hr(ba){if(V==="identity")return[new Jn(ba.key,ba.value,'identity function may not have a "stops" property')];var Za=[],Ra=ba.value;return Za=Za.concat(ot({key:ba.key,value:Ra,valueSpec:ba.valueSpec,style:ba.style,styleSpec:ba.styleSpec,arrayElementValidator:Dr})),ao(Ra)==="array"&&Ra.length===0&&Za.push(new Jn(ba.key,Ra,"array must have at least one stop")),Za}function Dr(ba){var Za=[],Ra=ba.value,dn=ba.key;if(ao(Ra)!=="array")return[new Jn(dn,Ra,"array expected, "+ao(Ra)+" found")];if(Ra.length!==2)return[new Jn(dn,Ra,"array length 2 expected, length "+Ra.length+" found")];if(Ft){if(ao(Ra[0])!=="object")return[new Jn(dn,Ra,"object expected, "+ao(Ra[0])+" found")];if(Ra[0].zoom===void 0)return[new Jn(dn,Ra,"object stop key must have zoom")];if(Ra[0].value===void 0)return[new Jn(dn,Ra,"object stop key must have value")];if(Ne&&Ne>Ui(Ra[0].zoom))return[new Jn(dn,Ra[0].zoom,"stop zoom values must appear in ascending order")];Ui(Ra[0].zoom)!==Ne&&(Ne=Ui(Ra[0].zoom),ke=void 0,_e={}),Za=Za.concat(Ie({key:dn+"[0]",value:Ra[0],valueSpec:{zoom:{}},style:ba.style,styleSpec:ba.styleSpec,objectElementValidators:{zoom:yt,value:Ir}}))}else Za=Za.concat(Ir({key:dn+"[0]",value:Ra[0],valueSpec:{},style:ba.style,styleSpec:ba.styleSpec},Ra));return Vi(ms(Ra[1]))?Za.concat([new Jn(dn+"[1]",Ra[1],"expressions are not allowed in function stops.")]):Za.concat(No({key:dn+"[1]",value:Ra[1],valueSpec:C,style:ba.style,styleSpec:ba.styleSpec}))}function Ir(ba,Za){var Ra=ao(ba.value),dn=Ui(ba.value),$a=ba.value!==null?ba.value:Za;if(!se)se=Ra;else if(Ra!==se)return[new Jn(ba.key,$a,Ra+" stop domain type must match previous stop domain type "+se)];if(Ra!=="number"&&Ra!=="string"&&Ra!=="boolean")return[new Jn(ba.key,$a,"stop domain value must be a number, string, or boolean")];if(Ra!=="number"&&V!=="categorical"){var vn="number expected, "+Ra+" found";return Qs(C)&&V===void 0&&(vn+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Jn(ba.key,$a,vn)]}return V==="categorical"&&Ra==="number"&&(!isFinite(dn)||Math.floor(dn)!==dn)?[new Jn(ba.key,$a,"integer expected, found "+dn)]:V!=="categorical"&&Ra==="number"&&ke!==void 0&&dn=2&&k[1]!=="$id"&&k[1]!=="$type";case"in":return k.length>=3&&(typeof k[1]!="string"||Array.isArray(k[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return k.length!==3||Array.isArray(k[1])||Array.isArray(k[2]);case"any":case"all":for(var C=0,V=k.slice(1);CC?1:0}function lt(k){if(!Array.isArray(k))return!1;if(k[0]==="within")return!0;for(var C=1;C"||C==="<="||C===">="?gt(k[1],k[2],C):C==="any"?Et(k.slice(1)):C==="all"?["all"].concat(k.slice(1).map(Tt)):C==="none"?["all"].concat(k.slice(1).map(Tt).map(sr)):C==="in"?Yt(k[1],k.slice(2)):C==="!in"?sr(Yt(k[1],k.slice(2))):C==="has"?rr(k[1]):C==="!has"?sr(rr(k[1])):C==="within"?k:!0;return V}function gt(k,C,V){switch(k){case"$type":return["filter-type-"+V,C];case"$id":return["filter-id-"+V,C];default:return["filter-"+V,k,C]}}function Et(k){return["any"].concat(k.map(Tt))}function Yt(k,C){if(C.length===0)return!1;switch(k){case"$type":return["filter-type-in",["literal",C]];case"$id":return["filter-id-in",["literal",C]];default:return C.length>200&&!C.some(function(V){return typeof V!=typeof C[0]})?["filter-in-large",k,["literal",C.sort(at)]]:["filter-in-small",k,["literal",C]]}}function rr(k){switch(k){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",k]}}function sr(k){return["!",k]}function Sr(k){return Wr(ms(k.value))?Wt(ds({},k,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Nr(k)}function Nr(k){var C=k.value,V=k.key;if(ao(C)!=="array")return[new Jn(V,C,"array expected, "+ao(C)+" found")];var se=k.styleSpec,_e,ke=[];if(C.length<1)return[new Jn(V,C,"filter array must have at least 1 element")];switch(ke=ke.concat(Fr({key:V+"[0]",value:C[0],valueSpec:se.filter_operator,style:k.style,styleSpec:k.styleSpec})),Ui(C[0])){case"<":case"<=":case">":case">=":C.length>=2&&Ui(C[1])==="$type"&&ke.push(new Jn(V,C,'"$type" cannot be use with operator "'+C[0]+'"'));case"==":case"!=":C.length!==3&&ke.push(new Jn(V,C,'filter array for operator "'+C[0]+'" must have 3 elements'));case"in":case"!in":C.length>=2&&(_e=ao(C[1]),_e!=="string"&&ke.push(new Jn(V+"[1]",C[1],"string expected, "+_e+" found")));for(var Ne=2;Ne=Gt[Ir+0]&&se>=Gt[Ir+1])?(Ne[Dr]=!0,ke.push(Ft[Dr])):Ne[Dr]=!1}}},Ye.prototype._forEachCell=function(k,C,V,se,_e,ke,Ne,it){for(var kt=this._convertToCellCoord(k),Ft=this._convertToCellCoord(C),Gt=this._convertToCellCoord(V),hr=this._convertToCellCoord(se),Dr=kt;Dr<=Gt;Dr++)for(var Ir=Ft;Ir<=hr;Ir++){var Xr=this.d*Ir+Dr;if(!(it&&!it(this._convertFromCellCoord(Dr),this._convertFromCellCoord(Ir),this._convertFromCellCoord(Dr+1),this._convertFromCellCoord(Ir+1)))&&_e.call(this,k,C,V,se,Xr,ke,Ne,it))return}},Ye.prototype._convertFromCellCoord=function(k){return(k-this.padding)/this.scale},Ye.prototype._convertToCellCoord=function(k){return Math.max(0,Math.min(this.d-1,Math.floor(k*this.scale)+this.padding))},Ye.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var k=this.cells,C=Le+this.cells.length+1+1,V=0,se=0;se=0)){var hr=k[Gt];Ft[Gt]=xt[kt].shallow.indexOf(Gt)>=0?hr:Ar(hr,C)}k instanceof Error&&(Ft.message=k.message)}if(Ft.$name)throw new Error("$name property is reserved for worker serialization logic.");return kt!=="Object"&&(Ft.$name=kt),Ft}throw new Error("can't serialize object of type "+typeof k)}function Vr(k){if(k==null||typeof k=="boolean"||typeof k=="number"||typeof k=="string"||k instanceof Boolean||k instanceof Number||k instanceof String||k instanceof Date||k instanceof RegExp||$t(k)||Cr(k)||ArrayBuffer.isView(k)||k instanceof ut)return k;if(Array.isArray(k))return k.map(Vr);if(typeof k=="object"){var C=k.$name||"Object",V=xt[C],se=V.klass;if(!se)throw new Error("can't deserialize unregistered class "+C);if(se.deserialize)return se.deserialize(k);for(var _e=Object.create(se.prototype),ke=0,Ne=Object.keys(k);ke=0?kt:Vr(kt)}}return _e}throw new Error("can't deserialize object of type "+typeof k)}var Kr=function(){this.first=!0};Kr.prototype.update=function(C,V){var se=Math.floor(C);return this.first?(this.first=!1,this.lastIntegerZoom=se,this.lastIntegerZoomTime=0,this.lastZoom=C,this.lastFloorZoom=se,!0):(this.lastFloorZoom>se?(this.lastIntegerZoom=se+1,this.lastIntegerZoomTime=V):this.lastFloorZoom=128&&k<=255},Arabic:function(k){return k>=1536&&k<=1791},"Arabic Supplement":function(k){return k>=1872&&k<=1919},"Arabic Extended-A":function(k){return k>=2208&&k<=2303},"Hangul Jamo":function(k){return k>=4352&&k<=4607},"Unified Canadian Aboriginal Syllabics":function(k){return k>=5120&&k<=5759},Khmer:function(k){return k>=6016&&k<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(k){return k>=6320&&k<=6399},"General Punctuation":function(k){return k>=8192&&k<=8303},"Letterlike Symbols":function(k){return k>=8448&&k<=8527},"Number Forms":function(k){return k>=8528&&k<=8591},"Miscellaneous Technical":function(k){return k>=8960&&k<=9215},"Control Pictures":function(k){return k>=9216&&k<=9279},"Optical Character Recognition":function(k){return k>=9280&&k<=9311},"Enclosed Alphanumerics":function(k){return k>=9312&&k<=9471},"Geometric Shapes":function(k){return k>=9632&&k<=9727},"Miscellaneous Symbols":function(k){return k>=9728&&k<=9983},"Miscellaneous Symbols and Arrows":function(k){return k>=11008&&k<=11263},"CJK Radicals Supplement":function(k){return k>=11904&&k<=12031},"Kangxi Radicals":function(k){return k>=12032&&k<=12255},"Ideographic Description Characters":function(k){return k>=12272&&k<=12287},"CJK Symbols and Punctuation":function(k){return k>=12288&&k<=12351},Hiragana:function(k){return k>=12352&&k<=12447},Katakana:function(k){return k>=12448&&k<=12543},Bopomofo:function(k){return k>=12544&&k<=12591},"Hangul Compatibility Jamo":function(k){return k>=12592&&k<=12687},Kanbun:function(k){return k>=12688&&k<=12703},"Bopomofo Extended":function(k){return k>=12704&&k<=12735},"CJK Strokes":function(k){return k>=12736&&k<=12783},"Katakana Phonetic Extensions":function(k){return k>=12784&&k<=12799},"Enclosed CJK Letters and Months":function(k){return k>=12800&&k<=13055},"CJK Compatibility":function(k){return k>=13056&&k<=13311},"CJK Unified Ideographs Extension A":function(k){return k>=13312&&k<=19903},"Yijing Hexagram Symbols":function(k){return k>=19904&&k<=19967},"CJK Unified Ideographs":function(k){return k>=19968&&k<=40959},"Yi Syllables":function(k){return k>=40960&&k<=42127},"Yi Radicals":function(k){return k>=42128&&k<=42191},"Hangul Jamo Extended-A":function(k){return k>=43360&&k<=43391},"Hangul Syllables":function(k){return k>=44032&&k<=55215},"Hangul Jamo Extended-B":function(k){return k>=55216&&k<=55295},"Private Use Area":function(k){return k>=57344&&k<=63743},"CJK Compatibility Ideographs":function(k){return k>=63744&&k<=64255},"Arabic Presentation Forms-A":function(k){return k>=64336&&k<=65023},"Vertical Forms":function(k){return k>=65040&&k<=65055},"CJK Compatibility Forms":function(k){return k>=65072&&k<=65103},"Small Form Variants":function(k){return k>=65104&&k<=65135},"Arabic Presentation Forms-B":function(k){return k>=65136&&k<=65279},"Halfwidth and Fullwidth Forms":function(k){return k>=65280&&k<=65519}};function Ua(k){for(var C=0,V=k;C=65097&&k<=65103)||aa["CJK Compatibility Ideographs"](k)||aa["CJK Compatibility"](k)||aa["CJK Radicals Supplement"](k)||aa["CJK Strokes"](k)||aa["CJK Symbols and Punctuation"](k)&&!(k>=12296&&k<=12305)&&!(k>=12308&&k<=12319)&&k!==12336||aa["CJK Unified Ideographs Extension A"](k)||aa["CJK Unified Ideographs"](k)||aa["Enclosed CJK Letters and Months"](k)||aa["Hangul Compatibility Jamo"](k)||aa["Hangul Jamo Extended-A"](k)||aa["Hangul Jamo Extended-B"](k)||aa["Hangul Jamo"](k)||aa["Hangul Syllables"](k)||aa.Hiragana(k)||aa["Ideographic Description Characters"](k)||aa.Kanbun(k)||aa["Kangxi Radicals"](k)||aa["Katakana Phonetic Extensions"](k)||aa.Katakana(k)&&k!==12540||aa["Halfwidth and Fullwidth Forms"](k)&&k!==65288&&k!==65289&&k!==65293&&!(k>=65306&&k<=65310)&&k!==65339&&k!==65341&&k!==65343&&!(k>=65371&&k<=65503)&&k!==65507&&!(k>=65512&&k<=65519)||aa["Small Form Variants"](k)&&!(k>=65112&&k<=65118)&&!(k>=65123&&k<=65126)||aa["Unified Canadian Aboriginal Syllabics"](k)||aa["Unified Canadian Aboriginal Syllabics Extended"](k)||aa["Vertical Forms"](k)||aa["Yijing Hexagram Symbols"](k)||aa["Yi Syllables"](k)||aa["Yi Radicals"](k))}function Va(k){return!!(aa["Latin-1 Supplement"](k)&&(k===167||k===169||k===174||k===177||k===188||k===189||k===190||k===215||k===247)||aa["General Punctuation"](k)&&(k===8214||k===8224||k===8225||k===8240||k===8241||k===8251||k===8252||k===8258||k===8263||k===8264||k===8265||k===8273)||aa["Letterlike Symbols"](k)||aa["Number Forms"](k)||aa["Miscellaneous Technical"](k)&&(k>=8960&&k<=8967||k>=8972&&k<=8991||k>=8996&&k<=9e3||k===9003||k>=9085&&k<=9114||k>=9150&&k<=9165||k===9167||k>=9169&&k<=9179||k>=9186&&k<=9215)||aa["Control Pictures"](k)&&k!==9251||aa["Optical Character Recognition"](k)||aa["Enclosed Alphanumerics"](k)||aa["Geometric Shapes"](k)||aa["Miscellaneous Symbols"](k)&&!(k>=9754&&k<=9759)||aa["Miscellaneous Symbols and Arrows"](k)&&(k>=11026&&k<=11055||k>=11088&&k<=11097||k>=11192&&k<=11243)||aa["CJK Symbols and Punctuation"](k)||aa.Katakana(k)||aa["Private Use Area"](k)||aa["CJK Compatibility Forms"](k)||aa["Small Form Variants"](k)||aa["Halfwidth and Fullwidth Forms"](k)||k===8734||k===8756||k===8757||k>=9984&&k<=10087||k>=10102&&k<=10131||k===65532||k===65533)}function Ma(k){return!(Ba(k)||Va(k))}function mn(k){return aa.Arabic(k)||aa["Arabic Supplement"](k)||aa["Arabic Extended-A"](k)||aa["Arabic Presentation Forms-A"](k)||aa["Arabic Presentation Forms-B"](k)}function Wn(k){return k>=1424&&k<=2303||aa["Arabic Presentation Forms-A"](k)||aa["Arabic Presentation Forms-B"](k)}function jn(k,C){return!(!C&&Wn(k)||k>=2304&&k<=3583||k>=3840&&k<=4255||aa.Khmer(k))}function Zn(k){for(var C=0,V=k;C-1&&(wi=_i.error),Po&&Po(k)};function sl(){Ms.fire(new kr("pluginStateChange",{pluginStatus:wi,pluginURL:Ji}))}var Ms=new Pr,Kn=function(){return wi},go=function(k){return k({pluginStatus:wi,pluginURL:Ji}),Ms.on("pluginStateChange",k),k},Do=function(k,C,V){if(V===void 0&&(V=!1),wi===_i.deferred||wi===_i.loading||wi===_i.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ji=we.resolveURL(k),wi=_i.deferred,Po=C,sl(),V||Es()},Es=function(){if(wi!==_i.deferred||!Ji)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");wi=_i.loading,sl(),Ji&&na({url:Ji},function(k){k?Vo(k):(wi=_i.loaded,sl())})},hs={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return wi===_i.loaded||hs.applyArabicShaping!=null},isLoading:function(){return wi===_i.loading},setState:function(C){wi=C.pluginStatus,Ji=C.pluginURL},isParsed:function(){return hs.applyArabicShaping!=null&&hs.processBidirectionalText!=null&&hs.processStyledBidirectionalText!=null},getPluginURL:function(){return Ji}},Hl=function(){!hs.isLoading()&&!hs.isLoaded()&&Kn()==="deferred"&&Es()},Qo=function(C,V){this.zoom=C,V?(this.now=V.now,this.fadeDuration=V.fadeDuration,this.zoomHistory=V.zoomHistory,this.transition=V.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Kr,this.transition={})};Qo.prototype.isSupportedScript=function(C){return hi(C,hs.isLoaded())},Qo.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Qo.prototype.getCrossfadeParameters=function(){var C=this.zoom,V=C-Math.floor(C),se=this.crossFadingFactor();return C>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:V+(1-V)*se}:{fromScale:.5,toScale:1,t:1-(1-se)*V}};var _s=function(C,V){this.property=C,this.value=V,this.expression=I(V===void 0?C.specification.default:V,C.specification)};_s.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},_s.prototype.possiblyEvaluate=function(C,V,se){return this.property.possiblyEvaluate(this,C,V,se)};var gu=function(C){this.property=C,this.value=new _s(C,void 0)};gu.prototype.transitioned=function(C,V){return new cr(this.property,this.value,V,_({},C.transition,this.transition),C.now)},gu.prototype.untransitioned=function(){return new cr(this.property,this.value,null,{},0)};var el=function(C){this._properties=C,this._values=Object.create(C.defaultTransitionablePropertyValues)};el.prototype.getValue=function(C){return O(this._values[C].value.value)},el.prototype.setValue=function(C,V){this._values.hasOwnProperty(C)||(this._values[C]=new gu(this._values[C].property)),this._values[C].value=new _s(this._values[C].property,V===null?void 0:O(V))},el.prototype.getTransition=function(C){return O(this._values[C].transition)},el.prototype.setTransition=function(C,V){this._values.hasOwnProperty(C)||(this._values[C]=new gu(this._values[C].property)),this._values[C].transition=O(V)||void 0},el.prototype.serialize=function(){for(var C={},V=0,se=Object.keys(this._values);Vthis.end)return this.prior=null,ke;if(this.value.isDataDriven())return this.prior=null,ke;if(_eNe.zoomHistory.lastIntegerZoom?{from:se,to:_e}:{from:ke,to:_e}},C.prototype.interpolate=function(se){return se},C}(Na),Un=function(C){this.specification=C};Un.prototype.possiblyEvaluate=function(C,V,se,_e){if(C.value!==void 0)if(C.expression.kind==="constant"){var ke=C.expression.evaluate(V,null,{},se,_e);return this._calculate(ke,ke,ke,V)}else return this._calculate(C.expression.evaluate(new Qo(Math.floor(V.zoom-1),V)),C.expression.evaluate(new Qo(Math.floor(V.zoom),V)),C.expression.evaluate(new Qo(Math.floor(V.zoom+1),V)),V)},Un.prototype._calculate=function(C,V,se,_e){var ke=_e.zoom;return ke>_e.zoomHistory.lastIntegerZoom?{from:C,to:V}:{from:se,to:V}},Un.prototype.interpolate=function(C){return C};var Gn=function(C){this.specification=C};Gn.prototype.possiblyEvaluate=function(C,V,se,_e){return!!C.expression.evaluate(V,null,{},se,_e)},Gn.prototype.interpolate=function(){return!1};var ti=function(C){this.properties=C,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var V in C){var se=C[V];se.specification.overridable&&this.overridableProperties.push(V);var _e=this.defaultPropertyValues[V]=new _s(se,void 0),ke=this.defaultTransitionablePropertyValues[V]=new gu(se);this.defaultTransitioningPropertyValues[V]=ke.untransitioned(),this.defaultPossiblyEvaluatedValues[V]=_e.possiblyEvaluate({})}};zt("DataDrivenProperty",Na),zt("DataConstantProperty",Da),zt("CrossFadedDataDrivenProperty",Hn),zt("CrossFadedProperty",Un),zt("ColorRampProperty",Gn);var Wi="-transition",Ti=function(k){function C(V,se){if(k.call(this),this.id=V.id,this.type=V.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},V.type!=="custom"&&(V=V,this.metadata=V.metadata,this.minzoom=V.minzoom,this.maxzoom=V.maxzoom,V.type!=="background"&&(this.source=V.source,this.sourceLayer=V["source-layer"],this.filter=V.filter),se.layout&&(this._unevaluatedLayout=new xa(se.layout)),se.paint)){this._transitionablePaint=new el(se.paint);for(var _e in V.paint)this.setPaintProperty(_e,V.paint[_e],{validate:!1});for(var ke in V.layout)this.setLayoutProperty(ke,V.layout[ke],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new In(se.paint)}}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},C.prototype.getLayoutProperty=function(se){return se==="visibility"?this.visibility:this._unevaluatedLayout.getValue(se)},C.prototype.setLayoutProperty=function(se,_e,ke){if(ke===void 0&&(ke={}),_e!=null){var Ne="layers."+this.id+".layout."+se;if(this._validate(Al,Ne,se,_e,ke))return}if(se==="visibility"){this.visibility=_e;return}this._unevaluatedLayout.setValue(se,_e)},C.prototype.getPaintProperty=function(se){return z(se,Wi)?this._transitionablePaint.getTransition(se.slice(0,-Wi.length)):this._transitionablePaint.getValue(se)},C.prototype.setPaintProperty=function(se,_e,ke){if(ke===void 0&&(ke={}),_e!=null){var Ne="layers."+this.id+".paint."+se;if(this._validate(vl,Ne,se,_e,ke))return!1}if(z(se,Wi))return this._transitionablePaint.setTransition(se.slice(0,-Wi.length),_e||void 0),!1;var it=this._transitionablePaint._values[se],kt=it.property.specification["property-type"]==="cross-faded-data-driven",Ft=it.value.isDataDriven(),Gt=it.value;this._transitionablePaint.setValue(se,_e),this._handleSpecialPaintPropertyUpdate(se);var hr=this._transitionablePaint._values[se].value,Dr=hr.isDataDriven();return Dr||Ft||kt||this._handleOverridablePaintPropertyUpdate(se,Gt,hr)},C.prototype._handleSpecialPaintPropertyUpdate=function(se){},C.prototype._handleOverridablePaintPropertyUpdate=function(se,_e,ke){return!1},C.prototype.isHidden=function(se){return this.minzoom&&se=this.maxzoom?!0:this.visibility==="none"},C.prototype.updateTransitions=function(se){this._transitioningPaint=this._transitionablePaint.transitioned(se,this._transitioningPaint)},C.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},C.prototype.recalculate=function(se,_e){se.getCrossfadeParameters&&(this._crossfadeParameters=se.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(se,void 0,_e)),this.paint=this._transitioningPaint.possiblyEvaluate(se,void 0,_e)},C.prototype.serialize=function(){var se={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&&(se.layout=se.layout||{},se.layout.visibility=this.visibility),B(se,function(_e,ke){return _e!==void 0&&!(ke==="layout"&&!Object.keys(_e).length)&&!(ke==="paint"&&!Object.keys(_e).length)})},C.prototype._validate=function(se,_e,ke,Ne,it){return it===void 0&&(it={}),it&&it.validate===!1?!1:pu(this,se.call(xo,{key:_e,layerType:this.type,objectKey:ke,value:Ne,styleSpec:Qa,style:{glyphs:!0,sprite:!0}}))},C.prototype.is3D=function(){return!1},C.prototype.isTileClipped=function(){return!1},C.prototype.hasOffscreenPass=function(){return!1},C.prototype.resize=function(){},C.prototype.isStateDependent=function(){for(var se in this.paint._values){var _e=this.paint.get(se);if(!(!(_e instanceof cn)||!Qs(_e.property.specification))&&(_e.value.kind==="source"||_e.value.kind==="composite")&&_e.value.isStateDependent)return!0}return!1},C}(Pr),si={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Fn=function(C,V){this._structArray=C,this._pos1=V*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},qa=128,wn=5,Tn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};Tn.serialize=function(C,V){return C._trim(),V&&(C.isTransferred=!0,V.push(C.arrayBuffer)),{length:C.length,arrayBuffer:C.arrayBuffer}},Tn.deserialize=function(C){var V=Object.create(this.prototype);return V.arrayBuffer=C.arrayBuffer,V.length=C.length,V.capacity=C.arrayBuffer.byteLength/V.bytesPerElement,V._refreshViews(),V},Tn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Tn.prototype.clear=function(){this.length=0},Tn.prototype.resize=function(C){this.reserve(C),this.length=C},Tn.prototype.reserve=function(C){if(C>this.capacity){this.capacity=Math.max(C,Math.floor(this.capacity*wn),qa),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var V=this.uint8;this._refreshViews(),V&&this.uint8.set(V)}},Tn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function Ln(k,C){C===void 0&&(C=1);var V=0,se=0,_e=k.map(function(Ne){var it=Pn(Ne.type),kt=V=Ri(V,Math.max(C,it)),Ft=Ne.components||1;return se=Math.max(se,it),V+=it*Ft,{name:Ne.name,type:Ne.type,components:Ft,offset:kt}}),ke=Ri(V,Math.max(se,C));return{members:_e,size:ke,alignment:C}}function Pn(k){return si[k].BYTES_PER_ELEMENT}function Ri(k,C){return Math.ceil(k/C)*C}var Xn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e){var ke=this.length;return this.resize(ke+1),this.emplace(ke,se,_e)},C.prototype.emplace=function(se,_e,ke){var Ne=se*2;return this.int16[Ne+0]=_e,this.int16[Ne+1]=ke,se},C}(Tn);Xn.prototype.bytesPerElement=4,zt("StructArrayLayout2i4",Xn);var $i=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne){var it=this.length;return this.resize(it+1),this.emplace(it,se,_e,ke,Ne)},C.prototype.emplace=function(se,_e,ke,Ne,it){var kt=se*4;return this.int16[kt+0]=_e,this.int16[kt+1]=ke,this.int16[kt+2]=Ne,this.int16[kt+3]=it,se},C}(Tn);$i.prototype.bytesPerElement=8,zt("StructArrayLayout4i8",$i);var Cn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt){var Ft=this.length;return this.resize(Ft+1),this.emplace(Ft,se,_e,ke,Ne,it,kt)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft){var Gt=se*6;return this.int16[Gt+0]=_e,this.int16[Gt+1]=ke,this.int16[Gt+2]=Ne,this.int16[Gt+3]=it,this.int16[Gt+4]=kt,this.int16[Gt+5]=Ft,se},C}(Tn);Cn.prototype.bytesPerElement=12,zt("StructArrayLayout2i4i12",Cn);var Mn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt){var Ft=this.length;return this.resize(Ft+1),this.emplace(Ft,se,_e,ke,Ne,it,kt)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft){var Gt=se*4,hr=se*8;return this.int16[Gt+0]=_e,this.int16[Gt+1]=ke,this.uint8[hr+4]=Ne,this.uint8[hr+5]=it,this.uint8[hr+6]=kt,this.uint8[hr+7]=Ft,se},C}(Tn);Mn.prototype.bytesPerElement=8,zt("StructArrayLayout2i4ub8",Mn);var Si=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e){var ke=this.length;return this.resize(ke+1),this.emplace(ke,se,_e)},C.prototype.emplace=function(se,_e,ke){var Ne=se*2;return this.float32[Ne+0]=_e,this.float32[Ne+1]=ke,se},C}(Tn);Si.prototype.bytesPerElement=8,zt("StructArrayLayout2f8",Si);var yn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr){var Ir=this.length;return this.resize(Ir+1),this.emplace(Ir,se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir){var Xr=se*10;return this.uint16[Xr+0]=_e,this.uint16[Xr+1]=ke,this.uint16[Xr+2]=Ne,this.uint16[Xr+3]=it,this.uint16[Xr+4]=kt,this.uint16[Xr+5]=Ft,this.uint16[Xr+6]=Gt,this.uint16[Xr+7]=hr,this.uint16[Xr+8]=Dr,this.uint16[Xr+9]=Ir,se},C}(Tn);yn.prototype.bytesPerElement=20,zt("StructArrayLayout10ui20",yn);var gi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr){var ba=this.length;return this.resize(ba+1),this.emplace(ba,se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba){var Za=se*12;return this.int16[Za+0]=_e,this.int16[Za+1]=ke,this.int16[Za+2]=Ne,this.int16[Za+3]=it,this.uint16[Za+4]=kt,this.uint16[Za+5]=Ft,this.uint16[Za+6]=Gt,this.uint16[Za+7]=hr,this.int16[Za+8]=Dr,this.int16[Za+9]=Ir,this.int16[Za+10]=Xr,this.int16[Za+11]=ba,se},C}(Tn);gi.prototype.bytesPerElement=24,zt("StructArrayLayout4i4ui4i24",gi);var ri=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke){var Ne=this.length;return this.resize(Ne+1),this.emplace(Ne,se,_e,ke)},C.prototype.emplace=function(se,_e,ke,Ne){var it=se*3;return this.float32[it+0]=_e,this.float32[it+1]=ke,this.float32[it+2]=Ne,se},C}(Tn);ri.prototype.bytesPerElement=12,zt("StructArrayLayout3f12",ri);var ro=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var _e=this.length;return this.resize(_e+1),this.emplace(_e,se)},C.prototype.emplace=function(se,_e){var ke=se*1;return this.uint32[ke+0]=_e,se},C}(Tn);ro.prototype.bytesPerElement=4,zt("StructArrayLayout1ul4",ro);var es=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.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)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr){var Dr=this.length;return this.resize(Dr+1),this.emplace(Dr,se,_e,ke,Ne,it,kt,Ft,Gt,hr)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr){var Ir=se*10,Xr=se*5;return this.int16[Ir+0]=_e,this.int16[Ir+1]=ke,this.int16[Ir+2]=Ne,this.int16[Ir+3]=it,this.int16[Ir+4]=kt,this.int16[Ir+5]=Ft,this.uint32[Xr+3]=Gt,this.uint16[Ir+8]=hr,this.uint16[Ir+9]=Dr,se},C}(Tn);es.prototype.bytesPerElement=20,zt("StructArrayLayout6i1ul2ui20",es);var Fi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt){var Ft=this.length;return this.resize(Ft+1),this.emplace(Ft,se,_e,ke,Ne,it,kt)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft){var Gt=se*6;return this.int16[Gt+0]=_e,this.int16[Gt+1]=ke,this.int16[Gt+2]=Ne,this.int16[Gt+3]=it,this.int16[Gt+4]=kt,this.int16[Gt+5]=Ft,se},C}(Tn);Fi.prototype.bytesPerElement=12,zt("StructArrayLayout2i2i2i12",Fi);var no=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it){var kt=this.length;return this.resize(kt+1),this.emplace(kt,se,_e,ke,Ne,it)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt){var Ft=se*4,Gt=se*8;return this.float32[Ft+0]=_e,this.float32[Ft+1]=ke,this.float32[Ft+2]=Ne,this.int16[Gt+6]=it,this.int16[Gt+7]=kt,se},C}(Tn);no.prototype.bytesPerElement=16,zt("StructArrayLayout2f1f2i16",no);var oi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne){var it=this.length;return this.resize(it+1),this.emplace(it,se,_e,ke,Ne)},C.prototype.emplace=function(se,_e,ke,Ne,it){var kt=se*12,Ft=se*3;return this.uint8[kt+0]=_e,this.uint8[kt+1]=ke,this.float32[Ft+1]=Ne,this.float32[Ft+2]=it,se},C}(Tn);oi.prototype.bytesPerElement=12,zt("StructArrayLayout2ub2f12",oi);var Xo=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke){var Ne=this.length;return this.resize(Ne+1),this.emplace(Ne,se,_e,ke)},C.prototype.emplace=function(se,_e,ke,Ne){var it=se*3;return this.uint16[it+0]=_e,this.uint16[it+1]=ke,this.uint16[it+2]=Ne,se},C}(Tn);Xo.prototype.bytesPerElement=6,zt("StructArrayLayout3ui6",Xo);var ys=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.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)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a){var vn=this.length;return this.resize(vn+1),this.emplace(vn,se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a,vn){var bn=se*24,Dn=se*12,ui=se*48;return this.int16[bn+0]=_e,this.int16[bn+1]=ke,this.uint16[bn+2]=Ne,this.uint16[bn+3]=it,this.uint32[Dn+2]=kt,this.uint32[Dn+3]=Ft,this.uint32[Dn+4]=Gt,this.uint16[bn+10]=hr,this.uint16[bn+11]=Dr,this.uint16[bn+12]=Ir,this.float32[Dn+7]=Xr,this.float32[Dn+8]=ba,this.uint8[ui+36]=Za,this.uint8[ui+37]=Ra,this.uint8[ui+38]=dn,this.uint32[Dn+10]=$a,this.int16[bn+22]=vn,se},C}(Tn);ys.prototype.bytesPerElement=48,zt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ys);var xs=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.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)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a,vn,bn,Dn,ui,ni,Zi,Mi,Bi,Ho,Xi,Qi){var cs=this.length;return this.resize(cs+1),this.emplace(cs,se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a,vn,bn,Dn,ui,ni,Zi,Mi,Bi,Ho,Xi,Qi)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a,vn,bn,Dn,ui,ni,Zi,Mi,Bi,Ho,Xi,Qi,cs){var Oo=se*34,rl=se*17;return this.int16[Oo+0]=_e,this.int16[Oo+1]=ke,this.int16[Oo+2]=Ne,this.int16[Oo+3]=it,this.int16[Oo+4]=kt,this.int16[Oo+5]=Ft,this.int16[Oo+6]=Gt,this.int16[Oo+7]=hr,this.uint16[Oo+8]=Dr,this.uint16[Oo+9]=Ir,this.uint16[Oo+10]=Xr,this.uint16[Oo+11]=ba,this.uint16[Oo+12]=Za,this.uint16[Oo+13]=Ra,this.uint16[Oo+14]=dn,this.uint16[Oo+15]=$a,this.uint16[Oo+16]=vn,this.uint16[Oo+17]=bn,this.uint16[Oo+18]=Dn,this.uint16[Oo+19]=ui,this.uint16[Oo+20]=ni,this.uint16[Oo+21]=Zi,this.uint16[Oo+22]=Mi,this.uint32[rl+12]=Bi,this.float32[rl+13]=Ho,this.float32[rl+14]=Xi,this.float32[rl+15]=Qi,this.float32[rl+16]=cs,se},C}(Tn);xs.prototype.bytesPerElement=68,zt("StructArrayLayout8i15ui1ul4f68",xs);var Xs=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var _e=this.length;return this.resize(_e+1),this.emplace(_e,se)},C.prototype.emplace=function(se,_e){var ke=se*1;return this.float32[ke+0]=_e,se},C}(Tn);Xs.prototype.bytesPerElement=4,zt("StructArrayLayout1f4",Xs);var Ps=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke){var Ne=this.length;return this.resize(Ne+1),this.emplace(Ne,se,_e,ke)},C.prototype.emplace=function(se,_e,ke,Ne){var it=se*3;return this.int16[it+0]=_e,this.int16[it+1]=ke,this.int16[it+2]=Ne,se},C}(Tn);Ps.prototype.bytesPerElement=6,zt("StructArrayLayout3i6",Ps);var Mu=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke){var Ne=this.length;return this.resize(Ne+1),this.emplace(Ne,se,_e,ke)},C.prototype.emplace=function(se,_e,ke,Ne){var it=se*2,kt=se*4;return this.uint32[it+0]=_e,this.uint16[kt+2]=ke,this.uint16[kt+3]=Ne,se},C}(Tn);Mu.prototype.bytesPerElement=8,zt("StructArrayLayout1ul2ui8",Mu);var dl=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e){var ke=this.length;return this.resize(ke+1),this.emplace(ke,se,_e)},C.prototype.emplace=function(se,_e,ke){var Ne=se*2;return this.uint16[Ne+0]=_e,this.uint16[Ne+1]=ke,se},C}(Tn);dl.prototype.bytesPerElement=4,zt("StructArrayLayout2ui4",dl);var Eu=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var _e=this.length;return this.resize(_e+1),this.emplace(_e,se)},C.prototype.emplace=function(se,_e){var ke=se*1;return this.uint16[ke+0]=_e,se},C}(Tn);Eu.prototype.bytesPerElement=2,zt("StructArrayLayout1ui2",Eu);var ac=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne){var it=this.length;return this.resize(it+1),this.emplace(it,se,_e,ke,Ne)},C.prototype.emplace=function(se,_e,ke,Ne,it){var kt=se*4;return this.float32[kt+0]=_e,this.float32[kt+1]=ke,this.float32[kt+2]=Ne,this.float32[kt+3]=it,se},C}(Tn);ac.prototype.bytesPerElement=16,zt("StructArrayLayout4f16",ac);var Lc=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var V={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 V.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},V.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},V.x1.get=function(){return this._structArray.int16[this._pos2+2]},V.y1.get=function(){return this._structArray.int16[this._pos2+3]},V.x2.get=function(){return this._structArray.int16[this._pos2+4]},V.y2.get=function(){return this._structArray.int16[this._pos2+5]},V.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},V.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},V.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},V.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(C.prototype,V),C}(Fn);Lc.prototype.size=20;var Pf=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new Lc(this,se)},C}(es);zt("CollisionBoxArray",Pf);var su=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var V={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 V.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},V.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},V.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},V.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},V.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},V.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},V.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},V.segment.get=function(){return this._structArray.uint16[this._pos2+10]},V.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},V.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},V.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},V.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},V.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},V.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},V.placedOrientation.set=function(se){this._structArray.uint8[this._pos1+37]=se},V.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},V.hidden.set=function(se){this._structArray.uint8[this._pos1+38]=se},V.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},V.crossTileID.set=function(se){this._structArray.uint32[this._pos4+10]=se},V.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(C.prototype,V),C}(Fn);su.prototype.size=48;var zu=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new su(this,se)},C}(ys);zt("PlacedSymbolArray",zu);var Fo=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var V={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 V.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},V.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},V.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},V.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},V.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},V.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},V.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},V.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},V.key.get=function(){return this._structArray.uint16[this._pos2+8]},V.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},V.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},V.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},V.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},V.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},V.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},V.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},V.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},V.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},V.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},V.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},V.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},V.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},V.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},V.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},V.crossTileID.set=function(se){this._structArray.uint32[this._pos4+12]=se},V.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},V.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},V.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},V.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(C.prototype,V),C}(Fn);Fo.prototype.size=68;var nc=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new Fo(this,se)},C}(xs);zt("SymbolInstanceArray",nc);var ll=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getoffsetX=function(se){return this.float32[se*1+0]},C}(Xs);zt("GlyphOffsetArray",ll);var Sl=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getx=function(se){return this.int16[se*3+0]},C.prototype.gety=function(se){return this.int16[se*3+1]},C.prototype.gettileUnitDistanceFromAnchor=function(se){return this.int16[se*3+2]},C}(Ps);zt("SymbolLineVertexArray",Sl);var qc=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var V={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return V.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},V.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},V.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(C.prototype,V),C}(Fn);qc.prototype.size=8;var Hc=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new qc(this,se)},C}(Mu);zt("FeatureIndexArray",Hc);var ss=Ln([{name:"a_pos",components:2,type:"Int16"}],4),js=ss.members,ls=function(C){C===void 0&&(C=[]),this.segments=C};ls.prototype.prepareSegment=function(C,V,se,_e){var ke=this.segments[this.segments.length-1];return C>ls.MAX_VERTEX_ARRAY_LENGTH&&U("Max vertices per segment is "+ls.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+C),(!ke||ke.vertexLength+C>ls.MAX_VERTEX_ARRAY_LENGTH||ke.sortKey!==_e)&&(ke={vertexOffset:V.length,primitiveOffset:se.length,vertexLength:0,primitiveLength:0},_e!==void 0&&(ke.sortKey=_e),this.segments.push(ke)),ke},ls.prototype.get=function(){return this.segments},ls.prototype.destroy=function(){for(var C=0,V=this.segments;C>>16)*kt&65535)<<16)&4294967295,Gt=Gt<<15|Gt>>>17,Gt=(Gt&65535)*Ft+(((Gt>>>16)*Ft&65535)<<16)&4294967295,Ne^=Gt,Ne=Ne<<13|Ne>>>19,it=(Ne&65535)*5+(((Ne>>>16)*5&65535)<<16)&4294967295,Ne=(it&65535)+27492+(((it>>>16)+58964&65535)<<16);switch(Gt=0,_e){case 3:Gt^=(V.charCodeAt(hr+2)&255)<<16;case 2:Gt^=(V.charCodeAt(hr+1)&255)<<8;case 1:Gt^=V.charCodeAt(hr)&255,Gt=(Gt&65535)*kt+(((Gt>>>16)*kt&65535)<<16)&4294967295,Gt=Gt<<15|Gt>>>17,Gt=(Gt&65535)*Ft+(((Gt>>>16)*Ft&65535)<<16)&4294967295,Ne^=Gt}return Ne^=V.length,Ne^=Ne>>>16,Ne=(Ne&65535)*2246822507+(((Ne>>>16)*2246822507&65535)<<16)&4294967295,Ne^=Ne>>>13,Ne=(Ne&65535)*3266489909+(((Ne>>>16)*3266489909&65535)<<16)&4294967295,Ne^=Ne>>>16,Ne>>>0}k.exports=C}),te=t(function(k){function C(V,se){for(var _e=V.length,ke=se^_e,Ne=0,it;_e>=4;)it=V.charCodeAt(Ne)&255|(V.charCodeAt(++Ne)&255)<<8|(V.charCodeAt(++Ne)&255)<<16|(V.charCodeAt(++Ne)&255)<<24,it=(it&65535)*1540483477+(((it>>>16)*1540483477&65535)<<16),it^=it>>>24,it=(it&65535)*1540483477+(((it>>>16)*1540483477&65535)<<16),ke=(ke&65535)*1540483477+(((ke>>>16)*1540483477&65535)<<16)^it,_e-=4,++Ne;switch(_e){case 3:ke^=(V.charCodeAt(Ne+2)&255)<<16;case 2:ke^=(V.charCodeAt(Ne+1)&255)<<8;case 1:ke^=V.charCodeAt(Ne)&255,ke=(ke&65535)*1540483477+(((ke>>>16)*1540483477&65535)<<16)}return ke^=ke>>>13,ke=(ke&65535)*1540483477+(((ke>>>16)*1540483477&65535)<<16),ke^=ke>>>15,ke>>>0}k.exports=C}),me=de,Ue=de,tt=te;me.murmur3=Ue,me.murmur2=tt;var ft=function(){this.ids=[],this.positions=[],this.indexed=!1};ft.prototype.add=function(C,V,se,_e){this.ids.push(bt(C)),this.positions.push(V,se,_e)},ft.prototype.getPositions=function(C){for(var V=bt(C),se=0,_e=this.ids.length-1;se<_e;){var ke=se+_e>>1;this.ids[ke]>=V?_e=ke:se=ke+1}for(var Ne=[];this.ids[se]===V;){var it=this.positions[3*se],kt=this.positions[3*se+1],Ft=this.positions[3*se+2];Ne.push({index:it,start:kt,end:Ft}),se++}return Ne},ft.serialize=function(C,V){var se=new Float64Array(C.ids),_e=new Uint32Array(C.positions);return It(se,_e,0,se.length-1),V&&V.push(se.buffer,_e.buffer),{ids:se,positions:_e}},ft.deserialize=function(C){var V=new ft;return V.ids=C.ids,V.positions=C.positions,V.indexed=!0,V};var st=Math.pow(2,53)-1;function bt(k){var C=+k;return!isNaN(C)&&C<=st?C:me(String(k))}function It(k,C,V,se){for(;V>1],ke=V-1,Ne=se+1;;){do ke++;while(k[ke]<_e);do Ne--;while(k[Ne]>_e);if(ke>=Ne)break;Jt(k,ke,Ne),Jt(C,3*ke,3*Ne),Jt(C,3*ke+1,3*Ne+1),Jt(C,3*ke+2,3*Ne+2)}Ne-VNe.x+1||ktNe.y+1)&&U("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return V}function Ds(k,C){return{type:k.type,id:k.id,properties:k.properties,geometry:C?us(k):[]}}function rs(k,C,V,se,_e){k.emplaceBack(C*2+(se+1)/2,V*2+(_e+1)/2)}var ul=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(V){return V.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new Xn,this.indexArray=new Xo,this.segments=new ls,this.programConfigurations=new fn(C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter(function(V){return V.isStateDependent()}).map(function(V){return V.id})};ul.prototype.populate=function(C,V,se){var _e=this.layers[0],ke=[],Ne=null;_e.type==="circle"&&(Ne=_e.layout.get("circle-sort-key"));for(var it=0,kt=C;it=ai||Dr<0||Dr>=ai)){var Ir=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,C.sortKey),Xr=Ir.vertexLength;rs(this.layoutVertexArray,hr,Dr,-1,-1),rs(this.layoutVertexArray,hr,Dr,1,-1),rs(this.layoutVertexArray,hr,Dr,1,1),rs(this.layoutVertexArray,hr,Dr,-1,1),this.indexArray.emplaceBack(Xr,Xr+1,Xr+2),this.indexArray.emplaceBack(Xr,Xr+3,Xr+2),Ir.vertexLength+=4,Ir.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,se,{},_e)},zt("CircleBucket",ul,{omit:["layers"]});function Uo(k,C){for(var V=0;V=3){for(var ke=0;ke<_e.length;ke++)if(Rf(k,_e[ke]))return!0}if(dh(k,_e,V))return!0}return!1}function dh(k,C,V){if(k.length>1){if(ph(k,C))return!0;for(var se=0;se1?k.distSqr(V):k.distSqr(V.sub(C)._mult(_e)._add(C))}function Rh(k,C){for(var V=!1,se,_e,ke,Ne=0;NeC.y!=ke.y>C.y&&C.x<(ke.x-_e.x)*(C.y-_e.y)/(ke.y-_e.y)+_e.x&&(V=!V)}return V}function Rf(k,C){for(var V=!1,se=0,_e=k.length-1;seC.y!=Ne.y>C.y&&C.x<(Ne.x-ke.x)*(C.y-ke.y)/(Ne.y-ke.y)+ke.x&&(V=!V)}return V}function Dh(k,C,V,se,_e){for(var ke=0,Ne=k;ke=it.x&&_e>=it.y)return!0}var kt=[new i(C,V),new i(C,_e),new i(se,_e),new i(se,V)];if(k.length>2)for(var Ft=0,Gt=kt;Ft_e.x&&C.x>_e.x||k.y_e.y&&C.y>_e.y)return!1;var ke=Z(k,C,V[0]);return ke!==Z(k,C,V[1])||ke!==Z(k,C,V[2])||ke!==Z(k,C,V[3])}function Df(k,C,V){var se=C.paint.get(k).value;return se.kind==="constant"?se.value:V.programConfigurations.get(C.id).getMaxValue(k)}function gh(k){return Math.sqrt(k[0]*k[0]+k[1]*k[1])}function Eh(k,C,V,se,_e){if(!C[0]&&!C[1])return k;var ke=i.convert(C)._mult(_e);V==="viewport"&&ke._rotate(-se);for(var Ne=[],it=0;it0&&(ke=1/Math.sqrt(ke)),k[0]=C[0]*ke,k[1]=C[1]*ke,k[2]=C[2]*ke,k}function Tx(k,C){return k[0]*C[0]+k[1]*C[1]+k[2]*C[2]}function Ax(k,C,V){var se=C[0],_e=C[1],ke=C[2],Ne=V[0],it=V[1],kt=V[2];return k[0]=_e*kt-ke*it,k[1]=ke*Ne-se*kt,k[2]=se*it-_e*Ne,k}function Sx(k,C,V){var se=C[0],_e=C[1],ke=C[2];return k[0]=se*V[0]+_e*V[3]+ke*V[6],k[1]=se*V[1]+_e*V[4]+ke*V[7],k[2]=se*V[2]+_e*V[5]+ke*V[8],k}var Mx=Iv;(function(){var k=Pv();return function(C,V,se,_e,ke,Ne){var it,kt;for(V||(V=3),se||(se=0),_e?kt=Math.min(_e*V+se,C.length):kt=C.length,it=se;itk.width||_e.height>k.height||V.x>k.width-_e.width||V.y>k.height-_e.height)throw new RangeError("out of range source coordinates for image copy");if(_e.width>C.width||_e.height>C.height||se.x>C.width-_e.width||se.y>C.height-_e.height)throw new RangeError("out of range destination coordinates for image copy");for(var Ne=k.data,it=C.data,kt=0;kt<_e.height;kt++)for(var Ft=((V.y+kt)*k.width+V.x)*ke,Gt=((se.y+kt)*C.width+se.x)*ke,hr=0;hr<_e.width*ke;hr++)it[Gt+hr]=Ne[Ft+hr];return C}var Ic=function(C,V){vg(this,C,1,V)};Ic.prototype.resize=function(C){dg(this,C,1)},Ic.prototype.clone=function(){return new Ic({width:this.width,height:this.height},new Uint8Array(this.data))},Ic.copy=function(C,V,se,_e,ke){a0(C,V,se,_e,ke,1)};var bf=function(C,V){vg(this,C,4,V)};bf.prototype.resize=function(C){dg(this,C,4)},bf.prototype.replace=function(C,V){V?this.data.set(C):C instanceof Uint8ClampedArray?this.data=new Uint8Array(C.buffer):this.data=C},bf.prototype.clone=function(){return new bf({width:this.width,height:this.height},new Uint8Array(this.data))},bf.copy=function(C,V,se,_e,ke){a0(C,V,se,_e,ke,4)},zt("AlphaImage",Ic),zt("RGBAImage",bf);var tm=new ti({"heatmap-radius":new Na(Qa.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Na(Qa.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Da(Qa.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Gn(Qa.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Da(Qa.paint_heatmap["heatmap-opacity"])}),Rv={paint:tm};function _d(k){var C={},V=k.resolution||256,se=k.clips?k.clips.length:1,_e=k.image||new bf({width:V,height:se}),ke=function(dn,$a,vn){C[k.evaluationKey]=vn;var bn=k.expression.evaluate(C);_e.data[dn+$a+0]=Math.floor(bn.r*255/bn.a),_e.data[dn+$a+1]=Math.floor(bn.g*255/bn.a),_e.data[dn+$a+2]=Math.floor(bn.b*255/bn.a),_e.data[dn+$a+3]=Math.floor(bn.a*255)};if(k.clips)for(var Ft=0,Gt=0;Ft80*V){it=Ft=k[0],kt=Gt=k[1];for(var Xr=V;Xr<_e;Xr+=V)hr=k[Xr],Dr=k[Xr+1],hrFt&&(Ft=hr),Dr>Gt&&(Gt=Dr);Ir=Math.max(Ft-it,Gt-kt),Ir=Ir!==0?1/Ir:0}return Jv(ke,Ne,V,it,kt,Ir),Ne}function pg(k,C,V,se,_e){var ke,Ne;if(_e===bg(k,C,V,se)>0)for(ke=C;ke=C;ke-=se)Ne=om(ke,k[ke],k[ke+1],Ne);return Ne&&bd(Ne,Ne.next)&&(gp(Ne),Ne=Ne.next),Ne}function pv(k,C){if(!k)return k;C||(C=k);var V=k,se;do if(se=!1,!V.steiner&&(bd(V,V.next)||Hu(V.prev,V,V.next)===0)){if(gp(V),V=C=V.prev,V===V.next)break;se=!0}else V=V.next;while(se||V!==C);return C}function Jv(k,C,V,se,_e,ke,Ne){if(k){!Ne&&ke&&yg(k,se,_e,ke);for(var it=k,kt,Ft;k.prev!==k.next;){if(kt=k.prev,Ft=k.next,ke?Rx(k,se,_e,ke):gg(k)){C.push(kt.i/V),C.push(k.i/V),C.push(Ft.i/V),gp(k),k=Ft.next,it=Ft.next;continue}if(k=Ft,k===it){Ne?Ne===1?(k=Dx(pv(k),C,V),Jv(k,C,V,se,_e,ke,2)):Ne===2&&am(k,C,V,se,_e,ke):Jv(pv(k),C,V,se,_e,ke,1);break}}}}function gg(k){var C=k.prev,V=k,se=k.next;if(Hu(C,V,se)>=0)return!1;for(var _e=k.next.next;_e!==k.prev;){if(zv(C.x,C.y,V.x,V.y,se.x,se.y,_e.x,_e.y)&&Hu(_e.prev,_e,_e.next)>=0)return!1;_e=_e.next}return!0}function Rx(k,C,V,se){var _e=k.prev,ke=k,Ne=k.next;if(Hu(_e,ke,Ne)>=0)return!1;for(var it=_e.xke.x?_e.x>Ne.x?_e.x:Ne.x:ke.x>Ne.x?ke.x:Ne.x,Gt=_e.y>ke.y?_e.y>Ne.y?_e.y:Ne.y:ke.y>Ne.y?ke.y:Ne.y,hr=mg(it,kt,C,V,se),Dr=mg(Ft,Gt,C,V,se),Ir=k.prevZ,Xr=k.nextZ;Ir&&Ir.z>=hr&&Xr&&Xr.z<=Dr;){if(Ir!==k.prev&&Ir!==k.next&&zv(_e.x,_e.y,ke.x,ke.y,Ne.x,Ne.y,Ir.x,Ir.y)&&Hu(Ir.prev,Ir,Ir.next)>=0||(Ir=Ir.prevZ,Xr!==k.prev&&Xr!==k.next&&zv(_e.x,_e.y,ke.x,ke.y,Ne.x,Ne.y,Xr.x,Xr.y)&&Hu(Xr.prev,Xr,Xr.next)>=0))return!1;Xr=Xr.nextZ}for(;Ir&&Ir.z>=hr;){if(Ir!==k.prev&&Ir!==k.next&&zv(_e.x,_e.y,ke.x,ke.y,Ne.x,Ne.y,Ir.x,Ir.y)&&Hu(Ir.prev,Ir,Ir.next)>=0)return!1;Ir=Ir.prevZ}for(;Xr&&Xr.z<=Dr;){if(Xr!==k.prev&&Xr!==k.next&&zv(_e.x,_e.y,ke.x,ke.y,Ne.x,Ne.y,Xr.x,Xr.y)&&Hu(Xr.prev,Xr,Xr.next)>=0)return!1;Xr=Xr.nextZ}return!0}function Dx(k,C,V){var se=k;do{var _e=se.prev,ke=se.next.next;!bd(_e,ke)&&$v(_e,se,se.next,ke)&&wd(_e,ke)&&wd(ke,_e)&&(C.push(_e.i/V),C.push(se.i/V),C.push(ke.i/V),gp(se),gp(se.next),se=k=ke),se=se.next}while(se!==k);return pv(se)}function am(k,C,V,se,_e,ke){var Ne=k;do{for(var it=Ne.next.next;it!==Ne.prev;){if(Ne.i!==it.i&&Fx(Ne,it)){var kt=xg(Ne,it);Ne=pv(Ne,Ne.next),kt=pv(kt,kt.next),Jv(Ne,C,V,se,_e,ke),Jv(kt,C,V,se,_e,ke);return}it=it.next}Ne=Ne.next}while(Ne!==k)}function nm(k,C,V,se){var _e=[],ke,Ne,it,kt,Ft;for(ke=0,Ne=C.length;ke=V.next.y&&V.next.y!==V.y){var it=V.x+(_e-V.y)*(V.next.x-V.x)/(V.next.y-V.y);if(it<=se&&it>ke){if(ke=it,it===se){if(_e===V.y)return V;if(_e===V.next.y)return V.next}Ne=V.x=V.x&&V.x>=Ft&&se!==V.x&&zv(_eNe.x||V.x===Ne.x&&im(Ne,V)))&&(Ne=V,hr=Dr)),V=V.next;while(V!==kt);return Ne}function im(k,C){return Hu(k.prev,k,C.prev)<0&&Hu(C.next,k,k.next)<0}function yg(k,C,V,se){var _e=k;do _e.z===null&&(_e.z=mg(_e.x,_e.y,C,V,se)),_e.prevZ=_e.prev,_e.nextZ=_e.next,_e=_e.next;while(_e!==k);_e.prevZ.nextZ=null,_e.prevZ=null,zx(_e)}function zx(k){var C,V,se,_e,ke,Ne,it,kt,Ft=1;do{for(V=k,k=null,ke=null,Ne=0;V;){for(Ne++,se=V,it=0,C=0;C0||kt>0&&se;)it!==0&&(kt===0||!se||V.z<=se.z)?(_e=V,V=V.nextZ,it--):(_e=se,se=se.nextZ,kt--),ke?ke.nextZ=_e:k=_e,_e.prevZ=ke,ke=_e;V=se}ke.nextZ=null,Ft*=2}while(Ne>1);return k}function mg(k,C,V,se,_e){return k=32767*(k-V)*_e,C=32767*(C-se)*_e,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,C=(C|C<<8)&16711935,C=(C|C<<4)&252645135,C=(C|C<<2)&858993459,C=(C|C<<1)&1431655765,k|C<<1}function l0(k){var C=k,V=k;do(C.x=0&&(k-Ne)*(se-it)-(V-Ne)*(C-it)>=0&&(V-Ne)*(ke-it)-(_e-Ne)*(se-it)>=0}function Fx(k,C){return k.next.i!==C.i&&k.prev.i!==C.i&&!_g(k,C)&&(wd(k,C)&&wd(C,k)&&u0(k,C)&&(Hu(k.prev,k,C.prev)||Hu(k,C.prev,C))||bd(k,C)&&Hu(k.prev,k,k.next)>0&&Hu(C.prev,C,C.next)>0)}function Hu(k,C,V){return(C.y-k.y)*(V.x-C.x)-(C.x-k.x)*(V.y-C.y)}function bd(k,C){return k.x===C.x&&k.y===C.y}function $v(k,C,V,se){var _e=pp(Hu(k,C,V)),ke=pp(Hu(k,C,se)),Ne=pp(Hu(V,se,k)),it=pp(Hu(V,se,C));return!!(_e!==ke&&Ne!==it||_e===0&&dp(k,V,C)||ke===0&&dp(k,se,C)||Ne===0&&dp(V,k,se)||it===0&&dp(V,C,se))}function dp(k,C,V){return C.x<=Math.max(k.x,V.x)&&C.x>=Math.min(k.x,V.x)&&C.y<=Math.max(k.y,V.y)&&C.y>=Math.min(k.y,V.y)}function pp(k){return k>0?1:k<0?-1:0}function _g(k,C){var V=k;do{if(V.i!==k.i&&V.next.i!==k.i&&V.i!==C.i&&V.next.i!==C.i&&$v(V,V.next,k,C))return!0;V=V.next}while(V!==k);return!1}function wd(k,C){return Hu(k.prev,k,k.next)<0?Hu(k,C,k.next)>=0&&Hu(k,k.prev,C)>=0:Hu(k,C,k.prev)<0||Hu(k,k.next,C)<0}function u0(k,C){var V=k,se=!1,_e=(k.x+C.x)/2,ke=(k.y+C.y)/2;do V.y>ke!=V.next.y>ke&&V.next.y!==V.y&&_e<(V.next.x-V.x)*(ke-V.y)/(V.next.y-V.y)+V.x&&(se=!se),V=V.next;while(V!==k);return se}function xg(k,C){var V=new c0(k.i,k.x,k.y),se=new c0(C.i,C.x,C.y),_e=k.next,ke=C.prev;return k.next=C,C.prev=k,V.next=_e,_e.prev=V,se.next=V,V.prev=se,ke.next=se,se.prev=ke,se}function om(k,C,V,se){var _e=new c0(k,C,V);return se?(_e.next=se.next,_e.prev=se,se.next.prev=_e,se.next=_e):(_e.prev=_e,_e.next=_e),_e}function gp(k){k.next.prev=k.prev,k.prev.next=k.next,k.prevZ&&(k.prevZ.nextZ=k.nextZ),k.nextZ&&(k.nextZ.prevZ=k.prevZ)}function c0(k,C,V){this.i=k,this.x=C,this.y=V,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}s0.deviation=function(k,C,V,se){var _e=C&&C.length,ke=_e?C[0]*V:k.length,Ne=Math.abs(bg(k,0,ke,V));if(_e)for(var it=0,kt=C.length;it0&&(se+=k[_e-1].length,V.holes.push(se))}return V},o0.default=rm;function Ox(k,C,V,se,_e){sm(k,C,V,se||k.length-1,_e||wg)}function sm(k,C,V,se,_e){for(;se>V;){if(se-V>600){var ke=se-V+1,Ne=C-V+1,it=Math.log(ke),kt=.5*Math.exp(2*it/3),Ft=.5*Math.sqrt(it*kt*(ke-kt)/ke)*(Ne-ke/2<0?-1:1),Gt=Math.max(V,Math.floor(C-Ne*kt/ke+Ft)),hr=Math.min(se,Math.floor(C+(ke-Ne)*kt/ke+Ft));sm(k,C,Gt,hr,_e)}var Dr=k[C],Ir=V,Xr=se;for(yp(k,V,C),_e(k[se],Dr)>0&&yp(k,V,se);Ir0;)Xr--}_e(k[V],Dr)===0?yp(k,V,Xr):(Xr++,yp(k,Xr,se)),Xr<=C&&(V=Xr+1),C<=Xr&&(se=Xr-1)}}function yp(k,C,V){var se=k[C];k[C]=k[V],k[V]=se}function wg(k,C){return kC?1:0}function Qh(k,C){var V=k.length;if(V<=1)return[k];for(var se=[],_e,ke,Ne=0;Ne1)for(var kt=0;kt>3}if(se--,V===1||V===2)_e+=k.readSVarint(),ke+=k.readSVarint(),V===1&&(it&&Ne.push(it),it=[]),it.push(new i(_e,ke));else if(V===7)it&&it.push(it[0].clone());else throw new Error("unknown command "+V)}return it&&Ne.push(it),Ne},Qv.prototype.bbox=function(){var k=this._pbf;k.pos=this._geometry;for(var C=k.readVarint()+k.pos,V=1,se=0,_e=0,ke=0,Ne=1/0,it=-1/0,kt=1/0,Ft=-1/0;k.pos>3}if(se--,V===1||V===2)_e+=k.readSVarint(),ke+=k.readSVarint(),_eit&&(it=_e),keFt&&(Ft=ke);else if(V!==7)throw new Error("unknown command "+V)}return[Ne,kt,it,Ft]},Qv.prototype.toGeoJSON=function(k,C,V){var se=this.extent*Math.pow(2,V),_e=this.extent*k,ke=this.extent*C,Ne=this.loadGeometry(),it=Qv.types[this.type],kt,Ft;function Gt(Ir){for(var Xr=0;Xr>3;C=se===1?k.readString():se===2?k.readFloat():se===3?k.readDouble():se===4?k.readVarint64():se===5?k.readVarint():se===6?k.readSVarint():se===7?k.readBoolean():null}return C}gm.prototype.feature=function(k){if(k<0||k>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[k];var C=this._pbf.readVarint()+this._pbf.pos;return new Td(this._pbf,C,this.extent,this._keys,this._values)};var mm=_m;function _m(k,C){this.layers=k.readFields(xm,{},C)}function xm(k,C,V){if(k===3){var se=new Sg(V,V.readVarint()+V.pos);se.length&&(C[se.name]=se)}}var bm=mm,Bx=Td,Nx=Sg,ed={VectorTile:bm,VectorTileFeature:Bx,VectorTileLayer:Nx},Ad=ed.VectorTileFeature.types,wm=500,Sd=Math.pow(2,13);function Md(k,C,V,se,_e,ke,Ne,it){k.emplaceBack(C,V,Math.floor(se*Sd)*2+Ne,_e*Sd*2,ke*Sd*2,Math.round(it))}var _h=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(V){return V.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new Cn,this.indexArray=new Xo,this.programConfigurations=new fn(C.layers,C.zoom),this.segments=new ls,this.stateDependentLayerIds=this.layers.filter(function(V){return V.isStateDependent()}).map(function(V){return V.id})};_h.prototype.populate=function(C,V,se){this.features=[],this.hasPattern=f0("fill-extrusion",this.layers,V);for(var _e=0,ke=C;_e=1){var vn=Za[dn-1];if(!v0($a,vn)){Ir.vertexLength+4>ls.MAX_VERTEX_ARRAY_LENGTH&&(Ir=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var bn=$a.sub(vn)._perp()._unit(),Dn=vn.dist($a);Ra+Dn>32768&&(Ra=0),Md(this.layoutVertexArray,$a.x,$a.y,bn.x,bn.y,0,0,Ra),Md(this.layoutVertexArray,$a.x,$a.y,bn.x,bn.y,0,1,Ra),Ra+=Dn,Md(this.layoutVertexArray,vn.x,vn.y,bn.x,bn.y,0,0,Ra),Md(this.layoutVertexArray,vn.x,vn.y,bn.x,bn.y,0,1,Ra);var ui=Ir.vertexLength;this.indexArray.emplaceBack(ui,ui+2,ui+1),this.indexArray.emplaceBack(ui+1,ui+2,ui+3),Ir.vertexLength+=4,Ir.primitiveLength+=2}}}}if(Ir.vertexLength+Ft>ls.MAX_VERTEX_ARRAY_LENGTH&&(Ir=this.segments.prepareSegment(Ft,this.layoutVertexArray,this.indexArray)),Ad[C.type]==="Polygon"){for(var ni=[],Zi=[],Mi=Ir.vertexLength,Bi=0,Ho=kt;Biai)||k.y===C.y&&(k.y<0||k.y>ai)}function d0(k){return k.every(function(C){return C.x<0})||k.every(function(C){return C.x>ai})||k.every(function(C){return C.y<0})||k.every(function(C){return C.y>ai})}var Ux=new ti({"fill-extrusion-opacity":new Da(Qa["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Na(Qa["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Da(Qa["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Da(Qa["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Hn(Qa["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Na(Qa["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Na(Qa["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Da(Qa["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),jx={paint:Ux},Vx=function(k){function C(V){k.call(this,V,jx)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.createBucket=function(se){return new _h(se)},C.prototype.queryRadius=function(){return gh(this.paint.get("fill-extrusion-translate"))},C.prototype.is3D=function(){return!0},C.prototype.queryIntersectsFeature=function(se,_e,ke,Ne,it,kt,Ft,Gt){var hr=Eh(se,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),kt.angle,Ft),Dr=this.paint.get("fill-extrusion-height").evaluate(_e,ke),Ir=this.paint.get("fill-extrusion-base").evaluate(_e,ke),Xr=Tm(hr,Gt,kt,0),ba=Mg(Ne,Ir,Dr,Gt),Za=ba[0],Ra=ba[1];return Ov(Za,Ra,Xr)},C}(Ti);function ev(k,C){return k.x*C.x+k.y*C.y}function sf(k,C){if(k.length===1){for(var V=0,se=C[V++],_e;!_e||se.equals(_e);)if(_e=C[V++],!_e)return 1/0;for(;V=2&&C[Ft-1].equals(C[Ft-2]);)Ft--;for(var Gt=0;Gt0;if(ni&&dn>Gt){var Mi=Ir.dist(Xr);if(Mi>2*hr){var Bi=Ir.sub(Ir.sub(Xr)._mult(hr/Mi)._round());this.updateDistance(Xr,Bi),this.addCurrentVertex(Bi,Za,0,0,Dr),Xr=Bi}}var Ho=Xr&&ba,Xi=Ho?se:kt?"butt":_e;if(Ho&&Xi==="round"&&(Dnke&&(Xi="bevel"),Xi==="bevel"&&(Dn>2&&(Xi="flipbevel"),Dn100)$a=Ra.mult(-1);else{var Qi=Dn*Za.add(Ra).mag()/Za.sub(Ra).mag();$a._perp()._mult(Qi*(Zi?-1:1))}this.addCurrentVertex(Ir,$a,0,0,Dr),this.addCurrentVertex(Ir,$a.mult(-1),0,0,Dr)}else if(Xi==="bevel"||Xi==="fakeround"){var cs=-Math.sqrt(Dn*Dn-1),Oo=Zi?cs:0,rl=Zi?0:cs;if(Xr&&this.addCurrentVertex(Ir,Za,Oo,rl,Dr),Xi==="fakeround")for(var Il=Math.round(ui*180/Math.PI/Cg),al=1;al2*hr){var Oc=Ir.add(ba.sub(Ir)._mult(hr/ff)._round());this.updateDistance(Ir,Oc),this.addCurrentVertex(Oc,Ra,0,0,Dr),Ir=Oc}}}}},wf.prototype.addCurrentVertex=function(C,V,se,_e,ke,Ne){Ne===void 0&&(Ne=!1);var it=V.x+V.y*se,kt=V.y-V.x*se,Ft=-V.x+V.y*_e,Gt=-V.y-V.x*_e;this.addHalfVertex(C,it,kt,Ne,!1,se,ke),this.addHalfVertex(C,Ft,Gt,Ne,!0,-_e,ke),this.distance>p0/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(C,V,se,_e,ke,Ne))},wf.prototype.addHalfVertex=function(C,V,se,_e,ke,Ne,it){var kt=C.x,Ft=C.y,Gt=this.lineClips?this.scaledDistance*(p0-1):this.scaledDistance,hr=Gt*Ed;if(this.layoutVertexArray.emplaceBack((kt<<1)+(_e?1:0),(Ft<<1)+(ke?1:0),Math.round(Em*V)+128,Math.round(Em*se)+128,(Ne===0?0:Ne<0?-1:1)+1|(hr&63)<<2,hr>>6),this.lineClips){var Dr=this.scaledDistance-this.lineClips.start,Ir=this.lineClips.end-this.lineClips.start,Xr=Dr/Ir;this.layoutVertexArray2.emplaceBack(Xr,this.lineClipsArray.length)}var ba=it.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,ba),it.primitiveLength++),ke?this.e2=ba:this.e1=ba},wf.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},wf.prototype.updateDistance=function(C,V){this.distance+=C.dist(V),this.updateScaledDistance()},zt("LineBucket",wf,{omit:["layers","patternFeatures"]});var Lg=new ti({"line-cap":new Da(Qa.layout_line["line-cap"]),"line-join":new Na(Qa.layout_line["line-join"]),"line-miter-limit":new Da(Qa.layout_line["line-miter-limit"]),"line-round-limit":new Da(Qa.layout_line["line-round-limit"]),"line-sort-key":new Na(Qa.layout_line["line-sort-key"])}),g0=new ti({"line-opacity":new Na(Qa.paint_line["line-opacity"]),"line-color":new Na(Qa.paint_line["line-color"]),"line-translate":new Da(Qa.paint_line["line-translate"]),"line-translate-anchor":new Da(Qa.paint_line["line-translate-anchor"]),"line-width":new Na(Qa.paint_line["line-width"]),"line-gap-width":new Na(Qa.paint_line["line-gap-width"]),"line-offset":new Na(Qa.paint_line["line-offset"]),"line-blur":new Na(Qa.paint_line["line-blur"]),"line-dasharray":new Un(Qa.paint_line["line-dasharray"]),"line-pattern":new Hn(Qa.paint_line["line-pattern"]),"line-gradient":new Gn(Qa.paint_line["line-gradient"])}),kd={paint:g0,layout:Lg},Pg=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.possiblyEvaluate=function(se,_e){return _e=new Qo(Math.floor(_e.zoom),{now:_e.now,fadeDuration:_e.fadeDuration,zoomHistory:_e.zoomHistory,transition:_e.transition}),k.prototype.possiblyEvaluate.call(this,se,_e)},C.prototype.evaluate=function(se,_e,ke,Ne){return _e=_({},_e,{zoom:Math.floor(_e.zoom)}),k.prototype.evaluate.call(this,se,_e,ke,Ne)},C}(Na),y0=new Pg(kd.paint.properties["line-width"].specification);y0.useIntegerZoom=!0;var Ig=function(k){function C(V){k.call(this,V,kd),this.gradientVersion=0}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._handleSpecialPaintPropertyUpdate=function(se){if(se==="line-gradient"){var _e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=_e._styleExpression.expression instanceof au,this.gradientVersion=(this.gradientVersion+1)%f}},C.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},C.prototype.recalculate=function(se,_e){k.prototype.recalculate.call(this,se,_e),this.paint._values["line-floorwidth"]=y0.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,se)},C.prototype.createBucket=function(se){return new wf(se)},C.prototype.queryRadius=function(se){var _e=se,ke=Lm(Df("line-width",this,_e),Df("line-gap-width",this,_e)),Ne=Df("line-offset",this,_e);return ke/2+Math.abs(Ne)+gh(this.paint.get("line-translate"))},C.prototype.queryIntersectsFeature=function(se,_e,ke,Ne,it,kt,Ft){var Gt=Eh(se,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),kt.angle,Ft),hr=Ft/2*Lm(this.paint.get("line-width").evaluate(_e,ke),this.paint.get("line-gap-width").evaluate(_e,ke)),Dr=this.paint.get("line-offset").evaluate(_e,ke);return Dr&&(Ne=H(Ne,Dr*Ft)),fc(Gt,Ne,hr)},C.prototype.isTileClipped=function(){return!0},C}(Ti);function Lm(k,C){return C>0?C+2*k:k}function H(k,C){for(var V=[],se=new i(0,0),_e=0;_e":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Xt(k){for(var C="",V=0;V>1,Gt=-7,hr=V?_e-1:0,Dr=V?-1:1,Ir=k[C+hr];for(hr+=Dr,ke=Ir&(1<<-Gt)-1,Ir>>=-Gt,Gt+=it;Gt>0;ke=ke*256+k[C+hr],hr+=Dr,Gt-=8);for(Ne=ke&(1<<-Gt)-1,ke>>=-Gt,Gt+=se;Gt>0;Ne=Ne*256+k[C+hr],hr+=Dr,Gt-=8);if(ke===0)ke=1-Ft;else{if(ke===kt)return Ne?NaN:(Ir?-1:1)*(1/0);Ne=Ne+Math.pow(2,se),ke=ke-Ft}return(Ir?-1:1)*Ne*Math.pow(2,ke-se)},Rr=function(k,C,V,se,_e,ke){var Ne,it,kt,Ft=ke*8-_e-1,Gt=(1<>1,Dr=_e===23?Math.pow(2,-24)-Math.pow(2,-77):0,Ir=se?0:ke-1,Xr=se?1:-1,ba=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(it=isNaN(C)?1:0,Ne=Gt):(Ne=Math.floor(Math.log(C)/Math.LN2),C*(kt=Math.pow(2,-Ne))<1&&(Ne--,kt*=2),Ne+hr>=1?C+=Dr/kt:C+=Dr*Math.pow(2,1-hr),C*kt>=2&&(Ne++,kt/=2),Ne+hr>=Gt?(it=0,Ne=Gt):Ne+hr>=1?(it=(C*kt-1)*Math.pow(2,_e),Ne=Ne+hr):(it=C*Math.pow(2,hr-1)*Math.pow(2,_e),Ne=0));_e>=8;k[V+Ir]=it&255,Ir+=Xr,it/=256,_e-=8);for(Ne=Ne<<_e|it,Ft+=_e;Ft>0;k[V+Ir]=Ne&255,Ir+=Xr,Ne/=256,Ft-=8);k[V+Ir-Xr]|=ba*128},jr={read:br,write:Rr},Yr=ca;function ca(k){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(k)?k:new Uint8Array(k||0),this.pos=0,this.type=0,this.length=this.buf.length}ca.Varint=0,ca.Fixed64=1,ca.Bytes=2,ca.Fixed32=5;var Ca=65536*65536,un=1/Ca,Ha=12,rn=typeof TextDecoder>"u"?null:new TextDecoder("utf8");ca.prototype={destroy:function(){this.buf=null},readFields:function(k,C,V){for(V=V||this.length;this.pos>3,ke=this.pos;this.type=se&7,k(_e,C,this),this.pos===ke&&this.skip(se)}return C},readMessage:function(k,C){return this.readFields(k,C,this.readVarint()+this.pos)},readFixed32:function(){var k=ih(this.buf,this.pos);return this.pos+=4,k},readSFixed32:function(){var k=Rc(this.buf,this.pos);return this.pos+=4,k},readFixed64:function(){var k=ih(this.buf,this.pos)+ih(this.buf,this.pos+4)*Ca;return this.pos+=8,k},readSFixed64:function(){var k=ih(this.buf,this.pos)+Rc(this.buf,this.pos+4)*Ca;return this.pos+=8,k},readFloat:function(){var k=jr.read(this.buf,this.pos,!0,23,4);return this.pos+=4,k},readDouble:function(){var k=jr.read(this.buf,this.pos,!0,52,8);return this.pos+=8,k},readVarint:function(k){var C=this.buf,V,se;return se=C[this.pos++],V=se&127,se<128||(se=C[this.pos++],V|=(se&127)<<7,se<128)||(se=C[this.pos++],V|=(se&127)<<14,se<128)||(se=C[this.pos++],V|=(se&127)<<21,se<128)?V:(se=C[this.pos],V|=(se&15)<<28,Sn(V,k,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var k=this.readVarint();return k%2===1?(k+1)/-2:k/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var k=this.readVarint()+this.pos,C=this.pos;return this.pos=k,k-C>=Ha&&rn?Kf(this.buf,C,k):Yf(this.buf,C,k)},readBytes:function(){var k=this.readVarint()+this.pos,C=this.buf.subarray(this.pos,k);return this.pos=k,C},readPackedVarint:function(k,C){if(this.type!==ca.Bytes)return k.push(this.readVarint(C));var V=$n(this);for(k=k||[];this.pos127;);else if(C===ca.Bytes)this.pos=this.readVarint()+this.pos;else if(C===ca.Fixed32)this.pos+=4;else if(C===ca.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+C)},writeTag:function(k,C){this.writeVarint(k<<3|C)},realloc:function(k){for(var C=this.length||16;C268435455||k<0){qo(k,this);return}this.realloc(4),this.buf[this.pos++]=k&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=k>>>7&127)))},writeSVarint:function(k){this.writeVarint(k<0?-k*2-1:k*2)},writeBoolean:function(k){this.writeVarint(!!k)},writeString:function(k){k=String(k),this.realloc(k.length*4),this.pos++;var C=this.pos;this.pos=Jf(this.buf,k,this.pos);var V=this.pos-C;V>=128&&mo(C,V,this),this.pos=C-1,this.writeVarint(V),this.pos+=V},writeFloat:function(k){this.realloc(4),jr.write(this.buf,k,this.pos,!0,23,4),this.pos+=4},writeDouble:function(k){this.realloc(8),jr.write(this.buf,k,this.pos,!0,52,8),this.pos+=8},writeBytes:function(k){var C=k.length;this.writeVarint(C),this.realloc(C);for(var V=0;V=128&&mo(V,se,this),this.pos=V-1,this.writeVarint(se),this.pos+=se},writeMessage:function(k,C,V){this.writeTag(k,ca.Bytes),this.writeRawMessage(C,V)},writePackedVarint:function(k,C){C.length&&this.writeMessage(k,so,C)},writePackedSVarint:function(k,C){C.length&&this.writeMessage(k,to,C)},writePackedBoolean:function(k,C){C.length&&this.writeMessage(k,_o,C)},writePackedFloat:function(k,C){C.length&&this.writeMessage(k,zn,C)},writePackedDouble:function(k,C){C.length&&this.writeMessage(k,To,C)},writePackedFixed32:function(k,C){C.length&&this.writeMessage(k,ts,C)},writePackedSFixed32:function(k,C){C.length&&this.writeMessage(k,Gl,C)},writePackedFixed64:function(k,C){C.length&&this.writeMessage(k,Nl,C)},writePackedSFixed64:function(k,C){C.length&&this.writeMessage(k,Gc,C)},writeBytesField:function(k,C){this.writeTag(k,ca.Bytes),this.writeBytes(C)},writeFixed32Field:function(k,C){this.writeTag(k,ca.Fixed32),this.writeFixed32(C)},writeSFixed32Field:function(k,C){this.writeTag(k,ca.Fixed32),this.writeSFixed32(C)},writeFixed64Field:function(k,C){this.writeTag(k,ca.Fixed64),this.writeFixed64(C)},writeSFixed64Field:function(k,C){this.writeTag(k,ca.Fixed64),this.writeSFixed64(C)},writeVarintField:function(k,C){this.writeTag(k,ca.Varint),this.writeVarint(C)},writeSVarintField:function(k,C){this.writeTag(k,ca.Varint),this.writeSVarint(C)},writeStringField:function(k,C){this.writeTag(k,ca.Bytes),this.writeString(C)},writeFloatField:function(k,C){this.writeTag(k,ca.Fixed32),this.writeFloat(C)},writeDoubleField:function(k,C){this.writeTag(k,ca.Fixed64),this.writeDouble(C)},writeBooleanField:function(k,C){this.writeVarintField(k,!!C)}};function Sn(k,C,V){var se=V.buf,_e,ke;if(ke=se[V.pos++],_e=(ke&112)>>4,ke<128||(ke=se[V.pos++],_e|=(ke&127)<<3,ke<128)||(ke=se[V.pos++],_e|=(ke&127)<<10,ke<128)||(ke=se[V.pos++],_e|=(ke&127)<<17,ke<128)||(ke=se[V.pos++],_e|=(ke&127)<<24,ke<128)||(ke=se[V.pos++],_e|=(ke&1)<<31,ke<128))return Oi(k,_e,C);throw new Error("Expected varint not more than 10 bytes")}function $n(k){return k.type===ca.Bytes?k.readVarint()+k.pos:k.pos+1}function Oi(k,C,V){return V?C*4294967296+(k>>>0):(C>>>0)*4294967296+(k>>>0)}function qo(k,C){var V,se;if(k>=0?(V=k%4294967296|0,se=k/4294967296|0):(V=~(-k%4294967296),se=~(-k/4294967296),V^4294967295?V=V+1|0:(V=0,se=se+1|0)),k>=18446744073709552e3||k<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");C.realloc(10),qi(V,se,C),Di(se,C)}function qi(k,C,V){V.buf[V.pos++]=k&127|128,k>>>=7,V.buf[V.pos++]=k&127|128,k>>>=7,V.buf[V.pos++]=k&127|128,k>>>=7,V.buf[V.pos++]=k&127|128,k>>>=7,V.buf[V.pos]=k&127}function Di(k,C){var V=(k&7)<<4;C.buf[C.pos++]|=V|((k>>>=3)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127)))))}function mo(k,C,V){var se=C<=16383?1:C<=2097151?2:C<=268435455?3:Math.floor(Math.log(C)/(Math.LN2*7));V.realloc(se);for(var _e=V.pos-1;_e>=k;_e--)V.buf[_e+se]=V.buf[_e]}function so(k,C){for(var V=0;V>>8,k[V+2]=C>>>16,k[V+3]=C>>>24}function Rc(k,C){return(k[C]|k[C+1]<<8|k[C+2]<<16)+(k[C+3]<<24)}function Yf(k,C,V){for(var se="",_e=C;_e239?4:ke>223?3:ke>191?2:1;if(_e+it>V)break;var kt,Ft,Gt;it===1?ke<128&&(Ne=ke):it===2?(kt=k[_e+1],(kt&192)===128&&(Ne=(ke&31)<<6|kt&63,Ne<=127&&(Ne=null))):it===3?(kt=k[_e+1],Ft=k[_e+2],(kt&192)===128&&(Ft&192)===128&&(Ne=(ke&15)<<12|(kt&63)<<6|Ft&63,(Ne<=2047||Ne>=55296&&Ne<=57343)&&(Ne=null))):it===4&&(kt=k[_e+1],Ft=k[_e+2],Gt=k[_e+3],(kt&192)===128&&(Ft&192)===128&&(Gt&192)===128&&(Ne=(ke&15)<<18|(kt&63)<<12|(Ft&63)<<6|Gt&63,(Ne<=65535||Ne>=1114112)&&(Ne=null))),Ne===null?(Ne=65533,it=1):Ne>65535&&(Ne-=65536,se+=String.fromCharCode(Ne>>>10&1023|55296),Ne=56320|Ne&1023),se+=String.fromCharCode(Ne),_e+=it}return se}function Kf(k,C,V){return rn.decode(k.subarray(C,V))}function Jf(k,C,V){for(var se=0,_e,ke;se55295&&_e<57344)if(ke)if(_e<56320){k[V++]=239,k[V++]=191,k[V++]=189,ke=_e;continue}else _e=ke-55296<<10|_e-56320|65536,ke=null;else{_e>56319||se+1===C.length?(k[V++]=239,k[V++]=191,k[V++]=189):ke=_e;continue}else ke&&(k[V++]=239,k[V++]=191,k[V++]=189,ke=null);_e<128?k[V++]=_e:(_e<2048?k[V++]=_e>>6|192:(_e<65536?k[V++]=_e>>12|224:(k[V++]=_e>>18|240,k[V++]=_e>>12&63|128),k[V++]=_e>>6&63|128),k[V++]=_e&63|128)}return V}var Ou=3;function Wc(k,C,V){k===1&&V.readMessage(Ff,C)}function Ff(k,C,V){if(k===3){var se=V.readMessage(Tf,{}),_e=se.id,ke=se.bitmap,Ne=se.width,it=se.height,kt=se.left,Ft=se.top,Gt=se.advance;C.push({id:_e,bitmap:new Ic({width:Ne+2*Ou,height:it+2*Ou},ke),metrics:{width:Ne,height:it,left:kt,top:Ft,advance:Gt}})}}function Tf(k,C,V){k===1?C.id=V.readVarint():k===2?C.bitmap=V.readBytes():k===3?C.width=V.readVarint():k===4?C.height=V.readVarint():k===5?C.left=V.readSVarint():k===6?C.top=V.readSVarint():k===7&&(C.advance=V.readVarint())}function $f(k){return new Yr(k).readFields(Wc,[])}var lf=Ou;function xh(k){for(var C=0,V=0,se=0,_e=k;se<_e.length;se+=1){var ke=_e[se];C+=ke.w*ke.h,V=Math.max(V,ke.w)}k.sort(function(Za,Ra){return Ra.h-Za.h});for(var Ne=Math.max(Math.ceil(Math.sqrt(C/.95)),V),it=[{x:0,y:0,w:Ne,h:1/0}],kt=0,Ft=0,Gt=0,hr=k;Gt=0;Ir--){var Xr=it[Ir];if(!(Dr.w>Xr.w||Dr.h>Xr.h)){if(Dr.x=Xr.x,Dr.y=Xr.y,Ft=Math.max(Ft,Dr.y+Dr.h),kt=Math.max(kt,Dr.x+Dr.w),Dr.w===Xr.w&&Dr.h===Xr.h){var ba=it.pop();Ir=0&&_e>=C&&bh[this.text.charCodeAt(_e)];_e--)se--;this.text=this.text.substring(C,se),this.sectionIndex=this.sectionIndex.slice(C,se)},Wl.prototype.substring=function(C,V){var se=new Wl;return se.text=this.text.substring(C,V),se.sectionIndex=this.sectionIndex.slice(C,V),se.sections=this.sections,se},Wl.prototype.toString=function(){return this.text},Wl.prototype.getMaxScale=function(){var C=this;return this.sectionIndex.reduce(function(V,se){return Math.max(V,C.sections[se].scale)},0)},Wl.prototype.addTextSection=function(C,V){this.text+=C.text,this.sections.push(Of.forText(C.scale,C.fontStack||V));for(var se=this.sections.length-1,_e=0;_e=Vh?null:++this.imageSectionID:(this.imageSectionID=jh,this.imageSectionID)};function uf(k,C){for(var V=[],se=k.text,_e=0,ke=0,Ne=C;ke=0,Gt=0,hr=0;hr0&&Oc>Zi&&(Zi=Oc)}else{var nl=V[Bi.fontStack],Ys=nl&&nl[Xi];if(Ys&&Ys.rect)Oo=Ys.rect,cs=Ys.metrics;else{var Zl=C[Bi.fontStack],fu=Zl&&Zl[Xi];if(!fu)continue;cs=fu.metrics}Qi=(bn-Bi.scale)*er}al?(k.verticalizable=!0,ni.push({glyph:Xi,imageName:rl,x:Dr,y:Ir+Qi,vertical:al,scale:Bi.scale,fontStack:Bi.fontStack,sectionIndex:Ho,metrics:cs,rect:Oo}),Dr+=Il*Bi.scale+Ft):(ni.push({glyph:Xi,imageName:rl,x:Dr,y:Ir+Qi,vertical:al,scale:Bi.scale,fontStack:Bi.fontStack,sectionIndex:Ho,metrics:cs,rect:Oo}),Dr+=cs.advance*Bi.scale+Ft)}if(ni.length!==0){var eh=Dr-Ft;Xr=Math.max(eh,Xr),Gx(ni,0,ni.length-1,Za,Zi)}Dr=0;var th=ke*bn+Zi;ui.lineOffset=Math.max(Zi,Dn),Ir+=th,ba=Math.max(th,ba),++Ra}var hf=Ir-cu,oh=Bg(Ne),sh=oh.horizontalAlign,Zc=oh.verticalAlign;Wx(k.positionedLines,Za,sh,Zc,Xr,ba,ke,hf,_e.length),k.top+=-Zc*hf,k.bottom=k.top+hf,k.left+=-sh*Xr,k.right=k.left+Xr}function Gx(k,C,V,se,_e){if(!(!se&&!_e))for(var ke=k[V],Ne=ke.metrics.advance*ke.scale,it=(k[V].x+Ne)*se,kt=C;kt<=V;kt++)k[kt].x-=it,k[kt].y+=_e}function Wx(k,C,V,se,_e,ke,Ne,it,kt){var Ft=(C-V)*_e,Gt=0;ke!==Ne?Gt=-it*se-cu:Gt=(-se*kt+.5)*Ne;for(var hr=0,Dr=k;hr-V/2;){if(Ne--,Ne<0)return!1;it-=k[Ne].dist(ke),ke=k[Ne]}it+=k[Ne].dist(k[Ne+1]),Ne++;for(var kt=[],Ft=0;itse;)Ft-=kt.shift().angleDelta;if(Ft>_e)return!1;Ne++,it+=hr.dist(Dr)}return!0}function Af(k){for(var C=0,V=0;VFt){var Xr=(Ft-kt)/Ir,ba=Ns(hr.x,Dr.x,Xr),Za=Ns(hr.y,Dr.y,Xr),Ra=new Ld(ba,Za,Dr.angleTo(hr),Gt);return Ra._round(),!Ne||Rm(k,Ra,it,Ne,C)?Ra:void 0}kt+=Ir}}function td(k,C,V,se,_e,ke,Ne,it,kt){var Ft=wh(se,ke,Ne),Gt=Bv(se,_e),hr=Gt*Ne,Dr=k[0].x===0||k[0].x===kt||k[0].y===0||k[0].y===kt;C-hr=0&&vn=0&&bn=0&&Dr+Ft<=Gt){var Dn=new Ld(vn,bn,dn,Xr);Dn._round(),(!se||Rm(k,Dn,ke,se,_e))&&Ir.push(Dn)}}hr+=Ra}return!it&&!Ir.length&&!Ne&&(Ir=Hh(k,hr/2,V,se,_e,ke,Ne,!0,kt)),Ir}function SA(k,C,V,se,_e){for(var ke=[],Ne=0;Ne=se&&hr.x>=se)&&(Gt.x>=se?Gt=new i(se,Gt.y+(hr.y-Gt.y)*((se-Gt.x)/(hr.x-Gt.x)))._round():hr.x>=se&&(hr=new i(se,Gt.y+(hr.y-Gt.y)*((se-Gt.x)/(hr.x-Gt.x)))._round()),!(Gt.y>=_e&&hr.y>=_e)&&(Gt.y>=_e?Gt=new i(Gt.x+(hr.x-Gt.x)*((_e-Gt.y)/(hr.y-Gt.y)),_e)._round():hr.y>=_e&&(hr=new i(Gt.x+(hr.x-Gt.x)*((_e-Gt.y)/(hr.y-Gt.y)),_e)._round()),(!kt||!Gt.equals(kt[kt.length-1]))&&(kt=[Gt],ke.push(kt)),kt.push(hr)))))}return ke}var _0=uu;function MA(k,C,V,se){var _e=[],ke=k.image,Ne=ke.pixelRatio,it=ke.paddedRect.w-2*_0,kt=ke.paddedRect.h-2*_0,Ft=k.right-k.left,Gt=k.bottom-k.top,hr=ke.stretchX||[[0,it]],Dr=ke.stretchY||[[0,kt]],Ir=function(nl,Ys){return nl+Ys[1]-Ys[0]},Xr=hr.reduce(Ir,0),ba=Dr.reduce(Ir,0),Za=it-Xr,Ra=kt-ba,dn=0,$a=Xr,vn=0,bn=ba,Dn=0,ui=Za,ni=0,Zi=Ra;if(ke.content&&se){var Mi=ke.content;dn=Dm(hr,0,Mi[0]),vn=Dm(Dr,0,Mi[1]),$a=Dm(hr,Mi[0],Mi[2]),bn=Dm(Dr,Mi[1],Mi[3]),Dn=Mi[0]-dn,ni=Mi[1]-vn,ui=Mi[2]-Mi[0]-$a,Zi=Mi[3]-Mi[1]-bn}var Bi=function(nl,Ys,Zl,fu){var ic=zm(nl.stretch-dn,$a,Ft,k.left),vc=Fm(nl.fixed-Dn,ui,nl.stretch,Xr),ff=zm(Ys.stretch-vn,bn,Gt,k.top),Oc=Fm(Ys.fixed-ni,Zi,Ys.stretch,ba),eh=zm(Zl.stretch-dn,$a,Ft,k.left),th=Fm(Zl.fixed-Dn,ui,Zl.stretch,Xr),hf=zm(fu.stretch-vn,bn,Gt,k.top),oh=Fm(fu.fixed-ni,Zi,fu.stretch,ba),sh=new i(ic,ff),Zc=new i(eh,ff),lh=new i(eh,hf),Oh=new i(ic,hf),nd=new i(vc/Ne,Oc/Ne),Dd=new i(th/Ne,oh/Ne),zd=C*Math.PI/180;if(zd){var Fd=Math.sin(zd),E0=Math.cos(zd),tv=[E0,-Fd,Fd,E0];sh._matMult(tv),Zc._matMult(tv),Oh._matMult(tv),lh._matMult(tv)}var Vm=nl.stretch+nl.fixed,rb=Zl.stretch+Zl.fixed,qm=Ys.stretch+Ys.fixed,ab=fu.stretch+fu.fixed,Gh={x:ke.paddedRect.x+_0+Vm,y:ke.paddedRect.y+_0+qm,w:rb-Vm,h:ab-qm},k0=ui/Ne/Ft,Hm=Zi/Ne/Gt;return{tl:sh,tr:Zc,bl:Oh,br:lh,tex:Gh,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:nd,pixelOffsetBR:Dd,minFontScaleX:k0,minFontScaleY:Hm,isSDF:V}};if(!se||!ke.stretchX&&!ke.stretchY)_e.push(Bi({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:it+1},{fixed:0,stretch:kt+1}));else for(var Ho=EA(hr,Za,Xr),Xi=EA(Dr,Ra,ba),Qi=0;Qi0&&(Xr=Math.max(10,Xr),this.circleDiameter=Xr)}else{var ba=Ne.top*it-kt,Za=Ne.bottom*it+kt,Ra=Ne.left*it-kt,dn=Ne.right*it+kt,$a=Ne.collisionPadding;if($a&&(Ra-=$a[0]*it,ba-=$a[1]*it,dn+=$a[2]*it,Za+=$a[3]*it),Gt){var vn=new i(Ra,ba),bn=new i(dn,ba),Dn=new i(Ra,Za),ui=new i(dn,Za),ni=Gt*Math.PI/180;vn._rotate(ni),bn._rotate(ni),Dn._rotate(ni),ui._rotate(ni),Ra=Math.min(vn.x,bn.x,Dn.x,ui.x),dn=Math.max(vn.x,bn.x,Dn.x,ui.x),ba=Math.min(vn.y,bn.y,Dn.y,ui.y),Za=Math.max(vn.y,bn.y,Dn.y,ui.y)}C.emplaceBack(V.x,V.y,Ra,ba,dn,Za,se,_e,ke)}this.boxEndIndex=C.length},x0=function(C,V){if(C===void 0&&(C=[]),V===void 0&&(V=Yz),this.data=C,this.length=this.data.length,this.compare=V,this.length>0)for(var se=(this.length>>1)-1;se>=0;se--)this._down(se)};x0.prototype.push=function(C){this.data.push(C),this.length++,this._up(this.length-1)},x0.prototype.pop=function(){if(this.length!==0){var C=this.data[0],V=this.data.pop();return this.length--,this.length>0&&(this.data[0]=V,this._down(0)),C}},x0.prototype.peek=function(){return this.data[0]},x0.prototype._up=function(C){for(var V=this,se=V.data,_e=V.compare,ke=se[C];C>0;){var Ne=C-1>>1,it=se[Ne];if(_e(ke,it)>=0)break;se[C]=it,C=Ne}se[C]=ke},x0.prototype._down=function(C){for(var V=this,se=V.data,_e=V.compare,ke=this.length>>1,Ne=se[C];C=0)break;se[C]=kt,C=it}se[C]=Ne};function Yz(k,C){return kC?1:0}function Kz(k,C,V){V===void 0&&(V=!1);for(var se=1/0,_e=1/0,ke=-1/0,Ne=-1/0,it=k[0],kt=0;ktke)&&(ke=Ft.x),(!kt||Ft.y>Ne)&&(Ne=Ft.y)}var Gt=ke-se,hr=Ne-_e,Dr=Math.min(Gt,hr),Ir=Dr/2,Xr=new x0([],Jz);if(Dr===0)return new i(se,_e);for(var ba=se;baRa.d||!Ra.d)&&(Ra=$a,V&&console.log("found best %d after %d probes",Math.round(1e4*$a.d)/1e4,dn)),!($a.max-Ra.d<=C)&&(Ir=$a.h/2,Xr.push(new b0($a.p.x-Ir,$a.p.y-Ir,Ir,k)),Xr.push(new b0($a.p.x+Ir,$a.p.y-Ir,Ir,k)),Xr.push(new b0($a.p.x-Ir,$a.p.y+Ir,Ir,k)),Xr.push(new b0($a.p.x+Ir,$a.p.y+Ir,Ir,k)),dn+=4)}return V&&(console.log("num probes: "+dn),console.log("best distance: "+Ra.d)),Ra.p}function Jz(k,C){return C.max-k.max}function b0(k,C,V,se){this.p=new i(k,C),this.h=V,this.d=$z(this.p,se),this.max=this.d+this.h*Math.SQRT2}function $z(k,C){for(var V=!1,se=1/0,_e=0;_ek.y!=Gt.y>k.y&&k.x<(Gt.x-Ft.x)*(k.y-Ft.y)/(Gt.y-Ft.y)+Ft.x&&(V=!V),se=Math.min(se,hv(k,Ft,Gt))}return(V?1:-1)*Math.sqrt(se)}function Qz(k){for(var C=0,V=0,se=0,_e=k[0],ke=0,Ne=_e.length,it=Ne-1;ke=ai||tv.y<0||tv.y>=ai||r8(k,tv,E0,V,se,_e,Xi,k.layers[0],k.collisionBoxArray,C.index,C.sourceLayerIndex,k.index,Ra,bn,ni,kt,$a,Dn,Zi,Ir,C,ke,Ft,Gt,Ne)};if(Mi==="line")for(var cs=0,Oo=SA(C.geometry,0,0,ai,ai);cs1){var ff=qh(vc,ui,V.vertical||Xr,se,ba,dn);ff&&Qi(vc,ff)}}else if(C.type==="Polygon")for(var Oc=0,eh=Qh(C.geometry,0);OcId&&U(k.layerIds[0]+': Value for "text-size" is >= '+Ug+'. Reduce your "text-size".')):Za.kind==="composite"&&(Ra=[Dc*Ir.compositeTextSizes[0].evaluate(Ne,{},Xr),Dc*Ir.compositeTextSizes[1].evaluate(Ne,{},Xr)],(Ra[0]>Id||Ra[1]>Id)&&U(k.layerIds[0]+': Value for "text-size" is >= '+Ug+'. Reduce your "text-size".')),k.addSymbols(k.text,ba,Ra,it,ke,Ne,Ft,C,kt.lineStartIndex,kt.lineLength,Dr,Xr);for(var dn=0,$a=Gt;dn<$a.length;dn+=1){var vn=$a[dn];hr[vn]=k.text.placedSymbolArray.length-1}return ba.length*4}function LA(k){for(var C in k)return k[C];return null}function r8(k,C,V,se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a,vn,bn,Dn,ui,ni){var Zi,Mi=k.addToLineVertexArray(C,V),Bi,Ho,Xi,Qi,cs=0,Oo=0,rl=0,Il=0,al=-1,nl=-1,Ys={},Zl=me(""),fu=0,ic=0;if(it._unevaluatedLayout.getValue("text-radial-offset")===void 0?(Zi=it.layout.get("text-offset").evaluate(vn,{},ui).map(function(qg){return qg*er}),fu=Zi[0],ic=Zi[1]):(fu=it.layout.get("text-radial-offset").evaluate(vn,{},ui)*er,ic=Yx),k.allowVerticalPlacement&&se.vertical){var vc=it.layout.get("text-rotate").evaluate(vn,{},ui),ff=vc+90,Oc=se.vertical;Xi=new Om(kt,C,Ft,Gt,hr,Oc,Dr,Ir,Xr,ff),Ne&&(Qi=new Om(kt,C,Ft,Gt,hr,Ne,Za,Ra,Xr,ff))}if(_e){var eh=it.layout.get("icon-rotate").evaluate(vn,{}),th=it.layout.get("icon-text-fit")!=="none",hf=MA(_e,eh,Dn,th),oh=Ne?MA(Ne,eh,Dn,th):void 0;Ho=new Om(kt,C,Ft,Gt,hr,_e,Za,Ra,!1,eh),cs=hf.length*4;var sh=k.iconSizeData,Zc=null;sh.kind==="source"?(Zc=[Dc*it.layout.get("icon-size").evaluate(vn,{})],Zc[0]>Id&&U(k.layerIds[0]+': Value for "icon-size" is >= '+Ug+'. Reduce your "icon-size".')):sh.kind==="composite"&&(Zc=[Dc*bn.compositeIconSizes[0].evaluate(vn,{},ui),Dc*bn.compositeIconSizes[1].evaluate(vn,{},ui)],(Zc[0]>Id||Zc[1]>Id)&&U(k.layerIds[0]+': Value for "icon-size" is >= '+Ug+'. Reduce your "icon-size".')),k.addSymbols(k.icon,hf,Zc,$a,dn,vn,!1,C,Mi.lineStartIndex,Mi.lineLength,-1,ui),al=k.icon.placedSymbolArray.length-1,oh&&(Oo=oh.length*4,k.addSymbols(k.icon,oh,Zc,$a,dn,vn,ku.vertical,C,Mi.lineStartIndex,Mi.lineLength,-1,ui),nl=k.icon.placedSymbolArray.length-1)}for(var lh in se.horizontal){var Oh=se.horizontal[lh];if(!Bi){Zl=me(Oh.text);var nd=it.layout.get("text-rotate").evaluate(vn,{},ui);Bi=new Om(kt,C,Ft,Gt,hr,Oh,Dr,Ir,Xr,nd)}var Dd=Oh.positionedLines.length===1;if(rl+=CA(k,C,Oh,ke,it,Xr,vn,ba,Mi,se.vertical?ku.horizontal:ku.horizontalOnly,Dd?Object.keys(se.horizontal):[lh],Ys,al,bn,ui),Dd)break}se.vertical&&(Il+=CA(k,C,se.vertical,ke,it,Xr,vn,ba,Mi,ku.vertical,["vertical"],Ys,nl,bn,ui));var zd=Bi?Bi.boxStartIndex:k.collisionBoxArray.length,Fd=Bi?Bi.boxEndIndex:k.collisionBoxArray.length,E0=Xi?Xi.boxStartIndex:k.collisionBoxArray.length,tv=Xi?Xi.boxEndIndex:k.collisionBoxArray.length,Vm=Ho?Ho.boxStartIndex:k.collisionBoxArray.length,rb=Ho?Ho.boxEndIndex:k.collisionBoxArray.length,qm=Qi?Qi.boxStartIndex:k.collisionBoxArray.length,ab=Qi?Qi.boxEndIndex:k.collisionBoxArray.length,Gh=-1,k0=function(qg,WA){return qg&&qg.circleDiameter?Math.max(qg.circleDiameter,WA):WA};Gh=k0(Bi,Gh),Gh=k0(Xi,Gh),Gh=k0(Ho,Gh),Gh=k0(Qi,Gh);var Hm=Gh>-1?1:0;Hm&&(Gh*=ni/er),k.glyphOffsetArray.length>=Pl.MAX_GLYPHS&&U("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),vn.sortKey!==void 0&&k.addToSortKeyRanges(k.symbolInstances.length,vn.sortKey),k.symbolInstances.emplaceBack(C.x,C.y,Ys.right>=0?Ys.right:-1,Ys.center>=0?Ys.center:-1,Ys.left>=0?Ys.left:-1,Ys.vertical||-1,al,nl,Zl,zd,Fd,E0,tv,Vm,rb,qm,ab,Ft,rl,Il,cs,Oo,Hm,0,Dr,fu,ic,Gh)}function a8(k,C,V,se){var _e=k.compareText;if(!(C in _e))_e[C]=[];else for(var ke=_e[C],Ne=ke.length-1;Ne>=0;Ne--)if(se.dist(ke[Ne])0)&&(Ne.value.kind!=="constant"||Ne.value.value.length>0),Gt=kt.value.kind!=="constant"||!!kt.value.value||Object.keys(kt.parameters).length>0,hr=ke.get("symbol-sort-key");if(this.features=[],!(!Ft&&!Gt)){for(var Dr=V.iconDependencies,Ir=V.glyphDependencies,Xr=V.availableImages,ba=new Qo(this.zoom),Za=0,Ra=C;Za=0;for(var Il=0,al=Zi.sections;Il=0;kt--)Ne[kt]={x:V[kt].x,y:V[kt].y,tileUnitDistanceFromAnchor:ke},kt>0&&(ke+=V[kt-1].dist(V[kt]));for(var Ft=0;Ft0},Pl.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Pl.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Pl.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Pl.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Pl.prototype.addIndicesForPlacedSymbol=function(C,V){for(var se=C.placedSymbolArray.get(V),_e=se.vertexStartIndex+se.numGlyphs*4,ke=se.vertexStartIndex;ke<_e;ke+=4)C.indexArray.emplaceBack(ke,ke+1,ke+2),C.indexArray.emplaceBack(ke+1,ke+2,ke+3)},Pl.prototype.getSortedSymbolIndexes=function(C){if(this.sortedAngle===C&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var V=Math.sin(C),se=Math.cos(C),_e=[],ke=[],Ne=[],it=0;it1||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 se=0,_e=this.symbolInstanceIndexes;se<_e.length;se+=1){var ke=_e[se],Ne=this.symbolInstances.get(ke);this.featureSortOrder.push(Ne.featureIndex),[Ne.rightJustifiedTextSymbolIndex,Ne.centerJustifiedTextSymbolIndex,Ne.leftJustifiedTextSymbolIndex].forEach(function(it,kt,Ft){it>=0&&Ft.indexOf(it)===kt&&V.addIndicesForPlacedSymbol(V.text,it)}),Ne.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Ne.verticalPlacedTextSymbolIndex),Ne.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ne.placedIconSymbolIndex),Ne.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ne.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},zt("SymbolBucket",Pl,{omit:["layers","collisionBoxArray","features","compareText"]}),Pl.MAX_GLYPHS=65535,Pl.addDynamicAttributes=Jx;function s8(k,C){return C.replace(/{([^{}]+)}/g,function(V,se){return se in k?String(k[se]):""})}var l8=new ti({"symbol-placement":new Da(Qa.layout_symbol["symbol-placement"]),"symbol-spacing":new Da(Qa.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Da(Qa.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Na(Qa.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Da(Qa.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Da(Qa.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Da(Qa.layout_symbol["icon-ignore-placement"]),"icon-optional":new Da(Qa.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Da(Qa.layout_symbol["icon-rotation-alignment"]),"icon-size":new Na(Qa.layout_symbol["icon-size"]),"icon-text-fit":new Da(Qa.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Da(Qa.layout_symbol["icon-text-fit-padding"]),"icon-image":new Na(Qa.layout_symbol["icon-image"]),"icon-rotate":new Na(Qa.layout_symbol["icon-rotate"]),"icon-padding":new Da(Qa.layout_symbol["icon-padding"]),"icon-keep-upright":new Da(Qa.layout_symbol["icon-keep-upright"]),"icon-offset":new Na(Qa.layout_symbol["icon-offset"]),"icon-anchor":new Na(Qa.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Da(Qa.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Da(Qa.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Da(Qa.layout_symbol["text-rotation-alignment"]),"text-field":new Na(Qa.layout_symbol["text-field"]),"text-font":new Na(Qa.layout_symbol["text-font"]),"text-size":new Na(Qa.layout_symbol["text-size"]),"text-max-width":new Na(Qa.layout_symbol["text-max-width"]),"text-line-height":new Da(Qa.layout_symbol["text-line-height"]),"text-letter-spacing":new Na(Qa.layout_symbol["text-letter-spacing"]),"text-justify":new Na(Qa.layout_symbol["text-justify"]),"text-radial-offset":new Na(Qa.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Da(Qa.layout_symbol["text-variable-anchor"]),"text-anchor":new Na(Qa.layout_symbol["text-anchor"]),"text-max-angle":new Da(Qa.layout_symbol["text-max-angle"]),"text-writing-mode":new Da(Qa.layout_symbol["text-writing-mode"]),"text-rotate":new Na(Qa.layout_symbol["text-rotate"]),"text-padding":new Da(Qa.layout_symbol["text-padding"]),"text-keep-upright":new Da(Qa.layout_symbol["text-keep-upright"]),"text-transform":new Na(Qa.layout_symbol["text-transform"]),"text-offset":new Na(Qa.layout_symbol["text-offset"]),"text-allow-overlap":new Da(Qa.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Da(Qa.layout_symbol["text-ignore-placement"]),"text-optional":new Da(Qa.layout_symbol["text-optional"])}),u8=new ti({"icon-opacity":new Na(Qa.paint_symbol["icon-opacity"]),"icon-color":new Na(Qa.paint_symbol["icon-color"]),"icon-halo-color":new Na(Qa.paint_symbol["icon-halo-color"]),"icon-halo-width":new Na(Qa.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Na(Qa.paint_symbol["icon-halo-blur"]),"icon-translate":new Da(Qa.paint_symbol["icon-translate"]),"icon-translate-anchor":new Da(Qa.paint_symbol["icon-translate-anchor"]),"text-opacity":new Na(Qa.paint_symbol["text-opacity"]),"text-color":new Na(Qa.paint_symbol["text-color"],{runtimeType:zo,getOverride:function(k){return k.textColor},hasOverride:function(k){return!!k.textColor}}),"text-halo-color":new Na(Qa.paint_symbol["text-halo-color"]),"text-halo-width":new Na(Qa.paint_symbol["text-halo-width"]),"text-halo-blur":new Na(Qa.paint_symbol["text-halo-blur"]),"text-translate":new Da(Qa.paint_symbol["text-translate"]),"text-translate-anchor":new Da(Qa.paint_symbol["text-translate-anchor"])}),$x={paint:u8,layout:l8},A0=function(C){this.type=C.property.overrides?C.property.overrides.runtimeType:Ks,this.defaultValue=C};A0.prototype.evaluate=function(C){if(C.formattedSection){var V=this.defaultValue.property.overrides;if(V&&V.hasOverride(C.formattedSection))return V.getOverride(C.formattedSection)}return C.feature&&C.featureState?this.defaultValue.evaluate(C.feature,C.featureState):this.defaultValue.property.specification.default},A0.prototype.eachChild=function(C){if(!this.defaultValue.isConstant()){var V=this.defaultValue.value;C(V._styleExpression.expression)}},A0.prototype.outputDefined=function(){return!1},A0.prototype.serialize=function(){return null},zt("FormatSectionOverride",A0,{omit:["defaultValue"]});var c8=function(k){function C(V){k.call(this,V,$x)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.recalculate=function(se,_e){if(k.prototype.recalculate.call(this,se,_e),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 ke=this.layout.get("text-writing-mode");if(ke){for(var Ne=[],it=0,kt=ke;it",targetMapId:_e,sourceMapId:Ne.mapId})}}},S0.prototype.receive=function(C){var V=C.data,se=V.id;if(se&&!(V.targetMapId&&this.mapId!==V.targetMapId))if(V.type===""){delete this.tasks[se];var _e=this.cancelCallbacks[se];delete this.cancelCallbacks[se],_e&&_e()}else oe()||V.mustQueue?(this.tasks[se]=V,this.taskQueue.push(se),this.invoker.trigger()):this.processTask(se,V)},S0.prototype.process=function(){if(this.taskQueue.length){var C=this.taskQueue.shift(),V=this.tasks[C];delete this.tasks[C],this.taskQueue.length&&this.invoker.trigger(),V&&this.processTask(C,V)}},S0.prototype.processTask=function(C,V){var se=this;if(V.type===""){var _e=this.callbacks[C];delete this.callbacks[C],_e&&(V.error?_e(Vr(V.error)):_e(null,Vr(V.data)))}else{var ke=!1,Ne=J(this.globalScope)?void 0:[],it=V.hasCallback?function(Dr,Ir){ke=!0,delete se.cancelCallbacks[C],se.target.postMessage({id:C,type:"",sourceMapId:se.mapId,error:Dr?Ar(Dr):null,data:Ar(Ir,Ne)},Ne)}:function(Dr){ke=!0},kt=null,Ft=Vr(V.data);if(this.parent[V.type])kt=this.parent[V.type](V.sourceMapId,Ft,it);else if(this.parent.getWorkerSource){var Gt=V.type.split("."),hr=this.parent.getWorkerSource(V.sourceMapId,Gt[0],Ft.source);kt=hr[Gt[1]](Ft,it)}else it(new Error("Could not find function "+V.type));!ke&&kt&&kt.cancel&&(this.cancelCallbacks[C]=kt.cancel)}},S0.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function b8(k,C,V){C=Math.pow(2,V)-C-1;var se=zA(k*256,C*256,V),_e=zA((k+1)*256,(C+1)*256,V);return se[0]+","+se[1]+","+_e[0]+","+_e[1]}function zA(k,C,V){var se=2*Math.PI*6378137/256/Math.pow(2,V),_e=k*se-2*Math.PI*6378137/2,ke=C*se-2*Math.PI*6378137/2;return[_e,ke]}var zc=function(C,V){C&&(V?this.setSouthWest(C).setNorthEast(V):C.length===4?this.setSouthWest([C[0],C[1]]).setNorthEast([C[2],C[3]]):this.setSouthWest(C[0]).setNorthEast(C[1]))};zc.prototype.setNorthEast=function(C){return this._ne=C instanceof Cu?new Cu(C.lng,C.lat):Cu.convert(C),this},zc.prototype.setSouthWest=function(C){return this._sw=C instanceof Cu?new Cu(C.lng,C.lat):Cu.convert(C),this},zc.prototype.extend=function(C){var V=this._sw,se=this._ne,_e,ke;if(C instanceof Cu)_e=C,ke=C;else if(C instanceof zc){if(_e=C._sw,ke=C._ne,!_e||!ke)return this}else{if(Array.isArray(C))if(C.length===4||C.every(Array.isArray)){var Ne=C;return this.extend(zc.convert(Ne))}else{var it=C;return this.extend(Cu.convert(it))}return this}return!V&&!se?(this._sw=new Cu(_e.lng,_e.lat),this._ne=new Cu(ke.lng,ke.lat)):(V.lng=Math.min(_e.lng,V.lng),V.lat=Math.min(_e.lat,V.lat),se.lng=Math.max(ke.lng,se.lng),se.lat=Math.max(ke.lat,se.lat)),this},zc.prototype.getCenter=function(){return new Cu((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},zc.prototype.getSouthWest=function(){return this._sw},zc.prototype.getNorthEast=function(){return this._ne},zc.prototype.getNorthWest=function(){return new Cu(this.getWest(),this.getNorth())},zc.prototype.getSouthEast=function(){return new Cu(this.getEast(),this.getSouth())},zc.prototype.getWest=function(){return this._sw.lng},zc.prototype.getSouth=function(){return this._sw.lat},zc.prototype.getEast=function(){return this._ne.lng},zc.prototype.getNorth=function(){return this._ne.lat},zc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},zc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},zc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},zc.prototype.contains=function(C){var V=Cu.convert(C),se=V.lng,_e=V.lat,ke=this._sw.lat<=_e&&_e<=this._ne.lat,Ne=this._sw.lng<=se&&se<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ne=this._sw.lng>=se&&se>=this._ne.lng),ke&&Ne},zc.convert=function(C){return!C||C instanceof zc?C:new zc(C)};var FA=63710088e-1,Cu=function(C,V){if(isNaN(C)||isNaN(V))throw new Error("Invalid LngLat object: ("+C+", "+V+")");if(this.lng=+C,this.lat=+V,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Cu.prototype.wrap=function(){return new Cu(y(this.lng,-180,180),this.lat)},Cu.prototype.toArray=function(){return[this.lng,this.lat]},Cu.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Cu.prototype.distanceTo=function(C){var V=Math.PI/180,se=this.lat*V,_e=C.lat*V,ke=Math.sin(se)*Math.sin(_e)+Math.cos(se)*Math.cos(_e)*Math.cos((C.lng-this.lng)*V),Ne=FA*Math.acos(Math.min(ke,1));return Ne},Cu.prototype.toBounds=function(C){C===void 0&&(C=0);var V=40075017,se=360*C/V,_e=se/Math.cos(Math.PI/180*this.lat);return new zc(new Cu(this.lng-_e,this.lat-se),new Cu(this.lng+_e,this.lat+se))},Cu.convert=function(C){if(C instanceof Cu)return C;if(Array.isArray(C)&&(C.length===2||C.length===3))return new Cu(Number(C[0]),Number(C[1]));if(!Array.isArray(C)&&typeof C=="object"&&C!==null)return new Cu(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 OA=2*Math.PI*FA;function BA(k){return OA*Math.cos(k*Math.PI/180)}function NA(k){return(180+k)/360}function UA(k){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+k*Math.PI/360)))/360}function jA(k,C){return k/BA(C)}function w8(k){return k*360-180}function eb(k){var C=180-k*360;return 360/Math.PI*Math.atan(Math.exp(C*Math.PI/180))-90}function T8(k,C){return k*BA(eb(C))}function A8(k){return 1/Math.cos(k*Math.PI/180)}var xp=function(C,V,se){se===void 0&&(se=0),this.x=+C,this.y=+V,this.z=+se};xp.fromLngLat=function(C,V){V===void 0&&(V=0);var se=Cu.convert(C);return new xp(NA(se.lng),UA(se.lat),jA(V,se.lat))},xp.prototype.toLngLat=function(){return new Cu(w8(this.x),eb(this.y))},xp.prototype.toAltitude=function(){return T8(this.z,this.y)},xp.prototype.meterInMercatorCoordinateUnits=function(){return 1/OA*A8(eb(this.y))};var bp=function(C,V,se){this.z=C,this.x=V,this.y=se,this.key=Vg(0,C,C,V,se)};bp.prototype.equals=function(C){return this.z===C.z&&this.x===C.x&&this.y===C.y},bp.prototype.url=function(C,V){var se=b8(this.x,this.y,this.z),_e=S8(this.z,this.x,this.y);return C[(this.x+this.y)%C.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(V==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",_e).replace("{bbox-epsg-3857}",se)},bp.prototype.getTilePoint=function(C){var V=Math.pow(2,this.z);return new i((C.x*V-this.x)*ai,(C.y*V-this.y)*ai)},bp.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var VA=function(C,V){this.wrap=C,this.canonical=V,this.key=Vg(C,V.z,V.z,V.x,V.y)},Fc=function(C,V,se,_e,ke){this.overscaledZ=C,this.wrap=V,this.canonical=new bp(se,+_e,+ke),this.key=Vg(V,C,se,_e,ke)};Fc.prototype.equals=function(C){return this.overscaledZ===C.overscaledZ&&this.wrap===C.wrap&&this.canonical.equals(C.canonical)},Fc.prototype.scaledTo=function(C){var V=this.canonical.z-C;return C>this.canonical.z?new Fc(C,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Fc(C,this.wrap,C,this.canonical.x>>V,this.canonical.y>>V)},Fc.prototype.calculateScaledKey=function(C,V){var se=this.canonical.z-C;return C>this.canonical.z?Vg(this.wrap*+V,C,this.canonical.z,this.canonical.x,this.canonical.y):Vg(this.wrap*+V,C,C,this.canonical.x>>se,this.canonical.y>>se)},Fc.prototype.isChildOf=function(C){if(C.wrap!==this.wrap)return!1;var V=this.canonical.z-C.canonical.z;return C.overscaledZ===0||C.overscaledZ>V&&C.canonical.y===this.canonical.y>>V},Fc.prototype.children=function(C){if(this.overscaledZ>=C)return[new Fc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var V=this.canonical.z+1,se=this.canonical.x*2,_e=this.canonical.y*2;return[new Fc(V,this.wrap,V,se,_e),new Fc(V,this.wrap,V,se+1,_e),new Fc(V,this.wrap,V,se,_e+1),new Fc(V,this.wrap,V,se+1,_e+1)]},Fc.prototype.isLessThan=function(C){return this.wrapC.wrap?!1:this.overscaledZC.overscaledZ?!1:this.canonical.xC.canonical.x?!1:this.canonical.y0;ke--)_e=1<=this.dim+1||V<-1||V>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(V+1)*this.stride+(C+1)},rd.prototype._unpackMapbox=function(C,V,se){return(C*256*256+V*256+se)/10-1e4},rd.prototype._unpackTerrarium=function(C,V,se){return C*256+V+se/256-32768},rd.prototype.getPixels=function(){return new bf({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},rd.prototype.backfillBorder=function(C,V,se){if(this.dim!==C.dim)throw new Error("dem dimension mismatch");var _e=V*this.dim,ke=V*this.dim+this.dim,Ne=se*this.dim,it=se*this.dim+this.dim;switch(V){case-1:_e=ke-1;break;case 1:ke=_e+1;break}switch(se){case-1:Ne=it-1;break;case 1:it=Ne+1;break}for(var kt=-V*this.dim,Ft=-se*this.dim,Gt=Ne;Gt=0&&hr[3]>=0&&kt.insert(it,hr[0],hr[1],hr[2],hr[3])}},ad.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ed.VectorTile(new Yr(this.rawTileData)).layers,this.sourceLayerCoder=new Um(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},ad.prototype.query=function(C,V,se,_e){var ke=this;this.loadVTLayers();for(var Ne=C.params||{},it=ai/C.tileSize/C.scale,kt=Ze(Ne.filter),Ft=C.queryGeometry,Gt=C.queryPadding*it,hr=HA(Ft),Dr=this.grid.query(hr.minX-Gt,hr.minY-Gt,hr.maxX+Gt,hr.maxY+Gt),Ir=HA(C.cameraQueryGeometry),Xr=this.grid3D.query(Ir.minX-Gt,Ir.minY-Gt,Ir.maxX+Gt,Ir.maxY+Gt,function(Dn,ui,ni,Zi){return Dh(C.cameraQueryGeometry,Dn-Gt,ui-Gt,ni+Gt,Zi+Gt)}),ba=0,Za=Xr;ba_e)ke=!1;else if(!V)ke=!0;else if(this.expirationTime=Hr.maxzoom)&&Hr.visibility!=="none"){c(Pr,this.zoom,Ot);var Zr=Aa[Hr.id]=Hr.createBucket({index:ga.bucketLayerIDs.length,layers:Pr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:vt,sourceID:this.source});Zr.populate(Lr,Pa,this.tileID.canonical),ga.bucketLayerIDs.push(Pr.map(function(ra){return ra.id}))}}}}var Jr,wt,Qt,mr,$r=e.mapObject(Pa.glyphDependencies,function(ra){return Object.keys(ra).map(Number)});Object.keys($r).length?gr.send("getGlyphs",{uid:this.uid,stacks:$r},function(ra,pa){Jr||(Jr=ra,wt=pa,ya.call(na))}):wt={};var oa=Object.keys(Pa.iconDependencies);oa.length?gr.send("getImages",{icons:oa,source:this.source,tileID:this.tileID,type:"icons"},function(ra,pa){Jr||(Jr=ra,Qt=pa,ya.call(na))}):Qt={};var Sa=Object.keys(Pa.patternDependencies);Sa.length?gr.send("getImages",{icons:Sa,source:this.source,tileID:this.tileID,type:"patterns"},function(ra,pa){Jr||(Jr=ra,mr=pa,ya.call(na))}):mr={},ya.call(this);function ya(){if(Jr)return Br(Jr);if(wt&&Qt&&mr){var ra=new n(wt),pa=new e.ImageAtlas(Qt,mr);for(var pn in Aa){var Ga=Aa[pn];Ga instanceof e.SymbolBucket?(c(Ga.layers,this.zoom,Ot),e.performSymbolLayout(Ga,wt,ra.positions,Qt,pa.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Ga.hasPattern&&(Ga instanceof e.LineBucket||Ga instanceof e.FillBucket||Ga instanceof e.FillExtrusionBucket)&&(c(Ga.layers,this.zoom,Ot),Ga.addFeatures(Pa,this.tileID.canonical,pa.patternPositions))}this.status="done",Br(null,{buckets:e.values(Aa).filter(function(qn){return!qn.isEmpty()}),featureIndex:ga,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ra.image,imageAtlas:pa,glyphMap:this.returnDependencies?wt:null,iconMap:this.returnDependencies?Qt:null,glyphPositions:this.returnDependencies?ra.positions:null})}}};function c(Vt,Lt,jt){for(var Ot=new e.EvaluationParameters(Lt),gr=0,Br=Vt;gr=0!=!!Lt&&Vt.reverse()}var M=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,_=function(Lt){this._feature=Lt,this.extent=e.EXTENT,this.type=Lt.type,this.properties=Lt.tags,"id"in Lt&&!isNaN(Lt.id)&&(this.id=parseInt(Lt.id,10))};_.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Lt=[],jt=0,Ot=this._feature.geometry;jt"u"&&(Ot.push(Ur),ga=Ot.length-1,Br[Ur]=ga),Lt.writeVarint(ga);var Aa=jt.properties[Ur],Pa=typeof Aa;Pa!=="string"&&Pa!=="boolean"&&Pa!=="number"&&(Aa=JSON.stringify(Aa));var sa=Pa+":"+Aa,Oa=na[sa];typeof Oa>"u"&&(gr.push(Aa),Oa=gr.length-1,na[sa]=Oa),Lt.writeVarint(Oa)}}function Q(Vt,Lt){return(Lt<<3)+(Vt&7)}function ue(Vt){return Vt<<1^Vt>>31}function oe(Vt,Lt){for(var jt=Vt.loadGeometry(),Ot=Vt.type,gr=0,Br=0,na=jt.length,Ur=0;Ur>1;J(Vt,Lt,na,Ot,gr,Br%2),j(Vt,Lt,jt,Ot,na-1,Br+1),j(Vt,Lt,jt,na+1,gr,Br+1)}}function J(Vt,Lt,jt,Ot,gr,Br){for(;gr>Ot;){if(gr-Ot>600){var na=gr-Ot+1,Ur=jt-Ot+1,ga=Math.log(na),Aa=.5*Math.exp(2*ga/3),Pa=.5*Math.sqrt(ga*Aa*(na-Aa)/na)*(Ur-na/2<0?-1:1),sa=Math.max(Ot,Math.floor(jt-Ur*Aa/na+Pa)),Oa=Math.min(gr,Math.floor(jt+(na-Ur)*Aa/na+Pa));J(Vt,Lt,jt,sa,Oa,Br)}var dt=Lt[2*jt+Br],vt=Ot,Lr=gr;for($(Vt,Lt,Ot,jt),Lt[2*gr+Br]>dt&&$(Vt,Lt,Ot,gr);vtdt;)Lr--}Lt[2*Ot+Br]===dt?$(Vt,Lt,Ot,Lr):(Lr++,$(Vt,Lt,Lr,gr)),Lr<=jt&&(Ot=Lr+1),jt<=Lr&&(gr=Lr-1)}}function $(Vt,Lt,jt,Ot){X(Vt,jt,Ot),X(Lt,2*jt,2*Ot),X(Lt,2*jt+1,2*Ot+1)}function X(Vt,Lt,jt){var Ot=Vt[Lt];Vt[Lt]=Vt[jt],Vt[jt]=Ot}function re(Vt,Lt,jt,Ot,gr,Br,na){for(var Ur=[0,Vt.length-1,0],ga=[],Aa,Pa;Ur.length;){var sa=Ur.pop(),Oa=Ur.pop(),dt=Ur.pop();if(Oa-dt<=na){for(var vt=dt;vt<=Oa;vt++)Aa=Lt[2*vt],Pa=Lt[2*vt+1],Aa>=jt&&Aa<=gr&&Pa>=Ot&&Pa<=Br&&ga.push(Vt[vt]);continue}var Lr=Math.floor((dt+Oa)/2);Aa=Lt[2*Lr],Pa=Lt[2*Lr+1],Aa>=jt&&Aa<=gr&&Pa>=Ot&&Pa<=Br&&ga.push(Vt[Lr]);var Er=(sa+1)%2;(sa===0?jt<=Aa:Ot<=Pa)&&(Ur.push(dt),Ur.push(Lr-1),Ur.push(Er)),(sa===0?gr>=Aa:Br>=Pa)&&(Ur.push(Lr+1),Ur.push(Oa),Ur.push(Er))}return ga}function ee(Vt,Lt,jt,Ot,gr,Br){for(var na=[0,Vt.length-1,0],Ur=[],ga=gr*gr;na.length;){var Aa=na.pop(),Pa=na.pop(),sa=na.pop();if(Pa-sa<=Br){for(var Oa=sa;Oa<=Pa;Oa++)q(Lt[2*Oa],Lt[2*Oa+1],jt,Ot)<=ga&&Ur.push(Vt[Oa]);continue}var dt=Math.floor((sa+Pa)/2),vt=Lt[2*dt],Lr=Lt[2*dt+1];q(vt,Lr,jt,Ot)<=ga&&Ur.push(Vt[dt]);var Er=(Aa+1)%2;(Aa===0?jt-gr<=vt:Ot-gr<=Lr)&&(na.push(sa),na.push(dt-1),na.push(Er)),(Aa===0?jt+gr>=vt:Ot+gr>=Lr)&&(na.push(dt+1),na.push(Pa),na.push(Er))}return Ur}function q(Vt,Lt,jt,Ot){var gr=Vt-jt,Br=Lt-Ot;return gr*gr+Br*Br}var ae=function(Vt){return Vt[0]},ie=function(Vt){return Vt[1]},fe=function(Lt,jt,Ot,gr,Br){jt===void 0&&(jt=ae),Ot===void 0&&(Ot=ie),gr===void 0&&(gr=64),Br===void 0&&(Br=Float64Array),this.nodeSize=gr,this.points=Lt;for(var na=Lt.length<65536?Uint16Array:Uint32Array,Ur=this.ids=new na(Lt.length),ga=this.coords=new Br(Lt.length*2),Aa=0;Aa=gr;Pa--){var sa=+Date.now();ga=this._cluster(ga,Pa),this.trees[Pa]=new fe(ga,ce,Re,na,Float32Array),Ot&&console.log("z%d: %d clusters in %dms",Pa,ga.length,+Date.now()-sa)}return Ot&&console.timeEnd("total time"),this},Ae.prototype.getClusters=function(Lt,jt){var Ot=((Lt[0]+180)%360+360)%360-180,gr=Math.max(-90,Math.min(90,Lt[1])),Br=Lt[2]===180?180:((Lt[2]+180)%360+360)%360-180,na=Math.max(-90,Math.min(90,Lt[3]));if(Lt[2]-Lt[0]>=360)Ot=-180,Br=180;else if(Ot>Br){var Ur=this.getClusters([Ot,gr,180,na],jt),ga=this.getClusters([-180,gr,Br,na],jt);return Ur.concat(ga)}for(var Aa=this.trees[this._limitZoom(jt)],Pa=Aa.range(Qe(Ot),Ke(na),Qe(Br),Ke(gr)),sa=[],Oa=0,dt=Pa;Oajt&&(Lr+=kr.numPoints||1)}if(Lr>=ga){for(var zr=sa.x*vt,Pr=sa.y*vt,Hr=Ur&&vt>1?this._map(sa,!0):null,Zr=(Pa<<5)+(jt+1)+this.points.length,Jr=0,wt=dt;Jr1)for(var oa=0,Sa=dt;oa>5},Ae.prototype._getOriginZoom=function(Lt){return(Lt-this.points.length)%32},Ae.prototype._map=function(Lt,jt){if(Lt.numPoints)return jt?xe({},Lt.properties):Lt.properties;var Ot=this.points[Lt.index].properties,gr=this.options.map(Ot);return jt&&gr===Ot?xe({},gr):gr};function Fe(Vt,Lt,jt,Ot,gr){return{x:Vt,y:Lt,zoom:1/0,id:jt,parentId:-1,numPoints:Ot,properties:gr}}function Ce(Vt,Lt){var jt=Vt.geometry.coordinates,Ot=jt[0],gr=jt[1];return{x:Qe(Ot),y:Ke(gr),zoom:1/0,index:Lt,parentId:-1}}function qe(Vt){return{type:"Feature",id:Vt.id,properties:et(Vt),geometry:{type:"Point",coordinates:[Xe(Vt.x),Me(Vt.y)]}}}function et(Vt){var Lt=Vt.numPoints,jt=Lt>=1e4?Math.round(Lt/1e3)+"k":Lt>=1e3?Math.round(Lt/100)/10+"k":Lt;return xe(xe({},Vt.properties),{cluster:!0,cluster_id:Vt.id,point_count:Lt,point_count_abbreviated:jt})}function Qe(Vt){return Vt/360+.5}function Ke(Vt){var Lt=Math.sin(Vt*Math.PI/180),jt=.5-.25*Math.log((1+Lt)/(1-Lt))/Math.PI;return jt<0?0:jt>1?1:jt}function Xe(Vt){return(Vt-.5)*360}function Me(Vt){var Lt=(180-Vt*360)*Math.PI/180;return 360*Math.atan(Math.exp(Lt))/Math.PI-90}function xe(Vt,Lt){for(var jt in Lt)Vt[jt]=Lt[jt];return Vt}function ce(Vt){return Vt.x}function Re(Vt){return Vt.y}function $e(Vt,Lt,jt,Ot){for(var gr=Ot,Br=jt-Lt>>1,na=jt-Lt,Ur,ga=Vt[Lt],Aa=Vt[Lt+1],Pa=Vt[jt],sa=Vt[jt+1],Oa=Lt+3;Oagr)Ur=Oa,gr=dt;else if(dt===gr){var vt=Math.abs(Oa-Br);vtOt&&(Ur-Lt>3&&$e(Vt,Lt,Ur,Ot),Vt[Ur+2]=gr,jt-Ur>3&&$e(Vt,Ur,jt,Ot))}function rt(Vt,Lt,jt,Ot,gr,Br){var na=gr-jt,Ur=Br-Ot;if(na!==0||Ur!==0){var ga=((Vt-jt)*na+(Lt-Ot)*Ur)/(na*na+Ur*Ur);ga>1?(jt=gr,Ot=Br):ga>0&&(jt+=na*ga,Ot+=Ur*ga)}return na=Vt-jt,Ur=Lt-Ot,na*na+Ur*Ur}function Je(Vt,Lt,jt,Ot){var gr={id:typeof Vt>"u"?null:Vt,type:Lt,geometry:jt,tags:Ot,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return At(gr),gr}function At(Vt){var Lt=Vt.geometry,jt=Vt.type;if(jt==="Point"||jt==="MultiPoint"||jt==="LineString")St(Vt,Lt);else if(jt==="Polygon"||jt==="MultiLineString")for(var Ot=0;Ot0&&(Ot?na+=(gr*Aa-ga*Br)/2:na+=Math.sqrt(Math.pow(ga-gr,2)+Math.pow(Aa-Br,2))),gr=ga,Br=Aa}var Pa=Lt.length-3;Lt[2]=1,$e(Lt,0,Pa,jt),Lt[Pa+2]=1,Lt.size=Math.abs(na),Lt.start=0,Lt.end=Lt.size}function Mr(Vt,Lt,jt,Ot){for(var gr=0;gr1?1:jt}function pt(Vt,Lt,jt,Ot,gr,Br,na,Ur){if(jt/=Lt,Ot/=Lt,Br>=jt&&na=Ot)return null;for(var ga=[],Aa=0;Aa=jt&&vt=Ot)continue;var Lr=[];if(Oa==="Point"||Oa==="MultiPoint")ze(sa,Lr,jt,Ot,gr);else if(Oa==="LineString")Ge(sa,Lr,jt,Ot,gr,!1,Ur.lineMetrics);else if(Oa==="MultiLineString")ve(sa,Lr,jt,Ot,gr,!1);else if(Oa==="Polygon")ve(sa,Lr,jt,Ot,gr,!0);else if(Oa==="MultiPolygon")for(var Er=0;Er=jt&&na<=Ot&&(Lt.push(Vt[Br]),Lt.push(Vt[Br+1]),Lt.push(Vt[Br+2]))}}function Ge(Vt,Lt,jt,Ot,gr,Br,na){for(var Ur=Oe(Vt),ga=gr===0?be:Pe,Aa=Vt.start,Pa,sa,Oa=0;Oajt&&(sa=ga(Ur,dt,vt,Er,_r,jt),na&&(Ur.start=Aa+Pa*sa)):yr>Ot?kr=jt&&(sa=ga(Ur,dt,vt,Er,_r,jt),zr=!0),kr>Ot&&yr<=Ot&&(sa=ga(Ur,dt,vt,Er,_r,Ot),zr=!0),!Br&&zr&&(na&&(Ur.end=Aa+Pa*sa),Lt.push(Ur),Ur=Oe(Vt)),na&&(Aa+=Pa)}var Pr=Vt.length-3;dt=Vt[Pr],vt=Vt[Pr+1],Lr=Vt[Pr+2],yr=gr===0?dt:vt,yr>=jt&&yr<=Ot&&ge(Ur,dt,vt,Lr),Pr=Ur.length-3,Br&&Pr>=3&&(Ur[Pr]!==Ur[0]||Ur[Pr+1]!==Ur[1])&&ge(Ur,Ur[0],Ur[1],Ur[2]),Ur.length&&Lt.push(Ur)}function Oe(Vt){var Lt=[];return Lt.size=Vt.size,Lt.start=Vt.start,Lt.end=Vt.end,Lt}function ve(Vt,Lt,jt,Ot,gr,Br){for(var na=0;nana.maxX&&(na.maxX=Pa),sa>na.maxY&&(na.maxY=sa)}return na}function qt(Vt,Lt,jt,Ot){var gr=Lt.geometry,Br=Lt.type,na=[];if(Br==="Point"||Br==="MultiPoint")for(var Ur=0;Ur0&&Lt.size<(gr?na:Ot)){jt.numPoints+=Lt.length/3;return}for(var Ur=[],ga=0;gana)&&(jt.numSimplified++,Ur.push(Lt[ga]),Ur.push(Lt[ga+1])),jt.numPoints++;gr&&lr(Ur,Br),Vt.push(Ur)}function lr(Vt,Lt){for(var jt=0,Ot=0,gr=Vt.length,Br=gr-2;Ot0===Lt)for(Ot=0,gr=Vt.length;Ot24)throw new Error("maxZoom should be in the 0-24 range");if(Lt.promoteId&&Lt.generateId)throw new Error("promoteId and generateId cannot be used together.");var Ot=Rt(Vt,Lt);this.tiles={},this.tileCoords=[],jt&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",Lt.indexMaxZoom,Lt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Ot=We(Ot,Lt),Ot.length&&this.splitTile(Ot,0,0,0),jt&&(Ot.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}da.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},da.prototype.splitTile=function(Vt,Lt,jt,Ot,gr,Br,na){for(var Ur=[Vt,Lt,jt,Ot],ga=this.options,Aa=ga.debug;Ur.length;){Ot=Ur.pop(),jt=Ur.pop(),Lt=Ur.pop(),Vt=Ur.pop();var Pa=1<1&&console.time("creation"),Oa=this.tiles[sa]=Bt(Vt,Lt,jt,Ot,ga),this.tileCoords.push({z:Lt,x:jt,y:Ot}),Aa)){Aa>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Lt,jt,Ot,Oa.numFeatures,Oa.numPoints,Oa.numSimplified),console.timeEnd("creation"));var dt="z"+Lt;this.stats[dt]=(this.stats[dt]||0)+1,this.total++}if(Oa.source=Vt,gr){if(Lt===ga.maxZoom||Lt===gr)continue;var vt=1<1&&console.time("clipping");var Lr=.5*ga.buffer/ga.extent,Er=.5-Lr,_r=.5+Lr,yr=1+Lr,kr,zr,Pr,Hr,Zr,Jr;kr=zr=Pr=Hr=null,Zr=pt(Vt,Pa,jt-Lr,jt+_r,0,Oa.minX,Oa.maxX,ga),Jr=pt(Vt,Pa,jt+Er,jt+yr,0,Oa.minX,Oa.maxX,ga),Vt=null,Zr&&(kr=pt(Zr,Pa,Ot-Lr,Ot+_r,1,Oa.minY,Oa.maxY,ga),zr=pt(Zr,Pa,Ot+Er,Ot+yr,1,Oa.minY,Oa.maxY,ga),Zr=null),Jr&&(Pr=pt(Jr,Pa,Ot-Lr,Ot+_r,1,Oa.minY,Oa.maxY,ga),Hr=pt(Jr,Pa,Ot+Er,Ot+yr,1,Oa.minY,Oa.maxY,ga),Jr=null),Aa>1&&console.timeEnd("clipping"),Ur.push(kr||[],Lt+1,jt*2,Ot*2),Ur.push(zr||[],Lt+1,jt*2,Ot*2+1),Ur.push(Pr||[],Lt+1,jt*2+1,Ot*2),Ur.push(Hr||[],Lt+1,jt*2+1,Ot*2+1)}}},da.prototype.getTile=function(Vt,Lt,jt){var Ot=this.options,gr=Ot.extent,Br=Ot.debug;if(Vt<0||Vt>24)return null;var na=1<1&&console.log("drilling down to z%d-%d-%d",Vt,Lt,jt);for(var ga=Vt,Aa=Lt,Pa=jt,sa;!sa&&ga>0;)ga--,Aa=Math.floor(Aa/2),Pa=Math.floor(Pa/2),sa=this.tiles[wa(ga,Aa,Pa)];return!sa||!sa.source?null:(Br>1&&console.log("found parent tile z%d-%d-%d",ga,Aa,Pa),Br>1&&console.time("drilling down"),this.splitTile(sa.source,ga,Aa,Pa,Vt,Lt,jt),Br>1&&console.timeEnd("drilling down"),this.tiles[Ur]?Mt(this.tiles[Ur],gr):null)};function wa(Vt,Lt,jt){return((1<=0?0:ye.button},r.remove=function(ye){ye.parentNode&&ye.parentNode.removeChild(ye)};function h(ye,W,de){var te,me,Ue,tt=e.browser.devicePixelRatio>1?"@2x":"",ft=e.getJSON(W.transformRequest(W.normalizeSpriteURL(ye,tt,".json"),e.ResourceType.SpriteJSON),function(It,Jt){ft=null,Ue||(Ue=It,te=Jt,bt())}),st=e.getImage(W.transformRequest(W.normalizeSpriteURL(ye,tt,".png"),e.ResourceType.SpriteImage),function(It,Jt){st=null,Ue||(Ue=It,me=Jt,bt())});function bt(){if(Ue)de(Ue);else if(te&&me){var It=e.browser.getImageData(me),Jt={};for(var Kt in te){var vr=te[Kt],Tr=vr.width,wr=vr.height,tr=vr.x,pr=vr.y,xr=vr.sdf,ea=vr.pixelRatio,ha=vr.stretchX,Ea=vr.stretchY,tn=vr.content,Xa=new e.RGBAImage({width:Tr,height:wr});e.RGBAImage.copy(It,Xa,{x:tr,y:pr},{x:0,y:0},{width:Tr,height:wr}),Jt[Kt]={data:Xa,pixelRatio:ea,sdf:xr,stretchX:ha,stretchY:Ea,content:tn}}de(null,Jt)}}return{cancel:function(){ft&&(ft.cancel(),ft=null),st&&(st.cancel(),st=null)}}}function T(ye){var W=ye.userImage;if(W&&W.render){var de=W.render();if(de)return ye.data.replace(new Uint8Array(W.data.buffer)),!0}return!1}var l=1,y=function(ye){function W(){ye.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.isLoaded=function(){return this.loaded},W.prototype.setLoaded=function(te){if(this.loaded!==te&&(this.loaded=te,te)){for(var me=0,Ue=this.requestors;me=0?1.2:1))}w.prototype.draw=function(ye){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(ye,this.buffer,this.middle);for(var W=this.ctx.getImageData(0,0,this.size,this.size),de=new Uint8ClampedArray(this.size*this.size),te=0;te65535){It(new Error("glyphs > 65535 not supported"));return}if(vr.ranges[wr]){It(null,{stack:Jt,id:Kt,glyph:Tr});return}var tr=vr.requests[wr];tr||(tr=vr.requests[wr]=[],g.loadGlyphRange(Jt,wr,te.url,te.requestManager,function(pr,xr){if(xr){for(var ea in xr)te._doesCharSupportLocalGlyph(+ea)||(vr.glyphs[+ea]=xr[+ea]);vr.ranges[wr]=!0}for(var ha=0,Ea=tr;ha1&&(bt=W[++st]);var Jt=Math.abs(It-bt.left),Kt=Math.abs(It-bt.right),vr=Math.min(Jt,Kt),Tr=void 0,wr=Ue/te*(me+1);if(bt.isDash){var tr=me-Math.abs(wr);Tr=Math.sqrt(vr*vr+tr*tr)}else Tr=me-Math.sqrt(vr*vr+wr*wr);this.data[ft+It]=Math.max(0,Math.min(255,Tr+128))}},F.prototype.addRegularDash=function(W){for(var de=W.length-1;de>=0;--de){var te=W[de],me=W[de+1];te.zeroLength?W.splice(de,1):me&&me.isDash===te.isDash&&(me.left=te.left,W.splice(de,1))}var Ue=W[0],tt=W[W.length-1];Ue.isDash===tt.isDash&&(Ue.left=tt.left-this.width,tt.right=Ue.right+this.width);for(var ft=this.width*this.nextRow,st=0,bt=W[st],It=0;It1&&(bt=W[++st]);var Jt=Math.abs(It-bt.left),Kt=Math.abs(It-bt.right),vr=Math.min(Jt,Kt),Tr=bt.isDash?vr:-vr;this.data[ft+It]=Math.max(0,Math.min(255,Tr+128))}},F.prototype.addDash=function(W,de){var te=de?7:0,me=2*te+1;if(this.nextRow+me>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var Ue=0,tt=0;tt=te.minX&&W.x=te.minY&&W.y0&&(It[new e.OverscaledTileID(te.overscaledZ,ft,me.z,tt,me.y-1).key]={backfilled:!1},It[new e.OverscaledTileID(te.overscaledZ,te.wrap,me.z,me.x,me.y-1).key]={backfilled:!1},It[new e.OverscaledTileID(te.overscaledZ,bt,me.z,st,me.y-1).key]={backfilled:!1}),me.y+10&&(Ue.resourceTiming=te._resourceTiming,te._resourceTiming=[]),te.fire(new e.Event("data",Ue))})},W.prototype.onAdd=function(te){this.map=te,this.load()},W.prototype.setData=function(te){var me=this;return this._data=te,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(Ue){if(Ue){me.fire(new e.ErrorEvent(Ue));return}var tt={dataType:"source",sourceDataType:"content"};me._collectResourceTiming&&me._resourceTiming&&me._resourceTiming.length>0&&(tt.resourceTiming=me._resourceTiming,me._resourceTiming=[]),me.fire(new e.Event("data",tt))}),this},W.prototype.getClusterExpansionZoom=function(te,me){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:te,source:this.id},me),this},W.prototype.getClusterChildren=function(te,me){return this.actor.send("geojson.getClusterChildren",{clusterId:te,source:this.id},me),this},W.prototype.getClusterLeaves=function(te,me,Ue,tt){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:te,limit:me,offset:Ue},tt),this},W.prototype._updateWorkerData=function(te){var me=this;this._loaded=!1;var Ue=e.extend({},this.workerOptions),tt=this._data;typeof tt=="string"?(Ue.request=this.map._requestManager.transformRequest(e.browser.resolveURL(tt),e.ResourceType.Source),Ue.request.collectResourceTiming=this._collectResourceTiming):Ue.data=JSON.stringify(tt),this.actor.send(this.type+".loadData",Ue,function(ft,st){me._removed||st&&st.abandoned||(me._loaded=!0,st&&st.resourceTiming&&st.resourceTiming[me.id]&&(me._resourceTiming=st.resourceTiming[me.id].slice(0)),me.actor.send(me.type+".coalesce",{source:Ue.source},null),te(ft))})},W.prototype.loaded=function(){return this._loaded},W.prototype.loadTile=function(te,me){var Ue=this,tt=te.actor?"reloadTile":"loadTile";te.actor=this.actor;var ft={type:this.type,uid:te.uid,tileID:te.tileID,zoom:te.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};te.request=this.actor.send(tt,ft,function(st,bt){return delete te.request,te.unloadVectorData(),te.aborted?me(null):st?me(st):(te.loadVectorData(bt,Ue.map.painter,tt==="reloadTile"),me(null))})},W.prototype.abortTile=function(te){te.request&&(te.request.cancel(),delete te.request),te.aborted=!0},W.prototype.unloadTile=function(te){te.unloadVectorData(),this.actor.send("removeTile",{uid:te.uid,type:this.type,source:this.id})},W.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},W.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},W.prototype.hasTransition=function(){return!1},W}(e.Evented),ue=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),oe=function(ye){function W(de,te,me,Ue){ye.call(this),this.id=de,this.dispatcher=me,this.coordinates=te.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Ue),this.options=te}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.load=function(te,me){var Ue=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),function(tt,ft){Ue._loaded=!0,tt?Ue.fire(new e.ErrorEvent(tt)):ft&&(Ue.image=ft,te&&(Ue.coordinates=te),me&&me(),Ue._finishLoading())})},W.prototype.loaded=function(){return this._loaded},W.prototype.updateImage=function(te){var me=this;return!this.image||!te.url?this:(this.options.url=te.url,this.load(te.coordinates,function(){me.texture=null}),this)},W.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},W.prototype.onAdd=function(te){this.map=te,this.load()},W.prototype.setCoordinates=function(te){var me=this;this.coordinates=te;var Ue=te.map(e.MercatorCoordinate.fromLngLat);this.tileID=le(Ue),this.minzoom=this.maxzoom=this.tileID.z;var tt=Ue.map(function(ft){return me.tileID.getTilePoint(ft)._round()});return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(tt[0].x,tt[0].y,0,0),this._boundsArray.emplaceBack(tt[1].x,tt[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(tt[3].x,tt[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(tt[2].x,tt[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},W.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var te=this.map.painter.context,me=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,ue.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(te,this.image,me.RGBA),this.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE));for(var Ue in this.tiles){var tt=this.tiles[Ue];tt.state!=="loaded"&&(tt.state="loaded",tt.texture=this.texture)}}},W.prototype.loadTile=function(te,me){this.tileID&&this.tileID.equals(te.tileID.canonical)?(this.tiles[String(te.tileID.wrap)]=te,te.buckets={},me(null)):(te.state="errored",me(null))},W.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},W.prototype.hasTransition=function(){return!1},W}(e.Evented);function le(ye){for(var W=1/0,de=1/0,te=-1/0,me=-1/0,Ue=0,tt=ye;Ueme.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+me.start(0)+" and "+me.end(0)+"-second mark."))):this.video.currentTime=te}},W.prototype.getVideo=function(){return this.video},W.prototype.onAdd=function(te){this.map||(this.map=te,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},W.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var te=this.map.painter.context,me=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,ue.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE),me.texSubImage2D(me.TEXTURE_2D,0,0,0,me.RGBA,me.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(te,this.video,me.RGBA),this.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE));for(var Ue in this.tiles){var tt=this.tiles[Ue];tt.state!=="loaded"&&(tt.state="loaded",tt.texture=this.texture)}}},W.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},W.prototype.hasTransition=function(){return this.video&&!this.video.paused},W}(oe),J=function(ye){function W(de,te,me,Ue){ye.call(this,de,te,me,Ue),te.coordinates?(!Array.isArray(te.coordinates)||te.coordinates.length!==4||te.coordinates.some(function(tt){return!Array.isArray(tt)||tt.length!==2||tt.some(function(ft){return typeof ft!="number"})}))&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+de,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+de,null,'missing required property "coordinates"'))),te.animate&&typeof te.animate!="boolean"&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+de,null,'optional "animate" property must be a boolean value'))),te.canvas?typeof te.canvas!="string"&&!(te.canvas instanceof e.window.HTMLCanvasElement)&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+de,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+de,null,'missing required property "canvas"'))),this.options=te,this.animate=te.animate!==void 0?te.animate:!0}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},W.prototype.getCanvas=function(){return this.canvas},W.prototype.onAdd=function(te){this.map=te,this.load(),this.canvas&&this.animate&&this.play()},W.prototype.onRemove=function(){this.pause()},W.prototype.prepare=function(){var te=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,te=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,te=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var me=this.map.painter.context,Ue=me.gl;this.boundsBuffer||(this.boundsBuffer=me.createVertexBuffer(this._boundsArray,ue.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(te||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(me,this.canvas,Ue.RGBA,{premultiply:!0});for(var tt in this.tiles){var ft=this.tiles[tt];ft.state!=="loaded"&&(ft.state="loaded",ft.texture=this.texture)}}},W.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},W.prototype.hasTransition=function(){return this._playing},W.prototype._hasInvalidDimensions=function(){for(var te=0,me=[this.canvas.width,this.canvas.height];tethis.max){var ft=this._getAndRemoveByKey(this.order[0]);ft&&this.onRemove(ft)}return this},Ce.prototype.has=function(W){return W.wrapped().key in this.data},Ce.prototype.getAndRemove=function(W){return this.has(W)?this._getAndRemoveByKey(W.wrapped().key):null},Ce.prototype._getAndRemoveByKey=function(W){var de=this.data[W].shift();return de.timeout&&clearTimeout(de.timeout),this.data[W].length===0&&delete this.data[W],this.order.splice(this.order.indexOf(W),1),de.value},Ce.prototype.getByKey=function(W){var de=this.data[W];return de?de[0].value:null},Ce.prototype.get=function(W){if(!this.has(W))return null;var de=this.data[W.wrapped().key][0];return de.value},Ce.prototype.remove=function(W,de){if(!this.has(W))return this;var te=W.wrapped().key,me=de===void 0?0:this.data[te].indexOf(de),Ue=this.data[te][me];return this.data[te].splice(me,1),Ue.timeout&&clearTimeout(Ue.timeout),this.data[te].length===0&&delete this.data[te],this.onRemove(Ue.value),this.order.splice(this.order.indexOf(te),1),this},Ce.prototype.setMaxSize=function(W){for(this.max=W;this.order.length>this.max;){var de=this._getAndRemoveByKey(this.order[0]);de&&this.onRemove(de)}return this},Ce.prototype.filter=function(W){var de=[];for(var te in this.data)for(var me=0,Ue=this.data[te];me1||(Math.abs(Jt)>1&&(Math.abs(Jt+vr)===1?Jt+=vr:Math.abs(Jt-vr)===1&&(Jt-=vr)),!(!It.dem||!bt.dem)&&(bt.dem.backfillBorder(It.dem,Jt,Kt),bt.neighboringTiles&&bt.neighboringTiles[Tr]&&(bt.neighboringTiles[Tr].backfilled=!0)))}},W.prototype.getTile=function(te){return this.getTileByID(te.key)},W.prototype.getTileByID=function(te){return this._tiles[te]},W.prototype._retainLoadedChildren=function(te,me,Ue,tt){for(var ft in this._tiles){var st=this._tiles[ft];if(!(tt[ft]||!st.hasData()||st.tileID.overscaledZ<=me||st.tileID.overscaledZ>Ue)){for(var bt=st.tileID;st&&st.tileID.overscaledZ>me+1;){var It=st.tileID.scaledTo(st.tileID.overscaledZ-1);st=this._tiles[It.key],st&&st.hasData()&&(bt=It)}for(var Jt=bt;Jt.overscaledZ>me;)if(Jt=Jt.scaledTo(Jt.overscaledZ-1),te[Jt.key]){tt[bt.key]=bt;break}}}},W.prototype.findLoadedParent=function(te,me){if(te.key in this._loadedParentTiles){var Ue=this._loadedParentTiles[te.key];return Ue&&Ue.tileID.overscaledZ>=me?Ue:null}for(var tt=te.overscaledZ-1;tt>=me;tt--){var ft=te.scaledTo(tt),st=this._getLoadedTile(ft);if(st)return st}},W.prototype._getLoadedTile=function(te){var me=this._tiles[te.key];if(me&&me.hasData())return me;var Ue=this._cache.getByKey(te.wrapped().key);return Ue},W.prototype.updateCacheSize=function(te){var me=Math.ceil(te.width/this._source.tileSize)+1,Ue=Math.ceil(te.height/this._source.tileSize)+1,tt=me*Ue,ft=5,st=Math.floor(tt*ft),bt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,st):st;this._cache.setMaxSize(bt)},W.prototype.handleWrapJump=function(te){var me=this._prevLng===void 0?te:this._prevLng,Ue=te-me,tt=Ue/360,ft=Math.round(tt);if(this._prevLng=te,ft){var st={};for(var bt in this._tiles){var It=this._tiles[bt];It.tileID=It.tileID.unwrapTo(It.tileID.wrap+ft),st[It.tileID.key]=It}this._tiles=st;for(var Jt in this._timers)clearTimeout(this._timers[Jt]),delete this._timers[Jt];for(var Kt in this._tiles){var vr=this._tiles[Kt];this._setTileReloadTimer(Kt,vr)}}},W.prototype.update=function(te){var me=this;if(this.transform=te,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(te),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var Ue;this.used?this._source.tileID?Ue=te.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(hn){return new e.OverscaledTileID(hn.canonical.z,hn.wrap,hn.canonical.z,hn.canonical.x,hn.canonical.y)}):(Ue=te.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(Ue=Ue.filter(function(hn){return me._source.hasTile(hn)}))):Ue=[];var tt=te.coveringZoomLevel(this._source),ft=Math.max(tt-W.maxOverzooming,this._source.minzoom),st=Math.max(tt+W.maxUnderzooming,this._source.minzoom),bt=this._updateRetainedTiles(Ue,tt);if(ga(this._source.type)){for(var It={},Jt={},Kt=Object.keys(bt),vr=0,Tr=Kt;vrthis._source.maxzoom){var xr=tr.children(this._source.maxzoom)[0],ea=this.getTile(xr);if(ea&&ea.hasData()){Ue[xr.key]=xr;continue}}else{var ha=tr.children(this._source.maxzoom);if(Ue[ha[0].key]&&Ue[ha[1].key]&&Ue[ha[2].key]&&Ue[ha[3].key])continue}for(var Ea=pr.wasRequested(),tn=tr.overscaledZ-1;tn>=ft;--tn){var Xa=tr.scaledTo(tn);if(tt[Xa.key]||(tt[Xa.key]=!0,pr=this.getTile(Xa),!pr&&Ea&&(pr=this._addTile(Xa)),pr&&(Ue[Xa.key]=Xa,Ea=pr.wasRequested(),pr.hasData())))break}}}return Ue},W.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var te in this._tiles){for(var me=[],Ue=void 0,tt=this._tiles[te].tileID;tt.overscaledZ>0;){if(tt.key in this._loadedParentTiles){Ue=this._loadedParentTiles[tt.key];break}me.push(tt.key);var ft=tt.scaledTo(tt.overscaledZ-1);if(Ue=this._getLoadedTile(ft),Ue)break;tt=ft}for(var st=0,bt=me;st0)&&(me.hasData()&&me.state!=="reloading"?this._cache.add(me.tileID,me,me.getExpiryTimeout()):(me.aborted=!0,this._abortTile(me),this._unloadTile(me))))},W.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var te in this._tiles)this._removeTile(te);this._cache.reset()},W.prototype.tilesIn=function(te,me,Ue){var tt=this,ft=[],st=this.transform;if(!st)return ft;for(var bt=Ue?st.getCameraQueryGeometry(te):te,It=te.map(function(tn){return st.pointCoordinate(tn)}),Jt=bt.map(function(tn){return st.pointCoordinate(tn)}),Kt=this.getIds(),vr=1/0,Tr=1/0,wr=-1/0,tr=-1/0,pr=0,xr=Jt;pr=0&&xn[1].y+hn>=0){var fn=It.map(function(Yn){return Ya.getTilePoint(Yn)}),En=Jt.map(function(Yn){return Ya.getTilePoint(Yn)});ft.push({tile:Xa,tileID:Ya,queryGeometry:fn,cameraQueryGeometry:En,scale:an})}}},Ea=0;Ea=e.browser.now())return!0}return!1},W.prototype.setFeatureState=function(te,me,Ue){te=te||"_geojsonTileLayer",this._state.updateState(te,me,Ue)},W.prototype.removeFeatureState=function(te,me,Ue){te=te||"_geojsonTileLayer",this._state.removeFeatureState(te,me,Ue)},W.prototype.getFeatureState=function(te,me){return te=te||"_geojsonTileLayer",this._state.getState(te,me)},W.prototype.setDependencies=function(te,me,Ue){var tt=this._tiles[te];tt&&tt.setDependencies(me,Ue)},W.prototype.reloadTilesForDependencies=function(te,me){for(var Ue in this._tiles){var tt=this._tiles[Ue];tt.hasDependency(te,me)&&this._reloadTile(Ue,"reloading")}this._cache.filter(function(ft){return!ft.hasDependency(te,me)})},W}(e.Evented);na.maxOverzooming=10,na.maxUnderzooming=3;function Ur(ye,W){var de=Math.abs(ye.wrap*2)-+(ye.wrap<0),te=Math.abs(W.wrap*2)-+(W.wrap<0);return ye.overscaledZ-W.overscaledZ||te-de||W.canonical.y-ye.canonical.y||W.canonical.x-ye.canonical.x}function ga(ye){return ye==="raster"||ye==="image"||ye==="video"}function Aa(){return new e.window.Worker(ls.workerUrl)}var Pa="mapboxgl_preloaded_worker_pool",sa=function(){this.active={}};sa.prototype.acquire=function(W){if(!this.workers)for(this.workers=[];this.workers.length0?(me-tt)/ft:0;return this.points[Ue].mult(1-st).add(this.points[de].mult(st))};var ra=function(W,de,te){var me=this.boxCells=[],Ue=this.circleCells=[];this.xCellCount=Math.ceil(W/te),this.yCellCount=Math.ceil(de/te);for(var tt=0;ttthis.width||me<0||de>this.height)return Ue?!1:[];var ft=[];if(W<=0&&de<=0&&this.width<=te&&this.height<=me){if(Ue)return!0;for(var st=0;st0:ft}},ra.prototype._queryCircle=function(W,de,te,me,Ue){var tt=W-te,ft=W+te,st=de-te,bt=de+te;if(ft<0||tt>this.width||bt<0||st>this.height)return me?!1:[];var It=[],Jt={hitTest:me,circle:{x:W,y:de,radius:te},seenUids:{box:{},circle:{}}};return this._forEachCell(tt,st,ft,bt,this._queryCellCircle,It,Jt,Ue),me?It.length>0:It},ra.prototype.query=function(W,de,te,me,Ue){return this._query(W,de,te,me,!1,Ue)},ra.prototype.hitTest=function(W,de,te,me,Ue){return this._query(W,de,te,me,!0,Ue)},ra.prototype.hitTestCircle=function(W,de,te,me){return this._queryCircle(W,de,te,!0,me)},ra.prototype._queryCell=function(W,de,te,me,Ue,tt,ft,st){var bt=ft.seenUids,It=this.boxCells[Ue];if(It!==null)for(var Jt=this.bboxes,Kt=0,vr=It;Kt=Jt[wr+0]&&me>=Jt[wr+1]&&(!st||st(this.boxKeys[Tr]))){if(ft.hitTest)return tt.push(!0),!0;tt.push({key:this.boxKeys[Tr],x1:Jt[wr],y1:Jt[wr+1],x2:Jt[wr+2],y2:Jt[wr+3]})}}}var tr=this.circleCells[Ue];if(tr!==null)for(var pr=this.circles,xr=0,ea=tr;xrft*ft+st*st},ra.prototype._circleAndRectCollide=function(W,de,te,me,Ue,tt,ft){var st=(tt-me)/2,bt=Math.abs(W-(me+st));if(bt>st+te)return!1;var It=(ft-Ue)/2,Jt=Math.abs(de-(Ue+It));if(Jt>It+te)return!1;if(bt<=st||Jt<=It)return!0;var Kt=bt-st,vr=Jt-It;return Kt*Kt+vr*vr<=te*te};function pa(ye,W,de,te,me){var Ue=e.create();return W?(e.scale(Ue,Ue,[1/me,1/me,1]),de||e.rotateZ(Ue,Ue,te.angle)):e.multiply(Ue,te.labelPlaneMatrix,ye),Ue}function pn(ye,W,de,te,me){if(W){var Ue=e.clone(ye);return e.scale(Ue,Ue,[me,me,1]),de||e.rotateZ(Ue,Ue,-te.angle),Ue}else return te.glCoordMatrix}function Ga(ye,W){var de=[ye.x,ye.y,0,1];Wo(de,de,W);var te=de[3];return{point:new e.Point(de[0]/te,de[1]/te),signedDistanceFromCamera:te}}function qn(ye,W){return .5+.5*(ye/W)}function Vn(ye,W){var de=ye[0]/ye[3],te=ye[1]/ye[3],me=de>=-W[0]&&de<=W[0]&&te>=-W[1]&&te<=W[1];return me}function di(ye,W,de,te,me,Ue,tt,ft){var st=te?ye.textSizeData:ye.iconSizeData,bt=e.evaluateSizeForZoom(st,de.transform.zoom),It=[256/de.width*2+1,256/de.height*2+1],Jt=te?ye.text.dynamicLayoutVertexArray:ye.icon.dynamicLayoutVertexArray;Jt.clear();for(var Kt=ye.lineVertexArray,vr=te?ye.text.placedSymbolArray:ye.icon.placedSymbolArray,Tr=de.transform.width/de.transform.height,wr=!1,tr=0;trUe)return{useVertical:!0}}return(ye===e.WritingMode.vertical?W.yde.x)?{needsFlipping:!0}:null}function ci(ye,W,de,te,me,Ue,tt,ft,st,bt,It,Jt,Kt,vr){var Tr=W/24,wr=ye.lineOffsetX*Tr,tr=ye.lineOffsetY*Tr,pr;if(ye.numGlyphs>1){var xr=ye.glyphStartIndex+ye.numGlyphs,ea=ye.lineStartIndex,ha=ye.lineStartIndex+ye.lineLength,Ea=yi(Tr,ft,wr,tr,de,It,Jt,ye,st,Ue,Kt);if(!Ea)return{notEnoughRoom:!0};var tn=Ga(Ea.first.point,tt).point,Xa=Ga(Ea.last.point,tt).point;if(te&&!de){var Ya=Ci(ye.writingMode,tn,Xa,vr);if(Ya)return Ya}pr=[Ea.first];for(var an=ye.glyphStartIndex+1;an0?En.point:ei(Jt,fn,hn,1,me),vi=Ci(ye.writingMode,hn,Yn,vr);if(vi)return vi}var ai=mi(Tr*ft.getoffsetX(ye.glyphStartIndex),wr,tr,de,It,Jt,ye.segment,ye.lineStartIndex,ye.lineStartIndex+ye.lineLength,st,Ue,Kt);if(!ai)return{notEnoughRoom:!0};pr=[ai]}for(var Io=0,yo=pr;Io0?1:-1,Tr=0;te&&(vr*=-1,Tr=Math.PI),vr<0&&(Tr+=Math.PI);for(var wr=vr>0?ft+tt:ft+tt+1,tr=me,pr=me,xr=0,ea=0,ha=Math.abs(Kt),Ea=[];xr+ea<=ha;){if(wr+=vr,wr=st)return null;if(pr=tr,Ea.push(tr),tr=Jt[wr],tr===void 0){var tn=new e.Point(bt.getx(wr),bt.gety(wr)),Xa=Ga(tn,It);if(Xa.signedDistanceFromCamera>0)tr=Jt[wr]=Xa.point;else{var Ya=wr-vr,an=xr===0?Ue:new e.Point(bt.getx(Ya),bt.gety(Ya));tr=ei(an,tn,pr,ha-xr+1,It)}}xr+=ea,ea=pr.dist(tr)}var hn=(ha-xr)/ea,xn=tr.sub(pr),fn=xn.mult(hn)._add(pr);fn._add(xn._unit()._perp()._mult(de*vr));var En=Tr+Math.atan2(tr.y-pr.y,tr.x-pr.x);return Ea.push(fn),{point:fn,angle:En,path:Ea}}var uo=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Lo(ye,W){for(var de=0;de=1;vs--)yo.push(ai.path[vs]);for(var us=1;us0){for(var Uo=yo[0].clone(),Vs=yo[0].clone(),Fu=1;Fu=En.x&&Vs.x<=Yn.x&&Uo.y>=En.y&&Vs.y<=Yn.y?ul=[yo]:Vs.xYn.x||Vs.yYn.y?ul=[]:ul=e.clipLine([yo],En.x,En.y,Yn.x,Yn.y)}for(var fc=0,dh=ul;fc=this.screenRightBoundary||methis.screenBottomBoundary},Ii.prototype.isInsideGrid=function(W,de,te,me){return te>=0&&W=0&&de0){var ha;return this.prevPlacement&&this.prevPlacement.variableOffsets[Kt.crossTileID]&&this.prevPlacement.placements[Kt.crossTileID]&&this.prevPlacement.placements[Kt.crossTileID].text&&(ha=this.prevPlacement.variableOffsets[Kt.crossTileID].anchor),this.variableOffsets[Kt.crossTileID]={textOffset:tr,width:te,height:me,anchor:W,textBoxScale:Ue,prevAnchor:ha},this.markUsedJustification(vr,W,Kt,Tr),vr.allowVerticalPlacement&&(this.markUsedOrientation(vr,Tr,Kt),this.placedOrientations[Kt.crossTileID]=Tr),{shift:pr,placedGlyphBoxes:xr}}},Co.prototype.placeLayerBucketPart=function(W,de,te){var me=this,Ue=W.parameters,tt=Ue.bucket,ft=Ue.layout,st=Ue.posMatrix,bt=Ue.textLabelPlaneMatrix,It=Ue.labelToScreenMatrix,Jt=Ue.textPixelRatio,Kt=Ue.holdingForFade,vr=Ue.collisionBoxArray,Tr=Ue.partiallyEvaluatedTextSize,wr=Ue.collisionGroup,tr=ft.get("text-optional"),pr=ft.get("icon-optional"),xr=ft.get("text-allow-overlap"),ea=ft.get("icon-allow-overlap"),ha=ft.get("text-rotation-alignment")==="map",Ea=ft.get("text-pitch-alignment")==="map",tn=ft.get("icon-text-fit")!=="none",Xa=ft.get("symbol-z-order")==="viewport-y",Ya=xr&&(ea||!tt.hasIconData()||pr),an=ea&&(xr||!tt.hasTextData()||tr);!tt.collisionArrays&&vr&&tt.deserializeCollisionBoxes(vr);var hn=function(ai,Io){if(!de[ai.crossTileID]){if(Kt){me.placements[ai.crossTileID]=new Ro(!1,!1,!1);return}var yo=!1,vs=!1,us=!0,Ds=null,rs={box:null,offscreen:null},ul={box:null,offscreen:null},Uo=null,Vs=null,Fu=null,fc=0,dh=0,ph=0;Io.textFeatureIndex?fc=Io.textFeatureIndex:ai.useRuntimeCollisionCircles&&(fc=ai.featureIndex),Io.verticalTextFeatureIndex&&(dh=Io.verticalTextFeatureIndex);var If=Io.textBox;if(If){var Mh=function(lu){var pl=e.WritingMode.horizontal;if(tt.allowVerticalPlacement&&!lu&&me.prevPlacement){var zf=me.prevPlacement.placedOrientations[ai.crossTileID];zf&&(me.placedOrientations[ai.crossTileID]=zf,pl=zf,me.markUsedOrientation(tt,pl,ai))}return pl},hv=function(lu,pl){if(tt.allowVerticalPlacement&&ai.numVerticalGlyphVertices>0&&Io.verticalTextBox)for(var zf=0,Kv=tt.writingModes;zf0&&(Xf=Xf.filter(function(lu){return lu!==Df.anchor}),Xf.unshift(Df.anchor))}var gh=function(lu,pl,zf){for(var Kv=lu.x2-lu.x1,yd=lu.y2-lu.y1,Ml=ai.textBoxScale,cp=tn&&!ea?pl:null,Pv={box:[],offscreen:!1},$p=xr?Xf.length*2:Xf.length,mh=0;mh<$p;++mh){var Iv=Xf[mh%Xf.length],Qp=mh>=Xf.length,fp=me.attemptAnchorPlacement(Iv,lu,Kv,yd,Ml,ha,Ea,Jt,st,wr,Qp,ai,tt,zf,cp);if(fp&&(Pv=fp.placedGlyphBoxes,Pv&&Pv.box&&Pv.box.length)){yo=!0,Ds=fp.shift;break}}return Pv},Eh=function(){return gh(If,Io.iconBox,e.WritingMode.horizontal)},yh=function(){var lu=Io.verticalTextBox,pl=rs&&rs.box&&rs.box.length;return tt.allowVerticalPlacement&&!pl&&ai.numVerticalGlyphVertices>0&&lu?gh(lu,Io.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}};hv(Eh,yh),rs&&(yo=rs.box,us=rs.offscreen);var Zv=Mh(rs&&rs.box);if(!yo&&me.prevPlacement){var vv=me.prevPlacement.variableOffsets[ai.crossTileID];vv&&(me.variableOffsets[ai.crossTileID]=vv,me.markUsedJustification(tt,vv.anchor,ai,Zv))}}else{var Rh=function(lu,pl){var zf=me.collisionIndex.placeCollisionBox(lu,xr,Jt,st,wr.predicate);return zf&&zf.box&&zf.box.length&&(me.markUsedOrientation(tt,pl,ai),me.placedOrientations[ai.crossTileID]=pl),zf},Rf=function(){return Rh(If,e.WritingMode.horizontal)},Dh=function(){var lu=Io.verticalTextBox;return tt.allowVerticalPlacement&&ai.numVerticalGlyphVertices>0&&lu?Rh(lu,e.WritingMode.vertical):{box:null,offscreen:null}};hv(Rf,Dh),Mh(rs&&rs.box&&rs.box.length)}}if(Uo=rs,yo=Uo&&Uo.box&&Uo.box.length>0,us=Uo&&Uo.offscreen,ai.useRuntimeCollisionCircles){var Pc=tt.text.placedSymbolArray.get(ai.centerJustifiedTextSymbolIndex),dv=e.evaluateSizeForFeature(tt.textSizeData,Tr,Pc),Xv=ft.get("text-padding"),of=ai.collisionCircleDiameter;Vs=me.collisionIndex.placeCollisionCircles(xr,Pc,tt.lineVertexArray,tt.glyphOffsetArray,dv,st,bt,It,te,Ea,wr.predicate,of,Xv),yo=xr||Vs.circles.length>0&&!Vs.collisionDetected,us=us&&Vs.offscreen}if(Io.iconFeatureIndex&&(ph=Io.iconFeatureIndex),Io.iconBox){var kv=function(lu){var pl=tn&&Ds?fs(lu,Ds.x,Ds.y,ha,Ea,me.transform.angle):lu;return me.collisionIndex.placeCollisionBox(pl,ea,Jt,st,wr.predicate)};ul&&ul.box&&ul.box.length&&Io.verticalIconBox?(Fu=kv(Io.verticalIconBox),vs=Fu.box.length>0):(Fu=kv(Io.iconBox),vs=Fu.box.length>0),us=us&&Fu.offscreen}var pd=tr||ai.numHorizontalGlyphVertices===0&&ai.numVerticalGlyphVertices===0,gd=pr||ai.numIconVertices===0;if(!pd&&!gd?vs=yo=vs&&yo:gd?pd||(vs=vs&&yo):yo=vs&&yo,yo&&Uo&&Uo.box&&(ul&&ul.box&&dh?me.collisionIndex.insertCollisionBox(Uo.box,ft.get("text-ignore-placement"),tt.bucketInstanceId,dh,wr.ID):me.collisionIndex.insertCollisionBox(Uo.box,ft.get("text-ignore-placement"),tt.bucketInstanceId,fc,wr.ID)),vs&&Fu&&me.collisionIndex.insertCollisionBox(Fu.box,ft.get("icon-ignore-placement"),tt.bucketInstanceId,ph,wr.ID),Vs&&(yo&&me.collisionIndex.insertCollisionCircles(Vs.circles,ft.get("text-ignore-placement"),tt.bucketInstanceId,fc,wr.ID),te)){var Yv=tt.bucketInstanceId,Cv=me.collisionCircleArrays[Yv];Cv===void 0&&(Cv=me.collisionCircleArrays[Yv]=new Li);for(var Lv=0;Lv=0;--fn){var En=xn[fn];hn(tt.symbolInstances.get(En),tt.collisionArrays[En])}else for(var Yn=W.symbolInstanceStart;Yn=0&&(tt>=0&&It!==tt?W.text.placedSymbolArray.get(It).crossTileID=0:W.text.placedSymbolArray.get(It).crossTileID=te.crossTileID)}},Co.prototype.markUsedOrientation=function(W,de,te){for(var me=de===e.WritingMode.horizontal||de===e.WritingMode.horizontalOnly?de:0,Ue=de===e.WritingMode.vertical?de:0,tt=[te.leftJustifiedTextSymbolIndex,te.centerJustifiedTextSymbolIndex,te.rightJustifiedTextSymbolIndex],ft=0,st=tt;ft0||Ea>0,hn=ea.numIconVertices>0,xn=me.placedOrientations[ea.crossTileID],fn=xn===e.WritingMode.vertical,En=xn===e.WritingMode.horizontal||xn===e.WritingMode.horizontalOnly;if(an){var Yn=Ks(Ya.text),vi=fn?Rn:Yn;Tr(W.text,ha,vi);var ai=En?Rn:Yn;Tr(W.text,Ea,ai);var Io=Ya.text.isHidden();[ea.rightJustifiedTextSymbolIndex,ea.centerJustifiedTextSymbolIndex,ea.leftJustifiedTextSymbolIndex].forEach(function(ph){ph>=0&&(W.text.placedSymbolArray.get(ph).hidden=Io||fn?1:0)}),ea.verticalPlacedTextSymbolIndex>=0&&(W.text.placedSymbolArray.get(ea.verticalPlacedTextSymbolIndex).hidden=Io||En?1:0);var yo=me.variableOffsets[ea.crossTileID];yo&&me.markUsedJustification(W,yo.anchor,ea,xn);var vs=me.placedOrientations[ea.crossTileID];vs&&(me.markUsedJustification(W,"left",ea,vs),me.markUsedOrientation(W,vs,ea))}if(hn){var us=Ks(Ya.icon),Ds=!(Kt&&ea.verticalPlacedIconSymbolIndex&&fn);if(ea.placedIconSymbolIndex>=0){var rs=Ds?us:Rn;Tr(W.icon,ea.numIconVertices,rs),W.icon.placedSymbolArray.get(ea.placedIconSymbolIndex).hidden=Ya.icon.isHidden()}if(ea.verticalPlacedIconSymbolIndex>=0){var ul=Ds?Rn:us;Tr(W.icon,ea.numVerticalIconVertices,ul),W.icon.placedSymbolArray.get(ea.verticalPlacedIconSymbolIndex).hidden=Ya.icon.isHidden()}}if(W.hasIconCollisionBoxData()||W.hasTextCollisionBoxData()){var Uo=W.collisionArrays[xr];if(Uo){var Vs=new e.Point(0,0);if(Uo.textBox||Uo.verticalTextBox){var Fu=!0;if(bt){var fc=me.variableOffsets[tn];fc?(Vs=as(fc.anchor,fc.width,fc.height,fc.textOffset,fc.textBoxScale),It&&Vs._rotate(Jt?me.transform.angle:-me.transform.angle)):Fu=!1}Uo.textBox&&Qa(W.textCollisionBox.collisionVertexArray,Ya.text.placed,!Fu||fn,Vs.x,Vs.y),Uo.verticalTextBox&&Qa(W.textCollisionBox.collisionVertexArray,Ya.text.placed,!Fu||En,Vs.x,Vs.y)}var dh=!!(!En&&Uo.verticalIconBox);Uo.iconBox&&Qa(W.iconCollisionBox.collisionVertexArray,Ya.icon.placed,dh,Kt?Vs.x:0,Kt?Vs.y:0),Uo.verticalIconBox&&Qa(W.iconCollisionBox.collisionVertexArray,Ya.icon.placed,!dh,Kt?Vs.x:0,Kt?Vs.y:0)}}},tr=0;trW},Co.prototype.setStale=function(){this.stale=!0};function Qa(ye,W,de,te,me){ye.emplaceBack(W?1:0,de?1:0,te||0,me||0),ye.emplaceBack(W?1:0,de?1:0,te||0,me||0),ye.emplaceBack(W?1:0,de?1:0,te||0,me||0),ye.emplaceBack(W?1:0,de?1:0,te||0,me||0)}var Jn=Math.pow(2,25),Os=Math.pow(2,24),ds=Math.pow(2,17),Ui=Math.pow(2,16),ms=Math.pow(2,9),Mo=Math.pow(2,8),ws=Math.pow(2,1);function Ks(ye){if(ye.opacity===0&&!ye.placed)return 0;if(ye.opacity===1&&ye.placed)return 4294967295;var W=ye.placed?1:0,de=Math.floor(ye.opacity*127);return de*Jn+W*Os+de*ds+W*Ui+de*ms+W*Mo+de*ws+W}var Rn=0,fo=function(W){this._sortAcrossTiles=W.layout.get("symbol-z-order")!=="viewport-y"&&W.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};fo.prototype.continuePlacement=function(W,de,te,me,Ue){for(var tt=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var ft=W[this._currentPlacementIndex],st=de[ft],bt=this.placement.collisionIndex.transform.zoom;if(st.type==="symbol"&&(!st.minzoom||st.minzoom<=bt)&&(!st.maxzoom||st.maxzoom>bt)){this._inProgressLayer||(this._inProgressLayer=new fo(st));var It=this._inProgressLayer.continuePlacement(te[st.source],this.placement,this._showCollisionBoxes,st,tt);if(It)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Pi.prototype.commit=function(W){return this.placement.commit(W),this.placement};var zo=512/e.EXTENT/2,wo=function(W,de,te){this.tileID=W,this.indexedSymbolInstances={},this.bucketInstanceId=te;for(var me=0;meW.overscaledZ)for(var bt in st){var It=st[bt];It.tileID.isChildOf(W)&&It.findMatches(de.symbolInstances,W,tt)}else{var Jt=W.scaledTo(Number(ft)),Kt=st[Jt.key];Kt&&Kt.findMatches(de.symbolInstances,W,tt)}}for(var vr=0;vr0)throw new Error("Unimplemented: "+tt.map(function(ft){return ft.command}).join(", ")+".");return Ue.forEach(function(ft){ft.command!=="setTransition"&&me[ft.command].apply(me,ft.args)}),this.stylesheet=te,!0},W.prototype.addImage=function(te,me){if(this.getImage(te))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(te,me),this._afterImageUpdated(te)},W.prototype.updateImage=function(te,me){this.imageManager.updateImage(te,me)},W.prototype.getImage=function(te){return this.imageManager.getImage(te)},W.prototype.removeImage=function(te){if(!this.getImage(te))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(te),this._afterImageUpdated(te)},W.prototype._afterImageUpdated=function(te){this._availableImages=this.imageManager.listImages(),this._changedImages[te]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},W.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},W.prototype.addSource=function(te,me,Ue){var tt=this;if(Ue===void 0&&(Ue={}),this._checkLoaded(),this.sourceCaches[te]!==void 0)throw new Error("There is already a source with this ID");if(!me.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(me).join(", ")+".");var ft=["vector","raster","geojson","video","image"],st=ft.indexOf(me.type)>=0;if(!(st&&this._validate(e.validateStyle.source,"sources."+te,me,null,Ue))){this.map&&this.map._collectResourceTiming&&(me.collectResourceTiming=!0);var bt=this.sourceCaches[te]=new na(te,me,this.dispatcher);bt.style=this,bt.setEventedParent(this,function(){return{isSourceLoaded:tt.loaded(),source:bt.serialize(),sourceId:te}}),bt.onAdd(this.map),this._changed=!0}},W.prototype.removeSource=function(te){if(this._checkLoaded(),this.sourceCaches[te]===void 0)throw new Error("There is no source with this ID");for(var me in this._layers)if(this._layers[me].source===te)return this.fire(new e.ErrorEvent(new Error('Source "'+te+'" cannot be removed while layer "'+me+'" is using it.')));var Ue=this.sourceCaches[te];delete this.sourceCaches[te],delete this._updatedSources[te],Ue.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:te})),Ue.setEventedParent(null),Ue.clearTiles(),Ue.onRemove&&Ue.onRemove(this.map),this._changed=!0},W.prototype.setGeoJSONSourceData=function(te,me){this._checkLoaded();var Ue=this.sourceCaches[te].getSource();Ue.setData(me),this._changed=!0},W.prototype.getSource=function(te){return this.sourceCaches[te]&&this.sourceCaches[te].getSource()},W.prototype.addLayer=function(te,me,Ue){Ue===void 0&&(Ue={}),this._checkLoaded();var tt=te.id;if(this.getLayer(tt)){this.fire(new e.ErrorEvent(new Error('Layer with id "'+tt+'" already exists on this map')));return}var ft;if(te.type==="custom"){if(Js(this,e.validateCustomStyleLayer(te)))return;ft=e.createStyleLayer(te)}else{if(typeof te.source=="object"&&(this.addSource(tt,te.source),te=e.clone$1(te),te=e.extend(te,{source:tt})),this._validate(e.validateStyle.layer,"layers."+tt,te,{arrayIndex:-1},Ue))return;ft=e.createStyleLayer(te),this._validateLayer(ft),ft.setEventedParent(this,{layer:{id:tt}}),this._serializedLayers[ft.id]=ft.serialize()}var st=me?this._order.indexOf(me):this._order.length;if(me&&st===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+me+'" does not exist on this map.')));return}if(this._order.splice(st,0,tt),this._layerOrderChanged=!0,this._layers[tt]=ft,this._removedLayers[tt]&&ft.source&&ft.type!=="custom"){var bt=this._removedLayers[tt];delete this._removedLayers[tt],bt.type!==ft.type?this._updatedSources[ft.source]="clear":(this._updatedSources[ft.source]="reload",this.sourceCaches[ft.source].pause())}this._updateLayer(ft),ft.onAdd&&ft.onAdd(this.map)},W.prototype.moveLayer=function(te,me){this._checkLoaded(),this._changed=!0;var Ue=this._layers[te];if(!Ue){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be moved.")));return}if(te!==me){var tt=this._order.indexOf(te);this._order.splice(tt,1);var ft=me?this._order.indexOf(me):this._order.length;if(me&&ft===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+me+'" does not exist on this map.')));return}this._order.splice(ft,0,te),this._layerOrderChanged=!0}},W.prototype.removeLayer=function(te){this._checkLoaded();var me=this._layers[te];if(!me){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be removed.")));return}me.setEventedParent(null);var Ue=this._order.indexOf(te);this._order.splice(Ue,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[te]=me,delete this._layers[te],delete this._serializedLayers[te],delete this._updatedLayers[te],delete this._updatedPaintProps[te],me.onRemove&&me.onRemove(this.map)},W.prototype.getLayer=function(te){return this._layers[te]},W.prototype.hasLayer=function(te){return te in this._layers},W.prototype.setLayerZoomRange=function(te,me,Ue){this._checkLoaded();var tt=this.getLayer(te);if(!tt){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot have zoom extent.")));return}tt.minzoom===me&&tt.maxzoom===Ue||(me!=null&&(tt.minzoom=me),Ue!=null&&(tt.maxzoom=Ue),this._updateLayer(tt))},W.prototype.setFilter=function(te,me,Ue){Ue===void 0&&(Ue={}),this._checkLoaded();var tt=this.getLayer(te);if(!tt){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be filtered.")));return}if(!e.deepEqual(tt.filter,me)){if(me==null){tt.filter=void 0,this._updateLayer(tt);return}this._validate(e.validateStyle.filter,"layers."+tt.id+".filter",me,null,Ue)||(tt.filter=e.clone$1(me),this._updateLayer(tt))}},W.prototype.getFilter=function(te){return e.clone$1(this.getLayer(te).filter)},W.prototype.setLayoutProperty=function(te,me,Ue,tt){tt===void 0&&(tt={}),this._checkLoaded();var ft=this.getLayer(te);if(!ft){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}e.deepEqual(ft.getLayoutProperty(me),Ue)||(ft.setLayoutProperty(me,Ue,tt),this._updateLayer(ft))},W.prototype.getLayoutProperty=function(te,me){var Ue=this.getLayer(te);if(!Ue){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style.")));return}return Ue.getLayoutProperty(me)},W.prototype.setPaintProperty=function(te,me,Ue,tt){tt===void 0&&(tt={}),this._checkLoaded();var ft=this.getLayer(te);if(!ft){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}if(!e.deepEqual(ft.getPaintProperty(me),Ue)){var st=ft.setPaintProperty(me,Ue,tt);st&&this._updateLayer(ft),this._changed=!0,this._updatedPaintProps[te]=!0}},W.prototype.getPaintProperty=function(te,me){return this.getLayer(te).getPaintProperty(me)},W.prototype.setFeatureState=function(te,me){this._checkLoaded();var Ue=te.source,tt=te.sourceLayer,ft=this.sourceCaches[Ue];if(ft===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+Ue+"' does not exist in the map's style.")));return}var st=ft.getSource().type;if(st==="geojson"&&tt){this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(st==="vector"&&!tt){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),ft.setFeatureState(tt,te.id,me)},W.prototype.removeFeatureState=function(te,me){this._checkLoaded();var Ue=te.source,tt=this.sourceCaches[Ue];if(tt===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+Ue+"' does not exist in the map's style.")));return}var ft=tt.getSource().type,st=ft==="vector"?te.sourceLayer:void 0;if(ft==="vector"&&!st){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(me&&typeof te.id!="string"&&typeof te.id!="number"){this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}tt.removeFeatureState(st,te.id,me)},W.prototype.getFeatureState=function(te){this._checkLoaded();var me=te.source,Ue=te.sourceLayer,tt=this.sourceCaches[me];if(tt===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+me+"' does not exist in the map's style.")));return}var ft=tt.getSource().type;if(ft==="vector"&&!Ue){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),tt.getFeatureState(Ue,te.id)},W.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},W.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,function(te){return te.serialize()}),layers:this._serializeLayers(this._order)},function(te){return te!==void 0})},W.prototype._updateLayer=function(te){this._updatedLayers[te.id]=!0,te.source&&!this._updatedSources[te.source]&&this.sourceCaches[te.source].getSource().type!=="raster"&&(this._updatedSources[te.source]="reload",this.sourceCaches[te.source].pause()),this._changed=!0},W.prototype._flattenAndSortRenderedFeatures=function(te){for(var me=this,Ue=function(En){return me._layers[En].type==="fill-extrusion"},tt={},ft=[],st=this._order.length-1;st>=0;st--){var bt=this._order[st];if(Ue(bt)){tt[bt]=st;for(var It=0,Jt=te;It=0;xr--){var ea=this._order[xr];if(Ue(ea))for(var ha=ft.length-1;ha>=0;ha--){var Ea=ft[ha].feature;if(tt[Ea.layer.id] 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;}`,hl=`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 +}`,yf=`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;}`,Jc=`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Uc="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;}",$u=`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 +}`,jc="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;}",$c=`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 +}`,bu=` +#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);}`,Qc=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +#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,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,sc=` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,wu=`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 +}`,eu=` +#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;}`,Sc=`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 +}`,ef=` +#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);}`,ps=`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 +}`,Vc="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;}",Zf=`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 +}`,mf=`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));}`,Mc=`#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 +}`,_f=`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);}`,tu=`#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 +}`,xf=`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);}`,Fl=Rs(Lu,Bu),ru=Rs(kf,gf),Uu=Rs(ns,_u),$s=Rs(Nc,ml),Qu=Rs(fl,_l),Tu=Rs(Yu,Ts),au=Rs(Tl,Ko),Ns=Rs(Cs,Nu),yc=Rs(Ul,Ku),Pu=Rs(Bs,Gf),ec=Rs(Eo,Wf),Ec=Rs(is,oo),Cf=Rs(pc,xu),nh=Rs(zl,Kc),lc=Rs(Ju,gc),kc=Rs(hl,yf),nu=Rs(Jc,Uc),tf=Rs($u,jc),Cl=Rs($c,bu),uc=Rs(Qc,sc),rf=Rs(wu,eu),mc=Rs(Sc,ef),Us=Rs(ps,Vc),vu=Rs(Zf,mf),du=Rs(Mc,_f),af=Rs(tu,xf);function Rs(ye,W){var de=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,te=W.match(/attribute ([\w]+) ([\w]+)/g),me=ye.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Ue=W.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),tt=Ue?Ue.concat(me):me,ft={};return ye=ye.replace(de,function(st,bt,It,Jt,Kt){return ft[Kt]=!0,bt==="define"?` +#ifndef HAS_UNIFORM_u_`+Kt+` +varying `+It+" "+Jt+" "+Kt+`; +#else +uniform `+It+" "+Jt+" u_"+Kt+`; +#endif +`:` +#ifdef HAS_UNIFORM_u_`+Kt+` + `+It+" "+Jt+" "+Kt+" = u_"+Kt+`; +#endif +`}),W=W.replace(de,function(st,bt,It,Jt,Kt){var vr=Jt==="float"?"vec2":"vec4",Tr=Kt.match(/color/)?"color":vr;return ft[Kt]?bt==="define"?` +#ifndef HAS_UNIFORM_u_`+Kt+` +uniform lowp float u_`+Kt+`_t; +attribute `+It+" "+vr+" a_"+Kt+`; +varying `+It+" "+Jt+" "+Kt+`; +#else +uniform `+It+" "+Jt+" u_"+Kt+`; +#endif +`:Tr==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Kt+` + `+Kt+" = a_"+Kt+`; +#else + `+It+" "+Jt+" "+Kt+" = u_"+Kt+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+Kt+` + `+Kt+" = unpack_mix_"+Tr+"(a_"+Kt+", u_"+Kt+`_t); +#else + `+It+" "+Jt+" "+Kt+" = u_"+Kt+`; +#endif +`:bt==="define"?` +#ifndef HAS_UNIFORM_u_`+Kt+` +uniform lowp float u_`+Kt+`_t; +attribute `+It+" "+vr+" a_"+Kt+`; +#else +uniform `+It+" "+Jt+" u_"+Kt+`; +#endif +`:Tr==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Kt+` + `+It+" "+Jt+" "+Kt+" = a_"+Kt+`; +#else + `+It+" "+Jt+" "+Kt+" = u_"+Kt+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+Kt+` + `+It+" "+Jt+" "+Kt+" = unpack_mix_"+Tr+"(a_"+Kt+", u_"+Kt+`_t); +#else + `+It+" "+Jt+" "+Kt+" = u_"+Kt+`; +#endif +`}),{fragmentSource:ye,vertexSource:W,staticAttributes:te,staticUniforms:tt}}var _c=Object.freeze({__proto__:null,prelude:Fl,background:ru,backgroundPattern:Uu,circle:$s,clippingMask:Qu,heatmap:Tu,heatmapTexture:au,collisionBox:Ns,collisionCircle:yc,debug:Pu,fill:ec,fillOutline:Ec,fillOutlinePattern:Cf,fillPattern:nh,fillExtrusion:lc,fillExtrusionPattern:kc,hillshadePrepare:nu,hillshade:tf,line:Cl,lineGradient:uc,linePattern:rf,lineSDF:mc,raster:Us,symbolIcon:vu,symbolSDF:du,symbolTextAndIcon:af}),ju=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};ju.prototype.bind=function(W,de,te,me,Ue,tt,ft,st){this.context=W;for(var bt=this.boundPaintVertexBuffers.length!==me.length,It=0;!bt&&It>16,ft>>16],u_pixel_coord_lower:[tt&65535,ft&65535]}}function bc(ye,W,de,te){var me=de.imageManager.getPattern(ye.from.toString()),Ue=de.imageManager.getPattern(ye.to.toString()),tt=de.imageManager.getPixelSize(),ft=tt.width,st=tt.height,bt=Math.pow(2,te.tileID.overscaledZ),It=te.tileSize*Math.pow(2,de.transform.tileZoom)/bt,Jt=It*(te.tileID.canonical.x+te.tileID.wrap*bt),Kt=It*te.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:me.tl,u_pattern_br_a:me.br,u_pattern_tl_b:Ue.tl,u_pattern_br_b:Ue.br,u_texsize:[ft,st],u_mix:W.t,u_pattern_size_a:me.displaySize,u_pattern_size_b:Ue.displaySize,u_scale_a:W.fromScale,u_scale_b:W.toScale,u_tile_units_to_pixels:1/xi(te,1,de.transform.tileZoom),u_pixel_coord_upper:[Jt>>16,Kt>>16],u_pixel_coord_lower:[Jt&65535,Kt&65535]}}var Lf=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_lightpos:new e.Uniform3f(ye,W.u_lightpos),u_lightintensity:new e.Uniform1f(ye,W.u_lightintensity),u_lightcolor:new e.Uniform3f(ye,W.u_lightcolor),u_vertical_gradient:new e.Uniform1f(ye,W.u_vertical_gradient),u_opacity:new e.Uniform1f(ye,W.u_opacity)}},xl=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_lightpos:new e.Uniform3f(ye,W.u_lightpos),u_lightintensity:new e.Uniform1f(ye,W.u_lightintensity),u_lightcolor:new e.Uniform3f(ye,W.u_lightcolor),u_vertical_gradient:new e.Uniform1f(ye,W.u_vertical_gradient),u_height_factor:new e.Uniform1f(ye,W.u_height_factor),u_image:new e.Uniform1i(ye,W.u_image),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ye,W.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ye,W.u_pixel_coord_lower),u_scale:new e.Uniform3f(ye,W.u_scale),u_fade:new e.Uniform1f(ye,W.u_fade),u_opacity:new e.Uniform1f(ye,W.u_opacity)}},nf=function(ye,W,de,te){var me=W.style.light,Ue=me.properties.get("position"),tt=[Ue.x,Ue.y,Ue.z],ft=e.create$1();me.properties.get("anchor")==="viewport"&&e.fromRotation(ft,-W.transform.angle),e.transformMat3(tt,tt,ft);var st=me.properties.get("color");return{u_matrix:ye,u_lightpos:tt,u_lightintensity:me.properties.get("intensity"),u_lightcolor:[st.r,st.g,st.b],u_vertical_gradient:+de,u_opacity:te}},ou=function(ye,W,de,te,me,Ue,tt){return e.extend(nf(ye,W,de,te),Iu(Ue,W,tt),{u_height_factor:-Math.pow(2,me.overscaledZ)/tt.tileSize/8})},Ru=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix)}},Au=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_image:new e.Uniform1i(ye,W.u_image),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ye,W.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ye,W.u_pixel_coord_lower),u_scale:new e.Uniform3f(ye,W.u_scale),u_fade:new e.Uniform1f(ye,W.u_fade)}},Zs=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_world:new e.Uniform2f(ye,W.u_world)}},Ol=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_world:new e.Uniform2f(ye,W.u_world),u_image:new e.Uniform1i(ye,W.u_image),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ye,W.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ye,W.u_pixel_coord_lower),u_scale:new e.Uniform3f(ye,W.u_scale),u_fade:new e.Uniform1f(ye,W.u_fade)}},bl=function(ye){return{u_matrix:ye}},tc=function(ye,W,de,te){return e.extend(bl(ye),Iu(de,W,te))},Su=function(ye,W){return{u_matrix:ye,u_world:W}},Cc=function(ye,W,de,te,me){return e.extend(tc(ye,W,de,te),{u_world:me})},Ht=function(ye,W){return{u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(ye,W.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(ye,W.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(ye,W.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix)}},ur=function(ye,W,de,te){var me=ye.transform,Ue,tt;if(te.paint.get("circle-pitch-alignment")==="map"){var ft=xi(de,1,me.zoom);Ue=!0,tt=[ft,ft]}else Ue=!1,tt=me.pixelsToGLUnits;return{u_camera_to_center_distance:me.cameraToCenterDistance,u_scale_with_map:+(te.paint.get("circle-pitch-scale")==="map"),u_matrix:ye.translatePosMatrix(W.posMatrix,de,te.paint.get("circle-translate"),te.paint.get("circle-translate-anchor")),u_pitch_with_map:+Ue,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:tt}},qr=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(ye,W.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(ye,W.u_extrude_scale),u_overscale_factor:new e.Uniform1f(ye,W.u_overscale_factor)}},Or=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_inv_matrix:new e.UniformMatrix4f(ye,W.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(ye,W.u_viewport_size)}},ua=function(ye,W,de){var te=xi(de,1,W.zoom),me=Math.pow(2,W.zoom-de.tileID.overscaledZ),Ue=de.tileID.overscaleFactor();return{u_matrix:ye,u_camera_to_center_distance:W.cameraToCenterDistance,u_pixels_to_tile_units:te,u_extrude_scale:[W.pixelsToGLUnits[0]/(te*me),W.pixelsToGLUnits[1]/(te*me)],u_overscale_factor:Ue}},Fa=function(ye,W,de){return{u_matrix:ye,u_inv_matrix:W,u_camera_to_center_distance:de.cameraToCenterDistance,u_viewport_size:[de.width,de.height]}},ja=function(ye,W){return{u_color:new e.UniformColor(ye,W.u_color),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_overlay:new e.Uniform1i(ye,W.u_overlay),u_overlay_scale:new e.Uniform1f(ye,W.u_overlay_scale)}},sn=function(ye,W,de){return de===void 0&&(de=1),{u_matrix:ye,u_color:W,u_overlay:0,u_overlay_scale:de}},gn=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix)}},kn=function(ye){return{u_matrix:ye}},Ja=function(ye,W){return{u_extrude_scale:new e.Uniform1f(ye,W.u_extrude_scale),u_intensity:new e.Uniform1f(ye,W.u_intensity),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix)}},_n=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_world:new e.Uniform2f(ye,W.u_world),u_image:new e.Uniform1i(ye,W.u_image),u_color_ramp:new e.Uniform1i(ye,W.u_color_ramp),u_opacity:new e.Uniform1f(ye,W.u_opacity)}},on=function(ye,W,de,te){return{u_matrix:ye,u_extrude_scale:xi(W,1,de),u_intensity:te}},Wa=function(ye,W,de,te){var me=e.create();e.ortho(me,0,ye.width,ye.height,0,0,1);var Ue=ye.context.gl;return{u_matrix:me,u_world:[Ue.drawingBufferWidth,Ue.drawingBufferHeight],u_image:de,u_color_ramp:te,u_opacity:W.paint.get("heatmap-opacity")}},On=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_image:new e.Uniform1i(ye,W.u_image),u_latrange:new e.Uniform2f(ye,W.u_latrange),u_light:new e.Uniform2f(ye,W.u_light),u_shadow:new e.UniformColor(ye,W.u_shadow),u_highlight:new e.UniformColor(ye,W.u_highlight),u_accent:new e.UniformColor(ye,W.u_accent)}},zi=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_image:new e.Uniform1i(ye,W.u_image),u_dimension:new e.Uniform2f(ye,W.u_dimension),u_zoom:new e.Uniform1f(ye,W.u_zoom),u_unpack:new e.Uniform4f(ye,W.u_unpack)}},ki=function(ye,W,de){var te=de.paint.get("hillshade-shadow-color"),me=de.paint.get("hillshade-highlight-color"),Ue=de.paint.get("hillshade-accent-color"),tt=de.paint.get("hillshade-illumination-direction")*(Math.PI/180);de.paint.get("hillshade-illumination-anchor")==="viewport"&&(tt-=ye.transform.angle);var ft=!ye.options.moving;return{u_matrix:ye.transform.calculatePosMatrix(W.tileID.toUnwrapped(),ft),u_image:0,u_latrange:Ni(ye,W.tileID),u_light:[de.paint.get("hillshade-exaggeration"),tt],u_shadow:te,u_highlight:me,u_accent:Ue}},ji=function(ye,W){var de=W.stride,te=e.create();return e.ortho(te,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(te,te,[0,-e.EXTENT,0]),{u_matrix:te,u_image:1,u_dimension:[de,de],u_zoom:ye.overscaledZ,u_unpack:W.getUnpackVector()}};function Ni(ye,W){var de=Math.pow(2,W.canonical.z),te=W.canonical.y;return[new e.MercatorCoordinate(0,te/de).toLngLat().lat,new e.MercatorCoordinate(0,(te+1)/de).toLngLat().lat]}var Bn=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_ratio:new e.Uniform1f(ye,W.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(ye,W.u_units_to_pixels)}},An=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_ratio:new e.Uniform1f(ye,W.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(ye,W.u_units_to_pixels),u_image:new e.Uniform1i(ye,W.u_image),u_image_height:new e.Uniform1f(ye,W.u_image_height)}},Ki=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_ratio:new e.Uniform1f(ye,W.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_image:new e.Uniform1i(ye,W.u_image),u_units_to_pixels:new e.Uniform2f(ye,W.u_units_to_pixels),u_scale:new e.Uniform3f(ye,W.u_scale),u_fade:new e.Uniform1f(ye,W.u_fade)}},ko=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_ratio:new e.Uniform1f(ye,W.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(ye,W.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(ye,W.u_patternscale_a),u_patternscale_b:new e.Uniform2f(ye,W.u_patternscale_b),u_sdfgamma:new e.Uniform1f(ye,W.u_sdfgamma),u_image:new e.Uniform1i(ye,W.u_image),u_tex_y_a:new e.Uniform1f(ye,W.u_tex_y_a),u_tex_y_b:new e.Uniform1f(ye,W.u_tex_y_b),u_mix:new e.Uniform1f(ye,W.u_mix)}},$o=function(ye,W,de){var te=ye.transform;return{u_matrix:il(ye,W,de),u_ratio:1/xi(W,1,te.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/te.pixelsToGLUnits[0],1/te.pixelsToGLUnits[1]]}},Ls=function(ye,W,de,te){return e.extend($o(ye,W,de),{u_image:0,u_image_height:te})},os=function(ye,W,de,te){var me=ye.transform,Ue=jo(W,me);return{u_matrix:il(ye,W,de),u_texsize:W.imageAtlasTexture.size,u_ratio:1/xi(W,1,me.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[Ue,te.fromScale,te.toScale],u_fade:te.t,u_units_to_pixels:[1/me.pixelsToGLUnits[0],1/me.pixelsToGLUnits[1]]}},As=function(ye,W,de,te,me){var Ue=ye.transform,tt=ye.lineAtlas,ft=jo(W,Ue),st=de.layout.get("line-cap")==="round",bt=tt.getDash(te.from,st),It=tt.getDash(te.to,st),Jt=bt.width*me.fromScale,Kt=It.width*me.toScale;return e.extend($o(ye,W,de),{u_patternscale_a:[ft/Jt,-bt.height/2],u_patternscale_b:[ft/Kt,-It.height/2],u_sdfgamma:tt.width/(Math.min(Jt,Kt)*256*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:bt.y,u_tex_y_b:It.y,u_mix:me.t})};function jo(ye,W){return 1/xi(ye,1,W.tileZoom)}function il(ye,W,de){return ye.translatePosMatrix(W.tileID.posMatrix,W,de.paint.get("line-translate"),de.paint.get("line-translate-anchor"))}var Qs=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_tl_parent:new e.Uniform2f(ye,W.u_tl_parent),u_scale_parent:new e.Uniform1f(ye,W.u_scale_parent),u_buffer_scale:new e.Uniform1f(ye,W.u_buffer_scale),u_fade_t:new e.Uniform1f(ye,W.u_fade_t),u_opacity:new e.Uniform1f(ye,W.u_opacity),u_image0:new e.Uniform1i(ye,W.u_image0),u_image1:new e.Uniform1i(ye,W.u_image1),u_brightness_low:new e.Uniform1f(ye,W.u_brightness_low),u_brightness_high:new e.Uniform1f(ye,W.u_brightness_high),u_saturation_factor:new e.Uniform1f(ye,W.u_saturation_factor),u_contrast_factor:new e.Uniform1f(ye,W.u_contrast_factor),u_spin_weights:new e.Uniform3f(ye,W.u_spin_weights)}},Ss=function(ye,W,de,te,me){return{u_matrix:ye,u_tl_parent:W,u_scale_parent:de,u_buffer_scale:1,u_fade_t:te.mix,u_opacity:te.opacity*me.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:me.paint.get("raster-brightness-min"),u_brightness_high:me.paint.get("raster-brightness-max"),u_saturation_factor:gs(me.paint.get("raster-saturation")),u_contrast_factor:ao(me.paint.get("raster-contrast")),u_spin_weights:fi(me.paint.get("raster-hue-rotate"))}};function fi(ye){ye*=Math.PI/180;var W=Math.sin(ye),de=Math.cos(ye);return[(2*de+1)/3,(-Math.sqrt(3)*W-de+1)/3,(Math.sqrt(3)*W-de+1)/3]}function ao(ye){return ye>0?1/(1-ye):1+ye}function gs(ye){return ye>0?1-1/(1.001-ye):-ye}var Jo=function(ye,W){return{u_is_size_zoom_constant:new e.Uniform1i(ye,W.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(ye,W.u_is_size_feature_constant),u_size_t:new e.Uniform1f(ye,W.u_size_t),u_size:new e.Uniform1f(ye,W.u_size),u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_pitch:new e.Uniform1f(ye,W.u_pitch),u_rotate_symbol:new e.Uniform1i(ye,W.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(ye,W.u_aspect_ratio),u_fade_change:new e.Uniform1f(ye,W.u_fade_change),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(ye,W.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(ye,W.u_coord_matrix),u_is_text:new e.Uniform1i(ye,W.u_is_text),u_pitch_with_map:new e.Uniform1i(ye,W.u_pitch_with_map),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_texture:new e.Uniform1i(ye,W.u_texture)}},Bl=function(ye,W){return{u_is_size_zoom_constant:new e.Uniform1i(ye,W.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(ye,W.u_is_size_feature_constant),u_size_t:new e.Uniform1f(ye,W.u_size_t),u_size:new e.Uniform1f(ye,W.u_size),u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_pitch:new e.Uniform1f(ye,W.u_pitch),u_rotate_symbol:new e.Uniform1i(ye,W.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(ye,W.u_aspect_ratio),u_fade_change:new e.Uniform1f(ye,W.u_fade_change),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(ye,W.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(ye,W.u_coord_matrix),u_is_text:new e.Uniform1i(ye,W.u_is_text),u_pitch_with_map:new e.Uniform1i(ye,W.u_pitch_with_map),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_texture:new e.Uniform1i(ye,W.u_texture),u_gamma_scale:new e.Uniform1f(ye,W.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(ye,W.u_is_halo)}},jl=function(ye,W){return{u_is_size_zoom_constant:new e.Uniform1i(ye,W.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(ye,W.u_is_size_feature_constant),u_size_t:new e.Uniform1f(ye,W.u_size_t),u_size:new e.Uniform1f(ye,W.u_size),u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_pitch:new e.Uniform1f(ye,W.u_pitch),u_rotate_symbol:new e.Uniform1i(ye,W.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(ye,W.u_aspect_ratio),u_fade_change:new e.Uniform1f(ye,W.u_fade_change),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(ye,W.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(ye,W.u_coord_matrix),u_is_text:new e.Uniform1i(ye,W.u_is_text),u_pitch_with_map:new e.Uniform1i(ye,W.u_pitch_with_map),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_texsize_icon:new e.Uniform2f(ye,W.u_texsize_icon),u_texture:new e.Uniform1i(ye,W.u_texture),u_texture_icon:new e.Uniform1i(ye,W.u_texture_icon),u_gamma_scale:new e.Uniform1f(ye,W.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(ye,W.u_is_halo)}},Vl=function(ye,W,de,te,me,Ue,tt,ft,st,bt){var It=me.transform;return{u_is_size_zoom_constant:+(ye==="constant"||ye==="source"),u_is_size_feature_constant:+(ye==="constant"||ye==="camera"),u_size_t:W?W.uSizeT:0,u_size:W?W.uSize:0,u_camera_to_center_distance:It.cameraToCenterDistance,u_pitch:It.pitch/360*2*Math.PI,u_rotate_symbol:+de,u_aspect_ratio:It.width/It.height,u_fade_change:me.options.fadeDuration?me.symbolFadeChange:1,u_matrix:Ue,u_label_plane_matrix:tt,u_coord_matrix:ft,u_is_text:+st,u_pitch_with_map:+te,u_texsize:bt,u_texture:0}},cc=function(ye,W,de,te,me,Ue,tt,ft,st,bt,It){var Jt=me.transform;return e.extend(Vl(ye,W,de,te,me,Ue,tt,ft,st,bt),{u_gamma_scale:te?Math.cos(Jt._pitch)*Jt.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+It})},ql=function(ye,W,de,te,me,Ue,tt,ft,st,bt){return e.extend(cc(ye,W,de,te,me,Ue,tt,ft,!0,st,!0),{u_texsize_icon:bt,u_texture_icon:1})},Vu=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_opacity:new e.Uniform1f(ye,W.u_opacity),u_color:new e.UniformColor(ye,W.u_color)}},ol=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_opacity:new e.Uniform1f(ye,W.u_opacity),u_image:new e.Uniform1i(ye,W.u_image),u_pattern_tl_a:new e.Uniform2f(ye,W.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(ye,W.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(ye,W.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(ye,W.u_pattern_br_b),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_mix:new e.Uniform1f(ye,W.u_mix),u_pattern_size_a:new e.Uniform2f(ye,W.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(ye,W.u_pattern_size_b),u_scale_a:new e.Uniform1f(ye,W.u_scale_a),u_scale_b:new e.Uniform1f(ye,W.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(ye,W.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ye,W.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(ye,W.u_tile_units_to_pixels)}},rc=function(ye,W,de){return{u_matrix:ye,u_opacity:W,u_color:de}},Vi=function(ye,W,de,te,me,Ue){return e.extend(bc(te,Ue,de,me),{u_matrix:ye,u_opacity:W})},eo={fillExtrusion:Lf,fillExtrusionPattern:xl,fill:Ru,fillPattern:Au,fillOutline:Zs,fillOutlinePattern:Ol,circle:Ht,collisionBox:qr,collisionCircle:Or,debug:ja,clippingMask:gn,heatmap:Ja,heatmapTexture:_n,hillshade:On,hillshadePrepare:zi,line:Bn,lineGradient:An,linePattern:Ki,lineSDF:ko,raster:Qs,symbolIcon:Jo,symbolSDF:Bl,symbolTextAndIcon:jl,background:Vu,backgroundPattern:ol},qu;function Du(ye,W,de,te,me,Ue,tt){for(var ft=ye.context,st=ft.gl,bt=ye.useProgram("collisionBox"),It=[],Jt=0,Kt=0,vr=0;vr0){var ha=e.create(),Ea=pr;e.mul(ha,tr.placementInvProjMatrix,ye.transform.glCoordMatrix),e.mul(ha,ha,tr.placementViewportMatrix),It.push({circleArray:ea,circleOffset:Kt,transform:Ea,invTransform:ha}),Jt+=ea.length/4,Kt=Jt}xr&&bt.draw(ft,st.LINES,wa.disabled,va.disabled,ye.colorModeForRenderPass(),gr.disabled,ua(pr,ye.transform,wr),de.id,xr.layoutVertexBuffer,xr.indexBuffer,xr.segments,null,ye.transform.zoom,null,null,xr.collisionVertexBuffer)}}if(!(!tt||!It.length)){var tn=ye.useProgram("collisionCircle"),Xa=new e.StructArrayLayout2f1f2i16;Xa.resize(Jt*4),Xa._trim();for(var Ya=0,an=0,hn=It;an=0&&(Tr[tr.associatedIconIndex]={shiftedAnchor:En,angle:Yn})}}if(It){vr.clear();for(var ai=ye.icon.placedSymbolArray,Io=0;Io0){var tt=e.browser.now(),ft=(tt-ye.timeAdded)/Ue,st=W?(tt-W.timeAdded)/Ue:-1,bt=de.getSource(),It=me.coveringZoomLevel({tileSize:bt.tileSize,roundZoom:bt.roundZoom}),Jt=!W||Math.abs(W.tileID.overscaledZ-It)>Math.abs(ye.tileID.overscaledZ-It),Kt=Jt&&ye.refreshedUponExpiration?1:e.clamp(Jt?ft:1-st,0,1);return ye.refreshedUponExpiration&&ft>=1&&(ye.refreshedUponExpiration=!1),W?{opacity:1,mix:1-Kt}:{opacity:Kt,mix:0}}else return{opacity:1,mix:0}}function sr(ye,W,de){var te=de.paint.get("background-color"),me=de.paint.get("background-opacity");if(me!==0){var Ue=ye.context,tt=Ue.gl,ft=ye.transform,st=ft.tileSize,bt=de.paint.get("background-pattern");if(!ye.isPatternMissing(bt)){var It=!bt&&te.a===1&&me===1&&ye.opaquePassEnabledForLayer()?"opaque":"translucent";if(ye.renderPass===It){var Jt=va.disabled,Kt=ye.depthModeForSublayer(0,It==="opaque"?wa.ReadWrite:wa.ReadOnly),vr=ye.colorModeForRenderPass(),Tr=ye.useProgram(bt?"backgroundPattern":"background"),wr=ft.coveringTiles({tileSize:st});bt&&(Ue.activeTexture.set(tt.TEXTURE0),ye.imageManager.bind(ye.context));for(var tr=de.getCrossfadeParameters(),pr=0,xr=wr;pr "+de.overscaledZ);var pr=tr+" "+vr+"kb";Gi(ye,pr),tt.draw(te,me.TRIANGLES,ft,st,Lt.alphaBlended,gr.disabled,sn(Ue,e.Color.transparent,wr),It,ye.debugBuffer,ye.quadTriangleIndexBuffer,ye.debugSegments)}function Gi(ye,W){ye.initDebugOverlayCanvas();var de=ye.debugOverlayCanvas,te=ye.context.gl,me=ye.debugOverlayCanvas.getContext("2d");me.clearRect(0,0,de.width,de.height),me.shadowColor="white",me.shadowBlur=2,me.lineWidth=1.5,me.strokeStyle="white",me.textBaseline="top",me.font="bold 36px Open Sans, sans-serif",me.fillText(W,5,5),me.strokeText(W,5,5),ye.debugOverlayTexture.update(de),ye.debugOverlayTexture.bind(te.LINEAR,te.CLAMP_TO_EDGE)}function Bo(ye,W,de){var te=ye.context,me=de.implementation;if(ye.renderPass==="offscreen"){var Ue=me.prerender;Ue&&(ye.setCustomLayerDefaults(),te.setColorMode(ye.colorModeForRenderPass()),Ue.call(me,te.gl,ye.transform.customLayerMatrix()),te.setDirty(),ye.setBaseState())}else if(ye.renderPass==="translucent"){ye.setCustomLayerDefaults(),te.setColorMode(ye.colorModeForRenderPass()),te.setStencilMode(va.disabled);var tt=me.renderingMode==="3d"?new wa(ye.context.gl.LEQUAL,wa.ReadWrite,ye.depthRangeFor3D):ye.depthModeForSublayer(0,wa.ReadOnly);te.setDepthMode(tt),me.render(te.gl,ye.transform.customLayerMatrix()),te.setDirty(),ye.setBaseState(),te.bindFramebuffer.set(null)}}var No={symbol:I,circle:Ct,heatmap:Wt,line:Wr,fill:je,"fill-extrusion":at,hillshade:Tt,raster:Yt,background:sr,debug:pi,custom:Bo},po=function(W,de){this.context=new Br(W),this.transform=de,this._tileTextures={},this.setup(),this.numSublayers=na.maxUnderzooming+na.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new $l,this.gpuTimers={}};po.prototype.resize=function(W,de){if(this.width=W*e.browser.devicePixelRatio,this.height=de*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var te=0,me=this.style._order;te256&&this.clearStencil(),te.setColorMode(Lt.disabled),te.setDepthMode(wa.disabled);var Ue=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var tt=0,ft=de;tt256&&this.clearStencil();var W=this.nextStencilID++,de=this.context.gl;return new va({func:de.NOTEQUAL,mask:255},W,255,de.KEEP,de.KEEP,de.REPLACE)},po.prototype.stencilModeForClipping=function(W){var de=this.context.gl;return new va({func:de.EQUAL,mask:255},this._tileClippingMaskIDs[W.key],0,de.KEEP,de.KEEP,de.REPLACE)},po.prototype.stencilConfigForOverlap=function(W){var de,te=this.context.gl,me=W.sort(function(bt,It){return It.overscaledZ-bt.overscaledZ}),Ue=me[me.length-1].overscaledZ,tt=me[0].overscaledZ-Ue+1;if(tt>1){this.currentStencilSource=void 0,this.nextStencilID+tt>256&&this.clearStencil();for(var ft={},st=0;st=0;this.currentLayer--){var ha=this.style._layers[me[this.currentLayer]],Ea=Ue[ha.source],tn=st[ha.source];this._renderTileClippingMasks(ha,tn),this.renderLayer(this,Ea,ha,tn)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?de.pop():null},po.prototype.isPatternMissing=function(W){if(!W)return!1;if(!W.from||!W.to)return!0;var de=this.imageManager.getPattern(W.from.toString()),te=this.imageManager.getPattern(W.to.toString());return!de||!te},po.prototype.useProgram=function(W,de){this.cache=this.cache||{};var te=""+W+(de?de.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[te]||(this.cache[te]=new xc(this.context,W,_c[W],de,eo[W],this._showOverdrawInspector)),this.cache[te]},po.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()},po.prototype.setBaseState=function(){var W=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(W.FUNC_ADD)},po.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var W=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,W.RGBA)}},po.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Zo=function(W,de){this.points=W,this.planes=de};Zo.fromInvProjectionMatrix=function(W,de,te){var me=[[-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]],Ue=Math.pow(2,te),tt=me.map(function(bt){return e.transformMat4([],bt,W)}).map(function(bt){return e.scale$1([],bt,1/bt[3]/de*Ue)}),ft=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],st=ft.map(function(bt){var It=e.sub([],tt[bt[0]],tt[bt[1]]),Jt=e.sub([],tt[bt[2]],tt[bt[1]]),Kt=e.normalize([],e.cross([],It,Jt)),vr=-e.dot(Kt,tt[bt[1]]);return Kt.concat(vr)});return new Zo(tt,st)};var Hs=function(W,de){this.min=W,this.max=de,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};Hs.prototype.quadrant=function(W){for(var de=[W%2===0,W<2],te=e.clone$2(this.min),me=e.clone$2(this.max),Ue=0;Ue=0;if(tt===0)return 0;tt!==de.length&&(te=!1)}if(te)return 2;for(var st=0;st<3;st++){for(var bt=Number.MAX_VALUE,It=-Number.MAX_VALUE,Jt=0;Jtthis.max[st]-this.min[st])return 0}return 1};var zs=function(W,de,te,me){if(W===void 0&&(W=0),de===void 0&&(de=0),te===void 0&&(te=0),me===void 0&&(me=0),isNaN(W)||W<0||isNaN(de)||de<0||isNaN(te)||te<0||isNaN(me)||me<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=W,this.bottom=de,this.left=te,this.right=me};zs.prototype.interpolate=function(W,de,te){return de.top!=null&&W.top!=null&&(this.top=e.number(W.top,de.top,te)),de.bottom!=null&&W.bottom!=null&&(this.bottom=e.number(W.bottom,de.bottom,te)),de.left!=null&&W.left!=null&&(this.left=e.number(W.left,de.left,te)),de.right!=null&&W.right!=null&&(this.right=e.number(W.right,de.right,te)),this},zs.prototype.getCenter=function(W,de){var te=e.clamp((this.left+W-this.right)/2,0,W),me=e.clamp((this.top+de-this.bottom)/2,0,de);return new e.Point(te,me)},zs.prototype.equals=function(W){return this.top===W.top&&this.bottom===W.bottom&&this.left===W.left&&this.right===W.right},zs.prototype.clone=function(){return new zs(this.top,this.bottom,this.left,this.right)},zs.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var xo=function(W,de,te,me,Ue){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=Ue===void 0?!0:Ue,this._minZoom=W||0,this._maxZoom=de||22,this._minPitch=te??0,this._maxPitch=me??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new zs,this._posMatrixCache={},this._alignedPosMatrixCache={}},bo={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}};xo.prototype.clone=function(){var W=new xo(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return W.tileSize=this.tileSize,W.latRange=this.latRange,W.width=this.width,W.height=this.height,W._center=this._center,W.zoom=this.zoom,W.angle=this.angle,W._fov=this._fov,W._pitch=this._pitch,W._unmodified=this._unmodified,W._edgeInsets=this._edgeInsets.clone(),W._calcMatrices(),W},bo.minZoom.get=function(){return this._minZoom},bo.minZoom.set=function(ye){this._minZoom!==ye&&(this._minZoom=ye,this.zoom=Math.max(this.zoom,ye))},bo.maxZoom.get=function(){return this._maxZoom},bo.maxZoom.set=function(ye){this._maxZoom!==ye&&(this._maxZoom=ye,this.zoom=Math.min(this.zoom,ye))},bo.minPitch.get=function(){return this._minPitch},bo.minPitch.set=function(ye){this._minPitch!==ye&&(this._minPitch=ye,this.pitch=Math.max(this.pitch,ye))},bo.maxPitch.get=function(){return this._maxPitch},bo.maxPitch.set=function(ye){this._maxPitch!==ye&&(this._maxPitch=ye,this.pitch=Math.min(this.pitch,ye))},bo.renderWorldCopies.get=function(){return this._renderWorldCopies},bo.renderWorldCopies.set=function(ye){ye===void 0?ye=!0:ye===null&&(ye=!1),this._renderWorldCopies=ye},bo.worldSize.get=function(){return this.tileSize*this.scale},bo.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},bo.size.get=function(){return new e.Point(this.width,this.height)},bo.bearing.get=function(){return-this.angle/Math.PI*180},bo.bearing.set=function(ye){var W=-e.wrap(ye,-180,180)*Math.PI/180;this.angle!==W&&(this._unmodified=!1,this.angle=W,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},bo.pitch.get=function(){return this._pitch/Math.PI*180},bo.pitch.set=function(ye){var W=e.clamp(ye,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==W&&(this._unmodified=!1,this._pitch=W,this._calcMatrices())},bo.fov.get=function(){return this._fov/Math.PI*180},bo.fov.set=function(ye){ye=Math.max(.01,Math.min(60,ye)),this._fov!==ye&&(this._unmodified=!1,this._fov=ye/180*Math.PI,this._calcMatrices())},bo.zoom.get=function(){return this._zoom},bo.zoom.set=function(ye){var W=Math.min(Math.max(ye,this.minZoom),this.maxZoom);this._zoom!==W&&(this._unmodified=!1,this._zoom=W,this.scale=this.zoomScale(W),this.tileZoom=Math.floor(W),this.zoomFraction=W-this.tileZoom,this._constrain(),this._calcMatrices())},bo.center.get=function(){return this._center},bo.center.set=function(ye){ye.lat===this._center.lat&&ye.lng===this._center.lng||(this._unmodified=!1,this._center=ye,this._constrain(),this._calcMatrices())},bo.padding.get=function(){return this._edgeInsets.toJSON()},bo.padding.set=function(ye){this._edgeInsets.equals(ye)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,ye,1),this._calcMatrices())},bo.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},xo.prototype.isPaddingEqual=function(W){return this._edgeInsets.equals(W)},xo.prototype.interpolatePadding=function(W,de,te){this._unmodified=!1,this._edgeInsets.interpolate(W,de,te),this._constrain(),this._calcMatrices()},xo.prototype.coveringZoomLevel=function(W){var de=(W.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/W.tileSize));return Math.max(0,de)},xo.prototype.getVisibleUnwrappedCoordinates=function(W){var de=[new e.UnwrappedTileID(0,W)];if(this._renderWorldCopies)for(var te=this.pointCoordinate(new e.Point(0,0)),me=this.pointCoordinate(new e.Point(this.width,0)),Ue=this.pointCoordinate(new e.Point(this.width,this.height)),tt=this.pointCoordinate(new e.Point(0,this.height)),ft=Math.floor(Math.min(te.x,me.x,Ue.x,tt.x)),st=Math.floor(Math.max(te.x,me.x,Ue.x,tt.x)),bt=1,It=ft-bt;It<=st+bt;It++)It!==0&&de.push(new e.UnwrappedTileID(It,W));return de},xo.prototype.coveringTiles=function(W){var de=this.coveringZoomLevel(W),te=de;if(W.minzoom!==void 0&&deW.maxzoom&&(de=W.maxzoom);var me=e.MercatorCoordinate.fromLngLat(this.center),Ue=Math.pow(2,de),tt=[Ue*me.x,Ue*me.y,0],ft=Zo.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,de),st=W.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(st=de);var bt=3,It=function(fn){return{aabb:new Hs([fn*Ue,0,0],[(fn+1)*Ue,Ue,0]),zoom:0,x:0,y:0,wrap:fn,fullyVisible:!1}},Jt=[],Kt=[],vr=de,Tr=W.reparseOverscaled?te:de;if(this._renderWorldCopies)for(var wr=1;wr<=3;wr++)Jt.push(It(-wr)),Jt.push(It(wr));for(Jt.push(It(0));Jt.length>0;){var tr=Jt.pop(),pr=tr.x,xr=tr.y,ea=tr.fullyVisible;if(!ea){var ha=tr.aabb.intersects(ft);if(ha===0)continue;ea=ha===2}var Ea=tr.aabb.distanceX(tt),tn=tr.aabb.distanceY(tt),Xa=Math.max(Math.abs(Ea),Math.abs(tn)),Ya=bt+(1<Ya&&tr.zoom>=st){Kt.push({tileID:new e.OverscaledTileID(tr.zoom===vr?Tr:tr.zoom,tr.wrap,tr.zoom,pr,xr),distanceSq:e.sqrLen([tt[0]-.5-pr,tt[1]-.5-xr])});continue}for(var an=0;an<4;an++){var hn=(pr<<1)+an%2,xn=(xr<<1)+(an>>1);Jt.push({aabb:tr.aabb.quadrant(an),zoom:tr.zoom+1,x:hn,y:xn,wrap:tr.wrap,fullyVisible:ea})}}return Kt.sort(function(fn,En){return fn.distanceSq-En.distanceSq}).map(function(fn){return fn.tileID})},xo.prototype.resize=function(W,de){this.width=W,this.height=de,this.pixelsToGLUnits=[2/W,-2/de],this._constrain(),this._calcMatrices()},bo.unmodified.get=function(){return this._unmodified},xo.prototype.zoomScale=function(W){return Math.pow(2,W)},xo.prototype.scaleZoom=function(W){return Math.log(W)/Math.LN2},xo.prototype.project=function(W){var de=e.clamp(W.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(W.lng)*this.worldSize,e.mercatorYfromLat(de)*this.worldSize)},xo.prototype.unproject=function(W){return new e.MercatorCoordinate(W.x/this.worldSize,W.y/this.worldSize).toLngLat()},bo.point.get=function(){return this.project(this.center)},xo.prototype.setLocationAtPoint=function(W,de){var te=this.pointCoordinate(de),me=this.pointCoordinate(this.centerPoint),Ue=this.locationCoordinate(W),tt=new e.MercatorCoordinate(Ue.x-(te.x-me.x),Ue.y-(te.y-me.y));this.center=this.coordinateLocation(tt),this._renderWorldCopies&&(this.center=this.center.wrap())},xo.prototype.locationPoint=function(W){return this.coordinatePoint(this.locationCoordinate(W))},xo.prototype.pointLocation=function(W){return this.coordinateLocation(this.pointCoordinate(W))},xo.prototype.locationCoordinate=function(W){return e.MercatorCoordinate.fromLngLat(W)},xo.prototype.coordinateLocation=function(W){return W.toLngLat()},xo.prototype.pointCoordinate=function(W){var de=0,te=[W.x,W.y,0,1],me=[W.x,W.y,1,1];e.transformMat4(te,te,this.pixelMatrixInverse),e.transformMat4(me,me,this.pixelMatrixInverse);var Ue=te[3],tt=me[3],ft=te[0]/Ue,st=me[0]/tt,bt=te[1]/Ue,It=me[1]/tt,Jt=te[2]/Ue,Kt=me[2]/tt,vr=Jt===Kt?0:(de-Jt)/(Kt-Jt);return new e.MercatorCoordinate(e.number(ft,st,vr)/this.worldSize,e.number(bt,It,vr)/this.worldSize)},xo.prototype.coordinatePoint=function(W){var de=[W.x*this.worldSize,W.y*this.worldSize,0,1];return e.transformMat4(de,de,this.pixelMatrix),new e.Point(de[0]/de[3],de[1]/de[3])},xo.prototype.getBounds=function(){return new e.LngLatBounds().extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},xo.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},xo.prototype.setMaxBounds=function(W){W?(this.lngRange=[W.getWest(),W.getEast()],this.latRange=[W.getSouth(),W.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},xo.prototype.calculatePosMatrix=function(W,de){de===void 0&&(de=!1);var te=W.key,me=de?this._alignedPosMatrixCache:this._posMatrixCache;if(me[te])return me[te];var Ue=W.canonical,tt=this.worldSize/this.zoomScale(Ue.z),ft=Ue.x+Math.pow(2,Ue.z)*W.wrap,st=e.identity(new Float64Array(16));return e.translate(st,st,[ft*tt,Ue.y*tt,0]),e.scale(st,st,[tt/e.EXTENT,tt/e.EXTENT,1]),e.multiply(st,de?this.alignedProjMatrix:this.projMatrix,st),me[te]=new Float32Array(st),me[te]},xo.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},xo.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var W=-90,de=90,te=-180,me=180,Ue,tt,ft,st,bt=this.size,It=this._unmodified;if(this.latRange){var Jt=this.latRange;W=e.mercatorYfromLat(Jt[1])*this.worldSize,de=e.mercatorYfromLat(Jt[0])*this.worldSize,Ue=de-Wde&&(st=de-tr)}if(this.lngRange){var pr=vr.x,xr=bt.x/2;pr-xrme&&(ft=me-xr)}(ft!==void 0||st!==void 0)&&(this.center=this.unproject(new e.Point(ft!==void 0?ft:vr.x,st!==void 0?st:vr.y))),this._unmodified=It,this._constraining=!1}},xo.prototype._calcMatrices=function(){if(this.height){var W=this._fov/2,de=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(W)*this.height;var te=Math.PI/2+this._pitch,me=this._fov*(.5+de.y/this.height),Ue=Math.sin(me)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-te-me,.01,Math.PI-.01)),tt=this.point,ft=tt.x,st=tt.y,bt=Math.cos(Math.PI/2-this._pitch)*Ue+this.cameraToCenterDistance,It=bt*1.01,Jt=this.height/50,Kt=new Float64Array(16);e.perspective(Kt,this._fov,this.width/this.height,Jt,It),Kt[8]=-de.x*2/this.width,Kt[9]=de.y*2/this.height,e.scale(Kt,Kt,[1,-1,1]),e.translate(Kt,Kt,[0,0,-this.cameraToCenterDistance]),e.rotateX(Kt,Kt,this._pitch),e.rotateZ(Kt,Kt,this.angle),e.translate(Kt,Kt,[-ft,-st,0]),this.mercatorMatrix=e.scale([],Kt,[this.worldSize,this.worldSize,this.worldSize]),e.scale(Kt,Kt,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Kt,this.invProjMatrix=e.invert([],this.projMatrix);var vr=this.width%2/2,Tr=this.height%2/2,wr=Math.cos(this.angle),tr=Math.sin(this.angle),pr=ft-Math.round(ft)+wr*vr+tr*Tr,xr=st-Math.round(st)+wr*Tr+tr*vr,ea=new Float64Array(Kt);if(e.translate(ea,ea,[pr>.5?pr-1:pr,xr>.5?xr-1:xr,0]),this.alignedProjMatrix=ea,Kt=e.create(),e.scale(Kt,Kt,[this.width/2,-this.height/2,1]),e.translate(Kt,Kt,[1,-1,0]),this.labelPlaneMatrix=Kt,Kt=e.create(),e.scale(Kt,Kt,[1,-1,1]),e.translate(Kt,Kt,[-1,-1,0]),e.scale(Kt,Kt,[2/this.width,2/this.height,1]),this.glCoordMatrix=Kt,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),Kt=e.invert(new Float64Array(16),this.pixelMatrix),!Kt)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Kt,this._posMatrixCache={},this._alignedPosMatrixCache={}}},xo.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var W=this.pointCoordinate(new e.Point(0,0)),de=[W.x*this.worldSize,W.y*this.worldSize,0,1],te=e.transformMat4(de,de,this.pixelMatrix);return te[3]/this.cameraToCenterDistance},xo.prototype.getCameraPoint=function(){var W=this._pitch,de=Math.tan(W)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,de))},xo.prototype.getCameraQueryGeometry=function(W){var de=this.getCameraPoint();if(W.length===1)return[W[0],de];for(var te=de.x,me=de.y,Ue=de.x,tt=de.y,ft=0,st=W;ft=3&&!W.some(function(te){return isNaN(te)})){var de=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(W[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+W[2],+W[1]],zoom:+W[0],bearing:de,pitch:+(W[4]||0)}),!0}return!1},Al.prototype._updateHashUnthrottled=function(){var W=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,W)}catch{}};var pu={linearity:.3,easing:e.bezier(0,0,.3,1)},pe=e.extend({deceleration:2500,maxSpeed:1400},pu),Le=e.extend({deceleration:20,maxSpeed:1400},pu),Ye=e.extend({deceleration:1e3,maxSpeed:360},pu),ut=e.extend({deceleration:1e3,maxSpeed:90},pu),ht=function(W){this._map=W,this.clear()};ht.prototype.clear=function(){this._inertiaBuffer=[]},ht.prototype.record=function(W){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:W})},ht.prototype._drainInertiaBuffer=function(){for(var W=this._inertiaBuffer,de=e.browser.now(),te=160;W.length>0&&de-W[0].time>te;)W.shift()},ht.prototype._onMoveEnd=function(W){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var de={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},te=0,me=this._inertiaBuffer;te=this._clickTolerance||this._map.fire(new Dt(W.type,this._map,W))},Ar.prototype.dblclick=function(W){return this._firePreventable(new Dt(W.type,this._map,W))},Ar.prototype.mouseover=function(W){this._map.fire(new Dt(W.type,this._map,W))},Ar.prototype.mouseout=function(W){this._map.fire(new Dt(W.type,this._map,W))},Ar.prototype.touchstart=function(W){return this._firePreventable(new $t(W.type,this._map,W))},Ar.prototype.touchmove=function(W){this._map.fire(new $t(W.type,this._map,W))},Ar.prototype.touchend=function(W){this._map.fire(new $t(W.type,this._map,W))},Ar.prototype.touchcancel=function(W){this._map.fire(new $t(W.type,this._map,W))},Ar.prototype._firePreventable=function(W){if(this._map.fire(W),W.defaultPrevented)return{}},Ar.prototype.isEnabled=function(){return!0},Ar.prototype.isActive=function(){return!1},Ar.prototype.enable=function(){},Ar.prototype.disable=function(){};var Vr=function(W){this._map=W};Vr.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Vr.prototype.mousemove=function(W){this._map.fire(new Dt(W.type,this._map,W))},Vr.prototype.mousedown=function(){this._delayContextMenu=!0},Vr.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Dt("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Vr.prototype.contextmenu=function(W){this._delayContextMenu?this._contextMenuEvent=W:this._map.fire(new Dt(W.type,this._map,W)),this._map.listens("contextmenu")&&W.preventDefault()},Vr.prototype.isEnabled=function(){return!0},Vr.prototype.isActive=function(){return!1},Vr.prototype.enable=function(){},Vr.prototype.disable=function(){};var Kr=function(W,de){this._map=W,this._el=W.getCanvasContainer(),this._container=W.getContainer(),this._clickTolerance=de.clickTolerance||1};Kr.prototype.isEnabled=function(){return!!this._enabled},Kr.prototype.isActive=function(){return!!this._active},Kr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Kr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Kr.prototype.mousedown=function(W,de){this.isEnabled()&&W.shiftKey&&W.button===0&&(r.disableDrag(),this._startPos=this._lastPos=de,this._active=!0)},Kr.prototype.mousemoveWindow=function(W,de){if(this._active){var te=de;if(!(this._lastPos.equals(te)||!this._box&&te.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=W.timeStamp),te.length===this.numTouches&&(this.centroid=Ua(de),this.touches=aa(te,de)))},Ba.prototype.touchmove=function(W,de,te){if(!(this.aborted||!this.centroid)){var me=aa(te,de);for(var Ue in this.touches){var tt=this.touches[Ue],ft=me[Ue];(!ft||ft.dist(tt)>ka)&&(this.aborted=!0)}}},Ba.prototype.touchend=function(W,de,te){if((!this.centroid||W.timeStamp-this.startTime>Ta)&&(this.aborted=!0),te.length===0){var me=!this.aborted&&this.centroid;if(this.reset(),me)return me}};var Va=function(W){this.singleTap=new Ba(W),this.numTaps=W.numTaps,this.reset()};Va.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Va.prototype.touchstart=function(W,de,te){this.singleTap.touchstart(W,de,te)},Va.prototype.touchmove=function(W,de,te){this.singleTap.touchmove(W,de,te)},Va.prototype.touchend=function(W,de,te){var me=this.singleTap.touchend(W,de,te);if(me){var Ue=W.timeStamp-this.lastTime0&&(this._active=!0);var me=aa(te,de),Ue=new e.Point(0,0),tt=new e.Point(0,0),ft=0;for(var st in me){var bt=me[st],It=this._touches[st];It&&(Ue._add(bt),tt._add(bt.sub(It)),ft++,me[st]=bt)}if(this._touches=me,!(ftMath.abs(ye.x)}var Qo=100,_s=function(ye){function W(){ye.apply(this,arguments)}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.reset=function(){ye.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},W.prototype._start=function(te){this._lastPoints=te,Hl(te[0].sub(te[1]))&&(this._valid=!1)},W.prototype._move=function(te,me,Ue){var tt=te[0].sub(this._lastPoints[0]),ft=te[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(tt,ft,Ue.timeStamp),!!this._valid){this._lastPoints=te,this._active=!0;var st=(tt.y+ft.y)/2,bt=-.5;return{pitchDelta:st*bt}}},W.prototype.gestureBeginsVertically=function(te,me,Ue){if(this._valid!==void 0)return this._valid;var tt=2,ft=te.mag()>=tt,st=me.mag()>=tt;if(!(!ft&&!st)){if(!ft||!st)return this._firstMove===void 0&&(this._firstMove=Ue),Ue-this._firstMove0==me.y>0;return Hl(te)&&Hl(me)&&bt}},W}(Vo),gu={panStep:100,bearingStep:15,pitchStep:10},el=function(){var W=gu;this._panStep=W.panStep,this._bearingStep=W.bearingStep,this._pitchStep=W.pitchStep,this._rotationDisabled=!1};el.prototype.reset=function(){this._active=!1},el.prototype.keydown=function(W){var de=this;if(!(W.altKey||W.ctrlKey||W.metaKey)){var te=0,me=0,Ue=0,tt=0,ft=0;switch(W.keyCode){case 61:case 107:case 171:case 187:te=1;break;case 189:case 109:case 173:te=-1;break;case 37:W.shiftKey?me=-1:(W.preventDefault(),tt=-1);break;case 39:W.shiftKey?me=1:(W.preventDefault(),tt=1);break;case 38:W.shiftKey?Ue=1:(W.preventDefault(),ft=-1);break;case 40:W.shiftKey?Ue=-1:(W.preventDefault(),ft=1);break;default:return}return this._rotationDisabled&&(me=0,Ue=0),{cameraAnimation:function(st){var bt=st.getZoom();st.easeTo({duration:300,easeId:"keyboardHandler",easing:cr,zoom:te?Math.round(bt)+te*(W.shiftKey?2:1):bt,bearing:st.getBearing()+me*de._bearingStep,pitch:st.getPitch()+Ue*de._pitchStep,offset:[-tt*de._panStep,-ft*de._panStep],center:st.getCenter()},{originalEvent:W})}}}},el.prototype.enable=function(){this._enabled=!0},el.prototype.disable=function(){this._enabled=!1,this.reset()},el.prototype.isEnabled=function(){return this._enabled},el.prototype.isActive=function(){return this._active},el.prototype.disableRotation=function(){this._rotationDisabled=!0},el.prototype.enableRotation=function(){this._rotationDisabled=!1};function cr(ye){return ye*(2-ye)}var fa=4.000244140625,xa=1/100,cn=1/450,In=2,Da=function(W,de){this._map=W,this._el=W.getCanvasContainer(),this._handler=de,this._delta=0,this._defaultZoomRate=xa,this._wheelZoomRate=cn,e.bindAll(["_onTimeout"],this)};Da.prototype.setZoomRate=function(W){this._defaultZoomRate=W},Da.prototype.setWheelZoomRate=function(W){this._wheelZoomRate=W},Da.prototype.isEnabled=function(){return!!this._enabled},Da.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},Da.prototype.isZooming=function(){return!!this._zooming},Da.prototype.enable=function(W){this.isEnabled()||(this._enabled=!0,this._aroundCenter=W&&W.around==="center")},Da.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Da.prototype.wheel=function(W){if(this.isEnabled()){var de=W.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?W.deltaY*40:W.deltaY,te=e.browser.now(),me=te-(this._lastWheelEventTime||0);this._lastWheelEventTime=te,de!==0&&de%fa===0?this._type="wheel":de!==0&&Math.abs(de)<4?this._type="trackpad":me>400?(this._type=null,this._lastValue=de,this._timeout=setTimeout(this._onTimeout,40,W)):this._type||(this._type=Math.abs(me*de)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,de+=this._lastValue)),W.shiftKey&&de&&(de=de/4),this._type&&(this._lastWheelEvent=W,this._delta-=de,this._active||this._start(W)),W.preventDefault()}},Da.prototype._onTimeout=function(W){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(W)},Da.prototype._start=function(W){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 de=r.mousePos(this._el,W);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(de)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},Da.prototype.renderFrame=function(){var W=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var de=this._map.transform;if(this._delta!==0){var te=this._type==="wheel"&&Math.abs(this._delta)>fa?this._wheelZoomRate:this._defaultZoomRate,me=In/(1+Math.exp(-Math.abs(this._delta*te)));this._delta<0&&me!==0&&(me=1/me);var Ue=typeof this._targetZoom=="number"?de.zoomScale(this._targetZoom):de.scale;this._targetZoom=Math.min(de.maxZoom,Math.max(de.minZoom,de.scaleZoom(Ue*me))),this._type==="wheel"&&(this._startZoom=de.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var tt=typeof this._targetZoom=="number"?this._targetZoom:de.zoom,ft=this._startZoom,st=this._easing,bt=!1,It;if(this._type==="wheel"&&ft&&st){var Jt=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),Kt=st(Jt);It=e.number(ft,tt,Kt),Jt<1?this._frameId||(this._frameId=!0):bt=!0}else It=tt,bt=!0;return this._active=!0,bt&&(this._active=!1,this._finishTimeout=setTimeout(function(){W._zooming=!1,W._handler._triggerRenderFrame(),delete W._targetZoom,delete W._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!bt,zoomDelta:It-de.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},Da.prototype._smoothOutEasing=function(W){var de=e.ease;if(this._prevEase){var te=this._prevEase,me=(e.browser.now()-te.start)/te.duration,Ue=te.easing(me+.01)-te.easing(me),tt=.27/Math.sqrt(Ue*Ue+1e-4)*.01,ft=Math.sqrt(.27*.27-tt*tt);de=e.bezier(tt,ft,.25,1)}return this._prevEase={start:e.browser.now(),duration:W,easing:de},de},Da.prototype.reset=function(){this._active=!1};var Na=function(W,de){this._clickZoom=W,this._tapZoom=de};Na.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Na.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Na.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Na.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var Hn=function(){this.reset()};Hn.prototype.reset=function(){this._active=!1},Hn.prototype.dblclick=function(W,de){return W.preventDefault(),{cameraAnimation:function(te){te.easeTo({duration:300,zoom:te.getZoom()+(W.shiftKey?-1:1),around:te.unproject(de)},{originalEvent:W})}}},Hn.prototype.enable=function(){this._enabled=!0},Hn.prototype.disable=function(){this._enabled=!1,this.reset()},Hn.prototype.isEnabled=function(){return this._enabled},Hn.prototype.isActive=function(){return this._active};var Un=function(){this._tap=new Va({numTouches:1,numTaps:1}),this.reset()};Un.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Un.prototype.touchstart=function(W,de,te){this._swipePoint||(this._tapTime&&W.timeStamp-this._tapTime>la&&this.reset(),this._tapTime?te.length>0&&(this._swipePoint=de[0],this._swipeTouch=te[0].identifier):this._tap.touchstart(W,de,te))},Un.prototype.touchmove=function(W,de,te){if(!this._tapTime)this._tap.touchmove(W,de,te);else if(this._swipePoint){if(te[0].identifier!==this._swipeTouch)return;var me=de[0],Ue=me.y-this._swipePoint.y;return this._swipePoint=me,W.preventDefault(),this._active=!0,{zoomDelta:Ue/128}}},Un.prototype.touchend=function(W,de,te){if(this._tapTime)this._swipePoint&&te.length===0&&this.reset();else{var me=this._tap.touchend(W,de,te);me&&(this._tapTime=W.timeStamp)}},Un.prototype.touchcancel=function(){this.reset()},Un.prototype.enable=function(){this._enabled=!0},Un.prototype.disable=function(){this._enabled=!1,this.reset()},Un.prototype.isEnabled=function(){return this._enabled},Un.prototype.isActive=function(){return this._active};var Gn=function(W,de,te){this._el=W,this._mousePan=de,this._touchPan=te};Gn.prototype.enable=function(W){this._inertiaOptions=W||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Gn.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Gn.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Gn.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var ti=function(W,de,te){this._pitchWithRotate=W.pitchWithRotate,this._mouseRotate=de,this._mousePitch=te};ti.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},ti.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},ti.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},ti.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Wi=function(W,de,te,me){this._el=W,this._touchZoom=de,this._touchRotate=te,this._tapDragZoom=me,this._rotationDisabled=!1,this._enabled=!0};Wi.prototype.enable=function(W){this._touchZoom.enable(W),this._rotationDisabled||this._touchRotate.enable(W),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Wi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Wi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Wi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Wi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Wi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Ti=function(ye){return ye.zoom||ye.drag||ye.pitch||ye.rotate},si=function(ye){function W(){ye.apply(this,arguments)}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W}(e.Event);function Fn(ye){return ye.panDelta&&ye.panDelta.mag()||ye.zoomDelta||ye.bearingDelta||ye.pitchDelta}var qa=function(W,de){this._map=W,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ht(W),this._bearingSnap=de.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(de),e.bindAll(["handleEvent","handleWindowEvent"],this);var te=this._el;this._listeners=[[te,"touchstart",{passive:!0}],[te,"touchmove",{passive:!1}],[te,"touchend",void 0],[te,"touchcancel",void 0],[te,"mousedown",void 0],[te,"mousemove",void 0],[te,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[te,"mouseover",void 0],[te,"mouseout",void 0],[te,"dblclick",void 0],[te,"click",void 0],[te,"keydown",{capture:!1}],[te,"keyup",void 0],[te,"wheel",{passive:!1}],[te,"contextmenu",void 0],[e.window,"blur",void 0]];for(var me=0,Ue=this._listeners;meft?Math.min(2,Ea):Math.max(.5,Ea),fn=Math.pow(xn,1-an),En=tt.unproject(ea.add(ha.mult(an*fn)).mult(hn));tt.setLocationAtPoint(tt.renderWorldCopies?En.wrap():En,tr)}Ue._fireMoveEvents(me)},function(an){Ue._afterEase(me,an)},te),this},W.prototype._prepareEase=function(te,me,Ue){Ue===void 0&&(Ue={}),this._moving=!0,!me&&!Ue.moving&&this.fire(new e.Event("movestart",te)),this._zooming&&!Ue.zooming&&this.fire(new e.Event("zoomstart",te)),this._rotating&&!Ue.rotating&&this.fire(new e.Event("rotatestart",te)),this._pitching&&!Ue.pitching&&this.fire(new e.Event("pitchstart",te))},W.prototype._fireMoveEvents=function(te){this.fire(new e.Event("move",te)),this._zooming&&this.fire(new e.Event("zoom",te)),this._rotating&&this.fire(new e.Event("rotate",te)),this._pitching&&this.fire(new e.Event("pitch",te))},W.prototype._afterEase=function(te,me){if(!(this._easeId&&me&&this._easeId===me)){delete this._easeId;var Ue=this._zooming,tt=this._rotating,ft=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Ue&&this.fire(new e.Event("zoomend",te)),tt&&this.fire(new e.Event("rotateend",te)),ft&&this.fire(new e.Event("pitchend",te)),this.fire(new e.Event("moveend",te))}},W.prototype.flyTo=function(te,me){var Ue=this;if(!te.essential&&e.browser.prefersReducedMotion){var tt=e.pick(te,["center","zoom","bearing","pitch","around"]);return this.jumpTo(tt,me)}this.stop(),te=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},te);var ft=this.transform,st=this.getZoom(),bt=this.getBearing(),It=this.getPitch(),Jt=this.getPadding(),Kt="zoom"in te?e.clamp(+te.zoom,ft.minZoom,ft.maxZoom):st,vr="bearing"in te?this._normalizeBearing(te.bearing,bt):bt,Tr="pitch"in te?+te.pitch:It,wr="padding"in te?te.padding:ft.padding,tr=ft.zoomScale(Kt-st),pr=e.Point.convert(te.offset),xr=ft.centerPoint.add(pr),ea=ft.pointLocation(xr),ha=e.LngLat.convert(te.center||ea);this._normalizeCenter(ha);var Ea=ft.project(ea),tn=ft.project(ha).sub(Ea),Xa=te.curve,Ya=Math.max(ft.width,ft.height),an=Ya/tr,hn=tn.mag();if("minZoom"in te){var xn=e.clamp(Math.min(te.minZoom,st,Kt),ft.minZoom,ft.maxZoom),fn=Ya/ft.zoomScale(xn-st);Xa=Math.sqrt(fn/hn*2)}var En=Xa*Xa;function Yn(Uo){var Vs=(an*an-Ya*Ya+(Uo?-1:1)*En*En*hn*hn)/(2*(Uo?an:Ya)*En*hn);return Math.log(Math.sqrt(Vs*Vs+1)-Vs)}function vi(Uo){return(Math.exp(Uo)-Math.exp(-Uo))/2}function ai(Uo){return(Math.exp(Uo)+Math.exp(-Uo))/2}function Io(Uo){return vi(Uo)/ai(Uo)}var yo=Yn(0),vs=function(Uo){return ai(yo)/ai(yo+Xa*Uo)},us=function(Uo){return Ya*((ai(yo)*Io(yo+Xa*Uo)-vi(yo))/En)/hn},Ds=(Yn(1)-yo)/Xa;if(Math.abs(hn)<1e-6||!isFinite(Ds)){if(Math.abs(Ya-an)<1e-6)return this.easeTo(te,me);var rs=ante.maxDuration&&(te.duration=0),this._zooming=!0,this._rotating=bt!==vr,this._pitching=Tr!==It,this._padding=!ft.isPaddingEqual(wr),this._prepareEase(me,!1),this._ease(function(Uo){var Vs=Uo*Ds,Fu=1/vs(Vs);ft.zoom=Uo===1?Kt:st+ft.scaleZoom(Fu),Ue._rotating&&(ft.bearing=e.number(bt,vr,Uo)),Ue._pitching&&(ft.pitch=e.number(It,Tr,Uo)),Ue._padding&&(ft.interpolatePadding(Jt,wr,Uo),xr=ft.centerPoint.add(pr));var fc=Uo===1?ha:ft.unproject(Ea.add(tn.mult(us(Vs))).mult(Fu));ft.setLocationAtPoint(ft.renderWorldCopies?fc.wrap():fc,xr),Ue._fireMoveEvents(me)},function(){return Ue._afterEase(me)},te),this},W.prototype.isEasing=function(){return!!this._easeFrameId},W.prototype.stop=function(){return this._stop()},W.prototype._stop=function(te,me){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var Ue=this._onEaseEnd;delete this._onEaseEnd,Ue.call(this,me)}if(!te){var tt=this.handlers;tt&&tt.stop(!1)}return this},W.prototype._ease=function(te,me,Ue){Ue.animate===!1||Ue.duration===0?(te(1),me()):(this._easeStart=e.browser.now(),this._easeOptions=Ue,this._onEaseFrame=te,this._onEaseEnd=me,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},W.prototype._renderFrameCallback=function(){var te=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(te)),te<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},W.prototype._normalizeBearing=function(te,me){te=e.wrap(te,-180,180);var Ue=Math.abs(te-me);return Math.abs(te-360-me)180?-360:Ue<-180?360:0}},W}(e.Evented),Tn=function(W){W===void 0&&(W={}),this.options=W,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Tn.prototype.getDefaultPosition=function(){return"bottom-right"},Tn.prototype.onAdd=function(W){var de=this.options&&this.options.compact;return this._map=W,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),de&&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),de===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Tn.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Tn.prototype._setElementTitle=function(W,de){var te=this._map._getUIString("AttributionControl."+de);W.title=te,W.setAttribute("aria-label",te)},Tn.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Tn.prototype._updateEditLink=function(){var W=this._editLink;W||(W=this._editLink=this._container.querySelector(".mapbox-improve-map"));var de=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(W){var te=de.reduce(function(me,Ue,tt){return Ue.value&&(me+=Ue.key+"="+Ue.value+(tt=0)return!1;return!0});var ft=W.join(" | ");ft!==this._attribHTML&&(this._attribHTML=ft,W.length?(this._innerContainer.innerHTML=ft,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Tn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Ln=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};Ln.prototype.onAdd=function(W){this._map=W,this._container=r.create("div","mapboxgl-ctrl");var de=r.create("a","mapboxgl-ctrl-logo");return de.target="_blank",de.rel="noopener nofollow",de.href="https://www.mapbox.com/",de.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),de.setAttribute("rel","noopener nofollow"),this._container.appendChild(de),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ln.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ln.prototype.getDefaultPosition=function(){return"bottom-left"},Ln.prototype._updateLogo=function(W){(!W||W.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},Ln.prototype._logoRequired=function(){if(this._map.style){var W=this._map.style.sourceCaches;for(var de in W){var te=W[de].getSource();if(te.mapbox_logo)return!0}return!1}},Ln.prototype._updateCompact=function(){var W=this._container.children;if(W.length){var de=W[0];this._map.getCanvasContainer().offsetWidth<250?de.classList.add("mapboxgl-compact"):de.classList.remove("mapboxgl-compact")}};var Pn=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Pn.prototype.add=function(W){var de=++this._id,te=this._queue;return te.push({callback:W,id:de,cancelled:!1}),de},Pn.prototype.remove=function(W){for(var de=this._currentlyRunning,te=de?this._queue.concat(de):this._queue,me=0,Ue=te;mete.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(te.minPitch!=null&&te.maxPitch!=null&&te.minPitch>te.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(te.minPitch!=null&&te.minPitchgi)throw new Error("maxPitch must be less than or equal to "+gi);var Ue=new xo(te.minZoom,te.maxZoom,te.minPitch,te.maxPitch,te.renderWorldCopies);if(ye.call(this,Ue,te),this._interactive=te.interactive,this._maxTileCacheSize=te.maxTileCacheSize,this._failIfMajorPerformanceCaveat=te.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=te.preserveDrawingBuffer,this._antialias=te.antialias,this._trackResize=te.trackResize,this._bearingSnap=te.bearingSnap,this._refreshExpiredTiles=te.refreshExpiredTiles,this._fadeDuration=te.fadeDuration,this._crossSourceCollisions=te.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=te.collectResourceTiming,this._renderTaskQueue=new Pn,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},Ri,te.locale),this._clickTolerance=te.clickTolerance,this._requestManager=new e.RequestManager(te.transformRequest,te.accessToken),typeof te.container=="string"){if(this._container=e.window.document.getElementById(te.container),!this._container)throw new Error("Container '"+te.container+"' not found.")}else if(te.container instanceof $i)this._container=te.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(te.maxBounds&&this.setMaxBounds(te.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return me._update(!1)}),this.on("moveend",function(){return me._update(!1)}),this.on("zoom",function(){return me._update(!0)}),typeof e.window<"u"&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new qa(this,te);var tt=typeof te.hash=="string"&&te.hash||void 0;this._hash=te.hash&&new Al(tt).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:te.center,zoom:te.zoom,bearing:te.bearing,pitch:te.pitch}),te.bounds&&(this.resize(),this.fitBounds(te.bounds,e.extend({},te.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=te.localIdeographFontFamily,te.style&&this.setStyle(te.style,{localIdeographFontFamily:te.localIdeographFontFamily}),te.attributionControl&&this.addControl(new Tn({customAttribution:te.customAttribution})),this.addControl(new Ln,te.logoPosition),this.on("style.load",function(){me.transform.unmodified&&me.jumpTo(me.style.stylesheet)}),this.on("data",function(ft){me._update(ft.dataType==="style"),me.fire(new e.Event(ft.dataType+"data",ft))}),this.on("dataloading",function(ft){me.fire(new e.Event(ft.dataType+"dataloading",ft))})}ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W;var de={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return W.prototype._getMapId=function(){return this._mapId},W.prototype.addControl=function(me,Ue){if(Ue===void 0&&(me.getDefaultPosition?Ue=me.getDefaultPosition():Ue="top-right"),!me||!me.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var tt=me.onAdd(this);this._controls.push(me);var ft=this._controlPositions[Ue];return Ue.indexOf("bottom")!==-1?ft.insertBefore(tt,ft.firstChild):ft.appendChild(tt),this},W.prototype.removeControl=function(me){if(!me||!me.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var Ue=this._controls.indexOf(me);return Ue>-1&&this._controls.splice(Ue,1),me.onRemove(this),this},W.prototype.hasControl=function(me){return this._controls.indexOf(me)>-1},W.prototype.resize=function(me){var Ue=this._containerDimensions(),tt=Ue[0],ft=Ue[1];this._resizeCanvas(tt,ft),this.transform.resize(tt,ft),this.painter.resize(tt,ft);var st=!this._moving;return st&&(this.stop(),this.fire(new e.Event("movestart",me)).fire(new e.Event("move",me))),this.fire(new e.Event("resize",me)),st&&this.fire(new e.Event("moveend",me)),this},W.prototype.getBounds=function(){return this.transform.getBounds()},W.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},W.prototype.setMaxBounds=function(me){return this.transform.setMaxBounds(e.LngLatBounds.convert(me)),this._update()},W.prototype.setMinZoom=function(me){if(me=me??Mn,me>=Mn&&me<=this.transform.maxZoom)return this.transform.minZoom=me,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=me,this._update(),this.getZoom()>me&&this.setZoom(me),this;throw new Error("maxZoom must be greater than the current minZoom")},W.prototype.getMaxZoom=function(){return this.transform.maxZoom},W.prototype.setMinPitch=function(me){if(me=me??yn,me=yn&&me<=this.transform.maxPitch)return this.transform.minPitch=me,this._update(),this.getPitch()gi)throw new Error("maxPitch must be less than or equal to "+gi);if(me>=this.transform.minPitch)return this.transform.maxPitch=me,this._update(),this.getPitch()>me&&this.setPitch(me),this;throw new Error("maxPitch must be greater than the current minPitch")},W.prototype.getMaxPitch=function(){return this.transform.maxPitch},W.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},W.prototype.setRenderWorldCopies=function(me){return this.transform.renderWorldCopies=me,this._update()},W.prototype.project=function(me){return this.transform.locationPoint(e.LngLat.convert(me))},W.prototype.unproject=function(me){return this.transform.pointLocation(e.Point.convert(me))},W.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},W.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},W.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},W.prototype._createDelegatedListener=function(me,Ue,tt){var ft=this,st;if(me==="mouseenter"||me==="mouseover"){var bt=!1,It=function(tr){var pr=ft.getLayer(Ue)?ft.queryRenderedFeatures(tr.point,{layers:[Ue]}):[];pr.length?bt||(bt=!0,tt.call(ft,new Dt(me,ft,tr.originalEvent,{features:pr}))):bt=!1},Jt=function(){bt=!1};return{layer:Ue,listener:tt,delegates:{mousemove:It,mouseout:Jt}}}else if(me==="mouseleave"||me==="mouseout"){var Kt=!1,vr=function(tr){var pr=ft.getLayer(Ue)?ft.queryRenderedFeatures(tr.point,{layers:[Ue]}):[];pr.length?Kt=!0:Kt&&(Kt=!1,tt.call(ft,new Dt(me,ft,tr.originalEvent)))},Tr=function(tr){Kt&&(Kt=!1,tt.call(ft,new Dt(me,ft,tr.originalEvent)))};return{layer:Ue,listener:tt,delegates:{mousemove:vr,mouseout:Tr}}}else{var wr=function(tr){var pr=ft.getLayer(Ue)?ft.queryRenderedFeatures(tr.point,{layers:[Ue]}):[];pr.length&&(tr.features=pr,tt.call(ft,tr),delete tr.features)};return{layer:Ue,listener:tt,delegates:(st={},st[me]=wr,st)}}},W.prototype.on=function(me,Ue,tt){if(tt===void 0)return ye.prototype.on.call(this,me,Ue);var ft=this._createDelegatedListener(me,Ue,tt);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[me]=this._delegatedListeners[me]||[],this._delegatedListeners[me].push(ft);for(var st in ft.delegates)this.on(st,ft.delegates[st]);return this},W.prototype.once=function(me,Ue,tt){if(tt===void 0)return ye.prototype.once.call(this,me,Ue);var ft=this._createDelegatedListener(me,Ue,tt);for(var st in ft.delegates)this.once(st,ft.delegates[st]);return this},W.prototype.off=function(me,Ue,tt){var ft=this;if(tt===void 0)return ye.prototype.off.call(this,me,Ue);var st=function(bt){for(var It=bt[me],Jt=0;Jt180;){var tt=de.locationPoint(ye);if(tt.x>=0&&tt.y>=0&&tt.x<=de.width&&tt.y<=de.height)break;ye.lng>de.center.lng?ye.lng-=360:ye.lng+=360}return ye}var ys={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function xs(ye,W,de){var te=ye.classList;for(var me in ys)te.remove("mapboxgl-"+de+"-anchor-"+me);te.add("mapboxgl-"+de+"-anchor-"+W)}var Xs=function(ye){function W(de,te){if(ye.call(this),(de instanceof e.window.HTMLElement||te)&&(de=e.extend({element:de},te)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=de&&de.anchor||"center",this._color=de&&de.color||"#3FB1CE",this._scale=de&&de.scale||1,this._draggable=de&&de.draggable||!1,this._clickTolerance=de&&de.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=de&&de.rotation||0,this._rotationAlignment=de&&de.rotationAlignment||"auto",this._pitchAlignment=de&&de.pitchAlignment&&de.pitchAlignment!=="auto"?de.pitchAlignment:this._rotationAlignment,!de||!de.element){this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var me=r.createNS("http://www.w3.org/2000/svg","svg"),Ue=41,tt=27;me.setAttributeNS(null,"display","block"),me.setAttributeNS(null,"height",Ue+"px"),me.setAttributeNS(null,"width",tt+"px"),me.setAttributeNS(null,"viewBox","0 0 "+tt+" "+Ue);var ft=r.createNS("http://www.w3.org/2000/svg","g");ft.setAttributeNS(null,"stroke","none"),ft.setAttributeNS(null,"stroke-width","1"),ft.setAttributeNS(null,"fill","none"),ft.setAttributeNS(null,"fill-rule","evenodd");var st=r.createNS("http://www.w3.org/2000/svg","g");st.setAttributeNS(null,"fill-rule","nonzero");var bt=r.createNS("http://www.w3.org/2000/svg","g");bt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),bt.setAttributeNS(null,"fill","#000000");for(var It=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}],Jt=0,Kt=It;Jt=me}this._isDragging&&(this._pos=te.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag")))},W.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new e.Event("dragend")),this._state="inactive"},W.prototype._addDragHandler=function(te){this._element.contains(te.originalEvent.target)&&(te.preventDefault(),this._positionDelta=te.point.sub(this._pos).add(this._offset),this._pointerdownPos=te.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},W.prototype.setDraggable=function(te){return this._draggable=!!te,this._map&&(te?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},W.prototype.isDraggable=function(){return this._draggable},W.prototype.setRotation=function(te){return this._rotation=te||0,this._update(),this},W.prototype.getRotation=function(){return this._rotation},W.prototype.setRotationAlignment=function(te){return this._rotationAlignment=te||"auto",this._update(),this},W.prototype.getRotationAlignment=function(){return this._rotationAlignment},W.prototype.setPitchAlignment=function(te){return this._pitchAlignment=te&&te!=="auto"?te:this._rotationAlignment,this._update(),this},W.prototype.getPitchAlignment=function(){return this._pitchAlignment},W}(e.Evented),Ps={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Mu;function dl(ye){Mu!==void 0?ye(Mu):e.window.navigator.permissions!==void 0?e.window.navigator.permissions.query({name:"geolocation"}).then(function(W){Mu=W.state!=="denied",ye(Mu)}):(Mu=!!e.window.navigator.geolocation,ye(Mu))}var Eu=0,ac=!1,Lc=function(ye){function W(de){ye.call(this),this.options=e.extend({},Ps,de),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.onAdd=function(te){return this._map=te,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),dl(this._setupUI),this._container},W.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Eu=0,ac=!1},W.prototype._isOutOfMapMaxBounds=function(te){var me=this._map.getMaxBounds(),Ue=te.coords;return me&&(Ue.longitudeme.getEast()||Ue.latitudeme.getNorth())},W.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");break}},W.prototype._onSuccess=function(te){if(this._map){if(this._isOutOfMapMaxBounds(te)){this._setErrorState(),this.fire(new e.Event("outofmaxbounds",te)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=te,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");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(te),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(te),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",te)),this._finish()}},W.prototype._updateCamera=function(te){var me=new e.LngLat(te.coords.longitude,te.coords.latitude),Ue=te.coords.accuracy,tt=this._map.getBearing(),ft=e.extend({bearing:tt},this.options.fitBoundsOptions);this._map.fitBounds(me.toBounds(Ue),ft,{geolocateSource:!0})},W.prototype._updateMarker=function(te){if(te){var me=new e.LngLat(te.coords.longitude,te.coords.latitude);this._accuracyCircleMarker.setLngLat(me).addTo(this._map),this._userLocationDotMarker.setLngLat(me).addTo(this._map),this._accuracy=te.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},W.prototype._updateCircleRadius=function(){var te=this._map._container.clientHeight/2,me=this._map.unproject([0,te]),Ue=this._map.unproject([1,te]),tt=me.distanceTo(Ue),ft=Math.ceil(2*this._accuracy/tt);this._circleElement.style.width=ft+"px",this._circleElement.style.height=ft+"px"},W.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},W.prototype._onError=function(te){if(this._map){if(this.options.trackUserLocation)if(te.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 me=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=me,this._geolocateButton.setAttribute("aria-label",me),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(te.code===3&&ac)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",te)),this._finish()}},W.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},W.prototype._setupUI=function(te){var me=this;if(this._container.addEventListener("contextmenu",function(ft){return ft.preventDefault()}),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",te===!1){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var Ue=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=Ue,this._geolocateButton.setAttribute("aria-label",Ue)}else{var tt=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=tt,this._geolocateButton.setAttribute("aria-label",tt)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Xs(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Xs({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(ft){var st=ft.originalEvent&&ft.originalEvent.type==="resize";!ft.geolocateSource&&me._watchState==="ACTIVE_LOCK"&&!st&&(me._watchState="BACKGROUND",me._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),me._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),me.fire(new e.Event("trackuserlocationend")))})},W.prototype.trigger=function(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Eu--,ac=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"));break}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");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Eu++;var te;Eu>1?(te={maximumAge:6e5,timeout:0},ac=!0):(te=this.options.positionOptions,ac=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,te)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},W.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},W}(e.Evented),Pf={maxWidth:100,unit:"metric"},su=function(W){this.options=e.extend({},Pf,W),e.bindAll(["_onMove","setUnit"],this)};su.prototype.getDefaultPosition=function(){return"bottom-left"},su.prototype._onMove=function(){zu(this._map,this._container,this.options)},su.prototype.onAdd=function(W){return this._map=W,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",W.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},su.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},su.prototype.setUnit=function(W){this.options.unit=W,zu(this._map,this._container,this.options)};function zu(ye,W,de){var te=de&&de.maxWidth||100,me=ye._container.clientHeight/2,Ue=ye.unproject([0,me]),tt=ye.unproject([te,me]),ft=Ue.distanceTo(tt);if(de&&de.unit==="imperial"){var st=3.2808*ft;if(st>5280){var bt=st/5280;Fo(W,te,bt,ye._getUIString("ScaleControl.Miles"))}else Fo(W,te,st,ye._getUIString("ScaleControl.Feet"))}else if(de&&de.unit==="nautical"){var It=ft/1852;Fo(W,te,It,ye._getUIString("ScaleControl.NauticalMiles"))}else ft>=1e3?Fo(W,te,ft/1e3,ye._getUIString("ScaleControl.Kilometers")):Fo(W,te,ft,ye._getUIString("ScaleControl.Meters"))}function Fo(ye,W,de,te){var me=ll(de),Ue=me/de;ye.style.width=W*Ue+"px",ye.innerHTML=me+" "+te}function nc(ye){var W=Math.pow(10,Math.ceil(-Math.log(ye)/Math.LN10));return Math.round(ye*W)/W}function ll(ye){var W=Math.pow(10,(""+Math.floor(ye)).length-1),de=ye/W;return de=de>=10?10:de>=5?5:de>=3?3:de>=2?2:de>=1?1:nc(de),W*de}var Sl=function(W){this._fullscreen=!1,W&&W.container&&(W.container instanceof e.window.HTMLElement?this._container=W.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};Sl.prototype.onAdd=function(W){return this._map=W,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Sl.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Sl.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},Sl.prototype._setupUI=function(){var W=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",W).setAttribute("aria-hidden",!0),W.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Sl.prototype._updateTitle=function(){var W=this._getTitle();this._fullscreenButton.setAttribute("aria-label",W),this._fullscreenButton.title=W},Sl.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Sl.prototype._isFullscreen=function(){return this._fullscreen},Sl.prototype._changeIcon=function(){var W=e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement;W===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Sl.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var qc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Hc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),ss=function(ye){function W(de){ye.call(this),this.options=e.extend(Object.create(qc),de),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.addTo=function(te){return this._map&&this.remove(),this._map=te,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this},W.prototype.isOpen=function(){return!!this._map},W.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},W.prototype.getLngLat=function(){return this._lngLat},W.prototype.setLngLat=function(te){return this._lngLat=e.LngLat.convert(te),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},W.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},W.prototype.getElement=function(){return this._container},W.prototype.setText=function(te){return this.setDOMContent(e.window.document.createTextNode(te))},W.prototype.setHTML=function(te){var me=e.window.document.createDocumentFragment(),Ue=e.window.document.createElement("body"),tt;for(Ue.innerHTML=te;tt=Ue.firstChild,!!tt;)me.appendChild(tt);return this.setDOMContent(me)},W.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},W.prototype.setMaxWidth=function(te){return this.options.maxWidth=te,this._update(),this},W.prototype.setDOMContent=function(te){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(te),this._createCloseButton(),this._update(),this._focusFirstElement(),this},W.prototype.addClassName=function(te){this._container&&this._container.classList.add(te)},W.prototype.removeClassName=function(te){this._container&&this._container.classList.remove(te)},W.prototype.setOffset=function(te){return this.options.offset=te,this._update(),this},W.prototype.toggleClassName=function(te){if(this._container)return this._container.classList.toggle(te)},W.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},W.prototype._onMouseUp=function(te){this._update(te.point)},W.prototype._onMouseMove=function(te){this._update(te.point)},W.prototype._onDrag=function(te){this._update(te.point)},W.prototype._update=function(te){var me=this,Ue=this._lngLat||this._trackPointer;if(!(!this._map||!Ue||!this._content)&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(vr){return me._container.classList.add(vr)}),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=Xo(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!te))){var tt=this._pos=this._trackPointer&&te?te:this._map.project(this._lngLat),ft=this.options.anchor,st=js(this.options.offset);if(!ft){var bt=this._container.offsetWidth,It=this._container.offsetHeight,Jt;tt.y+st.bottom.ythis._map.transform.height-It?Jt=["bottom"]:Jt=[],tt.xthis._map.transform.width-bt/2&&Jt.push("right"),Jt.length===0?ft="bottom":ft=Jt.join("-")}var Kt=tt.add(st[ft]).round();r.setTransform(this._container,ys[ft]+" translate("+Kt.x+"px,"+Kt.y+"px)"),xs(this._container,ft,"popup")}},W.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var te=this._container.querySelector(Hc);te&&te.focus()}},W.prototype._onClose=function(){this.remove()},W}(e.Evented);function js(ye){if(ye)if(typeof ye=="number"){var W=Math.round(Math.sqrt(.5*Math.pow(ye,2)));return{center:new e.Point(0,0),top:new e.Point(0,ye),"top-left":new e.Point(W,W),"top-right":new e.Point(-W,W),bottom:new e.Point(0,-ye),"bottom-left":new e.Point(W,-W),"bottom-right":new e.Point(-W,-W),left:new e.Point(ye,0),right:new e.Point(-ye,0)}}else if(ye instanceof e.Point||Array.isArray(ye)){var de=e.Point.convert(ye);return{center:de,top:de,"top-left":de,"top-right":de,bottom:de,"bottom-left":de,"bottom-right":de,left:de,right:de}}else return{center:e.Point.convert(ye.center||[0,0]),top:e.Point.convert(ye.top||[0,0]),"top-left":e.Point.convert(ye["top-left"]||[0,0]),"top-right":e.Point.convert(ye["top-right"]||[0,0]),bottom:e.Point.convert(ye.bottom||[0,0]),"bottom-left":e.Point.convert(ye["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(ye["bottom-right"]||[0,0]),left:e.Point.convert(ye.left||[0,0]),right:e.Point.convert(ye.right||[0,0])};else return js(new e.Point(0,0))}var ls={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:ro,NavigationControl:no,GeolocateControl:Lc,AttributionControl:Tn,ScaleControl:su,FullscreenControl:Sl,Popup:ss,Marker:Xs,Style:Dl,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:Lr,clearPrewarmedResources:Er,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(ye){e.config.ACCESS_TOKEN=ye},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(ye){e.config.API_URL=ye},get workerCount(){return sa.workerCount},set workerCount(ye){sa.workerCount=ye},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(ye){e.config.MAX_PARALLEL_IMAGE_REQUESTS=ye},clearStorage:function(W){e.clearTileCache(W)},workerUrl:""};return ls}),A})}}),XI=He({"src/plots/mapbox/layers.js"(Y,G){var d=Gr(),x=yl().sanitizeHTML,A=OT(),E=dd();function e(i,n){this.subplot=i,this.uid=i.uid+"-"+n,this.index=n,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(n){this.visible?this.needsNewImage(n)?this.updateImage(n):this.needsNewSource(n)?(this.removeLayer(),this.updateSource(n),this.updateLayer(n)):this.needsNewLayer(n)?this.updateLayer(n):this.updateStyle(n):(this.updateSource(n),this.updateLayer(n)),this.visible=r(n)},t.needsNewImage=function(i){var n=this.subplot.map;return n.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var n=this.subplot.map;n.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapboxLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var n=this.subplot.map;if(n.getSource(this.idSource)&&n.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=a(i);n.addSource(this.idSource,s)}},t.findFollowingMapboxLayerId=function(i){if(i==="traces")for(var n=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var n={},s={};switch(i.type){case"circle":d.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":d.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":d.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var c=i.symbol,f=A(c.textposition,c.iconsize);d.extendFlat(n,{"icon-image":c.icon+"-15","icon-size":c.iconsize/10,"text-field":c.text,"text-size":c.textfont.size,"text-anchor":f.anchor,"text-offset":f.offset,"symbol-placement":c.placement}),d.extendFlat(s,{"icon-color":i.color,"text-color":c.textfont.color,"text-opacity":i.opacity});break;case"raster":d.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:n,paint:s}}function a(i){var n=i.sourcetype,s=i.source,c={type:n},f;return n==="geojson"?f="data":n==="vector"?f=typeof s=="string"?"url":"tiles":n==="raster"?(f="tiles",c.tileSize=256):n==="image"&&(f="url",c.coordinates=i.coordinates),c[f]=s,i.sourceattribution&&(c.attribution=x(i.sourceattribution)),c}G.exports=function(n,s,c){var f=new e(n,s);return f.update(c),f}}}),YI=He({"src/plots/mapbox/mapbox.js"(Y,G){var d=BT(),x=Gr(),A=ip(),E=Ei(),e=io(),t=fh(),r=Wu(),o=bv(),a=o.drawMode,i=o.selectMode,n=dc().prepSelect,s=dc().clearOutline,c=dc().clearSelectionsCache,f=dc().selectOnClick,v=dd(),h=XI();function T(_,w){this.id=w,this.gd=_;var p=_._fullLayout,u=_._context;this.container=p._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(_,w,p){var u=this,g=w[u.id];u.map&&g.accesstoken!==u.accessToken&&(u.map.remove(),u.map=null,u.styleObj=null,u.traceHash={},u.layerList=[]);var m;u.map?m=new Promise(function(R,P){u.updateMap(_,w,R,P)}):m=new Promise(function(R,P){u.createMap(_,w,R,P)}),p.push(m)},l.createMap=function(_,w,p,u){var g=this,m=w[g.id],R=g.styleObj=b(m.style,w);g.accessToken=m.accesstoken;var P=m.bounds,z=P?[[P.west,P.south],[P.east,P.north]]:null,F=g.map=new d.Map({container:g.div,style:R.style,center:M(m.center),zoom:m.zoom,bearing:m.bearing,pitch:m.pitch,maxBounds:z,interactive:!g.isStatic,preserveDrawingBuffer:g.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0}));F._canvas.style.left="0px",F._canvas.style.top="0px",g.rejectOnError(u),g.isStatic||g.initFx(_,w);var B=[];B.push(new Promise(function(O){F.once("load",O)})),B=B.concat(A.fetchTraceGeoData(_)),Promise.all(B).then(function(){g.fillBelowLookup(_,w),g.updateData(_),g.updateLayout(w),g.resolveOnRender(p)}).catch(u)},l.updateMap=function(_,w,p,u){var g=this,m=g.map,R=w[this.id];g.rejectOnError(u);var P=[],z=b(R.style,w);JSON.stringify(g.styleObj)!==JSON.stringify(z)&&(g.styleObj=z,m.setStyle(z.style),g.traceHash={},P.push(new Promise(function(F){m.once("styledata",F)}))),P=P.concat(A.fetchTraceGeoData(_)),Promise.all(P).then(function(){g.fillBelowLookup(_,w),g.updateData(_),g.updateLayout(w),g.resolveOnRender(p)}).catch(u)},l.fillBelowLookup=function(_,w){var p=w[this.id],u=p.layers,g,m,R=this.belowLookup={},P=!1;for(g=0;g<_.length;g++){var z=_[g][0].trace,F=z._module;typeof z.below=="string"?m=z.below:F.getBelow&&(m=F.getBelow(z,this)),m===""&&(P=!0),R["trace-"+z.uid]=m||""}for(g=0;g1)for(g=0;g-1&&f(z.originalEvent,u,[p.xaxis],[p.yaxis],p.id,P),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(_){var w=this,p=w.map,u=w.gd;if(w.isStatic)return;function g(z){var F=w.map.unproject(z);return[F.lng,F.lat]}var m=_.dragmode,R;R=function(z,F){if(F.isRect){var B=z.range={};B[w.id]=[g([F.xmin,F.ymin]),g([F.xmax,F.ymax])]}else{var O=z.lassoPoints={};O[w.id]=F.map(g)}};var P=w.dragOptions;w.dragOptions=x.extendDeep(P||{},{dragmode:_.dragmode,element:w.div,gd:u,plotinfo:{id:w.id,domain:_[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:R},xaxes:[w.xaxis],yaxes:[w.yaxis],subplot:w.id}),p.off("click",w.onClickInPanHandler),i(m)||a(m)?(p.dragPan.disable(),p.on("zoomstart",w.clearOutline),w.dragOptions.prepFn=function(z,F,B){n(z,F,B,w.dragOptions,m)},t.init(w.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",w.clearOutline),w.div.onmousedown=null,w.div.ontouchstart=null,w.div.removeEventListener("touchstart",w.div._ontouchstart),w.onClickInPanHandler=w.onClickInPanFn(w.dragOptions),p.on("click",w.onClickInPanHandler))},l.updateFramework=function(_){var w=_[this.id].domain,p=_._size,u=this.div.style;u.width=p.w*(w.x[1]-w.x[0])+"px",u.height=p.h*(w.y[1]-w.y[0])+"px",u.left=p.l+w.x[0]*p.w+"px",u.top=p.t+(1-w.y[1])*p.h+"px",this.xaxis._offset=p.l+w.x[0]*p.w,this.xaxis._length=p.w*(w.x[1]-w.x[0]),this.yaxis._offset=p.t+(1-w.y[1])*p.h,this.yaxis._length=p.h*(w.y[1]-w.y[0])},l.updateLayers=function(_){var w=_[this.id],p=w.layers,u=this.layerList,g;if(p.length!==u.length){for(g=0;gB/2){var O=R.split("|").join("
");z.text(O).attr("data-unformatted",O).call(o.convertToTspans,h),F=r.bBox(z.node())}z.attr("transform",x(-3,-F.height+8)),P.insert("rect",".static-attribution").attr({x:-F.width-6,y:-F.height-3,width:F.width+6,height:F.height+3,fill:"rgba(255, 255, 255, 0.75)"});var L=1;F.width+6>B&&(L=B/(F.width+6));var N=[y.l+y.w*M.x[1],y.t+y.h*(1-M.y[0])];P.attr("transform",x(N[0],N[1])+A(L))}};function f(h,T){var l=h._fullLayout,y=h._context;if(y.mapboxAccessToken==="")return"";for(var b=[],S=[],M=!1,_=!1,w=0;w1&&d.warn(n.multipleTokensErrorMsg),b[0]):(S.length&&d.log(["Listed mapbox access token(s)",S.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function v(h){return typeof h=="string"&&(n.styleValuesMapbox.indexOf(h)!==-1||h.indexOf("mapbox://")===0||h.indexOf("stamen")===0)}Y.updateFx=function(h){for(var T=h._fullLayout,l=T._subplots[i],y=0;y=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},G.exports=function(r,o){var a=o[0].trace,i=new E(r,a.uid),n=i.sourceId,s=d(o),c=i.below=r.belowLookup["trace-"+a.uid];return r.map.addSource(n,{type:"geojson",data:s.geojson}),i._addLayers(s,c),o[0].trace._glTrace=i,i}}}),tR=He({"src/traces/choroplethmapbox/index.js"(Y,G){G.exports={attributes:NT(),supplyDefaults:QI(),colorbar:Zd(),calc:G_(),plot:eR(),hoverPoints:Z_(),eventData:X_(),selectPoints:Y_(),styleOnSelect:function(d,x){if(x){var A=x[0].trace;A._glTrace.updateOnSelect(x)}},getBelow:function(d,x){for(var A=x.getMapLayers(),E=A.length-2;E>=0;E--){var e=A[E].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=E+1;t0?+h[f]:0),c.push({type:"Feature",geometry:{type:"Point",coordinates:b},properties:S})}}var _=E.extractOpts(a),w=_.reversescale?E.flipScale(_.colorscale):_.colorscale,p=w[0][1],u=A.opacity(p)<1?p:A.addOpacity(p,0),g=["interpolate",["linear"],["heatmap-density"],0,u];for(f=1;f=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},G.exports=function(t,r){var o=r[0].trace,a=new A(t,o.uid),i=a.sourceId,n=d(r),s=a.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:n.geojson}),a._addLayers(n,s),a}}}),sR=He({"src/traces/densitymapbox/hover.js"(Y,G){var d=io(),x=lx().hoverPoints,A=lx().getExtraText;G.exports=function(e,t,r){var o=x(e,t,r);if(o){var a=o[0],i=a.cd,n=i[0].trace,s=i[a.index];if(delete a.color,"z"in s){var c=a.subplot.mockAxis;a.z=s.z,a.zLabel=d.tickText(c,c.c2l(s.z),"hover").text}return a.extraText=A(n,s,i[0].t.labels),[a]}}}}),lR=He({"src/traces/densitymapbox/event_data.js"(Y,G){G.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x.z=A.z,x}}}),uR=He({"src/traces/densitymapbox/index.js"(Y,G){G.exports={attributes:jT(),supplyDefaults:aR(),colorbar:Zd(),formatLabels:FT(),calc:nR(),plot:oR(),hoverPoints:sR(),eventData:lR(),getBelow:function(d,x){for(var A=x.getMapLayers(),E=0;EESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":`{name:latin} +{name:nonlatin}`,"text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),hR=He({"src/plots/map/styles/arcgis-sat.js"(Y,G){G.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),up=He({"src/plots/map/constants.js"(Y,G){var d=Ud(),x=fR(),A=hR(),E='© OpenStreetMap contributors',e="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",t="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",r="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",i="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",n={basic:r,streets:r,outdoors:r,light:e,dark:t,satellite:A,"satellite-streets":x,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:E,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":e,"carto-darkmatter":t,"carto-voyager":r,"carto-positron-nolabels":o,"carto-darkmatter-nolabels":a,"carto-voyager-nolabels":i},s=d(n);G.exports={styleValueDflt:"basic",stylesMap:n,styleValuesMap:s,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",s.join(", "),"or use a tile service."].join(` +`),mapOnErrorMsg:"Map error."}}}),Jy=He({"src/plots/map/layout_attributes.js"(Y,G){var d=Gr(),x=Ai().defaultLine,A=mu().attributes,E=Yl(),e=Zu().textposition,t=hu().overrideAll,r=Gs().templatedArray,o=up(),a=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});a.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=G.exports=t({_arrayAttrRegexps:[d.counterRegex("map",".layers",!0)],domain:A({name:"map"}),style:{valType:"any",values:o.styleValuesMap,dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:x},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:x}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:a,textposition:d.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),cx=He({"src/traces/scattermap/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=Yo().texttemplateAttrs,A=wv(),E=Zp(),e=Zu(),t=Jy(),r=cl(),o=kl(),a=ho().extendFlat,i=hu().overrideAll,n=Jy(),s=E.line,c=E.marker;G.exports=i({lon:E.lon,lat:E.lat,cluster:{enabled:{valType:"boolean"},maxzoom:a({},n.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:a({},c.opacity,{dflt:1})},mode:a({},e.mode,{dflt:"markers"}),text:a({},e.text,{}),texttemplate:x({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:a({},e.hovertext,{}),line:{color:s.color,width:s.width},connectgaps:e.connectgaps,marker:a({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode},o("marker")),fill:E.fill,fillcolor:A(),textfont:t.layers.symbol.textfont,textposition:t.layers.symbol.textposition,below:{valType:"string"},selected:{marker:e.selected.marker},unselected:{marker:e.unselected.marker},hoverinfo:a({},r.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d()},"calc","nested")}}),VT=He({"src/traces/scattermap/constants.js"(Y,G){var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];G.exports={isSupportedFont:function(x){return d.indexOf(x)!==-1}}}}),vR=He({"src/traces/scattermap/defaults.js"(Y,G){var d=Gr(),x=Rl(),A=Kh(),E=nv(),e=iv(),t=Av(),r=cx(),o=VT().isSupportedFont;G.exports=function(n,s,c,f){function v(g,m){return d.coerce(n,s,r,g,m)}function h(g,m){return d.coerce2(n,s,r,g,m)}var T=a(n,s,v);if(!T){s.visible=!1;return}if(v("text"),v("texttemplate"),v("hovertext"),v("hovertemplate"),v("mode"),v("below"),x.hasMarkers(s)){A(n,s,c,f,v,{noLine:!0,noAngle:!0}),v("marker.allowoverlap"),v("marker.angle");var l=s.marker;l.symbol!=="circle"&&(d.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),d.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}x.hasLines(s)&&(E(n,s,c,f,v,{noDash:!0}),v("connectgaps"));var y=h("cluster.maxzoom"),b=h("cluster.step"),S=h("cluster.color",s.marker&&s.marker.color||c),M=h("cluster.size"),_=h("cluster.opacity"),w=y!==!1||b!==!1||S!==!1||M!==!1||_!==!1,p=v("cluster.enabled",w);if(p||x.hasText(s)){var u=f.font.family;e(n,s,f,v,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}v("fill"),s.fill!=="none"&&t(n,s,c,v),d.coerceSelectionMarkerOpacity(s,v)};function a(i,n,s){var c=s("lon")||[],f=s("lat")||[],v=Math.min(c.length,f.length);return n._length=v,v}}}),qT=He({"src/traces/scattermap/format_labels.js"(Y,G){var d=io();G.exports=function(A,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,a=A.lonlat;return t.lonLabel=d.tickText(o,o.c2l(a[0]),!0).text,t.latLabel=d.tickText(o,o.c2l(a[1]),!0).text,t}}}),HT=He({"src/plots/map/convert_text_opts.js"(Y,G){var d=Gr();G.exports=function(A,E){var e=A.split(" "),t=e[0],r=e[1],o=d.isArrayOrTypedArray(E)?d.mean(E):E,a=.5+o/100,i=1.5+o/100,n=["",""],s=[0,0];switch(t){case"top":n[0]="top",s[1]=-i;break;case"bottom":n[0]="bottom",s[1]=i;break}switch(r){case"left":n[1]="right",s[0]=-a;break;case"right":n[1]="left",s[0]=a;break}var c;return n[0]&&n[1]?c=n.join("-"):n[0]?c=n[0]:n[1]?c=n[1]:c="center",{anchor:c,offset:s}}}}),dR=He({"src/traces/scattermap/convert.js"(Y,G){var d=Hi(),x=Gr(),A=lo().BADNUM,E=np(),e=Kl(),t=vo(),r=B0(),o=Rl(),a=VT().isSupportedFont,i=HT(),n=Ph().appendArrayPointValue,s=yl().NEWLINES,c=yl().BR_TAG_ALL;G.exports=function(_,w){var p=w[0].trace,u=p.visible===!0&&p._length!==0,g=p.fill!=="none",m=o.hasLines(p),R=o.hasMarkers(p),P=o.hasText(p),z=R&&p.marker.symbol==="circle",F=R&&p.marker.symbol!=="circle",B=p.cluster&&p.cluster.enabled,O=f("fill"),L=f("line"),N=f("circle"),U=f("symbol"),Z={fill:O,line:L,circle:N,symbol:U};if(!u)return Z;var Q;if((g||m)&&(Q=E.calcTraceToLineCoords(w)),g&&(O.geojson=E.makePolygon(Q),O.layout.visibility="visible",x.extendFlat(O.paint,{"fill-color":p.fillcolor})),m&&(L.geojson=E.makeLine(Q),L.layout.visibility="visible",x.extendFlat(L.paint,{"line-width":p.line.width,"line-color":p.line.color,"line-opacity":p.opacity})),z){var ue=v(w);N.geojson=ue.geojson,N.layout.visibility="visible",B&&(N.filter=["!",["has","point_count"]],Z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":b(p.cluster.color,p.cluster.step),"circle-radius":b(p.cluster.size,p.cluster.step),"circle-opacity":b(p.cluster.opacity,p.cluster.step)}},Z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(p),"text-size":12}}),x.extendFlat(N.paint,{"circle-color":ue.mcc,"circle-radius":ue.mrc,"circle-opacity":ue.mo})}if(z&&B&&(N.filter=["!",["has","point_count"]]),(F||P)&&(U.geojson=h(w,_),x.extendFlat(U.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(x.extendFlat(U.layout,{"icon-size":p.marker.size/10}),"angle"in p.marker&&p.marker.angle!=="auto"&&x.extendFlat(U.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),U.layout["icon-allow-overlap"]=p.marker.allowoverlap,x.extendFlat(U.paint,{"icon-opacity":p.opacity*p.marker.opacity,"icon-color":p.marker.color})),P)){var oe=(p.marker||{}).size,le=i(p.textposition,oe);x.extendFlat(U.layout,{"text-size":p.textfont.size,"text-anchor":le.anchor,"text-offset":le.offset,"text-font":S(p)}),x.extendFlat(U.paint,{"text-color":p.textfont.color,"text-opacity":p.opacity})}return Z};function f(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function v(M){var _=M[0].trace,w=_.marker,p=_.selectedpoints,u=x.isArrayOrTypedArray(w.color),g=x.isArrayOrTypedArray(w.size),m=x.isArrayOrTypedArray(w.opacity),R;function P(oe){return _.opacity*oe}function z(oe){return oe/2}var F;u&&(e.hasColorscale(_,"marker")?F=e.makeColorScaleFuncFromTrace(w):F=x.identity);var B;g&&(B=r(_));var O;m&&(O=function(oe){var le=d(oe)?+x.constrain(oe,0,1):0;return P(le)});var L=[];for(R=0;R850?R+=" Black":u>750?R+=" Extra Bold":u>650?R+=" Bold":u>550?R+=" Semi Bold":u>450?R+=" Medium":u>350?R+=" Regular":u>250?R+=" Light":u>150?R+=" Extra Light":R+=" Thin"):g.slice(0,2).join(" ")==="Open Sans"?(R="Open Sans",u>750?R+=" Extrabold":u>650?R+=" Bold":u>550?R+=" Semibold":u>350?R+=" Regular":R+=" Light"):g.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(R="Klokantech Noto Sans",g[3]==="CJK"&&(R+=" CJK"),R+=u>500?" Bold":" Regular")),m&&(R+=" Italic"),R==="Open Sans Regular Italic"?R="Open Sans Italic":R==="Open Sans Regular Bold"?R="Open Sans Bold":R==="Open Sans Regular Bold Italic"?R="Open Sans Bold Italic":R==="Klokantech Noto Sans Regular Italic"&&(R="Klokantech Noto Sans Italic"),a(R)||(R=w);var P=R.split(", ");return P}}}),pR=He({"src/traces/scattermap/plot.js"(Y,G){var d=Gr(),x=dR(),A=up().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,a,i){this.type="scattermap",this.subplot=r,this.uid=o,this.clusterEnabled=a,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:A+o+"-fill",line:A+o+"-line",circle:A+o+"-circle",symbol:A+o+"-symbol",cluster:A+o+"-cluster",clusterCount:A+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,a){var i={type:"geojson",data:o.geojson};a&&a.enabled&&d.extendFlat(i,{cluster:!0,clusterMaxZoom:a.maxzoom});var n=this.subplot.map.getSource(this.sourceIds[r]);n?n.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,a){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var n=this.layerIds[r],s,c=this.subplot.getMapLayers(),f=0;f=0;m--){var R=g[m];n.removeLayer(h.layerIds[R])}u||n.removeSource(h.sourceIds.circle)}function y(u){for(var g=E.nonCluster,m=0;m=0;m--){var R=g[m];n.removeLayer(h.layerIds[R]),u||n.removeSource(h.sourceIds[R])}}function S(u){v?l(u):b(u)}function M(u){f?T(u):y(u)}function _(){for(var u=f?E.cluster:E.nonCluster,g=0;g=0;i--){var n=a[i];o.removeLayer(this.layerIds[n]),o.removeSource(this.sourceIds[n])}},G.exports=function(o,a){var i=a[0].trace,n=i.cluster&&i.cluster.enabled,s=i.visible!==!0,c=new e(o,i.uid,n,s),f=x(o.gd,a),v=c.below=o.belowLookup["trace-"+i.uid],h,T,l;if(n)for(c.addSource("circle",f.circle,i.cluster),h=0;h=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=S*360,_=i-M;function w(B){var O=B.lonlat;if(O[0]===e||y&&T.indexOf(B.i+1)===-1)return 1/0;var L=x.modHalf(O[0],360),N=O[1],U=h.project([L,N]),Z=U.x-f.c2p([_,N]),Q=U.y-v.c2p([L,n]),ue=Math.max(3,B.mrc||0);return Math.max(Math.sqrt(Z*Z+Q*Q)-ue,1-3/ue)}if(d.getClosest(s,w,a),a.index!==!1){var p=s[a.index],u=p.lonlat,g=[x.modHalf(u[0],360)+M,u[1]],m=f.c2p(g),R=v.c2p(g),P=p.mrc||1;a.x0=m-P,a.x1=m+P,a.y0=R-P,a.y1=R+P;var z={};z[c.subplot]={_subplot:h};var F=c._module.formatLabels(p,c,z);return a.lonLabel=F.lonLabel,a.latLabel=F.latLabel,a.color=A(c,p),a.extraText=o(c,p,s[0].t.labels),a.hovertemplate=c.hovertemplate,[a]}}function o(a,i,n){if(a.hovertemplate)return;var s=i.hi||a.hoverinfo,c=s.split("+"),f=c.indexOf("all")!==-1,v=c.indexOf("lon")!==-1,h=c.indexOf("lat")!==-1,T=i.lonlat,l=[];function y(b){return b+"°"}return f||v&&h?l.push("("+y(T[1])+", "+y(T[0])+")"):v?l.push(n.lon+y(T[0])):h&&l.push(n.lat+y(T[1])),(f||c.indexOf("text")!==-1)&&E(i,a,l),l.join("
")}G.exports={hoverPoints:r,getExtraText:o}}}),gR=He({"src/traces/scattermap/event_data.js"(Y,G){G.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x}}}),yR=He({"src/traces/scattermap/select.js"(Y,G){var d=Gr(),x=Rl(),A=lo().BADNUM;G.exports=function(e,t){var r=e.cd,o=e.xaxis,a=e.yaxis,i=[],n=r[0].trace,s;if(!x.hasMarkers(n))return[];if(t===!1)for(s=0;s1)return 1;for(var K=H,he=0;he<8;he++){var Ee=this.sampleCurveX(K)-H;if(Math.abs(Ee)Ee?Ve=K:nt=K,K=.5*(nt-Ve)+Ve;return K},solve:function(H,D){return this.sampleCurveY(this.solveCurveX(H,D))}};var c=r(n);let f,v;function h(){return f==null&&(f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),f}function T(){if(v==null&&(v=!1,h())){const D=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(D){for(let he=0;he<5*5;he++){const Ee=4*he;D.fillStyle=`rgb(${Ee},${Ee+1},${Ee+2})`,D.fillRect(he%5,Math.floor(he/5),1,1)}const K=D.getImageData(0,0,5,5).data;for(let he=0;he<5*5*4;he++)if(he%4!=3&&K[he]!==he){v=!0;break}}}return v||!1}function l(H,D,K,he){const Ee=new c(H,D,K,he);return Be=>Ee.solve(Be)}const y=l(.25,.1,.25,1);function b(H,D,K){return Math.min(K,Math.max(D,H))}function S(H,D,K){const he=K-D,Ee=((H-D)%he+he)%he+D;return Ee===D?K:Ee}function M(H,...D){for(const K of D)for(const he in K)H[he]=K[he];return H}let _=1;function w(H,D,K){const he={};for(const Ee in H)he[Ee]=D.call(this,H[Ee],Ee,H);return he}function p(H,D,K){const he={};for(const Ee in H)D.call(this,H[Ee],Ee,H)&&(he[Ee]=H[Ee]);return he}function u(H){return Array.isArray(H)?H.map(u):typeof H=="object"&&H?w(H,u):H}const g={};function m(H){g[H]||(typeof console<"u"&&console.warn(H),g[H]=!0)}function R(H,D,K){return(K.y-H.y)*(D.x-H.x)>(D.y-H.y)*(K.x-H.x)}function P(H){return typeof WorkerGlobalScope<"u"&&H!==void 0&&H instanceof WorkerGlobalScope}let z=null;function F(H){return typeof ImageBitmap<"u"&&H instanceof ImageBitmap}const B="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function O(H,D,K,he,Ee){return t(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const Be=new VideoFrame(H,{timestamp:0});try{const Ve=Be==null?void 0:Be.format;if(!Ve||!Ve.startsWith("BGR")&&!Ve.startsWith("RGB"))throw new Error(`Unrecognized format ${Ve}`);const nt=Ve.startsWith("BGR"),mt=new Uint8ClampedArray(he*Ee*4);if(yield Be.copyTo(mt,function(Pt,Xt,er,br,Rr){const jr=4*Math.max(-Xt,0),Yr=(Math.max(0,er)-er)*br*4+jr,ca=4*br,Ca=Math.max(0,Xt),un=Math.max(0,er);return{rect:{x:Ca,y:un,width:Math.min(Pt.width,Xt+br)-Ca,height:Math.min(Pt.height,er+Rr)-un},layout:[{offset:Yr,stride:ca}]}}(H,D,K,he,Ee)),nt)for(let Pt=0;PtP(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,J=function(H,D){if(/:\/\//.test(H.url)&&!/^https?:|^file:/.test(H.url)){const he=ue(H.url);if(he)return he(H,D);if(P(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:H,targetMapId:oe},D)}if(!(/^file:/.test(K=H.url)||/^file:/.test(j())&&!/^\w+:/.test(K))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(he,Ee){return t(this,void 0,void 0,function*(){const Be=new Request(he.url,{method:he.method||"GET",body:he.body,credentials:he.credentials,headers:he.headers,cache:he.cache,referrer:j(),signal:Ee.signal});he.type!=="json"||Be.headers.has("Accept")||Be.headers.set("Accept","application/json");const Ve=yield fetch(Be);if(!Ve.ok){const Pt=yield Ve.blob();throw new le(Ve.status,Ve.statusText,he.url,Pt)}let nt;nt=he.type==="arrayBuffer"||he.type==="image"?Ve.arrayBuffer():he.type==="json"?Ve.json():Ve.text();const mt=yield nt;if(Ee.signal.aborted)throw Z();return{data:mt,cacheControl:Ve.headers.get("Cache-Control"),expires:Ve.headers.get("Expires")}})}(H,D);if(P(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:H,mustQueue:!0,targetMapId:oe},D)}var K;return function(he,Ee){return new Promise((Be,Ve)=>{var nt;const mt=new XMLHttpRequest;mt.open(he.method||"GET",he.url,!0),he.type!=="arrayBuffer"&&he.type!=="image"||(mt.responseType="arraybuffer");for(const Pt in he.headers)mt.setRequestHeader(Pt,he.headers[Pt]);he.type==="json"&&(mt.responseType="text",!((nt=he.headers)===null||nt===void 0)&&nt.Accept||mt.setRequestHeader("Accept","application/json")),mt.withCredentials=he.credentials==="include",mt.onerror=()=>{Ve(new Error(mt.statusText))},mt.onload=()=>{if(!Ee.signal.aborted)if((mt.status>=200&&mt.status<300||mt.status===0)&&mt.response!==null){let Pt=mt.response;if(he.type==="json")try{Pt=JSON.parse(mt.response)}catch(Xt){return void Ve(Xt)}Be({data:Pt,cacheControl:mt.getResponseHeader("Cache-Control"),expires:mt.getResponseHeader("Expires")})}else{const Pt=new Blob([mt.response],{type:mt.getResponseHeader("Content-Type")});Ve(new le(mt.status,mt.statusText,he.url,Pt))}},Ee.signal.addEventListener("abort",()=>{mt.abort(),Ve(Z())}),mt.send(he.body)})}(H,D)};function $(H){if(!H||H.indexOf("://")<=0||H.indexOf("data:image/")===0||H.indexOf("blob:")===0)return!0;const D=new URL(H),K=window.location;return D.protocol===K.protocol&&D.host===K.host}function X(H,D,K){K[H]&&K[H].indexOf(D)!==-1||(K[H]=K[H]||[],K[H].push(D))}function re(H,D,K){if(K&&K[H]){const he=K[H].indexOf(D);he!==-1&&K[H].splice(he,1)}}class ee{constructor(D,K={}){M(this,K),this.type=D}}class q extends ee{constructor(D,K={}){super("error",M({error:D},K))}}class ae{on(D,K){return this._listeners=this._listeners||{},X(D,K,this._listeners),this}off(D,K){return re(D,K,this._listeners),re(D,K,this._oneTimeListeners),this}once(D,K){return K?(this._oneTimeListeners=this._oneTimeListeners||{},X(D,K,this._oneTimeListeners),this):new Promise(he=>this.once(D,he))}fire(D,K){typeof D=="string"&&(D=new ee(D,K||{}));const he=D.type;if(this.listens(he)){D.target=this;const Ee=this._listeners&&this._listeners[he]?this._listeners[he].slice():[];for(const nt of Ee)nt.call(this,D);const Be=this._oneTimeListeners&&this._oneTimeListeners[he]?this._oneTimeListeners[he].slice():[];for(const nt of Be)re(he,nt,this._oneTimeListeners),nt.call(this,D);const Ve=this._eventedParent;Ve&&(M(D,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),Ve.fire(D))}else D instanceof q&&console.error(D.error);return this}listens(D){return this._listeners&&this._listeners[D]&&this._listeners[D].length>0||this._oneTimeListeners&&this._oneTimeListeners[D]&&this._oneTimeListeners[D].length>0||this._eventedParent&&this._eventedParent.listens(D)}setEventedParent(D,K){return this._eventedParent=D,this._eventedParentData=K,this}}var ie={$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"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:{},"viewport-glyph":{},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-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},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"}}};const fe=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function we(H,D){const K={};for(const he in H)he!=="ref"&&(K[he]=H[he]);return fe.forEach(he=>{he in D&&(K[he]=D[he])}),K}function Ae(H,D){if(Array.isArray(H)){if(!Array.isArray(D)||H.length!==D.length)return!1;for(let K=0;K`:H.itemType.kind==="value"?"array":`array<${D}>`}return H.kind}const Oe=[rt,Je,At,St,Rt,Mr,Ut,ze(ir),fr,dr,pt];function ve(H,D){if(D.kind==="error")return null;if(H.kind==="array"){if(D.kind==="array"&&(D.N===0&&D.itemType.kind==="value"||!ve(H.itemType,D.itemType))&&(typeof H.N!="number"||H.N===D.N))return null}else{if(H.kind===D.kind)return null;if(H.kind==="value"){for(const K of Oe)if(!ve(K,D))return null}}return`Expected ${Ge(H)} but found ${Ge(D)} instead.`}function ge(H,D){return D.some(K=>K.kind===H.kind)}function be(H,D){return D.some(K=>K==="null"?H===null:K==="array"?Array.isArray(H):K==="object"?H&&!Array.isArray(H)&&typeof H=="object":K===typeof H)}function Pe(H,D){return H.kind==="array"&&D.kind==="array"?H.itemType.kind===D.itemType.kind&&typeof H.N=="number":H.kind===D.kind}const We=.96422,ct=.82521,_t=4/29,Mt=6/29,Nt=3*Mt*Mt,Bt=Mt*Mt*Mt,qt=Math.PI/180,Zt=180/Math.PI;function lr(H){return(H%=360)<0&&(H+=360),H}function ta([H,D,K,he]){let Ee,Be;const Ve=wa((.2225045*(H=da(H))+.7168786*(D=da(D))+.0606169*(K=da(K)))/1);H===D&&D===K?Ee=Be=Ve:(Ee=wa((.4360747*H+.3850649*D+.1430804*K)/We),Be=wa((.0139322*H+.0971045*D+.7141733*K)/ct));const nt=116*Ve-16;return[nt<0?0:nt,500*(Ee-Ve),200*(Ve-Be),he]}function da(H){return H<=.04045?H/12.92:Math.pow((H+.055)/1.055,2.4)}function wa(H){return H>Bt?Math.pow(H,1/3):H/Nt+_t}function ma([H,D,K,he]){let Ee=(H+16)/116,Be=isNaN(D)?Ee:Ee+D/500,Ve=isNaN(K)?Ee:Ee-K/200;return Ee=1*va(Ee),Be=We*va(Be),Ve=ct*va(Ve),[Ia(3.1338561*Be-1.6168667*Ee-.4906146*Ve),Ia(-.9787684*Be+1.9161415*Ee+.033454*Ve),Ia(.0719453*Be-.2289914*Ee+1.4052427*Ve),he]}function Ia(H){return(H=H<=.00304?12.92*H:1.055*Math.pow(H,1/2.4)-.055)<0?0:H>1?1:H}function va(H){return H>Mt?H*H*H:Nt*(H-_t)}function La(H){return parseInt(H.padEnd(2,H),16)/255}function Ka(H,D){return Vt(D?H/100:H,0,1)}function Vt(H,D,K){return Math.min(Math.max(D,H),K)}function Lt(H){return!H.some(Number.isNaN)}const jt={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]};class Ot{constructor(D,K,he,Ee=1,Be=!0){this.r=D,this.g=K,this.b=he,this.a=Ee,Be||(this.r*=Ee,this.g*=Ee,this.b*=Ee,Ee||this.overwriteGetter("rgb",[D,K,he,Ee]))}static parse(D){if(D instanceof Ot)return D;if(typeof D!="string")return;const K=function(he){if((he=he.toLowerCase().trim())==="transparent")return[0,0,0,0];const Ee=jt[he];if(Ee){const[Ve,nt,mt]=Ee;return[Ve/255,nt/255,mt/255,1]}if(he.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(he)){const Ve=he.length<6?1:2;let nt=1;return[La(he.slice(nt,nt+=Ve)),La(he.slice(nt,nt+=Ve)),La(he.slice(nt,nt+=Ve)),La(he.slice(nt,nt+Ve)||"ff")]}if(he.startsWith("rgb")){const Ve=he.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Ve){const[nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca,un]=Ve,Ha=[Xt||" ",Rr||" ",ca].join("");if(Ha===" "||Ha===" /"||Ha===",,"||Ha===",,,"){const rn=[Pt,br,Yr].join(""),Sn=rn==="%%%"?100:rn===""?255:0;if(Sn){const $n=[Vt(+mt/Sn,0,1),Vt(+er/Sn,0,1),Vt(+jr/Sn,0,1),Ca?Ka(+Ca,un):1];if(Lt($n))return $n}}return}}const Be=he.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Be){const[Ve,nt,mt,Pt,Xt,er,br,Rr,jr]=Be,Yr=[mt||" ",Xt||" ",br].join("");if(Yr===" "||Yr===" /"||Yr===",,"||Yr===",,,"){const ca=[+nt,Vt(+Pt,0,100),Vt(+er,0,100),Rr?Ka(+Rr,jr):1];if(Lt(ca))return function([Ca,un,Ha,rn]){function Sn($n){const Oi=($n+Ca/30)%12,qo=un*Math.min(Ha,1-Ha);return Ha-qo*Math.max(-1,Math.min(Oi-3,9-Oi,1))}return Ca=lr(Ca),un/=100,Ha/=100,[Sn(0),Sn(8),Sn(4),rn]}(ca)}}}(D);return K?new Ot(...K,!1):void 0}get rgb(){const{r:D,g:K,b:he,a:Ee}=this,Be=Ee||1/0;return this.overwriteGetter("rgb",[D/Be,K/Be,he/Be,Ee])}get hcl(){return this.overwriteGetter("hcl",function(D){const[K,he,Ee,Be]=ta(D),Ve=Math.sqrt(he*he+Ee*Ee);return[Math.round(1e4*Ve)?lr(Math.atan2(Ee,he)*Zt):NaN,Ve,K,Be]}(this.rgb))}get lab(){return this.overwriteGetter("lab",ta(this.rgb))}overwriteGetter(D,K){return Object.defineProperty(this,D,{value:K}),K}toString(){const[D,K,he,Ee]=this.rgb;return`rgba(${[D,K,he].map(Be=>Math.round(255*Be)).join(",")},${Ee})`}}Ot.black=new Ot(0,0,0,1),Ot.white=new Ot(1,1,1,1),Ot.transparent=new Ot(0,0,0,0),Ot.red=new Ot(1,0,0,1);class gr{constructor(D,K,he){this.sensitivity=D?K?"variant":"case":K?"accent":"base",this.locale=he,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(D,K){return this.collator.compare(D,K)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Br{constructor(D,K,he,Ee,Be){this.text=D,this.image=K,this.scale=he,this.fontStack=Ee,this.textColor=Be}}class na{constructor(D){this.sections=D}static fromString(D){return new na([new Br(D,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(D=>D.text.length!==0||D.image&&D.image.name.length!==0)}static factory(D){return D instanceof na?D:na.fromString(D)}toString(){return this.sections.length===0?"":this.sections.map(D=>D.text).join("")}}class Ur{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof Ur)return D;if(typeof D=="number")return new Ur([D,D,D,D]);if(Array.isArray(D)&&!(D.length<1||D.length>4)){for(const K of D)if(typeof K!="number")return;switch(D.length){case 1:D=[D[0],D[0],D[0],D[0]];break;case 2:D=[D[0],D[1],D[0],D[1]];break;case 3:D=[D[0],D[1],D[2],D[1]]}return new Ur(D)}}toString(){return JSON.stringify(this.values)}}const ga=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Aa{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof Aa)return D;if(Array.isArray(D)&&!(D.length<1)&&D.length%2==0){for(let K=0;K=0&&H<=255&&typeof D=="number"&&D>=0&&D<=255&&typeof K=="number"&&K>=0&&K<=255?he===void 0||typeof he=="number"&&he>=0&&he<=1?null:`Invalid rgba value [${[H,D,K,he].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof he=="number"?[H,D,K,he]:[H,D,K]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Oa(H){if(H===null||typeof H=="string"||typeof H=="boolean"||typeof H=="number"||H instanceof Ot||H instanceof gr||H instanceof na||H instanceof Ur||H instanceof Aa||H instanceof Pa)return!0;if(Array.isArray(H)){for(const D of H)if(!Oa(D))return!1;return!0}if(typeof H=="object"){for(const D in H)if(!Oa(H[D]))return!1;return!0}return!1}function dt(H){if(H===null)return rt;if(typeof H=="string")return At;if(typeof H=="boolean")return St;if(typeof H=="number")return Je;if(H instanceof Ot)return Rt;if(H instanceof gr)return ar;if(H instanceof na)return Mr;if(H instanceof Ur)return fr;if(H instanceof Aa)return pt;if(H instanceof Pa)return dr;if(Array.isArray(H)){const D=H.length;let K;for(const he of H){const Ee=dt(he);if(K){if(K===Ee)continue;K=ir;break}K=Ee}return ze(K||ir,D)}return Ut}function vt(H){const D=typeof H;return H===null?"":D==="string"||D==="number"||D==="boolean"?String(H):H instanceof Ot||H instanceof na||H instanceof Ur||H instanceof Aa||H instanceof Pa?H.toString():JSON.stringify(H)}class Lr{constructor(D,K){this.type=D,this.value=K}static parse(D,K){if(D.length!==2)return K.error(`'literal' expression requires exactly one argument, but found ${D.length-1} instead.`);if(!Oa(D[1]))return K.error("invalid value");const he=D[1];let Ee=dt(he);const Be=K.expectedType;return Ee.kind!=="array"||Ee.N!==0||!Be||Be.kind!=="array"||typeof Be.N=="number"&&Be.N!==0||(Ee=Be),new Lr(Ee,he)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Er{constructor(D){this.name="ExpressionEvaluationError",this.message=D}toJSON(){return this.message}}const _r={string:At,number:Je,boolean:St,object:Ut};class yr{constructor(D,K){this.type=D,this.args=K}static parse(D,K){if(D.length<2)return K.error("Expected at least one argument.");let he,Ee=1;const Be=D[0];if(Be==="array"){let nt,mt;if(D.length>2){const Pt=D[1];if(typeof Pt!="string"||!(Pt in _r)||Pt==="object")return K.error('The item type argument of "array" must be one of string, number, boolean',1);nt=_r[Pt],Ee++}else nt=ir;if(D.length>3){if(D[2]!==null&&(typeof D[2]!="number"||D[2]<0||D[2]!==Math.floor(D[2])))return K.error('The length argument to "array" must be a positive integer literal',2);mt=D[2],Ee++}he=ze(nt,mt)}else{if(!_r[Be])throw new Error(`Types doesn't contain name = ${Be}`);he=_r[Be]}const Ve=[];for(;EeD.outputDefined())}}const kr={"to-boolean":St,"to-color":Rt,"to-number":Je,"to-string":At};class zr{constructor(D,K){this.type=D,this.args=K}static parse(D,K){if(D.length<2)return K.error("Expected at least one argument.");const he=D[0];if(!kr[he])throw new Error(`Can't parse ${he} as it is not part of the known types`);if((he==="to-boolean"||he==="to-string")&&D.length!==2)return K.error("Expected one argument.");const Ee=kr[he],Be=[];for(let Ve=1;Ve4?`Invalid rbga value ${JSON.stringify(K)}: expected an array containing either three or four numeric values.`:sa(K[0],K[1],K[2],K[3]),!he))return new Ot(K[0]/255,K[1]/255,K[2]/255,K[3])}throw new Er(he||`Could not parse color from value '${typeof K=="string"?K:JSON.stringify(K)}'`)}case"padding":{let K;for(const he of this.args){K=he.evaluate(D);const Ee=Ur.parse(K);if(Ee)return Ee}throw new Er(`Could not parse padding from value '${typeof K=="string"?K:JSON.stringify(K)}'`)}case"variableAnchorOffsetCollection":{let K;for(const he of this.args){K=he.evaluate(D);const Ee=Aa.parse(K);if(Ee)return Ee}throw new Er(`Could not parse variableAnchorOffsetCollection from value '${typeof K=="string"?K:JSON.stringify(K)}'`)}case"number":{let K=null;for(const he of this.args){if(K=he.evaluate(D),K===null)return 0;const Ee=Number(K);if(!isNaN(Ee))return Ee}throw new Er(`Could not convert ${JSON.stringify(K)} to number.`)}case"formatted":return na.fromString(vt(this.args[0].evaluate(D)));case"resolvedImage":return Pa.fromString(vt(this.args[0].evaluate(D)));default:return vt(this.args[0].evaluate(D))}}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}const Pr=["Unknown","Point","LineString","Polygon"];class Hr{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Pr[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(D){let K=this._parseColorCache[D];return K||(K=this._parseColorCache[D]=Ot.parse(D)),K}}class Zr{constructor(D,K,he=[],Ee,Be=new $e,Ve=[]){this.registry=D,this.path=he,this.key=he.map(nt=>`[${nt}]`).join(""),this.scope=Be,this.errors=Ve,this.expectedType=Ee,this._isConstant=K}parse(D,K,he,Ee,Be={}){return K?this.concat(K,he,Ee)._parse(D,Be):this._parse(D,Be)}_parse(D,K){function he(Ee,Be,Ve){return Ve==="assert"?new yr(Be,[Ee]):Ve==="coerce"?new zr(Be,[Ee]):Ee}if(D!==null&&typeof D!="string"&&typeof D!="boolean"&&typeof D!="number"||(D=["literal",D]),Array.isArray(D)){if(D.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const Ee=D[0];if(typeof Ee!="string")return this.error(`Expression name must be a string, but found ${typeof Ee} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const Be=this.registry[Ee];if(Be){let Ve=Be.parse(D,this);if(!Ve)return null;if(this.expectedType){const nt=this.expectedType,mt=Ve.type;if(nt.kind!=="string"&&nt.kind!=="number"&&nt.kind!=="boolean"&&nt.kind!=="object"&&nt.kind!=="array"||mt.kind!=="value")if(nt.kind!=="color"&&nt.kind!=="formatted"&&nt.kind!=="resolvedImage"||mt.kind!=="value"&&mt.kind!=="string")if(nt.kind!=="padding"||mt.kind!=="value"&&mt.kind!=="number"&&mt.kind!=="array")if(nt.kind!=="variableAnchorOffsetCollection"||mt.kind!=="value"&&mt.kind!=="array"){if(this.checkSubtype(nt,mt))return null}else Ve=he(Ve,nt,K.typeAnnotation||"coerce");else Ve=he(Ve,nt,K.typeAnnotation||"coerce");else Ve=he(Ve,nt,K.typeAnnotation||"coerce");else Ve=he(Ve,nt,K.typeAnnotation||"assert")}if(!(Ve instanceof Lr)&&Ve.type.kind!=="resolvedImage"&&this._isConstant(Ve)){const nt=new Hr;try{Ve=new Lr(Ve.type,Ve.evaluate(nt))}catch(mt){return this.error(mt.message),null}}return Ve}return this.error(`Unknown expression "${Ee}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(D===void 0?"'undefined' value invalid. Use null instead.":typeof D=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof D} instead.`)}concat(D,K,he){const Ee=typeof D=="number"?this.path.concat(D):this.path,Be=he?this.scope.concat(he):this.scope;return new Zr(this.registry,this._isConstant,Ee,K||null,Be,this.errors)}error(D,...K){const he=`${this.key}${K.map(Ee=>`[${Ee}]`).join("")}`;this.errors.push(new Re(he,D))}checkSubtype(D,K){const he=ve(D,K);return he&&this.error(he),he}}class Jr{constructor(D,K){this.type=K.type,this.bindings=[].concat(D),this.result=K}evaluate(D){return this.result.evaluate(D)}eachChild(D){for(const K of this.bindings)D(K[1]);D(this.result)}static parse(D,K){if(D.length<4)return K.error(`Expected at least 3 arguments, but found ${D.length-1} instead.`);const he=[];for(let Be=1;Be=he.length)throw new Er(`Array index out of bounds: ${K} > ${he.length-1}.`);if(K!==Math.floor(K))throw new Er(`Array index must be an integer, but found ${K} instead.`);return he[K]}eachChild(D){D(this.index),D(this.input)}outputDefined(){return!1}}class mr{constructor(D,K){this.type=St,this.needle=D,this.haystack=K}static parse(D,K){if(D.length!==3)return K.error(`Expected 2 arguments, but found ${D.length-1} instead.`);const he=K.parse(D[1],1,ir),Ee=K.parse(D[2],2,ir);return he&&Ee?ge(he.type,[St,At,Je,rt,ir])?new mr(he,Ee):K.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(he.type)} instead`):null}evaluate(D){const K=this.needle.evaluate(D),he=this.haystack.evaluate(D);if(!he)return!1;if(!be(K,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(dt(K))} instead.`);if(!be(he,["string","array"]))throw new Er(`Expected second argument to be of type array or string, but found ${Ge(dt(he))} instead.`);return he.indexOf(K)>=0}eachChild(D){D(this.needle),D(this.haystack)}outputDefined(){return!0}}class $r{constructor(D,K,he){this.type=Je,this.needle=D,this.haystack=K,this.fromIndex=he}static parse(D,K){if(D.length<=2||D.length>=5)return K.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);const he=K.parse(D[1],1,ir),Ee=K.parse(D[2],2,ir);if(!he||!Ee)return null;if(!ge(he.type,[St,At,Je,rt,ir]))return K.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(he.type)} instead`);if(D.length===4){const Be=K.parse(D[3],3,Je);return Be?new $r(he,Ee,Be):null}return new $r(he,Ee)}evaluate(D){const K=this.needle.evaluate(D),he=this.haystack.evaluate(D);if(!be(K,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(dt(K))} instead.`);let Ee;if(this.fromIndex&&(Ee=this.fromIndex.evaluate(D)),be(he,["string"])){const Be=he.indexOf(K,Ee);return Be===-1?-1:[...he.slice(0,Be)].length}if(be(he,["array"]))return he.indexOf(K,Ee);throw new Er(`Expected second argument to be of type array or string, but found ${Ge(dt(he))} instead.`)}eachChild(D){D(this.needle),D(this.haystack),this.fromIndex&&D(this.fromIndex)}outputDefined(){return!1}}class oa{constructor(D,K,he,Ee,Be,Ve){this.inputType=D,this.type=K,this.input=he,this.cases=Ee,this.outputs=Be,this.otherwise=Ve}static parse(D,K){if(D.length<5)return K.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if(D.length%2!=1)return K.error("Expected an even number of arguments.");let he,Ee;K.expectedType&&K.expectedType.kind!=="value"&&(Ee=K.expectedType);const Be={},Ve=[];for(let Pt=2;PtNumber.MAX_SAFE_INTEGER)return br.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof jr=="number"&&Math.floor(jr)!==jr)return br.error("Numeric branch labels must be integer values.");if(he){if(br.checkSubtype(he,dt(jr)))return null}else he=dt(jr);if(Be[String(jr)]!==void 0)return br.error("Branch labels must be unique.");Be[String(jr)]=Ve.length}const Rr=K.parse(er,Pt,Ee);if(!Rr)return null;Ee=Ee||Rr.type,Ve.push(Rr)}const nt=K.parse(D[1],1,ir);if(!nt)return null;const mt=K.parse(D[D.length-1],D.length-1,Ee);return mt?nt.type.kind!=="value"&&K.concat(1).checkSubtype(he,nt.type)?null:new oa(he,Ee,nt,Be,Ve,mt):null}evaluate(D){const K=this.input.evaluate(D);return(dt(K)===this.inputType&&this.outputs[this.cases[K]]||this.otherwise).evaluate(D)}eachChild(D){D(this.input),this.outputs.forEach(D),D(this.otherwise)}outputDefined(){return this.outputs.every(D=>D.outputDefined())&&this.otherwise.outputDefined()}}class Sa{constructor(D,K,he){this.type=D,this.branches=K,this.otherwise=he}static parse(D,K){if(D.length<4)return K.error(`Expected at least 3 arguments, but found only ${D.length-1}.`);if(D.length%2!=0)return K.error("Expected an odd number of arguments.");let he;K.expectedType&&K.expectedType.kind!=="value"&&(he=K.expectedType);const Ee=[];for(let Ve=1;VeK.outputDefined())&&this.otherwise.outputDefined()}}class ya{constructor(D,K,he,Ee){this.type=D,this.input=K,this.beginIndex=he,this.endIndex=Ee}static parse(D,K){if(D.length<=2||D.length>=5)return K.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);const he=K.parse(D[1],1,ir),Ee=K.parse(D[2],2,Je);if(!he||!Ee)return null;if(!ge(he.type,[ze(ir),At,ir]))return K.error(`Expected first argument to be of type array or string, but found ${Ge(he.type)} instead`);if(D.length===4){const Be=K.parse(D[3],3,Je);return Be?new ya(he.type,he,Ee,Be):null}return new ya(he.type,he,Ee)}evaluate(D){const K=this.input.evaluate(D),he=this.beginIndex.evaluate(D);let Ee;if(this.endIndex&&(Ee=this.endIndex.evaluate(D)),be(K,["string"]))return[...K].slice(he,Ee).join("");if(be(K,["array"]))return K.slice(he,Ee);throw new Er(`Expected first argument to be of type array or string, but found ${Ge(dt(K))} instead.`)}eachChild(D){D(this.input),D(this.beginIndex),this.endIndex&&D(this.endIndex)}outputDefined(){return!1}}function ra(H,D){const K=H.length-1;let he,Ee,Be=0,Ve=K,nt=0;for(;Be<=Ve;)if(nt=Math.floor((Be+Ve)/2),he=H[nt],Ee=H[nt+1],he<=D){if(nt===K||DD))throw new Er("Input is not a number.");Ve=nt-1}return 0}class pa{constructor(D,K,he){this.type=D,this.input=K,this.labels=[],this.outputs=[];for(const[Ee,Be]of he)this.labels.push(Ee),this.outputs.push(Be)}static parse(D,K){if(D.length-1<4)return K.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return K.error("Expected an even number of arguments.");const he=K.parse(D[1],1,Je);if(!he)return null;const Ee=[];let Be=null;K.expectedType&&K.expectedType.kind!=="value"&&(Be=K.expectedType);for(let Ve=1;Ve=nt)return K.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Pt);const er=K.parse(mt,Xt,Be);if(!er)return null;Be=Be||er.type,Ee.push([nt,er])}return new pa(Be,he,Ee)}evaluate(D){const K=this.labels,he=this.outputs;if(K.length===1)return he[0].evaluate(D);const Ee=this.input.evaluate(D);if(Ee<=K[0])return he[0].evaluate(D);const Be=K.length;return Ee>=K[Be-1]?he[Be-1].evaluate(D):he[ra(K,Ee)].evaluate(D)}eachChild(D){D(this.input);for(const K of this.outputs)D(K)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function pn(H){return H&&H.__esModule&&Object.prototype.hasOwnProperty.call(H,"default")?H.default:H}var Ga=qn;function qn(H,D,K,he){this.cx=3*H,this.bx=3*(K-H)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*D,this.by=3*(he-D)-this.cy,this.ay=1-this.cy-this.by,this.p1x=H,this.p1y=D,this.p2x=K,this.p2y=he}qn.prototype={sampleCurveX:function(H){return((this.ax*H+this.bx)*H+this.cx)*H},sampleCurveY:function(H){return((this.ay*H+this.by)*H+this.cy)*H},sampleCurveDerivativeX:function(H){return(3*this.ax*H+2*this.bx)*H+this.cx},solveCurveX:function(H,D){if(D===void 0&&(D=1e-6),H<0)return 0;if(H>1)return 1;for(var K=H,he=0;he<8;he++){var Ee=this.sampleCurveX(K)-H;if(Math.abs(Ee)Ee?Ve=K:nt=K,K=.5*(nt-Ve)+Ve;return K},solve:function(H,D){return this.sampleCurveY(this.solveCurveX(H,D))}};var Vn=pn(Ga);function di(H,D,K){return H+K*(D-H)}function yi(H,D,K){return H.map((he,Ee)=>di(he,D[Ee],K))}const Ci={number:di,color:function(H,D,K,he="rgb"){switch(he){case"rgb":{const[Ee,Be,Ve,nt]=yi(H.rgb,D.rgb,K);return new Ot(Ee,Be,Ve,nt,!1)}case"hcl":{const[Ee,Be,Ve,nt]=H.hcl,[mt,Pt,Xt,er]=D.hcl;let br,Rr;if(isNaN(Ee)||isNaN(mt))isNaN(Ee)?isNaN(mt)?br=NaN:(br=mt,Ve!==1&&Ve!==0||(Rr=Pt)):(br=Ee,Xt!==1&&Xt!==0||(Rr=Be));else{let un=mt-Ee;mt>Ee&&un>180?un-=360:mt180&&(un+=360),br=Ee+K*un}const[jr,Yr,ca,Ca]=function([un,Ha,rn,Sn]){return un=isNaN(un)?0:un*qt,ma([rn,Math.cos(un)*Ha,Math.sin(un)*Ha,Sn])}([br,Rr??di(Be,Pt,K),di(Ve,Xt,K),di(nt,er,K)]);return new Ot(jr,Yr,ca,Ca,!1)}case"lab":{const[Ee,Be,Ve,nt]=ma(yi(H.lab,D.lab,K));return new Ot(Ee,Be,Ve,nt,!1)}}},array:yi,padding:function(H,D,K){return new Ur(yi(H.values,D.values,K))},variableAnchorOffsetCollection:function(H,D,K){const he=H.values,Ee=D.values;if(he.length!==Ee.length)throw new Er(`Cannot interpolate values of different length. from: ${H.toString()}, to: ${D.toString()}`);const Be=[];for(let Ve=0;Vetypeof Xt!="number"||Xt<0||Xt>1))return K.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Ee={name:"cubic-bezier",controlPoints:Pt}}}if(D.length-1<4)return K.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return K.error("Expected an even number of arguments.");if(Be=K.parse(Be,2,Je),!Be)return null;const nt=[];let mt=null;he==="interpolate-hcl"||he==="interpolate-lab"?mt=Rt:K.expectedType&&K.expectedType.kind!=="value"&&(mt=K.expectedType);for(let Pt=0;Pt=Xt)return K.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',br);const jr=K.parse(er,Rr,mt);if(!jr)return null;mt=mt||jr.type,nt.push([Xt,jr])}return Pe(mt,Je)||Pe(mt,Rt)||Pe(mt,fr)||Pe(mt,pt)||Pe(mt,ze(Je))?new ci(mt,he,Ee,Be,nt):K.error(`Type ${Ge(mt)} is not interpolatable.`)}evaluate(D){const K=this.labels,he=this.outputs;if(K.length===1)return he[0].evaluate(D);const Ee=this.input.evaluate(D);if(Ee<=K[0])return he[0].evaluate(D);const Be=K.length;if(Ee>=K[Be-1])return he[Be-1].evaluate(D);const Ve=ra(K,Ee),nt=ci.interpolationFactor(this.interpolation,Ee,K[Ve],K[Ve+1]),mt=he[Ve].evaluate(D),Pt=he[Ve+1].evaluate(D);switch(this.operator){case"interpolate":return Ci[this.type.kind](mt,Pt,nt);case"interpolate-hcl":return Ci.color(mt,Pt,nt,"hcl");case"interpolate-lab":return Ci.color(mt,Pt,nt,"lab")}}eachChild(D){D(this.input);for(const K of this.outputs)D(K)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function ei(H,D,K,he){const Ee=he-K,Be=H-K;return Ee===0?0:D===1?Be/Ee:(Math.pow(D,Be)-1)/(Math.pow(D,Ee)-1)}class mi{constructor(D,K){this.type=D,this.args=K}static parse(D,K){if(D.length<2)return K.error("Expectected at least one argument.");let he=null;const Ee=K.expectedType;Ee&&Ee.kind!=="value"&&(he=Ee);const Be=[];for(const nt of D.slice(1)){const mt=K.parse(nt,1+Be.length,he,void 0,{typeAnnotation:"omit"});if(!mt)return null;he=he||mt.type,Be.push(mt)}if(!he)throw new Error("No output type");const Ve=Ee&&Be.some(nt=>ve(Ee,nt.type));return new mi(Ve?ir:he,Be)}evaluate(D){let K,he=null,Ee=0;for(const Be of this.args)if(Ee++,he=Be.evaluate(D),he&&he instanceof Pa&&!he.available&&(K||(K=he.name),he=null,Ee===this.args.length&&(he=K)),he!==null)break;return he}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}function uo(H,D){return H==="=="||H==="!="?D.kind==="boolean"||D.kind==="string"||D.kind==="number"||D.kind==="null"||D.kind==="value":D.kind==="string"||D.kind==="number"||D.kind==="value"}function Lo(H,D,K,he){return he.compare(D,K)===0}function Wo(H,D,K){const he=H!=="=="&&H!=="!=";return class QA{constructor(Be,Ve,nt){this.type=St,this.lhs=Be,this.rhs=Ve,this.collator=nt,this.hasUntypedArgument=Be.type.kind==="value"||Ve.type.kind==="value"}static parse(Be,Ve){if(Be.length!==3&&Be.length!==4)return Ve.error("Expected two or three arguments.");const nt=Be[0];let mt=Ve.parse(Be[1],1,ir);if(!mt)return null;if(!uo(nt,mt.type))return Ve.concat(1).error(`"${nt}" comparisons are not supported for type '${Ge(mt.type)}'.`);let Pt=Ve.parse(Be[2],2,ir);if(!Pt)return null;if(!uo(nt,Pt.type))return Ve.concat(2).error(`"${nt}" comparisons are not supported for type '${Ge(Pt.type)}'.`);if(mt.type.kind!==Pt.type.kind&&mt.type.kind!=="value"&&Pt.type.kind!=="value")return Ve.error(`Cannot compare types '${Ge(mt.type)}' and '${Ge(Pt.type)}'.`);he&&(mt.type.kind==="value"&&Pt.type.kind!=="value"?mt=new yr(Pt.type,[mt]):mt.type.kind!=="value"&&Pt.type.kind==="value"&&(Pt=new yr(mt.type,[Pt])));let Xt=null;if(Be.length===4){if(mt.type.kind!=="string"&&Pt.type.kind!=="string"&&mt.type.kind!=="value"&&Pt.type.kind!=="value")return Ve.error("Cannot use collator to compare non-string types.");if(Xt=Ve.parse(Be[3],3,ar),!Xt)return null}return new QA(mt,Pt,Xt)}evaluate(Be){const Ve=this.lhs.evaluate(Be),nt=this.rhs.evaluate(Be);if(he&&this.hasUntypedArgument){const mt=dt(Ve),Pt=dt(nt);if(mt.kind!==Pt.kind||mt.kind!=="string"&&mt.kind!=="number")throw new Er(`Expected arguments for "${H}" to be (string, string) or (number, number), but found (${mt.kind}, ${Pt.kind}) instead.`)}if(this.collator&&!he&&this.hasUntypedArgument){const mt=dt(Ve),Pt=dt(nt);if(mt.kind!=="string"||Pt.kind!=="string")return D(Be,Ve,nt)}return this.collator?K(Be,Ve,nt,this.collator.evaluate(Be)):D(Be,Ve,nt)}eachChild(Be){Be(this.lhs),Be(this.rhs),this.collator&&Be(this.collator)}outputDefined(){return!0}}}const li=Wo("==",function(H,D,K){return D===K},Lo),Ii=Wo("!=",function(H,D,K){return D!==K},function(H,D,K,he){return!Lo(0,D,K,he)}),xi=Wo("<",function(H,D,K){return D",function(H,D,K){return D>K},function(H,D,K,he){return he.compare(D,K)>0}),So=Wo("<=",function(H,D,K){return D<=K},function(H,D,K,he){return he.compare(D,K)<=0}),Ro=Wo(">=",function(H,D,K){return D>=K},function(H,D,K,he){return he.compare(D,K)>=0});class Li{constructor(D,K,he){this.type=ar,this.locale=he,this.caseSensitive=D,this.diacriticSensitive=K}static parse(D,K){if(D.length!==2)return K.error("Expected one argument.");const he=D[1];if(typeof he!="object"||Array.isArray(he))return K.error("Collator options argument must be an object.");const Ee=K.parse(he["case-sensitive"]!==void 0&&he["case-sensitive"],1,St);if(!Ee)return null;const Be=K.parse(he["diacritic-sensitive"]!==void 0&&he["diacritic-sensitive"],1,St);if(!Be)return null;let Ve=null;return he.locale&&(Ve=K.parse(he.locale,1,At),!Ve)?null:new Li(Ee,Be,Ve)}evaluate(D){return new gr(this.caseSensitive.evaluate(D),this.diacriticSensitive.evaluate(D),this.locale?this.locale.evaluate(D):null)}eachChild(D){D(this.caseSensitive),D(this.diacriticSensitive),this.locale&&D(this.locale)}outputDefined(){return!1}}class Yi{constructor(D,K,he,Ee,Be){this.type=At,this.number=D,this.locale=K,this.currency=he,this.minFractionDigits=Ee,this.maxFractionDigits=Be}static parse(D,K){if(D.length!==3)return K.error("Expected two arguments.");const he=K.parse(D[1],1,Je);if(!he)return null;const Ee=D[2];if(typeof Ee!="object"||Array.isArray(Ee))return K.error("NumberFormat options argument must be an object.");let Be=null;if(Ee.locale&&(Be=K.parse(Ee.locale,1,At),!Be))return null;let Ve=null;if(Ee.currency&&(Ve=K.parse(Ee.currency,1,At),!Ve))return null;let nt=null;if(Ee["min-fraction-digits"]&&(nt=K.parse(Ee["min-fraction-digits"],1,Je),!nt))return null;let mt=null;return Ee["max-fraction-digits"]&&(mt=K.parse(Ee["max-fraction-digits"],1,Je),!mt)?null:new Yi(he,Be,Ve,nt,mt)}evaluate(D){return new Intl.NumberFormat(this.locale?this.locale.evaluate(D):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(D):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(D):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(D):void 0}).format(this.number.evaluate(D))}eachChild(D){D(this.number),this.locale&&D(this.locale),this.currency&&D(this.currency),this.minFractionDigits&&D(this.minFractionDigits),this.maxFractionDigits&&D(this.maxFractionDigits)}outputDefined(){return!1}}class bs{constructor(D){this.type=Mr,this.sections=D}static parse(D,K){if(D.length<2)return K.error("Expected at least one argument.");const he=D[1];if(!Array.isArray(he)&&typeof he=="object")return K.error("First argument must be an image or text section.");const Ee=[];let Be=!1;for(let Ve=1;Ve<=D.length-1;++Ve){const nt=D[Ve];if(Be&&typeof nt=="object"&&!Array.isArray(nt)){Be=!1;let mt=null;if(nt["font-scale"]&&(mt=K.parse(nt["font-scale"],1,Je),!mt))return null;let Pt=null;if(nt["text-font"]&&(Pt=K.parse(nt["text-font"],1,ze(At)),!Pt))return null;let Xt=null;if(nt["text-color"]&&(Xt=K.parse(nt["text-color"],1,Rt),!Xt))return null;const er=Ee[Ee.length-1];er.scale=mt,er.font=Pt,er.textColor=Xt}else{const mt=K.parse(D[Ve],1,ir);if(!mt)return null;const Pt=mt.type.kind;if(Pt!=="string"&&Pt!=="value"&&Pt!=="null"&&Pt!=="resolvedImage")return K.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Be=!0,Ee.push({content:mt,scale:null,font:null,textColor:null})}}return new bs(Ee)}evaluate(D){return new na(this.sections.map(K=>{const he=K.content.evaluate(D);return dt(he)===dr?new Br("",he,null,null,null):new Br(vt(he),null,K.scale?K.scale.evaluate(D):null,K.font?K.font.evaluate(D).join(","):null,K.textColor?K.textColor.evaluate(D):null)}))}eachChild(D){for(const K of this.sections)D(K.content),K.scale&&D(K.scale),K.font&&D(K.font),K.textColor&&D(K.textColor)}outputDefined(){return!1}}class as{constructor(D){this.type=dr,this.input=D}static parse(D,K){if(D.length!==2)return K.error("Expected two arguments.");const he=K.parse(D[1],1,At);return he?new as(he):K.error("No image name provided.")}evaluate(D){const K=this.input.evaluate(D),he=Pa.fromString(K);return he&&D.availableImages&&(he.available=D.availableImages.indexOf(K)>-1),he}eachChild(D){D(this.input)}outputDefined(){return!1}}class fs{constructor(D){this.type=Je,this.input=D}static parse(D,K){if(D.length!==2)return K.error(`Expected 1 argument, but found ${D.length-1} instead.`);const he=K.parse(D[1],1);return he?he.type.kind!=="array"&&he.type.kind!=="string"&&he.type.kind!=="value"?K.error(`Expected argument of type string or array, but found ${Ge(he.type)} instead.`):new fs(he):null}evaluate(D){const K=this.input.evaluate(D);if(typeof K=="string")return[...K].length;if(Array.isArray(K))return K.length;throw new Er(`Expected value to be of type string or array, but found ${Ge(dt(K))} instead.`)}eachChild(D){D(this.input)}outputDefined(){return!1}}const Co=8192;function Qa(H,D){const K=(180+H[0])/360,he=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+H[1]*Math.PI/360)))/360,Ee=Math.pow(2,D.z);return[Math.round(K*Ee*Co),Math.round(he*Ee*Co)]}function Jn(H,D){const K=Math.pow(2,D.z);return[(Ee=(H[0]/Co+D.x)/K,360*Ee-180),(he=(H[1]/Co+D.y)/K,360/Math.PI*Math.atan(Math.exp((180-360*he)*Math.PI/180))-90)];var he,Ee}function Os(H,D){H[0]=Math.min(H[0],D[0]),H[1]=Math.min(H[1],D[1]),H[2]=Math.max(H[2],D[0]),H[3]=Math.max(H[3],D[1])}function ds(H,D){return!(H[0]<=D[0]||H[2]>=D[2]||H[1]<=D[1]||H[3]>=D[3])}function Ui(H,D,K){const he=H[0]-D[0],Ee=H[1]-D[1],Be=H[0]-K[0],Ve=H[1]-K[1];return he*Ve-Be*Ee==0&&he*Be<=0&&Ee*Ve<=0}function ms(H,D,K,he){return(Ee=[he[0]-K[0],he[1]-K[1]])[0]*(Be=[D[0]-H[0],D[1]-H[1]])[1]-Ee[1]*Be[0]!=0&&!(!Pi(H,D,K,he)||!Pi(K,he,H,D));var Ee,Be}function Mo(H,D,K){for(const he of K)for(let Ee=0;Ee(Ee=H)[1]!=(Ve=nt[mt+1])[1]>Ee[1]&&Ee[0]<(Ve[0]-Be[0])*(Ee[1]-Be[1])/(Ve[1]-Be[1])+Be[0]&&(he=!he)}var Ee,Be,Ve;return he}function Ks(H,D){for(const K of D)if(ws(H,K))return!0;return!1}function Rn(H,D){for(const K of H)if(!ws(K,D))return!1;for(let K=0;K0&&nt<0||Ve<0&&nt>0}function zo(H,D,K){const he=[];for(let Ee=0;EeK[2]){const Ee=.5*he;let Be=H[0]-K[0]>Ee?-he:K[0]-H[0]>Ee?he:0;Be===0&&(Be=H[0]-K[2]>Ee?-he:K[2]-H[0]>Ee?he:0),H[0]+=Be}Os(D,H)}function wl(H,D,K,he){const Ee=Math.pow(2,he.z)*Co,Be=[he.x*Co,he.y*Co],Ve=[];for(const nt of H)for(const mt of nt){const Pt=[mt.x+Be[0],mt.y+Be[1]];bi(Pt,D,K,Ee),Ve.push(Pt)}return Ve}function $l(H,D,K,he){const Ee=Math.pow(2,he.z)*Co,Be=[he.x*Co,he.y*Co],Ve=[];for(const mt of H){const Pt=[];for(const Xt of mt){const er=[Xt.x+Be[0],Xt.y+Be[1]];Os(D,er),Pt.push(er)}Ve.push(Pt)}if(D[2]-D[0]<=Ee/2){(nt=D)[0]=nt[1]=1/0,nt[2]=nt[3]=-1/0;for(const mt of Ve)for(const Pt of mt)bi(Pt,D,K,Ee)}var nt;return Ve}class Js{constructor(D,K){this.type=St,this.geojson=D,this.geometries=K}static parse(D,K){if(D.length!==2)return K.error(`'within' expression requires exactly one argument, but found ${D.length-1} instead.`);if(Oa(D[1])){const he=D[1];if(he.type==="FeatureCollection"){const Ee=[];for(const Be of he.features){const{type:Ve,coordinates:nt}=Be.geometry;Ve==="Polygon"&&Ee.push(nt),Ve==="MultiPolygon"&&Ee.push(...nt)}if(Ee.length)return new Js(he,{type:"MultiPolygon",coordinates:Ee})}else if(he.type==="Feature"){const Ee=he.geometry.type;if(Ee==="Polygon"||Ee==="MultiPolygon")return new Js(he,he.geometry)}else if(he.type==="Polygon"||he.type==="MultiPolygon")return new Js(he,he)}return K.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return function(K,he){const Ee=[1/0,1/0,-1/0,-1/0],Be=[1/0,1/0,-1/0,-1/0],Ve=K.canonicalID();if(he.type==="Polygon"){const nt=zo(he.coordinates,Be,Ve),mt=wl(K.geometry(),Ee,Be,Ve);if(!ds(Ee,Be))return!1;for(const Pt of mt)if(!ws(Pt,nt))return!1}if(he.type==="MultiPolygon"){const nt=wo(he.coordinates,Be,Ve),mt=wl(K.geometry(),Ee,Be,Ve);if(!ds(Ee,Be))return!1;for(const Pt of mt)if(!Ks(Pt,nt))return!1}return!0}(D,this.geometries);if(D.geometryType()==="LineString")return function(K,he){const Ee=[1/0,1/0,-1/0,-1/0],Be=[1/0,1/0,-1/0,-1/0],Ve=K.canonicalID();if(he.type==="Polygon"){const nt=zo(he.coordinates,Be,Ve),mt=$l(K.geometry(),Ee,Be,Ve);if(!ds(Ee,Be))return!1;for(const Pt of mt)if(!Rn(Pt,nt))return!1}if(he.type==="MultiPolygon"){const nt=wo(he.coordinates,Be,Ve),mt=$l(K.geometry(),Ee,Be,Ve);if(!ds(Ee,Be))return!1;for(const Pt of mt)if(!fo(Pt,nt))return!1}return!0}(D,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Ql=class{constructor(H=[],D=(K,he)=>Khe?1:0){if(this.data=H,this.length=this.data.length,this.compare=D,this.length>0)for(let K=(this.length>>1)-1;K>=0;K--)this._down(K)}push(H){this.data.push(H),this._up(this.length++)}pop(){if(this.length===0)return;const H=this.data[0],D=this.data.pop();return--this.length>0&&(this.data[0]=D,this._down(0)),H}peek(){return this.data[0]}_up(H){const{data:D,compare:K}=this,he=D[H];for(;H>0;){const Ee=H-1>>1,Be=D[Ee];if(K(he,Be)>=0)break;D[H]=Be,H=Ee}D[H]=he}_down(H){const{data:D,compare:K}=this,he=this.length>>1,Ee=D[H];for(;H=0)break;D[H]=D[Be],H=Be}D[H]=Ee}};function Ws(H,D,K,he,Ee){Is(H,D,K,he||H.length-1,Ee||Xu)}function Is(H,D,K,he,Ee){for(;he>K;){if(he-K>600){var Be=he-K+1,Ve=D-K+1,nt=Math.log(Be),mt=.5*Math.exp(2*nt/3),Pt=.5*Math.sqrt(nt*mt*(Be-mt)/Be)*(Ve-Be/2<0?-1:1);Is(H,D,Math.max(K,Math.floor(D-Ve*mt/Be+Pt)),Math.min(he,Math.floor(D+(Be-Ve)*mt/Be+Pt)),Ee)}var Xt=H[D],er=K,br=he;for(Dl(H,K,D),Ee(H[he],Xt)>0&&Dl(H,K,he);er0;)br--}Ee(H[K],Xt)===0?Dl(H,K,br):Dl(H,++br,he),br<=D&&(K=br+1),D<=br&&(he=br-1)}}function Dl(H,D,K){var he=H[D];H[D]=H[K],H[K]=he}function Xu(H,D){return HD?1:0}function Lu(H,D){if(H.length<=1)return[H];const K=[];let he,Ee;for(const Be of H){const Ve=kf(Be);Ve!==0&&(Be.area=Math.abs(Ve),Ee===void 0&&(Ee=Ve<0),Ee===Ve<0?(he&&K.push(he),he=[Be]):he.push(Be))}if(he&&K.push(he),D>1)for(let Be=0;Be1?(Pt=D[mt+1][0],Xt=D[mt+1][1]):Rr>0&&(Pt+=er/this.kx*Rr,Xt+=br/this.ky*Rr)),er=this.wrap(K[0]-Pt)*this.kx,br=(K[1]-Xt)*this.ky;const jr=er*er+br*br;jr180;)D-=360;return D}}function ml(H,D){return D[0]-H[0]}function fl(H){return H[1]-H[0]+1}function _l(H,D){return H[1]>=H[0]&&H[1]H[1])return[null,null];const K=fl(H);if(D){if(K===2)return[H,null];const Ee=Math.floor(K/2);return[[H[0],H[0]+Ee],[H[0]+Ee,H[1]]]}if(K===1)return[H,null];const he=Math.floor(K/2)-1;return[[H[0],H[0]+he],[H[0]+he+1,H[1]]]}function Ts(H,D){if(!_l(D,H.length))return[1/0,1/0,-1/0,-1/0];const K=[1/0,1/0,-1/0,-1/0];for(let he=D[0];he<=D[1];++he)Os(K,H[he]);return K}function Tl(H){const D=[1/0,1/0,-1/0,-1/0];for(const K of H)for(const he of K)Os(D,he);return D}function Ko(H){return H[0]!==-1/0&&H[1]!==-1/0&&H[2]!==1/0&&H[3]!==1/0}function Cs(H,D,K){if(!Ko(H)||!Ko(D))return NaN;let he=0,Ee=0;return H[2]D[2]&&(he=H[0]-D[2]),H[1]>D[3]&&(Ee=H[1]-D[3]),H[3]=he)return he;if(ds(Ee,Be)){if(Wf(H,D))return 0}else if(Wf(D,H))return 0;let Ve=1/0;for(const nt of H)for(let mt=0,Pt=nt.length,Xt=Pt-1;mt0;){const mt=Ve.pop();if(mt[0]>=Be)continue;const Pt=mt[1],Xt=D?50:100;if(fl(Pt)<=Xt){if(!_l(Pt,H.length))return NaN;if(D){const er=Eo(H,Pt,K,he);if(isNaN(er)||er===0)return er;Be=Math.min(Be,er)}else for(let er=Pt[0];er<=Pt[1];++er){const br=Gf(H[er],K,he);if(Be=Math.min(Be,br),Be===0)return 0}}else{const er=Yu(Pt,D);oo(Ve,Be,he,H,nt,er[0]),oo(Ve,Be,he,H,nt,er[1])}}return Be}function zl(H,D,K,he,Ee,Be=1/0){let Ve=Math.min(Be,Ee.distance(H[0],K[0]));if(Ve===0)return Ve;const nt=new Ql([[0,[0,H.length-1],[0,K.length-1]]],ml);for(;nt.length>0;){const mt=nt.pop();if(mt[0]>=Ve)continue;const Pt=mt[1],Xt=mt[2],er=D?50:100,br=he?50:100;if(fl(Pt)<=er&&fl(Xt)<=br){if(!_l(Pt,H.length)&&_l(Xt,K.length))return NaN;let Rr;if(D&&he)Rr=Ku(H,Pt,K,Xt,Ee),Ve=Math.min(Ve,Rr);else if(D&&!he){const jr=H.slice(Pt[0],Pt[1]+1);for(let Yr=Xt[0];Yr<=Xt[1];++Yr)if(Rr=Nu(K[Yr],jr,Ee),Ve=Math.min(Ve,Rr),Ve===0)return Ve}else if(!D&&he){const jr=K.slice(Xt[0],Xt[1]+1);for(let Yr=Pt[0];Yr<=Pt[1];++Yr)if(Rr=Nu(H[Yr],jr,Ee),Ve=Math.min(Ve,Rr),Ve===0)return Ve}else Rr=Bs(H,Pt,K,Xt,Ee),Ve=Math.min(Ve,Rr)}else{const Rr=Yu(Pt,D),jr=Yu(Xt,he);pc(nt,Ve,Ee,H,K,Rr[0],jr[0]),pc(nt,Ve,Ee,H,K,Rr[0],jr[1]),pc(nt,Ve,Ee,H,K,Rr[1],jr[0]),pc(nt,Ve,Ee,H,K,Rr[1],jr[1])}}return Ve}function Kc(H){return H.type==="MultiPolygon"?H.coordinates.map(D=>({type:"Polygon",coordinates:D})):H.type==="MultiLineString"?H.coordinates.map(D=>({type:"LineString",coordinates:D})):H.type==="MultiPoint"?H.coordinates.map(D=>({type:"Point",coordinates:D})):[H]}class Ju{constructor(D,K){this.type=Je,this.geojson=D,this.geometries=K}static parse(D,K){if(D.length!==2)return K.error(`'distance' expression requires exactly one argument, but found ${D.length-1} instead.`);if(Oa(D[1])){const he=D[1];if(he.type==="FeatureCollection")return new Ju(he,he.features.map(Ee=>Kc(Ee.geometry)).flat());if(he.type==="Feature")return new Ju(he,Kc(he.geometry));if("type"in he&&"coordinates"in he)return new Ju(he,Kc(he))}return K.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return function(K,he){const Ee=K.geometry(),Be=Ee.flat().map(mt=>Jn([mt.x,mt.y],K.canonical));if(Ee.length===0)return NaN;const Ve=new Nc(Be[0][1]);let nt=1/0;for(const mt of he){switch(mt.type){case"Point":nt=Math.min(nt,zl(Be,!1,[mt.coordinates],!1,Ve,nt));break;case"LineString":nt=Math.min(nt,zl(Be,!1,mt.coordinates,!0,Ve,nt));break;case"Polygon":nt=Math.min(nt,xu(Be,!1,mt.coordinates,Ve,nt))}if(nt===0)return nt}return nt}(D,this.geometries);if(D.geometryType()==="LineString")return function(K,he){const Ee=K.geometry(),Be=Ee.flat().map(mt=>Jn([mt.x,mt.y],K.canonical));if(Ee.length===0)return NaN;const Ve=new Nc(Be[0][1]);let nt=1/0;for(const mt of he){switch(mt.type){case"Point":nt=Math.min(nt,zl(Be,!0,[mt.coordinates],!1,Ve,nt));break;case"LineString":nt=Math.min(nt,zl(Be,!0,mt.coordinates,!0,Ve,nt));break;case"Polygon":nt=Math.min(nt,xu(Be,!0,mt.coordinates,Ve,nt))}if(nt===0)return nt}return nt}(D,this.geometries);if(D.geometryType()==="Polygon")return function(K,he){const Ee=K.geometry();if(Ee.length===0||Ee[0].length===0)return NaN;const Be=Lu(Ee,0).map(mt=>mt.map(Pt=>Pt.map(Xt=>Jn([Xt.x,Xt.y],K.canonical)))),Ve=new Nc(Be[0][0][0][1]);let nt=1/0;for(const mt of he)for(const Pt of Be){switch(mt.type){case"Point":nt=Math.min(nt,xu([mt.coordinates],!1,Pt,Ve,nt));break;case"LineString":nt=Math.min(nt,xu(mt.coordinates,!0,Pt,Ve,nt));break;case"Polygon":nt=Math.min(nt,is(Pt,mt.coordinates,Ve,nt))}if(nt===0)return nt}return nt}(D,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const gc={"==":li,"!=":Ii,">":Ao,"<":xi,">=":Ro,"<=":So,array:yr,at:Qt,boolean:yr,case:Sa,coalesce:mi,collator:Li,format:bs,image:as,in:mr,"index-of":$r,interpolate:ci,"interpolate-hcl":ci,"interpolate-lab":ci,length:fs,let:Jr,literal:Lr,match:oa,number:yr,"number-format":Yi,object:yr,slice:ya,step:pa,string:yr,"to-boolean":zr,"to-color":zr,"to-number":zr,"to-string":zr,var:wt,within:Js,distance:Ju};class hl{constructor(D,K,he,Ee){this.name=D,this.type=K,this._evaluate=he,this.args=Ee}evaluate(D){return this._evaluate(D,this.args)}eachChild(D){this.args.forEach(D)}outputDefined(){return!1}static parse(D,K){const he=D[0],Ee=hl.definitions[he];if(!Ee)return K.error(`Unknown expression "${he}". If you wanted a literal array, use ["literal", [...]].`,0);const Be=Array.isArray(Ee)?Ee[0]:Ee.type,Ve=Array.isArray(Ee)?[[Ee[1],Ee[2]]]:Ee.overloads,nt=Ve.filter(([Pt])=>!Array.isArray(Pt)||Pt.length===D.length-1);let mt=null;for(const[Pt,Xt]of nt){mt=new Zr(K.registry,jc,K.path,null,K.scope);const er=[];let br=!1;for(let Rr=1;Rr{return br=er,Array.isArray(br)?`(${br.map(Ge).join(", ")})`:`(${Ge(br.type)}...)`;var br}).join(" | "),Xt=[];for(let er=1;er{K=D?K&&jc(he):K&&he instanceof Lr}),!!K&&$c(H)&&Qc(H,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function $c(H){if(H instanceof hl&&(H.name==="get"&&H.args.length===1||H.name==="feature-state"||H.name==="has"&&H.args.length===1||H.name==="properties"||H.name==="geometry-type"||H.name==="id"||/^filter-/.test(H.name))||H instanceof Js||H instanceof Ju)return!1;let D=!0;return H.eachChild(K=>{D&&!$c(K)&&(D=!1)}),D}function bu(H){if(H instanceof hl&&H.name==="feature-state")return!1;let D=!0;return H.eachChild(K=>{D&&!bu(K)&&(D=!1)}),D}function Qc(H,D){if(H instanceof hl&&D.indexOf(H.name)>=0)return!1;let K=!0;return H.eachChild(he=>{K&&!Qc(he,D)&&(K=!1)}),K}function sc(H){return{result:"success",value:H}}function wu(H){return{result:"error",value:H}}function eu(H){return H["property-type"]==="data-driven"||H["property-type"]==="cross-faded-data-driven"}function Sc(H){return!!H.expression&&H.expression.parameters.indexOf("zoom")>-1}function ef(H){return!!H.expression&&H.expression.interpolated}function ps(H){return H instanceof Number?"number":H instanceof String?"string":H instanceof Boolean?"boolean":Array.isArray(H)?"array":H===null?"null":typeof H}function Vc(H){return typeof H=="object"&&H!==null&&!Array.isArray(H)}function Zf(H){return H}function mf(H,D){const K=D.type==="color",he=H.stops&&typeof H.stops[0][0]=="object",Ee=he||!(he||H.property!==void 0),Be=H.type||(ef(D)?"exponential":"interval");if(K||D.type==="padding"){const Xt=K?Ot.parse:Ur.parse;(H=ce({},H)).stops&&(H.stops=H.stops.map(er=>[er[0],Xt(er[1])])),H.default=Xt(H.default?H.default:D.default)}if(H.colorSpace&&(Ve=H.colorSpace)!=="rgb"&&Ve!=="hcl"&&Ve!=="lab")throw new Error(`Unknown color space: "${H.colorSpace}"`);var Ve;let nt,mt,Pt;if(Be==="exponential")nt=xf;else if(Be==="interval")nt=tu;else if(Be==="categorical"){nt=_f,mt=Object.create(null);for(const Xt of H.stops)mt[Xt[0]]=Xt[1];Pt=typeof H.stops[0][0]}else{if(Be!=="identity")throw new Error(`Unknown function type "${Be}"`);nt=Fl}if(he){const Xt={},er=[];for(let jr=0;jrjr[0]),evaluate:({zoom:jr},Yr)=>xf({stops:br,base:H.base},D,jr).evaluate(jr,Yr)}}if(Ee){const Xt=Be==="exponential"?{name:"exponential",base:H.base!==void 0?H.base:1}:null;return{kind:"camera",interpolationType:Xt,interpolationFactor:ci.interpolationFactor.bind(void 0,Xt),zoomStops:H.stops.map(er=>er[0]),evaluate:({zoom:er})=>nt(H,D,er,mt,Pt)}}return{kind:"source",evaluate(Xt,er){const br=er&&er.properties?er.properties[H.property]:void 0;return br===void 0?Mc(H.default,D.default):nt(H,D,br,mt,Pt)}}}function Mc(H,D,K){return H!==void 0?H:D!==void 0?D:K!==void 0?K:void 0}function _f(H,D,K,he,Ee){return Mc(typeof K===Ee?he[K]:void 0,H.default,D.default)}function tu(H,D,K){if(ps(K)!=="number")return Mc(H.default,D.default);const he=H.stops.length;if(he===1||K<=H.stops[0][0])return H.stops[0][1];if(K>=H.stops[he-1][0])return H.stops[he-1][1];const Ee=ra(H.stops.map(Be=>Be[0]),K);return H.stops[Ee][1]}function xf(H,D,K){const he=H.base!==void 0?H.base:1;if(ps(K)!=="number")return Mc(H.default,D.default);const Ee=H.stops.length;if(Ee===1||K<=H.stops[0][0])return H.stops[0][1];if(K>=H.stops[Ee-1][0])return H.stops[Ee-1][1];const Be=ra(H.stops.map(Xt=>Xt[0]),K),Ve=function(Xt,er,br,Rr){const jr=Rr-br,Yr=Xt-br;return jr===0?0:er===1?Yr/jr:(Math.pow(er,Yr)-1)/(Math.pow(er,jr)-1)}(K,he,H.stops[Be][0],H.stops[Be+1][0]),nt=H.stops[Be][1],mt=H.stops[Be+1][1],Pt=Ci[D.type]||Zf;return typeof nt.evaluate=="function"?{evaluate(...Xt){const er=nt.evaluate.apply(void 0,Xt),br=mt.evaluate.apply(void 0,Xt);if(er!==void 0&&br!==void 0)return Pt(er,br,Ve,H.colorSpace)}}:Pt(nt,mt,Ve,H.colorSpace)}function Fl(H,D,K){switch(D.type){case"color":K=Ot.parse(K);break;case"formatted":K=na.fromString(K.toString());break;case"resolvedImage":K=Pa.fromString(K.toString());break;case"padding":K=Ur.parse(K);break;default:ps(K)===D.type||D.type==="enum"&&D.values[K]||(K=void 0)}return Mc(K,H.default,D.default)}hl.register(gc,{error:[{kind:"error"},[At],(H,[D])=>{throw new Er(D.evaluate(H))}],typeof:[At,[ir],(H,[D])=>Ge(dt(D.evaluate(H)))],"to-rgba":[ze(Je,4),[Rt],(H,[D])=>{const[K,he,Ee,Be]=D.evaluate(H).rgb;return[255*K,255*he,255*Ee,Be]}],rgb:[Rt,[Je,Je,Je],yf],rgba:[Rt,[Je,Je,Je,Je],yf],has:{type:St,overloads:[[[At],(H,[D])=>Jc(D.evaluate(H),H.properties())],[[At,Ut],(H,[D,K])=>Jc(D.evaluate(H),K.evaluate(H))]]},get:{type:ir,overloads:[[[At],(H,[D])=>Uc(D.evaluate(H),H.properties())],[[At,Ut],(H,[D,K])=>Uc(D.evaluate(H),K.evaluate(H))]]},"feature-state":[ir,[At],(H,[D])=>Uc(D.evaluate(H),H.featureState||{})],properties:[Ut,[],H=>H.properties()],"geometry-type":[At,[],H=>H.geometryType()],id:[ir,[],H=>H.id()],zoom:[Je,[],H=>H.globals.zoom],"heatmap-density":[Je,[],H=>H.globals.heatmapDensity||0],"line-progress":[Je,[],H=>H.globals.lineProgress||0],accumulated:[ir,[],H=>H.globals.accumulated===void 0?null:H.globals.accumulated],"+":[Je,$u(Je),(H,D)=>{let K=0;for(const he of D)K+=he.evaluate(H);return K}],"*":[Je,$u(Je),(H,D)=>{let K=1;for(const he of D)K*=he.evaluate(H);return K}],"-":{type:Je,overloads:[[[Je,Je],(H,[D,K])=>D.evaluate(H)-K.evaluate(H)],[[Je],(H,[D])=>-D.evaluate(H)]]},"/":[Je,[Je,Je],(H,[D,K])=>D.evaluate(H)/K.evaluate(H)],"%":[Je,[Je,Je],(H,[D,K])=>D.evaluate(H)%K.evaluate(H)],ln2:[Je,[],()=>Math.LN2],pi:[Je,[],()=>Math.PI],e:[Je,[],()=>Math.E],"^":[Je,[Je,Je],(H,[D,K])=>Math.pow(D.evaluate(H),K.evaluate(H))],sqrt:[Je,[Je],(H,[D])=>Math.sqrt(D.evaluate(H))],log10:[Je,[Je],(H,[D])=>Math.log(D.evaluate(H))/Math.LN10],ln:[Je,[Je],(H,[D])=>Math.log(D.evaluate(H))],log2:[Je,[Je],(H,[D])=>Math.log(D.evaluate(H))/Math.LN2],sin:[Je,[Je],(H,[D])=>Math.sin(D.evaluate(H))],cos:[Je,[Je],(H,[D])=>Math.cos(D.evaluate(H))],tan:[Je,[Je],(H,[D])=>Math.tan(D.evaluate(H))],asin:[Je,[Je],(H,[D])=>Math.asin(D.evaluate(H))],acos:[Je,[Je],(H,[D])=>Math.acos(D.evaluate(H))],atan:[Je,[Je],(H,[D])=>Math.atan(D.evaluate(H))],min:[Je,$u(Je),(H,D)=>Math.min(...D.map(K=>K.evaluate(H)))],max:[Je,$u(Je),(H,D)=>Math.max(...D.map(K=>K.evaluate(H)))],abs:[Je,[Je],(H,[D])=>Math.abs(D.evaluate(H))],round:[Je,[Je],(H,[D])=>{const K=D.evaluate(H);return K<0?-Math.round(-K):Math.round(K)}],floor:[Je,[Je],(H,[D])=>Math.floor(D.evaluate(H))],ceil:[Je,[Je],(H,[D])=>Math.ceil(D.evaluate(H))],"filter-==":[St,[At,ir],(H,[D,K])=>H.properties()[D.value]===K.value],"filter-id-==":[St,[ir],(H,[D])=>H.id()===D.value],"filter-type-==":[St,[At],(H,[D])=>H.geometryType()===D.value],"filter-<":[St,[At,ir],(H,[D,K])=>{const he=H.properties()[D.value],Ee=K.value;return typeof he==typeof Ee&&he{const K=H.id(),he=D.value;return typeof K==typeof he&&K":[St,[At,ir],(H,[D,K])=>{const he=H.properties()[D.value],Ee=K.value;return typeof he==typeof Ee&&he>Ee}],"filter-id->":[St,[ir],(H,[D])=>{const K=H.id(),he=D.value;return typeof K==typeof he&&K>he}],"filter-<=":[St,[At,ir],(H,[D,K])=>{const he=H.properties()[D.value],Ee=K.value;return typeof he==typeof Ee&&he<=Ee}],"filter-id-<=":[St,[ir],(H,[D])=>{const K=H.id(),he=D.value;return typeof K==typeof he&&K<=he}],"filter->=":[St,[At,ir],(H,[D,K])=>{const he=H.properties()[D.value],Ee=K.value;return typeof he==typeof Ee&&he>=Ee}],"filter-id->=":[St,[ir],(H,[D])=>{const K=H.id(),he=D.value;return typeof K==typeof he&&K>=he}],"filter-has":[St,[ir],(H,[D])=>D.value in H.properties()],"filter-has-id":[St,[],H=>H.id()!==null&&H.id()!==void 0],"filter-type-in":[St,[ze(At)],(H,[D])=>D.value.indexOf(H.geometryType())>=0],"filter-id-in":[St,[ze(ir)],(H,[D])=>D.value.indexOf(H.id())>=0],"filter-in-small":[St,[At,ze(ir)],(H,[D,K])=>K.value.indexOf(H.properties()[D.value])>=0],"filter-in-large":[St,[At,ze(ir)],(H,[D,K])=>function(he,Ee,Be,Ve){for(;Be<=Ve;){const nt=Be+Ve>>1;if(Ee[nt]===he)return!0;Ee[nt]>he?Ve=nt-1:Be=nt+1}return!1}(H.properties()[D.value],K.value,0,K.value.length-1)],all:{type:St,overloads:[[[St,St],(H,[D,K])=>D.evaluate(H)&&K.evaluate(H)],[$u(St),(H,D)=>{for(const K of D)if(!K.evaluate(H))return!1;return!0}]]},any:{type:St,overloads:[[[St,St],(H,[D,K])=>D.evaluate(H)||K.evaluate(H)],[$u(St),(H,D)=>{for(const K of D)if(K.evaluate(H))return!0;return!1}]]},"!":[St,[St],(H,[D])=>!D.evaluate(H)],"is-supported-script":[St,[At],(H,[D])=>{const K=H.globals&&H.globals.isSupportedScript;return!K||K(D.evaluate(H))}],upcase:[At,[At],(H,[D])=>D.evaluate(H).toUpperCase()],downcase:[At,[At],(H,[D])=>D.evaluate(H).toLowerCase()],concat:[At,$u(ir),(H,D)=>D.map(K=>vt(K.evaluate(H))).join("")],"resolved-locale":[At,[ar],(H,[D])=>D.evaluate(H).resolvedLocale()]});class ru{constructor(D,K){var he;this.expression=D,this._warningHistory={},this._evaluator=new Hr,this._defaultValue=K?(he=K).type==="color"&&Vc(he.default)?new Ot(0,0,0,0):he.type==="color"?Ot.parse(he.default)||null:he.type==="padding"?Ur.parse(he.default)||null:he.type==="variableAnchorOffsetCollection"?Aa.parse(he.default)||null:he.default===void 0?null:he.default:null,this._enumValues=K&&K.type==="enum"?K.values:null}evaluateWithoutErrorHandling(D,K,he,Ee,Be,Ve){return this._evaluator.globals=D,this._evaluator.feature=K,this._evaluator.featureState=he,this._evaluator.canonical=Ee,this._evaluator.availableImages=Be||null,this._evaluator.formattedSection=Ve,this.expression.evaluate(this._evaluator)}evaluate(D,K,he,Ee,Be,Ve){this._evaluator.globals=D,this._evaluator.feature=K||null,this._evaluator.featureState=he||null,this._evaluator.canonical=Ee,this._evaluator.availableImages=Be||null,this._evaluator.formattedSection=Ve||null;try{const nt=this.expression.evaluate(this._evaluator);if(nt==null||typeof nt=="number"&&nt!=nt)return this._defaultValue;if(this._enumValues&&!(nt in this._enumValues))throw new Er(`Expected value to be one of ${Object.keys(this._enumValues).map(mt=>JSON.stringify(mt)).join(", ")}, but found ${JSON.stringify(nt)} instead.`);return nt}catch(nt){return this._warningHistory[nt.message]||(this._warningHistory[nt.message]=!0,typeof console<"u"&&console.warn(nt.message)),this._defaultValue}}}function Uu(H){return Array.isArray(H)&&H.length>0&&typeof H[0]=="string"&&H[0]in gc}function $s(H,D){const K=new Zr(gc,jc,[],D?function(Ee){const Be={color:Rt,string:At,number:Je,enum:At,boolean:St,formatted:Mr,padding:fr,resolvedImage:dr,variableAnchorOffsetCollection:pt};return Ee.type==="array"?ze(Be[Ee.value]||ir,Ee.length):Be[Ee.type]}(D):void 0),he=K.parse(H,void 0,void 0,void 0,D&&D.type==="string"?{typeAnnotation:"coerce"}:void 0);return he?sc(new ru(he,D)):wu(K.errors)}class Qu{constructor(D,K){this.kind=D,this._styleExpression=K,this.isStateDependent=D!=="constant"&&!bu(K.expression)}evaluateWithoutErrorHandling(D,K,he,Ee,Be,Ve){return this._styleExpression.evaluateWithoutErrorHandling(D,K,he,Ee,Be,Ve)}evaluate(D,K,he,Ee,Be,Ve){return this._styleExpression.evaluate(D,K,he,Ee,Be,Ve)}}class Tu{constructor(D,K,he,Ee){this.kind=D,this.zoomStops=he,this._styleExpression=K,this.isStateDependent=D!=="camera"&&!bu(K.expression),this.interpolationType=Ee}evaluateWithoutErrorHandling(D,K,he,Ee,Be,Ve){return this._styleExpression.evaluateWithoutErrorHandling(D,K,he,Ee,Be,Ve)}evaluate(D,K,he,Ee,Be,Ve){return this._styleExpression.evaluate(D,K,he,Ee,Be,Ve)}interpolationFactor(D,K,he){return this.interpolationType?ci.interpolationFactor(this.interpolationType,D,K,he):0}}function au(H,D){const K=$s(H,D);if(K.result==="error")return K;const he=K.value.expression,Ee=$c(he);if(!Ee&&!eu(D))return wu([new Re("","data expressions not supported")]);const Be=Qc(he,["zoom"]);if(!Be&&!Sc(D))return wu([new Re("","zoom expressions not supported")]);const Ve=yc(he);return Ve||Be?Ve instanceof Re?wu([Ve]):Ve instanceof ci&&!ef(D)?wu([new Re("",'"interpolate" expressions cannot be used with this property')]):sc(Ve?new Tu(Ee?"camera":"composite",K.value,Ve.labels,Ve instanceof ci?Ve.interpolation:void 0):new Qu(Ee?"constant":"source",K.value)):wu([new Re("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ns{constructor(D,K){this._parameters=D,this._specification=K,ce(this,mf(this._parameters,this._specification))}static deserialize(D){return new Ns(D._parameters,D._specification)}static serialize(D){return{_parameters:D._parameters,_specification:D._specification}}}function yc(H){let D=null;if(H instanceof Jr)D=yc(H.result);else if(H instanceof mi){for(const K of H.args)if(D=yc(K),D)break}else(H instanceof pa||H instanceof ci)&&H.input instanceof hl&&H.input.name==="zoom"&&(D=H);return D instanceof Re||H.eachChild(K=>{const he=yc(K);he instanceof Re?D=he:!D&&he?D=new Re("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):D&&he&&D!==he&&(D=new Re("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),D}function Pu(H){if(H===!0||H===!1)return!0;if(!Array.isArray(H)||H.length===0)return!1;switch(H[0]){case"has":return H.length>=2&&H[1]!=="$id"&&H[1]!=="$type";case"in":return H.length>=3&&(typeof H[1]!="string"||Array.isArray(H[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return H.length!==3||Array.isArray(H[1])||Array.isArray(H[2]);case"any":case"all":for(const D of H.slice(1))if(!Pu(D)&&typeof D!="boolean")return!1;return!0;default:return!0}}const ec={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ec(H){if(H==null)return{filter:()=>!0,needGeometry:!1};Pu(H)||(H=lc(H));const D=$s(H,ec);if(D.result==="error")throw new Error(D.value.map(K=>`${K.key}: ${K.message}`).join(", "));return{filter:(K,he,Ee)=>D.value.evaluate(K,he,{},Ee),needGeometry:nh(H)}}function Cf(H,D){return HD?1:0}function nh(H){if(!Array.isArray(H))return!1;if(H[0]==="within"||H[0]==="distance")return!0;for(let D=1;D"||D==="<="||D===">="?kc(H[1],H[2],D):D==="any"?(K=H.slice(1),["any"].concat(K.map(lc))):D==="all"?["all"].concat(H.slice(1).map(lc)):D==="none"?["all"].concat(H.slice(1).map(lc).map(Cl)):D==="in"?nu(H[1],H.slice(2)):D==="!in"?Cl(nu(H[1],H.slice(2))):D==="has"?tf(H[1]):D!=="!has"||Cl(tf(H[1]));var K}function kc(H,D,K){switch(H){case"$type":return[`filter-type-${K}`,D];case"$id":return[`filter-id-${K}`,D];default:return[`filter-${K}`,H,D]}}function nu(H,D){if(D.length===0)return!1;switch(H){case"$type":return["filter-type-in",["literal",D]];case"$id":return["filter-id-in",["literal",D]];default:return D.length>200&&!D.some(K=>typeof K!=typeof D[0])?["filter-in-large",H,["literal",D.sort(Cf)]]:["filter-in-small",H,["literal",D]]}}function tf(H){switch(H){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",H]}}function Cl(H){return["!",H]}function uc(H){const D=typeof H;if(D==="number"||D==="boolean"||D==="string"||H==null)return JSON.stringify(H);if(Array.isArray(H)){let Ee="[";for(const Be of H)Ee+=`${uc(Be)},`;return`${Ee}]`}const K=Object.keys(H).sort();let he="{";for(let Ee=0;Eehe.maximum?[new xe(D,K,`${K} is greater than the maximum value ${he.maximum}`)]:[]}function _c(H){const D=H.valueSpec,K=Us(H.value.type);let he,Ee,Be,Ve={};const nt=K!=="categorical"&&H.value.property===void 0,mt=!nt,Pt=ps(H.value.stops)==="array"&&ps(H.value.stops[0])==="array"&&ps(H.value.stops[0][0])==="object",Xt=du({key:H.key,value:H.value,valueSpec:H.styleSpec.function,validateSpec:H.validateSpec,style:H.style,styleSpec:H.styleSpec,objectElementValidators:{stops:function(Rr){if(K==="identity")return[new xe(Rr.key,Rr.value,'identity function may not have a "stops" property')];let jr=[];const Yr=Rr.value;return jr=jr.concat(af({key:Rr.key,value:Yr,valueSpec:Rr.valueSpec,validateSpec:Rr.validateSpec,style:Rr.style,styleSpec:Rr.styleSpec,arrayElementValidator:er})),ps(Yr)==="array"&&Yr.length===0&&jr.push(new xe(Rr.key,Yr,"array must have at least one stop")),jr},default:function(Rr){return Rr.validateSpec({key:Rr.key,value:Rr.value,valueSpec:D,validateSpec:Rr.validateSpec,style:Rr.style,styleSpec:Rr.styleSpec})}}});return K==="identity"&&nt&&Xt.push(new xe(H.key,H.value,'missing required property "property"')),K==="identity"||H.value.stops||Xt.push(new xe(H.key,H.value,'missing required property "stops"')),K==="exponential"&&H.valueSpec.expression&&!ef(H.valueSpec)&&Xt.push(new xe(H.key,H.value,"exponential functions not supported")),H.styleSpec.$version>=8&&(mt&&!eu(H.valueSpec)?Xt.push(new xe(H.key,H.value,"property functions not supported")):nt&&!Sc(H.valueSpec)&&Xt.push(new xe(H.key,H.value,"zoom functions not supported"))),K!=="categorical"&&!Pt||H.value.property!==void 0||Xt.push(new xe(H.key,H.value,'"property" property is required')),Xt;function er(Rr){let jr=[];const Yr=Rr.value,ca=Rr.key;if(ps(Yr)!=="array")return[new xe(ca,Yr,`array expected, ${ps(Yr)} found`)];if(Yr.length!==2)return[new xe(ca,Yr,`array length 2 expected, length ${Yr.length} found`)];if(Pt){if(ps(Yr[0])!=="object")return[new xe(ca,Yr,`object expected, ${ps(Yr[0])} found`)];if(Yr[0].zoom===void 0)return[new xe(ca,Yr,"object stop key must have zoom")];if(Yr[0].value===void 0)return[new xe(ca,Yr,"object stop key must have value")];if(Be&&Be>Us(Yr[0].zoom))return[new xe(ca,Yr[0].zoom,"stop zoom values must appear in ascending order")];Us(Yr[0].zoom)!==Be&&(Be=Us(Yr[0].zoom),Ee=void 0,Ve={}),jr=jr.concat(du({key:`${ca}[0]`,value:Yr[0],valueSpec:{zoom:{}},validateSpec:Rr.validateSpec,style:Rr.style,styleSpec:Rr.styleSpec,objectElementValidators:{zoom:Rs,value:br}}))}else jr=jr.concat(br({key:`${ca}[0]`,value:Yr[0],valueSpec:{},validateSpec:Rr.validateSpec,style:Rr.style,styleSpec:Rr.styleSpec},Yr));return Uu(vu(Yr[1]))?jr.concat([new xe(`${ca}[1]`,Yr[1],"expressions are not allowed in function stops.")]):jr.concat(Rr.validateSpec({key:`${ca}[1]`,value:Yr[1],valueSpec:D,validateSpec:Rr.validateSpec,style:Rr.style,styleSpec:Rr.styleSpec}))}function br(Rr,jr){const Yr=ps(Rr.value),ca=Us(Rr.value),Ca=Rr.value!==null?Rr.value:jr;if(he){if(Yr!==he)return[new xe(Rr.key,Ca,`${Yr} stop domain type must match previous stop domain type ${he}`)]}else he=Yr;if(Yr!=="number"&&Yr!=="string"&&Yr!=="boolean")return[new xe(Rr.key,Ca,"stop domain value must be a number, string, or boolean")];if(Yr!=="number"&&K!=="categorical"){let un=`number expected, ${Yr} found`;return eu(D)&&K===void 0&&(un+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new xe(Rr.key,Ca,un)]}return K!=="categorical"||Yr!=="number"||isFinite(ca)&&Math.floor(ca)===ca?K!=="categorical"&&Yr==="number"&&Ee!==void 0&&canew xe(`${H.key}${he.key}`,H.value,he.message));const K=D.value.expression||D.value._styleExpression.expression;if(H.expressionContext==="property"&&H.propertyKey==="text-font"&&!K.outputDefined())return[new xe(H.key,H.value,`Invalid data expression for "${H.propertyKey}". Output values must be contained as literals within the expression.`)];if(H.expressionContext==="property"&&H.propertyType==="layout"&&!bu(K))return[new xe(H.key,H.value,'"feature-state" data expressions are not supported with layout properties.')];if(H.expressionContext==="filter"&&!bu(K))return[new xe(H.key,H.value,'"feature-state" data expressions are not supported with filters.')];if(H.expressionContext&&H.expressionContext.indexOf("cluster")===0){if(!Qc(K,["zoom","feature-state"]))return[new xe(H.key,H.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(H.expressionContext==="cluster-initial"&&!$c(K))return[new xe(H.key,H.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function iu(H){const D=H.key,K=H.value,he=H.valueSpec,Ee=[];return Array.isArray(he.values)?he.values.indexOf(Us(K))===-1&&Ee.push(new xe(D,K,`expected one of [${he.values.join(", ")}], ${JSON.stringify(K)} found`)):Object.keys(he.values).indexOf(Us(K))===-1&&Ee.push(new xe(D,K,`expected one of [${Object.keys(he.values).join(", ")}], ${JSON.stringify(K)} found`)),Ee}function xc(H){return Pu(vu(H.value))?ju(ce({},H,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Iu(H)}function Iu(H){const D=H.value,K=H.key;if(ps(D)!=="array")return[new xe(K,D,`array expected, ${ps(D)} found`)];const he=H.styleSpec;let Ee,Be=[];if(D.length<1)return[new xe(K,D,"filter array must have at least 1 element")];switch(Be=Be.concat(iu({key:`${K}[0]`,value:D[0],valueSpec:he.filter_operator,style:H.style,styleSpec:H.styleSpec})),Us(D[0])){case"<":case"<=":case">":case">=":D.length>=2&&Us(D[1])==="$type"&&Be.push(new xe(K,D,`"$type" cannot be use with operator "${D[0]}"`));case"==":case"!=":D.length!==3&&Be.push(new xe(K,D,`filter array for operator "${D[0]}" must have 3 elements`));case"in":case"!in":D.length>=2&&(Ee=ps(D[1]),Ee!=="string"&&Be.push(new xe(`${K}[1]`,D[1],`string expected, ${Ee} found`)));for(let Ve=2;Ve{Pt in K&&D.push(new xe(he,K[Pt],`"${Pt}" is prohibited for ref layers`))}),Ee.layers.forEach(Pt=>{Us(Pt.id)===nt&&(mt=Pt)}),mt?mt.ref?D.push(new xe(he,K.ref,"ref cannot reference another ref layer")):Ve=Us(mt.type):D.push(new xe(he,K.ref,`ref layer "${nt}" not found`))}else if(Ve!=="background")if(K.source){const mt=Ee.sources&&Ee.sources[K.source],Pt=mt&&Us(mt.type);mt?Pt==="vector"&&Ve==="raster"?D.push(new xe(he,K.source,`layer "${K.id}" requires a raster source`)):Pt!=="raster-dem"&&Ve==="hillshade"?D.push(new xe(he,K.source,`layer "${K.id}" requires a raster-dem source`)):Pt==="raster"&&Ve!=="raster"?D.push(new xe(he,K.source,`layer "${K.id}" requires a vector source`)):Pt!=="vector"||K["source-layer"]?Pt==="raster-dem"&&Ve!=="hillshade"?D.push(new xe(he,K.source,"raster-dem source can only be used with layer type 'hillshade'.")):Ve!=="line"||!K.paint||!K.paint["line-gradient"]||Pt==="geojson"&&mt.lineMetrics||D.push(new xe(he,K,`layer "${K.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):D.push(new xe(he,K,`layer "${K.id}" must specify a "source-layer"`)):D.push(new xe(he,K.source,`source "${K.source}" not found`))}else D.push(new xe(he,K,'missing required property "source"'));return D=D.concat(du({key:he,value:K,valueSpec:Be.layer,style:H.style,styleSpec:H.styleSpec,validateSpec:H.validateSpec,objectElementValidators:{"*":()=>[],type:()=>H.validateSpec({key:`${he}.type`,value:K.type,valueSpec:Be.layer.type,style:H.style,styleSpec:H.styleSpec,validateSpec:H.validateSpec,object:K,objectKey:"type"}),filter:xc,layout:mt=>du({layer:K,key:mt.key,value:mt.value,style:mt.style,styleSpec:mt.styleSpec,validateSpec:mt.validateSpec,objectElementValidators:{"*":Pt=>xl(ce({layerType:Ve},Pt))}}),paint:mt=>du({layer:K,key:mt.key,value:mt.value,style:mt.style,styleSpec:mt.styleSpec,validateSpec:mt.validateSpec,objectElementValidators:{"*":Pt=>Lf(ce({layerType:Ve},Pt))}})}})),D}function ou(H){const D=H.value,K=H.key,he=ps(D);return he!=="string"?[new xe(K,D,`string expected, ${he} found`)]:[]}const Ru={promoteId:function({key:H,value:D}){if(ps(D)==="string")return ou({key:H,value:D});{const K=[];for(const he in D)K.push(...ou({key:`${H}.${he}`,value:D[he]}));return K}}};function Au(H){const D=H.value,K=H.key,he=H.styleSpec,Ee=H.style,Be=H.validateSpec;if(!D.type)return[new xe(K,D,'"type" is required')];const Ve=Us(D.type);let nt;switch(Ve){case"vector":case"raster":return nt=du({key:K,value:D,valueSpec:he[`source_${Ve.replace("-","_")}`],style:H.style,styleSpec:he,objectElementValidators:Ru,validateSpec:Be}),nt;case"raster-dem":return nt=function(mt){var Pt;const Xt=(Pt=mt.sourceName)!==null&&Pt!==void 0?Pt:"",er=mt.value,br=mt.styleSpec,Rr=br.source_raster_dem,jr=mt.style;let Yr=[];const ca=ps(er);if(er===void 0)return Yr;if(ca!=="object")return Yr.push(new xe("source_raster_dem",er,`object expected, ${ca} found`)),Yr;const Ca=Us(er.encoding)==="custom",un=["redFactor","greenFactor","blueFactor","baseShift"],Ha=mt.value.encoding?`"${mt.value.encoding}"`:"Default";for(const rn in er)!Ca&&un.includes(rn)?Yr.push(new xe(rn,er[rn],`In "${Xt}": "${rn}" is only valid when "encoding" is set to "custom". ${Ha} encoding found`)):Rr[rn]?Yr=Yr.concat(mt.validateSpec({key:rn,value:er[rn],valueSpec:Rr[rn],validateSpec:mt.validateSpec,style:jr,styleSpec:br})):Yr.push(new xe(rn,er[rn],`unknown property "${rn}"`));return Yr}({sourceName:K,value:D,style:H.style,styleSpec:he,validateSpec:Be}),nt;case"geojson":if(nt=du({key:K,value:D,valueSpec:he.source_geojson,style:Ee,styleSpec:he,validateSpec:Be,objectElementValidators:Ru}),D.cluster)for(const mt in D.clusterProperties){const[Pt,Xt]=D.clusterProperties[mt],er=typeof Pt=="string"?[Pt,["accumulated"],["get",mt]]:Pt;nt.push(...ju({key:`${K}.${mt}.map`,value:Xt,validateSpec:Be,expressionContext:"cluster-map"})),nt.push(...ju({key:`${K}.${mt}.reduce`,value:er,validateSpec:Be,expressionContext:"cluster-reduce"}))}return nt;case"video":return du({key:K,value:D,valueSpec:he.source_video,style:Ee,validateSpec:Be,styleSpec:he});case"image":return du({key:K,value:D,valueSpec:he.source_image,style:Ee,validateSpec:Be,styleSpec:he});case"canvas":return[new xe(K,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return iu({key:`${K}.type`,value:D.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:Ee,validateSpec:Be,styleSpec:he})}}function Zs(H){const D=H.value,K=H.styleSpec,he=K.light,Ee=H.style;let Be=[];const Ve=ps(D);if(D===void 0)return Be;if(Ve!=="object")return Be=Be.concat([new xe("light",D,`object expected, ${Ve} found`)]),Be;for(const nt in D){const mt=nt.match(/^(.*)-transition$/);Be=Be.concat(mt&&he[mt[1]]&&he[mt[1]].transition?H.validateSpec({key:nt,value:D[nt],valueSpec:K.transition,validateSpec:H.validateSpec,style:Ee,styleSpec:K}):he[nt]?H.validateSpec({key:nt,value:D[nt],valueSpec:he[nt],validateSpec:H.validateSpec,style:Ee,styleSpec:K}):[new xe(nt,D[nt],`unknown property "${nt}"`)])}return Be}function Ol(H){const D=H.value,K=H.styleSpec,he=K.sky,Ee=H.style,Be=ps(D);if(D===void 0)return[];if(Be!=="object")return[new xe("sky",D,`object expected, ${Be} found`)];let Ve=[];for(const nt in D)Ve=Ve.concat(he[nt]?H.validateSpec({key:nt,value:D[nt],valueSpec:he[nt],style:Ee,styleSpec:K}):[new xe(nt,D[nt],`unknown property "${nt}"`)]);return Ve}function bl(H){const D=H.value,K=H.styleSpec,he=K.terrain,Ee=H.style;let Be=[];const Ve=ps(D);if(D===void 0)return Be;if(Ve!=="object")return Be=Be.concat([new xe("terrain",D,`object expected, ${Ve} found`)]),Be;for(const nt in D)Be=Be.concat(he[nt]?H.validateSpec({key:nt,value:D[nt],valueSpec:he[nt],validateSpec:H.validateSpec,style:Ee,styleSpec:K}):[new xe(nt,D[nt],`unknown property "${nt}"`)]);return Be}function tc(H){let D=[];const K=H.value,he=H.key;if(Array.isArray(K)){const Ee=[],Be=[];for(const Ve in K)K[Ve].id&&Ee.includes(K[Ve].id)&&D.push(new xe(he,K,`all the sprites' ids must be unique, but ${K[Ve].id} is duplicated`)),Ee.push(K[Ve].id),K[Ve].url&&Be.includes(K[Ve].url)&&D.push(new xe(he,K,`all the sprites' URLs must be unique, but ${K[Ve].url} is duplicated`)),Be.push(K[Ve].url),D=D.concat(du({key:`${he}[${Ve}]`,value:K[Ve],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:H.validateSpec}));return D}return ou({key:he,value:K})}const Su={"*":()=>[],array:af,boolean:function(H){const D=H.value,K=H.key,he=ps(D);return he!=="boolean"?[new xe(K,D,`boolean expected, ${he} found`)]:[]},number:Rs,color:function(H){const D=H.key,K=H.value,he=ps(K);return he!=="string"?[new xe(D,K,`color expected, ${he} found`)]:Ot.parse(String(K))?[]:[new xe(D,K,`color expected, "${K}" found`)]},constants:mc,enum:iu,filter:xc,function:_c,layer:nf,object:du,source:Au,light:Zs,sky:Ol,terrain:bl,projection:function(H){const D=H.value,K=H.styleSpec,he=K.projection,Ee=H.style,Be=ps(D);if(D===void 0)return[];if(Be!=="object")return[new xe("projection",D,`object expected, ${Be} found`)];let Ve=[];for(const nt in D)Ve=Ve.concat(he[nt]?H.validateSpec({key:nt,value:D[nt],valueSpec:he[nt],style:Ee,styleSpec:K}):[new xe(nt,D[nt],`unknown property "${nt}"`)]);return Ve},string:ou,formatted:function(H){return ou(H).length===0?[]:ju(H)},resolvedImage:function(H){return ou(H).length===0?[]:ju(H)},padding:function(H){const D=H.key,K=H.value;if(ps(K)==="array"){if(K.length<1||K.length>4)return[new xe(D,K,`padding requires 1 to 4 values; ${K.length} values found`)];const he={type:"number"};let Ee=[];for(let Be=0;Be[]}})),H.constants&&(K=K.concat(mc({key:"constants",value:H.constants,style:H,styleSpec:D,validateSpec:Cc}))),Or(K)}function qr(H){return function(D){return H(av(Sf({},D),{validateSpec:Cc}))}}function Or(H){return[].concat(H).sort((D,K)=>D.line-K.line)}function ua(H){return function(...D){return Or(H.apply(this,D))}}ur.source=ua(qr(Au)),ur.sprite=ua(qr(tc)),ur.glyphs=ua(qr(Ht)),ur.light=ua(qr(Zs)),ur.sky=ua(qr(Ol)),ur.terrain=ua(qr(bl)),ur.layer=ua(qr(nf)),ur.filter=ua(qr(xc)),ur.paintProperty=ua(qr(Lf)),ur.layoutProperty=ua(qr(xl));const Fa=ur,ja=Fa.light,sn=Fa.sky,gn=Fa.paintProperty,kn=Fa.layoutProperty;function Ja(H,D){let K=!1;if(D&&D.length)for(const he of D)H.fire(new q(new Error(he.message))),K=!0;return K}class _n{constructor(D,K,he){const Ee=this.cells=[];if(D instanceof ArrayBuffer){this.arrayBuffer=D;const Ve=new Int32Array(this.arrayBuffer);D=Ve[0],this.d=(K=Ve[1])+2*(he=Ve[2]);for(let mt=0;mt=er[jr+0]&&Ee>=er[jr+1])?(nt[Rr]=!0,Ve.push(Xt[Rr])):nt[Rr]=!1}}}}_forEachCell(D,K,he,Ee,Be,Ve,nt,mt){const Pt=this._convertToCellCoord(D),Xt=this._convertToCellCoord(K),er=this._convertToCellCoord(he),br=this._convertToCellCoord(Ee);for(let Rr=Pt;Rr<=er;Rr++)for(let jr=Xt;jr<=br;jr++){const Yr=this.d*jr+Rr;if((!mt||mt(this._convertFromCellCoord(Rr),this._convertFromCellCoord(jr),this._convertFromCellCoord(Rr+1),this._convertFromCellCoord(jr+1)))&&Be.call(this,D,K,he,Ee,Yr,Ve,nt,mt))return}}_convertFromCellCoord(D){return(D-this.padding)/this.scale}_convertToCellCoord(D){return Math.max(0,Math.min(this.d-1,Math.floor(D*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const D=this.cells,K=3+this.cells.length+1+1;let he=0;for(let Ve=0;Ve=0)continue;const Ve=H[Be];Ee[Be]=on[K].shallow.indexOf(Be)>=0?Ve:ji(Ve,D)}H instanceof Error&&(Ee.message=H.message)}if(Ee.$name)throw new Error("$name property is reserved for worker serialization logic.");return K!=="Object"&&(Ee.$name=K),Ee}function Ni(H){if(ki(H))return H;if(Array.isArray(H))return H.map(Ni);if(typeof H!="object")throw new Error("can't deserialize object of type "+typeof H);const D=zi(H)||"Object";if(!on[D])throw new Error(`can't deserialize unregistered class ${D}`);const{klass:K}=on[D];if(!K)throw new Error(`can't deserialize unregistered class ${D}`);if(K.deserialize)return K.deserialize(H);const he=Object.create(K.prototype);for(const Ee of Object.keys(H)){if(Ee==="$name")continue;const Be=H[Ee];he[Ee]=on[D].shallow.indexOf(Ee)>=0?Be:Ni(Be)}return he}class Bn{constructor(){this.first=!0}update(D,K){const he=Math.floor(D);return this.first?(this.first=!1,this.lastIntegerZoom=he,this.lastIntegerZoomTime=0,this.lastZoom=D,this.lastFloorZoom=he,!0):(this.lastFloorZoom>he?(this.lastIntegerZoom=he+1,this.lastIntegerZoomTime=K):this.lastFloorZoomH>=128&&H<=255,"Hangul Jamo":H=>H>=4352&&H<=4607,Khmer:H=>H>=6016&&H<=6143,"General Punctuation":H=>H>=8192&&H<=8303,"Letterlike Symbols":H=>H>=8448&&H<=8527,"Number Forms":H=>H>=8528&&H<=8591,"Miscellaneous Technical":H=>H>=8960&&H<=9215,"Control Pictures":H=>H>=9216&&H<=9279,"Optical Character Recognition":H=>H>=9280&&H<=9311,"Enclosed Alphanumerics":H=>H>=9312&&H<=9471,"Geometric Shapes":H=>H>=9632&&H<=9727,"Miscellaneous Symbols":H=>H>=9728&&H<=9983,"Miscellaneous Symbols and Arrows":H=>H>=11008&&H<=11263,"Ideographic Description Characters":H=>H>=12272&&H<=12287,"CJK Symbols and Punctuation":H=>H>=12288&&H<=12351,Katakana:H=>H>=12448&&H<=12543,Kanbun:H=>H>=12688&&H<=12703,"CJK Strokes":H=>H>=12736&&H<=12783,"Enclosed CJK Letters and Months":H=>H>=12800&&H<=13055,"CJK Compatibility":H=>H>=13056&&H<=13311,"Yijing Hexagram Symbols":H=>H>=19904&&H<=19967,"Private Use Area":H=>H>=57344&&H<=63743,"Vertical Forms":H=>H>=65040&&H<=65055,"CJK Compatibility Forms":H=>H>=65072&&H<=65103,"Small Form Variants":H=>H>=65104&&H<=65135,"Halfwidth and Fullwidth Forms":H=>H>=65280&&H<=65519};function Ki(H){for(const D of H)if(jo(D.charCodeAt(0)))return!0;return!1}function ko(H){for(const D of H)if(!os(D.charCodeAt(0)))return!1;return!0}function $o(H){const D=H.map(K=>{try{return new RegExp(`\\p{sc=${K}}`,"u").source}catch{return null}}).filter(K=>K);return new RegExp(D.join("|"),"u")}const Ls=$o(["Arab","Dupl","Mong","Ougr","Syrc"]);function os(H){return!Ls.test(String.fromCodePoint(H))}const As=$o(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function jo(H){return!(H!==746&&H!==747&&(H<4352||!(An["CJK Compatibility Forms"](H)&&!(H>=65097&&H<=65103)||An["CJK Compatibility"](H)||An["CJK Strokes"](H)||!(!An["CJK Symbols and Punctuation"](H)||H>=12296&&H<=12305||H>=12308&&H<=12319||H===12336)||An["Enclosed CJK Letters and Months"](H)||An["Ideographic Description Characters"](H)||An.Kanbun(H)||An.Katakana(H)&&H!==12540||!(!An["Halfwidth and Fullwidth Forms"](H)||H===65288||H===65289||H===65293||H>=65306&&H<=65310||H===65339||H===65341||H===65343||H>=65371&&H<=65503||H===65507||H>=65512&&H<=65519)||!(!An["Small Form Variants"](H)||H>=65112&&H<=65118||H>=65123&&H<=65126)||An["Vertical Forms"](H)||An["Yijing Hexagram Symbols"](H)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(H))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(H))||As.test(String.fromCodePoint(H)))))}function il(H){return!(jo(H)||function(D){return!!(An["Latin-1 Supplement"](D)&&(D===167||D===169||D===174||D===177||D===188||D===189||D===190||D===215||D===247)||An["General Punctuation"](D)&&(D===8214||D===8224||D===8225||D===8240||D===8241||D===8251||D===8252||D===8258||D===8263||D===8264||D===8265||D===8273)||An["Letterlike Symbols"](D)||An["Number Forms"](D)||An["Miscellaneous Technical"](D)&&(D>=8960&&D<=8967||D>=8972&&D<=8991||D>=8996&&D<=9e3||D===9003||D>=9085&&D<=9114||D>=9150&&D<=9165||D===9167||D>=9169&&D<=9179||D>=9186&&D<=9215)||An["Control Pictures"](D)&&D!==9251||An["Optical Character Recognition"](D)||An["Enclosed Alphanumerics"](D)||An["Geometric Shapes"](D)||An["Miscellaneous Symbols"](D)&&!(D>=9754&&D<=9759)||An["Miscellaneous Symbols and Arrows"](D)&&(D>=11026&&D<=11055||D>=11088&&D<=11097||D>=11192&&D<=11243)||An["CJK Symbols and Punctuation"](D)||An.Katakana(D)||An["Private Use Area"](D)||An["CJK Compatibility Forms"](D)||An["Small Form Variants"](D)||An["Halfwidth and Fullwidth Forms"](D)||D===8734||D===8756||D===8757||D>=9984&&D<=10087||D>=10102&&D<=10131||D===65532||D===65533)}(H))}const Qs=$o(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Ss(H){return Qs.test(String.fromCodePoint(H))}function fi(H,D){return!(!D&&Ss(H)||H>=2304&&H<=3583||H>=3840&&H<=4255||An.Khmer(H))}function ao(H){for(const D of H)if(Ss(D.charCodeAt(0)))return!0;return!1}const gs=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(H){this.pluginStatus=H.pluginStatus,this.pluginURL=H.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(H){this.applyArabicShaping=H.applyArabicShaping,this.processBidirectionalText=H.processBidirectionalText,this.processStyledBidirectionalText=H.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Jo{constructor(D,K){this.zoom=D,K?(this.now=K.now,this.fadeDuration=K.fadeDuration,this.zoomHistory=K.zoomHistory,this.transition=K.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Bn,this.transition={})}isSupportedScript(D){return function(K,he){for(const Ee of K)if(!fi(Ee.charCodeAt(0),he))return!1;return!0}(D,gs.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const D=this.zoom,K=D-Math.floor(D),he=this.crossFadingFactor();return D>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:K+(1-K)*he}:{fromScale:.5,toScale:1,t:1-(1-he)*K}}}class Bl{constructor(D,K){this.property=D,this.value=K,this.expression=function(he,Ee){if(Vc(he))return new Ns(he,Ee);if(Uu(he)){const Be=au(he,Ee);if(Be.result==="error")throw new Error(Be.value.map(Ve=>`${Ve.key}: ${Ve.message}`).join(", "));return Be.value}{let Be=he;return Ee.type==="color"&&typeof he=="string"?Be=Ot.parse(he):Ee.type!=="padding"||typeof he!="number"&&!Array.isArray(he)?Ee.type==="variableAnchorOffsetCollection"&&Array.isArray(he)&&(Be=Aa.parse(he)):Be=Ur.parse(he),{kind:"constant",evaluate:()=>Be}}}(K===void 0?D.specification.default:K,D.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(D,K,he){return this.property.possiblyEvaluate(this,D,K,he)}}class jl{constructor(D){this.property=D,this.value=new Bl(D,void 0)}transitioned(D,K){return new cc(this.property,this.value,K,M({},D.transition,this.transition),D.now)}untransitioned(){return new cc(this.property,this.value,null,{},0)}}class Vl{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitionablePropertyValues)}getValue(D){return u(this._values[D].value.value)}setValue(D,K){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new jl(this._values[D].property)),this._values[D].value=new Bl(this._values[D].property,K===null?void 0:u(K))}getTransition(D){return u(this._values[D].transition)}setTransition(D,K){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new jl(this._values[D].property)),this._values[D].transition=u(K)||void 0}serialize(){const D={};for(const K of Object.keys(this._values)){const he=this.getValue(K);he!==void 0&&(D[K]=he);const Ee=this.getTransition(K);Ee!==void 0&&(D[`${K}-transition`]=Ee)}return D}transitioned(D,K){const he=new ql(this._properties);for(const Ee of Object.keys(this._values))he._values[Ee]=this._values[Ee].transitioned(D,K._values[Ee]);return he}untransitioned(){const D=new ql(this._properties);for(const K of Object.keys(this._values))D._values[K]=this._values[K].untransitioned();return D}}class cc{constructor(D,K,he,Ee,Be){this.property=D,this.value=K,this.begin=Be+Ee.delay||0,this.end=this.begin+Ee.duration||0,D.specification.transition&&(Ee.delay||Ee.duration)&&(this.prior=he)}possiblyEvaluate(D,K,he){const Ee=D.now||0,Be=this.value.possiblyEvaluate(D,K,he),Ve=this.prior;if(Ve){if(Ee>this.end)return this.prior=null,Be;if(this.value.isDataDriven())return this.prior=null,Be;if(Ee=1)return 1;const Pt=mt*mt,Xt=Pt*mt;return 4*(mt<.5?Xt:3*(mt-Pt)+Xt-.75)}(nt))}}return Be}}class ql{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitioningPropertyValues)}possiblyEvaluate(D,K,he){const Ee=new rc(this._properties);for(const Be of Object.keys(this._values))Ee._values[Be]=this._values[Be].possiblyEvaluate(D,K,he);return Ee}hasTransition(){for(const D of Object.keys(this._values))if(this._values[D].prior)return!0;return!1}}class Vu{constructor(D){this._properties=D,this._values=Object.create(D.defaultPropertyValues)}hasValue(D){return this._values[D].value!==void 0}getValue(D){return u(this._values[D].value)}setValue(D,K){this._values[D]=new Bl(this._values[D].property,K===null?void 0:u(K))}serialize(){const D={};for(const K of Object.keys(this._values)){const he=this.getValue(K);he!==void 0&&(D[K]=he)}return D}possiblyEvaluate(D,K,he){const Ee=new rc(this._properties);for(const Be of Object.keys(this._values))Ee._values[Be]=this._values[Be].possiblyEvaluate(D,K,he);return Ee}}class ol{constructor(D,K,he){this.property=D,this.value=K,this.parameters=he}isConstant(){return this.value.kind==="constant"}constantOr(D){return this.value.kind==="constant"?this.value.value:D}evaluate(D,K,he,Ee){return this.property.evaluate(this.value,this.parameters,D,K,he,Ee)}}class rc{constructor(D){this._properties=D,this._values=Object.create(D.defaultPossiblyEvaluatedValues)}get(D){return this._values[D]}}class Vi{constructor(D){this.specification=D}possiblyEvaluate(D,K){if(D.isDataDriven())throw new Error("Value should not be data driven");return D.expression.evaluate(K)}interpolate(D,K,he){const Ee=Ci[this.specification.type];return Ee?Ee(D,K,he):D}}class eo{constructor(D,K){this.specification=D,this.overrides=K}possiblyEvaluate(D,K,he,Ee){return new ol(this,D.expression.kind==="constant"||D.expression.kind==="camera"?{kind:"constant",value:D.expression.evaluate(K,null,{},he,Ee)}:D.expression,K)}interpolate(D,K,he){if(D.value.kind!=="constant"||K.value.kind!=="constant")return D;if(D.value.value===void 0||K.value.value===void 0)return new ol(this,{kind:"constant",value:void 0},D.parameters);const Ee=Ci[this.specification.type];if(Ee){const Be=Ee(D.value.value,K.value.value,he);return new ol(this,{kind:"constant",value:Be},D.parameters)}return D}evaluate(D,K,he,Ee,Be,Ve){return D.kind==="constant"?D.value:D.evaluate(K,he,Ee,Be,Ve)}}class qu extends eo{possiblyEvaluate(D,K,he,Ee){if(D.value===void 0)return new ol(this,{kind:"constant",value:void 0},K);if(D.expression.kind==="constant"){const Be=D.expression.evaluate(K,null,{},he,Ee),Ve=D.property.specification.type==="resolvedImage"&&typeof Be!="string"?Be.name:Be,nt=this._calculate(Ve,Ve,Ve,K);return new ol(this,{kind:"constant",value:nt},K)}if(D.expression.kind==="camera"){const Be=this._calculate(D.expression.evaluate({zoom:K.zoom-1}),D.expression.evaluate({zoom:K.zoom}),D.expression.evaluate({zoom:K.zoom+1}),K);return new ol(this,{kind:"constant",value:Be},K)}return new ol(this,D.expression,K)}evaluate(D,K,he,Ee,Be,Ve){if(D.kind==="source"){const nt=D.evaluate(K,he,Ee,Be,Ve);return this._calculate(nt,nt,nt,K)}return D.kind==="composite"?this._calculate(D.evaluate({zoom:Math.floor(K.zoom)-1},he,Ee),D.evaluate({zoom:Math.floor(K.zoom)},he,Ee),D.evaluate({zoom:Math.floor(K.zoom)+1},he,Ee),K):D.value}_calculate(D,K,he,Ee){return Ee.zoom>Ee.zoomHistory.lastIntegerZoom?{from:D,to:K}:{from:he,to:K}}interpolate(D){return D}}class Du{constructor(D){this.specification=D}possiblyEvaluate(D,K,he,Ee){if(D.value!==void 0){if(D.expression.kind==="constant"){const Be=D.expression.evaluate(K,null,{},he,Ee);return this._calculate(Be,Be,Be,K)}return this._calculate(D.expression.evaluate(new Jo(Math.floor(K.zoom-1),K)),D.expression.evaluate(new Jo(Math.floor(K.zoom),K)),D.expression.evaluate(new Jo(Math.floor(K.zoom+1),K)),K)}}_calculate(D,K,he,Ee){return Ee.zoom>Ee.zoomHistory.lastIntegerZoom?{from:D,to:K}:{from:he,to:K}}interpolate(D){return D}}class wc{constructor(D){this.specification=D}possiblyEvaluate(D,K,he,Ee){return!!D.expression.evaluate(K,null,{},he,Ee)}interpolate(){return!1}}class De{constructor(D){this.properties=D,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const K in D){const he=D[K];he.specification.overridable&&this.overridableProperties.push(K);const Ee=this.defaultPropertyValues[K]=new Bl(he,void 0),Be=this.defaultTransitionablePropertyValues[K]=new jl(he);this.defaultTransitioningPropertyValues[K]=Be.untransitioned(),this.defaultPossiblyEvaluatedValues[K]=Ee.possiblyEvaluate({})}}}Wa("DataDrivenProperty",eo),Wa("DataConstantProperty",Vi),Wa("CrossFadedDataDrivenProperty",qu),Wa("CrossFadedProperty",Du),Wa("ColorRampProperty",wc);const I="-transition";class ne extends ae{constructor(D,K){if(super(),this.id=D.id,this.type=D.type,this._featureFilter={filter:()=>!0,needGeometry:!1},D.type!=="custom"&&(this.metadata=D.metadata,this.minzoom=D.minzoom,this.maxzoom=D.maxzoom,D.type!=="background"&&(this.source=D.source,this.sourceLayer=D["source-layer"],this.filter=D.filter),K.layout&&(this._unevaluatedLayout=new Vu(K.layout)),K.paint)){this._transitionablePaint=new Vl(K.paint);for(const he in D.paint)this.setPaintProperty(he,D.paint[he],{validate:!1});for(const he in D.layout)this.setLayoutProperty(he,D.layout[he],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new rc(K.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(D){return D==="visibility"?this.visibility:this._unevaluatedLayout.getValue(D)}setLayoutProperty(D,K,he={}){K!=null&&this._validate(kn,`layers.${this.id}.layout.${D}`,D,K,he)||(D!=="visibility"?this._unevaluatedLayout.setValue(D,K):this.visibility=K)}getPaintProperty(D){return D.endsWith(I)?this._transitionablePaint.getTransition(D.slice(0,-11)):this._transitionablePaint.getValue(D)}setPaintProperty(D,K,he={}){if(K!=null&&this._validate(gn,`layers.${this.id}.paint.${D}`,D,K,he))return!1;if(D.endsWith(I))return this._transitionablePaint.setTransition(D.slice(0,-11),K||void 0),!1;{const Ee=this._transitionablePaint._values[D],Be=Ee.property.specification["property-type"]==="cross-faded-data-driven",Ve=Ee.value.isDataDriven(),nt=Ee.value;this._transitionablePaint.setValue(D,K),this._handleSpecialPaintPropertyUpdate(D);const mt=this._transitionablePaint._values[D].value;return mt.isDataDriven()||Ve||Be||this._handleOverridablePaintPropertyUpdate(D,nt,mt)}}_handleSpecialPaintPropertyUpdate(D){}_handleOverridablePaintPropertyUpdate(D,K,he){return!1}isHidden(D){return!!(this.minzoom&&D=this.maxzoom)||this.visibility==="none"}updateTransitions(D){this._transitioningPaint=this._transitionablePaint.transitioned(D,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(D,K){D.getCrossfadeParameters&&(this._crossfadeParameters=D.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(D,void 0,K)),this.paint=this._transitioningPaint.possiblyEvaluate(D,void 0,K)}serialize(){const D={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&&(D.layout=D.layout||{},D.layout.visibility=this.visibility),p(D,(K,he)=>!(K===void 0||he==="layout"&&!Object.keys(K).length||he==="paint"&&!Object.keys(K).length))}_validate(D,K,he,Ee,Be={}){return(!Be||Be.validate!==!1)&&Ja(this,D.call(Fa,{key:K,layerType:this.type,objectKey:he,value:Ee,styleSpec:ie,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const D in this.paint._values){const K=this.paint.get(D);if(K instanceof ol&&eu(K.property.specification)&&(K.value.kind==="source"||K.value.kind==="composite")&&K.value.isStateDependent)return!0}return!1}}const Te={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Se{constructor(D,K){this._structArray=D,this._pos1=K*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Ie{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(D,K){return D._trim(),K&&(D.isTransferred=!0,K.push(D.arrayBuffer)),{length:D.length,arrayBuffer:D.arrayBuffer}}static deserialize(D){const K=Object.create(this.prototype);return K.arrayBuffer=D.arrayBuffer,K.length=D.length,K.capacity=D.arrayBuffer.byteLength/K.bytesPerElement,K._refreshViews(),K}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(D){this.reserve(D),this.length=D}reserve(D){if(D>this.capacity){this.capacity=Math.max(D,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const K=this.uint8;this._refreshViews(),K&&this.uint8.set(K)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ot(H,D=1){let K=0,he=0;return{members:H.map(Ee=>{const Be=Te[Ee.type].BYTES_PER_ELEMENT,Ve=K=yt(K,Math.max(D,Be)),nt=Ee.components||1;return he=Math.max(he,Be),K+=Be*nt,{name:Ee.name,type:Ee.type,components:nt,offset:Ve}}),size:yt(K,Math.max(he,D)),alignment:D}}function yt(H,D){return Math.ceil(H/D)*D}class Ct extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K){const he=this.length;return this.resize(he+1),this.emplace(he,D,K)}emplace(D,K,he){const Ee=2*D;return this.int16[Ee+0]=K,this.int16[Ee+1]=he,D}}Ct.prototype.bytesPerElement=4,Wa("StructArrayLayout2i4",Ct);class Wt extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,D,K,he)}emplace(D,K,he,Ee){const Be=3*D;return this.int16[Be+0]=K,this.int16[Be+1]=he,this.int16[Be+2]=Ee,D}}Wt.prototype.bytesPerElement=6,Wa("StructArrayLayout3i6",Wt);class nr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee){const Be=this.length;return this.resize(Be+1),this.emplace(Be,D,K,he,Ee)}emplace(D,K,he,Ee,Be){const Ve=4*D;return this.int16[Ve+0]=K,this.int16[Ve+1]=he,this.int16[Ve+2]=Ee,this.int16[Ve+3]=Be,D}}nr.prototype.bytesPerElement=8,Wa("StructArrayLayout4i8",nr);class or extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve){const nt=this.length;return this.resize(nt+1),this.emplace(nt,D,K,he,Ee,Be,Ve)}emplace(D,K,he,Ee,Be,Ve,nt){const mt=6*D;return this.int16[mt+0]=K,this.int16[mt+1]=he,this.int16[mt+2]=Ee,this.int16[mt+3]=Be,this.int16[mt+4]=Ve,this.int16[mt+5]=nt,D}}or.prototype.bytesPerElement=12,Wa("StructArrayLayout2i4i12",or);class Fr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve){const nt=this.length;return this.resize(nt+1),this.emplace(nt,D,K,he,Ee,Be,Ve)}emplace(D,K,he,Ee,Be,Ve,nt){const mt=4*D,Pt=8*D;return this.int16[mt+0]=K,this.int16[mt+1]=he,this.uint8[Pt+4]=Ee,this.uint8[Pt+5]=Be,this.uint8[Pt+6]=Ve,this.uint8[Pt+7]=nt,D}}Fr.prototype.bytesPerElement=8,Wa("StructArrayLayout2i4ub8",Fr);class Wr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K){const he=this.length;return this.resize(he+1),this.emplace(he,D,K)}emplace(D,K,he){const Ee=2*D;return this.float32[Ee+0]=K,this.float32[Ee+1]=he,D}}Wr.prototype.bytesPerElement=8,Wa("StructArrayLayout2f8",Wr);class je extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt){const er=this.length;return this.resize(er+1),this.emplace(er,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt)}emplace(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er){const br=10*D;return this.uint16[br+0]=K,this.uint16[br+1]=he,this.uint16[br+2]=Ee,this.uint16[br+3]=Be,this.uint16[br+4]=Ve,this.uint16[br+5]=nt,this.uint16[br+6]=mt,this.uint16[br+7]=Pt,this.uint16[br+8]=Xt,this.uint16[br+9]=er,D}}je.prototype.bytesPerElement=20,Wa("StructArrayLayout10ui20",je);class Ze extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br){const Rr=this.length;return this.resize(Rr+1),this.emplace(Rr,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br)}emplace(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr){const jr=12*D;return this.int16[jr+0]=K,this.int16[jr+1]=he,this.int16[jr+2]=Ee,this.int16[jr+3]=Be,this.uint16[jr+4]=Ve,this.uint16[jr+5]=nt,this.uint16[jr+6]=mt,this.uint16[jr+7]=Pt,this.int16[jr+8]=Xt,this.int16[jr+9]=er,this.int16[jr+10]=br,this.int16[jr+11]=Rr,D}}Ze.prototype.bytesPerElement=24,Wa("StructArrayLayout4i4ui4i24",Ze);class at extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,he){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,D,K,he)}emplace(D,K,he,Ee){const Be=3*D;return this.float32[Be+0]=K,this.float32[Be+1]=he,this.float32[Be+2]=Ee,D}}at.prototype.bytesPerElement=12,Wa("StructArrayLayout3f12",at);class lt extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(D){const K=this.length;return this.resize(K+1),this.emplace(K,D)}emplace(D,K){return this.uint32[1*D+0]=K,D}}lt.prototype.bytesPerElement=4,Wa("StructArrayLayout1ul4",lt);class Tt extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve,nt,mt,Pt){const Xt=this.length;return this.resize(Xt+1),this.emplace(Xt,D,K,he,Ee,Be,Ve,nt,mt,Pt)}emplace(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt){const er=10*D,br=5*D;return this.int16[er+0]=K,this.int16[er+1]=he,this.int16[er+2]=Ee,this.int16[er+3]=Be,this.int16[er+4]=Ve,this.int16[er+5]=nt,this.uint32[br+3]=mt,this.uint16[er+8]=Pt,this.uint16[er+9]=Xt,D}}Tt.prototype.bytesPerElement=20,Wa("StructArrayLayout6i1ul2ui20",Tt);class gt extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve){const nt=this.length;return this.resize(nt+1),this.emplace(nt,D,K,he,Ee,Be,Ve)}emplace(D,K,he,Ee,Be,Ve,nt){const mt=6*D;return this.int16[mt+0]=K,this.int16[mt+1]=he,this.int16[mt+2]=Ee,this.int16[mt+3]=Be,this.int16[mt+4]=Ve,this.int16[mt+5]=nt,D}}gt.prototype.bytesPerElement=12,Wa("StructArrayLayout2i2i2i12",gt);class Et extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be){const Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,D,K,he,Ee,Be)}emplace(D,K,he,Ee,Be,Ve){const nt=4*D,mt=8*D;return this.float32[nt+0]=K,this.float32[nt+1]=he,this.float32[nt+2]=Ee,this.int16[mt+6]=Be,this.int16[mt+7]=Ve,D}}Et.prototype.bytesPerElement=16,Wa("StructArrayLayout2f1f2i16",Et);class Yt extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve){const nt=this.length;return this.resize(nt+1),this.emplace(nt,D,K,he,Ee,Be,Ve)}emplace(D,K,he,Ee,Be,Ve,nt){const mt=16*D,Pt=4*D,Xt=8*D;return this.uint8[mt+0]=K,this.uint8[mt+1]=he,this.float32[Pt+1]=Ee,this.float32[Pt+2]=Be,this.int16[Xt+6]=Ve,this.int16[Xt+7]=nt,D}}Yt.prototype.bytesPerElement=16,Wa("StructArrayLayout2ub2f2i16",Yt);class rr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,he){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,D,K,he)}emplace(D,K,he,Ee){const Be=3*D;return this.uint16[Be+0]=K,this.uint16[Be+1]=he,this.uint16[Be+2]=Ee,D}}rr.prototype.bytesPerElement=6,Wa("StructArrayLayout3ui6",rr);class sr extends Ie{_refreshViews(){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)}emplaceBack(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca){const un=this.length;return this.resize(un+1),this.emplace(un,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca)}emplace(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca,un){const Ha=24*D,rn=12*D,Sn=48*D;return this.int16[Ha+0]=K,this.int16[Ha+1]=he,this.uint16[Ha+2]=Ee,this.uint16[Ha+3]=Be,this.uint32[rn+2]=Ve,this.uint32[rn+3]=nt,this.uint32[rn+4]=mt,this.uint16[Ha+10]=Pt,this.uint16[Ha+11]=Xt,this.uint16[Ha+12]=er,this.float32[rn+7]=br,this.float32[rn+8]=Rr,this.uint8[Sn+36]=jr,this.uint8[Sn+37]=Yr,this.uint8[Sn+38]=ca,this.uint32[rn+10]=Ca,this.int16[Ha+22]=un,D}}sr.prototype.bytesPerElement=48,Wa("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",sr);class Sr extends Ie{_refreshViews(){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)}emplaceBack(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca,un,Ha,rn,Sn,$n,Oi,qo,qi,Di,mo,so){const to=this.length;return this.resize(to+1),this.emplace(to,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca,un,Ha,rn,Sn,$n,Oi,qo,qi,Di,mo,so)}emplace(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca,un,Ha,rn,Sn,$n,Oi,qo,qi,Di,mo,so,to){const zn=32*D,To=16*D;return this.int16[zn+0]=K,this.int16[zn+1]=he,this.int16[zn+2]=Ee,this.int16[zn+3]=Be,this.int16[zn+4]=Ve,this.int16[zn+5]=nt,this.int16[zn+6]=mt,this.int16[zn+7]=Pt,this.uint16[zn+8]=Xt,this.uint16[zn+9]=er,this.uint16[zn+10]=br,this.uint16[zn+11]=Rr,this.uint16[zn+12]=jr,this.uint16[zn+13]=Yr,this.uint16[zn+14]=ca,this.uint16[zn+15]=Ca,this.uint16[zn+16]=un,this.uint16[zn+17]=Ha,this.uint16[zn+18]=rn,this.uint16[zn+19]=Sn,this.uint16[zn+20]=$n,this.uint16[zn+21]=Oi,this.uint16[zn+22]=qo,this.uint32[To+12]=qi,this.float32[To+13]=Di,this.float32[To+14]=mo,this.uint16[zn+30]=so,this.uint16[zn+31]=to,D}}Sr.prototype.bytesPerElement=64,Wa("StructArrayLayout8i15ui1ul2f2ui64",Sr);class Nr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D){const K=this.length;return this.resize(K+1),this.emplace(K,D)}emplace(D,K){return this.float32[1*D+0]=K,D}}Nr.prototype.bytesPerElement=4,Wa("StructArrayLayout1f4",Nr);class Qr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,he){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,D,K,he)}emplace(D,K,he,Ee){const Be=3*D;return this.uint16[6*D+0]=K,this.float32[Be+1]=he,this.float32[Be+2]=Ee,D}}Qr.prototype.bytesPerElement=12,Wa("StructArrayLayout1ui2f12",Qr);class ia extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,he){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,D,K,he)}emplace(D,K,he,Ee){const Be=4*D;return this.uint32[2*D+0]=K,this.uint16[Be+2]=he,this.uint16[Be+3]=Ee,D}}ia.prototype.bytesPerElement=8,Wa("StructArrayLayout1ul2ui8",ia);class _a extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K){const he=this.length;return this.resize(he+1),this.emplace(he,D,K)}emplace(D,K,he){const Ee=2*D;return this.uint16[Ee+0]=K,this.uint16[Ee+1]=he,D}}_a.prototype.bytesPerElement=4,Wa("StructArrayLayout2ui4",_a);class za extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D){const K=this.length;return this.resize(K+1),this.emplace(K,D)}emplace(D,K){return this.uint16[1*D+0]=K,D}}za.prototype.bytesPerElement=2,Wa("StructArrayLayout1ui2",za);class nn extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee){const Be=this.length;return this.resize(Be+1),this.emplace(Be,D,K,he,Ee)}emplace(D,K,he,Ee,Be){const Ve=4*D;return this.float32[Ve+0]=K,this.float32[Ve+1]=he,this.float32[Ve+2]=Ee,this.float32[Ve+3]=Be,D}}nn.prototype.bytesPerElement=16,Wa("StructArrayLayout4f16",nn);class en extends Se{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new i(this.anchorPointX,this.anchorPointY)}}en.prototype.size=20;class ln extends Tt{get(D){return new en(this,D)}}Wa("CollisionBoxArray",ln);class Nn extends Se{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(D){this._structArray.uint8[this._pos1+37]=D}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(D){this._structArray.uint8[this._pos1+38]=D}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(D){this._structArray.uint32[this._pos4+10]=D}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Nn.prototype.size=48;class pi extends sr{get(D){return new Nn(this,D)}}Wa("PlacedSymbolArray",pi);class ii extends Se{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(D){this._structArray.uint32[this._pos4+12]=D}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}ii.prototype.size=64;class Gi extends Sr{get(D){return new ii(this,D)}}Wa("SymbolInstanceArray",Gi);class Bo extends Nr{getoffsetX(D){return this.float32[1*D+0]}}Wa("GlyphOffsetArray",Bo);class No extends Wt{getx(D){return this.int16[3*D+0]}gety(D){return this.int16[3*D+1]}gettileUnitDistanceFromAnchor(D){return this.int16[3*D+2]}}Wa("SymbolLineVertexArray",No);class po extends Se{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}po.prototype.size=12;class Zo extends Qr{get(D){return new po(this,D)}}Wa("TextAnchorOffsetArray",Zo);class Hs extends Se{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Hs.prototype.size=8;class zs extends ia{get(D){return new Hs(this,D)}}Wa("FeatureIndexArray",zs);class xo extends Ct{}class bo extends Ct{}class vl extends Ct{}class Al extends or{}class pu extends Fr{}class pe extends Wr{}class Le extends je{}class Ye extends Ze{}class ut extends at{}class ht extends lt{}class xt extends gt{}class zt extends Yt{}class Dt extends rr{}class $t extends _a{}const Cr=ot([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ar}=Cr;class Vr{constructor(D=[]){this.segments=D}prepareSegment(D,K,he,Ee){let Be=this.segments[this.segments.length-1];return D>Vr.MAX_VERTEX_ARRAY_LENGTH&&m(`Max vertices per segment is ${Vr.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${D}`),(!Be||Be.vertexLength+D>Vr.MAX_VERTEX_ARRAY_LENGTH||Be.sortKey!==Ee)&&(Be={vertexOffset:K.length,primitiveOffset:he.length,vertexLength:0,primitiveLength:0},Ee!==void 0&&(Be.sortKey=Ee),this.segments.push(Be)),Be}get(){return this.segments}destroy(){for(const D of this.segments)for(const K in D.vaos)D.vaos[K].destroy()}static simpleSegment(D,K,he,Ee){return new Vr([{vertexOffset:D,primitiveOffset:K,vertexLength:he,primitiveLength:Ee,vaos:{},sortKey:0}])}}function Kr(H,D){return 256*(H=b(Math.floor(H),0,255))+b(Math.floor(D),0,255)}Vr.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Wa("SegmentVector",Vr);const aa=ot([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Ua={exports:{}},la={exports:{}};la.exports=function(H,D){var K,he,Ee,Be,Ve,nt,mt,Pt;for(he=H.length-(K=3&H.length),Ee=D,Ve=3432918353,nt=461845907,Pt=0;Pt>>16)*Ve&65535)<<16)&4294967295)<<15|mt>>>17))*nt+(((mt>>>16)*nt&65535)<<16)&4294967295)<<13|Ee>>>19))+((5*(Ee>>>16)&65535)<<16)&4294967295))+((58964+(Be>>>16)&65535)<<16);switch(mt=0,K){case 3:mt^=(255&H.charCodeAt(Pt+2))<<16;case 2:mt^=(255&H.charCodeAt(Pt+1))<<8;case 1:Ee^=mt=(65535&(mt=(mt=(65535&(mt^=255&H.charCodeAt(Pt)))*Ve+(((mt>>>16)*Ve&65535)<<16)&4294967295)<<15|mt>>>17))*nt+(((mt>>>16)*nt&65535)<<16)&4294967295}return Ee^=H.length,Ee=2246822507*(65535&(Ee^=Ee>>>16))+((2246822507*(Ee>>>16)&65535)<<16)&4294967295,Ee=3266489909*(65535&(Ee^=Ee>>>13))+((3266489909*(Ee>>>16)&65535)<<16)&4294967295,(Ee^=Ee>>>16)>>>0};var Ta=la.exports,ka={exports:{}};ka.exports=function(H,D){for(var K,he=H.length,Ee=D^he,Be=0;he>=4;)K=1540483477*(65535&(K=255&H.charCodeAt(Be)|(255&H.charCodeAt(++Be))<<8|(255&H.charCodeAt(++Be))<<16|(255&H.charCodeAt(++Be))<<24))+((1540483477*(K>>>16)&65535)<<16),Ee=1540483477*(65535&Ee)+((1540483477*(Ee>>>16)&65535)<<16)^(K=1540483477*(65535&(K^=K>>>24))+((1540483477*(K>>>16)&65535)<<16)),he-=4,++Be;switch(he){case 3:Ee^=(255&H.charCodeAt(Be+2))<<16;case 2:Ee^=(255&H.charCodeAt(Be+1))<<8;case 1:Ee=1540483477*(65535&(Ee^=255&H.charCodeAt(Be)))+((1540483477*(Ee>>>16)&65535)<<16)}return Ee=1540483477*(65535&(Ee^=Ee>>>13))+((1540483477*(Ee>>>16)&65535)<<16),(Ee^=Ee>>>15)>>>0};var Ba=Ta,Va=ka.exports;Ua.exports=Ba,Ua.exports.murmur3=Ba,Ua.exports.murmur2=Va;var Ma=r(Ua.exports);class mn{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(D,K,he,Ee){this.ids.push(Wn(D)),this.positions.push(K,he,Ee)}getPositions(D){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const K=Wn(D);let he=0,Ee=this.ids.length-1;for(;he>1;this.ids[Ve]>=K?Ee=Ve:he=Ve+1}const Be=[];for(;this.ids[he]===K;)Be.push({index:this.positions[3*he],start:this.positions[3*he+1],end:this.positions[3*he+2]}),he++;return Be}static serialize(D,K){const he=new Float64Array(D.ids),Ee=new Uint32Array(D.positions);return jn(he,Ee,0,he.length-1),K&&K.push(he.buffer,Ee.buffer),{ids:he,positions:Ee}}static deserialize(D){const K=new mn;return K.ids=D.ids,K.positions=D.positions,K.indexed=!0,K}}function Wn(H){const D=+H;return!isNaN(D)&&D<=Number.MAX_SAFE_INTEGER?D:Ma(String(H))}function jn(H,D,K,he){for(;K>1];let Be=K-1,Ve=he+1;for(;;){do Be++;while(H[Be]Ee);if(Be>=Ve)break;Zn(H,Be,Ve),Zn(D,3*Be,3*Ve),Zn(D,3*Be+1,3*Ve+1),Zn(D,3*Be+2,3*Ve+2)}Ve-K`u_${Ee}`),this.type=he}setUniform(D,K,he){D.set(he.constantOr(this.value))}getBinding(D,K,he){return this.type==="color"?new wi(D,K):new _i(D,K)}}class Ms{constructor(D,K){this.uniformNames=K.map(he=>`u_${he}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(D,K){this.pixelRatioFrom=K.pixelRatio,this.pixelRatioTo=D.pixelRatio,this.patternFrom=K.tlbr,this.patternTo=D.tlbr}setUniform(D,K,he,Ee){const Be=Ee==="u_pattern_to"?this.patternTo:Ee==="u_pattern_from"?this.patternFrom:Ee==="u_pixel_ratio_to"?this.pixelRatioTo:Ee==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Be&&D.set(Be)}getBinding(D,K,he){return he.substr(0,9)==="u_pattern"?new Po(D,K):new _i(D,K)}}class Kn{constructor(D,K,he,Ee){this.expression=D,this.type=he,this.maxValue=0,this.paintVertexAttributes=K.map(Be=>({name:`a_${Be}`,type:"Float32",components:he==="color"?2:1,offset:0})),this.paintVertexArray=new Ee}populatePaintArray(D,K,he,Ee,Be){const Ve=this.paintVertexArray.length,nt=this.expression.evaluate(new Jo(0),K,{},Ee,[],Be);this.paintVertexArray.resize(D),this._setPaintValue(Ve,D,nt)}updatePaintArray(D,K,he,Ee){const Be=this.expression.evaluate({zoom:0},he,Ee);this._setPaintValue(D,K,Be)}_setPaintValue(D,K,he){if(this.type==="color"){const Ee=Vo(he);for(let Be=D;Be`u_${nt}_t`),this.type=he,this.useIntegerZoom=Ee,this.zoom=Be,this.maxValue=0,this.paintVertexAttributes=K.map(nt=>({name:`a_${nt}`,type:"Float32",components:he==="color"?4:2,offset:0})),this.paintVertexArray=new Ve}populatePaintArray(D,K,he,Ee,Be){const Ve=this.expression.evaluate(new Jo(this.zoom),K,{},Ee,[],Be),nt=this.expression.evaluate(new Jo(this.zoom+1),K,{},Ee,[],Be),mt=this.paintVertexArray.length;this.paintVertexArray.resize(D),this._setPaintValue(mt,D,Ve,nt)}updatePaintArray(D,K,he,Ee){const Be=this.expression.evaluate({zoom:this.zoom},he,Ee),Ve=this.expression.evaluate({zoom:this.zoom+1},he,Ee);this._setPaintValue(D,K,Be,Ve)}_setPaintValue(D,K,he,Ee){if(this.type==="color"){const Be=Vo(he),Ve=Vo(Ee);for(let nt=D;nt`#define HAS_UNIFORM_${Ee}`))}return D}getBinderAttributes(){const D=[];for(const K in this.binders){const he=this.binders[K];if(he instanceof Kn||he instanceof go)for(let Ee=0;Ee!0){this.programConfigurations={};for(const Ee of D)this.programConfigurations[Ee.id]=new Es(Ee,K,he);this.needsUpload=!1,this._featureMap=new mn,this._bufferOffset=0}populatePaintArrays(D,K,he,Ee,Be,Ve){for(const nt in this.programConfigurations)this.programConfigurations[nt].populatePaintArrays(D,K,Ee,Be,Ve);K.id!==void 0&&this._featureMap.add(K.id,he,this._bufferOffset,D),this._bufferOffset=D,this.needsUpload=!0}updatePaintArrays(D,K,he,Ee){for(const Be of he)this.needsUpload=this.programConfigurations[Be.id].updatePaintArrays(D,this._featureMap,K,Be,Ee)||this.needsUpload}get(D){return this.programConfigurations[D]}upload(D){if(this.needsUpload){for(const K in this.programConfigurations)this.programConfigurations[K].upload(D);this.needsUpload=!1}}destroy(){for(const D in this.programConfigurations)this.programConfigurations[D].destroy()}}function Hl(H,D){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[H]||[H.replace(`${D}-`,"").replace(/-/g,"_")]}function Qo(H,D,K){const he={color:{source:Wr,composite:nn},number:{source:Nr,composite:Wr}},Ee=function(Be){return{"line-pattern":{source:Le,composite:Le},"fill-pattern":{source:Le,composite:Le},"fill-extrusion-pattern":{source:Le,composite:Le}}[Be]}(H);return Ee&&Ee[K]||he[D][K]}Wa("ConstantBinder",sl),Wa("CrossFadedConstantBinder",Ms),Wa("SourceExpressionBinder",Kn),Wa("CrossFadedCompositeBinder",Do),Wa("CompositeExpressionBinder",go),Wa("ProgramConfiguration",Es,{omit:["_buffers"]}),Wa("ProgramConfigurationSet",hs);const _s=8192,gu=Math.pow(2,14)-1,el=-gu-1;function cr(H){const D=_s/H.extent,K=H.loadGeometry();for(let he=0;heVe.x+1||mtVe.y+1)&&m("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return K}function fa(H,D){return{type:H.type,id:H.id,properties:H.properties,geometry:D?cr(H):[]}}function xa(H,D,K,he,Ee){H.emplaceBack(2*D+(he+1)/2,2*K+(Ee+1)/2)}class cn{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(K=>K.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new bo,this.indexArray=new Dt,this.segments=new Vr,this.programConfigurations=new hs(D.layers,D.zoom),this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,he){const Ee=this.layers[0],Be=[];let Ve=null,nt=!1;Ee.type==="circle"&&(Ve=Ee.layout.get("circle-sort-key"),nt=!Ve.isConstant());for(const{feature:mt,id:Pt,index:Xt,sourceLayerIndex:er}of D){const br=this.layers[0]._featureFilter.needGeometry,Rr=fa(mt,br);if(!this.layers[0]._featureFilter.filter(new Jo(this.zoom),Rr,he))continue;const jr=nt?Ve.evaluate(Rr,{},he):void 0,Yr={id:Pt,properties:mt.properties,type:mt.type,sourceLayerIndex:er,index:Xt,geometry:br?Rr.geometry:cr(mt),patterns:{},sortKey:jr};Be.push(Yr)}nt&&Be.sort((mt,Pt)=>mt.sortKey-Pt.sortKey);for(const mt of Be){const{geometry:Pt,index:Xt,sourceLayerIndex:er}=mt,br=D[Xt].feature;this.addFeature(mt,Pt,Xt,he),K.featureIndex.insert(br,Pt,Xt,er,this.index)}}update(D,K,he){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,he)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Ar),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(D,K,he,Ee){for(const Be of K)for(const Ve of Be){const nt=Ve.x,mt=Ve.y;if(nt<0||nt>=_s||mt<0||mt>=_s)continue;const Pt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,D.sortKey),Xt=Pt.vertexLength;xa(this.layoutVertexArray,nt,mt,-1,-1),xa(this.layoutVertexArray,nt,mt,1,-1),xa(this.layoutVertexArray,nt,mt,1,1),xa(this.layoutVertexArray,nt,mt,-1,1),this.indexArray.emplaceBack(Xt,Xt+1,Xt+2),this.indexArray.emplaceBack(Xt,Xt+3,Xt+2),Pt.vertexLength+=4,Pt.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,he,{},Ee)}}function In(H,D){for(let K=0;K1){if(Un(H,D))return!0;for(let he=0;he1?K:K.sub(D)._mult(Ee)._add(D))}function Ti(H,D){let K,he,Ee,Be=!1;for(let Ve=0;VeD.y!=Ee.y>D.y&&D.x<(Ee.x-he.x)*(D.y-he.y)/(Ee.y-he.y)+he.x&&(Be=!Be)}return Be}function si(H,D){let K=!1;for(let he=0,Ee=H.length-1;heD.y!=Ve.y>D.y&&D.x<(Ve.x-Be.x)*(D.y-Be.y)/(Ve.y-Be.y)+Be.x&&(K=!K)}return K}function Fn(H,D,K){const he=K[0],Ee=K[2];if(H.xEe.x&&D.x>Ee.x||H.yEe.y&&D.y>Ee.y)return!1;const Be=R(H,D,K[0]);return Be!==R(H,D,K[1])||Be!==R(H,D,K[2])||Be!==R(H,D,K[3])}function qa(H,D,K){const he=D.paint.get(H).value;return he.kind==="constant"?he.value:K.programConfigurations.get(D.id).getMaxValue(H)}function wn(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])}function Tn(H,D,K,he,Ee){if(!D[0]&&!D[1])return H;const Be=i.convert(D)._mult(Ee);K==="viewport"&&Be._rotate(-he);const Ve=[];for(let nt=0;ntro(ca,Yr))}(Pt,mt),Rr=er?Xt*nt:Xt;for(const jr of Ee)for(const Yr of jr){const ca=er?Yr:ro(Yr,mt);let Ca=Rr;const un=gi([],[Yr.x,Yr.y,0,1],mt);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Ca*=un[3]/Ve.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Ca*=Ve.cameraToCenterDistance/un[3]),Da(br,ca,Ca))return!0}return!1}}function ro(H,D){const K=gi([],[H.x,H.y,0,1],D);return new i(K[0]/K[3],K[1]/K[3])}class es extends cn{}let Fi;Wa("HeatmapBucket",es,{omit:["layers"]});var no={get paint(){return Fi=Fi||new De({"heatmap-radius":new eo(ie.paint_heatmap["heatmap-radius"]),"heatmap-weight":new eo(ie.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Vi(ie.paint_heatmap["heatmap-intensity"]),"heatmap-color":new wc(ie.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Vi(ie.paint_heatmap["heatmap-opacity"])})}};function oi(H,{width:D,height:K},he,Ee){if(Ee){if(Ee instanceof Uint8ClampedArray)Ee=new Uint8Array(Ee.buffer);else if(Ee.length!==D*K*he)throw new RangeError(`mismatched image size. expected: ${Ee.length} but got: ${D*K*he}`)}else Ee=new Uint8Array(D*K*he);return H.width=D,H.height=K,H.data=Ee,H}function Xo(H,{width:D,height:K},he){if(D===H.width&&K===H.height)return;const Ee=oi({},{width:D,height:K},he);ys(H,Ee,{x:0,y:0},{x:0,y:0},{width:Math.min(H.width,D),height:Math.min(H.height,K)},he),H.width=D,H.height=K,H.data=Ee.data}function ys(H,D,K,he,Ee,Be){if(Ee.width===0||Ee.height===0)return D;if(Ee.width>H.width||Ee.height>H.height||K.x>H.width-Ee.width||K.y>H.height-Ee.height)throw new RangeError("out of range source coordinates for image copy");if(Ee.width>D.width||Ee.height>D.height||he.x>D.width-Ee.width||he.y>D.height-Ee.height)throw new RangeError("out of range destination coordinates for image copy");const Ve=H.data,nt=D.data;if(Ve===nt)throw new Error("srcData equals dstData, so image is already copied");for(let mt=0;mt{D[H.evaluationKey]=mt;const Pt=H.expression.evaluate(D);Ee.data[Ve+nt+0]=Math.floor(255*Pt.r/Pt.a),Ee.data[Ve+nt+1]=Math.floor(255*Pt.g/Pt.a),Ee.data[Ve+nt+2]=Math.floor(255*Pt.b/Pt.a),Ee.data[Ve+nt+3]=Math.floor(255*Pt.a)};if(H.clips)for(let Ve=0,nt=0;Ve80*K){nt=1/0,mt=1/0;let Xt=-1/0,er=-1/0;for(let br=K;brXt&&(Xt=Rr),jr>er&&(er=jr)}Pt=Math.max(Xt-nt,er-mt),Pt=Pt!==0?32767/Pt:0}return ll(Be,Ve,K,nt,mt,Pt,0),Ve}function Fo(H,D,K,he,Ee){let Be;if(Ee===function(Ve,nt,mt,Pt){let Xt=0;for(let er=nt,br=mt-Pt;er0)for(let Ve=D;Ve=D;Ve-=he)Be=Kt(Ve/he|0,H[Ve],H[Ve+1],Be);return Be&&tt(Be,Be.next)&&(vr(Be),Be=Be.next),Be}function nc(H,D){if(!H)return H;D||(D=H);let K,he=H;do if(K=!1,he.steiner||!tt(he,he.next)&&Ue(he.prev,he,he.next)!==0)he=he.next;else{if(vr(he),he=D=he.prev,he===he.next)break;K=!0}while(K||he!==D);return D}function ll(H,D,K,he,Ee,Be,Ve){if(!H)return;!Ve&&Be&&function(mt,Pt,Xt,er){let br=mt;do br.z===0&&(br.z=W(br.x,br.y,Pt,Xt,er)),br.prevZ=br.prev,br.nextZ=br.next,br=br.next;while(br!==mt);br.prevZ.nextZ=null,br.prevZ=null,function(Rr){let jr,Yr=1;do{let ca,Ca=Rr;Rr=null;let un=null;for(jr=0;Ca;){jr++;let Ha=Ca,rn=0;for(let $n=0;$n0||Sn>0&&Ha;)rn!==0&&(Sn===0||!Ha||Ca.z<=Ha.z)?(ca=Ca,Ca=Ca.nextZ,rn--):(ca=Ha,Ha=Ha.nextZ,Sn--),un?un.nextZ=ca:Rr=ca,ca.prevZ=un,un=ca;Ca=Ha}un.nextZ=null,Yr*=2}while(jr>1)}(br)}(H,he,Ee,Be);let nt=H;for(;H.prev!==H.next;){const mt=H.prev,Pt=H.next;if(Be?qc(H,he,Ee,Be):Sl(H))D.push(mt.i,H.i,Pt.i),vr(H),H=Pt.next,nt=Pt.next;else if((H=Pt)===nt){Ve?Ve===1?ll(H=Hc(nc(H),D),D,K,he,Ee,Be,2):Ve===2&&ss(H,D,K,he,Ee,Be):ll(nc(H),D,K,he,Ee,Be,1);break}}}function Sl(H){const D=H.prev,K=H,he=H.next;if(Ue(D,K,he)>=0)return!1;const Ee=D.x,Be=K.x,Ve=he.x,nt=D.y,mt=K.y,Pt=he.y,Xt=EeBe?Ee>Ve?Ee:Ve:Be>Ve?Be:Ve,Rr=nt>mt?nt>Pt?nt:Pt:mt>Pt?mt:Pt;let jr=he.next;for(;jr!==D;){if(jr.x>=Xt&&jr.x<=br&&jr.y>=er&&jr.y<=Rr&&te(Ee,nt,Be,mt,Ve,Pt,jr.x,jr.y)&&Ue(jr.prev,jr,jr.next)>=0)return!1;jr=jr.next}return!0}function qc(H,D,K,he){const Ee=H.prev,Be=H,Ve=H.next;if(Ue(Ee,Be,Ve)>=0)return!1;const nt=Ee.x,mt=Be.x,Pt=Ve.x,Xt=Ee.y,er=Be.y,br=Ve.y,Rr=ntmt?nt>Pt?nt:Pt:mt>Pt?mt:Pt,ca=Xt>er?Xt>br?Xt:br:er>br?er:br,Ca=W(Rr,jr,D,K,he),un=W(Yr,ca,D,K,he);let Ha=H.prevZ,rn=H.nextZ;for(;Ha&&Ha.z>=Ca&&rn&&rn.z<=un;){if(Ha.x>=Rr&&Ha.x<=Yr&&Ha.y>=jr&&Ha.y<=ca&&Ha!==Ee&&Ha!==Ve&&te(nt,Xt,mt,er,Pt,br,Ha.x,Ha.y)&&Ue(Ha.prev,Ha,Ha.next)>=0||(Ha=Ha.prevZ,rn.x>=Rr&&rn.x<=Yr&&rn.y>=jr&&rn.y<=ca&&rn!==Ee&&rn!==Ve&&te(nt,Xt,mt,er,Pt,br,rn.x,rn.y)&&Ue(rn.prev,rn,rn.next)>=0))return!1;rn=rn.nextZ}for(;Ha&&Ha.z>=Ca;){if(Ha.x>=Rr&&Ha.x<=Yr&&Ha.y>=jr&&Ha.y<=ca&&Ha!==Ee&&Ha!==Ve&&te(nt,Xt,mt,er,Pt,br,Ha.x,Ha.y)&&Ue(Ha.prev,Ha,Ha.next)>=0)return!1;Ha=Ha.prevZ}for(;rn&&rn.z<=un;){if(rn.x>=Rr&&rn.x<=Yr&&rn.y>=jr&&rn.y<=ca&&rn!==Ee&&rn!==Ve&&te(nt,Xt,mt,er,Pt,br,rn.x,rn.y)&&Ue(rn.prev,rn,rn.next)>=0)return!1;rn=rn.nextZ}return!0}function Hc(H,D){let K=H;do{const he=K.prev,Ee=K.next.next;!tt(he,Ee)&&ft(he,K,K.next,Ee)&&It(he,Ee)&&It(Ee,he)&&(D.push(he.i,K.i,Ee.i),vr(K),vr(K.next),K=H=Ee),K=K.next}while(K!==H);return nc(K)}function ss(H,D,K,he,Ee,Be){let Ve=H;do{let nt=Ve.next.next;for(;nt!==Ve.prev;){if(Ve.i!==nt.i&&me(Ve,nt)){let mt=Jt(Ve,nt);return Ve=nc(Ve,Ve.next),mt=nc(mt,mt.next),ll(Ve,D,K,he,Ee,Be,0),void ll(mt,D,K,he,Ee,Be,0)}nt=nt.next}Ve=Ve.next}while(Ve!==H)}function js(H,D){return H.x-D.x}function ls(H,D){const K=function(Ee,Be){let Ve=Be;const nt=Ee.x,mt=Ee.y;let Pt,Xt=-1/0;do{if(mt<=Ve.y&&mt>=Ve.next.y&&Ve.next.y!==Ve.y){const Yr=Ve.x+(mt-Ve.y)*(Ve.next.x-Ve.x)/(Ve.next.y-Ve.y);if(Yr<=nt&&Yr>Xt&&(Xt=Yr,Pt=Ve.x=Ve.x&&Ve.x>=br&&nt!==Ve.x&&te(mtPt.x||Ve.x===Pt.x&&ye(Pt,Ve)))&&(Pt=Ve,jr=Yr)}Ve=Ve.next}while(Ve!==er);return Pt}(H,D);if(!K)return D;const he=Jt(K,H);return nc(he,he.next),nc(K,K.next)}function ye(H,D){return Ue(H.prev,H,D.prev)<0&&Ue(D.next,H,H.next)<0}function W(H,D,K,he,Ee){return(H=1431655765&((H=858993459&((H=252645135&((H=16711935&((H=(H-K)*Ee|0)|H<<8))|H<<4))|H<<2))|H<<1))|(D=1431655765&((D=858993459&((D=252645135&((D=16711935&((D=(D-he)*Ee|0)|D<<8))|D<<4))|D<<2))|D<<1))<<1}function de(H){let D=H,K=H;do(D.x=(H-Ve)*(Be-nt)&&(H-Ve)*(he-nt)>=(K-Ve)*(D-nt)&&(K-Ve)*(Be-nt)>=(Ee-Ve)*(he-nt)}function me(H,D){return H.next.i!==D.i&&H.prev.i!==D.i&&!function(K,he){let Ee=K;do{if(Ee.i!==K.i&&Ee.next.i!==K.i&&Ee.i!==he.i&&Ee.next.i!==he.i&&ft(Ee,Ee.next,K,he))return!0;Ee=Ee.next}while(Ee!==K);return!1}(H,D)&&(It(H,D)&&It(D,H)&&function(K,he){let Ee=K,Be=!1;const Ve=(K.x+he.x)/2,nt=(K.y+he.y)/2;do Ee.y>nt!=Ee.next.y>nt&&Ee.next.y!==Ee.y&&Ve<(Ee.next.x-Ee.x)*(nt-Ee.y)/(Ee.next.y-Ee.y)+Ee.x&&(Be=!Be),Ee=Ee.next;while(Ee!==K);return Be}(H,D)&&(Ue(H.prev,H,D.prev)||Ue(H,D.prev,D))||tt(H,D)&&Ue(H.prev,H,H.next)>0&&Ue(D.prev,D,D.next)>0)}function Ue(H,D,K){return(D.y-H.y)*(K.x-D.x)-(D.x-H.x)*(K.y-D.y)}function tt(H,D){return H.x===D.x&&H.y===D.y}function ft(H,D,K,he){const Ee=bt(Ue(H,D,K)),Be=bt(Ue(H,D,he)),Ve=bt(Ue(K,he,H)),nt=bt(Ue(K,he,D));return Ee!==Be&&Ve!==nt||!(Ee!==0||!st(H,K,D))||!(Be!==0||!st(H,he,D))||!(Ve!==0||!st(K,H,he))||!(nt!==0||!st(K,D,he))}function st(H,D,K){return D.x<=Math.max(H.x,K.x)&&D.x>=Math.min(H.x,K.x)&&D.y<=Math.max(H.y,K.y)&&D.y>=Math.min(H.y,K.y)}function bt(H){return H>0?1:H<0?-1:0}function It(H,D){return Ue(H.prev,H,H.next)<0?Ue(H,D,H.next)>=0&&Ue(H,H.prev,D)>=0:Ue(H,D,H.prev)<0||Ue(H,H.next,D)<0}function Jt(H,D){const K=Tr(H.i,H.x,H.y),he=Tr(D.i,D.x,D.y),Ee=H.next,Be=D.prev;return H.next=D,D.prev=H,K.next=Ee,Ee.prev=K,he.next=K,K.prev=he,Be.next=he,he.prev=Be,he}function Kt(H,D,K,he){const Ee=Tr(H,D,K);return he?(Ee.next=he.next,Ee.prev=he,he.next.prev=Ee,he.next=Ee):(Ee.prev=Ee,Ee.next=Ee),Ee}function vr(H){H.next.prev=H.prev,H.prev.next=H.next,H.prevZ&&(H.prevZ.nextZ=H.nextZ),H.nextZ&&(H.nextZ.prevZ=H.prevZ)}function Tr(H,D,K){return{i:H,x:D,y:K,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function wr(H,D,K){const he=K.patternDependencies;let Ee=!1;for(const Be of D){const Ve=Be.paint.get(`${H}-pattern`);Ve.isConstant()||(Ee=!0);const nt=Ve.constantOr(null);nt&&(Ee=!0,he[nt.to]=!0,he[nt.from]=!0)}return Ee}function tr(H,D,K,he,Ee){const Be=Ee.patternDependencies;for(const Ve of D){const nt=Ve.paint.get(`${H}-pattern`).value;if(nt.kind!=="constant"){let mt=nt.evaluate({zoom:he-1},K,{},Ee.availableImages),Pt=nt.evaluate({zoom:he},K,{},Ee.availableImages),Xt=nt.evaluate({zoom:he+1},K,{},Ee.availableImages);mt=mt&&mt.name?mt.name:mt,Pt=Pt&&Pt.name?Pt.name:Pt,Xt=Xt&&Xt.name?Xt.name:Xt,Be[mt]=!0,Be[Pt]=!0,Be[Xt]=!0,K.patterns[Ve.id]={min:mt,mid:Pt,max:Xt}}}return K}class pr{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(K=>K.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new vl,this.indexArray=new Dt,this.indexArray2=new $t,this.programConfigurations=new hs(D.layers,D.zoom),this.segments=new Vr,this.segments2=new Vr,this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,he){this.hasPattern=wr("fill",this.layers,K);const Ee=this.layers[0].layout.get("fill-sort-key"),Be=!Ee.isConstant(),Ve=[];for(const{feature:nt,id:mt,index:Pt,sourceLayerIndex:Xt}of D){const er=this.layers[0]._featureFilter.needGeometry,br=fa(nt,er);if(!this.layers[0]._featureFilter.filter(new Jo(this.zoom),br,he))continue;const Rr=Be?Ee.evaluate(br,{},he,K.availableImages):void 0,jr={id:mt,properties:nt.properties,type:nt.type,sourceLayerIndex:Xt,index:Pt,geometry:er?br.geometry:cr(nt),patterns:{},sortKey:Rr};Ve.push(jr)}Be&&Ve.sort((nt,mt)=>nt.sortKey-mt.sortKey);for(const nt of Ve){const{geometry:mt,index:Pt,sourceLayerIndex:Xt}=nt;if(this.hasPattern){const er=tr("fill",this.layers,nt,this.zoom,K);this.patternFeatures.push(er)}else this.addFeature(nt,mt,Pt,he,{});K.featureIndex.insert(D[Pt].feature,mt,Pt,Xt,this.index)}}update(D,K,he){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,he)}addFeatures(D,K,he){for(const Ee of this.patternFeatures)this.addFeature(Ee,Ee.geometry,Ee.index,K,he)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,su),this.indexBuffer=D.createIndexBuffer(this.indexArray),this.indexBuffer2=D.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(D,K,he,Ee,Be){for(const Ve of Lu(K,500)){let nt=0;for(const Rr of Ve)nt+=Rr.length;const mt=this.segments.prepareSegment(nt,this.layoutVertexArray,this.indexArray),Pt=mt.vertexLength,Xt=[],er=[];for(const Rr of Ve){if(Rr.length===0)continue;Rr!==Ve[0]&&er.push(Xt.length/2);const jr=this.segments2.prepareSegment(Rr.length,this.layoutVertexArray,this.indexArray2),Yr=jr.vertexLength;this.layoutVertexArray.emplaceBack(Rr[0].x,Rr[0].y),this.indexArray2.emplaceBack(Yr+Rr.length-1,Yr),Xt.push(Rr[0].x),Xt.push(Rr[0].y);for(let ca=1;ca>3}if(Ee--,he===1||he===2)Be+=H.readSVarint(),Ve+=H.readSVarint(),he===1&&(D&&nt.push(D),D=[]),D.push(new hn(Be,Ve));else{if(he!==7)throw new Error("unknown command "+he);D&&D.push(D[0].clone())}}return D&&nt.push(D),nt},fn.prototype.bbox=function(){var H=this._pbf;H.pos=this._geometry;for(var D=H.readVarint()+H.pos,K=1,he=0,Ee=0,Be=0,Ve=1/0,nt=-1/0,mt=1/0,Pt=-1/0;H.pos>3}if(he--,K===1||K===2)(Ee+=H.readSVarint())nt&&(nt=Ee),(Be+=H.readSVarint())Pt&&(Pt=Be);else if(K!==7)throw new Error("unknown command "+K)}return[Ve,mt,nt,Pt]},fn.prototype.toGeoJSON=function(H,D,K){var he,Ee,Be=this.extent*Math.pow(2,K),Ve=this.extent*H,nt=this.extent*D,mt=this.loadGeometry(),Pt=fn.types[this.type];function Xt(Rr){for(var jr=0;jr>3;Ee=Ve===1?he.readString():Ve===2?he.readFloat():Ve===3?he.readDouble():Ve===4?he.readVarint64():Ve===5?he.readVarint():Ve===6?he.readSVarint():Ve===7?he.readBoolean():null}return Ee}(K))}Io.prototype.feature=function(H){if(H<0||H>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[H];var D=this._pbf.readVarint()+this._pbf.pos;return new vi(this._pbf,D,this.extent,this._keys,this._values)};var vs=ai;function us(H,D,K){if(H===3){var he=new vs(K,K.readVarint()+K.pos);he.length&&(D[he.name]=he)}}an.VectorTile=function(H,D){this.layers=H.readFields(us,{},D)},an.VectorTileFeature=xn,an.VectorTileLayer=ai;const Ds=an.VectorTileFeature.types,rs=Math.pow(2,13);function ul(H,D,K,he,Ee,Be,Ve,nt){H.emplaceBack(D,K,2*Math.floor(he*rs)+Ve,Ee*rs*2,Be*rs*2,Math.round(nt))}class Uo{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(K=>K.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new Al,this.centroidVertexArray=new xo,this.indexArray=new Dt,this.programConfigurations=new hs(D.layers,D.zoom),this.segments=new Vr,this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,he){this.features=[],this.hasPattern=wr("fill-extrusion",this.layers,K);for(const{feature:Ee,id:Be,index:Ve,sourceLayerIndex:nt}of D){const mt=this.layers[0]._featureFilter.needGeometry,Pt=fa(Ee,mt);if(!this.layers[0]._featureFilter.filter(new Jo(this.zoom),Pt,he))continue;const Xt={id:Be,sourceLayerIndex:nt,index:Ve,geometry:mt?Pt.geometry:cr(Ee),properties:Ee.properties,type:Ee.type,patterns:{}};this.hasPattern?this.features.push(tr("fill-extrusion",this.layers,Xt,this.zoom,K)):this.addFeature(Xt,Xt.geometry,Ve,he,{}),K.featureIndex.insert(Ee,Xt.geometry,Ve,nt,this.index,!0)}}addFeatures(D,K,he){for(const Ee of this.features){const{geometry:Be}=Ee;this.addFeature(Ee,Be,Ee.index,K,he)}}update(D,K,he){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,he)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Ya),this.centroidVertexBuffer=D.createVertexBuffer(this.centroidVertexArray,Xa.members,!0),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(D,K,he,Ee,Be){for(const Ve of Lu(K,500)){const nt={x:0,y:0,vertexCount:0};let mt=0;for(const jr of Ve)mt+=jr.length;let Pt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const jr of Ve){if(jr.length===0||Fu(jr))continue;let Yr=0;for(let ca=0;ca=1){const un=jr[ca-1];if(!Vs(Ca,un)){Pt.vertexLength+4>Vr.MAX_VERTEX_ARRAY_LENGTH&&(Pt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ha=Ca.sub(un)._perp()._unit(),rn=un.dist(Ca);Yr+rn>32768&&(Yr=0),ul(this.layoutVertexArray,Ca.x,Ca.y,Ha.x,Ha.y,0,0,Yr),ul(this.layoutVertexArray,Ca.x,Ca.y,Ha.x,Ha.y,0,1,Yr),nt.x+=2*Ca.x,nt.y+=2*Ca.y,nt.vertexCount+=2,Yr+=rn,ul(this.layoutVertexArray,un.x,un.y,Ha.x,Ha.y,0,0,Yr),ul(this.layoutVertexArray,un.x,un.y,Ha.x,Ha.y,0,1,Yr),nt.x+=2*un.x,nt.y+=2*un.y,nt.vertexCount+=2;const Sn=Pt.vertexLength;this.indexArray.emplaceBack(Sn,Sn+2,Sn+1),this.indexArray.emplaceBack(Sn+1,Sn+2,Sn+3),Pt.vertexLength+=4,Pt.primitiveLength+=2}}}}if(Pt.vertexLength+mt>Vr.MAX_VERTEX_ARRAY_LENGTH&&(Pt=this.segments.prepareSegment(mt,this.layoutVertexArray,this.indexArray)),Ds[D.type]!=="Polygon")continue;const Xt=[],er=[],br=Pt.vertexLength;for(const jr of Ve)if(jr.length!==0){jr!==Ve[0]&&er.push(Xt.length/2);for(let Yr=0;Yr_s)||H.y===D.y&&(H.y<0||H.y>_s)}function Fu(H){return H.every(D=>D.x<0)||H.every(D=>D.x>_s)||H.every(D=>D.y<0)||H.every(D=>D.y>_s)}let fc;Wa("FillExtrusionBucket",Uo,{omit:["layers","features"]});var dh={get paint(){return fc=fc||new De({"fill-extrusion-opacity":new Vi(ie["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new eo(ie["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Vi(ie["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Vi(ie["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new qu(ie["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new eo(ie["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new eo(ie["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Vi(ie["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class ph extends ne{constructor(D){super(D,dh)}createBucket(D){return new Uo(D)}queryRadius(){return wn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(D,K,he,Ee,Be,Ve,nt,mt){const Pt=Tn(D,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Ve.angle,nt),Xt=this.paint.get("fill-extrusion-height").evaluate(K,he),er=this.paint.get("fill-extrusion-base").evaluate(K,he),br=function(jr,Yr,ca,Ca){const un=[];for(const Ha of jr){const rn=[Ha.x,Ha.y,0,1];gi(rn,rn,Yr),un.push(new i(rn[0]/rn[3],rn[1]/rn[3]))}return un}(Pt,mt),Rr=function(jr,Yr,ca,Ca){const un=[],Ha=[],rn=Ca[8]*Yr,Sn=Ca[9]*Yr,$n=Ca[10]*Yr,Oi=Ca[11]*Yr,qo=Ca[8]*ca,qi=Ca[9]*ca,Di=Ca[10]*ca,mo=Ca[11]*ca;for(const so of jr){const to=[],zn=[];for(const To of so){const _o=To.x,ts=To.y,Gl=Ca[0]*_o+Ca[4]*ts+Ca[12],Nl=Ca[1]*_o+Ca[5]*ts+Ca[13],Gc=Ca[2]*_o+Ca[6]*ts+Ca[14],ih=Ca[3]*_o+Ca[7]*ts+Ca[15],hc=Gc+$n,Rc=ih+Oi,Yf=Gl+qo,Kf=Nl+qi,Jf=Gc+Di,Ou=ih+mo,Wc=new i((Gl+rn)/Rc,(Nl+Sn)/Rc);Wc.z=hc/Rc,to.push(Wc);const Ff=new i(Yf/Ou,Kf/Ou);Ff.z=Jf/Ou,zn.push(Ff)}un.push(to),Ha.push(zn)}return[un,Ha]}(Ee,er,Xt,mt);return function(jr,Yr,ca){let Ca=1/0;Na(ca,Yr)&&(Ca=Mh(ca,Yr[0]));for(let un=0;unK.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(K=>{this.gradients[K.id]={}}),this.layoutVertexArray=new pu,this.layoutVertexArray2=new pe,this.indexArray=new Dt,this.programConfigurations=new hs(D.layers,D.zoom),this.segments=new Vr,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,he){this.hasPattern=wr("line",this.layers,K);const Ee=this.layers[0].layout.get("line-sort-key"),Be=!Ee.isConstant(),Ve=[];for(const{feature:nt,id:mt,index:Pt,sourceLayerIndex:Xt}of D){const er=this.layers[0]._featureFilter.needGeometry,br=fa(nt,er);if(!this.layers[0]._featureFilter.filter(new Jo(this.zoom),br,he))continue;const Rr=Be?Ee.evaluate(br,{},he):void 0,jr={id:mt,properties:nt.properties,type:nt.type,sourceLayerIndex:Xt,index:Pt,geometry:er?br.geometry:cr(nt),patterns:{},sortKey:Rr};Ve.push(jr)}Be&&Ve.sort((nt,mt)=>nt.sortKey-mt.sortKey);for(const nt of Ve){const{geometry:mt,index:Pt,sourceLayerIndex:Xt}=nt;if(this.hasPattern){const er=tr("line",this.layers,nt,this.zoom,K);this.patternFeatures.push(er)}else this.addFeature(nt,mt,Pt,he,{});K.featureIndex.insert(D[Pt].feature,mt,Pt,Xt,this.index)}}update(D,K,he){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,he)}addFeatures(D,K,he){for(const Ee of this.patternFeatures)this.addFeature(Ee,Ee.geometry,Ee.index,K,he)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=D.createVertexBuffer(this.layoutVertexArray2,Dh)),this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Rh),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(D){if(D.properties&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_end"))return{start:+D.properties.mapbox_clip_start,end:+D.properties.mapbox_clip_end}}addFeature(D,K,he,Ee,Be){const Ve=this.layers[0].layout,nt=Ve.get("line-join").evaluate(D,{}),mt=Ve.get("line-cap"),Pt=Ve.get("line-miter-limit"),Xt=Ve.get("line-round-limit");this.lineClips=this.lineFeatureClips(D);for(const er of K)this.addLine(er,D,nt,mt,Pt,Xt);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,he,Be,Ee)}addLine(D,K,he,Ee,Be,Ve){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Ca=0;Ca=2&&D[mt-1].equals(D[mt-2]);)mt--;let Pt=0;for(;Pt0;if(Oi&&Ca>Pt){const mo=br.dist(Rr);if(mo>2*Xt){const so=br.sub(br.sub(Rr)._mult(Xt/mo)._round());this.updateDistance(Rr,so),this.addCurrentVertex(so,Yr,0,0,er),Rr=so}}const qi=Rr&&jr;let Di=qi?he:nt?"butt":Ee;if(qi&&Di==="round"&&(SnBe&&(Di="bevel"),Di==="bevel"&&(Sn>2&&(Di="flipbevel"),Sn100)un=ca.mult(-1);else{const mo=Sn*Yr.add(ca).mag()/Yr.sub(ca).mag();un._perp()._mult(mo*(qo?-1:1))}this.addCurrentVertex(br,un,0,0,er),this.addCurrentVertex(br,un.mult(-1),0,0,er)}else if(Di==="bevel"||Di==="fakeround"){const mo=-Math.sqrt(Sn*Sn-1),so=qo?mo:0,to=qo?0:mo;if(Rr&&this.addCurrentVertex(br,Yr,so,to,er),Di==="fakeround"){const zn=Math.round(180*$n/Math.PI/20);for(let To=1;To2*Xt){const so=br.add(jr.sub(br)._mult(Xt/mo)._round());this.updateDistance(br,so),this.addCurrentVertex(so,ca,0,0,er),br=so}}}}addCurrentVertex(D,K,he,Ee,Be,Ve=!1){const nt=K.y*Ee-K.x,mt=-K.y-K.x*Ee;this.addHalfVertex(D,K.x+K.y*he,K.y-K.x*he,Ve,!1,he,Be),this.addHalfVertex(D,nt,mt,Ve,!0,-Ee,Be),this.distance>gh/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(D,K,he,Ee,Be,Ve))}addHalfVertex({x:D,y:K},he,Ee,Be,Ve,nt,mt){const Pt=.5*(this.lineClips?this.scaledDistance*(gh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((D<<1)+(Be?1:0),(K<<1)+(Ve?1:0),Math.round(63*he)+128,Math.round(63*Ee)+128,1+(nt===0?0:nt<0?-1:1)|(63&Pt)<<2,Pt>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const Xt=mt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Xt),mt.primitiveLength++),Ve?this.e2=Xt:this.e1=Xt}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(D,K){this.distance+=D.dist(K),this.updateScaledDistance()}}let yh,Zv;Wa("LineBucket",Eh,{omit:["layers","patternFeatures"]});var vv={get paint(){return Zv=Zv||new De({"line-opacity":new eo(ie.paint_line["line-opacity"]),"line-color":new eo(ie.paint_line["line-color"]),"line-translate":new Vi(ie.paint_line["line-translate"]),"line-translate-anchor":new Vi(ie.paint_line["line-translate-anchor"]),"line-width":new eo(ie.paint_line["line-width"]),"line-gap-width":new eo(ie.paint_line["line-gap-width"]),"line-offset":new eo(ie.paint_line["line-offset"]),"line-blur":new eo(ie.paint_line["line-blur"]),"line-dasharray":new Du(ie.paint_line["line-dasharray"]),"line-pattern":new qu(ie.paint_line["line-pattern"]),"line-gradient":new wc(ie.paint_line["line-gradient"])})},get layout(){return yh=yh||new De({"line-cap":new Vi(ie.layout_line["line-cap"]),"line-join":new eo(ie.layout_line["line-join"]),"line-miter-limit":new Vi(ie.layout_line["line-miter-limit"]),"line-round-limit":new Vi(ie.layout_line["line-round-limit"]),"line-sort-key":new eo(ie.layout_line["line-sort-key"])})}};class Pc extends eo{possiblyEvaluate(D,K){return K=new Jo(Math.floor(K.zoom),{now:K.now,fadeDuration:K.fadeDuration,zoomHistory:K.zoomHistory,transition:K.transition}),super.possiblyEvaluate(D,K)}evaluate(D,K,he,Ee){return K=M({},K,{zoom:Math.floor(K.zoom)}),super.evaluate(D,K,he,Ee)}}let dv;class Xv extends ne{constructor(D){super(D,vv),this.gradientVersion=0,dv||(dv=new Pc(vv.paint.properties["line-width"].specification),dv.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(D){if(D==="line-gradient"){const K=this.gradientExpression();this.stepInterpolant=!!function(he){return he._styleExpression!==void 0}(K)&&K._styleExpression.expression instanceof pa,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(D,K){super.recalculate(D,K),this.paint._values["line-floorwidth"]=dv.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,D)}createBucket(D){return new Eh(D)}queryRadius(D){const K=D,he=of(qa("line-width",this,K),qa("line-gap-width",this,K)),Ee=qa("line-offset",this,K);return he/2+Math.abs(Ee)+wn(this.paint.get("line-translate"))}queryIntersectsFeature(D,K,he,Ee,Be,Ve,nt){const mt=Tn(D,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Ve.angle,nt),Pt=nt/2*of(this.paint.get("line-width").evaluate(K,he),this.paint.get("line-gap-width").evaluate(K,he)),Xt=this.paint.get("line-offset").evaluate(K,he);return Xt&&(Ee=function(er,br){const Rr=[];for(let jr=0;jr=3){for(let ca=0;ca0?D+2*H:H}const kv=ot([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),pd=ot([{name:"a_projected_pos",components:3,type:"Float32"}],4);ot([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const gd=ot([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);ot([{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"}]);const Yv=ot([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Cv=ot([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Lv(H,D,K){return H.sections.forEach(he=>{he.text=function(Ee,Be,Ve){const nt=Be.layout.get("text-transform").evaluate(Ve,{});return nt==="uppercase"?Ee=Ee.toLocaleUpperCase():nt==="lowercase"&&(Ee=Ee.toLocaleLowerCase()),gs.applyArabicShaping&&(Ee=gs.applyArabicShaping(Ee)),Ee}(he.text,D,K)}),H}ot([{name:"triangle",components:3,type:"Uint16"}]),ot([{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"}]),ot([{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",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),ot([{type:"Float32",name:"offsetX"}]),ot([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ot([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const lu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var pl=24,zf=Ml,Kv=function(H,D,K,he,Ee){var Be,Ve,nt=8*Ee-he-1,mt=(1<>1,Xt=-7,er=Ee-1,br=-1,Rr=H[D+er];for(er+=br,Be=Rr&(1<<-Xt)-1,Rr>>=-Xt,Xt+=nt;Xt>0;Be=256*Be+H[D+er],er+=br,Xt-=8);for(Ve=Be&(1<<-Xt)-1,Be>>=-Xt,Xt+=he;Xt>0;Ve=256*Ve+H[D+er],er+=br,Xt-=8);if(Be===0)Be=1-Pt;else{if(Be===mt)return Ve?NaN:1/0*(Rr?-1:1);Ve+=Math.pow(2,he),Be-=Pt}return(Rr?-1:1)*Ve*Math.pow(2,Be-he)},yd=function(H,D,K,he,Ee,Be){var Ve,nt,mt,Pt=8*Be-Ee-1,Xt=(1<>1,br=Ee===23?Math.pow(2,-24)-Math.pow(2,-77):0,Rr=0,jr=1,Yr=D<0||D===0&&1/D<0?1:0;for(D=Math.abs(D),isNaN(D)||D===1/0?(nt=isNaN(D)?1:0,Ve=Xt):(Ve=Math.floor(Math.log(D)/Math.LN2),D*(mt=Math.pow(2,-Ve))<1&&(Ve--,mt*=2),(D+=Ve+er>=1?br/mt:br*Math.pow(2,1-er))*mt>=2&&(Ve++,mt/=2),Ve+er>=Xt?(nt=0,Ve=Xt):Ve+er>=1?(nt=(D*mt-1)*Math.pow(2,Ee),Ve+=er):(nt=D*Math.pow(2,er-1)*Math.pow(2,Ee),Ve=0));Ee>=8;H[K+Rr]=255&nt,Rr+=jr,nt/=256,Ee-=8);for(Ve=Ve<0;H[K+Rr]=255&Ve,Rr+=jr,Ve/=256,Pt-=8);H[K+Rr-jr]|=128*Yr};function Ml(H){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(H)?H:new Uint8Array(H||0),this.pos=0,this.type=0,this.length=this.buf.length}Ml.Varint=0,Ml.Fixed64=1,Ml.Bytes=2,Ml.Fixed32=5;var cp=4294967296,Pv=1/cp,$p=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function mh(H){return H.type===Ml.Bytes?H.readVarint()+H.pos:H.pos+1}function Iv(H,D,K){return K?4294967296*D+(H>>>0):4294967296*(D>>>0)+(H>>>0)}function Qp(H,D,K){var he=D<=16383?1:D<=2097151?2:D<=268435455?3:Math.floor(Math.log(D)/(7*Math.LN2));K.realloc(he);for(var Ee=K.pos-1;Ee>=H;Ee--)K.buf[Ee+he]=K.buf[Ee]}function fp(H,D){for(var K=0;K>>8,H[K+2]=D>>>16,H[K+3]=D>>>24}function Qy(H,D){return(H[D]|H[D+1]<<8|H[D+2]<<16)+(H[D+3]<<24)}Ml.prototype={destroy:function(){this.buf=null},readFields:function(H,D,K){for(K=K||this.length;this.pos>3,Be=this.pos;this.type=7&he,H(Ee,D,this),this.pos===Be&&this.skip(he)}return D},readMessage:function(H,D){return this.readFields(H,D,this.readVarint()+this.pos)},readFixed32:function(){var H=t0(this.buf,this.pos);return this.pos+=4,H},readSFixed32:function(){var H=Qy(this.buf,this.pos);return this.pos+=4,H},readFixed64:function(){var H=t0(this.buf,this.pos)+t0(this.buf,this.pos+4)*cp;return this.pos+=8,H},readSFixed64:function(){var H=t0(this.buf,this.pos)+Qy(this.buf,this.pos+4)*cp;return this.pos+=8,H},readFloat:function(){var H=Kv(this.buf,this.pos,!0,23,4);return this.pos+=4,H},readDouble:function(){var H=Kv(this.buf,this.pos,!0,52,8);return this.pos+=8,H},readVarint:function(H){var D,K,he=this.buf;return D=127&(K=he[this.pos++]),K<128?D:(D|=(127&(K=he[this.pos++]))<<7,K<128?D:(D|=(127&(K=he[this.pos++]))<<14,K<128?D:(D|=(127&(K=he[this.pos++]))<<21,K<128?D:function(Ee,Be,Ve){var nt,mt,Pt=Ve.buf;if(nt=(112&(mt=Pt[Ve.pos++]))>>4,mt<128||(nt|=(127&(mt=Pt[Ve.pos++]))<<3,mt<128)||(nt|=(127&(mt=Pt[Ve.pos++]))<<10,mt<128)||(nt|=(127&(mt=Pt[Ve.pos++]))<<17,mt<128)||(nt|=(127&(mt=Pt[Ve.pos++]))<<24,mt<128)||(nt|=(1&(mt=Pt[Ve.pos++]))<<31,mt<128))return Iv(Ee,nt,Be);throw new Error("Expected varint not more than 10 bytes")}(D|=(15&(K=he[this.pos]))<<28,H,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var H=this.readVarint();return H%2==1?(H+1)/-2:H/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var H=this.readVarint()+this.pos,D=this.pos;return this.pos=H,H-D>=12&&$p?function(K,he,Ee){return $p.decode(K.subarray(he,Ee))}(this.buf,D,H):function(K,he,Ee){for(var Be="",Ve=he;Ve239?4:Xt>223?3:Xt>191?2:1;if(Ve+br>Ee)break;br===1?Xt<128&&(er=Xt):br===2?(192&(nt=K[Ve+1]))==128&&(er=(31&Xt)<<6|63&nt)<=127&&(er=null):br===3?(mt=K[Ve+2],(192&(nt=K[Ve+1]))==128&&(192&mt)==128&&((er=(15&Xt)<<12|(63&nt)<<6|63&mt)<=2047||er>=55296&&er<=57343)&&(er=null)):br===4&&(mt=K[Ve+2],Pt=K[Ve+3],(192&(nt=K[Ve+1]))==128&&(192&mt)==128&&(192&Pt)==128&&((er=(15&Xt)<<18|(63&nt)<<12|(63&mt)<<6|63&Pt)<=65535||er>=1114112)&&(er=null)),er===null?(er=65533,br=1):er>65535&&(er-=65536,Be+=String.fromCharCode(er>>>10&1023|55296),er=56320|1023&er),Be+=String.fromCharCode(er),Ve+=br}return Be}(this.buf,D,H)},readBytes:function(){var H=this.readVarint()+this.pos,D=this.buf.subarray(this.pos,H);return this.pos=H,D},readPackedVarint:function(H,D){if(this.type!==Ml.Bytes)return H.push(this.readVarint(D));var K=mh(this);for(H=H||[];this.pos127;);else if(D===Ml.Bytes)this.pos=this.readVarint()+this.pos;else if(D===Ml.Fixed32)this.pos+=4;else{if(D!==Ml.Fixed64)throw new Error("Unimplemented type: "+D);this.pos+=8}},writeTag:function(H,D){this.writeVarint(H<<3|D)},realloc:function(H){for(var D=this.length||16;D268435455||H<0?function(D,K){var he,Ee;if(D>=0?(he=D%4294967296|0,Ee=D/4294967296|0):(Ee=~(-D/4294967296),4294967295^(he=~(-D%4294967296))?he=he+1|0:(he=0,Ee=Ee+1|0)),D>=18446744073709552e3||D<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");K.realloc(10),function(Be,Ve,nt){nt.buf[nt.pos++]=127&Be|128,Be>>>=7,nt.buf[nt.pos++]=127&Be|128,Be>>>=7,nt.buf[nt.pos++]=127&Be|128,Be>>>=7,nt.buf[nt.pos++]=127&Be|128,nt.buf[nt.pos]=127&(Be>>>=7)}(he,0,K),function(Be,Ve){var nt=(7&Be)<<4;Ve.buf[Ve.pos++]|=nt|((Be>>>=3)?128:0),Be&&(Ve.buf[Ve.pos++]=127&Be|((Be>>>=7)?128:0),Be&&(Ve.buf[Ve.pos++]=127&Be|((Be>>>=7)?128:0),Be&&(Ve.buf[Ve.pos++]=127&Be|((Be>>>=7)?128:0),Be&&(Ve.buf[Ve.pos++]=127&Be|((Be>>>=7)?128:0),Be&&(Ve.buf[Ve.pos++]=127&Be)))))}(Ee,K)}(H,this):(this.realloc(4),this.buf[this.pos++]=127&H|(H>127?128:0),H<=127||(this.buf[this.pos++]=127&(H>>>=7)|(H>127?128:0),H<=127||(this.buf[this.pos++]=127&(H>>>=7)|(H>127?128:0),H<=127||(this.buf[this.pos++]=H>>>7&127))))},writeSVarint:function(H){this.writeVarint(H<0?2*-H-1:2*H)},writeBoolean:function(H){this.writeVarint(!!H)},writeString:function(H){H=String(H),this.realloc(4*H.length),this.pos++;var D=this.pos;this.pos=function(he,Ee,Be){for(var Ve,nt,mt=0;mt55295&&Ve<57344){if(!nt){Ve>56319||mt+1===Ee.length?(he[Be++]=239,he[Be++]=191,he[Be++]=189):nt=Ve;continue}if(Ve<56320){he[Be++]=239,he[Be++]=191,he[Be++]=189,nt=Ve;continue}Ve=nt-55296<<10|Ve-56320|65536,nt=null}else nt&&(he[Be++]=239,he[Be++]=191,he[Be++]=189,nt=null);Ve<128?he[Be++]=Ve:(Ve<2048?he[Be++]=Ve>>6|192:(Ve<65536?he[Be++]=Ve>>12|224:(he[Be++]=Ve>>18|240,he[Be++]=Ve>>12&63|128),he[Be++]=Ve>>6&63|128),he[Be++]=63&Ve|128)}return Be}(this.buf,H,this.pos);var K=this.pos-D;K>=128&&Qp(D,K,this),this.pos=D-1,this.writeVarint(K),this.pos+=K},writeFloat:function(H){this.realloc(4),yd(this.buf,H,this.pos,!0,23,4),this.pos+=4},writeDouble:function(H){this.realloc(8),yd(this.buf,H,this.pos,!0,52,8),this.pos+=8},writeBytes:function(H){var D=H.length;this.writeVarint(D),this.realloc(D);for(var K=0;K=128&&Qp(K,he,this),this.pos=K-1,this.writeVarint(he),this.pos+=he},writeMessage:function(H,D,K){this.writeTag(H,Ml.Bytes),this.writeRawMessage(D,K)},writePackedVarint:function(H,D){D.length&&this.writeMessage(H,fp,D)},writePackedSVarint:function(H,D){D.length&&this.writeMessage(H,Tx,D)},writePackedBoolean:function(H,D){D.length&&this.writeMessage(H,Mx,D)},writePackedFloat:function(H,D){D.length&&this.writeMessage(H,Ax,D)},writePackedDouble:function(H,D){D.length&&this.writeMessage(H,Sx,D)},writePackedFixed32:function(H,D){D.length&&this.writeMessage(H,Ex,D)},writePackedSFixed32:function(H,D){D.length&&this.writeMessage(H,kx,D)},writePackedFixed64:function(H,D){D.length&&this.writeMessage(H,Cx,D)},writePackedSFixed64:function(H,D){D.length&&this.writeMessage(H,e0,D)},writeBytesField:function(H,D){this.writeTag(H,Ml.Bytes),this.writeBytes(D)},writeFixed32Field:function(H,D){this.writeTag(H,Ml.Fixed32),this.writeFixed32(D)},writeSFixed32Field:function(H,D){this.writeTag(H,Ml.Fixed32),this.writeSFixed32(D)},writeFixed64Field:function(H,D){this.writeTag(H,Ml.Fixed64),this.writeFixed64(D)},writeSFixed64Field:function(H,D){this.writeTag(H,Ml.Fixed64),this.writeSFixed64(D)},writeVarintField:function(H,D){this.writeTag(H,Ml.Varint),this.writeVarint(D)},writeSVarintField:function(H,D){this.writeTag(H,Ml.Varint),this.writeSVarint(D)},writeStringField:function(H,D){this.writeTag(H,Ml.Bytes),this.writeString(D)},writeFloatField:function(H,D){this.writeTag(H,Ml.Fixed32),this.writeFloat(D)},writeDoubleField:function(H,D){this.writeTag(H,Ml.Fixed64),this.writeDouble(D)},writeBooleanField:function(H,D){this.writeVarintField(H,!!D)}};var hg=r(zf);const r0=3;function Lx(H,D,K){H===1&&K.readMessage(em,D)}function em(H,D,K){if(H===3){const{id:he,bitmap:Ee,width:Be,height:Ve,left:nt,top:mt,advance:Pt}=K.readMessage(vg,{});D.push({id:he,bitmap:new xs({width:Be+2*r0,height:Ve+2*r0},Ee),metrics:{width:Be,height:Ve,left:nt,top:mt,advance:Pt}})}}function vg(H,D,K){H===1?D.id=K.readVarint():H===2?D.bitmap=K.readBytes():H===3?D.width=K.readVarint():H===4?D.height=K.readVarint():H===5?D.left=K.readSVarint():H===6?D.top=K.readSVarint():H===7&&(D.advance=K.readVarint())}const dg=r0;function a0(H){let D=0,K=0;for(const Ve of H)D+=Ve.w*Ve.h,K=Math.max(K,Ve.w);H.sort((Ve,nt)=>nt.h-Ve.h);const he=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(D/.95)),K),h:1/0}];let Ee=0,Be=0;for(const Ve of H)for(let nt=he.length-1;nt>=0;nt--){const mt=he[nt];if(!(Ve.w>mt.w||Ve.h>mt.h)){if(Ve.x=mt.x,Ve.y=mt.y,Be=Math.max(Be,Ve.y+Ve.h),Ee=Math.max(Ee,Ve.x+Ve.w),Ve.w===mt.w&&Ve.h===mt.h){const Pt=he.pop();nt=0&&he>=D&&i0[this.text.charCodeAt(he)];he--)K--;this.text=this.text.substring(D,K),this.sectionIndex=this.sectionIndex.slice(D,K)}substring(D,K){const he=new xd;return he.text=this.text.substring(D,K),he.sectionIndex=this.sectionIndex.slice(D,K),he.sections=this.sections,he}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((D,K)=>Math.max(D,this.sections[K].scale),0)}addTextSection(D,K){this.text+=D.text,this.sections.push(hp.forText(D.scale,D.fontStack||K));const he=this.sections.length-1;for(let Ee=0;Ee=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function n0(H,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr){const Yr=xd.fromFeature(H,Ee);let ca;er===e.ah.vertical&&Yr.verticalizePunctuation();const{processBidirectionalText:Ca,processStyledBidirectionalText:un}=gs;if(Ca&&Yr.sections.length===1){ca=[];const Sn=Ca(Yr.toString(),Jv(Yr,Pt,Be,D,he,Rr));for(const $n of Sn){const Oi=new xd;Oi.text=$n,Oi.sections=Yr.sections;for(let qo=0;qo<$n.length;qo++)Oi.sectionIndex.push(0);ca.push(Oi)}}else if(un){ca=[];const Sn=un(Yr.text,Yr.sectionIndex,Jv(Yr,Pt,Be,D,he,Rr));for(const $n of Sn){const Oi=new xd;Oi.text=$n[0],Oi.sectionIndex=$n[1],Oi.sections=Yr.sections,ca.push(Oi)}}else ca=function(Sn,$n){const Oi=[],qo=Sn.text;let qi=0;for(const Di of $n)Oi.push(Sn.substring(qi,Di)),qi=Di;return qi0&&Fh>lf&&(lf=Fh)}else{const Wl=Oi[tl.fontStack],uf=Wl&&Wl[Ll];if(uf&&uf.rect)Cd=uf.rect,cu=uf.metrics;else{const Fh=$n[tl.fontStack],bh=Fh&&Fh[Ll];if(!bh)continue;cu=bh.metrics}ku=(Wc-tl.scale)*pl}Of?(Sn.verticalizable=!0,$f.push({glyph:Ll,imageName:jh,x:ts,y:Gl+ku,vertical:Of,scale:tl.scale,fontStack:tl.fontStack,sectionIndex:El,metrics:cu,rect:Cd}),ts+=Vh*tl.scale+zn):($f.push({glyph:Ll,imageName:jh,x:ts,y:Gl+ku,vertical:Of,scale:tl.scale,fontStack:tl.fontStack,sectionIndex:El,metrics:cu,rect:Cd}),ts+=cu.advance*tl.scale+zn)}$f.length!==0&&(Nl=Math.max(ts-zn,Nl),Rx($f,0,$f.length-1,ih,lf)),ts=0;const xh=Di*Wc+lf;Tf.lineOffset=Math.max(lf,Ff),Gl+=xh,Gc=Math.max(xh,Gc),++hc}var Rc;const Yf=Gl-_d,{horizontalAlign:Kf,verticalAlign:Jf}=gg(mo);(function(Ou,Wc,Ff,Tf,$f,lf,xh,uu,tl){const El=(Wc-Ff)*$f;let Ll=0;Ll=lf!==xh?-uu*Tf-_d:(-Tf*tl+.5)*xh;for(const ku of Ou)for(const cu of ku.positionedGlyphs)cu.x+=El,cu.y+=Ll})(Sn.positionedLines,ih,Kf,Jf,Nl,Gc,Di,Yf,qi.length),Sn.top+=-Jf*Yf,Sn.bottom=Sn.top+Yf,Sn.left+=-Kf*Nl,Sn.right=Sn.left+Nl}(rn,D,K,he,ca,Ve,nt,mt,er,Pt,br,jr),!function(Sn){for(const $n of Sn)if($n.positionedGlyphs.length!==0)return!1;return!0}(Ha)&&rn}const i0={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Px={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Ix={40:!0};function o0(H,D,K,he,Ee,Be){if(D.imageName){const Ve=he[D.imageName];return Ve?Ve.displaySize[0]*D.scale*pl/Be+Ee:0}{const Ve=K[D.fontStack],nt=Ve&&Ve[H];return nt?nt.metrics.advance*D.scale+Ee:0}}function rm(H,D,K,he){const Ee=Math.pow(H-D,2);return he?H=0;let Pt=0;for(let er=0;erPt){const Xt=Math.ceil(Be/Pt);Ee*=Xt/Ve,Ve=Xt}return{x1:he,y1:Ee,x2:he+Be,y2:Ee+Ve}}function nm(H,D,K,he,Ee,Be){const Ve=H.image;let nt;if(Ve.content){const ca=Ve.content,Ca=Ve.pixelRatio||1;nt=[ca[0]/Ca,ca[1]/Ca,Ve.displaySize[0]-ca[2]/Ca,Ve.displaySize[1]-ca[3]/Ca]}const mt=D.left*Be,Pt=D.right*Be;let Xt,er,br,Rr;K==="width"||K==="both"?(Rr=Ee[0]+mt-he[3],er=Ee[0]+Pt+he[1]):(Rr=Ee[0]+(mt+Pt-Ve.displaySize[0])/2,er=Rr+Ve.displaySize[0]);const jr=D.top*Be,Yr=D.bottom*Be;return K==="height"||K==="both"?(Xt=Ee[1]+jr-he[0],br=Ee[1]+Yr+he[2]):(Xt=Ee[1]+(jr+Yr-Ve.displaySize[1])/2,br=Xt+Ve.displaySize[1]),{image:Ve,top:Xt,right:er,bottom:br,left:Rr,collisionPadding:nt}}const vp=255,$h=128,Dv=vp*$h;function im(H,D){const{expression:K}=D;if(K.kind==="constant")return{kind:"constant",layoutSize:K.evaluate(new Jo(H+1))};if(K.kind==="source")return{kind:"source"};{const{zoomStops:he,interpolationType:Ee}=K;let Be=0;for(;BeVe.id),this.index=D.index,this.pixelRatio=D.pixelRatio,this.sourceLayerIndex=D.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Cn([]),this.placementViewportMatrix=Cn([]);const K=this.layers[0]._unevaluatedLayout._values;this.textSizeData=im(this.zoom,K["text-size"]),this.iconSizeData=im(this.zoom,K["icon-size"]);const he=this.layers[0].layout,Ee=he.get("symbol-sort-key"),Be=he.get("symbol-z-order");this.canOverlap=yg(he,"text-overlap","text-allow-overlap")!=="never"||yg(he,"icon-overlap","icon-allow-overlap")!=="never"||he.get("text-ignore-placement")||he.get("icon-ignore-placement"),this.sortFeaturesByKey=Be!=="viewport-y"&&!Ee.isConstant(),this.sortFeaturesByY=(Be==="viewport-y"||Be==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,he.get("symbol-placement")==="point"&&(this.writingModes=he.get("text-writing-mode").map(Ve=>e.ah[Ve])),this.stateDependentLayerIds=this.layers.filter(Ve=>Ve.isStateDependent()).map(Ve=>Ve.id),this.sourceID=D.sourceID}createArrays(){this.text=new Hu(new hs(this.layers,this.zoom,D=>/^text/.test(D))),this.icon=new Hu(new hs(this.layers,this.zoom,D=>/^icon/.test(D))),this.glyphOffsetArray=new Bo,this.lineVertexArray=new No,this.symbolInstances=new Gi,this.textAnchorOffsets=new Zo}calculateGlyphDependencies(D,K,he,Ee,Be){for(let Ve=0;Ve0)&&(Ve.value.kind!=="constant"||Ve.value.value.length>0),Xt=mt.value.kind!=="constant"||!!mt.value.value||Object.keys(mt.parameters).length>0,er=Be.get("symbol-sort-key");if(this.features=[],!Pt&&!Xt)return;const br=K.iconDependencies,Rr=K.glyphDependencies,jr=K.availableImages,Yr=new Jo(this.zoom);for(const{feature:ca,id:Ca,index:un,sourceLayerIndex:Ha}of D){const rn=Ee._featureFilter.needGeometry,Sn=fa(ca,rn);if(!Ee._featureFilter.filter(Yr,Sn,he))continue;let $n,Oi;if(rn||(Sn.geometry=cr(ca)),Pt){const qi=Ee.getValueAndResolveTokens("text-field",Sn,he,jr),Di=na.factory(qi),mo=this.hasRTLText=this.hasRTLText||Fx(Di);(!mo||gs.getRTLTextPluginStatus()==="unavailable"||mo&&gs.isParsed())&&($n=Lv(Di,Ee,Sn))}if(Xt){const qi=Ee.getValueAndResolveTokens("icon-image",Sn,he,jr);Oi=qi instanceof Pa?qi:Pa.fromString(qi)}if(!$n&&!Oi)continue;const qo=this.sortFeaturesByKey?er.evaluate(Sn,{},he):void 0;if(this.features.push({id:Ca,text:$n,icon:Oi,index:un,sourceLayerIndex:Ha,geometry:Sn.geometry,properties:ca.properties,type:zx[ca.type],sortKey:qo}),Oi&&(br[Oi.name]=!0),$n){const qi=Ve.evaluate(Sn,{},he).join(","),Di=Be.get("text-rotation-alignment")!=="viewport"&&Be.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(const mo of $n.sections)if(mo.image)br[mo.image.name]=!0;else{const so=Ki($n.toString()),to=mo.fontStack||qi,zn=Rr[to]=Rr[to]||{};this.calculateGlyphDependencies(mo.text,zn,Di,this.allowVerticalPlacement,so)}}}Be.get("symbol-placement")==="line"&&(this.features=function(ca){const Ca={},un={},Ha=[];let rn=0;function Sn(qi){Ha.push(ca[qi]),rn++}function $n(qi,Di,mo){const so=un[qi];return delete un[qi],un[Di]=so,Ha[so].geometry[0].pop(),Ha[so].geometry[0]=Ha[so].geometry[0].concat(mo[0]),so}function Oi(qi,Di,mo){const so=Ca[Di];return delete Ca[Di],Ca[qi]=so,Ha[so].geometry[0].shift(),Ha[so].geometry[0]=mo[0].concat(Ha[so].geometry[0]),so}function qo(qi,Di,mo){const so=mo?Di[0][Di[0].length-1]:Di[0][0];return`${qi}:${so.x}:${so.y}`}for(let qi=0;qiqi.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((ca,Ca)=>ca.sortKey-Ca.sortKey)}update(D,K,he){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(D,K,this.layers,he),this.icon.programConfigurations.updatePaintArrays(D,K,this.layers,he))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(D){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(D),this.iconCollisionBox.upload(D)),this.text.upload(D,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(D,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(D,K){const he=this.lineVertexArray.length;if(D.segment!==void 0){let Ee=D.dist(K[D.segment+1]),Be=D.dist(K[D.segment]);const Ve={};for(let nt=D.segment+1;nt=0;nt--)Ve[nt]={x:K[nt].x,y:K[nt].y,tileUnitDistanceFromAnchor:Be},nt>0&&(Be+=K[nt-1].dist(K[nt]));for(let nt=0;nt0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(D,K){const he=D.placedSymbolArray.get(K),Ee=he.vertexStartIndex+4*he.numGlyphs;for(let Be=he.vertexStartIndex;BeEe[nt]-Ee[mt]||Be[mt]-Be[nt]),Ve}addToSortKeyRanges(D,K){const he=this.sortKeyRanges[this.sortKeyRanges.length-1];he&&he.sortKey===K?he.symbolInstanceEnd=D+1:this.sortKeyRanges.push({sortKey:K,symbolInstanceStart:D,symbolInstanceEnd:D+1})}sortFeatures(D){if(this.sortFeaturesByY&&this.sortedAngle!==D&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(D),this.sortedAngle=D,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const K of this.symbolInstanceIndexes){const he=this.symbolInstances.get(K);this.featureSortOrder.push(he.featureIndex),[he.rightJustifiedTextSymbolIndex,he.centerJustifiedTextSymbolIndex,he.leftJustifiedTextSymbolIndex].forEach((Ee,Be,Ve)=>{Ee>=0&&Ve.indexOf(Ee)===Be&&this.addIndicesForPlacedSymbol(this.text,Ee)}),he.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,he.verticalPlacedTextSymbolIndex),he.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,he.placedIconSymbolIndex),he.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,he.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let dp,pp;Wa("SymbolBucket",$v,{omit:["layers","collisionBoxArray","features","compareText"]}),$v.MAX_GLYPHS=65535,$v.addDynamicAttributes=zv;var _g={get paint(){return pp=pp||new De({"icon-opacity":new eo(ie.paint_symbol["icon-opacity"]),"icon-color":new eo(ie.paint_symbol["icon-color"]),"icon-halo-color":new eo(ie.paint_symbol["icon-halo-color"]),"icon-halo-width":new eo(ie.paint_symbol["icon-halo-width"]),"icon-halo-blur":new eo(ie.paint_symbol["icon-halo-blur"]),"icon-translate":new Vi(ie.paint_symbol["icon-translate"]),"icon-translate-anchor":new Vi(ie.paint_symbol["icon-translate-anchor"]),"text-opacity":new eo(ie.paint_symbol["text-opacity"]),"text-color":new eo(ie.paint_symbol["text-color"],{runtimeType:Rt,getOverride:H=>H.textColor,hasOverride:H=>!!H.textColor}),"text-halo-color":new eo(ie.paint_symbol["text-halo-color"]),"text-halo-width":new eo(ie.paint_symbol["text-halo-width"]),"text-halo-blur":new eo(ie.paint_symbol["text-halo-blur"]),"text-translate":new Vi(ie.paint_symbol["text-translate"]),"text-translate-anchor":new Vi(ie.paint_symbol["text-translate-anchor"])})},get layout(){return dp=dp||new De({"symbol-placement":new Vi(ie.layout_symbol["symbol-placement"]),"symbol-spacing":new Vi(ie.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Vi(ie.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new eo(ie.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Vi(ie.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Vi(ie.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Vi(ie.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Vi(ie.layout_symbol["icon-ignore-placement"]),"icon-optional":new Vi(ie.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Vi(ie.layout_symbol["icon-rotation-alignment"]),"icon-size":new eo(ie.layout_symbol["icon-size"]),"icon-text-fit":new Vi(ie.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Vi(ie.layout_symbol["icon-text-fit-padding"]),"icon-image":new eo(ie.layout_symbol["icon-image"]),"icon-rotate":new eo(ie.layout_symbol["icon-rotate"]),"icon-padding":new eo(ie.layout_symbol["icon-padding"]),"icon-keep-upright":new Vi(ie.layout_symbol["icon-keep-upright"]),"icon-offset":new eo(ie.layout_symbol["icon-offset"]),"icon-anchor":new eo(ie.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Vi(ie.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Vi(ie.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Vi(ie.layout_symbol["text-rotation-alignment"]),"text-field":new eo(ie.layout_symbol["text-field"]),"text-font":new eo(ie.layout_symbol["text-font"]),"text-size":new eo(ie.layout_symbol["text-size"]),"text-max-width":new eo(ie.layout_symbol["text-max-width"]),"text-line-height":new Vi(ie.layout_symbol["text-line-height"]),"text-letter-spacing":new eo(ie.layout_symbol["text-letter-spacing"]),"text-justify":new eo(ie.layout_symbol["text-justify"]),"text-radial-offset":new eo(ie.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Vi(ie.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new eo(ie.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new eo(ie.layout_symbol["text-anchor"]),"text-max-angle":new Vi(ie.layout_symbol["text-max-angle"]),"text-writing-mode":new Vi(ie.layout_symbol["text-writing-mode"]),"text-rotate":new eo(ie.layout_symbol["text-rotate"]),"text-padding":new Vi(ie.layout_symbol["text-padding"]),"text-keep-upright":new Vi(ie.layout_symbol["text-keep-upright"]),"text-transform":new eo(ie.layout_symbol["text-transform"]),"text-offset":new eo(ie.layout_symbol["text-offset"]),"text-allow-overlap":new Vi(ie.layout_symbol["text-allow-overlap"]),"text-overlap":new Vi(ie.layout_symbol["text-overlap"]),"text-ignore-placement":new Vi(ie.layout_symbol["text-ignore-placement"]),"text-optional":new Vi(ie.layout_symbol["text-optional"])})}};class wd{constructor(D){if(D.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=D.property.overrides?D.property.overrides.runtimeType:rt,this.defaultValue=D}evaluate(D){if(D.formattedSection){const K=this.defaultValue.property.overrides;if(K&&K.hasOverride(D.formattedSection))return K.getOverride(D.formattedSection)}return D.feature&&D.featureState?this.defaultValue.evaluate(D.feature,D.featureState):this.defaultValue.property.specification.default}eachChild(D){this.defaultValue.isConstant()||D(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Wa("FormatSectionOverride",wd,{omit:["defaultValue"]});class u0 extends ne{constructor(D){super(D,_g)}recalculate(D,K){if(super.recalculate(D,K),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),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"){const he=this.layout.get("text-writing-mode");if(he){const Ee=[];for(const Be of he)Ee.indexOf(Be)<0&&Ee.push(Be);this.layout._values["text-writing-mode"]=Ee}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(D,K,he,Ee){const Be=this.layout.get(D).evaluate(K,{},he,Ee),Ve=this._unevaluatedLayout._values[D];return Ve.isDataDriven()||Uu(Ve.value)||!Be?Be:function(nt,mt){return mt.replace(/{([^{}]+)}/g,(Pt,Xt)=>nt&&Xt in nt?String(nt[Xt]):"")}(K.properties,Be)}createBucket(D){return new $v(D)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const D of _g.paint.overridableProperties){if(!u0.hasPaintOverride(this.layout,D))continue;const K=this.paint.get(D),he=new wd(K),Ee=new ru(he,K.property.specification);let Be=null;Be=K.value.kind==="constant"||K.value.kind==="source"?new Qu("source",Ee):new Tu("composite",Ee,K.value.zoomStops),this.paint._values[D]=new ol(K.property,Be,K.parameters)}}_handleOverridablePaintPropertyUpdate(D,K,he){return!(!this.layout||K.isDataDriven()||he.isDataDriven())&&u0.hasPaintOverride(this.layout,D)}static hasPaintOverride(D,K){const he=D.get("text-field"),Ee=_g.paint.properties[K];let Be=!1;const Ve=nt=>{for(const mt of nt)if(Ee.overrides&&Ee.overrides.hasOverride(mt))return void(Be=!0)};if(he.value.kind==="constant"&&he.value.value instanceof na)Ve(he.value.value.sections);else if(he.value.kind==="source"){const nt=Pt=>{Be||(Pt instanceof Lr&&dt(Pt.value)===Mr?Ve(Pt.value.sections):Pt instanceof bs?Ve(Pt.sections):Pt.eachChild(nt))},mt=he.value;mt._styleExpression&&nt(mt._styleExpression.expression)}return Be}}let xg;var om={get paint(){return xg=xg||new De({"background-color":new Vi(ie.paint_background["background-color"]),"background-pattern":new Du(ie.paint_background["background-pattern"]),"background-opacity":new Vi(ie.paint_background["background-opacity"])})}};class gp extends ne{constructor(D){super(D,om)}}let c0;var bg={get paint(){return c0=c0||new De({"raster-opacity":new Vi(ie.paint_raster["raster-opacity"]),"raster-hue-rotate":new Vi(ie.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Vi(ie.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Vi(ie.paint_raster["raster-brightness-max"]),"raster-saturation":new Vi(ie.paint_raster["raster-saturation"]),"raster-contrast":new Vi(ie.paint_raster["raster-contrast"]),"raster-resampling":new Vi(ie.paint_raster["raster-resampling"]),"raster-fade-duration":new Vi(ie.paint_raster["raster-fade-duration"])})}};class Ox extends ne{constructor(D){super(D,bg)}}class sm extends ne{constructor(D){super(D,{}),this.onAdd=K=>{this.implementation.onAdd&&this.implementation.onAdd(K,K.painter.context.gl)},this.onRemove=K=>{this.implementation.onRemove&&this.implementation.onRemove(K,K.painter.context.gl)},this.implementation=D}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class yp{constructor(D){this._methodToThrottle=D,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const wg=63710088e-1;class Qh{constructor(D,K){if(isNaN(D)||isNaN(K))throw new Error(`Invalid LngLat object: (${D}, ${K})`);if(this.lng=+D,this.lat=+K,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Qh(S(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(D){const K=Math.PI/180,he=this.lat*K,Ee=D.lat*K,Be=Math.sin(he)*Math.sin(Ee)+Math.cos(he)*Math.cos(Ee)*Math.cos((D.lng-this.lng)*K);return wg*Math.acos(Math.min(Be,1))}static convert(D){if(D instanceof Qh)return D;if(Array.isArray(D)&&(D.length===2||D.length===3))return new Qh(Number(D[0]),Number(D[1]));if(!Array.isArray(D)&&typeof D=="object"&&D!==null)return new Qh(Number("lng"in D?D.lng:D.lon),Number(D.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 [, ]")}}const lm=2*Math.PI*wg;function f0(H){return lm*Math.cos(H*Math.PI/180)}function h0(H){return(180+H)/360}function um(H){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+H*Math.PI/360)))/360}function zh(H,D){return H/f0(D)}function Tg(H){return 360/Math.PI*Math.atan(Math.exp((180-360*H)*Math.PI/180))-90}class mp{constructor(D,K,he=0){this.x=+D,this.y=+K,this.z=+he}static fromLngLat(D,K=0){const he=Qh.convert(D);return new mp(h0(he.lng),um(he.lat),zh(K,he.lat))}toLngLat(){return new Qh(360*this.x-180,Tg(this.y))}toAltitude(){return this.z*f0(Tg(this.y))}meterInMercatorCoordinateUnits(){return 1/lm*(D=Tg(this.y),1/Math.cos(D*Math.PI/180));var D}}function cm(H,D,K){var he=2*Math.PI*6378137/256/Math.pow(2,K);return[H*he-2*Math.PI*6378137/2,D*he-2*Math.PI*6378137/2]}class Ag{constructor(D,K,he){if(!function(Ee,Be,Ve){return!(Ee<0||Ee>25||Ve<0||Ve>=Math.pow(2,Ee)||Be<0||Be>=Math.pow(2,Ee))}(D,K,he))throw new Error(`x=${K}, y=${he}, z=${D} outside of bounds. 0<=x<${Math.pow(2,D)}, 0<=y<${Math.pow(2,D)} 0<=z<=25 `);this.z=D,this.x=K,this.y=he,this.key=Td(0,D,D,K,he)}equals(D){return this.z===D.z&&this.x===D.x&&this.y===D.y}url(D,K,he){const Ee=(Ve=this.y,nt=this.z,mt=cm(256*(Be=this.x),256*(Ve=Math.pow(2,nt)-Ve-1),nt),Pt=cm(256*(Be+1),256*(Ve+1),nt),mt[0]+","+mt[1]+","+Pt[0]+","+Pt[1]);var Be,Ve,nt,mt,Pt;const Xt=function(er,br,Rr){let jr,Yr="";for(let ca=er;ca>0;ca--)jr=1<1?"@2x":"").replace(/{quadkey}/g,Xt).replace(/{bbox-epsg-3857}/g,Ee)}isChildOf(D){const K=this.z-D.z;return K>0&&D.x===this.x>>K&&D.y===this.y>>K}getTilePoint(D){const K=Math.pow(2,this.z);return new i((D.x*K-this.x)*_s,(D.y*K-this.y)*_s)}toString(){return`${this.z}/${this.x}/${this.y}`}}class fm{constructor(D,K){this.wrap=D,this.canonical=K,this.key=Td(D,K.z,K.z,K.x,K.y)}}class kh{constructor(D,K,he,Ee,Be){if(D= z; overscaledZ = ${D}; z = ${he}`);this.overscaledZ=D,this.wrap=K,this.canonical=new Ag(he,+Ee,+Be),this.key=Td(K,D,he,Ee,Be)}clone(){return new kh(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(D){return this.overscaledZ===D.overscaledZ&&this.wrap===D.wrap&&this.canonical.equals(D.canonical)}scaledTo(D){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);const K=this.canonical.z-D;return D>this.canonical.z?new kh(D,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new kh(D,this.wrap,D,this.canonical.x>>K,this.canonical.y>>K)}calculateScaledKey(D,K){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);const he=this.canonical.z-D;return D>this.canonical.z?Td(this.wrap*+K,D,this.canonical.z,this.canonical.x,this.canonical.y):Td(this.wrap*+K,D,D,this.canonical.x>>he,this.canonical.y>>he)}isChildOf(D){if(D.wrap!==this.wrap)return!1;const K=this.canonical.z-D.canonical.z;return D.overscaledZ===0||D.overscaledZ>K&&D.canonical.y===this.canonical.y>>K}children(D){if(this.overscaledZ>=D)return[new kh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const K=this.canonical.z+1,he=2*this.canonical.x,Ee=2*this.canonical.y;return[new kh(K,this.wrap,K,he,Ee),new kh(K,this.wrap,K,he+1,Ee),new kh(K,this.wrap,K,he,Ee+1),new kh(K,this.wrap,K,he+1,Ee+1)]}isLessThan(D){return this.wrapD.wrap)&&(this.overscaledZD.overscaledZ)&&(this.canonical.xD.canonical.x)&&this.canonical.ythis.max&&(this.max=er),er=this.dim+1||K<-1||K>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(K+1)*this.stride+(D+1)}unpack(D,K,he){return D*this.redFactor+K*this.greenFactor+he*this.blueFactor-this.baseShift}getPixels(){return new Xs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(D,K,he){if(this.dim!==D.dim)throw new Error("dem dimension mismatch");let Ee=K*this.dim,Be=K*this.dim+this.dim,Ve=he*this.dim,nt=he*this.dim+this.dim;switch(K){case-1:Ee=Be-1;break;case 1:Be=Ee+1}switch(he){case-1:Ve=nt-1;break;case 1:nt=Ve+1}const mt=-K*this.dim,Pt=-he*this.dim;for(let Xt=Ve;Xt=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${D} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[D]}}class vm{constructor(D,K,he,Ee,Be){this.type="Feature",this._vectorTileFeature=D,D._z=K,D._x=he,D._y=Ee,this.properties=D.properties,this.id=Be}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(D){this._geometry=D}toJSON(){const D={geometry:this.geometry};for(const K in this)K!=="_geometry"&&K!=="_vectorTileFeature"&&(D[K]=this[K]);return D}}class dm{constructor(D,K){this.tileID=D,this.x=D.canonical.x,this.y=D.canonical.y,this.z=D.canonical.z,this.grid=new _n(_s,16,0),this.grid3D=new _n(_s,16,0),this.featureIndexArray=new zs,this.promoteId=K}insert(D,K,he,Ee,Be,Ve){const nt=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(he,Ee,Be);const mt=Ve?this.grid3D:this.grid;for(let Pt=0;Pt=0&&er[3]>=0&&mt.insert(nt,er[0],er[1],er[2],er[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new an.VectorTile(new hg(this.rawTileData)).layers,this.sourceLayerCoder=new hm(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(D,K,he,Ee){this.loadVTLayers();const Be=D.params||{},Ve=_s/D.tileSize/D.scale,nt=Ec(Be.filter),mt=D.queryGeometry,Pt=D.queryPadding*Ve,Xt=Sg(mt),er=this.grid.query(Xt.minX-Pt,Xt.minY-Pt,Xt.maxX+Pt,Xt.maxY+Pt),br=Sg(D.cameraQueryGeometry),Rr=this.grid3D.query(br.minX-Pt,br.minY-Pt,br.maxX+Pt,br.maxY+Pt,(ca,Ca,un,Ha)=>function(rn,Sn,$n,Oi,qo){for(const Di of rn)if(Sn<=Di.x&&$n<=Di.y&&Oi>=Di.x&&qo>=Di.y)return!0;const qi=[new i(Sn,$n),new i(Sn,qo),new i(Oi,qo),new i(Oi,$n)];if(rn.length>2){for(const Di of qi)if(si(rn,Di))return!0}for(let Di=0;Di(Ha||(Ha=cr(rn)),Sn.queryIntersectsFeature(mt,rn,$n,Ha,this.z,D.transform,Ve,D.pixelPosMatrix)))}return jr}loadMatchingFeature(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er){const br=this.bucketLayerIDs[K];if(Ve&&!function(ca,Ca){for(let un=0;un=0)return!0;return!1}(Ve,br))return;const Rr=this.sourceLayerCoder.decode(he),jr=this.vtLayers[Rr].feature(Ee);if(Be.needGeometry){const ca=fa(jr,!0);if(!Be.filter(new Jo(this.tileID.overscaledZ),ca,this.tileID.canonical))return}else if(!Be.filter(new Jo(this.tileID.overscaledZ),jr))return;const Yr=this.getId(jr,Rr);for(let ca=0;ca{const nt=D instanceof rc?D.get(Ve):null;return nt&&nt.evaluate?nt.evaluate(K,he,Ee):nt})}function Sg(H){let D=1/0,K=1/0,he=-1/0,Ee=-1/0;for(const Be of H)D=Math.min(D,Be.x),K=Math.min(K,Be.y),he=Math.max(he,Be.x),Ee=Math.max(Ee,Be.y);return{minX:D,minY:K,maxX:he,maxY:Ee}}function gm(H,D){return D-H}function ym(H,D,K,he,Ee){const Be=[];for(let Ve=0;Ve=he&&er.x>=he||(Xt.x>=he?Xt=new i(he,Xt.y+(he-Xt.x)/(er.x-Xt.x)*(er.y-Xt.y))._round():er.x>=he&&(er=new i(he,Xt.y+(he-Xt.x)/(er.x-Xt.x)*(er.y-Xt.y))._round()),Xt.y>=Ee&&er.y>=Ee||(Xt.y>=Ee?Xt=new i(Xt.x+(Ee-Xt.y)/(er.y-Xt.y)*(er.x-Xt.x),Ee)._round():er.y>=Ee&&(er=new i(Xt.x+(Ee-Xt.y)/(er.y-Xt.y)*(er.x-Xt.x),Ee)._round()),mt&&Xt.equals(mt[mt.length-1])||(mt=[Xt],Be.push(mt)),mt.push(er)))))}}return Be}Wa("FeatureIndex",dm,{omit:["rawTileData","sourceLayerCoder"]});class Fv extends i{constructor(D,K,he,Ee){super(D,K),this.angle=he,Ee!==void 0&&(this.segment=Ee)}clone(){return new Fv(this.x,this.y,this.angle,this.segment)}}function mm(H,D,K,he,Ee){if(D.segment===void 0||K===0)return!0;let Be=D,Ve=D.segment+1,nt=0;for(;nt>-K/2;){if(Ve--,Ve<0)return!1;nt-=H[Ve].dist(Be),Be=H[Ve]}nt+=H[Ve].dist(H[Ve+1]),Ve++;const mt=[];let Pt=0;for(;nthe;)Pt-=mt.shift().angleDelta;if(Pt>Ee)return!1;Ve++,nt+=Xt.dist(er)}return!0}function _m(H){let D=0;for(let K=0;KPt){const jr=(Pt-mt)/Rr,Yr=Ci.number(er.x,br.x,jr),ca=Ci.number(er.y,br.y,jr),Ca=new Fv(Yr,ca,br.angleTo(er),Xt);return Ca._round(),!Ve||mm(H,Ca,nt,Ve,D)?Ca:void 0}mt+=Rr}}function Nx(H,D,K,he,Ee,Be,Ve,nt,mt){const Pt=xm(he,Be,Ve),Xt=bm(he,Ee),er=Xt*Ve,br=H[0].x===0||H[0].x===mt||H[0].y===0||H[0].y===mt;return D-er=0&&rn=0&&Sn=0&&br+Pt<=Xt){const $n=new Fv(rn,Sn,un,jr);$n._round(),he&&!mm(H,$n,Be,he,Ee)||Rr.push($n)}}er+=Ca}return nt||Rr.length||Ve||(Rr=ed(H,er/2,K,he,Ee,Be,Ve,!0,mt)),Rr}Wa("Anchor",Fv);const Ad=Ic;function wm(H,D,K,he){const Ee=[],Be=H.image,Ve=Be.pixelRatio,nt=Be.paddedRect.w-2*Ad,mt=Be.paddedRect.h-2*Ad;let Pt={x1:H.left,y1:H.top,x2:H.right,y2:H.bottom};const Xt=Be.stretchX||[[0,nt]],er=Be.stretchY||[[0,mt]],br=(zn,To)=>zn+To[1]-To[0],Rr=Xt.reduce(br,0),jr=er.reduce(br,0),Yr=nt-Rr,ca=mt-jr;let Ca=0,un=Rr,Ha=0,rn=jr,Sn=0,$n=Yr,Oi=0,qo=ca;if(Be.content&&he){const zn=Be.content,To=zn[2]-zn[0],_o=zn[3]-zn[1];(Be.textFitWidth||Be.textFitHeight)&&(Pt=am(H)),Ca=Sd(Xt,0,zn[0]),Ha=Sd(er,0,zn[1]),un=Sd(Xt,zn[0],zn[2]),rn=Sd(er,zn[1],zn[3]),Sn=zn[0]-Ca,Oi=zn[1]-Ha,$n=To-un,qo=_o-rn}const qi=Pt.x1,Di=Pt.y1,mo=Pt.x2-qi,so=Pt.y2-Di,to=(zn,To,_o,ts)=>{const Gl=_h(zn.stretch-Ca,un,mo,qi),Nl=v0(zn.fixed-Sn,$n,zn.stretch,Rr),Gc=_h(To.stretch-Ha,rn,so,Di),ih=v0(To.fixed-Oi,qo,To.stretch,jr),hc=_h(_o.stretch-Ca,un,mo,qi),Rc=v0(_o.fixed-Sn,$n,_o.stretch,Rr),Yf=_h(ts.stretch-Ha,rn,so,Di),Kf=v0(ts.fixed-Oi,qo,ts.stretch,jr),Jf=new i(Gl,Gc),Ou=new i(hc,Gc),Wc=new i(hc,Yf),Ff=new i(Gl,Yf),Tf=new i(Nl/Ve,ih/Ve),$f=new i(Rc/Ve,Kf/Ve),lf=D*Math.PI/180;if(lf){const tl=Math.sin(lf),El=Math.cos(lf),Ll=[El,-tl,tl,El];Jf._matMult(Ll),Ou._matMult(Ll),Ff._matMult(Ll),Wc._matMult(Ll)}const xh=zn.stretch+zn.fixed,uu=To.stretch+To.fixed;return{tl:Jf,tr:Ou,bl:Ff,br:Wc,tex:{x:Be.paddedRect.x+Ad+xh,y:Be.paddedRect.y+Ad+uu,w:_o.stretch+_o.fixed-xh,h:ts.stretch+ts.fixed-uu},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Tf,pixelOffsetBR:$f,minFontScaleX:$n/Ve/mo,minFontScaleY:qo/Ve/so,isSDF:K}};if(he&&(Be.stretchX||Be.stretchY)){const zn=Md(Xt,Yr,Rr),To=Md(er,ca,jr);for(let _o=0;_o0&&(Yr=Math.max(10,Yr),this.circleDiameter=Yr)}else{const br=!((er=Ve.image)===null||er===void 0)&&er.content&&(Ve.image.textFitWidth||Ve.image.textFitHeight)?am(Ve):{x1:Ve.left,y1:Ve.top,x2:Ve.right,y2:Ve.bottom};br.y1=br.y1*nt-mt[0],br.y2=br.y2*nt+mt[2],br.x1=br.x1*nt-mt[3],br.x2=br.x2*nt+mt[1];const Rr=Ve.collisionPadding;if(Rr&&(br.x1-=Rr[0]*nt,br.y1-=Rr[1]*nt,br.x2+=Rr[2]*nt,br.y2+=Rr[3]*nt),Xt){const jr=new i(br.x1,br.y1),Yr=new i(br.x2,br.y1),ca=new i(br.x1,br.y2),Ca=new i(br.x2,br.y2),un=Xt*Math.PI/180;jr._rotate(un),Yr._rotate(un),ca._rotate(un),Ca._rotate(un),br.x1=Math.min(jr.x,Yr.x,ca.x,Ca.x),br.x2=Math.max(jr.x,Yr.x,ca.x,Ca.x),br.y1=Math.min(jr.y,Yr.y,ca.y,Ca.y),br.y2=Math.max(jr.y,Yr.y,ca.y,Ca.y)}D.emplaceBack(K.x,K.y,br.x1,br.y1,br.x2,br.y2,he,Ee,Be)}this.boxEndIndex=D.length}}class Ux{constructor(D=[],K=(he,Ee)=>heEe?1:0){if(this.data=D,this.length=this.data.length,this.compare=K,this.length>0)for(let he=(this.length>>1)-1;he>=0;he--)this._down(he)}push(D){this.data.push(D),this._up(this.length++)}pop(){if(this.length===0)return;const D=this.data[0],K=this.data.pop();return--this.length>0&&(this.data[0]=K,this._down(0)),D}peek(){return this.data[0]}_up(D){const{data:K,compare:he}=this,Ee=K[D];for(;D>0;){const Be=D-1>>1,Ve=K[Be];if(he(Ee,Ve)>=0)break;K[D]=Ve,D=Be}K[D]=Ee}_down(D){const{data:K,compare:he}=this,Ee=this.length>>1,Be=K[D];for(;D=0)break;K[D]=K[Ve],D=Ve}K[D]=Be}}function jx(H,D=1,K=!1){let he=1/0,Ee=1/0,Be=-1/0,Ve=-1/0;const nt=H[0];for(let Rr=0;RrBe)&&(Be=jr.x),(!Rr||jr.y>Ve)&&(Ve=jr.y)}const mt=Math.min(Be-he,Ve-Ee);let Pt=mt/2;const Xt=new Ux([],Vx);if(mt===0)return new i(he,Ee);for(let Rr=he;Rrer.d||!er.d)&&(er=Rr,K&&console.log("found best %d after %d probes",Math.round(1e4*Rr.d)/1e4,br)),Rr.max-er.d<=D||(Pt=Rr.h/2,Xt.push(new ev(Rr.p.x-Pt,Rr.p.y-Pt,Pt,H)),Xt.push(new ev(Rr.p.x+Pt,Rr.p.y-Pt,Pt,H)),Xt.push(new ev(Rr.p.x-Pt,Rr.p.y+Pt,Pt,H)),Xt.push(new ev(Rr.p.x+Pt,Rr.p.y+Pt,Pt,H)),br+=4)}return K&&(console.log(`num probes: ${br}`),console.log(`best distance: ${er.d}`)),er.p}function Vx(H,D){return D.max-H.max}function ev(H,D,K,he){this.p=new i(H,D),this.h=K,this.d=function(Ee,Be){let Ve=!1,nt=1/0;for(let mt=0;mtEe.y!=jr.y>Ee.y&&Ee.x<(jr.x-Rr.x)*(Ee.y-Rr.y)/(jr.y-Rr.y)+Rr.x&&(Ve=!Ve),nt=Math.min(nt,Wi(Ee,Rr,jr))}}return(Ve?1:-1)*Math.sqrt(nt)}(this.p,he),this.max=this.d+this.h*Math.SQRT2}var sf;e.aq=void 0,(sf=e.aq||(e.aq={}))[sf.center=1]="center",sf[sf.left=2]="left",sf[sf.right=3]="right",sf[sf.top=4]="top",sf[sf.bottom=5]="bottom",sf[sf["top-left"]=6]="top-left",sf[sf["top-right"]=7]="top-right",sf[sf["bottom-left"]=8]="bottom-left",sf[sf["bottom-right"]=9]="bottom-right";const Ov=7,Mg=Number.POSITIVE_INFINITY;function Tm(H,D){return D[1]!==Mg?function(K,he,Ee){let Be=0,Ve=0;switch(he=Math.abs(he),Ee=Math.abs(Ee),K){case"top-right":case"top-left":case"top":Ve=Ee-Ov;break;case"bottom-right":case"bottom-left":case"bottom":Ve=-Ee+Ov}switch(K){case"top-right":case"bottom-right":case"right":Be=-he;break;case"top-left":case"bottom-left":case"left":Be=he}return[Be,Ve]}(H,D[0],D[1]):function(K,he){let Ee=0,Be=0;he<0&&(he=0);const Ve=he/Math.SQRT2;switch(K){case"top-right":case"top-left":Be=Ve-Ov;break;case"bottom-right":case"bottom-left":Be=-Ve+Ov;break;case"bottom":Be=-he+Ov;break;case"top":Be=he-Ov}switch(K){case"top-right":case"bottom-right":Ee=-Ve;break;case"top-left":case"bottom-left":Ee=Ve;break;case"left":Ee=he;break;case"right":Ee=-he}return[Ee,Be]}(H,D[0])}function Am(H,D,K){var he;const Ee=H.layout,Be=(he=Ee.get("text-variable-anchor-offset"))===null||he===void 0?void 0:he.evaluate(D,{},K);if(Be){const nt=Be.values,mt=[];for(let Pt=0;Ptbr*pl);Xt.startsWith("top")?er[1]-=Ov:Xt.startsWith("bottom")&&(er[1]+=Ov),mt[Pt+1]=er}return new Aa(mt)}const Ve=Ee.get("text-variable-anchor");if(Ve){let nt;nt=H._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[Ee.get("text-radial-offset").evaluate(D,{},K)*pl,Mg]:Ee.get("text-offset").evaluate(D,{},K).map(Pt=>Pt*pl);const mt=[];for(const Pt of Ve)mt.push(Pt,Tm(Pt,nt));return new Aa(mt)}return null}function Eg(H){switch(H){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function qx(H,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt){let er=Be.textMaxSize.evaluate(D,{});er===void 0&&(er=Ve);const br=H.layers[0].layout,Rr=br.get("icon-offset").evaluate(D,{},Xt),jr=Mm(K.horizontal),Yr=Ve/24,ca=H.tilePixelRatio*Yr,Ca=H.tilePixelRatio*er/24,un=H.tilePixelRatio*nt,Ha=H.tilePixelRatio*br.get("symbol-spacing"),rn=br.get("text-padding")*H.tilePixelRatio,Sn=function(zn,To,_o,ts=1){const Gl=zn.get("icon-padding").evaluate(To,{},_o),Nl=Gl&&Gl.values;return[Nl[0]*ts,Nl[1]*ts,Nl[2]*ts,Nl[3]*ts]}(br,D,Xt,H.tilePixelRatio),$n=br.get("text-max-angle")/180*Math.PI,Oi=br.get("text-rotation-alignment")!=="viewport"&&br.get("symbol-placement")!=="point",qo=br.get("icon-rotation-alignment")==="map"&&br.get("symbol-placement")!=="point",qi=br.get("symbol-placement"),Di=Ha/2,mo=br.get("icon-text-fit");let so;he&&mo!=="none"&&(H.allowVerticalPlacement&&K.vertical&&(so=nm(he,K.vertical,mo,br.get("icon-text-fit-padding"),Rr,Yr)),jr&&(he=nm(he,jr,mo,br.get("icon-text-fit-padding"),Rr,Yr)));const to=(zn,To)=>{To.x<0||To.x>=_s||To.y<0||To.y>=_s||function(_o,ts,Gl,Nl,Gc,ih,hc,Rc,Yf,Kf,Jf,Ou,Wc,Ff,Tf,$f,lf,xh,uu,tl,El,Ll,ku,cu,Cd){const jh=_o.addToLineVertexArray(ts,Gl);let Vh,Of,Wl,uf,Fh=0,bh=0,Qf=0,Rg=0,Dg=-1,m0=-1;const gv={};let zg=Ma("");if(_o.allowVerticalPlacement&&Nl.vertical){const Af=Rc.layout.get("text-rotate").evaluate(El,{},cu)+90;Wl=new d0(Yf,ts,Kf,Jf,Ou,Nl.vertical,Wc,Ff,Tf,Af),hc&&(uf=new d0(Yf,ts,Kf,Jf,Ou,hc,lf,xh,Tf,Af))}if(Gc){const Af=Rc.layout.get("icon-rotate").evaluate(El,{}),wh=Rc.layout.get("icon-text-fit")!=="none",Bv=wm(Gc,Af,ku,wh),qh=hc?wm(hc,Af,ku,wh):void 0;Of=new d0(Yf,ts,Kf,Jf,Ou,Gc,lf,xh,!1,Af),Fh=4*Bv.length;const td=_o.iconSizeData;let Hh=null;td.kind==="source"?(Hh=[$h*Rc.layout.get("icon-size").evaluate(El,{})],Hh[0]>Dv&&m(`${_o.layerIds[0]}: Value for "icon-size" is >= ${vp}. Reduce your "icon-size".`)):td.kind==="composite"&&(Hh=[$h*Ll.compositeIconSizes[0].evaluate(El,{},cu),$h*Ll.compositeIconSizes[1].evaluate(El,{},cu)],(Hh[0]>Dv||Hh[1]>Dv)&&m(`${_o.layerIds[0]}: Value for "icon-size" is >= ${vp}. Reduce your "icon-size".`)),_o.addSymbols(_o.icon,Bv,Hh,tl,uu,El,e.ah.none,ts,jh.lineStartIndex,jh.lineLength,-1,cu),Dg=_o.icon.placedSymbolArray.length-1,qh&&(bh=4*qh.length,_o.addSymbols(_o.icon,qh,Hh,tl,uu,El,e.ah.vertical,ts,jh.lineStartIndex,jh.lineLength,-1,cu),m0=_o.icon.placedSymbolArray.length-1)}const Fg=Object.keys(Nl.horizontal);for(const Af of Fg){const wh=Nl.horizontal[Af];if(!Vh){zg=Ma(wh.text);const qh=Rc.layout.get("text-rotate").evaluate(El,{},cu);Vh=new d0(Yf,ts,Kf,Jf,Ou,wh,Wc,Ff,Tf,qh)}const Bv=wh.positionedLines.length===1;if(Qf+=Sm(_o,ts,wh,ih,Rc,Tf,El,$f,jh,Nl.vertical?e.ah.horizontal:e.ah.horizontalOnly,Bv?Fg:[Af],gv,Dg,Ll,cu),Bv)break}Nl.vertical&&(Rg+=Sm(_o,ts,Nl.vertical,ih,Rc,Tf,El,$f,jh,e.ah.vertical,["vertical"],gv,m0,Ll,cu));const Og=Vh?Vh.boxStartIndex:_o.collisionBoxArray.length,Bg=Vh?Vh.boxEndIndex:_o.collisionBoxArray.length,Hx=Wl?Wl.boxStartIndex:_o.collisionBoxArray.length,Gx=Wl?Wl.boxEndIndex:_o.collisionBoxArray.length,Wx=Of?Of.boxStartIndex:_o.collisionBoxArray.length,Zx=Of?Of.boxEndIndex:_o.collisionBoxArray.length,Pm=uf?uf.boxStartIndex:_o.collisionBoxArray.length,Ld=uf?uf.boxEndIndex:_o.collisionBoxArray.length;let Dc=-1;const Pd=(Af,wh)=>Af&&Af.circleDiameter?Math.max(Af.circleDiameter,wh):wh;Dc=Pd(Vh,Dc),Dc=Pd(Wl,Dc),Dc=Pd(Of,Dc),Dc=Pd(uf,Dc);const Ng=Dc>-1?1:0;Ng&&(Dc*=Cd/pl),_o.glyphOffsetArray.length>=$v.MAX_GLYPHS&&m("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),El.sortKey!==void 0&&_o.addToSortKeyRanges(_o.symbolInstances.length,El.sortKey);const Im=Am(Rc,El,cu),[Xx,Rm]=function(Af,wh){const Bv=Af.length,qh=wh==null?void 0:wh.values;if((qh==null?void 0:qh.length)>0)for(let td=0;td=0?gv.right:-1,gv.center>=0?gv.center:-1,gv.left>=0?gv.left:-1,gv.vertical||-1,Dg,m0,zg,Og,Bg,Hx,Gx,Wx,Zx,Pm,Ld,Kf,Qf,Rg,Fh,bh,Ng,0,Wc,Dc,Xx,Rm)}(H,To,zn,K,he,Ee,so,H.layers[0],H.collisionBoxArray,D.index,D.sourceLayerIndex,H.index,ca,[rn,rn,rn,rn],Oi,mt,un,Sn,qo,Rr,D,Be,Pt,Xt,Ve)};if(qi==="line")for(const zn of ym(D.geometry,0,0,_s,_s)){const To=Nx(zn,Ha,$n,K.vertical||jr,he,24,Ca,H.overscaling,_s);for(const _o of To)jr&&Em(H,jr.text,Di,_o)||to(zn,_o)}else if(qi==="line-center"){for(const zn of D.geometry)if(zn.length>1){const To=Bx(zn,$n,K.vertical||jr,he,24,Ca);To&&to(zn,To)}}else if(D.type==="Polygon")for(const zn of Lu(D.geometry,0)){const To=jx(zn,16);to(zn[0],new Fv(To.x,To.y,0))}else if(D.type==="LineString")for(const zn of D.geometry)to(zn,new Fv(zn[0].x,zn[0].y,0));else if(D.type==="Point")for(const zn of D.geometry)for(const To of zn)to([To],new Fv(To.x,To.y,0))}function Sm(H,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr){const Yr=function(un,Ha,rn,Sn,$n,Oi,qo,qi){const Di=Sn.layout.get("text-rotate").evaluate(Oi,{})*Math.PI/180,mo=[];for(const so of Ha.positionedLines)for(const to of so.positionedGlyphs){if(!to.rect)continue;const zn=to.rect||{};let To=dg+1,_o=!0,ts=1,Gl=0;const Nl=($n||qi)&&to.vertical,Gc=to.metrics.advance*to.scale/2;if(qi&&Ha.verticalizable&&(Gl=so.lineOffset/2-(to.imageName?-(pl-to.metrics.width*to.scale)/2:(to.scale-1)*pl)),to.imageName){const tl=qo[to.imageName];_o=tl.sdf,ts=tl.pixelRatio,To=Ic/ts}const ih=$n?[to.x+Gc,to.y]:[0,0];let hc=$n?[0,0]:[to.x+Gc+rn[0],to.y+rn[1]-Gl],Rc=[0,0];Nl&&(Rc=hc,hc=[0,0]);const Yf=to.metrics.isDoubleResolution?2:1,Kf=(to.metrics.left-To)*to.scale-Gc+hc[0],Jf=(-to.metrics.top-To)*to.scale+hc[1],Ou=Kf+zn.w/Yf*to.scale/ts,Wc=Jf+zn.h/Yf*to.scale/ts,Ff=new i(Kf,Jf),Tf=new i(Ou,Jf),$f=new i(Kf,Wc),lf=new i(Ou,Wc);if(Nl){const tl=new i(-Gc,Gc-_d),El=-Math.PI/2,Ll=pl/2-Gc,ku=new i(5-_d-Ll,-(to.imageName?Ll:0)),cu=new i(...Rc);Ff._rotateAround(El,tl)._add(ku)._add(cu),Tf._rotateAround(El,tl)._add(ku)._add(cu),$f._rotateAround(El,tl)._add(ku)._add(cu),lf._rotateAround(El,tl)._add(ku)._add(cu)}if(Di){const tl=Math.sin(Di),El=Math.cos(Di),Ll=[El,-tl,tl,El];Ff._matMult(Ll),Tf._matMult(Ll),$f._matMult(Ll),lf._matMult(Ll)}const xh=new i(0,0),uu=new i(0,0);mo.push({tl:Ff,tr:Tf,bl:$f,br:lf,tex:zn,writingMode:Ha.writingMode,glyphOffset:ih,sectionIndex:to.sectionIndex,isSDF:_o,pixelOffsetTL:xh,pixelOffsetBR:uu,minFontScaleX:0,minFontScaleY:0})}return mo}(0,K,nt,Ee,Be,Ve,he,H.allowVerticalPlacement),ca=H.textSizeData;let Ca=null;ca.kind==="source"?(Ca=[$h*Ee.layout.get("text-size").evaluate(Ve,{})],Ca[0]>Dv&&m(`${H.layerIds[0]}: Value for "text-size" is >= ${vp}. Reduce your "text-size".`)):ca.kind==="composite"&&(Ca=[$h*Rr.compositeTextSizes[0].evaluate(Ve,{},jr),$h*Rr.compositeTextSizes[1].evaluate(Ve,{},jr)],(Ca[0]>Dv||Ca[1]>Dv)&&m(`${H.layerIds[0]}: Value for "text-size" is >= ${vp}. Reduce your "text-size".`)),H.addSymbols(H.text,Yr,Ca,nt,Be,Ve,Pt,D,mt.lineStartIndex,mt.lineLength,br,jr);for(const un of Xt)er[un]=H.text.placedSymbolArray.length-1;return 4*Yr.length}function Mm(H){for(const D in H)return H[D];return null}function Em(H,D,K,he){const Ee=H.compareText;if(D in Ee){const Be=Ee[D];for(let Ve=Be.length-1;Ve>=0;Ve--)if(he.dist(Be[Ve])>4;if(Ee!==1)throw new Error(`Got v${Ee} data when expected v1.`);const Be=km[15&he];if(!Be)throw new Error("Unrecognized array type.");const[Ve]=new Uint16Array(D,2,1),[nt]=new Uint32Array(D,4,1);return new kg(nt,Ve,Be,D)}constructor(D,K=64,he=Float64Array,Ee){if(isNaN(D)||D<0)throw new Error(`Unpexpected numItems value: ${D}.`);this.numItems=+D,this.nodeSize=Math.min(Math.max(+K,2),65535),this.ArrayType=he,this.IndexArrayType=D<65536?Uint16Array:Uint32Array;const Be=km.indexOf(this.ArrayType),Ve=2*D*this.ArrayType.BYTES_PER_ELEMENT,nt=D*this.IndexArrayType.BYTES_PER_ELEMENT,mt=(8-nt%8)%8;if(Be<0)throw new Error(`Unexpected typed array class: ${he}.`);Ee&&Ee instanceof ArrayBuffer?(this.data=Ee,this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+nt+mt,2*D),this._pos=2*D,this._finished=!0):(this.data=new ArrayBuffer(8+Ve+nt+mt),this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+nt+mt,2*D),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Be]),new Uint16Array(this.data,2,1)[0]=K,new Uint32Array(this.data,4,1)[0]=D)}add(D,K){const he=this._pos>>1;return this.ids[he]=he,this.coords[this._pos++]=D,this.coords[this._pos++]=K,he}finish(){const D=this._pos>>1;if(D!==this.numItems)throw new Error(`Added ${D} items when expected ${this.numItems}.`);return Cg(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(D,K,he,Ee){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Be,coords:Ve,nodeSize:nt}=this,mt=[0,Be.length-1,0],Pt=[];for(;mt.length;){const Xt=mt.pop()||0,er=mt.pop()||0,br=mt.pop()||0;if(er-br<=nt){for(let ca=br;ca<=er;ca++){const Ca=Ve[2*ca],un=Ve[2*ca+1];Ca>=D&&Ca<=he&&un>=K&&un<=Ee&&Pt.push(Be[ca])}continue}const Rr=br+er>>1,jr=Ve[2*Rr],Yr=Ve[2*Rr+1];jr>=D&&jr<=he&&Yr>=K&&Yr<=Ee&&Pt.push(Be[Rr]),(Xt===0?D<=jr:K<=Yr)&&(mt.push(br),mt.push(Rr-1),mt.push(1-Xt)),(Xt===0?he>=jr:Ee>=Yr)&&(mt.push(Rr+1),mt.push(er),mt.push(1-Xt))}return Pt}within(D,K,he){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Ee,coords:Be,nodeSize:Ve}=this,nt=[0,Ee.length-1,0],mt=[],Pt=he*he;for(;nt.length;){const Xt=nt.pop()||0,er=nt.pop()||0,br=nt.pop()||0;if(er-br<=Ve){for(let ca=br;ca<=er;ca++)wf(Be[2*ca],Be[2*ca+1],D,K)<=Pt&&mt.push(Ee[ca]);continue}const Rr=br+er>>1,jr=Be[2*Rr],Yr=Be[2*Rr+1];wf(jr,Yr,D,K)<=Pt&&mt.push(Ee[Rr]),(Xt===0?D-he<=jr:K-he<=Yr)&&(nt.push(br),nt.push(Rr-1),nt.push(1-Xt)),(Xt===0?D+he>=jr:K+he>=Yr)&&(nt.push(Rr+1),nt.push(er),nt.push(1-Xt))}return mt}}function Cg(H,D,K,he,Ee,Be){if(Ee-he<=K)return;const Ve=he+Ee>>1;Cm(H,D,Ve,he,Ee,Be),Cg(H,D,K,he,Ve-1,1-Be),Cg(H,D,K,Ve+1,Ee,1-Be)}function Cm(H,D,K,he,Ee,Be){for(;Ee>he;){if(Ee-he>600){const Pt=Ee-he+1,Xt=K-he+1,er=Math.log(Pt),br=.5*Math.exp(2*er/3),Rr=.5*Math.sqrt(er*br*(Pt-br)/Pt)*(Xt-Pt/2<0?-1:1);Cm(H,D,K,Math.max(he,Math.floor(K-Xt*br/Pt+Rr)),Math.min(Ee,Math.floor(K+(Pt-Xt)*br/Pt+Rr)),Be)}const Ve=D[2*K+Be];let nt=he,mt=Ee;for(Ed(H,D,he,K),D[2*Ee+Be]>Ve&&Ed(H,D,he,Ee);ntVe;)mt--}D[2*he+Be]===Ve?Ed(H,D,he,mt):(mt++,Ed(H,D,mt,Ee)),mt<=K&&(he=mt+1),K<=mt&&(Ee=mt-1)}}function Ed(H,D,K,he){p0(H,K,he),p0(D,2*K,2*he),p0(D,2*K+1,2*he+1)}function p0(H,D,K){const he=H[D];H[D]=H[K],H[K]=he}function wf(H,D,K,he){const Ee=H-K,Be=D-he;return Ee*Ee+Be*Be}var Lg;e.bg=void 0,(Lg=e.bg||(e.bg={})).create="create",Lg.load="load",Lg.fullLoad="fullLoad";let g0=null,kd=[];const Pg=1e3/60,y0="loadTime",Ig="fullLoadTime",Lm={mark(H){performance.mark(H)},frame(H){const D=H;g0!=null&&kd.push(D-g0),g0=D},clearMetrics(){g0=null,kd=[],performance.clearMeasures(y0),performance.clearMeasures(Ig);for(const H in e.bg)performance.clearMarks(e.bg[H])},getPerformanceMetrics(){performance.measure(y0,e.bg.create,e.bg.load),performance.measure(Ig,e.bg.create,e.bg.fullLoad);const H=performance.getEntriesByName(y0)[0].duration,D=performance.getEntriesByName(Ig)[0].duration,K=kd.length,he=1/(kd.reduce((Be,Ve)=>Be+Ve,0)/K/1e3),Ee=kd.filter(Be=>Be>Pg).reduce((Be,Ve)=>Be+(Ve-Pg)/Pg,0);return{loadTime:H,fullLoadTime:D,fps:he,percentDroppedFrames:Ee/(K+Ee)*100,totalFrames:K}}};e.$=class extends nr{},e.A=$i,e.B=sn,e.C=function(H){if(z==null){const D=H.navigator?H.navigator.userAgent:null;z=!!H.safari||!(!D||!(/\b(iPad|iPhone|iPod)\b/.test(D)||D.match("Safari")&&!D.match("Chrome")))}return z},e.D=Vi,e.E=ae,e.F=class{constructor(H,D){this.target=H,this.mapId=D,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new yp(()=>this.process()),this.subscription=function(K,he,Ee,Be){return K.addEventListener(he,Ee,!1),{unsubscribe:()=>{K.removeEventListener(he,Ee,!1)}}}(this.target,"message",K=>this.receive(K)),this.globalScope=P(self)?H:window}registerMessageHandler(H,D){this.messageHandlers[H]=D}sendAsync(H,D){return new Promise((K,he)=>{const Ee=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[Ee]={resolve:K,reject:he},D&&D.signal.addEventListener("abort",()=>{delete this.resolveRejects[Ee];const nt={id:Ee,type:"",origin:location.origin,targetMapId:H.targetMapId,sourceMapId:this.mapId};this.target.postMessage(nt)},{once:!0});const Be=[],Ve=Object.assign(Object.assign({},H),{id:Ee,sourceMapId:this.mapId,origin:location.origin,data:ji(H.data,Be)});this.target.postMessage(Ve,{transfer:Be})})}receive(H){const D=H.data,K=D.id;if(!(D.origin!=="file://"&&location.origin!=="file://"&&D.origin!=="resource://android"&&location.origin!=="resource://android"&&D.origin!==location.origin||D.targetMapId&&this.mapId!==D.targetMapId)){if(D.type===""){delete this.tasks[K];const he=this.abortControllers[K];return delete this.abortControllers[K],void(he&&he.abort())}if(P(self)||D.mustQueue)return this.tasks[K]=D,this.taskQueue.push(K),void this.invoker.trigger();this.processTask(K,D)}}process(){if(this.taskQueue.length===0)return;const H=this.taskQueue.shift(),D=this.tasks[H];delete this.tasks[H],this.taskQueue.length>0&&this.invoker.trigger(),D&&this.processTask(H,D)}processTask(H,D){return t(this,void 0,void 0,function*(){if(D.type===""){const Ee=this.resolveRejects[H];return delete this.resolveRejects[H],Ee?void(D.error?Ee.reject(Ni(D.error)):Ee.resolve(Ni(D.data))):void 0}if(!this.messageHandlers[D.type])return void this.completeTask(H,new Error(`Could not find a registered handler for ${D.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const K=Ni(D.data),he=new AbortController;this.abortControllers[H]=he;try{const Ee=yield this.messageHandlers[D.type](D.sourceMapId,K,he);this.completeTask(H,null,Ee)}catch(Ee){this.completeTask(H,Ee)}})}completeTask(H,D,K){const he=[];delete this.abortControllers[H];const Ee={id:H,type:"",sourceMapId:this.mapId,origin:location.origin,error:D?ji(D):null,data:ji(K,he)};this.target.postMessage(Ee,{transfer:he})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=oe,e.H=function(){var H=new $i(16);return $i!=Float32Array&&(H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[11]=0,H[12]=0,H[13]=0,H[14]=0),H[0]=1,H[5]=1,H[10]=1,H[15]=1,H},e.I=bf,e.J=function(H,D,K){var he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr=K[0],ca=K[1],Ca=K[2];return D===H?(H[12]=D[0]*Yr+D[4]*ca+D[8]*Ca+D[12],H[13]=D[1]*Yr+D[5]*ca+D[9]*Ca+D[13],H[14]=D[2]*Yr+D[6]*ca+D[10]*Ca+D[14],H[15]=D[3]*Yr+D[7]*ca+D[11]*Ca+D[15]):(Ee=D[1],Be=D[2],Ve=D[3],nt=D[4],mt=D[5],Pt=D[6],Xt=D[7],er=D[8],br=D[9],Rr=D[10],jr=D[11],H[0]=he=D[0],H[1]=Ee,H[2]=Be,H[3]=Ve,H[4]=nt,H[5]=mt,H[6]=Pt,H[7]=Xt,H[8]=er,H[9]=br,H[10]=Rr,H[11]=jr,H[12]=he*Yr+nt*ca+er*Ca+D[12],H[13]=Ee*Yr+mt*ca+br*Ca+D[13],H[14]=Be*Yr+Pt*ca+Rr*Ca+D[14],H[15]=Ve*Yr+Xt*ca+jr*Ca+D[15]),H},e.K=function(H,D,K){var he=K[0],Ee=K[1],Be=K[2];return H[0]=D[0]*he,H[1]=D[1]*he,H[2]=D[2]*he,H[3]=D[3]*he,H[4]=D[4]*Ee,H[5]=D[5]*Ee,H[6]=D[6]*Ee,H[7]=D[7]*Ee,H[8]=D[8]*Be,H[9]=D[9]*Be,H[10]=D[10]*Be,H[11]=D[11]*Be,H[12]=D[12],H[13]=D[13],H[14]=D[14],H[15]=D[15],H},e.L=Mn,e.M=function(H,D){const K={};for(let he=0;he{const D=window.document.createElement("video");return D.muted=!0,new Promise(K=>{D.onloadstart=()=>{K(D)};for(const he of H){const Ee=window.document.createElement("source");$(he)||(D.crossOrigin="Anonymous"),Ee.src=he,D.appendChild(Ee)}})},e.a4=function(){return _++},e.a5=ln,e.a6=$v,e.a7=Ec,e.a8=fa,e.a9=vm,e.aA=function(H){if(H.type==="custom")return new sm(H);switch(H.type){case"background":return new gp(H);case"circle":return new ri(H);case"fill":return new Ea(H);case"fill-extrusion":return new ph(H);case"heatmap":return new dl(H);case"hillshade":return new Lc(H);case"line":return new Xv(H);case"raster":return new Ox(H);case"symbol":return new u0(H)}},e.aB=u,e.aC=function(H,D){if(!H)return[{command:"setStyle",args:[D]}];let K=[];try{if(!Ae(H.version,D.version))return[{command:"setStyle",args:[D]}];Ae(H.center,D.center)||K.push({command:"setCenter",args:[D.center]}),Ae(H.zoom,D.zoom)||K.push({command:"setZoom",args:[D.zoom]}),Ae(H.bearing,D.bearing)||K.push({command:"setBearing",args:[D.bearing]}),Ae(H.pitch,D.pitch)||K.push({command:"setPitch",args:[D.pitch]}),Ae(H.sprite,D.sprite)||K.push({command:"setSprite",args:[D.sprite]}),Ae(H.glyphs,D.glyphs)||K.push({command:"setGlyphs",args:[D.glyphs]}),Ae(H.transition,D.transition)||K.push({command:"setTransition",args:[D.transition]}),Ae(H.light,D.light)||K.push({command:"setLight",args:[D.light]}),Ae(H.terrain,D.terrain)||K.push({command:"setTerrain",args:[D.terrain]}),Ae(H.sky,D.sky)||K.push({command:"setSky",args:[D.sky]}),Ae(H.projection,D.projection)||K.push({command:"setProjection",args:[D.projection]});const he={},Ee=[];(function(Ve,nt,mt,Pt){let Xt;for(Xt in nt=nt||{},Ve=Ve||{})Object.prototype.hasOwnProperty.call(Ve,Xt)&&(Object.prototype.hasOwnProperty.call(nt,Xt)||qe(Xt,mt,Pt));for(Xt in nt)Object.prototype.hasOwnProperty.call(nt,Xt)&&(Object.prototype.hasOwnProperty.call(Ve,Xt)?Ae(Ve[Xt],nt[Xt])||(Ve[Xt].type==="geojson"&&nt[Xt].type==="geojson"&&Qe(Ve,nt,Xt)?Fe(mt,{command:"setGeoJSONSourceData",args:[Xt,nt[Xt].data]}):et(Xt,nt,mt,Pt)):Ce(Xt,nt,mt))})(H.sources,D.sources,Ee,he);const Be=[];H.layers&&H.layers.forEach(Ve=>{"source"in Ve&&he[Ve.source]?K.push({command:"removeLayer",args:[Ve.id]}):Be.push(Ve)}),K=K.concat(Ee),function(Ve,nt,mt){nt=nt||[];const Pt=(Ve=Ve||[]).map(Xe),Xt=nt.map(Xe),er=Ve.reduce(Me,{}),br=nt.reduce(Me,{}),Rr=Pt.slice(),jr=Object.create(null);let Yr,ca,Ca,un,Ha;for(let rn=0,Sn=0;rn@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(K,he,Ee,Be)=>{const Ve=Ee||Be;return D[he]=!Ve||Ve.toLowerCase(),""}),D["max-age"]){const K=parseInt(D["max-age"],10);isNaN(K)?delete D["max-age"]:D["max-age"]=K}return D},e.ab=function(H,D){const K=[];for(const he in H)he in D||K.push(he);return K},e.ac=b,e.ad=function(H,D,K){var he=Math.sin(K),Ee=Math.cos(K),Be=D[0],Ve=D[1],nt=D[2],mt=D[3],Pt=D[4],Xt=D[5],er=D[6],br=D[7];return D!==H&&(H[8]=D[8],H[9]=D[9],H[10]=D[10],H[11]=D[11],H[12]=D[12],H[13]=D[13],H[14]=D[14],H[15]=D[15]),H[0]=Be*Ee+Pt*he,H[1]=Ve*Ee+Xt*he,H[2]=nt*Ee+er*he,H[3]=mt*Ee+br*he,H[4]=Pt*Ee-Be*he,H[5]=Xt*Ee-Ve*he,H[6]=er*Ee-nt*he,H[7]=br*Ee-mt*he,H},e.ae=function(H){var D=new $i(16);return D[0]=H[0],D[1]=H[1],D[2]=H[2],D[3]=H[3],D[4]=H[4],D[5]=H[5],D[6]=H[6],D[7]=H[7],D[8]=H[8],D[9]=H[9],D[10]=H[10],D[11]=H[11],D[12]=H[12],D[13]=H[13],D[14]=H[14],D[15]=H[15],D},e.af=gi,e.ag=function(H,D){let K=0,he=0;if(H.kind==="constant")he=H.layoutSize;else if(H.kind!=="source"){const{interpolationType:Ee,minZoom:Be,maxZoom:Ve}=H,nt=Ee?b(ci.interpolationFactor(Ee,D,Be,Ve),0,1):0;H.kind==="camera"?he=Ci.number(H.minSize,H.maxSize,nt):K=nt}return{uSizeT:K,uSize:he}},e.ai=function(H,{uSize:D,uSizeT:K},{lowerSize:he,upperSize:Ee}){return H.kind==="source"?he/$h:H.kind==="composite"?Ci.number(he/$h,Ee/$h,K):D},e.aj=zv,e.ak=function(H,D,K,he){const Ee=D.y-H.y,Be=D.x-H.x,Ve=he.y-K.y,nt=he.x-K.x,mt=Ve*Be-nt*Ee;if(mt===0)return null;const Pt=(nt*(H.y-K.y)-Ve*(H.x-K.x))/mt;return new i(H.x+Pt*Be,H.y+Pt*Ee)},e.al=ym,e.am=In,e.an=Cn,e.ao=function(H){let D=1/0,K=1/0,he=-1/0,Ee=-1/0;for(const Be of H)D=Math.min(D,Be.x),K=Math.min(K,Be.y),he=Math.max(he,Be.x),Ee=Math.max(Ee,Be.y);return[D,K,he,Ee]},e.ap=pl,e.ar=yg,e.as=function(H,D){var K=D[0],he=D[1],Ee=D[2],Be=D[3],Ve=D[4],nt=D[5],mt=D[6],Pt=D[7],Xt=D[8],er=D[9],br=D[10],Rr=D[11],jr=D[12],Yr=D[13],ca=D[14],Ca=D[15],un=K*nt-he*Ve,Ha=K*mt-Ee*Ve,rn=K*Pt-Be*Ve,Sn=he*mt-Ee*nt,$n=he*Pt-Be*nt,Oi=Ee*Pt-Be*mt,qo=Xt*Yr-er*jr,qi=Xt*ca-br*jr,Di=Xt*Ca-Rr*jr,mo=er*ca-br*Yr,so=er*Ca-Rr*Yr,to=br*Ca-Rr*ca,zn=un*to-Ha*so+rn*mo+Sn*Di-$n*qi+Oi*qo;return zn?(H[0]=(nt*to-mt*so+Pt*mo)*(zn=1/zn),H[1]=(Ee*so-he*to-Be*mo)*zn,H[2]=(Yr*Oi-ca*$n+Ca*Sn)*zn,H[3]=(br*$n-er*Oi-Rr*Sn)*zn,H[4]=(mt*Di-Ve*to-Pt*qi)*zn,H[5]=(K*to-Ee*Di+Be*qi)*zn,H[6]=(ca*rn-jr*Oi-Ca*Ha)*zn,H[7]=(Xt*Oi-br*rn+Rr*Ha)*zn,H[8]=(Ve*so-nt*Di+Pt*qo)*zn,H[9]=(he*Di-K*so-Be*qo)*zn,H[10]=(jr*$n-Yr*rn+Ca*un)*zn,H[11]=(er*rn-Xt*$n-Rr*un)*zn,H[12]=(nt*qi-Ve*mo-mt*qo)*zn,H[13]=(K*mo-he*qi+Ee*qo)*zn,H[14]=(Yr*Ha-jr*Sn-ca*un)*zn,H[15]=(Xt*Sn-er*Ha+br*un)*zn,H):null},e.at=Eg,e.au=gg,e.av=kg,e.aw=function(){const H={},D=ie.$version;for(const K in ie.$root){const he=ie.$root[K];if(he.required){let Ee=null;Ee=K==="version"?D:he.type==="array"?[]:{},Ee!=null&&(H[K]=Ee)}}return H},e.ax=Bn,e.ay=j,e.az=function(H){H=H.slice();const D=Object.create(null);for(let K=0;K25||he<0||he>=1||K<0||K>=1)},e.bc=function(H,D){return H[0]=D[0],H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[5]=D[1],H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[10]=D[2],H[11]=0,H[12]=0,H[13]=0,H[14]=0,H[15]=1,H},e.bd=class extends Wt{},e.be=wg,e.bf=Lm,e.bh=le,e.bi=function(H,D){Q.REGISTERED_PROTOCOLS[H]=D},e.bj=function(H){delete Q.REGISTERED_PROTOCOLS[H]},e.bk=function(H,D){const K={};for(let Ee=0;Eeto*pl)}let qi=Ve?"center":K.get("text-justify").evaluate(Pt,{},H.canonical);const Di=K.get("symbol-placement")==="point"?K.get("text-max-width").evaluate(Pt,{},H.canonical)*pl:1/0,mo=()=>{H.bucket.allowVerticalPlacement&&Ki(rn)&&(jr.vertical=n0(Yr,H.glyphMap,H.glyphPositions,H.imagePositions,Xt,Di,Be,Oi,"left",$n,Ca,e.ah.vertical,!0,br,er))};if(!Ve&&qo){const so=new Set;if(qi==="auto")for(let zn=0;znt(void 0,void 0,void 0,function*(){if(H.byteLength===0)return createImageBitmap(new ImageData(1,1));const D=new Blob([new Uint8Array(H)],{type:"image/png"});try{return createImageBitmap(D)}catch(K){throw new Error(`Could not load image because of ${K.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),e.e=M,e.f=H=>new Promise((D,K)=>{const he=new Image;he.onload=()=>{D(he),URL.revokeObjectURL(he.src),he.onload=null,window.requestAnimationFrame(()=>{he.src=B})},he.onerror=()=>K(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."));const Ee=new Blob([new Uint8Array(H)],{type:"image/png"});he.src=H.byteLength?URL.createObjectURL(Ee):B}),e.g=ue,e.h=(H,D)=>J(M(H,{type:"json"}),D),e.i=P,e.j=q,e.k=ee,e.l=(H,D)=>J(M(H,{type:"arrayBuffer"}),D),e.m=J,e.n=function(H){return new hg(H).readFields(Lx,[])},e.o=xs,e.p=a0,e.q=De,e.r=ja,e.s=$,e.t=Ja,e.u=Fa,e.v=ie,e.w=m,e.x=function([H,D,K]){return D+=90,D*=Math.PI/180,K*=Math.PI/180,{x:H*Math.cos(D)*Math.sin(K),y:H*Math.sin(D)*Math.sin(K),z:H*Math.cos(K)}},e.y=Ci,e.z=Jo}),A("worker",["./shared"],function(e){class t{constructor(ze){this.keyCache={},ze&&this.replace(ze)}replace(ze){this._layerConfigs={},this._layers={},this.update(ze,[])}update(ze,Ge){for(const ve of ze){this._layerConfigs[ve.id]=ve;const ge=this._layers[ve.id]=e.aA(ve);ge._featureFilter=e.a7(ge.filter),this.keyCache[ve.id]&&delete this.keyCache[ve.id]}for(const ve of Ge)delete this.keyCache[ve],delete this._layerConfigs[ve],delete this._layers[ve];this.familiesBySource={};const Oe=e.bk(Object.values(this._layerConfigs),this.keyCache);for(const ve of Oe){const ge=ve.map(Mt=>this._layers[Mt.id]),be=ge[0];if(be.visibility==="none")continue;const Pe=be.source||"";let We=this.familiesBySource[Pe];We||(We=this.familiesBySource[Pe]={});const ct=be.sourceLayer||"_geojsonTileLayer";let _t=We[ct];_t||(_t=We[ct]=[]),_t.push(ge)}}}class r{constructor(ze){const Ge={},Oe=[];for(const Pe in ze){const We=ze[Pe],ct=Ge[Pe]={};for(const _t in We){const Mt=We[+_t];if(!Mt||Mt.bitmap.width===0||Mt.bitmap.height===0)continue;const Nt={x:0,y:0,w:Mt.bitmap.width+2,h:Mt.bitmap.height+2};Oe.push(Nt),ct[_t]={rect:Nt,metrics:Mt.metrics}}}const{w:ve,h:ge}=e.p(Oe),be=new e.o({width:ve||1,height:ge||1});for(const Pe in ze){const We=ze[Pe];for(const ct in We){const _t=We[+ct];if(!_t||_t.bitmap.width===0||_t.bitmap.height===0)continue;const Mt=Ge[Pe][ct].rect;e.o.copy(_t.bitmap,be,{x:0,y:0},{x:Mt.x+1,y:Mt.y+1},_t.bitmap)}}this.image=be,this.positions=Ge}}e.bl("GlyphAtlas",r);class o{constructor(ze){this.tileID=new e.S(ze.tileID.overscaledZ,ze.tileID.wrap,ze.tileID.canonical.z,ze.tileID.canonical.x,ze.tileID.canonical.y),this.uid=ze.uid,this.zoom=ze.zoom,this.pixelRatio=ze.pixelRatio,this.tileSize=ze.tileSize,this.source=ze.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=ze.showCollisionBoxes,this.collectResourceTiming=!!ze.collectResourceTiming,this.returnDependencies=!!ze.returnDependencies,this.promoteId=ze.promoteId,this.inFlightDependencies=[]}parse(ze,Ge,Oe,ve){return e._(this,void 0,void 0,function*(){this.status="parsing",this.data=ze,this.collisionBoxArray=new e.a5;const ge=new e.bm(Object.keys(ze.layers).sort()),be=new e.bn(this.tileID,this.promoteId);be.bucketLayerIDs=[];const Pe={},We={featureIndex:be,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Oe},ct=Ge.familiesBySource[this.source];for(const Ia in ct){const va=ze.layers[Ia];if(!va)continue;va.version===1&&e.w(`Vector tile source "${this.source}" layer "${Ia}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const La=ge.encode(Ia),Ka=[];for(let Vt=0;Vt=Lt.maxzoom||Lt.visibility!=="none"&&(a(Vt,this.zoom,Oe),(Pe[Lt.id]=Lt.createBucket({index:be.bucketLayerIDs.length,layers:Vt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:La,sourceID:this.source})).populate(Ka,We,this.tileID.canonical),be.bucketLayerIDs.push(Vt.map(jt=>jt.id)))}}const _t=e.aF(We.glyphDependencies,Ia=>Object.keys(Ia).map(Number));this.inFlightDependencies.forEach(Ia=>Ia==null?void 0:Ia.abort()),this.inFlightDependencies=[];let Mt=Promise.resolve({});if(Object.keys(_t).length){const Ia=new AbortController;this.inFlightDependencies.push(Ia),Mt=ve.sendAsync({type:"GG",data:{stacks:_t,source:this.source,tileID:this.tileID,type:"glyphs"}},Ia)}const Nt=Object.keys(We.iconDependencies);let Bt=Promise.resolve({});if(Nt.length){const Ia=new AbortController;this.inFlightDependencies.push(Ia),Bt=ve.sendAsync({type:"GI",data:{icons:Nt,source:this.source,tileID:this.tileID,type:"icons"}},Ia)}const qt=Object.keys(We.patternDependencies);let Zt=Promise.resolve({});if(qt.length){const Ia=new AbortController;this.inFlightDependencies.push(Ia),Zt=ve.sendAsync({type:"GI",data:{icons:qt,source:this.source,tileID:this.tileID,type:"patterns"}},Ia)}const[lr,ta,da]=yield Promise.all([Mt,Bt,Zt]),wa=new r(lr),ma=new e.bo(ta,da);for(const Ia in Pe){const va=Pe[Ia];va instanceof e.a6?(a(va.layers,this.zoom,Oe),e.bp({bucket:va,glyphMap:lr,glyphPositions:wa.positions,imageMap:ta,imagePositions:ma.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):va.hasPattern&&(va instanceof e.bq||va instanceof e.br||va instanceof e.bs)&&(a(va.layers,this.zoom,Oe),va.addFeatures(We,this.tileID.canonical,ma.patternPositions))}return this.status="done",{buckets:Object.values(Pe).filter(Ia=>!Ia.isEmpty()),featureIndex:be,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:wa.image,imageAtlas:ma,glyphMap:this.returnDependencies?lr:null,iconMap:this.returnDependencies?ta:null,glyphPositions:this.returnDependencies?wa.positions:null}})}}function a(pt,ze,Ge){const Oe=new e.z(ze);for(const ve of pt)ve.recalculate(Oe,Ge)}class i{constructor(ze,Ge,Oe){this.actor=ze,this.layerIndex=Ge,this.availableImages=Oe,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(ze,Ge){return e._(this,void 0,void 0,function*(){const Oe=yield e.l(ze.request,Ge);try{return{vectorTile:new e.bt.VectorTile(new e.bu(Oe.data)),rawData:Oe.data,cacheControl:Oe.cacheControl,expires:Oe.expires}}catch(ve){const ge=new Uint8Array(Oe.data);let be=`Unable to parse the tile at ${ze.request.url}, `;throw be+=ge[0]===31&&ge[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${ve.message}`,new Error(be)}})}loadTile(ze){return e._(this,void 0,void 0,function*(){const Ge=ze.uid,Oe=!!(ze&&ze.request&&ze.request.collectResourceTiming)&&new e.bv(ze.request),ve=new o(ze);this.loading[Ge]=ve;const ge=new AbortController;ve.abort=ge;try{const be=yield this.loadVectorTile(ze,ge);if(delete this.loading[Ge],!be)return null;const Pe=be.rawData,We={};be.expires&&(We.expires=be.expires),be.cacheControl&&(We.cacheControl=be.cacheControl);const ct={};if(Oe){const Mt=Oe.finish();Mt&&(ct.resourceTiming=JSON.parse(JSON.stringify(Mt)))}ve.vectorTile=be.vectorTile;const _t=ve.parse(be.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[Ge]=ve,this.fetching[Ge]={rawTileData:Pe,cacheControl:We,resourceTiming:ct};try{const Mt=yield _t;return e.e({rawTileData:Pe.slice(0)},Mt,We,ct)}finally{delete this.fetching[Ge]}}catch(be){throw delete this.loading[Ge],ve.status="done",this.loaded[Ge]=ve,be}})}reloadTile(ze){return e._(this,void 0,void 0,function*(){const Ge=ze.uid;if(!this.loaded||!this.loaded[Ge])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const Oe=this.loaded[Ge];if(Oe.showCollisionBoxes=ze.showCollisionBoxes,Oe.status==="parsing"){const ve=yield Oe.parse(Oe.vectorTile,this.layerIndex,this.availableImages,this.actor);let ge;if(this.fetching[Ge]){const{rawTileData:be,cacheControl:Pe,resourceTiming:We}=this.fetching[Ge];delete this.fetching[Ge],ge=e.e({rawTileData:be.slice(0)},ve,Pe,We)}else ge=ve;return ge}if(Oe.status==="done"&&Oe.vectorTile)return Oe.parse(Oe.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(ze){return e._(this,void 0,void 0,function*(){const Ge=this.loading,Oe=ze.uid;Ge&&Ge[Oe]&&Ge[Oe].abort&&(Ge[Oe].abort.abort(),delete Ge[Oe])})}removeTile(ze){return e._(this,void 0,void 0,function*(){this.loaded&&this.loaded[ze.uid]&&delete this.loaded[ze.uid]})}}class n{constructor(){this.loaded={}}loadTile(ze){return e._(this,void 0,void 0,function*(){const{uid:Ge,encoding:Oe,rawImageData:ve,redFactor:ge,greenFactor:be,blueFactor:Pe,baseShift:We}=ze,ct=ve.width+2,_t=ve.height+2,Mt=e.b(ve)?new e.R({width:ct,height:_t},yield e.bw(ve,-1,-1,ct,_t)):ve,Nt=new e.bx(Ge,Mt,Oe,ge,be,Pe,We);return this.loaded=this.loaded||{},this.loaded[Ge]=Nt,Nt})}removeTile(ze){const Ge=this.loaded,Oe=ze.uid;Ge&&Ge[Oe]&&delete Ge[Oe]}}function s(pt,ze){if(pt.length!==0){c(pt[0],ze);for(var Ge=1;Ge=Math.abs(Pe)?Ge-We+Pe:Pe-We+Ge,Ge=We}Ge+Oe>=0!=!!ze&&pt.reverse()}var f=e.by(function pt(ze,Ge){var Oe,ve=ze&&ze.type;if(ve==="FeatureCollection")for(Oe=0;Oe>31}function P(pt,ze){for(var Ge=pt.loadGeometry(),Oe=pt.type,ve=0,ge=0,be=Ge.length,Pe=0;Pept},O=Math.fround||(L=new Float32Array(1),pt=>(L[0]=+pt,L[0]));var L;const N=3,U=5,Z=6;class Q{constructor(ze){this.options=Object.assign(Object.create(B),ze),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(ze){const{log:Ge,minZoom:Oe,maxZoom:ve}=this.options;Ge&&console.time("total time");const ge=`prepare ${ze.length} points`;Ge&&console.time(ge),this.points=ze;const be=[];for(let We=0;We=Oe;We--){const ct=+Date.now();Pe=this.trees[We]=this._createTree(this._cluster(Pe,We)),Ge&&console.log("z%d: %d clusters in %dms",We,Pe.numItems,+Date.now()-ct)}return Ge&&console.timeEnd("total time"),this}getClusters(ze,Ge){let Oe=((ze[0]+180)%360+360)%360-180;const ve=Math.max(-90,Math.min(90,ze[1]));let ge=ze[2]===180?180:((ze[2]+180)%360+360)%360-180;const be=Math.max(-90,Math.min(90,ze[3]));if(ze[2]-ze[0]>=360)Oe=-180,ge=180;else if(Oe>ge){const Mt=this.getClusters([Oe,ve,180,be],Ge),Nt=this.getClusters([-180,ve,ge,be],Ge);return Mt.concat(Nt)}const Pe=this.trees[this._limitZoom(Ge)],We=Pe.range(le(Oe),j(be),le(ge),j(ve)),ct=Pe.data,_t=[];for(const Mt of We){const Nt=this.stride*Mt;_t.push(ct[Nt+U]>1?ue(ct,Nt,this.clusterProps):this.points[ct[Nt+N]])}return _t}getChildren(ze){const Ge=this._getOriginId(ze),Oe=this._getOriginZoom(ze),ve="No cluster with the specified id.",ge=this.trees[Oe];if(!ge)throw new Error(ve);const be=ge.data;if(Ge*this.stride>=be.length)throw new Error(ve);const Pe=this.options.radius/(this.options.extent*Math.pow(2,Oe-1)),We=ge.within(be[Ge*this.stride],be[Ge*this.stride+1],Pe),ct=[];for(const _t of We){const Mt=_t*this.stride;be[Mt+4]===ze&&ct.push(be[Mt+U]>1?ue(be,Mt,this.clusterProps):this.points[be[Mt+N]])}if(ct.length===0)throw new Error(ve);return ct}getLeaves(ze,Ge,Oe){const ve=[];return this._appendLeaves(ve,ze,Ge=Ge||10,Oe=Oe||0,0),ve}getTile(ze,Ge,Oe){const ve=this.trees[this._limitZoom(ze)],ge=Math.pow(2,ze),{extent:be,radius:Pe}=this.options,We=Pe/be,ct=(Oe-We)/ge,_t=(Oe+1+We)/ge,Mt={features:[]};return this._addTileFeatures(ve.range((Ge-We)/ge,ct,(Ge+1+We)/ge,_t),ve.data,Ge,Oe,ge,Mt),Ge===0&&this._addTileFeatures(ve.range(1-We/ge,ct,1,_t),ve.data,ge,Oe,ge,Mt),Ge===ge-1&&this._addTileFeatures(ve.range(0,ct,We/ge,_t),ve.data,-1,Oe,ge,Mt),Mt.features.length?Mt:null}getClusterExpansionZoom(ze){let Ge=this._getOriginZoom(ze)-1;for(;Ge<=this.options.maxZoom;){const Oe=this.getChildren(ze);if(Ge++,Oe.length!==1)break;ze=Oe[0].properties.cluster_id}return Ge}_appendLeaves(ze,Ge,Oe,ve,ge){const be=this.getChildren(Ge);for(const Pe of be){const We=Pe.properties;if(We&&We.cluster?ge+We.point_count<=ve?ge+=We.point_count:ge=this._appendLeaves(ze,We.cluster_id,Oe,ve,ge):ge1;let _t,Mt,Nt;if(ct)_t=oe(Ge,We,this.clusterProps),Mt=Ge[We],Nt=Ge[We+1];else{const Zt=this.points[Ge[We+N]];_t=Zt.properties;const[lr,ta]=Zt.geometry.coordinates;Mt=le(lr),Nt=j(ta)}const Bt={type:1,geometry:[[Math.round(this.options.extent*(Mt*ge-Oe)),Math.round(this.options.extent*(Nt*ge-ve))]],tags:_t};let qt;qt=ct||this.options.generateId?Ge[We+N]:this.points[Ge[We+N]].id,qt!==void 0&&(Bt.id=qt),be.features.push(Bt)}}_limitZoom(ze){return Math.max(this.options.minZoom,Math.min(Math.floor(+ze),this.options.maxZoom+1))}_cluster(ze,Ge){const{radius:Oe,extent:ve,reduce:ge,minPoints:be}=this.options,Pe=Oe/(ve*Math.pow(2,Ge)),We=ze.data,ct=[],_t=this.stride;for(let Mt=0;MtGe&&(lr+=We[da+U])}if(lr>Zt&&lr>=be){let ta,da=Nt*Zt,wa=Bt*Zt,ma=-1;const Ia=((Mt/_t|0)<<5)+(Ge+1)+this.points.length;for(const va of qt){const La=va*_t;if(We[La+2]<=Ge)continue;We[La+2]=Ge;const Ka=We[La+U];da+=We[La]*Ka,wa+=We[La+1]*Ka,We[La+4]=Ia,ge&&(ta||(ta=this._map(We,Mt,!0),ma=this.clusterProps.length,this.clusterProps.push(ta)),ge(ta,this._map(We,La)))}We[Mt+4]=Ia,ct.push(da/lr,wa/lr,1/0,Ia,-1,lr),ge&&ct.push(ma)}else{for(let ta=0;ta<_t;ta++)ct.push(We[Mt+ta]);if(lr>1)for(const ta of qt){const da=ta*_t;if(!(We[da+2]<=Ge)){We[da+2]=Ge;for(let wa=0;wa<_t;wa++)ct.push(We[da+wa])}}}}return ct}_getOriginId(ze){return ze-this.points.length>>5}_getOriginZoom(ze){return(ze-this.points.length)%32}_map(ze,Ge,Oe){if(ze[Ge+U]>1){const be=this.clusterProps[ze[Ge+Z]];return Oe?Object.assign({},be):be}const ve=this.points[ze[Ge+N]].properties,ge=this.options.map(ve);return Oe&&ge===ve?Object.assign({},ge):ge}}function ue(pt,ze,Ge){return{type:"Feature",id:pt[ze+N],properties:oe(pt,ze,Ge),geometry:{type:"Point",coordinates:[(Oe=pt[ze],360*(Oe-.5)),J(pt[ze+1])]}};var Oe}function oe(pt,ze,Ge){const Oe=pt[ze+U],ve=Oe>=1e4?`${Math.round(Oe/1e3)}k`:Oe>=1e3?Math.round(Oe/100)/10+"k":Oe,ge=pt[ze+Z],be=ge===-1?{}:Object.assign({},Ge[ge]);return Object.assign(be,{cluster:!0,cluster_id:pt[ze+N],point_count:Oe,point_count_abbreviated:ve})}function le(pt){return pt/360+.5}function j(pt){const ze=Math.sin(pt*Math.PI/180),Ge=.5-.25*Math.log((1+ze)/(1-ze))/Math.PI;return Ge<0?0:Ge>1?1:Ge}function J(pt){const ze=(180-360*pt)*Math.PI/180;return 360*Math.atan(Math.exp(ze))/Math.PI-90}function $(pt,ze,Ge,Oe){let ve=Oe;const ge=ze+(Ge-ze>>1);let be,Pe=Ge-ze;const We=pt[ze],ct=pt[ze+1],_t=pt[Ge],Mt=pt[Ge+1];for(let Nt=ze+3;Ntve)be=Nt,ve=Bt;else if(Bt===ve){const qt=Math.abs(Nt-ge);qtOe&&(be-ze>3&&$(pt,ze,be,Oe),pt[be+2]=ve,Ge-be>3&&$(pt,be,Ge,Oe))}function X(pt,ze,Ge,Oe,ve,ge){let be=ve-Ge,Pe=ge-Oe;if(be!==0||Pe!==0){const We=((pt-Ge)*be+(ze-Oe)*Pe)/(be*be+Pe*Pe);We>1?(Ge=ve,Oe=ge):We>0&&(Ge+=be*We,Oe+=Pe*We)}return be=pt-Ge,Pe=ze-Oe,be*be+Pe*Pe}function re(pt,ze,Ge,Oe){const ve={id:pt??null,type:ze,geometry:Ge,tags:Oe,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(ze==="Point"||ze==="MultiPoint"||ze==="LineString")ee(ve,Ge);else if(ze==="Polygon")ee(ve,Ge[0]);else if(ze==="MultiLineString")for(const ge of Ge)ee(ve,ge);else if(ze==="MultiPolygon")for(const ge of Ge)ee(ve,ge[0]);return ve}function ee(pt,ze){for(let Ge=0;Ge0&&(be+=Oe?(ve*_t-ct*ge)/2:Math.sqrt(Math.pow(ct-ve,2)+Math.pow(_t-ge,2))),ve=ct,ge=_t}const Pe=ze.length-3;ze[2]=1,$(ze,0,Pe,Ge),ze[Pe+2]=1,ze.size=Math.abs(be),ze.start=0,ze.end=ze.size}function fe(pt,ze,Ge,Oe){for(let ve=0;ve1?1:Ge}function Fe(pt,ze,Ge,Oe,ve,ge,be,Pe){if(Oe/=ze,ge>=(Ge/=ze)&&be=Oe)return null;const We=[];for(const ct of pt){const _t=ct.geometry;let Mt=ct.type;const Nt=ve===0?ct.minX:ct.minY,Bt=ve===0?ct.maxX:ct.maxY;if(Nt>=Ge&&Bt=Oe)continue;let qt=[];if(Mt==="Point"||Mt==="MultiPoint")Ce(_t,qt,Ge,Oe,ve);else if(Mt==="LineString")qe(_t,qt,Ge,Oe,ve,!1,Pe.lineMetrics);else if(Mt==="MultiLineString")Qe(_t,qt,Ge,Oe,ve,!1);else if(Mt==="Polygon")Qe(_t,qt,Ge,Oe,ve,!0);else if(Mt==="MultiPolygon")for(const Zt of _t){const lr=[];Qe(Zt,lr,Ge,Oe,ve,!0),lr.length&&qt.push(lr)}if(qt.length){if(Pe.lineMetrics&&Mt==="LineString"){for(const Zt of qt)We.push(re(ct.id,Mt,Zt,ct.tags));continue}Mt!=="LineString"&&Mt!=="MultiLineString"||(qt.length===1?(Mt="LineString",qt=qt[0]):Mt="MultiLineString"),Mt!=="Point"&&Mt!=="MultiPoint"||(Mt=qt.length===3?"Point":"MultiPoint"),We.push(re(ct.id,Mt,qt,ct.tags))}}return We.length?We:null}function Ce(pt,ze,Ge,Oe,ve){for(let ge=0;ge=Ge&&be<=Oe&&Ke(ze,pt[ge],pt[ge+1],pt[ge+2])}}function qe(pt,ze,Ge,Oe,ve,ge,be){let Pe=et(pt);const We=ve===0?Xe:Me;let ct,_t,Mt=pt.start;for(let lr=0;lrGe&&(_t=We(Pe,ta,da,ma,Ia,Ge),be&&(Pe.start=Mt+ct*_t)):va>Oe?La=Ge&&(_t=We(Pe,ta,da,ma,Ia,Ge),Ka=!0),La>Oe&&va<=Oe&&(_t=We(Pe,ta,da,ma,Ia,Oe),Ka=!0),!ge&&Ka&&(be&&(Pe.end=Mt+ct*_t),ze.push(Pe),Pe=et(pt)),be&&(Mt+=ct)}let Nt=pt.length-3;const Bt=pt[Nt],qt=pt[Nt+1],Zt=ve===0?Bt:qt;Zt>=Ge&&Zt<=Oe&&Ke(Pe,Bt,qt,pt[Nt+2]),Nt=Pe.length-3,ge&&Nt>=3&&(Pe[Nt]!==Pe[0]||Pe[Nt+1]!==Pe[1])&&Ke(Pe,Pe[0],Pe[1],Pe[2]),Pe.length&&ze.push(Pe)}function et(pt){const ze=[];return ze.size=pt.size,ze.start=pt.start,ze.end=pt.end,ze}function Qe(pt,ze,Ge,Oe,ve,ge){for(const be of pt)qe(be,ze,Ge,Oe,ve,ge,!1)}function Ke(pt,ze,Ge,Oe){pt.push(ze,Ge,Oe)}function Xe(pt,ze,Ge,Oe,ve,ge){const be=(ge-ze)/(Oe-ze);return Ke(pt,ge,Ge+(ve-Ge)*be,1),be}function Me(pt,ze,Ge,Oe,ve,ge){const be=(ge-Ge)/(ve-Ge);return Ke(pt,ze+(Oe-ze)*be,ge,1),be}function xe(pt,ze){const Ge=[];for(let Oe=0;Oe0&&ze.size<(ve?be:Oe))return void(Ge.numPoints+=ze.length/3);const Pe=[];for(let We=0;Webe)&&(Ge.numSimplified++,Pe.push(ze[We],ze[We+1])),Ge.numPoints++;ve&&function(We,ct){let _t=0;for(let Mt=0,Nt=We.length,Bt=Nt-2;Mt0===ct)for(let Mt=0,Nt=We.length;Mt24)throw new Error("maxZoom should be in the 0-24 range");if(Ge.promoteId&&Ge.generateId)throw new Error("promoteId and generateId cannot be used together.");let ve=function(ge,be){const Pe=[];if(ge.type==="FeatureCollection")for(let We=0;We1&&console.time("creation"),Bt=this.tiles[Nt]=rt(ze,Ge,Oe,ve,ct),this.tileCoords.push({z:Ge,x:Oe,y:ve}),_t)){_t>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Ge,Oe,ve,Bt.numFeatures,Bt.numPoints,Bt.numSimplified),console.timeEnd("creation"));const Ka=`z${Ge}`;this.stats[Ka]=(this.stats[Ka]||0)+1,this.total++}if(Bt.source=ze,ge==null){if(Ge===ct.indexMaxZoom||Bt.numPoints<=ct.indexMaxPoints)continue}else{if(Ge===ct.maxZoom||Ge===ge)continue;if(ge!=null){const Ka=ge-Ge;if(Oe!==be>>Ka||ve!==Pe>>Ka)continue}}if(Bt.source=null,ze.length===0)continue;_t>1&&console.time("clipping");const qt=.5*ct.buffer/ct.extent,Zt=.5-qt,lr=.5+qt,ta=1+qt;let da=null,wa=null,ma=null,Ia=null,va=Fe(ze,Mt,Oe-qt,Oe+lr,0,Bt.minX,Bt.maxX,ct),La=Fe(ze,Mt,Oe+Zt,Oe+ta,0,Bt.minX,Bt.maxX,ct);ze=null,va&&(da=Fe(va,Mt,ve-qt,ve+lr,1,Bt.minY,Bt.maxY,ct),wa=Fe(va,Mt,ve+Zt,ve+ta,1,Bt.minY,Bt.maxY,ct),va=null),La&&(ma=Fe(La,Mt,ve-qt,ve+lr,1,Bt.minY,Bt.maxY,ct),Ia=Fe(La,Mt,ve+Zt,ve+ta,1,Bt.minY,Bt.maxY,ct),La=null),_t>1&&console.timeEnd("clipping"),We.push(da||[],Ge+1,2*Oe,2*ve),We.push(wa||[],Ge+1,2*Oe,2*ve+1),We.push(ma||[],Ge+1,2*Oe+1,2*ve),We.push(Ia||[],Ge+1,2*Oe+1,2*ve+1)}}getTile(ze,Ge,Oe){ze=+ze,Ge=+Ge,Oe=+Oe;const ve=this.options,{extent:ge,debug:be}=ve;if(ze<0||ze>24)return null;const Pe=1<1&&console.log("drilling down to z%d-%d-%d",ze,Ge,Oe);let ct,_t=ze,Mt=Ge,Nt=Oe;for(;!ct&&_t>0;)_t--,Mt>>=1,Nt>>=1,ct=this.tiles[Ut(_t,Mt,Nt)];return ct&&ct.source?(be>1&&(console.log("found parent tile z%d-%d-%d",_t,Mt,Nt),console.time("drilling down")),this.splitTile(ct.source,_t,Mt,Nt,ze,Ge,Oe),be>1&&console.timeEnd("drilling down"),this.tiles[We]?Re(this.tiles[We],ge):null):null}}function Ut(pt,ze,Ge){return 32*((1<{Mt.properties=Bt;const qt={};for(const Zt of Nt)qt[Zt]=We[Zt].evaluate(_t,Mt);return qt},be.reduce=(Bt,qt)=>{Mt.properties=qt;for(const Zt of Nt)_t.accumulated=Bt[Zt],Bt[Zt]=ct[Zt].evaluate(_t,Mt)},be}(ze)).load((yield this._pendingData).features):(ve=yield this._pendingData,new Rt(ve,ze.geojsonVtOptions)),this.loaded={};const ge={};if(Oe){const be=Oe.finish();be&&(ge.resourceTiming={},ge.resourceTiming[ze.source]=JSON.parse(JSON.stringify(be)))}return ge}catch(ge){if(delete this._pendingRequest,e.bB(ge))return{abandoned:!0};throw ge}var ve})}getData(){return e._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(ze){const Ge=this.loaded;return Ge&&Ge[ze.uid]?super.reloadTile(ze):this.loadTile(ze)}loadAndProcessGeoJSON(ze,Ge){return e._(this,void 0,void 0,function*(){let Oe=yield this.loadGeoJSON(ze,Ge);if(delete this._pendingRequest,typeof Oe!="object")throw new Error(`Input data given to '${ze.source}' is not a valid GeoJSON object.`);if(f(Oe,!0),ze.filter){const ve=e.bC(ze.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ve.result==="error")throw new Error(ve.value.map(be=>`${be.key}: ${be.message}`).join(", "));Oe={type:"FeatureCollection",features:Oe.features.filter(be=>ve.value.evaluate({zoom:0},be))}}return Oe})}loadGeoJSON(ze,Ge){return e._(this,void 0,void 0,function*(){const{promoteId:Oe}=ze;if(ze.request){const ve=yield e.h(ze.request,Ge);return this._dataUpdateable=ar(ve.data,Oe)?Mr(ve.data,Oe):void 0,ve.data}if(typeof ze.data=="string")try{const ve=JSON.parse(ze.data);return this._dataUpdateable=ar(ve,Oe)?Mr(ve,Oe):void 0,ve}catch{throw new Error(`Input data given to '${ze.source}' is not a valid GeoJSON object.`)}if(!ze.dataDiff)throw new Error(`Input data given to '${ze.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${ze.source}`);return function(ve,ge,be){var Pe,We,ct,_t;if(ge.removeAll&&ve.clear(),ge.remove)for(const Mt of ge.remove)ve.delete(Mt);if(ge.add)for(const Mt of ge.add){const Nt=ir(Mt,be);Nt!=null&&ve.set(Nt,Mt)}if(ge.update)for(const Mt of ge.update){let Nt=ve.get(Mt.id);if(Nt==null)continue;const Bt=!Mt.removeAllProperties&&(((Pe=Mt.removeProperties)===null||Pe===void 0?void 0:Pe.length)>0||((We=Mt.addOrUpdateProperties)===null||We===void 0?void 0:We.length)>0);if((Mt.newGeometry||Mt.removeAllProperties||Bt)&&(Nt=Object.assign({},Nt),ve.set(Mt.id,Nt),Bt&&(Nt.properties=Object.assign({},Nt.properties))),Mt.newGeometry&&(Nt.geometry=Mt.newGeometry),Mt.removeAllProperties)Nt.properties={};else if(((ct=Mt.removeProperties)===null||ct===void 0?void 0:ct.length)>0)for(const qt of Mt.removeProperties)Object.prototype.hasOwnProperty.call(Nt.properties,qt)&&delete Nt.properties[qt];if(((_t=Mt.addOrUpdateProperties)===null||_t===void 0?void 0:_t.length)>0)for(const{key:qt,value:Zt}of Mt.addOrUpdateProperties)Nt.properties[qt]=Zt}}(this._dataUpdateable,ze.dataDiff,Oe),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(ze){return e._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(ze){return this._geoJSONIndex.getClusterExpansionZoom(ze.clusterId)}getClusterChildren(ze){return this._geoJSONIndex.getChildren(ze.clusterId)}getClusterLeaves(ze){return this._geoJSONIndex.getLeaves(ze.clusterId,ze.limit,ze.offset)}}class dr{constructor(ze){this.self=ze,this.actor=new e.F(ze),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(Ge,Oe)=>{if(this.externalWorkerSourceTypes[Ge])throw new Error(`Worker source with name "${Ge}" already registered.`);this.externalWorkerSourceTypes[Ge]=Oe},this.self.addProtocol=e.bi,this.self.removeProtocol=e.bj,this.self.registerRTLTextPlugin=Ge=>{if(e.bD.isParsed())throw new Error("RTL text plugin already registered.");e.bD.setMethods(Ge)},this.actor.registerMessageHandler("LDT",(Ge,Oe)=>this._getDEMWorkerSource(Ge,Oe.source).loadTile(Oe)),this.actor.registerMessageHandler("RDT",(Ge,Oe)=>e._(this,void 0,void 0,function*(){this._getDEMWorkerSource(Ge,Oe.source).removeTile(Oe)})),this.actor.registerMessageHandler("GCEZ",(Ge,Oe)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Ge,Oe.type,Oe.source).getClusterExpansionZoom(Oe)})),this.actor.registerMessageHandler("GCC",(Ge,Oe)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Ge,Oe.type,Oe.source).getClusterChildren(Oe)})),this.actor.registerMessageHandler("GCL",(Ge,Oe)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Ge,Oe.type,Oe.source).getClusterLeaves(Oe)})),this.actor.registerMessageHandler("LD",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).loadData(Oe)),this.actor.registerMessageHandler("GD",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).getData()),this.actor.registerMessageHandler("LT",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).loadTile(Oe)),this.actor.registerMessageHandler("RT",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).reloadTile(Oe)),this.actor.registerMessageHandler("AT",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).abortTile(Oe)),this.actor.registerMessageHandler("RMT",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).removeTile(Oe)),this.actor.registerMessageHandler("RS",(Ge,Oe)=>e._(this,void 0,void 0,function*(){if(!this.workerSources[Ge]||!this.workerSources[Ge][Oe.type]||!this.workerSources[Ge][Oe.type][Oe.source])return;const ve=this.workerSources[Ge][Oe.type][Oe.source];delete this.workerSources[Ge][Oe.type][Oe.source],ve.removeSource!==void 0&&ve.removeSource(Oe)})),this.actor.registerMessageHandler("RM",Ge=>e._(this,void 0,void 0,function*(){delete this.layerIndexes[Ge],delete this.availableImages[Ge],delete this.workerSources[Ge],delete this.demWorkerSources[Ge]})),this.actor.registerMessageHandler("SR",(Ge,Oe)=>e._(this,void 0,void 0,function*(){this.referrer=Oe})),this.actor.registerMessageHandler("SRPS",(Ge,Oe)=>this._syncRTLPluginState(Ge,Oe)),this.actor.registerMessageHandler("IS",(Ge,Oe)=>e._(this,void 0,void 0,function*(){this.self.importScripts(Oe)})),this.actor.registerMessageHandler("SI",(Ge,Oe)=>this._setImages(Ge,Oe)),this.actor.registerMessageHandler("UL",(Ge,Oe)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(Ge).update(Oe.layers,Oe.removedIds)})),this.actor.registerMessageHandler("SL",(Ge,Oe)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(Ge).replace(Oe)}))}_setImages(ze,Ge){return e._(this,void 0,void 0,function*(){this.availableImages[ze]=Ge;for(const Oe in this.workerSources[ze]){const ve=this.workerSources[ze][Oe];for(const ge in ve)ve[ge].availableImages=Ge}})}_syncRTLPluginState(ze,Ge){return e._(this,void 0,void 0,function*(){if(e.bD.isParsed())return e.bD.getState();if(Ge.pluginStatus!=="loading")return e.bD.setState(Ge),Ge;const Oe=Ge.pluginURL;if(this.self.importScripts(Oe),e.bD.isParsed()){const ve={pluginStatus:"loaded",pluginURL:Oe};return e.bD.setState(ve),ve}throw e.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${Oe}`)})}_getAvailableImages(ze){let Ge=this.availableImages[ze];return Ge||(Ge=[]),Ge}_getLayerIndex(ze){let Ge=this.layerIndexes[ze];return Ge||(Ge=this.layerIndexes[ze]=new t),Ge}_getWorkerSource(ze,Ge,Oe){if(this.workerSources[ze]||(this.workerSources[ze]={}),this.workerSources[ze][Ge]||(this.workerSources[ze][Ge]={}),!this.workerSources[ze][Ge][Oe]){const ve={sendAsync:(ge,be)=>(ge.targetMapId=ze,this.actor.sendAsync(ge,be))};switch(Ge){case"vector":this.workerSources[ze][Ge][Oe]=new i(ve,this._getLayerIndex(ze),this._getAvailableImages(ze));break;case"geojson":this.workerSources[ze][Ge][Oe]=new fr(ve,this._getLayerIndex(ze),this._getAvailableImages(ze));break;default:this.workerSources[ze][Ge][Oe]=new this.externalWorkerSourceTypes[Ge](ve,this._getLayerIndex(ze),this._getAvailableImages(ze))}}return this.workerSources[ze][Ge][Oe]}_getDEMWorkerSource(ze,Ge){return this.demWorkerSources[ze]||(this.demWorkerSources[ze]={}),this.demWorkerSources[ze][Ge]||(this.demWorkerSources[ze][Ge]=new n),this.demWorkerSources[ze][Ge]}}return e.i(self)&&(self.worker=new dr(self)),dr}),A("index",["exports","./shared"],function(e,t){var r="4.7.1";let o,a;const i={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:De=>new Promise((I,ne)=>{const Te=requestAnimationFrame(I);De.signal.addEventListener("abort",()=>{cancelAnimationFrame(Te),ne(t.c())})}),getImageData(De,I=0){return this.getImageCanvasContext(De).getImageData(-I,-I,De.width+2*I,De.height+2*I)},getImageCanvasContext(De){const I=window.document.createElement("canvas"),ne=I.getContext("2d",{willReadFrequently:!0});if(!ne)throw new Error("failed to create canvas 2d context");return I.width=De.width,I.height=De.height,ne.drawImage(De,0,0,De.width,De.height),ne},resolveURL:De=>(o||(o=document.createElement("a")),o.href=De,o.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(a==null&&(a=matchMedia("(prefers-reduced-motion: reduce)")),a.matches)}};class n{static testProp(I){if(!n.docStyle)return I[0];for(let ne=0;ne{window.removeEventListener("click",n.suppressClickInternal,!0)},0)}static getScale(I){const ne=I.getBoundingClientRect();return{x:ne.width/I.offsetWidth||1,y:ne.height/I.offsetHeight||1,boundingClientRect:ne}}static getPoint(I,ne,Te){const Se=ne.boundingClientRect;return new t.P((Te.clientX-Se.left)/ne.x-I.clientLeft,(Te.clientY-Se.top)/ne.y-I.clientTop)}static mousePos(I,ne){const Te=n.getScale(I);return n.getPoint(I,Te,ne)}static touchPos(I,ne){const Te=[],Se=n.getScale(I);for(let Ie=0;Ie{c&&T(c),c=null,h=!0},f.onerror=()=>{v=!0,c=null},f.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(De){let I,ne,Te,Se;De.resetRequestQueue=()=>{I=[],ne=0,Te=0,Se={}},De.addThrottleControl=Ct=>{const Wt=Te++;return Se[Wt]=Ct,Wt},De.removeThrottleControl=Ct=>{delete Se[Ct],ot()},De.getImage=(Ct,Wt,nr=!0)=>new Promise((or,Fr)=>{s.supported&&(Ct.headers||(Ct.headers={}),Ct.headers.accept="image/webp,*/*"),t.e(Ct,{type:"image"}),I.push({abortController:Wt,requestParameters:Ct,supportImageRefresh:nr,state:"queued",onError:Wr=>{Fr(Wr)},onSuccess:Wr=>{or(Wr)}}),ot()});const Ie=Ct=>t._(this,void 0,void 0,function*(){Ct.state="running";const{requestParameters:Wt,supportImageRefresh:nr,onError:or,onSuccess:Fr,abortController:Wr}=Ct,je=nr===!1&&!t.i(self)&&!t.g(Wt.url)&&(!Wt.headers||Object.keys(Wt.headers).reduce((lt,Tt)=>lt&&Tt==="accept",!0));ne++;const Ze=je?yt(Wt,Wr):t.m(Wt,Wr);try{const lt=yield Ze;delete Ct.abortController,Ct.state="completed",lt.data instanceof HTMLImageElement||t.b(lt.data)?Fr(lt):lt.data&&Fr({data:yield(at=lt.data,typeof createImageBitmap=="function"?t.d(at):t.f(at)),cacheControl:lt.cacheControl,expires:lt.expires})}catch(lt){delete Ct.abortController,or(lt)}finally{ne--,ot()}var at}),ot=()=>{const Ct=(()=>{for(const Wt of Object.keys(Se))if(Se[Wt]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let Wt=ne;Wt0;Wt++){const nr=I.shift();nr.abortController.signal.aborted?Wt--:Ie(nr)}},yt=(Ct,Wt)=>new Promise((nr,or)=>{const Fr=new Image,Wr=Ct.url,je=Ct.credentials;je&&je==="include"?Fr.crossOrigin="use-credentials":(je&&je==="same-origin"||!t.s(Wr))&&(Fr.crossOrigin="anonymous"),Wt.signal.addEventListener("abort",()=>{Fr.src="",or(t.c())}),Fr.fetchPriority="high",Fr.onload=()=>{Fr.onerror=Fr.onload=null,nr({data:Fr})},Fr.onerror=()=>{Fr.onerror=Fr.onload=null,Wt.signal.aborted||or(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."))},Fr.src=Wr})}(l||(l={})),l.resetRequestQueue();class y{constructor(I){this._transformRequestFn=I}transformRequest(I,ne){return this._transformRequestFn&&this._transformRequestFn(I,ne)||{url:I}}setTransformRequest(I){this._transformRequestFn=I}}function b(De){var I=new t.A(3);return I[0]=De[0],I[1]=De[1],I[2]=De[2],I}var S,M=function(De,I,ne){return De[0]=I[0]-ne[0],De[1]=I[1]-ne[1],De[2]=I[2]-ne[2],De};S=new t.A(3),t.A!=Float32Array&&(S[0]=0,S[1]=0,S[2]=0);var _=function(De){var I=De[0],ne=De[1];return I*I+ne*ne};function w(De){const I=[];if(typeof De=="string")I.push({id:"default",url:De});else if(De&&De.length>0){const ne=[];for(const{id:Te,url:Se}of De){const Ie=`${Te}${Se}`;ne.indexOf(Ie)===-1&&(ne.push(Ie),I.push({id:Te,url:Se}))}}return I}function p(De,I,ne){const Te=De.split("?");return Te[0]+=`${I}${ne}`,Te.join("?")}(function(){var De=new t.A(2);t.A!=Float32Array&&(De[0]=0,De[1]=0)})();class u{constructor(I,ne,Te,Se){this.context=I,this.format=Te,this.texture=I.gl.createTexture(),this.update(ne,Se)}update(I,ne,Te){const{width:Se,height:Ie}=I,ot=!(this.size&&this.size[0]===Se&&this.size[1]===Ie||Te),{context:yt}=this,{gl:Ct}=yt;if(this.useMipmap=!!(ne&&ne.useMipmap),Ct.bindTexture(Ct.TEXTURE_2D,this.texture),yt.pixelStoreUnpackFlipY.set(!1),yt.pixelStoreUnpack.set(1),yt.pixelStoreUnpackPremultiplyAlpha.set(this.format===Ct.RGBA&&(!ne||ne.premultiply!==!1)),ot)this.size=[Se,Ie],I instanceof HTMLImageElement||I instanceof HTMLCanvasElement||I instanceof HTMLVideoElement||I instanceof ImageData||t.b(I)?Ct.texImage2D(Ct.TEXTURE_2D,0,this.format,this.format,Ct.UNSIGNED_BYTE,I):Ct.texImage2D(Ct.TEXTURE_2D,0,this.format,Se,Ie,0,this.format,Ct.UNSIGNED_BYTE,I.data);else{const{x:Wt,y:nr}=Te||{x:0,y:0};I instanceof HTMLImageElement||I instanceof HTMLCanvasElement||I instanceof HTMLVideoElement||I instanceof ImageData||t.b(I)?Ct.texSubImage2D(Ct.TEXTURE_2D,0,Wt,nr,Ct.RGBA,Ct.UNSIGNED_BYTE,I):Ct.texSubImage2D(Ct.TEXTURE_2D,0,Wt,nr,Se,Ie,Ct.RGBA,Ct.UNSIGNED_BYTE,I.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Ct.generateMipmap(Ct.TEXTURE_2D)}bind(I,ne,Te){const{context:Se}=this,{gl:Ie}=Se;Ie.bindTexture(Ie.TEXTURE_2D,this.texture),Te!==Ie.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(Te=Ie.LINEAR),I!==this.filter&&(Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_MAG_FILTER,I),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_MIN_FILTER,Te||I),this.filter=I),ne!==this.wrap&&(Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_WRAP_S,ne),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_WRAP_T,ne),this.wrap=ne)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:I}=this.context;I.deleteTexture(this.texture),this.texture=null}}function g(De){const{userImage:I}=De;return!!(I&&I.render&&I.render())&&(De.data.replace(new Uint8Array(I.data.buffer)),!0)}class m extends t.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(I){if(this.loaded!==I&&(this.loaded=I,I)){for(const{ids:ne,promiseResolve:Te}of this.requestors)Te(this._getImagesForIds(ne));this.requestors=[]}}getImage(I){const ne=this.images[I];if(ne&&!ne.data&&ne.spriteData){const Te=ne.spriteData;ne.data=new t.R({width:Te.width,height:Te.height},Te.context.getImageData(Te.x,Te.y,Te.width,Te.height).data),ne.spriteData=null}return ne}addImage(I,ne){if(this.images[I])throw new Error(`Image id ${I} already exist, use updateImage instead`);this._validate(I,ne)&&(this.images[I]=ne)}_validate(I,ne){let Te=!0;const Se=ne.data||ne.spriteData;return this._validateStretch(ne.stretchX,Se&&Se.width)||(this.fire(new t.j(new Error(`Image "${I}" has invalid "stretchX" value`))),Te=!1),this._validateStretch(ne.stretchY,Se&&Se.height)||(this.fire(new t.j(new Error(`Image "${I}" has invalid "stretchY" value`))),Te=!1),this._validateContent(ne.content,ne)||(this.fire(new t.j(new Error(`Image "${I}" has invalid "content" value`))),Te=!1),Te}_validateStretch(I,ne){if(!I)return!0;let Te=0;for(const Se of I){if(Se[0]{let Se=!0;if(!this.isLoaded())for(const Ie of I)this.images[Ie]||(Se=!1);this.isLoaded()||Se?ne(this._getImagesForIds(I)):this.requestors.push({ids:I,promiseResolve:ne})})}_getImagesForIds(I){const ne={};for(const Te of I){let Se=this.getImage(Te);Se||(this.fire(new t.k("styleimagemissing",{id:Te})),Se=this.getImage(Te)),Se?ne[Te]={data:Se.data.clone(),pixelRatio:Se.pixelRatio,sdf:Se.sdf,version:Se.version,stretchX:Se.stretchX,stretchY:Se.stretchY,content:Se.content,textFitWidth:Se.textFitWidth,textFitHeight:Se.textFitHeight,hasRenderCallback:!!(Se.userImage&&Se.userImage.render)}:t.w(`Image "${Te}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return ne}getPixelSize(){const{width:I,height:ne}=this.atlasImage;return{width:I,height:ne}}getPattern(I){const ne=this.patterns[I],Te=this.getImage(I);if(!Te)return null;if(ne&&ne.position.version===Te.version)return ne.position;if(ne)ne.position.version=Te.version;else{const Se={w:Te.data.width+2,h:Te.data.height+2,x:0,y:0},Ie=new t.I(Se,Te);this.patterns[I]={bin:Se,position:Ie}}return this._updatePatternAtlas(),this.patterns[I].position}bind(I){const ne=I.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u(I,this.atlasImage,ne.RGBA),this.atlasTexture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE)}_updatePatternAtlas(){const I=[];for(const Ie in this.patterns)I.push(this.patterns[Ie].bin);const{w:ne,h:Te}=t.p(I),Se=this.atlasImage;Se.resize({width:ne||1,height:Te||1});for(const Ie in this.patterns){const{bin:ot}=this.patterns[Ie],yt=ot.x+1,Ct=ot.y+1,Wt=this.getImage(Ie).data,nr=Wt.width,or=Wt.height;t.R.copy(Wt,Se,{x:0,y:0},{x:yt,y:Ct},{width:nr,height:or}),t.R.copy(Wt,Se,{x:0,y:or-1},{x:yt,y:Ct-1},{width:nr,height:1}),t.R.copy(Wt,Se,{x:0,y:0},{x:yt,y:Ct+or},{width:nr,height:1}),t.R.copy(Wt,Se,{x:nr-1,y:0},{x:yt-1,y:Ct},{width:1,height:or}),t.R.copy(Wt,Se,{x:0,y:0},{x:yt+nr,y:Ct},{width:1,height:or})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(I){for(const ne of I){if(this.callbackDispatchedThisFrame[ne])continue;this.callbackDispatchedThisFrame[ne]=!0;const Te=this.getImage(ne);Te||t.w(`Image with ID: "${ne}" was not found`),g(Te)&&this.updateImage(ne,Te)}}}const R=1e20;function P(De,I,ne,Te,Se,Ie,ot,yt,Ct){for(let Wt=I;Wt-1);Ct++,Ie[Ct]=yt,ot[Ct]=Wt,ot[Ct+1]=R}for(let yt=0,Ct=0;yt65535)throw new Error("glyphs > 65535 not supported");if(Te.ranges[Ie])return{stack:I,id:ne,glyph:Se};if(!this.url)throw new Error("glyphsUrl is not set");if(!Te.requests[Ie]){const yt=F.loadGlyphRange(I,Ie,this.url,this.requestManager);Te.requests[Ie]=yt}const ot=yield Te.requests[Ie];for(const yt in ot)this._doesCharSupportLocalGlyph(+yt)||(Te.glyphs[+yt]=ot[+yt]);return Te.ranges[Ie]=!0,{stack:I,id:ne,glyph:ot[ne]||null}})}_doesCharSupportLocalGlyph(I){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(I))}_tinySDF(I,ne,Te){const Se=this.localIdeographFontFamily;if(!Se||!this._doesCharSupportLocalGlyph(Te))return;let Ie=I.tinySDF;if(!Ie){let yt="400";/bold/i.test(ne)?yt="900":/medium/i.test(ne)?yt="500":/light/i.test(ne)&&(yt="200"),Ie=I.tinySDF=new F.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:Se,fontWeight:yt})}const ot=Ie.draw(String.fromCharCode(Te));return{id:Te,bitmap:new t.o({width:ot.width||60,height:ot.height||60},ot.data),metrics:{width:ot.glyphWidth/2||24,height:ot.glyphHeight/2||24,left:ot.glyphLeft/2+.5||0,top:ot.glyphTop/2-27.5||-8,advance:ot.glyphAdvance/2||24,isDoubleResolution:!0}}}}F.loadGlyphRange=function(De,I,ne,Te){return t._(this,void 0,void 0,function*(){const Se=256*I,Ie=Se+255,ot=Te.transformRequest(ne.replace("{fontstack}",De).replace("{range}",`${Se}-${Ie}`),"Glyphs"),yt=yield t.l(ot,new AbortController);if(!yt||!yt.data)throw new Error(`Could not load glyph range. range: ${I}, ${Se}-${Ie}`);const Ct={};for(const Wt of t.n(yt.data))Ct[Wt.id]=Wt;return Ct})},F.TinySDF=class{constructor({fontSize:De=24,buffer:I=3,radius:ne=8,cutoff:Te=.25,fontFamily:Se="sans-serif",fontWeight:Ie="normal",fontStyle:ot="normal"}={}){this.buffer=I,this.cutoff=Te,this.radius=ne;const yt=this.size=De+4*I,Ct=this._createCanvas(yt),Wt=this.ctx=Ct.getContext("2d",{willReadFrequently:!0});Wt.font=`${ot} ${Ie} ${De}px ${Se}`,Wt.textBaseline="alphabetic",Wt.textAlign="left",Wt.fillStyle="black",this.gridOuter=new Float64Array(yt*yt),this.gridInner=new Float64Array(yt*yt),this.f=new Float64Array(yt),this.z=new Float64Array(yt+1),this.v=new Uint16Array(yt)}_createCanvas(De){const I=document.createElement("canvas");return I.width=I.height=De,I}draw(De){const{width:I,actualBoundingBoxAscent:ne,actualBoundingBoxDescent:Te,actualBoundingBoxLeft:Se,actualBoundingBoxRight:Ie}=this.ctx.measureText(De),ot=Math.ceil(ne),yt=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(Ie-Se))),Ct=Math.min(this.size-this.buffer,ot+Math.ceil(Te)),Wt=yt+2*this.buffer,nr=Ct+2*this.buffer,or=Math.max(Wt*nr,0),Fr=new Uint8ClampedArray(or),Wr={data:Fr,width:Wt,height:nr,glyphWidth:yt,glyphHeight:Ct,glyphTop:ot,glyphLeft:0,glyphAdvance:I};if(yt===0||Ct===0)return Wr;const{ctx:je,buffer:Ze,gridInner:at,gridOuter:lt}=this;je.clearRect(Ze,Ze,yt,Ct),je.fillText(De,Ze,Ze+ot);const Tt=je.getImageData(Ze,Ze,yt,Ct);lt.fill(R,0,or),at.fill(0,0,or);for(let gt=0;gt0?sr*sr:0,at[rr]=sr<0?sr*sr:0}}P(lt,0,0,Wt,nr,Wt,this.f,this.v,this.z),P(at,Ze,Ze,yt,Ct,Wt,this.f,this.v,this.z);for(let gt=0;gt1&&(Ct=I[++yt]);const nr=Math.abs(Wt-Ct.left),or=Math.abs(Wt-Ct.right),Fr=Math.min(nr,or);let Wr;const je=Ie/Te*(Se+1);if(Ct.isDash){const Ze=Se-Math.abs(je);Wr=Math.sqrt(Fr*Fr+Ze*Ze)}else Wr=Se-Math.sqrt(Fr*Fr+je*je);this.data[ot+Wt]=Math.max(0,Math.min(255,Wr+128))}}}addRegularDash(I){for(let yt=I.length-1;yt>=0;--yt){const Ct=I[yt],Wt=I[yt+1];Ct.zeroLength?I.splice(yt,1):Wt&&Wt.isDash===Ct.isDash&&(Wt.left=Ct.left,I.splice(yt,1))}const ne=I[0],Te=I[I.length-1];ne.isDash===Te.isDash&&(ne.left=Te.left-this.width,Te.right=ne.right+this.width);const Se=this.width*this.nextRow;let Ie=0,ot=I[Ie];for(let yt=0;yt1&&(ot=I[++Ie]);const Ct=Math.abs(yt-ot.left),Wt=Math.abs(yt-ot.right),nr=Math.min(Ct,Wt);this.data[Se+yt]=Math.max(0,Math.min(255,(ot.isDash?nr:-nr)+128))}}addDash(I,ne){const Te=ne?7:0,Se=2*Te+1;if(this.nextRow+Se>this.height)return t.w("LineAtlas out of space"),null;let Ie=0;for(let yt=0;yt{ne.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Q]}numActive(){return Object.keys(this.active).length}}const oe=Math.floor(i.hardwareConcurrency/2);let le,j;function J(){return le||(le=new ue),le}ue.workerCount=t.C(globalThis)?Math.max(Math.min(oe,3),1):1;class ${constructor(I,ne){this.workerPool=I,this.actors=[],this.currentActor=0,this.id=ne;const Te=this.workerPool.acquire(ne);for(let Se=0;Se{ne.remove()}),this.actors=[],I&&this.workerPool.release(this.id)}registerMessageHandler(I,ne){for(const Te of this.actors)Te.registerMessageHandler(I,ne)}}function X(){return j||(j=new $(J(),t.G),j.registerMessageHandler("GR",(De,I,ne)=>t.m(I,ne))),j}function re(De,I){const ne=t.H();return t.J(ne,ne,[1,1,0]),t.K(ne,ne,[.5*De.width,.5*De.height,1]),t.L(ne,ne,De.calculatePosMatrix(I.toUnwrapped()))}function ee(De,I,ne,Te,Se,Ie){const ot=function(or,Fr,Wr){if(or)for(const je of or){const Ze=Fr[je];if(Ze&&Ze.source===Wr&&Ze.type==="fill-extrusion")return!0}else for(const je in Fr){const Ze=Fr[je];if(Ze.source===Wr&&Ze.type==="fill-extrusion")return!0}return!1}(Se&&Se.layers,I,De.id),yt=Ie.maxPitchScaleFactor(),Ct=De.tilesIn(Te,yt,ot);Ct.sort(q);const Wt=[];for(const or of Ct)Wt.push({wrappedTileID:or.tileID.wrapped().key,queryResults:or.tile.queryRenderedFeatures(I,ne,De._state,or.queryGeometry,or.cameraQueryGeometry,or.scale,Se,Ie,yt,re(De.transform,or.tileID))});const nr=function(or){const Fr={},Wr={};for(const je of or){const Ze=je.queryResults,at=je.wrappedTileID,lt=Wr[at]=Wr[at]||{};for(const Tt in Ze){const gt=Ze[Tt],Et=lt[Tt]=lt[Tt]||{},Yt=Fr[Tt]=Fr[Tt]||[];for(const rr of gt)Et[rr.featureIndex]||(Et[rr.featureIndex]=!0,Yt.push(rr))}}return Fr}(Wt);for(const or in nr)nr[or].forEach(Fr=>{const Wr=Fr.feature,je=De.getFeatureState(Wr.layer["source-layer"],Wr.id);Wr.source=Wr.layer.source,Wr.layer["source-layer"]&&(Wr.sourceLayer=Wr.layer["source-layer"]),Wr.state=je});return nr}function q(De,I){const ne=De.tileID,Te=I.tileID;return ne.overscaledZ-Te.overscaledZ||ne.canonical.y-Te.canonical.y||ne.wrap-Te.wrap||ne.canonical.x-Te.canonical.x}function ae(De,I,ne){return t._(this,void 0,void 0,function*(){let Te=De;if(De.url?Te=(yield t.h(I.transformRequest(De.url,"Source"),ne)).data:yield i.frameAsync(ne),!Te)return null;const Se=t.M(t.e(Te,De),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in Te&&Te.vector_layers&&(Se.vectorLayerIds=Te.vector_layers.map(Ie=>Ie.id)),Se})}class ie{constructor(I,ne){I&&(ne?this.setSouthWest(I).setNorthEast(ne):Array.isArray(I)&&(I.length===4?this.setSouthWest([I[0],I[1]]).setNorthEast([I[2],I[3]]):this.setSouthWest(I[0]).setNorthEast(I[1])))}setNorthEast(I){return this._ne=I instanceof t.N?new t.N(I.lng,I.lat):t.N.convert(I),this}setSouthWest(I){return this._sw=I instanceof t.N?new t.N(I.lng,I.lat):t.N.convert(I),this}extend(I){const ne=this._sw,Te=this._ne;let Se,Ie;if(I instanceof t.N)Se=I,Ie=I;else{if(!(I instanceof ie))return Array.isArray(I)?I.length===4||I.every(Array.isArray)?this.extend(ie.convert(I)):this.extend(t.N.convert(I)):I&&("lng"in I||"lon"in I)&&"lat"in I?this.extend(t.N.convert(I)):this;if(Se=I._sw,Ie=I._ne,!Se||!Ie)return this}return ne||Te?(ne.lng=Math.min(Se.lng,ne.lng),ne.lat=Math.min(Se.lat,ne.lat),Te.lng=Math.max(Ie.lng,Te.lng),Te.lat=Math.max(Ie.lat,Te.lat)):(this._sw=new t.N(Se.lng,Se.lat),this._ne=new t.N(Ie.lng,Ie.lat)),this}getCenter(){return new t.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new t.N(this.getWest(),this.getNorth())}getSouthEast(){return new t.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(I){const{lng:ne,lat:Te}=t.N.convert(I);let Se=this._sw.lng<=ne&&ne<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Se=this._sw.lng>=ne&&ne>=this._ne.lng),this._sw.lat<=Te&&Te<=this._ne.lat&&Se}static convert(I){return I instanceof ie?I:I&&new ie(I)}static fromLngLat(I,ne=0){const Te=360*ne/40075017,Se=Te/Math.cos(Math.PI/180*I.lat);return new ie(new t.N(I.lng-Se,I.lat-Te),new t.N(I.lng+Se,I.lat+Te))}adjustAntiMeridian(){const I=new t.N(this._sw.lng,this._sw.lat),ne=new t.N(this._ne.lng,this._ne.lat);return new ie(I,I.lng>ne.lng?new t.N(ne.lng+360,ne.lat):ne)}}class fe{constructor(I,ne,Te){this.bounds=ie.convert(this.validateBounds(I)),this.minzoom=ne||0,this.maxzoom=Te||24}validateBounds(I){return Array.isArray(I)&&I.length===4?[Math.max(-180,I[0]),Math.max(-90,I[1]),Math.min(180,I[2]),Math.min(90,I[3])]:[-180,-90,180,90]}contains(I){const ne=Math.pow(2,I.z),Te=Math.floor(t.O(this.bounds.getWest())*ne),Se=Math.floor(t.Q(this.bounds.getNorth())*ne),Ie=Math.ceil(t.O(this.bounds.getEast())*ne),ot=Math.ceil(t.Q(this.bounds.getSouth())*ne);return I.x>=Te&&I.x=Se&&I.y{this._options.tiles=I}),this}setUrl(I){return this.setSourceProperty(()=>{this.url=I,this._options.url=I}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return t.e({},this._options)}loadTile(I){return t._(this,void 0,void 0,function*(){const ne=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Te={request:this.map._requestManager.transformRequest(ne,"Tile"),uid:I.uid,tileID:I.tileID,zoom:I.tileID.overscaledZ,tileSize:this.tileSize*I.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Te.request.collectResourceTiming=this._collectResourceTiming;let Se="RT";if(I.actor&&I.state!=="expired"){if(I.state==="loading")return new Promise((Ie,ot)=>{I.reloadPromise={resolve:Ie,reject:ot}})}else I.actor=this.dispatcher.getActor(),Se="LT";I.abortController=new AbortController;try{const Ie=yield I.actor.sendAsync({type:Se,data:Te},I.abortController);if(delete I.abortController,I.aborted)return;this._afterTileLoadWorkerResponse(I,Ie)}catch(Ie){if(delete I.abortController,I.aborted)return;if(Ie&&Ie.status!==404)throw Ie;this._afterTileLoadWorkerResponse(I,null)}})}_afterTileLoadWorkerResponse(I,ne){if(ne&&ne.resourceTiming&&(I.resourceTiming=ne.resourceTiming),ne&&this.map._refreshExpiredTiles&&I.setExpiryData(ne),I.loadVectorData(ne,this.map.painter),I.reloadPromise){const Te=I.reloadPromise;I.reloadPromise=null,this.loadTile(I).then(Te.resolve).catch(Te.reject)}}abortTile(I){return t._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController),I.actor&&(yield I.actor.sendAsync({type:"AT",data:{uid:I.uid,type:this.type,source:this.id}}))})}unloadTile(I){return t._(this,void 0,void 0,function*(){I.unloadVectorData(),I.actor&&(yield I.actor.sendAsync({type:"RMT",data:{uid:I.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Ae extends t.E{constructor(I,ne,Te,Se){super(),this.id=I,this.dispatcher=Te,this.setEventedParent(Se),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.e({type:"raster"},ne),t.e(this,t.M(ne,["url","scheme","tileSize"]))}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const I=yield ae(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,I&&(t.e(this,I),I.bounds&&(this.tileBounds=new fe(I.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})))}catch(I){this._tileJSONRequest=null,this.fire(new t.j(I))}})}loaded(){return this._loaded}onAdd(I){this.map=I,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(I){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),I(),this.load()}setTiles(I){return this.setSourceProperty(()=>{this._options.tiles=I}),this}setUrl(I){return this.setSourceProperty(()=>{this.url=I,this._options.url=I}),this}serialize(){return t.e({},this._options)}hasTile(I){return!this.tileBounds||this.tileBounds.contains(I.canonical)}loadTile(I){return t._(this,void 0,void 0,function*(){const ne=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);I.abortController=new AbortController;try{const Te=yield l.getImage(this.map._requestManager.transformRequest(ne,"Tile"),I.abortController,this.map._refreshExpiredTiles);if(delete I.abortController,I.aborted)return void(I.state="unloaded");if(Te&&Te.data){this.map._refreshExpiredTiles&&Te.cacheControl&&Te.expires&&I.setExpiryData({cacheControl:Te.cacheControl,expires:Te.expires});const Se=this.map.painter.context,Ie=Se.gl,ot=Te.data;I.texture=this.map.painter.getTileTexture(ot.width),I.texture?I.texture.update(ot,{useMipmap:!0}):(I.texture=new u(Se,ot,Ie.RGBA,{useMipmap:!0}),I.texture.bind(Ie.LINEAR,Ie.CLAMP_TO_EDGE,Ie.LINEAR_MIPMAP_NEAREST)),I.state="loaded"}}catch(Te){if(delete I.abortController,I.aborted)I.state="unloaded";else if(Te)throw I.state="errored",Te}})}abortTile(I){return t._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController)})}unloadTile(I){return t._(this,void 0,void 0,function*(){I.texture&&this.map.painter.saveTileTexture(I.texture)})}hasTransition(){return!1}}class Fe extends Ae{constructor(I,ne,Te,Se){super(I,ne,Te,Se),this.type="raster-dem",this.maxzoom=22,this._options=t.e({type:"raster-dem"},ne),this.encoding=ne.encoding||"mapbox",this.redFactor=ne.redFactor,this.greenFactor=ne.greenFactor,this.blueFactor=ne.blueFactor,this.baseShift=ne.baseShift}loadTile(I){return t._(this,void 0,void 0,function*(){const ne=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Te=this.map._requestManager.transformRequest(ne,"Tile");I.neighboringTiles=this._getNeighboringTiles(I.tileID),I.abortController=new AbortController;try{const Se=yield l.getImage(Te,I.abortController,this.map._refreshExpiredTiles);if(delete I.abortController,I.aborted)return void(I.state="unloaded");if(Se&&Se.data){const Ie=Se.data;this.map._refreshExpiredTiles&&Se.cacheControl&&Se.expires&&I.setExpiryData({cacheControl:Se.cacheControl,expires:Se.expires});const ot=t.b(Ie)&&t.U()?Ie:yield this.readImageNow(Ie),yt={type:this.type,uid:I.uid,source:this.id,rawImageData:ot,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!I.actor||I.state==="expired"){I.actor=this.dispatcher.getActor();const Ct=yield I.actor.sendAsync({type:"LDT",data:yt});I.dem=Ct,I.needsHillshadePrepare=!0,I.needsTerrainPrepare=!0,I.state="loaded"}}}catch(Se){if(delete I.abortController,I.aborted)I.state="unloaded";else if(Se)throw I.state="errored",Se}})}readImageNow(I){return t._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&t.V()){const ne=I.width+2,Te=I.height+2;try{return new t.R({width:ne,height:Te},yield t.W(I,-1,-1,ne,Te))}catch{}}return i.getImageData(I,1)})}_getNeighboringTiles(I){const ne=I.canonical,Te=Math.pow(2,ne.z),Se=(ne.x-1+Te)%Te,Ie=ne.x===0?I.wrap-1:I.wrap,ot=(ne.x+1+Te)%Te,yt=ne.x+1===Te?I.wrap+1:I.wrap,Ct={};return Ct[new t.S(I.overscaledZ,Ie,ne.z,Se,ne.y).key]={backfilled:!1},Ct[new t.S(I.overscaledZ,yt,ne.z,ot,ne.y).key]={backfilled:!1},ne.y>0&&(Ct[new t.S(I.overscaledZ,Ie,ne.z,Se,ne.y-1).key]={backfilled:!1},Ct[new t.S(I.overscaledZ,I.wrap,ne.z,ne.x,ne.y-1).key]={backfilled:!1},Ct[new t.S(I.overscaledZ,yt,ne.z,ot,ne.y-1).key]={backfilled:!1}),ne.y+10&&t.e(Ie,{resourceTiming:Se}),this.fire(new t.k("data",Object.assign(Object.assign({},Ie),{sourceDataType:"metadata"}))),this.fire(new t.k("data",Object.assign(Object.assign({},Ie),{sourceDataType:"content"})))}catch(Te){if(this._pendingLoads--,this._removed)return void this.fire(new t.k("dataabort",{dataType:"source"}));this.fire(new t.j(Te))}})}loaded(){return this._pendingLoads===0}loadTile(I){return t._(this,void 0,void 0,function*(){const ne=I.actor?"RT":"LT";I.actor=this.actor;const Te={type:this.type,uid:I.uid,tileID:I.tileID,zoom:I.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};I.abortController=new AbortController;const Se=yield this.actor.sendAsync({type:ne,data:Te},I.abortController);delete I.abortController,I.unloadVectorData(),I.aborted||I.loadVectorData(Se,this.map.painter,ne==="RT")})}abortTile(I){return t._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController),I.aborted=!0})}unloadTile(I){return t._(this,void 0,void 0,function*(){I.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:I.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return t.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var qe=t.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class et extends t.E{constructor(I,ne,Te,Se){super(),this.id=I,this.dispatcher=Te,this.coordinates=ne.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Se),this.options=ne}load(I){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const ne=yield l.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,ne&&ne.data&&(this.image=ne.data,I&&(this.coordinates=I),this._finishLoading())}catch(ne){this._request=null,this._loaded=!0,this.fire(new t.j(ne))}})}loaded(){return this._loaded}updateImage(I){return I.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=I.url,this.load(I.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(I){this.map=I,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(I){this.coordinates=I;const ne=I.map(t.Z.fromLngLat);this.tileID=function(Se){let Ie=1/0,ot=1/0,yt=-1/0,Ct=-1/0;for(const Fr of Se)Ie=Math.min(Ie,Fr.x),ot=Math.min(ot,Fr.y),yt=Math.max(yt,Fr.x),Ct=Math.max(Ct,Fr.y);const Wt=Math.max(yt-Ie,Ct-ot),nr=Math.max(0,Math.floor(-Math.log(Wt)/Math.LN2)),or=Math.pow(2,nr);return new t.a1(nr,Math.floor((Ie+yt)/2*or),Math.floor((ot+Ct)/2*or))}(ne),this.minzoom=this.maxzoom=this.tileID.z;const Te=ne.map(Se=>this.tileID.getTilePoint(Se)._round());return this._boundsArray=new t.$,this._boundsArray.emplaceBack(Te[0].x,Te[0].y,0,0),this._boundsArray.emplaceBack(Te[1].x,Te[1].y,t.X,0),this._boundsArray.emplaceBack(Te[3].x,Te[3].y,0,t.X),this._boundsArray.emplaceBack(Te[2].x,Te[2].y,t.X,t.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const I=this.map.painter.context,ne=I.gl;this.boundsBuffer||(this.boundsBuffer=I.createVertexBuffer(this._boundsArray,qe.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u(I,this.image,ne.RGBA),this.texture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE));let Te=!1;for(const Se in this.tiles){const Ie=this.tiles[Se];Ie.state!=="loaded"&&(Ie.state="loaded",Ie.texture=this.texture,Te=!0)}Te&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(I){return t._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(I.tileID.canonical)?(this.tiles[String(I.tileID.wrap)]=I,I.buckets={}):I.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Qe extends et{constructor(I,ne,Te,Se){super(I,ne,Te,Se),this.roundZoom=!0,this.type="video",this.options=ne}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1;const I=this.options;this.urls=[];for(const ne of I.urls)this.urls.push(this.map._requestManager.transformRequest(ne,"Source").url);try{const ne=yield t.a3(this.urls);if(this._loaded=!0,!ne)return;this.video=ne,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(ne){this.fire(new t.j(ne))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(I){if(this.video){const ne=this.video.seekable;Ine.end(0)?this.fire(new t.j(new t.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${ne.start(0)} and ${ne.end(0)}-second mark.`))):this.video.currentTime=I}}getVideo(){return this.video}onAdd(I){this.map||(this.map=I,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const I=this.map.painter.context,ne=I.gl;this.boundsBuffer||(this.boundsBuffer=I.createVertexBuffer(this._boundsArray,qe.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE),ne.texSubImage2D(ne.TEXTURE_2D,0,0,0,ne.RGBA,ne.UNSIGNED_BYTE,this.video)):(this.texture=new u(I,this.video,ne.RGBA),this.texture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE));let Te=!1;for(const Se in this.tiles){const Ie=this.tiles[Se];Ie.state!=="loaded"&&(Ie.state="loaded",Ie.texture=this.texture,Te=!0)}Te&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Ke extends et{constructor(I,ne,Te,Se){super(I,ne,Te,Se),ne.coordinates?Array.isArray(ne.coordinates)&&ne.coordinates.length===4&&!ne.coordinates.some(Ie=>!Array.isArray(Ie)||Ie.length!==2||Ie.some(ot=>typeof ot!="number"))||this.fire(new t.j(new t.a2(`sources.${I}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.j(new t.a2(`sources.${I}`,null,'missing required property "coordinates"'))),ne.animate&&typeof ne.animate!="boolean"&&this.fire(new t.j(new t.a2(`sources.${I}`,null,'optional "animate" property must be a boolean value'))),ne.canvas?typeof ne.canvas=="string"||ne.canvas instanceof HTMLCanvasElement||this.fire(new t.j(new t.a2(`sources.${I}`,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 t.j(new t.a2(`sources.${I}`,null,'missing required property "canvas"'))),this.options=ne,this.animate=ne.animate===void 0||ne.animate}load(){return t._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.j(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())})}getCanvas(){return this.canvas}onAdd(I){this.map=I,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let I=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,I=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,I=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const ne=this.map.painter.context,Te=ne.gl;this.boundsBuffer||(this.boundsBuffer=ne.createVertexBuffer(this._boundsArray,qe.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?(I||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u(ne,this.canvas,Te.RGBA,{premultiply:!0});let Se=!1;for(const Ie in this.tiles){const ot=this.tiles[Ie];ot.state!=="loaded"&&(ot.state="loaded",ot.texture=this.texture,Se=!0)}Se&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const I of[this.canvas.width,this.canvas.height])if(isNaN(I)||I<=0)return!0;return!1}}const Xe={},Me=De=>{switch(De){case"geojson":return Ce;case"image":return et;case"raster":return Ae;case"raster-dem":return Fe;case"vector":return we;case"video":return Qe;case"canvas":return Ke}return Xe[De]},xe="RTLPluginLoaded";class ce extends t.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=X()}_syncState(I){return this.status=I,this.dispatcher.broadcast("SRPS",{pluginStatus:I,pluginURL:this.url}).catch(ne=>{throw this.status="error",ne})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(I){return t._(this,arguments,void 0,function*(ne,Te=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=i.resolveURL(ne),!this.url)throw new Error(`requested url ${ne} is invalid`);if(this.status==="unavailable"){if(!Te)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return t._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new t.k(xe))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Re=null;function $e(){return Re||(Re=new ce),Re}class rt{constructor(I,ne){this.timeAdded=0,this.fadeEndTime=0,this.tileID=I,this.uid=t.a4(),this.uses=0,this.tileSize=ne,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(I){const ne=I+this.timeAdded;neIe.getLayer(Wt)).filter(Boolean);if(Ct.length!==0){yt.layers=Ct,yt.stateDependentLayerIds&&(yt.stateDependentLayers=yt.stateDependentLayerIds.map(Wt=>Ct.filter(nr=>nr.id===Wt)[0]));for(const Wt of Ct)ot[Wt.id]=yt}}return ot}(I.buckets,ne.style),this.hasSymbolBuckets=!1;for(const Se in this.buckets){const Ie=this.buckets[Se];if(Ie instanceof t.a6){if(this.hasSymbolBuckets=!0,!Te)break;Ie.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const Se in this.buckets){const Ie=this.buckets[Se];if(Ie instanceof t.a6&&Ie.hasRTLText){this.hasRTLText=!0,$e().lazyLoad();break}}this.queryPadding=0;for(const Se in this.buckets){const Ie=this.buckets[Se];this.queryPadding=Math.max(this.queryPadding,ne.style.getLayer(Se).queryRadius(Ie))}I.imageAtlas&&(this.imageAtlas=I.imageAtlas),I.glyphAtlasImage&&(this.glyphAtlasImage=I.glyphAtlasImage)}else this.collisionBoxArray=new t.a5}unloadVectorData(){for(const I in this.buckets)this.buckets[I].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(I){return this.buckets[I.id]}upload(I){for(const Te in this.buckets){const Se=this.buckets[Te];Se.uploadPending()&&Se.upload(I)}const ne=I.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new u(I,this.imageAtlas.image,ne.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new u(I,this.glyphAtlasImage,ne.ALPHA),this.glyphAtlasImage=null)}prepare(I){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(I,this.imageAtlasTexture)}queryRenderedFeatures(I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:Se,cameraQueryGeometry:Ie,scale:ot,tileSize:this.tileSize,pixelPosMatrix:nr,transform:Ct,params:yt,queryPadding:this.queryPadding*Wt},I,ne,Te):{}}querySourceFeatures(I,ne){const Te=this.latestFeatureIndex;if(!Te||!Te.rawTileData)return;const Se=Te.loadVTLayers(),Ie=ne&&ne.sourceLayer?ne.sourceLayer:"",ot=Se._geojsonTileLayer||Se[Ie];if(!ot)return;const yt=t.a7(ne&&ne.filter),{z:Ct,x:Wt,y:nr}=this.tileID.canonical,or={z:Ct,x:Wt,y:nr};for(let Fr=0;FrTe)Se=!1;else if(ne)if(this.expirationTime{this.remove(I,Ie)},Te)),this.data[Se].push(Ie),this.order.push(Se),this.order.length>this.max){const ot=this._getAndRemoveByKey(this.order[0]);ot&&this.onRemove(ot)}return this}has(I){return I.wrapped().key in this.data}getAndRemove(I){return this.has(I)?this._getAndRemoveByKey(I.wrapped().key):null}_getAndRemoveByKey(I){const ne=this.data[I].shift();return ne.timeout&&clearTimeout(ne.timeout),this.data[I].length===0&&delete this.data[I],this.order.splice(this.order.indexOf(I),1),ne.value}getByKey(I){const ne=this.data[I];return ne?ne[0].value:null}get(I){return this.has(I)?this.data[I.wrapped().key][0].value:null}remove(I,ne){if(!this.has(I))return this;const Te=I.wrapped().key,Se=ne===void 0?0:this.data[Te].indexOf(ne),Ie=this.data[Te][Se];return this.data[Te].splice(Se,1),Ie.timeout&&clearTimeout(Ie.timeout),this.data[Te].length===0&&delete this.data[Te],this.onRemove(Ie.value),this.order.splice(this.order.indexOf(Te),1),this}setMaxSize(I){for(this.max=I;this.order.length>this.max;){const ne=this._getAndRemoveByKey(this.order[0]);ne&&this.onRemove(ne)}return this}filter(I){const ne=[];for(const Te in this.data)for(const Se of this.data[Te])I(Se.value)||ne.push(Se);for(const Te of ne)this.remove(Te.value.tileID,Te)}}class At{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(I,ne,Te){const Se=String(ne);if(this.stateChanges[I]=this.stateChanges[I]||{},this.stateChanges[I][Se]=this.stateChanges[I][Se]||{},t.e(this.stateChanges[I][Se],Te),this.deletedStates[I]===null){this.deletedStates[I]={};for(const Ie in this.state[I])Ie!==Se&&(this.deletedStates[I][Ie]=null)}else if(this.deletedStates[I]&&this.deletedStates[I][Se]===null){this.deletedStates[I][Se]={};for(const Ie in this.state[I][Se])Te[Ie]||(this.deletedStates[I][Se][Ie]=null)}else for(const Ie in Te)this.deletedStates[I]&&this.deletedStates[I][Se]&&this.deletedStates[I][Se][Ie]===null&&delete this.deletedStates[I][Se][Ie]}removeFeatureState(I,ne,Te){if(this.deletedStates[I]===null)return;const Se=String(ne);if(this.deletedStates[I]=this.deletedStates[I]||{},Te&&ne!==void 0)this.deletedStates[I][Se]!==null&&(this.deletedStates[I][Se]=this.deletedStates[I][Se]||{},this.deletedStates[I][Se][Te]=null);else if(ne!==void 0)if(this.stateChanges[I]&&this.stateChanges[I][Se])for(Te in this.deletedStates[I][Se]={},this.stateChanges[I][Se])this.deletedStates[I][Se][Te]=null;else this.deletedStates[I][Se]=null;else this.deletedStates[I]=null}getState(I,ne){const Te=String(ne),Se=t.e({},(this.state[I]||{})[Te],(this.stateChanges[I]||{})[Te]);if(this.deletedStates[I]===null)return{};if(this.deletedStates[I]){const Ie=this.deletedStates[I][ne];if(Ie===null)return{};for(const ot in Ie)delete Se[ot]}return Se}initializeTileState(I,ne){I.setFeatureState(this.state,ne)}coalesceChanges(I,ne){const Te={};for(const Se in this.stateChanges){this.state[Se]=this.state[Se]||{};const Ie={};for(const ot in this.stateChanges[Se])this.state[Se][ot]||(this.state[Se][ot]={}),t.e(this.state[Se][ot],this.stateChanges[Se][ot]),Ie[ot]=this.state[Se][ot];Te[Se]=Ie}for(const Se in this.deletedStates){this.state[Se]=this.state[Se]||{};const Ie={};if(this.deletedStates[Se]===null)for(const ot in this.state[Se])Ie[ot]={},this.state[Se][ot]={};else for(const ot in this.deletedStates[Se]){if(this.deletedStates[Se][ot]===null)this.state[Se][ot]={};else for(const yt of Object.keys(this.deletedStates[Se][ot]))delete this.state[Se][ot][yt];Ie[ot]=this.state[Se][ot]}Te[Se]=Te[Se]||{},t.e(Te[Se],Ie)}if(this.stateChanges={},this.deletedStates={},Object.keys(Te).length!==0)for(const Se in I)I[Se].setFeatureState(Te,ne)}}class St extends t.E{constructor(I,ne,Te){super(),this.id=I,this.dispatcher=Te,this.on("data",Se=>this._dataHandler(Se)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((Se,Ie,ot,yt)=>{const Ct=new(Me(Ie.type))(Se,Ie,ot,yt);if(Ct.id!==Se)throw new Error(`Expected Source id to be ${Se} instead of ${Ct.id}`);return Ct})(I,ne,Te,this),this._tiles={},this._cache=new Je(0,Se=>this._unloadTile(Se)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new At,this._didEmitContent=!1,this._updated=!1}onAdd(I){this.map=I,this._maxTileCacheSize=I?I._maxTileCacheSize:null,this._maxTileCacheZoomLevels=I?I._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(I)}onRemove(I){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(I)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const I in this._tiles){const ne=this._tiles[I];if(ne.state!=="loaded"&&ne.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const I=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,I&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(I,ne,Te){return t._(this,void 0,void 0,function*(){try{yield this._source.loadTile(I),this._tileLoaded(I,ne,Te)}catch(Se){I.state="errored",Se.status!==404?this._source.fire(new t.j(Se,{tile:I})):this.update(this.transform,this.terrain)}})}_unloadTile(I){this._source.unloadTile&&this._source.unloadTile(I)}_abortTile(I){this._source.abortTile&&this._source.abortTile(I),this._source.fire(new t.k("dataabort",{tile:I,coord:I.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(I){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const ne in this._tiles){const Te=this._tiles[ne];Te.upload(I),Te.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(I=>I.tileID).sort(Rt).map(I=>I.key)}getRenderableIds(I){const ne=[];for(const Te in this._tiles)this._isIdRenderable(Te,I)&&ne.push(this._tiles[Te]);return I?ne.sort((Te,Se)=>{const Ie=Te.tileID,ot=Se.tileID,yt=new t.P(Ie.canonical.x,Ie.canonical.y)._rotate(this.transform.angle),Ct=new t.P(ot.canonical.x,ot.canonical.y)._rotate(this.transform.angle);return Ie.overscaledZ-ot.overscaledZ||Ct.y-yt.y||Ct.x-yt.x}).map(Te=>Te.tileID.key):ne.map(Te=>Te.tileID).sort(Rt).map(Te=>Te.key)}hasRenderableParent(I){const ne=this.findLoadedParent(I,0);return!!ne&&this._isIdRenderable(ne.tileID.key)}_isIdRenderable(I,ne){return this._tiles[I]&&this._tiles[I].hasData()&&!this._coveredTiles[I]&&(ne||!this._tiles[I].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const I in this._tiles)this._tiles[I].state!=="errored"&&this._reloadTile(I,"reloading")}}_reloadTile(I,ne){return t._(this,void 0,void 0,function*(){const Te=this._tiles[I];Te&&(Te.state!=="loading"&&(Te.state=ne),yield this._loadTile(Te,I,ne))})}_tileLoaded(I,ne,Te){I.timeAdded=i.now(),Te==="expired"&&(I.refreshedUponExpiration=!0),this._setTileReloadTimer(ne,I),this.getSource().type==="raster-dem"&&I.dem&&this._backfillDEM(I),this._state.initializeTileState(I,this.map?this.map.painter:null),I.aborted||this._source.fire(new t.k("data",{dataType:"source",tile:I,coord:I.tileID}))}_backfillDEM(I){const ne=this.getRenderableIds();for(let Se=0;Se1||(Math.abs(ot)>1&&(Math.abs(ot+Ct)===1?ot+=Ct:Math.abs(ot-Ct)===1&&(ot-=Ct)),Ie.dem&&Se.dem&&(Se.dem.backfillBorder(Ie.dem,ot,yt),Se.neighboringTiles&&Se.neighboringTiles[Wt]&&(Se.neighboringTiles[Wt].backfilled=!0)))}}getTile(I){return this.getTileByID(I.key)}getTileByID(I){return this._tiles[I]}_retainLoadedChildren(I,ne,Te,Se){for(const Ie in this._tiles){let ot=this._tiles[Ie];if(Se[Ie]||!ot.hasData()||ot.tileID.overscaledZ<=ne||ot.tileID.overscaledZ>Te)continue;let yt=ot.tileID;for(;ot&&ot.tileID.overscaledZ>ne+1;){const Wt=ot.tileID.scaledTo(ot.tileID.overscaledZ-1);ot=this._tiles[Wt.key],ot&&ot.hasData()&&(yt=Wt)}let Ct=yt;for(;Ct.overscaledZ>ne;)if(Ct=Ct.scaledTo(Ct.overscaledZ-1),I[Ct.key]){Se[yt.key]=yt;break}}}findLoadedParent(I,ne){if(I.key in this._loadedParentTiles){const Te=this._loadedParentTiles[I.key];return Te&&Te.tileID.overscaledZ>=ne?Te:null}for(let Te=I.overscaledZ-1;Te>=ne;Te--){const Se=I.scaledTo(Te),Ie=this._getLoadedTile(Se);if(Ie)return Ie}}findLoadedSibling(I){return this._getLoadedTile(I)}_getLoadedTile(I){const ne=this._tiles[I.key];return ne&&ne.hasData()?ne:this._cache.getByKey(I.wrapped().key)}updateCacheSize(I){const ne=Math.ceil(I.width/this._source.tileSize)+1,Te=Math.ceil(I.height/this._source.tileSize)+1,Se=Math.floor(ne*Te*(this._maxTileCacheZoomLevels===null?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),Ie=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Se):Se;this._cache.setMaxSize(Ie)}handleWrapJump(I){const ne=Math.round((I-(this._prevLng===void 0?I:this._prevLng))/360);if(this._prevLng=I,ne){const Te={};for(const Se in this._tiles){const Ie=this._tiles[Se];Ie.tileID=Ie.tileID.unwrapTo(Ie.tileID.wrap+ne),Te[Ie.tileID.key]=Ie}this._tiles=Te;for(const Se in this._timers)clearTimeout(this._timers[Se]),delete this._timers[Se];for(const Se in this._tiles)this._setTileReloadTimer(Se,this._tiles[Se])}}_updateCoveredAndRetainedTiles(I,ne,Te,Se,Ie,ot){const yt={},Ct={},Wt=Object.keys(I),nr=i.now();for(const or of Wt){const Fr=I[or],Wr=this._tiles[or];if(!Wr||Wr.fadeEndTime!==0&&Wr.fadeEndTime<=nr)continue;const je=this.findLoadedParent(Fr,ne),Ze=this.findLoadedSibling(Fr),at=je||Ze||null;at&&(this._addTile(at.tileID),yt[at.tileID.key]=at.tileID),Ct[or]=Fr}this._retainLoadedChildren(Ct,Se,Te,I);for(const or in yt)I[or]||(this._coveredTiles[or]=!0,I[or]=yt[or]);if(ot){const or={},Fr={};for(const Wr of Ie)this._tiles[Wr.key].hasData()?or[Wr.key]=Wr:Fr[Wr.key]=Wr;for(const Wr in Fr){const je=Fr[Wr].children(this._source.maxzoom);this._tiles[je[0].key]&&this._tiles[je[1].key]&&this._tiles[je[2].key]&&this._tiles[je[3].key]&&(or[je[0].key]=I[je[0].key]=je[0],or[je[1].key]=I[je[1].key]=je[1],or[je[2].key]=I[je[2].key]=je[2],or[je[3].key]=I[je[3].key]=je[3],delete Fr[Wr])}for(const Wr in Fr){const je=Fr[Wr],Ze=this.findLoadedParent(je,this._source.minzoom),at=this.findLoadedSibling(je),lt=Ze||at||null;if(lt){or[lt.tileID.key]=I[lt.tileID.key]=lt.tileID;for(const Tt in or)or[Tt].isChildOf(lt.tileID)&&delete or[Tt]}}for(const Wr in this._tiles)or[Wr]||(this._coveredTiles[Wr]=!0)}}update(I,ne){if(!this._sourceLoaded||this._paused)return;let Te;this.transform=I,this.terrain=ne,this.updateCacheSize(I),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?Te=I.getVisibleUnwrappedCoordinates(this._source.tileID).map(nr=>new t.S(nr.canonical.z,nr.wrap,nr.canonical.z,nr.canonical.x,nr.canonical.y)):(Te=I.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:ne}),this._source.hasTile&&(Te=Te.filter(nr=>this._source.hasTile(nr)))):Te=[];const Se=I.coveringZoomLevel(this._source),Ie=Math.max(Se-St.maxOverzooming,this._source.minzoom),ot=Math.max(Se+St.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const nr={};for(const or of Te)if(or.canonical.z>this._source.minzoom){const Fr=or.scaledTo(or.canonical.z-1);nr[Fr.key]=Fr;const Wr=or.scaledTo(Math.max(this._source.minzoom,Math.min(or.canonical.z,5)));nr[Wr.key]=Wr}Te=Te.concat(Object.values(nr))}const yt=Te.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,yt&&this.fire(new t.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const Ct=this._updateRetainedTiles(Te,Se);Ut(this._source.type)&&this._updateCoveredAndRetainedTiles(Ct,Ie,ot,Se,Te,ne);for(const nr in Ct)this._tiles[nr].clearFadeHold();const Wt=t.ab(this._tiles,Ct);for(const nr of Wt){const or=this._tiles[nr];or.hasSymbolBuckets&&!or.holdingForFade()?or.setHoldDuration(this.map._fadeDuration):or.hasSymbolBuckets&&!or.symbolFadeFinished()||this._removeTile(nr)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const I in this._tiles)this._tiles[I].holdingForFade()&&this._removeTile(I)}_updateRetainedTiles(I,ne){var Te;const Se={},Ie={},ot=Math.max(ne-St.maxOverzooming,this._source.minzoom),yt=Math.max(ne+St.maxUnderzooming,this._source.minzoom),Ct={};for(const Wt of I){const nr=this._addTile(Wt);Se[Wt.key]=Wt,nr.hasData()||nethis._source.maxzoom){const Fr=Wt.children(this._source.maxzoom)[0],Wr=this.getTile(Fr);if(Wr&&Wr.hasData()){Se[Fr.key]=Fr;continue}}else{const Fr=Wt.children(this._source.maxzoom);if(Se[Fr[0].key]&&Se[Fr[1].key]&&Se[Fr[2].key]&&Se[Fr[3].key])continue}let or=nr.wasRequested();for(let Fr=Wt.overscaledZ-1;Fr>=ot;--Fr){const Wr=Wt.scaledTo(Fr);if(Ie[Wr.key])break;if(Ie[Wr.key]=!0,nr=this.getTile(Wr),!nr&&or&&(nr=this._addTile(Wr)),nr){const je=nr.hasData();if((je||!(!((Te=this.map)===null||Te===void 0)&&Te.cancelPendingTileRequestsWhileZooming)||or)&&(Se[Wr.key]=Wr),or=nr.wasRequested(),je)break}}}return Se}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const I in this._tiles){const ne=[];let Te,Se=this._tiles[I].tileID;for(;Se.overscaledZ>0;){if(Se.key in this._loadedParentTiles){Te=this._loadedParentTiles[Se.key];break}ne.push(Se.key);const Ie=Se.scaledTo(Se.overscaledZ-1);if(Te=this._getLoadedTile(Ie),Te)break;Se=Ie}for(const Ie of ne)this._loadedParentTiles[Ie]=Te}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const I in this._tiles){const ne=this._tiles[I].tileID,Te=this._getLoadedTile(ne);this._loadedSiblingTiles[ne.key]=Te}}_addTile(I){let ne=this._tiles[I.key];if(ne)return ne;ne=this._cache.getAndRemove(I),ne&&(this._setTileReloadTimer(I.key,ne),ne.tileID=I,this._state.initializeTileState(ne,this.map?this.map.painter:null),this._cacheTimers[I.key]&&(clearTimeout(this._cacheTimers[I.key]),delete this._cacheTimers[I.key],this._setTileReloadTimer(I.key,ne)));const Te=ne;return ne||(ne=new rt(I,this._source.tileSize*I.overscaleFactor()),this._loadTile(ne,I.key,ne.state)),ne.uses++,this._tiles[I.key]=ne,Te||this._source.fire(new t.k("dataloading",{tile:ne,coord:ne.tileID,dataType:"source"})),ne}_setTileReloadTimer(I,ne){I in this._timers&&(clearTimeout(this._timers[I]),delete this._timers[I]);const Te=ne.getExpiryTimeout();Te&&(this._timers[I]=setTimeout(()=>{this._reloadTile(I,"expired"),delete this._timers[I]},Te))}_removeTile(I){const ne=this._tiles[I];ne&&(ne.uses--,delete this._tiles[I],this._timers[I]&&(clearTimeout(this._timers[I]),delete this._timers[I]),ne.uses>0||(ne.hasData()&&ne.state!=="reloading"?this._cache.add(ne.tileID,ne,ne.getExpiryTimeout()):(ne.aborted=!0,this._abortTile(ne),this._unloadTile(ne))))}_dataHandler(I){const ne=I.sourceDataType;I.dataType==="source"&&ne==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&I.dataType==="source"&&ne==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const I in this._tiles)this._removeTile(I);this._cache.reset()}tilesIn(I,ne,Te){const Se=[],Ie=this.transform;if(!Ie)return Se;const ot=Te?Ie.getCameraQueryGeometry(I):I,yt=I.map(je=>Ie.pointCoordinate(je,this.terrain)),Ct=ot.map(je=>Ie.pointCoordinate(je,this.terrain)),Wt=this.getIds();let nr=1/0,or=1/0,Fr=-1/0,Wr=-1/0;for(const je of Ct)nr=Math.min(nr,je.x),or=Math.min(or,je.y),Fr=Math.max(Fr,je.x),Wr=Math.max(Wr,je.y);for(let je=0;je=0&>[1].y+Tt>=0){const Et=yt.map(rr=>at.getTilePoint(rr)),Yt=Ct.map(rr=>at.getTilePoint(rr));Se.push({tile:Ze,tileID:at,queryGeometry:Et,cameraQueryGeometry:Yt,scale:lt})}}return Se}getVisibleCoordinates(I){const ne=this.getRenderableIds(I).map(Te=>this._tiles[Te].tileID);for(const Te of ne)Te.posMatrix=this.transform.calculatePosMatrix(Te.toUnwrapped());return ne}hasTransition(){if(this._source.hasTransition())return!0;if(Ut(this._source.type)){const I=i.now();for(const ne in this._tiles)if(this._tiles[ne].fadeEndTime>=I)return!0}return!1}setFeatureState(I,ne,Te){this._state.updateState(I=I||"_geojsonTileLayer",ne,Te)}removeFeatureState(I,ne,Te){this._state.removeFeatureState(I=I||"_geojsonTileLayer",ne,Te)}getFeatureState(I,ne){return this._state.getState(I=I||"_geojsonTileLayer",ne)}setDependencies(I,ne,Te){const Se=this._tiles[I];Se&&Se.setDependencies(ne,Te)}reloadTilesForDependencies(I,ne){for(const Te in this._tiles)this._tiles[Te].hasDependency(I,ne)&&this._reloadTile(Te,"reloading");this._cache.filter(Te=>!Te.hasDependency(I,ne))}}function Rt(De,I){const ne=Math.abs(2*De.wrap)-+(De.wrap<0),Te=Math.abs(2*I.wrap)-+(I.wrap<0);return De.overscaledZ-I.overscaledZ||Te-ne||I.canonical.y-De.canonical.y||I.canonical.x-De.canonical.x}function Ut(De){return De==="raster"||De==="image"||De==="video"}St.maxOverzooming=10,St.maxUnderzooming=3;class ir{constructor(I,ne){this.reset(I,ne)}reset(I,ne){this.points=I||[],this._distances=[0];for(let Te=1;Te0?(Se-ot)/yt:0;return this.points[Ie].mult(1-Ct).add(this.points[ne].mult(Ct))}}function ar(De,I){let ne=!0;return De==="always"||De!=="never"&&I!=="never"||(ne=!1),ne}class Mr{constructor(I,ne,Te){const Se=this.boxCells=[],Ie=this.circleCells=[];this.xCellCount=Math.ceil(I/Te),this.yCellCount=Math.ceil(ne/Te);for(let ot=0;otthis.width||Se<0||ne>this.height)return[];const Ct=[];if(I<=0&&ne<=0&&this.width<=Te&&this.height<=Se){if(Ie)return[{key:null,x1:I,y1:ne,x2:Te,y2:Se}];for(let Wt=0;Wt0}hitTestCircle(I,ne,Te,Se,Ie){const ot=I-Te,yt=I+Te,Ct=ne-Te,Wt=ne+Te;if(yt<0||ot>this.width||Wt<0||Ct>this.height)return!1;const nr=[];return this._forEachCell(ot,Ct,yt,Wt,this._queryCellCircle,nr,{hitTest:!0,overlapMode:Se,circle:{x:I,y:ne,radius:Te},seenUids:{box:{},circle:{}}},Ie),nr.length>0}_queryCell(I,ne,Te,Se,Ie,ot,yt,Ct){const{seenUids:Wt,hitTest:nr,overlapMode:or}=yt,Fr=this.boxCells[Ie];if(Fr!==null){const je=this.bboxes;for(const Ze of Fr)if(!Wt.box[Ze]){Wt.box[Ze]=!0;const at=4*Ze,lt=this.boxKeys[Ze];if(I<=je[at+2]&&ne<=je[at+3]&&Te>=je[at+0]&&Se>=je[at+1]&&(!Ct||Ct(lt))&&(!nr||!ar(or,lt.overlapMode))&&(ot.push({key:lt,x1:je[at],y1:je[at+1],x2:je[at+2],y2:je[at+3]}),nr))return!0}}const Wr=this.circleCells[Ie];if(Wr!==null){const je=this.circles;for(const Ze of Wr)if(!Wt.circle[Ze]){Wt.circle[Ze]=!0;const at=3*Ze,lt=this.circleKeys[Ze];if(this._circleAndRectCollide(je[at],je[at+1],je[at+2],I,ne,Te,Se)&&(!Ct||Ct(lt))&&(!nr||!ar(or,lt.overlapMode))){const Tt=je[at],gt=je[at+1],Et=je[at+2];if(ot.push({key:lt,x1:Tt-Et,y1:gt-Et,x2:Tt+Et,y2:gt+Et}),nr)return!0}}}return!1}_queryCellCircle(I,ne,Te,Se,Ie,ot,yt,Ct){const{circle:Wt,seenUids:nr,overlapMode:or}=yt,Fr=this.boxCells[Ie];if(Fr!==null){const je=this.bboxes;for(const Ze of Fr)if(!nr.box[Ze]){nr.box[Ze]=!0;const at=4*Ze,lt=this.boxKeys[Ze];if(this._circleAndRectCollide(Wt.x,Wt.y,Wt.radius,je[at+0],je[at+1],je[at+2],je[at+3])&&(!Ct||Ct(lt))&&!ar(or,lt.overlapMode))return ot.push(!0),!0}}const Wr=this.circleCells[Ie];if(Wr!==null){const je=this.circles;for(const Ze of Wr)if(!nr.circle[Ze]){nr.circle[Ze]=!0;const at=3*Ze,lt=this.circleKeys[Ze];if(this._circlesCollide(je[at],je[at+1],je[at+2],Wt.x,Wt.y,Wt.radius)&&(!Ct||Ct(lt))&&!ar(or,lt.overlapMode))return ot.push(!0),!0}}}_forEachCell(I,ne,Te,Se,Ie,ot,yt,Ct){const Wt=this._convertToXCellCoord(I),nr=this._convertToYCellCoord(ne),or=this._convertToXCellCoord(Te),Fr=this._convertToYCellCoord(Se);for(let Wr=Wt;Wr<=or;Wr++)for(let je=nr;je<=Fr;je++)if(Ie.call(this,I,ne,Te,Se,this.xCellCount*je+Wr,ot,yt,Ct))return}_convertToXCellCoord(I){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(I*this.xScale)))}_convertToYCellCoord(I){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(I*this.yScale)))}_circlesCollide(I,ne,Te,Se,Ie,ot){const yt=Se-I,Ct=Ie-ne,Wt=Te+ot;return Wt*Wt>yt*yt+Ct*Ct}_circleAndRectCollide(I,ne,Te,Se,Ie,ot,yt){const Ct=(ot-Se)/2,Wt=Math.abs(I-(Se+Ct));if(Wt>Ct+Te)return!1;const nr=(yt-Ie)/2,or=Math.abs(ne-(Ie+nr));if(or>nr+Te)return!1;if(Wt<=Ct||or<=nr)return!0;const Fr=Wt-Ct,Wr=or-nr;return Fr*Fr+Wr*Wr<=Te*Te}}function fr(De,I,ne,Te,Se){const Ie=t.H();return I?(t.K(Ie,Ie,[1/Se,1/Se,1]),ne||t.ad(Ie,Ie,Te.angle)):t.L(Ie,Te.labelPlaneMatrix,De),Ie}function dr(De,I,ne,Te,Se){if(I){const Ie=t.ae(De);return t.K(Ie,Ie,[Se,Se,1]),ne||t.ad(Ie,Ie,-Te.angle),Ie}return Te.glCoordMatrix}function pt(De,I,ne,Te){let Se;Te?(Se=[De,I,Te(De,I),1],t.af(Se,Se,ne)):(Se=[De,I,0,1],Zt(Se,Se,ne));const Ie=Se[3];return{point:new t.P(Se[0]/Ie,Se[1]/Ie),signedDistanceFromCamera:Ie,isOccluded:!1}}function ze(De,I){return .5+De/I*.5}function Ge(De,I){return De.x>=-I[0]&&De.x<=I[0]&&De.y>=-I[1]&&De.y<=I[1]}function Oe(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr,je){const Ze=Te?De.textSizeData:De.iconSizeData,at=t.ag(Ze,ne.transform.zoom),lt=[256/ne.width*2+1,256/ne.height*2+1],Tt=Te?De.text.dynamicLayoutVertexArray:De.icon.dynamicLayoutVertexArray;Tt.clear();const gt=De.lineVertexArray,Et=Te?De.text.placedSymbolArray:De.icon.placedSymbolArray,Yt=ne.transform.width/ne.transform.height;let rr=!1;for(let sr=0;srMath.abs(ne.x-I.x)*Te?{useVertical:!0}:(De===t.ah.vertical?I.yne.x)?{needsFlipping:!0}:null}function be(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr){const or=ne/24,Fr=I.lineOffsetX*or,Wr=I.lineOffsetY*or;let je;if(I.numGlyphs>1){const Ze=I.glyphStartIndex+I.numGlyphs,at=I.lineStartIndex,lt=I.lineStartIndex+I.lineLength,Tt=ve(or,yt,Fr,Wr,Te,I,nr,De);if(!Tt)return{notEnoughRoom:!0};const gt=pt(Tt.first.point.x,Tt.first.point.y,ot,De.getElevation).point,Et=pt(Tt.last.point.x,Tt.last.point.y,ot,De.getElevation).point;if(Se&&!Te){const Yt=ge(I.writingMode,gt,Et,Wt);if(Yt)return Yt}je=[Tt.first];for(let Yt=I.glyphStartIndex+1;Yt0?gt.point:function(rr,sr,Sr,Nr,Qr,ia){return Pe(rr,sr,Sr,1,Qr,ia)}(De.tileAnchorPoint,Tt,at,0,Ie,De),Yt=ge(I.writingMode,at,Et,Wt);if(Yt)return Yt}const Ze=Nt(or*yt.getoffsetX(I.glyphStartIndex),Fr,Wr,Te,I.segment,I.lineStartIndex,I.lineStartIndex+I.lineLength,De,nr);if(!Ze||De.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};je=[Ze]}for(const Ze of je)t.aj(Ct,Ze.point,Ze.angle);return{}}function Pe(De,I,ne,Te,Se,Ie){const ot=De.add(De.sub(I)._unit()),yt=Se!==void 0?pt(ot.x,ot.y,Se,Ie.getElevation).point:ct(ot.x,ot.y,Ie).point,Ct=ne.sub(yt);return ne.add(Ct._mult(Te/Ct.mag()))}function We(De,I,ne){const Te=I.projectionCache;if(Te.projections[De])return Te.projections[De];const Se=new t.P(I.lineVertexArray.getx(De),I.lineVertexArray.gety(De)),Ie=ct(Se.x,Se.y,I);if(Ie.signedDistanceFromCamera>0)return Te.projections[De]=Ie.point,Te.anyProjectionOccluded=Te.anyProjectionOccluded||Ie.isOccluded,Ie.point;const ot=De-ne.direction;return function(yt,Ct,Wt,nr,or){return Pe(yt,Ct,Wt,nr,void 0,or)}(ne.distanceFromAnchor===0?I.tileAnchorPoint:new t.P(I.lineVertexArray.getx(ot),I.lineVertexArray.gety(ot)),Se,ne.previousVertex,ne.absOffsetX-ne.distanceFromAnchor+1,I)}function ct(De,I,ne){const Te=De+ne.translation[0],Se=I+ne.translation[1];let Ie;return!ne.pitchWithMap&&ne.projection.useSpecialProjectionForSymbols?(Ie=ne.projection.projectTileCoordinates(Te,Se,ne.unwrappedTileID,ne.getElevation),Ie.point.x=(.5*Ie.point.x+.5)*ne.width,Ie.point.y=(.5*-Ie.point.y+.5)*ne.height):(Ie=pt(Te,Se,ne.labelPlaneMatrix,ne.getElevation),Ie.isOccluded=!1),Ie}function _t(De,I,ne){return De._unit()._perp()._mult(I*ne)}function Mt(De,I,ne,Te,Se,Ie,ot,yt,Ct){if(yt.projectionCache.offsets[De])return yt.projectionCache.offsets[De];const Wt=ne.add(I);if(De+Ct.direction=Se)return yt.projectionCache.offsets[De]=Wt,Wt;const nr=We(De+Ct.direction,yt,Ct),or=_t(nr.sub(ne),ot,Ct.direction),Fr=ne.add(or),Wr=nr.add(or);return yt.projectionCache.offsets[De]=t.ak(Ie,Wt,Fr,Wr)||Wt,yt.projectionCache.offsets[De]}function Nt(De,I,ne,Te,Se,Ie,ot,yt,Ct){const Wt=Te?De-I:De+I;let nr=Wt>0?1:-1,or=0;Te&&(nr*=-1,or=Math.PI),nr<0&&(or+=Math.PI);let Fr,Wr=nr>0?Ie+Se:Ie+Se+1;yt.projectionCache.cachedAnchorPoint?Fr=yt.projectionCache.cachedAnchorPoint:(Fr=ct(yt.tileAnchorPoint.x,yt.tileAnchorPoint.y,yt).point,yt.projectionCache.cachedAnchorPoint=Fr);let je,Ze,at=Fr,lt=Fr,Tt=0,gt=0;const Et=Math.abs(Wt),Yt=[];let rr;for(;Tt+gt<=Et;){if(Wr+=nr,Wr=ot)return null;Tt+=gt,lt=at,Ze=je;const Nr={absOffsetX:Et,direction:nr,distanceFromAnchor:Tt,previousVertex:lt};if(at=We(Wr,yt,Nr),ne===0)Yt.push(lt),rr=at.sub(lt);else{let Qr;const ia=at.sub(lt);Qr=ia.mag()===0?_t(We(Wr+nr,yt,Nr).sub(at),ne,nr):_t(ia,ne,nr),Ze||(Ze=lt.add(Qr)),je=Mt(Wr,Qr,at,Ie,ot,Ze,ne,yt,Nr),Yt.push(Ze),rr=je.sub(Ze)}gt=rr.mag()}const sr=rr._mult((Et-Tt)/gt)._add(Ze||lt),Sr=or+Math.atan2(at.y-lt.y,at.x-lt.x);return Yt.push(sr),{point:sr,angle:Ct?Sr:0,path:Yt}}const Bt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function qt(De,I){for(let ne=0;ne=1;ii--)ln.push(nn.path[ii]);for(let ii=1;iiGi.signedDistanceFromCamera<=0)?[]:ii.map(Gi=>Gi.point)}let pi=[];if(ln.length>0){const ii=ln[0].clone(),Gi=ln[0].clone();for(let Bo=1;Bo=ia.x&&Gi.x<=_a.x&&ii.y>=ia.y&&Gi.y<=_a.y?[ln]:Gi.x_a.x||Gi.y_a.y?[]:t.al([ln],ia.x,ia.y,_a.x,_a.y)}for(const ii of pi){za.reset(ii,.25*Qr);let Gi=0;Gi=za.length<=.5*Qr?1:Math.ceil(za.paddedLength/Nn)+1;for(let Bo=0;Bopt(Se.x,Se.y,Te,ne.getElevation))}queryRenderedSymbols(I){if(I.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const ne=[];let Te=1/0,Se=1/0,Ie=-1/0,ot=-1/0;for(const nr of I){const or=new t.P(nr.x+lr,nr.y+lr);Te=Math.min(Te,or.x),Se=Math.min(Se,or.y),Ie=Math.max(Ie,or.x),ot=Math.max(ot,or.y),ne.push(or)}const yt=this.grid.query(Te,Se,Ie,ot).concat(this.ignoredGrid.query(Te,Se,Ie,ot)),Ct={},Wt={};for(const nr of yt){const or=nr.key;if(Ct[or.bucketInstanceId]===void 0&&(Ct[or.bucketInstanceId]={}),Ct[or.bucketInstanceId][or.featureIndex])continue;const Fr=[new t.P(nr.x1,nr.y1),new t.P(nr.x2,nr.y1),new t.P(nr.x2,nr.y2),new t.P(nr.x1,nr.y2)];t.am(ne,Fr)&&(Ct[or.bucketInstanceId][or.featureIndex]=!0,Wt[or.bucketInstanceId]===void 0&&(Wt[or.bucketInstanceId]=[]),Wt[or.bucketInstanceId].push(or.featureIndex))}return Wt}insertCollisionBox(I,ne,Te,Se,Ie,ot){(Te?this.ignoredGrid:this.grid).insert({bucketInstanceId:Se,featureIndex:Ie,collisionGroupID:ot,overlapMode:ne},I[0],I[1],I[2],I[3])}insertCollisionCircles(I,ne,Te,Se,Ie,ot){const yt=Te?this.ignoredGrid:this.grid,Ct={bucketInstanceId:Se,featureIndex:Ie,collisionGroupID:ot,overlapMode:ne};for(let Wt=0;Wt=this.screenRightBoundary||Sethis.screenBottomBoundary}isInsideGrid(I,ne,Te,Se){return Te>=0&&I=0&&nethis.projectAndGetPerspectiveRatio(Te,Qr.x,Qr.y,Se,Wt));Sr=Nr.some(Qr=>!Qr.isOccluded),sr=Nr.map(Qr=>Qr.point)}else Sr=!0;return{box:t.ao(sr),allPointsOccluded:!Sr}}}function da(De,I,ne){return I*(t.X/(De.tileSize*Math.pow(2,ne-De.tileID.overscaledZ)))}class wa{constructor(I,ne,Te,Se){this.opacity=I?Math.max(0,Math.min(1,I.opacity+(I.placed?ne:-ne))):Se&&Te?1:0,this.placed=Te}isHidden(){return this.opacity===0&&!this.placed}}class ma{constructor(I,ne,Te,Se,Ie){this.text=new wa(I?I.text:null,ne,Te,Ie),this.icon=new wa(I?I.icon:null,ne,Se,Ie)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ia{constructor(I,ne,Te){this.text=I,this.icon=ne,this.skipFade=Te}}class va{constructor(){this.invProjMatrix=t.H(),this.viewportMatrix=t.H(),this.circles=[]}}class La{constructor(I,ne,Te,Se,Ie){this.bucketInstanceId=I,this.featureIndex=ne,this.sourceLayerIndex=Te,this.bucketIndex=Se,this.tileID=Ie}}class Ka{constructor(I){this.crossSourceCollisions=I,this.maxGroupID=0,this.collisionGroups={}}get(I){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[I]){const ne=++this.maxGroupID;this.collisionGroups[I]={ID:ne,predicate:Te=>Te.collisionGroupID===ne}}return this.collisionGroups[I]}}function Vt(De,I,ne,Te,Se){const{horizontalAlign:Ie,verticalAlign:ot}=t.au(De);return new t.P(-(Ie-.5)*I+Te[0]*Se,-(ot-.5)*ne+Te[1]*Se)}class Lt{constructor(I,ne,Te,Se,Ie,ot){this.transform=I.clone(),this.terrain=Te,this.collisionIndex=new ta(this.transform,ne),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=Se,this.retainedQueryData={},this.collisionGroups=new Ka(Ie),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=ot,ot&&(ot.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(I){const ne=this.terrain;return ne?(Te,Se)=>ne.getElevation(I,Te,Se):null}getBucketParts(I,ne,Te,Se){const Ie=Te.getBucket(ne),ot=Te.latestFeatureIndex;if(!Ie||!ot||ne.id!==Ie.layerIds[0])return;const yt=Te.collisionBoxArray,Ct=Ie.layers[0].layout,Wt=Ie.layers[0].paint,nr=Math.pow(2,this.transform.zoom-Te.tileID.overscaledZ),or=Te.tileSize/t.X,Fr=Te.tileID.toUnwrapped(),Wr=this.transform.calculatePosMatrix(Fr),je=Ct.get("text-pitch-alignment")==="map",Ze=Ct.get("text-rotation-alignment")==="map",at=da(Te,1,this.transform.zoom),lt=this.collisionIndex.mapProjection.translatePosition(this.transform,Te,Wt.get("text-translate"),Wt.get("text-translate-anchor")),Tt=this.collisionIndex.mapProjection.translatePosition(this.transform,Te,Wt.get("icon-translate"),Wt.get("icon-translate-anchor")),gt=fr(Wr,je,Ze,this.transform,at);let Et=null;if(je){const rr=dr(Wr,je,Ze,this.transform,at);Et=t.L([],this.transform.labelPlaneMatrix,rr)}this.retainedQueryData[Ie.bucketInstanceId]=new La(Ie.bucketInstanceId,ot,Ie.sourceLayerIndex,Ie.index,Te.tileID);const Yt={bucket:Ie,layout:Ct,translationText:lt,translationIcon:Tt,posMatrix:Wr,unwrappedTileID:Fr,textLabelPlaneMatrix:gt,labelToScreenMatrix:Et,scale:nr,textPixelRatio:or,holdingForFade:Te.holdingForFade(),collisionBoxArray:yt,partiallyEvaluatedTextSize:t.ag(Ie.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Ie.sourceID)};if(Se)for(const rr of Ie.sortKeyRanges){const{sortKey:sr,symbolInstanceStart:Sr,symbolInstanceEnd:Nr}=rr;I.push({sortKey:sr,symbolInstanceStart:Sr,symbolInstanceEnd:Nr,parameters:Yt})}else I.push({symbolInstanceStart:0,symbolInstanceEnd:Ie.symbolInstances.length,parameters:Yt})}attemptAnchorPlacement(I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr,je,Ze,at,lt,Tt,gt){const Et=t.aq[I.textAnchor],Yt=[I.textOffset0,I.textOffset1],rr=Vt(Et,Te,Se,Yt,Ie),sr=this.collisionIndex.placeCollisionBox(ne,Fr,Ct,Wt,nr,yt,ot,at,or.predicate,gt,rr);if((!Tt||this.collisionIndex.placeCollisionBox(Tt,Fr,Ct,Wt,nr,yt,ot,lt,or.predicate,gt,rr).placeable)&&sr.placeable){let Sr;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Wr.crossTileID]&&this.prevPlacement.placements[Wr.crossTileID]&&this.prevPlacement.placements[Wr.crossTileID].text&&(Sr=this.prevPlacement.variableOffsets[Wr.crossTileID].anchor),Wr.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Wr.crossTileID]={textOffset:Yt,width:Te,height:Se,anchor:Et,textBoxScale:Ie,prevAnchor:Sr},this.markUsedJustification(je,Et,Wr,Ze),je.allowVerticalPlacement&&(this.markUsedOrientation(je,Ze,Wr),this.placedOrientations[Wr.crossTileID]=Ze),{shift:rr,placedGlyphBoxes:sr}}}placeLayerBucketPart(I,ne,Te){const{bucket:Se,layout:Ie,translationText:ot,translationIcon:yt,posMatrix:Ct,unwrappedTileID:Wt,textLabelPlaneMatrix:nr,labelToScreenMatrix:or,textPixelRatio:Fr,holdingForFade:Wr,collisionBoxArray:je,partiallyEvaluatedTextSize:Ze,collisionGroup:at}=I.parameters,lt=Ie.get("text-optional"),Tt=Ie.get("icon-optional"),gt=t.ar(Ie,"text-overlap","text-allow-overlap"),Et=gt==="always",Yt=t.ar(Ie,"icon-overlap","icon-allow-overlap"),rr=Yt==="always",sr=Ie.get("text-rotation-alignment")==="map",Sr=Ie.get("text-pitch-alignment")==="map",Nr=Ie.get("icon-text-fit")!=="none",Qr=Ie.get("symbol-z-order")==="viewport-y",ia=Et&&(rr||!Se.hasIconData()||Tt),_a=rr&&(Et||!Se.hasTextData()||lt);!Se.collisionArrays&&je&&Se.deserializeCollisionBoxes(je);const za=this._getTerrainElevationFunc(this.retainedQueryData[Se.bucketInstanceId].tileID),nn=(en,ln,Nn)=>{var pi,ii;if(ne[en.crossTileID])return;if(Wr)return void(this.placements[en.crossTileID]=new Ia(!1,!1,!1));let Gi=!1,Bo=!1,No=!0,po=null,Zo={box:null,placeable:!1,offscreen:null},Hs={box:null,placeable:!1,offscreen:null},zs=null,xo=null,bo=null,vl=0,Al=0,pu=0;ln.textFeatureIndex?vl=ln.textFeatureIndex:en.useRuntimeCollisionCircles&&(vl=en.featureIndex),ln.verticalTextFeatureIndex&&(Al=ln.verticalTextFeatureIndex);const pe=ln.textBox;if(pe){const ht=$t=>{let Cr=t.ah.horizontal;if(Se.allowVerticalPlacement&&!$t&&this.prevPlacement){const Ar=this.prevPlacement.placedOrientations[en.crossTileID];Ar&&(this.placedOrientations[en.crossTileID]=Ar,Cr=Ar,this.markUsedOrientation(Se,Cr,en))}return Cr},xt=($t,Cr)=>{if(Se.allowVerticalPlacement&&en.numVerticalGlyphVertices>0&&ln.verticalTextBox){for(const Ar of Se.writingModes)if(Ar===t.ah.vertical?(Zo=Cr(),Hs=Zo):Zo=$t(),Zo&&Zo.placeable)break}else Zo=$t()},zt=en.textAnchorOffsetStartIndex,Dt=en.textAnchorOffsetEndIndex;if(Dt===zt){const $t=(Cr,Ar)=>{const Vr=this.collisionIndex.placeCollisionBox(Cr,gt,Fr,Ct,Wt,Sr,sr,ot,at.predicate,za);return Vr&&Vr.placeable&&(this.markUsedOrientation(Se,Ar,en),this.placedOrientations[en.crossTileID]=Ar),Vr};xt(()=>$t(pe,t.ah.horizontal),()=>{const Cr=ln.verticalTextBox;return Se.allowVerticalPlacement&&en.numVerticalGlyphVertices>0&&Cr?$t(Cr,t.ah.vertical):{box:null,offscreen:null}}),ht(Zo&&Zo.placeable)}else{let $t=t.aq[(ii=(pi=this.prevPlacement)===null||pi===void 0?void 0:pi.variableOffsets[en.crossTileID])===null||ii===void 0?void 0:ii.anchor];const Cr=(Vr,Kr,aa)=>{const Ua=Vr.x2-Vr.x1,la=Vr.y2-Vr.y1,Ta=en.textBoxScale,ka=Nr&&Yt==="never"?Kr:null;let Ba=null,Va=gt==="never"?1:2,Ma="never";$t&&Va++;for(let mn=0;mnCr(pe,ln.iconBox,t.ah.horizontal),()=>{const Vr=ln.verticalTextBox;return Se.allowVerticalPlacement&&(!Zo||!Zo.placeable)&&en.numVerticalGlyphVertices>0&&Vr?Cr(Vr,ln.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}}),Zo&&(Gi=Zo.placeable,No=Zo.offscreen);const Ar=ht(Zo&&Zo.placeable);if(!Gi&&this.prevPlacement){const Vr=this.prevPlacement.variableOffsets[en.crossTileID];Vr&&(this.variableOffsets[en.crossTileID]=Vr,this.markUsedJustification(Se,Vr.anchor,en,Ar))}}}if(zs=Zo,Gi=zs&&zs.placeable,No=zs&&zs.offscreen,en.useRuntimeCollisionCircles){const ht=Se.text.placedSymbolArray.get(en.centerJustifiedTextSymbolIndex),xt=t.ai(Se.textSizeData,Ze,ht),zt=Ie.get("text-padding");xo=this.collisionIndex.placeCollisionCircles(gt,ht,Se.lineVertexArray,Se.glyphOffsetArray,xt,Ct,Wt,nr,or,Te,Sr,at.predicate,en.collisionCircleDiameter,zt,ot,za),xo.circles.length&&xo.collisionDetected&&!Te&&t.w("Collisions detected, but collision boxes are not shown"),Gi=Et||xo.circles.length>0&&!xo.collisionDetected,No=No&&xo.offscreen}if(ln.iconFeatureIndex&&(pu=ln.iconFeatureIndex),ln.iconBox){const ht=xt=>this.collisionIndex.placeCollisionBox(xt,Yt,Fr,Ct,Wt,Sr,sr,yt,at.predicate,za,Nr&&po?po:void 0);Hs&&Hs.placeable&&ln.verticalIconBox?(bo=ht(ln.verticalIconBox),Bo=bo.placeable):(bo=ht(ln.iconBox),Bo=bo.placeable),No=No&&bo.offscreen}const Le=lt||en.numHorizontalGlyphVertices===0&&en.numVerticalGlyphVertices===0,Ye=Tt||en.numIconVertices===0;Le||Ye?Ye?Le||(Bo=Bo&&Gi):Gi=Bo&&Gi:Bo=Gi=Bo&&Gi;const ut=Bo&&bo.placeable;if(Gi&&zs.placeable&&this.collisionIndex.insertCollisionBox(zs.box,gt,Ie.get("text-ignore-placement"),Se.bucketInstanceId,Hs&&Hs.placeable&&Al?Al:vl,at.ID),ut&&this.collisionIndex.insertCollisionBox(bo.box,Yt,Ie.get("icon-ignore-placement"),Se.bucketInstanceId,pu,at.ID),xo&&Gi&&this.collisionIndex.insertCollisionCircles(xo.circles,gt,Ie.get("text-ignore-placement"),Se.bucketInstanceId,vl,at.ID),Te&&this.storeCollisionData(Se.bucketInstanceId,Nn,ln,zs,bo,xo),en.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(Se.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[en.crossTileID]=new Ia(Gi||ia,Bo||_a,No||Se.justReloaded),ne[en.crossTileID]=!0};if(Qr){if(I.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const en=Se.getSortedSymbolIndexes(this.transform.angle);for(let ln=en.length-1;ln>=0;--ln){const Nn=en[ln];nn(Se.symbolInstances.get(Nn),Se.collisionArrays[Nn],Nn)}}else for(let en=I.symbolInstanceStart;en=0&&(I.text.placedSymbolArray.get(yt).crossTileID=Ie>=0&&yt!==Ie?0:Te.crossTileID)}markUsedOrientation(I,ne,Te){const Se=ne===t.ah.horizontal||ne===t.ah.horizontalOnly?ne:0,Ie=ne===t.ah.vertical?ne:0,ot=[Te.leftJustifiedTextSymbolIndex,Te.centerJustifiedTextSymbolIndex,Te.rightJustifiedTextSymbolIndex];for(const yt of ot)I.text.placedSymbolArray.get(yt).placedOrientation=Se;Te.verticalPlacedTextSymbolIndex&&(I.text.placedSymbolArray.get(Te.verticalPlacedTextSymbolIndex).placedOrientation=Ie)}commit(I){this.commitTime=I,this.zoomAtLastRecencyCheck=this.transform.zoom;const ne=this.prevPlacement;let Te=!1;this.prevZoomAdjustment=ne?ne.zoomAdjustment(this.transform.zoom):0;const Se=ne?ne.symbolFadeChange(I):1,Ie=ne?ne.opacities:{},ot=ne?ne.variableOffsets:{},yt=ne?ne.placedOrientations:{};for(const Ct in this.placements){const Wt=this.placements[Ct],nr=Ie[Ct];nr?(this.opacities[Ct]=new ma(nr,Se,Wt.text,Wt.icon),Te=Te||Wt.text!==nr.text.placed||Wt.icon!==nr.icon.placed):(this.opacities[Ct]=new ma(null,Se,Wt.text,Wt.icon,Wt.skipFade),Te=Te||Wt.text||Wt.icon)}for(const Ct in Ie){const Wt=Ie[Ct];if(!this.opacities[Ct]){const nr=new ma(Wt,Se,!1,!1);nr.isHidden()||(this.opacities[Ct]=nr,Te=Te||Wt.text.placed||Wt.icon.placed)}}for(const Ct in ot)this.variableOffsets[Ct]||!this.opacities[Ct]||this.opacities[Ct].isHidden()||(this.variableOffsets[Ct]=ot[Ct]);for(const Ct in yt)this.placedOrientations[Ct]||!this.opacities[Ct]||this.opacities[Ct].isHidden()||(this.placedOrientations[Ct]=yt[Ct]);if(ne&&ne.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");Te?this.lastPlacementChangeTime=I:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=ne?ne.lastPlacementChangeTime:I)}updateLayerOpacities(I,ne){const Te={};for(const Se of ne){const Ie=Se.getBucket(I);Ie&&Se.latestFeatureIndex&&I.id===Ie.layerIds[0]&&this.updateBucketOpacities(Ie,Se.tileID,Te,Se.collisionBoxArray)}}updateBucketOpacities(I,ne,Te,Se){I.hasTextData()&&(I.text.opacityVertexArray.clear(),I.text.hasVisibleVertices=!1),I.hasIconData()&&(I.icon.opacityVertexArray.clear(),I.icon.hasVisibleVertices=!1),I.hasIconCollisionBoxData()&&I.iconCollisionBox.collisionVertexArray.clear(),I.hasTextCollisionBoxData()&&I.textCollisionBox.collisionVertexArray.clear();const Ie=I.layers[0],ot=Ie.layout,yt=new ma(null,0,!1,!1,!0),Ct=ot.get("text-allow-overlap"),Wt=ot.get("icon-allow-overlap"),nr=Ie._unevaluatedLayout.hasValue("text-variable-anchor")||Ie._unevaluatedLayout.hasValue("text-variable-anchor-offset"),or=ot.get("text-rotation-alignment")==="map",Fr=ot.get("text-pitch-alignment")==="map",Wr=ot.get("icon-text-fit")!=="none",je=new ma(null,0,Ct&&(Wt||!I.hasIconData()||ot.get("icon-optional")),Wt&&(Ct||!I.hasTextData()||ot.get("text-optional")),!0);!I.collisionArrays&&Se&&(I.hasIconCollisionBoxData()||I.hasTextCollisionBoxData())&&I.deserializeCollisionBoxes(Se);const Ze=(lt,Tt,gt)=>{for(let Et=0;Et0,Sr=this.placedOrientations[Tt.crossTileID],Nr=Sr===t.ah.vertical,Qr=Sr===t.ah.horizontal||Sr===t.ah.horizontalOnly;if(gt>0||Et>0){const _a=Pa(rr.text);Ze(I.text,gt,Nr?sa:_a),Ze(I.text,Et,Qr?sa:_a);const za=rr.text.isHidden();[Tt.rightJustifiedTextSymbolIndex,Tt.centerJustifiedTextSymbolIndex,Tt.leftJustifiedTextSymbolIndex].forEach(ln=>{ln>=0&&(I.text.placedSymbolArray.get(ln).hidden=za||Nr?1:0)}),Tt.verticalPlacedTextSymbolIndex>=0&&(I.text.placedSymbolArray.get(Tt.verticalPlacedTextSymbolIndex).hidden=za||Qr?1:0);const nn=this.variableOffsets[Tt.crossTileID];nn&&this.markUsedJustification(I,nn.anchor,Tt,Sr);const en=this.placedOrientations[Tt.crossTileID];en&&(this.markUsedJustification(I,"left",Tt,en),this.markUsedOrientation(I,en,Tt))}if(sr){const _a=Pa(rr.icon),za=!(Wr&&Tt.verticalPlacedIconSymbolIndex&&Nr);Tt.placedIconSymbolIndex>=0&&(Ze(I.icon,Tt.numIconVertices,za?_a:sa),I.icon.placedSymbolArray.get(Tt.placedIconSymbolIndex).hidden=rr.icon.isHidden()),Tt.verticalPlacedIconSymbolIndex>=0&&(Ze(I.icon,Tt.numVerticalIconVertices,za?sa:_a),I.icon.placedSymbolArray.get(Tt.verticalPlacedIconSymbolIndex).hidden=rr.icon.isHidden())}const ia=at&&at.has(lt)?at.get(lt):{text:null,icon:null};if(I.hasIconCollisionBoxData()||I.hasTextCollisionBoxData()){const _a=I.collisionArrays[lt];if(_a){let za=new t.P(0,0);if(_a.textBox||_a.verticalTextBox){let nn=!0;if(nr){const en=this.variableOffsets[Yt];en?(za=Vt(en.anchor,en.width,en.height,en.textOffset,en.textBoxScale),or&&za._rotate(Fr?this.transform.angle:-this.transform.angle)):nn=!1}if(_a.textBox||_a.verticalTextBox){let en;_a.textBox&&(en=Nr),_a.verticalTextBox&&(en=Qr),jt(I.textCollisionBox.collisionVertexArray,rr.text.placed,!nn||en,ia.text,za.x,za.y)}}if(_a.iconBox||_a.verticalIconBox){const nn=!!(!Qr&&_a.verticalIconBox);let en;_a.iconBox&&(en=nn),_a.verticalIconBox&&(en=!nn),jt(I.iconCollisionBox.collisionVertexArray,rr.icon.placed,en,ia.icon,Wr?za.x:0,Wr?za.y:0)}}}}if(I.sortFeatures(this.transform.angle),this.retainedQueryData[I.bucketInstanceId]&&(this.retainedQueryData[I.bucketInstanceId].featureSortOrder=I.featureSortOrder),I.hasTextData()&&I.text.opacityVertexBuffer&&I.text.opacityVertexBuffer.updateData(I.text.opacityVertexArray),I.hasIconData()&&I.icon.opacityVertexBuffer&&I.icon.opacityVertexBuffer.updateData(I.icon.opacityVertexArray),I.hasIconCollisionBoxData()&&I.iconCollisionBox.collisionVertexBuffer&&I.iconCollisionBox.collisionVertexBuffer.updateData(I.iconCollisionBox.collisionVertexArray),I.hasTextCollisionBoxData()&&I.textCollisionBox.collisionVertexBuffer&&I.textCollisionBox.collisionVertexBuffer.updateData(I.textCollisionBox.collisionVertexArray),I.text.opacityVertexArray.length!==I.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${I.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${I.text.layoutVertexArray.length}) / 4`);if(I.icon.opacityVertexArray.length!==I.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${I.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${I.icon.layoutVertexArray.length}) / 4`);if(I.bucketInstanceId in this.collisionCircleArrays){const lt=this.collisionCircleArrays[I.bucketInstanceId];I.placementInvProjMatrix=lt.invProjMatrix,I.placementViewportMatrix=lt.viewportMatrix,I.collisionCircleArray=lt.circles,delete this.collisionCircleArrays[I.bucketInstanceId]}}symbolFadeChange(I){return this.fadeDuration===0?1:(I-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(I){return Math.max(0,(this.transform.zoom-I)/1.5)}hasTransitions(I){return this.stale||I-this.lastPlacementChangeTimeI}setStale(){this.stale=!0}}function jt(De,I,ne,Te,Se,Ie){Te&&Te.length!==0||(Te=[0,0,0,0]);const ot=Te[0]-lr,yt=Te[1]-lr,Ct=Te[2]-lr,Wt=Te[3]-lr;De.emplaceBack(I?1:0,ne?1:0,Se||0,Ie||0,ot,yt),De.emplaceBack(I?1:0,ne?1:0,Se||0,Ie||0,Ct,yt),De.emplaceBack(I?1:0,ne?1:0,Se||0,Ie||0,Ct,Wt),De.emplaceBack(I?1:0,ne?1:0,Se||0,Ie||0,ot,Wt)}const Ot=Math.pow(2,25),gr=Math.pow(2,24),Br=Math.pow(2,17),na=Math.pow(2,16),Ur=Math.pow(2,9),ga=Math.pow(2,8),Aa=Math.pow(2,1);function Pa(De){if(De.opacity===0&&!De.placed)return 0;if(De.opacity===1&&De.placed)return 4294967295;const I=De.placed?1:0,ne=Math.floor(127*De.opacity);return ne*Ot+I*gr+ne*Br+I*na+ne*Ur+I*ga+ne*Aa+I}const sa=0;function Oa(){return{isOccluded:(De,I,ne)=>!1,getPitchedTextCorrection:(De,I,ne)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(De,I,ne,Te){throw new Error("Not implemented.")},translatePosition:(De,I,ne,Te)=>function(Se,Ie,ot,yt,Ct=!1){if(!ot[0]&&!ot[1])return[0,0];const Wt=Ct?yt==="map"?Se.angle:0:yt==="viewport"?-Se.angle:0;if(Wt){const nr=Math.sin(Wt),or=Math.cos(Wt);ot=[ot[0]*or-ot[1]*nr,ot[0]*nr+ot[1]*or]}return[Ct?ot[0]:da(Ie,ot[0],Se.zoom),Ct?ot[1]:da(Ie,ot[1],Se.zoom)]}(De,I,ne,Te),getCircleRadiusCorrection:De=>1}}class dt{constructor(I){this._sortAcrossTiles=I.layout.get("symbol-z-order")!=="viewport-y"&&!I.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(I,ne,Te,Se,Ie){const ot=this._bucketParts;for(;this._currentTileIndexyt.sortKey-Ct.sortKey));this._currentPartIndex!this._forceFullPlacement&&i.now()-Se>2;for(;this._currentPlacementIndex>=0;){const ot=ne[I[this._currentPlacementIndex]],yt=this.placement.collisionIndex.transform.zoom;if(ot.type==="symbol"&&(!ot.minzoom||ot.minzoom<=yt)&&(!ot.maxzoom||ot.maxzoom>yt)){if(this._inProgressLayer||(this._inProgressLayer=new dt(ot)),this._inProgressLayer.continuePlacement(Te[ot.source],this.placement,this._showCollisionBoxes,ot,Ie))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(I){return this.placement.commit(I),this.placement}}const Lr=512/t.X/2;class Er{constructor(I,ne,Te){this.tileID=I,this.bucketInstanceId=Te,this._symbolsByKey={};const Se=new Map;for(let Ie=0;Ie({x:Math.floor(Ct.anchorX*Lr),y:Math.floor(Ct.anchorY*Lr)})),crossTileIDs:ot.map(Ct=>Ct.crossTileID)};if(yt.positions.length>128){const Ct=new t.av(yt.positions.length,16,Uint16Array);for(const{x:Wt,y:nr}of yt.positions)Ct.add(Wt,nr);Ct.finish(),delete yt.positions,yt.index=Ct}this._symbolsByKey[Ie]=yt}}getScaledCoordinates(I,ne){const{x:Te,y:Se,z:Ie}=this.tileID.canonical,{x:ot,y:yt,z:Ct}=ne.canonical,Wt=Lr/Math.pow(2,Ct-Ie),nr=(yt*t.X+I.anchorY)*Wt,or=Se*t.X*Lr;return{x:Math.floor((ot*t.X+I.anchorX)*Wt-Te*t.X*Lr),y:Math.floor(nr-or)}}findMatches(I,ne,Te){const Se=this.tileID.canonical.zI)}}class _r{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class yr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(I){const ne=Math.round((I-this.lng)/360);if(ne!==0)for(const Te in this.indexes){const Se=this.indexes[Te],Ie={};for(const ot in Se){const yt=Se[ot];yt.tileID=yt.tileID.unwrapTo(yt.tileID.wrap+ne),Ie[yt.tileID.key]=yt}this.indexes[Te]=Ie}this.lng=I}addBucket(I,ne,Te){if(this.indexes[I.overscaledZ]&&this.indexes[I.overscaledZ][I.key]){if(this.indexes[I.overscaledZ][I.key].bucketInstanceId===ne.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(I.overscaledZ,this.indexes[I.overscaledZ][I.key])}for(let Ie=0;IeI.overscaledZ)for(const yt in ot){const Ct=ot[yt];Ct.tileID.isChildOf(I)&&Ct.findMatches(ne.symbolInstances,I,Se)}else{const yt=ot[I.scaledTo(Number(Ie)).key];yt&&yt.findMatches(ne.symbolInstances,I,Se)}}for(let Ie=0;Ie{ne[Te]=!0});for(const Te in this.layerIndexes)ne[Te]||delete this.layerIndexes[Te]}}const zr=(De,I)=>t.t(De,I&&I.filter(ne=>ne.identifier!=="source.canvas")),Pr=t.aw();class Hr extends t.E{constructor(I,ne={}){super(),this._rtlPluginLoaded=()=>{for(const Te in this.sourceCaches){const Se=this.sourceCaches[Te].getSource().type;Se!=="vector"&&Se!=="geojson"||this.sourceCaches[Te].reload()}},this.map=I,this.dispatcher=new $(J(),I._getMapId()),this.dispatcher.registerMessageHandler("GG",(Te,Se)=>this.getGlyphs(Te,Se)),this.dispatcher.registerMessageHandler("GI",(Te,Se)=>this.getImages(Te,Se)),this.imageManager=new m,this.imageManager.setEventedParent(this),this.glyphManager=new F(I._requestManager,ne.localIdeographFontFamily),this.lineAtlas=new Z(256,512),this.crossTileSymbolIndex=new kr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",t.ay()),$e().on(xe,this._rtlPluginLoaded),this.on("data",Te=>{if(Te.dataType!=="source"||Te.sourceDataType!=="metadata")return;const Se=this.sourceCaches[Te.sourceId];if(!Se)return;const Ie=Se.getSource();if(Ie&&Ie.vectorLayerIds)for(const ot in this._layers){const yt=this._layers[ot];yt.source===Ie.id&&this._validateLayer(yt)}})}loadURL(I,ne={},Te){this.fire(new t.k("dataloading",{dataType:"style"})),ne.validate=typeof ne.validate!="boolean"||ne.validate;const Se=this.map._requestManager.transformRequest(I,"Style");this._loadStyleRequest=new AbortController;const Ie=this._loadStyleRequest;t.h(Se,this._loadStyleRequest).then(ot=>{this._loadStyleRequest=null,this._load(ot.data,ne,Te)}).catch(ot=>{this._loadStyleRequest=null,ot&&!Ie.signal.aborted&&this.fire(new t.j(ot))})}loadJSON(I,ne={},Te){this.fire(new t.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,ne.validate=ne.validate!==!1,this._load(I,ne,Te)}).catch(()=>{})}loadEmpty(){this.fire(new t.k("dataloading",{dataType:"style"})),this._load(Pr,{validate:!1})}_load(I,ne,Te){var Se;const Ie=ne.transformStyle?ne.transformStyle(Te,I):I;if(!ne.validate||!zr(this,t.u(Ie))){this._loaded=!0,this.stylesheet=Ie;for(const ot in Ie.sources)this.addSource(ot,Ie.sources[ot],{validate:!1});Ie.sprite?this._loadSprite(Ie.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Ie.glyphs),this._createLayers(),this.light=new L(this.stylesheet.light),this.sky=new U(this.stylesheet.sky),this.map.setTerrain((Se=this.stylesheet.terrain)!==null&&Se!==void 0?Se:null),this.fire(new t.k("data",{dataType:"style"})),this.fire(new t.k("style.load"))}}_createLayers(){const I=t.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",I),this._order=I.map(ne=>ne.id),this._layers={},this._serializedLayers=null;for(const ne of I){const Te=t.aA(ne);Te.setEventedParent(this,{layer:{id:ne.id}}),this._layers[ne.id]=Te}}_loadSprite(I,ne=!1,Te=void 0){let Se;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(Ie,ot,yt,Ct){return t._(this,void 0,void 0,function*(){const Wt=w(Ie),nr=yt>1?"@2x":"",or={},Fr={};for(const{id:Wr,url:je}of Wt){const Ze=ot.transformRequest(p(je,nr,".json"),"SpriteJSON");or[Wr]=t.h(Ze,Ct);const at=ot.transformRequest(p(je,nr,".png"),"SpriteImage");Fr[Wr]=l.getImage(at,Ct)}return yield Promise.all([...Object.values(or),...Object.values(Fr)]),function(Wr,je){return t._(this,void 0,void 0,function*(){const Ze={};for(const at in Wr){Ze[at]={};const lt=i.getImageCanvasContext((yield je[at]).data),Tt=(yield Wr[at]).data;for(const gt in Tt){const{width:Et,height:Yt,x:rr,y:sr,sdf:Sr,pixelRatio:Nr,stretchX:Qr,stretchY:ia,content:_a,textFitWidth:za,textFitHeight:nn}=Tt[gt];Ze[at][gt]={data:null,pixelRatio:Nr,sdf:Sr,stretchX:Qr,stretchY:ia,content:_a,textFitWidth:za,textFitHeight:nn,spriteData:{width:Et,height:Yt,x:rr,y:sr,context:lt}}}}return Ze})}(or,Fr)})}(I,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(Ie=>{if(this._spriteRequest=null,Ie)for(const ot in Ie){this._spritesImagesIds[ot]=[];const yt=this._spritesImagesIds[ot]?this._spritesImagesIds[ot].filter(Ct=>!(Ct in Ie)):[];for(const Ct of yt)this.imageManager.removeImage(Ct),this._changedImages[Ct]=!0;for(const Ct in Ie[ot]){const Wt=ot==="default"?Ct:`${ot}:${Ct}`;this._spritesImagesIds[ot].push(Wt),Wt in this.imageManager.images?this.imageManager.updateImage(Wt,Ie[ot][Ct],!1):this.imageManager.addImage(Wt,Ie[ot][Ct]),ne&&(this._changedImages[Wt]=!0)}}}).catch(Ie=>{this._spriteRequest=null,Se=Ie,this.fire(new t.j(Se))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),ne&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"})),Te&&Te(Se)})}_unloadSprite(){for(const I of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(I),this._changedImages[I]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}_validateLayer(I){const ne=this.sourceCaches[I.source];if(!ne)return;const Te=I.sourceLayer;if(!Te)return;const Se=ne.getSource();(Se.type==="geojson"||Se.vectorLayerIds&&Se.vectorLayerIds.indexOf(Te)===-1)&&this.fire(new t.j(new Error(`Source layer "${Te}" does not exist on source "${Se.id}" as specified by style layer "${I.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const I in this.sourceCaches)if(!this.sourceCaches[I].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(I,ne=!1){const Te=this._serializedAllLayers();if(!I||I.length===0)return Object.values(ne?t.aB(Te):Te);const Se=[];for(const Ie of I)if(Te[Ie]){const ot=ne?t.aB(Te[Ie]):Te[Ie];Se.push(ot)}return Se}_serializedAllLayers(){let I=this._serializedLayers;if(I)return I;I=this._serializedLayers={};const ne=Object.keys(this._layers);for(const Te of ne){const Se=this._layers[Te];Se.type!=="custom"&&(I[Te]=Se.serialize())}return I}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const I in this.sourceCaches)if(this.sourceCaches[I].hasTransition())return!0;for(const I in this._layers)if(this._layers[I].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(I){if(!this._loaded)return;const ne=this._changed;if(ne){const Se=Object.keys(this._updatedLayers),Ie=Object.keys(this._removedLayers);(Se.length||Ie.length)&&this._updateWorkerLayers(Se,Ie);for(const ot in this._updatedSources){const yt=this._updatedSources[ot];if(yt==="reload")this._reloadSource(ot);else{if(yt!=="clear")throw new Error(`Invalid action ${yt}`);this._clearSource(ot)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const ot in this._updatedPaintProps)this._layers[ot].updateTransitions(I);this.light.updateTransitions(I),this.sky.updateTransitions(I),this._resetUpdates()}const Te={};for(const Se in this.sourceCaches){const Ie=this.sourceCaches[Se];Te[Se]=Ie.used,Ie.used=!1}for(const Se of this._order){const Ie=this._layers[Se];Ie.recalculate(I,this._availableImages),!Ie.isHidden(I.zoom)&&Ie.source&&(this.sourceCaches[Ie.source].used=!0)}for(const Se in Te){const Ie=this.sourceCaches[Se];!!Te[Se]!=!!Ie.used&&Ie.fire(new t.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:Se}))}this.light.recalculate(I),this.sky.recalculate(I),this.z=I.zoom,ne&&this.fire(new t.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const I=Object.keys(this._changedImages);if(I.length){for(const ne in this.sourceCaches)this.sourceCaches[ne].reloadTilesForDependencies(["icons","patterns"],I);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const I in this.sourceCaches)this.sourceCaches[I].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(I,ne){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(I,!1),removedIds:ne})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(I,ne={}){var Te;this._checkLoaded();const Se=this.serialize();if(I=ne.transformStyle?ne.transformStyle(Se,I):I,((Te=ne.validate)===null||Te===void 0||Te)&&zr(this,t.u(I)))return!1;(I=t.aB(I)).layers=t.az(I.layers);const Ie=t.aC(Se,I),ot=this._getOperationsToPerform(Ie);if(ot.unimplemented.length>0)throw new Error(`Unimplemented: ${ot.unimplemented.join(", ")}.`);if(ot.operations.length===0)return!1;for(const yt of ot.operations)yt();return this.stylesheet=I,this._serializedLayers=null,!0}_getOperationsToPerform(I){const ne=[],Te=[];for(const Se of I)switch(Se.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":ne.push(()=>this.addLayer.apply(this,Se.args));break;case"removeLayer":ne.push(()=>this.removeLayer.apply(this,Se.args));break;case"setPaintProperty":ne.push(()=>this.setPaintProperty.apply(this,Se.args));break;case"setLayoutProperty":ne.push(()=>this.setLayoutProperty.apply(this,Se.args));break;case"setFilter":ne.push(()=>this.setFilter.apply(this,Se.args));break;case"addSource":ne.push(()=>this.addSource.apply(this,Se.args));break;case"removeSource":ne.push(()=>this.removeSource.apply(this,Se.args));break;case"setLayerZoomRange":ne.push(()=>this.setLayerZoomRange.apply(this,Se.args));break;case"setLight":ne.push(()=>this.setLight.apply(this,Se.args));break;case"setGeoJSONSourceData":ne.push(()=>this.setGeoJSONSourceData.apply(this,Se.args));break;case"setGlyphs":ne.push(()=>this.setGlyphs.apply(this,Se.args));break;case"setSprite":ne.push(()=>this.setSprite.apply(this,Se.args));break;case"setSky":ne.push(()=>this.setSky.apply(this,Se.args));break;case"setTerrain":ne.push(()=>this.map.setTerrain.apply(this,Se.args));break;case"setTransition":ne.push(()=>{});break;default:Te.push(Se.command)}return{operations:ne,unimplemented:Te}}addImage(I,ne){if(this.getImage(I))return this.fire(new t.j(new Error(`An image named "${I}" already exists.`)));this.imageManager.addImage(I,ne),this._afterImageUpdated(I)}updateImage(I,ne){this.imageManager.updateImage(I,ne)}getImage(I){return this.imageManager.getImage(I)}removeImage(I){if(!this.getImage(I))return this.fire(new t.j(new Error(`An image named "${I}" does not exist.`)));this.imageManager.removeImage(I),this._afterImageUpdated(I)}_afterImageUpdated(I){this._availableImages=this.imageManager.listImages(),this._changedImages[I]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(I,ne,Te={}){if(this._checkLoaded(),this.sourceCaches[I]!==void 0)throw new Error(`Source "${I}" already exists.`);if(!ne.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(ne).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(ne.type)>=0&&this._validate(t.u.source,`sources.${I}`,ne,null,Te))return;this.map&&this.map._collectResourceTiming&&(ne.collectResourceTiming=!0);const Se=this.sourceCaches[I]=new St(I,ne,this.dispatcher);Se.style=this,Se.setEventedParent(this,()=>({isSourceLoaded:Se.loaded(),source:Se.serialize(),sourceId:I})),Se.onAdd(this.map),this._changed=!0}removeSource(I){if(this._checkLoaded(),this.sourceCaches[I]===void 0)throw new Error("There is no source with this ID");for(const Te in this._layers)if(this._layers[Te].source===I)return this.fire(new t.j(new Error(`Source "${I}" cannot be removed while layer "${Te}" is using it.`)));const ne=this.sourceCaches[I];delete this.sourceCaches[I],delete this._updatedSources[I],ne.fire(new t.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:I})),ne.setEventedParent(null),ne.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(I,ne){if(this._checkLoaded(),this.sourceCaches[I]===void 0)throw new Error(`There is no source with this ID=${I}`);const Te=this.sourceCaches[I].getSource();if(Te.type!=="geojson")throw new Error(`geojsonSource.type is ${Te.type}, which is !== 'geojson`);Te.setData(ne),this._changed=!0}getSource(I){return this.sourceCaches[I]&&this.sourceCaches[I].getSource()}addLayer(I,ne,Te={}){this._checkLoaded();const Se=I.id;if(this.getLayer(Se))return void this.fire(new t.j(new Error(`Layer "${Se}" already exists on this map.`)));let Ie;if(I.type==="custom"){if(zr(this,t.aD(I)))return;Ie=t.aA(I)}else{if("source"in I&&typeof I.source=="object"&&(this.addSource(Se,I.source),I=t.aB(I),I=t.e(I,{source:Se})),this._validate(t.u.layer,`layers.${Se}`,I,{arrayIndex:-1},Te))return;Ie=t.aA(I),this._validateLayer(Ie),Ie.setEventedParent(this,{layer:{id:Se}})}const ot=ne?this._order.indexOf(ne):this._order.length;if(ne&&ot===-1)this.fire(new t.j(new Error(`Cannot add layer "${Se}" before non-existing layer "${ne}".`)));else{if(this._order.splice(ot,0,Se),this._layerOrderChanged=!0,this._layers[Se]=Ie,this._removedLayers[Se]&&Ie.source&&Ie.type!=="custom"){const yt=this._removedLayers[Se];delete this._removedLayers[Se],yt.type!==Ie.type?this._updatedSources[Ie.source]="clear":(this._updatedSources[Ie.source]="reload",this.sourceCaches[Ie.source].pause())}this._updateLayer(Ie),Ie.onAdd&&Ie.onAdd(this.map)}}moveLayer(I,ne){if(this._checkLoaded(),this._changed=!0,!this._layers[I])return void this.fire(new t.j(new Error(`The layer '${I}' does not exist in the map's style and cannot be moved.`)));if(I===ne)return;const Te=this._order.indexOf(I);this._order.splice(Te,1);const Se=ne?this._order.indexOf(ne):this._order.length;ne&&Se===-1?this.fire(new t.j(new Error(`Cannot move layer "${I}" before non-existing layer "${ne}".`))):(this._order.splice(Se,0,I),this._layerOrderChanged=!0)}removeLayer(I){this._checkLoaded();const ne=this._layers[I];if(!ne)return void this.fire(new t.j(new Error(`Cannot remove non-existing layer "${I}".`)));ne.setEventedParent(null);const Te=this._order.indexOf(I);this._order.splice(Te,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[I]=ne,delete this._layers[I],this._serializedLayers&&delete this._serializedLayers[I],delete this._updatedLayers[I],delete this._updatedPaintProps[I],ne.onRemove&&ne.onRemove(this.map)}getLayer(I){return this._layers[I]}getLayersOrder(){return[...this._order]}hasLayer(I){return I in this._layers}setLayerZoomRange(I,ne,Te){this._checkLoaded();const Se=this.getLayer(I);Se?Se.minzoom===ne&&Se.maxzoom===Te||(ne!=null&&(Se.minzoom=ne),Te!=null&&(Se.maxzoom=Te),this._updateLayer(Se)):this.fire(new t.j(new Error(`Cannot set the zoom range of non-existing layer "${I}".`)))}setFilter(I,ne,Te={}){this._checkLoaded();const Se=this.getLayer(I);if(Se){if(!t.aE(Se.filter,ne))return ne==null?(Se.filter=void 0,void this._updateLayer(Se)):void(this._validate(t.u.filter,`layers.${Se.id}.filter`,ne,null,Te)||(Se.filter=t.aB(ne),this._updateLayer(Se)))}else this.fire(new t.j(new Error(`Cannot filter non-existing layer "${I}".`)))}getFilter(I){return t.aB(this.getLayer(I).filter)}setLayoutProperty(I,ne,Te,Se={}){this._checkLoaded();const Ie=this.getLayer(I);Ie?t.aE(Ie.getLayoutProperty(ne),Te)||(Ie.setLayoutProperty(ne,Te,Se),this._updateLayer(Ie)):this.fire(new t.j(new Error(`Cannot style non-existing layer "${I}".`)))}getLayoutProperty(I,ne){const Te=this.getLayer(I);if(Te)return Te.getLayoutProperty(ne);this.fire(new t.j(new Error(`Cannot get style of non-existing layer "${I}".`)))}setPaintProperty(I,ne,Te,Se={}){this._checkLoaded();const Ie=this.getLayer(I);Ie?t.aE(Ie.getPaintProperty(ne),Te)||(Ie.setPaintProperty(ne,Te,Se)&&this._updateLayer(Ie),this._changed=!0,this._updatedPaintProps[I]=!0,this._serializedLayers=null):this.fire(new t.j(new Error(`Cannot style non-existing layer "${I}".`)))}getPaintProperty(I,ne){return this.getLayer(I).getPaintProperty(ne)}setFeatureState(I,ne){this._checkLoaded();const Te=I.source,Se=I.sourceLayer,Ie=this.sourceCaches[Te];if(Ie===void 0)return void this.fire(new t.j(new Error(`The source '${Te}' does not exist in the map's style.`)));const ot=Ie.getSource().type;ot==="geojson"&&Se?this.fire(new t.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):ot!=="vector"||Se?(I.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Ie.setFeatureState(Se,I.id,ne)):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(I,ne){this._checkLoaded();const Te=I.source,Se=this.sourceCaches[Te];if(Se===void 0)return void this.fire(new t.j(new Error(`The source '${Te}' does not exist in the map's style.`)));const Ie=Se.getSource().type,ot=Ie==="vector"?I.sourceLayer:void 0;Ie!=="vector"||ot?ne&&typeof I.id!="string"&&typeof I.id!="number"?this.fire(new t.j(new Error("A feature id is required to remove its specific state property."))):Se.removeFeatureState(ot,I.id,ne):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(I){this._checkLoaded();const ne=I.source,Te=I.sourceLayer,Se=this.sourceCaches[ne];if(Se!==void 0)return Se.getSource().type!=="vector"||Te?(I.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Se.getFeatureState(Te,I.id)):void this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new t.j(new Error(`The source '${ne}' does not exist in the map's style.`)))}getTransition(){return t.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const I=t.aF(this.sourceCaches,Ie=>Ie.serialize()),ne=this._serializeByIds(this._order,!0),Te=this.map.getTerrain()||void 0,Se=this.stylesheet;return t.aG({version:Se.version,name:Se.name,metadata:Se.metadata,light:Se.light,sky:Se.sky,center:Se.center,zoom:Se.zoom,bearing:Se.bearing,pitch:Se.pitch,sprite:Se.sprite,glyphs:Se.glyphs,transition:Se.transition,sources:I,layers:ne,terrain:Te},Ie=>Ie!==void 0)}_updateLayer(I){this._updatedLayers[I.id]=!0,I.source&&!this._updatedSources[I.source]&&this.sourceCaches[I.source].getSource().type!=="raster"&&(this._updatedSources[I.source]="reload",this.sourceCaches[I.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(I){const ne=ot=>this._layers[ot].type==="fill-extrusion",Te={},Se=[];for(let ot=this._order.length-1;ot>=0;ot--){const yt=this._order[ot];if(ne(yt)){Te[yt]=ot;for(const Ct of I){const Wt=Ct[yt];if(Wt)for(const nr of Wt)Se.push(nr)}}}Se.sort((ot,yt)=>yt.intersectionZ-ot.intersectionZ);const Ie=[];for(let ot=this._order.length-1;ot>=0;ot--){const yt=this._order[ot];if(ne(yt))for(let Ct=Se.length-1;Ct>=0;Ct--){const Wt=Se[Ct].feature;if(Te[Wt.layer.id]{const Sr=lt.featureSortOrder;if(Sr){const Nr=Sr.indexOf(rr.featureIndex);return Sr.indexOf(sr.featureIndex)-Nr}return sr.featureIndex-rr.featureIndex});for(const rr of Yt)Et.push(rr)}}for(const lt in je)je[lt].forEach(Tt=>{const gt=Tt.feature,Et=Wt[yt[lt].source].getFeatureState(gt.layer["source-layer"],gt.id);gt.source=gt.layer.source,gt.layer["source-layer"]&&(gt.sourceLayer=gt.layer["source-layer"]),gt.state=Et});return je}(this._layers,ot,this.sourceCaches,I,ne,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Ie)}querySourceFeatures(I,ne){ne&&ne.filter&&this._validate(t.u.filter,"querySourceFeatures.filter",ne.filter,null,ne);const Te=this.sourceCaches[I];return Te?function(Se,Ie){const ot=Se.getRenderableIds().map(Wt=>Se.getTileByID(Wt)),yt=[],Ct={};for(let Wt=0;WtFr.getTileByID(Wr)).sort((Wr,je)=>je.tileID.overscaledZ-Wr.tileID.overscaledZ||(Wr.tileID.isLessThan(je.tileID)?-1:1))}const or=this.crossTileSymbolIndex.addLayer(nr,Ct[nr.source],I.center.lng);ot=ot||or}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((Ie=Ie||this._layerOrderChanged||Te===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(i.now(),I.zoom))&&(this.pauseablePlacement=new vt(I,this.map.terrain,this._order,Ie,ne,Te,Se,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Ct),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.now()),yt=!0),ot&&this.pauseablePlacement.placement.setStale()),yt||ot)for(const Wt of this._order){const nr=this._layers[Wt];nr.type==="symbol"&&this.placement.updateLayerOpacities(nr,Ct[nr.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(i.now())}_releaseSymbolFadeTiles(){for(const I in this.sourceCaches)this.sourceCaches[I].releaseSymbolFadeTiles()}getImages(I,ne){return t._(this,void 0,void 0,function*(){const Te=yield this.imageManager.getImages(ne.icons);this._updateTilesForChangedImages();const Se=this.sourceCaches[ne.source];return Se&&Se.setDependencies(ne.tileID.key,ne.type,ne.icons),Te})}getGlyphs(I,ne){return t._(this,void 0,void 0,function*(){const Te=yield this.glyphManager.getGlyphs(ne.stacks),Se=this.sourceCaches[ne.source];return Se&&Se.setDependencies(ne.tileID.key,ne.type,[""]),Te})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(I,ne={}){this._checkLoaded(),I&&this._validate(t.u.glyphs,"glyphs",I,null,ne)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=I,this.glyphManager.entries={},this.glyphManager.setURL(I))}addSprite(I,ne,Te={},Se){this._checkLoaded();const Ie=[{id:I,url:ne}],ot=[...w(this.stylesheet.sprite),...Ie];this._validate(t.u.sprite,"sprite",ot,null,Te)||(this.stylesheet.sprite=ot,this._loadSprite(Ie,!0,Se))}removeSprite(I){this._checkLoaded();const ne=w(this.stylesheet.sprite);if(ne.find(Te=>Te.id===I)){if(this._spritesImagesIds[I])for(const Te of this._spritesImagesIds[I])this.imageManager.removeImage(Te),this._changedImages[Te]=!0;ne.splice(ne.findIndex(Te=>Te.id===I),1),this.stylesheet.sprite=ne.length>0?ne:void 0,delete this._spritesImagesIds[I],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}else this.fire(new t.j(new Error(`Sprite "${I}" doesn't exists on this map.`)))}getSprite(){return w(this.stylesheet.sprite)}setSprite(I,ne={},Te){this._checkLoaded(),I&&this._validate(t.u.sprite,"sprite",I,null,ne)||(this.stylesheet.sprite=I,I?this._loadSprite(I,!0,Te):(this._unloadSprite(),Te&&Te(null)))}}var Zr=t.Y([{name:"a_pos",type:"Int16",components:2}]);const Jr={prelude:wt(`#ifdef GL_ES +precision mediump float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +`,`#ifdef GL_ES +precision highp float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 +);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} +#ifdef TERRAIN3D +uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; +#endif +const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { +#ifdef TERRAIN3D +highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); +#else +return 1.0; +#endif +}float calculate_visibility(vec4 pos) { +#ifdef TERRAIN3D +vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; +#else +return 1.0; +#endif +}float ele(vec2 pos) { +#ifdef TERRAIN3D +vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; +#else +return 0.0; +#endif +}float get_elevation(vec2 pos) { +#ifdef TERRAIN3D +vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; +#else +return 0.0; +#endif +}`),background:wt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:wt(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:wt(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:wt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:wt(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:wt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:wt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 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_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:wt("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);}"),debug:wt("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,get_elevation(a_pos),1);}"),fill:wt(`#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);}`),fillOutline:wt(`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;}`),fillOutlinePattern:wt(`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;}`),fillPattern:wt(`#ifdef GL_ES +precision highp float; +#endif +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);}`),fillExtrusion:wt(`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; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +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; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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;}`),fillExtrusionPattern:wt(`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; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +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; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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;}`),hillshadePrepare:wt(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); +#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;}"),hillshade:wt(`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;}"),line:wt(`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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_width2=vec2(outset,inset);}`),lineGradient:wt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +#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,v_uv);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;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_width2=vec2(outset,inset);}`),linePattern:wt(`#ifdef GL_ES +precision highp float; +#endif +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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:wt(`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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +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);}`),raster:wt(`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;}"),symbolIcon:wt(`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 +}`,`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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;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;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:wt(`#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 inner_edge=(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);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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 bool u_is_along_line;uniform bool u_is_variable_anchor;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_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:wt(`#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 +}`,`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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,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);}`),terrain:wt("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:wt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:wt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:wt("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function wt(De,I){const ne=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,Te=I.match(/attribute ([\w]+) ([\w]+)/g),Se=De.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Ie=I.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),ot=Ie?Ie.concat(Se):Se,yt={};return{fragmentSource:De=De.replace(ne,(Ct,Wt,nr,or,Fr)=>(yt[Fr]=!0,Wt==="define"?` +#ifndef HAS_UNIFORM_u_${Fr} +varying ${nr} ${or} ${Fr}; +#else +uniform ${nr} ${or} u_${Fr}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${Fr} + ${nr} ${or} ${Fr} = u_${Fr}; +#endif +`)),vertexSource:I=I.replace(ne,(Ct,Wt,nr,or,Fr)=>{const Wr=or==="float"?"vec2":"vec4",je=Fr.match(/color/)?"color":Wr;return yt[Fr]?Wt==="define"?` +#ifndef HAS_UNIFORM_u_${Fr} +uniform lowp float u_${Fr}_t; +attribute ${nr} ${Wr} a_${Fr}; +varying ${nr} ${or} ${Fr}; +#else +uniform ${nr} ${or} u_${Fr}; +#endif +`:je==="vec4"?` +#ifndef HAS_UNIFORM_u_${Fr} + ${Fr} = a_${Fr}; +#else + ${nr} ${or} ${Fr} = u_${Fr}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${Fr} + ${Fr} = unpack_mix_${je}(a_${Fr}, u_${Fr}_t); +#else + ${nr} ${or} ${Fr} = u_${Fr}; +#endif +`:Wt==="define"?` +#ifndef HAS_UNIFORM_u_${Fr} +uniform lowp float u_${Fr}_t; +attribute ${nr} ${Wr} a_${Fr}; +#else +uniform ${nr} ${or} u_${Fr}; +#endif +`:je==="vec4"?` +#ifndef HAS_UNIFORM_u_${Fr} + ${nr} ${or} ${Fr} = a_${Fr}; +#else + ${nr} ${or} ${Fr} = u_${Fr}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${Fr} + ${nr} ${or} ${Fr} = unpack_mix_${je}(a_${Fr}, u_${Fr}_t); +#else + ${nr} ${or} ${Fr} = u_${Fr}; +#endif +`}),staticAttributes:Te,staticUniforms:ot}}class Qt{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(I,ne,Te,Se,Ie,ot,yt,Ct,Wt){this.context=I;let nr=this.boundPaintVertexBuffers.length!==Se.length;for(let or=0;!nr&&or({u_matrix:De,u_texture:0,u_ele_delta:I,u_fog_matrix:ne,u_fog_color:Te?Te.properties.get("fog-color"):t.aM.white,u_fog_ground_blend:Te?Te.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:Te?Te.calculateFogBlendOpacity(Se):0,u_horizon_color:Te?Te.properties.get("horizon-color"):t.aM.white,u_horizon_fog_blend:Te?Te.properties.get("horizon-fog-blend"):1});function $r(De){const I=[];for(let ne=0;ne({u_depth:new t.aH(rr,sr.u_depth),u_terrain:new t.aH(rr,sr.u_terrain),u_terrain_dim:new t.aI(rr,sr.u_terrain_dim),u_terrain_matrix:new t.aJ(rr,sr.u_terrain_matrix),u_terrain_unpack:new t.aK(rr,sr.u_terrain_unpack),u_terrain_exaggeration:new t.aI(rr,sr.u_terrain_exaggeration)}))(I,Yt),this.binderUniforms=Te?Te.getUniforms(I,Yt):[]}draw(I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr,je,Ze,at,lt,Tt){const gt=I.gl;if(this.failedToCreate)return;if(I.program.set(this.program),I.setDepthMode(Te),I.setStencilMode(Se),I.setColorMode(Ie),I.setCullFace(ot),Ct){I.activeTexture.set(gt.TEXTURE2),gt.bindTexture(gt.TEXTURE_2D,Ct.depthTexture),I.activeTexture.set(gt.TEXTURE3),gt.bindTexture(gt.TEXTURE_2D,Ct.texture);for(const Yt in this.terrainUniforms)this.terrainUniforms[Yt].set(Ct[Yt])}for(const Yt in this.fixedUniforms)this.fixedUniforms[Yt].set(yt[Yt]);Ze&&Ze.setUniforms(I,this.binderUniforms,Wr,{zoom:je});let Et=0;switch(ne){case gt.LINES:Et=2;break;case gt.TRIANGLES:Et=3;break;case gt.LINE_STRIP:Et=1}for(const Yt of Fr.get()){const rr=Yt.vaos||(Yt.vaos={});(rr[Wt]||(rr[Wt]=new Qt)).bind(I,this,nr,Ze?Ze.getPaintVertexBuffers():[],or,Yt.vertexOffset,at,lt,Tt),gt.drawElements(ne,Yt.primitiveLength*Et,gt.UNSIGNED_SHORT,Yt.primitiveOffset*Et*2)}}}function Sa(De,I,ne){const Te=1/da(ne,1,I.transform.tileZoom),Se=Math.pow(2,ne.tileID.overscaledZ),Ie=ne.tileSize*Math.pow(2,I.transform.tileZoom)/Se,ot=Ie*(ne.tileID.canonical.x+ne.tileID.wrap*Se),yt=Ie*ne.tileID.canonical.y;return{u_image:0,u_texsize:ne.imageAtlasTexture.size,u_scale:[Te,De.fromScale,De.toScale],u_fade:De.t,u_pixel_coord_upper:[ot>>16,yt>>16],u_pixel_coord_lower:[65535&ot,65535&yt]}}const ya=(De,I,ne,Te)=>{const Se=I.style.light,Ie=Se.properties.get("position"),ot=[Ie.x,Ie.y,Ie.z],yt=function(){var Wt=new t.A(9);return t.A!=Float32Array&&(Wt[1]=0,Wt[2]=0,Wt[3]=0,Wt[5]=0,Wt[6]=0,Wt[7]=0),Wt[0]=1,Wt[4]=1,Wt[8]=1,Wt}();Se.properties.get("anchor")==="viewport"&&function(Wt,nr){var or=Math.sin(nr),Fr=Math.cos(nr);Wt[0]=Fr,Wt[1]=or,Wt[2]=0,Wt[3]=-or,Wt[4]=Fr,Wt[5]=0,Wt[6]=0,Wt[7]=0,Wt[8]=1}(yt,-I.transform.angle),function(Wt,nr,or){var Fr=nr[0],Wr=nr[1],je=nr[2];Wt[0]=Fr*or[0]+Wr*or[3]+je*or[6],Wt[1]=Fr*or[1]+Wr*or[4]+je*or[7],Wt[2]=Fr*or[2]+Wr*or[5]+je*or[8]}(ot,ot,yt);const Ct=Se.properties.get("color");return{u_matrix:De,u_lightpos:ot,u_lightintensity:Se.properties.get("intensity"),u_lightcolor:[Ct.r,Ct.g,Ct.b],u_vertical_gradient:+ne,u_opacity:Te}},ra=(De,I,ne,Te,Se,Ie,ot)=>t.e(ya(De,I,ne,Te),Sa(Ie,I,ot),{u_height_factor:-Math.pow(2,Se.overscaledZ)/ot.tileSize/8}),pa=De=>({u_matrix:De}),pn=(De,I,ne,Te)=>t.e(pa(De),Sa(ne,I,Te)),Ga=(De,I)=>({u_matrix:De,u_world:I}),qn=(De,I,ne,Te,Se)=>t.e(pn(De,I,ne,Te),{u_world:Se}),Vn=(De,I,ne,Te)=>{const Se=De.transform;let Ie,ot;if(Te.paint.get("circle-pitch-alignment")==="map"){const yt=da(ne,1,Se.zoom);Ie=!0,ot=[yt,yt]}else Ie=!1,ot=Se.pixelsToGLUnits;return{u_camera_to_center_distance:Se.cameraToCenterDistance,u_scale_with_map:+(Te.paint.get("circle-pitch-scale")==="map"),u_matrix:De.translatePosMatrix(I.posMatrix,ne,Te.paint.get("circle-translate"),Te.paint.get("circle-translate-anchor")),u_pitch_with_map:+Ie,u_device_pixel_ratio:De.pixelRatio,u_extrude_scale:ot}},di=(De,I,ne)=>({u_matrix:De,u_inv_matrix:I,u_camera_to_center_distance:ne.cameraToCenterDistance,u_viewport_size:[ne.width,ne.height]}),yi=(De,I,ne=1)=>({u_matrix:De,u_color:I,u_overlay:0,u_overlay_scale:ne}),Ci=De=>({u_matrix:De}),ci=(De,I,ne,Te)=>({u_matrix:De,u_extrude_scale:da(I,1,ne),u_intensity:Te}),ei=(De,I,ne,Te)=>{const Se=t.H();t.aP(Se,0,De.width,De.height,0,0,1);const Ie=De.context.gl;return{u_matrix:Se,u_world:[Ie.drawingBufferWidth,Ie.drawingBufferHeight],u_image:ne,u_color_ramp:Te,u_opacity:I.paint.get("heatmap-opacity")}};function mi(De,I){const ne=Math.pow(2,I.canonical.z),Te=I.canonical.y;return[new t.Z(0,Te/ne).toLngLat().lat,new t.Z(0,(Te+1)/ne).toLngLat().lat]}const uo=(De,I,ne,Te)=>{const Se=De.transform;return{u_matrix:xi(De,I,ne,Te),u_ratio:1/da(I,1,Se.zoom),u_device_pixel_ratio:De.pixelRatio,u_units_to_pixels:[1/Se.pixelsToGLUnits[0],1/Se.pixelsToGLUnits[1]]}},Lo=(De,I,ne,Te,Se)=>t.e(uo(De,I,ne,Se),{u_image:0,u_image_height:Te}),Wo=(De,I,ne,Te,Se)=>{const Ie=De.transform,ot=Ii(I,Ie);return{u_matrix:xi(De,I,ne,Se),u_texsize:I.imageAtlasTexture.size,u_ratio:1/da(I,1,Ie.zoom),u_device_pixel_ratio:De.pixelRatio,u_image:0,u_scale:[ot,Te.fromScale,Te.toScale],u_fade:Te.t,u_units_to_pixels:[1/Ie.pixelsToGLUnits[0],1/Ie.pixelsToGLUnits[1]]}},li=(De,I,ne,Te,Se,Ie)=>{const ot=De.lineAtlas,yt=Ii(I,De.transform),Ct=ne.layout.get("line-cap")==="round",Wt=ot.getDash(Te.from,Ct),nr=ot.getDash(Te.to,Ct),or=Wt.width*Se.fromScale,Fr=nr.width*Se.toScale;return t.e(uo(De,I,ne,Ie),{u_patternscale_a:[yt/or,-Wt.height/2],u_patternscale_b:[yt/Fr,-nr.height/2],u_sdfgamma:ot.width/(256*Math.min(or,Fr)*De.pixelRatio)/2,u_image:0,u_tex_y_a:Wt.y,u_tex_y_b:nr.y,u_mix:Se.t})};function Ii(De,I){return 1/da(De,1,I.tileZoom)}function xi(De,I,ne,Te){return De.translatePosMatrix(Te?Te.posMatrix:I.tileID.posMatrix,I,ne.paint.get("line-translate"),ne.paint.get("line-translate-anchor"))}const Ao=(De,I,ne,Te,Se)=>{return{u_matrix:De,u_tl_parent:I,u_scale_parent:ne,u_buffer_scale:1,u_fade_t:Te.mix,u_opacity:Te.opacity*Se.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Se.paint.get("raster-brightness-min"),u_brightness_high:Se.paint.get("raster-brightness-max"),u_saturation_factor:(ot=Se.paint.get("raster-saturation"),ot>0?1-1/(1.001-ot):-ot),u_contrast_factor:(Ie=Se.paint.get("raster-contrast"),Ie>0?1/(1-Ie):1+Ie),u_spin_weights:So(Se.paint.get("raster-hue-rotate"))};var Ie,ot};function So(De){De*=Math.PI/180;const I=Math.sin(De),ne=Math.cos(De);return[(2*ne+1)/3,(-Math.sqrt(3)*I-ne+1)/3,(Math.sqrt(3)*I-ne+1)/3]}const Ro=(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr)=>{const je=ot.transform;return{u_is_size_zoom_constant:+(De==="constant"||De==="source"),u_is_size_feature_constant:+(De==="constant"||De==="camera"),u_size_t:I?I.uSizeT:0,u_size:I?I.uSize:0,u_camera_to_center_distance:je.cameraToCenterDistance,u_pitch:je.pitch/360*2*Math.PI,u_rotate_symbol:+ne,u_aspect_ratio:je.width/je.height,u_fade_change:ot.options.fadeDuration?ot.symbolFadeChange:1,u_matrix:yt,u_label_plane_matrix:Ct,u_coord_matrix:Wt,u_is_text:+or,u_pitch_with_map:+Te,u_is_along_line:Se,u_is_variable_anchor:Ie,u_texsize:Fr,u_texture:0,u_translation:nr,u_pitched_scale:Wr}},Li=(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr,je)=>{const Ze=ot.transform;return t.e(Ro(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,je),{u_gamma_scale:Te?Math.cos(Ze._pitch)*Ze.cameraToCenterDistance:1,u_device_pixel_ratio:ot.pixelRatio,u_is_halo:+Wr})},Yi=(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr)=>t.e(Li(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,!0,or,!0,Wr),{u_texsize_icon:Fr,u_texture_icon:1}),bs=(De,I,ne)=>({u_matrix:De,u_opacity:I,u_color:ne}),as=(De,I,ne,Te,Se,Ie)=>t.e(function(ot,yt,Ct,Wt){const nr=Ct.imageManager.getPattern(ot.from.toString()),or=Ct.imageManager.getPattern(ot.to.toString()),{width:Fr,height:Wr}=Ct.imageManager.getPixelSize(),je=Math.pow(2,Wt.tileID.overscaledZ),Ze=Wt.tileSize*Math.pow(2,Ct.transform.tileZoom)/je,at=Ze*(Wt.tileID.canonical.x+Wt.tileID.wrap*je),lt=Ze*Wt.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:nr.tl,u_pattern_br_a:nr.br,u_pattern_tl_b:or.tl,u_pattern_br_b:or.br,u_texsize:[Fr,Wr],u_mix:yt.t,u_pattern_size_a:nr.displaySize,u_pattern_size_b:or.displaySize,u_scale_a:yt.fromScale,u_scale_b:yt.toScale,u_tile_units_to_pixels:1/da(Wt,1,Ct.transform.tileZoom),u_pixel_coord_upper:[at>>16,lt>>16],u_pixel_coord_lower:[65535&at,65535<]}}(Te,Ie,ne,Se),{u_matrix:De,u_opacity:I}),fs={fillExtrusion:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_lightpos:new t.aN(De,I.u_lightpos),u_lightintensity:new t.aI(De,I.u_lightintensity),u_lightcolor:new t.aN(De,I.u_lightcolor),u_vertical_gradient:new t.aI(De,I.u_vertical_gradient),u_opacity:new t.aI(De,I.u_opacity)}),fillExtrusionPattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_lightpos:new t.aN(De,I.u_lightpos),u_lightintensity:new t.aI(De,I.u_lightintensity),u_lightcolor:new t.aN(De,I.u_lightcolor),u_vertical_gradient:new t.aI(De,I.u_vertical_gradient),u_height_factor:new t.aI(De,I.u_height_factor),u_image:new t.aH(De,I.u_image),u_texsize:new t.aO(De,I.u_texsize),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade),u_opacity:new t.aI(De,I.u_opacity)}),fill:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix)}),fillPattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_image:new t.aH(De,I.u_image),u_texsize:new t.aO(De,I.u_texsize),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade)}),fillOutline:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_world:new t.aO(De,I.u_world)}),fillOutlinePattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_world:new t.aO(De,I.u_world),u_image:new t.aH(De,I.u_image),u_texsize:new t.aO(De,I.u_texsize),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade)}),circle:(De,I)=>({u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_scale_with_map:new t.aH(De,I.u_scale_with_map),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_extrude_scale:new t.aO(De,I.u_extrude_scale),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_matrix:new t.aJ(De,I.u_matrix)}),collisionBox:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_pixel_extrude_scale:new t.aO(De,I.u_pixel_extrude_scale)}),collisionCircle:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_inv_matrix:new t.aJ(De,I.u_inv_matrix),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_viewport_size:new t.aO(De,I.u_viewport_size)}),debug:(De,I)=>({u_color:new t.aL(De,I.u_color),u_matrix:new t.aJ(De,I.u_matrix),u_overlay:new t.aH(De,I.u_overlay),u_overlay_scale:new t.aI(De,I.u_overlay_scale)}),clippingMask:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix)}),heatmap:(De,I)=>({u_extrude_scale:new t.aI(De,I.u_extrude_scale),u_intensity:new t.aI(De,I.u_intensity),u_matrix:new t.aJ(De,I.u_matrix)}),heatmapTexture:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_world:new t.aO(De,I.u_world),u_image:new t.aH(De,I.u_image),u_color_ramp:new t.aH(De,I.u_color_ramp),u_opacity:new t.aI(De,I.u_opacity)}),hillshade:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_image:new t.aH(De,I.u_image),u_latrange:new t.aO(De,I.u_latrange),u_light:new t.aO(De,I.u_light),u_shadow:new t.aL(De,I.u_shadow),u_highlight:new t.aL(De,I.u_highlight),u_accent:new t.aL(De,I.u_accent)}),hillshadePrepare:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_image:new t.aH(De,I.u_image),u_dimension:new t.aO(De,I.u_dimension),u_zoom:new t.aI(De,I.u_zoom),u_unpack:new t.aK(De,I.u_unpack)}),line:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels)}),lineGradient:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels),u_image:new t.aH(De,I.u_image),u_image_height:new t.aI(De,I.u_image_height)}),linePattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_texsize:new t.aO(De,I.u_texsize),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_image:new t.aH(De,I.u_image),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade)}),lineSDF:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels),u_patternscale_a:new t.aO(De,I.u_patternscale_a),u_patternscale_b:new t.aO(De,I.u_patternscale_b),u_sdfgamma:new t.aI(De,I.u_sdfgamma),u_image:new t.aH(De,I.u_image),u_tex_y_a:new t.aI(De,I.u_tex_y_a),u_tex_y_b:new t.aI(De,I.u_tex_y_b),u_mix:new t.aI(De,I.u_mix)}),raster:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_tl_parent:new t.aO(De,I.u_tl_parent),u_scale_parent:new t.aI(De,I.u_scale_parent),u_buffer_scale:new t.aI(De,I.u_buffer_scale),u_fade_t:new t.aI(De,I.u_fade_t),u_opacity:new t.aI(De,I.u_opacity),u_image0:new t.aH(De,I.u_image0),u_image1:new t.aH(De,I.u_image1),u_brightness_low:new t.aI(De,I.u_brightness_low),u_brightness_high:new t.aI(De,I.u_brightness_high),u_saturation_factor:new t.aI(De,I.u_saturation_factor),u_contrast_factor:new t.aI(De,I.u_contrast_factor),u_spin_weights:new t.aN(De,I.u_spin_weights)}),symbolIcon:(De,I)=>({u_is_size_zoom_constant:new t.aH(De,I.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(De,I.u_is_size_feature_constant),u_size_t:new t.aI(De,I.u_size_t),u_size:new t.aI(De,I.u_size),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_pitch:new t.aI(De,I.u_pitch),u_rotate_symbol:new t.aH(De,I.u_rotate_symbol),u_aspect_ratio:new t.aI(De,I.u_aspect_ratio),u_fade_change:new t.aI(De,I.u_fade_change),u_matrix:new t.aJ(De,I.u_matrix),u_label_plane_matrix:new t.aJ(De,I.u_label_plane_matrix),u_coord_matrix:new t.aJ(De,I.u_coord_matrix),u_is_text:new t.aH(De,I.u_is_text),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_is_along_line:new t.aH(De,I.u_is_along_line),u_is_variable_anchor:new t.aH(De,I.u_is_variable_anchor),u_texsize:new t.aO(De,I.u_texsize),u_texture:new t.aH(De,I.u_texture),u_translation:new t.aO(De,I.u_translation),u_pitched_scale:new t.aI(De,I.u_pitched_scale)}),symbolSDF:(De,I)=>({u_is_size_zoom_constant:new t.aH(De,I.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(De,I.u_is_size_feature_constant),u_size_t:new t.aI(De,I.u_size_t),u_size:new t.aI(De,I.u_size),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_pitch:new t.aI(De,I.u_pitch),u_rotate_symbol:new t.aH(De,I.u_rotate_symbol),u_aspect_ratio:new t.aI(De,I.u_aspect_ratio),u_fade_change:new t.aI(De,I.u_fade_change),u_matrix:new t.aJ(De,I.u_matrix),u_label_plane_matrix:new t.aJ(De,I.u_label_plane_matrix),u_coord_matrix:new t.aJ(De,I.u_coord_matrix),u_is_text:new t.aH(De,I.u_is_text),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_is_along_line:new t.aH(De,I.u_is_along_line),u_is_variable_anchor:new t.aH(De,I.u_is_variable_anchor),u_texsize:new t.aO(De,I.u_texsize),u_texture:new t.aH(De,I.u_texture),u_gamma_scale:new t.aI(De,I.u_gamma_scale),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_is_halo:new t.aH(De,I.u_is_halo),u_translation:new t.aO(De,I.u_translation),u_pitched_scale:new t.aI(De,I.u_pitched_scale)}),symbolTextAndIcon:(De,I)=>({u_is_size_zoom_constant:new t.aH(De,I.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(De,I.u_is_size_feature_constant),u_size_t:new t.aI(De,I.u_size_t),u_size:new t.aI(De,I.u_size),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_pitch:new t.aI(De,I.u_pitch),u_rotate_symbol:new t.aH(De,I.u_rotate_symbol),u_aspect_ratio:new t.aI(De,I.u_aspect_ratio),u_fade_change:new t.aI(De,I.u_fade_change),u_matrix:new t.aJ(De,I.u_matrix),u_label_plane_matrix:new t.aJ(De,I.u_label_plane_matrix),u_coord_matrix:new t.aJ(De,I.u_coord_matrix),u_is_text:new t.aH(De,I.u_is_text),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_is_along_line:new t.aH(De,I.u_is_along_line),u_is_variable_anchor:new t.aH(De,I.u_is_variable_anchor),u_texsize:new t.aO(De,I.u_texsize),u_texsize_icon:new t.aO(De,I.u_texsize_icon),u_texture:new t.aH(De,I.u_texture),u_texture_icon:new t.aH(De,I.u_texture_icon),u_gamma_scale:new t.aI(De,I.u_gamma_scale),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_is_halo:new t.aH(De,I.u_is_halo),u_translation:new t.aO(De,I.u_translation),u_pitched_scale:new t.aI(De,I.u_pitched_scale)}),background:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_opacity:new t.aI(De,I.u_opacity),u_color:new t.aL(De,I.u_color)}),backgroundPattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_opacity:new t.aI(De,I.u_opacity),u_image:new t.aH(De,I.u_image),u_pattern_tl_a:new t.aO(De,I.u_pattern_tl_a),u_pattern_br_a:new t.aO(De,I.u_pattern_br_a),u_pattern_tl_b:new t.aO(De,I.u_pattern_tl_b),u_pattern_br_b:new t.aO(De,I.u_pattern_br_b),u_texsize:new t.aO(De,I.u_texsize),u_mix:new t.aI(De,I.u_mix),u_pattern_size_a:new t.aO(De,I.u_pattern_size_a),u_pattern_size_b:new t.aO(De,I.u_pattern_size_b),u_scale_a:new t.aI(De,I.u_scale_a),u_scale_b:new t.aI(De,I.u_scale_b),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(De,I.u_tile_units_to_pixels)}),terrain:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_texture:new t.aH(De,I.u_texture),u_ele_delta:new t.aI(De,I.u_ele_delta),u_fog_matrix:new t.aJ(De,I.u_fog_matrix),u_fog_color:new t.aL(De,I.u_fog_color),u_fog_ground_blend:new t.aI(De,I.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(De,I.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(De,I.u_horizon_color),u_horizon_fog_blend:new t.aI(De,I.u_horizon_fog_blend)}),terrainDepth:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ele_delta:new t.aI(De,I.u_ele_delta)}),terrainCoords:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_texture:new t.aH(De,I.u_texture),u_terrain_coords_id:new t.aI(De,I.u_terrain_coords_id),u_ele_delta:new t.aI(De,I.u_ele_delta)}),sky:(De,I)=>({u_sky_color:new t.aL(De,I.u_sky_color),u_horizon_color:new t.aL(De,I.u_horizon_color),u_horizon:new t.aI(De,I.u_horizon),u_sky_horizon_blend:new t.aI(De,I.u_sky_horizon_blend)})};class Co{constructor(I,ne,Te){this.context=I;const Se=I.gl;this.buffer=Se.createBuffer(),this.dynamicDraw=!!Te,this.context.unbindVAO(),I.bindElementBuffer.set(this.buffer),Se.bufferData(Se.ELEMENT_ARRAY_BUFFER,ne.arrayBuffer,this.dynamicDraw?Se.DYNAMIC_DRAW:Se.STATIC_DRAW),this.dynamicDraw||delete ne.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(I){const ne=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),ne.bufferSubData(ne.ELEMENT_ARRAY_BUFFER,0,I.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Qa={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Jn{constructor(I,ne,Te,Se){this.length=ne.length,this.attributes=Te,this.itemSize=ne.bytesPerElement,this.dynamicDraw=Se,this.context=I;const Ie=I.gl;this.buffer=Ie.createBuffer(),I.bindVertexBuffer.set(this.buffer),Ie.bufferData(Ie.ARRAY_BUFFER,ne.arrayBuffer,this.dynamicDraw?Ie.DYNAMIC_DRAW:Ie.STATIC_DRAW),this.dynamicDraw||delete ne.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(I){if(I.length!==this.length)throw new Error(`Length of new data is ${I.length}, which doesn't match current length of ${this.length}`);const ne=this.context.gl;this.bind(),ne.bufferSubData(ne.ARRAY_BUFFER,0,I.arrayBuffer)}enableAttributes(I,ne){for(let Te=0;Te0){const rr=t.H();t.aQ(rr,gt.placementInvProjMatrix,De.transform.glCoordMatrix),t.aQ(rr,rr,gt.placementViewportMatrix),Ct.push({circleArray:Yt,circleOffset:nr,transform:Tt.posMatrix,invTransform:rr,coord:Tt}),Wt+=Yt.length/4,nr=Wt}Et&&yt.draw(Ie,ot.LINES,Eo.disabled,is.disabled,De.colorModeForRenderPass(),oo.disabled,{u_matrix:Tt.posMatrix,u_pixel_extrude_scale:[1/(or=De.transform).width,1/or.height]},De.style.map.terrain&&De.style.map.terrain.getTerrainData(Tt),ne.id,Et.layoutVertexBuffer,Et.indexBuffer,Et.segments,null,De.transform.zoom,null,null,Et.collisionVertexBuffer)}var or;if(!Se||!Ct.length)return;const Fr=De.useProgram("collisionCircle"),Wr=new t.aR;Wr.resize(4*Wt),Wr._trim();let je=0;for(const lt of Ct)for(let Tt=0;Tt=0&&(lt[gt.associatedIconIndex]={shiftedAnchor:Nn,angle:pi})}else qt(gt.numGlyphs,Ze)}if(Wt){at.clear();const Tt=De.icon.placedSymbolArray;for(let gt=0;gtDe.style.map.terrain.getElevation(ia,aa,Ua):null,Kr=ne.layout.get("text-rotation-alignment")==="map";Oe(za,ia.posMatrix,De,Se,Al,pe,lt,Wt,Kr,Ze,ia.toUnwrapped(),je.width,je.height,Le,Vr)}const ht=ia.posMatrix,xt=Se&&Sr||ut,zt=Tt||xt?zl:Al,Dt=pu,$t=ln&&ne.paint.get(Se?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Cr;Cr=ln?za.iconsInText?Yi(Nn.kind,Gi,gt,lt,Tt,xt,De,ht,zt,Dt,Le,No,zs,Qr):Li(Nn.kind,Gi,gt,lt,Tt,xt,De,ht,zt,Dt,Le,Se,No,!0,Qr):Ro(Nn.kind,Gi,gt,lt,Tt,xt,De,ht,zt,Dt,Le,Se,No,Qr);const Ar={program:ii,buffers:nn,uniformValues:Cr,atlasTexture:po,atlasTextureIcon:xo,atlasInterpolation:Zo,atlasInterpolationIcon:Hs,isSDF:ln,hasHalo:$t};if(Yt&&za.canOverlap){rr=!0;const Vr=nn.segments.get();for(const Kr of Vr)Nr.push({segments:new t.a0([Kr]),sortKey:Kr.sortKey,state:Ar,terrainData:Bo})}else Nr.push({segments:nn.segments,sortKey:0,state:Ar,terrainData:Bo})}rr&&Nr.sort((ia,_a)=>ia.sortKey-_a.sortKey);for(const ia of Nr){const _a=ia.state;if(Fr.activeTexture.set(Wr.TEXTURE0),_a.atlasTexture.bind(_a.atlasInterpolation,Wr.CLAMP_TO_EDGE),_a.atlasTextureIcon&&(Fr.activeTexture.set(Wr.TEXTURE1),_a.atlasTextureIcon&&_a.atlasTextureIcon.bind(_a.atlasInterpolationIcon,Wr.CLAMP_TO_EDGE)),_a.isSDF){const za=_a.uniformValues;_a.hasHalo&&(za.u_is_halo=1,Jc(_a.buffers,ia.segments,ne,De,_a.program,sr,nr,or,za,ia.terrainData)),za.u_is_halo=0}Jc(_a.buffers,ia.segments,ne,De,_a.program,sr,nr,or,_a.uniformValues,ia.terrainData)}}function Jc(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt){const nr=Te.context;Se.draw(nr,nr.gl.TRIANGLES,Ie,ot,yt,oo.disabled,Ct,Wt,ne.id,De.layoutVertexBuffer,De.indexBuffer,I,ne.paint,Te.transform.zoom,De.programConfigurations.get(ne.id),De.dynamicLayoutVertexBuffer,De.opacityVertexBuffer)}function Uc(De,I,ne,Te){const Se=De.context,Ie=Se.gl,ot=is.disabled,yt=new Bs([Ie.ONE,Ie.ONE],t.aM.transparent,[!0,!0,!0,!0]),Ct=I.getBucket(ne);if(!Ct)return;const Wt=Te.key;let nr=ne.heatmapFbos.get(Wt);nr||(nr=jc(Se,I.tileSize,I.tileSize),ne.heatmapFbos.set(Wt,nr)),Se.bindFramebuffer.set(nr.framebuffer),Se.viewport.set([0,0,I.tileSize,I.tileSize]),Se.clear({color:t.aM.transparent});const or=Ct.programConfigurations.get(ne.id),Fr=De.useProgram("heatmap",or),Wr=De.style.map.terrain.getTerrainData(Te);Fr.draw(Se,Ie.TRIANGLES,Eo.disabled,ot,yt,oo.disabled,ci(Te.posMatrix,I,De.transform.zoom,ne.paint.get("heatmap-intensity")),Wr,ne.id,Ct.layoutVertexBuffer,Ct.indexBuffer,Ct.segments,ne.paint,De.transform.zoom,or)}function $u(De,I,ne){const Te=De.context,Se=Te.gl;Te.setColorMode(De.colorModeForRenderPass());const Ie=$c(Te,I),ot=ne.key,yt=I.heatmapFbos.get(ot);yt&&(Te.activeTexture.set(Se.TEXTURE0),Se.bindTexture(Se.TEXTURE_2D,yt.colorAttachment.get()),Te.activeTexture.set(Se.TEXTURE1),Ie.bind(Se.LINEAR,Se.CLAMP_TO_EDGE),De.useProgram("heatmapTexture").draw(Te,Se.TRIANGLES,Eo.disabled,is.disabled,De.colorModeForRenderPass(),oo.disabled,ei(De,I,0,1),null,I.id,De.rasterBoundsBuffer,De.quadTriangleIndexBuffer,De.rasterBoundsSegments,I.paint,De.transform.zoom),yt.destroy(),I.heatmapFbos.delete(ot))}function jc(De,I,ne){var Te,Se;const Ie=De.gl,ot=Ie.createTexture();Ie.bindTexture(Ie.TEXTURE_2D,ot),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_WRAP_S,Ie.CLAMP_TO_EDGE),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_WRAP_T,Ie.CLAMP_TO_EDGE),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_MIN_FILTER,Ie.LINEAR),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_MAG_FILTER,Ie.LINEAR);const yt=(Te=De.HALF_FLOAT)!==null&&Te!==void 0?Te:Ie.UNSIGNED_BYTE,Ct=(Se=De.RGBA16F)!==null&&Se!==void 0?Se:Ie.RGBA;Ie.texImage2D(Ie.TEXTURE_2D,0,Ct,I,ne,0,Ie.RGBA,yt,null);const Wt=De.createFramebuffer(I,ne,!1,!1);return Wt.colorAttachment.set(ot),Wt}function $c(De,I){return I.colorRampTexture||(I.colorRampTexture=new u(De,I.colorRamp,De.gl.RGBA)),I.colorRampTexture}function bu(De,I,ne,Te,Se){if(!ne||!Te||!Te.imageAtlas)return;const Ie=Te.imageAtlas.patternPositions;let ot=Ie[ne.to.toString()],yt=Ie[ne.from.toString()];if(!ot&&yt&&(ot=yt),!yt&&ot&&(yt=ot),!ot||!yt){const Ct=Se.getPaintProperty(I);ot=Ie[Ct],yt=Ie[Ct]}ot&&yt&&De.setConstantPatternPositions(ot,yt)}function Qc(De,I,ne,Te,Se,Ie,ot){const yt=De.context.gl,Ct="fill-pattern",Wt=ne.paint.get(Ct),nr=Wt&&Wt.constantOr(1),or=ne.getCrossfadeParameters();let Fr,Wr,je,Ze,at;ot?(Wr=nr&&!ne.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Fr=yt.LINES):(Wr=nr?"fillPattern":"fill",Fr=yt.TRIANGLES);const lt=Wt.constantOr(null);for(const Tt of Te){const gt=I.getTile(Tt);if(nr&&!gt.patternsLoaded())continue;const Et=gt.getBucket(ne);if(!Et)continue;const Yt=Et.programConfigurations.get(ne.id),rr=De.useProgram(Wr,Yt),sr=De.style.map.terrain&&De.style.map.terrain.getTerrainData(Tt);nr&&(De.context.activeTexture.set(yt.TEXTURE0),gt.imageAtlasTexture.bind(yt.LINEAR,yt.CLAMP_TO_EDGE),Yt.updatePaintBuffers(or)),bu(Yt,Ct,lt,gt,ne);const Sr=sr?Tt:null,Nr=De.translatePosMatrix(Sr?Sr.posMatrix:Tt.posMatrix,gt,ne.paint.get("fill-translate"),ne.paint.get("fill-translate-anchor"));if(ot){Ze=Et.indexBuffer2,at=Et.segments2;const Qr=[yt.drawingBufferWidth,yt.drawingBufferHeight];je=Wr==="fillOutlinePattern"&&nr?qn(Nr,De,or,gt,Qr):Ga(Nr,Qr)}else Ze=Et.indexBuffer,at=Et.segments,je=nr?pn(Nr,De,or,gt):pa(Nr);rr.draw(De.context,Fr,Se,De.stencilModeForClipping(Tt),Ie,oo.disabled,je,sr,ne.id,Et.layoutVertexBuffer,Ze,at,ne.paint,De.transform.zoom,Yt)}}function sc(De,I,ne,Te,Se,Ie,ot){const yt=De.context,Ct=yt.gl,Wt="fill-extrusion-pattern",nr=ne.paint.get(Wt),or=nr.constantOr(1),Fr=ne.getCrossfadeParameters(),Wr=ne.paint.get("fill-extrusion-opacity"),je=nr.constantOr(null);for(const Ze of Te){const at=I.getTile(Ze),lt=at.getBucket(ne);if(!lt)continue;const Tt=De.style.map.terrain&&De.style.map.terrain.getTerrainData(Ze),gt=lt.programConfigurations.get(ne.id),Et=De.useProgram(or?"fillExtrusionPattern":"fillExtrusion",gt);or&&(De.context.activeTexture.set(Ct.TEXTURE0),at.imageAtlasTexture.bind(Ct.LINEAR,Ct.CLAMP_TO_EDGE),gt.updatePaintBuffers(Fr)),bu(gt,Wt,je,at,ne);const Yt=De.translatePosMatrix(Ze.posMatrix,at,ne.paint.get("fill-extrusion-translate"),ne.paint.get("fill-extrusion-translate-anchor")),rr=ne.paint.get("fill-extrusion-vertical-gradient"),sr=or?ra(Yt,De,rr,Wr,Ze,Fr,at):ya(Yt,De,rr,Wr);Et.draw(yt,yt.gl.TRIANGLES,Se,Ie,ot,oo.backCCW,sr,Tt,ne.id,lt.layoutVertexBuffer,lt.indexBuffer,lt.segments,ne.paint,De.transform.zoom,gt,De.style.map.terrain&<.centroidVertexBuffer)}}function wu(De,I,ne,Te,Se,Ie,ot){const yt=De.context,Ct=yt.gl,Wt=ne.fbo;if(!Wt)return;const nr=De.useProgram("hillshade"),or=De.style.map.terrain&&De.style.map.terrain.getTerrainData(I);yt.activeTexture.set(Ct.TEXTURE0),Ct.bindTexture(Ct.TEXTURE_2D,Wt.colorAttachment.get()),nr.draw(yt,Ct.TRIANGLES,Se,Ie,ot,oo.disabled,((Fr,Wr,je,Ze)=>{const at=je.paint.get("hillshade-shadow-color"),lt=je.paint.get("hillshade-highlight-color"),Tt=je.paint.get("hillshade-accent-color");let gt=je.paint.get("hillshade-illumination-direction")*(Math.PI/180);je.paint.get("hillshade-illumination-anchor")==="viewport"&&(gt-=Fr.transform.angle);const Et=!Fr.options.moving;return{u_matrix:Ze?Ze.posMatrix:Fr.transform.calculatePosMatrix(Wr.tileID.toUnwrapped(),Et),u_image:0,u_latrange:mi(0,Wr.tileID),u_light:[je.paint.get("hillshade-exaggeration"),gt],u_shadow:at,u_highlight:lt,u_accent:Tt}})(De,ne,Te,or?I:null),or,Te.id,De.rasterBoundsBuffer,De.quadTriangleIndexBuffer,De.rasterBoundsSegments)}function eu(De,I,ne,Te,Se,Ie){const ot=De.context,yt=ot.gl,Ct=I.dem;if(Ct&&Ct.data){const Wt=Ct.dim,nr=Ct.stride,or=Ct.getPixels();if(ot.activeTexture.set(yt.TEXTURE1),ot.pixelStoreUnpackPremultiplyAlpha.set(!1),I.demTexture=I.demTexture||De.getTileTexture(nr),I.demTexture){const Wr=I.demTexture;Wr.update(or,{premultiply:!1}),Wr.bind(yt.NEAREST,yt.CLAMP_TO_EDGE)}else I.demTexture=new u(ot,or,yt.RGBA,{premultiply:!1}),I.demTexture.bind(yt.NEAREST,yt.CLAMP_TO_EDGE);ot.activeTexture.set(yt.TEXTURE0);let Fr=I.fbo;if(!Fr){const Wr=new u(ot,{width:Wt,height:Wt,data:null},yt.RGBA);Wr.bind(yt.LINEAR,yt.CLAMP_TO_EDGE),Fr=I.fbo=ot.createFramebuffer(Wt,Wt,!0,!1),Fr.colorAttachment.set(Wr.texture)}ot.bindFramebuffer.set(Fr.framebuffer),ot.viewport.set([0,0,Wt,Wt]),De.useProgram("hillshadePrepare").draw(ot,yt.TRIANGLES,Te,Se,Ie,oo.disabled,((Wr,je)=>{const Ze=je.stride,at=t.H();return t.aP(at,0,t.X,-t.X,0,0,1),t.J(at,at,[0,-t.X,0]),{u_matrix:at,u_image:1,u_dimension:[Ze,Ze],u_zoom:Wr.overscaledZ,u_unpack:je.getUnpackVector()}})(I.tileID,Ct),null,ne.id,De.rasterBoundsBuffer,De.quadTriangleIndexBuffer,De.rasterBoundsSegments),I.needsHillshadePrepare=!1}}function Sc(De,I,ne,Te,Se,Ie){const ot=Te.paint.get("raster-fade-duration");if(!Ie&&ot>0){const yt=i.now(),Ct=(yt-De.timeAdded)/ot,Wt=I?(yt-I.timeAdded)/ot:-1,nr=ne.getSource(),or=Se.coveringZoomLevel({tileSize:nr.tileSize,roundZoom:nr.roundZoom}),Fr=!I||Math.abs(I.tileID.overscaledZ-or)>Math.abs(De.tileID.overscaledZ-or),Wr=Fr&&De.refreshedUponExpiration?1:t.ac(Fr?Ct:1-Wt,0,1);return De.refreshedUponExpiration&&Ct>=1&&(De.refreshedUponExpiration=!1),I?{opacity:1,mix:1-Wr}:{opacity:Wr,mix:0}}return{opacity:1,mix:0}}const ef=new t.aM(1,0,0,1),ps=new t.aM(0,1,0,1),Vc=new t.aM(0,0,1,1),Zf=new t.aM(1,0,1,1),mf=new t.aM(0,1,1,1);function Mc(De,I,ne,Te){tu(De,0,I+ne/2,De.transform.width,ne,Te)}function _f(De,I,ne,Te){tu(De,I-ne/2,0,ne,De.transform.height,Te)}function tu(De,I,ne,Te,Se,Ie){const ot=De.context,yt=ot.gl;yt.enable(yt.SCISSOR_TEST),yt.scissor(I*De.pixelRatio,ne*De.pixelRatio,Te*De.pixelRatio,Se*De.pixelRatio),ot.clear({color:Ie}),yt.disable(yt.SCISSOR_TEST)}function xf(De,I,ne){const Te=De.context,Se=Te.gl,Ie=ne.posMatrix,ot=De.useProgram("debug"),yt=Eo.disabled,Ct=is.disabled,Wt=De.colorModeForRenderPass(),nr="$debug",or=De.style.map.terrain&&De.style.map.terrain.getTerrainData(ne);Te.activeTexture.set(Se.TEXTURE0);const Fr=I.getTileByID(ne.key).latestRawTileData,Wr=Math.floor((Fr&&Fr.byteLength||0)/1024),je=I.getTile(ne).tileSize,Ze=512/Math.min(je,512)*(ne.overscaledZ/De.transform.zoom)*.5;let at=ne.canonical.toString();ne.overscaledZ!==ne.canonical.z&&(at+=` => ${ne.overscaledZ}`),function(lt,Tt){lt.initDebugOverlayCanvas();const gt=lt.debugOverlayCanvas,Et=lt.context.gl,Yt=lt.debugOverlayCanvas.getContext("2d");Yt.clearRect(0,0,gt.width,gt.height),Yt.shadowColor="white",Yt.shadowBlur=2,Yt.lineWidth=1.5,Yt.strokeStyle="white",Yt.textBaseline="top",Yt.font="bold 36px Open Sans, sans-serif",Yt.fillText(Tt,5,5),Yt.strokeText(Tt,5,5),lt.debugOverlayTexture.update(gt),lt.debugOverlayTexture.bind(Et.LINEAR,Et.CLAMP_TO_EDGE)}(De,`${at} ${Wr}kB`),ot.draw(Te,Se.TRIANGLES,yt,Ct,Bs.alphaBlended,oo.disabled,yi(Ie,t.aM.transparent,Ze),null,nr,De.debugBuffer,De.quadTriangleIndexBuffer,De.debugSegments),ot.draw(Te,Se.LINE_STRIP,yt,Ct,Wt,oo.disabled,yi(Ie,t.aM.red),or,nr,De.debugBuffer,De.tileBorderIndexBuffer,De.debugSegments)}function Fl(De,I,ne){const Te=De.context,Se=Te.gl,Ie=De.colorModeForRenderPass(),ot=new Eo(Se.LEQUAL,Eo.ReadWrite,De.depthRangeFor3D),yt=De.useProgram("terrain"),Ct=I.getTerrainMesh();Te.bindFramebuffer.set(null),Te.viewport.set([0,0,De.width,De.height]);for(const Wt of ne){const nr=De.renderToTexture.getTexture(Wt),or=I.getTerrainData(Wt.tileID);Te.activeTexture.set(Se.TEXTURE0),Se.bindTexture(Se.TEXTURE_2D,nr.texture);const Fr=De.transform.calculatePosMatrix(Wt.tileID.toUnwrapped()),Wr=I.getMeshFrameDelta(De.transform.zoom),je=De.transform.calculateFogMatrix(Wt.tileID.toUnwrapped()),Ze=mr(Fr,Wr,je,De.style.sky,De.transform.pitch);yt.draw(Te,Se.TRIANGLES,ot,is.disabled,Ie,oo.backCCW,Ze,or,"terrain",Ct.vertexBuffer,Ct.indexBuffer,Ct.segments)}}class ru{constructor(I,ne,Te){this.vertexBuffer=I,this.indexBuffer=ne,this.segments=Te}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Uu{constructor(I,ne){this.context=new Gf(I),this.transform=ne,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=St.maxUnderzooming+St.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new kr}resize(I,ne,Te){if(this.width=Math.floor(I*Te),this.height=Math.floor(ne*Te),this.pixelRatio=Te,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const Se of this.style._order)this.style._layers[Se].resize()}setup(){const I=this.context,ne=new t.aX;ne.emplaceBack(0,0),ne.emplaceBack(t.X,0),ne.emplaceBack(0,t.X),ne.emplaceBack(t.X,t.X),this.tileExtentBuffer=I.createVertexBuffer(ne,Zr.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);const Te=new t.aX;Te.emplaceBack(0,0),Te.emplaceBack(t.X,0),Te.emplaceBack(0,t.X),Te.emplaceBack(t.X,t.X),this.debugBuffer=I.createVertexBuffer(Te,Zr.members),this.debugSegments=t.a0.simpleSegment(0,0,4,5);const Se=new t.$;Se.emplaceBack(0,0,0,0),Se.emplaceBack(t.X,0,t.X,0),Se.emplaceBack(0,t.X,0,t.X),Se.emplaceBack(t.X,t.X,t.X,t.X),this.rasterBoundsBuffer=I.createVertexBuffer(Se,qe.members),this.rasterBoundsSegments=t.a0.simpleSegment(0,0,4,2);const Ie=new t.aX;Ie.emplaceBack(0,0),Ie.emplaceBack(1,0),Ie.emplaceBack(0,1),Ie.emplaceBack(1,1),this.viewportBuffer=I.createVertexBuffer(Ie,Zr.members),this.viewportSegments=t.a0.simpleSegment(0,0,4,2);const ot=new t.aZ;ot.emplaceBack(0),ot.emplaceBack(1),ot.emplaceBack(3),ot.emplaceBack(2),ot.emplaceBack(0),this.tileBorderIndexBuffer=I.createIndexBuffer(ot);const yt=new t.aY;yt.emplaceBack(0,1,2),yt.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=I.createIndexBuffer(yt);const Ct=this.context.gl;this.stencilClearMode=new is({func:Ct.ALWAYS,mask:0},0,255,Ct.ZERO,Ct.ZERO,Ct.ZERO)}clearStencil(){const I=this.context,ne=I.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const Te=t.H();t.aP(Te,0,this.width,this.height,0,0,1),t.K(Te,Te,[ne.drawingBufferWidth,ne.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(I,ne.TRIANGLES,Eo.disabled,this.stencilClearMode,Bs.disabled,oo.disabled,Ci(Te),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(I,ne){if(this.currentStencilSource===I.source||!I.isTileClipped()||!ne||!ne.length)return;this.currentStencilSource=I.source;const Te=this.context,Se=Te.gl;this.nextStencilID+ne.length>256&&this.clearStencil(),Te.setColorMode(Bs.disabled),Te.setDepthMode(Eo.disabled);const Ie=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const ot of ne){const yt=this._tileClippingMaskIDs[ot.key]=this.nextStencilID++,Ct=this.style.map.terrain&&this.style.map.terrain.getTerrainData(ot);Ie.draw(Te,Se.TRIANGLES,Eo.disabled,new is({func:Se.ALWAYS,mask:0},yt,255,Se.KEEP,Se.KEEP,Se.REPLACE),Bs.disabled,oo.disabled,Ci(ot.posMatrix),Ct,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const I=this.nextStencilID++,ne=this.context.gl;return new is({func:ne.NOTEQUAL,mask:255},I,255,ne.KEEP,ne.KEEP,ne.REPLACE)}stencilModeForClipping(I){const ne=this.context.gl;return new is({func:ne.EQUAL,mask:255},this._tileClippingMaskIDs[I.key],0,ne.KEEP,ne.KEEP,ne.REPLACE)}stencilConfigForOverlap(I){const ne=this.context.gl,Te=I.sort((ot,yt)=>yt.overscaledZ-ot.overscaledZ),Se=Te[Te.length-1].overscaledZ,Ie=Te[0].overscaledZ-Se+1;if(Ie>1){this.currentStencilSource=void 0,this.nextStencilID+Ie>256&&this.clearStencil();const ot={};for(let yt=0;yt({u_sky_color:lt.properties.get("sky-color"),u_horizon_color:lt.properties.get("horizon-color"),u_horizon:(Tt.height/2+Tt.getHorizon())*gt,u_sky_horizon_blend:lt.properties.get("sky-horizon-blend")*Tt.height/2*gt}))(Wt,Ct.style.map.transform,Ct.pixelRatio),Wr=new Eo(or.LEQUAL,Eo.ReadWrite,[0,1]),je=is.disabled,Ze=Ct.colorModeForRenderPass(),at=Ct.useProgram("sky");if(!Wt.mesh){const lt=new t.aX;lt.emplaceBack(-1,-1),lt.emplaceBack(1,-1),lt.emplaceBack(1,1),lt.emplaceBack(-1,1);const Tt=new t.aY;Tt.emplaceBack(0,1,2),Tt.emplaceBack(0,2,3),Wt.mesh=new ru(nr.createVertexBuffer(lt,Zr.members),nr.createIndexBuffer(Tt),t.a0.simpleSegment(0,0,lt.length,Tt.length))}at.draw(nr,or.TRIANGLES,Wr,je,Ze,oo.disabled,Fr,void 0,"sky",Wt.mesh.vertexBuffer,Wt.mesh.indexBuffer,Wt.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=ne.showOverdrawInspector,this.depthRangeFor3D=[0,1-(I._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=Te.length-1;this.currentLayer>=0;this.currentLayer--){const Ct=this.style._layers[Te[this.currentLayer]],Wt=Se[Ct.source],nr=Ie[Ct.source];this._renderTileClippingMasks(Ct,nr),this.renderLayer(this,Wt,Ct,nr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerat.source&&!at.isHidden(nr)?[Wt.sourceCaches[at.source]]:[]),Wr=Fr.filter(at=>at.getSource().type==="vector"),je=Fr.filter(at=>at.getSource().type!=="vector"),Ze=at=>{(!or||or.getSource().maxzoomZe(at)),or||je.forEach(at=>Ze(at)),or}(this.style,this.transform.zoom);Ct&&function(Wt,nr,or){for(let Fr=0;Fr0),Se&&(t.b0(ne,Te),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(Ie,ot){const yt=Ie.context,Ct=yt.gl,Wt=Bs.unblended,nr=new Eo(Ct.LEQUAL,Eo.ReadWrite,[0,1]),or=ot.getTerrainMesh(),Fr=ot.sourceCache.getRenderableTiles(),Wr=Ie.useProgram("terrainDepth");yt.bindFramebuffer.set(ot.getFramebuffer("depth").framebuffer),yt.viewport.set([0,0,Ie.width/devicePixelRatio,Ie.height/devicePixelRatio]),yt.clear({color:t.aM.transparent,depth:1});for(const je of Fr){const Ze=ot.getTerrainData(je.tileID),at={u_matrix:Ie.transform.calculatePosMatrix(je.tileID.toUnwrapped()),u_ele_delta:ot.getMeshFrameDelta(Ie.transform.zoom)};Wr.draw(yt,Ct.TRIANGLES,nr,is.disabled,Wt,oo.backCCW,at,Ze,"terrain",or.vertexBuffer,or.indexBuffer,or.segments)}yt.bindFramebuffer.set(null),yt.viewport.set([0,0,Ie.width,Ie.height])}(this,this.style.map.terrain),function(Ie,ot){const yt=Ie.context,Ct=yt.gl,Wt=Bs.unblended,nr=new Eo(Ct.LEQUAL,Eo.ReadWrite,[0,1]),or=ot.getTerrainMesh(),Fr=ot.getCoordsTexture(),Wr=ot.sourceCache.getRenderableTiles(),je=Ie.useProgram("terrainCoords");yt.bindFramebuffer.set(ot.getFramebuffer("coords").framebuffer),yt.viewport.set([0,0,Ie.width/devicePixelRatio,Ie.height/devicePixelRatio]),yt.clear({color:t.aM.transparent,depth:1}),ot.coordsIndex=[];for(const Ze of Wr){const at=ot.getTerrainData(Ze.tileID);yt.activeTexture.set(Ct.TEXTURE0),Ct.bindTexture(Ct.TEXTURE_2D,Fr.texture);const lt={u_matrix:Ie.transform.calculatePosMatrix(Ze.tileID.toUnwrapped()),u_terrain_coords_id:(255-ot.coordsIndex.length)/255,u_texture:0,u_ele_delta:ot.getMeshFrameDelta(Ie.transform.zoom)};je.draw(yt,Ct.TRIANGLES,nr,is.disabled,Wt,oo.backCCW,lt,at,"terrain",or.vertexBuffer,or.indexBuffer,or.segments),ot.coordsIndex.push(Ze.tileID.key)}yt.bindFramebuffer.set(null),yt.viewport.set([0,0,Ie.width,Ie.height])}(this,this.style.map.terrain))}renderLayer(I,ne,Te,Se){if(!Te.isHidden(this.transform.zoom)&&(Te.type==="background"||Te.type==="custom"||(Se||[]).length))switch(this.id=Te.id,Te.type){case"symbol":(function(Ie,ot,yt,Ct,Wt){if(Ie.renderPass!=="translucent")return;const nr=is.disabled,or=Ie.colorModeForRenderPass();(yt._unevaluatedLayout.hasValue("text-variable-anchor")||yt._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(Fr,Wr,je,Ze,at,lt,Tt,gt,Et){const Yt=Wr.transform,rr=Oa(),sr=at==="map",Sr=lt==="map";for(const Nr of Fr){const Qr=Ze.getTile(Nr),ia=Qr.getBucket(je);if(!ia||!ia.text||!ia.text.segments.get().length)continue;const _a=t.ag(ia.textSizeData,Yt.zoom),za=da(Qr,1,Wr.transform.zoom),nn=fr(Nr.posMatrix,Sr,sr,Wr.transform,za),en=je.layout.get("icon-text-fit")!=="none"&&ia.hasIconData();if(_a){const ln=Math.pow(2,Yt.zoom-Qr.tileID.overscaledZ),Nn=Wr.style.map.terrain?(ii,Gi)=>Wr.style.map.terrain.getElevation(Nr,ii,Gi):null,pi=rr.translatePosition(Yt,Qr,Tt,gt);gc(ia,sr,Sr,Et,Yt,nn,Nr.posMatrix,ln,_a,en,rr,pi,Nr.toUnwrapped(),Nn)}}}(Ct,Ie,yt,ot,yt.layout.get("text-rotation-alignment"),yt.layout.get("text-pitch-alignment"),yt.paint.get("text-translate"),yt.paint.get("text-translate-anchor"),Wt),yt.paint.get("icon-opacity").constantOr(1)!==0&&yf(Ie,ot,yt,Ct,!1,yt.paint.get("icon-translate"),yt.paint.get("icon-translate-anchor"),yt.layout.get("icon-rotation-alignment"),yt.layout.get("icon-pitch-alignment"),yt.layout.get("icon-keep-upright"),nr,or),yt.paint.get("text-opacity").constantOr(1)!==0&&yf(Ie,ot,yt,Ct,!0,yt.paint.get("text-translate"),yt.paint.get("text-translate-anchor"),yt.layout.get("text-rotation-alignment"),yt.layout.get("text-pitch-alignment"),yt.layout.get("text-keep-upright"),nr,or),ot.map.showCollisionBoxes&&(xu(Ie,ot,yt,Ct,!0),xu(Ie,ot,yt,Ct,!1))})(I,ne,Te,Se,this.style.placement.variableOffsets);break;case"circle":(function(Ie,ot,yt,Ct){if(Ie.renderPass!=="translucent")return;const Wt=yt.paint.get("circle-opacity"),nr=yt.paint.get("circle-stroke-width"),or=yt.paint.get("circle-stroke-opacity"),Fr=!yt.layout.get("circle-sort-key").isConstant();if(Wt.constantOr(1)===0&&(nr.constantOr(1)===0||or.constantOr(1)===0))return;const Wr=Ie.context,je=Wr.gl,Ze=Ie.depthModeForSublayer(0,Eo.ReadOnly),at=is.disabled,lt=Ie.colorModeForRenderPass(),Tt=[];for(let gt=0;gtgt.sortKey-Et.sortKey);for(const gt of Tt){const{programConfiguration:Et,program:Yt,layoutVertexBuffer:rr,indexBuffer:sr,uniformValues:Sr,terrainData:Nr}=gt.state;Yt.draw(Wr,je.TRIANGLES,Ze,at,lt,oo.disabled,Sr,Nr,yt.id,rr,sr,gt.segments,yt.paint,Ie.transform.zoom,Et)}})(I,ne,Te,Se);break;case"heatmap":(function(Ie,ot,yt,Ct){if(yt.paint.get("heatmap-opacity")===0)return;const Wt=Ie.context;if(Ie.style.map.terrain){for(const nr of Ct){const or=ot.getTile(nr);ot.hasRenderableParent(nr)||(Ie.renderPass==="offscreen"?Uc(Ie,or,yt,nr):Ie.renderPass==="translucent"&&$u(Ie,yt,nr))}Wt.viewport.set([0,0,Ie.width,Ie.height])}else Ie.renderPass==="offscreen"?function(nr,or,Fr,Wr){const je=nr.context,Ze=je.gl,at=is.disabled,lt=new Bs([Ze.ONE,Ze.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(Tt,gt,Et){const Yt=Tt.gl;Tt.activeTexture.set(Yt.TEXTURE1),Tt.viewport.set([0,0,gt.width/4,gt.height/4]);let rr=Et.heatmapFbos.get(t.aU);rr?(Yt.bindTexture(Yt.TEXTURE_2D,rr.colorAttachment.get()),Tt.bindFramebuffer.set(rr.framebuffer)):(rr=jc(Tt,gt.width/4,gt.height/4),Et.heatmapFbos.set(t.aU,rr))})(je,nr,Fr),je.clear({color:t.aM.transparent});for(let Tt=0;Tt20&&nr.texParameterf(nr.TEXTURE_2D,Wt.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Wt.extTextureFilterAnisotropicMax);const ia=Ie.style.map.terrain&&Ie.style.map.terrain.getTerrainData(Tt),_a=ia?Tt:null,za=_a?_a.posMatrix:Ie.transform.calculatePosMatrix(Tt.toUnwrapped(),lt),nn=Ao(za,Nr||[0,0],Sr||1,sr,yt);or instanceof et?Fr.draw(Wt,nr.TRIANGLES,gt,is.disabled,Wr,oo.disabled,nn,ia,yt.id,or.boundsBuffer,Ie.quadTriangleIndexBuffer,or.boundsSegments):Fr.draw(Wt,nr.TRIANGLES,gt,je[Tt.overscaledZ],Wr,oo.disabled,nn,ia,yt.id,Ie.rasterBoundsBuffer,Ie.quadTriangleIndexBuffer,Ie.rasterBoundsSegments)}})(I,ne,Te,Se);break;case"background":(function(Ie,ot,yt,Ct){const Wt=yt.paint.get("background-color"),nr=yt.paint.get("background-opacity");if(nr===0)return;const or=Ie.context,Fr=or.gl,Wr=Ie.transform,je=Wr.tileSize,Ze=yt.paint.get("background-pattern");if(Ie.isPatternMissing(Ze))return;const at=!Ze&&Wt.a===1&&nr===1&&Ie.opaquePassEnabledForLayer()?"opaque":"translucent";if(Ie.renderPass!==at)return;const lt=is.disabled,Tt=Ie.depthModeForSublayer(0,at==="opaque"?Eo.ReadWrite:Eo.ReadOnly),gt=Ie.colorModeForRenderPass(),Et=Ie.useProgram(Ze?"backgroundPattern":"background"),Yt=Ct||Wr.coveringTiles({tileSize:je,terrain:Ie.style.map.terrain});Ze&&(or.activeTexture.set(Fr.TEXTURE0),Ie.imageManager.bind(Ie.context));const rr=yt.getCrossfadeParameters();for(const sr of Yt){const Sr=Ct?sr.posMatrix:Ie.transform.calculatePosMatrix(sr.toUnwrapped()),Nr=Ze?as(Sr,nr,Ie,Ze,{tileID:sr,tileSize:je},rr):bs(Sr,nr,Wt),Qr=Ie.style.map.terrain&&Ie.style.map.terrain.getTerrainData(sr);Et.draw(or,Fr.TRIANGLES,Tt,lt,gt,oo.disabled,Nr,Qr,yt.id,Ie.tileExtentBuffer,Ie.quadTriangleIndexBuffer,Ie.tileExtentSegments)}})(I,0,Te,Se);break;case"custom":(function(Ie,ot,yt){const Ct=Ie.context,Wt=yt.implementation;if(Ie.renderPass==="offscreen"){const nr=Wt.prerender;nr&&(Ie.setCustomLayerDefaults(),Ct.setColorMode(Ie.colorModeForRenderPass()),nr.call(Wt,Ct.gl,Ie.transform.customLayerMatrix()),Ct.setDirty(),Ie.setBaseState())}else if(Ie.renderPass==="translucent"){Ie.setCustomLayerDefaults(),Ct.setColorMode(Ie.colorModeForRenderPass()),Ct.setStencilMode(is.disabled);const nr=Wt.renderingMode==="3d"?new Eo(Ie.context.gl.LEQUAL,Eo.ReadWrite,Ie.depthRangeFor3D):Ie.depthModeForSublayer(0,Eo.ReadOnly);Ct.setDepthMode(nr),Wt.render(Ct.gl,Ie.transform.customLayerMatrix(),{farZ:Ie.transform.farZ,nearZ:Ie.transform.nearZ,fov:Ie.transform._fov,modelViewProjectionMatrix:Ie.transform.modelViewProjectionMatrix,projectionMatrix:Ie.transform.projectionMatrix}),Ct.setDirty(),Ie.setBaseState(),Ct.bindFramebuffer.set(null)}})(I,0,Te)}}translatePosMatrix(I,ne,Te,Se,Ie){if(!Te[0]&&!Te[1])return I;const ot=Ie?Se==="map"?this.transform.angle:0:Se==="viewport"?-this.transform.angle:0;if(ot){const Wt=Math.sin(ot),nr=Math.cos(ot);Te=[Te[0]*nr-Te[1]*Wt,Te[0]*Wt+Te[1]*nr]}const yt=[Ie?Te[0]:da(ne,Te[0],this.transform.zoom),Ie?Te[1]:da(ne,Te[1],this.transform.zoom),0],Ct=new Float32Array(16);return t.J(Ct,I,yt),Ct}saveTileTexture(I){const ne=this._tileTextures[I.size[0]];ne?ne.push(I):this._tileTextures[I.size[0]]=[I]}getTileTexture(I){const ne=this._tileTextures[I];return ne&&ne.length>0?ne.pop():null}isPatternMissing(I){if(!I)return!1;if(!I.from||!I.to)return!0;const ne=this.imageManager.getPattern(I.from.toString()),Te=this.imageManager.getPattern(I.to.toString());return!ne||!Te}useProgram(I,ne){this.cache=this.cache||{};const Te=I+(ne?ne.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[Te]||(this.cache[Te]=new oa(this.context,Jr[I],ne,fs[I],this._showOverdrawInspector,this.style.map.terrain)),this.cache[Te]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const 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)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new u(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:I,drawingBufferHeight:ne}=this.context.gl;return this.width!==I||this.height!==ne}}class $s{constructor(I,ne){this.points=I,this.planes=ne}static fromInvProjectionMatrix(I,ne,Te){const Se=Math.pow(2,Te),Ie=[[-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(yt=>{const Ct=1/(yt=t.af([],yt,I))[3]/ne*Se;return t.b1(yt,yt,[Ct,Ct,1/yt[3],Ct])}),ot=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(yt=>{const Ct=function(Fr,Wr){var je=Wr[0],Ze=Wr[1],at=Wr[2],lt=je*je+Ze*Ze+at*at;return lt>0&&(lt=1/Math.sqrt(lt)),Fr[0]=Wr[0]*lt,Fr[1]=Wr[1]*lt,Fr[2]=Wr[2]*lt,Fr}([],function(Fr,Wr,je){var Ze=Wr[0],at=Wr[1],lt=Wr[2],Tt=je[0],gt=je[1],Et=je[2];return Fr[0]=at*Et-lt*gt,Fr[1]=lt*Tt-Ze*Et,Fr[2]=Ze*gt-at*Tt,Fr}([],M([],Ie[yt[0]],Ie[yt[1]]),M([],Ie[yt[2]],Ie[yt[1]]))),Wt=-((nr=Ct)[0]*(or=Ie[yt[1]])[0]+nr[1]*or[1]+nr[2]*or[2]);var nr,or;return Ct.concat(Wt)});return new $s(Ie,ot)}}class Qu{constructor(I,ne){this.min=I,this.max=ne,this.center=function(Te,Se,Ie){return Te[0]=.5*Se[0],Te[1]=.5*Se[1],Te[2]=.5*Se[2],Te}([],function(Te,Se,Ie){return Te[0]=Se[0]+Ie[0],Te[1]=Se[1]+Ie[1],Te[2]=Se[2]+Ie[2],Te}([],this.min,this.max))}quadrant(I){const ne=[I%2==0,I<2],Te=b(this.min),Se=b(this.max);for(let Ie=0;Ie=0&&ot++;if(ot===0)return 0;ot!==ne.length&&(Te=!1)}if(Te)return 2;for(let Se=0;Se<3;Se++){let Ie=Number.MAX_VALUE,ot=-Number.MAX_VALUE;for(let yt=0;ytthis.max[Se]-this.min[Se])return 0}return 1}}class Tu{constructor(I=0,ne=0,Te=0,Se=0){if(isNaN(I)||I<0||isNaN(ne)||ne<0||isNaN(Te)||Te<0||isNaN(Se)||Se<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=I,this.bottom=ne,this.left=Te,this.right=Se}interpolate(I,ne,Te){return ne.top!=null&&I.top!=null&&(this.top=t.y.number(I.top,ne.top,Te)),ne.bottom!=null&&I.bottom!=null&&(this.bottom=t.y.number(I.bottom,ne.bottom,Te)),ne.left!=null&&I.left!=null&&(this.left=t.y.number(I.left,ne.left,Te)),ne.right!=null&&I.right!=null&&(this.right=t.y.number(I.right,ne.right,Te)),this}getCenter(I,ne){const Te=t.ac((this.left+I-this.right)/2,0,I),Se=t.ac((this.top+ne-this.bottom)/2,0,ne);return new t.P(Te,Se)}equals(I){return this.top===I.top&&this.bottom===I.bottom&&this.left===I.left&&this.right===I.right}clone(){return new Tu(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const au=85.051129;class Ns{constructor(I,ne,Te,Se,Ie){this.tileSize=512,this._renderWorldCopies=Ie===void 0||!!Ie,this._minZoom=I||0,this._maxZoom=ne||22,this._minPitch=Te??0,this._maxPitch=Se??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Tu,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const I=new Ns(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return I.apply(this),I}apply(I){this.tileSize=I.tileSize,this.latRange=I.latRange,this.lngRange=I.lngRange,this.width=I.width,this.height=I.height,this._center=I._center,this._elevation=I._elevation,this.minElevationForCurrentTile=I.minElevationForCurrentTile,this.zoom=I.zoom,this.angle=I.angle,this._fov=I._fov,this._pitch=I._pitch,this._unmodified=I._unmodified,this._edgeInsets=I._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(I){this._minZoom!==I&&(this._minZoom=I,this.zoom=Math.max(this.zoom,I))}get maxZoom(){return this._maxZoom}set maxZoom(I){this._maxZoom!==I&&(this._maxZoom=I,this.zoom=Math.min(this.zoom,I))}get minPitch(){return this._minPitch}set minPitch(I){this._minPitch!==I&&(this._minPitch=I,this.pitch=Math.max(this.pitch,I))}get maxPitch(){return this._maxPitch}set maxPitch(I){this._maxPitch!==I&&(this._maxPitch=I,this.pitch=Math.min(this.pitch,I))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(I){I===void 0?I=!0:I===null&&(I=!1),this._renderWorldCopies=I}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(I){const ne=-t.b3(I,-180,180)*Math.PI/180;this.angle!==ne&&(this._unmodified=!1,this.angle=ne,this._calcMatrices(),this.rotationMatrix=function(){var Te=new t.A(4);return t.A!=Float32Array&&(Te[1]=0,Te[2]=0),Te[0]=1,Te[3]=1,Te}(),function(Te,Se,Ie){var ot=Se[0],yt=Se[1],Ct=Se[2],Wt=Se[3],nr=Math.sin(Ie),or=Math.cos(Ie);Te[0]=ot*or+Ct*nr,Te[1]=yt*or+Wt*nr,Te[2]=ot*-nr+Ct*or,Te[3]=yt*-nr+Wt*or}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(I){const ne=t.ac(I,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==ne&&(this._unmodified=!1,this._pitch=ne,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(I){I=Math.max(.01,Math.min(60,I)),this._fov!==I&&(this._unmodified=!1,this._fov=I/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(I){const ne=Math.min(Math.max(I,this.minZoom),this.maxZoom);this._zoom!==ne&&(this._unmodified=!1,this._zoom=ne,this.tileZoom=Math.max(0,Math.floor(ne)),this.scale=this.zoomScale(ne),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(I){I.lat===this._center.lat&&I.lng===this._center.lng||(this._unmodified=!1,this._center=I,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(I){I!==this._elevation&&(this._elevation=I,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(I){this._edgeInsets.equals(I)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,I,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(I){return this._edgeInsets.equals(I)}interpolatePadding(I,ne,Te){this._unmodified=!1,this._edgeInsets.interpolate(I,ne,Te),this._constrain(),this._calcMatrices()}coveringZoomLevel(I){const ne=(I.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/I.tileSize));return Math.max(0,ne)}getVisibleUnwrappedCoordinates(I){const ne=[new t.b4(0,I)];if(this._renderWorldCopies){const Te=this.pointCoordinate(new t.P(0,0)),Se=this.pointCoordinate(new t.P(this.width,0)),Ie=this.pointCoordinate(new t.P(this.width,this.height)),ot=this.pointCoordinate(new t.P(0,this.height)),yt=Math.floor(Math.min(Te.x,Se.x,Ie.x,ot.x)),Ct=Math.floor(Math.max(Te.x,Se.x,Ie.x,ot.x)),Wt=1;for(let nr=yt-Wt;nr<=Ct+Wt;nr++)nr!==0&&ne.push(new t.b4(nr,I))}return ne}coveringTiles(I){var ne,Te;let Se=this.coveringZoomLevel(I);const Ie=Se;if(I.minzoom!==void 0&&SeI.maxzoom&&(Se=I.maxzoom);const ot=this.pointCoordinate(this.getCameraPoint()),yt=t.Z.fromLngLat(this.center),Ct=Math.pow(2,Se),Wt=[Ct*ot.x,Ct*ot.y,0],nr=[Ct*yt.x,Ct*yt.y,0],or=$s.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,Se);let Fr=I.minzoom||0;!I.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Fr=Se);const Wr=I.terrain?2/Math.min(this.tileSize,I.tileSize)*this.tileSize:3,je=gt=>({aabb:new Qu([gt*Ct,0,0],[(gt+1)*Ct,Ct,0]),zoom:0,x:0,y:0,wrap:gt,fullyVisible:!1}),Ze=[],at=[],lt=Se,Tt=I.reparseOverscaled?Ie:Se;if(this._renderWorldCopies)for(let gt=1;gt<=3;gt++)Ze.push(je(-gt)),Ze.push(je(gt));for(Ze.push(je(0));Ze.length>0;){const gt=Ze.pop(),Et=gt.x,Yt=gt.y;let rr=gt.fullyVisible;if(!rr){const ia=gt.aabb.intersects(or);if(ia===0)continue;rr=ia===2}const sr=I.terrain?Wt:nr,Sr=gt.aabb.distanceX(sr),Nr=gt.aabb.distanceY(sr),Qr=Math.max(Math.abs(Sr),Math.abs(Nr));if(gt.zoom===lt||Qr>Wr+(1<=Fr){const ia=lt-gt.zoom,_a=Wt[0]-.5-(Et<>1),nn=gt.zoom+1;let en=gt.aabb.quadrant(ia);if(I.terrain){const ln=new t.S(nn,gt.wrap,nn,_a,za),Nn=I.terrain.getMinMaxElevation(ln),pi=(ne=Nn.minElevation)!==null&&ne!==void 0?ne:this.elevation,ii=(Te=Nn.maxElevation)!==null&&Te!==void 0?Te:this.elevation;en=new Qu([en.min[0],en.min[1],pi],[en.max[0],en.max[1],ii])}Ze.push({aabb:en,zoom:nn,x:_a,y:za,wrap:gt.wrap,fullyVisible:rr})}}return at.sort((gt,Et)=>gt.distanceSq-Et.distanceSq).map(gt=>gt.tileID)}resize(I,ne){this.width=I,this.height=ne,this.pixelsToGLUnits=[2/I,-2/ne],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(I){return Math.pow(2,I)}scaleZoom(I){return Math.log(I)/Math.LN2}project(I){const ne=t.ac(I.lat,-85.051129,au);return new t.P(t.O(I.lng)*this.worldSize,t.Q(ne)*this.worldSize)}unproject(I){return new t.Z(I.x/this.worldSize,I.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(I){const ne=this.elevation,Te=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,Se=this.pointLocation(this.centerPoint,I),Ie=I.getElevationForLngLatZoom(Se,this.tileZoom);if(!(this.elevation-Ie))return;const ot=Te+ne-Ie,yt=Math.cos(this._pitch)*this.cameraToCenterDistance/ot/t.b5(1,Se.lat),Ct=this.scaleZoom(yt/this.tileSize);this._elevation=Ie,this._center=Se,this.zoom=Ct}setLocationAtPoint(I,ne){const Te=this.pointCoordinate(ne),Se=this.pointCoordinate(this.centerPoint),Ie=this.locationCoordinate(I),ot=new t.Z(Ie.x-(Te.x-Se.x),Ie.y-(Te.y-Se.y));this.center=this.coordinateLocation(ot),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(I,ne){return ne?this.coordinatePoint(this.locationCoordinate(I),ne.getElevationForLngLatZoom(I,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(I))}pointLocation(I,ne){return this.coordinateLocation(this.pointCoordinate(I,ne))}locationCoordinate(I){return t.Z.fromLngLat(I)}coordinateLocation(I){return I&&I.toLngLat()}pointCoordinate(I,ne){if(ne){const Fr=ne.pointCoordinate(I);if(Fr!=null)return Fr}const Te=[I.x,I.y,0,1],Se=[I.x,I.y,1,1];t.af(Te,Te,this.pixelMatrixInverse),t.af(Se,Se,this.pixelMatrixInverse);const Ie=Te[3],ot=Se[3],yt=Te[1]/Ie,Ct=Se[1]/ot,Wt=Te[2]/Ie,nr=Se[2]/ot,or=Wt===nr?0:(0-Wt)/(nr-Wt);return new t.Z(t.y.number(Te[0]/Ie,Se[0]/ot,or)/this.worldSize,t.y.number(yt,Ct,or)/this.worldSize)}coordinatePoint(I,ne=0,Te=this.pixelMatrix){const Se=[I.x*this.worldSize,I.y*this.worldSize,ne,1];return t.af(Se,Se,Te),new t.P(Se[0]/Se[3],Se[1]/Se[3])}getBounds(){const I=Math.max(0,this.height/2-this.getHorizon());return new ie().extend(this.pointLocation(new t.P(0,I))).extend(this.pointLocation(new t.P(this.width,I))).extend(this.pointLocation(new t.P(this.width,this.height))).extend(this.pointLocation(new t.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new ie([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(I){I?(this.lngRange=[I.getWest(),I.getEast()],this.latRange=[I.getSouth(),I.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,au])}calculateTileMatrix(I){const ne=I.canonical,Te=this.worldSize/this.zoomScale(ne.z),Se=ne.x+Math.pow(2,ne.z)*I.wrap,Ie=t.an(new Float64Array(16));return t.J(Ie,Ie,[Se*Te,ne.y*Te,0]),t.K(Ie,Ie,[Te/t.X,Te/t.X,1]),Ie}calculatePosMatrix(I,ne=!1){const Te=I.key,Se=ne?this._alignedPosMatrixCache:this._posMatrixCache;if(Se[Te])return Se[Te];const Ie=this.calculateTileMatrix(I);return t.L(Ie,ne?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Ie),Se[Te]=new Float32Array(Ie),Se[Te]}calculateFogMatrix(I){const ne=I.key,Te=this._fogMatrixCache;if(Te[ne])return Te[ne];const Se=this.calculateTileMatrix(I);return t.L(Se,this.fogMatrix,Se),Te[ne]=new Float32Array(Se),Te[ne]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(I,ne){ne=t.ac(+ne,this.minZoom,this.maxZoom);const Te={center:new t.N(I.lng,I.lat),zoom:ne};let Se=this.lngRange;if(!this._renderWorldCopies&&Se===null){const gt=179.9999999999;Se=[-gt,gt]}const Ie=this.tileSize*this.zoomScale(Te.zoom);let ot=0,yt=Ie,Ct=0,Wt=Ie,nr=0,or=0;const{x:Fr,y:Wr}=this.size;if(this.latRange){const gt=this.latRange;ot=t.Q(gt[1])*Ie,yt=t.Q(gt[0])*Ie,yt-otyt&&(lt=yt-gt)}if(Se){const gt=(Ct+Wt)/2;let Et=je;this._renderWorldCopies&&(Et=t.b3(je,gt-Ie/2,gt+Ie/2));const Yt=Fr/2;Et-YtWt&&(at=Wt-Yt)}if(at!==void 0||lt!==void 0){const gt=new t.P(at??je,lt??Ze);Te.center=this.unproject.call({worldSize:Ie},gt).wrap()}return Te}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const I=this._unmodified,{center:ne,zoom:Te}=this.getConstrained(this.center,this.zoom);this.center=ne,this.zoom=Te,this._unmodified=I,this._constraining=!1}_calcMatrices(){if(!this.height)return;const I=this.centerOffset,ne=this.point.x,Te=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b5(1,this.center.lat)*this.worldSize;let Se=t.an(new Float64Array(16));t.K(Se,Se,[this.width/2,-this.height/2,1]),t.J(Se,Se,[1,-1,0]),this.labelPlaneMatrix=Se,Se=t.an(new Float64Array(16)),t.K(Se,Se,[1,-1,1]),t.J(Se,Se,[-1,-1,0]),t.K(Se,Se,[2/this.width,2/this.height,1]),this.glCoordMatrix=Se;const Ie=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),ot=Math.min(this.elevation,this.minElevationForCurrentTile),yt=Ie-ot*this._pixelPerMeter/Math.cos(this._pitch),Ct=ot<0?yt:Ie,Wt=Math.PI/2+this._pitch,nr=this._fov*(.5+I.y/this.height),or=Math.sin(nr)*Ct/Math.sin(t.ac(Math.PI-Wt-nr,.01,Math.PI-.01)),Fr=this.getHorizon(),Wr=2*Math.atan(Fr/this.cameraToCenterDistance)*(.5+I.y/(2*Fr)),je=Math.sin(Wr)*Ct/Math.sin(t.ac(Math.PI-Wt-Wr,.01,Math.PI-.01)),Ze=Math.min(or,je);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Ze+Ct),this.nearZ=this.height/50,Se=new Float64Array(16),t.b6(Se,this._fov,this.width/this.height,this.nearZ,this.farZ),Se[8]=2*-I.x/this.width,Se[9]=2*I.y/this.height,this.projectionMatrix=t.ae(Se),t.K(Se,Se,[1,-1,1]),t.J(Se,Se,[0,0,-this.cameraToCenterDistance]),t.b7(Se,Se,this._pitch),t.ad(Se,Se,this.angle),t.J(Se,Se,[-ne,-Te,0]),this.mercatorMatrix=t.K([],Se,[this.worldSize,this.worldSize,this.worldSize]),t.K(Se,Se,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.L(new Float64Array(16),this.labelPlaneMatrix,Se),t.J(Se,Se,[0,0,-this.elevation]),this.modelViewProjectionMatrix=Se,this.invModelViewProjectionMatrix=t.as([],Se),this.fogMatrix=new Float64Array(16),t.b6(this.fogMatrix,this._fov,this.width/this.height,Ie,this.farZ),this.fogMatrix[8]=2*-I.x/this.width,this.fogMatrix[9]=2*I.y/this.height,t.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),t.b7(this.fogMatrix,this.fogMatrix,this._pitch),t.ad(this.fogMatrix,this.fogMatrix,this.angle),t.J(this.fogMatrix,this.fogMatrix,[-ne,-Te,0]),t.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=t.L(new Float64Array(16),this.labelPlaneMatrix,Se);const at=this.width%2/2,lt=this.height%2/2,Tt=Math.cos(this.angle),gt=Math.sin(this.angle),Et=ne-Math.round(ne)+Tt*at+gt*lt,Yt=Te-Math.round(Te)+Tt*lt+gt*at,rr=new Float64Array(Se);if(t.J(rr,rr,[Et>.5?Et-1:Et,Yt>.5?Yt-1:Yt,0]),this.alignedModelViewProjectionMatrix=rr,Se=t.as(new Float64Array(16),this.pixelMatrix),!Se)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Se,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const I=this.pointCoordinate(new t.P(0,0)),ne=[I.x*this.worldSize,I.y*this.worldSize,0,1];return t.af(ne,ne,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const I=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,I))}getCameraQueryGeometry(I){const ne=this.getCameraPoint();if(I.length===1)return[I[0],ne];{let Te=ne.x,Se=ne.y,Ie=ne.x,ot=ne.y;for(const yt of I)Te=Math.min(Te,yt.x),Se=Math.min(Se,yt.y),Ie=Math.max(Ie,yt.x),ot=Math.max(ot,yt.y);return[new t.P(Te,Se),new t.P(Ie,Se),new t.P(Ie,ot),new t.P(Te,ot),new t.P(Te,Se)]}}lngLatToCameraDepth(I,ne){const Te=this.locationCoordinate(I),Se=[Te.x*this.worldSize,Te.y*this.worldSize,ne,1];return t.af(Se,Se,this.modelViewProjectionMatrix),Se[2]/Se[3]}}function yc(De,I){let ne,Te=!1,Se=null,Ie=null;const ot=()=>{Se=null,Te&&(De.apply(Ie,ne),Se=setTimeout(ot,I),Te=!1)};return(...yt)=>(Te=!0,Ie=this,ne=yt,Se||ot(),Se)}class Pu{constructor(I){this._getCurrentHash=()=>{const ne=window.location.hash.replace("#","");if(this._hashName){let Te;return ne.split("&").map(Se=>Se.split("=")).forEach(Se=>{Se[0]===this._hashName&&(Te=Se)}),(Te&&Te[1]||"").split("/")}return ne.split("/")},this._onHashChange=()=>{const ne=this._getCurrentHash();if(ne.length>=3&&!ne.some(Te=>isNaN(Te))){const Te=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(ne[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+ne[2],+ne[1]],zoom:+ne[0],bearing:Te,pitch:+(ne[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const ne=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,ne)},this._removeHash=()=>{const ne=this._getCurrentHash();if(ne.length===0)return;const Te=ne.join("/");let Se=Te;Se.split("&").length>0&&(Se=Se.split("&")[0]),this._hashName&&(Se=`${this._hashName}=${Te}`);let Ie=window.location.hash.replace(Se,"");Ie.startsWith("#&")?Ie=Ie.slice(0,1)+Ie.slice(2):Ie==="#"&&(Ie="");let ot=window.location.href.replace(/(#.+)?$/,Ie);ot=ot.replace("&&","&"),window.history.replaceState(window.history.state,null,ot)},this._updateHash=yc(this._updateHashUnthrottled,300),this._hashName=I&&encodeURIComponent(I)}addTo(I){return this._map=I,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(I){const ne=this._map.getCenter(),Te=Math.round(100*this._map.getZoom())/100,Se=Math.ceil((Te*Math.LN2+Math.log(512/360/.5))/Math.LN10),Ie=Math.pow(10,Se),ot=Math.round(ne.lng*Ie)/Ie,yt=Math.round(ne.lat*Ie)/Ie,Ct=this._map.getBearing(),Wt=this._map.getPitch();let nr="";if(nr+=I?`/${ot}/${yt}/${Te}`:`${Te}/${yt}/${ot}`,(Ct||Wt)&&(nr+="/"+Math.round(10*Ct)/10),Wt&&(nr+=`/${Math.round(Wt)}`),this._hashName){const or=this._hashName;let Fr=!1;const Wr=window.location.hash.slice(1).split("&").map(je=>{const Ze=je.split("=")[0];return Ze===or?(Fr=!0,`${Ze}=${nr}`):je}).filter(je=>je);return Fr||Wr.push(`${or}=${nr}`),`#${Wr.join("&")}`}return`#${nr}`}}const ec={linearity:.3,easing:t.b8(0,0,.3,1)},Ec=t.e({deceleration:2500,maxSpeed:1400},ec),Cf=t.e({deceleration:20,maxSpeed:1400},ec),nh=t.e({deceleration:1e3,maxSpeed:360},ec),lc=t.e({deceleration:1e3,maxSpeed:90},ec);class kc{constructor(I){this._map=I,this.clear()}clear(){this._inertiaBuffer=[]}record(I){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:i.now(),settings:I})}_drainInertiaBuffer(){const I=this._inertiaBuffer,ne=i.now();for(;I.length>0&&ne-I[0].time>160;)I.shift()}_onMoveEnd(I){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const ne={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:Ie}of this._inertiaBuffer)ne.zoom+=Ie.zoomDelta||0,ne.bearing+=Ie.bearingDelta||0,ne.pitch+=Ie.pitchDelta||0,Ie.panDelta&&ne.pan._add(Ie.panDelta),Ie.around&&(ne.around=Ie.around),Ie.pinchAround&&(ne.pinchAround=Ie.pinchAround);const Te=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,Se={};if(ne.pan.mag()){const Ie=tf(ne.pan.mag(),Te,t.e({},Ec,I||{}));Se.offset=ne.pan.mult(Ie.amount/ne.pan.mag()),Se.center=this._map.transform.center,nu(Se,Ie)}if(ne.zoom){const Ie=tf(ne.zoom,Te,Cf);Se.zoom=this._map.transform.zoom+Ie.amount,nu(Se,Ie)}if(ne.bearing){const Ie=tf(ne.bearing,Te,nh);Se.bearing=this._map.transform.bearing+t.ac(Ie.amount,-179,179),nu(Se,Ie)}if(ne.pitch){const Ie=tf(ne.pitch,Te,lc);Se.pitch=this._map.transform.pitch+Ie.amount,nu(Se,Ie)}if(Se.zoom||Se.bearing){const Ie=ne.pinchAround===void 0?ne.around:ne.pinchAround;Se.around=Ie?this._map.unproject(Ie):this._map.getCenter()}return this.clear(),t.e(Se,{noMoveStart:!0})}}function nu(De,I){(!De.duration||De.durationne.unproject(Ct)),yt=Ie.reduce((Ct,Wt,nr,or)=>Ct.add(Wt.div(or.length)),new t.P(0,0));super(I,{points:Ie,point:yt,lngLats:ot,lngLat:ne.unproject(yt),originalEvent:Te}),this._defaultPrevented=!1}}class rf extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(I,ne,Te){super(I,{originalEvent:Te}),this._defaultPrevented=!1}}class mc{constructor(I,ne){this._map=I,this._clickTolerance=ne.clickTolerance}reset(){delete this._mousedownPos}wheel(I){return this._firePreventable(new rf(I.type,this._map,I))}mousedown(I,ne){return this._mousedownPos=ne,this._firePreventable(new Cl(I.type,this._map,I))}mouseup(I){this._map.fire(new Cl(I.type,this._map,I))}click(I,ne){this._mousedownPos&&this._mousedownPos.dist(ne)>=this._clickTolerance||this._map.fire(new Cl(I.type,this._map,I))}dblclick(I){return this._firePreventable(new Cl(I.type,this._map,I))}mouseover(I){this._map.fire(new Cl(I.type,this._map,I))}mouseout(I){this._map.fire(new Cl(I.type,this._map,I))}touchstart(I){return this._firePreventable(new uc(I.type,this._map,I))}touchmove(I){this._map.fire(new uc(I.type,this._map,I))}touchend(I){this._map.fire(new uc(I.type,this._map,I))}touchcancel(I){this._map.fire(new uc(I.type,this._map,I))}_firePreventable(I){if(this._map.fire(I),I.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Us{constructor(I){this._map=I}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(I){this._map.fire(new Cl(I.type,this._map,I))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Cl("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(I){this._delayContextMenu?this._contextMenuEvent=I:this._ignoreContextMenu||this._map.fire(new Cl(I.type,this._map,I)),this._map.listens("contextmenu")&&I.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class vu{constructor(I){this._map=I}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(I){return this.transform.pointLocation(t.P.convert(I),this._map.terrain)}}class du{constructor(I,ne){this._map=I,this._tr=new vu(I),this._el=I.getCanvasContainer(),this._container=I.getContainer(),this._clickTolerance=ne.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(I,ne){this.isEnabled()&&I.shiftKey&&I.button===0&&(n.disableDrag(),this._startPos=this._lastPos=ne,this._active=!0)}mousemoveWindow(I,ne){if(!this._active)return;const Te=ne;if(this._lastPos.equals(Te)||!this._box&&Te.dist(this._startPos)Ie.fitScreenCoordinates(Te,Se,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",I)}keydown(I){this._active&&I.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",I))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(n.remove(this._box),this._box=null),n.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(I,ne){return this._map.fire(new t.k(I,{originalEvent:ne}))}}function af(De,I){if(De.length!==I.length)throw new Error(`The number of touches and points are not equal - touches ${De.length}, points ${I.length}`);const ne={};for(let Te=0;Tethis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=I.timeStamp),Te.length===this.numTouches&&(this.centroid=function(Se){const Ie=new t.P(0,0);for(const ot of Se)Ie._add(ot);return Ie.div(Se.length)}(ne),this.touches=af(Te,ne)))}touchmove(I,ne,Te){if(this.aborted||!this.centroid)return;const Se=af(Te,ne);for(const Ie in this.touches){const ot=Se[Ie];(!ot||ot.dist(this.touches[Ie])>30)&&(this.aborted=!0)}}touchend(I,ne,Te){if((!this.centroid||I.timeStamp-this.startTime>500)&&(this.aborted=!0),Te.length===0){const Se=!this.aborted&&this.centroid;if(this.reset(),Se)return Se}}}class _c{constructor(I){this.singleTap=new Rs(I),this.numTaps=I.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(I,ne,Te){this.singleTap.touchstart(I,ne,Te)}touchmove(I,ne,Te){this.singleTap.touchmove(I,ne,Te)}touchend(I,ne,Te){const Se=this.singleTap.touchend(I,ne,Te);if(Se){const Ie=I.timeStamp-this.lastTime<500,ot=!this.lastTap||this.lastTap.dist(Se)<30;if(Ie&&ot||this.reset(),this.count++,this.lastTime=I.timeStamp,this.lastTap=Se,this.count===this.numTaps)return this.reset(),Se}}}class ju{constructor(I){this._tr=new vu(I),this._zoomIn=new _c({numTouches:1,numTaps:2}),this._zoomOut=new _c({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(I,ne,Te){this._zoomIn.touchstart(I,ne,Te),this._zoomOut.touchstart(I,ne,Te)}touchmove(I,ne,Te){this._zoomIn.touchmove(I,ne,Te),this._zoomOut.touchmove(I,ne,Te)}touchend(I,ne,Te){const Se=this._zoomIn.touchend(I,ne,Te),Ie=this._zoomOut.touchend(I,ne,Te),ot=this._tr;return Se?(this._active=!0,I.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:yt=>yt.easeTo({duration:300,zoom:ot.zoom+1,around:ot.unproject(Se)},{originalEvent:I})}):Ie?(this._active=!0,I.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:yt=>yt.easeTo({duration:300,zoom:ot.zoom-1,around:ot.unproject(Ie)},{originalEvent:I})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class iu{constructor(I){this._enabled=!!I.enable,this._moveStateManager=I.moveStateManager,this._clickTolerance=I.clickTolerance||1,this._moveFunction=I.move,this._activateOnStart=!!I.activateOnStart,I.assignEvents(this),this.reset()}reset(I){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(I)}_move(...I){const ne=this._moveFunction(...I);if(ne.bearingDelta||ne.pitchDelta||ne.around||ne.panDelta)return this._active=!0,ne}dragStart(I,ne){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(I)&&(this._moveStateManager.startMove(I),this._lastPoint=ne.length?ne[0]:ne,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(I,ne){if(!this.isEnabled())return;const Te=this._lastPoint;if(!Te)return;if(I.preventDefault(),!this._moveStateManager.isValidMoveEvent(I))return void this.reset(I);const Se=ne.length?ne[0]:ne;return!this._moved&&Se.dist(Te){De.mousedown=De.dragStart,De.mousemoveWindow=De.dragMove,De.mouseup=De.dragEnd,De.contextmenu=I=>{I.preventDefault()}},xl=({enable:De,clickTolerance:I,bearingDegreesPerPixelMoved:ne=.8})=>{const Te=new Iu({checkCorrectEvent:Se=>n.mouseButton(Se)===0&&Se.ctrlKey||n.mouseButton(Se)===2});return new iu({clickTolerance:I,move:(Se,Ie)=>({bearingDelta:(Ie.x-Se.x)*ne}),moveStateManager:Te,enable:De,assignEvents:Lf})},nf=({enable:De,clickTolerance:I,pitchDegreesPerPixelMoved:ne=-.5})=>{const Te=new Iu({checkCorrectEvent:Se=>n.mouseButton(Se)===0&&Se.ctrlKey||n.mouseButton(Se)===2});return new iu({clickTolerance:I,move:(Se,Ie)=>({pitchDelta:(Ie.y-Se.y)*ne}),moveStateManager:Te,enable:De,assignEvents:Lf})};class ou{constructor(I,ne){this._clickTolerance=I.clickTolerance||1,this._map=ne,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(I){return I<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(I,ne,Te){return this._calculateTransform(I,ne,Te)}touchmove(I,ne,Te){if(this._active){if(!this._shouldBePrevented(Te.length))return I.preventDefault(),this._calculateTransform(I,ne,Te);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",I)}}touchend(I,ne,Te){this._calculateTransform(I,ne,Te),this._active&&this._shouldBePrevented(Te.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(I,ne,Te){Te.length>0&&(this._active=!0);const Se=af(Te,ne),Ie=new t.P(0,0),ot=new t.P(0,0);let yt=0;for(const Wt in Se){const nr=Se[Wt],or=this._touches[Wt];or&&(Ie._add(nr),ot._add(nr.sub(or)),yt++,Se[Wt]=nr)}if(this._touches=Se,this._shouldBePrevented(yt)||!ot.mag())return;const Ct=ot.div(yt);return this._sum._add(Ct),this._sum.mag()Math.abs(De.x)}class Cc extends Ru{constructor(I){super(),this._currentTouchCount=0,this._map=I}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(I,ne,Te){super.touchstart(I,ne,Te),this._currentTouchCount=Te.length}_start(I){this._lastPoints=I,Su(I[0].sub(I[1]))&&(this._valid=!1)}_move(I,ne,Te){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const Se=I[0].sub(this._lastPoints[0]),Ie=I[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(Se,Ie,Te.timeStamp),this._valid?(this._lastPoints=I,this._active=!0,{pitchDelta:(Se.y+Ie.y)/2*-.5}):void 0}gestureBeginsVertically(I,ne,Te){if(this._valid!==void 0)return this._valid;const Se=I.mag()>=2,Ie=ne.mag()>=2;if(!Se&&!Ie)return;if(!Se||!Ie)return this._firstMove===void 0&&(this._firstMove=Te),Te-this._firstMove<100&&void 0;const ot=I.y>0==ne.y>0;return Su(I)&&Su(ne)&&ot}}const Ht={panStep:100,bearingStep:15,pitchStep:10};class ur{constructor(I){this._tr=new vu(I);const ne=Ht;this._panStep=ne.panStep,this._bearingStep=ne.bearingStep,this._pitchStep=ne.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(I){if(I.altKey||I.ctrlKey||I.metaKey)return;let ne=0,Te=0,Se=0,Ie=0,ot=0;switch(I.keyCode){case 61:case 107:case 171:case 187:ne=1;break;case 189:case 109:case 173:ne=-1;break;case 37:I.shiftKey?Te=-1:(I.preventDefault(),Ie=-1);break;case 39:I.shiftKey?Te=1:(I.preventDefault(),Ie=1);break;case 38:I.shiftKey?Se=1:(I.preventDefault(),ot=-1);break;case 40:I.shiftKey?Se=-1:(I.preventDefault(),ot=1);break;default:return}return this._rotationDisabled&&(Te=0,Se=0),{cameraAnimation:yt=>{const Ct=this._tr;yt.easeTo({duration:300,easeId:"keyboardHandler",easing:qr,zoom:ne?Math.round(Ct.zoom)+ne*(I.shiftKey?2:1):Ct.zoom,bearing:Ct.bearing+Te*this._bearingStep,pitch:Ct.pitch+Se*this._pitchStep,offset:[-Ie*this._panStep,-ot*this._panStep],center:Ct.center},{originalEvent:I})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function qr(De){return De*(2-De)}const Or=4.000244140625;class ua{constructor(I,ne){this._onTimeout=Te=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Te)},this._map=I,this._tr=new vu(I),this._triggerRenderFrame=ne,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(I){this._defaultZoomRate=I}setWheelZoomRate(I){this._wheelZoomRate=I}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(I){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!I&&I.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(I){return!!this._map.cooperativeGestures.isEnabled()&&!(I.ctrlKey||this._map.cooperativeGestures.isBypassed(I))}wheel(I){if(!this.isEnabled())return;if(this._shouldBePrevented(I))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",I);let ne=I.deltaMode===WheelEvent.DOM_DELTA_LINE?40*I.deltaY:I.deltaY;const Te=i.now(),Se=Te-(this._lastWheelEventTime||0);this._lastWheelEventTime=Te,ne!==0&&ne%Or==0?this._type="wheel":ne!==0&&Math.abs(ne)<4?this._type="trackpad":Se>400?(this._type=null,this._lastValue=ne,this._timeout=setTimeout(this._onTimeout,40,I)):this._type||(this._type=Math.abs(Se*ne)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,ne+=this._lastValue)),I.shiftKey&&ne&&(ne/=4),this._type&&(this._lastWheelEvent=I,this._delta-=ne,this._active||this._start(I)),I.preventDefault()}_start(I){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const ne=n.mousePos(this._map.getCanvas(),I),Te=this._tr;this._around=ne.y>Te.transform.height/2-Te.transform.getHorizon()?t.N.convert(this._aroundCenter?Te.center:Te.unproject(ne)):t.N.convert(Te.center),this._aroundPoint=Te.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const I=this._tr.transform;if(this._delta!==0){const Ct=this._type==="wheel"&&Math.abs(this._delta)>Or?this._wheelZoomRate:this._defaultZoomRate;let Wt=2/(1+Math.exp(-Math.abs(this._delta*Ct)));this._delta<0&&Wt!==0&&(Wt=1/Wt);const nr=typeof this._targetZoom=="number"?I.zoomScale(this._targetZoom):I.scale;this._targetZoom=Math.min(I.maxZoom,Math.max(I.minZoom,I.scaleZoom(nr*Wt))),this._type==="wheel"&&(this._startZoom=I.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const ne=typeof this._targetZoom=="number"?this._targetZoom:I.zoom,Te=this._startZoom,Se=this._easing;let Ie,ot=!1;const yt=i.now()-this._lastWheelEventTime;if(this._type==="wheel"&&Te&&Se&&yt){const Ct=Math.min(yt/200,1),Wt=Se(Ct);Ie=t.y.number(Te,ne,Wt),Ct<1?this._frameId||(this._frameId=!0):ot=!0}else Ie=ne,ot=!0;return this._active=!0,ot&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ot,zoomDelta:Ie-I.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(I){let ne=t.b9;if(this._prevEase){const Te=this._prevEase,Se=(i.now()-Te.start)/Te.duration,Ie=Te.easing(Se+.01)-Te.easing(Se),ot=.27/Math.sqrt(Ie*Ie+1e-4)*.01,yt=Math.sqrt(.0729-ot*ot);ne=t.b8(ot,yt,.25,1)}return this._prevEase={start:i.now(),duration:I,easing:ne},ne}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Fa{constructor(I,ne){this._clickZoom=I,this._tapZoom=ne}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class ja{constructor(I){this._tr=new vu(I),this.reset()}reset(){this._active=!1}dblclick(I,ne){return I.preventDefault(),{cameraAnimation:Te=>{Te.easeTo({duration:300,zoom:this._tr.zoom+(I.shiftKey?-1:1),around:this._tr.unproject(ne)},{originalEvent:I})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class sn{constructor(){this._tap=new _c({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(I,ne,Te){if(!this._swipePoint)if(this._tapTime){const Se=ne[0],Ie=I.timeStamp-this._tapTime<500,ot=this._tapPoint.dist(Se)<30;Ie&&ot?Te.length>0&&(this._swipePoint=Se,this._swipeTouch=Te[0].identifier):this.reset()}else this._tap.touchstart(I,ne,Te)}touchmove(I,ne,Te){if(this._tapTime){if(this._swipePoint){if(Te[0].identifier!==this._swipeTouch)return;const Se=ne[0],Ie=Se.y-this._swipePoint.y;return this._swipePoint=Se,I.preventDefault(),this._active=!0,{zoomDelta:Ie/128}}}else this._tap.touchmove(I,ne,Te)}touchend(I,ne,Te){if(this._tapTime)this._swipePoint&&Te.length===0&&this.reset();else{const Se=this._tap.touchend(I,ne,Te);Se&&(this._tapTime=I.timeStamp,this._tapPoint=Se)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gn{constructor(I,ne,Te){this._el=I,this._mousePan=ne,this._touchPan=Te}enable(I){this._inertiaOptions=I||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class kn{constructor(I,ne,Te){this._pitchWithRotate=I.pitchWithRotate,this._mouseRotate=ne,this._mousePitch=Te}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Ja{constructor(I,ne,Te,Se){this._el=I,this._touchZoom=ne,this._touchRotate=Te,this._tapDragZoom=Se,this._rotationDisabled=!1,this._enabled=!0}enable(I){this._touchZoom.enable(I),this._rotationDisabled||this._touchRotate.enable(I),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class _n{constructor(I,ne){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=I,this._options=ne,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const I=this._map.getCanvasContainer();I.classList.add("maplibregl-cooperative-gestures"),this._container=n.create("div","maplibregl-cooperative-gesture-screen",I);let ne=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(ne=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const Te=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),Se=document.createElement("div");Se.className="maplibregl-desktop-message",Se.textContent=ne,this._container.appendChild(Se);const Ie=document.createElement("div");Ie.className="maplibregl-mobile-message",Ie.textContent=Te,this._container.appendChild(Ie),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(n.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(I){return I[this._bypassKey]}notifyGestureBlocked(I,ne){this._enabled&&(this._map.fire(new t.k("cooperativegestureprevented",{gestureType:I,originalEvent:ne})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const on=De=>De.zoom||De.drag||De.pitch||De.rotate;class Wa extends t.k{}function On(De){return De.panDelta&&De.panDelta.mag()||De.zoomDelta||De.bearingDelta||De.pitchDelta}class zi{constructor(I,ne){this.handleWindowEvent=Se=>{this.handleEvent(Se,`${Se.type}Window`)},this.handleEvent=(Se,Ie)=>{if(Se.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const ot=Se.type==="renderFrame"?void 0:Se,yt={needsRenderFrame:!1},Ct={},Wt={},nr=Se.touches,or=nr?this._getMapTouches(nr):void 0,Fr=or?n.touchPos(this._map.getCanvas(),or):n.mousePos(this._map.getCanvas(),Se);for(const{handlerName:Ze,handler:at,allowed:lt}of this._handlers){if(!at.isEnabled())continue;let Tt;this._blockedByActive(Wt,lt,Ze)?at.reset():at[Ie||Se.type]&&(Tt=at[Ie||Se.type](Se,Fr,or),this.mergeHandlerResult(yt,Ct,Tt,Ze,ot),Tt&&Tt.needsRenderFrame&&this._triggerRenderFrame()),(Tt||at.isActive())&&(Wt[Ze]=at)}const Wr={};for(const Ze in this._previousActiveHandlers)Wt[Ze]||(Wr[Ze]=ot);this._previousActiveHandlers=Wt,(Object.keys(Wr).length||On(yt))&&(this._changes.push([yt,Ct,Wr]),this._triggerRenderFrame()),(Object.keys(Wt).length||On(yt))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:je}=yt;je&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],je(this._map))},this._map=I,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new kc(I),this._bearingSnap=ne.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(ne);const Te=this._el;this._listeners=[[Te,"touchstart",{passive:!0}],[Te,"touchmove",{passive:!1}],[Te,"touchend",void 0],[Te,"touchcancel",void 0],[Te,"mousedown",void 0],[Te,"mousemove",void 0],[Te,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[Te,"mouseover",void 0],[Te,"mouseout",void 0],[Te,"dblclick",void 0],[Te,"click",void 0],[Te,"keydown",{capture:!1}],[Te,"keyup",void 0],[Te,"wheel",{passive:!1}],[Te,"contextmenu",void 0],[window,"blur",void 0]];for(const[Se,Ie,ot]of this._listeners)n.addEventListener(Se,Ie,Se===document?this.handleWindowEvent:this.handleEvent,ot)}destroy(){for(const[I,ne,Te]of this._listeners)n.removeEventListener(I,ne,I===document?this.handleWindowEvent:this.handleEvent,Te)}_addDefaultHandlers(I){const ne=this._map,Te=ne.getCanvasContainer();this._add("mapEvent",new mc(ne,I));const Se=ne.boxZoom=new du(ne,I);this._add("boxZoom",Se),I.interactive&&I.boxZoom&&Se.enable();const Ie=ne.cooperativeGestures=new _n(ne,I.cooperativeGestures);this._add("cooperativeGestures",Ie),I.cooperativeGestures&&Ie.enable();const ot=new ju(ne),yt=new ja(ne);ne.doubleClickZoom=new Fa(yt,ot),this._add("tapZoom",ot),this._add("clickZoom",yt),I.interactive&&I.doubleClickZoom&&ne.doubleClickZoom.enable();const Ct=new sn;this._add("tapDragZoom",Ct);const Wt=ne.touchPitch=new Cc(ne);this._add("touchPitch",Wt),I.interactive&&I.touchPitch&&ne.touchPitch.enable(I.touchPitch);const nr=xl(I),or=nf(I);ne.dragRotate=new kn(I,nr,or),this._add("mouseRotate",nr,["mousePitch"]),this._add("mousePitch",or,["mouseRotate"]),I.interactive&&I.dragRotate&&ne.dragRotate.enable();const Fr=(({enable:Tt,clickTolerance:gt})=>{const Et=new Iu({checkCorrectEvent:Yt=>n.mouseButton(Yt)===0&&!Yt.ctrlKey});return new iu({clickTolerance:gt,move:(Yt,rr)=>({around:rr,panDelta:rr.sub(Yt)}),activateOnStart:!0,moveStateManager:Et,enable:Tt,assignEvents:Lf})})(I),Wr=new ou(I,ne);ne.dragPan=new gn(Te,Fr,Wr),this._add("mousePan",Fr),this._add("touchPan",Wr,["touchZoom","touchRotate"]),I.interactive&&I.dragPan&&ne.dragPan.enable(I.dragPan);const je=new tc,Ze=new Ol;ne.touchZoomRotate=new Ja(Te,Ze,je,Ct),this._add("touchRotate",je,["touchPan","touchZoom"]),this._add("touchZoom",Ze,["touchPan","touchRotate"]),I.interactive&&I.touchZoomRotate&&ne.touchZoomRotate.enable(I.touchZoomRotate);const at=ne.scrollZoom=new ua(ne,()=>this._triggerRenderFrame());this._add("scrollZoom",at,["mousePan"]),I.interactive&&I.scrollZoom&&ne.scrollZoom.enable(I.scrollZoom);const lt=ne.keyboard=new ur(ne);this._add("keyboard",lt),I.interactive&&I.keyboard&&ne.keyboard.enable(),this._add("blockableMapEvent",new Us(ne))}_add(I,ne,Te){this._handlers.push({handlerName:I,handler:ne,allowed:Te}),this._handlersById[I]=ne}stop(I){if(!this._updatingCamera){for(const{handler:ne}of this._handlers)ne.reset();this._inertia.clear(),this._fireEvents({},{},I),this._changes=[]}}isActive(){for(const{handler:I}of this._handlers)if(I.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!on(this._eventsInProgress)||this.isZooming()}_blockedByActive(I,ne,Te){for(const Se in I)if(Se!==Te&&(!ne||ne.indexOf(Se)<0))return!0;return!1}_getMapTouches(I){const ne=[];for(const Te of I)this._el.contains(Te.target)&&ne.push(Te);return ne}mergeHandlerResult(I,ne,Te,Se,Ie){if(!Te)return;t.e(I,Te);const ot={handlerName:Se,originalEvent:Te.originalEvent||Ie};Te.zoomDelta!==void 0&&(ne.zoom=ot),Te.panDelta!==void 0&&(ne.drag=ot),Te.pitchDelta!==void 0&&(ne.pitch=ot),Te.bearingDelta!==void 0&&(ne.rotate=ot)}_applyChanges(){const I={},ne={},Te={};for(const[Se,Ie,ot]of this._changes)Se.panDelta&&(I.panDelta=(I.panDelta||new t.P(0,0))._add(Se.panDelta)),Se.zoomDelta&&(I.zoomDelta=(I.zoomDelta||0)+Se.zoomDelta),Se.bearingDelta&&(I.bearingDelta=(I.bearingDelta||0)+Se.bearingDelta),Se.pitchDelta&&(I.pitchDelta=(I.pitchDelta||0)+Se.pitchDelta),Se.around!==void 0&&(I.around=Se.around),Se.pinchAround!==void 0&&(I.pinchAround=Se.pinchAround),Se.noInertia&&(I.noInertia=Se.noInertia),t.e(ne,Ie),t.e(Te,ot);this._updateMapTransform(I,ne,Te),this._changes=[]}_updateMapTransform(I,ne,Te){const Se=this._map,Ie=Se._getTransformForUpdate(),ot=Se.terrain;if(!(On(I)||ot&&this._terrainMovement))return this._fireEvents(ne,Te,!0);let{panDelta:yt,zoomDelta:Ct,bearingDelta:Wt,pitchDelta:nr,around:or,pinchAround:Fr}=I;Fr!==void 0&&(or=Fr),Se._stop(!0),or=or||Se.transform.centerPoint;const Wr=Ie.pointLocation(yt?or.sub(yt):or);Wt&&(Ie.bearing+=Wt),nr&&(Ie.pitch+=nr),Ct&&(Ie.zoom+=Ct),ot?this._terrainMovement||!ne.drag&&!ne.zoom?ne.drag&&this._terrainMovement?Ie.center=Ie.pointLocation(Ie.centerPoint.sub(yt)):Ie.setLocationAtPoint(Wr,or):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Ie.setLocationAtPoint(Wr,or)):Ie.setLocationAtPoint(Wr,or),Se._applyUpdatedTransform(Ie),this._map._update(),I.noInertia||this._inertia.record(I),this._fireEvents(ne,Te,!0)}_fireEvents(I,ne,Te){const Se=on(this._eventsInProgress),Ie=on(I),ot={};for(const or in I){const{originalEvent:Fr}=I[or];this._eventsInProgress[or]||(ot[`${or}start`]=Fr),this._eventsInProgress[or]=I[or]}!Se&&Ie&&this._fireEvent("movestart",Ie.originalEvent);for(const or in ot)this._fireEvent(or,ot[or]);Ie&&this._fireEvent("move",Ie.originalEvent);for(const or in I){const{originalEvent:Fr}=I[or];this._fireEvent(or,Fr)}const yt={};let Ct;for(const or in this._eventsInProgress){const{handlerName:Fr,originalEvent:Wr}=this._eventsInProgress[or];this._handlersById[Fr].isActive()||(delete this._eventsInProgress[or],Ct=ne[Fr]||Wr,yt[`${or}end`]=Ct)}for(const or in yt)this._fireEvent(or,yt[or]);const Wt=on(this._eventsInProgress),nr=(Se||Ie)&&!Wt;if(nr&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const or=this._map._getTransformForUpdate();or.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(or)}if(Te&&nr){this._updatingCamera=!0;const or=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Fr=Wr=>Wr!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Wa("renderFrame",{timeStamp:I})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class ki extends t.E{constructor(I,ne){super(),this._renderFrameCallback=()=>{const Te=Math.min((i.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Te)),Te<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=I,this._bearingSnap=ne.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new t.N(this.transform.center.lng,this.transform.center.lat)}setCenter(I,ne){return this.jumpTo({center:I},ne)}panBy(I,ne,Te){return I=t.P.convert(I).mult(-1),this.panTo(this.transform.center,t.e({offset:I},ne),Te)}panTo(I,ne,Te){return this.easeTo(t.e({center:I},ne),Te)}getZoom(){return this.transform.zoom}setZoom(I,ne){return this.jumpTo({zoom:I},ne),this}zoomTo(I,ne,Te){return this.easeTo(t.e({zoom:I},ne),Te)}zoomIn(I,ne){return this.zoomTo(this.getZoom()+1,I,ne),this}zoomOut(I,ne){return this.zoomTo(this.getZoom()-1,I,ne),this}getBearing(){return this.transform.bearing}setBearing(I,ne){return this.jumpTo({bearing:I},ne),this}getPadding(){return this.transform.padding}setPadding(I,ne){return this.jumpTo({padding:I},ne),this}rotateTo(I,ne,Te){return this.easeTo(t.e({bearing:I},ne),Te)}resetNorth(I,ne){return this.rotateTo(0,t.e({duration:1e3},I),ne),this}resetNorthPitch(I,ne){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},I),ne),this}snapToNorth(I,ne){return Math.abs(this.getBearing()){if(this._zooming&&(Se.zoom=t.y.number(Ie,at,sr)),this._rotating&&(Se.bearing=t.y.number(ot,Wt,sr)),this._pitching&&(Se.pitch=t.y.number(yt,nr,sr)),this._padding&&(Se.interpolatePadding(Ct,or,sr),Wr=Se.centerPoint.add(Fr)),this.terrain&&!I.freezeElevation&&this._updateElevation(sr),Et)Se.setLocationAtPoint(Et,Yt);else{const Sr=Se.zoomScale(Se.zoom-Ie),Nr=at>Ie?Math.min(2,gt):Math.max(.5,gt),Qr=Math.pow(Nr,1-sr),ia=Se.unproject(lt.add(Tt.mult(sr*Qr)).mult(Sr));Se.setLocationAtPoint(Se.renderWorldCopies?ia.wrap():ia,Wr)}this._applyUpdatedTransform(Se),this._fireMoveEvents(ne)},sr=>{this.terrain&&I.freezeElevation&&this._finalizeElevation(),this._afterEase(ne,sr)},I),this}_prepareEase(I,ne,Te={}){this._moving=!0,ne||Te.moving||this.fire(new t.k("movestart",I)),this._zooming&&!Te.zooming&&this.fire(new t.k("zoomstart",I)),this._rotating&&!Te.rotating&&this.fire(new t.k("rotatestart",I)),this._pitching&&!Te.pitching&&this.fire(new t.k("pitchstart",I))}_prepareElevation(I){this._elevationCenter=I,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(I,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(I){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const ne=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(I<1&&ne!==this._elevationTarget){const Te=this._elevationTarget-this._elevationStart;this._elevationStart+=I*(Te-(ne-(Te*I+this._elevationStart))/(1-I)),this._elevationTarget=ne}this.transform.elevation=t.y.number(this._elevationStart,this._elevationTarget,I)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(I){const ne=I.getCameraPosition(),Te=this.terrain.getElevationForLngLatZoom(ne.lngLat,I.zoom);if(ne.altitudethis._elevateCameraIfInsideTerrain(Se)),this.transformCameraUpdate&&ne.push(Se=>this.transformCameraUpdate(Se)),!ne.length)return;const Te=I.clone();for(const Se of ne){const Ie=Te.clone(),{center:ot,zoom:yt,pitch:Ct,bearing:Wt,elevation:nr}=Se(Ie);ot&&(Ie.center=ot),yt!==void 0&&(Ie.zoom=yt),Ct!==void 0&&(Ie.pitch=Ct),Wt!==void 0&&(Ie.bearing=Wt),nr!==void 0&&(Ie.elevation=nr),Te.apply(Ie)}this.transform.apply(Te)}_fireMoveEvents(I){this.fire(new t.k("move",I)),this._zooming&&this.fire(new t.k("zoom",I)),this._rotating&&this.fire(new t.k("rotate",I)),this._pitching&&this.fire(new t.k("pitch",I))}_afterEase(I,ne){if(this._easeId&&ne&&this._easeId===ne)return;delete this._easeId;const Te=this._zooming,Se=this._rotating,Ie=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Te&&this.fire(new t.k("zoomend",I)),Se&&this.fire(new t.k("rotateend",I)),Ie&&this.fire(new t.k("pitchend",I)),this.fire(new t.k("moveend",I))}flyTo(I,ne){var Te;if(!I.essential&&i.prefersReducedMotion){const ln=t.M(I,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ln,ne)}this.stop(),I=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},I);const Se=this._getTransformForUpdate(),Ie=Se.zoom,ot=Se.bearing,yt=Se.pitch,Ct=Se.padding,Wt="bearing"in I?this._normalizeBearing(I.bearing,ot):ot,nr="pitch"in I?+I.pitch:yt,or="padding"in I?I.padding:Se.padding,Fr=t.P.convert(I.offset);let Wr=Se.centerPoint.add(Fr);const je=Se.pointLocation(Wr),{center:Ze,zoom:at}=Se.getConstrained(t.N.convert(I.center||je),(Te=I.zoom)!==null&&Te!==void 0?Te:Ie);this._normalizeCenter(Ze,Se);const lt=Se.zoomScale(at-Ie),Tt=Se.project(je),gt=Se.project(Ze).sub(Tt);let Et=I.curve;const Yt=Math.max(Se.width,Se.height),rr=Yt/lt,sr=gt.mag();if("minZoom"in I){const ln=t.ac(Math.min(I.minZoom,Ie,at),Se.minZoom,Se.maxZoom),Nn=Yt/Se.zoomScale(ln-Ie);Et=Math.sqrt(Nn/sr*2)}const Sr=Et*Et;function Nr(ln){const Nn=(rr*rr-Yt*Yt+(ln?-1:1)*Sr*Sr*sr*sr)/(2*(ln?rr:Yt)*Sr*sr);return Math.log(Math.sqrt(Nn*Nn+1)-Nn)}function Qr(ln){return(Math.exp(ln)-Math.exp(-ln))/2}function ia(ln){return(Math.exp(ln)+Math.exp(-ln))/2}const _a=Nr(!1);let za=function(ln){return ia(_a)/ia(_a+Et*ln)},nn=function(ln){return Yt*((ia(_a)*(Qr(Nn=_a+Et*ln)/ia(Nn))-Qr(_a))/Sr)/sr;var Nn},en=(Nr(!0)-_a)/Et;if(Math.abs(sr)<1e-6||!isFinite(en)){if(Math.abs(Yt-rr)<1e-6)return this.easeTo(I,ne);const ln=rr0,za=Nn=>Math.exp(ln*Et*Nn)}return I.duration="duration"in I?+I.duration:1e3*en/("screenSpeed"in I?+I.screenSpeed/Et:+I.speed),I.maxDuration&&I.duration>I.maxDuration&&(I.duration=0),this._zooming=!0,this._rotating=ot!==Wt,this._pitching=nr!==yt,this._padding=!Se.isPaddingEqual(or),this._prepareEase(ne,!1),this.terrain&&this._prepareElevation(Ze),this._ease(ln=>{const Nn=ln*en,pi=1/za(Nn);Se.zoom=ln===1?at:Ie+Se.scaleZoom(pi),this._rotating&&(Se.bearing=t.y.number(ot,Wt,ln)),this._pitching&&(Se.pitch=t.y.number(yt,nr,ln)),this._padding&&(Se.interpolatePadding(Ct,or,ln),Wr=Se.centerPoint.add(Fr)),this.terrain&&!I.freezeElevation&&this._updateElevation(ln);const ii=ln===1?Ze:Se.unproject(Tt.add(gt.mult(nn(Nn))).mult(pi));Se.setLocationAtPoint(Se.renderWorldCopies?ii.wrap():ii,Wr),this._applyUpdatedTransform(Se),this._fireMoveEvents(ne)},()=>{this.terrain&&I.freezeElevation&&this._finalizeElevation(),this._afterEase(ne)},I),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(I,ne){var Te;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const Se=this._onEaseEnd;delete this._onEaseEnd,Se.call(this,ne)}return I||(Te=this.handlers)===null||Te===void 0||Te.stop(!1),this}_ease(I,ne,Te){Te.animate===!1||Te.duration===0?(I(1),ne()):(this._easeStart=i.now(),this._easeOptions=Te,this._onEaseFrame=I,this._onEaseEnd=ne,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(I,ne){I=t.b3(I,-180,180);const Te=Math.abs(I-ne);return Math.abs(I-360-ne)180?-360:Te<-180?360:0}queryTerrainElevation(I){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(I),this.transform.tileZoom)-this.transform.elevation:null}}const ji={compact:!0,customAttribution:'MapLibre'};class Ni{constructor(I=ji){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=ne=>{!ne||ne.sourceDataType!=="metadata"&&ne.sourceDataType!=="visibility"&&ne.dataType!=="style"&&ne.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=I}getDefaultPosition(){return"bottom-right"}onAdd(I){return this._map=I,this._compact=this.options.compact,this._container=n.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=n.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=n.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){n.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(I,ne){const Te=this._map._getUIString(`AttributionControl.${ne}`);I.title=Te,I.setAttribute("aria-label",Te)}_updateAttributions(){if(!this._map.style)return;let I=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?I=I.concat(this.options.customAttribution.map(Se=>typeof Se!="string"?"":Se)):typeof this.options.customAttribution=="string"&&I.push(this.options.customAttribution)),this._map.style.stylesheet){const Se=this._map.style.stylesheet;this.styleOwner=Se.owner,this.styleId=Se.id}const ne=this._map.style.sourceCaches;for(const Se in ne){const Ie=ne[Se];if(Ie.used||Ie.usedForTerrain){const ot=Ie.getSource();ot.attribution&&I.indexOf(ot.attribution)<0&&I.push(ot.attribution)}}I=I.filter(Se=>String(Se).trim()),I.sort((Se,Ie)=>Se.length-Ie.length),I=I.filter((Se,Ie)=>{for(let ot=Ie+1;ot=0)return!1;return!0});const Te=I.join(" | ");Te!==this._attribHTML&&(this._attribHTML=Te,I.length?(this._innerContainer.innerHTML=Te,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Bn{constructor(I={}){this._updateCompact=()=>{const ne=this._container.children;if(ne.length){const Te=ne[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&Te.classList.add("maplibregl-compact"):Te.classList.remove("maplibregl-compact")}},this.options=I}getDefaultPosition(){return"bottom-left"}onAdd(I){this._map=I,this._compact=this.options&&this.options.compact,this._container=n.create("div","maplibregl-ctrl");const ne=n.create("a","maplibregl-ctrl-logo");return ne.target="_blank",ne.rel="noopener nofollow",ne.href="https://maplibre.org/",ne.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),ne.setAttribute("rel","noopener nofollow"),this._container.appendChild(ne),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){n.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class An{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(I){const ne=++this._id;return this._queue.push({callback:I,id:ne,cancelled:!1}),ne}remove(I){const ne=this._currentlyRunning,Te=ne?this._queue.concat(ne):this._queue;for(const Se of Te)if(Se.id===I)return void(Se.cancelled=!0)}run(I=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const ne=this._currentlyRunning=this._queue;this._queue=[];for(const Te of ne)if(!Te.cancelled&&(Te.callback(I),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ki=t.Y([{name:"a_pos3d",type:"Int16",components:3}]);class ko extends t.E{constructor(I){super(),this.sourceCache=I,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,I.usedForTerrain=!0,I.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(I,ne){this.sourceCache.update(I,ne),this._renderableTilesKeys=[];const Te={};for(const Se of I.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:ne}))Te[Se.key]=!0,this._renderableTilesKeys.push(Se.key),this._tiles[Se.key]||(Se.posMatrix=new Float64Array(16),t.aP(Se.posMatrix,0,t.X,0,t.X,0,1),this._tiles[Se.key]=new rt(Se,this.tileSize));for(const Se in this._tiles)Te[Se]||delete this._tiles[Se]}freeRtt(I){for(const ne in this._tiles){const Te=this._tiles[ne];(!I||Te.tileID.equals(I)||Te.tileID.isChildOf(I)||I.isChildOf(Te.tileID))&&(Te.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(I=>this.getTileByID(I))}getTileByID(I){return this._tiles[I]}getTerrainCoords(I){const ne={};for(const Te of this._renderableTilesKeys){const Se=this._tiles[Te].tileID;if(Se.canonical.equals(I.canonical)){const Ie=I.clone();Ie.posMatrix=new Float64Array(16),t.aP(Ie.posMatrix,0,t.X,0,t.X,0,1),ne[Te]=Ie}else if(Se.canonical.isChildOf(I.canonical)){const Ie=I.clone();Ie.posMatrix=new Float64Array(16);const ot=Se.canonical.z-I.canonical.z,yt=Se.canonical.x-(Se.canonical.x>>ot<>ot<>ot;t.aP(Ie.posMatrix,0,Wt,0,Wt,0,1),t.J(Ie.posMatrix,Ie.posMatrix,[-yt*Wt,-Ct*Wt,0]),ne[Te]=Ie}else if(I.canonical.isChildOf(Se.canonical)){const Ie=I.clone();Ie.posMatrix=new Float64Array(16);const ot=I.canonical.z-Se.canonical.z,yt=I.canonical.x-(I.canonical.x>>ot<>ot<>ot;t.aP(Ie.posMatrix,0,t.X,0,t.X,0,1),t.J(Ie.posMatrix,Ie.posMatrix,[yt*Wt,Ct*Wt,0]),t.K(Ie.posMatrix,Ie.posMatrix,[1/2**ot,1/2**ot,0]),ne[Te]=Ie}}return ne}getSourceTile(I,ne){const Te=this.sourceCache._source;let Se=I.overscaledZ-this.deltaZoom;if(Se>Te.maxzoom&&(Se=Te.maxzoom),Se=Te.minzoom&&(!Ie||!Ie.dem);)Ie=this.sourceCache.getTileByID(I.scaledTo(Se--).key);return Ie}tilesAfterTime(I=Date.now()){return Object.values(this._tiles).filter(ne=>ne.timeAdded>=I)}}class $o{constructor(I,ne,Te){this.painter=I,this.sourceCache=new ko(ne),this.options=Te,this.exaggeration=typeof Te.exaggeration=="number"?Te.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(I,ne,Te,Se=t.X){var Ie;if(!(ne>=0&&ne=0&&TeI.canonical.z&&(I.canonical.z>=Se?Ie=I.canonical.z-Se:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const ot=I.canonical.x-(I.canonical.x>>Ie<>Ie<>8<<4|Ie>>8,ne[ot+3]=0;const Te=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(ne.buffer)),Se=new u(I,Te,I.gl.RGBA,{premultiply:!1});return Se.bind(I.gl.NEAREST,I.gl.CLAMP_TO_EDGE),this._coordsTexture=Se,Se}pointCoordinate(I){this.painter.maybeDrawDepthAndCoords(!0);const ne=new Uint8Array(4),Te=this.painter.context,Se=Te.gl,Ie=Math.round(I.x*this.painter.pixelRatio/devicePixelRatio),ot=Math.round(I.y*this.painter.pixelRatio/devicePixelRatio),yt=Math.round(this.painter.height/devicePixelRatio);Te.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),Se.readPixels(Ie,yt-ot-1,1,1,Se.RGBA,Se.UNSIGNED_BYTE,ne),Te.bindFramebuffer.set(null);const Ct=ne[0]+(ne[2]>>4<<8),Wt=ne[1]+((15&ne[2])<<8),nr=this.coordsIndex[255-ne[3]],or=nr&&this.sourceCache.getTileByID(nr);if(!or)return null;const Fr=this._coordsTextureSize,Wr=(1<I.id!==ne),this._recentlyUsed.push(I.id)}stampObject(I){I.stamp=++this._stamp}getOrCreateFreeObject(){for(const ne of this._recentlyUsed)if(!this._objects[ne].inUse)return this._objects[ne];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const I=this._createObject(this._objects.length);return this._objects.push(I),I}freeObject(I){I.inUse=!1}freeAllObjects(){for(const I of this._objects)this.freeObject(I)}isFull(){return!(this._objects.length!I.inUse)===!1}}const os={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class As{constructor(I,ne){this.painter=I,this.terrain=ne,this.pool=new Ls(I.context,30,ne.sourceCache.tileSize*ne.qualityFactor)}destruct(){this.pool.destruct()}getTexture(I){return this.pool.getObjectForId(I.rtt[this._stacks.length-1].id).texture}prepareForRender(I,ne){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=I._order.filter(Te=>!I._layers[Te].isHidden(ne)),this._coordsDescendingInv={};for(const Te in I.sourceCaches){this._coordsDescendingInv[Te]={};const Se=I.sourceCaches[Te].getVisibleCoordinates();for(const Ie of Se){const ot=this.terrain.sourceCache.getTerrainCoords(Ie);for(const yt in ot)this._coordsDescendingInv[Te][yt]||(this._coordsDescendingInv[Te][yt]=[]),this._coordsDescendingInv[Te][yt].push(ot[yt])}}this._coordsDescendingInvStr={};for(const Te of I._order){const Se=I._layers[Te],Ie=Se.source;if(os[Se.type]&&!this._coordsDescendingInvStr[Ie]){this._coordsDescendingInvStr[Ie]={};for(const ot in this._coordsDescendingInv[Ie])this._coordsDescendingInvStr[Ie][ot]=this._coordsDescendingInv[Ie][ot].map(yt=>yt.key).sort().join()}}for(const Te of this._renderableTiles)for(const Se in this._coordsDescendingInvStr){const Ie=this._coordsDescendingInvStr[Se][Te.tileID.key];Ie&&Ie!==Te.rttCoords[Se]&&(Te.rtt=[])}}renderLayer(I){if(I.isHidden(this.painter.transform.zoom))return!1;const ne=I.type,Te=this.painter,Se=this._renderableLayerIds[this._renderableLayerIds.length-1]===I.id;if(os[ne]&&(this._prevType&&os[this._prevType]||this._stacks.push([]),this._prevType=ne,this._stacks[this._stacks.length-1].push(I.id),!Se))return!0;if(os[this._prevType]||os[ne]&&Se){this._prevType=ne;const Ie=this._stacks.length-1,ot=this._stacks[Ie]||[];for(const yt of this._renderableTiles){if(this.pool.isFull()&&(Fl(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(yt),yt.rtt[Ie]){const Wt=this.pool.getObjectForId(yt.rtt[Ie].id);if(Wt.stamp===yt.rtt[Ie].stamp){this.pool.useObject(Wt);continue}}const Ct=this.pool.getOrCreateFreeObject();this.pool.useObject(Ct),this.pool.stampObject(Ct),yt.rtt[Ie]={id:Ct.id,stamp:Ct.stamp},Te.context.bindFramebuffer.set(Ct.fbo.framebuffer),Te.context.clear({color:t.aM.transparent,stencil:0}),Te.currentStencilSource=void 0;for(let Wt=0;Wt{De.touchstart=De.dragStart,De.touchmoveWindow=De.dragMove,De.touchend=De.dragEnd},fi={showCompass:!0,showZoom:!0,visualizePitch:!1};class ao{constructor(I,ne,Te=!1){this.mousedown=ot=>{this.startMouse(t.e({},ot,{ctrlKey:!0,preventDefault:()=>ot.preventDefault()}),n.mousePos(this.element,ot)),n.addEventListener(window,"mousemove",this.mousemove),n.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=ot=>{this.moveMouse(ot,n.mousePos(this.element,ot))},this.mouseup=ot=>{this.mouseRotate.dragEnd(ot),this.mousePitch&&this.mousePitch.dragEnd(ot),this.offTemp()},this.touchstart=ot=>{ot.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=n.touchPos(this.element,ot.targetTouches)[0],this.startTouch(ot,this._startPos),n.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.addEventListener(window,"touchend",this.touchend))},this.touchmove=ot=>{ot.targetTouches.length!==1?this.reset():(this._lastPos=n.touchPos(this.element,ot.targetTouches)[0],this.moveTouch(ot,this._lastPos))},this.touchend=ot=>{ot.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const Se=I.dragRotate._mouseRotate.getClickTolerance(),Ie=I.dragRotate._mousePitch.getClickTolerance();this.element=ne,this.mouseRotate=xl({clickTolerance:Se,enable:!0}),this.touchRotate=(({enable:ot,clickTolerance:yt,bearingDegreesPerPixelMoved:Ct=.8})=>{const Wt=new bc;return new iu({clickTolerance:yt,move:(nr,or)=>({bearingDelta:(or.x-nr.x)*Ct}),moveStateManager:Wt,enable:ot,assignEvents:Ss})})({clickTolerance:Se,enable:!0}),this.map=I,Te&&(this.mousePitch=nf({clickTolerance:Ie,enable:!0}),this.touchPitch=(({enable:ot,clickTolerance:yt,pitchDegreesPerPixelMoved:Ct=-.5})=>{const Wt=new bc;return new iu({clickTolerance:yt,move:(nr,or)=>({pitchDelta:(or.y-nr.y)*Ct}),moveStateManager:Wt,enable:ot,assignEvents:Ss})})({clickTolerance:Ie,enable:!0})),n.addEventListener(ne,"mousedown",this.mousedown),n.addEventListener(ne,"touchstart",this.touchstart,{passive:!1}),n.addEventListener(ne,"touchcancel",this.reset)}startMouse(I,ne){this.mouseRotate.dragStart(I,ne),this.mousePitch&&this.mousePitch.dragStart(I,ne),n.disableDrag()}startTouch(I,ne){this.touchRotate.dragStart(I,ne),this.touchPitch&&this.touchPitch.dragStart(I,ne),n.disableDrag()}moveMouse(I,ne){const Te=this.map,{bearingDelta:Se}=this.mouseRotate.dragMove(I,ne)||{};if(Se&&Te.setBearing(Te.getBearing()+Se),this.mousePitch){const{pitchDelta:Ie}=this.mousePitch.dragMove(I,ne)||{};Ie&&Te.setPitch(Te.getPitch()+Ie)}}moveTouch(I,ne){const Te=this.map,{bearingDelta:Se}=this.touchRotate.dragMove(I,ne)||{};if(Se&&Te.setBearing(Te.getBearing()+Se),this.touchPitch){const{pitchDelta:Ie}=this.touchPitch.dragMove(I,ne)||{};Ie&&Te.setPitch(Te.getPitch()+Ie)}}off(){const I=this.element;n.removeEventListener(I,"mousedown",this.mousedown),n.removeEventListener(I,"touchstart",this.touchstart,{passive:!1}),n.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.removeEventListener(window,"touchend",this.touchend),n.removeEventListener(I,"touchcancel",this.reset),this.offTemp()}offTemp(){n.enableDrag(),n.removeEventListener(window,"mousemove",this.mousemove),n.removeEventListener(window,"mouseup",this.mouseup),n.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.removeEventListener(window,"touchend",this.touchend)}}let gs;function Jo(De,I,ne){const Te=new t.N(De.lng,De.lat);if(De=new t.N(De.lng,De.lat),I){const Se=new t.N(De.lng-360,De.lat),Ie=new t.N(De.lng+360,De.lat),ot=ne.locationPoint(De).distSqr(I);ne.locationPoint(Se).distSqr(I)180;){const Se=ne.locationPoint(De);if(Se.x>=0&&Se.y>=0&&Se.x<=ne.width&&Se.y<=ne.height)break;De.lng>ne.center.lng?De.lng-=360:De.lng+=360}return De.lng!==Te.lng&&ne.locationPoint(De).y>ne.height/2-ne.getHorizon()?De:Te}const Bl={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function jl(De,I,ne){const Te=De.classList;for(const Se in Bl)Te.remove(`maplibregl-${ne}-anchor-${Se}`);Te.add(`maplibregl-${ne}-anchor-${I}`)}class Vl extends t.E{constructor(I){if(super(),this._onKeyPress=ne=>{const Te=ne.code,Se=ne.charCode||ne.keyCode;Te!=="Space"&&Te!=="Enter"&&Se!==32&&Se!==13||this.togglePopup()},this._onMapClick=ne=>{const Te=ne.originalEvent.target,Se=this._element;this._popup&&(Te===Se||Se.contains(Te))&&this.togglePopup()},this._update=ne=>{var Te;if(!this._map)return;const Se=this._map.loaded()&&!this._map.isMoving();((ne==null?void 0:ne.type)==="terrain"||(ne==null?void 0:ne.type)==="render"&&!Se)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Jo(this._lngLat,this._flatPos,this._map.transform):(Te=this._lngLat)===null||Te===void 0?void 0:Te.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let Ie="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Ie=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Ie=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let ot="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?ot="rotateX(0deg)":this._pitchAlignment==="map"&&(ot=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||ne&&ne.type!=="moveend"||(this._pos=this._pos.round()),n.setTransform(this._element,`${Bl[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${ot} ${Ie}`),i.frameAsync(new AbortController).then(()=>{this._updateOpacity(ne&&ne.type==="moveend")}).catch(()=>{})},this._onMove=ne=>{if(!this._isDragging){const Te=this._clickTolerance||this._map._clickTolerance;this._isDragging=ne.point.dist(this._pointerdownPos)>=Te}this._isDragging&&(this._pos=ne.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new t.k("dragstart"))),this.fire(new t.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new t.k("dragend")),this._state="inactive"},this._addDragHandler=ne=>{this._element.contains(ne.originalEvent.target)&&(ne.preventDefault(),this._positionDelta=ne.point.sub(this._pos).add(this._offset),this._pointerdownPos=ne.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=I&&I.anchor||"center",this._color=I&&I.color||"#3FB1CE",this._scale=I&&I.scale||1,this._draggable=I&&I.draggable||!1,this._clickTolerance=I&&I.clickTolerance||0,this._subpixelPositioning=I&&I.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=I&&I.rotation||0,this._rotationAlignment=I&&I.rotationAlignment||"auto",this._pitchAlignment=I&&I.pitchAlignment&&I.pitchAlignment!=="auto"?I.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(I==null?void 0:I.opacity,I==null?void 0:I.opacityWhenCovered),I&&I.element)this._element=I.element,this._offset=t.P.convert(I&&I.offset||[0,0]);else{this._defaultMarker=!0,this._element=n.create("div");const ne=n.createNS("http://www.w3.org/2000/svg","svg"),Te=41,Se=27;ne.setAttributeNS(null,"display","block"),ne.setAttributeNS(null,"height",`${Te}px`),ne.setAttributeNS(null,"width",`${Se}px`),ne.setAttributeNS(null,"viewBox",`0 0 ${Se} ${Te}`);const Ie=n.createNS("http://www.w3.org/2000/svg","g");Ie.setAttributeNS(null,"stroke","none"),Ie.setAttributeNS(null,"stroke-width","1"),Ie.setAttributeNS(null,"fill","none"),Ie.setAttributeNS(null,"fill-rule","evenodd");const ot=n.createNS("http://www.w3.org/2000/svg","g");ot.setAttributeNS(null,"fill-rule","nonzero");const yt=n.createNS("http://www.w3.org/2000/svg","g");yt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),yt.setAttributeNS(null,"fill","#000000");const Ct=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const lt of Ct){const Tt=n.createNS("http://www.w3.org/2000/svg","ellipse");Tt.setAttributeNS(null,"opacity","0.04"),Tt.setAttributeNS(null,"cx","10.5"),Tt.setAttributeNS(null,"cy","5.80029008"),Tt.setAttributeNS(null,"rx",lt.rx),Tt.setAttributeNS(null,"ry",lt.ry),yt.appendChild(Tt)}const Wt=n.createNS("http://www.w3.org/2000/svg","g");Wt.setAttributeNS(null,"fill",this._color);const nr=n.createNS("http://www.w3.org/2000/svg","path");nr.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),Wt.appendChild(nr);const or=n.createNS("http://www.w3.org/2000/svg","g");or.setAttributeNS(null,"opacity","0.25"),or.setAttributeNS(null,"fill","#000000");const Fr=n.createNS("http://www.w3.org/2000/svg","path");Fr.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),or.appendChild(Fr);const Wr=n.createNS("http://www.w3.org/2000/svg","g");Wr.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Wr.setAttributeNS(null,"fill","#FFFFFF");const je=n.createNS("http://www.w3.org/2000/svg","g");je.setAttributeNS(null,"transform","translate(8.0, 8.0)");const Ze=n.createNS("http://www.w3.org/2000/svg","circle");Ze.setAttributeNS(null,"fill","#000000"),Ze.setAttributeNS(null,"opacity","0.25"),Ze.setAttributeNS(null,"cx","5.5"),Ze.setAttributeNS(null,"cy","5.5"),Ze.setAttributeNS(null,"r","5.4999962");const at=n.createNS("http://www.w3.org/2000/svg","circle");at.setAttributeNS(null,"fill","#FFFFFF"),at.setAttributeNS(null,"cx","5.5"),at.setAttributeNS(null,"cy","5.5"),at.setAttributeNS(null,"r","5.4999962"),je.appendChild(Ze),je.appendChild(at),ot.appendChild(yt),ot.appendChild(Wt),ot.appendChild(or),ot.appendChild(Wr),ot.appendChild(je),ne.appendChild(ot),ne.setAttributeNS(null,"height",Te*this._scale+"px"),ne.setAttributeNS(null,"width",Se*this._scale+"px"),this._element.appendChild(ne),this._offset=t.P.convert(I&&I.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",ne=>{ne.preventDefault()}),this._element.addEventListener("mousedown",ne=>{ne.preventDefault()}),jl(this._element,this._anchor,"marker"),I&&I.className)for(const ne of I.className.split(" "))this._element.classList.add(ne);this._popup=null}addTo(I){return this.remove(),this._map=I,this._element.setAttribute("aria-label",I._getUIString("Marker.Title")),I.getCanvasContainer().appendChild(this._element),I.on("move",this._update),I.on("moveend",this._update),I.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),n.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(I){return this._lngLat=t.N.convert(I),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(I){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),I){if(!("offset"in I.options)){const Se=Math.abs(13.5)/Math.SQRT2;I.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[Se,-1*(38.1-13.5+Se)],"bottom-right":[-Se,-1*(38.1-13.5+Se)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=I,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(I){return this._subpixelPositioning=I,this}getPopup(){return this._popup}togglePopup(){const I=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:I?(I.isOpen()?I.remove():(I.setLngLat(this._lngLat),I.addTo(this._map)),this):this}_updateOpacity(I=!1){var ne,Te;if(!(!((ne=this._map)===null||ne===void 0)&&ne.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(I)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const Se=this._map,Ie=Se.terrain.depthAtPoint(this._pos),ot=Se.terrain.getElevationForLngLatZoom(this._lngLat,Se.transform.tileZoom);if(Se.transform.lngLatToCameraDepth(this._lngLat,ot)-Ie<.006)return void(this._element.style.opacity=this._opacity);const yt=-this._offset.y/Se.transform._pixelPerMeter,Ct=Math.sin(Se.getPitch()*Math.PI/180)*yt,Wt=Se.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),nr=Se.transform.lngLatToCameraDepth(this._lngLat,ot+Ct)-Wt>.006;!((Te=this._popup)===null||Te===void 0)&&Te.isOpen()&&nr&&this._popup.remove(),this._element.style.opacity=nr?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(I){return this._offset=t.P.convert(I),this._update(),this}addClassName(I){this._element.classList.add(I)}removeClassName(I){this._element.classList.remove(I)}toggleClassName(I){return this._element.classList.toggle(I)}setDraggable(I){return this._draggable=!!I,this._map&&(I?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(I){return this._rotation=I||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(I){return this._rotationAlignment=I||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(I){return this._pitchAlignment=I&&I!=="auto"?I:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(I,ne){return I===void 0&&ne===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),I!==void 0&&(this._opacity=I),ne!==void 0&&(this._opacityWhenCovered=ne),this._map&&this._updateOpacity(!0),this}}const cc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let ql=0,Vu=!1;const ol={maxWidth:100,unit:"metric"};function rc(De,I,ne){const Te=ne&&ne.maxWidth||100,Se=De._container.clientHeight/2,Ie=De.unproject([0,Se]),ot=De.unproject([Te,Se]),yt=Ie.distanceTo(ot);if(ne&&ne.unit==="imperial"){const Ct=3.2808*yt;Ct>5280?Vi(I,Te,Ct/5280,De._getUIString("ScaleControl.Miles")):Vi(I,Te,Ct,De._getUIString("ScaleControl.Feet"))}else ne&&ne.unit==="nautical"?Vi(I,Te,yt/1852,De._getUIString("ScaleControl.NauticalMiles")):yt>=1e3?Vi(I,Te,yt/1e3,De._getUIString("ScaleControl.Kilometers")):Vi(I,Te,yt,De._getUIString("ScaleControl.Meters"))}function Vi(De,I,ne,Te){const Se=function(Ie){const ot=Math.pow(10,`${Math.floor(Ie)}`.length-1);let yt=Ie/ot;return yt=yt>=10?10:yt>=5?5:yt>=3?3:yt>=2?2:yt>=1?1:function(Ct){const Wt=Math.pow(10,Math.ceil(-Math.log(Ct)/Math.LN10));return Math.round(Ct*Wt)/Wt}(yt),ot*yt}(ne);De.style.width=I*(Se/ne)+"px",De.innerHTML=`${Se} ${Te}`}const eo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},qu=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Du(De){if(De){if(typeof De=="number"){const I=Math.round(Math.abs(De)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,De),"top-left":new t.P(I,I),"top-right":new t.P(-I,I),bottom:new t.P(0,-De),"bottom-left":new t.P(I,-I),"bottom-right":new t.P(-I,-I),left:new t.P(De,0),right:new t.P(-De,0)}}if(De instanceof t.P||Array.isArray(De)){const I=t.P.convert(De);return{center:I,top:I,"top-left":I,"top-right":I,bottom:I,"bottom-left":I,"bottom-right":I,left:I,right:I}}return{center:t.P.convert(De.center||[0,0]),top:t.P.convert(De.top||[0,0]),"top-left":t.P.convert(De["top-left"]||[0,0]),"top-right":t.P.convert(De["top-right"]||[0,0]),bottom:t.P.convert(De.bottom||[0,0]),"bottom-left":t.P.convert(De["bottom-left"]||[0,0]),"bottom-right":t.P.convert(De["bottom-right"]||[0,0]),left:t.P.convert(De.left||[0,0]),right:t.P.convert(De.right||[0,0])}}return Du(new t.P(0,0))}const wc=r;e.AJAXError=t.bh,e.Evented=t.E,e.LngLat=t.N,e.MercatorCoordinate=t.Z,e.Point=t.P,e.addProtocol=t.bi,e.config=t.a,e.removeProtocol=t.bj,e.AttributionControl=Ni,e.BoxZoomHandler=du,e.CanvasSource=Ke,e.CooperativeGesturesHandler=_n,e.DoubleClickZoomHandler=Fa,e.DragPanHandler=gn,e.DragRotateHandler=kn,e.EdgeInsets=Tu,e.FullscreenControl=class extends t.E{constructor(De={}){super(),this._onFullscreenChange=()=>{var I;let ne=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((I=ne==null?void 0:ne.shadowRoot)===null||I===void 0)&&I.fullscreenElement;)ne=ne.shadowRoot.fullscreenElement;ne===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,De&&De.container&&(De.container instanceof HTMLElement?this._container=De.container:t.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(De){return this._map=De,this._container||(this._container=this._map.getContainer()),this._controlContainer=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){n.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const De=this._fullscreenButton=n.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);n.create("span","maplibregl-ctrl-icon",De).setAttribute("aria-hidden","true"),De.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const De=this._getTitle();this._fullscreenButton.setAttribute("aria-label",De),this._fullscreenButton.title=De}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new t.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},e.GeoJSONSource=Ce,e.GeolocateControl=class extends t.E{constructor(De){super(),this._onSuccess=I=>{if(this._map){if(this._isOutOfMapMaxBounds(I))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",I)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=I,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(I),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(I),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",I)),this._finish()}},this._updateCamera=I=>{const ne=new t.N(I.coords.longitude,I.coords.latitude),Te=I.coords.accuracy,Se=this._map.getBearing(),Ie=t.e({bearing:Se},this.options.fitBoundsOptions),ot=ie.fromLngLat(ne,Te);this._map.fitBounds(ot,Ie,{geolocateSource:!0})},this._updateMarker=I=>{if(I){const ne=new t.N(I.coords.longitude,I.coords.latitude);this._accuracyCircleMarker.setLngLat(ne).addTo(this._map),this._userLocationDotMarker.setLngLat(ne).addTo(this._map),this._accuracy=I.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=I=>{if(this._map){if(this.options.trackUserLocation)if(I.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const ne=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=ne,this._geolocateButton.setAttribute("aria-label",ne),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(I.code===3&&Vu)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",I)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",I=>I.preventDefault()),this._geolocateButton=n.create("button","maplibregl-ctrl-geolocate",this._container),n.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=I=>{if(this._map){if(I===!1){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");const ne=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=ne,this._geolocateButton.setAttribute("aria-label",ne)}else{const ne=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=ne,this._geolocateButton.setAttribute("aria-label",ne)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=n.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Vl({element:this._dotElement}),this._circleElement=n.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Vl({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",ne=>{ne.geolocateSource||this._watchState!=="ACTIVE_LOCK"||ne.originalEvent&&ne.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new t.k("trackuserlocationend")),this.fire(new t.k("userlocationlostfocus")))})}},this.options=t.e({},cc,De)}onAdd(De){return this._map=De,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return t._(this,arguments,void 0,function*(I=!1){if(gs!==void 0&&!I)return gs;if(window.navigator.permissions===void 0)return gs=!!window.navigator.geolocation,gs;try{gs=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{gs=!!window.navigator.geolocation}return gs})}().then(I=>this._finishSetupUI(I)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),n.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ql=0,Vu=!1}_isOutOfMapMaxBounds(De){const I=this._map.getMaxBounds(),ne=De.coords;return I&&(ne.longitudeI.getEast()||ne.latitudeI.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const De=this._map.getBounds(),I=De.getSouthEast(),ne=De.getNorthEast(),Te=I.distanceTo(ne),Se=Math.ceil(this._accuracy/(Te/this._map._container.clientHeight)*2);this._circleElement.style.width=`${Se}px`,this._circleElement.style.height=`${Se}px`}trigger(){if(!this._setup)return t.w("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 t.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ql--,Vu=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new t.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.k("trackuserlocationstart")),this.fire(new t.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let De;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ql++,ql>1?(De={maximumAge:6e5,timeout:0},Vu=!0):(De=this.options.positionOptions,Vu=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,De)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},e.Hash=Pu,e.ImageSource=et,e.KeyboardHandler=ur,e.LngLatBounds=ie,e.LogoControl=Bn,e.Map=class extends ki{constructor(De){t.bf.mark(t.bg.create);const I=Object.assign(Object.assign({},Qs),De);if(I.minZoom!=null&&I.maxZoom!=null&&I.minZoom>I.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(I.minPitch!=null&&I.maxPitch!=null&&I.minPitch>I.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(I.minPitch!=null&&I.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(I.maxPitch!=null&&I.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Ns(I.minZoom,I.maxZoom,I.minPitch,I.maxPitch,I.renderWorldCopies),{bearingSnap:I.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new An,this._controls=[],this._mapId=t.a4(),this._contextLost=ne=>{ne.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:ne}))},this._contextRestored=ne=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:ne}))},this._onMapScroll=ne=>{if(ne.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=I.interactive,this._maxTileCacheSize=I.maxTileCacheSize,this._maxTileCacheZoomLevels=I.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=I.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=I.preserveDrawingBuffer===!0,this._antialias=I.antialias===!0,this._trackResize=I.trackResize===!0,this._bearingSnap=I.bearingSnap,this._refreshExpiredTiles=I.refreshExpiredTiles===!0,this._fadeDuration=I.fadeDuration,this._crossSourceCollisions=I.crossSourceCollisions===!0,this._collectResourceTiming=I.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},jo),I.locale),this._clickTolerance=I.clickTolerance,this._overridePixelRatio=I.pixelRatio,this._maxCanvasSize=I.maxCanvasSize,this.transformCameraUpdate=I.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=I.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=l.addThrottleControl(()=>this.isMoving()),this._requestManager=new y(I.transformRequest),typeof I.container=="string"){if(this._container=document.getElementById(I.container),!this._container)throw new Error(`Container '${I.container}' not found.`)}else{if(!(I.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=I.container}if(I.maxBounds&&this.setMaxBounds(I.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let ne=!1;const Te=yc(Se=>{this._trackResize&&!this._removed&&(this.resize(Se),this.redraw())},50);this._resizeObserver=new ResizeObserver(Se=>{ne?Te(Se):ne=!0}),this._resizeObserver.observe(this._container)}this.handlers=new zi(this,I),this._hash=I.hash&&new Pu(typeof I.hash=="string"&&I.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:I.center,zoom:I.zoom,bearing:I.bearing,pitch:I.pitch}),I.bounds&&(this.resize(),this.fitBounds(I.bounds,t.e({},I.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=I.localIdeographFontFamily,this._validateStyle=I.validateStyle,I.style&&this.setStyle(I.style,{localIdeographFontFamily:I.localIdeographFontFamily}),I.attributionControl&&this.addControl(new Ni(typeof I.attributionControl=="boolean"?void 0:I.attributionControl)),I.maplibreLogo&&this.addControl(new Bn,I.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",ne=>{this._update(ne.dataType==="style"),this.fire(new t.k(`${ne.dataType}data`,ne))}),this.on("dataloading",ne=>{this.fire(new t.k(`${ne.dataType}dataloading`,ne))}),this.on("dataabort",ne=>{this.fire(new t.k("sourcedataabort",ne))})}_getMapId(){return this._mapId}addControl(De,I){if(I===void 0&&(I=De.getDefaultPosition?De.getDefaultPosition():"top-right"),!De||!De.onAdd)return this.fire(new t.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const ne=De.onAdd(this);this._controls.push(De);const Te=this._controlPositions[I];return I.indexOf("bottom")!==-1?Te.insertBefore(ne,Te.firstChild):Te.appendChild(ne),this}removeControl(De){if(!De||!De.onRemove)return this.fire(new t.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const I=this._controls.indexOf(De);return I>-1&&this._controls.splice(I,1),De.onRemove(this),this}hasControl(De){return this._controls.indexOf(De)>-1}calculateCameraOptionsFromTo(De,I,ne,Te){return Te==null&&this.terrain&&(Te=this.terrain.getElevationForLngLatZoom(ne,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(De,I,ne,Te)}resize(De){var I;const ne=this._containerDimensions(),Te=ne[0],Se=ne[1],Ie=this._getClampedPixelRatio(Te,Se);if(this._resizeCanvas(Te,Se,Ie),this.painter.resize(Te,Se,Ie),this.painter.overLimit()){const yt=this.painter.context.gl;this._maxCanvasSize=[yt.drawingBufferWidth,yt.drawingBufferHeight];const Ct=this._getClampedPixelRatio(Te,Se);this._resizeCanvas(Te,Se,Ct),this.painter.resize(Te,Se,Ct)}this.transform.resize(Te,Se),(I=this._requestedCameraState)===null||I===void 0||I.resize(Te,Se);const ot=!this._moving;return ot&&(this.stop(),this.fire(new t.k("movestart",De)).fire(new t.k("move",De))),this.fire(new t.k("resize",De)),ot&&this.fire(new t.k("moveend",De)),this}_getClampedPixelRatio(De,I){const{0:ne,1:Te}=this._maxCanvasSize,Se=this.getPixelRatio(),Ie=De*Se,ot=I*Se;return Math.min(Ie>ne?ne/Ie:1,ot>Te?Te/ot:1)*Se}getPixelRatio(){var De;return(De=this._overridePixelRatio)!==null&&De!==void 0?De:devicePixelRatio}setPixelRatio(De){this._overridePixelRatio=De,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(De){return this.transform.setMaxBounds(ie.convert(De)),this._update()}setMinZoom(De){if((De=De??-2)>=-2&&De<=this.transform.maxZoom)return this.transform.minZoom=De,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=De,this._update(),this.getZoom()>De&&this.setZoom(De),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(De){if((De=De??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(De>=0&&De<=this.transform.maxPitch)return this.transform.minPitch=De,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(De>=this.transform.minPitch)return this.transform.maxPitch=De,this._update(),this.getPitch()>De&&this.setPitch(De),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(De){return this.transform.renderWorldCopies=De,this._update()}project(De){return this.transform.locationPoint(t.N.convert(De),this.style&&this.terrain)}unproject(De){return this.transform.pointLocation(t.P.convert(De),this.terrain)}isMoving(){var De;return this._moving||((De=this.handlers)===null||De===void 0?void 0:De.isMoving())}isZooming(){var De;return this._zooming||((De=this.handlers)===null||De===void 0?void 0:De.isZooming())}isRotating(){var De;return this._rotating||((De=this.handlers)===null||De===void 0?void 0:De.isRotating())}_createDelegatedListener(De,I,ne){if(De==="mouseenter"||De==="mouseover"){let Te=!1;return{layers:I,listener:ne,delegates:{mousemove:Ie=>{const ot=I.filter(Ct=>this.getLayer(Ct)),yt=ot.length!==0?this.queryRenderedFeatures(Ie.point,{layers:ot}):[];yt.length?Te||(Te=!0,ne.call(this,new Cl(De,this,Ie.originalEvent,{features:yt}))):Te=!1},mouseout:()=>{Te=!1}}}}if(De==="mouseleave"||De==="mouseout"){let Te=!1;return{layers:I,listener:ne,delegates:{mousemove:ot=>{const yt=I.filter(Ct=>this.getLayer(Ct));(yt.length!==0?this.queryRenderedFeatures(ot.point,{layers:yt}):[]).length?Te=!0:Te&&(Te=!1,ne.call(this,new Cl(De,this,ot.originalEvent)))},mouseout:ot=>{Te&&(Te=!1,ne.call(this,new Cl(De,this,ot.originalEvent)))}}}}{const Te=Se=>{const Ie=I.filter(yt=>this.getLayer(yt)),ot=Ie.length!==0?this.queryRenderedFeatures(Se.point,{layers:Ie}):[];ot.length&&(Se.features=ot,ne.call(this,Se),delete Se.features)};return{layers:I,listener:ne,delegates:{[De]:Te}}}}_saveDelegatedListener(De,I){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[De]=this._delegatedListeners[De]||[],this._delegatedListeners[De].push(I)}_removeDelegatedListener(De,I,ne){if(!this._delegatedListeners||!this._delegatedListeners[De])return;const Te=this._delegatedListeners[De];for(let Se=0;SeI.includes(ot))){for(const ot in Ie.delegates)this.off(ot,Ie.delegates[ot]);return void Te.splice(Se,1)}}}on(De,I,ne){if(ne===void 0)return super.on(De,I);const Te=this._createDelegatedListener(De,typeof I=="string"?[I]:I,ne);this._saveDelegatedListener(De,Te);for(const Se in Te.delegates)this.on(Se,Te.delegates[Se]);return this}once(De,I,ne){if(ne===void 0)return super.once(De,I);const Te=typeof I=="string"?[I]:I,Se=this._createDelegatedListener(De,Te,ne);for(const Ie in Se.delegates){const ot=Se.delegates[Ie];Se.delegates[Ie]=(...yt)=>{this._removeDelegatedListener(De,Te,ne),ot(...yt)}}this._saveDelegatedListener(De,Se);for(const Ie in Se.delegates)this.once(Ie,Se.delegates[Ie]);return this}off(De,I,ne){return ne===void 0?super.off(De,I):(this._removeDelegatedListener(De,typeof I=="string"?[I]:I,ne),this)}queryRenderedFeatures(De,I){if(!this.style)return[];let ne;const Te=De instanceof t.P||Array.isArray(De),Se=Te?De:[[0,0],[this.transform.width,this.transform.height]];if(I=I||(Te?{}:De)||{},Se instanceof t.P||typeof Se[0]=="number")ne=[t.P.convert(Se)];else{const Ie=t.P.convert(Se[0]),ot=t.P.convert(Se[1]);ne=[Ie,new t.P(ot.x,Ie.y),ot,new t.P(Ie.x,ot.y),Ie]}return this.style.queryRenderedFeatures(ne,I,this.transform)}querySourceFeatures(De,I){return this.style.querySourceFeatures(De,I)}setStyle(De,I){return(I=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},I)).diff!==!1&&I.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&De?(this._diffStyle(De,I),this):(this._localIdeographFontFamily=I.localIdeographFontFamily,this._updateStyle(De,I))}setTransformRequest(De){return this._requestManager.setTransformRequest(De),this}_getUIString(De){const I=this._locale[De];if(I==null)throw new Error(`Missing UI string '${De}'`);return I}_updateStyle(De,I){if(I.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(De,I));const ne=this.style&&I.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!De)),De?(this.style=new Hr(this,I||{}),this.style.setEventedParent(this,{style:this.style}),typeof De=="string"?this.style.loadURL(De,I,ne):this.style.loadJSON(De,I,ne),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Hr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(De,I){if(typeof De=="string"){const ne=this._requestManager.transformRequest(De,"Style");t.h(ne,new AbortController).then(Te=>{this._updateDiff(Te.data,I)}).catch(Te=>{Te&&this.fire(new t.j(Te))})}else typeof De=="object"&&this._updateDiff(De,I)}_updateDiff(De,I){try{this.style.setState(De,I)&&this._update(!0)}catch(ne){t.w(`Unable to perform style diff: ${ne.message||ne.error||ne}. Rebuilding the style from scratch.`),this._updateStyle(De,I)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w("There is no style added to the map.")}addSource(De,I){return this._lazyInitEmptyStyle(),this.style.addSource(De,I),this._update(!0)}isSourceLoaded(De){const I=this.style&&this.style.sourceCaches[De];if(I!==void 0)return I.loaded();this.fire(new t.j(new Error(`There is no source with ID '${De}'`)))}setTerrain(De){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),De){const I=this.style.sourceCaches[De.source];if(!I)throw new Error(`cannot load terrain, because there exists no source with ID: ${De.source}`);this.terrain===null&&I.reload();for(const ne in this.style._layers){const Te=this.style._layers[ne];Te.type==="hillshade"&&Te.source===De.source&&t.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new $o(this.painter,I,De),this.painter.renderToTexture=new As(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=ne=>{ne.dataType==="style"?this.terrain.sourceCache.freeRtt():ne.dataType==="source"&&ne.tile&&(ne.sourceId!==De.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(ne.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new t.k("terrain",{terrain:De})),this}getTerrain(){var De,I;return(I=(De=this.terrain)===null||De===void 0?void 0:De.options)!==null&&I!==void 0?I:null}areTilesLoaded(){const De=this.style&&this.style.sourceCaches;for(const I in De){const ne=De[I]._tiles;for(const Te in ne){const Se=ne[Te];if(Se.state!=="loaded"&&Se.state!=="errored")return!1}}return!0}removeSource(De){return this.style.removeSource(De),this._update(!0)}getSource(De){return this.style.getSource(De)}addImage(De,I,ne={}){const{pixelRatio:Te=1,sdf:Se=!1,stretchX:Ie,stretchY:ot,content:yt,textFitWidth:Ct,textFitHeight:Wt}=ne;if(this._lazyInitEmptyStyle(),!(I instanceof HTMLImageElement||t.b(I))){if(I.width===void 0||I.height===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:nr,height:or,data:Fr}=I,Wr=I;return this.style.addImage(De,{data:new t.R({width:nr,height:or},new Uint8Array(Fr)),pixelRatio:Te,stretchX:Ie,stretchY:ot,content:yt,textFitWidth:Ct,textFitHeight:Wt,sdf:Se,version:0,userImage:Wr}),Wr.onAdd&&Wr.onAdd(this,De),this}}{const{width:nr,height:or,data:Fr}=i.getImageData(I);this.style.addImage(De,{data:new t.R({width:nr,height:or},Fr),pixelRatio:Te,stretchX:Ie,stretchY:ot,content:yt,textFitWidth:Ct,textFitHeight:Wt,sdf:Se,version:0})}}updateImage(De,I){const ne=this.style.getImage(De);if(!ne)return this.fire(new t.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const Te=I instanceof HTMLImageElement||t.b(I)?i.getImageData(I):I,{width:Se,height:Ie,data:ot}=Te;if(Se===void 0||Ie===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(Se!==ne.data.width||Ie!==ne.data.height)return this.fire(new t.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const yt=!(I instanceof HTMLImageElement||t.b(I));return ne.data.replace(ot,yt),this.style.updateImage(De,ne),this}getImage(De){return this.style.getImage(De)}hasImage(De){return De?!!this.style.getImage(De):(this.fire(new t.j(new Error("Missing required image id"))),!1)}removeImage(De){this.style.removeImage(De)}loadImage(De){return l.getImage(this._requestManager.transformRequest(De,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(De,I){return this._lazyInitEmptyStyle(),this.style.addLayer(De,I),this._update(!0)}moveLayer(De,I){return this.style.moveLayer(De,I),this._update(!0)}removeLayer(De){return this.style.removeLayer(De),this._update(!0)}getLayer(De){return this.style.getLayer(De)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(De,I,ne){return this.style.setLayerZoomRange(De,I,ne),this._update(!0)}setFilter(De,I,ne={}){return this.style.setFilter(De,I,ne),this._update(!0)}getFilter(De){return this.style.getFilter(De)}setPaintProperty(De,I,ne,Te={}){return this.style.setPaintProperty(De,I,ne,Te),this._update(!0)}getPaintProperty(De,I){return this.style.getPaintProperty(De,I)}setLayoutProperty(De,I,ne,Te={}){return this.style.setLayoutProperty(De,I,ne,Te),this._update(!0)}getLayoutProperty(De,I){return this.style.getLayoutProperty(De,I)}setGlyphs(De,I={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(De,I),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(De,I,ne={}){return this._lazyInitEmptyStyle(),this.style.addSprite(De,I,ne,Te=>{Te||this._update(!0)}),this}removeSprite(De){return this._lazyInitEmptyStyle(),this.style.removeSprite(De),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(De,I={}){return this._lazyInitEmptyStyle(),this.style.setSprite(De,I,ne=>{ne||this._update(!0)}),this}setLight(De,I={}){return this._lazyInitEmptyStyle(),this.style.setLight(De,I),this._update(!0)}getLight(){return this.style.getLight()}setSky(De){return this._lazyInitEmptyStyle(),this.style.setSky(De),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(De,I){return this.style.setFeatureState(De,I),this._update()}removeFeatureState(De,I){return this.style.removeFeatureState(De,I),this._update()}getFeatureState(De){return this.style.getFeatureState(De)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let De=0,I=0;return this._container&&(De=this._container.clientWidth||400,I=this._container.clientHeight||300),[De,I]}_setupContainer(){const De=this._container;De.classList.add("maplibregl-map");const I=this._canvasContainer=n.create("div","maplibregl-canvas-container",De);this._interactive&&I.classList.add("maplibregl-interactive"),this._canvas=n.create("canvas","maplibregl-canvas",I),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const ne=this._containerDimensions(),Te=this._getClampedPixelRatio(ne[0],ne[1]);this._resizeCanvas(ne[0],ne[1],Te);const Se=this._controlContainer=n.create("div","maplibregl-control-container",De),Ie=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(ot=>{Ie[ot]=n.create("div",`maplibregl-ctrl-${ot} `,Se)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(De,I,ne){this._canvas.width=Math.floor(ne*De),this._canvas.height=Math.floor(ne*I),this._canvas.style.width=`${De}px`,this._canvas.style.height=`${I}px`}_setupPainter(){const De={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let I=null;this._canvas.addEventListener("webglcontextcreationerror",Te=>{I={requestedAttributes:De},Te&&(I.statusMessage=Te.statusMessage,I.type=Te.type)},{once:!0});const ne=this._canvas.getContext("webgl2",De)||this._canvas.getContext("webgl",De);if(!ne){const Te="Failed to initialize WebGL";throw I?(I.message=Te,new Error(JSON.stringify(I))):new Error(Te)}this.painter=new Uu(ne,this.transform),s.testSupport(ne)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(De){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||De,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(De){return this._update(),this._renderTaskQueue.add(De)}_cancelRenderFrame(De){this._renderTaskQueue.remove(De)}_render(De){const I=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(De),this._removed)return;let ne=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const Se=this.transform.zoom,Ie=i.now();this.style.zoomHistory.update(Se,Ie);const ot=new t.z(Se,{now:Ie,fadeDuration:I,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),yt=ot.crossFadingFactor();yt===1&&yt===this._crossFadingFactor||(ne=!0,this._crossFadingFactor=yt),this.style.update(ot)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,I,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:I,showPadding:this.showPadding}),this.fire(new t.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,t.bf.mark(t.bg.load),this.fire(new t.k("load"))),this.style&&(this.style.hasTransitions()||ne)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const Te=this._sourcesDirty||this._styleDirty||this._placementDirty;return Te||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||Te||(this._fullyLoaded=!0,t.bf.mark(t.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var De;this._hash&&this._hash.remove();for(const ne of this._controls)ne.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),l.removeThrottleControl(this._imageQueueHandle),(De=this._resizeObserver)===null||De===void 0||De.disconnect();const I=this.painter.context.gl.getExtension("WEBGL_lose_context");I!=null&&I.loseContext&&I.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),n.remove(this._canvasContainer),n.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),t.bf.clearMetrics(),this._removed=!0,this.fire(new t.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(De=>{t.bf.frame(De),this._frameRequest=null,this._render(De)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(De){this._showTileBoundaries!==De&&(this._showTileBoundaries=De,this._update())}get showPadding(){return!!this._showPadding}set showPadding(De){this._showPadding!==De&&(this._showPadding=De,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(De){this._showCollisionBoxes!==De&&(this._showCollisionBoxes=De,De?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(De){this._showOverdrawInspector!==De&&(this._showOverdrawInspector=De,this._update())}get repaint(){return!!this._repaint}set repaint(De){this._repaint!==De&&(this._repaint=De,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(De){this._vertices=De,this._update()}get version(){return il}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=Cl,e.MapTouchEvent=uc,e.MapWheelEvent=rf,e.Marker=Vl,e.NavigationControl=class{constructor(De){this._updateZoomButtons=()=>{const I=this._map.getZoom(),ne=I===this._map.getMaxZoom(),Te=I===this._map.getMinZoom();this._zoomInButton.disabled=ne,this._zoomOutButton.disabled=Te,this._zoomInButton.setAttribute("aria-disabled",ne.toString()),this._zoomOutButton.setAttribute("aria-disabled",Te.toString())},this._rotateCompassArrow=()=>{const I=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=I},this._setButtonTitle=(I,ne)=>{const Te=this._map._getUIString(`NavigationControl.${ne}`);I.title=Te,I.setAttribute("aria-label",Te)},this.options=t.e({},fi,De),this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",I=>I.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",I=>this._map.zoomIn({},{originalEvent:I})),n.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",I=>this._map.zoomOut({},{originalEvent:I})),n.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",I=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:I}):this._map.resetNorth({},{originalEvent:I})}),this._compassIcon=n.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(De){return this._map=De,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new ao(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){n.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(De,I){const ne=n.create("button",De,this._container);return ne.type="button",ne.addEventListener("click",I),ne}},e.Popup=class extends t.E{constructor(De){super(),this.remove=()=>(this._content&&n.remove(this._content),this._container&&(n.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),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new t.k("close"))),this),this._onMouseUp=I=>{this._update(I.point)},this._onMouseMove=I=>{this._update(I.point)},this._onDrag=I=>{this._update(I.point)},this._update=I=>{var ne;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=n.create("div","maplibregl-popup",this._map.getContainer()),this._tip=n.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const yt of this.options.className.split(" "))this._container.classList.add(yt);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Jo(this._lngLat,this._flatPos,this._map.transform):(ne=this._lngLat)===null||ne===void 0?void 0:ne.wrap(),this._trackPointer&&!I)return;const Te=this._flatPos=this._pos=this._trackPointer&&I?I:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&I?I:this._map.transform.locationPoint(this._lngLat));let Se=this.options.anchor;const Ie=Du(this.options.offset);if(!Se){const yt=this._container.offsetWidth,Ct=this._container.offsetHeight;let Wt;Wt=Te.y+Ie.bottom.ythis._map.transform.height-Ct?["bottom"]:[],Te.xthis._map.transform.width-yt/2&&Wt.push("right"),Se=Wt.length===0?"bottom":Wt.join("-")}let ot=Te.add(Ie[Se]);this.options.subpixelPositioning||(ot=ot.round()),n.setTransform(this._container,`${Bl[Se]} translate(${ot.x}px,${ot.y}px)`),jl(this._container,Se,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(eo),De)}addTo(De){return this._map&&this.remove(),this._map=De,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new t.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(De){return this._lngLat=t.N.convert(De),this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(De){return this.setDOMContent(document.createTextNode(De))}setHTML(De){const I=document.createDocumentFragment(),ne=document.createElement("body");let Te;for(ne.innerHTML=De;Te=ne.firstChild,Te;)I.appendChild(Te);return this.setDOMContent(I)}getMaxWidth(){var De;return(De=this._container)===null||De===void 0?void 0:De.style.maxWidth}setMaxWidth(De){return this.options.maxWidth=De,this._update(),this}setDOMContent(De){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=n.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(De),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(De){return this._container&&this._container.classList.add(De),this}removeClassName(De){return this._container&&this._container.classList.remove(De),this}setOffset(De){return this.options.offset=De,this._update(),this}toggleClassName(De){if(this._container)return this._container.classList.toggle(De)}setSubpixelPositioning(De){this.options.subpixelPositioning=De}_createCloseButton(){this.options.closeButton&&(this._closeButton=n.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const De=this._container.querySelector(qu);De&&De.focus()}},e.RasterDEMTileSource=Fe,e.RasterTileSource=Ae,e.ScaleControl=class{constructor(De){this._onMove=()=>{rc(this._map,this._container,this.options)},this.setUnit=I=>{this.options.unit=I,rc(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},ol),De)}getDefaultPosition(){return"bottom-left"}onAdd(De){return this._map=De,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-scale",De.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){n.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},e.ScrollZoomHandler=ua,e.Style=Hr,e.TerrainControl=class{constructor(De){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=De}onAdd(De){return this._map=De,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=n.create("button","maplibregl-ctrl-terrain",this._container),n.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){n.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=Cc,e.TwoFingersTouchRotateHandler=tc,e.TwoFingersTouchZoomHandler=Ol,e.TwoFingersTouchZoomRotateHandler=Ja,e.VectorTileSource=we,e.VideoSource=Qe,e.addSourceType=(De,I)=>t._(void 0,void 0,void 0,function*(){if(Me(De))throw new Error(`A source type called "${De}" already exists.`);((ne,Te)=>{Xe[ne]=Te})(De,I)}),e.clearPrewarmedResources=function(){const De=le;De&&(De.isPreloaded()&&De.numActive()===1?(De.release(Q),le=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()"))},e.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return $e().getRTLTextPluginStatus()},e.getVersion=function(){return wc},e.getWorkerCount=function(){return ue.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(De){return X().broadcast("IS",De)},e.prewarm=function(){J().acquire(Q)},e.setMaxParallelImageRequests=function(De){t.a.MAX_PARALLEL_IMAGE_REQUESTS=De},e.setRTLTextPlugin=function(De,I){return $e().setRTLTextPlugin(De,I)},e.setWorkerCount=function(De){ue.workerCount=De},e.setWorkerUrl=function(De){t.a.WORKER_URL=De}});var E=d;return E})}}),_R=He({"src/plots/map/layers.js"(Y,G){var d=Gr(),x=yl().sanitizeHTML,A=HT(),E=up();function e(i,n){this.subplot=i,this.uid=i.uid+"-"+n,this.index=n,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(n){this.visible?this.needsNewImage(n)?this.updateImage(n):this.needsNewSource(n)?(this.removeLayer(),this.updateSource(n),this.updateLayer(n)):this.needsNewLayer(n)?this.updateLayer(n):this.updateStyle(n):(this.updateSource(n),this.updateLayer(n)),this.visible=r(n)},t.needsNewImage=function(i){var n=this.subplot.map;return n.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var n=this.subplot.map;n.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var n=this.subplot.map;if(n.getSource(this.idSource)&&n.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=a(i);n.addSource(this.idSource,s)}},t.findFollowingMapLayerId=function(i){if(i==="traces")for(var n=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var n={},s={};switch(i.type){case"circle":d.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":d.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":d.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var c=i.symbol,f=A(c.textposition,c.iconsize);d.extendFlat(n,{"icon-image":c.icon+"-15","icon-size":c.iconsize/10,"text-field":c.text,"text-size":c.textfont.size,"text-anchor":f.anchor,"text-offset":f.offset,"symbol-placement":c.placement}),d.extendFlat(s,{"icon-color":i.color,"text-color":c.textfont.color,"text-opacity":i.opacity});break;case"raster":d.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:n,paint:s}}function a(i){var n=i.sourcetype,s=i.source,c={type:n},f;return n==="geojson"?f="data":n==="vector"?f=typeof s=="string"?"url":"tiles":n==="raster"?(f="tiles",c.tileSize=256):n==="image"&&(f="url",c.coordinates=i.coordinates),c[f]=s,i.sourceattribution&&(c.attribution=x(i.sourceattribution)),c}G.exports=function(n,s,c){var f=new e(n,s);return f.update(c),f}}}),xR=He({"src/plots/map/map.js"(Y,G){var d=mR(),x=Gr(),A=ip(),E=Ei(),e=io(),t=fh(),r=Wu(),o=bv(),a=o.drawMode,i=o.selectMode,n=dc().prepSelect,s=dc().clearOutline,c=dc().clearSelectionsCache,f=dc().selectOnClick,v=up(),h=_R();function T(_,w){this.id=w,this.gd=_;var p=_._fullLayout,u=_._context;this.container=p._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(_,w,p){var u=this,g;u.map?g=new Promise(function(m,R){u.updateMap(_,w,m,R)}):g=new Promise(function(m,R){u.createMap(_,w,m,R)}),p.push(g)},l.createMap=function(_,w,p,u){var g=this,m=w[g.id],R=g.styleObj=b(m.style),P=m.bounds,z=P?[[P.west,P.south],[P.east,P.north]]:null,F=g.map=new d.Map({container:g.div,style:R.style,center:M(m.center),zoom:m.zoom,bearing:m.bearing,pitch:m.pitch,maxBounds:z,interactive:!g.isStatic,preserveDrawingBuffer:g.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0})),B={};F.on("styleimagemissing",function(L){var N=L.id;if(!B[N]&&N.includes("-15")){B[N]=!0;var U=new Image(15,15);U.onload=function(){F.addImage(N,U)},U.crossOrigin="Anonymous",U.src="https://unpkg.com/maki@2.1.0/icons/"+N+".svg"}}),F.setTransformRequest(function(L){return L=L.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),L=L.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),L=L.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:L}}),F._canvas.style.left="0px",F._canvas.style.top="0px",g.rejectOnError(u),g.isStatic||g.initFx(_,w);var O=[];O.push(new Promise(function(L){F.once("load",L)})),O=O.concat(A.fetchTraceGeoData(_)),Promise.all(O).then(function(){g.fillBelowLookup(_,w),g.updateData(_),g.updateLayout(w),g.resolveOnRender(p)}).catch(u)},l.updateMap=function(_,w,p,u){var g=this,m=g.map,R=w[this.id];g.rejectOnError(u);var P=[],z=b(R.style);JSON.stringify(g.styleObj)!==JSON.stringify(z)&&(g.styleObj=z,m.setStyle(z.style),g.traceHash={},P.push(new Promise(function(F){m.once("styledata",F)}))),P=P.concat(A.fetchTraceGeoData(_)),Promise.all(P).then(function(){g.fillBelowLookup(_,w),g.updateData(_),g.updateLayout(w),g.resolveOnRender(p)}).catch(u)},l.fillBelowLookup=function(_,w){var p=w[this.id],u=p.layers,g,m,R=this.belowLookup={},P=!1;for(g=0;g<_.length;g++){var z=_[g][0].trace,F=z._module;typeof z.below=="string"?m=z.below:F.getBelow&&(m=F.getBelow(z,this)),m===""&&(P=!0),R["trace-"+z.uid]=m||""}for(g=0;g1)for(g=0;g-1&&f(z.originalEvent,u,[p.xaxis],[p.yaxis],p.id,P),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(_){var w=this,p=w.map,u=w.gd;if(w.isStatic)return;function g(z){var F=w.map.unproject(z);return[F.lng,F.lat]}var m=_.dragmode,R;R=function(z,F){if(F.isRect){var B=z.range={};B[w.id]=[g([F.xmin,F.ymin]),g([F.xmax,F.ymax])]}else{var O=z.lassoPoints={};O[w.id]=F.map(g)}};var P=w.dragOptions;w.dragOptions=x.extendDeep(P||{},{dragmode:_.dragmode,element:w.div,gd:u,plotinfo:{id:w.id,domain:_[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:R},xaxes:[w.xaxis],yaxes:[w.yaxis],subplot:w.id}),p.off("click",w.onClickInPanHandler),i(m)||a(m)?(p.dragPan.disable(),p.on("zoomstart",w.clearOutline),w.dragOptions.prepFn=function(z,F,B){n(z,F,B,w.dragOptions,m)},t.init(w.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",w.clearOutline),w.div.onmousedown=null,w.div.ontouchstart=null,w.div.removeEventListener("touchstart",w.div._ontouchstart),w.onClickInPanHandler=w.onClickInPanFn(w.dragOptions),p.on("click",w.onClickInPanHandler))},l.updateFramework=function(_){var w=_[this.id].domain,p=_._size,u=this.div.style;u.width=p.w*(w.x[1]-w.x[0])+"px",u.height=p.h*(w.y[1]-w.y[0])+"px",u.left=p.l+w.x[0]*p.w+"px",u.top=p.t+(1-w.y[1])*p.h+"px",this.xaxis._offset=p.l+w.x[0]*p.w,this.xaxis._length=p.w*(w.x[1]-w.x[0]),this.yaxis._offset=p.t+(1-w.y[1])*p.h,this.yaxis._length=p.h*(w.y[1]-w.y[0])},l.updateLayers=function(_){var w=_[this.id],p=w.layers,u=this.layerList,g;if(p.length!==u.length){for(g=0;gp/2){var u=S.split("|").join("
");_.text(u).attr("data-unformatted",u).call(r.convertToTspans,i),w=t.bBox(_.node())}_.attr("transform",d(-3,-w.height+8)),M.insert("rect",".static-attribution").attr({x:-w.width-6,y:-w.height-3,width:w.width+6,height:w.height+3,fill:"rgba(255, 255, 255, 0.75)"});var g=1;w.width+6>p&&(g=p/(w.width+6));var m=[c.l+c.w*h.x[1],c.t+c.h*(1-h.y[0])];M.attr("transform",d(m[0],m[1])+x(g))}},Y.updateFx=function(i){for(var n=i._fullLayout,s=n._subplots[a],c=0;c=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},G.exports=function(r,o){var a=o[0].trace,i=new E(r,a.uid),n=i.sourceId,s=d(o),c=i.below=r.belowLookup["trace-"+a.uid];return r.map.addSource(n,{type:"geojson",data:s.geojson}),i._addLayers(s,c),o[0].trace._glTrace=i,i}}}),MR=He({"src/traces/choroplethmap/index.js"(Y,G){G.exports={attributes:GT(),supplyDefaults:AR(),colorbar:Zd(),calc:G_(),plot:SR(),hoverPoints:Z_(),eventData:X_(),selectPoints:Y_(),styleOnSelect:function(d,x){if(x){var A=x[0].trace;A._glTrace.updateOnSelect(x)}},getBelow:function(d,x){for(var A=x.getMapLayers(),E=A.length-2;E>=0;E--){var e=A[E].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=E+1;t0?+h[f]:0),c.push({type:"Feature",geometry:{type:"Point",coordinates:b},properties:S})}}var _=E.extractOpts(a),w=_.reversescale?E.flipScale(_.colorscale):_.colorscale,p=w[0][1],u=A.opacity(p)<1?p:A.addOpacity(p,0),g=["interpolate",["linear"],["heatmap-density"],0,u];for(f=1;f=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},G.exports=function(t,r){var o=r[0].trace,a=new A(t,o.uid),i=a.sourceId,n=d(r),s=a.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:n.geojson}),a._addLayers(n,s),a}}}),IR=He({"src/traces/densitymap/hover.js"(Y,G){var d=io(),x=fx().hoverPoints,A=fx().getExtraText;G.exports=function(e,t,r){var o=x(e,t,r);if(o){var a=o[0],i=a.cd,n=i[0].trace,s=i[a.index];if(delete a.color,"z"in s){var c=a.subplot.mockAxis;a.z=s.z,a.zLabel=d.tickText(c,c.c2l(s.z),"hover").text}return a.extraText=A(n,s,i[0].t.labels),[a]}}}}),RR=He({"src/traces/densitymap/event_data.js"(Y,G){G.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x.z=A.z,x}}}),DR=He({"src/traces/densitymap/index.js"(Y,G){G.exports={attributes:ZT(),supplyDefaults:kR(),colorbar:Zd(),formatLabels:qT(),calc:CR(),plot:PR(),hoverPoints:IR(),eventData:RR(),getBelow:function(d,x){for(var A=x.getMapLayers(),E=0;E0;){l=b[b.length-1];var S=x[l];if(r[l]=0&&a[l].push(o[_])}r[l]=M}else{if(e[l]===E[l]){for(var w=[],p=[],u=0,M=y.length-1;M>=0;--M){var g=y[M];if(t[g]=!1,w.push(g),p.push(a[g]),u+=a[g].length,o[g]=s.length,g===l){y.length=M;break}}s.push(w);for(var m=new Array(u),M=0;M_&&(_=n.source[y]),n.target[y]>_&&(_=n.target[y]);var w=_+1;a.node._count=w;var p,u=a.node.groups,g={};for(y=0;y0&&e(B,w)&&e(O,w)&&!(g.hasOwnProperty(B)&&g.hasOwnProperty(O)&&g[B]===g[O])){g.hasOwnProperty(O)&&(O=g[O]),g.hasOwnProperty(B)&&(B=g[B]),B=+B,O=+O,h[B]=h[O]=!0;var L="";n.label&&n.label[y]&&(L=n.label[y]);var N=null;L&&T.hasOwnProperty(L)&&(N=T[L]),s.push({pointNumber:y,label:L,color:c?n.color[y]:n.color,hovercolor:f?n.hovercolor[y]:n.hovercolor,customdata:v?n.customdata[y]:n.customdata,concentrationscale:N,source:B,target:O,value:+F}),z.source.push(B),z.target.push(O)}}var U=w+u.length,Z=E(i.color),Q=E(i.customdata),ue=[];for(y=0;yw-1,childrenNodes:[],pointNumber:y,label:oe,color:Z?i.color[y]:i.color,customdata:Q?i.customdata[y]:i.customdata})}var le=!1;return o(U,z.source,z.target)&&(le=!0),{circular:le,links:s,nodes:ue,groups:u,groupLookup:g}}function o(a,i,n){for(var s=x.init2dArray(a,0),c=0;c1})}G.exports=function(i,n){var s=r(n);return A({circular:s.circular,_nodes:s.nodes,_links:s.links,_groups:s.groups,_groupLookup:s.groupLookup})}}}),BR=He({"node_modules/d3-quadtree/dist/d3-quadtree.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y):(d=d||self,x(d.d3=d.d3||{}))})(Y,function(d){function x(w){var p=+this._x.call(null,w),u=+this._y.call(null,w);return A(this.cover(p,u),p,u,w)}function A(w,p,u,g){if(isNaN(p)||isNaN(u))return w;var m,R=w._root,P={data:g},z=w._x0,F=w._y0,B=w._x1,O=w._y1,L,N,U,Z,Q,ue,oe,le;if(!R)return w._root=P,w;for(;R.length;)if((Q=p>=(L=(z+B)/2))?z=L:B=L,(ue=u>=(N=(F+O)/2))?F=N:O=N,m=R,!(R=R[oe=ue<<1|Q]))return m[oe]=P,w;if(U=+w._x.call(null,R.data),Z=+w._y.call(null,R.data),p===U&&u===Z)return P.next=R,m?m[oe]=P:w._root=P,w;do m=m?m[oe]=new Array(4):w._root=new Array(4),(Q=p>=(L=(z+B)/2))?z=L:B=L,(ue=u>=(N=(F+O)/2))?F=N:O=N;while((oe=ue<<1|Q)===(le=(Z>=N)<<1|U>=L));return m[le]=R,m[oe]=P,w}function E(w){var p,u,g=w.length,m,R,P=new Array(g),z=new Array(g),F=1/0,B=1/0,O=-1/0,L=-1/0;for(u=0;uO&&(O=m),RL&&(L=R));if(F>O||B>L)return this;for(this.cover(F,B).cover(O,L),u=0;uw||w>=m||g>p||p>=R;)switch(B=(pO||(z=Z.y0)>L||(F=Z.x1)=oe)<<1|w>=ue)&&(Z=N[N.length-1],N[N.length-1]=N[N.length-1-Q],N[N.length-1-Q]=Z)}else{var le=w-+this._x.call(null,U.data),j=p-+this._y.call(null,U.data),J=le*le+j*j;if(J=(N=(P+F)/2))?P=N:F=N,(Q=L>=(U=(z+B)/2))?z=U:B=U,p=u,!(u=u[ue=Q<<1|Z]))return this;if(!u.length)break;(p[ue+1&3]||p[ue+2&3]||p[ue+3&3])&&(g=p,oe=ue)}for(;u.data!==w;)if(m=u,!(u=u.next))return this;return(R=u.next)&&delete u.next,m?(R?m.next=R:delete m.next,this):p?(R?p[ue]=R:delete p[ue],(u=p[0]||p[1]||p[2]||p[3])&&u===(p[3]||p[2]||p[1]||p[0])&&!u.length&&(g?g[oe]=u:this._root=u),this):(this._root=R,this)}function n(w){for(var p=0,u=w.length;p=h.length)return l!=null&&_.sort(l),y!=null?y(_):_;for(var g=-1,m=_.length,R=h[w++],P,z,F=E(),B,O=p();++gh.length)return _;var p,u=T[w-1];return y!=null&&w>=h.length?p=_.entries():(p=[],_.each(function(g,m){p.push({key:m,values:M(g,w)})})),u!=null?p.sort(function(g,m){return u(g.key,m.key)}):p}return b={object:function(_){return S(_,0,t,r)},map:function(_){return S(_,0,o,a)},entries:function(_){return M(S(_,0,o,a),0)},key:function(_){return h.push(_),b},sortKeys:function(_){return T[h.length-1]=_,b},sortValues:function(_){return l=_,b},rollup:function(_){return y=_,b}}}function t(){return{}}function r(h,T,l){h[T]=l}function o(){return E()}function a(h,T,l){h.set(T,l)}function i(){}var n=E.prototype;i.prototype=s.prototype={constructor:i,has:n.has,add:function(h){return h+="",this[x+h]=h,this},remove:n.remove,clear:n.clear,values:n.keys,size:n.size,empty:n.empty,each:n.each};function s(h,T){var l=new i;if(h instanceof i)h.each(function(S){l.add(S)});else if(h){var y=-1,b=h.length;if(T==null)for(;++y=0&&(n=i.slice(s+1),i=i.slice(0,s)),i&&!a.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:n}})}E.prototype=A.prototype={constructor:E,on:function(o,a){var i=this._,n=e(o+"",i),s,c=-1,f=n.length;if(arguments.length<2){for(;++c0)for(var i=new Array(s),n=0,s,c;n=0&&w._call.call(null,p),w=w._next;--x}function l(){a=(o=n.now())+i,x=A=0;try{T()}finally{x=0,b(),a=0}}function y(){var w=n.now(),p=w-o;p>e&&(i-=p,o=w)}function b(){for(var w,p=t,u,g=1/0;p;)p._call?(g>p._time&&(g=p._time),w=p,p=p._next):(u=p._next,p._next=null,p=w?w._next=u:t=u);r=w,S(g)}function S(w){if(!x){A&&(A=clearTimeout(A));var p=w-a;p>24?(w<1/0&&(A=setTimeout(l,w-n.now()-i)),E&&(E=clearInterval(E))):(E||(o=n.now(),E=setInterval(y,e)),x=1,s(l))}}function M(w,p,u){var g=new v;return p=p==null?0:+p,g.restart(function(m){g.stop(),w(m+p)},p,u),g}function _(w,p,u){var g=new v,m=p;return p==null?(g.restart(w,p,u),g):(p=+p,u=u==null?c():+u,g.restart(function R(P){P+=m,g.restart(R,m+=p,u),w(P)},p,u),g)}d.interval=_,d.now=c,d.timeout=M,d.timer=h,d.timerFlush=T,Object.defineProperty(d,"__esModule",{value:!0})})}}),jR=He({"node_modules/d3-force/dist/d3-force.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y,BR(),vx(),NR(),UR()):x(d.d3=d.d3||{},d.d3,d.d3,d.d3,d.d3)})(Y,function(d,x,A,E,e){function t(w,p){var u;w==null&&(w=0),p==null&&(p=0);function g(){var m,R=u.length,P,z=0,F=0;for(m=0;mL.index){var ae=N-re.x-re.vx,ie=U-re.y-re.vy,fe=ae*ae+ie*ie;feN+q||$U+q||XF.r&&(F.r=F[B].r)}function z(){if(p){var F,B=p.length,O;for(u=new Array(B),F=0;F1?(Q==null?z.remove(Z):z.set(Z,U(Q)),p):z.get(Z)},find:function(Z,Q,ue){var oe=0,le=w.length,j,J,$,X,re;for(ue==null?ue=1/0:ue*=ue,oe=0;oe1?(B.on(Z,Q),p):B.on(Z)}}}function b(){var w,p,u,g=r(-30),m,R=1,P=1/0,z=.81;function F(N){var U,Z=w.length,Q=x.quadtree(w,v,h).visitAfter(O);for(u=N,U=0;U=P)return;(N.data!==p||N.next)&&(ue===0&&(ue=o(),j+=ue*ue),oe===0&&(oe=o(),j+=oe*oe),jE)if(!(Math.abs(l*v-h*T)>E)||!s)this._+="L"+(this._x1=o)+","+(this._y1=a);else{var b=i-c,S=n-f,M=v*v+h*h,_=b*b+S*S,w=Math.sqrt(M),p=Math.sqrt(y),u=s*Math.tan((x-Math.acos((M+y-_)/(2*w*p)))/2),g=u/p,m=u/w;Math.abs(g-1)>E&&(this._+="L"+(o+g*T)+","+(a+g*l)),this._+="A"+s+","+s+",0,0,"+ +(l*b>T*S)+","+(this._x1=o+m*v)+","+(this._y1=a+m*h)}},arc:function(o,a,i,n,s,c){o=+o,a=+a,i=+i,c=!!c;var f=i*Math.cos(n),v=i*Math.sin(n),h=o+f,T=a+v,l=1^c,y=c?n-s:s-n;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+h+","+T:(Math.abs(this._x1-h)>E||Math.abs(this._y1-T)>E)&&(this._+="L"+h+","+T),i&&(y<0&&(y=y%A+A),y>e?this._+="A"+i+","+i+",0,1,"+l+","+(o-f)+","+(a-v)+"A"+i+","+i+",0,1,"+l+","+(this._x1=h)+","+(this._y1=T):y>E&&(this._+="A"+i+","+i+",0,"+ +(y>=x)+","+l+","+(this._x1=o+i*Math.cos(s))+","+(this._y1=a+i*Math.sin(s))))},rect:function(o,a,i,n){this._+="M"+(this._x0=this._x1=+o)+","+(this._y0=this._y1=+a)+"h"+ +i+"v"+ +n+"h"+-i+"Z"},toString:function(){return this._}},d.path=r,Object.defineProperty(d,"__esModule",{value:!0})})}}),KT=He({"node_modules/d3-shape/dist/d3-shape.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y,VR()):(d=d||self,x(d.d3=d.d3||{},d.d3))})(Y,function(d,x){function A(wt){return function(){return wt}}var E=Math.abs,e=Math.atan2,t=Math.cos,r=Math.max,o=Math.min,a=Math.sin,i=Math.sqrt,n=1e-12,s=Math.PI,c=s/2,f=2*s;function v(wt){return wt>1?0:wt<-1?s:Math.acos(wt)}function h(wt){return wt>=1?c:wt<=-1?-c:Math.asin(wt)}function T(wt){return wt.innerRadius}function l(wt){return wt.outerRadius}function y(wt){return wt.startAngle}function b(wt){return wt.endAngle}function S(wt){return wt&&wt.padAngle}function M(wt,Qt,mr,$r,oa,Sa,ya,ra){var pa=mr-wt,pn=$r-Qt,Ga=ya-oa,qn=ra-Sa,Vn=qn*pa-Ga*pn;if(!(Vn*Vnbs*bs+as*as&&(xi=So,Ao=Ro),{cx:xi,cy:Ao,x01:-Ga,y01:-qn,x11:xi*(oa/Wo-1),y11:Ao*(oa/Wo-1)}}function w(){var wt=T,Qt=l,mr=A(0),$r=null,oa=y,Sa=b,ya=S,ra=null;function pa(){var pn,Ga,qn=+wt.apply(this,arguments),Vn=+Qt.apply(this,arguments),di=oa.apply(this,arguments)-c,yi=Sa.apply(this,arguments)-c,Ci=E(yi-di),ci=yi>di;if(ra||(ra=pn=x.path()),Vnn))ra.moveTo(0,0);else if(Ci>f-n)ra.moveTo(Vn*t(di),Vn*a(di)),ra.arc(0,0,Vn,di,yi,!ci),qn>n&&(ra.moveTo(qn*t(yi),qn*a(yi)),ra.arc(0,0,qn,yi,di,ci));else{var ei=di,mi=yi,uo=di,Lo=yi,Wo=Ci,li=Ci,Ii=ya.apply(this,arguments)/2,xi=Ii>n&&($r?+$r.apply(this,arguments):i(qn*qn+Vn*Vn)),Ao=o(E(Vn-qn)/2,+mr.apply(this,arguments)),So=Ao,Ro=Ao,Li,Yi;if(xi>n){var bs=h(xi/qn*a(Ii)),as=h(xi/Vn*a(Ii));(Wo-=bs*2)>n?(bs*=ci?1:-1,uo+=bs,Lo-=bs):(Wo=0,uo=Lo=(di+yi)/2),(li-=as*2)>n?(as*=ci?1:-1,ei+=as,mi-=as):(li=0,ei=mi=(di+yi)/2)}var fs=Vn*t(ei),Co=Vn*a(ei),Qa=qn*t(Lo),Jn=qn*a(Lo);if(Ao>n){var Os=Vn*t(mi),ds=Vn*a(mi),Ui=qn*t(uo),ms=qn*a(uo),Mo;if(Cin?Ro>n?(Li=_(Ui,ms,fs,Co,Vn,Ro,ci),Yi=_(Os,ds,Qa,Jn,Vn,Ro,ci),ra.moveTo(Li.cx+Li.x01,Li.cy+Li.y01),Ron)||!(Wo>n)?ra.lineTo(Qa,Jn):So>n?(Li=_(Qa,Jn,Os,ds,qn,-So,ci),Yi=_(fs,Co,Ui,ms,qn,-So,ci),ra.lineTo(Li.cx+Li.x01,Li.cy+Li.y01),So=Vn;--di)ra.point(mi[di],uo[di]);ra.lineEnd(),ra.areaEnd()}ci&&(mi[qn]=+wt(Ci,qn,Ga),uo[qn]=+mr(Ci,qn,Ga),ra.point(Qt?+Qt(Ci,qn,Ga):mi[qn],$r?+$r(Ci,qn,Ga):uo[qn]))}if(ei)return ra=null,ei+""||null}function pn(){return R().defined(oa).curve(ya).context(Sa)}return pa.x=function(Ga){return arguments.length?(wt=typeof Ga=="function"?Ga:A(+Ga),Qt=null,pa):wt},pa.x0=function(Ga){return arguments.length?(wt=typeof Ga=="function"?Ga:A(+Ga),pa):wt},pa.x1=function(Ga){return arguments.length?(Qt=Ga==null?null:typeof Ga=="function"?Ga:A(+Ga),pa):Qt},pa.y=function(Ga){return arguments.length?(mr=typeof Ga=="function"?Ga:A(+Ga),$r=null,pa):mr},pa.y0=function(Ga){return arguments.length?(mr=typeof Ga=="function"?Ga:A(+Ga),pa):mr},pa.y1=function(Ga){return arguments.length?($r=Ga==null?null:typeof Ga=="function"?Ga:A(+Ga),pa):$r},pa.lineX0=pa.lineY0=function(){return pn().x(wt).y(mr)},pa.lineY1=function(){return pn().x(wt).y($r)},pa.lineX1=function(){return pn().x(Qt).y(mr)},pa.defined=function(Ga){return arguments.length?(oa=typeof Ga=="function"?Ga:A(!!Ga),pa):oa},pa.curve=function(Ga){return arguments.length?(ya=Ga,Sa!=null&&(ra=ya(Sa)),pa):ya},pa.context=function(Ga){return arguments.length?(Ga==null?Sa=ra=null:ra=ya(Sa=Ga),pa):Sa},pa}function z(wt,Qt){return Qtwt?1:Qt>=wt?0:NaN}function F(wt){return wt}function B(){var wt=F,Qt=z,mr=null,$r=A(0),oa=A(f),Sa=A(0);function ya(ra){var pa,pn=ra.length,Ga,qn,Vn=0,di=new Array(pn),yi=new Array(pn),Ci=+$r.apply(this,arguments),ci=Math.min(f,Math.max(-f,oa.apply(this,arguments)-Ci)),ei,mi=Math.min(Math.abs(ci)/pn,Sa.apply(this,arguments)),uo=mi*(ci<0?-1:1),Lo;for(pa=0;pa0&&(Vn+=Lo);for(Qt!=null?di.sort(function(Wo,li){return Qt(yi[Wo],yi[li])}):mr!=null&&di.sort(function(Wo,li){return mr(ra[Wo],ra[li])}),pa=0,qn=Vn?(ci-pn*uo)/Vn:0;pa0?Lo*qn:0)+uo,yi[Ga]={data:ra[Ga],index:pa,value:Lo,startAngle:Ci,endAngle:ei,padAngle:mi};return yi}return ya.value=function(ra){return arguments.length?(wt=typeof ra=="function"?ra:A(+ra),ya):wt},ya.sortValues=function(ra){return arguments.length?(Qt=ra,mr=null,ya):Qt},ya.sort=function(ra){return arguments.length?(mr=ra,Qt=null,ya):mr},ya.startAngle=function(ra){return arguments.length?($r=typeof ra=="function"?ra:A(+ra),ya):$r},ya.endAngle=function(ra){return arguments.length?(oa=typeof ra=="function"?ra:A(+ra),ya):oa},ya.padAngle=function(ra){return arguments.length?(Sa=typeof ra=="function"?ra:A(+ra),ya):Sa},ya}var O=N(u);function L(wt){this._curve=wt}L.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(wt,Qt){this._curve.point(Qt*Math.sin(wt),Qt*-Math.cos(wt))}};function N(wt){function Qt(mr){return new L(wt(mr))}return Qt._curve=wt,Qt}function U(wt){var Qt=wt.curve;return wt.angle=wt.x,delete wt.x,wt.radius=wt.y,delete wt.y,wt.curve=function(mr){return arguments.length?Qt(N(mr)):Qt()._curve},wt}function Z(){return U(R().curve(O))}function Q(){var wt=P().curve(O),Qt=wt.curve,mr=wt.lineX0,$r=wt.lineX1,oa=wt.lineY0,Sa=wt.lineY1;return wt.angle=wt.x,delete wt.x,wt.startAngle=wt.x0,delete wt.x0,wt.endAngle=wt.x1,delete wt.x1,wt.radius=wt.y,delete wt.y,wt.innerRadius=wt.y0,delete wt.y0,wt.outerRadius=wt.y1,delete wt.y1,wt.lineStartAngle=function(){return U(mr())},delete wt.lineX0,wt.lineEndAngle=function(){return U($r())},delete wt.lineX1,wt.lineInnerRadius=function(){return U(oa())},delete wt.lineY0,wt.lineOuterRadius=function(){return U(Sa())},delete wt.lineY1,wt.curve=function(ya){return arguments.length?Qt(N(ya)):Qt()._curve},wt}function ue(wt,Qt){return[(Qt=+Qt)*Math.cos(wt-=Math.PI/2),Qt*Math.sin(wt)]}var oe=Array.prototype.slice;function le(wt){return wt.source}function j(wt){return wt.target}function J(wt){var Qt=le,mr=j,$r=g,oa=m,Sa=null;function ya(){var ra,pa=oe.call(arguments),pn=Qt.apply(this,pa),Ga=mr.apply(this,pa);if(Sa||(Sa=ra=x.path()),wt(Sa,+$r.apply(this,(pa[0]=pn,pa)),+oa.apply(this,pa),+$r.apply(this,(pa[0]=Ga,pa)),+oa.apply(this,pa)),ra)return Sa=null,ra+""||null}return ya.source=function(ra){return arguments.length?(Qt=ra,ya):Qt},ya.target=function(ra){return arguments.length?(mr=ra,ya):mr},ya.x=function(ra){return arguments.length?($r=typeof ra=="function"?ra:A(+ra),ya):$r},ya.y=function(ra){return arguments.length?(oa=typeof ra=="function"?ra:A(+ra),ya):oa},ya.context=function(ra){return arguments.length?(Sa=ra??null,ya):Sa},ya}function $(wt,Qt,mr,$r,oa){wt.moveTo(Qt,mr),wt.bezierCurveTo(Qt=(Qt+$r)/2,mr,Qt,oa,$r,oa)}function X(wt,Qt,mr,$r,oa){wt.moveTo(Qt,mr),wt.bezierCurveTo(Qt,mr=(mr+oa)/2,$r,mr,$r,oa)}function re(wt,Qt,mr,$r,oa){var Sa=ue(Qt,mr),ya=ue(Qt,mr=(mr+oa)/2),ra=ue($r,mr),pa=ue($r,oa);wt.moveTo(Sa[0],Sa[1]),wt.bezierCurveTo(ya[0],ya[1],ra[0],ra[1],pa[0],pa[1])}function ee(){return J($)}function q(){return J(X)}function ae(){var wt=J(re);return wt.angle=wt.x,delete wt.x,wt.radius=wt.y,delete wt.y,wt}var ie={draw:function(wt,Qt){var mr=Math.sqrt(Qt/s);wt.moveTo(mr,0),wt.arc(0,0,mr,0,f)}},fe={draw:function(wt,Qt){var mr=Math.sqrt(Qt/5)/2;wt.moveTo(-3*mr,-mr),wt.lineTo(-mr,-mr),wt.lineTo(-mr,-3*mr),wt.lineTo(mr,-3*mr),wt.lineTo(mr,-mr),wt.lineTo(3*mr,-mr),wt.lineTo(3*mr,mr),wt.lineTo(mr,mr),wt.lineTo(mr,3*mr),wt.lineTo(-mr,3*mr),wt.lineTo(-mr,mr),wt.lineTo(-3*mr,mr),wt.closePath()}},we=Math.sqrt(1/3),Ae=we*2,Fe={draw:function(wt,Qt){var mr=Math.sqrt(Qt/Ae),$r=mr*we;wt.moveTo(0,-mr),wt.lineTo($r,0),wt.lineTo(0,mr),wt.lineTo(-$r,0),wt.closePath()}},Ce=.8908130915292852,qe=Math.sin(s/10)/Math.sin(7*s/10),et=Math.sin(f/10)*qe,Qe=-Math.cos(f/10)*qe,Ke={draw:function(wt,Qt){var mr=Math.sqrt(Qt*Ce),$r=et*mr,oa=Qe*mr;wt.moveTo(0,-mr),wt.lineTo($r,oa);for(var Sa=1;Sa<5;++Sa){var ya=f*Sa/5,ra=Math.cos(ya),pa=Math.sin(ya);wt.lineTo(pa*mr,-ra*mr),wt.lineTo(ra*$r-pa*oa,pa*$r+ra*oa)}wt.closePath()}},Xe={draw:function(wt,Qt){var mr=Math.sqrt(Qt),$r=-mr/2;wt.rect($r,$r,mr,mr)}},Me=Math.sqrt(3),xe={draw:function(wt,Qt){var mr=-Math.sqrt(Qt/(Me*3));wt.moveTo(0,mr*2),wt.lineTo(-Me*mr,-mr),wt.lineTo(Me*mr,-mr),wt.closePath()}},ce=-.5,Re=Math.sqrt(3)/2,$e=1/Math.sqrt(12),rt=($e/2+1)*3,Je={draw:function(wt,Qt){var mr=Math.sqrt(Qt/rt),$r=mr/2,oa=mr*$e,Sa=$r,ya=mr*$e+mr,ra=-Sa,pa=ya;wt.moveTo($r,oa),wt.lineTo(Sa,ya),wt.lineTo(ra,pa),wt.lineTo(ce*$r-Re*oa,Re*$r+ce*oa),wt.lineTo(ce*Sa-Re*ya,Re*Sa+ce*ya),wt.lineTo(ce*ra-Re*pa,Re*ra+ce*pa),wt.lineTo(ce*$r+Re*oa,ce*oa-Re*$r),wt.lineTo(ce*Sa+Re*ya,ce*ya-Re*Sa),wt.lineTo(ce*ra+Re*pa,ce*pa-Re*ra),wt.closePath()}},At=[ie,fe,Fe,Xe,Ke,xe,Je];function St(){var wt=A(ie),Qt=A(64),mr=null;function $r(){var oa;if(mr||(mr=oa=x.path()),wt.apply(this,arguments).draw(mr,+Qt.apply(this,arguments)),oa)return mr=null,oa+""||null}return $r.type=function(oa){return arguments.length?(wt=typeof oa=="function"?oa:A(oa),$r):wt},$r.size=function(oa){return arguments.length?(Qt=typeof oa=="function"?oa:A(+oa),$r):Qt},$r.context=function(oa){return arguments.length?(mr=oa??null,$r):mr},$r}function Rt(){}function Ut(wt,Qt,mr){wt._context.bezierCurveTo((2*wt._x0+wt._x1)/3,(2*wt._y0+wt._y1)/3,(wt._x0+2*wt._x1)/3,(wt._y0+2*wt._y1)/3,(wt._x0+4*wt._x1+Qt)/6,(wt._y0+4*wt._y1+mr)/6)}function ir(wt){this._context=wt}ir.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:Ut(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(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1,this._line?this._context.lineTo(wt,Qt):this._context.moveTo(wt,Qt);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:Ut(this,wt,Qt);break}this._x0=this._x1,this._x1=wt,this._y0=this._y1,this._y1=Qt}};function ar(wt){return new ir(wt)}function Mr(wt){this._context=wt}Mr.prototype={areaStart:Rt,areaEnd:Rt,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(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1,this._x2=wt,this._y2=Qt;break;case 1:this._point=2,this._x3=wt,this._y3=Qt;break;case 2:this._point=3,this._x4=wt,this._y4=Qt,this._context.moveTo((this._x0+4*this._x1+wt)/6,(this._y0+4*this._y1+Qt)/6);break;default:Ut(this,wt,Qt);break}this._x0=this._x1,this._x1=wt,this._y0=this._y1,this._y1=Qt}};function fr(wt){return new Mr(wt)}function dr(wt){this._context=wt}dr.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(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var mr=(this._x0+4*this._x1+wt)/6,$r=(this._y0+4*this._y1+Qt)/6;this._line?this._context.lineTo(mr,$r):this._context.moveTo(mr,$r);break;case 3:this._point=4;default:Ut(this,wt,Qt);break}this._x0=this._x1,this._x1=wt,this._y0=this._y1,this._y1=Qt}};function pt(wt){return new dr(wt)}function ze(wt,Qt){this._basis=new ir(wt),this._beta=Qt}ze.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var wt=this._x,Qt=this._y,mr=wt.length-1;if(mr>0)for(var $r=wt[0],oa=Qt[0],Sa=wt[mr]-$r,ya=Qt[mr]-oa,ra=-1,pa;++ra<=mr;)pa=ra/mr,this._basis.point(this._beta*wt[ra]+(1-this._beta)*($r+pa*Sa),this._beta*Qt[ra]+(1-this._beta)*(oa+pa*ya));this._x=this._y=null,this._basis.lineEnd()},point:function(wt,Qt){this._x.push(+wt),this._y.push(+Qt)}};var Ge=function wt(Qt){function mr($r){return Qt===1?new ir($r):new ze($r,Qt)}return mr.beta=function($r){return wt(+$r)},mr}(.85);function Oe(wt,Qt,mr){wt._context.bezierCurveTo(wt._x1+wt._k*(wt._x2-wt._x0),wt._y1+wt._k*(wt._y2-wt._y0),wt._x2+wt._k*(wt._x1-Qt),wt._y2+wt._k*(wt._y1-mr),wt._x2,wt._y2)}function ve(wt,Qt){this._context=wt,this._k=(1-Qt)/6}ve.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:Oe(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1,this._line?this._context.lineTo(wt,Qt):this._context.moveTo(wt,Qt);break;case 1:this._point=2,this._x1=wt,this._y1=Qt;break;case 2:this._point=3;default:Oe(this,wt,Qt);break}this._x0=this._x1,this._x1=this._x2,this._x2=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var ge=function wt(Qt){function mr($r){return new ve($r,Qt)}return mr.tension=function($r){return wt(+$r)},mr}(0);function be(wt,Qt){this._context=wt,this._k=(1-Qt)/6}be.prototype={areaStart:Rt,areaEnd:Rt,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(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1,this._x3=wt,this._y3=Qt;break;case 1:this._point=2,this._context.moveTo(this._x4=wt,this._y4=Qt);break;case 2:this._point=3,this._x5=wt,this._y5=Qt;break;default:Oe(this,wt,Qt);break}this._x0=this._x1,this._x1=this._x2,this._x2=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var Pe=function wt(Qt){function mr($r){return new be($r,Qt)}return mr.tension=function($r){return wt(+$r)},mr}(0);function We(wt,Qt){this._context=wt,this._k=(1-Qt)/6}We.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(wt,Qt){switch(wt=+wt,Qt=+Qt,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:Oe(this,wt,Qt);break}this._x0=this._x1,this._x1=this._x2,this._x2=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var ct=function wt(Qt){function mr($r){return new We($r,Qt)}return mr.tension=function($r){return wt(+$r)},mr}(0);function _t(wt,Qt,mr){var $r=wt._x1,oa=wt._y1,Sa=wt._x2,ya=wt._y2;if(wt._l01_a>n){var ra=2*wt._l01_2a+3*wt._l01_a*wt._l12_a+wt._l12_2a,pa=3*wt._l01_a*(wt._l01_a+wt._l12_a);$r=($r*ra-wt._x0*wt._l12_2a+wt._x2*wt._l01_2a)/pa,oa=(oa*ra-wt._y0*wt._l12_2a+wt._y2*wt._l01_2a)/pa}if(wt._l23_a>n){var pn=2*wt._l23_2a+3*wt._l23_a*wt._l12_a+wt._l12_2a,Ga=3*wt._l23_a*(wt._l23_a+wt._l12_a);Sa=(Sa*pn+wt._x1*wt._l23_2a-Qt*wt._l12_2a)/Ga,ya=(ya*pn+wt._y1*wt._l23_2a-mr*wt._l12_2a)/Ga}wt._context.bezierCurveTo($r,oa,Sa,ya,wt._x2,wt._y2)}function Mt(wt,Qt){this._context=wt,this._alpha=Qt}Mt.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(wt,Qt){if(wt=+wt,Qt=+Qt,this._point){var mr=this._x2-wt,$r=this._y2-Qt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(mr*mr+$r*$r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(wt,Qt):this._context.moveTo(wt,Qt);break;case 1:this._point=2;break;case 2:this._point=3;default:_t(this,wt,Qt);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=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var Nt=function wt(Qt){function mr($r){return Qt?new Mt($r,Qt):new ve($r,0)}return mr.alpha=function($r){return wt(+$r)},mr}(.5);function Bt(wt,Qt){this._context=wt,this._alpha=Qt}Bt.prototype={areaStart:Rt,areaEnd:Rt,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(wt,Qt){if(wt=+wt,Qt=+Qt,this._point){var mr=this._x2-wt,$r=this._y2-Qt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(mr*mr+$r*$r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=wt,this._y3=Qt;break;case 1:this._point=2,this._context.moveTo(this._x4=wt,this._y4=Qt);break;case 2:this._point=3,this._x5=wt,this._y5=Qt;break;default:_t(this,wt,Qt);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=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var qt=function wt(Qt){function mr($r){return Qt?new Bt($r,Qt):new be($r,0)}return mr.alpha=function($r){return wt(+$r)},mr}(.5);function Zt(wt,Qt){this._context=wt,this._alpha=Qt}Zt.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(wt,Qt){if(wt=+wt,Qt=+Qt,this._point){var mr=this._x2-wt,$r=this._y2-Qt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(mr*mr+$r*$r,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:_t(this,wt,Qt);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=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var lr=function wt(Qt){function mr($r){return Qt?new Zt($r,Qt):new We($r,0)}return mr.alpha=function($r){return wt(+$r)},mr}(.5);function ta(wt){this._context=wt}ta.prototype={areaStart:Rt,areaEnd:Rt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(wt,Qt){wt=+wt,Qt=+Qt,this._point?this._context.lineTo(wt,Qt):(this._point=1,this._context.moveTo(wt,Qt))}};function da(wt){return new ta(wt)}function wa(wt){return wt<0?-1:1}function ma(wt,Qt,mr){var $r=wt._x1-wt._x0,oa=Qt-wt._x1,Sa=(wt._y1-wt._y0)/($r||oa<0&&-0),ya=(mr-wt._y1)/(oa||$r<0&&-0),ra=(Sa*oa+ya*$r)/($r+oa);return(wa(Sa)+wa(ya))*Math.min(Math.abs(Sa),Math.abs(ya),.5*Math.abs(ra))||0}function Ia(wt,Qt){var mr=wt._x1-wt._x0;return mr?(3*(wt._y1-wt._y0)/mr-Qt)/2:Qt}function va(wt,Qt,mr){var $r=wt._x0,oa=wt._y0,Sa=wt._x1,ya=wt._y1,ra=(Sa-$r)/3;wt._context.bezierCurveTo($r+ra,oa+ra*Qt,Sa-ra,ya-ra*mr,Sa,ya)}function La(wt){this._context=wt}La.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:va(this,this._t0,Ia(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(wt,Qt){var mr=NaN;if(wt=+wt,Qt=+Qt,!(wt===this._x1&&Qt===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(wt,Qt):this._context.moveTo(wt,Qt);break;case 1:this._point=2;break;case 2:this._point=3,va(this,Ia(this,mr=ma(this,wt,Qt)),mr);break;default:va(this,this._t0,mr=ma(this,wt,Qt));break}this._x0=this._x1,this._x1=wt,this._y0=this._y1,this._y1=Qt,this._t0=mr}}};function Ka(wt){this._context=new Vt(wt)}(Ka.prototype=Object.create(La.prototype)).point=function(wt,Qt){La.prototype.point.call(this,Qt,wt)};function Vt(wt){this._context=wt}Vt.prototype={moveTo:function(wt,Qt){this._context.moveTo(Qt,wt)},closePath:function(){this._context.closePath()},lineTo:function(wt,Qt){this._context.lineTo(Qt,wt)},bezierCurveTo:function(wt,Qt,mr,$r,oa,Sa){this._context.bezierCurveTo(Qt,wt,$r,mr,Sa,oa)}};function Lt(wt){return new La(wt)}function jt(wt){return new Ka(wt)}function Ot(wt){this._context=wt}Ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var wt=this._x,Qt=this._y,mr=wt.length;if(mr)if(this._line?this._context.lineTo(wt[0],Qt[0]):this._context.moveTo(wt[0],Qt[0]),mr===2)this._context.lineTo(wt[1],Qt[1]);else for(var $r=gr(wt),oa=gr(Qt),Sa=0,ya=1;ya=0;--Qt)oa[Qt]=(ya[Qt]-oa[Qt+1])/Sa[Qt];for(Sa[mr-1]=(wt[mr]+oa[mr-1])/2,Qt=0;Qt=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1,this._line?this._context.lineTo(wt,Qt):this._context.moveTo(wt,Qt);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,Qt),this._context.lineTo(wt,Qt);else{var mr=this._x*(1-this._t)+wt*this._t;this._context.lineTo(mr,this._y),this._context.lineTo(mr,Qt)}break}}this._x=wt,this._y=Qt}};function Ur(wt){return new na(wt,.5)}function ga(wt){return new na(wt,0)}function Aa(wt){return new na(wt,1)}function Pa(wt,Qt){if((ya=wt.length)>1)for(var mr=1,$r,oa,Sa=wt[Qt[0]],ya,ra=Sa.length;mr=0;)mr[Qt]=Qt;return mr}function Oa(wt,Qt){return wt[Qt]}function dt(){var wt=A([]),Qt=sa,mr=Pa,$r=Oa;function oa(Sa){var ya=wt.apply(this,arguments),ra,pa=Sa.length,pn=ya.length,Ga=new Array(pn),qn;for(ra=0;ra0){for(var mr,$r,oa=0,Sa=wt[0].length,ya;oa0)for(var mr,$r=0,oa,Sa,ya,ra,pa,pn=wt[Qt[0]].length;$r0?(oa[0]=ya,oa[1]=ya+=Sa):Sa<0?(oa[1]=ra,oa[0]=ra+=Sa):(oa[0]=0,oa[1]=Sa)}function Er(wt,Qt){if((oa=wt.length)>0){for(var mr=0,$r=wt[Qt[0]],oa,Sa=$r.length;mr0)||!((Sa=(oa=wt[Qt[0]]).length)>0))){for(var mr=0,$r=1,oa,Sa,ya;$rSa&&(Sa=oa,mr=Qt);return mr}function zr(wt){var Qt=wt.map(Pr);return sa(wt).sort(function(mr,$r){return Qt[mr]-Qt[$r]})}function Pr(wt){for(var Qt=0,mr=-1,$r=wt.length,oa;++mr<$r;)(oa=+wt[mr][1])&&(Qt+=oa);return Qt}function Hr(wt){return zr(wt).reverse()}function Zr(wt){var Qt=wt.length,mr,$r,oa=wt.map(Pr),Sa=yr(wt),ya=0,ra=0,pa=[],pn=[];for(mr=0;mr0;--re)ae(X*=.99),ie(),q(X),ie();function ee(){var fe=x.max($,function(Fe){return Fe.length}),we=U*(R-g)/(fe-1);z>we&&(z=we);var Ae=x.min($,function(Fe){return(R-g-(Fe.length-1)*z)/x.sum(Fe,f)});$.forEach(function(Fe){Fe.forEach(function(Ce,qe){Ce.y1=(Ce.y0=qe)+Ce.value*Ae})}),J.links.forEach(function(Fe){Fe.width=Fe.value*Ae})}function q(fe){$.forEach(function(we){we.forEach(function(Ae){if(Ae.targetLinks.length){var Fe=(x.sum(Ae.targetLinks,h)/x.sum(Ae.targetLinks,f)-v(Ae))*fe;Ae.y0+=Fe,Ae.y1+=Fe}})})}function ae(fe){$.slice().reverse().forEach(function(we){we.forEach(function(Ae){if(Ae.sourceLinks.length){var Fe=(x.sum(Ae.sourceLinks,T)/x.sum(Ae.sourceLinks,f)-v(Ae))*fe;Ae.y0+=Fe,Ae.y1+=Fe}})})}function ie(){$.forEach(function(fe){var we,Ae,Fe=g,Ce=fe.length,qe;for(fe.sort(c),qe=0;qe0&&(we.y0+=Ae,we.y1+=Ae),Fe=we.y1+z;if(Ae=Fe-z-R,Ae>0)for(Fe=we.y0-=Ae,we.y1-=Ae,qe=Ce-2;qe>=0;--qe)we=fe[qe],Ae=we.y1+z-Fe,Ae>0&&(we.y0-=Ae,we.y1-=Ae),Fe=we.y0})}}function j(J){J.nodes.forEach(function($){$.sourceLinks.sort(s),$.targetLinks.sort(n)}),J.nodes.forEach(function($){var X=$.y0,re=X;$.sourceLinks.forEach(function(ee){ee.y0=X+ee.width/2,X+=ee.width}),$.targetLinks.forEach(function(ee){ee.y1=re+ee.width/2,re+=ee.width})})}return Z};function _(u){return[u.source.x1,u.y0]}function w(u){return[u.target.x0,u.y1]}var p=function(){return E.linkHorizontal().source(_).target(w)};d.sankey=M,d.sankeyCenter=a,d.sankeyLeft=t,d.sankeyRight=r,d.sankeyJustify=o,d.sankeyLinkHorizontal=p,Object.defineProperty(d,"__esModule",{value:!0})})}}),HR=He({"node_modules/elementary-circuits-directed-graph/johnson.js"(Y,G){var d=YT();G.exports=function(A,E){var e=[],t=[],r=[],o={},a=[],i;function n(S){r[S]=!1,o.hasOwnProperty(S)&&Object.keys(o[S]).forEach(function(M){delete o[S][M],r[M]&&n(M)})}function s(S){var M=!1;t.push(S),r[S]=!0;var _,w;for(_=0;_=S})}function v(S){f(S);for(var M=A,_=d(M),w=_.components.filter(function(z){return z.length>1}),p=1/0,u,g=0;g"u"?"undefined":s(ve))!=="object"&&(ve=Ge.source=_(ze,ve)),(typeof ge>"u"?"undefined":s(ge))!=="object"&&(ge=Ge.target=_(ze,ge)),ve.sourceLinks.push(Ge),ge.targetLinks.push(Ge)}),pt}function Ut(pt){pt.nodes.forEach(function(ze){ze.partOfCycle=!1,ze.value=Math.max(x.sum(ze.sourceLinks,h),x.sum(ze.targetLinks,h)),ze.sourceLinks.forEach(function(Ge){Ge.circular&&(ze.partOfCycle=!0,ze.circularLinkType=Ge.circularLinkType)}),ze.targetLinks.forEach(function(Ge){Ge.circular&&(ze.partOfCycle=!0,ze.circularLinkType=Ge.circularLinkType)})})}function ir(pt){var ze=0,Ge=0,Oe=0,ve=0,ge=x.max(pt.nodes,function(be){return be.column});return pt.links.forEach(function(be){be.circular&&(be.circularLinkType=="top"?ze=ze+be.width:Ge=Ge+be.width,be.target.column==0&&(ve=ve+be.width),be.source.column==ge&&(Oe=Oe+be.width))}),ze=ze>0?ze+p+u:ze,Ge=Ge>0?Ge+p+u:Ge,Oe=Oe>0?Oe+p+u:Oe,ve=ve>0?ve+p+u:ve,{top:ze,bottom:Ge,left:ve,right:Oe}}function ar(pt,ze){var Ge=x.max(pt.nodes,function(ct){return ct.column}),Oe=et-Ce,ve=Qe-qe,ge=Oe+ze.right+ze.left,be=ve+ze.top+ze.bottom,Pe=Oe/ge,We=ve/be;return Ce=Ce*Pe+ze.left,et=ze.right==0?et:et*Pe,qe=qe*We+ze.top,Qe=Qe*We,pt.nodes.forEach(function(ct){ct.x0=Ce+ct.column*((et-Ce-Ke)/Ge),ct.x1=ct.x0+Ke}),We}function Mr(pt){var ze,Ge,Oe;for(ze=pt.nodes,Ge=[],Oe=0;ze.length;++Oe,ze=Ge,Ge=[])ze.forEach(function(ve){ve.depth=Oe,ve.sourceLinks.forEach(function(ge){Ge.indexOf(ge.target)<0&&!ge.circular&&Ge.push(ge.target)})});for(ze=pt.nodes,Ge=[],Oe=0;ze.length;++Oe,ze=Ge,Ge=[])ze.forEach(function(ve){ve.height=Oe,ve.targetLinks.forEach(function(ge){Ge.indexOf(ge.source)<0&&!ge.circular&&Ge.push(ge.source)})});pt.nodes.forEach(function(ve){ve.column=Math.floor(xe.call(null,ve,Oe))})}function fr(pt,ze,Ge){var Oe=A.nest().key(function(ct){return ct.column}).sortKeys(x.ascending).entries(pt.nodes).map(function(ct){return ct.values});be(Ge),We();for(var ve=1,ge=ze;ge>0;--ge)Pe(ve*=.99,Ge),We();function be(ct){if(Je){var _t=1/0;Oe.forEach(function(qt){var Zt=Qe*Je/(qt.length+1);_t=Zt<_t?Zt:_t}),Xe=_t}var Mt=x.min(Oe,function(qt){return(Qe-qe-(qt.length-1)*Xe)/x.sum(qt,h)});Mt=Mt*g,pt.links.forEach(function(qt){qt.width=qt.value*Mt});var Nt=ir(pt),Bt=ar(pt,Nt);Mt=Mt*Bt,pt.links.forEach(function(qt){qt.width=qt.value*Mt}),Oe.forEach(function(qt){var Zt=qt.length;qt.forEach(function(lr,ta){lr.depth==Oe.length-1&&Zt==1||lr.depth==0&&Zt==1?(lr.y0=Qe/2-lr.value*Mt,lr.y1=lr.y0+lr.value*Mt):lr.partOfCycle?B(lr,ct)==0?(lr.y0=Qe/2+ta,lr.y1=lr.y0+lr.value*Mt):lr.circularLinkType=="top"?(lr.y0=qe+ta,lr.y1=lr.y0+lr.value*Mt):(lr.y0=Qe-lr.value*Mt-ta,lr.y1=lr.y0+lr.value*Mt):Nt.top==0||Nt.bottom==0?(lr.y0=(Qe-qe)/Zt*ta,lr.y1=lr.y0+lr.value*Mt):(lr.y0=(Qe-qe)/2-Zt/2+ta,lr.y1=lr.y0+lr.value*Mt)})})}function Pe(ct,_t){var Mt=Oe.length;Oe.forEach(function(Nt){var Bt=Nt.length,qt=Nt[0].depth;Nt.forEach(function(Zt){var lr;if((Zt.sourceLinks.length||Zt.targetLinks.length)&&!(Zt.partOfCycle&&B(Zt,_t)>0))if(qt==0&&Bt==1)lr=Zt.y1-Zt.y0,Zt.y0=Qe/2-lr/2,Zt.y1=Qe/2+lr/2;else if(qt==Mt-1&&Bt==1)lr=Zt.y1-Zt.y0,Zt.y0=Qe/2-lr/2,Zt.y1=Qe/2+lr/2;else{var ta=0,da=x.mean(Zt.sourceLinks,y),wa=x.mean(Zt.targetLinks,l);da&&wa?ta=(da+wa)/2:ta=da||wa;var ma=(ta-T(Zt))*ct;Zt.y0+=ma,Zt.y1+=ma}})})}function We(){Oe.forEach(function(ct){var _t,Mt,Nt=qe,Bt=ct.length,qt;for(ct.sort(v),qt=0;qt0&&(_t.y0+=Mt,_t.y1+=Mt),Nt=_t.y1+Xe;if(Mt=Nt-Xe-Qe,Mt>0)for(Nt=_t.y0-=Mt,_t.y1-=Mt,qt=Bt-2;qt>=0;--qt)_t=ct[qt],Mt=_t.y1+Xe-Nt,Mt>0&&(_t.y0-=Mt,_t.y1-=Mt),Nt=_t.y0})}}function dr(pt){pt.nodes.forEach(function(ze){ze.sourceLinks.sort(f),ze.targetLinks.sort(c)}),pt.nodes.forEach(function(ze){var Ge=ze.y0,Oe=Ge,ve=ze.y1,ge=ve;ze.sourceLinks.forEach(function(be){be.circular?(be.y0=ve-be.width/2,ve=ve-be.width):(be.y0=Ge+be.width/2,Ge+=be.width)}),ze.targetLinks.forEach(function(be){be.circular?(be.y1=ge-be.width/2,ge=ge-be.width):(be.y1=Oe+be.width/2,Oe+=be.width)})})}return St}function R(Ce,qe,et){var Qe=0;if(et===null){for(var Ke=[],Xe=0;Xeqe.source.column)}function B(Ce,qe){var et=0;Ce.sourceLinks.forEach(function(Ke){et=Ke.circular&&!Ae(Ke,qe)?et+1:et});var Qe=0;return Ce.targetLinks.forEach(function(Ke){Qe=Ke.circular&&!Ae(Ke,qe)?Qe+1:Qe}),et+Qe}function O(Ce){var qe=Ce.source.sourceLinks,et=0;qe.forEach(function(Xe){et=Xe.circular?et+1:et});var Qe=Ce.target.targetLinks,Ke=0;return Qe.forEach(function(Xe){Ke=Xe.circular?Ke+1:Ke}),!(et>1||Ke>1)}function L(Ce,qe,et){return Ce.sort(Z),Ce.forEach(function(Qe,Ke){var Xe=0;if(Ae(Qe,et)&&O(Qe))Qe.circularPathData.verticalBuffer=Xe+Qe.width/2;else{var Me=0;for(Me;MeXe?xe:Xe}Qe.circularPathData.verticalBuffer=Xe+Qe.width/2}}),Ce}function N(Ce,qe,et,Qe){var Ke=5,Xe=x.min(Ce.links,function(ce){return ce.source.y0});Ce.links.forEach(function(ce){ce.circular&&(ce.circularPathData={})});var Me=Ce.links.filter(function(ce){return ce.circularLinkType=="top"});L(Me,qe,Qe);var xe=Ce.links.filter(function(ce){return ce.circularLinkType=="bottom"});L(xe,qe,Qe),Ce.links.forEach(function(ce){if(ce.circular){if(ce.circularPathData.arcRadius=ce.width+u,ce.circularPathData.leftNodeBuffer=Ke,ce.circularPathData.rightNodeBuffer=Ke,ce.circularPathData.sourceWidth=ce.source.x1-ce.source.x0,ce.circularPathData.sourceX=ce.source.x0+ce.circularPathData.sourceWidth,ce.circularPathData.targetX=ce.target.x0,ce.circularPathData.sourceY=ce.y0,ce.circularPathData.targetY=ce.y1,Ae(ce,Qe)&&O(ce))ce.circularPathData.leftSmallArcRadius=u+ce.width/2,ce.circularPathData.leftLargeArcRadius=u+ce.width/2,ce.circularPathData.rightSmallArcRadius=u+ce.width/2,ce.circularPathData.rightLargeArcRadius=u+ce.width/2,ce.circularLinkType=="bottom"?(ce.circularPathData.verticalFullExtent=ce.source.y1+p+ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.rightLargeArcRadius):(ce.circularPathData.verticalFullExtent=ce.source.y0-p-ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.rightLargeArcRadius);else{var Re=ce.source.column,$e=ce.circularLinkType,rt=Ce.links.filter(function(St){return St.source.column==Re&&St.circularLinkType==$e});ce.circularLinkType=="bottom"?rt.sort(ue):rt.sort(Q);var Je=0;rt.forEach(function(St,Rt){St.circularLinkID==ce.circularLinkID&&(ce.circularPathData.leftSmallArcRadius=u+ce.width/2+Je,ce.circularPathData.leftLargeArcRadius=u+ce.width/2+Rt*qe+Je),Je=Je+St.width}),Re=ce.target.column,rt=Ce.links.filter(function(St){return St.target.column==Re&&St.circularLinkType==$e}),ce.circularLinkType=="bottom"?rt.sort(le):rt.sort(oe),Je=0,rt.forEach(function(St,Rt){St.circularLinkID==ce.circularLinkID&&(ce.circularPathData.rightSmallArcRadius=u+ce.width/2+Je,ce.circularPathData.rightLargeArcRadius=u+ce.width/2+Rt*qe+Je),Je=Je+St.width}),ce.circularLinkType=="bottom"?(ce.circularPathData.verticalFullExtent=Math.max(et,ce.source.y1,ce.target.y1)+p+ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.rightLargeArcRadius):(ce.circularPathData.verticalFullExtent=Xe-p-ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.rightLargeArcRadius)}ce.circularPathData.leftInnerExtent=ce.circularPathData.sourceX+ce.circularPathData.leftNodeBuffer,ce.circularPathData.rightInnerExtent=ce.circularPathData.targetX-ce.circularPathData.rightNodeBuffer,ce.circularPathData.leftFullExtent=ce.circularPathData.sourceX+ce.circularPathData.leftLargeArcRadius+ce.circularPathData.leftNodeBuffer,ce.circularPathData.rightFullExtent=ce.circularPathData.targetX-ce.circularPathData.rightLargeArcRadius-ce.circularPathData.rightNodeBuffer}if(ce.circular)ce.path=U(ce);else{var At=E.linkHorizontal().source(function(St){var Rt=St.source.x0+(St.source.x1-St.source.x0),Ut=St.y0;return[Rt,Ut]}).target(function(St){var Rt=St.target.x0,Ut=St.y1;return[Rt,Ut]});ce.path=At(ce)}})}function U(Ce){var qe="";return Ce.circularLinkType=="top"?qe="M"+Ce.circularPathData.sourceX+" "+Ce.circularPathData.sourceY+" L"+Ce.circularPathData.leftInnerExtent+" "+Ce.circularPathData.sourceY+" A"+Ce.circularPathData.leftLargeArcRadius+" "+Ce.circularPathData.leftSmallArcRadius+" 0 0 0 "+Ce.circularPathData.leftFullExtent+" "+(Ce.circularPathData.sourceY-Ce.circularPathData.leftSmallArcRadius)+" L"+Ce.circularPathData.leftFullExtent+" "+Ce.circularPathData.verticalLeftInnerExtent+" A"+Ce.circularPathData.leftLargeArcRadius+" "+Ce.circularPathData.leftLargeArcRadius+" 0 0 0 "+Ce.circularPathData.leftInnerExtent+" "+Ce.circularPathData.verticalFullExtent+" L"+Ce.circularPathData.rightInnerExtent+" "+Ce.circularPathData.verticalFullExtent+" A"+Ce.circularPathData.rightLargeArcRadius+" "+Ce.circularPathData.rightLargeArcRadius+" 0 0 0 "+Ce.circularPathData.rightFullExtent+" "+Ce.circularPathData.verticalRightInnerExtent+" L"+Ce.circularPathData.rightFullExtent+" "+(Ce.circularPathData.targetY-Ce.circularPathData.rightSmallArcRadius)+" A"+Ce.circularPathData.rightLargeArcRadius+" "+Ce.circularPathData.rightSmallArcRadius+" 0 0 0 "+Ce.circularPathData.rightInnerExtent+" "+Ce.circularPathData.targetY+" L"+Ce.circularPathData.targetX+" "+Ce.circularPathData.targetY:qe="M"+Ce.circularPathData.sourceX+" "+Ce.circularPathData.sourceY+" L"+Ce.circularPathData.leftInnerExtent+" "+Ce.circularPathData.sourceY+" A"+Ce.circularPathData.leftLargeArcRadius+" "+Ce.circularPathData.leftSmallArcRadius+" 0 0 1 "+Ce.circularPathData.leftFullExtent+" "+(Ce.circularPathData.sourceY+Ce.circularPathData.leftSmallArcRadius)+" L"+Ce.circularPathData.leftFullExtent+" "+Ce.circularPathData.verticalLeftInnerExtent+" A"+Ce.circularPathData.leftLargeArcRadius+" "+Ce.circularPathData.leftLargeArcRadius+" 0 0 1 "+Ce.circularPathData.leftInnerExtent+" "+Ce.circularPathData.verticalFullExtent+" L"+Ce.circularPathData.rightInnerExtent+" "+Ce.circularPathData.verticalFullExtent+" A"+Ce.circularPathData.rightLargeArcRadius+" "+Ce.circularPathData.rightLargeArcRadius+" 0 0 1 "+Ce.circularPathData.rightFullExtent+" "+Ce.circularPathData.verticalRightInnerExtent+" L"+Ce.circularPathData.rightFullExtent+" "+(Ce.circularPathData.targetY+Ce.circularPathData.rightSmallArcRadius)+" A"+Ce.circularPathData.rightLargeArcRadius+" "+Ce.circularPathData.rightSmallArcRadius+" 0 0 1 "+Ce.circularPathData.rightInnerExtent+" "+Ce.circularPathData.targetY+" L"+Ce.circularPathData.targetX+" "+Ce.circularPathData.targetY,qe}function Z(Ce,qe){return j(Ce)==j(qe)?Ce.circularLinkType=="bottom"?ue(Ce,qe):Q(Ce,qe):j(qe)-j(Ce)}function Q(Ce,qe){return Ce.y0-qe.y0}function ue(Ce,qe){return qe.y0-Ce.y0}function oe(Ce,qe){return Ce.y1-qe.y1}function le(Ce,qe){return qe.y1-Ce.y1}function j(Ce){return Ce.target.column-Ce.source.column}function J(Ce){return Ce.target.x0-Ce.source.x1}function $(Ce,qe){var et=z(Ce),Qe=J(qe)/Math.tan(et),Ke=we(Ce)=="up"?Ce.y1+Qe:Ce.y1-Qe;return Ke}function X(Ce,qe){var et=z(Ce),Qe=J(qe)/Math.tan(et),Ke=we(Ce)=="up"?Ce.y1-Qe:Ce.y1+Qe;return Ke}function re(Ce,qe,et,Qe){Ce.links.forEach(function(Ke){if(!Ke.circular&&Ke.target.column-Ke.source.column>1){var Xe=Ke.source.column+1,Me=Ke.target.column-1,xe=1,ce=Me-Xe+1;for(xe=1;Xe<=Me;Xe++,xe++)Ce.nodes.forEach(function(Re){if(Re.column==Xe){var $e=xe/(ce+1),rt=Math.pow(1-$e,3),Je=3*$e*Math.pow(1-$e,2),At=3*Math.pow($e,2)*(1-$e),St=Math.pow($e,3),Rt=rt*Ke.y0+Je*Ke.y0+At*Ke.y1+St*Ke.y1,Ut=Rt-Ke.width/2,ir=Rt+Ke.width/2,ar;Ut>Re.y0&&UtRe.y0&&irRe.y1&&q(Mr,ar,qe,et)})):UtRe.y1&&(ar=ir-Re.y0+10,Re=q(Re,ar,qe,et),Ce.nodes.forEach(function(Mr){w(Mr,Qe)==w(Re,Qe)||Mr.column!=Re.column||Mr.y0Re.y1&&q(Mr,ar,qe,et)}))}})}})}function ee(Ce,qe){return Ce.y0>qe.y0&&Ce.y0qe.y0&&Ce.y1qe.y1}function q(Ce,qe,et,Qe){return Ce.y0+qe>=et&&Ce.y1+qe<=Qe&&(Ce.y0=Ce.y0+qe,Ce.y1=Ce.y1+qe,Ce.targetLinks.forEach(function(Ke){Ke.y1=Ke.y1+qe}),Ce.sourceLinks.forEach(function(Ke){Ke.y0=Ke.y0+qe})),Ce}function ae(Ce,qe,et,Qe){Ce.nodes.forEach(function(Ke){Qe&&Ke.y+(Ke.y1-Ke.y0)>qe&&(Ke.y=Ke.y-(Ke.y+(Ke.y1-Ke.y0)-qe));var Xe=Ce.links.filter(function(ce){return w(ce.source,et)==w(Ke,et)}),Me=Xe.length;Me>1&&Xe.sort(function(ce,Re){if(!ce.circular&&!Re.circular){if(ce.target.column==Re.target.column)return ce.y1-Re.y1;if(fe(ce,Re)){if(ce.target.column>Re.target.column){var $e=X(Re,ce);return ce.y1-$e}if(Re.target.column>ce.target.column){var rt=X(ce,Re);return rt-Re.y1}}else return ce.y1-Re.y1}if(ce.circular&&!Re.circular)return ce.circularLinkType=="top"?-1:1;if(Re.circular&&!ce.circular)return Re.circularLinkType=="top"?1:-1;if(ce.circular&&Re.circular)return ce.circularLinkType===Re.circularLinkType&&ce.circularLinkType=="top"?ce.target.column===Re.target.column?ce.target.y1-Re.target.y1:Re.target.column-ce.target.column:ce.circularLinkType===Re.circularLinkType&&ce.circularLinkType=="bottom"?ce.target.column===Re.target.column?Re.target.y1-ce.target.y1:ce.target.column-Re.target.column:ce.circularLinkType=="top"?-1:1});var xe=Ke.y0;Xe.forEach(function(ce){ce.y0=xe+ce.width/2,xe=xe+ce.width}),Xe.forEach(function(ce,Re){if(ce.circularLinkType=="bottom"){var $e=Re+1,rt=0;for($e;$e1&&Ke.sort(function(xe,ce){if(!xe.circular&&!ce.circular){if(xe.source.column==ce.source.column)return xe.y0-ce.y0;if(fe(xe,ce)){if(ce.source.column0?"up":"down"}function Ae(Ce,qe){return w(Ce.source,qe)==w(Ce.target,qe)}function Fe(Ce,qe,et){var Qe=Ce.nodes,Ke=Ce.links,Xe=!1,Me=!1;if(Ke.forEach(function(Je){Je.circularLinkType=="top"?Xe=!0:Je.circularLinkType=="bottom"&&(Me=!0)}),Xe==!1||Me==!1){var xe=x.min(Qe,function(Je){return Je.y0}),ce=x.max(Qe,function(Je){return Je.y1}),Re=ce-xe,$e=et-qe,rt=$e/Re;Qe.forEach(function(Je){var At=(Je.y1-Je.y0)*rt;Je.y0=(Je.y0-xe)*rt,Je.y1=Je.y0+At}),Ke.forEach(function(Je){Je.y0=(Je.y0-xe)*rt,Je.y1=(Je.y1-xe)*rt,Je.width=Je.width*rt})}}d.sankeyCircular=m,d.sankeyCenter=i,d.sankeyLeft=r,d.sankeyRight=o,d.sankeyJustify=a,Object.defineProperty(d,"__esModule",{value:!0})})}}),JT=He({"src/traces/sankey/constants.js"(Y,G){G.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"}}}}),WR=He({"src/traces/sankey/render.js"(Y,G){var d=jR(),x=(Gp(),Go(tp)).interpolateNumber,A=Qn(),E=qR(),e=GR(),t=JT(),r=Mf(),o=Ai(),a=vo(),i=Gr(),n=i.strTranslate,s=i.strRotate,c=Wv(),f=c.keyFun,v=c.repeat,h=c.unwrap,T=yl(),l=Ei(),y=df(),b=y.CAP_SHIFT,S=y.LINE_SPACING,M=3;function _($,X,re){var ee=h(X),q=ee.trace,ae=q.domain,ie=q.orientation==="h",fe=q.node.pad,we=q.node.thickness,Ae={justify:E.sankeyJustify,left:E.sankeyLeft,right:E.sankeyRight,center:E.sankeyCenter}[q.node.align],Fe=$.width*(ae.x[1]-ae.x[0]),Ce=$.height*(ae.y[1]-ae.y[0]),qe=ee._nodes,et=ee._links,Qe=ee.circular,Ke;Qe?Ke=e.sankeyCircular().circularLinkGap(0):Ke=E.sankey(),Ke.iterations(t.sankeyIterations).size(ie?[Fe,Ce]:[Ce,Fe]).nodeWidth(we).nodePadding(fe).nodeId(function(Mr){return Mr.pointNumber}).nodeAlign(Ae).nodes(qe).links(et);var Xe=Ke();Ke.nodePadding()=ze||(pt=ze-dr.y0,pt>1e-6&&(dr.y0+=pt,dr.y1+=pt)),ze=dr.y1+fe})}function Rt(Mr){var fr=Mr.map(function(ge,be){return{x0:ge.x0,index:be}}).sort(function(ge,be){return ge.x0-be.x0}),dr=[],pt=-1,ze,Ge=-1/0,Oe;for(Me=0;MeGe+we&&(pt+=1,ze=ve.x0),Ge=ve.x0,dr[pt]||(dr[pt]=[]),dr[pt].push(ve),Oe=ze-ve.x0,ve.x0+=Oe,ve.x1+=Oe}return dr}if(q.node.x.length&&q.node.y.length){for(Me=0;Me0?" L "+q.targetX+" "+q.targetY:"")+"Z"):(re="M "+(q.targetX-X)+" "+(q.targetY-ee)+" L "+(q.rightInnerExtent-X)+" "+(q.targetY-ee)+" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightSmallArcRadius+ee)+" 0 0 0 "+(q.rightFullExtent-ee-X)+" "+(q.targetY+q.rightSmallArcRadius)+" L "+(q.rightFullExtent-ee-X)+" "+q.verticalRightInnerExtent,ae&&ie?re+=" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightLargeArcRadius+ee)+" 0 0 0 "+(q.rightInnerExtent-ee-X)+" "+(q.verticalFullExtent+ee)+" L "+(q.rightFullExtent+ee-X-(q.rightLargeArcRadius-ee))+" "+(q.verticalFullExtent+ee)+" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightLargeArcRadius+ee)+" 0 0 0 "+(q.leftFullExtent+ee)+" "+q.verticalLeftInnerExtent:ae?re+=" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightSmallArcRadius-ee)+" 0 0 1 "+(q.rightFullExtent-X-ee-(q.rightLargeArcRadius-ee))+" "+(q.verticalFullExtent-ee)+" L "+(q.leftFullExtent+ee+(q.rightLargeArcRadius-ee))+" "+(q.verticalFullExtent-ee)+" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightSmallArcRadius-ee)+" 0 0 1 "+(q.leftFullExtent+ee)+" "+q.verticalLeftInnerExtent:re+=" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightLargeArcRadius+ee)+" 0 0 0 "+(q.rightInnerExtent-X)+" "+(q.verticalFullExtent+ee)+" L "+q.leftInnerExtent+" "+(q.verticalFullExtent+ee)+" A "+(q.leftLargeArcRadius+ee)+" "+(q.leftLargeArcRadius+ee)+" 0 0 0 "+(q.leftFullExtent+ee)+" "+q.verticalLeftInnerExtent,re+=" L "+(q.leftFullExtent+ee)+" "+(q.sourceY+q.leftSmallArcRadius)+" A "+(q.leftLargeArcRadius+ee)+" "+(q.leftSmallArcRadius+ee)+" 0 0 0 "+q.leftInnerExtent+" "+(q.sourceY-ee)+" L "+q.sourceX+" "+(q.sourceY-ee)+" L "+q.sourceX+" "+(q.sourceY+ee)+" L "+q.leftInnerExtent+" "+(q.sourceY+ee)+" A "+(q.leftLargeArcRadius-ee)+" "+(q.leftSmallArcRadius-ee)+" 0 0 1 "+(q.leftFullExtent-ee)+" "+(q.sourceY+q.leftSmallArcRadius)+" L "+(q.leftFullExtent-ee)+" "+q.verticalLeftInnerExtent,ae&&ie?re+=" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightSmallArcRadius-ee)+" 0 0 1 "+(q.leftFullExtent-ee-(q.rightLargeArcRadius-ee))+" "+(q.verticalFullExtent-ee)+" L "+(q.rightFullExtent+ee-X+(q.rightLargeArcRadius-ee))+" "+(q.verticalFullExtent-ee)+" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightSmallArcRadius-ee)+" 0 0 1 "+(q.rightFullExtent+ee-X)+" "+q.verticalRightInnerExtent:ae?re+=" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightLargeArcRadius+ee)+" 0 0 0 "+(q.leftFullExtent+ee)+" "+(q.verticalFullExtent+ee)+" L "+(q.rightFullExtent-X-ee)+" "+(q.verticalFullExtent+ee)+" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightLargeArcRadius+ee)+" 0 0 0 "+(q.rightFullExtent+ee-X)+" "+q.verticalRightInnerExtent:re+=" A "+(q.leftLargeArcRadius-ee)+" "+(q.leftLargeArcRadius-ee)+" 0 0 1 "+q.leftInnerExtent+" "+(q.verticalFullExtent-ee)+" L "+(q.rightInnerExtent-X)+" "+(q.verticalFullExtent-ee)+" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightLargeArcRadius-ee)+" 0 0 1 "+(q.rightFullExtent+ee-X)+" "+q.verticalRightInnerExtent,re+=" L "+(q.rightFullExtent+ee-X)+" "+(q.targetY+q.rightSmallArcRadius)+" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightSmallArcRadius-ee)+" 0 0 1 "+(q.rightInnerExtent-X)+" "+(q.targetY+ee)+" L "+(q.targetX-X)+" "+(q.targetY+ee)+(X>0?" L "+q.targetX+" "+q.targetY:"")+"Z"),re}function u(){var $=.5;function X(re){var ee=re.linkArrowLength;if(re.link.circular)return p(re.link,ee);var q=Math.abs((re.link.target.x0-re.link.source.x1)/2);ee>q&&(ee=q);var ae=re.link.source.x1,ie=re.link.target.x0-ee,fe=x(ae,ie),we=fe($),Ae=fe(1-$),Fe=re.link.y0-re.link.width/2,Ce=re.link.y0+re.link.width/2,qe=re.link.y1-re.link.width/2,et=re.link.y1+re.link.width/2,Qe="M"+ae+","+Fe,Ke="C"+we+","+Fe+" "+Ae+","+qe+" "+ie+","+qe,Xe="C"+Ae+","+et+" "+we+","+Ce+" "+ae+","+Ce,Me=ee>0?"L"+(ie+ee)+","+(qe+re.link.width/2):"";return Me+="L"+ie+","+et,Qe+Ke+Me+Xe+"Z"}return X}function g($,X){var re=r(X.color),ee=t.nodePadAcross,q=$.nodePad/2;X.dx=X.x1-X.x0,X.dy=X.y1-X.y0;var ae=X.dx,ie=Math.max(.5,X.dy),fe="node_"+X.pointNumber;return X.group&&(fe=i.randstr()),X.trace=$.trace,X.curveNumber=$.trace.index,{index:X.pointNumber,key:fe,partOfGroup:X.partOfGroup||!1,group:X.group,traceId:$.key,trace:$.trace,node:X,nodePad:$.nodePad,nodeLineColor:$.nodeLineColor,nodeLineWidth:$.nodeLineWidth,textFont:$.textFont,size:$.horizontal?$.height:$.width,visibleWidth:Math.ceil(ae),visibleHeight:ie,zoneX:-ee,zoneY:-q,zoneWidth:ae+2*ee,zoneHeight:ie+2*q,labelY:$.horizontal?X.dy/2+1:X.dx/2+1,left:X.originalLayer===1,sizeAcross:$.width,forceLayouts:$.forceLayouts,horizontal:$.horizontal,darkBackground:re.getBrightness()<=128,tinyColorHue:o.tinyRGB(re),tinyColorAlpha:re.getAlpha(),valueFormat:$.valueFormat,valueSuffix:$.valueSuffix,sankey:$.sankey,graph:$.graph,arrangement:$.arrangement,uniqueNodeLabelPathId:[$.guid,$.key,fe].join("_"),interactionState:$.interactionState,figure:$}}function m($){$.attr("transform",function(X){return n(X.node.x0.toFixed(3),X.node.y0.toFixed(3))})}function R($){$.call(m)}function P($,X){$.call(R),X.attr("d",u())}function z($){$.attr("width",function(X){return X.node.x1-X.node.x0}).attr("height",function(X){return X.visibleHeight})}function F($){return $.link.width>1||$.linkLineWidth>0}function B($){var X=n($.translateX,$.translateY);return X+($.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function O($,X,re){$.on(".basic",null).on("mouseover.basic",function(ee){!ee.interactionState.dragInProgress&&!ee.partOfGroup&&(re.hover(this,ee,X),ee.interactionState.hovered=[this,ee])}).on("mousemove.basic",function(ee){!ee.interactionState.dragInProgress&&!ee.partOfGroup&&(re.follow(this,ee),ee.interactionState.hovered=[this,ee])}).on("mouseout.basic",function(ee){!ee.interactionState.dragInProgress&&!ee.partOfGroup&&(re.unhover(this,ee,X),ee.interactionState.hovered=!1)}).on("click.basic",function(ee){ee.interactionState.hovered&&(re.unhover(this,ee,X),ee.interactionState.hovered=!1),!ee.interactionState.dragInProgress&&!ee.partOfGroup&&re.select(this,ee,X)})}function L($,X,re,ee){var q=A.behavior.drag().origin(function(ae){return{x:ae.node.x0+ae.visibleWidth/2,y:ae.node.y0+ae.visibleHeight/2}}).on("dragstart",function(ae){if(ae.arrangement!=="fixed"&&(i.ensureSingle(ee._fullLayout._infolayer,"g","dragcover",function(fe){ee._fullLayout._dragCover=fe}),i.raiseToTop(this),ae.interactionState.dragInProgress=ae.node,oe(ae.node),ae.interactionState.hovered&&(re.nodeEvents.unhover.apply(0,ae.interactionState.hovered),ae.interactionState.hovered=!1),ae.arrangement==="snap")){var ie=ae.traceId+"|"+ae.key;ae.forceLayouts[ie]?ae.forceLayouts[ie].alpha(1):N($,ie,ae),U($,X,ae,ie,ee)}}).on("drag",function(ae){if(ae.arrangement!=="fixed"){var ie=A.event.x,fe=A.event.y;ae.arrangement==="snap"?(ae.node.x0=ie-ae.visibleWidth/2,ae.node.x1=ie+ae.visibleWidth/2,ae.node.y0=fe-ae.visibleHeight/2,ae.node.y1=fe+ae.visibleHeight/2):(ae.arrangement==="freeform"&&(ae.node.x0=ie-ae.visibleWidth/2,ae.node.x1=ie+ae.visibleWidth/2),fe=Math.max(0,Math.min(ae.size-ae.visibleHeight/2,fe)),ae.node.y0=fe-ae.visibleHeight/2,ae.node.y1=fe+ae.visibleHeight/2),oe(ae.node),ae.arrangement!=="snap"&&(ae.sankey.update(ae.graph),P($.filter(le(ae)),X))}}).on("dragend",function(ae){if(ae.arrangement!=="fixed"){ae.interactionState.dragInProgress=!1;for(var ie=0;ie0)window.requestAnimationFrame(ae);else{var we=re.node.originalX;re.node.x0=we-re.visibleWidth/2,re.node.x1=we+re.visibleWidth/2,Q(re,q)}})}function Z($,X,re,ee){return function(){for(var ae=0,ie=0;ie0&&ee.forceLayouts[X].alpha(0)}}function Q($,X){for(var re=[],ee=[],q=0;q<$.graph.nodes.length;q++){var ae=($.graph.nodes[q].x0+$.graph.nodes[q].x1)/2,ie=($.graph.nodes[q].y0+$.graph.nodes[q].y1)/2;re.push(ae/$.figure.width),ee.push(ie/$.figure.height)}l.call("_guiRestyle",X,{"node.x":[re],"node.y":[ee]},$.trace.index).then(function(){X._fullLayout._dragCover&&X._fullLayout._dragCover.remove()})}function ue($){var X=[],re;for(re=0;re<$.length;re++)$[re].originalX=($[re].x0+$[re].x1)/2,$[re].originalY=($[re].y0+$[re].y1)/2,X.indexOf($[re].originalX)===-1&&X.push($[re].originalX);for(X.sort(function(ee,q){return ee-q}),re=0;re<$.length;re++)$[re].originalLayerIndex=X.indexOf($[re].originalX),$[re].originalLayer=$[re].originalLayerIndex/(X.length-1)}function oe($){$.lastDraggedX=$.x0+$.dx/2,$.lastDraggedY=$.y0+$.dy/2}function le($){return function(X){return X.node.originalX===$.node.originalX}}function j($){for(var X=0;X<$.length;X++)$[X].y=($[X].y0+$[X].y1)/2,$[X].x=($[X].x0+$[X].x1)/2}function J($){for(var X=0;X<$.length;X++)$[X].y0=$[X].y-$[X].dy/2,$[X].y1=$[X].y0+$[X].dy,$[X].x0=$[X].x-$[X].dx/2,$[X].x1=$[X].x0+$[X].dx}G.exports=function($,X,re,ee,q){var ae=$._context.staticPlot,ie=!1;i.ensureSingle($._fullLayout._infolayer,"g","first-render",function(){ie=!0});var fe=$._fullLayout._dragCover,we=re.filter(function(Xe){return h(Xe).trace.visible}).map(_.bind(null,ee)),Ae=X.selectAll("."+t.cn.sankey).data(we,f);Ae.exit().remove(),Ae.enter().append("g").classed(t.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events",ae?"none":"auto").attr("transform",B),Ae.each(function(Xe,Me){$._fullData[Me]._sankey=Xe;var xe="bgsankey-"+Xe.trace.uid+"-"+Me;i.ensureSingle($._fullLayout._draggers,"rect",xe),$._fullData[Me]._bgRect=A.select("."+xe),$._fullData[Me]._bgRect.style("pointer-events",ae?"none":"all").attr("width",Xe.width).attr("height",Xe.height).attr("x",Xe.translateX).attr("y",Xe.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})}),Ae.transition().ease(t.ease).duration(t.duration).attr("transform",B);var Fe=Ae.selectAll("."+t.cn.sankeyLinks).data(v,f);Fe.enter().append("g").classed(t.cn.sankeyLinks,!0).style("fill","none");var Ce=Fe.selectAll("."+t.cn.sankeyLink).data(function(Xe){var Me=Xe.graph.links;return Me.filter(function(xe){return xe.value}).map(w.bind(null,Xe))},f);Ce.enter().append("path").classed(t.cn.sankeyLink,!0).call(O,Ae,q.linkEvents),Ce.style("stroke",function(Xe){return F(Xe)?o.tinyRGB(r(Xe.linkLineColor)):Xe.tinyColorHue}).style("stroke-opacity",function(Xe){return F(Xe)?o.opacity(Xe.linkLineColor):Xe.tinyColorAlpha}).style("fill",function(Xe){return Xe.tinyColorHue}).style("fill-opacity",function(Xe){return Xe.tinyColorAlpha}).style("stroke-width",function(Xe){return F(Xe)?Xe.linkLineWidth:1}).attr("d",u()),Ce.style("opacity",function(){return $._context.staticPlot||ie||fe?1:0}).transition().ease(t.ease).duration(t.duration).style("opacity",1),Ce.exit().transition().ease(t.ease).duration(t.duration).style("opacity",0).remove();var qe=Ae.selectAll("."+t.cn.sankeyNodeSet).data(v,f);qe.enter().append("g").classed(t.cn.sankeyNodeSet,!0),qe.style("cursor",function(Xe){switch(Xe.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var et=qe.selectAll("."+t.cn.sankeyNode).data(function(Xe){var Me=Xe.graph.nodes;return ue(Me),Me.map(g.bind(null,Xe))},f);et.enter().append("g").classed(t.cn.sankeyNode,!0).call(m).style("opacity",function(Xe){return($._context.staticPlot||ie)&&!Xe.partOfGroup?1:0}),et.call(O,Ae,q.nodeEvents).call(L,Ce,q,$),et.transition().ease(t.ease).duration(t.duration).call(m).style("opacity",function(Xe){return Xe.partOfGroup?0:1}),et.exit().transition().ease(t.ease).duration(t.duration).style("opacity",0).remove();var Qe=et.selectAll("."+t.cn.nodeRect).data(v);Qe.enter().append("rect").classed(t.cn.nodeRect,!0).call(z),Qe.style("stroke-width",function(Xe){return Xe.nodeLineWidth}).style("stroke",function(Xe){return o.tinyRGB(r(Xe.nodeLineColor))}).style("stroke-opacity",function(Xe){return o.opacity(Xe.nodeLineColor)}).style("fill",function(Xe){return Xe.tinyColorHue}).style("fill-opacity",function(Xe){return Xe.tinyColorAlpha}),Qe.transition().ease(t.ease).duration(t.duration).call(z);var Ke=et.selectAll("."+t.cn.nodeLabel).data(v);Ke.enter().append("text").classed(t.cn.nodeLabel,!0).style("cursor","default"),Ke.attr("data-notex",1).text(function(Xe){return Xe.node.label}).each(function(Xe){var Me=A.select(this);a.font(Me,Xe.textFont),T.convertToTspans(Me,$)}).attr("text-anchor",function(Xe){return Xe.horizontal&&Xe.left?"end":"start"}).attr("transform",function(Xe){var Me=A.select(this),xe=T.lineCount(Me),ce=Xe.textFont.size*((xe-1)*S-b),Re=Xe.nodeLineWidth/2+M,$e=((Xe.horizontal?Xe.visibleHeight:Xe.visibleWidth)-ce)/2;Xe.horizontal&&(Xe.left?Re=-Re:Re+=Xe.visibleWidth);var rt=Xe.horizontal?"":"scale(-1,1)"+s(90);return n(Xe.horizontal?Re:$e,Xe.horizontal?$e:Re)+rt}),Ke.transition().ease(t.ease).duration(t.duration)}}}),$T=He({"src/traces/sankey/plot.js"(Y,G){var d=Qn(),x=Gr(),A=x.numberFormat,E=WR(),e=Wu(),t=Ai(),r=JT().cn,o=x._;function a(b){return b!==""}function i(b,S){return b.filter(function(M){return M.key===S.traceId})}function n(b,S){d.select(b).select("path").style("fill-opacity",S),d.select(b).select("rect").style("fill-opacity",S)}function s(b){d.select(b).select("text.name").style("fill","black")}function c(b){return function(S){return b.node.sourceLinks.indexOf(S.link)!==-1||b.node.targetLinks.indexOf(S.link)!==-1}}function f(b){return function(S){return S.node.sourceLinks.indexOf(b.link)!==-1||S.node.targetLinks.indexOf(b.link)!==-1}}function v(b,S,M){S&&M&&i(M,S).selectAll("."+r.sankeyLink).filter(c(S)).call(T.bind(0,S,M,!1))}function h(b,S,M){S&&M&&i(M,S).selectAll("."+r.sankeyLink).filter(c(S)).call(l.bind(0,S,M,!1))}function T(b,S,M,_){_.style("fill",function(w){if(!w.link.concentrationscale)return w.tinyColorHoverHue}).style("fill-opacity",function(w){if(!w.link.concentrationscale)return w.tinyColorHoverAlpha}),_.each(function(w){var p=w.link.label;p!==""&&i(S,b).selectAll("."+r.sankeyLink).filter(function(u){return u.link.label===p}).style("fill",function(u){if(!u.link.concentrationscale)return u.tinyColorHoverHue}).style("fill-opacity",function(u){if(!u.link.concentrationscale)return u.tinyColorHoverAlpha})}),M&&i(S,b).selectAll("."+r.sankeyNode).filter(f(b)).call(v)}function l(b,S,M,_){_.style("fill",function(w){return w.tinyColorHue}).style("fill-opacity",function(w){return w.tinyColorAlpha}),_.each(function(w){var p=w.link.label;p!==""&&i(S,b).selectAll("."+r.sankeyLink).filter(function(u){return u.link.label===p}).style("fill",function(u){return u.tinyColorHue}).style("fill-opacity",function(u){return u.tinyColorAlpha})}),M&&i(S,b).selectAll(r.sankeyNode).filter(f(b)).call(h)}function y(b,S){var M=b.hoverlabel||{},_=x.nestedProperty(M,S).get();return Array.isArray(_)?!1:_}G.exports=function(S,M){for(var _=S._fullLayout,w=_._paper,p=_._size,u=0;u"),color:y(j,"bgcolor")||t.addOpacity(ee.color,1),borderColor:y(j,"bordercolor"),fontFamily:y(j,"font.family"),fontSize:y(j,"font.size"),fontColor:y(j,"font.color"),fontWeight:y(j,"font.weight"),fontStyle:y(j,"font.style"),fontVariant:y(j,"font.variant"),fontTextcase:y(j,"font.textcase"),fontLineposition:y(j,"font.lineposition"),fontShadow:y(j,"font.shadow"),nameLength:y(j,"namelength"),textAlign:y(j,"align"),idealAlign:d.event.x"),color:y(j,"bgcolor")||le.tinyColorHue,borderColor:y(j,"bordercolor"),fontFamily:y(j,"font.family"),fontSize:y(j,"font.size"),fontColor:y(j,"font.color"),fontWeight:y(j,"font.weight"),fontStyle:y(j,"font.style"),fontVariant:y(j,"font.variant"),fontTextcase:y(j,"font.textcase"),fontLineposition:y(j,"font.lineposition"),fontShadow:y(j,"font.shadow"),nameLength:y(j,"namelength"),textAlign:y(j,"align"),idealAlign:"left",hovertemplate:j.hovertemplate,hovertemplateLabels:ae,eventData:[le.node]},{container:_._hoverlayer.node(),outerContainer:_._paper.node(),gd:S});n(we,.85),s(we)}}},ue=function(oe,le,j){S._fullLayout.hovermode!==!1&&(d.select(oe).call(h,le,j),le.node.trace.node.hoverinfo!=="skip"&&(le.node.fullData=le.node.trace,S.emit("plotly_unhover",{event:d.event,points:[le.node]})),e.loneUnhover(_._hoverlayer.node()))};E(S,w,M,{width:p.w,height:p.h,margin:{t:p.t,r:p.r,b:p.b,l:p.l}},{linkEvents:{hover:R,follow:L,unhover:N,select:m},nodeEvents:{hover:Z,follow:Q,unhover:ue,select:U}})}}}),ZR=He({"src/traces/sankey/base_plot.js"(Y){var G=hu().overrideAll,d=Uf().getModuleCalcData,x=$T(),A=Od(),E=xv(),e=fh(),t=dc().prepSelect,r=Gr(),o=Ei(),a="sankey";Y.name=a,Y.baseLayoutAttrOverrides=G({hoverlabel:A.hoverlabel},"plot","nested"),Y.plot=function(n){var s=d(n.calcdata,a)[0];x(n,s),Y.updateFx(n)},Y.clean=function(n,s,c,f){var v=f._has&&f._has(a),h=s._has&&s._has(a);v&&!h&&(f._paperdiv.selectAll(".sankey").remove(),f._paperdiv.selectAll(".bgsankey").remove())},Y.updateFx=function(n){for(var s=0;s0}G.exports=function(F,B,O,L){var N=F._fullLayout,U;b(O)&&L&&(U=L()),E.makeTraceGroups(N._indicatorlayer,B,"trace").each(function(Z){var Q=Z[0],ue=Q.trace,oe=d.select(this),le=ue._hasGauge,j=ue._isAngular,J=ue._isBullet,$=ue.domain,X={w:N._size.w*($.x[1]-$.x[0]),h:N._size.h*($.y[1]-$.y[0]),l:N._size.l+N._size.w*$.x[0],r:N._size.r+N._size.w*(1-$.x[1]),t:N._size.t+N._size.h*(1-$.y[1]),b:N._size.b+N._size.h*$.y[0]},re=X.l+X.w/2,ee=X.t+X.h/2,q=Math.min(X.w/2,X.h),ae=i.innerRadius*q,ie,fe,we,Ae=ue.align||"center";if(fe=ee,!le)ie=X.l+l[Ae]*X.w,we=function(ce){return g(ce,X.w,X.h)};else if(j&&(ie=re,fe=ee+q/2,we=function(ce){return m(ce,.9*ae)}),J){var Fe=i.bulletPadding,Ce=1-i.bulletNumberDomainSize+Fe;ie=X.l+(Ce+(1-Ce)*l[Ae])*X.w,we=function(ce){return g(ce,(i.bulletNumberDomainSize-Fe)*X.w,X.h)}}_(F,oe,Z,{numbersX:ie,numbersY:fe,numbersScaler:we,transitionOpts:O,onComplete:U});var qe,et;le&&(qe={range:ue.gauge.axis.range,color:ue.gauge.bgcolor,line:{color:ue.gauge.bordercolor,width:0},thickness:1},et={range:ue.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:ue.gauge.bordercolor,width:ue.gauge.borderwidth},thickness:1});var Qe=oe.selectAll("g.angular").data(j?Z:[]);Qe.exit().remove();var Ke=oe.selectAll("g.angularaxis").data(j?Z:[]);Ke.exit().remove(),j&&M(F,oe,Z,{radius:q,innerRadius:ae,gauge:Qe,layer:Ke,size:X,gaugeBg:qe,gaugeOutline:et,transitionOpts:O,onComplete:U});var Xe=oe.selectAll("g.bullet").data(J?Z:[]);Xe.exit().remove();var Me=oe.selectAll("g.bulletaxis").data(J?Z:[]);Me.exit().remove(),J&&S(F,oe,Z,{gauge:Xe,layer:Me,size:X,gaugeBg:qe,gaugeOutline:et,transitionOpts:O,onComplete:U});var xe=oe.selectAll("text.title").data(Z);xe.exit().remove(),xe.enter().append("text").classed("title",!0),xe.attr("text-anchor",function(){return J?T.right:T[ue.title.align]}).text(ue.title.text).call(a.font,ue.title.font).call(n.convertToTspans,F),xe.attr("transform",function(){var ce=X.l+X.w*l[ue.title.align],Re,$e=i.titlePadding,rt=a.bBox(xe.node());if(le){if(j)if(ue.gauge.axis.visible){var Je=a.bBox(Ke.node());Re=Je.top-$e-rt.bottom}else Re=X.t+X.h/2-q/2-rt.bottom-$e;J&&(Re=fe-(rt.top+rt.bottom)/2,ce=X.l-i.bulletPadding*X.w)}else Re=ue._numbersTop-$e-rt.bottom;return t(ce,Re)})})};function S(z,F,B,O){var L=B[0].trace,N=O.gauge,U=O.layer,Z=O.gaugeBg,Q=O.gaugeOutline,ue=O.size,oe=L.domain,le=O.transitionOpts,j=O.onComplete,J,$,X,re,ee;N.enter().append("g").classed("bullet",!0),N.attr("transform",t(ue.l,ue.t)),U.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),U.selectAll("g.xbulletaxistick,path,text").remove();var q=ue.h,ae=L.gauge.bar.thickness*q,ie=oe.x[0],fe=oe.x[0]+(oe.x[1]-oe.x[0])*(L._hasNumber||L._hasDelta?1-i.bulletNumberDomainSize:1);J=u(z,L.gauge.axis),J._id="xbulletaxis",J.domain=[ie,fe],J.setScale(),$=s.calcTicks(J),X=s.makeTransTickFn(J),re=s.getTickSigns(J)[2],ee=ue.t+ue.h,J.visible&&(s.drawTicks(z,J,{vals:J.ticks==="inside"?s.clipEnds(J,$):$,layer:U,path:s.makeTickPath(J,ee,re),transFn:X}),s.drawLabels(z,J,{vals:$,layer:U,transFn:X,labelFns:s.makeLabelFns(J,ee)}));function we(Ke){Ke.attr("width",function(Xe){return Math.max(0,J.c2p(Xe.range[1])-J.c2p(Xe.range[0]))}).attr("x",function(Xe){return J.c2p(Xe.range[0])}).attr("y",function(Xe){return .5*(1-Xe.thickness)*q}).attr("height",function(Xe){return Xe.thickness*q})}var Ae=[Z].concat(L.gauge.steps),Fe=N.selectAll("g.bg-bullet").data(Ae);Fe.enter().append("g").classed("bg-bullet",!0).append("rect"),Fe.select("rect").call(we).call(w),Fe.exit().remove();var Ce=N.selectAll("g.value-bullet").data([L.gauge.bar]);Ce.enter().append("g").classed("value-bullet",!0).append("rect"),Ce.select("rect").attr("height",ae).attr("y",(q-ae)/2).call(w),b(le)?Ce.select("rect").transition().duration(le.duration).ease(le.easing).each("end",function(){j&&j()}).each("interrupt",function(){j&&j()}).attr("width",Math.max(0,J.c2p(Math.min(L.gauge.axis.range[1],B[0].y)))):Ce.select("rect").attr("width",typeof B[0].y=="number"?Math.max(0,J.c2p(Math.min(L.gauge.axis.range[1],B[0].y))):0),Ce.exit().remove();var qe=B.filter(function(){return L.gauge.threshold.value||L.gauge.threshold.value===0}),et=N.selectAll("g.threshold-bullet").data(qe);et.enter().append("g").classed("threshold-bullet",!0).append("line"),et.select("line").attr("x1",J.c2p(L.gauge.threshold.value)).attr("x2",J.c2p(L.gauge.threshold.value)).attr("y1",(1-L.gauge.threshold.thickness)/2*q).attr("y2",(1-(1-L.gauge.threshold.thickness)/2)*q).call(h.stroke,L.gauge.threshold.line.color).style("stroke-width",L.gauge.threshold.line.width),et.exit().remove();var Qe=N.selectAll("g.gauge-outline").data([Q]);Qe.enter().append("g").classed("gauge-outline",!0).append("rect"),Qe.select("rect").call(we).call(w),Qe.exit().remove()}function M(z,F,B,O){var L=B[0].trace,N=O.size,U=O.radius,Z=O.innerRadius,Q=O.gaugeBg,ue=O.gaugeOutline,oe=[N.l+N.w/2,N.t+N.h/2+U/2],le=O.gauge,j=O.layer,J=O.transitionOpts,$=O.onComplete,X=Math.PI/2;function re(At){var St=L.gauge.axis.range[0],Rt=L.gauge.axis.range[1],Ut=(At-St)/(Rt-St)*Math.PI-X;return Ut<-X?-X:Ut>X?X:Ut}function ee(At){return d.svg.arc().innerRadius((Z+U)/2-At/2*(U-Z)).outerRadius((Z+U)/2+At/2*(U-Z)).startAngle(-X)}function q(At){At.attr("d",function(St){return ee(St.thickness).startAngle(re(St.range[0])).endAngle(re(St.range[1]))()})}var ae,ie,fe,we;le.enter().append("g").classed("angular",!0),le.attr("transform",t(oe[0],oe[1])),j.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),j.selectAll("g.xangularaxistick,path,text").remove(),ae=u(z,L.gauge.axis),ae.type="linear",ae.range=L.gauge.axis.range,ae._id="xangularaxis",ae.ticklabeloverflow="allow",ae.setScale();var Ae=function(At){return(ae.range[0]-At.x)/(ae.range[1]-ae.range[0])*Math.PI+Math.PI},Fe={},Ce=s.makeLabelFns(ae,0),qe=Ce.labelStandoff;Fe.xFn=function(At){var St=Ae(At);return Math.cos(St)*qe},Fe.yFn=function(At){var St=Ae(At),Rt=Math.sin(St)>0?.2:1;return-Math.sin(St)*(qe+At.fontSize*Rt)+Math.abs(Math.cos(St))*(At.fontSize*o)},Fe.anchorFn=function(At){var St=Ae(At),Rt=Math.cos(St);return Math.abs(Rt)<.1?"middle":Rt>0?"start":"end"},Fe.heightFn=function(At,St,Rt){var Ut=Ae(At);return-.5*(1+Math.sin(Ut))*Rt};var et=function(At){return t(oe[0]+U*Math.cos(At),oe[1]-U*Math.sin(At))};fe=function(At){return et(Ae(At))};var Qe=function(At){var St=Ae(At);return et(St)+"rotate("+-r(St)+")"};if(ie=s.calcTicks(ae),we=s.getTickSigns(ae)[2],ae.visible){we=ae.ticks==="inside"?-1:1;var Ke=(ae.linewidth||1)/2;s.drawTicks(z,ae,{vals:ie,layer:j,path:"M"+we*Ke+",0h"+we*ae.ticklen,transFn:Qe}),s.drawLabels(z,ae,{vals:ie,layer:j,transFn:fe,labelFns:Fe})}var Xe=[Q].concat(L.gauge.steps),Me=le.selectAll("g.bg-arc").data(Xe);Me.enter().append("g").classed("bg-arc",!0).append("path"),Me.select("path").call(q).call(w),Me.exit().remove();var xe=ee(L.gauge.bar.thickness),ce=le.selectAll("g.value-arc").data([L.gauge.bar]);ce.enter().append("g").classed("value-arc",!0).append("path");var Re=ce.select("path");b(J)?(Re.transition().duration(J.duration).ease(J.easing).each("end",function(){$&&$()}).each("interrupt",function(){$&&$()}).attrTween("d",p(xe,re(B[0].lastY),re(B[0].y))),L._lastValue=B[0].y):Re.attr("d",typeof B[0].y=="number"?xe.endAngle(re(B[0].y)):"M0,0Z"),Re.call(w),ce.exit().remove(),Xe=[];var $e=L.gauge.threshold.value;($e||$e===0)&&Xe.push({range:[$e,$e],color:L.gauge.threshold.color,line:{color:L.gauge.threshold.line.color,width:L.gauge.threshold.line.width},thickness:L.gauge.threshold.thickness});var rt=le.selectAll("g.threshold-arc").data(Xe);rt.enter().append("g").classed("threshold-arc",!0).append("path"),rt.select("path").call(q).call(w),rt.exit().remove();var Je=le.selectAll("g.gauge-outline").data([ue]);Je.enter().append("g").classed("gauge-outline",!0).append("path"),Je.select("path").call(q).call(w),Je.exit().remove()}function _(z,F,B,O){var L=B[0].trace,N=O.numbersX,U=O.numbersY,Z=L.align||"center",Q=T[Z],ue=O.transitionOpts,oe=O.onComplete,le=E.ensureSingle(F,"g","numbers"),j,J,$,X=[];L._hasNumber&&X.push("number"),L._hasDelta&&(X.push("delta"),L.delta.position==="left"&&X.reverse());var re=le.selectAll("text").data(X);re.enter().append("text"),re.attr("text-anchor",function(){return Q}).attr("class",function(et){return et}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),re.exit().remove();function ee(et,Qe,Ke,Xe){if(et.match("s")&&Ke>=0!=Xe>=0&&!Qe(Ke).slice(-1).match(y)&&!Qe(Xe).slice(-1).match(y)){var Me=et.slice().replace("s","f").replace(/\d+/,function(ce){return parseInt(ce)-1}),xe=u(z,{tickformat:Me});return function(ce){return Math.abs(ce)<1?s.tickText(xe,ce).text:Qe(ce)}}else return Qe}function q(){var et=u(z,{tickformat:L.number.valueformat},L._range);et.setScale(),s.prepTicks(et);var Qe=function(ce){return s.tickText(et,ce).text},Ke=L.number.suffix,Xe=L.number.prefix,Me=le.select("text.number");function xe(){var ce=typeof B[0].y=="number"?Xe+Qe(B[0].y)+Ke:"-";Me.text(ce).call(a.font,L.number.font).call(n.convertToTspans,z)}return b(ue)?Me.transition().duration(ue.duration).ease(ue.easing).each("end",function(){xe(),oe&&oe()}).each("interrupt",function(){xe(),oe&&oe()}).attrTween("text",function(){var ce=d.select(this),Re=A(B[0].lastY,B[0].y);L._lastValue=B[0].y;var $e=ee(L.number.valueformat,Qe,B[0].lastY,B[0].y);return function(rt){ce.text(Xe+$e(Re(rt))+Ke)}}):xe(),j=R(Xe+Qe(B[0].y)+Ke,L.number.font,Q,z),Me}function ae(){var et=u(z,{tickformat:L.delta.valueformat},L._range);et.setScale(),s.prepTicks(et);var Qe=function(rt){return s.tickText(et,rt).text},Ke=L.delta.suffix,Xe=L.delta.prefix,Me=function(rt){var Je=L.delta.relative?rt.relativeDelta:rt.delta;return Je},xe=function(rt,Je){return rt===0||typeof rt!="number"||isNaN(rt)?"-":(rt>0?L.delta.increasing.symbol:L.delta.decreasing.symbol)+Xe+Je(rt)+Ke},ce=function(rt){return rt.delta>=0?L.delta.increasing.color:L.delta.decreasing.color};L._deltaLastValue===void 0&&(L._deltaLastValue=Me(B[0]));var Re=le.select("text.delta");Re.call(a.font,L.delta.font).call(h.fill,ce({delta:L._deltaLastValue}));function $e(){Re.text(xe(Me(B[0]),Qe)).call(h.fill,ce(B[0])).call(n.convertToTspans,z)}return b(ue)?Re.transition().duration(ue.duration).ease(ue.easing).tween("text",function(){var rt=d.select(this),Je=Me(B[0]),At=L._deltaLastValue,St=ee(L.delta.valueformat,Qe,At,Je),Rt=A(At,Je);return L._deltaLastValue=Je,function(Ut){rt.text(xe(Rt(Ut),St)),rt.call(h.fill,ce({delta:Rt(Ut)}))}}).each("end",function(){$e(),oe&&oe()}).each("interrupt",function(){$e(),oe&&oe()}):$e(),J=R(xe(Me(B[0]),Qe),L.delta.font,Q,z),Re}var ie=L.mode+L.align,fe;if(L._hasDelta&&(fe=ae(),ie+=L.delta.position+L.delta.font.size+L.delta.font.family+L.delta.valueformat,ie+=L.delta.increasing.symbol+L.delta.decreasing.symbol,$=J),L._hasNumber&&(q(),ie+=L.number.font.size+L.number.font.family+L.number.valueformat+L.number.suffix+L.number.prefix,$=j),L._hasDelta&&L._hasNumber){var we=[(j.left+j.right)/2,(j.top+j.bottom)/2],Ae=[(J.left+J.right)/2,(J.top+J.bottom)/2],Fe,Ce,qe=.75*L.delta.font.size;L.delta.position==="left"&&(Fe=P(L,"deltaPos",0,-1*(j.width*l[L.align]+J.width*(1-l[L.align])+qe),ie,Math.min),Ce=we[1]-Ae[1],$={width:j.width+J.width+qe,height:Math.max(j.height,J.height),left:J.left+Fe,right:j.right,top:Math.min(j.top,J.top+Ce),bottom:Math.max(j.bottom,J.bottom+Ce)}),L.delta.position==="right"&&(Fe=P(L,"deltaPos",0,j.width*(1-l[L.align])+J.width*l[L.align]+qe,ie,Math.max),Ce=we[1]-Ae[1],$={width:j.width+J.width+qe,height:Math.max(j.height,J.height),left:j.left,right:J.right+Fe,top:Math.min(j.top,J.top+Ce),bottom:Math.max(j.bottom,J.bottom+Ce)}),L.delta.position==="bottom"&&(Fe=null,Ce=J.height,$={width:Math.max(j.width,J.width),height:j.height+J.height,left:Math.min(j.left,J.left),right:Math.max(j.right,J.right),top:j.bottom-j.height,bottom:j.bottom+J.height}),L.delta.position==="top"&&(Fe=null,Ce=j.top,$={width:Math.max(j.width,J.width),height:j.height+J.height,left:Math.min(j.left,J.left),right:Math.max(j.right,J.right),top:j.bottom-j.height-J.height,bottom:j.bottom}),fe.attr({dx:Fe,dy:Ce})}(L._hasNumber||L._hasDelta)&&le.attr("transform",function(){var et=O.numbersScaler($);ie+=et[2];var Qe=P(L,"numbersScale",1,et[0],ie,Math.min),Ke;L._scaleNumbers||(Qe=1),L._isAngular?Ke=U-Qe*$.bottom:Ke=U-Qe*($.top+$.bottom)/2,L._numbersTop=Qe*$.top+Ke;var Xe=$[Z];Z==="center"&&(Xe=($.left+$.right)/2);var Me=N-Qe*Xe;return Me=P(L,"numbersTranslate",0,Me,ie,Math.max),t(Me,Ke)+e(Qe)})}function w(z){z.each(function(F){h.stroke(d.select(this),F.line.color)}).each(function(F){h.fill(d.select(this),F.color)}).style("stroke-width",function(F){return F.line.width})}function p(z,F,B){return function(){var O=x(F,B);return function(L){return z.endAngle(O(L))()}}}function u(z,F,B){var O=z._fullLayout,L=E.extendFlat({type:"linear",ticks:"outside",range:B,showline:!0},F),N={type:"linear",_id:"x"+F._id},U={letter:"x",font:O.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function Z(Q,ue){return E.coerce(L,N,v,Q,ue)}return c(L,N,Z,U,O),f(L,N,Z,U),N}function g(z,F,B){var O=Math.min(F/z.width,B/z.height);return[O,z,F+"x"+B]}function m(z,F){var B=Math.sqrt(z.width/2*(z.width/2)+z.height*z.height),O=F/B;return[O,z,F]}function R(z,F,B,O){var L=document.createElementNS("http://www.w3.org/2000/svg","text"),N=d.select(L);return N.text(z).attr("x",0).attr("y",0).attr("text-anchor",B).attr("data-unformatted",z).call(n.convertToTspans,O).call(a.font,F),a.bBox(N.node())}function P(z,F,B,O,L,N){var U="_cache"+F;z[U]&&z[U].key===L||(z[U]={key:L,value:B});var Z=E.aggNums(N,null,[z[U].value,O],2);return z[U].value=Z,Z}}}),tD=He({"src/traces/indicator/index.js"(Y,G){G.exports={moduleType:"trace",name:"indicator",basePlotModule:JR(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:QT(),supplyDefaults:$R().supplyDefaults,calc:QR().calc,plot:eD(),meta:{}}}}),rD=He({"lib/indicator.js"(Y,G){G.exports=tD()}}),tA=He({"src/traces/table/attributes.js"(Y,G){var d=Lp(),x=ho().extendFlat,A=hu().overrideAll,E=Yl(),e=mu().attributes,t=Gu().descriptionOnlyNumbers;G.exports=A({domain:e({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:x({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:x({},E({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:x({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:x({},E({arrayOk:!0}))}},"calc","from-root")}}),aD=He({"src/traces/table/defaults.js"(Y,G){var d=Gr(),x=tA(),A=mu().defaults;function E(e,t){for(var r=e.columnorder||[],o=e.header.values.length,a=r.slice(0,o),i=a.slice().sort(function(c,f){return c-f}),n=a.map(function(c){return i.indexOf(c)}),s=n.length;s",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"}}}}),iD=He({"src/traces/table/data_preparation_helper.js"(Y,G){var d=rA(),x=ho().extendFlat,A=Hi(),E=ch().isTypedArray,e=ch().isArrayOrTypedArray;G.exports=function(v,h){var T=o(h.cells.values),l=function(Q){return Q.slice(h.header.values.length,Q.length)},y=o(h.header.values);y.length&&!y[0].length&&(y[0]=[""],y=o(y));var b=y.concat(l(T).map(function(){return a((y[0]||[""]).length)})),S=h.domain,M=Math.floor(v._fullLayout._size.w*(S.x[1]-S.x[0])),_=Math.floor(v._fullLayout._size.h*(S.y[1]-S.y[0])),w=h.header.values.length?b[0].map(function(){return h.header.height}):[d.emptyHeaderHeight],p=T.length?T[0].map(function(){return h.cells.height}):[],u=w.reduce(r,0),g=_-u,m=g+d.uplift,R=s(p,m),P=s(w,u),z=n(P,[]),F=n(R,z),B={},O=h._fullInput.columnorder;e(O)&&(O=Array.from(O)),O=O.concat(l(T.map(function(Q,ue){return ue})));var L=b.map(function(Q,ue){var oe=e(h.columnwidth)?h.columnwidth[Math.min(ue,h.columnwidth.length-1)]:h.columnwidth;return A(oe)?Number(oe):1}),N=L.reduce(r,0);L=L.map(function(Q){return Q/N*M});var U=Math.max(t(h.header.line.width),t(h.cells.line.width)),Z={key:h.uid+v._context.staticPlot,translateX:S.x[0]*v._fullLayout._size.w,translateY:v._fullLayout._size.h*(1-S.y[1]),size:v._fullLayout._size,width:M,maxLineWidth:U,height:_,columnOrder:O,groupHeight:_,rowBlocks:F,headerRowBlocks:z,scrollY:0,cells:x({},h.cells,{values:T}),headerCells:x({},h.header,{values:b}),gdColumns:b.map(function(Q){return Q[0]}),gdColumnsOriginalOrder:b.map(function(Q){return Q[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:b.map(function(Q,ue){var oe=B[Q];B[Q]=(oe||0)+1;var le=Q+"__"+B[Q];return{key:le,label:Q,specIndex:ue,xIndex:O[ue],xScale:i,x:void 0,calcdata:void 0,columnWidth:L[ue]}})};return Z.columns.forEach(function(Q){Q.calcdata=Z,Q.x=i(Q)}),Z};function t(f){if(e(f)){for(var v=0,h=0;h=v||_===f.length-1)&&(h[l]=b,b.key=M++,b.firstRowIndex=S,b.lastRowIndex=_,b=c(),l+=y,S=_+1,y=0);return h}function c(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}}),oD=He({"src/traces/table/data_split_helpers.js"(Y){var G=ho().extendFlat;Y.splitToPanels=function(x){var A=[0,0],E=G({},x,{key:"header",type:"header",page:0,prevPages:A,currentRepaint:[null,null],dragHandle:!0,values:x.calcdata.headerCells.values[x.specIndex],rowBlocks:x.calcdata.headerRowBlocks,calcdata:G({},x.calcdata,{cells:x.calcdata.headerCells})}),e=G({},x,{key:"cells1",type:"cells",page:0,prevPages:A,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks}),t=G({},x,{key:"cells2",type:"cells",page:1,prevPages:A,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks});return[e,t,E]},Y.splitToCells=function(x){var A=d(x);return(x.values||[]).slice(A[0],A[1]).map(function(E,e){var t=typeof E=="string"&&E.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:e+t,key:A[0]+e,column:x,calcdata:x.calcdata,page:x.page,rowBlocks:x.rowBlocks,value:E}})};function d(x){var A=x.rowBlocks[x.page],E=A?A.rows[0].rowIndex:0,e=A?E+A.rows.length:0;return[E,e]}}}),aA=He({"src/traces/table/plot.js"(Y,G){var d=rA(),x=Qn(),A=Gr(),E=A.numberFormat,e=Wv(),t=vo(),r=yl(),o=Gr().raiseToTop,a=Gr().strTranslate,i=Gr().cancelTransition,n=iD(),s=oD(),c=Ai();G.exports=function(ie,fe){var we=!ie._context.staticPlot,Ae=ie._fullLayout._paper.selectAll("."+d.cn.table).data(fe.map(function(Je){var At=e.unwrap(Je),St=At.trace;return n(ie,St)}),e.keyFun);Ae.exit().remove(),Ae.enter().append("g").classed(d.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),Ae.attr("width",function(Je){return Je.width+Je.size.l+Je.size.r}).attr("height",function(Je){return Je.height+Je.size.t+Je.size.b}).attr("transform",function(Je){return a(Je.translateX,Je.translateY)});var Fe=Ae.selectAll("."+d.cn.tableControlView).data(e.repeat,e.keyFun),Ce=Fe.enter().append("g").classed(d.cn.tableControlView,!0).style("box-sizing","content-box");if(we){var qe="onwheel"in document?"wheel":"mousewheel";Ce.on("mousemove",function(Je){Fe.filter(function(At){return Je===At}).call(l,ie)}).on(qe,function(Je){if(!Je.scrollbarState.wheeling){Je.scrollbarState.wheeling=!0;var At=Je.scrollY+x.event.deltaY,St=Q(ie,Fe,null,At)(Je);St||(x.event.stopPropagation(),x.event.preventDefault()),Je.scrollbarState.wheeling=!1}}).call(l,ie,!0)}Fe.attr("transform",function(Je){return a(Je.size.l,Je.size.t)});var et=Fe.selectAll("."+d.cn.scrollBackground).data(e.repeat,e.keyFun);et.enter().append("rect").classed(d.cn.scrollBackground,!0).attr("fill","none"),et.attr("width",function(Je){return Je.width}).attr("height",function(Je){return Je.height}),Fe.each(function(Je){t.setClipUrl(x.select(this),v(ie,Je),ie)});var Qe=Fe.selectAll("."+d.cn.yColumn).data(function(Je){return Je.columns},e.keyFun);Qe.enter().append("g").classed(d.cn.yColumn,!0),Qe.exit().remove(),Qe.attr("transform",function(Je){return a(Je.x,0)}),we&&Qe.call(x.behavior.drag().origin(function(Je){var At=x.select(this);return B(At,Je,-d.uplift),o(this),Je.calcdata.columnDragInProgress=!0,l(Fe.filter(function(St){return Je.calcdata.key===St.key}),ie),Je}).on("drag",function(Je){var At=x.select(this),St=function(ir){return(Je===ir?x.event.x:ir.x)+ir.columnWidth/2};Je.x=Math.max(-d.overdrag,Math.min(Je.calcdata.width+d.overdrag-Je.columnWidth,x.event.x));var Rt=T(Qe).filter(function(ir){return ir.calcdata.key===Je.calcdata.key}),Ut=Rt.sort(function(ir,ar){return St(ir)-St(ar)});Ut.forEach(function(ir,ar){ir.xIndex=ar,ir.x=Je===ir?ir.x:ir.xScale(ir)}),Qe.filter(function(ir){return Je!==ir}).transition().ease(d.transitionEase).duration(d.transitionDuration).attr("transform",function(ir){return a(ir.x,0)}),At.call(i).attr("transform",a(Je.x,-d.uplift))}).on("dragend",function(Je){var At=x.select(this),St=Je.calcdata;Je.x=Je.xScale(Je),Je.calcdata.columnDragInProgress=!1,B(At,Je,0),z(ie,St,St.columns.map(function(Rt){return Rt.xIndex}))})),Qe.each(function(Je){t.setClipUrl(x.select(this),h(ie,Je),ie)});var Ke=Qe.selectAll("."+d.cn.columnBlock).data(s.splitToPanels,e.keyFun);Ke.enter().append("g").classed(d.cn.columnBlock,!0).attr("id",function(Je){return Je.key}),Ke.style("cursor",function(Je){return Je.dragHandle?"ew-resize":Je.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var Xe=Ke.filter(L),Me=Ke.filter(O);we&&Me.call(x.behavior.drag().origin(function(Je){return x.event.stopPropagation(),Je}).on("drag",Q(ie,Fe,-1)).on("dragend",function(){})),y(ie,Fe,Xe,Ke),y(ie,Fe,Me,Ke);var xe=Fe.selectAll("."+d.cn.scrollAreaClip).data(e.repeat,e.keyFun);xe.enter().append("clipPath").classed(d.cn.scrollAreaClip,!0).attr("id",function(Je){return v(ie,Je)});var ce=xe.selectAll("."+d.cn.scrollAreaClipRect).data(e.repeat,e.keyFun);ce.enter().append("rect").classed(d.cn.scrollAreaClipRect,!0).attr("x",-d.overdrag).attr("y",-d.uplift).attr("fill","none"),ce.attr("width",function(Je){return Je.width+2*d.overdrag}).attr("height",function(Je){return Je.height+d.uplift});var Re=Qe.selectAll("."+d.cn.columnBoundary).data(e.repeat,e.keyFun);Re.enter().append("g").classed(d.cn.columnBoundary,!0);var $e=Qe.selectAll("."+d.cn.columnBoundaryClippath).data(e.repeat,e.keyFun);$e.enter().append("clipPath").classed(d.cn.columnBoundaryClippath,!0),$e.attr("id",function(Je){return h(ie,Je)});var rt=$e.selectAll("."+d.cn.columnBoundaryRect).data(e.repeat,e.keyFun);rt.enter().append("rect").classed(d.cn.columnBoundaryRect,!0).attr("fill","none"),rt.attr("width",function(Je){return Je.columnWidth+2*f(Je)}).attr("height",function(Je){return Je.calcdata.height+2*f(Je)+d.uplift}).attr("x",function(Je){return-f(Je)}).attr("y",function(Je){return-f(Je)}),Z(null,Me,Fe)};function f(ae){return Math.ceil(ae.calcdata.maxLineWidth/2)}function v(ae,ie){return"clip"+ae._fullLayout._uid+"_scrollAreaBottomClip_"+ie.key}function h(ae,ie){return"clip"+ae._fullLayout._uid+"_columnBoundaryClippath_"+ie.calcdata.key+"_"+ie.specIndex}function T(ae){return[].concat.apply([],ae.map(function(ie){return ie})).map(function(ie){return ie.__data__})}function l(ae,ie,fe){function we(Qe){var Ke=Qe.rowBlocks;return $(Ke,Ke.length-1)+(Ke.length?X(Ke[Ke.length-1],1/0):1)}var Ae=ae.selectAll("."+d.cn.scrollbarKit).data(e.repeat,e.keyFun);Ae.enter().append("g").classed(d.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),Ae.each(function(Qe){var Ke=Qe.scrollbarState;Ke.totalHeight=we(Qe),Ke.scrollableAreaHeight=Qe.groupHeight-N(Qe),Ke.currentlyVisibleHeight=Math.min(Ke.totalHeight,Ke.scrollableAreaHeight),Ke.ratio=Ke.currentlyVisibleHeight/Ke.totalHeight,Ke.barLength=Math.max(Ke.ratio*Ke.currentlyVisibleHeight,d.goldenRatio*d.scrollbarWidth),Ke.barWiggleRoom=Ke.currentlyVisibleHeight-Ke.barLength,Ke.wiggleRoom=Math.max(0,Ke.totalHeight-Ke.scrollableAreaHeight),Ke.topY=Ke.barWiggleRoom===0?0:Qe.scrollY/Ke.wiggleRoom*Ke.barWiggleRoom,Ke.bottomY=Ke.topY+Ke.barLength,Ke.dragMultiplier=Ke.wiggleRoom/Ke.barWiggleRoom}).attr("transform",function(Qe){var Ke=Qe.width+d.scrollbarWidth/2+d.scrollbarOffset;return a(Ke,N(Qe))});var Fe=Ae.selectAll("."+d.cn.scrollbar).data(e.repeat,e.keyFun);Fe.enter().append("g").classed(d.cn.scrollbar,!0);var Ce=Fe.selectAll("."+d.cn.scrollbarSlider).data(e.repeat,e.keyFun);Ce.enter().append("g").classed(d.cn.scrollbarSlider,!0),Ce.attr("transform",function(Qe){return a(0,Qe.scrollbarState.topY||0)});var qe=Ce.selectAll("."+d.cn.scrollbarGlyph).data(e.repeat,e.keyFun);qe.enter().append("line").classed(d.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",d.scrollbarWidth).attr("stroke-linecap","round").attr("y1",d.scrollbarWidth/2),qe.attr("y2",function(Qe){return Qe.scrollbarState.barLength-d.scrollbarWidth/2}).attr("stroke-opacity",function(Qe){return Qe.columnDragInProgress||!Qe.scrollbarState.barWiggleRoom||fe?0:.4}),qe.transition().delay(0).duration(0),qe.transition().delay(d.scrollbarHideDelay).duration(d.scrollbarHideDuration).attr("stroke-opacity",0);var et=Fe.selectAll("."+d.cn.scrollbarCaptureZone).data(e.repeat,e.keyFun);et.enter().append("line").classed(d.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",d.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(Qe){var Ke=x.event.y,Xe=this.getBoundingClientRect(),Me=Qe.scrollbarState,xe=Ke-Xe.top,ce=x.scale.linear().domain([0,Me.scrollableAreaHeight]).range([0,Me.totalHeight]).clamp(!0);Me.topY<=xe&&xe<=Me.bottomY||Q(ie,ae,null,ce(xe-Me.barLength/2))(Qe)}).call(x.behavior.drag().origin(function(Qe){return x.event.stopPropagation(),Qe.scrollbarState.scrollbarScrollInProgress=!0,Qe}).on("drag",Q(ie,ae)).on("dragend",function(){})),et.attr("y2",function(Qe){return Qe.scrollbarState.scrollableAreaHeight}),ie._context.staticPlot&&(qe.remove(),et.remove())}function y(ae,ie,fe,we){var Ae=b(fe),Fe=S(Ae);p(Fe);var Ce=M(Fe);g(Ce);var qe=w(Fe),et=_(qe);u(et),m(et,ie,we,ae),J(Fe)}function b(ae){var ie=ae.selectAll("."+d.cn.columnCells).data(e.repeat,e.keyFun);return ie.enter().append("g").classed(d.cn.columnCells,!0),ie.exit().remove(),ie}function S(ae){var ie=ae.selectAll("."+d.cn.columnCell).data(s.splitToCells,function(fe){return fe.keyWithinBlock});return ie.enter().append("g").classed(d.cn.columnCell,!0),ie.exit().remove(),ie}function M(ae){var ie=ae.selectAll("."+d.cn.cellRect).data(e.repeat,function(fe){return fe.keyWithinBlock});return ie.enter().append("rect").classed(d.cn.cellRect,!0),ie}function _(ae){var ie=ae.selectAll("."+d.cn.cellText).data(e.repeat,function(fe){return fe.keyWithinBlock});return ie.enter().append("text").classed(d.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){x.event.stopPropagation()}),ie}function w(ae){var ie=ae.selectAll("."+d.cn.cellTextHolder).data(e.repeat,function(fe){return fe.keyWithinBlock});return ie.enter().append("g").classed(d.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),ie}function p(ae){ae.each(function(ie,fe){var we=ie.calcdata.cells.font,Ae=ie.column.specIndex,Fe={size:F(we.size,Ae,fe),color:F(we.color,Ae,fe),family:F(we.family,Ae,fe),weight:F(we.weight,Ae,fe),style:F(we.style,Ae,fe),variant:F(we.variant,Ae,fe),textcase:F(we.textcase,Ae,fe),lineposition:F(we.lineposition,Ae,fe),shadow:F(we.shadow,Ae,fe)};ie.rowNumber=ie.key,ie.align=F(ie.calcdata.cells.align,Ae,fe),ie.cellBorderWidth=F(ie.calcdata.cells.line.width,Ae,fe),ie.font=Fe})}function u(ae){ae.each(function(ie){t.font(x.select(this),ie.font)})}function g(ae){ae.attr("width",function(ie){return ie.column.columnWidth}).attr("stroke-width",function(ie){return ie.cellBorderWidth}).each(function(ie){var fe=x.select(this);c.stroke(fe,F(ie.calcdata.cells.line.color,ie.column.specIndex,ie.rowNumber)),c.fill(fe,F(ie.calcdata.cells.fill.color,ie.column.specIndex,ie.rowNumber))})}function m(ae,ie,fe,we){ae.text(function(Ae){var Fe=Ae.column.specIndex,Ce=Ae.rowNumber,qe=Ae.value,et=typeof qe=="string",Qe=et&&qe.match(/
/i),Ke=!et||Qe;Ae.mayHaveMarkup=et&&qe.match(/[<&>]/);var Xe=R(qe);Ae.latex=Xe;var Me=Xe?"":F(Ae.calcdata.cells.prefix,Fe,Ce)||"",xe=Xe?"":F(Ae.calcdata.cells.suffix,Fe,Ce)||"",ce=Xe?null:F(Ae.calcdata.cells.format,Fe,Ce)||null,Re=Me+(ce?E(ce)(Ae.value):Ae.value)+xe,$e;Ae.wrappingNeeded=!Ae.wrapped&&!Ke&&!Xe&&($e=P(Re)),Ae.cellHeightMayIncrease=Qe||Xe||Ae.mayHaveMarkup||($e===void 0?P(Re):$e),Ae.needsConvertToTspans=Ae.mayHaveMarkup||Ae.wrappingNeeded||Ae.latex;var rt;if(Ae.wrappingNeeded){var Je=d.wrapSplitCharacter===" "?Re.replace(/Ae&&we.push(Fe),Ae+=et}return we}function Z(ae,ie,fe){var we=T(ie)[0];if(we!==void 0){var Ae=we.rowBlocks,Fe=we.calcdata,Ce=$(Ae,Ae.length),qe=we.calcdata.groupHeight-N(we),et=Fe.scrollY=Math.max(0,Math.min(Ce-qe,Fe.scrollY)),Qe=U(Ae,et,qe);Qe.length===1&&(Qe[0]===Ae.length-1?Qe.unshift(Qe[0]-1):Qe.push(Qe[0]+1)),Qe[0]%2&&Qe.reverse(),ie.each(function(Ke,Xe){Ke.page=Qe[Xe],Ke.scrollY=et}),ie.attr("transform",function(Ke){var Xe=$(Ke.rowBlocks,Ke.page)-Ke.scrollY;return a(0,Xe)}),ae&&(ue(ae,fe,ie,Qe,we.prevPages,we,0),ue(ae,fe,ie,Qe,we.prevPages,we,1),l(fe,ae))}}function Q(ae,ie,fe,we){return function(Fe){var Ce=Fe.calcdata?Fe.calcdata:Fe,qe=ie.filter(function(Xe){return Ce.key===Xe.key}),et=fe||Ce.scrollbarState.dragMultiplier,Qe=Ce.scrollY;Ce.scrollY=we===void 0?Ce.scrollY+et*x.event.dy:we;var Ke=qe.selectAll("."+d.cn.yColumn).selectAll("."+d.cn.columnBlock).filter(O);return Z(ae,Ke,qe),Ce.scrollY===Qe}}function ue(ae,ie,fe,we,Ae,Fe,Ce){var qe=we[Ce]!==Ae[Ce];qe&&(clearTimeout(Fe.currentRepaint[Ce]),Fe.currentRepaint[Ce]=setTimeout(function(){var et=fe.filter(function(Qe,Ke){return Ke===Ce&&we[Ke]!==Ae[Ke]});y(ae,ie,et,fe),Ae[Ce]=we[Ce]}))}function oe(ae,ie,fe,we){return function(){var Fe=x.select(ie.parentNode);Fe.each(function(Ce){var qe=Ce.fragments;Fe.selectAll("tspan.line").each(function(Re,$e){qe[$e].width=this.getComputedTextLength()});var et=qe[qe.length-1].width,Qe=qe.slice(0,-1),Ke=[],Xe,Me,xe=0,ce=Ce.column.columnWidth-2*d.cellPad;for(Ce.value="";Qe.length;)Xe=Qe.shift(),Me=Xe.width+et,xe+Me>ce&&(Ce.value+=Ke.join(d.wrapSpacer)+d.lineBreaker,Ke=[],xe=0),Ke.push(Xe.text),xe+=Me;xe&&(Ce.value+=Ke.join(d.wrapSpacer)),Ce.wrapped=!0}),Fe.selectAll("tspan.line").remove(),m(Fe.select("."+d.cn.cellText),fe,ae,we),x.select(ie.parentNode.parentNode).call(J)}}function le(ae,ie,fe,we,Ae){return function(){if(!Ae.settledY){var Ce=x.select(ie.parentNode),qe=ee(Ae),et=Ae.key-qe.firstRowIndex,Qe=qe.rows[et].rowHeight,Ke=Ae.cellHeightMayIncrease?ie.parentNode.getBoundingClientRect().height+2*d.cellPad:Qe,Xe=Math.max(Ke,Qe),Me=Xe-qe.rows[et].rowHeight;Me&&(qe.rows[et].rowHeight=Xe,ae.selectAll("."+d.cn.columnCell).call(J),Z(null,ae.filter(O),0),l(fe,we,!0)),Ce.attr("transform",function(){var xe=this,ce=xe.parentNode,Re=ce.getBoundingClientRect(),$e=x.select(xe.parentNode).select("."+d.cn.cellRect).node().getBoundingClientRect(),rt=xe.transform.baseVal.consolidate(),Je=$e.top-Re.top+(rt?rt.matrix.f:d.cellPad);return a(j(Ae,x.select(xe.parentNode).select("."+d.cn.cellTextHolder).node().getBoundingClientRect().width),Je)}),Ae.settledY=!0}}}function j(ae,ie){switch(ae.align){case"left":return d.cellPad;case"right":return ae.column.columnWidth-(ie||0)-d.cellPad;case"center":return(ae.column.columnWidth-(ie||0))/2;default:return d.cellPad}}function J(ae){ae.attr("transform",function(ie){var fe=ie.rowBlocks[0].auxiliaryBlocks.reduce(function(Ce,qe){return Ce+X(qe,1/0)},0),we=ee(ie),Ae=X(we,ie.key),Fe=Ae+fe;return a(0,Fe)}).selectAll("."+d.cn.cellRect).attr("height",function(ie){return q(ee(ie),ie.key).rowHeight})}function $(ae,ie){for(var fe=0,we=ie-1;we>=0;we--)fe+=re(ae[we]);return fe}function X(ae,ie){for(var fe=0,we=0;weE.length&&(A=A.slice(0,E.length)):A=[],t=0;t90&&(v-=180,i=-i),{angle:v,flip:i,p:x.c2p(e,A,E),offsetMultplier:n}}}}),gD=He({"src/traces/carpet/plot.js"(Y,G){var d=Qn(),x=vo(),A=nA(),E=iA(),e=pD(),t=yl(),r=Gr(),o=r.strRotate,a=r.strTranslate,i=df();G.exports=function(y,b,S,M){var _=y._context.staticPlot,w=b.xaxis,p=b.yaxis,u=y._fullLayout,g=u._clips;r.makeTraceGroups(M,S,"trace").each(function(m){var R=d.select(this),P=m[0],z=P.trace,F=z.aaxis,B=z.baxis,O=r.ensureSingle(R,"g","minorlayer"),L=r.ensureSingle(R,"g","majorlayer"),N=r.ensureSingle(R,"g","boundarylayer"),U=r.ensureSingle(R,"g","labellayer");R.style("opacity",z.opacity),s(w,p,L,F,"a",F._gridlines,!0),s(w,p,L,B,"b",B._gridlines,!0),s(w,p,O,F,"a",F._minorgridlines,!0),s(w,p,O,B,"b",B._minorgridlines,!0),s(w,p,N,F,"a-boundary",F._boundarylines,_),s(w,p,N,B,"b-boundary",B._boundarylines,_);var Z=c(y,w,p,z,P,U,F._labels,"a-label"),Q=c(y,w,p,z,P,U,B._labels,"b-label");f(y,U,z,P,w,p,Z,Q),n(z,P,g,w,p)})};function n(l,y,b,S,M){var _,w,p,u,g=b.select("#"+l._clipPathId);g.size()||(g=b.append("clipPath").classed("carpetclip",!0));var m=r.ensureSingle(g,"path","carpetboundary"),R=y.clipsegments,P=[];for(u=0;u0?"start":"end","data-notex":1}).call(x.font,R.font).text(R.text).call(t.convertToTspans,l),L=x.bBox(this);O.attr("transform",a(z.p[0],z.p[1])+o(z.angle)+a(R.axis.labelpadding*B,L.height*.3)),g=Math.max(g,L.width+R.axis.labelpadding)}),u.exit().remove(),m.maxExtent=g,m}function f(l,y,b,S,M,_,w,p){var u,g,m,R,P=r.aggNums(Math.min,null,b.a),z=r.aggNums(Math.max,null,b.a),F=r.aggNums(Math.min,null,b.b),B=r.aggNums(Math.max,null,b.b);u=.5*(P+z),g=F,m=b.ab2xy(u,g,!0),R=b.dxyda_rough(u,g),w.angle===void 0&&r.extendFlat(w,e(b,M,_,m,b.dxydb_rough(u,g))),T(l,y,b,S,m,R,b.aaxis,M,_,w,"a-title"),u=P,g=.5*(F+B),m=b.ab2xy(u,g,!0),R=b.dxydb_rough(u,g),p.angle===void 0&&r.extendFlat(p,e(b,M,_,m,b.dxyda_rough(u,g))),T(l,y,b,S,m,R,b.baxis,M,_,p,"b-title")}var v=i.LINE_SPACING,h=(1-i.MID_SHIFT)/v+1;function T(l,y,b,S,M,_,w,p,u,g,m){var R=[];w.title.text&&R.push(w.title.text);var P=y.selectAll("text."+m).data(R),z=g.maxExtent;P.enter().append("text").classed(m,!0),P.each(function(){var F=e(b,p,u,M,_);["start","both"].indexOf(w.showticklabels)===-1&&(z=0);var B=w.title.font.size;z+=B+w.title.offset;var O=g.angle+(g.flip<0?180:0),L=(O-F.angle+450)%360,N=L>90&&L<270,U=d.select(this);U.text(w.title.text).call(t.convertToTspans,l),N&&(z=(-t.lineCount(U)+h)*v*B-z),U.attr("transform",a(F.p[0],F.p[1])+o(F.angle)+a(0,z)).attr("text-anchor","middle").call(x.font,w.title.font)}),P.exit().remove()}}}),yD=He({"src/traces/carpet/cheater_basis.js"(Y,G){var d=Gr().isArrayOrTypedArray;G.exports=function(x,A,E){var e,t,r,o,a,i,n=[],s=d(x)?x.length:x,c=d(A)?A.length:A,f=d(x)?x:null,v=d(A)?A:null;f&&(r=(f.length-1)/(f[f.length-1]-f[0])/(s-1)),v&&(o=(v.length-1)/(v[v.length-1]-v[0])/(c-1));var h,T=1/0,l=-1/0;for(t=0;t=10)return null;for(var e=1/0,t=-1/0,r=A.length,o=0;o0&&(X=E.dxydi([],Z-1,ue,0,oe),ae.push(le[0]+X[0]/3),ie.push(le[1]+X[1]/3),re=E.dxydi([],Z-1,ue,1,oe),ae.push($[0]-re[0]/3),ie.push($[1]-re[1]/3)),ae.push($[0]),ie.push($[1]),le=$;else for(Z=E.a2i(U),j=Math.floor(Math.max(0,Math.min(F-2,Z))),J=Z-j,fe.length=F,fe.crossLength=B,fe.xy=function(we){return E.evalxy([],Z,we)},fe.dxy=function(we,Ae){return E.dxydj([],j,we,J,Ae)},Q=0;Q0&&(ee=E.dxydj([],j,Q-1,J,0),ae.push(le[0]+ee[0]/3),ie.push(le[1]+ee[1]/3),q=E.dxydj([],j,Q-1,J,1),ae.push($[0]-q[0]/3),ie.push($[1]-q[1]/3)),ae.push($[0]),ie.push($[1]),le=$;return fe.axisLetter=e,fe.axis=M,fe.crossAxis=g,fe.value=U,fe.constvar=t,fe.index=f,fe.x=ae,fe.y=ie,fe.smoothing=g.smoothing,fe}function N(U){var Z,Q,ue,oe,le,j=[],J=[],$={};if($.length=S.length,$.crossLength=u.length,e==="b")for(ue=Math.max(0,Math.min(B-2,U)),le=Math.min(1,Math.max(0,U-ue)),$.xy=function(X){return E.evalxy([],X,U)},$.dxy=function(X,re){return E.dxydi([],X,ue,re,le)},Z=0;ZS.length-1)&&_.push(x(N(o),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(f=s;fS.length-1)&&!(T<0||T>S.length-1))for(l=S[a],y=S[T],r=0;rS[S.length-1])&&w.push(x(L(h),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash})));M.startline&&p.push(x(N(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&p.push(x(N(S.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(i=5e-15,n=[Math.floor((S[S.length-1]-M.tick0)/M.dtick*(1+i)),Math.ceil((S[0]-M.tick0)/M.dtick/(1+i))].sort(function(U,Z){return U-Z}),s=n[0],c=n[1],f=s;f<=c;f++)v=M.tick0+M.dtick*f,_.push(x(L(v),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(f=s-1;fS[S.length-1])&&w.push(x(L(h),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash}));M.startline&&p.push(x(L(S[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&p.push(x(L(S[S.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}}}),xD=He({"src/traces/carpet/calc_labels.js"(Y,G){var d=io(),x=ho().extendFlat;G.exports=function(E,e){var t,r,o,a,i,n=e._labels=[],s=e._gridlines;for(t=0;t=0;t--)r[s-t]=x[c][t],o[s-t]=A[c][t];for(a.push({x:r,y:o,bicubic:i}),t=c,r=[],o=[];t>=0;t--)r[c-t]=x[t][0],o[c-t]=A[t][0];return a.push({x:r,y:o,bicubic:n}),a}}}),wD=He({"src/traces/carpet/smooth_fill_2d_array.js"(Y,G){var d=Gr();G.exports=function(A,E,e){var t,r,o,a=[],i=[],n=A[0].length,s=A.length;function c(Q,ue){var oe=0,le,j=0;return Q>0&&(le=A[ue][Q-1])!==void 0&&(j++,oe+=le),Q0&&(le=A[ue-1][Q])!==void 0&&(j++,oe+=le),ue0&&r0&&tu);return d.log("Smoother converged to",g,"after",R,"iterations"),A}}}),TD=He({"src/traces/carpet/constants.js"(Y,G){G.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),AD=He({"src/traces/carpet/catmull_rom.js"(Y,G){var d=.5;G.exports=function(A,E,e,t){var r=A[0]-E[0],o=A[1]-E[1],a=e[0]-E[0],i=e[1]-E[1],n=Math.pow(r*r+o*o,d/2),s=Math.pow(a*a+i*i,d/2),c=(s*s*r-n*n*a)*t,f=(s*s*o-n*n*i)*t,v=s*(n+s)*3,h=n*(n+s)*3;return[[E[0]+(v&&c/v),E[1]+(v&&f/v)],[E[0]-(h&&c/h),E[1]-(h&&f/h)]]}}}),SD=He({"src/traces/carpet/compute_control_points.js"(Y,G){var d=AD(),x=Gr().ensureArray;function A(E,e,t){var r=-.5*t[0]+1.5*e[0],o=-.5*t[1]+1.5*e[1];return[(2*r+E[0])/3,(2*o+E[1])/3]}G.exports=function(e,t,r,o,a,i){var n,s,c,f,v,h,T,l,y,b,S=r[0].length,M=r.length,_=a?3*S-2:S,w=i?3*M-2:M;for(e=x(e,w),t=x(t,w),c=0;cv&&_T&&wh||wl},o.setScale=function(){var _=o._x,w=o._y,p=A(o._xctrl,o._yctrl,_,w,c.smoothing,f.smoothing);o._xctrl=p[0],o._yctrl=p[1],o.evalxy=E([o._xctrl,o._yctrl],n,s,c.smoothing,f.smoothing),o.dxydi=e([o._xctrl,o._yctrl],c.smoothing,f.smoothing),o.dxydj=t([o._xctrl,o._yctrl],c.smoothing,f.smoothing)},o.i2a=function(_){var w=Math.max(0,Math.floor(_[0]),n-2),p=_[0]-w;return(1-p)*a[w]+p*a[w+1]},o.j2b=function(_){var w=Math.max(0,Math.floor(_[1]),n-2),p=_[1]-w;return(1-p)*i[w]+p*i[w+1]},o.ij2ab=function(_){return[o.i2a(_[0]),o.j2b(_[1])]},o.a2i=function(_){var w=Math.max(0,Math.min(x(_,a),n-2)),p=a[w],u=a[w+1];return Math.max(0,Math.min(n-1,w+(_-p)/(u-p)))},o.b2j=function(_){var w=Math.max(0,Math.min(x(_,i),s-2)),p=i[w],u=i[w+1];return Math.max(0,Math.min(s-1,w+(_-p)/(u-p)))},o.ab2ij=function(_){return[o.a2i(_[0]),o.b2j(_[1])]},o.i2c=function(_,w){return o.evalxy([],_,w)},o.ab2xy=function(_,w,p){if(!p&&(_a[n-1]|wi[s-1]))return[!1,!1];var u=o.a2i(_),g=o.b2j(w),m=o.evalxy([],u,g);if(p){var R=0,P=0,z=[],F,B,O,L;_a[n-1]?(F=n-2,B=1,R=(_-a[n-1])/(a[n-1]-a[n-2])):(F=Math.max(0,Math.min(n-2,Math.floor(u))),B=u-F),wi[s-1]?(O=s-2,L=1,P=(w-i[s-1])/(i[s-1]-i[s-2])):(O=Math.max(0,Math.min(s-2,Math.floor(g))),L=g-O),R&&(o.dxydi(z,F,O,B,L),m[0]+=z[0]*R,m[1]+=z[1]*R),P&&(o.dxydj(z,F,O,B,L),m[0]+=z[0]*P,m[1]+=z[1]*P)}return m},o.c2p=function(_,w,p){return[w.c2p(_[0]),p.c2p(_[1])]},o.p2x=function(_,w,p){return[w.p2c(_[0]),p.p2c(_[1])]},o.dadi=function(_){var w=Math.max(0,Math.min(a.length-2,_));return a[w+1]-a[w]},o.dbdj=function(_){var w=Math.max(0,Math.min(i.length-2,_));return i[w+1]-i[w]},o.dxyda=function(_,w,p,u){var g=o.dxydi(null,_,w,p,u),m=o.dadi(_,p);return[g[0]/m,g[1]/m]},o.dxydb=function(_,w,p,u){var g=o.dxydj(null,_,w,p,u),m=o.dbdj(w,u);return[g[0]/m,g[1]/m]},o.dxyda_rough=function(_,w,p){var u=y*(p||.1),g=o.ab2xy(_+u,w,!0),m=o.ab2xy(_-u,w,!0);return[(g[0]-m[0])*.5/u,(g[1]-m[1])*.5/u]},o.dxydb_rough=function(_,w,p){var u=b*(p||.1),g=o.ab2xy(_,w+u,!0),m=o.ab2xy(_,w-u,!0);return[(g[0]-m[0])*.5/u,(g[1]-m[1])*.5/u]},o.dpdx=function(_){return _._m},o.dpdy=function(_){return _._m}}}}),LD=He({"src/traces/carpet/calc.js"(Y,G){var d=io(),x=Gr().isArray1D,A=yD(),E=mD(),e=_D(),t=xD(),r=bD(),o=I1(),a=wD(),i=P1(),n=CD();G.exports=function(c,f){var v=d.getFromId(c,f.xaxis),h=d.getFromId(c,f.yaxis),T=f.aaxis,l=f.baxis,y=f.x,b=f.y,S=[];y&&x(y)&&S.push("x"),b&&x(b)&&S.push("y"),S.length&&i(f,T,l,"a","b",S);var M=f._a=f._a||f.a,_=f._b=f._b||f.b;y=f._x||f.x,b=f._y||f.y;var w={};if(f._cheater){var p=T.cheatertype==="index"?M.length:M,u=l.cheatertype==="index"?_.length:_;y=A(p,u,f.cheaterslope)}f._x=y=o(y),f._y=b=o(b),a(y,M,_),a(b,M,_),n(f),f.setScale();var g=E(y),m=E(b),R=.5*(g[1]-g[0]),P=.5*(g[1]+g[0]),z=.5*(m[1]-m[0]),F=.5*(m[1]+m[0]),B=1.3;return g=[P-R*B,P+R*B],m=[F-z*B,F+z*B],f._extremes[v._id]=d.findExtremes(v,g,{padded:!0}),f._extremes[h._id]=d.findExtremes(h,m,{padded:!0}),e(f,"a","b"),e(f,"b","a"),t(f,T),t(f,l),w.clipsegments=r(f._xctrl,f._yctrl,T,l),w.x=y,w.y=b,w.a=M,w.b=_,[w]}}}),PD=He({"src/traces/carpet/index.js"(Y,G){G.exports={attributes:dx(),supplyDefaults:dD(),plot:gD(),calc:LD(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Bc(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),ID=He({"lib/carpet.js"(Y,G){G.exports=PD()}}),oA=He({"src/traces/scattercarpet/attributes.js"(Y,G){var d=wv(),x=Zu(),A=cl(),E=Yo().hovertemplateAttrs,e=Yo().texttemplateAttrs,t=kl(),r=ho().extendFlat,o=x.marker,a=x.line,i=o.line;G.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:r({},x.mode,{dflt:"markers"}),text:r({},x.text,{}),texttemplate:e({editType:"plot"},{keys:["a","b","text"]}),hovertext:r({},x.hovertext,{}),line:{color:a.color,width:a.width,dash:a.dash,backoff:a.backoff,shape:r({},a.shape,{values:["linear","spline"]}),smoothing:a.smoothing,editType:"calc"},connectgaps:x.connectgaps,fill:r({},x.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:d(),marker:r({symbol:o.symbol,opacity:o.opacity,maxdisplayed:o.maxdisplayed,angle:o.angle,angleref:o.angleref,standoff:o.standoff,size:o.size,sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,line:r({width:i.width,editType:"calc"},t("marker.line")),gradient:o.gradient,editType:"calc"},t("marker")),textfont:x.textfont,textposition:x.textposition,selected:x.selected,unselected:x.unselected,hoverinfo:r({},A.hoverinfo,{flags:["a","b","text","name"]}),hoveron:x.hoveron,hovertemplate:E(),zorder:x.zorder}}}),RD=He({"src/traces/scattercarpet/defaults.js"(Y,G){var d=Gr(),x=jv(),A=Rl(),E=Kh(),e=nv(),t=V0(),r=iv(),o=Av(),a=oA();G.exports=function(n,s,c,f){function v(M,_){return d.coerce(n,s,a,M,_)}v("carpet"),s.xaxis="x",s.yaxis="y";var h=v("a"),T=v("b"),l=Math.min(h.length,T.length);if(!l){s.visible=!1;return}s._length=l,v("text"),v("texttemplate"),v("hovertext");var y=l0?w=M.labelprefix.replace(/ = $/,""):w=M._hovertitle,l.push(w+": "+_.toFixed(3)+M.labelsuffix)}if(!v.hovertemplate){var b=f.hi||v.hoverinfo,S=b.split("+");S.indexOf("all")!==-1&&(S=["a","b","text"]),S.indexOf("a")!==-1&&y(h.aaxis,f.a),S.indexOf("b")!==-1&&y(h.baxis,f.b),l.push("y: "+a.yLabel),S.indexOf("text")!==-1&&x(f,v,l),a.extraText=l.join("
")}return o}}}),BD=He({"src/traces/scattercarpet/event_data.js"(Y,G){G.exports=function(x,A,E,e,t){var r=e[t];return x.a=r.a,x.b=r.b,x.y=r.y,x}}}),ND=He({"src/traces/scattercarpet/index.js"(Y,G){G.exports={attributes:oA(),supplyDefaults:RD(),colorbar:ah(),formatLabels:DD(),calc:zD(),plot:FD(),style:Ih().style,styleOnSelect:Ih().styleOnSelect,hoverPoints:OD(),selectPoints:W0(),eventData:BD(),moduleType:"trace",name:"scattercarpet",basePlotModule:Bc(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),UD=He({"lib/scattercarpet.js"(Y,G){G.exports=ND()}}),sA=He({"src/traces/contourcarpet/attributes.js"(Y,G){var d=Y0(),x=fy(),A=kl(),E=ho().extendFlat,e=x.contours;G.exports=E({carpet:{valType:"string",editType:"calc"},z:d.z,a:d.x,a0:d.x0,da:d.dx,b:d.y,b0:d.y0,db:d.dy,text:d.text,hovertext:d.hovertext,transpose:d.transpose,atype:d.xtype,btype:d.ytype,fillcolor:x.fillcolor,autocontour:x.autocontour,ncontours:x.ncontours,contours:{type:e.type,start:e.start,end:e.end,size:e.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:e.showlines,showlabels:e.showlabels,labelfont:e.labelfont,labelformat:e.labelformat,operation:e.operation,value:e.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:x.line.color,width:x.line.width,dash:x.line.dash,smoothing:x.line.smoothing,editType:"plot"},zorder:x.zorder},A("",{cLetter:"z",autoColorDflt:!1}))}}),lA=He({"src/traces/contourcarpet/defaults.js"(Y,G){var d=Gr(),x=L1(),A=sA(),E=Fw(),e=H1(),t=G1();G.exports=function(o,a,i,n){function s(h,T){return d.coerce(o,a,A,h,T)}function c(h){return d.coerce2(o,a,A,h)}if(s("carpet"),o.a&&o.b){var f=x(o,a,s,n,"a","b");if(!f){a.visible=!1;return}s("text");var v=s("contours.type")==="constraint";v?E(o,a,s,n,i,{hasHover:!1}):(e(o,a,s,c),t(o,a,s,n,{hasHover:!1}))}else a._defaultColor=i,a._length=null;s("zorder")}}}),jD=He({"src/traces/contourcarpet/calc.js"(Y,G){var d=Sh(),x=Gr(),A=P1(),E=I1(),e=R1(),t=D1(),r=xw(),o=lA(),a=px(),i=Ew();G.exports=function(c,f){var v=f._carpetTrace=a(c,f);if(!(!v||!v.visible||v.visible==="legendonly")){if(!f.a||!f.b){var h=c.data[v.index],T=c.data[f.index];T.a||(T.a=h.a),T.b||(T.b=h.b),o(T,f,f._defaultColor,c._fullLayout)}var l=n(c,f);return i(f,f._z),l}};function n(s,c){var f=c._carpetTrace,v=f.aaxis,h=f.baxis,T,l,y,b,S,M,_;v._minDtick=0,h._minDtick=0,x.isArray1D(c.z)&&A(c,v,h,"a","b",["z"]),T=c._a=c._a||c.a,b=c._b=c._b||c.b,T=T?v.makeCalcdata(c,"_a"):[],b=b?h.makeCalcdata(c,"_b"):[],l=c.a0||0,y=c.da||1,S=c.b0||0,M=c.db||1,_=c._z=E(c._z||c.z,c.transpose),c._emptypoints=t(_),e(_,c._emptypoints);var w=x.maxRowLength(_),p=c.xtype==="scaled"?"":T,u=r(c,p,l,y,w,v),g=c.ytype==="scaled"?"":b,m=r(c,g,S,M,_.length,h),R={a:u,b:m,z:_};return c.contours.type==="levels"&&c.contours.coloring!=="none"&&d(s,c,{vals:_,containerStr:"",cLetter:"z"}),[R]}}}),VD=He({"src/traces/carpet/axis_aligned_line.js"(Y,G){var d=Gr().isArrayOrTypedArray;G.exports=function(x,A,E,e){var t,r,o,a,i,n,s,c,f,v,h,T,l,y=d(E)?"a":"b",b=y==="a"?x.aaxis:x.baxis,S=b.smoothing,M=y==="a"?x.a2i:x.b2j,_=y==="a"?E:e,w=y==="a"?e:E,p=y==="a"?A.a.length:A.b.length,u=y==="a"?A.b.length:A.a.length,g=Math.floor(y==="a"?x.b2j(w):x.a2i(w)),m=y==="a"?function(ue){return x.evalxy([],ue,g)}:function(ue){return x.evalxy([],g,ue)};S&&(o=Math.max(0,Math.min(u-2,g)),a=g-o,r=y==="a"?function(ue,oe){return x.dxydi([],ue,o,oe,a)}:function(ue,oe){return x.dxydj([],o,ue,a,oe)});var R=M(_[0]),P=M(_[1]),z=R0?Math.floor:Math.ceil,O=z>0?Math.ceil:Math.floor,L=z>0?Math.min:Math.max,N=z>0?Math.max:Math.min,U=B(R+F),Z=O(P-F);s=m(R);var Q=[[s]];for(t=U;t*z=0;fe--)q=N.clipsegments[fe],ae=x([],q.x,R.c2p),ie=x([],q.y,P.c2p),ae.reverse(),ie.reverse(),we.push(A(ae,ie,q.bicubic));var Ae="M"+we.join("L")+"Z";S(F,N.clipsegments,R,P,oe,j),M(O,F,R,P,ee,$,J,L,N,j,Ae),h(F,ue,p,B,Q,u,L),E.setClipUrl(F,L._clipPathId,p)})};function v(w,p){var u,g,m,R,P,z,F,B,O;for(u=0;uue&&(g.max=ue),g.len=g.max-g.min}function l(w,p,u){var g=w.getPointAtLength(p),m=w.getPointAtLength(u),R=m.x-g.x,P=m.y-g.y,z=Math.sqrt(R*R+P*P);return[R/z,P/z]}function y(w){var p=Math.sqrt(w[0]*w[0]+w[1]*w[1]);return[w[0]/p,w[1]/p]}function b(w,p){var u=Math.abs(w[0]*p[0]+w[1]*p[1]),g=Math.sqrt(1-u*u);return g/u}function S(w,p,u,g,m,R){var P,z,F,B,O=e.ensureSingle(w,"g","contourbg"),L=O.selectAll("path").data(R==="fill"&&!m?[0]:[]);L.enter().append("path"),L.exit().remove();var N=[];for(B=0;B=0&&(U=ae,Q=ue):Math.abs(N[1]-U[1])=0&&(U=ae,Q=ue):e.log("endpt to newendpt is not vert. or horz.",N,U,ae)}if(Q>=0)break;B+=ee(N,U),N=U}if(Q===p.edgepaths.length){e.log("unclosed perimeter path");break}F=Q,L=O.indexOf(F)===-1,L&&(F=O[0],B+=ee(N,U)+"Z",N=null)}for(F=0;F_):M=z>m,_=z;var F=v(m,R,P,z);F.pos=g,F.yc=(m+z)/2,F.i=u,F.dir=M?"increasing":"decreasing",F.x=F.pos,F.y=[P,R],w&&(F.orig_p=s[u]),b&&(F.tx=n.text[u]),S&&(F.htx=n.hovertext[u]),p.push(F)}else p.push({pos:g,empty:!0})}return n._extremes[f._id]=A.findExtremes(f,d.concat(l,T),{padded:!0}),p.length&&(p[0].t={labels:{open:x(i,"open:")+" ",high:x(i,"high:")+" ",low:x(i,"low:")+" ",close:x(i,"close:")+" "}}),p}function a(i,n,s){var c=s._minDiff;if(!c){var f=i._fullData,v=[];c=1/0;var h;for(h=0;h"+y.labels[z]+d.hoverLabelText(T,F,l.yhoverformat)):(O=x.extendFlat({},S),O.y0=O.y1=B,O.yLabelVal=F,O.yLabel=y.labels[z]+d.hoverLabelText(T,F,l.yhoverformat),O.name="",b.push(O),R[F]=O)}return b}function n(s,c,f,v){var h=s.cd,T=s.ya,l=h[0].trace,y=h[0].t,b=a(s,c,f,v);if(!b)return[];var S=b.index,M=h[S],_=b.index=M.i,w=M.dir;function p(F){return y.labels[F]+d.hoverLabelText(T,l[F][_],l.yhoverformat)}var u=M.hi||l.hoverinfo,g=u.split("+"),m=u==="all",R=m||g.indexOf("y")!==-1,P=m||g.indexOf("text")!==-1,z=R?[p("open"),p("high"),p("low"),p("close")+" "+r[w]]:[];return P&&e(M,l,z),b.extraText=z.join("
"),b.y0=b.y1=T.c2p(M.yc,!0),[b]}G.exports={hoverPoints:o,hoverSplit:i,hoverOnPoints:n}}}),hA=He({"src/traces/ohlc/select.js"(Y,G){G.exports=function(x,A){var E=x.cd,e=x.xaxis,t=x.yaxis,r=[],o,a=E[0].t.bPos||0;if(A===!1)for(o=0;oc?function(l){return l<=0}:function(l){return l>=0};a.c2g=function(l){var y=a.c2l(l)-s;return(T(y)?y:0)+h},a.g2c=function(l){return a.l2c(l+s-h)},a.g2p=function(l){return l*v},a.c2p=function(l){return a.g2p(a.c2g(l))}}}function t(a,i){return i==="degrees"?A(a):a}function r(a,i){return i==="degrees"?E(a):a}function o(a,i){var n=a.type;if(n==="linear"){var s=a.d2c,c=a.c2d;a.d2c=function(f,v){return t(s(f),v)},a.c2d=function(f,v){return c(r(f,v))}}a.makeCalcdata=function(f,v){var h=f[v],T=f._length,l,y,b=function(p){return a.d2c(p,f.thetaunit)};if(h)for(l=new Array(T),y=0;y0?p:1/0},M=A(b,S),_=d.mod(M+1,b.length);return[b[M],b[_]]}function v(y){return Math.abs(y)>1e-10?y:0}function h(y,b,S){b=b||0,S=S||0;for(var M=y.length,_=new Array(M),w=0;w0?1:0}function x(r){var o=r[0],a=r[1];if(!isFinite(o)||!isFinite(a))return[1,0];var i=(o+1)*(o+1)+a*a;return[(o*o+a*a-1)/i,2*a/i]}function A(r,o){var a=o[0],i=o[1];return[a*r.radius+r.cx,-i*r.radius+r.cy]}function E(r,o){return o*r.radius}function e(r,o,a,i){var n=A(r,x([a,o])),s=n[0],c=n[1],f=A(r,x([i,o])),v=f[0],h=f[1];if(o===0)return["M"+s+","+c,"L"+v+","+h].join(" ");var T=E(r,1/Math.abs(o));return["M"+s+","+c,"A"+T+","+T+" 0 0,"+(o<0?1:0)+" "+v+","+h].join(" ")}function t(r,o,a,i){var n=E(r,1/(o+1)),s=A(r,x([o,a])),c=s[0],f=s[1],v=A(r,x([o,i])),h=v[0],T=v[1];if(d(a)!==d(i)){var l=A(r,x([o,0])),y=l[0],b=l[1];return["M"+c+","+f,"A"+n+","+n+" 0 0,"+(0et?(Qe=ie,Ke=ie*et,xe=(fe-Ke)/X.h/2,Xe=[q[0],q[1]],Me=[ae[0]+xe,ae[1]-xe]):(Qe=fe/et,Ke=fe,xe=(ie-Qe)/X.w/2,Xe=[q[0]+xe,q[1]-xe],Me=[ae[0],ae[1]]),J.xLength2=Qe,J.yLength2=Ke,J.xDomain2=Xe,J.yDomain2=Me;var ce=J.xOffset2=X.l+X.w*Xe[0],Re=J.yOffset2=X.t+X.h*(1-Me[1]),$e=J.radius=Qe/Fe,rt=J.innerRadius=J.getHole(j)*$e,Je=J.cx=ce-$e*Ae[0],At=J.cy=Re+$e*Ae[3],St=J.cxx=Je-ce,Rt=J.cyy=At-Re,Ut=re.side,ir;Ut==="counterclockwise"?(ir=Ut,Ut="top"):Ut==="clockwise"&&(ir=Ut,Ut="bottom"),J.radialAxis=J.mockAxis(le,j,re,{_id:"x",side:Ut,_trueSide:ir,domain:[rt/X.w,$e/X.w]}),J.angularAxis=J.mockAxis(le,j,ee,{side:"right",domain:[0,Math.PI],autorange:!1}),J.doAutoRange(le,j),J.updateAngularAxis(le,j),J.updateRadialAxis(le,j),J.updateRadialAxisTitle(le,j),J.xaxis=J.mockCartesianAxis(le,j,{_id:"x",domain:Xe}),J.yaxis=J.mockCartesianAxis(le,j,{_id:"y",domain:Me});var ar=J.pathSubplot();J.clipPaths.forTraces.select("path").attr("d",ar).attr("transform",t(St,Rt)),$.frontplot.attr("transform",t(ce,Re)).call(o.setClipUrl,J._hasClipOnAxisFalse?null:J.clipIds.forTraces,J.gd),$.bg.attr("d",ar).attr("transform",t(Je,At)).call(r.fill,j.bgcolor)},U.mockAxis=function(le,j,J,$){var X=E.extendFlat({},J,$);return s(X,j,le),X},U.mockCartesianAxis=function(le,j,J){var $=this,X=$.isSmith,re=J._id,ee=E.extendFlat({type:"linear"},J);n(ee,le);var q={x:[0,2],y:[1,3]};return ee.setRange=function(){var ae=$.sectorBBox,ie=q[re],fe=$.radialAxis._rl,we=(fe[1]-fe[0])/(1-$.getHole(j));ee.range=[ae[ie[0]]*we,ae[ie[1]]*we]},ee.isPtWithinRange=re==="x"&&!X?function(ae){return $.isPtInside(ae)}:function(){return!0},ee.setRange(),ee.setScale(),ee},U.doAutoRange=function(le,j){var J=this,$=J.gd,X=J.radialAxis,re=J.getRadial(j);c($,X);var ee=X.range;if(re.range=ee.slice(),re._input.range=ee.slice(),X._rl=[X.r2l(ee[0],null,"gregorian"),X.r2l(ee[1],null,"gregorian")],X.minallowed!==void 0){var q=X.r2l(X.minallowed);X._rl[0]>X._rl[1]?X._rl[1]=Math.max(X._rl[1],q):X._rl[0]=Math.max(X._rl[0],q)}if(X.maxallowed!==void 0){var ae=X.r2l(X.maxallowed);X._rl[0]90&&fe<=270&&(we.tickangle=180);var Ce=Fe?function($e){var rt=z(J,m([$e.x,0]));return t(rt[0]-q,rt[1]-ae)}:function($e){return t(we.l2p($e.x)+ee,0)},qe=Fe?function($e){return P(J,$e.x,-1/0,1/0)}:function($e){return J.pathArc(we.r2p($e.x)+ee)},et=Z(ie);if(J.radialTickLayout!==et&&(X["radial-axis"].selectAll(".xtick").remove(),J.radialTickLayout=et),Ae){we.setScale();var Qe=0,Ke=Fe?(we.tickvals||[]).filter(function($e){return $e>=0}).map(function($e){return i.tickText(we,$e,!0,!1)}):i.calcTicks(we),Xe=Fe?Ke:i.clipEnds(we,Ke),Me=i.getTickSigns(we)[2];Fe&&((we.ticks==="top"&&we.side==="bottom"||we.ticks==="bottom"&&we.side==="top")&&(Me=-Me),we.ticks==="top"&&we.side==="top"&&(Qe=-we.ticklen),we.ticks==="bottom"&&we.side==="bottom"&&(Qe=we.ticklen)),i.drawTicks($,we,{vals:Ke,layer:X["radial-axis"],path:i.makeTickPath(we,0,Me),transFn:Ce,crisp:!1}),i.drawGrid($,we,{vals:Xe,layer:X["radial-grid"],path:qe,transFn:E.noop,crisp:!1}),i.drawLabels($,we,{vals:Ke,layer:X["radial-axis"],transFn:Ce,labelFns:i.makeLabelFns(we,Qe)})}var xe=J.radialAxisAngle=J.vangles?L(ue(O(ie.angle),J.vangles)):ie.angle,ce=t(q,ae),Re=ce+e(-xe);oe(X["radial-axis"],Ae&&(ie.showticklabels||ie.ticks),{transform:Re}),oe(X["radial-grid"],Ae&&ie.showgrid,{transform:Fe?"":ce}),oe(X["radial-line"].select("line"),Ae&&ie.showline,{x1:Fe?-re:ee,y1:0,x2:re,y2:0,transform:Re}).attr("stroke-width",ie.linewidth).call(r.stroke,ie.linecolor)},U.updateRadialAxisTitle=function(le,j,J){if(!this.isSmith){var $=this,X=$.gd,re=$.radius,ee=$.cx,q=$.cy,ae=$.getRadial(j),ie=$.id+"title",fe=0;if(ae.title){var we=o.bBox($.layers["radial-axis"].node()).height,Ae=ae.title.font.size,Fe=ae.side;fe=Fe==="top"?Ae:Fe==="counterclockwise"?-(we+Ae*.4):we+Ae*.8}var Ce=J!==void 0?J:$.radialAxisAngle,qe=O(Ce),et=Math.cos(qe),Qe=Math.sin(qe),Ke=ee+re/2*et+fe*Qe,Xe=q-re/2*Qe+fe*et;$.layers["radial-axis-title"]=T.draw(X,ie,{propContainer:ae,propName:$.id+".radialaxis.title",placeholder:F(X,"Click to enter radial axis title"),attributes:{x:Ke,y:Xe,"text-anchor":"middle"},transform:{rotate:-Ce}})}},U.updateAngularAxis=function(le,j){var J=this,$=J.gd,X=J.layers,re=J.radius,ee=J.innerRadius,q=J.cx,ae=J.cy,ie=J.getAngular(j),fe=J.angularAxis,we=J.isSmith;we||(J.fillViewInitialKey("angularaxis.rotation",ie.rotation),fe.setGeometry(),fe.setScale());var Ae=we?function(rt){var Je=z(J,m([0,rt.x]));return Math.atan2(Je[0]-q,Je[1]-ae)-Math.PI/2}:function(rt){return fe.t2g(rt.x)};fe.type==="linear"&&fe.thetaunit==="radians"&&(fe.tick0=L(fe.tick0),fe.dtick=L(fe.dtick));var Fe=function(rt){return t(q+re*Math.cos(rt),ae-re*Math.sin(rt))},Ce=we?function(rt){var Je=z(J,m([0,rt.x]));return t(Je[0],Je[1])}:function(rt){return Fe(Ae(rt))},qe=we?function(rt){var Je=z(J,m([0,rt.x])),At=Math.atan2(Je[0]-q,Je[1]-ae)-Math.PI/2;return t(Je[0],Je[1])+e(-L(At))}:function(rt){var Je=Ae(rt);return Fe(Je)+e(-L(Je))},et=we?function(rt){return R(J,rt.x,0,1/0)}:function(rt){var Je=Ae(rt),At=Math.cos(Je),St=Math.sin(Je);return"M"+[q+ee*At,ae-ee*St]+"L"+[q+re*At,ae-re*St]},Qe=i.makeLabelFns(fe,0),Ke=Qe.labelStandoff,Xe={};Xe.xFn=function(rt){var Je=Ae(rt);return Math.cos(Je)*Ke},Xe.yFn=function(rt){var Je=Ae(rt),At=Math.sin(Je)>0?.2:1;return-Math.sin(Je)*(Ke+rt.fontSize*At)+Math.abs(Math.cos(Je))*(rt.fontSize*w)},Xe.anchorFn=function(rt){var Je=Ae(rt),At=Math.cos(Je);return Math.abs(At)<.1?"middle":At>0?"start":"end"},Xe.heightFn=function(rt,Je,At){var St=Ae(rt);return-.5*(1+Math.sin(St))*At};var Me=Z(ie);J.angularTickLayout!==Me&&(X["angular-axis"].selectAll("."+fe._id+"tick").remove(),J.angularTickLayout=Me);var xe=we?[1/0].concat(fe.tickvals||[]).map(function(rt){return i.tickText(fe,rt,!0,!1)}):i.calcTicks(fe);we&&(xe[0].text="∞",xe[0].fontSize*=1.75);var ce;if(j.gridshape==="linear"?(ce=xe.map(Ae),E.angleDelta(ce[0],ce[1])<0&&(ce=ce.slice().reverse())):ce=null,J.vangles=ce,fe.type==="category"&&(xe=xe.filter(function(rt){return E.isAngleInsideSector(Ae(rt),J.sectorInRad)})),fe.visible){var Re=fe.ticks==="inside"?-1:1,$e=(fe.linewidth||1)/2;i.drawTicks($,fe,{vals:xe,layer:X["angular-axis"],path:"M"+Re*$e+",0h"+Re*fe.ticklen,transFn:qe,crisp:!1}),i.drawGrid($,fe,{vals:xe,layer:X["angular-grid"],path:et,transFn:E.noop,crisp:!1}),i.drawLabels($,fe,{vals:xe,layer:X["angular-axis"],repositionOnUpdate:!0,transFn:Ce,labelFns:Xe})}oe(X["angular-line"].select("path"),ie.showline,{d:J.pathSubplot(),transform:t(q,ae)}).attr("stroke-width",ie.linewidth).call(r.stroke,ie.linecolor)},U.updateFx=function(le,j){if(!this.gd._context.staticPlot){var J=!this.isSmith;J&&(this.updateAngularDrag(le),this.updateRadialDrag(le,j,0),this.updateRadialDrag(le,j,1)),this.updateHoverAndMainDrag(le)}},U.updateHoverAndMainDrag=function(le){var j=this,J=j.isSmith,$=j.gd,X=j.layers,re=le._zoomlayer,ee=p.MINZOOM,q=p.OFFEDGE,ae=j.radius,ie=j.innerRadius,fe=j.cx,we=j.cy,Ae=j.cxx,Fe=j.cyy,Ce=j.sectorInRad,qe=j.vangles,et=j.radialAxis,Qe=u.clampTiny,Ke=u.findXYatLength,Xe=u.findEnclosingVertexAngles,Me=p.cornerHalfWidth,xe=p.cornerLen/2,ce,Re,$e=f.makeDragger(X,"path","maindrag",le.dragmode===!1?"none":"crosshair");d.select($e).attr("d",j.pathSubplot()).attr("transform",t(fe,we)),$e.onmousemove=function(qt){h.hover($,qt,j.id),$._fullLayout._lasthover=$e,$._fullLayout._hoversubplot=j.id},$e.onmouseout=function(qt){$._dragging||v.unhover($,qt)};var rt={element:$e,gd:$,subplot:j.id,plotinfo:{id:j.id,xaxis:j.xaxis,yaxis:j.yaxis},xaxes:[j.xaxis],yaxes:[j.yaxis]},Je,At,St,Rt,Ut,ir,ar,Mr,fr;function dr(qt,Zt){return Math.sqrt(qt*qt+Zt*Zt)}function pt(qt,Zt){return dr(qt-Ae,Zt-Fe)}function ze(qt,Zt){return Math.atan2(Fe-Zt,qt-Ae)}function Ge(qt,Zt){return[qt*Math.cos(Zt),qt*Math.sin(-Zt)]}function Oe(qt,Zt){if(qt===0)return j.pathSector(2*Me);var lr=xe/qt,ta=Zt-lr,da=Zt+lr,wa=Math.max(0,Math.min(qt,ae)),ma=wa-Me,Ia=wa+Me;return"M"+Ge(ma,ta)+"A"+[ma,ma]+" 0,0,0 "+Ge(ma,da)+"L"+Ge(Ia,da)+"A"+[Ia,Ia]+" 0,0,1 "+Ge(Ia,ta)+"Z"}function ve(qt,Zt,lr){if(qt===0)return j.pathSector(2*Me);var ta=Ge(qt,Zt),da=Ge(qt,lr),wa=Qe((ta[0]+da[0])/2),ma=Qe((ta[1]+da[1])/2),Ia,va;if(wa&&ma){var La=ma/wa,Ka=-1/La,Vt=Ke(Me,La,wa,ma);Ia=Ke(xe,Ka,Vt[0][0],Vt[0][1]),va=Ke(xe,Ka,Vt[1][0],Vt[1][1])}else{var Lt,jt;ma?(Lt=xe,jt=Me):(Lt=Me,jt=xe),Ia=[[wa-Lt,ma-jt],[wa+Lt,ma-jt]],va=[[wa-Lt,ma+jt],[wa+Lt,ma+jt]]}return"M"+Ia.join("L")+"L"+va.reverse().join("L")+"Z"}function ge(){St=null,Rt=null,Ut=j.pathSubplot(),ir=!1;var qt=$._fullLayout[j.id];ar=x(qt.bgcolor).getLuminance(),Mr=f.makeZoombox(re,ar,fe,we,Ut),Mr.attr("fill-rule","evenodd"),fr=f.makeCorners(re,fe,we),b($)}function be(qt,Zt){return Zt=Math.max(Math.min(Zt,ae),ie),qtee?(qt-1&&qt===1&&y(Zt,$,[j.xaxis],[j.yaxis],j.id,rt),lr.indexOf("event")>-1&&h.click($,Zt,j.id)}rt.prepFn=function(qt,Zt,lr){var ta=$._fullLayout.dragmode,da=$e.getBoundingClientRect();$._fullLayout._calcInverseTransform($);var wa=$._fullLayout._invTransform;ce=$._fullLayout._invScaleX,Re=$._fullLayout._invScaleY;var ma=E.apply3DTransform(wa)(Zt-da.left,lr-da.top);if(Je=ma[0],At=ma[1],qe){var Ia=u.findPolygonOffset(ae,Ce[0],Ce[1],qe);Je+=Ae+Ia[0],At+=Fe+Ia[1]}switch(ta){case"zoom":rt.clickFn=Bt,J||(qe?rt.moveFn=_t:rt.moveFn=We,rt.doneFn=Mt,ge());break;case"select":case"lasso":l(qt,Zt,lr,rt,ta);break}},v.init(rt)},U.updateRadialDrag=function(le,j,J){var $=this,X=$.gd,re=$.layers,ee=$.radius,q=$.innerRadius,ae=$.cx,ie=$.cy,fe=$.radialAxis,we=p.radialDragBoxSize,Ae=we/2;if(!fe.visible)return;var Fe=O($.radialAxisAngle),Ce=fe._rl,qe=Ce[0],et=Ce[1],Qe=Ce[J],Ke=.75*(Ce[1]-Ce[0])/(1-$.getHole(j))/ee,Xe,Me,xe;J?(Xe=ae+(ee+Ae)*Math.cos(Fe),Me=ie-(ee+Ae)*Math.sin(Fe),xe="radialdrag"):(Xe=ae+(q-Ae)*Math.cos(Fe),Me=ie-(q-Ae)*Math.sin(Fe),xe="radialdrag-inner");var ce=f.makeRectDragger(re,xe,"crosshair",-Ae,-Ae,we,we),Re={element:ce,gd:X};le.dragmode===!1&&(Re.dragmode=!1),oe(d.select(ce),fe.visible&&q0!=(J?Je>qe:Je=90||X>90&&re>=450?Fe=1:q<=0&&ie<=0?Fe=0:Fe=Math.max(q,ie),X<=180&&re>=180||X>180&&re>=540?fe=-1:ee>=0&&ae>=0?fe=0:fe=Math.min(ee,ae),X<=270&&re>=270||X>270&&re>=630?we=-1:q>=0&&ie>=0?we=0:we=Math.min(q,ie),re>=360?Ae=1:ee<=0&&ae<=0?Ae=0:Ae=Math.max(ee,ae),[fe,we,Ae,Fe]}function ue(le,j){var J=function(X){return E.angleDist(le,X)},$=E.findIndexOfMin(j,J);return j[$]}function oe(le,j,J){return j?(le.attr("display",null),le.attr(J)):le&&le.attr("display","none"),le}}}),yA=He({"src/plots/polar/layout_attributes.js"(Y,G){var d=Xc(),x=jf(),A=mu().attributes,E=Gr().extendFlat,e=hu().overrideAll,t=e({color:x.color,showline:E({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:E({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({tickmode:x.minor.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,ticklabelstep:x.ticklabelstep,showticklabels:x.showticklabels,labelalias:x.labelalias,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,showexponent:x.showexponent,exponentformat:x.exponentformat,minexponent:x.minexponent,separatethousands:x.separatethousands,tickfont:x.tickfont,tickangle:x.tickangle,tickformat:x.tickformat,tickformatstops:x.tickformatstops,layer:x.layer},"plot","from-root"),o={visible:E({},x.visible,{dflt:!0}),type:E({},x.type,{values:["-","linear","log","date","category"]}),autotypenumbers:x.autotypenumbers,autorangeoptions:{minallowed:x.autorangeoptions.minallowed,maxallowed:x.autorangeoptions.maxallowed,clipmin:x.autorangeoptions.clipmin,clipmax:x.autorangeoptions.clipmax,include:x.autorangeoptions.include,editType:"plot"},autorange:E({},x.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:E({},x.minallowed,{editType:"plot"}),maxallowed:E({},x.maxallowed,{editType:"plot"}),range:E({},x.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:x.categoryorder,categoryarray:x.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:x.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:E({},x.title.text,{editType:"plot",dflt:""}),font:E({},x.title.font,{editType:"plot"}),editType:"plot"},hoverformat:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(o,t,r);var a={visible:E({},x.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:x.autotypenumbers,categoryorder:x.categoryorder,categoryarray:x.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(a,t,r),G.exports={domain:A({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:d.background},radialaxis:o,angularaxis:a,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),tz=He({"src/plots/polar/layout_defaults.js"(Y,G){var d=Gr(),x=Ai(),A=Gs(),E=Xd(),e=Uf().getSubplotData,t=Ep(),r=O0(),o=Vd(),a=qd(),i=p1(),n=ay(),s=Sb(),c=N0(),f=yA(),v=dA(),h=yx(),T=h.axisNames;function l(b,S,M,_){var w=M("bgcolor");_.bgColor=x.combine(w,_.paper_bgcolor);var p=M("sector");M("hole");var u=e(_.fullData,h.name,_.id),g=_.layoutOut,m;function R(we,Ae){return M(m+"."+we,Ae)}for(var P=0;P")}}G.exports={hoverPoints:x,makeHoverPointText:A}}}),nz=He({"src/traces/scatterpolar/index.js"(Y,G){G.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:_x(),categories:["polar","symbols","showLegend","scatter-like"],attributes:$y(),supplyDefaults:xx().supplyDefaults,colorbar:ah(),formatLabels:bx(),calc:rz(),plot:az(),style:Ih().style,styleOnSelect:Ih().styleOnSelect,hoverPoints:wx().hoverPoints,selectPoints:W0(),meta:{}}}}),iz=He({"lib/scatterpolar.js"(Y,G){G.exports=nz()}}),mA=He({"src/traces/scatterpolargl/attributes.js"(Y,G){var d=$y(),x=qy(),A=Yo().texttemplateAttrs;G.exports={mode:d.mode,r:d.r,theta:d.theta,r0:d.r0,dr:d.dr,theta0:d.theta0,dtheta:d.dtheta,thetaunit:d.thetaunit,text:d.text,texttemplate:A({editType:"plot"},{keys:["r","theta","text"]}),hovertext:d.hovertext,hovertemplate:d.hovertemplate,line:{color:x.line.color,width:x.line.width,dash:x.line.dash,editType:"calc"},connectgaps:x.connectgaps,marker:x.marker,fill:x.fill,fillcolor:x.fillcolor,textposition:x.textposition,textfont:x.textfont,hoverinfo:d.hoverinfo,selected:d.selected,unselected:d.unselected}}}),oz=He({"src/traces/scatterpolargl/defaults.js"(Y,G){var d=Gr(),x=Rl(),A=xx().handleRThetaDefaults,E=Kh(),e=nv(),t=iv(),r=Av(),o=jv().PTS_LINESONLY,a=mA();G.exports=function(n,s,c,f){function v(T,l){return d.coerce(n,s,a,T,l)}var h=A(n,s,f,v);if(!h){s.visible=!1;return}v("thetaunit"),v("mode",h=r&&(_.marker.cluster=y.tree),_.marker&&(_.markerSel.positions=_.markerUnsel.positions=_.marker.positions=g),_.line&&g.length>1&&t.extendFlat(_.line,e.linePositions(i,l,g)),_.text&&(t.extendFlat(_.text,{positions:g},e.textPosition(i,l,_.text,_.marker)),t.extendFlat(_.textSel,{positions:g},e.textPosition(i,l,_.text,_.markerSel)),t.extendFlat(_.textUnsel,{positions:g},e.textPosition(i,l,_.text,_.markerUnsel))),_.fill&&!v.fill2d&&(v.fill2d=!0),_.marker&&!v.scatter2d&&(v.scatter2d=!0),_.line&&!v.line2d&&(v.line2d=!0),_.text&&!v.glText&&(v.glText=!0),v.lineOptions.push(_.line),v.fillOptions.push(_.fill),v.markerOptions.push(_.marker),v.markerSelectedOptions.push(_.markerSel),v.markerUnselectedOptions.push(_.markerUnsel),v.textOptions.push(_.text),v.textSelectedOptions.push(_.textSel),v.textUnselectedOptions.push(_.textUnsel),v.selectBatch.push([]),v.unselectBatch.push([]),y.x=m,y.y=R,y.rawx=m,y.rawy=R,y.r=S,y.theta=M,y.positions=g,y._scene=v,y.index=v.count,v.count++}}),A(i,n,s)}},G.exports.reglPrecompiled=o}}),hz=He({"src/traces/scatterpolargl/index.js"(Y,G){var d=cz();d.plot=fz(),G.exports=d}}),vz=He({"lib/scatterpolargl.js"(Y,G){G.exports=hz()}}),_A=He({"src/traces/barpolar/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=ho().extendFlat,A=$y(),E=qv();G.exports={r:A.r,theta:A.theta,r0:A.r0,dr:A.dr,theta0:A.theta0,dtheta:A.dtheta,thetaunit:A.thetaunit,base:x({},E.base,{}),offset:x({},E.offset,{}),width:x({},E.width,{}),text:x({},E.text,{}),hovertext:x({},E.hovertext,{}),marker:e(),hoverinfo:A.hoverinfo,hovertemplate:d(),selected:E.selected,unselected:E.unselected};function e(){var t=x({},E.marker);return delete t.cornerradius,t}}}),xA=He({"src/traces/barpolar/layout_attributes.js"(Y,G){G.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),dz=He({"src/traces/barpolar/defaults.js"(Y,G){var d=Gr(),x=xx().handleRThetaDefaults,A=A1(),E=_A();G.exports=function(t,r,o,a){function i(s,c){return d.coerce(t,r,E,s,c)}var n=x(t,r,a,i);if(!n){r.visible=!1;return}i("thetaunit"),i("base"),i("offset"),i("width"),i("text"),i("hovertext"),i("hovertemplate"),A(t,r,i,o,a),d.coerceSelectionMarkerOpacity(r,i)}}}),pz=He({"src/traces/barpolar/layout_defaults.js"(Y,G){var d=Gr(),x=xA();G.exports=function(A,E,e){var t={},r;function o(n,s){return d.coerce(A[r]||{},E[r],x,n,s)}for(var a=0;a0?(f=s,v=c):(f=c,v=s);var h=e.findEnclosingVertexAngles(f,r.vangles)[0],T=e.findEnclosingVertexAngles(v,r.vangles)[1],l=[h,(f+v)/2,T];return e.pathPolygonAnnulus(i,n,f,v,l,o,a)}:function(i,n,s,c){return A.pathAnnulus(i,n,s,c,o,a)}}}}),yz=He({"src/traces/barpolar/hover.js"(Y,G){var d=Wu(),x=Gr(),A=Z0().getTraceColor,E=x.fillText,e=wx().makeHoverPointText,t=mx().isPtInsidePolygon;G.exports=function(o,a,i){var n=o.cd,s=n[0].trace,c=o.subplot,f=c.radialAxis,v=c.angularAxis,h=c.vangles,T=h?t:x.isPtInsideSector,l=o.maxHoverDistance,y=v._period||2*Math.PI,b=Math.abs(f.g2p(Math.sqrt(a*a+i*i))),S=Math.atan2(i,a);f.range[0]>f.range[1]&&(S+=Math.PI);var M=function(u){return T(b,S,[u.rp0,u.rp1],[u.thetag0,u.thetag1],h)?l+Math.min(1,Math.abs(u.thetag1-u.thetag0)/y)-1+(u.rp1-b)/(u.rp1-u.rp0)-1:1/0};if(d.getClosest(n,M,o),o.index!==!1){var _=o.index,w=n[_];o.x0=o.x1=w.ct[0],o.y0=o.y1=w.ct[1];var p=x.extendFlat({},w,{r:w.s,theta:w.p});return E(w,s,o),e(p,s,c,o),o.hovertemplate=s.hovertemplate,o.color=A(s,w),o.xLabelVal=o.yLabelVal=void 0,w.s<0&&(o.idealAlign="left"),[o]}}}}),mz=He({"src/traces/barpolar/index.js"(Y,G){G.exports={moduleType:"trace",name:"barpolar",basePlotModule:_x(),categories:["polar","bar","showLegend"],attributes:_A(),layoutAttributes:xA(),supplyDefaults:dz(),supplyLayoutDefaults:pz(),calc:bA().calc,crossTraceCalc:bA().crossTraceCalc,plot:gz(),colorbar:ah(),formatLabels:bx(),style:uv().style,styleOnSelect:uv().styleOnSelect,hoverPoints:yz(),selectPoints:X0(),meta:{}}}}),_z=He({"lib/barpolar.js"(Y,G){G.exports=mz()}}),wA=He({"src/plots/smith/constants.js"(Y,G){G.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),TA=He({"src/plots/smith/layout_attributes.js"(Y,G){var d=Xc(),x=jf(),A=mu().attributes,E=Gr().extendFlat,e=hu().overrideAll,t=e({color:x.color,showline:E({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:E({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({ticklen:x.ticklen,tickwidth:E({},x.tickwidth,{dflt:2}),tickcolor:x.tickcolor,showticklabels:x.showticklabels,labelalias:x.labelalias,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,tickfont:x.tickfont,tickformat:x.tickformat,hoverformat:x.hoverformat,layer:x.layer},"plot","from-root"),o=E({visible:E({},x.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:E({},x.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},t,r),a=E({visible:E({},x.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:x.ticks,editType:"calc"},t,r);G.exports={domain:A({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:d.background},realaxis:o,imaginaryaxis:a,editType:"calc"}}}),xz=He({"src/plots/smith/layout_defaults.js"(Y,G){var d=Gr(),x=Ai(),A=Gs(),E=Xd(),e=Uf().getSubplotData,t=qd(),r=Vd(),o=ay(),a=Uv(),i=TA(),n=wA(),s=n.axisNames,c=v(function(h){return d.isTypedArray(h)&&(h=Array.from(h)),h.slice().reverse().map(function(T){return-T}).concat([0]).concat(h)},String);function f(h,T,l,y){var b=l("bgcolor");y.bgColor=x.combine(b,y.paper_bgcolor);var S=e(y.fullData,n.name,y.id),M=y.layoutOut,_;function w(U,Z){return l(_+"."+U,Z)}for(var p=0;p")}}G.exports={hoverPoints:x,makeHoverPointText:A}}}),Ez=He({"src/traces/scattersmith/index.js"(Y,G){G.exports={moduleType:"trace",name:"scattersmith",basePlotModule:bz(),categories:["smith","symbols","showLegend","scatter-like"],attributes:AA(),supplyDefaults:wz(),colorbar:ah(),formatLabels:Tz(),calc:Az(),plot:Sz(),style:Ih().style,styleOnSelect:Ih().styleOnSelect,hoverPoints:Mz().hoverPoints,selectPoints:W0(),meta:{}}}}),kz=He({"lib/scattersmith.js"(Y,G){G.exports=Ez()}}),vh=He({"node_modules/world-calendars/dist/main.js"(Y,G){var d=Yc();function x(){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={}}d(x.prototype,{instance:function(o,a){o=(o||"gregorian").toLowerCase(),a=a||"";var i=this._localCals[o+"-"+a];if(!i&&this.calendars[o]&&(i=new this.calendars[o](a),this._localCals[o+"-"+a]=i),!i)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,o);return i},newDate:function(o,a,i,n,s){return n=(o!=null&&o.year?o.calendar():typeof n=="string"?this.instance(n,s):n)||this.instance(),n.newDate(o,a,i)},substituteDigits:function(o){return function(a){return(a+"").replace(/[0-9]/g,function(i){return o[i]})}},substituteChineseDigits:function(o,a){return function(i){for(var n="",s=0;i>0;){var c=i%10;n=(c===0?"":o[c]+a[s])+n,s++,i=Math.floor(i/10)}return n.indexOf(o[1]+a[1])===0&&(n=n.substr(1)),n||o[0]}}});function A(o,a,i,n){if(this._calendar=o,this._year=a,this._month=i,this._day=n,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function E(o,a){return o=""+o,"000000".substring(0,a-o.length)+o}d(A.prototype,{newDate:function(o,a,i){return this._calendar.newDate(o??this,a,i)},year:function(o){return arguments.length===0?this._year:this.set(o,"y")},month:function(o){return arguments.length===0?this._month:this.set(o,"m")},day:function(o){return arguments.length===0?this._day:this.set(o,"d")},date:function(o,a,i){if(!this._calendar.isValid(o,a,i))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=o,this._month=a,this._day=i,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(o,a){return this._calendar.add(this,o,a)},set:function(o,a){return this._calendar.set(this,o,a)},compareTo:function(o){if(this._calendar.name!==o._calendar.name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,o._calendar.local.name);var a=this._year!==o._year?this._year-o._year:this._month!==o._month?this.monthOfYear()-o.monthOfYear():this._day-o._day;return a===0?0:a<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(o){return this._calendar.fromJD(o)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(o){return this._calendar.fromJSDate(o)},toString:function(){return(this.year()<0?"-":"")+E(Math.abs(this.year()),4)+"-"+E(this.month(),2)+"-"+E(this.day(),2)}});function e(){this.shortYearCutoff="+10"}d(e.prototype,{_validateLevel:0,newDate:function(o,a,i){return o==null?this.today():(o.year&&(this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),i=o.day(),a=o.month(),o=o.year()),new A(this,o,a,i))},today:function(){return this.fromJSDate(new Date)},epoch:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return a.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return(a.year()<0?"-":"")+E(Math.abs(a.year()),4)},monthsInYear:function(o){return this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),12},monthOfYear:function(o,a){var i=this._validate(o,a,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return(i.month()+this.monthsInYear(i)-this.firstMonth)%this.monthsInYear(i)+this.minMonth},fromMonthOfYear:function(o,a){var i=(a+this.firstMonth-2*this.minMonth)%this.monthsInYear(o)+this.minMonth;return this._validate(o,i,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth),i},daysInYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return this.leapYear(a)?366:365},dayOfYear:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(o,a,i){return this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),{}},add:function(o,a,i){return this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate),this._correctAdd(o,this._add(o,a,i),a,i)},_add:function(o,a,i){if(this._validateLevel++,i==="d"||i==="w"){var n=o.toJD()+a*(i==="w"?this.daysInWeek():1),s=o.calendar().fromJD(n);return this._validateLevel--,[s.year(),s.month(),s.day()]}try{var c=o.year()+(i==="y"?a:0),f=o.monthOfYear()+(i==="m"?a:0),s=o.day(),v=function(l){for(;fy-1+l.minMonth;)c++,f-=y,y=l.monthsInYear(c)};i==="y"?(o.month()!==this.fromMonthOfYear(c,f)&&(f=this.newDate(c,o.month(),this.minDay).monthOfYear()),f=Math.min(f,this.monthsInYear(c)),s=Math.min(s,this.daysInMonth(c,this.fromMonthOfYear(c,f)))):i==="m"&&(v(this),s=Math.min(s,this.daysInMonth(c,this.fromMonthOfYear(c,f))));var h=[c,this.fromMonthOfYear(c,f),s];return this._validateLevel--,h}catch(T){throw this._validateLevel--,T}},_correctAdd:function(o,a,i,n){if(!this.hasYearZero&&(n==="y"||n==="m")&&(a[0]===0||o.year()>0!=a[0]>0)){var s={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],c=i<0?-1:1;a=this._add(o,i*s[0]+c*s[1],s[2])}return o.date(a[0],a[1],a[2])},set:function(o,a,i){this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate);var n=i==="y"?a:o.year(),s=i==="m"?a:o.month(),c=i==="d"?a:o.day();return(i==="y"||i==="m")&&(c=Math.min(c,this.daysInMonth(n,s))),o.date(n,s,c)},isValid:function(o,a,i){this._validateLevel++;var n=this.hasYearZero||o!==0;if(n){var s=this.newDate(o,a,this.minDay);n=a>=this.minMonth&&a-this.minMonth=this.minDay&&i-this.minDay13.5?13:1),T=s-(h>2.5?4716:4715);return T<=0&&T--,this.newDate(T,h,v)},toJSDate:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),s=new Date(n.year(),n.month()-1,n.day());return s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0),s.setHours(s.getHours()>12?s.getHours()+2:0),s},fromJSDate:function(o){return this.newDate(o.getFullYear(),o.getMonth()+1,o.getDate())}});var r=G.exports=new x;r.cdate=A,r.baseCalendar=e,r.calendars.gregorian=t}}),Cz=He({"node_modules/world-calendars/dist/plus.js"(){var Y=Yc(),G=vh();Y(G.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"}),G.local=G.regionalOptions[""],Y(G.cdate.prototype,{formatDate:function(d,x){return typeof d!="string"&&(x=d,d=""),this._calendar.formatDate(d||"",this,x)}}),Y(G.baseCalendar.prototype,{UNIX_EPOCH:G.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:24*60*60,TICKS_EPOCH:G.instance().jdEpoch,TICKS_PER_DAY:24*60*60*1e7,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(d,x,A){if(typeof d!="string"&&(A=x,x=d,d=""),!x)return"";if(x.calendar()!==this)throw G.local.invalidFormat||G.regionalOptions[""].invalidFormat;d=d||this.local.dateFormat,A=A||{};var E=A.dayNamesShort||this.local.dayNamesShort,e=A.dayNames||this.local.dayNames,t=A.monthNumbers||this.local.monthNumbers,r=A.monthNamesShort||this.local.monthNamesShort,o=A.monthNames||this.local.monthNames;A.calculateWeek||this.local.calculateWeek;for(var a=function(b,S){for(var M=1;y+M1},i=function(b,S,M,_){var w=""+S;if(a(b,_))for(;w.length1},y=function(R,P){var z=l(R,P),F=[2,3,z?4:2,z?4:2,10,11,20]["oyYJ@!".indexOf(R)+1],B=new RegExp("^-?\\d{1,"+F+"}"),O=x.substring(p).match(B);if(!O)throw(G.local.missingNumberAt||G.regionalOptions[""].missingNumberAt).replace(/\{0\}/,p);return p+=O[0].length,parseInt(O[0],10)},b=this,S=function(){if(typeof o=="function"){l("m");var R=o.call(b,x.substring(p));return p+=R.length,R}return y("m")},M=function(R,P,z,F){for(var B=l(R,F)?z:P,O=0;O-1){c=1,f=v;for(var m=this.daysInMonth(s,c);f>m;m=this.daysInMonth(s,c))c++,f-=m}return n>-1?this.fromJD(n):this.newDate(s,c,f)},determineDate:function(d,x,A,E,e){A&&typeof A!="object"&&(e=E,E=A,A=null),typeof E!="string"&&(e=E,E="");var t=this,r=function(o){try{return t.parseDate(E,o,e)}catch{}o=o.toLowerCase();for(var a=(o.match(/^c/)&&A?A.newDate():null)||t.today(),i=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,n=i.exec(o);n;)a.add(parseInt(n[1],10),n[2]||"d"),n=i.exec(o);return a};return x=x?x.newDate():null,d=d==null?x:typeof d=="string"?r(d):typeof d=="number"?isNaN(d)||d===1/0||d===-1/0?x:t.today().add(d,"d"):t.newDate(d),d}})}}),Lz=He({"node_modules/world-calendars/dist/calendars/chinese.js"(){var Y=vh(),G=Yc(),d=Y.instance();function x(n){this.local=this.regionalOptions[n||""]||this.regionalOptions[""]}x.prototype=new Y.baseCalendar,G(x.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(n,s){if(typeof n=="string"){var c=n.match(E);return c?c[0]:""}var f=this._validateYear(n),v=n.month(),h=""+this.toChineseMonth(f,v);return s&&h.length<2&&(h="0"+h),this.isIntercalaryMonth(f,v)&&(h+="i"),h},monthNames:function(n){if(typeof n=="string"){var s=n.match(e);return s?s[0]:""}var c=this._validateYear(n),f=n.month(),v=this.toChineseMonth(c,f),h=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][v-1];return this.isIntercalaryMonth(c,f)&&(h="闰"+h),h},monthNamesShort:function(n){if(typeof n=="string"){var s=n.match(t);return s?s[0]:""}var c=this._validateYear(n),f=n.month(),v=this.toChineseMonth(c,f),h=["一","二","三","四","五","六","七","八","九","十","十一","十二"][v-1];return this.isIntercalaryMonth(c,f)&&(h="闰"+h),h},parseMonth:function(n,s){n=this._validateYear(n);var c=parseInt(s),f;if(isNaN(c))s[0]==="闰"&&(f=!0,s=s.substring(1)),s[s.length-1]==="月"&&(s=s.substring(0,s.length-1)),c=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(s);else{var v=s[s.length-1];f=v==="i"||v==="I"}var h=this.toMonthIndex(n,c,f);return h},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(n,s){if(n.year&&(n=n.year()),typeof n!="number"||n<1888||n>2111)throw s.replace(/\{0\}/,this.local.name);return n},toMonthIndex:function(n,s,c){var f=this.intercalaryMonth(n),v=c&&s!==f;if(v||s<1||s>12)throw Y.local.invalidMonth.replace(/\{0\}/,this.local.name);var h;return f?!c&&s<=f?h=s-1:h=s:h=s-1,h},toChineseMonth:function(n,s){n.year&&(n=n.year(),s=n.month());var c=this.intercalaryMonth(n),f=c?12:11;if(s<0||s>f)throw Y.local.invalidMonth.replace(/\{0\}/,this.local.name);var v;return c?s>13;return c},isIntercalaryMonth:function(n,s){n.year&&(n=n.year(),s=n.month());var c=this.intercalaryMonth(n);return!!c&&c===s},leapYear:function(n){return this.intercalaryMonth(n)!==0},weekOfYear:function(n,s,c){var f=this._validateYear(n,Y.local.invalidyear),v=o[f-o[0]],h=v>>9&4095,T=v>>5&15,l=v&31,y;y=d.newDate(h,T,l),y.add(4-(y.dayOfWeek()||7),"d");var b=this.toJD(n,s,c)-y.toJD();return 1+Math.floor(b/7)},monthsInYear:function(n){return this.leapYear(n)?13:12},daysInMonth:function(n,s){n.year&&(s=n.month(),n=n.year()),n=this._validateYear(n);var c=r[n-r[0]],f=c>>13,v=f?12:11;if(s>v)throw Y.local.invalidMonth.replace(/\{0\}/,this.local.name);var h=c&1<<12-s?30:29;return h},weekDay:function(n,s,c){return(this.dayOfWeek(n,s,c)||7)<6},toJD:function(n,s,c){var f=this._validate(n,h,c,Y.local.invalidDate);n=this._validateYear(f.year()),s=f.month(),c=f.day();var v=this.isIntercalaryMonth(n,s),h=this.toChineseMonth(n,s),T=i(n,h,c,v);return d.toJD(T.year,T.month,T.day)},fromJD:function(n){var s=d.fromJD(n),c=a(s.year(),s.month(),s.day()),f=this.toMonthIndex(c.year,c.month,c.isIntercalary);return this.newDate(c.year,f,c.day)},fromString:function(n){var s=n.match(A),c=this._validateYear(+s[1]),f=+s[2],v=!!s[3],h=this.toMonthIndex(c,f,v),T=+s[4];return this.newDate(c,h,T)},add:function(n,s,c){var f=n.year(),v=n.month(),h=this.isIntercalaryMonth(f,v),T=this.toChineseMonth(f,v),l=Object.getPrototypeOf(x.prototype).add.call(this,n,s,c);if(c==="y"){var y=l.year(),b=l.month(),S=this.isIntercalaryMonth(y,T),M=h&&S?this.toMonthIndex(y,T,!0):this.toMonthIndex(y,T,!1);M!==b&&l.month(M)}return l}});var A=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,E=/^\d?\d[iI]?/m,e=/^闰?十?[一二三四五六七八九]?月/m,t=/^闰?十?[一二三四五六七八九]?/m;Y.calendars.chinese=x;var r=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],o=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function a(n,s,c,f){var v,h;if(typeof n=="object")v=n,h=s||{};else{var T=typeof n=="number"&&n>=1888&&n<=2111;if(!T)throw new Error("Solar year outside range 1888-2111");var l=typeof s=="number"&&s>=1&&s<=12;if(!l)throw new Error("Solar month outside range 1 - 12");var y=typeof c=="number"&&c>=1&&c<=31;if(!y)throw new Error("Solar day outside range 1 - 31");v={year:n,month:s,day:c},h={}}var b=o[v.year-o[0]],S=v.year<<9|v.month<<5|v.day;h.year=S>=b?v.year:v.year-1,b=o[h.year-o[0]];var M=b>>9&4095,_=b>>5&15,w=b&31,p,u=new Date(M,_-1,w),g=new Date(v.year,v.month-1,v.day);p=Math.round((g-u)/(24*3600*1e3));var m=r[h.year-r[0]],R;for(R=0;R<13;R++){var P=m&1<<12-R?30:29;if(p>13;return!z||R=1888&&n<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var y=typeof s=="number"&&s>=1&&s<=12;if(!y)throw new Error("Lunar month outside range 1 - 12");var b=typeof c=="number"&&c>=1&&c<=30;if(!b)throw new Error("Lunar day outside range 1 - 30");var S;typeof f=="object"?(S=!1,h=f):(S=!!f,h={}),T={year:n,month:s,day:c,isIntercalary:S}}var M;M=T.day-1;var _=r[T.year-r[0]],w=_>>13,p;w&&(T.month>w||T.isIntercalary)?p=T.month:p=T.month-1;for(var u=0;u>9&4095,P=m>>5&15,z=m&31,F=new Date(R,P-1,z+M);return h.year=F.getFullYear(),h.month=1+F.getMonth(),h.day=F.getDate(),h}}}),Pz=He({"node_modules/world-calendars/dist/calendars/coptic.js"(){var Y=vh(),G=Yc();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.prototype,{name:"Coptic",jdEpoch:18250295e-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:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),E=A.year()+(A.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear||Y.regionalOptions[""].invalidYear),13},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return(this.dayOfWeek(x,A,E)||7)<6},toJD:function(x,A,E){var e=this._validate(x,A,E,Y.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var A=Math.floor(x)+.5-this.jdEpoch,E=Math.floor((A-Math.floor((A+366)/1461))/365)+1;E<=0&&E--,A=Math.floor(x)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(A/30)+1,t=A-(e-1)*30+1;return this.newDate(E,e,t)}}),Y.calendars.coptic=d}}),Iz=He({"node_modules/world-calendars/dist/calendars/discworld.js"(){var Y=vh(),G=Yc();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(A){return this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear),!1},monthsInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear),13},daysInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear),400},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/8)+1},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);return(t.day()+1)%8},weekDay:function(A,E,e){var t=this.dayOfWeek(A,E,e);return t>=2&&t<=6},extraInfo:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);return{century:x[Math.floor((t.year()-1)/100)+1]||""}},toJD:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);return A=t.year()+(t.year()<0?1:0),E=t.month(),e=t.day(),e+(E>1?16:0)+(E>2?(E-2)*32:0)+(A-1)*400+this.jdEpoch-1},fromJD:function(A){A=Math.floor(A+.5)-Math.floor(this.jdEpoch)-1;var E=Math.floor(A/400)+1;A-=(E-1)*400,A+=A>15?16:0;var e=Math.floor(A/32)+1,t=A-(e-1)*32+1;return this.newDate(E<=0?E-1:E,e,t)}});var x={20:"Fruitbat",21:"Anchovy"};Y.calendars.discworld=d}}),Rz=He({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var Y=vh(),G=Yc();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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(E){var A=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),E=A.year()+(A.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear||Y.regionalOptions[""].invalidYear),13},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return(this.dayOfWeek(x,A,E)||7)<6},toJD:function(x,A,E){var e=this._validate(x,A,E,Y.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var A=Math.floor(x)+.5-this.jdEpoch,E=Math.floor((A-Math.floor((A+366)/1461))/365)+1;E<=0&&E--,A=Math.floor(x)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(A/30)+1,t=A-(e-1)*30+1;return this.newDate(E,e,t)}}),Y.calendars.ethiopian=d}}),Dz=He({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var Y=vh(),G=Yc();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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(A){var E=this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear);return this._leapYear(E.year())},_leapYear:function(A){return A=A<0?A+1:A,x(A*7+1,19)<7},monthsInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear),this._leapYear(A.year?A.year():A)?13:12},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear);return A=E.year(),this.toJD(A===-1?1:A+1,7,1)-this.toJD(A,7,1)},daysInMonth:function(A,E){return A.year&&(E=A.month(),A=A.year()),this._validate(A,E,this.minDay,Y.local.invalidMonth),E===12&&this.leapYear(A)||E===8&&x(this.daysInYear(A),10)===5?30:E===9&&x(this.daysInYear(A),10)===3?29:this.daysPerMonth[E-1]},weekDay:function(A,E,e){return this.dayOfWeek(A,E,e)!==6},extraInfo:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);return{yearType:(this.leapYear(t)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(t)%10-3]}},toJD:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);A=t.year(),E=t.month(),e=t.day();var r=A<=0?A+1:A,o=this.jdEpoch+this._delay1(r)+this._delay2(r)+e+1;if(E<7){for(var a=7;a<=this.monthsInYear(A);a++)o+=this.daysInMonth(A,a);for(var a=1;a=this.toJD(E===-1?1:E+1,7,1);)E++;for(var e=Athis.toJD(E,e,this.daysInMonth(E,e));)e++;var t=A-this.toJD(E,e,1)+1;return this.newDate(E,e,t)}});function x(A,E){return A-E*Math.floor(A/E)}Y.calendars.hebrew=d}}),zz=He({"node_modules/world-calendars/dist/calendars/islamic.js"(){var Y=vh(),G=Yc();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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īs","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(x){var A=this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear);return(A.year()*11+14)%30<11},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){return this.leapYear(x)?355:354},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===12&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return this.dayOfWeek(x,A,E)!==5},toJD:function(x,A,E){var e=this._validate(x,A,E,Y.local.invalidDate);return x=e.year(),A=e.month(),E=e.day(),x=x<=0?x+1:x,E+Math.ceil(29.5*(A-1))+(x-1)*354+Math.floor((3+11*x)/30)+this.jdEpoch-1},fromJD:function(x){x=Math.floor(x)+.5;var A=Math.floor((30*(x-this.jdEpoch)+10646)/10631);A=A<=0?A-1:A;var E=Math.min(12,Math.ceil((x-29-this.toJD(A,1,1))/29.5)+1),e=x-this.toJD(A,E,1)+1;return this.newDate(A,E,e)}}),Y.calendars.islamic=d}}),Fz=He({"node_modules/world-calendars/dist/calendars/julian.js"(){var Y=vh(),G=Yc();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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(E){var A=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),E=A.year()<0?A.year()+1:A.year();return E%4===0},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(4-(e.dayOfWeek()||7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===2&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return(this.dayOfWeek(x,A,E)||7)<6},toJD:function(x,A,E){var e=this._validate(x,A,E,Y.local.invalidDate);return x=e.year(),A=e.month(),E=e.day(),x<0&&x++,A<=2&&(x--,A+=12),Math.floor(365.25*(x+4716))+Math.floor(30.6001*(A+1))+E-1524.5},fromJD:function(x){var A=Math.floor(x+.5),E=A+1524,e=Math.floor((E-122.1)/365.25),t=Math.floor(365.25*e),r=Math.floor((E-t)/30.6001),o=r-Math.floor(r<14?1:13),a=e-Math.floor(o>2?4716:4715),i=E-t-Math.floor(30.6001*r);return a<=0&&a--,this.newDate(a,o,i)}}),Y.calendars.julian=d}}),Oz=He({"node_modules/world-calendars/dist/calendars/mayan.js"(){var Y=vh(),G=Yc();function d(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(E){return this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),!1},formatYear:function(E){var e=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear);E=e.year();var t=Math.floor(E/400);E=E%400,E+=E<0?400:0;var r=Math.floor(E/20);return t+"."+r+"."+E%20},forYear:function(E){if(E=E.split("."),E.length<3)throw"Invalid Mayan year";for(var e=0,t=0;t19||t>0&&r<0)throw"Invalid Mayan year";e=e*20+r}return e},monthsInYear:function(E){return this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),18},weekOfYear:function(E,e,t){return this._validate(E,e,t,Y.local.invalidDate),0},daysInYear:function(E){return this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),360},daysInMonth:function(E,e){return this._validate(E,e,this.minDay,Y.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(E,e,t){var r=this._validate(E,e,t,Y.local.invalidDate);return r.day()},weekDay:function(E,e,t){return this._validate(E,e,t,Y.local.invalidDate),!0},extraInfo:function(E,e,t){var r=this._validate(E,e,t,Y.local.invalidDate),o=r.toJD(),a=this._toHaab(o),i=this._toTzolkin(o);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[i[0]-1],tzolkinDay:i[0],tzolkinTrecena:i[1]}},_toHaab:function(E){E-=this.jdEpoch;var e=x(E+8+17*20,365);return[Math.floor(e/20)+1,x(e,20)]},_toTzolkin:function(E){return E-=this.jdEpoch,[A(E+20,20),A(E+4,13)]},toJD:function(E,e,t){var r=this._validate(E,e,t,Y.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(E){E=Math.floor(E)+.5-this.jdEpoch;var e=Math.floor(E/360);E=E%360,E+=E<0?360:0;var t=Math.floor(E/20),r=E%20;return this.newDate(e,t,r)}});function x(E,e){return E-e*Math.floor(E/e)}function A(E,e){return x(E-1,e)+1}Y.calendars.mayan=d}}),Bz=He({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var Y=vh(),G=Yc();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar;var x=Y.instance("gregorian");G(d.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(A){var E=this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear||Y.regionalOptions[""].invalidYear);return x.leapYear(E.year()+(E.year()<1?1:0)+1469)},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(1-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return(this.dayOfWeek(A,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Y.local.invalidMonth),r=t.year();r<0&&r++;for(var o=t.day(),a=1;a=this.toJD(E+1,1,1);)E++;for(var e=A-Math.floor(this.toJD(E,1,1)+.5)+1,t=1;e>this.daysInMonth(E,t);)e-=this.daysInMonth(E,t),t++;return this.newDate(E,t,e)}}),Y.calendars.nanakshahi=d}}),Nz=He({"node_modules/world-calendars/dist/calendars/nepali.js"(){var Y=vh(),G=Yc();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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(x){return this.daysInYear(x)!==this.daysPerYear},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){var A=this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear);if(x=A.year(),typeof this.NEPALI_CALENDAR_DATA[x]>"u")return this.daysPerYear;for(var E=0,e=this.minMonth;e<=12;e++)E+=this.NEPALI_CALENDAR_DATA[x][e];return E},daysInMonth:function(x,A){return x.year&&(A=x.month(),x=x.year()),this._validate(x,A,this.minDay,Y.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[x]>"u"?this.daysPerMonth[A-1]:this.NEPALI_CALENDAR_DATA[x][A]},weekDay:function(x,A,E){return this.dayOfWeek(x,A,E)!==6},toJD:function(x,A,E){var e=this._validate(x,A,E,Y.local.invalidDate);x=e.year(),A=e.month(),E=e.day();var t=Y.instance(),r=0,o=A,a=x;this._createMissingCalendarData(x);var i=x-(o>9||o===9&&E>=this.NEPALI_CALENDAR_DATA[a][0]?56:57);for(A!==9&&(r=E,o--);o!==9;)o<=0&&(o=12,a--),r+=this.NEPALI_CALENDAR_DATA[a][o],o--;return A===9?(r+=E-this.NEPALI_CALENDAR_DATA[a][0],r<0&&(r+=t.daysInYear(i))):r+=this.NEPALI_CALENDAR_DATA[a][9]-this.NEPALI_CALENDAR_DATA[a][0],t.newDate(i,1,1).add(r,"d").toJD()},fromJD:function(x){var A=Y.instance(),E=A.fromJD(x),e=E.year(),t=E.dayOfYear(),r=e+56;this._createMissingCalendarData(r);for(var o=9,a=this.NEPALI_CALENDAR_DATA[r][0],i=this.NEPALI_CALENDAR_DATA[r][o]-a+1;t>i;)o++,o>12&&(o=1,r++),i+=this.NEPALI_CALENDAR_DATA[r][o];var n=this.NEPALI_CALENDAR_DATA[r][o]-(i-t);return this.newDate(r,o,n)},_createMissingCalendarData:function(x){var A=this.daysPerMonth.slice(0);A.unshift(17);for(var E=x-1;E"u"&&(this.NEPALI_CALENDAR_DATA[E]=A)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),Y.calendars.nepali=d}}),Uz=He({"node_modules/world-calendars/dist/calendars/persian.js"(){var Y=vh(),G=Yc();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Chæharshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Chæ","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear);return((E.year()-(E.year()>0?474:473))%2820+474+38)*682%2816<682},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-((t.dayOfWeek()+1)%7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return this.dayOfWeek(A,E,e)!==5},toJD:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);A=t.year(),E=t.month(),e=t.day();var r=A-(A>=0?474:473),o=474+x(r,2820);return e+(E<=7?(E-1)*31:(E-1)*30+6)+Math.floor((o*682-110)/2816)+(o-1)*365+Math.floor(r/2820)*1029983+this.jdEpoch-1},fromJD:function(A){A=Math.floor(A)+.5;var E=A-this.toJD(475,1,1),e=Math.floor(E/1029983),t=x(E,1029983),r=2820;if(t!==1029982){var o=Math.floor(t/366),a=x(t,366);r=Math.floor((2134*o+2816*a+2815)/1028522)+o+1}var i=r+2820*e+474;i=i<=0?i-1:i;var n=A-this.toJD(i,1,1)+1,s=n<=186?Math.ceil(n/31):Math.ceil((n-6)/30),c=A-this.toJD(i,s,1)+1;return this.newDate(i,s,c)}});function x(A,E){return A-E*Math.floor(A/E)}Y.calendars.persian=d,Y.calendars.jalali=d}}),jz=He({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var Y=vh(),G=Yc(),d=Y.instance();function x(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}x.prototype=new Y.baseCalendar,G(x.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(e){var E=this._validate(e,this.minMonth,this.minDay,Y.local.invalidYear),e=this._t2gYear(E.year());return d.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,Y.local.invalidYear),r=this._t2gYear(t.year());return d.weekOfYear(r,t.month(),t.day())},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return(this.dayOfWeek(A,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Y.local.invalidDate),r=this._t2gYear(t.year());return d.toJD(r,t.month(),t.day())},fromJD:function(A){var E=d.fromJD(A),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(A){return A+this.yearsOffset+(A>=-this.yearsOffset&&A<=-1?1:0)},_g2tYear:function(A){return A-this.yearsOffset-(A>=1&&A<=this.yearsOffset?1:0)}}),Y.calendars.taiwan=x}}),Vz=He({"node_modules/world-calendars/dist/calendars/thai.js"(){var Y=vh(),G=Yc(),d=Y.instance();function x(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}x.prototype=new Y.baseCalendar,G(x.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(e){var E=this._validate(e,this.minMonth,this.minDay,Y.local.invalidYear),e=this._t2gYear(E.year());return d.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,Y.local.invalidYear),r=this._t2gYear(t.year());return d.weekOfYear(r,t.month(),t.day())},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return(this.dayOfWeek(A,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Y.local.invalidDate),r=this._t2gYear(t.year());return d.toJD(r,t.month(),t.day())},fromJD:function(A){var E=d.fromJD(A),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(A){return A-this.yearsOffset-(A>=1&&A<=this.yearsOffset?1:0)},_g2tYear:function(A){return A+this.yearsOffset+(A>=-this.yearsOffset&&A<=-1?1:0)}}),Y.calendars.thai=x}}),qz=He({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var Y=vh(),G=Yc();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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āthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear);return this.daysInYear(E.year())===355},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(A){for(var E=0,e=1;e<=12;e++)E+=this.daysInMonth(A,e);return E},daysInMonth:function(A,E){for(var e=this._validate(A,E,this.minDay,Y.local.invalidMonth),t=e.toJD()-24e5+.5,r=0,o=0;ot)return x[r]-x[r-1];r++}return 30},weekDay:function(A,E,e){return this.dayOfWeek(A,E,e)!==5},toJD:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate),r=12*(t.year()-1)+t.month()-15292,o=t.day()+x[r-1]-1;return o+24e5-.5},fromJD:function(A){for(var E=A-24e5+.5,e=0,t=0;tE);t++)e++;var r=e+15292,o=Math.floor((r-1)/12),a=o+1,i=r-12*o,n=E-x[e-1]+1;return this.newDate(a,i,n)},isValid:function(A,E,e){var t=Y.baseCalendar.prototype.isValid.apply(this,arguments);return t&&(A=A.year!=null?A.year:A,t=A>=1276&&A<=1500),t},_validate:function(A,E,e,t){var r=Y.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw t.replace(/\{0\}/,this.local.name);return r}}),Y.calendars.ummalqura=d;var x=[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]}}),Hz=He({"src/components/calendars/calendars.js"(Y,G){G.exports=vh(),Cz(),Lz(),Pz(),Iz(),Rz(),Dz(),zz(),Fz(),Oz(),Bz(),Nz(),Uz(),jz(),Vz(),qz()}}),Gz=He({"src/components/calendars/index.js"(Y,G){var d=Hz(),x=Gr(),A=lo(),E=A.EPOCHJD,e=A.ONEDAY,t={valType:"enumerated",values:x.sortObjectKeys(d.calendars),editType:"calc",dflt:"gregorian"},r=function(_,w,p,u){var g={};return g[p]=t,x.coerce(_,w,g,p,u)},o=function(_,w,p,u){for(var g=0;g + * @license MIT + *//*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *//*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + *//*! + * pad-left + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT license. + *//*! + * repeat-string + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + *//*! Bundled license information: + +native-promise-only/lib/npo.src.js: + (*! Native Promise Only + v0.8.1 (c) Kyle Simpson + MIT License: http://getify.mit-license.org + *) + +polybooljs/index.js: + (* + * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc + * @license MIT + * @preserve Project Home: https://github.com/voidqk/polybooljs + *) + +ieee754/index.js: + (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) + +buffer/index.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) + +safe-buffer/index.js: + (*! safe-buffer. MIT License. Feross Aboukhadijeh *) + +assert/build/internal/util/comparisons.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) + +object-assign/index.js: + (* + object-assign + (c) Sindre Sorhus + @license MIT + *) + +maplibre-gl/dist/maplibre-gl.js: + (** + * MapLibre GL JS + * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt + *) +*/return window.Plotly=Ch,Ch})}(Wm)),Wm.exports}var $A;function U8(){return $A||($A=1,function(uh){Object.defineProperty(uh,"__esModule",{value:!0}),uh.default=void 0;var Th=qs(O8()),Ch=qs(N8());function qs(Zh){return Zh&&Zh.__esModule?Zh:{default:Zh}}var vf=(0,Th.default)(Ch.default),Wh=vf;uh.default=Wh}(lb)),lb}var j8=U8();const V8=P8(j8),G8=({orgId:uh,runId:Th})=>{const[Ch,qs]=Gm.useState(!0),[vf,Wh]=Gm.useState(null),[Zh,wp]=Gm.useState([]);return Gm.useEffect(()=>{(async()=>{try{const Bh=await R8.getRunEvents(uh,Th),Nv={};Bh.forEach(mv=>{const Nh=mv.data,Sf=Nh.step||Nh.global_step;Sf!==void 0&&Object.entries(Nh).forEach(([av,ks])=>{av!=="step"&&av!=="global_step"&&(typeof ks=="number"||typeof ks=="string"&&!isNaN(Number(ks)))&&(Nv[av]||(Nv[av]=[]),Nv[av].push({step:Number(Sf),value:Number(ks)}))})});const rv=[];for(const[mv,Nh]of Object.entries(Nv))Nh.length>1&&(Nh.sort((Sf,av)=>Sf.step-av.step),rv.push({title:mv,x:Nh.map(Sf=>Sf.step),y:Nh.map(Sf=>Sf.value)}));wp(rv),qs(!1)}catch(Bh){console.error("Error fetching events:",Bh),Wh(Bh instanceof Error?Bh.message:"Error fetching metrics"),qs(!1)}})()},[uh,Th]),Ch?yv.jsx(C0,{sx:{display:"flex",justifyContent:"center",p:3},children:yv.jsx(I8,{})}):vf?yv.jsx(C0,{sx:{p:2},children:yv.jsxs(nb,{color:"error",children:["Error loading metrics: ",vf]})}):Zh.length===0?yv.jsx(C0,{sx:{p:2},children:yv.jsx(nb,{children:"No metrics data available for plotting"})}):yv.jsxs(C0,{children:[yv.jsx(nb,{variant:"h6",sx:{mb:2},children:"Metrics:"}),yv.jsx(C0,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(500px, 1fr))",gap:3},children:Zh.map((Lh,Bh)=>yv.jsx(C0,{sx:{minHeight:400},children:yv.jsx(V8,{data:[{x:Lh.x,y:Lh.y,type:"scatter",mode:"lines+markers",name:Lh.title,line:{color:"#1f77b4",width:2},marker:{size:6}}],layout:{title:{text:Lh.title,y:.95,x:.05,xanchor:"left",yanchor:"top",font:{size:16,color:"#333"}},xaxis:{title:"step",showgrid:!0,gridcolor:"#E1E5EA",zeroline:!1},yaxis:{title:Lh.title,showgrid:!0,gridcolor:"#E1E5EA",zeroline:!1},autosize:!0,margin:{t:60,r:30,l:60,b:50},plot_bgcolor:"white",paper_bgcolor:"white",showlegend:!0,legend:{x:1,y:1,xanchor:"right",yanchor:"top",bgcolor:"rgba(255, 255, 255, 0.8)",bordercolor:"#E1E5EA",borderwidth:1}},style:{width:"100%",height:"100%"},config:{responsive:!0,displayModeBar:!0,displaylogo:!1,modeBarButtonsToAdd:["toImage"],modeBarButtonsToRemove:["select2d","lasso2d"],toImageButtonOptions:{format:"png",filename:`${Lh.title}_${Th}`,height:800,width:1200,scale:2}}})},Bh))})]})};export{G8 as MetricsPlots}; diff --git a/openweights/dashboard/backend/static/assets/MetricsPlots-Do-0PbcE.js b/openweights/dashboard/backend/static/assets/MetricsPlots-Do-0PbcE.js new file mode 100644 index 0000000..8af97f2 --- /dev/null +++ b/openweights/dashboard/backend/static/assets/MetricsPlots-Do-0PbcE.js @@ -0,0 +1,3855 @@ +import{r as L8,g as P8,a as Gm,j as yv,B as C0,C as I8,T as nb,b as R8}from"./index-KCoSzXrZ.js";var ib={exports:{}},ob,ZA;function D8(){if(ZA)return ob;ZA=1;var uh="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ob=uh,ob}var sb,XA;function z8(){if(XA)return sb;XA=1;var uh=D8();function Th(){}function Ch(){}return Ch.resetWarningCache=Th,sb=function(){function qs(Zh,wp,Lh,Bh,Nv,rv){if(rv!==uh){var mv=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw mv.name="Invariant Violation",mv}}qs.isRequired=qs;function vf(){return qs}var Wh={array:qs,bigint:qs,bool:qs,func:qs,number:qs,object:qs,string:qs,symbol:qs,any:qs,arrayOf:vf,element:qs,elementType:qs,instanceOf:vf,node:qs,objectOf:vf,oneOf:vf,oneOfType:vf,shape:vf,exact:vf,checkPropTypes:Ch,resetWarningCache:Th};return Wh.PropTypes=Wh,Wh},sb}var YA;function F8(){return YA||(YA=1,ib.exports=z8()()),ib.exports}var lb={},ub={},KA;function O8(){return KA||(KA=1,function(uh){function Th(Go){"@babel/helpers - typeof";return Th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Fs){return typeof Fs}:function(Fs){return Fs&&typeof Symbol=="function"&&Fs.constructor===Symbol&&Fs!==Symbol.prototype?"symbol":typeof Fs},Th(Go)}Object.defineProperty(uh,"__esModule",{value:!0}),uh.default=Zm;var Ch=Zh(L8()),qs=vf(F8());function vf(Go){return Go&&Go.__esModule?Go:{default:Go}}function Wh(Go){if(typeof WeakMap!="function")return null;var Fs=new WeakMap,Tc=new WeakMap;return(Wh=function(Bf){return Bf?Tc:Fs})(Go)}function Zh(Go,Fs){if(Go&&Go.__esModule)return Go;if(Go===null||Th(Go)!=="object"&&typeof Go!="function")return{default:Go};var Tc=Wh(Fs);if(Tc&&Tc.has(Go))return Tc.get(Go);var Qn={},Bf=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Xl in Go)if(Xl!=="default"&&Object.prototype.hasOwnProperty.call(Go,Xl)){var co=Bf?Object.getOwnPropertyDescriptor(Go,Xl):null;co&&(co.get||co.set)?Object.defineProperty(Qn,Xl,co):Qn[Xl]=Go[Xl]}return Qn.default=Go,Tc&&Tc.set(Go,Qn),Qn}function wp(Go,Fs){if(!(Go instanceof Fs))throw new TypeError("Cannot call a class as a function")}function Lh(Go,Fs){for(var Tc=0;Tc"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ks(Go){return ks=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Tc){return Tc.__proto__||Object.getPrototypeOf(Tc)},ks(Go)}var He=["AfterExport","AfterPlot","Animated","AnimatingFrame","AnimationInterrupted","AutoSize","BeforeExport","BeforeHover","ButtonClicked","Click","ClickAnnotation","Deselect","DoubleClick","Framework","Hover","LegendClick","LegendDoubleClick","Relayout","Relayouting","Restyle","Redraw","Selected","Selecting","SliderChange","SliderEnd","SliderStart","SunburstClick","Transitioning","TransitionInterrupted","Unhover","WebGlContextLost"],L0=["plotly_restyle","plotly_redraw","plotly_relayout","plotly_relayouting","plotly_doubleclick","plotly_animated","plotly_sunburstclick"],Tp=typeof window<"u";function Zm(Go){var Fs=function(Tc){Nv(Bf,Tc);var Qn=mv(Bf);function Bf(Xl){var co;return wp(this,Bf),co=Qn.call(this,Xl),co.p=Promise.resolve(),co.resizeHandler=null,co.handlers={},co.syncWindowResize=co.syncWindowResize.bind(Sf(co)),co.syncEventHandlers=co.syncEventHandlers.bind(Sf(co)),co.attachUpdateEvents=co.attachUpdateEvents.bind(Sf(co)),co.getRef=co.getRef.bind(Sf(co)),co.handleUpdate=co.handleUpdate.bind(Sf(co)),co.figureCallback=co.figureCallback.bind(Sf(co)),co.updatePlotly=co.updatePlotly.bind(Sf(co)),co}return Bh(Bf,[{key:"updatePlotly",value:function(co,Ac,Hi){var lo=this;this.p=this.p.then(function(){if(!lo.unmounting){if(!lo.el)throw new Error("Missing element reference");return Go.react(lo.el,{data:lo.props.data,layout:lo.props.layout,config:lo.props.config,frames:lo.props.frames})}}).then(function(){lo.unmounting||(lo.syncWindowResize(co),lo.syncEventHandlers(),lo.figureCallback(Ac),Hi&&lo.attachUpdateEvents())}).catch(function(Uh){lo.props.onError&&lo.props.onError(Uh)})}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(co){this.unmounting=!1;var Ac=co.frames&&co.frames.length?co.frames.length:0,Hi=this.props.frames&&this.props.frames.length?this.props.frames.length:0,lo=!(co.layout===this.props.layout&&co.data===this.props.data&&co.config===this.props.config&&Hi===Ac),Uh=co.revision!==void 0,Xh=co.revision!==this.props.revision;!lo&&(!Uh||Uh&&!Xh)||this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&Tp&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),Go.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var co=this;!this.el||!this.el.removeListener||L0.forEach(function(Ac){co.el.on(Ac,co.handleUpdate)})}},{key:"removeUpdateEvents",value:function(){var co=this;!this.el||!this.el.removeListener||L0.forEach(function(Ac){co.el.removeListener(Ac,co.handleUpdate)})}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(co){if(typeof co=="function"){var Ac=this.el,Hi=Ac.data,lo=Ac.layout,Uh=this.el._transitionData?this.el._transitionData._frames:null,Xh={data:Hi,layout:lo,frames:Uh};co(Xh,this.el)}}},{key:"syncWindowResize",value:function(co){var Ac=this;Tp&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return Go.Plots.resize(Ac.el)},window.addEventListener("resize",this.resizeHandler),co&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(co){this.el=co,this.props.debug&&Tp&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var co=this;He.forEach(function(Ac){var Hi=co.props["on"+Ac],lo=co.handlers[Ac],Uh=!!lo;Hi&&!Uh?co.addEventHandler(Ac,Hi):!Hi&&Uh?co.removeEventHandler(Ac):Hi&&Uh&&Hi!==lo&&(co.removeEventHandler(Ac),co.addEventHandler(Ac,Hi))})}},{key:"addEventHandler",value:function(co,Ac){this.handlers[co]=Ac,this.el.on(this.getPlotlyEventName(co),this.handlers[co])}},{key:"removeEventHandler",value:function(co){this.el.removeListener(this.getPlotlyEventName(co),this.handlers[co]),delete this.handlers[co]}},{key:"getPlotlyEventName",value:function(co){return"plotly_"+co.toLowerCase()}},{key:"render",value:function(){return Ch.default.createElement("div",{id:this.props.divId,style:this.props.style,ref:this.getRef,className:this.props.className})}}]),Bf}(Ch.Component);return Fs.propTypes={data:qs.default.arrayOf(qs.default.object),config:qs.default.object,layout:qs.default.object,frames:qs.default.arrayOf(qs.default.object),revision:qs.default.number,onInitialized:qs.default.func,onPurge:qs.default.func,onError:qs.default.func,onUpdate:qs.default.func,debug:qs.default.bool,style:qs.default.object,className:qs.default.string,useResizeHandler:qs.default.bool,divId:qs.default.string},He.forEach(function(Tc){Fs.propTypes["on"+Tc]=qs.default.func}),Fs.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},Fs}}(ub)),ub}var Wm={exports:{}},B8=Wm.exports,JA;function N8(){return JA||(JA=1,function(uh){var Th={};(function(Ch,qs){uh.exports?uh.exports=qs():Ch.moduleName=qs()})(typeof self<"u"?self:B8,()=>{var Ch=(()=>{var qs=Object.create,vf=Object.defineProperty,Wh=Object.defineProperties,Zh=Object.getOwnPropertyDescriptor,wp=Object.getOwnPropertyDescriptors,Lh=Object.getOwnPropertyNames,Bh=Object.getOwnPropertySymbols,Nv=Object.getPrototypeOf,rv=Object.prototype.hasOwnProperty,mv=Object.prototype.propertyIsEnumerable,Nh=(Y,G,d)=>G in Y?vf(Y,G,{enumerable:!0,configurable:!0,writable:!0,value:d}):Y[G]=d,Sf=(Y,G)=>{for(var d in G||(G={}))rv.call(G,d)&&Nh(Y,d,G[d]);if(Bh)for(var d of Bh(G))mv.call(G,d)&&Nh(Y,d,G[d]);return Y},av=(Y,G)=>Wh(Y,wp(G)),ks=(Y,G)=>function(){return Y&&(G=(0,Y[Lh(Y)[0]])(Y=0)),G},He=(Y,G)=>function(){return G||(0,Y[Lh(Y)[0]])((G={exports:{}}).exports,G),G.exports},L0=(Y,G)=>{for(var d in G)vf(Y,d,{get:G[d],enumerable:!0})},Tp=(Y,G,d,x)=>{if(G&&typeof G=="object"||typeof G=="function")for(let A of Lh(G))!rv.call(Y,A)&&A!==d&&vf(Y,A,{get:()=>G[A],enumerable:!(x=Zh(G,A))||x.enumerable});return Y},Zm=(Y,G,d)=>(d=Y!=null?qs(Nv(Y)):{},Tp(vf(d,"default",{value:Y,enumerable:!0}),Y)),Go=Y=>Tp(vf({},"__esModule",{value:!0}),Y),Fs=He({"src/version.js"(Y){Y.version="3.0.1"}}),Tc=He({"node_modules/native-promise-only/lib/npo.src.js"(Y,G){(function(x,A,E){A[x]=A[x]||E(),typeof G<"u"&&G.exports&&(G.exports=A[x])})("Promise",typeof window<"u"?window:Y,function(){var x,A,E,e=Object.prototype.toString,t=typeof setImmediate<"u"?function(y){return setImmediate(y)}:setTimeout;try{Object.defineProperty({},"x",{}),x=function(y,b,S,M){return Object.defineProperty(y,b,{value:S,writable:!0,configurable:M!==!1})}}catch{x=function(b,S,M){return b[S]=M,b}}E=function(){var y,b,S;function M(_,w){this.fn=_,this.self=w,this.next=void 0}return{add:function(w,p){S=new M(w,p),b?b.next=S:y=S,b=S,S=void 0},drain:function(){var w=y;for(y=b=A=void 0;w;)w.fn.call(w.self),w=w.next}}}();function r(l,y){E.add(l,y),A||(A=t(E.drain))}function o(l){var y,b=typeof l;return l!=null&&(b=="object"||b=="function")&&(y=l.then),typeof y=="function"?y:!1}function a(){for(var l=0;l0&&r(a,b))}catch(S){s.call(new f(b),S)}}}function s(l){var y=this;y.triggered||(y.triggered=!0,y.def&&(y=y.def),y.msg=l,y.state=2,y.chain.length>0&&r(a,y))}function c(l,y,b,S){for(var M=0;MLe?1:pe>=Le?0:NaN}d.descending=function(pe,Le){return Lepe?1:Le>=pe?0:NaN},d.min=function(pe,Le){var Ye=-1,ut=pe.length,ht,xt;if(arguments.length===1){for(;++Ye=xt){ht=xt;break}for(;++Yext&&(ht=xt)}else{for(;++Ye=xt){ht=xt;break}for(;++Yext&&(ht=xt)}return ht},d.max=function(pe,Le){var Ye=-1,ut=pe.length,ht,xt;if(arguments.length===1){for(;++Ye=xt){ht=xt;break}for(;++Yeht&&(ht=xt)}else{for(;++Ye=xt){ht=xt;break}for(;++Yeht&&(ht=xt)}return ht},d.extent=function(pe,Le){var Ye=-1,ut=pe.length,ht,xt,zt;if(arguments.length===1){for(;++Ye=xt){ht=zt=xt;break}for(;++Yext&&(ht=xt),zt=xt){ht=zt=xt;break}for(;++Yext&&(ht=xt),zt1)return zt/($t-1)},d.deviation=function(){var pe=d.variance.apply(this,arguments);return pe&&Math.sqrt(pe)};function v(pe){return{left:function(Le,Ye,ut,ht){for(arguments.length<3&&(ut=0),arguments.length<4&&(ht=Le.length);ut>>1;pe(Le[xt],Ye)<0?ut=xt+1:ht=xt}return ut},right:function(Le,Ye,ut,ht){for(arguments.length<3&&(ut=0),arguments.length<4&&(ht=Le.length);ut>>1;pe(Le[xt],Ye)>0?ht=xt:ut=xt+1}return ut}}}var h=v(s);d.bisectLeft=h.left,d.bisect=d.bisectRight=h.right,d.bisector=function(pe){return v(pe.length===1?function(Le,Ye){return s(pe(Le),Ye)}:pe)},d.shuffle=function(pe,Le,Ye){(ut=arguments.length)<3&&(Ye=pe.length,ut<2&&(Le=0));for(var ut=Ye-Le,ht,xt;ut;)xt=Math.random()*ut--|0,ht=pe[ut+Le],pe[ut+Le]=pe[xt+Le],pe[xt+Le]=ht;return pe},d.permute=function(pe,Le){for(var Ye=Le.length,ut=new Array(Ye);Ye--;)ut[Ye]=pe[Le[Ye]];return ut},d.pairs=function(pe){for(var Le=0,Ye=pe.length-1,ut=pe[0],ht=new Array(Ye<0?0:Ye);Le=0;)for(zt=pe[Le],Ye=zt.length;--Ye>=0;)xt[--ht]=zt[Ye];return xt};var l=Math.abs;d.range=function(pe,Le,Ye){if(arguments.length<3&&(Ye=1,arguments.length<2&&(Le=pe,pe=0)),(Le-pe)/Ye===1/0)throw new Error("infinite range");var ut=[],ht=y(l(Ye)),xt=-1,zt;if(pe*=ht,Le*=ht,Ye*=ht,Ye<0)for(;(zt=pe+Ye*++xt)>Le;)ut.push(zt/ht);else for(;(zt=pe+Ye*++xt)=Le.length)return ht?ht.call(pe,$t):ut?$t.sort(ut):$t;for(var Ar=-1,Vr=$t.length,Kr=Le[Cr++],aa,Ua,la,Ta=new S,ka;++Ar=Le.length)return Dt;var Cr=[],Ar=Ye[$t++];return Dt.forEach(function(Vr,Kr){Cr.push({key:Vr,values:zt(Kr,$t)})}),Ar?Cr.sort(function(Vr,Kr){return Ar(Vr.key,Kr.key)}):Cr}return pe.map=function(Dt,$t){return xt($t,Dt,0)},pe.entries=function(Dt){return zt(xt(d.map,Dt,0),0)},pe.key=function(Dt){return Le.push(Dt),pe},pe.sortKeys=function(Dt){return Ye[Le.length-1]=Dt,pe},pe.sortValues=function(Dt){return ut=Dt,pe},pe.rollup=function(Dt){return ht=Dt,pe},pe},d.set=function(pe){var Le=new z;if(pe)for(var Ye=0,ut=pe.length;Ye=0&&(ut=pe.slice(Ye+1),pe=pe.slice(0,Ye)),pe)return arguments.length<2?this[pe].on(ut):this[pe].on(ut,Le);if(arguments.length===2){if(Le==null)for(pe in this)this.hasOwnProperty(pe)&&this[pe].on(ut,null);return this}};function Z(pe){var Le=[],Ye=new S;function ut(){for(var ht=Le,xt=-1,zt=ht.length,Dt;++xt=0&&(Ye=pe.slice(0,Le))!=="xmlns"&&(pe=pe.slice(Le+1)),fe.hasOwnProperty(Ye)?{space:fe[Ye],local:pe}:pe}},ee.attr=function(pe,Le){if(arguments.length<2){if(typeof pe=="string"){var Ye=this.node();return pe=d.ns.qualify(pe),pe.local?Ye.getAttributeNS(pe.space,pe.local):Ye.getAttribute(pe)}for(Le in pe)this.each(we(Le,pe[Le]));return this}return this.each(we(pe,Le))};function we(pe,Le){pe=d.ns.qualify(pe);function Ye(){this.removeAttribute(pe)}function ut(){this.removeAttributeNS(pe.space,pe.local)}function ht(){this.setAttribute(pe,Le)}function xt(){this.setAttributeNS(pe.space,pe.local,Le)}function zt(){var $t=Le.apply(this,arguments);$t==null?this.removeAttribute(pe):this.setAttribute(pe,$t)}function Dt(){var $t=Le.apply(this,arguments);$t==null?this.removeAttributeNS(pe.space,pe.local):this.setAttributeNS(pe.space,pe.local,$t)}return Le==null?pe.local?ut:Ye:typeof Le=="function"?pe.local?Dt:zt:pe.local?xt:ht}function Ae(pe){return pe.trim().replace(/\s+/g," ")}ee.classed=function(pe,Le){if(arguments.length<2){if(typeof pe=="string"){var Ye=this.node(),ut=(pe=Ce(pe)).length,ht=-1;if(Le=Ye.classList){for(;++ht=0;)(xt=Ye[ut])&&(ht&&ht!==xt.nextSibling&&ht.parentNode.insertBefore(xt,ht),ht=xt);return this},ee.sort=function(pe){pe=Re.apply(this,arguments);for(var Le=-1,Ye=this.length;++Le=Le&&(Le=ht+1);!($t=zt[Le])&&++Le0&&(pe=pe.slice(0,ht));var zt=Rt.get(pe);zt&&(pe=zt,xt=ir);function Dt(){var Ar=this[ut];Ar&&(this.removeEventListener(pe,Ar,Ar.$),delete this[ut])}function $t(){var Ar=xt(Le,A(arguments));Dt.call(this),this.addEventListener(pe,this[ut]=Ar,Ar.$=Ye),Ar._=Le}function Cr(){var Ar=new RegExp("^__on([^.]+)"+d.requote(pe)+"$"),Vr;for(var Kr in this)if(Vr=Kr.match(Ar)){var aa=this[Kr];this.removeEventListener(Vr[1],aa,aa.$),delete this[Kr]}}return ht?Le?$t:Dt:Le?N:Cr}var Rt=d.map({mouseenter:"mouseover",mouseleave:"mouseout"});E&&Rt.forEach(function(pe){"on"+pe in E&&Rt.remove(pe)});function Ut(pe,Le){return function(Ye){var ut=d.event;d.event=Ye,Le[0]=this.__data__;try{pe.apply(this,Le)}finally{d.event=ut}}}function ir(pe,Le){var Ye=Ut(pe,Le);return function(ut){var ht=this,xt=ut.relatedTarget;(!xt||xt!==ht&&!(xt.compareDocumentPosition(ht)&8))&&Ye.call(ht,ut)}}var ar,Mr=0;function fr(pe){var Le=".dragsuppress-"+ ++Mr,Ye="click"+Le,ut=d.select(t(pe)).on("touchmove"+Le,Q).on("dragstart"+Le,Q).on("selectstart"+Le,Q);if(ar==null&&(ar="onselectstart"in pe?!1:O(pe.style,"userSelect")),ar){var ht=e(pe).style,xt=ht[ar];ht[ar]="none"}return function(zt){if(ut.on(Le,null),ar&&(ht[ar]=xt),zt){var Dt=function(){ut.on(Ye,null)};ut.on(Ye,function(){Q(),Dt()},!0),setTimeout(Dt,0)}}}d.mouse=function(pe){return pt(pe,ue())};var dr=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function pt(pe,Le){Le.changedTouches&&(Le=Le.changedTouches[0]);var Ye=pe.ownerSVGElement||pe;if(Ye.createSVGPoint){var ut=Ye.createSVGPoint();if(dr<0){var ht=t(pe);if(ht.scrollX||ht.scrollY){Ye=d.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var xt=Ye[0][0].getScreenCTM();dr=!(xt.f||xt.e),Ye.remove()}}return dr?(ut.x=Le.pageX,ut.y=Le.pageY):(ut.x=Le.clientX,ut.y=Le.clientY),ut=ut.matrixTransform(pe.getScreenCTM().inverse()),[ut.x,ut.y]}var zt=pe.getBoundingClientRect();return[Le.clientX-zt.left-pe.clientLeft,Le.clientY-zt.top-pe.clientTop]}d.touch=function(pe,Le,Ye){if(arguments.length<3&&(Ye=Le,Le=ue().changedTouches),Le){for(var ut=0,ht=Le.length,xt;ut1?Pe:pe<-1?-Pe:Math.asin(pe)}function Nt(pe){return((pe=Math.exp(pe))-1/pe)/2}function Bt(pe){return((pe=Math.exp(pe))+1/pe)/2}function qt(pe){return((pe=Math.exp(2*pe))-1)/(pe+1)}var Zt=Math.SQRT2,lr=2,ta=4;d.interpolateZoom=function(pe,Le){var Ye=pe[0],ut=pe[1],ht=pe[2],xt=Le[0],zt=Le[1],Dt=Le[2],$t=xt-Ye,Cr=zt-ut,Ar=$t*$t+Cr*Cr,Vr,Kr;if(Ar0&&(Kn=Kn.transition().duration(zt)),Kn.call(Va.event)}function hi(){Ta&&Ta.domain(la.range().map(function(Kn){return(Kn-pe.x)/pe.k}).map(la.invert)),Ba&&Ba.domain(ka.range().map(function(Kn){return(Kn-pe.y)/pe.k}).map(ka.invert))}function _i(Kn){Dt++||Kn({type:"zoomstart"})}function Po(Kn){hi(),Kn({type:"zoom",scale:pe.k,translate:[pe.x,pe.y]})}function wi(Kn){--Dt||(Kn({type:"zoomend"}),Ye=null)}function Ji(){var Kn=this,go=Ua.of(Kn,arguments),Do=0,Es=d.select(t(Kn)).on(Cr,Qo).on(Ar,_s),hs=Ma(d.mouse(Kn)),Hl=fr(Kn);za.call(Kn),_i(go);function Qo(){Do=1,jn(d.mouse(Kn),hs),Po(go)}function _s(){Es.on(Cr,null).on(Ar,null),Hl(Do),wi(go)}}function Vo(){var Kn=this,go=Ua.of(Kn,arguments),Do={},Es=0,hs,Hl=".zoom-"+d.event.changedTouches[0].identifier,Qo="touchmove"+Hl,_s="touchend"+Hl,gu=[],el=d.select(Kn),cr=fr(Kn);xa(),_i(go),el.on($t,null).on(Kr,xa);function fa(){var Da=d.touches(Kn);return hs=pe.k,Da.forEach(function(Na){Na.identifier in Do&&(Do[Na.identifier]=Ma(Na))}),Da}function xa(){var Da=d.event.target;d.select(Da).on(Qo,cn).on(_s,In),gu.push(Da);for(var Na=d.event.changedTouches,Hn=0,Un=Na.length;Hn1){var Wi=Gn[0],Ti=Gn[1],si=Wi[0]-Ti[0],Fn=Wi[1]-Ti[1];Es=si*si+Fn*Fn}}function cn(){var Da=d.touches(Kn),Na,Hn,Un,Gn;za.call(Kn);for(var ti=0,Wi=Da.length;ti1?1:Le,Ye=Ye<0?0:Ye>1?1:Ye,ht=Ye<=.5?Ye*(1+Le):Ye+Le-Ye*Le,ut=2*Ye-ht;function xt(Dt){return Dt>360?Dt-=360:Dt<0&&(Dt+=360),Dt<60?ut+(ht-ut)*Dt/60:Dt<180?ht:Dt<240?ut+(ht-ut)*(240-Dt)/60:ut}function zt(Dt){return Math.round(xt(Dt)*255)}return new vt(zt(pe+120),zt(pe),zt(pe-120))}d.hcl=Vt;function Vt(pe,Le,Ye){return this instanceof Vt?(this.h=+pe,this.c=+Le,void(this.l=+Ye)):arguments.length<2?pe instanceof Vt?new Vt(pe.h,pe.c,pe.l):pe instanceof Ot?Pa(pe.l,pe.a,pe.b):Pa((pe=Pr((pe=d.rgb(pe)).r,pe.g,pe.b)).l,pe.a,pe.b):new Vt(pe,Le,Ye)}var Lt=Vt.prototype=new Ia;Lt.brighter=function(pe){return new Vt(this.h,this.c,Math.min(100,this.l+gr*(arguments.length?pe:1)))},Lt.darker=function(pe){return new Vt(this.h,this.c,Math.max(0,this.l-gr*(arguments.length?pe:1)))},Lt.rgb=function(){return jt(this.h,this.c,this.l).rgb()};function jt(pe,Le,Ye){return isNaN(pe)&&(pe=0),isNaN(Le)&&(Le=0),new Ot(Ye,Math.cos(pe*=We)*Le,Math.sin(pe)*Le)}d.lab=Ot;function Ot(pe,Le,Ye){return this instanceof Ot?(this.l=+pe,this.a=+Le,void(this.b=+Ye)):arguments.length<2?pe instanceof Ot?new Ot(pe.l,pe.a,pe.b):pe instanceof Vt?jt(pe.h,pe.c,pe.l):Pr((pe=vt(pe)).r,pe.g,pe.b):new Ot(pe,Le,Ye)}var gr=18,Br=.95047,na=1,Ur=1.08883,ga=Ot.prototype=new Ia;ga.brighter=function(pe){return new Ot(Math.min(100,this.l+gr*(arguments.length?pe:1)),this.a,this.b)},ga.darker=function(pe){return new Ot(Math.max(0,this.l-gr*(arguments.length?pe:1)),this.a,this.b)},ga.rgb=function(){return Aa(this.l,this.a,this.b)};function Aa(pe,Le,Ye){var ut=(pe+16)/116,ht=ut+Le/500,xt=ut-Ye/200;return ht=sa(ht)*Br,ut=sa(ut)*na,xt=sa(xt)*Ur,new vt(dt(3.2404542*ht-1.5371385*ut-.4985314*xt),dt(-.969266*ht+1.8760108*ut+.041556*xt),dt(.0556434*ht-.2040259*ut+1.0572252*xt))}function Pa(pe,Le,Ye){return pe>0?new Vt(Math.atan2(Ye,Le)*ct,Math.sqrt(Le*Le+Ye*Ye),pe):new Vt(NaN,NaN,pe)}function sa(pe){return pe>.206893034?pe*pe*pe:(pe-4/29)/7.787037}function Oa(pe){return pe>.008856?Math.pow(pe,1/3):7.787037*pe+4/29}function dt(pe){return Math.round(255*(pe<=.00304?12.92*pe:1.055*Math.pow(pe,1/2.4)-.055))}d.rgb=vt;function vt(pe,Le,Ye){return this instanceof vt?(this.r=~~pe,this.g=~~Le,void(this.b=~~Ye)):arguments.length<2?pe instanceof vt?new vt(pe.r,pe.g,pe.b):kr(""+pe,vt,Ka):new vt(pe,Le,Ye)}function Lr(pe){return new vt(pe>>16,pe>>8&255,pe&255)}function Er(pe){return Lr(pe)+""}var _r=vt.prototype=new Ia;_r.brighter=function(pe){pe=Math.pow(.7,arguments.length?pe:1);var Le=this.r,Ye=this.g,ut=this.b,ht=30;return!Le&&!Ye&&!ut?new vt(ht,ht,ht):(Le&&Le>4,ut=ut>>4|ut,ht=$t&240,ht=ht>>4|ht,xt=$t&15,xt=xt<<4|xt):pe.length===7&&(ut=($t&16711680)>>16,ht=($t&65280)>>8,xt=$t&255)),Le(ut,ht,xt))}function zr(pe,Le,Ye){var ut=Math.min(pe/=255,Le/=255,Ye/=255),ht=Math.max(pe,Le,Ye),xt=ht-ut,zt,Dt,$t=(ht+ut)/2;return xt?(Dt=$t<.5?xt/(ht+ut):xt/(2-ht-ut),pe==ht?zt=(Le-Ye)/xt+(Le0&&$t<1?0:zt),new va(zt,Dt,$t)}function Pr(pe,Le,Ye){pe=Hr(pe),Le=Hr(Le),Ye=Hr(Ye);var ut=Oa((.4124564*pe+.3575761*Le+.1804375*Ye)/Br),ht=Oa((.2126729*pe+.7151522*Le+.072175*Ye)/na),xt=Oa((.0193339*pe+.119192*Le+.9503041*Ye)/Ur);return Ot(116*ht-16,500*(ut-ht),200*(ht-xt))}function Hr(pe){return(pe/=255)<=.04045?pe/12.92:Math.pow((pe+.055)/1.055,2.4)}function Zr(pe){var Le=parseFloat(pe);return pe.charAt(pe.length-1)==="%"?Math.round(Le*2.55):Le}var Jr=d.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Jr.forEach(function(pe,Le){Jr.set(pe,Lr(Le))});function wt(pe){return typeof pe=="function"?pe:function(){return pe}}d.functor=wt,d.xhr=Qt(F);function Qt(pe){return function(Le,Ye,ut){return arguments.length===2&&typeof Ye=="function"&&(ut=Ye,Ye=null),mr(Le,Ye,pe,ut)}}function mr(pe,Le,Ye,ut){var ht={},xt=d.dispatch("beforesend","progress","load","error"),zt={},Dt=new XMLHttpRequest,$t=null;self.XDomainRequest&&!("withCredentials"in Dt)&&/^(http(s)?:)?\/\//.test(pe)&&(Dt=new XDomainRequest),"onload"in Dt?Dt.onload=Dt.onerror=Cr:Dt.onreadystatechange=function(){Dt.readyState>3&&Cr()};function Cr(){var Ar=Dt.status,Vr;if(!Ar&&oa(Dt)||Ar>=200&&Ar<300||Ar===304){try{Vr=Ye.call(ht,Dt)}catch(Kr){xt.error.call(ht,Kr);return}xt.load.call(ht,Vr)}else xt.error.call(ht,Dt)}return Dt.onprogress=function(Ar){var Vr=d.event;d.event=Ar;try{xt.progress.call(ht,Dt)}finally{d.event=Vr}},ht.header=function(Ar,Vr){return Ar=(Ar+"").toLowerCase(),arguments.length<2?zt[Ar]:(Vr==null?delete zt[Ar]:zt[Ar]=Vr+"",ht)},ht.mimeType=function(Ar){return arguments.length?(Le=Ar==null?null:Ar+"",ht):Le},ht.responseType=function(Ar){return arguments.length?($t=Ar,ht):$t},ht.response=function(Ar){return Ye=Ar,ht},["get","post"].forEach(function(Ar){ht[Ar]=function(){return ht.send.apply(ht,[Ar].concat(A(arguments)))}}),ht.send=function(Ar,Vr,Kr){if(arguments.length===2&&typeof Vr=="function"&&(Kr=Vr,Vr=null),Dt.open(Ar,pe,!0),Le!=null&&!("accept"in zt)&&(zt.accept=Le+",*/*"),Dt.setRequestHeader)for(var aa in zt)Dt.setRequestHeader(aa,zt[aa]);return Le!=null&&Dt.overrideMimeType&&Dt.overrideMimeType(Le),$t!=null&&(Dt.responseType=$t),Kr!=null&&ht.on("error",Kr).on("load",function(Ua){Kr(null,Ua)}),xt.beforesend.call(ht,Dt),Dt.send(Vr??null),ht},ht.abort=function(){return Dt.abort(),ht},d.rebind(ht,xt,"on"),ut==null?ht:ht.get($r(ut))}function $r(pe){return pe.length===1?function(Le,Ye){pe(Le==null?Ye:null)}:pe}function oa(pe){var Le=pe.responseType;return Le&&Le!=="text"?pe.response:pe.responseText}d.dsv=function(pe,Le){var Ye=new RegExp('["'+pe+` +]`),ut=pe.charCodeAt(0);function ht(Cr,Ar,Vr){arguments.length<3&&(Vr=Ar,Ar=null);var Kr=mr(Cr,Le,Ar==null?xt:zt(Ar),Vr);return Kr.row=function(aa){return arguments.length?Kr.response((Ar=aa)==null?xt:zt(aa)):Ar},Kr}function xt(Cr){return ht.parse(Cr.responseText)}function zt(Cr){return function(Ar){return ht.parse(Ar.responseText,Cr)}}ht.parse=function(Cr,Ar){var Vr;return ht.parseRows(Cr,function(Kr,aa){if(Vr)return Vr(Kr,aa-1);var Ua=function(la){for(var Ta={},ka=Kr.length,Ba=0;Ba=Ua)return Kr;if(Ba)return Ba=!1,Vr;var mn=la;if(Cr.charCodeAt(mn)===34){for(var Wn=mn;Wn++24?(isFinite(Le)&&(clearTimeout(pa),pa=setTimeout(qn,Le)),ra=0):(ra=1,pn(qn))}d.timer.flush=function(){Vn(),di()};function Vn(){for(var pe=Date.now(),Le=Sa;Le;)pe>=Le.t&&Le.c(pe-Le.t)&&(Le.c=null),Le=Le.n;return pe}function di(){for(var pe,Le=Sa,Ye=1/0;Le;)Le.c?(Le.t=0;--Dt)la.push(ht[Cr[Vr[Dt]][2]]);for(Dt=+aa;Dt1&&_t(pe[Ye[ut-2]],pe[Ye[ut-1]],pe[ht])<=0;)--ut;Ye[ut++]=ht}return Ye.slice(0,ut)}function ei(pe,Le){return pe[0]-Le[0]||pe[1]-Le[1]}d.geom.polygon=function(pe){return j(pe,mi),pe};var mi=d.geom.polygon.prototype=[];mi.area=function(){for(var pe=-1,Le=this.length,Ye,ut=this[Le-1],ht=0;++peGe)Dt=Dt.L;else if(zt=Le-Jn(Dt,Ye),zt>Ge){if(!Dt.R){ut=Dt;break}Dt=Dt.R}else{xt>-Ge?(ut=Dt.P,ht=Dt):zt>-Ge?(ut=Dt,ht=Dt.N):ut=ht=Dt;break}var $t=bs(pe);if(xi.insert(ut,$t),!(!ut&&!ht)){if(ut===ht){ws(ut),ht=bs(ut.site),xi.insert($t,ht),$t.edge=ht.edge=zo(ut.site,$t.site),Mo(ut),Mo(ht);return}if(!ht){$t.edge=zo(ut.site,$t.site);return}ws(ut),ws(ht);var Cr=ut.site,Ar=Cr.x,Vr=Cr.y,Kr=pe.x-Ar,aa=pe.y-Vr,Ua=ht.site,la=Ua.x-Ar,Ta=Ua.y-Vr,ka=2*(Kr*Ta-aa*la),Ba=Kr*Kr+aa*aa,Va=la*la+Ta*Ta,Ma={x:(Ta*Ba-aa*Va)/ka+Ar,y:(Kr*Va-la*Ba)/ka+Vr};bi(ht.edge,Cr,Ua,Ma),$t.edge=zo(Cr,pe,null,Ma),ht.edge=zo(pe,Ua,null,Ma),Mo(ut),Mo(ht)}}function Qa(pe,Le){var Ye=pe.site,ut=Ye.x,ht=Ye.y,xt=ht-Le;if(!xt)return ut;var zt=pe.P;if(!zt)return-1/0;Ye=zt.site;var Dt=Ye.x,$t=Ye.y,Cr=$t-Le;if(!Cr)return Dt;var Ar=Dt-ut,Vr=1/xt-1/Cr,Kr=Ar/Cr;return Vr?(-Kr+Math.sqrt(Kr*Kr-2*Vr*(Ar*Ar/(-2*Cr)-$t+Cr/2+ht-xt/2)))/Vr+ut:(ut+Dt)/2}function Jn(pe,Le){var Ye=pe.N;if(Ye)return Qa(Ye,Le);var ut=pe.site;return ut.y===Le?ut.x:1/0}function Os(pe){this.site=pe,this.edges=[]}Os.prototype.prepare=function(){for(var pe=this.edges,Le=pe.length,Ye;Le--;)Ye=pe[Le].edge,(!Ye.b||!Ye.a)&&pe.splice(Le,1);return pe.sort(Ui),pe.length};function ds(pe){for(var Le=pe[0][0],Ye=pe[1][0],ut=pe[0][1],ht=pe[1][1],xt,zt,Dt,$t,Cr=Ii,Ar=Cr.length,Vr,Kr,aa,Ua,la,Ta;Ar--;)if(Vr=Cr[Ar],!(!Vr||!Vr.prepare()))for(aa=Vr.edges,Ua=aa.length,Kr=0;KrGe||l($t-zt)>Ge)&&(aa.splice(Kr,0,new wl(wo(Vr.site,Ta,l(Dt-Le)Ge?{x:Le,y:l(xt-Le)Ge?{x:l(zt-ht)Ge?{x:Ye,y:l(xt-Ye)Ge?{x:l(zt-ut)=-Oe)){var Kr=$t*$t+Cr*Cr,aa=Ar*Ar+Ta*Ta,Ua=(Ta*Kr-Cr*aa)/Vr,la=($t*aa-Ar*Kr)/Vr,Ta=la+Dt,ka=Li.pop()||new ms;ka.arc=pe,ka.site=ht,ka.x=Ua+zt,ka.y=Ta+Math.sqrt(Ua*Ua+la*la),ka.cy=Ta,pe.circle=ka;for(var Ba=null,Va=Ro._;Va;)if(ka.y0)){if(la/=aa,aa<0){if(la0){if(la>Kr)return;la>Vr&&(Vr=la)}if(la=Ye-Dt,!(!aa&&la<0)){if(la/=aa,aa<0){if(la>Kr)return;la>Vr&&(Vr=la)}else if(aa>0){if(la0)){if(la/=Ua,Ua<0){if(la0){if(la>Kr)return;la>Vr&&(Vr=la)}if(la=ut-$t,!(!Ua&&la<0)){if(la/=Ua,Ua<0){if(la>Kr)return;la>Vr&&(Vr=la)}else if(Ua>0){if(la0&&(ht.a={x:Dt+Vr*aa,y:$t+Vr*Ua}),Kr<1&&(ht.b={x:Dt+Kr*aa,y:$t+Kr*Ua}),ht}}}}}}function Rn(pe){for(var Le=li,Ye=Ks(pe[0][0],pe[0][1],pe[1][0],pe[1][1]),ut=Le.length,ht;ut--;)ht=Le[ut],(!fo(ht,pe)||!Ye(ht)||l(ht.a.x-ht.b.x)=xt)return;if(Ar>Kr){if(!ut)ut={x:Ua,y:zt};else if(ut.y>=Dt)return;Ye={x:Ua,y:Dt}}else{if(!ut)ut={x:Ua,y:Dt};else if(ut.y1)if(Ar>Kr){if(!ut)ut={x:(zt-ka)/Ta,y:zt};else if(ut.y>=Dt)return;Ye={x:(Dt-ka)/Ta,y:Dt}}else{if(!ut)ut={x:(Dt-ka)/Ta,y:Dt};else if(ut.y=xt)return;Ye={x:xt,y:Ta*xt+ka}}else{if(!ut)ut={x:xt,y:Ta*xt+ka};else if(ut.x=Ar&&ka.x<=Kr&&ka.y>=Vr&&ka.y<=aa?[[Ar,aa],[Kr,aa],[Kr,Vr],[Ar,Vr]]:[];Ba.point=$t[la]}),Cr}function Dt($t){return $t.map(function(Cr,Ar){return{x:Math.round(ut(Cr,Ar)/Ge)*Ge,y:Math.round(ht(Cr,Ar)/Ge)*Ge,i:Ar}})}return zt.links=function($t){return Dl(Dt($t)).edges.filter(function(Cr){return Cr.l&&Cr.r}).map(function(Cr){return{source:$t[Cr.l.i],target:$t[Cr.r.i]}})},zt.triangles=function($t){var Cr=[];return Dl(Dt($t)).cells.forEach(function(Ar,Vr){for(var Kr=Ar.site,aa=Ar.edges.sort(Ui),Ua=-1,la=aa.length,Ta,ka=aa[la-1].edge,Ba=ka.l===Kr?ka.r:ka.l;++UaVa&&(Va=Ar.x),Ar.y>Ma&&(Ma=Ar.y),aa.push(Ar.x),Ua.push(Ar.y);else for(la=0;laVa&&(Va=mn),Wn>Ma&&(Ma=Wn),aa.push(mn),Ua.push(Wn)}var jn=Va-ka,Zn=Ma-Ba;jn>Zn?Ma=Ba+jn:Va=ka+Zn;function hi(wi,Ji,Vo,sl,Ms,Kn,go,Do){if(!(isNaN(Vo)||isNaN(sl)))if(wi.leaf){var Es=wi.x,hs=wi.y;if(Es!=null)if(l(Es-Vo)+l(hs-sl)<.01)_i(wi,Ji,Vo,sl,Ms,Kn,go,Do);else{var Hl=wi.point;wi.x=wi.y=wi.point=null,_i(wi,Hl,Es,hs,Ms,Kn,go,Do),_i(wi,Ji,Vo,sl,Ms,Kn,go,Do)}else wi.x=Vo,wi.y=sl,wi.point=Ji}else _i(wi,Ji,Vo,sl,Ms,Kn,go,Do)}function _i(wi,Ji,Vo,sl,Ms,Kn,go,Do){var Es=(Ms+go)*.5,hs=(Kn+Do)*.5,Hl=Vo>=Es,Qo=sl>=hs,_s=Qo<<1|Hl;wi.leaf=!1,wi=wi.nodes[_s]||(wi.nodes[_s]=ns()),Hl?Ms=Es:go=Es,Qo?Kn=hs:Do=hs,hi(wi,Ji,Vo,sl,Ms,Kn,go,Do)}var Po=ns();if(Po.add=function(wi){hi(Po,wi,+Vr(wi,++la),+Kr(wi,la),ka,Ba,Va,Ma)},Po.visit=function(wi){_u(wi,Po,ka,Ba,Va,Ma)},Po.find=function(wi){return Nc(Po,wi[0],wi[1],ka,Ba,Va,Ma)},la=-1,Le==null){for(;++laxt||Kr>zt||aa=mn,Zn=Ye>=Wn,hi=Zn<<1|jn,_i=hi+4;hi<_i;++hi)if(Ar=Ma[hi&3])switch(hi&3){case 0:Cr(Ar,Vr,Kr,mn,Wn);break;case 1:Cr(Ar,mn,Kr,aa,Wn);break;case 2:Cr(Ar,Vr,Wn,mn,Ua);break;case 3:Cr(Ar,mn,Wn,aa,Ua);break}}}(pe,ut,ht,xt,zt),$t}d.interpolateRgb=ml;function ml(pe,Le){pe=d.rgb(pe),Le=d.rgb(Le);var Ye=pe.r,ut=pe.g,ht=pe.b,xt=Le.r-Ye,zt=Le.g-ut,Dt=Le.b-ht;return function($t){return"#"+yr(Math.round(Ye+xt*$t))+yr(Math.round(ut+zt*$t))+yr(Math.round(ht+Dt*$t))}}d.interpolateObject=fl;function fl(pe,Le){var Ye={},ut={},ht;for(ht in pe)ht in Le?Ye[ht]=Ko(pe[ht],Le[ht]):ut[ht]=pe[ht];for(ht in Le)ht in pe||(ut[ht]=Le[ht]);return function(xt){for(ht in Ye)ut[ht]=Ye[ht](xt);return ut}}d.interpolateNumber=_l;function _l(pe,Le){return pe=+pe,Le=+Le,function(Ye){return pe*(1-Ye)+Le*Ye}}d.interpolateString=Yu;function Yu(pe,Le){var Ye=Ts.lastIndex=Tl.lastIndex=0,ut,ht,xt,zt=-1,Dt=[],$t=[];for(pe=pe+"",Le=Le+"";(ut=Ts.exec(pe))&&(ht=Tl.exec(Le));)(xt=ht.index)>Ye&&(xt=Le.slice(Ye,xt),Dt[zt]?Dt[zt]+=xt:Dt[++zt]=xt),(ut=ut[0])===(ht=ht[0])?Dt[zt]?Dt[zt]+=ht:Dt[++zt]=ht:(Dt[++zt]=null,$t.push({i:zt,x:_l(ut,ht)})),Ye=Tl.lastIndex;return Ye=0&&!(ut=d.interpolators[Ye](pe,Le)););return ut}d.interpolators=[function(pe,Le){var Ye=typeof Le;return(Ye==="string"?Jr.has(Le.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Le)?ml:Yu:Le instanceof Ia?ml:Array.isArray(Le)?Cs:Ye==="object"&&isNaN(Le)?fl:_l)(pe,Le)}],d.interpolateArray=Cs;function Cs(pe,Le){var Ye=[],ut=[],ht=pe.length,xt=Le.length,zt=Math.min(pe.length,Le.length),Dt;for(Dt=0;Dt=0?pe.slice(0,Le):pe,ut=Le>=0?pe.slice(Le+1):"in";return Ye=Ul.get(Ye)||Nu,ut=Ku.get(ut)||F,Bs(ut(Ye.apply(null,x.call(arguments,1))))};function Bs(pe){return function(Le){return Le<=0?0:Le>=1?1:pe(Le)}}function Gf(pe){return function(Le){return 1-pe(1-Le)}}function Eo(pe){return function(Le){return .5*(Le<.5?pe(2*Le):2-pe(2-2*Le))}}function Wf(pe){return pe*pe}function is(pe){return pe*pe*pe}function oo(pe){if(pe<=0)return 0;if(pe>=1)return 1;var Le=pe*pe,Ye=Le*pe;return 4*(pe<.5?Ye:3*(pe-Le)+Ye-.75)}function pc(pe){return function(Le){return Math.pow(Le,pe)}}function xu(pe){return 1-Math.cos(pe*Pe)}function zl(pe){return Math.pow(2,10*(pe-1))}function Kc(pe){return 1-Math.sqrt(1-pe*pe)}function Ju(pe,Le){var Ye;return arguments.length<2&&(Le=.45),arguments.length?Ye=Le/ge*Math.asin(1/pe):(pe=1,Ye=Le/4),function(ut){return 1+pe*Math.pow(2,-10*ut)*Math.sin((ut-Ye)*ge/Le)}}function gc(pe){return pe||(pe=1.70158),function(Le){return Le*Le*((pe+1)*Le-pe)}}function hl(pe){return pe<1/2.75?7.5625*pe*pe:pe<2/2.75?7.5625*(pe-=1.5/2.75)*pe+.75:pe<2.5/2.75?7.5625*(pe-=2.25/2.75)*pe+.9375:7.5625*(pe-=2.625/2.75)*pe+.984375}d.interpolateHcl=yf;function yf(pe,Le){pe=d.hcl(pe),Le=d.hcl(Le);var Ye=pe.h,ut=pe.c,ht=pe.l,xt=Le.h-Ye,zt=Le.c-ut,Dt=Le.l-ht;return isNaN(zt)&&(zt=0,ut=isNaN(ut)?Le.c:ut),isNaN(xt)?(xt=0,Ye=isNaN(Ye)?Le.h:Ye):xt>180?xt-=360:xt<-180&&(xt+=360),function($t){return jt(Ye+xt*$t,ut+zt*$t,ht+Dt*$t)+""}}d.interpolateHsl=Jc;function Jc(pe,Le){pe=d.hsl(pe),Le=d.hsl(Le);var Ye=pe.h,ut=pe.s,ht=pe.l,xt=Le.h-Ye,zt=Le.s-ut,Dt=Le.l-ht;return isNaN(zt)&&(zt=0,ut=isNaN(ut)?Le.s:ut),isNaN(xt)?(xt=0,Ye=isNaN(Ye)?Le.h:Ye):xt>180?xt-=360:xt<-180&&(xt+=360),function($t){return Ka(Ye+xt*$t,ut+zt*$t,ht+Dt*$t)+""}}d.interpolateLab=Uc;function Uc(pe,Le){pe=d.lab(pe),Le=d.lab(Le);var Ye=pe.l,ut=pe.a,ht=pe.b,xt=Le.l-Ye,zt=Le.a-ut,Dt=Le.b-ht;return function($t){return Aa(Ye+xt*$t,ut+zt*$t,ht+Dt*$t)+""}}d.interpolateRound=$u;function $u(pe,Le){return Le-=pe,function(Ye){return Math.round(pe+Le*Ye)}}d.transform=function(pe){var Le=E.createElementNS(d.ns.prefix.svg,"g");return(d.transform=function(Ye){if(Ye!=null){Le.setAttribute("transform",Ye);var ut=Le.transform.baseVal.consolidate()}return new jc(ut?ut.matrix:sc)})(pe)};function jc(pe){var Le=[pe.a,pe.b],Ye=[pe.c,pe.d],ut=bu(Le),ht=$c(Le,Ye),xt=bu(Qc(Ye,Le,-ht))||0;Le[0]*Ye[1]180?Le+=360:Le-pe>180&&(pe+=360),ut.push({i:Ye.push(wu(Ye)+"rotate(",null,")")-2,x:_l(pe,Le)})):Le&&Ye.push(wu(Ye)+"rotate("+Le+")")}function ef(pe,Le,Ye,ut){pe!==Le?ut.push({i:Ye.push(wu(Ye)+"skewX(",null,")")-2,x:_l(pe,Le)}):Le&&Ye.push(wu(Ye)+"skewX("+Le+")")}function ps(pe,Le,Ye,ut){if(pe[0]!==Le[0]||pe[1]!==Le[1]){var ht=Ye.push(wu(Ye)+"scale(",null,",",null,")");ut.push({i:ht-4,x:_l(pe[0],Le[0])},{i:ht-2,x:_l(pe[1],Le[1])})}else(Le[0]!==1||Le[1]!==1)&&Ye.push(wu(Ye)+"scale("+Le+")")}function Vc(pe,Le){var Ye=[],ut=[];return pe=d.transform(pe),Le=d.transform(Le),eu(pe.translate,Le.translate,Ye,ut),Sc(pe.rotate,Le.rotate,Ye,ut),ef(pe.skew,Le.skew,Ye,ut),ps(pe.scale,Le.scale,Ye,ut),pe=Le=null,function(ht){for(var xt=-1,zt=ut.length,Dt;++xt0?xt=Ma:(Ye.c=null,Ye.t=NaN,Ye=null,Le.end({type:"end",alpha:xt=0})):Ma>0&&(Le.start({type:"start",alpha:xt=Ma}),Ye=Ga(pe.tick)),pe):xt},pe.start=function(){var Ma,mn=aa.length,Wn=Ua.length,jn=ut[0],Zn=ut[1],hi,_i;for(Ma=0;Ma=0;)xt.push(Ar=Cr[$t]),Ar.parent=Dt,Ar.depth=Dt.depth+1;Ye&&(Dt.value=0),Dt.children=Cr}else Ye&&(Dt.value=+Ye.call(ut,Dt,Dt.depth)||0),delete Dt.children;return Pu(ht,function(Vr){var Kr,aa;pe&&(Kr=Vr.children)&&Kr.sort(pe),Ye&&(aa=Vr.parent)&&(aa.value+=Vr.value)}),zt}return ut.sort=function(ht){return arguments.length?(pe=ht,ut):pe},ut.children=function(ht){return arguments.length?(Le=ht,ut):Le},ut.value=function(ht){return arguments.length?(Ye=ht,ut):Ye},ut.revalue=function(ht){return Ye&&(yc(ht,function(xt){xt.children&&(xt.value=0)}),Pu(ht,function(xt){var zt;xt.children||(xt.value=+Ye.call(ut,xt,xt.depth)||0),(zt=xt.parent)&&(zt.value+=xt.value)})),ht},ut};function Ns(pe,Le){return d.rebind(pe,Le,"sort","children","value"),pe.nodes=pe,pe.links=nh,pe}function yc(pe,Le){for(var Ye=[pe];(pe=Ye.pop())!=null;)if(Le(pe),(ht=pe.children)&&(ut=ht.length))for(var ut,ht;--ut>=0;)Ye.push(ht[ut])}function Pu(pe,Le){for(var Ye=[pe],ut=[];(pe=Ye.pop())!=null;)if(ut.push(pe),(zt=pe.children)&&(xt=zt.length))for(var ht=-1,xt,zt;++htht&&(ht=Dt),ut.push(Dt)}for(zt=0;ztut&&(Ye=Le,ut=ht);return Ye}function vu(pe){return pe.reduce(du,0)}function du(pe,Le){return pe+Le[1]}d.layout.histogram=function(){var pe=!0,Le=Number,Ye=_c,ut=af;function ht(xt,Kr){for(var Dt=[],$t=xt.map(Le,this),Cr=Ye.call(this,$t,Kr),Ar=ut.call(this,Cr,$t,Kr),Vr,Kr=-1,aa=$t.length,Ua=Ar.length-1,la=pe?1:1/aa,Ta;++Kr0)for(Kr=-1;++Kr=Cr[0]&&Ta<=Cr[1]&&(Vr=Dt[d.bisect(Ar,Ta,1,Ua)-1],Vr.y+=la,Vr.push(xt[Kr]));return Dt}return ht.value=function(xt){return arguments.length?(Le=xt,ht):Le},ht.range=function(xt){return arguments.length?(Ye=wt(xt),ht):Ye},ht.bins=function(xt){return arguments.length?(ut=typeof xt=="number"?function(zt){return Rs(zt,xt)}:wt(xt),ht):ut},ht.frequency=function(xt){return arguments.length?(pe=!!xt,ht):pe},ht};function af(pe,Le){return Rs(pe,Math.ceil(Math.log(Le.length)/Math.LN2+1))}function Rs(pe,Le){for(var Ye=-1,ut=+pe[0],ht=(pe[1]-ut)/Le,xt=[];++Ye<=Le;)xt[Ye]=ht*Ye+ut;return xt}function _c(pe){return[d.min(pe),d.max(pe)]}d.layout.pack=function(){var pe=d.layout.hierarchy().sort(ju),Le=0,Ye=[1,1],ut;function ht(xt,zt){var Dt=pe.call(this,xt,zt),$t=Dt[0],Cr=Ye[0],Ar=Ye[1],Vr=ut==null?Math.sqrt:typeof ut=="function"?ut:function(){return ut};if($t.x=$t.y=0,Pu($t,function(aa){aa.r=+Vr(aa.value)}),Pu($t,bc),Le){var Kr=Le*(ut?1:Math.max(2*$t.r/Cr,2*$t.r/Ar))/2;Pu($t,function(aa){aa.r+=Kr}),Pu($t,bc),Pu($t,function(aa){aa.r-=Kr})}return nf($t,Cr/2,Ar/2,ut?1:1/Math.max(2*$t.r/Cr,2*$t.r/Ar)),Dt}return ht.size=function(xt){return arguments.length?(Ye=xt,ht):Ye},ht.radius=function(xt){return arguments.length?(ut=xt==null||typeof xt=="function"?xt:+xt,ht):ut},ht.padding=function(xt){return arguments.length?(Le=+xt,ht):Le},Ns(ht,pe)};function ju(pe,Le){return pe.value-Le.value}function iu(pe,Le){var Ye=pe._pack_next;pe._pack_next=Le,Le._pack_prev=pe,Le._pack_next=Ye,Ye._pack_prev=Le}function xc(pe,Le){pe._pack_next=Le,Le._pack_prev=pe}function Iu(pe,Le){var Ye=Le.x-pe.x,ut=Le.y-pe.y,ht=pe.r+Le.r;return .999*ht*ht>Ye*Ye+ut*ut}function bc(pe){if(!(Le=pe.children)||!(Kr=Le.length))return;var Le,Ye=1/0,ut=-1/0,ht=1/0,xt=-1/0,zt,Dt,$t,Cr,Ar,Vr,Kr;function aa(Ma){Ye=Math.min(Ma.x-Ma.r,Ye),ut=Math.max(Ma.x+Ma.r,ut),ht=Math.min(Ma.y-Ma.r,ht),xt=Math.max(Ma.y+Ma.r,xt)}if(Le.forEach(Lf),zt=Le[0],zt.x=-zt.r,zt.y=0,aa(zt),Kr>1&&(Dt=Le[1],Dt.x=Dt.r,Dt.y=0,aa(Dt),Kr>2))for($t=Le[2],ou(zt,Dt,$t),aa($t),iu(zt,$t),zt._pack_prev=$t,iu($t,Dt),Dt=zt._pack_next,Cr=3;CrTa.x&&(Ta=mn),mn.depth>ka.depth&&(ka=mn)});var Ba=Le(la,Ta)/2-la.x,Va=Ye[0]/(Ta.x+Le(Ta,la)/2+Ba),Ma=Ye[1]/(ka.depth||1);yc(aa,function(mn){mn.x=(mn.x+Ba)*Va,mn.y=mn.depth*Ma})}return Kr}function xt(Ar){for(var Vr={A:null,children:[Ar]},Kr=[Vr],aa;(aa=Kr.pop())!=null;)for(var Ua=aa.children,la,Ta=0,ka=Ua.length;Ta0&&(Ol(tc(la,Ar,Kr),Ar,mn),ka+=mn,Ba+=mn),Va+=la.m,ka+=aa.m,Ma+=Ta.m,Ba+=Ua.m;la&&!Zs(Ua)&&(Ua.t=la,Ua.m+=Va-Ba),aa&&!Au(Ta)&&(Ta.t=aa,Ta.m+=ka-Ma,Kr=Ar)}return Kr}function Cr(Ar){Ar.x*=Ye[0],Ar.y=Ar.depth*Ye[1]}return ht.separation=function(Ar){return arguments.length?(Le=Ar,ht):Le},ht.size=function(Ar){return arguments.length?(ut=(Ye=Ar)==null?Cr:null,ht):ut?null:Ye},ht.nodeSize=function(Ar){return arguments.length?(ut=(Ye=Ar)==null?null:Cr,ht):ut?Ye:null},Ns(ht,pe)};function Ru(pe,Le){return pe.parent==Le.parent?1:2}function Au(pe){var Le=pe.children;return Le.length?Le[0]:pe.t}function Zs(pe){var Le=pe.children,Ye;return(Ye=Le.length)?Le[Ye-1]:pe.t}function Ol(pe,Le,Ye){var ut=Ye/(Le.i-pe.i);Le.c-=ut,Le.s+=Ye,pe.c+=ut,Le.z+=Ye,Le.m+=Ye}function bl(pe){for(var Le=0,Ye=0,ut=pe.children,ht=ut.length,xt;--ht>=0;)xt=ut[ht],xt.z+=Le,xt.m+=Le,Le+=xt.s+(Ye+=xt.c)}function tc(pe,Le,Ye){return pe.a.parent===Le.parent?pe.a:Ye}d.layout.cluster=function(){var pe=d.layout.hierarchy().sort(null).value(null),Le=Ru,Ye=[1,1],ut=!1;function ht(xt,zt){var Dt=pe.call(this,xt,zt),$t=Dt[0],Cr,Ar=0;Pu($t,function(la){var Ta=la.children;Ta&&Ta.length?(la.x=Cc(Ta),la.y=Su(Ta)):(la.x=Cr?Ar+=Le(la,Cr):0,la.y=0,Cr=la)});var Vr=Ht($t),Kr=ur($t),aa=Vr.x-Le(Vr,Kr)/2,Ua=Kr.x+Le(Kr,Vr)/2;return Pu($t,ut?function(la){la.x=(la.x-$t.x)*Ye[0],la.y=($t.y-la.y)*Ye[1]}:function(la){la.x=(la.x-aa)/(Ua-aa)*Ye[0],la.y=(1-($t.y?la.y/$t.y:1))*Ye[1]}),Dt}return ht.separation=function(xt){return arguments.length?(Le=xt,ht):Le},ht.size=function(xt){return arguments.length?(ut=(Ye=xt)==null,ht):ut?null:Ye},ht.nodeSize=function(xt){return arguments.length?(ut=(Ye=xt)!=null,ht):ut?Ye:null},Ns(ht,pe)};function Su(pe){return 1+d.max(pe,function(Le){return Le.y})}function Cc(pe){return pe.reduce(function(Le,Ye){return Le+Ye.x},0)/pe.length}function Ht(pe){var Le=pe.children;return Le&&Le.length?Ht(Le[0]):pe}function ur(pe){var Le=pe.children,Ye;return Le&&(Ye=Le.length)?ur(Le[Ye-1]):pe}d.layout.treemap=function(){var pe=d.layout.hierarchy(),Le=Math.round,Ye=[1,1],ut=null,ht=qr,xt=!1,zt,Dt="squarify",$t=.5*(1+Math.sqrt(5));function Cr(la,Ta){for(var ka=-1,Ba=la.length,Va,Ma;++ka0;)Ba.push(Ma=Va[Zn-1]),Ba.area+=Ma.area,Dt!=="squarify"||(Wn=Kr(Ba,jn))<=mn?(Va.pop(),mn=Wn):(Ba.area-=Ba.pop().area,aa(Ba,jn,ka,!1),jn=Math.min(ka.dx,ka.dy),Ba.length=Ba.area=0,mn=1/0);Ba.length&&(aa(Ba,jn,ka,!0),Ba.length=Ba.area=0),Ta.forEach(Ar)}}function Vr(la){var Ta=la.children;if(Ta&&Ta.length){var ka=ht(la),Ba=Ta.slice(),Va,Ma=[];for(Cr(Ba,ka.dx*ka.dy/la.value),Ma.area=0;Va=Ba.pop();)Ma.push(Va),Ma.area+=Va.area,Va.z!=null&&(aa(Ma,Va.z?ka.dx:ka.dy,ka,!Ba.length),Ma.length=Ma.area=0);Ta.forEach(Vr)}}function Kr(la,Ta){for(var ka=la.area,Ba,Va=0,Ma=1/0,mn=-1,Wn=la.length;++mnVa&&(Va=Ba));return ka*=ka,Ta*=Ta,ka?Math.max(Ta*Va*$t/ka,ka/(Ta*Ma*$t)):1/0}function aa(la,Ta,ka,Ba){var Va=-1,Ma=la.length,mn=ka.x,Wn=ka.y,jn=Ta?Le(la.area/Ta):0,Zn;if(Ta==ka.dx){for((Ba||jn>ka.dy)&&(jn=ka.dy);++Vaka.dx)&&(jn=ka.dx);++Va1);return pe+Le*ut*Math.sqrt(-2*Math.log(xt)/xt)}},logNormal:function(){var pe=d.random.normal.apply(d,arguments);return function(){return Math.exp(pe())}},bates:function(pe){var Le=d.random.irwinHall(pe);return function(){return Le()/pe}},irwinHall:function(pe){return function(){for(var Le=0,Ye=0;Ye2?Ja:ja,Cr=ut?mf:Zf;return ht=$t(pe,Le,Cr,Ye),xt=$t(Le,pe,Cr,Ko),Dt}function Dt($t){return ht($t)}return Dt.invert=function($t){return xt($t)},Dt.domain=function($t){return arguments.length?(pe=$t.map(Number),zt()):pe},Dt.range=function($t){return arguments.length?(Le=$t,zt()):Le},Dt.rangeRound=function($t){return Dt.range($t).interpolate($u)},Dt.clamp=function($t){return arguments.length?(ut=$t,zt()):ut},Dt.interpolate=function($t){return arguments.length?(Ye=$t,zt()):Ye},Dt.ticks=function($t){return zi(pe,$t)},Dt.tickFormat=function($t,Cr){return d3_scale_linearTickFormat(pe,$t,Cr)},Dt.nice=function($t){return Wa(pe,$t),zt()},Dt.copy=function(){return _n(pe,Le,Ye,ut)},zt()}function on(pe,Le){return d.rebind(pe,Le,"range","rangeRound","interpolate","clamp")}function Wa(pe,Le){return sn(pe,gn(On(pe,Le)[2])),sn(pe,gn(On(pe,Le)[2])),pe}function On(pe,Le){Le==null&&(Le=10);var Ye=ua(pe),ut=Ye[1]-Ye[0],ht=Math.pow(10,Math.floor(Math.log(ut/Le)/Math.LN10)),xt=Le/ut*ht;return xt<=.15?ht*=10:xt<=.35?ht*=5:xt<=.75&&(ht*=2),Ye[0]=Math.ceil(Ye[0]/ht)*ht,Ye[1]=Math.floor(Ye[1]/ht)*ht+ht*.5,Ye[2]=ht,Ye}function zi(pe,Le){return d.range.apply(d,On(pe,Le))}d.scale.log=function(){return ki(d.scale.linear().domain([0,1]),10,!0,[1,10])};function ki(pe,Le,Ye,ut){function ht(Dt){return(Ye?Math.log(Dt<0?0:Dt):-Math.log(Dt>0?0:-Dt))/Math.log(Le)}function xt(Dt){return Ye?Math.pow(Le,Dt):-Math.pow(Le,-Dt)}function zt(Dt){return pe(ht(Dt))}return zt.invert=function(Dt){return xt(pe.invert(Dt))},zt.domain=function(Dt){return arguments.length?(Ye=Dt[0]>=0,pe.domain((ut=Dt.map(Number)).map(ht)),zt):ut},zt.base=function(Dt){return arguments.length?(Le=+Dt,pe.domain(ut.map(ht)),zt):Le},zt.nice=function(){var Dt=sn(ut.map(ht),Ye?Math:ji);return pe.domain(Dt),ut=Dt.map(xt),zt},zt.ticks=function(){var Dt=ua(ut),$t=[],Cr=Dt[0],Ar=Dt[1],Vr=Math.floor(ht(Cr)),Kr=Math.ceil(ht(Ar)),aa=Le%1?2:Le;if(isFinite(Kr-Vr)){if(Ye){for(;Vr0;Ua--)$t.push(xt(Vr)*Ua);for(Vr=0;$t[Vr]Ar;Kr--);$t=$t.slice(Vr,Kr)}return $t},zt.copy=function(){return ki(pe.copy(),Le,Ye,ut)},on(zt,pe)}var ji={floor:function(pe){return-Math.ceil(-pe)},ceil:function(pe){return-Math.floor(-pe)}};d.scale.pow=function(){return Ni(d.scale.linear(),1,[0,1])};function Ni(pe,Le,Ye){var ut=Bn(Le),ht=Bn(1/Le);function xt(zt){return pe(ut(zt))}return xt.invert=function(zt){return ht(pe.invert(zt))},xt.domain=function(zt){return arguments.length?(pe.domain((Ye=zt.map(Number)).map(ut)),xt):Ye},xt.ticks=function(zt){return zi(Ye,zt)},xt.tickFormat=function(zt,Dt){return d3_scale_linearTickFormat(Ye,zt,Dt)},xt.nice=function(zt){return xt.domain(Wa(Ye,zt))},xt.exponent=function(zt){return arguments.length?(ut=Bn(Le=zt),ht=Bn(1/Le),pe.domain(Ye.map(ut)),xt):Le},xt.copy=function(){return Ni(pe.copy(),Le,Ye)},on(xt,pe)}function Bn(pe){return function(Le){return Le<0?-Math.pow(-Le,pe):Math.pow(Le,pe)}}d.scale.sqrt=function(){return d.scale.pow().exponent(.5)},d.scale.ordinal=function(){return An([],{t:"range",a:[[]]})};function An(pe,Le){var Ye,ut,ht;function xt(Dt){return ut[((Ye.get(Dt)||(Le.t==="range"?Ye.set(Dt,pe.push(Dt)):NaN))-1)%ut.length]}function zt(Dt,$t){return d.range(pe.length).map(function(Cr){return Dt+$t*Cr})}return xt.domain=function(Dt){if(!arguments.length)return pe;pe=[],Ye=new S;for(var $t=-1,Cr=Dt.length,Ar;++$t0?Ye[xt-1]:pe[0],xtKr?0:1;if(Ar=be)return $t(Ar,Ua)+(Cr?$t(Cr,1-Ua):"")+"Z";var la,Ta,ka,Ba,Va=0,Ma=0,mn,Wn,jn,Zn,hi,_i,Po,wi,Ji=[];if((Ba=(+zt.apply(this,arguments)||0)/2)&&(ka=ut===Ss?Math.sqrt(Cr*Cr+Ar*Ar):+ut.apply(this,arguments),Ua||(Ma*=-1),Ar&&(Ma=Mt(ka/Ar*Math.sin(Ba))),Cr&&(Va=Mt(ka/Cr*Math.sin(Ba)))),Ar){mn=Ar*Math.cos(Vr+Ma),Wn=Ar*Math.sin(Vr+Ma),jn=Ar*Math.cos(Kr-Ma),Zn=Ar*Math.sin(Kr-Ma);var Vo=Math.abs(Kr-Vr-2*Ma)<=ve?0:1;if(Ma&&jl(mn,Wn,jn,Zn)===Ua^Vo){var sl=(Vr+Kr)/2;mn=Ar*Math.cos(sl),Wn=Ar*Math.sin(sl),jn=Zn=null}}else mn=Wn=0;if(Cr){hi=Cr*Math.cos(Kr-Va),_i=Cr*Math.sin(Kr-Va),Po=Cr*Math.cos(Vr+Va),wi=Cr*Math.sin(Vr+Va);var Ms=Math.abs(Vr-Kr+2*Va)<=ve?0:1;if(Va&&jl(hi,_i,Po,wi)===1-Ua^Ms){var Kn=(Vr+Kr)/2;hi=Cr*Math.cos(Kn),_i=Cr*Math.sin(Kn),Po=wi=null}}else hi=_i=0;if(aa>Ge&&(la=Math.min(Math.abs(Ar-Cr)/2,+Ye.apply(this,arguments)))>.001){Ta=Cr0?0:1}function Vl(pe,Le,Ye,ut,ht){var xt=pe[0]-Le[0],zt=pe[1]-Le[1],Dt=(ht?ut:-ut)/Math.sqrt(xt*xt+zt*zt),$t=Dt*zt,Cr=-Dt*xt,Ar=pe[0]+$t,Vr=pe[1]+Cr,Kr=Le[0]+$t,aa=Le[1]+Cr,Ua=(Ar+Kr)/2,la=(Vr+aa)/2,Ta=Kr-Ar,ka=aa-Vr,Ba=Ta*Ta+ka*ka,Va=Ye-ut,Ma=Ar*aa-Kr*Vr,mn=(ka<0?-1:1)*Math.sqrt(Math.max(0,Va*Va*Ba-Ma*Ma)),Wn=(Ma*ka-Ta*mn)/Ba,jn=(-Ma*Ta-ka*mn)/Ba,Zn=(Ma*ka+Ta*mn)/Ba,hi=(-Ma*Ta+ka*mn)/Ba,_i=Wn-Ua,Po=jn-la,wi=Zn-Ua,Ji=hi-la;return _i*_i+Po*Po>wi*wi+Ji*Ji&&(Wn=Zn,jn=hi),[[Wn-$t,jn-Cr],[Wn*Ye/Va,jn*Ye/Va]]}function cc(){return!0}function ql(pe){var Le=yi,Ye=Ci,ut=cc,ht=ol,xt=ht.key,zt=.7;function Dt($t){var Cr=[],Ar=[],Vr=-1,Kr=$t.length,aa,Ua=wt(Le),la=wt(Ye);function Ta(){Cr.push("M",ht(pe(Ar),zt))}for(;++Vr1?pe.join("L"):pe+"Z"}function rc(pe){return pe.join("L")+"Z"}function Vi(pe){for(var Le=0,Ye=pe.length,ut=pe[0],ht=[ut[0],",",ut[1]];++Le1&&ht.push("H",ut[0]),ht.join("")}function eo(pe){for(var Le=0,Ye=pe.length,ut=pe[0],ht=[ut[0],",",ut[1]];++Le1){Dt=Le[1],xt=pe[$t],$t++,ut+="C"+(ht[0]+zt[0])+","+(ht[1]+zt[1])+","+(xt[0]-Dt[0])+","+(xt[1]-Dt[1])+","+xt[0]+","+xt[1];for(var Cr=2;Cr9&&(xt=Ye*3/Math.sqrt(xt),zt[Dt]=xt*ut,zt[Dt+1]=xt*ht));for(Dt=-1;++Dt<=$t;)xt=(pe[Math.min($t,Dt+1)][0]-pe[Math.max(0,Dt-1)][0])/(6*(1+zt[Dt]*zt[Dt])),Le.push([xt||0,zt[Dt]*xt||0]);return Le}function Ze(pe){return pe.length<3?ol(pe):pe[0]+I(pe,je(pe))}d.svg.line.radial=function(){var pe=ql(at);return pe.radius=pe.x,delete pe.x,pe.angle=pe.y,delete pe.y,pe};function at(pe){for(var Le,Ye=-1,ut=pe.length,ht,xt;++Yeve)+",1 "+Vr}function Cr(Ar,Vr,Kr,aa){return"Q 0,0 "+aa}return xt.radius=function(Ar){return arguments.length?(Ye=wt(Ar),xt):Ye},xt.source=function(Ar){return arguments.length?(pe=wt(Ar),xt):pe},xt.target=function(Ar){return arguments.length?(Le=wt(Ar),xt):Le},xt.startAngle=function(Ar){return arguments.length?(ut=wt(Ar),xt):ut},xt.endAngle=function(Ar){return arguments.length?(ht=wt(Ar),xt):ht},xt};function Et(pe){return pe.radius}d.svg.diagonal=function(){var pe=Tt,Le=gt,Ye=Yt;function ut(ht,xt){var zt=pe.call(this,ht,xt),Dt=Le.call(this,ht,xt),$t=(zt.y+Dt.y)/2,Cr=[zt,{x:zt.x,y:$t},{x:Dt.x,y:$t},Dt];return Cr=Cr.map(Ye),"M"+Cr[0]+"C"+Cr[1]+" "+Cr[2]+" "+Cr[3]}return ut.source=function(ht){return arguments.length?(pe=wt(ht),ut):pe},ut.target=function(ht){return arguments.length?(Le=wt(ht),ut):Le},ut.projection=function(ht){return arguments.length?(Ye=ht,ut):Ye},ut};function Yt(pe){return[pe.x,pe.y]}d.svg.diagonal.radial=function(){var pe=d.svg.diagonal(),Le=Yt,Ye=pe.projection;return pe.projection=function(ut){return arguments.length?Ye(rr(Le=ut)):Le},pe};function rr(pe){return function(){var Le=pe.apply(this,arguments),Ye=Le[0],ut=Le[1]-Pe;return[Ye*Math.cos(ut),Ye*Math.sin(ut)]}}d.svg.symbol=function(){var pe=Sr,Le=sr;function Ye(ut,ht){return(Qr.get(pe.call(this,ut,ht))||Nr)(Le.call(this,ut,ht))}return Ye.type=function(ut){return arguments.length?(pe=wt(ut),Ye):pe},Ye.size=function(ut){return arguments.length?(Le=wt(ut),Ye):Le},Ye};function sr(){return 64}function Sr(){return"circle"}function Nr(pe){var Le=Math.sqrt(pe/ve);return"M0,"+Le+"A"+Le+","+Le+" 0 1,1 0,"+-Le+"A"+Le+","+Le+" 0 1,1 0,"+Le+"Z"}var Qr=d.map({circle:Nr,cross:function(pe){var Le=Math.sqrt(pe/5)/2;return"M"+-3*Le+","+-Le+"H"+-Le+"V"+-3*Le+"H"+Le+"V"+-Le+"H"+3*Le+"V"+Le+"H"+Le+"V"+3*Le+"H"+-Le+"V"+Le+"H"+-3*Le+"Z"},diamond:function(pe){var Le=Math.sqrt(pe/(2*_a)),Ye=Le*_a;return"M0,"+-Le+"L"+Ye+",0 0,"+Le+" "+-Ye+",0Z"},square:function(pe){var Le=Math.sqrt(pe)/2;return"M"+-Le+","+-Le+"L"+Le+","+-Le+" "+Le+","+Le+" "+-Le+","+Le+"Z"},"triangle-down":function(pe){var Le=Math.sqrt(pe/ia),Ye=Le*ia/2;return"M0,"+Ye+"L"+Le+","+-Ye+" "+-Le+","+-Ye+"Z"},"triangle-up":function(pe){var Le=Math.sqrt(pe/ia),Ye=Le*ia/2;return"M0,"+-Ye+"L"+Le+","+Ye+" "+-Le+","+Ye+"Z"}});d.svg.symbolTypes=Qr.keys();var ia=Math.sqrt(3),_a=Math.tan(30*We);ee.transition=function(pe){for(var Le=pi||++Nn,Ye=No(pe),ut=[],ht,xt,zt=ii||{time:Date.now(),ease:oo,delay:0,duration:250},Dt=-1,$t=this.length;++Dt<$t;){ut.push(ht=[]);for(var Cr=this[Dt],Ar=-1,Vr=Cr.length;++Ar0;)Vr[--Ba].call(pe,ka);if(Ta>=1)return zt.event&&zt.event.end.call(pe,pe.__data__,Le),--xt.count?delete xt[ut]:delete pe[Ye],1}zt||(Dt=ht.time,$t=Ga(Kr,0,Dt),zt=xt[ut]={tween:new S,time:Dt,timer:$t,delay:ht.delay,duration:ht.duration,ease:ht.ease,index:Le},ht=null,++xt.count)}d.svg.axis=function(){var pe=d.scale.linear(),Le=Zo,Ye=6,ut=6,ht=3,xt=[10],zt=null,Dt;function $t(Cr){Cr.each(function(){var Ar=d.select(this),Vr=this.__chart__||pe,Kr=this.__chart__=pe.copy(),aa=zt??(Kr.ticks?Kr.ticks.apply(Kr,xt):Kr.domain()),Ua=Dt??(Kr.tickFormat?Kr.tickFormat.apply(Kr,xt):F),la=Ar.selectAll(".tick").data(aa,Kr),Ta=la.enter().insert("g",".domain").attr("class","tick").style("opacity",Ge),ka=d.transition(la.exit()).style("opacity",Ge).remove(),Ba=d.transition(la.order()).style("opacity",1),Va=Math.max(Ye,0)+ht,Ma,mn=Fa(Kr),Wn=Ar.selectAll(".domain").data([0]),jn=(Wn.enter().append("path").attr("class","domain"),d.transition(Wn));Ta.append("line"),Ta.append("text");var Zn=Ta.select("line"),hi=Ba.select("line"),_i=la.select("text").text(Ua),Po=Ta.select("text"),wi=Ba.select("text"),Ji=Le==="top"||Le==="left"?-1:1,Vo,sl,Ms,Kn;if(Le==="bottom"||Le==="top"?(Ma=zs,Vo="x",Ms="y",sl="x2",Kn="y2",_i.attr("dy",Ji<0?"0em":".71em").style("text-anchor","middle"),jn.attr("d","M"+mn[0]+","+Ji*ut+"V0H"+mn[1]+"V"+Ji*ut)):(Ma=xo,Vo="y",Ms="x",sl="y2",Kn="x2",_i.attr("dy",".32em").style("text-anchor",Ji<0?"end":"start"),jn.attr("d","M"+Ji*ut+","+mn[0]+"H0V"+mn[1]+"H"+Ji*ut)),Zn.attr(Kn,Ji*Ye),Po.attr(Ms,Ji*Va),hi.attr(sl,0).attr(Kn,Ji*Ye),wi.attr(Vo,0).attr(Ms,Ji*Va),Kr.rangeBand){var go=Kr,Do=go.rangeBand()/2;Vr=Kr=function(Es){return go(Es)+Do}}else Vr.rangeBand?Vr=Kr:ka.call(Ma,Kr,Vr);Ta.call(Ma,Vr,Kr),Ba.call(Ma,Kr,Kr)})}return $t.scale=function(Cr){return arguments.length?(pe=Cr,$t):pe},$t.orient=function(Cr){return arguments.length?(Le=Cr in Hs?Cr+"":Zo,$t):Le},$t.ticks=function(){return arguments.length?(xt=A(arguments),$t):xt},$t.tickValues=function(Cr){return arguments.length?(zt=Cr,$t):zt},$t.tickFormat=function(Cr){return arguments.length?(Dt=Cr,$t):Dt},$t.tickSize=function(Cr){var Ar=arguments.length;return Ar?(Ye=+Cr,ut=+arguments[Ar-1],$t):Ye},$t.innerTickSize=function(Cr){return arguments.length?(Ye=+Cr,$t):Ye},$t.outerTickSize=function(Cr){return arguments.length?(ut=+Cr,$t):ut},$t.tickPadding=function(Cr){return arguments.length?(ht=+Cr,$t):ht},$t.tickSubdivide=function(){return arguments.length&&$t},$t};var Zo="bottom",Hs={top:1,right:1,bottom:1,left:1};function zs(pe,Le,Ye){pe.attr("transform",function(ut){var ht=Le(ut);return"translate("+(isFinite(ht)?ht:Ye(ut))+",0)"})}function xo(pe,Le,Ye){pe.attr("transform",function(ut){var ht=Le(ut);return"translate(0,"+(isFinite(ht)?ht:Ye(ut))+")"})}d.svg.brush=function(){var pe=oe(Ar,"brushstart","brush","brushend"),Le=null,Ye=null,ut=[0,0],ht=[0,0],xt,zt,Dt=!0,$t=!0,Cr=vl[0];function Ar(la){la.each(function(){var Ta=d.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",Ua).on("touchstart.brush",Ua),ka=Ta.selectAll(".background").data([0]);ka.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),Ta.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Ba=Ta.selectAll(".resize").data(Cr,F);Ba.exit().remove(),Ba.enter().append("g").attr("class",function(Wn){return"resize "+Wn}).style("cursor",function(Wn){return bo[Wn]}).append("rect").attr("x",function(Wn){return/[ew]$/.test(Wn)?-3:null}).attr("y",function(Wn){return/^[ns]/.test(Wn)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Ba.style("display",Ar.empty()?"none":null);var Va=d.transition(Ta),Ma=d.transition(ka),mn;Le&&(mn=Fa(Le),Ma.attr("x",mn[0]).attr("width",mn[1]-mn[0]),Kr(Va)),Ye&&(mn=Fa(Ye),Ma.attr("y",mn[0]).attr("height",mn[1]-mn[0]),aa(Va)),Vr(Va)})}Ar.event=function(la){la.each(function(){var Ta=pe.of(this,arguments),ka={x:ut,y:ht,i:xt,j:zt},Ba=this.__chart__||ka;this.__chart__=ka,pi?d.select(this).transition().each("start.brush",function(){xt=Ba.i,zt=Ba.j,ut=Ba.x,ht=Ba.y,Ta({type:"brushstart"})}).tween("brush:brush",function(){var Va=Cs(ut,ka.x),Ma=Cs(ht,ka.y);return xt=zt=null,function(mn){ut=ka.x=Va(mn),ht=ka.y=Ma(mn),Ta({type:"brush",mode:"resize"})}}).each("end.brush",function(){xt=ka.i,zt=ka.j,Ta({type:"brush",mode:"resize"}),Ta({type:"brushend"})}):(Ta({type:"brushstart"}),Ta({type:"brush",mode:"resize"}),Ta({type:"brushend"}))})};function Vr(la){la.selectAll(".resize").attr("transform",function(Ta){return"translate("+ut[+/e$/.test(Ta)]+","+ht[+/^s/.test(Ta)]+")"})}function Kr(la){la.select(".extent").attr("x",ut[0]),la.selectAll(".extent,.n>rect,.s>rect").attr("width",ut[1]-ut[0])}function aa(la){la.select(".extent").attr("y",ht[0]),la.selectAll(".extent,.e>rect,.w>rect").attr("height",ht[1]-ht[0])}function Ua(){var la=this,Ta=d.select(d.event.target),ka=pe.of(la,arguments),Ba=d.select(la),Va=Ta.datum(),Ma=!/^(n|s)$/.test(Va)&&Le,mn=!/^(e|w)$/.test(Va)&&Ye,Wn=Ta.classed("extent"),jn=fr(la),Zn,hi=d.mouse(la),_i,Po=d.select(t(la)).on("keydown.brush",Vo).on("keyup.brush",sl);if(d.event.changedTouches?Po.on("touchmove.brush",Ms).on("touchend.brush",go):Po.on("mousemove.brush",Ms).on("mouseup.brush",go),Ba.interrupt().selectAll("*").interrupt(),Wn)hi[0]=ut[0]-hi[0],hi[1]=ht[0]-hi[1];else if(Va){var wi=+/w$/.test(Va),Ji=+/^n/.test(Va);_i=[ut[1-wi]-hi[0],ht[1-Ji]-hi[1]],hi[0]=ut[wi],hi[1]=ht[Ji]}else d.event.altKey&&(Zn=hi.slice());Ba.style("pointer-events","none").selectAll(".resize").style("display",null),d.select("body").style("cursor",Ta.style("cursor")),ka({type:"brushstart"}),Ms();function Vo(){d.event.keyCode==32&&(Wn||(Zn=null,hi[0]-=ut[1],hi[1]-=ht[1],Wn=2),Q())}function sl(){d.event.keyCode==32&&Wn==2&&(hi[0]+=ut[1],hi[1]+=ht[1],Wn=0,Q())}function Ms(){var Do=d.mouse(la),Es=!1;_i&&(Do[0]+=_i[0],Do[1]+=_i[1]),Wn||(d.event.altKey?(Zn||(Zn=[(ut[0]+ut[1])/2,(ht[0]+ht[1])/2]),hi[0]=ut[+(Do[0]0))return Ut;do Ut.push(ir=new Date(+At)),Re(At,Rt),ce(At);while(ir=St)for(;ce(St),!At(St);)St.setTime(St-1)},function(St,Rt){if(St>=St)if(Rt<0)for(;++Rt<=0;)for(;Re(St,-1),!At(St););else for(;--Rt>=0;)for(;Re(St,1),!At(St););})},$e&&(Je.count=function(At,St){return x.setTime(+At),A.setTime(+St),ce(x),ce(A),Math.floor($e(x,A))},Je.every=function(At){return At=Math.floor(At),!isFinite(At)||!(At>0)?null:At>1?Je.filter(rt?function(St){return rt(St)%At===0}:function(St){return Je.count(0,St)%At===0}):Je}),Je}var e=E(function(){},function(ce,Re){ce.setTime(+ce+Re)},function(ce,Re){return Re-ce});e.every=function(ce){return ce=Math.floor(ce),!isFinite(ce)||!(ce>0)?null:ce>1?E(function(Re){Re.setTime(Math.floor(Re/ce)*ce)},function(Re,$e){Re.setTime(+Re+$e*ce)},function(Re,$e){return($e-Re)/ce}):e};var t=e.range,r=1e3,o=6e4,a=36e5,i=864e5,n=6048e5,s=E(function(ce){ce.setTime(ce-ce.getMilliseconds())},function(ce,Re){ce.setTime(+ce+Re*r)},function(ce,Re){return(Re-ce)/r},function(ce){return ce.getUTCSeconds()}),c=s.range,f=E(function(ce){ce.setTime(ce-ce.getMilliseconds()-ce.getSeconds()*r)},function(ce,Re){ce.setTime(+ce+Re*o)},function(ce,Re){return(Re-ce)/o},function(ce){return ce.getMinutes()}),v=f.range,h=E(function(ce){ce.setTime(ce-ce.getMilliseconds()-ce.getSeconds()*r-ce.getMinutes()*o)},function(ce,Re){ce.setTime(+ce+Re*a)},function(ce,Re){return(Re-ce)/a},function(ce){return ce.getHours()}),T=h.range,l=E(function(ce){ce.setHours(0,0,0,0)},function(ce,Re){ce.setDate(ce.getDate()+Re)},function(ce,Re){return(Re-ce-(Re.getTimezoneOffset()-ce.getTimezoneOffset())*o)/i},function(ce){return ce.getDate()-1}),y=l.range;function b(ce){return E(function(Re){Re.setDate(Re.getDate()-(Re.getDay()+7-ce)%7),Re.setHours(0,0,0,0)},function(Re,$e){Re.setDate(Re.getDate()+$e*7)},function(Re,$e){return($e-Re-($e.getTimezoneOffset()-Re.getTimezoneOffset())*o)/n})}var S=b(0),M=b(1),_=b(2),w=b(3),p=b(4),u=b(5),g=b(6),m=S.range,R=M.range,P=_.range,z=w.range,F=p.range,B=u.range,O=g.range,L=E(function(ce){ce.setDate(1),ce.setHours(0,0,0,0)},function(ce,Re){ce.setMonth(ce.getMonth()+Re)},function(ce,Re){return Re.getMonth()-ce.getMonth()+(Re.getFullYear()-ce.getFullYear())*12},function(ce){return ce.getMonth()}),N=L.range,U=E(function(ce){ce.setMonth(0,1),ce.setHours(0,0,0,0)},function(ce,Re){ce.setFullYear(ce.getFullYear()+Re)},function(ce,Re){return Re.getFullYear()-ce.getFullYear()},function(ce){return ce.getFullYear()});U.every=function(ce){return!isFinite(ce=Math.floor(ce))||!(ce>0)?null:E(function(Re){Re.setFullYear(Math.floor(Re.getFullYear()/ce)*ce),Re.setMonth(0,1),Re.setHours(0,0,0,0)},function(Re,$e){Re.setFullYear(Re.getFullYear()+$e*ce)})};var Z=U.range,Q=E(function(ce){ce.setUTCSeconds(0,0)},function(ce,Re){ce.setTime(+ce+Re*o)},function(ce,Re){return(Re-ce)/o},function(ce){return ce.getUTCMinutes()}),ue=Q.range,oe=E(function(ce){ce.setUTCMinutes(0,0,0)},function(ce,Re){ce.setTime(+ce+Re*a)},function(ce,Re){return(Re-ce)/a},function(ce){return ce.getUTCHours()}),le=oe.range,j=E(function(ce){ce.setUTCHours(0,0,0,0)},function(ce,Re){ce.setUTCDate(ce.getUTCDate()+Re)},function(ce,Re){return(Re-ce)/i},function(ce){return ce.getUTCDate()-1}),J=j.range;function $(ce){return E(function(Re){Re.setUTCDate(Re.getUTCDate()-(Re.getUTCDay()+7-ce)%7),Re.setUTCHours(0,0,0,0)},function(Re,$e){Re.setUTCDate(Re.getUTCDate()+$e*7)},function(Re,$e){return($e-Re)/n})}var X=$(0),re=$(1),ee=$(2),q=$(3),ae=$(4),ie=$(5),fe=$(6),we=X.range,Ae=re.range,Fe=ee.range,Ce=q.range,qe=ae.range,et=ie.range,Qe=fe.range,Ke=E(function(ce){ce.setUTCDate(1),ce.setUTCHours(0,0,0,0)},function(ce,Re){ce.setUTCMonth(ce.getUTCMonth()+Re)},function(ce,Re){return Re.getUTCMonth()-ce.getUTCMonth()+(Re.getUTCFullYear()-ce.getUTCFullYear())*12},function(ce){return ce.getUTCMonth()}),Xe=Ke.range,Me=E(function(ce){ce.setUTCMonth(0,1),ce.setUTCHours(0,0,0,0)},function(ce,Re){ce.setUTCFullYear(ce.getUTCFullYear()+Re)},function(ce,Re){return Re.getUTCFullYear()-ce.getUTCFullYear()},function(ce){return ce.getUTCFullYear()});Me.every=function(ce){return!isFinite(ce=Math.floor(ce))||!(ce>0)?null:E(function(Re){Re.setUTCFullYear(Math.floor(Re.getUTCFullYear()/ce)*ce),Re.setUTCMonth(0,1),Re.setUTCHours(0,0,0,0)},function(Re,$e){Re.setUTCFullYear(Re.getUTCFullYear()+$e*ce)})};var xe=Me.range;d.timeDay=l,d.timeDays=y,d.timeFriday=u,d.timeFridays=B,d.timeHour=h,d.timeHours=T,d.timeInterval=E,d.timeMillisecond=e,d.timeMilliseconds=t,d.timeMinute=f,d.timeMinutes=v,d.timeMonday=M,d.timeMondays=R,d.timeMonth=L,d.timeMonths=N,d.timeSaturday=g,d.timeSaturdays=O,d.timeSecond=s,d.timeSeconds=c,d.timeSunday=S,d.timeSundays=m,d.timeThursday=p,d.timeThursdays=F,d.timeTuesday=_,d.timeTuesdays=P,d.timeWednesday=w,d.timeWednesdays=z,d.timeWeek=S,d.timeWeeks=m,d.timeYear=U,d.timeYears=Z,d.utcDay=j,d.utcDays=J,d.utcFriday=ie,d.utcFridays=et,d.utcHour=oe,d.utcHours=le,d.utcMillisecond=e,d.utcMilliseconds=t,d.utcMinute=Q,d.utcMinutes=ue,d.utcMonday=re,d.utcMondays=Ae,d.utcMonth=Ke,d.utcMonths=Xe,d.utcSaturday=fe,d.utcSaturdays=Qe,d.utcSecond=s,d.utcSeconds=c,d.utcSunday=X,d.utcSundays=we,d.utcThursday=ae,d.utcThursdays=qe,d.utcTuesday=ee,d.utcTuesdays=Fe,d.utcWednesday=q,d.utcWednesdays=Ce,d.utcWeek=X,d.utcWeeks=we,d.utcYear=Me,d.utcYears=xe,Object.defineProperty(d,"__esModule",{value:!0})})}}),Xl=He({"node_modules/d3-time-format/dist/d3-time-format.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y,Bf()):(d=d||self,x(d.d3=d.d3||{},d.d3))})(Y,function(d,x){function A(ze){if(0<=ze.y&&ze.y<100){var Ge=new Date(-1,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L);return Ge.setFullYear(ze.y),Ge}return new Date(ze.y,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L)}function E(ze){if(0<=ze.y&&ze.y<100){var Ge=new Date(Date.UTC(-1,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L));return Ge.setUTCFullYear(ze.y),Ge}return new Date(Date.UTC(ze.y,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L))}function e(ze,Ge,Oe){return{y:ze,m:Ge,d:Oe,H:0,M:0,S:0,L:0}}function t(ze){var Ge=ze.dateTime,Oe=ze.date,ve=ze.time,ge=ze.periods,be=ze.days,Pe=ze.shortDays,We=ze.months,ct=ze.shortMonths,_t=c(ge),Mt=f(ge),Nt=c(be),Bt=f(be),qt=c(Pe),Zt=f(Pe),lr=c(We),ta=f(We),da=c(ct),wa=f(ct),ma={a:Aa,A:Pa,b:sa,B:Oa,c:null,d:L,e:L,f:ue,H:N,I:U,j:Z,L:Q,m:oe,M:le,p:dt,q:vt,Q:St,s:Rt,S:j,u:J,U:$,V:X,w:re,W:ee,x:null,X:null,y:q,Y:ae,Z:ie,"%":At},Ia={a:Lr,A:Er,b:_r,B:yr,c:null,d:fe,e:fe,f:qe,H:we,I:Ae,j:Fe,L:Ce,m:et,M:Qe,p:kr,q:zr,Q:St,s:Rt,S:Ke,u:Xe,U:Me,V:xe,w:ce,W:Re,x:null,X:null,y:$e,Y:rt,Z:Je,"%":At},va={a:jt,A:Ot,b:gr,B:Br,c:na,d:p,e:p,f:z,H:g,I:g,j:u,L:P,m:w,M:m,p:Lt,q:_,Q:B,s:O,S:R,u:h,U:T,V:l,w:v,W:y,x:Ur,X:ga,y:S,Y:b,Z:M,"%":F};ma.x=La(Oe,ma),ma.X=La(ve,ma),ma.c=La(Ge,ma),Ia.x=La(Oe,Ia),Ia.X=La(ve,Ia),Ia.c=La(Ge,Ia);function La(Pr,Hr){return function(Zr){var Jr=[],wt=-1,Qt=0,mr=Pr.length,$r,oa,Sa;for(Zr instanceof Date||(Zr=new Date(+Zr));++wt53)return null;"w"in Jr||(Jr.w=1),"Z"in Jr?(Qt=E(e(Jr.y,0,1)),mr=Qt.getUTCDay(),Qt=mr>4||mr===0?x.utcMonday.ceil(Qt):x.utcMonday(Qt),Qt=x.utcDay.offset(Qt,(Jr.V-1)*7),Jr.y=Qt.getUTCFullYear(),Jr.m=Qt.getUTCMonth(),Jr.d=Qt.getUTCDate()+(Jr.w+6)%7):(Qt=A(e(Jr.y,0,1)),mr=Qt.getDay(),Qt=mr>4||mr===0?x.timeMonday.ceil(Qt):x.timeMonday(Qt),Qt=x.timeDay.offset(Qt,(Jr.V-1)*7),Jr.y=Qt.getFullYear(),Jr.m=Qt.getMonth(),Jr.d=Qt.getDate()+(Jr.w+6)%7)}else("W"in Jr||"U"in Jr)&&("w"in Jr||(Jr.w="u"in Jr?Jr.u%7:"W"in Jr?1:0),mr="Z"in Jr?E(e(Jr.y,0,1)).getUTCDay():A(e(Jr.y,0,1)).getDay(),Jr.m=0,Jr.d="W"in Jr?(Jr.w+6)%7+Jr.W*7-(mr+5)%7:Jr.w+Jr.U*7-(mr+6)%7);return"Z"in Jr?(Jr.H+=Jr.Z/100|0,Jr.M+=Jr.Z%100,E(Jr)):A(Jr)}}function Vt(Pr,Hr,Zr,Jr){for(var wt=0,Qt=Hr.length,mr=Zr.length,$r,oa;wt=mr)return-1;if($r=Hr.charCodeAt(wt++),$r===37){if($r=Hr.charAt(wt++),oa=va[$r in r?Hr.charAt(wt++):$r],!oa||(Jr=oa(Pr,Zr,Jr))<0)return-1}else if($r!=Zr.charCodeAt(Jr++))return-1}return Jr}function Lt(Pr,Hr,Zr){var Jr=_t.exec(Hr.slice(Zr));return Jr?(Pr.p=Mt[Jr[0].toLowerCase()],Zr+Jr[0].length):-1}function jt(Pr,Hr,Zr){var Jr=qt.exec(Hr.slice(Zr));return Jr?(Pr.w=Zt[Jr[0].toLowerCase()],Zr+Jr[0].length):-1}function Ot(Pr,Hr,Zr){var Jr=Nt.exec(Hr.slice(Zr));return Jr?(Pr.w=Bt[Jr[0].toLowerCase()],Zr+Jr[0].length):-1}function gr(Pr,Hr,Zr){var Jr=da.exec(Hr.slice(Zr));return Jr?(Pr.m=wa[Jr[0].toLowerCase()],Zr+Jr[0].length):-1}function Br(Pr,Hr,Zr){var Jr=lr.exec(Hr.slice(Zr));return Jr?(Pr.m=ta[Jr[0].toLowerCase()],Zr+Jr[0].length):-1}function na(Pr,Hr,Zr){return Vt(Pr,Ge,Hr,Zr)}function Ur(Pr,Hr,Zr){return Vt(Pr,Oe,Hr,Zr)}function ga(Pr,Hr,Zr){return Vt(Pr,ve,Hr,Zr)}function Aa(Pr){return Pe[Pr.getDay()]}function Pa(Pr){return be[Pr.getDay()]}function sa(Pr){return ct[Pr.getMonth()]}function Oa(Pr){return We[Pr.getMonth()]}function dt(Pr){return ge[+(Pr.getHours()>=12)]}function vt(Pr){return 1+~~(Pr.getMonth()/3)}function Lr(Pr){return Pe[Pr.getUTCDay()]}function Er(Pr){return be[Pr.getUTCDay()]}function _r(Pr){return ct[Pr.getUTCMonth()]}function yr(Pr){return We[Pr.getUTCMonth()]}function kr(Pr){return ge[+(Pr.getUTCHours()>=12)]}function zr(Pr){return 1+~~(Pr.getUTCMonth()/3)}return{format:function(Pr){var Hr=La(Pr+="",ma);return Hr.toString=function(){return Pr},Hr},parse:function(Pr){var Hr=Ka(Pr+="",!1);return Hr.toString=function(){return Pr},Hr},utcFormat:function(Pr){var Hr=La(Pr+="",Ia);return Hr.toString=function(){return Pr},Hr},utcParse:function(Pr){var Hr=Ka(Pr+="",!0);return Hr.toString=function(){return Pr},Hr}}}var r={"-":"",_:" ",0:"0"},o=/^\s*\d+/,a=/^%/,i=/[\\^$*+?|[\]().{}]/g;function n(ze,Ge,Oe){var ve=ze<0?"-":"",ge=(ve?-ze:ze)+"",be=ge.length;return ve+(be68?1900:2e3),Oe+ve[0].length):-1}function M(ze,Ge,Oe){var ve=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(Ge.slice(Oe,Oe+6));return ve?(ze.Z=ve[1]?0:-(ve[2]+(ve[3]||"00")),Oe+ve[0].length):-1}function _(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+1));return ve?(ze.q=ve[0]*3-3,Oe+ve[0].length):-1}function w(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+2));return ve?(ze.m=ve[0]-1,Oe+ve[0].length):-1}function p(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+2));return ve?(ze.d=+ve[0],Oe+ve[0].length):-1}function u(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+3));return ve?(ze.m=0,ze.d=+ve[0],Oe+ve[0].length):-1}function g(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+2));return ve?(ze.H=+ve[0],Oe+ve[0].length):-1}function m(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+2));return ve?(ze.M=+ve[0],Oe+ve[0].length):-1}function R(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+2));return ve?(ze.S=+ve[0],Oe+ve[0].length):-1}function P(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+3));return ve?(ze.L=+ve[0],Oe+ve[0].length):-1}function z(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+6));return ve?(ze.L=Math.floor(ve[0]/1e3),Oe+ve[0].length):-1}function F(ze,Ge,Oe){var ve=a.exec(Ge.slice(Oe,Oe+1));return ve?Oe+ve[0].length:-1}function B(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe));return ve?(ze.Q=+ve[0],Oe+ve[0].length):-1}function O(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe));return ve?(ze.s=+ve[0],Oe+ve[0].length):-1}function L(ze,Ge){return n(ze.getDate(),Ge,2)}function N(ze,Ge){return n(ze.getHours(),Ge,2)}function U(ze,Ge){return n(ze.getHours()%12||12,Ge,2)}function Z(ze,Ge){return n(1+x.timeDay.count(x.timeYear(ze),ze),Ge,3)}function Q(ze,Ge){return n(ze.getMilliseconds(),Ge,3)}function ue(ze,Ge){return Q(ze,Ge)+"000"}function oe(ze,Ge){return n(ze.getMonth()+1,Ge,2)}function le(ze,Ge){return n(ze.getMinutes(),Ge,2)}function j(ze,Ge){return n(ze.getSeconds(),Ge,2)}function J(ze){var Ge=ze.getDay();return Ge===0?7:Ge}function $(ze,Ge){return n(x.timeSunday.count(x.timeYear(ze)-1,ze),Ge,2)}function X(ze,Ge){var Oe=ze.getDay();return ze=Oe>=4||Oe===0?x.timeThursday(ze):x.timeThursday.ceil(ze),n(x.timeThursday.count(x.timeYear(ze),ze)+(x.timeYear(ze).getDay()===4),Ge,2)}function re(ze){return ze.getDay()}function ee(ze,Ge){return n(x.timeMonday.count(x.timeYear(ze)-1,ze),Ge,2)}function q(ze,Ge){return n(ze.getFullYear()%100,Ge,2)}function ae(ze,Ge){return n(ze.getFullYear()%1e4,Ge,4)}function ie(ze){var Ge=ze.getTimezoneOffset();return(Ge>0?"-":(Ge*=-1,"+"))+n(Ge/60|0,"0",2)+n(Ge%60,"0",2)}function fe(ze,Ge){return n(ze.getUTCDate(),Ge,2)}function we(ze,Ge){return n(ze.getUTCHours(),Ge,2)}function Ae(ze,Ge){return n(ze.getUTCHours()%12||12,Ge,2)}function Fe(ze,Ge){return n(1+x.utcDay.count(x.utcYear(ze),ze),Ge,3)}function Ce(ze,Ge){return n(ze.getUTCMilliseconds(),Ge,3)}function qe(ze,Ge){return Ce(ze,Ge)+"000"}function et(ze,Ge){return n(ze.getUTCMonth()+1,Ge,2)}function Qe(ze,Ge){return n(ze.getUTCMinutes(),Ge,2)}function Ke(ze,Ge){return n(ze.getUTCSeconds(),Ge,2)}function Xe(ze){var Ge=ze.getUTCDay();return Ge===0?7:Ge}function Me(ze,Ge){return n(x.utcSunday.count(x.utcYear(ze)-1,ze),Ge,2)}function xe(ze,Ge){var Oe=ze.getUTCDay();return ze=Oe>=4||Oe===0?x.utcThursday(ze):x.utcThursday.ceil(ze),n(x.utcThursday.count(x.utcYear(ze),ze)+(x.utcYear(ze).getUTCDay()===4),Ge,2)}function ce(ze){return ze.getUTCDay()}function Re(ze,Ge){return n(x.utcMonday.count(x.utcYear(ze)-1,ze),Ge,2)}function $e(ze,Ge){return n(ze.getUTCFullYear()%100,Ge,2)}function rt(ze,Ge){return n(ze.getUTCFullYear()%1e4,Ge,4)}function Je(){return"+0000"}function At(){return"%"}function St(ze){return+ze}function Rt(ze){return Math.floor(+ze/1e3)}var Ut;ir({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 ir(ze){return Ut=t(ze),d.timeFormat=Ut.format,d.timeParse=Ut.parse,d.utcFormat=Ut.utcFormat,d.utcParse=Ut.utcParse,Ut}var ar="%Y-%m-%dT%H:%M:%S.%LZ";function Mr(ze){return ze.toISOString()}var fr=Date.prototype.toISOString?Mr:d.utcFormat(ar);function dr(ze){var Ge=new Date(ze);return isNaN(Ge)?null:Ge}var pt=+new Date("2000-01-01T00:00:00.000Z")?dr:d.utcParse(ar);d.isoFormat=fr,d.isoParse=pt,d.timeFormatDefaultLocale=ir,d.timeFormatLocale=t,Object.defineProperty(d,"__esModule",{value:!0})})}}),co=He({"node_modules/d3-format/dist/d3-format.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y):(d=typeof globalThis<"u"?globalThis:d||self,x(d.d3=d.d3||{}))})(Y,function(d){function x(w){return Math.abs(w=Math.round(w))>=1e21?w.toLocaleString("en").replace(/,/g,""):w.toString(10)}function A(w,p){if((u=(w=p?w.toExponential(p-1):w.toExponential()).indexOf("e"))<0)return null;var u,g=w.slice(0,u);return[g.length>1?g[0]+g.slice(2):g,+w.slice(u+1)]}function E(w){return w=A(Math.abs(w)),w?w[1]:NaN}function e(w,p){return function(u,g){for(var m=u.length,R=[],P=0,z=w[0],F=0;m>0&&z>0&&(F+z+1>g&&(z=Math.max(1,g-F)),R.push(u.substring(m-=z,m+z)),!((F+=z+1)>g));)z=w[P=(P+1)%w.length];return R.reverse().join(p)}}function t(w){return function(p){return p.replace(/[0-9]/g,function(u){return w[+u]})}}var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(w){if(!(p=r.exec(w)))throw new Error("invalid format: "+w);var p;return new a({fill:p[1],align:p[2],sign:p[3],symbol:p[4],zero:p[5],width:p[6],comma:p[7],precision:p[8]&&p[8].slice(1),trim:p[9],type:p[10]})}o.prototype=a.prototype;function a(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+""}a.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function i(w){e:for(var p=w.length,u=1,g=-1,m;u0&&(g=0);break}return g>0?w.slice(0,g)+w.slice(m+1):w}var n;function s(w,p){var u=A(w,p);if(!u)return w+"";var g=u[0],m=u[1],R=m-(n=Math.max(-8,Math.min(8,Math.floor(m/3)))*3)+1,P=g.length;return R===P?g:R>P?g+new Array(R-P+1).join("0"):R>0?g.slice(0,R)+"."+g.slice(R):"0."+new Array(1-R).join("0")+A(w,Math.max(0,p+R-1))[0]}function c(w,p){var u=A(w,p);if(!u)return w+"";var g=u[0],m=u[1];return m<0?"0."+new Array(-m).join("0")+g:g.length>m+1?g.slice(0,m+1)+"."+g.slice(m+1):g+new Array(m-g.length+2).join("0")}var f={"%":function(w,p){return(w*100).toFixed(p)},b:function(w){return Math.round(w).toString(2)},c:function(w){return w+""},d:x,e:function(w,p){return w.toExponential(p)},f:function(w,p){return w.toFixed(p)},g:function(w,p){return w.toPrecision(p)},o:function(w){return Math.round(w).toString(8)},p:function(w,p){return c(w*100,p)},r:c,s,X:function(w){return Math.round(w).toString(16).toUpperCase()},x:function(w){return Math.round(w).toString(16)}};function v(w){return w}var h=Array.prototype.map,T=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function l(w){var p=w.grouping===void 0||w.thousands===void 0?v:e(h.call(w.grouping,Number),w.thousands+""),u=w.currency===void 0?"":w.currency[0]+"",g=w.currency===void 0?"":w.currency[1]+"",m=w.decimal===void 0?".":w.decimal+"",R=w.numerals===void 0?v:t(h.call(w.numerals,String)),P=w.percent===void 0?"%":w.percent+"",z=w.minus===void 0?"-":w.minus+"",F=w.nan===void 0?"NaN":w.nan+"";function B(L){L=o(L);var N=L.fill,U=L.align,Z=L.sign,Q=L.symbol,ue=L.zero,oe=L.width,le=L.comma,j=L.precision,J=L.trim,$=L.type;$==="n"?(le=!0,$="g"):f[$]||(j===void 0&&(j=12),J=!0,$="g"),(ue||N==="0"&&U==="=")&&(ue=!0,N="0",U="=");var X=Q==="$"?u:Q==="#"&&/[boxX]/.test($)?"0"+$.toLowerCase():"",re=Q==="$"?g:/[%p]/.test($)?P:"",ee=f[$],q=/[defgprs%]/.test($);j=j===void 0?6:/[gprs]/.test($)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function ae(ie){var fe=X,we=re,Ae,Fe,Ce;if($==="c")we=ee(ie)+we,ie="";else{ie=+ie;var qe=ie<0||1/ie<0;if(ie=isNaN(ie)?F:ee(Math.abs(ie),j),J&&(ie=i(ie)),qe&&+ie==0&&Z!=="+"&&(qe=!1),fe=(qe?Z==="("?Z:z:Z==="-"||Z==="("?"":Z)+fe,we=($==="s"?T[8+n/3]:"")+we+(qe&&Z==="("?")":""),q){for(Ae=-1,Fe=ie.length;++AeCe||Ce>57){we=(Ce===46?m+ie.slice(Ae+1):ie.slice(Ae))+we,ie=ie.slice(0,Ae);break}}}le&&!ue&&(ie=p(ie,1/0));var et=fe.length+ie.length+we.length,Qe=et>1)+fe+ie+we+Qe.slice(et);break;default:ie=Qe+fe+ie+we;break}return R(ie)}return ae.toString=function(){return L+""},ae}function O(L,N){var U=B((L=o(L),L.type="f",L)),Z=Math.max(-8,Math.min(8,Math.floor(E(N)/3)))*3,Q=Math.pow(10,-Z),ue=T[8+Z/3];return function(oe){return U(Q*oe)+ue}}return{format:B,formatPrefix:O}}var y;b({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function b(w){return y=l(w),d.format=y.format,d.formatPrefix=y.formatPrefix,y}function S(w){return Math.max(0,-E(Math.abs(w)))}function M(w,p){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(E(p)/3)))*3-E(Math.abs(w)))}function _(w,p){return w=Math.abs(w),p=Math.abs(p)-w,Math.max(0,E(p)-E(w))+1}d.FormatSpecifier=a,d.formatDefaultLocale=b,d.formatLocale=l,d.formatSpecifier=o,d.precisionFixed=S,d.precisionPrefix=M,d.precisionRound=_,Object.defineProperty(d,"__esModule",{value:!0})})}}),Ac=He({"node_modules/is-string-blank/index.js"(Y,G){G.exports=function(d){for(var x=d.length,A,E=0;E13)&&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}}}),Hi=He({"node_modules/fast-isnumeric/index.js"(Y,G){var d=Ac();G.exports=function(x){var A=typeof x;if(A==="string"){var E=x;if(x=+x,x===0&&d(E))return!1}else if(A!=="number")return!1;return x-x<1}}}),lo=He({"src/constants/numerical.js"(Y,G){G.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,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,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}}}),Uh=He({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y):(d=typeof globalThis<"u"?globalThis:d||self,x(d["base64-arraybuffer"]={}))})(Y,function(d){for(var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=typeof Uint8Array>"u"?[]:new Uint8Array(256),E=0;E>2],n+=x[(o[a]&3)<<4|o[a+1]>>4],n+=x[(o[a+1]&15)<<2|o[a+2]>>6],n+=x[o[a+2]&63];return i%3===2?n=n.substring(0,n.length-1)+"=":i%3===1&&(n=n.substring(0,n.length-2)+"=="),n},t=function(r){var o=r.length*.75,a=r.length,i,n=0,s,c,f,v;r[r.length-1]==="="&&(o--,r[r.length-2]==="="&&o--);var h=new ArrayBuffer(o),T=new Uint8Array(h);for(i=0;i>4,T[n++]=(c&15)<<4|f>>2,T[n++]=(f&3)<<6|v&63;return h};d.decode=t,d.encode=e,Object.defineProperty(d,"__esModule",{value:!0})})}}),Xh=He({"src/lib/is_plain_object.js"(Y,G){G.exports=function(x){return window&&window.process&&window.process.versions?Object.prototype.toString.call(x)==="[object Object]":Object.prototype.toString.call(x)==="[object Object]"&&Object.getPrototypeOf(x).hasOwnProperty("hasOwnProperty")}}}),ch=He({"src/lib/array.js"(Y){var G=Uh().decode,d=Xh(),x=Array.isArray,A=ArrayBuffer,E=DataView;function e(s){return A.isView(s)&&!(s instanceof E)}Y.isTypedArray=e;function t(s){return x(s)||e(s)}Y.isArrayOrTypedArray=t;function r(s){return!t(s[0])}Y.isArray1D=r,Y.ensureArray=function(s,c){return x(s)||(s=[]),s.length=c,s};var o={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};o.uint8c=o.u1c,o.uint8=o.u1,o.int8=o.i1,o.uint16=o.u2,o.int16=o.i2,o.uint32=o.u4,o.int32=o.i4,o.float32=o.f4,o.float64=o.f8;function a(s){return s.constructor===ArrayBuffer}Y.isArrayBuffer=a,Y.decodeTypedArraySpec=function(s){var c=[],f=i(s),v=f.dtype,h=o[v];if(!h)throw new Error('Error in dtype: "'+v+'"');var T=h.BYTES_PER_ELEMENT,l=f.bdata;a(l)||(l=G(l));var y=f.shape===void 0?[l.byteLength/T]:(""+f.shape).split(",");y.reverse();var b=y.length,S,M,_=+y[0],w=T*_,p=0;if(b===1)c=new h(l);else if(b===2)for(S=+y[1],M=0;M2)return h[S]=h[S]|e,y.set(b,null);if(l){for(c=S;c0)return Math.log(A)/Math.LN10;var e=Math.log(Math.min(E[0],E[1]))/Math.LN10;return d(e)||(e=Math.log(Math.max(E[0],E[1]))/Math.LN10-6),e}}}),rS=He({"src/lib/relink_private.js"(Y,G){var d=ch().isArrayOrTypedArray,x=Xh();G.exports=function A(E,e){for(var t in e){var r=e[t],o=E[t];if(o!==r)if(t.charAt(0)==="_"||typeof r=="function"){if(t in E)continue;E[t]=r}else if(d(r)&&d(o)&&x(r[0])){if(t==="customdata"||t==="ids")continue;for(var a=Math.min(r.length,o.length),i=0;iE/2?A-Math.round(A/E)*E:A}G.exports={mod:d,modHalf:x}}}),Mf=He({"node_modules/tinycolor2/tinycolor.js"(Y,G){(function(d){var x=/^\s+/,A=/\s+$/,E=0,e=d.round,t=d.min,r=d.max,o=d.random;function a(q,ae){if(q=q||"",ae=ae||{},q instanceof a)return q;if(!(this instanceof a))return new a(q,ae);var ie=i(q);this._originalInput=q,this._r=ie.r,this._g=ie.g,this._b=ie.b,this._a=ie.a,this._roundA=e(100*this._a)/100,this._format=ae.format||ie.format,this._gradientType=ae.gradientType,this._r<1&&(this._r=e(this._r)),this._g<1&&(this._g=e(this._g)),this._b<1&&(this._b=e(this._b)),this._ok=ie.ok,this._tc_id=E++}a.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 q=this.toRgb();return(q.r*299+q.g*587+q.b*114)/1e3},getLuminance:function(){var q=this.toRgb(),ae,ie,fe,we,Ae,Fe;return ae=q.r/255,ie=q.g/255,fe=q.b/255,ae<=.03928?we=ae/12.92:we=d.pow((ae+.055)/1.055,2.4),ie<=.03928?Ae=ie/12.92:Ae=d.pow((ie+.055)/1.055,2.4),fe<=.03928?Fe=fe/12.92:Fe=d.pow((fe+.055)/1.055,2.4),.2126*we+.7152*Ae+.0722*Fe},setAlpha:function(q){return this._a=L(q),this._roundA=e(100*this._a)/100,this},toHsv:function(){var q=f(this._r,this._g,this._b);return{h:q.h*360,s:q.s,v:q.v,a:this._a}},toHsvString:function(){var q=f(this._r,this._g,this._b),ae=e(q.h*360),ie=e(q.s*100),fe=e(q.v*100);return this._a==1?"hsv("+ae+", "+ie+"%, "+fe+"%)":"hsva("+ae+", "+ie+"%, "+fe+"%, "+this._roundA+")"},toHsl:function(){var q=s(this._r,this._g,this._b);return{h:q.h*360,s:q.s,l:q.l,a:this._a}},toHslString:function(){var q=s(this._r,this._g,this._b),ae=e(q.h*360),ie=e(q.s*100),fe=e(q.l*100);return this._a==1?"hsl("+ae+", "+ie+"%, "+fe+"%)":"hsla("+ae+", "+ie+"%, "+fe+"%, "+this._roundA+")"},toHex:function(q){return h(this._r,this._g,this._b,q)},toHexString:function(q){return"#"+this.toHex(q)},toHex8:function(q){return T(this._r,this._g,this._b,this._a,q)},toHex8String:function(q){return"#"+this.toHex8(q)},toRgb:function(){return{r:e(this._r),g:e(this._g),b:e(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+e(this._r)+", "+e(this._g)+", "+e(this._b)+")":"rgba("+e(this._r)+", "+e(this._g)+", "+e(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:e(N(this._r,255)*100)+"%",g:e(N(this._g,255)*100)+"%",b:e(N(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+e(N(this._r,255)*100)+"%, "+e(N(this._g,255)*100)+"%, "+e(N(this._b,255)*100)+"%)":"rgba("+e(N(this._r,255)*100)+"%, "+e(N(this._g,255)*100)+"%, "+e(N(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:B[h(this._r,this._g,this._b,!0)]||!1},toFilter:function(q){var ae="#"+l(this._r,this._g,this._b,this._a),ie=ae,fe=this._gradientType?"GradientType = 1, ":"";if(q){var we=a(q);ie="#"+l(we._r,we._g,we._b,we._a)}return"progid:DXImageTransform.Microsoft.gradient("+fe+"startColorstr="+ae+",endColorstr="+ie+")"},toString:function(q){var ae=!!q;q=q||this._format;var ie=!1,fe=this._a<1&&this._a>=0,we=!ae&&fe&&(q==="hex"||q==="hex6"||q==="hex3"||q==="hex4"||q==="hex8"||q==="name");return we?q==="name"&&this._a===0?this.toName():this.toRgbString():(q==="rgb"&&(ie=this.toRgbString()),q==="prgb"&&(ie=this.toPercentageRgbString()),(q==="hex"||q==="hex6")&&(ie=this.toHexString()),q==="hex3"&&(ie=this.toHexString(!0)),q==="hex4"&&(ie=this.toHex8String(!0)),q==="hex8"&&(ie=this.toHex8String()),q==="name"&&(ie=this.toName()),q==="hsl"&&(ie=this.toHslString()),q==="hsv"&&(ie=this.toHsvString()),ie||this.toHexString())},clone:function(){return a(this.toString())},_applyModification:function(q,ae){var ie=q.apply(null,[this].concat([].slice.call(ae)));return this._r=ie._r,this._g=ie._g,this._b=ie._b,this.setAlpha(ie._a),this},lighten:function(){return this._applyModification(M,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(y,arguments)},saturate:function(){return this._applyModification(b,arguments)},greyscale:function(){return this._applyModification(S,arguments)},spin:function(){return this._applyModification(p,arguments)},_applyCombination:function(q,ae){return q.apply(null,[this].concat([].slice.call(ae)))},analogous:function(){return this._applyCombination(P,arguments)},complement:function(){return this._applyCombination(u,arguments)},monochromatic:function(){return this._applyCombination(z,arguments)},splitcomplement:function(){return this._applyCombination(R,arguments)},triad:function(){return this._applyCombination(g,arguments)},tetrad:function(){return this._applyCombination(m,arguments)}},a.fromRatio=function(q,ae){if(typeof q=="object"){var ie={};for(var fe in q)q.hasOwnProperty(fe)&&(fe==="a"?ie[fe]=q[fe]:ie[fe]=le(q[fe]));q=ie}return a(q,ae)};function i(q){var ae={r:0,g:0,b:0},ie=1,fe=null,we=null,Ae=null,Fe=!1,Ce=!1;return typeof q=="string"&&(q=re(q)),typeof q=="object"&&(X(q.r)&&X(q.g)&&X(q.b)?(ae=n(q.r,q.g,q.b),Fe=!0,Ce=String(q.r).substr(-1)==="%"?"prgb":"rgb"):X(q.h)&&X(q.s)&&X(q.v)?(fe=le(q.s),we=le(q.v),ae=v(q.h,fe,we),Fe=!0,Ce="hsv"):X(q.h)&&X(q.s)&&X(q.l)&&(fe=le(q.s),Ae=le(q.l),ae=c(q.h,fe,Ae),Fe=!0,Ce="hsl"),q.hasOwnProperty("a")&&(ie=q.a)),ie=L(ie),{ok:Fe,format:q.format||Ce,r:t(255,r(ae.r,0)),g:t(255,r(ae.g,0)),b:t(255,r(ae.b,0)),a:ie}}function n(q,ae,ie){return{r:N(q,255)*255,g:N(ae,255)*255,b:N(ie,255)*255}}function s(q,ae,ie){q=N(q,255),ae=N(ae,255),ie=N(ie,255);var fe=r(q,ae,ie),we=t(q,ae,ie),Ae,Fe,Ce=(fe+we)/2;if(fe==we)Ae=Fe=0;else{var qe=fe-we;switch(Fe=Ce>.5?qe/(2-fe-we):qe/(fe+we),fe){case q:Ae=(ae-ie)/qe+(ae1&&(Ke-=1),Ke<1/6?et+(Qe-et)*6*Ke:Ke<1/2?Qe:Ke<2/3?et+(Qe-et)*(2/3-Ke)*6:et}if(ae===0)fe=we=Ae=ie;else{var Ce=ie<.5?ie*(1+ae):ie+ae-ie*ae,qe=2*ie-Ce;fe=Fe(qe,Ce,q+1/3),we=Fe(qe,Ce,q),Ae=Fe(qe,Ce,q-1/3)}return{r:fe*255,g:we*255,b:Ae*255}}function f(q,ae,ie){q=N(q,255),ae=N(ae,255),ie=N(ie,255);var fe=r(q,ae,ie),we=t(q,ae,ie),Ae,Fe,Ce=fe,qe=fe-we;if(Fe=fe===0?0:qe/fe,fe==we)Ae=0;else{switch(fe){case q:Ae=(ae-ie)/qe+(ae>1)+720)%360;--ae;)fe.h=(fe.h+we)%360,Ae.push(a(fe));return Ae}function z(q,ae){ae=ae||6;for(var ie=a(q).toHsv(),fe=ie.h,we=ie.s,Ae=ie.v,Fe=[],Ce=1/ae;ae--;)Fe.push(a({h:fe,s:we,v:Ae})),Ae=(Ae+Ce)%1;return Fe}a.mix=function(q,ae,ie){ie=ie===0?0:ie||50;var fe=a(q).toRgb(),we=a(ae).toRgb(),Ae=ie/100,Fe={r:(we.r-fe.r)*Ae+fe.r,g:(we.g-fe.g)*Ae+fe.g,b:(we.b-fe.b)*Ae+fe.b,a:(we.a-fe.a)*Ae+fe.a};return a(Fe)},a.readability=function(q,ae){var ie=a(q),fe=a(ae);return(d.max(ie.getLuminance(),fe.getLuminance())+.05)/(d.min(ie.getLuminance(),fe.getLuminance())+.05)},a.isReadable=function(q,ae,ie){var fe=a.readability(q,ae),we,Ae;switch(Ae=!1,we=ee(ie),we.level+we.size){case"AAsmall":case"AAAlarge":Ae=fe>=4.5;break;case"AAlarge":Ae=fe>=3;break;case"AAAsmall":Ae=fe>=7;break}return Ae},a.mostReadable=function(q,ae,ie){var fe=null,we=0,Ae,Fe,Ce,qe;ie=ie||{},Fe=ie.includeFallbackColors,Ce=ie.level,qe=ie.size;for(var et=0;etwe&&(we=Ae,fe=a(ae[et]));return a.isReadable(q,fe,{level:Ce,size:qe})||!Fe?fe:(ie.includeFallbackColors=!1,a.mostReadable(q,["#fff","#000"],ie))};var F=a.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"},B=a.hexNames=O(F);function O(q){var ae={};for(var ie in q)q.hasOwnProperty(ie)&&(ae[q[ie]]=ie);return ae}function L(q){return q=parseFloat(q),(isNaN(q)||q<0||q>1)&&(q=1),q}function N(q,ae){Q(q)&&(q="100%");var ie=ue(q);return q=t(ae,r(0,parseFloat(q))),ie&&(q=parseInt(q*ae,10)/100),d.abs(q-ae)<1e-6?1:q%ae/parseFloat(ae)}function U(q){return t(1,r(0,q))}function Z(q){return parseInt(q,16)}function Q(q){return typeof q=="string"&&q.indexOf(".")!=-1&&parseFloat(q)===1}function ue(q){return typeof q=="string"&&q.indexOf("%")!=-1}function oe(q){return q.length==1?"0"+q:""+q}function le(q){return q<=1&&(q=q*100+"%"),q}function j(q){return d.round(parseFloat(q)*255).toString(16)}function J(q){return Z(q)/255}var $=function(){var q="[-\\+]?\\d+%?",ae="[-\\+]?\\d*\\.\\d+%?",ie="(?:"+ae+")|(?:"+q+")",fe="[\\s|\\(]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")\\s*\\)?",we="[\\s|\\(]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")\\s*\\)?";return{CSS_UNIT:new RegExp(ie),rgb:new RegExp("rgb"+fe),rgba:new RegExp("rgba"+we),hsl:new RegExp("hsl"+fe),hsla:new RegExp("hsla"+we),hsv:new RegExp("hsv"+fe),hsva:new RegExp("hsva"+we),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 X(q){return!!$.CSS_UNIT.exec(q)}function re(q){q=q.replace(x,"").replace(A,"").toLowerCase();var ae=!1;if(F[q])q=F[q],ae=!0;else if(q=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ie;return(ie=$.rgb.exec(q))?{r:ie[1],g:ie[2],b:ie[3]}:(ie=$.rgba.exec(q))?{r:ie[1],g:ie[2],b:ie[3],a:ie[4]}:(ie=$.hsl.exec(q))?{h:ie[1],s:ie[2],l:ie[3]}:(ie=$.hsla.exec(q))?{h:ie[1],s:ie[2],l:ie[3],a:ie[4]}:(ie=$.hsv.exec(q))?{h:ie[1],s:ie[2],v:ie[3]}:(ie=$.hsva.exec(q))?{h:ie[1],s:ie[2],v:ie[3],a:ie[4]}:(ie=$.hex8.exec(q))?{r:Z(ie[1]),g:Z(ie[2]),b:Z(ie[3]),a:J(ie[4]),format:ae?"name":"hex8"}:(ie=$.hex6.exec(q))?{r:Z(ie[1]),g:Z(ie[2]),b:Z(ie[3]),format:ae?"name":"hex"}:(ie=$.hex4.exec(q))?{r:Z(ie[1]+""+ie[1]),g:Z(ie[2]+""+ie[2]),b:Z(ie[3]+""+ie[3]),a:J(ie[4]+""+ie[4]),format:ae?"name":"hex8"}:(ie=$.hex3.exec(q))?{r:Z(ie[1]+""+ie[1]),g:Z(ie[2]+""+ie[2]),b:Z(ie[3]+""+ie[3]),format:ae?"name":"hex"}:!1}function ee(q){var ae,ie;return q=q||{level:"AA",size:"small"},ae=(q.level||"AA").toUpperCase(),ie=(q.size||"small").toLowerCase(),ae!=="AA"&&ae!=="AAA"&&(ae="AA"),ie!=="small"&&ie!=="large"&&(ie="small"),{level:ae,size:ie}}typeof G<"u"&&G.exports?G.exports=a:window.tinycolor=a})(Math)}}),ho=He({"src/lib/extend.js"(Y){var G=Xh(),d=Array.isArray;function x(E,e){var t,r;for(t=0;t=0)))return a;if(f===3)s[f]>1&&(s[f]=1);else if(s[f]>=1)return a}var v=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return c?"rgba("+v+", "+s[3]+")":"rgb("+v+")"}}}),Bd=He({"src/constants/interactions.js"(Y,G){G.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}}),R0=He({"src/lib/regex.js"(Y){Y.counter=function(G,d,x,A){var E=(d||"")+(x?"":"$"),e=A===!1?"":"^";return G==="xy"?new RegExp(e+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+E):new RegExp(e+G+"([2-9]|[1-9][0-9]+)?"+E)}}}),aS=He({"src/lib/coerce.js"(Y){var G=Hi(),d=Mf(),x=ho().extendFlat,A=cl(),E=Ap(),e=Ai(),t=Bd().DESELECTDIM,r=Hg(),o=R0().counter,a=P0().modHalf,i=ch().isArrayOrTypedArray,n=ch().isTypedArraySpec,s=ch().decodeTypedArraySpec;Y.valObjectMeta={data_array:{coerceFunction:function(f,v,h){v.set(i(f)?f:n(f)?s(f):h)}},enumerated:{coerceFunction:function(f,v,h,T){T.coerceNumber&&(f=+f),T.values.indexOf(f)===-1?v.set(h):v.set(f)},validateFunction:function(f,v){v.coerceNumber&&(f=+f);for(var h=v.values,T=0;TT.max?v.set(h):v.set(+f)}},integer:{coerceFunction:function(f,v,h,T){if((T.extras||[]).indexOf(f)!==-1){v.set(f);return}n(f)&&(f=s(f)),f%1||!G(f)||T.min!==void 0&&fT.max?v.set(h):v.set(+f)}},string:{coerceFunction:function(f,v,h,T){if(typeof f!="string"){var l=typeof f=="number";T.strict===!0||!l?v.set(h):v.set(String(f))}else T.noBlank&&!f?v.set(h):v.set(f)}},color:{coerceFunction:function(f,v,h){n(f)&&(f=s(f)),d(f).isValid()?v.set(f):v.set(h)}},colorlist:{coerceFunction:function(f,v,h){function T(l){return d(l).isValid()}!Array.isArray(f)||!f.length?v.set(h):f.every(T)?v.set(f):v.set(h)}},colorscale:{coerceFunction:function(f,v,h){v.set(E.get(f,h))}},angle:{coerceFunction:function(f,v,h){n(f)&&(f=s(f)),f==="auto"?v.set("auto"):G(f)?v.set(a(+f,360)):v.set(h)}},subplotid:{coerceFunction:function(f,v,h,T){var l=T.regex||o(h);if(typeof f=="string"&&l.test(f)){v.set(f);return}v.set(h)},validateFunction:function(f,v){var h=v.dflt;return f===h?!0:typeof f!="string"?!1:!!o(h).test(f)}},flaglist:{coerceFunction:function(f,v,h,T){if((T.extras||[]).indexOf(f)!==-1){v.set(f);return}if(typeof f!="string"){v.set(h);return}for(var l=f.split("+"),y=0;y/g),f=0;f1){var e=["LOG:"];for(E=0;E1){var t=[];for(E=0;E"),"long")}},A.warn=function(){var E;if(d.logging>0){var e=["WARN:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}},A.error=function(){var E;if(d.logging>0){var e=["ERROR:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}}}}),Ym=He({"src/lib/noop.js"(Y,G){G.exports=function(){}}}),fb=He({"src/lib/push_unique.js"(Y,G){G.exports=function(x,A){if(A instanceof RegExp){for(var E=A.toString(),e=0;e0){for(var e=[],t=0;t=l&&F<=y?F:e}if(typeof F!="string"&&typeof F!="number")return e;F=String(F);var U=h(B),Z=F.charAt(0);U&&(Z==="G"||Z==="g")&&(F=F.substr(1),B="");var Q=U&&B.substr(0,7)==="chinese",ue=F.match(Q?f:c);if(!ue)return e;var oe=ue[1],le=ue[3]||"1",j=Number(ue[5]||1),J=Number(ue[7]||0),$=Number(ue[9]||0),X=Number(ue[11]||0);if(U){if(oe.length===2)return e;oe=Number(oe);var re;try{var ee=n.getComponentMethod("calendars","getCal")(B);if(Q){var q=le.charAt(le.length-1)==="i";le=parseInt(le,10),re=ee.newDate(oe,ee.toMonthIndex(oe,le,q),j)}else re=ee.newDate(oe,Number(le),j)}catch{return e}return re?(re.toJD()-i)*t+J*r+$*o+X*a:e}oe.length===2?oe=(Number(oe)+2e3-v)%100+v:oe=Number(oe),le-=1;var ae=new Date(Date.UTC(2e3,le,j,J,$));return ae.setUTCFullYear(oe),ae.getUTCMonth()!==le||ae.getUTCDate()!==j?e:ae.getTime()+X*a},l=Y.MIN_MS=Y.dateTime2ms("-9999"),y=Y.MAX_MS=Y.dateTime2ms("9999-12-31 23:59:59.9999"),Y.isDateTime=function(F,B){return Y.dateTime2ms(F,B)!==e};function b(F,B){return String(F+Math.pow(10,B)).substr(1)}var S=90*t,M=3*r,_=5*o;Y.ms2DateTime=function(F,B,O){if(typeof F!="number"||!(F>=l&&F<=y))return e;B||(B=0);var L=Math.floor(A(F+.05,1)*10),N=Math.round(F-L/10),U,Z,Q,ue,oe,le;if(h(O)){var j=Math.floor(N/t)+i,J=Math.floor(A(F,t));try{U=n.getComponentMethod("calendars","getCal")(O).fromJD(j).formatDate("yyyy-mm-dd")}catch{U=s("G%Y-%m-%d")(new Date(N))}if(U.charAt(0)==="-")for(;U.length<11;)U="-0"+U.substr(1);else for(;U.length<10;)U="0"+U;Z=B=l+t&&F<=y-t))return e;var B=Math.floor(A(F+.05,1)*10),O=new Date(Math.round(F-B/10)),L=G("%Y-%m-%d")(O),N=O.getHours(),U=O.getMinutes(),Z=O.getSeconds(),Q=O.getUTCMilliseconds()*10+B;return w(L,N,U,Z,Q)};function w(F,B,O,L,N){if((B||O||L||N)&&(F+=" "+b(B,2)+":"+b(O,2),(L||N)&&(F+=":"+b(L,2),N))){for(var U=4;N%10===0;)U-=1,N/=10;F+="."+b(N,U)}return F}Y.cleanDate=function(F,B,O){if(F===e)return B;if(Y.isJSDate(F)||typeof F=="number"&&isFinite(F)){if(h(O))return x.error("JS Dates and milliseconds are incompatible with world calendars",F),B;if(F=Y.ms2DateTimeLocal(+F),!F&&B!==void 0)return B}else if(!Y.isDateTime(F,O))return x.error("unrecognized date",F),B;return F};var p=/%\d?f/g,u=/%h/g,g={1:"1",2:"1",3:"2",4:"2"};function m(F,B,O,L){F=F.replace(p,function(U){var Z=Math.min(+U.charAt(1)||6,6),Q=(B/1e3%1+2).toFixed(Z).substr(2).replace(/0+$/,"")||"0";return Q});var N=new Date(Math.floor(B+.05));if(F=F.replace(u,function(){return g[O("%q")(N)]}),h(L))try{F=n.getComponentMethod("calendars","worldCalFmt")(F,B,L)}catch{return"Invalid"}return O(F)(N)}var R=[59,59.9,59.99,59.999,59.9999];function P(F,B){var O=A(F+.05,t),L=b(Math.floor(O/r),2)+":"+b(A(Math.floor(O/o),60),2);if(B!=="M"){d(B)||(B=0);var N=Math.min(A(F/a,60),R[B]),U=(100+N).toFixed(B).substr(1);B>0&&(U=U.replace(/0+$/,"").replace(/[\.]$/,"")),L+=":"+U}return L}Y.formatDate=function(F,B,O,L,N,U){if(N=h(N)&&N,!B)if(O==="y")B=U.year;else if(O==="m")B=U.month;else if(O==="d")B=U.dayMonth+` +`+U.year;else return P(F,O)+` +`+m(U.dayMonthYear,F,L,N);return m(B,F,L,N)};var z=3*t;Y.incrementMonth=function(F,B,O){O=h(O)&&O;var L=A(F,t);if(F=Math.round(F-L),O)try{var N=Math.round(F/t)+i,U=n.getComponentMethod("calendars","getCal")(O),Z=U.fromJD(N);return B%12?U.add(Z,B,"m"):U.add(Z,B/12,"y"),(Z.toJD()-i)*t+L}catch{x.error("invalid ms "+F+" in calendar "+O)}var Q=new Date(F+z);return Q.setUTCMonth(Q.getUTCMonth()+B)+L-z},Y.findExactDates=function(F,B){for(var O=0,L=0,N=0,U=0,Z,Q,ue=h(B)&&n.getComponentMethod("calendars","getCal")(B),oe=0;oe1?(i[c-1]-i[0])/(c-1):1,h,T;for(v>=0?T=n?e:t:T=n?o:r,a+=v*E*(n?-1:1)*(v>=0?1:-1);s90&&d.log("Long binary search..."),s-1};function e(a,i){return ai}function o(a,i){return a>=i}Y.sorterAsc=function(a,i){return a-i},Y.sorterDes=function(a,i){return i-a},Y.distinctVals=function(a){var i=a.slice();i.sort(Y.sorterAsc);var n;for(n=i.length-1;n>-1&&i[n]===A;n--);for(var s=i[n]-i[0]||1,c=s/(n||1)/1e4,f=[],v,h=0;h<=n;h++){var T=i[h],l=T-v;v===void 0?(f.push(T),v=T):l>c&&(s=Math.min(s,l),f.push(T),v=T)}return{vals:f,minDiff:s}},Y.roundUp=function(a,i,n){for(var s=0,c=i.length-1,f,v=0,h=n?0:1,T=n?1:0,l=n?Math.ceil:Math.floor;s0&&(s=1),n&&s)return a.sort(i)}return s?a:a.reverse()},Y.findIndexOfMin=function(a,i){i=i||x;for(var n=1/0,s,c=0;cE.length)&&(e=E.length),G(A)||(A=!1),d(E[0])){for(r=new Array(e),t=0;tx.length-1)return x[x.length-1];var E=A%1;return E*x[Math.ceil(A)]+(1-E)*x[Math.floor(A)]}}}),OS=He({"src/lib/angles.js"(Y,G){var d=P0(),x=d.mod,A=d.modHalf,E=Math.PI,e=2*E;function t(T){return T/180*E}function r(T){return T/E*180}function o(T){return Math.abs(T[1]-T[0])>e-1e-14}function a(T,l){return A(l-T,e)}function i(T,l){return Math.abs(a(T,l))}function n(T,l){if(o(l))return!0;var y,b;l[0]b&&(b+=e);var S=x(T,e),M=S+e;return S>=y&&S<=b||M>=y&&M<=b}function s(T,l,y,b){if(!n(l,b))return!1;var S,M;return y[0]=S&&T<=M}function c(T,l,y,b,S,M,_){S=S||0,M=M||0;var w=o([y,b]),p,u,g,m,R;w?(p=0,u=E,g=e):y1/3&&d.x<2/3},Y.isRightAnchor=function(d){return d.xanchor==="right"||d.xanchor==="auto"&&d.x>=2/3},Y.isTopAnchor=function(d){return d.yanchor==="top"||d.yanchor==="auto"&&d.y>=2/3},Y.isMiddleAnchor=function(d){return d.yanchor==="middle"||d.yanchor==="auto"&&d.y>1/3&&d.y<2/3},Y.isBottomAnchor=function(d){return d.yanchor==="bottom"||d.yanchor==="auto"&&d.y<=1/3}}}),NS=He({"src/lib/geometry2d.js"(Y){var G=P0().mod;Y.segmentsIntersect=d;function d(t,r,o,a,i,n,s,c){var f=o-t,v=i-t,h=s-i,T=a-r,l=n-r,y=c-n,b=f*y-h*T;if(b===0)return null;var S=(v*y-h*l)/b,M=(v*T-f*l)/b;return M<0||M>1||S<0||S>1?null:{x:t+f*S,y:r+T*S}}Y.segmentDistance=function(r,o,a,i,n,s,c,f){if(d(r,o,a,i,n,s,c,f))return 0;var v=a-r,h=i-o,T=c-n,l=f-s,y=v*v+h*h,b=T*T+l*l,S=Math.min(x(v,h,y,n-r,s-o),x(v,h,y,c-r,f-o),x(T,l,b,r-n,o-s),x(T,l,b,a-n,i-s));return Math.sqrt(S)};function x(t,r,o,a,i){var n=a*t+i*r;if(n<0)return a*a+i*i;if(n>o){var s=a-t,c=i-r;return s*s+c*c}else{var f=a*r-i*t;return f*f/o}}var A,E,e;Y.getTextLocation=function(r,o,a,i){if((r!==E||i!==e)&&(A={},E=r,e=i),A[a])return A[a];var n=r.getPointAtLength(G(a-i/2,o)),s=r.getPointAtLength(G(a+i/2,o)),c=Math.atan((s.y-n.y)/(s.x-n.x)),f=r.getPointAtLength(G(a,o)),v=(f.x*4+n.x+s.x)/6,h=(f.y*4+n.y+s.y)/6,T={x:v,y:h,theta:c};return A[a]=T,T},Y.clearLocationCache=function(){E=null},Y.getVisibleSegment=function(r,o,a){var i=o.left,n=o.right,s=o.top,c=o.bottom,f=0,v=r.getTotalLength(),h=v,T,l;function y(S){var M=r.getPointAtLength(S);S===0?T=M:S===v&&(l=M);var _=M.xn?M.x-n:0,w=M.yc?M.y-c:0;return Math.sqrt(_*_+w*w)}for(var b=y(f);b;){if(f+=b+a,f>h)return;b=y(f)}for(b=y(h);b;){if(h-=b+a,f>h)return;b=y(h)}return{min:f,max:h,len:h-f,total:v,isClosed:f===0&&h===v&&Math.abs(T.x-l.x)<.1&&Math.abs(T.y-l.y)<.1}},Y.findPointOnPath=function(r,o,a,i){i=i||{};for(var n=i.pathLength||r.getTotalLength(),s=i.tolerance||.001,c=i.iterationLimit||30,f=r.getPointAtLength(0)[a]>r.getPointAtLength(n)[a]?-1:1,v=0,h=0,T=n,l,y,b;v0?T=l:h=l,v++}return y}}}),e1=He({"src/lib/throttle.js"(Y){var G={};Y.throttle=function(A,E,e){var t=G[A],r=Date.now();if(!t){for(var o in G)G[o].tst.ts+E){a();return}t.timer=setTimeout(function(){a(),t.timer=null},E)},Y.done=function(x){var A=G[x];return!A||!A.timer?Promise.resolve():new Promise(function(E){var e=A.onDone;A.onDone=function(){e&&e(),E(),A.onDone=null}})},Y.clear=function(x){if(x)d(G[x]),delete G[x];else for(var A in G)Y.clear(A)};function d(x){x&&x.timer!==null&&(clearTimeout(x.timer),x.timer=null)}}}),US=He({"src/lib/clear_responsive.js"(Y,G){G.exports=function(x){x._responsiveChartHandler&&(window.removeEventListener("resize",x._responsiveChartHandler),delete x._responsiveChartHandler)}}}),jS=He({"node_modules/is-mobile/index.js"(Y,G){G.exports=E,G.exports.isMobile=E,G.exports.default=E;var d=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,x=/CrOS/,A=/android|ipad|playbook|silk/i;function E(e){e||(e={});let t=e.ua;if(!t&&typeof navigator<"u"&&(t=navigator.userAgent),t&&t.headers&&typeof t.headers["user-agent"]=="string"&&(t=t.headers["user-agent"]),typeof t!="string")return!1;let r=d.test(t)&&!x.test(t)||!!e.tablet&&A.test(t);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(r=!0),r}}}),VS=He({"src/lib/preserve_drawing_buffer.js"(Y,G){var d=Hi(),x=jS();G.exports=function(e){var t;if(e&&e.hasOwnProperty("userAgent")?t=e.userAgent:t=A(),typeof t!="string")return!0;var r=x({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var o=t.split(" "),a=1;a-1;n--){var s=o[n];if(s.substr(0,8)==="Version/"){var c=s.substr(8).split(".")[0];if(d(c)&&(c=+c),c>=13)return!0}}}return r};function A(){var E;return typeof navigator<"u"&&(E=navigator.userAgent),E&&E.headers&&typeof E.headers["user-agent"]=="string"&&(E=E.headers["user-agent"]),E}}}),qS=He({"src/lib/make_trace_groups.js"(Y,G){var d=Qn();G.exports=function(A,E,e){var t=A.selectAll("g."+e.replace(/\s/g,".")).data(E,function(o){return o[0].trace.uid});t.exit().remove(),t.enter().append("g").attr("class",e),t.order();var r=A.classed("rangeplot")?"nodeRangePlot3":"node3";return t.each(function(o){o[0][r]=d.select(this)}),t}}}),HS=He({"src/lib/localize.js"(Y,G){var d=Ei();G.exports=function(A,E){for(var e=A._context.locale,t=0;t<2;t++){for(var r=A._context.locales,o=0;o<2;o++){var a=(r[e]||{}).dictionary;if(a){var i=a[E];if(i)return i}r=d.localeRegistry}var n=e.split("-")[0];if(n===e)break;e=n}return E}}}),gb=He({"src/lib/filter_unique.js"(Y,G){G.exports=function(x){for(var A={},E=[],e=0,t=0;t1?(E*x+E*A)/E:x+A,t=String(e).length;if(t>16){var r=String(A).length,o=String(x).length;if(t>=o+r){var a=parseFloat(e).toPrecision(12);a.indexOf("e+")===-1&&(e=+a)}}return e}}}),ZS=He({"src/lib/clean_number.js"(Y,G){var d=Hi(),x=lo().BADNUM,A=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;G.exports=function(e){return typeof e=="string"&&(e=e.replace(A,"")),d(e)?Number(e):x}}}),Gr=He({"src/lib/index.js"(Y,G){var d=Qn(),x=Xl().utcFormat,A=co().format,E=Hi(),e=lo(),t=e.FP_SAFE,r=-t,o=e.BADNUM,a=G.exports={};a.adjustFormat=function(ee){return!ee||/^\d[.]\df/.test(ee)||/[.]\d%/.test(ee)?ee:ee==="0.f"?"~f":/^\d%/.test(ee)?"~%":/^\ds/.test(ee)?"~s":!/^[~,.0$]/.test(ee)&&/[&fps]/.test(ee)?"~"+ee:ee};var i={};a.warnBadFormat=function(re){var ee=String(re);i[ee]||(i[ee]=1,a.warn('encountered bad format: "'+ee+'"'))},a.noFormat=function(re){return String(re)},a.numberFormat=function(re){var ee;try{ee=A(a.adjustFormat(re))}catch{return a.warnBadFormat(re),a.noFormat}return ee},a.nestedProperty=Hg(),a.keyedContainer=eS(),a.relativeAttr=tS(),a.isPlainObject=Xh(),a.toLogRange=Xm(),a.relinkPrivateKeys=rS();var n=ch();a.isArrayBuffer=n.isArrayBuffer,a.isTypedArray=n.isTypedArray,a.isArrayOrTypedArray=n.isArrayOrTypedArray,a.isArray1D=n.isArray1D,a.ensureArray=n.ensureArray,a.concat=n.concat,a.maxRowLength=n.maxRowLength,a.minRowLength=n.minRowLength;var s=P0();a.mod=s.mod,a.modHalf=s.modHalf;var c=aS();a.valObjectMeta=c.valObjectMeta,a.coerce=c.coerce,a.coerce2=c.coerce2,a.coerceFont=c.coerceFont,a.coercePattern=c.coercePattern,a.coerceHoverinfo=c.coerceHoverinfo,a.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,a.validate=c.validate;var f=zS();a.dateTime2ms=f.dateTime2ms,a.isDateTime=f.isDateTime,a.ms2DateTime=f.ms2DateTime,a.ms2DateTimeLocal=f.ms2DateTimeLocal,a.cleanDate=f.cleanDate,a.isJSDate=f.isJSDate,a.formatDate=f.formatDate,a.incrementMonth=f.incrementMonth,a.dateTick0=f.dateTick0,a.dfltRange=f.dfltRange,a.findExactDates=f.findExactDates,a.MIN_MS=f.MIN_MS,a.MAX_MS=f.MAX_MS;var v=Qm();a.findBin=v.findBin,a.sorterAsc=v.sorterAsc,a.sorterDes=v.sorterDes,a.distinctVals=v.distinctVals,a.roundUp=v.roundUp,a.sort=v.sort,a.findIndexOfMin=v.findIndexOfMin,a.sortObjectKeys=Ud();var h=FS();a.aggNums=h.aggNums,a.len=h.len,a.mean=h.mean,a.geometricMean=h.geometricMean,a.median=h.median,a.midRange=h.midRange,a.variance=h.variance,a.stdev=h.stdev,a.interp=h.interp;var T=Km();a.init2dArray=T.init2dArray,a.transposeRagged=T.transposeRagged,a.dot=T.dot,a.translationMatrix=T.translationMatrix,a.rotationMatrix=T.rotationMatrix,a.rotationXYMatrix=T.rotationXYMatrix,a.apply3DTransform=T.apply3DTransform,a.apply2DTransform=T.apply2DTransform,a.apply2DTransform2=T.apply2DTransform2,a.convertCssMatrix=T.convertCssMatrix,a.inverseTransformMatrix=T.inverseTransformMatrix;var l=OS();a.deg2rad=l.deg2rad,a.rad2deg=l.rad2deg,a.angleDelta=l.angleDelta,a.angleDist=l.angleDist,a.isFullCircle=l.isFullCircle,a.isAngleInsideSector=l.isAngleInsideSector,a.isPtInsideSector=l.isPtInsideSector,a.pathArc=l.pathArc,a.pathSector=l.pathSector,a.pathAnnulus=l.pathAnnulus;var y=BS();a.isLeftAnchor=y.isLeftAnchor,a.isCenterAnchor=y.isCenterAnchor,a.isRightAnchor=y.isRightAnchor,a.isTopAnchor=y.isTopAnchor,a.isMiddleAnchor=y.isMiddleAnchor,a.isBottomAnchor=y.isBottomAnchor;var b=NS();a.segmentsIntersect=b.segmentsIntersect,a.segmentDistance=b.segmentDistance,a.getTextLocation=b.getTextLocation,a.clearLocationCache=b.clearLocationCache,a.getVisibleSegment=b.getVisibleSegment,a.findPointOnPath=b.findPointOnPath;var S=ho();a.extendFlat=S.extendFlat,a.extendDeep=S.extendDeep,a.extendDeepAll=S.extendDeepAll,a.extendDeepNoArrays=S.extendDeepNoArrays;var M=Nd();a.log=M.log,a.warn=M.warn,a.error=M.error;var _=R0();a.counterRegex=_.counter;var w=e1();a.throttle=w.throttle,a.throttleDone=w.done,a.clearThrottle=w.clear;var p=Wg();a.getGraphDiv=p.getGraphDiv,a.isPlotDiv=p.isPlotDiv,a.removeElement=p.removeElement,a.addStyleRule=p.addStyleRule,a.addRelatedStyleRule=p.addRelatedStyleRule,a.deleteRelatedStyleRule=p.deleteRelatedStyleRule,a.setStyleOnHover=p.setStyleOnHover,a.getFullTransformMatrix=p.getFullTransformMatrix,a.getElementTransformMatrix=p.getElementTransformMatrix,a.getElementAndAncestors=p.getElementAndAncestors,a.equalDomRects=p.equalDomRects,a.clearResponsive=US(),a.preserveDrawingBuffer=VS(),a.makeTraceGroups=qS(),a._=HS(),a.notifier=cb(),a.filterUnique=gb(),a.filterVisible=GS(),a.pushUnique=fb(),a.increment=WS(),a.cleanNumber=ZS(),a.ensureNumber=function(ee){return E(ee)?(ee=Number(ee),ee>t||ee=ee?!1:E(re)&&re>=0&&re%1===0},a.noop=Ym(),a.identity=Xg(),a.repeat=function(re,ee){for(var q=new Array(ee),ae=0;aeq?Math.max(q,Math.min(ee,re)):Math.max(ee,Math.min(q,re))},a.bBoxIntersect=function(re,ee,q){return q=q||0,re.left<=ee.right+q&&ee.left<=re.right+q&&re.top<=ee.bottom+q&&ee.top<=re.bottom+q},a.simpleMap=function(re,ee,q,ae,ie){for(var fe=re.length,we=new Array(fe),Ae=0;Ae=Math.pow(2,q)?ie>10?(a.warn("randstr failed uniqueness"),we):re(ee,q,ae,(ie||0)+1):we},a.OptionControl=function(re,ee){re||(re={}),ee||(ee="opt");var q={};return q.optionList=[],q._newoption=function(ae){ae[ee]=re,q[ae.name]=ae,q.optionList.push(ae)},q["_"+ee]=re,q},a.smooth=function(re,ee){if(ee=Math.round(ee)||0,ee<2)return re;var q=re.length,ae=2*q,ie=2*ee-1,fe=new Array(ie),we=new Array(q),Ae,Fe,Ce,qe;for(Ae=0;Ae=ae&&(Ce-=ae*Math.floor(Ce/ae)),Ce<0?Ce=-1-Ce:Ce>=q&&(Ce=ae-1-Ce),qe+=re[Ce]*fe[Fe];we[Ae]=qe}return we},a.syncOrAsync=function(re,ee,q){var ae,ie;function fe(){return a.syncOrAsync(re,ee,q)}for(;re.length;)if(ie=re.splice(0,1)[0],ae=ie(ee),ae&&ae.then)return ae.then(fe);return q&&q(ee)},a.stripTrailingSlash=function(re){return re.substr(-1)==="/"?re.substr(0,re.length-1):re},a.noneOrAll=function(re,ee,q){if(re){var ae=!1,ie=!0,fe,we;for(fe=0;fe0?ie:0})},a.fillArray=function(re,ee,q,ae){if(ae=ae||a.identity,a.isArrayOrTypedArray(re))for(var ie=0;ie1?ie+we[1]:"";if(fe&&(we.length>1||Ae.length>4||q))for(;ae.test(Ae);)Ae=Ae.replace(ae,"$1"+fe+"$2");return Ae+Fe},a.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var O=/^\w*$/;a.templateString=function(re,ee){var q={};return re.replace(a.TEMPLATE_STRING_REGEX,function(ae,ie){var fe;return O.test(ie)?fe=ee[ie]:(q[ie]=q[ie]||a.nestedProperty(ee,ie).get,fe=q[ie](!0)),fe!==void 0?fe:""})};var L={max:10,count:0,name:"hovertemplate"};a.hovertemplateString=function(){return oe.apply(L,arguments)};var N={max:10,count:0,name:"texttemplate"};a.texttemplateString=function(){return oe.apply(N,arguments)};var U=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function Z(re){var ee=re.match(U);return ee?{key:ee[1],op:ee[2],number:Number(ee[3])}:{key:re,op:null,number:null}}var Q={max:10,count:0,name:"texttemplate",parseMultDiv:!0};a.texttemplateStringForShapes=function(){return oe.apply(Q,arguments)};var ue=/^[:|\|]/;function oe(re,ee,q){var ae=this,ie=arguments;return ee||(ee={}),re.replace(a.TEMPLATE_STRING_REGEX,function(fe,we,Ae){var Fe=we==="xother"||we==="yother",Ce=we==="_xother"||we==="_yother",qe=we==="_xother_"||we==="_yother_",et=we==="xother_"||we==="yother_",Qe=Fe||Ce||et||qe,Ke=we;(Ce||qe)&&(Ke=Ke.substring(1)),(et||qe)&&(Ke=Ke.substring(0,Ke.length-1));var Xe=null,Me=null;if(ae.parseMultDiv){var xe=Z(Ke);Ke=xe.key,Xe=xe.op,Me=xe.number}var ce;if(Qe){if(ce=ee[Ke],ce===void 0)return""}else{var Re,$e;for($e=3;$e=le&&we<=j,Ce=Ae>=le&&Ae<=j;if(Fe&&(ae=10*ae+we-le),Ce&&(ie=10*ie+Ae-le),!Fe||!Ce){if(ae!==ie)return ae-ie;if(we!==Ae)return we-Ae}}return ie-ae};var J=2e9;a.seedPseudoRandom=function(){J=2e9},a.pseudoRandom=function(){var re=J;return J=(69069*J+1)%4294967296,Math.abs(J-re)<429496729?a.pseudoRandom():J/4294967296},a.fillText=function(re,ee,q){var ae=Array.isArray(q)?function(we){q.push(we)}:function(we){q.text=we},ie=a.extractOption(re,ee,"htx","hovertext");if(a.isValidTextValue(ie))return ae(ie);var fe=a.extractOption(re,ee,"tx","text");if(a.isValidTextValue(fe))return ae(fe)},a.isValidTextValue=function(re){return re||re===0},a.formatPercent=function(re,ee){ee=ee||0;for(var q=(Math.round(100*re*Math.pow(10,ee))*Math.pow(.1,ee)).toFixed(ee)+"%",ae=0;ae1&&(Ce=1):Ce=0,a.strTranslate(ie-Ce*(q+we),fe-Ce*(ae+Ae))+a.strScale(Ce)+(Fe?"rotate("+Fe+(ee?"":" "+q+" "+ae)+")":"")},a.setTransormAndDisplay=function(re,ee){re.attr("transform",a.getTextTransform(ee)),re.style("display",ee.scale?null:"none")},a.ensureUniformFontSize=function(re,ee){var q=a.extendFlat({},ee);return q.size=Math.max(ee.size,re._fullLayout.uniformtext.minsize||0),q},a.join2=function(re,ee,q){var ae=re.length;return ae>1?re.slice(0,-1).join(ee)+q+re[ae-1]:re.join(ee)},a.bigFont=function(re){return Math.round(1.2*re)};var $=a.getFirefoxVersion(),X=$!==null&&$<86;a.getPositionFromD3Event=function(){return X?[d.event.layerX,d.event.layerY]:[d.event.offsetX,d.event.offsetY]}}}),XS=He({"build/plotcss.js"(){var Y=Gr(),G={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(x in G)d=x.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),Y.addStyleRule(d,G[x]);var d,x}}),yb=He({"node_modules/is-browser/client.js"(Y,G){G.exports=!0}}),mb=He({"node_modules/has-hover/index.js"(Y,G){var d=yb(),x;typeof window.matchMedia=="function"?x=!window.matchMedia("(hover: none)").matches:x=d,G.exports=x}}),Mp=He({"node_modules/events/events.js"(Y,G){var d=typeof Reflect=="object"?Reflect:null,x=d&&typeof d.apply=="function"?d.apply:function(M,_,w){return Function.prototype.apply.call(M,_,w)},A;d&&typeof d.ownKeys=="function"?A=d.ownKeys:Object.getOwnPropertySymbols?A=function(M){return Object.getOwnPropertyNames(M).concat(Object.getOwnPropertySymbols(M))}:A=function(M){return Object.getOwnPropertyNames(M)};function E(S){console&&console.warn&&console.warn(S)}var e=Number.isNaN||function(M){return M!==M};function t(){t.init.call(this)}G.exports=t,G.exports.once=l,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var r=10;function o(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(S){if(typeof S!="number"||S<0||e(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");r=S}}),t.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(M){if(typeof M!="number"||M<0||e(M))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+M+".");return this._maxListeners=M,this};function a(S){return S._maxListeners===void 0?t.defaultMaxListeners:S._maxListeners}t.prototype.getMaxListeners=function(){return a(this)},t.prototype.emit=function(M){for(var _=[],w=1;w0&&(g=_[0]),g instanceof Error)throw g;var m=new Error("Unhandled error."+(g?" ("+g.message+")":""));throw m.context=g,m}var R=u[M];if(R===void 0)return!1;if(typeof R=="function")x(R,this,_);else for(var P=R.length,z=v(R,P),w=0;w0&&g.length>p&&!g.warned){g.warned=!0;var m=new Error("Possible EventEmitter memory leak detected. "+g.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");m.name="MaxListenersExceededWarning",m.emitter=S,m.type=M,m.count=g.length,E(m)}return S}t.prototype.addListener=function(M,_){return i(this,M,_,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(M,_){return i(this,M,_,!0)};function n(){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 s(S,M,_){var w={fired:!1,wrapFn:void 0,target:S,type:M,listener:_},p=n.bind(w);return p.listener=_,w.wrapFn=p,p}t.prototype.once=function(M,_){return o(_),this.on(M,s(this,M,_)),this},t.prototype.prependOnceListener=function(M,_){return o(_),this.prependListener(M,s(this,M,_)),this},t.prototype.removeListener=function(M,_){var w,p,u,g,m;if(o(_),p=this._events,p===void 0)return this;if(w=p[M],w===void 0)return this;if(w===_||w.listener===_)--this._eventsCount===0?this._events=Object.create(null):(delete p[M],p.removeListener&&this.emit("removeListener",M,w.listener||_));else if(typeof w!="function"){for(u=-1,g=w.length-1;g>=0;g--)if(w[g]===_||w[g].listener===_){m=w[g].listener,u=g;break}if(u<0)return this;u===0?w.shift():h(w,u),w.length===1&&(p[M]=w[0]),p.removeListener!==void 0&&this.emit("removeListener",M,m||_)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(M){var _,w,p;if(w=this._events,w===void 0)return this;if(w.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):w[M]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete w[M]),this;if(arguments.length===0){var u=Object.keys(w),g;for(p=0;p=0;p--)this.removeListener(M,_[p]);return this};function c(S,M,_){var w=S._events;if(w===void 0)return[];var p=w[M];return p===void 0?[]:typeof p=="function"?_?[p.listener||p]:[p]:_?T(p):v(p,p.length)}t.prototype.listeners=function(M){return c(this,M,!0)},t.prototype.rawListeners=function(M){return c(this,M,!1)},t.listenerCount=function(S,M){return typeof S.listenerCount=="function"?S.listenerCount(M):f.call(S,M)},t.prototype.listenerCount=f;function f(S){var M=this._events;if(M!==void 0){var _=M[S];if(typeof _=="function")return 1;if(_!==void 0)return _.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]};function v(S,M){for(var _=new Array(M),w=0;wx.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--)},E.startSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},E.stopSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},E.undo=function(t){var r,o;if(!(t.undoQueue===void 0||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=t.undoQueue.queue.length)){for(r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=L.length)return!1;if(P.dimensions===2){if(F++,z.length===F)return P;var N=z[F];if(!b(N))return!1;P=L[O][N]}else P=L[O]}else P=L}}return P}function b(P){return P===Math.round(P)&&P>=0}function S(P){var z,F;z=G.modules[P]._module,F=z.basePlotModule;var B={};B.type=null;var O=o({},x),L=o({},z.attributes);Y.crawl(L,function(Z,Q,ue,oe,le){n(O,le).set(void 0),Z===void 0&&n(L,le).set(void 0)}),o(B,O),G.traceIs(P,"noOpacity")&&delete B.opacity,G.traceIs(P,"showLegend")||(delete B.showlegend,delete B.legendgroup),G.traceIs(P,"noHover")&&(delete B.hoverinfo,delete B.hoverlabel),z.selectPoints||delete B.selectedpoints,o(B,L),F.attributes&&o(B,F.attributes),B.type=P;var N={meta:z.meta||{},categories:z.categories||{},animatable:!!z.animatable,type:P,attributes:w(B)};if(z.layoutAttributes){var U={};o(U,z.layoutAttributes),N.layoutAttributes=w(U)}return z.animatable||Y.crawl(N,function(Z){Y.isValObject(Z)&&"anim"in Z&&delete Z.anim}),N}function M(){var P={},z,F;o(P,A);for(z in G.subplotsRegistry)if(F=G.subplotsRegistry[z],!!F.layoutAttributes)if(Array.isArray(F.attr))for(var B=0;B=a&&(o._input||{})._templateitemname;n&&(i=a);var s=r+"["+i+"]",c;function f(){c={},n&&(c[s]={},c[s][x]=n)}f();function v(y,b){c[y]=b}function h(y,b){n?G.nestedProperty(c[s],y).set(b):c[s+"."+y]=b}function T(){var y=c;return f(),y}function l(y,b){y&&h(y,b);var S=T();for(var M in S)G.nestedProperty(t,M).set(S[M])}return{modifyBase:v,modifyItem:h,getUpdateObj:T,applyUpdate:l}}}}),Ef=He({"src/plots/cartesian/constants.js"(Y,G){var d=R0().counter;G.exports={idRegex:{x:d("x","( domain)?"),y:d("y","( domain)?")},attrRegex:d("[xy]axis"),xAxisMatch:d("xaxis"),yAxisMatch:d("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),oc=He({"src/plots/cartesian/axis_ids.js"(Y){var G=Ei(),d=Ef();Y.id2name=function(E){if(!(typeof E!="string"||!E.match(d.AX_ID_PATTERN))){var e=E.split(" ")[0].substr(1);return e==="1"&&(e=""),E.charAt(0)+"axis"+e}},Y.name2id=function(E){if(E.match(d.AX_NAME_PATTERN)){var e=E.substr(5);return e==="1"&&(e=""),E.charAt(0)+e}},Y.cleanId=function(E,e,t){var r=/( domain)$/.test(E);if(!(typeof E!="string"||!E.match(d.AX_ID_PATTERN))&&!(e&&E.charAt(0)!==e)&&!(r&&!t)){var o=E.split(" ")[0].substr(1).replace(/^0+/,"");return o==="1"&&(o=""),E.charAt(0)+o+(r&&t?" domain":"")}},Y.list=function(A,E,e){var t=A._fullLayout;if(!t)return[];var r=Y.listIds(A,E),o=new Array(r.length),a;for(a=0;at?1:-1:+(A.substr(1)||1)-+(E.substr(1)||1)},Y.ref2id=function(A){return/^[xyz]/.test(A)?A.split(" ")[0]:!1};function x(A,E){if(E&&E.length){for(var e=0;e0?".":"")+n;d.isPlainObject(s)?t(s,o,c,i+1):o(c,n,s)}})}}}),yu=He({"src/plots/plots.js"(Y,G){var d=Qn(),x=Xl().timeFormatLocale,A=co().formatLocale,E=Hi(),e=Uh(),t=Ei(),r=F0(),o=Gs(),a=Gr(),i=Ai(),n=lo().BADNUM,s=oc(),c=jd().clearOutline,f=t1(),v=Zg(),h=_b(),T=Uf().getModuleCalcData,l=a.relinkPrivateKeys,y=a._,b=G.exports={};a.extendFlat(b,t),b.attributes=cl(),b.attributes.type.values=b.allTypes,b.fontAttrs=Yl(),b.layoutAttributes=D0();var S=KS();b.executeAPICommand=S.executeAPICommand,b.computeAPICommandBindings=S.computeAPICommandBindings,b.manageCommandObserver=S.manageCommandObserver,b.hasSimpleAPICommandBindings=S.hasSimpleAPICommandBindings,b.redrawText=function(j){return j=a.getGraphDiv(j),new Promise(function(J){setTimeout(function(){j._fullLayout&&(t.getComponentMethod("annotations","draw")(j),t.getComponentMethod("legend","draw")(j),t.getComponentMethod("colorbar","draw")(j),J(b.previousPromises(j)))},300)})},b.resize=function(j){j=a.getGraphDiv(j);var J,$=new Promise(function(X,re){(!j||a.isHidden(j))&&re(new Error("Resize must be passed a displayed plot div element.")),j._redrawTimer&&clearTimeout(j._redrawTimer),j._resolveResize&&(J=j._resolveResize),j._resolveResize=X,j._redrawTimer=setTimeout(function(){if(!j.layout||j.layout.width&&j.layout.height||a.isHidden(j)){X(j);return}delete j.layout.width,delete j.layout.height;var ee=j.changed;j.autoplay=!0,t.call("relayout",j,{autosize:!0}).then(function(){j.changed=ee,j._resolveResize===X&&(delete j._resolveResize,X(j))})},100)});return J&&J($),$},b.previousPromises=function(j){if((j._promises||[]).length)return Promise.all(j._promises).then(function(){j._promises=[]})},b.addLinks=function(j){if(!(!j._context.showLink&&!j._context.showSources)){var J=j._fullLayout,$=a.ensureSingle(J._paper,"text","js-plot-link-container",function(ie){ie.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:i.defaultLine,"pointer-events":"all"}).each(function(){var fe=d.select(this);fe.append("tspan").classed("js-link-to-tool",!0),fe.append("tspan").classed("js-link-spacer",!0),fe.append("tspan").classed("js-sourcelinks",!0)})}),X=$.node(),re={y:J._paper.attr("height")-9};document.body.contains(X)&&X.getComputedTextLength()>=J.width-20?(re["text-anchor"]="start",re.x=5):(re["text-anchor"]="end",re.x=J._paper.attr("width")-7),$.attr(re);var ee=$.select(".js-link-to-tool"),q=$.select(".js-link-spacer"),ae=$.select(".js-sourcelinks");j._context.showSources&&j._context.showSources(j),j._context.showLink&&M(j,ee),q.text(ee.text()&&ae.text()?" - ":"")}};function M(j,J){J.text("");var $=J.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(j._context.linkText+" »");if(j._context.sendData)$.on("click",function(){b.sendDataToCloud(j)});else{var X=window.location.pathname.split("/"),re=window.location.search;$.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+X[2].split(".")[0]+"/"+X[1]+re})}}b.sendDataToCloud=function(j){var J=(window.PLOTLYENV||{}).BASE_URL||j._context.plotlyServerURL;if(J){j.emit("plotly_beforeexport");var $=d.select(j).append("div").attr("id","hiddenform").style("display","none"),X=$.append("form").attr({action:J+"/external",method:"post",target:"_blank"}),re=X.append("input").attr({type:"text",name:"data"});return re.node().value=b.graphJson(j,!1,"keepdata"),X.node().submit(),$.remove(),j.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];b.supplyDefaults=function(j,J){var $=J&&J.skipUpdateCalc,X=j._fullLayout||{};if(X._skipDefaults){delete X._skipDefaults;return}var re=j._fullLayout={},ee=j.layout||{},q=j._fullData||[],ae=j._fullData=[],ie=j.data||[],fe=j.calcdata||[],we=j._context||{},Ae;j._transitionData||b.createTransitionData(j),re._dfltTitle={plot:y(j,"Click to enter Plot title"),subtitle:y(j,"Click to enter Plot subtitle"),x:y(j,"Click to enter X axis title"),y:y(j,"Click to enter Y axis title"),colorbar:y(j,"Click to enter Colorscale title"),annotation:y(j,"new text")},re._traceWord=y(j,"trace");var Fe=g(j,_);if(re._mapboxAccessToken=we.mapboxAccessToken,X._initialAutoSizeIsDone){var Ce=X.width,qe=X.height;b.supplyLayoutGlobalDefaults(ee,re,Fe),ee.width||(re.width=Ce),ee.height||(re.height=qe),b.sanitizeMargins(re)}else{b.supplyLayoutGlobalDefaults(ee,re,Fe);var et=!ee.width||!ee.height,Qe=re.autosize,Ke=we.autosizable,Xe=et&&(Qe||Ke);Xe?b.plotAutoSize(j,ee,re):et&&b.sanitizeMargins(re),!Qe&&et&&(ee.width=re.width,ee.height=re.height)}re._d3locale=m(Fe,re.separators),re._extraFormat=g(j,w),re._initialAutoSizeIsDone=!0,re._dataLength=ie.length,re._modules=[],re._visibleModules=[],re._basePlotModules=[];var Me=re._subplots=u(),xe=re._splomAxes={x:{},y:{}},ce=re._splomSubplots={};re._splomGridDflt={},re._scatterStackOpts={},re._firstScatter={},re._alignmentOpts={},re._colorAxes={},re._requestRangeslider={},re._traceUids=p(q,ie),b.supplyDataDefaults(ie,ae,ee,re);var Re=Object.keys(xe.x),$e=Object.keys(xe.y);if(Re.length>1&&$e.length>1){for(t.getComponentMethod("grid","sizeDefaults")(ee,re),Ae=0;Ae15&&$e.length>15&&re.shapes.length===0&&re.images.length===0,b.linkSubplots(ae,re,q,X),b.cleanPlot(ae,re,q,X);var Rt=!!(X._has&&X._has("cartesian")),Ut=!!(re._has&&re._has("cartesian")),ir=Rt,ar=Ut;ir&&!ar?X._bgLayer.remove():ar&&!ir&&(re._shouldCreateBgLayer=!0),X._zoomlayer&&!j._dragging&&c({_fullLayout:X}),R(ae,re),l(re,X),t.getComponentMethod("colorscale","crossTraceDefaults")(ae,re),re._preGUI||(re._preGUI={}),re._tracePreGUI||(re._tracePreGUI={});var Mr=re._tracePreGUI,fr={},dr;for(dr in Mr)fr[dr]="old";for(Ae=0;Ae0){var we=1-2*ee;q=Math.round(we*q),ae=Math.round(we*ae)}}var Ae=b.layoutAttributes.width.min,Fe=b.layoutAttributes.height.min;q1,qe=!$.height&&Math.abs(X.height-ae)>1;(qe||Ce)&&(Ce&&(X.width=q),qe&&(X.height=ae)),J._initialAutoSize||(J._initialAutoSize={width:q,height:ae}),b.sanitizeMargins(X)},b.supplyLayoutModuleDefaults=function(j,J,$,X){var re=t.componentsRegistry,ee=J._basePlotModules,q,ae,ie,fe=t.subplotsRegistry.cartesian;for(q in re)ie=re[q],ie.includeBasePlot&&ie.includeBasePlot(j,J);ee.length||ee.push(fe),J._has("cartesian")&&(t.getComponentMethod("grid","contentDefaults")(j,J),fe.finalizeSubplots(j,J));for(var we in J._subplots)J._subplots[we].sort(a.subplotSort);for(ae=0;ae1&&($.l/=Qe,$.r/=Qe)}if(Fe){var Ke=($.t+$.b)/Fe;Ke>1&&($.t/=Ke,$.b/=Ke)}var Xe=$.xl!==void 0?$.xl:$.x,Me=$.xr!==void 0?$.xr:$.x,xe=$.yt!==void 0?$.yt:$.y,ce=$.yb!==void 0?$.yb:$.y;Ce[J]={l:{val:Xe,size:$.l+et},r:{val:Me,size:$.r+et},b:{val:ce,size:$.b+et},t:{val:xe,size:$.t+et}},qe[J]=1}if(!X._replotting)return b.doAutoMargin(j)}};function L(j){if("_redrawFromAutoMarginCount"in j._fullLayout)return!1;var J=s.list(j,"",!0);for(var $ in J)if(J[$].autoshift||J[$].shift)return!0;return!1}b.doAutoMargin=function(j){var J=j._fullLayout,$=J.width,X=J.height;J._size||(J._size={}),F(J);var re=J._size,ee=J.margin,q={t:0,b:0,l:0,r:0},ae=a.extendFlat({},re),ie=ee.l,fe=ee.r,we=ee.t,Ae=ee.b,Fe=J._pushmargin,Ce=J._pushmarginIds,qe=J.minreducedwidth,et=J.minreducedheight;if(ee.autoexpand!==!1){for(var Qe in Fe)Ce[Qe]||delete Fe[Qe];var Ke=j._fullLayout._reservedMargin;for(var Xe in Ke)for(var Me in Ke[Xe]){var xe=Ke[Xe][Me];q[Me]=Math.max(q[Me],xe)}Fe.base={l:{val:0,size:ie},r:{val:1,size:fe},t:{val:1,size:we},b:{val:0,size:Ae}};for(var ce in q){var Re=0;for(var $e in Fe)$e!=="base"&&E(Fe[$e][ce].size)&&(Re=Fe[$e][ce].size>Re?Fe[$e][ce].size:Re);var rt=Math.max(0,ee[ce]-Re);q[ce]=Math.max(0,q[ce]-rt)}for(var Je in Fe){var At=Fe[Je].l||{},St=Fe[Je].b||{},Rt=At.val,Ut=At.size,ir=St.val,ar=St.size,Mr=$-q.r-q.l,fr=X-q.t-q.b;for(var dr in Fe){if(E(Ut)&&Fe[dr].r){var pt=Fe[dr].r.val,ze=Fe[dr].r.size;if(pt>Rt){var Ge=(Ut*pt+(ze-Mr)*Rt)/(pt-Rt),Oe=(ze*(1-Rt)+(Ut-Mr)*(1-pt))/(pt-Rt);Ge+Oe>ie+fe&&(ie=Ge,fe=Oe)}}if(E(ar)&&Fe[dr].t){var ve=Fe[dr].t.val,ge=Fe[dr].t.size;if(ve>ir){var be=(ar*ve+(ge-fr)*ir)/(ve-ir),Pe=(ge*(1-ir)+(ar-fr)*(1-ve))/(ve-ir);be+Pe>Ae+we&&(Ae=be,we=Pe)}}}}}var We=a.constrain($-ee.l-ee.r,B,qe),ct=a.constrain(X-ee.t-ee.b,O,et),_t=Math.max(0,$-We),Mt=Math.max(0,X-ct);if(_t){var Nt=(ie+fe)/_t;Nt>1&&(ie/=Nt,fe/=Nt)}if(Mt){var Bt=(Ae+we)/Mt;Bt>1&&(Ae/=Bt,we/=Bt)}if(re.l=Math.round(ie)+q.l,re.r=Math.round(fe)+q.r,re.t=Math.round(we)+q.t,re.b=Math.round(Ae)+q.b,re.p=Math.round(ee.pad),re.w=Math.round($)-re.l-re.r,re.h=Math.round(X)-re.t-re.b,!J._replotting&&(b.didMarginChange(ae,re)||L(j))){"_redrawFromAutoMarginCount"in J?J._redrawFromAutoMarginCount++:J._redrawFromAutoMarginCount=1;var qt=3*(1+Object.keys(Ce).length);if(J._redrawFromAutoMarginCount1)return!0}return!1},b.graphJson=function(j,J,$,X,re,ee){(re&&J&&!j._fullData||re&&!J&&!j._fullLayout)&&b.supplyDefaults(j);var q=re?j._fullData:j.data,ae=re?j._fullLayout:j.layout,ie=(j._transitionData||{})._frames;function fe(Fe,Ce){if(typeof Fe=="function")return Ce?"_function_":null;if(a.isPlainObject(Fe)){var qe={},et;return Object.keys(Fe).sort().forEach(function(Me){if(["_","["].indexOf(Me.charAt(0))===-1){if(typeof Fe[Me]=="function"){Ce&&(qe[Me]="_function");return}if($==="keepdata"){if(Me.substr(Me.length-3)==="src")return}else if($==="keepstream"){if(et=Fe[Me+"src"],typeof et=="string"&&et.indexOf(":")>0&&!a.isPlainObject(Fe.stream))return}else if($!=="keepall"&&(et=Fe[Me+"src"],typeof et=="string"&&et.indexOf(":")>0))return;qe[Me]=fe(Fe[Me],Ce)}}),qe}var Qe=Array.isArray(Fe),Ke=a.isTypedArray(Fe);if((Qe||Ke)&&Fe.dtype&&Fe.shape){var Xe=Fe.bdata;return fe({dtype:Fe.dtype,shape:Fe.shape,bdata:a.isArrayBuffer(Xe)?e.encode(Xe):Xe},Ce)}return Qe?Fe.map(function(Me){return fe(Me,Ce)}):Ke?a.simpleMap(Fe,a.identity):a.isJSDate(Fe)?a.ms2DateTimeLocal(+Fe):Fe}var we={data:(q||[]).map(function(Fe){var Ce=fe(Fe);return J&&delete Ce.fit,Ce})};if(!J&&(we.layout=fe(ae),re)){var Ae=ae._size;we.layout.computed={margin:{b:Ae.b,l:Ae.l,r:Ae.r,t:Ae.t}}}return ie&&(we.frames=fe(ie)),ee&&(we.config=fe(j._context,!0)),X==="object"?we:JSON.stringify(we)},b.modifyFrames=function(j,J){var $,X,re,ee=j._transitionData._frames,q=j._transitionData._frameHash;for($=0;$0&&(j._transitioningWithDuration=!0),j._transitionData._interruptCallbacks.push(function(){X=!0}),$.redraw&&j._transitionData._interruptCallbacks.push(function(){return t.call("redraw",j)}),j._transitionData._interruptCallbacks.push(function(){j.emit("plotly_transitioninterrupted",[])});var Fe=0,Ce=0;function qe(){return Fe++,function(){Ce++,!X&&Ce===Fe&&ae(Ae)}}$.runFn(qe),setTimeout(qe())})}function ae(Ae){if(j._transitionData)return ee(j._transitionData._interruptCallbacks),Promise.resolve().then(function(){if($.redraw)return t.call("redraw",j)}).then(function(){j._transitioning=!1,j._transitioningWithDuration=!1,j.emit("plotly_transitioned",[])}).then(Ae)}function ie(){if(j._transitionData)return j._transitioning=!1,re(j._transitionData._interruptCallbacks)}var fe=[b.previousPromises,ie,$.prepareFn,b.rehover,b.reselect,q],we=a.syncOrAsync(fe,j);return(!we||!we.then)&&(we=Promise.resolve()),we.then(function(){return j})}b.doCalcdata=function(j,J){var $=s.list(j),X=j._fullData,re=j._fullLayout,ee,q,ae,ie,fe=new Array(X.length),we=(j.calcdata||[]).slice();for(j.calcdata=fe,re._numBoxes=0,re._numViolins=0,re._violinScaleGroupStats={},j._hmpixcount=0,j._hmlumcount=0,re._piecolormap={},re._sunburstcolormap={},re._treemapcolormap={},re._iciclecolormap={},re._funnelareacolormap={},ae=0;ae=0;ie--)if(ce[ie].enabled){ee._indexToPoints=ce[ie]._indexToPoints;break}q&&q.calc&&(xe=q.calc(j,ee))}(!Array.isArray(xe)||!xe[0])&&(xe=[{x:n,y:n}]),xe[0].t||(xe[0].t={}),xe[0].trace=ee,fe[Xe]=xe}}for(oe($,X,re),ae=0;aeae||Ce>ie)&&(ee.style("overflow","hidden"),Ae=ee.node().getBoundingClientRect(),Fe=Ae.width,Ce=Ae.height);var qe=+O.attr("x"),et=+O.attr("y"),Qe=j||O.node().getBoundingClientRect().height,Ke=-Qe/4;if(ue[0]==="y")q.attr({transform:"rotate("+[-90,qe,et]+")"+x(-Fe/2,Ke-Ce/2)});else if(ue[0]==="l")et=Ke-Ce/2;else if(ue[0]==="a"&&ue.indexOf("atitle")!==0)qe=0,et=Ke;else{var Xe=O.attr("text-anchor");qe=qe-Fe*(Xe==="middle"?.5:Xe==="end"?1:0),et=et+Ke-Ce/2}ee.attr({x:qe,y:et}),N&&N.call(O,q),le(q)})})):oe(),O};var t=/(<|<|<)/g,r=/(>|>|>)/g;function o(O){return O.replace(t,"\\lt ").replace(r,"\\gt ")}var a=[["$","$"],["\\(","\\)"]];function i(O,L,N){var U=parseInt((MathJax.version||"").split(".")[0]);if(U!==2&&U!==3){d.warn("No MathJax version:",MathJax.version);return}var Z,Q,ue,oe,le=function(){return Q=d.extendDeepAll({},MathJax.Hub.config),ue=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:a},displayAlign:"left"})},j=function(){Q=d.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=a},J=function(){if(Z=MathJax.Hub.config.menuSettings.renderer,Z!=="SVG")return MathJax.Hub.setRenderer("SVG")},$=function(){Z=MathJax.config.startup.output,Z!=="svg"&&(MathJax.config.startup.output="svg")},X=function(){var fe="math-output-"+d.randstr({},64);oe=G.select("body").append("div").attr({id:fe}).style({visibility:"hidden",position:"absolute","font-size":L.fontSize+"px"}).text(o(O));var we=oe.node();return U===2?MathJax.Hub.Typeset(we):MathJax.typeset([we])},re=function(){var fe=oe.select(U===2?".MathJax_SVG":".MathJax"),we=!fe.empty()&&oe.select("svg").node();if(!we)d.log("There was an error in the tex syntax.",O),N();else{var Ae=we.getBoundingClientRect(),Fe;U===2?Fe=G.select("body").select("#MathJax_SVG_glyphs"):Fe=fe.select("defs"),N(fe,Fe,Ae)}oe.remove()},ee=function(){if(Z!=="SVG")return MathJax.Hub.setRenderer(Z)},q=function(){Z!=="svg"&&(MathJax.config.startup.output=Z)},ae=function(){return ue!==void 0&&(MathJax.Hub.processSectionDelay=ue),MathJax.Hub.Config(Q)},ie=function(){MathJax.config=Q};U===2?MathJax.Hub.Queue(le,J,X,re,ee,ae):U===3&&(j(),$(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){X(),re(),q(),ie()}))}var n={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},s={sub:"0.3em",sup:"-0.6em"},c={sub:"-0.21em",sup:"0.42em"},f="​",v=["http:","https:","mailto:","",void 0,":"],h=Y.NEWLINES=/(\r\n?|\n)/g,T=/(<[^<>]*>)/,l=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;Y.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,S=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,M=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,_=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function w(O,L){if(!O)return null;var N=O.match(L),U=N&&(N[3]||N[4]);return U&&m(U)}var p=/(^|;)\s*color:/;Y.plainText=function(O,L){L=L||{};for(var N=L.len!==void 0&&L.len!==-1?L.len:1/0,U=L.allowedTags!==void 0?L.allowedTags:["br"],Z="...",Q=Z.length,ue=O.split(T),oe=[],le="",j=0,J=0;JQ?oe.push($.substr(0,q-Q)+Z):oe.push($.substr(0,q));break}le=""}}return oe.join("")};var u={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},g=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function m(O){return O.replace(g,function(L,N){var U;return N.charAt(0)==="#"?U=R(N.charAt(1)==="x"?parseInt(N.substr(2),16):parseInt(N.substr(1),10)):U=u[N],U||L})}Y.convertEntities=m;function R(O){if(!(O>1114111)){var L=String.fromCodePoint;if(L)return L(O);var N=String.fromCharCode;return O<=65535?N(O):N((O>>10)+55232,O%1024+56320)}}function P(O,L){L=L.replace(h," ");var N=!1,U=[],Z,Q=-1;function ue(){Q++;var Ce=document.createElementNS(A.svg,"tspan");G.select(Ce).attr({class:"line",dy:Q*E+"em"}),O.appendChild(Ce),Z=Ce;var qe=U;if(U=[{node:Ce}],qe.length>1)for(var et=1;et.",L);return}var qe=U.pop();Ce!==qe.type&&d.log("Start tag <"+qe.type+"> doesnt match end tag <"+Ce+">. Pretending it did match.",L),Z=U[U.length-1].node}var J=y.test(L);J?ue():(Z=O,U=[{node:O}]);for(var $=L.split(T),X=0;X<$.length;X++){var re=$[X],ee=re.match(l),q=ee&&ee[2].toLowerCase(),ae=n[q];if(q==="br")ue();else if(ae===void 0)le(Z,m(re));else if(ee[1])j(q);else{var ie=ee[4],fe={type:q},we=w(ie,b);if(we?(we=we.replace(p,"$1 fill:"),ae&&(we+=";"+ae)):ae&&(we=ae),we&&(fe.style=we),q==="a"){N=!0;var Ae=w(ie,S);if(Ae){var Fe=z(Ae);Fe&&(fe.href=Fe,fe.target=w(ie,M)||"_blank",fe.popup=w(ie,_))}}oe(fe)}}return N}function z(O){var L=encodeURI(decodeURI(O)),N=document.createElement("a"),U=document.createElement("a");N.href=O,U.href=L;var Z=N.protocol,Q=U.protocol;return v.indexOf(Z)!==-1&&v.indexOf(Q)!==-1?L:""}Y.sanitizeHTML=function(L){L=L.replace(h," ");for(var N=document.createElement("p"),U=N,Z=[],Q=L.split(T),ue=0;ue=0;y--,b++){var S=h[y];l[b]=[1-S[0],S[1]]}return l}function c(h,T){T=T||{};for(var l=h.domain,y=h.range,b=y.length,S=new Array(b),M=0;Mh-f?f=h-(v-h):v-h=0?y=o.colorscale.sequential:y=o.colorscale.sequentialminus,s._sync("colorscale",y)}}}}),Kl=He({"src/components/colorscale/index.js"(Y,G){var d=Ap(),x=Ah();G.exports={moduleType:"component",name:"colorscale",attributes:kl(),layoutAttributes:xb(),supplyLayoutDefaults:JS(),handleDefaults:pf(),crossTraceDefaults:$S(),calc:Sh(),scales:d.scales,defaultScale:d.defaultScale,getScale:d.get,isValidScale:d.isValid,hasColorscale:x.hasColorscale,extractOpts:x.extractOpts,extractScale:x.extractScale,flipScale:x.flipScale,makeColorScaleFunc:x.makeColorScaleFunc,makeColorScaleFuncFromTrace:x.makeColorScaleFuncFromTrace}}}),Rl=He({"src/traces/scatter/subtypes.js"(Y,G){var d=Gr(),x=ch().isTypedArraySpec;G.exports={hasLines:function(A){return A.visible&&A.mode&&A.mode.indexOf("lines")!==-1},hasMarkers:function(A){return A.visible&&(A.mode&&A.mode.indexOf("markers")!==-1||A.type==="splom")},hasText:function(A){return A.visible&&A.mode&&A.mode.indexOf("text")!==-1},isBubble:function(A){var E=A.marker;return d.isPlainObject(E)&&(d.isArrayOrTypedArray(E.size)||x(E.size))}}}}),B0=He({"src/traces/scatter/make_bubble_size_func.js"(Y,G){var d=Hi();G.exports=function(A,E){E||(E=2);var e=A.marker,t=e.sizeref||1,r=e.sizemin||0,o=e.sizemode==="area"?function(a){return Math.sqrt(a/t)}:function(a){return a/t};return function(a){var i=o(a/E);return d(i)&&i>0?Math.max(i,r):0}}}}),Ph=He({"src/components/fx/helpers.js"(Y){var G=Gr();Y.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},Y.isTraceInSubplots=function(t,r){if(t.type==="splom"){for(var o=t.xaxes||[],a=t.yaxes||[],i=0;i=0&&o.index2&&(r.push([a].concat(i.splice(0,2))),n="l",a=a=="m"?"l":"L");;){if(i.length==d[n])return i.unshift(a),r.push(i);if(i.length0&&(xe=100,Me=Me.replace("-open","")),Me.indexOf("-dot")>0&&(xe+=200,Me=Me.replace("-dot","")),Me=l.symbolNames.indexOf(Me),Me>=0&&(Me+=xe)}return Me%100>=p||Me>=400?0:Math.floor(Math.max(Me,0))};function g(Me,xe,ce,Re){var $e=Me%100;return l.symbolFuncs[$e](xe,ce,Re)+(Me>=200?u:"")}var m=A("~f"),R={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};l.gradient=function(Me,xe,ce,Re,$e,rt){var Je=R[Re];return P(Me,xe,ce,Je.type,$e,rt,Je.start,Je.stop,!1,Je.reversed)};function P(Me,xe,ce,Re,$e,rt,Je,At,St,Rt){var Ut=$e.length,ir;Re==="linear"?ir={node:"linearGradient",attrs:{x1:Je.x,y1:Je.y,x2:At.x,y2:At.y,gradientUnits:St?"userSpaceOnUse":"objectBoundingBox"},reversed:Rt}:Re==="radial"&&(ir={node:"radialGradient",reversed:Rt});for(var ar=new Array(Ut),Mr=0;Mr=0&&Me.i===void 0&&(Me.i=rt.i),xe.style("opacity",Re.selectedOpacityFn?Re.selectedOpacityFn(Me):Me.mo===void 0?Je.opacity:Me.mo),Re.ms2mrc){var St;Me.ms==="various"||Je.size==="various"?St=3:St=Re.ms2mrc(Me.ms),Me.mrc=St,Re.selectedSizeFn&&(St=Me.mrc=Re.selectedSizeFn(Me));var Rt=l.symbolNumber(Me.mx||Je.symbol)||0;Me.om=Rt%200>=100;var Ut=Xe(Me,ce),ir=ae(Me,ce);xe.attr("d",g(Rt,St,Ut,ir))}var ar=!1,Mr,fr,dr;if(Me.so)dr=At.outlierwidth,fr=At.outliercolor,Mr=Je.outliercolor;else{var pt=(At||{}).width;dr=(Me.mlw+1||pt+1||(Me.trace?(Me.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in Me?fr=Me.mlcc=Re.lineScale(Me.mlc):x.isArrayOrTypedArray(At.color)?fr=r.defaultLine:fr=At.color,x.isArrayOrTypedArray(Je.color)&&(Mr=r.defaultLine,ar=!0),"mc"in Me?Mr=Me.mcc=Re.markerScale(Me.mc):Mr=Je.color||Je.colors||"rgba(0,0,0,0)",Re.selectedColorFn&&(Mr=Re.selectedColorFn(Me))}if(Me.om)xe.call(r.stroke,Mr).style({"stroke-width":(dr||1)+"px",fill:"none"});else{xe.style("stroke-width",(Me.isBlank?0:dr)+"px");var ze=Je.gradient,Ge=Me.mgt;Ge?ar=!0:Ge=ze&&ze.type,x.isArrayOrTypedArray(Ge)&&(Ge=Ge[0],R[Ge]||(Ge=0));var Oe=Je.pattern,ve=Oe&&l.getPatternAttr(Oe.shape,Me.i,"");if(Ge&&Ge!=="none"){var ge=Me.mgc;ge?ar=!0:ge=ze.color;var be=ce.uid;ar&&(be+="-"+Me.i),l.gradient(xe,$e,be,Ge,[[0,ge],[1,Mr]],"fill")}else if(ve){var Pe=!1,We=Oe.fgcolor;!We&&rt&&rt.color&&(We=rt.color,Pe=!0);var ct=l.getPatternAttr(We,Me.i,rt&&rt.color||null),_t=l.getPatternAttr(Oe.bgcolor,Me.i,null),Mt=Oe.fgopacity,Nt=l.getPatternAttr(Oe.size,Me.i,8),Bt=l.getPatternAttr(Oe.solidity,Me.i,.3);Pe=Pe||Me.mcc||x.isArrayOrTypedArray(Oe.shape)||x.isArrayOrTypedArray(Oe.bgcolor)||x.isArrayOrTypedArray(Oe.fgcolor)||x.isArrayOrTypedArray(Oe.size)||x.isArrayOrTypedArray(Oe.solidity);var qt=ce.uid;Pe&&(qt+="-"+Me.i),l.pattern(xe,"point",$e,qt,ve,Nt,Bt,Me.mcc,Oe.fillmode,_t,ct,Mt)}else x.isArrayOrTypedArray(Mr)?r.fill(xe,Mr[Me.i]):r.fill(xe,Mr);dr&&r.stroke(xe,fr)}},l.makePointStyleFns=function(Me){var xe={},ce=Me.marker;return xe.markerScale=l.tryColorscale(ce,""),xe.lineScale=l.tryColorscale(ce,"line"),t.traceIs(Me,"symbols")&&(xe.ms2mrc=v.isBubble(Me)?h(Me):function(){return(ce.size||6)/2}),Me.selectedpoints&&x.extendFlat(xe,l.makeSelectedPointStyleFns(Me)),xe},l.makeSelectedPointStyleFns=function(Me){var xe={},ce=Me.selected||{},Re=Me.unselected||{},$e=Me.marker||{},rt=ce.marker||{},Je=Re.marker||{},At=$e.opacity,St=rt.opacity,Rt=Je.opacity,Ut=St!==void 0,ir=Rt!==void 0;(x.isArrayOrTypedArray(At)||Ut||ir)&&(xe.selectedOpacityFn=function(ve){var ge=ve.mo===void 0?$e.opacity:ve.mo;return ve.selected?Ut?St:ge:ir?Rt:f*ge});var ar=$e.color,Mr=rt.color,fr=Je.color;(Mr||fr)&&(xe.selectedColorFn=function(ve){var ge=ve.mcc||ar;return ve.selected?Mr||ge:fr||ge});var dr=$e.size,pt=rt.size,ze=Je.size,Ge=pt!==void 0,Oe=ze!==void 0;return t.traceIs(Me,"symbols")&&(Ge||Oe)&&(xe.selectedSizeFn=function(ve){var ge=ve.mrc||dr/2;return ve.selected?Ge?pt/2:ge:Oe?ze/2:ge}),xe},l.makeSelectedTextStyleFns=function(Me){var xe={},ce=Me.selected||{},Re=Me.unselected||{},$e=Me.textfont||{},rt=ce.textfont||{},Je=Re.textfont||{},At=$e.color,St=rt.color,Rt=Je.color;return xe.selectedTextColorFn=function(Ut){var ir=Ut.tc||At;return Ut.selected?St||ir:Rt||(St?ir:r.addOpacity(ir,f))},xe},l.selectedPointStyle=function(Me,xe){if(!(!Me.size()||!xe.selectedpoints)){var ce=l.makeSelectedPointStyleFns(xe),Re=xe.marker||{},$e=[];ce.selectedOpacityFn&&$e.push(function(rt,Je){rt.style("opacity",ce.selectedOpacityFn(Je))}),ce.selectedColorFn&&$e.push(function(rt,Je){r.fill(rt,ce.selectedColorFn(Je))}),ce.selectedSizeFn&&$e.push(function(rt,Je){var At=Je.mx||Re.symbol||0,St=ce.selectedSizeFn(Je);rt.attr("d",g(l.symbolNumber(At),St,Xe(Je,xe),ae(Je,xe))),Je.mrc2=St}),$e.length&&Me.each(function(rt){for(var Je=d.select(this),At=0;At<$e.length;At++)$e[At](Je,rt)})}},l.tryColorscale=function(Me,xe){var ce=xe?x.nestedProperty(Me,xe).get():Me;if(ce){var Re=ce.color;if((ce.colorscale||ce._colorAx)&&x.isArrayOrTypedArray(Re))return o.makeColorScaleFuncFromTrace(ce)}return x.identity};var z={start:1,end:-1,middle:0,bottom:1,top:-1};function F(Me,xe,ce,Re,$e){var rt=d.select(Me.node().parentNode),Je=xe.indexOf("top")!==-1?"top":xe.indexOf("bottom")!==-1?"bottom":"middle",At=xe.indexOf("left")!==-1?"end":xe.indexOf("right")!==-1?"start":"middle",St=Re?Re/.8+1:0,Rt=(i.lineCount(Me)-1)*c+1,Ut=z[At]*St,ir=ce*.75+z[Je]*St+(z[Je]-1)*Rt*ce/2;Me.attr("text-anchor",At),$e||rt.attr("transform",a(Ut,ir))}function B(Me,xe){var ce=Me.ts||xe.textfont.size;return E(ce)&&ce>0?ce:0}l.textPointStyle=function(Me,xe,ce){if(Me.size()){var Re;if(xe.selectedpoints){var $e=l.makeSelectedTextStyleFns(xe);Re=$e.selectedTextColorFn}var rt=xe.texttemplate,Je=ce._fullLayout;Me.each(function(At){var St=d.select(this),Rt=rt?x.extractOption(At,xe,"txt","texttemplate"):x.extractOption(At,xe,"tx","text");if(!Rt&&Rt!==0){St.remove();return}if(rt){var Ut=xe._module.formatLabels,ir=Ut?Ut(At,xe,Je):{},ar={};T(ar,xe,At.i);var Mr=xe._meta||{};Rt=x.texttemplateString(Rt,ir,Je._d3locale,ar,At,Mr)}var fr=At.tp||xe.textposition,dr=B(At,xe),pt=Re?Re(At):At.tc||xe.textfont.color;St.call(l.font,{family:At.tf||xe.textfont.family,weight:At.tw||xe.textfont.weight,style:At.ty||xe.textfont.style,variant:At.tv||xe.textfont.variant,textcase:At.tC||xe.textfont.textcase,lineposition:At.tE||xe.textfont.lineposition,shadow:At.tS||xe.textfont.shadow,size:dr,color:pt}).text(Rt).call(i.convertToTspans,ce).call(F,fr,dr,At.mrc)})}},l.selectedTextStyle=function(Me,xe){if(!(!Me.size()||!xe.selectedpoints)){var ce=l.makeSelectedTextStyleFns(xe);Me.each(function(Re){var $e=d.select(this),rt=ce.selectedTextColorFn(Re),Je=Re.tp||xe.textposition,At=B(Re,xe);r.fill($e,rt);var St=t.traceIs(xe,"bar-like");F($e,Je,At,Re.mrc2||Re.mrc,St)})}};var O=.5;l.smoothopen=function(Me,xe){if(Me.length<3)return"M"+Me.join("L");var ce="M"+Me[0],Re=[],$e;for($e=1;$e=St||ve>=Ut&&ve<=St)&&(ge<=ir&&ge>=Rt||ge>=ir&&ge<=Rt)&&(Me=[ve,ge])}return Me}l.applyBackoff=j,l.makeTester=function(){var Me=x.ensureSingleById(d.select("body"),"svg","js-plotly-tester",function(ce){ce.attr(n.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),xe=x.ensureSingle(Me,"path","js-reference-point",function(ce){ce.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});l.tester=Me,l.testref=xe},l.savedBBoxes={};var J=0,$=1e4;l.bBox=function(Me,xe,ce){ce||(ce=X(Me));var Re;if(ce){if(Re=l.savedBBoxes[ce],Re)return x.extendFlat({},Re)}else if(Me.childNodes.length===1){var $e=Me.childNodes[0];if(ce=X($e),ce){var rt=+$e.getAttribute("x")||0,Je=+$e.getAttribute("y")||0,At=$e.getAttribute("transform");if(!At){var St=l.bBox($e,!1,ce);return rt&&(St.left+=rt,St.right+=rt),Je&&(St.top+=Je,St.bottom+=Je),St}if(ce+="~"+rt+"~"+Je+"~"+At,Re=l.savedBBoxes[ce],Re)return x.extendFlat({},Re)}}var Rt,Ut;xe?Rt=Me:(Ut=l.tester.node(),Rt=Me.cloneNode(!0),Ut.appendChild(Rt)),d.select(Rt).attr("transform",null).call(i.positionText,0,0);var ir=Rt.getBoundingClientRect(),ar=l.testref.node().getBoundingClientRect();xe||Ut.removeChild(Rt);var Mr={height:ir.height,width:ir.width,left:ir.left-ar.left,top:ir.top-ar.top,right:ir.right-ar.left,bottom:ir.bottom-ar.top};return J>=$&&(l.savedBBoxes={},J=0),ce&&(l.savedBBoxes[ce]=Mr),J++,x.extendFlat({},Mr)};function X(Me){var xe=Me.getAttribute("data-unformatted");if(xe!==null)return xe+Me.getAttribute("data-math")+Me.getAttribute("text-anchor")+Me.getAttribute("style")}l.setClipUrl=function(Me,xe,ce){Me.attr("clip-path",re(xe,ce))};function re(Me,xe){if(!Me)return null;var ce=xe._context,Re=ce._exportedPlot?"":ce._baseUrl||"";return Re?"url('"+Re+"#"+Me+"')":"url(#"+Me+")"}l.getTranslate=function(Me){var xe=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,ce=Me.attr?"attr":"getAttribute",Re=Me[ce]("transform")||"",$e=Re.replace(xe,function(rt,Je,At){return[Je,At].join(" ")}).split(" ");return{x:+$e[0]||0,y:+$e[1]||0}},l.setTranslate=function(Me,xe,ce){var Re=/(\btranslate\(.*?\);?)/,$e=Me.attr?"attr":"getAttribute",rt=Me.attr?"attr":"setAttribute",Je=Me[$e]("transform")||"";return xe=xe||0,ce=ce||0,Je=Je.replace(Re,"").trim(),Je+=a(xe,ce),Je=Je.trim(),Me[rt]("transform",Je),Je},l.getScale=function(Me){var xe=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,ce=Me.attr?"attr":"getAttribute",Re=Me[ce]("transform")||"",$e=Re.replace(xe,function(rt,Je,At){return[Je,At].join(" ")}).split(" ");return{x:+$e[0]||1,y:+$e[1]||1}},l.setScale=function(Me,xe,ce){var Re=/(\bscale\(.*?\);?)/,$e=Me.attr?"attr":"getAttribute",rt=Me.attr?"attr":"setAttribute",Je=Me[$e]("transform")||"";return xe=xe||1,ce=ce||1,Je=Je.replace(Re,"").trim(),Je+="scale("+xe+","+ce+")",Je=Je.trim(),Me[rt]("transform",Je),Je};var ee=/\s*sc.*/;l.setPointGroupScale=function(Me,xe,ce){if(xe=xe||1,ce=ce||1,!!Me){var Re=xe===1&&ce===1?"":"scale("+xe+","+ce+")";Me.each(function(){var $e=(this.getAttribute("transform")||"").replace(ee,"");$e+=Re,$e=$e.trim(),this.setAttribute("transform",$e)})}};var q=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(Me,xe,ce){Me&&Me.each(function(){var Re,$e=d.select(this),rt=$e.select("text");if(rt.node()){var Je=parseFloat(rt.attr("x")||0),At=parseFloat(rt.attr("y")||0),St=($e.attr("transform")||"").match(q);xe===1&&ce===1?Re=[]:Re=[a(Je,At),"scale("+xe+","+ce+")",a(-Je,-At)],St&&Re.push(St),$e.attr("transform",Re.join(""))}})};function ae(Me,xe){var ce;return Me&&(ce=Me.mf),ce===void 0&&(ce=xe.marker&&xe.marker.standoff||0),!xe._geo&&!xe._xA?-ce:ce}l.getMarkerStandoff=ae;var ie=Math.atan2,fe=Math.cos,we=Math.sin;function Ae(Me,xe){var ce=xe[0],Re=xe[1];return[ce*fe(Me)-Re*we(Me),ce*we(Me)+Re*fe(Me)]}var Fe,Ce,qe,et,Qe,Ke;function Xe(Me,xe){var ce=Me.ma;ce===void 0&&(ce=xe.marker.angle,(!ce||x.isArrayOrTypedArray(ce))&&(ce=0));var Re,$e,rt=xe.marker.angleref;if(rt==="previous"||rt==="north"){if(xe._geo){var Je=xe._geo.project(Me.lonlat);Re=Je[0],$e=Je[1]}else{var At=xe._xA,St=xe._yA;if(At&&St)Re=At.c2p(Me.x),$e=St.c2p(Me.y);else return 90}if(xe._geo){var Rt=Me.lonlat[0],Ut=Me.lonlat[1],ir=xe._geo.project([Rt,Ut+1e-5]),ar=xe._geo.project([Rt+1e-5,Ut]),Mr=ie(ar[1]-$e,ar[0]-Re),fr=ie(ir[1]-$e,ir[0]-Re),dr;if(rt==="north")dr=ce/180*Math.PI;else if(rt==="previous"){var pt=Rt/180*Math.PI,ze=Ut/180*Math.PI,Ge=Fe/180*Math.PI,Oe=Ce/180*Math.PI,ve=Ge-pt,ge=fe(Oe)*we(ve),be=we(Oe)*fe(ze)-fe(Oe)*we(ze)*fe(ve);dr=-ie(ge,be)-Math.PI,Fe=Rt,Ce=Ut}var Pe=Ae(Mr,[fe(dr),0]),We=Ae(fr,[we(dr),0]);ce=ie(Pe[1]+We[1],Pe[0]+We[0])/Math.PI*180,rt==="previous"&&!(Ke===xe.uid&&Me.i===Qe+1)&&(ce=null)}if(rt==="previous"&&!xe._geo)if(Ke===xe.uid&&Me.i===Qe+1&&E(Re)&&E($e)){var ct=Re-qe,_t=$e-et,Mt=xe.line&&xe.line.shape||"",Nt=Mt.slice(Mt.length-1);Nt==="h"&&(_t=0),Nt==="v"&&(ct=0),ce+=ie(_t,ct)/Math.PI*180+90}else ce=null}return qe=Re,et=$e,Qe=Me.i,Ke=xe.uid,ce}l.getMarkerAngle=Xe}}),kp=He({"src/components/titles/index.js"(Y,G){var d=Qn(),x=Hi(),A=yu(),E=Ei(),e=Gr(),t=e.strTranslate,r=vo(),o=Ai(),a=yl(),i=Bd(),n=df().OPPOSITE_SIDE,s=/ [XY][0-9]* /,c=1.6,f=1.6;function v(h,T,l){var y=h._fullLayout,b=l.propContainer,S=l.propName,M=l.placeholder,_=l.traceIndex,w=l.avoid||{},p=l.attributes,u=l.transform,g=l.containerGroup,m=1,R=b.title,P=(R&&R.text?R.text:"").trim(),z=!1,F=R&&R.font?R.font:{},B=F.family,O=F.size,L=F.color,N=F.weight,U=F.style,Z=F.variant,Q=F.textcase,ue=F.lineposition,oe=F.shadow,le=l.subtitlePropName,j=!!le,J=l.subtitlePlaceholder,$=(b.title||{}).subtitle||{text:"",font:{}},X=$.text.trim(),re=!1,ee=1,q=$.font,ae=q.family,ie=q.size,fe=q.color,we=q.weight,Ae=q.style,Fe=q.variant,Ce=q.textcase,qe=q.lineposition,et=q.shadow,Qe;S==="title.text"?Qe="titleText":S.indexOf("axis")!==-1?Qe="axisTitleText":S.indexOf("colorbar"!==-1)&&(Qe="colorbarTitleText");var Ke=h._context.edits[Qe];function Xe(ar,Mr){return ar===void 0||Mr===void 0?!1:ar.replace(s," % ")===Mr.replace(s," % ")}P===""?m=0:Xe(P,M)&&(Ke||(P=""),m=.2,z=!0),j&&(X===""?ee=0:Xe(X,J)&&(Ke||(X=""),ee=.2,re=!0)),l._meta?P=e.templateString(P,l._meta):y._meta&&(P=e.templateString(P,y._meta));var Me=P||X||Ke,xe;g||(g=e.ensureSingle(y._infolayer,"g","g-"+T),xe=y._hColorbarMoveTitle);var ce=g.selectAll("text."+T).data(Me?[0]:[]);ce.enter().append("text"),ce.text(P).attr("class",T),ce.exit().remove();var Re=null,$e=T+"-subtitle",rt=X||Ke;if(j&&rt&&(Re=g.selectAll("text."+$e).data(rt?[0]:[]),Re.enter().append("text"),Re.text(X).attr("class",$e),Re.exit().remove()),!Me)return g;function Je(ar,Mr){e.syncOrAsync([At,St],{title:ar,subtitle:Mr})}function At(ar){var Mr=ar.title,fr=ar.subtitle,dr;!u&&xe&&(u={}),u?(dr="",u.rotate&&(dr+="rotate("+[u.rotate,p.x,p.y]+")"),(u.offset||xe)&&(dr+=t(0,(u.offset||0)-(xe||0)))):dr=null,Mr.attr("transform",dr);function pt(be){if(be){var Pe=d.select(be.node().parentNode).select("."+$e);if(!Pe.empty()){var We=be.node().getBBox();if(We.height){var ct=We.y+We.height+c*ie;Pe.attr("y",ct)}}}}if(Mr.style("opacity",m*o.opacity(L)).call(r.font,{color:o.rgb(L),size:d.round(O,2),family:B,weight:N,style:U,variant:Z,textcase:Q,shadow:oe,lineposition:ue}).attr(p).call(a.convertToTspans,h,pt),fr){var ze=g.select("."+T+"-math-group"),Ge=Mr.node().getBBox(),Oe=ze.node()?ze.node().getBBox():void 0,ve=Oe?Oe.y+Oe.height+c*ie:Ge.y+Ge.height+f*ie,ge=e.extendFlat({},p,{y:ve});fr.attr("transform",dr),fr.style("opacity",ee*o.opacity(fe)).call(r.font,{color:o.rgb(fe),size:d.round(ie,2),family:ae,weight:we,style:Ae,variant:Fe,textcase:Ce,shadow:et,lineposition:qe}).attr(ge).call(a.convertToTspans,h)}return A.previousPromises(h)}function St(ar){var Mr=ar.title,fr=d.select(Mr.node().parentNode);if(w&&w.selection&&w.side&&P){fr.attr("transform",null);var dr=n[w.side],pt=w.side==="left"||w.side==="top"?-1:1,ze=x(w.pad)?w.pad:2,Ge=r.bBox(fr.node()),Oe={t:0,b:0,l:0,r:0},ve=h._fullLayout._reservedMargin;for(var ge in ve)for(var be in ve[ge]){var Pe=ve[ge][be];Oe[be]=Math.max(Oe[be],Pe)}var We={left:Oe.l,top:Oe.t,right:y.width-Oe.r,bottom:y.height-Oe.b},ct=w.maxShift||pt*(We[w.side]-Ge[w.side]),_t=0;if(ct<0)_t=ct;else{var Mt=w.offsetLeft||0,Nt=w.offsetTop||0;Ge.left-=Mt,Ge.right-=Mt,Ge.top-=Nt,Ge.bottom-=Nt,w.selection.each(function(){var qt=r.bBox(this);e.bBoxIntersect(Ge,qt,ze)&&(_t=Math.max(_t,pt*(qt[w.side]-Ge[dr])+ze))}),_t=Math.min(ct,_t),b._titleScoot=Math.abs(_t)}if(_t>0||ct<0){var Bt={left:[-_t,0],right:[_t,0],top:[0,-_t],bottom:[0,_t]}[w.side];fr.attr("transform",t(Bt[0],Bt[1]))}}}ce.call(Je,Re);function Rt(ar,Mr){ar.text(Mr).on("mouseover.opacity",function(){d.select(this).transition().duration(i.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){d.select(this).transition().duration(i.HIDE_PLACEHOLDER).style("opacity",0)})}if(Ke&&(P?ce.on(".opacity",null):(Rt(ce,M),z=!0),ce.call(a.makeEditable,{gd:h}).on("edit",function(ar){_!==void 0?E.call("_guiRestyle",h,S,ar,_):E.call("_guiRelayout",h,S,ar)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Je)}).on("input",function(ar){this.text(ar||" ").call(a.positionText,p.x,p.y)}),j)){if(j&&!P){var Ut=ce.node().getBBox(),ir=Ut.y+Ut.height+f*ie;Re.attr("y",ir)}X?Re.on(".opacity",null):(Rt(Re,J),re=!0),Re.call(a.makeEditable,{gd:h}).on("edit",function(ar){E.call("_guiRelayout",h,"title.subtitle.text",ar)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Je)}).on("input",function(ar){this.text(ar||" ").call(a.positionText,Re.attr("x"),Re.attr("y"))})}return ce.classed("js-placeholder",z),Re&&Re.classed("js-placeholder",re),g}G.exports={draw:v,SUBTITLE_PADDING_EM:f,SUBTITLE_PADDING_MATHJAX_EM:c}}}),Uv=He({"src/plots/cartesian/set_convert.js"(Y,G){var d=Qn(),x=Xl().utcFormat,A=Gr(),E=A.numberFormat,e=Hi(),t=A.cleanNumber,r=A.ms2DateTime,o=A.dateTime2ms,a=A.ensureNumber,i=A.isArrayOrTypedArray,n=lo(),s=n.FP_SAFE,c=n.BADNUM,f=n.LOG_CLIP,v=n.ONEWEEK,h=n.ONEDAY,T=n.ONEHOUR,l=n.ONEMIN,y=n.ONESEC,b=oc(),S=Ef(),M=S.HOUR_PATTERN,_=S.WEEKDAY_PATTERN;function w(u){return Math.pow(10,u)}function p(u){return u!=null}G.exports=function(g,m){m=m||{};var R=g._id||"x",P=R.charAt(0);function z(X,re){if(X>0)return Math.log(X)/Math.LN10;if(X<=0&&re&&g.range&&g.range.length===2){var ee=g.range[0],q=g.range[1];return .5*(ee+q-2*f*Math.abs(ee-q))}else return c}function F(X,re,ee,q){if((q||{}).msUTC&&e(X))return+X;var ae=o(X,ee||g.calendar);if(ae===c)if(e(X)){X=+X;var ie=Math.floor(A.mod(X+.05,1)*10),fe=Math.round(X-ie/10);ae=o(new Date(fe))+ie/10}else return c;return ae}function B(X,re,ee){return r(X,re,ee||g.calendar)}function O(X){return g._categories[Math.round(X)]}function L(X){if(p(X)){if(g._categoriesMap===void 0&&(g._categoriesMap={}),g._categoriesMap[X]!==void 0)return g._categoriesMap[X];g._categories.push(typeof X=="number"?String(X):X);var re=g._categories.length-1;return g._categoriesMap[X]=re,re}return c}function N(X,re){for(var ee=new Array(re),q=0;qg.range[1]&&(ee=!ee);for(var q=ee?-1:1,ae=q*X,ie=0,fe=0;feAe)ie=fe+1;else{ie=ae<(we+Ae)/2?fe:fe+1;break}}var Fe=g._B[ie]||0;return isFinite(Fe)?ue(X,g._m2,Fe):0},j=function(X){var re=g._rangebreaks.length;if(!re)return oe(X,g._m,g._b);for(var ee=0,q=0;qg._rangebreaks[q].pmax&&(ee=q+1);return oe(X,g._m2,g._B[ee])}}g.c2l=g.type==="log"?z:a,g.l2c=g.type==="log"?w:a,g.l2p=le,g.p2l=j,g.c2p=g.type==="log"?function(X,re){return le(z(X,re))}:le,g.p2c=g.type==="log"?function(X){return w(j(X))}:j,["linear","-"].indexOf(g.type)!==-1?(g.d2r=g.r2d=g.d2c=g.r2c=g.d2l=g.r2l=t,g.c2d=g.c2r=g.l2d=g.l2r=a,g.d2p=g.r2p=function(X){return g.l2p(t(X))},g.p2d=g.p2r=j,g.cleanPos=a):g.type==="log"?(g.d2r=g.d2l=function(X,re){return z(t(X),re)},g.r2d=g.r2c=function(X){return w(t(X))},g.d2c=g.r2l=t,g.c2d=g.l2r=a,g.c2r=z,g.l2d=w,g.d2p=function(X,re){return g.l2p(g.d2r(X,re))},g.p2d=function(X){return w(j(X))},g.r2p=function(X){return g.l2p(t(X))},g.p2r=j,g.cleanPos=a):g.type==="date"?(g.d2r=g.r2d=A.identity,g.d2c=g.r2c=g.d2l=g.r2l=F,g.c2d=g.c2r=g.l2d=g.l2r=B,g.d2p=g.r2p=function(X,re,ee){return g.l2p(F(X,0,ee))},g.p2d=g.p2r=function(X,re,ee){return B(j(X),re,ee)},g.cleanPos=function(X){return A.cleanDate(X,c,g.calendar)}):g.type==="category"?(g.d2c=g.d2l=L,g.r2d=g.c2d=g.l2d=O,g.d2r=g.d2l_noadd=Z,g.r2c=function(X){var re=Q(X);return re!==void 0?re:g.fraction2r(.5)},g.l2r=g.c2r=a,g.r2l=Q,g.d2p=function(X){return g.l2p(g.r2c(X))},g.p2d=function(X){return O(j(X))},g.r2p=g.d2p,g.p2r=j,g.cleanPos=function(X){return typeof X=="string"&&X!==""?X:a(X)}):g.type==="multicategory"&&(g.r2d=g.c2d=g.l2d=O,g.d2r=g.d2l_noadd=Z,g.r2c=function(X){var re=Z(X);return re!==void 0?re:g.fraction2r(.5)},g.r2c_just_indices=U,g.l2r=g.c2r=a,g.r2l=Z,g.d2p=function(X){return g.l2p(g.r2c(X))},g.p2d=function(X){return O(j(X))},g.r2p=g.d2p,g.p2r=j,g.cleanPos=function(X){return Array.isArray(X)||typeof X=="string"&&X!==""?X:a(X)},g.setupMultiCategory=function(X){var re=g._traceIndices,ee,q,ae=g._matchGroup;if(ae&&g._categories.length===0){for(var ie in ae)if(ie!==R){var fe=m[b.id2name(ie)];re=re.concat(fe._traceIndices)}}var we=[[0,{}],[0,{}]],Ae=[];for(ee=0;eefe[1]&&(q[ie?0:1]=ee),q[0]===q[1]){var we=g.l2r(re),Ae=g.l2r(ee);if(re!==void 0){var Fe=we+1;ee!==void 0&&(Fe=Math.min(Fe,Ae)),q[ie?1:0]=Fe}if(ee!==void 0){var Ce=Ae+1;re!==void 0&&(Ce=Math.max(Ce,we)),q[ie?0:1]=Ce}}}},g.cleanRange=function(X,re){g._cleanRange(X,re),g.limitRange(X)},g._cleanRange=function(X,re){re||(re={}),X||(X="range");var ee=A.nestedProperty(g,X).get(),q,ae;if(g.type==="date"?ae=A.dfltRange(g.calendar):P==="y"?ae=S.DFLTRANGEY:g._name==="realaxis"?ae=[0,1]:ae=re.dfltRange||S.DFLTRANGEX,ae=ae.slice(),(g.rangemode==="tozero"||g.rangemode==="nonnegative")&&(ae[0]=0),!ee||ee.length!==2){A.nestedProperty(g,X).set(ae);return}var ie=ee[0]===null,fe=ee[1]===null;for(g.type==="date"&&!g.autorange&&(ee[0]=A.cleanDate(ee[0],c,g.calendar),ee[1]=A.cleanDate(ee[1],c,g.calendar)),q=0;q<2;q++)if(g.type==="date"){if(!A.isDateTime(ee[q],g.calendar)){g[X]=ae;break}if(g.r2l(ee[0])===g.r2l(ee[1])){var we=A.constrain(g.r2l(ee[0]),A.MIN_MS+1e3,A.MAX_MS-1e3);ee[0]=g.l2r(we-1e3),ee[1]=g.l2r(we+1e3);break}}else{if(!e(ee[q]))if(!(ie||fe)&&e(ee[1-q]))ee[q]=ee[1-q]*(q?10:.1);else{g[X]=ae;break}if(ee[q]<-s?ee[q]=-s:ee[q]>s&&(ee[q]=s),ee[0]===ee[1]){var Ae=Math.max(1,Math.abs(ee[0]*1e-6));ee[0]-=Ae,ee[1]+=Ae}}},g.setScale=function(X){var re=m._size;if(g.overlaying){var ee=b.getFromId({_fullLayout:m},g.overlaying);g.domain=ee.domain}var q=X&&g._r?"_r":"range",ae=g.calendar;g.cleanRange(q);var ie=g.r2l(g[q][0],ae),fe=g.r2l(g[q][1],ae),we=P==="y";if(we?(g._offset=re.t+(1-g.domain[1])*re.h,g._length=re.h*(g.domain[1]-g.domain[0]),g._m=g._length/(ie-fe),g._b=-g._m*fe):(g._offset=re.l+g.domain[0]*re.w,g._length=re.w*(g.domain[1]-g.domain[0]),g._m=g._length/(fe-ie),g._b=-g._m*ie),g._rangebreaks=[],g._lBreaks=0,g._m2=0,g._B=[],g.rangebreaks){var Ae,Fe;if(g._rangebreaks=g.locateBreaks(Math.min(ie,fe),Math.max(ie,fe)),g._rangebreaks.length){for(Ae=0;Aefe&&(Ce=!Ce),Ce&&g._rangebreaks.reverse();var qe=Ce?-1:1;for(g._m2=qe*g._length/(Math.abs(fe-ie)-g._lBreaks),g._B.push(-g._m2*(we?fe:ie)),Ae=0;Aeae&&(ae+=7,ieae&&(ae+=24,ie=q&&ie=q&&X=Je.min&&(ceJe.max&&(Je.max=Re),$e=!1)}$e&&fe.push({min:ce,max:Re})}};for(ee=0;eey*2}function n(f){return Math.max(1,(f-1)/1e3)}function s(f,v){for(var h=f.length,T=n(h),l=0,y=0,b={},S=0;Sl*2}function c(f){return E(f[0])&&E(f[1])}}}),_v=He({"src/plots/cartesian/autorange.js"(Y,G){var d=Qn(),x=Hi(),A=Gr(),E=lo().FP_SAFE,e=Ei(),t=vo(),r=oc(),o=r.getFromId,a=r.isLinked;G.exports={applyAutorangeOptions:g,getAutoRange:i,makePadFn:s,doAutoRange:h,findExtremes:T,concatExtremes:v};function i(m,R){var P,z,F=[],B=m._fullLayout,O=s(B,R,0),L=s(B,R,1),N=v(m,R),U=N.min,Z=N.max;if(U.length===0||Z.length===0)return A.simpleMap(R.range,R.r2l);var Q=U[0].val,ue=Z[0].val;for(P=1;P0&&(Ae=re-O(ae)-L(ie),Ae>ee?Fe/Ae>q&&(fe=ae,we=ie,q=Fe/Ae):Fe/re>q&&(fe={val:ae.val,nopad:1},we={val:ie.val,nopad:1},q=Fe/re));function Ce(Xe,Me){return Math.max(Xe,L(Me))}if(Q===ue){var qe=Q-1,et=Q+1;if($)if(Q===0)F=[0,1];else{var Qe=(Q>0?Z:U).reduce(Ce,0),Ke=Q/(1-Math.min(.5,Qe/re));F=Q>0?[0,Ke]:[Ke,0]}else X?F=[Math.max(0,qe),Math.max(1,et)]:F=[qe,et]}else $?(fe.val>=0&&(fe={val:0,nopad:1}),we.val<=0&&(we={val:0,nopad:1})):X&&(fe.val-q*O(fe)<0&&(fe={val:0,nopad:1}),we.val<=0&&(we={val:1,nopad:1})),q=(we.val-fe.val-n(R,ae.val,ie.val))/(re-O(fe)-L(we)),F=[fe.val-q*O(fe),we.val+q*L(we)];return F=g(F,R),R.limitRange&&R.limitRange(),le&&F.reverse(),A.simpleMap(F,R.l2r||Number)}function n(m,R,P){var z=0;if(m.rangebreaks)for(var F=m.locateBreaks(R,P),B=0;B0?P.ppadplus:P.ppadminus)||P.ppad||0),ae=ee((m._m>0?P.ppadminus:P.ppadplus)||P.ppad||0),ie=ee(P.vpadplus||P.vpad),fe=ee(P.vpadminus||P.vpad);if(!U){if(X=1/0,re=-1/0,N)for(Q=0;Q0&&(X=ue),ue>re&&ue-E&&(X=ue),ue>re&&ue=Fe;Q--)Ae(Q);return{min:z,max:F,opts:P}}function l(m,R,P,z){b(m,R,P,z,M)}function y(m,R,P,z){b(m,R,P,z,_)}function b(m,R,P,z,F){for(var B=z.tozero,O=z.extrapad,L=!0,N=0;N=P&&(U.extrapad||!O)){L=!1;break}else F(R,U.val)&&U.pad<=P&&(O||!U.extrapad)&&(m.splice(N,1),N--)}if(L){var Z=B&&R===0;m.push({val:R,pad:Z?0:P,extrapad:Z?!1:O})}}function S(m){return x(m)&&Math.abs(m)=R}function w(m,R){var P=R.autorangeoptions;return P&&P.minallowed!==void 0&&u(R,P.minallowed,P.maxallowed)?P.minallowed:P&&P.clipmin!==void 0&&u(R,P.clipmin,P.clipmax)?Math.max(m,R.d2l(P.clipmin)):m}function p(m,R){var P=R.autorangeoptions;return P&&P.maxallowed!==void 0&&u(R,P.minallowed,P.maxallowed)?P.maxallowed:P&&P.clipmax!==void 0&&u(R,P.clipmin,P.clipmax)?Math.min(m,R.d2l(P.clipmax)):m}function u(m,R,P){return R!==void 0&&P!==void 0?(R=m.d2l(R),P=m.d2l(P),R=N&&(B=N,P=N),O<=N&&(O=N,z=N)}}return P=w(P,R),z=p(z,R),[P,z]}}}),io=He({"src/plots/cartesian/axes.js"(Y,G){var d=Qn(),x=Hi(),A=yu(),E=Ei(),e=Gr(),t=e.strTranslate,r=yl(),o=kp(),a=Ai(),i=vo(),n=jf(),s=wb(),c=lo(),f=c.ONEMAXYEAR,v=c.ONEAVGYEAR,h=c.ONEMINYEAR,T=c.ONEMAXQUARTER,l=c.ONEAVGQUARTER,y=c.ONEMINQUARTER,b=c.ONEMAXMONTH,S=c.ONEAVGMONTH,M=c.ONEMINMONTH,_=c.ONEWEEK,w=c.ONEDAY,p=w/2,u=c.ONEHOUR,g=c.ONEMIN,m=c.ONESEC,R=c.ONEMILLI,P=c.ONEMICROSEC,z=c.MINUS_SIGN,F=c.BADNUM,B={K:"zeroline"},O={K:"gridline",L:"path"},L={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},U={K:"tick",L:"text"},Z={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},Q=df(),ue=Q.MID_SHIFT,oe=Q.CAP_SHIFT,le=Q.LINE_SPACING,j=Q.OPPOSITE_SIDE,J=3,$=G.exports={};$.setConvert=Uv();var X=N0(),re=oc(),ee=re.idSort,q=re.isLinked;$.id2name=re.id2name,$.name2id=re.name2id,$.cleanId=re.cleanId,$.list=re.list,$.listIds=re.listIds,$.getFromId=re.getFromId,$.getFromTrace=re.getFromTrace;var ae=_v();$.getAutoRange=ae.getAutoRange,$.findExtremes=ae.findExtremes;var ie=1e-4;function fe(dt){var vt=(dt[1]-dt[0])*ie;return[dt[0]-vt,dt[1]+vt]}$.coerceRef=function(dt,vt,Lr,Er,_r,yr){var kr=Er.charAt(Er.length-1),zr=Lr._fullLayout._subplots[kr+"axis"],Pr=Er+"ref",Hr={};return _r||(_r=zr[0]||(typeof yr=="string"?yr:yr[0])),yr||(yr=_r),zr=zr.concat(zr.map(function(Zr){return Zr+" domain"})),Hr[Pr]={valType:"enumerated",values:zr.concat(yr?typeof yr=="string"?[yr]:yr:[]),dflt:_r},e.coerce(dt,vt,Hr,Pr)},$.getRefType=function(dt){return dt===void 0?dt:dt==="paper"?"paper":dt==="pixel"?"pixel":/( domain)$/.test(dt)?"domain":"range"},$.coercePosition=function(dt,vt,Lr,Er,_r,yr){var kr,zr,Pr=$.getRefType(Er);if(Pr!=="range")kr=e.ensureNumber,zr=Lr(_r,yr);else{var Hr=$.getFromId(vt,Er);yr=Hr.fraction2r(yr),zr=Lr(_r,yr),kr=Hr.cleanPos}dt[_r]=kr(zr)},$.cleanPosition=function(dt,vt,Lr){var Er=Lr==="paper"||Lr==="pixel"?e.ensureNumber:$.getFromId(vt,Lr).cleanPos;return Er(dt)},$.redrawComponents=function(dt,vt){vt=vt||$.listIds(dt);var Lr=dt._fullLayout;function Er(_r,yr,kr,zr){for(var Pr=E.getComponentMethod(_r,yr),Hr={},Zr=0;Zr2e-6||((Lr-dt._forceTick0)/dt._minDtick%1+1.000001)%1>2e-6)&&(dt._minDtick=0))},$.saveRangeInitial=function(dt,vt){for(var Lr=$.list(dt,"",!0),Er=!1,_r=0;_rJr*.3||Hr(Er)||Hr(_r))){var wt=Lr.dtick/2;dt+=dt+wtkr){var zr=Number(Lr.substr(1));yr.exactYears>kr&&zr%12===0?dt=$.tickIncrement(dt,"M6","reverse")+w*1.5:yr.exactMonths>kr?dt=$.tickIncrement(dt,"M1","reverse")+w*15.5:dt-=p;var Pr=$.tickIncrement(dt,Lr);if(Pr<=Er)return Pr}return dt}$.prepMinorTicks=function(dt,vt,Lr){if(!vt.minor.dtick){delete dt.dtick;var Er=vt.dtick&&x(vt._tmin),_r;if(Er){var yr=$.tickIncrement(vt._tmin,vt.dtick,!0);_r=[vt._tmin,yr*.99+vt._tmin*.01]}else{var kr=e.simpleMap(vt.range,vt.r2l);_r=[kr[0],.8*kr[0]+.2*kr[1]]}if(dt.range=e.simpleMap(_r,vt.l2r),dt._isMinor=!0,$.prepTicks(dt,Lr),Er){var zr=x(vt.dtick),Pr=x(dt.dtick),Hr=zr?vt.dtick:+vt.dtick.substring(1),Zr=Pr?dt.dtick:+dt.dtick.substring(1);zr&&Pr?et(Hr,Zr)?Hr===2*_&&Zr===2*w&&(dt.dtick=_):Hr===2*_&&Zr===3*w?dt.dtick=_:Hr===_&&!(vt._input.minor||{}).nticks?dt.dtick=w:Qe(Hr/Zr,2.5)?dt.dtick=Hr/2:dt.dtick=Hr:String(vt.dtick).charAt(0)==="M"?Pr?dt.dtick="M1":et(Hr,Zr)?Hr>=12&&Zr===2&&(dt.dtick="M3"):dt.dtick=vt.dtick:String(dt.dtick).charAt(0)==="L"?String(vt.dtick).charAt(0)==="L"?et(Hr,Zr)||(dt.dtick=Qe(Hr/Zr,2.5)?vt.dtick/2:vt.dtick):dt.dtick="D1":dt.dtick==="D2"&&+vt.dtick>1&&(dt.dtick=1)}dt.range=vt.range}vt.minor._tick0Init===void 0&&(dt.tick0=vt.tick0)};function et(dt,vt){return Math.abs((dt/vt+.5)%1-.5)<.001}function Qe(dt,vt){return Math.abs(dt/vt-1)<.001}$.prepTicks=function(dt,vt){var Lr=e.simpleMap(dt.range,dt.r2l,void 0,void 0,vt);if(dt.tickmode==="auto"||!dt.dtick){var Er=dt.nticks,_r;Er||(dt.type==="category"||dt.type==="multicategory"?(_r=dt.tickfont?e.bigFont(dt.tickfont.size||12):15,Er=dt._length/_r):(_r=dt._id.charAt(0)==="y"?40:80,Er=e.constrain(dt._length/_r,4,9)+1),dt._name==="radialaxis"&&(Er*=2)),dt.minor&&dt.minor.tickmode!=="array"||dt.tickmode==="array"&&(Er*=100),dt._roughDTick=Math.abs(Lr[1]-Lr[0])/Er,$.autoTicks(dt,dt._roughDTick),dt._minDtick>0&&dt.dtick0?(yr=Er-1,kr=Er):(yr=Er,kr=Er);var zr=dt[yr].value,Pr=dt[kr].value,Hr=Math.abs(Pr-zr),Zr=Lr||Hr,Jr=0;Zr>=h?Hr>=h&&Hr<=f?Jr=Hr:Jr=v:Lr===l&&Zr>=y?Hr>=y&&Hr<=T?Jr=Hr:Jr=l:Zr>=M?Hr>=M&&Hr<=b?Jr=Hr:Jr=S:Lr===_&&Zr>=_?Jr=_:Zr>=w?Jr=w:Lr===p&&Zr>=p?Jr=p:Lr===u&&Zr>=u&&(Jr=u);var wt;Jr>=Hr&&(Jr=Hr,wt=!0);var Qt=_r+Jr;if(vt.rangebreaks&&Jr>0){for(var mr=84,$r=0,oa=0;oa_&&(Jr=Hr)}(Jr>0||Er===0)&&(dt[Er].periodX=_r+Jr/2)}}$.calcTicks=function(vt,Lr){for(var Er=vt.type,_r=vt.calendar,yr=vt.ticklabelstep,kr=vt.ticklabelmode==="period",zr=vt.range[0]>vt.range[1],Pr=!vt.ticklabelindex||e.isArrayOrTypedArray(vt.ticklabelindex)?vt.ticklabelindex:[vt.ticklabelindex],Hr=e.simpleMap(vt.range,vt.r2l,void 0,void 0,Lr),Zr=Hr[1]=(ra?0:1);pa--){var pn=!pa;pa?(vt._dtickInit=vt.dtick,vt._tick0Init=vt.tick0):(vt.minor._dtickInit=vt.minor.dtick,vt.minor._tick0Init=vt.minor.tick0);var Ga=pa?vt:e.extendFlat({},vt,vt.minor);if(pn?$.prepMinorTicks(Ga,vt,Lr):$.prepTicks(Ga,Lr),Ga.tickmode==="array"){pa?(oa=[],mr=Re(vt,!pn)):(Sa=[],$r=Re(vt,!pn));continue}if(Ga.tickmode==="sync"){oa=[],mr=ce(vt);continue}var qn=fe(Hr),Vn=qn[0],di=qn[1],yi=x(Ga.dtick),Ci=Er==="log"&&!(yi||Ga.dtick.charAt(0)==="L"),ci=$.tickFirst(Ga,Lr);if(pa){if(vt._tmin=ci,ci=di:mi<=di;mi=$.tickIncrement(mi,Wo,Zr,_r)){if(pa&&uo++,Ga.rangebreaks&&!Zr){if(mi=wt)break}if(oa.length>Qt||mi===ei)break;ei=mi;var li={value:mi};pa?(Ci&&mi!==(mi|0)&&(li.simpleLabel=!0),yr>1&&uo%yr&&(li.skipLabel=!0),oa.push(li)):(li.minor=!0,Sa.push(li))}}if(!Sa||Sa.length<2)Pr=!1;else{var Ii=(Sa[1].value-Sa[0].value)*(zr?-1:1);Oa(Ii,vt.tickformat)||(Pr=!1)}if(!Pr)ya=oa;else{var xi=oa.concat(Sa);kr&&oa.length&&(xi=xi.slice(1)),xi=xi.sort(function(Pi,zo){return Pi.value-zo.value}).filter(function(Pi,zo,wo){return zo===0||Pi.value!==wo[zo-1].value});var Ao=xi.map(function(Pi,zo){return Pi.minor===void 0&&!Pi.skipLabel?zo:null}).filter(function(Pi){return Pi!==null});Ao.forEach(function(Pi){Pr.map(function(zo){var wo=Pi+zo;wo>=0&&wo-1;Qa--){if(oa[Qa].drop){oa.splice(Qa,1);continue}oa[Qa].value=Ur(oa[Qa].value,vt);var Ui=vt.c2p(oa[Qa].value);(Jn?ds>Ui-Os:dswt||biwt&&(wo.periodX=wt),bi_r&&wtv)vt/=v,Er=_r(10),dt.dtick="M"+12*ir(vt,Er,$e);else if(yr>S)vt/=S,dt.dtick="M"+ir(vt,1,rt);else if(yr>w){if(dt.dtick=ir(vt,w,dt._hasDayOfWeekBreaks?[1,2,7,14]:At),!Lr){var kr=$.getTickFormat(dt),zr=dt.ticklabelmode==="period";zr&&(dt._rawTick0=dt.tick0),/%[uVW]/.test(kr)?dt.tick0=e.dateTick0(dt.calendar,2):dt.tick0=e.dateTick0(dt.calendar,1),zr&&(dt._dowTick0=dt.tick0)}}else yr>u?dt.dtick=ir(vt,u,rt):yr>g?dt.dtick=ir(vt,g,Je):yr>m?dt.dtick=ir(vt,m,Je):(Er=_r(10),dt.dtick=ir(vt,Er,$e))}else if(dt.type==="log"){dt.tick0=0;var Pr=e.simpleMap(dt.range,dt.r2l);if(dt._isMinor&&(vt*=1.5),vt>.7)dt.dtick=Math.ceil(vt);else if(Math.abs(Pr[1]-Pr[0])<1){var Hr=1.5*Math.abs((Pr[1]-Pr[0])/vt);vt=Math.abs(Math.pow(10,Pr[1])-Math.pow(10,Pr[0]))/Hr,Er=_r(10),dt.dtick="L"+ir(vt,Er,$e)}else dt.dtick=vt>.3?"D2":"D1"}else dt.type==="category"||dt.type==="multicategory"?(dt.tick0=0,dt.dtick=Math.ceil(Math.max(vt,1))):na(dt)?(dt.tick0=0,Er=1,dt.dtick=ir(vt,Er,Ut)):(dt.tick0=0,Er=_r(10),dt.dtick=ir(vt,Er,$e));if(dt.dtick===0&&(dt.dtick=1),!x(dt.dtick)&&typeof dt.dtick!="string"){var Zr=dt.dtick;throw dt.dtick=1,"ax.dtick error: "+String(Zr)}};function ar(dt){var vt=dt.dtick;if(dt._tickexponent=0,!x(vt)&&typeof vt!="string"&&(vt=1),(dt.type==="category"||dt.type==="multicategory")&&(dt._tickround=null),dt.type==="date"){var Lr=dt.r2l(dt.tick0),Er=dt.l2r(Lr).replace(/(^-|i)/g,""),_r=Er.length;if(String(vt).charAt(0)==="M")_r>10||Er.substr(5)!=="01-01"?dt._tickround="d":dt._tickround=+vt.substr(1)%12===0?"y":"m";else if(vt>=w&&_r<=10||vt>=w*15)dt._tickround="d";else if(vt>=g&&_r<=16||vt>=u)dt._tickround="M";else if(vt>=m&&_r<=19||vt>=g)dt._tickround="S";else{var yr=dt.l2r(Lr+vt).replace(/^-/,"").length;dt._tickround=Math.max(_r,yr)-20,dt._tickround<0&&(dt._tickround=4)}}else if(x(vt)||vt.charAt(0)==="L"){var kr=dt.range.map(dt.r2d||Number);x(vt)||(vt=Number(vt.substr(1))),dt._tickround=2-Math.floor(Math.log(vt)/Math.LN10+.01);var zr=Math.max(Math.abs(kr[0]),Math.abs(kr[1])),Pr=Math.floor(Math.log(zr)/Math.LN10+.01),Hr=dt.minexponent===void 0?3:dt.minexponent;Math.abs(Pr)>Hr&&(be(dt.exponentformat)&&!Pe(Pr)?dt._tickexponent=3*Math.round((Pr-1)/3):dt._tickexponent=Pr)}else dt._tickround=null}$.tickIncrement=function(dt,vt,Lr,Er){var _r=Lr?-1:1;if(x(vt))return e.increment(dt,_r*vt);var yr=vt.charAt(0),kr=_r*Number(vt.substr(1));if(yr==="M")return e.incrementMonth(dt,kr,Er);if(yr==="L")return Math.log(Math.pow(10,dt)+kr)/Math.LN10;if(yr==="D"){var zr=vt==="D2"?Rt:St,Pr=dt+_r*.01,Hr=e.roundUp(e.mod(Pr,1),zr,Lr);return Math.floor(Pr)+Math.log(d.round(Math.pow(10,Hr),1))/Math.LN10}throw"unrecognized dtick "+String(vt)},$.tickFirst=function(dt,vt){var Lr=dt.r2l||Number,Er=e.simpleMap(dt.range,Lr,void 0,void 0,vt),_r=Er[1]=0&&Sa<=dt._length?oa:null};if(yr&&e.isArrayOrTypedArray(dt.ticktext)){var Jr=e.simpleMap(dt.range,dt.r2l),wt=(Math.abs(Jr[1]-Jr[0])-(dt._lBreaks||0))/1e4;for(Hr=0;Hr"+zr;else{var Hr=ga(dt),Zr=dt._trueSide||dt.side;(!Hr&&Zr==="top"||Hr&&Zr==="bottom")&&(kr+="
")}vt.text=kr}function dr(dt,vt,Lr,Er,_r){var yr=dt.dtick,kr=vt.x,zr=dt.tickformat,Pr=typeof yr=="string"&&yr.charAt(0);if(_r==="never"&&(_r=""),Er&&Pr!=="L"&&(yr="L3",Pr="L"),zr||Pr==="L")vt.text=We(Math.pow(10,kr),dt,_r,Er);else if(x(yr)||Pr==="D"&&e.mod(kr+.01,1)<.1){var Hr=Math.round(kr),Zr=Math.abs(Hr),Jr=dt.exponentformat;Jr==="power"||be(Jr)&&Pe(Hr)?(Hr===0?vt.text=1:Hr===1?vt.text="10":vt.text="10"+(Hr>1?"":z)+Zr+"",vt.fontSize*=1.25):(Jr==="e"||Jr==="E")&&Zr>2?vt.text="1"+Jr+(Hr>0?"+":z)+Zr:(vt.text=We(Math.pow(10,kr),dt,"","fakehover"),yr==="D1"&&dt._id.charAt(0)==="y"&&(vt.dy-=vt.fontSize/6))}else if(Pr==="D")vt.text=String(Math.round(Math.pow(10,e.mod(kr,1)))),vt.fontSize*=.75;else throw"unrecognized dtick "+String(yr);if(dt.dtick==="D1"){var wt=String(vt.text).charAt(0);(wt==="0"||wt==="1")&&(dt._id.charAt(0)==="y"?vt.dx-=vt.fontSize/4:(vt.dy+=vt.fontSize/2,vt.dx+=(dt.range[1]>dt.range[0]?1:-1)*vt.fontSize*(kr<0?.5:.25)))}}function pt(dt,vt){var Lr=dt._categories[Math.round(vt.x)];Lr===void 0&&(Lr=""),vt.text=String(Lr)}function ze(dt,vt,Lr){var Er=Math.round(vt.x),_r=dt._categories[Er]||[],yr=_r[1]===void 0?"":String(_r[1]),kr=_r[0]===void 0?"":String(_r[0]);Lr?vt.text=kr+" - "+yr:(vt.text=yr,vt.text2=kr)}function Ge(dt,vt,Lr,Er,_r){_r==="never"?_r="":dt.showexponent==="all"&&Math.abs(vt.x/dt.dtick)<1e-6&&(_r="hide"),vt.text=We(vt.x,dt,_r,Er)}function Oe(dt,vt,Lr,Er,_r){if(dt.thetaunit==="radians"&&!Lr){var yr=vt.x/180;if(yr===0)vt.text="0";else{var kr=ve(yr);if(kr[1]>=100)vt.text=We(e.deg2rad(vt.x),dt,_r,Er);else{var zr=vt.x<0;kr[1]===1?kr[0]===1?vt.text="π":vt.text=kr[0]+"π":vt.text=["",kr[0],"","⁄","",kr[1],"","π"].join(""),zr&&(vt.text=z+vt.text)}}}else vt.text=We(vt.x,dt,_r,Er)}function ve(dt){function vt(zr,Pr){return Math.abs(zr-Pr)<=1e-6}function Lr(zr,Pr){return vt(Pr,0)?zr:Lr(Pr,zr%Pr)}function Er(zr){for(var Pr=1;!vt(Math.round(zr*Pr)/Pr,zr);)Pr*=10;return Pr}var _r=Er(dt),yr=dt*_r,kr=Math.abs(Lr(yr,_r));return[Math.round(yr/kr),Math.round(_r/kr)]}var ge=["f","p","n","μ","m","","k","M","G","T"];function be(dt){return dt==="SI"||dt==="B"}function Pe(dt){return dt>14||dt<-15}function We(dt,vt,Lr,Er){var _r=dt<0,yr=vt._tickround,kr=Lr||vt.exponentformat||"B",zr=vt._tickexponent,Pr=$.getTickFormat(vt),Hr=vt.separatethousands;if(Er){var Zr={exponentformat:kr,minexponent:vt.minexponent,dtick:vt.showexponent==="none"?vt.dtick:x(dt)&&Math.abs(dt)||1,range:vt.showexponent==="none"?vt.range.map(vt.r2d):[0,dt||1]};ar(Zr),yr=(Number(Zr._tickround)||0)+4,zr=Zr._tickexponent,vt.hoverformat&&(Pr=vt.hoverformat)}if(Pr)return vt._numFormat(Pr)(dt).replace(/-/g,z);var Jr=Math.pow(10,-yr)/2;if(kr==="none"&&(zr=0),dt=Math.abs(dt),dt"+mr+"":kr==="B"&&zr===9?dt+="B":be(kr)&&(dt+=ge[zr/3+5])}return _r?z+dt:dt}$.getTickFormat=function(dt){var vt;function Lr(Pr){return typeof Pr!="string"?Pr:Number(Pr.replace("M",""))*S}function Er(Pr,Hr){var Zr=["L","D"];if(typeof Pr==typeof Hr){if(typeof Pr=="number")return Pr-Hr;var Jr=Zr.indexOf(Pr.charAt(0)),wt=Zr.indexOf(Hr.charAt(0));return Jr===wt?Number(Pr.replace(/(L|D)/g,""))-Number(Hr.replace(/(L|D)/g,"")):Jr-wt}else return typeof Pr=="number"?1:-1}function _r(Pr,Hr,Zr){var Jr=Zr||function(mr){return mr},wt=Hr[0],Qt=Hr[1];return(!wt&&typeof wt!="number"||Jr(wt)<=Jr(Pr))&&(!Qt&&typeof Qt!="number"||Jr(Qt)>=Jr(Pr))}function yr(Pr,Hr){var Zr=Hr[0]===null,Jr=Hr[1]===null,wt=Er(Pr,Hr[0])>=0,Qt=Er(Pr,Hr[1])<=0;return(Zr||wt)&&(Jr||Qt)}var kr,zr;if(dt.tickformatstops&&dt.tickformatstops.length>0)switch(dt.type){case"date":case"linear":{for(vt=0;vt=0&&_r.unshift(_r.splice(Zr,1).shift())}});var zr={false:{left:0,right:0}};return e.syncOrAsync(_r.map(function(Pr){return function(){if(Pr){var Hr=$.getFromId(dt,Pr);Lr||(Lr={}),Lr.axShifts=zr,Lr.overlayingShiftedAx=kr;var Zr=$.drawOne(dt,Hr,Lr);return Hr._shiftPusher&&Pa(Hr,Hr._fullDepth||0,zr,!0),Hr._r=Hr.range.slice(),Hr._rl=e.simpleMap(Hr._r,Hr.r2l),Zr}}}))},$.drawOne=function(dt,vt,Lr){Lr=Lr||{};var Er=Lr.axShifts||{},_r=Lr.overlayingShiftedAx||[],yr,kr,zr;vt.setScale();var Pr=dt._fullLayout,Hr=vt._id,Zr=Hr.charAt(0),Jr=$.counterLetter(Hr),wt=Pr._plots[vt._mainSubplot];if(!wt)return;if(vt._shiftPusher=vt.autoshift||_r.indexOf(vt._id)!==-1||_r.indexOf(vt.overlaying)!==-1,vt._shiftPusher&vt.anchor==="free"){var Qt=vt.linewidth/2||0;vt.ticks==="inside"&&(Qt+=vt.ticklen),Pa(vt,Qt,Er,!0),Pa(vt,vt.shift||0,Er,!1)}(Lr.skipTitle!==!0||vt._shift===void 0)&&(vt._shift=sa(vt,Er));var mr=wt[Zr+"axislayer"],$r=vt._mainLinePosition,oa=$r+=vt._shift,Sa=vt._mainMirrorPosition,ya=vt._vals=$.calcTicks(vt),ra=[vt.mirror,oa,Sa].join("_");for(yr=0;yr0?wo.bottom-Pi:0,zo))));var Js=0,Ql=0;if(vt._shiftPusher&&(Js=Math.max(zo,wo.height>0?Rn==="l"?Pi-wo.left:wo.right-Pi:0),vt.title.text!==Pr._dfltTitle[Zr]&&(Ql=(vt._titleStandoff||0)+(vt._titleScoot||0),Rn==="l"&&(Ql+=da(vt))),vt._fullDepth=Math.max(Js,Ql)),vt.automargin){bi={x:0,y:0,r:0,l:0,t:0,b:0};var Ws=[0,1],Is=typeof vt._shift=="number"?vt._shift:0;if(Zr==="x"){if(Rn==="b"?bi[Rn]=vt._depth:(bi[Rn]=vt._depth=Math.max(wo.width>0?Pi-wo.top:0,zo),Ws.reverse()),wo.width>0){var Dl=wo.right-(vt._offset+vt._length);Dl>0&&(bi.xr=1,bi.r=Dl);var Xu=vt._offset-wo.left;Xu>0&&(bi.xl=0,bi.l=Xu)}}else if(Rn==="l"?(vt._depth=Math.max(wo.height>0?Pi-wo.left:0,zo),bi[Rn]=vt._depth-Is):(vt._depth=Math.max(wo.height>0?wo.right-Pi:0,zo),bi[Rn]=vt._depth+Is,Ws.reverse()),wo.height>0){var Lu=wo.bottom-(vt._offset+vt._length);Lu>0&&(bi.yb=0,bi.b=Lu);var Bu=vt._offset-wo.top;Bu>0&&(bi.yt=1,bi.t=Bu)}bi[Jr]=vt.anchor==="free"?vt.position:vt._anchorAxis.domain[Ws[0]],vt.title.text!==Pr._dfltTitle[Zr]&&(bi[Rn]+=da(vt)+(vt.title.standoff||0)),vt.mirror&&vt.anchor!=="free"&&(wl={x:0,y:0,r:0,l:0,t:0,b:0},wl[fo]=vt.linewidth,vt.mirror&&vt.mirror!==!0&&(wl[fo]+=zo),vt.mirror===!0||vt.mirror==="ticks"?wl[Jr]=vt._anchorAxis.domain[Ws[1]]:(vt.mirror==="all"||vt.mirror==="allticks")&&(wl[Jr]=[vt._counterDomainMin,vt._counterDomainMax][Ws[1]]))}Ks&&($l=E.getComponentMethod("rangeslider","autoMarginOpts")(dt,vt)),typeof vt.automargin=="string"&&(ct(bi,vt.automargin),ct(wl,vt.automargin)),A.autoMargin(dt,Ka(vt),bi),A.autoMargin(dt,Vt(vt),wl),A.autoMargin(dt,Lt(vt),$l)}),e.syncOrAsync(Mo)}};function ct(dt,vt){if(dt){var Lr=Object.keys(Z).reduce(function(Er,_r){return vt.indexOf(_r)!==-1&&Z[_r].forEach(function(yr){Er[yr]=1}),Er},{});Object.keys(dt).forEach(function(Er){Lr[Er]||(Er.length===1?dt[Er]=0:delete dt[Er])})}}function _t(dt,vt){var Lr=[],Er,_r=function(yr,kr){var zr=yr.xbnd[kr];zr!==null&&Lr.push(e.extendFlat({},yr,{x:zr}))};if(vt.length){for(Er=0;Erdt.range[1],zr=dt.ticklabelposition&&dt.ticklabelposition.indexOf("inside")!==-1,Pr=!zr;if(Lr){var Hr=kr?-1:1;Lr=Lr*Hr}if(Er){var Zr=dt.side,Jr=zr&&(Zr==="top"||Zr==="left")||Pr&&(Zr==="bottom"||Zr==="right")?1:-1;Er=Er*Jr}return dt._id.charAt(0)==="x"?function(wt){return t(_r+dt._offset+dt.l2p(qt(wt))+Lr,yr+Er)}:function(wt){return t(yr+Er,_r+dt._offset+dt.l2p(qt(wt))+Lr)}};function qt(dt){return dt.periodX!==void 0?dt.periodX:dt.x}function Zt(dt){var vt=dt.ticklabelposition||"",Lr=function(Qt){return vt.indexOf(Qt)!==-1},Er=Lr("top"),_r=Lr("left"),yr=Lr("right"),kr=Lr("bottom"),zr=Lr("inside"),Pr=kr||_r||Er||yr;if(!Pr&&!zr)return[0,0];var Hr=dt.side,Zr=Pr?(dt.tickwidth||0)/2:0,Jr=J,wt=dt.tickfont?dt.tickfont.size:12;return(kr||Er)&&(Zr+=wt*oe,Jr+=(dt.linewidth||0)/2),(_r||yr)&&(Zr+=(dt.linewidth||0)/2,Jr+=J),zr&&Hr==="top"&&(Jr-=wt*(1-oe)),(_r||Er)&&(Zr=-Zr),(Hr==="bottom"||Hr==="right")&&(Jr=-Jr),[Pr?Zr:0,zr?Jr:0]}$.makeTickPath=function(dt,vt,Lr,Er){Er||(Er={});var _r=Er.minor;if(_r&&!dt.minor)return"";var yr=Er.len!==void 0?Er.len:_r?dt.minor.ticklen:dt.ticklen,kr=dt._id.charAt(0),zr=(dt.linewidth||1)/2;return kr==="x"?"M0,"+(vt+zr*Lr)+"v"+yr*Lr:"M"+(vt+zr*Lr)+",0h"+yr*Lr},$.makeLabelFns=function(dt,vt,Lr){var Er=dt.ticklabelposition||"",_r=function(ci){return Er.indexOf(ci)!==-1},yr=_r("top"),kr=_r("left"),zr=_r("right"),Pr=_r("bottom"),Hr=Pr||kr||yr||zr,Zr=_r("inside"),Jr=Er==="inside"&&dt.ticks==="inside"||!Zr&&dt.ticks==="outside"&&dt.tickson!=="boundaries",wt=0,Qt=0,mr=Jr?dt.ticklen:0;if(Zr?mr*=-1:Hr&&(mr=0),Jr&&(wt+=mr,Lr)){var $r=e.deg2rad(Lr);wt=mr*Math.cos($r)+1,Qt=mr*Math.sin($r)}dt.showticklabels&&(Jr||dt.showline)&&(wt+=.2*dt.tickfont.size),wt+=(dt.linewidth||1)/2*(Zr?-1:1);var oa={labelStandoff:wt,labelShift:Qt},Sa,ya,ra,pa,pn=0,Ga=dt.side,qn=dt._id.charAt(0),Vn=dt.tickangle,di;if(qn==="x")di=!Zr&&Ga==="bottom"||Zr&&Ga==="top",pa=di?1:-1,Zr&&(pa*=-1),Sa=Qt*pa,ya=vt+wt*pa,ra=di?1:-.2,Math.abs(Vn)===90&&(Zr?ra+=ue:Vn===-90&&Ga==="bottom"?ra=oe:Vn===90&&Ga==="top"?ra=ue:ra=.5,pn=ue/2*(Vn/90)),oa.xFn=function(ci){return ci.dx+Sa+pn*ci.fontSize},oa.yFn=function(ci){return ci.dy+ya+ci.fontSize*ra},oa.anchorFn=function(ci,ei){if(Hr){if(kr)return"end";if(zr)return"start"}return!x(ei)||ei===0||ei===180?"middle":ei*pa<0!==Zr?"end":"start"},oa.heightFn=function(ci,ei,mi){return ei<-60||ei>60?-.5*mi:dt.side==="top"!==Zr?-mi:0};else if(qn==="y"){if(di=!Zr&&Ga==="left"||Zr&&Ga==="right",pa=di?1:-1,Zr&&(pa*=-1),Sa=wt,ya=Qt*pa,ra=0,!Zr&&Math.abs(Vn)===90&&(Vn===-90&&Ga==="left"||Vn===90&&Ga==="right"?ra=oe:ra=.5),Zr){var yi=x(Vn)?+Vn:0;if(yi!==0){var Ci=e.deg2rad(yi);pn=Math.abs(Math.sin(Ci))*oe*pa,ra=0}}oa.xFn=function(ci){return ci.dx+vt-(Sa+ci.fontSize*ra)*pa+pn*ci.fontSize},oa.yFn=function(ci){return ci.dy+ya+ci.fontSize*ue},oa.anchorFn=function(ci,ei){return x(ei)&&Math.abs(ei)===90?"middle":di?"end":"start"},oa.heightFn=function(ci,ei,mi){return dt.side==="right"&&(ei*=-1),ei<-30?-mi:ei<30?-.5*mi:0}}return oa};function lr(dt){return[dt.text,dt.x,dt.axInfo,dt.font,dt.fontSize,dt.fontColor].join("_")}$.drawTicks=function(dt,vt,Lr){Lr=Lr||{};var Er=vt._id+"tick",_r=[].concat(vt.minor&&vt.minor.ticks?Lr.vals.filter(function(kr){return kr.minor&&!kr.noTick}):[]).concat(vt.ticks?Lr.vals.filter(function(kr){return!kr.minor&&!kr.noTick}):[]),yr=Lr.layer.selectAll("path."+Er).data(_r,lr);yr.exit().remove(),yr.enter().append("path").classed(Er,1).classed("ticks",1).classed("crisp",Lr.crisp!==!1).each(function(kr){return a.stroke(d.select(this),kr.minor?vt.minor.tickcolor:vt.tickcolor)}).style("stroke-width",function(kr){return i.crispRound(dt,kr.minor?vt.minor.tickwidth:vt.tickwidth,1)+"px"}).attr("d",Lr.path).style("display",null),Aa(vt,[N]),yr.attr("transform",Lr.transFn)},$.drawGrid=function(dt,vt,Lr){if(Lr=Lr||{},vt.tickmode!=="sync"){var Er=vt._id+"grid",_r=vt.minor&&vt.minor.showgrid,yr=_r?Lr.vals.filter(function(Sa){return Sa.minor}):[],kr=vt.showgrid?Lr.vals.filter(function(Sa){return!Sa.minor}):[],zr=Lr.counterAxis;if(zr&&$.shouldShowZeroLine(dt,vt,zr))for(var Pr=vt.tickmode==="array",Hr=0;Hr=0;mr--){var $r=mr?wt:Qt;if($r){var oa=$r.selectAll("path."+Er).data(mr?kr:yr,lr);oa.exit().remove(),oa.enter().append("path").classed(Er,1).classed("crisp",Lr.crisp!==!1),oa.attr("transform",Lr.transFn).attr("d",Lr.path).each(function(Sa){return a.stroke(d.select(this),Sa.minor?vt.minor.gridcolor:vt.gridcolor||"#ddd")}).style("stroke-dasharray",function(Sa){return i.dashStyle(Sa.minor?vt.minor.griddash:vt.griddash,Sa.minor?vt.minor.gridwidth:vt.gridwidth)}).style("stroke-width",function(Sa){return(Sa.minor?Jr:vt._gw)+"px"}).style("display",null),typeof Lr.path=="function"&&oa.attr("d",Lr.path)}}Aa(vt,[O,L])}},$.drawZeroLine=function(dt,vt,Lr){Lr=Lr||Lr;var Er=vt._id+"zl",_r=$.shouldShowZeroLine(dt,vt,Lr.counterAxis),yr=Lr.layer.selectAll("path."+Er).data(_r?[{x:0,id:vt._id}]:[]);yr.exit().remove(),yr.enter().append("path").classed(Er,1).classed("zl",1).classed("crisp",Lr.crisp!==!1).each(function(){Lr.layer.selectAll("path").sort(function(kr,zr){return ee(kr.id,zr.id)})}),yr.attr("transform",Lr.transFn).attr("d",Lr.path).call(a.stroke,vt.zerolinecolor||a.defaultLine).style("stroke-width",i.crispRound(dt,vt.zerolinewidth,vt._gw||1)+"px").style("display",null),Aa(vt,[B])},$.drawLabels=function(dt,vt,Lr){Lr=Lr||{};var Er=dt._fullLayout,_r=vt._id,yr=Lr.cls||_r+"tick",kr=Lr.vals.filter(function(li){return li.text}),zr=Lr.labelFns,Pr=Lr.secondary?0:vt.tickangle,Hr=(vt._prevTickAngles||{})[yr],Zr=Lr.layer.selectAll("g."+yr).data(vt.showticklabels?kr:[],lr),Jr=[];Zr.enter().append("g").classed(yr,1).append("text").attr("text-anchor","middle").each(function(li){var Ii=d.select(this),xi=dt._promises.length;Ii.call(r.positionText,zr.xFn(li),zr.yFn(li)).call(i.font,{family:li.font,size:li.fontSize,color:li.fontColor,weight:li.fontWeight,style:li.fontStyle,variant:li.fontVariant,textcase:li.fontTextcase,lineposition:li.fontLineposition,shadow:li.fontShadow}).text(li.text).call(r.convertToTspans,dt),dt._promises[xi]?Jr.push(dt._promises.pop().then(function(){wt(Ii,Pr)})):wt(Ii,Pr)}),Aa(vt,[U]),Zr.exit().remove(),Lr.repositionOnUpdate&&Zr.each(function(li){d.select(this).select("text").call(r.positionText,zr.xFn(li),zr.yFn(li))});function wt(li,Ii){li.each(function(xi){var Ao=d.select(this),So=Ao.select(".text-math-group"),Ro=zr.anchorFn(xi,Ii),Li=Lr.transFn.call(Ao.node(),xi)+(x(Ii)&&+Ii!=0?" rotate("+Ii+","+zr.xFn(xi)+","+(zr.yFn(xi)-xi.fontSize/2)+")":""),Yi=r.lineCount(Ao),bs=le*xi.fontSize,as=zr.heightFn(xi,x(Ii)?+Ii:0,(Yi-1)*bs);if(as&&(Li+=t(0,as)),So.empty()){var fs=Ao.select("text");fs.attr({transform:Li,"text-anchor":Ro}),fs.style("opacity",1),vt._adjustTickLabelsOverflow&&vt._adjustTickLabelsOverflow()}else{var Co=i.bBox(So.node()).width,Qa=Co*{end:-.5,start:.5}[Ro];So.attr("transform",Li+t(Qa,0))}})}vt._adjustTickLabelsOverflow=function(){var li=vt.ticklabeloverflow;if(!(!li||li==="allow")){var Ii=li.indexOf("hide")!==-1,xi=vt._id.charAt(0)==="x",Ao=0,So=xi?dt._fullLayout.width:dt._fullLayout.height;if(li.indexOf("domain")!==-1){var Ro=e.simpleMap(vt.range,vt.r2l);Ao=vt.l2p(Ro[0])+vt._offset,So=vt.l2p(Ro[1])+vt._offset}var Li=Math.min(Ao,So),Yi=Math.max(Ao,So),bs=vt.side,as=1/0,fs=-1/0;Zr.each(function(Os){var ds=d.select(this),Ui=ds.select(".text-math-group");if(Ui.empty()){var ms=i.bBox(ds.node()),Mo=0;xi?(ms.right>Yi||ms.leftYi||ms.top+(vt.tickangle?0:Os.fontSize/4)vt["_visibleLabelMin_"+Ro._id]?Os.style("display","none"):Yi.K==="tick"&&!Li&&Os.style("display",null)})})})})},wt(Zr,Hr+1?Hr:Pr);function Qt(){return Jr.length&&Promise.all(Jr)}var mr=null;function $r(){if(wt(Zr,Pr),kr.length&&vt.autotickangles&&(vt.type!=="log"||String(vt.dtick).charAt(0)!=="D")){mr=vt.autotickangles[0];var li=0,Ii=[],xi,Ao=1;Zr.each(function(wo){li=Math.max(li,wo.fontSize);var bi=vt.l2p(wo.x),wl=La(this),$l=i.bBox(wl.node());Ao=Math.max(Ao,r.lineCount(wl)),Ii.push({top:0,bottom:10,height:10,left:bi-$l.width/2,right:bi+$l.width/2+2,width:$l.width+2})});var So=(vt.tickson==="boundaries"||vt.showdividers)&&!Lr.secondary,Ro=kr.length,Li=Math.abs((kr[Ro-1].x-kr[0].x)*vt._m)/(Ro-1),Yi=So?Li/2:Li,bs=So?vt.ticklen:li*1.25*Ao,as=Math.sqrt(Math.pow(Yi,2)+Math.pow(bs,2)),fs=Yi/as,Co=vt.autotickangles.map(function(wo){return wo*Math.PI/180}),Qa=Co.find(function(wo){return Math.abs(Math.cos(wo))<=fs});Qa===void 0&&(Qa=Co.reduce(function(wo,bi){return Math.abs(Math.cos(wo))uo*mi&&(Ci=mi,Vn[qn]=di[qn]=ci[qn])}var Lo=Math.abs(Ci-yi);Lo-pa>0?(Lo-=pa,pa*=1+pa/Lo):pa=0,vt._id.charAt(0)!=="y"&&(pa=-pa),Vn[Ga]=ya.p2r(ya.r2p(di[Ga])+pn*pa),ya.autorange==="min"||ya.autorange==="max reversed"?(Vn[0]=null,ya._rangeInitial0=void 0,ya._rangeInitial1=void 0):(ya.autorange==="max"||ya.autorange==="min reversed")&&(Vn[1]=null,ya._rangeInitial0=void 0,ya._rangeInitial1=void 0),Er._insideTickLabelsUpdaterange[ya._name+".range"]=Vn}var Wo=e.syncOrAsync(oa);return Wo&&Wo.then&&dt._promises.push(Wo),Wo};function ta(dt,vt,Lr){var Er=vt._id+"divider",_r=Lr.vals,yr=Lr.layer.selectAll("path."+Er).data(_r,lr);yr.exit().remove(),yr.enter().insert("path",":first-child").classed(Er,1).classed("crisp",1).call(a.stroke,vt.dividercolor).style("stroke-width",i.crispRound(dt,vt.dividerwidth,1)+"px"),yr.attr("transform",Lr.transFn).attr("d",Lr.path)}$.getPxPosition=function(dt,vt){var Lr=dt._fullLayout._size,Er=vt._id.charAt(0),_r=vt.side,yr;if(vt.anchor!=="free"?yr=vt._anchorAxis:Er==="x"?yr={_offset:Lr.t+(1-(vt.position||0))*Lr.h,_length:0}:Er==="y"&&(yr={_offset:Lr.l+(vt.position||0)*Lr.w+vt._shift,_length:0}),_r==="top"||_r==="left")return yr._offset;if(_r==="bottom"||_r==="right")return yr._offset+yr._length};function da(dt){var vt=dt.title.font.size,Lr=(dt.title.text.match(r.BR_TAG_ALL)||[]).length;return dt.title.hasOwnProperty("standoff")?vt*(oe+Lr*le):Lr?vt*(Lr+1)*le:vt}function wa(dt,vt){var Lr=dt._fullLayout,Er=vt._id,_r=Er.charAt(0),yr=vt.title.font.size,kr,zr=(vt.title.text.match(r.BR_TAG_ALL)||[]).length;if(vt.title.hasOwnProperty("standoff"))vt.side==="bottom"||vt.side==="right"?kr=vt._depth+vt.title.standoff+yr*oe:(vt.side==="top"||vt.side==="left")&&(kr=vt._depth+vt.title.standoff+yr*(ue+zr*le));else{var Pr=ga(vt);if(vt.type==="multicategory")kr=vt._depth;else{var Hr=1.5*yr;Pr&&(Hr=.5*yr,vt.ticks==="outside"&&(Hr+=vt.ticklen)),kr=10+Hr+(vt.linewidth?vt.linewidth-1:0)}Pr||(_r==="x"?kr+=vt.side==="top"?yr*(vt.showticklabels?1:0):yr*(vt.showticklabels?1.5:.5):kr+=vt.side==="right"?yr*(vt.showticklabels?1:.5):yr*(vt.showticklabels?.5:0))}var Zr=$.getPxPosition(dt,vt),Jr,wt,Qt;_r==="x"?(wt=vt._offset+vt._length/2,Qt=vt.side==="top"?Zr-kr:Zr+kr):(Qt=vt._offset+vt._length/2,wt=vt.side==="right"?Zr+kr:Zr-kr,Jr={rotate:"-90",offset:0});var mr;if(vt.type!=="multicategory"){var $r=vt._selections[vt._id+"tick"];if(mr={selection:$r,side:vt.side},$r&&$r.node()&&$r.node().parentNode){var oa=i.getTranslate($r.node().parentNode);mr.offsetLeft=oa.x,mr.offsetTop=oa.y}vt.title.hasOwnProperty("standoff")&&(mr.pad=0)}return vt._titleStandoff=kr,o.draw(dt,Er+"title",{propContainer:vt,propName:vt._name+".title.text",placeholder:Lr._dfltTitle[_r],avoid:mr,transform:Jr,attributes:{x:wt,y:Qt,"text-anchor":"middle"}})}$.shouldShowZeroLine=function(dt,vt,Lr){var Er=e.simpleMap(vt.range,vt.r2l);return Er[0]*Er[1]<=0&&vt.zeroline&&(vt.type==="linear"||vt.type==="-")&&!(vt.rangebreaks&&vt.maskBreaks(0)===F)&&(ma(vt,0)||!Ia(dt,vt,Lr,Er)||va(dt,vt))},$.clipEnds=function(dt,vt){return vt.filter(function(Lr){return ma(dt,Lr.x)})};function ma(dt,vt){var Lr=dt.l2p(vt);return Lr>1&&Lr1)for(_r=1;_r=_r.min&&dt<_r.max)return _r.max}return dt}function ga(dt){return(dt.ticklabelposition||"").indexOf("inside")!==-1}function Aa(dt,vt){ga(dt._anchorAxis||{})&&dt._hideCounterAxisInsideTickLabels&&dt._hideCounterAxisInsideTickLabels(vt)}function Pa(dt,vt,Lr,Er){var _r=dt.anchor!=="free"&&(dt.overlaying===void 0||dt.overlaying===!1)?dt._id:dt.overlaying,yr;Er?yr=dt.side==="right"?vt:-vt:yr=vt,_r in Lr||(Lr[_r]={}),dt.side in Lr[_r]||(Lr[_r][dt.side]=0),Lr[_r][dt.side]+=yr}function sa(dt,vt){return dt.autoshift?vt[dt.overlaying][dt.side]:dt.shift||0}function Oa(dt,vt){return/%f/.test(vt)?dt>=P:/%L/.test(vt)?dt>=R:/%[SX]/.test(vt)?dt>=m:/%M/.test(vt)?dt>=g:/%[HI]/.test(vt)?dt>=u:/%p/.test(vt)?dt>=p:/%[Aadejuwx]/.test(vt)?dt>=w:/%[UVW]/.test(vt)?dt>=_:/%[Bbm]/.test(vt)?dt>=M:/%[q]/.test(vt)?dt>=y:/%[Yy]/.test(vt)?dt>=h:!0}}}),Sb=He({"src/plots/cartesian/autorange_options_defaults.js"(Y,G){G.exports=function(x,A,E){var e,t;if(E){var r=A==="reversed"||A==="min reversed"||A==="max reversed";e=E[r?1:0],t=E[r?0:1]}var o=x("autorangeoptions.minallowed",t===null?e:void 0),a=x("autorangeoptions.maxallowed",e===null?t:void 0);o===void 0&&x("autorangeoptions.clipmin"),a===void 0&&x("autorangeoptions.clipmax"),x("autorangeoptions.include")}}}),Mb=He({"src/plots/cartesian/range_defaults.js"(Y,G){var d=Sb();G.exports=function(A,E,e,t){var r=E._template||{},o=E.type||r.type||"-";e("minallowed"),e("maxallowed");var a=e("range");if(!a){var i;!t.noInsiderange&&o!=="log"&&(i=e("insiderange"),i&&(i[0]===null||i[1]===null)&&(E.insiderange=!1,i=void 0),i&&(a=e("range",i)))}var n=E.getAutorangeDflt(a,t),s=e("autorange",n),c;a&&(a[0]===null&&a[1]===null||(a[0]===null||a[1]===null)&&(s==="reversed"||s===!0)||a[0]!==null&&(s==="min"||s==="max reversed")||a[1]!==null&&(s==="max"||s==="min reversed"))&&(a=void 0,delete E.range,E.autorange=!0,c=!0),c||(n=E.getAutorangeDflt(a,t),s=e("autorange",n)),s&&(d(e,s,a),(o==="linear"||o==="-")&&e("rangemode")),E.cleanRange()}}}),eM=He({"node_modules/mouse-event-offset/index.js"(Y,G){var d={left:0,top:0};G.exports=x;function x(E,e,t){e=e||E.currentTarget||E.srcElement,Array.isArray(t)||(t=[0,0]);var r=E.clientX||0,o=E.clientY||0,a=A(e);return t[0]=r-a.left,t[1]=o-a.top,t}function A(E){return E===window||E===document||E===document.body?d:E.getBoundingClientRect()}}}),a1=He({"node_modules/has-passive-events/index.js"(Y,G){var d=yb();function x(){var A=!1;try{var E=Object.defineProperty({},"passive",{get:function(){A=!0}});window.addEventListener("test",null,E),window.removeEventListener("test",null,E)}catch{A=!1}return A}G.exports=d&&x()}}),tM=He({"src/components/dragelement/align.js"(Y,G){G.exports=function(x,A,E,e,t){var r=(x-E)/(e-E),o=r+A/(e-E),a=(r+o)/2;return t==="left"||t==="bottom"?r:t==="center"||t==="middle"?a:t==="right"||t==="top"?o:r<2/3-a?r:o>4/3-a?o:a}}}),rM=He({"src/components/dragelement/cursor.js"(Y,G){var d=Gr(),x=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];G.exports=function(E,e,t,r){return t==="left"?E=0:t==="center"?E=1:t==="right"?E=2:E=d.constrain(Math.floor(E*3),0,2),r==="bottom"?e=0:r==="middle"?e=1:r==="top"?e=2:e=d.constrain(Math.floor(e*3),0,2),x[e][E]}}}),aM=He({"src/components/dragelement/unhover.js"(Y,G){var d=z0(),x=e1(),A=Wg().getGraphDiv,E=Gg(),e=G.exports={};e.wrapped=function(t,r,o){t=A(t),t._fullLayout&&x.clear(t._fullLayout._uid+E.HOVERID),e.raw(t,r,o)},e.raw=function(r,o){var a=r._fullLayout,i=r._hoverdata;o||(o={}),!(o.target&&!r._dragged&&d.triggerHandler(r,"plotly_beforehover",o)===!1)&&(a._hoverlayer.selectAll("g").remove(),a._hoverlayer.selectAll("line").remove(),a._hoverlayer.selectAll("circle").remove(),r._hoverdata=void 0,o.target&&i&&r.emit("plotly_unhover",{event:o,points:i}))}}}),fh=He({"src/components/dragelement/index.js"(Y,G){var d=eM(),x=mb(),A=a1(),E=Gr().removeElement,e=Ef(),t=G.exports={};t.align=tM(),t.getCursor=rM();var r=aM();t.unhover=r.wrapped,t.unhoverRaw=r.raw,t.init=function(n){var s=n.gd,c=1,f=s._context.doubleClickDelay,v=n.element,h,T,l,y,b,S,M,_;s._mouseDownTime||(s._mouseDownTime=0),v.style.pointerEvents="all",v.onmousedown=u,A?(v._ontouchstart&&v.removeEventListener("touchstart",v._ontouchstart),v._ontouchstart=u,v.addEventListener("touchstart",u,{passive:!1})):v.ontouchstart=u;function w(R,P,z){return Math.abs(R)"u"&&typeof R.clientY>"u"&&(R.clientX=h,R.clientY=T),l=new Date().getTime(),l-s._mouseDownTimef&&(c=Math.max(c-1,1)),s._dragged)n.doneFn&&n.doneFn();else{var P;S.target===M?P=S:(P={target:M,srcElement:M,toElement:M},Object.keys(S).concat(Object.keys(S.__proto__)).forEach(z=>{var F=S[z];!P[z]&&typeof F!="function"&&(P[z]=F)})),n.clickFn&&n.clickFn(c,P),_||M.dispatchEvent(new MouseEvent("click",R))}s._dragging=!1,s._dragged=!1}};function o(){var i=document.createElement("div");i.className="dragcover";var n=i.style;return n.position="fixed",n.left=0,n.right=0,n.top=0,n.bottom=0,n.zIndex=999999999,n.background="none",document.body.appendChild(i),i}t.coverSlip=o;function a(i){return d(i.changedTouches?i.changedTouches[0]:i,document.body)}}}),xv=He({"src/lib/setcursor.js"(Y,G){G.exports=function(x,A){(x.attr("class")||"").split(" ").forEach(function(E){E.indexOf("cursor-")===0&&x.classed(E,!1)}),A&&x.classed("cursor-"+A,!0)}}}),nM=He({"src/lib/override_cursor.js"(Y,G){var d=xv(),x="data-savedcursor",A="!!";G.exports=function(e,t){var r=e.attr(x);if(t){if(!r){for(var o=(e.attr("class")||"").split(" "),a=0;a(a==="legend"?1:0));if(R===!1&&(n[a]=void 0),!(R===!1&&!c.uirevision)&&(v("uirevision",n.uirevision),R!==!1)){v("borderwidth");var P=v("orientation"),z=v("yref"),F=v("xref"),B=P==="h",O=z==="paper",L=F==="paper",N,U,Z,Q="left";B?(N=0,d.getComponentMethod("rangeslider","isVisible")(i.xaxis)?O?(U=1.1,Z="bottom"):(U=1,Z="top"):O?(U=-.1,Z="top"):(U=0,Z="bottom")):(U=1,Z="auto",L?N=1.02:(N=1,Q="right")),x.coerce(c,f,{x:{valType:"number",editType:"legend",min:L?-2:0,max:L?3:1,dflt:N}},"x"),x.coerce(c,f,{y:{valType:"number",editType:"legend",min:O?-2:0,max:O?3:1,dflt:U}},"y"),v("traceorder",w),r.isGrouped(n[a])&&v("tracegroupgap"),v("entrywidth"),v("entrywidthmode"),v("indentation"),v("itemsizing"),v("itemwidth"),v("itemclick"),v("itemdoubleclick"),v("groupclick"),v("xanchor",Q),v("yanchor",Z),v("valign"),x.noneOrAll(c,f,["x","y"]);var ue=v("title.text");if(ue){v("title.side",B?"left":"top");var oe=x.extendFlat({},h,{size:x.bigFont(h.size)});x.coerceFont(v,"title.font",oe)}}}}G.exports=function(i,n,s){var c,f=s.slice(),v=n.shapes;if(v)for(c=0;cR&&(m=R)}u[h][0]._groupMinRank=m,u[h][0]._preGroupSort=h}var P=function(N,U){return N[0]._groupMinRank-U[0]._groupMinRank||N[0]._preGroupSort-U[0]._preGroupSort},z=function(N,U){return N.trace.legendrank-U.trace.legendrank||N._preSort-U._preSort};for(u.forEach(function(N,U){N[0]._preGroupSort=U}),u.sort(P),h=0;h0)re=J.width;else return 0;return p?X:Math.min(re,$)};S.each(function(j){var J=d.select(this),$=A.ensureSingle(J,"g","layers");$.style("opacity",j[0].trace.opacity);var X=_.indentation,re=_.valign,ee=j[0].lineHeight,q=j[0].height;if(re==="middle"&&X===0||!ee||!q)$.attr("transform",null);else{var ae={top:1,bottom:-1}[re],ie=ae*(.5*(ee-q+3))||0,fe=_.indentation;$.attr("transform",E(fe,ie))}var we=$.selectAll("g.legendfill").data([j]);we.enter().append("g").classed("legendfill",!0);var Ae=$.selectAll("g.legendlines").data([j]);Ae.enter().append("g").classed("legendlines",!0);var Fe=$.selectAll("g.legendsymbols").data([j]);Fe.enter().append("g").classed("legendsymbols",!0),Fe.selectAll("g.legendpoints").data([j]).enter().append("g").classed("legendpoints",!0)}).each(le).each(F).each(O).each(B).each(N).each(ue).each(Q).each(P).each(z).each(U).each(Z);function P(j){var J=l(j),$=J.showFill,X=J.showLine,re=J.showGradientLine,ee=J.showGradientFill,q=J.anyFill,ae=J.anyLine,ie=j[0],fe=ie.trace,we,Ae,Fe=r(fe),Ce=Fe.colorscale,qe=Fe.reversescale,et=function(Re){if(Re.size())if($)e.fillGroupStyle(Re,M,!0);else{var $e="legendfill-"+fe.uid;e.gradient(Re,M,$e,T(qe),Ce,"fill")}},Qe=function(Re){if(Re.size()){var $e="legendline-"+fe.uid;e.lineGroupStyle(Re),e.gradient(Re,M,$e,T(qe),Ce,"stroke")}},Ke=o.hasMarkers(fe)||!q?"M5,0":ae?"M5,-2":"M5,-3",Xe=d.select(this),Me=Xe.select(".legendfill").selectAll("path").data($||ee?[j]:[]);if(Me.enter().append("path").classed("js-fill",!0),Me.exit().remove(),Me.attr("d",Ke+"h"+u+"v6h-"+u+"z").call(et),X||re){var xe=R(void 0,fe.line,v,c);Ae=A.minExtend(fe,{line:{width:xe}}),we=[A.minExtend(ie,{trace:Ae})]}var ce=Xe.select(".legendlines").selectAll("path").data(X||re?[we]:[]);ce.enter().append("path").classed("js-line",!0),ce.exit().remove(),ce.attr("d",Ke+(re?"l"+u+",0.0001":"h"+u)).call(X?e.lineGroupStyle:Qe)}function z(j){var J=l(j),$=J.anyFill,X=J.anyLine,re=J.showLine,ee=J.showMarker,q=j[0],ae=q.trace,ie=!ee&&!X&&!$&&o.hasText(ae),fe,we;function Ae(Me,xe,ce,Re){var $e=A.nestedProperty(ae,Me).get(),rt=A.isArrayOrTypedArray($e)&&xe?xe($e):$e;if(p&&rt&&Re!==void 0&&(rt=Re),ce){if(rtce[1])return ce[1]}return rt}function Fe(Me){return q._distinct&&q.index&&Me[q.index]?Me[q.index]:Me[0]}if(ee||ie||re){var Ce={},qe={};if(ee){Ce.mc=Ae("marker.color",Fe),Ce.mx=Ae("marker.symbol",Fe),Ce.mo=Ae("marker.opacity",A.mean,[.2,1]),Ce.mlc=Ae("marker.line.color",Fe),Ce.mlw=Ae("marker.line.width",A.mean,[0,5],f),qe.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var et=Ae("marker.size",A.mean,[2,16],s);Ce.ms=et,qe.marker.size=et}re&&(qe.line={width:Ae("line.width",Fe,[0,10],c)}),ie&&(Ce.tx="Aa",Ce.tp=Ae("textposition",Fe),Ce.ts=10,Ce.tc=Ae("textfont.color",Fe),Ce.tf=Ae("textfont.family",Fe),Ce.tw=Ae("textfont.weight",Fe),Ce.ty=Ae("textfont.style",Fe),Ce.tv=Ae("textfont.variant",Fe),Ce.tC=Ae("textfont.textcase",Fe),Ce.tE=Ae("textfont.lineposition",Fe),Ce.tS=Ae("textfont.shadow",Fe)),fe=[A.minExtend(q,Ce)],we=A.minExtend(ae,qe),we.selectedpoints=null,we.texttemplate=null}var Qe=d.select(this).select("g.legendpoints"),Ke=Qe.selectAll("path.scatterpts").data(ee?fe:[]);Ke.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",m),Ke.exit().remove(),Ke.call(e.pointStyle,we,M),ee&&(fe[0].mrc=3);var Xe=Qe.selectAll("g.pointtext").data(ie?fe:[]);Xe.enter().append("g").classed("pointtext",!0).append("text").attr("transform",m),Xe.exit().remove(),Xe.selectAll("text").call(e.textPointStyle,we,M)}function F(j){var J=j[0].trace,$=J.type==="waterfall";if(j[0]._distinct&&$){var X=j[0].trace[j[0].dir].marker;return j[0].mc=X.color,j[0].mlw=X.line.width,j[0].mlc=X.line.color,L(j,this,"waterfall")}var re=[];J.visible&&$&&(re=j[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 ee=d.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(re);ee.enter().append("path").classed("legendwaterfall",!0).attr("transform",m).style("stroke-miterlimit",1),ee.exit().remove(),ee.each(function(q){var ae=d.select(this),ie=J[q[0]].marker,fe=R(void 0,ie.line,h,f);ae.attr("d",q[1]).style("stroke-width",fe+"px").call(t.fill,ie.color),fe&&ae.call(t.stroke,ie.line.color)})}function B(j){L(j,this)}function O(j){L(j,this,"funnel")}function L(j,J,$){var X=j[0].trace,re=X.marker||{},ee=re.line||{},q=re.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",ae=$?X.visible&&X.type===$:x.traceIs(X,"bar"),ie=d.select(J).select("g.legendpoints").selectAll("path.legend"+$).data(ae?[j]:[]);ie.enter().append("path").classed("legend"+$,!0).attr("d",q).attr("transform",m),ie.exit().remove(),ie.each(function(fe){var we=d.select(this),Ae=fe[0],Fe=R(Ae.mlw,re.line,h,f);we.style("stroke-width",Fe+"px");var Ce=Ae.mcc;if(!_._inHover&&"mc"in Ae){var qe=r(re),et=qe.mid;et===void 0&&(et=(qe.max+qe.min)/2),Ce=e.tryColorscale(re,"")(et)}var Qe=Ce||Ae.mc||re.color,Ke=re.pattern,Xe=Ke&&e.getPatternAttr(Ke.shape,0,"");if(Xe){var Me=e.getPatternAttr(Ke.bgcolor,0,null),xe=e.getPatternAttr(Ke.fgcolor,0,null),ce=Ke.fgopacity,Re=y(Ke.size,8,10),$e=y(Ke.solidity,.5,1),rt="legend-"+X.uid;we.call(e.pattern,"legend",M,rt,Xe,Re,$e,Ce,Ke.fillmode,Me,xe,ce)}else we.call(t.fill,Qe);Fe&&t.stroke(we,Ae.mlc||ee.color)})}function N(j){var J=j[0].trace,$=d.select(this).select("g.legendpoints").selectAll("path.legendbox").data(J.visible&&x.traceIs(J,"box-violin")?[j]:[]);$.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",m),$.exit().remove(),$.each(function(){var X=d.select(this);if((J.boxpoints==="all"||J.points==="all")&&t.opacity(J.fillcolor)===0&&t.opacity((J.line||{}).color)===0){var re=A.minExtend(J,{marker:{size:p?s:A.constrain(J.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});$.call(e.pointStyle,re,M)}else{var ee=R(void 0,J.line,h,f);X.style("stroke-width",ee+"px").call(t.fill,J.fillcolor),ee&&t.stroke(X,J.line.color)}})}function U(j){var J=j[0].trace,$=d.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(J.visible&&J.type==="candlestick"?[j,j]:[]);$.enter().append("path").classed("legendcandle",!0).attr("d",function(X,re){return re?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",m).style("stroke-miterlimit",1),$.exit().remove(),$.each(function(X,re){var ee=d.select(this),q=J[re?"increasing":"decreasing"],ae=R(void 0,q.line,h,f);ee.style("stroke-width",ae+"px").call(t.fill,q.fillcolor),ae&&t.stroke(ee,q.line.color)})}function Z(j){var J=j[0].trace,$=d.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(J.visible&&J.type==="ohlc"?[j,j]:[]);$.enter().append("path").classed("legendohlc",!0).attr("d",function(X,re){return re?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",m).style("stroke-miterlimit",1),$.exit().remove(),$.each(function(X,re){var ee=d.select(this),q=J[re?"increasing":"decreasing"],ae=R(void 0,q.line,h,f);ee.style("fill","none").call(e.dashLine,q.line.dash,ae),ae&&t.stroke(ee,q.line.color)})}function Q(j){oe(j,this,"pie")}function ue(j){oe(j,this,"funnelarea")}function oe(j,J,$){var X=j[0],re=X.trace,ee=$?re.visible&&re.type===$:x.traceIs(re,$),q=d.select(J).select("g.legendpoints").selectAll("path.legend"+$).data(ee?[j]:[]);if(q.enter().append("path").classed("legend"+$,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",m),q.exit().remove(),q.size()){var ae=re.marker||{},ie=R(i(ae.line.width,X.pts),ae.line,h,f),fe="pieLike",we=A.minExtend(re,{marker:{line:{width:ie}}},fe),Ae=A.minExtend(X,{trace:we},fe);a(q,Ae,we,M)}}function le(j){var J=j[0].trace,$,X=[];if(J.visible)switch(J.type){case"histogram2d":case"heatmap":X=[["M-15,-2V4H15V-2Z"]],$=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":X=[["M-6,-6V6H6V-6Z"]],$=!0;break;case"densitymapbox":case"densitymap":X=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],$="radial";break;case"cone":X=[["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"]],$=!1;break;case"streamtube":X=[["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"]],$=!1;break;case"surface":X=[["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"]],$=!0;break;case"mesh3d":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],$=!1;break;case"volume":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],$=!0;break;case"isosurface":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],$=!1;break}var re=d.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(X);re.enter().append("path").classed("legend3dandfriends",!0).attr("transform",m).style("stroke-miterlimit",1),re.exit().remove(),re.each(function(ee,q){var ae=d.select(this),ie=r(J),fe=ie.colorscale,we=ie.reversescale,Ae=function(et){if(et.size()){var Qe="legendfill-"+J.uid;e.gradient(et,M,Qe,T(we,$==="radial"),fe,"fill")}},Fe;if(fe){if(!$){var qe=fe.length;Fe=q===0?fe[we?qe-1:0][1]:q===1?fe[we?0:qe-1][1]:fe[Math.floor((qe-1)/2)][1]}}else{var Ce=J.vertexcolor||J.facecolor||J.color;Fe=A.isArrayOrTypedArray(Ce)?Ce[q]||Ce[0]:Ce}ae.attr("d",ee[0]),Fe?ae.call(t.fill,Fe):ae.call(Ae)})}};function T(b,S){var M=S?"radial":"horizontal";return M+(b?"":"reversed")}function l(b){var S=b[0].trace,M=S.contours,_=o.hasLines(S),w=o.hasMarkers(S),p=S.visible&&S.fill&&S.fill!=="none",u=!1,g=!1;if(M){var m=M.coloring;m==="lines"?u=!0:_=m==="none"||m==="heatmap"||M.showlines,M.type==="constraint"?p=M._operation!=="=":(m==="fill"||m==="heatmap")&&(g=!0)}return{showMarker:w,showLine:_,showFill:p,showGradientLine:u,showGradientFill:g,anyLine:_||u,anyFill:p||g}}function y(b,S,M){return b&&A.isArrayOrTypedArray(b)?S:b>M?M:b}}}),Pb=He({"src/components/legend/draw.js"(Y,G){var d=Qn(),x=Gr(),A=yu(),E=Ei(),e=z0(),t=fh(),r=vo(),o=Ai(),a=yl(),i=iM(),n=Cb(),s=df(),c=s.LINE_SPACING,f=s.FROM_TL,v=s.FROM_BR,h=oM(),T=Lb(),l=n1(),y=1,b=/^legend[0-9]*$/;G.exports=function(U,Z){if(Z)M(U,Z);else{var Q=U._fullLayout,ue=Q._legends,oe=Q._infolayer.selectAll('[class^="legend"]');oe.each(function(){var $=d.select(this),X=$.attr("class"),re=X.split(" ")[0];re.match(b)&&ue.indexOf(re)===-1&&$.remove()});for(var le=0;le1)}var ae=Q.hiddenlabels||[];if(!j&&(!Q.showlegend||!J.length))return le.selectAll("."+ue).remove(),Q._topdefs.select("#"+oe).remove(),A.autoMargin(N,ue);var ie=x.ensureSingle(le,"g",ue,function(Ke){j||Ke.attr("pointer-events","all")}),fe=x.ensureSingleById(Q._topdefs,"clipPath",oe,function(Ke){Ke.append("rect")}),we=x.ensureSingle(ie,"rect","bg",function(Ke){Ke.attr("shape-rendering","crispEdges")});we.call(o.stroke,Z.bordercolor).call(o.fill,Z.bgcolor).style("stroke-width",Z.borderwidth+"px");var Ae=x.ensureSingle(ie,"g","scrollbox"),Fe=Z.title;Z._titleWidth=0,Z._titleHeight=0;var Ce;Fe.text?(Ce=x.ensureSingle(Ae,"text",ue+"titletext"),Ce.attr("text-anchor","start").call(r.font,Fe.font).text(Fe.text),m(Ce,Ae,N,Z,y)):Ae.selectAll("."+ue+"titletext").remove();var qe=x.ensureSingle(ie,"rect","scrollbar",function(Ke){Ke.attr(n.scrollBarEnterAttrs).call(o.fill,n.scrollBarColor)}),et=Ae.selectAll("g.groups").data(J);et.enter().append("g").attr("class","groups"),et.exit().remove();var Qe=et.selectAll("g.traces").data(x.identity);Qe.enter().append("g").attr("class","traces"),Qe.exit().remove(),Qe.style("opacity",function(Ke){var Xe=Ke[0].trace;return E.traceIs(Xe,"pie-like")?ae.indexOf(Ke[0].label)!==-1?.5:1:Xe.visible==="legendonly"?.5:1}).each(function(){d.select(this).call(p,N,Z)}).call(T,N,Z).each(function(){j||d.select(this).call(g,N,ue)}),x.syncOrAsync([A.previousPromises,function(){return z(N,et,Qe,Z)},function(){var Ke=Q._size,Xe=Z.borderwidth,Me=Z.xref==="paper",xe=Z.yref==="paper";if(Fe.text&&S(Ce,Z,Xe),!j){var ce,Re;Me?ce=Ke.l+Ke.w*Z.x-f[B(Z)]*Z._width:ce=Q.width*Z.x-f[B(Z)]*Z._width,xe?Re=Ke.t+Ke.h*(1-Z.y)-f[O(Z)]*Z._effHeight:Re=Q.height*(1-Z.y)-f[O(Z)]*Z._effHeight;var $e=F(N,ue,ce,Re);if($e)return;if(Q.margin.autoexpand){var rt=ce,Je=Re;ce=Me?x.constrain(ce,0,Q.width-Z._width):rt,Re=xe?x.constrain(Re,0,Q.height-Z._effHeight):Je,ce!==rt&&x.log("Constrain "+ue+".x to make legend fit inside graph"),Re!==Je&&x.log("Constrain "+ue+".y to make legend fit inside graph")}r.setTranslate(ie,ce,Re)}if(qe.on(".drag",null),ie.on("wheel",null),j||Z._height<=Z._maxHeight||N._context.staticPlot){var At=Z._effHeight;j&&(At=Z._height),we.attr({width:Z._width-Xe,height:At-Xe,x:Xe/2,y:Xe/2}),r.setTranslate(Ae,0,0),fe.select("rect").attr({width:Z._width-2*Xe,height:At-2*Xe,x:Xe,y:Xe}),r.setClipUrl(Ae,oe,N),r.setRect(qe,0,0,0,0),delete Z._scrollY}else{var St=Math.max(n.scrollBarMinHeight,Z._effHeight*Z._effHeight/Z._height),Rt=Z._effHeight-St-2*n.scrollBarMargin,Ut=Z._height-Z._effHeight,ir=Rt/Ut,ar=Math.min(Z._scrollY||0,Ut);we.attr({width:Z._width-2*Xe+n.scrollBarWidth+n.scrollBarMargin,height:Z._effHeight-Xe,x:Xe/2,y:Xe/2}),fe.select("rect").attr({width:Z._width-2*Xe+n.scrollBarWidth+n.scrollBarMargin,height:Z._effHeight-2*Xe,x:Xe,y:Xe+ar}),r.setClipUrl(Ae,oe,N),ve(ar,St,ir),ie.on("wheel",function(){ar=x.constrain(Z._scrollY+d.event.deltaY/Rt*Ut,0,Ut),ve(ar,St,ir),ar!==0&&ar!==Ut&&d.event.preventDefault()});var Mr,fr,dr,pt=function(ct,_t,Mt){var Nt=(Mt-_t)/ir+ct;return x.constrain(Nt,0,Ut)},ze=function(ct,_t,Mt){var Nt=(_t-Mt)/ir+ct;return x.constrain(Nt,0,Ut)},Ge=d.behavior.drag().on("dragstart",function(){var ct=d.event.sourceEvent;ct.type==="touchstart"?Mr=ct.changedTouches[0].clientY:Mr=ct.clientY,dr=ar}).on("drag",function(){var ct=d.event.sourceEvent;ct.buttons===2||ct.ctrlKey||(ct.type==="touchmove"?fr=ct.changedTouches[0].clientY:fr=ct.clientY,ar=pt(dr,Mr,fr),ve(ar,St,ir))});qe.call(Ge);var Oe=d.behavior.drag().on("dragstart",function(){var ct=d.event.sourceEvent;ct.type==="touchstart"&&(Mr=ct.changedTouches[0].clientY,dr=ar)}).on("drag",function(){var ct=d.event.sourceEvent;ct.type==="touchmove"&&(fr=ct.changedTouches[0].clientY,ar=ze(dr,Mr,fr),ve(ar,St,ir))});Ae.call(Oe)}function ve(ct,_t,Mt){Z._scrollY=N._fullLayout[ue]._scrollY=ct,r.setTranslate(Ae,0,-ct),r.setRect(qe,Z._width,n.scrollBarMargin+ct*Mt,n.scrollBarWidth,_t),fe.select("rect").attr("y",Xe+ct)}if(N._context.edits.legendPosition){var ge,be,Pe,We;ie.classed("cursor-move",!0),t.init({element:ie.node(),gd:N,prepFn:function(ct){if(ct.target!==qe.node()){var _t=r.getTranslate(ie);Pe=_t.x,We=_t.y}},moveFn:function(ct,_t){if(Pe!==void 0&&We!==void 0){var Mt=Pe+ct,Nt=We+_t;r.setTranslate(ie,Mt,Nt),ge=t.align(Mt,Z._width,Ke.l,Ke.l+Ke.w,Z.xanchor),be=t.align(Nt+Z._height,-Z._height,Ke.t+Ke.h,Ke.t,Z.yanchor)}},doneFn:function(){if(ge!==void 0&&be!==void 0){var ct={};ct[ue+".x"]=ge,ct[ue+".y"]=be,E.call("_guiRelayout",N,ct)}},clickFn:function(ct,_t){var Mt=le.selectAll("g.traces").filter(function(){var Nt=this.getBoundingClientRect();return _t.clientX>=Nt.left&&_t.clientX<=Nt.right&&_t.clientY>=Nt.top&&_t.clientY<=Nt.bottom});Mt.size()>0&&w(N,ie,Mt,ct,_t)}})}}],N)}}function _(N,U,Z){var Q=N[0],ue=Q.width,oe=U.entrywidthmode,le=Q.trace.legendwidth||U.entrywidth;return oe==="fraction"?U._maxWidth*le:Z+(le||ue)}function w(N,U,Z,Q,ue){var oe=Z.data()[0][0].trace,le={event:ue,node:Z.node(),curveNumber:oe.index,expandedIndex:oe.index,data:N.data,layout:N.layout,frames:N._transitionData._frames,config:N._context,fullData:N._fullData,fullLayout:N._fullLayout};oe._group&&(le.group=oe._group),E.traceIs(oe,"pie-like")&&(le.label=Z.datum()[0].label);var j=e.triggerHandler(N,"plotly_legendclick",le);if(Q===1){if(j===!1)return;U._clickTimeout=setTimeout(function(){N._fullLayout&&i(Z,N,Q)},N._context.doubleClickDelay)}else if(Q===2){U._clickTimeout&&clearTimeout(U._clickTimeout),N._legendMouseDownTime=0;var J=e.triggerHandler(N,"plotly_legenddoubleclick",le);J!==!1&&j!==!1&&i(Z,N,Q)}}function p(N,U,Z){var Q=L(Z),ue=N.data()[0][0],oe=ue.trace,le=E.traceIs(oe,"pie-like"),j=!Z._inHover&&U._context.edits.legendText&&!le,J=Z._maxNameLength,$,X;ue.groupTitle?($=ue.groupTitle.text,X=ue.groupTitle.font):(X=Z.font,Z.entries?$=ue.text:($=le?ue.label:oe.name,oe._meta&&($=x.templateString($,oe._meta))));var re=x.ensureSingle(N,"text",Q+"text");re.attr("text-anchor","start").call(r.font,X).text(j?u($,J):$);var ee=Z.indentation+Z.itemwidth+n.itemGap*2;a.positionText(re,ee,0),j?re.call(a.makeEditable,{gd:U,text:$}).call(m,N,U,Z).on("edit",function(q){this.text(u(q,J)).call(m,N,U,Z);var ae=ue.trace._fullInput||{},ie={};return ie.name=q,ae._isShape?E.call("_guiRelayout",U,"shapes["+oe.index+"].name",ie.name):E.call("_guiRestyle",U,ie,oe.index)}):m(re,N,U,Z)}function u(N,U){var Z=Math.max(4,U);if(N&&N.trim().length>=Z/2)return N;N=N||"";for(var Q=Z-N.length;Q>0;Q--)N+=" ";return N}function g(N,U,Z){var Q=U._context.doubleClickDelay,ue,oe=1,le=x.ensureSingle(N,"rect",Z+"toggle",function(j){U._context.staticPlot||j.style("cursor","pointer").attr("pointer-events","all"),j.call(o.fill,"rgba(0,0,0,0)")});U._context.staticPlot||(le.on("mousedown",function(){ue=new Date().getTime(),ue-U._legendMouseDownTimeQ&&(oe=Math.max(oe-1,1)),w(U,j,N,oe,d.event)}}))}function m(N,U,Z,Q,ue){Q._inHover&&N.attr("data-notex",!0),a.convertToTspans(N,Z,function(){R(U,Z,Q,ue)})}function R(N,U,Z,Q){var ue=N.data()[0][0];if(!Z._inHover&&ue&&!ue.trace.showlegend){N.remove();return}var oe=N.select("g[class*=math-group]"),le=oe.node(),j=L(Z);Z||(Z=U._fullLayout[j]);var J=Z.borderwidth,$;Q===y?$=Z.title.font:ue.groupTitle?$=ue.groupTitle.font:$=Z.font;var X=$.size*c,re,ee;if(le){var q=r.bBox(le);re=q.height,ee=q.width,Q===y?r.setTranslate(oe,J,J+re*.75):r.setTranslate(oe,0,re*.25)}else{var ae="."+j+(Q===y?"title":"")+"text",ie=N.select(ae),fe=a.lineCount(ie),we=ie.node();if(re=X*fe,ee=we?r.bBox(we).width:0,Q===y)Z.title.side==="left"&&(ee+=n.itemGap*2),a.positionText(ie,J+n.titlePad,J+X);else{var Ae=n.itemGap*2+Z.indentation+Z.itemwidth;ue.groupTitle&&(Ae=n.itemGap,ee-=Z.indentation+Z.itemwidth),a.positionText(ie,Ae,-X*((fe-1)/2-.3))}}Q===y?(Z._titleWidth=ee,Z._titleHeight=re):(ue.lineHeight=X,ue.height=Math.max(re,16)+3,ue.width=ee)}function P(N){var U=0,Z=0,Q=N.title.side;return Q&&(Q.indexOf("left")!==-1&&(U=N._titleWidth),Q.indexOf("top")!==-1&&(Z=N._titleHeight)),[U,Z]}function z(N,U,Z,Q){var ue=N._fullLayout,oe=L(Q);Q||(Q=ue[oe]);var le=ue._size,j=l.isVertical(Q),J=l.isGrouped(Q),$=Q.entrywidthmode==="fraction",X=Q.borderwidth,re=2*X,ee=n.itemGap,q=Q.indentation+Q.itemwidth+ee*2,ae=2*(X+ee),ie=O(Q),fe=Q.y<0||Q.y===0&&ie==="top",we=Q.y>1||Q.y===1&&ie==="bottom",Ae=Q.tracegroupgap,Fe={};Q._maxHeight=Math.max(fe||we?ue.height/2:le.h,30);var Ce=0;Q._width=0,Q._height=0;var qe=P(Q);if(j)Z.each(function(dr){var pt=dr[0].height;r.setTranslate(this,X+qe[0],X+qe[1]+Q._height+pt/2+ee),Q._height+=pt,Q._width=Math.max(Q._width,dr[0].width)}),Ce=q+Q._width,Q._width+=ee+q+re,Q._height+=ae,J&&(U.each(function(dr,pt){r.setTranslate(this,0,pt*Q.tracegroupgap)}),Q._height+=(Q._lgroupsLength-1)*Q.tracegroupgap);else{var et=B(Q),Qe=Q.x<0||Q.x===0&&et==="right",Ke=Q.x>1||Q.x===1&&et==="left",Xe=we||fe,Me=ue.width/2;Q._maxWidth=Math.max(Qe?Xe&&et==="left"?le.l+le.w:Me:Ke?Xe&&et==="right"?le.r+le.w:Me:le.w,2*q);var xe=0,ce=0;Z.each(function(dr){var pt=_(dr,Q,q);xe=Math.max(xe,pt),ce+=pt}),Ce=null;var Re=0;if(J){var $e=0,rt=0,Je=0;U.each(function(){var dr=0,pt=0;d.select(this).selectAll("g.traces").each(function(Ge){var Oe=_(Ge,Q,q),ve=Ge[0].height;r.setTranslate(this,qe[0],qe[1]+X+ee+ve/2+pt),pt+=ve,dr=Math.max(dr,Oe),Fe[Ge[0].trace.legendgroup]=dr});var ze=dr+ee;rt>0&&ze+X+rt>Q._maxWidth?(Re=Math.max(Re,rt),rt=0,Je+=$e+Ae,$e=pt):$e=Math.max($e,pt),r.setTranslate(this,rt,Je),rt+=ze}),Q._width=Math.max(Re,rt)+X,Q._height=Je+$e+ae}else{var At=Z.size(),St=ce+re+(At-1)*ee=Q._maxWidth&&(Re=Math.max(Re,ar),Ut=0,ir+=Rt,Q._height+=Rt,Rt=0),r.setTranslate(this,qe[0]+X+Ut,qe[1]+X+ir+pt/2+ee),ar=Ut+ze+ee,Ut+=Ge,Rt=Math.max(Rt,pt)}),St?(Q._width=Ut+re,Q._height=Rt+ae):(Q._width=Math.max(Re,ar)+re,Q._height+=Rt+ae)}}Q._width=Math.ceil(Math.max(Q._width+qe[0],Q._titleWidth+2*(X+n.titlePad))),Q._height=Math.ceil(Math.max(Q._height+qe[1],Q._titleHeight+2*(X+n.itemGap))),Q._effHeight=Math.min(Q._height,Q._maxHeight);var Mr=N._context.edits,fr=Mr.legendText||Mr.legendPosition;Z.each(function(dr){var pt=d.select(this).select("."+oe+"toggle"),ze=dr[0].height,Ge=dr[0].trace.legendgroup,Oe=_(dr,Q,q);J&&Ge!==""&&(Oe=Fe[Ge]);var ve=fr?q:Ce||Oe;!j&&!$&&(ve+=ee/2),r.setRect(pt,0,-ze/2,ve,ze)})}function F(N,U,Z,Q){var ue=N._fullLayout,oe=ue[U],le=B(oe),j=O(oe),J=oe.xref==="paper",$=oe.yref==="paper";N._fullLayout._reservedMargin[U]={};var X=oe.y<.5?"b":"t",re=oe.x<.5?"l":"r",ee={r:ue.width-Z,l:Z+oe._width,b:ue.height-Q,t:Q+oe._effHeight};if(J&&$)return A.autoMargin(N,U,{x:oe.x,y:oe.y,l:oe._width*f[le],r:oe._width*v[le],b:oe._effHeight*v[j],t:oe._effHeight*f[j]});J?N._fullLayout._reservedMargin[U][X]=ee[X]:$||oe.orientation==="v"?N._fullLayout._reservedMargin[U][re]=ee[re]:N._fullLayout._reservedMargin[U][X]=ee[X]}function B(N){return x.isRightAnchor(N)?"right":x.isCenterAnchor(N)?"center":"left"}function O(N){return x.isBottomAnchor(N)?"bottom":x.isMiddleAnchor(N)?"middle":"top"}function L(N){return N._id||"legend"}}}),Ib=He({"src/components/fx/hover.js"(Y){var G=Qn(),d=Hi(),x=Mf(),A=Gr(),E=A.pushUnique,e=A.strTranslate,t=A.strRotate,r=z0(),o=yl(),a=nM(),i=vo(),n=Ai(),s=fh(),c=io(),f=Ef().zindexSeparator,v=Ei(),h=Ph(),T=Gg(),l=kb(),y=Pb(),b=T.YANGLE,S=Math.PI*b/180,M=1/Math.sin(S),_=Math.cos(S),w=Math.sin(S),p=T.HOVERARROWSIZE,u=T.HOVERTEXTPAD,g={box:!0,ohlc:!0,violin:!0,candlestick:!0},m={scatter:!0,scattergl:!0,splom:!0};function R(q,ae){return q.distance-ae.distance}Y.hover=function(ae,ie,fe,we){ae=A.getGraphDiv(ae);var Ae=ie.target;A.throttle(ae._fullLayout._uid+T.HOVERID,T.HOVERMINTIME,function(){P(ae,ie,fe,we,Ae)})},Y.loneHover=function(ae,ie){var fe=!0;Array.isArray(ae)||(fe=!1,ae=[ae]);var we=ie.gd,Ae=X(we),Fe=re(we),Ce=ae.map(function(Re){var $e=Re._x0||Re.x0||Re.x||0,rt=Re._x1||Re.x1||Re.x||0,Je=Re._y0||Re.y0||Re.y||0,At=Re._y1||Re.y1||Re.y||0,St=Re.eventData;if(St){var Rt=Math.min($e,rt),Ut=Math.max($e,rt),ir=Math.min(Je,At),ar=Math.max(Je,At),Mr=Re.trace;if(v.traceIs(Mr,"gl3d")){var fr=we._fullLayout[Mr.scene]._scene.container,dr=fr.offsetLeft,pt=fr.offsetTop;Rt+=dr,Ut+=dr,ir+=pt,ar+=pt}St.bbox={x0:Rt+Fe,x1:Ut+Fe,y0:ir+Ae,y1:ar+Ae},ie.inOut_bbox&&ie.inOut_bbox.push(St.bbox)}else St=!1;return{color:Re.color||n.defaultLine,x0:Re.x0||Re.x||0,x1:Re.x1||Re.x||0,y0:Re.y0||Re.y||0,y1:Re.y1||Re.y||0,xLabel:Re.xLabel,yLabel:Re.yLabel,zLabel:Re.zLabel,text:Re.text,name:Re.name,idealAlign:Re.idealAlign,borderColor:Re.borderColor,fontFamily:Re.fontFamily,fontSize:Re.fontSize,fontColor:Re.fontColor,fontWeight:Re.fontWeight,fontStyle:Re.fontStyle,fontVariant:Re.fontVariant,nameLength:Re.nameLength,textAlign:Re.textAlign,trace:Re.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Re.hovertemplate||!1,hovertemplateLabels:Re.hovertemplateLabels||!1,eventData:St}}),qe=!1,et=B(Ce,{gd:we,hovermode:"closest",rotateLabels:qe,bgColor:ie.bgColor||n.background,container:G.select(ie.container),outerContainer:ie.outerContainer||ie.container}),Qe=et.hoverLabels,Ke=5,Xe=0,Me=0;Qe.sort(function(Re,$e){return Re.y0-$e.y0}).each(function(Re,$e){var rt=Re.y0-Re.by/2;rt-KeUt[0]._length||Ia<0||Ia>ir[0]._length)return s.unhoverRaw(q,ae)}if(ae.pointerX=ma+Ut[0]._offset,ae.pointerY=Ia+ir[0]._offset,"xval"in ae?Oe=h.flat(Ae,ae.xval):Oe=h.p2c(Ut,ma),"yval"in ae?ve=h.flat(Ae,ae.yval):ve=h.p2c(ir,Ia),!d(Oe[0])||!d(ve[0]))return A.warn("Fx.hover failed",ae,q),s.unhoverRaw(q,ae)}var Ka=1/0;function Vt(ei,mi){for(be=0;beZt&&(ze.splice(0,Zt),Ka=ze[0].distance),Ke&&pt!==0&&ze.length===0){qt.distance=pt,qt.index=!1;var Ii=We._module.hoverPoints(qt,Nt,Bt,"closest",{hoverLayer:Ce._hoverlayer});if(Ii&&(Ii=Ii.filter(function(Yi){return Yi.spikeDistance<=pt})),Ii&&Ii.length){var xi,Ao=Ii.filter(function(Yi){return Yi.xa.showspikes&&Yi.xa.spikesnap!=="hovered data"});if(Ao.length){var So=Ao[0];d(So.x0)&&d(So.y0)&&(xi=jt(So),(!lr.vLinePoint||lr.vLinePoint.spikeDistance>xi.spikeDistance)&&(lr.vLinePoint=xi))}var Ro=Ii.filter(function(Yi){return Yi.ya.showspikes&&Yi.ya.spikesnap!=="hovered data"});if(Ro.length){var Li=Ro[0];d(Li.x0)&&d(Li.y0)&&(xi=jt(Li),(!lr.hLinePoint||lr.hLinePoint.spikeDistance>xi.spikeDistance)&&(lr.hLinePoint=xi))}}}}}Vt();function Lt(ei,mi,uo){for(var Lo=null,Wo=1/0,li,Ii=0;Ii0&&Math.abs(ei.distance)vt-1;Pr--)zr(ze[Pr]);ze=_r,Br()}var Hr=q._hoverdata,Zr=[],Jr=X(q),wt=re(q);for(ge=0;ge1||ze.length>1)||Xe==="closest"&&ta&&ze.length>1,di=n.combine(Ce.plot_bgcolor||n.background,Ce.paper_bgcolor),yi=B(ze,{gd:q,hovermode:Xe,rotateLabels:Vn,bgColor:di,container:Ce._hoverlayer,outerContainer:Ce._paper.node(),commonLabelOpts:Ce.hoverlabel,hoverdistance:Ce.hoverdistance}),Ci=yi.hoverLabels;if(h.isUnifiedHover(Xe)||(L(Ci,Vn,Ce,yi.commonLabelBoundingBox),Z(Ci,Vn,Ce._invScaleX,Ce._invScaleY)),we&&we.tagName){var ci=v.getComponentMethod("annotations","hasClickToShow")(q,Zr);a(G.select(we),ci?"pointer":"")}!we||fe||!oe(q,ae,Hr)||(Hr&&q.emit("plotly_unhover",{event:ae,points:Hr}),q.emit("plotly_hover",{event:ae,points:q._hoverdata,xaxes:Ut,yaxes:ir,xvals:Oe,yvals:ve}))}function z(q){return[q.trace.index,q.index,q.x0,q.y0,q.name,q.attr,q.xa?q.xa._id:"",q.ya?q.ya._id:""].join(",")}var F=/([\s\S]*)<\/extra>/;function B(q,ae){var ie=ae.gd,fe=ie._fullLayout,we=ae.hovermode,Ae=ae.rotateLabels,Fe=ae.bgColor,Ce=ae.container,qe=ae.outerContainer,et=ae.commonLabelOpts||{};if(q.length===0)return[[]];var Qe=ae.fontFamily||T.HOVERFONT,Ke=ae.fontSize||T.HOVERFONTSIZE,Xe=ae.fontWeight||fe.font.weight,Me=ae.fontStyle||fe.font.style,xe=ae.fontVariant||fe.font.variant,ce=ae.fontTextcase||fe.font.textcase,Re=ae.fontLineposition||fe.font.lineposition,$e=ae.fontShadow||fe.font.shadow,rt=q[0],Je=rt.xa,At=rt.ya,St=we.charAt(0),Rt=St+"Label",Ut=rt[Rt];if(Ut===void 0&&Je.type==="multicategory")for(var ir=0;irfe.width-Zr&&(Jr=fe.width-Zr),Oa.attr("d","M"+(zr-Jr)+",0L"+(zr-Jr+p)+","+Hr+p+"H"+Zr+"v"+Hr+(u*2+kr.height)+"H"+-Zr+"V"+Hr+p+"H"+(zr-Jr-p)+"Z"),zr=Jr,be.minX=zr-Zr,be.maxX=zr+Zr,Je.side==="top"?(be.minY=Pr-(u*2+kr.height),be.maxY=Pr-u):(be.minY=Pr+u,be.maxY=Pr+(u*2+kr.height))}else{var wt,Qt,mr;At.side==="right"?(wt="start",Qt=1,mr="",zr=Je._offset+Je._length):(wt="end",Qt=-1,mr="-",zr=Je._offset),Pr=At._offset+(rt.y0+rt.y1)/2,dt.attr("text-anchor",wt),Oa.attr("d","M0,0L"+mr+p+","+p+"V"+(u+kr.height/2)+"h"+mr+(u*2+kr.width)+"V-"+(u+kr.height/2)+"H"+mr+p+"V-"+p+"Z"),be.minY=Pr-(u+kr.height/2),be.maxY=Pr+(u+kr.height/2),At.side==="right"?(be.minX=zr+p,be.maxX=zr+p+(u*2+kr.width)):(be.minX=zr-p-(u*2+kr.width),be.maxX=zr-p);var $r=kr.height/2,oa=Mr-kr.top-$r,Sa="clip"+fe._uid+"commonlabel"+At._id,ya;if(zr=0?ga=gr:Br+Ia=0?ga=Br:na+Ia=0?Aa=jt:Ot+va=0?Aa=Ot:Ur+va=0,(sa.idealAlign==="top"||!pn)&&Ga?(mr-=oa/2,sa.anchor="end"):pn?(mr+=oa/2,sa.anchor="start"):sa.anchor="middle",sa.crossPos=mr;else{if(sa.pos=mr,pn=Qt+$r/2+pa<=fr,Ga=Qt-$r/2-pa>=0,(sa.idealAlign==="left"||!pn)&&Ga)Qt-=$r/2,sa.anchor="end";else if(pn)Qt+=$r/2,sa.anchor="start";else{sa.anchor="middle";var qn=pa/2,Vn=Qt+qn-fr,di=Qt-qn;Vn>0&&(Qt-=Vn),di<0&&(Qt+=-di)}sa.crossPos=Qt}Pr.attr("text-anchor",sa.anchor),Zr&&Hr.attr("text-anchor",sa.anchor),Oa.attr("transform",e(Qt,mr)+(Ae?t(b):""))}),{hoverLabels:Pa,commonLabelBoundingBox:be}}function O(q,ae,ie,fe,we,Ae){var Fe="",Ce="";q.nameOverride!==void 0&&(q.name=q.nameOverride),q.name&&(q.trace._meta&&(q.name=A.templateString(q.name,q.trace._meta)),Fe=j(q.name,q.nameLength));var qe=ie.charAt(0),et=qe==="x"?"y":"x";q.zLabel!==void 0?(q.xLabel!==void 0&&(Ce+="x: "+q.xLabel+"
"),q.yLabel!==void 0&&(Ce+="y: "+q.yLabel+"
"),q.trace.type!=="choropleth"&&q.trace.type!=="choroplethmapbox"&&q.trace.type!=="choroplethmap"&&(Ce+=(Ce?"z: ":"")+q.zLabel)):ae&&q[qe+"Label"]===we?Ce=q[et+"Label"]||"":q.xLabel===void 0?q.yLabel!==void 0&&q.trace.type!=="scattercarpet"&&(Ce=q.yLabel):q.yLabel===void 0?Ce=q.xLabel:Ce="("+q.xLabel+", "+q.yLabel+")",(q.text||q.text===0)&&!Array.isArray(q.text)&&(Ce+=(Ce?"
":"")+q.text),q.extraText!==void 0&&(Ce+=(Ce?"
":"")+q.extraText),Ae&&Ce===""&&!q.hovertemplate&&(Fe===""&&Ae.remove(),Ce=Fe);var Qe=q.hovertemplate||!1;if(Qe){var Ke=q.hovertemplateLabels||q;q[qe+"Label"]!==we&&(Ke[qe+"other"]=Ke[qe+"Val"],Ke[qe+"otherLabel"]=Ke[qe+"Label"]),Ce=A.hovertemplateString(Qe,Ke,fe._d3locale,q.eventData[0]||{},q.trace._meta),Ce=Ce.replace(F,function(Xe,Me){return Fe=j(Me,q.nameLength),""})}return[Ce,Fe]}function L(q,ae,ie,fe){var we=ae?"xa":"ya",Ae=ae?"ya":"xa",Fe=0,Ce=1,qe=q.size(),et=new Array(qe),Qe=0,Ke=fe.minX,Xe=fe.maxX,Me=fe.minY,xe=fe.maxY,ce=function(Oe){return Oe*ie._invScaleX},Re=function(Oe){return Oe*ie._invScaleY};q.each(function(Oe){var ve=Oe[we],ge=Oe[Ae],be=ve._id.charAt(0)==="x",Pe=ve.range;Qe===0&&Pe&&Pe[0]>Pe[1]!==be&&(Ce=-1);var We=0,ct=be?ie.width:ie.height;if(ie.hovermode==="x"||ie.hovermode==="y"){var _t=N(Oe,ae),Mt=Oe.anchor,Nt=Mt==="end"?-1:1,Bt,qt;if(Mt==="middle")Bt=Oe.crossPos+(be?Re(_t.y-Oe.by/2):ce(Oe.bx/2+Oe.tx2width/2)),qt=Bt+(be?Re(Oe.by):ce(Oe.bx));else if(be)Bt=Oe.crossPos+Re(p+_t.y)-Re(Oe.by/2-p),qt=Bt+Re(Oe.by);else{var Zt=ce(Nt*p+_t.x),lr=Zt+ce(Nt*Oe.bx);Bt=Oe.crossPos+Math.min(Zt,lr),qt=Oe.crossPos+Math.max(Zt,lr)}be?Me!==void 0&&xe!==void 0&&Math.min(qt,xe)-Math.max(Bt,Me)>1&&(ge.side==="left"?(We=ge._mainLinePosition,ct=ie.width):ct=ge._mainLinePosition):Ke!==void 0&&Xe!==void 0&&Math.min(qt,Xe)-Math.max(Bt,Ke)>1&&(ge.side==="top"?(We=ge._mainLinePosition,ct=ie.height):ct=ge._mainLinePosition)}et[Qe++]=[{datum:Oe,traceIndex:Oe.trace.index,dp:0,pos:Oe.pos,posref:Oe.posref,size:Oe.by*(be?M:1)/2,pmin:We,pmax:ct}]}),et.sort(function(Oe,ve){return Oe[0].posref-ve[0].posref||Ce*(ve[0].traceIndex-Oe[0].traceIndex)});var $e,rt,Je,At,St,Rt,Ut;function ir(Oe){var ve=Oe[0],ge=Oe[Oe.length-1];if(rt=ve.pmin-ve.pos-ve.dp+ve.size,Je=ge.pos+ge.dp+ge.size-ve.pmax,rt>.01){for(St=Oe.length-1;St>=0;St--)Oe[St].dp+=rt;$e=!1}if(!(Je<.01)){if(rt<-.01){for(St=Oe.length-1;St>=0;St--)Oe[St].dp-=Je;$e=!1}if($e){var be=0;for(At=0;Atve.pmax&&be++;for(At=Oe.length-1;At>=0&&!(be<=0);At--)Rt=Oe[At],Rt.pos>ve.pmax-1&&(Rt.del=!0,be--);for(At=0;At=0;St--)Oe[St].dp-=Je;for(At=Oe.length-1;At>=0&&!(be<=0);At--)Rt=Oe[At],Rt.pos+Rt.dp+Rt.size>ve.pmax&&(Rt.del=!0,be--)}}}for(;!$e&&Fe<=qe;){for(Fe++,$e=!0,At=0;At.01){for(St=Mr.length-1;St>=0;St--)Mr[St].dp+=rt;for(ar.push.apply(ar,Mr),et.splice(At+1,1),Ut=0,St=ar.length-1;St>=0;St--)Ut+=ar[St].dp;for(Je=Ut/ar.length,St=ar.length-1;St>=0;St--)ar[St].dp-=Je;$e=!1}else At++}et.forEach(ir)}for(At=et.length-1;At>=0;At--){var pt=et[At];for(St=pt.length-1;St>=0;St--){var ze=pt[St],Ge=ze.datum;Ge.offset=ze.dp,Ge.del=ze.del}}}function N(q,ae){var ie=0,fe=q.offset;return ae&&(fe*=-w,ie=q.offset*_),{x:ie,y:fe}}function U(q){var ae={start:1,end:-1,middle:0}[q.anchor],ie=ae*(p+u),fe=ie+ae*(q.txwidth+u),we=q.anchor==="middle";return we&&(ie-=q.tx2width/2,fe+=q.txwidth/2+u),{alignShift:ae,textShiftX:ie,text2ShiftX:fe}}function Z(q,ae,ie,fe){var we=function(Fe){return Fe*ie},Ae=function(Fe){return Fe*fe};q.each(function(Fe){var Ce=G.select(this);if(Fe.del)return Ce.remove();var qe=Ce.select("text.nums"),et=Fe.anchor,Qe=et==="end"?-1:1,Ke=U(Fe),Xe=N(Fe,ae),Me=Xe.x,xe=Xe.y,ce=et==="middle";Ce.select("path").attr("d",ce?"M-"+we(Fe.bx/2+Fe.tx2width/2)+","+Ae(xe-Fe.by/2)+"h"+we(Fe.bx)+"v"+Ae(Fe.by)+"h-"+we(Fe.bx)+"Z":"M0,0L"+we(Qe*p+Me)+","+Ae(p+xe)+"v"+Ae(Fe.by/2-p)+"h"+we(Qe*Fe.bx)+"v-"+Ae(Fe.by)+"H"+we(Qe*p+Me)+"V"+Ae(xe-p)+"Z");var Re=Me+Ke.textShiftX,$e=xe+Fe.ty0-Fe.by/2+u,rt=Fe.textAlign||"auto";rt!=="auto"&&(rt==="left"&&et!=="start"?(qe.attr("text-anchor","start"),Re=ce?-Fe.bx/2-Fe.tx2width/2+u:-Fe.bx-u):rt==="right"&&et!=="end"&&(qe.attr("text-anchor","end"),Re=ce?Fe.bx/2-Fe.tx2width/2-u:Fe.bx+u)),qe.call(o.positionText,we(Re),Ae($e)),Fe.tx2width&&(Ce.select("text.name").call(o.positionText,we(Ke.text2ShiftX+Ke.alignShift*u+Me),Ae(xe+Fe.ty0-Fe.by/2+u)),Ce.select("rect").call(i.setRect,we(Ke.text2ShiftX+(Ke.alignShift-1)*Fe.tx2width/2+Me),Ae(xe-Fe.by/2-1),we(Fe.tx2width),Ae(Fe.by+2)))})}function Q(q,ae){var ie=q.index,fe=q.trace||{},we=q.cd[0],Ae=q.cd[ie]||{};function Fe(Xe){return Xe||d(Xe)&&Xe===0}var Ce=Array.isArray(ie)?function(Xe,Me){var xe=A.castOption(we,ie,Xe);return Fe(xe)?xe:A.extractOption({},fe,"",Me)}:function(Xe,Me){return A.extractOption(Ae,fe,Xe,Me)};function qe(Xe,Me,xe){var ce=Ce(Me,xe);Fe(ce)&&(q[Xe]=ce)}if(qe("hoverinfo","hi","hoverinfo"),qe("bgcolor","hbg","hoverlabel.bgcolor"),qe("borderColor","hbc","hoverlabel.bordercolor"),qe("fontFamily","htf","hoverlabel.font.family"),qe("fontSize","hts","hoverlabel.font.size"),qe("fontColor","htc","hoverlabel.font.color"),qe("fontWeight","htw","hoverlabel.font.weight"),qe("fontStyle","hty","hoverlabel.font.style"),qe("fontVariant","htv","hoverlabel.font.variant"),qe("nameLength","hnl","hoverlabel.namelength"),qe("textAlign","hta","hoverlabel.align"),q.posref=ae==="y"||ae==="closest"&&fe.orientation==="h"?q.xa._offset+(q.x0+q.x1)/2:q.ya._offset+(q.y0+q.y1)/2,q.x0=A.constrain(q.x0,0,q.xa._length),q.x1=A.constrain(q.x1,0,q.xa._length),q.y0=A.constrain(q.y0,0,q.ya._length),q.y1=A.constrain(q.y1,0,q.ya._length),q.xLabelVal!==void 0&&(q.xLabel="xLabel"in q?q.xLabel:c.hoverLabelText(q.xa,q.xLabelVal,fe.xhoverformat),q.xVal=q.xa.c2d(q.xLabelVal)),q.yLabelVal!==void 0&&(q.yLabel="yLabel"in q?q.yLabel:c.hoverLabelText(q.ya,q.yLabelVal,fe.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 et=c.tickText(q.xa,q.xa.c2l(q.xerr),"hover").text;q.xerrneg!==void 0?q.xLabel+=" +"+et+" / -"+c.tickText(q.xa,q.xa.c2l(q.xerrneg),"hover").text:q.xLabel+=" ± "+et,ae==="x"&&(q.distance+=1)}if(!isNaN(q.yerr)&&!(q.ya.type==="log"&&q.yerr<=0)){var Qe=c.tickText(q.ya,q.ya.c2l(q.yerr),"hover").text;q.yerrneg!==void 0?q.yLabel+=" +"+Qe+" / -"+c.tickText(q.ya,q.ya.c2l(q.yerrneg),"hover").text:q.yLabel+=" ± "+Qe,ae==="y"&&(q.distance+=1)}var Ke=q.hoverinfo||q.trace.hoverinfo;return Ke&&Ke!=="all"&&(Ke=Array.isArray(Ke)?Ke:Ke.split("+"),Ke.indexOf("x")===-1&&(q.xLabel=void 0),Ke.indexOf("y")===-1&&(q.yLabel=void 0),Ke.indexOf("z")===-1&&(q.zLabel=void 0),Ke.indexOf("text")===-1&&(q.text=void 0),Ke.indexOf("name")===-1&&(q.name=void 0)),q}function ue(q,ae,ie){var fe=ie.container,we=ie.fullLayout,Ae=we._size,Fe=ie.event,Ce=!!ae.hLinePoint,qe=!!ae.vLinePoint,et,Qe;if(fe.selectAll(".spikeline").remove(),!!(qe||Ce)){var Ke=n.combine(we.plot_bgcolor,we.paper_bgcolor);if(Ce){var Xe=ae.hLinePoint,Me,xe;et=Xe&&Xe.xa,Qe=Xe&&Xe.ya;var ce=Qe.spikesnap;ce==="cursor"?(Me=Fe.pointerX,xe=Fe.pointerY):(Me=et._offset+Xe.x,xe=Qe._offset+Xe.y);var Re=x.readability(Xe.color,Ke)<1.5?n.contrast(Ke):Xe.color,$e=Qe.spikemode,rt=Qe.spikethickness,Je=Qe.spikecolor||Re,At=c.getPxPosition(q,Qe),St,Rt;if($e.indexOf("toaxis")!==-1||$e.indexOf("across")!==-1){if($e.indexOf("toaxis")!==-1&&(St=At,Rt=Me),$e.indexOf("across")!==-1){var Ut=Qe._counterDomainMin,ir=Qe._counterDomainMax;Qe.anchor==="free"&&(Ut=Math.min(Ut,Qe.position),ir=Math.max(ir,Qe.position)),St=Ae.l+Ut*Ae.w,Rt=Ae.l+ir*Ae.w}fe.insert("line",":first-child").attr({x1:St,x2:Rt,y1:xe,y2:xe,"stroke-width":rt,stroke:Je,"stroke-dasharray":i.dashStyle(Qe.spikedash,rt)}).classed("spikeline",!0).classed("crisp",!0),fe.insert("line",":first-child").attr({x1:St,x2:Rt,y1:xe,y2:xe,"stroke-width":rt+2,stroke:Ke}).classed("spikeline",!0).classed("crisp",!0)}$e.indexOf("marker")!==-1&&fe.insert("circle",":first-child").attr({cx:At+(Qe.side!=="right"?rt:-rt),cy:xe,r:rt,fill:Je}).classed("spikeline",!0)}if(qe){var ar=ae.vLinePoint,Mr,fr;et=ar&&ar.xa,Qe=ar&&ar.ya;var dr=et.spikesnap;dr==="cursor"?(Mr=Fe.pointerX,fr=Fe.pointerY):(Mr=et._offset+ar.x,fr=Qe._offset+ar.y);var pt=x.readability(ar.color,Ke)<1.5?n.contrast(Ke):ar.color,ze=et.spikemode,Ge=et.spikethickness,Oe=et.spikecolor||pt,ve=c.getPxPosition(q,et),ge,be;if(ze.indexOf("toaxis")!==-1||ze.indexOf("across")!==-1){if(ze.indexOf("toaxis")!==-1&&(ge=ve,be=fr),ze.indexOf("across")!==-1){var Pe=et._counterDomainMin,We=et._counterDomainMax;et.anchor==="free"&&(Pe=Math.min(Pe,et.position),We=Math.max(We,et.position)),ge=Ae.t+(1-We)*Ae.h,be=Ae.t+(1-Pe)*Ae.h}fe.insert("line",":first-child").attr({x1:Mr,x2:Mr,y1:ge,y2:be,"stroke-width":Ge,stroke:Oe,"stroke-dasharray":i.dashStyle(et.spikedash,Ge)}).classed("spikeline",!0).classed("crisp",!0),fe.insert("line",":first-child").attr({x1:Mr,x2:Mr,y1:ge,y2:be,"stroke-width":Ge+2,stroke:Ke}).classed("spikeline",!0).classed("crisp",!0)}ze.indexOf("marker")!==-1&&fe.insert("circle",":first-child").attr({cx:Mr,cy:ve-(et.side!=="top"?Ge:-Ge),r:Ge,fill:Oe}).classed("spikeline",!0)}}}function oe(q,ae,ie){if(!ie||ie.length!==q._hoverdata.length)return!0;for(var fe=ie.length-1;fe>=0;fe--){var we=ie[fe],Ae=q._hoverdata[fe];if(we.curveNumber!==Ae.curveNumber||String(we.pointNumber)!==String(Ae.pointNumber)||String(we.pointNumbers)!==String(Ae.pointNumbers))return!0}return!1}function le(q,ae){return!0}function j(q,ae){return o.plainText(q||"",{len:ae,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function J(q,ae){for(var ie=ae.charAt(0),fe=[],we=[],Ae=[],Fe=0;Fe"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),o1=He({"src/components/shapes/draw_newshape/constants.js"(Y,G){var d=32;G.exports={CIRCLE_SIDES:d,i000:0,i090:d/4,i180:d/2,i270:d/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),s1=He({"src/components/selections/helpers.js"(Y,G){var d=Gr().strTranslate;function x(t,r){switch(t.type){case"log":return t.p2d(r);case"date":return t.p2r(r,0,t.calendar);default:return t.p2r(r)}}function A(t,r){switch(t.type){case"log":return t.d2p(r);case"date":return t.r2p(r,0,t.calendar);default:return t.r2p(r)}}function E(t){var r=t._id.charAt(0)==="y"?1:0;return function(o){return x(t,o[r])}}function e(t){return d(t.xaxis._offset,t.yaxis._offset)}G.exports={p2r:x,r2p:A,axValue:E,getTransform:e}}}),Gd=He({"src/components/shapes/draw_newshape/helpers.js"(Y){var G=Yg(),d=o1(),x=d.CIRCLE_SIDES,A=d.SQRT2,E=s1(),e=E.p2r,t=E.r2p,r=[0,3,4,5,6,1,2],o=[0,3,4,1,2];Y.writePaths=function(n){var s=n.length;if(!s)return"M0,0Z";for(var c="",f=0;f0&&yl&&(b="X"),b});return f>l&&(y=y.replace(/[\s,]*X.*/,""),d.log("Ignoring extra params in segment "+c)),v+y})}function E(e,t){t=t||0;var r=0;return t&&e&&(e.type==="category"||e.type==="multicategory")&&(r=(e.r2p(1)-e.r2p(0))*t),r}}}),zb=He({"src/components/shapes/display_labels.js"(Y,G){var d=Gr(),x=io(),A=yl(),E=vo(),e=Gd().readPaths,t=Wd(),r=t.getPathString,o=Jm(),a=df().FROM_TL;G.exports=function(c,f,v,h){if(h.selectAll(".shape-label").remove(),!!(v.label.text||v.label.texttemplate)){var T;if(v.label.texttemplate){var l={};if(v.type!=="path"){var y=x.getFromId(c,v.xref),b=x.getFromId(c,v.yref);for(var S in o){var M=o[S](v,y,b);M!==void 0&&(l[S]=M)}}T=d.texttemplateStringForShapes(v.label.texttemplate,{},c._fullLayout._d3locale,l)}else T=v.label.text;var _={"data-index":f},w=v.label.font,p={"data-notex":1},u=h.append("g").attr(_).classed("shape-label",!0),g=u.append("text").attr(p).classed("shape-label-text",!0).text(T),m,R,P,z;if(v.path){var F=r(c,v),B=e(F,c);m=1/0,P=1/0,R=-1/0,z=-1/0;for(var O=0;O=s?h=c-v:h=v-c,-180/Math.PI*Math.atan2(h,T)}function n(s,c,f,v,h,T,l){var y=h.label.textposition,b=h.label.textangle,S=h.label.padding,M=h.type,_=Math.PI/180*T,w=Math.sin(_),p=Math.cos(_),u=h.label.xanchor,g=h.label.yanchor,m,R,P,z;if(M==="line"){y==="start"?(m=s,R=c):y==="end"?(m=f,R=v):(m=(s+f)/2,R=(c+v)/2),u==="auto"&&(y==="start"?b==="auto"?f>s?u="left":fs?u="right":fs?u="right":fs?u="left":f1&&!(Ke.length===2&&Ke[1][0]==="Z")&&(j===0&&(Ke[0][0]="M"),m[le]=Ke,B(),O())}}function fe(Ke,Xe){if(Ke===2){le=+Xe.srcElement.getAttribute("data-i"),j=+Xe.srcElement.getAttribute("data-j");var Me=m[le];!T(Me)&&!l(Me)&&ie()}}function we(Ke){ue=[];for(var Xe=0;XeB&&Pe>O&&!ve.shiftKey?s.getCursor(We/be,1-ct/Pe):"move";c(m,_t),St=_t.split("-")[0]}}function ar(ve){l(g)||(L&&(J=ce(R.xanchor)),N&&($=Re(R.yanchor)),R.type==="path"?Ae=R.path:(ue=L?R.x0:ce(R.x0),oe=N?R.y0:Re(R.y0),le=L?R.x1:ce(R.x1),j=N?R.y1:Re(R.y1)),uej?(X=oe,ae="y0",re=j,ie="y1"):(X=j,ae="y1",re=oe,ie="y0"),ir(ve),ze(z,R),Oe(m,R,g),At.moveFn=St==="move"?dr:pt,At.altKey=ve.altKey)}function Mr(){l(g)||(c(m),Ge(z),S(m,g,R),x.call("_guiRelayout",g,F.getUpdateObj()))}function fr(){l(g)||Ge(z)}function dr(ve,ge){if(R.type==="path"){var be=function(ct){return ct},Pe=be,We=be;L?Q("xanchor",R.xanchor=$e(J+ve)):(Pe=function(_t){return $e(ce(_t)+ve)},Ce&&Ce.type==="date"&&(Pe=v.encodeDate(Pe))),N?Q("yanchor",R.yanchor=rt($+ge)):(We=function(_t){return rt(Re(_t)+ge)},et&&et.type==="date"&&(We=v.encodeDate(We))),Q("path",R.path=_(Ae,Pe,We))}else L?Q("xanchor",R.xanchor=$e(J+ve)):(Q("x0",R.x0=$e(ue+ve)),Q("x1",R.x1=$e(le+ve))),N?Q("yanchor",R.yanchor=rt($+ge)):(Q("y0",R.y0=rt(oe+ge)),Q("y1",R.y1=rt(j+ge)));m.attr("d",h(g,R)),ze(z,R),r(g,P,R,Fe)}function pt(ve,ge){if(Z){var be=function(va){return va},Pe=be,We=be;L?Q("xanchor",R.xanchor=$e(J+ve)):(Pe=function(La){return $e(ce(La)+ve)},Ce&&Ce.type==="date"&&(Pe=v.encodeDate(Pe))),N?Q("yanchor",R.yanchor=rt($+ge)):(We=function(La){return rt(Re(La)+ge)},et&&et.type==="date"&&(We=v.encodeDate(We))),Q("path",R.path=_(Ae,Pe,We))}else if(U){if(St==="resize-over-start-point"){var ct=ue+ve,_t=N?oe-ge:oe+ge;Q("x0",R.x0=L?ct:$e(ct)),Q("y0",R.y0=N?_t:rt(_t))}else if(St==="resize-over-end-point"){var Mt=le+ve,Nt=N?j-ge:j+ge;Q("x1",R.x1=L?Mt:$e(Mt)),Q("y1",R.y1=N?Nt:rt(Nt))}}else{var Bt=function(va){return St.indexOf(va)!==-1},qt=Bt("n"),Zt=Bt("s"),lr=Bt("w"),ta=Bt("e"),da=qt?X+ge:X,wa=Zt?re+ge:re,ma=lr?ee+ve:ee,Ia=ta?q+ve:q;N&&(qt&&(da=X-ge),Zt&&(wa=re-ge)),(!N&&wa-da>O||N&&da-wa>O)&&(Q(ae,R[ae]=N?da:rt(da)),Q(ie,R[ie]=N?wa:rt(wa))),Ia-ma>B&&(Q(fe,R[fe]=L?ma:$e(ma)),Q(we,R[we]=L?Ia:$e(Ia)))}m.attr("d",h(g,R)),ze(z,R),r(g,P,R,Fe)}function ze(ve,ge){(L||N)&&be();function be(){var Pe=ge.type!=="path",We=ve.selectAll(".visual-cue").data([0]),ct=1;We.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":ct}).classed("visual-cue",!0);var _t=ce(L?ge.xanchor:A.midRange(Pe?[ge.x0,ge.x1]:v.extractPathCoords(ge.path,f.paramIsX))),Mt=Re(N?ge.yanchor:A.midRange(Pe?[ge.y0,ge.y1]:v.extractPathCoords(ge.path,f.paramIsY)));if(_t=v.roundPositionForSharpStrokeRendering(_t,ct),Mt=v.roundPositionForSharpStrokeRendering(Mt,ct),L&&N){var Nt="M"+(_t-1-ct)+","+(Mt-1-ct)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";We.attr("d",Nt)}else if(L){var Bt="M"+(_t-1-ct)+","+(Mt-9-ct)+"v18 h2 v-18 Z";We.attr("d",Bt)}else{var qt="M"+(_t-9-ct)+","+(Mt-1-ct)+"h18 v2 h-18 Z";We.attr("d",qt)}}}function Ge(ve){ve.selectAll(".visual-cue").remove()}function Oe(ve,ge,be){var Pe=ge.xref,We=ge.yref,ct=E.getFromId(be,Pe),_t=E.getFromId(be,We),Mt="";Pe!=="paper"&&!ct.autorange&&(Mt+=Pe),We!=="paper"&&!_t.autorange&&(Mt+=We),i.setClipUrl(ve,Mt?"clip"+be._fullLayout._uid+Mt:null,be)}}function _(g,m,R){return g.replace(f.segmentRE,function(P){var z=0,F=P.charAt(0),B=f.paramIsX[F],O=f.paramIsY[F],L=f.numParams[F],N=P.substr(1).replace(f.paramRE,function(U){return z>=L||(B[z]?U=m(U):O[z]&&(U=R(U)),z++),U});return F+N})}function w(g,m){if(y(g)){var R=m.node(),P=+R.getAttribute("data-index");if(P>=0){if(P===g._fullLayout._activeShapeIndex){p(g);return}g._fullLayout._activeShapeIndex=P,g._fullLayout._deactivateShape=p,T(g)}}}function p(g){if(y(g)){var m=g._fullLayout._activeShapeIndex;m>=0&&(o(g),delete g._fullLayout._activeShapeIndex,T(g))}}function u(g){if(y(g)){o(g);var m=g._fullLayout._activeShapeIndex,R=(g.layout||{}).shapes||[];if(m1?(oe=["toggleHover"],le=["resetViews"]):u?(ue=["zoomInGeo","zoomOutGeo"],oe=["hoverClosestGeo"],le=["resetGeo"]):p?(oe=["hoverClosest3d"],le=["resetCameraDefault3d","resetCameraLastSave3d"]):P?(ue=["zoomInMapbox","zoomOutMapbox"],oe=["toggleHover"],le=["resetViewMapbox"]):z?(ue=["zoomInMap","zoomOutMap"],oe=["toggleHover"],le=["resetViewMap"]):g?oe=["hoverClosestPie"]:O?(oe=["hoverClosestCartesian","hoverCompareCartesian"],le=["resetViewSankey"]):oe=["toggleHover"],w&&oe.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(s(T)||N)&&(oe=[]),w&&!L&&(ue=["zoomIn2d","zoomOut2d","autoScale2d"],le[0]!=="resetViews"&&(le=["resetScale2d"])),p?j=["zoom3d","pan3d","orbitRotation","tableRotation"]:w&&!L||R?j=["zoom2d","pan2d"]:P||z||u?j=["pan2d"]:F&&(j=["zoom2d"]),n(T)&&j.push("select2d","lasso2d");var J=[],$=function(q){J.indexOf(q)===-1&&oe.indexOf(q)!==-1&&J.push(q)};if(Array.isArray(M)){for(var X=[],re=0;reb?T.substr(b):l.substr(y))+S}function c(v,h){for(var T=h._size,l=T.h/T.w,y={},b=Object.keys(v),S=0;St*R&&!B)){for(b=0;bj&&ieoe&&(oe=ie);var we=(oe-ue)/(2*le);u/=we,ue=_.l2r(ue),oe=_.l2r(oe),_.range=_._input.range=U=O[1]||Z[1]<=O[0])&&Q[0]L[0])return!0}return!1}function S(O){var L=O._fullLayout,N=L._size,U=N.p,Z=i.list(O,"",!0),Q,ue,oe,le,j,J;if(L._paperdiv.style({width:O._context.responsive&&L.autosize&&!O._context._hasZeroWidth&&!O.layout.width?"100%":L.width+"px",height:O._context.responsive&&L.autosize&&!O._context._hasZeroHeight&&!O.layout.height?"100%":L.height+"px"}).selectAll(".main-svg").call(r.setSize,L.width,L.height),O._context.setBackground(O,L.paper_bgcolor),Y.drawMainTitle(O),a.manage(O),!L._has("cartesian"))return x.previousPromises(O);function $(Oe,ve,ge){var be=Oe._lw/2;if(Oe._id.charAt(0)==="x"){if(ve){if(ge==="top")return ve._offset-U-be}else return N.t+N.h*(1-(Oe.position||0))+be%1;return ve._offset+ve._length+U+be}if(ve){if(ge==="right")return ve._offset+ve._length+U+be}else return N.l+N.w*(Oe.position||0)+be%1;return ve._offset-U-be}for(Q=0;Q0){m(O,Q,j,le),oe.attr({x:ue,y:Q,"text-anchor":U,dy:z(L.yanchor)}).call(E.positionText,ue,Q);var J=(L.text.match(E.BR_TAG_ALL)||[]).length;if(J){var $=n.LINE_SPACING*J+n.MID_SHIFT;L.y===0&&($=-$),oe.selectAll(".line").each(function(){var ae=+this.getAttribute("dy").slice(0,-2)-$+"em";this.setAttribute("dy",ae)})}var X=G.selectAll(".gtitle-subtitle");if(X.node()){var re=oe.node().getBBox(),ee=re.y+re.height,q=ee+o.SUBTITLE_PADDING_EM*L.subtitle.font.size;X.attr({x:ue,y:q,"text-anchor":U,dy:z(L.yanchor)}).call(E.positionText,ue,q)}}}};function p(O,L,N,U,Z){var Q=L.yref==="paper"?O._fullLayout._size.h:O._fullLayout.height,ue=A.isTopAnchor(L)?U:U-Z,oe=N==="b"?Q-ue:ue;return A.isTopAnchor(L)&&N==="t"||A.isBottomAnchor(L)&&N==="b"?!1:oe.5?"t":"b",ue=O._fullLayout.margin[Q],oe=0;return L.yref==="paper"?oe=N+L.pad.t+L.pad.b:L.yref==="container"&&(oe=u(Q,U,Z,O._fullLayout.height,N)+L.pad.t+L.pad.b),oe>ue?oe:0}function m(O,L,N,U){var Z="title.automargin",Q=O._fullLayout.title,ue=Q.y>.5?"t":"b",oe={x:Q.x,y:Q.y,t:0,b:0},le={};Q.yref==="paper"&&p(O,Q,ue,L,U)?oe[ue]=N:Q.yref==="container"&&(le[ue]=N,O._fullLayout._reservedMargin[Z]=le),x.allowAutoMargin(O,Z),x.autoMargin(O,Z,oe)}function R(O,L){var N=O.title,U=O._size,Z=0;switch(L===h?Z=N.pad.l:L===l&&(Z=-N.pad.r),N.xref){case"paper":return U.l+U.w*N.x+Z;case"container":default:return O.width*N.x+Z}}function P(O,L){var N=O.title,U=O._size,Z=0;if(L==="0em"||!L?Z=-N.pad.b:L===n.CAP_SHIFT+"em"&&(Z=N.pad.t),N.y==="auto")return U.t/2;switch(N.yref){case"paper":return U.t+U.h-U.h*N.y+Z;case"container":default:return O.height-O.height*N.y+Z}}function z(O){return O==="top"?n.CAP_SHIFT+.3+"em":O==="bottom"?"-0.3em":n.MID_SHIFT+"em"}function F(O){var L=O.title,N=T;return A.isRightAnchor(L)?N=l:A.isLeftAnchor(L)&&(N=h),N}function B(O){var L=O.title,N="0em";return A.isTopAnchor(L)?N=n.CAP_SHIFT+"em":A.isMiddleAnchor(L)&&(N=n.MID_SHIFT+"em"),N}Y.doTraceStyle=function(O){var L=O.calcdata,N=[],U;for(U=0;U=0;F--){var B=M.append("path").attr(w).style("opacity",F?.1:p).call(E.stroke,g).call(E.fill,u).call(e.dashLine,F?"solid":R,F?4+m:m);if(s(B,h,y),P){var O=t(h.layout,"selections",y);B.style({cursor:"move"});var L={element:B.node(),plotinfo:b,gd:h,editHelpers:O,isActiveSelection:!0},N=d(_,h);x(N,B,L)}else B.style("pointer-events",F?"all":"none");z[F]=B}var U=z[0],Z=z[1];Z.node().addEventListener("click",function(){return c(h,U)})}}function s(h,T,l){var y=l.xref+l.yref;e.setClipUrl(h,"clip"+T._fullLayout._uid+y,T)}function c(h,T){if(i(h)){var l=T.node(),y=+l.getAttribute("data-index");if(y>=0){if(y===h._fullLayout._activeSelectionIndex){v(h);return}h._fullLayout._activeSelectionIndex=y,h._fullLayout._deactivateSelection=v,a(h)}}}function f(h){if(i(h)){var T=h._fullLayout.selections.length-1;h._fullLayout._activeSelectionIndex=T,h._fullLayout._deactivateSelection=v,a(h)}}function v(h){if(i(h)){var T=h._fullLayout._activeSelectionIndex;T>=0&&(A(h),delete h._fullLayout._activeSelectionIndex,a(h))}}}}),gM=He({"node_modules/polybooljs/lib/build-log.js"(Y,G){function d(){var x,A=0,E=!1;function e(t,r){return x.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),x}return x={list:[],segmentId:function(){return A++},checkIntersection:function(t,r){return e("check",{seg1:t,seg2:r})},segmentChop:function(t,r){return e("div_seg",{seg:t,pt:r}),e("chop",{seg:t,pt:r})},statusRemove:function(t){return e("pop_seg",{seg:t})},segmentUpdate:function(t){return e("seg_update",{seg:t})},segmentNew:function(t,r){return e("new_seg",{seg:t,primary:r})},segmentRemove:function(t){return e("rem_seg",{seg:t})},tempStatus:function(t,r,o){return e("temp_status",{seg:t,above:r,below:o})},rewind:function(t){return e("rewind",{seg:t})},status:function(t,r,o){return e("status",{seg:t,above:r,below:o})},vert:function(t){return t===E?x:(E=t,e("vert",{x:t}))},log:function(t){return typeof t!="string"&&(t=JSON.stringify(t,!1," ")),e("log",{txt:t})},reset:function(){return e("reset")},selected:function(t){return e("selected",{segs:t})},chainStart:function(t){return e("chain_start",{seg:t})},chainRemoveHead:function(t,r){return e("chain_rem_head",{index:t,pt:r})},chainRemoveTail:function(t,r){return e("chain_rem_tail",{index:t,pt:r})},chainNew:function(t,r){return e("chain_new",{pt1:t,pt2:r})},chainMatch:function(t){return e("chain_match",{index:t})},chainClose:function(t){return e("chain_close",{index:t})},chainAddHead:function(t,r){return e("chain_add_head",{index:t,pt:r})},chainAddTail:function(t,r){return e("chain_add_tail",{index:t,pt:r})},chainConnect:function(t,r){return e("chain_con",{index1:t,index2:r})},chainReverse:function(t){return e("chain_rev",{index:t})},chainJoin:function(t,r){return e("chain_join",{index1:t,index2:r})},done:function(){return e("done")}},x}G.exports=d}}),yM=He({"node_modules/polybooljs/lib/epsilon.js"(Y,G){function d(x){typeof x!="number"&&(x=1e-10);var A={epsilon:function(E){return typeof E=="number"&&(x=E),x},pointAboveOrOnLine:function(E,e,t){var r=e[0],o=e[1],a=t[0],i=t[1],n=E[0],s=E[1];return(a-r)*(s-o)-(i-o)*(n-r)>=-x},pointBetween:function(E,e,t){var r=E[1]-e[1],o=t[0]-e[0],a=E[0]-e[0],i=t[1]-e[1],n=a*o+r*i;if(n-x)},pointsSameX:function(E,e){return Math.abs(E[0]-e[0])x!=a-r>x&&(o-s)*(r-c)/(a-c)+s-t>x&&(i=!i),o=s,a=c}return i}};return A}G.exports=d}}),mM=He({"node_modules/polybooljs/lib/linked-list.js"(Y,G){var d={create:function(){var x={root:{root:!0,next:null},exists:function(A){return!(A===null||A===x.root)},isEmpty:function(){return x.root.next===null},getHead:function(){return x.root.next},insertBefore:function(A,E){for(var e=x.root,t=x.root.next;t!==null;){if(E(t)){A.prev=t.prev,A.next=t,t.prev.next=A,t.prev=A;return}e=t,t=t.next}e.next=A,A.prev=e,A.next=null},findTransition:function(A){for(var E=x.root,e=x.root.next;e!==null&&!A(e);)E=e,e=e.next;return{before:E===x.root?null:E,after:e,insert:function(t){return t.prev=E,t.next=e,E.next=t,e!==null&&(e.prev=t),t}}}};return x},node:function(x){return x.prev=null,x.next=null,x.remove=function(){x.prev.next=x.next,x.next&&(x.next.prev=x.prev),x.prev=null,x.next=null},x}};G.exports=d}}),_M=He({"node_modules/polybooljs/lib/intersecter.js"(Y,G){var d=mM();function x(A,E,e){function t(T,l){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:null,below:null},otherFill:null}}function r(T,l,y){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:y.myFill.above,below:y.myFill.below},otherFill:null}}var o=d.create();function a(T,l,y,b,S,M){var _=E.pointsCompare(l,S);return _!==0?_:E.pointsSame(y,M)?0:T!==b?T?1:-1:E.pointAboveOrOnLine(y,b?S:M,b?M:S)?1:-1}function i(T,l){o.insertBefore(T,function(y){var b=a(T.isStart,T.pt,l,y.isStart,y.pt,y.other.pt);return b<0})}function n(T,l){var y=d.node({isStart:!0,pt:T.start,seg:T,primary:l,other:null,status:null});return i(y,T.end),y}function s(T,l,y){var b=d.node({isStart:!1,pt:l.end,seg:l,primary:y,other:T,status:null});T.other=b,i(b,T.pt)}function c(T,l){var y=n(T,l);return s(y,T,l),y}function f(T,l){e&&e.segmentChop(T.seg,l),T.other.remove(),T.seg.end=l,T.other.pt=l,i(T.other,T.pt)}function v(T,l){var y=r(l,T.seg.end,T.seg);return f(T,l),c(y,T.primary)}function h(T,l){var y=d.create();function b(B,O){var L=B.seg.start,N=B.seg.end,U=O.seg.start,Z=O.seg.end;return E.pointsCollinear(L,U,Z)?E.pointsCollinear(N,U,Z)||E.pointAboveOrOnLine(N,U,Z)?1:-1:E.pointAboveOrOnLine(L,U,Z)?1:-1}function S(B){return y.findTransition(function(O){var L=b(B,O.ev);return L>0})}function M(B,O){var L=B.seg,N=O.seg,U=L.start,Z=L.end,Q=N.start,ue=N.end;e&&e.checkIntersection(L,N);var oe=E.linesIntersect(U,Z,Q,ue);if(oe===!1){if(!E.pointsCollinear(U,Z,Q)||E.pointsSame(U,ue)||E.pointsSame(Z,Q))return!1;var le=E.pointsSame(U,Q),j=E.pointsSame(Z,ue);if(le&&j)return O;var J=!le&&E.pointBetween(U,Q,ue),$=!j&&E.pointBetween(Z,Q,ue);if(le)return $?v(O,Z):v(B,ue),O;J&&(j||($?v(O,Z):v(B,ue)),v(O,U))}else oe.alongA===0&&(oe.alongB===-1?v(B,Q):oe.alongB===0?v(B,oe.pt):oe.alongB===1&&v(B,ue)),oe.alongB===0&&(oe.alongA===-1?v(O,U):oe.alongA===0?v(O,oe.pt):oe.alongA===1&&v(O,Z));return!1}for(var _=[];!o.isEmpty();){var w=o.getHead();if(e&&e.vert(w.pt[0]),w.isStart){let B=function(){if(u){var O=M(w,u);if(O)return O}return g?M(w,g):!1};e&&e.segmentNew(w.seg,w.primary);var p=S(w),u=p.before?p.before.ev:null,g=p.after?p.after.ev:null;e&&e.tempStatus(w.seg,u?u.seg:!1,g?g.seg:!1);var m=B();if(m){if(A){var R;w.seg.myFill.below===null?R=!0:R=w.seg.myFill.above!==w.seg.myFill.below,R&&(m.seg.myFill.above=!m.seg.myFill.above)}else m.seg.otherFill=w.seg.myFill;e&&e.segmentUpdate(m.seg),w.other.remove(),w.remove()}if(o.getHead()!==w){e&&e.rewind(w.seg);continue}if(A){var R;w.seg.myFill.below===null?R=!0:R=w.seg.myFill.above!==w.seg.myFill.below,g?w.seg.myFill.below=g.seg.myFill.above:w.seg.myFill.below=T,R?w.seg.myFill.above=!w.seg.myFill.below:w.seg.myFill.above=w.seg.myFill.below}else if(w.seg.otherFill===null){var P;g?w.primary===g.primary?P=g.seg.otherFill.above:P=g.seg.myFill.above:P=w.primary?l:T,w.seg.otherFill={above:P,below:P}}e&&e.status(w.seg,u?u.seg:!1,g?g.seg:!1),w.other.status=p.insert(d.node({ev:w}))}else{var z=w.status;if(z===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(y.exists(z.prev)&&y.exists(z.next)&&M(z.prev.ev,z.next.ev),e&&e.statusRemove(z.ev.seg),z.remove(),!w.primary){var F=w.seg.myFill;w.seg.myFill=w.seg.otherFill,w.seg.otherFill=F}_.push(w.seg)}o.getHead().remove()}return e&&e.done(),_}return A?{addRegion:function(T){for(var l,y=T[T.length-1],b=0;br!=v>r&&t<(f-s)*(r-c)/(v-c)+s;h&&(o=!o)}return o}}}),ey=He({"src/lib/polygon.js"(Y,G){var d=Km().dot,x=lo().BADNUM,A=G.exports={};A.tester=function(e){var t=e.slice(),r=t[0][0],o=r,a=t[0][1],i=a,n;for((t[t.length-1][0]!==t[0][0]||t[t.length-1][1]!==t[0][1])&&t.push(t[0]),n=1;no||S===x||Si||y&&c(l))}function v(l,y){var b=l[0],S=l[1];if(b===x||bo||S===x||Si)return!1;var M=t.length,_=t[0][0],w=t[0][1],p=0,u,g,m,R,P;for(u=1;uMath.max(g,_)||S>Math.max(m,w)))if(Sn||Math.abs(d(v,c))>o)return!0;return!1},A.filter=function(e,t){var r=[e[0]],o=0,a=0;function i(s){e.push(s);var c=r.length,f=o;r.splice(a+1);for(var v=f+1;v1){var n=e.pop();i(n)}return{addPt:i,raw:e,filtered:r}}}}),SM=He({"src/components/selections/constants.js"(Y,G){G.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),MM=He({"src/components/selections/select.js"(Y,G){var d=TM(),x=AM(),A=Ei(),E=vo().dashStyle,e=Ai(),t=Wu(),r=Ph().makeEventData,o=bv(),a=o.freeMode,i=o.rectMode,n=o.drawMode,s=o.openMode,c=o.selectMode,f=Wd(),v=$g(),h=u1(),T=jd().clearOutline,l=Gd(),y=l.handleEllipse,b=l.readPaths,S=l1().newShapes,M=Db(),_=jb().activateLastSelection,w=Gr(),p=w.sorterAsc,u=ey(),g=e1(),m=oc().getFromId,R=Jg(),P=Qg().redrawReglTraces,z=SM(),F=z.MINSELECT,B=u.filter,O=u.tester,L=s1(),N=L.p2r,U=L.axValue,Z=L.getTransform;function Q(ze){return ze.subplot!==void 0}function ue(ze,Ge,Oe,ve,ge){var be=!Q(ve),Pe=a(ge),We=i(ge),ct=s(ge),_t=n(ge),Mt=c(ge),Nt=ge==="drawline",Bt=ge==="drawcircle",qt=Nt||Bt,Zt=ve.gd,lr=Zt._fullLayout,ta=Mt&&lr.newselection.mode==="immediate"&&be,da=lr._zoomlayer,wa=ve.element.getBoundingClientRect(),ma=ve.plotinfo,Ia=Z(ma),va=Ge-wa.left,La=Oe-wa.top;lr._calcInverseTransform(Zt);var Ka=w.apply3DTransform(lr._invTransform)(va,La);va=Ka[0],La=Ka[1];var Vt=lr._invScaleX,Lt=lr._invScaleY,jt=va,Ot=La,gr="M"+va+","+La,Br=ve.xaxes[0],na=ve.yaxes[0],Ur=Br._length,ga=na._length,Aa=ze.altKey&&!(n(ge)&&ct),Pa,sa,Oa,dt,vt,Lr,Er;X(ze,Zt,ve),Pe&&(Pa=B([[va,La]],z.BENDPX));var _r=da.selectAll("path.select-outline-"+ma.id).data([1]),yr=_t?lr.newshape:lr.newselection;_t&&(ve.hasText=yr.label.text||yr.label.texttemplate);var kr=_t&&!ct?yr.fillcolor:"rgba(0,0,0,0)",zr=yr.line.color||(be?e.contrast(Zt._fullLayout.plot_bgcolor):"#7f7f7f");_r.enter().append("path").attr("class","select-outline select-outline-"+ma.id).style({opacity:_t?yr.opacity/2:1,"stroke-dasharray":E(yr.line.dash,yr.line.width),"stroke-width":yr.line.width+"px","shape-rendering":"crispEdges"}).call(e.stroke,zr).call(e.fill,kr).attr("fill-rule","evenodd").classed("cursor-move",!!_t).attr("transform",Ia).attr("d",gr+"Z");var Pr=da.append("path").attr("class","zoombox-corners").style({fill:e.background,stroke:e.defaultLine,"stroke-width":1}).attr("transform",Ia).attr("d","M0,0Z");if(_t&&ve.hasText){var Hr=da.select(".label-temp");Hr.empty()&&(Hr=da.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Zr=lr._uid+z.SELECTID,Jr=[],wt=ie(Zt,ve.xaxes,ve.yaxes,ve.subplot);ta&&!ze.shiftKey&&(ve._clearSubplotSelections=function(){if(be){var mr=Br._id,$r=na._id;rt(Zt,mr,$r,wt);for(var oa=(Zt.layout||{}).selections||[],Sa=[],ya=!1,ra=0;ra=0){Zt._fullLayout._deactivateShape(Zt);return}if(!_t){var oa=lr.clickmode;g.done(Zr).then(function(){if(g.clear(Zr),mr===2){for(_r.remove(),vt=0;vt-1&&oe($r,Zt,ve.xaxes,ve.yaxes,ve.subplot,ve,_r),oa==="event"&&dr(Zt,void 0);t.click(Zt,$r,ma.id)}).catch(w.error)}},ve.doneFn=function(){Pr.remove(),g.done(Zr).then(function(){g.clear(Zr),!ta&&dt&&ve.selectionDefs&&(dt.subtract=Aa,ve.selectionDefs.push(dt),ve.mergedPolygons.length=0,[].push.apply(ve.mergedPolygons,Oa)),(ta||_t)&&q(ve,ta),ve.doneFnCompleted&&ve.doneFnCompleted(Jr),Mt&&dr(Zt,Er)}).catch(w.error)}}function oe(ze,Ge,Oe,ve,ge,be,Pe){var We=Ge._hoverdata,ct=Ge._fullLayout,_t=ct.clickmode,Mt=_t.indexOf("event")>-1,Nt=[],Bt,qt,Zt,lr,ta,da,wa,ma,Ia,va;if(we(We)){X(ze,Ge,be),Bt=ie(Ge,Oe,ve,ge);var La=Ae(We,Bt),Ka=La.pointNumbers.length>0;if(Ka?Ce(Bt,La):qe(Bt)&&(wa=Fe(La))){for(Pe&&Pe.remove(),va=0;va=0}function ee(ze){return ze._fullLayout._activeSelectionIndex>=0}function q(ze,Ge){var Oe=ze.dragmode,ve=ze.plotinfo,ge=ze.gd;re(ge)&&ge._fullLayout._deactivateShape(ge),ee(ge)&&ge._fullLayout._deactivateSelection(ge);var be=ge._fullLayout,Pe=be._zoomlayer,We=n(Oe),ct=c(Oe);if(We||ct){var _t=Pe.selectAll(".select-outline-"+ve.id);if(_t&&ge._fullLayout._outlining){var Mt;We&&(Mt=S(_t,ze)),Mt&&A.call("_guiRelayout",ge,{shapes:Mt});var Nt;ct&&!Q(ze)&&(Nt=M(_t,ze)),Nt&&(ge._fullLayout._noEmitSelectedAtStart=!0,A.call("_guiRelayout",ge,{selections:Nt}).then(function(){Ge&&_(ge)})),ge._fullLayout._outlining=!1}}ve.selection={},ve.selection.selectionDefs=ze.selectionDefs=[],ve.selection.mergedPolygons=ze.mergedPolygons=[]}function ae(ze){return ze._id}function ie(ze,Ge,Oe,ve){if(!ze.calcdata)return[];var ge=[],be=Ge.map(ae),Pe=Oe.map(ae),We,ct,_t;for(_t=0;_t0,be=ge?ve[0]:Oe;return Ge.selectedpoints?Ge.selectedpoints.indexOf(be)>-1:!1}function Ce(ze,Ge){var Oe=[],ve,ge,be,Pe;for(Pe=0;Pe0&&Oe.push(ve);if(Oe.length===1&&(be=Oe[0]===Ge.searchInfo,be&&(ge=Ge.searchInfo.cd[0].trace,ge.selectedpoints.length===Ge.pointNumbers.length))){for(Pe=0;Pe1||(Ge+=ve.selectedpoints.length,Ge>1)))return!1;return Ge===1}function et(ze,Ge,Oe){var ve;for(ve=0;ve-1&&Ge;if(!Pe&&Ge){var mr=At(ze,!0);if(mr.length){var $r=mr[0].xref,oa=mr[0].yref;if($r&&oa){var Sa=Ut(mr),ya=ar([m(ze,$r,"x"),m(ze,oa,"y")]);ya(Jr,Sa)}}ze._fullLayout._noEmitSelectedAtStart?ze._fullLayout._noEmitSelectedAtStart=!1:Qt&&dr(ze,Jr),Bt._reselect=!1}if(!Pe&&Bt._deselect){var ra=Bt._deselect;We=ra.xref,ct=ra.yref,$e(We,ct,Mt)||rt(ze,We,ct,ve),Qt&&(Jr.points.length?dr(ze,Jr):pt(ze)),Bt._deselect=!1}return{eventData:Jr,selectionTesters:Oe}}function Re(ze){var Ge=ze.calcdata;if(Ge)for(var Oe=0;Oe=0){kr._fullLayout._deactivateShape(kr);return}var zr=kr._fullLayout.clickmode;if(J(kr),_r===2&&!Me&&sa(),Xe)zr.indexOf("select")>-1&&p(yr,kr,rt,Je,we.id,Mt),zr.indexOf("event")>-1&&n.click(kr,yr,we.id);else if(_r===1&&Me){var Pr=et?ce:xe,Hr=et==="s"||Qe==="w"?0:1,Zr=Pr._name+".range["+Hr+"]",Jr=L(Pr,Hr),wt="left",Qt="middle";if(Pr.fixedrange)return;et?(Qt=et==="n"?"top":"bottom",Pr.side==="right"&&(wt="right")):Qe==="e"&&(wt="right"),kr._context.showAxisRangeEntryBoxes&&d.select(_t).call(o.makeEditable,{gd:kr,immediate:!0,background:kr._fullLayout.paper_bgcolor,text:String(Jr),fill:Pr.tickfont?Pr.tickfont.color:"#444",horizontalAlign:wt,verticalAlign:Qt}).on("edit",function(mr){var $r=Pr.d2r(mr);$r!==void 0&&t.call("_guiRelayout",kr,Zr,$r)})}}f.init(Mt);var qt,Zt,lr,ta,da,wa,ma,Ia,va,La;function Ka(_r,yr,kr){var zr=_t.getBoundingClientRect();qt=yr-zr.left,Zt=kr-zr.top,fe._fullLayout._calcInverseTransform(fe);var Pr=x.apply3DTransform(fe._fullLayout._invTransform)(qt,Zt);qt=Pr[0],Zt=Pr[1],lr={l:qt,r:qt,w:0,t:Zt,b:Zt,h:0},ta=fe._hmpixcount?fe._hmlumcount/fe._hmpixcount:E(fe._fullLayout.plot_bgcolor).getLuminance(),da="M0,0H"+Rt+"V"+Ut+"H0V0",wa=!1,ma="xy",La=!1,Ia=ue(Ke,ta,At,St,da),va=oe(Ke,At,St)}function Vt(_r,yr){if(fe._transitioningWithDuration)return!1;var kr=Math.max(0,Math.min(Rt,be*_r+qt)),zr=Math.max(0,Math.min(Ut,Pe*yr+Zt)),Pr=Math.abs(kr-qt),Hr=Math.abs(zr-Zt);lr.l=Math.min(qt,kr),lr.r=Math.max(qt,kr),lr.t=Math.min(Zt,zr),lr.b=Math.max(Zt,zr);function Zr(){ma="",lr.r=lr.l,lr.t=lr.b,va.attr("d","M0,0Z")}if(ir.isSubplotConstrained)Pr>R||Hr>R?(ma="xy",Pr/Rt>Hr/Ut?(Hr=Pr*Ut/Rt,Zt>zr?lr.t=Zt-Hr:lr.b=Zt+Hr):(Pr=Hr*Rt/Ut,qt>kr?lr.l=qt-Pr:lr.r=qt+Pr),va.attr("d",ee(lr))):Zr();else if(ar.isSubplotConstrained)if(Pr>R||Hr>R){ma="xy";var Jr=Math.min(lr.l/Rt,(Ut-lr.b)/Ut),wt=Math.max(lr.r/Rt,(Ut-lr.t)/Ut);lr.l=Jr*Rt,lr.r=wt*Rt,lr.b=(1-Jr)*Ut,lr.t=(1-wt)*Ut,va.attr("d",ee(lr))}else Zr();else!fr||Hr0){var mr;if(ar.isSubplotConstrained||!Mr&&fr.length===1){for(mr=0;mr1&&(Zr.maxallowed!==void 0&&pt===(Zr.range[0]1&&(Jr.maxallowed!==void 0&&ze===(Jr.range[0]=0?Math.min(fe,.9):1/(1/Math.max(fe,-.3)+3.222))}function Q(fe,we,Ae){return fe?fe==="nsew"?Ae?"":we==="pan"?"move":"crosshair":fe.toLowerCase()+"-resize":"pointer"}function ue(fe,we,Ae,Fe,Ce){return fe.append("path").attr("class","zoombox").style({fill:we>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",r(Ae,Fe)).attr("d",Ce+"Z")}function oe(fe,we,Ae){return fe.append("path").attr("class","zoombox-corners").style({fill:a.background,stroke:a.defaultLine,"stroke-width":1,opacity:0}).attr("transform",r(we,Ae)).attr("d","M0,0Z")}function le(fe,we,Ae,Fe,Ce,qe){fe.attr("d",Fe+"M"+Ae.l+","+Ae.t+"v"+Ae.h+"h"+Ae.w+"v-"+Ae.h+"h-"+Ae.w+"Z"),j(fe,we,Ce,qe)}function j(fe,we,Ae,Fe){Ae||(fe.transition().style("fill",Fe>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),we.transition().style("opacity",1).duration(200))}function J(fe){d.select(fe).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function $(fe){P&&fe.data&&fe._context.showTips&&(x.notifier(x._(fe,"Double-click to zoom back out"),"long"),P=!1)}function X(fe,we){return"M"+(fe.l-.5)+","+(we-R-.5)+"h-3v"+(2*R+1)+"h3ZM"+(fe.r+.5)+","+(we-R-.5)+"h3v"+(2*R+1)+"h-3Z"}function re(fe,we){return"M"+(we-R-.5)+","+(fe.t-.5)+"v-3h"+(2*R+1)+"v3ZM"+(we-R-.5)+","+(fe.b+.5)+"v3h"+(2*R+1)+"v-3Z"}function ee(fe){var we=Math.floor(Math.min(fe.b-fe.t,fe.r-fe.l,R)/2);return"M"+(fe.l-3.5)+","+(fe.t-.5+we)+"h3v"+-we+"h"+we+"v-3h-"+(we+3)+"ZM"+(fe.r+3.5)+","+(fe.t-.5+we)+"h-3v"+-we+"h"+-we+"v-3h"+(we+3)+"ZM"+(fe.r+3.5)+","+(fe.b+.5-we)+"h-3v"+we+"h"+-we+"v3h"+(we+3)+"ZM"+(fe.l-3.5)+","+(fe.b+.5-we)+"h3v"+we+"h"+we+"v3h-"+(we+3)+"Z"}function q(fe,we,Ae,Fe,Ce){for(var qe=!1,et={},Qe={},Ke,Xe,Me,xe,ce=(Ce||{}).xaHash,Re=(Ce||{}).yaHash,$e=0;$e1&&x.warn("Full array edits are incompatible with other edits",c);var b=i[""][""];if(t(b))a.set(null);else if(Array.isArray(b))a.set(b);else return x.warn("Unrecognized full array edit value",c,b),!0;return T?!1:(f(l,y),v(o),!0)}var S=Object.keys(i).map(Number).sort(A),M=a.get(),_=M||[],w=s(y,c).get(),p=[],u=-1,g=_.length,m,R,P,z,F,B,O,L;for(m=0;m_.length-(O?0:1)){x.warn("index out of range",c,P);continue}if(B!==void 0)F.length>1&&x.warn("Insertion & removal are incompatible with edits to the same index.",c,P),t(B)?p.push(P):O?(B==="add"&&(B={}),_.splice(P,0,B),w&&w.splice(P,0,{})):x.warn("Unrecognized full object edit value",c,P,B),u===-1&&(u=P);else for(R=0;R=0;m--)_.splice(p[m],1),w&&w.splice(p[m],1);if(_.length?M||a.set(_):a.set(null),T)return!1;if(f(l,y),h!==d){var N;if(u===-1)N=S;else{for(g=Math.max(_.length,g),N=[],m=0;m=u));m++)N.push(P);for(m=u;m0&&x.log("Clearing previous rejected promises from queue."),T._promises=[]},Y.cleanLayout=function(T){var l;T||(T={}),T.xaxis1&&(T.xaxis||(T.xaxis=T.xaxis1),delete T.xaxis1),T.yaxis1&&(T.yaxis||(T.yaxis=T.yaxis1),delete T.yaxis1),T.scene1&&(T.scene||(T.scene=T.scene1),delete T.scene1);var y=(A.subplotsRegistry.cartesian||{}).attrRegex;(A.subplotsRegistry.polar||{}).attrRegex,(A.subplotsRegistry.ternary||{}).attrRegex,(A.subplotsRegistry.gl3d||{}).attrRegex;var b=Object.keys(T);for(l=0;l3?(R.x=1.02,R.xanchor="left"):R.x<-2&&(R.x=-.02,R.xanchor="right"),R.y>3?(R.y=1.02,R.yanchor="bottom"):R.y<-2&&(R.y=-.02,R.yanchor="top")),T.dragmode==="rotate"&&(T.dragmode="orbit"),e.clean(T),T.template&&T.template.layout&&Y.cleanLayout(T.template.layout),T};function a(T,l){var y=T[l],b=l.charAt(0);y&&y!=="paper"&&(T[l]=t(y,b,!0))}Y.cleanData=function(T){for(var l=0;l0)return T.substr(0,l)}Y.hasParent=function(T,l){for(var y=v(l);y;){if(y in T)return!0;y=v(y)}return!1};var h=["x","y","z"];Y.clearAxisTypes=function(T,l,y){for(var b=0;b=ve.data.length||We<-ve.data.length)throw new Error(be+" must be valid indices for gd.data.");if(ge.indexOf(We,Pe+1)>-1||We>=0&&ge.indexOf(-ve.data.length+We)>-1||We<0&&ge.indexOf(ve.data.length+We)>-1)throw new Error("each index in "+be+" must be unique.")}}function N(ve,ge,be){if(!Array.isArray(ve.data))throw new Error("gd.data must be an array.");if(typeof ge>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(ge)||(ge=[ge]),L(ve,ge,"currentIndices"),typeof be<"u"&&!Array.isArray(be)&&(be=[be]),typeof be<"u"&&L(ve,be,"newIndices"),typeof be<"u"&&ge.length!==be.length)throw new Error("current and new indices must be of equal length.")}function U(ve,ge,be){var Pe,We;if(!Array.isArray(ve.data))throw new Error("gd.data must be an array.");if(typeof ge>"u")throw new Error("traces must be defined.");for(Array.isArray(ge)||(ge=[ge]),Pe=0;Pe"u")throw new Error("indices must be an integer or array of integers");L(ve,be,"indices");for(var ct in ge){if(!Array.isArray(ge[ct])||ge[ct].length!==be.length)throw new Error("attribute "+ct+" must be an array of length equal to indices array length");if(We&&(!(ct in Pe)||!Array.isArray(Pe[ct])||Pe[ct].length!==ge[ct].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}function Q(ve,ge,be,Pe){var We=A.isPlainObject(Pe),ct=[],_t,Mt,Nt,Bt,qt;Array.isArray(be)||(be=[be]),be=O(be,ve.data.length-1);for(var Zt in ge)for(var lr=0;lr=0&&qt=0&&qt"u")return Bt=Y.redraw(ve),t.add(ve,We,_t,ct,Mt),Bt;Array.isArray(be)||(be=[be]);try{N(ve,Pe,be)}catch(qt){throw ve.data.splice(ve.data.length-ge.length,ge.length),qt}return t.startSequence(ve),t.add(ve,We,_t,ct,Mt),Bt=Y.moveTraces(ve,Pe,be),t.stopSequence(ve),Bt}function $(ve,ge){ve=A.getGraphDiv(ve);var be=[],Pe=Y.addTraces,We=$,ct=[ve,be,ge],_t=[ve,ge],Mt,Nt;if(typeof ge>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(ge)||(ge=[ge]),L(ve,ge,"indices"),ge=O(ge,ve.data.length-1),ge.sort(A.sorterDes),Mt=0;Mt"u")for(be=[],Bt=0;Bt0&&typeof Ot.parts[na]!="string";)na--;var Ur=Ot.parts[na],ga=Ot.parts[na-1]+"."+Ur,Aa=Ot.parts.slice(0,na).join("."),Pa=E(ve.layout,Aa).get(),sa=E(Pe,Aa).get(),Oa=Ot.get();if(gr!==void 0){Ia[jt]=gr,va[jt]=Ur==="reverse"?gr:ee(Oa);var dt=o.getLayoutValObject(Pe,Ot.parts);if(dt&&dt.impliedEdits&&gr!==null)for(var vt in dt.impliedEdits)La(A.relativeAttr(jt,vt),dt.impliedEdits[vt]);if(["width","height"].indexOf(jt)!==-1)if(gr){La("autosize",null);var Lr=jt==="height"?"width":"height";La(Lr,Pe[Lr])}else Pe[jt]=ve._initialAutoSize[jt];else if(jt==="autosize")La("width",gr?null:Pe.width),La("height",gr?null:Pe.height);else if(ga.match(Ce))Lt(ga),E(Pe,Aa+"._inputRange").set(null);else if(ga.match(qe)){Lt(ga),E(Pe,Aa+"._inputRange").set(null);var Er=E(Pe,Aa).get();Er._inputDomain&&(Er._input.domain=Er._inputDomain.slice())}else ga.match(et)&&E(Pe,Aa+"._inputDomain").set(null);if(Ur==="type"){Vt=Pa;var _r=sa.type==="linear"&&gr==="log",yr=sa.type==="log"&&gr==="linear";if(_r||yr){if(!Vt||!Vt.range)La(Aa+".autorange",!0);else if(sa.autorange)_r&&(Vt.range=Vt.range[1]>Vt.range[0]?[1,2]:[2,1]);else{var kr=Vt.range[0],zr=Vt.range[1];_r?(kr<=0&&zr<=0&&La(Aa+".autorange",!0),kr<=0?kr=zr/1e6:zr<=0&&(zr=kr/1e6),La(Aa+".range[0]",Math.log(kr)/Math.LN10),La(Aa+".range[1]",Math.log(zr)/Math.LN10)):(La(Aa+".range[0]",Math.pow(10,kr)),La(Aa+".range[1]",Math.pow(10,zr)))}Array.isArray(Pe._subplots.polar)&&Pe._subplots.polar.length&&Pe[Ot.parts[0]]&&Ot.parts[1]==="radialaxis"&&delete Pe[Ot.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(ve,sa,gr,La),r.getComponentMethod("images","convertCoords")(ve,sa,gr,La)}else La(Aa+".autorange",!0),La(Aa+".range",null);E(Pe,Aa+"._inputRange").set(null)}else if(Ur.match(_)){var Pr=E(Pe,jt).get(),Hr=(gr||{}).type;(!Hr||Hr==="-")&&(Hr="linear"),r.getComponentMethod("annotations","convertCoords")(ve,Pr,Hr,La),r.getComponentMethod("images","convertCoords")(ve,Pr,Hr,La)}var Zr=y.containerArrayMatch(jt);if(Zr){qt=Zr.array,Zt=Zr.index;var Jr=Zr.property,wt=dt||{editType:"calc"};Zt!==""&&Jr===""&&(y.isAddVal(gr)?va[jt]=null:y.isRemoveVal(gr)?va[jt]=(E(be,qt).get()||[])[Zt]:A.warn("unrecognized full object value",ge)),M.update(ma,wt),Bt[qt]||(Bt[qt]={});var Qt=Bt[qt][Zt];Qt||(Qt=Bt[qt][Zt]={}),Qt[Jr]=gr,delete ge[jt]}else Ur==="reverse"?(Pa.range?Pa.range.reverse():(La(Aa+".autorange",!0),Pa.range=[1,0]),sa.autorange?ma.calc=!0:ma.plot=!0):(jt==="dragmode"&&(gr===!1&&Oa!==!1||gr!==!1&&Oa===!1)||Pe._has("scatter-like")&&Pe._has("regl")&&jt==="dragmode"&&(gr==="lasso"||gr==="select")&&!(Oa==="lasso"||Oa==="select")?ma.plot=!0:dt?M.update(ma,dt):ma.calc=!0,Ot.set(gr))}}for(qt in Bt){var mr=y.applyContainerArrayChanges(ve,ct(be,qt),Bt[qt],ma,ct);mr||(ma.plot=!0)}for(var $r in Ka){Vt=i.getFromId(ve,$r);var oa=Vt&&Vt._constraintGroup;if(oa){ma.calc=!0;for(var Sa in oa)Ka[Sa]||(i.getFromId(ve,Sa)._constraintShrinkable=!0)}}(Ke(ve)||ge.height||ge.width)&&(ma.plot=!0);var ya=Pe.shapes;for(Zt=0;Zt1;)if(Pe.pop(),be=E(ge,Pe.join(".")+".uirevision").get(),be!==void 0)return be;return ge.uirevision}function rt(ve,ge){for(var be=0;be=We.length?We[0]:We[Bt]:We}function Mt(Bt){return Array.isArray(ct)?Bt>=ct.length?ct[0]:ct[Bt]:ct}function Nt(Bt,qt){var Zt=0;return function(){if(Bt&&++Zt===qt)return Bt()}}return new Promise(function(Bt,qt){function Zt(){if(Pe._frameQueue.length!==0){for(;Pe._frameQueue.length;){var Ur=Pe._frameQueue.pop();Ur.onInterrupt&&Ur.onInterrupt()}ve.emit("plotly_animationinterrupted",[])}}function lr(Ur){if(Ur.length!==0){for(var ga=0;gaPe._timeToNext&&da()};Ur()}var ma=0;function Ia(Ur){return Array.isArray(We)?ma>=We.length?Ur.transitionOpts=We[ma]:Ur.transitionOpts=We[0]:Ur.transitionOpts=We,ma++,Ur}var va,La,Ka=[],Vt=ge==null,Lt=Array.isArray(ge),jt=!Vt&&!Lt&&A.isPlainObject(ge);if(jt)Ka.push({type:"object",data:Ia(A.extendFlat({},ge))});else if(Vt||["string","number"].indexOf(typeof ge)!==-1)for(va=0;va0&&BrBr)&&na.push(La);Ka=na}}Ka.length>0?lr(Ka):(ve.emit("plotly_animated"),Bt())})}function dr(ve,ge,be){if(ve=A.getGraphDiv(ve),ge==null)return Promise.resolve();if(!A.isPlotDiv(ve))throw new Error("This element is not a Plotly plot: "+ve+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var Pe,We,ct,_t,Mt=ve._transitionData._frames,Nt=ve._transitionData._frameHash;if(!Array.isArray(ge))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+ge);var Bt=Mt.length+ge.length*2,qt=[],Zt={};for(Pe=ge.length-1;Pe>=0;Pe--)if(A.isPlainObject(ge[Pe])){var lr=ge[Pe].name,ta=(Nt[lr]||Zt[lr]||{}).name,da=ge[Pe].name,wa=Nt[ta]||Zt[ta];ta&&da&&typeof da=="number"&&wa&&wOt.index?-1:jt.index=0;Pe--){if(We=qt[Pe].frame,typeof We.name=="number"&&A.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!We.name)for(;Nt[We.name="frame "+ve._transitionData._counter++];);if(Nt[We.name]){for(ct=0;ct=0;be--)Pe=ge[be],ct.push({type:"delete",index:Pe}),_t.unshift({type:"insert",index:Pe,value:We[Pe]});var Mt=a.modifyFrames,Nt=a.modifyFrames,Bt=[ve,_t],qt=[ve,ct];return t&&t.add(ve,Mt,Bt,Nt,qt),a.modifyFrames(ve,ct)}function ze(ve){ve=A.getGraphDiv(ve);var ge=ve._fullLayout||{},be=ve._fullData||[];return a.cleanPlot([],{},be,ge),a.purge(ve),e.purge(ve),ge._container&&ge._container.remove(),delete ve._context,ve}function Ge(ve){var ge=ve._fullLayout,be=ve.getBoundingClientRect();if(!A.equalDomRects(be,ge._lastBBox)){var Pe=ge._invTransform=A.inverseTransformMatrix(A.getFullTransformMatrix(ve));ge._invScaleX=Math.sqrt(Pe[0][0]*Pe[0][0]+Pe[0][1]*Pe[0][1]+Pe[0][2]*Pe[0][2]),ge._invScaleY=Math.sqrt(Pe[1][0]*Pe[1][0]+Pe[1][1]*Pe[1][1]+Pe[1][2]*Pe[1][2]),ge._lastBBox=be}}function Oe(ve){var ge=G.select(ve),be=ve._fullLayout;if(be._calcInverseTransform=Ge,be._calcInverseTransform(ve),be._container=ge.selectAll(".plot-container").data([0]),be._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),be._paperdiv=be._container.selectAll(".svg-container").data([0]),be._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),be._glcontainer=be._paperdiv.selectAll(".gl-container").data([{}]),be._glcontainer.enter().append("div").classed("gl-container",!0),be._paperdiv.selectAll(".main-svg").remove(),be._paperdiv.select(".modebar-container").remove(),be._paper=be._paperdiv.insert("svg",":first-child").classed("main-svg",!0),be._toppaper=be._paperdiv.append("svg").classed("main-svg",!0),be._modebardiv=be._paperdiv.append("div"),delete be._modeBar,be._hoverpaper=be._paperdiv.append("svg").classed("main-svg",!0),!be._uid){var Pe={};G.selectAll("defs").each(function(){this.id&&(Pe[this.id.split("-")[1]]=1)}),be._uid=A.randstr(Pe)}be._paperdiv.selectAll(".main-svg").attr(h.svgAttrs),be._defs=be._paper.append("defs").attr("id","defs-"+be._uid),be._clips=be._defs.append("g").classed("clips",!0),be._topdefs=be._toppaper.append("defs").attr("id","topdefs-"+be._uid),be._topclips=be._topdefs.append("g").classed("clips",!0),be._bgLayer=be._paper.append("g").classed("bglayer",!0),be._draggers=be._paper.append("g").classed("draglayer",!0);var We=be._paper.append("g").classed("layer-below",!0);be._imageLowerLayer=We.append("g").classed("imagelayer",!0),be._shapeLowerLayer=We.append("g").classed("shapelayer",!0),be._cartesianlayer=be._paper.append("g").classed("cartesianlayer",!0),be._polarlayer=be._paper.append("g").classed("polarlayer",!0),be._smithlayer=be._paper.append("g").classed("smithlayer",!0),be._ternarylayer=be._paper.append("g").classed("ternarylayer",!0),be._geolayer=be._paper.append("g").classed("geolayer",!0),be._funnelarealayer=be._paper.append("g").classed("funnelarealayer",!0),be._pielayer=be._paper.append("g").classed("pielayer",!0),be._iciclelayer=be._paper.append("g").classed("iciclelayer",!0),be._treemaplayer=be._paper.append("g").classed("treemaplayer",!0),be._sunburstlayer=be._paper.append("g").classed("sunburstlayer",!0),be._indicatorlayer=be._toppaper.append("g").classed("indicatorlayer",!0),be._glimages=be._paper.append("g").classed("glimages",!0);var ct=be._toppaper.append("g").classed("layer-above",!0);be._imageUpperLayer=ct.append("g").classed("imagelayer",!0),be._shapeUpperLayer=ct.append("g").classed("shapelayer",!0),be._selectionLayer=be._toppaper.append("g").classed("selectionlayer",!0),be._infolayer=be._toppaper.append("g").classed("infolayer",!0),be._menulayer=be._toppaper.append("g").classed("menulayer",!0),be._zoomlayer=be._toppaper.append("g").classed("zoomlayer",!0),be._hoverlayer=be._hoverpaper.append("g").classed("hoverlayer",!0),be._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),ve.emit("plotly_framework")}Y.animate=fr,Y.addFrames=dr,Y.deleteFrames=pt,Y.addTraces=J,Y.deleteTraces=$,Y.extendTraces=le,Y.moveTraces=X,Y.prependTraces=j,Y.newPlot=B,Y._doPlot=u,Y.purge=ze,Y.react=Rt,Y.redraw=F,Y.relayout=we,Y.restyle=re,Y.setPlotConfig=m,Y.update=Xe,Y._guiRelayout=Me(we),Y._guiRestyle=Me(re),Y._guiUpdate=Me(Xe),Y._storeDirectGUIEdit=ie}}),id=He({"src/snapshot/helpers.js"(Y){var G=Ei();Y.getDelay=function(A){return A._has&&(A._has("gl3d")||A._has("mapbox")||A._has("map"))?500:0},Y.getRedrawFunc=function(A){return function(){G.getComponentMethod("colorbar","draw")(A)}},Y.encodeSVG=function(A){return"data:image/svg+xml,"+encodeURIComponent(A)},Y.encodeJSON=function(A){return"data:application/json,"+encodeURIComponent(A)};var d=window.URL||window.webkitURL;Y.createObjectURL=function(A){return d.createObjectURL(A)},Y.revokeObjectURL=function(A){return d.revokeObjectURL(A)},Y.createBlob=function(A,E){if(E==="svg")return new window.Blob([A],{type:"image/svg+xml;charset=utf-8"});if(E==="full-json")return new window.Blob([A],{type:"application/json;charset=utf-8"});var e=x(window.atob(A));return new window.Blob([e],{type:"image/"+E})},Y.octetStream=function(A){document.location.href="data:application/octet-stream"+A};function x(A){for(var E=A.length,e=new ArrayBuffer(E),t=new Uint8Array(e),r=0;r")!==-1?"":i.html(s).text()});return i.remove(),n}function o(a){return a.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}G.exports=function(i,n,s){var c=i._fullLayout,f=c._paper,v=c._toppaper,h=c.width,T=c.height,l;f.insert("rect",":first-child").call(x.setRect,0,0,h,T).call(A.fill,c.paper_bgcolor);var y=c._basePlotModules||[];for(l=0;l1&&M.push(s("object","layout"))),x.supplyDefaults(_);for(var u=_._fullData,g=w.length,m=0;mR.length&&S.push(s("unused",M,g.concat(R.length)));var L=R.length,N=Array.isArray(O);N&&(L=Math.min(L,O.length));var U,Z,Q,ue,oe;if(P.dimensions===2)for(Z=0;ZR[Z].length&&S.push(s("unused",M,g.concat(Z,R[Z].length)));var le=R[Z].length;for(U=0;U<(N?Math.min(le,O[Z].length):le);U++)Q=N?O[Z][U]:O,ue=m[Z][U],oe=R[Z][U],d.validate(ue,Q)?oe!==ue&&oe!==+ue&&S.push(s("dynamic",M,g.concat(Z,U),ue,oe)):S.push(s("value",M,g.concat(Z,U),ue))}else S.push(s("array",M,g.concat(Z),m[Z]));else for(Z=0;ZF?S.push({code:"unused",traceType:m,templateCount:z,dataCount:F}):F>z&&S.push({code:"reused",traceType:m,templateCount:z,dataCount:F})}}function B(O,L){for(var N in O)if(N.charAt(0)!=="_"){var U=O[N],Z=s(O,N,L);d(U)?(Array.isArray(O)&&U._template===!1&&U.templateitemname&&S.push({code:"missing",path:Z,templateitemname:U.templateitemname}),B(U,Z)):Array.isArray(U)&&c(U)&&B(U,Z)}}if(B({data:_,layout:M},""),S.length)return S.map(f)};function c(v){for(var h=0;h=0;f--){var v=e[f];if(v.type==="scatter"&&v.xaxis===s.xaxis&&v.yaxis===s.yaxis){v.opacity=void 0;break}}}}}}}),BM=He({"src/traces/scatter/layout_defaults.js"(Y,G){var d=Gr(),x=t1();G.exports=function(A,E){function e(r,o){return d.coerce(A,E,x,r,o)}var t=E.barmode==="group";E.scattermode==="group"&&e("scattergap",t?E.bargap:.2)}}}),Sv=He({"src/plots/cartesian/align_period.js"(Y,G){var d=Hi(),x=Gr(),A=x.dateTime2ms,E=x.incrementMonth,e=lo(),t=e.ONEAVGMONTH;G.exports=function(o,a,i,n){if(a.type!=="date")return{vals:n};var s=o[i+"periodalignment"];if(!s)return{vals:n};var c=o[i+"period"],f;if(d(c)){if(c=+c,c<=0)return{vals:n}}else if(typeof c=="string"&&c.charAt(0)==="M"){var v=+c.substring(1);if(v>0&&Math.round(v)===v)f=v;else return{vals:n}}for(var h=a.calendar,T=s==="start",l=s==="end",y=o[i+"period0"],b=A(y,h)||0,S=[],M=[],_=[],w=n.length,p=0;pu;)R=E(R,-f,h);for(;R<=u;)R=E(R,f,h);m=E(R,-f,h)}else{for(g=Math.round((u-b)/c),R=b+g*c;R>u;)R-=c;for(;R<=u;)R+=c;m=R-c}S[p]=T?m:l?R:(m+R)/2,M[p]=m,_[p]=R}return{vals:S,starts:M,ends:_}}}}),ov=He({"src/traces/scatter/colorscale_calc.js"(Y,G){var d=Ah().hasColorscale,x=Sh(),A=Rl();G.exports=function(e,t){A.hasLines(t)&&d(t,"line")&&x(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),A.hasMarkers(t)&&(d(t,"marker")&&x(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),d(t,"marker.line")&&x(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),Vv=He({"src/traces/scatter/arrays_to_calcdata.js"(Y,G){var d=Gr();G.exports=function(A,E){for(var e=0;eB&&m[L].gap;)L--;for(U=m[L].s,O=m.length-1;O>L;O--)m[O].s=U;for(;BN+O||!d(L))}for(var Z=0;Zz[h]&&h0?e:t)/(h._m*y*(h._m>0?e:t)))),Nt*=1e3}if(Bt===A){if(l&&(Bt=h.c2p(Mt.y,!0)),Bt===A)return!1;Bt*=1e3}return[Nt,Bt]}function ae(_t,Mt,Nt,Bt){var qt=Nt-_t,Zt=Bt-Mt,lr=.5-_t,ta=.5-Mt,da=qt*qt+Zt*Zt,wa=qt*lr+Zt*ta;if(wa>0&&wa1||Math.abs(lr.y-Nt[0][1])>1)&&(lr=[lr.x,lr.y],Bt&&Ae(lr,_t)qe||_t[1]Qe)return[a(_t[0],Ce,qe),a(_t[1],et,Qe)]}function At(_t,Mt){if(_t[0]===Mt[0]&&(_t[0]===Ce||_t[0]===qe)||_t[1]===Mt[1]&&(_t[1]===et||_t[1]===Qe))return!0}function St(_t,Mt){var Nt=[],Bt=Je(_t),qt=Je(Mt);return Bt&&qt&&At(Bt,qt)||(Bt&&Nt.push(Bt),qt&&Nt.push(qt)),Nt}function Rt(_t,Mt,Nt){return function(Bt,qt){var Zt=Je(Bt),lr=Je(qt),ta=[];if(Zt&&lr&&At(Zt,lr))return ta;Zt&&ta.push(Zt),lr&&ta.push(lr);var da=2*r.constrain((Bt[_t]+qt[_t])/2,Mt,Nt)-((Zt||Bt)[_t]+(lr||qt)[_t]);if(da){var wa;Zt&&lr?wa=da>0==Zt[_t]>lr[_t]?Zt:lr:wa=Zt||lr,wa[_t]+=da}return ta}}var Ut;p==="linear"||p==="spline"?Ut=rt:p==="hv"||p==="vh"?Ut=St:p==="hvh"?Ut=Rt(0,Ce,qe):p==="vhv"&&(Ut=Rt(1,et,Qe));function ir(_t,Mt){var Nt=Mt[0]-_t[0],Bt=(Mt[1]-_t[1])/Nt,qt=(_t[1]*Mt[0]-Mt[1]*_t[0])/Nt;return qt>0?[Bt>0?Ce:qe,Qe]:[Bt>0?qe:Ce,et]}function ar(_t){var Mt=_t[0],Nt=_t[1],Bt=Mt===z[F-1][0],qt=Nt===z[F-1][1];if(!(Bt&&qt))if(F>1){var Zt=Mt===z[F-2][0],lr=Nt===z[F-2][1];Bt&&(Mt===Ce||Mt===qe)&&Zt?lr?F--:z[F-1]=_t:qt&&(Nt===et||Nt===Qe)&&lr?Zt?F--:z[F-1]=_t:z[F++]=_t}else z[F++]=_t}function Mr(_t){z[F-1][0]!==_t[0]&&z[F-1][1]!==_t[1]&&ar([xe,ce]),ar(_t),Re=null,xe=ce=0}var fr=r.isArrayOrTypedArray(M);function dr(_t){if(_t&&S&&(_t.i=B,_t.d=s,_t.trace=f,_t.marker=fr?M[_t.i]:M,_t.backoff=S),ie=_t[0]/y,fe=_t[1]/b,Xe=_t[0]qe?qe:0,Me=_t[1]Qe?Qe:0,Xe||Me){if(!F)z[F++]=[Xe||_t[0],Me||_t[1]];else if(Re){var Mt=Ut(Re,_t);Mt.length>1&&(Mr(Mt[0]),z[F++]=Mt[1])}else $e=Ut(z[F-1],_t)[0],z[F++]=$e;var Nt=z[F-1];Xe&&Me&&(Nt[0]!==Xe||Nt[1]!==Me)?(Re&&(xe!==Xe&&ce!==Me?ar(xe&&ce?ir(Re,_t):[xe||Xe,ce||Me]):xe&&ce&&ar([xe,ce])),ar([Xe,Me])):xe-Xe&&ce-Me&&ar([Xe||xe,Me||ce]),Re=_t,xe=Xe,ce=Me}else Re&&Mr(Ut(Re,_t)[0]),z[F++]=_t}for(B=0;Bwe(Z,pt))break;L=Z,$=oe[0]*ue[0]+oe[1]*ue[1],$>j?(j=$,N=Z,Q=!1):$=s.length||!Z)break;dr(Z),O=Z}}Re&&ar([xe||Re[0],ce||Re[1]]),m.push(z.slice(0,F))}var ze=p.slice(p.length-1);if(S&&ze!=="h"&&ze!=="v"){for(var Ge=!1,Oe=-1,ve=[],ge=0;ge=0?i=v:(i=v=f,f++),i0,p=a(v,h,T);if(S=l.selectAll("g.trace").data(p,function(g){return g[0].trace.uid}),S.enter().append("g").attr("class",function(g){return"trace scatter trace"+g[0].trace.uid}).style("stroke-miterlimit",2),S.order(),n(v,S,h),w){b&&(M=b());var u=d.transition().duration(y.duration).ease(y.easing).each("end",function(){M&&M()}).each("interrupt",function(){M&&M()});u.each(function(){l.selectAll("g.trace").each(function(g,m){s(v,m,h,g,p,this,y)})})}else S.each(function(g,m){s(v,m,h,g,p,this,y)});_&&S.exit().remove(),l.selectAll("path:not([d])").remove()};function n(f,v,h){v.each(function(T){var l=E(d.select(this),"g","fills");t.setClipUrl(l,h.layerClipId,f);var y=T[0].trace,b=[];y._ownfill&&b.push("_ownFill"),y._nexttrace&&b.push("_nextFill");var S=l.selectAll("g").data(b,e);S.enter().append("g"),S.exit().each(function(M){y[M]=null}).remove(),S.order().each(function(M){y[M]=E(d.select(this),"path","js-fill")})})}function s(f,v,h,T,l,y,b){var S=f._context.staticPlot,M;c(f,v,h,T,l);var _=!!b&&b.duration>0;function w(ar){return _?ar.transition():ar}var p=h.xaxis,u=h.yaxis,g=T[0].trace,m=g.line,R=d.select(y),P=E(R,"g","errorbars"),z=E(R,"g","lines"),F=E(R,"g","points"),B=E(R,"g","text");if(x.getComponentMethod("errorbars","plot")(f,P,h,b),g.visible!==!0)return;w(R).style("opacity",g.opacity);var O,L,N=g.fill.charAt(g.fill.length-1);N!=="x"&&N!=="y"&&(N="");var U,Z;N==="y"?(U=1,Z=u.c2p(0,!0)):N==="x"&&(U=0,Z=p.c2p(0,!0)),T[0][h.isRangePlot?"nodeRangePlot3":"node3"]=R;var Q="",ue=[],oe=g._prevtrace,le=null,j=null;oe&&(Q=oe._prevRevpath||"",L=oe._nextFill,ue=oe._ownPolygons,le=oe._fillsegments,j=oe._fillElement);var J,$,X="",re="",ee,q,ae,ie,fe,we,Ae=[];g._polygons=[];var Fe=[],Ce=[],qe=A.noop;if(O=g._ownFill,r.hasLines(g)||g.fill!=="none"){L&&L.datum(T),["hv","vh","hvh","vhv"].indexOf(m.shape)!==-1?(ee=t.steps(m.shape),q=t.steps(m.shape.split("").reverse().join(""))):m.shape==="spline"?ee=q=function(ar){var Mr=ar[ar.length-1];return ar.length>1&&ar[0][0]===Mr[0]&&ar[0][1]===Mr[1]?t.smoothclosed(ar.slice(1),m.smoothing):t.smoothopen(ar,m.smoothing)}:ee=q=function(ar){return"M"+ar.join("L")},ae=function(ar){return q(ar.reverse())},Ce=o(T,{xaxis:p,yaxis:u,trace:g,connectGaps:g.connectgaps,baseTolerance:Math.max(m.width||1,3)/4,shape:m.shape,backoff:m.backoff,simplify:m.simplify,fill:g.fill}),Fe=new Array(Ce.length);var et=0;for(M=0;M=S[0]&&R.x<=S[1]&&R.y>=M[0]&&R.y<=M[1]}),u=Math.ceil(p.length/w),g=0;l.forEach(function(R,P){var z=R[0].trace;r.hasMarkers(z)&&z.marker.maxdisplayed>0&&P=Math.min(oe,le)&&h<=Math.max(oe,le)?0:1/0}var j=Math.max(3,ue.mrc||0),J=1-1/j,$=Math.abs(f.c2p(ue.x)-h);return $=Math.min(oe,le)&&T<=Math.max(oe,le)?0:1/0}var j=Math.max(3,ue.mrc||0),J=1-1/j,$=Math.abs(v.c2p(ue.y)-T);return $re!=Fe>=re&&(fe=ae[q-1][0],we=ae[q][0],Fe-Ae&&(ie=fe+(we-fe)*(re-Ae)/(Fe-Ae),j=Math.min(j,ie),J=Math.max(J,ie)));return j=Math.max(j,0),J=Math.min(J,f._length),{x0:j,x1:J,y0:re,y1:re}}if(y.indexOf("fills")!==-1&&c._fillElement){var U=L(c._fillElement)&&!L(c._fillExclusionElement);if(U){var Z=N(c._polygons);Z===null&&(Z={x0:l[0],x1:l[0],y0:l[1],y1:l[1]});var Q=e.defaultLine;return e.opacity(c.fillcolor)?Q=c.fillcolor:e.opacity((c.line||{}).color)&&(Q=c.line.color),d.extendFlat(o,{distance:o.maxHoverDistance,x0:Z.x0,x1:Z.x1,y0:Z.y0,y1:Z.y1,color:Q,hovertemplate:!1}),delete o.index,c.text&&!d.isArrayOrTypedArray(c.text)?o.text=String(c.text):o.text=c.name,[o]}}}}}),W0=He({"src/traces/scatter/select.js"(Y,G){var d=Rl();G.exports=function(A,E){var e=A.cd,t=A.xaxis,r=A.yaxis,o=[],a=e[0].trace,i,n,s,c,f=!d.hasMarkers(a)&&!d.hasText(a);if(f)return[];if(E===!1)for(i=0;i0&&(n["_"+a+"axes"]||{})[o])return n;if((n[a+"axis"]||a)===o){if(t(n,a))return n;if((n[a]||[]).length||n[a+"0"])return n}}}function e(r){return{v:"x",h:"y"}[r.orientation||"v"]}function t(r,o){var a=e(r),i=d(r,"box-violin"),n=d(r._fullInput||{},"candlestick");return i&&!n&&o===a&&r[a]===void 0&&r[a+"0"]===void 0}}}),p1=He({"src/plots/cartesian/category_order_defaults.js"(Y,G){var d=ch().isTypedArraySpec;function x(A,E){var e=E.dataAttr||A._id.charAt(0),t={},r,o,a;if(E.axData)r=E.axData;else for(r=[],o=0;o0||d(o),i;a&&(i="array");var n=t("categoryorder",i),s;n==="array"&&(s=t("categoryarray")),!a&&n==="array"&&(n=e.categoryorder="trace"),n==="trace"?e._initialCategories=[]:n==="array"?e._initialCategories=s.slice():(s=x(e,r).sort(),n==="category ascending"?e._initialCategories=s:n==="category descending"&&(e._initialCategories=s.reverse()))}}}}),ay=He({"src/plots/cartesian/line_grid_defaults.js"(Y,G){var d=Mf().mix,x=Xc(),A=Gr();G.exports=function(e,t,r,o){o=o||{};var a=o.dfltColor;function i(g,m){return A.coerce2(e,t,o.attributes,g,m)}var n=i("linecolor",a),s=i("linewidth"),c=r("showline",o.showLine||!!n||!!s);c||(delete t.linecolor,delete t.linewidth);var f=d(a,o.bgColor,o.blend||x.lightFraction).toRgbString(),v=i("gridcolor",f),h=i("gridwidth"),T=i("griddash"),l=r("showgrid",o.showGrid||!!v||!!h||!!T);if(l||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),o.hasMinor){var y=d(t.gridcolor,o.bgColor,67).toRgbString(),b=i("minor.gridcolor",y),S=i("minor.gridwidth",t.gridwidth||1),M=i("minor.griddash",t.griddash||"solid"),_=r("minor.showgrid",!!b||!!S||!!M);_||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!o.noZeroLine){var w=i("zerolinecolor",a),p=i("zerolinewidth"),u=r("zeroline",o.showGrid||!!w||!!p);u||(delete t.zerolinecolor,delete t.zerolinewidth)}}}}),ny=He({"src/plots/cartesian/axis_defaults.js"(Y,G){var d=Hi(),x=Ei(),A=Gr(),E=Gs(),e=rh(),t=jf(),r=Ep(),o=O0(),a=Vd(),i=qd(),n=p1(),s=ay(),c=Mb(),f=Uv(),v=Ef().WEEKDAY_PATTERN,h=Ef().HOUR_PATTERN;G.exports=function(S,M,_,w,p){var u=w.letter,g=w.font||{},m=w.splomStash||{},R=_("visible",!w.visibleDflt),P=M._template||{},z=M.type||P.type||"-",F;if(z==="date"){var B=x.getComponentMethod("calendars","handleDefaults");B(S,M,"calendar",w.calendar),w.noTicklabelmode||(F=_("ticklabelmode"))}!w.noTicklabelindex&&(z==="date"||z==="linear")&&_("ticklabelindex");var O="";(!w.noTicklabelposition||z==="multicategory")&&(O=A.coerce(S,M,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:F==="period"?["outside","inside"]:u==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),w.noTicklabeloverflow||_("ticklabeloverflow",O.indexOf("inside")!==-1?"hide past domain":z==="category"||z==="multicategory"?"allow":"hide past div"),f(M,p),c(S,M,_,w),n(S,M,_,w),z!=="category"&&!w.noHover&&_("hoverformat");var L=_("color"),N=L!==t.color.dflt?L:g.color,U=m.label||p._dfltTitle[u];if(i(S,M,_,z,w),!R)return M;_("title.text",U),A.coerceFont(_,"title.font",g,{overrideDflt:{size:A.bigFont(g.size),color:N}}),r(S,M,_,z);var Z=w.hasMinor;if(Z&&(E.newContainer(M,"minor"),r(S,M,_,z,{isMinor:!0})),a(S,M,_,z,w),o(S,M,_,w),Z){var Q=w.isMinor;w.isMinor=!0,o(S,M,_,w),w.isMinor=Q}s(S,M,_,{dfltColor:L,bgColor:w.bgColor,showGrid:w.showGrid,hasMinor:Z,attributes:t}),Z&&!M.minor.ticks&&!M.minor.showgrid&&delete M.minor,(M.showline||M.ticks)&&_("mirror");var ue=z==="multicategory";if(!w.noTickson&&(z==="category"||ue)&&(M.ticks||M.showgrid)){var oe;ue&&(oe="boundaries");var le=_("tickson",oe);le==="boundaries"&&delete M.ticklabelposition}if(ue){var j=_("showdividers");j&&(_("dividercolor"),_("dividerwidth"))}if(z==="date")if(e(S,M,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:T}),!M.rangebreaks.length)delete M.rangebreaks;else{for(var J=0;J=2){var u="",g,m;if(p.length===2){for(g=0;g<2;g++)if(m=y(p[g]),m){u=v;break}}var R=_("pattern",u);if(R===v)for(g=0;g<2;g++)m=y(p[g]),m&&(S.bounds[g]=p[g]=m-1);if(R)for(g=0;g<2;g++)switch(m=p[g],R){case v:if(!d(m)){S.enabled=!1;return}if(m=+m,m!==Math.floor(m)||m<0||m>=7){S.enabled=!1;return}S.bounds[g]=p[g]=m;break;case h:if(!d(m)){S.enabled=!1;return}if(m=+m,m<0||m>24){S.enabled=!1;return}S.bounds[g]=p[g]=m;break}if(M.autorange===!1){var P=M.range;if(P[0]P[1]){S.enabled=!1;return}}else if(p[0]>P[0]&&p[1]_[1]-1/4096&&(e.domain=f),x.noneOrAll(E.domain,e.domain,f),e.tickmode==="sync"&&(e.tickmode="auto")}return t("layer"),e}}}),VM=He({"src/plots/cartesian/layout_defaults.js"(Y,G){var d=Gr(),x=Ai(),A=Ph().isUnifiedHover,E=Rb(),e=Gs(),t=D0(),r=jf(),o=Jb(),a=ny(),i=Cp(),n=g1(),s=oc(),c=s.id2name,f=s.name2id,v=Ef().AX_ID_PATTERN,h=Ei(),T=h.traceIs,l=h.getComponentMethod;function y(b,S,M){Array.isArray(b[S])?b[S].push(M):b[S]=[M]}G.exports=function(S,M,_){var w=M.autotypenumbers,p={},u={},g={},m={},R={},P={},z={},F={},B={},O={},L,N;for(L=0;L<_.length;L++){var U=_[L];if(T(U,"cartesian")){var Z;if(U.xaxis)Z=c(U.xaxis),y(p,Z,U);else if(U.xaxes)for(N=0;N rect").call(E.setTranslate,0,0).call(E.setScale,1,1),M.plot.call(E.setTranslate,_._offset,w._offset).call(E.setScale,1,1);var p=M.plot.selectAll(".scatterlayer .trace");p.selectAll(".point").call(E.setPointGroupScale,1,1),p.selectAll(".textpoint").call(E.setTextPointsScale,1,1),p.call(E.hideOutsideRangePoints,M)}function c(M,_){var w=M.plotinfo,p=w.xaxis,u=w.yaxis,g=p._length,m=u._length,R=!!M.xr1,P=!!M.yr1,z=[];if(R){var F=A.simpleMap(M.xr0,p.r2l),B=A.simpleMap(M.xr1,p.r2l),O=F[1]-F[0],L=B[1]-B[0];z[0]=(F[0]*(1-_)+_*B[0]-F[0])/(F[1]-F[0])*g,z[2]=g*(1-_+_*L/O),p.range[0]=p.l2r(F[0]*(1-_)+_*B[0]),p.range[1]=p.l2r(F[1]*(1-_)+_*B[1])}else z[0]=0,z[2]=g;if(P){var N=A.simpleMap(M.yr0,u.r2l),U=A.simpleMap(M.yr1,u.r2l),Z=N[1]-N[0],Q=U[1]-U[0];z[1]=(N[1]*(1-_)+_*U[1]-N[1])/(N[0]-N[1])*m,z[3]=m*(1-_+_*Q/Z),u.range[0]=p.l2r(N[0]*(1-_)+_*U[0]),u.range[1]=u.l2r(N[1]*(1-_)+_*U[1])}else z[1]=0,z[3]=m;e.drawOne(r,p,{skipTitle:!0}),e.drawOne(r,u,{skipTitle:!0}),e.redrawComponents(r,[p._id,u._id]);var ue=R?g/z[2]:1,oe=P?m/z[3]:1,le=R?z[0]:0,j=P?z[1]:0,J=R?z[0]/z[2]*g:0,$=P?z[1]/z[3]*m:0,X=p._offset-J,re=u._offset-$;w.clipRect.call(E.setTranslate,le,j).call(E.setScale,1/ue,1/oe),w.plot.call(E.setTranslate,X,re).call(E.setScale,ue,oe),E.setPointGroupScale(w.zoomScalePts,1/ue,1/oe),E.setTextPointsScale(w.zoomScaleTxt,1/ue,1/oe)}var f;i&&(f=i());function v(){for(var M={},_=0;_a.duration?(v(),y=window.cancelAnimationFrame(S)):y=window.requestAnimationFrame(S)}return T=Date.now(),y=window.requestAnimationFrame(S),Promise.resolve()}}}),Bc=He({"src/plots/cartesian/index.js"(Y){var G=Qn(),d=Ei(),x=Gr(),A=yu(),E=vo(),e=Uf().getModuleCalcData,t=oc(),r=Ef(),o=Yh(),a=x.ensureSingle;function i(T,l,y){return x.ensureSingle(T,l,y,function(b){b.datum(y)})}var n=r.zindexSeparator;Y.name="cartesian",Y.attr=["xaxis","yaxis"],Y.idRoot=["x","y"],Y.idRegex=r.idRegex,Y.attrRegex=r.attrRegex,Y.attributes=jM(),Y.layoutAttributes=jf(),Y.supplyLayoutDefaults=VM(),Y.transitionAxes=qM(),Y.finalizeSubplots=function(T,l){var y=l._subplots,b=y.xaxis,S=y.yaxis,M=y.cartesian,_=M,w={},p={},u,g,m;for(u=0;u<_.length;u++){var R=_[u].split("y");w[R[0]]=1,p["y"+R[1]]=1}for(u=0;u0){var P=R.id;if(P.indexOf(n)!==-1)continue;P+=n+(u+1),R=x.extendFlat({},R,{id:P,plot:S._cartesianlayer.selectAll(".subplot").select("."+P)})}for(var z=[],F,B=0;B<_.length;B++){var O=_[B],L=O[0].trace;g===(L.zorder||0)&&L.xaxis+L.yaxis===m&&((l.indexOf(L.index)!==-1||L.carpet)&&(F&&F[0].trace.xaxis+F[0].trace.yaxis===m&&["tonextx","tonexty","tonext"].indexOf(L.fill)!==-1&&z.indexOf(F)===-1&&z.push(F),z.push(O)),F=O)}s(T,R,z,y,b)}}};function s(T,l,y,b,S){for(var M=r.traceLayerClasses,_=T._fullLayout,w=_._zindices,p=_._modules,u,g,m,R=[],P=[],z=0;z1&&(Z+=n+U),N.push(w+Z),_=0;_1,m=l.mainplotinfo;if(!l.mainplot||g)if(u)l.xlines=a(b,"path","xlines-above"),l.ylines=a(b,"path","ylines-above"),l.xaxislayer=a(b,"g","xaxislayer-above"),l.yaxislayer=a(b,"g","yaxislayer-above");else{if(!_){var R=a(b,"g","layer-subplot");l.shapelayer=a(R,"g","shapelayer"),l.imagelayer=a(R,"g","imagelayer"),m&&g?(l.minorGridlayer=m.minorGridlayer,l.gridlayer=m.gridlayer,l.zerolinelayer=m.zerolinelayer):(l.minorGridlayer=a(b,"g","minor-gridlayer"),l.gridlayer=a(b,"g","gridlayer"),l.zerolinelayer=a(b,"g","zerolinelayer"));var P=a(b,"g","layer-between");l.shapelayerBetween=a(P,"g","shapelayer"),l.imagelayerBetween=a(P,"g","imagelayer"),a(b,"path","xlines-below"),a(b,"path","ylines-below"),l.overlinesBelow=a(b,"g","overlines-below"),a(b,"g","xaxislayer-below"),a(b,"g","yaxislayer-below"),l.overaxesBelow=a(b,"g","overaxes-below")}l.overplot=a(b,"g","overplot"),l.plot=a(l.overplot,"g",S),_||(l.xlines=a(b,"path","xlines-above"),l.ylines=a(b,"path","ylines-above"),l.overlinesAbove=a(b,"g","overlines-above"),a(b,"g","xaxislayer-above"),a(b,"g","yaxislayer-above"),l.overaxesAbove=a(b,"g","overaxes-above"),l.xlines=b.select(".xlines-"+w),l.ylines=b.select(".ylines-"+p),l.xaxislayer=b.select(".xaxislayer-"+w),l.yaxislayer=b.select(".yaxislayer-"+p))}else{var z=m.plotgroup,F=S+"-x",B=S+"-y";l.minorGridlayer=m.minorGridlayer,l.gridlayer=m.gridlayer,l.zerolinelayer=m.zerolinelayer,a(m.overlinesBelow,"path",F),a(m.overlinesBelow,"path",B),a(m.overaxesBelow,"g",F),a(m.overaxesBelow,"g",B),l.plot=a(m.overplot,"g",S),a(m.overlinesAbove,"path",F),a(m.overlinesAbove,"path",B),a(m.overaxesAbove,"g",F),a(m.overaxesAbove,"g",B),l.xlines=z.select(".overlines-"+w).select("."+F),l.ylines=z.select(".overlines-"+p).select("."+B),l.xaxislayer=z.select(".overaxes-"+w).select("."+F),l.yaxislayer=z.select(".overaxes-"+p).select("."+B)}_||(u||(i(l.minorGridlayer,"g",l.xaxis._id),i(l.minorGridlayer,"g",l.yaxis._id),l.minorGridlayer.selectAll("g").map(function(O){return O[0]}).sort(t.idSort),i(l.gridlayer,"g",l.xaxis._id),i(l.gridlayer,"g",l.yaxis._id),l.gridlayer.selectAll("g").map(function(O){return O[0]}).sort(t.idSort)),l.xlines.style("fill","none").classed("crisp",!0),l.ylines.style("fill","none").classed("crisp",!0))}function v(T,l){if(T){var y={};T.each(function(p){var u=p[0],g=G.select(this);g.remove(),h(u,l),y[u]=!0});for(var b in l._plots)for(var S=l._plots[b],M=S.overlays||[],_=0;_=0,l=i.indexOf("end")>=0,y=c.backoff*v+n.standoff,b=f.backoff*h+n.startstandoff,S,M,_,w;if(s.nodeName==="line"){S={x:+a.attr("x1"),y:+a.attr("y1")},M={x:+a.attr("x2"),y:+a.attr("y2")};var p=S.x-M.x,u=S.y-M.y;if(_=Math.atan2(u,p),w=_+Math.PI,y&&b&&y+b>Math.sqrt(p*p+u*u)){Z();return}if(y){if(y*y>p*p+u*u){Z();return}var g=y*Math.cos(_),m=y*Math.sin(_);M.x+=g,M.y+=m,a.attr({x2:M.x,y2:M.y})}if(b){if(b*b>p*p+u*u){Z();return}var R=b*Math.cos(_),P=b*Math.sin(_);S.x-=R,S.y-=P,a.attr({x1:S.x,y1:S.y})}}else if(s.nodeName==="path"){var z=s.getTotalLength(),F="";if(z2/3?va="right":va="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[va]}for(var $e=!1,rt=["x","y"],Je=0;Je1)&&(Rt===St?(We=Ut.r2fraction(b["a"+At]),(We<0||We>1)&&($e=!0)):$e=!0),Ge=Ut._offset+Ut.r2p(b[At]),ge=.5}else{var ct=Pe==="domain";At==="x"?(ve=b[At],Ge=ct?Ut._offset+Ut._length*ve:Ge=u.l+u.w*ve):(ve=1-b[At],Ge=ct?Ut._offset+Ut._length*ve:Ge=u.t+u.h*ve),ge=b.showarrow?.5:ve}if(b.showarrow){ze.head=Ge;var _t=b["a"+At];if(be=ar*Re(.5,b.xanchor)-Mr*Re(.5,b.yanchor),Rt===St){var Mt=t.getRefType(Rt);Mt==="domain"?(At==="y"&&(_t=1-_t),ze.tail=Ut._offset+Ut._length*_t):Mt==="paper"?At==="y"?(_t=1-_t,ze.tail=u.t+u.h*_t):ze.tail=u.l+u.w*_t:ze.tail=Ut._offset+Ut.r2p(_t),Oe=be}else ze.tail=Ge+_t,Oe=be+_t;ze.text=ze.tail+be;var Nt=p[At==="x"?"width":"height"];if(St==="paper"&&(ze.head=E.constrain(ze.head,1,Nt-1)),Rt==="pixel"){var Bt=-Math.max(ze.tail-3,ze.text),qt=Math.min(ze.tail+3,ze.text)-Nt;Bt>0?(ze.tail+=Bt,ze.text+=Bt):qt>0&&(ze.tail-=qt,ze.text-=qt)}ze.tail+=pt,ze.head+=pt}else be=fr*Re(ge,dr),Oe=be,ze.text=Ge+be;ze.text+=pt,be+=pt,Oe+=pt,b["_"+At+"padplus"]=fr/2+Oe,b["_"+At+"padminus"]=fr/2-Oe,b["_"+At+"size"]=fr,b["_"+At+"shift"]=be}if($e){le.remove();return}var Zt=0,lr=0;if(b.align!=="left"&&(Zt=(Xe-Qe)*(b.align==="center"?.5:1)),b.valign!=="top"&&(lr=(Me-Ke)*(b.valign==="middle"?.5:1)),qe)Ce.select("svg").attr({x:$+Zt-1,y:$+lr}).call(o.setClipUrl,re?O:null,y);else{var ta=$+lr-et.top,da=$+Zt-et.left;ie.call(i.positionText,da,ta).call(o.setClipUrl,re?O:null,y)}ee.select("rect").call(o.setRect,$,$,Xe,Me),X.call(o.setRect,j/2,j/2,xe-j,ce-j),le.call(o.setTranslate,Math.round(L.x.text-xe/2),Math.round(L.y.text-ce/2)),Z.attr({transform:"rotate("+N+","+L.x.text+","+L.y.text+")"});var wa=function(Ia,va){U.selectAll(".annotation-arrow-g").remove();var La=L.x.head,Ka=L.y.head,Vt=L.x.tail+Ia,Lt=L.y.tail+va,jt=L.x.text+Ia,Ot=L.y.text+va,gr=E.rotationXYMatrix(N,jt,Ot),Br=E.apply2DTransform(gr),na=E.apply2DTransform2(gr),Ur=+X.attr("width"),ga=+X.attr("height"),Aa=jt-.5*Ur,Pa=Aa+Ur,sa=Ot-.5*ga,Oa=sa+ga,dt=[[Aa,sa,Aa,Oa],[Aa,Oa,Pa,Oa],[Pa,Oa,Pa,sa],[Pa,sa,Aa,sa]].map(na);if(!dt.reduce(function(wt,Qt){return wt^!!E.segmentsIntersect(La,Ka,La+1e6,Ka+1e6,Qt[0],Qt[1],Qt[2],Qt[3])},!1)){dt.forEach(function(wt){var Qt=E.segmentsIntersect(Vt,Lt,La,Ka,wt[0],wt[1],wt[2],wt[3]);Qt&&(Vt=Qt.x,Lt=Qt.y)});var vt=b.arrowwidth,Lr=b.arrowcolor,Er=b.arrowside,_r=U.append("g").style({opacity:r.opacity(Lr)}).classed("annotation-arrow-g",!0),yr=_r.append("path").attr("d","M"+Vt+","+Lt+"L"+La+","+Ka).style("stroke-width",vt+"px").call(r.stroke,r.rgb(Lr));if(f(yr,Er,b),g.annotationPosition&&yr.node().parentNode&&!M){var kr=La,zr=Ka;if(b.standoff){var Pr=Math.sqrt(Math.pow(La-Vt,2)+Math.pow(Ka-Lt,2));kr+=b.standoff*(Vt-La)/Pr,zr+=b.standoff*(Lt-Ka)/Pr}var Hr=_r.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(Vt-kr)+","+(Lt-zr),transform:e(kr,zr)}).style("stroke-width",vt+6+"px").call(r.stroke,"rgba(0,0,0,0)").call(r.fill,"rgba(0,0,0,0)"),Zr,Jr;s.init({element:Hr.node(),gd:y,prepFn:function(){var wt=o.getTranslate(le);Zr=wt.x,Jr=wt.y,_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0)},moveFn:function(wt,Qt){var mr=Br(Zr,Jr),$r=mr[0]+wt,oa=mr[1]+Qt;le.call(o.setTranslate,$r,oa),F("x",T(_,wt,"x",u,b)),F("y",T(w,Qt,"y",u,b)),b.axref===b.xref&&F("ax",T(_,wt,"ax",u,b)),b.ayref===b.yref&&F("ay",T(w,Qt,"ay",u,b)),_r.attr("transform",e(wt,Qt)),Z.attr({transform:"rotate("+N+","+$r+","+oa+")"})},doneFn:function(){x.call("_guiRelayout",y,B());var wt=document.querySelector(".js-notes-box-panel");wt&&wt.redraw(wt.selectedObj)}})}}};if(b.showarrow&&wa(0,0),Q){var ma;s.init({element:le.node(),gd:y,prepFn:function(){ma=Z.attr("transform")},moveFn:function(Ia,va){var La="pointer";if(b.showarrow)b.axref===b.xref?F("ax",T(_,Ia,"ax",u,b)):F("ax",b.ax+Ia),b.ayref===b.yref?F("ay",T(w,va,"ay",u.w,b)):F("ay",b.ay+va),wa(Ia,va);else{if(M)return;var Ka,Vt;if(_)Ka=T(_,Ia,"x",u,b);else{var Lt=b._xsize/u.w,jt=b.x+(b._xshift-b.xshift)/u.w-Lt/2;Ka=s.align(jt+Ia/u.w,Lt,0,1,b.xanchor)}if(w)Vt=T(w,va,"y",u,b);else{var Ot=b._ysize/u.h,gr=b.y-(b._yshift+b.yshift)/u.h-Ot/2;Vt=s.align(gr-va/u.h,Ot,0,1,b.yanchor)}F("x",Ka),F("y",Vt),(!_||!w)&&(La=s.getCursor(_?.5:Ka,w?.5:Vt,b.xanchor,b.yanchor))}Z.attr({transform:e(Ia,va)+ma}),n(le,La)},clickFn:function(Ia,va){b.captureevents&&y.emit("plotly_clickannotation",oe(va))},doneFn:function(){n(le),x.call("_guiRelayout",y,B());var Ia=document.querySelector(".js-notes-box-panel");Ia&&Ia.redraw(Ia.selectedObj)}})}}g.annotationText?ie.call(i.makeEditable,{delegate:le,gd:y}).call(fe).on("edit",function(Ae){b.text=Ae,this.call(fe),F("text",Ae),_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0),x.call("_guiRelayout",y,B())}):ie.call(fe)}}}),WM=He({"src/components/annotations/click.js"(Y,G){var d=Gr(),x=Ei(),A=Gs().arrayEditor;G.exports={hasClickToShow:E,onClick:e};function E(o,a){var i=t(o,a);return i.on.length>0||i.explicitOff.length>0}function e(o,a){var i=t(o,a),n=i.on,s=i.off.concat(i.explicitOff),c={},f=o._fullLayout.annotations,v,h;if(n.length||s.length){for(v=0;v1){n=!0;break}}n?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+a+'"]').remove():(i._pdata=x(e.glplot.cameraParams,[t.xaxis.r2l(i.x)*r[0],t.yaxis.r2l(i.y)*r[1],t.zaxis.r2l(i.z)*r[2]]),d(e.graphDiv,i,a,e.id,i._xa,i._ya))}}}}),e5=He({"src/components/annotations3d/index.js"(Y,G){var d=Ei(),x=Gr();G.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:m1()}}},layoutAttributes:m1(),handleDefaults:JM(),includeBasePlot:A,convert:$M(),draw:QM()};function A(E,e){var t=d.subplotsRegistry.gl3d;if(t)for(var r=t.attrRegex,o=Object.keys(E),a=0;a0?l+v:v;return{ppad:v,ppadplus:h?b:S,ppadminus:h?S:b}}else return{ppad:v}}function o(a,i,n){var s=a._id.charAt(0)==="x"?"x":"y",c=a.type==="category"||a.type==="multicategory",f,v,h=0,T=0,l=c?a.r2c:a.d2c,y=i[s+"sizemode"]==="scaled";if(y?(f=i[s+"0"],v=i[s+"1"],c&&(h=i[s+"0shift"],T=i[s+"1shift"])):(f=i[s+"anchor"],v=i[s+"anchor"]),f!==void 0)return[l(f)+h,l(v)+T];if(i.path){var b=1/0,S=-1/0,M=i.path.match(A.segmentRE),_,w,p,u,g;for(a.type==="date"&&(l=E.decodeDate(l)),_=0;_S&&(S=g)));if(S>=b)return[b,S]}}}}),n5=He({"src/components/shapes/index.js"(Y,G){var d=c1();G.exports={moduleType:"component",name:"shapes",layoutAttributes:ew(),supplyLayoutDefaults:t5(),supplyDrawNewShapeDefaults:r5(),includeBasePlot:ry()("shapes"),calcAutorange:a5(),draw:d.draw,drawOne:d.drawOne}}}),tw=He({"src/components/images/attributes.js"(Y,G){var d=Ef(),x=Gs().templatedArray;ty(),G.exports=x("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",d.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",d.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),i5=He({"src/components/images/defaults.js"(Y,G){var d=Gr(),x=io(),A=rh(),E=tw(),e="images";G.exports=function(o,a){var i={name:e,handleItemDefaults:t};A(o,a,i)};function t(r,o,a){function i(y,b){return d.coerce(r,o,E,y,b)}var n=i("source"),s=i("visible",!!n);if(!s)return o;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var c={_fullLayout:a},f=["x","y"],v=0;v<2;v++){var h=f[v],T=x.coerceRef(r,o,c,h,"paper",void 0);if(T!=="paper"){var l=x.getFromId(c,T);l._imgIndices.push(o._index)}x.coercePosition(o,c,i,T,h,0)}return o}}}),o5=He({"src/components/images/draw.js"(Y,G){var d=Qn(),x=vo(),A=io(),E=oc(),e=Yh();G.exports=function(r){var o=r._fullLayout,a=[],i={},n=[],s,c;for(c=0;c0);f&&(s("active"),s("direction"),s("type"),s("showactive"),s("x"),s("y"),d.noneOrAll(a,i,["x","y"]),s("xanchor"),s("yanchor"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),d.coerceFont(s,"font",n.font),s("bgcolor",n.paper_bgcolor),s("bordercolor"),s("borderwidth"))}function o(a,i){function n(c,f){return d.coerce(a,i,t,c,f)}var s=n("visible",a.method==="skip"||Array.isArray(a.args));s&&(n("method"),n("args"),n("args2"),n("label"),n("execute"))}}}),c5=He({"src/components/updatemenus/scrollbox.js"(Y,G){G.exports=e;var d=Qn(),x=Ai(),A=vo(),E=Gr();function e(t,r,o){this.gd=t,this.container=r,this.id=o,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}e.barWidth=2,e.barLength=20,e.barRadius=2,e.barPad=1,e.barColor="#808BA4",e.prototype.enable=function(r,o,a){var i=this.gd._fullLayout,n=i.width,s=i.height;this.position=r;var c=this.position.l,f=this.position.w,v=this.position.t,h=this.position.h,T=this.position.direction,l=T==="down",y=T==="left",b=T==="right",S=T==="up",M=f,_=h,w,p,u,g;!l&&!y&&!b&&!S&&(this.position.direction="down",l=!0);var m=l||S;m?(w=c,p=w+M,l?(u=v,g=Math.min(u+_,s),_=g-u):(g=v+_,u=Math.max(g-_,0),_=g-u)):(u=v,g=u+_,y?(p=c+M,w=Math.max(p-M,0),M=p-w):(w=c,p=Math.min(w+M,n),M=p-w)),this._box={l:w,t:u,w:M,h:_};var R=f>M,P=e.barLength+2*e.barPad,z=e.barWidth+2*e.barPad,F=c,B=v+h;B+z>s&&(B=s-z);var O=this.container.selectAll("rect.scrollbar-horizontal").data(R?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-horizontal",!0).call(x.fill,e.barColor),R?(this.hbar=O.attr({rx:e.barRadius,ry:e.barRadius,x:F,y:B,width:P,height:z}),this._hbarXMin=F+P/2,this._hbarTranslateMax=M-P):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=h>_,N=e.barWidth+2*e.barPad,U=e.barLength+2*e.barPad,Z=c+f,Q=v;Z+N>n&&(Z=n-N);var ue=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);ue.exit().on(".drag",null).remove(),ue.enter().append("rect").classed("scrollbar-vertical",!0).call(x.fill,e.barColor),L?(this.vbar=ue.attr({rx:e.barRadius,ry:e.barRadius,x:Z,y:Q,width:N,height:U}),this._vbarYMin=Q+U/2,this._vbarTranslateMax=_-U):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var oe=this.id,le=w-.5,j=L?p+N+.5:p+.5,J=u-.5,$=R?g+z+.5:g+.5,X=i._topdefs.selectAll("#"+oe).data(R||L?[0]:[]);if(X.exit().remove(),X.enter().append("clipPath").attr("id",oe).append("rect"),R||L?(this._clipRect=X.select("rect").attr({x:Math.floor(le),y:Math.floor(J),width:Math.ceil(j)-Math.floor(le),height:Math.ceil($)-Math.floor(J)}),this.container.call(A.setClipUrl,oe,this.gd),this.bg.attr({x:c,y:v,width:f,height:h})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(A.setClipUrl,null),delete this._clipRect),R||L){var re=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(re);var ee=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault(),d.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));R&&this.hbar.on(".drag",null).call(ee),L&&this.vbar.on(".drag",null).call(ee)}this.setTranslate(o,a)},e.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(A.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},e.prototype._onBoxDrag=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r-=d.event.dx),this.vbar&&(o-=d.event.dy),this.setTranslate(r,o)},e.prototype._onBoxWheel=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r+=d.event.deltaY),this.vbar&&(o+=d.event.deltaY),this.setTranslate(r,o)},e.prototype._onBarDrag=function(){var r=this.translateX,o=this.translateY;if(this.hbar){var a=r+this._hbarXMin,i=a+this._hbarTranslateMax,n=E.constrain(d.event.x,a,i),s=(n-a)/(i-a),c=this.position.w-this._box.w;r=s*c}if(this.vbar){var f=o+this._vbarYMin,v=f+this._vbarTranslateMax,h=E.constrain(d.event.y,f,v),T=(h-f)/(v-f),l=this.position.h-this._box.h;o=T*l}this.setTranslate(r,o)},e.prototype.setTranslate=function(r,o){var a=this.position.w-this._box.w,i=this.position.h-this._box.h;if(r=E.constrain(r||0,0,a),o=E.constrain(o||0,0,i),this.translateX=r,this.translateY=o,this.container.call(A.setTranslate,this._box.l-this.position.l-r,this._box.t-this.position.t-o),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+r-.5),y:Math.floor(this.position.t+o-.5)}),this.hbar){var n=r/a;this.hbar.call(A.setTranslate,r+n*this._hbarTranslateMax,o)}if(this.vbar){var s=o/i;this.vbar.call(A.setTranslate,r,o+s*this._vbarTranslateMax)}}}}),f5=He({"src/components/updatemenus/draw.js"(Y,G){var d=Qn(),x=yu(),A=Ai(),E=vo(),e=Gr(),t=yl(),r=Gs().arrayEditor,o=df().LINE_SPACING,a=_1(),i=c5();G.exports=function(P){var z=P._fullLayout,F=e.filterVisible(z[a.name]);function B(oe){x.autoMargin(P,u(oe))}var O=z._menulayer.selectAll("g."+a.containerClassName).data(F.length>0?[0]:[]);if(O.enter().append("g").classed(a.containerClassName,!0).style("cursor","pointer"),O.exit().each(function(){d.select(this).selectAll("g."+a.headerGroupClassName).each(B)}).remove(),F.length!==0){var L=O.selectAll("g."+a.headerGroupClassName).data(F,n);L.enter().append("g").classed(a.headerGroupClassName,!0);for(var N=e.ensureSingle(O,"g",a.dropdownButtonGroupClassName,function(oe){oe.style("pointer-events","all")}),U=0;U0?[0]:[]);Z.enter().append("g").classed(a.containerClassName,!0).style("cursor",L?null:"ew-resize");function Q(j){j._commandObserver&&(j._commandObserver.remove(),delete j._commandObserver),x.autoMargin(O,f(j))}if(Z.exit().each(function(){d.select(this).selectAll("g."+a.groupClassName).each(Q)}).remove(),U.length!==0){var ue=Z.selectAll("g."+a.groupClassName).data(U,h);ue.enter().append("g").classed(a.groupClassName,!0),ue.exit().each(Q).remove();for(var oe=0;oe0&&(ue=ue.transition().duration(O.transition.duration).ease(O.transition.easing)),ue.attr("transform",t(Q-a.gripWidth*.5,O._dims.currentValueTotalHeight))}}function R(B,O){var L=B._dims;return L.inputAreaStart+a.stepInset+(L.inputAreaLength-2*a.stepInset)*Math.min(1,Math.max(0,O))}function P(B,O){var L=B._dims;return Math.min(1,Math.max(0,(O-a.stepInset-L.inputAreaStart)/(L.inputAreaLength-2*a.stepInset-2*L.inputAreaStart)))}function z(B,O,L){var N=L._dims,U=e.ensureSingle(B,"rect",a.railTouchRectClass,function(Z){Z.call(p,O,B,L).style("pointer-events","all")});U.attr({width:N.inputAreaLength,height:Math.max(N.inputAreaWidth,a.tickOffset+L.ticklen+N.labelHeight)}).call(A.fill,L.bgcolor).attr("opacity",0),E.setTranslate(U,0,N.currentValueTotalHeight)}function F(B,O){var L=O._dims,N=L.inputAreaLength-a.railInset*2,U=e.ensureSingle(B,"rect",a.railRectClass);U.attr({width:N,height:a.railWidth,rx:a.railRadius,ry:a.railRadius,"shape-rendering":"crispEdges"}).call(A.stroke,O.bordercolor).call(A.fill,O.bgcolor).style("stroke-width",O.borderwidth+"px"),E.setTranslate(U,a.railInset,(L.inputAreaWidth-a.railWidth)*.5+L.currentValueTotalHeight)}}}),p5=He({"src/components/sliders/index.js"(Y,G){var d=iy();G.exports={moduleType:"component",name:d.name,layoutAttributes:aw(),supplyLayoutDefaults:v5(),draw:d5()}}}),x1=He({"src/components/rangeslider/attributes.js"(Y,G){var d=Xc();G.exports={bgcolor:{valType:"color",dflt:d.background,editType:"plot"},bordercolor:{valType:"color",dflt:d.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}}),nw=He({"src/components/rangeslider/oppaxis_attributes.js"(Y,G){G.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}}),b1=He({"src/components/rangeslider/constants.js"(Y,G){G.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}}),g5=He({"src/components/rangeslider/helpers.js"(Y){var G=oc(),d=yl(),x=b1(),A=df().LINE_SPACING,E=x.name;function e(t){var r=t&&t[E];return r&&r.visible}Y.isVisible=e,Y.makeData=function(t){for(var r=G.list({_fullLayout:t},"x",!0),o=t.margin,a=[],i=0;i=Qe.max)qe=fe[et+1];else if(Ce=Qe.pmax)qe=fe[et+1];else if(Ce0?p.touches[0].clientX:0}function v(p,u,g,m){if(u._context.staticPlot)return;var R=p.select("rect."+c.slideBoxClassName).node(),P=p.select("rect."+c.grabAreaMinClassName).node(),z=p.select("rect."+c.grabAreaMaxClassName).node();function F(){var B=d.event,O=B.target,L=f(B),N=L-p.node().getBoundingClientRect().left,U=m.d2p(g._rl[0]),Z=m.d2p(g._rl[1]),Q=n.coverSlip();this.addEventListener("touchmove",ue),this.addEventListener("touchend",oe),Q.addEventListener("mousemove",ue),Q.addEventListener("mouseup",oe);function ue(le){var j=f(le),J=+j-L,$,X,re;switch(O){case R:if(re="ew-resize",U+J>g._length||Z+J<0)return;$=U+J,X=Z+J;break;case P:if(re="col-resize",U+J>g._length)return;$=U+J,X=Z;break;case z:if(re="col-resize",Z+J<0)return;$=U,X=Z+J;break;default:re="ew-resize",$=N,X=N+J;break}if(X<$){var ee=X;X=$,$=ee}m._pixelMin=$,m._pixelMax=X,s(d.select(Q),re),h(p,u,g,m)}function oe(){Q.removeEventListener("mousemove",ue),Q.removeEventListener("mouseup",oe),this.removeEventListener("touchmove",ue),this.removeEventListener("touchend",oe),E.removeElement(Q)}}p.on("mousedown",F),p.on("touchstart",F)}function h(p,u,g,m){function R(F){return g.l2r(E.constrain(F,m._rl[0],m._rl[1]))}var P=R(m.p2d(m._pixelMin)),z=R(m.p2d(m._pixelMax));window.requestAnimationFrame(function(){x.call("_guiRelayout",u,g._name+".range",[P,z])})}function T(p,u,g,m,R,P){var z=c.handleWidth/2;function F(le){return E.constrain(le,0,m._width)}function B(le){return E.constrain(le,0,m._height)}function O(le){return E.constrain(le,-z,m._width+z)}var L=F(m.d2p(g._rl[0])),N=F(m.d2p(g._rl[1]));if(p.select("rect."+c.slideBoxClassName).attr("x",L).attr("width",N-L),p.select("rect."+c.maskMinClassName).attr("width",L),p.select("rect."+c.maskMaxClassName).attr("x",N).attr("width",m._width-N),P.rangemode!=="match"){var U=m._height-B(m.d2pOppAxis(R._rl[1])),Z=m._height-B(m.d2pOppAxis(R._rl[0]));p.select("rect."+c.maskMinOppAxisClassName).attr("x",L).attr("height",U).attr("width",N-L),p.select("rect."+c.maskMaxOppAxisClassName).attr("x",L).attr("y",Z).attr("height",m._height-Z).attr("width",N-L),p.select("rect."+c.slideBoxClassName).attr("y",U).attr("height",Z-U)}var Q=.5,ue=Math.round(O(L-z))-Q,oe=Math.round(O(N-z))+Q;p.select("g."+c.grabberMinClassName).attr("transform",e(ue,Q)),p.select("g."+c.grabberMaxClassName).attr("transform",e(oe,Q))}function l(p,u,g,m){var R=E.ensureSingle(p,"rect",c.bgClassName,function(B){B.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),P=m.borderwidth%2===0?m.borderwidth:m.borderwidth-1,z=-m._offsetShift,F=t.crispRound(u,m.borderwidth);R.attr({width:m._width+P,height:m._height+P,transform:e(z,z),"stroke-width":F}).call(r.stroke,m.bordercolor).call(r.fill,m.bgcolor)}function y(p,u,g,m){var R=u._fullLayout,P=E.ensureSingleById(R._topdefs,"clipPath",m._clipId,function(z){z.append("rect").attr({x:0,y:0})});P.select("rect").attr({width:m._width,height:m._height})}function b(p,u,g,m){var R=u.calcdata,P=p.selectAll("g."+c.rangePlotClassName).data(g._subplotsWith,E.identity);P.enter().append("g").attr("class",function(F){return c.rangePlotClassName+" "+F}).call(t.setClipUrl,m._clipId,u),P.order(),P.exit().remove();var z;P.each(function(F,B){var O=d.select(this),L=B===0,N=i.getFromId(u,F,"y"),U=N._name,Z=m[U],Q={data:[],layout:{xaxis:{type:g.type,domain:[0,1],range:m.range.slice(),calendar:g.calendar},width:m._width,height:m._height,margin:{t:0,b:0,l:0,r:0}},_context:u._context};g.rangebreaks&&(Q.layout.xaxis.rangebreaks=g.rangebreaks),Q.layout[U]={type:N.type,domain:[0,1],range:Z.rangemode!=="match"?Z.range.slice():N.range.slice(),calendar:N.calendar},N.rangebreaks&&(Q.layout[U].rangebreaks=N.rangebreaks),A.supplyDefaults(Q);var ue=Q._fullLayout.xaxis,oe=Q._fullLayout[U];ue.clearCalc(),ue.setScale(),oe.clearCalc(),oe.setScale();var le={id:F,plotgroup:O,xaxis:ue,yaxis:oe,isRangePlot:!0};L?z=le:(le.mainplot="xy",le.mainplotinfo=z),a.rangePlot(u,le,S(R,F))})}function S(p,u){for(var g=[],m=0;m0);if(y){var b=o(n,s,c);T("x",b[0]),T("y",b[1]),d.noneOrAll(i,n,["x","y"]),T("xanchor"),T("yanchor"),d.coerceFont(T,"font",s.font);var S=T("bgcolor");T("activecolor",x.contrast(S,t.lightAmount,t.darkAmount)),T("bordercolor"),T("borderwidth")}};function r(a,i,n,s){var c=s.calendar;function f(T,l){return d.coerce(a,i,e.buttons,T,l)}var v=f("visible");if(v){var h=f("step");h!=="all"&&(c&&c!=="gregorian"&&(h==="month"||h==="year")?i.stepmode="backward":f("stepmode"),f("count")),f("label")}}function o(a,i,n){for(var s=n.filter(function(h){return i[h].anchor===a._id}),c=0,f=0;f1)){delete c.grid;return}if(!T&&!l&&!y){var g=w("pattern")==="independent";g&&(T=!0)}_._hasSubplotGrid=T;var m=w("roworder"),R=m==="top to bottom",P=T?.2:.1,z=T?.3:.1,F,B;b&&c._splomGridDflt&&(F=c._splomGridDflt.xside,B=c._splomGridDflt.yside),_._domains={x:a("x",w,P,F,u),y:a("y",w,z,B,p,R)}}function a(s,c,f,v,h,T){var l=c(s+"gap",f),y=c("domain."+s);c(s+"side",v);for(var b=new Array(h),S=y[0],M=(y[1]-S)/(h-l),_=M*(1-l),w=0;w0,v=r._context.staticPlot;o.each(function(h){var T=h[0].trace,l=T.error_x||{},y=T.error_y||{},b;T.ids&&(b=function(w){return w.id});var S=E.hasMarkers(T)&&T.marker.maxdisplayed>0;!y.visible&&!l.visible&&(h=[]);var M=d.select(this).selectAll("g.errorbar").data(h,b);if(M.exit().remove(),!!h.length){l.visible||M.selectAll("path.xerror").remove(),y.visible||M.selectAll("path.yerror").remove(),M.style("opacity",1);var _=M.enter().append("g").classed("errorbar",!0);f&&_.style("opacity",0).transition().duration(i.duration).style("opacity",1),A.setClipUrl(M,a.layerClipId,r),M.each(function(w){var p=d.select(this),u=e(w,s,c);if(!(S&&!w.vis)){var g,m=p.select("path.yerror");if(y.visible&&x(u.x)&&x(u.yh)&&x(u.ys)){var R=y.width;g="M"+(u.x-R)+","+u.yh+"h"+2*R+"m-"+R+",0V"+u.ys,u.noYS||(g+="m-"+R+",0h"+2*R),n=!m.size(),n?m=p.append("path").style("vector-effect",v?"none":"non-scaling-stroke").classed("yerror",!0):f&&(m=m.transition().duration(i.duration).ease(i.easing)),m.attr("d",g)}else m.remove();var P=p.select("path.xerror");if(l.visible&&x(u.y)&&x(u.xh)&&x(u.xs)){var z=(l.copy_ystyle?y:l).width;g="M"+u.xh+","+(u.y-z)+"v"+2*z+"m0,-"+z+"H"+u.xs,u.noXS||(g+="m0,-"+z+"v"+2*z),n=!P.size(),n?P=p.append("path").style("vector-effect",v?"none":"non-scaling-stroke").classed("xerror",!0):f&&(P=P.transition().duration(i.duration).ease(i.easing)),P.attr("d",g)}else P.remove()}})}})};function e(t,r,o){var a={x:r.c2p(t.x),y:o.c2p(t.y)};return t.yh!==void 0&&(a.yh=o.c2p(t.yh),a.ys=o.c2p(t.ys),x(a.ys)||(a.noYS=!0,a.ys=o.c2p(t.ys,!0))),t.xh!==void 0&&(a.xh=r.c2p(t.xh),a.xs=r.c2p(t.xs),x(a.xs)||(a.noXS=!0,a.xs=r.c2p(t.xs,!0))),a}}}),k5=He({"src/components/errorbars/style.js"(Y,G){var d=Qn(),x=Ai();G.exports=function(E){E.each(function(e){var t=e[0].trace,r=t.error_y||{},o=t.error_x||{},a=d.select(this);a.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(x.stroke,r.color),o.copy_ystyle&&(o=r),a.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(x.stroke,o.color)})}}}),C5=He({"src/components/errorbars/index.js"(Y,G){var d=Gr(),x=hu().overrideAll,A=sw(),E={error_x:d.extendFlat({},A),error_y:d.extendFlat({},A)};delete E.error_x.copy_zstyle,delete E.error_y.copy_zstyle,delete E.error_y.copy_ystyle;var e={error_x:d.extendFlat({},A),error_y:d.extendFlat({},A),error_z:d.extendFlat({},A)};delete e.error_x.copy_ystyle,delete e.error_y.copy_ystyle,delete e.error_z.copy_ystyle,delete e.error_z.copy_zstyle,G.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:E,bar:E,histogram:E,scatter3d:x(e,"calc","nested"),scattergl:x(E,"calc","nested")}},supplyDefaults:S5(),calc:M5(),makeComputeError:lw(),plot:E5(),style:k5(),hoverInfo:t};function t(r,o,a){(o.error_y||{}).visible&&(a.yerr=r.yh-r.y,o.error_y.symmetric||(a.yerrneg=r.y-r.ys)),(o.error_x||{}).visible&&(a.xerr=r.xh-r.x,o.error_x.symmetric||(a.xerrneg=r.x-r.xs))}}}),L5=He({"src/components/colorbar/constants.js"(Y,G){G.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),P5=He({"src/components/colorbar/draw.js"(Y,G){var d=Qn(),x=Mf(),A=yu(),E=Ei(),e=io(),t=fh(),r=Gr(),o=r.strTranslate,a=ho().extendFlat,i=xv(),n=vo(),s=Ai(),c=kp(),f=yl(),v=Ah().flipScale,h=ny(),T=g1(),l=jf(),y=df(),b=y.LINE_SPACING,S=y.FROM_TL,M=y.FROM_BR,_=L5().cn;function w(P){var z=P._fullLayout,F=z._infolayer.selectAll("g."+_.colorbar).data(p(P),function(B){return B._id});F.enter().append("g").attr("class",function(B){return B._id}).classed(_.colorbar,!0),F.each(function(B){var O=d.select(this);r.ensureSingle(O,"rect",_.cbbg),r.ensureSingle(O,"g",_.cbfills),r.ensureSingle(O,"g",_.cblines),r.ensureSingle(O,"g",_.cbaxis,function(N){N.classed(_.crisp,!0)}),r.ensureSingle(O,"g",_.cbtitleunshift,function(N){N.append("g").classed(_.cbtitle,!0)}),r.ensureSingle(O,"rect",_.cboutline);var L=u(O,B,P);L&&L.then&&(P._promises||[]).push(L),P._context.edits.colorbarPosition&&g(O,B,P)}),F.exit().each(function(B){A.autoMargin(P,B._id)}).remove(),F.order()}function p(P){var z=P._fullLayout,F=P.calcdata,B=[],O,L,N,U;function Z(q){return a(q,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function Q(){typeof U.calc=="function"?U.calc(P,N,O):(O._fillgradient=L.reversescale?v(L.colorscale):L.colorscale,O._zrange=[L[U.min],L[U.max]])}for(var ue=0;ue1){var ze=Math.pow(10,Math.floor(Math.log(pt)/Math.LN10));fr*=ze*r.roundUp(pt/ze,[2,5,10]),(Math.abs(et.start)/et.size+1e-6)%1<2e-6&&(ar.tick0=0)}ar.dtick=fr}ar.domain=B?[Ut+J/ae.h,Ut+Re-J/ae.h]:[Ut+j/ae.w,Ut+Re-j/ae.w],ar.setScale(),P.attr("transform",o(Math.round(ae.l),Math.round(ae.t)));var Ge=P.select("."+_.cbtitleunshift).attr("transform",o(-Math.round(ae.l),-Math.round(ae.t))),Oe=ar.ticklabelposition,ve=ar.title.font.size,ge=P.select("."+_.cbaxis),be,Pe=0,We=0;function ct(qt,Zt){var lr={propContainer:ar,propName:z._propPrefix+"title",traceIndex:z._traceIndex,_meta:z._meta,placeholder:q._dfltTitle.colorbar,containerGroup:P.select("."+_.cbtitle)},ta=qt.charAt(0)==="h"?qt.substr(1):"h"+qt;P.selectAll("."+ta+",."+ta+"-math-group").remove(),c.draw(F,qt,a(lr,Zt||{}))}function _t(){if(B&&Mr||!B&&!Mr){var qt,Zt;Ae==="top"&&(qt=j+ae.l+$e*$,Zt=J+ae.t+rt*(1-Ut-Re)+3+ve*.75),Ae==="bottom"&&(qt=j+ae.l+$e*$,Zt=J+ae.t+rt*(1-Ut)-3-ve*.25),Ae==="right"&&(Zt=J+ae.t+rt*X+3+ve*.75,qt=j+ae.l+$e*Ut),ct(ar._id+"title",{attributes:{x:qt,y:Zt,"text-anchor":B?"start":"middle"}})}}function Mt(){if(B&&!Mr||!B&&Mr){var qt=ar.position||0,Zt=ar._offset+ar._length/2,lr,ta;if(Ae==="right")ta=Zt,lr=ae.l+$e*qt+10+ve*(ar.showticklabels?1:.5);else if(lr=Zt,Ae==="bottom"&&(ta=ae.t+rt*qt+10+(Oe.indexOf("inside")===-1?ar.tickfont.size:0)+(ar.ticks!=="intside"&&z.ticklen||0)),Ae==="top"){var da=we.text.split("
").length;ta=ae.t+rt*qt+10-Me-b*ve*da}ct((B?"h":"v")+ar._id+"title",{avoid:{selection:d.select(F).selectAll("g."+ar._id+"tick"),side:Ae,offsetTop:B?0:ae.t,offsetLeft:B?ae.l:0,maxShift:B?q.width:q.height},attributes:{x:lr,y:ta,"text-anchor":"middle"},transform:{rotate:B?-90:0,offset:0}})}}function Nt(){if(!B&&!Mr||B&&Mr){var qt=P.select("."+_.cbtitle),Zt=qt.select("text"),lr=[-Z/2,Z/2],ta=qt.select(".h"+ar._id+"title-math-group").node(),da=15.6;Zt.node()&&(da=parseInt(Zt.node().style.fontSize,10)*b);var wa;if(ta?(wa=n.bBox(ta),We=wa.width,Pe=wa.height,Pe>da&&(lr[1]-=(Pe-da)/2)):Zt.node()&&!Zt.classed(_.jsPlaceholder)&&(wa=n.bBox(Zt.node()),We=wa.width,Pe=wa.height),B){if(Pe){if(Pe+=5,Ae==="top")ar.domain[1]-=Pe/ae.h,lr[1]*=-1;else{ar.domain[0]+=Pe/ae.h;var ma=f.lineCount(Zt);lr[1]+=(1-ma)*da}qt.attr("transform",o(lr[0],lr[1])),ar.setScale()}}else We&&(Ae==="right"&&(ar.domain[0]+=(We+ve/2)/ae.w),qt.attr("transform",o(lr[0],lr[1])),ar.setScale())}P.selectAll("."+_.cbfills+",."+_.cblines).attr("transform",B?o(0,Math.round(ae.h*(1-ar.domain[1]))):o(Math.round(ae.w*ar.domain[0]),0)),ge.attr("transform",B?o(0,Math.round(-ae.t)):o(Math.round(-ae.l),0));var Ia=P.select("."+_.cbfills).selectAll("rect."+_.cbfill).attr("style","").data(Ke);Ia.enter().append("rect").classed(_.cbfill,!0).attr("style",""),Ia.exit().remove();var va=Fe.map(ar.c2p).map(Math.round).sort(function(jt,Ot){return jt-Ot});Ia.each(function(jt,Ot){var gr=[Ot===0?Fe[0]:(Ke[Ot]+Ke[Ot-1])/2,Ot===Ke.length-1?Fe[1]:(Ke[Ot]+Ke[Ot+1])/2].map(ar.c2p).map(Math.round);B&&(gr[1]=r.constrain(gr[1]+(gr[1]>gr[0])?1:-1,va[0],va[1]));var Br=d.select(this).attr(B?"x":"y",Je).attr(B?"y":"x",d.min(gr)).attr(B?"width":"height",Math.max(Me,2)).attr(B?"height":"width",Math.max(d.max(gr)-d.min(gr),2));if(z._fillgradient)n.gradient(Br,F,z._id,B?"vertical":"horizontalreversed",z._fillgradient,"fill");else{var na=qe(jt).replace("e-","");Br.attr("fill",x(na).toHexString())}});var La=P.select("."+_.cblines).selectAll("path."+_.cbline).data(fe.color&&fe.width?Xe:[]);La.enter().append("path").classed(_.cbline,!0),La.exit().remove(),La.each(function(jt){var Ot=Je,gr=Math.round(ar.c2p(jt))+fe.width/2%1;d.select(this).attr("d","M"+(B?Ot+","+gr:gr+","+Ot)+(B?"h":"v")+Me).call(n.lineGroupStyle,fe.width,Ce(jt),fe.dash)}),ge.selectAll("g."+ar._id+"tick,path").remove();var Ka=Je+Me+(Z||0)/2-(z.ticks==="outside"?1:0),Vt=e.calcTicks(ar),Lt=e.getTickSigns(ar)[2];return e.drawTicks(F,ar,{vals:ar.ticks==="inside"?e.clipEnds(ar,Vt):Vt,layer:ge,path:e.makeTickPath(ar,Ka,Lt),transFn:e.makeTransTickFn(ar)}),e.drawLabels(F,ar,{vals:Vt,layer:ge,transFn:e.makeTransTickLabelFn(ar),labelFns:e.makeLabelFns(ar,Ka)})}function Bt(){var qt,Zt=Me+Z/2;Oe.indexOf("inside")===-1&&(qt=n.bBox(ge.node()),Zt+=B?qt.width:qt.height),be=Ge.select("text");var lr=0,ta=B&&Ae==="top",da=!B&&Ae==="right",wa=0;if(be.node()&&!be.classed(_.jsPlaceholder)){var ma,Ia=Ge.select(".h"+ar._id+"title-math-group").node();Ia&&(B&&Mr||!B&&!Mr)?(qt=n.bBox(Ia),lr=qt.width,ma=qt.height):(qt=n.bBox(Ge.node()),lr=qt.right-ae.l-(B?Je:ir),ma=qt.bottom-ae.t-(B?ir:Je),!B&&Ae==="top"&&(Zt+=qt.height,wa=qt.height)),da&&(be.attr("transform",o(lr/2+ve/2,0)),lr*=2),Zt=Math.max(Zt,B?lr:ma)}var va=(B?j:J)*2+Zt+Q+Z/2,La=0;!B&&we.text&&le==="bottom"&&X<=0&&(La=va/2,va+=La,wa+=La),q._hColorbarMoveTitle=La,q._hColorbarMoveCBTitle=wa;var Ka=Q+Z,Vt=(B?Je:ir)-Ka/2-(B?j:0),Lt=(B?ir:Je)-(B?ce:J+wa-La);P.select("."+_.cbbg).attr("x",Vt).attr("y",Lt).attr(B?"width":"height",Math.max(va-La,2)).attr(B?"height":"width",Math.max(ce+Ka,2)).call(s.fill,ue).call(s.stroke,z.bordercolor).style("stroke-width",Q);var jt=da?Math.max(lr-10,0):0;P.selectAll("."+_.cboutline).attr("x",(B?Je:ir+j)+jt).attr("y",(B?ir+J-ce:Je)+(ta?Pe:0)).attr(B?"width":"height",Math.max(Me,2)).attr(B?"height":"width",Math.max(ce-(B?2*J+Pe:2*j+jt),2)).call(s.stroke,z.outlinecolor).style({fill:"none","stroke-width":Z});var Ot=B?At*va:0,gr=B?0:(1-St)*va-wa;if(Ot=ee?ae.l-Ot:-Ot,gr=re?ae.t-gr:-gr,P.attr("transform",o(Ot,gr)),!B&&(Q||x(ue).getAlpha()&&!x.equals(q.paper_bgcolor,ue))){var Br=ge.selectAll("text"),na=Br[0].length,Ur=P.select("."+_.cbbg).node(),ga=n.bBox(Ur),Aa=n.getTranslate(P),Pa=2;Br.each(function(zr,Pr){var Hr=0,Zr=na-1;if(Pr===Hr||Pr===Zr){var Jr=n.bBox(this),wt=n.getTranslate(this),Qt;if(Pr===Zr){var mr=Jr.right+wt.x,$r=ga.right+Aa.x+ir-Q-Pa+$;Qt=$r-mr,Qt>0&&(Qt=0)}else if(Pr===Hr){var oa=Jr.left+wt.x,Sa=ga.left+Aa.x+ir+Q+Pa;Qt=Sa-oa,Qt<0&&(Qt=0)}Qt&&(na<3?this.setAttribute("transform","translate("+Qt+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var sa={},Oa=S[oe],dt=M[oe],vt=S[le],Lr=M[le],Er=va-Me;B?(L==="pixels"?(sa.y=X,sa.t=ce*vt,sa.b=ce*Lr):(sa.t=sa.b=0,sa.yt=X+O*vt,sa.yb=X-O*Lr),U==="pixels"?(sa.x=$,sa.l=va*Oa,sa.r=va*dt):(sa.l=Er*Oa,sa.r=Er*dt,sa.xl=$-N*Oa,sa.xr=$+N*dt)):(L==="pixels"?(sa.x=$,sa.l=ce*Oa,sa.r=ce*dt):(sa.l=sa.r=0,sa.xl=$+O*Oa,sa.xr=$-O*dt),U==="pixels"?(sa.y=1-X,sa.t=va*vt,sa.b=va*Lr):(sa.t=Er*vt,sa.b=Er*Lr,sa.yt=X-N*vt,sa.yb=X+N*Lr));var _r=z.y<.5?"b":"t",yr=z.x<.5?"l":"r";F._fullLayout._reservedMargin[z._id]={};var kr={r:q.width-Vt-Ot,l:Vt+sa.r,b:q.height-Lt-gr,t:Lt+sa.b};ee&&re?A.autoMargin(F,z._id,sa):ee?F._fullLayout._reservedMargin[z._id][_r]=kr[_r]:re||B?F._fullLayout._reservedMargin[z._id][yr]=kr[yr]:F._fullLayout._reservedMargin[z._id][_r]=kr[_r]}return r.syncOrAsync([A.previousPromises,_t,Nt,Mt,A.previousPromises,Bt],F)}function g(P,z,F){var B=z.orientation==="v",O=F._fullLayout,L=O._size,N,U,Z;t.init({element:P.node(),gd:F,prepFn:function(){N=P.attr("transform"),i(P)},moveFn:function(Q,ue){P.attr("transform",N+o(Q,ue)),U=t.align((B?z._uFrac:z._vFrac)+Q/L.w,B?z._thickFrac:z._lenFrac,0,1,z.xanchor),Z=t.align((B?z._vFrac:1-z._uFrac)-ue/L.h,B?z._lenFrac:z._thickFrac,0,1,z.yanchor);var oe=t.getCursor(U,Z,z.xanchor,z.yanchor);i(P,oe)},doneFn:function(){if(i(P),U!==void 0&&Z!==void 0){var Q={};Q[z._propPrefix+"x"]=U,Q[z._propPrefix+"y"]=Z,z._traceIndex!==void 0?E.call("_guiRestyle",F,Q,z._traceIndex):E.call("_guiRelayout",F,Q)}}})}function m(P,z,F){var B=z._levels,O=[],L=[],N,U,Z=B.end+B.size/100,Q=B.size,ue=1.001*F[0]-.001*F[1],oe=1.001*F[1]-.001*F[0];for(U=0;U<1e5&&(N=B.start+U*Q,!(Q>0?N>=Z:N<=Z));U++)N>ue&&N0?N>=Z:N<=Z));U++)N>F[0]&&N-1}G.exports=function(o,a){var i,n=o.data,s=o.layout,c=E([],n),f=E({},s,e(a.tileClass)),v=o._context||{};if(a.width&&(f.width=a.width),a.height&&(f.height=a.height),a.tileClass==="thumbnail"||a.tileClass==="themes__thumb"){f.annotations=[];var h=Object.keys(f);for(i=0;i=0)return v}else if(typeof v=="string"&&(v=v.trim(),v.slice(-1)==="%"&&d(v.slice(0,-1))&&(v=+v.slice(0,-1),v>=0)))return v+"%"}function f(v,h,T,l,y,b){b=b||{};var S=b.moduleHasSelected!==!1,M=b.moduleHasUnselected!==!1,_=b.moduleHasConstrain!==!1,w=b.moduleHasCliponaxis!==!1,p=b.moduleHasTextangle!==!1,u=b.moduleHasInsideanchor!==!1,g=!!b.hasPathbar,m=Array.isArray(y)||y==="auto",R=m||y==="inside",P=m||y==="outside";if(R||P){var z=i(l,"textfont",T.font),F=x.extendFlat({},z),B=v.textfont&&v.textfont.color,O=!B;if(O&&delete F.color,i(l,"insidetextfont",F),g){var L=x.extendFlat({},z);O&&delete L.color,i(l,"pathbar.textfont",L)}P&&i(l,"outsidetextfont",z),S&&l("selected.textfont.color"),M&&l("unselected.textfont.color"),_&&l("constraintext"),w&&l("cliponaxis"),p&&l("textangle"),l("texttemplate")}R&&u&&l("insidetextanchor")}G.exports={supplyDefaults:n,crossTraceDefaults:s,handleText:f,validateCornerradius:c}}}),cw=He({"src/traces/bar/layout_defaults.js"(Y,G){var d=Ei(),x=io(),A=Gr(),E=T1(),e=Jh().validateCornerradius;G.exports=function(t,r,o){function a(S,M){return A.coerce(t,r,E,S,M)}for(var i=!1,n=!1,s=!1,c={},f=a("barmode"),v=f==="group",h=0;h0&&!c[l]&&(s=!0),c[l]=!0),T.visible&&T.type==="histogram"){var y=x.getFromId({_fullLayout:r},T[T.orientation==="v"?"xaxis":"yaxis"]);y.type!=="category"&&(n=!0)}}if(!i){delete r.barmode;return}f!=="overlay"&&a("barnorm"),a("bargap",n&&!s?0:.2),a("bargroupgap");var b=a("barcornerradius");r.barcornerradius=e(b)}}}),oy=He({"src/traces/bar/arrays_to_calcdata.js"(Y,G){var d=Gr();G.exports=function(A,E){for(var e=0;er;if(!o)return E}return e!==void 0?e:A.dflt},Y.coerceColor=function(A,E,e){return d(E).isValid()?E:e!==void 0?e:A.dflt},Y.coerceEnumerated=function(A,E,e){return A.coerceNumber&&(E=+E),A.values.indexOf(E)!==-1?E:e!==void 0?e:A.dflt},Y.getValue=function(A,E){var e;return x(A)?E1||g.bargap===0&&g.bargroupgap===0&&!m[0].trace.marker.line.width)&&d.select(this).attr("shape-rendering","crispEdges")}),p.selectAll("g.points").each(function(m){var R=d.select(this),P=m[0].trace;c(R,P,w)}),e.getComponentMethod("errorbars","style")(p)}function c(w,p,u){A.pointStyle(w.selectAll("path"),p,u),f(w,p,u)}function f(w,p,u){w.selectAll("text").each(function(g){var m=d.select(this),R=E.ensureUniformFontSize(u,l(m,g,p,u));A.font(m,R)})}function v(w,p,u){var g=p[0].trace;g.selectedpoints?h(u,g,w):(c(u,g,w),e.getComponentMethod("errorbars","style")(u))}function h(w,p,u){A.selectedPointStyle(w.selectAll("path"),p),T(w.selectAll("text"),p,u)}function T(w,p,u){w.each(function(g){var m=d.select(this),R;if(g.selected){R=E.ensureUniformFontSize(u,l(m,g,p,u));var P=p.selected.textfont&&p.selected.textfont.color;P&&(R.color=P),A.font(m,R)}else A.selectedTextStyle(m,p)})}function l(w,p,u,g){var m=g._fullLayout.font,R=u.textfont;if(w.classed("bartext-inside")){var P=_(p,u);R=b(u,p.i,m,P)}else w.classed("bartext-outside")&&(R=S(u,p.i,m));return R}function y(w,p,u){return M(o,w.textfont,p,u)}function b(w,p,u,g){var m=y(w,p,u),R=w._input.textfont===void 0||w._input.textfont.color===void 0||Array.isArray(w.textfont.color)&&w.textfont.color[p]===void 0;return R&&(m={color:x.contrast(g),family:m.family,size:m.size,weight:m.weight,style:m.style,variant:m.variant,textcase:m.textcase,lineposition:m.lineposition,shadow:m.shadow}),M(a,w.insidetextfont,p,m)}function S(w,p,u){var g=y(w,p,u);return M(i,w.outsidetextfont,p,g)}function M(w,p,u,g){p=p||{};var m=n.getValue(p.family,u),R=n.getValue(p.size,u),P=n.getValue(p.color,u),z=n.getValue(p.weight,u),F=n.getValue(p.style,u),B=n.getValue(p.variant,u),O=n.getValue(p.textcase,u),L=n.getValue(p.lineposition,u),N=n.getValue(p.shadow,u);return{family:n.coerceString(w.family,m,g.family),size:n.coerceNumber(w.size,R,g.size),color:n.coerceColor(w.color,P,g.color),weight:n.coerceString(w.weight,z,g.weight),style:n.coerceString(w.style,F,g.style),variant:n.coerceString(w.variant,B,g.variant),textcase:n.coerceString(w.variant,O,g.textcase),lineposition:n.coerceString(w.variant,L,g.lineposition),shadow:n.coerceString(w.variant,N,g.shadow)}}function _(w,p){return p.type==="waterfall"?p[w.dir].marker.color:w.mcc||w.mc||p.marker.color}G.exports={style:s,styleTextPoints:f,styleOnSelect:v,getInsideTextFont:b,getOutsideTextFont:S,getBarColor:_,resizeText:t}}}),Dp=He({"src/traces/bar/plot.js"(Y,G){var d=Qn(),x=Hi(),A=Gr(),E=yl(),e=Ai(),t=vo(),r=Ei(),o=io().tickText,a=hh(),i=a.recordMinTextSize,n=a.clearMinTextSize,s=uv(),c=S1(),f=Rp(),v=qv(),h=v.text,T=v.textposition,l=Ph().appendArrayPointValue,y=f.TEXTPAD;function b(Q){return Q.id}function S(Q){if(Q.ids)return b}function M(Q){return(Q>0)-(Q<0)}function _(Q,ue){return Q0}function g(Q,ue,oe,le,j,J){var $=ue.xaxis,X=ue.yaxis,re=Q._fullLayout,ee=Q._context.staticPlot;j||(j={mode:re.barmode,norm:re.barmode,gap:re.bargap,groupgap:re.bargroupgap},n("bar",re));var q=A.makeTraceGroups(le,oe,"trace bars").each(function(ae){var ie=d.select(this),fe=ae[0].trace,we=ae[0].t,Ae=fe.type==="waterfall",Fe=fe.type==="funnel",Ce=fe.type==="histogram",qe=fe.type==="bar",et=qe||Fe,Qe=0;Ae&&fe.connector.visible&&fe.connector.mode==="between"&&(Qe=fe.connector.line.width/2);var Ke=fe.orientation==="h",Xe=u(j),Me=A.ensureSingle(ie,"g","points"),xe=S(fe),ce=Me.selectAll("g.point").data(A.identity,xe);ce.enter().append("g").classed("point",!0),ce.exit().remove(),ce.each(function($e,rt){var Je=d.select(this),At=w($e,$,X,Ke),St=At[0][0],Rt=At[0][1],Ut=At[1][0],ir=At[1][1],ar=(Ke?Rt-St:ir-Ut)===0;ar&&et&&c.getLineWidth(fe,$e)&&(ar=!1),ar||(ar=!x(St)||!x(Rt)||!x(Ut)||!x(ir)),$e.isBlank=ar,ar&&(Ke?Rt=St:ir=Ut),Qe&&!ar&&(Ke?(St-=_(St,Rt)*Qe,Rt+=_(St,Rt)*Qe):(Ut-=_(Ut,ir)*Qe,ir+=_(Ut,ir)*Qe));var Mr,fr;if(fe.type==="waterfall"){if(!ar){var dr=fe[$e.dir].marker;Mr=dr.line.width,fr=dr.color}}else Mr=c.getLineWidth(fe,$e),fr=$e.mc||fe.marker.color;function pt(Ka){var Vt=d.round(Mr/2%1,2);return j.gap===0&&j.groupgap===0?d.round(Math.round(Ka)-Vt,2):Ka}function ze(Ka,Vt,Lt){return Lt&&Ka===Vt?Ka:Math.abs(Ka-Vt)>=2?pt(Ka):Ka>Vt?Math.ceil(Ka):Math.floor(Ka)}var Ge=e.opacity(fr),Oe=Ge<1||Mr>.01?pt:ze;Q._context.staticPlot||(St=Oe(St,Rt,Ke),Rt=Oe(Rt,St,Ke),Ut=Oe(Ut,ir,!Ke),ir=Oe(ir,Ut,!Ke));var ve=Ke?$.c2p:X.c2p,ge;$e.s0>0?ge=$e._sMax:$e.s0<0?ge=$e._sMin:ge=$e.s1>0?$e._sMax:$e._sMin;function be(Ka,Vt){if(!Ka)return 0;var Lt=Math.abs(Ke?ir-Ut:Rt-St),jt=Math.abs(Ke?Rt-St:ir-Ut),Ot=Oe(Math.abs(ve(ge,!0)-ve(0,!0))),gr=$e.hasB?Math.min(Lt/2,jt/2):Math.min(Lt/2,Ot),Br;if(Vt==="%"){var na=Math.min(50,Ka);Br=Lt*(na/100)}else Br=Ka;return Oe(Math.max(Math.min(Br,gr),0))}var Pe=qe||Ce?be(we.cornerradiusvalue,we.cornerradiusform):0,We,ct,_t="M"+St+","+Ut+"V"+ir+"H"+Rt+"V"+Ut+"Z",Mt=0;if(Pe&&$e.s){var Nt=M($e.s0)===0||M($e.s)===M($e.s0)?$e.s1:$e.s0;if(Mt=Oe($e.hasB?0:Math.abs(ve(ge,!0)-ve(Nt,!0))),Mt0?Math.sqrt(Mt*(2*Pe-Mt)):0,da=Bt>0?Math.max:Math.min;We="M"+St+","+Ut+"V"+(ir-lr*qt)+"H"+da(Rt-(Pe-Mt)*Bt,St)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+Rt+","+(ir-Pe*qt-ta)+"V"+(Ut+Pe*qt+ta)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+da(Rt-(Pe-Mt)*Bt,St)+","+(Ut+lr*qt)+"Z"}else if($e.hasB)We="M"+(St+Pe*Bt)+","+Ut+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+St+","+(Ut+Pe*qt)+"V"+(ir-Pe*qt)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+(St+Pe*Bt)+","+ir+"H"+(Rt-Pe*Bt)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+Rt+","+(ir-Pe*qt)+"V"+(Ut+Pe*qt)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+(Rt-Pe*Bt)+","+Ut+"Z";else{ct=Math.abs(ir-Ut)+Mt;var wa=ct0?Math.sqrt(Mt*(2*Pe-Mt)):0,Ia=qt>0?Math.max:Math.min;We="M"+(St+wa*Bt)+","+Ut+"V"+Ia(ir-(Pe-Mt)*qt,Ut)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+(St+Pe*Bt-ma)+","+ir+"H"+(Rt-Pe*Bt+ma)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+(Rt-wa*Bt)+","+Ia(ir-(Pe-Mt)*qt,Ut)+"V"+Ut+"Z"}}else We=_t}else We=_t;var va=p(A.ensureSingle(Je,"path"),re,j,J);if(va.style("vector-effect",ee?"none":"non-scaling-stroke").attr("d",isNaN((Rt-St)*(ir-Ut))||ar&&Q._context.staticPlot?"M0,0Z":We).call(t.setClipUrl,ue.layerClipId,Q),!re.uniformtext.mode&&Xe){var La=t.makePointStyleFns(fe);t.singlePointStyle($e,va,fe,La,Q)}m(Q,ue,Je,ae,rt,St,Rt,Ut,ir,Pe,Mt,j,J),ue.layerClipId&&t.hideOutsideRangePoint($e,Je.select("text"),$,X,fe.xcalendar,fe.ycalendar)});var Re=fe.cliponaxis===!1;t.setClipUrl(ie,Re?null:ue.layerClipId,Q)});r.getComponentMethod("errorbars","plot")(Q,q,ue,j)}function m(Q,ue,oe,le,j,J,$,X,re,ee,q,ae,ie){var fe=ue.xaxis,we=ue.yaxis,Ae=Q._fullLayout,Fe;function Ce(ct,_t,Mt){var Nt=A.ensureSingle(ct,"text").text(_t).attr({class:"bartext bartext-"+Fe,"text-anchor":"middle","data-notex":1}).call(t.font,Mt).call(E.convertToTspans,Q);return Nt}var qe=le[0].trace,et=qe.orientation==="h",Qe=L(Ae,le,j,fe,we);Fe=N(qe,j);var Ke=ae.mode==="stack"||ae.mode==="relative",Xe=le[j],Me=!Ke||Xe._outmost,xe=Xe.hasB,ce=ee&&ee-q>y;if(!Qe||Fe==="none"||(Xe.isBlank||J===$||X===re)&&(Fe==="auto"||Fe==="inside")){oe.select("text").remove();return}var Re=Ae.font,$e=s.getBarColor(le[j],qe),rt=s.getInsideTextFont(qe,j,Re,$e),Je=s.getOutsideTextFont(qe,j,Re),At=qe.insidetextanchor||"end",St=oe.datum();et?fe.type==="log"&&St.s0<=0&&(fe.range[0]0&&pt>0,Oe;ce?xe?Oe=R(ir-2*ee,ar,dr,pt,et)||R(ir,ar-2*ee,dr,pt,et):et?Oe=R(ir-(ee-q),ar,dr,pt,et)||R(ir,ar-2*(ee-q),dr,pt,et):Oe=R(ir,ar-(ee-q),dr,pt,et)||R(ir-2*(ee-q),ar,dr,pt,et):Oe=R(ir,ar,dr,pt,et),Ge&&Oe?Fe="inside":(Fe="outside",Mr.remove(),Mr=null)}else Fe="inside";if(!Mr){ze=A.ensureUniformFontSize(Q,Fe==="outside"?Je:rt),Mr=Ce(oe,Qe,ze);var ve=Mr.attr("transform");if(Mr.attr("transform",""),fr=t.bBox(Mr.node()),dr=fr.width,pt=fr.height,Mr.attr("transform",ve),dr<=0||pt<=0){Mr.remove();return}}var ge=qe.textangle,be,Pe;Fe==="outside"?(Pe=qe.constraintext==="both"||qe.constraintext==="outside",be=O(J,$,X,re,fr,{isHorizontal:et,constrained:Pe,angle:ge})):(Pe=qe.constraintext==="both"||qe.constraintext==="inside",be=F(J,$,X,re,fr,{isHorizontal:et,constrained:Pe,angle:ge,anchor:At,hasB:xe,r:ee,overhead:q})),be.fontSize=ze.size,i(qe.type==="histogram"?"bar":qe.type,be,Ae),Xe.transform=be;var We=p(Mr,Ae,ae,ie);A.setTransormAndDisplay(We,be)}function R(Q,ue,oe,le,j){if(Q<0||ue<0)return!1;var J=oe<=Q&&le<=ue,$=oe<=ue&&le<=Q,X=j?Q>=oe*(ue/le):ue>=le*(Q/oe);return J||$||X}function P(Q){return Q==="auto"?0:Q}function z(Q,ue){var oe=Math.PI/180*ue,le=Math.abs(Math.sin(oe)),j=Math.abs(Math.cos(oe));return{x:Q.width*j+Q.height*le,y:Q.width*le+Q.height*j}}function F(Q,ue,oe,le,j,J){var $=!!J.isHorizontal,X=!!J.constrained,re=J.angle||0,ee=J.anchor,q=ee==="end",ae=ee==="start",ie=J.leftToRight||0,fe=(ie+1)/2,we=1-fe,Ae=J.hasB,Fe=J.r,Ce=J.overhead,qe=j.width,et=j.height,Qe=Math.abs(ue-Q),Ke=Math.abs(le-oe),Xe=Qe>2*y&&Ke>2*y?y:0;Qe-=2*Xe,Ke-=2*Xe;var Me=P(re);re==="auto"&&!(qe<=Qe&&et<=Ke)&&(qe>Qe||et>Ke)&&(!(qe>Ke||et>Qe)||qey){var $e=B(Q,ue,oe,le,xe,Fe,Ce,$,Ae);ce=$e.scale,Re=$e.pad}else ce=1,X&&(ce=Math.min(1,Qe/xe.x,Ke/xe.y)),Re=0;var rt=j.left*we+j.right*fe,Je=(j.top+j.bottom)/2,At=(Q+y)*we+(ue-y)*fe,St=(oe+le)/2,Rt=0,Ut=0;if(ae||q){var ir=($?xe.x:xe.y)/2;Fe&&(q||Ae)&&(Xe+=Re);var ar=$?_(Q,ue):_(oe,le);$?ae?(At=Q+ar*Xe,Rt=-ar*ir):(At=ue-ar*Xe,Rt=ar*ir):ae?(St=oe+ar*Xe,Ut=-ar*ir):(St=le-ar*Xe,Ut=ar*ir)}return{textX:rt,textY:Je,targetX:At,targetY:St,anchorX:Rt,anchorY:Ut,scale:ce,rotate:Me}}function B(Q,ue,oe,le,j,J,$,X,re){var ee=Math.max(0,Math.abs(ue-Q)-2*y),q=Math.max(0,Math.abs(le-oe)-2*y),ae=J-y,ie=$?ae-Math.sqrt(ae*ae-(ae-$)*(ae-$)):ae,fe=re?ae*2:X?ae-$:2*ie,we=re?ae*2:X?2*ie:ae-$,Ae,Fe,Ce,qe,et;return j.y/j.x>=q/(ee-fe)?qe=q/j.y:j.y/j.x<=(q-we)/ee?qe=ee/j.x:!re&&X?(Ae=j.x*j.x+j.y*j.y/4,Fe=-2*j.x*(ee-ae)-j.y*(q/2-ae),Ce=(ee-ae)*(ee-ae)+(q/2-ae)*(q/2-ae)-ae*ae,qe=(-Fe+Math.sqrt(Fe*Fe-4*Ae*Ce))/(2*Ae)):re?(Ae=(j.x*j.x+j.y*j.y)/4,Fe=-j.x*(ee/2-ae)-j.y*(q/2-ae),Ce=(ee/2-ae)*(ee/2-ae)+(q/2-ae)*(q/2-ae)-ae*ae,qe=(-Fe+Math.sqrt(Fe*Fe-4*Ae*Ce))/(2*Ae)):(Ae=j.x*j.x/4+j.y*j.y,Fe=-j.x*(ee/2-ae)-2*j.y*(q-ae),Ce=(ee/2-ae)*(ee/2-ae)+(q-ae)*(q-ae)-ae*ae,qe=(-Fe+Math.sqrt(Fe*Fe-4*Ae*Ce))/(2*Ae)),qe=Math.min(1,qe),X?et=Math.max(0,ae-Math.sqrt(Math.max(0,ae*ae-(ae-(q-j.y*qe)/2)*(ae-(q-j.y*qe)/2)))-$):et=Math.max(0,ae-Math.sqrt(Math.max(0,ae*ae-(ae-(ee-j.x*qe)/2)*(ae-(ee-j.x*qe)/2)))-$),{scale:qe,pad:et}}function O(Q,ue,oe,le,j,J){var $=!!J.isHorizontal,X=!!J.constrained,re=J.angle||0,ee=j.width,q=j.height,ae=Math.abs(ue-Q),ie=Math.abs(le-oe),fe;$?fe=ie>2*y?y:0:fe=ae>2*y?y:0;var we=1;X&&(we=$?Math.min(1,ie/q):Math.min(1,ae/ee));var Ae=P(re),Fe=z(j,Ae),Ce=($?Fe.x:Fe.y)/2,qe=(j.left+j.right)/2,et=(j.top+j.bottom)/2,Qe=(Q+ue)/2,Ke=(oe+le)/2,Xe=0,Me=0,xe=$?_(ue,Q):_(oe,le);return $?(Qe=ue-xe*fe,Xe=xe*Ce):(Ke=le+xe*fe,Me=-xe*Ce),{textX:qe,textY:et,targetX:Qe,targetY:Ke,anchorX:Xe,anchorY:Me,scale:we,rotate:Ae}}function L(Q,ue,oe,le,j){var J=ue[0].trace,$=J.texttemplate,X;return $?X=U(Q,ue,oe,le,j):J.textinfo?X=Z(ue,oe,le,j):X=c.getValue(J.text,oe),c.coerceString(h,X)}function N(Q,ue){var oe=c.getValue(Q.textposition,ue);return c.coerceEnumerated(T,oe)}function U(Q,ue,oe,le,j){var J=ue[0].trace,$=A.castOption(J,oe,"texttemplate");if(!$)return"";var X=J.type==="histogram",re=J.type==="waterfall",ee=J.type==="funnel",q=J.orientation==="h",ae,ie,fe,we;q?(ae="y",ie=j,fe="x",we=le):(ae="x",ie=le,fe="y",we=j);function Ae(Xe){return o(ie,ie.c2l(Xe),!0).text}function Fe(Xe){return o(we,we.c2l(Xe),!0).text}var Ce=ue[oe],qe={};qe.label=Ce.p,qe.labelLabel=qe[ae+"Label"]=Ae(Ce.p);var et=A.castOption(J,Ce.i,"text");(et===0||et)&&(qe.text=et),qe.value=Ce.s,qe.valueLabel=qe[fe+"Label"]=Fe(Ce.s);var Qe={};l(Qe,J,Ce.i),(X||Qe.x===void 0)&&(Qe.x=q?qe.value:qe.label),(X||Qe.y===void 0)&&(Qe.y=q?qe.label:qe.value),(X||Qe.xLabel===void 0)&&(Qe.xLabel=q?qe.valueLabel:qe.labelLabel),(X||Qe.yLabel===void 0)&&(Qe.yLabel=q?qe.labelLabel:qe.valueLabel),re&&(qe.delta=+Ce.rawS||Ce.s,qe.deltaLabel=Fe(qe.delta),qe.final=Ce.v,qe.finalLabel=Fe(qe.final),qe.initial=qe.final-qe.delta,qe.initialLabel=Fe(qe.initial)),ee&&(qe.value=Ce.s,qe.valueLabel=Fe(qe.value),qe.percentInitial=Ce.begR,qe.percentInitialLabel=A.formatPercent(Ce.begR),qe.percentPrevious=Ce.difR,qe.percentPreviousLabel=A.formatPercent(Ce.difR),qe.percentTotal=Ce.sumR,qe.percenTotalLabel=A.formatPercent(Ce.sumR));var Ke=A.castOption(J,Ce.i,"customdata");return Ke&&(qe.customdata=Ke),A.texttemplateString($,qe,Q._d3locale,Qe,qe,J._meta||{})}function Z(Q,ue,oe,le){var j=Q[0].trace,J=j.orientation==="h",$=j.type==="waterfall",X=j.type==="funnel";function re(Ke){var Xe=J?le:oe;return o(Xe,Ke,!0).text}function ee(Ke){var Xe=J?oe:le;return o(Xe,+Ke,!0).text}var q=j.textinfo,ae=Q[ue],ie=q.split("+"),fe=[],we,Ae=function(Ke){return ie.indexOf(Ke)!==-1};if(Ae("label")&&fe.push(re(Q[ue].p)),Ae("text")&&(we=A.castOption(j,ae.i,"text"),(we===0||we)&&fe.push(we)),$){var Fe=+ae.rawS||ae.s,Ce=ae.v,qe=Ce-Fe;Ae("initial")&&fe.push(ee(qe)),Ae("delta")&&fe.push(ee(Fe)),Ae("final")&&fe.push(ee(Ce))}if(X){Ae("value")&&fe.push(ee(ae.s));var et=0;Ae("percent initial")&&et++,Ae("percent previous")&&et++,Ae("percent total")&&et++;var Qe=et>1;Ae("percent initial")&&(we=A.formatPercent(ae.begR),Qe&&(we+=" of initial"),fe.push(we)),Ae("percent previous")&&(we=A.formatPercent(ae.difR),Qe&&(we+=" of previous"),fe.push(we)),Ae("percent total")&&(we=A.formatPercent(ae.sumR),Qe&&(we+=" of total"),fe.push(we))}return fe.join("
")}G.exports={plot:g,toMoveInsideBar:F}}}),Z0=He({"src/traces/bar/hover.js"(Y,G){var d=Wu(),x=Ei(),A=Ai(),E=Gr().fillText,e=S1().getLineWidth,t=io().hoverLabelText,r=lo().BADNUM;function o(n,s,c,f,v){var h=a(n,s,c,f,v);if(h){var T=h.cd,l=T[0].trace,y=T[h.index];return h.color=i(l,y),x.getComponentMethod("errorbars","hoverInfo")(y,l,h),[h]}}function a(n,s,c,f,v){var h=n.cd,T=h[0].trace,l=h[0].t,y=f==="closest",b=T.type==="waterfall",S=n.maxHoverDistance,M=n.maxSpikeDistance,_,w,p,u,g,m,R;T.orientation==="h"?(_=c,w=s,p="y",u="x",g=le,m=Q):(_=s,w=c,p="x",u="y",m=le,g=Q);var P=T[p+"period"],z=y||P;function F(we){return O(we,-1)}function B(we){return O(we,1)}function O(we,Ae){var Fe=we.w;return we[p]+Ae*Fe/2}function L(we){return we[p+"End"]-we[p+"Start"]}var N=y?F:P?function(we){return we.p-L(we)/2}:function(we){return Math.min(F(we),we.p-l.bardelta/2)},U=y?B:P?function(we){return we.p+L(we)/2}:function(we){return Math.max(B(we),we.p+l.bardelta/2)};function Z(we,Ae,Fe){return v.finiteRange&&(Fe=0),d.inbox(we-_,Ae-_,Fe+Math.min(1,Math.abs(Ae-we)/R)-1)}function Q(we){return Z(N(we),U(we),S)}function ue(we){return Z(F(we),B(we),M)}function oe(we){var Ae=we[u];if(b){var Fe=Math.abs(we.rawS)||0;w>0?Ae+=Fe:w<0&&(Ae-=Fe)}return Ae}function le(we){var Ae=w,Fe=we.b,Ce=oe(we);return d.inbox(Fe-Ae,Ce-Ae,S+(Ce-Ae)/(Ce-Fe)-1)}function j(we){var Ae=w,Fe=we.b,Ce=oe(we);return d.inbox(Fe-Ae,Ce-Ae,M+(Ce-Ae)/(Ce-Fe)-1)}var J=n[p+"a"],$=n[u+"a"];R=Math.abs(J.r2c(J.range[1])-J.r2c(J.range[0]));function X(we){return(g(we)+m(we))/2}var re=d.getDistanceFunction(f,g,m,X);if(d.getClosest(h,re,n),n.index!==!1&&h[n.index].p!==r){z||(N=function(we){return Math.min(F(we),we.p-l.bargroupwidth/2)},U=function(we){return Math.max(B(we),we.p+l.bargroupwidth/2)});var ee=n.index,q=h[ee],ae=T.base?q.b+q.s:q.s;n[u+"0"]=n[u+"1"]=$.c2p(q[u],!0),n[u+"LabelVal"]=ae;var ie=l.extents[l.extents.round(q.p)];n[p+"0"]=J.c2p(y?N(q):ie[0],!0),n[p+"1"]=J.c2p(y?U(q):ie[1],!0);var fe=q.orig_p!==void 0;return n[p+"LabelVal"]=fe?q.orig_p:q.p,n.labelLabel=t(J,n[p+"LabelVal"],T[p+"hoverformat"]),n.valueLabel=t($,n[u+"LabelVal"],T[u+"hoverformat"]),n.baseLabel=t($,q.b,T[u+"hoverformat"]),n.spikeDistance=(j(q)+ue(q))/2,n[p+"Spike"]=J.c2p(q.p,!0),E(q,T,n),n.hovertemplate=T.hovertemplate,n}}function i(n,s){var c=s.mcc||n.marker.color,f=s.mlcc||n.marker.line.color,v=e(n,s);if(A.opacity(c))return c;if(A.opacity(f)&&v)return f}G.exports={hoverPoints:o,hoverOnBars:a,getTraceColor:i}}}),j5=He({"src/traces/bar/event_data.js"(Y,G){G.exports=function(x,A,E){return x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),E.orientation==="h"?(x.label=x.y,x.value=x.x):(x.label=x.x,x.value=x.y),x}}}),X0=He({"src/traces/bar/select.js"(Y,G){G.exports=function(A,E){var e=A.cd,t=A.xaxis,r=A.yaxis,o=e[0].trace,a=o.type==="funnel",i=o.orientation==="h",n=[],s;if(E===!1)for(s=0;s0?(P="v",p>0?z=Math.min(g,u):z=Math.min(u)):p>0?(P="h",z=Math.min(g)):z=0;if(!z){c.visible=!1;return}c._length=z;var N=f("orientation",P);c._hasPreCompStats?N==="v"&&p===0?(f("x0",0),f("dx",1)):N==="h"&&w===0&&(f("y0",0),f("dy",1)):N==="v"&&p===0?f("x0"):N==="h"&&w===0&&f("y0");var U=x.getComponentMethod("calendars","handleTraceDefaults");U(s,c,["x","y"],v)}function i(s,c,f,v){var h=v.prefix,T=d.coerce2(s,c,r,"marker.outliercolor"),l=f("marker.line.outliercolor"),y="outliers";c._hasPreCompStats?y="all":(T||l)&&(y="suspectedoutliers");var b=f(h+"points",y);b?(f("jitter",b==="all"?.3:0),f("pointpos",b==="all"?-1.5:0),f("marker.symbol"),f("marker.opacity"),f("marker.size"),f("marker.angle"),f("marker.color",c.line.color),f("marker.line.color"),f("marker.line.width"),b==="suspectedoutliers"&&(f("marker.line.outliercolor",c.marker.color),f("marker.line.outlierwidth")),f("selected.marker.color"),f("unselected.marker.color"),f("selected.marker.size"),f("unselected.marker.size"),f("text"),f("hovertext")):delete c.marker;var S=f("hoveron");(S==="all"||S.indexOf("points")!==-1)&&f("hovertemplate"),d.coerceSelectionMarkerOpacity(c,f)}function n(s,c){var f,v;function h(b){return d.coerce(v._input,v,r,b)}for(var T=0;Toe.uf};if(M._hasPreCompStats){var ee=M[z],q=function(ar){return P.d2c((M[ar]||[])[m])},ae=1/0,ie=-1/0;for(m=0;m=oe.q1&&oe.q3>=oe.med){var we=q("lowerfence");oe.lf=we!==e&&we<=oe.q1?we:v(oe,j,J);var Ae=q("upperfence");oe.uf=Ae!==e&&Ae>=oe.q3?Ae:h(oe,j,J);var Fe=q("mean");oe.mean=Fe!==e?Fe:J?E.mean(j,J):(oe.q1+oe.q3)/2;var Ce=q("sd");oe.sd=Fe!==e&&Ce>=0?Ce:J?E.stdev(j,J,oe.mean):oe.q3-oe.q1,oe.lo=T(oe),oe.uo=l(oe);var qe=q("notchspan");qe=qe!==e&&qe>0?qe:y(oe,J),oe.ln=oe.med-qe,oe.un=oe.med+qe;var et=oe.lf,Qe=oe.uf;M.boxpoints&&j.length&&(et=Math.min(et,j[0]),Qe=Math.max(Qe,j[J-1])),M.notched&&(et=Math.min(et,oe.ln),Qe=Math.max(Qe,oe.un)),oe.min=et,oe.max=Qe}else{E.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+oe.q1,"median = "+oe.med,"q3 = "+oe.q3].join(` +`));var Ke;oe.med!==e?Ke=oe.med:oe.q1!==e?oe.q3!==e?Ke=(oe.q1+oe.q3)/2:Ke=oe.q1:oe.q3!==e?Ke=oe.q3:Ke=0,oe.med=Ke,oe.q1=oe.q3=Ke,oe.lf=oe.uf=Ke,oe.mean=oe.sd=Ke,oe.ln=oe.un=Ke,oe.min=oe.max=Ke}ae=Math.min(ae,oe.min),ie=Math.max(ie,oe.max),oe.pts2=le.filter(re),u.push(oe)}}M._extremes[P._id]=x.findExtremes(P,[ae,ie],{padded:!0})}else{var Xe=P.makeCalcdata(M,z),Me=o(Q,ue),xe=Q.length,ce=a(xe);for(m=0;m=0&&Re0){if(oe={},oe.pos=oe[B]=Q[m],le=oe.pts=ce[m].sort(c),j=oe[z]=le.map(f),J=j.length,oe.min=j[0],oe.max=j[J-1],oe.mean=E.mean(j,J),oe.sd=E.stdev(j,J,oe.mean)*M.sdmultiple,oe.med=E.interp(j,.5),J%2&&(At||St)){var Rt,Ut;At?(Rt=j.slice(0,J/2),Ut=j.slice(J/2+1)):St&&(Rt=j.slice(0,J/2+1),Ut=j.slice(J/2)),oe.q1=E.interp(Rt,.5),oe.q3=E.interp(Ut,.5)}else oe.q1=E.interp(j,.25),oe.q3=E.interp(j,.75);oe.lf=v(oe,j,J),oe.uf=h(oe,j,J),oe.lo=T(oe),oe.uo=l(oe);var ir=y(oe,J);oe.ln=oe.med-ir,oe.un=oe.med+ir,$e=Math.min($e,oe.ln),rt=Math.max(rt,oe.un),oe.pts2=le.filter(re),u.push(oe)}M.notched&&E.isTypedArray(Xe)&&(Xe=Array.from(Xe)),M._extremes[P._id]=x.findExtremes(P,M.notched?Xe.concat([$e,rt]):Xe,{padded:!0})}return s(u,M),u.length>0?(u[0].t={num:_[g],dPos:ue,posLetter:B,valLetter:z,labels:{med:t(S,"median:"),min:t(S,"min:"),q1:t(S,"q1:"),q3:t(S,"q3:"),max:t(S,"max:"),mean:M.boxmean==="sd"||M.sizemode==="sd"?t(S,"mean ± σ:").replace("σ",M.sdmultiple===1?"σ":M.sdmultiple+"σ"):t(S,"mean:"),lf:t(S,"lower fence:"),uf:t(S,"upper fence:")}},_[g]++,u):[{t:{empty:!0}}]};function r(b,S,M,_){var w=S in b,p=S+"0"in b,u="d"+S in b;if(w||p&&u){var g=M.makeCalcdata(b,S),m=A(b,M,S,g).vals;return[m,g]}var R;p?R=b[S+"0"]:"name"in b&&(M.type==="category"||d(b.name)&&["linear","log"].indexOf(M.type)!==-1||E.isDateTime(b.name)&&M.type==="date")?R=b.name:R=_;for(var P=M.type==="multicategory"?M.r2c_just_indices(R):M.d2c(R,0,b[S+"calendar"]),z=b._length,F=new Array(z),B=0;B1,p=1-s[r+"gap"],u=1-s[r+"groupgap"];for(v=0;v0;if(P==="positive"?(oe=z*(R?1:.5),J=j,le=J=B):P==="negative"?(oe=J=B,le=z*(R?1:.5),$=j):(oe=le=z,J=$=j),ie){var fe=g.pointpos,we=g.jitter,Ae=g.marker.size/2,Fe=0;fe+we>=0&&(Fe=j*(fe+we),Fe>oe?(ae=!0,ee=Ae,X=Fe):Fe>J&&(ee=Ae,X=oe)),Fe<=oe&&(X=oe);var Ce=0;fe-we<=0&&(Ce=-j*(fe-we),Ce>le?(ae=!0,q=Ae,re=Ce):Ce>$&&(q=Ae,re=le)),Ce<=le&&(re=le)}else X=oe,re=le;var qe=new Array(T.length);for(h=0;hM.lo&&(N.so=!0)}return w});S.enter().append("path").classed("point",!0),S.exit().remove(),S.call(A.translatePoints,f,v)}function a(i,n,s,c){var f=n.val,v=n.pos,h=!!v.rangebreaks,T=c.bPos,l=c.bPosPxOffset||0,y=s.boxmean||(s.meanline||{}).visible,b,S;Array.isArray(c.bdPos)?(b=c.bdPos[0],S=c.bdPos[1]):(b=c.bdPos,S=c.bdPos);var M=i.selectAll("path.mean").data(s.type==="box"&&s.boxmean||s.type==="violin"&&s.box.visible&&s.meanline.visible?x.identity:[]);M.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),M.exit().remove(),M.each(function(_){var w=v.c2l(_.pos+T,!0),p=v.l2p(w-b)+l,u=v.l2p(w+S)+l,g=h?(p+u)/2:v.l2p(w)+l,m=f.c2p(_.mean,!0),R=f.c2p(_.mean-_.sd,!0),P=f.c2p(_.mean+_.sd,!0);s.orientation==="h"?d.select(this).attr("d","M"+m+","+p+"V"+u+(y==="sd"?"m0,0L"+R+","+g+"L"+m+","+p+"L"+P+","+g+"Z":"")):d.select(this).attr("d","M"+p+","+m+"H"+u+(y==="sd"?"m0,0L"+g+","+R+"L"+p+","+m+"L"+g+","+P+"Z":""))})}G.exports={plot:t,plotBoxAndWhiskers:r,plotPoints:o,plotBoxMean:a}}}),C1=He({"src/traces/box/style.js"(Y,G){var d=Qn(),x=Ai(),A=vo();function E(t,r,o){var a=o||d.select(t).selectAll("g.trace.boxes");a.style("opacity",function(i){return i[0].trace.opacity}),a.each(function(i){var n=d.select(this),s=i[0].trace,c=s.line.width;function f(T,l,y,b){T.style("stroke-width",l+"px").call(x.stroke,y).call(x.fill,b)}var v=n.selectAll("path.box");if(s.type==="candlestick")v.each(function(T){if(!T.empty){var l=d.select(this),y=s[T.dir];f(l,y.line.width,y.line.color,y.fillcolor),l.style("opacity",s.selectedpoints&&!T.selected?.3:1)}});else{f(v,c,s.line.color,s.fillcolor),n.selectAll("path.mean").style({"stroke-width":c,"stroke-dasharray":2*c+"px,"+c+"px"}).call(x.stroke,s.line.color);var h=n.selectAll("path.point");A.pointStyle(h,s,t)}})}function e(t,r,o){var a=r[0].trace,i=o.selectAll("path.point");a.selectedpoints?A.selectedPointStyle(i,a):A.pointStyle(i,a,t)}G.exports={style:E,styleOnSelect:e}}}),hw=He({"src/traces/box/hover.js"(Y,G){var d=io(),x=Gr(),A=Wu(),E=Ai(),e=x.fillText;function t(a,i,n,s){var c=a.cd,f=c[0].trace,v=f.hoveron,h=[],T;return v.indexOf("boxes")!==-1&&(h=h.concat(r(a,i,n,s))),v.indexOf("points")!==-1&&(T=o(a,i,n)),s==="closest"?T?[T]:h:(T&&h.push(T),h)}function r(a,i,n,s){var c=a.cd,f=a.xa,v=a.ya,h=c[0].trace,T=c[0].t,l=h.type==="violin",y,b,S,M,_,w,p,u,g,m,R,P=T.bdPos,z,F,B=T.wHover,O=function(Ce){return S.c2l(Ce.pos)+T.bPos-S.c2l(w)};l&&h.side!=="both"?(h.side==="positive"&&(g=function(Ce){var qe=O(Ce);return A.inbox(qe,qe+B,m)},z=P,F=0),h.side==="negative"&&(g=function(Ce){var qe=O(Ce);return A.inbox(qe-B,qe,m)},z=0,F=P)):(g=function(Ce){var qe=O(Ce);return A.inbox(qe-B,qe+B,m)},z=F=P);var L;l?L=function(Ce){return A.inbox(Ce.span[0]-_,Ce.span[1]-_,m)}:L=function(Ce){return A.inbox(Ce.min-_,Ce.max-_,m)},h.orientation==="h"?(_=i,w=n,p=L,u=g,y="y",S=v,b="x",M=f):(_=n,w=i,p=g,u=L,y="x",S=f,b="y",M=v);var N=Math.min(1,P/Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0])));m=a.maxHoverDistance-N,R=a.maxSpikeDistance-N;function U(Ce){return(p(Ce)+u(Ce))/2}var Z=A.getDistanceFunction(s,p,u,U);if(A.getClosest(c,Z,a),a.index===!1)return[];var Q=c[a.index],ue=h.line.color,oe=(h.marker||{}).color;E.opacity(ue)&&h.line.width?a.color=ue:E.opacity(oe)&&h.boxpoints?a.color=oe:a.color=h.fillcolor,a[y+"0"]=S.c2p(Q.pos+T.bPos-F,!0),a[y+"1"]=S.c2p(Q.pos+T.bPos+z,!0),a[y+"LabelVal"]=Q.orig_p!==void 0?Q.orig_p:Q.pos;var le=y+"Spike";a.spikeDistance=U(Q)*R/m,a[le]=S.c2p(Q.pos,!0);var j=h.boxmean||h.sizemode==="sd"||(h.meanline||{}).visible,J=h.boxpoints||h.points,$=J&&j?["max","uf","q3","med","mean","q1","lf","min"]:J&&!j?["max","uf","q3","med","q1","lf","min"]:!J&&j?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],X=M.range[1]0&&(o=!0);for(var s=0;st){var r=t-E[x];return E[x]=t,r}}else return E[x]=t,t;return 0},max:function(x,A,E,e){var t=e[A];if(d(t))if(t=Number(t),d(E[x])){if(E[x]p&&pE){var m=u===x?1:6,R=u===x?"M12":"M1";return function(P,z){var F=T.c2d(P,x,l),B=F.indexOf("-",m);B>0&&(F=F.substr(0,B));var O=T.d2c(F,0,l);if(Or?c>E?c>x*1.1?x:c>A*1.1?A:E:c>e?e:c>t?t:r:Math.pow(10,Math.floor(Math.log(c)/Math.LN10))}function n(c,f,v,h,T,l){if(h&&c>E){var y=s(f,T,l),b=s(v,T,l),S=c===x?0:1;return y[S]!==b[S]}return Math.floor(v/c)-Math.floor(f/c)>.1}function s(c,f,v){var h=f.c2d(c,x,v).split("-");return h[0]===""&&(h.unshift(),h[0]="-"+h[0]),h}}}),_w=He({"src/traces/histogram/calc.js"(Y,G){var d=Hi(),x=Gr(),A=Ei(),E=io(),e=oy(),t=pw(),r=gw(),o=yw(),a=mw();function i(v,h){var T=[],l=[],y=h.orientation==="h",b=E.getFromId(v,y?h.yaxis:h.xaxis),S=y?"y":"x",M={x:"y",y:"x"}[S],_=h[S+"calendar"],w=h.cumulative,p,u=n(v,h,b,S),g=u[0],m=u[1],R=typeof g.size=="string",P=[],z=R?P:g,F=[],B=[],O=[],L=0,N=h.histnorm,U=h.histfunc,Z=N.indexOf("density")!==-1,Q,ue,oe;w.enabled&&Z&&(N=N.replace(/ ?density$/,""),Z=!1);var le=U==="max"||U==="min",j=le?null:0,J=t.count,$=r[N],X=!1,re=function(xe){return b.r2c(xe,0,_)},ee;for(x.isArrayOrTypedArray(h[M])&&U!=="count"&&(ee=h[M],X=U==="avg",J=t[U]),p=re(g.start),ue=re(g.end)+(p-E.tickIncrement(p,g.size,!1,_))/1e6;p=0&&oe=Ke;p--)if(l[p]){Xe=p;break}for(p=Ke;p<=Xe;p++)if(d(T[p])&&d(l[p])){var Me={p:T[p],s:l[p],b:0};w.enabled||(Me.pts=O[p],fe?Me.ph0=Me.ph1=O[p].length?m[O[p][0]]:T[p]:(h._computePh=!0,Me.ph0=qe(P[p]),Me.ph1=qe(P[p+1],!0))),Qe.push(Me)}return Qe.length===1&&(Qe[0].width1=E.tickIncrement(Qe[0].p,g.size,!1,_)-Qe[0].p),e(Qe,h),x.isArrayOrTypedArray(h.selectedpoints)&&x.tagSelected(Qe,h,Fe),Qe}function n(v,h,T,l,y){var b=l+"bins",S=v._fullLayout,M=h["_"+l+"bingroup"],_=S._histogramBinOpts[M],w=S.barmode==="overlay",p,u,g,m,R,P,z,F=function(Ce){return T.r2c(Ce,0,m)},B=function(Ce){return T.c2r(Ce,0,m)},O=T.type==="date"?function(Ce){return Ce||Ce===0?x.cleanDate(Ce,null,m):null}:function(Ce){return d(Ce)?Number(Ce):null};function L(Ce,qe,et){qe[Ce+"Found"]?(qe[Ce]=O(qe[Ce]),qe[Ce]===null&&(qe[Ce]=et[Ce])):(P[Ce]=qe[Ce]=et[Ce],x.nestedProperty(u[0],b+"."+Ce).set(et[Ce]))}if(h["_"+l+"autoBinFinished"])delete h["_"+l+"autoBinFinished"];else{u=_.traces;var N=[],U=!0,Z=!1,Q=!1;for(p=0;p"u"){if(y)return[oe,R,!0];oe=s(v,h,T,l,b)}z=g.cumulative||{},z.enabled&&z.currentbin!=="include"&&(z.direction==="decreasing"?oe.start=B(E.tickIncrement(F(oe.start),oe.size,!0,m)):oe.end=B(E.tickIncrement(F(oe.end),oe.size,!1,m))),_.size=oe.size,_.sizeFound||(P.size=oe.size,x.nestedProperty(u[0],b+".size").set(oe.size)),L("start",_,oe),L("end",_,oe)}R=h["_"+l+"pos0"],delete h["_"+l+"pos0"];var j=h._input[b]||{},J=x.extendFlat({},_),$=_.start,X=T.r2l(j.start),re=X!==void 0;if((_.startFound||re)&&X!==T.r2l($)){var ee=re?X:x.aggNums(Math.min,null,R),q={type:T.type==="category"||T.type==="multicategory"?"linear":T.type,r2l:T.r2l,dtick:_.size,tick0:$,calendar:m,range:[ee,E.tickIncrement(ee,_.size,!1,m)].map(T.l2r)},ae=E.tickFirst(q);ae>T.r2l(ee)&&(ae=E.tickIncrement(ae,_.size,!0,m)),J.start=T.l2r(ae),re||x.nestedProperty(h,b+".start").set(J.start)}var ie=_.end,fe=T.r2l(j.end),we=fe!==void 0;if((_.endFound||we)&&fe!==T.r2l(ie)){var Ae=we?fe:x.aggNums(Math.max,null,R);J.end=T.l2r(Ae),we||x.nestedProperty(h,b+".start").set(J.end)}var Fe="autobin"+l;return h._input[Fe]===!1&&(h._input[b]=x.extendFlat({},h[b]||{}),delete h._input[Fe],delete h[Fe]),[J,R]}function s(v,h,T,l,y){var b=v._fullLayout,S=c(v,h),M=!1,_=1/0,w=[h],p,u,g;for(p=0;p=0;l--)M(l);else if(h==="increasing"){for(l=1;l=0;l--)v[l]+=v[l+1];T==="exclude"&&(v.push(0),v.shift())}}G.exports={calc:i,calcAllAutoBins:n}}}),X5=He({"src/traces/histogram2d/calc.js"(Y,G){var d=Gr(),x=io(),A=pw(),E=gw(),e=yw(),t=mw(),r=_w().calcAllAutoBins;G.exports=function(s,c){var f=x.getFromId(s,c.xaxis),v=x.getFromId(s,c.yaxis),h=c.xcalendar,T=c.ycalendar,l=function(ze){return f.r2c(ze,0,h)},y=function(ze){return v.r2c(ze,0,T)},b=function(ze){return f.c2r(ze,0,h)},S=function(ze){return v.c2r(ze,0,T)},M,_,w,p,u=r(s,c,f,"x"),g=u[0],m=u[1],R=r(s,c,v,"y"),P=R[0],z=R[1],F=c._length;m.length>F&&m.splice(F,m.length-F),z.length>F&&z.splice(F,z.length-F);var B=[],O=[],L=[],N=typeof g.size=="string",U=typeof P.size=="string",Z=[],Q=[],ue=N?Z:g,oe=U?Q:P,le=0,j=[],J=[],$=c.histnorm,X=c.histfunc,re=$.indexOf("density")!==-1,ee=X==="max"||X==="min",q=ee?null:0,ae=A.count,ie=E[$],fe=!1,we=[],Ae=[],Fe="z"in c?c.z:"marker"in c&&Array.isArray(c.marker.color)?c.marker.color:"";Fe&&X!=="count"&&(fe=X==="avg",ae=A[X]);var Ce=g.size,qe=l(g.start),et=l(g.end)+(qe-x.tickIncrement(qe,Ce,!1,h))/1e6;for(M=qe;M=0&&w=0&&p<$e&&(le+=ae(w,M,B[p],Fe,j[p]),J[p][w].push(M),At&&(Rt[w]===void 0?Rt[w]=dr:Rt[w]!==dr&&(At=!1)),St&&(Ut[p]===void 0?Ut[p]=pt:Ut[p]!==pt&&(St=!1)),ir=Math.min(ir,dr-Z[w]),ar=Math.min(ar,Z[w+1]-dr),Mr=Math.min(Mr,pt-Q[p]),fr=Math.min(fr,Q[p+1]-pt))}if(fe)for(p=0;p<$e;p++)le+=e(B[p],j[p]);if(ie)for(p=0;p<$e;p++)ie(B[p],le,we,Ae[p]);return{x:m,xRanges:i(Z,At&&Rt,ir,ar,f,h),x0:Xe,dx:Ke,y:z,yRanges:i(Q,St&&Ut,Mr,fr,v,T),y0:Je,dy:rt,z:B,pts:J}};function o(n,s,c,f){var v=new Array(n),h;if(f)for(h=0;hx;i++)a=e(r,o,E(a));return a>x&&d.log("interp2d didn't converge quickly",a),r};function e(t,r,o){var a=0,i,n,s,c,f,v,h,T,l,y,b,S,M;for(c=0;cS&&(a=Math.max(a,Math.abs(t[n][s]-b)/(M-S))))}return a}}}),D1=He({"src/traces/heatmap/find_empties.js"(Y,G){var d=Gr().maxRowLength;G.exports=function(A){var E=[],e={},t=[],r=A[0],o=[],a=[0,0,0],i=d(A),n,s,c,f,v,h,T,l;for(s=0;s=0;v--)f=t[v],s=f[0],c=f[1],h=((e[[s-1,c]]||a)[2]+(e[[s+1,c]]||a)[2]+(e[[s,c-1]]||a)[2]+(e[[s,c+1]]||a)[2])/20,h&&(T[f]=[s,c,h],t.splice(v,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(f in T)e[f]=T[f],E.push(T[f])}return E.sort(function(y,b){return b[2]-y[2]})}}}),xw=He({"src/traces/heatmap/make_bound_array.js"(Y,G){var d=Ei(),x=Gr().isArrayOrTypedArray;G.exports=function(E,e,t,r,o,a){var i=[],n=d.traceIs(E,"contour"),s=d.traceIs(E,"histogram"),c,f,v,h=x(e)&&e.length>1;if(h&&!s&&a.type!=="category"){var T=e.length;if(T<=o){if(n)i=Array.from(e).slice(0,o);else if(o===1)a.type==="log"?i=[.5*e[0],2*e[0]]:i=[e[0]-.5,e[0]+.5];else if(a.type==="log"){for(i=[Math.pow(e[0],1.5)/Math.pow(e[1],.5)],v=1;v1){var $=(J[J.length-1]-J[0])/(J.length-1),X=Math.abs($/100);for(F=0;FX)return!1}return!0}T._islinear=!1,l.type==="log"||y.type==="log"?M==="fast"&&L("log axis found"):N(_)?N(g)?T._islinear=!0:M==="fast"&&L("y scale is not linear"):M==="fast"&&L("x scale is not linear");var U=x.maxRowLength(z),Z=T.xtype==="scaled"?"":_,Q=n(T,Z,w,p,U,l),ue=T.ytype==="scaled"?"":g,oe=n(T,ue,m,R,z.length,y);T._extremes[l._id]=A.findExtremes(l,Q),T._extremes[y._id]=A.findExtremes(y,oe);var le={x:Q,y:oe,z,text:T._text||T.text,hovertext:T._hovertext||T.hovertext};if(T.xperiodalignment&&u&&(le.orig_x=u),T.yperiodalignment&&P&&(le.orig_y=P),Z&&Z.length===Q.length-1&&(le.xCenter=Z),ue&&ue.length===oe.length-1&&(le.yCenter=ue),S&&(le.xRanges=B.xRanges,le.yRanges=B.yRanges,le.pts=B.pts),b||t(h,T,{vals:z,cLetter:"z"}),b&&T.contours&&T.contours.coloring==="heatmap"){var j={type:T.type==="contour"?"heatmap":"histogram2d",xcalendar:T.xcalendar,ycalendar:T.ycalendar};le.xfill=n(j,Z,w,p,U,l),le.yfill=n(j,ue,m,R,z.length,y)}return[le]};function c(v){for(var h=[],T=v.length,l=0;l0;)re=g.c2p(N[ie]),ie--;for(re0;)ae=m.c2p(U[ie]),ie--;ae=g._length||re<=0||q>=m._length||ae<=0;if(et){var Qe=P.selectAll("image").data([]);Qe.exit().remove(),y(P);return}var Ke,Xe;Ae==="fast"?(Ke=j,Xe=le):(Ke=Ce,Xe=qe);var Me=document.createElement("canvas");Me.width=Ke,Me.height=Xe;var xe=Me.getContext("2d",{willReadFrequently:!0}),ce=n(F,{noNumericCheck:!0,returnArray:!0}),Re,$e;Ae==="fast"?(Re=J?function(pa){return j-1-pa}:t.identity,$e=$?function(pa){return le-1-pa}:t.identity):(Re=function(pa){return t.constrain(Math.round(g.c2p(N[pa])-X),0,Ce)},$e=function(pa){return t.constrain(Math.round(m.c2p(U[pa])-q),0,qe)});var rt=$e(0),Je=[rt,rt],At=J?0:1,St=$?0:1,Rt=0,Ut=0,ir=0,ar=0,Mr,fr,dr,pt,ze;function Ge(pa,pn){if(pa!==void 0){var Ga=ce(pa);return Ga[0]=Math.round(Ga[0]),Ga[1]=Math.round(Ga[1]),Ga[2]=Math.round(Ga[2]),Rt+=pn,Ut+=Ga[0]*pn,ir+=Ga[1]*pn,ar+=Ga[2]*pn,Ga}return[0,0,0,0]}function Oe(pa,pn,Ga,qn){var Vn=pa[Ga.bin0];if(Vn===void 0)return Ge(void 0,1);var di=pa[Ga.bin1],yi=pn[Ga.bin0],Ci=pn[Ga.bin1],ci=di-Vn||0,ei=yi-Vn||0,mi;return di===void 0?Ci===void 0?mi=0:yi===void 0?mi=2*(Ci-Vn):mi=(2*Ci-yi-Vn)*2/3:Ci===void 0?yi===void 0?mi=0:mi=(2*Vn-di-yi)*2/3:yi===void 0?mi=(2*Ci-di-Vn)*2/3:mi=Ci+Vn-di-yi,Ge(Vn+Ga.frac*ci+qn.frac*(ei+Ga.frac*mi))}if(Ae!=="default"){var ve=0,ge;try{ge=new Uint8Array(Ke*Xe*4)}catch{ge=new Array(Ke*Xe*4)}if(Ae==="smooth"){var be=Z||N,Pe=Q||U,We=new Array(be.length),ct=new Array(Pe.length),_t=new Array(Ce),Mt=Z?S:b,Nt=Q?S:b,Bt,qt,Zt;for(ie=0;ieAa||Aa>m._length))for(fe=Br;fesa||sa>g._length)){var Oa=o({x:Pa,y:ga},F,_._fullLayout);Oa.x=Pa,Oa.y=ga;var dt=z.z[ie][fe];dt===void 0?(Oa.z="",Oa.zLabel=""):(Oa.z=dt,Oa.zLabel=e.tickText(Vt,dt,"hover").text);var vt=z.text&&z.text[ie]&&z.text[ie][fe];(vt===void 0||vt===!1)&&(vt=""),Oa.text=vt;var Lr=t.texttemplateString(La,Oa,_._fullLayout._d3locale,Oa,F._meta||{});if(Lr){var Er=Lr.split("
"),_r=Er.length,yr=0;for(we=0;we<_r;we++)yr=Math.max(yr,Er[we].length);Ur.push({l:_r,c:yr,t:Lr,x:sa,y:Aa,z:dt})}}}}var kr=F.textfont,zr=kr.size,Pr=_._fullLayout.font.size;if(!zr||zr==="auto"){var Hr=1/0,Zr=1/0,Jr=0,wt=0;for(we=0;we=y[0].length||R<0||R>y.length)return}else{if(d.inbox(o-T[0],o-T[T.length-1],0)>0||d.inbox(a-l[0],a-l[l.length-1],0)>0)return;if(s){var P;for(w=[2*T[0]-T[1]],P=1;P=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),fy=He({"src/traces/contour/attributes.js"(Y,G){var d=Y0(),x=Zu(),A=Gu(),E=A.axisHoverFormat,e=A.descriptionOnlyNumbers,t=kl(),r=Nf().dash,o=Yl(),a=ho().extendFlat,i=q1(),n=i.COMPARISON_OPS2,s=i.INTERVAL_OPS,c=x.line;G.exports=a({z:d.z,x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:x.xperiod0,yperiod0:x.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,text:d.text,hovertext:d.hovertext,transpose:d.transpose,xtype:d.xtype,ytype:d.ytype,xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:d.hovertemplate,texttemplate:a({},d.texttemplate,{}),textfont:a({},d.textfont,{}),hoverongaps:d.hoverongaps,connectgaps:a({},d.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:o({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:e("contour label")},operation:{valType:"enumerated",values:[].concat(n).concat(s),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:a({},c.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:r,smoothing:a({},c.smoothing,{}),editType:"plot"},zorder:x.zorder},t("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),Sw=He({"src/traces/histogram2dcontour/attributes.js"(Y,G){var d=V1(),x=fy(),A=kl(),E=Gu().axisHoverFormat,e=ho().extendFlat;G.exports=e({x:d.x,y:d.y,z:d.z,marker:d.marker,histnorm:d.histnorm,histfunc:d.histfunc,nbinsx:d.nbinsx,xbins:d.xbins,nbinsy:d.nbinsy,ybins:d.ybins,autobinx:d.autobinx,autobiny:d.autobiny,bingroup:d.bingroup,xbingroup:d.xbingroup,ybingroup:d.ybingroup,autocontour:x.autocontour,ncontours:x.ncontours,contours:x.contours,line:{color:x.line.color,width:e({},x.line.width,{dflt:.5}),dash:x.line.dash,smoothing:x.line.smoothing,editType:"plot"},xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:d.hovertemplate,texttemplate:x.texttemplate,textfont:x.textfont},A("",{cLetter:"z",editTypeOverride:"calc"}))}}),H1=He({"src/traces/contour/contours_defaults.js"(Y,G){G.exports=function(x,A,E,e){var t=e("contours.start"),r=e("contours.end"),o=t===!1||r===!1,a=E("contours.size"),i;o?i=A.autocontour=!0:i=E("autocontour",!1),(i||!a)&&E("ncontours")}}}),Mw=He({"src/traces/contour/label_defaults.js"(Y,G){var d=Gr();G.exports=function(A,E,e,t){t||(t={});var r=A("contours.showlabels");if(r){var o=E.font;d.coerceFont(A,"contours.labelfont",o,{overrideDflt:{color:e}}),A("contours.labelformat")}t.hasHover!==!1&&A("zhoverformat")}}}),G1=He({"src/traces/contour/style_defaults.js"(Y,G){var d=pf(),x=Mw();G.exports=function(E,e,t,r,o){var a=t("contours.coloring"),i,n="";a==="fill"&&(i=t("contours.showlines")),i!==!1&&(a!=="lines"&&(n=t("line.color","#000")),t("line.width",.5),t("line.dash")),a!=="none"&&(E.showlegend!==!0&&(e.showlegend=!1),e._dfltShowLegend=!1,d(E,e,r,t,{prefix:"",cLetter:"z"})),t("line.smoothing"),x(t,r,n,o)}}}),oE=He({"src/traces/histogram2dcontour/defaults.js"(Y,G){var d=Gr(),x=Aw(),A=H1(),E=G1(),e=cy(),t=Sw();G.exports=function(o,a,i,n){function s(f,v){return d.coerce(o,a,t,f,v)}function c(f){return d.coerce2(o,a,t,f)}x(o,a,s,n),a.visible!==!1&&(A(o,a,s,c),E(o,a,s,n),s("xhoverformat"),s("yhoverformat"),s("hovertemplate"),a.contours&&a.contours.coloring==="heatmap"&&e(s,n))}}}),Ew=He({"src/traces/contour/set_contours.js"(Y,G){var d=io(),x=Gr();G.exports=function(e,t){var r=e.contours;if(e.autocontour){var o=e.zmin,a=e.zmax;(e.zauto||o===void 0)&&(o=x.aggNums(Math.min,null,t)),(e.zauto||a===void 0)&&(a=x.aggNums(Math.max,null,t));var i=A(o,a,e.ncontours);r.size=i.dtick,r.start=d.tickFirst(i),i.range.reverse(),r.end=d.tickFirst(i),r.start===o&&(r.start+=r.size),r.end===a&&(r.end-=r.size),r.start>r.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),x.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if(r.type!=="constraint"){var n=r.start,s=r.end,c=e._input.contours;if(n>s&&(r.start=c.start=s,s=r.end=c.end=n,n=r.start),!(r.size>0)){var f;n===s?f=1:f=A(n,s,e.ncontours).dtick,c.size=r.size=f}}};function A(E,e,t){var r={type:"linear",range:[E,e]};return d.autoTicks(r,(e-E)/(t||15)),r}}}),hy=He({"src/traces/contour/end_plus.js"(Y,G){G.exports=function(x){return x.end+x.size/1e6}}}),kw=He({"src/traces/contour/calc.js"(Y,G){var d=Kl(),x=z1(),A=Ew(),E=hy();G.exports=function(t,r){var o=x(t,r),a=o[0].z;A(r,a);var i=r.contours,n=d.extractOpts(r),s;if(i.coloring==="heatmap"&&n.auto&&r.autocontour===!1){var c=i.start,f=E(i),v=i.size||1,h=Math.floor((f-c)/v)+1;isFinite(v)||(v=1,h=1);var T=c-v/2,l=T+h*v;s=[T,l]}else s=a;return d.calc(t,r,{vals:s,cLetter:"z"}),o}}}),vy=He({"src/traces/contour/constants.js"(Y,G){G.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}}}}),Cw=He({"src/traces/contour/make_crossings.js"(Y,G){var d=vy();G.exports=function(E){var e=E[0].z,t=e.length,r=e[0].length,o=t===2||r===2,a,i,n,s,c,f,v,h,T;for(i=0;iA?0:1)+(E[0][1]>A?0:2)+(E[1][1]>A?0:4)+(E[1][0]>A?0:8);if(e===5||e===10){var t=(E[0][0]+E[0][1]+E[1][0]+E[1][1])/4;return A>t?e===5?713:1114:e===5?104:208}return e===15?0:e}}}),Lw=He({"src/traces/contour/find_all_paths.js"(Y,G){var d=Gr(),x=vy();G.exports=function(a,i,n){var s,c,f,v,h;for(i=i||.01,n=n||.01,f=0;f20?(f=x.CHOOSESADDLE[f][(v[0]||v[1])<0?0:1],o.crossings[c]=x.SADDLEREMAINDER[f]):delete o.crossings[c],v=x.NEWDELTA[f],!v){d.log("Found bad marching index:",f,a,o.level);break}h.push(r(o,a,v)),a[0]+=v[0],a[1]+=v[1],c=a.join(","),A(h[h.length-1],h[h.length-2],n,s)&&h.pop();var M=v[0]&&(a[0]<0||a[0]>l-2)||v[1]&&(a[1]<0||a[1]>T-2),_=a[0]===y[0]&&a[1]===y[1]&&v[0]===b[0]&&v[1]===b[1];if(_||i&&M)break;f=o.crossings[c]}S===1e4&&d.log("Infinite loop in contour?");var w=A(h[0],h[h.length-1],n,s),p=0,u=.2*o.smoothing,g=[],m=0,R,P,z,F,B,O,L,N,U,Z,Q;for(S=1;S=m;S--)if(R=g[S],R=m&&R+g[P]N&&U--,o.edgepaths[U]=Q.concat(h,Z));break}j||(o.edgepaths[N]=h.concat(Z))}for(N=0;N20&&a?o===208||o===1114?n=i[0]===0?1:-1:s=i[1]===0?1:-1:x.BOTTOMSTART.indexOf(o)!==-1?s=1:x.LEFTSTART.indexOf(o)!==-1?n=1:x.TOPSTART.indexOf(o)!==-1?s=-1:n=-1,[n,s]}function r(o,a,i){var n=a[0]+Math.max(i[0],0),s=a[1]+Math.max(i[1],0),c=o.z[s][n],f=o.xaxis,v=o.yaxis;if(i[1]){var h=(o.level-c)/(o.z[s][n+1]-c),T=(h!==1?(1-h)*f.c2l(o.x[n]):0)+(h!==0?h*f.c2l(o.x[n+1]):0);return[f.c2p(f.l2c(T),!0),v.c2p(o.y[s],!0),n+h,s]}else{var l=(o.level-c)/(o.z[s+1][n]-c),y=(l!==1?(1-l)*v.c2l(o.y[s]):0)+(l!==0?l*v.c2l(o.y[s+1]):0);return[f.c2p(o.x[n],!0),v.c2p(v.l2c(y),!0),n,s+l]}}}}),sE=He({"src/traces/contour/constraint_mapping.js"(Y,G){var d=q1(),x=Hi();G.exports={"[]":E("[]"),"][":E("]["),">":e(">"),"<":e("<"),"=":e("=")};function A(t,r){var o=Array.isArray(r),a;function i(n){return x(n)?+n:null}return d.COMPARISON_OPS2.indexOf(t)!==-1?a=i(o?r[0]:r):d.INTERVAL_OPS.indexOf(t)!==-1?a=o?[i(r[0]),i(r[1])]:[i(r),i(r)]:d.SET_OPS.indexOf(t)!==-1&&(a=o?r.map(i):[i(r)]),a}function E(t){return function(r){r=A(t,r);var o=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return{start:o,end:a,size:a-o}}}function e(t){return function(r){return r=A(t,r),{start:r,end:1/0,size:1/0}}}}}),Pw=He({"src/traces/contour/empty_pathinfo.js"(Y,G){var d=Gr(),x=sE(),A=hy();G.exports=function(e,t,r){for(var o=e.type==="constraint"?x[e._operation](e.value):e,a=o.size,i=[],n=A(o),s=r.trace._carpetTrace,c=s?{xaxis:s.aaxis,yaxis:s.baxis,x:r.a,y:r.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:r.x,y:r.y},f=o.start;f1e3){d.warn("Too many contours, clipping at 1000",e);break}return i}}}),Iw=He({"src/traces/contour/convert_to_constraints.js"(Y,G){var d=Gr();G.exports=function(A,E){var e,t,r,o=function(n){return n.reverse()},a=function(n){return n};switch(E){case"=":case"<":return A;case">":for(A.length!==1&&d.warn("Contour data invalid for the specified inequality operation."),t=A[0],e=0;er.level||r.starts.length&&t===r.level)}break;case"constraint":if(A.prefixBoundary=!1,A.edgepaths.length)return;var o=A.x.length,a=A.y.length,i=-1/0,n=1/0;for(e=0;e":s>i&&(A.prefixBoundary=!0);break;case"<":(si||A.starts.length&&f===n)&&(A.prefixBoundary=!0);break;case"][":c=Math.min(s[0],s[1]),f=Math.max(s[0],s[1]),ci&&(A.prefixBoundary=!0);break}break}}}}),W1=He({"src/traces/contour/plot.js"(Y){var G=Qn(),d=Gr(),x=vo(),A=Kl(),E=yl(),e=io(),t=Uv(),r=O1(),o=Cw(),a=Lw(),i=Pw(),n=Iw(),s=Rw(),c=vy(),f=c.LABELOPTIMIZER;Y.plot=function(_,w,p,u){var g=w.xaxis,m=w.yaxis;d.makeTraceGroups(u,p,"contour").each(function(R){var P=G.select(this),z=R[0],F=z.trace,B=z.x,O=z.y,L=F.contours,N=i(L,w,z),U=d.ensureSingle(P,"g","heatmapcoloring"),Z=[];L.coloring==="heatmap"&&(Z=[R]),r(_,w,Z,U),o(N),a(N);var Q=g.c2p(B[0],!0),ue=g.c2p(B[B.length-1],!0),oe=m.c2p(O[0],!0),le=m.c2p(O[O.length-1],!0),j=[[Q,le],[ue,le],[ue,oe],[Q,oe]],J=N;L.type==="constraint"&&(J=n(N,L._operation)),v(P,j,L),h(P,J,j,L),l(P,N,_,z,L),b(P,w,_,z,j)})};function v(M,_,w){var p=d.ensureSingle(M,"g","contourbg"),u=p.selectAll("path").data(w.coloring==="fill"?[0]:[]);u.enter().append("path"),u.exit().remove(),u.attr("d","M"+_.join("L")+"Z").style("stroke","none")}function h(M,_,w,p){var u=p.coloring==="fill"||p.type==="constraint"&&p._operation!=="=",g="M"+w.join("L")+"Z";u&&s(_,p);var m=d.ensureSingle(M,"g","contourfill"),R=m.selectAll("path").data(u?_:[]);R.enter().append("path"),R.exit().remove(),R.each(function(P){var z=(P.prefixBoundary?g:"")+T(P,w);z?G.select(this).attr("d",z).style("stroke","none"):G.select(this).remove()})}function T(M,_){var w="",p=0,u=M.edgepaths.map(function(Q,ue){return ue}),g=!0,m,R,P,z,F,B;function O(Q){return Math.abs(Q[1]-_[0][1])<.01}function L(Q){return Math.abs(Q[1]-_[2][1])<.01}function N(Q){return Math.abs(Q[0]-_[0][0])<.01}function U(Q){return Math.abs(Q[0]-_[2][0])<.01}for(;u.length;){for(B=x.smoothopen(M.edgepaths[p],M.smoothing),w+=g?B:B.replace(/^M/,"L"),u.splice(u.indexOf(p),1),m=M.edgepaths[p][M.edgepaths[p].length-1],z=-1,P=0;P<4;P++){if(!m){d.log("Missing end?",p,M);break}for(O(m)&&!U(m)?R=_[1]:N(m)?R=_[0]:L(m)?R=_[3]:U(m)&&(R=_[2]),F=0;F=0&&(R=Z,z=F):Math.abs(m[1]-R[1])<.01?Math.abs(m[1]-Z[1])<.01&&(Z[0]-m[0])*(R[0]-Z[0])>=0&&(R=Z,z=F):d.log("endpt to newendpt is not vert. or horz.",m,R,Z)}if(m=R,z>=0)break;w+="L"+R}if(z===M.edgepaths.length){d.log("unclosed perimeter path");break}p=z,g=u.indexOf(p)===-1,g&&(p=u[0],w+="Z")}for(p=0;pf.MAXCOST*2)break;O&&(R/=2),m=z-R/2,P=m+R*1.5}if(B<=f.MAXCOST)return F};function y(M,_,w,p){var u=_.width/2,g=_.height/2,m=M.x,R=M.y,P=M.theta,z=Math.cos(P)*u,F=Math.sin(P)*u,B=(m>p.center?p.right-m:m-p.left)/(z+Math.abs(Math.sin(P)*g)),O=(R>p.middle?p.bottom-R:R-p.top)/(Math.abs(F)+Math.cos(P)*g);if(B<1||O<1)return 1/0;var L=f.EDGECOST*(1/(B-1)+1/(O-1));L+=f.ANGLECOST*P*P;for(var N=m-z,U=R-F,Z=m+z,Q=R+F,ue=0;ue=b)&&(r<=y&&(r=y),o>=b&&(o=b),i=Math.floor((o-r)/a)+1,n=0),l=0;ly&&(v.unshift(y),h.unshift(h[0])),v[v.length-1]2?s.value=s.value.slice(2):s.length===0?s.value=[0,1]:s.length<2?(c=parseFloat(s.value[0]),s.value=[c,c+1]):s.value=[parseFloat(s.value[0]),parseFloat(s.value[1])]:d(s.value)&&(c=parseFloat(s.value),s.value=[c,c+1])):(n("contours.value",0),d(s.value)||(r(s.value)?s.value=parseFloat(s.value[0]):s.value=0))}}}),cE=He({"src/traces/contour/defaults.js"(Y,G){var d=Gr(),x=L1(),A=Tv(),E=Fw(),e=H1(),t=G1(),r=cy(),o=fy();G.exports=function(i,n,s,c){function f(l,y){return d.coerce(i,n,o,l,y)}function v(l){return d.coerce2(i,n,o,l)}var h=x(i,n,f,c);if(!h){n.visible=!1;return}A(i,n,c,f),f("xhoverformat"),f("yhoverformat"),f("text"),f("hovertext"),f("hoverongaps"),f("hovertemplate");var T=f("contours.type")==="constraint";f("connectgaps",d.isArray1D(n.z)),T?E(i,n,f,c,s):(e(i,n,f,v),t(i,n,f,c)),n.contours&&n.contours.coloring==="heatmap"&&r(f,c),f("zorder")}}}),fE=He({"src/traces/contour/index.js"(Y,G){G.exports={attributes:fy(),supplyDefaults:cE(),calc:kw(),plot:W1().plot,style:Z1(),colorbar:X1(),hoverPoints:zw(),moduleType:"trace",name:"contour",basePlotModule:Bc(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),hE=He({"lib/contour.js"(Y,G){G.exports=fE()}}),Ow=He({"src/traces/scatterternary/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=Yo().texttemplateAttrs,A=wv(),E=Zu(),e=cl(),t=kl(),r=Nf().dash,o=ho().extendFlat,a=E.marker,i=E.line,n=a.line;G.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:o({},E.mode,{dflt:"markers"}),text:o({},E.text,{}),texttemplate:x({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:o({},E.hovertext,{}),line:{color:i.color,width:i.width,dash:r,backoff:i.backoff,shape:o({},i.shape,{values:["linear","spline"]}),smoothing:i.smoothing,editType:"calc"},connectgaps:E.connectgaps,cliponaxis:E.cliponaxis,fill:o({},E.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:A(),marker:o({symbol:a.symbol,opacity:a.opacity,angle:a.angle,angleref:a.angleref,standoff:a.standoff,maxdisplayed:a.maxdisplayed,size:a.size,sizeref:a.sizeref,sizemin:a.sizemin,sizemode:a.sizemode,line:o({width:n.width,editType:"calc"},t("marker.line")),gradient:a.gradient,editType:"calc"},t("marker")),textfont:E.textfont,textposition:E.textposition,selected:E.selected,unselected:E.unselected,hoverinfo:o({},e.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:E.hoveron,hovertemplate:d()}}}),vE=He({"src/traces/scatterternary/defaults.js"(Y,G){var d=Gr(),x=jv(),A=Rl(),E=Kh(),e=nv(),t=V0(),r=iv(),o=Av(),a=Ow();G.exports=function(n,s,c,f){function v(M,_){return d.coerce(n,s,a,M,_)}var h=v("a"),T=v("b"),l=v("c"),y;if(h?(y=h.length,T?(y=Math.min(y,T.length),l&&(y=Math.min(y,l.length))):l?y=Math.min(y,l.length):y=0):T&&l&&(y=Math.min(T.length,l.length)),!y){s.visible=!1;return}s._length=y,v("sum"),v("text"),v("hovertext"),s.hoveron!=="fills"&&v("hovertemplate");var b=y"),o.hovertemplate=f.hovertemplate,r}}}),mE=He({"src/traces/scatterternary/event_data.js"(Y,G){G.exports=function(x,A,E,e,t){if(A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),e[t]){var r=e[t];x.a=r.a,x.b=r.b,x.c=r.c}else x.a=A.a,x.b=A.b,x.c=A.c;return x}}}),_E=He({"src/plots/ternary/ternary.js"(Y,G){var d=Qn(),x=Mf(),A=Ei(),E=Gr(),e=E.strTranslate,t=E._,r=Ai(),o=vo(),a=Uv(),i=ho().extendFlat,n=yu(),s=io(),c=fh(),f=Wu(),v=bv(),h=v.freeMode,T=v.rectMode,l=kp(),y=dc().prepSelect,b=dc().selectOnClick,S=dc().clearOutline,M=dc().clearSelectionsCache,_=Ef();function w(L,N){this.id=L.id,this.graphDiv=L.graphDiv,this.init(N),this.makeFramework(N),this.updateFx(N),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}G.exports=w;var p=w.prototype;p.init=function(L){this.container=L._ternarylayer,this.defs=L._defs,this.layoutId=L._uid,this.traceHash={},this.layers={}},p.plot=function(L,N){var U=this,Z=N[U.id],Q=N._size;U._hasClipOnAxisFalse=!1;for(var ue=0;ueu*J?(fe=J,ie=fe*u):(ie=j,fe=ie/u),we=oe*ie/j,Ae=le*fe/J,q=N.l+N.w*Q-ie/2,ae=N.t+N.h*(1-ue)-fe/2,U.x0=q,U.y0=ae,U.w=ie,U.h=fe,U.sum=$,U.xaxis={type:"linear",range:[X+2*ee-$,$-X-2*re],domain:[Q-we/2,Q+we/2],_id:"x"},a(U.xaxis,U.graphDiv._fullLayout),U.xaxis.setScale(),U.xaxis.isPtWithinRange=function(Re){return Re.a>=U.aaxis.range[0]&&Re.a<=U.aaxis.range[1]&&Re.b>=U.baxis.range[1]&&Re.b<=U.baxis.range[0]&&Re.c>=U.caxis.range[1]&&Re.c<=U.caxis.range[0]},U.yaxis={type:"linear",range:[X,$-re-ee],domain:[ue-Ae/2,ue+Ae/2],_id:"y"},a(U.yaxis,U.graphDiv._fullLayout),U.yaxis.setScale(),U.yaxis.isPtWithinRange=function(){return!0};var Fe=U.yaxis.domain[0],Ce=U.aaxis=i({},L.aaxis,{range:[X,$-re-ee],side:"left",tickangle:(+L.aaxis.tickangle||0)-30,domain:[Fe,Fe+Ae*u],anchor:"free",position:0,_id:"y",_length:ie});a(Ce,U.graphDiv._fullLayout),Ce.setScale();var qe=U.baxis=i({},L.baxis,{range:[$-X-ee,re],side:"bottom",domain:U.xaxis.domain,anchor:"free",position:0,_id:"x",_length:ie});a(qe,U.graphDiv._fullLayout),qe.setScale();var et=U.caxis=i({},L.caxis,{range:[$-X-re,ee],side:"right",tickangle:(+L.caxis.tickangle||0)+30,domain:[Fe,Fe+Ae*u],anchor:"free",position:0,_id:"y",_length:ie});a(et,U.graphDiv._fullLayout),et.setScale();var Qe="M"+q+","+(ae+fe)+"h"+ie+"l-"+ie/2+",-"+fe+"Z";U.clipDef.select("path").attr("d",Qe),U.layers.plotbg.select("path").attr("d",Qe);var Ke="M0,"+fe+"h"+ie+"l-"+ie/2+",-"+fe+"Z";U.clipDefRelative.select("path").attr("d",Ke);var Xe=e(q,ae);U.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Xe),U.clipDefRelative.select("path").attr("transform",null);var Me=e(q-qe._offset,ae+fe);U.layers.baxis.attr("transform",Me),U.layers.bgrid.attr("transform",Me);var xe=e(q+ie/2,ae)+"rotate(30)"+e(0,-Ce._offset);U.layers.aaxis.attr("transform",xe),U.layers.agrid.attr("transform",xe);var ce=e(q+ie/2,ae)+"rotate(-30)"+e(0,-et._offset);U.layers.caxis.attr("transform",ce),U.layers.cgrid.attr("transform",ce),U.drawAxes(!0),U.layers.aline.select("path").attr("d",Ce.showline?"M"+q+","+(ae+fe)+"l"+ie/2+",-"+fe:"M0,0").call(r.stroke,Ce.linecolor||"#000").style("stroke-width",(Ce.linewidth||0)+"px"),U.layers.bline.select("path").attr("d",qe.showline?"M"+q+","+(ae+fe)+"h"+ie:"M0,0").call(r.stroke,qe.linecolor||"#000").style("stroke-width",(qe.linewidth||0)+"px"),U.layers.cline.select("path").attr("d",et.showline?"M"+(q+ie/2)+","+ae+"l"+ie/2+","+fe:"M0,0").call(r.stroke,et.linecolor||"#000").style("stroke-width",(et.linewidth||0)+"px"),U.graphDiv._context.staticPlot||U.initInteractions(),o.setClipUrl(U.layers.frontplot,U._hasClipOnAxisFalse?null:U.clipId,U.graphDiv)},p.drawAxes=function(L){var N=this,U=N.graphDiv,Z=N.id.substr(7)+"title",Q=N.layers,ue=N.aaxis,oe=N.baxis,le=N.caxis;if(N.drawAx(ue),N.drawAx(oe),N.drawAx(le),L){var j=Math.max(ue.showticklabels?ue.tickfont.size/2:0,(le.showticklabels?le.tickfont.size*.75:0)+(le.ticks==="outside"?le.ticklen*.87:0)),J=(oe.showticklabels?oe.tickfont.size:0)+(oe.ticks==="outside"?oe.ticklen:0)+3;Q["a-title"]=l.draw(U,"a"+Z,{propContainer:ue,propName:N.id+".aaxis.title",placeholder:t(U,"Click to enter Component A title"),attributes:{x:N.x0+N.w/2,y:N.y0-ue.title.font.size/3-j,"text-anchor":"middle"}}),Q["b-title"]=l.draw(U,"b"+Z,{propContainer:oe,propName:N.id+".baxis.title",placeholder:t(U,"Click to enter Component B title"),attributes:{x:N.x0-J,y:N.y0+N.h+oe.title.font.size*.83+J,"text-anchor":"middle"}}),Q["c-title"]=l.draw(U,"c"+Z,{propContainer:le,propName:N.id+".caxis.title",placeholder:t(U,"Click to enter Component C title"),attributes:{x:N.x0+N.w+J,y:N.y0+N.h+le.title.font.size*.83+J,"text-anchor":"middle"}})}},p.drawAx=function(L){var N=this,U=N.graphDiv,Z=L._name,Q=Z.charAt(0),ue=L._id,oe=N.layers[Z],le=30,j=Q+"tickLayout",J=g(L);N[j]!==J&&(oe.selectAll("."+ue+"tick").remove(),N[j]=J),L.setScale();var $=s.calcTicks(L),X=s.clipEnds(L,$),re=s.makeTransTickFn(L),ee=s.getTickSigns(L)[2],q=E.deg2rad(le),ae=ee*(L.linewidth||1)/2,ie=ee*L.ticklen,fe=N.w,we=N.h,Ae=Q==="b"?"M0,"+ae+"l"+Math.sin(q)*ie+","+Math.cos(q)*ie:"M"+ae+",0l"+Math.cos(q)*ie+","+-Math.sin(q)*ie,Fe={a:"M0,0l"+we+",-"+fe/2,b:"M0,0l-"+fe/2+",-"+we,c:"M0,0l-"+we+","+fe/2}[Q];s.drawTicks(U,L,{vals:L.ticks==="inside"?X:$,layer:oe,path:Ae,transFn:re,crisp:!1}),s.drawGrid(U,L,{vals:X,layer:N.layers[Q+"grid"],path:Fe,transFn:re,crisp:!1}),s.drawLabels(U,L,{vals:$,layer:oe,transFn:re,labelFns:s.makeLabelFns(L,0,le)})};function g(L){return L.ticks+String(L.ticklen)+String(L.showticklabels)}var m=_.MINZOOM/2+.87,R="m-0.87,.5h"+m+"v3h-"+(m+5.2)+"l"+(m/2+2.6)+",-"+(m*.87+4.5)+"l2.6,1.5l-"+m/2+","+m*.87+"Z",P="m0.87,.5h-"+m+"v3h"+(m+5.2)+"l-"+(m/2+2.6)+",-"+(m*.87+4.5)+"l-2.6,1.5l"+m/2+","+m*.87+"Z",z="m0,1l"+m/2+","+m*.87+"l2.6,-1.5l-"+(m/2+2.6)+",-"+(m*.87+4.5)+"l-"+(m/2+2.6)+","+(m*.87+4.5)+"l2.6,1.5l"+m/2+",-"+m*.87+"Z",F="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",B=!0;p.clearOutline=function(){M(this.dragOptions),S(this.dragOptions.gd)},p.initInteractions=function(){var L=this,N=L.layers.plotbg.select("path").node(),U=L.graphDiv,Z=U._fullLayout._zoomlayer,Q,ue;this.dragOptions={element:N,gd:U,plotinfo:{id:L.id,domain:U._fullLayout[L.id].domain,xaxis:L.xaxis,yaxis:L.yaxis},subplot:L.id,prepFn:function(Me,xe,ce){L.dragOptions.xaxes=[L.xaxis],L.dragOptions.yaxes=[L.yaxis],Q=U._fullLayout._invScaleX,ue=U._fullLayout._invScaleY;var Re=L.dragOptions.dragmode=U._fullLayout.dragmode;h(Re)?L.dragOptions.minDrag=1:L.dragOptions.minDrag=void 0,Re==="zoom"?(L.dragOptions.moveFn=qe,L.dragOptions.clickFn=fe,L.dragOptions.doneFn=et,we(Me,xe,ce)):Re==="pan"?(L.dragOptions.moveFn=Ke,L.dragOptions.clickFn=fe,L.dragOptions.doneFn=Xe,Qe(),L.clearOutline(U)):(T(Re)||h(Re))&&y(Me,xe,ce,L.dragOptions,Re)}};var oe,le,j,J,$,X,re,ee,q,ae;function ie(Me){var xe={};return xe[L.id+".aaxis.min"]=Me.a,xe[L.id+".baxis.min"]=Me.b,xe[L.id+".caxis.min"]=Me.c,xe}function fe(Me,xe){var ce=U._fullLayout.clickmode;O(U),Me===2&&(U.emit("plotly_doubleclick",null),A.call("_guiRelayout",U,ie({a:0,b:0,c:0}))),ce.indexOf("select")>-1&&Me===1&&b(xe,U,[L.xaxis],[L.yaxis],L.id,L.dragOptions),ce.indexOf("event")>-1&&f.click(U,xe,L.id)}function we(Me,xe,ce){var Re=N.getBoundingClientRect();oe=xe-Re.left,le=ce-Re.top,U._fullLayout._calcInverseTransform(U);var $e=U._fullLayout._invTransform,rt=E.apply3DTransform($e)(oe,le);oe=rt[0],le=rt[1],j={a:L.aaxis.range[0],b:L.baxis.range[1],c:L.caxis.range[1]},$=j,J=L.aaxis.range[1]-j.a,X=x(L.graphDiv._fullLayout[L.id].bgcolor).getLuminance(),re="M0,"+L.h+"L"+L.w/2+", 0L"+L.w+","+L.h+"Z",ee=!1,q=Z.append("path").attr("class","zoombox").attr("transform",e(L.x0,L.y0)).style({fill:X>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",re),ae=Z.append("path").attr("class","zoombox-corners").attr("transform",e(L.x0,L.y0)).style({fill:r.background,stroke:r.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),L.clearOutline(U)}function Ae(Me,xe){return 1-xe/L.h}function Fe(Me,xe){return 1-(Me+(L.h-xe)/Math.sqrt(3))/L.w}function Ce(Me,xe){return(Me-(L.h-xe)/Math.sqrt(3))/L.w}function qe(Me,xe){var ce=oe+Me*Q,Re=le+xe*ue,$e=Math.max(0,Math.min(1,Ae(oe,le),Ae(ce,Re))),rt=Math.max(0,Math.min(1,Fe(oe,le),Fe(ce,Re))),Je=Math.max(0,Math.min(1,Ce(oe,le),Ce(ce,Re))),At=($e/2+Je)*L.w,St=(1-$e/2-rt)*L.w,Rt=(At+St)/2,Ut=St-At,ir=(1-$e)*L.h,ar=ir-Ut/u;Ut<_.MINZOOM?($=j,q.attr("d",re),ae.attr("d","M0,0Z")):($={a:j.a+$e*J,b:j.b+rt*J,c:j.c+Je*J},q.attr("d",re+"M"+At+","+ir+"H"+St+"L"+Rt+","+ar+"L"+At+","+ir+"Z"),ae.attr("d","M"+oe+","+le+F+"M"+At+","+ir+R+"M"+St+","+ir+P+"M"+Rt+","+ar+z)),ee||(q.transition().style("fill",X>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ae.transition().style("opacity",1).duration(200),ee=!0),U.emit("plotly_relayouting",ie($))}function et(){O(U),$!==j&&(A.call("_guiRelayout",U,ie($)),B&&U.data&&U._context.showTips&&(E.notifier(t(U,"Double-click to zoom back out"),"long"),B=!1))}function Qe(){j={a:L.aaxis.range[0],b:L.baxis.range[1],c:L.caxis.range[1]},$=j}function Ke(Me,xe){var ce=Me/L.xaxis._m,Re=xe/L.yaxis._m;$={a:j.a-Re,b:j.b+(ce+Re)/2,c:j.c-(ce-Re)/2};var $e=[$.a,$.b,$.c].sort(E.sorterAsc),rt={a:$e.indexOf($.a),b:$e.indexOf($.b),c:$e.indexOf($.c)};$e[0]<0&&($e[1]+$e[0]/2<0?($e[2]+=$e[0]+$e[1],$e[0]=$e[1]=0):($e[2]+=$e[0]/2,$e[1]+=$e[0]/2,$e[0]=0),$={a:$e[rt.a],b:$e[rt.b],c:$e[rt.c]},xe=(j.a-$.a)*L.yaxis._m,Me=(j.c-$.c-j.b+$.b)*L.xaxis._m);var Je=e(L.x0+Me,L.y0+xe);L.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Je);var At=e(-Me,-xe);L.clipDefRelative.select("path").attr("transform",At),L.aaxis.range=[$.a,L.sum-$.b-$.c],L.baxis.range=[L.sum-$.a-$.c,$.b],L.caxis.range=[L.sum-$.a-$.b,$.c],L.drawAxes(!1),L._hasClipOnAxisFalse&&L.plotContainer.select(".scatterlayer").selectAll(".trace").call(o.hideOutsideRangePoints,L),U.emit("plotly_relayouting",ie($))}function Xe(){A.call("_guiRelayout",U,ie($))}N.onmousemove=function(Me){f.hover(U,Me,L.id),U._fullLayout._lasthover=N,U._fullLayout._hoversubplot=L.id},N.onmouseout=function(Me){U._dragging||c.unhover(U,Me)},c.init(this.dragOptions)};function O(L){d.select(L).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}}),Bw=He({"src/plots/ternary/layout_attributes.js"(Y,G){var d=Xc(),x=mu().attributes,A=jf(),E=hu().overrideAll,e=ho().extendFlat,t={title:{text:A.title.text,font:A.title.font},color:A.color,tickmode:A.minor.tickmode,nticks:e({},A.nticks,{dflt:6,min:1}),tick0:A.tick0,dtick:A.dtick,tickvals:A.tickvals,ticktext:A.ticktext,ticks:A.ticks,ticklen:A.ticklen,tickwidth:A.tickwidth,tickcolor:A.tickcolor,ticklabelstep:A.ticklabelstep,showticklabels:A.showticklabels,labelalias:A.labelalias,showtickprefix:A.showtickprefix,tickprefix:A.tickprefix,showticksuffix:A.showticksuffix,ticksuffix:A.ticksuffix,showexponent:A.showexponent,exponentformat:A.exponentformat,minexponent:A.minexponent,separatethousands:A.separatethousands,tickfont:A.tickfont,tickangle:A.tickangle,tickformat:A.tickformat,tickformatstops:A.tickformatstops,hoverformat:A.hoverformat,showline:e({},A.showline,{dflt:!0}),linecolor:A.linecolor,linewidth:A.linewidth,showgrid:e({},A.showgrid,{dflt:!0}),gridcolor:A.gridcolor,gridwidth:A.gridwidth,griddash:A.griddash,layer:A.layer,min:{valType:"number",dflt:0,min:0}},r=G.exports=E({domain:x({name:"ternary"}),bgcolor:{valType:"color",dflt:d.background},sum:{valType:"number",dflt:1,min:0},aaxis:t,baxis:t,caxis:t},"plot","from-root");r.uirevision={valType:"any",editType:"none"},r.aaxis.uirevision=r.baxis.uirevision=r.caxis.uirevision={valType:"any",editType:"none"}}}),Xd=He({"src/plots/subplot_defaults.js"(Y,G){var d=Gr(),x=Gs(),A=mu().defaults;G.exports=function(e,t,r,o){var a=o.type,i=o.attributes,n=o.handleDefaults,s=o.partition||"x",c=t._subplots[a],f=c.length,v=f&&c[0].replace(/\d+$/,""),h,T;function l(M,_){return d.coerce(h,T,i,M,_)}for(var y=0;y=y&&(w.min=0,p.min=0,u.min=0,f.aaxis&&delete f.aaxis.min,f.baxis&&delete f.baxis.min,f.caxis&&delete f.caxis.min)}function c(f,v,h,T){var l=i[v._name];function y(g,m){return A.coerce(f,v,l,g,m)}y("uirevision",T.uirevision),v.type="linear";var b=y("color"),S=b!==l.color.dflt?b:h.font.color,M=v._name,_=M.charAt(0).toUpperCase(),w="Component "+_,p=y("title.text",w);v._hovertitle=p===w?p:_,A.coerceFont(y,"title.font",h.font,{overrideDflt:{size:A.bigFont(h.font.size),color:S}}),y("min"),o(f,v,y,"linear"),t(f,v,y,"linear"),e(f,v,y,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),r(f,v,y,{outerTicks:!0});var u=y("showticklabels");u&&(A.coerceFont(y,"tickfont",h.font,{overrideDflt:{color:S}}),y("tickangle"),y("tickformat")),a(f,v,y,{dfltColor:b,bgColor:h.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:l}),y("hoverformat"),y("layer")}}}),bE=He({"src/plots/ternary/index.js"(Y){var G=_E(),d=Uf().getSubplotCalcData,x=Gr().counterRegex,A="ternary";Y.name=A;var E=Y.attr="subplot";Y.idRoot=A,Y.idRegex=Y.attrRegex=x(A);var e=Y.attributes={};e[E]={valType:"subplotid",dflt:"ternary",editType:"calc"},Y.layoutAttributes=Bw(),Y.supplyLayoutDefaults=xE(),Y.plot=function(r){for(var o=r._fullLayout,a=r.calcdata,i=o._subplots[A],n=0;n0){var M=r.xa,_=r.ya,w,p,u,g,m;f.orientation==="h"?(m=o,w="y",u=_,p="x",g=M):(m=a,w="x",u=M,p="y",g=_);var R=c[r.index];if(m>=R.span[0]&&m<=R.span[1]){var P=x.extendFlat({},r),z=g.c2p(m,!0),F=e.getKdeValue(R,f,m),B=e.getPositionOnKdePath(R,f,z),O=u._offset,L=u._length;P[w+"0"]=B[0],P[w+"1"]=B[1],P[p+"0"]=P[p+"1"]=z,P[p+"Label"]=p+": "+A.hoverLabelText(g,m,f[p+"hoverformat"])+", "+c[0].t.labels.kde+" "+F.toFixed(3);for(var N=0,U=0;U path").each(function(h){if(!h.isBlank){var T=v.marker;d.select(this).call(A.fill,h.mc||T.color).call(A.stroke,h.mlc||T.line.color).call(x.dashLine,T.line.dash,h.mlw||T.line.width).style("opacity",v.selectedpoints&&!h.selected?E:1)}}),r(f,v,a),f.selectAll(".regions").each(function(){d.select(this).selectAll("path").style("stroke-width",0).call(A.fill,v.connector.fillcolor)}),f.selectAll(".lines").each(function(){var h=v.connector.line;x.lineGroupStyle(d.select(this).selectAll("path"),h.width,h.color,h.dash)})})}G.exports={style:o}}}),UE=He({"src/traces/funnel/hover.js"(Y,G){var d=Ai().opacity,x=Z0().hoverOnBars,A=Gr().formatPercent;G.exports=function(t,r,o,a,i){var n=x(t,r,o,a,i);if(n){var s=n.cd,c=s[0].trace,f=c.orientation==="h",v=n.index,h=s[v],T=f?"x":"y";n[T+"LabelVal"]=h.s,n.percentInitial=h.begR,n.percentInitialLabel=A(h.begR,1),n.percentPrevious=h.difR,n.percentPreviousLabel=A(h.difR,1),n.percentTotal=h.sumR,n.percentTotalLabel=A(h.sumR,1);var l=h.hi||c.hoverinfo,y=[];if(l&&l!=="none"&&l!=="skip"){var b=l==="all",S=l.split("+"),M=function(_){return b||S.indexOf(_)!==-1};M("percent initial")&&y.push(n.percentInitialLabel+" of initial"),M("percent previous")&&y.push(n.percentPreviousLabel+" of previous"),M("percent total")&&y.push(n.percentTotalLabel+" of total")}return n.extraText=y.join("
"),n.color=E(c,h),[n]}};function E(e,t){var r=e.marker,o=t.mc||r.color,a=t.mlc||r.line.color,i=t.mlw||r.line.width;if(d(o))return o;if(d(a)&&i)return a}}}),jE=He({"src/traces/funnel/event_data.js"(Y,G){G.exports=function(x,A){return x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,"percentInitial"in A&&(x.percentInitial=A.percentInitial),"percentPrevious"in A&&(x.percentPrevious=A.percentPrevious),"percentTotal"in A&&(x.percentTotal=A.percentTotal),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),x}}}),VE=He({"src/traces/funnel/index.js"(Y,G){G.exports={attributes:jw(),layoutAttributes:Vw(),supplyDefaults:qw().supplyDefaults,crossTraceDefaults:qw().crossTraceDefaults,supplyLayoutDefaults:DE(),calc:FE(),crossTraceCalc:OE(),plot:BE(),style:NE().style,hoverPoints:UE(),eventData:jE(),selectPoints:X0(),moduleType:"trace",name:"funnel",basePlotModule:Bc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),qE=He({"lib/funnel.js"(Y,G){G.exports=VE()}}),HE=He({"src/traces/waterfall/constants.js"(Y,G){G.exports={eventDataKeys:["initial","delta","final"]}}}),Hw=He({"src/traces/waterfall/attributes.js"(Y,G){var d=qv(),x=Zu().line,A=cl(),E=Gu().axisHoverFormat,e=Yo().hovertemplateAttrs,t=Yo().texttemplateAttrs,r=HE(),o=ho().extendFlat,a=Ai();function i(n){return{marker:{color:o({},d.marker.color,{arrayOk:!1,editType:"style"}),line:{color:o({},d.marker.line.color,{arrayOk:!1,editType:"style"}),width:o({},d.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}G.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,xhoverformat:E("x"),yhoverformat:E("y"),hovertext:d.hovertext,hovertemplate:e({},{keys:r.eventDataKeys}),hoverinfo:o({},A.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:t({editType:"plot"},{keys:r.eventDataKeys.concat(["label"])}),text:d.text,textposition:d.textposition,insidetextanchor:d.insidetextanchor,textangle:d.textangle,textfont:d.textfont,insidetextfont:d.insidetextfont,outsidetextfont:d.outsidetextfont,constraintext:d.constraintext,cliponaxis:d.cliponaxis,orientation:d.orientation,offset:d.offset,width:d.width,increasing:i(),decreasing:i(),totals:i(),connector:{line:{color:o({},x.color,{dflt:a.defaultLine}),width:o({},x.width,{editType:"plot"}),dash:x.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,zorder:d.zorder}}}),Gw=He({"src/traces/waterfall/layout_attributes.js"(Y,G){G.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"}}}}),K0=He({"src/constants/delta.js"(Y,G){G.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}}),Ww=He({"src/traces/waterfall/defaults.js"(Y,G){var d=Gr(),x=Pp(),A=Jh().handleText,E=j0(),e=Tv(),t=Hw(),r=Ai(),o=K0(),a=o.INCREASING.COLOR,i=o.DECREASING.COLOR,n="#4499FF";function s(v,h,T){v(h+".marker.color",T),v(h+".marker.line.color",r.defaultLine),v(h+".marker.line.width")}function c(v,h,T,l){function y(w,p){return d.coerce(v,h,t,w,p)}var b=E(v,h,l,y);if(!b){h.visible=!1;return}e(v,h,l,y),y("xhoverformat"),y("yhoverformat"),y("measure"),y("orientation",h.x&&!h.y?"h":"v"),y("base"),y("offset"),y("width"),y("text"),y("hovertext"),y("hovertemplate");var S=y("textposition");A(v,h,l,y,S,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),h.textposition!=="none"&&(y("texttemplate"),h.texttemplate||y("textinfo")),s(y,"increasing",a),s(y,"decreasing",i),s(y,"totals",n);var M=y("connector.visible");if(M){y("connector.mode");var _=y("connector.line.width");_&&(y("connector.line.color"),y("connector.line.dash"))}y("zorder")}function f(v,h){var T,l;function y(S){return d.coerce(l._input,l,t,S)}if(h.waterfallmode==="group")for(var b=0;b0&&(y?m+="M"+u[0]+","+g[1]+"V"+g[0]:m+="M"+u[1]+","+g[0]+"H"+u[0]),b!=="between"&&(_.isSum||w path").each(function(h){if(!h.isBlank){var T=v[h.dir].marker;d.select(this).call(A.fill,T.color).call(A.stroke,T.line.color).call(x.dashLine,T.line.dash,T.line.width).style("opacity",v.selectedpoints&&!h.selected?E:1)}}),r(f,v,a),f.selectAll(".lines").each(function(){var h=v.connector.line;x.lineGroupStyle(d.select(this).selectAll("path"),h.width,h.color,h.dash)})})}G.exports={style:o}}}),KE=He({"src/traces/waterfall/hover.js"(Y,G){var d=io().hoverLabelText,x=Ai().opacity,A=Z0().hoverOnBars,E=K0(),e={increasing:E.INCREASING.SYMBOL,decreasing:E.DECREASING.SYMBOL};G.exports=function(o,a,i,n,s){var c=A(o,a,i,n,s);if(!c)return;var f=c.cd,v=f[0].trace,h=v.orientation==="h",T=h?"x":"y",l=h?o.xa:o.ya;function y(R){return d(l,R,v[T+"hoverformat"])}var b=c.index,S=f[b],M=S.isSum?S.b+S.s:S.rawS;c.initial=S.b+S.s-M,c.delta=M,c.final=c.initial+c.delta;var _=y(Math.abs(c.delta));c.deltaLabel=M<0?"("+_+")":_,c.finalLabel=y(c.final),c.initialLabel=y(c.initial);var w=S.hi||v.hoverinfo,p=[];if(w&&w!=="none"&&w!=="skip"){var u=w==="all",g=w.split("+"),m=function(R){return u||g.indexOf(R)!==-1};S.isSum||(m("final")&&(h?!m("x"):!m("y"))&&p.push(c.finalLabel),m("delta")&&(M<0?p.push(c.deltaLabel+" "+e.decreasing):p.push(c.deltaLabel+" "+e.increasing)),m("initial")&&p.push("Initial: "+c.initialLabel))}return p.length&&(c.extraText=p.join("
")),c.color=t(v,S),[c]};function t(r,o){var a=r[o.dir].marker,i=a.color,n=a.line.color,s=a.line.width;if(x(i))return i;if(x(n)&&s)return n}}}),JE=He({"src/traces/waterfall/event_data.js"(Y,G){G.exports=function(x,A){return x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,"initial"in A&&(x.initial=A.initial),"delta"in A&&(x.delta=A.delta),"final"in A&&(x.final=A.final),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),x}}}),$E=He({"src/traces/waterfall/index.js"(Y,G){G.exports={attributes:Hw(),layoutAttributes:Gw(),supplyDefaults:Ww().supplyDefaults,crossTraceDefaults:Ww().crossTraceDefaults,supplyLayoutDefaults:GE(),calc:WE(),crossTraceCalc:ZE(),plot:XE(),style:YE().style,hoverPoints:KE(),eventData:JE(),selectPoints:X0(),moduleType:"trace",name:"waterfall",basePlotModule:Bc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),QE=He({"lib/waterfall.js"(Y,G){G.exports=$E()}}),J0=He({"src/traces/image/constants.js"(Y,G){G.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(d){return d.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(d){var x=d.slice(0,3);return x[1]=x[1]+"%",x[2]=x[2]+"%",x},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(d){var x=d.slice(0,4);return x[1]=x[1]+"%",x[2]=x[2]+"%",x},suffix:["°","%","%",""]}}}}}),Zw=He({"src/traces/image/attributes.js"(Y,G){var d=cl(),x=Zu().zorder,A=Yo().hovertemplateAttrs,E=ho().extendFlat,e=J0().colormodel,t=["rgb","rgba","rgba256","hsl","hsla"],r=[],o=[];for(i=0;i0)throw new Error("Invalid string. Length must be a multiple of 4");var v=c.indexOf("=");v===-1&&(v=f);var h=v===f?0:4-v%4;return[v,h]}function r(c){var f=t(c),v=f[0],h=f[1];return(v+h)*3/4-h}function o(c,f,v){return(f+v)*3/4-v}function a(c){var f,v=t(c),h=v[0],T=v[1],l=new x(o(c,h,T)),y=0,b=T>0?h-4:h,S;for(S=0;S>16&255,l[y++]=f>>8&255,l[y++]=f&255;return T===2&&(f=d[c.charCodeAt(S)]<<2|d[c.charCodeAt(S+1)]>>4,l[y++]=f&255),T===1&&(f=d[c.charCodeAt(S)]<<10|d[c.charCodeAt(S+1)]<<4|d[c.charCodeAt(S+2)]>>2,l[y++]=f>>8&255,l[y++]=f&255),l}function i(c){return G[c>>18&63]+G[c>>12&63]+G[c>>6&63]+G[c&63]}function n(c,f,v){for(var h,T=[],l=f;lb?b:y+l));return h===1?(f=c[v-1],T.push(G[f>>2]+G[f<<4&63]+"==")):h===2&&(f=(c[v-2]<<8)+c[v-1],T.push(G[f>>10]+G[f>>4&63]+G[f<<2&63]+"=")),T.join("")}}}),rk=He({"node_modules/ieee754/index.js"(Y){Y.read=function(G,d,x,A,E){var e,t,r=E*8-A-1,o=(1<>1,i=-7,n=x?E-1:0,s=x?-1:1,c=G[d+n];for(n+=s,e=c&(1<<-i)-1,c>>=-i,i+=r;i>0;e=e*256+G[d+n],n+=s,i-=8);for(t=e&(1<<-i)-1,e>>=-i,i+=A;i>0;t=t*256+G[d+n],n+=s,i-=8);if(e===0)e=1-a;else{if(e===o)return t?NaN:(c?-1:1)*(1/0);t=t+Math.pow(2,A),e=e-a}return(c?-1:1)*t*Math.pow(2,e-A)},Y.write=function(G,d,x,A,E,e){var t,r,o,a=e*8-E-1,i=(1<>1,s=E===23?Math.pow(2,-24)-Math.pow(2,-77):0,c=A?0:e-1,f=A?1:-1,v=d<0||d===0&&1/d<0?1:0;for(d=Math.abs(d),isNaN(d)||d===1/0?(r=isNaN(d)?1:0,t=i):(t=Math.floor(Math.log(d)/Math.LN2),d*(o=Math.pow(2,-t))<1&&(t--,o*=2),t+n>=1?d+=s/o:d+=s*Math.pow(2,1-n),d*o>=2&&(t++,o/=2),t+n>=i?(r=0,t=i):t+n>=1?(r=(d*o-1)*Math.pow(2,E),t=t+n):(r=d*Math.pow(2,n-1)*Math.pow(2,E),t=0));E>=8;G[x+c]=r&255,c+=f,r/=256,E-=8);for(t=t<0;G[x+c]=t&255,c+=f,t/=256,a-=8);G[x+c-f]|=v*128}}}),zp=He({"node_modules/buffer/index.js"(Y){var G=tk(),d=rk(),x=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Y.Buffer=t,Y.SlowBuffer=T,Y.INSPECT_MAX_BYTES=50;var A=2147483647;Y.kMaxLength=A,t.TYPED_ARRAY_SUPPORT=E(),!t.TYPED_ARRAY_SUPPORT&&typeof console<"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.");function E(){try{const Me=new Uint8Array(1),xe={foo:function(){return 42}};return Object.setPrototypeOf(xe,Uint8Array.prototype),Object.setPrototypeOf(Me,xe),Me.foo()===42}catch{return!1}}Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}});function e(Me){if(Me>A)throw new RangeError('The value "'+Me+'" is invalid for option "size"');const xe=new Uint8Array(Me);return Object.setPrototypeOf(xe,t.prototype),xe}function t(Me,xe,ce){if(typeof Me=="number"){if(typeof xe=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return i(Me)}return r(Me,xe,ce)}t.poolSize=8192;function r(Me,xe,ce){if(typeof Me=="string")return n(Me,xe);if(ArrayBuffer.isView(Me))return c(Me);if(Me==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Me);if(qe(Me,ArrayBuffer)||Me&&qe(Me.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(qe(Me,SharedArrayBuffer)||Me&&qe(Me.buffer,SharedArrayBuffer)))return f(Me,xe,ce);if(typeof Me=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Re=Me.valueOf&&Me.valueOf();if(Re!=null&&Re!==Me)return t.from(Re,xe,ce);const $e=v(Me);if($e)return $e;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Me[Symbol.toPrimitive]=="function")return t.from(Me[Symbol.toPrimitive]("string"),xe,ce);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Me)}t.from=function(Me,xe,ce){return r(Me,xe,ce)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array);function o(Me){if(typeof Me!="number")throw new TypeError('"size" argument must be of type number');if(Me<0)throw new RangeError('The value "'+Me+'" is invalid for option "size"')}function a(Me,xe,ce){return o(Me),Me<=0?e(Me):xe!==void 0?typeof ce=="string"?e(Me).fill(xe,ce):e(Me).fill(xe):e(Me)}t.alloc=function(Me,xe,ce){return a(Me,xe,ce)};function i(Me){return o(Me),e(Me<0?0:h(Me)|0)}t.allocUnsafe=function(Me){return i(Me)},t.allocUnsafeSlow=function(Me){return i(Me)};function n(Me,xe){if((typeof xe!="string"||xe==="")&&(xe="utf8"),!t.isEncoding(xe))throw new TypeError("Unknown encoding: "+xe);const ce=l(Me,xe)|0;let Re=e(ce);const $e=Re.write(Me,xe);return $e!==ce&&(Re=Re.slice(0,$e)),Re}function s(Me){const xe=Me.length<0?0:h(Me.length)|0,ce=e(xe);for(let Re=0;Re=A)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A.toString(16)+" bytes");return Me|0}function T(Me){return+Me!=Me&&(Me=0),t.alloc(+Me)}t.isBuffer=function(xe){return xe!=null&&xe._isBuffer===!0&&xe!==t.prototype},t.compare=function(xe,ce){if(qe(xe,Uint8Array)&&(xe=t.from(xe,xe.offset,xe.byteLength)),qe(ce,Uint8Array)&&(ce=t.from(ce,ce.offset,ce.byteLength)),!t.isBuffer(xe)||!t.isBuffer(ce))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(xe===ce)return 0;let Re=xe.length,$e=ce.length;for(let rt=0,Je=Math.min(Re,$e);rt$e.length?(t.isBuffer(Je)||(Je=t.from(Je)),Je.copy($e,rt)):Uint8Array.prototype.set.call($e,Je,rt);else if(t.isBuffer(Je))Je.copy($e,rt);else throw new TypeError('"list" argument must be an Array of Buffers');rt+=Je.length}return $e};function l(Me,xe){if(t.isBuffer(Me))return Me.length;if(ArrayBuffer.isView(Me)||qe(Me,ArrayBuffer))return Me.byteLength;if(typeof Me!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Me);const ce=Me.length,Re=arguments.length>2&&arguments[2]===!0;if(!Re&&ce===0)return 0;let $e=!1;for(;;)switch(xe){case"ascii":case"latin1":case"binary":return ce;case"utf8":case"utf-8":return fe(Me).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce*2;case"hex":return ce>>>1;case"base64":return Fe(Me).length;default:if($e)return Re?-1:fe(Me).length;xe=(""+xe).toLowerCase(),$e=!0}}t.byteLength=l;function y(Me,xe,ce){let Re=!1;if((xe===void 0||xe<0)&&(xe=0),xe>this.length||((ce===void 0||ce>this.length)&&(ce=this.length),ce<=0)||(ce>>>=0,xe>>>=0,ce<=xe))return"";for(Me||(Me="utf8");;)switch(Me){case"hex":return O(this,xe,ce);case"utf8":case"utf-8":return R(this,xe,ce);case"ascii":return F(this,xe,ce);case"latin1":case"binary":return B(this,xe,ce);case"base64":return m(this,xe,ce);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,xe,ce);default:if(Re)throw new TypeError("Unknown encoding: "+Me);Me=(Me+"").toLowerCase(),Re=!0}}t.prototype._isBuffer=!0;function b(Me,xe,ce){const Re=Me[xe];Me[xe]=Me[ce],Me[ce]=Re}t.prototype.swap16=function(){const xe=this.length;if(xe%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let ce=0;cece&&(xe+=" ... "),""},x&&(t.prototype[x]=t.prototype.inspect),t.prototype.compare=function(xe,ce,Re,$e,rt){if(qe(xe,Uint8Array)&&(xe=t.from(xe,xe.offset,xe.byteLength)),!t.isBuffer(xe))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof xe);if(ce===void 0&&(ce=0),Re===void 0&&(Re=xe?xe.length:0),$e===void 0&&($e=0),rt===void 0&&(rt=this.length),ce<0||Re>xe.length||$e<0||rt>this.length)throw new RangeError("out of range index");if($e>=rt&&ce>=Re)return 0;if($e>=rt)return-1;if(ce>=Re)return 1;if(ce>>>=0,Re>>>=0,$e>>>=0,rt>>>=0,this===xe)return 0;let Je=rt-$e,At=Re-ce;const St=Math.min(Je,At),Rt=this.slice($e,rt),Ut=xe.slice(ce,Re);for(let ir=0;ir2147483647?ce=2147483647:ce<-2147483648&&(ce=-2147483648),ce=+ce,et(ce)&&(ce=$e?0:Me.length-1),ce<0&&(ce=Me.length+ce),ce>=Me.length){if($e)return-1;ce=Me.length-1}else if(ce<0)if($e)ce=0;else return-1;if(typeof xe=="string"&&(xe=t.from(xe,Re)),t.isBuffer(xe))return xe.length===0?-1:M(Me,xe,ce,Re,$e);if(typeof xe=="number")return xe=xe&255,typeof Uint8Array.prototype.indexOf=="function"?$e?Uint8Array.prototype.indexOf.call(Me,xe,ce):Uint8Array.prototype.lastIndexOf.call(Me,xe,ce):M(Me,[xe],ce,Re,$e);throw new TypeError("val must be string, number or Buffer")}function M(Me,xe,ce,Re,$e){let rt=1,Je=Me.length,At=xe.length;if(Re!==void 0&&(Re=String(Re).toLowerCase(),Re==="ucs2"||Re==="ucs-2"||Re==="utf16le"||Re==="utf-16le")){if(Me.length<2||xe.length<2)return-1;rt=2,Je/=2,At/=2,ce/=2}function St(Ut,ir){return rt===1?Ut[ir]:Ut.readUInt16BE(ir*rt)}let Rt;if($e){let Ut=-1;for(Rt=ce;RtJe&&(ce=Je-At),Rt=ce;Rt>=0;Rt--){let Ut=!0;for(let ir=0;ir$e&&(Re=$e)):Re=$e;const rt=xe.length;Re>rt/2&&(Re=rt/2);let Je;for(Je=0;Je>>0,isFinite(Re)?(Re=Re>>>0,$e===void 0&&($e="utf8")):($e=Re,Re=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const rt=this.length-ce;if((Re===void 0||Re>rt)&&(Re=rt),xe.length>0&&(Re<0||ce<0)||ce>this.length)throw new RangeError("Attempt to write outside buffer bounds");$e||($e="utf8");let Je=!1;for(;;)switch($e){case"hex":return _(this,xe,ce,Re);case"utf8":case"utf-8":return w(this,xe,ce,Re);case"ascii":case"latin1":case"binary":return p(this,xe,ce,Re);case"base64":return u(this,xe,ce,Re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,xe,ce,Re);default:if(Je)throw new TypeError("Unknown encoding: "+$e);$e=(""+$e).toLowerCase(),Je=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function m(Me,xe,ce){return xe===0&&ce===Me.length?G.fromByteArray(Me):G.fromByteArray(Me.slice(xe,ce))}function R(Me,xe,ce){ce=Math.min(Me.length,ce);const Re=[];let $e=xe;for(;$e239?4:rt>223?3:rt>191?2:1;if($e+At<=ce){let St,Rt,Ut,ir;switch(At){case 1:rt<128&&(Je=rt);break;case 2:St=Me[$e+1],(St&192)===128&&(ir=(rt&31)<<6|St&63,ir>127&&(Je=ir));break;case 3:St=Me[$e+1],Rt=Me[$e+2],(St&192)===128&&(Rt&192)===128&&(ir=(rt&15)<<12|(St&63)<<6|Rt&63,ir>2047&&(ir<55296||ir>57343)&&(Je=ir));break;case 4:St=Me[$e+1],Rt=Me[$e+2],Ut=Me[$e+3],(St&192)===128&&(Rt&192)===128&&(Ut&192)===128&&(ir=(rt&15)<<18|(St&63)<<12|(Rt&63)<<6|Ut&63,ir>65535&&ir<1114112&&(Je=ir))}}Je===null?(Je=65533,At=1):Je>65535&&(Je-=65536,Re.push(Je>>>10&1023|55296),Je=56320|Je&1023),Re.push(Je),$e+=At}return z(Re)}var P=4096;function z(Me){const xe=Me.length;if(xe<=P)return String.fromCharCode.apply(String,Me);let ce="",Re=0;for(;ReRe)&&(ce=Re);let $e="";for(let rt=xe;rtRe&&(xe=Re),ce<0?(ce+=Re,ce<0&&(ce=0)):ce>Re&&(ce=Re),cece)throw new RangeError("Trying to access beyond buffer length")}t.prototype.readUintLE=t.prototype.readUIntLE=function(xe,ce,Re){xe=xe>>>0,ce=ce>>>0,Re||N(xe,ce,this.length);let $e=this[xe],rt=1,Je=0;for(;++Je>>0,ce=ce>>>0,Re||N(xe,ce,this.length);let $e=this[xe+--ce],rt=1;for(;ce>0&&(rt*=256);)$e+=this[xe+--ce]*rt;return $e},t.prototype.readUint8=t.prototype.readUInt8=function(xe,ce){return xe=xe>>>0,ce||N(xe,1,this.length),this[xe]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(xe,ce){return xe=xe>>>0,ce||N(xe,2,this.length),this[xe]|this[xe+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(xe,ce){return xe=xe>>>0,ce||N(xe,2,this.length),this[xe]<<8|this[xe+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(xe,ce){return xe=xe>>>0,ce||N(xe,4,this.length),(this[xe]|this[xe+1]<<8|this[xe+2]<<16)+this[xe+3]*16777216},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(xe,ce){return xe=xe>>>0,ce||N(xe,4,this.length),this[xe]*16777216+(this[xe+1]<<16|this[xe+2]<<8|this[xe+3])},t.prototype.readBigUInt64LE=Ke(function(xe){xe=xe>>>0,ee(xe,"offset");const ce=this[xe],Re=this[xe+7];(ce===void 0||Re===void 0)&&q(xe,this.length-8);const $e=ce+this[++xe]*2**8+this[++xe]*2**16+this[++xe]*2**24,rt=this[++xe]+this[++xe]*2**8+this[++xe]*2**16+Re*2**24;return BigInt($e)+(BigInt(rt)<>>0,ee(xe,"offset");const ce=this[xe],Re=this[xe+7];(ce===void 0||Re===void 0)&&q(xe,this.length-8);const $e=ce*2**24+this[++xe]*2**16+this[++xe]*2**8+this[++xe],rt=this[++xe]*2**24+this[++xe]*2**16+this[++xe]*2**8+Re;return(BigInt($e)<>>0,ce=ce>>>0,Re||N(xe,ce,this.length);let $e=this[xe],rt=1,Je=0;for(;++Je=rt&&($e-=Math.pow(2,8*ce)),$e},t.prototype.readIntBE=function(xe,ce,Re){xe=xe>>>0,ce=ce>>>0,Re||N(xe,ce,this.length);let $e=ce,rt=1,Je=this[xe+--$e];for(;$e>0&&(rt*=256);)Je+=this[xe+--$e]*rt;return rt*=128,Je>=rt&&(Je-=Math.pow(2,8*ce)),Je},t.prototype.readInt8=function(xe,ce){return xe=xe>>>0,ce||N(xe,1,this.length),this[xe]&128?(255-this[xe]+1)*-1:this[xe]},t.prototype.readInt16LE=function(xe,ce){xe=xe>>>0,ce||N(xe,2,this.length);const Re=this[xe]|this[xe+1]<<8;return Re&32768?Re|4294901760:Re},t.prototype.readInt16BE=function(xe,ce){xe=xe>>>0,ce||N(xe,2,this.length);const Re=this[xe+1]|this[xe]<<8;return Re&32768?Re|4294901760:Re},t.prototype.readInt32LE=function(xe,ce){return xe=xe>>>0,ce||N(xe,4,this.length),this[xe]|this[xe+1]<<8|this[xe+2]<<16|this[xe+3]<<24},t.prototype.readInt32BE=function(xe,ce){return xe=xe>>>0,ce||N(xe,4,this.length),this[xe]<<24|this[xe+1]<<16|this[xe+2]<<8|this[xe+3]},t.prototype.readBigInt64LE=Ke(function(xe){xe=xe>>>0,ee(xe,"offset");const ce=this[xe],Re=this[xe+7];(ce===void 0||Re===void 0)&&q(xe,this.length-8);const $e=this[xe+4]+this[xe+5]*2**8+this[xe+6]*2**16+(Re<<24);return(BigInt($e)<>>0,ee(xe,"offset");const ce=this[xe],Re=this[xe+7];(ce===void 0||Re===void 0)&&q(xe,this.length-8);const $e=(ce<<24)+this[++xe]*2**16+this[++xe]*2**8+this[++xe];return(BigInt($e)<>>0,ce||N(xe,4,this.length),d.read(this,xe,!0,23,4)},t.prototype.readFloatBE=function(xe,ce){return xe=xe>>>0,ce||N(xe,4,this.length),d.read(this,xe,!1,23,4)},t.prototype.readDoubleLE=function(xe,ce){return xe=xe>>>0,ce||N(xe,8,this.length),d.read(this,xe,!0,52,8)},t.prototype.readDoubleBE=function(xe,ce){return xe=xe>>>0,ce||N(xe,8,this.length),d.read(this,xe,!1,52,8)};function U(Me,xe,ce,Re,$e,rt){if(!t.isBuffer(Me))throw new TypeError('"buffer" argument must be a Buffer instance');if(xe>$e||xeMe.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(xe,ce,Re,$e){if(xe=+xe,ce=ce>>>0,Re=Re>>>0,!$e){const At=Math.pow(2,8*Re)-1;U(this,xe,ce,Re,At,0)}let rt=1,Je=0;for(this[ce]=xe&255;++Je>>0,Re=Re>>>0,!$e){const At=Math.pow(2,8*Re)-1;U(this,xe,ce,Re,At,0)}let rt=Re-1,Je=1;for(this[ce+rt]=xe&255;--rt>=0&&(Je*=256);)this[ce+rt]=xe/Je&255;return ce+Re},t.prototype.writeUint8=t.prototype.writeUInt8=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,1,255,0),this[ce]=xe&255,ce+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,2,65535,0),this[ce]=xe&255,this[ce+1]=xe>>>8,ce+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,2,65535,0),this[ce]=xe>>>8,this[ce+1]=xe&255,ce+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,4,4294967295,0),this[ce+3]=xe>>>24,this[ce+2]=xe>>>16,this[ce+1]=xe>>>8,this[ce]=xe&255,ce+4},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,4,4294967295,0),this[ce]=xe>>>24,this[ce+1]=xe>>>16,this[ce+2]=xe>>>8,this[ce+3]=xe&255,ce+4};function Z(Me,xe,ce,Re,$e){re(xe,Re,$e,Me,ce,7);let rt=Number(xe&BigInt(4294967295));Me[ce++]=rt,rt=rt>>8,Me[ce++]=rt,rt=rt>>8,Me[ce++]=rt,rt=rt>>8,Me[ce++]=rt;let Je=Number(xe>>BigInt(32)&BigInt(4294967295));return Me[ce++]=Je,Je=Je>>8,Me[ce++]=Je,Je=Je>>8,Me[ce++]=Je,Je=Je>>8,Me[ce++]=Je,ce}function Q(Me,xe,ce,Re,$e){re(xe,Re,$e,Me,ce,7);let rt=Number(xe&BigInt(4294967295));Me[ce+7]=rt,rt=rt>>8,Me[ce+6]=rt,rt=rt>>8,Me[ce+5]=rt,rt=rt>>8,Me[ce+4]=rt;let Je=Number(xe>>BigInt(32)&BigInt(4294967295));return Me[ce+3]=Je,Je=Je>>8,Me[ce+2]=Je,Je=Je>>8,Me[ce+1]=Je,Je=Je>>8,Me[ce]=Je,ce+8}t.prototype.writeBigUInt64LE=Ke(function(xe,ce=0){return Z(this,xe,ce,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeBigUInt64BE=Ke(function(xe,ce=0){return Q(this,xe,ce,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeIntLE=function(xe,ce,Re,$e){if(xe=+xe,ce=ce>>>0,!$e){const St=Math.pow(2,8*Re-1);U(this,xe,ce,Re,St-1,-St)}let rt=0,Je=1,At=0;for(this[ce]=xe&255;++rt>0)-At&255;return ce+Re},t.prototype.writeIntBE=function(xe,ce,Re,$e){if(xe=+xe,ce=ce>>>0,!$e){const St=Math.pow(2,8*Re-1);U(this,xe,ce,Re,St-1,-St)}let rt=Re-1,Je=1,At=0;for(this[ce+rt]=xe&255;--rt>=0&&(Je*=256);)xe<0&&At===0&&this[ce+rt+1]!==0&&(At=1),this[ce+rt]=(xe/Je>>0)-At&255;return ce+Re},t.prototype.writeInt8=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,1,127,-128),xe<0&&(xe=255+xe+1),this[ce]=xe&255,ce+1},t.prototype.writeInt16LE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,2,32767,-32768),this[ce]=xe&255,this[ce+1]=xe>>>8,ce+2},t.prototype.writeInt16BE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,2,32767,-32768),this[ce]=xe>>>8,this[ce+1]=xe&255,ce+2},t.prototype.writeInt32LE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,4,2147483647,-2147483648),this[ce]=xe&255,this[ce+1]=xe>>>8,this[ce+2]=xe>>>16,this[ce+3]=xe>>>24,ce+4},t.prototype.writeInt32BE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,4,2147483647,-2147483648),xe<0&&(xe=4294967295+xe+1),this[ce]=xe>>>24,this[ce+1]=xe>>>16,this[ce+2]=xe>>>8,this[ce+3]=xe&255,ce+4},t.prototype.writeBigInt64LE=Ke(function(xe,ce=0){return Z(this,xe,ce,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),t.prototype.writeBigInt64BE=Ke(function(xe,ce=0){return Q(this,xe,ce,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ue(Me,xe,ce,Re,$e,rt){if(ce+Re>Me.length)throw new RangeError("Index out of range");if(ce<0)throw new RangeError("Index out of range")}function oe(Me,xe,ce,Re,$e){return xe=+xe,ce=ce>>>0,$e||ue(Me,xe,ce,4),d.write(Me,xe,ce,Re,23,4),ce+4}t.prototype.writeFloatLE=function(xe,ce,Re){return oe(this,xe,ce,!0,Re)},t.prototype.writeFloatBE=function(xe,ce,Re){return oe(this,xe,ce,!1,Re)};function le(Me,xe,ce,Re,$e){return xe=+xe,ce=ce>>>0,$e||ue(Me,xe,ce,8),d.write(Me,xe,ce,Re,52,8),ce+8}t.prototype.writeDoubleLE=function(xe,ce,Re){return le(this,xe,ce,!0,Re)},t.prototype.writeDoubleBE=function(xe,ce,Re){return le(this,xe,ce,!1,Re)},t.prototype.copy=function(xe,ce,Re,$e){if(!t.isBuffer(xe))throw new TypeError("argument should be a Buffer");if(Re||(Re=0),!$e&&$e!==0&&($e=this.length),ce>=xe.length&&(ce=xe.length),ce||(ce=0),$e>0&&$e=this.length)throw new RangeError("Index out of range");if($e<0)throw new RangeError("sourceEnd out of bounds");$e>this.length&&($e=this.length),xe.length-ce<$e-Re&&($e=xe.length-ce+Re);const rt=$e-Re;return this===xe&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(ce,Re,$e):Uint8Array.prototype.set.call(xe,this.subarray(Re,$e),ce),rt},t.prototype.fill=function(xe,ce,Re,$e){if(typeof xe=="string"){if(typeof ce=="string"?($e=ce,ce=0,Re=this.length):typeof Re=="string"&&($e=Re,Re=this.length),$e!==void 0&&typeof $e!="string")throw new TypeError("encoding must be a string");if(typeof $e=="string"&&!t.isEncoding($e))throw new TypeError("Unknown encoding: "+$e);if(xe.length===1){const Je=xe.charCodeAt(0);($e==="utf8"&&Je<128||$e==="latin1")&&(xe=Je)}}else typeof xe=="number"?xe=xe&255:typeof xe=="boolean"&&(xe=Number(xe));if(ce<0||this.length>>0,Re=Re===void 0?this.length:Re>>>0,xe||(xe=0);let rt;if(typeof xe=="number")for(rt=ce;rt2**32?$e=$(String(ce)):typeof ce=="bigint"&&($e=String(ce),(ce>BigInt(2)**BigInt(32)||ce<-(BigInt(2)**BigInt(32)))&&($e=$($e)),$e+="n"),Re+=` It must be ${xe}. Received ${$e}`,Re},RangeError);function $(Me){let xe="",ce=Me.length;const Re=Me[0]==="-"?1:0;for(;ce>=Re+4;ce-=3)xe=`_${Me.slice(ce-3,ce)}${xe}`;return`${Me.slice(0,ce)}${xe}`}function X(Me,xe,ce){ee(xe,"offset"),(Me[xe]===void 0||Me[xe+ce]===void 0)&&q(xe,Me.length-(ce+1))}function re(Me,xe,ce,Re,$e,rt){if(Me>ce||Me= 0${Je} and < 2${Je} ** ${(rt+1)*8}${Je}`:At=`>= -(2${Je} ** ${(rt+1)*8-1}${Je}) and < 2 ** ${(rt+1)*8-1}${Je}`,new j.ERR_OUT_OF_RANGE("value",At,Me)}X(Re,$e,rt)}function ee(Me,xe){if(typeof Me!="number")throw new j.ERR_INVALID_ARG_TYPE(xe,"number",Me)}function q(Me,xe,ce){throw Math.floor(Me)!==Me?(ee(Me,ce),new j.ERR_OUT_OF_RANGE("offset","an integer",Me)):xe<0?new j.ERR_BUFFER_OUT_OF_BOUNDS:new j.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${xe}`,Me)}var ae=/[^+/0-9A-Za-z-_]/g;function ie(Me){if(Me=Me.split("=")[0],Me=Me.trim().replace(ae,""),Me.length<2)return"";for(;Me.length%4!==0;)Me=Me+"=";return Me}function fe(Me,xe){xe=xe||1/0;let ce;const Re=Me.length;let $e=null;const rt=[];for(let Je=0;Je55295&&ce<57344){if(!$e){if(ce>56319){(xe-=3)>-1&&rt.push(239,191,189);continue}else if(Je+1===Re){(xe-=3)>-1&&rt.push(239,191,189);continue}$e=ce;continue}if(ce<56320){(xe-=3)>-1&&rt.push(239,191,189),$e=ce;continue}ce=($e-55296<<10|ce-56320)+65536}else $e&&(xe-=3)>-1&&rt.push(239,191,189);if($e=null,ce<128){if((xe-=1)<0)break;rt.push(ce)}else if(ce<2048){if((xe-=2)<0)break;rt.push(ce>>6|192,ce&63|128)}else if(ce<65536){if((xe-=3)<0)break;rt.push(ce>>12|224,ce>>6&63|128,ce&63|128)}else if(ce<1114112){if((xe-=4)<0)break;rt.push(ce>>18|240,ce>>12&63|128,ce>>6&63|128,ce&63|128)}else throw new Error("Invalid code point")}return rt}function we(Me){const xe=[];for(let ce=0;ce>8,$e=ce%256,rt.push($e),rt.push(Re);return rt}function Fe(Me){return G.toByteArray(ie(Me))}function Ce(Me,xe,ce,Re){let $e;for($e=0;$e=xe.length||$e>=Me.length);++$e)xe[$e+ce]=Me[$e];return $e}function qe(Me,xe){return Me instanceof xe||Me!=null&&Me.constructor!=null&&Me.constructor.name!=null&&Me.constructor.name===xe.name}function et(Me){return Me!==Me}var Qe=function(){const Me="0123456789abcdef",xe=new Array(256);for(let ce=0;ce<16;++ce){const Re=ce*16;for(let $e=0;$e<16;++$e)xe[Re+$e]=Me[ce]+Me[$e]}return xe}();function Ke(Me){return typeof BigInt>"u"?Xe:Me}function Xe(){throw new Error("BigInt not supported")}}}),K1=He({"node_modules/has-symbols/shams.js"(Y,G){G.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var x={},A=Symbol("test"),E=Object(A);if(typeof A=="string"||Object.prototype.toString.call(A)!=="[object Symbol]"||Object.prototype.toString.call(E)!=="[object Symbol]")return!1;var e=42;x[A]=e;for(A in x)return!1;if(typeof Object.keys=="function"&&Object.keys(x).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(x).length!==0)return!1;var t=Object.getOwnPropertySymbols(x);if(t.length!==1||t[0]!==A||!Object.prototype.propertyIsEnumerable.call(x,A))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var r=Object.getOwnPropertyDescriptor(x,A);if(r.value!==e||r.enumerable!==!0)return!1}return!0}}}),dy=He({"node_modules/has-tostringtag/shams.js"(Y,G){var d=K1();G.exports=function(){return d()&&!!Symbol.toStringTag}}}),ak=He({"node_modules/es-errors/index.js"(Y,G){G.exports=Error}}),nk=He({"node_modules/es-errors/eval.js"(Y,G){G.exports=EvalError}}),ik=He({"node_modules/es-errors/range.js"(Y,G){G.exports=RangeError}}),ok=He({"node_modules/es-errors/ref.js"(Y,G){G.exports=ReferenceError}}),Yw=He({"node_modules/es-errors/syntax.js"(Y,G){G.exports=SyntaxError}}),py=He({"node_modules/es-errors/type.js"(Y,G){G.exports=TypeError}}),sk=He({"node_modules/es-errors/uri.js"(Y,G){G.exports=URIError}}),lk=He({"node_modules/has-symbols/index.js"(Y,G){var d=typeof Symbol<"u"&&Symbol,x=K1();G.exports=function(){return typeof d!="function"||typeof Symbol!="function"||typeof d("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:x()}}}),uk=He({"node_modules/has-proto/index.js"(Y,G){var d={foo:{}},x=Object;G.exports=function(){return{__proto__:d}.foo===d.foo&&!({__proto__:null}instanceof x)}}}),ck=He({"node_modules/function-bind/implementation.js"(Y,G){var d="Function.prototype.bind called on incompatible ",x=Object.prototype.toString,A=Math.max,E="[object Function]",e=function(a,i){for(var n=[],s=0;s"u"||!h?d:h(Uint8Array),y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?d:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?d:ArrayBuffer,"%ArrayIteratorPrototype%":f&&h?h([][Symbol.iterator]()):d,"%AsyncFromSyncIteratorPrototype%":d,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%Atomics%":typeof Atomics>"u"?d:Atomics,"%BigInt%":typeof BigInt>"u"?d:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?d:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?d:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?d:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":x,"%eval%":eval,"%EvalError%":A,"%Float32Array%":typeof Float32Array>"u"?d:Float32Array,"%Float64Array%":typeof Float64Array>"u"?d:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?d:FinalizationRegistry,"%Function%":a,"%GeneratorFunction%":T,"%Int8Array%":typeof Int8Array>"u"?d:Int8Array,"%Int16Array%":typeof Int16Array>"u"?d:Int16Array,"%Int32Array%":typeof Int32Array>"u"?d:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f&&h?h(h([][Symbol.iterator]())):d,"%JSON%":typeof JSON=="object"?JSON:d,"%Map%":typeof Map>"u"?d:Map,"%MapIteratorPrototype%":typeof Map>"u"||!f||!h?d:h(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?d:Promise,"%Proxy%":typeof Proxy>"u"?d:Proxy,"%RangeError%":E,"%ReferenceError%":e,"%Reflect%":typeof Reflect>"u"?d:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?d:Set,"%SetIteratorPrototype%":typeof Set>"u"||!f||!h?d:h(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?d:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f&&h?h(""[Symbol.iterator]()):d,"%Symbol%":f?Symbol:d,"%SyntaxError%":t,"%ThrowTypeError%":c,"%TypedArray%":l,"%TypeError%":r,"%Uint8Array%":typeof Uint8Array>"u"?d:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?d:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?d:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?d:Uint32Array,"%URIError%":o,"%WeakMap%":typeof WeakMap>"u"?d:WeakMap,"%WeakRef%":typeof WeakRef>"u"?d:WeakRef,"%WeakSet%":typeof WeakSet>"u"?d:WeakSet};if(h)try{null.error}catch(O){b=h(h(O)),y["%Error.prototype%"]=b}var b,S=function O(L){var N;if(L==="%AsyncFunction%")N=i("async function () {}");else if(L==="%GeneratorFunction%")N=i("function* () {}");else if(L==="%AsyncGeneratorFunction%")N=i("async function* () {}");else if(L==="%AsyncGenerator%"){var U=O("%AsyncGeneratorFunction%");U&&(N=U.prototype)}else if(L==="%AsyncIteratorPrototype%"){var Z=O("%AsyncGenerator%");Z&&h&&(N=h(Z.prototype))}return y[L]=N,N},M={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=J1(),w=fk(),p=_.call(Function.call,Array.prototype.concat),u=_.call(Function.apply,Array.prototype.splice),g=_.call(Function.call,String.prototype.replace),m=_.call(Function.call,String.prototype.slice),R=_.call(Function.call,RegExp.prototype.exec),P=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,z=/\\(\\)?/g,F=function(L){var N=m(L,0,1),U=m(L,-1);if(N==="%"&&U!=="%")throw new t("invalid intrinsic syntax, expected closing `%`");if(U==="%"&&N!=="%")throw new t("invalid intrinsic syntax, expected opening `%`");var Z=[];return g(L,P,function(Q,ue,oe,le){Z[Z.length]=oe?g(le,z,"$1"):ue||Q}),Z},B=function(L,N){var U=L,Z;if(w(M,U)&&(Z=M[U],U="%"+Z[0]+"%"),w(y,U)){var Q=y[U];if(Q===T&&(Q=S(U)),typeof Q>"u"&&!N)throw new r("intrinsic "+L+" exists, but is not available. Please file an issue!");return{alias:Z,name:U,value:Q}}throw new t("intrinsic "+L+" does not exist!")};G.exports=function(L,N){if(typeof L!="string"||L.length===0)throw new r("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof N!="boolean")throw new r('"allowMissing" argument must be a boolean');if(R(/^%?[^%]*%?$/,L)===null)throw new t("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var U=F(L),Z=U.length>0?U[0]:"",Q=B("%"+Z+"%",N),ue=Q.name,oe=Q.value,le=!1,j=Q.alias;j&&(Z=j[0],u(U,p([0,1],j)));for(var J=1,$=!0;J=U.length){var q=n(oe,X);$=!!q,$&&"get"in q&&!("originalValue"in q.get)?oe=q.get:oe=oe[X]}else $=w(oe,X),oe=oe[X];$&&!le&&(y[ue]=oe)}}return oe}}}),$1=He({"node_modules/es-define-property/index.js"(Y,G){var d=$0(),x=d("%Object.defineProperty%",!0)||!1;if(x)try{x({},"a",{value:1})}catch{x=!1}G.exports=x}}),gy=He({"node_modules/gopd/index.js"(Y,G){var d=$0(),x=d("%Object.getOwnPropertyDescriptor%",!0);if(x)try{x([],"length")}catch{x=null}G.exports=x}}),hk=He({"node_modules/define-data-property/index.js"(Y,G){var d=$1(),x=Yw(),A=py(),E=gy();G.exports=function(t,r,o){if(!t||typeof t!="object"&&typeof t!="function")throw new A("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new A("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new A("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new A("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new A("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new A("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,n=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,c=!!E&&E(t,r);if(d)d(t,r,{configurable:n===null&&c?c.configurable:!n,enumerable:a===null&&c?c.enumerable:!a,value:o,writable:i===null&&c?c.writable:!i});else if(s||!a&&!i&&!n)t[r]=o;else throw new x("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}}),Kw=He({"node_modules/has-property-descriptors/index.js"(Y,G){var d=$1(),x=function(){return!!d};x.hasArrayLengthDefineBug=function(){if(!d)return null;try{return d([],"length",{value:1}).length!==1}catch{return!0}},G.exports=x}}),vk=He({"node_modules/set-function-length/index.js"(Y,G){var d=$0(),x=hk(),A=Kw()(),E=gy(),e=py(),t=d("%Math.floor%");G.exports=function(o,a){if(typeof o!="function")throw new e("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||t(a)!==a)throw new e("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in o&&E){var c=E(o,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(s=!1)}return(n||s||!i)&&(A?x(o,"length",a,!0,!0):x(o,"length",a)),o}}}),yy=He({"node_modules/call-bind/index.js"(Y,G){var d=J1(),x=$0(),A=vk(),E=py(),e=x("%Function.prototype.apply%"),t=x("%Function.prototype.call%"),r=x("%Reflect.apply%",!0)||d.call(t,e),o=$1(),a=x("%Math.max%");G.exports=function(s){if(typeof s!="function")throw new E("a function is required");var c=r(d,t,arguments);return A(c,1+a(0,s.length-(arguments.length-1)),!0)};var i=function(){return r(d,e,arguments)};o?o(G.exports,"apply",{value:i}):G.exports.apply=i}}),Q0=He({"node_modules/call-bind/callBound.js"(Y,G){var d=$0(),x=yy(),A=x(d("String.prototype.indexOf"));G.exports=function(e,t){var r=d(e,!!t);return typeof r=="function"&&A(e,".prototype.")>-1?x(r):r}}}),dk=He({"node_modules/is-arguments/index.js"(Y,G){var d=dy()(),x=Q0(),A=x("Object.prototype.toString"),E=function(o){return d&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:A(o)==="[object Arguments]"},e=function(o){return E(o)?!0:o!==null&&typeof o=="object"&&typeof o.length=="number"&&o.length>=0&&A(o)!=="[object Array]"&&A(o.callee)==="[object Function]"},t=function(){return E(arguments)}();E.isLegacyArguments=e,G.exports=t?E:e}}),pk=He({"node_modules/is-generator-function/index.js"(Y,G){var d=Object.prototype.toString,x=Function.prototype.toString,A=/^\s*(?:function)?\*/,E=dy()(),e=Object.getPrototypeOf,t=function(){if(!E)return!1;try{return Function("return function*() {}")()}catch{}},r;G.exports=function(a){if(typeof a!="function")return!1;if(A.test(x.call(a)))return!0;if(!E){var i=d.call(a);return i==="[object GeneratorFunction]"}if(!e)return!1;if(typeof r>"u"){var n=t();r=n?e(n):!1}return e(a)===r}}}),gk=He({"node_modules/is-callable/index.js"(Y,G){var d=Function.prototype.toString,x=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,A,E;if(typeof x=="function"&&typeof Object.defineProperty=="function")try{A=Object.defineProperty({},"length",{get:function(){throw E}}),E={},x(function(){throw 42},null,A)}catch(y){y!==E&&(x=null)}else x=null;var e=/^\s*class\b/,t=function(b){try{var S=d.call(b);return e.test(S)}catch{return!1}},r=function(b){try{return t(b)?!1:(d.call(b),!0)}catch{return!1}},o=Object.prototype.toString,a="[object Object]",i="[object Function]",n="[object GeneratorFunction]",s="[object HTMLAllCollection]",c="[object HTML document.all class]",f="[object HTMLCollection]",v=typeof Symbol=="function"&&!!Symbol.toStringTag,h=!(0 in[,]),T=function(){return!1};typeof document=="object"&&(l=document.all,o.call(l)===o.call(document.all)&&(T=function(b){if((h||!b)&&(typeof b>"u"||typeof b=="object"))try{var S=o.call(b);return(S===s||S===c||S===f||S===a)&&b("")==null}catch{}return!1}));var l;G.exports=x?function(b){if(T(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;try{x(b,null,A)}catch(S){if(S!==E)return!1}return!t(b)&&r(b)}:function(b){if(T(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;if(v)return r(b);if(t(b))return!1;var S=o.call(b);return S!==i&&S!==n&&!/^\[object HTML/.test(S)?!1:r(b)}}}),Jw=He({"node_modules/for-each/index.js"(Y,G){var d=gk(),x=Object.prototype.toString,A=Object.prototype.hasOwnProperty,E=function(a,i,n){for(var s=0,c=a.length;s=3&&(s=n),x.call(a)==="[object Array]"?E(a,i,s):typeof a=="string"?e(a,i,s):t(a,i,s)};G.exports=r}}),$w=He({"node_modules/available-typed-arrays/index.js"(Y,G){var d=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],x=typeof globalThis>"u"?window:globalThis;G.exports=function(){for(var E=[],e=0;e"u"?window:globalThis,a=x(),i=E("String.prototype.slice"),n=Object.getPrototypeOf,s=E("Array.prototype.indexOf",!0)||function(T,l){for(var y=0;y-1?l:l!=="Object"?!1:v(T)}return e?f(T):null}}}),mk=He({"node_modules/is-typed-array/index.js"(Y,G){var d=Jw(),x=$w(),A=Q0(),E=A("Object.prototype.toString"),e=dy()(),t=gy(),r=typeof globalThis>"u"?window:globalThis,o=x(),a=A("Array.prototype.indexOf",!0)||function(v,h){for(var T=0;T-1}return t?c(v):!1}}}),Qw=He({"node_modules/util/support/types.js"(Y){var G=dk(),d=pk(),x=yk(),A=mk();function E(Ae){return Ae.call.bind(Ae)}var e=typeof BigInt<"u",t=typeof Symbol<"u",r=E(Object.prototype.toString),o=E(Number.prototype.valueOf),a=E(String.prototype.valueOf),i=E(Boolean.prototype.valueOf);e&&(n=E(BigInt.prototype.valueOf));var n;t&&(s=E(Symbol.prototype.valueOf));var s;function c(Ae,Fe){if(typeof Ae!="object")return!1;try{return Fe(Ae),!0}catch{return!1}}Y.isArgumentsObject=G,Y.isGeneratorFunction=d,Y.isTypedArray=A;function f(Ae){return typeof Promise<"u"&&Ae instanceof Promise||Ae!==null&&typeof Ae=="object"&&typeof Ae.then=="function"&&typeof Ae.catch=="function"}Y.isPromise=f;function v(Ae){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Ae):A(Ae)||Z(Ae)}Y.isArrayBufferView=v;function h(Ae){return x(Ae)==="Uint8Array"}Y.isUint8Array=h;function T(Ae){return x(Ae)==="Uint8ClampedArray"}Y.isUint8ClampedArray=T;function l(Ae){return x(Ae)==="Uint16Array"}Y.isUint16Array=l;function y(Ae){return x(Ae)==="Uint32Array"}Y.isUint32Array=y;function b(Ae){return x(Ae)==="Int8Array"}Y.isInt8Array=b;function S(Ae){return x(Ae)==="Int16Array"}Y.isInt16Array=S;function M(Ae){return x(Ae)==="Int32Array"}Y.isInt32Array=M;function _(Ae){return x(Ae)==="Float32Array"}Y.isFloat32Array=_;function w(Ae){return x(Ae)==="Float64Array"}Y.isFloat64Array=w;function p(Ae){return x(Ae)==="BigInt64Array"}Y.isBigInt64Array=p;function u(Ae){return x(Ae)==="BigUint64Array"}Y.isBigUint64Array=u;function g(Ae){return r(Ae)==="[object Map]"}g.working=typeof Map<"u"&&g(new Map);function m(Ae){return typeof Map>"u"?!1:g.working?g(Ae):Ae instanceof Map}Y.isMap=m;function R(Ae){return r(Ae)==="[object Set]"}R.working=typeof Set<"u"&&R(new Set);function P(Ae){return typeof Set>"u"?!1:R.working?R(Ae):Ae instanceof Set}Y.isSet=P;function z(Ae){return r(Ae)==="[object WeakMap]"}z.working=typeof WeakMap<"u"&&z(new WeakMap);function F(Ae){return typeof WeakMap>"u"?!1:z.working?z(Ae):Ae instanceof WeakMap}Y.isWeakMap=F;function B(Ae){return r(Ae)==="[object WeakSet]"}B.working=typeof WeakSet<"u"&&B(new WeakSet);function O(Ae){return B(Ae)}Y.isWeakSet=O;function L(Ae){return r(Ae)==="[object ArrayBuffer]"}L.working=typeof ArrayBuffer<"u"&&L(new ArrayBuffer);function N(Ae){return typeof ArrayBuffer>"u"?!1:L.working?L(Ae):Ae instanceof ArrayBuffer}Y.isArrayBuffer=N;function U(Ae){return r(Ae)==="[object DataView]"}U.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&U(new DataView(new ArrayBuffer(1),0,1));function Z(Ae){return typeof DataView>"u"?!1:U.working?U(Ae):Ae instanceof DataView}Y.isDataView=Z;var Q=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ue(Ae){return r(Ae)==="[object SharedArrayBuffer]"}function oe(Ae){return typeof Q>"u"?!1:(typeof ue.working>"u"&&(ue.working=ue(new Q)),ue.working?ue(Ae):Ae instanceof Q)}Y.isSharedArrayBuffer=oe;function le(Ae){return r(Ae)==="[object AsyncFunction]"}Y.isAsyncFunction=le;function j(Ae){return r(Ae)==="[object Map Iterator]"}Y.isMapIterator=j;function J(Ae){return r(Ae)==="[object Set Iterator]"}Y.isSetIterator=J;function $(Ae){return r(Ae)==="[object Generator]"}Y.isGeneratorObject=$;function X(Ae){return r(Ae)==="[object WebAssembly.Module]"}Y.isWebAssemblyCompiledModule=X;function re(Ae){return c(Ae,o)}Y.isNumberObject=re;function ee(Ae){return c(Ae,a)}Y.isStringObject=ee;function q(Ae){return c(Ae,i)}Y.isBooleanObject=q;function ae(Ae){return e&&c(Ae,n)}Y.isBigIntObject=ae;function ie(Ae){return t&&c(Ae,s)}Y.isSymbolObject=ie;function fe(Ae){return re(Ae)||ee(Ae)||q(Ae)||ae(Ae)||ie(Ae)}Y.isBoxedPrimitive=fe;function we(Ae){return typeof Uint8Array<"u"&&(N(Ae)||oe(Ae))}Y.isAnyArrayBuffer=we,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Ae){Object.defineProperty(Y,Ae,{enumerable:!1,value:function(){throw new Error(Ae+" is not supported in userland")}})})}}),e2=He({"node_modules/util/support/isBufferBrowser.js"(Y,G){G.exports=function(x){return x&&typeof x=="object"&&typeof x.copy=="function"&&typeof x.fill=="function"&&typeof x.readUInt8=="function"}}}),t2=He({"(disabled):node_modules/util/util.js"(Y){var G=Object.getOwnPropertyDescriptors||function(Z){for(var Q=Object.keys(Z),ue={},oe=0;oe=oe)return J;switch(J){case"%s":return String(ue[Q++]);case"%d":return Number(ue[Q++]);case"%j":try{return JSON.stringify(ue[Q++])}catch{return"[Circular]"}default:return J}}),j=ue[Q];Q"u")return function(){return Y.deprecate(U,Z).apply(this,arguments)};var Q=!1;function ue(){if(!Q){if(process.throwDeprecation)throw new Error(Z);process.traceDeprecation?console.trace(Z):console.error(Z),Q=!0}return U.apply(this,arguments)}return ue};var x={},A=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),A=new RegExp("^"+E+"$","i");var E;Y.debuglog=function(U){if(U=U.toUpperCase(),!x[U])if(A.test(U)){var Z=process.pid;x[U]=function(){var Q=Y.format.apply(Y,arguments);console.error("%s %d: %s",U,Z,Q)}}else x[U]=function(){};return x[U]};function e(U,Z){var Q={seen:[],stylize:r};return arguments.length>=3&&(Q.depth=arguments[2]),arguments.length>=4&&(Q.colors=arguments[3]),h(Z)?Q.showHidden=Z:Z&&Y._extend(Q,Z),M(Q.showHidden)&&(Q.showHidden=!1),M(Q.depth)&&(Q.depth=2),M(Q.colors)&&(Q.colors=!1),M(Q.customInspect)&&(Q.customInspect=!0),Q.colors&&(Q.stylize=t),a(Q,U,Q.depth)}Y.inspect=e,e.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]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(U,Z){var Q=e.styles[Z];return Q?"\x1B["+e.colors[Q][0]+"m"+U+"\x1B["+e.colors[Q][1]+"m":U}function r(U,Z){return U}function o(U){var Z={};return U.forEach(function(Q,ue){Z[Q]=!0}),Z}function a(U,Z,Q){if(U.customInspect&&Z&&g(Z.inspect)&&Z.inspect!==Y.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var ue=Z.inspect(Q,U);return b(ue)||(ue=a(U,ue,Q)),ue}var oe=i(U,Z);if(oe)return oe;var le=Object.keys(Z),j=o(le);if(U.showHidden&&(le=Object.getOwnPropertyNames(Z)),u(Z)&&(le.indexOf("message")>=0||le.indexOf("description")>=0))return n(Z);if(le.length===0){if(g(Z)){var J=Z.name?": "+Z.name:"";return U.stylize("[Function"+J+"]","special")}if(_(Z))return U.stylize(RegExp.prototype.toString.call(Z),"regexp");if(p(Z))return U.stylize(Date.prototype.toString.call(Z),"date");if(u(Z))return n(Z)}var $="",X=!1,re=["{","}"];if(v(Z)&&(X=!0,re=["[","]"]),g(Z)){var ee=Z.name?": "+Z.name:"";$=" [Function"+ee+"]"}if(_(Z)&&($=" "+RegExp.prototype.toString.call(Z)),p(Z)&&($=" "+Date.prototype.toUTCString.call(Z)),u(Z)&&($=" "+n(Z)),le.length===0&&(!X||Z.length==0))return re[0]+$+re[1];if(Q<0)return _(Z)?U.stylize(RegExp.prototype.toString.call(Z),"regexp"):U.stylize("[Object]","special");U.seen.push(Z);var q;return X?q=s(U,Z,Q,j,le):q=le.map(function(ae){return c(U,Z,Q,j,ae,X)}),U.seen.pop(),f(q,$,re)}function i(U,Z){if(M(Z))return U.stylize("undefined","undefined");if(b(Z)){var Q="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize(Q,"string")}if(y(Z))return U.stylize(""+Z,"number");if(h(Z))return U.stylize(""+Z,"boolean");if(T(Z))return U.stylize("null","null")}function n(U){return"["+Error.prototype.toString.call(U)+"]"}function s(U,Z,Q,ue,oe){for(var le=[],j=0,J=Z.length;j-1&&(le?J=J.split(` +`).map(function(X){return" "+X}).join(` +`).slice(2):J=` +`+J.split(` +`).map(function(X){return" "+X}).join(` +`))):J=U.stylize("[Circular]","special")),M(j)){if(le&&oe.match(/^\d+$/))return J;j=JSON.stringify(""+oe),j.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(j=j.slice(1,-1),j=U.stylize(j,"name")):(j=j.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),j=U.stylize(j,"string"))}return j+": "+J}function f(U,Z,Q){var ue=U.reduce(function(oe,le){return le.indexOf(` +`)>=0,oe+le.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ue>60?Q[0]+(Z===""?"":Z+` + `)+" "+U.join(`, + `)+" "+Q[1]:Q[0]+Z+" "+U.join(", ")+" "+Q[1]}Y.types=Qw();function v(U){return Array.isArray(U)}Y.isArray=v;function h(U){return typeof U=="boolean"}Y.isBoolean=h;function T(U){return U===null}Y.isNull=T;function l(U){return U==null}Y.isNullOrUndefined=l;function y(U){return typeof U=="number"}Y.isNumber=y;function b(U){return typeof U=="string"}Y.isString=b;function S(U){return typeof U=="symbol"}Y.isSymbol=S;function M(U){return U===void 0}Y.isUndefined=M;function _(U){return w(U)&&R(U)==="[object RegExp]"}Y.isRegExp=_,Y.types.isRegExp=_;function w(U){return typeof U=="object"&&U!==null}Y.isObject=w;function p(U){return w(U)&&R(U)==="[object Date]"}Y.isDate=p,Y.types.isDate=p;function u(U){return w(U)&&(R(U)==="[object Error]"||U instanceof Error)}Y.isError=u,Y.types.isNativeError=u;function g(U){return typeof U=="function"}Y.isFunction=g;function m(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Y.isPrimitive=m,Y.isBuffer=e2();function R(U){return Object.prototype.toString.call(U)}function P(U){return U<10?"0"+U.toString(10):U.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var U=new Date,Z=[P(U.getHours()),P(U.getMinutes()),P(U.getSeconds())].join(":");return[U.getDate(),z[U.getMonth()],Z].join(" ")}Y.log=function(){console.log("%s - %s",F(),Y.format.apply(Y,arguments))},Y.inherits=od(),Y._extend=function(U,Z){if(!Z||!w(Z))return U;for(var Q=Object.keys(Z),ue=Q.length;ue--;)U[Q[ue]]=Z[Q[ue]];return U};function B(U,Z){return Object.prototype.hasOwnProperty.call(U,Z)}var O=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Y.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if(O&&Z[O]){var Q=Z[O];if(typeof Q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Q}function Q(){for(var ue,oe,le=new Promise(function($,X){ue=$,oe=X}),j=[],J=0;J0?this.tail.next=h:this.head=h,this.tail=h,++this.length}},{key:"unshift",value:function(v){var h={data:v,next:this.head};this.length===0&&(this.tail=h),this.head=h,++this.length}},{key:"shift",value:function(){if(this.length!==0){var v=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,v}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(v){if(this.length===0)return"";for(var h=this.head,T=""+h.data;h=h.next;)T+=v+h.data;return T}},{key:"concat",value:function(v){if(this.length===0)return o.alloc(0);for(var h=o.allocUnsafe(v>>>0),T=this.head,l=0;T;)s(T.data,h,l),l+=T.data.length,T=T.next;return h}},{key:"consume",value:function(v,h){var T;return vy.length?y.length:v;if(b===y.length?l+=y:l+=y.slice(0,v),v-=b,v===0){b===y.length?(++T,h.next?this.head=h.next:this.head=this.tail=null):(this.head=h,h.data=y.slice(b));break}++T}return this.length-=T,l}},{key:"_getBuffer",value:function(v){var h=o.allocUnsafe(v),T=this.head,l=1;for(T.data.copy(h),v-=T.data.length;T=T.next;){var y=T.data,b=v>y.length?y.length:v;if(y.copy(h,h.length-v,0,b),v-=b,v===0){b===y.length?(++l,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=y.slice(b));break}++l}return this.length-=l,h}},{key:n,value:function(v,h){return i(this,x({},h,{depth:0,customInspect:!1}))}}]),c}()}}),r2=He({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"(Y,G){function d(r,o){var a=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(o?o(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(e,this,r)):process.nextTick(e,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(s){!o&&s?a._writableState?a._writableState.errorEmitted?process.nextTick(A,a):(a._writableState.errorEmitted=!0,process.nextTick(x,a,s)):process.nextTick(x,a,s):o?(process.nextTick(A,a),o(s)):process.nextTick(A,a)}),this)}function x(r,o){e(r,o),A(r)}function A(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function E(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function e(r,o){r.emit("error",o)}function t(r,o){var a=r._readableState,i=r._writableState;a&&a.autoDestroy||i&&i.autoDestroy?r.destroy(o):r.emit("error",o)}G.exports={destroy:d,undestroy:E,errorOrDestroy:t}}}),Fp=He({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"(Y,G){function d(o,a){o.prototype=Object.create(a.prototype),o.prototype.constructor=o,o.__proto__=a}var x={};function A(o,a,i){i||(i=Error);function n(c,f,v){return typeof a=="string"?a:a(c,f,v)}var s=function(c){d(f,c);function f(v,h,T){return c.call(this,n(v,h,T))||this}return f}(i);s.prototype.name=i.name,s.prototype.code=o,x[o]=s}function E(o,a){if(Array.isArray(o)){var i=o.length;return o=o.map(function(n){return String(n)}),i>2?"one of ".concat(a," ").concat(o.slice(0,i-1).join(", "),", or ")+o[i-1]:i===2?"one of ".concat(a," ").concat(o[0]," or ").concat(o[1]):"of ".concat(a," ").concat(o[0])}else return"of ".concat(a," ").concat(String(o))}function e(o,a,i){return o.substr(0,a.length)===a}function t(o,a,i){return(i===void 0||i>o.length)&&(i=o.length),o.substring(i-a.length,i)===a}function r(o,a,i){return typeof i!="number"&&(i=0),i+a.length>o.length?!1:o.indexOf(a,i)!==-1}A("ERR_INVALID_OPT_VALUE",function(o,a){return'The value "'+a+'" is invalid for option "'+o+'"'},TypeError),A("ERR_INVALID_ARG_TYPE",function(o,a,i){var n;typeof a=="string"&&e(a,"not ")?(n="must not be",a=a.replace(/^not /,"")):n="must be";var s;if(t(o," argument"))s="The ".concat(o," ").concat(n," ").concat(E(a,"type"));else{var c=r(o,".")?"property":"argument";s='The "'.concat(o,'" ').concat(c," ").concat(n," ").concat(E(a,"type"))}return s+=". Received type ".concat(typeof i),s},TypeError),A("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),A("ERR_METHOD_NOT_IMPLEMENTED",function(o){return"The "+o+" method is not implemented"}),A("ERR_STREAM_PREMATURE_CLOSE","Premature close"),A("ERR_STREAM_DESTROYED",function(o){return"Cannot call "+o+" 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(o){return"Unknown encoding: "+o},TypeError),A("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),G.exports.codes=x}}),a2=He({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(Y,G){var d=Fp().codes.ERR_INVALID_OPT_VALUE;function x(E,e,t){return E.highWaterMark!=null?E.highWaterMark:e?E[t]:null}function A(E,e,t,r){var o=x(e,r,t);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var a=r?t:"highWaterMark";throw new d(a,o)}return Math.floor(o)}return E.objectMode?16:16*1024}G.exports={getHighWaterMark:A}}}),xk=He({"node_modules/util-deprecate/browser.js"(Y,G){G.exports=d;function d(A,E){if(x("noDeprecation"))return A;var e=!1;function t(){if(!e){if(x("throwDeprecation"))throw new Error(E);x("traceDeprecation")?console.trace(E):console.warn(E),e=!0}return A.apply(this,arguments)}return t}function x(A){try{if(!window.localStorage)return!1}catch{return!1}var E=window.localStorage[A];return E==null?!1:String(E).toLowerCase()==="true"}}}),n2=He({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(Y,G){G.exports=p;function d(j){var J=this;this.next=null,this.entry=null,this.finish=function(){le(J,j)}}var x;p.WritableState=_;var A={deprecate:xk()},E=Xw(),e=zp().Buffer,t=window.Uint8Array||function(){};function r(j){return e.from(j)}function o(j){return e.isBuffer(j)||j instanceof t}var a=r2(),i=a2(),n=i.getHighWaterMark,s=Fp().codes,c=s.ERR_INVALID_ARG_TYPE,f=s.ERR_METHOD_NOT_IMPLEMENTED,v=s.ERR_MULTIPLE_CALLBACK,h=s.ERR_STREAM_CANNOT_PIPE,T=s.ERR_STREAM_DESTROYED,l=s.ERR_STREAM_NULL_VALUES,y=s.ERR_STREAM_WRITE_AFTER_END,b=s.ERR_UNKNOWN_ENCODING,S=a.errorOrDestroy;od()(p,E);function M(){}function _(j,J,$){x=x||Op(),j=j||{},typeof $!="boolean"&&($=J instanceof x),this.objectMode=!!j.objectMode,$&&(this.objectMode=this.objectMode||!!j.writableObjectMode),this.highWaterMark=n(this,j,"writableHighWaterMark",$),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var X=j.decodeStrings===!1;this.decodeStrings=!X,this.defaultEncoding=j.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(re){B(J,re)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=j.emitClose!==!1,this.autoDestroy=!!j.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}_.prototype.getBuffer=function(){for(var J=this.bufferedRequest,$=[];J;)$.push(J),J=J.next;return $},function(){try{Object.defineProperty(_.prototype,"buffer",{get:A.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var w;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(w=Function.prototype[Symbol.hasInstance],Object.defineProperty(p,Symbol.hasInstance,{value:function(J){return w.call(this,J)?!0:this!==p?!1:J&&J._writableState instanceof _}})):w=function(J){return J instanceof this};function p(j){x=x||Op();var J=this instanceof x;if(!J&&!w.call(p,this))return new p(j);this._writableState=new _(j,this,J),this.writable=!0,j&&(typeof j.write=="function"&&(this._write=j.write),typeof j.writev=="function"&&(this._writev=j.writev),typeof j.destroy=="function"&&(this._destroy=j.destroy),typeof j.final=="function"&&(this._final=j.final)),E.call(this)}p.prototype.pipe=function(){S(this,new h)};function u(j,J){var $=new y;S(j,$),process.nextTick(J,$)}function g(j,J,$,X){var re;return $===null?re=new l:typeof $!="string"&&!J.objectMode&&(re=new c("chunk",["string","Buffer"],$)),re?(S(j,re),process.nextTick(X,re),!1):!0}p.prototype.write=function(j,J,$){var X=this._writableState,re=!1,ee=!X.objectMode&&o(j);return ee&&!e.isBuffer(j)&&(j=r(j)),typeof J=="function"&&($=J,J=null),ee?J="buffer":J||(J=X.defaultEncoding),typeof $!="function"&&($=M),X.ending?u(this,$):(ee||g(this,X,j,$))&&(X.pendingcb++,re=R(this,X,ee,j,J,$)),re},p.prototype.cork=function(){this._writableState.corked++},p.prototype.uncork=function(){var j=this._writableState;j.corked&&(j.corked--,!j.writing&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&N(this,j))},p.prototype.setDefaultEncoding=function(J){if(typeof J=="string"&&(J=J.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((J+"").toLowerCase())>-1))throw new b(J);return this._writableState.defaultEncoding=J,this},Object.defineProperty(p.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function m(j,J,$){return!j.objectMode&&j.decodeStrings!==!1&&typeof J=="string"&&(J=e.from(J,$)),J}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function R(j,J,$,X,re,ee){if(!$){var q=m(J,X,re);X!==q&&($=!0,re="buffer",X=q)}var ae=J.objectMode?1:X.length;J.length+=ae;var ie=J.length>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function t(T,l,y){var b=l.length-1;if(b=0?(S>0&&(T.lastNeed=S-1),S):--b=0?(S>0&&(T.lastNeed=S-2),S):--b=0?(S>0&&(S===2?S=0:T.lastNeed=S-3),S):0))}function r(T,l,y){if((l[0]&192)!==128)return T.lastNeed=0,"�";if(T.lastNeed>1&&l.length>1){if((l[1]&192)!==128)return T.lastNeed=1,"�";if(T.lastNeed>2&&l.length>2&&(l[2]&192)!==128)return T.lastNeed=2,"�"}}function o(T){var l=this.lastTotal-this.lastNeed,y=r(this,T);if(y!==void 0)return y;if(this.lastNeed<=T.length)return T.copy(this.lastChar,l,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,l,0,T.length),this.lastNeed-=T.length}function a(T,l){var y=t(this,T,l);if(!this.lastNeed)return T.toString("utf8",l);this.lastTotal=y;var b=T.length-(y-this.lastNeed);return T.copy(this.lastChar,0,b),T.toString("utf8",l,b)}function i(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+"�":l}function n(T,l){if((T.length-l)%2===0){var y=T.toString("utf16le",l);if(y){var b=y.charCodeAt(y.length-1);if(b>=55296&&b<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],y.slice(0,-1)}return y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",l,T.length-1)}function s(T){var l=T&&T.length?this.write(T):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return l+this.lastChar.toString("utf16le",0,y)}return l}function c(T,l){var y=(T.length-l)%3;return y===0?T.toString("base64",l):(this.lastNeed=3-y,this.lastTotal=3,y===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",l,T.length-y))}function f(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+this.lastChar.toString("base64",0,3-this.lastNeed):l}function v(T){return T.toString(this.encoding)}function h(T){return T&&T.length?this.write(T):""}}}),Q1=He({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(Y,G){var d=Fp().codes.ERR_STREAM_PREMATURE_CLOSE;function x(t){var r=!1;return function(){if(!r){r=!0;for(var o=arguments.length,a=new Array(o),i=0;i0)if(typeof q!="string"&&!we.objectMode&&Object.getPrototypeOf(q)!==E.prototype&&(q=t(q)),ie)we.endEmitted?M(ee,new l):m(ee,we,q,!0);else if(we.ended)M(ee,new h);else{if(we.destroyed)return!1;we.reading=!1,we.decoder&&!ae?(q=we.decoder.write(q),we.objectMode||q.length!==0?m(ee,we,q,!1):N(ee,we)):m(ee,we,q,!1)}else ie||(we.reading=!1,N(ee,we))}return!we.ended&&(we.length=P?ee=P:(ee--,ee|=ee>>>1,ee|=ee>>>2,ee|=ee>>>4,ee|=ee>>>8,ee|=ee>>>16,ee++),ee}function F(ee,q){return ee<=0||q.length===0&&q.ended?0:q.objectMode?1:ee!==ee?q.flowing&&q.length?q.buffer.head.data.length:q.length:(ee>q.highWaterMark&&(q.highWaterMark=z(ee)),ee<=q.length?ee:q.ended?q.length:(q.needReadable=!0,0))}u.prototype.read=function(ee){a("read",ee),ee=parseInt(ee,10);var q=this._readableState,ae=ee;if(ee!==0&&(q.emittedReadable=!1),ee===0&&q.needReadable&&((q.highWaterMark!==0?q.length>=q.highWaterMark:q.length>0)||q.ended))return a("read: emitReadable",q.length,q.ended),q.length===0&&q.ended?$(this):O(this),null;if(ee=F(ee,q),ee===0&&q.ended)return q.length===0&&$(this),null;var ie=q.needReadable;a("need readable",ie),(q.length===0||q.length-ee0?fe=J(ee,q):fe=null,fe===null?(q.needReadable=q.length<=q.highWaterMark,ee=0):(q.length-=ee,q.awaitDrain=0),q.length===0&&(q.ended||(q.needReadable=!0),ae!==ee&&q.ended&&$(this)),fe!==null&&this.emit("data",fe),fe};function B(ee,q){if(a("onEofChunk"),!q.ended){if(q.decoder){var ae=q.decoder.end();ae&&ae.length&&(q.buffer.push(ae),q.length+=q.objectMode?1:ae.length)}q.ended=!0,q.sync?O(ee):(q.needReadable=!1,q.emittedReadable||(q.emittedReadable=!0,L(ee)))}}function O(ee){var q=ee._readableState;a("emitReadable",q.needReadable,q.emittedReadable),q.needReadable=!1,q.emittedReadable||(a("emitReadable",q.flowing),q.emittedReadable=!0,process.nextTick(L,ee))}function L(ee){var q=ee._readableState;a("emitReadable_",q.destroyed,q.length,q.ended),!q.destroyed&&(q.length||q.ended)&&(ee.emit("readable"),q.emittedReadable=!1),q.needReadable=!q.flowing&&!q.ended&&q.length<=q.highWaterMark,j(ee)}function N(ee,q){q.readingMore||(q.readingMore=!0,process.nextTick(U,ee,q))}function U(ee,q){for(;!q.reading&&!q.ended&&(q.length1&&re(ie.pipes,ee)!==-1)&&!qe&&(a("false write response, pause",ie.awaitDrain),ie.awaitDrain++),ae.pause())}function Ke(ce){a("onerror",ce),xe(),ee.removeListener("error",Ke),x(ee,"error")===0&&M(ee,ce)}w(ee,"error",Ke);function Xe(){ee.removeListener("finish",Me),xe()}ee.once("close",Xe);function Me(){a("onfinish"),ee.removeListener("close",Xe),xe()}ee.once("finish",Me);function xe(){a("unpipe"),ae.unpipe(ee)}return ee.emit("pipe",ae),ie.flowing||(a("pipe resume"),ae.resume()),ee};function Z(ee){return function(){var ae=ee._readableState;a("pipeOnDrain",ae.awaitDrain),ae.awaitDrain&&ae.awaitDrain--,ae.awaitDrain===0&&x(ee,"data")&&(ae.flowing=!0,j(ee))}}u.prototype.unpipe=function(ee){var q=this._readableState,ae={hasUnpiped:!1};if(q.pipesCount===0)return this;if(q.pipesCount===1)return ee&&ee!==q.pipes?this:(ee||(ee=q.pipes),q.pipes=null,q.pipesCount=0,q.flowing=!1,ee&&ee.emit("unpipe",this,ae),this);if(!ee){var ie=q.pipes,fe=q.pipesCount;q.pipes=null,q.pipesCount=0,q.flowing=!1;for(var we=0;we0,ie.flowing!==!1&&this.resume()):ee==="readable"&&!ie.endEmitted&&!ie.readableListening&&(ie.readableListening=ie.needReadable=!0,ie.flowing=!1,ie.emittedReadable=!1,a("on readable",ie.length,ie.reading),ie.length?O(this):ie.reading||process.nextTick(ue,this)),ae},u.prototype.addListener=u.prototype.on,u.prototype.removeListener=function(ee,q){var ae=A.prototype.removeListener.call(this,ee,q);return ee==="readable"&&process.nextTick(Q,this),ae},u.prototype.removeAllListeners=function(ee){var q=A.prototype.removeAllListeners.apply(this,arguments);return(ee==="readable"||ee===void 0)&&process.nextTick(Q,this),q};function Q(ee){var q=ee._readableState;q.readableListening=ee.listenerCount("readable")>0,q.resumeScheduled&&!q.paused?q.flowing=!0:ee.listenerCount("data")>0&&ee.resume()}function ue(ee){a("readable nexttick read 0"),ee.read(0)}u.prototype.resume=function(){var ee=this._readableState;return ee.flowing||(a("resume"),ee.flowing=!ee.readableListening,oe(this,ee)),ee.paused=!1,this};function oe(ee,q){q.resumeScheduled||(q.resumeScheduled=!0,process.nextTick(le,ee,q))}function le(ee,q){a("resume",q.reading),q.reading||ee.read(0),q.resumeScheduled=!1,ee.emit("resume"),j(ee),q.flowing&&!q.reading&&ee.read(0)}u.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function j(ee){var q=ee._readableState;for(a("flow",q.flowing);q.flowing&&ee.read()!==null;);}u.prototype.wrap=function(ee){var q=this,ae=this._readableState,ie=!1;ee.on("end",function(){if(a("wrapped end"),ae.decoder&&!ae.ended){var Ae=ae.decoder.end();Ae&&Ae.length&&q.push(Ae)}q.push(null)}),ee.on("data",function(Ae){if(a("wrapped data"),ae.decoder&&(Ae=ae.decoder.write(Ae)),!(ae.objectMode&&Ae==null)&&!(!ae.objectMode&&(!Ae||!Ae.length))){var Fe=q.push(Ae);Fe||(ie=!0,ee.pause())}});for(var fe in ee)this[fe]===void 0&&typeof ee[fe]=="function"&&(this[fe]=function(Fe){return function(){return ee[Fe].apply(ee,arguments)}}(fe));for(var we=0;we<_.length;we++)ee.on(_[we],this.emit.bind(this,_[we]));return this._read=function(Ae){a("wrapped _read",Ae),ie&&(ie=!1,ee.resume())},this},typeof Symbol=="function"&&(u.prototype[Symbol.asyncIterator]=function(){return b===void 0&&(b=wk()),b(this)}),Object.defineProperty(u.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(u.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(u.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(q){this._readableState&&(this._readableState.flowing=q)}}),u._fromList=J,Object.defineProperty(u.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function J(ee,q){if(q.length===0)return null;var ae;return q.objectMode?ae=q.buffer.shift():!ee||ee>=q.length?(q.decoder?ae=q.buffer.join(""):q.buffer.length===1?ae=q.buffer.first():ae=q.buffer.concat(q.length),q.buffer.clear()):ae=q.buffer.consume(ee,q.decoder),ae}function $(ee){var q=ee._readableState;a("endReadable",q.endEmitted),q.endEmitted||(q.ended=!0,process.nextTick(X,q,ee))}function X(ee,q){if(a("endReadableNT",ee.endEmitted,ee.length),!ee.endEmitted&&ee.length===0&&(ee.endEmitted=!0,q.readable=!1,q.emit("end"),ee.autoDestroy)){var ae=q._writableState;(!ae||ae.autoDestroy&&ae.finished)&&q.destroy()}}typeof Symbol=="function"&&(u.from=function(ee,q){return S===void 0&&(S=Tk()),S(u,ee,q)});function re(ee,q){for(var ae=0,ie=ee.length;ae0;return o(y,S,M,function(_){T||(T=_),_&&l.forEach(a),!S&&(l.forEach(a),h(T))})});return f.reduce(i)}G.exports=s}}),Mk=He({"node_modules/stream-browserify/index.js"(Y,G){G.exports=A;var d=Mp().EventEmitter,x=od();x(A,d),A.Readable=o2(),A.Writable=n2(),A.Duplex=Op(),A.Transform=s2(),A.PassThrough=Ak(),A.finished=Q1(),A.pipeline=Sk(),A.Stream=A;function A(){d.call(this)}A.prototype.pipe=function(E,e){var t=this;function r(f){E.writable&&E.write(f)===!1&&t.pause&&t.pause()}t.on("data",r);function o(){t.readable&&t.resume&&t.resume()}E.on("drain",o),!E._isStdio&&(!e||e.end!==!1)&&(t.on("end",i),t.on("close",n));var a=!1;function i(){a||(a=!0,E.end())}function n(){a||(a=!0,typeof E.destroy=="function"&&E.destroy())}function s(f){if(c(),d.listenerCount(this,"error")===0)throw f}t.on("error",s),E.on("error",s);function c(){t.removeListener("data",r),E.removeListener("drain",o),t.removeListener("end",i),t.removeListener("close",n),t.removeListener("error",s),E.removeListener("error",s),t.removeListener("end",c),t.removeListener("close",c),E.removeListener("close",c)}return t.on("end",c),t.on("close",c),E.on("close",c),E.emit("pipe",t),E}}}),eg=He({"node_modules/util/util.js"(Y){var G=Object.getOwnPropertyDescriptors||function(Z){for(var Q=Object.keys(Z),ue={},oe=0;oe=oe)return J;switch(J){case"%s":return String(ue[Q++]);case"%d":return Number(ue[Q++]);case"%j":try{return JSON.stringify(ue[Q++])}catch{return"[Circular]"}default:return J}}),j=ue[Q];Q"u")return function(){return Y.deprecate(U,Z).apply(this,arguments)};var Q=!1;function ue(){if(!Q){if(process.throwDeprecation)throw new Error(Z);process.traceDeprecation?console.trace(Z):console.error(Z),Q=!0}return U.apply(this,arguments)}return ue};var x={},A=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),A=new RegExp("^"+E+"$","i");var E;Y.debuglog=function(U){if(U=U.toUpperCase(),!x[U])if(A.test(U)){var Z=process.pid;x[U]=function(){var Q=Y.format.apply(Y,arguments);console.error("%s %d: %s",U,Z,Q)}}else x[U]=function(){};return x[U]};function e(U,Z){var Q={seen:[],stylize:r};return arguments.length>=3&&(Q.depth=arguments[2]),arguments.length>=4&&(Q.colors=arguments[3]),h(Z)?Q.showHidden=Z:Z&&Y._extend(Q,Z),M(Q.showHidden)&&(Q.showHidden=!1),M(Q.depth)&&(Q.depth=2),M(Q.colors)&&(Q.colors=!1),M(Q.customInspect)&&(Q.customInspect=!0),Q.colors&&(Q.stylize=t),a(Q,U,Q.depth)}Y.inspect=e,e.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]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(U,Z){var Q=e.styles[Z];return Q?"\x1B["+e.colors[Q][0]+"m"+U+"\x1B["+e.colors[Q][1]+"m":U}function r(U,Z){return U}function o(U){var Z={};return U.forEach(function(Q,ue){Z[Q]=!0}),Z}function a(U,Z,Q){if(U.customInspect&&Z&&g(Z.inspect)&&Z.inspect!==Y.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var ue=Z.inspect(Q,U);return b(ue)||(ue=a(U,ue,Q)),ue}var oe=i(U,Z);if(oe)return oe;var le=Object.keys(Z),j=o(le);if(U.showHidden&&(le=Object.getOwnPropertyNames(Z)),u(Z)&&(le.indexOf("message")>=0||le.indexOf("description")>=0))return n(Z);if(le.length===0){if(g(Z)){var J=Z.name?": "+Z.name:"";return U.stylize("[Function"+J+"]","special")}if(_(Z))return U.stylize(RegExp.prototype.toString.call(Z),"regexp");if(p(Z))return U.stylize(Date.prototype.toString.call(Z),"date");if(u(Z))return n(Z)}var $="",X=!1,re=["{","}"];if(v(Z)&&(X=!0,re=["[","]"]),g(Z)){var ee=Z.name?": "+Z.name:"";$=" [Function"+ee+"]"}if(_(Z)&&($=" "+RegExp.prototype.toString.call(Z)),p(Z)&&($=" "+Date.prototype.toUTCString.call(Z)),u(Z)&&($=" "+n(Z)),le.length===0&&(!X||Z.length==0))return re[0]+$+re[1];if(Q<0)return _(Z)?U.stylize(RegExp.prototype.toString.call(Z),"regexp"):U.stylize("[Object]","special");U.seen.push(Z);var q;return X?q=s(U,Z,Q,j,le):q=le.map(function(ae){return c(U,Z,Q,j,ae,X)}),U.seen.pop(),f(q,$,re)}function i(U,Z){if(M(Z))return U.stylize("undefined","undefined");if(b(Z)){var Q="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize(Q,"string")}if(y(Z))return U.stylize(""+Z,"number");if(h(Z))return U.stylize(""+Z,"boolean");if(T(Z))return U.stylize("null","null")}function n(U){return"["+Error.prototype.toString.call(U)+"]"}function s(U,Z,Q,ue,oe){for(var le=[],j=0,J=Z.length;j-1&&(le?J=J.split(` +`).map(function(X){return" "+X}).join(` +`).slice(2):J=` +`+J.split(` +`).map(function(X){return" "+X}).join(` +`))):J=U.stylize("[Circular]","special")),M(j)){if(le&&oe.match(/^\d+$/))return J;j=JSON.stringify(""+oe),j.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(j=j.slice(1,-1),j=U.stylize(j,"name")):(j=j.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),j=U.stylize(j,"string"))}return j+": "+J}function f(U,Z,Q){var ue=U.reduce(function(oe,le){return le.indexOf(` +`)>=0,oe+le.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ue>60?Q[0]+(Z===""?"":Z+` + `)+" "+U.join(`, + `)+" "+Q[1]:Q[0]+Z+" "+U.join(", ")+" "+Q[1]}Y.types=Qw();function v(U){return Array.isArray(U)}Y.isArray=v;function h(U){return typeof U=="boolean"}Y.isBoolean=h;function T(U){return U===null}Y.isNull=T;function l(U){return U==null}Y.isNullOrUndefined=l;function y(U){return typeof U=="number"}Y.isNumber=y;function b(U){return typeof U=="string"}Y.isString=b;function S(U){return typeof U=="symbol"}Y.isSymbol=S;function M(U){return U===void 0}Y.isUndefined=M;function _(U){return w(U)&&R(U)==="[object RegExp]"}Y.isRegExp=_,Y.types.isRegExp=_;function w(U){return typeof U=="object"&&U!==null}Y.isObject=w;function p(U){return w(U)&&R(U)==="[object Date]"}Y.isDate=p,Y.types.isDate=p;function u(U){return w(U)&&(R(U)==="[object Error]"||U instanceof Error)}Y.isError=u,Y.types.isNativeError=u;function g(U){return typeof U=="function"}Y.isFunction=g;function m(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Y.isPrimitive=m,Y.isBuffer=e2();function R(U){return Object.prototype.toString.call(U)}function P(U){return U<10?"0"+U.toString(10):U.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var U=new Date,Z=[P(U.getHours()),P(U.getMinutes()),P(U.getSeconds())].join(":");return[U.getDate(),z[U.getMonth()],Z].join(" ")}Y.log=function(){console.log("%s - %s",F(),Y.format.apply(Y,arguments))},Y.inherits=od(),Y._extend=function(U,Z){if(!Z||!w(Z))return U;for(var Q=Object.keys(Z),ue=Q.length;ue--;)U[Q[ue]]=Z[Q[ue]];return U};function B(U,Z){return Object.prototype.hasOwnProperty.call(U,Z)}var O=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Y.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if(O&&Z[O]){var Q=Z[O];if(typeof Q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Q}function Q(){for(var ue,oe,le=new Promise(function($,X){ue=$,oe=X}),j=[],J=0;J"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function i(y){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},i(y)}var n={},s,c;function f(y,b,S){S||(S=Error);function M(w,p,u){return typeof b=="string"?b:b(w,p,u)}var _=function(w){E(u,w);var p=t(u);function u(g,m,R){var P;return A(this,u),P=p.call(this,M(g,m,R)),P.code=y,P}return x(u)}(S);n[y]=_}function v(y,b){if(Array.isArray(y)){var S=y.length;return y=y.map(function(M){return String(M)}),S>2?"one of ".concat(b," ").concat(y.slice(0,S-1).join(", "),", or ")+y[S-1]:S===2?"one of ".concat(b," ").concat(y[0]," or ").concat(y[1]):"of ".concat(b," ").concat(y[0])}else return"of ".concat(b," ").concat(String(y))}function h(y,b,S){return y.substr(0,b.length)===b}function T(y,b,S){return(S===void 0||S>y.length)&&(S=y.length),y.substring(S-b.length,S)===b}function l(y,b,S){return typeof S!="number"&&(S=0),S+b.length>y.length?!1:y.indexOf(b,S)!==-1}f("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),f("ERR_INVALID_ARG_TYPE",function(y,b,S){s===void 0&&(s=_y()),s(typeof y=="string","'name' must be a string");var M;typeof b=="string"&&h(b,"not ")?(M="must not be",b=b.replace(/^not /,"")):M="must be";var _;if(T(y," argument"))_="The ".concat(y," ").concat(M," ").concat(v(b,"type"));else{var w=l(y,".")?"property":"argument";_='The "'.concat(y,'" ').concat(w," ").concat(M," ").concat(v(b,"type"))}return _+=". Received type ".concat(d(S)),_},TypeError),f("ERR_INVALID_ARG_VALUE",function(y,b){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";c===void 0&&(c=eg());var M=c.inspect(b);return M.length>128&&(M="".concat(M.slice(0,128),"...")),"The argument '".concat(y,"' ").concat(S,". Received ").concat(M)},TypeError),f("ERR_INVALID_RETURN_VALUE",function(y,b,S){var M;return S&&S.constructor&&S.constructor.name?M="instance of ".concat(S.constructor.name):M="type ".concat(d(S)),"Expected ".concat(y,' to be returned from the "').concat(b,'"')+" function but got ".concat(M,".")},TypeError),f("ERR_MISSING_ARGS",function(){for(var y=arguments.length,b=new Array(y),S=0;S0,"At least one arg needs to be specified");var M="The ",_=b.length;switch(b=b.map(function(w){return'"'.concat(w,'"')}),_){case 1:M+="".concat(b[0]," argument");break;case 2:M+="".concat(b[0]," and ").concat(b[1]," arguments");break;default:M+=b.slice(0,_-1).join(", "),M+=", and ".concat(b[_-1]," arguments");break}return"".concat(M," must be specified")},TypeError),G.exports.codes=n}}),Ek=He({"node_modules/assert/build/internal/assert/assertion_error.js"(Y,G){function d(N,U){var Z=Object.keys(N);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(N);U&&(Q=Q.filter(function(ue){return Object.getOwnPropertyDescriptor(N,ue).enumerable})),Z.push.apply(Z,Q)}return Z}function x(N){for(var U=1;U"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function h(N){return Function.toString.call(N).indexOf("[native code]")!==-1}function T(N,U){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Q,ue){return Q.__proto__=ue,Q},T(N,U)}function l(N){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Z){return Z.__proto__||Object.getPrototypeOf(Z)},l(N)}function y(N){"@babel/helpers - typeof";return y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},y(N)}var b=eg(),S=b.inspect,M=l2(),_=M.codes.ERR_INVALID_ARG_TYPE;function w(N,U,Z){return(Z===void 0||Z>N.length)&&(Z=N.length),N.substring(Z-U.length,Z)===U}function p(N,U){if(U=Math.floor(U),N.length==0||U==0)return"";var Z=N.length*U;for(U=Math.floor(Math.log(U)/Math.log(2));U;)N+=N,U--;return N+=N.substring(0,Z-N.length),N}var u="",g="",m="",R="",P={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},z=10;function F(N){var U=Object.keys(N),Z=Object.create(Object.getPrototypeOf(N));return U.forEach(function(Q){Z[Q]=N[Q]}),Object.defineProperty(Z,"message",{value:N.message}),Z}function B(N){return S(N,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function O(N,U,Z){var Q="",ue="",oe=0,le="",j=!1,J=B(N),$=J.split(` +`),X=B(U).split(` +`),re=0,ee="";if(Z==="strictEqual"&&y(N)==="object"&&y(U)==="object"&&N!==null&&U!==null&&(Z="strictEqualObject"),$.length===1&&X.length===1&&$[0]!==X[0]){var q=$[0].length+X[0].length;if(q<=z){if((y(N)!=="object"||N===null)&&(y(U)!=="object"||U===null)&&(N!==0||U!==0))return"".concat(P[Z],` + +`)+"".concat($[0]," !== ").concat(X[0],` +`)}else if(Z!=="strictEqualObject"){var ae=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(q2&&(ee=` + `.concat(p(" ",re),"^"),re=0)}}}for(var ie=$[$.length-1],fe=X[X.length-1];ie===fe&&(re++<2?le=` + `.concat(ie).concat(le):Q=ie,$.pop(),X.pop(),!($.length===0||X.length===0));)ie=$[$.length-1],fe=X[X.length-1];var we=Math.max($.length,X.length);if(we===0){var Ae=J.split(` +`);if(Ae.length>30)for(Ae[26]="".concat(u,"...").concat(R);Ae.length>27;)Ae.pop();return"".concat(P.notIdentical,` + +`).concat(Ae.join(` +`),` +`)}re>3&&(le=` +`.concat(u,"...").concat(R).concat(le),j=!0),Q!==""&&(le=` + `.concat(Q).concat(le),Q="");var Fe=0,Ce=P[Z]+` +`.concat(g,"+ actual").concat(R," ").concat(m,"- expected").concat(R),qe=" ".concat(u,"...").concat(R," Lines skipped");for(re=0;re1&&re>2&&(et>4?(ue+=` +`.concat(u,"...").concat(R),j=!0):et>3&&(ue+=` + `.concat(X[re-2]),Fe++),ue+=` + `.concat(X[re-1]),Fe++),oe=re,Q+=` +`.concat(m,"-").concat(R," ").concat(X[re]),Fe++;else if(X.length1&&re>2&&(et>4?(ue+=` +`.concat(u,"...").concat(R),j=!0):et>3&&(ue+=` + `.concat($[re-2]),Fe++),ue+=` + `.concat($[re-1]),Fe++),oe=re,ue+=` +`.concat(g,"+").concat(R," ").concat($[re]),Fe++;else{var Qe=X[re],Ke=$[re],Xe=Ke!==Qe&&(!w(Ke,",")||Ke.slice(0,-1)!==Qe);Xe&&w(Qe,",")&&Qe.slice(0,-1)===Ke&&(Xe=!1,Ke+=","),Xe?(et>1&&re>2&&(et>4?(ue+=` +`.concat(u,"...").concat(R),j=!0):et>3&&(ue+=` + `.concat($[re-2]),Fe++),ue+=` + `.concat($[re-1]),Fe++),oe=re,ue+=` +`.concat(g,"+").concat(R," ").concat(Ke),Q+=` +`.concat(m,"-").concat(R," ").concat(Qe),Fe+=2):(ue+=Q,Q="",(et===1||re===0)&&(ue+=` + `.concat(Ke),Fe++))}if(Fe>20&&re30)for(q[26]="".concat(u,"...").concat(R);q.length>27;)q.pop();q.length===1?oe=Z.call(this,"".concat(ee," ").concat(q[0])):oe=Z.call(this,"".concat(ee,` + +`).concat(q.join(` +`),` +`))}else{var ae=B($),ie="",fe=P[j];j==="notDeepEqual"||j==="notEqual"?(ae="".concat(P[j],` + +`).concat(ae),ae.length>1024&&(ae="".concat(ae.slice(0,1021),"..."))):(ie="".concat(B(X)),ae.length>512&&(ae="".concat(ae.slice(0,509),"...")),ie.length>512&&(ie="".concat(ie.slice(0,509),"...")),j==="deepEqual"||j==="equal"?ae="".concat(fe,` + +`).concat(ae,` + +should equal + +`):ie=" ".concat(j," ").concat(ie)),oe=Z.call(this,"".concat(ae).concat(ie))}return Error.stackTraceLimit=re,oe.generatedMessage=!le,Object.defineProperty(s(oe),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),oe.code="ERR_ASSERTION",oe.actual=$,oe.expected=X,oe.operator=j,Error.captureStackTrace&&Error.captureStackTrace(s(oe),J),oe.stack,oe.name="AssertionError",n(oe)}return t(Q,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:U,value:function(oe,le){return S(this,x(x({},le),{},{customInspect:!1,depth:0}))}}]),Q}(c(Error),S.custom);G.exports=L}}),u2=He({"node_modules/object-keys/isArguments.js"(Y,G){var d=Object.prototype.toString;G.exports=function(A){var E=d.call(A),e=E==="[object Arguments]";return e||(e=E!=="[object Array]"&&A!==null&&typeof A=="object"&&typeof A.length=="number"&&A.length>=0&&d.call(A.callee)==="[object Function]"),e}}}),kk=He({"node_modules/object-keys/implementation.js"(Y,G){var d;Object.keys||(x=Object.prototype.hasOwnProperty,A=Object.prototype.toString,E=u2(),e=Object.prototype.propertyIsEnumerable,t=!e.call({toString:null},"toString"),r=e.call(function(){},"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=function(c){var f=c.constructor;return f&&f.prototype===c},i={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},n=function(){if(typeof window>"u")return!1;for(var c in window)try{if(!i["$"+c]&&x.call(window,c)&&window[c]!==null&&typeof window[c]=="object")try{a(window[c])}catch{return!0}}catch{return!0}return!1}(),s=function(c){if(typeof window>"u"||!n)return a(c);try{return a(c)}catch{return!1}},d=function(f){var v=f!==null&&typeof f=="object",h=A.call(f)==="[object Function]",T=E(f),l=v&&A.call(f)==="[object String]",y=[];if(!v&&!h&&!T)throw new TypeError("Object.keys called on a non-object");var b=r&&h;if(l&&f.length>0&&!x.call(f,0))for(var S=0;S0)for(var M=0;M2?arguments[2]:{},f=d(s);x&&(f=E.call(f,Object.getOwnPropertySymbols(s)));for(var v=0;vXe.length)&&(Me=Xe.length);for(var xe=0,ce=new Array(Me);xe10)return!0;for(var Me=0;Me57)return!0}return Xe.length===10&&Xe>=Math.pow(2,32)}function L(Xe){return Object.keys(Xe).filter(O).concat(s(Xe).filter(Object.prototype.propertyIsEnumerable.bind(Xe)))}function N(Xe,Me){if(Xe===Me)return 0;for(var xe=Xe.length,ce=Me.length,Re=0,$e=Math.min(xe,ce);Re<$e;++Re)if(Xe[Re]!==Me[Re]){xe=Xe[Re],ce=Me[Re];break}return xe1?j-1:0),$=1;$1?j-1:0),$=1;$1?j-1:0),$=1;$1?j-1:0),$=1;$0)return t(i);if(s==="number"&&isNaN(i)===!1)return n.long?o(i):r(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function t(i){if(i=String(i),!(i.length>100)){var n=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(n){var s=parseFloat(n[1]),c=(n[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return s*e;case"days":case"day":case"d":return s*E;case"hours":case"hour":case"hrs":case"hr":case"h":return s*A;case"minutes":case"minute":case"mins":case"min":case"m":return s*x;case"seconds":case"second":case"secs":case"sec":case"s":return s*d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function r(i){return i>=E?Math.round(i/E)+"d":i>=A?Math.round(i/A)+"h":i>=x?Math.round(i/x)+"m":i>=d?Math.round(i/d)+"s":i+"ms"}function o(i){return a(i,E,"day")||a(i,A,"hour")||a(i,x,"minute")||a(i,d,"second")||i+" ms"}function a(i,n,s){if(!(i=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}Y.formatters.j=function(r){try{return JSON.stringify(r)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}};function x(r){var o=this.useColors;if(r[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+r[0]+(o?"%c ":" ")+"+"+Y.humanize(this.diff),!!o){var a="color: "+this.color;r.splice(1,0,a,"color: inherit");var i=0,n=0;r[0].replace(/%[a-zA-Z%]/g,function(s){s!=="%%"&&(i++,s==="%c"&&(n=i))}),r.splice(n,0,a)}}function A(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function E(r){try{r==null?Y.storage.removeItem("debug"):Y.storage.debug=r}catch{}}function e(){var r;try{r=Y.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=Th.DEBUG),r}Y.enable(e());function t(){try{return window.localStorage}catch{}}}}),Nk=He({"node_modules/stream-parser/index.js"(Y,G){var d=_y(),x=Bk()("stream-parser");G.exports=r;var A=-1,E=0,e=1,t=2;function r(l){var y=l&&typeof l._transform=="function",b=l&&typeof l._write=="function";if(!y&&!b)throw new Error("must pass a Writable or Transform stream in");x("extending Parser into stream"),l._bytes=a,l._skipBytes=i,y&&(l._passthrough=n),y?l._transform=c:l._write=s}function o(l){x("initializing parser stream"),l._parserBytesLeft=0,l._parserBuffers=[],l._parserBuffered=0,l._parserState=A,l._parserCallback=null,typeof l.push=="function"&&(l._parserOutput=l.push.bind(l)),l._parserInit=!0}function a(l,y){d(!this._parserCallback,'there is already a "callback" set!'),d(isFinite(l)&&l>0,'can only buffer a finite number of bytes > 0, got "'+l+'"'),this._parserInit||o(this),x("buffering %o bytes",l),this._parserBytesLeft=l,this._parserCallback=y,this._parserState=E}function i(l,y){d(!this._parserCallback,'there is already a "callback" set!'),d(l>0,'can only skip > 0 bytes, got "'+l+'"'),this._parserInit||o(this),x("skipping %o bytes",l),this._parserBytesLeft=l,this._parserCallback=y,this._parserState=e}function n(l,y){d(!this._parserCallback,'There is already a "callback" set!'),d(l>0,'can only pass through > 0 bytes, got "'+l+'"'),this._parserInit||o(this),x("passing through %o bytes",l),this._parserBytesLeft=l,this._parserCallback=y,this._parserState=t}function s(l,y,b){this._parserInit||o(this),x("write(%o bytes)",l.length),typeof y=="function"&&(b=y),h(this,l,null,b)}function c(l,y,b){this._parserInit||o(this),x("transform(%o bytes)",l.length),typeof y!="function"&&(y=this._parserOutput),h(this,l,y,b)}function f(l,y,b,S){return l._parserBytesLeft<=0?S(new Error("got data but not currently parsing anything")):y.length<=l._parserBytesLeft?function(){return v(l,y,b,S)}:function(){var M=y.slice(0,l._parserBytesLeft);return v(l,M,b,function(_){if(_)return S(_);if(y.length>M.length)return function(){return f(l,y.slice(M.length),b,S)}})}}function v(l,y,b,S){if(l._parserBytesLeft-=y.length,x("%o bytes left for stream piece",l._parserBytesLeft),l._parserState===E?(l._parserBuffers.push(y),l._parserBuffered+=y.length):l._parserState===t&&b(y),l._parserBytesLeft===0){var M=l._parserCallback;if(M&&l._parserState===E&&l._parserBuffers.length>1&&(y=Buffer.concat(l._parserBuffers,l._parserBuffered)),l._parserState!==E&&(y=null),l._parserCallback=null,l._parserBuffered=0,l._parserState=A,l._parserBuffers.splice(0),M){var _=[];y&&_.push(y),b&&_.push(b);var w=M.length>_.length;w&&_.push(T(S));var p=M.apply(l,_);if(!w||S===p)return S}}else return S}var h=T(f);function T(l){return function(){for(var y=l.apply(this,arguments);typeof y=="function";)y=y();return y}}}}),Jl=He({"node_modules/probe-image-size/lib/common.js"(Y){var G=Mk().Transform,d=Nk();function x(){G.call(this,{readableObjectMode:!0})}x.prototype=Object.create(G.prototype),x.prototype.constructor=x,d(x.prototype),Y.ParserStream=x,Y.sliceEq=function(E,e,t){for(var r=e,o=0;o>4&15,f=n[4]&15,v=n[5]>>4&15,h=d(n,6),T=8,l=0;lh.width||v.width===h.width&&v.height>h.height?v:h}),c=n.reduce(function(v,h){return v.height>h.height||v.height===h.height&&v.width>h.width?v:h}),f;return s.width>c.height||s.width===c.height&&s.height>c.width?f=s:f=c,f}G.exports.readSizeFromMeta=function(n){var s={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(a(n,s),!!s.sizes.length){var c=i(s.sizes),f=1;s.transforms.forEach(function(h){var T={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},l={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(h.type==="imir"&&(h.value===0?f=l[f]:(f=l[f],f=T[f],f=T[f])),h.type==="irot")for(var y=0;y0&&!this.aborted;){var t=this.ifds_to_read.shift();t.offset&&this.scan_ifd(t.id,t.offset,E)}},A.prototype.read_uint16=function(E){var e=this.input;if(E+2>e.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?e[E]*256+e[E+1]:e[E]+e[E+1]*256},A.prototype.read_uint32=function(E){var e=this.input;if(E+4>e.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?e[E]*16777216+e[E+1]*65536+e[E+2]*256+e[E+3]:e[E]+e[E+1]*256+e[E+2]*65536+e[E+3]*16777216},A.prototype.is_subifd_link=function(E,e){return E===0&&e===34665||E===0&&e===34853||E===34665&&e===40965},A.prototype.exif_format_length=function(E){switch(E){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},A.prototype.exif_format_read=function(E,e){var t;switch(E){case 1:case 2:return t=this.input[e],t;case 6:return t=this.input[e],t|(t&128)*33554430;case 3:return t=this.read_uint16(e),t;case 8:return t=this.read_uint16(e),t|(t&32768)*131070;case 4:return t=this.read_uint32(e),t;case 9:return t=this.read_uint32(e),t|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},A.prototype.scan_ifd=function(E,e,t){var r=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw d("unexpected EOF","EBADDATA");for(var h=[],T=f,l=0;l0&&(this.ifds_to_read.push({id:a,offset:h[0]}),v=!0);var b={is_big_endian:this.big_endian,ifd:E,tag:a,format:i,count:n,entry_offset:e+this.start,data_length:c,data_offset:f+this.start,value:h,is_subifd_link:v};if(t(b)===!1){this.aborted=!0;return}e+=12}E===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},G.exports.ExifParser=A,G.exports.get_orientation=function(E){var e=0;try{return new A(E,0,E.length).each(function(t){if(t.ifd===0&&t.tag===274&&Array.isArray(t.value))return e=t.value[0],!1}),e}catch{return-1}}}}),jk=He({"node_modules/probe-image-size/lib/parse_sync/avif.js"(Y,G){var d=Jl().str2arr,x=Jl().sliceEq,A=Jl().readUInt32BE,E=Uk(),e=t_(),t=d("ftyp");G.exports=function(r){if(x(r,4,t)){var o=E.unbox(r,0);if(o){var a=E.getMimeType(o.data);if(a){for(var i,n=o.end;;){var s=E.unbox(r,n);if(!s)break;if(n=s.end,s.boxtype==="mdat")return;if(s.boxtype==="meta"){i=s.data;break}}if(i){var c=E.readSizeFromMeta(i);if(c){var f={width:c.width,height:c.height,type:a.type,mime:a.mime,wUnits:"px",hUnits:"px"};if(c.variants.length>1&&(f.variants=c.variants),c.orientation&&(f.orientation=c.orientation),c.exif_location&&c.exif_location.offset+c.exif_location.length<=r.length){var v=A(r,c.exif_location.offset),h=r.slice(c.exif_location.offset+v+4,c.exif_location.offset+c.exif_location.length),T=e.get_orientation(h);T>0&&(f.orientation=T)}return f}}}}}}}}),Vk=He({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(Y,G){var d=Jl().str2arr,x=Jl().sliceEq,A=Jl().readUInt16LE,E=d("BM");G.exports=function(e){if(!(e.length<26)&&x(e,0,E))return{width:A(e,18),height:A(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),qk=He({"node_modules/probe-image-size/lib/parse_sync/gif.js"(Y,G){var d=Jl().str2arr,x=Jl().sliceEq,A=Jl().readUInt16LE,E=d("GIF87a"),e=d("GIF89a");G.exports=function(t){if(!(t.length<10)&&!(!x(t,0,E)&&!x(t,0,e)))return{width:A(t,6),height:A(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),Hk=He({"node_modules/probe-image-size/lib/parse_sync/ico.js"(Y,G){var d=Jl().readUInt16LE,x=0,A=1,E=16;G.exports=function(e){var t=d(e,0),r=d(e,2),o=d(e,4);if(!(t!==x||r!==A||!o)){for(var a=[],i={width:0,height:0},n=0;ni.width||c>i.height)&&(i=f)}return{width:i.width,height:i.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),Gk=He({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(Y,G){var d=Jl().readUInt16BE,x=Jl().str2arr,A=Jl().sliceEq,E=t_(),e=x("Exif\0\0");G.exports=function(t){if(!(t.length<2)&&!(t[0]!==255||t[1]!==216||t[2]!==255))for(var r=2;;){for(;;){if(t.length-r<2)return;if(t[r++]===255)break}for(var o=t[r++],a;o===255;)o=t[r++];if(208<=o&&o<=217||o===1)a=0;else if(192<=o&&o<=254){if(t.length-r<2)return;a=d(t,r)-2,r+=2}else return;if(o===217||o===218)return;var i;if(o===225&&a>=10&&A(t,r,e)&&(i=E.get_orientation(t.slice(r+6,r+a))),a>=5&&192<=o&&o<=207&&o!==196&&o!==200&&o!==204){if(t.length-r0&&(n.orientation=i),n}r+=a}}}}),Wk=He({"node_modules/probe-image-size/lib/parse_sync/png.js"(Y,G){var d=Jl().str2arr,x=Jl().sliceEq,A=Jl().readUInt32BE,E=d(`‰PNG\r + +`),e=d("IHDR");G.exports=function(t){if(!(t.length<24)&&x(t,0,E)&&x(t,12,e))return{width:A(t,16),height:A(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),Zk=He({"node_modules/probe-image-size/lib/parse_sync/psd.js"(Y,G){var d=Jl().str2arr,x=Jl().sliceEq,A=Jl().readUInt32BE,E=d("8BPS\0");G.exports=function(e){if(!(e.length<22)&&x(e,0,E))return{width:A(e,18),height:A(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),Xk=He({"node_modules/probe-image-size/lib/parse_sync/svg.js"(Y,G){function d(s){return s===32||s===9||s===13||s===10}function x(s){return typeof s=="number"&&isFinite(s)&&s>0}function A(s){var c=0,f=s.length;for(s[0]===239&&s[1]===187&&s[2]===191&&(c=3);c]*>/,e=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,t=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,r=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,o=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,a=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function i(s){var c=s.match(t),f=s.match(r),v=s.match(o);return{width:c&&(c[1]||c[2]),height:f&&(f[1]||f[2]),viewbox:v&&(v[1]||v[2])}}function n(s){return a.test(s)?s.match(a)[0]:"px"}G.exports=function(s){if(A(s)){for(var c="",f=0;f>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function i(n,s){return{width:(n[s+6]<<16|n[s+5]<<8|n[s+4])+1,height:(n[s+9]<n.length)){for(;s+8=10?c=c||o(n,s+8):h==="VP8L"&&T>=9?c=c||a(n,s+8):h==="VP8X"&&T>=10?c=c||i(n,s+8):h==="EXIF"&&(f=e.get_orientation(n.slice(s+8,s+8+T)),s=1/0),s+=8+T}if(c)return f>0&&(c.orientation=f),c}}}}}),Jk=He({"node_modules/probe-image-size/lib/parsers_sync.js"(Y,G){G.exports={avif:jk(),bmp:Vk(),gif:qk(),ico:Hk(),jpeg:Gk(),png:Wk(),psd:Zk(),svg:Xk(),tiff:Yk(),webp:Kk()}}}),$k=He({"node_modules/probe-image-size/sync.js"(Y,G){var d=Jk();function x(A){for(var E=Object.keys(d),e=0;e0;)R=c.c2p(M+B*u),B--;for(B=0;z===void 0&&B0;)F=f.c2p(_+B*g),B--;if(Rj[0];if(J||$){var X=m+L/2,re=z+N/2;oe+="transform:"+A(X+"px",re+"px")+"scale("+(J?-1:1)+","+($?-1:1)+")"+A(-X+"px",-re+"px")+";"}}ue.attr("style",oe);var ee=new Promise(function(q){if(y._hasZ)q();else if(y._hasSource)if(y._canvas&&y._canvas.el.width===w&&y._canvas.el.height===p&&y._canvas.source===y.source)q();else{var ae=document.createElement("canvas");ae.width=w,ae.height=p;var ie=ae.getContext("2d",{willReadFrequently:!0});y._image=y._image||new Image;var fe=y._image;fe.onload=function(){ie.drawImage(fe,0,0),y._canvas={el:ae,source:y.source},q()},fe.setAttribute("src",y.source)}}).then(function(){var q,ae;if(y._hasZ)ae=Q(function(we,Ae){var Fe=S[Ae][we];return x.isTypedArray(Fe)&&(Fe=Array.from(Fe)),Fe}),q=ae.toDataURL("image/png");else if(y._hasSource)if(b)q=y.source;else{var ie=y._canvas.el.getContext("2d",{willReadFrequently:!0}),fe=ie.getImageData(0,0,w,p).data;ae=Q(function(we,Ae){var Fe=4*(Ae*w+we);return[fe[Fe],fe[Fe+1],fe[Fe+2],fe[Fe+3]]}),q=ae.toDataURL("image/png")}ue.attr({"xlink:href":q,height:N,width:L,x:m,y:z})});a._promises.push(ee)})}}}),rC=He({"src/traces/image/style.js"(Y,G){var d=Qn();G.exports=function(A){d.select(A).selectAll(".im image").style("opacity",function(E){return E[0].trace.opacity})}}}),aC=He({"src/traces/image/hover.js"(Y,G){var d=Wu(),x=Gr(),A=x.isArrayOrTypedArray,E=J0();G.exports=function(t,r,o){var a=t.cd[0],i=a.trace,n=t.xa,s=t.ya;if(!(d.inbox(r-a.x0,r-(a.x0+a.w*i.dx),0)>0||d.inbox(o-a.y0,o-(a.y0+a.h*i.dy),0)>0)){var c=Math.floor((r-a.x0)/i.dx),f=Math.floor(Math.abs(o-a.y0)/i.dy),v;if(i._hasZ?v=a.z[f][c]:i._hasSource&&(v=i._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(c,f,1,1).data),!!v){var h=a.hi||i.hoverinfo,T;if(h){var l=h.split("+");l.indexOf("all")!==-1&&(l=["color"]),l.indexOf("color")!==-1&&(T=!0)}var y=E.colormodel[i.colormodel],b=y.colormodel||i.colormodel,S=b.length,M=i._scaler(v),_=y.suffix,w=[];(i.hovertemplate||T)&&(w.push("["+[M[0]+_[0],M[1]+_[1],M[2]+_[2]].join(", ")),S===4&&w.push(", "+M[3]+_[3]),w.push("]"),w=w.join(""),t.extraText=b.toUpperCase()+": "+w);var p;A(i.hovertext)&&A(i.hovertext[f])?p=i.hovertext[f][c]:A(i.text)&&A(i.text[f])&&(p=i.text[f][c]);var u=s.c2p(a.y0+(f+.5)*i.dy),g=a.x0+(c+.5)*i.dx,m=a.y0+(f+.5)*i.dy,R="["+v.slice(0,i.colormodel.length).join(", ")+"]";return[x.extendFlat(t,{index:[f,c],x0:n.c2p(a.x0+c*i.dx),x1:n.c2p(a.x0+(c+1)*i.dx),y0:u,y1:u,color:M,xVal:g,xLabelVal:g,yVal:m,yLabelVal:m,zLabelVal:R,text:p,hovertemplateLabels:{zLabel:R,colorLabel:w,"color[0]Label":M[0]+_[0],"color[1]Label":M[1]+_[1],"color[2]Label":M[2]+_[2],"color[3]Label":M[3]+_[3]}})]}}}}}),nC=He({"src/traces/image/event_data.js"(Y,G){G.exports=function(x,A){return"xVal"in A&&(x.x=A.xVal),"yVal"in A&&(x.y=A.yVal),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),x.color=A.color,x.colormodel=A.trace.colormodel,x.z||(x.z=A.color),x}}}),iC=He({"src/traces/image/index.js"(Y,G){G.exports={attributes:Zw(),supplyDefaults:ek(),calc:eC(),plot:tC(),style:rC(),hoverPoints:aC(),eventData:nC(),moduleType:"trace",name:"image",basePlotModule:Bc(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),oC=He({"lib/image.js"(Y,G){G.exports=iC()}}),Bp=He({"src/traces/pie/attributes.js"(Y,G){var d=cl(),x=mu().attributes,A=Yl(),E=Xc(),e=Yo().hovertemplateAttrs,t=Yo().texttemplateAttrs,r=ho().extendFlat,o=Nf().pattern,a=A({editType:"plot",arrayOk:!0,colorEditType:"plot"});G.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:E.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:o,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:r({},d.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:e({},{keys:["label","color","value","percent","text"]}),texttemplate:t({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:r({},a,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:r({},a,{}),outsidetextfont:r({},a,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:r({},a,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:x({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),Np=He({"src/traces/pie/defaults.js"(Y,G){var d=Hi(),x=Gr(),A=Bp(),E=mu().defaults,e=Jh().handleText,t=Gr().coercePattern;function r(i,n){var s=x.isArrayOrTypedArray(i),c=x.isArrayOrTypedArray(n),f=Math.min(s?i.length:1/0,c?n.length:1/0);if(isFinite(f)||(f=0),f&&c){for(var v,h=0;h0){v=!0;break}}v||(f=0)}return{hasLabels:s,hasValues:c,len:f}}function o(i,n,s,c,f){var v=c("marker.line.width");v&&c("marker.line.color",f?void 0:s.paper_bgcolor);var h=c("marker.colors");t(c,"marker.pattern",h),i.marker&&!n.marker.pattern.fgcolor&&(n.marker.pattern.fgcolor=i.marker.colors),n.marker.pattern.bgcolor||(n.marker.pattern.bgcolor=s.paper_bgcolor)}function a(i,n,s,c){function f(m,R){return x.coerce(i,n,A,m,R)}var v=f("labels"),h=f("values"),T=r(v,h),l=T.len;if(n._hasLabels=T.hasLabels,n._hasValues=T.hasValues,!n._hasLabels&&n._hasValues&&(f("label0"),f("dlabel")),!l){n.visible=!1;return}n._length=l,o(i,n,c,f,!0),f("scalegroup");var y=f("text"),b=f("texttemplate"),S;if(b||(S=f("textinfo",x.isArrayOrTypedArray(y)?"text+percent":"percent")),f("hovertext"),f("hovertemplate"),b||S&&S!=="none"){var M=f("textposition");e(i,n,c,f,M,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var _=Array.isArray(M)||M==="auto",w=_||M==="outside";w&&f("automargin"),(M==="inside"||M==="auto"||Array.isArray(M))&&f("insidetextorientation")}else S==="none"&&f("textposition","none");E(n,c,f);var p=f("hole"),u=f("title.text");if(u){var g=f("title.position",p?"middle center":"top center");!p&&g==="middle center"&&(n.title.position="top center"),x.coerceFont(f,"title.font",c.font)}f("sort"),f("direction"),f("rotation"),f("pull")}G.exports={handleLabelsAndValues:r,handleMarkerDefaults:o,supplyDefaults:a}}}),r_=He({"src/traces/pie/layout_attributes.js"(Y,G){G.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),sC=He({"src/traces/pie/layout_defaults.js"(Y,G){var d=Gr(),x=r_();G.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("hiddenlabels"),t("piecolorway",e.colorway),t("extendpiecolors")}}}),tg=He({"src/traces/pie/calc.js"(Y,G){var d=Hi(),x=Mf(),A=Ai(),E={};function e(a,i){var n=[],s=a._fullLayout,c=s.hiddenlabels||[],f=i.labels,v=i.marker.colors||[],h=i.values,T=i._length,l=i._hasValues&&T,y,b;if(i.dlabel)for(f=new Array(T),y=0;y=0});var R=i.type==="funnelarea"?w:i.sort;return R&&n.sort(function(P,z){return z.v-P.v}),n[0]&&(n[0].vTotal=_),n}function t(a){return function(n,s){return!n||(n=x(n),!n.isValid())?!1:(n=A.addOpacity(n,n.getAlpha()),a[s]||(a[s]=n),n)}}function r(a,i){var n=(i||{}).type;n||(n="pie");var s=a._fullLayout,c=a.calcdata,f=s[n+"colorway"],v=s["_"+n+"colormap"];s["extend"+n+"colors"]&&(f=o(f,E));for(var h=0,T=0;T0&&($e+=St*ce.pxmid[0],rt+=St*ce.pxmid[1])}ce.cxFinal=$e,ce.cyFinal=rt;function Rt(pt,ze,Ge,Oe){var ve=Oe*(ze[0]-pt[0]),ge=Oe*(ze[1]-pt[1]);return"a"+Oe*fe.r+","+Oe*fe.r+" 0 "+ce.largeArc+(Ge?" 1 ":" 0 ")+ve+","+ge}var Ut=we.hole;if(ce.v===fe.vTotal){var ir="M"+($e+ce.px0[0])+","+(rt+ce.px0[1])+Rt(ce.px0,ce.pxmid,!0,1)+Rt(ce.pxmid,ce.px0,!0,1)+"Z";Ut?At.attr("d","M"+($e+Ut*ce.px0[0])+","+(rt+Ut*ce.px0[1])+Rt(ce.px0,ce.pxmid,!1,Ut)+Rt(ce.pxmid,ce.px0,!1,Ut)+"Z"+ir):At.attr("d",ir)}else{var ar=Rt(ce.px0,ce.px1,!0,1);if(Ut){var Mr=1-Ut;At.attr("d","M"+($e+Ut*ce.px1[0])+","+(rt+Ut*ce.px1[1])+Rt(ce.px1,ce.px0,!1,Ut)+"l"+Mr*ce.px0[0]+","+Mr*ce.px0[1]+ar+"Z")}else At.attr("d","M"+$e+","+rt+"l"+ce.px0[0]+","+ce.px0[1]+ar+"Z")}le(J,ce,fe);var fr=f.castOption(we.textposition,ce.pts),dr=Je.selectAll("g.slicetext").data(ce.text&&fr!=="none"?[0]:[]);dr.enter().append("g").classed("slicetext",!0),dr.exit().remove(),dr.each(function(){var pt=t.ensureSingle(d.select(this),"text","",function(We){We.attr("data-notex",1)}),ze=t.ensureUniformFontSize(J,fr==="outside"?b(we,ce,re.font):S(we,ce,re.font));pt.text(ce.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(e.font,ze).call(a.convertToTspans,J);var Ge=e.bBox(pt.node()),Oe;if(fr==="outside")Oe=z(Ge,ce);else if(Oe=_(Ge,ce,fe),fr==="auto"&&Oe.scale<1){var ve=t.ensureUniformFontSize(J,we.outsidetextfont);pt.call(e.font,ve),Ge=e.bBox(pt.node()),Oe=z(Ge,ce)}var ge=Oe.textPosAngle,be=ge===void 0?ce.pxmid:oe(fe.r,ge);if(Oe.targetX=$e+be[0]*Oe.rCenter+(Oe.x||0),Oe.targetY=rt+be[1]*Oe.rCenter+(Oe.y||0),j(Oe,Ge),Oe.outside){var Pe=Oe.targetY;ce.yLabelMin=Pe-Ge.height/2,ce.yLabelMid=Pe,ce.yLabelMax=Pe+Ge.height/2,ce.labelExtraX=0,ce.labelExtraY=0,Ce=!0}Oe.fontSize=ze.size,n(we.type,Oe,re),ae[Re].transform=Oe,t.setTransormAndDisplay(pt,Oe)})});var qe=d.select(this).selectAll("g.titletext").data(we.title.text?[0]:[]);if(qe.enter().append("g").classed("titletext",!0),qe.exit().remove(),qe.each(function(){var ce=t.ensureSingle(d.select(this),"text","",function(rt){rt.attr("data-notex",1)}),Re=we.title.text;we._meta&&(Re=t.templateString(Re,we._meta)),ce.text(Re).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(e.font,we.title.font).call(a.convertToTspans,J);var $e;we.title.position==="middle center"?$e=F(fe):$e=B(fe,ee),ce.attr("transform",o($e.x,$e.y)+r(Math.min(1,$e.scale))+o($e.tx,$e.ty))}),Ce&&U(Fe,we),l(Ae,we),Ce&&we.automargin){var et=e.bBox(ie.node()),Qe=we.domain,Ke=ee.w*(Qe.x[1]-Qe.x[0]),Xe=ee.h*(Qe.y[1]-Qe.y[0]),Me=(.5*Ke-fe.r)/ee.w,xe=(.5*Xe-fe.r)/ee.h;x.autoMargin(J,"pie."+we.uid+".automargin",{xl:Qe.x[0]-Me,xr:Qe.x[1]+Me,yb:Qe.y[0]-xe,yt:Qe.y[1]+xe,l:Math.max(fe.cx-fe.r-et.left,0),r:Math.max(et.right-(fe.cx+fe.r),0),b:Math.max(et.bottom-(fe.cy+fe.r),0),t:Math.max(fe.cy-fe.r-et.top,0),pad:5})}})});setTimeout(function(){q.selectAll("tspan").each(function(){var ae=d.select(this);ae.attr("dy")&&ae.attr("dy",ae.attr("dy"))})},0)}function l(J,$){J.each(function(X){var re=d.select(this);if(!X.labelExtraX&&!X.labelExtraY){re.select("path.textline").remove();return}var ee=re.select("g.slicetext text");X.transform.targetX+=X.labelExtraX,X.transform.targetY+=X.labelExtraY,t.setTransormAndDisplay(ee,X.transform);var q=X.cxFinal+X.pxmid[0],ae=X.cyFinal+X.pxmid[1],ie="M"+q+","+ae,fe=(X.yLabelMax-X.yLabelMin)*(X.pxmid[0]<0?-1:1)/4;if(X.labelExtraX){var we=X.labelExtraX*X.pxmid[1]/X.pxmid[0],Ae=X.yLabelMid+X.labelExtraY-(X.cyFinal+X.pxmid[1]);Math.abs(we)>Math.abs(Ae)?ie+="l"+Ae*X.pxmid[0]/X.pxmid[1]+","+Ae+"H"+(q+X.labelExtraX+fe):ie+="l"+X.labelExtraX+","+we+"v"+(Ae-we)+"h"+fe}else ie+="V"+(X.yLabelMid+X.labelExtraY)+"h"+fe;t.ensureSingle(re,"path","textline").call(E.stroke,$.outsidetextfont.color).attr({"stroke-width":Math.min(2,$.outsidetextfont.size/8),d:ie,fill:"none"})})}function y(J,$,X){var re=X[0],ee=re.cx,q=re.cy,ae=re.trace,ie=ae.type==="funnelarea";"_hasHoverLabel"in ae||(ae._hasHoverLabel=!1),"_hasHoverEvent"in ae||(ae._hasHoverEvent=!1),J.on("mouseover",function(fe){var we=$._fullLayout,Ae=$._fullData[ae.index];if(!($._dragging||we.hovermode===!1)){var Fe=Ae.hoverinfo;if(Array.isArray(Fe)&&(Fe=A.castHoverinfo({hoverinfo:[f.castOption(Fe,fe.pts)],_module:ae._module},we,0)),Fe==="all"&&(Fe="label+text+value+percent+name"),Ae.hovertemplate||Fe!=="none"&&Fe!=="skip"&&Fe){var Ce=fe.rInscribed||0,qe=ee+fe.pxmid[0]*(1-Ce),et=q+fe.pxmid[1]*(1-Ce),Qe=we.separators,Ke=[];if(Fe&&Fe.indexOf("label")!==-1&&Ke.push(fe.label),fe.text=f.castOption(Ae.hovertext||Ae.text,fe.pts),Fe&&Fe.indexOf("text")!==-1){var Xe=fe.text;t.isValidTextValue(Xe)&&Ke.push(Xe)}fe.value=fe.v,fe.valueLabel=f.formatPieValue(fe.v,Qe),Fe&&Fe.indexOf("value")!==-1&&Ke.push(fe.valueLabel),fe.percent=fe.v/re.vTotal,fe.percentLabel=f.formatPiePercent(fe.percent,Qe),Fe&&Fe.indexOf("percent")!==-1&&Ke.push(fe.percentLabel);var Me=Ae.hoverlabel,xe=Me.font,ce=[];A.loneHover({trace:ae,x0:qe-Ce*re.r,x1:qe+Ce*re.r,y:et,_x0:ie?ee+fe.TL[0]:qe-Ce*re.r,_x1:ie?ee+fe.TR[0]:qe+Ce*re.r,_y0:ie?q+fe.TL[1]:et-Ce*re.r,_y1:ie?q+fe.BL[1]:et+Ce*re.r,text:Ke.join("
"),name:Ae.hovertemplate||Fe.indexOf("name")!==-1?Ae.name:void 0,idealAlign:fe.pxmid[0]<0?"left":"right",color:f.castOption(Me.bgcolor,fe.pts)||fe.color,borderColor:f.castOption(Me.bordercolor,fe.pts),fontFamily:f.castOption(xe.family,fe.pts),fontSize:f.castOption(xe.size,fe.pts),fontColor:f.castOption(xe.color,fe.pts),nameLength:f.castOption(Me.namelength,fe.pts),textAlign:f.castOption(Me.align,fe.pts),hovertemplate:f.castOption(Ae.hovertemplate,fe.pts),hovertemplateLabels:fe,eventData:[v(fe,Ae)]},{container:we._hoverlayer.node(),outerContainer:we._paper.node(),gd:$,inOut_bbox:ce}),fe.bbox=ce[0],ae._hasHoverLabel=!0}ae._hasHoverEvent=!0,$.emit("plotly_hover",{points:[v(fe,Ae)],event:d.event})}}),J.on("mouseout",function(fe){var we=$._fullLayout,Ae=$._fullData[ae.index],Fe=d.select(this).datum();ae._hasHoverEvent&&(fe.originalEvent=d.event,$.emit("plotly_unhover",{points:[v(Fe,Ae)],event:d.event}),ae._hasHoverEvent=!1),ae._hasHoverLabel&&(A.loneUnhover(we._hoverlayer.node()),ae._hasHoverLabel=!1)}),J.on("click",function(fe){var we=$._fullLayout,Ae=$._fullData[ae.index];$._dragging||we.hovermode===!1||($._hoverdata=[v(fe,Ae)],A.click($,d.event))})}function b(J,$,X){var re=f.castOption(J.outsidetextfont.color,$.pts)||f.castOption(J.textfont.color,$.pts)||X.color,ee=f.castOption(J.outsidetextfont.family,$.pts)||f.castOption(J.textfont.family,$.pts)||X.family,q=f.castOption(J.outsidetextfont.size,$.pts)||f.castOption(J.textfont.size,$.pts)||X.size,ae=f.castOption(J.outsidetextfont.weight,$.pts)||f.castOption(J.textfont.weight,$.pts)||X.weight,ie=f.castOption(J.outsidetextfont.style,$.pts)||f.castOption(J.textfont.style,$.pts)||X.style,fe=f.castOption(J.outsidetextfont.variant,$.pts)||f.castOption(J.textfont.variant,$.pts)||X.variant,we=f.castOption(J.outsidetextfont.textcase,$.pts)||f.castOption(J.textfont.textcase,$.pts)||X.textcase,Ae=f.castOption(J.outsidetextfont.lineposition,$.pts)||f.castOption(J.textfont.lineposition,$.pts)||X.lineposition,Fe=f.castOption(J.outsidetextfont.shadow,$.pts)||f.castOption(J.textfont.shadow,$.pts)||X.shadow;return{color:re,family:ee,size:q,weight:ae,style:ie,variant:fe,textcase:we,lineposition:Ae,shadow:Fe}}function S(J,$,X){var re=f.castOption(J.insidetextfont.color,$.pts);!re&&J._input.textfont&&(re=f.castOption(J._input.textfont.color,$.pts));var ee=f.castOption(J.insidetextfont.family,$.pts)||f.castOption(J.textfont.family,$.pts)||X.family,q=f.castOption(J.insidetextfont.size,$.pts)||f.castOption(J.textfont.size,$.pts)||X.size,ae=f.castOption(J.insidetextfont.weight,$.pts)||f.castOption(J.textfont.weight,$.pts)||X.weight,ie=f.castOption(J.insidetextfont.style,$.pts)||f.castOption(J.textfont.style,$.pts)||X.style,fe=f.castOption(J.insidetextfont.variant,$.pts)||f.castOption(J.textfont.variant,$.pts)||X.variant,we=f.castOption(J.insidetextfont.textcase,$.pts)||f.castOption(J.textfont.textcase,$.pts)||X.textcase,Ae=f.castOption(J.insidetextfont.lineposition,$.pts)||f.castOption(J.textfont.lineposition,$.pts)||X.lineposition,Fe=f.castOption(J.insidetextfont.shadow,$.pts)||f.castOption(J.textfont.shadow,$.pts)||X.shadow;return{color:re||E.contrast($.color),family:ee,size:q,weight:ae,style:ie,variant:fe,textcase:we,lineposition:Ae,shadow:Fe}}function M(J,$){for(var X,re,ee=0;ee=-4;Me-=2)Xe(Math.PI*Me,"tan");for(Me=4;Me>=-4;Me-=2)Xe(Math.PI*(Me+1),"tan")}if(Fe||qe){for(Me=4;Me>=-4;Me-=2)Xe(Math.PI*(Me+1.5),"rad");for(Me=4;Me>=-4;Me-=2)Xe(Math.PI*(Me+.5),"rad")}}if(ie||et||Fe){var xe=Math.sqrt(J.width*J.width+J.height*J.height);if(Ke={scale:ee*re*2/xe,rCenter:1-ee,rotate:0},Ke.textPosAngle=($.startangle+$.stopangle)/2,Ke.scale>=1)return Ke;Qe.push(Ke)}(et||qe)&&(Ke=p(J,re,ae,fe,we),Ke.textPosAngle=($.startangle+$.stopangle)/2,Qe.push(Ke)),(et||Ce)&&(Ke=u(J,re,ae,fe,we),Ke.textPosAngle=($.startangle+$.stopangle)/2,Qe.push(Ke));for(var ce=0,Re=0,$e=0;$e=1)break}return Qe[ce]}function w(J,$){var X=J.startangle,re=J.stopangle;return X>$&&$>re||X<$&&$0?1:-1)/2,y:q/(1+X*X/(re*re)),outside:!0}}function F(J){var $=Math.sqrt(J.titleBox.width*J.titleBox.width+J.titleBox.height*J.titleBox.height);return{x:J.cx,y:J.cy,scale:J.trace.hole*J.r*2/$,tx:0,ty:-J.titleBox.height/2+J.trace.title.font.size}}function B(J,$){var X=1,re=1,ee,q=J.trace,ae={x:J.cx,y:J.cy},ie={tx:0,ty:0};ie.ty+=q.title.font.size,ee=N(q),q.title.position.indexOf("top")!==-1?(ae.y-=(1+ee)*J.r,ie.ty-=J.titleBox.height):q.title.position.indexOf("bottom")!==-1&&(ae.y+=(1+ee)*J.r);var fe=O(J.r,J.trace.aspectratio),we=$.w*(q.domain.x[1]-q.domain.x[0])/2;return q.title.position.indexOf("left")!==-1?(we=we+fe,ae.x-=(1+ee)*fe,ie.tx+=J.titleBox.width/2):q.title.position.indexOf("center")!==-1?we*=2:q.title.position.indexOf("right")!==-1&&(we=we+fe,ae.x+=(1+ee)*fe,ie.tx-=J.titleBox.width/2),X=we/J.titleBox.width,re=L(J,$)/J.titleBox.height,{x:ae.x,y:ae.y,scale:Math.min(X,re),tx:ie.tx,ty:ie.ty}}function O(J,$){return J/($===void 0?1:$)}function L(J,$){var X=J.trace,re=$.h*(X.domain.y[1]-X.domain.y[0]);return Math.min(J.titleBox.height,re/2)}function N(J){var $=J.pull;if(!$)return 0;var X;if(t.isArrayOrTypedArray($))for($=0,X=0;X$&&($=J.pull[X]);return $}function U(J,$){var X,re,ee,q,ae,ie,fe,we,Ae,Fe,Ce,qe,et;function Qe(xe,ce){return xe.pxmid[1]-ce.pxmid[1]}function Ke(xe,ce){return ce.pxmid[1]-xe.pxmid[1]}function Xe(xe,ce){ce||(ce={});var Re=ce.labelExtraY+(re?ce.yLabelMax:ce.yLabelMin),$e=re?xe.yLabelMin:xe.yLabelMax,rt=re?xe.yLabelMax:xe.yLabelMin,Je=xe.cyFinal+ae(xe.px0[1],xe.px1[1]),At=Re-$e,St,Rt,Ut,ir,ar,Mr;if(At*fe>0&&(xe.labelExtraY=At),!!t.isArrayOrTypedArray($.pull))for(Rt=0;Rt=(f.castOption($.pull,Ut.pts)||0))&&((xe.pxmid[1]-Ut.pxmid[1])*fe>0?(ir=Ut.cyFinal+ae(Ut.px0[1],Ut.px1[1]),At=ir-$e-xe.labelExtraY,At*fe>0&&(xe.labelExtraY+=At)):(rt+xe.labelExtraY-Je)*fe>0&&(St=3*ie*Math.abs(Rt-Fe.indexOf(xe)),ar=Ut.cxFinal+q(Ut.px0[0],Ut.px1[0]),Mr=ar+St-(xe.cxFinal+xe.pxmid[0])-xe.labelExtraX,Mr*ie>0&&(xe.labelExtraX+=Mr)))}for(re=0;re<2;re++)for(ee=re?Qe:Ke,ae=re?Math.max:Math.min,fe=re?1:-1,X=0;X<2;X++){for(q=X?Math.max:Math.min,ie=X?1:-1,we=J[re][X],we.sort(ee),Ae=J[1-re][X],Fe=Ae.concat(we),qe=[],Ce=0;Ce1?(we=X.r,Ae=we/ee.aspectratio):(Ae=X.r,we=Ae*ee.aspectratio),we*=(1+ee.baseratio)/2,fe=we*Ae}ae=Math.min(ae,fe/X.vTotal)}for(re=0;re$.vTotal/2?1:0,we.halfangle=Math.PI*Math.min(we.v/$.vTotal,.5),we.ring=1-re.hole,we.rInscribed=P(we,$))}function oe(J,$){return[J*Math.sin($),-J*Math.cos($)]}function le(J,$,X){var re=J._fullLayout,ee=X.trace,q=ee.texttemplate,ae=ee.textinfo;if(!q&&ae&&ae!=="none"){var ie=ae.split("+"),fe=function(ce){return ie.indexOf(ce)!==-1},we=fe("label"),Ae=fe("text"),Fe=fe("value"),Ce=fe("percent"),qe=re.separators,et;if(et=we?[$.label]:[],Ae){var Qe=f.getFirstFilled(ee.text,$.pts);h(Qe)&&et.push(Qe)}Fe&&et.push(f.formatPieValue($.v,qe)),Ce&&et.push(f.formatPiePercent($.v/X.vTotal,qe)),$.text=et.join("
")}function Ke(ce){return{label:ce.label,value:ce.v,valueLabel:f.formatPieValue(ce.v,re.separators),percent:ce.v/X.vTotal,percentLabel:f.formatPiePercent(ce.v/X.vTotal,re.separators),color:ce.color,text:ce.text,customdata:t.castOption(ee,ce.i,"customdata")}}if(q){var Xe=t.castOption(ee,$.i,"texttemplate");if(!Xe)$.text="";else{var Me=Ke($),xe=f.getFirstFilled(ee.text,$.pts);(h(xe)||xe==="")&&(Me.text=xe),$.text=t.texttemplateString(Xe,Me,J._fullLayout._d3locale,Me,ee._meta||{})}}}function j(J,$){var X=J.rotate*Math.PI/180,re=Math.cos(X),ee=Math.sin(X),q=($.left+$.right)/2,ae=($.top+$.bottom)/2;J.textX=q*re-ae*ee,J.textY=q*ee+ae*re,J.noCenter=!0}G.exports={plot:T,formatSliceLabel:le,transformInsideText:_,determineInsideTextFont:S,positionTitleOutside:B,prerenderTitles:M,layoutAreas:Z,attachFxHandlers:y,computeTransform:j}}}),uC=He({"src/traces/pie/style.js"(Y,G){var d=Qn(),x=U0(),A=hh().resizeText;G.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");A(e,t,"pie"),t.each(function(r){var o=r[0],a=o.trace,i=d.select(this);i.style({opacity:a.opacity}),i.selectAll("path.surface").each(function(n){d.select(this).call(x,n,a,e)})})}}}),cC=He({"src/traces/pie/base_plot.js"(Y){var G=yu();Y.name="pie",Y.plot=function(d,x,A,E){G.plotBasePlot(Y.name,d,x,A,E)},Y.clean=function(d,x,A,E){G.cleanBasePlot(Y.name,d,x,A,E)}}}),fC=He({"src/traces/pie/index.js"(Y,G){G.exports={attributes:Bp(),supplyDefaults:Np().supplyDefaults,supplyLayoutDefaults:sC(),layoutAttributes:r_(),calc:tg().calc,crossTraceCalc:tg().crossTraceCalc,plot:a_().plot,style:uC(),styleOne:U0(),moduleType:"trace",name:"pie",basePlotModule:cC(),categories:["pie-like","pie","showLegend"],meta:{}}}}),hC=He({"lib/pie.js"(Y,G){G.exports=fC()}}),vC=He({"src/traces/sunburst/base_plot.js"(Y){var G=yu();Y.name="sunburst",Y.plot=function(d,x,A,E){G.plotBasePlot(Y.name,d,x,A,E)},Y.clean=function(d,x,A,E){G.cleanBasePlot(Y.name,d,x,A,E)}}}),d2=He({"src/traces/sunburst/constants.js"(Y,G){G.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),xy=He({"src/traces/sunburst/attributes.js"(Y,G){var d=cl(),x=Yo().hovertemplateAttrs,A=Yo().texttemplateAttrs,E=kl(),e=mu().attributes,t=Bp(),r=d2(),o=ho().extendFlat,a=Nf().pattern;G.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:o({colors:{valType:"data_array",editType:"calc"},line:{color:o({},t.marker.line.color,{dflt:null}),width:o({},t.marker.line.width,{dflt:1}),editType:"calc"},pattern:a,editType:"calc"},E("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:t.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:A({editType:"plot"},{keys:r.eventDataKeys.concat(["label","value"])}),hovertext:t.hovertext,hoverinfo:o({},d.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:x({},{keys:r.eventDataKeys}),textfont:t.textfont,insidetextorientation:t.insidetextorientation,insidetextfont:t.insidetextfont,outsidetextfont:o({},t.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:t.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:e({name:"sunburst",trace:!0,editType:"calc"})}}}),p2=He({"src/traces/sunburst/layout_attributes.js"(Y,G){G.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),dC=He({"src/traces/sunburst/defaults.js"(Y,G){var d=Gr(),x=xy(),A=mu().defaults,E=Jh().handleText,e=Np().handleMarkerDefaults,t=Kl(),r=t.hasColorscale,o=t.handleDefaults;G.exports=function(i,n,s,c){function f(S,M){return d.coerce(i,n,x,S,M)}var v=f("labels"),h=f("parents");if(!v||!v.length||!h||!h.length){n.visible=!1;return}var T=f("values");T&&T.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),e(i,n,c,f);var l=n._hasColorscale=r(i,"marker","colors")||(i.marker||{}).coloraxis;l&&o(i,n,c,f,{prefix:"marker.",cLetter:"c"}),f("leaf.opacity",l?1:.7);var y=f("text");f("texttemplate"),n.texttemplate||f("textinfo",d.isArrayOrTypedArray(y)?"text+label":"label"),f("hovertext"),f("hovertemplate");var b="auto";E(i,n,c,f,b,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("insidetextorientation"),f("sort"),f("rotation"),f("root.color"),A(n,c,f),n._length=null}}}),pC=He({"src/traces/sunburst/layout_defaults.js"(Y,G){var d=Gr(),x=p2();G.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("sunburstcolorway",e.colorway),t("extendsunburstcolors")}}}),by=He({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y):(d=d||self,x(d.d3=d.d3||{}))})(Y,function(d){function x(Oe,ve){return Oe.parent===ve.parent?1:2}function A(Oe){return Oe.reduce(E,0)/Oe.length}function E(Oe,ve){return Oe+ve.x}function e(Oe){return 1+Oe.reduce(t,0)}function t(Oe,ve){return Math.max(Oe,ve.y)}function r(Oe){for(var ve;ve=Oe.children;)Oe=ve[0];return Oe}function o(Oe){for(var ve;ve=Oe.children;)Oe=ve[ve.length-1];return Oe}function a(){var Oe=x,ve=1,ge=1,be=!1;function Pe(We){var ct,_t=0;We.eachAfter(function(Zt){var lr=Zt.children;lr?(Zt.x=A(lr),Zt.y=e(lr)):(Zt.x=ct?_t+=Oe(Zt,ct):0,Zt.y=0,ct=Zt)});var Mt=r(We),Nt=o(We),Bt=Mt.x-Oe(Mt,Nt)/2,qt=Nt.x+Oe(Nt,Mt)/2;return We.eachAfter(be?function(Zt){Zt.x=(Zt.x-We.x)*ve,Zt.y=(We.y-Zt.y)*ge}:function(Zt){Zt.x=(Zt.x-Bt)/(qt-Bt)*ve,Zt.y=(1-(We.y?Zt.y/We.y:1))*ge})}return Pe.separation=function(We){return arguments.length?(Oe=We,Pe):Oe},Pe.size=function(We){return arguments.length?(be=!1,ve=+We[0],ge=+We[1],Pe):be?null:[ve,ge]},Pe.nodeSize=function(We){return arguments.length?(be=!0,ve=+We[0],ge=+We[1],Pe):be?[ve,ge]:null},Pe}function i(Oe){var ve=0,ge=Oe.children,be=ge&&ge.length;if(!be)ve=1;else for(;--be>=0;)ve+=ge[be].value;Oe.value=ve}function n(){return this.eachAfter(i)}function s(Oe){var ve=this,ge,be=[ve],Pe,We,ct;do for(ge=be.reverse(),be=[];ve=ge.pop();)if(Oe(ve),Pe=ve.children,Pe)for(We=0,ct=Pe.length;We=0;--Pe)ge.push(be[Pe]);return this}function f(Oe){for(var ve=this,ge=[ve],be=[],Pe,We,ct;ve=ge.pop();)if(be.push(ve),Pe=ve.children,Pe)for(We=0,ct=Pe.length;We=0;)ge+=be[Pe].value;ve.value=ge})}function h(Oe){return this.eachBefore(function(ve){ve.children&&ve.children.sort(Oe)})}function T(Oe){for(var ve=this,ge=l(ve,Oe),be=[ve];ve!==ge;)ve=ve.parent,be.push(ve);for(var Pe=be.length;Oe!==ge;)be.splice(Pe,0,Oe),Oe=Oe.parent;return be}function l(Oe,ve){if(Oe===ve)return Oe;var ge=Oe.ancestors(),be=ve.ancestors(),Pe=null;for(Oe=ge.pop(),ve=be.pop();Oe===ve;)Pe=Oe,Oe=ge.pop(),ve=be.pop();return Pe}function y(){for(var Oe=this,ve=[Oe];Oe=Oe.parent;)ve.push(Oe);return ve}function b(){var Oe=[];return this.each(function(ve){Oe.push(ve)}),Oe}function S(){var Oe=[];return this.eachBefore(function(ve){ve.children||Oe.push(ve)}),Oe}function M(){var Oe=this,ve=[];return Oe.each(function(ge){ge!==Oe&&ve.push({source:ge.parent,target:ge})}),ve}function _(Oe,ve){var ge=new m(Oe),be=+Oe.value&&(ge.value=Oe.value),Pe,We=[ge],ct,_t,Mt,Nt;for(ve==null&&(ve=p);Pe=We.pop();)if(be&&(Pe.value=+Pe.data.value),(_t=ve(Pe.data))&&(Nt=_t.length))for(Pe.children=new Array(Nt),Mt=Nt-1;Mt>=0;--Mt)We.push(ct=Pe.children[Mt]=new m(_t[Mt])),ct.parent=Pe,ct.depth=Pe.depth+1;return ge.eachBefore(g)}function w(){return _(this).eachBefore(u)}function p(Oe){return Oe.children}function u(Oe){Oe.data=Oe.data.data}function g(Oe){var ve=0;do Oe.height=ve;while((Oe=Oe.parent)&&Oe.height<++ve)}function m(Oe){this.data=Oe,this.depth=this.height=0,this.parent=null}m.prototype=_.prototype={constructor:m,count:n,each:s,eachAfter:f,eachBefore:c,sum:v,sort:h,path:T,ancestors:y,descendants:b,leaves:S,links:M,copy:w};var R=Array.prototype.slice;function P(Oe){for(var ve=Oe.length,ge,be;ve;)be=Math.random()*ve--|0,ge=Oe[ve],Oe[ve]=Oe[be],Oe[be]=ge;return Oe}function z(Oe){for(var ve=0,ge=(Oe=P(R.call(Oe))).length,be=[],Pe,We;ve0&&ge*ge>be*be+Pe*Pe}function L(Oe,ve){for(var ge=0;geMt?(Pe=(Nt+Mt-We)/(2*Nt),_t=Math.sqrt(Math.max(0,Mt/Nt-Pe*Pe)),ge.x=Oe.x-Pe*be-_t*ct,ge.y=Oe.y-Pe*ct+_t*be):(Pe=(Nt+We-Mt)/(2*Nt),_t=Math.sqrt(Math.max(0,We/Nt-Pe*Pe)),ge.x=ve.x+Pe*be-_t*ct,ge.y=ve.y+Pe*ct+_t*be)):(ge.x=ve.x+ge.r,ge.y=ve.y)}function oe(Oe,ve){var ge=Oe.r+ve.r-1e-6,be=ve.x-Oe.x,Pe=ve.y-Oe.y;return ge>0&&ge*ge>be*be+Pe*Pe}function le(Oe){var ve=Oe._,ge=Oe.next._,be=ve.r+ge.r,Pe=(ve.x*ge.r+ge.x*ve.r)/be,We=(ve.y*ge.r+ge.y*ve.r)/be;return Pe*Pe+We*We}function j(Oe){this._=Oe,this.next=null,this.previous=null}function J(Oe){if(!(Pe=Oe.length))return 0;var ve,ge,be,Pe,We,ct,_t,Mt,Nt,Bt,qt;if(ve=Oe[0],ve.x=0,ve.y=0,!(Pe>1))return ve.r;if(ge=Oe[1],ve.x=-ge.r,ge.x=ve.r,ge.y=0,!(Pe>2))return ve.r+ge.r;ue(ge,ve,be=Oe[2]),ve=new j(ve),ge=new j(ge),be=new j(be),ve.next=be.previous=ge,ge.next=ve.previous=be,be.next=ge.previous=ve;e:for(_t=3;_t0)throw new Error("cycle");return _t}return ge.id=function(be){return arguments.length?(Oe=re(be),ge):Oe},ge.parentId=function(be){return arguments.length?(ve=re(be),ge):ve},ge}function ce(Oe,ve){return Oe.parent===ve.parent?1:2}function Re(Oe){var ve=Oe.children;return ve?ve[0]:Oe.t}function $e(Oe){var ve=Oe.children;return ve?ve[ve.length-1]:Oe.t}function rt(Oe,ve,ge){var be=ge/(ve.i-Oe.i);ve.c-=be,ve.s+=ge,Oe.c+=be,ve.z+=ge,ve.m+=ge}function Je(Oe){for(var ve=0,ge=0,be=Oe.children,Pe=be.length,We;--Pe>=0;)We=be[Pe],We.z+=ve,We.m+=ve,ve+=We.s+(ge+=We.c)}function At(Oe,ve,ge){return Oe.a.parent===ve.parent?Oe.a:ge}function St(Oe,ve){this._=Oe,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=ve}St.prototype=Object.create(m.prototype);function Rt(Oe){for(var ve=new St(Oe,0),ge,be=[ve],Pe,We,ct,_t;ge=be.pop();)if(We=ge._.children)for(ge.children=new Array(_t=We.length),ct=_t-1;ct>=0;--ct)be.push(Pe=ge.children[ct]=new St(We[ct],ct)),Pe.parent=ge;return(ve.parent=new St(null,0)).children=[ve],ve}function Ut(){var Oe=ce,ve=1,ge=1,be=null;function Pe(Nt){var Bt=Rt(Nt);if(Bt.eachAfter(We),Bt.parent.m=-Bt.z,Bt.eachBefore(ct),be)Nt.eachBefore(Mt);else{var qt=Nt,Zt=Nt,lr=Nt;Nt.eachBefore(function(Ia){Ia.xZt.x&&(Zt=Ia),Ia.depth>lr.depth&&(lr=Ia)});var ta=qt===Zt?1:Oe(qt,Zt)/2,da=ta-qt.x,wa=ve/(Zt.x+ta+da),ma=ge/(lr.depth||1);Nt.eachBefore(function(Ia){Ia.x=(Ia.x+da)*wa,Ia.y=Ia.depth*ma})}return Nt}function We(Nt){var Bt=Nt.children,qt=Nt.parent.children,Zt=Nt.i?qt[Nt.i-1]:null;if(Bt){Je(Nt);var lr=(Bt[0].z+Bt[Bt.length-1].z)/2;Zt?(Nt.z=Zt.z+Oe(Nt._,Zt._),Nt.m=Nt.z-lr):Nt.z=lr}else Zt&&(Nt.z=Zt.z+Oe(Nt._,Zt._));Nt.parent.A=_t(Nt,Zt,Nt.parent.A||qt[0])}function ct(Nt){Nt._.x=Nt.z+Nt.parent.m,Nt.m+=Nt.parent.m}function _t(Nt,Bt,qt){if(Bt){for(var Zt=Nt,lr=Nt,ta=Bt,da=Zt.parent.children[0],wa=Zt.m,ma=lr.m,Ia=ta.m,va=da.m,La;ta=$e(ta),Zt=Re(Zt),ta&&Zt;)da=Re(da),lr=$e(lr),lr.a=Nt,La=ta.z+Ia-Zt.z-wa+Oe(ta._,Zt._),La>0&&(rt(At(ta,Nt,qt),Nt,La),wa+=La,ma+=La),Ia+=ta.m,wa+=Zt.m,va+=da.m,ma+=lr.m;ta&&!$e(lr)&&(lr.t=ta,lr.m+=Ia-ma),Zt&&!Re(da)&&(da.t=Zt,da.m+=wa-va,qt=Nt)}return qt}function Mt(Nt){Nt.x*=ve,Nt.y=Nt.depth*ge}return Pe.separation=function(Nt){return arguments.length?(Oe=Nt,Pe):Oe},Pe.size=function(Nt){return arguments.length?(be=!1,ve=+Nt[0],ge=+Nt[1],Pe):be?null:[ve,ge]},Pe.nodeSize=function(Nt){return arguments.length?(be=!0,ve=+Nt[0],ge=+Nt[1],Pe):be?[ve,ge]:null},Pe}function ir(Oe,ve,ge,be,Pe){for(var We=Oe.children,ct,_t=-1,Mt=We.length,Nt=Oe.value&&(Pe-ge)/Oe.value;++_tIa&&(Ia=Nt),Vt=wa*wa*Ka,va=Math.max(Ia/Vt,Vt/ma),va>La){wa-=Nt;break}La=va}ct.push(Mt={value:wa,dice:lr1?be:1)},ge}(ar);function dr(){var Oe=fr,ve=!1,ge=1,be=1,Pe=[0],We=ee,ct=ee,_t=ee,Mt=ee,Nt=ee;function Bt(Zt){return Zt.x0=Zt.y0=0,Zt.x1=ge,Zt.y1=be,Zt.eachBefore(qt),Pe=[0],ve&&Zt.eachBefore(Fe),Zt}function qt(Zt){var lr=Pe[Zt.depth],ta=Zt.x0+lr,da=Zt.y0+lr,wa=Zt.x1-lr,ma=Zt.y1-lr;wa=Zt-1){var Ia=We[qt];Ia.x0=ta,Ia.y0=da,Ia.x1=wa,Ia.y1=ma;return}for(var va=Nt[qt],La=lr/2+va,Ka=qt+1,Vt=Zt-1;Ka>>1;Nt[Lt]ma-da){var gr=(ta*Ot+wa*jt)/lr;Bt(qt,Ka,jt,ta,da,gr,ma),Bt(Ka,Zt,Ot,gr,da,wa,ma)}else{var Br=(da*Ot+ma*jt)/lr;Bt(qt,Ka,jt,ta,da,wa,Br),Bt(Ka,Zt,Ot,ta,Br,wa,ma)}}}function ze(Oe,ve,ge,be,Pe){(Oe.depth&1?ir:Ce)(Oe,ve,ge,be,Pe)}var Ge=function Oe(ve){function ge(be,Pe,We,ct,_t){if((Mt=be._squarify)&&Mt.ratio===ve)for(var Mt,Nt,Bt,qt,Zt=-1,lr,ta=Mt.length,da=be.value;++Zt1?be:1)},ge}(ar);d.cluster=a,d.hierarchy=_,d.pack=ie,d.packEnclose=z,d.packSiblings=$,d.partition=qe,d.stratify=xe,d.tree=Ut,d.treemap=dr,d.treemapBinary=pt,d.treemapDice=Ce,d.treemapResquarify=Ge,d.treemapSlice=ir,d.treemapSliceDice=ze,d.treemapSquarify=fr,Object.defineProperty(d,"__esModule",{value:!0})})}}),wy=He({"src/traces/sunburst/calc.js"(Y){var G=by(),d=Hi(),x=Gr(),A=Kl().makeColorScaleFuncFromTrace,E=tg().makePullColorFn,e=tg().generateExtendedColors,t=Kl().calc,r=lo().ALMOST_EQUAL,o={},a={},i={};Y.calc=function(s,c){var f=s._fullLayout,v=c.ids,h=x.isArrayOrTypedArray(v),T=c.labels,l=c.parents,y=c.values,b=x.isArrayOrTypedArray(y),S=[],M={},_={},w=function($,X){M[$]?M[$].push(X):M[$]=[X],_[X]=1},p=function($){return $||typeof $=="number"},u=function($){return!b||d(y[$])&&y[$]>=0},g,m,R;h?(g=Math.min(v.length,l.length),m=function($){return p(v[$])&&u($)},R=function($){return String(v[$])}):(g=Math.min(T.length,l.length),m=function($){return p(T[$])&&u($)},R=function($){return String(T[$])}),b&&(g=Math.min(g,y.length));for(var P=0;P1){for(var N=x.randstr(),U=0;U>8&15|G>>4&240,G>>4&15|G&240,(G&15)<<4|G&15,1):d===8?Ty(G>>24&255,G>>16&255,G>>8&255,(G&255)/255):d===4?Ty(G>>12&15|G>>8&240,G>>8&15|G>>4&240,G>>4&15|G&240,((G&15)<<4|G&15)/255):null):(G=S2.exec(Y))?new Vf(G[1],G[2],G[3],1):(G=M2.exec(Y))?new Vf(G[1]*255/100,G[2]*255/100,G[3]*255/100,1):(G=E2.exec(Y))?Ty(G[1],G[2],G[3],G[4]):(G=k2.exec(Y))?Ty(G[1]*255/100,G[2]*255/100,G[3]*255/100,G[4]):(G=C2.exec(Y))?b2(G[1],G[2]/100,G[3]/100,1):(G=L2.exec(Y))?b2(G[1],G[2]/100,G[3]/100,G[4]):l_.hasOwnProperty(Y)?m2(l_[Y]):Y==="transparent"?new Vf(NaN,NaN,NaN,0):null}function m2(Y){return new Vf(Y>>16&255,Y>>8&255,Y&255,1)}function Ty(Y,G,d,x){return x<=0&&(Y=G=d=NaN),new Vf(Y,G,d,x)}function i_(Y){return Y instanceof sd||(Y=ag(Y)),Y?(Y=Y.rgb(),new Vf(Y.r,Y.g,Y.b,Y.opacity)):new Vf}function Ay(Y,G,d,x){return arguments.length===1?i_(Y):new Vf(Y,G,d,x??1)}function Vf(Y,G,d,x){this.r=+Y,this.g=+G,this.b=+d,this.opacity=+x}function _2(){return`#${Kd(this.r)}${Kd(this.g)}${Kd(this.b)}`}function mC(){return`#${Kd(this.r)}${Kd(this.g)}${Kd(this.b)}${Kd((isNaN(this.opacity)?1:this.opacity)*255)}`}function x2(){const Y=Sy(this.opacity);return`${Y===1?"rgb(":"rgba("}${Yd(this.r)}, ${Yd(this.g)}, ${Yd(this.b)}${Y===1?")":`, ${Y})`}`}function Sy(Y){return isNaN(Y)?1:Math.max(0,Math.min(1,Y))}function Yd(Y){return Math.max(0,Math.min(255,Math.round(Y)||0))}function Kd(Y){return Y=Yd(Y),(Y<16?"0":"")+Y.toString(16)}function b2(Y,G,d,x){return x<=0?Y=G=d=NaN:d<=0||d>=1?Y=G=NaN:G<=0&&(Y=NaN),new cv(Y,G,d,x)}function w2(Y){if(Y instanceof cv)return new cv(Y.h,Y.s,Y.l,Y.opacity);if(Y instanceof sd||(Y=ag(Y)),!Y)return new cv;if(Y instanceof cv)return Y;Y=Y.rgb();var G=Y.r/255,d=Y.g/255,x=Y.b/255,A=Math.min(G,d,x),E=Math.max(G,d,x),e=NaN,t=E-A,r=(E+A)/2;return t?(G===E?e=(d-x)/t+(d0&&r<1?0:e,new cv(e,t,r,Y.opacity)}function o_(Y,G,d,x){return arguments.length===1?w2(Y):new cv(Y,G,d,x??1)}function cv(Y,G,d,x){this.h=+Y,this.s=+G,this.l=+d,this.opacity=+x}function T2(Y){return Y=(Y||0)%360,Y<0?Y+360:Y}function My(Y){return Math.max(0,Math.min(1,Y||0))}function s_(Y,G,d){return(Y<60?G+(d-G)*Y/60:Y<180?d:Y<240?G+(d-G)*(240-Y)/60:G)*255}var ld,Jd,$d,jp,fv,A2,S2,M2,E2,k2,C2,L2,l_,u_=ks({"node_modules/d3-color/src/color.js"(){n_(),ld=.7,Jd=1/ld,$d="\\s*([+-]?\\d+)\\s*",jp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",A2=/^#([0-9a-f]{3,8})$/,S2=new RegExp(`^rgb\\(${$d},${$d},${$d}\\)$`),M2=new RegExp(`^rgb\\(${fv},${fv},${fv}\\)$`),E2=new RegExp(`^rgba\\(${$d},${$d},${$d},${jp}\\)$`),k2=new RegExp(`^rgba\\(${fv},${fv},${fv},${jp}\\)$`),C2=new RegExp(`^hsl\\(${jp},${fv},${fv}\\)$`),L2=new RegExp(`^hsla\\(${jp},${fv},${fv},${jp}\\)$`),l_={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},Up(sd,ag,{copy(Y){return Object.assign(new this.constructor,this,Y)},displayable(){return this.rgb().displayable()},hex:g2,formatHex:g2,formatHex8:gC,formatHsl:yC,formatRgb:y2,toString:y2}),Up(Vf,Ay,rg(sd,{brighter(Y){return Y=Y==null?Jd:Math.pow(Jd,Y),new Vf(this.r*Y,this.g*Y,this.b*Y,this.opacity)},darker(Y){return Y=Y==null?ld:Math.pow(ld,Y),new Vf(this.r*Y,this.g*Y,this.b*Y,this.opacity)},rgb(){return this},clamp(){return new Vf(Yd(this.r),Yd(this.g),Yd(this.b),Sy(this.opacity))},displayable(){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:_2,formatHex:_2,formatHex8:mC,formatRgb:x2,toString:x2})),Up(cv,o_,rg(sd,{brighter(Y){return Y=Y==null?Jd:Math.pow(Jd,Y),new cv(this.h,this.s,this.l*Y,this.opacity)},darker(Y){return Y=Y==null?ld:Math.pow(ld,Y),new cv(this.h,this.s,this.l*Y,this.opacity)},rgb(){var Y=this.h%360+(this.h<0)*360,G=isNaN(Y)||isNaN(this.s)?0:this.s,d=this.l,x=d+(d<.5?d:1-d)*G,A=2*d-x;return new Vf(s_(Y>=240?Y-240:Y+120,A,x),s_(Y,A,x),s_(Y<120?Y+240:Y-120,A,x),this.opacity)},clamp(){return new cv(T2(this.h),My(this.s),My(this.l),Sy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const Y=Sy(this.opacity);return`${Y===1?"hsl(":"hsla("}${T2(this.h)}, ${My(this.s)*100}%, ${My(this.l)*100}%${Y===1?")":`, ${Y})`}`}}))}}),c_,f_,P2=ks({"node_modules/d3-color/src/math.js"(){c_=Math.PI/180,f_=180/Math.PI}});function I2(Y){if(Y instanceof Mv)return new Mv(Y.l,Y.a,Y.b,Y.opacity);if(Y instanceof Hv)return R2(Y);Y instanceof Vf||(Y=i_(Y));var G=g_(Y.r),d=g_(Y.g),x=g_(Y.b),A=v_((.2225045*G+.7168786*d+.0606169*x)/__),E,e;return G===d&&d===x?E=e=A:(E=v_((.4360747*G+.3850649*d+.1430804*x)/m_),e=v_((.0139322*G+.0971045*d+.7141733*x)/x_)),new Mv(116*A-16,500*(E-A),200*(A-e),Y.opacity)}function h_(Y,G,d,x){return arguments.length===1?I2(Y):new Mv(Y,G,d,x??1)}function Mv(Y,G,d,x){this.l=+Y,this.a=+G,this.b=+d,this.opacity=+x}function v_(Y){return Y>D2?Math.pow(Y,.3333333333333333):Y/w_+b_}function d_(Y){return Y>Qd?Y*Y*Y:w_*(Y-b_)}function p_(Y){return 255*(Y<=.0031308?12.92*Y:1.055*Math.pow(Y,.4166666666666667)-.055)}function g_(Y){return(Y/=255)<=.04045?Y/12.92:Math.pow((Y+.055)/1.055,2.4)}function _C(Y){if(Y instanceof Hv)return new Hv(Y.h,Y.c,Y.l,Y.opacity);if(Y instanceof Mv||(Y=I2(Y)),Y.a===0&&Y.b===0)return new Hv(NaN,0=1?(d=1,G-1):Math.floor(d*G),A=Y[x],E=Y[x+1],e=x>0?Y[x-1]:2*A-E,t=x()=>Y}});function U2(Y,G){return function(d){return Y+d*G}}function TC(Y,G,d){return Y=Math.pow(Y,d),G=Math.pow(G,d)-Y,d=1/d,function(x){return Math.pow(Y+x*G,d)}}function Cy(Y,G){var d=G-Y;return d?U2(Y,d>180||d<-180?d-360*Math.round(d/360):d):og(isNaN(Y)?G:Y)}function AC(Y){return(Y=+Y)==1?qf:function(G,d){return d-G?TC(G,d,Y):og(isNaN(G)?d:G)}}function qf(Y,G){var d=G-Y;return d?U2(Y,d):og(isNaN(Y)?G:Y)}var Hp=ks({"node_modules/d3-interpolate/src/color.js"(){N2()}});function j2(Y){return function(G){var d=G.length,x=new Array(d),A=new Array(d),E=new Array(d),e,t;for(e=0;ed&&(E=G.slice(d,E),t[e]?t[e]+=E:t[++e]=E),(x=x[0])===(A=A[0])?t[e]?t[e]+=A:t[++e]=A:(t[++e]=null,r.push({i:e,x:Ev(x,A)})),d=Ry.lastIndex;return d180?a+=360:a-o>180&&(o+=360),n.push({i:i.push(A(i)+"rotate(",null,x)-2,x:Ev(o,a)})):a&&i.push(A(i)+"rotate("+a+x)}function t(o,a,i,n){o!==a?n.push({i:i.push(A(i)+"skewX(",null,x)-2,x:Ev(o,a)}):a&&i.push(A(i)+"skewX("+a+x)}function r(o,a,i,n,s,c){if(o!==i||a!==n){var f=s.push(A(s)+"scale(",null,",",null,")");c.push({i:f-4,x:Ev(o,i)},{i:f-2,x:Ev(a,n)})}else(i!==1||n!==1)&&s.push(A(s)+"scale("+i+","+n+")")}return function(o,a){var i=[],n=[];return o=Y(o),a=Y(a),E(o.translateX,o.translateY,a.translateX,a.translateY,i,n),e(o.rotate,a.rotate,i,n),t(o.skewX,a.skewX,i,n),r(o.scaleX,o.scaleY,a.scaleX,a.scaleY,i,n),o=a=null,function(s){for(var c=-1,f=n.length,v;++cDy,interpolateArray:()=>SC,interpolateBasis:()=>F2,interpolateBasisClosed:()=>O2,interpolateCubehelix:()=>d3,interpolateCubehelixLong:()=>p3,interpolateDate:()=>X2,interpolateDiscrete:()=>kC,interpolateHcl:()=>f3,interpolateHclLong:()=>h3,interpolateHsl:()=>l3,interpolateHslLong:()=>u3,interpolateHue:()=>LC,interpolateLab:()=>qC,interpolateNumber:()=>Ev,interpolateNumberArray:()=>C_,interpolateObject:()=>K2,interpolateRgb:()=>Ly,interpolateRgbBasis:()=>V2,interpolateRgbBasisClosed:()=>q2,interpolateRound:()=>IC,interpolateString:()=>$2,interpolateTransformCss:()=>r3,interpolateTransformSvg:()=>a3,interpolateZoom:()=>o3,piecewise:()=>ZC,quantize:()=>YC});var Gp=ks({"node_modules/d3-interpolate/src/index.js"(){zy(),Z2(),k_(),B2(),Y2(),CC(),PC(),Py(),L_(),J2(),RC(),Q2(),BC(),jC(),H2(),VC(),HC(),GC(),WC(),XC(),KC()}}),I_=He({"src/traces/sunburst/fill_one.js"(Y,G){var d=vo(),x=Ai();G.exports=function(E,e,t,r,o){var a=e.data.data,i=a.i,n=o||a.color;if(i>=0){e.i=a.i;var s=t.marker;s.pattern?(!s.colors||!s.pattern.shape)&&(s.color=n,e.color=n):(s.color=n,e.color=n),d.pointStyle(E,t,r,e)}else x.fill(E,n)}}}),g3=He({"src/traces/sunburst/style.js"(Y,G){var d=Qn(),x=Ai(),A=Gr(),E=hh().resizeText,e=I_();function t(o){var a=o._fullLayout._sunburstlayer.selectAll(".trace");E(o,a,"sunburst"),a.each(function(i){var n=d.select(this),s=i[0],c=s.trace;n.style("opacity",c.opacity),n.selectAll("path.surface").each(function(f){d.select(this).call(r,f,c,o)})})}function r(o,a,i,n){var s=a.data.data,c=!a.children,f=s.i,v=A.castOption(i,f,"marker.line.color")||x.defaultLine,h=A.castOption(i,f,"marker.line.width")||0;o.call(e,a,i,n).style("stroke-width",h).call(x.stroke,v).style("opacity",c?i.leaf.opacity:null)}G.exports={style:t,styleOne:r}}}),ud=He({"src/traces/sunburst/helpers.js"(Y){var G=Gr(),d=Ai(),x=xv(),A=Hd();Y.findEntryWithLevel=function(r,o){var a;return o&&r.eachAfter(function(i){if(Y.getPtId(i)===o)return a=i.copy()}),a||r},Y.findEntryWithChild=function(r,o){var a;return r.eachAfter(function(i){for(var n=i.children||[],s=0;s0)},Y.getMaxDepth=function(r){return r.maxdepth>=0?r.maxdepth:1/0},Y.isHeader=function(r,o){return!(Y.isLeaf(r)||r.depth===o._maxDepth-1)};function t(r){return r.data.data.pid}Y.getParent=function(r,o){return Y.findEntryWithLevel(r,t(o))},Y.listPath=function(r,o){var a=r.parent;if(!a)return[];var i=o?[a.data[o]]:[a];return Y.listPath(a,o).concat(i)},Y.getPath=function(r){return Y.listPath(r,"label").join("/")+"/"},Y.formatValue=A.formatPieValue,Y.formatPercent=function(r,o){var a=G.formatPercent(r,0);return a==="0%"&&(a=A.formatPiePercent(r,o)),a}}}),By=He({"src/traces/sunburst/fx.js"(Y,G){var d=Qn(),x=Ei(),A=Ph().appendArrayPointValue,E=Wu(),e=Gr(),t=z0(),r=ud(),o=Hd(),a=o.formatPieValue;G.exports=function(s,c,f,v,h){var T=v[0],l=T.trace,y=T.hierarchy,b=l.type==="sunburst",S=l.type==="treemap"||l.type==="icicle";"_hasHoverLabel"in l||(l._hasHoverLabel=!1),"_hasHoverEvent"in l||(l._hasHoverEvent=!1);var M=function(p){var u=f._fullLayout;if(!(f._dragging||u.hovermode===!1)){var g=f._fullData[l.index],m=p.data.data,R=m.i,P=r.isHierarchyRoot(p),z=r.getParent(y,p),F=r.getValue(p),B=function(ae){return e.castOption(g,R,ae)},O=B("hovertemplate"),L=E.castHoverinfo(g,u,R),N=u.separators,U;if(O||L&&L!=="none"&&L!=="skip"){var Z,Q;b&&(Z=T.cx+p.pxmid[0]*(1-p.rInscribed),Q=T.cy+p.pxmid[1]*(1-p.rInscribed)),S&&(Z=p._hoverX,Q=p._hoverY);var ue={},oe=[],le=[],j=function(ae){return oe.indexOf(ae)!==-1};L&&(oe=L==="all"?g._module.attributes.hoverinfo.flags:L.split("+")),ue.label=m.label,j("label")&&ue.label&&le.push(ue.label),m.hasOwnProperty("v")&&(ue.value=m.v,ue.valueLabel=a(ue.value,N),j("value")&&le.push(ue.valueLabel)),ue.currentPath=p.currentPath=r.getPath(p.data),j("current path")&&!P&&le.push(ue.currentPath);var J,$=[],X=function(){$.indexOf(J)===-1&&(le.push(J),$.push(J))};ue.percentParent=p.percentParent=F/r.getValue(z),ue.parent=p.parentString=r.getPtLabel(z),j("percent parent")&&(J=r.formatPercent(ue.percentParent,N)+" of "+ue.parent,X()),ue.percentEntry=p.percentEntry=F/r.getValue(c),ue.entry=p.entry=r.getPtLabel(c),j("percent entry")&&!P&&!p.onPathbar&&(J=r.formatPercent(ue.percentEntry,N)+" of "+ue.entry,X()),ue.percentRoot=p.percentRoot=F/r.getValue(y),ue.root=p.root=r.getPtLabel(y),j("percent root")&&!P&&(J=r.formatPercent(ue.percentRoot,N)+" of "+ue.root,X()),ue.text=B("hovertext")||B("text"),j("text")&&(J=ue.text,e.isValidTextValue(J)&&le.push(J)),U=[i(p,g,h.eventDataKeys)];var re={trace:g,y:Q,_x0:p._x0,_x1:p._x1,_y0:p._y0,_y1:p._y1,text:le.join("
"),name:O||j("name")?g.name:void 0,color:B("hoverlabel.bgcolor")||m.color,borderColor:B("hoverlabel.bordercolor"),fontFamily:B("hoverlabel.font.family"),fontSize:B("hoverlabel.font.size"),fontColor:B("hoverlabel.font.color"),fontWeight:B("hoverlabel.font.weight"),fontStyle:B("hoverlabel.font.style"),fontVariant:B("hoverlabel.font.variant"),nameLength:B("hoverlabel.namelength"),textAlign:B("hoverlabel.align"),hovertemplate:O,hovertemplateLabels:ue,eventData:U};b&&(re.x0=Z-p.rInscribed*p.rpx1,re.x1=Z+p.rInscribed*p.rpx1,re.idealAlign=p.pxmid[0]<0?"left":"right"),S&&(re.x=Z,re.idealAlign=Z<0?"left":"right");var ee=[];E.loneHover(re,{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:f,inOut_bbox:ee}),U[0].bbox=ee[0],l._hasHoverLabel=!0}if(S){var q=s.select("path.surface");h.styleOne(q,p,g,f,{hovered:!0})}l._hasHoverEvent=!0,f.emit("plotly_hover",{points:U||[i(p,g,h.eventDataKeys)],event:d.event})}},_=function(p){var u=f._fullLayout,g=f._fullData[l.index],m=d.select(this).datum();if(l._hasHoverEvent&&(p.originalEvent=d.event,f.emit("plotly_unhover",{points:[i(m,g,h.eventDataKeys)],event:d.event}),l._hasHoverEvent=!1),l._hasHoverLabel&&(E.loneUnhover(u._hoverlayer.node()),l._hasHoverLabel=!1),S){var R=s.select("path.surface");h.styleOne(R,m,g,f,{hovered:!1})}},w=function(p){var u=f._fullLayout,g=f._fullData[l.index],m=b&&(r.isHierarchyRoot(p)||r.isLeaf(p)),R=r.getPtId(p),P=r.isEntry(p)?r.findEntryWithChild(y,R):r.findEntryWithLevel(y,R),z=r.getPtId(P),F={points:[i(p,g,h.eventDataKeys)],event:d.event};m||(F.nextLevel=z);var B=t.triggerHandler(f,"plotly_"+l.type+"click",F);if(B!==!1&&u.hovermode&&(f._hoverdata=[i(p,g,h.eventDataKeys)],E.click(f,d.event)),!m&&B!==!1&&!f._dragging&&!f._transitioning){x.call("_storeDirectGUIEdit",g,u._tracePreGUI[g.uid],{level:g.level});var O={data:[{level:z}],traces:[l.index]},L={frame:{redraw:!1,duration:h.transitionTime},transition:{duration:h.transitionTime,easing:h.transitionEasing},mode:"immediate",fromcurrent:!0};E.loneUnhover(u._hoverlayer.node()),x.call("animate",f,O,L)}};s.on("mouseover",M),s.on("mouseout",_),s.on("click",w)};function i(n,s,c){for(var f=n.data.data,v={curveNumber:s.index,pointNumber:f.i,data:s._input,fullData:s},h=0;hrt.x1?2*Math.PI:0)+ae;Je=ce.rpx1qe?2*Math.PI:0)+ae;$e={x0:Je,x1:Je}}else $e={rpx0:oe,rpx1:oe},E.extendFlat($e,xe(ce));else $e={rpx0:0,rpx1:0};else $e={x0:ae,x1:ae};return x($e,rt)}function Me(ce){var Re=$[T.getPtId(ce)],$e,rt=ce.transform;if(Re)$e=Re;else if($e={rpx1:ce.rpx1,transform:{textPosAngle:rt.textPosAngle,scale:0,rotate:rt.rotate,rCenter:rt.rCenter,x:rt.x,y:rt.y}},J)if(ce.parent)if(qe){var Je=ce.x1>qe?2*Math.PI:0;$e.x0=$e.x1=Je}else E.extendFlat($e,xe(ce));else $e.x0=$e.x1=ae;else $e.x0=$e.x1=ae;var At=x($e.transform.textPosAngle,ce.transform.textPosAngle),St=x($e.rpx1,ce.rpx1),Rt=x($e.x0,ce.x0),Ut=x($e.x1,ce.x1),ir=x($e.transform.scale,rt.scale),ar=x($e.transform.rotate,rt.rotate),Mr=rt.rCenter===0?3:$e.transform.rCenter===0?1/3:1,fr=x($e.transform.rCenter,rt.rCenter),dr=function(pt){return fr(Math.pow(pt,Mr))};return function(pt){var ze=St(pt),Ge=Rt(pt),Oe=Ut(pt),ve=dr(pt),ge=we(ze,(Ge+Oe)/2),be=At(pt),Pe={pxmid:ge,rpx1:ze,transform:{textPosAngle:be,rCenter:ve,x:rt.x,y:rt.y}};return r(B.type,rt,m),{transform:{targetX:Fe(Pe),targetY:Ce(Pe),scale:ir(pt),rotate:ar(pt),rCenter:ve}}}}function xe(ce){var Re=ce.parent,$e=$[T.getPtId(Re)],rt={};if($e){var Je=Re.children,At=Je.indexOf(ce),St=Je.length,Rt=x($e.x0,$e.x1);rt.x0=Rt(At/St),rt.x1=Rt(At/St)}else rt.x0=rt.x1=0;return rt}}function y(_){return d.partition().size([2*Math.PI,_.height+1])(_)}Y.formatSliceLabel=function(_,w,p,u,g){var m=p.texttemplate,R=p.textinfo;if(!m&&(!R||R==="none"))return"";var P=g.separators,z=u[0],F=_.data.data,B=z.hierarchy,O=T.isHierarchyRoot(_),L=T.getParent(B,_),N=T.getValue(_);if(!m){var U=R.split("+"),Z=function(ee){return U.indexOf(ee)!==-1},Q=[],ue;if(Z("label")&&F.label&&Q.push(F.label),F.hasOwnProperty("v")&&Z("value")&&Q.push(T.formatValue(F.v,P)),!O){Z("current path")&&Q.push(T.getPath(_.data));var oe=0;Z("percent parent")&&oe++,Z("percent entry")&&oe++,Z("percent root")&&oe++;var le=oe>1;if(oe){var j,J=function(ee){ue=T.formatPercent(j,P),le&&(ue+=" of "+ee),Q.push(ue)};Z("percent parent")&&!O&&(j=N/T.getValue(L),J("parent")),Z("percent entry")&&(j=N/T.getValue(w),J("entry")),Z("percent root")&&(j=N/T.getValue(B),J("root"))}}return Z("text")&&(ue=E.castOption(p,F.i,"text"),E.isValidTextValue(ue)&&Q.push(ue)),Q.join("
")}var $=E.castOption(p,F.i,"texttemplate");if(!$)return"";var X={};F.label&&(X.label=F.label),F.hasOwnProperty("v")&&(X.value=F.v,X.valueLabel=T.formatValue(F.v,P)),X.currentPath=T.getPath(_.data),O||(X.percentParent=N/T.getValue(L),X.percentParentLabel=T.formatPercent(X.percentParent,P),X.parent=T.getPtLabel(L)),X.percentEntry=N/T.getValue(w),X.percentEntryLabel=T.formatPercent(X.percentEntry,P),X.entry=T.getPtLabel(w),X.percentRoot=N/T.getValue(B),X.percentRootLabel=T.formatPercent(X.percentRoot,P),X.root=T.getPtLabel(B),F.hasOwnProperty("color")&&(X.color=F.color);var re=E.castOption(p,F.i,"text");return(E.isValidTextValue(re)||re==="")&&(X.text=re),X.customdata=E.castOption(p,F.i,"customdata"),E.texttemplateString($,X,g._d3locale,X,p._meta||{})};function b(_){return _.rpx0===0&&E.isFullCircle([_.x0,_.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(_.halfangle)),_.ring/2))}function S(_){return M(_.rpx1,_.transform.textPosAngle)}function M(_,w){return[_*Math.sin(w),-_*Math.cos(w)]}}}),JC=He({"src/traces/sunburst/index.js"(Y,G){G.exports={moduleType:"trace",name:"sunburst",basePlotModule:vC(),categories:[],animatable:!0,attributes:xy(),layoutAttributes:p2(),supplyDefaults:dC(),supplyLayoutDefaults:pC(),calc:wy().calc,crossTraceCalc:wy().crossTraceCalc,plot:R_().plot,style:g3().style,colorbar:ah(),meta:{}}}}),$C=He({"lib/sunburst.js"(Y,G){G.exports=JC()}}),QC=He({"src/traces/treemap/base_plot.js"(Y){var G=yu();Y.name="treemap",Y.plot=function(d,x,A,E){G.plotBasePlot(Y.name,d,x,A,E)},Y.clean=function(d,x,A,E){G.cleanBasePlot(Y.name,d,x,A,E)}}}),Wp=He({"src/traces/treemap/constants.js"(Y,G){G.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),D_=He({"src/traces/treemap/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=Yo().texttemplateAttrs,A=kl(),E=mu().attributes,e=Bp(),t=xy(),r=Wp(),o=ho().extendFlat,a=Nf().pattern;G.exports={labels:t.labels,parents:t.parents,values:t.values,branchvalues:t.branchvalues,count:t.count,level:t.level,maxdepth:t.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:o({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:t.marker.colors,pattern:a,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:t.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},A("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:o({},e.textfont,{}),editType:"calc"},text:e.text,textinfo:t.textinfo,texttemplate:x({editType:"plot"},{keys:r.eventDataKeys.concat(["label","value"])}),hovertext:e.hovertext,hoverinfo:t.hoverinfo,hovertemplate:d({},{keys:r.eventDataKeys}),textfont:e.textfont,insidetextfont:e.insidetextfont,outsidetextfont:o({},e.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:e.sort,root:t.root,domain:E({name:"treemap",trace:!0,editType:"calc"})}}}),y3=He({"src/traces/treemap/layout_attributes.js"(Y,G){G.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),eL=He({"src/traces/treemap/defaults.js"(Y,G){var d=Gr(),x=D_(),A=Ai(),E=mu().defaults,e=Jh().handleText,t=Rp().TEXTPAD,r=Np().handleMarkerDefaults,o=Kl(),a=o.hasColorscale,i=o.handleDefaults;G.exports=function(s,c,f,v){function h(g,m){return d.coerce(s,c,x,g,m)}var T=h("labels"),l=h("parents");if(!T||!T.length||!l||!l.length){c.visible=!1;return}var y=h("values");y&&y.length?h("branchvalues"):h("count"),h("level"),h("maxdepth");var b=h("tiling.packing");b==="squarify"&&h("tiling.squarifyratio"),h("tiling.flip"),h("tiling.pad");var S=h("text");h("texttemplate"),c.texttemplate||h("textinfo",d.isArrayOrTypedArray(S)?"text+label":"label"),h("hovertext"),h("hovertemplate");var M=h("pathbar.visible"),_="auto";e(s,c,v,h,_,{hasPathbar:M,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("textposition");var w=c.textposition.indexOf("bottom")!==-1;r(s,c,v,h);var p=c._hasColorscale=a(s,"marker","colors")||(s.marker||{}).coloraxis;p?i(s,c,v,h,{prefix:"marker.",cLetter:"c"}):h("marker.depthfade",!(c.marker.colors||[]).length);var u=c.textfont.size*2;h("marker.pad.t",w?u/4:u),h("marker.pad.l",u/4),h("marker.pad.r",u/4),h("marker.pad.b",w?u:u/4),h("marker.cornerradius"),c._hovered={marker:{line:{width:2,color:A.contrast(v.paper_bgcolor)}}},M&&(h("pathbar.thickness",c.pathbar.textfont.size+2*t),h("pathbar.side"),h("pathbar.edgeshape")),h("sort"),h("root.color"),E(c,v,h),c._length=null}}}),tL=He({"src/traces/treemap/layout_defaults.js"(Y,G){var d=Gr(),x=y3();G.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("treemapcolorway",e.colorway),t("extendtreemapcolors")}}}),m3=He({"src/traces/treemap/calc.js"(Y){var G=wy();Y.calc=function(d,x){return G.calc(d,x)},Y.crossTraceCalc=function(d){return G._runCrossTraceCalc("treemap",d)}}}),_3=He({"src/traces/treemap/flip_tree.js"(Y,G){G.exports=function d(x,A,E){var e;E.swapXY&&(e=x.x0,x.x0=x.y0,x.y0=e,e=x.x1,x.x1=x.y1,x.y1=e),E.flipX&&(e=x.x0,x.x0=A[0]-x.x1,x.x1=A[0]-e),E.flipY&&(e=x.y0,x.y0=A[1]-x.y1,x.y1=A[1]-e);var t=x.children;if(t)for(var r=0;r0)for(var u=0;u").join(" ")||"";var le=x.ensureSingle(ue,"g","slicetext"),j=x.ensureSingle(le,"text","",function($){$.attr("data-notex",1)}),J=x.ensureUniformFontSize(s,o.determineTextFont(B,Q,z.font,{onPathbar:!0}));j.text(Q._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(A.font,J).call(E.convertToTspans,s),Q.textBB=A.bBox(j.node()),Q.transform=_(Q,{fontSize:J.size,onPathbar:!0}),Q.transform.fontSize=J.size,p?j.transition().attrTween("transform",function($){var X=m($,i,R,[l,y]);return function(re){return w(X(re))}}):j.attr("transform",w(Q))})}}}),aL=He({"src/traces/treemap/plot_one.js"(Y,G){var d=Qn(),x=(Gp(),Go(tp)).interpolate,A=ud(),E=Gr(),e=Rp().TEXTPAD,t=Dp(),r=t.toMoveInsideBar,o=hh(),a=o.recordMinTextSize,i=Wp(),n=rL();function s(c){return A.isHierarchyRoot(c)?"":A.getPtId(c)}G.exports=function(f,v,h,T,l){var y=f._fullLayout,b=v[0],S=b.trace,M=S.type,_=M==="icicle",w=b.hierarchy,p=A.findEntryWithLevel(w,S.level),u=d.select(h),g=u.selectAll("g.pathbar"),m=u.selectAll("g.slice");if(!p){g.remove(),m.remove();return}var R=A.isHierarchyRoot(p),P=!y.uniformtext.mode&&A.hasTransition(T),z=A.getMaxDepth(S),F=function(fr){return fr.data.depth-p.data.depth-1?N+Q:-(Z+Q):0,oe={x0:U,x1:U,y0:ue,y1:ue+Z},le=function(fr,dr,pt){var ze=S.tiling.pad,Ge=function(be){return be-ze<=dr.x0},Oe=function(be){return be+ze>=dr.x1},ve=function(be){return be-ze<=dr.y0},ge=function(be){return be+ze>=dr.y1};return fr.x0===dr.x0&&fr.x1===dr.x1&&fr.y0===dr.y0&&fr.y1===dr.y1?{x0:fr.x0,x1:fr.x1,y0:fr.y0,y1:fr.y1}:{x0:Ge(fr.x0-ze)?0:Oe(fr.x0-ze)?pt[0]:fr.x0,x1:Ge(fr.x1+ze)?0:Oe(fr.x1+ze)?pt[0]:fr.x1,y0:ve(fr.y0-ze)?0:ge(fr.y0-ze)?pt[1]:fr.y0,y1:ve(fr.y1+ze)?0:ge(fr.y1+ze)?pt[1]:fr.y1}},j=null,J={},$={},X=null,re=function(fr,dr){return dr?J[s(fr)]:$[s(fr)]},ee=function(fr,dr,pt,ze){if(dr)return J[s(w)]||oe;var Ge=$[S.level]||pt;return F(fr)?le(fr,Ge,ze):{}};b.hasMultipleRoots&&R&&z++,S._maxDepth=z,S._backgroundColor=y.paper_bgcolor,S._entryDepth=p.data.depth,S._atRootLevel=R;var q=-L/2+B.l+B.w*(O.x[1]+O.x[0])/2,ae=-N/2+B.t+B.h*(1-(O.y[1]+O.y[0])/2),ie=function(fr){return q+fr},fe=function(fr){return ae+fr},we=fe(0),Ae=ie(0),Fe=function(fr){return Ae+fr},Ce=function(fr){return we+fr};function qe(fr,dr){return fr+","+dr}var et=Fe(0),Qe=function(fr){fr.x=Math.max(et,fr.x)},Ke=S.pathbar.edgeshape,Xe=function(fr){var dr=Fe(Math.max(Math.min(fr.x0,fr.x0),0)),pt=Fe(Math.min(Math.max(fr.x1,fr.x1),U)),ze=Ce(fr.y0),Ge=Ce(fr.y1),Oe=Z/2,ve={},ge={};ve.x=dr,ge.x=pt,ve.y=ge.y=(ze+Ge)/2;var be={x:dr,y:ze},Pe={x:pt,y:ze},We={x:pt,y:Ge},ct={x:dr,y:Ge};return Ke===">"?(be.x-=Oe,Pe.x-=Oe,We.x-=Oe,ct.x-=Oe):Ke==="/"?(We.x-=Oe,ct.x-=Oe,ve.x-=Oe/2,ge.x-=Oe/2):Ke==="\\"?(be.x-=Oe,Pe.x-=Oe,ve.x-=Oe/2,ge.x-=Oe/2):Ke==="<"&&(ve.x-=Oe,ge.x-=Oe),Qe(be),Qe(ct),Qe(ve),Qe(Pe),Qe(We),Qe(ge),"M"+qe(be.x,be.y)+"L"+qe(Pe.x,Pe.y)+"L"+qe(ge.x,ge.y)+"L"+qe(We.x,We.y)+"L"+qe(ct.x,ct.y)+"L"+qe(ve.x,ve.y)+"Z"},Me=S[_?"tiling":"marker"].pad,xe=function(fr){return S.textposition.indexOf(fr)!==-1},ce=xe("top"),Re=xe("left"),$e=xe("right"),rt=xe("bottom"),Je=function(fr){var dr=ie(fr.x0),pt=ie(fr.x1),ze=fe(fr.y0),Ge=fe(fr.y1),Oe=pt-dr,ve=Ge-ze;if(!Oe||!ve)return"";var ge=S.marker.cornerradius||0,be=Math.min(ge,Oe/2,ve/2);be&&fr.data&&fr.data.data&&fr.data.data.label&&(ce&&(be=Math.min(be,Me.t)),Re&&(be=Math.min(be,Me.l)),$e&&(be=Math.min(be,Me.r)),rt&&(be=Math.min(be,Me.b)));var Pe=function(We,ct){return be?"a"+qe(be,be)+" 0 0 1 "+qe(We,ct):""};return"M"+qe(dr,ze+be)+Pe(be,-be)+"L"+qe(pt-be,ze)+Pe(be,be)+"L"+qe(pt,Ge-be)+Pe(-be,be)+"L"+qe(dr+be,Ge)+Pe(-be,-be)+"Z"},At=function(fr,dr){var pt=fr.x0,ze=fr.x1,Ge=fr.y0,Oe=fr.y1,ve=fr.textBB,ge=ce||dr.isHeader&&!rt,be=ge?"start":rt?"end":"middle",Pe=xe("right"),We=xe("left")||dr.onPathbar,ct=We?-1:Pe?1:0;if(dr.isHeader){if(pt+=(_?Me:Me.l)-e,ze-=(_?Me:Me.r)-e,pt>=ze){var _t=(pt+ze)/2;pt=_t,ze=_t}var Mt;rt?(Mt=Oe-(_?Me:Me.b),Ge-1,flipY:O.tiling.flip.indexOf("y")>-1,pad:{inner:O.tiling.pad,top:O.marker.pad.t,left:O.marker.pad.l,right:O.marker.pad.r,bottom:O.marker.pad.b}}),ue=Q.descendants(),oe=1/0,le=-1/0;ue.forEach(function(re){var ee=re.depth;ee>=O._maxDepth?(re.x0=re.x1=(re.x0+re.x1)/2,re.y0=re.y1=(re.y0+re.y1)/2):(oe=Math.min(oe,ee),le=Math.max(le,ee))}),h=h.data(ue,o.getPtId),O._maxVisibleLayers=isFinite(le)?le-oe+1:0,h.enter().append("g").classed("slice",!0),u(h,n,P,[l,y],M),h.order();var j=null;if(p&&R){var J=o.getPtId(R);h.each(function(re){j===null&&o.getPtId(re)===J&&(j={x0:re.x0,x1:re.x1,y0:re.y0,y1:re.y1})})}var $=function(){return j||{x0:0,x1:l,y0:0,y1:y}},X=h;return p&&(X=X.transition().each("end",function(){var re=d.select(this);o.setSliceCursor(re,c,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),X.each(function(re){var ee=o.isHeader(re,O);re._x0=b(re.x0),re._x1=b(re.x1),re._y0=S(re.y0),re._y1=S(re.y1),re._hoverX=b(re.x1-O.marker.pad.r),re._hoverY=S(U?re.y1-O.marker.pad.b/2:re.y0+O.marker.pad.t/2);var q=d.select(this),ae=x.ensureSingle(q,"path","surface",function(Ce){Ce.style("pointer-events",z?"none":"all")});p?ae.transition().attrTween("d",function(Ce){var qe=g(Ce,n,$(),[l,y]);return function(et){return M(qe(et))}}):ae.attr("d",M),q.call(a,v,c,f,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,c,{isTransitioning:c._transitioning}),ae.call(t,re,O,c,{hovered:!1}),re.x0===re.x1||re.y0===re.y1?re._text="":ee?re._text=Z?"":o.getPtLabel(re)||"":re._text=i(re,v,O,f,F)||"";var ie=x.ensureSingle(q,"g","slicetext"),fe=x.ensureSingle(ie,"text","",function(Ce){Ce.attr("data-notex",1)}),we=x.ensureUniformFontSize(c,o.determineTextFont(O,re,F.font)),Ae=re._text||" ",Fe=ee&&Ae.indexOf("
")===-1;fe.text(Ae).classed("slicetext",!0).attr("text-anchor",N?"end":L||Fe?"start":"middle").call(A.font,we).call(E.convertToTspans,c),re.textBB=A.bBox(fe.node()),re.transform=_(re,{fontSize:we.size,isHeader:ee}),re.transform.fontSize=we.size,p?fe.transition().attrTween("transform",function(Ce){var qe=m(Ce,n,$(),[l,y]);return function(et){return w(qe(et))}}):fe.attr("transform",w(re))}),j}}}),iL=He({"src/traces/treemap/plot.js"(Y,G){var d=b3(),x=nL();G.exports=function(E,e,t,r){return d(E,e,t,r,{type:"treemap",drawDescendants:x})}}}),oL=He({"src/traces/treemap/index.js"(Y,G){G.exports={moduleType:"trace",name:"treemap",basePlotModule:QC(),categories:[],animatable:!0,attributes:D_(),layoutAttributes:y3(),supplyDefaults:eL(),supplyLayoutDefaults:tL(),calc:m3().calc,crossTraceCalc:m3().crossTraceCalc,plot:iL(),style:z_().style,colorbar:ah(),meta:{}}}}),sL=He({"lib/treemap.js"(Y,G){G.exports=oL()}}),lL=He({"src/traces/icicle/base_plot.js"(Y){var G=yu();Y.name="icicle",Y.plot=function(d,x,A,E){G.plotBasePlot(Y.name,d,x,A,E)},Y.clean=function(d,x,A,E){G.cleanBasePlot(Y.name,d,x,A,E)}}}),w3=He({"src/traces/icicle/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=Yo().texttemplateAttrs,A=kl(),E=mu().attributes,e=Bp(),t=xy(),r=D_(),o=Wp(),a=ho().extendFlat,i=Nf().pattern;G.exports={labels:t.labels,parents:t.parents,values:t.values,branchvalues:t.branchvalues,count:t.count,level:t.level,maxdepth:t.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:r.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:a({colors:t.marker.colors,line:t.marker.line,pattern:i,editType:"calc"},A("marker",{colorAttr:"colors",anim:!1})),leaf:t.leaf,pathbar:r.pathbar,text:e.text,textinfo:t.textinfo,texttemplate:x({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),hovertext:e.hovertext,hoverinfo:t.hoverinfo,hovertemplate:d({},{keys:o.eventDataKeys}),textfont:e.textfont,insidetextfont:e.insidetextfont,outsidetextfont:r.outsidetextfont,textposition:r.textposition,sort:e.sort,root:t.root,domain:E({name:"icicle",trace:!0,editType:"calc"})}}}),T3=He({"src/traces/icicle/layout_attributes.js"(Y,G){G.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),uL=He({"src/traces/icicle/defaults.js"(Y,G){var d=Gr(),x=w3(),A=Ai(),E=mu().defaults,e=Jh().handleText,t=Rp().TEXTPAD,r=Np().handleMarkerDefaults,o=Kl(),a=o.hasColorscale,i=o.handleDefaults;G.exports=function(s,c,f,v){function h(w,p){return d.coerce(s,c,x,w,p)}var T=h("labels"),l=h("parents");if(!T||!T.length||!l||!l.length){c.visible=!1;return}var y=h("values");y&&y.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),h("tiling.orientation"),h("tiling.flip"),h("tiling.pad");var b=h("text");h("texttemplate"),c.texttemplate||h("textinfo",d.isArrayOrTypedArray(b)?"text+label":"label"),h("hovertext"),h("hovertemplate");var S=h("pathbar.visible"),M="auto";e(s,c,v,h,M,{hasPathbar:S,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("textposition"),r(s,c,v,h);var _=c._hasColorscale=a(s,"marker","colors")||(s.marker||{}).coloraxis;_&&i(s,c,v,h,{prefix:"marker.",cLetter:"c"}),h("leaf.opacity",_?1:.7),c._hovered={marker:{line:{width:2,color:A.contrast(v.paper_bgcolor)}}},S&&(h("pathbar.thickness",c.pathbar.textfont.size+2*t),h("pathbar.side"),h("pathbar.edgeshape")),h("sort"),h("root.color"),E(c,v,h),c._length=null}}}),cL=He({"src/traces/icicle/layout_defaults.js"(Y,G){var d=Gr(),x=T3();G.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("iciclecolorway",e.colorway),t("extendiciclecolors")}}}),A3=He({"src/traces/icicle/calc.js"(Y){var G=wy();Y.calc=function(d,x){return G.calc(d,x)},Y.crossTraceCalc=function(d){return G._runCrossTraceCalc("icicle",d)}}}),fL=He({"src/traces/icicle/partition.js"(Y,G){var d=by(),x=_3();G.exports=function(E,e,t){var r=t.flipX,o=t.flipY,a=t.orientation==="h",i=t.maxDepth,n=e[0],s=e[1];i&&(n=(E.height+1)*e[0]/Math.min(E.height+1,i),s=(E.height+1)*e[1]/Math.min(E.height+1,i));var c=d.partition().padding(t.pad.inner).size(a?[e[1],n]:[e[0],s])(E);return(a||r||o)&&x(c,e,{swapXY:a,flipX:r,flipY:o}),c}}}),S3=He({"src/traces/icicle/style.js"(Y,G){var d=Qn(),x=Ai(),A=Gr(),E=hh().resizeText,e=I_();function t(o){var a=o._fullLayout._iciclelayer.selectAll(".trace");E(o,a,"icicle"),a.each(function(i){var n=d.select(this),s=i[0],c=s.trace;n.style("opacity",c.opacity),n.selectAll("path.surface").each(function(f){d.select(this).call(r,f,c,o)})})}function r(o,a,i,n){var s=a.data.data,c=!a.children,f=s.i,v=A.castOption(i,f,"marker.line.color")||x.defaultLine,h=A.castOption(i,f,"marker.line.width")||0;o.call(e,a,i,n).style("stroke-width",h).call(x.stroke,v).style("opacity",c?i.leaf.opacity:null)}G.exports={style:t,styleOne:r}}}),hL=He({"src/traces/icicle/draw_descendants.js"(Y,G){var d=Qn(),x=Gr(),A=vo(),E=yl(),e=fL(),t=S3().styleOne,r=Wp(),o=ud(),a=By(),i=R_().formatSliceLabel,n=!1;G.exports=function(c,f,v,h,T){var l=T.width,y=T.height,b=T.viewX,S=T.viewY,M=T.pathSlice,_=T.toMoveInsideSlice,w=T.strTransform,p=T.hasTransition,u=T.handleSlicesExit,g=T.makeUpdateSliceInterpolator,m=T.makeUpdateTextInterpolator,R=T.prevEntry,P={},z=c._context.staticPlot,F=c._fullLayout,B=f[0],O=B.trace,L=O.textposition.indexOf("left")!==-1,N=O.textposition.indexOf("right")!==-1,U=O.textposition.indexOf("bottom")!==-1,Z=e(v,[l,y],{flipX:O.tiling.flip.indexOf("x")>-1,flipY:O.tiling.flip.indexOf("y")>-1,orientation:O.tiling.orientation,pad:{inner:O.tiling.pad},maxDepth:O._maxDepth}),Q=Z.descendants(),ue=1/0,oe=-1/0;Q.forEach(function(X){var re=X.depth;re>=O._maxDepth?(X.x0=X.x1=(X.x0+X.x1)/2,X.y0=X.y1=(X.y0+X.y1)/2):(ue=Math.min(ue,re),oe=Math.max(oe,re))}),h=h.data(Q,o.getPtId),O._maxVisibleLayers=isFinite(oe)?oe-ue+1:0,h.enter().append("g").classed("slice",!0),u(h,n,P,[l,y],M),h.order();var le=null;if(p&&R){var j=o.getPtId(R);h.each(function(X){le===null&&o.getPtId(X)===j&&(le={x0:X.x0,x1:X.x1,y0:X.y0,y1:X.y1})})}var J=function(){return le||{x0:0,x1:l,y0:0,y1:y}},$=h;return p&&($=$.transition().each("end",function(){var X=d.select(this);o.setSliceCursor(X,c,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),$.each(function(X){X._x0=b(X.x0),X._x1=b(X.x1),X._y0=S(X.y0),X._y1=S(X.y1),X._hoverX=b(X.x1-O.tiling.pad),X._hoverY=S(U?X.y1-O.tiling.pad/2:X.y0+O.tiling.pad/2);var re=d.select(this),ee=x.ensureSingle(re,"path","surface",function(fe){fe.style("pointer-events",z?"none":"all")});p?ee.transition().attrTween("d",function(fe){var we=g(fe,n,J(),[l,y],{orientation:O.tiling.orientation,flipX:O.tiling.flip.indexOf("x")>-1,flipY:O.tiling.flip.indexOf("y")>-1});return function(Ae){return M(we(Ae))}}):ee.attr("d",M),re.call(a,v,c,f,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,c,{isTransitioning:c._transitioning}),ee.call(t,X,O,c,{hovered:!1}),X.x0===X.x1||X.y0===X.y1?X._text="":X._text=i(X,v,O,f,F)||"";var q=x.ensureSingle(re,"g","slicetext"),ae=x.ensureSingle(q,"text","",function(fe){fe.attr("data-notex",1)}),ie=x.ensureUniformFontSize(c,o.determineTextFont(O,X,F.font));ae.text(X._text||" ").classed("slicetext",!0).attr("text-anchor",N?"end":L?"start":"middle").call(A.font,ie).call(E.convertToTspans,c),X.textBB=A.bBox(ae.node()),X.transform=_(X,{fontSize:ie.size}),X.transform.fontSize=ie.size,p?ae.transition().attrTween("transform",function(fe){var we=m(fe,n,J(),[l,y]);return function(Ae){return w(we(Ae))}}):ae.attr("transform",w(X))}),le}}}),vL=He({"src/traces/icicle/plot.js"(Y,G){var d=b3(),x=hL();G.exports=function(E,e,t,r){return d(E,e,t,r,{type:"icicle",drawDescendants:x})}}}),dL=He({"src/traces/icicle/index.js"(Y,G){G.exports={moduleType:"trace",name:"icicle",basePlotModule:lL(),categories:[],animatable:!0,attributes:w3(),layoutAttributes:T3(),supplyDefaults:uL(),supplyLayoutDefaults:cL(),calc:A3().calc,crossTraceCalc:A3().crossTraceCalc,plot:vL(),style:S3().style,colorbar:ah(),meta:{}}}}),pL=He({"lib/icicle.js"(Y,G){G.exports=dL()}}),gL=He({"src/traces/funnelarea/base_plot.js"(Y){var G=yu();Y.name="funnelarea",Y.plot=function(d,x,A,E){G.plotBasePlot(Y.name,d,x,A,E)},Y.clean=function(d,x,A,E){G.cleanBasePlot(Y.name,d,x,A,E)}}}),M3=He({"src/traces/funnelarea/attributes.js"(Y,G){var d=Bp(),x=cl(),A=mu().attributes,E=Yo().hovertemplateAttrs,e=Yo().texttemplateAttrs,t=ho().extendFlat;G.exports={labels:d.labels,label0:d.label0,dlabel:d.dlabel,values:d.values,marker:{colors:d.marker.colors,line:{color:t({},d.marker.line.color,{dflt:null}),width:t({},d.marker.line.width,{dflt:1}),editType:"calc"},pattern:d.marker.pattern,editType:"calc"},text:d.text,hovertext:d.hovertext,scalegroup:t({},d.scalegroup,{}),textinfo:t({},d.textinfo,{flags:["label","text","value","percent"]}),texttemplate:e({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:t({},x.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:E({},{keys:["label","color","value","text","percent"]}),textposition:t({},d.textposition,{values:["inside","none"],dflt:"inside"}),textfont:d.textfont,insidetextfont:d.insidetextfont,title:{text:d.title.text,font:d.title.font,position:t({},d.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:A({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),E3=He({"src/traces/funnelarea/layout_attributes.js"(Y,G){var d=r_().hiddenlabels;G.exports={hiddenlabels:d,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),yL=He({"src/traces/funnelarea/defaults.js"(Y,G){var d=Gr(),x=M3(),A=mu().defaults,E=Jh().handleText,e=Np().handleLabelsAndValues,t=Np().handleMarkerDefaults;G.exports=function(o,a,i,n){function s(M,_){return d.coerce(o,a,x,M,_)}var c=s("labels"),f=s("values"),v=e(c,f),h=v.len;if(a._hasLabels=v.hasLabels,a._hasValues=v.hasValues,!a._hasLabels&&a._hasValues&&(s("label0"),s("dlabel")),!h){a.visible=!1;return}a._length=h,t(o,a,n,s),s("scalegroup");var T=s("text"),l=s("texttemplate"),y;if(l||(y=s("textinfo",Array.isArray(T)?"text+percent":"percent")),s("hovertext"),s("hovertemplate"),l||y&&y!=="none"){var b=s("textposition");E(o,a,n,s,b,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else y==="none"&&s("textposition","none");A(a,n,s);var S=s("title.text");S&&(s("title.position"),d.coerceFont(s,"title.font",n.font)),s("aspectratio"),s("baseratio")}}}),mL=He({"src/traces/funnelarea/layout_defaults.js"(Y,G){var d=Gr(),x=E3();G.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("hiddenlabels"),t("funnelareacolorway",e.colorway),t("extendfunnelareacolors")}}}),k3=He({"src/traces/funnelarea/calc.js"(Y,G){var d=tg();function x(E,e){return d.calc(E,e)}function A(E){d.crossTraceCalc(E,{type:"funnelarea"})}G.exports={calc:x,crossTraceCalc:A}}}),_L=He({"src/traces/funnelarea/plot.js"(Y,G){var d=Qn(),x=vo(),A=Gr(),E=A.strScale,e=A.strTranslate,t=yl(),r=Dp(),o=r.toMoveInsideBar,a=hh(),i=a.recordMinTextSize,n=a.clearMinTextSize,s=Hd(),c=a_(),f=c.attachFxHandlers,v=c.determineInsideTextFont,h=c.layoutAreas,T=c.prerenderTitles,l=c.positionTitleOutside,y=c.formatSliceLabel;G.exports=function(w,p){var u=w._context.staticPlot,g=w._fullLayout;n("funnelarea",g),T(p,w),h(p,g._size),A.makeTraceGroups(g._funnelarealayer,p,"trace").each(function(m){var R=d.select(this),P=m[0],z=P.trace;M(m),R.each(function(){var F=d.select(this).selectAll("g.slice").data(m);F.enter().append("g").classed("slice",!0),F.exit().remove(),F.each(function(O,L){if(O.hidden){d.select(this).selectAll("path,g").remove();return}O.pointNumber=O.i,O.curveNumber=z.index;var N=P.cx,U=P.cy,Z=d.select(this),Q=Z.selectAll("path.surface").data([O]);Q.enter().append("path").classed("surface",!0).style({"pointer-events":u?"none":"all"}),Z.call(f,w,m);var ue="M"+(N+O.TR[0])+","+(U+O.TR[1])+b(O.TR,O.BR)+b(O.BR,O.BL)+b(O.BL,O.TL)+"Z";Q.attr("d",ue),y(w,O,P);var oe=s.castOption(z.textposition,O.pts),le=Z.selectAll("g.slicetext").data(O.text&&oe!=="none"?[0]:[]);le.enter().append("g").classed("slicetext",!0),le.exit().remove(),le.each(function(){var j=A.ensureSingle(d.select(this),"text","",function(ie){ie.attr("data-notex",1)}),J=A.ensureUniformFontSize(w,v(z,O,g.font));j.text(O.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(x.font,J).call(t.convertToTspans,w);var $=x.bBox(j.node()),X,re,ee,q=Math.min(O.BL[1],O.BR[1])+U,ae=Math.max(O.TL[1],O.TR[1])+U;re=Math.max(O.TL[0],O.BL[0])+N,ee=Math.min(O.TR[0],O.BR[0])+N,X=o(re,ee,q,ae,$,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),X.fontSize=J.size,i(z.type,X,g),m[L].transform=X,A.setTransormAndDisplay(j,X)})});var B=d.select(this).selectAll("g.titletext").data(z.title.text?[0]:[]);B.enter().append("g").classed("titletext",!0),B.exit().remove(),B.each(function(){var O=A.ensureSingle(d.select(this),"text","",function(U){U.attr("data-notex",1)}),L=z.title.text;z._meta&&(L=A.templateString(L,z._meta)),O.text(L).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(x.font,z.title.font).call(t.convertToTspans,w);var N=l(P,g._size);O.attr("transform",e(N.x,N.y)+E(Math.min(1,N.scale))+e(N.tx,N.ty))})})})};function b(_,w){var p=w[0]-_[0],u=w[1]-_[1];return"l"+p+","+u}function S(_,w){return[.5*(_[0]+w[0]),.5*(_[1]+w[1])]}function M(_){if(!_.length)return;var w=_[0],p=w.trace,u=p.aspectratio,g=p.baseratio;g>.999&&(g=.999);var m=Math.pow(g,2),R=w.vTotal,P=R*m/(1-m),z=R,F=P/R;function B(){var fe=Math.sqrt(F);return{x:fe,y:-fe}}function O(){var fe=B();return[fe.x,fe.y]}var L,N=[];N.push(O());var U,Z;for(U=_.length-1;U>-1;U--)if(Z=_[U],!Z.hidden){var Q=Z.v/z;F+=Q,N.push(O())}var ue=1/0,oe=-1/0;for(U=0;U-1;U--)if(Z=_[U],!Z.hidden){q+=1;var ae=N[q][0],ie=N[q][1];Z.TL=[-ae,ie],Z.TR=[ae,ie],Z.BL=re,Z.BR=ee,Z.pxmid=S(Z.TR,Z.BR),re=Z.TL,ee=Z.TR}}}}),xL=He({"src/traces/funnelarea/style.js"(Y,G){var d=Qn(),x=U0(),A=hh().resizeText;G.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");A(e,t,"funnelarea"),t.each(function(r){var o=r[0],a=o.trace,i=d.select(this);i.style({opacity:a.opacity}),i.selectAll("path.surface").each(function(n){d.select(this).call(x,n,a,e)})})}}}),bL=He({"src/traces/funnelarea/index.js"(Y,G){G.exports={moduleType:"trace",name:"funnelarea",basePlotModule:gL(),categories:["pie-like","funnelarea","showLegend"],attributes:M3(),layoutAttributes:E3(),supplyDefaults:yL(),supplyLayoutDefaults:mL(),calc:k3().calc,crossTraceCalc:k3().crossTraceCalc,plot:_L(),style:xL(),styleOne:U0(),meta:{}}}}),wL=He({"lib/funnelarea.js"(Y,G){G.exports=bL()}}),Hf=He({"stackgl_modules/index.js"(Y,G){(function(){var d={1964:function(e,t,r){e.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot3d:r(4100),gl_scatter3d:r(8418),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}},4793:function(e,t,r){function o(ve,ge){if(!(ve instanceof ge))throw new TypeError("Cannot call a class as a function")}function a(ve,ge){for(var be=0;bew)throw new RangeError('The value "'+ve+'" is invalid for option "size"');var ge=new Uint8Array(ve);return Object.setPrototypeOf(ge,g.prototype),ge}function g(ve,ge,be){if(typeof ve=="number"){if(typeof ge=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return z(ve)}return m(ve,ge,be)}g.poolSize=8192;function m(ve,ge,be){if(typeof ve=="string")return F(ve,ge);if(ArrayBuffer.isView(ve))return O(ve);if(ve==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+b(ve));if(dr(ve,ArrayBuffer)||ve&&dr(ve.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(dr(ve,SharedArrayBuffer)||ve&&dr(ve.buffer,SharedArrayBuffer)))return L(ve,ge,be);if(typeof ve=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var Pe=ve.valueOf&&ve.valueOf();if(Pe!=null&&Pe!==ve)return g.from(Pe,ge,be);var We=N(ve);if(We)return We;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ve[Symbol.toPrimitive]=="function")return g.from(ve[Symbol.toPrimitive]("string"),ge,be);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+b(ve))}g.from=function(ve,ge,be){return m(ve,ge,be)},Object.setPrototypeOf(g.prototype,Uint8Array.prototype),Object.setPrototypeOf(g,Uint8Array);function R(ve){if(typeof ve!="number")throw new TypeError('"size" argument must be of type number');if(ve<0)throw new RangeError('The value "'+ve+'" is invalid for option "size"')}function P(ve,ge,be){return R(ve),ve<=0?u(ve):ge!==void 0?typeof be=="string"?u(ve).fill(ge,be):u(ve).fill(ge):u(ve)}g.alloc=function(ve,ge,be){return P(ve,ge,be)};function z(ve){return R(ve),u(ve<0?0:U(ve)|0)}g.allocUnsafe=function(ve){return z(ve)},g.allocUnsafeSlow=function(ve){return z(ve)};function F(ve,ge){if((typeof ge!="string"||ge==="")&&(ge="utf8"),!g.isEncoding(ge))throw new TypeError("Unknown encoding: "+ge);var be=Z(ve,ge)|0,Pe=u(be),We=Pe.write(ve,ge);return We!==be&&(Pe=Pe.slice(0,We)),Pe}function B(ve){for(var ge=ve.length<0?0:U(ve.length)|0,be=u(ge),Pe=0;Pe=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return ve|0}g.isBuffer=function(ge){return ge!=null&&ge._isBuffer===!0&&ge!==g.prototype},g.compare=function(ge,be){if(dr(ge,Uint8Array)&&(ge=g.from(ge,ge.offset,ge.byteLength)),dr(be,Uint8Array)&&(be=g.from(be,be.offset,be.byteLength)),!g.isBuffer(ge)||!g.isBuffer(be))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ge===be)return 0;for(var Pe=ge.length,We=be.length,ct=0,_t=Math.min(Pe,We);ct<_t;++ct)if(ge[ct]!==be[ct]){Pe=ge[ct],We=be[ct];break}return PeWe.length?(g.isBuffer(_t)||(_t=g.from(_t)),_t.copy(We,ct)):Uint8Array.prototype.set.call(We,_t,ct);else if(g.isBuffer(_t))_t.copy(We,ct);else throw new TypeError('"list" argument must be an Array of Buffers');ct+=_t.length}return We};function Z(ve,ge){if(g.isBuffer(ve))return ve.length;if(ArrayBuffer.isView(ve)||dr(ve,ArrayBuffer))return ve.byteLength;if(typeof ve!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+b(ve));var be=ve.length,Pe=arguments.length>2&&arguments[2]===!0;if(!Pe&&be===0)return 0;for(var We=!1;;)switch(ge){case"ascii":case"latin1":case"binary":return be;case"utf8":case"utf-8":return Ut(ve).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return be*2;case"hex":return be>>>1;case"base64":return Mr(ve).length;default:if(We)return Pe?-1:Ut(ve).length;ge=(""+ge).toLowerCase(),We=!0}}g.byteLength=Z;function Q(ve,ge,be){var Pe=!1;if((ge===void 0||ge<0)&&(ge=0),ge>this.length||((be===void 0||be>this.length)&&(be=this.length),be<=0)||(be>>>=0,ge>>>=0,be<=ge))return"";for(ve||(ve="utf8");;)switch(ve){case"hex":return Ae(this,ge,be);case"utf8":case"utf-8":return q(this,ge,be);case"ascii":return fe(this,ge,be);case"latin1":case"binary":return we(this,ge,be);case"base64":return ee(this,ge,be);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fe(this,ge,be);default:if(Pe)throw new TypeError("Unknown encoding: "+ve);ve=(ve+"").toLowerCase(),Pe=!0}}g.prototype._isBuffer=!0;function ue(ve,ge,be){var Pe=ve[ge];ve[ge]=ve[be],ve[be]=Pe}g.prototype.swap16=function(){var ge=this.length;if(ge%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var be=0;bebe&&(ge+=" ... "),""},_&&(g.prototype[_]=g.prototype.inspect),g.prototype.compare=function(ge,be,Pe,We,ct){if(dr(ge,Uint8Array)&&(ge=g.from(ge,ge.offset,ge.byteLength)),!g.isBuffer(ge))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+b(ge));if(be===void 0&&(be=0),Pe===void 0&&(Pe=ge?ge.length:0),We===void 0&&(We=0),ct===void 0&&(ct=this.length),be<0||Pe>ge.length||We<0||ct>this.length)throw new RangeError("out of range index");if(We>=ct&&be>=Pe)return 0;if(We>=ct)return-1;if(be>=Pe)return 1;if(be>>>=0,Pe>>>=0,We>>>=0,ct>>>=0,this===ge)return 0;for(var _t=ct-We,Mt=Pe-be,Nt=Math.min(_t,Mt),Bt=this.slice(We,ct),qt=ge.slice(be,Pe),Zt=0;Zt2147483647?be=2147483647:be<-2147483648&&(be=-2147483648),be=+be,pt(be)&&(be=We?0:ve.length-1),be<0&&(be=ve.length+be),be>=ve.length){if(We)return-1;be=ve.length-1}else if(be<0)if(We)be=0;else return-1;if(typeof ge=="string"&&(ge=g.from(ge,Pe)),g.isBuffer(ge))return ge.length===0?-1:le(ve,ge,be,Pe,We);if(typeof ge=="number")return ge=ge&255,typeof Uint8Array.prototype.indexOf=="function"?We?Uint8Array.prototype.indexOf.call(ve,ge,be):Uint8Array.prototype.lastIndexOf.call(ve,ge,be):le(ve,[ge],be,Pe,We);throw new TypeError("val must be string, number or Buffer")}function le(ve,ge,be,Pe,We){var ct=1,_t=ve.length,Mt=ge.length;if(Pe!==void 0&&(Pe=String(Pe).toLowerCase(),Pe==="ucs2"||Pe==="ucs-2"||Pe==="utf16le"||Pe==="utf-16le")){if(ve.length<2||ge.length<2)return-1;ct=2,_t/=2,Mt/=2,be/=2}function Nt(ta,da){return ct===1?ta[da]:ta.readUInt16BE(da*ct)}var Bt;if(We){var qt=-1;for(Bt=be;Bt<_t;Bt++)if(Nt(ve,Bt)===Nt(ge,qt===-1?0:Bt-qt)){if(qt===-1&&(qt=Bt),Bt-qt+1===Mt)return qt*ct}else qt!==-1&&(Bt-=Bt-qt),qt=-1}else for(be+Mt>_t&&(be=_t-Mt),Bt=be;Bt>=0;Bt--){for(var Zt=!0,lr=0;lrWe&&(Pe=We)):Pe=We;var ct=ge.length;Pe>ct/2&&(Pe=ct/2);var _t;for(_t=0;_t>>0,isFinite(Pe)?(Pe=Pe>>>0,We===void 0&&(We="utf8")):(We=Pe,Pe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ct=this.length-be;if((Pe===void 0||Pe>ct)&&(Pe=ct),ge.length>0&&(Pe<0||be<0)||be>this.length)throw new RangeError("Attempt to write outside buffer bounds");We||(We="utf8");for(var _t=!1;;)switch(We){case"hex":return j(this,ge,be,Pe);case"utf8":case"utf-8":return J(this,ge,be,Pe);case"ascii":case"latin1":case"binary":return $(this,ge,be,Pe);case"base64":return X(this,ge,be,Pe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,ge,be,Pe);default:if(_t)throw new TypeError("Unknown encoding: "+We);We=(""+We).toLowerCase(),_t=!0}},g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ee(ve,ge,be){return ge===0&&be===ve.length?S.fromByteArray(ve):S.fromByteArray(ve.slice(ge,be))}function q(ve,ge,be){be=Math.min(ve.length,be);for(var Pe=[],We=ge;We239?4:ct>223?3:ct>191?2:1;if(We+Mt<=be){var Nt=void 0,Bt=void 0,qt=void 0,Zt=void 0;switch(Mt){case 1:ct<128&&(_t=ct);break;case 2:Nt=ve[We+1],(Nt&192)===128&&(Zt=(ct&31)<<6|Nt&63,Zt>127&&(_t=Zt));break;case 3:Nt=ve[We+1],Bt=ve[We+2],(Nt&192)===128&&(Bt&192)===128&&(Zt=(ct&15)<<12|(Nt&63)<<6|Bt&63,Zt>2047&&(Zt<55296||Zt>57343)&&(_t=Zt));break;case 4:Nt=ve[We+1],Bt=ve[We+2],qt=ve[We+3],(Nt&192)===128&&(Bt&192)===128&&(qt&192)===128&&(Zt=(ct&15)<<18|(Nt&63)<<12|(Bt&63)<<6|qt&63,Zt>65535&&Zt<1114112&&(_t=Zt))}}_t===null?(_t=65533,Mt=1):_t>65535&&(_t-=65536,Pe.push(_t>>>10&1023|55296),_t=56320|_t&1023),Pe.push(_t),We+=Mt}return ie(Pe)}var ae=4096;function ie(ve){var ge=ve.length;if(ge<=ae)return String.fromCharCode.apply(String,ve);for(var be="",Pe=0;PePe)&&(be=Pe);for(var We="",ct=ge;ctPe&&(ge=Pe),be<0?(be+=Pe,be<0&&(be=0)):be>Pe&&(be=Pe),bebe)throw new RangeError("Trying to access beyond buffer length")}g.prototype.readUintLE=g.prototype.readUIntLE=function(ge,be,Pe){ge=ge>>>0,be=be>>>0,Pe||Ce(ge,be,this.length);for(var We=this[ge],ct=1,_t=0;++_t>>0,be=be>>>0,Pe||Ce(ge,be,this.length);for(var We=this[ge+--be],ct=1;be>0&&(ct*=256);)We+=this[ge+--be]*ct;return We},g.prototype.readUint8=g.prototype.readUInt8=function(ge,be){return ge=ge>>>0,be||Ce(ge,1,this.length),this[ge]},g.prototype.readUint16LE=g.prototype.readUInt16LE=function(ge,be){return ge=ge>>>0,be||Ce(ge,2,this.length),this[ge]|this[ge+1]<<8},g.prototype.readUint16BE=g.prototype.readUInt16BE=function(ge,be){return ge=ge>>>0,be||Ce(ge,2,this.length),this[ge]<<8|this[ge+1]},g.prototype.readUint32LE=g.prototype.readUInt32LE=function(ge,be){return ge=ge>>>0,be||Ce(ge,4,this.length),(this[ge]|this[ge+1]<<8|this[ge+2]<<16)+this[ge+3]*16777216},g.prototype.readUint32BE=g.prototype.readUInt32BE=function(ge,be){return ge=ge>>>0,be||Ce(ge,4,this.length),this[ge]*16777216+(this[ge+1]<<16|this[ge+2]<<8|this[ge+3])},g.prototype.readBigUInt64LE=Ge(function(ge){ge=ge>>>0,Je(ge,"offset");var be=this[ge],Pe=this[ge+7];(be===void 0||Pe===void 0)&&At(ge,this.length-8);var We=be+this[++ge]*Math.pow(2,8)+this[++ge]*Math.pow(2,16)+this[++ge]*Math.pow(2,24),ct=this[++ge]+this[++ge]*Math.pow(2,8)+this[++ge]*Math.pow(2,16)+Pe*Math.pow(2,24);return BigInt(We)+(BigInt(ct)<>>0,Je(ge,"offset");var be=this[ge],Pe=this[ge+7];(be===void 0||Pe===void 0)&&At(ge,this.length-8);var We=be*Math.pow(2,24)+this[++ge]*Math.pow(2,16)+this[++ge]*Math.pow(2,8)+this[++ge],ct=this[++ge]*Math.pow(2,24)+this[++ge]*Math.pow(2,16)+this[++ge]*Math.pow(2,8)+Pe;return(BigInt(We)<>>0,be=be>>>0,Pe||Ce(ge,be,this.length);for(var We=this[ge],ct=1,_t=0;++_t=ct&&(We-=Math.pow(2,8*be)),We},g.prototype.readIntBE=function(ge,be,Pe){ge=ge>>>0,be=be>>>0,Pe||Ce(ge,be,this.length);for(var We=be,ct=1,_t=this[ge+--We];We>0&&(ct*=256);)_t+=this[ge+--We]*ct;return ct*=128,_t>=ct&&(_t-=Math.pow(2,8*be)),_t},g.prototype.readInt8=function(ge,be){return ge=ge>>>0,be||Ce(ge,1,this.length),this[ge]&128?(255-this[ge]+1)*-1:this[ge]},g.prototype.readInt16LE=function(ge,be){ge=ge>>>0,be||Ce(ge,2,this.length);var Pe=this[ge]|this[ge+1]<<8;return Pe&32768?Pe|4294901760:Pe},g.prototype.readInt16BE=function(ge,be){ge=ge>>>0,be||Ce(ge,2,this.length);var Pe=this[ge+1]|this[ge]<<8;return Pe&32768?Pe|4294901760:Pe},g.prototype.readInt32LE=function(ge,be){return ge=ge>>>0,be||Ce(ge,4,this.length),this[ge]|this[ge+1]<<8|this[ge+2]<<16|this[ge+3]<<24},g.prototype.readInt32BE=function(ge,be){return ge=ge>>>0,be||Ce(ge,4,this.length),this[ge]<<24|this[ge+1]<<16|this[ge+2]<<8|this[ge+3]},g.prototype.readBigInt64LE=Ge(function(ge){ge=ge>>>0,Je(ge,"offset");var be=this[ge],Pe=this[ge+7];(be===void 0||Pe===void 0)&&At(ge,this.length-8);var We=this[ge+4]+this[ge+5]*Math.pow(2,8)+this[ge+6]*Math.pow(2,16)+(Pe<<24);return(BigInt(We)<>>0,Je(ge,"offset");var be=this[ge],Pe=this[ge+7];(be===void 0||Pe===void 0)&&At(ge,this.length-8);var We=(be<<24)+this[++ge]*Math.pow(2,16)+this[++ge]*Math.pow(2,8)+this[++ge];return(BigInt(We)<>>0,be||Ce(ge,4,this.length),M.read(this,ge,!0,23,4)},g.prototype.readFloatBE=function(ge,be){return ge=ge>>>0,be||Ce(ge,4,this.length),M.read(this,ge,!1,23,4)},g.prototype.readDoubleLE=function(ge,be){return ge=ge>>>0,be||Ce(ge,8,this.length),M.read(this,ge,!0,52,8)},g.prototype.readDoubleBE=function(ge,be){return ge=ge>>>0,be||Ce(ge,8,this.length),M.read(this,ge,!1,52,8)};function qe(ve,ge,be,Pe,We,ct){if(!g.isBuffer(ve))throw new TypeError('"buffer" argument must be a Buffer instance');if(ge>We||geve.length)throw new RangeError("Index out of range")}g.prototype.writeUintLE=g.prototype.writeUIntLE=function(ge,be,Pe,We){if(ge=+ge,be=be>>>0,Pe=Pe>>>0,!We){var ct=Math.pow(2,8*Pe)-1;qe(this,ge,be,Pe,ct,0)}var _t=1,Mt=0;for(this[be]=ge&255;++Mt>>0,Pe=Pe>>>0,!We){var ct=Math.pow(2,8*Pe)-1;qe(this,ge,be,Pe,ct,0)}var _t=Pe-1,Mt=1;for(this[be+_t]=ge&255;--_t>=0&&(Mt*=256);)this[be+_t]=ge/Mt&255;return be+Pe},g.prototype.writeUint8=g.prototype.writeUInt8=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,1,255,0),this[be]=ge&255,be+1},g.prototype.writeUint16LE=g.prototype.writeUInt16LE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,2,65535,0),this[be]=ge&255,this[be+1]=ge>>>8,be+2},g.prototype.writeUint16BE=g.prototype.writeUInt16BE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,2,65535,0),this[be]=ge>>>8,this[be+1]=ge&255,be+2},g.prototype.writeUint32LE=g.prototype.writeUInt32LE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,4,4294967295,0),this[be+3]=ge>>>24,this[be+2]=ge>>>16,this[be+1]=ge>>>8,this[be]=ge&255,be+4},g.prototype.writeUint32BE=g.prototype.writeUInt32BE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,4,4294967295,0),this[be]=ge>>>24,this[be+1]=ge>>>16,this[be+2]=ge>>>8,this[be+3]=ge&255,be+4};function et(ve,ge,be,Pe,We){rt(ge,Pe,We,ve,be,7);var ct=Number(ge&BigInt(4294967295));ve[be++]=ct,ct=ct>>8,ve[be++]=ct,ct=ct>>8,ve[be++]=ct,ct=ct>>8,ve[be++]=ct;var _t=Number(ge>>BigInt(32)&BigInt(4294967295));return ve[be++]=_t,_t=_t>>8,ve[be++]=_t,_t=_t>>8,ve[be++]=_t,_t=_t>>8,ve[be++]=_t,be}function Qe(ve,ge,be,Pe,We){rt(ge,Pe,We,ve,be,7);var ct=Number(ge&BigInt(4294967295));ve[be+7]=ct,ct=ct>>8,ve[be+6]=ct,ct=ct>>8,ve[be+5]=ct,ct=ct>>8,ve[be+4]=ct;var _t=Number(ge>>BigInt(32)&BigInt(4294967295));return ve[be+3]=_t,_t=_t>>8,ve[be+2]=_t,_t=_t>>8,ve[be+1]=_t,_t=_t>>8,ve[be]=_t,be+8}g.prototype.writeBigUInt64LE=Ge(function(ge){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return et(this,ge,be,BigInt(0),BigInt("0xffffffffffffffff"))}),g.prototype.writeBigUInt64BE=Ge(function(ge){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Qe(this,ge,be,BigInt(0),BigInt("0xffffffffffffffff"))}),g.prototype.writeIntLE=function(ge,be,Pe,We){if(ge=+ge,be=be>>>0,!We){var ct=Math.pow(2,8*Pe-1);qe(this,ge,be,Pe,ct-1,-ct)}var _t=0,Mt=1,Nt=0;for(this[be]=ge&255;++_t>0)-Nt&255;return be+Pe},g.prototype.writeIntBE=function(ge,be,Pe,We){if(ge=+ge,be=be>>>0,!We){var ct=Math.pow(2,8*Pe-1);qe(this,ge,be,Pe,ct-1,-ct)}var _t=Pe-1,Mt=1,Nt=0;for(this[be+_t]=ge&255;--_t>=0&&(Mt*=256);)ge<0&&Nt===0&&this[be+_t+1]!==0&&(Nt=1),this[be+_t]=(ge/Mt>>0)-Nt&255;return be+Pe},g.prototype.writeInt8=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,1,127,-128),ge<0&&(ge=255+ge+1),this[be]=ge&255,be+1},g.prototype.writeInt16LE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,2,32767,-32768),this[be]=ge&255,this[be+1]=ge>>>8,be+2},g.prototype.writeInt16BE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,2,32767,-32768),this[be]=ge>>>8,this[be+1]=ge&255,be+2},g.prototype.writeInt32LE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,4,2147483647,-2147483648),this[be]=ge&255,this[be+1]=ge>>>8,this[be+2]=ge>>>16,this[be+3]=ge>>>24,be+4},g.prototype.writeInt32BE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,4,2147483647,-2147483648),ge<0&&(ge=4294967295+ge+1),this[be]=ge>>>24,this[be+1]=ge>>>16,this[be+2]=ge>>>8,this[be+3]=ge&255,be+4},g.prototype.writeBigInt64LE=Ge(function(ge){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return et(this,ge,be,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),g.prototype.writeBigInt64BE=Ge(function(ge){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Qe(this,ge,be,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ke(ve,ge,be,Pe,We,ct){if(be+Pe>ve.length)throw new RangeError("Index out of range");if(be<0)throw new RangeError("Index out of range")}function Xe(ve,ge,be,Pe,We){return ge=+ge,be=be>>>0,We||Ke(ve,ge,be,4),M.write(ve,ge,be,Pe,23,4),be+4}g.prototype.writeFloatLE=function(ge,be,Pe){return Xe(this,ge,be,!0,Pe)},g.prototype.writeFloatBE=function(ge,be,Pe){return Xe(this,ge,be,!1,Pe)};function Me(ve,ge,be,Pe,We){return ge=+ge,be=be>>>0,We||Ke(ve,ge,be,8),M.write(ve,ge,be,Pe,52,8),be+8}g.prototype.writeDoubleLE=function(ge,be,Pe){return Me(this,ge,be,!0,Pe)},g.prototype.writeDoubleBE=function(ge,be,Pe){return Me(this,ge,be,!1,Pe)},g.prototype.copy=function(ge,be,Pe,We){if(!g.isBuffer(ge))throw new TypeError("argument should be a Buffer");if(Pe||(Pe=0),!We&&We!==0&&(We=this.length),be>=ge.length&&(be=ge.length),be||(be=0),We>0&&We=this.length)throw new RangeError("Index out of range");if(We<0)throw new RangeError("sourceEnd out of bounds");We>this.length&&(We=this.length),ge.length-be>>0,Pe=Pe===void 0?this.length:Pe>>>0,ge||(ge=0);var _t;if(typeof ge=="number")for(_t=be;_tMath.pow(2,32)?We=Re(String(be)):typeof be=="bigint"&&(We=String(be),(be>Math.pow(BigInt(2),BigInt(32))||be<-Math.pow(BigInt(2),BigInt(32)))&&(We=Re(We)),We+="n"),Pe+=" It must be ".concat(ge,". Received ").concat(We),Pe},RangeError);function Re(ve){for(var ge="",be=ve.length,Pe=ve[0]==="-"?1:0;be>=Pe+4;be-=3)ge="_".concat(ve.slice(be-3,be)).concat(ge);return"".concat(ve.slice(0,be)).concat(ge)}function $e(ve,ge,be){Je(ge,"offset"),(ve[ge]===void 0||ve[ge+be]===void 0)&&At(ge,ve.length-(be+1))}function rt(ve,ge,be,Pe,We,ct){if(ve>be||ve= 0".concat(_t," and < 2").concat(_t," ** ").concat((ct+1)*8).concat(_t):Mt=">= -(2".concat(_t," ** ").concat((ct+1)*8-1).concat(_t,") and < 2 ** ")+"".concat((ct+1)*8-1).concat(_t),new xe.ERR_OUT_OF_RANGE("value",Mt,ve)}$e(Pe,We,ct)}function Je(ve,ge){if(typeof ve!="number")throw new xe.ERR_INVALID_ARG_TYPE(ge,"number",ve)}function At(ve,ge,be){throw Math.floor(ve)!==ve?(Je(ve,be),new xe.ERR_OUT_OF_RANGE("offset","an integer",ve)):ge<0?new xe.ERR_BUFFER_OUT_OF_BOUNDS:new xe.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(ge),ve)}var St=/[^+/0-9A-Za-z-_]/g;function Rt(ve){if(ve=ve.split("=")[0],ve=ve.trim().replace(St,""),ve.length<2)return"";for(;ve.length%4!==0;)ve=ve+"=";return ve}function Ut(ve,ge){ge=ge||1/0;for(var be,Pe=ve.length,We=null,ct=[],_t=0;_t55295&&be<57344){if(!We){if(be>56319){(ge-=3)>-1&&ct.push(239,191,189);continue}else if(_t+1===Pe){(ge-=3)>-1&&ct.push(239,191,189);continue}We=be;continue}if(be<56320){(ge-=3)>-1&&ct.push(239,191,189),We=be;continue}be=(We-55296<<10|be-56320)+65536}else We&&(ge-=3)>-1&&ct.push(239,191,189);if(We=null,be<128){if((ge-=1)<0)break;ct.push(be)}else if(be<2048){if((ge-=2)<0)break;ct.push(be>>6|192,be&63|128)}else if(be<65536){if((ge-=3)<0)break;ct.push(be>>12|224,be>>6&63|128,be&63|128)}else if(be<1114112){if((ge-=4)<0)break;ct.push(be>>18|240,be>>12&63|128,be>>6&63|128,be&63|128)}else throw new Error("Invalid code point")}return ct}function ir(ve){for(var ge=[],be=0;be>8,We=be%256,ct.push(We),ct.push(Pe);return ct}function Mr(ve){return S.toByteArray(Rt(ve))}function fr(ve,ge,be,Pe){var We;for(We=0;We=ge.length||We>=ve.length);++We)ge[We+be]=ve[We];return We}function dr(ve,ge){return ve instanceof ge||ve!=null&&ve.constructor!=null&&ve.constructor.name!=null&&ve.constructor.name===ge.name}function pt(ve){return ve!==ve}var ze=function(){for(var ve="0123456789abcdef",ge=new Array(256),be=0;be<16;++be)for(var Pe=be*16,We=0;We<16;++We)ge[Pe+We]=ve[be]+ve[We];return ge}();function Ge(ve){return typeof BigInt>"u"?Oe:ve}function Oe(){throw new Error("BigInt not supported")}},9216:function(e){e.exports=a,e.exports.isMobile=a,e.exports.default=a;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,o=/android|ipad|playbook|silk/i;function a(i){i||(i={});var n=i.ua;if(!n&&typeof navigator<"u"&&(n=navigator.userAgent),n&&n.headers&&typeof n.headers["user-agent"]=="string"&&(n=n.headers["user-agent"]),typeof n!="string")return!1;var s=t.test(n)&&!r.test(n)||!!i.tablet&&o.test(n);return!s&&i.tablet&&i.featureDetect&&navigator&&navigator.maxTouchPoints>1&&n.indexOf("Macintosh")!==-1&&n.indexOf("Safari")!==-1&&(s=!0),s}},6296:function(e,t,r){e.exports=c;var o=r(7261),a=r(9977),i=r(1811);function n(f,v){this._controllerNames=Object.keys(f),this._controllerList=this._controllerNames.map(function(h){return f[h]}),this._mode=v,this._active=f[v],this._active||(this._mode="turntable",this._active=f.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=n.prototype;s.flush=function(f){for(var v=this._controllerList,h=0;h"u"?r(1538):WeakMap,a=r(2762),i=r(8116),n=new o;function s(c){var f=n.get(c),v=f&&(f._triangleBuffer.handle||f._triangleBuffer.buffer);if(!v||!c.isBuffer(v)){var h=a(c,new Float32Array([-1,-1,-1,4,4,-1]));f=i(c,[{buffer:h,type:c.FLOAT,size:2}]),f._triangleBuffer=h,n.set(c,f)}f.bind(),c.drawArrays(c.TRIANGLES,0,3),f.unbind()}e.exports=s},1085:function(e,t,r){var o=r(1371);e.exports=a;function a(i,n,s){n=typeof n=="number"?n:1,s=s||": ";var c=i.split(/\r?\n/),f=String(c.length+n-1).length;return c.map(function(v,h){var T=h+n,l=String(T).length,y=o(T,f-l);return y+s+v}).join(` +`)}},3952:function(e,t,r){e.exports=i;var o=r(3250);function a(n,s){for(var c=new Array(s+1),f=0;f0)throw new Error("Invalid string. Length must be a multiple of 4");var M=b.indexOf("=");M===-1&&(M=S);var _=M===S?0:4-M%4;return[M,_]}function f(b){var S=c(b),M=S[0],_=S[1];return(M+_)*3/4-_}function v(b,S,M){return(S+M)*3/4-M}function h(b){var S,M=c(b),_=M[0],w=M[1],p=new a(v(b,_,w)),u=0,g=w>0?_-4:_,m;for(m=0;m>16&255,p[u++]=S>>8&255,p[u++]=S&255;return w===2&&(S=o[b.charCodeAt(m)]<<2|o[b.charCodeAt(m+1)]>>4,p[u++]=S&255),w===1&&(S=o[b.charCodeAt(m)]<<10|o[b.charCodeAt(m+1)]<<4|o[b.charCodeAt(m+2)]>>2,p[u++]=S>>8&255,p[u++]=S&255),p}function T(b){return r[b>>18&63]+r[b>>12&63]+r[b>>6&63]+r[b&63]}function l(b,S,M){for(var _,w=[],p=S;pg?g:u+p));return _===1?(S=b[M-1],w.push(r[S>>2]+r[S<<4&63]+"==")):_===2&&(S=(b[M-2]<<8)+b[M-1],w.push(r[S>>10]+r[S>>4&63]+r[S<<2&63]+"=")),w.join("")}},3865:function(e,t,r){var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]).add(n[0].mul(i[1])),i[1].mul(n[1]))}},1318:function(e){e.exports=t;function t(r,o){return r[0].mul(o[1]).cmp(o[0].mul(r[1]))}},8697:function(e,t,r){var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]),i[1].mul(n[0]))}},7842:function(e,t,r){var o=r(6330),a=r(1533),i=r(2651),n=r(6768),s=r(869),c=r(8697);e.exports=f;function f(v,h){if(o(v))return h?c(v,f(h)):[v[0].clone(),v[1].clone()];var T=0,l,y;if(a(v))l=v.clone();else if(typeof v=="string")l=n(v);else{if(v===0)return[i(0),i(1)];if(v===Math.floor(v))l=i(v);else{for(;v!==Math.floor(v);)v=v*Math.pow(2,256),T-=256;l=i(v)}}if(o(h))l.mul(h[1]),y=h[0].clone();else if(a(h))y=h.clone();else if(typeof h=="string")y=n(h);else if(!h)y=i(1);else if(h===Math.floor(h))y=i(h);else{for(;h!==Math.floor(h);)h=h*Math.pow(2,256),T+=256;y=i(h)}return T>0?l=l.ushln(T):T<0&&(y=y.ushln(-T)),s(l,y)}},6330:function(e,t,r){var o=r(1533);e.exports=a;function a(i){return Array.isArray(i)&&i.length===2&&o(i[0])&&o(i[1])}},5716:function(e,t,r){var o=r(6859);e.exports=a;function a(i){return i.cmp(new o(0))}},1369:function(e,t,r){var o=r(5716);e.exports=a;function a(i){var n=i.length,s=i.words,c=0;if(n===1)c=s[0];else if(n===2)c=s[0]+s[1]*67108864;else for(var f=0;f20?52:c+32}},1533:function(e,t,r){r(6859),e.exports=o;function o(a){return a&&typeof a=="object"&&!!a.words}},2651:function(e,t,r){var o=r(6859),a=r(2361);e.exports=i;function i(n){var s=a.exponent(n);return s<52?new o(n):new o(n*Math.pow(2,52-s)).ushln(s-52)}},869:function(e,t,r){var o=r(2651),a=r(5716);e.exports=i;function i(n,s){var c=a(n),f=a(s);if(c===0)return[o(0),o(1)];if(f===0)return[o(0),o(0)];f<0&&(n=n.neg(),s=s.neg());var v=n.gcd(s);return v.cmpn(1)?[n.div(v),s.div(v)]:[n,s]}},6768:function(e,t,r){var o=r(6859);e.exports=a;function a(i){return new o(i)}},6504:function(e,t,r){var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[0]),i[1].mul(n[1]))}},7721:function(e,t,r){var o=r(5716);e.exports=a;function a(i){return o(i[0])*o(i[1])}},5572:function(e,t,r){var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]).sub(i[1].mul(n[0])),i[1].mul(n[1]))}},946:function(e,t,r){var o=r(1369),a=r(4025);e.exports=i;function i(n){var s=n[0],c=n[1];if(s.cmpn(0)===0)return 0;var f=s.abs().divmod(c.abs()),v=f.div,h=o(v),T=f.mod,l=s.negative!==c.negative?-1:1;if(T.cmpn(0)===0)return l*h;if(h){var y=a(h)+4,b=o(T.ushln(y).divRound(c));return l*(h+b*Math.pow(2,-y))}else{var S=c.bitLength()-T.bitLength()+53,b=o(T.ushln(S).divRound(c));return S<1023?l*b*Math.pow(2,-S):(b*=Math.pow(2,-1023),l*b*Math.pow(2,1023-S))}}},2478:function(e){function t(s,c,f,v,h){for(var T=h+1;v<=h;){var l=v+h>>>1,y=s[l],b=f!==void 0?f(y,c):y-c;b>=0?(T=l,h=l-1):v=l+1}return T}function r(s,c,f,v,h){for(var T=h+1;v<=h;){var l=v+h>>>1,y=s[l],b=f!==void 0?f(y,c):y-c;b>0?(T=l,h=l-1):v=l+1}return T}function o(s,c,f,v,h){for(var T=v-1;v<=h;){var l=v+h>>>1,y=s[l],b=f!==void 0?f(y,c):y-c;b<0?(T=l,v=l+1):h=l-1}return T}function a(s,c,f,v,h){for(var T=v-1;v<=h;){var l=v+h>>>1,y=s[l],b=f!==void 0?f(y,c):y-c;b<=0?(T=l,v=l+1):h=l-1}return T}function i(s,c,f,v,h){for(;v<=h;){var T=v+h>>>1,l=s[T],y=f!==void 0?f(l,c):l-c;if(y===0)return T;y<=0?v=T+1:h=T-1}return-1}function n(s,c,f,v,h,T){return typeof f=="function"?T(s,c,f,v===void 0?0:v|0,h===void 0?s.length-1:h|0):T(s,c,void 0,f===void 0?0:f|0,v===void 0?s.length-1:v|0)}e.exports={ge:function(s,c,f,v,h){return n(s,c,f,v,h,t)},gt:function(s,c,f,v,h){return n(s,c,f,v,h,r)},lt:function(s,c,f,v,h){return n(s,c,f,v,h,o)},le:function(s,c,f,v,h){return n(s,c,f,v,h,a)},eq:function(s,c,f,v,h){return n(s,c,f,v,h,i)}}},8828:function(e,t){"use restrict";var r=32;t.INT_BITS=r,t.INT_MAX=2147483647,t.INT_MIN=-1<0)-(i<0)},t.abs=function(i){var n=i>>r-1;return(i^n)-n},t.min=function(i,n){return n^(i^n)&-(i65535)<<4,i>>>=n,s=(i>255)<<3,i>>>=s,n|=s,s=(i>15)<<2,i>>>=s,n|=s,s=(i>3)<<1,i>>>=s,n|=s,n|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var n=32;return i&=-i,i&&n--,i&65535&&(n-=16),i&16711935&&(n-=8),i&252645135&&(n-=4),i&858993459&&(n-=2),i&1431655765&&(n-=1),n}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var a=new Array(256);(function(i){for(var n=0;n<256;++n){var s=n,c=n,f=7;for(s>>>=1;s;s>>>=1)c<<=1,c|=s&1,--f;i[n]=c<>>8&255]<<16|a[i>>>16&255]<<8|a[i>>>24&255]},t.interleave2=function(i,n){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,n&=65535,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,i|n<<1},t.deinterleave2=function(i,n){return i=i>>>n&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,n,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,i|=n<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,n){return i=i>>>n&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var n=i|i-1;return n+1|(~n&-~n)-1>>>o(i)+1}},6859:function(e,t,r){e=r.nmd(e),function(o,a){function i(O,L){if(!O)throw new Error(L||"Assertion failed")}function n(O,L){O.super_=L;var N=function(){};N.prototype=L.prototype,O.prototype=new N,O.prototype.constructor=O}function s(O,L,N){if(s.isBN(O))return O;this.negative=0,this.words=null,this.length=0,this.red=null,O!==null&&((L==="le"||L==="be")&&(N=L,L=10),this._init(O||0,L||10,N||"be"))}typeof o=="object"?o.exports=s:a.BN=s,s.BN=s,s.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=r(7790).Buffer}catch{}s.isBN=function(L){return L instanceof s?!0:L!==null&&typeof L=="object"&&L.constructor.wordSize===s.wordSize&&Array.isArray(L.words)},s.max=function(L,N){return L.cmp(N)>0?L:N},s.min=function(L,N){return L.cmp(N)<0?L:N},s.prototype._init=function(L,N,U){if(typeof L=="number")return this._initNumber(L,N,U);if(typeof L=="object")return this._initArray(L,N,U);N==="hex"&&(N=16),i(N===(N|0)&&N>=2&&N<=36),L=L.toString().replace(/\s+/g,"");var Z=0;L[0]==="-"&&(Z++,this.negative=1),Z=0;Z-=3)ue=L[Z]|L[Z-1]<<8|L[Z-2]<<16,this.words[Q]|=ue<>>26-oe&67108863,oe+=24,oe>=26&&(oe-=26,Q++);else if(U==="le")for(Z=0,Q=0;Z>>26-oe&67108863,oe+=24,oe>=26&&(oe-=26,Q++);return this.strip()};function f(O,L){var N=O.charCodeAt(L);return N>=65&&N<=70?N-55:N>=97&&N<=102?N-87:N-48&15}function v(O,L,N){var U=f(O,N);return N-1>=L&&(U|=f(O,N-1)<<4),U}s.prototype._parseHex=function(L,N,U){this.length=Math.ceil((L.length-N)/6),this.words=new Array(this.length);for(var Z=0;Z=N;Z-=2)oe=v(L,N,Z)<=18?(Q-=18,ue+=1,this.words[ue]|=oe>>>26):Q+=8;else{var le=L.length-N;for(Z=le%2===0?N+1:N;Z=18?(Q-=18,ue+=1,this.words[ue]|=oe>>>26):Q+=8}this.strip()};function h(O,L,N,U){for(var Z=0,Q=Math.min(O.length,N),ue=L;ue=49?Z+=oe-49+10:oe>=17?Z+=oe-17+10:Z+=oe}return Z}s.prototype._parseBase=function(L,N,U){this.words=[0],this.length=1;for(var Z=0,Q=1;Q<=67108863;Q*=N)Z++;Z--,Q=Q/N|0;for(var ue=L.length-U,oe=ue%Z,le=Math.min(ue,ue-oe)+U,j=0,J=U;J1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var T=["","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"],l=[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],y=[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];s.prototype.toString=function(L,N){L=L||10,N=N|0||1;var U;if(L===16||L==="hex"){U="";for(var Z=0,Q=0,ue=0;ue>>24-Z&16777215,Q!==0||ue!==this.length-1?U=T[6-le.length]+le+U:U=le+U,Z+=2,Z>=26&&(Z-=26,ue--)}for(Q!==0&&(U=Q.toString(16)+U);U.length%N!==0;)U="0"+U;return this.negative!==0&&(U="-"+U),U}if(L===(L|0)&&L>=2&&L<=36){var j=l[L],J=y[L];U="";var $=this.clone();for($.negative=0;!$.isZero();){var X=$.modn(J).toString(L);$=$.idivn(J),$.isZero()?U=X+U:U=T[j-X.length]+X+U}for(this.isZero()&&(U="0"+U);U.length%N!==0;)U="0"+U;return this.negative!==0&&(U="-"+U),U}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var L=this.words[0];return this.length===2?L+=this.words[1]*67108864:this.length===3&&this.words[2]===1?L+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-L:L},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(L,N){return i(typeof c<"u"),this.toArrayLike(c,L,N)},s.prototype.toArray=function(L,N){return this.toArrayLike(Array,L,N)},s.prototype.toArrayLike=function(L,N,U){var Z=this.byteLength(),Q=U||Math.max(1,Z);i(Z<=Q,"byte array longer than desired length"),i(Q>0,"Requested array length <= 0"),this.strip();var ue=N==="le",oe=new L(Q),le,j,J=this.clone();if(ue){for(j=0;!J.isZero();j++)le=J.andln(255),J.iushrn(8),oe[j]=le;for(;j=4096&&(U+=13,N>>>=13),N>=64&&(U+=7,N>>>=7),N>=8&&(U+=4,N>>>=4),N>=2&&(U+=2,N>>>=2),U+N},s.prototype._zeroBits=function(L){if(L===0)return 26;var N=L,U=0;return N&8191||(U+=13,N>>>=13),N&127||(U+=7,N>>>=7),N&15||(U+=4,N>>>=4),N&3||(U+=2,N>>>=2),N&1||U++,U},s.prototype.bitLength=function(){var L=this.words[this.length-1],N=this._countBits(L);return(this.length-1)*26+N};function b(O){for(var L=new Array(O.bitLength()),N=0;N>>Z}return L}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var L=0,N=0;NL.length?this.clone().ior(L):L.clone().ior(this)},s.prototype.uor=function(L){return this.length>L.length?this.clone().iuor(L):L.clone().iuor(this)},s.prototype.iuand=function(L){var N;this.length>L.length?N=L:N=this;for(var U=0;UL.length?this.clone().iand(L):L.clone().iand(this)},s.prototype.uand=function(L){return this.length>L.length?this.clone().iuand(L):L.clone().iuand(this)},s.prototype.iuxor=function(L){var N,U;this.length>L.length?(N=this,U=L):(N=L,U=this);for(var Z=0;ZL.length?this.clone().ixor(L):L.clone().ixor(this)},s.prototype.uxor=function(L){return this.length>L.length?this.clone().iuxor(L):L.clone().iuxor(this)},s.prototype.inotn=function(L){i(typeof L=="number"&&L>=0);var N=Math.ceil(L/26)|0,U=L%26;this._expand(N),U>0&&N--;for(var Z=0;Z0&&(this.words[Z]=~this.words[Z]&67108863>>26-U),this.strip()},s.prototype.notn=function(L){return this.clone().inotn(L)},s.prototype.setn=function(L,N){i(typeof L=="number"&&L>=0);var U=L/26|0,Z=L%26;return this._expand(U+1),N?this.words[U]=this.words[U]|1<L.length?(U=this,Z=L):(U=L,Z=this);for(var Q=0,ue=0;ue>>26;for(;Q!==0&&ue>>26;if(this.length=U.length,Q!==0)this.words[this.length]=Q,this.length++;else if(U!==this)for(;ueL.length?this.clone().iadd(L):L.clone().iadd(this)},s.prototype.isub=function(L){if(L.negative!==0){L.negative=0;var N=this.iadd(L);return L.negative=1,N._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(L),this.negative=1,this._normSign();var U=this.cmp(L);if(U===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,Q;U>0?(Z=this,Q=L):(Z=L,Q=this);for(var ue=0,oe=0;oe>26,this.words[oe]=N&67108863;for(;ue!==0&&oe>26,this.words[oe]=N&67108863;if(ue===0&&oe>>26,$=le&67108863,X=Math.min(j,L.length-1),re=Math.max(0,j-O.length+1);re<=X;re++){var ee=j-re|0;Z=O.words[ee]|0,Q=L.words[re]|0,ue=Z*Q+$,J+=ue/67108864|0,$=ue&67108863}N.words[j]=$|0,le=J|0}return le!==0?N.words[j]=le|0:N.length--,N.strip()}var M=function(L,N,U){var Z=L.words,Q=N.words,ue=U.words,oe=0,le,j,J,$=Z[0]|0,X=$&8191,re=$>>>13,ee=Z[1]|0,q=ee&8191,ae=ee>>>13,ie=Z[2]|0,fe=ie&8191,we=ie>>>13,Ae=Z[3]|0,Fe=Ae&8191,Ce=Ae>>>13,qe=Z[4]|0,et=qe&8191,Qe=qe>>>13,Ke=Z[5]|0,Xe=Ke&8191,Me=Ke>>>13,xe=Z[6]|0,ce=xe&8191,Re=xe>>>13,$e=Z[7]|0,rt=$e&8191,Je=$e>>>13,At=Z[8]|0,St=At&8191,Rt=At>>>13,Ut=Z[9]|0,ir=Ut&8191,ar=Ut>>>13,Mr=Q[0]|0,fr=Mr&8191,dr=Mr>>>13,pt=Q[1]|0,ze=pt&8191,Ge=pt>>>13,Oe=Q[2]|0,ve=Oe&8191,ge=Oe>>>13,be=Q[3]|0,Pe=be&8191,We=be>>>13,ct=Q[4]|0,_t=ct&8191,Mt=ct>>>13,Nt=Q[5]|0,Bt=Nt&8191,qt=Nt>>>13,Zt=Q[6]|0,lr=Zt&8191,ta=Zt>>>13,da=Q[7]|0,wa=da&8191,ma=da>>>13,Ia=Q[8]|0,va=Ia&8191,La=Ia>>>13,Ka=Q[9]|0,Vt=Ka&8191,Lt=Ka>>>13;U.negative=L.negative^N.negative,U.length=19,le=Math.imul(X,fr),j=Math.imul(X,dr),j=j+Math.imul(re,fr)|0,J=Math.imul(re,dr);var jt=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(jt>>>26)|0,jt&=67108863,le=Math.imul(q,fr),j=Math.imul(q,dr),j=j+Math.imul(ae,fr)|0,J=Math.imul(ae,dr),le=le+Math.imul(X,ze)|0,j=j+Math.imul(X,Ge)|0,j=j+Math.imul(re,ze)|0,J=J+Math.imul(re,Ge)|0;var Ot=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,le=Math.imul(fe,fr),j=Math.imul(fe,dr),j=j+Math.imul(we,fr)|0,J=Math.imul(we,dr),le=le+Math.imul(q,ze)|0,j=j+Math.imul(q,Ge)|0,j=j+Math.imul(ae,ze)|0,J=J+Math.imul(ae,Ge)|0,le=le+Math.imul(X,ve)|0,j=j+Math.imul(X,ge)|0,j=j+Math.imul(re,ve)|0,J=J+Math.imul(re,ge)|0;var gr=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(gr>>>26)|0,gr&=67108863,le=Math.imul(Fe,fr),j=Math.imul(Fe,dr),j=j+Math.imul(Ce,fr)|0,J=Math.imul(Ce,dr),le=le+Math.imul(fe,ze)|0,j=j+Math.imul(fe,Ge)|0,j=j+Math.imul(we,ze)|0,J=J+Math.imul(we,Ge)|0,le=le+Math.imul(q,ve)|0,j=j+Math.imul(q,ge)|0,j=j+Math.imul(ae,ve)|0,J=J+Math.imul(ae,ge)|0,le=le+Math.imul(X,Pe)|0,j=j+Math.imul(X,We)|0,j=j+Math.imul(re,Pe)|0,J=J+Math.imul(re,We)|0;var Br=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Br>>>26)|0,Br&=67108863,le=Math.imul(et,fr),j=Math.imul(et,dr),j=j+Math.imul(Qe,fr)|0,J=Math.imul(Qe,dr),le=le+Math.imul(Fe,ze)|0,j=j+Math.imul(Fe,Ge)|0,j=j+Math.imul(Ce,ze)|0,J=J+Math.imul(Ce,Ge)|0,le=le+Math.imul(fe,ve)|0,j=j+Math.imul(fe,ge)|0,j=j+Math.imul(we,ve)|0,J=J+Math.imul(we,ge)|0,le=le+Math.imul(q,Pe)|0,j=j+Math.imul(q,We)|0,j=j+Math.imul(ae,Pe)|0,J=J+Math.imul(ae,We)|0,le=le+Math.imul(X,_t)|0,j=j+Math.imul(X,Mt)|0,j=j+Math.imul(re,_t)|0,J=J+Math.imul(re,Mt)|0;var na=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(na>>>26)|0,na&=67108863,le=Math.imul(Xe,fr),j=Math.imul(Xe,dr),j=j+Math.imul(Me,fr)|0,J=Math.imul(Me,dr),le=le+Math.imul(et,ze)|0,j=j+Math.imul(et,Ge)|0,j=j+Math.imul(Qe,ze)|0,J=J+Math.imul(Qe,Ge)|0,le=le+Math.imul(Fe,ve)|0,j=j+Math.imul(Fe,ge)|0,j=j+Math.imul(Ce,ve)|0,J=J+Math.imul(Ce,ge)|0,le=le+Math.imul(fe,Pe)|0,j=j+Math.imul(fe,We)|0,j=j+Math.imul(we,Pe)|0,J=J+Math.imul(we,We)|0,le=le+Math.imul(q,_t)|0,j=j+Math.imul(q,Mt)|0,j=j+Math.imul(ae,_t)|0,J=J+Math.imul(ae,Mt)|0,le=le+Math.imul(X,Bt)|0,j=j+Math.imul(X,qt)|0,j=j+Math.imul(re,Bt)|0,J=J+Math.imul(re,qt)|0;var Ur=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,le=Math.imul(ce,fr),j=Math.imul(ce,dr),j=j+Math.imul(Re,fr)|0,J=Math.imul(Re,dr),le=le+Math.imul(Xe,ze)|0,j=j+Math.imul(Xe,Ge)|0,j=j+Math.imul(Me,ze)|0,J=J+Math.imul(Me,Ge)|0,le=le+Math.imul(et,ve)|0,j=j+Math.imul(et,ge)|0,j=j+Math.imul(Qe,ve)|0,J=J+Math.imul(Qe,ge)|0,le=le+Math.imul(Fe,Pe)|0,j=j+Math.imul(Fe,We)|0,j=j+Math.imul(Ce,Pe)|0,J=J+Math.imul(Ce,We)|0,le=le+Math.imul(fe,_t)|0,j=j+Math.imul(fe,Mt)|0,j=j+Math.imul(we,_t)|0,J=J+Math.imul(we,Mt)|0,le=le+Math.imul(q,Bt)|0,j=j+Math.imul(q,qt)|0,j=j+Math.imul(ae,Bt)|0,J=J+Math.imul(ae,qt)|0,le=le+Math.imul(X,lr)|0,j=j+Math.imul(X,ta)|0,j=j+Math.imul(re,lr)|0,J=J+Math.imul(re,ta)|0;var ga=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(ga>>>26)|0,ga&=67108863,le=Math.imul(rt,fr),j=Math.imul(rt,dr),j=j+Math.imul(Je,fr)|0,J=Math.imul(Je,dr),le=le+Math.imul(ce,ze)|0,j=j+Math.imul(ce,Ge)|0,j=j+Math.imul(Re,ze)|0,J=J+Math.imul(Re,Ge)|0,le=le+Math.imul(Xe,ve)|0,j=j+Math.imul(Xe,ge)|0,j=j+Math.imul(Me,ve)|0,J=J+Math.imul(Me,ge)|0,le=le+Math.imul(et,Pe)|0,j=j+Math.imul(et,We)|0,j=j+Math.imul(Qe,Pe)|0,J=J+Math.imul(Qe,We)|0,le=le+Math.imul(Fe,_t)|0,j=j+Math.imul(Fe,Mt)|0,j=j+Math.imul(Ce,_t)|0,J=J+Math.imul(Ce,Mt)|0,le=le+Math.imul(fe,Bt)|0,j=j+Math.imul(fe,qt)|0,j=j+Math.imul(we,Bt)|0,J=J+Math.imul(we,qt)|0,le=le+Math.imul(q,lr)|0,j=j+Math.imul(q,ta)|0,j=j+Math.imul(ae,lr)|0,J=J+Math.imul(ae,ta)|0,le=le+Math.imul(X,wa)|0,j=j+Math.imul(X,ma)|0,j=j+Math.imul(re,wa)|0,J=J+Math.imul(re,ma)|0;var Aa=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Aa>>>26)|0,Aa&=67108863,le=Math.imul(St,fr),j=Math.imul(St,dr),j=j+Math.imul(Rt,fr)|0,J=Math.imul(Rt,dr),le=le+Math.imul(rt,ze)|0,j=j+Math.imul(rt,Ge)|0,j=j+Math.imul(Je,ze)|0,J=J+Math.imul(Je,Ge)|0,le=le+Math.imul(ce,ve)|0,j=j+Math.imul(ce,ge)|0,j=j+Math.imul(Re,ve)|0,J=J+Math.imul(Re,ge)|0,le=le+Math.imul(Xe,Pe)|0,j=j+Math.imul(Xe,We)|0,j=j+Math.imul(Me,Pe)|0,J=J+Math.imul(Me,We)|0,le=le+Math.imul(et,_t)|0,j=j+Math.imul(et,Mt)|0,j=j+Math.imul(Qe,_t)|0,J=J+Math.imul(Qe,Mt)|0,le=le+Math.imul(Fe,Bt)|0,j=j+Math.imul(Fe,qt)|0,j=j+Math.imul(Ce,Bt)|0,J=J+Math.imul(Ce,qt)|0,le=le+Math.imul(fe,lr)|0,j=j+Math.imul(fe,ta)|0,j=j+Math.imul(we,lr)|0,J=J+Math.imul(we,ta)|0,le=le+Math.imul(q,wa)|0,j=j+Math.imul(q,ma)|0,j=j+Math.imul(ae,wa)|0,J=J+Math.imul(ae,ma)|0,le=le+Math.imul(X,va)|0,j=j+Math.imul(X,La)|0,j=j+Math.imul(re,va)|0,J=J+Math.imul(re,La)|0;var Pa=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Pa>>>26)|0,Pa&=67108863,le=Math.imul(ir,fr),j=Math.imul(ir,dr),j=j+Math.imul(ar,fr)|0,J=Math.imul(ar,dr),le=le+Math.imul(St,ze)|0,j=j+Math.imul(St,Ge)|0,j=j+Math.imul(Rt,ze)|0,J=J+Math.imul(Rt,Ge)|0,le=le+Math.imul(rt,ve)|0,j=j+Math.imul(rt,ge)|0,j=j+Math.imul(Je,ve)|0,J=J+Math.imul(Je,ge)|0,le=le+Math.imul(ce,Pe)|0,j=j+Math.imul(ce,We)|0,j=j+Math.imul(Re,Pe)|0,J=J+Math.imul(Re,We)|0,le=le+Math.imul(Xe,_t)|0,j=j+Math.imul(Xe,Mt)|0,j=j+Math.imul(Me,_t)|0,J=J+Math.imul(Me,Mt)|0,le=le+Math.imul(et,Bt)|0,j=j+Math.imul(et,qt)|0,j=j+Math.imul(Qe,Bt)|0,J=J+Math.imul(Qe,qt)|0,le=le+Math.imul(Fe,lr)|0,j=j+Math.imul(Fe,ta)|0,j=j+Math.imul(Ce,lr)|0,J=J+Math.imul(Ce,ta)|0,le=le+Math.imul(fe,wa)|0,j=j+Math.imul(fe,ma)|0,j=j+Math.imul(we,wa)|0,J=J+Math.imul(we,ma)|0,le=le+Math.imul(q,va)|0,j=j+Math.imul(q,La)|0,j=j+Math.imul(ae,va)|0,J=J+Math.imul(ae,La)|0,le=le+Math.imul(X,Vt)|0,j=j+Math.imul(X,Lt)|0,j=j+Math.imul(re,Vt)|0,J=J+Math.imul(re,Lt)|0;var sa=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(sa>>>26)|0,sa&=67108863,le=Math.imul(ir,ze),j=Math.imul(ir,Ge),j=j+Math.imul(ar,ze)|0,J=Math.imul(ar,Ge),le=le+Math.imul(St,ve)|0,j=j+Math.imul(St,ge)|0,j=j+Math.imul(Rt,ve)|0,J=J+Math.imul(Rt,ge)|0,le=le+Math.imul(rt,Pe)|0,j=j+Math.imul(rt,We)|0,j=j+Math.imul(Je,Pe)|0,J=J+Math.imul(Je,We)|0,le=le+Math.imul(ce,_t)|0,j=j+Math.imul(ce,Mt)|0,j=j+Math.imul(Re,_t)|0,J=J+Math.imul(Re,Mt)|0,le=le+Math.imul(Xe,Bt)|0,j=j+Math.imul(Xe,qt)|0,j=j+Math.imul(Me,Bt)|0,J=J+Math.imul(Me,qt)|0,le=le+Math.imul(et,lr)|0,j=j+Math.imul(et,ta)|0,j=j+Math.imul(Qe,lr)|0,J=J+Math.imul(Qe,ta)|0,le=le+Math.imul(Fe,wa)|0,j=j+Math.imul(Fe,ma)|0,j=j+Math.imul(Ce,wa)|0,J=J+Math.imul(Ce,ma)|0,le=le+Math.imul(fe,va)|0,j=j+Math.imul(fe,La)|0,j=j+Math.imul(we,va)|0,J=J+Math.imul(we,La)|0,le=le+Math.imul(q,Vt)|0,j=j+Math.imul(q,Lt)|0,j=j+Math.imul(ae,Vt)|0,J=J+Math.imul(ae,Lt)|0;var Oa=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Oa>>>26)|0,Oa&=67108863,le=Math.imul(ir,ve),j=Math.imul(ir,ge),j=j+Math.imul(ar,ve)|0,J=Math.imul(ar,ge),le=le+Math.imul(St,Pe)|0,j=j+Math.imul(St,We)|0,j=j+Math.imul(Rt,Pe)|0,J=J+Math.imul(Rt,We)|0,le=le+Math.imul(rt,_t)|0,j=j+Math.imul(rt,Mt)|0,j=j+Math.imul(Je,_t)|0,J=J+Math.imul(Je,Mt)|0,le=le+Math.imul(ce,Bt)|0,j=j+Math.imul(ce,qt)|0,j=j+Math.imul(Re,Bt)|0,J=J+Math.imul(Re,qt)|0,le=le+Math.imul(Xe,lr)|0,j=j+Math.imul(Xe,ta)|0,j=j+Math.imul(Me,lr)|0,J=J+Math.imul(Me,ta)|0,le=le+Math.imul(et,wa)|0,j=j+Math.imul(et,ma)|0,j=j+Math.imul(Qe,wa)|0,J=J+Math.imul(Qe,ma)|0,le=le+Math.imul(Fe,va)|0,j=j+Math.imul(Fe,La)|0,j=j+Math.imul(Ce,va)|0,J=J+Math.imul(Ce,La)|0,le=le+Math.imul(fe,Vt)|0,j=j+Math.imul(fe,Lt)|0,j=j+Math.imul(we,Vt)|0,J=J+Math.imul(we,Lt)|0;var dt=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(dt>>>26)|0,dt&=67108863,le=Math.imul(ir,Pe),j=Math.imul(ir,We),j=j+Math.imul(ar,Pe)|0,J=Math.imul(ar,We),le=le+Math.imul(St,_t)|0,j=j+Math.imul(St,Mt)|0,j=j+Math.imul(Rt,_t)|0,J=J+Math.imul(Rt,Mt)|0,le=le+Math.imul(rt,Bt)|0,j=j+Math.imul(rt,qt)|0,j=j+Math.imul(Je,Bt)|0,J=J+Math.imul(Je,qt)|0,le=le+Math.imul(ce,lr)|0,j=j+Math.imul(ce,ta)|0,j=j+Math.imul(Re,lr)|0,J=J+Math.imul(Re,ta)|0,le=le+Math.imul(Xe,wa)|0,j=j+Math.imul(Xe,ma)|0,j=j+Math.imul(Me,wa)|0,J=J+Math.imul(Me,ma)|0,le=le+Math.imul(et,va)|0,j=j+Math.imul(et,La)|0,j=j+Math.imul(Qe,va)|0,J=J+Math.imul(Qe,La)|0,le=le+Math.imul(Fe,Vt)|0,j=j+Math.imul(Fe,Lt)|0,j=j+Math.imul(Ce,Vt)|0,J=J+Math.imul(Ce,Lt)|0;var vt=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(vt>>>26)|0,vt&=67108863,le=Math.imul(ir,_t),j=Math.imul(ir,Mt),j=j+Math.imul(ar,_t)|0,J=Math.imul(ar,Mt),le=le+Math.imul(St,Bt)|0,j=j+Math.imul(St,qt)|0,j=j+Math.imul(Rt,Bt)|0,J=J+Math.imul(Rt,qt)|0,le=le+Math.imul(rt,lr)|0,j=j+Math.imul(rt,ta)|0,j=j+Math.imul(Je,lr)|0,J=J+Math.imul(Je,ta)|0,le=le+Math.imul(ce,wa)|0,j=j+Math.imul(ce,ma)|0,j=j+Math.imul(Re,wa)|0,J=J+Math.imul(Re,ma)|0,le=le+Math.imul(Xe,va)|0,j=j+Math.imul(Xe,La)|0,j=j+Math.imul(Me,va)|0,J=J+Math.imul(Me,La)|0,le=le+Math.imul(et,Vt)|0,j=j+Math.imul(et,Lt)|0,j=j+Math.imul(Qe,Vt)|0,J=J+Math.imul(Qe,Lt)|0;var Lr=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Lr>>>26)|0,Lr&=67108863,le=Math.imul(ir,Bt),j=Math.imul(ir,qt),j=j+Math.imul(ar,Bt)|0,J=Math.imul(ar,qt),le=le+Math.imul(St,lr)|0,j=j+Math.imul(St,ta)|0,j=j+Math.imul(Rt,lr)|0,J=J+Math.imul(Rt,ta)|0,le=le+Math.imul(rt,wa)|0,j=j+Math.imul(rt,ma)|0,j=j+Math.imul(Je,wa)|0,J=J+Math.imul(Je,ma)|0,le=le+Math.imul(ce,va)|0,j=j+Math.imul(ce,La)|0,j=j+Math.imul(Re,va)|0,J=J+Math.imul(Re,La)|0,le=le+Math.imul(Xe,Vt)|0,j=j+Math.imul(Xe,Lt)|0,j=j+Math.imul(Me,Vt)|0,J=J+Math.imul(Me,Lt)|0;var Er=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Er>>>26)|0,Er&=67108863,le=Math.imul(ir,lr),j=Math.imul(ir,ta),j=j+Math.imul(ar,lr)|0,J=Math.imul(ar,ta),le=le+Math.imul(St,wa)|0,j=j+Math.imul(St,ma)|0,j=j+Math.imul(Rt,wa)|0,J=J+Math.imul(Rt,ma)|0,le=le+Math.imul(rt,va)|0,j=j+Math.imul(rt,La)|0,j=j+Math.imul(Je,va)|0,J=J+Math.imul(Je,La)|0,le=le+Math.imul(ce,Vt)|0,j=j+Math.imul(ce,Lt)|0,j=j+Math.imul(Re,Vt)|0,J=J+Math.imul(Re,Lt)|0;var _r=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(_r>>>26)|0,_r&=67108863,le=Math.imul(ir,wa),j=Math.imul(ir,ma),j=j+Math.imul(ar,wa)|0,J=Math.imul(ar,ma),le=le+Math.imul(St,va)|0,j=j+Math.imul(St,La)|0,j=j+Math.imul(Rt,va)|0,J=J+Math.imul(Rt,La)|0,le=le+Math.imul(rt,Vt)|0,j=j+Math.imul(rt,Lt)|0,j=j+Math.imul(Je,Vt)|0,J=J+Math.imul(Je,Lt)|0;var yr=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(yr>>>26)|0,yr&=67108863,le=Math.imul(ir,va),j=Math.imul(ir,La),j=j+Math.imul(ar,va)|0,J=Math.imul(ar,La),le=le+Math.imul(St,Vt)|0,j=j+Math.imul(St,Lt)|0,j=j+Math.imul(Rt,Vt)|0,J=J+Math.imul(Rt,Lt)|0;var kr=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(kr>>>26)|0,kr&=67108863,le=Math.imul(ir,Vt),j=Math.imul(ir,Lt),j=j+Math.imul(ar,Vt)|0,J=Math.imul(ar,Lt);var zr=(oe+le|0)+((j&8191)<<13)|0;return oe=(J+(j>>>13)|0)+(zr>>>26)|0,zr&=67108863,ue[0]=jt,ue[1]=Ot,ue[2]=gr,ue[3]=Br,ue[4]=na,ue[5]=Ur,ue[6]=ga,ue[7]=Aa,ue[8]=Pa,ue[9]=sa,ue[10]=Oa,ue[11]=dt,ue[12]=vt,ue[13]=Lr,ue[14]=Er,ue[15]=_r,ue[16]=yr,ue[17]=kr,ue[18]=zr,oe!==0&&(ue[19]=oe,U.length++),U};Math.imul||(M=S);function _(O,L,N){N.negative=L.negative^O.negative,N.length=O.length+L.length;for(var U=0,Z=0,Q=0;Q>>26)|0,Z+=ue>>>26,ue&=67108863}N.words[Q]=oe,U=ue,ue=Z}return U!==0?N.words[Q]=U:N.length--,N.strip()}function w(O,L,N){var U=new p;return U.mulp(O,L,N)}s.prototype.mulTo=function(L,N){var U,Z=this.length+L.length;return this.length===10&&L.length===10?U=M(this,L,N):Z<63?U=S(this,L,N):Z<1024?U=_(this,L,N):U=w(this,L,N),U};function p(O,L){this.x=O,this.y=L}p.prototype.makeRBT=function(L){for(var N=new Array(L),U=s.prototype._countBits(L)-1,Z=0;Z>=1;return Z},p.prototype.permute=function(L,N,U,Z,Q,ue){for(var oe=0;oe>>1)Q++;return 1<>>13,U[2*ue+1]=Q&8191,Q=Q>>>13;for(ue=2*N;ue>=26,N+=Z/67108864|0,N+=Q>>>26,this.words[U]=Q&67108863}return N!==0&&(this.words[U]=N,this.length++),this},s.prototype.muln=function(L){return this.clone().imuln(L)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(L){var N=b(L);if(N.length===0)return new s(1);for(var U=this,Z=0;Z=0);var N=L%26,U=(L-N)/26,Z=67108863>>>26-N<<26-N,Q;if(N!==0){var ue=0;for(Q=0;Q>>26-N}ue&&(this.words[Q]=ue,this.length++)}if(U!==0){for(Q=this.length-1;Q>=0;Q--)this.words[Q+U]=this.words[Q];for(Q=0;Q=0);var Z;N?Z=(N-N%26)/26:Z=0;var Q=L%26,ue=Math.min((L-Q)/26,this.length),oe=67108863^67108863>>>Q<ue)for(this.length-=ue,j=0;j=0&&(J!==0||j>=Z);j--){var $=this.words[j]|0;this.words[j]=J<<26-Q|$>>>Q,J=$&oe}return le&&J!==0&&(le.words[le.length++]=J),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(L,N,U){return i(this.negative===0),this.iushrn(L,N,U)},s.prototype.shln=function(L){return this.clone().ishln(L)},s.prototype.ushln=function(L){return this.clone().iushln(L)},s.prototype.shrn=function(L){return this.clone().ishrn(L)},s.prototype.ushrn=function(L){return this.clone().iushrn(L)},s.prototype.testn=function(L){i(typeof L=="number"&&L>=0);var N=L%26,U=(L-N)/26,Z=1<=0);var N=L%26,U=(L-N)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=U)return this;if(N!==0&&U++,this.length=Math.min(U,this.length),N!==0){var Z=67108863^67108863>>>N<=67108864;N++)this.words[N]-=67108864,N===this.length-1?this.words[N+1]=1:this.words[N+1]++;return this.length=Math.max(this.length,N+1),this},s.prototype.isubn=function(L){if(i(typeof L=="number"),i(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 N=0;N>26)-(le/67108864|0),this.words[Q+U]=ue&67108863}for(;Q>26,this.words[Q+U]=ue&67108863;if(oe===0)return this.strip();for(i(oe===-1),oe=0,Q=0;Q>26,this.words[Q]=ue&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(L,N){var U=this.length-L.length,Z=this.clone(),Q=L,ue=Q.words[Q.length-1]|0,oe=this._countBits(ue);U=26-oe,U!==0&&(Q=Q.ushln(U),Z.iushln(U),ue=Q.words[Q.length-1]|0);var le=Z.length-Q.length,j;if(N!=="mod"){j=new s(null),j.length=le+1,j.words=new Array(j.length);for(var J=0;J=0;X--){var re=(Z.words[Q.length+X]|0)*67108864+(Z.words[Q.length+X-1]|0);for(re=Math.min(re/ue|0,67108863),Z._ishlnsubmul(Q,re,X);Z.negative!==0;)re--,Z.negative=0,Z._ishlnsubmul(Q,1,X),Z.isZero()||(Z.negative^=1);j&&(j.words[X]=re)}return j&&j.strip(),Z.strip(),N!=="div"&&U!==0&&Z.iushrn(U),{div:j||null,mod:Z}},s.prototype.divmod=function(L,N,U){if(i(!L.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var Z,Q,ue;return this.negative!==0&&L.negative===0?(ue=this.neg().divmod(L,N),N!=="mod"&&(Z=ue.div.neg()),N!=="div"&&(Q=ue.mod.neg(),U&&Q.negative!==0&&Q.iadd(L)),{div:Z,mod:Q}):this.negative===0&&L.negative!==0?(ue=this.divmod(L.neg(),N),N!=="mod"&&(Z=ue.div.neg()),{div:Z,mod:ue.mod}):this.negative&L.negative?(ue=this.neg().divmod(L.neg(),N),N!=="div"&&(Q=ue.mod.neg(),U&&Q.negative!==0&&Q.isub(L)),{div:ue.div,mod:Q}):L.length>this.length||this.cmp(L)<0?{div:new s(0),mod:this}:L.length===1?N==="div"?{div:this.divn(L.words[0]),mod:null}:N==="mod"?{div:null,mod:new s(this.modn(L.words[0]))}:{div:this.divn(L.words[0]),mod:new s(this.modn(L.words[0]))}:this._wordDiv(L,N)},s.prototype.div=function(L){return this.divmod(L,"div",!1).div},s.prototype.mod=function(L){return this.divmod(L,"mod",!1).mod},s.prototype.umod=function(L){return this.divmod(L,"mod",!0).mod},s.prototype.divRound=function(L){var N=this.divmod(L);if(N.mod.isZero())return N.div;var U=N.div.negative!==0?N.mod.isub(L):N.mod,Z=L.ushrn(1),Q=L.andln(1),ue=U.cmp(Z);return ue<0||Q===1&&ue===0?N.div:N.div.negative!==0?N.div.isubn(1):N.div.iaddn(1)},s.prototype.modn=function(L){i(L<=67108863);for(var N=(1<<26)%L,U=0,Z=this.length-1;Z>=0;Z--)U=(N*U+(this.words[Z]|0))%L;return U},s.prototype.idivn=function(L){i(L<=67108863);for(var N=0,U=this.length-1;U>=0;U--){var Z=(this.words[U]|0)+N*67108864;this.words[U]=Z/L|0,N=Z%L}return this.strip()},s.prototype.divn=function(L){return this.clone().idivn(L)},s.prototype.egcd=function(L){i(L.negative===0),i(!L.isZero());var N=this,U=L.clone();N.negative!==0?N=N.umod(L):N=N.clone();for(var Z=new s(1),Q=new s(0),ue=new s(0),oe=new s(1),le=0;N.isEven()&&U.isEven();)N.iushrn(1),U.iushrn(1),++le;for(var j=U.clone(),J=N.clone();!N.isZero();){for(var $=0,X=1;!(N.words[0]&X)&&$<26;++$,X<<=1);if($>0)for(N.iushrn($);$-- >0;)(Z.isOdd()||Q.isOdd())&&(Z.iadd(j),Q.isub(J)),Z.iushrn(1),Q.iushrn(1);for(var re=0,ee=1;!(U.words[0]&ee)&&re<26;++re,ee<<=1);if(re>0)for(U.iushrn(re);re-- >0;)(ue.isOdd()||oe.isOdd())&&(ue.iadd(j),oe.isub(J)),ue.iushrn(1),oe.iushrn(1);N.cmp(U)>=0?(N.isub(U),Z.isub(ue),Q.isub(oe)):(U.isub(N),ue.isub(Z),oe.isub(Q))}return{a:ue,b:oe,gcd:U.iushln(le)}},s.prototype._invmp=function(L){i(L.negative===0),i(!L.isZero());var N=this,U=L.clone();N.negative!==0?N=N.umod(L):N=N.clone();for(var Z=new s(1),Q=new s(0),ue=U.clone();N.cmpn(1)>0&&U.cmpn(1)>0;){for(var oe=0,le=1;!(N.words[0]&le)&&oe<26;++oe,le<<=1);if(oe>0)for(N.iushrn(oe);oe-- >0;)Z.isOdd()&&Z.iadd(ue),Z.iushrn(1);for(var j=0,J=1;!(U.words[0]&J)&&j<26;++j,J<<=1);if(j>0)for(U.iushrn(j);j-- >0;)Q.isOdd()&&Q.iadd(ue),Q.iushrn(1);N.cmp(U)>=0?(N.isub(U),Z.isub(Q)):(U.isub(N),Q.isub(Z))}var $;return N.cmpn(1)===0?$=Z:$=Q,$.cmpn(0)<0&&$.iadd(L),$},s.prototype.gcd=function(L){if(this.isZero())return L.abs();if(L.isZero())return this.abs();var N=this.clone(),U=L.clone();N.negative=0,U.negative=0;for(var Z=0;N.isEven()&&U.isEven();Z++)N.iushrn(1),U.iushrn(1);do{for(;N.isEven();)N.iushrn(1);for(;U.isEven();)U.iushrn(1);var Q=N.cmp(U);if(Q<0){var ue=N;N=U,U=ue}else if(Q===0||U.cmpn(1)===0)break;N.isub(U)}while(!0);return U.iushln(Z)},s.prototype.invm=function(L){return this.egcd(L).a.umod(L)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(L){return this.words[0]&L},s.prototype.bincn=function(L){i(typeof L=="number");var N=L%26,U=(L-N)/26,Z=1<>>26,oe&=67108863,this.words[ue]=oe}return Q!==0&&(this.words[ue]=Q,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(L){var N=L<0;if(this.negative!==0&&!N)return-1;if(this.negative===0&&N)return 1;this.strip();var U;if(this.length>1)U=1;else{N&&(L=-L),i(L<=67108863,"Number is too big");var Z=this.words[0]|0;U=Z===L?0:ZL.length)return 1;if(this.length=0;U--){var Z=this.words[U]|0,Q=L.words[U]|0;if(Z!==Q){ZQ&&(N=1);break}}return N},s.prototype.gtn=function(L){return this.cmpn(L)===1},s.prototype.gt=function(L){return this.cmp(L)===1},s.prototype.gten=function(L){return this.cmpn(L)>=0},s.prototype.gte=function(L){return this.cmp(L)>=0},s.prototype.ltn=function(L){return this.cmpn(L)===-1},s.prototype.lt=function(L){return this.cmp(L)===-1},s.prototype.lten=function(L){return this.cmpn(L)<=0},s.prototype.lte=function(L){return this.cmp(L)<=0},s.prototype.eqn=function(L){return this.cmpn(L)===0},s.prototype.eq=function(L){return this.cmp(L)===0},s.red=function(L){return new F(L)},s.prototype.toRed=function(L){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),L.convertTo(this)._forceRed(L)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(L){return this.red=L,this},s.prototype.forceRed=function(L){return i(!this.red,"Already a number in reduction context"),this._forceRed(L)},s.prototype.redAdd=function(L){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,L)},s.prototype.redIAdd=function(L){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,L)},s.prototype.redSub=function(L){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,L)},s.prototype.redISub=function(L){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,L)},s.prototype.redShl=function(L){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,L)},s.prototype.redMul=function(L){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,L),this.red.mul(this,L)},s.prototype.redIMul=function(L){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,L),this.red.imul(this,L)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(L){return i(this.red&&!L.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,L)};var u={k256:null,p224:null,p192:null,p25519:null};function g(O,L){this.name=O,this.p=new s(L,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}g.prototype._tmp=function(){var L=new s(null);return L.words=new Array(Math.ceil(this.n/13)),L},g.prototype.ireduce=function(L){var N=L,U;do this.split(N,this.tmp),N=this.imulK(N),N=N.iadd(this.tmp),U=N.bitLength();while(U>this.n);var Z=U0?N.isub(this.p):N.strip!==void 0?N.strip():N._strip(),N},g.prototype.split=function(L,N){L.iushrn(this.n,0,N)},g.prototype.imulK=function(L){return L.imul(this.k)};function m(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(m,g),m.prototype.split=function(L,N){for(var U=4194303,Z=Math.min(L.length,9),Q=0;Q>>22,ue=oe}ue>>>=22,L.words[Q-10]=ue,ue===0&&L.length>10?L.length-=10:L.length-=9},m.prototype.imulK=function(L){L.words[L.length]=0,L.words[L.length+1]=0,L.length+=2;for(var N=0,U=0;U>>=26,L.words[U]=Q,N=Z}return N!==0&&(L.words[L.length++]=N),L},s._prime=function(L){if(u[L])return u[L];var N;if(L==="k256")N=new m;else if(L==="p224")N=new R;else if(L==="p192")N=new P;else if(L==="p25519")N=new z;else throw new Error("Unknown prime "+L);return u[L]=N,N};function F(O){if(typeof O=="string"){var L=s._prime(O);this.m=L.p,this.prime=L}else i(O.gtn(1),"modulus must be greater than 1"),this.m=O,this.prime=null}F.prototype._verify1=function(L){i(L.negative===0,"red works only with positives"),i(L.red,"red works only with red numbers")},F.prototype._verify2=function(L,N){i((L.negative|N.negative)===0,"red works only with positives"),i(L.red&&L.red===N.red,"red works only with red numbers")},F.prototype.imod=function(L){return this.prime?this.prime.ireduce(L)._forceRed(this):L.umod(this.m)._forceRed(this)},F.prototype.neg=function(L){return L.isZero()?L.clone():this.m.sub(L)._forceRed(this)},F.prototype.add=function(L,N){this._verify2(L,N);var U=L.add(N);return U.cmp(this.m)>=0&&U.isub(this.m),U._forceRed(this)},F.prototype.iadd=function(L,N){this._verify2(L,N);var U=L.iadd(N);return U.cmp(this.m)>=0&&U.isub(this.m),U},F.prototype.sub=function(L,N){this._verify2(L,N);var U=L.sub(N);return U.cmpn(0)<0&&U.iadd(this.m),U._forceRed(this)},F.prototype.isub=function(L,N){this._verify2(L,N);var U=L.isub(N);return U.cmpn(0)<0&&U.iadd(this.m),U},F.prototype.shl=function(L,N){return this._verify1(L),this.imod(L.ushln(N))},F.prototype.imul=function(L,N){return this._verify2(L,N),this.imod(L.imul(N))},F.prototype.mul=function(L,N){return this._verify2(L,N),this.imod(L.mul(N))},F.prototype.isqr=function(L){return this.imul(L,L.clone())},F.prototype.sqr=function(L){return this.mul(L,L)},F.prototype.sqrt=function(L){if(L.isZero())return L.clone();var N=this.m.andln(3);if(i(N%2===1),N===3){var U=this.m.add(new s(1)).iushrn(2);return this.pow(L,U)}for(var Z=this.m.subn(1),Q=0;!Z.isZero()&&Z.andln(1)===0;)Q++,Z.iushrn(1);i(!Z.isZero());var ue=new s(1).toRed(this),oe=ue.redNeg(),le=this.m.subn(1).iushrn(1),j=this.m.bitLength();for(j=new s(2*j*j).toRed(this);this.pow(j,le).cmp(oe)!==0;)j.redIAdd(oe);for(var J=this.pow(j,Z),$=this.pow(L,Z.addn(1).iushrn(1)),X=this.pow(L,Z),re=Q;X.cmp(ue)!==0;){for(var ee=X,q=0;ee.cmp(ue)!==0;q++)ee=ee.redSqr();i(q=0;Q--){for(var J=N.words[Q],$=j-1;$>=0;$--){var X=J>>$&1;if(ue!==Z[0]&&(ue=this.sqr(ue)),X===0&&oe===0){le=0;continue}oe<<=1,oe|=X,le++,!(le!==U&&(Q!==0||$!==0))&&(ue=this.mul(ue,Z[oe]),le=0,oe=0)}j=26}return ue},F.prototype.convertTo=function(L){var N=L.umod(this.m);return N===L?N.clone():N},F.prototype.convertFrom=function(L){var N=L.clone();return N.red=null,N},s.mont=function(L){return new B(L)};function B(O){F.call(this,O),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(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)}n(B,F),B.prototype.convertTo=function(L){return this.imod(L.ushln(this.shift))},B.prototype.convertFrom=function(L){var N=this.imod(L.mul(this.rinv));return N.red=null,N},B.prototype.imul=function(L,N){if(L.isZero()||N.isZero())return L.words[0]=0,L.length=1,L;var U=L.imul(N),Z=U.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Q=U.isub(Z).iushrn(this.shift),ue=Q;return Q.cmp(this.m)>=0?ue=Q.isub(this.m):Q.cmpn(0)<0&&(ue=Q.iadd(this.m)),ue._forceRed(this)},B.prototype.mul=function(L,N){if(L.isZero()||N.isZero())return new s(0)._forceRed(this);var U=L.mul(N),Z=U.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Q=U.isub(Z).iushrn(this.shift),ue=Q;return Q.cmp(this.m)>=0?ue=Q.isub(this.m):Q.cmpn(0)<0&&(ue=Q.iadd(this.m)),ue._forceRed(this)},B.prototype.invm=function(L){var N=this.imod(L._invmp(this.m).mul(this.r2));return N._forceRed(this)}}(e,this)},6204:function(e){e.exports=t;function t(r){var o,a,i,n=r.length,s=0;for(o=0;o>>1;if(!(p<=0)){var u,g=o.mallocDouble(2*p*_),m=o.mallocInt32(_);if(_=s(y,p,g,m),_>0){if(p===1&&M)a.init(_),u=a.sweepComplete(p,S,0,_,g,m,0,_,g,m);else{var R=o.mallocDouble(2*p*w),P=o.mallocInt32(w);w=s(b,p,R,P),w>0&&(a.init(_+w),p===1?u=a.sweepBipartite(p,S,0,_,g,m,0,w,R,P):u=i(p,S,M,_,g,m,w,R,P),o.free(R),o.free(P))}o.free(g),o.free(m)}return u}}}var f;function v(y,b){f.push([y,b])}function h(y){return f=[],c(y,y,v,!0),f}function T(y,b){return f=[],c(y,b,v,!1),f}function l(y,b,S){switch(arguments.length){case 1:return h(y);case 2:return typeof b=="function"?c(y,y,b,!0):T(y,b);case 3:return c(y,b,S,!1);default:throw new Error("box-intersect: Invalid arguments")}}},2455:function(e,t){function r(){function i(c,f,v,h,T,l,y,b,S,M,_){for(var w=2*c,p=h,u=w*h;pS-b?i(c,f,v,h,T,l,y,b,S,M,_):n(c,f,v,h,T,l,y,b,S,M,_)}return s}function o(){function i(v,h,T,l,y,b,S,M,_,w,p){for(var u=2*v,g=l,m=u*l;gw-_?l?i(v,h,T,y,b,S,M,_,w,p,u):n(v,h,T,y,b,S,M,_,w,p,u):l?s(v,h,T,y,b,S,M,_,w,p,u):c(v,h,T,y,b,S,M,_,w,p,u)}return f}function a(i){return i?r():o()}t.partial=a(!1),t.full=a(!0)},7150:function(e,t,r){e.exports=O;var o=r(1888),a=r(8828),i=r(2455),n=i.partial,s=i.full,c=r(855),f=r(3545),v=r(8105),h=128,T=1<<22,l=1<<22,y=v("!(lo>=p0)&&!(p1>=hi)"),b=v("lo===p0"),S=v("lo0;){J-=1;var re=J*p,ee=m[re],q=m[re+1],ae=m[re+2],ie=m[re+3],fe=m[re+4],we=m[re+5],Ae=J*u,Fe=R[Ae],Ce=R[Ae+1],qe=we&1,et=!!(we&16),Qe=Q,Ke=ue,Xe=le,Me=j;if(qe&&(Qe=le,Ke=j,Xe=Q,Me=ue),!(we&2&&(ae=S(L,ee,q,ae,Qe,Ke,Ce),q>=ae))&&!(we&4&&(q=M(L,ee,q,ae,Qe,Ke,Fe),q>=ae))){var xe=ae-q,ce=fe-ie;if(et){if(L*xe*(xe+ce)v&&T[w+f]>M;--_,w-=y){for(var p=w,u=w+y,g=0;g>>1,M=2*c,_=S,w=T[M*S+f];y=R?(_=m,w=R):g>=z?(_=u,w=g):(_=P,w=z):R>=z?(_=m,w=R):z>=g?(_=u,w=g):(_=P,w=z);for(var O=M*(b-1),L=M*_,F=0;F=p0)&&!(p1>=hi)":f};function r(v){return t[v]}function o(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+u];if(R===S)if(p===m)p+=1,w+=M;else{for(var P=0;M>P;++P){var z=y[_+P];y[_+P]=y[w],y[w++]=z}var F=b[m];b[m]=b[p],b[p++]=F}}return p}function a(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+u];if(RP;++P){var z=y[_+P];y[_+P]=y[w],y[w++]=z}var F=b[m];b[m]=b[p],b[p++]=F}}return p}function i(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+g];if(R<=S)if(p===m)p+=1,w+=M;else{for(var P=0;M>P;++P){var z=y[_+P];y[_+P]=y[w],y[w++]=z}var F=b[m];b[m]=b[p],b[p++]=F}}return p}function n(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+g];if(R<=S)if(p===m)p+=1,w+=M;else{for(var P=0;M>P;++P){var z=y[_+P];y[_+P]=y[w],y[w++]=z}var F=b[m];b[m]=b[p],b[p++]=F}}return p}function s(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+u],P=y[_+g];if(R<=S&&S<=P)if(p===m)p+=1,w+=M;else{for(var z=0;M>z;++z){var F=y[_+z];y[_+z]=y[w],y[w++]=F}var B=b[m];b[m]=b[p],b[p++]=B}}return p}function c(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+u],P=y[_+g];if(Rz;++z){var F=y[_+z];y[_+z]=y[w],y[w++]=F}var B=b[m];b[m]=b[p],b[p++]=B}}return p}function f(v,h,T,l,y,b,S,M){for(var _=2*v,w=_*T,p=w,u=T,g=h,m=v+h,R=T;l>R;++R,w+=_){var P=y[w+g],z=y[w+m];if(!(P>=S)&&!(M>=z))if(u===R)u+=1,p+=_;else{for(var F=0;_>F;++F){var B=y[w+F];y[w+F]=y[p],y[p++]=B}var O=b[R];b[R]=b[u],b[u++]=O}}return u}},4192:function(e){e.exports=r;var t=32;function r(h,T){T<=4*t?o(0,T-1,h):v(0,T-1,h)}function o(h,T,l){for(var y=2*(h+1),b=h+1;b<=T;++b){for(var S=l[y++],M=l[y++],_=b,w=y-2;_-- >h;){var p=l[w-2],u=l[w-1];if(pl[T+1]:!0}function f(h,T,l,y){h*=2;var b=y[h];return b>1,_=M-y,w=M+y,p=b,u=_,g=M,m=w,R=S,P=h+1,z=T-1,F=0;c(p,u,l)&&(F=p,p=u,u=F),c(m,R,l)&&(F=m,m=R,R=F),c(p,g,l)&&(F=p,p=g,g=F),c(u,g,l)&&(F=u,u=g,g=F),c(p,m,l)&&(F=p,p=m,m=F),c(g,m,l)&&(F=g,g=m,m=F),c(u,R,l)&&(F=u,u=R,R=F),c(u,g,l)&&(F=u,u=g,g=F),c(m,R,l)&&(F=m,m=R,R=F);for(var B=l[2*u],O=l[2*u+1],L=l[2*m],N=l[2*m+1],U=2*p,Z=2*g,Q=2*R,ue=2*b,oe=2*M,le=2*S,j=0;j<2;++j){var J=l[U+j],$=l[Z+j],X=l[Q+j];l[ue+j]=J,l[oe+j]=$,l[le+j]=X}i(_,h,l),i(w,T,l);for(var re=P;re<=z;++re)if(f(re,B,O,l))re!==P&&a(re,P,l),++P;else if(!f(re,L,N,l))for(;;)if(f(z,L,N,l)){f(z,B,O,l)?(n(re,P,z,l),++P,--z):(a(re,z,l),--z);break}else{if(--z>>1;i(y,$);for(var X=0,re=0,oe=0;oe<$;++oe){var ee=y[2*oe+1]|0;if(ee>=n)ee=ee-n|0,S(v,h,re--,ee);else if(ee>=0)S(c,f,X--,ee);else if(ee<=-n){ee=-ee-n|0;for(var q=0;q>>1;i(y,$);for(var X=0,re=0,ee=0,oe=0;oe<$;++oe){var q=y[2*oe+1]|0,ae=q&1;if(oe<$-1&&q>>1===y[2*oe+3]>>1&&(ae=2,oe+=1),q<0){for(var ie=-(q>>1)-1,fe=0;fe>1)-1;ae===0?S(c,f,X--,ie):ae===1?S(v,h,re--,ie):ae===2&&S(T,l,ee--,ie)}}}function p(g,m,R,P,z,F,B,O,L,N,U,Z){var Q=0,ue=2*g,oe=m,le=m+g,j=1,J=1;P?J=n:j=n;for(var $=z;$>>1;i(y,q);for(var ae=0,$=0;$=n?(fe=!P,X-=n):(fe=!!P,X-=1),fe)M(c,f,ae++,X);else{var we=Z[X],Ae=ue*X,Fe=U[Ae+m+1],Ce=U[Ae+m+1+g];e:for(var qe=0;qe>>1;i(y,X);for(var re=0,le=0;le=n)c[re++]=j-n;else{j-=1;var q=U[j],ae=Q*j,ie=N[ae+m+1],fe=N[ae+m+1+g];e:for(var we=0;we=0;--we)if(c[we]===j){for(var qe=we+1;qe0;){for(var y=c.pop(),h=c.pop(),b=-1,S=-1,T=v[h],_=1;_=0||(s.flip(h,y),a(n,s,c,b,h,S),a(n,s,c,h,S,b),a(n,s,c,S,y,b),a(n,s,c,y,b,S))}}},5023:function(e,t,r){var o=r(2478);e.exports=f;function a(v,h,T,l,y,b,S){this.cells=v,this.neighbor=h,this.flags=l,this.constraint=T,this.active=y,this.next=b,this.boundary=S}var i=a.prototype;function n(v,h){return v[0]-h[0]||v[1]-h[1]||v[2]-h[2]}i.locate=function(){var v=[0,0,0];return function(h,T,l){var y=h,b=T,S=l;return T0||S.length>0;){for(;b.length>0;){var u=b.pop();if(M[u]!==-y){M[u]=y,_[u];for(var g=0;g<3;++g){var m=p[3*u+g];m>=0&&M[m]===0&&(w[3*u+g]?S.push(m):(b.push(m),M[m]=y))}}}var R=S;S=b,b=R,S.length=0,y=-y}var P=c(_,M,h);return T?P.concat(l.boundary):P}},8902:function(e,t,r){var o=r(2478),a=r(3250)[3],i=0,n=1,s=2;e.exports=S;function c(M,_,w,p,u){this.a=M,this.b=_,this.idx=w,this.lowerIds=p,this.upperIds=u}function f(M,_,w,p){this.a=M,this.b=_,this.type=w,this.idx=p}function v(M,_){var w=M.a[0]-_.a[0]||M.a[1]-_.a[1]||M.type-_.type;return w||M.type!==i&&(w=a(M.a,M.b,_.b),w)?w:M.idx-_.idx}function h(M,_){return a(M.a,M.b,_)}function T(M,_,w,p,u){for(var g=o.lt(_,p,h),m=o.gt(_,p,h),R=g;R1&&a(w[z[B-2]],w[z[B-1]],p)>0;)M.push([z[B-1],z[B-2],u]),B-=1;z.length=B,z.push(u);for(var F=P.upperIds,B=F.length;B>1&&a(w[F[B-2]],w[F[B-1]],p)<0;)M.push([F[B-2],F[B-1],u]),B-=1;F.length=B,F.push(u)}}function l(M,_){var w;return M.a[0]<_.a[0]?w=a(M.a,M.b,_.a):w=a(_.b,_.a,M.a),w||(_.b[0]P[0]&&u.push(new f(P,R,s,g),new f(R,P,n,g))}u.sort(v);for(var z=u[0].a[0]-(1+Math.abs(u[0].a[0]))*Math.pow(2,-52),F=[new c([z,1],[z,0],-1,[],[])],B=[],g=0,O=u.length;g=0}}(),i.removeTriangle=function(c,f,v){var h=this.stars;n(h[c],f,v),n(h[f],v,c),n(h[v],c,f)},i.addTriangle=function(c,f,v){var h=this.stars;h[c].push(f,v),h[f].push(v,c),h[v].push(c,f)},i.opposite=function(c,f){for(var v=this.stars[f],h=1,T=v.length;h=0;--L){var J=B[L];N=J[0];var $=z[N],X=$[0],re=$[1],ee=P[X],q=P[re];if((ee[0]-q[0]||ee[1]-q[1])<0){var ae=X;X=re,re=ae}$[0]=X;var ie=$[1]=J[1],fe;for(O&&(fe=$[2]);L>0&&B[L-1][0]===N;){var J=B[--L],we=J[1];O?z.push([ie,we,fe]):z.push([ie,we]),ie=we}O?z.push([ie,re,fe]):z.push([ie,re])}return U}function _(P,z,F){for(var B=z.length,O=new o(B),L=[],N=0;Nz[2]?1:0)}function u(P,z,F){if(P.length!==0){if(z)for(var B=0;B0||N.length>0}function R(P,z,F){var B;if(F){B=z;for(var O=new Array(z.length),L=0;LM+1)throw new Error(b+" map requires nshades to be at least size "+y.length);Array.isArray(f.alpha)?f.alpha.length!==2?_=[1,1]:_=f.alpha.slice():typeof f.alpha=="number"?_=[f.alpha,f.alpha]:_=[1,1],v=y.map(function(R){return Math.round(R.index*M)}),_[0]=Math.min(Math.max(_[0],0),1),_[1]=Math.min(Math.max(_[1],0),1);var p=y.map(function(R,P){var z=y[P].index,F=y[P].rgb.slice();return F.length===4&&F[3]>=0&&F[3]<=1||(F[3]=_[0]+(_[1]-_[0])*z),F}),u=[];for(w=0;w=0}function f(v,h,T,l){var y=o(h,T,l);if(y===0){var b=a(o(v,h,T)),S=a(o(v,h,l));if(b===S){if(b===0){var M=c(v,h,T),_=c(v,h,l);return M===_?0:M?1:-1}return 0}else{if(S===0)return b>0||c(v,h,l)?-1:1;if(b===0)return S>0||c(v,h,T)?1:-1}return a(S-b)}var w=o(v,h,T);if(w>0)return y>0&&o(v,h,l)>0?1:-1;if(w<0)return y>0||o(v,h,l)>0?1:-1;var p=o(v,h,l);return p>0||c(v,h,T)?1:-1}},8572:function(e){e.exports=function(r){return r<0?-1:r>0?1:0}},8507:function(e){e.exports=o;var t=Math.min;function r(a,i){return a-i}function o(a,i){var n=a.length,s=a.length-i.length;if(s)return s;switch(n){case 0:return 0;case 1:return a[0]-i[0];case 2:return a[0]+a[1]-i[0]-i[1]||t(a[0],a[1])-t(i[0],i[1]);case 3:var c=a[0]+a[1],f=i[0]+i[1];if(s=c+a[2]-(f+i[2]),s)return s;var v=t(a[0],a[1]),h=t(i[0],i[1]);return t(v,a[2])-t(h,i[2])||t(v+a[2],c)-t(h+i[2],f);case 4:var T=a[0],l=a[1],y=a[2],b=a[3],S=i[0],M=i[1],_=i[2],w=i[3];return T+l+y+b-(S+M+_+w)||t(T,l,y,b)-t(S,M,_,w,S)||t(T+l,T+y,T+b,l+y,l+b,y+b)-t(S+M,S+_,S+w,M+_,M+w,_+w)||t(T+l+y,T+l+b,T+y+b,l+y+b)-t(S+M+_,S+M+w,S+_+w,M+_+w);default:for(var p=a.slice().sort(r),u=i.slice().sort(r),g=0;gr[a][0]&&(a=i);return oa?[[a],[o]]:[[o]]}},4750:function(e,t,r){e.exports=a;var o=r(3090);function a(i){var n=o(i),s=n.length;if(s<=2)return[];for(var c=new Array(s),f=n[s-1],v=0;v=f[S]&&(b+=1);l[y]=b}}return c}function s(c,f){try{return o(c,!0)}catch{var v=a(c);if(v.length<=f)return[];var h=i(c,v),T=o(h,!0);return n(T,v)}}},4769:function(e){function t(o,a,i,n,s,c){var f=6*s*s-6*s,v=3*s*s-4*s+1,h=-6*s*s+6*s,T=3*s*s-2*s;if(o.length){c||(c=new Array(o.length));for(var l=o.length-1;l>=0;--l)c[l]=f*o[l]+v*a[l]+h*i[l]+T*n[l];return c}return f*o+v*a+h*i[l]+T*n}function r(o,a,i,n,s,c){var f=s-1,v=s*s,h=f*f,T=(1+2*s)*h,l=s*h,y=v*(3-2*s),b=v*f;if(o.length){c||(c=new Array(o.length));for(var S=o.length-1;S>=0;--S)c[S]=T*o[S]+l*a[S]+y*i[S]+b*n[S];return c}return T*o+l*a+y*i+b*n}e.exports=r,e.exports.derivative=t},7642:function(e,t,r){var o=r(8954),a=r(1682);e.exports=c;function i(f,v){this.point=f,this.index=v}function n(f,v){for(var h=f.point,T=v.point,l=h.length,y=0;y=2)return!1;F[O]=L}return!0}):z=z.filter(function(F){for(var B=0;B<=T;++B){var O=g[F[B]];if(O<0)return!1;F[B]=O}return!0}),T&1)for(var b=0;b>>31},e.exports.exponent=function(i){var n=e.exports.hi(i);return(n<<1>>>21)-1023},e.exports.fraction=function(i){var n=e.exports.lo(i),s=e.exports.hi(i),c=s&(1<<20)-1;return s&2146435072&&(c+=1048576),[n,c]},e.exports.denormalized=function(i){var n=e.exports.hi(i);return!(n&2146435072)}},1338:function(e){function t(a,i,n){var s=a[n]|0;if(s<=0)return[];var c=new Array(s),f;if(n===a.length-1)for(f=0;f"u"&&(i=0),typeof a){case"number":if(a>0)return r(a|0,i);break;case"object":if(typeof a.length=="number")return t(a,i,0);break}return[]}e.exports=o},3134:function(e,t,r){e.exports=a;var o=r(1682);function a(i,n){var s=i.length;if(typeof n!="number"){n=0;for(var c=0;c=T-1)for(var w=b.length-1,u=v-h[T-1],p=0;p=T-1){var _=b.length-1;v-h[T-1];for(var w=0;w=0;--T)if(v[--h])return!1;return!0},s.jump=function(v){var h=this.lastT(),T=this.dimension;if(!(v0;--p)l.push(i(M[p-1],_[p-1],arguments[p])),y.push(0)}},s.push=function(v){var h=this.lastT(),T=this.dimension;if(!(v1e-6?1/S:0;this._time.push(v);for(var u=T;u>0;--u){var g=i(_[u-1],w[u-1],arguments[u]);l.push(g),y.push((g-l[b++])*p)}}},s.set=function(v){var h=this.dimension;if(!(v0;--M)T.push(i(b[M-1],S[M-1],arguments[M])),l.push(0)}},s.move=function(v){var h=this.lastT(),T=this.dimension;if(!(v<=h||arguments.length!==T+1)){var l=this._state,y=this._velocity,b=l.length-this.dimension,S=this.bounds,M=S[0],_=S[1],w=v-h,p=w>1e-6?1/w:0;this._time.push(v);for(var u=T;u>0;--u){var g=arguments[u];l.push(i(M[u-1],_[u-1],l[b++]+g)),y.push(g*p)}}},s.idle=function(v){var h=this.lastT();if(!(v=0;--p)l.push(i(M[p],_[p],l[b]+w*y[b])),y.push(0),b+=1}};function c(v){for(var h=new Array(v),T=0;T=0;--P){var u=g[P];m[P]<=0?g[P]=new o(u._color,u.key,u.value,g[P+1],u.right,u._count+1):g[P]=new o(u._color,u.key,u.value,u.left,g[P+1],u._count+1)}for(var P=g.length-1;P>1;--P){var z=g[P-1],u=g[P];if(z._color===r||u._color===r)break;var F=g[P-2];if(F.left===z)if(z.left===u){var B=F.right;if(B&&B._color===t)z._color=r,F.right=i(r,B),F._color=t,P-=1;else{if(F._color=t,F.left=z.right,z._color=r,z.right=F,g[P-2]=z,g[P-1]=u,n(F),n(z),P>=3){var O=g[P-3];O.left===F?O.left=z:O.right=z}break}}else{var B=F.right;if(B&&B._color===t)z._color=r,F.right=i(r,B),F._color=t,P-=1;else{if(z.right=u.left,F._color=t,F.left=u.right,u._color=r,u.left=z,u.right=F,g[P-2]=u,g[P-1]=z,n(F),n(z),n(u),P>=3){var O=g[P-3];O.left===F?O.left=u:O.right=u}break}}else if(z.right===u){var B=F.left;if(B&&B._color===t)z._color=r,F.left=i(r,B),F._color=t,P-=1;else{if(F._color=t,F.right=z.left,z._color=r,z.left=F,g[P-2]=z,g[P-1]=u,n(F),n(z),P>=3){var O=g[P-3];O.right===F?O.right=z:O.left=z}break}}else{var B=F.left;if(B&&B._color===t)z._color=r,F.left=i(r,B),F._color=t,P-=1;else{if(z.left=u.right,F._color=t,F.right=u.left,u._color=r,u.right=z,u.left=F,g[P-2]=u,g[P-1]=z,n(F),n(z),n(u),P>=3){var O=g[P-3];O.right===F?O.right=u:O.left=u}break}}}return g[0]._color=r,new s(p,g[0])};function f(_,w){if(w.left){var p=f(_,w.left);if(p)return p}var p=_(w.key,w.value);if(p)return p;if(w.right)return f(_,w.right)}function v(_,w,p,u){var g=w(_,u.key);if(g<=0){if(u.left){var m=v(_,w,p,u.left);if(m)return m}var m=p(u.key,u.value);if(m)return m}if(u.right)return v(_,w,p,u.right)}function h(_,w,p,u,g){var m=p(_,g.key),R=p(w,g.key),P;if(m<=0&&(g.left&&(P=h(_,w,p,u,g.left),P)||R>0&&(P=u(g.key,g.value),P)))return P;if(R>0&&g.right)return h(_,w,p,u,g.right)}c.forEach=function(w,p,u){if(this.root)switch(arguments.length){case 1:return f(w,this.root);case 2:return v(p,this._compare,w,this.root);case 3:return this._compare(p,u)>=0?void 0:h(p,u,this._compare,w,this.root)}},Object.defineProperty(c,"begin",{get:function(){for(var _=[],w=this.root;w;)_.push(w),w=w.left;return new T(this,_)}}),Object.defineProperty(c,"end",{get:function(){for(var _=[],w=this.root;w;)_.push(w),w=w.right;return new T(this,_)}}),c.at=function(_){if(_<0)return new T(this,[]);for(var w=this.root,p=[];;){if(p.push(w),w.left){if(_=w.right._count)break;w=w.right}else break}return new T(this,[])},c.ge=function(_){for(var w=this._compare,p=this.root,u=[],g=0;p;){var m=w(_,p.key);u.push(p),m<=0&&(g=u.length),m<=0?p=p.left:p=p.right}return u.length=g,new T(this,u)},c.gt=function(_){for(var w=this._compare,p=this.root,u=[],g=0;p;){var m=w(_,p.key);u.push(p),m<0&&(g=u.length),m<0?p=p.left:p=p.right}return u.length=g,new T(this,u)},c.lt=function(_){for(var w=this._compare,p=this.root,u=[],g=0;p;){var m=w(_,p.key);u.push(p),m>0&&(g=u.length),m<=0?p=p.left:p=p.right}return u.length=g,new T(this,u)},c.le=function(_){for(var w=this._compare,p=this.root,u=[],g=0;p;){var m=w(_,p.key);u.push(p),m>=0&&(g=u.length),m<0?p=p.left:p=p.right}return u.length=g,new T(this,u)},c.find=function(_){for(var w=this._compare,p=this.root,u=[];p;){var g=w(_,p.key);if(u.push(p),g===0)return new T(this,u);g<=0?p=p.left:p=p.right}return new T(this,[])},c.remove=function(_){var w=this.find(_);return w?w.remove():this},c.get=function(_){for(var w=this._compare,p=this.root;p;){var u=w(_,p.key);if(u===0)return p.value;u<=0?p=p.left:p=p.right}};function T(_,w){this.tree=_,this._stack=w}var l=T.prototype;Object.defineProperty(l,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(l,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),l.clone=function(){return new T(this.tree,this._stack.slice())};function y(_,w){_.key=w.key,_.value=w.value,_.left=w.left,_.right=w.right,_._color=w._color,_._count=w._count}function b(_){for(var w,p,u,g,m=_.length-1;m>=0;--m){if(w=_[m],m===0){w._color=r;return}if(p=_[m-1],p.left===w){if(u=p.right,u.right&&u.right._color===t){if(u=p.right=a(u),g=u.right=a(u.right),p.right=u.left,u.left=p,u.right=g,u._color=p._color,w._color=r,p._color=r,g._color=r,n(p),n(u),m>1){var R=_[m-2];R.left===p?R.left=u:R.right=u}_[m-1]=u;return}else if(u.left&&u.left._color===t){if(u=p.right=a(u),g=u.left=a(u.left),p.right=g.left,u.left=g.right,g.left=p,g.right=u,g._color=p._color,p._color=r,u._color=r,w._color=r,n(p),n(u),n(g),m>1){var R=_[m-2];R.left===p?R.left=g:R.right=g}_[m-1]=g;return}if(u._color===r)if(p._color===t){p._color=r,p.right=i(t,u);return}else{p.right=i(t,u);continue}else{if(u=a(u),p.right=u.left,u.left=p,u._color=p._color,p._color=t,n(p),n(u),m>1){var R=_[m-2];R.left===p?R.left=u:R.right=u}_[m-1]=u,_[m]=p,m+1<_.length?_[m+1]=w:_.push(w),m=m+2}}else{if(u=p.left,u.left&&u.left._color===t){if(u=p.left=a(u),g=u.left=a(u.left),p.left=u.right,u.right=p,u.left=g,u._color=p._color,w._color=r,p._color=r,g._color=r,n(p),n(u),m>1){var R=_[m-2];R.right===p?R.right=u:R.left=u}_[m-1]=u;return}else if(u.right&&u.right._color===t){if(u=p.left=a(u),g=u.right=a(u.right),p.left=g.right,u.right=g.left,g.right=p,g.left=u,g._color=p._color,p._color=r,u._color=r,w._color=r,n(p),n(u),n(g),m>1){var R=_[m-2];R.right===p?R.right=g:R.left=g}_[m-1]=g;return}if(u._color===r)if(p._color===t){p._color=r,p.left=i(t,u);return}else{p.left=i(t,u);continue}else{if(u=a(u),p.left=u.right,u.right=p,u._color=p._color,p._color=t,n(p),n(u),m>1){var R=_[m-2];R.right===p?R.right=u:R.left=u}_[m-1]=u,_[m]=p,m+1<_.length?_[m+1]=w:_.push(w),m=m+2}}}}l.remove=function(){var _=this._stack;if(_.length===0)return this.tree;var w=new Array(_.length),p=_[_.length-1];w[w.length-1]=new o(p._color,p.key,p.value,p.left,p.right,p._count);for(var u=_.length-2;u>=0;--u){var p=_[u];p.left===_[u+1]?w[u]=new o(p._color,p.key,p.value,w[u+1],p.right,p._count):w[u]=new o(p._color,p.key,p.value,p.left,w[u+1],p._count)}if(p=w[w.length-1],p.left&&p.right){var g=w.length;for(p=p.left;p.right;)w.push(p),p=p.right;var m=w[g-1];w.push(new o(p._color,m.key,m.value,p.left,p.right,p._count)),w[g-1].key=p.key,w[g-1].value=p.value;for(var u=w.length-2;u>=g;--u)p=w[u],w[u]=new o(p._color,p.key,p.value,p.left,w[u+1],p._count);w[g-1].left=w[g]}if(p=w[w.length-1],p._color===t){var R=w[w.length-2];R.left===p?R.left=null:R.right===p&&(R.right=null),w.pop();for(var u=0;u0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(l,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(l,"index",{get:function(){var _=0,w=this._stack;if(w.length===0){var p=this.tree.root;return p?p._count:0}else w[w.length-1].left&&(_=w[w.length-1].left._count);for(var u=w.length-2;u>=0;--u)w[u+1]===w[u].right&&(++_,w[u].left&&(_+=w[u].left._count));return _},enumerable:!0}),l.next=function(){var _=this._stack;if(_.length!==0){var w=_[_.length-1];if(w.right)for(w=w.right;w;)_.push(w),w=w.left;else for(_.pop();_.length>0&&_[_.length-1].right===w;)w=_[_.length-1],_.pop()}},Object.defineProperty(l,"hasNext",{get:function(){var _=this._stack;if(_.length===0)return!1;if(_[_.length-1].right)return!0;for(var w=_.length-1;w>0;--w)if(_[w-1].left===_[w])return!0;return!1}}),l.update=function(_){var w=this._stack;if(w.length===0)throw new Error("Can't update empty node!");var p=new Array(w.length),u=w[w.length-1];p[p.length-1]=new o(u._color,u.key,_,u.left,u.right,u._count);for(var g=w.length-2;g>=0;--g)u=w[g],u.left===w[g+1]?p[g]=new o(u._color,u.key,u.value,p[g+1],u.right,u._count):p[g]=new o(u._color,u.key,u.value,u.left,p[g+1],u._count);return new s(this.tree._compare,p[0])},l.prev=function(){var _=this._stack;if(_.length!==0){var w=_[_.length-1];if(w.left)for(w=w.left;w;)_.push(w),w=w.right;else for(_.pop();_.length>0&&_[_.length-1].left===w;)w=_[_.length-1],_.pop()}},Object.defineProperty(l,"hasPrev",{get:function(){var _=this._stack;if(_.length===0)return!1;if(_[_.length-1].left)return!0;for(var w=_.length-1;w>0;--w)if(_[w-1].right===_[w])return!0;return!1}});function S(_,w){return _w?1:0}function M(_){return new s(_||S,null)}},3837:function(e,t,r){e.exports=P;var o=r(4935),a=r(501),i=r(5304),n=r(6429),s=r(6444),c=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),f=ArrayBuffer,v=DataView;function h(z){return f.isView(z)&&!(z instanceof v)}function T(z){return Array.isArray(z)||h(z)}function l(z,F){return z[0]=F[0],z[1]=F[1],z[2]=F[2],z}function y(z){this.gl=z,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=i(z)}var b=y.prototype;b.update=function(z){z=z||{};function F(X,re,ee){if(ee in z){var q=z[ee],ae=this[ee],ie;(X?T(q)&&T(q[0]):T(q))?this[ee]=ie=[re(q[0]),re(q[1]),re(q[2])]:this[ee]=ie=[re(q),re(q),re(q)];for(var fe=0;fe<3;++fe)if(ie[fe]!==ae[fe])return!0}return!1}var B=F.bind(this,!1,Number),O=F.bind(this,!1,Boolean),L=F.bind(this,!1,String),N=F.bind(this,!0,function(X){if(T(X)){if(X.length===3)return[+X[0],+X[1],+X[2],1];if(X.length===4)return[+X[0],+X[1],+X[2],+X[3]]}return[0,0,0,1]}),U,Z=!1,Q=!1;if("bounds"in z)for(var ue=z.bounds,oe=0;oe<2;++oe)for(var le=0;le<3;++le)ue[oe][le]!==this.bounds[oe][le]&&(Q=!0),this.bounds[oe][le]=ue[oe][le];if("ticks"in z){U=z.ticks,Z=!0,this.autoTicks=!1;for(var oe=0;oe<3;++oe)this.tickSpacing[oe]=0}else B("tickSpacing")&&(this.autoTicks=!0,Q=!0);if(this._firstInit&&("ticks"in z||"tickSpacing"in z||(this.autoTicks=!0),Q=!0,Z=!0,this._firstInit=!1),Q&&this.autoTicks&&(U=s.create(this.bounds,this.tickSpacing),Z=!0),Z){for(var oe=0;oe<3;++oe)U[oe].sort(function(re,ee){return re.x-ee.x});s.equal(U,this.ticks)?Z=!1:this.ticks=U}O("tickEnable"),L("tickFont")&&(Z=!0),L("tickFontStyle")&&(Z=!0),L("tickFontWeight")&&(Z=!0),L("tickFontVariant")&&(Z=!0),B("tickSize"),B("tickAngle"),B("tickPad"),N("tickColor");var j=L("labels");L("labelFont")&&(j=!0),L("labelFontStyle")&&(j=!0),L("labelFontWeight")&&(j=!0),L("labelFontVariant")&&(j=!0),O("labelEnable"),B("labelSize"),B("labelPad"),N("labelColor"),O("lineEnable"),O("lineMirror"),B("lineWidth"),N("lineColor"),O("lineTickEnable"),O("lineTickMirror"),B("lineTickLength"),B("lineTickWidth"),N("lineTickColor"),O("gridEnable"),B("gridWidth"),N("gridColor"),O("zeroEnable"),N("zeroLineColor"),B("zeroLineWidth"),O("backgroundEnable"),N("backgroundColor");var J=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],$=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(j||Z)&&this._text.update(this.bounds,this.labels,J,this.ticks,$):this._text=o(this.gl,this.bounds,this.labels,J,this.ticks,$),this._lines&&Z&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=a(this.gl,this.bounds,this.ticks))};function S(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var M=[new S,new S,new S];function _(z,F,B,O,L){for(var N=z.primalOffset,U=z.primalMinor,Z=z.mirrorOffset,Q=z.mirrorMinor,ue=O[F],oe=0;oe<3;++oe)if(F!==oe){var le=N,j=Z,J=U,$=Q;ue&1<0?(J[oe]=-1,$[oe]=0):(J[oe]=0,$[oe]=1)}}var w=[0,0,0],p={model:c,view:c,projection:c,_ortho:!1};b.isOpaque=function(){return!0},b.isTransparent=function(){return!1},b.drawTransparent=function(z){};var u=0,g=[0,0,0],m=[0,0,0],R=[0,0,0];b.draw=function(z){z=z||p;for(var ee=this.gl,F=z.model||c,B=z.view||c,O=z.projection||c,L=this.bounds,N=z._ortho||!1,U=n(F,B,O,L,N),Z=U.cubeEdges,Q=U.axis,ue=B[12],oe=B[13],le=B[14],j=B[15],J=N?2:1,$=J*this.pixelRatio*(O[3]*ue+O[7]*oe+O[11]*le+O[15]*j)/ee.drawingBufferHeight,X=0;X<3;++X)this.lastCubeProps.cubeEdges[X]=Z[X],this.lastCubeProps.axis[X]=Q[X];for(var re=M,X=0;X<3;++X)_(M[X],X,this.bounds,Z,Q);for(var ee=this.gl,q=w,X=0;X<3;++X)this.backgroundEnable[X]?q[X]=Q[X]:q[X]=0;this._background.draw(F,B,O,L,q,this.backgroundColor),this._lines.bind(F,B,O,this);for(var X=0;X<3;++X){var ae=[0,0,0];Q[X]>0?ae[X]=L[1][X]:ae[X]=L[0][X];for(var ie=0;ie<2;++ie){var fe=(X+1+ie)%3,we=(X+1+(ie^1))%3;this.gridEnable[fe]&&this._lines.drawGrid(fe,we,this.bounds,ae,this.gridColor[fe],this.gridWidth[fe]*this.pixelRatio)}for(var ie=0;ie<2;++ie){var fe=(X+1+ie)%3,we=(X+1+(ie^1))%3;this.zeroEnable[we]&&Math.min(L[0][we],L[1][we])<=0&&Math.max(L[0][we],L[1][we])>=0&&this._lines.drawZero(fe,we,this.bounds,ae,this.zeroLineColor[we],this.zeroLineWidth[we]*this.pixelRatio)}}for(var X=0;X<3;++X){this.lineEnable[X]&&this._lines.drawAxisLine(X,this.bounds,re[X].primalOffset,this.lineColor[X],this.lineWidth[X]*this.pixelRatio),this.lineMirror[X]&&this._lines.drawAxisLine(X,this.bounds,re[X].mirrorOffset,this.lineColor[X],this.lineWidth[X]*this.pixelRatio);for(var Ae=l(g,re[X].primalMinor),Fe=l(m,re[X].mirrorMinor),Ce=this.lineTickLength,ie=0;ie<3;++ie){var qe=$/F[5*ie];Ae[ie]*=Ce[ie]*qe,Fe[ie]*=Ce[ie]*qe}this.lineTickEnable[X]&&this._lines.drawAxisTicks(X,re[X].primalOffset,Ae,this.lineTickColor[X],this.lineTickWidth[X]*this.pixelRatio),this.lineTickMirror[X]&&this._lines.drawAxisTicks(X,re[X].mirrorOffset,Fe,this.lineTickColor[X],this.lineTickWidth[X]*this.pixelRatio)}this._lines.unbind(),this._text.bind(F,B,O,this.pixelRatio);var et,Qe=.5,Ke,Xe;function Me(Je){Xe=[0,0,0],Xe[Je]=1}function xe(Je,At,St){var Rt=(Je+1)%3,Ut=(Je+2)%3,ir=At[Rt],ar=At[Ut],Mr=St[Rt],fr=St[Ut];if(ir>0&&fr>0){Me(Rt);return}else if(ir>0&&fr<0){Me(Rt);return}else if(ir<0&&fr>0){Me(Rt);return}else if(ir<0&&fr<0){Me(Rt);return}else if(ar>0&&Mr>0){Me(Ut);return}else if(ar>0&&Mr<0){Me(Ut);return}else if(ar<0&&Mr>0){Me(Ut);return}else if(ar<0&&Mr<0){Me(Ut);return}}for(var X=0;X<3;++X){for(var ce=re[X].primalMinor,Re=re[X].mirrorMinor,$e=l(R,re[X].primalOffset),ie=0;ie<3;++ie)this.lineTickEnable[X]&&($e[ie]+=$*ce[ie]*Math.max(this.lineTickLength[ie],0)/F[5*ie]);var rt=[0,0,0];if(rt[X]=1,this.tickEnable[X]){this.tickAngle[X]===-3600?(this.tickAngle[X]=0,this.tickAlign[X]="auto"):this.tickAlign[X]=-1,Ke=1,et=[this.tickAlign[X],Qe,Ke],et[0]==="auto"?et[0]=u:et[0]=parseInt(""+et[0]),Xe=[0,0,0],xe(X,ce,Re);for(var ie=0;ie<3;++ie)$e[ie]+=$*ce[ie]*this.tickPad[ie]/F[5*ie];this._text.drawTicks(X,this.tickSize[X],this.tickAngle[X],$e,this.tickColor[X],rt,Xe,et)}if(this.labelEnable[X]){Ke=0,Xe=[0,0,0],this.labels[X].length>4&&(Me(X),Ke=1),et=[this.labelAlign[X],Qe,Ke],et[0]==="auto"?et[0]=u:et[0]=parseInt(""+et[0]);for(var ie=0;ie<3;++ie)$e[ie]+=$*ce[ie]*this.labelPad[ie]/F[5*ie];$e[X]+=.5*(L[0][X]+L[1][X]),this._text.drawLabel(X,this.labelSize[X],this.labelAngle[X],$e,this.labelColor[X],[0,0,0],Xe,et)}}this._text.unbind()},b.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function P(z,F){var B=new y(z);return B.update(F),B}},5304:function(e,t,r){e.exports=c;var o=r(2762),a=r(8116),i=r(1879).bg;function n(f,v,h,T){this.gl=f,this.buffer=v,this.vao=h,this.shader=T}var s=n.prototype;s.draw=function(f,v,h,T,l,y){for(var b=!1,S=0;S<3;++S)b=b||l[S];if(b){var M=this.gl;M.enable(M.POLYGON_OFFSET_FILL),M.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:f,view:v,projection:h,bounds:T,enable:l,colors:y},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),M.disable(M.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function c(f){for(var v=[],h=[],T=0,l=0;l<3;++l)for(var y=(l+1)%3,b=(l+2)%3,S=[0,0,0],M=[0,0,0],_=-1;_<=1;_+=2){h.push(T,T+2,T+1,T+1,T+2,T+3),S[l]=_,M[l]=_;for(var w=-1;w<=1;w+=2){S[y]=w;for(var p=-1;p<=1;p+=2)S[b]=p,v.push(S[0],S[1],S[2],M[0],M[1],M[2]),T+=1}var u=y;y=b,b=u}var g=o(f,new Float32Array(v)),m=o(f,new Uint16Array(h),f.ELEMENT_ARRAY_BUFFER),R=a(f,[{buffer:g,type:f.FLOAT,size:3,offset:0,stride:24},{buffer:g,type:f.FLOAT,size:3,offset:12,stride:24}],m),P=i(f);return P.attributes.position.location=0,P.attributes.normal.location=1,new n(f,g,R,P)}},6429:function(e,t,r){e.exports=_;var o=r(8828),a=r(6760),i=r(5202),n=r(3250),s=new Array(16),c=new Array(8),f=new Array(8),v=new Array(3),h=[0,0,0];(function(){for(var w=0;w<8;++w)c[w]=[1,1,1,1],f[w]=[1,1,1]})();function T(w,p,u){for(var g=0;g<4;++g){w[g]=u[12+g];for(var m=0;m<3;++m)w[g]+=p[m]*u[4*m+g]}}var l=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]];function y(w){for(var p=0;pQ&&(B|=1<Q){B|=1<f[P][1])&&(re=P);for(var ee=-1,P=0;P<3;++P){var q=re^1<f[ae][0]&&(ae=q)}}var ie=b;ie[0]=ie[1]=ie[2]=0,ie[o.log2(ee^re)]=re&ee,ie[o.log2(re^ae)]=re&ae;var fe=ae^7;fe===B||fe===X?(fe=ee^7,ie[o.log2(ae^fe)]=fe&ae):ie[o.log2(ee^fe)]=feⅇfor(var we=S,Ae=B,N=0;N<3;++N)Ae&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); +} +`]),c=o([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 color; +void main() { + gl_FragColor = color; +}`]);t.Q=function(h){return a(h,s,c,null,[{name:"position",type:"vec3"}])};var f=o([`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); +} +`]),v=o([`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]; +}`]);t.bg=function(h){return a(h,f,v,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(e,t,r){e.exports=y;var o=r(2762),a=r(8116),i=r(4359),n=r(1879).Q,s=window||process.global||{},c=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var f=3;function v(b,S,M,_){this.gl=b,this.shader=S,this.buffer=M,this.vao=_,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var h=v.prototype,T=[0,0];h.bind=function(b,S,M,_){this.vao.bind(),this.shader.bind();var w=this.shader.uniforms;w.model=b,w.view=S,w.projection=M,w.pixelScale=_,T[0]=this.gl.drawingBufferWidth,T[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=T},h.unbind=function(){this.vao.unbind()},h.update=function(b,S,M,_,w){var p=[];function u(N,U,Z,Q,ue,oe){var le=[Z.style,Z.weight,Z.variant,Z.family].join("_"),j=c[le];j||(j=c[le]={});var J=j[U];J||(J=j[U]=l(U,{triangles:!0,font:Z.family,fontStyle:Z.style,fontWeight:Z.weight,fontVariant:Z.variant,textAlign:"center",textBaseline:"middle",lineSpacing:ue,styletags:oe}));for(var $=(Q||12)/12,X=J.positions,re=J.cells,ee=0,q=re.length;ee=0;--ie){var fe=X[ae[ie]];p.push($*fe[0],-$*fe[1],N)}}for(var g=[0,0,0],m=[0,0,0],R=[0,0,0],P=[0,0,0],z=1.25,F={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},B=0;B<3;++B){R[B]=p.length/f|0,u(.5*(b[0][B]+b[1][B]),S[B],M[B],12,z,F),P[B]=(p.length/f|0)-R[B],g[B]=p.length/f|0;for(var O=0;O<_[B].length;++O)if(_[B][O].text){var L={family:_[B][O].font||w[B].family,style:w[B].fontStyle||w[B].style,weight:w[B].fontWeight||w[B].weight,variant:w[B].fontVariant||w[B].variant};u(_[B][O].x,_[B][O].text,L,_[B][O].fontSize||12,z,F)}m[B]=(p.length/f|0)-g[B]}this.buffer.update(p),this.tickOffset=g,this.tickCount=m,this.labelOffset=R,this.labelCount=P},h.drawTicks=function(b,S,M,_,w,p,u,g){this.tickCount[b]&&(this.shader.uniforms.axis=p,this.shader.uniforms.color=w,this.shader.uniforms.angle=M,this.shader.uniforms.scale=S,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=g,this.vao.draw(this.gl.TRIANGLES,this.tickCount[b],this.tickOffset[b]))},h.drawLabel=function(b,S,M,_,w,p,u,g){this.labelCount[b]&&(this.shader.uniforms.axis=p,this.shader.uniforms.color=w,this.shader.uniforms.angle=M,this.shader.uniforms.scale=S,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=g,this.vao.draw(this.gl.TRIANGLES,this.labelCount[b],this.labelOffset[b]))},h.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()};function l(b,S){try{return i(b,S)}catch(M){return console.warn('error vectorizing text:"'+b+'" error:',M),{cells:[],positions:[]}}}function y(b,S,M,_,w,p){var u=o(b),g=a(b,[{buffer:u,size:3}]),m=n(b);m.attributes.position.location=0;var R=new v(b,m,u,g);return R.update(S,M,_,w,p),R}},6444:function(e,t){t.create=o,t.equal=a;function r(i,n){var s=i+"",c=s.indexOf("."),f=0;c>=0&&(f=s.length-c-1);var v=Math.pow(10,f),h=Math.round(i*n*v),T=h+"";if(T.indexOf("e")>=0)return T;var l=h/v,y=h%v;h<0?(l=-Math.ceil(l)|0,y=-y|0):(l=Math.floor(l)|0,y=y|0);var b=""+l;if(h<0&&(b="-"+b),f){for(var S=""+y;S.length=i[0][c];--v)f.push({x:v*n[c],text:r(n[c],v)});s.push(f)}return s}function a(i,n){for(var s=0;s<3;++s){if(i[s].length!==n[s].length)return!1;for(var c=0;cb)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return l.bufferSubData(y,_,M),b}function v(l,y){for(var b=o.malloc(l.length,y),S=l.length,M=0;M=0;--S){if(y[S]!==b)return!1;b*=l[S]}return!0}c.update=function(l,y){if(typeof y!="number"&&(y=-1),this.bind(),typeof l=="object"&&typeof l.shape<"u"){var b=l.dtype;if(n.indexOf(b)<0&&(b="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var S=gl.getExtension("OES_element_index_uint");S&&b!=="uint16"?b="uint32":b="uint16"}if(b===l.dtype&&h(l.shape,l.stride))l.offset===0&&l.data.length===l.shape[0]?this.length=f(this.gl,this.type,this.length,this.usage,l.data,y):this.length=f(this.gl,this.type,this.length,this.usage,l.data.subarray(l.offset,l.shape[0]),y);else{var M=o.malloc(l.size,b),_=i(M,l.shape);a.assign(_,l),y<0?this.length=f(this.gl,this.type,this.length,this.usage,M,y):this.length=f(this.gl,this.type,this.length,this.usage,M.subarray(0,l.size),y),o.free(M)}}else if(Array.isArray(l)){var w;this.type===this.gl.ELEMENT_ARRAY_BUFFER?w=v(l,"uint16"):w=v(l,"float32"),y<0?this.length=f(this.gl,this.type,this.length,this.usage,w,y):this.length=f(this.gl,this.type,this.length,this.usage,w.subarray(0,l.length),y),o.free(w)}else if(typeof l=="object"&&typeof l.length=="number")this.length=f(this.gl,this.type,this.length,this.usage,l,y);else if(typeof l=="number"||l===void 0){if(y>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");l=l|0,l<=0&&(l=1),this.gl.bufferData(this.type,l|0,this.usage),this.length=l}else throw new Error("gl-buffer: Invalid data type")};function T(l,y,b,S){if(b=b||l.ARRAY_BUFFER,S=S||l.DYNAMIC_DRAW,b!==l.ARRAY_BUFFER&&b!==l.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(S!==l.DYNAMIC_DRAW&&S!==l.STATIC_DRAW&&S!==l.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 M=l.createBuffer(),_=new s(l,b,M,0,S);return _.update(y),_}e.exports=T},6405:function(e,t,r){var o=r(2931);e.exports=function(i,n){var s=i.positions,c=i.vectors,f={positions:[],vertexIntensity:[],vertexIntensityBounds:i.vertexIntensityBounds,vectors:[],cells:[],coneOffset:i.coneOffset,colormap:i.colormap};if(i.positions.length===0)return n&&(n[0]=[0,0,0],n[1]=[0,0,0]),f;for(var v=0,h=1/0,T=-1/0,l=1/0,y=-1/0,b=1/0,S=-1/0,M=null,_=null,w=[],p=1/0,u=!1,g=i.coneSizemode==="raw",m=0;mv&&(v=o.length(P)),m&&!g){var z=2*o.distance(M,R)/(o.length(_)+o.length(P));z?(p=Math.min(p,z),u=!1):u=!0}u||(M=R,_=P),w.push(P)}var F=[h,l,b],B=[T,y,S];n&&(n[0]=F,n[1]=B),v===0&&(v=1);var O=1/v;isFinite(p)||(p=1),f.vectorScale=p;var L=i.coneSize||(g?1:.5);i.absoluteConeSize&&(L=i.absoluteConeSize*O),f.coneScale=L;for(var m=0,N=0;m=1},l.isTransparent=function(){return this.opacity<1},l.pickSlots=1,l.setPickBase=function(w){this.pickId=w};function y(w){for(var p=v({colormap:w,nshades:256,format:"rgba"}),u=new Uint8Array(256*4),g=0;g<256;++g){for(var m=p[g],R=0;R<3;++R)u[4*g+R]=m[R];u[4*g+3]=m[3]*255}return f(u,[256,256,4],[4,0,1])}function b(w){for(var p=w.length,u=new Array(p),g=0;g0){var N=this.triShader;N.bind(),N.uniforms=z,this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},l.drawPick=function(w){w=w||{};for(var p=this.gl,u=w.model||h,g=w.view||h,m=w.projection||h,R=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],P=0;P<3;++P)R[0][P]=Math.max(R[0][P],this.clipBounds[0][P]),R[1][P]=Math.min(R[1][P],this.clipBounds[1][P]);this._model=[].slice.call(u),this._view=[].slice.call(g),this._projection=[].slice.call(m),this._resolution=[p.drawingBufferWidth,p.drawingBufferHeight];var z={model:u,view:g,projection:m,clipBounds:R,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},F=this.pickShader;F.bind(),F.uniforms=z,this.triangleCount>0&&(this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},l.pick=function(w){if(!w||w.id!==this.pickId)return null;var p=w.value[0]+256*w.value[1]+65536*w.value[2],u=this.cells[p],g=this.positions[u[1]].slice(0,3),m={position:g,dataCoordinate:g,index:Math.floor(u[1]/48)};return this.traceType==="cone"?m.index=Math.floor(u[1]/48):this.traceType==="streamtube"&&(m.intensity=this.intensity[u[1]],m.velocity=this.vectors[u[1]].slice(0,3),m.divergence=this.vectors[u[1]][3],m.index=p),m},l.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()};function S(w,p){var u=o(w,p.meshShader.vertex,p.meshShader.fragment,null,p.meshShader.attributes);return u.attributes.position.location=0,u.attributes.color.location=2,u.attributes.uv.location=3,u.attributes.vector.location=4,u}function M(w,p){var u=o(w,p.pickShader.vertex,p.pickShader.fragment,null,p.pickShader.attributes);return u.attributes.position.location=0,u.attributes.id.location=1,u.attributes.vector.location=4,u}function _(w,p,u){var g=u.shaders;arguments.length===1&&(p=w,w=p.gl);var m=S(w,g),R=M(w,g),P=n(w,f(new Uint8Array([255,255,255,255]),[1,1,4]));P.generateMipmap(),P.minFilter=w.LINEAR_MIPMAP_LINEAR,P.magFilter=w.LINEAR;var z=a(w),F=a(w),B=a(w),O=a(w),L=a(w),N=i(w,[{buffer:z,type:w.FLOAT,size:4},{buffer:L,type:w.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:B,type:w.FLOAT,size:4},{buffer:O,type:w.FLOAT,size:2},{buffer:F,type:w.FLOAT,size:4}]),U=new T(w,P,m,R,z,F,L,B,O,N,u.traceType||"cone");return U.update(p),U}e.exports=_},614:function(e,t,r){var o=r(3236),a=o([`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; +} +`]),i=o([`#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; +} +`]),n=o([`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; +} +`]),s=o([`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); +}`]);t.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:n,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(e){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171:function(e,t,r){var o=r(737);e.exports=function(i){return o[i]}},9165:function(e,t,r){e.exports=T;var o=r(2762),a=r(8116),i=r(3436),n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,y,b,S){this.gl=l,this.shader=S,this.buffer=y,this.vao=b,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 c=s.prototype;c.isOpaque=function(){return!this.hasAlpha},c.isTransparent=function(){return this.hasAlpha},c.drawTransparent=c.draw=function(l){var y=this.gl,b=this.shader.uniforms;this.shader.bind();var S=b.view=l.view||n,M=b.projection=l.projection||n;b.model=l.model||n,b.clipBounds=this.clipBounds,b.opacity=this.opacity;var _=S[12],w=S[13],p=S[14],u=S[15],g=l._ortho||!1,m=g?2:1,R=m*this.pixelRatio*(M[3]*_+M[7]*w+M[11]*p+M[15]*u)/y.drawingBufferHeight;this.vao.bind();for(var P=0;P<3;++P)y.lineWidth(this.lineWidth[P]*this.pixelRatio),b.capSize=this.capSize[P]*R,this.lineCount[P]&&y.drawArrays(y.LINES,this.lineOffset[P],this.lineCount[P]);this.vao.unbind()};function f(l,y){for(var b=0;b<3;++b)l[0][b]=Math.min(l[0][b],y[b]),l[1][b]=Math.max(l[1][b],y[b])}var v=function(){for(var l=new Array(3),y=0;y<3;++y){for(var b=[],S=1;S<=2;++S)for(var M=-1;M<=1;M+=2){var _=(S+y)%3,w=[0,0,0];w[_]=M,b.push(w)}l[y]=b}return l}();function h(l,y,b,S){for(var M=v[S],_=0;_0){var z=g.slice();z[p]+=R[1][p],M.push(g[0],g[1],g[2],P[0],P[1],P[2],P[3],0,0,0,z[0],z[1],z[2],P[0],P[1],P[2],P[3],0,0,0),f(this.bounds,z),w+=2+h(M,z,P,p)}}}this.lineCount[p]=w-this.lineOffset[p]}this.buffer.update(M)}},c.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function T(l){var y=l.gl,b=o(y),S=a(y,[{buffer:b,type:y.FLOAT,size:3,offset:0,stride:40},{buffer:b,type:y.FLOAT,size:4,offset:12,stride:40},{buffer:b,type:y.FLOAT,size:3,offset:28,stride:40}]),M=i(y);M.attributes.position.location=0,M.attributes.color.location=1,M.attributes.offset.location=2;var _=new s(y,b,S,M);return _.update(l),_}},3436:function(e,t,r){var o=r(3236),a=r(9405),i=o([`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; +}`]),n=o([`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; +}`]);e.exports=function(s){return a(s,i,n,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(e,t,r){var o=r(7766);e.exports=w;var a=null,i,n,s,c;function f(p){var u=p.getParameter(p.FRAMEBUFFER_BINDING),g=p.getParameter(p.RENDERBUFFER_BINDING),m=p.getParameter(p.TEXTURE_BINDING_2D);return[u,g,m]}function v(p,u){p.bindFramebuffer(p.FRAMEBUFFER,u[0]),p.bindRenderbuffer(p.RENDERBUFFER,u[1]),p.bindTexture(p.TEXTURE_2D,u[2])}function h(p,u){var g=p.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL);a=new Array(g+1);for(var m=0;m<=g;++m){for(var R=new Array(g),P=0;P1&&F.drawBuffersWEBGL(a[z]);var U=g.getExtension("WEBGL_depth_texture");U?B?p.depth=l(g,R,P,U.UNSIGNED_INT_24_8_WEBGL,g.DEPTH_STENCIL,g.DEPTH_STENCIL_ATTACHMENT):O&&(p.depth=l(g,R,P,g.UNSIGNED_SHORT,g.DEPTH_COMPONENT,g.DEPTH_ATTACHMENT)):O&&B?p._depth_rb=y(g,R,P,g.DEPTH_STENCIL,g.DEPTH_STENCIL_ATTACHMENT):O?p._depth_rb=y(g,R,P,g.DEPTH_COMPONENT16,g.DEPTH_ATTACHMENT):B&&(p._depth_rb=y(g,R,P,g.STENCIL_INDEX,g.STENCIL_ATTACHMENT));var Z=g.checkFramebufferStatus(g.FRAMEBUFFER);if(Z!==g.FRAMEBUFFER_COMPLETE){p._destroyed=!0,g.bindFramebuffer(g.FRAMEBUFFER,null),g.deleteFramebuffer(p.handle),p.handle=null,p.depth&&(p.depth.dispose(),p.depth=null),p._depth_rb&&(g.deleteRenderbuffer(p._depth_rb),p._depth_rb=null);for(var N=0;NR||g<0||g>R)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");p._shape[0]=u,p._shape[1]=g;for(var P=f(m),z=0;zP||g<0||g>P)throw new Error("gl-fbo: Parameters are too large for FBO");m=m||{};var z=1;if("color"in m){if(z=Math.max(m.color|0,0),z<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(z>1)if(R){if(z>p.getParameter(R.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+z+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var F=p.UNSIGNED_BYTE,B=p.getExtension("OES_texture_float");if(m.float&&z>0){if(!B)throw new Error("gl-fbo: Context does not support floating point textures");F=p.FLOAT}else m.preferFloat&&z>0&&B&&(F=p.FLOAT);var O=!0;"depth"in m&&(O=!!m.depth);var L=!1;return"stencil"in m&&(L=!!m.stencil),new S(p,u,g,F,z,O,L,R)}},2992:function(e,t,r){var o=r(3387).sprintf,a=r(5171),i=r(1848),n=r(1085);e.exports=s;function s(c,f,v){var h=i(f)||"of unknown name (see npm glsl-shader-name)",T="unknown type";v!==void 0&&(T=v===a.FRAGMENT_SHADER?"fragment":"vertex");for(var l=o(`Error compiling %s shader %s: +`,T,h),y=o("%s%s",l,c),b=c.split(` +`),S={},M=0;M 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; +} +`]),s=o([`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); +}`]),c=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(f){return a(f,i,n,null,c)},t.createPickShader=function(f){return a(f,i,s,null,c)}},5714:function(e,t,r){e.exports=p;var o=r(2762),a=r(8116),i=r(7766),n=new Uint8Array(4),s=new Float32Array(n.buffer);function c(u,g,m,R){return n[0]=R,n[1]=m,n[2]=g,n[3]=u,s[0]}var f=r(2478),v=r(9618),h=r(7319),T=h.createShader,l=h.createPickShader,y=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function b(u,g){for(var m=0,R=0;R<3;++R){var P=u[R]-g[R];m+=P*P}return Math.sqrt(m)}function S(u){for(var g=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],m=0;m<3;++m)g[0][m]=Math.max(u[0][m],g[0][m]),g[1][m]=Math.min(u[1][m],g[1][m]);return g}function M(u,g,m,R){this.arcLength=u,this.position=g,this.index=m,this.dataCoordinate=R}function _(u,g,m,R,P,z){this.gl=u,this.shader=g,this.pickShader=m,this.buffer=R,this.vao=P,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=z,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var w=_.prototype;w.isTransparent=function(){return this.hasAlpha},w.isOpaque=function(){return!this.hasAlpha},w.pickSlots=1,w.setPickBase=function(u){this.pickId=u},w.drawTransparent=w.draw=function(u){if(this.vertexCount){var g=this.gl,m=this.shader,R=this.vao;m.bind(),m.uniforms={model:u.model||y,view:u.view||y,projection:u.projection||y,clipBounds:S(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[g.drawingBufferWidth,g.drawingBufferHeight],pixelRatio:this.pixelRatio},R.bind(),R.draw(g.TRIANGLE_STRIP,this.vertexCount),R.unbind()}},w.drawPick=function(u){if(this.vertexCount){var g=this.gl,m=this.pickShader,R=this.vao;m.bind(),m.uniforms={model:u.model||y,view:u.view||y,projection:u.projection||y,pickId:this.pickId,clipBounds:S(this.clipBounds),screenShape:[g.drawingBufferWidth,g.drawingBufferHeight],pixelRatio:this.pixelRatio},R.bind(),R.draw(g.TRIANGLE_STRIP,this.vertexCount),R.unbind()}},w.update=function(u){var g,m;this.dirty=!0;var R=!!u.connectGaps;"dashScale"in u&&(this.dashScale=u.dashScale),this.hasAlpha=!1,"opacity"in u&&(this.opacity=+u.opacity,this.opacity<1&&(this.hasAlpha=!0));var P=[],z=[],F=[],B=0,O=0,L=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],N=u.position||u.positions;if(N){var U=u.color||u.colors||[0,0,0,1],Z=u.lineWidth||1,Q=!1;e:for(g=1;g0){for(var le=0;le<24;++le)P.push(P[P.length-12]);O+=2,Q=!0}continue e}L[0][m]=Math.min(L[0][m],ue[m],oe[m]),L[1][m]=Math.max(L[1][m],ue[m],oe[m])}var j,J;Array.isArray(U[0])?(j=U.length>g-1?U[g-1]:U.length>0?U[U.length-1]:[0,0,0,1],J=U.length>g?U[g]:U.length>0?U[U.length-1]:[0,0,0,1]):j=J=U,j.length===3&&(j=[j[0],j[1],j[2],1]),J.length===3&&(J=[J[0],J[1],J[2],1]),!this.hasAlpha&&j[3]<1&&(this.hasAlpha=!0);var $;Array.isArray(Z)?$=Z.length>g-1?Z[g-1]:Z.length>0?Z[Z.length-1]:[0,0,0,1]:$=Z;var X=B;if(B+=b(ue,oe),Q){for(m=0;m<2;++m)P.push(ue[0],ue[1],ue[2],oe[0],oe[1],oe[2],X,$,j[0],j[1],j[2],j[3]);O+=2,Q=!1}P.push(ue[0],ue[1],ue[2],oe[0],oe[1],oe[2],X,$,j[0],j[1],j[2],j[3],ue[0],ue[1],ue[2],oe[0],oe[1],oe[2],X,-$,j[0],j[1],j[2],j[3],oe[0],oe[1],oe[2],ue[0],ue[1],ue[2],B,-$,J[0],J[1],J[2],J[3],oe[0],oe[1],oe[2],ue[0],ue[1],ue[2],B,$,J[0],J[1],J[2],J[3]),O+=4}}if(this.buffer.update(P),z.push(B),F.push(N[N.length-1].slice()),this.bounds=L,this.vertexCount=O,this.points=F,this.arcLength=z,"dashes"in u){var re=u.dashes,ee=re.slice();for(ee.unshift(0),g=1;g1.0001)return null;m+=g[M]}return Math.abs(m-1)>.001?null:[_,c(v,g),g]}},840:function(e,t,r){var o=r(3236),a=o([`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; +} +`]),i=o([`#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; +} +`]),n=o([`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; +}`]),s=o([`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; +}`]),c=o([`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; +}`]),f=o([`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; +}`]),v=o([`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; +}`]),h=o([`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); +}`]),T=o([`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; +}`]),l=o([`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))); +}`]),y=o([`precision highp float; +#define GLSLIFY 1 + +uniform vec3 contourColor; + +void main() { + gl_FragColor = vec4(contourColor, 1.0); +} +`]);t.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:n,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:v,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:T,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},t.contourShader={vertex:l,fragment:y,attributes:[{name:"position",type:"vec3"}]}},7201:function(e,t,r){var o=1e-6,a=1e-6,i=r(9405),n=r(2762),s=r(8116),c=r(7766),f=r(8406),v=r(6760),h=r(7608),T=r(9618),l=r(6729),y=r(7765),b=r(1888),S=r(840),M=r(7626),_=S.meshShader,w=S.wireShader,p=S.pointShader,u=S.pickShader,g=S.pointPickShader,m=S.contourShader,R=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function P(le,j,J,$,X,re,ee,q,ae,ie,fe,we,Ae,Fe,Ce,qe,et,Qe,Ke,Xe,Me,xe,ce,Re,$e,rt,Je){this.gl=le,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=j,this.dirty=!0,this.triShader=J,this.lineShader=$,this.pointShader=X,this.pickShader=re,this.pointPickShader=ee,this.contourShader=q,this.trianglePositions=ae,this.triangleColors=fe,this.triangleNormals=Ae,this.triangleUVs=we,this.triangleIds=ie,this.triangleVAO=Fe,this.triangleCount=0,this.lineWidth=1,this.edgePositions=Ce,this.edgeColors=et,this.edgeUVs=Qe,this.edgeIds=qe,this.edgeVAO=Ke,this.edgeCount=0,this.pointPositions=Xe,this.pointColors=xe,this.pointUVs=ce,this.pointSizes=Re,this.pointIds=Me,this.pointVAO=$e,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=rt,this.contourVAO=Je,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=R,this._view=R,this._projection=R,this._resolution=[1,1]}var z=P.prototype;z.isOpaque=function(){return!this.hasAlpha},z.isTransparent=function(){return this.hasAlpha},z.pickSlots=1,z.setPickBase=function(le){this.pickId=le};function F(le,j){if(!j||!j.length)return 1;for(var J=0;Jle&&J>0){var $=(j[J][0]-le)/(j[J][0]-j[J-1][0]);return j[J][1]*(1-$)+$*j[J-1][1]}}return 1}function B(le,j){for(var J=l({colormap:le,nshades:256,format:"rgba"}),$=new Uint8Array(256*4),X=0;X<256;++X){for(var re=J[X],ee=0;ee<3;++ee)$[4*X+ee]=re[ee];j?$[4*X+3]=255*F(X/255,j):$[4*X+3]=255*re[3]}return T($,[256,256,4],[4,0,1])}function O(le){for(var j=le.length,J=new Array(j),$=0;$0){var Ae=this.triShader;Ae.bind(),Ae.uniforms=q,this.triangleVAO.bind(),j.drawArrays(j.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var Ae=this.lineShader;Ae.bind(),Ae.uniforms=q,this.edgeVAO.bind(),j.lineWidth(this.lineWidth*this.pixelRatio),j.drawArrays(j.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var Ae=this.pointShader;Ae.bind(),Ae.uniforms=q,this.pointVAO.bind(),j.drawArrays(j.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var Ae=this.contourShader;Ae.bind(),Ae.uniforms=q,this.contourVAO.bind(),j.drawArrays(j.LINES,0,this.contourCount),this.contourVAO.unbind()}},z.drawPick=function(le){le=le||{};for(var j=this.gl,J=le.model||R,$=le.view||R,X=le.projection||R,re=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],ee=0;ee<3;++ee)re[0][ee]=Math.max(re[0][ee],this.clipBounds[0][ee]),re[1][ee]=Math.min(re[1][ee],this.clipBounds[1][ee]);this._model=[].slice.call(J),this._view=[].slice.call($),this._projection=[].slice.call(X),this._resolution=[j.drawingBufferWidth,j.drawingBufferHeight];var q={model:J,view:$,projection:X,clipBounds:re,pickId:this.pickId/255},ae=this.pickShader;if(ae.bind(),ae.uniforms=q,this.triangleCount>0&&(this.triangleVAO.bind(),j.drawArrays(j.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),j.lineWidth(this.lineWidth*this.pixelRatio),j.drawArrays(j.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var ae=this.pointPickShader;ae.bind(),ae.uniforms=q,this.pointVAO.bind(),j.drawArrays(j.POINTS,0,this.pointCount),this.pointVAO.unbind()}},z.pick=function(le){if(!le||le.id!==this.pickId)return null;for(var j=le.value[0]+256*le.value[1]+65536*le.value[2],J=this.cells[j],$=this.positions,X=new Array(J.length),re=0;reMath.abs(u))l.rotate(R,0,0,-p*g*Math.PI*_.rotateSpeed/window.innerWidth);else if(!_._ortho){var P=-_.zoomSpeed*m*u/window.innerHeight*(R-l.lastT())/20;l.pan(R,0,0,b*(Math.exp(P)-1))}}},!0)},_.enableMouseListeners(),_}},799:function(e,t,r){var o=r(3236),a=r(9405),i=o([`precision mediump float; +#define GLSLIFY 1 +attribute vec2 position; +varying vec2 uv; +void main() { + uv = position; + gl_Position = vec4(position, 0, 1); +}`]),n=o([`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); +}`]);e.exports=function(s){return a(s,i,n,null,[{name:"position",type:"vec2"}])}},4100:function(e,t,r){var o=r(4437),a=r(3837),i=r(5445),n=r(4449),s=r(3589),c=r(2260),f=r(7169),v=r(351),h=r(4772),T=r(4040),l=r(799),y=r(9216)({tablet:!0,featureDetect:!0});e.exports={createScene:w,createCamera:o};function b(){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 S(u,g){var m=null;try{m=u.getContext("webgl",g),m||(m=u.getContext("experimental-webgl",g))}catch{return null}return m}function M(u){var g=Math.round(Math.log(Math.abs(u))/Math.log(10));if(g<0){var m=Math.round(Math.pow(10,-g));return Math.ceil(u*m)/m}else if(g>0){var m=Math.round(Math.pow(10,g));return Math.ceil(u/m)*m}return Math.ceil(u)}function _(u){return typeof u=="boolean"?u:!0}function w(u){u=u||{},u.camera=u.camera||{};var g=u.canvas;if(!g)if(g=document.createElement("canvas"),u.container){var m=u.container;m.appendChild(g)}else document.body.appendChild(g);var R=u.gl;if(R||(u.glOptions&&(y=!!u.glOptions.preserveDrawingBuffer),R=S(g,u.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:y})),!R)throw new Error("webgl not supported");var P=u.bounds||[[-10,-10,-10],[10,10,10]],z=new b,F=c(R,R.drawingBufferWidth,R.drawingBufferHeight,{preferFloat:!y}),B=l(R),O=u.cameraObject&&u.cameraObject._ortho===!0||u.camera.projection&&u.camera.projection.type==="orthographic"||!1,L={eye:u.camera.eye||[2,0,0],center:u.camera.center||[0,0,0],up:u.camera.up||[0,1,0],zoomMin:u.camera.zoomMax||.1,zoomMax:u.camera.zoomMin||100,mode:u.camera.mode||"turntable",_ortho:O},N=u.axes||{},U=a(R,N);U.enable=!N.disable;var Z=u.spikes||{},Q=n(R,Z),ue=[],oe=[],le=[],j=[],J=!0,ee=!0,$=new Array(16),X=new Array(16),re={view:null,projection:$,model:X,_ortho:!1},ee=!0,q=[R.drawingBufferWidth,R.drawingBufferHeight],ae=u.cameraObject||o(g,L),ie={gl:R,contextLost:!1,pixelRatio:u.pixelRatio||1,canvas:g,selection:z,camera:ae,axes:U,axesPixels:null,spikes:Q,bounds:P,objects:ue,shape:q,aspect:u.aspectRatio||[1,1,1],pickRadius:u.pickRadius||10,zNear:u.zNear||.01,zFar:u.zFar||1e3,fovy:u.fovy||Math.PI/4,clearColor:u.clearColor||[0,0,0,0],autoResize:_(u.autoResize),autoBounds:_(u.autoBounds),autoScale:!!u.autoScale,autoCenter:_(u.autoCenter),clipToBounds:_(u.clipToBounds),snapToData:!!u.snapToData,onselect:u.onselect||null,onrender:u.onrender||null,onclick:u.onclick||null,cameraParams:re,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(Xe){this.aspect[0]=Xe.x,this.aspect[1]=Xe.y,this.aspect[2]=Xe.z,ee=!0},setBounds:function(Xe,Me){this.bounds[0][Xe]=Me.min,this.bounds[1][Xe]=Me.max},setClearColor:function(Xe){this.clearColor=Xe},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)}},fe=[R.drawingBufferWidth/ie.pixelRatio|0,R.drawingBufferHeight/ie.pixelRatio|0];function we(){if(!ie._stopped&&ie.autoResize){var Xe=g.parentNode,Me=1,xe=1;Xe&&Xe!==document.body?(Me=Xe.clientWidth,xe=Xe.clientHeight):(Me=window.innerWidth,xe=window.innerHeight);var ce=Math.ceil(Me*ie.pixelRatio)|0,Re=Math.ceil(xe*ie.pixelRatio)|0;if(ce!==g.width||Re!==g.height){g.width=ce,g.height=Re;var $e=g.style;$e.position=$e.position||"absolute",$e.left="0px",$e.top="0px",$e.width=Me+"px",$e.height=xe+"px",J=!0}}}ie.autoResize&&we(),window.addEventListener("resize",we);function Ae(){for(var Xe=ue.length,Me=j.length,xe=0;xe0&&le[Me-1]===0;)le.pop(),j.pop().dispose()}ie.update=function(Xe){ie._stopped||(J=!0,ee=!0)},ie.add=function(Xe){ie._stopped||(Xe.axes=U,ue.push(Xe),oe.push(-1),J=!0,ee=!0,Ae())},ie.remove=function(Xe){if(!ie._stopped){var Me=ue.indexOf(Xe);Me<0||(ue.splice(Me,1),oe.pop(),J=!0,ee=!0,Ae())}},ie.dispose=function(){if(!ie._stopped&&(ie._stopped=!0,window.removeEventListener("resize",we),g.removeEventListener("webglcontextlost",Fe),ie.mouseListener.enabled=!1,!ie.contextLost)){U.dispose(),Q.dispose();for(var Xe=0;Xez.distance)continue;for(var St=0;St1e-6?(y=Math.acos(b),S=Math.sin(y),M=Math.sin((1-i)*y)/S,_=Math.sin(i*y)/S):(M=1-i,_=i),r[0]=M*n+_*v,r[1]=M*s+_*h,r[2]=M*c+_*T,r[3]=M*f+_*l,r}},5964:function(e){e.exports=function(t){return!t&&t!==0?"":t.toString()}},9366:function(e,t,r){var o=r(4359);e.exports=i;var a={};function i(n,s,c){var f=[s.style,s.weight,s.variant,s.family].join("_"),v=a[f];if(v||(v=a[f]={}),n in v)return v[n];var h={textAlign:"center",textBaseline:"middle",lineHeight:1,font:s.family,fontStyle:s.style,fontWeight:s.weight,fontVariant:s.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}};h.triangles=!0;var T=o(n,h);h.triangles=!1;var l=o(n,h),y,b;if(c&&c!==1){for(y=0;y 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; + } +}`]),n=a([`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; + } +}`]),s=a([`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; + } +} +`]),c=a([`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; +} +`]),f=a([`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); +}`]),v=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:i,fragment:c,attributes:v},T={vertex:n,fragment:c,attributes:v},l={vertex:s,fragment:c,attributes:v},y={vertex:i,fragment:f,attributes:v},b={vertex:n,fragment:f,attributes:v},S={vertex:s,fragment:f,attributes:v};function M(_,w){var p=o(_,w),u=p.attributes;return u.position.location=0,u.color.location=1,u.glyph.location=2,u.id.location=3,p}t.createPerspective=function(_){return M(_,h)},t.createOrtho=function(_){return M(_,T)},t.createProject=function(_){return M(_,l)},t.createPickPerspective=function(_){return M(_,y)},t.createPickOrtho=function(_){return M(_,b)},t.createPickProject=function(_){return M(_,S)}},8418:function(e,t,r){var o=r(5219),a=r(2762),i=r(8116),n=r(1888),s=r(6760),c=r(1283),f=r(9366),v=r(5964),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=ArrayBuffer,l=DataView;function y(X){return T.isView(X)&&!(X instanceof l)}function b(X){return Array.isArray(X)||y(X)}e.exports=$;function S(X,re){var ee=X[0],q=X[1],ae=X[2],ie=X[3];return X[0]=re[0]*ee+re[4]*q+re[8]*ae+re[12]*ie,X[1]=re[1]*ee+re[5]*q+re[9]*ae+re[13]*ie,X[2]=re[2]*ee+re[6]*q+re[10]*ae+re[14]*ie,X[3]=re[3]*ee+re[7]*q+re[11]*ae+re[15]*ie,X}function M(X,re,ee,q){return S(q,q),S(q,q),S(q,q)}function _(X,re){this.index=X,this.dataCoordinate=this.position=re}function w(X){return X===!0||X>1?1:X}function p(X,re,ee,q,ae,ie,fe,we,Ae,Fe,Ce,qe){this.gl=X,this.pixelRatio=1,this.shader=re,this.orthoShader=ee,this.projectShader=q,this.pointBuffer=ae,this.colorBuffer=ie,this.glyphBuffer=fe,this.idBuffer=we,this.vao=Ae,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=Fe,this.pickOrthoShader=Ce,this.pickProjectShader=qe,this.points=[],this._selectResult=new _(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}var u=p.prototype;u.pickSlots=1,u.setPickBase=function(X){this.pickId=X},u.isTransparent=function(){if(this.hasAlpha)return!0;for(var X=0;X<3;++X)if(this.axesProject[X]&&this.projectHasAlpha)return!0;return!1},u.isOpaque=function(){if(!this.hasAlpha)return!0;for(var X=0;X<3;++X)if(this.axesProject[X]&&!this.projectHasAlpha)return!0;return!1};var g=[0,0],m=[0,0,0],R=[0,0,0],P=[0,0,0,1],z=[0,0,0,1],F=h.slice(),B=[0,0,0],O=[[0,0,0],[0,0,0]];function L(X){return X[0]=X[1]=X[2]=0,X}function N(X,re){return X[0]=re[0],X[1]=re[1],X[2]=re[2],X[3]=1,X}function U(X,re,ee,q){return X[0]=re[0],X[1]=re[1],X[2]=re[2],X[ee]=q,X}function Z(X){for(var re=O,ee=0;ee<2;++ee)for(var q=0;q<3;++q)re[ee][q]=Math.max(Math.min(X[ee][q],1e8),-1e8);return re}function Q(X,re,ee,q){var ae=re.axesProject,ie=re.gl,fe=X.uniforms,we=ee.model||h,Ae=ee.view||h,Fe=ee.projection||h,Ce=re.axesBounds,qe=Z(re.clipBounds),et;re.axes&&re.axes.lastCubeProps?et=re.axes.lastCubeProps.axis:et=[1,1,1],g[0]=2/ie.drawingBufferWidth,g[1]=2/ie.drawingBufferHeight,X.bind(),fe.view=Ae,fe.projection=Fe,fe.screenSize=g,fe.highlightId=re.highlightId,fe.highlightScale=re.highlightScale,fe.clipBounds=qe,fe.pickGroup=re.pickId/255,fe.pixelRatio=q;for(var Qe=0;Qe<3;++Qe)if(ae[Qe]){fe.scale=re.projectScale[Qe],fe.opacity=re.projectOpacity[Qe];for(var Ke=F,Xe=0;Xe<16;++Xe)Ke[Xe]=0;for(var Xe=0;Xe<4;++Xe)Ke[5*Xe]=1;Ke[5*Qe]=0,et[Qe]<0?Ke[12+Qe]=Ce[0][Qe]:Ke[12+Qe]=Ce[1][Qe],s(Ke,we,Ke),fe.model=Ke;var Me=(Qe+1)%3,xe=(Qe+2)%3,ce=L(m),Re=L(R);ce[Me]=1,Re[xe]=1;var $e=M(Fe,Ae,we,N(P,ce)),rt=M(Fe,Ae,we,N(z,Re));if(Math.abs($e[1])>Math.abs(rt[1])){var Je=$e;$e=rt,rt=Je,Je=ce,ce=Re,Re=Je;var At=Me;Me=xe,xe=At}$e[0]<0&&(ce[Me]=-1),rt[1]>0&&(Re[xe]=-1);for(var St=0,Rt=0,Xe=0;Xe<4;++Xe)St+=Math.pow(we[4*Me+Xe],2),Rt+=Math.pow(we[4*xe+Xe],2);ce[Me]/=Math.sqrt(St),Re[xe]/=Math.sqrt(Rt),fe.axes[0]=ce,fe.axes[1]=Re,fe.fragClipBounds[0]=U(B,qe[0],Qe,-1e8),fe.fragClipBounds[1]=U(B,qe[1],Qe,1e8),re.vao.bind(),re.vao.draw(ie.TRIANGLES,re.vertexCount),re.lineWidth>0&&(ie.lineWidth(re.lineWidth*q),re.vao.draw(ie.LINES,re.lineVertexCount,re.vertexCount)),re.vao.unbind()}}var ue=[-1e8,-1e8,-1e8],oe=[1e8,1e8,1e8],le=[ue,oe];function j(X,re,ee,q,ae,ie,fe){var we=ee.gl;if((ie===ee.projectHasAlpha||fe)&&Q(re,ee,q,ae),ie===ee.hasAlpha||fe){X.bind();var Ae=X.uniforms;Ae.model=q.model||h,Ae.view=q.view||h,Ae.projection=q.projection||h,g[0]=2/we.drawingBufferWidth,g[1]=2/we.drawingBufferHeight,Ae.screenSize=g,Ae.highlightId=ee.highlightId,Ae.highlightScale=ee.highlightScale,Ae.fragClipBounds=le,Ae.clipBounds=ee.axes.bounds,Ae.opacity=ee.opacity,Ae.pickGroup=ee.pickId/255,Ae.pixelRatio=ae,ee.vao.bind(),ee.vao.draw(we.TRIANGLES,ee.vertexCount),ee.lineWidth>0&&(we.lineWidth(ee.lineWidth*ae),ee.vao.draw(we.LINES,ee.lineVertexCount,ee.vertexCount)),ee.vao.unbind()}}u.draw=function(X){var re=this.useOrtho?this.orthoShader:this.shader;j(re,this.projectShader,this,X,this.pixelRatio,!1,!1)},u.drawTransparent=function(X){var re=this.useOrtho?this.orthoShader:this.shader;j(re,this.projectShader,this,X,this.pixelRatio,!0,!1)},u.drawPick=function(X){var re=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;j(re,this.pickProjectShader,this,X,1,!0,!0)},u.pick=function(X){if(!X||X.id!==this.pickId)return null;var re=X.value[2]+(X.value[1]<<8)+(X.value[0]<<16);if(re>=this.pointCount||re<0)return null;var ee=this.points[re],q=this._selectResult;q.index=re;for(var ae=0;ae<3;++ae)q.position[ae]=q.dataCoordinate[ae]=ee[ae];return q},u.highlight=function(X){if(!X)this.highlightId=[1,1,1,1];else{var re=X.index,ee=re&255,q=re>>8&255,ae=re>>16&255;this.highlightId=[ee/255,q/255,ae/255,0]}};function J(X,re,ee,q){var ae;b(X)?re0){var dr=0,pt=xe,ze=[0,0,0,1],Ge=[0,0,0,1],Oe=b(et)&&b(et[0]),ve=b(Xe)&&b(Xe[0]);e:for(var q=0;q0?1-Rt[0][0]:Mt<0?1+Rt[1][0]:1,Nt*=Nt>0?1-Rt[0][1]:Nt<0?1+Rt[1][1]:1;for(var Bt=[Mt,Nt],da=At.cells||[],wa=At.positions||[],rt=0;rtthis.buffer.length){a.free(this.buffer);for(var b=this.buffer=a.mallocUint8(n(y*l*4)),S=0;Sb)for(l=b;ly)for(l=y;l=0){for(var O=B.type.charAt(B.type.length-1)|0,L=new Array(O),N=0;N=0;)U+=1;z[F]=U}var Z=new Array(b.length);function Q(){_.program=n.program(w,_._vref,_._fref,P,z);for(var ue=0;ue=0){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+_+": "+w);s(v,h,p[0],l,u,y,_)}else if(w.indexOf("mat")>=0){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+_+": "+w);c(v,h,p,l,u,y,_)}else throw new o("","Unknown data type for attribute "+_+": "+w);break}}return y}},3327:function(e,t,r){var o=r(216),a=r(8866);e.exports=s;function i(c){return function(){return c}}function n(c,f){for(var v=new Array(c),h=0;h4)throw new a("","Invalid data type");switch(U.charAt(0)){case"b":case"i":c["uniform"+Z+"iv"](h[z],F);break;case"v":c["uniform"+Z+"fv"](h[z],F);break;default:throw new a("","Unrecognized data type for vector "+name+": "+U)}}else if(U.indexOf("mat")===0&&U.length===4){if(Z=U.charCodeAt(U.length-1)-48,Z<2||Z>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+U);c["uniformMatrix"+Z+"fv"](h[z],!1,F);break}else throw new a("","Unknown uniform data type for "+name+": "+U)}}}}}function y(w,p){if(typeof p!="object")return[[w,p]];var u=[];for(var g in p){var m=p[g],R=w;parseInt(g)+""===g?R+="["+g+"]":R+="."+g,typeof m=="object"?u.push.apply(u,y(R,m)):u.push([R,m])}return u}function b(w){switch(w){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var p=w.indexOf("vec");if(0<=p&&p<=1&&w.length===4+p){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new a("","Invalid data type");return w.charAt(0)==="b"?n(u,!1):n(u,0)}else if(w.indexOf("mat")===0&&w.length===4){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+w);return n(u*u,0)}else throw new a("","Unknown uniform data type for "+name+": "+w)}}function S(w,p,u){if(typeof u=="object"){var g=M(u);Object.defineProperty(w,p,{get:i(g),set:l(u),enumerable:!0,configurable:!1})}else h[u]?Object.defineProperty(w,p,{get:T(u),set:l(u),enumerable:!0,configurable:!1}):w[p]=b(v[u].type)}function M(w){var p;if(Array.isArray(w)){p=new Array(w.length);for(var u=0;u1){v[0]in c||(c[v[0]]=[]),c=c[v[0]];for(var h=1;h1)for(var y=0;y"u"?r(606):WeakMap,n=new i,s=0;function c(S,M,_,w,p,u,g){this.id=S,this.src=M,this.type=_,this.shader=w,this.count=u,this.programs=[],this.cache=g}c.prototype.dispose=function(){if(--this.count===0){for(var S=this.cache,M=S.gl,_=this.programs,w=0,p=_.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; +} +`]),i=o([`#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; +} +`]),n=o([`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; +} +`]),s=o([`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); +}`]);t.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:n,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(e,t,r){var o=r(2931),a=r(9970),i=["xyz","xzy","yxz","yzx","zxy","zyx"],n=function(b,S,M,_){for(var w=b.points,p=b.velocities,u=b.divergences,g=[],m=[],R=[],P=[],z=[],F=[],B=0,O=0,L=a.create(),N=a.create(),U=8,Z=0;Z0)for(var le=0;leS)return _-1}return _},f=function(b,S,M){return bM?M:b},v=function(b,S,M){var _=S.vectors,w=S.meshgrid,p=b[0],u=b[1],g=b[2],m=w[0].length,R=w[1].length,P=w[2].length,z=c(w[0],p),F=c(w[1],u),B=c(w[2],g),O=z+1,L=F+1,N=B+1;if(z=f(z,0,m-1),O=f(O,0,m-1),F=f(F,0,R-1),L=f(L,0,R-1),B=f(B,0,P-1),N=f(N,0,P-1),z<0||F<0||B<0||O>m-1||L>R-1||N>P-1)return o.create();var U=w[0][z],Z=w[0][O],Q=w[1][F],ue=w[1][L],oe=w[2][B],le=w[2][N],j=(p-U)/(Z-U),J=(u-Q)/(ue-Q),$=(g-oe)/(le-oe);isFinite(j)||(j=.5),isFinite(J)||(J=.5),isFinite($)||($=.5);var X,re,ee,q,ae,ie;switch(M.reversedX&&(z=m-1-z,O=m-1-O),M.reversedY&&(F=R-1-F,L=R-1-L),M.reversedZ&&(B=P-1-B,N=P-1-N),M.filled){case 5:ae=B,ie=N,ee=F*P,q=L*P,X=z*P*R,re=O*P*R;break;case 4:ae=B,ie=N,X=z*P,re=O*P,ee=F*P*m,q=L*P*m;break;case 3:ee=F,q=L,ae=B*R,ie=N*R,X=z*R*P,re=O*R*P;break;case 2:ee=F,q=L,X=z*R,re=O*R,ae=B*R*m,ie=N*R*m;break;case 1:X=z,re=O,ae=B*m,ie=N*m,ee=F*m*P,q=L*m*P;break;default:X=z,re=O,ee=F*m,q=L*m,ae=B*m*R,ie=N*m*R;break}var fe=_[X+ee+ae],we=_[X+ee+ie],Ae=_[X+q+ae],Fe=_[X+q+ie],Ce=_[re+ee+ae],qe=_[re+ee+ie],et=_[re+q+ae],Qe=_[re+q+ie],Ke=o.create(),Xe=o.create(),Me=o.create(),xe=o.create();o.lerp(Ke,fe,Ce,j),o.lerp(Xe,we,qe,j),o.lerp(Me,Ae,et,j),o.lerp(xe,Fe,Qe,j);var ce=o.create(),Re=o.create();o.lerp(ce,Ke,Me,J),o.lerp(Re,Xe,xe,J);var $e=o.create();return o.lerp($e,ce,Re,$),$e},h=function(b){var S=1/0;b.sort(function(p,u){return p-u});for(var M=b.length,_=1;_O||QeL||KeN)},Z=o.distance(S[0],S[1]),Q=10*Z/_,ue=Q*Q,oe=1,le=0,j=M.length;j>1&&(oe=T(M));for(var J=0;Jle&&(le=fe),ae.push(fe),P.push({points:X,velocities:re,divergences:ae});for(var we=0;we<_*100&&X.length<_&&U($);){we++;var Ae=o.clone(ee),Fe=o.squaredLength(Ae);if(Fe===0)break;if(Fe>ue&&o.scale(Ae,Ae,Q/Math.sqrt(Fe)),o.add(Ae,Ae,$),ee=m(Ae),o.squaredDistance(q,Ae)-ue>-1e-4*ue){X.push(Ae),q=Ae,re.push(ee);var ie=R(Ae,ee),fe=o.length(ie);isFinite(fe)&&fe>le&&(le=fe),ae.push(fe)}$=Ae}}var Ce=s(P,b.colormap,le,oe);return p?Ce.tubeScale=p:(le===0&&(le=1),Ce.tubeScale=w*.5*oe/le),Ce};var l=r(6740),y=r(6405).createMesh;e.exports.createTubeMesh=function(b,S){return y(b,S,{shaders:l,traceType:"streamtube"})}},990:function(e,t,r){var o=r(9405),a=r(3236),i=a([`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; + mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); + vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 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); +} +`]),n=a([`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 — 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; +} +`]),s=a([`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; + mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); + vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 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); +} +`]),c=a([`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)); +} +`]);t.createShader=function(f){var v=o(f,i,n,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v.attributes.normal.location=2,v},t.createPickShader=function(f){var v=o(f,i,c,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v.attributes.normal.location=2,v},t.createContourShader=function(f){var v=o(f,s,n,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v},t.createPickContourShader=function(f){var v=o(f,s,c,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v}},9499:function(e,t,r){e.exports=re;var o=r(8828),a=r(2762),i=r(8116),n=r(7766),s=r(1888),c=r(6729),f=r(5298),v=r(9994),h=r(9618),T=r(3711),l=r(6760),y=r(7608),b=r(2478),S=r(6199),M=r(990),_=M.createShader,w=M.createContourShader,p=M.createPickShader,u=M.createPickContourShader,g=4*10,m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],R=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],P=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];(function(){for(var ee=0;ee<3;++ee){var q=P[ee],ae=(ee+1)%3,ie=(ee+2)%3;q[ae+0]=1,q[ie+3]=1,q[ee+6]=1}})();function z(ee,q,ae,ie,fe){this.position=ee,this.index=q,this.uv=ae,this.level=ie,this.dataCoordinate=fe}var F=256;function B(ee,q,ae,ie,fe,we,Ae,Fe,Ce,qe,et,Qe,Ke,Xe,Me){this.gl=ee,this.shape=q,this.bounds=ae,this.objectOffset=Me,this.intensityBounds=[],this._shader=ie,this._pickShader=fe,this._coordinateBuffer=we,this._vao=Ae,this._colorMap=Fe,this._contourShader=Ce,this._contourPickShader=qe,this._contourBuffer=et,this._contourVAO=Qe,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new z([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=Ke,this._dynamicVAO=Xe,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=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var O=B.prototype;O.genColormap=function(ee,q){var ae=!1,ie=v([c({colormap:ee,nshades:F,format:"rgba"}).map(function(fe,we){var Ae=q?L(we/255,q):fe[3];return Ae<1&&(ae=!0),[fe[0],fe[1],fe[2],255*Ae]})]);return f.divseq(ie,255),this.hasAlphaScale=ae,ie},O.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},O.isOpaque=function(){return!this.isTransparent()},O.pickSlots=1,O.setPickBase=function(ee){this.pickId=ee};function L(ee,q){if(!q||!q.length)return 1;for(var ae=0;aeee&&ae>0){var ie=(q[ae][0]-ee)/(q[ae][0]-q[ae-1][0]);return q[ae][1]*(1-ie)+ie*q[ae-1][1]}}return 1}var N=[0,0,0],U={showSurface:!1,showContour:!1,projections:[m.slice(),m.slice(),m.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function Z(ee,q){var ae,ie,fe,we=q.axes&&q.axes.lastCubeProps.axis||N,Ae=q.showSurface,Fe=q.showContour;for(ae=0;ae<3;++ae)for(Ae=Ae||q.surfaceProject[ae],ie=0;ie<3;++ie)Fe=Fe||q.contourProject[ae][ie];for(ae=0;ae<3;++ae){var Ce=U.projections[ae];for(ie=0;ie<16;++ie)Ce[ie]=0;for(ie=0;ie<4;++ie)Ce[5*ie]=1;Ce[5*ae]=0,Ce[12+ae]=q.axesBounds[+(we[ae]>0)][ae],l(Ce,ee.model,Ce);var qe=U.clipBounds[ae];for(fe=0;fe<2;++fe)for(ie=0;ie<3;++ie)qe[fe][ie]=ee.clipBounds[fe][ie];qe[0][ae]=-1e8,qe[1][ae]=1e8}return U.showSurface=Ae,U.showContour=Fe,U}var Q={model:m,view:m,projection:m,inverseModel:m.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},ue=m.slice(),oe=[1,0,0,0,1,0,0,0,1];function le(ee,q){ee=ee||{};var ae=this.gl;ae.disable(ae.CULL_FACE),this._colorMap.bind(0);var ie=Q;ie.model=ee.model||m,ie.view=ee.view||m,ie.projection=ee.projection||m,ie.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],ie.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],ie.objectOffset=this.objectOffset,ie.contourColor=this.contourColor[0],ie.inverseModel=y(ie.inverseModel,ie.model);for(var fe=0;fe<2;++fe)for(var we=ie.clipBounds[fe],Ae=0;Ae<3;++Ae)we[Ae]=Math.min(Math.max(this.clipBounds[fe][Ae],-1e8),1e8);ie.kambient=this.ambientLight,ie.kdiffuse=this.diffuseLight,ie.kspecular=this.specularLight,ie.roughness=this.roughness,ie.fresnel=this.fresnel,ie.opacity=this.opacity,ie.height=0,ie.permutation=oe,ie.vertexColor=this.vertexColor;var Fe=ue;for(l(Fe,ie.view,ie.model),l(Fe,ie.projection,Fe),y(Fe,Fe),fe=0;fe<3;++fe)ie.eyePosition[fe]=Fe[12+fe]/Fe[15];var Ce=Fe[15];for(fe=0;fe<3;++fe)Ce+=this.lightPosition[fe]*Fe[4*fe+3];for(fe=0;fe<3;++fe){var qe=Fe[12+fe];for(Ae=0;Ae<3;++Ae)qe+=Fe[4*Ae+fe]*this.lightPosition[Ae];ie.lightPosition[fe]=qe/Ce}var et=Z(ie,this);if(et.showSurface){for(this._shader.bind(),this._shader.uniforms=ie,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(ae.TRIANGLES,this._vertexCount),fe=0;fe<3;++fe)!this.surfaceProject[fe]||!this.vertexCount||(this._shader.uniforms.model=et.projections[fe],this._shader.uniforms.clipBounds=et.clipBounds[fe],this._vao.draw(ae.TRIANGLES,this._vertexCount));this._vao.unbind()}if(et.showContour){var Qe=this._contourShader;ie.kambient=1,ie.kdiffuse=0,ie.kspecular=0,ie.opacity=1,Qe.bind(),Qe.uniforms=ie;var Ke=this._contourVAO;for(Ke.bind(),fe=0;fe<3;++fe)for(Qe.uniforms.permutation=P[fe],ae.lineWidth(this.contourWidth[fe]*this.pixelRatio),Ae=0;Ae>4)/16)/255,fe=Math.floor(ie),we=ie-fe,Ae=q[1]*(ee.value[1]+(ee.value[2]&15)/16)/255,Fe=Math.floor(Ae),Ce=Ae-Fe;fe+=1,Fe+=1;var qe=ae.position;qe[0]=qe[1]=qe[2]=0;for(var et=0;et<2;++et)for(var Qe=et?we:1-we,Ke=0;Ke<2;++Ke)for(var Xe=Ke?Ce:1-Ce,Me=fe+et,xe=Fe+Ke,ce=Qe*Xe,Re=0;Re<3;++Re)qe[Re]+=this._field[Re].get(Me,xe)*ce;for(var $e=this._pickResult.level,rt=0;rt<3;++rt)if($e[rt]=b.le(this.contourLevels[rt],qe[rt]),$e[rt]<0)this.contourLevels[rt].length>0&&($e[rt]=0);else if($e[rt]Math.abs(At-qe[rt])&&($e[rt]+=1)}for(ae.index[0]=we<.5?fe:fe+1,ae.index[1]=Ce<.5?Fe:Fe+1,ae.uv[0]=ie/q[0],ae.uv[1]=Ae/q[1],Re=0;Re<3;++Re)ae.dataCoordinate[Re]=this._field[Re].get(ae.index[0],ae.index[1]);return ae},O.padField=function(ee,q){var ae=q.shape.slice(),ie=ee.shape.slice();f.assign(ee.lo(1,1).hi(ae[0],ae[1]),q),f.assign(ee.lo(1).hi(ae[0],1),q.hi(ae[0],1)),f.assign(ee.lo(1,ie[1]-1).hi(ae[0],1),q.lo(0,ae[1]-1).hi(ae[0],1)),f.assign(ee.lo(0,1).hi(1,ae[1]),q.hi(1)),f.assign(ee.lo(ie[0]-1,1).hi(1,ae[1]),q.lo(ae[0]-1)),ee.set(0,0,q.get(0,0)),ee.set(0,ie[1]-1,q.get(0,ae[1]-1)),ee.set(ie[0]-1,0,q.get(ae[0]-1,0)),ee.set(ie[0]-1,ie[1]-1,q.get(ae[0]-1,ae[1]-1))};function J(ee,q){return Array.isArray(ee)?[q(ee[0]),q(ee[1]),q(ee[2])]:[q(ee),q(ee),q(ee)]}function $(ee){return Array.isArray(ee)?ee.length===3?[ee[0],ee[1],ee[2],1]:[ee[0],ee[1],ee[2],ee[3]]:[0,0,0,1]}function X(ee){if(Array.isArray(ee)){if(Array.isArray(ee))return[$(ee[0]),$(ee[1]),$(ee[2])];var q=$(ee);return[q.slice(),q.slice(),q.slice()]}}O.update=function(ee){ee=ee||{},this.objectOffset=ee.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in ee&&(this.contourWidth=J(ee.contourWidth,Number)),"showContour"in ee&&(this.showContour=J(ee.showContour,Boolean)),"showSurface"in ee&&(this.showSurface=!!ee.showSurface),"contourTint"in ee&&(this.contourTint=J(ee.contourTint,Boolean)),"contourColor"in ee&&(this.contourColor=X(ee.contourColor)),"contourProject"in ee&&(this.contourProject=J(ee.contourProject,function(Oa){return J(Oa,Boolean)})),"surfaceProject"in ee&&(this.surfaceProject=ee.surfaceProject),"dynamicColor"in ee&&(this.dynamicColor=X(ee.dynamicColor)),"dynamicTint"in ee&&(this.dynamicTint=J(ee.dynamicTint,Number)),"dynamicWidth"in ee&&(this.dynamicWidth=J(ee.dynamicWidth,Number)),"opacity"in ee&&(this.opacity=ee.opacity),"opacityscale"in ee&&(this.opacityscale=ee.opacityscale),"colorBounds"in ee&&(this.colorBounds=ee.colorBounds),"vertexColor"in ee&&(this.vertexColor=ee.vertexColor?1:0),"colormap"in ee&&this._colorMap.setPixels(this.genColormap(ee.colormap,this.opacityscale));var q=ee.field||ee.coords&&ee.coords[2]||null,ae=!1;if(q||(this._field[2].shape[0]||this._field[2].shape[2]?q=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):q=this._field[2].hi(0,0)),"field"in ee||"coords"in ee){var ie=(q.shape[0]+2)*(q.shape[1]+2);ie>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(o.nextPow2(ie))),this._field[2]=h(this._field[2].data,[q.shape[0]+2,q.shape[1]+2]),this.padField(this._field[2],q),this.shape=q.shape.slice();for(var fe=this.shape,we=0;we<2;++we)this._field[2].size>this._field[we].data.length&&(s.freeFloat(this._field[we].data),this._field[we].data=s.mallocFloat(this._field[2].size)),this._field[we]=h(this._field[we].data,[fe[0]+2,fe[1]+2]);if(ee.coords){var Ae=ee.coords;if(!Array.isArray(Ae)||Ae.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(we=0;we<2;++we){var Fe=Ae[we];for(Ke=0;Ke<2;++Ke)if(Fe.shape[Ke]!==fe[Ke])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[we],Fe)}}else if(ee.ticks){var Ce=ee.ticks;if(!Array.isArray(Ce)||Ce.length!==2)throw new Error("gl-surface: invalid ticks");for(we=0;we<2;++we){var qe=Ce[we];if((Array.isArray(qe)||qe.length)&&(qe=h(qe)),qe.shape[0]!==fe[we])throw new Error("gl-surface: invalid tick length");var et=h(qe.data,fe);et.stride[we]=qe.stride[0],et.stride[we^1]=0,this.padField(this._field[we],et)}}else{for(we=0;we<2;++we){var Qe=[0,0];Qe[we]=1,this._field[we]=h(this._field[we].data,[fe[0]+2,fe[1]+2],Qe,0)}this._field[0].set(0,0,0);for(var Ke=0;Ke0){for(var Pa=0;Pa<5;++Pa)qt.pop();Oe-=1}continue e}}}da.push(Oe)}this._contourOffsets[Zt]=ta,this._contourCounts[Zt]=da}var sa=s.mallocFloat(qt.length);for(we=0;wez||R<0||R>z)throw new Error("gl-texture2d: Invalid texture size");return g._shape=[m,R],g.bind(),P.texImage2D(P.TEXTURE_2D,0,g.format,m,R,0,g.format,g.type,null),g._mipLevels=[0],g}function l(g,m,R,P,z,F){this.gl=g,this.handle=m,this.format=z,this.type=F,this._shape=[R,P],this._mipLevels=[0],this._magFilter=g.NEAREST,this._minFilter=g.NEAREST,this._wrapS=g.CLAMP_TO_EDGE,this._wrapT=g.CLAMP_TO_EDGE,this._anisoSamples=1;var B=this,O=[this._wrapS,this._wrapT];Object.defineProperties(O,[{get:function(){return B._wrapS},set:function(N){return B.wrapS=N}},{get:function(){return B._wrapT},set:function(N){return B.wrapT=N}}]),this._wrapVector=O;var L=[this._shape[0],this._shape[1]];Object.defineProperties(L,[{get:function(){return B._shape[0]},set:function(N){return B.width=N}},{get:function(){return B._shape[1]},set:function(N){return B.height=N}}]),this._shapeVector=L}var y=l.prototype;Object.defineProperties(y,{minFilter:{get:function(){return this._minFilter},set:function(g){this.bind();var m=this.gl;if(this.type===m.FLOAT&&n.indexOf(g)>=0&&(m.getExtension("OES_texture_float_linear")||(g=m.NEAREST)),s.indexOf(g)<0)throw new Error("gl-texture2d: Unknown filter mode "+g);return m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,g),this._minFilter=g}},magFilter:{get:function(){return this._magFilter},set:function(g){this.bind();var m=this.gl;if(this.type===m.FLOAT&&n.indexOf(g)>=0&&(m.getExtension("OES_texture_float_linear")||(g=m.NEAREST)),s.indexOf(g)<0)throw new Error("gl-texture2d: Unknown filter mode "+g);return m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,g),this._magFilter=g}},mipSamples:{get:function(){return this._anisoSamples},set:function(g){var m=this._anisoSamples;if(this._anisoSamples=Math.max(g,1)|0,m!==this._anisoSamples){var R=this.gl.getExtension("EXT_texture_filter_anisotropic");R&&this.gl.texParameterf(this.gl.TEXTURE_2D,R.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(g){if(this.bind(),c.indexOf(g)<0)throw new Error("gl-texture2d: Unknown wrap mode "+g);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,g),this._wrapS=g}},wrapT:{get:function(){return this._wrapT},set:function(g){if(this.bind(),c.indexOf(g)<0)throw new Error("gl-texture2d: Unknown wrap mode "+g);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,g),this._wrapT=g}},wrap:{get:function(){return this._wrapVector},set:function(g){if(Array.isArray(g)||(g=[g,g]),g.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var m=0;m<2;++m)if(c.indexOf(g[m])<0)throw new Error("gl-texture2d: Unknown wrap mode "+g);this._wrapS=g[0],this._wrapT=g[1];var R=this.gl;return this.bind(),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,this._wrapS),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,this._wrapT),g}},shape:{get:function(){return this._shapeVector},set:function(g){if(!Array.isArray(g))g=[g|0,g|0];else if(g.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return T(this,g[0]|0,g[1]|0),[g[0]|0,g[1]|0]}},width:{get:function(){return this._shape[0]},set:function(g){return g=g|0,T(this,g,this._shape[1]),g}},height:{get:function(){return this._shape[1]},set:function(g){return g=g|0,T(this,this._shape[0],g),g}}}),y.bind=function(g){var m=this.gl;return g!==void 0&&m.activeTexture(m.TEXTURE0+(g|0)),m.bindTexture(m.TEXTURE_2D,this.handle),g!==void 0?g|0:m.getParameter(m.ACTIVE_TEXTURE)-m.TEXTURE0},y.dispose=function(){this.gl.deleteTexture(this.handle)},y.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var g=Math.min(this._shape[0],this._shape[1]),m=0;g>0;++m,g>>>=1)this._mipLevels.indexOf(m)<0&&this._mipLevels.push(m)},y.setPixels=function(g,m,R,P){var z=this.gl;this.bind(),Array.isArray(m)?(P=R,R=m[1]|0,m=m[0]|0):(m=m||0,R=R||0),P=P||0;var F=v(g)?g:g.raw;if(F){var B=this._mipLevels.indexOf(P)<0;B?(z.texImage2D(z.TEXTURE_2D,0,this.format,this.format,this.type,F),this._mipLevels.push(P)):z.texSubImage2D(z.TEXTURE_2D,P,m,R,this.format,this.type,F)}else if(g.shape&&g.stride&&g.data){if(g.shape.length<2||m+g.shape[1]>this._shape[1]>>>P||R+g.shape[0]>this._shape[0]>>>P||m<0||R<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");S(z,m,R,P,this.format,this.type,this._mipLevels,g)}else throw new Error("gl-texture2d: Unsupported data type")};function b(g,m){return g.length===3?m[2]===1&&m[1]===g[0]*g[2]&&m[0]===g[2]:m[0]===1&&m[1]===g[0]}function S(g,m,R,P,z,F,B,O){var L=O.dtype,N=O.shape.slice();if(N.length<2||N.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var U=0,Z=0,Q=b(N,O.stride.slice());if(L==="float32"?U=g.FLOAT:L==="float64"?(U=g.FLOAT,Q=!1,L="float32"):L==="uint8"?U=g.UNSIGNED_BYTE:(U=g.UNSIGNED_BYTE,Q=!1,L="uint8"),N.length===2)Z=g.LUMINANCE,N=[N[0],N[1],1],O=o(O.data,N,[O.stride[0],O.stride[1],1],O.offset);else if(N.length===3){if(N[2]===1)Z=g.ALPHA;else if(N[2]===2)Z=g.LUMINANCE_ALPHA;else if(N[2]===3)Z=g.RGB;else if(N[2]===4)Z=g.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");N[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((Z===g.LUMINANCE||Z===g.ALPHA)&&(z===g.LUMINANCE||z===g.ALPHA)&&(Z=z),Z!==z)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var ue=O.size,oe=B.indexOf(P)<0;if(oe&&B.push(P),U===F&&Q)O.offset===0&&O.data.length===ue?oe?g.texImage2D(g.TEXTURE_2D,P,z,N[0],N[1],0,z,F,O.data):g.texSubImage2D(g.TEXTURE_2D,P,m,R,N[0],N[1],z,F,O.data):oe?g.texImage2D(g.TEXTURE_2D,P,z,N[0],N[1],0,z,F,O.data.subarray(O.offset,O.offset+ue)):g.texSubImage2D(g.TEXTURE_2D,P,m,R,N[0],N[1],z,F,O.data.subarray(O.offset,O.offset+ue));else{var le;F===g.FLOAT?le=i.mallocFloat32(ue):le=i.mallocUint8(ue);var j=o(le,N,[N[2],N[2]*N[0],1]);U===g.FLOAT&&F===g.UNSIGNED_BYTE?h(j,O):a.assign(j,O),oe?g.texImage2D(g.TEXTURE_2D,P,z,N[0],N[1],0,z,F,le.subarray(0,ue)):g.texSubImage2D(g.TEXTURE_2D,P,m,R,N[0],N[1],z,F,le.subarray(0,ue)),F===g.FLOAT?i.freeFloat32(le):i.freeUint8(le)}}function M(g){var m=g.createTexture();return g.bindTexture(g.TEXTURE_2D,m),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.NEAREST),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.NEAREST),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),m}function _(g,m,R,P,z){var F=g.getParameter(g.MAX_TEXTURE_SIZE);if(m<0||m>F||R<0||R>F)throw new Error("gl-texture2d: Invalid texture shape");if(z===g.FLOAT&&!g.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var B=M(g);return g.texImage2D(g.TEXTURE_2D,0,P,m,R,0,P,z,null),new l(g,B,m,R,P,z)}function w(g,m,R,P,z,F){var B=M(g);return g.texImage2D(g.TEXTURE_2D,0,z,z,F,m),new l(g,B,R,P,z,F)}function p(g,m){var R=m.dtype,P=m.shape.slice(),z=g.getParameter(g.MAX_TEXTURE_SIZE);if(P[0]<0||P[0]>z||P[1]<0||P[1]>z)throw new Error("gl-texture2d: Invalid texture size");var F=b(P,m.stride.slice()),B=0;R==="float32"?B=g.FLOAT:R==="float64"?(B=g.FLOAT,F=!1,R="float32"):R==="uint8"?B=g.UNSIGNED_BYTE:(B=g.UNSIGNED_BYTE,F=!1,R="uint8");var O=0;if(P.length===2)O=g.LUMINANCE,P=[P[0],P[1],1],m=o(m.data,P,[m.stride[0],m.stride[1],1],m.offset);else if(P.length===3)if(P[2]===1)O=g.ALPHA;else if(P[2]===2)O=g.LUMINANCE_ALPHA;else if(P[2]===3)O=g.RGB;else if(P[2]===4)O=g.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");B===g.FLOAT&&!g.getExtension("OES_texture_float")&&(B=g.UNSIGNED_BYTE,F=!1);var L,N,U=m.size;if(F)m.offset===0&&m.data.length===U?L=m.data:L=m.data.subarray(m.offset,m.offset+U);else{var Z=[P[2],P[2]*P[0],1];N=i.malloc(U,R);var Q=o(N,P,Z,0);(R==="float32"||R==="float64")&&B===g.UNSIGNED_BYTE?h(Q,m):a.assign(Q,m),L=N.subarray(0,U)}var ue=M(g);return g.texImage2D(g.TEXTURE_2D,0,O,P[0],P[1],0,O,B,L),F||i.free(N),new l(g,ue,P[0],P[1],O,B)}function u(g){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(n||f(g),typeof arguments[1]=="number")return _(g,arguments[1],arguments[2],arguments[3]||g.RGBA,arguments[4]||g.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return _(g,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||g.RGBA,arguments[3]||g.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var m=arguments[1],R=v(m)?m:m.raw;if(R)return w(g,R,m.width|0,m.height|0,arguments[2]||g.RGBA,arguments[3]||g.UNSIGNED_BYTE);if(m.shape&&m.data&&m.stride)return p(g,m)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}},1433:function(e){function t(r,o,a){o?o.bind():r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,null);var i=r.getParameter(r.MAX_VERTEX_ATTRIBS)|0;if(a){if(a.length>i)throw new Error("gl-vao: Too many vertex attributes");for(var n=0;n1?0:Math.acos(h)}},9226:function(e){e.exports=t;function t(r,o){return r[0]=Math.ceil(o[0]),r[1]=Math.ceil(o[1]),r[2]=Math.ceil(o[2]),r}},3126:function(e){e.exports=t;function t(r){var o=new Float32Array(3);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o}},3990:function(e){e.exports=t;function t(r,o){return r[0]=o[0],r[1]=o[1],r[2]=o[2],r}},1091:function(e){e.exports=t;function t(){var r=new Float32Array(3);return r[0]=0,r[1]=0,r[2]=0,r}},5911:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[0],f=a[1],v=a[2];return r[0]=n*v-s*f,r[1]=s*c-i*v,r[2]=i*f-n*c,r}},5455:function(e,t,r){e.exports=r(7056)},7056:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2];return Math.sqrt(a*a+i*i+n*n)}},4008:function(e,t,r){e.exports=r(6690)},6690:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]/a[0],r[1]=o[1]/a[1],r[2]=o[2]/a[2],r}},244:function(e){e.exports=t;function t(r,o){return r[0]*o[0]+r[1]*o[1]+r[2]*o[2]}},2613:function(e){e.exports=1e-6},9922:function(e,t,r){e.exports=a;var o=r(2613);function a(i,n){var s=i[0],c=i[1],f=i[2],v=n[0],h=n[1],T=n[2];return Math.abs(s-v)<=o*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(c-h)<=o*Math.max(1,Math.abs(c),Math.abs(h))&&Math.abs(f-T)<=o*Math.max(1,Math.abs(f),Math.abs(T))}},9265:function(e){e.exports=t;function t(r,o){return r[0]===o[0]&&r[1]===o[1]&&r[2]===o[2]}},2681:function(e){e.exports=t;function t(r,o){return r[0]=Math.floor(o[0]),r[1]=Math.floor(o[1]),r[2]=Math.floor(o[2]),r}},5137:function(e,t,r){e.exports=a;var o=r(1091)();function a(i,n,s,c,f,v){var h,T;for(n||(n=3),s||(s=0),c?T=Math.min(c*n+s,i.length):T=i.length,h=s;h0&&(s=1/Math.sqrt(s),r[0]=o[0]*s,r[1]=o[1]*s,r[2]=o[2]*s),r}},7636:function(e){e.exports=t;function t(r,o){o=o||1;var a=Math.random()*2*Math.PI,i=Math.random()*2-1,n=Math.sqrt(1-i*i)*o;return r[0]=Math.cos(a)*n,r[1]=Math.sin(a)*n,r[2]=i*o,r}},6894:function(e){e.exports=t;function t(r,o,a,i){var n=a[1],s=a[2],c=o[1]-n,f=o[2]-s,v=Math.sin(i),h=Math.cos(i);return r[0]=o[0],r[1]=n+c*h-f*v,r[2]=s+c*v+f*h,r}},109:function(e){e.exports=t;function t(r,o,a,i){var n=a[0],s=a[2],c=o[0]-n,f=o[2]-s,v=Math.sin(i),h=Math.cos(i);return r[0]=n+f*v+c*h,r[1]=o[1],r[2]=s+f*h-c*v,r}},8692:function(e){e.exports=t;function t(r,o,a,i){var n=a[0],s=a[1],c=o[0]-n,f=o[1]-s,v=Math.sin(i),h=Math.cos(i);return r[0]=n+c*h-f*v,r[1]=s+c*v+f*h,r[2]=o[2],r}},2447:function(e){e.exports=t;function t(r,o){return r[0]=Math.round(o[0]),r[1]=Math.round(o[1]),r[2]=Math.round(o[2]),r}},6621:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a,r[1]=o[1]*a,r[2]=o[2]*a,r}},8489:function(e){e.exports=t;function t(r,o,a,i){return r[0]=o[0]+a[0]*i,r[1]=o[1]+a[1]*i,r[2]=o[2]+a[2]*i,r}},1463:function(e){e.exports=t;function t(r,o,a,i){return r[0]=o,r[1]=a,r[2]=i,r}},6141:function(e,t,r){e.exports=r(2953)},5486:function(e,t,r){e.exports=r(3066)},2953:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2];return a*a+i*i+n*n}},3066:function(e){e.exports=t;function t(r){var o=r[0],a=r[1],i=r[2];return o*o+a*a+i*i}},2229:function(e,t,r){e.exports=r(6843)},6843:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]-a[0],r[1]=o[1]-a[1],r[2]=o[2]-a[2],r}},492:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2];return r[0]=i*a[0]+n*a[3]+s*a[6],r[1]=i*a[1]+n*a[4]+s*a[7],r[2]=i*a[2]+n*a[5]+s*a[8],r}},5673:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[3]*i+a[7]*n+a[11]*s+a[15];return c=c||1,r[0]=(a[0]*i+a[4]*n+a[8]*s+a[12])/c,r[1]=(a[1]*i+a[5]*n+a[9]*s+a[13])/c,r[2]=(a[2]*i+a[6]*n+a[10]*s+a[14])/c,r}},264:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[0],f=a[1],v=a[2],h=a[3],T=h*i+f*s-v*n,l=h*n+v*i-c*s,y=h*s+c*n-f*i,b=-c*i-f*n-v*s;return r[0]=T*h+b*-c+l*-v-y*-f,r[1]=l*h+b*-f+y*-c-T*-v,r[2]=y*h+b*-v+T*-f-l*-c,r}},4361:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]+a[0],r[1]=o[1]+a[1],r[2]=o[2]+a[2],r[3]=o[3]+a[3],r}},2335:function(e){e.exports=t;function t(r){var o=new Float32Array(4);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o}},2933:function(e){e.exports=t;function t(r,o){return r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=o[3],r}},7536:function(e){e.exports=t;function t(){var r=new Float32Array(4);return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}},4691:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2],s=o[3]-r[3];return Math.sqrt(a*a+i*i+n*n+s*s)}},1373:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]/a[0],r[1]=o[1]/a[1],r[2]=o[2]/a[2],r[3]=o[3]/a[3],r}},3750:function(e){e.exports=t;function t(r,o){return r[0]*o[0]+r[1]*o[1]+r[2]*o[2]+r[3]*o[3]}},3390:function(e){e.exports=t;function t(r,o,a,i){var n=new Float32Array(4);return n[0]=r,n[1]=o,n[2]=a,n[3]=i,n}},9970:function(e,t,r){e.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(e){e.exports=t;function t(r,o){return r[0]=1/o[0],r[1]=1/o[1],r[2]=1/o[2],r[3]=1/o[3],r}},6808:function(e){e.exports=t;function t(r){var o=r[0],a=r[1],i=r[2],n=r[3];return Math.sqrt(o*o+a*a+i*i+n*n)}},2573:function(e){e.exports=t;function t(r,o,a,i){var n=o[0],s=o[1],c=o[2],f=o[3];return r[0]=n+i*(a[0]-n),r[1]=s+i*(a[1]-s),r[2]=c+i*(a[2]-c),r[3]=f+i*(a[3]-f),r}},160:function(e){e.exports=t;function t(r,o,a){return r[0]=Math.max(o[0],a[0]),r[1]=Math.max(o[1],a[1]),r[2]=Math.max(o[2],a[2]),r[3]=Math.max(o[3],a[3]),r}},2334:function(e){e.exports=t;function t(r,o,a){return r[0]=Math.min(o[0],a[0]),r[1]=Math.min(o[1],a[1]),r[2]=Math.min(o[2],a[2]),r[3]=Math.min(o[3],a[3]),r}},3576:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a[0],r[1]=o[1]*a[1],r[2]=o[2]*a[2],r[3]=o[3]*a[3],r}},1498:function(e){e.exports=t;function t(r,o){return r[0]=-o[0],r[1]=-o[1],r[2]=-o[2],r[3]=-o[3],r}},5177:function(e){e.exports=t;function t(r,o){var a=o[0],i=o[1],n=o[2],s=o[3],c=a*a+i*i+n*n+s*s;return c>0&&(c=1/Math.sqrt(c),r[0]=a*c,r[1]=i*c,r[2]=n*c,r[3]=s*c),r}},9131:function(e,t,r){var o=r(5177),a=r(9288);e.exports=i;function i(n,s){return s=s||1,n[0]=Math.random(),n[1]=Math.random(),n[2]=Math.random(),n[3]=Math.random(),o(n,n),a(n,n,s),n}},9288:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a,r[1]=o[1]*a,r[2]=o[2]*a,r[3]=o[3]*a,r}},4844:function(e){e.exports=t;function t(r,o,a,i){return r[0]=o[0]+a[0]*i,r[1]=o[1]+a[1]*i,r[2]=o[2]+a[2]*i,r[3]=o[3]+a[3]*i,r}},4578:function(e){e.exports=t;function t(r,o,a,i,n){return r[0]=o,r[1]=a,r[2]=i,r[3]=n,r}},7960:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2],s=o[3]-r[3];return a*a+i*i+n*n+s*s}},483:function(e){e.exports=t;function t(r){var o=r[0],a=r[1],i=r[2],n=r[3];return o*o+a*a+i*i+n*n}},6860:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]-a[0],r[1]=o[1]-a[1],r[2]=o[2]-a[2],r[3]=o[3]-a[3],r}},5352:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=o[3];return r[0]=a[0]*i+a[4]*n+a[8]*s+a[12]*c,r[1]=a[1]*i+a[5]*n+a[9]*s+a[13]*c,r[2]=a[2]*i+a[6]*n+a[10]*s+a[14]*c,r[3]=a[3]*i+a[7]*n+a[11]*s+a[15]*c,r}},4041:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[0],f=a[1],v=a[2],h=a[3],T=h*i+f*s-v*n,l=h*n+v*i-c*s,y=h*s+c*n-f*i,b=-c*i-f*n-v*s;return r[0]=T*h+b*-c+l*-v-y*-f,r[1]=l*h+b*-f+y*-c-T*-v,r[2]=y*h+b*-v+T*-f-l*-c,r[3]=o[3],r}},1848:function(e,t,r){var o=r(4905),a=r(6468);e.exports=i;function i(n){for(var s=Array.isArray(n)?n:o(n),c=0;c0)continue;Re=Me.slice(0,1).join("")}return ee(Re),Q+=Re.length,L=L.slice(Re.length),L.length}while(!0)}function et(){return/[^a-fA-F0-9]/.test(B)?(ee(L.join("")),F=c,P):(L.push(B),O=B,P+1)}function Qe(){return B==="."||/[eE]/.test(B)?(L.push(B),F=b,O=B,P+1):B==="x"&&L.length===1&&L[0]==="0"?(F=u,L.push(B),O=B,P+1):/[^\d]/.test(B)?(ee(L.join("")),F=c,P):(L.push(B),O=B,P+1)}function Ke(){return B==="f"&&(L.push(B),O=B,P+=1),/[eE]/.test(B)||(B==="-"||B==="+")&&/[eE]/.test(O)?(L.push(B),O=B,P+1):/[^\d]/.test(B)?(ee(L.join("")),F=c,P):(L.push(B),O=B,P+1)}function Xe(){if(/[^\d\w_]/.test(B)){var Me=L.join("");return re[Me]?F=_:X[Me]?F=M:F=S,ee(L.join("")),F=c,P}return L.push(B),O=B,P+1}}},3508:function(e,t,r){var o=r(6852);o=o.slice().filter(function(a){return!/^(gl\_|texture)/.test(a)}),e.exports=o.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(e){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932:function(e,t,r){var o=r(620);e.exports=o.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(e){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827:function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(e,t,r){var o=r(5874);e.exports=a;function a(i,n){var s=o(n),c=[];return c=c.concat(s(i)),c=c.concat(s(null)),c}},3236:function(e){e.exports=function(t){typeof t=="string"&&(t=[t]);for(var r=[].slice.call(arguments,1),o=[],a=0;a>1,T=-7,l=a?n-1:0,y=a?-1:1,b=r[o+l];for(l+=y,s=b&(1<<-T)-1,b>>=-T,T+=f;T>0;s=s*256+r[o+l],l+=y,T-=8);for(c=s&(1<<-T)-1,s>>=-T,T+=i;T>0;c=c*256+r[o+l],l+=y,T-=8);if(s===0)s=1-h;else{if(s===v)return c?NaN:(b?-1:1)*(1/0);c=c+Math.pow(2,i),s=s-h}return(b?-1:1)*c*Math.pow(2,s-i)},t.write=function(r,o,a,i,n,s){var c,f,v,h=s*8-n-1,T=(1<>1,y=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=i?0:s-1,S=i?1:-1,M=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(f=isNaN(o)?1:0,c=T):(c=Math.floor(Math.log(o)/Math.LN2),o*(v=Math.pow(2,-c))<1&&(c--,v*=2),c+l>=1?o+=y/v:o+=y*Math.pow(2,1-l),o*v>=2&&(c++,v/=2),c+l>=T?(f=0,c=T):c+l>=1?(f=(o*v-1)*Math.pow(2,n),c=c+l):(f=o*Math.pow(2,l-1)*Math.pow(2,n),c=0));n>=8;r[a+b]=f&255,b+=S,f/=256,n-=8);for(c=c<0;r[a+b]=c&255,b+=S,c/=256,h-=8);r[a+b-S]|=M*128}},8954:function(e,t,r){e.exports=l;var o=r(3250),a=r(6803).Fw;function i(y,b,S){this.vertices=y,this.adjacent=b,this.boundary=S,this.lastVisited=-1}i.prototype.flip=function(){var y=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=y;var b=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=b};function n(y,b,S){this.vertices=y,this.cell=b,this.index=S}function s(y,b){return a(y.vertices,b.vertices)}function c(y){return function(){var b=this.tuple;return y.apply(this,b)}}function f(y){var b=o[y+1];return b||(b=o),c(b)}var v=[];function h(y,b,S){this.dimension=y,this.vertices=b,this.simplices=S,this.interior=S.filter(function(w){return!w.boundary}),this.tuple=new Array(y+1);for(var M=0;M<=y;++M)this.tuple[M]=this.vertices[M];var _=v[y];_||(_=v[y]=f(y)),this.orient=_}var T=h.prototype;T.handleBoundaryDegeneracy=function(y,b){var S=this.dimension,M=this.vertices.length-1,_=this.tuple,w=this.vertices,p=[y];for(y.lastVisited=-M;p.length>0;){y=p.pop();for(var u=y.adjacent,g=0;g<=S;++g){var m=u[g];if(!(!m.boundary||m.lastVisited<=-M)){for(var R=m.vertices,P=0;P<=S;++P){var z=R[P];z<0?_[P]=b:_[P]=w[z]}var F=this.orient();if(F>0)return m;m.lastVisited=-M,F===0&&p.push(m)}}}return null},T.walk=function(y,b){var S=this.vertices.length-1,M=this.dimension,_=this.vertices,w=this.tuple,p=b?this.interior.length*Math.random()|0:this.interior.length-1,u=this.interior[p];e:for(;!u.boundary;){for(var g=u.vertices,m=u.adjacent,R=0;R<=M;++R)w[R]=_[g[R]];u.lastVisited=S;for(var R=0;R<=M;++R){var P=m[R];if(!(P.lastVisited>=S)){var z=w[R];w[R]=y;var F=this.orient();if(w[R]=z,F<0){u=P;continue e}else P.boundary?P.lastVisited=-S:P.lastVisited=S}}return}return u},T.addPeaks=function(y,b){var S=this.vertices.length-1,M=this.dimension,_=this.vertices,w=this.tuple,p=this.interior,u=this.simplices,g=[b];b.lastVisited=S,b.vertices[b.vertices.indexOf(-1)]=S,b.boundary=!1,p.push(b);for(var m=[];g.length>0;){var b=g.pop(),R=b.vertices,P=b.adjacent,z=R.indexOf(S);if(!(z<0)){for(var F=0;F<=M;++F)if(F!==z){var B=P[F];if(!(!B.boundary||B.lastVisited>=S)){var O=B.vertices;if(B.lastVisited!==-S){for(var L=0,N=0;N<=M;++N)O[N]<0?(L=N,w[N]=y):w[N]=_[O[N]];var U=this.orient();if(U>0){O[L]=S,B.boundary=!1,p.push(B),g.push(B),B.lastVisited=S;continue}else B.lastVisited=-S}var Z=B.adjacent,Q=R.slice(),ue=P.slice(),oe=new i(Q,ue,!0);u.push(oe);var le=Z.indexOf(b);if(!(le<0)){Z[le]=oe,ue[z]=B,Q[F]=-1,ue[F]=b,P[F]=oe,oe.flip();for(var N=0;N<=M;++N){var j=Q[N];if(!(j<0||j===S)){for(var J=new Array(M-1),$=0,X=0;X<=M;++X){var re=Q[X];re<0||X===N||(J[$++]=re)}m.push(new n(J,oe,N))}}}}}}}m.sort(s);for(var F=0;F+1=0?p[g++]=u[R]:m=R&1;if(m===(y&1)){var P=p[0];p[0]=p[1],p[1]=P}b.push(p)}}return b};function l(y,b){var S=y.length;if(S===0)throw new Error("Must have at least d+1 points");var M=y[0].length;if(S<=M)throw new Error("Must input at least d+1 points");var _=y.slice(0,M+1),w=o.apply(void 0,_);if(w===0)throw new Error("Input not in general position");for(var p=new Array(M+1),u=0;u<=M;++u)p[u]=u;w<0&&(p[0]=1,p[1]=0);for(var g=new i(p,new Array(M+1),!1),m=g.adjacent,R=new Array(M+2),u=0;u<=M;++u){for(var P=p.slice(),z=0;z<=M;++z)z===u&&(P[z]=-1);var F=P[0];P[0]=P[1],P[1]=F;var B=new i(P,new Array(M+1),!0);m[u]=B,R[u]=B}R[M+1]=g;for(var u=0;u<=M;++u)for(var P=m[u].vertices,O=m[u].adjacent,z=0;z<=M;++z){var L=P[z];if(L<0){O[z]=g;continue}for(var N=0;N<=M;++N)m[N].vertices.indexOf(L)<0&&(O[z]=m[N])}for(var U=new h(M,_,R),Z=!!b,u=M+1;u3*(R+1)?h(this,m):this.left.insert(m):this.left=w([m]);else if(m[0]>this.mid)this.right?4*(this.right.count+1)>3*(R+1)?h(this,m):this.right.insert(m):this.right=w([m]);else{var P=o.ge(this.leftPoints,m,M),z=o.ge(this.rightPoints,m,_);this.leftPoints.splice(P,0,m),this.rightPoints.splice(z,0,m)}},c.remove=function(m){var R=this.count-this.leftPoints;if(m[1]3*(R-1))return T(this,m);var z=this.left.remove(m);return z===n?(this.left=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else if(m[0]>this.mid){if(!this.right)return a;var F=this.left?this.left.count:0;if(4*F>3*(R-1))return T(this,m);var z=this.right.remove(m);return z===n?(this.right=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else{if(this.count===1)return this.leftPoints[0]===m?n:a;if(this.leftPoints.length===1&&this.leftPoints[0]===m){if(this.left&&this.right){for(var B=this,O=this.left;O.right;)B=O,O=O.right;if(B===this)O.right=this.right;else{var L=this.left,z=this.right;B.count-=O.count,B.right=O.left,O.left=L,O.right=z}f(this,O),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?f(this,this.left):f(this,this.right);return i}for(var L=o.ge(this.leftPoints,m,M);L=0&&m[z][1]>=R;--z){var F=P(m[z]);if(F)return F}}function b(m,R){for(var P=0;Pthis.mid){if(this.right){var P=this.right.queryPoint(m,R);if(P)return P}return y(this.rightPoints,m,R)}else return b(this.leftPoints,R)},c.queryInterval=function(m,R,P){if(mthis.mid&&this.right){var z=this.right.queryInterval(m,R,P);if(z)return z}return Rthis.mid?y(this.rightPoints,m,P):b(this.leftPoints,P)};function S(m,R){return m-R}function M(m,R){var P=m[0]-R[0];return P||m[1]-R[1]}function _(m,R){var P=m[1]-R[1];return P||m[0]-R[0]}function w(m){if(m.length===0)return null;for(var R=[],P=0;P>1],F=[],B=[],O=[],P=0;P13)&&o!==32&&o!==133&&o!==160&&o!==5760&&o!==6158&&(o<8192||o>8205)&&o!==8232&&o!==8233&&o!==8239&&o!==8287&&o!==8288&&o!==12288&&o!==65279)return!1;return!0}},395:function(e){function t(r,o,a){return r*(1-a)+o*a}e.exports=t},2652:function(e,t,r){var o=r(4335),a=r(6864),i=r(1903),n=r(9921),s=r(7608),c=r(5665),f={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},v=a(),h=a(),T=[0,0,0,0],l=[[0,0,0],[0,0,0],[0,0,0]],y=[0,0,0];e.exports=function(w,p,u,g,m,R){if(p||(p=[0,0,0]),u||(u=[0,0,0]),g||(g=[0,0,0]),m||(m=[0,0,0,1]),R||(R=[0,0,0,1]),!o(v,w)||(i(h,v),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(n(h)<1e-8)))return!1;var P=v[3],z=v[7],F=v[11],B=v[12],O=v[13],L=v[14],N=v[15];if(P!==0||z!==0||F!==0){T[0]=P,T[1]=z,T[2]=F,T[3]=N;var U=s(h,h);if(!U)return!1;c(h,h),b(m,T,h)}else m[0]=m[1]=m[2]=0,m[3]=1;if(p[0]=B,p[1]=O,p[2]=L,S(l,v),u[0]=f.length(l[0]),f.normalize(l[0],l[0]),g[0]=f.dot(l[0],l[1]),M(l[1],l[1],l[0],1,-g[0]),u[1]=f.length(l[1]),f.normalize(l[1],l[1]),g[0]/=u[1],g[1]=f.dot(l[0],l[2]),M(l[2],l[2],l[0],1,-g[1]),g[2]=f.dot(l[1],l[2]),M(l[2],l[2],l[1],1,-g[2]),u[2]=f.length(l[2]),f.normalize(l[2],l[2]),g[1]/=u[2],g[2]/=u[2],f.cross(y,l[1],l[2]),f.dot(l[0],y)<0)for(var Z=0;Z<3;Z++)u[Z]*=-1,l[Z][0]*=-1,l[Z][1]*=-1,l[Z][2]*=-1;return R[0]=.5*Math.sqrt(Math.max(1+l[0][0]-l[1][1]-l[2][2],0)),R[1]=.5*Math.sqrt(Math.max(1-l[0][0]+l[1][1]-l[2][2],0)),R[2]=.5*Math.sqrt(Math.max(1-l[0][0]-l[1][1]+l[2][2],0)),R[3]=.5*Math.sqrt(Math.max(1+l[0][0]+l[1][1]+l[2][2],0)),l[2][1]>l[1][2]&&(R[0]=-R[0]),l[0][2]>l[2][0]&&(R[1]=-R[1]),l[1][0]>l[0][1]&&(R[2]=-R[2]),!0};function b(_,w,p){var u=w[0],g=w[1],m=w[2],R=w[3];return _[0]=p[0]*u+p[4]*g+p[8]*m+p[12]*R,_[1]=p[1]*u+p[5]*g+p[9]*m+p[13]*R,_[2]=p[2]*u+p[6]*g+p[10]*m+p[14]*R,_[3]=p[3]*u+p[7]*g+p[11]*m+p[15]*R,_}function S(_,w){_[0][0]=w[0],_[0][1]=w[1],_[0][2]=w[2],_[1][0]=w[4],_[1][1]=w[5],_[1][2]=w[6],_[2][0]=w[8],_[2][1]=w[9],_[2][2]=w[10]}function M(_,w,p,u,g){_[0]=w[0]*u+p[0]*g,_[1]=w[1]*u+p[1]*g,_[2]=w[2]*u+p[2]*g}},4335:function(e){e.exports=function(r,o){var a=o[15];if(a===0)return!1;for(var i=1/a,n=0;n<16;n++)r[n]=o[n]*i;return!0}},7442:function(e,t,r){var o=r(6658),a=r(7182),i=r(2652),n=r(9921),s=r(8648),c=T(),f=T(),v=T();e.exports=h;function h(b,S,M,_){if(n(S)===0||n(M)===0)return!1;var w=i(S,c.translate,c.scale,c.skew,c.perspective,c.quaternion),p=i(M,f.translate,f.scale,f.skew,f.perspective,f.quaternion);return!w||!p?!1:(o(v.translate,c.translate,f.translate,_),o(v.skew,c.skew,f.skew,_),o(v.scale,c.scale,f.scale,_),o(v.perspective,c.perspective,f.perspective,_),s(v.quaternion,c.quaternion,f.quaternion,_),a(b,v.translate,v.scale,v.skew,v.perspective,v.quaternion),!0)}function T(){return{translate:l(),scale:l(1),skew:l(),perspective:y(),quaternion:y()}}function l(b){return[b||0,b||0,b||0]}function y(){return[0,0,0,1]}},7182:function(e,t,r){var o={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)};o.create();var a=o.create();e.exports=function(n,s,c,f,v,h){return o.identity(n),o.fromRotationTranslation(n,h,s),n[3]=v[0],n[7]=v[1],n[11]=v[2],n[15]=v[3],o.identity(a),f[2]!==0&&(a[9]=f[2],o.multiply(n,n,a)),f[1]!==0&&(a[9]=0,a[8]=f[1],o.multiply(n,n,a)),f[0]!==0&&(a[8]=0,a[4]=f[0],o.multiply(n,n,a)),o.scale(n,n,c),n}},1811:function(e,t,r){var o=r(2478),a=r(7442),i=r(7608),n=r(5567),s=r(2408),c=r(7089),f=r(6582),v=r(7656);r(2504);var h=r(3536),T=[0,0,0];e.exports=S;function l(M){this._components=M.slice(),this._time=[0],this.prevMatrix=M.slice(),this.nextMatrix=M.slice(),this.computedMatrix=M.slice(),this.computedInverse=M.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]}var y=l.prototype;y.recalcMatrix=function(M){var _=this._time,w=o.le(_,M),p=this.computedMatrix;if(!(w<0)){var u=this._components;if(w===_.length-1)for(var g=16*w,m=0;m<16;++m)p[m]=u[g++];else{for(var R=_[w+1]-_[w],g=16*w,P=this.prevMatrix,z=!0,m=0;m<16;++m)P[m]=u[g++];for(var F=this.nextMatrix,m=0;m<16;++m)F[m]=u[g++],z=z&&P[m]===F[m];if(R<1e-6||z)for(var m=0;m<16;++m)p[m]=P[m];else a(p,P,F,(M-_[w])/R)}var B=this.computedUp;B[0]=p[1],B[1]=p[5],B[2]=p[9],h(B,B);var O=this.computedInverse;i(O,p);var L=this.computedEye,N=O[15];L[0]=O[12]/N,L[1]=O[13]/N,L[2]=O[14]/N;for(var U=this.computedCenter,Z=Math.exp(this.computedRadius[0]),m=0;m<3;++m)U[m]=L[m]-p[2+4*m]*Z}},y.idle=function(M){if(!(M1&&o(i[f[l-2]],i[f[l-1]],T)<=0;)l-=1,f.pop();for(f.push(h),l=v.length;l>1&&o(i[v[l-2]],i[v[l-1]],T)>=0;)l-=1,v.pop();v.push(h)}for(var y=new Array(v.length+f.length-2),b=0,s=0,S=f.length;s0;--M)y[b++]=v[M];return y}},351:function(e,t,r){e.exports=a;var o=r(4687);function a(i,n){n||(n=i,i=window);var s=0,c=0,f=0,v={shift:!1,alt:!1,control:!1,meta:!1},h=!1;function T(m){var R=!1;return"altKey"in m&&(R=R||m.altKey!==v.alt,v.alt=!!m.altKey),"shiftKey"in m&&(R=R||m.shiftKey!==v.shift,v.shift=!!m.shiftKey),"ctrlKey"in m&&(R=R||m.ctrlKey!==v.control,v.control=!!m.ctrlKey),"metaKey"in m&&(R=R||m.metaKey!==v.meta,v.meta=!!m.metaKey),R}function l(m,R){var P=o.x(R),z=o.y(R);"buttons"in R&&(m=R.buttons|0),(m!==s||P!==c||z!==f||T(R))&&(s=m|0,c=P||0,f=z||0,n&&n(s,c,f,v))}function y(m){l(0,m)}function b(){(s||c||f||v.shift||v.alt||v.meta||v.control)&&(c=f=0,s=0,v.shift=v.alt=v.control=v.meta=!1,n&&n(0,0,0,v))}function S(m){T(m)&&n&&n(s,c,f,v)}function M(m){o.buttons(m)===0?l(0,m):l(s,m)}function _(m){l(s|o.buttons(m),m)}function w(m){l(s&~o.buttons(m),m)}function p(){h||(h=!0,i.addEventListener("mousemove",M),i.addEventListener("mousedown",_),i.addEventListener("mouseup",w),i.addEventListener("mouseleave",y),i.addEventListener("mouseenter",y),i.addEventListener("mouseout",y),i.addEventListener("mouseover",y),i.addEventListener("blur",b),i.addEventListener("keyup",S),i.addEventListener("keydown",S),i.addEventListener("keypress",S),i!==window&&(window.addEventListener("blur",b),window.addEventListener("keyup",S),window.addEventListener("keydown",S),window.addEventListener("keypress",S)))}function u(){h&&(h=!1,i.removeEventListener("mousemove",M),i.removeEventListener("mousedown",_),i.removeEventListener("mouseup",w),i.removeEventListener("mouseleave",y),i.removeEventListener("mouseenter",y),i.removeEventListener("mouseout",y),i.removeEventListener("mouseover",y),i.removeEventListener("blur",b),i.removeEventListener("keyup",S),i.removeEventListener("keydown",S),i.removeEventListener("keypress",S),i!==window&&(window.removeEventListener("blur",b),window.removeEventListener("keyup",S),window.removeEventListener("keydown",S),window.removeEventListener("keypress",S)))}p();var g={element:i};return Object.defineProperties(g,{enabled:{get:function(){return h},set:function(m){m?p():u()},enumerable:!0},buttons:{get:function(){return s},enumerable:!0},x:{get:function(){return c},enumerable:!0},y:{get:function(){return f},enumerable:!0},mods:{get:function(){return v},enumerable:!0}}),g}},24:function(e){var t={left:0,top:0};e.exports=r;function r(a,i,n){i=i||a.currentTarget||a.srcElement,Array.isArray(n)||(n=[0,0]);var s=a.clientX||0,c=a.clientY||0,f=o(i);return n[0]=s-f.left,n[1]=c-f.top,n}function o(a){return a===window||a===document||a===document.body?t:a.getBoundingClientRect()}},4687:function(e,t){function r(n){if(typeof n=="object"){if("buttons"in n)return n.buttons;if("which"in n){var s=n.which;if(s===2)return 4;if(s===3)return 2;if(s>0)return 1<=0)return 1<0){if(ue=1,j[$++]=v(p[R],b,S,M),R+=U,_>0)for(Q=1,P=p[R],X=j[$]=v(P,b,S,M),q=j[$+re],fe=j[$+ae],Fe=j[$+we],(X!==q||X!==fe||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,q,fe,Fe,b,S,M),Ce=J[$]=oe++),$+=1,R+=U,Q=2;Q<_;++Q)P=p[R],X=j[$]=v(P,b,S,M),q=j[$+re],fe=j[$+ae],Fe=j[$+we],(X!==q||X!==fe||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,q,fe,Fe,b,S,M),Ce=J[$]=oe++,Fe!==q&&f(J[$+re],Ce,N,F,Fe,q,b,S,M)),$+=1,R+=U;for(R+=Z,$=0,qe=re,re=ee,ee=qe,qe=ae,ae=ie,ie=qe,qe=we,we=Ae,Ae=qe,ue=2;ue0)for(Q=1,P=p[R],X=j[$]=v(P,b,S,M),q=j[$+re],fe=j[$+ae],Fe=j[$+we],(X!==q||X!==fe||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,q,fe,Fe,b,S,M),Ce=J[$]=oe++,Fe!==fe&&f(J[$+ae],Ce,O,N,fe,Fe,b,S,M)),$+=1,R+=U,Q=2;Q<_;++Q)P=p[R],X=j[$]=v(P,b,S,M),q=j[$+re],fe=j[$+ae],Fe=j[$+we],(X!==q||X!==fe||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,q,fe,Fe,b,S,M),Ce=J[$]=oe++,Fe!==fe&&f(J[$+ae],Ce,O,N,fe,Fe,b,S,M),Fe!==q&&f(J[$+re],Ce,N,F,Fe,q,b,S,M)),$+=1,R+=U;ue&1&&($=0),qe=re,re=ee,ee=qe,qe=ae,ae=ie,ie=qe,qe=we,we=Ae,Ae=qe,R+=Z}}T(J),T(j)}},"false,1,0":function(c,f,v,h,T){return function(y,b,S,M){var _=y.shape[0]|0,w=y.shape[1]|0,p=y.data,u=y.offset|0,g=y.stride[0]|0,m=y.stride[1]|0,R=u,P,z=-g|0,F=0,B=-m|0,O=0,L=-g-m|0,N=0,U=m|0,Z=g-m*w|0,Q=0,ue=0,oe=0,le=2*w|0,j=h(le),J=h(le),$=0,X=0,re=-1,ee=-1,q=0,ae=-w|0,ie=w|0,fe=0,we=-w-1|0,Ae=w-1|0,Fe=0,Ce=0,qe=0;for(ue=0;ue0){if(Q=1,j[$++]=v(p[R],b,S,M),R+=U,w>0)for(ue=1,P=p[R],X=j[$]=v(P,b,S,M),fe=j[$+ae],q=j[$+re],Fe=j[$+we],(X!==fe||X!==q||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,fe,q,Fe,b,S,M),Ce=J[$]=oe++),$+=1,R+=U,ue=2;ue0)for(ue=1,P=p[R],X=j[$]=v(P,b,S,M),fe=j[$+ae],q=j[$+re],Fe=j[$+we],(X!==fe||X!==q||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,fe,q,Fe,b,S,M),Ce=J[$]=oe++,Fe!==fe&&f(J[$+ae],Ce,N,F,Fe,fe,b,S,M)),$+=1,R+=U,ue=2;ue 0"),typeof s.vertex!="function"&&c("Must specify vertex creation function"),typeof s.cell!="function"&&c("Must specify cell creation function"),typeof s.phase!="function"&&c("Must specify phase function");for(var T=s.getters||[],l=new Array(v),y=0;y=0?l[y]=!0:l[y]=!1;return i(s.vertex,s.cell,s.phase,h,f,l)}},6199:function(e,t,r){var o=r(1338),a={zero:function(S,M,_,w){var p=S[0],u=_[0];w|=0;var g=0,m=u;for(g=0;g2&&g[1]>2&&w(u.pick(-1,-1).lo(1,1).hi(g[0]-2,g[1]-2),p.pick(-1,-1,0).lo(1,1).hi(g[0]-2,g[1]-2),p.pick(-1,-1,1).lo(1,1).hi(g[0]-2,g[1]-2)),g[1]>2&&(_(u.pick(0,-1).lo(1).hi(g[1]-2),p.pick(0,-1,1).lo(1).hi(g[1]-2)),M(p.pick(0,-1,0).lo(1).hi(g[1]-2))),g[1]>2&&(_(u.pick(g[0]-1,-1).lo(1).hi(g[1]-2),p.pick(g[0]-1,-1,1).lo(1).hi(g[1]-2)),M(p.pick(g[0]-1,-1,0).lo(1).hi(g[1]-2))),g[0]>2&&(_(u.pick(-1,0).lo(1).hi(g[0]-2),p.pick(-1,0,0).lo(1).hi(g[0]-2)),M(p.pick(-1,0,1).lo(1).hi(g[0]-2))),g[0]>2&&(_(u.pick(-1,g[1]-1).lo(1).hi(g[0]-2),p.pick(-1,g[1]-1,0).lo(1).hi(g[0]-2)),M(p.pick(-1,g[1]-1,1).lo(1).hi(g[0]-2))),p.set(0,0,0,0),p.set(0,0,1,0),p.set(g[0]-1,0,0,0),p.set(g[0]-1,0,1,0),p.set(0,g[1]-1,0,0),p.set(0,g[1]-1,1,0),p.set(g[0]-1,g[1]-1,0,0),p.set(g[0]-1,g[1]-1,1,0),p}}function b(S){var M=S.join(),g=v[M];if(g)return g;for(var _=S.length,w=[h,T],p=1;p<=_;++p)w.push(l(p));var u=y,g=u.apply(void 0,w);return v[M]=g,g}e.exports=function(M,_,w){if(Array.isArray(w)||(typeof w=="string"?w=o(_.dimension,w):w=o(_.dimension,"clamp")),_.size===0)return M;if(_.dimension===0)return M.set(0),M;var p=b(w);return p(M,_)}},4317:function(e){function t(n,s){var c=Math.floor(s),f=s-c,v=0<=c&&c0;){O<64?(_=O,O=0):(_=64,O-=64);for(var L=v[1]|0;L>0;){L<64?(w=L,L=0):(w=64,L-=64),l=F+O*u+L*g,S=B+O*R+L*P;var N=0,U=0,Z=0,Q=m,ue=u-p*m,oe=g-_*u,le=z,j=R-p*z,J=P-_*R;for(Z=0;Z0;){P<64?(_=P,P=0):(_=64,P-=64);for(var z=v[0]|0;z>0;){z<64?(M=z,z=0):(M=64,z-=64),l=m+P*p+z*w,S=R+P*g+z*u;var F=0,B=0,O=p,L=w-_*p,N=g,U=u-_*g;for(B=0;B0;){B<64?(w=B,B=0):(w=64,B-=64);for(var O=v[0]|0;O>0;){O<64?(M=O,O=0):(M=64,O-=64);for(var L=v[1]|0;L>0;){L<64?(_=L,L=0):(_=64,L-=64),l=z+B*g+O*p+L*u,S=F+B*P+O*m+L*R;var N=0,U=0,Z=0,Q=g,ue=p-w*g,oe=u-M*p,le=P,j=m-w*P,J=R-M*m;for(Z=0;Z<_;++Z){for(U=0;Uy;){N=0,U=F-_;t:for(O=0;OQ)break t;U+=m,N+=R}for(N=F,U=F-_,O=0;O>1,L=O-z,N=O+z,U=F,Z=L,Q=O,ue=N,oe=B,le=b+1,j=S-1,J=!0,$,X,re,ee,q,ae,ie,fe,we,Ae=0,Fe=0,Ce=0,qe,et,Qe,Ke,Xe,Me,xe,ce,Re,$e,rt,Je,At,St,Rt,Ut,ir=g,ar=T(ir),Mr=T(ir);et=w*U,Qe=w*Z,Ut=_;e:for(qe=0;qe0){X=U,U=Z,Z=X;break e}if(Ce<0)break e;Ut+=R}et=w*ue,Qe=w*oe,Ut=_;e:for(qe=0;qe0){X=ue,ue=oe,oe=X;break e}if(Ce<0)break e;Ut+=R}et=w*U,Qe=w*Q,Ut=_;e:for(qe=0;qe0){X=U,U=Q,Q=X;break e}if(Ce<0)break e;Ut+=R}et=w*Z,Qe=w*Q,Ut=_;e:for(qe=0;qe0){X=Z,Z=Q,Q=X;break e}if(Ce<0)break e;Ut+=R}et=w*U,Qe=w*ue,Ut=_;e:for(qe=0;qe0){X=U,U=ue,ue=X;break e}if(Ce<0)break e;Ut+=R}et=w*Q,Qe=w*ue,Ut=_;e:for(qe=0;qe0){X=Q,Q=ue,ue=X;break e}if(Ce<0)break e;Ut+=R}et=w*Z,Qe=w*oe,Ut=_;e:for(qe=0;qe0){X=Z,Z=oe,oe=X;break e}if(Ce<0)break e;Ut+=R}et=w*Z,Qe=w*Q,Ut=_;e:for(qe=0;qe0){X=Z,Z=Q,Q=X;break e}if(Ce<0)break e;Ut+=R}et=w*ue,Qe=w*oe,Ut=_;e:for(qe=0;qe0){X=ue,ue=oe,oe=X;break e}if(Ce<0)break e;Ut+=R}for(et=w*U,Qe=w*Z,Ke=w*Q,Xe=w*ue,Me=w*oe,xe=w*F,ce=w*O,Re=w*B,Rt=0,Ut=_,qe=0;qe0)j--;else if(Ce<0){for(et=w*ae,Qe=w*le,Ke=w*j,Ut=_,qe=0;qe0)for(;;){ie=_+j*w,Rt=0;e:for(qe=0;qe0){if(--jB){e:for(;;){for(ie=_+le*w,Rt=0,Ut=_,qe=0;qe1&&y?S(l,y[0],y[1]):S(l)}var f={"uint32,1,0":function(h,T){return function(l){var y=l.data,b=l.offset|0,S=l.shape,M=l.stride,_=M[0]|0,w=S[0]|0,p=M[1]|0,u=S[1]|0,g=p,m=p,R=1;w<=32?h(0,w-1,y,b,_,p,w,u,g,m,R):T(0,w-1,y,b,_,p,w,u,g,m,R)}}};function v(h,T){var l=[T,h].join(","),y=f[l],b=n(h,T),S=c(h,T,b);return y(b,S)}e.exports=v},446:function(e,t,r){var o=r(7640),a={};function i(n){var s=n.order,c=n.dtype,f=[s,c],v=f.join(":"),h=a[v];return h||(a[v]=h=o(s,c)),h(n),n}e.exports=i},9618:function(e,t,r){var o=r(7163),a=typeof Float64Array<"u";function i(T,l){return T[0]-l[0]}function n(){var T=this.stride,l=new Array(T.length),y;for(y=0;y=0&&(p=_|0,w+=g*p,u-=p),new b(this.data,u,g,w)},S.step=function(_){var w=this.shape[0],p=this.stride[0],u=this.offset,g=0,m=Math.ceil;return typeof _=="number"&&(g=_|0,g<0?(u+=p*(w-1),w=m(-w/g)):w=m(w/g),p*=g),new b(this.data,w,p,u)},S.transpose=function(_){_=_===void 0?0:_|0;var w=this.shape,p=this.stride;return new b(this.data,w[_],p[_],this.offset)},S.pick=function(_){var w=[],p=[],u=this.offset;typeof _=="number"&&_>=0?u=u+this.stride[0]*_|0:(w.push(this.shape[0]),p.push(this.stride[0]));var g=l[w.length+1];return g(this.data,w,p,u)},function(_,w,p,u){return new b(_,w[0],p[0],u)}},2:function(T,l,y){function b(M,_,w,p,u,g){this.data=M,this.shape=[_,w],this.stride=[p,u],this.offset=g|0}var S=b.prototype;return S.dtype=T,S.dimension=2,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(S,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),S.set=function(_,w,p){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w,p):this.data[this.offset+this.stride[0]*_+this.stride[1]*w]=p},S.get=function(_,w){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w):this.data[this.offset+this.stride[0]*_+this.stride[1]*w]},S.index=function(_,w){return this.offset+this.stride[0]*_+this.stride[1]*w},S.hi=function(_,w){return new b(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,this.stride[0],this.stride[1],this.offset)},S.lo=function(_,w){var p=this.offset,u=0,g=this.shape[0],m=this.shape[1],R=this.stride[0],P=this.stride[1];return typeof _=="number"&&_>=0&&(u=_|0,p+=R*u,g-=u),typeof w=="number"&&w>=0&&(u=w|0,p+=P*u,m-=u),new b(this.data,g,m,R,P,p)},S.step=function(_,w){var p=this.shape[0],u=this.shape[1],g=this.stride[0],m=this.stride[1],R=this.offset,P=0,z=Math.ceil;return typeof _=="number"&&(P=_|0,P<0?(R+=g*(p-1),p=z(-p/P)):p=z(p/P),g*=P),typeof w=="number"&&(P=w|0,P<0?(R+=m*(u-1),u=z(-u/P)):u=z(u/P),m*=P),new b(this.data,p,u,g,m,R)},S.transpose=function(_,w){_=_===void 0?0:_|0,w=w===void 0?1:w|0;var p=this.shape,u=this.stride;return new b(this.data,p[_],p[w],u[_],u[w],this.offset)},S.pick=function(_,w){var p=[],u=[],g=this.offset;typeof _=="number"&&_>=0?g=g+this.stride[0]*_|0:(p.push(this.shape[0]),u.push(this.stride[0])),typeof w=="number"&&w>=0?g=g+this.stride[1]*w|0:(p.push(this.shape[1]),u.push(this.stride[1]));var m=l[p.length+1];return m(this.data,p,u,g)},function(_,w,p,u){return new b(_,w[0],w[1],p[0],p[1],u)}},3:function(T,l,y){function b(M,_,w,p,u,g,m,R){this.data=M,this.shape=[_,w,p],this.stride=[u,g,m],this.offset=R|0}var S=b.prototype;return S.dtype=T,S.dimension=3,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(S,"order",{get:function(){var _=Math.abs(this.stride[0]),w=Math.abs(this.stride[1]),p=Math.abs(this.stride[2]);return _>w?w>p?[2,1,0]:_>p?[1,2,0]:[1,0,2]:_>p?[2,0,1]:p>w?[0,1,2]:[0,2,1]}}),S.set=function(_,w,p,u){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p,u):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p]=u},S.get=function(_,w,p){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p]},S.index=function(_,w,p){return this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p},S.hi=function(_,w,p){return new b(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,typeof p!="number"||p<0?this.shape[2]:p|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},S.lo=function(_,w,p){var u=this.offset,g=0,m=this.shape[0],R=this.shape[1],P=this.shape[2],z=this.stride[0],F=this.stride[1],B=this.stride[2];return typeof _=="number"&&_>=0&&(g=_|0,u+=z*g,m-=g),typeof w=="number"&&w>=0&&(g=w|0,u+=F*g,R-=g),typeof p=="number"&&p>=0&&(g=p|0,u+=B*g,P-=g),new b(this.data,m,R,P,z,F,B,u)},S.step=function(_,w,p){var u=this.shape[0],g=this.shape[1],m=this.shape[2],R=this.stride[0],P=this.stride[1],z=this.stride[2],F=this.offset,B=0,O=Math.ceil;return typeof _=="number"&&(B=_|0,B<0?(F+=R*(u-1),u=O(-u/B)):u=O(u/B),R*=B),typeof w=="number"&&(B=w|0,B<0?(F+=P*(g-1),g=O(-g/B)):g=O(g/B),P*=B),typeof p=="number"&&(B=p|0,B<0?(F+=z*(m-1),m=O(-m/B)):m=O(m/B),z*=B),new b(this.data,u,g,m,R,P,z,F)},S.transpose=function(_,w,p){_=_===void 0?0:_|0,w=w===void 0?1:w|0,p=p===void 0?2:p|0;var u=this.shape,g=this.stride;return new b(this.data,u[_],u[w],u[p],g[_],g[w],g[p],this.offset)},S.pick=function(_,w,p){var u=[],g=[],m=this.offset;typeof _=="number"&&_>=0?m=m+this.stride[0]*_|0:(u.push(this.shape[0]),g.push(this.stride[0])),typeof w=="number"&&w>=0?m=m+this.stride[1]*w|0:(u.push(this.shape[1]),g.push(this.stride[1])),typeof p=="number"&&p>=0?m=m+this.stride[2]*p|0:(u.push(this.shape[2]),g.push(this.stride[2]));var R=l[u.length+1];return R(this.data,u,g,m)},function(_,w,p,u){return new b(_,w[0],w[1],w[2],p[0],p[1],p[2],u)}},4:function(T,l,y){function b(M,_,w,p,u,g,m,R,P,z){this.data=M,this.shape=[_,w,p,u],this.stride=[g,m,R,P],this.offset=z|0}var S=b.prototype;return S.dtype=T,S.dimension=4,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(S,"order",{get:y}),S.set=function(_,w,p,u,g){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p+this.stride[3]*u,g):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p+this.stride[3]*u]=g},S.get=function(_,w,p,u){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p+this.stride[3]*u):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p+this.stride[3]*u]},S.index=function(_,w,p,u){return this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p+this.stride[3]*u},S.hi=function(_,w,p,u){return new b(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,typeof p!="number"||p<0?this.shape[2]:p|0,typeof u!="number"||u<0?this.shape[3]:u|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},S.lo=function(_,w,p,u){var g=this.offset,m=0,R=this.shape[0],P=this.shape[1],z=this.shape[2],F=this.shape[3],B=this.stride[0],O=this.stride[1],L=this.stride[2],N=this.stride[3];return typeof _=="number"&&_>=0&&(m=_|0,g+=B*m,R-=m),typeof w=="number"&&w>=0&&(m=w|0,g+=O*m,P-=m),typeof p=="number"&&p>=0&&(m=p|0,g+=L*m,z-=m),typeof u=="number"&&u>=0&&(m=u|0,g+=N*m,F-=m),new b(this.data,R,P,z,F,B,O,L,N,g)},S.step=function(_,w,p,u){var g=this.shape[0],m=this.shape[1],R=this.shape[2],P=this.shape[3],z=this.stride[0],F=this.stride[1],B=this.stride[2],O=this.stride[3],L=this.offset,N=0,U=Math.ceil;return typeof _=="number"&&(N=_|0,N<0?(L+=z*(g-1),g=U(-g/N)):g=U(g/N),z*=N),typeof w=="number"&&(N=w|0,N<0?(L+=F*(m-1),m=U(-m/N)):m=U(m/N),F*=N),typeof p=="number"&&(N=p|0,N<0?(L+=B*(R-1),R=U(-R/N)):R=U(R/N),B*=N),typeof u=="number"&&(N=u|0,N<0?(L+=O*(P-1),P=U(-P/N)):P=U(P/N),O*=N),new b(this.data,g,m,R,P,z,F,B,O,L)},S.transpose=function(_,w,p,u){_=_===void 0?0:_|0,w=w===void 0?1:w|0,p=p===void 0?2:p|0,u=u===void 0?3:u|0;var g=this.shape,m=this.stride;return new b(this.data,g[_],g[w],g[p],g[u],m[_],m[w],m[p],m[u],this.offset)},S.pick=function(_,w,p,u){var g=[],m=[],R=this.offset;typeof _=="number"&&_>=0?R=R+this.stride[0]*_|0:(g.push(this.shape[0]),m.push(this.stride[0])),typeof w=="number"&&w>=0?R=R+this.stride[1]*w|0:(g.push(this.shape[1]),m.push(this.stride[1])),typeof p=="number"&&p>=0?R=R+this.stride[2]*p|0:(g.push(this.shape[2]),m.push(this.stride[2])),typeof u=="number"&&u>=0?R=R+this.stride[3]*u|0:(g.push(this.shape[3]),m.push(this.stride[3]));var P=l[g.length+1];return P(this.data,g,m,R)},function(_,w,p,u){return new b(_,w[0],w[1],w[2],w[3],p[0],p[1],p[2],p[3],u)}},5:function(l,y,b){function S(_,w,p,u,g,m,R,P,z,F,B,O){this.data=_,this.shape=[w,p,u,g,m],this.stride=[R,P,z,F,B],this.offset=O|0}var M=S.prototype;return M.dtype=l,M.dimension=5,Object.defineProperty(M,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(M,"order",{get:b}),M.set=function(w,p,u,g,m,R){return l==="generic"?this.data.set(this.offset+this.stride[0]*w+this.stride[1]*p+this.stride[2]*u+this.stride[3]*g+this.stride[4]*m,R):this.data[this.offset+this.stride[0]*w+this.stride[1]*p+this.stride[2]*u+this.stride[3]*g+this.stride[4]*m]=R},M.get=function(w,p,u,g,m){return l==="generic"?this.data.get(this.offset+this.stride[0]*w+this.stride[1]*p+this.stride[2]*u+this.stride[3]*g+this.stride[4]*m):this.data[this.offset+this.stride[0]*w+this.stride[1]*p+this.stride[2]*u+this.stride[3]*g+this.stride[4]*m]},M.index=function(w,p,u,g,m){return this.offset+this.stride[0]*w+this.stride[1]*p+this.stride[2]*u+this.stride[3]*g+this.stride[4]*m},M.hi=function(w,p,u,g,m){return new S(this.data,typeof w!="number"||w<0?this.shape[0]:w|0,typeof p!="number"||p<0?this.shape[1]:p|0,typeof u!="number"||u<0?this.shape[2]:u|0,typeof g!="number"||g<0?this.shape[3]:g|0,typeof m!="number"||m<0?this.shape[4]:m|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},M.lo=function(w,p,u,g,m){var R=this.offset,P=0,z=this.shape[0],F=this.shape[1],B=this.shape[2],O=this.shape[3],L=this.shape[4],N=this.stride[0],U=this.stride[1],Z=this.stride[2],Q=this.stride[3],ue=this.stride[4];return typeof w=="number"&&w>=0&&(P=w|0,R+=N*P,z-=P),typeof p=="number"&&p>=0&&(P=p|0,R+=U*P,F-=P),typeof u=="number"&&u>=0&&(P=u|0,R+=Z*P,B-=P),typeof g=="number"&&g>=0&&(P=g|0,R+=Q*P,O-=P),typeof m=="number"&&m>=0&&(P=m|0,R+=ue*P,L-=P),new S(this.data,z,F,B,O,L,N,U,Z,Q,ue,R)},M.step=function(w,p,u,g,m){var R=this.shape[0],P=this.shape[1],z=this.shape[2],F=this.shape[3],B=this.shape[4],O=this.stride[0],L=this.stride[1],N=this.stride[2],U=this.stride[3],Z=this.stride[4],Q=this.offset,ue=0,oe=Math.ceil;return typeof w=="number"&&(ue=w|0,ue<0?(Q+=O*(R-1),R=oe(-R/ue)):R=oe(R/ue),O*=ue),typeof p=="number"&&(ue=p|0,ue<0?(Q+=L*(P-1),P=oe(-P/ue)):P=oe(P/ue),L*=ue),typeof u=="number"&&(ue=u|0,ue<0?(Q+=N*(z-1),z=oe(-z/ue)):z=oe(z/ue),N*=ue),typeof g=="number"&&(ue=g|0,ue<0?(Q+=U*(F-1),F=oe(-F/ue)):F=oe(F/ue),U*=ue),typeof m=="number"&&(ue=m|0,ue<0?(Q+=Z*(B-1),B=oe(-B/ue)):B=oe(B/ue),Z*=ue),new S(this.data,R,P,z,F,B,O,L,N,U,Z,Q)},M.transpose=function(w,p,u,g,m){w=w===void 0?0:w|0,p=p===void 0?1:p|0,u=u===void 0?2:u|0,g=g===void 0?3:g|0,m=m===void 0?4:m|0;var R=this.shape,P=this.stride;return new S(this.data,R[w],R[p],R[u],R[g],R[m],P[w],P[p],P[u],P[g],P[m],this.offset)},M.pick=function(w,p,u,g,m){var R=[],P=[],z=this.offset;typeof w=="number"&&w>=0?z=z+this.stride[0]*w|0:(R.push(this.shape[0]),P.push(this.stride[0])),typeof p=="number"&&p>=0?z=z+this.stride[1]*p|0:(R.push(this.shape[1]),P.push(this.stride[1])),typeof u=="number"&&u>=0?z=z+this.stride[2]*u|0:(R.push(this.shape[2]),P.push(this.stride[2])),typeof g=="number"&&g>=0?z=z+this.stride[3]*g|0:(R.push(this.shape[3]),P.push(this.stride[3])),typeof m=="number"&&m>=0?z=z+this.stride[4]*m|0:(R.push(this.shape[4]),P.push(this.stride[4]));var F=y[R.length+1];return F(this.data,R,P,z)},function(w,p,u,g){return new S(w,p[0],p[1],p[2],p[3],p[4],u[0],u[1],u[2],u[3],u[4],g)}}};function c(T,l){var y=l===-1?"T":String(l),b=s[y];return l===-1?b(T):l===0?b(T,v[T][0]):b(T,v[T],n)}function f(T){if(o(T))return"buffer";if(a)switch(Object.prototype.toString.call(T)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(T)?"array":"generic"}var v={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function h(T,l,y,b){if(T===void 0){var u=v.array[0];return u([])}else typeof T=="number"&&(T=[T]);l===void 0&&(l=[T.length]);var S=l.length;if(y===void 0){y=new Array(S);for(var M=S-1,_=1;M>=0;--M)y[M]=_,_*=l[M]}if(b===void 0){b=0;for(var M=0;M>>0;e.exports=n;function n(s,c){if(isNaN(s)||isNaN(c))return NaN;if(s===c)return s;if(s===0)return c<0?-a:a;var f=o.hi(s),v=o.lo(s);return c>s==s>0?v===i?(f+=1,v=0):v+=1:v===0?(v=i,f-=1):v-=1,o.pack(v,f)}},8406:function(e,t){var r=1e-6,o=1e-6;t.vertexNormals=function(a,i,n){for(var s=i.length,c=new Array(s),f=n===void 0?r:n,v=0;vf)for(var R=c[l],P=1/Math.sqrt(p*g),m=0;m<3;++m){var z=(m+1)%3,F=(m+2)%3;R[m]+=P*(u[z]*w[F]-u[F]*w[z])}}for(var v=0;vf)for(var P=1/Math.sqrt(B),m=0;m<3;++m)R[m]*=P;else for(var m=0;m<3;++m)R[m]=0}return c},t.faceNormals=function(a,i,n){for(var s=a.length,c=new Array(s),f=n===void 0?o:n,v=0;vf?M=1/Math.sqrt(M):M=0;for(var l=0;l<3;++l)S[l]*=M;c[v]=S}return c}},4081:function(e){e.exports=t;function t(r,o,a,i,n,s,c,f,v,h){var T=o+s+h;if(l>0){var l=Math.sqrt(T+1);r[0]=.5*(c-v)/l,r[1]=.5*(f-i)/l,r[2]=.5*(a-s)/l,r[3]=.5*l}else{var y=Math.max(o,s,h),l=Math.sqrt(2*y-T+1);o>=y?(r[0]=.5*l,r[1]=.5*(n+a)/l,r[2]=.5*(f+i)/l,r[3]=.5*(c-v)/l):s>=y?(r[0]=.5*(a+n)/l,r[1]=.5*l,r[2]=.5*(v+c)/l,r[3]=.5*(f-i)/l):(r[0]=.5*(i+f)/l,r[1]=.5*(c+v)/l,r[2]=.5*l,r[3]=.5*(a-n)/l)}return r}},9977:function(e,t,r){e.exports=l;var o=r(9215),a=r(6582),i=r(7399),n=r(7608),s=r(4081);function c(y,b,S){return Math.sqrt(Math.pow(y,2)+Math.pow(b,2)+Math.pow(S,2))}function f(y,b,S,M){return Math.sqrt(Math.pow(y,2)+Math.pow(b,2)+Math.pow(S,2)+Math.pow(M,2))}function v(y,b){var S=b[0],M=b[1],_=b[2],w=b[3],p=f(S,M,_,w);p>1e-6?(y[0]=S/p,y[1]=M/p,y[2]=_/p,y[3]=w/p):(y[0]=y[1]=y[2]=0,y[3]=1)}function h(y,b,S){this.radius=o([S]),this.center=o(b),this.rotation=o(y),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 T=h.prototype;T.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},T.recalcMatrix=function(y){this.radius.curve(y),this.center.curve(y),this.rotation.curve(y);var b=this.computedRotation;v(b,b);var S=this.computedMatrix;i(S,b);var M=this.computedCenter,_=this.computedEye,w=this.computedUp,p=Math.exp(this.computedRadius[0]);_[0]=M[0]+p*S[2],_[1]=M[1]+p*S[6],_[2]=M[2]+p*S[10],w[0]=S[1],w[1]=S[5],w[2]=S[9];for(var u=0;u<3;++u){for(var g=0,m=0;m<3;++m)g+=S[u+4*m]*_[m];S[12+u]=-g}},T.getMatrix=function(y,b){this.recalcMatrix(y);var S=this.computedMatrix;if(b){for(var M=0;M<16;++M)b[M]=S[M];return b}return S},T.idle=function(y){this.center.idle(y),this.radius.idle(y),this.rotation.idle(y)},T.flush=function(y){this.center.flush(y),this.radius.flush(y),this.rotation.flush(y)},T.pan=function(y,b,S,M){b=b||0,S=S||0,M=M||0,this.recalcMatrix(y);var _=this.computedMatrix,w=_[1],p=_[5],u=_[9],g=c(w,p,u);w/=g,p/=g,u/=g;var m=_[0],R=_[4],P=_[8],z=m*w+R*p+P*u;m-=w*z,R-=p*z,P-=u*z;var F=c(m,R,P);m/=F,R/=F,P/=F,_[2],_[6],_[10];var B=m*b+w*S,O=R*b+p*S,L=P*b+u*S;this.center.move(y,B,O,L);var N=Math.exp(this.computedRadius[0]);N=Math.max(1e-4,N+M),this.radius.set(y,Math.log(N))},T.rotate=function(y,b,S,M){this.recalcMatrix(y),b=b||0,S=S||0;var _=this.computedMatrix,w=_[0],p=_[4],u=_[8],g=_[1],m=_[5],R=_[9],P=_[2],z=_[6],F=_[10],B=b*w+S*g,O=b*p+S*m,L=b*u+S*R,N=-(z*L-F*O),U=-(F*B-P*L),Z=-(P*O-z*B),Q=Math.sqrt(Math.max(0,1-Math.pow(N,2)-Math.pow(U,2)-Math.pow(Z,2))),ue=f(N,U,Z,Q);ue>1e-6?(N/=ue,U/=ue,Z/=ue,Q/=ue):(N=U=Z=0,Q=1);var oe=this.computedRotation,le=oe[0],j=oe[1],J=oe[2],$=oe[3],X=le*Q+$*N+j*Z-J*U,re=j*Q+$*U+J*N-le*Z,ee=J*Q+$*Z+le*U-j*N,q=$*Q-le*N-j*U-J*Z;if(M){N=P,U=z,Z=F;var ae=Math.sin(M)/c(N,U,Z);N*=ae,U*=ae,Z*=ae,Q=Math.cos(b),X=X*Q+q*N+re*Z-ee*U,re=re*Q+q*U+ee*N-X*Z,ee=ee*Q+q*Z+X*U-re*N,q=q*Q-X*N-re*U-ee*Z}var ie=f(X,re,ee,q);ie>1e-6?(X/=ie,re/=ie,ee/=ie,q/=ie):(X=re=ee=0,q=1),this.rotation.set(y,X,re,ee,q)},T.lookAt=function(y,b,S,M){this.recalcMatrix(y),S=S||this.computedCenter,b=b||this.computedEye,M=M||this.computedUp;var _=this.computedMatrix;a(_,b,S,M);var w=this.computedRotation;s(w,_[0],_[1],_[2],_[4],_[5],_[6],_[8],_[9],_[10]),v(w,w),this.rotation.set(y,w[0],w[1],w[2],w[3]);for(var p=0,u=0;u<3;++u)p+=Math.pow(S[u]-b[u],2);this.radius.set(y,.5*Math.log(Math.max(p,1e-6))),this.center.set(y,S[0],S[1],S[2])},T.translate=function(y,b,S,M){this.center.move(y,b||0,S||0,M||0)},T.setMatrix=function(y,b){var S=this.computedRotation;s(S,b[0],b[1],b[2],b[4],b[5],b[6],b[8],b[9],b[10]),v(S,S),this.rotation.set(y,S[0],S[1],S[2],S[3]);var M=this.computedMatrix;n(M,b);var _=M[15];if(Math.abs(_)>1e-6){var w=M[12]/_,p=M[13]/_,u=M[14]/_;this.recalcMatrix(y);var g=Math.exp(this.computedRadius[0]);this.center.set(y,w-M[2]*g,p-M[6]*g,u-M[10]*g),this.radius.idle(y)}else this.center.idle(y),this.radius.idle(y)},T.setDistance=function(y,b){b>0&&this.radius.set(y,Math.log(b))},T.setDistanceLimits=function(y,b){y>0?y=Math.log(y):y=-1/0,b>0?b=Math.log(b):b=1/0,b=Math.max(b,y),this.radius.bounds[0][0]=y,this.radius.bounds[1][0]=b},T.getDistanceLimits=function(y){var b=this.radius.bounds;return y?(y[0]=Math.exp(b[0][0]),y[1]=Math.exp(b[1][0]),y):[Math.exp(b[0][0]),Math.exp(b[1][0])]},T.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]}},T.fromJSON=function(y){var b=this.lastT(),S=y.center;S&&this.center.set(b,S[0],S[1],S[2]);var M=y.rotation;M&&this.rotation.set(b,M[0],M[1],M[2],M[3]);var _=y.distance;_&&_>0&&this.radius.set(b,Math.log(_)),this.setDistanceLimits(y.zoomMin,y.zoomMax)};function l(y){y=y||{};var b=y.center||[0,0,0],S=y.rotation||[0,0,0,1],M=y.radius||1;b=[].slice.call(b,0,3),S=[].slice.call(S,0,4),v(S,S);var _=new h(S,b,Math.log(M));return _.setDistanceLimits(y.zoomMin,y.zoomMax),("eye"in y||"up"in y)&&_.lookAt(0,y.eye,y.center,y.up),_}},1371:function(e,t,r){var o=r(3233);e.exports=function(i,n,s){return s=typeof s<"u"?s+"":" ",o(s,n)+i}},3202:function(e){e.exports=function(r,o){o||(o=[0,""]),r=String(r);var a=parseFloat(r,10);return o[0]=a,o[1]=r.match(/[\d.\-\+]*\s*(.*)/)[1]||"",o}},3088:function(e,t,r){e.exports=a;var o=r(3140);function a(i,n){for(var s=n.length|0,c=i.length,f=[new Array(s),new Array(s)],v=0;v0){m=f[z][u][0],P=z;break}R=m[P^1];for(var F=0;F<2;++F)for(var B=f[F][u],O=0;O0&&(m=L,R=N,P=F)}return g||m&&l(m,P),R}function b(p,u){var g=f[u][p][0],m=[p];l(g,u);for(var R=g[u^1];;){for(;R!==p;)m.push(R),R=y(m[m.length-2],R,!1);if(f[0][p].length+f[1][p].length===0)break;var P=m[m.length-1],z=p,F=m[1],B=y(P,z,!0);if(o(n[P],n[z],n[F],n[B])<0)break;m.push(p),R=y(P,z)}return m}function S(p,u){return u[1]===u[u.length-1]}for(var v=0;v0;){f[0][v].length;var w=b(v,M);S(_,w)?_.push.apply(_,w):(_.length>0&&T.push(_),_=w)}_.length>0&&T.push(_)}return T}},5609:function(e,t,r){e.exports=a;var o=r(3134);function a(i,n){for(var s=o(i,n.length),c=new Array(n.length),f=new Array(n.length),v=[],h=0;h0;){var l=v.pop();c[l]=!1;for(var y=s[l],h=0;h0}_=_.filter(w);for(var p=_.length,u=new Array(p),g=new Array(p),M=0;M0;){var ae=re.pop(),ie=Q[ae];c(ie,function(Ce,qe){return Ce-qe});var fe=ie.length,we=ee[ae],Ae;if(we===0){var B=_[ae];Ae=[B]}for(var M=0;M=0)&&(ee[Fe]=we^1,re.push(Fe),we===0)){var B=_[Fe];X(B)||(B.reverse(),Ae.push(B))}}we===0&&q.push(Ae)}return q}},5085:function(e,t,r){e.exports=y;var o=r(3250)[3],a=r(4209),i=r(3352),n=r(2478);function s(){return!0}function c(b){return function(S,M){var _=b[S];return _?!!_.queryPoint(M,s):!1}}function f(b){for(var S={},M=0;M0&&S[_]===M[0])w=b[_-1];else return 1;for(var p=1;w;){var u=w.key,g=o(M,u[0],u[1]);if(u[0][0]0)p=-1,w=w.right;else return 0;else if(g>0)w=w.left;else if(g<0)p=1,w=w.right;else return 0}return p}}function h(b){return 1}function T(b){return function(M){return b(M[0],M[1])?0:1}}function l(b,S){return function(_){return b(_[0],_[1])?0:S(_)}}function y(b){for(var S=b.length,M=[],_=[],w=0;w=h?(u=1,m=h+2*y+S):(u=-y/h,m=y*u+S)):(u=0,b>=0?(g=0,m=S):-b>=l?(g=1,m=l+2*b+S):(g=-b/l,m=b*g+S));else if(g<0)g=0,y>=0?(u=0,m=S):-y>=h?(u=1,m=h+2*y+S):(u=-y/h,m=y*u+S);else{var R=1/p;u*=R,g*=R,m=u*(h*u+T*g+2*y)+g*(T*u+l*g+2*b)+S}else{var P,z,F,B;u<0?(P=T+y,z=l+b,z>P?(F=z-P,B=h-2*T+l,F>=B?(u=1,g=0,m=h+2*y+S):(u=F/B,g=1-u,m=u*(h*u+T*g+2*y)+g*(T*u+l*g+2*b)+S)):(u=0,z<=0?(g=1,m=l+2*b+S):b>=0?(g=0,m=S):(g=-b/l,m=b*g+S))):g<0?(P=T+b,z=h+y,z>P?(F=z-P,B=h-2*T+l,F>=B?(g=1,u=0,m=l+2*b+S):(g=F/B,u=1-g,m=u*(h*u+T*g+2*y)+g*(T*u+l*g+2*b)+S)):(g=0,z<=0?(u=1,m=h+2*y+S):y>=0?(u=0,m=S):(u=-y/h,m=y*u+S))):(F=l+b-T-y,F<=0?(u=0,g=1,m=l+2*b+S):(B=h-2*T+l,F>=B?(u=1,g=0,m=h+2*y+S):(u=F/B,g=1-u,m=u*(h*u+T*g+2*y)+g*(T*u+l*g+2*b)+S)))}for(var O=1-u-g,v=0;v0){var l=s[f-1];if(o(h,l)===0&&i(l)!==T){f-=1;continue}}s[f++]=h}}return s.length=f,s}},3233:function(e){var t="",r;e.exports=o;function o(a,i){if(typeof a!="string")throw new TypeError("expected a string");if(i===1)return a;if(i===2)return a+a;var n=a.length*i;if(r!==a||typeof r>"u")r=a,t="";else if(t.length>=n)return t.substr(0,n);for(;n>t.length&&i>1;)i&1&&(t+=a),i>>=1,a+=a;return t+=a,t=t.substr(0,n),t}},3025:function(e,t,r){e.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(e){e.exports=t;function t(r){for(var o=r.length,a=r[r.length-1],i=o,n=o-2;n>=0;--n){var s=a,c=r[n];a=s+c;var f=a-s,v=c-f;v&&(r[--i]=a,a=v)}for(var h=0,n=i;n0){if(z<=0)return F;B=P+z}else if(P<0){if(z>=0)return F;B=-(P+z)}else return F;var O=f*B;return F>=O||F<=-O?F:b(g,m,R)},function(g,m,R,P){var z=g[0]-P[0],F=m[0]-P[0],B=R[0]-P[0],O=g[1]-P[1],L=m[1]-P[1],N=R[1]-P[1],U=g[2]-P[2],Z=m[2]-P[2],Q=R[2]-P[2],ue=F*N,oe=B*L,le=B*O,j=z*N,J=z*L,$=F*O,X=U*(ue-oe)+Z*(le-j)+Q*(J-$),re=(Math.abs(ue)+Math.abs(oe))*Math.abs(U)+(Math.abs(le)+Math.abs(j))*Math.abs(Z)+(Math.abs(J)+Math.abs($))*Math.abs(Q),ee=v*re;return X>ee||-X>ee?X:S(g,m,R,P)}];function _(u){var g=M[u.length];return g||(g=M[u.length]=y(u.length)),g.apply(void 0,u)}function w(u,g,m,R,P,z,F){return function(O,L,N,U,Z){switch(arguments.length){case 0:case 1:return 0;case 2:return R(O,L);case 3:return P(O,L,N);case 4:return z(O,L,N,U);case 5:return F(O,L,N,U,Z)}for(var Q=new Array(arguments.length),ue=0;ue0&&h>0||v<0&&h<0)return!1;var T=o(c,n,s),l=o(f,n,s);return T>0&&l>0||T<0&&l<0?!1:v===0&&h===0&&T===0&&l===0?a(n,s,c,f):!0}},8545:function(e){e.exports=r;function t(o,a){var i=o+a,n=i-o,s=i-n,c=a-n,f=o-s,v=f+c;return v?[v,i]:[i]}function r(o,a){var i=o.length|0,n=a.length|0;if(i===1&&n===1)return t(o[0],-a[0]);var s=i+n,c=new Array(s),f=0,v=0,h=0,T=Math.abs,l=o[v],y=T(l),b=-a[h],S=T(b),M,_;y=n?(M=l,v+=1,v=n?(M=l,v+=1,v"u"&&(M=s(y));var _=y.length;if(_===0||M<1)return{cells:[],vertexIds:[],vertexWeights:[]};var w=c(b,+S),p=f(y,M),u=v(p,b,w,+S),g=h(p,b.length|0),m=n(M)(y,p.data,g,w),R=T(p),P=[].slice.call(u.data,0,u.shape[0]);return a.free(w),a.free(p.data),a.free(u.data),a.free(g),{cells:m,vertexIds:R,vertexWeights:P}}},1570:function(e){e.exports=r;var t=[function(){function a(i,n,s,c){for(var f=i.length,v=[],h=0;h>1,b=s[2*y+1];if(b===h)return y;h>1,b=s[2*y+1];if(b===h)return y;h>1,b=s[2*y+1];if(b===h)return y;h0)-(i<0)},t.abs=function(i){var n=i>>r-1;return(i^n)-n},t.min=function(i,n){return n^(i^n)&-(i65535)<<4,i>>>=n,s=(i>255)<<3,i>>>=s,n|=s,s=(i>15)<<2,i>>>=s,n|=s,s=(i>3)<<1,i>>>=s,n|=s,n|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var n=32;return i&=-i,i&&n--,i&65535&&(n-=16),i&16711935&&(n-=8),i&252645135&&(n-=4),i&858993459&&(n-=2),i&1431655765&&(n-=1),n}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var a=new Array(256);(function(i){for(var n=0;n<256;++n){var s=n,c=n,f=7;for(s>>>=1;s;s>>>=1)c<<=1,c|=s&1,--f;i[n]=c<>>8&255]<<16|a[i>>>16&255]<<8|a[i>>>24&255]},t.interleave2=function(i,n){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,n&=65535,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,i|n<<1},t.deinterleave2=function(i,n){return i=i>>>n&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,n,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,i|=n<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,n){return i=i>>>n&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var n=i|i-1;return n+1|(~n&-~n)-1>>>o(i)+1}},2014:function(e,t,r){"use restrict";var o=r(3105),a=r(4623);function i(u){for(var g=0,m=Math.max,R=0,P=u.length;R>1,F=c(u[z],g);F<=0?(F===0&&(P=z),m=z+1):F>0&&(R=z-1)}return P}t.findCell=T;function l(u,g){for(var m=new Array(u.length),R=0,P=m.length;R=u.length||c(u[Q],z)!==0););}return m}t.incidence=l;function y(u,g){if(!g)return l(h(S(u,0)),u);for(var m=new Array(g),R=0;R>>L&1&&O.push(P[L]);g.push(O)}return v(g)}t.explode=b;function S(u,g){if(g<0)return[];for(var m=[],R=(1<>1:(le>>1)-1}function R(le){for(var j=g(le);;){var J=j,$=2*le+1,X=2*(le+1),re=le;if($0;){var J=m(le);if(J>=0){var $=g(J);if(j<$){u(le,J),le=J;continue}}return le}}function z(){if(U>0){var le=O[0];return u(0,U-1),U-=1,R(0),le}return-1}function F(le,j){var J=O[le];return y[J]===j?le:(y[J]=-1/0,P(le),z(),y[J]=j,U+=1,P(U-1))}function B(le){if(!b[le]){b[le]=!0;var j=T[le],J=l[le];T[J]>=0&&(T[J]=j),l[j]>=0&&(l[j]=J),L[j]>=0&&F(L[j],p(j)),L[J]>=0&&F(L[J],p(J))}}for(var O=[],L=new Array(v),S=0;S>1;S>=0;--S)R(S);for(;;){var Z=z();if(Z<0||y[Z]>f)break;B(Z)}for(var Q=[],S=0;S=0&&J>=0&&j!==J){var $=L[j],X=L[J];$!==X&&oe.push([$,X])}}),a.unique(a.normalize(oe)),{positions:Q,edges:oe}}},1303:function(e,t,r){e.exports=i;var o=r(3250);function a(n,s){var c,f;if(s[0][0]s[1][0])c=s[1],f=s[0];else{var v=Math.min(n[0][1],n[1][1]),h=Math.max(n[0][1],n[1][1]),T=Math.min(s[0][1],s[1][1]),l=Math.max(s[0][1],s[1][1]);return hl?v-l:h-l}var y,b;n[0][1]s[1][0])c=s[1],f=s[0];else return a(s,n);var v,h;if(n[0][0]n[1][0])v=n[1],h=n[0];else return-a(n,s);var T=o(c,f,h),l=o(c,f,v);if(T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;if(T=o(h,v,f),l=o(h,v,c),T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;return f[0]-h[0]}},4209:function(e,t,r){e.exports=l;var o=r(2478),a=r(3840),i=r(3250),n=r(1303);function s(y,b,S){this.slabs=y,this.coordinates=b,this.horizontal=S}var c=s.prototype;function f(y,b){return y.y-b}function v(y,b){for(var S=null;y;){var M=y.key,_,w;M[0][0]0)if(b[0]!==M[1][0])S=y,y=y.right;else{var u=v(y.right,b);if(u)return u;y=y.left}else{if(b[0]!==M[1][0])return y;var u=v(y.right,b);if(u)return u;y=y.left}}return S}c.castUp=function(y){var b=o.le(this.coordinates,y[0]);if(b<0)return-1;this.slabs[b];var S=v(this.slabs[b],y),M=-1;if(S&&(M=S.value),this.coordinates[b]===y[0]){var _=null;if(S&&(_=S.key),b>0){var w=v(this.slabs[b-1],y);w&&(_?n(w.key,_)>0&&(_=w.key,M=w.value):(M=w.value,_=w.key))}var p=this.horizontal[b];if(p.length>0){var u=o.ge(p,y[1],f);if(u=p.length)return M;g=p[u]}}if(g.start)if(_){var m=i(_[0],_[1],[y[0],g.y]);_[0][0]>_[1][0]&&(m=-m),m>0&&(M=g.index)}else M=g.index;else g.y!==y[1]&&(M=g.index)}}}return M};function h(y,b,S,M){this.y=y,this.index=b,this.start=S,this.closed=M}function T(y,b,S,M){this.x=y,this.segment=b,this.create=S,this.index=M}function l(y){for(var b=y.length,S=2*b,M=new Array(S),_=0;_1&&(b=1);for(var S=1-b,M=v.length,_=new Array(M),w=0;w0||y>0&&_<0){var w=n(b,_,S,y);T.push(w),l.push(w.slice())}_<0?l.push(S.slice()):_>0?T.push(S.slice()):(T.push(S.slice()),l.push(S.slice())),y=_}return{positive:T,negative:l}}function c(v,h){for(var T=[],l=i(v[v.length-1],h),y=v[v.length-1],b=v[0],S=0;S0||l>0&&M<0)&&T.push(n(y,M,b,l)),M>=0&&T.push(b.slice()),l=M}return T}function f(v,h){for(var T=[],l=i(v[v.length-1],h),y=v[v.length-1],b=v[0],S=0;S0||l>0&&M<0)&&T.push(n(y,M,b,l)),M<=0&&T.push(b.slice()),l=M}return T}},3387:function(e,t,r){var o;(function(){var a={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 i(v){return s(f(v),arguments)}function n(v,h){return i.apply(null,[v].concat(h||[]))}function s(v,h){var T=1,l=v.length,y,b="",S,M,_,w,p,u,g,m;for(S=0;S=0),_.type){case"b":y=parseInt(y,10).toString(2);break;case"c":y=String.fromCharCode(parseInt(y,10));break;case"d":case"i":y=parseInt(y,10);break;case"j":y=JSON.stringify(y,null,_.width?parseInt(_.width):0);break;case"e":y=_.precision?parseFloat(y).toExponential(_.precision):parseFloat(y).toExponential();break;case"f":y=_.precision?parseFloat(y).toFixed(_.precision):parseFloat(y);break;case"g":y=_.precision?String(Number(y.toPrecision(_.precision))):parseFloat(y);break;case"o":y=(parseInt(y,10)>>>0).toString(8);break;case"s":y=String(y),y=_.precision?y.substring(0,_.precision):y;break;case"t":y=String(!!y),y=_.precision?y.substring(0,_.precision):y;break;case"T":y=Object.prototype.toString.call(y).slice(8,-1).toLowerCase(),y=_.precision?y.substring(0,_.precision):y;break;case"u":y=parseInt(y,10)>>>0;break;case"v":y=y.valueOf(),y=_.precision?y.substring(0,_.precision):y;break;case"x":y=(parseInt(y,10)>>>0).toString(16);break;case"X":y=(parseInt(y,10)>>>0).toString(16).toUpperCase();break}a.json.test(_.type)?b+=y:(a.number.test(_.type)&&(!g||_.sign)?(m=g?"+":"-",y=y.toString().replace(a.sign,"")):m="",p=_.pad_char?_.pad_char==="0"?"0":_.pad_char.charAt(1):" ",u=_.width-(m+y).length,w=_.width&&u>0?p.repeat(u):"",b+=_.align?m+y+w:p==="0"?m+w+y:w+m+y)}return b}var c=Object.create(null);function f(v){if(c[v])return c[v];for(var h=v,T,l=[],y=0;h;){if((T=a.text.exec(h))!==null)l.push(T[0]);else if((T=a.modulo.exec(h))!==null)l.push("%");else if((T=a.placeholder.exec(h))!==null){if(T[2]){y|=1;var b=[],S=T[2],M=[];if((M=a.key.exec(S))!==null)for(b.push(M[1]);(S=S.substring(M[0].length))!=="";)if((M=a.key_access.exec(S))!==null)b.push(M[1]);else if((M=a.index_access.exec(S))!==null)b.push(M[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");T[2]=b}else y|=2;if(y===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");l.push({placeholder:T[0],param_no:T[1],keys:T[2],sign:T[3],pad_char:T[4],align:T[5],width:T[6],precision:T[7],type:T[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");h=h.substring(T[0].length)}return c[v]=l}t.sprintf=i,t.vsprintf=n,typeof window<"u"&&(window.sprintf=i,window.vsprintf=n,o=(function(){return{sprintf:i,vsprintf:n}}).call(t,r,t,e),o!==void 0&&(e.exports=o))})()},3711:function(e,t,r){e.exports=f;var o=r(2640),a=r(781),i={"2d":function(v,h,T){var l=v({order:h,scalarArguments:3,getters:T==="generic"?[0]:void 0,phase:function(b,S,M,_){return b>_|0},vertex:function(b,S,M,_,w,p,u,g,m,R,P,z,F){var B=(u<<0)+(g<<1)+(m<<2)+(R<<3)|0;if(!(B===0||B===15))switch(B){case 0:P.push([b-.5,S-.5]);break;case 1:P.push([b-.25-.25*(_+M-2*F)/(M-_),S-.25-.25*(w+M-2*F)/(M-w)]);break;case 2:P.push([b-.75-.25*(-_-M+2*F)/(_-M),S-.25-.25*(p+_-2*F)/(_-p)]);break;case 3:P.push([b-.5,S-.5-.5*(w+M+p+_-4*F)/(M-w+_-p)]);break;case 4:P.push([b-.25-.25*(p+w-2*F)/(w-p),S-.75-.25*(-w-M+2*F)/(w-M)]);break;case 5:P.push([b-.5-.5*(_+M+p+w-4*F)/(M-_+w-p),S-.5]);break;case 6:P.push([b-.5-.25*(-_-M+p+w)/(_-M+w-p),S-.5-.25*(-w-M+p+_)/(w-M+_-p)]);break;case 7:P.push([b-.75-.25*(p+w-2*F)/(w-p),S-.75-.25*(p+_-2*F)/(_-p)]);break;case 8:P.push([b-.75-.25*(-p-w+2*F)/(p-w),S-.75-.25*(-p-_+2*F)/(p-_)]);break;case 9:P.push([b-.5-.25*(_+M+-p-w)/(M-_+p-w),S-.5-.25*(w+M+-p-_)/(M-w+p-_)]);break;case 10:P.push([b-.5-.5*(-_-M+-p-w+4*F)/(_-M+p-w),S-.5]);break;case 11:P.push([b-.25-.25*(-p-w+2*F)/(p-w),S-.75-.25*(w+M-2*F)/(M-w)]);break;case 12:P.push([b-.5,S-.5-.5*(-w-M+-p-_+4*F)/(w-M+p-_)]);break;case 13:P.push([b-.75-.25*(_+M-2*F)/(M-_),S-.25-.25*(-p-_+2*F)/(p-_)]);break;case 14:P.push([b-.25-.25*(-_-M+2*F)/(_-M),S-.25-.25*(-w-M+2*F)/(w-M)]);break;case 15:P.push([b-.5,S-.5]);break}},cell:function(b,S,M,_,w,p,u,g,m){w?g.push([b,S]):g.push([S,b])}});return function(y,b){var S=[],M=[];return l(y,S,M,b),{positions:S,cells:M}}}};function n(v,h){var T=v.length+"d",l=i[T];if(l)return l(o,v,h)}function s(v,h){for(var T=a(v,h),l=T.length,y=new Array(l),b=new Array(l),S=0;SMath.max(_,w)?p[2]=1:_>Math.max(M,w)?p[0]=1:p[1]=1;for(var u=0,g=0,m=0;m<3;++m)u+=S[m]*S[m],g+=p[m]*S[m];for(var m=0;m<3;++m)p[m]-=g/u*S[m];return s(p,p),p}function T(S,M,_,w,p,u,g,m){this.center=o(_),this.up=o(w),this.right=o(p),this.radius=o([u]),this.angle=o([g,m]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(S,M),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 R=0;R<16;++R)this.computedMatrix[R]=.5;this.recalcMatrix(0)}var l=T.prototype;l.setDistanceLimits=function(S,M){S>0?S=Math.log(S):S=-1/0,M>0?M=Math.log(M):M=1/0,M=Math.max(M,S),this.radius.bounds[0][0]=S,this.radius.bounds[1][0]=M},l.getDistanceLimits=function(S){var M=this.radius.bounds[0];return S?(S[0]=Math.exp(M[0][0]),S[1]=Math.exp(M[1][0]),S):[Math.exp(M[0][0]),Math.exp(M[1][0])]},l.recalcMatrix=function(S){this.center.curve(S),this.up.curve(S),this.right.curve(S),this.radius.curve(S),this.angle.curve(S);for(var M=this.computedUp,_=this.computedRight,w=0,p=0,u=0;u<3;++u)p+=M[u]*_[u],w+=M[u]*M[u];for(var g=Math.sqrt(w),m=0,u=0;u<3;++u)_[u]-=M[u]*p/w,m+=_[u]*_[u],M[u]/=g;for(var R=Math.sqrt(m),u=0;u<3;++u)_[u]/=R;var P=this.computedToward;n(P,M,_),s(P,P);for(var z=Math.exp(this.computedRadius[0]),F=this.computedAngle[0],B=this.computedAngle[1],O=Math.cos(F),L=Math.sin(F),N=Math.cos(B),U=Math.sin(B),Z=this.computedCenter,Q=O*N,ue=L*N,oe=U,le=-O*U,j=-L*U,J=N,$=this.computedEye,X=this.computedMatrix,u=0;u<3;++u){var re=Q*_[u]+ue*P[u]+oe*M[u];X[4*u+1]=le*_[u]+j*P[u]+J*M[u],X[4*u+2]=re,X[4*u+3]=0}var ee=X[1],q=X[5],ae=X[9],ie=X[2],fe=X[6],we=X[10],Ae=q*we-ae*fe,Fe=ae*ie-ee*we,Ce=ee*fe-q*ie,qe=f(Ae,Fe,Ce);Ae/=qe,Fe/=qe,Ce/=qe,X[0]=Ae,X[4]=Fe,X[8]=Ce;for(var u=0;u<3;++u)$[u]=Z[u]+X[2+4*u]*z;for(var u=0;u<3;++u){for(var m=0,et=0;et<3;++et)m+=X[u+4*et]*$[et];X[12+u]=-m}X[15]=1},l.getMatrix=function(S,M){this.recalcMatrix(S);var _=this.computedMatrix;if(M){for(var w=0;w<16;++w)M[w]=_[w];return M}return _};var y=[0,0,0];l.rotate=function(S,M,_,w){if(this.angle.move(S,M,_),w){this.recalcMatrix(S);var p=this.computedMatrix;y[0]=p[2],y[1]=p[6],y[2]=p[10];for(var u=this.computedUp,g=this.computedRight,m=this.computedToward,R=0;R<3;++R)p[4*R]=u[R],p[4*R+1]=g[R],p[4*R+2]=m[R];i(p,p,w,y);for(var R=0;R<3;++R)u[R]=p[4*R],g[R]=p[4*R+1];this.up.set(S,u[0],u[1],u[2]),this.right.set(S,g[0],g[1],g[2])}},l.pan=function(S,M,_,w){M=M||0,_=_||0,w=w||0,this.recalcMatrix(S);var p=this.computedMatrix;Math.exp(this.computedRadius[0]);var u=p[1],g=p[5],m=p[9],R=f(u,g,m);u/=R,g/=R,m/=R;var P=p[0],z=p[4],F=p[8],B=P*u+z*g+F*m;P-=u*B,z-=g*B,F-=m*B;var O=f(P,z,F);P/=O,z/=O,F/=O;var L=P*M+u*_,N=z*M+g*_,U=F*M+m*_;this.center.move(S,L,N,U);var Z=Math.exp(this.computedRadius[0]);Z=Math.max(1e-4,Z+w),this.radius.set(S,Math.log(Z))},l.translate=function(S,M,_,w){this.center.move(S,M||0,_||0,w||0)},l.setMatrix=function(S,M,_,w){var p=1;typeof _=="number"&&(p=_|0),(p<0||p>3)&&(p=1);var u=(p+2)%3;M||(this.recalcMatrix(S),M=this.computedMatrix);var g=M[p],m=M[p+4],R=M[p+8];if(w){var z=Math.abs(g),F=Math.abs(m),B=Math.abs(R),O=Math.max(z,F,B);z===O?(g=g<0?-1:1,m=R=0):B===O?(R=R<0?-1:1,g=m=0):(m=m<0?-1:1,g=R=0)}else{var P=f(g,m,R);g/=P,m/=P,R/=P}var L=M[u],N=M[u+4],U=M[u+8],Z=L*g+N*m+U*R;L-=g*Z,N-=m*Z,U-=R*Z;var Q=f(L,N,U);L/=Q,N/=Q,U/=Q;var ue=m*U-R*N,oe=R*L-g*U,le=g*N-m*L,j=f(ue,oe,le);ue/=j,oe/=j,le/=j,this.center.jump(S,Me,xe,ce),this.radius.idle(S),this.up.jump(S,g,m,R),this.right.jump(S,L,N,U);var J,$;if(p===2){var X=M[1],re=M[5],ee=M[9],q=X*L+re*N+ee*U,ae=X*ue+re*oe+ee*le;Ae<0?J=-Math.PI/2:J=Math.PI/2,$=Math.atan2(ae,q)}else{var ie=M[2],fe=M[6],we=M[10],Ae=ie*g+fe*m+we*R,Fe=ie*L+fe*N+we*U,Ce=ie*ue+fe*oe+we*le;J=Math.asin(v(Ae)),$=Math.atan2(Ce,Fe)}this.angle.jump(S,$,J),this.recalcMatrix(S);var qe=M[2],et=M[6],Qe=M[10],Ke=this.computedMatrix;a(Ke,M);var Xe=Ke[15],Me=Ke[12]/Xe,xe=Ke[13]/Xe,ce=Ke[14]/Xe,Re=Math.exp(this.computedRadius[0]);this.center.jump(S,Me-qe*Re,xe-et*Re,ce-Qe*Re)},l.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},l.idle=function(S){this.center.idle(S),this.up.idle(S),this.right.idle(S),this.radius.idle(S),this.angle.idle(S)},l.flush=function(S){this.center.flush(S),this.up.flush(S),this.right.flush(S),this.radius.flush(S),this.angle.flush(S)},l.setDistance=function(S,M){M>0&&this.radius.set(S,Math.log(M))},l.lookAt=function(S,M,_,w){this.recalcMatrix(S),M=M||this.computedEye,_=_||this.computedCenter,w=w||this.computedUp;var p=w[0],u=w[1],g=w[2],m=f(p,u,g);if(!(m<1e-6)){p/=m,u/=m,g/=m;var R=M[0]-_[0],P=M[1]-_[1],z=M[2]-_[2],F=f(R,P,z);if(!(F<1e-6)){R/=F,P/=F,z/=F;var B=this.computedRight,O=B[0],L=B[1],N=B[2],U=p*O+u*L+g*N;O-=U*p,L-=U*u,N-=U*g;var Z=f(O,L,N);if(!(Z<.01&&(O=u*z-g*P,L=g*R-p*z,N=p*P-u*R,Z=f(O,L,N),Z<1e-6))){O/=Z,L/=Z,N/=Z,this.up.set(S,p,u,g),this.right.set(S,O,L,N),this.center.set(S,_[0],_[1],_[2]),this.radius.set(S,Math.log(F));var Q=u*N-g*L,ue=g*O-p*N,oe=p*L-u*O,le=f(Q,ue,oe);Q/=le,ue/=le,oe/=le;var j=p*R+u*P+g*z,J=O*R+L*P+N*z,$=Q*R+ue*P+oe*z,X=Math.asin(v(j)),re=Math.atan2($,J),ee=this.angle._state,q=ee[ee.length-1],ae=ee[ee.length-2];q=q%(2*Math.PI);var ie=Math.abs(q+2*Math.PI-re),fe=Math.abs(q-re),we=Math.abs(q-2*Math.PI-re);ie0?N.pop():new ArrayBuffer(O)}t.mallocArrayBuffer=y;function b(B){return new Uint8Array(y(B),0,B)}t.mallocUint8=b;function S(B){return new Uint16Array(y(2*B),0,B)}t.mallocUint16=S;function M(B){return new Uint32Array(y(4*B),0,B)}t.mallocUint32=M;function _(B){return new Int8Array(y(B),0,B)}t.mallocInt8=_;function w(B){return new Int16Array(y(2*B),0,B)}t.mallocInt16=w;function p(B){return new Int32Array(y(4*B),0,B)}t.mallocInt32=p;function u(B){return new Float32Array(y(4*B),0,B)}t.mallocFloat32=t.mallocFloat=u;function g(B){return new Float64Array(y(8*B),0,B)}t.mallocFloat64=t.mallocDouble=g;function m(B){return n?new Uint8ClampedArray(y(B),0,B):b(B)}t.mallocUint8Clamped=m;function R(B){return s?new BigUint64Array(y(8*B),0,B):null}t.mallocBigUint64=R;function P(B){return c?new BigInt64Array(y(8*B),0,B):null}t.mallocBigInt64=P;function z(B){return new DataView(y(B),0,B)}t.mallocDataView=z;function F(B){B=o.nextPow2(B);var O=o.log2(B),L=h[O];return L.length>0?L.pop():new i(B)}t.mallocBuffer=F,t.clearCache=function(){for(var O=0;O<32;++O)f.UINT8[O].length=0,f.UINT16[O].length=0,f.UINT32[O].length=0,f.INT8[O].length=0,f.INT16[O].length=0,f.INT32[O].length=0,f.FLOAT[O].length=0,f.DOUBLE[O].length=0,f.BIGUINT64[O].length=0,f.BIGINT64[O].length=0,f.UINT8C[O].length=0,v[O].length=0,h[O].length=0}},1755:function(e){"use restrict";e.exports=t;function t(o){this.roots=new Array(o),this.ranks=new Array(o);for(var a=0;a",N="",U=L.length,Z=N.length,Q=F[0]===y||F[0]===M,ue=0,oe=-Z;ue>-1&&(ue=B.indexOf(L,ue),!(ue===-1||(oe=B.indexOf(N,ue+U),oe===-1)||oe<=ue));){for(var le=ue;le=oe)O[le]=null,B=B.substr(0,le)+" "+B.substr(le+1);else if(O[le]!==null){var j=O[le].indexOf(F[0]);j===-1?O[le]+=F:Q&&(O[le]=O[le].substr(0,j+1)+(1+parseInt(O[le][j+1]))+O[le].substr(j+2))}var J=ue+U,$=B.substr(J,oe-J),X=$.indexOf(L);X!==-1?ue=X:ue=oe+Z}return O}function p(z,F,B){for(var O=F.textAlign||"start",L=F.textBaseline||"alphabetic",N=[1<<30,1<<30],U=[0,0],Z=z.length,Q=0;Q/g,` +`):B=B.replace(/\/g," ");var U="",Z=[];for(q=0;q-1?parseInt(ce[1+rt]):0,St=Je>-1?parseInt(Re[1+Je]):0;At!==St&&($e=$e.replace(Ce(),"?px "),fe*=Math.pow(.75,St-At),$e=$e.replace("?px ",Ce())),ie+=.25*j*(St-At)}if(N.superscripts===!0){var Rt=ce.indexOf(y),Ut=Re.indexOf(y),ir=Rt>-1?parseInt(ce[1+Rt]):0,ar=Ut>-1?parseInt(Re[1+Ut]):0;ir!==ar&&($e=$e.replace(Ce(),"?px "),fe*=Math.pow(.75,ar-ir),$e=$e.replace("?px ",Ce())),ie-=.25*j*(ar-ir)}if(N.bolds===!0){var Mr=ce.indexOf(v)>-1,fr=Re.indexOf(v)>-1;!Mr&&fr&&(dr?$e=$e.replace("italic ","italic bold "):$e="bold "+$e),Mr&&!fr&&($e=$e.replace("bold ",""))}if(N.italics===!0){var dr=ce.indexOf(T)>-1,pt=Re.indexOf(T)>-1;!dr&&pt&&($e="italic "+$e),dr&&!pt&&($e=$e.replace("italic ",""))}F.font=$e}for(ee=0;ee0&&(L=O.size),O.lineSpacing&&O.lineSpacing>0&&(N=O.lineSpacing),O.styletags&&O.styletags.breaklines&&(U.breaklines=!!O.styletags.breaklines),O.styletags&&O.styletags.bolds&&(U.bolds=!!O.styletags.bolds),O.styletags&&O.styletags.italics&&(U.italics=!!O.styletags.italics),O.styletags&&O.styletags.subscripts&&(U.subscripts=!!O.styletags.subscripts),O.styletags&&O.styletags.superscripts&&(U.superscripts=!!O.styletags.superscripts)),B.font=[O.fontStyle,O.fontVariant,O.fontWeight,L+"px",O.font].filter(function(Q){return Q}).join(" "),B.textAlign="start",B.textBaseline="alphabetic",B.direction="ltr";var Z=u(F,B,z,L,N,U);return R(Z,O,L)}},1538:function(e){(function(){if(typeof ses<"u"&&ses.ok&&!ses.ok())return;function r(g){g.permitHostObjects___&&g.permitHostObjects___(r)}typeof ses<"u"&&(ses.weakMapPermitHostObjects=r);var o=!1;if(typeof WeakMap=="function"){var a=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var i=new a,n=Object.freeze({});if(i.set(n,1),i.get(n)!==1)o=!0;else{e.exports=WeakMap;return}}}var s=Object.getOwnPropertyNames,c=Object.defineProperty,f=Object.isExtensible,v="weakmap:",h=v+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var T=new ArrayBuffer(25),l=new Uint8Array(T);crypto.getRandomValues(l),h=v+"rand:"+Array.prototype.map.call(l,function(g){return(g%36).toString(36)}).join("")+"___"}function y(g){return!(g.substr(0,v.length)==v&&g.substr(g.length-3)==="___")}if(c(Object,"getOwnPropertyNames",{value:function(m){return s(m).filter(y)}}),"getPropertyNames"in Object){var b=Object.getPropertyNames;c(Object,"getPropertyNames",{value:function(m){return b(m).filter(y)}})}function S(g){if(g!==Object(g))throw new TypeError("Not an object: "+g);var m=g[h];if(m&&m.key===g)return m;if(f(g)){m={key:g};try{return c(g,h,{value:m,writable:!1,enumerable:!1,configurable:!1}),m}catch{return}}}(function(){var g=Object.freeze;c(Object,"freeze",{value:function(z){return S(z),g(z)}});var m=Object.seal;c(Object,"seal",{value:function(z){return S(z),m(z)}});var R=Object.preventExtensions;c(Object,"preventExtensions",{value:function(z){return S(z),R(z)}})})();function M(g){return g.prototype=null,Object.freeze(g)}var _=!1;function w(){!_&&typeof console<"u"&&(_=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}var p=0,u=function(){this instanceof u||w();var g=[],m=[],R=p++;function P(O,L){var N,U=S(O);return U?R in U?U[R]:L:(N=g.indexOf(O),N>=0?m[N]:L)}function z(O){var L=S(O);return L?R in L:g.indexOf(O)>=0}function F(O,L){var N,U=S(O);return U?U[R]=L:(N=g.indexOf(O),N>=0?m[N]=L:(N=g.length,m[N]=L,g[N]=O)),this}function B(O){var L=S(O),N,U;return L?R in L&&delete L[R]:(N=g.indexOf(O),N<0?!1:(U=g.length-1,g[N]=void 0,m[N]=m[U],g[N]=g[U],g.length=U,m.length=U,!0))}return Object.create(u.prototype,{get___:{value:M(P)},has___:{value:M(z)},set___:{value:M(F)},delete___:{value:M(B)}})};u.prototype=Object.create(Object.prototype,{get:{value:function(m,R){return this.get___(m,R)},writable:!0,configurable:!0},has:{value:function(m){return this.has___(m)},writable:!0,configurable:!0},set:{value:function(m,R){return this.set___(m,R)},writable:!0,configurable:!0},delete:{value:function(m){return this.delete___(m)},writable:!0,configurable:!0}}),typeof a=="function"?function(){o&&typeof Proxy<"u"&&(Proxy=void 0);function g(){this instanceof u||w();var m=new a,R=void 0,P=!1;function z(L,N){return R?m.has(L)?m.get(L):R.get___(L,N):m.get(L,N)}function F(L){return m.has(L)||(R?R.has___(L):!1)}var B;o?B=function(L,N){return m.set(L,N),m.has(L)||(R||(R=new u),R.set(L,N)),this}:B=function(L,N){if(P)try{m.set(L,N)}catch{R||(R=new u),R.set___(L,N)}else m.set(L,N);return this};function O(L){var N=!!m.delete(L);return R&&R.delete___(L)||N}return Object.create(u.prototype,{get___:{value:M(z)},has___:{value:M(F)},set___:{value:M(B)},delete___:{value:M(O)},permitHostObjects___:{value:M(function(L){if(L===r)P=!0;else throw new Error("bogus call to permitHostObjects___")})}})}g.prototype=u.prototype,e.exports=g,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(Proxy=void 0),e.exports=u)})()},236:function(e,t,r){var o=r(8284);e.exports=a;function a(){var i={};return function(n){if((typeof n!="object"||n===null)&&typeof n!="function")throw new Error("Weakmap-shim: Key must be object");var s=n.valueOf(i);return s&&s.identity===i?s:o(n,i)}}},8284:function(e){e.exports=t;function t(r,o){var a={identity:o},i=r.valueOf;return Object.defineProperty(r,"valueOf",{value:function(n){return n!==o?i.apply(this,arguments):a},writable:!0}),a}},606:function(e,t,r){var o=r(236);e.exports=a;function a(){var i=o();return{get:function(n,s){var c=i(n);return c.hasOwnProperty("value")?c.value:s},set:function(n,s){return i(n).value=s,this},has:function(n){return"value"in i(n)},delete:function(n){return delete i(n).value}}}},3349:function(e){function t(){return function(s,c,f,v,h,T){var l=s[0],y=f[0],b=[0],S=y;v|=0;var M=0,_=y;for(M=0;M=0!=p>=0&&h.push(b[0]+.5+.5*(w+p)/(w-p))}v+=_,++b[0]}}}function r(){return t()}var o=r;function a(s){var c={};return function(v,h,T){var l=v.dtype,y=v.order,b=[l,y.join()].join(),S=c[b];return S||(c[b]=S=s([l,y])),S(v.shape.slice(0),v.data,v.stride,v.offset|0,h,T)}}function i(s){return a(o.bind(void 0,s))}function n(s){return i({funcName:s.funcName})}e.exports=n({funcName:"zeroCrossings"})},781:function(e,t,r){e.exports=a;var o=r(3349);function a(i,n){var s=[];return n=+n||0,o(i.hi(i.shape[0]-1),s,n),s}},7790:function(){}},x={};function A(e){var t=x[e];if(t!==void 0)return t.exports;var r=x[e]={id:e,loaded:!1,exports:{}};return d[e].call(r.exports,r,r.exports,A),r.loaded=!0,r.exports}(function(){A.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}()})(),function(){A.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}();var E=A(1964);G.exports=E})()}}),C3=He({"node_modules/color-name/index.js"(Y,G){G.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]}}}),TL=He({"node_modules/color-normalize/node_modules/color-parse/index.js"(Y,G){var d=C3();G.exports=A;var x={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function A(E){var e,t=[],r=1,o;if(typeof E=="string")if(E=E.toLowerCase(),d[E])t=d[E].slice(),o="rgb";else if(E==="transparent")r=0,o="rgb",t=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(E)){var a=E.slice(1),i=a.length,n=i<=4;r=1,n?(t=[parseInt(a[0]+a[0],16),parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16)],i===4&&(r=parseInt(a[3]+a[3],16)/255)):(t=[parseInt(a[0]+a[1],16),parseInt(a[2]+a[3],16),parseInt(a[4]+a[5],16)],i===8&&(r=parseInt(a[6]+a[7],16)/255)),t[0]||(t[0]=0),t[1]||(t[1]=0),t[2]||(t[2]=0),o="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(E)){var s=e[1],c=s==="rgb",a=s.replace(/a$/,"");o=a;var i=a==="cmyk"?4:a==="gray"?1:3;t=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(h,T){if(/%$/.test(h))return T===i?parseFloat(h)/100:a==="rgb"?parseFloat(h)*255/100:parseFloat(h);if(a[T]==="h"){if(/deg$/.test(h))return parseFloat(h);if(x[h]!==void 0)return x[h]}return parseFloat(h)}),s===a&&t.push(1),r=c||t[i]===void 0?1:t[i],t=t.slice(0,i)}else E.length>10&&/[0-9](?:\s|\/)/.test(E)&&(t=E.match(/([0-9]+)/g).map(function(f){return parseFloat(f)}),o=E.match(/([a-z])/ig).join("").toLowerCase());else isNaN(E)?Array.isArray(E)||E.length?(t=[E[0],E[1],E[2]],o="rgb",r=E.length===4?E[3]:1):E instanceof Object&&(E.r!=null||E.red!=null||E.R!=null?(o="rgb",t=[E.r||E.red||E.R||0,E.g||E.green||E.G||0,E.b||E.blue||E.B||0]):(o="hsl",t=[E.h||E.hue||E.H||0,E.s||E.saturation||E.S||0,E.l||E.lightness||E.L||E.b||E.brightness]),r=E.a||E.alpha||E.opacity||1,E.opacity!=null&&(r/=100)):(o="rgb",t=[E>>>16,(E&65280)>>>8,E&255]);return{space:o,values:t,alpha:r}}}}),AL=He({"node_modules/color-normalize/node_modules/color-rgba/index.js"(Y,G){var d=TL();G.exports=function(E){Array.isArray(E)&&E.raw&&(E=String.raw.apply(null,arguments));var e,t=d(E);if(!t.space)return[];var r=[0,0,0],o=t.space[0]==="h"?[360,100,100]:[255,255,255];return e=Array(3),e[0]=Math.min(Math.max(t.values[0],r[0]),o[0]),e[1]=Math.min(Math.max(t.values[1],r[1]),o[1]),e[2]=Math.min(Math.max(t.values[2],r[2]),o[2]),t.space[0]==="h"&&(e=x(e)),e.push(Math.min(Math.max(t.alpha,0),1)),e};function x(A){var E=A[0]/360,e=A[1]/100,t=A[2]/100,r,o,a,i,n,s=0;if(e===0)return n=t*255,[n,n,n];for(o=t<.5?t*(1+e):t+e-t*e,r=2*t-o,i=[0,0,0];s<3;)a=E+1/3*-(s-1),a<0?a++:a>1&&a--,n=6*a<1?r+(o-r)*6*a:2*a<1?o:3*a<2?r+(o-r)*(2/3-a)*6:r,i[s++]=n*255;return i}}}),Ny=He({"node_modules/clamp/index.js"(Y,G){G.exports=d;function d(x,A,E){return AE?E:x:xA?A:x}}}),F_=He({"node_modules/dtype/index.js"(Y,G){G.exports=function(d){switch(d){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),rp=He({"node_modules/color-normalize/index.js"(Y,G){var d=AL(),x=Ny(),A=F_();G.exports=function(t,r){(r==="float"||!r)&&(r="array"),r==="uint"&&(r="uint8"),r==="uint_clamped"&&(r="uint8_clamped");var o=A(r),a=new o(4),i=r!=="uint8"&&r!=="uint8_clamped";return(!t.length||typeof t=="string")&&(t=d(t),t[0]/=255,t[1]/=255,t[2]/=255),E(t)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3]!=null?t[3]:255,i&&(a[0]/=255,a[1]/=255,a[2]/=255,a[3]/=255),a):(i?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3]!=null?t[3]:1):(a[0]=x(Math.floor(t[0]*255),0,255),a[1]=x(Math.floor(t[1]*255),0,255),a[2]=x(Math.floor(t[2]*255),0,255),a[3]=t[3]==null?255:x(Math.floor(t[3]*255),0,255)),a)};function E(e){return!!(e instanceof Uint8Array||e instanceof Uint8ClampedArray||Array.isArray(e)&&(e[0]>1||e[0]===0)&&(e[1]>1||e[1]===0)&&(e[2]>1||e[2]===0)&&(!e[3]||e[3]>1))}}}),cd=He({"src/lib/str2rgbarray.js"(Y,G){var d=rp();function x(A){return A?d(A):[0,0,0,1]}G.exports=x}}),fd=He({"src/lib/gl_format_color.js"(Y,G){var d=Hi(),x=Mf(),A=rp(),E=Kl(),e=Xc().defaultLine,t=ch().isArrayOrTypedArray,r=A(e),o=1;function a(f,v){var h=f;return h[3]*=v,h}function i(f){if(d(f))return r;var v=A(f);return v.length?v:r}function n(f){return d(f)?f:o}function s(f,v,h){var T=f.color;T&&T._inputArray&&(T=T._inputArray);var l=t(T),y=t(v),b=E.extractOpts(f),S=[],M,_,w,p,u;if(b.colorscale!==void 0?M=E.makeColorScaleFuncFromTrace(f):M=i,l?_=function(m,R){return m[R]===void 0?r:A(M(m[R]))}:_=i,y?w=function(m,R){return m[R]===void 0?o:n(m[R])}:w=n,l||y)for(var g=0;g0){var h=o.c2l(f);o._lowerLogErrorBound||(o._lowerLogErrorBound=h),o._lowerErrorBound=Math.min(o._lowerLogErrorBound,h)}}else i[n]=[-s[0]*r,s[1]*r]}return i}function A(e){for(var t=0;t-1?-1:R.indexOf("right")>-1?1:0}function b(R){return R==null?0:R.indexOf("top")>-1?-1:R.indexOf("bottom")>-1?1:0}function S(R){var P=0,z=0,F=[P,z];if(Array.isArray(R))for(var B=0;B=0){var Z=T(N.position,N.delaunayColor,N.delaunayAxis);Z.opacity=R.opacity,this.delaunayMesh?this.delaunayMesh.update(Z):(Z.gl=P,this.delaunayMesh=E(Z),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},h.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function m(R,P){var z=new v(R,P.uid);return z.update(P),z}G.exports=m}}),P3=He({"src/traces/scatter3d/attributes.js"(Y,G){var d=Zu(),x=Yl(),A=kl(),E=Gu().axisHoverFormat,e=Yo().hovertemplateAttrs,t=Yo().texttemplateAttrs,r=cl(),o=L3(),a=O_(),i=ho().extendFlat,n=hu().overrideAll,s=Ud(),c=d.line,f=d.marker,v=f.line,h=i({width:c.width,dash:{valType:"enumerated",values:s(o),dflt:"solid"}},A("line"));function T(y){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var l=G.exports=n({x:d.x,y:d.y,z:{valType:"data_array"},text:i({},d.text,{}),texttemplate:t({},{}),hovertext:i({},d.hovertext,{}),hovertemplate:e(),xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z"),mode:i({},d.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:T(),y:T(),z:T()},connectgaps:d.connectgaps,line:h,marker:i({symbol:{valType:"enumerated",values:s(a),dflt:"circle",arrayOk:!0},size:i({},f.size,{dflt:8}),sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode,opacity:i({},f.opacity,{arrayOk:!1}),colorbar:f.colorbar,line:i({width:i({},v.width,{arrayOk:!1})},A("marker.line"))},A("marker")),textposition:i({},d.textposition,{dflt:"top center"}),textfont:x({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:r.opacity,hoverinfo:i({},r.hoverinfo)},"calc","nested");l.x.editType=l.y.editType=l.z.editType="calc+clearAxisTypes"}}),EL=He({"src/traces/scatter3d/defaults.js"(Y,G){var d=Ei(),x=Gr(),A=Rl(),E=Kh(),e=nv(),t=iv(),r=P3();G.exports=function(i,n,s,c){function f(M,_){return x.coerce(i,n,r,M,_)}var v=o(i,n,f,c);if(!v){n.visible=!1;return}f("text"),f("hovertext"),f("hovertemplate"),f("xhoverformat"),f("yhoverformat"),f("zhoverformat"),f("mode"),A.hasMarkers(n)&&E(i,n,s,c,f,{noSelect:!0,noAngle:!0}),A.hasLines(n)&&(f("connectgaps"),e(i,n,s,c,f)),A.hasText(n)&&(f("texttemplate"),t(i,n,c,f,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var h=(n.line||{}).color,T=(n.marker||{}).color;f("surfaceaxis")>=0&&f("surfacecolor",h||T);for(var l=["x","y","z"],y=0;y<3;++y){var b="projection."+l[y];f(b+".show")&&(f(b+".opacity"),f(b+".scale"))}var S=d.getComponentMethod("errorbars","supplyDefaults");S(i,n,h||T||s,{axis:"z"}),S(i,n,h||T||s,{axis:"y",inherit:"z"}),S(i,n,h||T||s,{axis:"x",inherit:"z"})};function o(a,i,n,s){var c=0,f=n("x"),v=n("y"),h=n("z"),T=d.getComponentMethod("calendars","handleTraceDefaults");return T(a,i,["x","y","z"],s),f&&v&&h&&(c=Math.min(f.length,v.length,h.length),i._length=i._xlength=i._ylength=i._zlength=c),c}}}),kL=He({"src/traces/scatter3d/calc.js"(Y,G){var d=Vv(),x=ov();G.exports=function(E,e){var t=[{x:!1,y:!1,trace:e,t:{}}];return d(t,e),x(E,e),t}}}),CL=He({"node_modules/get-canvas-context/index.js"(Y,G){G.exports=d;function d(x,A){if(typeof x!="string")throw new TypeError("must specify type string");if(A=A||{},typeof document>"u"&&!A.canvas)return null;var E=A.canvas||document.createElement("canvas");typeof A.width=="number"&&(E.width=A.width),typeof A.height=="number"&&(E.height=A.height);var e=A,t;try{var r=[x];x.indexOf("webgl")===0&&r.push("experimental-"+x);for(var o=0;o/g," "));i[n]=v,s.tickmode=c}}r.ticks=i;for(var n=0;n<3;++n){.5*(t.glplot.bounds[0][n]+t.glplot.bounds[1][n]);for(var h=0;h<2;++h)r.bounds[h][n]=t.glplot.bounds[h][n]}t.contourLevels=E(i)}}}),DL=He({"src/plots/gl3d/scene.js"(Y,G){var d=Hf().gl_plot3d,x=d.createCamera,A=d.createScene,E=LL(),e=a1(),t=Ei(),r=Gr(),o=r.preserveDrawingBuffer(),a=io(),i=Wu(),n=cd(),s=I3(),c=Qb(),f=PL(),v=IL(),h=RL(),T=_v().applyAutorangeOptions,l,y,b=!1;function S(z,F){var B=document.createElement("div"),O=z.container;this.graphDiv=z.graphDiv;var L=document.createElementNS("http://www.w3.org/2000/svg","svg");L.style.position="absolute",L.style.top=L.style.left="0px",L.style.width=L.style.height="100%",L.style["z-index"]=20,L.style["pointer-events"]="none",B.appendChild(L),this.svgContainer=L,B.id=z.id,B.style.position="absolute",B.style.top=B.style.left="0px",B.style.width=B.style.height="100%",O.appendChild(B),this.fullLayout=F,this.id=z.id||"scene",this.fullSceneLayout=F[this.id],this.plotArgs=[[],{},{}],this.axesOptions=f(F,F[this.id]),this.spikeOptions=v(F[this.id]),this.container=B,this.staticMode=!!z.staticPlot,this.pixelRatio=this.pixelRatio||z.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=t.getComponentMethod("annotations3d","convert"),this.drawAnnotations=t.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var M=S.prototype;M.prepareOptions=function(){var z=this,F={canvas:z.canvas,gl:z.gl,glOptions:{preserveDrawingBuffer:o,premultipliedAlpha:!0,antialias:!0},container:z.container,axes:z.axesOptions,spikes:z.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:z.camera,pixelRatio:z.pixelRatio};if(z.staticMode){if(!y&&(l=document.createElement("canvas"),y=E({canvas:l,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!y))throw new Error("error creating static canvas/context for image server");F.gl=y,F.canvas=l}return F};var _=!0;M.tryCreatePlot=function(){var z=this,F=z.prepareOptions(),B=!0;try{z.glplot=A(F)}catch{if(z.staticMode||!_||o)B=!1;else{r.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{o=F.glOptions.preserveDrawingBuffer=!0,z.glplot=A(F)}catch{o=F.glOptions.preserveDrawingBuffer=!1,B=!1}}}return _=!1,B},M.initializeGLCamera=function(){var z=this,F=z.fullSceneLayout.camera,B=F.projection.type==="orthographic";z.camera=x(z.container,{center:[F.center.x,F.center.y,F.center.z],eye:[F.eye.x,F.eye.y,F.eye.z],up:[F.up.x,F.up.y,F.up.z],_ortho:B,zoomMin:.01,zoomMax:100,mode:"orbit"})},M.initializeGLPlot=function(){var z=this;z.initializeGLCamera();var F=z.tryCreatePlot();if(!F)return s(z);z.traces={},z.make4thDimension();var B=z.graphDiv,O=B.layout,L=function(){var U={};return z.isCameraChanged(O)&&(U[z.id+".camera"]=z.getCamera()),z.isAspectChanged(O)&&(U[z.id+".aspectratio"]=z.glplot.getAspectratio(),O[z.id].aspectmode!=="manual"&&(z.fullSceneLayout.aspectmode=O[z.id].aspectmode=U[z.id+".aspectmode"]="manual")),U},N=function(U){if(U.fullSceneLayout.dragmode!==!1){var Z=L();U.saveLayout(O),U.graphDiv.emit("plotly_relayout",Z)}};return z.glplot.canvas&&(z.glplot.canvas.addEventListener("mouseup",function(){N(z)}),z.glplot.canvas.addEventListener("touchstart",function(){b=!0}),z.glplot.canvas.addEventListener("wheel",function(U){if(B._context._scrollZoom.gl3d){if(z.camera._ortho){var Z=U.deltaX>U.deltaY?1.1:.9090909090909091,Q=z.glplot.getAspectratio();z.glplot.setAspectratio({x:Z*Q.x,y:Z*Q.y,z:Z*Q.z})}N(z)}},e?{passive:!1}:!1),z.glplot.canvas.addEventListener("mousemove",function(){if(z.fullSceneLayout.dragmode!==!1&&z.camera.mouseListener.buttons!==0){var U=L();z.graphDiv.emit("plotly_relayouting",U)}}),z.staticMode||z.glplot.canvas.addEventListener("webglcontextlost",function(U){B&&B.emit&&B.emit("plotly_webglcontextlost",{event:U,layer:z.id})},!1)),z.glplot.oncontextloss=function(){z.recoverContext()},z.glplot.onrender=function(){z.render()},!0},M.render=function(){var z=this,F=z.graphDiv,B,O=z.svgContainer,L=z.container.getBoundingClientRect();F._fullLayout._calcInverseTransform(F);var N=F._fullLayout._invScaleX,U=F._fullLayout._invScaleY,Z=L.width*N,Q=L.height*U;O.setAttributeNS(null,"viewBox","0 0 "+Z+" "+Q),O.setAttributeNS(null,"width",Z),O.setAttributeNS(null,"height",Q),h(z),z.glplot.axes.update(z.axesOptions);for(var ue=Object.keys(z.traces),oe=null,le=z.glplot.selection,j=0;j")):B.type==="isosurface"||B.type==="volume"?(ee.valueLabel=a.hoverLabelText(z._mockAxis,z._mockAxis.d2l(le.traceCoordinate[3]),B.valuehoverformat),we.push("value: "+ee.valueLabel),le.textLabel&&we.push(le.textLabel),fe=we.join("
")):fe=le.textLabel;var Ae={x:le.traceCoordinate[0],y:le.traceCoordinate[1],z:le.traceCoordinate[2],data:X._input,fullData:X,curveNumber:X.index,pointNumber:re};i.appendArrayPointValue(Ae,X,re),B._module.eventData&&(Ae=X._module.eventData(Ae,le,X,{},re));var Fe={points:[Ae]};if(z.fullSceneLayout.hovermode){var Ce=[];i.loneHover({trace:X,x:(.5+.5*$[0]/$[3])*Z,y:(.5-.5*$[1]/$[3])*Q,xLabel:ee.xLabel,yLabel:ee.yLabel,zLabel:ee.zLabel,text:fe,name:oe.name,color:i.castHoverOption(X,re,"bgcolor")||oe.color,borderColor:i.castHoverOption(X,re,"bordercolor"),fontFamily:i.castHoverOption(X,re,"font.family"),fontSize:i.castHoverOption(X,re,"font.size"),fontColor:i.castHoverOption(X,re,"font.color"),nameLength:i.castHoverOption(X,re,"namelength"),textAlign:i.castHoverOption(X,re,"align"),hovertemplate:r.castOption(X,re,"hovertemplate"),hovertemplateLabels:r.extendFlat({},Ae,ee),eventData:[Ae]},{container:O,gd:F,inOut_bbox:Ce}),Ae.bbox=Ce[0]}le.distance<5&&(le.buttons||b)?F.emit("plotly_click",Fe):F.emit("plotly_hover",Fe),this.oldEventData=Fe}else i.loneUnhover(O),this.oldEventData&&F.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;z.drawAnnotations(z)},M.recoverContext=function(){var z=this;z.glplot.dispose();var F=function(){if(z.glplot.gl.isContextLost()){requestAnimationFrame(F);return}if(!z.initializeGLPlot()){r.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}z.plot.apply(z,z.plotArgs)};requestAnimationFrame(F)};var w=["xaxis","yaxis","zaxis"];function p(z,F,B){for(var O=z.fullSceneLayout,L=0;L<3;L++){var N=w[L],U=N.charAt(0),Z=O[N],Q=F[U],ue=F[U+"calendar"],oe=F["_"+U+"length"];if(!r.isArrayOrTypedArray(Q))B[0][L]=Math.min(B[0][L],0),B[1][L]=Math.max(B[1][L],oe-1);else for(var le,j=0;j<(oe||Q.length);j++)if(r.isArrayOrTypedArray(Q[j]))for(var J=0;JX[1][U])X[0][U]=-1,X[1][U]=1;else{var qe=X[1][U]-X[0][U];X[0][U]-=qe/32,X[1][U]+=qe/32}if(ee=[X[0][U],X[1][U]],ee=T(ee,Q),X[0][U]=ee[0],X[1][U]=ee[1],Q.isReversed()){var et=X[0][U];X[0][U]=X[1][U],X[1][U]=et}}else ee=Q.range,X[0][U]=Q.r2l(ee[0]),X[1][U]=Q.r2l(ee[1]);X[0][U]===X[1][U]&&(X[0][U]-=1,X[1][U]+=1),Q.range=[X[0][U],X[1][U]],Q.limitRange(),O.glplot.setBounds(U,{min:Q.range[0]*J[U],max:Q.range[1]*J[U]})}var Qe,Ke=oe.aspectmode;if(Ke==="cube")Qe=[1,1,1];else if(Ke==="manual"){var Xe=oe.aspectratio;Qe=[Xe.x,Xe.y,Xe.z]}else if(Ke==="auto"||Ke==="data"){var Me=[1,1,1];for(U=0;U<3;++U){Q=oe[w[U]],ue=Q.type;var xe=re[ue];Me[U]=Math.pow(xe.acc,1/xe.count)/J[U]}Ke==="data"||Math.max.apply(null,Me)/Math.min.apply(null,Me)<=4?Qe=Me:Qe=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");oe.aspectratio.x=le.aspectratio.x=Qe[0],oe.aspectratio.y=le.aspectratio.y=Qe[1],oe.aspectratio.z=le.aspectratio.z=Qe[2],O.glplot.setAspectratio(oe.aspectratio),O.viewInitial.aspectratio||(O.viewInitial.aspectratio={x:oe.aspectratio.x,y:oe.aspectratio.y,z:oe.aspectratio.z}),O.viewInitial.aspectmode||(O.viewInitial.aspectmode=oe.aspectmode);var ce=oe.domain||null,Re=F._size||null;if(ce&&Re){var $e=O.container.style;$e.position="absolute",$e.left=Re.l+ce.x[0]*Re.w+"px",$e.top=Re.t+(1-ce.y[1])*Re.h+"px",$e.width=Re.w*(ce.x[1]-ce.x[0])+"px",$e.height=Re.h*(ce.y[1]-ce.y[0])+"px"}O.glplot.redraw()}},M.destroy=function(){var z=this;z.glplot&&(z.camera.mouseListener.enabled=!1,z.container.removeEventListener("wheel",z.camera.wheelListener),z.camera=null,z.glplot.dispose(),z.container.parentNode.removeChild(z.container),z.glplot=null)};function g(z){return[[z.eye.x,z.eye.y,z.eye.z],[z.center.x,z.center.y,z.center.z],[z.up.x,z.up.y,z.up.z]]}function m(z){return{up:{x:z.up[0],y:z.up[1],z:z.up[2]},center:{x:z.center[0],y:z.center[1],z:z.center[2]},eye:{x:z.eye[0],y:z.eye[1],z:z.eye[2]},projection:{type:z._ortho===!0?"orthographic":"perspective"}}}M.getCamera=function(){var z=this;return z.camera.view.recalcMatrix(z.camera.view.lastT()),m(z.camera)},M.setViewport=function(z){var F=this,B=z.camera;F.camera.lookAt.apply(this,g(B)),F.glplot.setAspectratio(z.aspectratio);var O=B.projection.type==="orthographic",L=F.camera._ortho;O!==L&&(F.glplot.redraw(),F.glplot.clearRGBA(),F.glplot.dispose(),F.initializeGLPlot())},M.isCameraChanged=function(z){var F=this,B=F.getCamera(),O=r.nestedProperty(z,F.id+".camera"),L=O.get();function N(ue,oe,le,j){var J=["up","center","eye"],$=["x","y","z"];return oe[J[le]]&&ue[J[le]][$[j]]===oe[J[le]][$[j]]}var U=!1;if(L===void 0)U=!0;else{for(var Z=0;Z<3;Z++)for(var Q=0;Q<3;Q++)if(!N(B,L,Z,Q)){U=!0;break}(!L.projection||B.projection&&B.projection.type!==L.projection.type)&&(U=!0)}return U},M.isAspectChanged=function(z){var F=this,B=F.glplot.getAspectratio(),O=r.nestedProperty(z,F.id+".aspectratio"),L=O.get();return L===void 0||L.x!==B.x||L.y!==B.y||L.z!==B.z},M.saveLayout=function(z){var F=this,B=F.fullLayout,O,L,N,U,Z,Q,ue=F.isCameraChanged(z),oe=F.isAspectChanged(z),le=ue||oe;if(le){var j={};if(ue&&(O=F.getCamera(),L=r.nestedProperty(z,F.id+".camera"),N=L.get(),j[F.id+".camera"]=N),oe&&(U=F.glplot.getAspectratio(),Z=r.nestedProperty(z,F.id+".aspectratio"),Q=Z.get(),j[F.id+".aspectratio"]=Q),t.call("_storeDirectGUIEdit",z,B._preGUI,j),ue){L.set(O);var J=r.nestedProperty(B,F.id+".camera");J.set(O)}if(oe){Z.set(U);var $=r.nestedProperty(B,F.id+".aspectratio");$.set(U),F.glplot.redraw()}}return le},M.updateFx=function(z,F){var B=this,O=B.camera;if(O)if(z==="orbit")O.mode="orbit",O.keyBindingMode="rotate";else if(z==="turntable"){O.up=[0,0,1],O.mode="turntable",O.keyBindingMode="rotate";var L=B.graphDiv,N=L._fullLayout,U=B.fullSceneLayout.camera,Z=U.up.x,Q=U.up.y,ue=U.up.z;if(ue/Math.sqrt(Z*Z+Q*Q+ue*ue)<.999){var oe=B.id+".camera.up",le={x:0,y:0,z:1},j={};j[oe]=le;var J=L.layout;t.call("_storeDirectGUIEdit",J,N._preGUI,j),U.up=le,r.nestedProperty(J,oe).set(le)}}else O.keyBindingMode=z;B.fullSceneLayout.hovermode=F};function R(z,F,B){for(var O=0,L=B-1;O0)for(var Z=255/U,Q=0;Q<3;++Q)z[N+Q]=Math.min(Z*z[N+Q],255)}}M.toImage=function(z){var F=this;z||(z="png"),F.staticMode&&F.container.appendChild(l),F.glplot.redraw();var B=F.glplot.gl,O=B.drawingBufferWidth,L=B.drawingBufferHeight;B.bindFramebuffer(B.FRAMEBUFFER,null);var N=new Uint8Array(O*L*4);B.readPixels(0,0,O,L,B.RGBA,B.UNSIGNED_BYTE,N),R(N,O,L),P(N,O,L);var U=document.createElement("canvas");U.width=O,U.height=L;var Z=U.getContext("2d",{willReadFrequently:!0}),Q=Z.createImageData(O,L);Q.data.set(N),Z.putImageData(Q,0,0);var ue;switch(z){case"jpeg":ue=U.toDataURL("image/jpeg");break;case"webp":ue=U.toDataURL("image/webp");break;default:ue=U.toDataURL("image/png")}return F.staticMode&&F.container.removeChild(l),ue},M.setConvert=function(){for(var z=this,F=0;F<3;F++){var B=z.fullSceneLayout[w[F]];a.setConvert(B,z.fullLayout),B.setScale=r.noop}},M.make4thDimension=function(){var z=this,F=z.graphDiv,B=F._fullLayout;z._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},a.setConvert(z._mockAxis,B)},G.exports=S}}),zL=He({"src/plots/gl3d/layout/attributes.js"(Y,G){G.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),R3=He({"src/plots/gl3d/layout/axis_attributes.js"(Y,G){var d=Ai(),x=jf(),A=ho().extendFlat,E=hu().overrideAll;G.exports=E({visible:x.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:d.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:x.color,categoryorder:x.categoryorder,categoryarray:x.categoryarray,title:{text:x.title.text,font:x.title.font},type:A({},x.type,{values:["-","linear","log","date","category"]}),autotypenumbers:x.autotypenumbers,autorange:x.autorange,autorangeoptions:{minallowed:x.autorangeoptions.minallowed,maxallowed:x.autorangeoptions.maxallowed,clipmin:x.autorangeoptions.clipmin,clipmax:x.autorangeoptions.clipmax,include:x.autorangeoptions.include,editType:"plot"},rangemode:x.rangemode,minallowed:x.minallowed,maxallowed:x.maxallowed,range:A({},x.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:x.minor.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,mirror:x.mirror,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,showticklabels:x.showticklabels,labelalias:x.labelalias,tickfont:x.tickfont,tickangle:x.tickangle,tickprefix:x.tickprefix,showtickprefix:x.showtickprefix,ticksuffix:x.ticksuffix,showticksuffix:x.showticksuffix,showexponent:x.showexponent,exponentformat:x.exponentformat,minexponent:x.minexponent,separatethousands:x.separatethousands,tickformat:x.tickformat,tickformatstops:x.tickformatstops,hoverformat:x.hoverformat,showline:x.showline,linecolor:x.linecolor,linewidth:x.linewidth,showgrid:x.showgrid,gridcolor:A({},x.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:x.gridwidth,zeroline:x.zeroline,zerolinecolor:x.zerolinecolor,zerolinewidth:x.zerolinewidth},"plot","from-root")}}),D3=He({"src/plots/gl3d/layout/layout_attributes.js"(Y,G){var d=R3(),x=mu().attributes,A=ho().extendFlat,E=Gr().counterRegex;function e(t,r,o){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:r,editType:"camera"},z:{valType:"number",dflt:o,editType:"camera"},editType:"camera"}}G.exports={_arrayAttrRegexps:[E("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:A(e(0,0,1),{}),center:A(e(0,0,0),{}),eye:A(e(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:x({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:d,yaxis:d,zaxis:d,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"}}}),FL=He({"src/plots/gl3d/layout/axis_defaults.js"(Y,G){var d=Mf().mix,x=Gr(),A=Gs(),E=R3(),e=Jb(),t=ny(),r=["xaxis","yaxis","zaxis"],o=100*136/187;G.exports=function(i,n,s){var c,f;function v(l,y){return x.coerce(c,f,E,l,y)}for(var h=0;h1;function v(h){if(!f){var T=d.validate(n[h],t[h]);if(T)return n[h]}}E(n,s,c,{type:o,attributes:t,handleDefaults:a,fullLayout:s,font:s.font,fullData:c,getDfltFromLayout:v,autotypenumbersDflt:s.autotypenumbers,paper_bgcolor:s.paper_bgcolor,calendar:s.calendar})};function a(i,n,s,c){for(var f=s("bgcolor"),v=x.combine(f,c.paper_bgcolor),h=["up","center","eye"],T=0;T.999)&&(M="turntable")}else M="turntable";s("dragmode",M),s("hovermode",c.getDfltFromLayout("hovermode"))}}}),ap=He({"src/plots/gl3d/index.js"(Y){var G=hu().overrideAll,d=Od(),x=DL(),A=Uf().getSubplotData,E=Gr(),e=Yh(),t="gl3d",r="scene";Y.name=t,Y.attr=r,Y.idRoot=r,Y.idRegex=Y.attrRegex=E.counterRegex("scene"),Y.attributes=zL(),Y.layoutAttributes=D3(),Y.baseLayoutAttrOverrides=G({hoverlabel:d.hoverlabel},"plot","nested"),Y.supplyLayoutDefaults=OL(),Y.plot=function(a){for(var i=a._fullLayout,n=a._fullData,s=i._subplots[t],c=0;c0){R=c[P];break}return R}function T(g,m){if(!(g<1||m<1)){for(var R=v(g),P=v(m),z=1,F=0;FS;)P--,P/=h(P),P++,P1?z:1};function M(g,m,R){var P=R[8]+R[2]*m[0]+R[5]*m[1];return g[0]=(R[6]+R[0]*m[0]+R[3]*m[1])/P,g[1]=(R[7]+R[1]*m[0]+R[4]*m[1])/P,g}function _(g,m,R){return w(g,m,M,R),g}function w(g,m,R,P){for(var z=[0,0],F=g.shape[0],B=g.shape[1],O=0;O0&&this.contourStart[P]!==null&&this.contourEnd[P]!==null&&this.contourEnd[P]>this.contourStart[P]))for(m[P]=!0,z=this.contourStart[P];zQ&&(this.minValues[N]=Q),this.maxValues[N]c&&(o.isomin=null,o.isomax=null);var f=n("x"),v=n("y"),h=n("z"),T=n("value");if(!f||!f.length||!v||!v.length||!h||!h.length||!T||!T.length){o.visible=!1;return}var l=x.getComponentMethod("calendars","handleTraceDefaults");l(r,o,["x","y","z"],i),n("valuehoverformat"),["x","y","z"].forEach(function(M){n(M+"hoverformat");var _="caps."+M,w=n(_+".show");w&&n(_+".fill");var p="slices."+M,u=n(p+".show");u&&(n(p+".fill"),n(p+".locations"))});var y=n("spaceframe.show");y&&n("spaceframe.fill");var b=n("surface.show");b&&(n("surface.count"),n("surface.fill"),n("surface.pattern"));var S=n("contour.show");S&&(n("contour.color"),n("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(M){n(M)}),E(r,o,i,n,{prefix:"",cLetter:"c"}),o._length=null}G.exports={supplyDefaults:e,supplyIsoDefaults:t}}}),N_=He({"src/traces/streamtube/calc.js"(Y,G){var d=Gr(),x=Sh();function A(r,o){o._len=Math.min(o.u.length,o.v.length,o.w.length,o.x.length,o.y.length,o.z.length),o._u=t(o.u,o._len),o._v=t(o.v,o._len),o._w=t(o.w,o._len),o._x=t(o.x,o._len),o._y=t(o.y,o._len),o._z=t(o.z,o._len);var a=E(o);o._gridFill=a.fill,o._Xs=a.Xs,o._Ys=a.Ys,o._Zs=a.Zs,o._len=a.len;var i=0,n,s,c;o.starts&&(n=t(o.starts.x||[]),s=t(o.starts.y||[]),c=t(o.starts.z||[]),i=Math.min(n.length,s.length,c.length)),o._startsX=n||[],o._startsY=s||[],o._startsZ=c||[];var f=0,v=1/0,h;for(h=0;h1&&(u=o[n-1],m=a[n-1],P=i[n-1]),s=0;su?"-":"+")+"x"),S=S.replace("y",(g>m?"-":"+")+"y"),S=S.replace("z",(R>P?"-":"+")+"z");var O=function(){n=0,z=[],F=[],B=[]};(!n||n0;v--){var h=Math.min(f[v],f[v-1]),T=Math.max(f[v],f[v-1]);if(T>h&&h-1}function ae(pt,ze){return pt===null?ze:pt}function ie(pt,ze,Ge){ue();var Oe=[ze],ve=[Ge];if(X>=1)Oe=[ze],ve=[Ge];else if(X>0){var ge=ee(ze,Ge);Oe=ge.xyzv,ve=ge.abc}for(var be=0;be-1?Ge[We]:Q(ct,_t,Mt);Bt>-1?Pe[We]=Bt:Pe[We]=le(ct,_t,Mt,ae(pt,Nt))}j(Pe[0],Pe[1],Pe[2])}}function fe(pt,ze,Ge){var Oe=function(ve,ge,be){ie(pt,[ze[ve],ze[ge],ze[be]],[Ge[ve],Ge[ge],Ge[be]])};Oe(0,1,2),Oe(2,3,0)}function we(pt,ze,Ge){var Oe=function(ve,ge,be){ie(pt,[ze[ve],ze[ge],ze[be]],[Ge[ve],Ge[ge],Ge[be]])};Oe(0,1,2),Oe(3,0,1),Oe(2,3,0),Oe(1,2,3)}function Ae(pt,ze,Ge,Oe){var ve=pt[3];veOe&&(ve=Oe);for(var ge=(pt[3]-ve)/(pt[3]-ze[3]+1e-9),be=[],Pe=0;Pe<4;Pe++)be[Pe]=(1-ge)*pt[Pe]+ge*ze[Pe];return be}function Fe(pt,ze,Ge){return pt>=ze&&pt<=Ge}function Ce(pt){var ze=.001*(O-B);return pt>=B-ze&&pt<=O+ze}function qe(pt){for(var ze=[],Ge=0;Ge<4;Ge++){var Oe=pt[Ge];ze.push([c._x[Oe],c._y[Oe],c._z[Oe],c._value[Oe]])}return ze}var et=3;function Qe(pt,ze,Ge,Oe,ve,ge){ge||(ge=1),Ge=[-1,-1,-1];var be=!1,Pe=[Fe(ze[0][3],Oe,ve),Fe(ze[1][3],Oe,ve),Fe(ze[2][3],Oe,ve)];if(!Pe[0]&&!Pe[1]&&!Pe[2])return!1;var We=function(_t,Mt,Nt){return Ce(Mt[0][3])&&Ce(Mt[1][3])&&Ce(Mt[2][3])?(ie(_t,Mt,Nt),!0):gePe?[z,ge]:[ge,F];Rt(ze,We[0],We[1])}}var ct=[[Math.min(B,F),Math.max(B,F)],[Math.min(z,O),Math.max(z,O)]];["x","y","z"].forEach(function(_t){for(var Mt=[],Nt=0;Nt0&&(da.push(Ia.id),_t==="x"?wa.push([Ia.distRatio,0,0]):_t==="y"?wa.push([0,Ia.distRatio,0]):wa.push([0,0,Ia.distRatio]))}else _t==="x"?ta=Mr(1,u-1):_t==="y"?ta=Mr(1,g-1):ta=Mr(1,m-1);da.length>0&&(_t==="x"?Mt[Bt]=Ut(pt,da,qt,Zt,wa,Mt[Bt]):_t==="y"?Mt[Bt]=ir(pt,da,qt,Zt,wa,Mt[Bt]):Mt[Bt]=ar(pt,da,qt,Zt,wa,Mt[Bt]),Bt++),ta.length>0&&(_t==="x"?Mt[Bt]=$e(pt,ta,qt,Zt,Mt[Bt]):_t==="y"?Mt[Bt]=rt(pt,ta,qt,Zt,Mt[Bt]):Mt[Bt]=Je(pt,ta,qt,Zt,Mt[Bt]),Bt++)}var va=c.caps[_t];va.show&&va.fill&&(re(va.fill),_t==="x"?Mt[Bt]=$e(pt,[0,u-1],qt,Zt,Mt[Bt]):_t==="y"?Mt[Bt]=rt(pt,[0,g-1],qt,Zt,Mt[Bt]):Mt[Bt]=Je(pt,[0,m-1],qt,Zt,Mt[Bt]),Bt++)}}),b===0&&oe(),c._meshX=L,c._meshY=N,c._meshZ=U,c._meshIntensity=Z,c._Xs=_,c._Ys=w,c._Zs=p}return dr(),c}function s(c,f){var v=c.glplot.gl,h=d({gl:v}),T=new o(c,h,f.uid);return h._trace=T,T.update(f),c.glplot.add(h),T}G.exports={findNearestOnAxis:r,generateIsoMeshes:n,createIsosurfaceTrace:s}}}),HL=He({"src/traces/isosurface/index.js"(Y,G){G.exports={attributes:B_(),supplyDefaults:F3().supplyDefaults,calc:O3(),colorbar:{min:"cmin",max:"cmax"},plot:U_().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:ap(),categories:["gl3d","showLegend"],meta:{}}}}),GL=He({"lib/isosurface.js"(Y,G){G.exports=HL()}}),B3=He({"src/traces/volume/attributes.js"(Y,G){var d=kl(),x=B_(),A=Uy(),E=cl(),e=ho().extendFlat,t=hu().overrideAll,r=G.exports=t(e({x:x.x,y:x.y,z:x.z,value:x.value,isomin:x.isomin,isomax:x.isomax,surface:x.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:x.slices,caps:x.caps,text:x.text,hovertext:x.hovertext,xhoverformat:x.xhoverformat,yhoverformat:x.yhoverformat,zhoverformat:x.zhoverformat,valuehoverformat:x.valuehoverformat,hovertemplate:x.hovertemplate},d("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:x.colorbar,opacity:x.opacity,opacityscale:A.opacityscale,lightposition:x.lightposition,lighting:x.lighting,flatshading:x.flatshading,contour:x.contour,hoverinfo:e({},E.hoverinfo),showlegend:e({},E.showlegend,{dflt:!1})}),"calc","nested");r.x.editType=r.y.editType=r.z.editType=r.value.editType="calc+clearAxisTypes"}}),WL=He({"src/traces/volume/defaults.js"(Y,G){var d=Gr(),x=B3(),A=F3().supplyIsoDefaults,E=z3().opacityscaleDefaults;G.exports=function(t,r,o,a){function i(n,s){return d.coerce(t,r,x,n,s)}A(t,r,o,a,i),E(t,r,a,i)}}}),ZL=He({"src/traces/volume/convert.js"(Y,G){var d=Hf().gl_mesh3d,x=fd().parseColorScale,A=Gr().isArrayOrTypedArray,E=cd(),e=Kl().extractOpts,t=lg(),r=U_().findNearestOnAxis,o=U_().generateIsoMeshes;function a(s,c,f){this.scene=s,this.uid=f,this.mesh=c,this.name="",this.data=null,this.showContour=!1}var i=a.prototype;i.handlePick=function(s){if(s.object===this.mesh){var c=s.data.index,f=this.data._meshX[c],v=this.data._meshY[c],h=this.data._meshZ[c],T=this.data._Ys.length,l=this.data._Zs.length,y=r(f,this.data._Xs).id,b=r(v,this.data._Ys).id,S=r(h,this.data._Zs).id,M=s.index=S+l*b+l*T*y;s.traceCoordinate=[this.data._meshX[M],this.data._meshY[M],this.data._meshZ[M],this.data._value[M]];var _=this.data.hovertext||this.data.text;return A(_)&&_[M]!==void 0?s.textLabel=_[M]:_&&(s.textLabel=_),!0}},i.update=function(s){var c=this.scene,f=c.fullSceneLayout;this.data=o(s);function v(b,S,M,_){return S.map(function(w){return b.d2l(w,0,_)*M})}var h=t(v(f.xaxis,s._meshX,c.dataScale[0],s.xcalendar),v(f.yaxis,s._meshY,c.dataScale[1],s.ycalendar),v(f.zaxis,s._meshZ,c.dataScale[2],s.zcalendar)),T=t(s._meshI,s._meshJ,s._meshK),l={positions:h,cells:T,lightPosition:[s.lightposition.x,s.lightposition.y,s.lightposition.z],ambient:s.lighting.ambient,diffuse:s.lighting.diffuse,specular:s.lighting.specular,roughness:s.lighting.roughness,fresnel:s.lighting.fresnel,vertexNormalsEpsilon:s.lighting.vertexnormalsepsilon,faceNormalsEpsilon:s.lighting.facenormalsepsilon,opacity:s.opacity,opacityscale:s.opacityscale,contourEnable:s.contour.show,contourColor:E(s.contour.color).slice(0,3),contourWidth:s.contour.width,useFacetNormals:s.flatshading},y=e(s);l.vertexIntensity=s._meshIntensity,l.vertexIntensityBounds=[y.min,y.max],l.colormap=x(s),this.mesh.update(l)},i.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function n(s,c){var f=s.glplot.gl,v=d({gl:f}),h=new a(s,v,c.uid);return v._trace=h,h.update(c),s.glplot.add(v),h}G.exports=n}}),XL=He({"src/traces/volume/index.js"(Y,G){G.exports={attributes:B3(),supplyDefaults:WL(),calc:O3(),colorbar:{min:"cmin",max:"cmax"},plot:ZL(),moduleType:"trace",name:"volume",basePlotModule:ap(),categories:["gl3d","showLegend"],meta:{}}}}),YL=He({"lib/volume.js"(Y,G){G.exports=XL()}}),KL=He({"src/traces/mesh3d/defaults.js"(Y,G){var d=Ei(),x=Gr(),A=pf(),E=sg();G.exports=function(t,r,o,a){function i(v,h){return x.coerce(t,r,E,v,h)}function n(v){var h=v.map(function(T){var l=i(T);return l&&x.isArrayOrTypedArray(l)?l:null});return h.every(function(T){return T&&T.length===h[0].length})&&h}var s=n(["x","y","z"]);if(!s){r.visible=!1;return}if(n(["i","j","k"]),r.i&&(!r.j||!r.k)||r.j&&(!r.k||!r.i)||r.k&&(!r.i||!r.j)){r.visible=!1;return}var c=d.getComponentMethod("calendars","handleTraceDefaults");c(t,r,["x","y","z"],a),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(v){i(v)});var f=i("contour.show");f&&(i("contour.color"),i("contour.width")),"intensity"in t?(i("intensity"),i("intensitymode"),A(t,r,a,i,{prefix:"",cLetter:"c"})):(r.showscale=!1,"facecolor"in t?i("facecolor"):"vertexcolor"in t?i("vertexcolor"):i("color",o)),i("text"),i("hovertext"),i("hovertemplate"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),r._length=null}}}),JL=He({"src/traces/mesh3d/calc.js"(Y,G){var d=Sh();G.exports=function(A,E){E.intensity&&d(A,E,{vals:E.intensity,containerStr:"",cLetter:"c"})}}}),$L=He({"src/traces/mesh3d/convert.js"(Y,G){var d=Hf().gl_mesh3d,x=Hf().delaunay_triangulate,A=Hf().alpha_shape,E=Hf().convex_hull,e=fd().parseColorScale,t=Gr().isArrayOrTypedArray,r=cd(),o=Kl().extractOpts,a=lg();function i(l,y,b){this.scene=l,this.uid=b,this.mesh=y,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var n=i.prototype;n.handlePick=function(l){if(l.object===this.mesh){var y=l.index=l.data.index;l.data._cellCenter?l.traceCoordinate=l.data.dataCoordinate:l.traceCoordinate=[this.data.x[y],this.data.y[y],this.data.z[y]];var b=this.data.hovertext||this.data.text;return t(b)&&b[y]!==void 0?l.textLabel=b[y]:b&&(l.textLabel=b),!0}};function s(l){for(var y=[],b=l.length,S=0;S=y-.5)return!1;return!0}n.update=function(l){var y=this.scene,b=y.fullSceneLayout;this.data=l;var S=l.x.length,M=a(c(b.xaxis,l.x,y.dataScale[0],l.xcalendar),c(b.yaxis,l.y,y.dataScale[1],l.ycalendar),c(b.zaxis,l.z,y.dataScale[2],l.zcalendar)),_;if(l.i&&l.j&&l.k){if(l.i.length!==l.j.length||l.j.length!==l.k.length||!h(l.i,S)||!h(l.j,S)||!h(l.k,S))return;_=a(f(l.i),f(l.j),f(l.k))}else l.alphahull===0?_=E(M):l.alphahull>0?_=A(l.alphahull,M):_=v(l.delaunayaxis,M);var w={positions:M,cells:_,lightPosition:[l.lightposition.x,l.lightposition.y,l.lightposition.z],ambient:l.lighting.ambient,diffuse:l.lighting.diffuse,specular:l.lighting.specular,roughness:l.lighting.roughness,fresnel:l.lighting.fresnel,vertexNormalsEpsilon:l.lighting.vertexnormalsepsilon,faceNormalsEpsilon:l.lighting.facenormalsepsilon,opacity:l.opacity,contourEnable:l.contour.show,contourColor:r(l.contour.color).slice(0,3),contourWidth:l.contour.width,useFacetNormals:l.flatshading};if(l.intensity){var p=o(l);this.color="#fff";var u=l.intensitymode;w[u+"Intensity"]=l.intensity,w[u+"IntensityBounds"]=[p.min,p.max],w.colormap=e(l)}else l.vertexcolor?(this.color=l.vertexcolor[0],w.vertexColors=s(l.vertexcolor)):l.facecolor?(this.color=l.facecolor[0],w.cellColors=s(l.facecolor)):(this.color=l.color,w.meshColor=r(l.color));this.mesh.update(w)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function T(l,y){var b=l.glplot.gl,S=d({gl:b}),M=new i(l,S,y.uid);return S._trace=M,M.update(y),l.glplot.add(S),M}G.exports=T}}),QL=He({"src/traces/mesh3d/index.js"(Y,G){G.exports={attributes:sg(),supplyDefaults:KL(),calc:JL(),colorbar:{min:"cmin",max:"cmax"},plot:$L(),moduleType:"trace",name:"mesh3d",basePlotModule:ap(),categories:["gl3d","showLegend"],meta:{}}}}),eP=He({"lib/mesh3d.js"(Y,G){G.exports=QL()}}),N3=He({"src/traces/cone/attributes.js"(Y,G){var d=kl(),x=Gu().axisHoverFormat,A=Yo().hovertemplateAttrs,E=sg(),e=cl(),t=ho().extendFlat,r={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:A({editType:"calc"},{keys:["norm"]}),uhoverformat:x("u",1),vhoverformat:x("v",1),whoverformat:x("w",1),xhoverformat:x("x"),yhoverformat:x("y"),zhoverformat:x("z"),showlegend:t({},e.showlegend,{dflt:!1})};t(r,d("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var o=["opacity","lightposition","lighting"];o.forEach(function(a){r[a]=E[a]}),r.hoverinfo=t({},e.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),G.exports=r}}),tP=He({"src/traces/cone/defaults.js"(Y,G){var d=Gr(),x=pf(),A=N3();G.exports=function(e,t,r,o){function a(T,l){return d.coerce(e,t,A,T,l)}var i=a("u"),n=a("v"),s=a("w"),c=a("x"),f=a("y"),v=a("z");if(!i||!i.length||!n||!n.length||!s||!s.length||!c||!c.length||!f||!f.length||!v||!v.length){t.visible=!1;return}var h=a("sizemode");a("sizeref",h==="raw"?1:.5),a("anchor"),a("lighting.ambient"),a("lighting.diffuse"),a("lighting.specular"),a("lighting.roughness"),a("lighting.fresnel"),a("lightposition.x"),a("lightposition.y"),a("lightposition.z"),x(e,t,o,a,{prefix:"",cLetter:"c"}),a("text"),a("hovertext"),a("hovertemplate"),a("uhoverformat"),a("vhoverformat"),a("whoverformat"),a("xhoverformat"),a("yhoverformat"),a("zhoverformat"),t._length=null}}}),rP=He({"src/traces/cone/calc.js"(Y,G){var d=Sh();G.exports=function(A,E){for(var e=E.u,t=E.v,r=E.w,o=Math.min(E.x.length,E.y.length,E.z.length,e.length,t.length,r.length),a=-1/0,i=1/0,n=0;n2?h=f.slice(1,v-1):v===2?h=[(f[0]+f[1])/2]:h=f,h}function n(f){var v=f.length;return v===1?[.5,.5]:[f[1]-f[0],f[v-1]-f[v-2]]}function s(f,v){var h=f.fullSceneLayout,T=f.dataScale,l=v._len,y={};function b(le,j){var J=h[j],$=T[r[j]];return A.simpleMap(le,function(X){return J.d2l(X)*$})}if(y.vectors=t(b(v._u,"xaxis"),b(v._v,"yaxis"),b(v._w,"zaxis"),l),!l)return{positions:[],cells:[]};var S=b(v._Xs,"xaxis"),M=b(v._Ys,"yaxis"),_=b(v._Zs,"zaxis");y.meshgrid=[S,M,_],y.gridFill=v._gridFill;var w=v._slen;if(w)y.startingPositions=t(b(v._startsX,"xaxis"),b(v._startsY,"yaxis"),b(v._startsZ,"zaxis"));else{for(var p=M[0],u=i(S),g=i(_),m=new Array(u.length*g.length),R=0,P=0;Pp&&(p=R[0]),R[1]u&&(u=R[1])}function m(R){switch(R.type){case"GeometryCollection":R.geometries.forEach(m);break;case"Point":g(R.coordinates);break;case"MultiPoint":R.coordinates.forEach(g);break}}b.arcs.forEach(function(R){for(var P=-1,z=R.length,F;++Pp&&(p=F[0]),F[1]u&&(u=F[1])});for(M in b.objects)m(b.objects[M]);return[_,w,p,u]}function e(b,S){for(var M,_=b.length,w=_-S;w<--_;)M=b[w],b[w++]=b[_],b[_]=M}function t(b,S){return typeof S=="string"&&(S=b.objects[S]),S.type==="GeometryCollection"?{type:"FeatureCollection",features:S.geometries.map(function(M){return r(b,M)})}:r(b,S)}function r(b,S){var M=S.id,_=S.bbox,w=S.properties==null?{}:S.properties,p=o(b,S);return M==null&&_==null?{type:"Feature",properties:w,geometry:p}:_==null?{type:"Feature",id:M,properties:w,geometry:p}:{type:"Feature",id:M,bbox:_,properties:w,geometry:p}}function o(b,S){var M=A(b.transform),_=b.arcs;function w(P,z){z.length&&z.pop();for(var F=_[P<0?~P:P],B=0,O=F.length;B1)_=s(b,S,M);else for(w=0,_=new Array(p=b.arcs.length);w1)for(var z=1,F=g(R[0]),B,O;zF&&(O=R[0],R[0]=R[z],R[z]=O,F=B);return R}).filter(function(m){return m.length>0})}}function h(b,S){for(var M=0,_=b.length;M<_;){var w=M+_>>>1;b[w]=2))throw new Error("n must be ≥2");m=b.bbox||E(b);var M=m[0],_=m[1],w=m[2],p=m[3],u;S={scale:[w-M?(w-M)/(u-1):1,p-_?(p-_)/(u-1):1],translate:[M,_]}}else m=b.bbox;var g=l(S),m,R,P=b.objects,z={};function F(L){return g(L)}function B(L){var N;switch(L.type){case"GeometryCollection":N={type:"GeometryCollection",geometries:L.geometries.map(B)};break;case"Point":N={type:"Point",coordinates:F(L.coordinates)};break;case"MultiPoint":N={type:"MultiPoint",coordinates:L.coordinates.map(F)};break;default:return L}return L.id!=null&&(N.id=L.id),L.bbox!=null&&(N.bbox=L.bbox),L.properties!=null&&(N.properties=L.properties),N}function O(L){var N=0,U=1,Z=L.length,Q,ue=new Array(Z);for(ue[0]=g(L[0],0);++N0&&(E.push(e),e=[])}return e.length>0&&E.push(e),E},Y.makeLine=function(d){return d.length===1?{type:"LineString",coordinates:d[0]}:{type:"MultiLineString",coordinates:d}},Y.makePolygon=function(d){if(d.length===1)return{type:"Polygon",coordinates:d};for(var x=new Array(d.length),A=0;Ae(B,z)),F)}function r(P,z,F={}){for(const O of P){if(O.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(O[O.length-1].length!==O[0].length)throw new Error("First and last Position are not equivalent.");for(let L=0;Lr(B,z)),F)}function a(P,z,F={}){if(P.length<2)throw new Error("coordinates must be an array of two or more positions");return A({type:"LineString",coordinates:P},z,F)}function i(P,z,F={}){return n(P.map(B=>a(B,z)),F)}function n(P,z={}){const F={type:"FeatureCollection"};return z.id&&(F.id=z.id),z.bbox&&(F.bbox=z.bbox),F.features=P,F}function s(P,z,F={}){return A({type:"MultiLineString",coordinates:P},z,F)}function c(P,z,F={}){return A({type:"MultiPoint",coordinates:P},z,F)}function f(P,z,F={}){return A({type:"MultiPolygon",coordinates:P},z,F)}function v(P,z,F={}){return A({type:"GeometryCollection",geometries:P},z,F)}function h(P,z=0){if(z&&!(z>=0))throw new Error("precision must be a positive number");const F=Math.pow(10,z||0);return Math.round(P*F)/F}function T(P,z="kilometers"){const F=d[z];if(!F)throw new Error(z+" units is invalid");return P*F}function l(P,z="kilometers"){const F=d[z];if(!F)throw new Error(z+" units is invalid");return P/F}function y(P,z){return M(l(P,z))}function b(P){let z=P%360;return z<0&&(z+=360),z}function S(P){return P=P%360,P>0?P>180?P-360:P:P<-180?P+360:P}function M(P){return P%(2*Math.PI)*180/Math.PI}function _(P){return P%360*Math.PI/180}function w(P,z="kilometers",F="kilometers"){if(!(P>=0))throw new Error("length must be a positive number");return T(l(P,z),F)}function p(P,z="meters",F="kilometers"){if(!(P>=0))throw new Error("area must be a positive number");const B=x[z];if(!B)throw new Error("invalid original units");const O=x[F];if(!O)throw new Error("invalid final units");return P/B*O}function u(P){return!isNaN(P)&&P!==null&&!Array.isArray(P)}function g(P){return P!==null&&typeof P=="object"&&!Array.isArray(P)}function m(P){if(!P)throw new Error("bbox is required");if(!Array.isArray(P))throw new Error("bbox must be an Array");if(P.length!==4&&P.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");P.forEach(z=>{if(!u(z))throw new Error("bbox must only contain numbers")})}function R(P){if(!P)throw new Error("id is required");if(["string","number"].indexOf(typeof P)===-1)throw new Error("id must be a number or a string")}Y.areaFactors=x,Y.azimuthToBearing=S,Y.bearingToAzimuth=b,Y.convertArea=p,Y.convertLength=w,Y.degreesToRadians=_,Y.earthRadius=G,Y.factors=d,Y.feature=A,Y.featureCollection=n,Y.geometry=E,Y.geometryCollection=v,Y.isNumber=u,Y.isObject=g,Y.lengthToDegrees=y,Y.lengthToRadians=l,Y.lineString=a,Y.lineStrings=i,Y.multiLineString=s,Y.multiPoint=c,Y.multiPolygon=f,Y.point=e,Y.points=t,Y.polygon=r,Y.polygons=o,Y.radiansToDegrees=M,Y.radiansToLength=T,Y.round=h,Y.validateBBox=m,Y.validateId=R}}),H_=He({"node_modules/@turf/meta/dist/cjs/index.cjs"(Y){Object.defineProperty(Y,"__esModule",{value:!0});var G=q_();function d(l,y,b){if(l!==null)for(var S,M,_,w,p,u,g,m=0,R=0,P,z=l.type,F=z==="FeatureCollection",B=z==="Feature",O=F?l.features.length:1,L=0;Lu||F>g||B>m){p=R,u=S,g=F,m=B,_=0;return}var O=G.lineString.call(void 0,[p,R],b.properties);if(y(O,S,M,B,_)===!1)return!1;_++,p=R})===!1)return!1}}})}function c(l,y,b){var S=b,M=!1;return s(l,function(_,w,p,u,g){M===!1&&b===void 0?S=_:S=y(S,_,w,p,u,g),M=!0}),S}function f(l,y){if(!l)throw new Error("geojson is required");i(l,function(b,S,M){if(b.geometry!==null){var _=b.geometry.type,w=b.geometry.coordinates;switch(_){case"LineString":if(y(b,S,M,0,0)===!1)return!1;break;case"Polygon":for(var p=0;pi+A(n),0)}function A(a){let i=0,n;switch(a.type){case"Polygon":return E(a.coordinates);case"MultiPolygon":for(n=0;n0){i+=Math.abs(r(a[0]));for(let n=1;n=i?(s+2)%i:s+2],h=c[0]*t,T=f[1]*t,l=v[0]*t;n+=(l-h)*Math.sin(T),s++}return n*e}var o=x;Y.area=x,Y.default=o}}),dP=He({"node_modules/@turf/centroid/dist/cjs/index.cjs"(Y){Object.defineProperty(Y,"__esModule",{value:!0});var G=q_(),d=H_();function x(E,e={}){let t=0,r=0,o=0;return d.coordEach.call(void 0,E,function(a){t+=a[0],r+=a[1],o++},!0),G.point.call(void 0,[t/o,r/o],e.properties)}var A=x;Y.centroid=x,Y.default=A}}),pP=He({"node_modules/@turf/bbox/dist/cjs/index.cjs"(Y){Object.defineProperty(Y,"__esModule",{value:!0});var G=H_();function d(A,E={}){if(A.bbox!=null&&E.recompute!==!0)return A.bbox;const e=[1/0,1/0,-1/0,-1/0];return G.coordEach.call(void 0,A,t=>{e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]0&&z[F+1][0]<0)return F;return null}switch(w==="RUS"||w==="FJI"?u=function(z){var F;if(P(z)===null)F=z;else for(F=new Array(z.length),R=0;RF?B[O++]=[z[R][0]+360,z[R][1]]:R===F?(B[O++]=z[R],B[O++]=[z[R][0],-90]):B[O++]=z[R];var L=i.tester(B);L.pts.pop(),p.push(L)}:u=function(z){p.push(i.tester(z))},M.type){case"MultiPolygon":for(g=0;g<_.length;g++)for(m=0;m<_[g].length;m++)u(_[g][m]);break;case"Polygon":for(g=0;g<_.length;g++)u(_[g]);break}return p}function h(S){var M=S.geojson,_=window.PlotlyGeoAssets||{},w=typeof M=="string"?_[M]:M;return o(w)?w:(r.error("Oops ... something went wrong when fetching "+M),!1)}function T(S){var M=S[0].trace,_=h(M);if(!_)return!1;var w={},p=[],u;for(u=0;u0?L.properties.ct=l(L):L.properties.ct=[NaN,NaN],B.fIn=z,B.fOut=L,p.push(L)}else r.log(["Location",B.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete w[F]}switch(_.type){case"FeatureCollection":var R=_.features;for(u=0;up&&(p=m,_=g)}else _=M;return E(_).geometry.coordinates}function y(S){var M=window.PlotlyGeoAssets||{},_=[];function w(R){return new Promise(function(P,z){d.json(R,function(F,B){if(F){delete M[R];var O=F.status===404?'GeoJSON at URL "'+R+'" does not exist.':"Unexpected error while fetching from "+R;return z(new Error(O))}return M[R]=B,P(B)})})}function p(R){return new Promise(function(P,z){var F=0,B=setInterval(function(){if(M[R]&&M[R]!=="pending")return clearInterval(B),P(M[R]);if(F>100)return clearInterval(B),z("Unexpected error while fetching from "+R);F++},50)})}for(var u=0;u")}}}),yP=He({"src/traces/scattergeo/event_data.js"(Y,G){G.exports=function(x,A,E,e,t){x.lon=A.lon,x.lat=A.lat,x.location=A.loc?A.loc:null;var r=e[t];return r.fIn&&r.fIn.properties&&(x.properties=r.fIn.properties),x}}}),mP=He({"src/traces/scattergeo/select.js"(Y,G){var d=Rl(),x=lo().BADNUM;G.exports=function(E,e){var t=E.cd,r=E.xaxis,o=E.yaxis,a=[],i=t[0].trace,n,s,c,f,v,h=!d.hasMarkers(i)&&!d.hasText(i);if(h)return[];if(e===!1)for(v=0;vX?1:$>=X?0:NaN}function A($){return $.length===1&&($=E($)),{left:function(X,re,ee,q){for(ee==null&&(ee=0),q==null&&(q=X.length);ee>>1;$(X[ae],re)<0?ee=ae+1:q=ae}return ee},right:function(X,re,ee,q){for(ee==null&&(ee=0),q==null&&(q=X.length);ee>>1;$(X[ae],re)>0?q=ae:ee=ae+1}return ee}}}function E($){return function(X,re){return x($(X),re)}}var e=A(x),t=e.right,r=e.left;function o($,X){X==null&&(X=a);for(var re=0,ee=$.length-1,q=$[0],ae=new Array(ee<0?0:ee);re$?1:X>=$?0:NaN}function s($){return $===null?NaN:+$}function c($,X){var re=$.length,ee=0,q=-1,ae=0,ie,fe,we=0;if(X==null)for(;++q1)return we/(ee-1)}function f($,X){var re=c($,X);return re&&Math.sqrt(re)}function v($,X){var re=$.length,ee=-1,q,ae,ie;if(X==null){for(;++ee=q)for(ae=ie=q;++eeq&&(ae=q),ie=q)for(ae=ie=q;++eeq&&(ae=q),ie0)return[$];if((ee=X<$)&&(ae=$,$=X,X=ae),(fe=u($,X,re))===0||!isFinite(fe))return[];if(fe>0)for($=Math.ceil($/fe),X=Math.floor(X/fe),ie=new Array(ae=Math.ceil(X-$+1));++q=0?(ae>=M?10:ae>=_?5:ae>=w?2:1)*Math.pow(10,q):-Math.pow(10,-q)/(ae>=M?10:ae>=_?5:ae>=w?2:1)}function g($,X,re){var ee=Math.abs(X-$)/Math.max(0,re),q=Math.pow(10,Math.floor(Math.log(ee)/Math.LN10)),ae=ee/q;return ae>=M?q*=10:ae>=_?q*=5:ae>=w&&(q*=2),X<$?-q:q}function m($){return Math.ceil(Math.log($.length)/Math.LN2)+1}function R(){var $=b,X=v,re=m;function ee(q){var ae,ie=q.length,fe,we=new Array(ie);for(ae=0;aeCe;)qe.pop(),--et;var Qe=new Array(et+1),Ke;for(ae=0;ae<=et;++ae)Ke=Qe[ae]=[],Ke.x0=ae>0?qe[ae-1]:Fe,Ke.x1=ae=1)return+re($[ee-1],ee-1,$);var ee,q=(ee-1)*X,ae=Math.floor(q),ie=+re($[ae],ae,$),fe=+re($[ae+1],ae+1,$);return ie+(fe-ie)*(q-ae)}}function z($,X,re){return $=l.call($,s).sort(x),Math.ceil((re-X)/(2*(P($,.75)-P($,.25))*Math.pow($.length,-1/3)))}function F($,X,re){return Math.ceil((re-X)/(3.5*f($)*Math.pow($.length,-1/3)))}function B($,X){var re=$.length,ee=-1,q,ae;if(X==null){for(;++ee=q)for(ae=q;++eeae&&(ae=q)}else for(;++ee=q)for(ae=q;++eeae&&(ae=q);return ae}function O($,X){var re=$.length,ee=re,q=-1,ae,ie=0;if(X==null)for(;++q=0;)for(ie=$[X],re=ie.length;--re>=0;)ae[--q]=ie[re];return ae}function U($,X){var re=$.length,ee=-1,q,ae;if(X==null){for(;++ee=q)for(ae=q;++eeq&&(ae=q)}else for(;++ee=q)for(ae=q;++eeq&&(ae=q);return ae}function Z($,X){for(var re=X.length,ee=new Array(re);re--;)ee[re]=$[X[re]];return ee}function Q($,X){if(re=$.length){var re,ee=0,q=0,ae,ie=$[q];for(X==null&&(X=x);++ee0?1:Ht<0?-1:0},p=Math.sqrt,u=Math.tan;function g(Ht){return Ht>1?0:Ht<-1?a:Math.acos(Ht)}function m(Ht){return Ht>1?i:Ht<-1?-i:Math.asin(Ht)}function R(Ht){return(Ht=_(Ht/2))*Ht}function P(){}function z(Ht,ur){Ht&&B.hasOwnProperty(Ht.type)&&B[Ht.type](Ht,ur)}var F={Feature:function(Ht,ur){z(Ht.geometry,ur)},FeatureCollection:function(Ht,ur){for(var qr=Ht.features,Or=-1,ua=qr.length;++Or=0?1:-1,ua=Or*qr,Fa=l(ur),ja=_(ur),sn=j*ja,gn=le*Fa+sn*l(ua),kn=sn*Or*_(ua);U.add(T(kn,gn)),oe=Ht,le=Fa,j=ja}function q(Ht){return Z.reset(),N(Ht,J),Z*2}function ae(Ht){return[T(Ht[1],Ht[0]),m(Ht[2])]}function ie(Ht){var ur=Ht[0],qr=Ht[1],Or=l(qr);return[Or*l(ur),Or*_(ur),_(qr)]}function fe(Ht,ur){return Ht[0]*ur[0]+Ht[1]*ur[1]+Ht[2]*ur[2]}function we(Ht,ur){return[Ht[1]*ur[2]-Ht[2]*ur[1],Ht[2]*ur[0]-Ht[0]*ur[2],Ht[0]*ur[1]-Ht[1]*ur[0]]}function Ae(Ht,ur){Ht[0]+=ur[0],Ht[1]+=ur[1],Ht[2]+=ur[2]}function Fe(Ht,ur){return[Ht[0]*ur,Ht[1]*ur,Ht[2]*ur]}function Ce(Ht){var ur=p(Ht[0]*Ht[0]+Ht[1]*Ht[1]+Ht[2]*Ht[2]);Ht[0]/=ur,Ht[1]/=ur,Ht[2]/=ur}var qe,et,Qe,Ke,Xe,Me,xe,ce,Re=A(),$e,rt,Je={point:At,lineStart:Rt,lineEnd:Ut,polygonStart:function(){Je.point=ir,Je.lineStart=ar,Je.lineEnd=Mr,Re.reset(),J.polygonStart()},polygonEnd:function(){J.polygonEnd(),Je.point=At,Je.lineStart=Rt,Je.lineEnd=Ut,U<0?(qe=-(Qe=180),et=-(Ke=90)):Re>r?Ke=90:Re<-r&&(et=-90),rt[0]=qe,rt[1]=Qe},sphere:function(){qe=-(Qe=180),et=-(Ke=90)}};function At(Ht,ur){$e.push(rt=[qe=Ht,Qe=Ht]),urKe&&(Ke=ur)}function St(Ht,ur){var qr=ie([Ht*f,ur*f]);if(ce){var Or=we(ce,qr),ua=[Or[1],-Or[0],0],Fa=we(ua,Or);Ce(Fa),Fa=ae(Fa);var ja=Ht-Xe,sn=ja>0?1:-1,gn=Fa[0]*c*sn,kn,Ja=v(ja)>180;Ja^(sn*XeKe&&(Ke=kn)):(gn=(gn+360)%360-180,Ja^(sn*XeKe&&(Ke=ur))),Ja?Htfr(qe,Qe)&&(Qe=Ht):fr(Ht,Qe)>fr(qe,Qe)&&(qe=Ht):Qe>=qe?(HtQe&&(Qe=Ht)):Ht>Xe?fr(qe,Ht)>fr(qe,Qe)&&(Qe=Ht):fr(Ht,Qe)>fr(qe,Qe)&&(qe=Ht)}else $e.push(rt=[qe=Ht,Qe=Ht]);urKe&&(Ke=ur),ce=qr,Xe=Ht}function Rt(){Je.point=St}function Ut(){rt[0]=qe,rt[1]=Qe,Je.point=At,ce=null}function ir(Ht,ur){if(ce){var qr=Ht-Xe;Re.add(v(qr)>180?qr+(qr>0?360:-360):qr)}else Me=Ht,xe=ur;J.point(Ht,ur),St(Ht,ur)}function ar(){J.lineStart()}function Mr(){ir(Me,xe),J.lineEnd(),v(Re)>r&&(qe=-(Qe=180)),rt[0]=qe,rt[1]=Qe,ce=null}function fr(Ht,ur){return(ur-=Ht)<0?ur+360:ur}function dr(Ht,ur){return Ht[0]-ur[0]}function pt(Ht,ur){return Ht[0]<=Ht[1]?Ht[0]<=ur&&ur<=Ht[1]:urfr(Or[0],Or[1])&&(Or[1]=ua[1]),fr(ua[0],Or[1])>fr(Or[0],Or[1])&&(Or[0]=ua[0])):Fa.push(Or=ua);for(ja=-1/0,qr=Fa.length-1,ur=0,Or=Fa[qr];ur<=qr;Or=ua,++ur)ua=Fa[ur],(sn=fr(Or[1],ua[0]))>ja&&(ja=sn,qe=ua[0],Qe=Or[1])}return $e=rt=null,qe===1/0||et===1/0?[[NaN,NaN],[NaN,NaN]]:[[qe,et],[Qe,Ke]]}var Ge,Oe,ve,ge,be,Pe,We,ct,_t,Mt,Nt,Bt,qt,Zt,lr,ta,da={sphere:P,point:wa,lineStart:Ia,lineEnd:Ka,polygonStart:function(){da.lineStart=Vt,da.lineEnd=Lt},polygonEnd:function(){da.lineStart=Ia,da.lineEnd=Ka}};function wa(Ht,ur){Ht*=f,ur*=f;var qr=l(ur);ma(qr*l(Ht),qr*_(Ht),_(ur))}function ma(Ht,ur,qr){++Ge,ve+=(Ht-ve)/Ge,ge+=(ur-ge)/Ge,be+=(qr-be)/Ge}function Ia(){da.point=va}function va(Ht,ur){Ht*=f,ur*=f;var qr=l(ur);Zt=qr*l(Ht),lr=qr*_(Ht),ta=_(ur),da.point=La,ma(Zt,lr,ta)}function La(Ht,ur){Ht*=f,ur*=f;var qr=l(ur),Or=qr*l(Ht),ua=qr*_(Ht),Fa=_(ur),ja=T(p((ja=lr*Fa-ta*ua)*ja+(ja=ta*Or-Zt*Fa)*ja+(ja=Zt*ua-lr*Or)*ja),Zt*Or+lr*ua+ta*Fa);Oe+=ja,Pe+=ja*(Zt+(Zt=Or)),We+=ja*(lr+(lr=ua)),ct+=ja*(ta+(ta=Fa)),ma(Zt,lr,ta)}function Ka(){da.point=wa}function Vt(){da.point=jt}function Lt(){Ot(Bt,qt),da.point=wa}function jt(Ht,ur){Bt=Ht,qt=ur,Ht*=f,ur*=f,da.point=Ot;var qr=l(ur);Zt=qr*l(Ht),lr=qr*_(Ht),ta=_(ur),ma(Zt,lr,ta)}function Ot(Ht,ur){Ht*=f,ur*=f;var qr=l(ur),Or=qr*l(Ht),ua=qr*_(Ht),Fa=_(ur),ja=lr*Fa-ta*ua,sn=ta*Or-Zt*Fa,gn=Zt*ua-lr*Or,kn=p(ja*ja+sn*sn+gn*gn),Ja=m(kn),_n=kn&&-Ja/kn;_t+=_n*ja,Mt+=_n*sn,Nt+=_n*gn,Oe+=Ja,Pe+=Ja*(Zt+(Zt=Or)),We+=Ja*(lr+(lr=ua)),ct+=Ja*(ta+(ta=Fa)),ma(Zt,lr,ta)}function gr(Ht){Ge=Oe=ve=ge=be=Pe=We=ct=_t=Mt=Nt=0,N(Ht,da);var ur=_t,qr=Mt,Or=Nt,ua=ur*ur+qr*qr+Or*Or;return uaa?Ht+Math.round(-Ht/s)*s:Ht,ur]}Ur.invert=Ur;function ga(Ht,ur,qr){return(Ht%=s)?ur||qr?na(Pa(Ht),sa(ur,qr)):Pa(Ht):ur||qr?sa(ur,qr):Ur}function Aa(Ht){return function(ur,qr){return ur+=Ht,[ur>a?ur-s:ur<-a?ur+s:ur,qr]}}function Pa(Ht){var ur=Aa(Ht);return ur.invert=Aa(-Ht),ur}function sa(Ht,ur){var qr=l(Ht),Or=_(Ht),ua=l(ur),Fa=_(ur);function ja(sn,gn){var kn=l(gn),Ja=l(sn)*kn,_n=_(sn)*kn,on=_(gn),Wa=on*qr+Ja*Or;return[T(_n*ua-Wa*Fa,Ja*qr-on*Or),m(Wa*ua+_n*Fa)]}return ja.invert=function(sn,gn){var kn=l(gn),Ja=l(sn)*kn,_n=_(sn)*kn,on=_(gn),Wa=on*ua-_n*Fa;return[T(_n*ua+on*Fa,Ja*qr+Wa*Or),m(Wa*qr-Ja*Or)]},ja}function Oa(Ht){Ht=ga(Ht[0]*f,Ht[1]*f,Ht.length>2?Ht[2]*f:0);function ur(qr){return qr=Ht(qr[0]*f,qr[1]*f),qr[0]*=c,qr[1]*=c,qr}return ur.invert=function(qr){return qr=Ht.invert(qr[0]*f,qr[1]*f),qr[0]*=c,qr[1]*=c,qr},ur}function dt(Ht,ur,qr,Or,ua,Fa){if(qr){var ja=l(ur),sn=_(ur),gn=Or*qr;ua==null?(ua=ur+Or*s,Fa=ur-gn/2):(ua=vt(ja,ua),Fa=vt(ja,Fa),(Or>0?uaFa)&&(ua+=Or*s));for(var kn,Ja=ua;Or>0?Ja>Fa:Ja1&&Ht.push(Ht.pop().concat(Ht.shift()))},result:function(){var qr=Ht;return Ht=[],ur=null,qr}}}function _r(Ht,ur){return v(Ht[0]-ur[0])=0;--sn)ua.point((_n=Ja[sn])[0],_n[1]);else Or(on.x,on.p.x,-1,ua);on=on.p}on=on.o,Ja=on.z,Wa=!Wa}while(!on.v);ua.lineEnd()}}}function zr(Ht){if(ur=Ht.length){for(var ur,qr=0,Or=Ht[0],ua;++qr=0?1:-1,os=Ls*$o,As=os>a,jo=zi*Ki;if(Pr.add(T(jo*Ls*_(os),ki*ko+jo*l(os))),ja+=As?$o+Ls*s:$o,As^Wa>=qr^Bn>=qr){var il=we(ie(on),ie(Ni));Ce(il);var Qs=we(Fa,il);Ce(Qs);var Ss=(As^$o>=0?-1:1)*m(Qs[2]);(Or>Ss||Or===Ss&&(il[0]||il[1]))&&(sn+=As^$o>=0?1:-1)}}return(ja<-r||ja0){for(gn||(ua.polygonStart(),gn=!0),ua.lineStart(),ko=0;ko1&&An&2&&Ki.push(Ki.pop().concat(Ki.shift())),Ja.push(Ki.filter(wt))}}return on}}function wt(Ht){return Ht.length>1}function Qt(Ht,ur){return((Ht=Ht.x)[0]<0?Ht[1]-i-r:i-Ht[1])-((ur=ur.x)[0]<0?ur[1]-i-r:i-ur[1])}var mr=Jr(function(){return!0},$r,Sa,[-a,-i]);function $r(Ht){var ur=NaN,qr=NaN,Or=NaN,ua;return{lineStart:function(){Ht.lineStart(),ua=1},point:function(Fa,ja){var sn=Fa>0?a:-a,gn=v(Fa-ur);v(gn-a)0?i:-i),Ht.point(Or,qr),Ht.lineEnd(),Ht.lineStart(),Ht.point(sn,qr),Ht.point(Fa,qr),ua=0):Or!==sn&&gn>=a&&(v(ur-Or)r?h((_(ur)*(Fa=l(Or))*_(qr)-_(Or)*(ua=l(ur))*_(Ht))/(ua*Fa*ja)):(ur+Or)/2}function Sa(Ht,ur,qr,Or){var ua;if(Ht==null)ua=qr*i,Or.point(-a,ua),Or.point(0,ua),Or.point(a,ua),Or.point(a,0),Or.point(a,-ua),Or.point(0,-ua),Or.point(-a,-ua),Or.point(-a,0),Or.point(-a,ua);else if(v(Ht[0]-ur[0])>r){var Fa=Ht[0]0,ua=v(ur)>r;function Fa(Ja,_n,on,Wa){dt(Wa,Ht,qr,on,Ja,_n)}function ja(Ja,_n){return l(Ja)*l(_n)>ur}function sn(Ja){var _n,on,Wa,On,zi;return{lineStart:function(){On=Wa=!1,zi=1},point:function(ki,ji){var Ni=[ki,ji],Bn,An=ja(ki,ji),Ki=Or?An?0:kn(ki,ji):An?kn(ki+(ki<0?a:-a),ji):0;if(!_n&&(On=Wa=An)&&Ja.lineStart(),An!==Wa&&(Bn=gn(_n,Ni),(!Bn||_r(_n,Bn)||_r(Ni,Bn))&&(Ni[2]=1)),An!==Wa)zi=0,An?(Ja.lineStart(),Bn=gn(Ni,_n),Ja.point(Bn[0],Bn[1])):(Bn=gn(_n,Ni),Ja.point(Bn[0],Bn[1],2),Ja.lineEnd()),_n=Bn;else if(ua&&_n&&Or^An){var ko;!(Ki&on)&&(ko=gn(Ni,_n,!0))&&(zi=0,Or?(Ja.lineStart(),Ja.point(ko[0][0],ko[0][1]),Ja.point(ko[1][0],ko[1][1]),Ja.lineEnd()):(Ja.point(ko[1][0],ko[1][1]),Ja.lineEnd(),Ja.lineStart(),Ja.point(ko[0][0],ko[0][1],3)))}An&&(!_n||!_r(_n,Ni))&&Ja.point(Ni[0],Ni[1]),_n=Ni,Wa=An,on=Ki},lineEnd:function(){Wa&&Ja.lineEnd(),_n=null},clean:function(){return zi|(On&&Wa)<<1}}}function gn(Ja,_n,on){var Wa=ie(Ja),On=ie(_n),zi=[1,0,0],ki=we(Wa,On),ji=fe(ki,ki),Ni=ki[0],Bn=ji-Ni*Ni;if(!Bn)return!on&&Ja;var An=ur*ji/Bn,Ki=-ur*Ni/Bn,ko=we(zi,ki),$o=Fe(zi,An),Ls=Fe(ki,Ki);Ae($o,Ls);var os=ko,As=fe($o,os),jo=fe(os,os),il=As*As-jo*(fe($o,$o)-1);if(!(il<0)){var Qs=p(il),Ss=Fe(os,(-As-Qs)/jo);if(Ae(Ss,$o),Ss=ae(Ss),!on)return Ss;var fi=Ja[0],ao=_n[0],gs=Ja[1],Jo=_n[1],Bl;ao0^Ss[1]<(v(Ss[0]-fi)a^(fi<=Ss[0]&&Ss[0]<=ao)){var ql=Fe(os,(-As+Qs)/jo);return Ae(ql,$o),[Ss,ae(ql)]}}}function kn(Ja,_n){var on=Or?Ht:a-Ht,Wa=0;return Ja<-on?Wa|=1:Ja>on&&(Wa|=2),_n<-on?Wa|=4:_n>on&&(Wa|=8),Wa}return Jr(ja,sn,Fa,Or?[0,-Ht]:[-a,Ht-a])}function ra(Ht,ur,qr,Or,ua,Fa){var ja=Ht[0],sn=Ht[1],gn=ur[0],kn=ur[1],Ja=0,_n=1,on=gn-ja,Wa=kn-sn,On;if(On=qr-ja,!(!on&&On>0)){if(On/=on,on<0){if(On0){if(On>_n)return;On>Ja&&(Ja=On)}if(On=ua-ja,!(!on&&On<0)){if(On/=on,on<0){if(On>_n)return;On>Ja&&(Ja=On)}else if(on>0){if(On0)){if(On/=Wa,Wa<0){if(On0){if(On>_n)return;On>Ja&&(Ja=On)}if(On=Fa-sn,!(!Wa&&On<0)){if(On/=Wa,Wa<0){if(On>_n)return;On>Ja&&(Ja=On)}else if(Wa>0){if(On0&&(Ht[0]=ja+Ja*on,Ht[1]=sn+Ja*Wa),_n<1&&(ur[0]=ja+_n*on,ur[1]=sn+_n*Wa),!0}}}}}var pa=1e9,pn=-pa;function Ga(Ht,ur,qr,Or){function ua(kn,Ja){return Ht<=kn&&kn<=qr&&ur<=Ja&&Ja<=Or}function Fa(kn,Ja,_n,on){var Wa=0,On=0;if(kn==null||(Wa=ja(kn,_n))!==(On=ja(Ja,_n))||gn(kn,Ja)<0^_n>0)do on.point(Wa===0||Wa===3?Ht:qr,Wa>1?Or:ur);while((Wa=(Wa+_n+4)%4)!==On);else on.point(Ja[0],Ja[1])}function ja(kn,Ja){return v(kn[0]-Ht)0?0:3:v(kn[0]-qr)0?2:1:v(kn[1]-ur)0?1:0:Ja>0?3:2}function sn(kn,Ja){return gn(kn.x,Ja.x)}function gn(kn,Ja){var _n=ja(kn,1),on=ja(Ja,1);return _n!==on?_n-on:_n===0?Ja[1]-kn[1]:_n===1?kn[0]-Ja[0]:_n===2?kn[1]-Ja[1]:Ja[0]-kn[0]}return function(kn){var Ja=kn,_n=Er(),on,Wa,On,zi,ki,ji,Ni,Bn,An,Ki,ko,$o={point:Ls,lineStart:il,lineEnd:Qs,polygonStart:As,polygonEnd:jo};function Ls(fi,ao){ua(fi,ao)&&Ja.point(fi,ao)}function os(){for(var fi=0,ao=0,gs=Wa.length;aoOr&&(Vu-cc)*(Or-ql)>(ol-ql)*(Ht-cc)&&++fi:ol<=Or&&(Vu-cc)*(Or-ql)<(ol-ql)*(Ht-cc)&&--fi;return fi}function As(){Ja=_n,on=[],Wa=[],ko=!0}function jo(){var fi=os(),ao=ko&&fi,gs=(on=x.merge(on)).length;(ao||gs)&&(kn.polygonStart(),ao&&(kn.lineStart(),Fa(null,null,1,kn),kn.lineEnd()),gs&&kr(on,sn,fi,Fa,kn),kn.polygonEnd()),Ja=kn,on=Wa=On=null}function il(){$o.point=Ss,Wa&&Wa.push(On=[]),Ki=!0,An=!1,Ni=Bn=NaN}function Qs(){on&&(Ss(zi,ki),ji&&An&&_n.rejoin(),on.push(_n.result())),$o.point=Ls,An&&Ja.lineEnd()}function Ss(fi,ao){var gs=ua(fi,ao);if(Wa&&On.push([fi,ao]),Ki)zi=fi,ki=ao,ji=gs,Ki=!1,gs&&(Ja.lineStart(),Ja.point(fi,ao));else if(gs&&An)Ja.point(fi,ao);else{var Jo=[Ni=Math.max(pn,Math.min(pa,Ni)),Bn=Math.max(pn,Math.min(pa,Bn))],Bl=[fi=Math.max(pn,Math.min(pa,fi)),ao=Math.max(pn,Math.min(pa,ao))];ra(Jo,Bl,Ht,ur,qr,Or)?(An||(Ja.lineStart(),Ja.point(Jo[0],Jo[1])),Ja.point(Bl[0],Bl[1]),gs||Ja.lineEnd(),ko=!1):gs&&(Ja.lineStart(),Ja.point(fi,ao),ko=!1)}Ni=fi,Bn=ao,An=gs}return $o}}function qn(){var Ht=0,ur=0,qr=960,Or=500,ua,Fa,ja;return ja={stream:function(sn){return ua&&Fa===sn?ua:ua=Ga(Ht,ur,qr,Or)(Fa=sn)},extent:function(sn){return arguments.length?(Ht=+sn[0][0],ur=+sn[0][1],qr=+sn[1][0],Or=+sn[1][1],ua=Fa=null,ja):[[Ht,ur],[qr,Or]]}}}var Vn=A(),di,yi,Ci,ci={sphere:P,point:P,lineStart:ei,lineEnd:P,polygonStart:P,polygonEnd:P};function ei(){ci.point=uo,ci.lineEnd=mi}function mi(){ci.point=ci.lineEnd=P}function uo(Ht,ur){Ht*=f,ur*=f,di=Ht,yi=_(ur),Ci=l(ur),ci.point=Lo}function Lo(Ht,ur){Ht*=f,ur*=f;var qr=_(ur),Or=l(ur),ua=v(Ht-di),Fa=l(ua),ja=_(ua),sn=Or*ja,gn=Ci*qr-yi*Or*Fa,kn=yi*qr+Ci*Or*Fa;Vn.add(T(p(sn*sn+gn*gn),kn)),di=Ht,yi=qr,Ci=Or}function Wo(Ht){return Vn.reset(),N(Ht,ci),+Vn}var li=[null,null],Ii={type:"LineString",coordinates:li};function xi(Ht,ur){return li[0]=Ht,li[1]=ur,Wo(Ii)}var Ao={Feature:function(Ht,ur){return Ro(Ht.geometry,ur)},FeatureCollection:function(Ht,ur){for(var qr=Ht.features,Or=-1,ua=qr.length;++Or0&&(ua=xi(Ht[Fa],Ht[Fa-1]),ua>0&&qr<=ua&&Or<=ua&&(qr+Or-ua)*(1-Math.pow((qr-Or)/ua,2))r}).map(on)).concat(x.range(y(Fa/kn)*kn,ua,kn).filter(function(Bn){return v(Bn%_n)>r}).map(Wa))}return ji.lines=function(){return Ni().map(function(Bn){return{type:"LineString",coordinates:Bn}})},ji.outline=function(){return{type:"Polygon",coordinates:[On(Or).concat(zi(ja).slice(1),On(qr).reverse().slice(1),zi(sn).reverse().slice(1))]}},ji.extent=function(Bn){return arguments.length?ji.extentMajor(Bn).extentMinor(Bn):ji.extentMinor()},ji.extentMajor=function(Bn){return arguments.length?(Or=+Bn[0][0],qr=+Bn[1][0],sn=+Bn[0][1],ja=+Bn[1][1],Or>qr&&(Bn=Or,Or=qr,qr=Bn),sn>ja&&(Bn=sn,sn=ja,ja=Bn),ji.precision(ki)):[[Or,sn],[qr,ja]]},ji.extentMinor=function(Bn){return arguments.length?(ur=+Bn[0][0],Ht=+Bn[1][0],Fa=+Bn[0][1],ua=+Bn[1][1],ur>Ht&&(Bn=ur,ur=Ht,Ht=Bn),Fa>ua&&(Bn=Fa,Fa=ua,ua=Bn),ji.precision(ki)):[[ur,Fa],[Ht,ua]]},ji.step=function(Bn){return arguments.length?ji.stepMajor(Bn).stepMinor(Bn):ji.stepMinor()},ji.stepMajor=function(Bn){return arguments.length?(Ja=+Bn[0],_n=+Bn[1],ji):[Ja,_n]},ji.stepMinor=function(Bn){return arguments.length?(gn=+Bn[0],kn=+Bn[1],ji):[gn,kn]},ji.precision=function(Bn){return arguments.length?(ki=+Bn,on=Qa(Fa,ua,90),Wa=Jn(ur,Ht,ki),On=Qa(sn,ja,90),zi=Jn(Or,qr,ki),ji):ki},ji.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function ds(){return Os()()}function Ui(Ht,ur){var qr=Ht[0]*f,Or=Ht[1]*f,ua=ur[0]*f,Fa=ur[1]*f,ja=l(Or),sn=_(Or),gn=l(Fa),kn=_(Fa),Ja=ja*l(qr),_n=ja*_(qr),on=gn*l(ua),Wa=gn*_(ua),On=2*m(p(R(Fa-Or)+ja*gn*R(ua-qr))),zi=_(On),ki=On?function(ji){var Ni=_(ji*=On)/zi,Bn=_(On-ji)/zi,An=Bn*Ja+Ni*on,Ki=Bn*_n+Ni*Wa,ko=Bn*sn+Ni*kn;return[T(Ki,An)*c,T(ko,p(An*An+Ki*Ki))*c]}:function(){return[qr*c,Or*c]};return ki.distance=On,ki}function ms(Ht){return Ht}var Mo=A(),ws=A(),Ks,Rn,fo,Pi,zo={point:P,lineStart:P,lineEnd:P,polygonStart:function(){zo.lineStart=wo,zo.lineEnd=$l},polygonEnd:function(){zo.lineStart=zo.lineEnd=zo.point=P,Mo.add(v(ws)),ws.reset()},result:function(){var Ht=Mo/2;return Mo.reset(),Ht}};function wo(){zo.point=bi}function bi(Ht,ur){zo.point=wl,Ks=fo=Ht,Rn=Pi=ur}function wl(Ht,ur){ws.add(Pi*Ht-fo*ur),fo=Ht,Pi=ur}function $l(){wl(Ks,Rn)}var Js=1/0,Ql=Js,Ws=-Js,Is=Ws,Dl={point:Xu,lineStart:P,lineEnd:P,polygonStart:P,polygonEnd:P,result:function(){var Ht=[[Js,Ql],[Ws,Is]];return Ws=Is=-(Ql=Js=1/0),Ht}};function Xu(Ht,ur){HtWs&&(Ws=Ht),urIs&&(Is=ur)}var Lu=0,Bu=0,kf=0,gf=0,ns=0,_u=0,Nc=0,ml=0,fl=0,_l,Yu,Ts,Tl,Ko={point:Cs,lineStart:Nu,lineEnd:Bs,polygonStart:function(){Ko.lineStart=Gf,Ko.lineEnd=Eo},polygonEnd:function(){Ko.point=Cs,Ko.lineStart=Nu,Ko.lineEnd=Bs},result:function(){var Ht=fl?[Nc/fl,ml/fl]:_u?[gf/_u,ns/_u]:kf?[Lu/kf,Bu/kf]:[NaN,NaN];return Lu=Bu=kf=gf=ns=_u=Nc=ml=fl=0,Ht}};function Cs(Ht,ur){Lu+=Ht,Bu+=ur,++kf}function Nu(){Ko.point=Ul}function Ul(Ht,ur){Ko.point=Ku,Cs(Ts=Ht,Tl=ur)}function Ku(Ht,ur){var qr=Ht-Ts,Or=ur-Tl,ua=p(qr*qr+Or*Or);gf+=ua*(Ts+Ht)/2,ns+=ua*(Tl+ur)/2,_u+=ua,Cs(Ts=Ht,Tl=ur)}function Bs(){Ko.point=Cs}function Gf(){Ko.point=Wf}function Eo(){is(_l,Yu)}function Wf(Ht,ur){Ko.point=is,Cs(_l=Ts=Ht,Yu=Tl=ur)}function is(Ht,ur){var qr=Ht-Ts,Or=ur-Tl,ua=p(qr*qr+Or*Or);gf+=ua*(Ts+Ht)/2,ns+=ua*(Tl+ur)/2,_u+=ua,ua=Tl*Ht-Ts*ur,Nc+=ua*(Ts+Ht),ml+=ua*(Tl+ur),fl+=ua*3,Cs(Ts=Ht,Tl=ur)}function oo(Ht){this._context=Ht}oo.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,ur){switch(this._point){case 0:{this._context.moveTo(Ht,ur),this._point=1;break}case 1:{this._context.lineTo(Ht,ur);break}default:{this._context.moveTo(Ht+this._radius,ur),this._context.arc(Ht,ur,this._radius,0,s);break}}},result:P};var pc=A(),xu,zl,Kc,Ju,gc,hl={point:P,lineStart:function(){hl.point=yf},lineEnd:function(){xu&&Jc(zl,Kc),hl.point=P},polygonStart:function(){xu=!0},polygonEnd:function(){xu=null},result:function(){var Ht=+pc;return pc.reset(),Ht}};function yf(Ht,ur){hl.point=Jc,zl=Ju=Ht,Kc=gc=ur}function Jc(Ht,ur){Ju-=Ht,gc-=ur,pc.add(p(Ju*Ju+gc*gc)),Ju=Ht,gc=ur}function Uc(){this._string=[]}Uc.prototype={_radius:4.5,_circle:$u(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,ur){switch(this._point){case 0:{this._string.push("M",Ht,",",ur),this._point=1;break}case 1:{this._string.push("L",Ht,",",ur);break}default:{this._circle==null&&(this._circle=$u(this._radius)),this._string.push("M",Ht,",",ur,this._circle);break}}},result:function(){if(this._string.length){var Ht=this._string.join("");return this._string=[],Ht}else return null}};function $u(Ht){return"m0,"+Ht+"a"+Ht+","+Ht+" 0 1,1 0,"+-2*Ht+"a"+Ht+","+Ht+" 0 1,1 0,"+2*Ht+"z"}function jc(Ht,ur){var qr=4.5,Or,ua;function Fa(ja){return ja&&(typeof qr=="function"&&ua.pointRadius(+qr.apply(this,arguments)),N(ja,Or(ua))),ua.result()}return Fa.area=function(ja){return N(ja,Or(zo)),zo.result()},Fa.measure=function(ja){return N(ja,Or(hl)),hl.result()},Fa.bounds=function(ja){return N(ja,Or(Dl)),Dl.result()},Fa.centroid=function(ja){return N(ja,Or(Ko)),Ko.result()},Fa.projection=function(ja){return arguments.length?(Or=ja==null?(Ht=null,ms):(Ht=ja).stream,Fa):Ht},Fa.context=function(ja){return arguments.length?(ua=ja==null?(ur=null,new Uc):new oo(ur=ja),typeof qr!="function"&&ua.pointRadius(qr),Fa):ur},Fa.pointRadius=function(ja){return arguments.length?(qr=typeof ja=="function"?ja:(ua.pointRadius(+ja),+ja),Fa):qr},Fa.projection(Ht).context(ur)}function $c(Ht){return{stream:bu(Ht)}}function bu(Ht){return function(ur){var qr=new Qc;for(var Or in Ht)qr[Or]=Ht[Or];return qr.stream=ur,qr}}function Qc(){}Qc.prototype={constructor:Qc,point:function(Ht,ur){this.stream.point(Ht,ur)},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 sc(Ht,ur,qr){var Or=Ht.clipExtent&&Ht.clipExtent();return Ht.scale(150).translate([0,0]),Or!=null&&Ht.clipExtent(null),N(qr,Ht.stream(Dl)),ur(Dl.result()),Or!=null&&Ht.clipExtent(Or),Ht}function wu(Ht,ur,qr){return sc(Ht,function(Or){var ua=ur[1][0]-ur[0][0],Fa=ur[1][1]-ur[0][1],ja=Math.min(ua/(Or[1][0]-Or[0][0]),Fa/(Or[1][1]-Or[0][1])),sn=+ur[0][0]+(ua-ja*(Or[1][0]+Or[0][0]))/2,gn=+ur[0][1]+(Fa-ja*(Or[1][1]+Or[0][1]))/2;Ht.scale(150*ja).translate([sn,gn])},qr)}function eu(Ht,ur,qr){return wu(Ht,[[0,0],ur],qr)}function Sc(Ht,ur,qr){return sc(Ht,function(Or){var ua=+ur,Fa=ua/(Or[1][0]-Or[0][0]),ja=(ua-Fa*(Or[1][0]+Or[0][0]))/2,sn=-Fa*Or[0][1];Ht.scale(150*Fa).translate([ja,sn])},qr)}function ef(Ht,ur,qr){return sc(Ht,function(Or){var ua=+ur,Fa=ua/(Or[1][1]-Or[0][1]),ja=-Fa*Or[0][0],sn=(ua-Fa*(Or[1][1]+Or[0][1]))/2;Ht.scale(150*Fa).translate([ja,sn])},qr)}var ps=16,Vc=l(30*f);function Zf(Ht,ur){return+ur?Mc(Ht,ur):mf(Ht)}function mf(Ht){return bu({point:function(ur,qr){ur=Ht(ur,qr),this.stream.point(ur[0],ur[1])}})}function Mc(Ht,ur){function qr(Or,ua,Fa,ja,sn,gn,kn,Ja,_n,on,Wa,On,zi,ki){var ji=kn-Or,Ni=Ja-ua,Bn=ji*ji+Ni*Ni;if(Bn>4*ur&&zi--){var An=ja+on,Ki=sn+Wa,ko=gn+On,$o=p(An*An+Ki*Ki+ko*ko),Ls=m(ko/=$o),os=v(v(ko)-1)ur||v((ji*Qs+Ni*Ss)/Bn-.5)>.3||ja*on+sn*Wa+gn*On2?fi[2]%360*f:0,Qs()):[sn*c,gn*c,kn*c]},jo.angle=function(fi){return arguments.length?(_n=fi%360*f,Qs()):_n*c},jo.reflectX=function(fi){return arguments.length?(on=fi?-1:1,Qs()):on<0},jo.reflectY=function(fi){return arguments.length?(Wa=fi?-1:1,Qs()):Wa<0},jo.precision=function(fi){return arguments.length?(ko=Zf($o,Ki=fi*fi),Ss()):p(Ki)},jo.fitExtent=function(fi,ao){return wu(jo,fi,ao)},jo.fitSize=function(fi,ao){return eu(jo,fi,ao)},jo.fitWidth=function(fi,ao){return Sc(jo,fi,ao)},jo.fitHeight=function(fi,ao){return ef(jo,fi,ao)};function Qs(){var fi=Fl(qr,0,0,on,Wa,_n).apply(null,ur(Fa,ja)),ao=(_n?Fl:xf)(qr,Or-fi[0],ua-fi[1],on,Wa,_n);return Ja=ga(sn,gn,kn),$o=na(ur,ao),Ls=na(Ja,$o),ko=Zf($o,Ki),Ss()}function Ss(){return os=As=null,jo}return function(){return ur=Ht.apply(this,arguments),jo.invert=ur.invert&&il,Qs()}}function $s(Ht){var ur=0,qr=a/3,Or=Uu(Ht),ua=Or(ur,qr);return ua.parallels=function(Fa){return arguments.length?Or(ur=Fa[0]*f,qr=Fa[1]*f):[ur*c,qr*c]},ua}function Qu(Ht){var ur=l(Ht);function qr(Or,ua){return[Or*ur,_(ua)/ur]}return qr.invert=function(Or,ua){return[Or/ur,m(ua*ur)]},qr}function Tu(Ht,ur){var qr=_(Ht),Or=(qr+_(ur))/2;if(v(Or)=.12&&ki<.234&&zi>=-.425&&zi<-.214?ua:ki>=.166&&ki<.234&&zi>=-.214&&zi<-.115?ja:qr).invert(on)},Ja.stream=function(on){return Ht&&ur===on?Ht:Ht=yc([qr.stream(ur=on),ua.stream(on),ja.stream(on)])},Ja.precision=function(on){return arguments.length?(qr.precision(on),ua.precision(on),ja.precision(on),_n()):qr.precision()},Ja.scale=function(on){return arguments.length?(qr.scale(on),ua.scale(on*.35),ja.scale(on),Ja.translate(qr.translate())):qr.scale()},Ja.translate=function(on){if(!arguments.length)return qr.translate();var Wa=qr.scale(),On=+on[0],zi=+on[1];return Or=qr.translate(on).clipExtent([[On-.455*Wa,zi-.238*Wa],[On+.455*Wa,zi+.238*Wa]]).stream(kn),Fa=ua.translate([On-.307*Wa,zi+.201*Wa]).clipExtent([[On-.425*Wa+r,zi+.12*Wa+r],[On-.214*Wa-r,zi+.234*Wa-r]]).stream(kn),sn=ja.translate([On-.205*Wa,zi+.212*Wa]).clipExtent([[On-.214*Wa+r,zi+.166*Wa+r],[On-.115*Wa-r,zi+.234*Wa-r]]).stream(kn),_n()},Ja.fitExtent=function(on,Wa){return wu(Ja,on,Wa)},Ja.fitSize=function(on,Wa){return eu(Ja,on,Wa)},Ja.fitWidth=function(on,Wa){return Sc(Ja,on,Wa)},Ja.fitHeight=function(on,Wa){return ef(Ja,on,Wa)};function _n(){return Ht=ur=null,Ja}return Ja.scale(1070)}function ec(Ht){return function(ur,qr){var Or=l(ur),ua=l(qr),Fa=Ht(Or*ua);return[Fa*ua*_(ur),Fa*_(qr)]}}function Ec(Ht){return function(ur,qr){var Or=p(ur*ur+qr*qr),ua=Ht(Or),Fa=_(ua),ja=l(ua);return[T(ur*Fa,Or*ja),m(Or&&qr*Fa/Or)]}}var Cf=ec(function(Ht){return p(2/(1+Ht))});Cf.invert=Ec(function(Ht){return 2*m(Ht/2)});function nh(){return ru(Cf).scale(124.75).clipAngle(180-.001)}var lc=ec(function(Ht){return(Ht=g(Ht))&&Ht/_(Ht)});lc.invert=Ec(function(Ht){return Ht});function kc(){return ru(lc).scale(79.4188).clipAngle(180-.001)}function nu(Ht,ur){return[Ht,S(u((i+ur)/2))]}nu.invert=function(Ht,ur){return[Ht,2*h(b(ur))-i]};function tf(){return Cl(nu).scale(961/s)}function Cl(Ht){var ur=ru(Ht),qr=ur.center,Or=ur.scale,ua=ur.translate,Fa=ur.clipExtent,ja=null,sn,gn,kn;ur.scale=function(_n){return arguments.length?(Or(_n),Ja()):Or()},ur.translate=function(_n){return arguments.length?(ua(_n),Ja()):ua()},ur.center=function(_n){return arguments.length?(qr(_n),Ja()):qr()},ur.clipExtent=function(_n){return arguments.length?(_n==null?ja=sn=gn=kn=null:(ja=+_n[0][0],sn=+_n[0][1],gn=+_n[1][0],kn=+_n[1][1]),Ja()):ja==null?null:[[ja,sn],[gn,kn]]};function Ja(){var _n=a*Or(),on=ur(Oa(ur.rotate()).invert([0,0]));return Fa(ja==null?[[on[0]-_n,on[1]-_n],[on[0]+_n,on[1]+_n]]:Ht===nu?[[Math.max(on[0]-_n,ja),sn],[Math.min(on[0]+_n,gn),kn]]:[[ja,Math.max(on[1]-_n,sn)],[gn,Math.min(on[1]+_n,kn)]])}return Ja()}function uc(Ht){return u((i+Ht)/2)}function rf(Ht,ur){var qr=l(Ht),Or=Ht===ur?_(Ht):S(qr/l(ur))/S(uc(ur)/uc(Ht)),ua=qr*M(uc(Ht),Or)/Or;if(!Or)return nu;function Fa(ja,sn){ua>0?sn<-i+r&&(sn=-i+r):sn>i-r&&(sn=i-r);var gn=ua/M(uc(sn),Or);return[gn*_(Or*ja),ua-gn*l(Or*ja)]}return Fa.invert=function(ja,sn){var gn=ua-sn,kn=w(Or)*p(ja*ja+gn*gn),Ja=T(ja,v(gn))*w(gn);return gn*Or<0&&(Ja-=a*w(ja)*w(gn)),[Ja/Or,2*h(M(ua/kn,1/Or))-i]},Fa}function mc(){return $s(rf).scale(109.5).parallels([30,30])}function Us(Ht,ur){return[Ht,ur]}Us.invert=Us;function vu(){return ru(Us).scale(152.63)}function du(Ht,ur){var qr=l(Ht),Or=Ht===ur?_(Ht):(qr-l(ur))/(ur-Ht),ua=qr/Or+Ht;if(v(Or)r&&--Or>0);return[Ht/(.8707+(Fa=qr*qr)*(-.131979+Fa*(-.013791+Fa*Fa*Fa*(.003971-.001529*Fa)))),qr]};function Au(){return ru(Ru).scale(175.295)}function Zs(Ht,ur){return[l(ur)*_(Ht),_(ur)]}Zs.invert=Ec(m);function Ol(){return ru(Zs).scale(249.5).clipAngle(90+r)}function bl(Ht,ur){var qr=l(ur),Or=1+l(Ht)*qr;return[qr*_(Ht)/Or,_(ur)/Or]}bl.invert=Ec(function(Ht){return 2*h(Ht)});function tc(){return ru(bl).scale(250).clipAngle(142)}function Su(Ht,ur){return[S(u((i+ur)/2)),-Ht]}Su.invert=function(Ht,ur){return[-ur,2*h(b(Ht))-i]};function Cc(){var Ht=Cl(Su),ur=Ht.center,qr=Ht.rotate;return Ht.center=function(Or){return arguments.length?ur([-Or[1],Or[0]]):(Or=ur(),[Or[1],-Or[0]])},Ht.rotate=function(Or){return arguments.length?qr([Or[0],Or[1],Or.length>2?Or[2]+90:90]):(Or=qr(),[Or[0],Or[1],Or[2]-90])},qr([0,0,90]).scale(159.155)}d.geoAlbers=Ns,d.geoAlbersUsa=Pu,d.geoArea=q,d.geoAzimuthalEqualArea=nh,d.geoAzimuthalEqualAreaRaw=Cf,d.geoAzimuthalEquidistant=kc,d.geoAzimuthalEquidistantRaw=lc,d.geoBounds=ze,d.geoCentroid=gr,d.geoCircle=Lr,d.geoClipAntimeridian=mr,d.geoClipCircle=ya,d.geoClipExtent=qn,d.geoClipRectangle=Ga,d.geoConicConformal=mc,d.geoConicConformalRaw=rf,d.geoConicEqualArea=au,d.geoConicEqualAreaRaw=Tu,d.geoConicEquidistant=af,d.geoConicEquidistantRaw=du,d.geoContains=Co,d.geoDistance=xi,d.geoEqualEarth=Lf,d.geoEqualEarthRaw=bc,d.geoEquirectangular=vu,d.geoEquirectangularRaw=Us,d.geoGnomonic=nf,d.geoGnomonicRaw=xl,d.geoGraticule=Os,d.geoGraticule10=ds,d.geoIdentity=ou,d.geoInterpolate=Ui,d.geoLength=Wo,d.geoMercator=tf,d.geoMercatorRaw=nu,d.geoNaturalEarth1=Au,d.geoNaturalEarth1Raw=Ru,d.geoOrthographic=Ol,d.geoOrthographicRaw=Zs,d.geoPath=jc,d.geoProjection=ru,d.geoProjectionMutator=Uu,d.geoRotation=Oa,d.geoStereographic=tc,d.geoStereographicRaw=bl,d.geoStream=N,d.geoTransform=$c,d.geoTransverseMercator=Cc,d.geoTransverseMercatorRaw=Su,Object.defineProperty(d,"__esModule",{value:!0})})}}),_P=He({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y,H3(),Vy()):x(d.d3=d.d3||{},d.d3,d.d3)})(Y,function(d,x,A){var E=Math.abs,e=Math.atan,t=Math.atan2,r=Math.cos,o=Math.exp,a=Math.floor,i=Math.log,n=Math.max,s=Math.min,c=Math.pow,f=Math.round,v=Math.sign||function(je){return je>0?1:je<0?-1:0},h=Math.sin,T=Math.tan,l=1e-6,y=1e-12,b=Math.PI,S=b/2,M=b/4,_=Math.SQRT1_2,w=F(2),p=F(b),u=b*2,g=180/b,m=b/180;function R(je){return je?je/Math.sin(je):1}function P(je){return je>1?S:je<-1?-S:Math.asin(je)}function z(je){return je>1?0:je<-1?b:Math.acos(je)}function F(je){return je>0?Math.sqrt(je):0}function B(je){return je=o(2*je),(je-1)/(je+1)}function O(je){return(o(je)-o(-je))/2}function L(je){return(o(je)+o(-je))/2}function N(je){return i(je+F(je*je+1))}function U(je){return i(je+F(je*je-1))}function Z(je){var Ze=T(je/2),at=2*i(r(je/2))/(Ze*Ze);function lt(Tt,gt){var Et=r(Tt),Yt=r(gt),rr=h(gt),sr=Yt*Et,Sr=-((1-sr?i((1+sr)/2)/(1-sr):-.5)+at/(1+sr));return[Sr*Yt*h(Tt),Sr*rr]}return lt.invert=function(Tt,gt){var Et=F(Tt*Tt+gt*gt),Yt=-je/2,rr=50,sr;if(!Et)return[0,0];do{var Sr=Yt/2,Nr=r(Sr),Qr=h(Sr),ia=Qr/Nr,_a=-i(E(Nr));Yt-=sr=(2/ia*_a-at*ia-Et)/(-_a/(Qr*Qr)+1-at/(2*Nr*Nr))*(Nr<0?.7:1)}while(E(sr)>l&&--rr>0);var za=h(Yt);return[t(Tt*za,Et*r(Yt)),P(gt*za/Et)]},lt}function Q(){var je=S,Ze=x.geoProjectionMutator(Z),at=Ze(je);return at.radius=function(lt){return arguments.length?Ze(je=lt*m):je*g},at.scale(179.976).clipAngle(147)}function ue(je,Ze){var at=r(Ze),lt=R(z(at*r(je/=2)));return[2*at*h(je)*lt,h(Ze)*lt]}ue.invert=function(je,Ze){if(!(je*je+4*Ze*Ze>b*b+l)){var at=je,lt=Ze,Tt=25;do{var gt=h(at),Et=h(at/2),Yt=r(at/2),rr=h(lt),sr=r(lt),Sr=h(2*lt),Nr=rr*rr,Qr=sr*sr,ia=Et*Et,_a=1-Qr*Yt*Yt,za=_a?z(sr*Yt)*F(nn=1/_a):nn=0,nn,en=2*za*sr*Et-je,ln=za*rr-Ze,Nn=nn*(Qr*ia+za*sr*Yt*Nr),pi=nn*(.5*gt*Sr-za*2*rr*Et),ii=nn*.25*(Sr*Et-za*rr*Qr*gt),Gi=nn*(Nr*Yt+za*ia*sr),Bo=pi*ii-Gi*Nn;if(!Bo)break;var No=(ln*pi-en*Gi)/Bo,po=(en*ii-ln*Nn)/Bo;at-=No,lt-=po}while((E(No)>l||E(po)>l)&&--Tt>0);return[at,lt]}};function oe(){return x.geoProjection(ue).scale(152.63)}function le(je){var Ze=h(je),at=r(je),lt=je>=0?1:-1,Tt=T(lt*je),gt=(1+Ze-at)/2;function Et(Yt,rr){var sr=r(rr),Sr=r(Yt/=2);return[(1+sr)*h(Yt),(lt*rr>-t(Sr,Tt)-.001?0:-lt*10)+gt+h(rr)*at-(1+sr)*Ze*Sr]}return Et.invert=function(Yt,rr){var sr=0,Sr=0,Nr=50;do{var Qr=r(sr),ia=h(sr),_a=r(Sr),za=h(Sr),nn=1+_a,en=nn*ia-Yt,ln=gt+za*at-nn*Ze*Qr-rr,Nn=nn*Qr/2,pi=-ia*za,ii=Ze*nn*ia/2,Gi=at*_a+Ze*Qr*za,Bo=pi*ii-Gi*Nn,No=(ln*pi-en*Gi)/Bo/2,po=(en*ii-ln*Nn)/Bo;E(po)>2&&(po/=2),sr-=No,Sr-=po}while((E(No)>l||E(po)>l)&&--Nr>0);return lt*Sr>-t(r(sr),Tt)-.001?[sr*2,Sr]:null},Et}function j(){var je=20*m,Ze=je>=0?1:-1,at=T(Ze*je),lt=x.geoProjectionMutator(le),Tt=lt(je),gt=Tt.stream;return Tt.parallel=function(Et){return arguments.length?(at=T((Ze=(je=Et*m)>=0?1:-1)*je),lt(je)):je*g},Tt.stream=function(Et){var Yt=Tt.rotate(),rr=gt(Et),sr=(Tt.rotate([0,0]),gt(Et)),Sr=Tt.precision();return Tt.rotate(Yt),rr.sphere=function(){sr.polygonStart(),sr.lineStart();for(var Nr=Ze*-180;Ze*Nr<180;Nr+=Ze*90)sr.point(Nr,Ze*90);if(je)for(;Ze*(Nr-=3*Ze*Sr)>=-180;)sr.point(Nr,Ze*-t(r(Nr*m/2),at)*g);sr.lineEnd(),sr.polygonEnd()},rr},Tt.scale(218.695).center([0,28.0974])}function J(je,Ze){var at=T(Ze/2),lt=F(1-at*at),Tt=1+lt*r(je/=2),gt=h(je)*lt/Tt,Et=at/Tt,Yt=gt*gt,rr=Et*Et;return[4/3*gt*(3+Yt-3*rr),4/3*Et*(3+3*Yt-rr)]}J.invert=function(je,Ze){if(je*=3/8,Ze*=3/8,!je&&E(Ze)>1)return null;var at=je*je,lt=Ze*Ze,Tt=1+at+lt,gt=F((Tt-F(Tt*Tt-4*Ze*Ze))/2),Et=P(gt)/3,Yt=gt?U(E(Ze/gt))/3:N(E(je))/3,rr=r(Et),sr=L(Yt),Sr=sr*sr-rr*rr;return[v(je)*2*t(O(Yt)*rr,.25-Sr),v(Ze)*2*t(sr*h(Et),.25+Sr)]};function $(){return x.geoProjection(J).scale(66.1603)}var X=F(8),re=i(1+w);function ee(je,Ze){var at=E(Ze);return aty&&--lt>0);return[je/(r(at)*(X-1/h(at))),v(Ze)*at]};function q(){return x.geoProjection(ee).scale(112.314)}function ae(je){var Ze=2*b/je;function at(lt,Tt){var gt=x.geoAzimuthalEquidistantRaw(lt,Tt);if(E(lt)>S){var Et=t(gt[1],gt[0]),Yt=F(gt[0]*gt[0]+gt[1]*gt[1]),rr=Ze*f((Et-S)/Ze)+S,sr=t(h(Et-=rr),2-r(Et));Et=rr+P(b/Yt*h(sr))-sr,gt[0]=Yt*r(Et),gt[1]=Yt*h(Et)}return gt}return at.invert=function(lt,Tt){var gt=F(lt*lt+Tt*Tt);if(gt>S){var Et=t(Tt,lt),Yt=Ze*f((Et-S)/Ze)+S,rr=Et>Yt?-1:1,sr=gt*r(Yt-Et),Sr=1/T(rr*z((sr-b)/F(b*(b-2*sr)+gt*gt)));Et=Yt+2*e((Sr+rr*F(Sr*Sr-3))/3),lt=gt*r(Et),Tt=gt*h(Et)}return x.geoAzimuthalEquidistantRaw.invert(lt,Tt)},at}function ie(){var je=5,Ze=x.geoProjectionMutator(ae),at=Ze(je),lt=at.stream,Tt=.01,gt=-r(Tt*m),Et=h(Tt*m);return at.lobes=function(Yt){return arguments.length?Ze(je=+Yt):je},at.stream=function(Yt){var rr=at.rotate(),sr=lt(Yt),Sr=(at.rotate([0,0]),lt(Yt));return at.rotate(rr),sr.sphere=function(){Sr.polygonStart(),Sr.lineStart();for(var Nr=0,Qr=360/je,ia=2*b/je,_a=90-180/je,za=S;Nr0&&E(Tt)>l);return lt<0?NaN:at}function Ce(je,Ze,at){return Ze===void 0&&(Ze=40),at===void 0&&(at=y),function(lt,Tt,gt,Et){var Yt,rr,sr;gt=gt===void 0?0:+gt,Et=Et===void 0?0:+Et;for(var Sr=0;SrYt){gt-=rr/=2,Et-=sr/=2;continue}Yt=_a;var za=(gt>0?-1:1)*at,nn=(Et>0?-1:1)*at,en=je(gt+za,Et),ln=je(gt,Et+nn),Nn=(en[0]-Nr[0])/za,pi=(en[1]-Nr[1])/za,ii=(ln[0]-Nr[0])/nn,Gi=(ln[1]-Nr[1])/nn,Bo=Gi*Nn-pi*ii,No=(E(Bo)<.5?.5:1)/Bo;if(rr=(ia*ii-Qr*Gi)*No,sr=(Qr*pi-ia*Nn)*No,gt+=rr,Et+=sr,E(rr)0&&(Yt[1]*=1+rr/1.5*Yt[0]*Yt[0]),Yt}return lt.invert=Ce(lt),lt}function et(){return x.geoProjection(qe()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function Qe(je,Ze){var at=je*h(Ze),lt=30,Tt;do Ze-=Tt=(Ze+h(Ze)-at)/(1+r(Ze));while(E(Tt)>l&&--lt>0);return Ze/2}function Ke(je,Ze,at){function lt(Tt,gt){return[je*Tt*r(gt=Qe(at,gt)),Ze*h(gt)]}return lt.invert=function(Tt,gt){return gt=P(gt/Ze),[Tt/(je*r(gt)),P((2*gt+h(2*gt))/at)]},lt}var Xe=Ke(w/S,w,b);function Me(){return x.geoProjection(Xe).scale(169.529)}var xe=2.00276,ce=1.11072;function Re(je,Ze){var at=Qe(b,Ze);return[xe*je/(1/r(Ze)+ce/r(at)),(Ze+w*h(at))/xe]}Re.invert=function(je,Ze){var at=xe*Ze,lt=Ze<0?-M:M,Tt=25,gt,Et;do Et=at-w*h(lt),lt-=gt=(h(2*lt)+2*lt-b*h(Et))/(2*r(2*lt)+2+b*r(Et)*w*r(lt));while(E(gt)>l&&--Tt>0);return Et=at-w*h(lt),[je*(1/r(Et)+ce/r(lt))/xe,Et]};function $e(){return x.geoProjection(Re).scale(160.857)}function rt(je){var Ze=0,at=x.geoProjectionMutator(je),lt=at(Ze);return lt.parallel=function(Tt){return arguments.length?at(Ze=Tt*m):Ze*g},lt}function Je(je,Ze){return[je*r(Ze),Ze]}Je.invert=function(je,Ze){return[je/r(Ze),Ze]};function At(){return x.geoProjection(Je).scale(152.63)}function St(je){if(!je)return Je;var Ze=1/T(je);function at(lt,Tt){var gt=Ze+je-Tt,Et=gt&<*r(Tt)/gt;return[gt*h(Et),Ze-gt*r(Et)]}return at.invert=function(lt,Tt){var gt=F(lt*lt+(Tt=Ze-Tt)*Tt),Et=Ze+je-gt;return[gt/r(Et)*t(lt,Tt),Et]},at}function Rt(){return rt(St).scale(123.082).center([0,26.1441]).parallel(45)}function Ut(je){function Ze(at,lt){var Tt=S-lt,gt=Tt&&at*je*h(Tt)/Tt;return[Tt*h(gt)/je,S-Tt*r(gt)]}return Ze.invert=function(at,lt){var Tt=at*je,gt=S-lt,Et=F(Tt*Tt+gt*gt),Yt=t(Tt,gt);return[(Et?Et/h(Et):1)*Yt/je,S-Et]},Ze}function ir(){var je=.5,Ze=x.geoProjectionMutator(Ut),at=Ze(je);return at.fraction=function(lt){return arguments.length?Ze(je=+lt):je},at.scale(158.837)}var ar=Ke(1,4/b,b);function Mr(){return x.geoProjection(ar).scale(152.63)}function fr(je,Ze,at,lt,Tt,gt){var Et=r(gt),Yt;if(E(je)>1||E(gt)>1)Yt=z(at*Tt+Ze*lt*Et);else{var rr=h(je/2),sr=h(gt/2);Yt=2*P(F(rr*rr+Ze*lt*sr*sr))}return E(Yt)>l?[Yt,t(lt*h(gt),Ze*Tt-at*lt*Et)]:[0,0]}function dr(je,Ze,at){return z((je*je+Ze*Ze-at*at)/(2*je*Ze))}function pt(je){return je-2*b*a((je+b)/(2*b))}function ze(je,Ze,at){for(var lt=[[je[0],je[1],h(je[1]),r(je[1])],[Ze[0],Ze[1],h(Ze[1]),r(Ze[1])],[at[0],at[1],h(at[1]),r(at[1])]],Tt=lt[2],gt,Et=0;Et<3;++Et,Tt=gt)gt=lt[Et],Tt.v=fr(gt[1]-Tt[1],Tt[3],Tt[2],gt[3],gt[2],gt[0]-Tt[0]),Tt.point=[0,0];var Yt=dr(lt[0].v[0],lt[2].v[0],lt[1].v[0]),rr=dr(lt[0].v[0],lt[1].v[0],lt[2].v[0]),sr=b-Yt;lt[2].point[1]=0,lt[0].point[0]=-(lt[1].point[0]=lt[0].v[0]/2);var Sr=[lt[2].point[0]=lt[0].point[0]+lt[2].v[0]*r(Yt),2*(lt[0].point[1]=lt[1].point[1]=lt[2].v[0]*h(Yt))];function Nr(Qr,ia){var _a=h(ia),za=r(ia),nn=new Array(3),en;for(en=0;en<3;++en){var ln=lt[en];if(nn[en]=fr(ia-ln[1],ln[3],ln[2],za,_a,Qr-ln[0]),!nn[en][0])return ln.point;nn[en][1]=pt(nn[en][1]-ln.v[1])}var Nn=Sr.slice();for(en=0;en<3;++en){var pi=en==2?0:en+1,ii=dr(lt[en].v[0],nn[en][0],nn[pi][0]);nn[en][1]<0&&(ii=-ii),en?en==1?(ii=rr-ii,Nn[0]-=nn[en][0]*r(ii),Nn[1]-=nn[en][0]*h(ii)):(ii=sr-ii,Nn[0]+=nn[en][0]*r(ii),Nn[1]+=nn[en][0]*h(ii)):(Nn[0]+=nn[en][0]*r(ii),Nn[1]-=nn[en][0]*h(ii))}return Nn[0]/=3,Nn[1]/=3,Nn}return Nr}function Ge(je){return je[0]*=m,je[1]*=m,je}function Oe(){return ve([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function ve(je,Ze,at){var lt=x.geoCentroid({type:"MultiPoint",coordinates:[je,Ze,at]}),Tt=[-lt[0],-lt[1]],gt=x.geoRotation(Tt),Et=ze(Ge(gt(je)),Ge(gt(Ze)),Ge(gt(at)));Et.invert=Ce(Et);var Yt=x.geoProjection(Et).rotate(Tt),rr=Yt.center;return delete Yt.rotate,Yt.center=function(sr){return arguments.length?rr(gt(sr)):gt.invert(rr())},Yt.clipAngle(90)}function ge(je,Ze){var at=F(1-h(Ze));return[2/p*je*at,p*(1-at)]}ge.invert=function(je,Ze){var at=(at=Ze/p-1)*at;return[at>0?je*F(b/at)/2:0,P(1-at)]};function be(){return x.geoProjection(ge).scale(95.6464).center([0,30])}function Pe(je){var Ze=T(je);function at(lt,Tt){return[lt,(lt?lt/h(lt):1)*(h(Tt)*r(lt)-Ze*r(Tt))]}return at.invert=Ze?function(lt,Tt){lt&&(Tt*=h(lt)/lt);var gt=r(lt);return[lt,2*t(F(gt*gt+Ze*Ze-Tt*Tt)-gt,Ze-Tt)]}:function(lt,Tt){return[lt,P(lt?Tt*T(lt)/lt:Tt)]},at}function We(){return rt(Pe).scale(249.828).clipAngle(90)}var ct=F(3);function _t(je,Ze){return[ct*je*(2*r(2*Ze/3)-1)/p,ct*p*h(Ze/3)]}_t.invert=function(je,Ze){var at=3*P(Ze/(ct*p));return[p*je/(ct*(2*r(2*at/3)-1)),at]};function Mt(){return x.geoProjection(_t).scale(156.19)}function Nt(je){var Ze=r(je);function at(lt,Tt){return[lt*Ze,h(Tt)/Ze]}return at.invert=function(lt,Tt){return[lt/Ze,P(Tt*Ze)]},at}function Bt(){return rt(Nt).parallel(38.58).scale(195.044)}function qt(je){var Ze=r(je);function at(lt,Tt){return[lt*Ze,(1+Ze)*T(Tt/2)]}return at.invert=function(lt,Tt){return[lt/Ze,e(Tt/(1+Ze))*2]},at}function Zt(){return rt(qt).scale(124.75)}function lr(je,Ze){var at=F(8/(3*b));return[at*je*(1-E(Ze)/b),at*Ze]}lr.invert=function(je,Ze){var at=F(8/(3*b)),lt=Ze/at;return[je/(at*(1-E(lt)/b)),lt]};function ta(){return x.geoProjection(lr).scale(165.664)}function da(je,Ze){var at=F(4-3*h(E(Ze)));return[2/F(6*b)*je*at,v(Ze)*F(2*b/3)*(2-at)]}da.invert=function(je,Ze){var at=2-E(Ze)/F(2*b/3);return[je*F(6*b)/(2*at),v(Ze)*P((4-at*at)/3)]};function wa(){return x.geoProjection(da).scale(165.664)}function ma(je,Ze){var at=F(b*(4+b));return[2/at*je*(1+F(1-4*Ze*Ze/(b*b))),4/at*Ze]}ma.invert=function(je,Ze){var at=F(b*(4+b))/2;return[je*at/(1+F(1-Ze*Ze*(4+b)/(4*b))),Ze*at/2]};function Ia(){return x.geoProjection(ma).scale(180.739)}function va(je,Ze){var at=(2+S)*h(Ze);Ze/=2;for(var lt=0,Tt=1/0;lt<10&&E(Tt)>l;lt++){var gt=r(Ze);Ze-=Tt=(Ze+h(Ze)*(gt+2)-at)/(2*gt*(1+gt))}return[2/F(b*(4+b))*je*(1+r(Ze)),2*F(b/(4+b))*h(Ze)]}va.invert=function(je,Ze){var at=Ze*F((4+b)/b)/2,lt=P(at),Tt=r(lt);return[je/(2/F(b*(4+b))*(1+Tt)),P((lt+at*(Tt+2))/(2+S))]};function La(){return x.geoProjection(va).scale(180.739)}function Ka(je,Ze){return[je*(1+r(Ze))/F(2+b),2*Ze/F(2+b)]}Ka.invert=function(je,Ze){var at=F(2+b),lt=Ze*at/2;return[at*je/(1+r(lt)),lt]};function Vt(){return x.geoProjection(Ka).scale(173.044)}function Lt(je,Ze){for(var at=(1+S)*h(Ze),lt=0,Tt=1/0;lt<10&&E(Tt)>l;lt++)Ze-=Tt=(Ze+h(Ze)-at)/(1+r(Ze));return at=F(2+b),[je*(1+r(Ze))/at,2*Ze/at]}Lt.invert=function(je,Ze){var at=1+S,lt=F(at/2);return[je*2*lt/(1+r(Ze*=lt)),P((Ze+h(Ze))/at)]};function jt(){return x.geoProjection(Lt).scale(173.044)}var Ot=3+2*w;function gr(je,Ze){var at=h(je/=2),lt=r(je),Tt=F(r(Ze)),gt=r(Ze/=2),Et=h(Ze)/(gt+w*lt*Tt),Yt=F(2/(1+Et*Et)),rr=F((w*gt+(lt+at)*Tt)/(w*gt+(lt-at)*Tt));return[Ot*(Yt*(rr-1/rr)-2*i(rr)),Ot*(Yt*Et*(rr+1/rr)-2*e(Et))]}gr.invert=function(je,Ze){if(!(gt=J.invert(je/1.2,Ze*1.065)))return null;var at=gt[0],lt=gt[1],Tt=20,gt;je/=Ot,Ze/=Ot;do{var Et=at/2,Yt=lt/2,rr=h(Et),sr=r(Et),Sr=h(Yt),Nr=r(Yt),Qr=r(lt),ia=F(Qr),_a=Sr/(Nr+w*sr*ia),za=_a*_a,nn=F(2/(1+za)),en=w*Nr+(sr+rr)*ia,ln=w*Nr+(sr-rr)*ia,Nn=en/ln,pi=F(Nn),ii=pi-1/pi,Gi=pi+1/pi,Bo=nn*ii-2*i(pi)-je,No=nn*_a*Gi-2*e(_a)-Ze,po=Sr&&_*ia*rr*za/Sr,Zo=(w*sr*Nr+ia)/(2*(Nr+w*sr*ia)*(Nr+w*sr*ia)*ia),Hs=-.5*_a*nn*nn*nn,zs=Hs*po,xo=Hs*Zo,bo=(bo=2*Nr+w*ia*(sr-rr))*bo*pi,vl=(w*sr*Nr*ia+Qr)/bo,Al=-(w*rr*Sr)/(ia*bo),pu=ii*zs-2*vl/pi+nn*(vl+vl/Nn),pe=ii*xo-2*Al/pi+nn*(Al+Al/Nn),Le=_a*Gi*zs-2*po/(1+za)+nn*Gi*po+nn*_a*(vl-vl/Nn),Ye=_a*Gi*xo-2*Zo/(1+za)+nn*Gi*Zo+nn*_a*(Al-Al/Nn),ut=pe*Le-Ye*pu;if(!ut)break;var ht=(No*pe-Bo*Ye)/ut,xt=(Bo*Le-No*pu)/ut;at-=ht,lt=n(-S,s(S,lt-xt))}while((E(ht)>l||E(xt)>l)&&--Tt>0);return E(E(lt)-S)lt){var Nr=F(Sr),Qr=t(sr,rr),ia=at*f(Qr/at),_a=Qr-ia,za=je*r(_a),nn=(je*h(_a)-_a*h(za))/(S-za),en=_r(_a,nn),ln=(b-je)/yr(en,za,b);rr=Nr;var Nn=50,pi;do rr-=pi=(je+yr(en,za,rr)*ln-Nr)/(en(rr)*ln);while(E(pi)>l&&--Nn>0);sr=_a*h(rr),rrlt){var rr=F(Yt),sr=t(Et,gt),Sr=at*f(sr/at),Nr=sr-Sr;gt=rr*r(Nr),Et=rr*h(Nr);for(var Qr=gt-S,ia=h(gt),_a=Et/ia,za=gtl||E(_a)>l)&&--za>0);return[Nr,Qr]},rr}var Pr=zr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function Hr(){return x.geoProjection(Pr).scale(149.995)}var Zr=zr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Jr(){return x.geoProjection(Zr).scale(153.93)}var wt=zr(5/6*b,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Qt(){return x.geoProjection(wt).scale(130.945)}function mr(je,Ze){var at=je*je,lt=Ze*Ze;return[je*(1-.162388*lt)*(.87-952426e-9*at*at),Ze*(1+lt/12)]}mr.invert=function(je,Ze){var at=je,lt=Ze,Tt=50,gt;do{var Et=lt*lt;lt-=gt=(lt*(1+Et/12)-Ze)/(1+Et/4)}while(E(gt)>l&&--Tt>0);Tt=50,je/=1-.162388*Et;do{var Yt=(Yt=at*at)*Yt;at-=gt=(at*(.87-952426e-9*Yt)-je)/(.87-.00476213*Yt)}while(E(gt)>l&&--Tt>0);return[at,lt]};function $r(){return x.geoProjection(mr).scale(131.747)}var oa=zr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Sa(){return x.geoProjection(oa).scale(131.087)}function ya(je){var Ze=je(S,0)[0]-je(-S,0)[0];function at(lt,Tt){var gt=lt>0?-.5:.5,Et=je(lt+gt*b,Tt);return Et[0]-=gt*Ze,Et}return je.invert&&(at.invert=function(lt,Tt){var gt=lt>0?-.5:.5,Et=je.invert(lt+gt*Ze,Tt),Yt=Et[0]-gt*b;return Yt<-b?Yt+=2*b:Yt>b&&(Yt-=2*b),Et[0]=Yt,Et}),at}function ra(je,Ze){var at=v(je),lt=v(Ze),Tt=r(Ze),gt=r(je)*Tt,Et=h(je)*Tt,Yt=h(lt*Ze);je=E(t(Et,Yt)),Ze=P(gt),E(je-S)>l&&(je%=S);var rr=pa(je>b/4?S-je:je,Ze);return je>b/4&&(Yt=rr[0],rr[0]=-rr[1],rr[1]=-Yt),rr[0]*=at,rr[1]*=-lt,rr}ra.invert=function(je,Ze){E(je)>1&&(je=v(je)*2-je),E(Ze)>1&&(Ze=v(Ze)*2-Ze);var at=v(je),lt=v(Ze),Tt=-at*je,gt=-lt*Ze,Et=gt/Tt<1,Yt=pn(Et?gt:Tt,Et?Tt:gt),rr=Yt[0],sr=Yt[1],Sr=r(sr);return Et&&(rr=-S-rr),[at*(t(h(rr)*Sr,-h(sr))+b),lt*P(r(rr)*Sr)]};function pa(je,Ze){if(Ze===S)return[0,0];var at=h(Ze),lt=at*at,Tt=lt*lt,gt=1+Tt,Et=1+3*Tt,Yt=1-Tt,rr=P(1/F(gt)),sr=Yt+lt*gt*rr,Sr=(1-at)/sr,Nr=F(Sr),Qr=Sr*gt,ia=F(Qr),_a=Nr*Yt,za,nn;if(je===0)return[0,-(_a+lt*ia)];var en=r(Ze),ln=1/en,Nn=2*at*en,pi=(-3*lt+rr*Et)*Nn,ii=(-sr*en-(1-at)*pi)/(sr*sr),Gi=.5*ii/Nr,Bo=Yt*Gi-2*lt*Nr*Nn,No=lt*gt*ii+Sr*Et*Nn,po=-ln*Nn,Zo=-ln*No,Hs=-2*ln*Bo,zs=4*je/b,xo;if(je>.222*b||Ze.175*b){if(za=(_a+lt*F(Qr*(1+Tt)-_a*_a))/(1+Tt),je>b/4)return[za,za];var bo=za,vl=.5*za;za=.5*(vl+bo),nn=50;do{var Al=F(Qr-za*za),pu=za*(Hs+po*Al)+Zo*P(za/ia)-zs;if(!pu)break;pu<0?vl=za:bo=za,za=.5*(vl+bo)}while(E(bo-vl)>l&&--nn>0)}else{za=l,nn=25;do{var pe=za*za,Le=F(Qr-pe),Ye=Hs+po*Le,ut=za*Ye+Zo*P(za/ia)-zs,ht=Ye+(Zo-po*pe)/Le;za-=xo=Le?ut/ht:0}while(E(xo)>l&&--nn>0)}return[za,-_a-lt*F(Qr-za*za)]}function pn(je,Ze){for(var at=0,lt=1,Tt=.5,gt=50;;){var Et=Tt*Tt,Yt=F(Tt),rr=P(1/F(1+Et)),sr=1-Et+Tt*(1+Et)*rr,Sr=(1-Yt)/sr,Nr=F(Sr),Qr=Sr*(1+Et),ia=Nr*(1-Et),_a=Qr-je*je,za=F(_a),nn=Ze+ia+Tt*za;if(E(lt-at)0?at=Tt:lt=Tt,Tt=.5*(at+lt)}if(!gt)return null;var en=P(Yt),ln=r(en),Nn=1/ln,pi=2*Yt*ln,ii=(-3*Tt+rr*(1+3*Et))*pi,Gi=(-sr*ln-(1-Yt)*ii)/(sr*sr),Bo=.5*Gi/Nr,No=(1-Et)*Bo-2*Tt*Nr*pi,po=-2*Nn*No,Zo=-Nn*pi,Hs=-Nn*(Tt*(1+Et)*Gi+Sr*(1+3*Et)*pi);return[b/4*(je*(po+Zo*za)+Hs*P(je/F(Qr))),en]}function Ga(){return x.geoProjection(ya(ra)).scale(239.75)}function qn(je,Ze,at){var lt,Tt,gt;return je?(lt=Vn(je,at),Ze?(Tt=Vn(Ze,1-at),gt=Tt[1]*Tt[1]+at*lt[0]*lt[0]*Tt[0]*Tt[0],[[lt[0]*Tt[2]/gt,lt[1]*lt[2]*Tt[0]*Tt[1]/gt],[lt[1]*Tt[1]/gt,-lt[0]*lt[2]*Tt[0]*Tt[2]/gt],[lt[2]*Tt[1]*Tt[2]/gt,-at*lt[0]*lt[1]*Tt[0]/gt]]):[[lt[0],0],[lt[1],0],[lt[2],0]]):(Tt=Vn(Ze,1-at),[[0,Tt[0]/Tt[1]],[1/Tt[1],0],[Tt[2]/Tt[1],0]])}function Vn(je,Ze){var at,lt,Tt,gt,Et;if(Ze=1-l)return at=(1-Ze)/4,lt=L(je),gt=B(je),Tt=1/lt,Et=lt*O(je),[gt+at*(Et-je)/(lt*lt),Tt-at*gt*Tt*(Et-je),Tt+at*gt*Tt*(Et+je),2*e(o(je))-S+at*(Et-je)/lt];var Yt=[1,0,0,0,0,0,0,0,0],rr=[F(Ze),0,0,0,0,0,0,0,0],sr=0;for(lt=F(1-Ze),Et=1;E(rr[sr]/Yt[sr])>l&&sr<8;)at=Yt[sr++],rr[sr]=(at-lt)/2,Yt[sr]=(at+lt)/2,lt=F(at*lt),Et*=2;Tt=Et*Yt[sr]*je;do gt=rr[sr]*h(lt=Tt)/Yt[sr],Tt=(P(gt)+Tt)/2;while(--sr);return[h(Tt),gt=r(Tt),gt/r(Tt-lt),Tt]}function di(je,Ze,at){var lt=E(je),Tt=E(Ze),gt=O(Tt);if(lt){var Et=1/h(lt),Yt=1/(T(lt)*T(lt)),rr=-(Yt+at*(gt*gt*Et*Et)-1+at),sr=(at-1)*Yt,Sr=(-rr+F(rr*rr-4*sr))/2;return[yi(e(1/F(Sr)),at)*v(je),yi(e(F((Sr/Yt-1)/at)),1-at)*v(Ze)]}return[0,yi(e(gt),1-at)*v(Ze)]}function yi(je,Ze){if(!Ze)return je;if(Ze===1)return i(T(je/2+M));for(var at=1,lt=F(1-Ze),Tt=F(Ze),gt=0;E(Tt)>l;gt++){if(je%b){var Et=e(lt*T(je)/at);Et<0&&(Et+=b),je+=Et+~~(je/b)*b}else je+=je;Tt=(at+lt)/2,lt=F(at*lt),Tt=((at=Tt)-lt)/2}return je/(c(2,gt)*at)}function Ci(je,Ze){var at=(w-1)/(w+1),lt=F(1-at*at),Tt=yi(S,lt*lt),gt=-1,Et=i(T(b/4+E(Ze)/2)),Yt=o(gt*Et)/F(at),rr=ci(Yt*r(gt*je),Yt*h(gt*je)),sr=di(rr[0],rr[1],lt*lt);return[-sr[1],(Ze>=0?1:-1)*(.5*Tt-sr[0])]}function ci(je,Ze){var at=je*je,lt=Ze+1,Tt=1-at-Ze*Ze;return[.5*((je>=0?S:-S)-t(Tt,2*je)),-.25*i(Tt*Tt+4*at)+.5*i(lt*lt+at)]}function ei(je,Ze){var at=Ze[0]*Ze[0]+Ze[1]*Ze[1];return[(je[0]*Ze[0]+je[1]*Ze[1])/at,(je[1]*Ze[0]-je[0]*Ze[1])/at]}Ci.invert=function(je,Ze){var at=(w-1)/(w+1),lt=F(1-at*at),Tt=yi(S,lt*lt),gt=-1,Et=qn(.5*Tt-Ze,-je,lt*lt),Yt=ei(Et[0],Et[1]),rr=t(Yt[1],Yt[0])/gt;return[rr,2*e(o(.5/gt*i(at*Yt[0]*Yt[0]+at*Yt[1]*Yt[1])))-S]};function mi(){return x.geoProjection(ya(Ci)).scale(151.496)}function uo(je){var Ze=h(je),at=r(je),lt=Lo(je);lt.invert=Lo(-je);function Tt(gt,Et){var Yt=lt(gt,Et);gt=Yt[0],Et=Yt[1];var rr=h(Et),sr=r(Et),Sr=r(gt),Nr=z(Ze*rr+at*sr*Sr),Qr=h(Nr),ia=E(Qr)>l?Nr/Qr:1;return[ia*at*h(gt),(E(gt)>S?ia:-ia)*(Ze*sr-at*rr*Sr)]}return Tt.invert=function(gt,Et){var Yt=F(gt*gt+Et*Et),rr=-h(Yt),sr=r(Yt),Sr=Yt*sr,Nr=-Et*rr,Qr=Yt*Ze,ia=F(Sr*Sr+Nr*Nr-Qr*Qr),_a=t(Sr*Qr+Nr*ia,Nr*Qr-Sr*ia),za=(Yt>S?-1:1)*t(gt*rr,Yt*r(_a)*sr+Et*h(_a)*rr);return lt.invert(za,_a)},Tt}function Lo(je){var Ze=h(je),at=r(je);return function(lt,Tt){var gt=r(Tt),Et=r(lt)*gt,Yt=h(lt)*gt,rr=h(Tt);return[t(Yt,Et*at-rr*Ze),P(rr*at+Et*Ze)]}}function Wo(){var je=0,Ze=x.geoProjectionMutator(uo),at=Ze(je),lt=at.rotate,Tt=at.stream,gt=x.geoCircle();return at.parallel=function(Et){if(!arguments.length)return je*g;var Yt=at.rotate();return Ze(je=Et*m).rotate(Yt)},at.rotate=function(Et){return arguments.length?(lt.call(at,[Et[0],Et[1]-je*g]),gt.center([-Et[0],-Et[1]]),at):(Et=lt.call(at),Et[1]+=je*g,Et)},at.stream=function(Et){return Et=Tt(Et),Et.sphere=function(){Et.polygonStart();var Yt=.01,rr=gt.radius(90-Yt)().coordinates[0],sr=rr.length-1,Sr=-1,Nr;for(Et.lineStart();++Sr=0;)Et.point((Nr=rr[Sr])[0],Nr[1]);Et.lineEnd(),Et.polygonEnd()},Et},at.scale(79.4187).parallel(45).clipAngle(180-.001)}var li=3,Ii=P(1-1/li)*g,xi=Nt(0);function Ao(je){var Ze=Ii*m,at=ge(b,Ze)[0]-ge(-b,Ze)[0],lt=xi(0,Ze)[1],Tt=ge(0,Ze)[1],gt=p-Tt,Et=u/je,Yt=4/u,rr=lt+gt*gt*4/u;function sr(Sr,Nr){var Qr,ia=E(Nr);if(ia>Ze){var _a=s(je-1,n(0,a((Sr+b)/Et)));Sr+=b*(je-1)/je-_a*Et,Qr=ge(Sr,ia),Qr[0]=Qr[0]*u/at-u*(je-1)/(2*je)+_a*u/je,Qr[1]=lt+(Qr[1]-Tt)*4*gt/u,Nr<0&&(Qr[1]=-Qr[1])}else Qr=xi(Sr,Nr);return Qr[0]*=Yt,Qr[1]/=rr,Qr}return sr.invert=function(Sr,Nr){Sr/=Yt,Nr*=rr;var Qr=E(Nr);if(Qr>lt){var ia=s(je-1,n(0,a((Sr+b)/Et)));Sr=(Sr+b*(je-1)/je-ia*Et)*at/u;var _a=ge.invert(Sr,.25*(Qr-lt)*u/gt+Tt);return _a[0]-=b*(je-1)/je-ia*Et,Nr<0&&(_a[1]=-_a[1]),_a}return xi.invert(Sr,Nr)},sr}function So(je,Ze){return[je,Ze&1?90-l:Ii]}function Ro(je,Ze){return[je,Ze&1?-90+l:-Ii]}function Li(je){return[je[0]*(1-l),je[1]]}function Yi(je){var Ze=[].concat(A.range(-180,180+je/2,je).map(So),A.range(180,-180-je/2,-je).map(Ro));return{type:"Polygon",coordinates:[je===180?Ze.map(Li):Ze]}}function bs(){var je=4,Ze=x.geoProjectionMutator(Ao),at=Ze(je),lt=at.stream;return at.lobes=function(Tt){return arguments.length?Ze(je=+Tt):je},at.stream=function(Tt){var gt=at.rotate(),Et=lt(Tt),Yt=(at.rotate([0,0]),lt(Tt));return at.rotate(gt),Et.sphere=function(){x.geoStream(Yi(180/je),Yt)},Et},at.scale(239.75)}function as(je){var Ze=1+je,at=h(1/Ze),lt=P(at),Tt=2*F(b/(gt=b+4*lt*Ze)),gt,Et=.5*Tt*(Ze+F(je*(2+je))),Yt=je*je,rr=Ze*Ze;function sr(Sr,Nr){var Qr=1-h(Nr),ia,_a;if(Qr&&Qr<2){var za=S-Nr,nn=25,en;do{var ln=h(za),Nn=r(za),pi=lt+t(ln,Ze-Nn),ii=1+rr-2*Ze*Nn;za-=en=(za-Yt*lt-Ze*ln+ii*pi-.5*Qr*gt)/(2*Ze*ln*pi)}while(E(en)>y&&--nn>0);ia=Tt*F(ii),_a=Sr*pi/b}else ia=Tt*(je+Qr),_a=Sr*lt/b;return[ia*h(_a),Et-ia*r(_a)]}return sr.invert=function(Sr,Nr){var Qr=Sr*Sr+(Nr-=Et)*Nr,ia=(1+rr-Qr/(Tt*Tt))/(2*Ze),_a=z(ia),za=h(_a),nn=lt+t(za,Ze-ia);return[P(Sr/F(Qr))*b/nn,P(1-2*(_a-Yt*lt-Ze*za+(1+rr-2*Ze*ia)*nn)/gt)]},sr}function fs(){var je=1,Ze=x.geoProjectionMutator(as),at=Ze(je);return at.ratio=function(lt){return arguments.length?Ze(je=+lt):je},at.scale(167.774).center([0,18.67])}var Co=.7109889596207567,Qa=.0528035274542;function Jn(je,Ze){return Ze>-Co?(je=Xe(je,Ze),je[1]+=Qa,je):Je(je,Ze)}Jn.invert=function(je,Ze){return Ze>-Co?Xe.invert(je,Ze-Qa):Je.invert(je,Ze)};function Os(){return x.geoProjection(Jn).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function ds(je,Ze){return E(Ze)>Co?(je=Xe(je,Ze),je[1]-=Ze>0?Qa:-Qa,je):Je(je,Ze)}ds.invert=function(je,Ze){return E(Ze)>Co?Xe.invert(je,Ze+(Ze>0?Qa:-Qa)):Je.invert(je,Ze)};function Ui(){return x.geoProjection(ds).scale(152.63)}function ms(je,Ze,at,lt){var Tt=F(4*b/(2*at+(1+je-Ze/2)*h(2*at)+(je+Ze)/2*h(4*at)+Ze/2*h(6*at))),gt=F(lt*h(at)*F((1+je*r(2*at)+Ze*r(4*at))/(1+je+Ze))),Et=at*rr(1);function Yt(Nr){return F(1+je*r(2*Nr)+Ze*r(4*Nr))}function rr(Nr){var Qr=Nr*at;return(2*Qr+(1+je-Ze/2)*h(2*Qr)+(je+Ze)/2*h(4*Qr)+Ze/2*h(6*Qr))/at}function sr(Nr){return Yt(Nr)*h(Nr)}var Sr=function(Nr,Qr){var ia=at*Fe(rr,Et*h(Qr)/at,Qr/b);isNaN(ia)&&(ia=at*v(Qr));var _a=Tt*Yt(ia);return[_a*gt*Nr/b*r(ia),_a/gt*h(ia)]};return Sr.invert=function(Nr,Qr){var ia=Fe(sr,Qr*gt/Tt);return[Nr*b/(r(ia)*Tt*gt*Yt(ia)),P(at*rr(ia/at)/Et)]},at===0&&(Tt=F(lt/b),Sr=function(Nr,Qr){return[Nr*Tt,h(Qr)/Tt]},Sr.invert=function(Nr,Qr){return[Nr/Tt,P(Qr*Tt)]}),Sr}function Mo(){var je=1,Ze=0,at=45*m,lt=2,Tt=x.geoProjectionMutator(ms),gt=Tt(je,Ze,at,lt);return gt.a=function(Et){return arguments.length?Tt(je=+Et,Ze,at,lt):je},gt.b=function(Et){return arguments.length?Tt(je,Ze=+Et,at,lt):Ze},gt.psiMax=function(Et){return arguments.length?Tt(je,Ze,at=+Et*m,lt):at*g},gt.ratio=function(Et){return arguments.length?Tt(je,Ze,at,lt=+Et):lt},gt.scale(180.739)}function ws(je,Ze,at,lt,Tt,gt,Et,Yt,rr,sr,Sr){if(Sr.nanEncountered)return NaN;var Nr,Qr,ia,_a,za,nn,en,ln,Nn,pi;if(Nr=at-Ze,Qr=je(Ze+Nr*.25),ia=je(at-Nr*.25),isNaN(Qr)){Sr.nanEncountered=!0;return}if(isNaN(ia)){Sr.nanEncountered=!0;return}return _a=Nr*(lt+4*Qr+Tt)/12,za=Nr*(Tt+4*ia+gt)/12,nn=_a+za,pi=(nn-Et)/15,sr>rr?(Sr.maxDepthCount++,nn+pi):Math.abs(pi)>1;do rr[nn]>ia?za=nn:_a=nn,nn=_a+za>>1;while(nn>_a);var en=rr[nn+1]-rr[nn];return en&&(en=(ia-rr[nn+1])/en),(nn+1+en)/Et}var Nr=2*Sr(1)/b*gt/at,Qr=function(ia,_a){var za=Sr(E(h(_a))),nn=lt(za)*ia;return za/=Nr,[nn,_a>=0?za:-za]};return Qr.invert=function(ia,_a){var za;return _a*=Nr,E(_a)<1&&(za=v(_a)*P(Tt(E(_a))*gt)),[ia/lt(E(_a)),za]},Qr}function fo(){var je=0,Ze=2.5,at=1.183136,lt=x.geoProjectionMutator(Rn),Tt=lt(je,Ze,at);return Tt.alpha=function(gt){return arguments.length?lt(je=+gt,Ze,at):je},Tt.k=function(gt){return arguments.length?lt(je,Ze=+gt,at):Ze},Tt.gamma=function(gt){return arguments.length?lt(je,Ze,at=+gt):at},Tt.scale(152.63)}function Pi(je,Ze){return E(je[0]-Ze[0])=0;--rr)at=je[1][rr],lt=at[0][0],Tt=at[0][1],gt=at[1][1],Et=at[2][0],Yt=at[2][1],Ze.push(zo([[Et-l,Yt-l],[Et-l,gt+l],[lt+l,gt+l],[lt+l,Tt-l]],30));return{type:"Polygon",coordinates:[A.merge(Ze)]}}function bi(je,Ze,at){var lt,Tt;function gt(rr,sr){for(var Sr=sr<0?-1:1,Nr=Ze[+(sr<0)],Qr=0,ia=Nr.length-1;QrNr[Qr][2][0];++Qr);var _a=je(rr-Nr[Qr][1][0],sr);return _a[0]+=je(Nr[Qr][1][0],Sr*sr>Sr*Nr[Qr][0][1]?Nr[Qr][0][1]:sr)[0],_a}at?gt.invert=at(gt):je.invert&&(gt.invert=function(rr,sr){for(var Sr=Tt[+(sr<0)],Nr=Ze[+(sr<0)],Qr=0,ia=Sr.length;Qr_a&&(za=ia,ia=_a,_a=za),[[Nr,ia],[Qr,_a]]})}),Et):Ze.map(function(sr){return sr.map(function(Sr){return[[Sr[0][0]*g,Sr[0][1]*g],[Sr[1][0]*g,Sr[1][1]*g],[Sr[2][0]*g,Sr[2][1]*g]]})})},Ze!=null&&Et.lobes(Ze),Et}var wl=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function $l(){return bi(Re,wl).scale(160.857)}var Js=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Ql(){return bi(ds,Js).scale(152.63)}var Ws=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Is(){return bi(Xe,Ws).scale(169.529)}var Dl=[[[[-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 Xu(){return bi(Xe,Dl).scale(169.529).rotate([20,0])}var Lu=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function Bu(){return bi(Jn,Lu,Ce).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var kf=[[[[-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 gf(){return bi(Je,kf).scale(152.63).rotate([-20,0])}function ns(je,Ze){return[3/u*je*F(b*b/3-Ze*Ze),Ze]}ns.invert=function(je,Ze){return[u/3*je/F(b*b/3-Ze*Ze),Ze]};function _u(){return x.geoProjection(ns).scale(158.837)}function Nc(je){function Ze(at,lt){if(E(E(lt)-S)2)return null;at/=2,lt/=2;var gt=at*at,Et=lt*lt,Yt=2*lt/(1+gt+Et);return Yt=c((1+Yt)/(1-Yt),1/je),[t(2*at,1-gt-Et)/je,P((Yt-1)/(Yt+1))]},Ze}function ml(){var je=.5,Ze=x.geoProjectionMutator(Nc),at=Ze(je);return at.spacing=function(lt){return arguments.length?Ze(je=+lt):je},at.scale(124.75)}var fl=b/w;function _l(je,Ze){return[je*(1+F(r(Ze)))/2,Ze/(r(Ze/2)*r(je/6))]}_l.invert=function(je,Ze){var at=E(je),lt=E(Ze),Tt=l,gt=S;ltl||E(nn)>l)&&--Tt>0);return Tt&&[at,lt]};function Tl(){return x.geoProjection(Ts).scale(139.98)}function Ko(je,Ze){return[h(je)/r(Ze),T(Ze)*r(je)]}Ko.invert=function(je,Ze){var at=je*je,lt=Ze*Ze,Tt=lt+1,gt=at+Tt,Et=je?_*F((gt-F(gt*gt-4*at))/at):1/F(Tt);return[P(je*Et),v(Ze)*z(Et)]};function Cs(){return x.geoProjection(Ko).scale(144.049).clipAngle(90-.001)}function Nu(je){var Ze=r(je),at=T(M+je/2);function lt(Tt,gt){var Et=gt-je,Yt=E(Et)=0;)Sr=je[sr],Nr=Sr[0]+Yt*(ia=Nr)-rr*Qr,Qr=Sr[1]+Yt*Qr+rr*ia;return Nr=Yt*(ia=Nr)-rr*Qr,Qr=Yt*Qr+rr*ia,[Nr,Qr]}return at.invert=function(lt,Tt){var gt=20,Et=lt,Yt=Tt;do{for(var rr=Ze,sr=je[rr],Sr=sr[0],Nr=sr[1],Qr=0,ia=0,_a;--rr>=0;)sr=je[rr],Qr=Sr+Et*(_a=Qr)-Yt*ia,ia=Nr+Et*ia+Yt*_a,Sr=sr[0]+Et*(_a=Sr)-Yt*Nr,Nr=sr[1]+Et*Nr+Yt*_a;Qr=Sr+Et*(_a=Qr)-Yt*ia,ia=Nr+Et*ia+Yt*_a,Sr=Et*(_a=Sr)-Yt*Nr-lt,Nr=Et*Nr+Yt*_a-Tt;var za=Qr*Qr+ia*ia,nn,en;Et-=nn=(Sr*Qr+Nr*ia)/za,Yt-=en=(Nr*Qr-Sr*ia)/za}while(E(nn)+E(en)>l*l&&--gt>0);if(gt){var ln=F(Et*Et+Yt*Yt),Nn=2*e(ln*.5),pi=h(Nn);return[t(Et*pi,ln*r(Nn)),ln?P(Yt*pi/ln):0]}},at}var Eo=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Wf=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],is=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],oo=[[.9245,0],[0,0],[.01943,0]],pc=[[.721316,0],[0,0],[-.00881625,-.00617325]];function xu(){return hl(Eo,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function zl(){return hl(Wf,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Kc(){return hl(is,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Ju(){return hl(oo,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function gc(){return hl(pc,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function hl(je,Ze){var at=x.geoProjection(Gf(je)).rotate(Ze).clipAngle(90),lt=x.geoRotation(Ze),Tt=at.center;return delete at.rotate,at.center=function(gt){return arguments.length?Tt(lt(gt)):lt.invert(Tt())},at}var yf=F(6),Jc=F(7);function Uc(je,Ze){var at=P(7*h(Ze)/(3*yf));return[yf*je*(2*r(2*at/3)-1)/Jc,9*h(at/3)/Jc]}Uc.invert=function(je,Ze){var at=3*P(Ze*Jc/9);return[je*Jc/(yf*(2*r(2*at/3)-1)),P(h(at)*3*yf/7)]};function $u(){return x.geoProjection(Uc).scale(164.859)}function jc(je,Ze){for(var at=(1+_)*h(Ze),lt=Ze,Tt=0,gt;Tt<25&&(lt-=gt=(h(lt/2)+h(lt)-at)/(.5*r(lt/2)+r(lt)),!(E(gt)y&&--lt>0);return gt=at*at,Et=gt*gt,Yt=gt*Et,[je/(.84719-.13063*gt+Yt*Yt*(-.04515+.05494*gt-.02326*Et+.00331*Yt)),at]};function wu(){return x.geoProjection(sc).scale(175.295)}function eu(je,Ze){return[je*(1+r(Ze))/2,2*(Ze-T(Ze/2))]}eu.invert=function(je,Ze){for(var at=Ze/2,lt=0,Tt=1/0;lt<10&&E(Tt)>l;++lt){var gt=r(Ze/2);Ze-=Tt=(Ze-T(Ze/2)-at)/(1-.5/(gt*gt))}return[2*je/(1+r(Ze)),Ze]};function Sc(){return x.geoProjection(eu).scale(152.63)}var ef=[[[[-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 ps(){return bi(fe(1/0),ef).rotate([20,0]).scale(152.63)}function Vc(je,Ze){var at=h(Ze),lt=r(Ze),Tt=v(je);if(je===0||E(Ze)===S)return[0,Ze];if(Ze===0)return[je,0];if(E(je)===S)return[je*lt,S*at];var gt=b/(2*je)-2*je/b,Et=2*Ze/b,Yt=(1-Et*Et)/(at-Et),rr=gt*gt,sr=Yt*Yt,Sr=1+rr/sr,Nr=1+sr/rr,Qr=(gt*at/Yt-gt/2)/Sr,ia=(sr*at/rr+Yt/2)/Nr,_a=Qr*Qr+lt*lt/Sr,za=ia*ia-(sr*at*at/rr+Yt*at-1)/Nr;return[S*(Qr+F(_a)*Tt),S*(ia+F(za<0?0:za)*v(-Ze*gt)*Tt)]}Vc.invert=function(je,Ze){je/=S,Ze/=S;var at=je*je,lt=Ze*Ze,Tt=at+lt,gt=b*b;return[je?(Tt-1+F((1-Tt)*(1-Tt)+4*at))/(2*je)*S:0,Fe(function(Et){return Tt*(b*h(Et)-2*Et)*b+4*Et*Et*(Ze-h(Et))+2*b*Et-gt*Ze},0)]};function Zf(){return x.geoProjection(Vc).scale(127.267)}var mf=1.0148,Mc=.23185,_f=-.14499,tu=.02406,xf=mf,Fl=5*Mc,ru=7*_f,Uu=9*tu,$s=1.790857183;function Qu(je,Ze){var at=Ze*Ze;return[je,Ze*(mf+at*at*(Mc+at*(_f+tu*at)))]}Qu.invert=function(je,Ze){Ze>$s?Ze=$s:Ze<-$s&&(Ze=-$s);var at=Ze,lt;do{var Tt=at*at;at-=lt=(at*(mf+Tt*Tt*(Mc+Tt*(_f+tu*Tt)))-Ze)/(xf+Tt*Tt*(Fl+Tt*(ru+Uu*Tt)))}while(E(lt)>l);return[je,at]};function Tu(){return x.geoProjection(Qu).scale(139.319)}function au(je,Ze){if(E(Ze)l&&--Tt>0);return Et=T(lt),[(E(Ze)=0;)if(lt=Ze[Yt],at[0]===lt[0]&&at[1]===lt[1]){if(gt)return[gt,at];gt=at}}}function Cl(je){for(var Ze=je.length,at=[],lt=je[Ze-1],Tt=0;Tt0?[-lt[0],0]:[180-lt[0],180])};var Ze=mc.map(function(at){return{face:at,project:je(at)}});return[-1,0,0,1,0,1,4,5].forEach(function(at,lt){var Tt=Ze[at];Tt&&(Tt.children||(Tt.children=[])).push(Ze[lt])}),lc(Ze[0],function(at,lt){return Ze[at<-b/2?lt<0?6:4:at<0?lt<0?2:0:atlt^ia>lt&&at<(Qr-sr)*(lt-Sr)/(ia-Sr)+sr&&(Tt=!Tt)}return Tt}function xl(je,Ze){var at=Ze.stream,lt;if(!at)throw new Error("invalid projection");switch(je&&je.type){case"Feature":lt=ou;break;case"FeatureCollection":lt=nf;break;default:lt=Au;break}return lt(je,at)}function nf(je,Ze){return{type:"FeatureCollection",features:je.features.map(function(at){return ou(at,Ze)})}}function ou(je,Ze){return{type:"Feature",id:je.id,properties:je.properties,geometry:Au(je.geometry,Ze)}}function Ru(je,Ze){return{type:"GeometryCollection",geometries:je.geometries.map(function(at){return Au(at,Ze)})}}function Au(je,Ze){if(!je)return null;if(je.type==="GeometryCollection")return Ru(je,Ze);var at;switch(je.type){case"Point":at=bl;break;case"MultiPoint":at=bl;break;case"LineString":at=tc;break;case"MultiLineString":at=tc;break;case"Polygon":at=Su;break;case"MultiPolygon":at=Su;break;case"Sphere":at=Su;break;default:return null}return x.geoStream(je,Ze(at)),at.result()}var Zs=[],Ol=[],bl={point:function(je,Ze){Zs.push([je,Ze])},result:function(){var je=Zs.length?Zs.length<2?{type:"Point",coordinates:Zs[0]}:{type:"MultiPoint",coordinates:Zs}:null;return Zs=[],je}},tc={lineStart:Iu,point:function(je,Ze){Zs.push([je,Ze])},lineEnd:function(){Zs.length&&(Ol.push(Zs),Zs=[])},result:function(){var je=Ol.length?Ol.length<2?{type:"LineString",coordinates:Ol[0]}:{type:"MultiLineString",coordinates:Ol}:null;return Ol=[],je}},Su={polygonStart:Iu,lineStart:Iu,point:function(je,Ze){Zs.push([je,Ze])},lineEnd:function(){var je=Zs.length;if(je){do Zs.push(Zs[0].slice());while(++je<4);Ol.push(Zs),Zs=[]}},polygonEnd:Iu,result:function(){if(!Ol.length)return null;var je=[],Ze=[];return Ol.forEach(function(at){bc(at)?je.push([at]):Ze.push(at)}),Ze.forEach(function(at){var lt=at[0];je.some(function(Tt){if(Lf(Tt[0],lt))return Tt.push(at),!0})||je.push([at])}),Ol=[],je.length?je.length>1?{type:"MultiPolygon",coordinates:je}:{type:"Polygon",coordinates:je[0]}:null}};function Cc(je){var Ze=je(S,0)[0]-je(-S,0)[0];function at(lt,Tt){var gt=E(lt)0?lt-b:lt+b,Tt),Yt=(Et[0]-Et[1])*_,rr=(Et[0]+Et[1])*_;if(gt)return[Yt,rr];var sr=Ze*_,Sr=Yt>0^rr>0?-1:1;return[Sr*Yt-v(rr)*sr,Sr*rr-v(Yt)*sr]}return je.invert&&(at.invert=function(lt,Tt){var gt=(lt+Tt)*_,Et=(Tt-lt)*_,Yt=E(gt)<.5*Ze&&E(Et)<.5*Ze;if(!Yt){var rr=Ze*_,sr=gt>0^Et>0?-1:1,Sr=-sr*lt+(Et>0?1:-1)*rr,Nr=-sr*Tt+(gt>0?1:-1)*rr;gt=(-Sr-Nr)*_,Et=(Sr-Nr)*_}var Qr=je.invert(gt,Et);return Yt||(Qr[0]+=gt>0?b:-b),Qr}),x.geoProjection(at).rotate([-90,-90,45]).clipAngle(180-.001)}function Ht(){return Cc(ra).scale(176.423)}function ur(){return Cc(Ci).scale(111.48)}function qr(je,Ze){if(!(0<=(Ze=+Ze)&&Ze<=20))throw new Error("invalid digits");function at(sr){var Sr=sr.length,Nr=2,Qr=new Array(Sr);for(Qr[0]=+sr[0].toFixed(Ze),Qr[1]=+sr[1].toFixed(Ze);Nr2||ia[0]!=Sr[0]||ia[1]!=Sr[1])&&(Nr.push(ia),Sr=ia)}return Nr.length===1&&sr.length>1&&Nr.push(at(sr[sr.length-1])),Nr}function gt(sr){return sr.map(Tt)}function Et(sr){if(sr==null)return sr;var Sr;switch(sr.type){case"GeometryCollection":Sr={type:"GeometryCollection",geometries:sr.geometries.map(Et)};break;case"Point":Sr={type:"Point",coordinates:at(sr.coordinates)};break;case"MultiPoint":Sr={type:sr.type,coordinates:lt(sr.coordinates)};break;case"LineString":Sr={type:sr.type,coordinates:Tt(sr.coordinates)};break;case"MultiLineString":case"Polygon":Sr={type:sr.type,coordinates:gt(sr.coordinates)};break;case"MultiPolygon":Sr={type:"MultiPolygon",coordinates:sr.coordinates.map(gt)};break;default:return sr}return sr.bbox!=null&&(Sr.bbox=sr.bbox),Sr}function Yt(sr){var Sr={type:"Feature",properties:sr.properties,geometry:Et(sr.geometry)};return sr.id!=null&&(Sr.id=sr.id),sr.bbox!=null&&(Sr.bbox=sr.bbox),Sr}if(je!=null)switch(je.type){case"Feature":return Yt(je);case"FeatureCollection":{var rr={type:"FeatureCollection",features:je.features.map(Yt)};return je.bbox!=null&&(rr.bbox=je.bbox),rr}default:return Et(je)}return je}function Or(je){var Ze=h(je);function at(lt,Tt){var gt=Ze?T(lt*Ze/2)/Ze:lt/2;if(!Tt)return[2*gt,-je];var Et=2*e(gt*h(Tt)),Yt=1/T(Tt);return[h(Et)*Yt,Tt+(1-r(Et))*Yt-je]}return at.invert=function(lt,Tt){if(E(Tt+=je)l&&--Yt>0);var Qr=lt*(sr=T(Et)),ia=T(E(Tt)0?S:-S)*(rr+Tt*(Sr-Et)/2+Tt*Tt*(Sr-2*rr+Et)/2)]}ja.invert=function(je,Ze){var at=Ze/S,lt=at*90,Tt=s(18,E(lt/5)),gt=n(0,a(Tt));do{var Et=Fa[gt][1],Yt=Fa[gt+1][1],rr=Fa[s(19,gt+2)][1],sr=rr-Et,Sr=rr-2*Yt+Et,Nr=2*(E(at)-Yt)/sr,Qr=Sr/sr,ia=Nr*(1-Qr*Nr*(1-2*Qr*Nr));if(ia>=0||gt===1){lt=(Ze>=0?5:-5)*(ia+Tt);var _a=50,za;do Tt=s(18,E(lt)/5),gt=a(Tt),ia=Tt-gt,Et=Fa[gt][1],Yt=Fa[gt+1][1],rr=Fa[s(19,gt+2)][1],lt-=(za=(Ze>=0?S:-S)*(Yt+ia*(rr-Et)/2+ia*ia*(rr-2*Yt+Et)/2)-Ze)*g;while(E(za)>y&&--_a>0);break}}while(--gt>=0);var nn=Fa[gt][0],en=Fa[gt+1][0],ln=Fa[s(19,gt+2)][0];return[je/(en+ia*(ln-nn)/2+ia*ia*(ln-2*en+nn)/2),lt*m]};function sn(){return x.geoProjection(ja).scale(152.63)}function gn(je){function Ze(at,lt){var Tt=r(lt),gt=(je-1)/(je-Tt*r(at));return[gt*Tt*h(at),gt*h(lt)]}return Ze.invert=function(at,lt){var Tt=at*at+lt*lt,gt=F(Tt),Et=(je-F(1-Tt*(je+1)/(je-1)))/((je-1)/gt+gt/(je-1));return[t(at*Et,gt*F(1-Et*Et)),gt?P(lt*Et/gt):0]},Ze}function kn(je,Ze){var at=gn(je);if(!Ze)return at;var lt=r(Ze),Tt=h(Ze);function gt(Et,Yt){var rr=at(Et,Yt),sr=rr[1],Sr=sr*Tt/(je-1)+lt;return[rr[0]*lt/Sr,sr/Sr]}return gt.invert=function(Et,Yt){var rr=(je-1)/(je-1-Yt*Tt);return at.invert(rr*Et,rr*Yt*lt)},gt}function Ja(){var je=2,Ze=0,at=x.geoProjectionMutator(kn),lt=at(je,Ze);return lt.distance=function(Tt){return arguments.length?at(je=+Tt,Ze):je},lt.tilt=function(Tt){return arguments.length?at(je,Ze=Tt*m):Ze*g},lt.scale(432.147).clipAngle(z(1/je)*g-1e-6)}var _n=1e-4,on=1e4,Wa=-180,On=Wa+_n,zi=180,ki=zi-_n,ji=-90,Ni=ji+_n,Bn=90,An=Bn-_n;function Ki(je){return je.length>0}function ko(je){return Math.floor(je*on)/on}function $o(je){return je===ji||je===Bn?[0,je]:[Wa,ko(je)]}function Ls(je){var Ze=je[0],at=je[1],lt=!1;return Ze<=On?(Ze=Wa,lt=!0):Ze>=ki&&(Ze=zi,lt=!0),at<=Ni?(at=ji,lt=!0):at>=An&&(at=Bn,lt=!0),lt?[Ze,at]:je}function os(je){return je.map(Ls)}function As(je,Ze,at){for(var lt=0,Tt=je.length;lt=ki||Sr<=Ni||Sr>=An){gt[Et]=Ls(rr);for(var Nr=Et+1;NrOn&&iaNi&&_a=Yt)break;at.push({index:-1,polygon:Ze,ring:gt=gt.slice(Nr-1)}),gt[0]=$o(gt[0][1]),Et=-1,Yt=gt.length}}}}function jo(je){var Ze,at=je.length,lt={},Tt={},gt,Et,Yt,rr,sr;for(Ze=0;Ze0?b-Yt:Yt)*g],sr=x.geoProjection(je(Et)).rotate(rr),Sr=x.geoRotation(rr),Nr=sr.center;return delete sr.rotate,sr.center=function(Qr){return arguments.length?Nr(Sr(Qr)):Sr.invert(Nr())},sr.clipAngle(90)}function Jo(je){var Ze=r(je);function at(lt,Tt){var gt=x.geoGnomonicRaw(lt,Tt);return gt[0]*=Ze,gt}return at.invert=function(lt,Tt){return x.geoGnomonicRaw.invert(lt/Ze,Tt)},at}function Bl(){return jl([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function jl(je,Ze){return gs(Jo,je,Ze)}function Vl(je){if(!(je*=2))return x.geoAzimuthalEquidistantRaw;var Ze=-je/2,at=-Ze,lt=je*je,Tt=T(at),gt=.5/h(at);function Et(Yt,rr){var sr=z(r(rr)*r(Yt-Ze)),Sr=z(r(rr)*r(Yt-at)),Nr=rr<0?-1:1;return sr*=sr,Sr*=Sr,[(sr-Sr)/(2*je),Nr*F(4*lt*Sr-(lt-sr+Sr)*(lt-sr+Sr))/(2*je)]}return Et.invert=function(Yt,rr){var sr=rr*rr,Sr=r(F(sr+(Qr=Yt+Ze)*Qr)),Nr=r(F(sr+(Qr=Yt+at)*Qr)),Qr,ia;return[t(ia=Sr-Nr,Qr=(Sr+Nr)*Tt),(rr<0?-1:1)*z(F(Qr*Qr+ia*ia)*gt)]},Et}function cc(){return ql([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function ql(je,Ze){return gs(Vl,je,Ze)}function Vu(je,Ze){if(E(Ze)l&&--Yt>0);return[v(je)*(F(Tt*Tt+4)+Tt)*b/4,S*Et]};function wc(){return x.geoProjection(Du).scale(127.16)}function De(je,Ze,at,lt,Tt){function gt(Et,Yt){var rr=at*h(lt*Yt),sr=F(1-rr*rr),Sr=F(2/(1+sr*r(Et*=Tt)));return[je*sr*Sr*h(Et),Ze*rr*Sr]}return gt.invert=function(Et,Yt){var rr=Et/je,sr=Yt/Ze,Sr=F(rr*rr+sr*sr),Nr=2*P(Sr/2);return[t(Et*T(Nr),je*Sr)/Tt,Sr&&P(Yt*h(Nr)/(Ze*at*Sr))/lt]},gt}function I(je,Ze,at,lt){var Tt=b/3;je=n(je,l),Ze=n(Ze,l),je=s(je,S),Ze=s(Ze,b-l),at=n(at,0),at=s(at,100-l),lt=n(lt,l);var gt=at/100+1,Et=lt/100,Yt=z(gt*r(Tt))/Tt,rr=h(je)/h(Yt*S),sr=Ze/b,Sr=F(Et*h(je/2)/h(Ze/2)),Nr=Sr/F(sr*rr*Yt),Qr=1/(Sr*F(sr*rr*Yt));return De(Nr,Qr,rr,Yt,sr)}function ne(){var je=65*m,Ze=60*m,at=20,lt=200,Tt=x.geoProjectionMutator(I),gt=Tt(je,Ze,at,lt);return gt.poleline=function(Et){return arguments.length?Tt(je=+Et*m,Ze,at,lt):je*g},gt.parallels=function(Et){return arguments.length?Tt(je,Ze=+Et*m,at,lt):Ze*g},gt.inflation=function(Et){return arguments.length?Tt(je,Ze,at=+Et,lt):at},gt.ratio=function(Et){return arguments.length?Tt(je,Ze,at,lt=+Et):lt},gt.scale(163.775)}function Te(){return ne().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var Se=4*b+3*F(3),Ie=2*F(2*b*F(3)/Se),ot=Ke(Ie*F(3)/b,Ie,Se/6);function yt(){return x.geoProjection(ot).scale(176.84)}function Ct(je,Ze){return[je*F(1-3*Ze*Ze/(b*b)),Ze]}Ct.invert=function(je,Ze){return[je/F(1-3*Ze*Ze/(b*b)),Ze]};function Wt(){return x.geoProjection(Ct).scale(152.63)}function nr(je,Ze){var at=r(Ze),lt=r(je)*at,Tt=1-lt,gt=r(je=t(h(je)*at,-h(Ze))),Et=h(je);return at=F(1-lt*lt),[Et*at-gt*Tt,-gt*at-Et*Tt]}nr.invert=function(je,Ze){var at=(je*je+Ze*Ze)/-2,lt=F(-at*(2+at)),Tt=Ze*at+je*lt,gt=je*at-Ze*lt,Et=F(gt*gt+Tt*Tt);return[t(lt*Tt,Et*(1+at)),Et?-P(lt*gt/Et):0]};function or(){return x.geoProjection(nr).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function Fr(je,Ze){var at=ue(je,Ze);return[(at[0]+je/S)/2,(at[1]+Ze)/2]}Fr.invert=function(je,Ze){var at=je,lt=Ze,Tt=25;do{var gt=r(lt),Et=h(lt),Yt=h(2*lt),rr=Et*Et,sr=gt*gt,Sr=h(at),Nr=r(at/2),Qr=h(at/2),ia=Qr*Qr,_a=1-sr*Nr*Nr,za=_a?z(gt*Nr)*F(nn=1/_a):nn=0,nn,en=.5*(2*za*gt*Qr+at/S)-je,ln=.5*(za*Et+lt)-Ze,Nn=.5*nn*(sr*ia+za*gt*Nr*rr)+.5/S,pi=nn*(Sr*Yt/4-za*Et*Qr),ii=.125*nn*(Yt*Qr-za*Et*sr*Sr),Gi=.5*nn*(rr*Nr+za*ia*gt)+.5,Bo=pi*ii-Gi*Nn,No=(ln*pi-en*Gi)/Bo,po=(en*ii-ln*Nn)/Bo;at-=No,lt-=po}while((E(No)>l||E(po)>l)&&--Tt>0);return[at,lt]};function Wr(){return x.geoProjection(Fr).scale(158.837)}d.geoNaturalEarth=x.geoNaturalEarth1,d.geoNaturalEarthRaw=x.geoNaturalEarth1Raw,d.geoAiry=Q,d.geoAiryRaw=Z,d.geoAitoff=oe,d.geoAitoffRaw=ue,d.geoArmadillo=j,d.geoArmadilloRaw=le,d.geoAugust=$,d.geoAugustRaw=J,d.geoBaker=q,d.geoBakerRaw=ee,d.geoBerghaus=ie,d.geoBerghausRaw=ae,d.geoBertin1953=et,d.geoBertin1953Raw=qe,d.geoBoggs=$e,d.geoBoggsRaw=Re,d.geoBonne=Rt,d.geoBonneRaw=St,d.geoBottomley=ir,d.geoBottomleyRaw=Ut,d.geoBromley=Mr,d.geoBromleyRaw=ar,d.geoChamberlin=ve,d.geoChamberlinRaw=ze,d.geoChamberlinAfrica=Oe,d.geoCollignon=be,d.geoCollignonRaw=ge,d.geoCraig=We,d.geoCraigRaw=Pe,d.geoCraster=Mt,d.geoCrasterRaw=_t,d.geoCylindricalEqualArea=Bt,d.geoCylindricalEqualAreaRaw=Nt,d.geoCylindricalStereographic=Zt,d.geoCylindricalStereographicRaw=qt,d.geoEckert1=ta,d.geoEckert1Raw=lr,d.geoEckert2=wa,d.geoEckert2Raw=da,d.geoEckert3=Ia,d.geoEckert3Raw=ma,d.geoEckert4=La,d.geoEckert4Raw=va,d.geoEckert5=Vt,d.geoEckert5Raw=Ka,d.geoEckert6=jt,d.geoEckert6Raw=Lt,d.geoEisenlohr=Br,d.geoEisenlohrRaw=gr,d.geoFahey=ga,d.geoFaheyRaw=Ur,d.geoFoucaut=Pa,d.geoFoucautRaw=Aa,d.geoFoucautSinusoidal=Oa,d.geoFoucautSinusoidalRaw=sa,d.geoGilbert=Lr,d.geoGingery=kr,d.geoGingeryRaw=Er,d.geoGinzburg4=Hr,d.geoGinzburg4Raw=Pr,d.geoGinzburg5=Jr,d.geoGinzburg5Raw=Zr,d.geoGinzburg6=Qt,d.geoGinzburg6Raw=wt,d.geoGinzburg8=$r,d.geoGinzburg8Raw=mr,d.geoGinzburg9=Sa,d.geoGinzburg9Raw=oa,d.geoGringorten=Ga,d.geoGringortenRaw=ra,d.geoGuyou=mi,d.geoGuyouRaw=Ci,d.geoHammer=Ae,d.geoHammerRaw=fe,d.geoHammerRetroazimuthal=Wo,d.geoHammerRetroazimuthalRaw=uo,d.geoHealpix=bs,d.geoHealpixRaw=Ao,d.geoHill=fs,d.geoHillRaw=as,d.geoHomolosine=Ui,d.geoHomolosineRaw=ds,d.geoHufnagel=Mo,d.geoHufnagelRaw=ms,d.geoHyperelliptical=fo,d.geoHyperellipticalRaw=Rn,d.geoInterrupt=bi,d.geoInterruptedBoggs=$l,d.geoInterruptedHomolosine=Ql,d.geoInterruptedMollweide=Is,d.geoInterruptedMollweideHemispheres=Xu,d.geoInterruptedSinuMollweide=Bu,d.geoInterruptedSinusoidal=gf,d.geoKavrayskiy7=_u,d.geoKavrayskiy7Raw=ns,d.geoLagrange=ml,d.geoLagrangeRaw=Nc,d.geoLarrivee=Yu,d.geoLarriveeRaw=_l,d.geoLaskowski=Tl,d.geoLaskowskiRaw=Ts,d.geoLittrow=Cs,d.geoLittrowRaw=Ko,d.geoLoximuthal=Ul,d.geoLoximuthalRaw=Nu,d.geoMiller=Bs,d.geoMillerRaw=Ku,d.geoModifiedStereographic=hl,d.geoModifiedStereographicRaw=Gf,d.geoModifiedStereographicAlaska=xu,d.geoModifiedStereographicGs48=zl,d.geoModifiedStereographicGs50=Kc,d.geoModifiedStereographicMiller=Ju,d.geoModifiedStereographicLee=gc,d.geoMollweide=Me,d.geoMollweideRaw=Xe,d.geoMtFlatPolarParabolic=$u,d.geoMtFlatPolarParabolicRaw=Uc,d.geoMtFlatPolarQuartic=$c,d.geoMtFlatPolarQuarticRaw=jc,d.geoMtFlatPolarSinusoidal=Qc,d.geoMtFlatPolarSinusoidalRaw=bu,d.geoNaturalEarth2=wu,d.geoNaturalEarth2Raw=sc,d.geoNellHammer=Sc,d.geoNellHammerRaw=eu,d.geoInterruptedQuarticAuthalic=ps,d.geoNicolosi=Zf,d.geoNicolosiRaw=Vc,d.geoPatterson=Tu,d.geoPattersonRaw=Qu,d.geoPolyconic=Ns,d.geoPolyconicRaw=au,d.geoPolyhedral=lc,d.geoPolyhedralButterfly=Us,d.geoPolyhedralCollignon=af,d.geoPolyhedralWaterman=Rs,d.geoProject=xl,d.geoGringortenQuincuncial=Ht,d.geoPeirceQuincuncial=ur,d.geoPierceQuincuncial=ur,d.geoQuantize=qr,d.geoQuincuncial=Cc,d.geoRectangularPolyconic=ua,d.geoRectangularPolyconicRaw=Or,d.geoRobinson=sn,d.geoRobinsonRaw=ja,d.geoSatellite=Ja,d.geoSatelliteRaw=kn,d.geoSinuMollweide=Os,d.geoSinuMollweideRaw=Jn,d.geoSinusoidal=At,d.geoSinusoidalRaw=Je,d.geoStitch=Ss,d.geoTimes=ao,d.geoTimesRaw=fi,d.geoTwoPointAzimuthal=jl,d.geoTwoPointAzimuthalRaw=Jo,d.geoTwoPointAzimuthalUsa=Bl,d.geoTwoPointEquidistant=ql,d.geoTwoPointEquidistantRaw=Vl,d.geoTwoPointEquidistantUsa=cc,d.geoVanDerGrinten=ol,d.geoVanDerGrintenRaw=Vu,d.geoVanDerGrinten2=Vi,d.geoVanDerGrinten2Raw=rc,d.geoVanDerGrinten3=qu,d.geoVanDerGrinten3Raw=eo,d.geoVanDerGrinten4=wc,d.geoVanDerGrinten4Raw=Du,d.geoWagner=ne,d.geoWagner7=Te,d.geoWagnerRaw=I,d.geoWagner4=yt,d.geoWagner4Raw=ot,d.geoWagner6=Wt,d.geoWagner6Raw=Ct,d.geoWiechel=or,d.geoWiechelRaw=nr,d.geoWinkel3=Wr,d.geoWinkel3Raw=Fr,Object.defineProperty(d,"__esModule",{value:!0})})}}),xP=He({"src/plots/geo/zoom.js"(Y,G){var d=Qn(),x=Gr(),A=Ei(),E=Math.PI/180,e=180/Math.PI,t={cursor:"pointer"},r={cursor:"auto"};function o(g,m){var R=g.projection,P;return m._isScoped?P=n:m._isClipped?P=c:P=s,P(g,R)}G.exports=o;function a(g,m){return d.behavior.zoom().translate(m.translate()).scale(m.scale())}function i(g,m,R){var P=g.id,z=g.graphDiv,F=z.layout,B=F[P],O=z._fullLayout,L=O[P],N={},U={};function Z(Q,ue){N[P+"."+Q]=x.nestedProperty(B,Q).get(),A.call("_storeDirectGUIEdit",F,O._preGUI,N);var oe=x.nestedProperty(L,Q);oe.get()!==ue&&(oe.set(ue),x.nestedProperty(B,Q).set(ue),U[P+"."+Q]=ue)}R(Z),Z("projection.scale",m.scale()/g.fitScale),Z("fitbounds",!1),z.emit("plotly_relayout",U)}function n(g,m){var R=a(g,m);function P(){d.select(this).style(t)}function z(){m.scale(d.event.scale).translate(d.event.translate),g.render(!0);var O=m.invert(g.midPt);g.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":m.scale()/g.fitScale,"geo.center.lon":O[0],"geo.center.lat":O[1]})}function F(O){var L=m.invert(g.midPt);O("center.lon",L[0]),O("center.lat",L[1])}function B(){d.select(this).style(r),i(g,m,F)}return R.on("zoomstart",P).on("zoom",z).on("zoomend",B),R}function s(g,m){var R=a(g,m),P=2,z,F,B,O,L,N,U,Z,Q;function ue(X){return m.invert(X)}function oe(X){var re=ue(X);if(!re)return!0;var ee=m(re);return Math.abs(ee[0]-X[0])>P||Math.abs(ee[1]-X[1])>P}function le(){d.select(this).style(t),z=d.mouse(this),F=m.rotate(),B=m.translate(),O=F,L=ue(z)}function j(){if(N=d.mouse(this),oe(z)){R.scale(m.scale()),R.translate(m.translate());return}m.scale(d.event.scale),m.translate([B[0],d.event.translate[1]]),L?ue(N)&&(Z=ue(N),U=[O[0]+(Z[0]-L[0]),F[1],F[2]],m.rotate(U),O=U):(z=N,L=ue(z)),Q=!0,g.render(!0);var X=m.rotate(),re=m.invert(g.midPt);g.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":m.scale()/g.fitScale,"geo.center.lon":re[0],"geo.center.lat":re[1],"geo.projection.rotation.lon":-X[0]})}function J(){d.select(this).style(r),Q&&i(g,m,$)}function $(X){var re=m.rotate(),ee=m.invert(g.midPt);X("projection.rotation.lon",-re[0]),X("center.lon",ee[0]),X("center.lat",ee[1])}return R.on("zoomstart",le).on("zoom",j).on("zoomend",J),R}function c(g,m){m.rotate(),m.scale();var R=a(g,m),P=u(R,"zoomstart","zoom","zoomend"),z=0,F=R.on,B;R.on("zoomstart",function(){d.select(this).style(t);var Z=d.mouse(this),Q=m.rotate(),ue=Q,oe=m.translate(),le=v(Q);B=f(m,Z),F.call(R,"zoom",function(){var j=d.mouse(this);if(m.scale(d.event.scale),!B)Z=j,B=f(m,Z);else if(f(m,j)){m.rotate(Q).translate(oe);var J=f(m,j),$=T(B,J),X=M(h(le,$)),re=l(X,B,ue);(!isFinite(re[0])||!isFinite(re[1])||!isFinite(re[2]))&&(re=ue),m.rotate(re),ue=re}L(P.of(this,arguments))}),O(P.of(this,arguments))}).on("zoomend",function(){d.select(this).style(r),F.call(R,"zoom",null),N(P.of(this,arguments)),i(g,m,U)}).on("zoom.redraw",function(){g.render(!0);var Z=m.rotate();g.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":m.scale()/g.fitScale,"geo.projection.rotation.lon":-Z[0],"geo.projection.rotation.lat":-Z[1]})});function O(Z){z++||Z({type:"zoomstart"})}function L(Z){Z({type:"zoom"})}function N(Z){--z||Z({type:"zoomend"})}function U(Z){var Q=m.rotate();Z("projection.rotation.lon",-Q[0]),Z("projection.rotation.lat",-Q[1])}return d.rebind(R,P,"on")}function f(g,m){var R=g.invert(m);return R&&isFinite(R[0])&&isFinite(R[1])&&_(R)}function v(g){var m=.5*g[0]*E,R=.5*g[1]*E,P=.5*g[2]*E,z=Math.sin(m),F=Math.cos(m),B=Math.sin(R),O=Math.cos(R),L=Math.sin(P),N=Math.cos(P);return[F*O*N+z*B*L,z*O*N-F*B*L,F*B*N+z*O*L,F*O*L-z*B*N]}function h(g,m){var R=g[0],P=g[1],z=g[2],F=g[3],B=m[0],O=m[1],L=m[2],N=m[3];return[R*B-P*O-z*L-F*N,R*O+P*B+z*N-F*L,R*L-P*N+z*B+F*O,R*N+P*L-z*O+F*B]}function T(g,m){if(!(!g||!m)){var R=p(g,m),P=Math.sqrt(w(R,R)),z=.5*Math.acos(Math.max(-1,Math.min(1,w(g,m)))),F=Math.sin(z)/P;return P&&[Math.cos(z),R[2]*F,-R[1]*F,R[0]*F]}}function l(g,m,R){var P=S(m,2,g[0]);P=S(P,1,g[1]),P=S(P,0,g[2]-R[2]);var z=m[0],F=m[1],B=m[2],O=P[0],L=P[1],N=P[2],U=Math.atan2(F,z)*e,Z=Math.sqrt(z*z+F*F),Q,ue;Math.abs(L)>Z?(ue=(L>0?90:-90)-U,Q=0):(ue=Math.asin(L/Z)*e-U,Q=Math.sqrt(Z*Z-L*L));var oe=180-ue-2*U,le=(Math.atan2(N,O)-Math.atan2(B,Q))*e,j=(Math.atan2(N,O)-Math.atan2(B,-Q))*e,J=y(R[0],R[1],ue,le),$=y(R[0],R[1],oe,j);return J<=$?[ue,le,R[2]]:[oe,j,R[2]]}function y(g,m,R,P){var z=b(R-g),F=b(P-m);return Math.sqrt(z*z+F*F)}function b(g){return(g%360+540)%360-180}function S(g,m,R){var P=R*E,z=g.slice(),F=m===0?1:0,B=m===2?1:2,O=Math.cos(P),L=Math.sin(P);return z[F]=g[F]*O-g[B]*L,z[B]=g[B]*O+g[F]*L,z}function M(g){return[Math.atan2(2*(g[0]*g[1]+g[2]*g[3]),1-2*(g[1]*g[1]+g[2]*g[2]))*e,Math.asin(Math.max(-1,Math.min(1,2*(g[0]*g[2]-g[3]*g[1]))))*e,Math.atan2(2*(g[0]*g[3]+g[1]*g[2]),1-2*(g[2]*g[2]+g[3]*g[3]))*e]}function _(g){var m=g[0]*E,R=g[1]*E,P=Math.cos(R);return[P*Math.cos(m),P*Math.sin(m),Math.sin(R)]}function w(g,m){for(var R=0,P=0,z=g.length;P0&&L._module.calcGeoJSON(O,P)}if(!z){var N=this.updateProjection(R,P);if(N)return;(!this.viewInitial||this.scope!==F.scope)&&this.saveViewInitial(F)}this.scope=F.scope,this.updateBaseLayers(P,F),this.updateDims(P,F),this.updateFx(P,F),s.generalUpdatePerTraceModule(this.graphDiv,this,R,F);var U=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=U.selectAll(".point"),this.dataPoints.text=U.selectAll("text"),this.dataPaths.line=U.selectAll(".js-line");var Z=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=Z.selectAll("path"),this._render()},p.updateProjection=function(R,P){var z=this.graphDiv,F=P[this.id],B=P._size,O=F.domain,L=F.projection,N=F.lonaxis,U=F.lataxis,Z=N._ax,Q=U._ax,ue=this.projection=u(F),oe=[[B.l+B.w*O.x[0],B.t+B.h*(1-O.y[1])],[B.l+B.w*O.x[1],B.t+B.h*(1-O.y[0])]],le=F.center||{},j=L.rotation||{},J=N.range||[],$=U.range||[];if(F.fitbounds){Z._length=oe[1][0]-oe[0][0],Q._length=oe[1][1]-oe[0][1],Z.range=f(z,Z),Q.range=f(z,Q);var X=(Z.range[0]+Z.range[1])/2,re=(Q.range[0]+Q.range[1])/2;if(F._isScoped)le={lon:X,lat:re};else if(F._isClipped){le={lon:X,lat:re},j={lon:X,lat:re,roll:j.roll};var ee=L.type,q=b.lonaxisSpan[ee]/2||180,ae=b.lataxisSpan[ee]/2||90;J=[X-q,X+q],$=[re-ae,re+ae]}else le={lon:X,lat:re},j={lon:X,lat:j.lat,roll:j.roll}}ue.center([le.lon-j.lon,le.lat-j.lat]).rotate([-j.lon,-j.lat,j.roll]).parallels(L.parallels);var ie=m(J,$);ue.fitExtent(oe,ie);var fe=this.bounds=ue.getBounds(ie),we=this.fitScale=ue.scale(),Ae=ue.translate();if(F.fitbounds){var Fe=ue.getBounds(m(Z.range,Q.range)),Ce=Math.min((fe[1][0]-fe[0][0])/(Fe[1][0]-Fe[0][0]),(fe[1][1]-fe[0][1])/(Fe[1][1]-Fe[0][1]));isFinite(Ce)?ue.scale(Ce*we):r.warn("Something went wrong during"+this.id+"fitbounds computations.")}else ue.scale(L.scale*we);var qe=this.midPt=[(fe[0][0]+fe[1][0])/2,(fe[0][1]+fe[1][1])/2];if(ue.translate([Ae[0]+(qe[0]-Ae[0]),Ae[1]+(qe[1]-Ae[1])]).clipExtent(fe),F._isAlbersUsa){var et=ue([le.lon,le.lat]),Qe=ue.translate();ue.translate([Qe[0]-(et[0]-Qe[0]),Qe[1]-(et[1]-Qe[1])])}},p.updateBaseLayers=function(R,P){var z=this,F=z.topojson,B=z.layers,O=z.basePaths;function L(oe){return oe==="lonaxis"||oe==="lataxis"}function N(oe){return!!b.lineLayers[oe]}function U(oe){return!!b.fillLayers[oe]}var Z=this.hasChoropleth?b.layersForChoropleth:b.layers,Q=Z.filter(function(oe){return N(oe)||U(oe)?P["show"+oe]:L(oe)?P[oe].showgrid:!0}),ue=z.framework.selectAll(".layer").data(Q,String);ue.exit().each(function(oe){delete B[oe],delete O[oe],d.select(this).remove()}),ue.enter().append("g").attr("class",function(oe){return"layer "+oe}).each(function(oe){var le=B[oe]=d.select(this);oe==="bg"?z.bgRect=le.append("rect").style("pointer-events","all"):L(oe)?O[oe]=le.append("path").style("fill","none"):oe==="backplot"?le.append("g").classed("choroplethlayer",!0):oe==="frontplot"?le.append("g").classed("scatterlayer",!0):N(oe)?O[oe]=le.append("path").style("fill","none").style("stroke-miterlimit",2):U(oe)&&(O[oe]=le.append("path").style("stroke","none"))}),ue.order(),ue.each(function(oe){var le=O[oe],j=b.layerNameToAdjective[oe];oe==="frame"?le.datum(b.sphereSVG):N(oe)||U(oe)?le.datum(_(F,F.objects[oe])):L(oe)&&le.datum(g(oe,P,R)).call(a.stroke,P[oe].gridcolor).call(i.dashLine,P[oe].griddash,P[oe].gridwidth),N(oe)?le.call(a.stroke,P[j+"color"]).call(i.dashLine,"",P[j+"width"]):U(oe)&&le.call(a.fill,P[j+"color"])})},p.updateDims=function(R,P){var z=this.bounds,F=(P.framewidth||0)/2,B=z[0][0]-F,O=z[0][1]-F,L=z[1][0]-B+F,N=z[1][1]-O+F;i.setRect(this.clipRect,B,O,L,N),this.bgRect.call(i.setRect,B,O,L,N).call(a.fill,P.bgcolor),this.xaxis._offset=B,this.xaxis._length=L,this.yaxis._offset=O,this.yaxis._length=N},p.updateFx=function(R,P){var z=this,F=z.graphDiv,B=z.bgRect,O=R.dragmode,L=R.clickmode;if(z.isStatic)return;function N(){var ue=z.viewInitial,oe={};for(var le in ue)oe[z.id+"."+le]=ue[le];t.call("_guiRelayout",F,oe),F.emit("plotly_doubleclick",null)}function U(ue){return z.projection.invert([ue[0]+z.xaxis._offset,ue[1]+z.yaxis._offset])}var Z=function(ue,oe){if(oe.isRect){var le=ue.range={};le[z.id]=[U([oe.xmin,oe.ymin]),U([oe.xmax,oe.ymax])]}else{var j=ue.lassoPoints={};j[z.id]=oe.map(U)}},Q={element:z.bgRect.node(),gd:F,plotinfo:{id:z.id,xaxis:z.xaxis,yaxis:z.yaxis,fillRangeItems:Z},xaxes:[z.xaxis],yaxes:[z.yaxis],subplot:z.id,clickFn:function(ue){ue===2&&T(F)}};O==="pan"?(B.node().onmousedown=null,B.call(y(z,P)),B.on("dblclick.zoom",N),F._context._scrollZoom.geo||B.on("wheel.zoom",null)):(O==="select"||O==="lasso")&&(B.on(".zoom",null),Q.prepFn=function(ue,oe,le){h(ue,oe,le,Q,O)},v.init(Q)),B.on("mousemove",function(){var ue=z.projection.invert(r.getPositionFromD3Event());if(!ue)return v.unhover(F,d.event);z.xaxis.p2c=function(){return ue[0]},z.yaxis.p2c=function(){return ue[1]},n.hover(F,d.event,z.id)}),B.on("mouseout",function(){F._dragging||v.unhover(F,d.event)}),B.on("click",function(){O!=="select"&&O!=="lasso"&&(L.indexOf("select")>-1&&l(d.event,F,[z.xaxis],[z.yaxis],z.id,Q),L.indexOf("event")>-1&&n.click(F,d.event))})},p.makeFramework=function(){var R=this,P=R.graphDiv,z=P._fullLayout,F="clip"+z._uid+R.id;R.clipDef=z._clips.append("clipPath").attr("id",F),R.clipRect=R.clipDef.append("rect"),R.framework=d.select(R.container).append("g").attr("class","geo "+R.id).call(i.setClipUrl,F,P),R.project=function(B){var O=R.projection(B);return O?[O[0]-R.xaxis._offset,O[1]-R.yaxis._offset]:[null,null]},R.xaxis={_id:"x",c2p:function(B){return R.project(B)[0]}},R.yaxis={_id:"y",c2p:function(B){return R.project(B)[1]}},R.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},c.setConvert(R.mockAxis,z)},p.saveViewInitial=function(R){var P=R.center||{},z=R.projection,F=z.rotation||{};this.viewInitial={fitbounds:R.fitbounds,"projection.scale":z.scale};var B;R._isScoped?B={"center.lon":P.lon,"center.lat":P.lat}:R._isClipped?B={"projection.rotation.lon":F.lon,"projection.rotation.lat":F.lat}:B={"center.lon":P.lon,"center.lat":P.lat,"projection.rotation.lon":F.lon},r.extendFlat(this.viewInitial,B)},p.render=function(R){this._hasMarkerAngles&&R?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},p._render=function(){var R=this.projection,P=R.getPath(),z;function F(O){var L=R(O.lonlat);return L?o(L[0],L[1]):null}function B(O){return R.isLonLatOverEdges(O.lonlat)?"none":null}for(z in this.basePaths)this.basePaths[z].attr("d",P);for(z in this.dataPaths)this.dataPaths[z].attr("d",function(O){return P(O.geojson)});for(z in this.dataPoints)this.dataPoints[z].attr("display",B).attr("transform",F)};function u(R){var P=R.projection,z=P.type,F=b.projNames[z];F="geo"+r.titleCase(F);for(var B=x[F]||e[F],O=B(),L=R._isSatellite?Math.acos(1/P.distance)*180/Math.PI:R._isClipped?b.lonaxisSpan[z]/2:null,N=["center","rotate","parallels","clipExtent"],U=function(ue){return ue?O:[]},Z=0;Zj}else return!1},O.getPath=function(){return A().projection(O)},O.getBounds=function(ue){return O.getPath().bounds(ue)},O.precision(b.precision),R._isSatellite&&O.tilt(P.tilt).distance(P.distance),L&&O.clipAngle(L-b.clipPad),O}function g(R,P,z){var F=1e-6,B=2.5,O=P[R],L=b.scopeDefaults[P.scope],N,U,Z;R==="lonaxis"?(N=L.lonaxisRange,U=L.lataxisRange,Z=function(re,ee){return[re,ee]}):R==="lataxis"&&(N=L.lataxisRange,U=L.lonaxisRange,Z=function(re,ee){return[ee,re]});var Q={type:"linear",range:[N[0],N[1]-F],tick0:O.tick0,dtick:O.dtick};c.setConvert(Q,z);var ue=c.calcTicks(Q);!P.isScoped&&R==="lonaxis"&&ue.pop();for(var oe=ue.length,le=new Array(oe),j=0;j0&&B<0&&(B+=360);var N=(B-F)/4;return{type:"Polygon",coordinates:[[[F,O],[F,L],[F+N,L],[F+2*N,L],[F+3*N,L],[B,L],[B,O],[B-N,O],[B-2*N,O],[B-3*N,O],[F,O]]]}}}}),G3=He({"src/plots/geo/layout_attributes.js"(Y,G){var d=Xc(),x=mu().attributes,A=Nf().dash,E=jy(),e=hu().overrideAll,t=Ud(),r={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:d.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:A},o=G.exports=e({domain:x({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:t(E.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:t(E.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:d.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:E.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:E.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:E.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:E.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:d.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:d.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:d.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:d.background},lonaxis:r,lataxis:r},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}}),wP=He({"src/plots/geo/layout_defaults.js"(Y,G){var d=Gr(),x=Xd(),A=Uf().getSubplotData,E=jy(),e=G3(),t=E.axesNames;G.exports=function(a,i,n){x(a,i,n,{type:"geo",attributes:e,handleDefaults:r,fullData:n,partition:"y"})};function r(o,a,i,n){var s=A(n.fullData,"geo",n.id),c=s.map(function($){return $.index}),f=i("resolution"),v=i("scope"),h=E.scopeDefaults[v],T=i("projection.type",h.projType),l=a._isAlbersUsa=T==="albers usa";l&&(v=a.scope="usa");var y=a._isScoped=v!=="world",b=a._isSatellite=T==="satellite",S=a._isConic=T.indexOf("conic")!==-1||T==="albers",M=a._isClipped=!!E.lonaxisSpan[T];if(o.visible===!1){var _=d.extendDeep({},a._template);_.showcoastlines=!1,_.showcountries=!1,_.showframe=!1,_.showlakes=!1,_.showland=!1,_.showocean=!1,_.showrivers=!1,_.showsubunits=!1,_.lonaxis&&(_.lonaxis.showgrid=!1),_.lataxis&&(_.lataxis.showgrid=!1),a._template=_}for(var w=i("visible"),p,u=0;u0&&U<0&&(U+=360);var Z=(N+U)/2,Q;if(!l){var ue=y?h.projRotate:[Z,0,0];Q=i("projection.rotation.lon",ue[0]),i("projection.rotation.lat",ue[1]),i("projection.rotation.roll",ue[2]),p=i("showcoastlines",!y&&w),p&&(i("coastlinecolor"),i("coastlinewidth")),p=i("showocean",w?void 0:!1),p&&i("oceancolor")}var oe,le;if(l?(oe=-96.6,le=38.7):(oe=y?Z:Q,le=(L[0]+L[1])/2),i("center.lon",oe),i("center.lat",le),b&&(i("projection.tilt"),i("projection.distance")),S){var j=h.projParallels||[0,60];i("projection.parallels",j)}i("projection.scale"),p=i("showland",w?void 0:!1),p&&i("landcolor"),p=i("showlakes",w?void 0:!1),p&&i("lakecolor"),p=i("showrivers",w?void 0:!1),p&&(i("rivercolor"),i("riverwidth")),p=i("showcountries",y&&v!=="usa"&&w),p&&(i("countrycolor"),i("countrywidth")),(v==="usa"||v==="north america"&&f===50)&&(i("showsubunits",w),i("subunitcolor"),i("subunitwidth")),y||(p=i("showframe",w),p&&(i("framecolor"),i("framewidth"))),i("bgcolor");var J=i("fitbounds");J&&(delete a.projection.scale,y?(delete a.center.lon,delete a.center.lat):M?(delete a.center.lon,delete a.center.lat,delete a.projection.rotation.lon,delete a.projection.rotation.lat,delete a.lonaxis.range,delete a.lataxis.range):(delete a.center.lon,delete a.center.lat,delete a.projection.rotation.lon))}}}),W3=He({"src/plots/geo/index.js"(Y,G){var d=Uf().getSubplotCalcData,x=Gr().counterRegex,A=bP(),E="geo",e=x(E),t={};t[E]={valType:"subplotid",dflt:E,editType:"calc"};function r(i){for(var n=i._fullLayout,s=i.calcdata,c=n._subplots[E],f=0;f")}}}}),X_=He({"src/traces/choropleth/event_data.js"(Y,G){G.exports=function(x,A,E,e,t){x.location=A.location,x.z=A.z;var r=e[t];return r.fIn&&r.fIn.properties&&(x.properties=r.fIn.properties),x.ct=r.ct,x}}}),Y_=He({"src/traces/choropleth/select.js"(Y,G){G.exports=function(x,A){var E=x.cd,e=x.xaxis,t=x.yaxis,r=[],o,a,i,n,s;if(A===!1)for(o=0;o=Math.min(U,Z)&&T<=Math.max(U,Z)?0:1/0}if(P=Math.min(Q,ue)&&l<=Math.max(Q,ue)?0:1/0}B=Math.sqrt(P*P+z*z),u=b[R]}}}else for(R=b.length-1;R>-1;R--)p=b[R],g=v[p],m=h[p],P=c.c2p(g)-T,z=f.c2p(m)-l,F=Math.sqrt(P*P+z*z),F100},Y.isDotSymbol=function(d){return typeof d=="string"?G.DOT_RE.test(d):d>200}}}),kP=He({"src/traces/scattergl/defaults.js"(Y,G){var d=Gr(),x=Ei(),A=J_(),E=qy(),e=jv(),t=Rl(),r=j0(),o=Tv(),a=Kh(),i=nv(),n=Av(),s=iv();G.exports=function(f,v,h,T){function l(u,g){return d.coerce(f,v,E,u,g)}var y=f.marker?A.isOpenSymbol(f.marker.symbol):!1,b=t.isBubble(f),S=r(f,v,T,l);if(!S){v.visible=!1;return}o(f,v,T,l),l("xhoverformat"),l("yhoverformat");var M=S>>1,f=r[c],v=a!==void 0?a(f,o):f-o;v>=0?(s=c,n=c-1):i=c+1}return s}function x(r,o,a,i,n){for(var s=n+1;i<=n;){var c=i+n>>>1,f=r[c],v=a!==void 0?a(f,o):f-o;v>0?(s=c,n=c-1):i=c+1}return s}function A(r,o,a,i,n){for(var s=i-1;i<=n;){var c=i+n>>>1,f=r[c],v=a!==void 0?a(f,o):f-o;v<0?(s=c,i=c+1):n=c-1}return s}function E(r,o,a,i,n){for(var s=i-1;i<=n;){var c=i+n>>>1,f=r[c],v=a!==void 0?a(f,o):f-o;v<=0?(s=c,i=c+1):n=c-1}return s}function e(r,o,a,i,n){for(;i<=n;){var s=i+n>>>1,c=r[s],f=a!==void 0?a(c,o):c-o;if(f===0)return s;f<=0?i=s+1:n=s-1}return-1}function t(r,o,a,i,n,s){return typeof a=="function"?s(r,o,a,i===void 0?0:i|0,n===void 0?r.length-1:n|0):s(r,o,void 0,a===void 0?0:a|0,i===void 0?r.length-1:i|0)}G.exports={ge:function(r,o,a,i,n){return t(r,o,a,i,n,d)},gt:function(r,o,a,i,n){return t(r,o,a,i,n,x)},lt:function(r,o,a,i,n){return t(r,o,a,i,n,A)},le:function(r,o,a,i,n){return t(r,o,a,i,n,E)},eq:function(r,o,a,i,n){return t(r,o,a,i,n,e)}}}}),Gv=He({"node_modules/pick-by-alias/index.js"(Y,G){G.exports=function(E,e,t){var r={},o,a;if(typeof e=="string"&&(e=x(e)),Array.isArray(e)){var i={};for(a=0;a1&&(A=arguments),typeof A=="string"?A=A.split(/\s/).map(parseFloat):typeof A=="number"&&(A=[A]),A.length&&typeof A[0]=="number"?A.length===1?E={width:A[0],height:A[0],x:0,y:0}:A.length===2?E={width:A[0],height:A[1],x:0,y:0}:E={x:A[0],y:A[1],width:A[2]-A[0]||0,height:A[3]-A[1]||0}:A&&(A=d(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"}),E={x:A.left||0,y:A.top||0},A.width==null?A.right?E.width=A.right-E.x:E.width=0:E.width=A.width,A.height==null?A.bottom?E.height=A.bottom-E.y:E.height=0:E.height=A.height),E}}}),Xp=He({"node_modules/array-bounds/index.js"(Y,G){G.exports=d;function d(x,A){if(!x||x.length==null)throw Error("Argument should be an array");A==null?A=1:A=Math.floor(A);for(var E=Array(A*2),e=0;et&&(t=x[o]),x[o]>>1,b;v.dtype||(v.dtype="array"),typeof v.dtype=="string"?b=new(a(v.dtype))(y):v.dtype&&(b=v.dtype,Array.isArray(b)&&(b.length=y));for(let P=0;Ph||L>n){for(let re=0;reie||Z>fe||Q<$||ue=oe||q===ae)return;let we=S[ee];ae===void 0&&(ae=we.length);for(let Me=q;Me=B&&ce<=L&&Re>=O&&Re<=N&&le.push(xe)}let Ae=M[ee],Fe=Ae[q*4+0],Ce=Ae[q*4+1],qe=Ae[q*4+2],et=Ae[q*4+3],Qe=J(Ae,q+1),Ke=re*.5,Xe=ee+1;j($,X,Ke,Xe,Fe,Ce||qe||et||Qe),j($,X+Ke,Ke,Xe,Ce,qe||et||Qe),j($+Ke,X,Ke,Xe,qe,et||Qe),j($+Ke,X+Ke,Ke,Xe,et,Qe)}function J($,X){let re=null,ee=0;for(;re===null;)if(re=$[X*4+ee],ee++,ee>$.length)return null;return re}return le}function m(P,z,F,B,O){let L=[];for(let N=0;N1&&(f=1),f<-1&&(f=-1),c*Math.acos(f)},t=function(a,i,n,s,c,f,v,h,T,l,y,b){var S=Math.pow(c,2),M=Math.pow(f,2),_=Math.pow(y,2),w=Math.pow(b,2),p=S*M-S*w-M*_;p<0&&(p=0),p/=S*w+M*_,p=Math.sqrt(p)*(v===h?-1:1);var u=p*c/f*b,g=p*-f/c*y,m=l*u-T*g+(a+n)/2,R=T*u+l*g+(i+s)/2,P=(y-u)/c,z=(b-g)/f,F=(-y-u)/c,B=(-b-g)/f,O=e(1,0,P,z),L=e(P,z,F,B);return h===0&&L>0&&(L-=x),h===1&&L<0&&(L+=x),[m,R,O,L]},r=function(a){var i=a.px,n=a.py,s=a.cx,c=a.cy,f=a.rx,v=a.ry,h=a.xAxisRotation,T=h===void 0?0:h,l=a.largeArcFlag,y=l===void 0?0:l,b=a.sweepFlag,S=b===void 0?0:b,M=[];if(f===0||v===0)return[];var _=Math.sin(T*x/360),w=Math.cos(T*x/360),p=w*(i-s)/2+_*(n-c)/2,u=-_*(i-s)/2+w*(n-c)/2;if(p===0&&u===0)return[];f=Math.abs(f),v=Math.abs(v);var g=Math.pow(p,2)/Math.pow(f,2)+Math.pow(u,2)/Math.pow(v,2);g>1&&(f*=Math.sqrt(g),v*=Math.sqrt(g));var m=t(i,n,s,c,f,v,y,S,_,w,p,u),R=d(m,4),P=R[0],z=R[1],F=R[2],B=R[3],O=Math.abs(B)/(x/4);Math.abs(1-O)<1e-7&&(O=1);var L=Math.max(Math.ceil(O),1);B/=L;for(var N=0;N4?(o=l[l.length-4],a=l[l.length-3]):(o=f,a=v),r.push(l)}return r}function A(e,t,r,o){return["C",e,t,r,o,r,o]}function E(e,t,r,o,a,i){return["C",e/3+2/3*r,t/3+2/3*o,a/3+2/3*r,i/3+2/3*o,a,i]}}}),Y3=He({"node_modules/is-svg-path/index.js"(Y,G){G.exports=function(x){return typeof x!="string"?!1:(x=x.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(x)&&/[\dz]$/i.test(x)&&x.length>4))}}}),OP=He({"node_modules/svg-path-bounds/index.js"(Y,G){var d=Yg(),x=X3(),A=FP(),E=Y3(),e=_y();G.exports=t;function t(r){if(Array.isArray(r)&&r.length===1&&typeof r[0]=="string"&&(r=r[0]),typeof r=="string"&&(e(E(r),"String is not an SVG path."),r=d(r)),e(Array.isArray(r),"Argument should be a string or an array of path segments."),r=x(r),r=A(r),!r.length)return[0,0,0,0];for(var o=[1/0,1/0,-1/0,-1/0],a=0,i=r.length;ao[2]&&(o[2]=n[s+0]),n[s+1]>o[3]&&(o[3]=n[s+1]);return o}}}),BP=He({"node_modules/normalize-svg-path/index.js"(Y,G){var d=Math.PI,x=o(120);G.exports=A;function A(a){for(var i,n=[],s=0,c=0,f=0,v=0,h=null,T=null,l=0,y=0,b=0,S=a.length;b7&&(n.push(M.splice(0,7)),M.unshift("C"));break;case"S":var w=l,p=y;(i=="C"||i=="S")&&(w+=w-s,p+=p-c),M=["C",w,p,M[1],M[2],M[3],M[4]];break;case"T":i=="Q"||i=="T"?(h=l*2-h,T=y*2-T):(h=l,T=y),M=e(l,y,h,T,M[1],M[2]);break;case"Q":h=M[1],T=M[2],M=e(l,y,M[1],M[2],M[3],M[4]);break;case"L":M=E(l,y,M[1],M[2]);break;case"H":M=E(l,y,M[1],y);break;case"V":M=E(l,y,l,M[1]);break;case"Z":M=E(l,y,f,v);break}i=_,l=M[M.length-2],y=M[M.length-1],M.length>4?(s=M[M.length-4],c=M[M.length-3]):(s=l,c=y),n.push(M)}return n}function E(a,i,n,s){return["C",a,i,n,s,n,s]}function e(a,i,n,s,c,f){return["C",a/3+2/3*n,i/3+2/3*s,c/3+2/3*n,f/3+2/3*s,c,f]}function t(a,i,n,s,c,f,v,h,T,l){if(l)m=l[0],R=l[1],u=l[2],g=l[3];else{var y=r(a,i,-c);a=y.x,i=y.y,y=r(h,T,-c),h=y.x,T=y.y;var b=(a-h)/2,S=(i-T)/2,M=b*b/(n*n)+S*S/(s*s);M>1&&(M=Math.sqrt(M),n=M*n,s=M*s);var _=n*n,w=s*s,p=(f==v?-1:1)*Math.sqrt(Math.abs((_*w-_*S*S-w*b*b)/(_*S*S+w*b*b)));p==1/0&&(p=1);var u=p*n*S/s+(a+h)/2,g=p*-s*b/n+(i+T)/2,m=Math.asin(((i-g)/s).toFixed(9)),R=Math.asin(((T-g)/s).toFixed(9));m=aR&&(m=m-d*2),!v&&R>m&&(R=R-d*2)}if(Math.abs(R-m)>x){var P=R,z=h,F=T;R=m+x*(v&&R>m?1:-1),h=u+n*Math.cos(R),T=g+s*Math.sin(R);var B=t(h,T,n,s,c,0,v,z,F,[R,P,u,g])}var O=Math.tan((R-m)/4),L=4/3*n*O,N=4/3*s*O,U=[2*a-(a+L*Math.sin(m)),2*i-(i-N*Math.cos(m)),h+L*Math.sin(R),T-N*Math.cos(R),h,T];if(l)return U;B&&(U=U.concat(B));for(var Z=0;Z0?r.strokeStyle="white":r.strokeStyle="black",r.lineWidth=Math.abs(h)),r.translate(c*.5,f*.5),r.scale(y,y),i()){var b=new Path2D(n);r.fill(b),h&&r.stroke(b)}else{var S=x(n);A(r,S),r.fill(),h&&r.stroke()}r.setTransform(1,0,0,1,0,0);var M=e(r,{cutoff:s.cutoff!=null?s.cutoff:.5,radius:s.radius!=null?s.radius:v*.5});return M}var a;function i(){if(a!=null)return a;var n=document.createElement("canvas").getContext("2d");if(n.canvas.width=n.canvas.height=1,!window.Path2D)return a=!1;var s=new Path2D("M0,0h1v1h-1v-1Z");n.fillStyle="black",n.fill(s);var c=n.getImageData(0,0,1,1);return a=c&&c.data&&c.data[3]===255}}}),Kp=He({"src/traces/scattergl/convert.js"(Y,G){var d=Hi(),x=jP(),A=rp(),E=Ei(),e=Gr(),t=e.isArrayOrTypedArray,r=vo(),o=oc(),a=fd().formatColor,i=Rl(),n=B0(),s=J_(),c=op(),f=Bd().DESELECTDIM,v={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},h=Ph().appendArrayPointValue;function T(B,O){var L,N={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},U=B._context.plotGlPixelRatio;if(O.visible!==!0)return N;if(i.hasText(O)&&(N.text=l(B,O),N.textSel=M(B,O,O.selected),N.textUnsel=M(B,O,O.unselected)),i.hasMarkers(O)&&(N.marker=b(B,O),N.markerSel=S(B,O,O.selected),N.markerUnsel=S(B,O,O.unselected),!O.unselected&&t(O.marker.opacity))){var Z=O.marker.opacity;for(N.markerUnsel.opacity=new Array(Z.length),L=0;L500?"bold":"normal":B}function b(B,O){var L=O._length,N=O.marker,U={},Z,Q=t(N.symbol),ue=t(N.angle),oe=t(N.color),le=t(N.line.color),j=t(N.opacity),J=t(N.size),$=t(N.line.width),X;if(Q||(X=s.isOpenSymbol(N.symbol)),Q||oe||le||j||ue){U.symbols=new Array(L),U.angles=new Array(L),U.colors=new Array(L),U.borderColors=new Array(L);var re=N.symbol,ee=N.angle,q=a(N,N.opacity,L),ae=a(N.line,N.opacity,L);if(!t(ae[0])){var ie=ae;for(ae=Array(L),Z=0;Zc.TOO_MANY_POINTS||i.hasMarkers(O)?"rect":"round";if(le&&O.connectgaps){var J=Z[0],$=Z[1];for(Q=0;Q1?oe[Q]:oe[0]:oe,X=t(le)?le.length>1?le[Q]:le[0]:le,re=v[$],ee=v[X],q=j?j/.8+1:0,ae=-ee*q-ee*.5;Z.offset[Q]=[re*q/J,ae/J]}}return Z}G.exports={style:T,markerStyle:b,markerSelection:S,linePositions:P,errorBarPositions:z,textPosition:F}}}),K3=He({"src/traces/scattergl/scene_update.js"(Y,G){var d=Gr();G.exports=function(A,E){var e=E._scene,t={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},r={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return E._scene||(e=E._scene={},e.init=function(){d.extendFlat(e,r,t)},e.init(),e.update=function(a){var i=d.repeat(a,e.count);if(e.fill2d&&e.fill2d.update(i),e.scatter2d&&e.scatter2d.update(i),e.line2d&&e.line2d.update(i),e.error2d&&e.error2d.update(i.concat(i)),e.select2d&&e.select2d.update(i),e.glText)for(var n=0;n=f,u=w*2,g={},m,R=S.makeCalcdata(y,"x"),P=M.makeCalcdata(y,"y"),z=e(y,S,"x",R),F=e(y,M,"y",P),B=z.vals,O=F.vals;y._x=B,y._y=O,y.xperiodalignment&&(y._origX=R,y._xStarts=z.starts,y._xEnds=z.ends),y.yperiodalignment&&(y._origY=P,y._yStarts=F.starts,y._yEnds=F.ends);var L=new Array(u),N=new Array(w);for(m=0;m1&&x.extendFlat(_.line,n.linePositions(T,y,b)),_.errorX||_.errorY){var w=n.errorBarPositions(T,y,b,S,M);_.errorX&&x.extendFlat(_.errorX,w.x),_.errorY&&x.extendFlat(_.errorY,w.y)}return _.text&&(x.extendFlat(_.text,{positions:b},n.textPosition(T,y,_.text,_.marker)),x.extendFlat(_.textSel,{positions:b},n.textPosition(T,y,_.text,_.markerSel)),x.extendFlat(_.textUnsel,{positions:b},n.textPosition(T,y,_.text,_.markerUnsel))),_}}}),J3=He({"src/traces/scattergl/edit_style.js"(Y,G){var d=Gr(),x=Ai(),A=Bd().DESELECTDIM;function E(e){var t=e[0],r=t.trace,o=t.t,a=o._scene,i=o.index,n=a.selectBatch[i],s=a.unselectBatch[i],c=a.textOptions[i],f=a.textSelectedOptions[i]||{},v=a.textUnselectedOptions[i]||{},h=d.extendFlat({},c),T,l;if(n.length||s.length){var y=f.color,b=v.color,S=c.color,M=d.isArrayOrTypedArray(S);for(h.color=new Array(r._length),T=0;T>>24,r=(E&16711680)>>>16,o=(E&65280)>>>8,a=E&255;return e===!1?[t,r,o,a]:[t/255,r/255,o/255,a/255]}}}),Yc=He({"node_modules/object-assign/index.js"(Y,G){var d=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;function E(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function e(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var r={},o=0;o<10;o++)r["_"+String.fromCharCode(o)]=o;var a=Object.getOwnPropertyNames(r).map(function(n){return r[n]});if(a.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(n){i[n]=n}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}G.exports=e()?Object.assign:function(t,r){for(var o,a=E(t),i,n=1;ng.length)&&(m=g.length);for(var R=0,P=new Array(m);R 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; +} +`]),oe.vert=h([`precision highp float; +#define GLSLIFY 1 + +attribute float x, y, xFract, yFract; +attribute float size, borderSize; +attribute vec4 colorId, borderColorId; +attribute float isActive; + +// \`invariant\` effectively turns off optimizations for the position. +// We need this because -fast-math on M1 Macs is re-ordering +// floating point operations in a way that causes floating point +// precision limits to put points in the wrong locations. +invariant gl_Position; + +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; +} +`]),b&&(oe.frag=oe.frag.replace("smoothstep","smoothStep"),ue.frag=ue.frag.replace("smoothstep","smoothStep")),this.drawCircle=g(oe)}w.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},w.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},w.prototype.draw=function(){for(var g=this,m=arguments.length,R=new Array(m),P=0;Pxe)?Xe.tree=f(Ke,{bounds:Je}):xe&&xe.length&&(Xe.tree=xe),Xe.tree){var At={primitive:"points",usage:"static",data:Xe.tree,type:"uint32"};Xe.elements?Xe.elements(At):Xe.elements=B.elements(At)}var St=S.float32(Ke);ce({data:St,usage:"dynamic"});var Rt=S.fract32(Ke,St);return Re({data:Rt,usage:"dynamic"}),$e({data:new Uint8Array(rt),type:"uint8",usage:"stream"}),Ke}},{marker:function(Ke,Xe,Me){var xe=Xe.activation;if(xe.forEach(function(Rt){return Rt&&Rt.destroy&&Rt.destroy()}),xe.length=0,!Ke||typeof Ke[0]=="number"){var ce=g.addMarker(Ke);xe[ce]=!0}else{for(var Re=[],$e=0,rt=Math.min(Ke.length,Xe.count);$e=0)return z;var F;if(g instanceof Uint8Array||g instanceof Uint8ClampedArray)F=g;else{F=new Uint8Array(g.length);for(var B=0,O=g.length;BP*4&&(this.tooManyColors=!0),this.updatePalette(R),z.length===1?z[0]:z},w.prototype.updatePalette=function(g){if(!this.tooManyColors){var m=this.maxColors,R=this.paletteTexture,P=Math.ceil(g.length*.25/m);if(P>1){g=g.slice();for(var z=g.length*.25%m;z80*L){ue=le=B[0],oe=j=B[1];for(var re=L;rele&&(le=J),$>j&&(j=$);X=Math.max(le-ue,j-oe),X=X!==0?32767/X:0}return E(Z,Q,L,ue,oe,X,0),Q}function x(B,O,L,N,U){var Z,Q;if(U===F(B,O,L,N)>0)for(Z=O;Z=O;Z-=N)Q=R(Z,B[Z],B[Z+1],Q);return Q&&S(Q,Q.next)&&(P(Q),Q=Q.next),Q}function A(B,O){if(!B)return B;O||(O=B);var L=B,N;do if(N=!1,!L.steiner&&(S(L,L.next)||b(L.prev,L,L.next)===0)){if(P(L),L=O=L.prev,L===L.next)break;N=!0}else L=L.next;while(N||L!==O);return O}function E(B,O,L,N,U,Z,Q){if(B){!Q&&Z&&f(B,N,U,Z);for(var ue=B,oe,le;B.prev!==B.next;){if(oe=B.prev,le=B.next,Z?t(B,N,U,Z):e(B)){O.push(oe.i/L|0),O.push(B.i/L|0),O.push(le.i/L|0),P(B),B=le.next,ue=le.next;continue}if(B=le,B===ue){Q?Q===1?(B=r(A(B),O,L),E(B,O,L,N,U,Z,2)):Q===2&&o(B,O,L,N,U,Z):E(A(B),O,L,N,U,Z,1);break}}}}function e(B){var O=B.prev,L=B,N=B.next;if(b(O,L,N)>=0)return!1;for(var U=O.x,Z=L.x,Q=N.x,ue=O.y,oe=L.y,le=N.y,j=UZ?U>Q?U:Q:Z>Q?Z:Q,X=ue>oe?ue>le?ue:le:oe>le?oe:le,re=N.next;re!==O;){if(re.x>=j&&re.x<=$&&re.y>=J&&re.y<=X&&l(U,ue,Z,oe,Q,le,re.x,re.y)&&b(re.prev,re,re.next)>=0)return!1;re=re.next}return!0}function t(B,O,L,N){var U=B.prev,Z=B,Q=B.next;if(b(U,Z,Q)>=0)return!1;for(var ue=U.x,oe=Z.x,le=Q.x,j=U.y,J=Z.y,$=Q.y,X=ueoe?ue>le?ue:le:oe>le?oe:le,q=j>J?j>$?j:$:J>$?J:$,ae=h(X,re,O,L,N),ie=h(ee,q,O,L,N),fe=B.prevZ,we=B.nextZ;fe&&fe.z>=ae&&we&&we.z<=ie;){if(fe.x>=X&&fe.x<=ee&&fe.y>=re&&fe.y<=q&&fe!==U&&fe!==Q&&l(ue,j,oe,J,le,$,fe.x,fe.y)&&b(fe.prev,fe,fe.next)>=0||(fe=fe.prevZ,we.x>=X&&we.x<=ee&&we.y>=re&&we.y<=q&&we!==U&&we!==Q&&l(ue,j,oe,J,le,$,we.x,we.y)&&b(we.prev,we,we.next)>=0))return!1;we=we.nextZ}for(;fe&&fe.z>=ae;){if(fe.x>=X&&fe.x<=ee&&fe.y>=re&&fe.y<=q&&fe!==U&&fe!==Q&&l(ue,j,oe,J,le,$,fe.x,fe.y)&&b(fe.prev,fe,fe.next)>=0)return!1;fe=fe.prevZ}for(;we&&we.z<=ie;){if(we.x>=X&&we.x<=ee&&we.y>=re&&we.y<=q&&we!==U&&we!==Q&&l(ue,j,oe,J,le,$,we.x,we.y)&&b(we.prev,we,we.next)>=0)return!1;we=we.nextZ}return!0}function r(B,O,L){var N=B;do{var U=N.prev,Z=N.next.next;!S(U,Z)&&M(U,N,N.next,Z)&&u(U,Z)&&u(Z,U)&&(O.push(U.i/L|0),O.push(N.i/L|0),O.push(Z.i/L|0),P(N),P(N.next),N=B=Z),N=N.next}while(N!==B);return A(N)}function o(B,O,L,N,U,Z){var Q=B;do{for(var ue=Q.next.next;ue!==Q.prev;){if(Q.i!==ue.i&&y(Q,ue)){var oe=m(Q,ue);Q=A(Q,Q.next),oe=A(oe,oe.next),E(Q,O,L,N,U,Z,0),E(oe,O,L,N,U,Z,0);return}ue=ue.next}Q=Q.next}while(Q!==B)}function a(B,O,L,N){var U=[],Z,Q,ue,oe,le;for(Z=0,Q=O.length;Z=L.next.y&&L.next.y!==L.y){var ue=L.x+(U-L.y)*(L.next.x-L.x)/(L.next.y-L.y);if(ue<=N&&ue>Z&&(Z=ue,Q=L.x=L.x&&L.x>=le&&N!==L.x&&l(UQ.x||L.x===Q.x&&c(Q,L)))&&(Q=L,J=$)),L=L.next;while(L!==oe);return Q}function c(B,O){return b(B.prev,B,O.prev)<0&&b(O.next,B,B.next)<0}function f(B,O,L,N){var U=B;do U.z===0&&(U.z=h(U.x,U.y,O,L,N)),U.prevZ=U.prev,U.nextZ=U.next,U=U.next;while(U!==B);U.prevZ.nextZ=null,U.prevZ=null,v(U)}function v(B){var O,L,N,U,Z,Q,ue,oe,le=1;do{for(L=B,B=null,Z=null,Q=0;L;){for(Q++,N=L,ue=0,O=0;O0||oe>0&&N;)ue!==0&&(oe===0||!N||L.z<=N.z)?(U=L,L=L.nextZ,ue--):(U=N,N=N.nextZ,oe--),Z?Z.nextZ=U:B=U,U.prevZ=Z,Z=U;L=N}Z.nextZ=null,le*=2}while(Q>1);return B}function h(B,O,L,N,U){return B=(B-L)*U|0,O=(O-N)*U|0,B=(B|B<<8)&16711935,B=(B|B<<4)&252645135,B=(B|B<<2)&858993459,B=(B|B<<1)&1431655765,O=(O|O<<8)&16711935,O=(O|O<<4)&252645135,O=(O|O<<2)&858993459,O=(O|O<<1)&1431655765,B|O<<1}function T(B){var O=B,L=B;do(O.x=(B-Q)*(Z-ue)&&(B-Q)*(N-ue)>=(L-Q)*(O-ue)&&(L-Q)*(Z-ue)>=(U-Q)*(N-ue)}function y(B,O){return B.next.i!==O.i&&B.prev.i!==O.i&&!p(B,O)&&(u(B,O)&&u(O,B)&&g(B,O)&&(b(B.prev,B,O.prev)||b(B,O.prev,O))||S(B,O)&&b(B.prev,B,B.next)>0&&b(O.prev,O,O.next)>0)}function b(B,O,L){return(O.y-B.y)*(L.x-O.x)-(O.x-B.x)*(L.y-O.y)}function S(B,O){return B.x===O.x&&B.y===O.y}function M(B,O,L,N){var U=w(b(B,O,L)),Z=w(b(B,O,N)),Q=w(b(L,N,B)),ue=w(b(L,N,O));return!!(U!==Z&&Q!==ue||U===0&&_(B,L,O)||Z===0&&_(B,N,O)||Q===0&&_(L,B,N)||ue===0&&_(L,O,N))}function _(B,O,L){return O.x<=Math.max(B.x,L.x)&&O.x>=Math.min(B.x,L.x)&&O.y<=Math.max(B.y,L.y)&&O.y>=Math.min(B.y,L.y)}function w(B){return B>0?1:B<0?-1:0}function p(B,O){var L=B;do{if(L.i!==B.i&&L.next.i!==B.i&&L.i!==O.i&&L.next.i!==O.i&&M(L,L.next,B,O))return!0;L=L.next}while(L!==B);return!1}function u(B,O){return b(B.prev,B,B.next)<0?b(B,O,B.next)>=0&&b(B,B.prev,O)>=0:b(B,O,B.prev)<0||b(B,B.next,O)<0}function g(B,O){var L=B,N=!1,U=(B.x+O.x)/2,Z=(B.y+O.y)/2;do L.y>Z!=L.next.y>Z&&L.next.y!==L.y&&U<(L.next.x-L.x)*(Z-L.y)/(L.next.y-L.y)+L.x&&(N=!N),L=L.next;while(L!==B);return N}function m(B,O){var L=new z(B.i,B.x,B.y),N=new z(O.i,O.x,O.y),U=B.next,Z=O.prev;return B.next=O,O.prev=B,L.next=U,U.prev=L,N.next=L,L.prev=N,Z.next=N,N.prev=Z,N}function R(B,O,L,N){var U=new z(B,O,L);return N?(U.next=N.next,U.prev=N,N.next.prev=U,N.next=U):(U.prev=U,U.next=U),U}function P(B){B.next.prev=B.prev,B.prev.next=B.next,B.prevZ&&(B.prevZ.nextZ=B.nextZ),B.nextZ&&(B.nextZ.prevZ=B.prevZ)}function z(B,O,L){this.i=B,this.x=O,this.y=L,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}d.deviation=function(B,O,L,N){var U=O&&O.length,Z=U?O[0]*L:B.length,Q=Math.abs(F(B,0,Z,L));if(U)for(var ue=0,oe=O.length;ue0&&(N+=B[U-1].length,L.holes.push(N))}return L}}}),XP=He({"node_modules/array-normalize/index.js"(Y,G){var d=Xp();G.exports=x;function x(A,E,e){if(!A||A.length==null)throw Error("Argument should be an array");E==null&&(E=1),e==null&&(e=d(A,E));for(var t=0;t-1}}}),oT=He({"node_modules/es5-ext/string/#/contains/index.js"(Y,G){G.exports=s6()()?String.prototype.contains:l6()}}),vd=He({"node_modules/d/index.js"(Y,G){var d=Jp(),x=nT(),A=rx(),E=iT(),e=oT(),t=G.exports=function(r,o){var a,i,n,s,c;return arguments.length<2||typeof r!="string"?(s=o,o=r,r=null):s=arguments[2],d(r)?(a=e.call(r,"c"),i=e.call(r,"e"),n=e.call(r,"w")):(a=n=!0,i=!1),c={value:o,configurable:a,enumerable:i,writable:n},s?A(E(s),c):c};t.gs=function(r,o,a){var i,n,s,c;return typeof r!="string"?(s=a,a=o,o=r,r=null):s=arguments[3],d(o)?x(o)?d(a)?x(a)||(s=a,a=void 0):a=void 0:(s=o,o=a=void 0):o=void 0,d(r)?(i=e.call(r,"c"),n=e.call(r,"e")):(i=!0,n=!1),c={get:o,set:a,configurable:i,enumerable:n},s?A(E(s),c):c}}}),Hy=He({"node_modules/es5-ext/function/is-arguments.js"(Y,G){var d=Object.prototype.toString,x=d.call(function(){return arguments}());G.exports=function(A){return d.call(A)===x}}}),Gy=He({"node_modules/es5-ext/string/is-string.js"(Y,G){var d=Object.prototype.toString,x=d.call("");G.exports=function(A){return typeof A=="string"||A&&typeof A=="object"&&(A instanceof String||d.call(A)===x)||!1}}}),u6=He({"node_modules/ext/global-this/is-implemented.js"(Y,G){G.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}}),c6=He({"node_modules/ext/global-this/implementation.js"(Y,G){var d=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};G.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return d()}try{return __global__||d()}finally{delete Object.prototype.__global__}}()}}),Wy=He({"node_modules/ext/global-this/index.js"(Y,G){G.exports=u6()()?globalThis:c6()}}),f6=He({"node_modules/es6-symbol/is-implemented.js"(Y,G){var d=Wy(),x={object:!0,symbol:!0};G.exports=function(){var A=d.Symbol,E;if(typeof A!="function")return!1;E=A("test symbol");try{String(E)}catch{return!1}return!(!x[typeof A.iterator]||!x[typeof A.toPrimitive]||!x[typeof A.toStringTag])}}}),h6=He({"node_modules/es6-symbol/is-symbol.js"(Y,G){G.exports=function(d){return d?typeof d=="symbol"?!0:!d.constructor||d.constructor.name!=="Symbol"?!1:d[d.constructor.toStringTag]==="Symbol":!1}}}),sT=He({"node_modules/es6-symbol/validate-symbol.js"(Y,G){var d=h6();G.exports=function(x){if(!d(x))throw new TypeError(x+" is not a symbol");return x}}}),v6=He({"node_modules/es6-symbol/lib/private/generate-name.js"(Y,G){var d=vd(),x=Object.create,A=Object.defineProperty,E=Object.prototype,e=x(null);G.exports=function(t){for(var r=0,o,a;e[t+(r||"")];)++r;return t+=r||"",e[t]=!0,o="@@"+t,A(E,o,d.gs(null,function(i){a||(a=!0,A(this,o,d(i)),a=!1)})),o}}}),d6=He({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(Y,G){var d=vd(),x=Wy().Symbol;G.exports=function(A){return Object.defineProperties(A,{hasInstance:d("",x&&x.hasInstance||A("hasInstance")),isConcatSpreadable:d("",x&&x.isConcatSpreadable||A("isConcatSpreadable")),iterator:d("",x&&x.iterator||A("iterator")),match:d("",x&&x.match||A("match")),replace:d("",x&&x.replace||A("replace")),search:d("",x&&x.search||A("search")),species:d("",x&&x.species||A("species")),split:d("",x&&x.split||A("split")),toPrimitive:d("",x&&x.toPrimitive||A("toPrimitive")),toStringTag:d("",x&&x.toStringTag||A("toStringTag")),unscopables:d("",x&&x.unscopables||A("unscopables"))})}}}),p6=He({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(Y,G){var d=vd(),x=sT(),A=Object.create(null);G.exports=function(E){return Object.defineProperties(E,{for:d(function(e){return A[e]?A[e]:A[e]=E(String(e))}),keyFor:d(function(e){var t;x(e);for(t in A)if(A[t]===e)return t})})}}}),g6=He({"node_modules/es6-symbol/polyfill.js"(Y,G){var d=vd(),x=sT(),A=Wy().Symbol,E=v6(),e=d6(),t=p6(),r=Object.create,o=Object.defineProperties,a=Object.defineProperty,i,n,s;if(typeof A=="function")try{String(A()),s=!0}catch{}else A=null;n=function(f){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return i(f)},G.exports=i=function c(f){var v;if(this instanceof c)throw new TypeError("Symbol is not a constructor");return s?A(f):(v=r(n.prototype),f=f===void 0?"":String(f),o(v,{__description__:d("",f),__name__:d("",E(f))}))},e(i),t(i),o(n.prototype,{constructor:d(i),toString:d("",function(){return this.__name__})}),o(i.prototype,{toString:d(function(){return"Symbol ("+x(this).__description__+")"}),valueOf:d(function(){return x(this)})}),a(i.prototype,i.toPrimitive,d("",function(){var c=x(this);return typeof c=="symbol"?c:c.toString()})),a(i.prototype,i.toStringTag,d("c","Symbol")),a(n.prototype,i.toStringTag,d("c",i.prototype[i.toStringTag])),a(n.prototype,i.toPrimitive,d("c",i.prototype[i.toPrimitive]))}}),lp=He({"node_modules/es6-symbol/index.js"(Y,G){G.exports=f6()()?Wy().Symbol:g6()}}),y6=He({"node_modules/es5-ext/array/#/clear.js"(Y,G){var d=hd();G.exports=function(){return d(this).length=0,this}}}),fg=He({"node_modules/es5-ext/object/valid-callable.js"(Y,G){G.exports=function(d){if(typeof d!="function")throw new TypeError(d+" is not a function");return d}}}),m6=He({"node_modules/type/string/coerce.js"(Y,G){var d=Jp(),x=tx(),A=Object.prototype.toString;G.exports=function(E){if(!d(E))return null;if(x(E)){var e=E.toString;if(typeof e!="function"||e===A)return null}try{return""+E}catch{return null}}}}),_6=He({"node_modules/type/lib/safe-to-string.js"(Y,G){G.exports=function(d){try{return d.toString()}catch{try{return String(d)}catch{return null}}}}}),x6=He({"node_modules/type/lib/to-short-string.js"(Y,G){var d=_6(),x=/[\n\r\u2028\u2029]/g;G.exports=function(A){var E=d(A);return E===null?"":(E.length>100&&(E=E.slice(0,99)+"…"),E=E.replace(x,function(e){switch(e){case` +`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),E)}}}),lT=He({"node_modules/type/lib/resolve-exception.js"(Y,G){var d=Jp(),x=tx(),A=m6(),E=x6(),e=function(t,r){return t.replace("%v",E(r))};G.exports=function(t,r,o){if(!x(o))throw new TypeError(e(r,t));if(!d(t)){if("default"in o)return o.default;if(o.isOptional)return null}var a=A(o.errorMessage);throw d(a)||(a=r),new TypeError(e(a,t))}}}),b6=He({"node_modules/type/value/ensure.js"(Y,G){var d=lT(),x=Jp();G.exports=function(A){return x(A)?A:d(A,"Cannot use %v",arguments[1])}}}),w6=He({"node_modules/type/plain-function/ensure.js"(Y,G){var d=lT(),x=nT();G.exports=function(A){return x(A)?A:d(A,"%v is not a plain function",arguments[1])}}}),T6=He({"node_modules/es5-ext/array/from/is-implemented.js"(Y,G){G.exports=function(){var d=Array.from,x,A;return typeof d!="function"?!1:(x=["raz","dwa"],A=d(x),!!(A&&A!==x&&A[1]==="dwa"))}}}),A6=He({"node_modules/es5-ext/function/is-function.js"(Y,G){var d=Object.prototype.toString,x=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);G.exports=function(A){return typeof A=="function"&&x(d.call(A))}}}),S6=He({"node_modules/es5-ext/math/sign/is-implemented.js"(Y,G){G.exports=function(){var d=Math.sign;return typeof d!="function"?!1:d(10)===1&&d(-20)===-1}}}),M6=He({"node_modules/es5-ext/math/sign/shim.js"(Y,G){G.exports=function(d){return d=Number(d),isNaN(d)||d===0?d:d>0?1:-1}}}),E6=He({"node_modules/es5-ext/math/sign/index.js"(Y,G){G.exports=S6()()?Math.sign:M6()}}),k6=He({"node_modules/es5-ext/number/to-integer.js"(Y,G){var d=E6(),x=Math.abs,A=Math.floor;G.exports=function(E){return isNaN(E)?0:(E=Number(E),E===0||!isFinite(E)?E:d(E)*A(x(E)))}}}),C6=He({"node_modules/es5-ext/number/to-pos-integer.js"(Y,G){var d=k6(),x=Math.max;G.exports=function(A){return x(0,d(A))}}}),L6=He({"node_modules/es5-ext/array/from/shim.js"(Y,G){var d=lp().iterator,x=Hy(),A=A6(),E=C6(),e=fg(),t=hd(),r=sp(),o=Gy(),a=Array.isArray,i=Function.prototype.call,n={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;G.exports=function(c){var f=arguments[1],v=arguments[2],h,T,l,y,b,S,M,_,w,p;if(c=Object(t(c)),r(f)&&e(f),!this||this===Array||!A(this)){if(!f){if(x(c))return b=c.length,b!==1?Array.apply(null,c):(y=new Array(1),y[0]=c[0],y);if(a(c)){for(y=new Array(b=c.length),T=0;T=55296&&S<=56319&&(p+=c[++T])),p=f?i.call(f,v,p,l):p,h?(n.value=p,s(y,l,n)):y[l]=p,++l;b=l}}if(b===void 0)for(b=E(c.length),h&&(y=new h(b)),T=0;T=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){o(this,"__redo__",e("c",[n]));return}this.__redo__.forEach(function(s,c){s>=n&&(this.__redo__[c]=++s)},this),this.__redo__.push(n)}}),_onDelete:e(function(n){var s;n>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(s=this.__redo__.indexOf(n),s!==-1&&this.__redo__.splice(s,1),this.__redo__.forEach(function(c,f){c>n&&(this.__redo__[f]=--c)},this)))}),_onClear:e(function(){this.__redo__&&d.call(this.__redo__),this.__nextIndex__=0})}))),o(i.prototype,r.iterator,e(function(){return this}))}}),O6=He({"node_modules/es6-iterator/array.js"(Y,G){var d=ex(),x=oT(),A=vd(),E=lp(),e=uT(),t=Object.defineProperty,r;r=G.exports=function(o,a){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e.call(this,o),a?x.call(a,"key+value")?a="key+value":x.call(a,"key")?a="key":a="value":a="value",t(this,"__kind__",A("",a))},d&&d(r,e),delete r.prototype.constructor,r.prototype=Object.create(e.prototype,{_resolve:A(function(o){return this.__kind__==="value"?this.__list__[o]:this.__kind__==="key+value"?[o,this.__list__[o]]:o})}),t(r.prototype,E.toStringTag,A("c","Array Iterator"))}}),B6=He({"node_modules/es6-iterator/string.js"(Y,G){var d=ex(),x=vd(),A=lp(),E=uT(),e=Object.defineProperty,t;t=G.exports=function(r){if(!(this instanceof t))throw new TypeError("Constructor requires 'new'");r=String(r),E.call(this,r),e(this,"__length__",x("",r.length))},d&&d(t,E),delete t.prototype.constructor,t.prototype=Object.create(E.prototype,{_next:x(function(){if(this.__list__){if(this.__nextIndex__=55296&&a<=56319?o+this.__list__[this.__nextIndex__++]:o)})}),e(t.prototype,A.toStringTag,x("c","String Iterator"))}}),N6=He({"node_modules/es6-iterator/is-iterable.js"(Y,G){var d=Hy(),x=sp(),A=Gy(),E=lp().iterator,e=Array.isArray;G.exports=function(t){return x(t)?e(t)||A(t)||d(t)?!0:typeof t[E]=="function":!1}}}),U6=He({"node_modules/es6-iterator/valid-iterable.js"(Y,G){var d=N6();G.exports=function(x){if(!d(x))throw new TypeError(x+" is not iterable");return x}}}),cT=He({"node_modules/es6-iterator/get.js"(Y,G){var d=Hy(),x=Gy(),A=O6(),E=B6(),e=U6(),t=lp().iterator;G.exports=function(r){return typeof e(r)[t]=="function"?r[t]():d(r)?new A(r):x(r)?new E(r):new A(r)}}}),j6=He({"node_modules/es6-iterator/for-of.js"(Y,G){var d=Hy(),x=fg(),A=Gy(),E=cT(),e=Array.isArray,t=Function.prototype.call,r=Array.prototype.some;G.exports=function(o,a){var i,n=arguments[2],s,c,f,v,h,T,l;if(e(o)||d(o)?i="array":A(o)?i="string":o=E(o),x(a),c=function(){f=!0},i==="array"){r.call(o,function(y){return t.call(a,n,y,c),f});return}if(i==="string"){for(h=o.length,v=0;v=55296&&l<=56319&&(T+=o[++v])),t.call(a,n,T,c),!f);++v);return}for(s=o.next();!s.done;){if(t.call(a,n,s.value,c),f)return;s=o.next()}}}}),V6=He({"node_modules/es6-weak-map/is-native-implemented.js"(Y,G){G.exports=function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"}()}}),q6=He({"node_modules/es6-weak-map/polyfill.js"(Y,G){var d=sp(),x=ex(),A=$P(),E=hd(),e=QP(),t=vd(),r=cT(),o=j6(),a=lp().toStringTag,i=V6(),n=Array.isArray,s=Object.defineProperty,c=Object.prototype.hasOwnProperty,f=Object.getPrototypeOf,v;G.exports=v=function(){var h=arguments[0],T;if(!(this instanceof v))throw new TypeError("Constructor requires 'new'");return T=i&&x&&WeakMap!==v?x(new WeakMap,f(this)):this,d(h)&&(n(h)||(h=r(h))),s(T,"__weakMapData__",t("c","$weakMap$"+e())),h&&o(h,function(l){E(l),T.set(l[0],l[1])}),T},i&&(x&&x(v,WeakMap),v.prototype=Object.create(WeakMap.prototype,{constructor:t(v)})),Object.defineProperties(v.prototype,{delete:t(function(h){return c.call(A(h),this.__weakMapData__)?(delete h[this.__weakMapData__],!0):!1}),get:t(function(h){if(c.call(A(h),this.__weakMapData__))return h[this.__weakMapData__]}),has:t(function(h){return c.call(A(h),this.__weakMapData__)}),set:t(function(h,T){return s(A(h),this.__weakMapData__,t("c",T)),this}),toString:t(function(){return"[object WeakMap]"})}),s(v.prototype,a,t("c","WeakMap"))}}),fT=He({"node_modules/es6-weak-map/index.js"(Y,G){G.exports=YP()()?WeakMap:q6()}}),H6=He({"node_modules/array-find-index/index.js"(Y,G){G.exports=function(d,x,A){if(typeof Array.prototype.findIndex=="function")return d.findIndex(x,A);if(typeof x!="function")throw new TypeError("predicate must be a function");var E=Object(d),e=E.length;if(e===0)return-1;for(var t=0;t 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; + } + } +} +`,l=` +precision highp float; + +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; +} +`;G.exports=y;function y(b,S){if(!(this instanceof y))return new y(b,S);if(typeof b=="function"?(S||(S={}),S.regl=b):S=b,S.length&&(S.positions=S),b=S.regl,!b.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=b._gl,this.regl=b,this.passes=[],this.shaders=y.shaders.has(b)?y.shaders.get(b):y.shaders.set(b,y.createShaders(b)).get(b),this.update(S)}y.dashMult=2,y.maxPatternLength=256,y.precisionThreshold=3e6,y.maxPoints=1e4,y.maxLines=2048,y.shaders=new i,y.createShaders=function(b){let S=b.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),M={primitive:"triangle strip",instances:b.prop("count"),count:4,offset:0,uniforms:{miterMode:(u,g)=>g.join==="round"?2:1,miterLimit:b.prop("miterLimit"),scale:b.prop("scale"),scaleFract:b.prop("scaleFract"),translateFract:b.prop("translateFract"),translate:b.prop("translate"),thickness:b.prop("thickness"),dashTexture:b.prop("dashTexture"),opacity:b.prop("opacity"),pixelRatio:b.context("pixelRatio"),id:b.prop("id"),dashLength:b.prop("dashLength"),viewport:(u,g)=>[g.viewport.x,g.viewport.y,u.viewportWidth,u.viewportHeight],depth:b.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(u,g)=>!g.overlay},stencil:{enable:!1},scissor:{enable:!0,box:b.prop("viewport")},viewport:b.prop("viewport")},_=b(A({vert:c,frag:f,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:b.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:b.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:b.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},M)),w;try{w=b(A({cull:{enable:!0,face:"back"},vert:T,frag:l,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aColor:{buffer:b.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:b.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},M))}catch{w=_}return{fill:b({primitive:"triangle",elements:(u,g)=>g.triangles,offset:0,vert:v,frag:h,uniforms:{scale:b.prop("scale"),color:b.prop("fill"),scaleFract:b.prop("scaleFract"),translateFract:b.prop("translateFract"),translate:b.prop("translate"),opacity:b.prop("opacity"),pixelRatio:b.context("pixelRatio"),id:b.prop("id"),viewport:(u,g)=>[g.viewport.x,g.viewport.y,u.viewportWidth,u.viewportHeight]},attributes:{position:{buffer:b.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:b.prop("positionFractBuffer"),stride:8,offset:8}},blend:M.blend,depth:{enable:!1},scissor:M.scissor,stencil:M.stencil,viewport:M.viewport}),rect:_,miter:w}},y.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},y.prototype.render=function(...b){b.length&&this.update(...b),this.draw()},y.prototype.draw=function(...b){return(b.length?b:this.passes).forEach((S,M)=>{if(S&&Array.isArray(S))return this.draw(...S);typeof S=="number"&&(S=this.passes[S]),S&&S.count>1&&S.opacity&&(this.regl._refresh(),S.fill&&S.triangles&&S.triangles.length>2&&this.shaders.fill(S),S.thickness&&(S.scale[0]*S.viewport.width>y.precisionThreshold||S.scale[1]*S.viewport.height>y.precisionThreshold?this.shaders.rect(S):S.join==="rect"||!S.join&&(S.thickness<=2||S.count>=y.maxPoints)?this.shaders.rect(S):this.shaders.miter(S)))}),this},y.prototype.update=function(b){if(!b)return;b.length!=null?typeof b[0]=="number"&&(b=[{positions:b}]):Array.isArray(b)||(b=[b]);let{regl:S,gl:M}=this;if(b.forEach((w,p)=>{let u=this.passes[p];if(w!==void 0){if(w===null){this.passes[p]=null;return}if(typeof w[0]=="number"&&(w={positions:w}),w=E(w,{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"}),u||(this.passes[p]=u={id:p,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:S.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:S.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:S.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:S.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},w=A({},y.defaults,w)),w.thickness!=null&&(u.thickness=parseFloat(w.thickness)),w.opacity!=null&&(u.opacity=parseFloat(w.opacity)),w.miterLimit!=null&&(u.miterLimit=parseFloat(w.miterLimit)),w.overlay!=null&&(u.overlay=!!w.overlay,poe-le),Z=[],Q=0,ue=u.hole!=null?u.hole[0]:null;if(ue!=null){let oe=s(U,le=>le>=ue);U=U.slice(0,oe),U.push(ue)}for(let oe=0;oe$-ue+(U[oe]-Q)),J=t(le,j);J=J.map($=>$+Q+($+Q{b.colorBuffer.destroy(),b.positionBuffer.destroy(),b.dashTexture.destroy()}),this.passes.length=0,this}}}),G6=He({"node_modules/regl-error2d/index.js"(Y,G){var d=Xp(),x=rp(),A=Q3(),E=Gv(),e=Yc(),t=Yp(),{float32:r,fract32:o}=Q_();G.exports=i;var a=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function i(n,s){if(typeof n=="function"?(s||(s={}),s.regl=n):s=n,s.length&&(s.positions=s),n=s.regl,!n.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let c=n._gl,f,v,h,T,l,y,b={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},S=[];return T=n.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),v=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),h=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),l=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),y=n.buffer({usage:"static",type:"float",data:a}),p(s),f=n({vert:` + precision highp float; + + attribute vec2 position, positionFract; + attribute vec4 error; + attribute vec4 color; + + attribute vec2 direction, lineOffset, capOffset; + + uniform vec4 viewport; + uniform float lineWidth, capSize; + uniform vec2 scale, scaleFract, translate, translateFract; + + varying vec4 fragColor; + + void main() { + fragColor = color / 255.; + + vec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset; + + vec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw; + + vec2 position = position + dxy; + + vec2 pos = (position + translate) * scale + + (positionFract + translateFract) * scale + + (position + translate) * scaleFract + + (positionFract + translateFract) * scaleFract; + + pos += pixelOffset / viewport.zw; + + gl_Position = vec4(pos * 2. - 1., 0, 1); + } + `,frag:` + precision highp float; + + varying vec4 fragColor; + + uniform float opacity; + + void main() { + gl_FragColor = fragColor; + gl_FragColor.a *= opacity; + } + `,uniforms:{range:n.prop("range"),lineWidth:n.prop("lineWidth"),capSize:n.prop("capSize"),opacity:n.prop("opacity"),scale:n.prop("scale"),translate:n.prop("translate"),scaleFract:n.prop("scaleFract"),translateFract:n.prop("translateFract"),viewport:(g,m)=>[m.viewport.x,m.viewport.y,g.viewportWidth,g.viewportHeight]},attributes:{color:{buffer:T,offset:(g,m)=>m.offset*4,divisor:1},position:{buffer:v,offset:(g,m)=>m.offset*8,divisor:1},positionFract:{buffer:h,offset:(g,m)=>m.offset*8,divisor:1},error:{buffer:l,offset:(g,m)=>m.offset*16,divisor:1},direction:{buffer:y,stride:24,offset:0},lineOffset:{buffer:y,stride:24,offset:8},capOffset:{buffer:y,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:n.prop("viewport")},viewport:n.prop("viewport"),stencil:!1,instances:n.prop("count"),count:a.length}),e(M,{update:p,draw:_,destroy:u,regl:n,gl:c,canvas:c.canvas,groups:S}),M;function M(g){g?p(g):g===null&&u(),_()}function _(g){if(typeof g=="number")return w(g);g&&!Array.isArray(g)&&(g=[g]),n._refresh(),S.forEach((m,R)=>{if(m){if(g&&(g[R]?m.draw=!0:m.draw=!1),!m.draw){m.draw=!0;return}w(R)}})}function w(g){typeof g=="number"&&(g=S[g]),g!=null&&g&&g.count&&g.color&&g.opacity&&g.positions&&g.positions.length>1&&(g.scaleRatio=[g.scale[0]*g.viewport.width,g.scale[1]*g.viewport.height],f(g),g.after&&g.after(g))}function p(g){if(!g)return;g.length!=null?typeof g[0]=="number"&&(g=[{positions:g}]):Array.isArray(g)||(g=[g]);let m=0,R=0;if(M.groups=S=g.map((F,B)=>{let O=S[B];if(F)typeof F=="function"?F={after:F}:typeof F[0]=="number"&&(F={positions:F});else return O;return F=E(F,{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"}),O||(S[B]=O={id:B,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},F=e({},b,F)),A(O,F,[{lineWidth:L=>+L*.5,capSize:L=>+L*.5,opacity:parseFloat,errors:L=>(L=t(L),R+=L.length,L),positions:(L,N)=>(L=t(L,"float64"),N.count=Math.floor(L.length/2),N.bounds=d(L,2),N.offset=m,m+=N.count,L)},{color:(L,N)=>{let U=N.count;if(L||(L="transparent"),!Array.isArray(L)||typeof L[0]=="number"){let Q=L;L=Array(U);for(let ue=0;ue{let Z=N.bounds;return L||(L=Z),N.scale=[1/(L[2]-L[0]),1/(L[3]-L[1])],N.translate=[-L[0],-L[1]],N.scaleFract=o(N.scale),N.translateFract=o(N.translate),L},viewport:L=>{let N;return Array.isArray(L)?N={x:L[0],y:L[1],width:L[2]-L[0],height:L[3]-L[1]}:L?(N={x:L.x||L.left||0,y:L.y||L.top||0},L.right?N.width=L.right-N.x:N.width=L.w||L.width||0,L.bottom?N.height=L.bottom-N.y:N.height=L.h||L.height||0):N={x:0,y:0,width:c.drawingBufferWidth,height:c.drawingBufferHeight},N}}]),O}),m||R){let F=S.reduce((N,U,Z)=>N+(U?U.count:0),0),B=new Float64Array(F*2),O=new Uint8Array(F*4),L=new Float32Array(F*4);S.forEach((N,U)=>{if(!N)return;let{positions:Z,count:Q,offset:ue,color:oe,errors:le}=N;Q&&(O.set(oe,ue*4),L.set(le,ue*4),B.set(Z,ue*2))});var P=r(B);v(P);var z=o(B,P);h(z),T(O),l(L)}}function u(){v.destroy(),h.destroy(),T.destroy(),l.destroy(),y.destroy()}}}}),W6=He({"node_modules/unquote/index.js"(Y,G){var d=/[\'\"]/;G.exports=function(A){return A?(d.test(A.charAt(0))&&(A=A.substr(1)),d.test(A.charAt(A.length-1))&&(A=A.substr(0,A.length-1)),A):""}}}),vT=He({"node_modules/css-global-keywords/index.json"(){}}),dT=He({"node_modules/css-system-font-keywords/index.json"(){}}),pT=He({"node_modules/css-font-weight-keywords/index.json"(){}}),gT=He({"node_modules/css-font-style-keywords/index.json"(){}}),yT=He({"node_modules/css-font-stretch-keywords/index.json"(){}}),Z6=He({"node_modules/parenthesis/index.js"(Y,G){function d(E,e){if(typeof E!="string")return[E];var t=[E];typeof e=="string"||Array.isArray(e)?e={brackets:e}:e||(e={});var r=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],o=e.escape||"___",a=!!e.flat;r.forEach(function(s){var c=new RegExp(["\\",s[0],"[^\\",s[0],"\\",s[1],"]*\\",s[1]].join("")),f=[];function v(h,T,l){var y=t.push(h.slice(s[0].length,-s[1].length))-1;return f.push(y),o+y+o}t.forEach(function(h,T){for(var l,y=0;h!=l;)if(l=h,h=h.replace(c,v),y++>1e4)throw Error("References have circular dependency. Please, check them.");t[T]=h}),f=f.reverse(),t=t.map(function(h){return f.forEach(function(T){h=h.replace(new RegExp("(\\"+o+T+"\\"+o+")","g"),s[0]+"$1"+s[1])}),h})});var i=new RegExp("\\"+o+"([0-9]+)\\"+o);function n(s,c,f){for(var v=[],h,T=0;h=i.exec(s);){if(T++>1e4)throw Error("Circular references in parenthesis");v.push(s.slice(0,h.index)),v.push(n(c[h[1]],c)),s=s.slice(h.index+h[0].length)}return v.push(s),v}return a?t:n(t[0],t)}function x(E,e){if(e&&e.flat){var t=e&&e.escape||"___",r=E[0],o;if(!r)return"";for(var a=new RegExp("\\"+t+"([0-9]+)\\"+t),i=0;r!=o;){if(i++>1e4)throw Error("Circular references in "+E);o=r,r=r.replace(a,n)}return r}return E.reduce(function s(c,f){return Array.isArray(f)&&(f=f.reduce(s,"")),c+f},"");function n(s,c){if(E[c]==null)throw Error("Reference "+c+"is undefined");return E[c]}}function A(E,e){return Array.isArray(E)?x(E,e):d(E,e)}A.parse=d,A.stringify=x,G.exports=A}}),X6=He({"node_modules/string-split-by/index.js"(Y,G){var d=Z6();G.exports=function(A,E,e){if(A==null)throw Error("First argument should be a string");if(E==null)throw Error("Separator should be a string or a RegExp");e?(typeof e=="string"||Array.isArray(e))&&(e={ignore:e}):e={},e.escape==null&&(e.escape=!0),e.ignore==null?e.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof e.ignore=="string"&&(e.ignore=[e.ignore]),e.ignore=e.ignore.map(function(c){return c.length===1&&(c=c+c),c}));var t=d.parse(A,{flat:!0,brackets:e.ignore}),r=t[0],o=r.split(E);if(e.escape){for(var a=[],i=0;i1&&fa===xa&&(fa==='"'||fa==="'"))return['"'+r(cr.substr(1,cr.length-2))+'"'];var cn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(cr);if(cn)return o(cr.substr(0,cn.index)).concat(o(cn[1])).concat(o(cr.substr(cn.index+cn[0].length)));var In=cr.split(".");if(In.length===1)return['"'+r(cr)+'"'];for(var Da=[],Na=0;Na"u"?1:window.devicePixelRatio,ti=!1,Wi={},Ti=function(qa){},si=function(){};if(typeof fa=="string"?xa=document.querySelector(fa):typeof fa=="object"&&(y(fa)?xa=fa:b(fa)?(Da=fa,In=Da.canvas):("gl"in fa?Da=fa.gl:"canvas"in fa?In=M(fa.canvas):"container"in fa&&(cn=M(fa.container)),"attributes"in fa&&(Na=fa.attributes),"extensions"in fa&&(Hn=S(fa.extensions)),"optionalExtensions"in fa&&(Un=S(fa.optionalExtensions)),"onDone"in fa&&(Ti=fa.onDone),"profile"in fa&&(ti=!!fa.profile),"pixelRatio"in fa&&(Gn=+fa.pixelRatio),"cachedCode"in fa&&(Wi=fa.cachedCode))),xa&&(xa.nodeName.toLowerCase()==="canvas"?In=xa:cn=xa),!Da){if(!In){var Fn=T(cn||document.body,Ti,Gn);if(!Fn)return null;In=Fn.canvas,si=Fn.onDestroy}Na.premultipliedAlpha===void 0&&(Na.premultipliedAlpha=!0),Da=l(In,Na)}return Da?{gl:Da,canvas:In,container:cn,extensions:Hn,optionalExtensions:Un,pixelRatio:Gn,profile:ti,cachedCode:Wi,onDone:Ti,onDestroy:si}:(si(),Ti("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function w(cr,fa){var xa={};function cn(Na){var Hn=Na.toLowerCase(),Un;try{Un=xa[Hn]=cr.getExtension(Hn)}catch{}return!!Un}for(var In=0;In65535)<<4,cr>>>=fa,xa=(cr>255)<<3,cr>>>=xa,fa|=xa,xa=(cr>15)<<2,cr>>>=xa,fa|=xa,xa=(cr>3)<<1,cr>>>=xa,fa|=xa,fa|cr>>1}function L(){var cr=p(8,function(){return[]});function fa(Da){var Na=B(Da),Hn=cr[O(Na)>>2];return Hn.length>0?Hn.pop():new ArrayBuffer(Na)}function xa(Da){cr[O(Da.byteLength)>>2].push(Da)}function cn(Da,Na){var Hn=null;switch(Da){case u:Hn=new Int8Array(fa(Na),0,Na);break;case g:Hn=new Uint8Array(fa(Na),0,Na);break;case m:Hn=new Int16Array(fa(2*Na),0,Na);break;case R:Hn=new Uint16Array(fa(2*Na),0,Na);break;case P:Hn=new Int32Array(fa(4*Na),0,Na);break;case z:Hn=new Uint32Array(fa(4*Na),0,Na);break;case F:Hn=new Float32Array(fa(4*Na),0,Na);break;default:return null}return Hn.length!==Na?Hn.subarray(0,Na):Hn}function In(Da){xa(Da.buffer)}return{alloc:fa,free:xa,allocType:cn,freeType:In}}var N=L();N.zero=L();var U=3408,Z=3410,Q=3411,ue=3412,oe=3413,le=3414,j=3415,J=33901,$=33902,X=3379,re=3386,ee=34921,q=36347,ae=36348,ie=35661,fe=35660,we=34930,Ae=36349,Fe=34076,Ce=34024,qe=7936,et=7937,Qe=7938,Ke=35724,Xe=34047,Me=36063,xe=34852,ce=3553,Re=34067,$e=34069,rt=33984,Je=6408,At=5126,St=5121,Rt=36160,Ut=36053,ir=36064,ar=16384,Mr=function(cr,fa){var xa=1;fa.ext_texture_filter_anisotropic&&(xa=cr.getParameter(Xe));var cn=1,In=1;fa.webgl_draw_buffers&&(cn=cr.getParameter(xe),In=cr.getParameter(Me));var Da=!!fa.oes_texture_float;if(Da){var Na=cr.createTexture();cr.bindTexture(ce,Na),cr.texImage2D(ce,0,Je,1,1,0,Je,At,null);var Hn=cr.createFramebuffer();if(cr.bindFramebuffer(Rt,Hn),cr.framebufferTexture2D(Rt,ir,ce,Na,0),cr.bindTexture(ce,null),cr.checkFramebufferStatus(Rt)!==Ut)Da=!1;else{cr.viewport(0,0,1,1),cr.clearColor(1,0,0,1),cr.clear(ar);var Un=N.allocType(At,4);cr.readPixels(0,0,1,1,Je,At,Un),cr.getError()?Da=!1:(cr.deleteFramebuffer(Hn),cr.deleteTexture(Na),Da=Un[0]===1),N.freeType(Un)}}var Gn=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),ti=!0;if(!Gn){var Wi=cr.createTexture(),Ti=N.allocType(St,36);cr.activeTexture(rt),cr.bindTexture(Re,Wi),cr.texImage2D($e,0,Je,3,3,0,Je,St,Ti),N.freeType(Ti),cr.bindTexture(Re,null),cr.deleteTexture(Wi),ti=!cr.getError()}return{colorBits:[cr.getParameter(Z),cr.getParameter(Q),cr.getParameter(ue),cr.getParameter(oe)],depthBits:cr.getParameter(le),stencilBits:cr.getParameter(j),subpixelBits:cr.getParameter(U),extensions:Object.keys(fa).filter(function(si){return!!fa[si]}),maxAnisotropic:xa,maxDrawbuffers:cn,maxColorAttachments:In,pointSizeDims:cr.getParameter(J),lineWidthDims:cr.getParameter($),maxViewportDims:cr.getParameter(re),maxCombinedTextureUnits:cr.getParameter(ie),maxCubeMapSize:cr.getParameter(Fe),maxRenderbufferSize:cr.getParameter(Ce),maxTextureUnits:cr.getParameter(we),maxTextureSize:cr.getParameter(X),maxAttributes:cr.getParameter(ee),maxVertexUniforms:cr.getParameter(q),maxVertexTextureUnits:cr.getParameter(fe),maxVaryingVectors:cr.getParameter(ae),maxFragmentUniforms:cr.getParameter(Ae),glsl:cr.getParameter(Ke),renderer:cr.getParameter(et),vendor:cr.getParameter(qe),version:cr.getParameter(Qe),readFloat:Da,npotTextureCube:ti}},fr=function(cr){return cr instanceof Uint8Array||cr instanceof Uint16Array||cr instanceof Uint32Array||cr instanceof Int8Array||cr instanceof Int16Array||cr instanceof Int32Array||cr instanceof Float32Array||cr instanceof Float64Array||cr instanceof Uint8ClampedArray};function dr(cr){return!!cr&&typeof cr=="object"&&Array.isArray(cr.shape)&&Array.isArray(cr.stride)&&typeof cr.offset=="number"&&cr.shape.length===cr.stride.length&&(Array.isArray(cr.data)||fr(cr.data))}var pt=function(cr){return Object.keys(cr).map(function(fa){return cr[fa]})},ze={shape:Pe,flatten:be};function Ge(cr,fa,xa){for(var cn=0;cn0){var $i;if(Array.isArray(wn[0])){Xn=va(wn);for(var Cn=1,Mn=1;Mn0){if(typeof Cn[0]=="number"){var gi=N.allocType(Pn.dtype,Cn.length);gr(gi,Cn),Xn(gi,Si),N.freeType(gi)}else if(Array.isArray(Cn[0])||fr(Cn[0])){yn=va(Cn);var ri=Ia(Cn,yn,Pn.dtype);Xn(ri,Si),N.freeType(ri)}}}else if(dr(Cn)){yn=Cn.shape;var ro=Cn.stride,es=0,Fi=0,no=0,oi=0;yn.length===1?(es=yn[0],Fi=1,no=ro[0],oi=0):yn.length===2&&(es=yn[0],Fi=yn[1],no=ro[0],oi=ro[1]);var Xo=Array.isArray(Cn.data)?Pn.dtype:Ot(Cn.data),ys=N.allocType(Xo,es*Fi);Br(ys,Cn.data,es,Fi,no,oi,Cn.offset),Xn(ys,Si),N.freeType(ys)}return Ri}return Tn||Ri(qa),Ri._reglType="buffer",Ri._buffer=Pn,Ri.subdata=$i,xa.profile&&(Ri.stats=Pn.stats),Ri.destroy=function(){Ti(Pn)},Ri}function Fn(){pt(Da).forEach(function(qa){qa.buffer=cr.createBuffer(),cr.bindBuffer(qa.type,qa.buffer),cr.bufferData(qa.type,qa.persistentData||qa.byteLength,qa.usage)})}return xa.profile&&(fa.getTotalBufferSize=function(){var qa=0;return Object.keys(Da).forEach(function(wn){qa+=Da[wn].stats.size}),qa}),{create:si,createStream:Un,destroyStream:Gn,clear:function(){pt(Da).forEach(Ti),Hn.forEach(Ti)},getBuffer:function(qa){return qa&&qa._buffer instanceof Na?qa._buffer:null},restore:Fn,_initBuffer:Wi}}var Ur=0,ga=0,Aa=1,Pa=1,sa=4,Oa=4,dt={points:Ur,point:ga,lines:Aa,line:Pa,triangles:sa,triangle:Oa,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},vt=0,Lr=1,Er=4,_r=5120,yr=5121,kr=5122,zr=5123,Pr=5124,Hr=5125,Zr=34963,Jr=35040,wt=35044;function Qt(cr,fa,xa,cn){var In={},Da=0,Na={uint8:yr,uint16:zr};fa.oes_element_index_uint&&(Na.uint32=Hr);function Hn(Fn){this.id=Da++,In[this.id]=this,this.buffer=Fn,this.primType=Er,this.vertCount=0,this.type=0}Hn.prototype.bind=function(){this.buffer.bind()};var Un=[];function Gn(Fn){var qa=Un.pop();return qa||(qa=new Hn(xa.create(null,Zr,!0,!1)._buffer)),Wi(qa,Fn,Jr,-1,-1,0,0),qa}function ti(Fn){Un.push(Fn)}function Wi(Fn,qa,wn,Tn,Ln,Pn,Ri){Fn.buffer.bind();var Xn;if(qa){var $i=Ri;!Ri&&(!fr(qa)||dr(qa)&&!fr(qa.data))&&($i=fa.oes_element_index_uint?Hr:zr),xa._initBuffer(Fn.buffer,qa,wn,$i,3)}else cr.bufferData(Zr,Pn,wn),Fn.buffer.dtype=Xn||yr,Fn.buffer.usage=wn,Fn.buffer.dimension=3,Fn.buffer.byteLength=Pn;if(Xn=Ri,!Ri){switch(Fn.buffer.dtype){case yr:case _r:Xn=yr;break;case zr:case kr:Xn=zr;break;case Hr:case Pr:Xn=Hr;break}Fn.buffer.dtype=Xn}Fn.type=Xn;var Cn=Ln;Cn<0&&(Cn=Fn.buffer.byteLength,Xn===zr?Cn>>=1:Xn===Hr&&(Cn>>=2)),Fn.vertCount=Cn;var Mn=Tn;if(Tn<0){Mn=Er;var Si=Fn.buffer.dimension;Si===1&&(Mn=vt),Si===2&&(Mn=Lr),Si===3&&(Mn=Er)}Fn.primType=Mn}function Ti(Fn){cn.elementsCount--,delete In[Fn.id],Fn.buffer.destroy(),Fn.buffer=null}function si(Fn,qa){var wn=xa.create(null,Zr,!0),Tn=new Hn(wn._buffer);cn.elementsCount++;function Ln(Pn){if(!Pn)wn(),Tn.primType=Er,Tn.vertCount=0,Tn.type=yr;else if(typeof Pn=="number")wn(Pn),Tn.primType=Er,Tn.vertCount=Pn|0,Tn.type=yr;else{var Ri=null,Xn=wt,$i=-1,Cn=-1,Mn=0,Si=0;Array.isArray(Pn)||fr(Pn)||dr(Pn)?Ri=Pn:("data"in Pn&&(Ri=Pn.data),"usage"in Pn&&(Xn=ma[Pn.usage]),"primitive"in Pn&&($i=dt[Pn.primitive]),"count"in Pn&&(Cn=Pn.count|0),"type"in Pn&&(Si=Na[Pn.type]),"length"in Pn?Mn=Pn.length|0:(Mn=Cn,Si===zr||Si===kr?Mn*=2:(Si===Hr||Si===Pr)&&(Mn*=4))),Wi(Tn,Ri,Xn,$i,Cn,Mn,Si)}return Ln}return Ln(Fn),Ln._reglType="elements",Ln._elements=Tn,Ln.subdata=function(Pn,Ri){return wn.subdata(Pn,Ri),Ln},Ln.destroy=function(){Ti(Tn)},Ln}return{create:si,createStream:Gn,destroyStream:ti,getElements:function(Fn){return typeof Fn=="function"&&Fn._elements instanceof Hn?Fn._elements:null},clear:function(){pt(In).forEach(Ti)}}}var mr=new Float32Array(1),$r=new Uint32Array(mr.buffer),oa=5123;function Sa(cr){for(var fa=N.allocType(oa,cr.length),xa=0;xa>>31<<15,Da=(cn<<1>>>24)-127,Na=cn>>13&1023;if(Da<-24)fa[xa]=In;else if(Da<-14){var Hn=-14-Da;fa[xa]=In+(Na+1024>>Hn)}else Da>15?fa[xa]=In+31744:fa[xa]=In+(Da+15<<10)+Na}return fa}function ya(cr){return Array.isArray(cr)||fr(cr)}var ra=34467,pa=3553,pn=34067,Ga=34069,qn=6408,Vn=6406,di=6407,yi=6409,Ci=6410,ci=32854,ei=32855,mi=36194,uo=32819,Lo=32820,Wo=33635,li=34042,Ii=6402,xi=34041,Ao=35904,So=35906,Ro=36193,Li=33776,Yi=33777,bs=33778,as=33779,fs=35986,Co=35987,Qa=34798,Jn=35840,Os=35841,ds=35842,Ui=35843,ms=36196,Mo=5121,ws=5123,Ks=5125,Rn=5126,fo=10242,Pi=10243,zo=10497,wo=33071,bi=33648,wl=10240,$l=10241,Js=9728,Ql=9729,Ws=9984,Is=9985,Dl=9986,Xu=9987,Lu=33170,Bu=4352,kf=4353,gf=4354,ns=34046,_u=3317,Nc=37440,ml=37441,fl=37443,_l=37444,Yu=33984,Ts=[Ws,Dl,Is,Xu],Tl=[0,yi,Ci,di,qn],Ko={};Ko[yi]=Ko[Vn]=Ko[Ii]=1,Ko[xi]=Ko[Ci]=2,Ko[di]=Ko[Ao]=3,Ko[qn]=Ko[So]=4;function Cs(cr){return"[object "+cr+"]"}var Nu=Cs("HTMLCanvasElement"),Ul=Cs("OffscreenCanvas"),Ku=Cs("CanvasRenderingContext2D"),Bs=Cs("ImageBitmap"),Gf=Cs("HTMLImageElement"),Eo=Cs("HTMLVideoElement"),Wf=Object.keys(We).concat([Nu,Ul,Ku,Bs,Gf,Eo]),is=[];is[Mo]=1,is[Rn]=4,is[Ro]=2,is[ws]=2,is[Ks]=4;var oo=[];oo[ci]=2,oo[ei]=2,oo[mi]=2,oo[xi]=4,oo[Li]=.5,oo[Yi]=.5,oo[bs]=1,oo[as]=1,oo[fs]=.5,oo[Co]=1,oo[Qa]=1,oo[Jn]=.5,oo[Os]=.25,oo[ds]=.5,oo[Ui]=.25,oo[ms]=.5;function pc(cr){return Array.isArray(cr)&&(cr.length===0||typeof cr[0]=="number")}function xu(cr){if(!Array.isArray(cr))return!1;var fa=cr.length;return!(fa===0||!ya(cr[0]))}function zl(cr){return Object.prototype.toString.call(cr)}function Kc(cr){return zl(cr)===Nu}function Ju(cr){return zl(cr)===Ul}function gc(cr){return zl(cr)===Ku}function hl(cr){return zl(cr)===Bs}function yf(cr){return zl(cr)===Gf}function Jc(cr){return zl(cr)===Eo}function Uc(cr){if(!cr)return!1;var fa=zl(cr);return Wf.indexOf(fa)>=0?!0:pc(cr)||xu(cr)||dr(cr)}function $u(cr){return We[Object.prototype.toString.call(cr)]|0}function jc(cr,fa){var xa=fa.length;switch(cr.type){case Mo:case ws:case Ks:case Rn:var cn=N.allocType(cr.type,xa);cn.set(fa),cr.data=cn;break;case Ro:cr.data=Sa(fa);break}}function $c(cr,fa){return N.allocType(cr.type===Ro?Rn:cr.type,fa)}function bu(cr,fa){cr.type===Ro?(cr.data=Sa(fa),N.freeType(fa)):cr.data=fa}function Qc(cr,fa,xa,cn,In,Da){for(var Na=cr.width,Hn=cr.height,Un=cr.channels,Gn=Na*Hn*Un,ti=$c(cr,Gn),Wi=0,Ti=0;Ti=1;)Hn+=Na*Un*Un,Un/=2;return Hn}else return Na*xa*cn}function wu(cr,fa,xa,cn,In,Da,Na){var Hn={"don't care":Bu,"dont care":Bu,nice:gf,fast:kf},Un={repeat:zo,clamp:wo,mirror:bi},Gn={nearest:Js,linear:Ql},ti=d({mipmap:Xu,"nearest mipmap nearest":Ws,"linear mipmap nearest":Is,"nearest mipmap linear":Dl,"linear mipmap linear":Xu},Gn),Wi={none:0,browser:_l},Ti={uint8:Mo,rgba4:uo,rgb565:Wo,"rgb5 a1":Lo},si={alpha:Vn,luminance:yi,"luminance alpha":Ci,rgb:di,rgba:qn,rgba4:ci,"rgb5 a1":ei,rgb565:mi},Fn={};fa.ext_srgb&&(si.srgb=Ao,si.srgba=So),fa.oes_texture_float&&(Ti.float32=Ti.float=Rn),fa.oes_texture_half_float&&(Ti.float16=Ti["half float"]=Ro),fa.webgl_depth_texture&&(d(si,{depth:Ii,"depth stencil":xi}),d(Ti,{uint16:ws,uint32:Ks,"depth stencil":li})),fa.webgl_compressed_texture_s3tc&&d(Fn,{"rgb s3tc dxt1":Li,"rgba s3tc dxt1":Yi,"rgba s3tc dxt3":bs,"rgba s3tc dxt5":as}),fa.webgl_compressed_texture_atc&&d(Fn,{"rgb atc":fs,"rgba atc explicit alpha":Co,"rgba atc interpolated alpha":Qa}),fa.webgl_compressed_texture_pvrtc&&d(Fn,{"rgb pvrtc 4bppv1":Jn,"rgb pvrtc 2bppv1":Os,"rgba pvrtc 4bppv1":ds,"rgba pvrtc 2bppv1":Ui}),fa.webgl_compressed_texture_etc1&&(Fn["rgb etc1"]=ms);var qa=Array.prototype.slice.call(cr.getParameter(ra));Object.keys(Fn).forEach(function(W){var de=Fn[W];qa.indexOf(de)>=0&&(si[W]=de)});var wn=Object.keys(si);xa.textureFormats=wn;var Tn=[];Object.keys(si).forEach(function(W){var de=si[W];Tn[de]=W});var Ln=[];Object.keys(Ti).forEach(function(W){var de=Ti[W];Ln[de]=W});var Pn=[];Object.keys(Gn).forEach(function(W){var de=Gn[W];Pn[de]=W});var Ri=[];Object.keys(ti).forEach(function(W){var de=ti[W];Ri[de]=W});var Xn=[];Object.keys(Un).forEach(function(W){var de=Un[W];Xn[de]=W});var $i=wn.reduce(function(W,de){var te=si[de];return te===yi||te===Vn||te===yi||te===Ci||te===Ii||te===xi||fa.ext_srgb&&(te===Ao||te===So)?W[te]=te:te===ei||de.indexOf("rgba")>=0?W[te]=qn:W[te]=di,W},{});function Cn(){this.internalformat=qn,this.format=qn,this.type=Mo,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=_l,this.width=0,this.height=0,this.channels=0}function Mn(W,de){W.internalformat=de.internalformat,W.format=de.format,W.type=de.type,W.compressed=de.compressed,W.premultiplyAlpha=de.premultiplyAlpha,W.flipY=de.flipY,W.unpackAlignment=de.unpackAlignment,W.colorSpace=de.colorSpace,W.width=de.width,W.height=de.height,W.channels=de.channels}function Si(W,de){if(!(typeof de!="object"||!de)){if("premultiplyAlpha"in de&&(W.premultiplyAlpha=de.premultiplyAlpha),"flipY"in de&&(W.flipY=de.flipY),"alignment"in de&&(W.unpackAlignment=de.alignment),"colorSpace"in de&&(W.colorSpace=Wi[de.colorSpace]),"type"in de){var te=de.type;W.type=Ti[te]}var me=W.width,Ue=W.height,tt=W.channels,ft=!1;"shape"in de?(me=de.shape[0],Ue=de.shape[1],de.shape.length===3&&(tt=de.shape[2],ft=!0)):("radius"in de&&(me=Ue=de.radius),"width"in de&&(me=de.width),"height"in de&&(Ue=de.height),"channels"in de&&(tt=de.channels,ft=!0)),W.width=me|0,W.height=Ue|0,W.channels=tt|0;var st=!1;if("format"in de){var bt=de.format,It=W.internalformat=si[bt];W.format=$i[It],bt in Ti&&("type"in de||(W.type=Ti[bt])),bt in Fn&&(W.compressed=!0),st=!0}!ft&&st?W.channels=Ko[W.format]:ft&&!st&&W.channels!==Tl[W.format]&&(W.format=W.internalformat=Tl[W.channels])}}function yn(W){cr.pixelStorei(Nc,W.flipY),cr.pixelStorei(ml,W.premultiplyAlpha),cr.pixelStorei(fl,W.colorSpace),cr.pixelStorei(_u,W.unpackAlignment)}function gi(){Cn.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function ri(W,de){var te=null;if(Uc(de)?te=de:de&&(Si(W,de),"x"in de&&(W.xOffset=de.x|0),"y"in de&&(W.yOffset=de.y|0),Uc(de.data)&&(te=de.data)),de.copy){var me=In.viewportWidth,Ue=In.viewportHeight;W.width=W.width||me-W.xOffset,W.height=W.height||Ue-W.yOffset,W.needsCopy=!0}else if(!te)W.width=W.width||1,W.height=W.height||1,W.channels=W.channels||4;else if(fr(te))W.channels=W.channels||4,W.data=te,!("type"in de)&&W.type===Mo&&(W.type=$u(te));else if(pc(te))W.channels=W.channels||4,jc(W,te),W.alignment=1,W.needsFree=!0;else if(dr(te)){var tt=te.data;!Array.isArray(tt)&&W.type===Mo&&(W.type=$u(tt));var ft=te.shape,st=te.stride,bt,It,Jt,Kt,vr,Tr;ft.length===3?(Jt=ft[2],Tr=st[2]):(Jt=1,Tr=1),bt=ft[0],It=ft[1],Kt=st[0],vr=st[1],W.alignment=1,W.width=bt,W.height=It,W.channels=Jt,W.format=W.internalformat=Tl[Jt],W.needsFree=!0,Qc(W,tt,Kt,vr,Tr,te.offset)}else if(Kc(te)||Ju(te)||gc(te))Kc(te)||Ju(te)?W.element=te:W.element=te.canvas,W.width=W.element.width,W.height=W.element.height,W.channels=4;else if(hl(te))W.element=te,W.width=te.width,W.height=te.height,W.channels=4;else if(yf(te))W.element=te,W.width=te.naturalWidth,W.height=te.naturalHeight,W.channels=4;else if(Jc(te))W.element=te,W.width=te.videoWidth,W.height=te.videoHeight,W.channels=4;else if(xu(te)){var wr=W.width||te[0].length,tr=W.height||te.length,pr=W.channels;ya(te[0][0])?pr=pr||te[0][0].length:pr=pr||1;for(var xr=ze.shape(te),ea=1,ha=0;ha>=Ue,te.height>>=Ue,ri(te,me[Ue]),W.mipmask|=1<=0&&!("faces"in de)&&(W.genMipmaps=!0)}if("mag"in de){var me=de.mag;W.magFilter=Gn[me]}var Ue=W.wrapS,tt=W.wrapT;if("wrap"in de){var ft=de.wrap;typeof ft=="string"?Ue=tt=Un[ft]:Array.isArray(ft)&&(Ue=Un[ft[0]],tt=Un[ft[1]])}else{if("wrapS"in de){var st=de.wrapS;Ue=Un[st]}if("wrapT"in de){var bt=de.wrapT;tt=Un[bt]}}if(W.wrapS=Ue,W.wrapT=tt,"anisotropic"in de&&(de.anisotropic,W.anisotropic=de.anisotropic),"mipmap"in de){var It=!1;switch(typeof de.mipmap){case"string":W.mipmapHint=Hn[de.mipmap],W.genMipmaps=!0,It=!0;break;case"boolean":It=W.genMipmaps=de.mipmap;break;case"object":W.genMipmaps=!1,It=!0;break}It&&!("min"in de)&&(W.minFilter=Ws)}}function Lc(W,de){cr.texParameteri(de,$l,W.minFilter),cr.texParameteri(de,wl,W.magFilter),cr.texParameteri(de,fo,W.wrapS),cr.texParameteri(de,Pi,W.wrapT),fa.ext_texture_filter_anisotropic&&cr.texParameteri(de,ns,W.anisotropic),W.genMipmaps&&(cr.hint(Lu,W.mipmapHint),cr.generateMipmap(de))}var Pf=0,su={},zu=xa.maxTextureUnits,Fo=Array(zu).map(function(){return null});function nc(W){Cn.call(this),this.mipmask=0,this.internalformat=qn,this.id=Pf++,this.refCount=1,this.target=W,this.texture=cr.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Eu,Na.profile&&(this.stats={size:0})}function ll(W){cr.activeTexture(Yu),cr.bindTexture(W.target,W.texture)}function Sl(){var W=Fo[0];W?cr.bindTexture(W.target,W.texture):cr.bindTexture(pa,null)}function qc(W){var de=W.texture,te=W.unit,me=W.target;te>=0&&(cr.activeTexture(Yu+te),cr.bindTexture(me,null),Fo[te]=null),cr.deleteTexture(de),W.texture=null,W.params=null,W.pixels=null,W.refCount=0,delete su[W.id],Da.textureCount--}d(nc.prototype,{bind:function(){var W=this;W.bindCount+=1;var de=W.unit;if(de<0){for(var te=0;te0)continue;me.unit=-1}Fo[te]=W,de=te;break}Na.profile&&Da.maxTextureUnits>vr)-Jt,Tr.height=Tr.height||(te.height>>vr)-Kt,ll(te),es(Tr,pa,Jt,Kt,vr),Sl(),oi(Tr),me}function tt(ft,st){var bt=ft|0,It=st|0||bt;if(bt===te.width&&It===te.height)return me;me.width=te.width=bt,me.height=te.height=It,ll(te);for(var Jt=0;te.mipmask>>Jt;++Jt){var Kt=bt>>Jt,vr=It>>Jt;if(!Kt||!vr)break;cr.texImage2D(pa,Jt,te.format,Kt,vr,0,te.format,te.type,null)}return Sl(),Na.profile&&(te.stats.size=sc(te.internalformat,te.type,bt,It,!1,!1)),me}return me(W,de),me.subimage=Ue,me.resize=tt,me._reglType="texture2d",me._texture=te,Na.profile&&(me.stats=te.stats),me.destroy=function(){te.decRef()},me}function ss(W,de,te,me,Ue,tt){var ft=new nc(pn);su[ft.id]=ft,Da.cubeCount++;var st=new Array(6);function bt(Kt,vr,Tr,wr,tr,pr){var xr,ea=ft.texInfo;for(Eu.call(ea),xr=0;xr<6;++xr)st[xr]=Mu();if(typeof Kt=="number"||!Kt){var ha=Kt|0||1;for(xr=0;xr<6;++xr)ys(st[xr],ha,ha)}else if(typeof Kt=="object")if(vr)xs(st[0],Kt),xs(st[1],vr),xs(st[2],Tr),xs(st[3],wr),xs(st[4],tr),xs(st[5],pr);else if(ac(ea,Kt),Si(ft,Kt),"faces"in Kt){var Ea=Kt.faces;for(xr=0;xr<6;++xr)Mn(st[xr],ft),xs(st[xr],Ea[xr])}else for(xr=0;xr<6;++xr)xs(st[xr],Kt);for(Mn(ft,st[0]),ea.genMipmaps?ft.mipmask=(st[0].width<<1)-1:ft.mipmask=st[0].mipmask,ft.internalformat=st[0].internalformat,bt.width=st[0].width,bt.height=st[0].height,ll(ft),xr=0;xr<6;++xr)Xs(st[xr],Ga+xr);for(Lc(ea,pn),Sl(),Na.profile&&(ft.stats.size=sc(ft.internalformat,ft.type,bt.width,bt.height,ea.genMipmaps,!0)),bt.format=Tn[ft.internalformat],bt.type=Ln[ft.type],bt.mag=Pn[ea.magFilter],bt.min=Ri[ea.minFilter],bt.wrapS=Xn[ea.wrapS],bt.wrapT=Xn[ea.wrapT],xr=0;xr<6;++xr)dl(st[xr]);return bt}function It(Kt,vr,Tr,wr,tr){var pr=Tr|0,xr=wr|0,ea=tr|0,ha=no();return Mn(ha,ft),ha.width=0,ha.height=0,ri(ha,vr),ha.width=ha.width||(ft.width>>ea)-pr,ha.height=ha.height||(ft.height>>ea)-xr,ll(ft),es(ha,Ga+Kt,pr,xr,ea),Sl(),oi(ha),bt}function Jt(Kt){var vr=Kt|0;if(vr!==ft.width){bt.width=ft.width=vr,bt.height=ft.height=vr,ll(ft);for(var Tr=0;Tr<6;++Tr)for(var wr=0;ft.mipmask>>wr;++wr)cr.texImage2D(Ga+Tr,wr,ft.format,vr>>wr,vr>>wr,0,ft.format,ft.type,null);return Sl(),Na.profile&&(ft.stats.size=sc(ft.internalformat,ft.type,bt.width,bt.height,!1,!0)),bt}}return bt(W,de,te,me,Ue,tt),bt.subimage=It,bt.resize=Jt,bt._reglType="textureCube",bt._texture=ft,Na.profile&&(bt.stats=ft.stats),bt.destroy=function(){ft.decRef()},bt}function js(){for(var W=0;W>me,te.height>>me,0,te.internalformat,te.type,null);else for(var Ue=0;Ue<6;++Ue)cr.texImage2D(Ga+Ue,me,te.internalformat,te.width>>me,te.height>>me,0,te.internalformat,te.type,null);Lc(te.texInfo,te.target)})}function ye(){for(var W=0;W=0?Mu=!0:Un.indexOf(dl)>=0&&(Mu=!1))),("depthTexture"in Fo||"depthStencilTexture"in Fo)&&(zu=!!(Fo.depthTexture||Fo.depthStencilTexture)),"depth"in Fo&&(typeof Fo.depth=="boolean"?xs=Fo.depth:(Lc=Fo.depth,Xs=!1)),"stencil"in Fo&&(typeof Fo.stencil=="boolean"?Xs=Fo.stencil:(Pf=Fo.stencil,xs=!1)),"depthStencil"in Fo&&(typeof Fo.depthStencil=="boolean"?xs=Xs=Fo.depthStencil:(su=Fo.depthStencil,xs=!1,Xs=!1))}var ll=null,Sl=null,qc=null,Hc=null;if(Array.isArray(Ps))ll=Ps.map(si);else if(Ps)ll=[si(Ps)];else for(ll=new Array(ac),oi=0;oi0&&(no.depth=gi[0].depth,no.stencil=gi[0].stencil,no.depthStencil=gi[0].depthStencil),gi[Fi]?gi[Fi](no):gi[Fi]=Cn(no)}return d(ri,{width:oi,height:oi,color:dl})}function ro(es){var Fi,no=es|0;if(no===ri.width)return ri;var oi=ri.color;for(Fi=0;Fi=Xo.byteLength?ys.subdata(Xo):(ys.destroy(),Mn.buffers[Fi]=null)),Mn.buffers[Fi]||(ys=Mn.buffers[Fi]=In.create(no,mc,!1,!0)),oi.buffer=In.getBuffer(ys),oi.size=oi.buffer.dimension|0,oi.normalized=!1,oi.type=oi.buffer.dtype,oi.offset=0,oi.stride=0,oi.divisor=0,oi.state=1,ro[Fi]=1}else In.getBuffer(no)?(oi.buffer=In.getBuffer(no),oi.size=oi.buffer.dimension|0,oi.normalized=!1,oi.type=oi.buffer.dtype,oi.offset=0,oi.stride=0,oi.divisor=0,oi.state=1):In.getBuffer(no.buffer)?(oi.buffer=In.getBuffer(no.buffer),oi.size=(+no.size||oi.buffer.dimension)|0,oi.normalized=!!no.normalized||!1,"type"in no?oi.type=ta[no.type]:oi.type=oi.buffer.dtype,oi.offset=(no.offset||0)|0,oi.stride=(no.stride||0)|0,oi.divisor=(no.divisor||0)|0,oi.state=1):"x"in no&&(oi.x=+no.x||0,oi.y=+no.y||0,oi.z=+no.z||0,oi.w=+no.w||0,oi.state=2)}for(var xs=0;xs1)for(var yn=0;ynqa&&(qa=wn.stats.uniformsCount)}),qa},xa.getMaxAttributesCount=function(){var qa=0;return ti.forEach(function(wn){wn.stats.attributesCount>qa&&(qa=wn.stats.attributesCount)}),qa});function Fn(){In={},Da={};for(var qa=0;qa>>4&15)+fa.charAt(cn&15);return xa}function Au(cr){for(var fa="",xa=-1,cn,In;++xa>>6&31,128|cn&63):cn<=65535?fa+=String.fromCharCode(224|cn>>>12&15,128|cn>>>6&63,128|cn&63):cn<=2097151&&(fa+=String.fromCharCode(240|cn>>>18&7,128|cn>>>12&63,128|cn>>>6&63,128|cn&63));return fa}function Zs(cr){for(var fa=Array(cr.length>>2),xa=0;xa>5]|=(cr.charCodeAt(xa/8)&255)<<24-xa%32;return fa}function Ol(cr){for(var fa="",xa=0;xa>5]>>>24-xa%32&255);return fa}function bl(cr,fa){return cr>>>fa|cr<<32-fa}function tc(cr,fa){return cr>>>fa}function Su(cr,fa,xa){return cr&fa^~cr&xa}function Cc(cr,fa,xa){return cr&fa^cr&xa^fa&xa}function Ht(cr){return bl(cr,2)^bl(cr,13)^bl(cr,22)}function ur(cr){return bl(cr,6)^bl(cr,11)^bl(cr,25)}function qr(cr){return bl(cr,7)^bl(cr,18)^tc(cr,3)}function Or(cr){return bl(cr,17)^bl(cr,19)^tc(cr,10)}var ua=new Array(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);function Fa(cr,fa){var xa=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),cn=new Array(64),In,Da,Na,Hn,Un,Gn,ti,Wi,Ti,si,Fn,qa;for(cr[fa>>5]|=128<<24-fa%32,cr[(fa+64>>9<<4)+15]=fa,Ti=0;Ti>16)+(fa>>16)+(xa>>16);return cn<<16|xa&65535}function sn(cr){return Array.prototype.slice.call(cr)}function gn(cr){return sn(cr).join("")}function kn(cr){var fa=cr&&cr.cache,xa=0,cn=[],In=[],Da=[];function Na(Fn,qa){var wn=qa&&qa.stable;if(!wn){for(var Tn=0;Tn0&&(Fn.push(Ln,"="),Fn.push.apply(Fn,sn(arguments)),Fn.push(";")),Ln}return d(qa,{def:Tn,toString:function(){return gn([wn.length>0?"var "+wn.join(",")+";":"",gn(Fn)])}})}function Un(){var Fn=Hn(),qa=Hn(),wn=Fn.toString,Tn=qa.toString;function Ln(Pn,Ri){qa(Pn,Ri,"=",Fn.def(Pn,Ri),";")}return d(function(){Fn.apply(Fn,sn(arguments))},{def:Fn.def,entry:Fn,exit:qa,save:Ln,set:function(Pn,Ri,Xn){Ln(Pn,Ri),Fn(Pn,Ri,"=",Xn,";")},toString:function(){return wn()+Tn()}})}function Gn(){var Fn=gn(arguments),qa=Un(),wn=Un(),Tn=qa.toString,Ln=wn.toString;return d(qa,{then:function(){return qa.apply(qa,sn(arguments)),this},else:function(){return wn.apply(wn,sn(arguments)),this},toString:function(){var Pn=Ln();return Pn&&(Pn="else{"+Pn+"}"),gn(["if(",Fn,"){",Tn(),"}",Pn])}})}var ti=Hn(),Wi={};function Ti(Fn,qa){var wn=[];function Tn(){var $i="a"+wn.length;return wn.push($i),$i}qa=qa||0;for(var Ln=0;Ln":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},ka={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ba={cw:ut,ccw:ht};function Va(cr){return Array.isArray(cr)||fr(cr)||dr(cr)}function Ma(cr){return cr.sort(function(fa,xa){return fa===wc?-1:xa===wc?1:fa=1,cn>=2,fa)}else if(xa===Ni){var In=cr.data;return new mn(In.thisDep,In.contextDep,In.propDep,fa)}else{if(xa===Bn)return new mn(!1,!1,!1,fa);if(xa===An){for(var Da=!1,Na=!1,Hn=!1,Un=0;Un=1&&(Na=!0),ti>=2&&(Hn=!0)}else Gn.type===Ni&&(Da=Da||Gn.data.thisDep,Na=Na||Gn.data.contextDep,Hn=Hn||Gn.data.propDep)}return new mn(Da,Na,Hn,fa)}else return new mn(xa===ji,xa===ki,xa===zi,fa)}}var hi=new mn(!1,!1,!1,function(){});function _i(cr,fa,xa,cn,In,Da,Na,Hn,Un,Gn,ti,Wi,Ti,si,Fn,qa){var wn=Gn.Record,Tn={add:32774,subtract:32778,"reverse subtract":32779};xa.ext_blend_minmax&&(Tn.min=xt,Tn.max=zt);var Ln=xa.angle_instanced_arrays,Pn=xa.webgl_draw_buffers,Ri=xa.oes_vertex_array_object,Xn={dirty:!0,profile:qa.profile},$i={},Cn=[],Mn={},Si={};function yn(st){return st.replace(".","_")}function gi(st,bt,It){var Jt=yn(st);Cn.push(st),$i[Jt]=Xn[Jt]=!!It,Mn[Jt]=bt}function ri(st,bt,It){var Jt=yn(st);Cn.push(st),Array.isArray(It)?(Xn[Jt]=It.slice(),$i[Jt]=It.slice()):Xn[Jt]=$i[Jt]=It,Si[Jt]=bt}function ro(st){return!!isNaN(st)}gi(Ki,Sr),gi(ko,sr),ri($o,"blendColor",[0,0,0,0]),ri(Ls,"blendEquationSeparate",[Vr,Vr]),ri(os,"blendFuncSeparate",[Ar,Cr,Ar,Cr]),gi(As,Qr,!0),ri(jo,"depthFunc",Kr),ri(il,"depthRange",[0,1]),ri(Qs,"depthMask",!0),ri(Ss,Ss,[!0,!0,!0,!0]),gi(fi,rr),ri(ao,"cullFace",Ye),ri(gs,gs,ht),ri(Jo,Jo,1),gi(Bl,_a),ri(jl,"polygonOffset",[0,0]),gi(Vl,za),gi(cc,nn),ri(ql,"sampleCoverage",[1,!1]),gi(Vu,Nr),ri(ol,"stencilMask",-1),ri(rc,"stencilFunc",[Dt,0,-1]),ri(Vi,"stencilOpSeparate",[Le,$t,$t,$t]),ri(eo,"stencilOpSeparate",[Ye,$t,$t,$t]),gi(qu,ia),ri(Du,"scissor",[0,0,cr.drawingBufferWidth,cr.drawingBufferHeight]),ri(wc,wc,[0,0,cr.drawingBufferWidth,cr.drawingBufferHeight]);var es={gl:cr,context:Ti,strings:fa,next:$i,current:Xn,draw:Wi,elements:Da,buffer:In,shader:ti,attributes:Gn.state,vao:Gn,uniforms:Un,framebuffer:Hn,extensions:xa,timer:si,isBufferArgs:Va},Fi={primTypes:dt,compareFuncs:Ta,blendFuncs:la,blendEquations:Tn,stencilOps:ka,glTypes:ta,orientationType:Ba};Pn&&(Fi.backBuffer=[Ye],Fi.drawBuffer=p(cn.maxDrawbuffers,function(st){return st===0?[0]:p(st,function(bt){return Ua+bt})}));var no=0;function oi(){var st=kn({cache:Fn}),bt=st.link,It=st.global;st.id=no++,st.batchId="0";var Jt=bt(es),Kt=st.shared={props:"a0"};Object.keys(es).forEach(function(pr){Kt[pr]=It.def(Jt,".",pr)});var vr=st.next={},Tr=st.current={};Object.keys(Si).forEach(function(pr){Array.isArray(Xn[pr])&&(vr[pr]=It.def(Kt.next,".",pr),Tr[pr]=It.def(Kt.current,".",pr))});var wr=st.constants={};Object.keys(Fi).forEach(function(pr){wr[pr]=It.def(JSON.stringify(Fi[pr]))}),st.invoke=function(pr,xr){switch(xr.type){case On:var ea=["this",Kt.context,Kt.props,st.batchId];return pr.def(bt(xr.data),".call(",ea.slice(0,Math.max(xr.data.length+1,4)),")");case zi:return pr.def(Kt.props,xr.data);case ki:return pr.def(Kt.context,xr.data);case ji:return pr.def("this",xr.data);case Ni:return xr.data.append(st,pr),xr.data.ref;case Bn:return xr.data.toString();case An:return xr.data.map(function(ha){return st.invoke(pr,ha)})}},st.attribCache={};var tr={};return st.scopeAttrib=function(pr){var xr=fa.id(pr);if(xr in tr)return tr[xr];var ea=Gn.scope[xr];ea||(ea=Gn.scope[xr]=new wn);var ha=tr[xr]=bt(ea);return ha},st}function Xo(st){var bt=st.static,It=st.dynamic,Jt;if(De in bt){var Kt=!!bt[De];Jt=jn(function(Tr,wr){return Kt}),Jt.enable=Kt}else if(De in It){var vr=It[De];Jt=Zn(vr,function(Tr,wr){return Tr.invoke(wr,vr)})}return Jt}function ys(st,bt){var It=st.static,Jt=st.dynamic;if(I in It){var Kt=It[I];return Kt?(Kt=Hn.getFramebuffer(Kt),jn(function(Tr,wr){var tr=Tr.link(Kt),pr=Tr.shared;wr.set(pr.framebuffer,".next",tr);var xr=pr.context;return wr.set(xr,"."+Fr,tr+".width"),wr.set(xr,"."+Wr,tr+".height"),tr})):jn(function(Tr,wr){var tr=Tr.shared;wr.set(tr.framebuffer,".next","null");var pr=tr.context;return wr.set(pr,"."+Fr,pr+"."+lt),wr.set(pr,"."+Wr,pr+"."+Tt),"null"})}else if(I in Jt){var vr=Jt[I];return Zn(vr,function(Tr,wr){var tr=Tr.invoke(wr,vr),pr=Tr.shared,xr=pr.framebuffer,ea=wr.def(xr,".getFramebuffer(",tr,")");wr.set(xr,".next",ea);var ha=pr.context;return wr.set(ha,"."+Fr,ea+"?"+ea+".width:"+ha+"."+lt),wr.set(ha,"."+Wr,ea+"?"+ea+".height:"+ha+"."+Tt),ea})}else return null}function xs(st,bt,It){var Jt=st.static,Kt=st.dynamic;function vr(tr){if(tr in Jt){var pr=Jt[tr],xr=!0,ea=pr.x|0,ha=pr.y|0,Ea,tn;return"width"in pr?Ea=pr.width|0:xr=!1,"height"in pr?tn=pr.height|0:xr=!1,new mn(!xr&&bt&&bt.thisDep,!xr&&bt&&bt.contextDep,!xr&&bt&&bt.propDep,function(an,hn){var xn=an.shared.context,fn=Ea;"width"in pr||(fn=hn.def(xn,".",Fr,"-",ea));var En=tn;return"height"in pr||(En=hn.def(xn,".",Wr,"-",ha)),[ea,ha,fn,En]})}else if(tr in Kt){var Xa=Kt[tr],Ya=Zn(Xa,function(an,hn){var xn=an.invoke(hn,Xa),fn=an.shared.context,En=hn.def(xn,".x|0"),Yn=hn.def(xn,".y|0"),vi=hn.def('"width" in ',xn,"?",xn,".width|0:","(",fn,".",Fr,"-",En,")"),ai=hn.def('"height" in ',xn,"?",xn,".height|0:","(",fn,".",Wr,"-",Yn,")");return[En,Yn,vi,ai]});return bt&&(Ya.thisDep=Ya.thisDep||bt.thisDep,Ya.contextDep=Ya.contextDep||bt.contextDep,Ya.propDep=Ya.propDep||bt.propDep),Ya}else return bt?new mn(bt.thisDep,bt.contextDep,bt.propDep,function(an,hn){var xn=an.shared.context;return[0,0,hn.def(xn,".",Fr),hn.def(xn,".",Wr)]}):null}var Tr=vr(wc);if(Tr){var wr=Tr;Tr=new mn(Tr.thisDep,Tr.contextDep,Tr.propDep,function(tr,pr){var xr=wr.append(tr,pr),ea=tr.shared.context;return pr.set(ea,"."+je,xr[2]),pr.set(ea,"."+Ze,xr[3]),xr})}return{viewport:Tr,scissor_box:vr(Du)}}function Xs(st,bt){var It=st.static,Jt=typeof It[Te]=="string"&&typeof It[ne]=="string";if(Jt){if(Object.keys(bt.dynamic).length>0)return null;var Kt=bt.static,vr=Object.keys(Kt);if(vr.length>0&&typeof Kt[vr[0]]=="number"){for(var Tr=[],wr=0;wr"+En+"?"+xr+".constant["+En+"]:0;"}).join(""),"}}else{","if(",Ea,"(",xr,".buffer)){",an,"=",tn,".createStream(",Et,",",xr,".buffer);","}else{",an,"=",tn,".getBuffer(",xr,".buffer);","}",hn,'="type" in ',xr,"?",ha.glTypes,"[",xr,".type]:",an,".dtype;",Xa.normalized,"=!!",xr,".normalized;");function xn(fn){pr(Xa[fn],"=",xr,".",fn,"|0;")}return xn("size"),xn("offset"),xn("stride"),xn("divisor"),pr("}}"),pr.exit("if(",Xa.isStream,"){",tn,".destroyStream(",an,");","}"),Xa}Kt[vr]=Zn(Tr,wr)}),Kt}function Lc(st){var bt=st.static,It=st.dynamic,Jt={};return Object.keys(bt).forEach(function(Kt){var vr=bt[Kt];Jt[Kt]=jn(function(Tr,wr){return typeof vr=="number"||typeof vr=="boolean"?""+vr:Tr.link(vr)})}),Object.keys(It).forEach(function(Kt){var vr=It[Kt];Jt[Kt]=Zn(vr,function(Tr,wr){return Tr.invoke(wr,vr)})}),Jt}function Pf(st,bt,It,Jt,Kt){st.static,st.dynamic;var vr=Xs(st,bt),Tr=ys(st),wr=xs(st,Tr),tr=Mu(st),pr=dl(st),xr=Ps(st,Kt,vr);function ea(an){var hn=wr[an];hn&&(pr[an]=hn)}ea(wc),ea(yn(Du));var ha=Object.keys(pr).length>0,Ea={framebuffer:Tr,draw:tr,shader:xr,state:pr,dirty:ha,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Ea.profile=Xo(st),Ea.uniforms=Eu(It),Ea.drawVAO=Ea.scopeVAO=tr.vao,!Ea.drawVAO&&xr.program&&!vr&&xa.angle_instanced_arrays&&tr.static.elements){var tn=!0,Xa=xr.program.attributes.map(function(an){var hn=bt.static[an];return tn=tn&&!!hn,hn});if(tn&&Xa.length>0){var Ya=Gn.getVAO(Gn.createVAO({attributes:Xa,elements:tr.static.elements}));Ea.drawVAO=new mn(null,null,null,function(an,hn){return an.link(Ya)}),Ea.useVAO=!0}}return vr?Ea.useVAO=!0:Ea.attributes=ac(bt),Ea.context=Lc(Jt),Ea}function su(st,bt,It){var Jt=st.shared,Kt=Jt.context,vr=st.scope();Object.keys(It).forEach(function(Tr){bt.save(Kt,"."+Tr);var wr=It[Tr],tr=wr.append(st,bt);Array.isArray(tr)?vr(Kt,".",Tr,"=[",tr.join(),"];"):vr(Kt,".",Tr,"=",tr,";")}),bt(vr)}function zu(st,bt,It,Jt){var Kt=st.shared,vr=Kt.gl,Tr=Kt.framebuffer,wr;Pn&&(wr=bt.def(Kt.extensions,".webgl_draw_buffers"));var tr=st.constants,pr=tr.drawBuffer,xr=tr.backBuffer,ea;It?ea=It.append(st,bt):ea=bt.def(Tr,".next"),Jt||bt("if(",ea,"!==",Tr,".cur){"),bt("if(",ea,"){",vr,".bindFramebuffer(",aa,",",ea,".framebuffer);"),Pn&&bt(wr,".drawBuffersWEBGL(",pr,"[",ea,".colorAttachments.length]);"),bt("}else{",vr,".bindFramebuffer(",aa,",null);"),Pn&&bt(wr,".drawBuffersWEBGL(",xr,");"),bt("}",Tr,".cur=",ea,";"),Jt||bt("}")}function Fo(st,bt,It){var Jt=st.shared,Kt=Jt.gl,vr=st.current,Tr=st.next,wr=Jt.current,tr=Jt.next,pr=st.cond(wr,".dirty");Cn.forEach(function(xr){var ea=yn(xr);if(!(ea in It.state)){var ha,Ea;if(ea in Tr){ha=Tr[ea],Ea=vr[ea];var tn=p(Xn[ea].length,function(Ya){return pr.def(ha,"[",Ya,"]")});pr(st.cond(tn.map(function(Ya,an){return Ya+"!=="+Ea+"["+an+"]"}).join("||")).then(Kt,".",Si[ea],"(",tn,");",tn.map(function(Ya,an){return Ea+"["+an+"]="+Ya}).join(";"),";"))}else{ha=pr.def(tr,".",ea);var Xa=st.cond(ha,"!==",wr,".",ea);pr(Xa),ea in Mn?Xa(st.cond(ha).then(Kt,".enable(",Mn[ea],");").else(Kt,".disable(",Mn[ea],");"),wr,".",ea,"=",ha,";"):Xa(Kt,".",Si[ea],"(",ha,");",wr,".",ea,"=",ha,";")}}}),Object.keys(It.state).length===0&&pr(wr,".dirty=false;"),bt(pr)}function nc(st,bt,It,Jt){var Kt=st.shared,vr=st.current,Tr=Kt.current,wr=Kt.gl,tr;Ma(Object.keys(It)).forEach(function(pr){var xr=It[pr];if(!(Jt&&!Jt(xr))){var ea=xr.append(st,bt);if(Mn[pr]){var ha=Mn[pr];Wn(xr)?(tr=st.link(ea,{stable:!0}),bt(st.cond(tr).then(wr,".enable(",ha,");").else(wr,".disable(",ha,");")),bt(Tr,".",pr,"=",tr,";")):(bt(st.cond(ea).then(wr,".enable(",ha,");").else(wr,".disable(",ha,");")),bt(Tr,".",pr,"=",ea,";"))}else if(ya(ea)){var Ea=vr[pr];bt(wr,".",Si[pr],"(",ea,");",ea.map(function(tn,Xa){return Ea+"["+Xa+"]="+tn}).join(";"),";")}else Wn(xr)?(tr=st.link(ea,{stable:!0}),bt(wr,".",Si[pr],"(",tr,");",Tr,".",pr,"=",tr,";")):bt(wr,".",Si[pr],"(",ea,");",Tr,".",pr,"=",ea,";")}})}function ll(st,bt){Ln&&(st.instancing=bt.def(st.shared.extensions,".angle_instanced_arrays"))}function Sl(st,bt,It,Jt,Kt){var vr=st.shared,Tr=st.stats,wr=vr.current,tr=vr.timer,pr=It.profile;function xr(){return typeof performance>"u"?"Date.now()":"performance.now()"}var ea,ha;function Ea(xn){ea=bt.def(),xn(ea,"=",xr(),";"),typeof Kt=="string"?xn(Tr,".count+=",Kt,";"):xn(Tr,".count++;"),si&&(Jt?(ha=bt.def(),xn(ha,"=",tr,".getNumPendingQueries();")):xn(tr,".beginQuery(",Tr,");"))}function tn(xn){xn(Tr,".cpuTime+=",xr(),"-",ea,";"),si&&(Jt?xn(tr,".pushScopeStats(",ha,",",tr,".getNumPendingQueries(),",Tr,");"):xn(tr,".endQuery();"))}function Xa(xn){var fn=bt.def(wr,".profile");bt(wr,".profile=",xn,";"),bt.exit(wr,".profile=",fn,";")}var Ya;if(pr){if(Wn(pr)){pr.enable?(Ea(bt),tn(bt.exit),Xa("true")):Xa("false");return}Ya=pr.append(st,bt),Xa(Ya)}else Ya=bt.def(wr,".profile");var an=st.block();Ea(an),bt("if(",Ya,"){",an,"}");var hn=st.block();tn(hn),bt.exit("if(",Ya,"){",hn,"}")}function qc(st,bt,It,Jt,Kt){var vr=st.shared;function Tr(tr){switch(tr){case ln:case Gi:case Zo:return 2;case Nn:case Bo:case Hs:return 3;case pi:case No:case zs:return 4;default:return 1}}function wr(tr,pr,xr){var ea=vr.gl,ha=bt.def(tr,".location"),Ea=bt.def(vr.attributes,"[",ha,"]"),tn=xr.state,Xa=xr.buffer,Ya=[xr.x,xr.y,xr.z,xr.w],an=["buffer","normalized","offset","stride"];function hn(){bt("if(!",Ea,".buffer){",ea,".enableVertexAttribArray(",ha,");}");var fn=xr.type,En;if(xr.size?En=bt.def(xr.size,"||",pr):En=pr,bt("if(",Ea,".type!==",fn,"||",Ea,".size!==",En,"||",an.map(function(vi){return Ea+"."+vi+"!=="+xr[vi]}).join("||"),"){",ea,".bindBuffer(",Et,",",Xa,".buffer);",ea,".vertexAttribPointer(",[ha,En,fn,xr.normalized,xr.stride,xr.offset],");",Ea,".type=",fn,";",Ea,".size=",En,";",an.map(function(vi){return Ea+"."+vi+"="+xr[vi]+";"}).join(""),"}"),Ln){var Yn=xr.divisor;bt("if(",Ea,".divisor!==",Yn,"){",st.instancing,".vertexAttribDivisorANGLE(",[ha,Yn],");",Ea,".divisor=",Yn,";}")}}function xn(){bt("if(",Ea,".buffer){",ea,".disableVertexAttribArray(",ha,");",Ea,".buffer=null;","}if(",Ja.map(function(fn,En){return Ea+"."+fn+"!=="+Ya[En]}).join("||"),"){",ea,".vertexAttrib4f(",ha,",",Ya,");",Ja.map(function(fn,En){return Ea+"."+fn+"="+Ya[En]+";"}).join(""),"}")}tn===on?hn():tn===Wa?xn():(bt("if(",tn,"===",on,"){"),hn(),bt("}else{"),xn(),bt("}"))}Jt.forEach(function(tr){var pr=tr.name,xr=It.attributes[pr],ea;if(xr){if(!Kt(xr))return;ea=xr.append(st,bt)}else{if(!Kt(hi))return;var ha=st.scopeAttrib(pr);ea={},Object.keys(new wn).forEach(function(Ea){ea[Ea]=bt.def(ha,".",Ea)})}wr(st.link(tr),Tr(tr.info.type),ea)})}function Hc(st,bt,It,Jt,Kt,vr){for(var Tr=st.shared,wr=Tr.gl,tr,pr=0;pr1){for(var Io=[],yo=[],vs=0;vs>1)",Xa],");")}function Yn(){It(Ya,".drawArraysInstancedANGLE(",[ha,Ea,tn,Xa],");")}xr&&xr!=="null"?hn?En():(It("if(",xr,"){"),En(),It("}else{"),Yn(),It("}")):Yn()}function fn(){function En(){It(vr+".drawElements("+[ha,tn,an,Ea+"<<(("+an+"-"+_n+")>>1)"]+");")}function Yn(){It(vr+".drawArrays("+[ha,Ea,tn]+");")}xr&&xr!=="null"?hn?En():(It("if(",xr,"){"),En(),It("}else{"),Yn(),It("}")):Yn()}Ln&&(typeof Xa!="number"||Xa>=0)?typeof Xa=="string"?(It("if(",Xa,">0){"),xn(),It("}else if(",Xa,"<0){"),fn(),It("}")):xn():fn()}function js(st,bt,It,Jt,Kt){var vr=oi(),Tr=vr.proc("body",Kt);return Ln&&(vr.instancing=Tr.def(vr.shared.extensions,".angle_instanced_arrays")),st(vr,Tr,It,Jt),vr.compile().body}function ls(st,bt,It,Jt){ll(st,bt),It.useVAO?It.drawVAO?bt(st.shared.vao,".setVAO(",It.drawVAO.append(st,bt),");"):bt(st.shared.vao,".setVAO(",st.shared.vao,".targetVAO);"):(bt(st.shared.vao,".setVAO(null);"),qc(st,bt,It,Jt.attributes,function(){return!0})),Hc(st,bt,It,Jt.uniforms,function(){return!0},!1),ss(st,bt,bt,It)}function ye(st,bt){var It=st.proc("draw",1);ll(st,It),su(st,It,bt.context),zu(st,It,bt.framebuffer),Fo(st,It,bt),nc(st,It,bt.state),Sl(st,It,bt,!1,!0);var Jt=bt.shader.progVar.append(st,It);if(It(st.shared.gl,".useProgram(",Jt,".program);"),bt.shader.program)ls(st,It,bt,bt.shader.program);else{It(st.shared.vao,".setVAO(null);");var Kt=st.global.def("{}"),vr=It.def(Jt,".id"),Tr=It.def(Kt,"[",vr,"]");It(st.cond(Tr).then(Tr,".call(this,a0);").else(Tr,"=",Kt,"[",vr,"]=",st.link(function(wr){return js(ls,st,bt,wr,1)}),"(",Jt,");",Tr,".call(this,a0);"))}Object.keys(bt.state).length>0&&It(st.shared.current,".dirty=true;"),st.shared.vao&&It(st.shared.vao,".setVAO(null);")}function W(st,bt,It,Jt){st.batchId="a1",ll(st,bt);function Kt(){return!0}qc(st,bt,It,Jt.attributes,Kt),Hc(st,bt,It,Jt.uniforms,Kt,!1),ss(st,bt,bt,It)}function de(st,bt,It,Jt){ll(st,bt);var Kt=It.contextDep,vr=bt.def(),Tr="a0",wr="a1",tr=bt.def();st.shared.props=tr,st.batchId=vr;var pr=st.scope(),xr=st.scope();bt(pr.entry,"for(",vr,"=0;",vr,"<",wr,";++",vr,"){",tr,"=",Tr,"[",vr,"];",xr,"}",pr.exit);function ea(an){return an.contextDep&&Kt||an.propDep}function ha(an){return!ea(an)}if(It.needsContext&&su(st,xr,It.context),It.needsFramebuffer&&zu(st,xr,It.framebuffer),nc(st,xr,It.state,ea),It.profile&&ea(It.profile)&&Sl(st,xr,It,!1,!0),Jt)It.useVAO?It.drawVAO?ea(It.drawVAO)?xr(st.shared.vao,".setVAO(",It.drawVAO.append(st,xr),");"):pr(st.shared.vao,".setVAO(",It.drawVAO.append(st,pr),");"):pr(st.shared.vao,".setVAO(",st.shared.vao,".targetVAO);"):(pr(st.shared.vao,".setVAO(null);"),qc(st,pr,It,Jt.attributes,ha),qc(st,xr,It,Jt.attributes,ea)),Hc(st,pr,It,Jt.uniforms,ha,!1),Hc(st,xr,It,Jt.uniforms,ea,!0),ss(st,pr,xr,It);else{var Ea=st.global.def("{}"),tn=It.shader.progVar.append(st,xr),Xa=xr.def(tn,".id"),Ya=xr.def(Ea,"[",Xa,"]");xr(st.shared.gl,".useProgram(",tn,".program);","if(!",Ya,"){",Ya,"=",Ea,"[",Xa,"]=",st.link(function(an){return js(W,st,It,an,2)}),"(",tn,");}",Ya,".call(this,a0[",vr,"],",vr,");")}}function te(st,bt){var It=st.proc("batch",2);st.batchId="0",ll(st,It);var Jt=!1,Kt=!0;Object.keys(bt.context).forEach(function(Ea){Jt=Jt||bt.context[Ea].propDep}),Jt||(su(st,It,bt.context),Kt=!1);var vr=bt.framebuffer,Tr=!1;vr?(vr.propDep?Jt=Tr=!0:vr.contextDep&&Jt&&(Tr=!0),Tr||zu(st,It,vr)):zu(st,It,null),bt.state.viewport&&bt.state.viewport.propDep&&(Jt=!0);function wr(Ea){return Ea.contextDep&&Jt||Ea.propDep}Fo(st,It,bt),nc(st,It,bt.state,function(Ea){return!wr(Ea)}),(!bt.profile||!wr(bt.profile))&&Sl(st,It,bt,!1,"a1"),bt.contextDep=Jt,bt.needsContext=Kt,bt.needsFramebuffer=Tr;var tr=bt.shader.progVar;if(tr.contextDep&&Jt||tr.propDep)de(st,It,bt,null);else{var pr=tr.append(st,It);if(It(st.shared.gl,".useProgram(",pr,".program);"),bt.shader.program)de(st,It,bt,bt.shader.program);else{It(st.shared.vao,".setVAO(null);");var xr=st.global.def("{}"),ea=It.def(pr,".id"),ha=It.def(xr,"[",ea,"]");It(st.cond(ha).then(ha,".call(this,a0,a1);").else(ha,"=",xr,"[",ea,"]=",st.link(function(Ea){return js(de,st,bt,Ea,2)}),"(",pr,");",ha,".call(this,a0,a1);"))}}Object.keys(bt.state).length>0&&It(st.shared.current,".dirty=true;"),st.shared.vao&&It(st.shared.vao,".setVAO(null);")}function me(st,bt){var It=st.proc("scope",3);st.batchId="a2";var Jt=st.shared,Kt=Jt.current;if(su(st,It,bt.context),bt.framebuffer&&bt.framebuffer.append(st,It),Ma(Object.keys(bt.state)).forEach(function(wr){var tr=bt.state[wr],pr=tr.append(st,It);ya(pr)?pr.forEach(function(xr,ea){ro(xr)?It.set(st.next[wr],"["+ea+"]",xr):It.set(st.next[wr],"["+ea+"]",st.link(xr,{stable:!0}))}):Wn(tr)?It.set(Jt.next,"."+wr,st.link(pr,{stable:!0})):It.set(Jt.next,"."+wr,pr)}),Sl(st,It,bt,!0,!0),[Se,yt,ot,Ct,Ie].forEach(function(wr){var tr=bt.draw[wr];if(tr){var pr=tr.append(st,It);ro(pr)?It.set(Jt.draw,"."+wr,pr):It.set(Jt.draw,"."+wr,st.link(pr),{stable:!0})}}),Object.keys(bt.uniforms).forEach(function(wr){var tr=bt.uniforms[wr].append(st,It);Array.isArray(tr)&&(tr="["+tr.map(function(pr){return ro(pr)?pr:st.link(pr,{stable:!0})})+"]"),It.set(Jt.uniforms,"["+st.link(fa.id(wr),{stable:!0})+"]",tr)}),Object.keys(bt.attributes).forEach(function(wr){var tr=bt.attributes[wr].append(st,It),pr=st.scopeAttrib(wr);Object.keys(new wn).forEach(function(xr){It.set(pr,"."+xr,tr[xr])})}),bt.scopeVAO){var vr=bt.scopeVAO.append(st,It);ro(vr)?It.set(Jt.vao,".targetVAO",vr):It.set(Jt.vao,".targetVAO",st.link(vr,{stable:!0}))}function Tr(wr){var tr=bt.shader[wr];if(tr){var pr=tr.append(st,It);ro(pr)?It.set(Jt.shader,"."+wr,pr):It.set(Jt.shader,"."+wr,st.link(pr,{stable:!0}))}}Tr(ne),Tr(Te),Object.keys(bt.state).length>0&&(It(Kt,".dirty=true;"),It.exit(Kt,".dirty=true;")),It("a1(",st.shared.context,",a0,",st.batchId,");")}function Ue(st){if(!(typeof st!="object"||ya(st))){for(var bt=Object.keys(st),It=0;It=0;--ss){var js=ro[ss];js&&js(si,null,0)}xa.flush(),Gn&&Gn.update()}function ys(){!oi&&ro.length>0&&(oi=f.next(Xo))}function xs(){oi&&(f.cancel(Xo),oi=null)}function Xs(ss){ss.preventDefault(),xs(),es.forEach(function(js){js()})}function Ps(ss){xa.getError(),In.restore(),Xn.restore(),Tn.restore(),$i.restore(),Cn.restore(),Mn.restore(),Pn.restore(),Gn&&Gn.restore(),Si.procs.refresh(),ys(),Fi.forEach(function(js){js()})}ri&&(ri.addEventListener(Es,Xs,!1),ri.addEventListener(hs,Ps,!1));function Mu(){ro.length=0,xs(),ri&&(ri.removeEventListener(Es,Xs),ri.removeEventListener(hs,Ps)),Xn.clear(),Mn.clear(),Cn.clear(),Pn.clear(),$i.clear(),Ln.clear(),Tn.clear(),Gn&&Gn.clear(),no.forEach(function(ss){ss()})}function dl(ss){function js(Kt){var vr=d({},Kt);delete vr.uniforms,delete vr.attributes,delete vr.context,delete vr.vao,"stencil"in vr&&vr.stencil.op&&(vr.stencil.opBack=vr.stencil.opFront=vr.stencil.op,delete vr.stencil.op);function Tr(wr){if(wr in vr){var tr=vr[wr];delete vr[wr],Object.keys(tr).forEach(function(pr){vr[wr+"."+pr]=tr[pr]})}}return Tr("blend"),Tr("depth"),Tr("cull"),Tr("stencil"),Tr("polygonOffset"),Tr("scissor"),Tr("sample"),"vao"in Kt&&(vr.vao=Kt.vao),vr}function ls(Kt,vr){var Tr={},wr={};return Object.keys(Kt).forEach(function(tr){var pr=Kt[tr];if(c.isDynamic(pr)){wr[tr]=c.unbox(pr,tr);return}else if(vr&&Array.isArray(pr)){for(var xr=0;xr0)return ft.call(this,It(Kt|0),Kt|0)}else if(Array.isArray(Kt)){if(Kt.length)return ft.call(this,Kt,Kt.length)}else return tt.call(this,Kt)}return d(Jt,{stats:me,destroy:function(){Ue.destroy()}})}var Eu=Mn.setFBO=dl({framebuffer:c.define.call(null,Hl,"framebuffer")});function ac(ss,js){var ls=0;Si.procs.poll();var ye=js.color;ye&&(xa.clearColor(+ye[0]||0,+ye[1]||0,+ye[2]||0,+ye[3]||0),ls|=Ms),"depth"in js&&(xa.clearDepth(+js.depth),ls|=Kn),"stencil"in js&&(xa.clearStencil(js.stencil|0),ls|=go),xa.clear(ls)}function Lc(ss){if("framebuffer"in ss)if(ss.framebuffer&&ss.framebuffer_reglType==="framebufferCube")for(var js=0;js<6;++js)Eu(d({framebuffer:ss.framebuffer.faces[js]},ss),ac);else Eu(ss,ac);else ac(null,ss)}function Pf(ss){ro.push(ss);function js(){var ls=gu(ro,ss);function ye(){var W=gu(ro,ye);ro[W]=ro[ro.length-1],ro.length-=1,ro.length<=0&&xs()}ro[ls]=ye}return ys(),{cancel:js}}function su(){var ss=gi.viewport,js=gi.scissor_box;ss[0]=ss[1]=js[0]=js[1]=0,si.viewportWidth=si.framebufferWidth=si.drawingBufferWidth=ss[2]=js[2]=xa.drawingBufferWidth,si.viewportHeight=si.framebufferHeight=si.drawingBufferHeight=ss[3]=js[3]=xa.drawingBufferHeight}function zu(){si.tick+=1,si.time=nc(),su(),Si.procs.poll()}function Fo(){$i.refresh(),su(),Si.procs.refresh(),Gn&&Gn.update()}function nc(){return(v()-ti)/1e3}Fo();function ll(ss,js){var ls;switch(ss){case"frame":return Pf(js);case"lost":ls=es;break;case"restore":ls=Fi;break;case"destroy":ls=no;break}return ls.push(js),{cancel:function(){for(var ye=0;ye=0},read:yn,destroy:Mu,_gl:xa,_refresh:Fo,poll:function(){zu(),Gn&&Gn.update()},now:nc,stats:Na,getCachedCode:Sl,preloadCachedCode:qc});return fa.onDone(null,Hc),Hc}return el})}}),$6=He({"node_modules/gl-util/context.js"(Y,G){var d=Gv();G.exports=function(o){if(o?typeof o=="string"&&(o={container:o}):o={},A(o)?o={container:o}:E(o)?o={container:o}:e(o)?o={gl:o}:o=d(o,{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),o.pixelRatio||(o.pixelRatio=window.pixelRatio||1),o.gl)return o.gl;if(o.canvas&&(o.container=o.canvas.parentNode),o.container){if(typeof o.container=="string"){var a=document.querySelector(o.container);if(!a)throw Error("Element "+o.container+" is not found");o.container=a}A(o.container)?(o.canvas=o.container,o.container=o.canvas.parentNode):o.canvas||(o.canvas=t(),o.container.appendChild(o.canvas),x(o))}else if(!o.canvas)if(typeof document<"u")o.container=document.body||document.documentElement,o.canvas=t(),o.container.appendChild(o.canvas),x(o);else throw Error("Not DOM environment. Use headless-gl.");return o.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(i){try{o.gl=o.canvas.getContext(i,o.attrs)}catch{}return o.gl}),o.gl};function x(r){if(r.container)if(r.container==document.body)document.body.style.width||(r.canvas.width=r.width||r.pixelRatio*window.innerWidth),document.body.style.height||(r.canvas.height=r.height||r.pixelRatio*window.innerHeight);else{var o=r.container.getBoundingClientRect();r.canvas.width=r.width||o.right-o.left,r.canvas.height=r.height||o.bottom-o.top}}function A(r){return typeof r.getContext=="function"&&"width"in r&&"height"in r}function E(r){return typeof r.nodeName=="string"&&typeof r.appendChild=="function"&&typeof r.getBoundingClientRect=="function"}function e(r){return typeof r.drawArrays=="function"||typeof r.drawElements=="function"}function t(){var r=document.createElement("canvas");return r.style.position="absolute",r.style.top=0,r.style.left=0,r}}}),Q6=He({"node_modules/font-atlas/index.js"(Y,G){var d=_T(),x=[32,126];G.exports=A;function A(E){E=E||{};var e=E.shape?E.shape:E.canvas?[E.canvas.width,E.canvas.height]:[512,512],t=E.canvas||document.createElement("canvas"),r=E.font,o=typeof E.step=="number"?[E.step,E.step]:E.step||[32,32],a=E.chars||x;if(r&&typeof r!="string"&&(r=d(r)),!Array.isArray(a))a=String(a).split("");else if(a.length===2&&typeof a[0]=="number"&&typeof a[1]=="number"){for(var i=[],n=a[0],s=0;n<=a[1];n++)i[s++]=String.fromCharCode(n);a=i}e=e.slice(),t.width=e[0],t.height=e[1];var c=t.getContext("2d");c.fillStyle="#000",c.fillRect(0,0,t.width,t.height),c.font=r,c.textAlign="center",c.textBaseline="middle",c.fillStyle="#fff";for(var f=o[0]/2,v=o[1]/2,n=0;ne[0]-o[0]/2&&(f=o[0]/2,v+=o[1]);return t}}}),bT=He({"node_modules/bit-twiddle/twiddle.js"(Y){"use restrict";var G=32;Y.INT_BITS=G,Y.INT_MAX=2147483647,Y.INT_MIN=-1<0)-(A<0)},Y.abs=function(A){var E=A>>G-1;return(A^E)-E},Y.min=function(A,E){return E^(A^E)&-(A65535)<<4,A>>>=E,e=(A>255)<<3,A>>>=e,E|=e,e=(A>15)<<2,A>>>=e,E|=e,e=(A>3)<<1,A>>>=e,E|=e,E|A>>1},Y.log10=function(A){return A>=1e9?9:A>=1e8?8:A>=1e7?7:A>=1e6?6:A>=1e5?5:A>=1e4?4:A>=1e3?3:A>=100?2:A>=10?1:0},Y.popCount=function(A){return A=A-(A>>>1&1431655765),A=(A&858993459)+(A>>>2&858993459),(A+(A>>>4)&252645135)*16843009>>>24};function d(A){var E=32;return A&=-A,A&&E--,A&65535&&(E-=16),A&16711935&&(E-=8),A&252645135&&(E-=4),A&858993459&&(E-=2),A&1431655765&&(E-=1),E}Y.countTrailingZeros=d,Y.nextPow2=function(A){return A+=A===0,--A,A|=A>>>1,A|=A>>>2,A|=A>>>4,A|=A>>>8,A|=A>>>16,A+1},Y.prevPow2=function(A){return A|=A>>>1,A|=A>>>2,A|=A>>>4,A|=A>>>8,A|=A>>>16,A-(A>>>1)},Y.parity=function(A){return A^=A>>>16,A^=A>>>8,A^=A>>>4,A&=15,27030>>>A&1};var x=new Array(256);(function(A){for(var E=0;E<256;++E){var e=E,t=E,r=7;for(e>>>=1;e;e>>>=1)t<<=1,t|=e&1,--r;A[E]=t<>>8&255]<<16|x[A>>>16&255]<<8|x[A>>>24&255]},Y.interleave2=function(A,E){return A&=65535,A=(A|A<<8)&16711935,A=(A|A<<4)&252645135,A=(A|A<<2)&858993459,A=(A|A<<1)&1431655765,E&=65535,E=(E|E<<8)&16711935,E=(E|E<<4)&252645135,E=(E|E<<2)&858993459,E=(E|E<<1)&1431655765,A|E<<1},Y.deinterleave2=function(A,E){return A=A>>>E&1431655765,A=(A|A>>>1)&858993459,A=(A|A>>>2)&252645135,A=(A|A>>>4)&16711935,A=(A|A>>>16)&65535,A<<16>>16},Y.interleave3=function(A,E,e){return A&=1023,A=(A|A<<16)&4278190335,A=(A|A<<8)&251719695,A=(A|A<<4)&3272356035,A=(A|A<<2)&1227133513,E&=1023,E=(E|E<<16)&4278190335,E=(E|E<<8)&251719695,E=(E|E<<4)&3272356035,E=(E|E<<2)&1227133513,A|=E<<1,e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,A|e<<2},Y.deinterleave3=function(A,E){return A=A>>>E&1227133513,A=(A|A>>>2)&3272356035,A=(A|A>>>4)&251719695,A=(A|A>>>8)&4278190335,A=(A|A>>>16)&1023,A<<22>>22},Y.nextCombination=function(A){var E=A|A-1;return E+1|(~E&-~E)-1>>>d(A)+1}}}),eI=He({"node_modules/dup/dup.js"(Y,G){function d(E,e,t){var r=E[t]|0;if(r<=0)return[];var o=new Array(r),a;if(t===E.length-1)for(a=0;a"u"&&(e=0),typeof E){case"number":if(E>0)return x(E|0,e);break;case"object":if(typeof E.length=="number")return d(E,e,0);break}return[]}G.exports=A}}),tI=He({"node_modules/typedarray-pool/pool.js"(Y){var G=bT(),d=eI(),x=zp().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:d([32,0]),UINT16:d([32,0]),UINT32:d([32,0]),BIGUINT64:d([32,0]),INT8:d([32,0]),INT16:d([32,0]),INT32:d([32,0]),BIGINT64:d([32,0]),FLOAT:d([32,0]),DOUBLE:d([32,0]),DATA:d([32,0]),UINT8C:d([32,0]),BUFFER:d([32,0])});var A=typeof Uint8ClampedArray<"u",E=typeof BigUint64Array<"u",e=typeof BigInt64Array<"u",t=window.__TYPEDARRAY_POOL;t.UINT8C||(t.UINT8C=d([32,0])),t.BIGUINT64||(t.BIGUINT64=d([32,0])),t.BIGINT64||(t.BIGINT64=d([32,0])),t.BUFFER||(t.BUFFER=d([32,0]));var r=t.DATA,o=t.BUFFER;Y.free=function(u){if(x.isBuffer(u))o[G.log2(u.length)].push(u);else{if(Object.prototype.toString.call(u)!=="[object ArrayBuffer]"&&(u=u.buffer),!u)return;var g=u.length||u.byteLength,m=G.log2(g)|0;r[m].push(u)}};function a(p){if(p){var u=p.length||p.byteLength,g=G.log2(u);r[g].push(p)}}function i(p){a(p.buffer)}Y.freeUint8=Y.freeUint16=Y.freeUint32=Y.freeBigUint64=Y.freeInt8=Y.freeInt16=Y.freeInt32=Y.freeBigInt64=Y.freeFloat32=Y.freeFloat=Y.freeFloat64=Y.freeDouble=Y.freeUint8Clamped=Y.freeDataView=i,Y.freeArrayBuffer=a,Y.freeBuffer=function(u){o[G.log2(u.length)].push(u)},Y.malloc=function(u,g){if(g===void 0||g==="arraybuffer")return n(u);switch(g){case"uint8":return s(u);case"uint16":return c(u);case"uint32":return f(u);case"int8":return v(u);case"int16":return h(u);case"int32":return T(u);case"float":case"float32":return l(u);case"double":case"float64":return y(u);case"uint8_clamped":return b(u);case"bigint64":return M(u);case"biguint64":return S(u);case"buffer":return w(u);case"data":case"dataview":return _(u);default:return null}return null};function n(u){var u=G.nextPow2(u),g=G.log2(u),m=r[g];return m.length>0?m.pop():new ArrayBuffer(u)}Y.mallocArrayBuffer=n;function s(p){return new Uint8Array(n(p),0,p)}Y.mallocUint8=s;function c(p){return new Uint16Array(n(2*p),0,p)}Y.mallocUint16=c;function f(p){return new Uint32Array(n(4*p),0,p)}Y.mallocUint32=f;function v(p){return new Int8Array(n(p),0,p)}Y.mallocInt8=v;function h(p){return new Int16Array(n(2*p),0,p)}Y.mallocInt16=h;function T(p){return new Int32Array(n(4*p),0,p)}Y.mallocInt32=T;function l(p){return new Float32Array(n(4*p),0,p)}Y.mallocFloat32=Y.mallocFloat=l;function y(p){return new Float64Array(n(8*p),0,p)}Y.mallocFloat64=Y.mallocDouble=y;function b(p){return A?new Uint8ClampedArray(n(p),0,p):s(p)}Y.mallocUint8Clamped=b;function S(p){return E?new BigUint64Array(n(8*p),0,p):null}Y.mallocBigUint64=S;function M(p){return e?new BigInt64Array(n(8*p),0,p):null}Y.mallocBigInt64=M;function _(p){return new DataView(n(p),0,p)}Y.mallocDataView=_;function w(p){p=G.nextPow2(p);var u=G.log2(p),g=o[u];return g.length>0?g.pop():new x(p)}Y.mallocBuffer=w,Y.clearCache=function(){for(var u=0;u<32;++u)t.UINT8[u].length=0,t.UINT16[u].length=0,t.UINT32[u].length=0,t.INT8[u].length=0,t.INT16[u].length=0,t.INT32[u].length=0,t.FLOAT[u].length=0,t.DOUBLE[u].length=0,t.BIGUINT64[u].length=0,t.BIGINT64[u].length=0,t.UINT8C[u].length=0,r[u].length=0,o[u].length=0}}}),rI=He({"node_modules/is-plain-obj/index.js"(Y,G){var d=Object.prototype.toString;G.exports=function(x){var A;return d.call(x)==="[object Object]"&&(A=Object.getPrototypeOf(x),A===null||A===Object.getPrototypeOf({}))}}}),wT=He({"node_modules/parse-unit/index.js"(Y,G){G.exports=function(x,A){A||(A=[0,""]),x=String(x);var E=parseFloat(x,10);return A[0]=E,A[1]=x.match(/[\d.\-\+]*\s*(.*)/)[1]||"",A}}}),aI=He({"node_modules/to-px/topx.js"(Y,G){var d=wT();G.exports=e;var x=96;function A(t,r){var o=d(getComputedStyle(t).getPropertyValue(r));return o[0]*e(o[1],t)}function E(t,r){var o=document.createElement("div");o.style["font-size"]="128"+t,r.appendChild(o);var a=A(o,"font-size")/128;return r.removeChild(o),a}function e(t,r){switch(r=r||document.body,t=(t||"px").trim().toLowerCase(),(r===window||r===document)&&(r=document.body),t){case"%":return r.clientHeight/100;case"ch":case"ex":return E(t,r);case"em":return A(r,"font-size");case"rem":return A(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return x;case"cm":return x/2.54;case"mm":return x/25.4;case"pt":return x/72;case"pc":return x/6}return 1}}}),nI=He({"node_modules/detect-kerning/index.js"(Y,G){G.exports=E;var d=E.canvas=document.createElement("canvas"),x=d.getContext("2d"),A=e([32,126]);E.createPairs=e,E.ascii=A;function E(t,r){Array.isArray(t)&&(t=t.join(", "));var o={},a,i=16,n=.05;r&&(r.length===2&&typeof r[0]=="number"?a=e(r):Array.isArray(r)?a=r:(r.o?a=e(r.o):r.pairs&&(a=r.pairs),r.fontSize&&(i=r.fontSize),r.threshold!=null&&(n=r.threshold))),a||(a=A),x.font=i+"px "+t;for(var s=0;si*n){var h=(v-f)/i;o[c]=h*1e3}}return o}function e(t){for(var r=[],o=t[0];o<=t[1];o++)for(var a=String.fromCharCode(o),i=t[0];i0;o-=4)if(r[o]!==0)return Math.floor((o-3)*.25/t)}}}),oI=He({"node_modules/gl-text/dist.js"(Y,G){var d=J6(),x=Gv(),A=xT(),E=$6(),e=fT(),t=rp(),r=Q6(),o=tI(),a=cg(),i=rI(),n=wT(),s=aI(),c=nI(),f=Yc(),v=iI(),h=Yp(),T=bT(),l=T.nextPow2,y=new e,b=!1;document.body&&(S=document.body.appendChild(document.createElement("div")),S.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(S).fontStretch&&(b=!0),document.body.removeChild(S));var S,M=function(p){_(p)?(p={regl:p},this.gl=p.regl._gl):this.gl=E(p),this.shader=y.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=p.regl||A({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),y.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(i(p)?p:{})};M.prototype.createShader=function(){var p=this.regl,u=p({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:p.prop("count"),offset:p.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:p.this("sizeBuffer")},width:{offset:0,stride:8,buffer:p.this("sizeBuffer")},char:p.this("charBuffer"),position:p.this("position")},uniforms:{atlasSize:function(m,R){return[R.atlas.width,R.atlas.height]},atlasDim:function(m,R){return[R.atlas.cols,R.atlas.rows]},atlas:function(m,R){return R.atlas.texture},charStep:function(m,R){return R.atlas.step},em:function(m,R){return R.atlas.em},color:p.prop("color"),opacity:p.prop("opacity"),viewport:p.this("viewportArray"),scale:p.this("scale"),align:p.prop("align"),baseline:p.prop("baseline"),translate:p.this("translate"),positionOffset:p.prop("positionOffset")},primitive:"points",viewport:p.this("viewport"),vert:` + precision highp float; + attribute float width, charOffset, char; + attribute vec2 position; + uniform float fontSize, charStep, em, align, baseline; + uniform vec4 viewport; + uniform vec4 color; + uniform vec2 atlasSize, atlasDim, scale, translate, positionOffset; + varying vec2 charCoord, charId; + varying float charWidth; + varying vec4 fontColor; + void main () { + vec2 offset = floor(em * (vec2(align + charOffset, baseline) + + vec2(positionOffset.x, -positionOffset.y))) + / (viewport.zw * scale.xy); + + vec2 position = (position + translate) * scale; + position += offset * scale; + + charCoord = position * viewport.zw + viewport.xy; + + gl_Position = vec4(position * 2. - 1., 0, 1); + + gl_PointSize = charStep; + + charId.x = mod(char, atlasDim.x); + charId.y = floor(char / atlasDim.x); + + charWidth = width * em; + + fontColor = color / 255.; + }`,frag:` + precision highp float; + uniform float fontSize, charStep, opacity; + uniform vec2 atlasSize; + uniform vec4 viewport; + uniform sampler2D atlas; + varying vec4 fontColor; + varying vec2 charCoord, charId; + varying float charWidth; + + float lightness(vec4 color) { + return color.r * 0.299 + color.g * 0.587 + color.b * 0.114; + } + + void main () { + vec2 uv = gl_FragCoord.xy - charCoord + charStep * .5; + float halfCharStep = floor(charStep * .5 + .5); + + // invert y and shift by 1px (FF expecially needs that) + uv.y = charStep - uv.y; + + // ignore points outside of character bounding box + float halfCharWidth = ceil(charWidth * .5); + if (floor(uv.x) > 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; + }`}),g={};return{regl:p,draw:u,atlas:g}},M.prototype.update=function(p){var u=this;if(typeof p=="string")p={text:p};else if(!p)return;p=x(p,{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),p.opacity!=null&&(Array.isArray(p.opacity)?this.opacity=p.opacity.map(function(ce){return parseFloat(ce)}):this.opacity=parseFloat(p.opacity)),p.viewport!=null&&(this.viewport=a(p.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]),p.kerning!=null&&(this.kerning=p.kerning),p.offset!=null&&(typeof p.offset=="number"&&(p.offset=[p.offset,0]),this.positionOffset=h(p.offset)),p.direction&&(this.direction=p.direction),p.range&&(this.range=p.range,this.scale=[1/(p.range[2]-p.range[0]),1/(p.range[3]-p.range[1])],this.translate=[-p.range[0],-p.range[1]]),p.scale&&(this.scale=p.scale),p.translate&&(this.translate=p.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!p.font&&(p.font=M.baseFontSize+"px sans-serif");var g=!1,m=!1;if(p.font&&(Array.isArray(p.font)?p.font:[p.font]).forEach(function(ce,Re){if(typeof ce=="string")try{ce=d.parse(ce)}catch{ce=d.parse(M.baseFontSize+"px "+ce)}else{var $e=ce.style,rt=ce.weight,Je=ce.stretch,At=ce.variant;ce=d.parse(d.stringify(ce)),$e&&(ce.style=$e),rt&&(ce.weight=rt),Je&&(ce.stretch=Je),At&&(ce.variant=At)}var St=d.stringify({size:M.baseFontSize,family:ce.family,stretch:b?ce.stretch:void 0,variant:ce.variant,weight:ce.weight,style:ce.style}),Rt=n(ce.size),Ut=Math.round(Rt[0]*s(Rt[1]));if(Ut!==u.fontSize[Re]&&(m=!0,u.fontSize[Re]=Ut),(!u.font[Re]||St!=u.font[Re].baseString)&&(g=!0,u.font[Re]=M.fonts[St],!u.font[Re])){var ir=ce.family.join(", "),ar=[ce.style];ce.style!=ce.variant&&ar.push(ce.variant),ce.variant!=ce.weight&&ar.push(ce.weight),b&&ce.weight!=ce.stretch&&ar.push(ce.stretch),u.font[Re]={baseString:St,family:ir,weight:ce.weight,stretch:ce.stretch,style:ce.style,variant:ce.variant,width:{},kerning:{},metrics:v(ir,{origin:"top",fontSize:M.baseFontSize,fontStyle:ar.join(" ")})},M.fonts[St]=u.font[Re]}}),(g||m)&&this.font.forEach(function(ce,Re){var $e=d.stringify({size:u.fontSize[Re],family:ce.family,stretch:b?ce.stretch:void 0,variant:ce.variant,weight:ce.weight,style:ce.style});if(u.fontAtlas[Re]=u.shader.atlas[$e],!u.fontAtlas[Re]){var rt=ce.metrics;u.shader.atlas[$e]=u.fontAtlas[Re]={fontString:$e,step:Math.ceil(u.fontSize[Re]*rt.bottom*.5)*2,em:u.fontSize[Re],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:u.regl.texture()}}p.text==null&&(p.text=u.text)}),typeof p.text=="string"&&p.position&&p.position.length>2){for(var R=Array(p.position.length*.5),P=0;P2){for(var B=!p.position[0].length,O=o.mallocFloat(this.count*2),L=0,N=0;L1?u.align[Re]:u.align[0]:u.align;if(typeof $e=="number")return $e;switch($e){case"right":case"end":return-ce;case"center":case"centre":case"middle":return-ce*.5}return 0})),this.baseline==null&&p.baseline==null&&(p.baseline=0),p.baseline!=null&&(this.baseline=p.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(ce,Re){var $e=(u.font[Re]||u.font[0]).metrics,rt=0;return rt+=$e.bottom*.5,typeof ce=="number"?rt+=ce-$e.baseline:rt+=-$e[ce],rt*=-1,rt})),p.color!=null)if(p.color||(p.color="transparent"),typeof p.color=="string"||!isNaN(p.color))this.color=t(p.color,"uint8");else{var Fe;if(typeof p.color[0]=="number"&&p.color.length>this.counts.length){var Ce=p.color.length;Fe=o.mallocUint8(Ce);for(var qe=(p.color.subarray||p.color.slice).bind(p.color),et=0;et4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(Xe){var Me=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(Me);for(var xe=0;xe1?this.counts[xe]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[xe]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(xe*4,xe*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[xe]:this.opacity,baseline:this.baselineOffset[xe]!=null?this.baselineOffset[xe]:this.baselineOffset[0],align:this.align?this.alignOffset[xe]!=null?this.alignOffset[xe]:this.alignOffset[0]:0,atlas:this.fontAtlas[xe]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(xe*2,xe*2+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={};function _(w){return typeof w=="function"&&w._gl&&w.prop&&w.texture&&w.buffer}G.exports=M}}),ax=He({"src/lib/prepare_regl.js"(Y,G){var d=I3(),x=xT();G.exports=function(E,e,t){var r=E._fullLayout,o=!0;return r._glcanvas.each(function(a){if(a.regl){a.regl.preloadCachedCode(t);return}if(!(a.pick&&!r._has("parcoords"))){try{a.regl=x({canvas:this,attributes:{antialias:!a.pick,preserveDrawingBuffer:!0},pixelRatio:E._context.plotGlPixelRatio||window.devicePixelRatio,extensions:e||[],cachedCode:t||{}})}catch{o=!1}a.regl||(o=!1),o&&this.addEventListener("webglcontextlost",function(i){E&&E.emit&&E.emit("plotly_webglcontextlost",{event:i,layer:a.key})},!1)}}),o||d({container:r._glcontainer.node()}),o}}}),TT=He({"src/traces/scattergl/plot.js"(c,G){var d=eT(),x=hT(),A=G6(),E=oI(),e=Gr(),t=bv().selectMode,r=ax(),o=Rl(),a=Kb(),i=J3().styleTextSelection,n={};function s(f,v,h,T){var l=f._size,y=f.width*T,b=f.height*T,S=l.l*T,M=l.b*T,_=l.r*T,w=l.t*T,p=l.w*T,u=l.h*T;return[S+v.domain[0]*p,M+h.domain[0]*u,y-_-(1-v.domain[1])*p,b-w-(1-h.domain[1])*u]}var c=G.exports=function(v,h,T){if(T.length){var l=v._fullLayout,y=h._scene,b=h.xaxis,S=h.yaxis,M,_;if(y){var w=r(v,["ANGLE_instanced_arrays","OES_element_index_uint"],n);if(!w){y.init();return}var p=y.count,u=l._glcanvas.data()[0].regl;if(a(v,h,T),y.dirty){if((y.line2d||y.error2d)&&!(y.scatter2d||y.fill2d||y.glText)&&u.clear({}),y.error2d===!0&&(y.error2d=A(u)),y.line2d===!0&&(y.line2d=x(u)),y.scatter2d===!0&&(y.scatter2d=d(u)),y.fill2d===!0&&(y.fill2d=x(u)),y.glText===!0)for(y.glText=new Array(p),M=0;My.glText.length){var g=p-y.glText.length;for(M=0;Mie&&(isNaN(ae[fe])||isNaN(ae[fe+1]));)fe-=2;q.positions=ae.slice(ie,fe+2)}return q}),y.line2d.update(y.lineOptions)),y.error2d){var P=(y.errorXOptions||[]).concat(y.errorYOptions||[]);y.error2d.update(P)}y.scatter2d&&y.scatter2d.update(y.markerOptions),y.fillOrder=e.repeat(null,p),y.fill2d&&(y.fillOptions=y.fillOptions.map(function(q,ae){var ie=T[ae];if(!(!q||!ie||!ie[0]||!ie[0].trace)){var fe=ie[0],we=fe.trace,Ae=fe.t,Fe=y.lineOptions[ae],Ce,qe,et=[];we._ownfill&&et.push(ae),we._nexttrace&&et.push(ae+1),et.length&&(y.fillOrder[ae]=et);var Qe=[],Ke=Fe&&Fe.positions||Ae.positions,Xe,Me;if(we.fill==="tozeroy"){for(Xe=0;XeXe&&isNaN(Ke[Me+1]);)Me-=2;Ke[Xe+1]!==0&&(Qe=[Ke[Xe],0]),Qe=Qe.concat(Ke.slice(Xe,Me+2)),Ke[Me+1]!==0&&(Qe=Qe.concat([Ke[Me],0]))}else if(we.fill==="tozerox"){for(Xe=0;XeXe&&isNaN(Ke[Me]);)Me-=2;Ke[Xe]!==0&&(Qe=[0,Ke[Xe+1]]),Qe=Qe.concat(Ke.slice(Xe,Me+2)),Ke[Me]!==0&&(Qe=Qe.concat([0,Ke[Me+1]]))}else if(we.fill==="toself"||we.fill==="tonext"){for(Qe=[],Ce=0,q.splitNull=!0,qe=0;qe-1;for(M=0;Mb&&h||yi,m;for(g?m=h.sizeAvg||Math.max(h.size,3):m=A(c,v),S=0;S{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,E(()=>{this.dirty=!1})),this)},o.prototype.update=function(...s){if(!s.length)return;for(let v=0;vm||!h.lower&&g{c[T+y]=v})}this.scatter.draw(...c)}return this},o.prototype.destroy=function(){return this.traces.forEach(s=>{s.buffer&&s.buffer.destroy&&s.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function a(s,c,f){let v=s.id!=null?s.id:s,h=c,T=f;return v<<16|(h&255)<<8|T&255}function i(s,c,f){let v,h,T,l,y=s[c],b=s[f];return y.length>2?(y[0],y[2],v=y[1],h=y[3]):y.length?(v=y[0],h=y[1]):(y.x,v=y.y,y.x+y.width,h=y.y+y.height),b.length>2?(T=b[0],l=b[2],b[1],b[3]):b.length?(T=b[0],l=b[1]):(T=b.x,b.y,l=b.x+b.width,b.y+b.height),[T,v,l,h]}function n(s){if(typeof s=="number")return[s,s,s,s];if(s.length===2)return[s[0],s[1],s[0],s[1]];{let c=t(s);return[c.x,c.y,c.x+c.width,c.y+c.height]}}}}),gI=He({"src/traces/splom/plot.js"(Y,G){var d=pI(),x=Gr(),A=oc(),E=bv().selectMode;G.exports=function(r,o,a){if(a.length)for(var i=0;i-1,B=E(h)||!!i.selectedpoints||F,O=!0;if(B){var L=i._length;if(i.selectedpoints){s.selectBatch=i.selectedpoints;var N=i.selectedpoints,U={};for(y=0;y=Z[Q][0]&&U<=Z[Q][1])return!0;return!1}function c(U){U.attr("x",-d.bar.captureWidth/2).attr("width",d.bar.captureWidth)}function f(U){U.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function v(U){if(!U.brush.filterSpecified)return"0,"+U.height;for(var Z=h(U.brush.filter.getConsolidated(),U.height),Q=[0],ue,oe,le,j=Z.length?Z[0][0]:null,J=0;JU[1]+Q||Z=.9*U[1]+.1*U[0]?"n":Z<=.9*U[0]+.1*U[1]?"s":"ns"}function l(){x.select(document.body).style("cursor",null)}function y(U){U.attr("stroke-dasharray",v)}function b(U,Z){var Q=x.select(U).selectAll(".highlight, .highlight-shadow"),ue=Z?Q.transition().duration(d.bar.snapDuration).each("end",Z):Q;y(ue)}function S(U,Z){var Q=U.brush,ue=Q.filterSpecified,oe=NaN,le={},j;if(ue){var J=U.height,$=Q.filter.getConsolidated(),X=h($,J),re=NaN,ee=NaN,q=NaN;for(j=0;j<=X.length;j++){var ae=X[j];if(ae&&ae[0]<=Z&&Z<=ae[1]){re=j;break}else if(ee=j?j-1:NaN,ae&&ae[0]>Z){q=j;break}}if(oe=re,isNaN(oe)&&(isNaN(ee)||isNaN(q)?oe=isNaN(ee)?q:ee:oe=Z-X[ee][1]=Fe[0]&&Ae<=Fe[1]){le.clickableOrdinalRange=Fe;break}}}return le}function M(U,Z){x.event.sourceEvent.stopPropagation();var Q=Z.height-x.mouse(U)[1]-2*d.verticalPadding,ue=Z.unitToPaddedPx.invert(Q),oe=Z.brush,le=S(Z,Q),j=le.interval,J=oe.svgBrush;if(J.wasDragged=!1,J.grabbingBar=le.region==="ns",J.grabbingBar){var $=j.map(Z.unitToPaddedPx);J.grabPoint=Q-$[0]-d.verticalPadding,J.barLength=$[1]-$[0]}J.clickableOrdinalRange=le.clickableOrdinalRange,J.stayingIntervals=Z.multiselect&&oe.filterSpecified?oe.filter.getConsolidated():[],j&&(J.stayingIntervals=J.stayingIntervals.filter(function(X){return X[0]!==j[0]&&X[1]!==j[1]})),J.startExtent=le.region?j[le.region==="s"?1:0]:ue,Z.parent.inBrushDrag=!0,J.brushStartCallback()}function _(U,Z){x.event.sourceEvent.stopPropagation();var Q=Z.height-x.mouse(U)[1]-2*d.verticalPadding,ue=Z.brush.svgBrush;ue.wasDragged=!0,ue._dragging=!0,ue.grabbingBar?ue.newExtent=[Q-ue.grabPoint,Q+ue.barLength-ue.grabPoint].map(Z.unitToPaddedPx.invert):ue.newExtent=[ue.startExtent,Z.unitToPaddedPx.invert(Q)].sort(e),Z.brush.filterSpecified=!0,ue.extent=ue.stayingIntervals.concat([ue.newExtent]),ue.brushCallback(Z),b(U.parentNode)}function w(U,Z){var Q=Z.brush,ue=Q.filter,oe=Q.svgBrush;oe._dragging||(p(U,Z),_(U,Z),Z.brush.svgBrush.wasDragged=!1),oe._dragging=!1;var le=x.event;le.sourceEvent.stopPropagation();var j=oe.grabbingBar;if(oe.grabbingBar=!1,oe.grabLocation=void 0,Z.parent.inBrushDrag=!1,l(),!oe.wasDragged){oe.wasDragged=void 0,oe.clickableOrdinalRange?Q.filterSpecified&&Z.multiselect?oe.extent.push(oe.clickableOrdinalRange):(oe.extent=[oe.clickableOrdinalRange],Q.filterSpecified=!0):j?(oe.extent=oe.stayingIntervals,oe.extent.length===0&&z(Q)):z(Q),oe.brushCallback(Z),b(U.parentNode),oe.brushEndCallback(Q.filterSpecified?ue.getConsolidated():[]);return}var J=function(){ue.set(ue.getConsolidated())};if(Z.ordinal){var $=Z.unitTickvals;$[$.length-1]<$[0]&&$.reverse(),oe.newExtent=[n(0,$,oe.newExtent[0],oe.stayingIntervals),n(1,$,oe.newExtent[1],oe.stayingIntervals)];var X=oe.newExtent[1]>oe.newExtent[0];oe.extent=oe.stayingIntervals.concat(X?[oe.newExtent]:[]),oe.extent.length||z(Q),oe.brushCallback(Z),X?b(U.parentNode,J):(J(),b(U.parentNode))}else J();oe.brushEndCallback(Q.filterSpecified?ue.getConsolidated():[])}function p(U,Z){var Q=Z.height-x.mouse(U)[1]-2*d.verticalPadding,ue=S(Z,Q),oe="crosshair";ue.clickableOrdinalRange?oe="pointer":ue.region&&(oe=ue.region+"-resize"),x.select(document.body).style("cursor",oe)}function u(U){U.on("mousemove",function(Z){x.event.preventDefault(),Z.parent.inBrushDrag||p(this,Z)}).on("mouseleave",function(Z){Z.parent.inBrushDrag||l()}).call(x.behavior.drag().on("dragstart",function(Z){M(this,Z)}).on("drag",function(Z){_(this,Z)}).on("dragend",function(Z){w(this,Z)}))}function g(U,Z){return U[0]-Z[0]}function m(U,Z,Q){var ue=Q._context.staticPlot,oe=U.selectAll(".background").data(E);oe.enter().append("rect").classed("background",!0).call(c).call(f).style("pointer-events",ue?"none":"auto").attr("transform",t(0,d.verticalPadding)),oe.call(u).attr("height",function(J){return J.height-d.verticalPadding});var le=U.selectAll(".highlight-shadow").data(E);le.enter().append("line").classed("highlight-shadow",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width+d.bar.strokeWidth).attr("stroke",Z).attr("opacity",d.bar.strokeOpacity).attr("stroke-linecap","butt"),le.attr("y1",function(J){return J.height}).call(y);var j=U.selectAll(".highlight").data(E);j.enter().append("line").classed("highlight",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width-d.bar.strokeWidth).attr("stroke",d.bar.fillColor).attr("opacity",d.bar.fillOpacity).attr("stroke-linecap","butt"),j.attr("y1",function(J){return J.height}).call(y)}function R(U,Z,Q){var ue=U.selectAll("."+d.cn.axisBrush).data(E,A);ue.enter().append("g").classed(d.cn.axisBrush,!0),m(ue,Z,Q)}function P(U){return U.svgBrush.extent.map(function(Z){return Z.slice()})}function z(U){U.filterSpecified=!1,U.svgBrush.extent=[[-1/0,1/0]]}function F(U){return function(Q){var ue=Q.brush,oe=P(ue),le=oe.slice();ue.filter.set(le),U()}}function B(U){for(var Z=U.slice(),Q=[],ue,oe=Z.shift();oe;){for(ue=oe.slice();(oe=Z.shift())&&oe[0]<=ue[1];)ue[1]=Math.max(ue[1],oe[1]);Q.push(ue)}return Q.length===1&&Q[0][0]>Q[0][1]&&(Q=[]),Q}function O(){var U=[],Z,Q;return{set:function(ue){U=ue.map(function(oe){return oe.slice().sort(e)}).sort(g),U.length===1&&U[0][0]===-1/0&&U[0][1]===1/0&&(U=[[0,-1]]),Z=B(U),Q=U.reduce(function(oe,le){return[Math.min(oe[0],le[0]),Math.max(oe[1],le[1])]},[1/0,-1/0])},get:function(){return U.slice()},getConsolidated:function(){return Z},getBounds:function(){return Q}}}function L(U,Z,Q,ue,oe,le){var j=O();return j.set(Q),{filter:j,filterSpecified:Z,svgBrush:{extent:[],brushStartCallback:ue,brushCallback:F(oe),brushEndCallback:le}}}function N(U,Z){if(Array.isArray(U[0])?(U=U.map(function(ue){return ue.sort(e)}),Z.multiselect?U=B(U.sort(g)):U=[U[0]]):U=[U.sort(e)],Z.tickvals){var Q=Z.tickvals.slice().sort(e);if(U=U.map(function(ue){var oe=[n(0,Q,ue[0],[]),n(1,Q,ue[1],[])];if(oe[1]>oe[0])return oe}).filter(function(ue){return ue}),!U.length)return}return U.length>1?U:U[0]}G.exports={makeBrush:L,ensureAxisBrush:R,cleanRanges:N}}}),AI=He({"src/traces/parcoords/defaults.js"(Y,G){var d=Gr(),x=Ah().hasColorscale,A=pf(),E=mu().defaults,e=rh(),t=io(),r=MT(),o=ET(),a=Zy().maxDimensionCount,i=nx();function n(c,f,v,h,T){var l=T("line.color",v);if(x(c,"line")&&d.isArrayOrTypedArray(l)){if(l.length)return T("line.colorscale"),A(c,f,h,T,{prefix:"line.",cLetter:"c"}),l.length;f.line.color=v}return 1/0}function s(c,f,v,h){function T(M,_){return d.coerce(c,f,r.dimensions,M,_)}var l=T("values"),y=T("visible");if(l&&l.length||(y=f.visible=!1),y){T("label"),T("tickvals"),T("ticktext"),T("tickformat");var b=T("range");f._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:b},t.setConvert(f._ax,h.layout),T("multiselect");var S=T("constraintrange");S&&(f.constraintrange=o.cleanRanges(S,f))}}G.exports=function(f,v,h,T){function l(_,w){return d.coerce(f,v,r,_,w)}var y=f.dimensions;Array.isArray(y)&&y.length>a&&(d.log("parcoords traces support up to "+a+" dimensions at the moment"),y.splice(a));var b=e(f,v,{name:"dimensions",layout:T,handleItemDefaults:s}),S=n(f,v,h,T,l);E(v,T,l),(!Array.isArray(b)||!b.length)&&(v.visible=!1),i(v,b,"values",S);var M=d.extendFlat({},T.font,{size:Math.round(T.font.size/1.2)});d.coerceFont(l,"labelfont",M),d.coerceFont(l,"tickfont",M,{autoShadowDflt:!0}),d.coerceFont(l,"rangefont",M),l("labelangle"),l("labelside"),l("unselected.line.color"),l("unselected.line.opacity")}}}),SI=He({"src/traces/parcoords/calc.js"(Y,G){var d=Gr().isArrayOrTypedArray,x=Kl(),A=Wv().wrap;G.exports=function(t,r){var o,a;return x.hasColorscale(r,"line")&&d(r.line.color)?(o=r.line.color,a=x.extractOpts(r.line).colorscale,x.calc(t,r,{vals:o,containerStr:"line",cLetter:"c"})):(o=E(r._length),a=[[0,r.line.color],[1,r.line.color]]),A({lineColor:o,cscale:a})};function E(e){for(var t=new Array(e),r=0;r>>16,(Y&65280)>>>8,Y&255],alpha:1};if(typeof Y=="number")return{space:"rgb",values:[Y>>>16,(Y&65280)>>>8,Y&255],alpha:1};if(Y=String(Y).toLowerCase(),ix.default[Y])A=ix.default[Y].slice(),e="rgb";else if(Y==="transparent")E=0,e="rgb",A=[0,0,0];else if(Y[0]==="#"){var t=Y.slice(1),r=t.length,o=r<=4;E=1,o?(A=[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16)],r===4&&(E=parseInt(t[3]+t[3],16)/255)):(A=[parseInt(t[0]+t[1],16),parseInt(t[2]+t[3],16),parseInt(t[4]+t[5],16)],r===8&&(E=parseInt(t[6]+t[7],16)/255)),A[0]||(A[0]=0),A[1]||(A[1]=0),A[2]||(A[2]=0),e="rgb"}else if(x=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(Y)){var a=x[1];e=a.replace(/a$/,"");var i=e==="cmyk"?4:e==="gray"?1:3;A=x[2].trim().split(/\s*[,\/]\s*|\s+/),e==="color"&&(e=A.shift()),A=A.map(function(n,s){if(n[n.length-1]==="%")return n=parseFloat(n)/100,s===3?n:e==="rgb"?n*255:e[0]==="h"||e[0]==="l"&&!s?n*100:e==="lab"?n*125:e==="lch"?s<2?n*150:n*360:e[0]==="o"&&!s?n:e==="oklab"?n*.4:e==="oklch"?s<2?n*.4:n*360:n;if(e[s]==="h"||s===2&&e[e.length-1]==="h"){if(ox[n]!==void 0)return ox[n];if(n.endsWith("deg"))return parseFloat(n);if(n.endsWith("turn"))return parseFloat(n)*360;if(n.endsWith("grad"))return parseFloat(n)*360/400;if(n.endsWith("rad"))return parseFloat(n)*180/Math.PI}return n==="none"?0:parseFloat(n)}),E=A.length>i?A.pop():1}else/[0-9](?:\s|\/|,)/.test(Y)&&(A=Y.match(/([0-9]+)/g).map(function(n){return parseFloat(n)}),e=((d=(G=Y.match(/([a-z])/ig))==null?void 0:G.join(""))==null?void 0:d.toLowerCase())||"rgb");return{space:e,values:A,alpha:E}}var ix,kT,ox,EI=ks({"node_modules/color-parse/index.js"(){ix=Zm(C3()),kT=MI,ox={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Xy,CT=ks({"node_modules/color-space/rgb.js"(){Xy={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),Yy,kI=ks({"node_modules/color-space/hsl.js"(){CT(),Yy={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(Y){var G=Y[0]/360,d=Y[1]/100,x=Y[2]/100,A,E,e,t,r,o=0;if(d===0)return r=x*255,[r,r,r];for(E=x<.5?x*(1+d):x+d-x*d,A=2*x-E,t=[0,0,0];o<3;)e=G+1/3*-(o-1),e<0?e++:e>1&&e--,r=6*e<1?A+(E-A)*6*e:2*e<1?E:3*e<2?A+(E-A)*(2/3-e)*6:A,t[o++]=r*255;return t}},Xy.hsl=function(Y){var G=Y[0]/255,d=Y[1]/255,x=Y[2]/255,A=Math.min(G,d,x),E=Math.max(G,d,x),e=E-A,t,r,o;return E===A?t=0:G===E?t=(d-x)/e:d===E?t=2+(x-G)/e:x===E&&(t=4+(G-d)/e),t=Math.min(t*60,360),t<0&&(t+=360),o=(A+E)/2,E===A?r=0:o<=.5?r=e/(E+A):r=e/(2-E-A),[t,r*100,o*100]}}}),LT={};L0(LT,{default:()=>CI});function CI(Y){Array.isArray(Y)&&Y.raw&&(Y=String.raw(...arguments)),Y instanceof Number&&(Y=+Y);var G,d=kT(Y);if(!d.space)return[];const x=d.space[0]==="h"?Yy.min:Xy.min,A=d.space[0]==="h"?Yy.max:Xy.max;return G=Array(3),G[0]=Math.min(Math.max(d.values[0],x[0]),A[0]),G[1]=Math.min(Math.max(d.values[1],x[1]),A[1]),G[2]=Math.min(Math.max(d.values[2],x[2]),A[2]),d.space[0]==="h"&&(G=Yy.rgb(G)),G.push(Math.min(Math.max(d.alpha,0),1)),G}var LI=ks({"node_modules/color-rgba/index.js"(){EI(),CT(),kI()}}),PT=He({"src/traces/parcoords/helpers.js"(Y){var G=Gr().isTypedArray;Y.convertTypedArray=function(d){return G(d)?Array.prototype.slice.call(d):d},Y.isOrdinal=function(d){return!!d.tickvals},Y.isVisible=function(d){return d.visible||!("visible"in d)}}}),PI=He({"src/traces/parcoords/lines.js"(Y,G){var d=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` +`),x=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` +`),A=Zy().maxDimensionCount,E=Gr(),e=1e-6,t=2048,r=new Uint8Array(4),o=new Uint8Array(4),a={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function i(w){w.read({x:0,y:0,width:1,height:1,data:r})}function n(w,p,u,g,m){var R=w._gl;R.enable(R.SCISSOR_TEST),R.scissor(p,u,g,m),w.clear({color:[0,0,0,0],depth:1})}function s(w,p,u,g,m,R){var P=R.key;function z(F){var B=Math.min(g,m-F*g);F===0&&(window.cancelAnimationFrame(u.currentRafs[P]),delete u.currentRafs[P],n(w,R.scissorX,R.scissorY,R.scissorWidth,R.viewBoxSize[1])),!u.clearOnly&&(R.count=2*B,R.offset=2*F*g,p(R),F*g+B>>8*p)%256/255}function h(w,p,u){for(var g=new Array(w*(A+4)),m=0,R=0;RCe&&(Ce=ee[fe].dim1.canvasX,Ae=fe);ie===0&&n(m,0,0,B.canvasWidth,B.canvasHeight);var qe=j(u);for(fe=0;fefe._length&&(Xe=Xe.slice(0,fe._length));var Me=fe.tickvals,xe;function ce(At,St){return{val:At,text:xe[St]}}function Re(At,St){return At.val-St.val}if(A(Me)&&Me.length){x.isTypedArray(Me)&&(Me=Array.from(Me)),xe=fe.ticktext,!A(xe)||!xe.length?xe=Me.map(E(fe.tickformat)):xe.length>Me.length?xe=xe.slice(0,Me.length):Me.length>xe.length&&(Me=Me.slice(0,xe.length));for(var $e=1;$e=St||ar>=Rt)return;var Mr=Je.lineLayer.readPixel(ir,Rt-1-ar),fr=Mr[3]!==0,dr=fr?Mr[2]+256*(Mr[1]+256*Mr[0]):null,pt={x:ir,y:ar,clientX:At.clientX,clientY:At.clientY,dataIndex:Je.model.key,curveNumber:dr};dr!==Ae&&(fr?J.hover(pt):J.unhover&&J.unhover(pt),Ae=dr)}}),we.style("opacity",function(Je){return Je.pick?0:1}),re.style("background","rgba(255, 255, 255, 0)");var Ce=re.selectAll("."+T.cn.parcoords).data(fe,c);Ce.exit().remove(),Ce.enter().append("g").classed(T.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),Ce.attr("transform",function(Je){return o(Je.model.translateX,Je.model.translateY)});var qe=Ce.selectAll("."+T.cn.parcoordsControlView).data(f,c);qe.enter().append("g").classed(T.cn.parcoordsControlView,!0),qe.attr("transform",function(Je){return o(Je.model.pad.l,Je.model.pad.t)});var et=qe.selectAll("."+T.cn.yAxis).data(function(Je){return Je.dimensions},c);et.enter().append("g").classed(T.cn.yAxis,!0),qe.each(function(Je){N(et,Je,q)}),we.each(function(Je){if(Je.viewModel){!Je.lineLayer||J?Je.lineLayer=y(this,Je):Je.lineLayer.update(Je),(Je.key||Je.key===0)&&(Je.viewModel[Je.key]=Je.lineLayer);var At=!Je.context||J;Je.lineLayer.render(Je.viewModel.panels,At)}}),et.attr("transform",function(Je){return o(Je.xScale(Je.xIndex),0)}),et.call(d.behavior.drag().origin(function(Je){return Je}).on("drag",function(Je){var At=Je.parent;ie.linePickActive(!1),Je.x=Math.max(-T.overdrag,Math.min(Je.model.width+T.overdrag,d.event.x)),Je.canvasX=Je.x*Je.model.canvasPixelRatio,et.sort(function(St,Rt){return St.x-Rt.x}).each(function(St,Rt){St.xIndex=Rt,St.x=Je===St?St.x:St.xScale(St.xIndex),St.canvasX=St.x*St.model.canvasPixelRatio}),N(et,At,q),et.filter(function(St){return Math.abs(Je.xIndex-St.xIndex)!==0}).attr("transform",function(St){return o(St.xScale(St.xIndex),0)}),d.select(this).attr("transform",o(Je.x,0)),et.each(function(St,Rt,Ut){Ut===Je.parent.key&&(At.dimensions[Rt]=St)}),At.contextLayer&&At.contextLayer.render(At.panels,!1,!P(At)),At.focusLayer.render&&At.focusLayer.render(At.panels)}).on("dragend",function(Je){var At=Je.parent;Je.x=Je.xScale(Je.xIndex),Je.canvasX=Je.x*Je.model.canvasPixelRatio,N(et,At,q),d.select(this).attr("transform",function(St){return o(St.x,0)}),At.contextLayer&&At.contextLayer.render(At.panels,!1,!P(At)),At.focusLayer&&At.focusLayer.render(At.panels),At.pickLayer&&At.pickLayer.render(At.panels,!0),ie.linePickActive(!0),J&&J.axesMoved&&J.axesMoved(At.key,At.dimensions.map(function(St){return St.crossfilterDimensionIndex}))})),et.exit().remove();var Qe=et.selectAll("."+T.cn.axisOverlays).data(f,c);Qe.enter().append("g").classed(T.cn.axisOverlays,!0),Qe.selectAll("."+T.cn.axis).remove();var Ke=Qe.selectAll("."+T.cn.axis).data(f,c);Ke.enter().append("g").classed(T.cn.axis,!0),Ke.each(function(Je){var At=Je.model.height/Je.model.tickDistance,St=Je.domainScale,Rt=St.domain();d.select(this).call(d.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(At,Je.tickFormat).tickValues(Je.ordinal?Rt:null).tickFormat(function(Ut){return h.isOrdinal(Je)?Ut:Z(Je.model.dimensions[Je.visibleIndex],Ut)}).scale(St)),i.font(Ke.selectAll("text"),Je.model.tickFont)}),Ke.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),Ke.selectAll("text").style("cursor","default");var Xe=Qe.selectAll("."+T.cn.axisHeading).data(f,c);Xe.enter().append("g").classed(T.cn.axisHeading,!0);var Me=Xe.selectAll("."+T.cn.axisTitle).data(f,c);Me.enter().append("text").classed(T.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",$?"none":"auto"),Me.text(function(Je){return Je.label}).each(function(Je){var At=d.select(this);i.font(At,Je.model.labelFont),a.convertToTspans(At,oe)}).attr("transform",function(Je){var At=L(Je.model.labelAngle,Je.model.labelSide),St=T.axisTitleOffset;return(At.dir>0?"":o(0,2*St+Je.model.height))+r(At.degrees)+o(-St*At.dx,-St*At.dy)}).attr("text-anchor",function(Je){var At=L(Je.model.labelAngle,Je.model.labelSide),St=Math.abs(At.dx),Rt=Math.abs(At.dy);return 2*St>Rt?At.dir*At.dx<0?"start":"end":"middle"});var xe=Qe.selectAll("."+T.cn.axisExtent).data(f,c);xe.enter().append("g").classed(T.cn.axisExtent,!0);var ce=xe.selectAll("."+T.cn.axisExtentTop).data(f,c);ce.enter().append("g").classed(T.cn.axisExtentTop,!0),ce.attr("transform",o(0,-T.axisExtentOffset));var Re=ce.selectAll("."+T.cn.axisExtentTopText).data(f,c);Re.enter().append("text").classed(T.cn.axisExtentTopText,!0).call(B),Re.text(function(Je){return Q(Je,!0)}).each(function(Je){i.font(d.select(this),Je.model.rangeFont)});var $e=xe.selectAll("."+T.cn.axisExtentBottom).data(f,c);$e.enter().append("g").classed(T.cn.axisExtentBottom,!0),$e.attr("transform",function(Je){return o(0,Je.model.height+T.axisExtentOffset)});var rt=$e.selectAll("."+T.cn.axisExtentBottomText).data(f,c);rt.enter().append("text").classed(T.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(B),rt.text(function(Je){return Q(Je,!1)}).each(function(Je){i.font(d.select(this),Je.model.rangeFont)}),l.ensureAxisBrush(Qe,ae,oe)}}}),IT=He({"src/traces/parcoords/plot.js"(r,G){var d=II(),x=ax(),A=PT().isVisible,E={};function e(o,a,i){var n=a.indexOf(i),s=o.indexOf(n);return s===-1&&(s+=a.length),s}function t(o,a){return function(n,s){return e(o,a,n)-e(o,a,s)}}var r=G.exports=function(a,i){var n=a._fullLayout,s=x(a,[],E);if(s){var c={},f={},v={},h={},T=n._size;i.forEach(function(M,_){var w=M[0].trace;v[_]=w.index;var p=h[_]=w.index;c[_]=a.data[p].dimensions,f[_]=a.data[p].dimensions.slice()});var l=function(M,_,w){var p=f[M][_],u=w.map(function(F){return F.slice()}),g="dimensions["+_+"].constraintrange",m=n._tracePreGUI[a._fullData[v[M]]._fullInput.uid];if(m[g]===void 0){var R=p.constraintrange;m[g]=R||null}var P=a._fullData[v[M]].dimensions[_];u.length?(u.length===1&&(u=u[0]),p.constraintrange=u,P.constraintrange=u.slice(),u=[u]):(delete p.constraintrange,delete P.constraintrange,u=null);var z={};z[g]=u,a.emit("plotly_restyle",[z,[h[M]]])},y=function(M){a.emit("plotly_hover",M)},b=function(M){a.emit("plotly_unhover",M)},S=function(M,_){var w=t(_,f[M].filter(A));c[M].sort(w),f[M].filter(function(p){return!A(p)}).sort(function(p){return f[M].indexOf(p)}).forEach(function(p){c[M].splice(c[M].indexOf(p),1),c[M].splice(f[M].indexOf(p),0,p)}),a.emit("plotly_restyle",[{dimensions:[c[M]]},[h[M]]])};d(a,i,{width:T.w,height:T.h,margin:{t:T.t,r:T.r,b:T.b,l:T.l}},{filterChanged:l,hover:y,unhover:b,axesMoved:S})}};r.reglPrecompiled=E}}),RI=He({"src/traces/parcoords/base_plot.js"(Y){var G=Qn(),d=Uf().getModuleCalcData,x=IT(),A=Yh();Y.name="parcoords",Y.plot=function(E){var e=d(E.calcdata,"parcoords")[0];e.length&&x(E,e)},Y.clean=function(E,e,t,r){var o=r._has&&r._has("parcoords"),a=e._has&&e._has("parcoords");o&&!a&&(r._paperdiv.selectAll(".parcoords").remove(),r._glimages.selectAll("*").remove())},Y.toSVG=function(E){var e=E._fullLayout._glimages,t=G.select(E).selectAll(".svg-container"),r=t.filter(function(a,i){return i===t.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function o(){var a=this,i=a.toDataURL("image/png"),n=e.append("svg:image");n.attr({xmlns:A.svg,"xlink:href":i,preserveAspectRatio:"none",x:0,y:0,width:a.style.width,height:a.style.height})}r.each(o),window.setTimeout(function(){G.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),DI=He({"src/traces/parcoords/base_index.js"(Y,G){G.exports={attributes:MT(),supplyDefaults:AI(),calc:SI(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:RI(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),zI=He({"src/traces/parcoords/index.js"(Y,G){var d=DI();d.plot=IT(),G.exports=d}}),FI=He({"lib/parcoords.js"(Y,G){G.exports=zI()}}),RT=He({"src/traces/parcats/attributes.js"(Y,G){var d=ho().extendFlat,x=cl(),A=Yl(),E=kl(),e=Yo().hovertemplateAttrs,t=mu().attributes,r=d({editType:"calc"},E("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability"]})});G.exports={domain:t({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:d({},x.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:A({editType:"calc"}),tickfont:A({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:r,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),OI=He({"src/traces/parcats/defaults.js"(Y,G){var d=Gr(),x=Ah().hasColorscale,A=pf(),E=mu().defaults,e=rh(),t=RT(),r=nx(),o=ch().isTypedArraySpec;function a(n,s,c,f,v){v("line.shape"),v("line.hovertemplate");var h=v("line.color",f.colorway[0]);if(x(n,"line")&&d.isArrayOrTypedArray(h)){if(h.length)return v("line.colorscale"),A(n,s,f,v,{prefix:"line.",cLetter:"c"}),h.length;s.line.color=c}return 1/0}function i(n,s){function c(b,S){return d.coerce(n,s,t.dimensions,b,S)}var f=c("values"),v=c("visible");if(f&&f.length||(v=s.visible=!1),v){c("label"),c("displayindex",s._index);var h=n.categoryarray,T=d.isArrayOrTypedArray(h)&&h.length>0||o(h),l;T&&(l="array");var y=c("categoryorder",l);y==="array"?(c("categoryarray"),c("ticktext")):(delete n.categoryarray,delete n.ticktext),!T&&y==="array"&&(s.categoryorder="trace")}}G.exports=function(s,c,f,v){function h(b,S){return d.coerce(s,c,t,b,S)}var T=e(s,c,{name:"dimensions",handleItemDefaults:i}),l=a(s,c,f,v,h);E(c,v,h),(!Array.isArray(T)||!T.length)&&(c.visible=!1),r(c,T,"values",l),h("hoveron"),h("hovertemplate"),h("arrangement"),h("bundlecolors"),h("sortpaths"),h("counts");var y=v.font;d.coerceFont(h,"labelfont",y,{overrideDflt:{size:Math.round(y.size)}}),d.coerceFont(h,"tickfont",y,{autoShadowDflt:!0,overrideDflt:{size:Math.round(y.size/1.2)}})}}}),BI=He({"src/traces/parcats/calc.js"(Y,G){var d=Wv().wrap,x=Ah().hasColorscale,A=Sh(),E=gb(),e=vo(),t=Gr(),r=Hi();G.exports=function(y,b){var S=t.filterVisible(b.dimensions);if(S.length===0)return[];var M=S.map(function(j){var J;if(j.categoryorder==="trace")J=null;else if(j.categoryorder==="array")J=j.categoryarray;else{J=E(j.values);for(var $=!0,X=0;X=l.length||y[l[b]]!==void 0)return!1;y[l[b]]=!0}return!0}}}),NI=He({"src/traces/parcats/parcats.js"(Y,G){var d=Qn(),x=(Gp(),Go(tp)).interpolateNumber,A=f1(),E=Wu(),e=Gr(),t=e.strTranslate,r=vo(),o=Mf(),a=yl();function i(X,re,ee,q){var ae=re._context.staticPlot,ie=X.map(oe.bind(0,re,ee)),fe=q.selectAll("g.parcatslayer").data([null]);fe.enter().append("g").attr("class","parcatslayer").style("pointer-events",ae?"none":"all");var we=fe.selectAll("g.trace.parcats").data(ie,n),Ae=we.enter().append("g").attr("class","trace parcats");we.attr("transform",function(ce){return t(ce.x,ce.y)}),Ae.append("g").attr("class","paths");var Fe=we.select("g.paths"),Ce=Fe.selectAll("path.path").data(function(ce){return ce.paths},n);Ce.attr("fill",function(ce){return ce.model.color});var qe=Ce.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(ce){return ce.model.color}).attr("fill-opacity",0);y(qe),Ce.attr("d",function(ce){return ce.svgD}),qe.empty()||Ce.sort(c),Ce.exit().remove(),Ce.on("mouseover",f).on("mouseout",v).on("click",l),Ae.append("g").attr("class","dimensions");var et=we.select("g.dimensions"),Qe=et.selectAll("g.dimension").data(function(ce){return ce.dimensions},n);Qe.enter().append("g").attr("class","dimension"),Qe.attr("transform",function(ce){return t(ce.x,0)}),Qe.exit().remove();var Ke=Qe.selectAll("g.category").data(function(ce){return ce.categories},n),Xe=Ke.enter().append("g").attr("class","category");Ke.attr("transform",function(ce){return t(0,ce.y)}),Xe.append("rect").attr("class","catrect").attr("pointer-events","none"),Ke.select("rect.catrect").attr("fill","none").attr("width",function(ce){return ce.width}).attr("height",function(ce){return ce.height}),M(Xe);var Me=Ke.selectAll("rect.bandrect").data(function(ce){return ce.bands},n);Me.each(function(){e.raiseToTop(this)}),Me.attr("fill",function(ce){return ce.color});var xe=Me.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(ce){return ce.color}).attr("fill-opacity",0);Me.attr("fill",function(ce){return ce.color}).attr("width",function(ce){return ce.width}).attr("height",function(ce){return ce.height}).attr("y",function(ce){return ce.y}).attr("cursor",function(ce){return ce.parcatsViewModel.arrangement==="fixed"?"default":ce.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),w(xe),Me.exit().remove(),Xe.append("text").attr("class","catlabel").attr("pointer-events","none"),Ke.select("text.catlabel").attr("text-anchor",function(ce){return s(ce)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(ce){return s(ce)?ce.width+5:-5}).attr("y",function(ce){return ce.height/2}).text(function(ce){return ce.model.categoryLabel}).each(function(ce){r.font(d.select(this),ce.parcatsViewModel.categorylabelfont),a.convertToTspans(d.select(this),re)}),Xe.append("text").attr("class","dimlabel"),Ke.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(ce){return ce.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(ce){return ce.width/2}).attr("y",-5).text(function(ce,Re){return Re===0?ce.parcatsViewModel.model.dimensions[ce.model.dimensionInd].dimensionLabel:null}).each(function(ce){r.font(d.select(this),ce.parcatsViewModel.labelfont)}),Ke.selectAll("rect.bandrect").on("mouseover",B).on("mouseout",O),Ke.exit().remove(),Qe.call(d.behavior.drag().origin(function(ce){return{x:ce.x,y:0}}).on("dragstart",L).on("drag",N).on("dragend",U)),we.each(function(ce){ce.traceSelection=d.select(this),ce.pathSelection=d.select(this).selectAll("g.paths").selectAll("path.path"),ce.dimensionSelection=d.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),we.exit().remove()}G.exports=function(X,re,ee,q){i(ee,X,q,re)};function n(X){return X.key}function s(X){var re=X.parcatsViewModel.dimensions.length,ee=X.parcatsViewModel.dimensions[re-1].model.dimensionInd;return X.model.dimensionInd===ee}function c(X,re){return X.model.rawColor>re.model.rawColor?1:X.model.rawColor"),Je=d.mouse(ae)[0];E.loneHover({trace:ie,x:Ke-we.left+Ae.left,y:Xe-we.top+Ae.top,text:rt,color:X.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Me,idealAlign:Je1&&Fe.displayInd===Ae.dimensions.length-1?(et=fe.left,Qe="left"):(et=fe.left+fe.width,Qe="right");var Ke=we.model.count,Xe=we.model.categoryLabel,Me=Ke/we.parcatsViewModel.model.count,xe={countLabel:Ke,categoryLabel:Xe,probabilityLabel:Me.toFixed(3)},ce=[];we.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&ce.push(["Count:",xe.countLabel].join(" ")),we.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&ce.push(["P("+xe.categoryLabel+"):",xe.probabilityLabel].join(" "));var Re=ce.join("
");return{trace:Ce,x:q*(et-re.left),y:ae*(qe-re.top),text:Re,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:Qe,hovertemplate:Ce.hovertemplate,hovertemplateLabels:xe,eventData:[{data:Ce._input,fullData:Ce,count:Ke,category:Xe,probability:Me}]}}function z(X,re,ee){var q=[];return d.select(ee.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var ae=this;q.push(P(X,re,ae))}),q}function F(X,re,ee){X._fullLayout._calcInverseTransform(X);var q=X._fullLayout._invScaleX,ae=X._fullLayout._invScaleY,ie=ee.getBoundingClientRect(),fe=d.select(ee).datum(),we=fe.categoryViewModel,Ae=we.parcatsViewModel,Fe=Ae.model.dimensions[we.model.dimensionInd],Ce=Ae.trace,qe=ie.y+ie.height/2,et,Qe;Ae.dimensions.length>1&&Fe.displayInd===Ae.dimensions.length-1?(et=ie.left,Qe="left"):(et=ie.left+ie.width,Qe="right");var Ke=we.model.categoryLabel,Xe=fe.parcatsViewModel.model.count,Me=0;fe.categoryViewModel.bands.forEach(function(Ut){Ut.color===fe.color&&(Me+=Ut.count)});var xe=we.model.count,ce=0;Ae.pathSelection.each(function(Ut){Ut.model.color===fe.color&&(ce+=Ut.model.count)});var Re=Me/Xe,$e=Me/ce,rt=Me/xe,Je={countLabel:Me,categoryLabel:Ke,probabilityLabel:Re.toFixed(3)},At=[];we.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&At.push(["Count:",Je.countLabel].join(" ")),we.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(At.push("P(color ∩ "+Ke+"): "+Je.probabilityLabel),At.push("P("+Ke+" | color): "+$e.toFixed(3)),At.push("P(color | "+Ke+"): "+rt.toFixed(3)));var St=At.join("
"),Rt=o.mostReadable(fe.color,["black","white"]);return{trace:Ce,x:q*(et-re.left),y:ae*(qe-re.top),text:St,color:fe.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:Rt,fontSize:10,idealAlign:Qe,hovertemplate:Ce.hovertemplate,hovertemplateLabels:Je,eventData:[{data:Ce._input,fullData:Ce,category:Ke,count:Xe,probability:Re,categorycount:xe,colorcount:ce,bandcolorcount:Me}]}}function B(X){if(!X.parcatsViewModel.dragDimension&&X.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var re=d.mouse(this)[1];if(re<-1)return;var ee=X.parcatsViewModel.graphDiv,q=ee._fullLayout,ae=q._paperdiv.node().getBoundingClientRect(),ie=X.parcatsViewModel.hoveron,fe=this;if(ie==="color"?(g(fe),R(fe,"plotly_hover",d.event)):(u(fe),m(fe,"plotly_hover",d.event)),X.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var we;ie==="category"?we=P(ee,ae,fe):ie==="color"?we=F(ee,ae,fe):ie==="dimension"&&(we=z(ee,ae,fe)),we&&E.loneHover(we,{container:q._hoverlayer.node(),outerContainer:q._paper.node(),gd:ee})}}}function O(X){var re=X.parcatsViewModel;if(!re.dragDimension&&(y(re.pathSelection),M(re.dimensionSelection.selectAll("g.category")),w(re.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),E.loneUnhover(re.graphDiv._fullLayout._hoverlayer.node()),re.pathSelection.sort(c),re.hoverinfoItems.indexOf("skip")===-1)){var ee=X.parcatsViewModel.hoveron,q=this;ee==="color"?R(q,"plotly_unhover",d.event):m(q,"plotly_unhover",d.event)}}function L(X){X.parcatsViewModel.arrangement!=="fixed"&&(X.dragDimensionDisplayInd=X.model.displayInd,X.initialDragDimensionDisplayInds=X.parcatsViewModel.model.dimensions.map(function(re){return re.displayInd}),X.dragHasMoved=!1,X.dragCategoryDisplayInd=null,d.select(this).selectAll("g.category").select("rect.catrect").each(function(re){var ee=d.mouse(this)[0],q=d.mouse(this)[1];-2<=ee&&ee<=re.width+2&&-2<=q&&q<=re.height+2&&(X.dragCategoryDisplayInd=re.model.displayInd,X.initialDragCategoryDisplayInds=X.model.categories.map(function(ae){return ae.displayInd}),re.model.dragY=re.y,e.raiseToTop(this.parentNode),d.select(this.parentNode).selectAll("rect.bandrect").each(function(ae){ae.yCe.y+Ce.height/2&&(ie.model.displayInd=Ce.model.displayInd,Ce.model.displayInd=we),X.dragCategoryDisplayInd=ie.model.displayInd}if(X.dragCategoryDisplayInd===null||X.parcatsViewModel.arrangement==="freeform"){ae.model.dragX=d.event.x;var qe=X.parcatsViewModel.dimensions[ee],et=X.parcatsViewModel.dimensions[q];qe!==void 0&&ae.model.dragXet.x&&(ae.model.displayInd=et.model.displayInd,et.model.displayInd=X.dragDimensionDisplayInd),X.dragDimensionDisplayInd=ae.model.displayInd}J(X.parcatsViewModel),j(X.parcatsViewModel),ue(X.parcatsViewModel),Q(X.parcatsViewModel)}}function U(X){if(X.parcatsViewModel.arrangement!=="fixed"&&X.dragDimensionDisplayInd!==null){d.select(this).selectAll("text").attr("font-weight","normal");var re={},ee=Z(X.parcatsViewModel),q=X.parcatsViewModel.model.dimensions.map(function(et){return et.displayInd}),ae=X.initialDragDimensionDisplayInds.some(function(et,Qe){return et!==q[Qe]});ae&&q.forEach(function(et,Qe){var Ke=X.parcatsViewModel.model.dimensions[Qe].containerInd;re["dimensions["+Ke+"].displayindex"]=et});var ie=!1;if(X.dragCategoryDisplayInd!==null){var fe=X.model.categories.map(function(et){return et.displayInd});if(ie=X.initialDragCategoryDisplayInds.some(function(et,Qe){return et!==fe[Qe]}),ie){var we=X.model.categories.slice().sort(function(et,Qe){return et.displayInd-Qe.displayInd}),Ae=we.map(function(et){return et.categoryValue}),Fe=we.map(function(et){return et.categoryLabel});re["dimensions["+X.model.containerInd+"].categoryarray"]=[Ae],re["dimensions["+X.model.containerInd+"].ticktext"]=[Fe],re["dimensions["+X.model.containerInd+"].categoryorder"]="array"}}if(X.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!X.dragHasMoved&&X.potentialClickBand&&(X.parcatsViewModel.hoveron==="color"?R(X.potentialClickBand,"plotly_click",d.event.sourceEvent):m(X.potentialClickBand,"plotly_click",d.event.sourceEvent)),X.model.dragX=null,X.dragCategoryDisplayInd!==null){var Ce=X.parcatsViewModel.dimensions[X.dragDimensionDisplayInd].categories[X.dragCategoryDisplayInd];Ce.model.dragY=null,X.dragCategoryDisplayInd=null}X.dragDimensionDisplayInd=null,X.parcatsViewModel.dragDimension=null,X.dragHasMoved=null,X.potentialClickBand=null,J(X.parcatsViewModel),j(X.parcatsViewModel);var qe=d.transition().duration(300).ease("cubic-in-out");qe.each(function(){ue(X.parcatsViewModel,!0),Q(X.parcatsViewModel,!0)}).each("end",function(){(ae||ie)&&A.restyle(X.parcatsViewModel.graphDiv,re,[ee])})}}function Z(X){for(var re,ee=X.graphDiv._fullData,q=0;q=0;Ae--)Fe+="C"+fe[Ae]+","+(re[Ae+1]+q)+" "+ie[Ae]+","+(re[Ae]+q)+" "+(X[Ae]+ee[Ae])+","+(re[Ae]+q),Fe+="l-"+ee[Ae]+",0 ";return Fe+="Z",Fe}function j(X){var re=X.dimensions,ee=X.model,q=re.map(function(Mr){return Mr.categories.map(function(fr){return fr.y})}),ae=X.model.dimensions.map(function(Mr){return Mr.categories.map(function(fr){return fr.displayInd})}),ie=X.model.dimensions.map(function(Mr){return Mr.displayInd}),fe=X.dimensions.map(function(Mr){return Mr.model.dimensionInd}),we=re.map(function(Mr){return Mr.x}),Ae=re.map(function(Mr){return Mr.width}),Fe=[];for(var Ce in ee.paths)ee.paths.hasOwnProperty(Ce)&&Fe.push(ee.paths[Ce]);function qe(Mr){var fr=Mr.categoryInds.map(function(pt,ze){return ae[ze][pt]}),dr=fe.map(function(pt){return fr[pt]});return dr}Fe.sort(function(Mr,fr){var dr=qe(Mr),pt=qe(fr);return X.sortpaths==="backward"&&(dr.reverse(),pt.reverse()),dr.push(Mr.valueInds[0]),pt.push(fr.valueInds[0]),X.bundlecolors&&(dr.unshift(Mr.rawColor),pt.unshift(fr.rawColor)),drpt?1:0});for(var et=new Array(Fe.length),Qe=re[0].model.count,Ke=re[0].categories.map(function(Mr){return Mr.height}).reduce(function(Mr,fr){return Mr+fr}),Xe=0;Xe0?xe=Ke*(Me.count/Qe):xe=0;for(var ce=new Array(q.length),Re=0;Re1?fe=(X.width-2*ee-q)/(ae-1):fe=0,we=ee,Ae=we+fe*ie;var Fe=[],Ce=X.model.maxCats,qe=re.categories.length,et=8,Qe=re.count,Ke=X.height-et*(Ce-1),Xe,Me,xe,ce,Re,$e=(Ce-qe)*et/2,rt=re.categories.map(function(Je){return{displayInd:Je.displayInd,categoryInd:Je.categoryInd}});for(rt.sort(function(Je,At){return Je.displayInd-At.displayInd}),Re=0;Re0?Xe=Me.count/Qe*Ke:Xe=0,xe={key:Me.valueInds[0],model:Me,width:q,height:Xe,y:Me.dragY!==null?Me.dragY:$e,bands:[],parcatsViewModel:X},$e=$e+Xe+et,Fe.push(xe);return{key:re.dimensionInd,x:re.dragX!==null?re.dragX:Ae,y:0,width:q,model:re,categories:Fe,parcatsViewModel:X,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}}),DT=He({"src/traces/parcats/plot.js"(Y,G){var d=NI();G.exports=function(A,E,e,t){var r=A._fullLayout,o=r._paper,a=r._size;d(A,o,E,{width:a.w,height:a.h,margin:{t:a.t,r:a.r,b:a.b,l:a.l}},e,t)}}}),UI=He({"src/traces/parcats/base_plot.js"(Y){var G=Uf().getModuleCalcData,d=DT(),x="parcats";Y.name=x,Y.plot=function(A,E,e,t){var r=G(A.calcdata,x);if(r.length){var o=r[0];d(A,o,e,t)}},Y.clean=function(A,E,e,t){var r=t._has&&t._has("parcats"),o=E._has&&E._has("parcats");r&&!o&&t._paperdiv.selectAll(".parcats").remove()}}}),jI=He({"src/traces/parcats/index.js"(Y,G){G.exports={attributes:RT(),supplyDefaults:OI(),calc:BI(),plot:DT(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:UI(),categories:["noOpacity"],meta:{}}}}),VI=He({"lib/parcats.js"(Y,G){G.exports=jI()}}),dd=He({"src/plots/mapbox/constants.js"(Y,G){var d=Ud(),x="1.13.4",A='©
OpenStreetMap contributors',E=['© Carto',A].join(" "),e=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),t=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),r={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:A,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:E,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:E,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:t,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},o=d(r);G.exports={requiredVersion:x,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:r,styleValuesNonMapbox:o,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+x+"."].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:",o.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')`}}}}),Ky=He({"src/plots/mapbox/layout_attributes.js"(Y,G){var d=Gr(),x=Ai().defaultLine,A=mu().attributes,E=Yl(),e=Zu().textposition,t=hu().overrideAll,r=Gs().templatedArray,o=dd(),a=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});a.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=G.exports=t({_arrayAttrRegexps:[d.counterRegex("mapbox",".layers",!0)],domain:A({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:o.styleValuesMapbox.concat(o.styleValuesNonMapbox),dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:x},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:x}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:a,textposition:d.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),sx=He({"src/traces/scattermapbox/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=Yo().texttemplateAttrs,A=wv(),E=Zp(),e=Zu(),t=Ky(),r=cl(),o=kl(),a=ho().extendFlat,i=hu().overrideAll,n=Ky(),s=E.line,c=E.marker;G.exports=i({lon:E.lon,lat:E.lat,cluster:{enabled:{valType:"boolean"},maxzoom:a({},n.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:a({},c.opacity,{dflt:1})},mode:a({},e.mode,{dflt:"markers"}),text:a({},e.text,{}),texttemplate:x({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:a({},e.hovertext,{}),line:{color:s.color,width:s.width},connectgaps:e.connectgaps,marker:a({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode},o("marker")),fill:E.fill,fillcolor:A(),textfont:t.layers.symbol.textfont,textposition:t.layers.symbol.textposition,below:{valType:"string"},selected:{marker:e.selected.marker},unselected:{marker:e.unselected.marker},hoverinfo:a({},r.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d()},"calc","nested")}}),zT=He({"src/traces/scattermapbox/constants.js"(Y,G){var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];G.exports={isSupportedFont:function(x){return d.indexOf(x)!==-1}}}}),qI=He({"src/traces/scattermapbox/defaults.js"(Y,G){var d=Gr(),x=Rl(),A=Kh(),E=nv(),e=iv(),t=Av(),r=sx(),o=zT().isSupportedFont;G.exports=function(n,s,c,f){function v(g,m){return d.coerce(n,s,r,g,m)}function h(g,m){return d.coerce2(n,s,r,g,m)}var T=a(n,s,v);if(!T){s.visible=!1;return}if(v("text"),v("texttemplate"),v("hovertext"),v("hovertemplate"),v("mode"),v("below"),x.hasMarkers(s)){A(n,s,c,f,v,{noLine:!0,noAngle:!0}),v("marker.allowoverlap"),v("marker.angle");var l=s.marker;l.symbol!=="circle"&&(d.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),d.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}x.hasLines(s)&&(E(n,s,c,f,v,{noDash:!0}),v("connectgaps"));var y=h("cluster.maxzoom"),b=h("cluster.step"),S=h("cluster.color",s.marker&&s.marker.color||c),M=h("cluster.size"),_=h("cluster.opacity"),w=y!==!1||b!==!1||S!==!1||M!==!1||_!==!1,p=v("cluster.enabled",w);if(p||x.hasText(s)){var u=f.font.family;e(n,s,f,v,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}v("fill"),s.fill!=="none"&&t(n,s,c,v),d.coerceSelectionMarkerOpacity(s,v)};function a(i,n,s){var c=s("lon")||[],f=s("lat")||[],v=Math.min(c.length,f.length);return n._length=v,v}}}),FT=He({"src/traces/scattermapbox/format_labels.js"(Y,G){var d=io();G.exports=function(A,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,a=A.lonlat;return t.lonLabel=d.tickText(o,o.c2l(a[0]),!0).text,t.latLabel=d.tickText(o,o.c2l(a[1]),!0).text,t}}}),OT=He({"src/plots/mapbox/convert_text_opts.js"(Y,G){var d=Gr();G.exports=function(A,E){var e=A.split(" "),t=e[0],r=e[1],o=d.isArrayOrTypedArray(E)?d.mean(E):E,a=.5+o/100,i=1.5+o/100,n=["",""],s=[0,0];switch(t){case"top":n[0]="top",s[1]=-i;break;case"bottom":n[0]="bottom",s[1]=i;break}switch(r){case"left":n[1]="right",s[0]=-a;break;case"right":n[1]="left",s[0]=a;break}var c;return n[0]&&n[1]?c=n.join("-"):n[0]?c=n[0]:n[1]?c=n[1]:c="center",{anchor:c,offset:s}}}}),HI=He({"src/traces/scattermapbox/convert.js"(Y,G){var d=Hi(),x=Gr(),A=lo().BADNUM,E=np(),e=Kl(),t=vo(),r=B0(),o=Rl(),a=zT().isSupportedFont,i=OT(),n=Ph().appendArrayPointValue,s=yl().NEWLINES,c=yl().BR_TAG_ALL;G.exports=function(_,w){var p=w[0].trace,u=p.visible===!0&&p._length!==0,g=p.fill!=="none",m=o.hasLines(p),R=o.hasMarkers(p),P=o.hasText(p),z=R&&p.marker.symbol==="circle",F=R&&p.marker.symbol!=="circle",B=p.cluster&&p.cluster.enabled,O=f("fill"),L=f("line"),N=f("circle"),U=f("symbol"),Z={fill:O,line:L,circle:N,symbol:U};if(!u)return Z;var Q;if((g||m)&&(Q=E.calcTraceToLineCoords(w)),g&&(O.geojson=E.makePolygon(Q),O.layout.visibility="visible",x.extendFlat(O.paint,{"fill-color":p.fillcolor})),m&&(L.geojson=E.makeLine(Q),L.layout.visibility="visible",x.extendFlat(L.paint,{"line-width":p.line.width,"line-color":p.line.color,"line-opacity":p.opacity})),z){var ue=v(w);N.geojson=ue.geojson,N.layout.visibility="visible",B&&(N.filter=["!",["has","point_count"]],Z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":b(p.cluster.color,p.cluster.step),"circle-radius":b(p.cluster.size,p.cluster.step),"circle-opacity":b(p.cluster.opacity,p.cluster.step)}},Z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(p),"text-size":12}}),x.extendFlat(N.paint,{"circle-color":ue.mcc,"circle-radius":ue.mrc,"circle-opacity":ue.mo})}if(z&&B&&(N.filter=["!",["has","point_count"]]),(F||P)&&(U.geojson=h(w,_),x.extendFlat(U.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(x.extendFlat(U.layout,{"icon-size":p.marker.size/10}),"angle"in p.marker&&p.marker.angle!=="auto"&&x.extendFlat(U.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),U.layout["icon-allow-overlap"]=p.marker.allowoverlap,x.extendFlat(U.paint,{"icon-opacity":p.opacity*p.marker.opacity,"icon-color":p.marker.color})),P)){var oe=(p.marker||{}).size,le=i(p.textposition,oe);x.extendFlat(U.layout,{"text-size":p.textfont.size,"text-anchor":le.anchor,"text-offset":le.offset,"text-font":S(p)}),x.extendFlat(U.paint,{"text-color":p.textfont.color,"text-opacity":p.opacity})}return Z};function f(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function v(M){var _=M[0].trace,w=_.marker,p=_.selectedpoints,u=x.isArrayOrTypedArray(w.color),g=x.isArrayOrTypedArray(w.size),m=x.isArrayOrTypedArray(w.opacity),R;function P(oe){return _.opacity*oe}function z(oe){return oe/2}var F;u&&(e.hasColorscale(_,"marker")?F=e.makeColorScaleFuncFromTrace(w):F=x.identity);var B;g&&(B=r(_));var O;m&&(O=function(oe){var le=d(oe)?+x.constrain(oe,0,1):0;return P(le)});var L=[];for(R=0;R850?R+=" Black":u>750?R+=" Extra Bold":u>650?R+=" Bold":u>550?R+=" Semi Bold":u>450?R+=" Medium":u>350?R+=" Regular":u>250?R+=" Light":u>150?R+=" Extra Light":R+=" Thin"):g.slice(0,2).join(" ")==="Open Sans"?(R="Open Sans",u>750?R+=" Extrabold":u>650?R+=" Bold":u>550?R+=" Semibold":u>350?R+=" Regular":R+=" Light"):g.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(R="Klokantech Noto Sans",g[3]==="CJK"&&(R+=" CJK"),R+=u>500?" Bold":" Regular")),m&&(R+=" Italic"),R==="Open Sans Regular Italic"?R="Open Sans Italic":R==="Open Sans Regular Bold"?R="Open Sans Bold":R==="Open Sans Regular Bold Italic"?R="Open Sans Bold Italic":R==="Klokantech Noto Sans Regular Italic"&&(R="Klokantech Noto Sans Italic"),a(R)||(R=w);var P=R.split(", ");return P}}}),GI=He({"src/traces/scattermapbox/plot.js"(Y,G){var d=Gr(),x=HI(),A=dd().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,a,i){this.type="scattermapbox",this.subplot=r,this.uid=o,this.clusterEnabled=a,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:A+o+"-fill",line:A+o+"-line",circle:A+o+"-circle",symbol:A+o+"-symbol",cluster:A+o+"-cluster",clusterCount:A+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,a){var i={type:"geojson",data:o.geojson};a&&a.enabled&&d.extendFlat(i,{cluster:!0,clusterMaxZoom:a.maxzoom});var n=this.subplot.map.getSource(this.sourceIds[r]);n?n.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,a){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var n=this.layerIds[r],s,c=this.subplot.getMapLayers(),f=0;f=0;m--){var R=g[m];n.removeLayer(h.layerIds[R])}u||n.removeSource(h.sourceIds.circle)}function y(u){for(var g=E.nonCluster,m=0;m=0;m--){var R=g[m];n.removeLayer(h.layerIds[R]),u||n.removeSource(h.sourceIds[R])}}function S(u){v?l(u):b(u)}function M(u){f?T(u):y(u)}function _(){for(var u=f?E.cluster:E.nonCluster,g=0;g=0;i--){var n=a[i];o.removeLayer(this.layerIds[n]),o.removeSource(this.sourceIds[n])}},G.exports=function(o,a){var i=a[0].trace,n=i.cluster&&i.cluster.enabled,s=i.visible!==!0,c=new e(o,i.uid,n,s),f=x(o.gd,a),v=c.below=o.belowLookup["trace-"+i.uid],h,T,l;if(n)for(c.addSource("circle",f.circle,i.cluster),h=0;h=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=S*360,_=i-M;function w(B){var O=B.lonlat;if(O[0]===e||y&&T.indexOf(B.i+1)===-1)return 1/0;var L=x.modHalf(O[0],360),N=O[1],U=h.project([L,N]),Z=U.x-f.c2p([_,N]),Q=U.y-v.c2p([L,n]),ue=Math.max(3,B.mrc||0);return Math.max(Math.sqrt(Z*Z+Q*Q)-ue,1-3/ue)}if(d.getClosest(s,w,a),a.index!==!1){var p=s[a.index],u=p.lonlat,g=[x.modHalf(u[0],360)+M,u[1]],m=f.c2p(g),R=v.c2p(g),P=p.mrc||1;a.x0=m-P,a.x1=m+P,a.y0=R-P,a.y1=R+P;var z={};z[c.subplot]={_subplot:h};var F=c._module.formatLabels(p,c,z);return a.lonLabel=F.lonLabel,a.latLabel=F.latLabel,a.color=A(c,p),a.extraText=o(c,p,s[0].t.labels),a.hovertemplate=c.hovertemplate,[a]}}function o(a,i,n){if(a.hovertemplate)return;var s=i.hi||a.hoverinfo,c=s.split("+"),f=c.indexOf("all")!==-1,v=c.indexOf("lon")!==-1,h=c.indexOf("lat")!==-1,T=i.lonlat,l=[];function y(b){return b+"°"}return f||v&&h?l.push("("+y(T[1])+", "+y(T[0])+")"):v?l.push(n.lon+y(T[0])):h&&l.push(n.lat+y(T[1])),(f||c.indexOf("text")!==-1)&&E(i,a,l),l.join("
")}G.exports={hoverPoints:r,getExtraText:o}}}),WI=He({"src/traces/scattermapbox/event_data.js"(Y,G){G.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x}}}),ZI=He({"src/traces/scattermapbox/select.js"(Y,G){var d=Gr(),x=Rl(),A=lo().BADNUM;G.exports=function(e,t){var r=e.cd,o=e.xaxis,a=e.yaxis,i=[],n=r[0].trace,s;if(!x.hasMarkers(n))return[];if(t===!1)for(s=0;s"u"&&(C=1e-6);var V,se,_e,ke,Ne;for(_e=k,Ne=0;Ne<8;Ne++){if(ke=this.sampleCurveX(_e)-k,Math.abs(ke)se)return se;for(;Vke?V=_e:se=_e,_e=(se-V)*.5+V}return _e},a.prototype.solve=function(k,C){return this.sampleCurveY(this.solveCurveX(k,C))};var i=n;function n(k,C){this.x=k,this.y=C}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(k){return this.clone()._add(k)},sub:function(k){return this.clone()._sub(k)},multByPoint:function(k){return this.clone()._multByPoint(k)},divByPoint:function(k){return this.clone()._divByPoint(k)},mult:function(k){return this.clone()._mult(k)},div:function(k){return this.clone()._div(k)},rotate:function(k){return this.clone()._rotate(k)},rotateAround:function(k,C){return this.clone()._rotateAround(k,C)},matMult:function(k){return this.clone()._matMult(k)},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(k){return this.x===k.x&&this.y===k.y},dist:function(k){return Math.sqrt(this.distSqr(k))},distSqr:function(k){var C=k.x-this.x,V=k.y-this.y;return C*C+V*V},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(k){return Math.atan2(this.y-k.y,this.x-k.x)},angleWith:function(k){return this.angleWithSep(k.x,k.y)},angleWithSep:function(k,C){return Math.atan2(this.x*C-this.y*k,this.x*k+this.y*C)},_matMult:function(k){var C=k[0]*this.x+k[1]*this.y,V=k[2]*this.x+k[3]*this.y;return this.x=C,this.y=V,this},_add:function(k){return this.x+=k.x,this.y+=k.y,this},_sub:function(k){return this.x-=k.x,this.y-=k.y,this},_mult:function(k){return this.x*=k,this.y*=k,this},_div:function(k){return this.x/=k,this.y/=k,this},_multByPoint:function(k){return this.x*=k.x,this.y*=k.y,this},_divByPoint:function(k){return this.x/=k.x,this.y/=k.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var k=this.y;return this.y=this.x,this.x=-k,this},_rotate:function(k){var C=Math.cos(k),V=Math.sin(k),se=C*this.x-V*this.y,_e=V*this.x+C*this.y;return this.x=se,this.y=_e,this},_rotateAround:function(k,C){var V=Math.cos(k),se=Math.sin(k),_e=C.x+V*(this.x-C.x)-se*(this.y-C.y),ke=C.y+se*(this.x-C.x)+V*(this.y-C.y);return this.x=_e,this.y=ke,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(k){return k instanceof n?k:Array.isArray(k)?new n(k[0],k[1]):k};var s=typeof self<"u"?self:{};function c(k,C){if(Array.isArray(k)){if(!Array.isArray(C)||k.length!==C.length)return!1;for(var V=0;V=1)return 1;var C=k*k,V=C*k;return 4*(k<.5?V:3*(k-C)+V-.75)}function h(k,C,V,se){var _e=new o(k,C,V,se);return function(ke){return _e.solve(ke)}}var T=h(.25,.1,.25,1);function l(k,C,V){return Math.min(V,Math.max(C,k))}function y(k,C,V){var se=V-C,_e=((k-C)%se+se)%se+C;return _e===C?V:_e}function b(k,C,V){if(!k.length)return V(null,[]);var se=k.length,_e=new Array(k.length),ke=null;k.forEach(function(Ne,it){C(Ne,function(kt,Ft){kt&&(ke=kt),_e[it]=Ft,--se===0&&V(ke,_e)})})}function S(k){var C=[];for(var V in k)C.push(k[V]);return C}function M(k,C){var V=[];for(var se in k)se in C||V.push(se);return V}function _(k){for(var C=[],V=arguments.length-1;V-- >0;)C[V]=arguments[V+1];for(var se=0,_e=C;se<_e.length;se+=1){var ke=_e[se];for(var Ne in ke)k[Ne]=ke[Ne]}return k}function w(k,C){for(var V={},se=0;se>C/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,k)}return k()}function m(k){return k<=1?1:Math.pow(2,Math.ceil(Math.log(k)/Math.LN2))}function R(k){return k?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(k):!1}function P(k,C){k.forEach(function(V){C[V]&&(C[V]=C[V].bind(C))})}function z(k,C){return k.indexOf(C,k.length-C.length)!==-1}function F(k,C,V){var se={};for(var _e in k)se[_e]=C.call(V||this,k[_e],_e,k);return se}function B(k,C,V){var se={};for(var _e in k)C.call(V||this,k[_e],_e,k)&&(se[_e]=k[_e]);return se}function O(k){return Array.isArray(k)?k.map(O):typeof k=="object"&&k?F(k,O):k}function L(k,C){for(var V=0;V=0)return!0;return!1}var N={};function U(k){N[k]||(typeof console<"u"&&console.warn(k),N[k]=!0)}function Z(k,C,V){return(V.y-k.y)*(C.x-k.x)>(C.y-k.y)*(V.x-k.x)}function Q(k){for(var C=0,V=0,se=k.length,_e=se-1,ke=void 0,Ne=void 0;V@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,V={};if(k.replace(C,function(_e,ke,Ne,it){var kt=Ne||it;return V[ke]=kt?kt.toLowerCase():!0,""}),V["max-age"]){var se=parseInt(V["max-age"],10);isNaN(se)?delete V["max-age"]:V["max-age"]=se}return V}var j=null;function J(k){if(j==null){var C=k.navigator?k.navigator.userAgent:null;j=!!k.safari||!!(C&&(/\b(iPad|iPhone|iPod)\b/.test(C)||C.match("Safari")&&!C.match("Chrome")))}return j}function $(k){try{var C=s[k];return C.setItem("_mapbox_test_",1),C.removeItem("_mapbox_test_"),!0}catch{return!1}}function X(k){return s.btoa(encodeURIComponent(k).replace(/%([0-9A-F]{2})/g,function(C,V){return String.fromCharCode(+("0x"+V))}))}function re(k){return decodeURIComponent(s.atob(k).split("").map(function(C){return"%"+("00"+C.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var ee=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),q=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,ae=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,ie,fe,we={now:ee,frame:function(C){var V=q(C);return{cancel:function(){return ae(V)}}},getImageData:function(C,V){V===void 0&&(V=0);var se=s.document.createElement("canvas"),_e=se.getContext("2d");if(!_e)throw new Error("failed to create canvas 2d context");return se.width=C.width,se.height=C.height,_e.drawImage(C,0,0,C.width,C.height),_e.getImageData(-V,-V,C.width+2*V,C.height+2*V)},resolveURL:function(C){return ie||(ie=s.document.createElement("a")),ie.href=C,ie.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(fe==null&&(fe=s.matchMedia("(prefers-reduced-motion: reduce)")),fe.matches):!1}},Ae={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},Fe={supported:!1,testSupport:Ke},Ce,qe=!1,et,Qe=!1;s.document&&(et=s.document.createElement("img"),et.onload=function(){Ce&&Xe(Ce),Ce=null,Qe=!0},et.onerror=function(){qe=!0,Ce=null},et.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function Ke(k){qe||!et||(Qe?Xe(k):Ce=k)}function Xe(k){var C=k.createTexture();k.bindTexture(k.TEXTURE_2D,C);try{if(k.texImage2D(k.TEXTURE_2D,0,k.RGBA,k.RGBA,k.UNSIGNED_BYTE,et),k.isContextLost())return;Fe.supported=!0}catch{}k.deleteTexture(C),qe=!0}var Me="01";function xe(){for(var k="1",C="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",V="",se=0;se<10;se++)V+=C[Math.floor(Math.random()*62)];var _e=12*60*60*1e3,ke=[k,Me,V].join(""),Ne=Date.now()+_e;return{token:ke,tokenExpiresAt:Ne}}var ce=function(C,V){this._transformRequestFn=C,this._customAccessToken=V,this._createSkuToken()};ce.prototype._createSkuToken=function(){var C=xe();this._skuToken=C.token,this._skuTokenExpiresAt=C.tokenExpiresAt},ce.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},ce.prototype.transformRequest=function(C,V){return this._transformRequestFn?this._transformRequestFn(C,V)||{url:C}:{url:C}},ce.prototype.normalizeStyleURL=function(C,V){if(!Re(C))return C;var se=Rt(C);return se.path="/styles/v1"+se.path,this._makeAPIURL(se,this._customAccessToken||V)},ce.prototype.normalizeGlyphsURL=function(C,V){if(!Re(C))return C;var se=Rt(C);return se.path="/fonts/v1"+se.path,this._makeAPIURL(se,this._customAccessToken||V)},ce.prototype.normalizeSourceURL=function(C,V){if(!Re(C))return C;var se=Rt(C);return se.path="/v4/"+se.authority+".json",se.params.push("secure"),this._makeAPIURL(se,this._customAccessToken||V)},ce.prototype.normalizeSpriteURL=function(C,V,se,_e){var ke=Rt(C);return Re(C)?(ke.path="/styles/v1"+ke.path+"/sprite"+V+se,this._makeAPIURL(ke,this._customAccessToken||_e)):(ke.path+=""+V+se,Ut(ke))},ce.prototype.normalizeTileURL=function(C,V){if(this._isSkuTokenExpired()&&this._createSkuToken(),C&&!Re(C))return C;var se=Rt(C),_e=/(\.(png|jpg)\d*)(?=$)/,ke=/^.+\/v4\//,Ne=we.devicePixelRatio>=2||V===512?"@2x":"",it=Fe.supported?".webp":"$1";se.path=se.path.replace(_e,""+Ne+it),se.path=se.path.replace(ke,"/"),se.path="/v4"+se.path;var kt=this._customAccessToken||At(se.params)||Ae.ACCESS_TOKEN;return Ae.REQUIRE_ACCESS_TOKEN&&kt&&this._skuToken&&se.params.push("sku="+this._skuToken),this._makeAPIURL(se,kt)},ce.prototype.canonicalizeTileURL=function(C,V){var se="/v4/",_e=/\.[\w]+$/,ke=Rt(C);if(!ke.path.match(/(^\/v4\/)/)||!ke.path.match(_e))return C;var Ne="mapbox://tiles/";Ne+=ke.path.replace(se,"");var it=ke.params;return V&&(it=it.filter(function(kt){return!kt.match(/^access_token=/)})),it.length&&(Ne+="?"+it.join("&")),Ne},ce.prototype.canonicalizeTileset=function(C,V){for(var se=V?Re(V):!1,_e=[],ke=0,Ne=C.tiles||[];ke=0&&C.params.splice(ke,1)}if(_e.path!=="/"&&(C.path=""+_e.path+C.path),!Ae.REQUIRE_ACCESS_TOKEN)return Ut(C);if(V=V||Ae.ACCESS_TOKEN,!V)throw new Error("An API access token is required to use Mapbox GL. "+se);if(V[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+se);return C.params=C.params.filter(function(Ne){return Ne.indexOf("access_token")===-1}),C.params.push("access_token="+V),Ut(C)};function Re(k){return k.indexOf("mapbox:")===0}var $e=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function rt(k){return $e.test(k)}function Je(k){return k.indexOf("sku=")>0&&rt(k)}function At(k){for(var C=0,V=k;C=1&&s.localStorage.setItem(V,JSON.stringify(this.eventData))}catch{U("Unable to write to LocalStorage")}},Mr.prototype.processRequests=function(C){},Mr.prototype.postEvent=function(C,V,se,_e){var ke=this;if(Ae.EVENTS_URL){var Ne=Rt(Ae.EVENTS_URL);Ne.params.push("access_token="+(_e||Ae.ACCESS_TOKEN||""));var it={event:this.type,created:new Date(C).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:Me,userId:this.anonId},kt=V?_(it,V):it,Ft={url:Ut(Ne),headers:{"Content-Type":"text/plain"},body:JSON.stringify([kt])};this.pendingRequest=Ur(Ft,function(Gt){ke.pendingRequest=null,se(Gt),ke.saveEventData(),ke.processRequests(_e)})}},Mr.prototype.queueRequest=function(C,V){this.queue.push(C),this.processRequests(V)};var fr=function(k){function C(){k.call(this,"map.load"),this.success={},this.skuToken=""}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postMapLoadEvent=function(se,_e,ke,Ne){this.skuToken=ke,(Ae.EVENTS_URL&&Ne||Ae.ACCESS_TOKEN&&Array.isArray(se)&&se.some(function(it){return Re(it)||rt(it)}))&&this.queueRequest({id:_e,timestamp:Date.now()},Ne)},C.prototype.processRequests=function(se){var _e=this;if(!(this.pendingRequest||this.queue.length===0)){var ke=this.queue.shift(),Ne=ke.id,it=ke.timestamp;Ne&&this.success[Ne]||(this.anonId||this.fetchEventData(),R(this.anonId)||(this.anonId=g()),this.postEvent(it,{skuToken:this.skuToken},function(kt){kt||Ne&&(_e.success[Ne]=!0)},se))}},C}(Mr),dr=function(k){function C(V){k.call(this,"appUserTurnstile"),this._customAccessToken=V}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postTurnstileEvent=function(se,_e){Ae.EVENTS_URL&&Ae.ACCESS_TOKEN&&Array.isArray(se)&&se.some(function(ke){return Re(ke)||rt(ke)})&&this.queueRequest(Date.now(),_e)},C.prototype.processRequests=function(se){var _e=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var ke=ar(Ae.ACCESS_TOKEN),Ne=ke?ke.u:Ae.ACCESS_TOKEN,it=Ne!==this.eventData.tokenU;R(this.anonId)||(this.anonId=g(),it=!0);var kt=this.queue.shift();if(this.eventData.lastSuccess){var Ft=new Date(this.eventData.lastSuccess),Gt=new Date(kt),hr=(kt-this.eventData.lastSuccess)/(24*60*60*1e3);it=it||hr>=1||hr<-1||Ft.getDate()!==Gt.getDate()}else it=!0;if(!it)return this.processRequests();this.postEvent(kt,{"enabled.telemetry":!1},function(Dr){Dr||(_e.eventData.lastSuccess=kt,_e.eventData.tokenU=Ne)},se)}},C}(Mr),pt=new dr,ze=pt.postTurnstileEvent.bind(pt),Ge=new fr,Oe=Ge.postMapLoadEvent.bind(Ge),ve="mapbox-tiles",ge=500,be=50,Pe=1e3*60*7,We;function ct(){s.caches&&!We&&(We=s.caches.open(ve))}var _t;function Mt(k,C){if(_t===void 0)try{new Response(new ReadableStream),_t=!0}catch{_t=!1}_t?C(k.body):k.blob().then(C)}function Nt(k,C,V){if(ct(),!!We){var se={status:C.status,statusText:C.statusText,headers:new s.Headers};C.headers.forEach(function(Ne,it){return se.headers.set(it,Ne)});var _e=le(C.headers.get("Cache-Control")||"");if(!_e["no-store"]){_e["max-age"]&&se.headers.set("Expires",new Date(V+_e["max-age"]*1e3).toUTCString());var ke=new Date(se.headers.get("Expires")).getTime()-V;keDate.now()&&!V["no-cache"]}var lr=1/0;function ta(k){lr++,lr>be&&(k.getActor().send("enforceCacheSizeLimit",ge),lr=0)}function da(k){ct(),We&&We.then(function(C){C.keys().then(function(V){for(var se=0;se=200&&V.status<300||V.status===0)&&V.response!==null){var _e=V.response;if(k.type==="json")try{_e=JSON.parse(V.response)}catch(ke){return C(ke)}C(null,_e,V.getResponseHeader("Cache-Control"),V.getResponseHeader("Expires"))}else C(new Ka(V.statusText,V.status,k.url))},V.send(k.body),{cancel:function(){return V.abort()}}}var gr=function(k,C){if(!Lt(k.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return jt(k,C);if(oe()&&self.worker&&self.worker.actor){var V=!0;return self.worker.actor.send("getResource",k,C,void 0,V)}}return Ot(k,C)},Br=function(k,C){return gr(_(k,{type:"json"}),C)},na=function(k,C){return gr(_(k,{type:"arrayBuffer"}),C)},Ur=function(k,C){return gr(_(k,{method:"POST"}),C)};function ga(k){var C=s.document.createElement("a");return C.href=k,C.protocol===s.document.location.protocol&&C.host===s.document.location.host}var Aa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Pa(k,C,V,se){var _e=new s.Image,ke=s.URL;_e.onload=function(){C(null,_e),ke.revokeObjectURL(_e.src),_e.onload=null,s.requestAnimationFrame(function(){_e.src=Aa})},_e.onerror=function(){return C(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 Ne=new s.Blob([new Uint8Array(k)],{type:"image/png"});_e.cacheControl=V,_e.expires=se,_e.src=k.byteLength?ke.createObjectURL(Ne):Aa}function sa(k,C){var V=new s.Blob([new Uint8Array(k)],{type:"image/png"});s.createImageBitmap(V).then(function(se){C(null,se)}).catch(function(se){C(new Error("Could not load image because of "+se.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var Oa,dt,vt=function(){Oa=[],dt=0};vt();var Lr=function(k,C){if(Fe.supported&&(k.headers||(k.headers={}),k.headers.accept="image/webp,*/*"),dt>=Ae.MAX_PARALLEL_IMAGE_REQUESTS){var V={requestParameters:k,callback:C,cancelled:!1,cancel:function(){this.cancelled=!0}};return Oa.push(V),V}dt++;var se=!1,_e=function(){if(!se)for(se=!0,dt--;Oa.length&&dt0||this._oneTimeListeners&&this._oneTimeListeners[C]&&this._oneTimeListeners[C].length>0||this._eventedParent&&this._eventedParent.listens(C)},Pr.prototype.setEventedParent=function(C,V){return this._eventedParent=C,this._eventedParentData=V,this};var Hr=8,Zr={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"}},Jr={"*":{type:"source"}},wt=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Qt={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},mr={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},$r={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},oa={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},Sa={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"}}},ya={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"}}},ra={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"}},pa=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],pn={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ga={"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"}},qn={"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"}},Vn={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},di={"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"}},yi={"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"}},Ci={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ci={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ei={type:"array",value:"*"},mi={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},uo={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Lo={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Wo={type:"array",value:"*",minimum:1},li={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}},Ii=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],xi={"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"}},Ao={"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"}},So={"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"}},Ro={"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"}},Li={"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"}},Yi={"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"}},bs={"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"}},as={"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"}},fs={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Co={"*":{type:"string"}},Qa={$version:Hr,$root:Zr,sources:Jr,source:wt,source_vector:Qt,source_raster:mr,source_raster_dem:$r,source_geojson:oa,source_video:Sa,source_image:ya,layer:ra,layout:pa,layout_background:pn,layout_fill:Ga,layout_circle:qn,layout_heatmap:Vn,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:di,layout_symbol:yi,layout_raster:Ci,layout_hillshade:ci,filter:ei,filter_operator:mi,geometry_type:uo,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:Lo,expression:Wo,light:li,paint:Ii,paint_fill:xi,"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:Ao,paint_circle:So,paint_heatmap:Ro,paint_symbol:Li,paint_raster:Yi,paint_hillshade:bs,paint_background:as,transition:fs,"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:Co},Jn=function(C,V,se,_e){this.message=(C?C+": ":"")+se,_e&&(this.identifier=_e),V!=null&&V.__line__&&(this.line=V.__line__)};function Os(k){var C=k.key,V=k.value;return V?[new Jn(C,V,"constants have been deprecated as of v8")]:[]}function ds(k){for(var C=[],V=arguments.length-1;V-- >0;)C[V]=arguments[V+1];for(var se=0,_e=C;se<_e.length;se+=1){var ke=_e[se];for(var Ne in ke)k[Ne]=ke[Ne]}return k}function Ui(k){return k instanceof Number||k instanceof String||k instanceof Boolean?k.valueOf():k}function ms(k){if(Array.isArray(k))return k.map(ms);if(k instanceof Object&&!(k instanceof Number||k instanceof String||k instanceof Boolean)){var C={};for(var V in k)C[V]=ms(k[V]);return C}return Ui(k)}var Mo=function(k){function C(V,se){k.call(this,se),this.message=se,this.key=V}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C}(Error),ws=function(C,V){V===void 0&&(V=[]),this.parent=C,this.bindings={};for(var se=0,_e=V;se<_e.length;se+=1){var ke=_e[se],Ne=ke[0],it=ke[1];this.bindings[Ne]=it}};ws.prototype.concat=function(C){return new ws(this,C)},ws.prototype.get=function(C){if(this.bindings[C])return this.bindings[C];if(this.parent)return this.parent.get(C);throw new Error(C+" not found in scope.")},ws.prototype.has=function(C){return this.bindings[C]?!0:this.parent?this.parent.has(C):!1};var Ks={kind:"null"},Rn={kind:"number"},fo={kind:"string"},Pi={kind:"boolean"},zo={kind:"color"},wo={kind:"object"},bi={kind:"value"},wl={kind:"error"},$l={kind:"collator"},Js={kind:"formatted"},Ql={kind:"resolvedImage"};function Ws(k,C){return{kind:"array",itemType:k,N:C}}function Is(k){if(k.kind==="array"){var C=Is(k.itemType);return typeof k.N=="number"?"array<"+C+", "+k.N+">":k.itemType.kind==="value"?"array":"array<"+C+">"}else return k.kind}var Dl=[Ks,Rn,fo,Pi,zo,Js,wo,Ws(bi),Ql];function Xu(k,C){if(C.kind==="error")return null;if(k.kind==="array"){if(C.kind==="array"&&(C.N===0&&C.itemType.kind==="value"||!Xu(k.itemType,C.itemType))&&(typeof k.N!="number"||k.N===C.N))return null}else{if(k.kind===C.kind)return null;if(k.kind==="value")for(var V=0,se=Dl;V255?255:Ft}function _e(Ft){return Ft<0?0:Ft>1?1:Ft}function ke(Ft){return Ft[Ft.length-1]==="%"?se(parseFloat(Ft)/100*255):se(parseInt(Ft))}function Ne(Ft){return Ft[Ft.length-1]==="%"?_e(parseFloat(Ft)/100):_e(parseFloat(Ft))}function it(Ft,Gt,hr){return hr<0?hr+=1:hr>1&&(hr-=1),hr*6<1?Ft+(Gt-Ft)*hr*6:hr*2<1?Gt:hr*3<2?Ft+(Gt-Ft)*(2/3-hr)*6:Ft}function kt(Ft){var Gt=Ft.replace(/ /g,"").toLowerCase();if(Gt in V)return V[Gt].slice();if(Gt[0]==="#"){if(Gt.length===4){var hr=parseInt(Gt.substr(1),16);return hr>=0&&hr<=4095?[(hr&3840)>>4|(hr&3840)>>8,hr&240|(hr&240)>>4,hr&15|(hr&15)<<4,1]:null}else if(Gt.length===7){var hr=parseInt(Gt.substr(1),16);return hr>=0&&hr<=16777215?[(hr&16711680)>>16,(hr&65280)>>8,hr&255,1]:null}return null}var Dr=Gt.indexOf("("),Ir=Gt.indexOf(")");if(Dr!==-1&&Ir+1===Gt.length){var Xr=Gt.substr(0,Dr),ba=Gt.substr(Dr+1,Ir-(Dr+1)).split(","),Za=1;switch(Xr){case"rgba":if(ba.length!==4)return null;Za=Ne(ba.pop());case"rgb":return ba.length!==3?null:[ke(ba[0]),ke(ba[1]),ke(ba[2]),Za];case"hsla":if(ba.length!==4)return null;Za=Ne(ba.pop());case"hsl":if(ba.length!==3)return null;var Ra=(parseFloat(ba[0])%360+360)%360/360,dn=Ne(ba[1]),$a=Ne(ba[2]),vn=$a<=.5?$a*(dn+1):$a+dn-$a*dn,bn=$a*2-vn;return[se(it(bn,vn,Ra+1/3)*255),se(it(bn,vn,Ra)*255),se(it(bn,vn,Ra-1/3)*255),Za];default:return null}}return null}try{C.parseCSSColor=kt}catch{}}),gf=kf.parseCSSColor,ns=function(C,V,se,_e){_e===void 0&&(_e=1),this.r=C,this.g=V,this.b=se,this.a=_e};ns.parse=function(C){if(C){if(C instanceof ns)return C;if(typeof C=="string"){var V=gf(C);if(V)return new ns(V[0]/255*V[3],V[1]/255*V[3],V[2]/255*V[3],V[3])}}},ns.prototype.toString=function(){var C=this.toArray(),V=C[0],se=C[1],_e=C[2],ke=C[3];return"rgba("+Math.round(V)+","+Math.round(se)+","+Math.round(_e)+","+ke+")"},ns.prototype.toArray=function(){var C=this,V=C.r,se=C.g,_e=C.b,ke=C.a;return ke===0?[0,0,0,0]:[V*255/ke,se*255/ke,_e*255/ke,ke]},ns.black=new ns(0,0,0,1),ns.white=new ns(1,1,1,1),ns.transparent=new ns(0,0,0,0),ns.red=new ns(1,0,0,1);var _u=function(C,V,se){C?this.sensitivity=V?"variant":"case":this.sensitivity=V?"accent":"base",this.locale=se,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};_u.prototype.compare=function(C,V){return this.collator.compare(C,V)},_u.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Nc=function(C,V,se,_e,ke){this.text=C,this.image=V,this.scale=se,this.fontStack=_e,this.textColor=ke},ml=function(C){this.sections=C};ml.fromString=function(C){return new ml([new Nc(C,null,null,null,null)])},ml.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(C){return C.text.length!==0||C.image&&C.image.name.length!==0})},ml.factory=function(C){return C instanceof ml?C:ml.fromString(C)},ml.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(C){return C.text}).join("")},ml.prototype.serialize=function(){for(var C=["format"],V=0,se=this.sections;V=0&&k<=255&&typeof C=="number"&&C>=0&&C<=255&&typeof V=="number"&&V>=0&&V<=255)){var _e=typeof se=="number"?[k,C,V,se]:[k,C,V];return"Invalid rgba value ["+_e.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof se>"u"||typeof se=="number"&&se>=0&&se<=1?null:"Invalid rgba value ["+[k,C,V,se].join(", ")+"]: 'a' must be between 0 and 1."}function Yu(k){if(k===null)return!0;if(typeof k=="string")return!0;if(typeof k=="boolean")return!0;if(typeof k=="number")return!0;if(k instanceof ns)return!0;if(k instanceof _u)return!0;if(k instanceof ml)return!0;if(k instanceof fl)return!0;if(Array.isArray(k)){for(var C=0,V=k;C2){var it=C[1];if(typeof it!="string"||!(it in Nu)||it==="object")return V.error('The item type argument of "array" must be one of string, number, boolean',1);Ne=Nu[it],se++}else Ne=bi;var kt;if(C.length>3){if(C[2]!==null&&(typeof C[2]!="number"||C[2]<0||C[2]!==Math.floor(C[2])))return V.error('The length argument to "array" must be a positive integer literal',2);kt=C[2],se++}_e=Ws(Ne,kt)}else _e=Nu[ke];for(var Ft=[];se1)&&V.push(_e)}}return V.concat(this.args.map(function(ke){return ke.serialize()}))};var Ku=function(C){this.type=Js,this.sections=C};Ku.parse=function(C,V){if(C.length<2)return V.error("Expected at least one argument.");var se=C[1];if(!Array.isArray(se)&&typeof se=="object")return V.error("First argument must be an image or text section.");for(var _e=[],ke=!1,Ne=1;Ne<=C.length-1;++Ne){var it=C[Ne];if(ke&&typeof it=="object"&&!Array.isArray(it)){ke=!1;var kt=null;if(it["font-scale"]&&(kt=V.parse(it["font-scale"],1,Rn),!kt))return null;var Ft=null;if(it["text-font"]&&(Ft=V.parse(it["text-font"],1,Ws(fo)),!Ft))return null;var Gt=null;if(it["text-color"]&&(Gt=V.parse(it["text-color"],1,zo),!Gt))return null;var hr=_e[_e.length-1];hr.scale=kt,hr.font=Ft,hr.textColor=Gt}else{var Dr=V.parse(C[Ne],1,bi);if(!Dr)return null;var Ir=Dr.type.kind;if(Ir!=="string"&&Ir!=="value"&&Ir!=="null"&&Ir!=="resolvedImage")return V.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");ke=!0,_e.push({content:Dr,scale:null,font:null,textColor:null})}}return new Ku(_e)},Ku.prototype.evaluate=function(C){var V=function(se){var _e=se.content.evaluate(C);return Ts(_e)===Ql?new Nc("",_e,null,null,null):new Nc(Tl(_e),null,se.scale?se.scale.evaluate(C):null,se.font?se.font.evaluate(C).join(","):null,se.textColor?se.textColor.evaluate(C):null)};return new ml(this.sections.map(V))},Ku.prototype.eachChild=function(C){for(var V=0,se=this.sections;V-1),se},Bs.prototype.eachChild=function(C){C(this.input)},Bs.prototype.outputDefined=function(){return!1},Bs.prototype.serialize=function(){return["image",this.input.serialize()]};var Gf={"to-boolean":Pi,"to-color":zo,"to-number":Rn,"to-string":fo},Eo=function(C,V){this.type=C,this.args=V};Eo.parse=function(C,V){if(C.length<2)return V.error("Expected at least one argument.");var se=C[0];if((se==="to-boolean"||se==="to-string")&&C.length!==2)return V.error("Expected one argument.");for(var _e=Gf[se],ke=[],Ne=1;Ne4?se="Invalid rbga value "+JSON.stringify(V)+": expected an array containing either three or four numeric values.":se=_l(V[0],V[1],V[2],V[3]),!se))return new ns(V[0]/255,V[1]/255,V[2]/255,V[3])}throw new Cs(se||"Could not parse color from value '"+(typeof V=="string"?V:String(JSON.stringify(V)))+"'")}else if(this.type.kind==="number"){for(var kt=null,Ft=0,Gt=this.args;Ft=C[2]||k[1]<=C[1]||k[3]>=C[3])}function yf(k,C){var V=Ju(k[0]),se=gc(k[1]),_e=Math.pow(2,C.z);return[Math.round(V*_e*zl),Math.round(se*_e*zl)]}function Jc(k,C,V){var se=k[0]-C[0],_e=k[1]-C[1],ke=k[0]-V[0],Ne=k[1]-V[1];return se*Ne-ke*_e===0&&se*ke<=0&&_e*Ne<=0}function Uc(k,C,V){return C[1]>k[1]!=V[1]>k[1]&&k[0]<(V[0]-C[0])*(k[1]-C[1])/(V[1]-C[1])+C[0]}function $u(k,C){for(var V=!1,se=0,_e=C.length;se<_e;se++)for(var ke=C[se],Ne=0,it=ke.length;Ne0&&hr<0||Gt<0&&hr>0}function Qc(k,C,V,se){var _e=[C[0]-k[0],C[1]-k[1]],ke=[se[0]-V[0],se[1]-V[1]];return $c(ke,_e)===0?!1:!!(bu(k,C,V,se)&&bu(V,se,k,C))}function sc(k,C,V){for(var se=0,_e=V;se<_e.length;se+=1)for(var ke=_e[se],Ne=0;NeV[2]){var _e=se*.5,ke=k[0]-V[0]>_e?-se:V[0]-k[0]>_e?se:0;ke===0&&(ke=k[0]-V[2]>_e?-se:V[2]-k[0]>_e?se:0),k[0]+=ke}Kc(C,k)}function Vc(k){k[0]=k[1]=1/0,k[2]=k[3]=-1/0}function Zf(k,C,V,se){for(var _e=Math.pow(2,se.z)*zl,ke=[se.x*zl,se.y*zl],Ne=[],it=0,kt=k;it=0)return!1;var V=!0;return k.eachChild(function(se){V&&!ru(se,C)&&(V=!1)}),V}var Uu=function(C,V){this.type=V.type,this.name=C,this.boundExpression=V};Uu.parse=function(C,V){if(C.length!==2||typeof C[1]!="string")return V.error("'var' expression requires exactly one string literal argument.");var se=C[1];return V.scope.has(se)?new Uu(se,V.scope.get(se)):V.error('Unknown variable "'+se+'". Make sure "'+se+'" has been bound in an enclosing "let" expression before using it.',1)},Uu.prototype.evaluate=function(C){return this.boundExpression.evaluate(C)},Uu.prototype.eachChild=function(){},Uu.prototype.outputDefined=function(){return!1},Uu.prototype.serialize=function(){return["var",this.name]};var $s=function(C,V,se,_e,ke){V===void 0&&(V=[]),_e===void 0&&(_e=new ws),ke===void 0&&(ke=[]),this.registry=C,this.path=V,this.key=V.map(function(Ne){return"["+Ne+"]"}).join(""),this.scope=_e,this.errors=ke,this.expectedType=se};$s.prototype.parse=function(C,V,se,_e,ke){return ke===void 0&&(ke={}),V?this.concat(V,se,_e)._parse(C,ke):this._parse(C,ke)},$s.prototype._parse=function(C,V){(C===null||typeof C=="string"||typeof C=="boolean"||typeof C=="number")&&(C=["literal",C]);function se(Gt,hr,Dr){return Dr==="assert"?new Ul(hr,[Gt]):Dr==="coerce"?new Eo(hr,[Gt]):Gt}if(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 _e=C[0];if(typeof _e!="string")return this.error("Expression name must be a string, but found "+typeof _e+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var ke=this.registry[_e];if(ke){var Ne=ke.parse(C,this);if(!Ne)return null;if(this.expectedType){var it=this.expectedType,kt=Ne.type;if((it.kind==="string"||it.kind==="number"||it.kind==="boolean"||it.kind==="object"||it.kind==="array")&&kt.kind==="value")Ne=se(Ne,it,V.typeAnnotation||"assert");else if((it.kind==="color"||it.kind==="formatted"||it.kind==="resolvedImage")&&(kt.kind==="value"||kt.kind==="string"))Ne=se(Ne,it,V.typeAnnotation||"coerce");else if(this.checkSubtype(it,kt))return null}if(!(Ne instanceof Ko)&&Ne.type.kind!=="resolvedImage"&&Qu(Ne)){var Ft=new is;try{Ne=new Ko(Ne.type,Ne.evaluate(Ft))}catch(Gt){return this.error(Gt.message),null}}return Ne}return this.error('Unknown expression "'+_e+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof C>"u"?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.")},$s.prototype.concat=function(C,V,se){var _e=typeof C=="number"?this.path.concat(C):this.path,ke=se?this.scope.concat(se):this.scope;return new $s(this.registry,_e,V||null,ke,this.errors)},$s.prototype.error=function(C){for(var V=[],se=arguments.length-1;se-- >0;)V[se]=arguments[se+1];var _e=""+this.key+V.map(function(ke){return"["+ke+"]"}).join("");this.errors.push(new Mo(_e,C))},$s.prototype.checkSubtype=function(C,V){var se=Xu(C,V);return se&&this.error(se),se};function Qu(k){if(k instanceof Uu)return Qu(k.boundExpression);if(k instanceof oo&&k.name==="error")return!1;if(k instanceof xu)return!1;if(k instanceof tu)return!1;var C=k instanceof Eo||k instanceof Ul,V=!0;return k.eachChild(function(se){C?V=V&&Qu(se):V=V&&se instanceof Ko}),V?xf(k)&&ru(k,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Tu(k,C){for(var V=k.length-1,se=0,_e=V,ke=0,Ne,it;se<=_e;)if(ke=Math.floor((se+_e)/2),Ne=k[ke],it=k[ke+1],Ne<=C){if(ke===V||CC)_e=ke-1;else throw new Cs("Input is not a number.");return 0}var au=function(C,V,se){this.type=C,this.input=V,this.labels=[],this.outputs=[];for(var _e=0,ke=se;_e=it)return V.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Ft);var hr=V.parse(kt,Gt,ke);if(!hr)return null;ke=ke||hr.type,_e.push([it,hr])}return new au(ke,se,_e)},au.prototype.evaluate=function(C){var V=this.labels,se=this.outputs;if(V.length===1)return se[0].evaluate(C);var _e=this.input.evaluate(C);if(_e<=V[0])return se[0].evaluate(C);var ke=V.length;if(_e>=V[ke-1])return se[ke-1].evaluate(C);var Ne=Tu(V,_e);return se[Ne].evaluate(C)},au.prototype.eachChild=function(C){C(this.input);for(var V=0,se=this.outputs;V0&&C.push(this.labels[V]),C.push(this.outputs[V].serialize());return C};function Ns(k,C,V){return k*(1-V)+C*V}function yc(k,C,V){return new ns(Ns(k.r,C.r,V),Ns(k.g,C.g,V),Ns(k.b,C.b,V),Ns(k.a,C.a,V))}function Pu(k,C,V){return k.map(function(se,_e){return Ns(se,C[_e],V)})}var ec=Object.freeze({__proto__:null,number:Ns,color:yc,array:Pu}),Ec=.95047,Cf=1,nh=1.08883,lc=4/29,kc=6/29,nu=3*kc*kc,tf=kc*kc*kc,Cl=Math.PI/180,uc=180/Math.PI;function rf(k){return k>tf?Math.pow(k,1/3):k/nu+lc}function mc(k){return k>kc?k*k*k:nu*(k-lc)}function Us(k){return 255*(k<=.0031308?12.92*k:1.055*Math.pow(k,1/2.4)-.055)}function vu(k){return k/=255,k<=.04045?k/12.92:Math.pow((k+.055)/1.055,2.4)}function du(k){var C=vu(k.r),V=vu(k.g),se=vu(k.b),_e=rf((.4124564*C+.3575761*V+.1804375*se)/Ec),ke=rf((.2126729*C+.7151522*V+.072175*se)/Cf),Ne=rf((.0193339*C+.119192*V+.9503041*se)/nh);return{l:116*ke-16,a:500*(_e-ke),b:200*(ke-Ne),alpha:k.a}}function af(k){var C=(k.l+16)/116,V=isNaN(k.a)?C:C+k.a/500,se=isNaN(k.b)?C:C-k.b/200;return C=Cf*mc(C),V=Ec*mc(V),se=nh*mc(se),new ns(Us(3.2404542*V-1.5371385*C-.4985314*se),Us(-.969266*V+1.8760108*C+.041556*se),Us(.0556434*V-.2040259*C+1.0572252*se),k.alpha)}function Rs(k,C,V){return{l:Ns(k.l,C.l,V),a:Ns(k.a,C.a,V),b:Ns(k.b,C.b,V),alpha:Ns(k.alpha,C.alpha,V)}}function _c(k){var C=du(k),V=C.l,se=C.a,_e=C.b,ke=Math.atan2(_e,se)*uc;return{h:ke<0?ke+360:ke,c:Math.sqrt(se*se+_e*_e),l:V,alpha:k.a}}function ju(k){var C=k.h*Cl,V=k.c,se=k.l;return af({l:se,a:Math.cos(C)*V,b:Math.sin(C)*V,alpha:k.alpha})}function iu(k,C,V){var se=C-k;return k+V*(se>180||se<-180?se-360*Math.round(se/360):se)}function xc(k,C,V){return{h:iu(k.h,C.h,V),c:Ns(k.c,C.c,V),l:Ns(k.l,C.l,V),alpha:Ns(k.alpha,C.alpha,V)}}var Iu={forward:du,reverse:af,interpolate:Rs},bc={forward:_c,reverse:ju,interpolate:xc},Lf=Object.freeze({__proto__:null,lab:Iu,hcl:bc}),xl=function(C,V,se,_e,ke){this.type=C,this.operator=V,this.interpolation=se,this.input=_e,this.labels=[],this.outputs=[];for(var Ne=0,it=ke;Ne1}))return V.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_e={name:"cubic-bezier",controlPoints:kt}}else return V.error("Unknown interpolation type "+String(_e[0]),1,0);if(C.length-1<4)return V.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if((C.length-1)%2!==0)return V.error("Expected an even number of arguments.");if(ke=V.parse(ke,2,Rn),!ke)return null;var Ft=[],Gt=null;se==="interpolate-hcl"||se==="interpolate-lab"?Gt=zo:V.expectedType&&V.expectedType.kind!=="value"&&(Gt=V.expectedType);for(var hr=0;hr=Dr)return V.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Xr);var Za=V.parse(Ir,ba,Gt);if(!Za)return null;Gt=Gt||Za.type,Ft.push([Dr,Za])}return Gt.kind!=="number"&&Gt.kind!=="color"&&!(Gt.kind==="array"&&Gt.itemType.kind==="number"&&typeof Gt.N=="number")?V.error("Type "+Is(Gt)+" is not interpolatable."):new xl(Gt,se,_e,ke,Ft)},xl.prototype.evaluate=function(C){var V=this.labels,se=this.outputs;if(V.length===1)return se[0].evaluate(C);var _e=this.input.evaluate(C);if(_e<=V[0])return se[0].evaluate(C);var ke=V.length;if(_e>=V[ke-1])return se[ke-1].evaluate(C);var Ne=Tu(V,_e),it=V[Ne],kt=V[Ne+1],Ft=xl.interpolationFactor(this.interpolation,_e,it,kt),Gt=se[Ne].evaluate(C),hr=se[Ne+1].evaluate(C);return this.operator==="interpolate"?ec[this.type.kind.toLowerCase()](Gt,hr,Ft):this.operator==="interpolate-hcl"?bc.reverse(bc.interpolate(bc.forward(Gt),bc.forward(hr),Ft)):Iu.reverse(Iu.interpolate(Iu.forward(Gt),Iu.forward(hr),Ft))},xl.prototype.eachChild=function(C){C(this.input);for(var V=0,se=this.outputs;V=se.length)throw new Cs("Array index out of bounds: "+V+" > "+(se.length-1)+".");if(V!==Math.floor(V))throw new Cs("Array index must be an integer, but found "+V+" instead.");return se[V]},Au.prototype.eachChild=function(C){C(this.index),C(this.input)},Au.prototype.outputDefined=function(){return!1},Au.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Zs=function(C,V){this.type=Pi,this.needle=C,this.haystack=V};Zs.parse=function(C,V){if(C.length!==3)return V.error("Expected 2 arguments, but found "+(C.length-1)+" instead.");var se=V.parse(C[1],1,bi),_e=V.parse(C[2],2,bi);return!se||!_e?null:Lu(se.type,[Pi,fo,Rn,Ks,bi])?new Zs(se,_e):V.error("Expected first argument to be of type boolean, string, number or null, but found "+Is(se.type)+" instead")},Zs.prototype.evaluate=function(C){var V=this.needle.evaluate(C),se=this.haystack.evaluate(C);if(!se)return!1;if(!Bu(V,["boolean","string","number","null"]))throw new Cs("Expected first argument to be of type boolean, string, number or null, but found "+Is(Ts(V))+" instead.");if(!Bu(se,["string","array"]))throw new Cs("Expected second argument to be of type array or string, but found "+Is(Ts(se))+" instead.");return se.indexOf(V)>=0},Zs.prototype.eachChild=function(C){C(this.needle),C(this.haystack)},Zs.prototype.outputDefined=function(){return!0},Zs.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Ol=function(C,V,se){this.type=Rn,this.needle=C,this.haystack=V,this.fromIndex=se};Ol.parse=function(C,V){if(C.length<=2||C.length>=5)return V.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var se=V.parse(C[1],1,bi),_e=V.parse(C[2],2,bi);if(!se||!_e)return null;if(!Lu(se.type,[Pi,fo,Rn,Ks,bi]))return V.error("Expected first argument to be of type boolean, string, number or null, but found "+Is(se.type)+" instead");if(C.length===4){var ke=V.parse(C[3],3,Rn);return ke?new Ol(se,_e,ke):null}else return new Ol(se,_e)},Ol.prototype.evaluate=function(C){var V=this.needle.evaluate(C),se=this.haystack.evaluate(C);if(!Bu(V,["boolean","string","number","null"]))throw new Cs("Expected first argument to be of type boolean, string, number or null, but found "+Is(Ts(V))+" instead.");if(!Bu(se,["string","array"]))throw new Cs("Expected second argument to be of type array or string, but found "+Is(Ts(se))+" instead.");if(this.fromIndex){var _e=this.fromIndex.evaluate(C);return se.indexOf(V,_e)}return se.indexOf(V)},Ol.prototype.eachChild=function(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)},Ol.prototype.outputDefined=function(){return!1},Ol.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 bl=function(C,V,se,_e,ke,Ne){this.inputType=C,this.type=V,this.input=se,this.cases=_e,this.outputs=ke,this.otherwise=Ne};bl.parse=function(C,V){if(C.length<5)return V.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if(C.length%2!==1)return V.error("Expected an even number of arguments.");var se,_e;V.expectedType&&V.expectedType.kind!=="value"&&(_e=V.expectedType);for(var ke={},Ne=[],it=2;itNumber.MAX_SAFE_INTEGER)return Gt.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof Ir=="number"&&Math.floor(Ir)!==Ir)return Gt.error("Numeric branch labels must be integer values.");if(!se)se=Ts(Ir);else if(Gt.checkSubtype(se,Ts(Ir)))return null;if(typeof ke[String(Ir)]<"u")return Gt.error("Branch labels must be unique.");ke[String(Ir)]=Ne.length}var Xr=V.parse(Ft,it,_e);if(!Xr)return null;_e=_e||Xr.type,Ne.push(Xr)}var ba=V.parse(C[1],1,bi);if(!ba)return null;var Za=V.parse(C[C.length-1],C.length-1,_e);return!Za||ba.type.kind!=="value"&&V.concat(1).checkSubtype(se,ba.type)?null:new bl(se,_e,ba,ke,Ne,Za)},bl.prototype.evaluate=function(C){var V=this.input.evaluate(C),se=Ts(V)===this.inputType&&this.outputs[this.cases[V]]||this.otherwise;return se.evaluate(C)},bl.prototype.eachChild=function(C){C(this.input),this.outputs.forEach(C),C(this.otherwise)},bl.prototype.outputDefined=function(){return this.outputs.every(function(C){return C.outputDefined()})&&this.otherwise.outputDefined()},bl.prototype.serialize=function(){for(var C=this,V=["match",this.input.serialize()],se=Object.keys(this.cases).sort(),_e=[],ke={},Ne=0,it=se;Ne=5)return V.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var se=V.parse(C[1],1,bi),_e=V.parse(C[2],2,Rn);if(!se||!_e)return null;if(!Lu(se.type,[Ws(bi),fo,bi]))return V.error("Expected first argument to be of type array or string, but found "+Is(se.type)+" instead");if(C.length===4){var ke=V.parse(C[3],3,Rn);return ke?new Su(se.type,se,_e,ke):null}else return new Su(se.type,se,_e)},Su.prototype.evaluate=function(C){var V=this.input.evaluate(C),se=this.beginIndex.evaluate(C);if(!Bu(V,["string","array"]))throw new Cs("Expected first argument to be of type array or string, but found "+Is(Ts(V))+" instead.");if(this.endIndex){var _e=this.endIndex.evaluate(C);return V.slice(se,_e)}return V.slice(se)},Su.prototype.eachChild=function(C){C(this.input),C(this.beginIndex),this.endIndex&&C(this.endIndex)},Su.prototype.outputDefined=function(){return!1},Su.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()]};function Cc(k,C){return k==="=="||k==="!="?C.kind==="boolean"||C.kind==="string"||C.kind==="number"||C.kind==="null"||C.kind==="value":C.kind==="string"||C.kind==="number"||C.kind==="value"}function Ht(k,C,V){return C===V}function ur(k,C,V){return C!==V}function qr(k,C,V){return CV}function ua(k,C,V){return C<=V}function Fa(k,C,V){return C>=V}function ja(k,C,V,se){return se.compare(C,V)===0}function sn(k,C,V,se){return!ja(k,C,V,se)}function gn(k,C,V,se){return se.compare(C,V)<0}function kn(k,C,V,se){return se.compare(C,V)>0}function Ja(k,C,V,se){return se.compare(C,V)<=0}function _n(k,C,V,se){return se.compare(C,V)>=0}function on(k,C,V){var se=k!=="=="&&k!=="!=";return function(){function _e(ke,Ne,it){this.type=Pi,this.lhs=ke,this.rhs=Ne,this.collator=it,this.hasUntypedArgument=ke.type.kind==="value"||Ne.type.kind==="value"}return _e.parse=function(Ne,it){if(Ne.length!==3&&Ne.length!==4)return it.error("Expected two or three arguments.");var kt=Ne[0],Ft=it.parse(Ne[1],1,bi);if(!Ft)return null;if(!Cc(kt,Ft.type))return it.concat(1).error('"'+kt+`" comparisons are not supported for type '`+Is(Ft.type)+"'.");var Gt=it.parse(Ne[2],2,bi);if(!Gt)return null;if(!Cc(kt,Gt.type))return it.concat(2).error('"'+kt+`" comparisons are not supported for type '`+Is(Gt.type)+"'.");if(Ft.type.kind!==Gt.type.kind&&Ft.type.kind!=="value"&&Gt.type.kind!=="value")return it.error("Cannot compare types '"+Is(Ft.type)+"' and '"+Is(Gt.type)+"'.");se&&(Ft.type.kind==="value"&&Gt.type.kind!=="value"?Ft=new Ul(Gt.type,[Ft]):Ft.type.kind!=="value"&&Gt.type.kind==="value"&&(Gt=new Ul(Ft.type,[Gt])));var hr=null;if(Ne.length===4){if(Ft.type.kind!=="string"&&Gt.type.kind!=="string"&&Ft.type.kind!=="value"&&Gt.type.kind!=="value")return it.error("Cannot use collator to compare non-string types.");if(hr=it.parse(Ne[3],3,$l),!hr)return null}return new _e(Ft,Gt,hr)},_e.prototype.evaluate=function(Ne){var it=this.lhs.evaluate(Ne),kt=this.rhs.evaluate(Ne);if(se&&this.hasUntypedArgument){var Ft=Ts(it),Gt=Ts(kt);if(Ft.kind!==Gt.kind||!(Ft.kind==="string"||Ft.kind==="number"))throw new Cs('Expected arguments for "'+k+'" to be (string, string) or (number, number), but found ('+Ft.kind+", "+Gt.kind+") instead.")}if(this.collator&&!se&&this.hasUntypedArgument){var hr=Ts(it),Dr=Ts(kt);if(hr.kind!=="string"||Dr.kind!=="string")return C(Ne,it,kt)}return this.collator?V(Ne,it,kt,this.collator.evaluate(Ne)):C(Ne,it,kt)},_e.prototype.eachChild=function(Ne){Ne(this.lhs),Ne(this.rhs),this.collator&&Ne(this.collator)},_e.prototype.outputDefined=function(){return!0},_e.prototype.serialize=function(){var Ne=[k];return this.eachChild(function(it){Ne.push(it.serialize())}),Ne},_e}()}var Wa=on("==",Ht,ja),On=on("!=",ur,sn),zi=on("<",qr,gn),ki=on(">",Or,kn),ji=on("<=",ua,Ja),Ni=on(">=",Fa,_n),Bn=function(C,V,se,_e,ke){this.type=fo,this.number=C,this.locale=V,this.currency=se,this.minFractionDigits=_e,this.maxFractionDigits=ke};Bn.parse=function(C,V){if(C.length!==3)return V.error("Expected two arguments.");var se=V.parse(C[1],1,Rn);if(!se)return null;var _e=C[2];if(typeof _e!="object"||Array.isArray(_e))return V.error("NumberFormat options argument must be an object.");var ke=null;if(_e.locale&&(ke=V.parse(_e.locale,1,fo),!ke))return null;var Ne=null;if(_e.currency&&(Ne=V.parse(_e.currency,1,fo),!Ne))return null;var it=null;if(_e["min-fraction-digits"]&&(it=V.parse(_e["min-fraction-digits"],1,Rn),!it))return null;var kt=null;return _e["max-fraction-digits"]&&(kt=V.parse(_e["max-fraction-digits"],1,Rn),!kt)?null:new Bn(se,ke,Ne,it,kt)},Bn.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))},Bn.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)},Bn.prototype.outputDefined=function(){return!1},Bn.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 An=function(C){this.type=Rn,this.input=C};An.parse=function(C,V){if(C.length!==2)return V.error("Expected 1 argument, but found "+(C.length-1)+" instead.");var se=V.parse(C[1],1);return se?se.type.kind!=="array"&&se.type.kind!=="string"&&se.type.kind!=="value"?V.error("Expected argument of type string or array, but found "+Is(se.type)+" instead."):new An(se):null},An.prototype.evaluate=function(C){var V=this.input.evaluate(C);if(typeof V=="string")return V.length;if(Array.isArray(V))return V.length;throw new Cs("Expected value to be of type string or array, but found "+Is(Ts(V))+" instead.")},An.prototype.eachChild=function(C){C(this.input)},An.prototype.outputDefined=function(){return!1},An.prototype.serialize=function(){var C=["length"];return this.eachChild(function(V){C.push(V.serialize())}),C};var Ki={"==":Wa,"!=":On,">":ki,"<":zi,">=":Ni,"<=":ji,array:Ul,at:Au,boolean:Ul,case:tc,coalesce:ou,collator:xu,format:Ku,image:Bs,in:Zs,"index-of":Ol,interpolate:xl,"interpolate-hcl":xl,"interpolate-lab":xl,length:An,let:Ru,literal:Ko,match:bl,number:Ul,"number-format":Bn,object:Ul,slice:Su,step:au,string:Ul,"to-boolean":Eo,"to-color":Eo,"to-number":Eo,"to-string":Eo,var:Uu,within:tu};function ko(k,C){var V=C[0],se=C[1],_e=C[2],ke=C[3];V=V.evaluate(k),se=se.evaluate(k),_e=_e.evaluate(k);var Ne=ke?ke.evaluate(k):1,it=_l(V,se,_e,Ne);if(it)throw new Cs(it);return new ns(V/255*Ne,se/255*Ne,_e/255*Ne,Ne)}function $o(k,C){return k in C}function Ls(k,C){var V=C[k];return typeof V>"u"?null:V}function os(k,C,V,se){for(;V<=se;){var _e=V+se>>1;if(C[_e]===k)return!0;C[_e]>k?se=_e-1:V=_e+1}return!1}function As(k){return{type:k}}oo.register(Ki,{error:[wl,[fo],function(k,C){var V=C[0];throw new Cs(V.evaluate(k))}],typeof:[fo,[bi],function(k,C){var V=C[0];return Is(Ts(V.evaluate(k)))}],"to-rgba":[Ws(Rn,4),[zo],function(k,C){var V=C[0];return V.evaluate(k).toArray()}],rgb:[zo,[Rn,Rn,Rn],ko],rgba:[zo,[Rn,Rn,Rn,Rn],ko],has:{type:Pi,overloads:[[[fo],function(k,C){var V=C[0];return $o(V.evaluate(k),k.properties())}],[[fo,wo],function(k,C){var V=C[0],se=C[1];return $o(V.evaluate(k),se.evaluate(k))}]]},get:{type:bi,overloads:[[[fo],function(k,C){var V=C[0];return Ls(V.evaluate(k),k.properties())}],[[fo,wo],function(k,C){var V=C[0],se=C[1];return Ls(V.evaluate(k),se.evaluate(k))}]]},"feature-state":[bi,[fo],function(k,C){var V=C[0];return Ls(V.evaluate(k),k.featureState||{})}],properties:[wo,[],function(k){return k.properties()}],"geometry-type":[fo,[],function(k){return k.geometryType()}],id:[bi,[],function(k){return k.id()}],zoom:[Rn,[],function(k){return k.globals.zoom}],"heatmap-density":[Rn,[],function(k){return k.globals.heatmapDensity||0}],"line-progress":[Rn,[],function(k){return k.globals.lineProgress||0}],accumulated:[bi,[],function(k){return k.globals.accumulated===void 0?null:k.globals.accumulated}],"+":[Rn,As(Rn),function(k,C){for(var V=0,se=0,_e=C;se<_e.length;se+=1){var ke=_e[se];V+=ke.evaluate(k)}return V}],"*":[Rn,As(Rn),function(k,C){for(var V=1,se=0,_e=C;se<_e.length;se+=1){var ke=_e[se];V*=ke.evaluate(k)}return V}],"-":{type:Rn,overloads:[[[Rn,Rn],function(k,C){var V=C[0],se=C[1];return V.evaluate(k)-se.evaluate(k)}],[[Rn],function(k,C){var V=C[0];return-V.evaluate(k)}]]},"/":[Rn,[Rn,Rn],function(k,C){var V=C[0],se=C[1];return V.evaluate(k)/se.evaluate(k)}],"%":[Rn,[Rn,Rn],function(k,C){var V=C[0],se=C[1];return V.evaluate(k)%se.evaluate(k)}],ln2:[Rn,[],function(){return Math.LN2}],pi:[Rn,[],function(){return Math.PI}],e:[Rn,[],function(){return Math.E}],"^":[Rn,[Rn,Rn],function(k,C){var V=C[0],se=C[1];return Math.pow(V.evaluate(k),se.evaluate(k))}],sqrt:[Rn,[Rn],function(k,C){var V=C[0];return Math.sqrt(V.evaluate(k))}],log10:[Rn,[Rn],function(k,C){var V=C[0];return Math.log(V.evaluate(k))/Math.LN10}],ln:[Rn,[Rn],function(k,C){var V=C[0];return Math.log(V.evaluate(k))}],log2:[Rn,[Rn],function(k,C){var V=C[0];return Math.log(V.evaluate(k))/Math.LN2}],sin:[Rn,[Rn],function(k,C){var V=C[0];return Math.sin(V.evaluate(k))}],cos:[Rn,[Rn],function(k,C){var V=C[0];return Math.cos(V.evaluate(k))}],tan:[Rn,[Rn],function(k,C){var V=C[0];return Math.tan(V.evaluate(k))}],asin:[Rn,[Rn],function(k,C){var V=C[0];return Math.asin(V.evaluate(k))}],acos:[Rn,[Rn],function(k,C){var V=C[0];return Math.acos(V.evaluate(k))}],atan:[Rn,[Rn],function(k,C){var V=C[0];return Math.atan(V.evaluate(k))}],min:[Rn,As(Rn),function(k,C){return Math.min.apply(Math,C.map(function(V){return V.evaluate(k)}))}],max:[Rn,As(Rn),function(k,C){return Math.max.apply(Math,C.map(function(V){return V.evaluate(k)}))}],abs:[Rn,[Rn],function(k,C){var V=C[0];return Math.abs(V.evaluate(k))}],round:[Rn,[Rn],function(k,C){var V=C[0],se=V.evaluate(k);return se<0?-Math.round(-se):Math.round(se)}],floor:[Rn,[Rn],function(k,C){var V=C[0];return Math.floor(V.evaluate(k))}],ceil:[Rn,[Rn],function(k,C){var V=C[0];return Math.ceil(V.evaluate(k))}],"filter-==":[Pi,[fo,bi],function(k,C){var V=C[0],se=C[1];return k.properties()[V.value]===se.value}],"filter-id-==":[Pi,[bi],function(k,C){var V=C[0];return k.id()===V.value}],"filter-type-==":[Pi,[fo],function(k,C){var V=C[0];return k.geometryType()===V.value}],"filter-<":[Pi,[fo,bi],function(k,C){var V=C[0],se=C[1],_e=k.properties()[V.value],ke=se.value;return typeof _e==typeof ke&&_e":[Pi,[fo,bi],function(k,C){var V=C[0],se=C[1],_e=k.properties()[V.value],ke=se.value;return typeof _e==typeof ke&&_e>ke}],"filter-id->":[Pi,[bi],function(k,C){var V=C[0],se=k.id(),_e=V.value;return typeof se==typeof _e&&se>_e}],"filter-<=":[Pi,[fo,bi],function(k,C){var V=C[0],se=C[1],_e=k.properties()[V.value],ke=se.value;return typeof _e==typeof ke&&_e<=ke}],"filter-id-<=":[Pi,[bi],function(k,C){var V=C[0],se=k.id(),_e=V.value;return typeof se==typeof _e&&se<=_e}],"filter->=":[Pi,[fo,bi],function(k,C){var V=C[0],se=C[1],_e=k.properties()[V.value],ke=se.value;return typeof _e==typeof ke&&_e>=ke}],"filter-id->=":[Pi,[bi],function(k,C){var V=C[0],se=k.id(),_e=V.value;return typeof se==typeof _e&&se>=_e}],"filter-has":[Pi,[bi],function(k,C){var V=C[0];return V.value in k.properties()}],"filter-has-id":[Pi,[],function(k){return k.id()!==null&&k.id()!==void 0}],"filter-type-in":[Pi,[Ws(fo)],function(k,C){var V=C[0];return V.value.indexOf(k.geometryType())>=0}],"filter-id-in":[Pi,[Ws(bi)],function(k,C){var V=C[0];return V.value.indexOf(k.id())>=0}],"filter-in-small":[Pi,[fo,Ws(bi)],function(k,C){var V=C[0],se=C[1];return se.value.indexOf(k.properties()[V.value])>=0}],"filter-in-large":[Pi,[fo,Ws(bi)],function(k,C){var V=C[0],se=C[1];return os(k.properties()[V.value],se.value,0,se.value.length-1)}],all:{type:Pi,overloads:[[[Pi,Pi],function(k,C){var V=C[0],se=C[1];return V.evaluate(k)&&se.evaluate(k)}],[As(Pi),function(k,C){for(var V=0,se=C;V-1}function fi(k){return!!k.expression&&k.expression.interpolated}function ao(k){return k instanceof Number?"number":k instanceof String?"string":k instanceof Boolean?"boolean":Array.isArray(k)?"array":k===null?"null":typeof k}function gs(k){return typeof k=="object"&&k!==null&&!Array.isArray(k)}function Jo(k){return k}function Bl(k,C){var V=C.type==="color",se=k.stops&&typeof k.stops[0][0]=="object",_e=se||k.property!==void 0,ke=se||!_e,Ne=k.type||(fi(C)?"exponential":"interval");if(V&&(k=ds({},k),k.stops&&(k.stops=k.stops.map(function(ni){return[ni[0],ns.parse(ni[1])]})),k.default?k.default=ns.parse(k.default):k.default=ns.parse(C.default)),k.colorSpace&&k.colorSpace!=="rgb"&&!Lf[k.colorSpace])throw new Error("Unknown color space: "+k.colorSpace);var it,kt,Ft;if(Ne==="exponential")it=ql;else if(Ne==="interval")it=cc;else if(Ne==="categorical"){it=Vl,kt=Object.create(null);for(var Gt=0,hr=k.stops;Gt=k.stops[se-1][0])return k.stops[se-1][1];var _e=Tu(k.stops.map(function(ke){return ke[0]}),V);return k.stops[_e][1]}function ql(k,C,V){var se=k.base!==void 0?k.base:1;if(ao(V)!=="number")return jl(k.default,C.default);var _e=k.stops.length;if(_e===1||V<=k.stops[0][0])return k.stops[0][1];if(V>=k.stops[_e-1][0])return k.stops[_e-1][1];var ke=Tu(k.stops.map(function(hr){return hr[0]}),V),Ne=ol(V,se,k.stops[ke][0],k.stops[ke+1][0]),it=k.stops[ke][1],kt=k.stops[ke+1][1],Ft=ec[C.type]||Jo;if(k.colorSpace&&k.colorSpace!=="rgb"){var Gt=Lf[k.colorSpace];Ft=function(hr,Dr){return Gt.reverse(Gt.interpolate(Gt.forward(hr),Gt.forward(Dr),Ne))}}return typeof it.evaluate=="function"?{evaluate:function(){for(var Dr=[],Ir=arguments.length;Ir--;)Dr[Ir]=arguments[Ir];var Xr=it.evaluate.apply(void 0,Dr),ba=kt.evaluate.apply(void 0,Dr);if(!(Xr===void 0||ba===void 0))return Ft(Xr,ba,Ne)}}:Ft(it,kt,Ne)}function Vu(k,C,V){return C.type==="color"?V=ns.parse(V):C.type==="formatted"?V=ml.fromString(V.toString()):C.type==="resolvedImage"?V=fl.fromString(V.toString()):ao(V)!==C.type&&(C.type!=="enum"||!C.values[V])&&(V=void 0),jl(V,k.default,C.default)}function ol(k,C,V,se){var _e=se-V,ke=k-V;return _e===0?0:C===1?ke/_e:(Math.pow(C,ke)-1)/(Math.pow(C,_e)-1)}var rc=function(C,V){this.expression=C,this._warningHistory={},this._evaluator=new is,this._defaultValue=V?Se(V):null,this._enumValues=V&&V.type==="enum"?V.values:null};rc.prototype.evaluateWithoutErrorHandling=function(C,V,se,_e,ke,Ne){return this._evaluator.globals=C,this._evaluator.feature=V,this._evaluator.featureState=se,this._evaluator.canonical=_e,this._evaluator.availableImages=ke||null,this._evaluator.formattedSection=Ne,this.expression.evaluate(this._evaluator)},rc.prototype.evaluate=function(C,V,se,_e,ke,Ne){this._evaluator.globals=C,this._evaluator.feature=V||null,this._evaluator.featureState=se||null,this._evaluator.canonical=_e,this._evaluator.availableImages=ke||null,this._evaluator.formattedSection=Ne||null;try{var it=this.expression.evaluate(this._evaluator);if(it==null||typeof it=="number"&&it!==it)return this._defaultValue;if(this._enumValues&&!(it in this._enumValues))throw new Cs("Expected value to be one of "+Object.keys(this._enumValues).map(function(kt){return JSON.stringify(kt)}).join(", ")+", but found "+JSON.stringify(it)+" instead.");return it}catch(kt){return this._warningHistory[kt.message]||(this._warningHistory[kt.message]=!0,typeof console<"u"&&console.warn(kt.message)),this._defaultValue}};function Vi(k){return Array.isArray(k)&&k.length>0&&typeof k[0]=="string"&&k[0]in Ki}function eo(k,C){var V=new $s(Ki,[],C?Te(C):void 0),se=V.parse(k,void 0,void 0,void 0,C&&C.type==="string"?{typeAnnotation:"coerce"}:void 0);return se?jo(new rc(se,C)):il(V.errors)}var qu=function(C,V){this.kind=C,this._styleExpression=V,this.isStateDependent=C!=="constant"&&!Fl(V.expression)};qu.prototype.evaluateWithoutErrorHandling=function(C,V,se,_e,ke,Ne){return this._styleExpression.evaluateWithoutErrorHandling(C,V,se,_e,ke,Ne)},qu.prototype.evaluate=function(C,V,se,_e,ke,Ne){return this._styleExpression.evaluate(C,V,se,_e,ke,Ne)};var Du=function(C,V,se,_e){this.kind=C,this.zoomStops=se,this._styleExpression=V,this.isStateDependent=C!=="camera"&&!Fl(V.expression),this.interpolationType=_e};Du.prototype.evaluateWithoutErrorHandling=function(C,V,se,_e,ke,Ne){return this._styleExpression.evaluateWithoutErrorHandling(C,V,se,_e,ke,Ne)},Du.prototype.evaluate=function(C,V,se,_e,ke,Ne){return this._styleExpression.evaluate(C,V,se,_e,ke,Ne)},Du.prototype.interpolationFactor=function(C,V,se){return this.interpolationType?xl.interpolationFactor(this.interpolationType,C,V,se):0};function wc(k,C){if(k=eo(k,C),k.result==="error")return k;var V=k.value.expression,se=xf(V);if(!se&&!Qs(C))return il([new Mo("","data expressions not supported")]);var _e=ru(V,["zoom"]);if(!_e&&!Ss(C))return il([new Mo("","zoom expressions not supported")]);var ke=ne(V);if(!ke&&!_e)return il([new Mo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(ke instanceof Mo)return il([ke]);if(ke instanceof xl&&!fi(C))return il([new Mo("",'"interpolate" expressions cannot be used with this property')]);if(!ke)return jo(se?new qu("constant",k.value):new qu("source",k.value));var Ne=ke instanceof xl?ke.interpolation:void 0;return jo(se?new Du("camera",k.value,ke.labels,Ne):new Du("composite",k.value,ke.labels,Ne))}var De=function(C,V){this._parameters=C,this._specification=V,ds(this,Bl(this._parameters,this._specification))};De.deserialize=function(C){return new De(C._parameters,C._specification)},De.serialize=function(C){return{_parameters:C._parameters,_specification:C._specification}};function I(k,C){if(gs(k))return new De(k,C);if(Vi(k)){var V=wc(k,C);if(V.result==="error")throw new Error(V.value.map(function(_e){return _e.key+": "+_e.message}).join(", "));return V.value}else{var se=k;return typeof k=="string"&&C.type==="color"&&(se=ns.parse(k)),{kind:"constant",evaluate:function(){return se}}}}function ne(k){var C=null;if(k instanceof Ru)C=ne(k.result);else if(k instanceof ou)for(var V=0,se=k.args;Vse.maximum?[new Jn(C,V,V+" is greater than the maximum value "+se.maximum)]:[]}function Ct(k){var C=k.valueSpec,V=Ui(k.value.type),se,_e={},ke,Ne,it=V!=="categorical"&&k.value.property===void 0,kt=!it,Ft=ao(k.value.stops)==="array"&&ao(k.value.stops[0])==="array"&&ao(k.value.stops[0][0])==="object",Gt=Ie({key:k.key,value:k.value,valueSpec:k.styleSpec.function,style:k.style,styleSpec:k.styleSpec,objectElementValidators:{stops:hr,default:Xr}});return V==="identity"&&it&&Gt.push(new Jn(k.key,k.value,'missing required property "property"')),V!=="identity"&&!k.value.stops&&Gt.push(new Jn(k.key,k.value,'missing required property "stops"')),V==="exponential"&&k.valueSpec.expression&&!fi(k.valueSpec)&&Gt.push(new Jn(k.key,k.value,"exponential functions not supported")),k.styleSpec.$version>=8&&(kt&&!Qs(k.valueSpec)?Gt.push(new Jn(k.key,k.value,"property functions not supported")):it&&!Ss(k.valueSpec)&&Gt.push(new Jn(k.key,k.value,"zoom functions not supported"))),(V==="categorical"||Ft)&&k.value.property===void 0&&Gt.push(new Jn(k.key,k.value,'"property" property is required')),Gt;function hr(ba){if(V==="identity")return[new Jn(ba.key,ba.value,'identity function may not have a "stops" property')];var Za=[],Ra=ba.value;return Za=Za.concat(ot({key:ba.key,value:Ra,valueSpec:ba.valueSpec,style:ba.style,styleSpec:ba.styleSpec,arrayElementValidator:Dr})),ao(Ra)==="array"&&Ra.length===0&&Za.push(new Jn(ba.key,Ra,"array must have at least one stop")),Za}function Dr(ba){var Za=[],Ra=ba.value,dn=ba.key;if(ao(Ra)!=="array")return[new Jn(dn,Ra,"array expected, "+ao(Ra)+" found")];if(Ra.length!==2)return[new Jn(dn,Ra,"array length 2 expected, length "+Ra.length+" found")];if(Ft){if(ao(Ra[0])!=="object")return[new Jn(dn,Ra,"object expected, "+ao(Ra[0])+" found")];if(Ra[0].zoom===void 0)return[new Jn(dn,Ra,"object stop key must have zoom")];if(Ra[0].value===void 0)return[new Jn(dn,Ra,"object stop key must have value")];if(Ne&&Ne>Ui(Ra[0].zoom))return[new Jn(dn,Ra[0].zoom,"stop zoom values must appear in ascending order")];Ui(Ra[0].zoom)!==Ne&&(Ne=Ui(Ra[0].zoom),ke=void 0,_e={}),Za=Za.concat(Ie({key:dn+"[0]",value:Ra[0],valueSpec:{zoom:{}},style:ba.style,styleSpec:ba.styleSpec,objectElementValidators:{zoom:yt,value:Ir}}))}else Za=Za.concat(Ir({key:dn+"[0]",value:Ra[0],valueSpec:{},style:ba.style,styleSpec:ba.styleSpec},Ra));return Vi(ms(Ra[1]))?Za.concat([new Jn(dn+"[1]",Ra[1],"expressions are not allowed in function stops.")]):Za.concat(No({key:dn+"[1]",value:Ra[1],valueSpec:C,style:ba.style,styleSpec:ba.styleSpec}))}function Ir(ba,Za){var Ra=ao(ba.value),dn=Ui(ba.value),$a=ba.value!==null?ba.value:Za;if(!se)se=Ra;else if(Ra!==se)return[new Jn(ba.key,$a,Ra+" stop domain type must match previous stop domain type "+se)];if(Ra!=="number"&&Ra!=="string"&&Ra!=="boolean")return[new Jn(ba.key,$a,"stop domain value must be a number, string, or boolean")];if(Ra!=="number"&&V!=="categorical"){var vn="number expected, "+Ra+" found";return Qs(C)&&V===void 0&&(vn+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Jn(ba.key,$a,vn)]}return V==="categorical"&&Ra==="number"&&(!isFinite(dn)||Math.floor(dn)!==dn)?[new Jn(ba.key,$a,"integer expected, found "+dn)]:V!=="categorical"&&Ra==="number"&&ke!==void 0&&dn=2&&k[1]!=="$id"&&k[1]!=="$type";case"in":return k.length>=3&&(typeof k[1]!="string"||Array.isArray(k[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return k.length!==3||Array.isArray(k[1])||Array.isArray(k[2]);case"any":case"all":for(var C=0,V=k.slice(1);CC?1:0}function lt(k){if(!Array.isArray(k))return!1;if(k[0]==="within")return!0;for(var C=1;C"||C==="<="||C===">="?gt(k[1],k[2],C):C==="any"?Et(k.slice(1)):C==="all"?["all"].concat(k.slice(1).map(Tt)):C==="none"?["all"].concat(k.slice(1).map(Tt).map(sr)):C==="in"?Yt(k[1],k.slice(2)):C==="!in"?sr(Yt(k[1],k.slice(2))):C==="has"?rr(k[1]):C==="!has"?sr(rr(k[1])):C==="within"?k:!0;return V}function gt(k,C,V){switch(k){case"$type":return["filter-type-"+V,C];case"$id":return["filter-id-"+V,C];default:return["filter-"+V,k,C]}}function Et(k){return["any"].concat(k.map(Tt))}function Yt(k,C){if(C.length===0)return!1;switch(k){case"$type":return["filter-type-in",["literal",C]];case"$id":return["filter-id-in",["literal",C]];default:return C.length>200&&!C.some(function(V){return typeof V!=typeof C[0]})?["filter-in-large",k,["literal",C.sort(at)]]:["filter-in-small",k,["literal",C]]}}function rr(k){switch(k){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",k]}}function sr(k){return["!",k]}function Sr(k){return Wr(ms(k.value))?Wt(ds({},k,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Nr(k)}function Nr(k){var C=k.value,V=k.key;if(ao(C)!=="array")return[new Jn(V,C,"array expected, "+ao(C)+" found")];var se=k.styleSpec,_e,ke=[];if(C.length<1)return[new Jn(V,C,"filter array must have at least 1 element")];switch(ke=ke.concat(Fr({key:V+"[0]",value:C[0],valueSpec:se.filter_operator,style:k.style,styleSpec:k.styleSpec})),Ui(C[0])){case"<":case"<=":case">":case">=":C.length>=2&&Ui(C[1])==="$type"&&ke.push(new Jn(V,C,'"$type" cannot be use with operator "'+C[0]+'"'));case"==":case"!=":C.length!==3&&ke.push(new Jn(V,C,'filter array for operator "'+C[0]+'" must have 3 elements'));case"in":case"!in":C.length>=2&&(_e=ao(C[1]),_e!=="string"&&ke.push(new Jn(V+"[1]",C[1],"string expected, "+_e+" found")));for(var Ne=2;Ne=Gt[Ir+0]&&se>=Gt[Ir+1])?(Ne[Dr]=!0,ke.push(Ft[Dr])):Ne[Dr]=!1}}},Ye.prototype._forEachCell=function(k,C,V,se,_e,ke,Ne,it){for(var kt=this._convertToCellCoord(k),Ft=this._convertToCellCoord(C),Gt=this._convertToCellCoord(V),hr=this._convertToCellCoord(se),Dr=kt;Dr<=Gt;Dr++)for(var Ir=Ft;Ir<=hr;Ir++){var Xr=this.d*Ir+Dr;if(!(it&&!it(this._convertFromCellCoord(Dr),this._convertFromCellCoord(Ir),this._convertFromCellCoord(Dr+1),this._convertFromCellCoord(Ir+1)))&&_e.call(this,k,C,V,se,Xr,ke,Ne,it))return}},Ye.prototype._convertFromCellCoord=function(k){return(k-this.padding)/this.scale},Ye.prototype._convertToCellCoord=function(k){return Math.max(0,Math.min(this.d-1,Math.floor(k*this.scale)+this.padding))},Ye.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var k=this.cells,C=Le+this.cells.length+1+1,V=0,se=0;se=0)){var hr=k[Gt];Ft[Gt]=xt[kt].shallow.indexOf(Gt)>=0?hr:Ar(hr,C)}k instanceof Error&&(Ft.message=k.message)}if(Ft.$name)throw new Error("$name property is reserved for worker serialization logic.");return kt!=="Object"&&(Ft.$name=kt),Ft}throw new Error("can't serialize object of type "+typeof k)}function Vr(k){if(k==null||typeof k=="boolean"||typeof k=="number"||typeof k=="string"||k instanceof Boolean||k instanceof Number||k instanceof String||k instanceof Date||k instanceof RegExp||$t(k)||Cr(k)||ArrayBuffer.isView(k)||k instanceof ut)return k;if(Array.isArray(k))return k.map(Vr);if(typeof k=="object"){var C=k.$name||"Object",V=xt[C],se=V.klass;if(!se)throw new Error("can't deserialize unregistered class "+C);if(se.deserialize)return se.deserialize(k);for(var _e=Object.create(se.prototype),ke=0,Ne=Object.keys(k);ke=0?kt:Vr(kt)}}return _e}throw new Error("can't deserialize object of type "+typeof k)}var Kr=function(){this.first=!0};Kr.prototype.update=function(C,V){var se=Math.floor(C);return this.first?(this.first=!1,this.lastIntegerZoom=se,this.lastIntegerZoomTime=0,this.lastZoom=C,this.lastFloorZoom=se,!0):(this.lastFloorZoom>se?(this.lastIntegerZoom=se+1,this.lastIntegerZoomTime=V):this.lastFloorZoom=128&&k<=255},Arabic:function(k){return k>=1536&&k<=1791},"Arabic Supplement":function(k){return k>=1872&&k<=1919},"Arabic Extended-A":function(k){return k>=2208&&k<=2303},"Hangul Jamo":function(k){return k>=4352&&k<=4607},"Unified Canadian Aboriginal Syllabics":function(k){return k>=5120&&k<=5759},Khmer:function(k){return k>=6016&&k<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(k){return k>=6320&&k<=6399},"General Punctuation":function(k){return k>=8192&&k<=8303},"Letterlike Symbols":function(k){return k>=8448&&k<=8527},"Number Forms":function(k){return k>=8528&&k<=8591},"Miscellaneous Technical":function(k){return k>=8960&&k<=9215},"Control Pictures":function(k){return k>=9216&&k<=9279},"Optical Character Recognition":function(k){return k>=9280&&k<=9311},"Enclosed Alphanumerics":function(k){return k>=9312&&k<=9471},"Geometric Shapes":function(k){return k>=9632&&k<=9727},"Miscellaneous Symbols":function(k){return k>=9728&&k<=9983},"Miscellaneous Symbols and Arrows":function(k){return k>=11008&&k<=11263},"CJK Radicals Supplement":function(k){return k>=11904&&k<=12031},"Kangxi Radicals":function(k){return k>=12032&&k<=12255},"Ideographic Description Characters":function(k){return k>=12272&&k<=12287},"CJK Symbols and Punctuation":function(k){return k>=12288&&k<=12351},Hiragana:function(k){return k>=12352&&k<=12447},Katakana:function(k){return k>=12448&&k<=12543},Bopomofo:function(k){return k>=12544&&k<=12591},"Hangul Compatibility Jamo":function(k){return k>=12592&&k<=12687},Kanbun:function(k){return k>=12688&&k<=12703},"Bopomofo Extended":function(k){return k>=12704&&k<=12735},"CJK Strokes":function(k){return k>=12736&&k<=12783},"Katakana Phonetic Extensions":function(k){return k>=12784&&k<=12799},"Enclosed CJK Letters and Months":function(k){return k>=12800&&k<=13055},"CJK Compatibility":function(k){return k>=13056&&k<=13311},"CJK Unified Ideographs Extension A":function(k){return k>=13312&&k<=19903},"Yijing Hexagram Symbols":function(k){return k>=19904&&k<=19967},"CJK Unified Ideographs":function(k){return k>=19968&&k<=40959},"Yi Syllables":function(k){return k>=40960&&k<=42127},"Yi Radicals":function(k){return k>=42128&&k<=42191},"Hangul Jamo Extended-A":function(k){return k>=43360&&k<=43391},"Hangul Syllables":function(k){return k>=44032&&k<=55215},"Hangul Jamo Extended-B":function(k){return k>=55216&&k<=55295},"Private Use Area":function(k){return k>=57344&&k<=63743},"CJK Compatibility Ideographs":function(k){return k>=63744&&k<=64255},"Arabic Presentation Forms-A":function(k){return k>=64336&&k<=65023},"Vertical Forms":function(k){return k>=65040&&k<=65055},"CJK Compatibility Forms":function(k){return k>=65072&&k<=65103},"Small Form Variants":function(k){return k>=65104&&k<=65135},"Arabic Presentation Forms-B":function(k){return k>=65136&&k<=65279},"Halfwidth and Fullwidth Forms":function(k){return k>=65280&&k<=65519}};function Ua(k){for(var C=0,V=k;C=65097&&k<=65103)||aa["CJK Compatibility Ideographs"](k)||aa["CJK Compatibility"](k)||aa["CJK Radicals Supplement"](k)||aa["CJK Strokes"](k)||aa["CJK Symbols and Punctuation"](k)&&!(k>=12296&&k<=12305)&&!(k>=12308&&k<=12319)&&k!==12336||aa["CJK Unified Ideographs Extension A"](k)||aa["CJK Unified Ideographs"](k)||aa["Enclosed CJK Letters and Months"](k)||aa["Hangul Compatibility Jamo"](k)||aa["Hangul Jamo Extended-A"](k)||aa["Hangul Jamo Extended-B"](k)||aa["Hangul Jamo"](k)||aa["Hangul Syllables"](k)||aa.Hiragana(k)||aa["Ideographic Description Characters"](k)||aa.Kanbun(k)||aa["Kangxi Radicals"](k)||aa["Katakana Phonetic Extensions"](k)||aa.Katakana(k)&&k!==12540||aa["Halfwidth and Fullwidth Forms"](k)&&k!==65288&&k!==65289&&k!==65293&&!(k>=65306&&k<=65310)&&k!==65339&&k!==65341&&k!==65343&&!(k>=65371&&k<=65503)&&k!==65507&&!(k>=65512&&k<=65519)||aa["Small Form Variants"](k)&&!(k>=65112&&k<=65118)&&!(k>=65123&&k<=65126)||aa["Unified Canadian Aboriginal Syllabics"](k)||aa["Unified Canadian Aboriginal Syllabics Extended"](k)||aa["Vertical Forms"](k)||aa["Yijing Hexagram Symbols"](k)||aa["Yi Syllables"](k)||aa["Yi Radicals"](k))}function Va(k){return!!(aa["Latin-1 Supplement"](k)&&(k===167||k===169||k===174||k===177||k===188||k===189||k===190||k===215||k===247)||aa["General Punctuation"](k)&&(k===8214||k===8224||k===8225||k===8240||k===8241||k===8251||k===8252||k===8258||k===8263||k===8264||k===8265||k===8273)||aa["Letterlike Symbols"](k)||aa["Number Forms"](k)||aa["Miscellaneous Technical"](k)&&(k>=8960&&k<=8967||k>=8972&&k<=8991||k>=8996&&k<=9e3||k===9003||k>=9085&&k<=9114||k>=9150&&k<=9165||k===9167||k>=9169&&k<=9179||k>=9186&&k<=9215)||aa["Control Pictures"](k)&&k!==9251||aa["Optical Character Recognition"](k)||aa["Enclosed Alphanumerics"](k)||aa["Geometric Shapes"](k)||aa["Miscellaneous Symbols"](k)&&!(k>=9754&&k<=9759)||aa["Miscellaneous Symbols and Arrows"](k)&&(k>=11026&&k<=11055||k>=11088&&k<=11097||k>=11192&&k<=11243)||aa["CJK Symbols and Punctuation"](k)||aa.Katakana(k)||aa["Private Use Area"](k)||aa["CJK Compatibility Forms"](k)||aa["Small Form Variants"](k)||aa["Halfwidth and Fullwidth Forms"](k)||k===8734||k===8756||k===8757||k>=9984&&k<=10087||k>=10102&&k<=10131||k===65532||k===65533)}function Ma(k){return!(Ba(k)||Va(k))}function mn(k){return aa.Arabic(k)||aa["Arabic Supplement"](k)||aa["Arabic Extended-A"](k)||aa["Arabic Presentation Forms-A"](k)||aa["Arabic Presentation Forms-B"](k)}function Wn(k){return k>=1424&&k<=2303||aa["Arabic Presentation Forms-A"](k)||aa["Arabic Presentation Forms-B"](k)}function jn(k,C){return!(!C&&Wn(k)||k>=2304&&k<=3583||k>=3840&&k<=4255||aa.Khmer(k))}function Zn(k){for(var C=0,V=k;C-1&&(wi=_i.error),Po&&Po(k)};function sl(){Ms.fire(new kr("pluginStateChange",{pluginStatus:wi,pluginURL:Ji}))}var Ms=new Pr,Kn=function(){return wi},go=function(k){return k({pluginStatus:wi,pluginURL:Ji}),Ms.on("pluginStateChange",k),k},Do=function(k,C,V){if(V===void 0&&(V=!1),wi===_i.deferred||wi===_i.loading||wi===_i.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ji=we.resolveURL(k),wi=_i.deferred,Po=C,sl(),V||Es()},Es=function(){if(wi!==_i.deferred||!Ji)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");wi=_i.loading,sl(),Ji&&na({url:Ji},function(k){k?Vo(k):(wi=_i.loaded,sl())})},hs={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return wi===_i.loaded||hs.applyArabicShaping!=null},isLoading:function(){return wi===_i.loading},setState:function(C){wi=C.pluginStatus,Ji=C.pluginURL},isParsed:function(){return hs.applyArabicShaping!=null&&hs.processBidirectionalText!=null&&hs.processStyledBidirectionalText!=null},getPluginURL:function(){return Ji}},Hl=function(){!hs.isLoading()&&!hs.isLoaded()&&Kn()==="deferred"&&Es()},Qo=function(C,V){this.zoom=C,V?(this.now=V.now,this.fadeDuration=V.fadeDuration,this.zoomHistory=V.zoomHistory,this.transition=V.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Kr,this.transition={})};Qo.prototype.isSupportedScript=function(C){return hi(C,hs.isLoaded())},Qo.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Qo.prototype.getCrossfadeParameters=function(){var C=this.zoom,V=C-Math.floor(C),se=this.crossFadingFactor();return C>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:V+(1-V)*se}:{fromScale:.5,toScale:1,t:1-(1-se)*V}};var _s=function(C,V){this.property=C,this.value=V,this.expression=I(V===void 0?C.specification.default:V,C.specification)};_s.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},_s.prototype.possiblyEvaluate=function(C,V,se){return this.property.possiblyEvaluate(this,C,V,se)};var gu=function(C){this.property=C,this.value=new _s(C,void 0)};gu.prototype.transitioned=function(C,V){return new cr(this.property,this.value,V,_({},C.transition,this.transition),C.now)},gu.prototype.untransitioned=function(){return new cr(this.property,this.value,null,{},0)};var el=function(C){this._properties=C,this._values=Object.create(C.defaultTransitionablePropertyValues)};el.prototype.getValue=function(C){return O(this._values[C].value.value)},el.prototype.setValue=function(C,V){this._values.hasOwnProperty(C)||(this._values[C]=new gu(this._values[C].property)),this._values[C].value=new _s(this._values[C].property,V===null?void 0:O(V))},el.prototype.getTransition=function(C){return O(this._values[C].transition)},el.prototype.setTransition=function(C,V){this._values.hasOwnProperty(C)||(this._values[C]=new gu(this._values[C].property)),this._values[C].transition=O(V)||void 0},el.prototype.serialize=function(){for(var C={},V=0,se=Object.keys(this._values);Vthis.end)return this.prior=null,ke;if(this.value.isDataDriven())return this.prior=null,ke;if(_eNe.zoomHistory.lastIntegerZoom?{from:se,to:_e}:{from:ke,to:_e}},C.prototype.interpolate=function(se){return se},C}(Na),Un=function(C){this.specification=C};Un.prototype.possiblyEvaluate=function(C,V,se,_e){if(C.value!==void 0)if(C.expression.kind==="constant"){var ke=C.expression.evaluate(V,null,{},se,_e);return this._calculate(ke,ke,ke,V)}else return this._calculate(C.expression.evaluate(new Qo(Math.floor(V.zoom-1),V)),C.expression.evaluate(new Qo(Math.floor(V.zoom),V)),C.expression.evaluate(new Qo(Math.floor(V.zoom+1),V)),V)},Un.prototype._calculate=function(C,V,se,_e){var ke=_e.zoom;return ke>_e.zoomHistory.lastIntegerZoom?{from:C,to:V}:{from:se,to:V}},Un.prototype.interpolate=function(C){return C};var Gn=function(C){this.specification=C};Gn.prototype.possiblyEvaluate=function(C,V,se,_e){return!!C.expression.evaluate(V,null,{},se,_e)},Gn.prototype.interpolate=function(){return!1};var ti=function(C){this.properties=C,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var V in C){var se=C[V];se.specification.overridable&&this.overridableProperties.push(V);var _e=this.defaultPropertyValues[V]=new _s(se,void 0),ke=this.defaultTransitionablePropertyValues[V]=new gu(se);this.defaultTransitioningPropertyValues[V]=ke.untransitioned(),this.defaultPossiblyEvaluatedValues[V]=_e.possiblyEvaluate({})}};zt("DataDrivenProperty",Na),zt("DataConstantProperty",Da),zt("CrossFadedDataDrivenProperty",Hn),zt("CrossFadedProperty",Un),zt("ColorRampProperty",Gn);var Wi="-transition",Ti=function(k){function C(V,se){if(k.call(this),this.id=V.id,this.type=V.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},V.type!=="custom"&&(V=V,this.metadata=V.metadata,this.minzoom=V.minzoom,this.maxzoom=V.maxzoom,V.type!=="background"&&(this.source=V.source,this.sourceLayer=V["source-layer"],this.filter=V.filter),se.layout&&(this._unevaluatedLayout=new xa(se.layout)),se.paint)){this._transitionablePaint=new el(se.paint);for(var _e in V.paint)this.setPaintProperty(_e,V.paint[_e],{validate:!1});for(var ke in V.layout)this.setLayoutProperty(ke,V.layout[ke],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new In(se.paint)}}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},C.prototype.getLayoutProperty=function(se){return se==="visibility"?this.visibility:this._unevaluatedLayout.getValue(se)},C.prototype.setLayoutProperty=function(se,_e,ke){if(ke===void 0&&(ke={}),_e!=null){var Ne="layers."+this.id+".layout."+se;if(this._validate(Al,Ne,se,_e,ke))return}if(se==="visibility"){this.visibility=_e;return}this._unevaluatedLayout.setValue(se,_e)},C.prototype.getPaintProperty=function(se){return z(se,Wi)?this._transitionablePaint.getTransition(se.slice(0,-Wi.length)):this._transitionablePaint.getValue(se)},C.prototype.setPaintProperty=function(se,_e,ke){if(ke===void 0&&(ke={}),_e!=null){var Ne="layers."+this.id+".paint."+se;if(this._validate(vl,Ne,se,_e,ke))return!1}if(z(se,Wi))return this._transitionablePaint.setTransition(se.slice(0,-Wi.length),_e||void 0),!1;var it=this._transitionablePaint._values[se],kt=it.property.specification["property-type"]==="cross-faded-data-driven",Ft=it.value.isDataDriven(),Gt=it.value;this._transitionablePaint.setValue(se,_e),this._handleSpecialPaintPropertyUpdate(se);var hr=this._transitionablePaint._values[se].value,Dr=hr.isDataDriven();return Dr||Ft||kt||this._handleOverridablePaintPropertyUpdate(se,Gt,hr)},C.prototype._handleSpecialPaintPropertyUpdate=function(se){},C.prototype._handleOverridablePaintPropertyUpdate=function(se,_e,ke){return!1},C.prototype.isHidden=function(se){return this.minzoom&&se=this.maxzoom?!0:this.visibility==="none"},C.prototype.updateTransitions=function(se){this._transitioningPaint=this._transitionablePaint.transitioned(se,this._transitioningPaint)},C.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},C.prototype.recalculate=function(se,_e){se.getCrossfadeParameters&&(this._crossfadeParameters=se.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(se,void 0,_e)),this.paint=this._transitioningPaint.possiblyEvaluate(se,void 0,_e)},C.prototype.serialize=function(){var se={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&&(se.layout=se.layout||{},se.layout.visibility=this.visibility),B(se,function(_e,ke){return _e!==void 0&&!(ke==="layout"&&!Object.keys(_e).length)&&!(ke==="paint"&&!Object.keys(_e).length)})},C.prototype._validate=function(se,_e,ke,Ne,it){return it===void 0&&(it={}),it&&it.validate===!1?!1:pu(this,se.call(xo,{key:_e,layerType:this.type,objectKey:ke,value:Ne,styleSpec:Qa,style:{glyphs:!0,sprite:!0}}))},C.prototype.is3D=function(){return!1},C.prototype.isTileClipped=function(){return!1},C.prototype.hasOffscreenPass=function(){return!1},C.prototype.resize=function(){},C.prototype.isStateDependent=function(){for(var se in this.paint._values){var _e=this.paint.get(se);if(!(!(_e instanceof cn)||!Qs(_e.property.specification))&&(_e.value.kind==="source"||_e.value.kind==="composite")&&_e.value.isStateDependent)return!0}return!1},C}(Pr),si={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Fn=function(C,V){this._structArray=C,this._pos1=V*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},qa=128,wn=5,Tn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};Tn.serialize=function(C,V){return C._trim(),V&&(C.isTransferred=!0,V.push(C.arrayBuffer)),{length:C.length,arrayBuffer:C.arrayBuffer}},Tn.deserialize=function(C){var V=Object.create(this.prototype);return V.arrayBuffer=C.arrayBuffer,V.length=C.length,V.capacity=C.arrayBuffer.byteLength/V.bytesPerElement,V._refreshViews(),V},Tn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Tn.prototype.clear=function(){this.length=0},Tn.prototype.resize=function(C){this.reserve(C),this.length=C},Tn.prototype.reserve=function(C){if(C>this.capacity){this.capacity=Math.max(C,Math.floor(this.capacity*wn),qa),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var V=this.uint8;this._refreshViews(),V&&this.uint8.set(V)}},Tn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function Ln(k,C){C===void 0&&(C=1);var V=0,se=0,_e=k.map(function(Ne){var it=Pn(Ne.type),kt=V=Ri(V,Math.max(C,it)),Ft=Ne.components||1;return se=Math.max(se,it),V+=it*Ft,{name:Ne.name,type:Ne.type,components:Ft,offset:kt}}),ke=Ri(V,Math.max(se,C));return{members:_e,size:ke,alignment:C}}function Pn(k){return si[k].BYTES_PER_ELEMENT}function Ri(k,C){return Math.ceil(k/C)*C}var Xn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e){var ke=this.length;return this.resize(ke+1),this.emplace(ke,se,_e)},C.prototype.emplace=function(se,_e,ke){var Ne=se*2;return this.int16[Ne+0]=_e,this.int16[Ne+1]=ke,se},C}(Tn);Xn.prototype.bytesPerElement=4,zt("StructArrayLayout2i4",Xn);var $i=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne){var it=this.length;return this.resize(it+1),this.emplace(it,se,_e,ke,Ne)},C.prototype.emplace=function(se,_e,ke,Ne,it){var kt=se*4;return this.int16[kt+0]=_e,this.int16[kt+1]=ke,this.int16[kt+2]=Ne,this.int16[kt+3]=it,se},C}(Tn);$i.prototype.bytesPerElement=8,zt("StructArrayLayout4i8",$i);var Cn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt){var Ft=this.length;return this.resize(Ft+1),this.emplace(Ft,se,_e,ke,Ne,it,kt)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft){var Gt=se*6;return this.int16[Gt+0]=_e,this.int16[Gt+1]=ke,this.int16[Gt+2]=Ne,this.int16[Gt+3]=it,this.int16[Gt+4]=kt,this.int16[Gt+5]=Ft,se},C}(Tn);Cn.prototype.bytesPerElement=12,zt("StructArrayLayout2i4i12",Cn);var Mn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt){var Ft=this.length;return this.resize(Ft+1),this.emplace(Ft,se,_e,ke,Ne,it,kt)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft){var Gt=se*4,hr=se*8;return this.int16[Gt+0]=_e,this.int16[Gt+1]=ke,this.uint8[hr+4]=Ne,this.uint8[hr+5]=it,this.uint8[hr+6]=kt,this.uint8[hr+7]=Ft,se},C}(Tn);Mn.prototype.bytesPerElement=8,zt("StructArrayLayout2i4ub8",Mn);var Si=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e){var ke=this.length;return this.resize(ke+1),this.emplace(ke,se,_e)},C.prototype.emplace=function(se,_e,ke){var Ne=se*2;return this.float32[Ne+0]=_e,this.float32[Ne+1]=ke,se},C}(Tn);Si.prototype.bytesPerElement=8,zt("StructArrayLayout2f8",Si);var yn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr){var Ir=this.length;return this.resize(Ir+1),this.emplace(Ir,se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir){var Xr=se*10;return this.uint16[Xr+0]=_e,this.uint16[Xr+1]=ke,this.uint16[Xr+2]=Ne,this.uint16[Xr+3]=it,this.uint16[Xr+4]=kt,this.uint16[Xr+5]=Ft,this.uint16[Xr+6]=Gt,this.uint16[Xr+7]=hr,this.uint16[Xr+8]=Dr,this.uint16[Xr+9]=Ir,se},C}(Tn);yn.prototype.bytesPerElement=20,zt("StructArrayLayout10ui20",yn);var gi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr){var ba=this.length;return this.resize(ba+1),this.emplace(ba,se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba){var Za=se*12;return this.int16[Za+0]=_e,this.int16[Za+1]=ke,this.int16[Za+2]=Ne,this.int16[Za+3]=it,this.uint16[Za+4]=kt,this.uint16[Za+5]=Ft,this.uint16[Za+6]=Gt,this.uint16[Za+7]=hr,this.int16[Za+8]=Dr,this.int16[Za+9]=Ir,this.int16[Za+10]=Xr,this.int16[Za+11]=ba,se},C}(Tn);gi.prototype.bytesPerElement=24,zt("StructArrayLayout4i4ui4i24",gi);var ri=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke){var Ne=this.length;return this.resize(Ne+1),this.emplace(Ne,se,_e,ke)},C.prototype.emplace=function(se,_e,ke,Ne){var it=se*3;return this.float32[it+0]=_e,this.float32[it+1]=ke,this.float32[it+2]=Ne,se},C}(Tn);ri.prototype.bytesPerElement=12,zt("StructArrayLayout3f12",ri);var ro=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var _e=this.length;return this.resize(_e+1),this.emplace(_e,se)},C.prototype.emplace=function(se,_e){var ke=se*1;return this.uint32[ke+0]=_e,se},C}(Tn);ro.prototype.bytesPerElement=4,zt("StructArrayLayout1ul4",ro);var es=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.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)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr){var Dr=this.length;return this.resize(Dr+1),this.emplace(Dr,se,_e,ke,Ne,it,kt,Ft,Gt,hr)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr){var Ir=se*10,Xr=se*5;return this.int16[Ir+0]=_e,this.int16[Ir+1]=ke,this.int16[Ir+2]=Ne,this.int16[Ir+3]=it,this.int16[Ir+4]=kt,this.int16[Ir+5]=Ft,this.uint32[Xr+3]=Gt,this.uint16[Ir+8]=hr,this.uint16[Ir+9]=Dr,se},C}(Tn);es.prototype.bytesPerElement=20,zt("StructArrayLayout6i1ul2ui20",es);var Fi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt){var Ft=this.length;return this.resize(Ft+1),this.emplace(Ft,se,_e,ke,Ne,it,kt)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft){var Gt=se*6;return this.int16[Gt+0]=_e,this.int16[Gt+1]=ke,this.int16[Gt+2]=Ne,this.int16[Gt+3]=it,this.int16[Gt+4]=kt,this.int16[Gt+5]=Ft,se},C}(Tn);Fi.prototype.bytesPerElement=12,zt("StructArrayLayout2i2i2i12",Fi);var no=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it){var kt=this.length;return this.resize(kt+1),this.emplace(kt,se,_e,ke,Ne,it)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt){var Ft=se*4,Gt=se*8;return this.float32[Ft+0]=_e,this.float32[Ft+1]=ke,this.float32[Ft+2]=Ne,this.int16[Gt+6]=it,this.int16[Gt+7]=kt,se},C}(Tn);no.prototype.bytesPerElement=16,zt("StructArrayLayout2f1f2i16",no);var oi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne){var it=this.length;return this.resize(it+1),this.emplace(it,se,_e,ke,Ne)},C.prototype.emplace=function(se,_e,ke,Ne,it){var kt=se*12,Ft=se*3;return this.uint8[kt+0]=_e,this.uint8[kt+1]=ke,this.float32[Ft+1]=Ne,this.float32[Ft+2]=it,se},C}(Tn);oi.prototype.bytesPerElement=12,zt("StructArrayLayout2ub2f12",oi);var Xo=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke){var Ne=this.length;return this.resize(Ne+1),this.emplace(Ne,se,_e,ke)},C.prototype.emplace=function(se,_e,ke,Ne){var it=se*3;return this.uint16[it+0]=_e,this.uint16[it+1]=ke,this.uint16[it+2]=Ne,se},C}(Tn);Xo.prototype.bytesPerElement=6,zt("StructArrayLayout3ui6",Xo);var ys=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.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)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a){var vn=this.length;return this.resize(vn+1),this.emplace(vn,se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a,vn){var bn=se*24,Dn=se*12,ui=se*48;return this.int16[bn+0]=_e,this.int16[bn+1]=ke,this.uint16[bn+2]=Ne,this.uint16[bn+3]=it,this.uint32[Dn+2]=kt,this.uint32[Dn+3]=Ft,this.uint32[Dn+4]=Gt,this.uint16[bn+10]=hr,this.uint16[bn+11]=Dr,this.uint16[bn+12]=Ir,this.float32[Dn+7]=Xr,this.float32[Dn+8]=ba,this.uint8[ui+36]=Za,this.uint8[ui+37]=Ra,this.uint8[ui+38]=dn,this.uint32[Dn+10]=$a,this.int16[bn+22]=vn,se},C}(Tn);ys.prototype.bytesPerElement=48,zt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ys);var xs=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.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)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a,vn,bn,Dn,ui,ni,Zi,Mi,Bi,Ho,Xi,Qi){var cs=this.length;return this.resize(cs+1),this.emplace(cs,se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a,vn,bn,Dn,ui,ni,Zi,Mi,Bi,Ho,Xi,Qi)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a,vn,bn,Dn,ui,ni,Zi,Mi,Bi,Ho,Xi,Qi,cs){var Oo=se*34,rl=se*17;return this.int16[Oo+0]=_e,this.int16[Oo+1]=ke,this.int16[Oo+2]=Ne,this.int16[Oo+3]=it,this.int16[Oo+4]=kt,this.int16[Oo+5]=Ft,this.int16[Oo+6]=Gt,this.int16[Oo+7]=hr,this.uint16[Oo+8]=Dr,this.uint16[Oo+9]=Ir,this.uint16[Oo+10]=Xr,this.uint16[Oo+11]=ba,this.uint16[Oo+12]=Za,this.uint16[Oo+13]=Ra,this.uint16[Oo+14]=dn,this.uint16[Oo+15]=$a,this.uint16[Oo+16]=vn,this.uint16[Oo+17]=bn,this.uint16[Oo+18]=Dn,this.uint16[Oo+19]=ui,this.uint16[Oo+20]=ni,this.uint16[Oo+21]=Zi,this.uint16[Oo+22]=Mi,this.uint32[rl+12]=Bi,this.float32[rl+13]=Ho,this.float32[rl+14]=Xi,this.float32[rl+15]=Qi,this.float32[rl+16]=cs,se},C}(Tn);xs.prototype.bytesPerElement=68,zt("StructArrayLayout8i15ui1ul4f68",xs);var Xs=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var _e=this.length;return this.resize(_e+1),this.emplace(_e,se)},C.prototype.emplace=function(se,_e){var ke=se*1;return this.float32[ke+0]=_e,se},C}(Tn);Xs.prototype.bytesPerElement=4,zt("StructArrayLayout1f4",Xs);var Ps=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke){var Ne=this.length;return this.resize(Ne+1),this.emplace(Ne,se,_e,ke)},C.prototype.emplace=function(se,_e,ke,Ne){var it=se*3;return this.int16[it+0]=_e,this.int16[it+1]=ke,this.int16[it+2]=Ne,se},C}(Tn);Ps.prototype.bytesPerElement=6,zt("StructArrayLayout3i6",Ps);var Mu=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke){var Ne=this.length;return this.resize(Ne+1),this.emplace(Ne,se,_e,ke)},C.prototype.emplace=function(se,_e,ke,Ne){var it=se*2,kt=se*4;return this.uint32[it+0]=_e,this.uint16[kt+2]=ke,this.uint16[kt+3]=Ne,se},C}(Tn);Mu.prototype.bytesPerElement=8,zt("StructArrayLayout1ul2ui8",Mu);var dl=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e){var ke=this.length;return this.resize(ke+1),this.emplace(ke,se,_e)},C.prototype.emplace=function(se,_e,ke){var Ne=se*2;return this.uint16[Ne+0]=_e,this.uint16[Ne+1]=ke,se},C}(Tn);dl.prototype.bytesPerElement=4,zt("StructArrayLayout2ui4",dl);var Eu=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var _e=this.length;return this.resize(_e+1),this.emplace(_e,se)},C.prototype.emplace=function(se,_e){var ke=se*1;return this.uint16[ke+0]=_e,se},C}(Tn);Eu.prototype.bytesPerElement=2,zt("StructArrayLayout1ui2",Eu);var ac=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne){var it=this.length;return this.resize(it+1),this.emplace(it,se,_e,ke,Ne)},C.prototype.emplace=function(se,_e,ke,Ne,it){var kt=se*4;return this.float32[kt+0]=_e,this.float32[kt+1]=ke,this.float32[kt+2]=Ne,this.float32[kt+3]=it,se},C}(Tn);ac.prototype.bytesPerElement=16,zt("StructArrayLayout4f16",ac);var Lc=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var V={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 V.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},V.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},V.x1.get=function(){return this._structArray.int16[this._pos2+2]},V.y1.get=function(){return this._structArray.int16[this._pos2+3]},V.x2.get=function(){return this._structArray.int16[this._pos2+4]},V.y2.get=function(){return this._structArray.int16[this._pos2+5]},V.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},V.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},V.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},V.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(C.prototype,V),C}(Fn);Lc.prototype.size=20;var Pf=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new Lc(this,se)},C}(es);zt("CollisionBoxArray",Pf);var su=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var V={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 V.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},V.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},V.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},V.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},V.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},V.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},V.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},V.segment.get=function(){return this._structArray.uint16[this._pos2+10]},V.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},V.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},V.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},V.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},V.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},V.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},V.placedOrientation.set=function(se){this._structArray.uint8[this._pos1+37]=se},V.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},V.hidden.set=function(se){this._structArray.uint8[this._pos1+38]=se},V.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},V.crossTileID.set=function(se){this._structArray.uint32[this._pos4+10]=se},V.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(C.prototype,V),C}(Fn);su.prototype.size=48;var zu=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new su(this,se)},C}(ys);zt("PlacedSymbolArray",zu);var Fo=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var V={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 V.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},V.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},V.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},V.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},V.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},V.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},V.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},V.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},V.key.get=function(){return this._structArray.uint16[this._pos2+8]},V.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},V.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},V.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},V.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},V.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},V.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},V.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},V.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},V.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},V.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},V.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},V.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},V.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},V.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},V.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},V.crossTileID.set=function(se){this._structArray.uint32[this._pos4+12]=se},V.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},V.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},V.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},V.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(C.prototype,V),C}(Fn);Fo.prototype.size=68;var nc=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new Fo(this,se)},C}(xs);zt("SymbolInstanceArray",nc);var ll=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getoffsetX=function(se){return this.float32[se*1+0]},C}(Xs);zt("GlyphOffsetArray",ll);var Sl=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getx=function(se){return this.int16[se*3+0]},C.prototype.gety=function(se){return this.int16[se*3+1]},C.prototype.gettileUnitDistanceFromAnchor=function(se){return this.int16[se*3+2]},C}(Ps);zt("SymbolLineVertexArray",Sl);var qc=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var V={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return V.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},V.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},V.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(C.prototype,V),C}(Fn);qc.prototype.size=8;var Hc=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new qc(this,se)},C}(Mu);zt("FeatureIndexArray",Hc);var ss=Ln([{name:"a_pos",components:2,type:"Int16"}],4),js=ss.members,ls=function(C){C===void 0&&(C=[]),this.segments=C};ls.prototype.prepareSegment=function(C,V,se,_e){var ke=this.segments[this.segments.length-1];return C>ls.MAX_VERTEX_ARRAY_LENGTH&&U("Max vertices per segment is "+ls.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+C),(!ke||ke.vertexLength+C>ls.MAX_VERTEX_ARRAY_LENGTH||ke.sortKey!==_e)&&(ke={vertexOffset:V.length,primitiveOffset:se.length,vertexLength:0,primitiveLength:0},_e!==void 0&&(ke.sortKey=_e),this.segments.push(ke)),ke},ls.prototype.get=function(){return this.segments},ls.prototype.destroy=function(){for(var C=0,V=this.segments;C>>16)*kt&65535)<<16)&4294967295,Gt=Gt<<15|Gt>>>17,Gt=(Gt&65535)*Ft+(((Gt>>>16)*Ft&65535)<<16)&4294967295,Ne^=Gt,Ne=Ne<<13|Ne>>>19,it=(Ne&65535)*5+(((Ne>>>16)*5&65535)<<16)&4294967295,Ne=(it&65535)+27492+(((it>>>16)+58964&65535)<<16);switch(Gt=0,_e){case 3:Gt^=(V.charCodeAt(hr+2)&255)<<16;case 2:Gt^=(V.charCodeAt(hr+1)&255)<<8;case 1:Gt^=V.charCodeAt(hr)&255,Gt=(Gt&65535)*kt+(((Gt>>>16)*kt&65535)<<16)&4294967295,Gt=Gt<<15|Gt>>>17,Gt=(Gt&65535)*Ft+(((Gt>>>16)*Ft&65535)<<16)&4294967295,Ne^=Gt}return Ne^=V.length,Ne^=Ne>>>16,Ne=(Ne&65535)*2246822507+(((Ne>>>16)*2246822507&65535)<<16)&4294967295,Ne^=Ne>>>13,Ne=(Ne&65535)*3266489909+(((Ne>>>16)*3266489909&65535)<<16)&4294967295,Ne^=Ne>>>16,Ne>>>0}k.exports=C}),te=t(function(k){function C(V,se){for(var _e=V.length,ke=se^_e,Ne=0,it;_e>=4;)it=V.charCodeAt(Ne)&255|(V.charCodeAt(++Ne)&255)<<8|(V.charCodeAt(++Ne)&255)<<16|(V.charCodeAt(++Ne)&255)<<24,it=(it&65535)*1540483477+(((it>>>16)*1540483477&65535)<<16),it^=it>>>24,it=(it&65535)*1540483477+(((it>>>16)*1540483477&65535)<<16),ke=(ke&65535)*1540483477+(((ke>>>16)*1540483477&65535)<<16)^it,_e-=4,++Ne;switch(_e){case 3:ke^=(V.charCodeAt(Ne+2)&255)<<16;case 2:ke^=(V.charCodeAt(Ne+1)&255)<<8;case 1:ke^=V.charCodeAt(Ne)&255,ke=(ke&65535)*1540483477+(((ke>>>16)*1540483477&65535)<<16)}return ke^=ke>>>13,ke=(ke&65535)*1540483477+(((ke>>>16)*1540483477&65535)<<16),ke^=ke>>>15,ke>>>0}k.exports=C}),me=de,Ue=de,tt=te;me.murmur3=Ue,me.murmur2=tt;var ft=function(){this.ids=[],this.positions=[],this.indexed=!1};ft.prototype.add=function(C,V,se,_e){this.ids.push(bt(C)),this.positions.push(V,se,_e)},ft.prototype.getPositions=function(C){for(var V=bt(C),se=0,_e=this.ids.length-1;se<_e;){var ke=se+_e>>1;this.ids[ke]>=V?_e=ke:se=ke+1}for(var Ne=[];this.ids[se]===V;){var it=this.positions[3*se],kt=this.positions[3*se+1],Ft=this.positions[3*se+2];Ne.push({index:it,start:kt,end:Ft}),se++}return Ne},ft.serialize=function(C,V){var se=new Float64Array(C.ids),_e=new Uint32Array(C.positions);return It(se,_e,0,se.length-1),V&&V.push(se.buffer,_e.buffer),{ids:se,positions:_e}},ft.deserialize=function(C){var V=new ft;return V.ids=C.ids,V.positions=C.positions,V.indexed=!0,V};var st=Math.pow(2,53)-1;function bt(k){var C=+k;return!isNaN(C)&&C<=st?C:me(String(k))}function It(k,C,V,se){for(;V>1],ke=V-1,Ne=se+1;;){do ke++;while(k[ke]<_e);do Ne--;while(k[Ne]>_e);if(ke>=Ne)break;Jt(k,ke,Ne),Jt(C,3*ke,3*Ne),Jt(C,3*ke+1,3*Ne+1),Jt(C,3*ke+2,3*Ne+2)}Ne-VNe.x+1||ktNe.y+1)&&U("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return V}function Ds(k,C){return{type:k.type,id:k.id,properties:k.properties,geometry:C?us(k):[]}}function rs(k,C,V,se,_e){k.emplaceBack(C*2+(se+1)/2,V*2+(_e+1)/2)}var ul=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(V){return V.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new Xn,this.indexArray=new Xo,this.segments=new ls,this.programConfigurations=new fn(C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter(function(V){return V.isStateDependent()}).map(function(V){return V.id})};ul.prototype.populate=function(C,V,se){var _e=this.layers[0],ke=[],Ne=null;_e.type==="circle"&&(Ne=_e.layout.get("circle-sort-key"));for(var it=0,kt=C;it=ai||Dr<0||Dr>=ai)){var Ir=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,C.sortKey),Xr=Ir.vertexLength;rs(this.layoutVertexArray,hr,Dr,-1,-1),rs(this.layoutVertexArray,hr,Dr,1,-1),rs(this.layoutVertexArray,hr,Dr,1,1),rs(this.layoutVertexArray,hr,Dr,-1,1),this.indexArray.emplaceBack(Xr,Xr+1,Xr+2),this.indexArray.emplaceBack(Xr,Xr+3,Xr+2),Ir.vertexLength+=4,Ir.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,se,{},_e)},zt("CircleBucket",ul,{omit:["layers"]});function Uo(k,C){for(var V=0;V=3){for(var ke=0;ke<_e.length;ke++)if(Rf(k,_e[ke]))return!0}if(dh(k,_e,V))return!0}return!1}function dh(k,C,V){if(k.length>1){if(ph(k,C))return!0;for(var se=0;se1?k.distSqr(V):k.distSqr(V.sub(C)._mult(_e)._add(C))}function Rh(k,C){for(var V=!1,se,_e,ke,Ne=0;NeC.y!=ke.y>C.y&&C.x<(ke.x-_e.x)*(C.y-_e.y)/(ke.y-_e.y)+_e.x&&(V=!V)}return V}function Rf(k,C){for(var V=!1,se=0,_e=k.length-1;seC.y!=Ne.y>C.y&&C.x<(Ne.x-ke.x)*(C.y-ke.y)/(Ne.y-ke.y)+ke.x&&(V=!V)}return V}function Dh(k,C,V,se,_e){for(var ke=0,Ne=k;ke=it.x&&_e>=it.y)return!0}var kt=[new i(C,V),new i(C,_e),new i(se,_e),new i(se,V)];if(k.length>2)for(var Ft=0,Gt=kt;Ft_e.x&&C.x>_e.x||k.y_e.y&&C.y>_e.y)return!1;var ke=Z(k,C,V[0]);return ke!==Z(k,C,V[1])||ke!==Z(k,C,V[2])||ke!==Z(k,C,V[3])}function Df(k,C,V){var se=C.paint.get(k).value;return se.kind==="constant"?se.value:V.programConfigurations.get(C.id).getMaxValue(k)}function gh(k){return Math.sqrt(k[0]*k[0]+k[1]*k[1])}function Eh(k,C,V,se,_e){if(!C[0]&&!C[1])return k;var ke=i.convert(C)._mult(_e);V==="viewport"&&ke._rotate(-se);for(var Ne=[],it=0;it0&&(ke=1/Math.sqrt(ke)),k[0]=C[0]*ke,k[1]=C[1]*ke,k[2]=C[2]*ke,k}function Tx(k,C){return k[0]*C[0]+k[1]*C[1]+k[2]*C[2]}function Ax(k,C,V){var se=C[0],_e=C[1],ke=C[2],Ne=V[0],it=V[1],kt=V[2];return k[0]=_e*kt-ke*it,k[1]=ke*Ne-se*kt,k[2]=se*it-_e*Ne,k}function Sx(k,C,V){var se=C[0],_e=C[1],ke=C[2];return k[0]=se*V[0]+_e*V[3]+ke*V[6],k[1]=se*V[1]+_e*V[4]+ke*V[7],k[2]=se*V[2]+_e*V[5]+ke*V[8],k}var Mx=Iv;(function(){var k=Pv();return function(C,V,se,_e,ke,Ne){var it,kt;for(V||(V=3),se||(se=0),_e?kt=Math.min(_e*V+se,C.length):kt=C.length,it=se;itk.width||_e.height>k.height||V.x>k.width-_e.width||V.y>k.height-_e.height)throw new RangeError("out of range source coordinates for image copy");if(_e.width>C.width||_e.height>C.height||se.x>C.width-_e.width||se.y>C.height-_e.height)throw new RangeError("out of range destination coordinates for image copy");for(var Ne=k.data,it=C.data,kt=0;kt<_e.height;kt++)for(var Ft=((V.y+kt)*k.width+V.x)*ke,Gt=((se.y+kt)*C.width+se.x)*ke,hr=0;hr<_e.width*ke;hr++)it[Gt+hr]=Ne[Ft+hr];return C}var Ic=function(C,V){vg(this,C,1,V)};Ic.prototype.resize=function(C){dg(this,C,1)},Ic.prototype.clone=function(){return new Ic({width:this.width,height:this.height},new Uint8Array(this.data))},Ic.copy=function(C,V,se,_e,ke){a0(C,V,se,_e,ke,1)};var bf=function(C,V){vg(this,C,4,V)};bf.prototype.resize=function(C){dg(this,C,4)},bf.prototype.replace=function(C,V){V?this.data.set(C):C instanceof Uint8ClampedArray?this.data=new Uint8Array(C.buffer):this.data=C},bf.prototype.clone=function(){return new bf({width:this.width,height:this.height},new Uint8Array(this.data))},bf.copy=function(C,V,se,_e,ke){a0(C,V,se,_e,ke,4)},zt("AlphaImage",Ic),zt("RGBAImage",bf);var tm=new ti({"heatmap-radius":new Na(Qa.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Na(Qa.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Da(Qa.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Gn(Qa.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Da(Qa.paint_heatmap["heatmap-opacity"])}),Rv={paint:tm};function _d(k){var C={},V=k.resolution||256,se=k.clips?k.clips.length:1,_e=k.image||new bf({width:V,height:se}),ke=function(dn,$a,vn){C[k.evaluationKey]=vn;var bn=k.expression.evaluate(C);_e.data[dn+$a+0]=Math.floor(bn.r*255/bn.a),_e.data[dn+$a+1]=Math.floor(bn.g*255/bn.a),_e.data[dn+$a+2]=Math.floor(bn.b*255/bn.a),_e.data[dn+$a+3]=Math.floor(bn.a*255)};if(k.clips)for(var Ft=0,Gt=0;Ft80*V){it=Ft=k[0],kt=Gt=k[1];for(var Xr=V;Xr<_e;Xr+=V)hr=k[Xr],Dr=k[Xr+1],hrFt&&(Ft=hr),Dr>Gt&&(Gt=Dr);Ir=Math.max(Ft-it,Gt-kt),Ir=Ir!==0?1/Ir:0}return Jv(ke,Ne,V,it,kt,Ir),Ne}function pg(k,C,V,se,_e){var ke,Ne;if(_e===bg(k,C,V,se)>0)for(ke=C;ke=C;ke-=se)Ne=om(ke,k[ke],k[ke+1],Ne);return Ne&&bd(Ne,Ne.next)&&(gp(Ne),Ne=Ne.next),Ne}function pv(k,C){if(!k)return k;C||(C=k);var V=k,se;do if(se=!1,!V.steiner&&(bd(V,V.next)||Hu(V.prev,V,V.next)===0)){if(gp(V),V=C=V.prev,V===V.next)break;se=!0}else V=V.next;while(se||V!==C);return C}function Jv(k,C,V,se,_e,ke,Ne){if(k){!Ne&&ke&&yg(k,se,_e,ke);for(var it=k,kt,Ft;k.prev!==k.next;){if(kt=k.prev,Ft=k.next,ke?Rx(k,se,_e,ke):gg(k)){C.push(kt.i/V),C.push(k.i/V),C.push(Ft.i/V),gp(k),k=Ft.next,it=Ft.next;continue}if(k=Ft,k===it){Ne?Ne===1?(k=Dx(pv(k),C,V),Jv(k,C,V,se,_e,ke,2)):Ne===2&&am(k,C,V,se,_e,ke):Jv(pv(k),C,V,se,_e,ke,1);break}}}}function gg(k){var C=k.prev,V=k,se=k.next;if(Hu(C,V,se)>=0)return!1;for(var _e=k.next.next;_e!==k.prev;){if(zv(C.x,C.y,V.x,V.y,se.x,se.y,_e.x,_e.y)&&Hu(_e.prev,_e,_e.next)>=0)return!1;_e=_e.next}return!0}function Rx(k,C,V,se){var _e=k.prev,ke=k,Ne=k.next;if(Hu(_e,ke,Ne)>=0)return!1;for(var it=_e.xke.x?_e.x>Ne.x?_e.x:Ne.x:ke.x>Ne.x?ke.x:Ne.x,Gt=_e.y>ke.y?_e.y>Ne.y?_e.y:Ne.y:ke.y>Ne.y?ke.y:Ne.y,hr=mg(it,kt,C,V,se),Dr=mg(Ft,Gt,C,V,se),Ir=k.prevZ,Xr=k.nextZ;Ir&&Ir.z>=hr&&Xr&&Xr.z<=Dr;){if(Ir!==k.prev&&Ir!==k.next&&zv(_e.x,_e.y,ke.x,ke.y,Ne.x,Ne.y,Ir.x,Ir.y)&&Hu(Ir.prev,Ir,Ir.next)>=0||(Ir=Ir.prevZ,Xr!==k.prev&&Xr!==k.next&&zv(_e.x,_e.y,ke.x,ke.y,Ne.x,Ne.y,Xr.x,Xr.y)&&Hu(Xr.prev,Xr,Xr.next)>=0))return!1;Xr=Xr.nextZ}for(;Ir&&Ir.z>=hr;){if(Ir!==k.prev&&Ir!==k.next&&zv(_e.x,_e.y,ke.x,ke.y,Ne.x,Ne.y,Ir.x,Ir.y)&&Hu(Ir.prev,Ir,Ir.next)>=0)return!1;Ir=Ir.prevZ}for(;Xr&&Xr.z<=Dr;){if(Xr!==k.prev&&Xr!==k.next&&zv(_e.x,_e.y,ke.x,ke.y,Ne.x,Ne.y,Xr.x,Xr.y)&&Hu(Xr.prev,Xr,Xr.next)>=0)return!1;Xr=Xr.nextZ}return!0}function Dx(k,C,V){var se=k;do{var _e=se.prev,ke=se.next.next;!bd(_e,ke)&&$v(_e,se,se.next,ke)&&wd(_e,ke)&&wd(ke,_e)&&(C.push(_e.i/V),C.push(se.i/V),C.push(ke.i/V),gp(se),gp(se.next),se=k=ke),se=se.next}while(se!==k);return pv(se)}function am(k,C,V,se,_e,ke){var Ne=k;do{for(var it=Ne.next.next;it!==Ne.prev;){if(Ne.i!==it.i&&Fx(Ne,it)){var kt=xg(Ne,it);Ne=pv(Ne,Ne.next),kt=pv(kt,kt.next),Jv(Ne,C,V,se,_e,ke),Jv(kt,C,V,se,_e,ke);return}it=it.next}Ne=Ne.next}while(Ne!==k)}function nm(k,C,V,se){var _e=[],ke,Ne,it,kt,Ft;for(ke=0,Ne=C.length;ke=V.next.y&&V.next.y!==V.y){var it=V.x+(_e-V.y)*(V.next.x-V.x)/(V.next.y-V.y);if(it<=se&&it>ke){if(ke=it,it===se){if(_e===V.y)return V;if(_e===V.next.y)return V.next}Ne=V.x=V.x&&V.x>=Ft&&se!==V.x&&zv(_eNe.x||V.x===Ne.x&&im(Ne,V)))&&(Ne=V,hr=Dr)),V=V.next;while(V!==kt);return Ne}function im(k,C){return Hu(k.prev,k,C.prev)<0&&Hu(C.next,k,k.next)<0}function yg(k,C,V,se){var _e=k;do _e.z===null&&(_e.z=mg(_e.x,_e.y,C,V,se)),_e.prevZ=_e.prev,_e.nextZ=_e.next,_e=_e.next;while(_e!==k);_e.prevZ.nextZ=null,_e.prevZ=null,zx(_e)}function zx(k){var C,V,se,_e,ke,Ne,it,kt,Ft=1;do{for(V=k,k=null,ke=null,Ne=0;V;){for(Ne++,se=V,it=0,C=0;C0||kt>0&&se;)it!==0&&(kt===0||!se||V.z<=se.z)?(_e=V,V=V.nextZ,it--):(_e=se,se=se.nextZ,kt--),ke?ke.nextZ=_e:k=_e,_e.prevZ=ke,ke=_e;V=se}ke.nextZ=null,Ft*=2}while(Ne>1);return k}function mg(k,C,V,se,_e){return k=32767*(k-V)*_e,C=32767*(C-se)*_e,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,C=(C|C<<8)&16711935,C=(C|C<<4)&252645135,C=(C|C<<2)&858993459,C=(C|C<<1)&1431655765,k|C<<1}function l0(k){var C=k,V=k;do(C.x=0&&(k-Ne)*(se-it)-(V-Ne)*(C-it)>=0&&(V-Ne)*(ke-it)-(_e-Ne)*(se-it)>=0}function Fx(k,C){return k.next.i!==C.i&&k.prev.i!==C.i&&!_g(k,C)&&(wd(k,C)&&wd(C,k)&&u0(k,C)&&(Hu(k.prev,k,C.prev)||Hu(k,C.prev,C))||bd(k,C)&&Hu(k.prev,k,k.next)>0&&Hu(C.prev,C,C.next)>0)}function Hu(k,C,V){return(C.y-k.y)*(V.x-C.x)-(C.x-k.x)*(V.y-C.y)}function bd(k,C){return k.x===C.x&&k.y===C.y}function $v(k,C,V,se){var _e=pp(Hu(k,C,V)),ke=pp(Hu(k,C,se)),Ne=pp(Hu(V,se,k)),it=pp(Hu(V,se,C));return!!(_e!==ke&&Ne!==it||_e===0&&dp(k,V,C)||ke===0&&dp(k,se,C)||Ne===0&&dp(V,k,se)||it===0&&dp(V,C,se))}function dp(k,C,V){return C.x<=Math.max(k.x,V.x)&&C.x>=Math.min(k.x,V.x)&&C.y<=Math.max(k.y,V.y)&&C.y>=Math.min(k.y,V.y)}function pp(k){return k>0?1:k<0?-1:0}function _g(k,C){var V=k;do{if(V.i!==k.i&&V.next.i!==k.i&&V.i!==C.i&&V.next.i!==C.i&&$v(V,V.next,k,C))return!0;V=V.next}while(V!==k);return!1}function wd(k,C){return Hu(k.prev,k,k.next)<0?Hu(k,C,k.next)>=0&&Hu(k,k.prev,C)>=0:Hu(k,C,k.prev)<0||Hu(k,k.next,C)<0}function u0(k,C){var V=k,se=!1,_e=(k.x+C.x)/2,ke=(k.y+C.y)/2;do V.y>ke!=V.next.y>ke&&V.next.y!==V.y&&_e<(V.next.x-V.x)*(ke-V.y)/(V.next.y-V.y)+V.x&&(se=!se),V=V.next;while(V!==k);return se}function xg(k,C){var V=new c0(k.i,k.x,k.y),se=new c0(C.i,C.x,C.y),_e=k.next,ke=C.prev;return k.next=C,C.prev=k,V.next=_e,_e.prev=V,se.next=V,V.prev=se,ke.next=se,se.prev=ke,se}function om(k,C,V,se){var _e=new c0(k,C,V);return se?(_e.next=se.next,_e.prev=se,se.next.prev=_e,se.next=_e):(_e.prev=_e,_e.next=_e),_e}function gp(k){k.next.prev=k.prev,k.prev.next=k.next,k.prevZ&&(k.prevZ.nextZ=k.nextZ),k.nextZ&&(k.nextZ.prevZ=k.prevZ)}function c0(k,C,V){this.i=k,this.x=C,this.y=V,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}s0.deviation=function(k,C,V,se){var _e=C&&C.length,ke=_e?C[0]*V:k.length,Ne=Math.abs(bg(k,0,ke,V));if(_e)for(var it=0,kt=C.length;it0&&(se+=k[_e-1].length,V.holes.push(se))}return V},o0.default=rm;function Ox(k,C,V,se,_e){sm(k,C,V,se||k.length-1,_e||wg)}function sm(k,C,V,se,_e){for(;se>V;){if(se-V>600){var ke=se-V+1,Ne=C-V+1,it=Math.log(ke),kt=.5*Math.exp(2*it/3),Ft=.5*Math.sqrt(it*kt*(ke-kt)/ke)*(Ne-ke/2<0?-1:1),Gt=Math.max(V,Math.floor(C-Ne*kt/ke+Ft)),hr=Math.min(se,Math.floor(C+(ke-Ne)*kt/ke+Ft));sm(k,C,Gt,hr,_e)}var Dr=k[C],Ir=V,Xr=se;for(yp(k,V,C),_e(k[se],Dr)>0&&yp(k,V,se);Ir0;)Xr--}_e(k[V],Dr)===0?yp(k,V,Xr):(Xr++,yp(k,Xr,se)),Xr<=C&&(V=Xr+1),C<=Xr&&(se=Xr-1)}}function yp(k,C,V){var se=k[C];k[C]=k[V],k[V]=se}function wg(k,C){return kC?1:0}function Qh(k,C){var V=k.length;if(V<=1)return[k];for(var se=[],_e,ke,Ne=0;Ne1)for(var kt=0;kt>3}if(se--,V===1||V===2)_e+=k.readSVarint(),ke+=k.readSVarint(),V===1&&(it&&Ne.push(it),it=[]),it.push(new i(_e,ke));else if(V===7)it&&it.push(it[0].clone());else throw new Error("unknown command "+V)}return it&&Ne.push(it),Ne},Qv.prototype.bbox=function(){var k=this._pbf;k.pos=this._geometry;for(var C=k.readVarint()+k.pos,V=1,se=0,_e=0,ke=0,Ne=1/0,it=-1/0,kt=1/0,Ft=-1/0;k.pos>3}if(se--,V===1||V===2)_e+=k.readSVarint(),ke+=k.readSVarint(),_eit&&(it=_e),keFt&&(Ft=ke);else if(V!==7)throw new Error("unknown command "+V)}return[Ne,kt,it,Ft]},Qv.prototype.toGeoJSON=function(k,C,V){var se=this.extent*Math.pow(2,V),_e=this.extent*k,ke=this.extent*C,Ne=this.loadGeometry(),it=Qv.types[this.type],kt,Ft;function Gt(Ir){for(var Xr=0;Xr>3;C=se===1?k.readString():se===2?k.readFloat():se===3?k.readDouble():se===4?k.readVarint64():se===5?k.readVarint():se===6?k.readSVarint():se===7?k.readBoolean():null}return C}gm.prototype.feature=function(k){if(k<0||k>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[k];var C=this._pbf.readVarint()+this._pbf.pos;return new Td(this._pbf,C,this.extent,this._keys,this._values)};var mm=_m;function _m(k,C){this.layers=k.readFields(xm,{},C)}function xm(k,C,V){if(k===3){var se=new Sg(V,V.readVarint()+V.pos);se.length&&(C[se.name]=se)}}var bm=mm,Bx=Td,Nx=Sg,ed={VectorTile:bm,VectorTileFeature:Bx,VectorTileLayer:Nx},Ad=ed.VectorTileFeature.types,wm=500,Sd=Math.pow(2,13);function Md(k,C,V,se,_e,ke,Ne,it){k.emplaceBack(C,V,Math.floor(se*Sd)*2+Ne,_e*Sd*2,ke*Sd*2,Math.round(it))}var _h=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(V){return V.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new Cn,this.indexArray=new Xo,this.programConfigurations=new fn(C.layers,C.zoom),this.segments=new ls,this.stateDependentLayerIds=this.layers.filter(function(V){return V.isStateDependent()}).map(function(V){return V.id})};_h.prototype.populate=function(C,V,se){this.features=[],this.hasPattern=f0("fill-extrusion",this.layers,V);for(var _e=0,ke=C;_e=1){var vn=Za[dn-1];if(!v0($a,vn)){Ir.vertexLength+4>ls.MAX_VERTEX_ARRAY_LENGTH&&(Ir=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var bn=$a.sub(vn)._perp()._unit(),Dn=vn.dist($a);Ra+Dn>32768&&(Ra=0),Md(this.layoutVertexArray,$a.x,$a.y,bn.x,bn.y,0,0,Ra),Md(this.layoutVertexArray,$a.x,$a.y,bn.x,bn.y,0,1,Ra),Ra+=Dn,Md(this.layoutVertexArray,vn.x,vn.y,bn.x,bn.y,0,0,Ra),Md(this.layoutVertexArray,vn.x,vn.y,bn.x,bn.y,0,1,Ra);var ui=Ir.vertexLength;this.indexArray.emplaceBack(ui,ui+2,ui+1),this.indexArray.emplaceBack(ui+1,ui+2,ui+3),Ir.vertexLength+=4,Ir.primitiveLength+=2}}}}if(Ir.vertexLength+Ft>ls.MAX_VERTEX_ARRAY_LENGTH&&(Ir=this.segments.prepareSegment(Ft,this.layoutVertexArray,this.indexArray)),Ad[C.type]==="Polygon"){for(var ni=[],Zi=[],Mi=Ir.vertexLength,Bi=0,Ho=kt;Biai)||k.y===C.y&&(k.y<0||k.y>ai)}function d0(k){return k.every(function(C){return C.x<0})||k.every(function(C){return C.x>ai})||k.every(function(C){return C.y<0})||k.every(function(C){return C.y>ai})}var Ux=new ti({"fill-extrusion-opacity":new Da(Qa["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Na(Qa["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Da(Qa["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Da(Qa["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Hn(Qa["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Na(Qa["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Na(Qa["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Da(Qa["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),jx={paint:Ux},Vx=function(k){function C(V){k.call(this,V,jx)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.createBucket=function(se){return new _h(se)},C.prototype.queryRadius=function(){return gh(this.paint.get("fill-extrusion-translate"))},C.prototype.is3D=function(){return!0},C.prototype.queryIntersectsFeature=function(se,_e,ke,Ne,it,kt,Ft,Gt){var hr=Eh(se,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),kt.angle,Ft),Dr=this.paint.get("fill-extrusion-height").evaluate(_e,ke),Ir=this.paint.get("fill-extrusion-base").evaluate(_e,ke),Xr=Tm(hr,Gt,kt,0),ba=Mg(Ne,Ir,Dr,Gt),Za=ba[0],Ra=ba[1];return Ov(Za,Ra,Xr)},C}(Ti);function ev(k,C){return k.x*C.x+k.y*C.y}function sf(k,C){if(k.length===1){for(var V=0,se=C[V++],_e;!_e||se.equals(_e);)if(_e=C[V++],!_e)return 1/0;for(;V=2&&C[Ft-1].equals(C[Ft-2]);)Ft--;for(var Gt=0;Gt0;if(ni&&dn>Gt){var Mi=Ir.dist(Xr);if(Mi>2*hr){var Bi=Ir.sub(Ir.sub(Xr)._mult(hr/Mi)._round());this.updateDistance(Xr,Bi),this.addCurrentVertex(Bi,Za,0,0,Dr),Xr=Bi}}var Ho=Xr&&ba,Xi=Ho?se:kt?"butt":_e;if(Ho&&Xi==="round"&&(Dnke&&(Xi="bevel"),Xi==="bevel"&&(Dn>2&&(Xi="flipbevel"),Dn100)$a=Ra.mult(-1);else{var Qi=Dn*Za.add(Ra).mag()/Za.sub(Ra).mag();$a._perp()._mult(Qi*(Zi?-1:1))}this.addCurrentVertex(Ir,$a,0,0,Dr),this.addCurrentVertex(Ir,$a.mult(-1),0,0,Dr)}else if(Xi==="bevel"||Xi==="fakeround"){var cs=-Math.sqrt(Dn*Dn-1),Oo=Zi?cs:0,rl=Zi?0:cs;if(Xr&&this.addCurrentVertex(Ir,Za,Oo,rl,Dr),Xi==="fakeround")for(var Il=Math.round(ui*180/Math.PI/Cg),al=1;al2*hr){var Oc=Ir.add(ba.sub(Ir)._mult(hr/ff)._round());this.updateDistance(Ir,Oc),this.addCurrentVertex(Oc,Ra,0,0,Dr),Ir=Oc}}}}},wf.prototype.addCurrentVertex=function(C,V,se,_e,ke,Ne){Ne===void 0&&(Ne=!1);var it=V.x+V.y*se,kt=V.y-V.x*se,Ft=-V.x+V.y*_e,Gt=-V.y-V.x*_e;this.addHalfVertex(C,it,kt,Ne,!1,se,ke),this.addHalfVertex(C,Ft,Gt,Ne,!0,-_e,ke),this.distance>p0/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(C,V,se,_e,ke,Ne))},wf.prototype.addHalfVertex=function(C,V,se,_e,ke,Ne,it){var kt=C.x,Ft=C.y,Gt=this.lineClips?this.scaledDistance*(p0-1):this.scaledDistance,hr=Gt*Ed;if(this.layoutVertexArray.emplaceBack((kt<<1)+(_e?1:0),(Ft<<1)+(ke?1:0),Math.round(Em*V)+128,Math.round(Em*se)+128,(Ne===0?0:Ne<0?-1:1)+1|(hr&63)<<2,hr>>6),this.lineClips){var Dr=this.scaledDistance-this.lineClips.start,Ir=this.lineClips.end-this.lineClips.start,Xr=Dr/Ir;this.layoutVertexArray2.emplaceBack(Xr,this.lineClipsArray.length)}var ba=it.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,ba),it.primitiveLength++),ke?this.e2=ba:this.e1=ba},wf.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},wf.prototype.updateDistance=function(C,V){this.distance+=C.dist(V),this.updateScaledDistance()},zt("LineBucket",wf,{omit:["layers","patternFeatures"]});var Lg=new ti({"line-cap":new Da(Qa.layout_line["line-cap"]),"line-join":new Na(Qa.layout_line["line-join"]),"line-miter-limit":new Da(Qa.layout_line["line-miter-limit"]),"line-round-limit":new Da(Qa.layout_line["line-round-limit"]),"line-sort-key":new Na(Qa.layout_line["line-sort-key"])}),g0=new ti({"line-opacity":new Na(Qa.paint_line["line-opacity"]),"line-color":new Na(Qa.paint_line["line-color"]),"line-translate":new Da(Qa.paint_line["line-translate"]),"line-translate-anchor":new Da(Qa.paint_line["line-translate-anchor"]),"line-width":new Na(Qa.paint_line["line-width"]),"line-gap-width":new Na(Qa.paint_line["line-gap-width"]),"line-offset":new Na(Qa.paint_line["line-offset"]),"line-blur":new Na(Qa.paint_line["line-blur"]),"line-dasharray":new Un(Qa.paint_line["line-dasharray"]),"line-pattern":new Hn(Qa.paint_line["line-pattern"]),"line-gradient":new Gn(Qa.paint_line["line-gradient"])}),kd={paint:g0,layout:Lg},Pg=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.possiblyEvaluate=function(se,_e){return _e=new Qo(Math.floor(_e.zoom),{now:_e.now,fadeDuration:_e.fadeDuration,zoomHistory:_e.zoomHistory,transition:_e.transition}),k.prototype.possiblyEvaluate.call(this,se,_e)},C.prototype.evaluate=function(se,_e,ke,Ne){return _e=_({},_e,{zoom:Math.floor(_e.zoom)}),k.prototype.evaluate.call(this,se,_e,ke,Ne)},C}(Na),y0=new Pg(kd.paint.properties["line-width"].specification);y0.useIntegerZoom=!0;var Ig=function(k){function C(V){k.call(this,V,kd),this.gradientVersion=0}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._handleSpecialPaintPropertyUpdate=function(se){if(se==="line-gradient"){var _e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=_e._styleExpression.expression instanceof au,this.gradientVersion=(this.gradientVersion+1)%f}},C.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},C.prototype.recalculate=function(se,_e){k.prototype.recalculate.call(this,se,_e),this.paint._values["line-floorwidth"]=y0.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,se)},C.prototype.createBucket=function(se){return new wf(se)},C.prototype.queryRadius=function(se){var _e=se,ke=Lm(Df("line-width",this,_e),Df("line-gap-width",this,_e)),Ne=Df("line-offset",this,_e);return ke/2+Math.abs(Ne)+gh(this.paint.get("line-translate"))},C.prototype.queryIntersectsFeature=function(se,_e,ke,Ne,it,kt,Ft){var Gt=Eh(se,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),kt.angle,Ft),hr=Ft/2*Lm(this.paint.get("line-width").evaluate(_e,ke),this.paint.get("line-gap-width").evaluate(_e,ke)),Dr=this.paint.get("line-offset").evaluate(_e,ke);return Dr&&(Ne=H(Ne,Dr*Ft)),fc(Gt,Ne,hr)},C.prototype.isTileClipped=function(){return!0},C}(Ti);function Lm(k,C){return C>0?C+2*k:k}function H(k,C){for(var V=[],se=new i(0,0),_e=0;_e":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Xt(k){for(var C="",V=0;V>1,Gt=-7,hr=V?_e-1:0,Dr=V?-1:1,Ir=k[C+hr];for(hr+=Dr,ke=Ir&(1<<-Gt)-1,Ir>>=-Gt,Gt+=it;Gt>0;ke=ke*256+k[C+hr],hr+=Dr,Gt-=8);for(Ne=ke&(1<<-Gt)-1,ke>>=-Gt,Gt+=se;Gt>0;Ne=Ne*256+k[C+hr],hr+=Dr,Gt-=8);if(ke===0)ke=1-Ft;else{if(ke===kt)return Ne?NaN:(Ir?-1:1)*(1/0);Ne=Ne+Math.pow(2,se),ke=ke-Ft}return(Ir?-1:1)*Ne*Math.pow(2,ke-se)},Rr=function(k,C,V,se,_e,ke){var Ne,it,kt,Ft=ke*8-_e-1,Gt=(1<>1,Dr=_e===23?Math.pow(2,-24)-Math.pow(2,-77):0,Ir=se?0:ke-1,Xr=se?1:-1,ba=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(it=isNaN(C)?1:0,Ne=Gt):(Ne=Math.floor(Math.log(C)/Math.LN2),C*(kt=Math.pow(2,-Ne))<1&&(Ne--,kt*=2),Ne+hr>=1?C+=Dr/kt:C+=Dr*Math.pow(2,1-hr),C*kt>=2&&(Ne++,kt/=2),Ne+hr>=Gt?(it=0,Ne=Gt):Ne+hr>=1?(it=(C*kt-1)*Math.pow(2,_e),Ne=Ne+hr):(it=C*Math.pow(2,hr-1)*Math.pow(2,_e),Ne=0));_e>=8;k[V+Ir]=it&255,Ir+=Xr,it/=256,_e-=8);for(Ne=Ne<<_e|it,Ft+=_e;Ft>0;k[V+Ir]=Ne&255,Ir+=Xr,Ne/=256,Ft-=8);k[V+Ir-Xr]|=ba*128},jr={read:br,write:Rr},Yr=ca;function ca(k){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(k)?k:new Uint8Array(k||0),this.pos=0,this.type=0,this.length=this.buf.length}ca.Varint=0,ca.Fixed64=1,ca.Bytes=2,ca.Fixed32=5;var Ca=65536*65536,un=1/Ca,Ha=12,rn=typeof TextDecoder>"u"?null:new TextDecoder("utf8");ca.prototype={destroy:function(){this.buf=null},readFields:function(k,C,V){for(V=V||this.length;this.pos>3,ke=this.pos;this.type=se&7,k(_e,C,this),this.pos===ke&&this.skip(se)}return C},readMessage:function(k,C){return this.readFields(k,C,this.readVarint()+this.pos)},readFixed32:function(){var k=ih(this.buf,this.pos);return this.pos+=4,k},readSFixed32:function(){var k=Rc(this.buf,this.pos);return this.pos+=4,k},readFixed64:function(){var k=ih(this.buf,this.pos)+ih(this.buf,this.pos+4)*Ca;return this.pos+=8,k},readSFixed64:function(){var k=ih(this.buf,this.pos)+Rc(this.buf,this.pos+4)*Ca;return this.pos+=8,k},readFloat:function(){var k=jr.read(this.buf,this.pos,!0,23,4);return this.pos+=4,k},readDouble:function(){var k=jr.read(this.buf,this.pos,!0,52,8);return this.pos+=8,k},readVarint:function(k){var C=this.buf,V,se;return se=C[this.pos++],V=se&127,se<128||(se=C[this.pos++],V|=(se&127)<<7,se<128)||(se=C[this.pos++],V|=(se&127)<<14,se<128)||(se=C[this.pos++],V|=(se&127)<<21,se<128)?V:(se=C[this.pos],V|=(se&15)<<28,Sn(V,k,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var k=this.readVarint();return k%2===1?(k+1)/-2:k/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var k=this.readVarint()+this.pos,C=this.pos;return this.pos=k,k-C>=Ha&&rn?Kf(this.buf,C,k):Yf(this.buf,C,k)},readBytes:function(){var k=this.readVarint()+this.pos,C=this.buf.subarray(this.pos,k);return this.pos=k,C},readPackedVarint:function(k,C){if(this.type!==ca.Bytes)return k.push(this.readVarint(C));var V=$n(this);for(k=k||[];this.pos127;);else if(C===ca.Bytes)this.pos=this.readVarint()+this.pos;else if(C===ca.Fixed32)this.pos+=4;else if(C===ca.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+C)},writeTag:function(k,C){this.writeVarint(k<<3|C)},realloc:function(k){for(var C=this.length||16;C268435455||k<0){qo(k,this);return}this.realloc(4),this.buf[this.pos++]=k&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=k>>>7&127)))},writeSVarint:function(k){this.writeVarint(k<0?-k*2-1:k*2)},writeBoolean:function(k){this.writeVarint(!!k)},writeString:function(k){k=String(k),this.realloc(k.length*4),this.pos++;var C=this.pos;this.pos=Jf(this.buf,k,this.pos);var V=this.pos-C;V>=128&&mo(C,V,this),this.pos=C-1,this.writeVarint(V),this.pos+=V},writeFloat:function(k){this.realloc(4),jr.write(this.buf,k,this.pos,!0,23,4),this.pos+=4},writeDouble:function(k){this.realloc(8),jr.write(this.buf,k,this.pos,!0,52,8),this.pos+=8},writeBytes:function(k){var C=k.length;this.writeVarint(C),this.realloc(C);for(var V=0;V=128&&mo(V,se,this),this.pos=V-1,this.writeVarint(se),this.pos+=se},writeMessage:function(k,C,V){this.writeTag(k,ca.Bytes),this.writeRawMessage(C,V)},writePackedVarint:function(k,C){C.length&&this.writeMessage(k,so,C)},writePackedSVarint:function(k,C){C.length&&this.writeMessage(k,to,C)},writePackedBoolean:function(k,C){C.length&&this.writeMessage(k,_o,C)},writePackedFloat:function(k,C){C.length&&this.writeMessage(k,zn,C)},writePackedDouble:function(k,C){C.length&&this.writeMessage(k,To,C)},writePackedFixed32:function(k,C){C.length&&this.writeMessage(k,ts,C)},writePackedSFixed32:function(k,C){C.length&&this.writeMessage(k,Gl,C)},writePackedFixed64:function(k,C){C.length&&this.writeMessage(k,Nl,C)},writePackedSFixed64:function(k,C){C.length&&this.writeMessage(k,Gc,C)},writeBytesField:function(k,C){this.writeTag(k,ca.Bytes),this.writeBytes(C)},writeFixed32Field:function(k,C){this.writeTag(k,ca.Fixed32),this.writeFixed32(C)},writeSFixed32Field:function(k,C){this.writeTag(k,ca.Fixed32),this.writeSFixed32(C)},writeFixed64Field:function(k,C){this.writeTag(k,ca.Fixed64),this.writeFixed64(C)},writeSFixed64Field:function(k,C){this.writeTag(k,ca.Fixed64),this.writeSFixed64(C)},writeVarintField:function(k,C){this.writeTag(k,ca.Varint),this.writeVarint(C)},writeSVarintField:function(k,C){this.writeTag(k,ca.Varint),this.writeSVarint(C)},writeStringField:function(k,C){this.writeTag(k,ca.Bytes),this.writeString(C)},writeFloatField:function(k,C){this.writeTag(k,ca.Fixed32),this.writeFloat(C)},writeDoubleField:function(k,C){this.writeTag(k,ca.Fixed64),this.writeDouble(C)},writeBooleanField:function(k,C){this.writeVarintField(k,!!C)}};function Sn(k,C,V){var se=V.buf,_e,ke;if(ke=se[V.pos++],_e=(ke&112)>>4,ke<128||(ke=se[V.pos++],_e|=(ke&127)<<3,ke<128)||(ke=se[V.pos++],_e|=(ke&127)<<10,ke<128)||(ke=se[V.pos++],_e|=(ke&127)<<17,ke<128)||(ke=se[V.pos++],_e|=(ke&127)<<24,ke<128)||(ke=se[V.pos++],_e|=(ke&1)<<31,ke<128))return Oi(k,_e,C);throw new Error("Expected varint not more than 10 bytes")}function $n(k){return k.type===ca.Bytes?k.readVarint()+k.pos:k.pos+1}function Oi(k,C,V){return V?C*4294967296+(k>>>0):(C>>>0)*4294967296+(k>>>0)}function qo(k,C){var V,se;if(k>=0?(V=k%4294967296|0,se=k/4294967296|0):(V=~(-k%4294967296),se=~(-k/4294967296),V^4294967295?V=V+1|0:(V=0,se=se+1|0)),k>=18446744073709552e3||k<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");C.realloc(10),qi(V,se,C),Di(se,C)}function qi(k,C,V){V.buf[V.pos++]=k&127|128,k>>>=7,V.buf[V.pos++]=k&127|128,k>>>=7,V.buf[V.pos++]=k&127|128,k>>>=7,V.buf[V.pos++]=k&127|128,k>>>=7,V.buf[V.pos]=k&127}function Di(k,C){var V=(k&7)<<4;C.buf[C.pos++]|=V|((k>>>=3)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127)))))}function mo(k,C,V){var se=C<=16383?1:C<=2097151?2:C<=268435455?3:Math.floor(Math.log(C)/(Math.LN2*7));V.realloc(se);for(var _e=V.pos-1;_e>=k;_e--)V.buf[_e+se]=V.buf[_e]}function so(k,C){for(var V=0;V>>8,k[V+2]=C>>>16,k[V+3]=C>>>24}function Rc(k,C){return(k[C]|k[C+1]<<8|k[C+2]<<16)+(k[C+3]<<24)}function Yf(k,C,V){for(var se="",_e=C;_e239?4:ke>223?3:ke>191?2:1;if(_e+it>V)break;var kt,Ft,Gt;it===1?ke<128&&(Ne=ke):it===2?(kt=k[_e+1],(kt&192)===128&&(Ne=(ke&31)<<6|kt&63,Ne<=127&&(Ne=null))):it===3?(kt=k[_e+1],Ft=k[_e+2],(kt&192)===128&&(Ft&192)===128&&(Ne=(ke&15)<<12|(kt&63)<<6|Ft&63,(Ne<=2047||Ne>=55296&&Ne<=57343)&&(Ne=null))):it===4&&(kt=k[_e+1],Ft=k[_e+2],Gt=k[_e+3],(kt&192)===128&&(Ft&192)===128&&(Gt&192)===128&&(Ne=(ke&15)<<18|(kt&63)<<12|(Ft&63)<<6|Gt&63,(Ne<=65535||Ne>=1114112)&&(Ne=null))),Ne===null?(Ne=65533,it=1):Ne>65535&&(Ne-=65536,se+=String.fromCharCode(Ne>>>10&1023|55296),Ne=56320|Ne&1023),se+=String.fromCharCode(Ne),_e+=it}return se}function Kf(k,C,V){return rn.decode(k.subarray(C,V))}function Jf(k,C,V){for(var se=0,_e,ke;se55295&&_e<57344)if(ke)if(_e<56320){k[V++]=239,k[V++]=191,k[V++]=189,ke=_e;continue}else _e=ke-55296<<10|_e-56320|65536,ke=null;else{_e>56319||se+1===C.length?(k[V++]=239,k[V++]=191,k[V++]=189):ke=_e;continue}else ke&&(k[V++]=239,k[V++]=191,k[V++]=189,ke=null);_e<128?k[V++]=_e:(_e<2048?k[V++]=_e>>6|192:(_e<65536?k[V++]=_e>>12|224:(k[V++]=_e>>18|240,k[V++]=_e>>12&63|128),k[V++]=_e>>6&63|128),k[V++]=_e&63|128)}return V}var Ou=3;function Wc(k,C,V){k===1&&V.readMessage(Ff,C)}function Ff(k,C,V){if(k===3){var se=V.readMessage(Tf,{}),_e=se.id,ke=se.bitmap,Ne=se.width,it=se.height,kt=se.left,Ft=se.top,Gt=se.advance;C.push({id:_e,bitmap:new Ic({width:Ne+2*Ou,height:it+2*Ou},ke),metrics:{width:Ne,height:it,left:kt,top:Ft,advance:Gt}})}}function Tf(k,C,V){k===1?C.id=V.readVarint():k===2?C.bitmap=V.readBytes():k===3?C.width=V.readVarint():k===4?C.height=V.readVarint():k===5?C.left=V.readSVarint():k===6?C.top=V.readSVarint():k===7&&(C.advance=V.readVarint())}function $f(k){return new Yr(k).readFields(Wc,[])}var lf=Ou;function xh(k){for(var C=0,V=0,se=0,_e=k;se<_e.length;se+=1){var ke=_e[se];C+=ke.w*ke.h,V=Math.max(V,ke.w)}k.sort(function(Za,Ra){return Ra.h-Za.h});for(var Ne=Math.max(Math.ceil(Math.sqrt(C/.95)),V),it=[{x:0,y:0,w:Ne,h:1/0}],kt=0,Ft=0,Gt=0,hr=k;Gt=0;Ir--){var Xr=it[Ir];if(!(Dr.w>Xr.w||Dr.h>Xr.h)){if(Dr.x=Xr.x,Dr.y=Xr.y,Ft=Math.max(Ft,Dr.y+Dr.h),kt=Math.max(kt,Dr.x+Dr.w),Dr.w===Xr.w&&Dr.h===Xr.h){var ba=it.pop();Ir=0&&_e>=C&&bh[this.text.charCodeAt(_e)];_e--)se--;this.text=this.text.substring(C,se),this.sectionIndex=this.sectionIndex.slice(C,se)},Wl.prototype.substring=function(C,V){var se=new Wl;return se.text=this.text.substring(C,V),se.sectionIndex=this.sectionIndex.slice(C,V),se.sections=this.sections,se},Wl.prototype.toString=function(){return this.text},Wl.prototype.getMaxScale=function(){var C=this;return this.sectionIndex.reduce(function(V,se){return Math.max(V,C.sections[se].scale)},0)},Wl.prototype.addTextSection=function(C,V){this.text+=C.text,this.sections.push(Of.forText(C.scale,C.fontStack||V));for(var se=this.sections.length-1,_e=0;_e=Vh?null:++this.imageSectionID:(this.imageSectionID=jh,this.imageSectionID)};function uf(k,C){for(var V=[],se=k.text,_e=0,ke=0,Ne=C;ke=0,Gt=0,hr=0;hr0&&Oc>Zi&&(Zi=Oc)}else{var nl=V[Bi.fontStack],Ys=nl&&nl[Xi];if(Ys&&Ys.rect)Oo=Ys.rect,cs=Ys.metrics;else{var Zl=C[Bi.fontStack],fu=Zl&&Zl[Xi];if(!fu)continue;cs=fu.metrics}Qi=(bn-Bi.scale)*er}al?(k.verticalizable=!0,ni.push({glyph:Xi,imageName:rl,x:Dr,y:Ir+Qi,vertical:al,scale:Bi.scale,fontStack:Bi.fontStack,sectionIndex:Ho,metrics:cs,rect:Oo}),Dr+=Il*Bi.scale+Ft):(ni.push({glyph:Xi,imageName:rl,x:Dr,y:Ir+Qi,vertical:al,scale:Bi.scale,fontStack:Bi.fontStack,sectionIndex:Ho,metrics:cs,rect:Oo}),Dr+=cs.advance*Bi.scale+Ft)}if(ni.length!==0){var eh=Dr-Ft;Xr=Math.max(eh,Xr),Gx(ni,0,ni.length-1,Za,Zi)}Dr=0;var th=ke*bn+Zi;ui.lineOffset=Math.max(Zi,Dn),Ir+=th,ba=Math.max(th,ba),++Ra}var hf=Ir-cu,oh=Bg(Ne),sh=oh.horizontalAlign,Zc=oh.verticalAlign;Wx(k.positionedLines,Za,sh,Zc,Xr,ba,ke,hf,_e.length),k.top+=-Zc*hf,k.bottom=k.top+hf,k.left+=-sh*Xr,k.right=k.left+Xr}function Gx(k,C,V,se,_e){if(!(!se&&!_e))for(var ke=k[V],Ne=ke.metrics.advance*ke.scale,it=(k[V].x+Ne)*se,kt=C;kt<=V;kt++)k[kt].x-=it,k[kt].y+=_e}function Wx(k,C,V,se,_e,ke,Ne,it,kt){var Ft=(C-V)*_e,Gt=0;ke!==Ne?Gt=-it*se-cu:Gt=(-se*kt+.5)*Ne;for(var hr=0,Dr=k;hr-V/2;){if(Ne--,Ne<0)return!1;it-=k[Ne].dist(ke),ke=k[Ne]}it+=k[Ne].dist(k[Ne+1]),Ne++;for(var kt=[],Ft=0;itse;)Ft-=kt.shift().angleDelta;if(Ft>_e)return!1;Ne++,it+=hr.dist(Dr)}return!0}function Af(k){for(var C=0,V=0;VFt){var Xr=(Ft-kt)/Ir,ba=Ns(hr.x,Dr.x,Xr),Za=Ns(hr.y,Dr.y,Xr),Ra=new Ld(ba,Za,Dr.angleTo(hr),Gt);return Ra._round(),!Ne||Rm(k,Ra,it,Ne,C)?Ra:void 0}kt+=Ir}}function td(k,C,V,se,_e,ke,Ne,it,kt){var Ft=wh(se,ke,Ne),Gt=Bv(se,_e),hr=Gt*Ne,Dr=k[0].x===0||k[0].x===kt||k[0].y===0||k[0].y===kt;C-hr=0&&vn=0&&bn=0&&Dr+Ft<=Gt){var Dn=new Ld(vn,bn,dn,Xr);Dn._round(),(!se||Rm(k,Dn,ke,se,_e))&&Ir.push(Dn)}}hr+=Ra}return!it&&!Ir.length&&!Ne&&(Ir=Hh(k,hr/2,V,se,_e,ke,Ne,!0,kt)),Ir}function SA(k,C,V,se,_e){for(var ke=[],Ne=0;Ne=se&&hr.x>=se)&&(Gt.x>=se?Gt=new i(se,Gt.y+(hr.y-Gt.y)*((se-Gt.x)/(hr.x-Gt.x)))._round():hr.x>=se&&(hr=new i(se,Gt.y+(hr.y-Gt.y)*((se-Gt.x)/(hr.x-Gt.x)))._round()),!(Gt.y>=_e&&hr.y>=_e)&&(Gt.y>=_e?Gt=new i(Gt.x+(hr.x-Gt.x)*((_e-Gt.y)/(hr.y-Gt.y)),_e)._round():hr.y>=_e&&(hr=new i(Gt.x+(hr.x-Gt.x)*((_e-Gt.y)/(hr.y-Gt.y)),_e)._round()),(!kt||!Gt.equals(kt[kt.length-1]))&&(kt=[Gt],ke.push(kt)),kt.push(hr)))))}return ke}var _0=uu;function MA(k,C,V,se){var _e=[],ke=k.image,Ne=ke.pixelRatio,it=ke.paddedRect.w-2*_0,kt=ke.paddedRect.h-2*_0,Ft=k.right-k.left,Gt=k.bottom-k.top,hr=ke.stretchX||[[0,it]],Dr=ke.stretchY||[[0,kt]],Ir=function(nl,Ys){return nl+Ys[1]-Ys[0]},Xr=hr.reduce(Ir,0),ba=Dr.reduce(Ir,0),Za=it-Xr,Ra=kt-ba,dn=0,$a=Xr,vn=0,bn=ba,Dn=0,ui=Za,ni=0,Zi=Ra;if(ke.content&&se){var Mi=ke.content;dn=Dm(hr,0,Mi[0]),vn=Dm(Dr,0,Mi[1]),$a=Dm(hr,Mi[0],Mi[2]),bn=Dm(Dr,Mi[1],Mi[3]),Dn=Mi[0]-dn,ni=Mi[1]-vn,ui=Mi[2]-Mi[0]-$a,Zi=Mi[3]-Mi[1]-bn}var Bi=function(nl,Ys,Zl,fu){var ic=zm(nl.stretch-dn,$a,Ft,k.left),vc=Fm(nl.fixed-Dn,ui,nl.stretch,Xr),ff=zm(Ys.stretch-vn,bn,Gt,k.top),Oc=Fm(Ys.fixed-ni,Zi,Ys.stretch,ba),eh=zm(Zl.stretch-dn,$a,Ft,k.left),th=Fm(Zl.fixed-Dn,ui,Zl.stretch,Xr),hf=zm(fu.stretch-vn,bn,Gt,k.top),oh=Fm(fu.fixed-ni,Zi,fu.stretch,ba),sh=new i(ic,ff),Zc=new i(eh,ff),lh=new i(eh,hf),Oh=new i(ic,hf),nd=new i(vc/Ne,Oc/Ne),Dd=new i(th/Ne,oh/Ne),zd=C*Math.PI/180;if(zd){var Fd=Math.sin(zd),E0=Math.cos(zd),tv=[E0,-Fd,Fd,E0];sh._matMult(tv),Zc._matMult(tv),Oh._matMult(tv),lh._matMult(tv)}var Vm=nl.stretch+nl.fixed,rb=Zl.stretch+Zl.fixed,qm=Ys.stretch+Ys.fixed,ab=fu.stretch+fu.fixed,Gh={x:ke.paddedRect.x+_0+Vm,y:ke.paddedRect.y+_0+qm,w:rb-Vm,h:ab-qm},k0=ui/Ne/Ft,Hm=Zi/Ne/Gt;return{tl:sh,tr:Zc,bl:Oh,br:lh,tex:Gh,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:nd,pixelOffsetBR:Dd,minFontScaleX:k0,minFontScaleY:Hm,isSDF:V}};if(!se||!ke.stretchX&&!ke.stretchY)_e.push(Bi({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:it+1},{fixed:0,stretch:kt+1}));else for(var Ho=EA(hr,Za,Xr),Xi=EA(Dr,Ra,ba),Qi=0;Qi0&&(Xr=Math.max(10,Xr),this.circleDiameter=Xr)}else{var ba=Ne.top*it-kt,Za=Ne.bottom*it+kt,Ra=Ne.left*it-kt,dn=Ne.right*it+kt,$a=Ne.collisionPadding;if($a&&(Ra-=$a[0]*it,ba-=$a[1]*it,dn+=$a[2]*it,Za+=$a[3]*it),Gt){var vn=new i(Ra,ba),bn=new i(dn,ba),Dn=new i(Ra,Za),ui=new i(dn,Za),ni=Gt*Math.PI/180;vn._rotate(ni),bn._rotate(ni),Dn._rotate(ni),ui._rotate(ni),Ra=Math.min(vn.x,bn.x,Dn.x,ui.x),dn=Math.max(vn.x,bn.x,Dn.x,ui.x),ba=Math.min(vn.y,bn.y,Dn.y,ui.y),Za=Math.max(vn.y,bn.y,Dn.y,ui.y)}C.emplaceBack(V.x,V.y,Ra,ba,dn,Za,se,_e,ke)}this.boxEndIndex=C.length},x0=function(C,V){if(C===void 0&&(C=[]),V===void 0&&(V=Yz),this.data=C,this.length=this.data.length,this.compare=V,this.length>0)for(var se=(this.length>>1)-1;se>=0;se--)this._down(se)};x0.prototype.push=function(C){this.data.push(C),this.length++,this._up(this.length-1)},x0.prototype.pop=function(){if(this.length!==0){var C=this.data[0],V=this.data.pop();return this.length--,this.length>0&&(this.data[0]=V,this._down(0)),C}},x0.prototype.peek=function(){return this.data[0]},x0.prototype._up=function(C){for(var V=this,se=V.data,_e=V.compare,ke=se[C];C>0;){var Ne=C-1>>1,it=se[Ne];if(_e(ke,it)>=0)break;se[C]=it,C=Ne}se[C]=ke},x0.prototype._down=function(C){for(var V=this,se=V.data,_e=V.compare,ke=this.length>>1,Ne=se[C];C=0)break;se[C]=kt,C=it}se[C]=Ne};function Yz(k,C){return kC?1:0}function Kz(k,C,V){V===void 0&&(V=!1);for(var se=1/0,_e=1/0,ke=-1/0,Ne=-1/0,it=k[0],kt=0;ktke)&&(ke=Ft.x),(!kt||Ft.y>Ne)&&(Ne=Ft.y)}var Gt=ke-se,hr=Ne-_e,Dr=Math.min(Gt,hr),Ir=Dr/2,Xr=new x0([],Jz);if(Dr===0)return new i(se,_e);for(var ba=se;baRa.d||!Ra.d)&&(Ra=$a,V&&console.log("found best %d after %d probes",Math.round(1e4*$a.d)/1e4,dn)),!($a.max-Ra.d<=C)&&(Ir=$a.h/2,Xr.push(new b0($a.p.x-Ir,$a.p.y-Ir,Ir,k)),Xr.push(new b0($a.p.x+Ir,$a.p.y-Ir,Ir,k)),Xr.push(new b0($a.p.x-Ir,$a.p.y+Ir,Ir,k)),Xr.push(new b0($a.p.x+Ir,$a.p.y+Ir,Ir,k)),dn+=4)}return V&&(console.log("num probes: "+dn),console.log("best distance: "+Ra.d)),Ra.p}function Jz(k,C){return C.max-k.max}function b0(k,C,V,se){this.p=new i(k,C),this.h=V,this.d=$z(this.p,se),this.max=this.d+this.h*Math.SQRT2}function $z(k,C){for(var V=!1,se=1/0,_e=0;_ek.y!=Gt.y>k.y&&k.x<(Gt.x-Ft.x)*(k.y-Ft.y)/(Gt.y-Ft.y)+Ft.x&&(V=!V),se=Math.min(se,hv(k,Ft,Gt))}return(V?1:-1)*Math.sqrt(se)}function Qz(k){for(var C=0,V=0,se=0,_e=k[0],ke=0,Ne=_e.length,it=Ne-1;ke=ai||tv.y<0||tv.y>=ai||r8(k,tv,E0,V,se,_e,Xi,k.layers[0],k.collisionBoxArray,C.index,C.sourceLayerIndex,k.index,Ra,bn,ni,kt,$a,Dn,Zi,Ir,C,ke,Ft,Gt,Ne)};if(Mi==="line")for(var cs=0,Oo=SA(C.geometry,0,0,ai,ai);cs1){var ff=qh(vc,ui,V.vertical||Xr,se,ba,dn);ff&&Qi(vc,ff)}}else if(C.type==="Polygon")for(var Oc=0,eh=Qh(C.geometry,0);OcId&&U(k.layerIds[0]+': Value for "text-size" is >= '+Ug+'. Reduce your "text-size".')):Za.kind==="composite"&&(Ra=[Dc*Ir.compositeTextSizes[0].evaluate(Ne,{},Xr),Dc*Ir.compositeTextSizes[1].evaluate(Ne,{},Xr)],(Ra[0]>Id||Ra[1]>Id)&&U(k.layerIds[0]+': Value for "text-size" is >= '+Ug+'. Reduce your "text-size".')),k.addSymbols(k.text,ba,Ra,it,ke,Ne,Ft,C,kt.lineStartIndex,kt.lineLength,Dr,Xr);for(var dn=0,$a=Gt;dn<$a.length;dn+=1){var vn=$a[dn];hr[vn]=k.text.placedSymbolArray.length-1}return ba.length*4}function LA(k){for(var C in k)return k[C];return null}function r8(k,C,V,se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a,vn,bn,Dn,ui,ni){var Zi,Mi=k.addToLineVertexArray(C,V),Bi,Ho,Xi,Qi,cs=0,Oo=0,rl=0,Il=0,al=-1,nl=-1,Ys={},Zl=me(""),fu=0,ic=0;if(it._unevaluatedLayout.getValue("text-radial-offset")===void 0?(Zi=it.layout.get("text-offset").evaluate(vn,{},ui).map(function(qg){return qg*er}),fu=Zi[0],ic=Zi[1]):(fu=it.layout.get("text-radial-offset").evaluate(vn,{},ui)*er,ic=Yx),k.allowVerticalPlacement&&se.vertical){var vc=it.layout.get("text-rotate").evaluate(vn,{},ui),ff=vc+90,Oc=se.vertical;Xi=new Om(kt,C,Ft,Gt,hr,Oc,Dr,Ir,Xr,ff),Ne&&(Qi=new Om(kt,C,Ft,Gt,hr,Ne,Za,Ra,Xr,ff))}if(_e){var eh=it.layout.get("icon-rotate").evaluate(vn,{}),th=it.layout.get("icon-text-fit")!=="none",hf=MA(_e,eh,Dn,th),oh=Ne?MA(Ne,eh,Dn,th):void 0;Ho=new Om(kt,C,Ft,Gt,hr,_e,Za,Ra,!1,eh),cs=hf.length*4;var sh=k.iconSizeData,Zc=null;sh.kind==="source"?(Zc=[Dc*it.layout.get("icon-size").evaluate(vn,{})],Zc[0]>Id&&U(k.layerIds[0]+': Value for "icon-size" is >= '+Ug+'. Reduce your "icon-size".')):sh.kind==="composite"&&(Zc=[Dc*bn.compositeIconSizes[0].evaluate(vn,{},ui),Dc*bn.compositeIconSizes[1].evaluate(vn,{},ui)],(Zc[0]>Id||Zc[1]>Id)&&U(k.layerIds[0]+': Value for "icon-size" is >= '+Ug+'. Reduce your "icon-size".')),k.addSymbols(k.icon,hf,Zc,$a,dn,vn,!1,C,Mi.lineStartIndex,Mi.lineLength,-1,ui),al=k.icon.placedSymbolArray.length-1,oh&&(Oo=oh.length*4,k.addSymbols(k.icon,oh,Zc,$a,dn,vn,ku.vertical,C,Mi.lineStartIndex,Mi.lineLength,-1,ui),nl=k.icon.placedSymbolArray.length-1)}for(var lh in se.horizontal){var Oh=se.horizontal[lh];if(!Bi){Zl=me(Oh.text);var nd=it.layout.get("text-rotate").evaluate(vn,{},ui);Bi=new Om(kt,C,Ft,Gt,hr,Oh,Dr,Ir,Xr,nd)}var Dd=Oh.positionedLines.length===1;if(rl+=CA(k,C,Oh,ke,it,Xr,vn,ba,Mi,se.vertical?ku.horizontal:ku.horizontalOnly,Dd?Object.keys(se.horizontal):[lh],Ys,al,bn,ui),Dd)break}se.vertical&&(Il+=CA(k,C,se.vertical,ke,it,Xr,vn,ba,Mi,ku.vertical,["vertical"],Ys,nl,bn,ui));var zd=Bi?Bi.boxStartIndex:k.collisionBoxArray.length,Fd=Bi?Bi.boxEndIndex:k.collisionBoxArray.length,E0=Xi?Xi.boxStartIndex:k.collisionBoxArray.length,tv=Xi?Xi.boxEndIndex:k.collisionBoxArray.length,Vm=Ho?Ho.boxStartIndex:k.collisionBoxArray.length,rb=Ho?Ho.boxEndIndex:k.collisionBoxArray.length,qm=Qi?Qi.boxStartIndex:k.collisionBoxArray.length,ab=Qi?Qi.boxEndIndex:k.collisionBoxArray.length,Gh=-1,k0=function(qg,WA){return qg&&qg.circleDiameter?Math.max(qg.circleDiameter,WA):WA};Gh=k0(Bi,Gh),Gh=k0(Xi,Gh),Gh=k0(Ho,Gh),Gh=k0(Qi,Gh);var Hm=Gh>-1?1:0;Hm&&(Gh*=ni/er),k.glyphOffsetArray.length>=Pl.MAX_GLYPHS&&U("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),vn.sortKey!==void 0&&k.addToSortKeyRanges(k.symbolInstances.length,vn.sortKey),k.symbolInstances.emplaceBack(C.x,C.y,Ys.right>=0?Ys.right:-1,Ys.center>=0?Ys.center:-1,Ys.left>=0?Ys.left:-1,Ys.vertical||-1,al,nl,Zl,zd,Fd,E0,tv,Vm,rb,qm,ab,Ft,rl,Il,cs,Oo,Hm,0,Dr,fu,ic,Gh)}function a8(k,C,V,se){var _e=k.compareText;if(!(C in _e))_e[C]=[];else for(var ke=_e[C],Ne=ke.length-1;Ne>=0;Ne--)if(se.dist(ke[Ne])0)&&(Ne.value.kind!=="constant"||Ne.value.value.length>0),Gt=kt.value.kind!=="constant"||!!kt.value.value||Object.keys(kt.parameters).length>0,hr=ke.get("symbol-sort-key");if(this.features=[],!(!Ft&&!Gt)){for(var Dr=V.iconDependencies,Ir=V.glyphDependencies,Xr=V.availableImages,ba=new Qo(this.zoom),Za=0,Ra=C;Za=0;for(var Il=0,al=Zi.sections;Il=0;kt--)Ne[kt]={x:V[kt].x,y:V[kt].y,tileUnitDistanceFromAnchor:ke},kt>0&&(ke+=V[kt-1].dist(V[kt]));for(var Ft=0;Ft0},Pl.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Pl.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Pl.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Pl.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Pl.prototype.addIndicesForPlacedSymbol=function(C,V){for(var se=C.placedSymbolArray.get(V),_e=se.vertexStartIndex+se.numGlyphs*4,ke=se.vertexStartIndex;ke<_e;ke+=4)C.indexArray.emplaceBack(ke,ke+1,ke+2),C.indexArray.emplaceBack(ke+1,ke+2,ke+3)},Pl.prototype.getSortedSymbolIndexes=function(C){if(this.sortedAngle===C&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var V=Math.sin(C),se=Math.cos(C),_e=[],ke=[],Ne=[],it=0;it1||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 se=0,_e=this.symbolInstanceIndexes;se<_e.length;se+=1){var ke=_e[se],Ne=this.symbolInstances.get(ke);this.featureSortOrder.push(Ne.featureIndex),[Ne.rightJustifiedTextSymbolIndex,Ne.centerJustifiedTextSymbolIndex,Ne.leftJustifiedTextSymbolIndex].forEach(function(it,kt,Ft){it>=0&&Ft.indexOf(it)===kt&&V.addIndicesForPlacedSymbol(V.text,it)}),Ne.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Ne.verticalPlacedTextSymbolIndex),Ne.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ne.placedIconSymbolIndex),Ne.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ne.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},zt("SymbolBucket",Pl,{omit:["layers","collisionBoxArray","features","compareText"]}),Pl.MAX_GLYPHS=65535,Pl.addDynamicAttributes=Jx;function s8(k,C){return C.replace(/{([^{}]+)}/g,function(V,se){return se in k?String(k[se]):""})}var l8=new ti({"symbol-placement":new Da(Qa.layout_symbol["symbol-placement"]),"symbol-spacing":new Da(Qa.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Da(Qa.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Na(Qa.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Da(Qa.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Da(Qa.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Da(Qa.layout_symbol["icon-ignore-placement"]),"icon-optional":new Da(Qa.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Da(Qa.layout_symbol["icon-rotation-alignment"]),"icon-size":new Na(Qa.layout_symbol["icon-size"]),"icon-text-fit":new Da(Qa.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Da(Qa.layout_symbol["icon-text-fit-padding"]),"icon-image":new Na(Qa.layout_symbol["icon-image"]),"icon-rotate":new Na(Qa.layout_symbol["icon-rotate"]),"icon-padding":new Da(Qa.layout_symbol["icon-padding"]),"icon-keep-upright":new Da(Qa.layout_symbol["icon-keep-upright"]),"icon-offset":new Na(Qa.layout_symbol["icon-offset"]),"icon-anchor":new Na(Qa.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Da(Qa.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Da(Qa.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Da(Qa.layout_symbol["text-rotation-alignment"]),"text-field":new Na(Qa.layout_symbol["text-field"]),"text-font":new Na(Qa.layout_symbol["text-font"]),"text-size":new Na(Qa.layout_symbol["text-size"]),"text-max-width":new Na(Qa.layout_symbol["text-max-width"]),"text-line-height":new Da(Qa.layout_symbol["text-line-height"]),"text-letter-spacing":new Na(Qa.layout_symbol["text-letter-spacing"]),"text-justify":new Na(Qa.layout_symbol["text-justify"]),"text-radial-offset":new Na(Qa.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Da(Qa.layout_symbol["text-variable-anchor"]),"text-anchor":new Na(Qa.layout_symbol["text-anchor"]),"text-max-angle":new Da(Qa.layout_symbol["text-max-angle"]),"text-writing-mode":new Da(Qa.layout_symbol["text-writing-mode"]),"text-rotate":new Na(Qa.layout_symbol["text-rotate"]),"text-padding":new Da(Qa.layout_symbol["text-padding"]),"text-keep-upright":new Da(Qa.layout_symbol["text-keep-upright"]),"text-transform":new Na(Qa.layout_symbol["text-transform"]),"text-offset":new Na(Qa.layout_symbol["text-offset"]),"text-allow-overlap":new Da(Qa.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Da(Qa.layout_symbol["text-ignore-placement"]),"text-optional":new Da(Qa.layout_symbol["text-optional"])}),u8=new ti({"icon-opacity":new Na(Qa.paint_symbol["icon-opacity"]),"icon-color":new Na(Qa.paint_symbol["icon-color"]),"icon-halo-color":new Na(Qa.paint_symbol["icon-halo-color"]),"icon-halo-width":new Na(Qa.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Na(Qa.paint_symbol["icon-halo-blur"]),"icon-translate":new Da(Qa.paint_symbol["icon-translate"]),"icon-translate-anchor":new Da(Qa.paint_symbol["icon-translate-anchor"]),"text-opacity":new Na(Qa.paint_symbol["text-opacity"]),"text-color":new Na(Qa.paint_symbol["text-color"],{runtimeType:zo,getOverride:function(k){return k.textColor},hasOverride:function(k){return!!k.textColor}}),"text-halo-color":new Na(Qa.paint_symbol["text-halo-color"]),"text-halo-width":new Na(Qa.paint_symbol["text-halo-width"]),"text-halo-blur":new Na(Qa.paint_symbol["text-halo-blur"]),"text-translate":new Da(Qa.paint_symbol["text-translate"]),"text-translate-anchor":new Da(Qa.paint_symbol["text-translate-anchor"])}),$x={paint:u8,layout:l8},A0=function(C){this.type=C.property.overrides?C.property.overrides.runtimeType:Ks,this.defaultValue=C};A0.prototype.evaluate=function(C){if(C.formattedSection){var V=this.defaultValue.property.overrides;if(V&&V.hasOverride(C.formattedSection))return V.getOverride(C.formattedSection)}return C.feature&&C.featureState?this.defaultValue.evaluate(C.feature,C.featureState):this.defaultValue.property.specification.default},A0.prototype.eachChild=function(C){if(!this.defaultValue.isConstant()){var V=this.defaultValue.value;C(V._styleExpression.expression)}},A0.prototype.outputDefined=function(){return!1},A0.prototype.serialize=function(){return null},zt("FormatSectionOverride",A0,{omit:["defaultValue"]});var c8=function(k){function C(V){k.call(this,V,$x)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.recalculate=function(se,_e){if(k.prototype.recalculate.call(this,se,_e),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 ke=this.layout.get("text-writing-mode");if(ke){for(var Ne=[],it=0,kt=ke;it",targetMapId:_e,sourceMapId:Ne.mapId})}}},S0.prototype.receive=function(C){var V=C.data,se=V.id;if(se&&!(V.targetMapId&&this.mapId!==V.targetMapId))if(V.type===""){delete this.tasks[se];var _e=this.cancelCallbacks[se];delete this.cancelCallbacks[se],_e&&_e()}else oe()||V.mustQueue?(this.tasks[se]=V,this.taskQueue.push(se),this.invoker.trigger()):this.processTask(se,V)},S0.prototype.process=function(){if(this.taskQueue.length){var C=this.taskQueue.shift(),V=this.tasks[C];delete this.tasks[C],this.taskQueue.length&&this.invoker.trigger(),V&&this.processTask(C,V)}},S0.prototype.processTask=function(C,V){var se=this;if(V.type===""){var _e=this.callbacks[C];delete this.callbacks[C],_e&&(V.error?_e(Vr(V.error)):_e(null,Vr(V.data)))}else{var ke=!1,Ne=J(this.globalScope)?void 0:[],it=V.hasCallback?function(Dr,Ir){ke=!0,delete se.cancelCallbacks[C],se.target.postMessage({id:C,type:"",sourceMapId:se.mapId,error:Dr?Ar(Dr):null,data:Ar(Ir,Ne)},Ne)}:function(Dr){ke=!0},kt=null,Ft=Vr(V.data);if(this.parent[V.type])kt=this.parent[V.type](V.sourceMapId,Ft,it);else if(this.parent.getWorkerSource){var Gt=V.type.split("."),hr=this.parent.getWorkerSource(V.sourceMapId,Gt[0],Ft.source);kt=hr[Gt[1]](Ft,it)}else it(new Error("Could not find function "+V.type));!ke&&kt&&kt.cancel&&(this.cancelCallbacks[C]=kt.cancel)}},S0.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function b8(k,C,V){C=Math.pow(2,V)-C-1;var se=zA(k*256,C*256,V),_e=zA((k+1)*256,(C+1)*256,V);return se[0]+","+se[1]+","+_e[0]+","+_e[1]}function zA(k,C,V){var se=2*Math.PI*6378137/256/Math.pow(2,V),_e=k*se-2*Math.PI*6378137/2,ke=C*se-2*Math.PI*6378137/2;return[_e,ke]}var zc=function(C,V){C&&(V?this.setSouthWest(C).setNorthEast(V):C.length===4?this.setSouthWest([C[0],C[1]]).setNorthEast([C[2],C[3]]):this.setSouthWest(C[0]).setNorthEast(C[1]))};zc.prototype.setNorthEast=function(C){return this._ne=C instanceof Cu?new Cu(C.lng,C.lat):Cu.convert(C),this},zc.prototype.setSouthWest=function(C){return this._sw=C instanceof Cu?new Cu(C.lng,C.lat):Cu.convert(C),this},zc.prototype.extend=function(C){var V=this._sw,se=this._ne,_e,ke;if(C instanceof Cu)_e=C,ke=C;else if(C instanceof zc){if(_e=C._sw,ke=C._ne,!_e||!ke)return this}else{if(Array.isArray(C))if(C.length===4||C.every(Array.isArray)){var Ne=C;return this.extend(zc.convert(Ne))}else{var it=C;return this.extend(Cu.convert(it))}return this}return!V&&!se?(this._sw=new Cu(_e.lng,_e.lat),this._ne=new Cu(ke.lng,ke.lat)):(V.lng=Math.min(_e.lng,V.lng),V.lat=Math.min(_e.lat,V.lat),se.lng=Math.max(ke.lng,se.lng),se.lat=Math.max(ke.lat,se.lat)),this},zc.prototype.getCenter=function(){return new Cu((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},zc.prototype.getSouthWest=function(){return this._sw},zc.prototype.getNorthEast=function(){return this._ne},zc.prototype.getNorthWest=function(){return new Cu(this.getWest(),this.getNorth())},zc.prototype.getSouthEast=function(){return new Cu(this.getEast(),this.getSouth())},zc.prototype.getWest=function(){return this._sw.lng},zc.prototype.getSouth=function(){return this._sw.lat},zc.prototype.getEast=function(){return this._ne.lng},zc.prototype.getNorth=function(){return this._ne.lat},zc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},zc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},zc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},zc.prototype.contains=function(C){var V=Cu.convert(C),se=V.lng,_e=V.lat,ke=this._sw.lat<=_e&&_e<=this._ne.lat,Ne=this._sw.lng<=se&&se<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ne=this._sw.lng>=se&&se>=this._ne.lng),ke&&Ne},zc.convert=function(C){return!C||C instanceof zc?C:new zc(C)};var FA=63710088e-1,Cu=function(C,V){if(isNaN(C)||isNaN(V))throw new Error("Invalid LngLat object: ("+C+", "+V+")");if(this.lng=+C,this.lat=+V,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Cu.prototype.wrap=function(){return new Cu(y(this.lng,-180,180),this.lat)},Cu.prototype.toArray=function(){return[this.lng,this.lat]},Cu.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Cu.prototype.distanceTo=function(C){var V=Math.PI/180,se=this.lat*V,_e=C.lat*V,ke=Math.sin(se)*Math.sin(_e)+Math.cos(se)*Math.cos(_e)*Math.cos((C.lng-this.lng)*V),Ne=FA*Math.acos(Math.min(ke,1));return Ne},Cu.prototype.toBounds=function(C){C===void 0&&(C=0);var V=40075017,se=360*C/V,_e=se/Math.cos(Math.PI/180*this.lat);return new zc(new Cu(this.lng-_e,this.lat-se),new Cu(this.lng+_e,this.lat+se))},Cu.convert=function(C){if(C instanceof Cu)return C;if(Array.isArray(C)&&(C.length===2||C.length===3))return new Cu(Number(C[0]),Number(C[1]));if(!Array.isArray(C)&&typeof C=="object"&&C!==null)return new Cu(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 OA=2*Math.PI*FA;function BA(k){return OA*Math.cos(k*Math.PI/180)}function NA(k){return(180+k)/360}function UA(k){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+k*Math.PI/360)))/360}function jA(k,C){return k/BA(C)}function w8(k){return k*360-180}function eb(k){var C=180-k*360;return 360/Math.PI*Math.atan(Math.exp(C*Math.PI/180))-90}function T8(k,C){return k*BA(eb(C))}function A8(k){return 1/Math.cos(k*Math.PI/180)}var xp=function(C,V,se){se===void 0&&(se=0),this.x=+C,this.y=+V,this.z=+se};xp.fromLngLat=function(C,V){V===void 0&&(V=0);var se=Cu.convert(C);return new xp(NA(se.lng),UA(se.lat),jA(V,se.lat))},xp.prototype.toLngLat=function(){return new Cu(w8(this.x),eb(this.y))},xp.prototype.toAltitude=function(){return T8(this.z,this.y)},xp.prototype.meterInMercatorCoordinateUnits=function(){return 1/OA*A8(eb(this.y))};var bp=function(C,V,se){this.z=C,this.x=V,this.y=se,this.key=Vg(0,C,C,V,se)};bp.prototype.equals=function(C){return this.z===C.z&&this.x===C.x&&this.y===C.y},bp.prototype.url=function(C,V){var se=b8(this.x,this.y,this.z),_e=S8(this.z,this.x,this.y);return C[(this.x+this.y)%C.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(V==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",_e).replace("{bbox-epsg-3857}",se)},bp.prototype.getTilePoint=function(C){var V=Math.pow(2,this.z);return new i((C.x*V-this.x)*ai,(C.y*V-this.y)*ai)},bp.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var VA=function(C,V){this.wrap=C,this.canonical=V,this.key=Vg(C,V.z,V.z,V.x,V.y)},Fc=function(C,V,se,_e,ke){this.overscaledZ=C,this.wrap=V,this.canonical=new bp(se,+_e,+ke),this.key=Vg(V,C,se,_e,ke)};Fc.prototype.equals=function(C){return this.overscaledZ===C.overscaledZ&&this.wrap===C.wrap&&this.canonical.equals(C.canonical)},Fc.prototype.scaledTo=function(C){var V=this.canonical.z-C;return C>this.canonical.z?new Fc(C,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Fc(C,this.wrap,C,this.canonical.x>>V,this.canonical.y>>V)},Fc.prototype.calculateScaledKey=function(C,V){var se=this.canonical.z-C;return C>this.canonical.z?Vg(this.wrap*+V,C,this.canonical.z,this.canonical.x,this.canonical.y):Vg(this.wrap*+V,C,C,this.canonical.x>>se,this.canonical.y>>se)},Fc.prototype.isChildOf=function(C){if(C.wrap!==this.wrap)return!1;var V=this.canonical.z-C.canonical.z;return C.overscaledZ===0||C.overscaledZ>V&&C.canonical.y===this.canonical.y>>V},Fc.prototype.children=function(C){if(this.overscaledZ>=C)return[new Fc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var V=this.canonical.z+1,se=this.canonical.x*2,_e=this.canonical.y*2;return[new Fc(V,this.wrap,V,se,_e),new Fc(V,this.wrap,V,se+1,_e),new Fc(V,this.wrap,V,se,_e+1),new Fc(V,this.wrap,V,se+1,_e+1)]},Fc.prototype.isLessThan=function(C){return this.wrapC.wrap?!1:this.overscaledZC.overscaledZ?!1:this.canonical.xC.canonical.x?!1:this.canonical.y0;ke--)_e=1<=this.dim+1||V<-1||V>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(V+1)*this.stride+(C+1)},rd.prototype._unpackMapbox=function(C,V,se){return(C*256*256+V*256+se)/10-1e4},rd.prototype._unpackTerrarium=function(C,V,se){return C*256+V+se/256-32768},rd.prototype.getPixels=function(){return new bf({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},rd.prototype.backfillBorder=function(C,V,se){if(this.dim!==C.dim)throw new Error("dem dimension mismatch");var _e=V*this.dim,ke=V*this.dim+this.dim,Ne=se*this.dim,it=se*this.dim+this.dim;switch(V){case-1:_e=ke-1;break;case 1:ke=_e+1;break}switch(se){case-1:Ne=it-1;break;case 1:it=Ne+1;break}for(var kt=-V*this.dim,Ft=-se*this.dim,Gt=Ne;Gt=0&&hr[3]>=0&&kt.insert(it,hr[0],hr[1],hr[2],hr[3])}},ad.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ed.VectorTile(new Yr(this.rawTileData)).layers,this.sourceLayerCoder=new Um(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},ad.prototype.query=function(C,V,se,_e){var ke=this;this.loadVTLayers();for(var Ne=C.params||{},it=ai/C.tileSize/C.scale,kt=Ze(Ne.filter),Ft=C.queryGeometry,Gt=C.queryPadding*it,hr=HA(Ft),Dr=this.grid.query(hr.minX-Gt,hr.minY-Gt,hr.maxX+Gt,hr.maxY+Gt),Ir=HA(C.cameraQueryGeometry),Xr=this.grid3D.query(Ir.minX-Gt,Ir.minY-Gt,Ir.maxX+Gt,Ir.maxY+Gt,function(Dn,ui,ni,Zi){return Dh(C.cameraQueryGeometry,Dn-Gt,ui-Gt,ni+Gt,Zi+Gt)}),ba=0,Za=Xr;ba_e)ke=!1;else if(!V)ke=!0;else if(this.expirationTime=Hr.maxzoom)&&Hr.visibility!=="none"){c(Pr,this.zoom,Ot);var Zr=Aa[Hr.id]=Hr.createBucket({index:ga.bucketLayerIDs.length,layers:Pr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:vt,sourceID:this.source});Zr.populate(Lr,Pa,this.tileID.canonical),ga.bucketLayerIDs.push(Pr.map(function(ra){return ra.id}))}}}}var Jr,wt,Qt,mr,$r=e.mapObject(Pa.glyphDependencies,function(ra){return Object.keys(ra).map(Number)});Object.keys($r).length?gr.send("getGlyphs",{uid:this.uid,stacks:$r},function(ra,pa){Jr||(Jr=ra,wt=pa,ya.call(na))}):wt={};var oa=Object.keys(Pa.iconDependencies);oa.length?gr.send("getImages",{icons:oa,source:this.source,tileID:this.tileID,type:"icons"},function(ra,pa){Jr||(Jr=ra,Qt=pa,ya.call(na))}):Qt={};var Sa=Object.keys(Pa.patternDependencies);Sa.length?gr.send("getImages",{icons:Sa,source:this.source,tileID:this.tileID,type:"patterns"},function(ra,pa){Jr||(Jr=ra,mr=pa,ya.call(na))}):mr={},ya.call(this);function ya(){if(Jr)return Br(Jr);if(wt&&Qt&&mr){var ra=new n(wt),pa=new e.ImageAtlas(Qt,mr);for(var pn in Aa){var Ga=Aa[pn];Ga instanceof e.SymbolBucket?(c(Ga.layers,this.zoom,Ot),e.performSymbolLayout(Ga,wt,ra.positions,Qt,pa.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Ga.hasPattern&&(Ga instanceof e.LineBucket||Ga instanceof e.FillBucket||Ga instanceof e.FillExtrusionBucket)&&(c(Ga.layers,this.zoom,Ot),Ga.addFeatures(Pa,this.tileID.canonical,pa.patternPositions))}this.status="done",Br(null,{buckets:e.values(Aa).filter(function(qn){return!qn.isEmpty()}),featureIndex:ga,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ra.image,imageAtlas:pa,glyphMap:this.returnDependencies?wt:null,iconMap:this.returnDependencies?Qt:null,glyphPositions:this.returnDependencies?ra.positions:null})}}};function c(Vt,Lt,jt){for(var Ot=new e.EvaluationParameters(Lt),gr=0,Br=Vt;gr=0!=!!Lt&&Vt.reverse()}var M=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,_=function(Lt){this._feature=Lt,this.extent=e.EXTENT,this.type=Lt.type,this.properties=Lt.tags,"id"in Lt&&!isNaN(Lt.id)&&(this.id=parseInt(Lt.id,10))};_.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Lt=[],jt=0,Ot=this._feature.geometry;jt"u"&&(Ot.push(Ur),ga=Ot.length-1,Br[Ur]=ga),Lt.writeVarint(ga);var Aa=jt.properties[Ur],Pa=typeof Aa;Pa!=="string"&&Pa!=="boolean"&&Pa!=="number"&&(Aa=JSON.stringify(Aa));var sa=Pa+":"+Aa,Oa=na[sa];typeof Oa>"u"&&(gr.push(Aa),Oa=gr.length-1,na[sa]=Oa),Lt.writeVarint(Oa)}}function Q(Vt,Lt){return(Lt<<3)+(Vt&7)}function ue(Vt){return Vt<<1^Vt>>31}function oe(Vt,Lt){for(var jt=Vt.loadGeometry(),Ot=Vt.type,gr=0,Br=0,na=jt.length,Ur=0;Ur>1;J(Vt,Lt,na,Ot,gr,Br%2),j(Vt,Lt,jt,Ot,na-1,Br+1),j(Vt,Lt,jt,na+1,gr,Br+1)}}function J(Vt,Lt,jt,Ot,gr,Br){for(;gr>Ot;){if(gr-Ot>600){var na=gr-Ot+1,Ur=jt-Ot+1,ga=Math.log(na),Aa=.5*Math.exp(2*ga/3),Pa=.5*Math.sqrt(ga*Aa*(na-Aa)/na)*(Ur-na/2<0?-1:1),sa=Math.max(Ot,Math.floor(jt-Ur*Aa/na+Pa)),Oa=Math.min(gr,Math.floor(jt+(na-Ur)*Aa/na+Pa));J(Vt,Lt,jt,sa,Oa,Br)}var dt=Lt[2*jt+Br],vt=Ot,Lr=gr;for($(Vt,Lt,Ot,jt),Lt[2*gr+Br]>dt&&$(Vt,Lt,Ot,gr);vtdt;)Lr--}Lt[2*Ot+Br]===dt?$(Vt,Lt,Ot,Lr):(Lr++,$(Vt,Lt,Lr,gr)),Lr<=jt&&(Ot=Lr+1),jt<=Lr&&(gr=Lr-1)}}function $(Vt,Lt,jt,Ot){X(Vt,jt,Ot),X(Lt,2*jt,2*Ot),X(Lt,2*jt+1,2*Ot+1)}function X(Vt,Lt,jt){var Ot=Vt[Lt];Vt[Lt]=Vt[jt],Vt[jt]=Ot}function re(Vt,Lt,jt,Ot,gr,Br,na){for(var Ur=[0,Vt.length-1,0],ga=[],Aa,Pa;Ur.length;){var sa=Ur.pop(),Oa=Ur.pop(),dt=Ur.pop();if(Oa-dt<=na){for(var vt=dt;vt<=Oa;vt++)Aa=Lt[2*vt],Pa=Lt[2*vt+1],Aa>=jt&&Aa<=gr&&Pa>=Ot&&Pa<=Br&&ga.push(Vt[vt]);continue}var Lr=Math.floor((dt+Oa)/2);Aa=Lt[2*Lr],Pa=Lt[2*Lr+1],Aa>=jt&&Aa<=gr&&Pa>=Ot&&Pa<=Br&&ga.push(Vt[Lr]);var Er=(sa+1)%2;(sa===0?jt<=Aa:Ot<=Pa)&&(Ur.push(dt),Ur.push(Lr-1),Ur.push(Er)),(sa===0?gr>=Aa:Br>=Pa)&&(Ur.push(Lr+1),Ur.push(Oa),Ur.push(Er))}return ga}function ee(Vt,Lt,jt,Ot,gr,Br){for(var na=[0,Vt.length-1,0],Ur=[],ga=gr*gr;na.length;){var Aa=na.pop(),Pa=na.pop(),sa=na.pop();if(Pa-sa<=Br){for(var Oa=sa;Oa<=Pa;Oa++)q(Lt[2*Oa],Lt[2*Oa+1],jt,Ot)<=ga&&Ur.push(Vt[Oa]);continue}var dt=Math.floor((sa+Pa)/2),vt=Lt[2*dt],Lr=Lt[2*dt+1];q(vt,Lr,jt,Ot)<=ga&&Ur.push(Vt[dt]);var Er=(Aa+1)%2;(Aa===0?jt-gr<=vt:Ot-gr<=Lr)&&(na.push(sa),na.push(dt-1),na.push(Er)),(Aa===0?jt+gr>=vt:Ot+gr>=Lr)&&(na.push(dt+1),na.push(Pa),na.push(Er))}return Ur}function q(Vt,Lt,jt,Ot){var gr=Vt-jt,Br=Lt-Ot;return gr*gr+Br*Br}var ae=function(Vt){return Vt[0]},ie=function(Vt){return Vt[1]},fe=function(Lt,jt,Ot,gr,Br){jt===void 0&&(jt=ae),Ot===void 0&&(Ot=ie),gr===void 0&&(gr=64),Br===void 0&&(Br=Float64Array),this.nodeSize=gr,this.points=Lt;for(var na=Lt.length<65536?Uint16Array:Uint32Array,Ur=this.ids=new na(Lt.length),ga=this.coords=new Br(Lt.length*2),Aa=0;Aa=gr;Pa--){var sa=+Date.now();ga=this._cluster(ga,Pa),this.trees[Pa]=new fe(ga,ce,Re,na,Float32Array),Ot&&console.log("z%d: %d clusters in %dms",Pa,ga.length,+Date.now()-sa)}return Ot&&console.timeEnd("total time"),this},Ae.prototype.getClusters=function(Lt,jt){var Ot=((Lt[0]+180)%360+360)%360-180,gr=Math.max(-90,Math.min(90,Lt[1])),Br=Lt[2]===180?180:((Lt[2]+180)%360+360)%360-180,na=Math.max(-90,Math.min(90,Lt[3]));if(Lt[2]-Lt[0]>=360)Ot=-180,Br=180;else if(Ot>Br){var Ur=this.getClusters([Ot,gr,180,na],jt),ga=this.getClusters([-180,gr,Br,na],jt);return Ur.concat(ga)}for(var Aa=this.trees[this._limitZoom(jt)],Pa=Aa.range(Qe(Ot),Ke(na),Qe(Br),Ke(gr)),sa=[],Oa=0,dt=Pa;Oajt&&(Lr+=kr.numPoints||1)}if(Lr>=ga){for(var zr=sa.x*vt,Pr=sa.y*vt,Hr=Ur&&vt>1?this._map(sa,!0):null,Zr=(Pa<<5)+(jt+1)+this.points.length,Jr=0,wt=dt;Jr1)for(var oa=0,Sa=dt;oa>5},Ae.prototype._getOriginZoom=function(Lt){return(Lt-this.points.length)%32},Ae.prototype._map=function(Lt,jt){if(Lt.numPoints)return jt?xe({},Lt.properties):Lt.properties;var Ot=this.points[Lt.index].properties,gr=this.options.map(Ot);return jt&&gr===Ot?xe({},gr):gr};function Fe(Vt,Lt,jt,Ot,gr){return{x:Vt,y:Lt,zoom:1/0,id:jt,parentId:-1,numPoints:Ot,properties:gr}}function Ce(Vt,Lt){var jt=Vt.geometry.coordinates,Ot=jt[0],gr=jt[1];return{x:Qe(Ot),y:Ke(gr),zoom:1/0,index:Lt,parentId:-1}}function qe(Vt){return{type:"Feature",id:Vt.id,properties:et(Vt),geometry:{type:"Point",coordinates:[Xe(Vt.x),Me(Vt.y)]}}}function et(Vt){var Lt=Vt.numPoints,jt=Lt>=1e4?Math.round(Lt/1e3)+"k":Lt>=1e3?Math.round(Lt/100)/10+"k":Lt;return xe(xe({},Vt.properties),{cluster:!0,cluster_id:Vt.id,point_count:Lt,point_count_abbreviated:jt})}function Qe(Vt){return Vt/360+.5}function Ke(Vt){var Lt=Math.sin(Vt*Math.PI/180),jt=.5-.25*Math.log((1+Lt)/(1-Lt))/Math.PI;return jt<0?0:jt>1?1:jt}function Xe(Vt){return(Vt-.5)*360}function Me(Vt){var Lt=(180-Vt*360)*Math.PI/180;return 360*Math.atan(Math.exp(Lt))/Math.PI-90}function xe(Vt,Lt){for(var jt in Lt)Vt[jt]=Lt[jt];return Vt}function ce(Vt){return Vt.x}function Re(Vt){return Vt.y}function $e(Vt,Lt,jt,Ot){for(var gr=Ot,Br=jt-Lt>>1,na=jt-Lt,Ur,ga=Vt[Lt],Aa=Vt[Lt+1],Pa=Vt[jt],sa=Vt[jt+1],Oa=Lt+3;Oagr)Ur=Oa,gr=dt;else if(dt===gr){var vt=Math.abs(Oa-Br);vtOt&&(Ur-Lt>3&&$e(Vt,Lt,Ur,Ot),Vt[Ur+2]=gr,jt-Ur>3&&$e(Vt,Ur,jt,Ot))}function rt(Vt,Lt,jt,Ot,gr,Br){var na=gr-jt,Ur=Br-Ot;if(na!==0||Ur!==0){var ga=((Vt-jt)*na+(Lt-Ot)*Ur)/(na*na+Ur*Ur);ga>1?(jt=gr,Ot=Br):ga>0&&(jt+=na*ga,Ot+=Ur*ga)}return na=Vt-jt,Ur=Lt-Ot,na*na+Ur*Ur}function Je(Vt,Lt,jt,Ot){var gr={id:typeof Vt>"u"?null:Vt,type:Lt,geometry:jt,tags:Ot,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return At(gr),gr}function At(Vt){var Lt=Vt.geometry,jt=Vt.type;if(jt==="Point"||jt==="MultiPoint"||jt==="LineString")St(Vt,Lt);else if(jt==="Polygon"||jt==="MultiLineString")for(var Ot=0;Ot0&&(Ot?na+=(gr*Aa-ga*Br)/2:na+=Math.sqrt(Math.pow(ga-gr,2)+Math.pow(Aa-Br,2))),gr=ga,Br=Aa}var Pa=Lt.length-3;Lt[2]=1,$e(Lt,0,Pa,jt),Lt[Pa+2]=1,Lt.size=Math.abs(na),Lt.start=0,Lt.end=Lt.size}function Mr(Vt,Lt,jt,Ot){for(var gr=0;gr1?1:jt}function pt(Vt,Lt,jt,Ot,gr,Br,na,Ur){if(jt/=Lt,Ot/=Lt,Br>=jt&&na=Ot)return null;for(var ga=[],Aa=0;Aa=jt&&vt=Ot)continue;var Lr=[];if(Oa==="Point"||Oa==="MultiPoint")ze(sa,Lr,jt,Ot,gr);else if(Oa==="LineString")Ge(sa,Lr,jt,Ot,gr,!1,Ur.lineMetrics);else if(Oa==="MultiLineString")ve(sa,Lr,jt,Ot,gr,!1);else if(Oa==="Polygon")ve(sa,Lr,jt,Ot,gr,!0);else if(Oa==="MultiPolygon")for(var Er=0;Er=jt&&na<=Ot&&(Lt.push(Vt[Br]),Lt.push(Vt[Br+1]),Lt.push(Vt[Br+2]))}}function Ge(Vt,Lt,jt,Ot,gr,Br,na){for(var Ur=Oe(Vt),ga=gr===0?be:Pe,Aa=Vt.start,Pa,sa,Oa=0;Oajt&&(sa=ga(Ur,dt,vt,Er,_r,jt),na&&(Ur.start=Aa+Pa*sa)):yr>Ot?kr=jt&&(sa=ga(Ur,dt,vt,Er,_r,jt),zr=!0),kr>Ot&&yr<=Ot&&(sa=ga(Ur,dt,vt,Er,_r,Ot),zr=!0),!Br&&zr&&(na&&(Ur.end=Aa+Pa*sa),Lt.push(Ur),Ur=Oe(Vt)),na&&(Aa+=Pa)}var Pr=Vt.length-3;dt=Vt[Pr],vt=Vt[Pr+1],Lr=Vt[Pr+2],yr=gr===0?dt:vt,yr>=jt&&yr<=Ot&&ge(Ur,dt,vt,Lr),Pr=Ur.length-3,Br&&Pr>=3&&(Ur[Pr]!==Ur[0]||Ur[Pr+1]!==Ur[1])&&ge(Ur,Ur[0],Ur[1],Ur[2]),Ur.length&&Lt.push(Ur)}function Oe(Vt){var Lt=[];return Lt.size=Vt.size,Lt.start=Vt.start,Lt.end=Vt.end,Lt}function ve(Vt,Lt,jt,Ot,gr,Br){for(var na=0;nana.maxX&&(na.maxX=Pa),sa>na.maxY&&(na.maxY=sa)}return na}function qt(Vt,Lt,jt,Ot){var gr=Lt.geometry,Br=Lt.type,na=[];if(Br==="Point"||Br==="MultiPoint")for(var Ur=0;Ur0&&Lt.size<(gr?na:Ot)){jt.numPoints+=Lt.length/3;return}for(var Ur=[],ga=0;gana)&&(jt.numSimplified++,Ur.push(Lt[ga]),Ur.push(Lt[ga+1])),jt.numPoints++;gr&&lr(Ur,Br),Vt.push(Ur)}function lr(Vt,Lt){for(var jt=0,Ot=0,gr=Vt.length,Br=gr-2;Ot0===Lt)for(Ot=0,gr=Vt.length;Ot24)throw new Error("maxZoom should be in the 0-24 range");if(Lt.promoteId&&Lt.generateId)throw new Error("promoteId and generateId cannot be used together.");var Ot=Rt(Vt,Lt);this.tiles={},this.tileCoords=[],jt&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",Lt.indexMaxZoom,Lt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Ot=We(Ot,Lt),Ot.length&&this.splitTile(Ot,0,0,0),jt&&(Ot.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}da.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},da.prototype.splitTile=function(Vt,Lt,jt,Ot,gr,Br,na){for(var Ur=[Vt,Lt,jt,Ot],ga=this.options,Aa=ga.debug;Ur.length;){Ot=Ur.pop(),jt=Ur.pop(),Lt=Ur.pop(),Vt=Ur.pop();var Pa=1<1&&console.time("creation"),Oa=this.tiles[sa]=Bt(Vt,Lt,jt,Ot,ga),this.tileCoords.push({z:Lt,x:jt,y:Ot}),Aa)){Aa>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Lt,jt,Ot,Oa.numFeatures,Oa.numPoints,Oa.numSimplified),console.timeEnd("creation"));var dt="z"+Lt;this.stats[dt]=(this.stats[dt]||0)+1,this.total++}if(Oa.source=Vt,gr){if(Lt===ga.maxZoom||Lt===gr)continue;var vt=1<1&&console.time("clipping");var Lr=.5*ga.buffer/ga.extent,Er=.5-Lr,_r=.5+Lr,yr=1+Lr,kr,zr,Pr,Hr,Zr,Jr;kr=zr=Pr=Hr=null,Zr=pt(Vt,Pa,jt-Lr,jt+_r,0,Oa.minX,Oa.maxX,ga),Jr=pt(Vt,Pa,jt+Er,jt+yr,0,Oa.minX,Oa.maxX,ga),Vt=null,Zr&&(kr=pt(Zr,Pa,Ot-Lr,Ot+_r,1,Oa.minY,Oa.maxY,ga),zr=pt(Zr,Pa,Ot+Er,Ot+yr,1,Oa.minY,Oa.maxY,ga),Zr=null),Jr&&(Pr=pt(Jr,Pa,Ot-Lr,Ot+_r,1,Oa.minY,Oa.maxY,ga),Hr=pt(Jr,Pa,Ot+Er,Ot+yr,1,Oa.minY,Oa.maxY,ga),Jr=null),Aa>1&&console.timeEnd("clipping"),Ur.push(kr||[],Lt+1,jt*2,Ot*2),Ur.push(zr||[],Lt+1,jt*2,Ot*2+1),Ur.push(Pr||[],Lt+1,jt*2+1,Ot*2),Ur.push(Hr||[],Lt+1,jt*2+1,Ot*2+1)}}},da.prototype.getTile=function(Vt,Lt,jt){var Ot=this.options,gr=Ot.extent,Br=Ot.debug;if(Vt<0||Vt>24)return null;var na=1<1&&console.log("drilling down to z%d-%d-%d",Vt,Lt,jt);for(var ga=Vt,Aa=Lt,Pa=jt,sa;!sa&&ga>0;)ga--,Aa=Math.floor(Aa/2),Pa=Math.floor(Pa/2),sa=this.tiles[wa(ga,Aa,Pa)];return!sa||!sa.source?null:(Br>1&&console.log("found parent tile z%d-%d-%d",ga,Aa,Pa),Br>1&&console.time("drilling down"),this.splitTile(sa.source,ga,Aa,Pa,Vt,Lt,jt),Br>1&&console.timeEnd("drilling down"),this.tiles[Ur]?Mt(this.tiles[Ur],gr):null)};function wa(Vt,Lt,jt){return((1<=0?0:ye.button},r.remove=function(ye){ye.parentNode&&ye.parentNode.removeChild(ye)};function h(ye,W,de){var te,me,Ue,tt=e.browser.devicePixelRatio>1?"@2x":"",ft=e.getJSON(W.transformRequest(W.normalizeSpriteURL(ye,tt,".json"),e.ResourceType.SpriteJSON),function(It,Jt){ft=null,Ue||(Ue=It,te=Jt,bt())}),st=e.getImage(W.transformRequest(W.normalizeSpriteURL(ye,tt,".png"),e.ResourceType.SpriteImage),function(It,Jt){st=null,Ue||(Ue=It,me=Jt,bt())});function bt(){if(Ue)de(Ue);else if(te&&me){var It=e.browser.getImageData(me),Jt={};for(var Kt in te){var vr=te[Kt],Tr=vr.width,wr=vr.height,tr=vr.x,pr=vr.y,xr=vr.sdf,ea=vr.pixelRatio,ha=vr.stretchX,Ea=vr.stretchY,tn=vr.content,Xa=new e.RGBAImage({width:Tr,height:wr});e.RGBAImage.copy(It,Xa,{x:tr,y:pr},{x:0,y:0},{width:Tr,height:wr}),Jt[Kt]={data:Xa,pixelRatio:ea,sdf:xr,stretchX:ha,stretchY:Ea,content:tn}}de(null,Jt)}}return{cancel:function(){ft&&(ft.cancel(),ft=null),st&&(st.cancel(),st=null)}}}function T(ye){var W=ye.userImage;if(W&&W.render){var de=W.render();if(de)return ye.data.replace(new Uint8Array(W.data.buffer)),!0}return!1}var l=1,y=function(ye){function W(){ye.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.isLoaded=function(){return this.loaded},W.prototype.setLoaded=function(te){if(this.loaded!==te&&(this.loaded=te,te)){for(var me=0,Ue=this.requestors;me=0?1.2:1))}w.prototype.draw=function(ye){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(ye,this.buffer,this.middle);for(var W=this.ctx.getImageData(0,0,this.size,this.size),de=new Uint8ClampedArray(this.size*this.size),te=0;te65535){It(new Error("glyphs > 65535 not supported"));return}if(vr.ranges[wr]){It(null,{stack:Jt,id:Kt,glyph:Tr});return}var tr=vr.requests[wr];tr||(tr=vr.requests[wr]=[],g.loadGlyphRange(Jt,wr,te.url,te.requestManager,function(pr,xr){if(xr){for(var ea in xr)te._doesCharSupportLocalGlyph(+ea)||(vr.glyphs[+ea]=xr[+ea]);vr.ranges[wr]=!0}for(var ha=0,Ea=tr;ha1&&(bt=W[++st]);var Jt=Math.abs(It-bt.left),Kt=Math.abs(It-bt.right),vr=Math.min(Jt,Kt),Tr=void 0,wr=Ue/te*(me+1);if(bt.isDash){var tr=me-Math.abs(wr);Tr=Math.sqrt(vr*vr+tr*tr)}else Tr=me-Math.sqrt(vr*vr+wr*wr);this.data[ft+It]=Math.max(0,Math.min(255,Tr+128))}},F.prototype.addRegularDash=function(W){for(var de=W.length-1;de>=0;--de){var te=W[de],me=W[de+1];te.zeroLength?W.splice(de,1):me&&me.isDash===te.isDash&&(me.left=te.left,W.splice(de,1))}var Ue=W[0],tt=W[W.length-1];Ue.isDash===tt.isDash&&(Ue.left=tt.left-this.width,tt.right=Ue.right+this.width);for(var ft=this.width*this.nextRow,st=0,bt=W[st],It=0;It1&&(bt=W[++st]);var Jt=Math.abs(It-bt.left),Kt=Math.abs(It-bt.right),vr=Math.min(Jt,Kt),Tr=bt.isDash?vr:-vr;this.data[ft+It]=Math.max(0,Math.min(255,Tr+128))}},F.prototype.addDash=function(W,de){var te=de?7:0,me=2*te+1;if(this.nextRow+me>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var Ue=0,tt=0;tt=te.minX&&W.x=te.minY&&W.y0&&(It[new e.OverscaledTileID(te.overscaledZ,ft,me.z,tt,me.y-1).key]={backfilled:!1},It[new e.OverscaledTileID(te.overscaledZ,te.wrap,me.z,me.x,me.y-1).key]={backfilled:!1},It[new e.OverscaledTileID(te.overscaledZ,bt,me.z,st,me.y-1).key]={backfilled:!1}),me.y+10&&(Ue.resourceTiming=te._resourceTiming,te._resourceTiming=[]),te.fire(new e.Event("data",Ue))})},W.prototype.onAdd=function(te){this.map=te,this.load()},W.prototype.setData=function(te){var me=this;return this._data=te,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(Ue){if(Ue){me.fire(new e.ErrorEvent(Ue));return}var tt={dataType:"source",sourceDataType:"content"};me._collectResourceTiming&&me._resourceTiming&&me._resourceTiming.length>0&&(tt.resourceTiming=me._resourceTiming,me._resourceTiming=[]),me.fire(new e.Event("data",tt))}),this},W.prototype.getClusterExpansionZoom=function(te,me){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:te,source:this.id},me),this},W.prototype.getClusterChildren=function(te,me){return this.actor.send("geojson.getClusterChildren",{clusterId:te,source:this.id},me),this},W.prototype.getClusterLeaves=function(te,me,Ue,tt){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:te,limit:me,offset:Ue},tt),this},W.prototype._updateWorkerData=function(te){var me=this;this._loaded=!1;var Ue=e.extend({},this.workerOptions),tt=this._data;typeof tt=="string"?(Ue.request=this.map._requestManager.transformRequest(e.browser.resolveURL(tt),e.ResourceType.Source),Ue.request.collectResourceTiming=this._collectResourceTiming):Ue.data=JSON.stringify(tt),this.actor.send(this.type+".loadData",Ue,function(ft,st){me._removed||st&&st.abandoned||(me._loaded=!0,st&&st.resourceTiming&&st.resourceTiming[me.id]&&(me._resourceTiming=st.resourceTiming[me.id].slice(0)),me.actor.send(me.type+".coalesce",{source:Ue.source},null),te(ft))})},W.prototype.loaded=function(){return this._loaded},W.prototype.loadTile=function(te,me){var Ue=this,tt=te.actor?"reloadTile":"loadTile";te.actor=this.actor;var ft={type:this.type,uid:te.uid,tileID:te.tileID,zoom:te.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};te.request=this.actor.send(tt,ft,function(st,bt){return delete te.request,te.unloadVectorData(),te.aborted?me(null):st?me(st):(te.loadVectorData(bt,Ue.map.painter,tt==="reloadTile"),me(null))})},W.prototype.abortTile=function(te){te.request&&(te.request.cancel(),delete te.request),te.aborted=!0},W.prototype.unloadTile=function(te){te.unloadVectorData(),this.actor.send("removeTile",{uid:te.uid,type:this.type,source:this.id})},W.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},W.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},W.prototype.hasTransition=function(){return!1},W}(e.Evented),ue=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),oe=function(ye){function W(de,te,me,Ue){ye.call(this),this.id=de,this.dispatcher=me,this.coordinates=te.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Ue),this.options=te}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.load=function(te,me){var Ue=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),function(tt,ft){Ue._loaded=!0,tt?Ue.fire(new e.ErrorEvent(tt)):ft&&(Ue.image=ft,te&&(Ue.coordinates=te),me&&me(),Ue._finishLoading())})},W.prototype.loaded=function(){return this._loaded},W.prototype.updateImage=function(te){var me=this;return!this.image||!te.url?this:(this.options.url=te.url,this.load(te.coordinates,function(){me.texture=null}),this)},W.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},W.prototype.onAdd=function(te){this.map=te,this.load()},W.prototype.setCoordinates=function(te){var me=this;this.coordinates=te;var Ue=te.map(e.MercatorCoordinate.fromLngLat);this.tileID=le(Ue),this.minzoom=this.maxzoom=this.tileID.z;var tt=Ue.map(function(ft){return me.tileID.getTilePoint(ft)._round()});return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(tt[0].x,tt[0].y,0,0),this._boundsArray.emplaceBack(tt[1].x,tt[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(tt[3].x,tt[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(tt[2].x,tt[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},W.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var te=this.map.painter.context,me=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,ue.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(te,this.image,me.RGBA),this.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE));for(var Ue in this.tiles){var tt=this.tiles[Ue];tt.state!=="loaded"&&(tt.state="loaded",tt.texture=this.texture)}}},W.prototype.loadTile=function(te,me){this.tileID&&this.tileID.equals(te.tileID.canonical)?(this.tiles[String(te.tileID.wrap)]=te,te.buckets={},me(null)):(te.state="errored",me(null))},W.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},W.prototype.hasTransition=function(){return!1},W}(e.Evented);function le(ye){for(var W=1/0,de=1/0,te=-1/0,me=-1/0,Ue=0,tt=ye;Ueme.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+me.start(0)+" and "+me.end(0)+"-second mark."))):this.video.currentTime=te}},W.prototype.getVideo=function(){return this.video},W.prototype.onAdd=function(te){this.map||(this.map=te,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},W.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var te=this.map.painter.context,me=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,ue.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE),me.texSubImage2D(me.TEXTURE_2D,0,0,0,me.RGBA,me.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(te,this.video,me.RGBA),this.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE));for(var Ue in this.tiles){var tt=this.tiles[Ue];tt.state!=="loaded"&&(tt.state="loaded",tt.texture=this.texture)}}},W.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},W.prototype.hasTransition=function(){return this.video&&!this.video.paused},W}(oe),J=function(ye){function W(de,te,me,Ue){ye.call(this,de,te,me,Ue),te.coordinates?(!Array.isArray(te.coordinates)||te.coordinates.length!==4||te.coordinates.some(function(tt){return!Array.isArray(tt)||tt.length!==2||tt.some(function(ft){return typeof ft!="number"})}))&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+de,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+de,null,'missing required property "coordinates"'))),te.animate&&typeof te.animate!="boolean"&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+de,null,'optional "animate" property must be a boolean value'))),te.canvas?typeof te.canvas!="string"&&!(te.canvas instanceof e.window.HTMLCanvasElement)&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+de,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+de,null,'missing required property "canvas"'))),this.options=te,this.animate=te.animate!==void 0?te.animate:!0}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},W.prototype.getCanvas=function(){return this.canvas},W.prototype.onAdd=function(te){this.map=te,this.load(),this.canvas&&this.animate&&this.play()},W.prototype.onRemove=function(){this.pause()},W.prototype.prepare=function(){var te=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,te=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,te=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var me=this.map.painter.context,Ue=me.gl;this.boundsBuffer||(this.boundsBuffer=me.createVertexBuffer(this._boundsArray,ue.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(te||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(me,this.canvas,Ue.RGBA,{premultiply:!0});for(var tt in this.tiles){var ft=this.tiles[tt];ft.state!=="loaded"&&(ft.state="loaded",ft.texture=this.texture)}}},W.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},W.prototype.hasTransition=function(){return this._playing},W.prototype._hasInvalidDimensions=function(){for(var te=0,me=[this.canvas.width,this.canvas.height];tethis.max){var ft=this._getAndRemoveByKey(this.order[0]);ft&&this.onRemove(ft)}return this},Ce.prototype.has=function(W){return W.wrapped().key in this.data},Ce.prototype.getAndRemove=function(W){return this.has(W)?this._getAndRemoveByKey(W.wrapped().key):null},Ce.prototype._getAndRemoveByKey=function(W){var de=this.data[W].shift();return de.timeout&&clearTimeout(de.timeout),this.data[W].length===0&&delete this.data[W],this.order.splice(this.order.indexOf(W),1),de.value},Ce.prototype.getByKey=function(W){var de=this.data[W];return de?de[0].value:null},Ce.prototype.get=function(W){if(!this.has(W))return null;var de=this.data[W.wrapped().key][0];return de.value},Ce.prototype.remove=function(W,de){if(!this.has(W))return this;var te=W.wrapped().key,me=de===void 0?0:this.data[te].indexOf(de),Ue=this.data[te][me];return this.data[te].splice(me,1),Ue.timeout&&clearTimeout(Ue.timeout),this.data[te].length===0&&delete this.data[te],this.onRemove(Ue.value),this.order.splice(this.order.indexOf(te),1),this},Ce.prototype.setMaxSize=function(W){for(this.max=W;this.order.length>this.max;){var de=this._getAndRemoveByKey(this.order[0]);de&&this.onRemove(de)}return this},Ce.prototype.filter=function(W){var de=[];for(var te in this.data)for(var me=0,Ue=this.data[te];me1||(Math.abs(Jt)>1&&(Math.abs(Jt+vr)===1?Jt+=vr:Math.abs(Jt-vr)===1&&(Jt-=vr)),!(!It.dem||!bt.dem)&&(bt.dem.backfillBorder(It.dem,Jt,Kt),bt.neighboringTiles&&bt.neighboringTiles[Tr]&&(bt.neighboringTiles[Tr].backfilled=!0)))}},W.prototype.getTile=function(te){return this.getTileByID(te.key)},W.prototype.getTileByID=function(te){return this._tiles[te]},W.prototype._retainLoadedChildren=function(te,me,Ue,tt){for(var ft in this._tiles){var st=this._tiles[ft];if(!(tt[ft]||!st.hasData()||st.tileID.overscaledZ<=me||st.tileID.overscaledZ>Ue)){for(var bt=st.tileID;st&&st.tileID.overscaledZ>me+1;){var It=st.tileID.scaledTo(st.tileID.overscaledZ-1);st=this._tiles[It.key],st&&st.hasData()&&(bt=It)}for(var Jt=bt;Jt.overscaledZ>me;)if(Jt=Jt.scaledTo(Jt.overscaledZ-1),te[Jt.key]){tt[bt.key]=bt;break}}}},W.prototype.findLoadedParent=function(te,me){if(te.key in this._loadedParentTiles){var Ue=this._loadedParentTiles[te.key];return Ue&&Ue.tileID.overscaledZ>=me?Ue:null}for(var tt=te.overscaledZ-1;tt>=me;tt--){var ft=te.scaledTo(tt),st=this._getLoadedTile(ft);if(st)return st}},W.prototype._getLoadedTile=function(te){var me=this._tiles[te.key];if(me&&me.hasData())return me;var Ue=this._cache.getByKey(te.wrapped().key);return Ue},W.prototype.updateCacheSize=function(te){var me=Math.ceil(te.width/this._source.tileSize)+1,Ue=Math.ceil(te.height/this._source.tileSize)+1,tt=me*Ue,ft=5,st=Math.floor(tt*ft),bt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,st):st;this._cache.setMaxSize(bt)},W.prototype.handleWrapJump=function(te){var me=this._prevLng===void 0?te:this._prevLng,Ue=te-me,tt=Ue/360,ft=Math.round(tt);if(this._prevLng=te,ft){var st={};for(var bt in this._tiles){var It=this._tiles[bt];It.tileID=It.tileID.unwrapTo(It.tileID.wrap+ft),st[It.tileID.key]=It}this._tiles=st;for(var Jt in this._timers)clearTimeout(this._timers[Jt]),delete this._timers[Jt];for(var Kt in this._tiles){var vr=this._tiles[Kt];this._setTileReloadTimer(Kt,vr)}}},W.prototype.update=function(te){var me=this;if(this.transform=te,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(te),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var Ue;this.used?this._source.tileID?Ue=te.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(hn){return new e.OverscaledTileID(hn.canonical.z,hn.wrap,hn.canonical.z,hn.canonical.x,hn.canonical.y)}):(Ue=te.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(Ue=Ue.filter(function(hn){return me._source.hasTile(hn)}))):Ue=[];var tt=te.coveringZoomLevel(this._source),ft=Math.max(tt-W.maxOverzooming,this._source.minzoom),st=Math.max(tt+W.maxUnderzooming,this._source.minzoom),bt=this._updateRetainedTiles(Ue,tt);if(ga(this._source.type)){for(var It={},Jt={},Kt=Object.keys(bt),vr=0,Tr=Kt;vrthis._source.maxzoom){var xr=tr.children(this._source.maxzoom)[0],ea=this.getTile(xr);if(ea&&ea.hasData()){Ue[xr.key]=xr;continue}}else{var ha=tr.children(this._source.maxzoom);if(Ue[ha[0].key]&&Ue[ha[1].key]&&Ue[ha[2].key]&&Ue[ha[3].key])continue}for(var Ea=pr.wasRequested(),tn=tr.overscaledZ-1;tn>=ft;--tn){var Xa=tr.scaledTo(tn);if(tt[Xa.key]||(tt[Xa.key]=!0,pr=this.getTile(Xa),!pr&&Ea&&(pr=this._addTile(Xa)),pr&&(Ue[Xa.key]=Xa,Ea=pr.wasRequested(),pr.hasData())))break}}}return Ue},W.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var te in this._tiles){for(var me=[],Ue=void 0,tt=this._tiles[te].tileID;tt.overscaledZ>0;){if(tt.key in this._loadedParentTiles){Ue=this._loadedParentTiles[tt.key];break}me.push(tt.key);var ft=tt.scaledTo(tt.overscaledZ-1);if(Ue=this._getLoadedTile(ft),Ue)break;tt=ft}for(var st=0,bt=me;st0)&&(me.hasData()&&me.state!=="reloading"?this._cache.add(me.tileID,me,me.getExpiryTimeout()):(me.aborted=!0,this._abortTile(me),this._unloadTile(me))))},W.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var te in this._tiles)this._removeTile(te);this._cache.reset()},W.prototype.tilesIn=function(te,me,Ue){var tt=this,ft=[],st=this.transform;if(!st)return ft;for(var bt=Ue?st.getCameraQueryGeometry(te):te,It=te.map(function(tn){return st.pointCoordinate(tn)}),Jt=bt.map(function(tn){return st.pointCoordinate(tn)}),Kt=this.getIds(),vr=1/0,Tr=1/0,wr=-1/0,tr=-1/0,pr=0,xr=Jt;pr=0&&xn[1].y+hn>=0){var fn=It.map(function(Yn){return Ya.getTilePoint(Yn)}),En=Jt.map(function(Yn){return Ya.getTilePoint(Yn)});ft.push({tile:Xa,tileID:Ya,queryGeometry:fn,cameraQueryGeometry:En,scale:an})}}},Ea=0;Ea=e.browser.now())return!0}return!1},W.prototype.setFeatureState=function(te,me,Ue){te=te||"_geojsonTileLayer",this._state.updateState(te,me,Ue)},W.prototype.removeFeatureState=function(te,me,Ue){te=te||"_geojsonTileLayer",this._state.removeFeatureState(te,me,Ue)},W.prototype.getFeatureState=function(te,me){return te=te||"_geojsonTileLayer",this._state.getState(te,me)},W.prototype.setDependencies=function(te,me,Ue){var tt=this._tiles[te];tt&&tt.setDependencies(me,Ue)},W.prototype.reloadTilesForDependencies=function(te,me){for(var Ue in this._tiles){var tt=this._tiles[Ue];tt.hasDependency(te,me)&&this._reloadTile(Ue,"reloading")}this._cache.filter(function(ft){return!ft.hasDependency(te,me)})},W}(e.Evented);na.maxOverzooming=10,na.maxUnderzooming=3;function Ur(ye,W){var de=Math.abs(ye.wrap*2)-+(ye.wrap<0),te=Math.abs(W.wrap*2)-+(W.wrap<0);return ye.overscaledZ-W.overscaledZ||te-de||W.canonical.y-ye.canonical.y||W.canonical.x-ye.canonical.x}function ga(ye){return ye==="raster"||ye==="image"||ye==="video"}function Aa(){return new e.window.Worker(ls.workerUrl)}var Pa="mapboxgl_preloaded_worker_pool",sa=function(){this.active={}};sa.prototype.acquire=function(W){if(!this.workers)for(this.workers=[];this.workers.length0?(me-tt)/ft:0;return this.points[Ue].mult(1-st).add(this.points[de].mult(st))};var ra=function(W,de,te){var me=this.boxCells=[],Ue=this.circleCells=[];this.xCellCount=Math.ceil(W/te),this.yCellCount=Math.ceil(de/te);for(var tt=0;ttthis.width||me<0||de>this.height)return Ue?!1:[];var ft=[];if(W<=0&&de<=0&&this.width<=te&&this.height<=me){if(Ue)return!0;for(var st=0;st0:ft}},ra.prototype._queryCircle=function(W,de,te,me,Ue){var tt=W-te,ft=W+te,st=de-te,bt=de+te;if(ft<0||tt>this.width||bt<0||st>this.height)return me?!1:[];var It=[],Jt={hitTest:me,circle:{x:W,y:de,radius:te},seenUids:{box:{},circle:{}}};return this._forEachCell(tt,st,ft,bt,this._queryCellCircle,It,Jt,Ue),me?It.length>0:It},ra.prototype.query=function(W,de,te,me,Ue){return this._query(W,de,te,me,!1,Ue)},ra.prototype.hitTest=function(W,de,te,me,Ue){return this._query(W,de,te,me,!0,Ue)},ra.prototype.hitTestCircle=function(W,de,te,me){return this._queryCircle(W,de,te,!0,me)},ra.prototype._queryCell=function(W,de,te,me,Ue,tt,ft,st){var bt=ft.seenUids,It=this.boxCells[Ue];if(It!==null)for(var Jt=this.bboxes,Kt=0,vr=It;Kt=Jt[wr+0]&&me>=Jt[wr+1]&&(!st||st(this.boxKeys[Tr]))){if(ft.hitTest)return tt.push(!0),!0;tt.push({key:this.boxKeys[Tr],x1:Jt[wr],y1:Jt[wr+1],x2:Jt[wr+2],y2:Jt[wr+3]})}}}var tr=this.circleCells[Ue];if(tr!==null)for(var pr=this.circles,xr=0,ea=tr;xrft*ft+st*st},ra.prototype._circleAndRectCollide=function(W,de,te,me,Ue,tt,ft){var st=(tt-me)/2,bt=Math.abs(W-(me+st));if(bt>st+te)return!1;var It=(ft-Ue)/2,Jt=Math.abs(de-(Ue+It));if(Jt>It+te)return!1;if(bt<=st||Jt<=It)return!0;var Kt=bt-st,vr=Jt-It;return Kt*Kt+vr*vr<=te*te};function pa(ye,W,de,te,me){var Ue=e.create();return W?(e.scale(Ue,Ue,[1/me,1/me,1]),de||e.rotateZ(Ue,Ue,te.angle)):e.multiply(Ue,te.labelPlaneMatrix,ye),Ue}function pn(ye,W,de,te,me){if(W){var Ue=e.clone(ye);return e.scale(Ue,Ue,[me,me,1]),de||e.rotateZ(Ue,Ue,-te.angle),Ue}else return te.glCoordMatrix}function Ga(ye,W){var de=[ye.x,ye.y,0,1];Wo(de,de,W);var te=de[3];return{point:new e.Point(de[0]/te,de[1]/te),signedDistanceFromCamera:te}}function qn(ye,W){return .5+.5*(ye/W)}function Vn(ye,W){var de=ye[0]/ye[3],te=ye[1]/ye[3],me=de>=-W[0]&&de<=W[0]&&te>=-W[1]&&te<=W[1];return me}function di(ye,W,de,te,me,Ue,tt,ft){var st=te?ye.textSizeData:ye.iconSizeData,bt=e.evaluateSizeForZoom(st,de.transform.zoom),It=[256/de.width*2+1,256/de.height*2+1],Jt=te?ye.text.dynamicLayoutVertexArray:ye.icon.dynamicLayoutVertexArray;Jt.clear();for(var Kt=ye.lineVertexArray,vr=te?ye.text.placedSymbolArray:ye.icon.placedSymbolArray,Tr=de.transform.width/de.transform.height,wr=!1,tr=0;trUe)return{useVertical:!0}}return(ye===e.WritingMode.vertical?W.yde.x)?{needsFlipping:!0}:null}function ci(ye,W,de,te,me,Ue,tt,ft,st,bt,It,Jt,Kt,vr){var Tr=W/24,wr=ye.lineOffsetX*Tr,tr=ye.lineOffsetY*Tr,pr;if(ye.numGlyphs>1){var xr=ye.glyphStartIndex+ye.numGlyphs,ea=ye.lineStartIndex,ha=ye.lineStartIndex+ye.lineLength,Ea=yi(Tr,ft,wr,tr,de,It,Jt,ye,st,Ue,Kt);if(!Ea)return{notEnoughRoom:!0};var tn=Ga(Ea.first.point,tt).point,Xa=Ga(Ea.last.point,tt).point;if(te&&!de){var Ya=Ci(ye.writingMode,tn,Xa,vr);if(Ya)return Ya}pr=[Ea.first];for(var an=ye.glyphStartIndex+1;an0?En.point:ei(Jt,fn,hn,1,me),vi=Ci(ye.writingMode,hn,Yn,vr);if(vi)return vi}var ai=mi(Tr*ft.getoffsetX(ye.glyphStartIndex),wr,tr,de,It,Jt,ye.segment,ye.lineStartIndex,ye.lineStartIndex+ye.lineLength,st,Ue,Kt);if(!ai)return{notEnoughRoom:!0};pr=[ai]}for(var Io=0,yo=pr;Io0?1:-1,Tr=0;te&&(vr*=-1,Tr=Math.PI),vr<0&&(Tr+=Math.PI);for(var wr=vr>0?ft+tt:ft+tt+1,tr=me,pr=me,xr=0,ea=0,ha=Math.abs(Kt),Ea=[];xr+ea<=ha;){if(wr+=vr,wr=st)return null;if(pr=tr,Ea.push(tr),tr=Jt[wr],tr===void 0){var tn=new e.Point(bt.getx(wr),bt.gety(wr)),Xa=Ga(tn,It);if(Xa.signedDistanceFromCamera>0)tr=Jt[wr]=Xa.point;else{var Ya=wr-vr,an=xr===0?Ue:new e.Point(bt.getx(Ya),bt.gety(Ya));tr=ei(an,tn,pr,ha-xr+1,It)}}xr+=ea,ea=pr.dist(tr)}var hn=(ha-xr)/ea,xn=tr.sub(pr),fn=xn.mult(hn)._add(pr);fn._add(xn._unit()._perp()._mult(de*vr));var En=Tr+Math.atan2(tr.y-pr.y,tr.x-pr.x);return Ea.push(fn),{point:fn,angle:En,path:Ea}}var uo=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Lo(ye,W){for(var de=0;de=1;vs--)yo.push(ai.path[vs]);for(var us=1;us0){for(var Uo=yo[0].clone(),Vs=yo[0].clone(),Fu=1;Fu=En.x&&Vs.x<=Yn.x&&Uo.y>=En.y&&Vs.y<=Yn.y?ul=[yo]:Vs.xYn.x||Vs.yYn.y?ul=[]:ul=e.clipLine([yo],En.x,En.y,Yn.x,Yn.y)}for(var fc=0,dh=ul;fc=this.screenRightBoundary||methis.screenBottomBoundary},Ii.prototype.isInsideGrid=function(W,de,te,me){return te>=0&&W=0&&de0){var ha;return this.prevPlacement&&this.prevPlacement.variableOffsets[Kt.crossTileID]&&this.prevPlacement.placements[Kt.crossTileID]&&this.prevPlacement.placements[Kt.crossTileID].text&&(ha=this.prevPlacement.variableOffsets[Kt.crossTileID].anchor),this.variableOffsets[Kt.crossTileID]={textOffset:tr,width:te,height:me,anchor:W,textBoxScale:Ue,prevAnchor:ha},this.markUsedJustification(vr,W,Kt,Tr),vr.allowVerticalPlacement&&(this.markUsedOrientation(vr,Tr,Kt),this.placedOrientations[Kt.crossTileID]=Tr),{shift:pr,placedGlyphBoxes:xr}}},Co.prototype.placeLayerBucketPart=function(W,de,te){var me=this,Ue=W.parameters,tt=Ue.bucket,ft=Ue.layout,st=Ue.posMatrix,bt=Ue.textLabelPlaneMatrix,It=Ue.labelToScreenMatrix,Jt=Ue.textPixelRatio,Kt=Ue.holdingForFade,vr=Ue.collisionBoxArray,Tr=Ue.partiallyEvaluatedTextSize,wr=Ue.collisionGroup,tr=ft.get("text-optional"),pr=ft.get("icon-optional"),xr=ft.get("text-allow-overlap"),ea=ft.get("icon-allow-overlap"),ha=ft.get("text-rotation-alignment")==="map",Ea=ft.get("text-pitch-alignment")==="map",tn=ft.get("icon-text-fit")!=="none",Xa=ft.get("symbol-z-order")==="viewport-y",Ya=xr&&(ea||!tt.hasIconData()||pr),an=ea&&(xr||!tt.hasTextData()||tr);!tt.collisionArrays&&vr&&tt.deserializeCollisionBoxes(vr);var hn=function(ai,Io){if(!de[ai.crossTileID]){if(Kt){me.placements[ai.crossTileID]=new Ro(!1,!1,!1);return}var yo=!1,vs=!1,us=!0,Ds=null,rs={box:null,offscreen:null},ul={box:null,offscreen:null},Uo=null,Vs=null,Fu=null,fc=0,dh=0,ph=0;Io.textFeatureIndex?fc=Io.textFeatureIndex:ai.useRuntimeCollisionCircles&&(fc=ai.featureIndex),Io.verticalTextFeatureIndex&&(dh=Io.verticalTextFeatureIndex);var If=Io.textBox;if(If){var Mh=function(lu){var pl=e.WritingMode.horizontal;if(tt.allowVerticalPlacement&&!lu&&me.prevPlacement){var zf=me.prevPlacement.placedOrientations[ai.crossTileID];zf&&(me.placedOrientations[ai.crossTileID]=zf,pl=zf,me.markUsedOrientation(tt,pl,ai))}return pl},hv=function(lu,pl){if(tt.allowVerticalPlacement&&ai.numVerticalGlyphVertices>0&&Io.verticalTextBox)for(var zf=0,Kv=tt.writingModes;zf0&&(Xf=Xf.filter(function(lu){return lu!==Df.anchor}),Xf.unshift(Df.anchor))}var gh=function(lu,pl,zf){for(var Kv=lu.x2-lu.x1,yd=lu.y2-lu.y1,Ml=ai.textBoxScale,cp=tn&&!ea?pl:null,Pv={box:[],offscreen:!1},$p=xr?Xf.length*2:Xf.length,mh=0;mh<$p;++mh){var Iv=Xf[mh%Xf.length],Qp=mh>=Xf.length,fp=me.attemptAnchorPlacement(Iv,lu,Kv,yd,Ml,ha,Ea,Jt,st,wr,Qp,ai,tt,zf,cp);if(fp&&(Pv=fp.placedGlyphBoxes,Pv&&Pv.box&&Pv.box.length)){yo=!0,Ds=fp.shift;break}}return Pv},Eh=function(){return gh(If,Io.iconBox,e.WritingMode.horizontal)},yh=function(){var lu=Io.verticalTextBox,pl=rs&&rs.box&&rs.box.length;return tt.allowVerticalPlacement&&!pl&&ai.numVerticalGlyphVertices>0&&lu?gh(lu,Io.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}};hv(Eh,yh),rs&&(yo=rs.box,us=rs.offscreen);var Zv=Mh(rs&&rs.box);if(!yo&&me.prevPlacement){var vv=me.prevPlacement.variableOffsets[ai.crossTileID];vv&&(me.variableOffsets[ai.crossTileID]=vv,me.markUsedJustification(tt,vv.anchor,ai,Zv))}}else{var Rh=function(lu,pl){var zf=me.collisionIndex.placeCollisionBox(lu,xr,Jt,st,wr.predicate);return zf&&zf.box&&zf.box.length&&(me.markUsedOrientation(tt,pl,ai),me.placedOrientations[ai.crossTileID]=pl),zf},Rf=function(){return Rh(If,e.WritingMode.horizontal)},Dh=function(){var lu=Io.verticalTextBox;return tt.allowVerticalPlacement&&ai.numVerticalGlyphVertices>0&&lu?Rh(lu,e.WritingMode.vertical):{box:null,offscreen:null}};hv(Rf,Dh),Mh(rs&&rs.box&&rs.box.length)}}if(Uo=rs,yo=Uo&&Uo.box&&Uo.box.length>0,us=Uo&&Uo.offscreen,ai.useRuntimeCollisionCircles){var Pc=tt.text.placedSymbolArray.get(ai.centerJustifiedTextSymbolIndex),dv=e.evaluateSizeForFeature(tt.textSizeData,Tr,Pc),Xv=ft.get("text-padding"),of=ai.collisionCircleDiameter;Vs=me.collisionIndex.placeCollisionCircles(xr,Pc,tt.lineVertexArray,tt.glyphOffsetArray,dv,st,bt,It,te,Ea,wr.predicate,of,Xv),yo=xr||Vs.circles.length>0&&!Vs.collisionDetected,us=us&&Vs.offscreen}if(Io.iconFeatureIndex&&(ph=Io.iconFeatureIndex),Io.iconBox){var kv=function(lu){var pl=tn&&Ds?fs(lu,Ds.x,Ds.y,ha,Ea,me.transform.angle):lu;return me.collisionIndex.placeCollisionBox(pl,ea,Jt,st,wr.predicate)};ul&&ul.box&&ul.box.length&&Io.verticalIconBox?(Fu=kv(Io.verticalIconBox),vs=Fu.box.length>0):(Fu=kv(Io.iconBox),vs=Fu.box.length>0),us=us&&Fu.offscreen}var pd=tr||ai.numHorizontalGlyphVertices===0&&ai.numVerticalGlyphVertices===0,gd=pr||ai.numIconVertices===0;if(!pd&&!gd?vs=yo=vs&&yo:gd?pd||(vs=vs&&yo):yo=vs&&yo,yo&&Uo&&Uo.box&&(ul&&ul.box&&dh?me.collisionIndex.insertCollisionBox(Uo.box,ft.get("text-ignore-placement"),tt.bucketInstanceId,dh,wr.ID):me.collisionIndex.insertCollisionBox(Uo.box,ft.get("text-ignore-placement"),tt.bucketInstanceId,fc,wr.ID)),vs&&Fu&&me.collisionIndex.insertCollisionBox(Fu.box,ft.get("icon-ignore-placement"),tt.bucketInstanceId,ph,wr.ID),Vs&&(yo&&me.collisionIndex.insertCollisionCircles(Vs.circles,ft.get("text-ignore-placement"),tt.bucketInstanceId,fc,wr.ID),te)){var Yv=tt.bucketInstanceId,Cv=me.collisionCircleArrays[Yv];Cv===void 0&&(Cv=me.collisionCircleArrays[Yv]=new Li);for(var Lv=0;Lv=0;--fn){var En=xn[fn];hn(tt.symbolInstances.get(En),tt.collisionArrays[En])}else for(var Yn=W.symbolInstanceStart;Yn=0&&(tt>=0&&It!==tt?W.text.placedSymbolArray.get(It).crossTileID=0:W.text.placedSymbolArray.get(It).crossTileID=te.crossTileID)}},Co.prototype.markUsedOrientation=function(W,de,te){for(var me=de===e.WritingMode.horizontal||de===e.WritingMode.horizontalOnly?de:0,Ue=de===e.WritingMode.vertical?de:0,tt=[te.leftJustifiedTextSymbolIndex,te.centerJustifiedTextSymbolIndex,te.rightJustifiedTextSymbolIndex],ft=0,st=tt;ft0||Ea>0,hn=ea.numIconVertices>0,xn=me.placedOrientations[ea.crossTileID],fn=xn===e.WritingMode.vertical,En=xn===e.WritingMode.horizontal||xn===e.WritingMode.horizontalOnly;if(an){var Yn=Ks(Ya.text),vi=fn?Rn:Yn;Tr(W.text,ha,vi);var ai=En?Rn:Yn;Tr(W.text,Ea,ai);var Io=Ya.text.isHidden();[ea.rightJustifiedTextSymbolIndex,ea.centerJustifiedTextSymbolIndex,ea.leftJustifiedTextSymbolIndex].forEach(function(ph){ph>=0&&(W.text.placedSymbolArray.get(ph).hidden=Io||fn?1:0)}),ea.verticalPlacedTextSymbolIndex>=0&&(W.text.placedSymbolArray.get(ea.verticalPlacedTextSymbolIndex).hidden=Io||En?1:0);var yo=me.variableOffsets[ea.crossTileID];yo&&me.markUsedJustification(W,yo.anchor,ea,xn);var vs=me.placedOrientations[ea.crossTileID];vs&&(me.markUsedJustification(W,"left",ea,vs),me.markUsedOrientation(W,vs,ea))}if(hn){var us=Ks(Ya.icon),Ds=!(Kt&&ea.verticalPlacedIconSymbolIndex&&fn);if(ea.placedIconSymbolIndex>=0){var rs=Ds?us:Rn;Tr(W.icon,ea.numIconVertices,rs),W.icon.placedSymbolArray.get(ea.placedIconSymbolIndex).hidden=Ya.icon.isHidden()}if(ea.verticalPlacedIconSymbolIndex>=0){var ul=Ds?Rn:us;Tr(W.icon,ea.numVerticalIconVertices,ul),W.icon.placedSymbolArray.get(ea.verticalPlacedIconSymbolIndex).hidden=Ya.icon.isHidden()}}if(W.hasIconCollisionBoxData()||W.hasTextCollisionBoxData()){var Uo=W.collisionArrays[xr];if(Uo){var Vs=new e.Point(0,0);if(Uo.textBox||Uo.verticalTextBox){var Fu=!0;if(bt){var fc=me.variableOffsets[tn];fc?(Vs=as(fc.anchor,fc.width,fc.height,fc.textOffset,fc.textBoxScale),It&&Vs._rotate(Jt?me.transform.angle:-me.transform.angle)):Fu=!1}Uo.textBox&&Qa(W.textCollisionBox.collisionVertexArray,Ya.text.placed,!Fu||fn,Vs.x,Vs.y),Uo.verticalTextBox&&Qa(W.textCollisionBox.collisionVertexArray,Ya.text.placed,!Fu||En,Vs.x,Vs.y)}var dh=!!(!En&&Uo.verticalIconBox);Uo.iconBox&&Qa(W.iconCollisionBox.collisionVertexArray,Ya.icon.placed,dh,Kt?Vs.x:0,Kt?Vs.y:0),Uo.verticalIconBox&&Qa(W.iconCollisionBox.collisionVertexArray,Ya.icon.placed,!dh,Kt?Vs.x:0,Kt?Vs.y:0)}}},tr=0;trW},Co.prototype.setStale=function(){this.stale=!0};function Qa(ye,W,de,te,me){ye.emplaceBack(W?1:0,de?1:0,te||0,me||0),ye.emplaceBack(W?1:0,de?1:0,te||0,me||0),ye.emplaceBack(W?1:0,de?1:0,te||0,me||0),ye.emplaceBack(W?1:0,de?1:0,te||0,me||0)}var Jn=Math.pow(2,25),Os=Math.pow(2,24),ds=Math.pow(2,17),Ui=Math.pow(2,16),ms=Math.pow(2,9),Mo=Math.pow(2,8),ws=Math.pow(2,1);function Ks(ye){if(ye.opacity===0&&!ye.placed)return 0;if(ye.opacity===1&&ye.placed)return 4294967295;var W=ye.placed?1:0,de=Math.floor(ye.opacity*127);return de*Jn+W*Os+de*ds+W*Ui+de*ms+W*Mo+de*ws+W}var Rn=0,fo=function(W){this._sortAcrossTiles=W.layout.get("symbol-z-order")!=="viewport-y"&&W.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};fo.prototype.continuePlacement=function(W,de,te,me,Ue){for(var tt=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var ft=W[this._currentPlacementIndex],st=de[ft],bt=this.placement.collisionIndex.transform.zoom;if(st.type==="symbol"&&(!st.minzoom||st.minzoom<=bt)&&(!st.maxzoom||st.maxzoom>bt)){this._inProgressLayer||(this._inProgressLayer=new fo(st));var It=this._inProgressLayer.continuePlacement(te[st.source],this.placement,this._showCollisionBoxes,st,tt);if(It)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Pi.prototype.commit=function(W){return this.placement.commit(W),this.placement};var zo=512/e.EXTENT/2,wo=function(W,de,te){this.tileID=W,this.indexedSymbolInstances={},this.bucketInstanceId=te;for(var me=0;meW.overscaledZ)for(var bt in st){var It=st[bt];It.tileID.isChildOf(W)&&It.findMatches(de.symbolInstances,W,tt)}else{var Jt=W.scaledTo(Number(ft)),Kt=st[Jt.key];Kt&&Kt.findMatches(de.symbolInstances,W,tt)}}for(var vr=0;vr0)throw new Error("Unimplemented: "+tt.map(function(ft){return ft.command}).join(", ")+".");return Ue.forEach(function(ft){ft.command!=="setTransition"&&me[ft.command].apply(me,ft.args)}),this.stylesheet=te,!0},W.prototype.addImage=function(te,me){if(this.getImage(te))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(te,me),this._afterImageUpdated(te)},W.prototype.updateImage=function(te,me){this.imageManager.updateImage(te,me)},W.prototype.getImage=function(te){return this.imageManager.getImage(te)},W.prototype.removeImage=function(te){if(!this.getImage(te))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(te),this._afterImageUpdated(te)},W.prototype._afterImageUpdated=function(te){this._availableImages=this.imageManager.listImages(),this._changedImages[te]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},W.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},W.prototype.addSource=function(te,me,Ue){var tt=this;if(Ue===void 0&&(Ue={}),this._checkLoaded(),this.sourceCaches[te]!==void 0)throw new Error("There is already a source with this ID");if(!me.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(me).join(", ")+".");var ft=["vector","raster","geojson","video","image"],st=ft.indexOf(me.type)>=0;if(!(st&&this._validate(e.validateStyle.source,"sources."+te,me,null,Ue))){this.map&&this.map._collectResourceTiming&&(me.collectResourceTiming=!0);var bt=this.sourceCaches[te]=new na(te,me,this.dispatcher);bt.style=this,bt.setEventedParent(this,function(){return{isSourceLoaded:tt.loaded(),source:bt.serialize(),sourceId:te}}),bt.onAdd(this.map),this._changed=!0}},W.prototype.removeSource=function(te){if(this._checkLoaded(),this.sourceCaches[te]===void 0)throw new Error("There is no source with this ID");for(var me in this._layers)if(this._layers[me].source===te)return this.fire(new e.ErrorEvent(new Error('Source "'+te+'" cannot be removed while layer "'+me+'" is using it.')));var Ue=this.sourceCaches[te];delete this.sourceCaches[te],delete this._updatedSources[te],Ue.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:te})),Ue.setEventedParent(null),Ue.clearTiles(),Ue.onRemove&&Ue.onRemove(this.map),this._changed=!0},W.prototype.setGeoJSONSourceData=function(te,me){this._checkLoaded();var Ue=this.sourceCaches[te].getSource();Ue.setData(me),this._changed=!0},W.prototype.getSource=function(te){return this.sourceCaches[te]&&this.sourceCaches[te].getSource()},W.prototype.addLayer=function(te,me,Ue){Ue===void 0&&(Ue={}),this._checkLoaded();var tt=te.id;if(this.getLayer(tt)){this.fire(new e.ErrorEvent(new Error('Layer with id "'+tt+'" already exists on this map')));return}var ft;if(te.type==="custom"){if(Js(this,e.validateCustomStyleLayer(te)))return;ft=e.createStyleLayer(te)}else{if(typeof te.source=="object"&&(this.addSource(tt,te.source),te=e.clone$1(te),te=e.extend(te,{source:tt})),this._validate(e.validateStyle.layer,"layers."+tt,te,{arrayIndex:-1},Ue))return;ft=e.createStyleLayer(te),this._validateLayer(ft),ft.setEventedParent(this,{layer:{id:tt}}),this._serializedLayers[ft.id]=ft.serialize()}var st=me?this._order.indexOf(me):this._order.length;if(me&&st===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+me+'" does not exist on this map.')));return}if(this._order.splice(st,0,tt),this._layerOrderChanged=!0,this._layers[tt]=ft,this._removedLayers[tt]&&ft.source&&ft.type!=="custom"){var bt=this._removedLayers[tt];delete this._removedLayers[tt],bt.type!==ft.type?this._updatedSources[ft.source]="clear":(this._updatedSources[ft.source]="reload",this.sourceCaches[ft.source].pause())}this._updateLayer(ft),ft.onAdd&&ft.onAdd(this.map)},W.prototype.moveLayer=function(te,me){this._checkLoaded(),this._changed=!0;var Ue=this._layers[te];if(!Ue){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be moved.")));return}if(te!==me){var tt=this._order.indexOf(te);this._order.splice(tt,1);var ft=me?this._order.indexOf(me):this._order.length;if(me&&ft===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+me+'" does not exist on this map.')));return}this._order.splice(ft,0,te),this._layerOrderChanged=!0}},W.prototype.removeLayer=function(te){this._checkLoaded();var me=this._layers[te];if(!me){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be removed.")));return}me.setEventedParent(null);var Ue=this._order.indexOf(te);this._order.splice(Ue,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[te]=me,delete this._layers[te],delete this._serializedLayers[te],delete this._updatedLayers[te],delete this._updatedPaintProps[te],me.onRemove&&me.onRemove(this.map)},W.prototype.getLayer=function(te){return this._layers[te]},W.prototype.hasLayer=function(te){return te in this._layers},W.prototype.setLayerZoomRange=function(te,me,Ue){this._checkLoaded();var tt=this.getLayer(te);if(!tt){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot have zoom extent.")));return}tt.minzoom===me&&tt.maxzoom===Ue||(me!=null&&(tt.minzoom=me),Ue!=null&&(tt.maxzoom=Ue),this._updateLayer(tt))},W.prototype.setFilter=function(te,me,Ue){Ue===void 0&&(Ue={}),this._checkLoaded();var tt=this.getLayer(te);if(!tt){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be filtered.")));return}if(!e.deepEqual(tt.filter,me)){if(me==null){tt.filter=void 0,this._updateLayer(tt);return}this._validate(e.validateStyle.filter,"layers."+tt.id+".filter",me,null,Ue)||(tt.filter=e.clone$1(me),this._updateLayer(tt))}},W.prototype.getFilter=function(te){return e.clone$1(this.getLayer(te).filter)},W.prototype.setLayoutProperty=function(te,me,Ue,tt){tt===void 0&&(tt={}),this._checkLoaded();var ft=this.getLayer(te);if(!ft){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}e.deepEqual(ft.getLayoutProperty(me),Ue)||(ft.setLayoutProperty(me,Ue,tt),this._updateLayer(ft))},W.prototype.getLayoutProperty=function(te,me){var Ue=this.getLayer(te);if(!Ue){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style.")));return}return Ue.getLayoutProperty(me)},W.prototype.setPaintProperty=function(te,me,Ue,tt){tt===void 0&&(tt={}),this._checkLoaded();var ft=this.getLayer(te);if(!ft){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}if(!e.deepEqual(ft.getPaintProperty(me),Ue)){var st=ft.setPaintProperty(me,Ue,tt);st&&this._updateLayer(ft),this._changed=!0,this._updatedPaintProps[te]=!0}},W.prototype.getPaintProperty=function(te,me){return this.getLayer(te).getPaintProperty(me)},W.prototype.setFeatureState=function(te,me){this._checkLoaded();var Ue=te.source,tt=te.sourceLayer,ft=this.sourceCaches[Ue];if(ft===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+Ue+"' does not exist in the map's style.")));return}var st=ft.getSource().type;if(st==="geojson"&&tt){this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(st==="vector"&&!tt){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),ft.setFeatureState(tt,te.id,me)},W.prototype.removeFeatureState=function(te,me){this._checkLoaded();var Ue=te.source,tt=this.sourceCaches[Ue];if(tt===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+Ue+"' does not exist in the map's style.")));return}var ft=tt.getSource().type,st=ft==="vector"?te.sourceLayer:void 0;if(ft==="vector"&&!st){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(me&&typeof te.id!="string"&&typeof te.id!="number"){this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}tt.removeFeatureState(st,te.id,me)},W.prototype.getFeatureState=function(te){this._checkLoaded();var me=te.source,Ue=te.sourceLayer,tt=this.sourceCaches[me];if(tt===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+me+"' does not exist in the map's style.")));return}var ft=tt.getSource().type;if(ft==="vector"&&!Ue){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),tt.getFeatureState(Ue,te.id)},W.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},W.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,function(te){return te.serialize()}),layers:this._serializeLayers(this._order)},function(te){return te!==void 0})},W.prototype._updateLayer=function(te){this._updatedLayers[te.id]=!0,te.source&&!this._updatedSources[te.source]&&this.sourceCaches[te.source].getSource().type!=="raster"&&(this._updatedSources[te.source]="reload",this.sourceCaches[te.source].pause()),this._changed=!0},W.prototype._flattenAndSortRenderedFeatures=function(te){for(var me=this,Ue=function(En){return me._layers[En].type==="fill-extrusion"},tt={},ft=[],st=this._order.length-1;st>=0;st--){var bt=this._order[st];if(Ue(bt)){tt[bt]=st;for(var It=0,Jt=te;It=0;xr--){var ea=this._order[xr];if(Ue(ea))for(var ha=ft.length-1;ha>=0;ha--){var Ea=ft[ha].feature;if(tt[Ea.layer.id] 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;}`,hl=`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 +}`,yf=`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;}`,Jc=`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Uc="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;}",$u=`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 +}`,jc="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;}",$c=`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 +}`,bu=` +#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);}`,Qc=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +#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,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,sc=` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,wu=`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 +}`,eu=` +#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;}`,Sc=`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 +}`,ef=` +#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);}`,ps=`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 +}`,Vc="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;}",Zf=`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 +}`,mf=`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));}`,Mc=`#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 +}`,_f=`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);}`,tu=`#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 +}`,xf=`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);}`,Fl=Rs(Lu,Bu),ru=Rs(kf,gf),Uu=Rs(ns,_u),$s=Rs(Nc,ml),Qu=Rs(fl,_l),Tu=Rs(Yu,Ts),au=Rs(Tl,Ko),Ns=Rs(Cs,Nu),yc=Rs(Ul,Ku),Pu=Rs(Bs,Gf),ec=Rs(Eo,Wf),Ec=Rs(is,oo),Cf=Rs(pc,xu),nh=Rs(zl,Kc),lc=Rs(Ju,gc),kc=Rs(hl,yf),nu=Rs(Jc,Uc),tf=Rs($u,jc),Cl=Rs($c,bu),uc=Rs(Qc,sc),rf=Rs(wu,eu),mc=Rs(Sc,ef),Us=Rs(ps,Vc),vu=Rs(Zf,mf),du=Rs(Mc,_f),af=Rs(tu,xf);function Rs(ye,W){var de=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,te=W.match(/attribute ([\w]+) ([\w]+)/g),me=ye.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Ue=W.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),tt=Ue?Ue.concat(me):me,ft={};return ye=ye.replace(de,function(st,bt,It,Jt,Kt){return ft[Kt]=!0,bt==="define"?` +#ifndef HAS_UNIFORM_u_`+Kt+` +varying `+It+" "+Jt+" "+Kt+`; +#else +uniform `+It+" "+Jt+" u_"+Kt+`; +#endif +`:` +#ifdef HAS_UNIFORM_u_`+Kt+` + `+It+" "+Jt+" "+Kt+" = u_"+Kt+`; +#endif +`}),W=W.replace(de,function(st,bt,It,Jt,Kt){var vr=Jt==="float"?"vec2":"vec4",Tr=Kt.match(/color/)?"color":vr;return ft[Kt]?bt==="define"?` +#ifndef HAS_UNIFORM_u_`+Kt+` +uniform lowp float u_`+Kt+`_t; +attribute `+It+" "+vr+" a_"+Kt+`; +varying `+It+" "+Jt+" "+Kt+`; +#else +uniform `+It+" "+Jt+" u_"+Kt+`; +#endif +`:Tr==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Kt+` + `+Kt+" = a_"+Kt+`; +#else + `+It+" "+Jt+" "+Kt+" = u_"+Kt+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+Kt+` + `+Kt+" = unpack_mix_"+Tr+"(a_"+Kt+", u_"+Kt+`_t); +#else + `+It+" "+Jt+" "+Kt+" = u_"+Kt+`; +#endif +`:bt==="define"?` +#ifndef HAS_UNIFORM_u_`+Kt+` +uniform lowp float u_`+Kt+`_t; +attribute `+It+" "+vr+" a_"+Kt+`; +#else +uniform `+It+" "+Jt+" u_"+Kt+`; +#endif +`:Tr==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Kt+` + `+It+" "+Jt+" "+Kt+" = a_"+Kt+`; +#else + `+It+" "+Jt+" "+Kt+" = u_"+Kt+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+Kt+` + `+It+" "+Jt+" "+Kt+" = unpack_mix_"+Tr+"(a_"+Kt+", u_"+Kt+`_t); +#else + `+It+" "+Jt+" "+Kt+" = u_"+Kt+`; +#endif +`}),{fragmentSource:ye,vertexSource:W,staticAttributes:te,staticUniforms:tt}}var _c=Object.freeze({__proto__:null,prelude:Fl,background:ru,backgroundPattern:Uu,circle:$s,clippingMask:Qu,heatmap:Tu,heatmapTexture:au,collisionBox:Ns,collisionCircle:yc,debug:Pu,fill:ec,fillOutline:Ec,fillOutlinePattern:Cf,fillPattern:nh,fillExtrusion:lc,fillExtrusionPattern:kc,hillshadePrepare:nu,hillshade:tf,line:Cl,lineGradient:uc,linePattern:rf,lineSDF:mc,raster:Us,symbolIcon:vu,symbolSDF:du,symbolTextAndIcon:af}),ju=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};ju.prototype.bind=function(W,de,te,me,Ue,tt,ft,st){this.context=W;for(var bt=this.boundPaintVertexBuffers.length!==me.length,It=0;!bt&&It>16,ft>>16],u_pixel_coord_lower:[tt&65535,ft&65535]}}function bc(ye,W,de,te){var me=de.imageManager.getPattern(ye.from.toString()),Ue=de.imageManager.getPattern(ye.to.toString()),tt=de.imageManager.getPixelSize(),ft=tt.width,st=tt.height,bt=Math.pow(2,te.tileID.overscaledZ),It=te.tileSize*Math.pow(2,de.transform.tileZoom)/bt,Jt=It*(te.tileID.canonical.x+te.tileID.wrap*bt),Kt=It*te.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:me.tl,u_pattern_br_a:me.br,u_pattern_tl_b:Ue.tl,u_pattern_br_b:Ue.br,u_texsize:[ft,st],u_mix:W.t,u_pattern_size_a:me.displaySize,u_pattern_size_b:Ue.displaySize,u_scale_a:W.fromScale,u_scale_b:W.toScale,u_tile_units_to_pixels:1/xi(te,1,de.transform.tileZoom),u_pixel_coord_upper:[Jt>>16,Kt>>16],u_pixel_coord_lower:[Jt&65535,Kt&65535]}}var Lf=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_lightpos:new e.Uniform3f(ye,W.u_lightpos),u_lightintensity:new e.Uniform1f(ye,W.u_lightintensity),u_lightcolor:new e.Uniform3f(ye,W.u_lightcolor),u_vertical_gradient:new e.Uniform1f(ye,W.u_vertical_gradient),u_opacity:new e.Uniform1f(ye,W.u_opacity)}},xl=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_lightpos:new e.Uniform3f(ye,W.u_lightpos),u_lightintensity:new e.Uniform1f(ye,W.u_lightintensity),u_lightcolor:new e.Uniform3f(ye,W.u_lightcolor),u_vertical_gradient:new e.Uniform1f(ye,W.u_vertical_gradient),u_height_factor:new e.Uniform1f(ye,W.u_height_factor),u_image:new e.Uniform1i(ye,W.u_image),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ye,W.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ye,W.u_pixel_coord_lower),u_scale:new e.Uniform3f(ye,W.u_scale),u_fade:new e.Uniform1f(ye,W.u_fade),u_opacity:new e.Uniform1f(ye,W.u_opacity)}},nf=function(ye,W,de,te){var me=W.style.light,Ue=me.properties.get("position"),tt=[Ue.x,Ue.y,Ue.z],ft=e.create$1();me.properties.get("anchor")==="viewport"&&e.fromRotation(ft,-W.transform.angle),e.transformMat3(tt,tt,ft);var st=me.properties.get("color");return{u_matrix:ye,u_lightpos:tt,u_lightintensity:me.properties.get("intensity"),u_lightcolor:[st.r,st.g,st.b],u_vertical_gradient:+de,u_opacity:te}},ou=function(ye,W,de,te,me,Ue,tt){return e.extend(nf(ye,W,de,te),Iu(Ue,W,tt),{u_height_factor:-Math.pow(2,me.overscaledZ)/tt.tileSize/8})},Ru=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix)}},Au=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_image:new e.Uniform1i(ye,W.u_image),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ye,W.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ye,W.u_pixel_coord_lower),u_scale:new e.Uniform3f(ye,W.u_scale),u_fade:new e.Uniform1f(ye,W.u_fade)}},Zs=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_world:new e.Uniform2f(ye,W.u_world)}},Ol=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_world:new e.Uniform2f(ye,W.u_world),u_image:new e.Uniform1i(ye,W.u_image),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ye,W.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ye,W.u_pixel_coord_lower),u_scale:new e.Uniform3f(ye,W.u_scale),u_fade:new e.Uniform1f(ye,W.u_fade)}},bl=function(ye){return{u_matrix:ye}},tc=function(ye,W,de,te){return e.extend(bl(ye),Iu(de,W,te))},Su=function(ye,W){return{u_matrix:ye,u_world:W}},Cc=function(ye,W,de,te,me){return e.extend(tc(ye,W,de,te),{u_world:me})},Ht=function(ye,W){return{u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(ye,W.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(ye,W.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(ye,W.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix)}},ur=function(ye,W,de,te){var me=ye.transform,Ue,tt;if(te.paint.get("circle-pitch-alignment")==="map"){var ft=xi(de,1,me.zoom);Ue=!0,tt=[ft,ft]}else Ue=!1,tt=me.pixelsToGLUnits;return{u_camera_to_center_distance:me.cameraToCenterDistance,u_scale_with_map:+(te.paint.get("circle-pitch-scale")==="map"),u_matrix:ye.translatePosMatrix(W.posMatrix,de,te.paint.get("circle-translate"),te.paint.get("circle-translate-anchor")),u_pitch_with_map:+Ue,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:tt}},qr=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(ye,W.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(ye,W.u_extrude_scale),u_overscale_factor:new e.Uniform1f(ye,W.u_overscale_factor)}},Or=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_inv_matrix:new e.UniformMatrix4f(ye,W.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(ye,W.u_viewport_size)}},ua=function(ye,W,de){var te=xi(de,1,W.zoom),me=Math.pow(2,W.zoom-de.tileID.overscaledZ),Ue=de.tileID.overscaleFactor();return{u_matrix:ye,u_camera_to_center_distance:W.cameraToCenterDistance,u_pixels_to_tile_units:te,u_extrude_scale:[W.pixelsToGLUnits[0]/(te*me),W.pixelsToGLUnits[1]/(te*me)],u_overscale_factor:Ue}},Fa=function(ye,W,de){return{u_matrix:ye,u_inv_matrix:W,u_camera_to_center_distance:de.cameraToCenterDistance,u_viewport_size:[de.width,de.height]}},ja=function(ye,W){return{u_color:new e.UniformColor(ye,W.u_color),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_overlay:new e.Uniform1i(ye,W.u_overlay),u_overlay_scale:new e.Uniform1f(ye,W.u_overlay_scale)}},sn=function(ye,W,de){return de===void 0&&(de=1),{u_matrix:ye,u_color:W,u_overlay:0,u_overlay_scale:de}},gn=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix)}},kn=function(ye){return{u_matrix:ye}},Ja=function(ye,W){return{u_extrude_scale:new e.Uniform1f(ye,W.u_extrude_scale),u_intensity:new e.Uniform1f(ye,W.u_intensity),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix)}},_n=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_world:new e.Uniform2f(ye,W.u_world),u_image:new e.Uniform1i(ye,W.u_image),u_color_ramp:new e.Uniform1i(ye,W.u_color_ramp),u_opacity:new e.Uniform1f(ye,W.u_opacity)}},on=function(ye,W,de,te){return{u_matrix:ye,u_extrude_scale:xi(W,1,de),u_intensity:te}},Wa=function(ye,W,de,te){var me=e.create();e.ortho(me,0,ye.width,ye.height,0,0,1);var Ue=ye.context.gl;return{u_matrix:me,u_world:[Ue.drawingBufferWidth,Ue.drawingBufferHeight],u_image:de,u_color_ramp:te,u_opacity:W.paint.get("heatmap-opacity")}},On=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_image:new e.Uniform1i(ye,W.u_image),u_latrange:new e.Uniform2f(ye,W.u_latrange),u_light:new e.Uniform2f(ye,W.u_light),u_shadow:new e.UniformColor(ye,W.u_shadow),u_highlight:new e.UniformColor(ye,W.u_highlight),u_accent:new e.UniformColor(ye,W.u_accent)}},zi=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_image:new e.Uniform1i(ye,W.u_image),u_dimension:new e.Uniform2f(ye,W.u_dimension),u_zoom:new e.Uniform1f(ye,W.u_zoom),u_unpack:new e.Uniform4f(ye,W.u_unpack)}},ki=function(ye,W,de){var te=de.paint.get("hillshade-shadow-color"),me=de.paint.get("hillshade-highlight-color"),Ue=de.paint.get("hillshade-accent-color"),tt=de.paint.get("hillshade-illumination-direction")*(Math.PI/180);de.paint.get("hillshade-illumination-anchor")==="viewport"&&(tt-=ye.transform.angle);var ft=!ye.options.moving;return{u_matrix:ye.transform.calculatePosMatrix(W.tileID.toUnwrapped(),ft),u_image:0,u_latrange:Ni(ye,W.tileID),u_light:[de.paint.get("hillshade-exaggeration"),tt],u_shadow:te,u_highlight:me,u_accent:Ue}},ji=function(ye,W){var de=W.stride,te=e.create();return e.ortho(te,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(te,te,[0,-e.EXTENT,0]),{u_matrix:te,u_image:1,u_dimension:[de,de],u_zoom:ye.overscaledZ,u_unpack:W.getUnpackVector()}};function Ni(ye,W){var de=Math.pow(2,W.canonical.z),te=W.canonical.y;return[new e.MercatorCoordinate(0,te/de).toLngLat().lat,new e.MercatorCoordinate(0,(te+1)/de).toLngLat().lat]}var Bn=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_ratio:new e.Uniform1f(ye,W.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(ye,W.u_units_to_pixels)}},An=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_ratio:new e.Uniform1f(ye,W.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(ye,W.u_units_to_pixels),u_image:new e.Uniform1i(ye,W.u_image),u_image_height:new e.Uniform1f(ye,W.u_image_height)}},Ki=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_ratio:new e.Uniform1f(ye,W.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_image:new e.Uniform1i(ye,W.u_image),u_units_to_pixels:new e.Uniform2f(ye,W.u_units_to_pixels),u_scale:new e.Uniform3f(ye,W.u_scale),u_fade:new e.Uniform1f(ye,W.u_fade)}},ko=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_ratio:new e.Uniform1f(ye,W.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(ye,W.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(ye,W.u_patternscale_a),u_patternscale_b:new e.Uniform2f(ye,W.u_patternscale_b),u_sdfgamma:new e.Uniform1f(ye,W.u_sdfgamma),u_image:new e.Uniform1i(ye,W.u_image),u_tex_y_a:new e.Uniform1f(ye,W.u_tex_y_a),u_tex_y_b:new e.Uniform1f(ye,W.u_tex_y_b),u_mix:new e.Uniform1f(ye,W.u_mix)}},$o=function(ye,W,de){var te=ye.transform;return{u_matrix:il(ye,W,de),u_ratio:1/xi(W,1,te.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/te.pixelsToGLUnits[0],1/te.pixelsToGLUnits[1]]}},Ls=function(ye,W,de,te){return e.extend($o(ye,W,de),{u_image:0,u_image_height:te})},os=function(ye,W,de,te){var me=ye.transform,Ue=jo(W,me);return{u_matrix:il(ye,W,de),u_texsize:W.imageAtlasTexture.size,u_ratio:1/xi(W,1,me.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[Ue,te.fromScale,te.toScale],u_fade:te.t,u_units_to_pixels:[1/me.pixelsToGLUnits[0],1/me.pixelsToGLUnits[1]]}},As=function(ye,W,de,te,me){var Ue=ye.transform,tt=ye.lineAtlas,ft=jo(W,Ue),st=de.layout.get("line-cap")==="round",bt=tt.getDash(te.from,st),It=tt.getDash(te.to,st),Jt=bt.width*me.fromScale,Kt=It.width*me.toScale;return e.extend($o(ye,W,de),{u_patternscale_a:[ft/Jt,-bt.height/2],u_patternscale_b:[ft/Kt,-It.height/2],u_sdfgamma:tt.width/(Math.min(Jt,Kt)*256*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:bt.y,u_tex_y_b:It.y,u_mix:me.t})};function jo(ye,W){return 1/xi(ye,1,W.tileZoom)}function il(ye,W,de){return ye.translatePosMatrix(W.tileID.posMatrix,W,de.paint.get("line-translate"),de.paint.get("line-translate-anchor"))}var Qs=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_tl_parent:new e.Uniform2f(ye,W.u_tl_parent),u_scale_parent:new e.Uniform1f(ye,W.u_scale_parent),u_buffer_scale:new e.Uniform1f(ye,W.u_buffer_scale),u_fade_t:new e.Uniform1f(ye,W.u_fade_t),u_opacity:new e.Uniform1f(ye,W.u_opacity),u_image0:new e.Uniform1i(ye,W.u_image0),u_image1:new e.Uniform1i(ye,W.u_image1),u_brightness_low:new e.Uniform1f(ye,W.u_brightness_low),u_brightness_high:new e.Uniform1f(ye,W.u_brightness_high),u_saturation_factor:new e.Uniform1f(ye,W.u_saturation_factor),u_contrast_factor:new e.Uniform1f(ye,W.u_contrast_factor),u_spin_weights:new e.Uniform3f(ye,W.u_spin_weights)}},Ss=function(ye,W,de,te,me){return{u_matrix:ye,u_tl_parent:W,u_scale_parent:de,u_buffer_scale:1,u_fade_t:te.mix,u_opacity:te.opacity*me.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:me.paint.get("raster-brightness-min"),u_brightness_high:me.paint.get("raster-brightness-max"),u_saturation_factor:gs(me.paint.get("raster-saturation")),u_contrast_factor:ao(me.paint.get("raster-contrast")),u_spin_weights:fi(me.paint.get("raster-hue-rotate"))}};function fi(ye){ye*=Math.PI/180;var W=Math.sin(ye),de=Math.cos(ye);return[(2*de+1)/3,(-Math.sqrt(3)*W-de+1)/3,(Math.sqrt(3)*W-de+1)/3]}function ao(ye){return ye>0?1/(1-ye):1+ye}function gs(ye){return ye>0?1-1/(1.001-ye):-ye}var Jo=function(ye,W){return{u_is_size_zoom_constant:new e.Uniform1i(ye,W.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(ye,W.u_is_size_feature_constant),u_size_t:new e.Uniform1f(ye,W.u_size_t),u_size:new e.Uniform1f(ye,W.u_size),u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_pitch:new e.Uniform1f(ye,W.u_pitch),u_rotate_symbol:new e.Uniform1i(ye,W.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(ye,W.u_aspect_ratio),u_fade_change:new e.Uniform1f(ye,W.u_fade_change),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(ye,W.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(ye,W.u_coord_matrix),u_is_text:new e.Uniform1i(ye,W.u_is_text),u_pitch_with_map:new e.Uniform1i(ye,W.u_pitch_with_map),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_texture:new e.Uniform1i(ye,W.u_texture)}},Bl=function(ye,W){return{u_is_size_zoom_constant:new e.Uniform1i(ye,W.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(ye,W.u_is_size_feature_constant),u_size_t:new e.Uniform1f(ye,W.u_size_t),u_size:new e.Uniform1f(ye,W.u_size),u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_pitch:new e.Uniform1f(ye,W.u_pitch),u_rotate_symbol:new e.Uniform1i(ye,W.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(ye,W.u_aspect_ratio),u_fade_change:new e.Uniform1f(ye,W.u_fade_change),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(ye,W.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(ye,W.u_coord_matrix),u_is_text:new e.Uniform1i(ye,W.u_is_text),u_pitch_with_map:new e.Uniform1i(ye,W.u_pitch_with_map),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_texture:new e.Uniform1i(ye,W.u_texture),u_gamma_scale:new e.Uniform1f(ye,W.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(ye,W.u_is_halo)}},jl=function(ye,W){return{u_is_size_zoom_constant:new e.Uniform1i(ye,W.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(ye,W.u_is_size_feature_constant),u_size_t:new e.Uniform1f(ye,W.u_size_t),u_size:new e.Uniform1f(ye,W.u_size),u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_pitch:new e.Uniform1f(ye,W.u_pitch),u_rotate_symbol:new e.Uniform1i(ye,W.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(ye,W.u_aspect_ratio),u_fade_change:new e.Uniform1f(ye,W.u_fade_change),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(ye,W.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(ye,W.u_coord_matrix),u_is_text:new e.Uniform1i(ye,W.u_is_text),u_pitch_with_map:new e.Uniform1i(ye,W.u_pitch_with_map),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_texsize_icon:new e.Uniform2f(ye,W.u_texsize_icon),u_texture:new e.Uniform1i(ye,W.u_texture),u_texture_icon:new e.Uniform1i(ye,W.u_texture_icon),u_gamma_scale:new e.Uniform1f(ye,W.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(ye,W.u_is_halo)}},Vl=function(ye,W,de,te,me,Ue,tt,ft,st,bt){var It=me.transform;return{u_is_size_zoom_constant:+(ye==="constant"||ye==="source"),u_is_size_feature_constant:+(ye==="constant"||ye==="camera"),u_size_t:W?W.uSizeT:0,u_size:W?W.uSize:0,u_camera_to_center_distance:It.cameraToCenterDistance,u_pitch:It.pitch/360*2*Math.PI,u_rotate_symbol:+de,u_aspect_ratio:It.width/It.height,u_fade_change:me.options.fadeDuration?me.symbolFadeChange:1,u_matrix:Ue,u_label_plane_matrix:tt,u_coord_matrix:ft,u_is_text:+st,u_pitch_with_map:+te,u_texsize:bt,u_texture:0}},cc=function(ye,W,de,te,me,Ue,tt,ft,st,bt,It){var Jt=me.transform;return e.extend(Vl(ye,W,de,te,me,Ue,tt,ft,st,bt),{u_gamma_scale:te?Math.cos(Jt._pitch)*Jt.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+It})},ql=function(ye,W,de,te,me,Ue,tt,ft,st,bt){return e.extend(cc(ye,W,de,te,me,Ue,tt,ft,!0,st,!0),{u_texsize_icon:bt,u_texture_icon:1})},Vu=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_opacity:new e.Uniform1f(ye,W.u_opacity),u_color:new e.UniformColor(ye,W.u_color)}},ol=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_opacity:new e.Uniform1f(ye,W.u_opacity),u_image:new e.Uniform1i(ye,W.u_image),u_pattern_tl_a:new e.Uniform2f(ye,W.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(ye,W.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(ye,W.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(ye,W.u_pattern_br_b),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_mix:new e.Uniform1f(ye,W.u_mix),u_pattern_size_a:new e.Uniform2f(ye,W.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(ye,W.u_pattern_size_b),u_scale_a:new e.Uniform1f(ye,W.u_scale_a),u_scale_b:new e.Uniform1f(ye,W.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(ye,W.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ye,W.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(ye,W.u_tile_units_to_pixels)}},rc=function(ye,W,de){return{u_matrix:ye,u_opacity:W,u_color:de}},Vi=function(ye,W,de,te,me,Ue){return e.extend(bc(te,Ue,de,me),{u_matrix:ye,u_opacity:W})},eo={fillExtrusion:Lf,fillExtrusionPattern:xl,fill:Ru,fillPattern:Au,fillOutline:Zs,fillOutlinePattern:Ol,circle:Ht,collisionBox:qr,collisionCircle:Or,debug:ja,clippingMask:gn,heatmap:Ja,heatmapTexture:_n,hillshade:On,hillshadePrepare:zi,line:Bn,lineGradient:An,linePattern:Ki,lineSDF:ko,raster:Qs,symbolIcon:Jo,symbolSDF:Bl,symbolTextAndIcon:jl,background:Vu,backgroundPattern:ol},qu;function Du(ye,W,de,te,me,Ue,tt){for(var ft=ye.context,st=ft.gl,bt=ye.useProgram("collisionBox"),It=[],Jt=0,Kt=0,vr=0;vr0){var ha=e.create(),Ea=pr;e.mul(ha,tr.placementInvProjMatrix,ye.transform.glCoordMatrix),e.mul(ha,ha,tr.placementViewportMatrix),It.push({circleArray:ea,circleOffset:Kt,transform:Ea,invTransform:ha}),Jt+=ea.length/4,Kt=Jt}xr&&bt.draw(ft,st.LINES,wa.disabled,va.disabled,ye.colorModeForRenderPass(),gr.disabled,ua(pr,ye.transform,wr),de.id,xr.layoutVertexBuffer,xr.indexBuffer,xr.segments,null,ye.transform.zoom,null,null,xr.collisionVertexBuffer)}}if(!(!tt||!It.length)){var tn=ye.useProgram("collisionCircle"),Xa=new e.StructArrayLayout2f1f2i16;Xa.resize(Jt*4),Xa._trim();for(var Ya=0,an=0,hn=It;an=0&&(Tr[tr.associatedIconIndex]={shiftedAnchor:En,angle:Yn})}}if(It){vr.clear();for(var ai=ye.icon.placedSymbolArray,Io=0;Io0){var tt=e.browser.now(),ft=(tt-ye.timeAdded)/Ue,st=W?(tt-W.timeAdded)/Ue:-1,bt=de.getSource(),It=me.coveringZoomLevel({tileSize:bt.tileSize,roundZoom:bt.roundZoom}),Jt=!W||Math.abs(W.tileID.overscaledZ-It)>Math.abs(ye.tileID.overscaledZ-It),Kt=Jt&&ye.refreshedUponExpiration?1:e.clamp(Jt?ft:1-st,0,1);return ye.refreshedUponExpiration&&ft>=1&&(ye.refreshedUponExpiration=!1),W?{opacity:1,mix:1-Kt}:{opacity:Kt,mix:0}}else return{opacity:1,mix:0}}function sr(ye,W,de){var te=de.paint.get("background-color"),me=de.paint.get("background-opacity");if(me!==0){var Ue=ye.context,tt=Ue.gl,ft=ye.transform,st=ft.tileSize,bt=de.paint.get("background-pattern");if(!ye.isPatternMissing(bt)){var It=!bt&&te.a===1&&me===1&&ye.opaquePassEnabledForLayer()?"opaque":"translucent";if(ye.renderPass===It){var Jt=va.disabled,Kt=ye.depthModeForSublayer(0,It==="opaque"?wa.ReadWrite:wa.ReadOnly),vr=ye.colorModeForRenderPass(),Tr=ye.useProgram(bt?"backgroundPattern":"background"),wr=ft.coveringTiles({tileSize:st});bt&&(Ue.activeTexture.set(tt.TEXTURE0),ye.imageManager.bind(ye.context));for(var tr=de.getCrossfadeParameters(),pr=0,xr=wr;pr "+de.overscaledZ);var pr=tr+" "+vr+"kb";Gi(ye,pr),tt.draw(te,me.TRIANGLES,ft,st,Lt.alphaBlended,gr.disabled,sn(Ue,e.Color.transparent,wr),It,ye.debugBuffer,ye.quadTriangleIndexBuffer,ye.debugSegments)}function Gi(ye,W){ye.initDebugOverlayCanvas();var de=ye.debugOverlayCanvas,te=ye.context.gl,me=ye.debugOverlayCanvas.getContext("2d");me.clearRect(0,0,de.width,de.height),me.shadowColor="white",me.shadowBlur=2,me.lineWidth=1.5,me.strokeStyle="white",me.textBaseline="top",me.font="bold 36px Open Sans, sans-serif",me.fillText(W,5,5),me.strokeText(W,5,5),ye.debugOverlayTexture.update(de),ye.debugOverlayTexture.bind(te.LINEAR,te.CLAMP_TO_EDGE)}function Bo(ye,W,de){var te=ye.context,me=de.implementation;if(ye.renderPass==="offscreen"){var Ue=me.prerender;Ue&&(ye.setCustomLayerDefaults(),te.setColorMode(ye.colorModeForRenderPass()),Ue.call(me,te.gl,ye.transform.customLayerMatrix()),te.setDirty(),ye.setBaseState())}else if(ye.renderPass==="translucent"){ye.setCustomLayerDefaults(),te.setColorMode(ye.colorModeForRenderPass()),te.setStencilMode(va.disabled);var tt=me.renderingMode==="3d"?new wa(ye.context.gl.LEQUAL,wa.ReadWrite,ye.depthRangeFor3D):ye.depthModeForSublayer(0,wa.ReadOnly);te.setDepthMode(tt),me.render(te.gl,ye.transform.customLayerMatrix()),te.setDirty(),ye.setBaseState(),te.bindFramebuffer.set(null)}}var No={symbol:I,circle:Ct,heatmap:Wt,line:Wr,fill:je,"fill-extrusion":at,hillshade:Tt,raster:Yt,background:sr,debug:pi,custom:Bo},po=function(W,de){this.context=new Br(W),this.transform=de,this._tileTextures={},this.setup(),this.numSublayers=na.maxUnderzooming+na.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new $l,this.gpuTimers={}};po.prototype.resize=function(W,de){if(this.width=W*e.browser.devicePixelRatio,this.height=de*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var te=0,me=this.style._order;te256&&this.clearStencil(),te.setColorMode(Lt.disabled),te.setDepthMode(wa.disabled);var Ue=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var tt=0,ft=de;tt256&&this.clearStencil();var W=this.nextStencilID++,de=this.context.gl;return new va({func:de.NOTEQUAL,mask:255},W,255,de.KEEP,de.KEEP,de.REPLACE)},po.prototype.stencilModeForClipping=function(W){var de=this.context.gl;return new va({func:de.EQUAL,mask:255},this._tileClippingMaskIDs[W.key],0,de.KEEP,de.KEEP,de.REPLACE)},po.prototype.stencilConfigForOverlap=function(W){var de,te=this.context.gl,me=W.sort(function(bt,It){return It.overscaledZ-bt.overscaledZ}),Ue=me[me.length-1].overscaledZ,tt=me[0].overscaledZ-Ue+1;if(tt>1){this.currentStencilSource=void 0,this.nextStencilID+tt>256&&this.clearStencil();for(var ft={},st=0;st=0;this.currentLayer--){var ha=this.style._layers[me[this.currentLayer]],Ea=Ue[ha.source],tn=st[ha.source];this._renderTileClippingMasks(ha,tn),this.renderLayer(this,Ea,ha,tn)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?de.pop():null},po.prototype.isPatternMissing=function(W){if(!W)return!1;if(!W.from||!W.to)return!0;var de=this.imageManager.getPattern(W.from.toString()),te=this.imageManager.getPattern(W.to.toString());return!de||!te},po.prototype.useProgram=function(W,de){this.cache=this.cache||{};var te=""+W+(de?de.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[te]||(this.cache[te]=new xc(this.context,W,_c[W],de,eo[W],this._showOverdrawInspector)),this.cache[te]},po.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()},po.prototype.setBaseState=function(){var W=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(W.FUNC_ADD)},po.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var W=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,W.RGBA)}},po.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Zo=function(W,de){this.points=W,this.planes=de};Zo.fromInvProjectionMatrix=function(W,de,te){var me=[[-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]],Ue=Math.pow(2,te),tt=me.map(function(bt){return e.transformMat4([],bt,W)}).map(function(bt){return e.scale$1([],bt,1/bt[3]/de*Ue)}),ft=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],st=ft.map(function(bt){var It=e.sub([],tt[bt[0]],tt[bt[1]]),Jt=e.sub([],tt[bt[2]],tt[bt[1]]),Kt=e.normalize([],e.cross([],It,Jt)),vr=-e.dot(Kt,tt[bt[1]]);return Kt.concat(vr)});return new Zo(tt,st)};var Hs=function(W,de){this.min=W,this.max=de,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};Hs.prototype.quadrant=function(W){for(var de=[W%2===0,W<2],te=e.clone$2(this.min),me=e.clone$2(this.max),Ue=0;Ue=0;if(tt===0)return 0;tt!==de.length&&(te=!1)}if(te)return 2;for(var st=0;st<3;st++){for(var bt=Number.MAX_VALUE,It=-Number.MAX_VALUE,Jt=0;Jtthis.max[st]-this.min[st])return 0}return 1};var zs=function(W,de,te,me){if(W===void 0&&(W=0),de===void 0&&(de=0),te===void 0&&(te=0),me===void 0&&(me=0),isNaN(W)||W<0||isNaN(de)||de<0||isNaN(te)||te<0||isNaN(me)||me<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=W,this.bottom=de,this.left=te,this.right=me};zs.prototype.interpolate=function(W,de,te){return de.top!=null&&W.top!=null&&(this.top=e.number(W.top,de.top,te)),de.bottom!=null&&W.bottom!=null&&(this.bottom=e.number(W.bottom,de.bottom,te)),de.left!=null&&W.left!=null&&(this.left=e.number(W.left,de.left,te)),de.right!=null&&W.right!=null&&(this.right=e.number(W.right,de.right,te)),this},zs.prototype.getCenter=function(W,de){var te=e.clamp((this.left+W-this.right)/2,0,W),me=e.clamp((this.top+de-this.bottom)/2,0,de);return new e.Point(te,me)},zs.prototype.equals=function(W){return this.top===W.top&&this.bottom===W.bottom&&this.left===W.left&&this.right===W.right},zs.prototype.clone=function(){return new zs(this.top,this.bottom,this.left,this.right)},zs.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var xo=function(W,de,te,me,Ue){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=Ue===void 0?!0:Ue,this._minZoom=W||0,this._maxZoom=de||22,this._minPitch=te??0,this._maxPitch=me??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new zs,this._posMatrixCache={},this._alignedPosMatrixCache={}},bo={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}};xo.prototype.clone=function(){var W=new xo(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return W.tileSize=this.tileSize,W.latRange=this.latRange,W.width=this.width,W.height=this.height,W._center=this._center,W.zoom=this.zoom,W.angle=this.angle,W._fov=this._fov,W._pitch=this._pitch,W._unmodified=this._unmodified,W._edgeInsets=this._edgeInsets.clone(),W._calcMatrices(),W},bo.minZoom.get=function(){return this._minZoom},bo.minZoom.set=function(ye){this._minZoom!==ye&&(this._minZoom=ye,this.zoom=Math.max(this.zoom,ye))},bo.maxZoom.get=function(){return this._maxZoom},bo.maxZoom.set=function(ye){this._maxZoom!==ye&&(this._maxZoom=ye,this.zoom=Math.min(this.zoom,ye))},bo.minPitch.get=function(){return this._minPitch},bo.minPitch.set=function(ye){this._minPitch!==ye&&(this._minPitch=ye,this.pitch=Math.max(this.pitch,ye))},bo.maxPitch.get=function(){return this._maxPitch},bo.maxPitch.set=function(ye){this._maxPitch!==ye&&(this._maxPitch=ye,this.pitch=Math.min(this.pitch,ye))},bo.renderWorldCopies.get=function(){return this._renderWorldCopies},bo.renderWorldCopies.set=function(ye){ye===void 0?ye=!0:ye===null&&(ye=!1),this._renderWorldCopies=ye},bo.worldSize.get=function(){return this.tileSize*this.scale},bo.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},bo.size.get=function(){return new e.Point(this.width,this.height)},bo.bearing.get=function(){return-this.angle/Math.PI*180},bo.bearing.set=function(ye){var W=-e.wrap(ye,-180,180)*Math.PI/180;this.angle!==W&&(this._unmodified=!1,this.angle=W,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},bo.pitch.get=function(){return this._pitch/Math.PI*180},bo.pitch.set=function(ye){var W=e.clamp(ye,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==W&&(this._unmodified=!1,this._pitch=W,this._calcMatrices())},bo.fov.get=function(){return this._fov/Math.PI*180},bo.fov.set=function(ye){ye=Math.max(.01,Math.min(60,ye)),this._fov!==ye&&(this._unmodified=!1,this._fov=ye/180*Math.PI,this._calcMatrices())},bo.zoom.get=function(){return this._zoom},bo.zoom.set=function(ye){var W=Math.min(Math.max(ye,this.minZoom),this.maxZoom);this._zoom!==W&&(this._unmodified=!1,this._zoom=W,this.scale=this.zoomScale(W),this.tileZoom=Math.floor(W),this.zoomFraction=W-this.tileZoom,this._constrain(),this._calcMatrices())},bo.center.get=function(){return this._center},bo.center.set=function(ye){ye.lat===this._center.lat&&ye.lng===this._center.lng||(this._unmodified=!1,this._center=ye,this._constrain(),this._calcMatrices())},bo.padding.get=function(){return this._edgeInsets.toJSON()},bo.padding.set=function(ye){this._edgeInsets.equals(ye)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,ye,1),this._calcMatrices())},bo.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},xo.prototype.isPaddingEqual=function(W){return this._edgeInsets.equals(W)},xo.prototype.interpolatePadding=function(W,de,te){this._unmodified=!1,this._edgeInsets.interpolate(W,de,te),this._constrain(),this._calcMatrices()},xo.prototype.coveringZoomLevel=function(W){var de=(W.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/W.tileSize));return Math.max(0,de)},xo.prototype.getVisibleUnwrappedCoordinates=function(W){var de=[new e.UnwrappedTileID(0,W)];if(this._renderWorldCopies)for(var te=this.pointCoordinate(new e.Point(0,0)),me=this.pointCoordinate(new e.Point(this.width,0)),Ue=this.pointCoordinate(new e.Point(this.width,this.height)),tt=this.pointCoordinate(new e.Point(0,this.height)),ft=Math.floor(Math.min(te.x,me.x,Ue.x,tt.x)),st=Math.floor(Math.max(te.x,me.x,Ue.x,tt.x)),bt=1,It=ft-bt;It<=st+bt;It++)It!==0&&de.push(new e.UnwrappedTileID(It,W));return de},xo.prototype.coveringTiles=function(W){var de=this.coveringZoomLevel(W),te=de;if(W.minzoom!==void 0&&deW.maxzoom&&(de=W.maxzoom);var me=e.MercatorCoordinate.fromLngLat(this.center),Ue=Math.pow(2,de),tt=[Ue*me.x,Ue*me.y,0],ft=Zo.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,de),st=W.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(st=de);var bt=3,It=function(fn){return{aabb:new Hs([fn*Ue,0,0],[(fn+1)*Ue,Ue,0]),zoom:0,x:0,y:0,wrap:fn,fullyVisible:!1}},Jt=[],Kt=[],vr=de,Tr=W.reparseOverscaled?te:de;if(this._renderWorldCopies)for(var wr=1;wr<=3;wr++)Jt.push(It(-wr)),Jt.push(It(wr));for(Jt.push(It(0));Jt.length>0;){var tr=Jt.pop(),pr=tr.x,xr=tr.y,ea=tr.fullyVisible;if(!ea){var ha=tr.aabb.intersects(ft);if(ha===0)continue;ea=ha===2}var Ea=tr.aabb.distanceX(tt),tn=tr.aabb.distanceY(tt),Xa=Math.max(Math.abs(Ea),Math.abs(tn)),Ya=bt+(1<Ya&&tr.zoom>=st){Kt.push({tileID:new e.OverscaledTileID(tr.zoom===vr?Tr:tr.zoom,tr.wrap,tr.zoom,pr,xr),distanceSq:e.sqrLen([tt[0]-.5-pr,tt[1]-.5-xr])});continue}for(var an=0;an<4;an++){var hn=(pr<<1)+an%2,xn=(xr<<1)+(an>>1);Jt.push({aabb:tr.aabb.quadrant(an),zoom:tr.zoom+1,x:hn,y:xn,wrap:tr.wrap,fullyVisible:ea})}}return Kt.sort(function(fn,En){return fn.distanceSq-En.distanceSq}).map(function(fn){return fn.tileID})},xo.prototype.resize=function(W,de){this.width=W,this.height=de,this.pixelsToGLUnits=[2/W,-2/de],this._constrain(),this._calcMatrices()},bo.unmodified.get=function(){return this._unmodified},xo.prototype.zoomScale=function(W){return Math.pow(2,W)},xo.prototype.scaleZoom=function(W){return Math.log(W)/Math.LN2},xo.prototype.project=function(W){var de=e.clamp(W.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(W.lng)*this.worldSize,e.mercatorYfromLat(de)*this.worldSize)},xo.prototype.unproject=function(W){return new e.MercatorCoordinate(W.x/this.worldSize,W.y/this.worldSize).toLngLat()},bo.point.get=function(){return this.project(this.center)},xo.prototype.setLocationAtPoint=function(W,de){var te=this.pointCoordinate(de),me=this.pointCoordinate(this.centerPoint),Ue=this.locationCoordinate(W),tt=new e.MercatorCoordinate(Ue.x-(te.x-me.x),Ue.y-(te.y-me.y));this.center=this.coordinateLocation(tt),this._renderWorldCopies&&(this.center=this.center.wrap())},xo.prototype.locationPoint=function(W){return this.coordinatePoint(this.locationCoordinate(W))},xo.prototype.pointLocation=function(W){return this.coordinateLocation(this.pointCoordinate(W))},xo.prototype.locationCoordinate=function(W){return e.MercatorCoordinate.fromLngLat(W)},xo.prototype.coordinateLocation=function(W){return W.toLngLat()},xo.prototype.pointCoordinate=function(W){var de=0,te=[W.x,W.y,0,1],me=[W.x,W.y,1,1];e.transformMat4(te,te,this.pixelMatrixInverse),e.transformMat4(me,me,this.pixelMatrixInverse);var Ue=te[3],tt=me[3],ft=te[0]/Ue,st=me[0]/tt,bt=te[1]/Ue,It=me[1]/tt,Jt=te[2]/Ue,Kt=me[2]/tt,vr=Jt===Kt?0:(de-Jt)/(Kt-Jt);return new e.MercatorCoordinate(e.number(ft,st,vr)/this.worldSize,e.number(bt,It,vr)/this.worldSize)},xo.prototype.coordinatePoint=function(W){var de=[W.x*this.worldSize,W.y*this.worldSize,0,1];return e.transformMat4(de,de,this.pixelMatrix),new e.Point(de[0]/de[3],de[1]/de[3])},xo.prototype.getBounds=function(){return new e.LngLatBounds().extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},xo.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},xo.prototype.setMaxBounds=function(W){W?(this.lngRange=[W.getWest(),W.getEast()],this.latRange=[W.getSouth(),W.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},xo.prototype.calculatePosMatrix=function(W,de){de===void 0&&(de=!1);var te=W.key,me=de?this._alignedPosMatrixCache:this._posMatrixCache;if(me[te])return me[te];var Ue=W.canonical,tt=this.worldSize/this.zoomScale(Ue.z),ft=Ue.x+Math.pow(2,Ue.z)*W.wrap,st=e.identity(new Float64Array(16));return e.translate(st,st,[ft*tt,Ue.y*tt,0]),e.scale(st,st,[tt/e.EXTENT,tt/e.EXTENT,1]),e.multiply(st,de?this.alignedProjMatrix:this.projMatrix,st),me[te]=new Float32Array(st),me[te]},xo.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},xo.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var W=-90,de=90,te=-180,me=180,Ue,tt,ft,st,bt=this.size,It=this._unmodified;if(this.latRange){var Jt=this.latRange;W=e.mercatorYfromLat(Jt[1])*this.worldSize,de=e.mercatorYfromLat(Jt[0])*this.worldSize,Ue=de-Wde&&(st=de-tr)}if(this.lngRange){var pr=vr.x,xr=bt.x/2;pr-xrme&&(ft=me-xr)}(ft!==void 0||st!==void 0)&&(this.center=this.unproject(new e.Point(ft!==void 0?ft:vr.x,st!==void 0?st:vr.y))),this._unmodified=It,this._constraining=!1}},xo.prototype._calcMatrices=function(){if(this.height){var W=this._fov/2,de=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(W)*this.height;var te=Math.PI/2+this._pitch,me=this._fov*(.5+de.y/this.height),Ue=Math.sin(me)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-te-me,.01,Math.PI-.01)),tt=this.point,ft=tt.x,st=tt.y,bt=Math.cos(Math.PI/2-this._pitch)*Ue+this.cameraToCenterDistance,It=bt*1.01,Jt=this.height/50,Kt=new Float64Array(16);e.perspective(Kt,this._fov,this.width/this.height,Jt,It),Kt[8]=-de.x*2/this.width,Kt[9]=de.y*2/this.height,e.scale(Kt,Kt,[1,-1,1]),e.translate(Kt,Kt,[0,0,-this.cameraToCenterDistance]),e.rotateX(Kt,Kt,this._pitch),e.rotateZ(Kt,Kt,this.angle),e.translate(Kt,Kt,[-ft,-st,0]),this.mercatorMatrix=e.scale([],Kt,[this.worldSize,this.worldSize,this.worldSize]),e.scale(Kt,Kt,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Kt,this.invProjMatrix=e.invert([],this.projMatrix);var vr=this.width%2/2,Tr=this.height%2/2,wr=Math.cos(this.angle),tr=Math.sin(this.angle),pr=ft-Math.round(ft)+wr*vr+tr*Tr,xr=st-Math.round(st)+wr*Tr+tr*vr,ea=new Float64Array(Kt);if(e.translate(ea,ea,[pr>.5?pr-1:pr,xr>.5?xr-1:xr,0]),this.alignedProjMatrix=ea,Kt=e.create(),e.scale(Kt,Kt,[this.width/2,-this.height/2,1]),e.translate(Kt,Kt,[1,-1,0]),this.labelPlaneMatrix=Kt,Kt=e.create(),e.scale(Kt,Kt,[1,-1,1]),e.translate(Kt,Kt,[-1,-1,0]),e.scale(Kt,Kt,[2/this.width,2/this.height,1]),this.glCoordMatrix=Kt,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),Kt=e.invert(new Float64Array(16),this.pixelMatrix),!Kt)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Kt,this._posMatrixCache={},this._alignedPosMatrixCache={}}},xo.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var W=this.pointCoordinate(new e.Point(0,0)),de=[W.x*this.worldSize,W.y*this.worldSize,0,1],te=e.transformMat4(de,de,this.pixelMatrix);return te[3]/this.cameraToCenterDistance},xo.prototype.getCameraPoint=function(){var W=this._pitch,de=Math.tan(W)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,de))},xo.prototype.getCameraQueryGeometry=function(W){var de=this.getCameraPoint();if(W.length===1)return[W[0],de];for(var te=de.x,me=de.y,Ue=de.x,tt=de.y,ft=0,st=W;ft=3&&!W.some(function(te){return isNaN(te)})){var de=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(W[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+W[2],+W[1]],zoom:+W[0],bearing:de,pitch:+(W[4]||0)}),!0}return!1},Al.prototype._updateHashUnthrottled=function(){var W=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,W)}catch{}};var pu={linearity:.3,easing:e.bezier(0,0,.3,1)},pe=e.extend({deceleration:2500,maxSpeed:1400},pu),Le=e.extend({deceleration:20,maxSpeed:1400},pu),Ye=e.extend({deceleration:1e3,maxSpeed:360},pu),ut=e.extend({deceleration:1e3,maxSpeed:90},pu),ht=function(W){this._map=W,this.clear()};ht.prototype.clear=function(){this._inertiaBuffer=[]},ht.prototype.record=function(W){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:W})},ht.prototype._drainInertiaBuffer=function(){for(var W=this._inertiaBuffer,de=e.browser.now(),te=160;W.length>0&&de-W[0].time>te;)W.shift()},ht.prototype._onMoveEnd=function(W){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var de={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},te=0,me=this._inertiaBuffer;te=this._clickTolerance||this._map.fire(new Dt(W.type,this._map,W))},Ar.prototype.dblclick=function(W){return this._firePreventable(new Dt(W.type,this._map,W))},Ar.prototype.mouseover=function(W){this._map.fire(new Dt(W.type,this._map,W))},Ar.prototype.mouseout=function(W){this._map.fire(new Dt(W.type,this._map,W))},Ar.prototype.touchstart=function(W){return this._firePreventable(new $t(W.type,this._map,W))},Ar.prototype.touchmove=function(W){this._map.fire(new $t(W.type,this._map,W))},Ar.prototype.touchend=function(W){this._map.fire(new $t(W.type,this._map,W))},Ar.prototype.touchcancel=function(W){this._map.fire(new $t(W.type,this._map,W))},Ar.prototype._firePreventable=function(W){if(this._map.fire(W),W.defaultPrevented)return{}},Ar.prototype.isEnabled=function(){return!0},Ar.prototype.isActive=function(){return!1},Ar.prototype.enable=function(){},Ar.prototype.disable=function(){};var Vr=function(W){this._map=W};Vr.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Vr.prototype.mousemove=function(W){this._map.fire(new Dt(W.type,this._map,W))},Vr.prototype.mousedown=function(){this._delayContextMenu=!0},Vr.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Dt("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Vr.prototype.contextmenu=function(W){this._delayContextMenu?this._contextMenuEvent=W:this._map.fire(new Dt(W.type,this._map,W)),this._map.listens("contextmenu")&&W.preventDefault()},Vr.prototype.isEnabled=function(){return!0},Vr.prototype.isActive=function(){return!1},Vr.prototype.enable=function(){},Vr.prototype.disable=function(){};var Kr=function(W,de){this._map=W,this._el=W.getCanvasContainer(),this._container=W.getContainer(),this._clickTolerance=de.clickTolerance||1};Kr.prototype.isEnabled=function(){return!!this._enabled},Kr.prototype.isActive=function(){return!!this._active},Kr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Kr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Kr.prototype.mousedown=function(W,de){this.isEnabled()&&W.shiftKey&&W.button===0&&(r.disableDrag(),this._startPos=this._lastPos=de,this._active=!0)},Kr.prototype.mousemoveWindow=function(W,de){if(this._active){var te=de;if(!(this._lastPos.equals(te)||!this._box&&te.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=W.timeStamp),te.length===this.numTouches&&(this.centroid=Ua(de),this.touches=aa(te,de)))},Ba.prototype.touchmove=function(W,de,te){if(!(this.aborted||!this.centroid)){var me=aa(te,de);for(var Ue in this.touches){var tt=this.touches[Ue],ft=me[Ue];(!ft||ft.dist(tt)>ka)&&(this.aborted=!0)}}},Ba.prototype.touchend=function(W,de,te){if((!this.centroid||W.timeStamp-this.startTime>Ta)&&(this.aborted=!0),te.length===0){var me=!this.aborted&&this.centroid;if(this.reset(),me)return me}};var Va=function(W){this.singleTap=new Ba(W),this.numTaps=W.numTaps,this.reset()};Va.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Va.prototype.touchstart=function(W,de,te){this.singleTap.touchstart(W,de,te)},Va.prototype.touchmove=function(W,de,te){this.singleTap.touchmove(W,de,te)},Va.prototype.touchend=function(W,de,te){var me=this.singleTap.touchend(W,de,te);if(me){var Ue=W.timeStamp-this.lastTime0&&(this._active=!0);var me=aa(te,de),Ue=new e.Point(0,0),tt=new e.Point(0,0),ft=0;for(var st in me){var bt=me[st],It=this._touches[st];It&&(Ue._add(bt),tt._add(bt.sub(It)),ft++,me[st]=bt)}if(this._touches=me,!(ftMath.abs(ye.x)}var Qo=100,_s=function(ye){function W(){ye.apply(this,arguments)}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.reset=function(){ye.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},W.prototype._start=function(te){this._lastPoints=te,Hl(te[0].sub(te[1]))&&(this._valid=!1)},W.prototype._move=function(te,me,Ue){var tt=te[0].sub(this._lastPoints[0]),ft=te[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(tt,ft,Ue.timeStamp),!!this._valid){this._lastPoints=te,this._active=!0;var st=(tt.y+ft.y)/2,bt=-.5;return{pitchDelta:st*bt}}},W.prototype.gestureBeginsVertically=function(te,me,Ue){if(this._valid!==void 0)return this._valid;var tt=2,ft=te.mag()>=tt,st=me.mag()>=tt;if(!(!ft&&!st)){if(!ft||!st)return this._firstMove===void 0&&(this._firstMove=Ue),Ue-this._firstMove0==me.y>0;return Hl(te)&&Hl(me)&&bt}},W}(Vo),gu={panStep:100,bearingStep:15,pitchStep:10},el=function(){var W=gu;this._panStep=W.panStep,this._bearingStep=W.bearingStep,this._pitchStep=W.pitchStep,this._rotationDisabled=!1};el.prototype.reset=function(){this._active=!1},el.prototype.keydown=function(W){var de=this;if(!(W.altKey||W.ctrlKey||W.metaKey)){var te=0,me=0,Ue=0,tt=0,ft=0;switch(W.keyCode){case 61:case 107:case 171:case 187:te=1;break;case 189:case 109:case 173:te=-1;break;case 37:W.shiftKey?me=-1:(W.preventDefault(),tt=-1);break;case 39:W.shiftKey?me=1:(W.preventDefault(),tt=1);break;case 38:W.shiftKey?Ue=1:(W.preventDefault(),ft=-1);break;case 40:W.shiftKey?Ue=-1:(W.preventDefault(),ft=1);break;default:return}return this._rotationDisabled&&(me=0,Ue=0),{cameraAnimation:function(st){var bt=st.getZoom();st.easeTo({duration:300,easeId:"keyboardHandler",easing:cr,zoom:te?Math.round(bt)+te*(W.shiftKey?2:1):bt,bearing:st.getBearing()+me*de._bearingStep,pitch:st.getPitch()+Ue*de._pitchStep,offset:[-tt*de._panStep,-ft*de._panStep],center:st.getCenter()},{originalEvent:W})}}}},el.prototype.enable=function(){this._enabled=!0},el.prototype.disable=function(){this._enabled=!1,this.reset()},el.prototype.isEnabled=function(){return this._enabled},el.prototype.isActive=function(){return this._active},el.prototype.disableRotation=function(){this._rotationDisabled=!0},el.prototype.enableRotation=function(){this._rotationDisabled=!1};function cr(ye){return ye*(2-ye)}var fa=4.000244140625,xa=1/100,cn=1/450,In=2,Da=function(W,de){this._map=W,this._el=W.getCanvasContainer(),this._handler=de,this._delta=0,this._defaultZoomRate=xa,this._wheelZoomRate=cn,e.bindAll(["_onTimeout"],this)};Da.prototype.setZoomRate=function(W){this._defaultZoomRate=W},Da.prototype.setWheelZoomRate=function(W){this._wheelZoomRate=W},Da.prototype.isEnabled=function(){return!!this._enabled},Da.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},Da.prototype.isZooming=function(){return!!this._zooming},Da.prototype.enable=function(W){this.isEnabled()||(this._enabled=!0,this._aroundCenter=W&&W.around==="center")},Da.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Da.prototype.wheel=function(W){if(this.isEnabled()){var de=W.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?W.deltaY*40:W.deltaY,te=e.browser.now(),me=te-(this._lastWheelEventTime||0);this._lastWheelEventTime=te,de!==0&&de%fa===0?this._type="wheel":de!==0&&Math.abs(de)<4?this._type="trackpad":me>400?(this._type=null,this._lastValue=de,this._timeout=setTimeout(this._onTimeout,40,W)):this._type||(this._type=Math.abs(me*de)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,de+=this._lastValue)),W.shiftKey&&de&&(de=de/4),this._type&&(this._lastWheelEvent=W,this._delta-=de,this._active||this._start(W)),W.preventDefault()}},Da.prototype._onTimeout=function(W){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(W)},Da.prototype._start=function(W){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 de=r.mousePos(this._el,W);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(de)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},Da.prototype.renderFrame=function(){var W=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var de=this._map.transform;if(this._delta!==0){var te=this._type==="wheel"&&Math.abs(this._delta)>fa?this._wheelZoomRate:this._defaultZoomRate,me=In/(1+Math.exp(-Math.abs(this._delta*te)));this._delta<0&&me!==0&&(me=1/me);var Ue=typeof this._targetZoom=="number"?de.zoomScale(this._targetZoom):de.scale;this._targetZoom=Math.min(de.maxZoom,Math.max(de.minZoom,de.scaleZoom(Ue*me))),this._type==="wheel"&&(this._startZoom=de.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var tt=typeof this._targetZoom=="number"?this._targetZoom:de.zoom,ft=this._startZoom,st=this._easing,bt=!1,It;if(this._type==="wheel"&&ft&&st){var Jt=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),Kt=st(Jt);It=e.number(ft,tt,Kt),Jt<1?this._frameId||(this._frameId=!0):bt=!0}else It=tt,bt=!0;return this._active=!0,bt&&(this._active=!1,this._finishTimeout=setTimeout(function(){W._zooming=!1,W._handler._triggerRenderFrame(),delete W._targetZoom,delete W._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!bt,zoomDelta:It-de.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},Da.prototype._smoothOutEasing=function(W){var de=e.ease;if(this._prevEase){var te=this._prevEase,me=(e.browser.now()-te.start)/te.duration,Ue=te.easing(me+.01)-te.easing(me),tt=.27/Math.sqrt(Ue*Ue+1e-4)*.01,ft=Math.sqrt(.27*.27-tt*tt);de=e.bezier(tt,ft,.25,1)}return this._prevEase={start:e.browser.now(),duration:W,easing:de},de},Da.prototype.reset=function(){this._active=!1};var Na=function(W,de){this._clickZoom=W,this._tapZoom=de};Na.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Na.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Na.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Na.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var Hn=function(){this.reset()};Hn.prototype.reset=function(){this._active=!1},Hn.prototype.dblclick=function(W,de){return W.preventDefault(),{cameraAnimation:function(te){te.easeTo({duration:300,zoom:te.getZoom()+(W.shiftKey?-1:1),around:te.unproject(de)},{originalEvent:W})}}},Hn.prototype.enable=function(){this._enabled=!0},Hn.prototype.disable=function(){this._enabled=!1,this.reset()},Hn.prototype.isEnabled=function(){return this._enabled},Hn.prototype.isActive=function(){return this._active};var Un=function(){this._tap=new Va({numTouches:1,numTaps:1}),this.reset()};Un.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Un.prototype.touchstart=function(W,de,te){this._swipePoint||(this._tapTime&&W.timeStamp-this._tapTime>la&&this.reset(),this._tapTime?te.length>0&&(this._swipePoint=de[0],this._swipeTouch=te[0].identifier):this._tap.touchstart(W,de,te))},Un.prototype.touchmove=function(W,de,te){if(!this._tapTime)this._tap.touchmove(W,de,te);else if(this._swipePoint){if(te[0].identifier!==this._swipeTouch)return;var me=de[0],Ue=me.y-this._swipePoint.y;return this._swipePoint=me,W.preventDefault(),this._active=!0,{zoomDelta:Ue/128}}},Un.prototype.touchend=function(W,de,te){if(this._tapTime)this._swipePoint&&te.length===0&&this.reset();else{var me=this._tap.touchend(W,de,te);me&&(this._tapTime=W.timeStamp)}},Un.prototype.touchcancel=function(){this.reset()},Un.prototype.enable=function(){this._enabled=!0},Un.prototype.disable=function(){this._enabled=!1,this.reset()},Un.prototype.isEnabled=function(){return this._enabled},Un.prototype.isActive=function(){return this._active};var Gn=function(W,de,te){this._el=W,this._mousePan=de,this._touchPan=te};Gn.prototype.enable=function(W){this._inertiaOptions=W||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Gn.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Gn.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Gn.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var ti=function(W,de,te){this._pitchWithRotate=W.pitchWithRotate,this._mouseRotate=de,this._mousePitch=te};ti.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},ti.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},ti.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},ti.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Wi=function(W,de,te,me){this._el=W,this._touchZoom=de,this._touchRotate=te,this._tapDragZoom=me,this._rotationDisabled=!1,this._enabled=!0};Wi.prototype.enable=function(W){this._touchZoom.enable(W),this._rotationDisabled||this._touchRotate.enable(W),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Wi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Wi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Wi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Wi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Wi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Ti=function(ye){return ye.zoom||ye.drag||ye.pitch||ye.rotate},si=function(ye){function W(){ye.apply(this,arguments)}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W}(e.Event);function Fn(ye){return ye.panDelta&&ye.panDelta.mag()||ye.zoomDelta||ye.bearingDelta||ye.pitchDelta}var qa=function(W,de){this._map=W,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ht(W),this._bearingSnap=de.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(de),e.bindAll(["handleEvent","handleWindowEvent"],this);var te=this._el;this._listeners=[[te,"touchstart",{passive:!0}],[te,"touchmove",{passive:!1}],[te,"touchend",void 0],[te,"touchcancel",void 0],[te,"mousedown",void 0],[te,"mousemove",void 0],[te,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[te,"mouseover",void 0],[te,"mouseout",void 0],[te,"dblclick",void 0],[te,"click",void 0],[te,"keydown",{capture:!1}],[te,"keyup",void 0],[te,"wheel",{passive:!1}],[te,"contextmenu",void 0],[e.window,"blur",void 0]];for(var me=0,Ue=this._listeners;meft?Math.min(2,Ea):Math.max(.5,Ea),fn=Math.pow(xn,1-an),En=tt.unproject(ea.add(ha.mult(an*fn)).mult(hn));tt.setLocationAtPoint(tt.renderWorldCopies?En.wrap():En,tr)}Ue._fireMoveEvents(me)},function(an){Ue._afterEase(me,an)},te),this},W.prototype._prepareEase=function(te,me,Ue){Ue===void 0&&(Ue={}),this._moving=!0,!me&&!Ue.moving&&this.fire(new e.Event("movestart",te)),this._zooming&&!Ue.zooming&&this.fire(new e.Event("zoomstart",te)),this._rotating&&!Ue.rotating&&this.fire(new e.Event("rotatestart",te)),this._pitching&&!Ue.pitching&&this.fire(new e.Event("pitchstart",te))},W.prototype._fireMoveEvents=function(te){this.fire(new e.Event("move",te)),this._zooming&&this.fire(new e.Event("zoom",te)),this._rotating&&this.fire(new e.Event("rotate",te)),this._pitching&&this.fire(new e.Event("pitch",te))},W.prototype._afterEase=function(te,me){if(!(this._easeId&&me&&this._easeId===me)){delete this._easeId;var Ue=this._zooming,tt=this._rotating,ft=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Ue&&this.fire(new e.Event("zoomend",te)),tt&&this.fire(new e.Event("rotateend",te)),ft&&this.fire(new e.Event("pitchend",te)),this.fire(new e.Event("moveend",te))}},W.prototype.flyTo=function(te,me){var Ue=this;if(!te.essential&&e.browser.prefersReducedMotion){var tt=e.pick(te,["center","zoom","bearing","pitch","around"]);return this.jumpTo(tt,me)}this.stop(),te=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},te);var ft=this.transform,st=this.getZoom(),bt=this.getBearing(),It=this.getPitch(),Jt=this.getPadding(),Kt="zoom"in te?e.clamp(+te.zoom,ft.minZoom,ft.maxZoom):st,vr="bearing"in te?this._normalizeBearing(te.bearing,bt):bt,Tr="pitch"in te?+te.pitch:It,wr="padding"in te?te.padding:ft.padding,tr=ft.zoomScale(Kt-st),pr=e.Point.convert(te.offset),xr=ft.centerPoint.add(pr),ea=ft.pointLocation(xr),ha=e.LngLat.convert(te.center||ea);this._normalizeCenter(ha);var Ea=ft.project(ea),tn=ft.project(ha).sub(Ea),Xa=te.curve,Ya=Math.max(ft.width,ft.height),an=Ya/tr,hn=tn.mag();if("minZoom"in te){var xn=e.clamp(Math.min(te.minZoom,st,Kt),ft.minZoom,ft.maxZoom),fn=Ya/ft.zoomScale(xn-st);Xa=Math.sqrt(fn/hn*2)}var En=Xa*Xa;function Yn(Uo){var Vs=(an*an-Ya*Ya+(Uo?-1:1)*En*En*hn*hn)/(2*(Uo?an:Ya)*En*hn);return Math.log(Math.sqrt(Vs*Vs+1)-Vs)}function vi(Uo){return(Math.exp(Uo)-Math.exp(-Uo))/2}function ai(Uo){return(Math.exp(Uo)+Math.exp(-Uo))/2}function Io(Uo){return vi(Uo)/ai(Uo)}var yo=Yn(0),vs=function(Uo){return ai(yo)/ai(yo+Xa*Uo)},us=function(Uo){return Ya*((ai(yo)*Io(yo+Xa*Uo)-vi(yo))/En)/hn},Ds=(Yn(1)-yo)/Xa;if(Math.abs(hn)<1e-6||!isFinite(Ds)){if(Math.abs(Ya-an)<1e-6)return this.easeTo(te,me);var rs=ante.maxDuration&&(te.duration=0),this._zooming=!0,this._rotating=bt!==vr,this._pitching=Tr!==It,this._padding=!ft.isPaddingEqual(wr),this._prepareEase(me,!1),this._ease(function(Uo){var Vs=Uo*Ds,Fu=1/vs(Vs);ft.zoom=Uo===1?Kt:st+ft.scaleZoom(Fu),Ue._rotating&&(ft.bearing=e.number(bt,vr,Uo)),Ue._pitching&&(ft.pitch=e.number(It,Tr,Uo)),Ue._padding&&(ft.interpolatePadding(Jt,wr,Uo),xr=ft.centerPoint.add(pr));var fc=Uo===1?ha:ft.unproject(Ea.add(tn.mult(us(Vs))).mult(Fu));ft.setLocationAtPoint(ft.renderWorldCopies?fc.wrap():fc,xr),Ue._fireMoveEvents(me)},function(){return Ue._afterEase(me)},te),this},W.prototype.isEasing=function(){return!!this._easeFrameId},W.prototype.stop=function(){return this._stop()},W.prototype._stop=function(te,me){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var Ue=this._onEaseEnd;delete this._onEaseEnd,Ue.call(this,me)}if(!te){var tt=this.handlers;tt&&tt.stop(!1)}return this},W.prototype._ease=function(te,me,Ue){Ue.animate===!1||Ue.duration===0?(te(1),me()):(this._easeStart=e.browser.now(),this._easeOptions=Ue,this._onEaseFrame=te,this._onEaseEnd=me,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},W.prototype._renderFrameCallback=function(){var te=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(te)),te<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},W.prototype._normalizeBearing=function(te,me){te=e.wrap(te,-180,180);var Ue=Math.abs(te-me);return Math.abs(te-360-me)180?-360:Ue<-180?360:0}},W}(e.Evented),Tn=function(W){W===void 0&&(W={}),this.options=W,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Tn.prototype.getDefaultPosition=function(){return"bottom-right"},Tn.prototype.onAdd=function(W){var de=this.options&&this.options.compact;return this._map=W,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),de&&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),de===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Tn.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Tn.prototype._setElementTitle=function(W,de){var te=this._map._getUIString("AttributionControl."+de);W.title=te,W.setAttribute("aria-label",te)},Tn.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Tn.prototype._updateEditLink=function(){var W=this._editLink;W||(W=this._editLink=this._container.querySelector(".mapbox-improve-map"));var de=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(W){var te=de.reduce(function(me,Ue,tt){return Ue.value&&(me+=Ue.key+"="+Ue.value+(tt=0)return!1;return!0});var ft=W.join(" | ");ft!==this._attribHTML&&(this._attribHTML=ft,W.length?(this._innerContainer.innerHTML=ft,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Tn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Ln=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};Ln.prototype.onAdd=function(W){this._map=W,this._container=r.create("div","mapboxgl-ctrl");var de=r.create("a","mapboxgl-ctrl-logo");return de.target="_blank",de.rel="noopener nofollow",de.href="https://www.mapbox.com/",de.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),de.setAttribute("rel","noopener nofollow"),this._container.appendChild(de),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ln.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ln.prototype.getDefaultPosition=function(){return"bottom-left"},Ln.prototype._updateLogo=function(W){(!W||W.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},Ln.prototype._logoRequired=function(){if(this._map.style){var W=this._map.style.sourceCaches;for(var de in W){var te=W[de].getSource();if(te.mapbox_logo)return!0}return!1}},Ln.prototype._updateCompact=function(){var W=this._container.children;if(W.length){var de=W[0];this._map.getCanvasContainer().offsetWidth<250?de.classList.add("mapboxgl-compact"):de.classList.remove("mapboxgl-compact")}};var Pn=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Pn.prototype.add=function(W){var de=++this._id,te=this._queue;return te.push({callback:W,id:de,cancelled:!1}),de},Pn.prototype.remove=function(W){for(var de=this._currentlyRunning,te=de?this._queue.concat(de):this._queue,me=0,Ue=te;mete.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(te.minPitch!=null&&te.maxPitch!=null&&te.minPitch>te.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(te.minPitch!=null&&te.minPitchgi)throw new Error("maxPitch must be less than or equal to "+gi);var Ue=new xo(te.minZoom,te.maxZoom,te.minPitch,te.maxPitch,te.renderWorldCopies);if(ye.call(this,Ue,te),this._interactive=te.interactive,this._maxTileCacheSize=te.maxTileCacheSize,this._failIfMajorPerformanceCaveat=te.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=te.preserveDrawingBuffer,this._antialias=te.antialias,this._trackResize=te.trackResize,this._bearingSnap=te.bearingSnap,this._refreshExpiredTiles=te.refreshExpiredTiles,this._fadeDuration=te.fadeDuration,this._crossSourceCollisions=te.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=te.collectResourceTiming,this._renderTaskQueue=new Pn,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},Ri,te.locale),this._clickTolerance=te.clickTolerance,this._requestManager=new e.RequestManager(te.transformRequest,te.accessToken),typeof te.container=="string"){if(this._container=e.window.document.getElementById(te.container),!this._container)throw new Error("Container '"+te.container+"' not found.")}else if(te.container instanceof $i)this._container=te.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(te.maxBounds&&this.setMaxBounds(te.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return me._update(!1)}),this.on("moveend",function(){return me._update(!1)}),this.on("zoom",function(){return me._update(!0)}),typeof e.window<"u"&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new qa(this,te);var tt=typeof te.hash=="string"&&te.hash||void 0;this._hash=te.hash&&new Al(tt).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:te.center,zoom:te.zoom,bearing:te.bearing,pitch:te.pitch}),te.bounds&&(this.resize(),this.fitBounds(te.bounds,e.extend({},te.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=te.localIdeographFontFamily,te.style&&this.setStyle(te.style,{localIdeographFontFamily:te.localIdeographFontFamily}),te.attributionControl&&this.addControl(new Tn({customAttribution:te.customAttribution})),this.addControl(new Ln,te.logoPosition),this.on("style.load",function(){me.transform.unmodified&&me.jumpTo(me.style.stylesheet)}),this.on("data",function(ft){me._update(ft.dataType==="style"),me.fire(new e.Event(ft.dataType+"data",ft))}),this.on("dataloading",function(ft){me.fire(new e.Event(ft.dataType+"dataloading",ft))})}ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W;var de={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return W.prototype._getMapId=function(){return this._mapId},W.prototype.addControl=function(me,Ue){if(Ue===void 0&&(me.getDefaultPosition?Ue=me.getDefaultPosition():Ue="top-right"),!me||!me.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var tt=me.onAdd(this);this._controls.push(me);var ft=this._controlPositions[Ue];return Ue.indexOf("bottom")!==-1?ft.insertBefore(tt,ft.firstChild):ft.appendChild(tt),this},W.prototype.removeControl=function(me){if(!me||!me.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var Ue=this._controls.indexOf(me);return Ue>-1&&this._controls.splice(Ue,1),me.onRemove(this),this},W.prototype.hasControl=function(me){return this._controls.indexOf(me)>-1},W.prototype.resize=function(me){var Ue=this._containerDimensions(),tt=Ue[0],ft=Ue[1];this._resizeCanvas(tt,ft),this.transform.resize(tt,ft),this.painter.resize(tt,ft);var st=!this._moving;return st&&(this.stop(),this.fire(new e.Event("movestart",me)).fire(new e.Event("move",me))),this.fire(new e.Event("resize",me)),st&&this.fire(new e.Event("moveend",me)),this},W.prototype.getBounds=function(){return this.transform.getBounds()},W.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},W.prototype.setMaxBounds=function(me){return this.transform.setMaxBounds(e.LngLatBounds.convert(me)),this._update()},W.prototype.setMinZoom=function(me){if(me=me??Mn,me>=Mn&&me<=this.transform.maxZoom)return this.transform.minZoom=me,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=me,this._update(),this.getZoom()>me&&this.setZoom(me),this;throw new Error("maxZoom must be greater than the current minZoom")},W.prototype.getMaxZoom=function(){return this.transform.maxZoom},W.prototype.setMinPitch=function(me){if(me=me??yn,me=yn&&me<=this.transform.maxPitch)return this.transform.minPitch=me,this._update(),this.getPitch()gi)throw new Error("maxPitch must be less than or equal to "+gi);if(me>=this.transform.minPitch)return this.transform.maxPitch=me,this._update(),this.getPitch()>me&&this.setPitch(me),this;throw new Error("maxPitch must be greater than the current minPitch")},W.prototype.getMaxPitch=function(){return this.transform.maxPitch},W.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},W.prototype.setRenderWorldCopies=function(me){return this.transform.renderWorldCopies=me,this._update()},W.prototype.project=function(me){return this.transform.locationPoint(e.LngLat.convert(me))},W.prototype.unproject=function(me){return this.transform.pointLocation(e.Point.convert(me))},W.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},W.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},W.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},W.prototype._createDelegatedListener=function(me,Ue,tt){var ft=this,st;if(me==="mouseenter"||me==="mouseover"){var bt=!1,It=function(tr){var pr=ft.getLayer(Ue)?ft.queryRenderedFeatures(tr.point,{layers:[Ue]}):[];pr.length?bt||(bt=!0,tt.call(ft,new Dt(me,ft,tr.originalEvent,{features:pr}))):bt=!1},Jt=function(){bt=!1};return{layer:Ue,listener:tt,delegates:{mousemove:It,mouseout:Jt}}}else if(me==="mouseleave"||me==="mouseout"){var Kt=!1,vr=function(tr){var pr=ft.getLayer(Ue)?ft.queryRenderedFeatures(tr.point,{layers:[Ue]}):[];pr.length?Kt=!0:Kt&&(Kt=!1,tt.call(ft,new Dt(me,ft,tr.originalEvent)))},Tr=function(tr){Kt&&(Kt=!1,tt.call(ft,new Dt(me,ft,tr.originalEvent)))};return{layer:Ue,listener:tt,delegates:{mousemove:vr,mouseout:Tr}}}else{var wr=function(tr){var pr=ft.getLayer(Ue)?ft.queryRenderedFeatures(tr.point,{layers:[Ue]}):[];pr.length&&(tr.features=pr,tt.call(ft,tr),delete tr.features)};return{layer:Ue,listener:tt,delegates:(st={},st[me]=wr,st)}}},W.prototype.on=function(me,Ue,tt){if(tt===void 0)return ye.prototype.on.call(this,me,Ue);var ft=this._createDelegatedListener(me,Ue,tt);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[me]=this._delegatedListeners[me]||[],this._delegatedListeners[me].push(ft);for(var st in ft.delegates)this.on(st,ft.delegates[st]);return this},W.prototype.once=function(me,Ue,tt){if(tt===void 0)return ye.prototype.once.call(this,me,Ue);var ft=this._createDelegatedListener(me,Ue,tt);for(var st in ft.delegates)this.once(st,ft.delegates[st]);return this},W.prototype.off=function(me,Ue,tt){var ft=this;if(tt===void 0)return ye.prototype.off.call(this,me,Ue);var st=function(bt){for(var It=bt[me],Jt=0;Jt180;){var tt=de.locationPoint(ye);if(tt.x>=0&&tt.y>=0&&tt.x<=de.width&&tt.y<=de.height)break;ye.lng>de.center.lng?ye.lng-=360:ye.lng+=360}return ye}var ys={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function xs(ye,W,de){var te=ye.classList;for(var me in ys)te.remove("mapboxgl-"+de+"-anchor-"+me);te.add("mapboxgl-"+de+"-anchor-"+W)}var Xs=function(ye){function W(de,te){if(ye.call(this),(de instanceof e.window.HTMLElement||te)&&(de=e.extend({element:de},te)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=de&&de.anchor||"center",this._color=de&&de.color||"#3FB1CE",this._scale=de&&de.scale||1,this._draggable=de&&de.draggable||!1,this._clickTolerance=de&&de.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=de&&de.rotation||0,this._rotationAlignment=de&&de.rotationAlignment||"auto",this._pitchAlignment=de&&de.pitchAlignment&&de.pitchAlignment!=="auto"?de.pitchAlignment:this._rotationAlignment,!de||!de.element){this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var me=r.createNS("http://www.w3.org/2000/svg","svg"),Ue=41,tt=27;me.setAttributeNS(null,"display","block"),me.setAttributeNS(null,"height",Ue+"px"),me.setAttributeNS(null,"width",tt+"px"),me.setAttributeNS(null,"viewBox","0 0 "+tt+" "+Ue);var ft=r.createNS("http://www.w3.org/2000/svg","g");ft.setAttributeNS(null,"stroke","none"),ft.setAttributeNS(null,"stroke-width","1"),ft.setAttributeNS(null,"fill","none"),ft.setAttributeNS(null,"fill-rule","evenodd");var st=r.createNS("http://www.w3.org/2000/svg","g");st.setAttributeNS(null,"fill-rule","nonzero");var bt=r.createNS("http://www.w3.org/2000/svg","g");bt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),bt.setAttributeNS(null,"fill","#000000");for(var It=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}],Jt=0,Kt=It;Jt=me}this._isDragging&&(this._pos=te.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag")))},W.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new e.Event("dragend")),this._state="inactive"},W.prototype._addDragHandler=function(te){this._element.contains(te.originalEvent.target)&&(te.preventDefault(),this._positionDelta=te.point.sub(this._pos).add(this._offset),this._pointerdownPos=te.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},W.prototype.setDraggable=function(te){return this._draggable=!!te,this._map&&(te?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},W.prototype.isDraggable=function(){return this._draggable},W.prototype.setRotation=function(te){return this._rotation=te||0,this._update(),this},W.prototype.getRotation=function(){return this._rotation},W.prototype.setRotationAlignment=function(te){return this._rotationAlignment=te||"auto",this._update(),this},W.prototype.getRotationAlignment=function(){return this._rotationAlignment},W.prototype.setPitchAlignment=function(te){return this._pitchAlignment=te&&te!=="auto"?te:this._rotationAlignment,this._update(),this},W.prototype.getPitchAlignment=function(){return this._pitchAlignment},W}(e.Evented),Ps={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Mu;function dl(ye){Mu!==void 0?ye(Mu):e.window.navigator.permissions!==void 0?e.window.navigator.permissions.query({name:"geolocation"}).then(function(W){Mu=W.state!=="denied",ye(Mu)}):(Mu=!!e.window.navigator.geolocation,ye(Mu))}var Eu=0,ac=!1,Lc=function(ye){function W(de){ye.call(this),this.options=e.extend({},Ps,de),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.onAdd=function(te){return this._map=te,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),dl(this._setupUI),this._container},W.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Eu=0,ac=!1},W.prototype._isOutOfMapMaxBounds=function(te){var me=this._map.getMaxBounds(),Ue=te.coords;return me&&(Ue.longitudeme.getEast()||Ue.latitudeme.getNorth())},W.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");break}},W.prototype._onSuccess=function(te){if(this._map){if(this._isOutOfMapMaxBounds(te)){this._setErrorState(),this.fire(new e.Event("outofmaxbounds",te)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=te,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");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(te),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(te),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",te)),this._finish()}},W.prototype._updateCamera=function(te){var me=new e.LngLat(te.coords.longitude,te.coords.latitude),Ue=te.coords.accuracy,tt=this._map.getBearing(),ft=e.extend({bearing:tt},this.options.fitBoundsOptions);this._map.fitBounds(me.toBounds(Ue),ft,{geolocateSource:!0})},W.prototype._updateMarker=function(te){if(te){var me=new e.LngLat(te.coords.longitude,te.coords.latitude);this._accuracyCircleMarker.setLngLat(me).addTo(this._map),this._userLocationDotMarker.setLngLat(me).addTo(this._map),this._accuracy=te.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},W.prototype._updateCircleRadius=function(){var te=this._map._container.clientHeight/2,me=this._map.unproject([0,te]),Ue=this._map.unproject([1,te]),tt=me.distanceTo(Ue),ft=Math.ceil(2*this._accuracy/tt);this._circleElement.style.width=ft+"px",this._circleElement.style.height=ft+"px"},W.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},W.prototype._onError=function(te){if(this._map){if(this.options.trackUserLocation)if(te.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 me=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=me,this._geolocateButton.setAttribute("aria-label",me),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(te.code===3&&ac)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",te)),this._finish()}},W.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},W.prototype._setupUI=function(te){var me=this;if(this._container.addEventListener("contextmenu",function(ft){return ft.preventDefault()}),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",te===!1){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var Ue=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=Ue,this._geolocateButton.setAttribute("aria-label",Ue)}else{var tt=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=tt,this._geolocateButton.setAttribute("aria-label",tt)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Xs(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Xs({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(ft){var st=ft.originalEvent&&ft.originalEvent.type==="resize";!ft.geolocateSource&&me._watchState==="ACTIVE_LOCK"&&!st&&(me._watchState="BACKGROUND",me._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),me._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),me.fire(new e.Event("trackuserlocationend")))})},W.prototype.trigger=function(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Eu--,ac=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"));break}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");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Eu++;var te;Eu>1?(te={maximumAge:6e5,timeout:0},ac=!0):(te=this.options.positionOptions,ac=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,te)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},W.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},W}(e.Evented),Pf={maxWidth:100,unit:"metric"},su=function(W){this.options=e.extend({},Pf,W),e.bindAll(["_onMove","setUnit"],this)};su.prototype.getDefaultPosition=function(){return"bottom-left"},su.prototype._onMove=function(){zu(this._map,this._container,this.options)},su.prototype.onAdd=function(W){return this._map=W,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",W.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},su.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},su.prototype.setUnit=function(W){this.options.unit=W,zu(this._map,this._container,this.options)};function zu(ye,W,de){var te=de&&de.maxWidth||100,me=ye._container.clientHeight/2,Ue=ye.unproject([0,me]),tt=ye.unproject([te,me]),ft=Ue.distanceTo(tt);if(de&&de.unit==="imperial"){var st=3.2808*ft;if(st>5280){var bt=st/5280;Fo(W,te,bt,ye._getUIString("ScaleControl.Miles"))}else Fo(W,te,st,ye._getUIString("ScaleControl.Feet"))}else if(de&&de.unit==="nautical"){var It=ft/1852;Fo(W,te,It,ye._getUIString("ScaleControl.NauticalMiles"))}else ft>=1e3?Fo(W,te,ft/1e3,ye._getUIString("ScaleControl.Kilometers")):Fo(W,te,ft,ye._getUIString("ScaleControl.Meters"))}function Fo(ye,W,de,te){var me=ll(de),Ue=me/de;ye.style.width=W*Ue+"px",ye.innerHTML=me+" "+te}function nc(ye){var W=Math.pow(10,Math.ceil(-Math.log(ye)/Math.LN10));return Math.round(ye*W)/W}function ll(ye){var W=Math.pow(10,(""+Math.floor(ye)).length-1),de=ye/W;return de=de>=10?10:de>=5?5:de>=3?3:de>=2?2:de>=1?1:nc(de),W*de}var Sl=function(W){this._fullscreen=!1,W&&W.container&&(W.container instanceof e.window.HTMLElement?this._container=W.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};Sl.prototype.onAdd=function(W){return this._map=W,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Sl.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Sl.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},Sl.prototype._setupUI=function(){var W=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",W).setAttribute("aria-hidden",!0),W.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Sl.prototype._updateTitle=function(){var W=this._getTitle();this._fullscreenButton.setAttribute("aria-label",W),this._fullscreenButton.title=W},Sl.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Sl.prototype._isFullscreen=function(){return this._fullscreen},Sl.prototype._changeIcon=function(){var W=e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement;W===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Sl.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var qc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Hc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),ss=function(ye){function W(de){ye.call(this),this.options=e.extend(Object.create(qc),de),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.addTo=function(te){return this._map&&this.remove(),this._map=te,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this},W.prototype.isOpen=function(){return!!this._map},W.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},W.prototype.getLngLat=function(){return this._lngLat},W.prototype.setLngLat=function(te){return this._lngLat=e.LngLat.convert(te),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},W.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},W.prototype.getElement=function(){return this._container},W.prototype.setText=function(te){return this.setDOMContent(e.window.document.createTextNode(te))},W.prototype.setHTML=function(te){var me=e.window.document.createDocumentFragment(),Ue=e.window.document.createElement("body"),tt;for(Ue.innerHTML=te;tt=Ue.firstChild,!!tt;)me.appendChild(tt);return this.setDOMContent(me)},W.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},W.prototype.setMaxWidth=function(te){return this.options.maxWidth=te,this._update(),this},W.prototype.setDOMContent=function(te){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(te),this._createCloseButton(),this._update(),this._focusFirstElement(),this},W.prototype.addClassName=function(te){this._container&&this._container.classList.add(te)},W.prototype.removeClassName=function(te){this._container&&this._container.classList.remove(te)},W.prototype.setOffset=function(te){return this.options.offset=te,this._update(),this},W.prototype.toggleClassName=function(te){if(this._container)return this._container.classList.toggle(te)},W.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},W.prototype._onMouseUp=function(te){this._update(te.point)},W.prototype._onMouseMove=function(te){this._update(te.point)},W.prototype._onDrag=function(te){this._update(te.point)},W.prototype._update=function(te){var me=this,Ue=this._lngLat||this._trackPointer;if(!(!this._map||!Ue||!this._content)&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(vr){return me._container.classList.add(vr)}),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=Xo(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!te))){var tt=this._pos=this._trackPointer&&te?te:this._map.project(this._lngLat),ft=this.options.anchor,st=js(this.options.offset);if(!ft){var bt=this._container.offsetWidth,It=this._container.offsetHeight,Jt;tt.y+st.bottom.ythis._map.transform.height-It?Jt=["bottom"]:Jt=[],tt.xthis._map.transform.width-bt/2&&Jt.push("right"),Jt.length===0?ft="bottom":ft=Jt.join("-")}var Kt=tt.add(st[ft]).round();r.setTransform(this._container,ys[ft]+" translate("+Kt.x+"px,"+Kt.y+"px)"),xs(this._container,ft,"popup")}},W.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var te=this._container.querySelector(Hc);te&&te.focus()}},W.prototype._onClose=function(){this.remove()},W}(e.Evented);function js(ye){if(ye)if(typeof ye=="number"){var W=Math.round(Math.sqrt(.5*Math.pow(ye,2)));return{center:new e.Point(0,0),top:new e.Point(0,ye),"top-left":new e.Point(W,W),"top-right":new e.Point(-W,W),bottom:new e.Point(0,-ye),"bottom-left":new e.Point(W,-W),"bottom-right":new e.Point(-W,-W),left:new e.Point(ye,0),right:new e.Point(-ye,0)}}else if(ye instanceof e.Point||Array.isArray(ye)){var de=e.Point.convert(ye);return{center:de,top:de,"top-left":de,"top-right":de,bottom:de,"bottom-left":de,"bottom-right":de,left:de,right:de}}else return{center:e.Point.convert(ye.center||[0,0]),top:e.Point.convert(ye.top||[0,0]),"top-left":e.Point.convert(ye["top-left"]||[0,0]),"top-right":e.Point.convert(ye["top-right"]||[0,0]),bottom:e.Point.convert(ye.bottom||[0,0]),"bottom-left":e.Point.convert(ye["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(ye["bottom-right"]||[0,0]),left:e.Point.convert(ye.left||[0,0]),right:e.Point.convert(ye.right||[0,0])};else return js(new e.Point(0,0))}var ls={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:ro,NavigationControl:no,GeolocateControl:Lc,AttributionControl:Tn,ScaleControl:su,FullscreenControl:Sl,Popup:ss,Marker:Xs,Style:Dl,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:Lr,clearPrewarmedResources:Er,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(ye){e.config.ACCESS_TOKEN=ye},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(ye){e.config.API_URL=ye},get workerCount(){return sa.workerCount},set workerCount(ye){sa.workerCount=ye},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(ye){e.config.MAX_PARALLEL_IMAGE_REQUESTS=ye},clearStorage:function(W){e.clearTileCache(W)},workerUrl:""};return ls}),A})}}),XI=He({"src/plots/mapbox/layers.js"(Y,G){var d=Gr(),x=yl().sanitizeHTML,A=OT(),E=dd();function e(i,n){this.subplot=i,this.uid=i.uid+"-"+n,this.index=n,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(n){this.visible?this.needsNewImage(n)?this.updateImage(n):this.needsNewSource(n)?(this.removeLayer(),this.updateSource(n),this.updateLayer(n)):this.needsNewLayer(n)?this.updateLayer(n):this.updateStyle(n):(this.updateSource(n),this.updateLayer(n)),this.visible=r(n)},t.needsNewImage=function(i){var n=this.subplot.map;return n.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var n=this.subplot.map;n.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapboxLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var n=this.subplot.map;if(n.getSource(this.idSource)&&n.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=a(i);n.addSource(this.idSource,s)}},t.findFollowingMapboxLayerId=function(i){if(i==="traces")for(var n=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var n={},s={};switch(i.type){case"circle":d.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":d.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":d.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var c=i.symbol,f=A(c.textposition,c.iconsize);d.extendFlat(n,{"icon-image":c.icon+"-15","icon-size":c.iconsize/10,"text-field":c.text,"text-size":c.textfont.size,"text-anchor":f.anchor,"text-offset":f.offset,"symbol-placement":c.placement}),d.extendFlat(s,{"icon-color":i.color,"text-color":c.textfont.color,"text-opacity":i.opacity});break;case"raster":d.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:n,paint:s}}function a(i){var n=i.sourcetype,s=i.source,c={type:n},f;return n==="geojson"?f="data":n==="vector"?f=typeof s=="string"?"url":"tiles":n==="raster"?(f="tiles",c.tileSize=256):n==="image"&&(f="url",c.coordinates=i.coordinates),c[f]=s,i.sourceattribution&&(c.attribution=x(i.sourceattribution)),c}G.exports=function(n,s,c){var f=new e(n,s);return f.update(c),f}}}),YI=He({"src/plots/mapbox/mapbox.js"(Y,G){var d=BT(),x=Gr(),A=ip(),E=Ei(),e=io(),t=fh(),r=Wu(),o=bv(),a=o.drawMode,i=o.selectMode,n=dc().prepSelect,s=dc().clearOutline,c=dc().clearSelectionsCache,f=dc().selectOnClick,v=dd(),h=XI();function T(_,w){this.id=w,this.gd=_;var p=_._fullLayout,u=_._context;this.container=p._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(_,w,p){var u=this,g=w[u.id];u.map&&g.accesstoken!==u.accessToken&&(u.map.remove(),u.map=null,u.styleObj=null,u.traceHash={},u.layerList=[]);var m;u.map?m=new Promise(function(R,P){u.updateMap(_,w,R,P)}):m=new Promise(function(R,P){u.createMap(_,w,R,P)}),p.push(m)},l.createMap=function(_,w,p,u){var g=this,m=w[g.id],R=g.styleObj=b(m.style,w);g.accessToken=m.accesstoken;var P=m.bounds,z=P?[[P.west,P.south],[P.east,P.north]]:null,F=g.map=new d.Map({container:g.div,style:R.style,center:M(m.center),zoom:m.zoom,bearing:m.bearing,pitch:m.pitch,maxBounds:z,interactive:!g.isStatic,preserveDrawingBuffer:g.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0}));F._canvas.style.left="0px",F._canvas.style.top="0px",g.rejectOnError(u),g.isStatic||g.initFx(_,w);var B=[];B.push(new Promise(function(O){F.once("load",O)})),B=B.concat(A.fetchTraceGeoData(_)),Promise.all(B).then(function(){g.fillBelowLookup(_,w),g.updateData(_),g.updateLayout(w),g.resolveOnRender(p)}).catch(u)},l.updateMap=function(_,w,p,u){var g=this,m=g.map,R=w[this.id];g.rejectOnError(u);var P=[],z=b(R.style,w);JSON.stringify(g.styleObj)!==JSON.stringify(z)&&(g.styleObj=z,m.setStyle(z.style),g.traceHash={},P.push(new Promise(function(F){m.once("styledata",F)}))),P=P.concat(A.fetchTraceGeoData(_)),Promise.all(P).then(function(){g.fillBelowLookup(_,w),g.updateData(_),g.updateLayout(w),g.resolveOnRender(p)}).catch(u)},l.fillBelowLookup=function(_,w){var p=w[this.id],u=p.layers,g,m,R=this.belowLookup={},P=!1;for(g=0;g<_.length;g++){var z=_[g][0].trace,F=z._module;typeof z.below=="string"?m=z.below:F.getBelow&&(m=F.getBelow(z,this)),m===""&&(P=!0),R["trace-"+z.uid]=m||""}for(g=0;g1)for(g=0;g-1&&f(z.originalEvent,u,[p.xaxis],[p.yaxis],p.id,P),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(_){var w=this,p=w.map,u=w.gd;if(w.isStatic)return;function g(z){var F=w.map.unproject(z);return[F.lng,F.lat]}var m=_.dragmode,R;R=function(z,F){if(F.isRect){var B=z.range={};B[w.id]=[g([F.xmin,F.ymin]),g([F.xmax,F.ymax])]}else{var O=z.lassoPoints={};O[w.id]=F.map(g)}};var P=w.dragOptions;w.dragOptions=x.extendDeep(P||{},{dragmode:_.dragmode,element:w.div,gd:u,plotinfo:{id:w.id,domain:_[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:R},xaxes:[w.xaxis],yaxes:[w.yaxis],subplot:w.id}),p.off("click",w.onClickInPanHandler),i(m)||a(m)?(p.dragPan.disable(),p.on("zoomstart",w.clearOutline),w.dragOptions.prepFn=function(z,F,B){n(z,F,B,w.dragOptions,m)},t.init(w.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",w.clearOutline),w.div.onmousedown=null,w.div.ontouchstart=null,w.div.removeEventListener("touchstart",w.div._ontouchstart),w.onClickInPanHandler=w.onClickInPanFn(w.dragOptions),p.on("click",w.onClickInPanHandler))},l.updateFramework=function(_){var w=_[this.id].domain,p=_._size,u=this.div.style;u.width=p.w*(w.x[1]-w.x[0])+"px",u.height=p.h*(w.y[1]-w.y[0])+"px",u.left=p.l+w.x[0]*p.w+"px",u.top=p.t+(1-w.y[1])*p.h+"px",this.xaxis._offset=p.l+w.x[0]*p.w,this.xaxis._length=p.w*(w.x[1]-w.x[0]),this.yaxis._offset=p.t+(1-w.y[1])*p.h,this.yaxis._length=p.h*(w.y[1]-w.y[0])},l.updateLayers=function(_){var w=_[this.id],p=w.layers,u=this.layerList,g;if(p.length!==u.length){for(g=0;gB/2){var O=R.split("|").join("
");z.text(O).attr("data-unformatted",O).call(o.convertToTspans,h),F=r.bBox(z.node())}z.attr("transform",x(-3,-F.height+8)),P.insert("rect",".static-attribution").attr({x:-F.width-6,y:-F.height-3,width:F.width+6,height:F.height+3,fill:"rgba(255, 255, 255, 0.75)"});var L=1;F.width+6>B&&(L=B/(F.width+6));var N=[y.l+y.w*M.x[1],y.t+y.h*(1-M.y[0])];P.attr("transform",x(N[0],N[1])+A(L))}};function f(h,T){var l=h._fullLayout,y=h._context;if(y.mapboxAccessToken==="")return"";for(var b=[],S=[],M=!1,_=!1,w=0;w1&&d.warn(n.multipleTokensErrorMsg),b[0]):(S.length&&d.log(["Listed mapbox access token(s)",S.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function v(h){return typeof h=="string"&&(n.styleValuesMapbox.indexOf(h)!==-1||h.indexOf("mapbox://")===0||h.indexOf("stamen")===0)}Y.updateFx=function(h){for(var T=h._fullLayout,l=T._subplots[i],y=0;y=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},G.exports=function(r,o){var a=o[0].trace,i=new E(r,a.uid),n=i.sourceId,s=d(o),c=i.below=r.belowLookup["trace-"+a.uid];return r.map.addSource(n,{type:"geojson",data:s.geojson}),i._addLayers(s,c),o[0].trace._glTrace=i,i}}}),tR=He({"src/traces/choroplethmapbox/index.js"(Y,G){G.exports={attributes:NT(),supplyDefaults:QI(),colorbar:Zd(),calc:G_(),plot:eR(),hoverPoints:Z_(),eventData:X_(),selectPoints:Y_(),styleOnSelect:function(d,x){if(x){var A=x[0].trace;A._glTrace.updateOnSelect(x)}},getBelow:function(d,x){for(var A=x.getMapLayers(),E=A.length-2;E>=0;E--){var e=A[E].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=E+1;t0?+h[f]:0),c.push({type:"Feature",geometry:{type:"Point",coordinates:b},properties:S})}}var _=E.extractOpts(a),w=_.reversescale?E.flipScale(_.colorscale):_.colorscale,p=w[0][1],u=A.opacity(p)<1?p:A.addOpacity(p,0),g=["interpolate",["linear"],["heatmap-density"],0,u];for(f=1;f=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},G.exports=function(t,r){var o=r[0].trace,a=new A(t,o.uid),i=a.sourceId,n=d(r),s=a.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:n.geojson}),a._addLayers(n,s),a}}}),sR=He({"src/traces/densitymapbox/hover.js"(Y,G){var d=io(),x=lx().hoverPoints,A=lx().getExtraText;G.exports=function(e,t,r){var o=x(e,t,r);if(o){var a=o[0],i=a.cd,n=i[0].trace,s=i[a.index];if(delete a.color,"z"in s){var c=a.subplot.mockAxis;a.z=s.z,a.zLabel=d.tickText(c,c.c2l(s.z),"hover").text}return a.extraText=A(n,s,i[0].t.labels),[a]}}}}),lR=He({"src/traces/densitymapbox/event_data.js"(Y,G){G.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x.z=A.z,x}}}),uR=He({"src/traces/densitymapbox/index.js"(Y,G){G.exports={attributes:jT(),supplyDefaults:aR(),colorbar:Zd(),formatLabels:FT(),calc:nR(),plot:oR(),hoverPoints:sR(),eventData:lR(),getBelow:function(d,x){for(var A=x.getMapLayers(),E=0;EESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":`{name:latin} +{name:nonlatin}`,"text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),hR=He({"src/plots/map/styles/arcgis-sat.js"(Y,G){G.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),up=He({"src/plots/map/constants.js"(Y,G){var d=Ud(),x=fR(),A=hR(),E='© OpenStreetMap contributors',e="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",t="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",r="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",i="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",n={basic:r,streets:r,outdoors:r,light:e,dark:t,satellite:A,"satellite-streets":x,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:E,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":e,"carto-darkmatter":t,"carto-voyager":r,"carto-positron-nolabels":o,"carto-darkmatter-nolabels":a,"carto-voyager-nolabels":i},s=d(n);G.exports={styleValueDflt:"basic",stylesMap:n,styleValuesMap:s,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",s.join(", "),"or use a tile service."].join(` +`),mapOnErrorMsg:"Map error."}}}),Jy=He({"src/plots/map/layout_attributes.js"(Y,G){var d=Gr(),x=Ai().defaultLine,A=mu().attributes,E=Yl(),e=Zu().textposition,t=hu().overrideAll,r=Gs().templatedArray,o=up(),a=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});a.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=G.exports=t({_arrayAttrRegexps:[d.counterRegex("map",".layers",!0)],domain:A({name:"map"}),style:{valType:"any",values:o.styleValuesMap,dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:x},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:x}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:a,textposition:d.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),cx=He({"src/traces/scattermap/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=Yo().texttemplateAttrs,A=wv(),E=Zp(),e=Zu(),t=Jy(),r=cl(),o=kl(),a=ho().extendFlat,i=hu().overrideAll,n=Jy(),s=E.line,c=E.marker;G.exports=i({lon:E.lon,lat:E.lat,cluster:{enabled:{valType:"boolean"},maxzoom:a({},n.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:a({},c.opacity,{dflt:1})},mode:a({},e.mode,{dflt:"markers"}),text:a({},e.text,{}),texttemplate:x({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:a({},e.hovertext,{}),line:{color:s.color,width:s.width},connectgaps:e.connectgaps,marker:a({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode},o("marker")),fill:E.fill,fillcolor:A(),textfont:t.layers.symbol.textfont,textposition:t.layers.symbol.textposition,below:{valType:"string"},selected:{marker:e.selected.marker},unselected:{marker:e.unselected.marker},hoverinfo:a({},r.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d()},"calc","nested")}}),VT=He({"src/traces/scattermap/constants.js"(Y,G){var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];G.exports={isSupportedFont:function(x){return d.indexOf(x)!==-1}}}}),vR=He({"src/traces/scattermap/defaults.js"(Y,G){var d=Gr(),x=Rl(),A=Kh(),E=nv(),e=iv(),t=Av(),r=cx(),o=VT().isSupportedFont;G.exports=function(n,s,c,f){function v(g,m){return d.coerce(n,s,r,g,m)}function h(g,m){return d.coerce2(n,s,r,g,m)}var T=a(n,s,v);if(!T){s.visible=!1;return}if(v("text"),v("texttemplate"),v("hovertext"),v("hovertemplate"),v("mode"),v("below"),x.hasMarkers(s)){A(n,s,c,f,v,{noLine:!0,noAngle:!0}),v("marker.allowoverlap"),v("marker.angle");var l=s.marker;l.symbol!=="circle"&&(d.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),d.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}x.hasLines(s)&&(E(n,s,c,f,v,{noDash:!0}),v("connectgaps"));var y=h("cluster.maxzoom"),b=h("cluster.step"),S=h("cluster.color",s.marker&&s.marker.color||c),M=h("cluster.size"),_=h("cluster.opacity"),w=y!==!1||b!==!1||S!==!1||M!==!1||_!==!1,p=v("cluster.enabled",w);if(p||x.hasText(s)){var u=f.font.family;e(n,s,f,v,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}v("fill"),s.fill!=="none"&&t(n,s,c,v),d.coerceSelectionMarkerOpacity(s,v)};function a(i,n,s){var c=s("lon")||[],f=s("lat")||[],v=Math.min(c.length,f.length);return n._length=v,v}}}),qT=He({"src/traces/scattermap/format_labels.js"(Y,G){var d=io();G.exports=function(A,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,a=A.lonlat;return t.lonLabel=d.tickText(o,o.c2l(a[0]),!0).text,t.latLabel=d.tickText(o,o.c2l(a[1]),!0).text,t}}}),HT=He({"src/plots/map/convert_text_opts.js"(Y,G){var d=Gr();G.exports=function(A,E){var e=A.split(" "),t=e[0],r=e[1],o=d.isArrayOrTypedArray(E)?d.mean(E):E,a=.5+o/100,i=1.5+o/100,n=["",""],s=[0,0];switch(t){case"top":n[0]="top",s[1]=-i;break;case"bottom":n[0]="bottom",s[1]=i;break}switch(r){case"left":n[1]="right",s[0]=-a;break;case"right":n[1]="left",s[0]=a;break}var c;return n[0]&&n[1]?c=n.join("-"):n[0]?c=n[0]:n[1]?c=n[1]:c="center",{anchor:c,offset:s}}}}),dR=He({"src/traces/scattermap/convert.js"(Y,G){var d=Hi(),x=Gr(),A=lo().BADNUM,E=np(),e=Kl(),t=vo(),r=B0(),o=Rl(),a=VT().isSupportedFont,i=HT(),n=Ph().appendArrayPointValue,s=yl().NEWLINES,c=yl().BR_TAG_ALL;G.exports=function(_,w){var p=w[0].trace,u=p.visible===!0&&p._length!==0,g=p.fill!=="none",m=o.hasLines(p),R=o.hasMarkers(p),P=o.hasText(p),z=R&&p.marker.symbol==="circle",F=R&&p.marker.symbol!=="circle",B=p.cluster&&p.cluster.enabled,O=f("fill"),L=f("line"),N=f("circle"),U=f("symbol"),Z={fill:O,line:L,circle:N,symbol:U};if(!u)return Z;var Q;if((g||m)&&(Q=E.calcTraceToLineCoords(w)),g&&(O.geojson=E.makePolygon(Q),O.layout.visibility="visible",x.extendFlat(O.paint,{"fill-color":p.fillcolor})),m&&(L.geojson=E.makeLine(Q),L.layout.visibility="visible",x.extendFlat(L.paint,{"line-width":p.line.width,"line-color":p.line.color,"line-opacity":p.opacity})),z){var ue=v(w);N.geojson=ue.geojson,N.layout.visibility="visible",B&&(N.filter=["!",["has","point_count"]],Z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":b(p.cluster.color,p.cluster.step),"circle-radius":b(p.cluster.size,p.cluster.step),"circle-opacity":b(p.cluster.opacity,p.cluster.step)}},Z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(p),"text-size":12}}),x.extendFlat(N.paint,{"circle-color":ue.mcc,"circle-radius":ue.mrc,"circle-opacity":ue.mo})}if(z&&B&&(N.filter=["!",["has","point_count"]]),(F||P)&&(U.geojson=h(w,_),x.extendFlat(U.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(x.extendFlat(U.layout,{"icon-size":p.marker.size/10}),"angle"in p.marker&&p.marker.angle!=="auto"&&x.extendFlat(U.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),U.layout["icon-allow-overlap"]=p.marker.allowoverlap,x.extendFlat(U.paint,{"icon-opacity":p.opacity*p.marker.opacity,"icon-color":p.marker.color})),P)){var oe=(p.marker||{}).size,le=i(p.textposition,oe);x.extendFlat(U.layout,{"text-size":p.textfont.size,"text-anchor":le.anchor,"text-offset":le.offset,"text-font":S(p)}),x.extendFlat(U.paint,{"text-color":p.textfont.color,"text-opacity":p.opacity})}return Z};function f(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function v(M){var _=M[0].trace,w=_.marker,p=_.selectedpoints,u=x.isArrayOrTypedArray(w.color),g=x.isArrayOrTypedArray(w.size),m=x.isArrayOrTypedArray(w.opacity),R;function P(oe){return _.opacity*oe}function z(oe){return oe/2}var F;u&&(e.hasColorscale(_,"marker")?F=e.makeColorScaleFuncFromTrace(w):F=x.identity);var B;g&&(B=r(_));var O;m&&(O=function(oe){var le=d(oe)?+x.constrain(oe,0,1):0;return P(le)});var L=[];for(R=0;R850?R+=" Black":u>750?R+=" Extra Bold":u>650?R+=" Bold":u>550?R+=" Semi Bold":u>450?R+=" Medium":u>350?R+=" Regular":u>250?R+=" Light":u>150?R+=" Extra Light":R+=" Thin"):g.slice(0,2).join(" ")==="Open Sans"?(R="Open Sans",u>750?R+=" Extrabold":u>650?R+=" Bold":u>550?R+=" Semibold":u>350?R+=" Regular":R+=" Light"):g.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(R="Klokantech Noto Sans",g[3]==="CJK"&&(R+=" CJK"),R+=u>500?" Bold":" Regular")),m&&(R+=" Italic"),R==="Open Sans Regular Italic"?R="Open Sans Italic":R==="Open Sans Regular Bold"?R="Open Sans Bold":R==="Open Sans Regular Bold Italic"?R="Open Sans Bold Italic":R==="Klokantech Noto Sans Regular Italic"&&(R="Klokantech Noto Sans Italic"),a(R)||(R=w);var P=R.split(", ");return P}}}),pR=He({"src/traces/scattermap/plot.js"(Y,G){var d=Gr(),x=dR(),A=up().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,a,i){this.type="scattermap",this.subplot=r,this.uid=o,this.clusterEnabled=a,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:A+o+"-fill",line:A+o+"-line",circle:A+o+"-circle",symbol:A+o+"-symbol",cluster:A+o+"-cluster",clusterCount:A+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,a){var i={type:"geojson",data:o.geojson};a&&a.enabled&&d.extendFlat(i,{cluster:!0,clusterMaxZoom:a.maxzoom});var n=this.subplot.map.getSource(this.sourceIds[r]);n?n.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,a){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var n=this.layerIds[r],s,c=this.subplot.getMapLayers(),f=0;f=0;m--){var R=g[m];n.removeLayer(h.layerIds[R])}u||n.removeSource(h.sourceIds.circle)}function y(u){for(var g=E.nonCluster,m=0;m=0;m--){var R=g[m];n.removeLayer(h.layerIds[R]),u||n.removeSource(h.sourceIds[R])}}function S(u){v?l(u):b(u)}function M(u){f?T(u):y(u)}function _(){for(var u=f?E.cluster:E.nonCluster,g=0;g=0;i--){var n=a[i];o.removeLayer(this.layerIds[n]),o.removeSource(this.sourceIds[n])}},G.exports=function(o,a){var i=a[0].trace,n=i.cluster&&i.cluster.enabled,s=i.visible!==!0,c=new e(o,i.uid,n,s),f=x(o.gd,a),v=c.below=o.belowLookup["trace-"+i.uid],h,T,l;if(n)for(c.addSource("circle",f.circle,i.cluster),h=0;h=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=S*360,_=i-M;function w(B){var O=B.lonlat;if(O[0]===e||y&&T.indexOf(B.i+1)===-1)return 1/0;var L=x.modHalf(O[0],360),N=O[1],U=h.project([L,N]),Z=U.x-f.c2p([_,N]),Q=U.y-v.c2p([L,n]),ue=Math.max(3,B.mrc||0);return Math.max(Math.sqrt(Z*Z+Q*Q)-ue,1-3/ue)}if(d.getClosest(s,w,a),a.index!==!1){var p=s[a.index],u=p.lonlat,g=[x.modHalf(u[0],360)+M,u[1]],m=f.c2p(g),R=v.c2p(g),P=p.mrc||1;a.x0=m-P,a.x1=m+P,a.y0=R-P,a.y1=R+P;var z={};z[c.subplot]={_subplot:h};var F=c._module.formatLabels(p,c,z);return a.lonLabel=F.lonLabel,a.latLabel=F.latLabel,a.color=A(c,p),a.extraText=o(c,p,s[0].t.labels),a.hovertemplate=c.hovertemplate,[a]}}function o(a,i,n){if(a.hovertemplate)return;var s=i.hi||a.hoverinfo,c=s.split("+"),f=c.indexOf("all")!==-1,v=c.indexOf("lon")!==-1,h=c.indexOf("lat")!==-1,T=i.lonlat,l=[];function y(b){return b+"°"}return f||v&&h?l.push("("+y(T[1])+", "+y(T[0])+")"):v?l.push(n.lon+y(T[0])):h&&l.push(n.lat+y(T[1])),(f||c.indexOf("text")!==-1)&&E(i,a,l),l.join("
")}G.exports={hoverPoints:r,getExtraText:o}}}),gR=He({"src/traces/scattermap/event_data.js"(Y,G){G.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x}}}),yR=He({"src/traces/scattermap/select.js"(Y,G){var d=Gr(),x=Rl(),A=lo().BADNUM;G.exports=function(e,t){var r=e.cd,o=e.xaxis,a=e.yaxis,i=[],n=r[0].trace,s;if(!x.hasMarkers(n))return[];if(t===!1)for(s=0;s1)return 1;for(var K=H,he=0;he<8;he++){var Ee=this.sampleCurveX(K)-H;if(Math.abs(Ee)Ee?Ve=K:nt=K,K=.5*(nt-Ve)+Ve;return K},solve:function(H,D){return this.sampleCurveY(this.solveCurveX(H,D))}};var c=r(n);let f,v;function h(){return f==null&&(f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),f}function T(){if(v==null&&(v=!1,h())){const D=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(D){for(let he=0;he<5*5;he++){const Ee=4*he;D.fillStyle=`rgb(${Ee},${Ee+1},${Ee+2})`,D.fillRect(he%5,Math.floor(he/5),1,1)}const K=D.getImageData(0,0,5,5).data;for(let he=0;he<5*5*4;he++)if(he%4!=3&&K[he]!==he){v=!0;break}}}return v||!1}function l(H,D,K,he){const Ee=new c(H,D,K,he);return Be=>Ee.solve(Be)}const y=l(.25,.1,.25,1);function b(H,D,K){return Math.min(K,Math.max(D,H))}function S(H,D,K){const he=K-D,Ee=((H-D)%he+he)%he+D;return Ee===D?K:Ee}function M(H,...D){for(const K of D)for(const he in K)H[he]=K[he];return H}let _=1;function w(H,D,K){const he={};for(const Ee in H)he[Ee]=D.call(this,H[Ee],Ee,H);return he}function p(H,D,K){const he={};for(const Ee in H)D.call(this,H[Ee],Ee,H)&&(he[Ee]=H[Ee]);return he}function u(H){return Array.isArray(H)?H.map(u):typeof H=="object"&&H?w(H,u):H}const g={};function m(H){g[H]||(typeof console<"u"&&console.warn(H),g[H]=!0)}function R(H,D,K){return(K.y-H.y)*(D.x-H.x)>(D.y-H.y)*(K.x-H.x)}function P(H){return typeof WorkerGlobalScope<"u"&&H!==void 0&&H instanceof WorkerGlobalScope}let z=null;function F(H){return typeof ImageBitmap<"u"&&H instanceof ImageBitmap}const B="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function O(H,D,K,he,Ee){return t(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const Be=new VideoFrame(H,{timestamp:0});try{const Ve=Be==null?void 0:Be.format;if(!Ve||!Ve.startsWith("BGR")&&!Ve.startsWith("RGB"))throw new Error(`Unrecognized format ${Ve}`);const nt=Ve.startsWith("BGR"),mt=new Uint8ClampedArray(he*Ee*4);if(yield Be.copyTo(mt,function(Pt,Xt,er,br,Rr){const jr=4*Math.max(-Xt,0),Yr=(Math.max(0,er)-er)*br*4+jr,ca=4*br,Ca=Math.max(0,Xt),un=Math.max(0,er);return{rect:{x:Ca,y:un,width:Math.min(Pt.width,Xt+br)-Ca,height:Math.min(Pt.height,er+Rr)-un},layout:[{offset:Yr,stride:ca}]}}(H,D,K,he,Ee)),nt)for(let Pt=0;PtP(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,J=function(H,D){if(/:\/\//.test(H.url)&&!/^https?:|^file:/.test(H.url)){const he=ue(H.url);if(he)return he(H,D);if(P(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:H,targetMapId:oe},D)}if(!(/^file:/.test(K=H.url)||/^file:/.test(j())&&!/^\w+:/.test(K))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(he,Ee){return t(this,void 0,void 0,function*(){const Be=new Request(he.url,{method:he.method||"GET",body:he.body,credentials:he.credentials,headers:he.headers,cache:he.cache,referrer:j(),signal:Ee.signal});he.type!=="json"||Be.headers.has("Accept")||Be.headers.set("Accept","application/json");const Ve=yield fetch(Be);if(!Ve.ok){const Pt=yield Ve.blob();throw new le(Ve.status,Ve.statusText,he.url,Pt)}let nt;nt=he.type==="arrayBuffer"||he.type==="image"?Ve.arrayBuffer():he.type==="json"?Ve.json():Ve.text();const mt=yield nt;if(Ee.signal.aborted)throw Z();return{data:mt,cacheControl:Ve.headers.get("Cache-Control"),expires:Ve.headers.get("Expires")}})}(H,D);if(P(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:H,mustQueue:!0,targetMapId:oe},D)}var K;return function(he,Ee){return new Promise((Be,Ve)=>{var nt;const mt=new XMLHttpRequest;mt.open(he.method||"GET",he.url,!0),he.type!=="arrayBuffer"&&he.type!=="image"||(mt.responseType="arraybuffer");for(const Pt in he.headers)mt.setRequestHeader(Pt,he.headers[Pt]);he.type==="json"&&(mt.responseType="text",!((nt=he.headers)===null||nt===void 0)&&nt.Accept||mt.setRequestHeader("Accept","application/json")),mt.withCredentials=he.credentials==="include",mt.onerror=()=>{Ve(new Error(mt.statusText))},mt.onload=()=>{if(!Ee.signal.aborted)if((mt.status>=200&&mt.status<300||mt.status===0)&&mt.response!==null){let Pt=mt.response;if(he.type==="json")try{Pt=JSON.parse(mt.response)}catch(Xt){return void Ve(Xt)}Be({data:Pt,cacheControl:mt.getResponseHeader("Cache-Control"),expires:mt.getResponseHeader("Expires")})}else{const Pt=new Blob([mt.response],{type:mt.getResponseHeader("Content-Type")});Ve(new le(mt.status,mt.statusText,he.url,Pt))}},Ee.signal.addEventListener("abort",()=>{mt.abort(),Ve(Z())}),mt.send(he.body)})}(H,D)};function $(H){if(!H||H.indexOf("://")<=0||H.indexOf("data:image/")===0||H.indexOf("blob:")===0)return!0;const D=new URL(H),K=window.location;return D.protocol===K.protocol&&D.host===K.host}function X(H,D,K){K[H]&&K[H].indexOf(D)!==-1||(K[H]=K[H]||[],K[H].push(D))}function re(H,D,K){if(K&&K[H]){const he=K[H].indexOf(D);he!==-1&&K[H].splice(he,1)}}class ee{constructor(D,K={}){M(this,K),this.type=D}}class q extends ee{constructor(D,K={}){super("error",M({error:D},K))}}class ae{on(D,K){return this._listeners=this._listeners||{},X(D,K,this._listeners),this}off(D,K){return re(D,K,this._listeners),re(D,K,this._oneTimeListeners),this}once(D,K){return K?(this._oneTimeListeners=this._oneTimeListeners||{},X(D,K,this._oneTimeListeners),this):new Promise(he=>this.once(D,he))}fire(D,K){typeof D=="string"&&(D=new ee(D,K||{}));const he=D.type;if(this.listens(he)){D.target=this;const Ee=this._listeners&&this._listeners[he]?this._listeners[he].slice():[];for(const nt of Ee)nt.call(this,D);const Be=this._oneTimeListeners&&this._oneTimeListeners[he]?this._oneTimeListeners[he].slice():[];for(const nt of Be)re(he,nt,this._oneTimeListeners),nt.call(this,D);const Ve=this._eventedParent;Ve&&(M(D,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),Ve.fire(D))}else D instanceof q&&console.error(D.error);return this}listens(D){return this._listeners&&this._listeners[D]&&this._listeners[D].length>0||this._oneTimeListeners&&this._oneTimeListeners[D]&&this._oneTimeListeners[D].length>0||this._eventedParent&&this._eventedParent.listens(D)}setEventedParent(D,K){return this._eventedParent=D,this._eventedParentData=K,this}}var ie={$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"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:{},"viewport-glyph":{},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-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},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"}}};const fe=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function we(H,D){const K={};for(const he in H)he!=="ref"&&(K[he]=H[he]);return fe.forEach(he=>{he in D&&(K[he]=D[he])}),K}function Ae(H,D){if(Array.isArray(H)){if(!Array.isArray(D)||H.length!==D.length)return!1;for(let K=0;K`:H.itemType.kind==="value"?"array":`array<${D}>`}return H.kind}const Oe=[rt,Je,At,St,Rt,Mr,Ut,ze(ir),fr,dr,pt];function ve(H,D){if(D.kind==="error")return null;if(H.kind==="array"){if(D.kind==="array"&&(D.N===0&&D.itemType.kind==="value"||!ve(H.itemType,D.itemType))&&(typeof H.N!="number"||H.N===D.N))return null}else{if(H.kind===D.kind)return null;if(H.kind==="value"){for(const K of Oe)if(!ve(K,D))return null}}return`Expected ${Ge(H)} but found ${Ge(D)} instead.`}function ge(H,D){return D.some(K=>K.kind===H.kind)}function be(H,D){return D.some(K=>K==="null"?H===null:K==="array"?Array.isArray(H):K==="object"?H&&!Array.isArray(H)&&typeof H=="object":K===typeof H)}function Pe(H,D){return H.kind==="array"&&D.kind==="array"?H.itemType.kind===D.itemType.kind&&typeof H.N=="number":H.kind===D.kind}const We=.96422,ct=.82521,_t=4/29,Mt=6/29,Nt=3*Mt*Mt,Bt=Mt*Mt*Mt,qt=Math.PI/180,Zt=180/Math.PI;function lr(H){return(H%=360)<0&&(H+=360),H}function ta([H,D,K,he]){let Ee,Be;const Ve=wa((.2225045*(H=da(H))+.7168786*(D=da(D))+.0606169*(K=da(K)))/1);H===D&&D===K?Ee=Be=Ve:(Ee=wa((.4360747*H+.3850649*D+.1430804*K)/We),Be=wa((.0139322*H+.0971045*D+.7141733*K)/ct));const nt=116*Ve-16;return[nt<0?0:nt,500*(Ee-Ve),200*(Ve-Be),he]}function da(H){return H<=.04045?H/12.92:Math.pow((H+.055)/1.055,2.4)}function wa(H){return H>Bt?Math.pow(H,1/3):H/Nt+_t}function ma([H,D,K,he]){let Ee=(H+16)/116,Be=isNaN(D)?Ee:Ee+D/500,Ve=isNaN(K)?Ee:Ee-K/200;return Ee=1*va(Ee),Be=We*va(Be),Ve=ct*va(Ve),[Ia(3.1338561*Be-1.6168667*Ee-.4906146*Ve),Ia(-.9787684*Be+1.9161415*Ee+.033454*Ve),Ia(.0719453*Be-.2289914*Ee+1.4052427*Ve),he]}function Ia(H){return(H=H<=.00304?12.92*H:1.055*Math.pow(H,1/2.4)-.055)<0?0:H>1?1:H}function va(H){return H>Mt?H*H*H:Nt*(H-_t)}function La(H){return parseInt(H.padEnd(2,H),16)/255}function Ka(H,D){return Vt(D?H/100:H,0,1)}function Vt(H,D,K){return Math.min(Math.max(D,H),K)}function Lt(H){return!H.some(Number.isNaN)}const jt={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]};class Ot{constructor(D,K,he,Ee=1,Be=!0){this.r=D,this.g=K,this.b=he,this.a=Ee,Be||(this.r*=Ee,this.g*=Ee,this.b*=Ee,Ee||this.overwriteGetter("rgb",[D,K,he,Ee]))}static parse(D){if(D instanceof Ot)return D;if(typeof D!="string")return;const K=function(he){if((he=he.toLowerCase().trim())==="transparent")return[0,0,0,0];const Ee=jt[he];if(Ee){const[Ve,nt,mt]=Ee;return[Ve/255,nt/255,mt/255,1]}if(he.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(he)){const Ve=he.length<6?1:2;let nt=1;return[La(he.slice(nt,nt+=Ve)),La(he.slice(nt,nt+=Ve)),La(he.slice(nt,nt+=Ve)),La(he.slice(nt,nt+Ve)||"ff")]}if(he.startsWith("rgb")){const Ve=he.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Ve){const[nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca,un]=Ve,Ha=[Xt||" ",Rr||" ",ca].join("");if(Ha===" "||Ha===" /"||Ha===",,"||Ha===",,,"){const rn=[Pt,br,Yr].join(""),Sn=rn==="%%%"?100:rn===""?255:0;if(Sn){const $n=[Vt(+mt/Sn,0,1),Vt(+er/Sn,0,1),Vt(+jr/Sn,0,1),Ca?Ka(+Ca,un):1];if(Lt($n))return $n}}return}}const Be=he.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Be){const[Ve,nt,mt,Pt,Xt,er,br,Rr,jr]=Be,Yr=[mt||" ",Xt||" ",br].join("");if(Yr===" "||Yr===" /"||Yr===",,"||Yr===",,,"){const ca=[+nt,Vt(+Pt,0,100),Vt(+er,0,100),Rr?Ka(+Rr,jr):1];if(Lt(ca))return function([Ca,un,Ha,rn]){function Sn($n){const Oi=($n+Ca/30)%12,qo=un*Math.min(Ha,1-Ha);return Ha-qo*Math.max(-1,Math.min(Oi-3,9-Oi,1))}return Ca=lr(Ca),un/=100,Ha/=100,[Sn(0),Sn(8),Sn(4),rn]}(ca)}}}(D);return K?new Ot(...K,!1):void 0}get rgb(){const{r:D,g:K,b:he,a:Ee}=this,Be=Ee||1/0;return this.overwriteGetter("rgb",[D/Be,K/Be,he/Be,Ee])}get hcl(){return this.overwriteGetter("hcl",function(D){const[K,he,Ee,Be]=ta(D),Ve=Math.sqrt(he*he+Ee*Ee);return[Math.round(1e4*Ve)?lr(Math.atan2(Ee,he)*Zt):NaN,Ve,K,Be]}(this.rgb))}get lab(){return this.overwriteGetter("lab",ta(this.rgb))}overwriteGetter(D,K){return Object.defineProperty(this,D,{value:K}),K}toString(){const[D,K,he,Ee]=this.rgb;return`rgba(${[D,K,he].map(Be=>Math.round(255*Be)).join(",")},${Ee})`}}Ot.black=new Ot(0,0,0,1),Ot.white=new Ot(1,1,1,1),Ot.transparent=new Ot(0,0,0,0),Ot.red=new Ot(1,0,0,1);class gr{constructor(D,K,he){this.sensitivity=D?K?"variant":"case":K?"accent":"base",this.locale=he,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(D,K){return this.collator.compare(D,K)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Br{constructor(D,K,he,Ee,Be){this.text=D,this.image=K,this.scale=he,this.fontStack=Ee,this.textColor=Be}}class na{constructor(D){this.sections=D}static fromString(D){return new na([new Br(D,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(D=>D.text.length!==0||D.image&&D.image.name.length!==0)}static factory(D){return D instanceof na?D:na.fromString(D)}toString(){return this.sections.length===0?"":this.sections.map(D=>D.text).join("")}}class Ur{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof Ur)return D;if(typeof D=="number")return new Ur([D,D,D,D]);if(Array.isArray(D)&&!(D.length<1||D.length>4)){for(const K of D)if(typeof K!="number")return;switch(D.length){case 1:D=[D[0],D[0],D[0],D[0]];break;case 2:D=[D[0],D[1],D[0],D[1]];break;case 3:D=[D[0],D[1],D[2],D[1]]}return new Ur(D)}}toString(){return JSON.stringify(this.values)}}const ga=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Aa{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof Aa)return D;if(Array.isArray(D)&&!(D.length<1)&&D.length%2==0){for(let K=0;K=0&&H<=255&&typeof D=="number"&&D>=0&&D<=255&&typeof K=="number"&&K>=0&&K<=255?he===void 0||typeof he=="number"&&he>=0&&he<=1?null:`Invalid rgba value [${[H,D,K,he].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof he=="number"?[H,D,K,he]:[H,D,K]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Oa(H){if(H===null||typeof H=="string"||typeof H=="boolean"||typeof H=="number"||H instanceof Ot||H instanceof gr||H instanceof na||H instanceof Ur||H instanceof Aa||H instanceof Pa)return!0;if(Array.isArray(H)){for(const D of H)if(!Oa(D))return!1;return!0}if(typeof H=="object"){for(const D in H)if(!Oa(H[D]))return!1;return!0}return!1}function dt(H){if(H===null)return rt;if(typeof H=="string")return At;if(typeof H=="boolean")return St;if(typeof H=="number")return Je;if(H instanceof Ot)return Rt;if(H instanceof gr)return ar;if(H instanceof na)return Mr;if(H instanceof Ur)return fr;if(H instanceof Aa)return pt;if(H instanceof Pa)return dr;if(Array.isArray(H)){const D=H.length;let K;for(const he of H){const Ee=dt(he);if(K){if(K===Ee)continue;K=ir;break}K=Ee}return ze(K||ir,D)}return Ut}function vt(H){const D=typeof H;return H===null?"":D==="string"||D==="number"||D==="boolean"?String(H):H instanceof Ot||H instanceof na||H instanceof Ur||H instanceof Aa||H instanceof Pa?H.toString():JSON.stringify(H)}class Lr{constructor(D,K){this.type=D,this.value=K}static parse(D,K){if(D.length!==2)return K.error(`'literal' expression requires exactly one argument, but found ${D.length-1} instead.`);if(!Oa(D[1]))return K.error("invalid value");const he=D[1];let Ee=dt(he);const Be=K.expectedType;return Ee.kind!=="array"||Ee.N!==0||!Be||Be.kind!=="array"||typeof Be.N=="number"&&Be.N!==0||(Ee=Be),new Lr(Ee,he)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Er{constructor(D){this.name="ExpressionEvaluationError",this.message=D}toJSON(){return this.message}}const _r={string:At,number:Je,boolean:St,object:Ut};class yr{constructor(D,K){this.type=D,this.args=K}static parse(D,K){if(D.length<2)return K.error("Expected at least one argument.");let he,Ee=1;const Be=D[0];if(Be==="array"){let nt,mt;if(D.length>2){const Pt=D[1];if(typeof Pt!="string"||!(Pt in _r)||Pt==="object")return K.error('The item type argument of "array" must be one of string, number, boolean',1);nt=_r[Pt],Ee++}else nt=ir;if(D.length>3){if(D[2]!==null&&(typeof D[2]!="number"||D[2]<0||D[2]!==Math.floor(D[2])))return K.error('The length argument to "array" must be a positive integer literal',2);mt=D[2],Ee++}he=ze(nt,mt)}else{if(!_r[Be])throw new Error(`Types doesn't contain name = ${Be}`);he=_r[Be]}const Ve=[];for(;EeD.outputDefined())}}const kr={"to-boolean":St,"to-color":Rt,"to-number":Je,"to-string":At};class zr{constructor(D,K){this.type=D,this.args=K}static parse(D,K){if(D.length<2)return K.error("Expected at least one argument.");const he=D[0];if(!kr[he])throw new Error(`Can't parse ${he} as it is not part of the known types`);if((he==="to-boolean"||he==="to-string")&&D.length!==2)return K.error("Expected one argument.");const Ee=kr[he],Be=[];for(let Ve=1;Ve4?`Invalid rbga value ${JSON.stringify(K)}: expected an array containing either three or four numeric values.`:sa(K[0],K[1],K[2],K[3]),!he))return new Ot(K[0]/255,K[1]/255,K[2]/255,K[3])}throw new Er(he||`Could not parse color from value '${typeof K=="string"?K:JSON.stringify(K)}'`)}case"padding":{let K;for(const he of this.args){K=he.evaluate(D);const Ee=Ur.parse(K);if(Ee)return Ee}throw new Er(`Could not parse padding from value '${typeof K=="string"?K:JSON.stringify(K)}'`)}case"variableAnchorOffsetCollection":{let K;for(const he of this.args){K=he.evaluate(D);const Ee=Aa.parse(K);if(Ee)return Ee}throw new Er(`Could not parse variableAnchorOffsetCollection from value '${typeof K=="string"?K:JSON.stringify(K)}'`)}case"number":{let K=null;for(const he of this.args){if(K=he.evaluate(D),K===null)return 0;const Ee=Number(K);if(!isNaN(Ee))return Ee}throw new Er(`Could not convert ${JSON.stringify(K)} to number.`)}case"formatted":return na.fromString(vt(this.args[0].evaluate(D)));case"resolvedImage":return Pa.fromString(vt(this.args[0].evaluate(D)));default:return vt(this.args[0].evaluate(D))}}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}const Pr=["Unknown","Point","LineString","Polygon"];class Hr{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Pr[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(D){let K=this._parseColorCache[D];return K||(K=this._parseColorCache[D]=Ot.parse(D)),K}}class Zr{constructor(D,K,he=[],Ee,Be=new $e,Ve=[]){this.registry=D,this.path=he,this.key=he.map(nt=>`[${nt}]`).join(""),this.scope=Be,this.errors=Ve,this.expectedType=Ee,this._isConstant=K}parse(D,K,he,Ee,Be={}){return K?this.concat(K,he,Ee)._parse(D,Be):this._parse(D,Be)}_parse(D,K){function he(Ee,Be,Ve){return Ve==="assert"?new yr(Be,[Ee]):Ve==="coerce"?new zr(Be,[Ee]):Ee}if(D!==null&&typeof D!="string"&&typeof D!="boolean"&&typeof D!="number"||(D=["literal",D]),Array.isArray(D)){if(D.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const Ee=D[0];if(typeof Ee!="string")return this.error(`Expression name must be a string, but found ${typeof Ee} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const Be=this.registry[Ee];if(Be){let Ve=Be.parse(D,this);if(!Ve)return null;if(this.expectedType){const nt=this.expectedType,mt=Ve.type;if(nt.kind!=="string"&&nt.kind!=="number"&&nt.kind!=="boolean"&&nt.kind!=="object"&&nt.kind!=="array"||mt.kind!=="value")if(nt.kind!=="color"&&nt.kind!=="formatted"&&nt.kind!=="resolvedImage"||mt.kind!=="value"&&mt.kind!=="string")if(nt.kind!=="padding"||mt.kind!=="value"&&mt.kind!=="number"&&mt.kind!=="array")if(nt.kind!=="variableAnchorOffsetCollection"||mt.kind!=="value"&&mt.kind!=="array"){if(this.checkSubtype(nt,mt))return null}else Ve=he(Ve,nt,K.typeAnnotation||"coerce");else Ve=he(Ve,nt,K.typeAnnotation||"coerce");else Ve=he(Ve,nt,K.typeAnnotation||"coerce");else Ve=he(Ve,nt,K.typeAnnotation||"assert")}if(!(Ve instanceof Lr)&&Ve.type.kind!=="resolvedImage"&&this._isConstant(Ve)){const nt=new Hr;try{Ve=new Lr(Ve.type,Ve.evaluate(nt))}catch(mt){return this.error(mt.message),null}}return Ve}return this.error(`Unknown expression "${Ee}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(D===void 0?"'undefined' value invalid. Use null instead.":typeof D=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof D} instead.`)}concat(D,K,he){const Ee=typeof D=="number"?this.path.concat(D):this.path,Be=he?this.scope.concat(he):this.scope;return new Zr(this.registry,this._isConstant,Ee,K||null,Be,this.errors)}error(D,...K){const he=`${this.key}${K.map(Ee=>`[${Ee}]`).join("")}`;this.errors.push(new Re(he,D))}checkSubtype(D,K){const he=ve(D,K);return he&&this.error(he),he}}class Jr{constructor(D,K){this.type=K.type,this.bindings=[].concat(D),this.result=K}evaluate(D){return this.result.evaluate(D)}eachChild(D){for(const K of this.bindings)D(K[1]);D(this.result)}static parse(D,K){if(D.length<4)return K.error(`Expected at least 3 arguments, but found ${D.length-1} instead.`);const he=[];for(let Be=1;Be=he.length)throw new Er(`Array index out of bounds: ${K} > ${he.length-1}.`);if(K!==Math.floor(K))throw new Er(`Array index must be an integer, but found ${K} instead.`);return he[K]}eachChild(D){D(this.index),D(this.input)}outputDefined(){return!1}}class mr{constructor(D,K){this.type=St,this.needle=D,this.haystack=K}static parse(D,K){if(D.length!==3)return K.error(`Expected 2 arguments, but found ${D.length-1} instead.`);const he=K.parse(D[1],1,ir),Ee=K.parse(D[2],2,ir);return he&&Ee?ge(he.type,[St,At,Je,rt,ir])?new mr(he,Ee):K.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(he.type)} instead`):null}evaluate(D){const K=this.needle.evaluate(D),he=this.haystack.evaluate(D);if(!he)return!1;if(!be(K,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(dt(K))} instead.`);if(!be(he,["string","array"]))throw new Er(`Expected second argument to be of type array or string, but found ${Ge(dt(he))} instead.`);return he.indexOf(K)>=0}eachChild(D){D(this.needle),D(this.haystack)}outputDefined(){return!0}}class $r{constructor(D,K,he){this.type=Je,this.needle=D,this.haystack=K,this.fromIndex=he}static parse(D,K){if(D.length<=2||D.length>=5)return K.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);const he=K.parse(D[1],1,ir),Ee=K.parse(D[2],2,ir);if(!he||!Ee)return null;if(!ge(he.type,[St,At,Je,rt,ir]))return K.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(he.type)} instead`);if(D.length===4){const Be=K.parse(D[3],3,Je);return Be?new $r(he,Ee,Be):null}return new $r(he,Ee)}evaluate(D){const K=this.needle.evaluate(D),he=this.haystack.evaluate(D);if(!be(K,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(dt(K))} instead.`);let Ee;if(this.fromIndex&&(Ee=this.fromIndex.evaluate(D)),be(he,["string"])){const Be=he.indexOf(K,Ee);return Be===-1?-1:[...he.slice(0,Be)].length}if(be(he,["array"]))return he.indexOf(K,Ee);throw new Er(`Expected second argument to be of type array or string, but found ${Ge(dt(he))} instead.`)}eachChild(D){D(this.needle),D(this.haystack),this.fromIndex&&D(this.fromIndex)}outputDefined(){return!1}}class oa{constructor(D,K,he,Ee,Be,Ve){this.inputType=D,this.type=K,this.input=he,this.cases=Ee,this.outputs=Be,this.otherwise=Ve}static parse(D,K){if(D.length<5)return K.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if(D.length%2!=1)return K.error("Expected an even number of arguments.");let he,Ee;K.expectedType&&K.expectedType.kind!=="value"&&(Ee=K.expectedType);const Be={},Ve=[];for(let Pt=2;PtNumber.MAX_SAFE_INTEGER)return br.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof jr=="number"&&Math.floor(jr)!==jr)return br.error("Numeric branch labels must be integer values.");if(he){if(br.checkSubtype(he,dt(jr)))return null}else he=dt(jr);if(Be[String(jr)]!==void 0)return br.error("Branch labels must be unique.");Be[String(jr)]=Ve.length}const Rr=K.parse(er,Pt,Ee);if(!Rr)return null;Ee=Ee||Rr.type,Ve.push(Rr)}const nt=K.parse(D[1],1,ir);if(!nt)return null;const mt=K.parse(D[D.length-1],D.length-1,Ee);return mt?nt.type.kind!=="value"&&K.concat(1).checkSubtype(he,nt.type)?null:new oa(he,Ee,nt,Be,Ve,mt):null}evaluate(D){const K=this.input.evaluate(D);return(dt(K)===this.inputType&&this.outputs[this.cases[K]]||this.otherwise).evaluate(D)}eachChild(D){D(this.input),this.outputs.forEach(D),D(this.otherwise)}outputDefined(){return this.outputs.every(D=>D.outputDefined())&&this.otherwise.outputDefined()}}class Sa{constructor(D,K,he){this.type=D,this.branches=K,this.otherwise=he}static parse(D,K){if(D.length<4)return K.error(`Expected at least 3 arguments, but found only ${D.length-1}.`);if(D.length%2!=0)return K.error("Expected an odd number of arguments.");let he;K.expectedType&&K.expectedType.kind!=="value"&&(he=K.expectedType);const Ee=[];for(let Ve=1;VeK.outputDefined())&&this.otherwise.outputDefined()}}class ya{constructor(D,K,he,Ee){this.type=D,this.input=K,this.beginIndex=he,this.endIndex=Ee}static parse(D,K){if(D.length<=2||D.length>=5)return K.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);const he=K.parse(D[1],1,ir),Ee=K.parse(D[2],2,Je);if(!he||!Ee)return null;if(!ge(he.type,[ze(ir),At,ir]))return K.error(`Expected first argument to be of type array or string, but found ${Ge(he.type)} instead`);if(D.length===4){const Be=K.parse(D[3],3,Je);return Be?new ya(he.type,he,Ee,Be):null}return new ya(he.type,he,Ee)}evaluate(D){const K=this.input.evaluate(D),he=this.beginIndex.evaluate(D);let Ee;if(this.endIndex&&(Ee=this.endIndex.evaluate(D)),be(K,["string"]))return[...K].slice(he,Ee).join("");if(be(K,["array"]))return K.slice(he,Ee);throw new Er(`Expected first argument to be of type array or string, but found ${Ge(dt(K))} instead.`)}eachChild(D){D(this.input),D(this.beginIndex),this.endIndex&&D(this.endIndex)}outputDefined(){return!1}}function ra(H,D){const K=H.length-1;let he,Ee,Be=0,Ve=K,nt=0;for(;Be<=Ve;)if(nt=Math.floor((Be+Ve)/2),he=H[nt],Ee=H[nt+1],he<=D){if(nt===K||DD))throw new Er("Input is not a number.");Ve=nt-1}return 0}class pa{constructor(D,K,he){this.type=D,this.input=K,this.labels=[],this.outputs=[];for(const[Ee,Be]of he)this.labels.push(Ee),this.outputs.push(Be)}static parse(D,K){if(D.length-1<4)return K.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return K.error("Expected an even number of arguments.");const he=K.parse(D[1],1,Je);if(!he)return null;const Ee=[];let Be=null;K.expectedType&&K.expectedType.kind!=="value"&&(Be=K.expectedType);for(let Ve=1;Ve=nt)return K.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Pt);const er=K.parse(mt,Xt,Be);if(!er)return null;Be=Be||er.type,Ee.push([nt,er])}return new pa(Be,he,Ee)}evaluate(D){const K=this.labels,he=this.outputs;if(K.length===1)return he[0].evaluate(D);const Ee=this.input.evaluate(D);if(Ee<=K[0])return he[0].evaluate(D);const Be=K.length;return Ee>=K[Be-1]?he[Be-1].evaluate(D):he[ra(K,Ee)].evaluate(D)}eachChild(D){D(this.input);for(const K of this.outputs)D(K)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function pn(H){return H&&H.__esModule&&Object.prototype.hasOwnProperty.call(H,"default")?H.default:H}var Ga=qn;function qn(H,D,K,he){this.cx=3*H,this.bx=3*(K-H)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*D,this.by=3*(he-D)-this.cy,this.ay=1-this.cy-this.by,this.p1x=H,this.p1y=D,this.p2x=K,this.p2y=he}qn.prototype={sampleCurveX:function(H){return((this.ax*H+this.bx)*H+this.cx)*H},sampleCurveY:function(H){return((this.ay*H+this.by)*H+this.cy)*H},sampleCurveDerivativeX:function(H){return(3*this.ax*H+2*this.bx)*H+this.cx},solveCurveX:function(H,D){if(D===void 0&&(D=1e-6),H<0)return 0;if(H>1)return 1;for(var K=H,he=0;he<8;he++){var Ee=this.sampleCurveX(K)-H;if(Math.abs(Ee)Ee?Ve=K:nt=K,K=.5*(nt-Ve)+Ve;return K},solve:function(H,D){return this.sampleCurveY(this.solveCurveX(H,D))}};var Vn=pn(Ga);function di(H,D,K){return H+K*(D-H)}function yi(H,D,K){return H.map((he,Ee)=>di(he,D[Ee],K))}const Ci={number:di,color:function(H,D,K,he="rgb"){switch(he){case"rgb":{const[Ee,Be,Ve,nt]=yi(H.rgb,D.rgb,K);return new Ot(Ee,Be,Ve,nt,!1)}case"hcl":{const[Ee,Be,Ve,nt]=H.hcl,[mt,Pt,Xt,er]=D.hcl;let br,Rr;if(isNaN(Ee)||isNaN(mt))isNaN(Ee)?isNaN(mt)?br=NaN:(br=mt,Ve!==1&&Ve!==0||(Rr=Pt)):(br=Ee,Xt!==1&&Xt!==0||(Rr=Be));else{let un=mt-Ee;mt>Ee&&un>180?un-=360:mt180&&(un+=360),br=Ee+K*un}const[jr,Yr,ca,Ca]=function([un,Ha,rn,Sn]){return un=isNaN(un)?0:un*qt,ma([rn,Math.cos(un)*Ha,Math.sin(un)*Ha,Sn])}([br,Rr??di(Be,Pt,K),di(Ve,Xt,K),di(nt,er,K)]);return new Ot(jr,Yr,ca,Ca,!1)}case"lab":{const[Ee,Be,Ve,nt]=ma(yi(H.lab,D.lab,K));return new Ot(Ee,Be,Ve,nt,!1)}}},array:yi,padding:function(H,D,K){return new Ur(yi(H.values,D.values,K))},variableAnchorOffsetCollection:function(H,D,K){const he=H.values,Ee=D.values;if(he.length!==Ee.length)throw new Er(`Cannot interpolate values of different length. from: ${H.toString()}, to: ${D.toString()}`);const Be=[];for(let Ve=0;Vetypeof Xt!="number"||Xt<0||Xt>1))return K.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Ee={name:"cubic-bezier",controlPoints:Pt}}}if(D.length-1<4)return K.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return K.error("Expected an even number of arguments.");if(Be=K.parse(Be,2,Je),!Be)return null;const nt=[];let mt=null;he==="interpolate-hcl"||he==="interpolate-lab"?mt=Rt:K.expectedType&&K.expectedType.kind!=="value"&&(mt=K.expectedType);for(let Pt=0;Pt=Xt)return K.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',br);const jr=K.parse(er,Rr,mt);if(!jr)return null;mt=mt||jr.type,nt.push([Xt,jr])}return Pe(mt,Je)||Pe(mt,Rt)||Pe(mt,fr)||Pe(mt,pt)||Pe(mt,ze(Je))?new ci(mt,he,Ee,Be,nt):K.error(`Type ${Ge(mt)} is not interpolatable.`)}evaluate(D){const K=this.labels,he=this.outputs;if(K.length===1)return he[0].evaluate(D);const Ee=this.input.evaluate(D);if(Ee<=K[0])return he[0].evaluate(D);const Be=K.length;if(Ee>=K[Be-1])return he[Be-1].evaluate(D);const Ve=ra(K,Ee),nt=ci.interpolationFactor(this.interpolation,Ee,K[Ve],K[Ve+1]),mt=he[Ve].evaluate(D),Pt=he[Ve+1].evaluate(D);switch(this.operator){case"interpolate":return Ci[this.type.kind](mt,Pt,nt);case"interpolate-hcl":return Ci.color(mt,Pt,nt,"hcl");case"interpolate-lab":return Ci.color(mt,Pt,nt,"lab")}}eachChild(D){D(this.input);for(const K of this.outputs)D(K)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function ei(H,D,K,he){const Ee=he-K,Be=H-K;return Ee===0?0:D===1?Be/Ee:(Math.pow(D,Be)-1)/(Math.pow(D,Ee)-1)}class mi{constructor(D,K){this.type=D,this.args=K}static parse(D,K){if(D.length<2)return K.error("Expectected at least one argument.");let he=null;const Ee=K.expectedType;Ee&&Ee.kind!=="value"&&(he=Ee);const Be=[];for(const nt of D.slice(1)){const mt=K.parse(nt,1+Be.length,he,void 0,{typeAnnotation:"omit"});if(!mt)return null;he=he||mt.type,Be.push(mt)}if(!he)throw new Error("No output type");const Ve=Ee&&Be.some(nt=>ve(Ee,nt.type));return new mi(Ve?ir:he,Be)}evaluate(D){let K,he=null,Ee=0;for(const Be of this.args)if(Ee++,he=Be.evaluate(D),he&&he instanceof Pa&&!he.available&&(K||(K=he.name),he=null,Ee===this.args.length&&(he=K)),he!==null)break;return he}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}function uo(H,D){return H==="=="||H==="!="?D.kind==="boolean"||D.kind==="string"||D.kind==="number"||D.kind==="null"||D.kind==="value":D.kind==="string"||D.kind==="number"||D.kind==="value"}function Lo(H,D,K,he){return he.compare(D,K)===0}function Wo(H,D,K){const he=H!=="=="&&H!=="!=";return class QA{constructor(Be,Ve,nt){this.type=St,this.lhs=Be,this.rhs=Ve,this.collator=nt,this.hasUntypedArgument=Be.type.kind==="value"||Ve.type.kind==="value"}static parse(Be,Ve){if(Be.length!==3&&Be.length!==4)return Ve.error("Expected two or three arguments.");const nt=Be[0];let mt=Ve.parse(Be[1],1,ir);if(!mt)return null;if(!uo(nt,mt.type))return Ve.concat(1).error(`"${nt}" comparisons are not supported for type '${Ge(mt.type)}'.`);let Pt=Ve.parse(Be[2],2,ir);if(!Pt)return null;if(!uo(nt,Pt.type))return Ve.concat(2).error(`"${nt}" comparisons are not supported for type '${Ge(Pt.type)}'.`);if(mt.type.kind!==Pt.type.kind&&mt.type.kind!=="value"&&Pt.type.kind!=="value")return Ve.error(`Cannot compare types '${Ge(mt.type)}' and '${Ge(Pt.type)}'.`);he&&(mt.type.kind==="value"&&Pt.type.kind!=="value"?mt=new yr(Pt.type,[mt]):mt.type.kind!=="value"&&Pt.type.kind==="value"&&(Pt=new yr(mt.type,[Pt])));let Xt=null;if(Be.length===4){if(mt.type.kind!=="string"&&Pt.type.kind!=="string"&&mt.type.kind!=="value"&&Pt.type.kind!=="value")return Ve.error("Cannot use collator to compare non-string types.");if(Xt=Ve.parse(Be[3],3,ar),!Xt)return null}return new QA(mt,Pt,Xt)}evaluate(Be){const Ve=this.lhs.evaluate(Be),nt=this.rhs.evaluate(Be);if(he&&this.hasUntypedArgument){const mt=dt(Ve),Pt=dt(nt);if(mt.kind!==Pt.kind||mt.kind!=="string"&&mt.kind!=="number")throw new Er(`Expected arguments for "${H}" to be (string, string) or (number, number), but found (${mt.kind}, ${Pt.kind}) instead.`)}if(this.collator&&!he&&this.hasUntypedArgument){const mt=dt(Ve),Pt=dt(nt);if(mt.kind!=="string"||Pt.kind!=="string")return D(Be,Ve,nt)}return this.collator?K(Be,Ve,nt,this.collator.evaluate(Be)):D(Be,Ve,nt)}eachChild(Be){Be(this.lhs),Be(this.rhs),this.collator&&Be(this.collator)}outputDefined(){return!0}}}const li=Wo("==",function(H,D,K){return D===K},Lo),Ii=Wo("!=",function(H,D,K){return D!==K},function(H,D,K,he){return!Lo(0,D,K,he)}),xi=Wo("<",function(H,D,K){return D",function(H,D,K){return D>K},function(H,D,K,he){return he.compare(D,K)>0}),So=Wo("<=",function(H,D,K){return D<=K},function(H,D,K,he){return he.compare(D,K)<=0}),Ro=Wo(">=",function(H,D,K){return D>=K},function(H,D,K,he){return he.compare(D,K)>=0});class Li{constructor(D,K,he){this.type=ar,this.locale=he,this.caseSensitive=D,this.diacriticSensitive=K}static parse(D,K){if(D.length!==2)return K.error("Expected one argument.");const he=D[1];if(typeof he!="object"||Array.isArray(he))return K.error("Collator options argument must be an object.");const Ee=K.parse(he["case-sensitive"]!==void 0&&he["case-sensitive"],1,St);if(!Ee)return null;const Be=K.parse(he["diacritic-sensitive"]!==void 0&&he["diacritic-sensitive"],1,St);if(!Be)return null;let Ve=null;return he.locale&&(Ve=K.parse(he.locale,1,At),!Ve)?null:new Li(Ee,Be,Ve)}evaluate(D){return new gr(this.caseSensitive.evaluate(D),this.diacriticSensitive.evaluate(D),this.locale?this.locale.evaluate(D):null)}eachChild(D){D(this.caseSensitive),D(this.diacriticSensitive),this.locale&&D(this.locale)}outputDefined(){return!1}}class Yi{constructor(D,K,he,Ee,Be){this.type=At,this.number=D,this.locale=K,this.currency=he,this.minFractionDigits=Ee,this.maxFractionDigits=Be}static parse(D,K){if(D.length!==3)return K.error("Expected two arguments.");const he=K.parse(D[1],1,Je);if(!he)return null;const Ee=D[2];if(typeof Ee!="object"||Array.isArray(Ee))return K.error("NumberFormat options argument must be an object.");let Be=null;if(Ee.locale&&(Be=K.parse(Ee.locale,1,At),!Be))return null;let Ve=null;if(Ee.currency&&(Ve=K.parse(Ee.currency,1,At),!Ve))return null;let nt=null;if(Ee["min-fraction-digits"]&&(nt=K.parse(Ee["min-fraction-digits"],1,Je),!nt))return null;let mt=null;return Ee["max-fraction-digits"]&&(mt=K.parse(Ee["max-fraction-digits"],1,Je),!mt)?null:new Yi(he,Be,Ve,nt,mt)}evaluate(D){return new Intl.NumberFormat(this.locale?this.locale.evaluate(D):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(D):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(D):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(D):void 0}).format(this.number.evaluate(D))}eachChild(D){D(this.number),this.locale&&D(this.locale),this.currency&&D(this.currency),this.minFractionDigits&&D(this.minFractionDigits),this.maxFractionDigits&&D(this.maxFractionDigits)}outputDefined(){return!1}}class bs{constructor(D){this.type=Mr,this.sections=D}static parse(D,K){if(D.length<2)return K.error("Expected at least one argument.");const he=D[1];if(!Array.isArray(he)&&typeof he=="object")return K.error("First argument must be an image or text section.");const Ee=[];let Be=!1;for(let Ve=1;Ve<=D.length-1;++Ve){const nt=D[Ve];if(Be&&typeof nt=="object"&&!Array.isArray(nt)){Be=!1;let mt=null;if(nt["font-scale"]&&(mt=K.parse(nt["font-scale"],1,Je),!mt))return null;let Pt=null;if(nt["text-font"]&&(Pt=K.parse(nt["text-font"],1,ze(At)),!Pt))return null;let Xt=null;if(nt["text-color"]&&(Xt=K.parse(nt["text-color"],1,Rt),!Xt))return null;const er=Ee[Ee.length-1];er.scale=mt,er.font=Pt,er.textColor=Xt}else{const mt=K.parse(D[Ve],1,ir);if(!mt)return null;const Pt=mt.type.kind;if(Pt!=="string"&&Pt!=="value"&&Pt!=="null"&&Pt!=="resolvedImage")return K.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Be=!0,Ee.push({content:mt,scale:null,font:null,textColor:null})}}return new bs(Ee)}evaluate(D){return new na(this.sections.map(K=>{const he=K.content.evaluate(D);return dt(he)===dr?new Br("",he,null,null,null):new Br(vt(he),null,K.scale?K.scale.evaluate(D):null,K.font?K.font.evaluate(D).join(","):null,K.textColor?K.textColor.evaluate(D):null)}))}eachChild(D){for(const K of this.sections)D(K.content),K.scale&&D(K.scale),K.font&&D(K.font),K.textColor&&D(K.textColor)}outputDefined(){return!1}}class as{constructor(D){this.type=dr,this.input=D}static parse(D,K){if(D.length!==2)return K.error("Expected two arguments.");const he=K.parse(D[1],1,At);return he?new as(he):K.error("No image name provided.")}evaluate(D){const K=this.input.evaluate(D),he=Pa.fromString(K);return he&&D.availableImages&&(he.available=D.availableImages.indexOf(K)>-1),he}eachChild(D){D(this.input)}outputDefined(){return!1}}class fs{constructor(D){this.type=Je,this.input=D}static parse(D,K){if(D.length!==2)return K.error(`Expected 1 argument, but found ${D.length-1} instead.`);const he=K.parse(D[1],1);return he?he.type.kind!=="array"&&he.type.kind!=="string"&&he.type.kind!=="value"?K.error(`Expected argument of type string or array, but found ${Ge(he.type)} instead.`):new fs(he):null}evaluate(D){const K=this.input.evaluate(D);if(typeof K=="string")return[...K].length;if(Array.isArray(K))return K.length;throw new Er(`Expected value to be of type string or array, but found ${Ge(dt(K))} instead.`)}eachChild(D){D(this.input)}outputDefined(){return!1}}const Co=8192;function Qa(H,D){const K=(180+H[0])/360,he=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+H[1]*Math.PI/360)))/360,Ee=Math.pow(2,D.z);return[Math.round(K*Ee*Co),Math.round(he*Ee*Co)]}function Jn(H,D){const K=Math.pow(2,D.z);return[(Ee=(H[0]/Co+D.x)/K,360*Ee-180),(he=(H[1]/Co+D.y)/K,360/Math.PI*Math.atan(Math.exp((180-360*he)*Math.PI/180))-90)];var he,Ee}function Os(H,D){H[0]=Math.min(H[0],D[0]),H[1]=Math.min(H[1],D[1]),H[2]=Math.max(H[2],D[0]),H[3]=Math.max(H[3],D[1])}function ds(H,D){return!(H[0]<=D[0]||H[2]>=D[2]||H[1]<=D[1]||H[3]>=D[3])}function Ui(H,D,K){const he=H[0]-D[0],Ee=H[1]-D[1],Be=H[0]-K[0],Ve=H[1]-K[1];return he*Ve-Be*Ee==0&&he*Be<=0&&Ee*Ve<=0}function ms(H,D,K,he){return(Ee=[he[0]-K[0],he[1]-K[1]])[0]*(Be=[D[0]-H[0],D[1]-H[1]])[1]-Ee[1]*Be[0]!=0&&!(!Pi(H,D,K,he)||!Pi(K,he,H,D));var Ee,Be}function Mo(H,D,K){for(const he of K)for(let Ee=0;Ee(Ee=H)[1]!=(Ve=nt[mt+1])[1]>Ee[1]&&Ee[0]<(Ve[0]-Be[0])*(Ee[1]-Be[1])/(Ve[1]-Be[1])+Be[0]&&(he=!he)}var Ee,Be,Ve;return he}function Ks(H,D){for(const K of D)if(ws(H,K))return!0;return!1}function Rn(H,D){for(const K of H)if(!ws(K,D))return!1;for(let K=0;K0&&nt<0||Ve<0&&nt>0}function zo(H,D,K){const he=[];for(let Ee=0;EeK[2]){const Ee=.5*he;let Be=H[0]-K[0]>Ee?-he:K[0]-H[0]>Ee?he:0;Be===0&&(Be=H[0]-K[2]>Ee?-he:K[2]-H[0]>Ee?he:0),H[0]+=Be}Os(D,H)}function wl(H,D,K,he){const Ee=Math.pow(2,he.z)*Co,Be=[he.x*Co,he.y*Co],Ve=[];for(const nt of H)for(const mt of nt){const Pt=[mt.x+Be[0],mt.y+Be[1]];bi(Pt,D,K,Ee),Ve.push(Pt)}return Ve}function $l(H,D,K,he){const Ee=Math.pow(2,he.z)*Co,Be=[he.x*Co,he.y*Co],Ve=[];for(const mt of H){const Pt=[];for(const Xt of mt){const er=[Xt.x+Be[0],Xt.y+Be[1]];Os(D,er),Pt.push(er)}Ve.push(Pt)}if(D[2]-D[0]<=Ee/2){(nt=D)[0]=nt[1]=1/0,nt[2]=nt[3]=-1/0;for(const mt of Ve)for(const Pt of mt)bi(Pt,D,K,Ee)}var nt;return Ve}class Js{constructor(D,K){this.type=St,this.geojson=D,this.geometries=K}static parse(D,K){if(D.length!==2)return K.error(`'within' expression requires exactly one argument, but found ${D.length-1} instead.`);if(Oa(D[1])){const he=D[1];if(he.type==="FeatureCollection"){const Ee=[];for(const Be of he.features){const{type:Ve,coordinates:nt}=Be.geometry;Ve==="Polygon"&&Ee.push(nt),Ve==="MultiPolygon"&&Ee.push(...nt)}if(Ee.length)return new Js(he,{type:"MultiPolygon",coordinates:Ee})}else if(he.type==="Feature"){const Ee=he.geometry.type;if(Ee==="Polygon"||Ee==="MultiPolygon")return new Js(he,he.geometry)}else if(he.type==="Polygon"||he.type==="MultiPolygon")return new Js(he,he)}return K.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return function(K,he){const Ee=[1/0,1/0,-1/0,-1/0],Be=[1/0,1/0,-1/0,-1/0],Ve=K.canonicalID();if(he.type==="Polygon"){const nt=zo(he.coordinates,Be,Ve),mt=wl(K.geometry(),Ee,Be,Ve);if(!ds(Ee,Be))return!1;for(const Pt of mt)if(!ws(Pt,nt))return!1}if(he.type==="MultiPolygon"){const nt=wo(he.coordinates,Be,Ve),mt=wl(K.geometry(),Ee,Be,Ve);if(!ds(Ee,Be))return!1;for(const Pt of mt)if(!Ks(Pt,nt))return!1}return!0}(D,this.geometries);if(D.geometryType()==="LineString")return function(K,he){const Ee=[1/0,1/0,-1/0,-1/0],Be=[1/0,1/0,-1/0,-1/0],Ve=K.canonicalID();if(he.type==="Polygon"){const nt=zo(he.coordinates,Be,Ve),mt=$l(K.geometry(),Ee,Be,Ve);if(!ds(Ee,Be))return!1;for(const Pt of mt)if(!Rn(Pt,nt))return!1}if(he.type==="MultiPolygon"){const nt=wo(he.coordinates,Be,Ve),mt=$l(K.geometry(),Ee,Be,Ve);if(!ds(Ee,Be))return!1;for(const Pt of mt)if(!fo(Pt,nt))return!1}return!0}(D,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Ql=class{constructor(H=[],D=(K,he)=>Khe?1:0){if(this.data=H,this.length=this.data.length,this.compare=D,this.length>0)for(let K=(this.length>>1)-1;K>=0;K--)this._down(K)}push(H){this.data.push(H),this._up(this.length++)}pop(){if(this.length===0)return;const H=this.data[0],D=this.data.pop();return--this.length>0&&(this.data[0]=D,this._down(0)),H}peek(){return this.data[0]}_up(H){const{data:D,compare:K}=this,he=D[H];for(;H>0;){const Ee=H-1>>1,Be=D[Ee];if(K(he,Be)>=0)break;D[H]=Be,H=Ee}D[H]=he}_down(H){const{data:D,compare:K}=this,he=this.length>>1,Ee=D[H];for(;H=0)break;D[H]=D[Be],H=Be}D[H]=Ee}};function Ws(H,D,K,he,Ee){Is(H,D,K,he||H.length-1,Ee||Xu)}function Is(H,D,K,he,Ee){for(;he>K;){if(he-K>600){var Be=he-K+1,Ve=D-K+1,nt=Math.log(Be),mt=.5*Math.exp(2*nt/3),Pt=.5*Math.sqrt(nt*mt*(Be-mt)/Be)*(Ve-Be/2<0?-1:1);Is(H,D,Math.max(K,Math.floor(D-Ve*mt/Be+Pt)),Math.min(he,Math.floor(D+(Be-Ve)*mt/Be+Pt)),Ee)}var Xt=H[D],er=K,br=he;for(Dl(H,K,D),Ee(H[he],Xt)>0&&Dl(H,K,he);er0;)br--}Ee(H[K],Xt)===0?Dl(H,K,br):Dl(H,++br,he),br<=D&&(K=br+1),D<=br&&(he=br-1)}}function Dl(H,D,K){var he=H[D];H[D]=H[K],H[K]=he}function Xu(H,D){return HD?1:0}function Lu(H,D){if(H.length<=1)return[H];const K=[];let he,Ee;for(const Be of H){const Ve=kf(Be);Ve!==0&&(Be.area=Math.abs(Ve),Ee===void 0&&(Ee=Ve<0),Ee===Ve<0?(he&&K.push(he),he=[Be]):he.push(Be))}if(he&&K.push(he),D>1)for(let Be=0;Be1?(Pt=D[mt+1][0],Xt=D[mt+1][1]):Rr>0&&(Pt+=er/this.kx*Rr,Xt+=br/this.ky*Rr)),er=this.wrap(K[0]-Pt)*this.kx,br=(K[1]-Xt)*this.ky;const jr=er*er+br*br;jr180;)D-=360;return D}}function ml(H,D){return D[0]-H[0]}function fl(H){return H[1]-H[0]+1}function _l(H,D){return H[1]>=H[0]&&H[1]H[1])return[null,null];const K=fl(H);if(D){if(K===2)return[H,null];const Ee=Math.floor(K/2);return[[H[0],H[0]+Ee],[H[0]+Ee,H[1]]]}if(K===1)return[H,null];const he=Math.floor(K/2)-1;return[[H[0],H[0]+he],[H[0]+he+1,H[1]]]}function Ts(H,D){if(!_l(D,H.length))return[1/0,1/0,-1/0,-1/0];const K=[1/0,1/0,-1/0,-1/0];for(let he=D[0];he<=D[1];++he)Os(K,H[he]);return K}function Tl(H){const D=[1/0,1/0,-1/0,-1/0];for(const K of H)for(const he of K)Os(D,he);return D}function Ko(H){return H[0]!==-1/0&&H[1]!==-1/0&&H[2]!==1/0&&H[3]!==1/0}function Cs(H,D,K){if(!Ko(H)||!Ko(D))return NaN;let he=0,Ee=0;return H[2]D[2]&&(he=H[0]-D[2]),H[1]>D[3]&&(Ee=H[1]-D[3]),H[3]=he)return he;if(ds(Ee,Be)){if(Wf(H,D))return 0}else if(Wf(D,H))return 0;let Ve=1/0;for(const nt of H)for(let mt=0,Pt=nt.length,Xt=Pt-1;mt0;){const mt=Ve.pop();if(mt[0]>=Be)continue;const Pt=mt[1],Xt=D?50:100;if(fl(Pt)<=Xt){if(!_l(Pt,H.length))return NaN;if(D){const er=Eo(H,Pt,K,he);if(isNaN(er)||er===0)return er;Be=Math.min(Be,er)}else for(let er=Pt[0];er<=Pt[1];++er){const br=Gf(H[er],K,he);if(Be=Math.min(Be,br),Be===0)return 0}}else{const er=Yu(Pt,D);oo(Ve,Be,he,H,nt,er[0]),oo(Ve,Be,he,H,nt,er[1])}}return Be}function zl(H,D,K,he,Ee,Be=1/0){let Ve=Math.min(Be,Ee.distance(H[0],K[0]));if(Ve===0)return Ve;const nt=new Ql([[0,[0,H.length-1],[0,K.length-1]]],ml);for(;nt.length>0;){const mt=nt.pop();if(mt[0]>=Ve)continue;const Pt=mt[1],Xt=mt[2],er=D?50:100,br=he?50:100;if(fl(Pt)<=er&&fl(Xt)<=br){if(!_l(Pt,H.length)&&_l(Xt,K.length))return NaN;let Rr;if(D&&he)Rr=Ku(H,Pt,K,Xt,Ee),Ve=Math.min(Ve,Rr);else if(D&&!he){const jr=H.slice(Pt[0],Pt[1]+1);for(let Yr=Xt[0];Yr<=Xt[1];++Yr)if(Rr=Nu(K[Yr],jr,Ee),Ve=Math.min(Ve,Rr),Ve===0)return Ve}else if(!D&&he){const jr=K.slice(Xt[0],Xt[1]+1);for(let Yr=Pt[0];Yr<=Pt[1];++Yr)if(Rr=Nu(H[Yr],jr,Ee),Ve=Math.min(Ve,Rr),Ve===0)return Ve}else Rr=Bs(H,Pt,K,Xt,Ee),Ve=Math.min(Ve,Rr)}else{const Rr=Yu(Pt,D),jr=Yu(Xt,he);pc(nt,Ve,Ee,H,K,Rr[0],jr[0]),pc(nt,Ve,Ee,H,K,Rr[0],jr[1]),pc(nt,Ve,Ee,H,K,Rr[1],jr[0]),pc(nt,Ve,Ee,H,K,Rr[1],jr[1])}}return Ve}function Kc(H){return H.type==="MultiPolygon"?H.coordinates.map(D=>({type:"Polygon",coordinates:D})):H.type==="MultiLineString"?H.coordinates.map(D=>({type:"LineString",coordinates:D})):H.type==="MultiPoint"?H.coordinates.map(D=>({type:"Point",coordinates:D})):[H]}class Ju{constructor(D,K){this.type=Je,this.geojson=D,this.geometries=K}static parse(D,K){if(D.length!==2)return K.error(`'distance' expression requires exactly one argument, but found ${D.length-1} instead.`);if(Oa(D[1])){const he=D[1];if(he.type==="FeatureCollection")return new Ju(he,he.features.map(Ee=>Kc(Ee.geometry)).flat());if(he.type==="Feature")return new Ju(he,Kc(he.geometry));if("type"in he&&"coordinates"in he)return new Ju(he,Kc(he))}return K.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return function(K,he){const Ee=K.geometry(),Be=Ee.flat().map(mt=>Jn([mt.x,mt.y],K.canonical));if(Ee.length===0)return NaN;const Ve=new Nc(Be[0][1]);let nt=1/0;for(const mt of he){switch(mt.type){case"Point":nt=Math.min(nt,zl(Be,!1,[mt.coordinates],!1,Ve,nt));break;case"LineString":nt=Math.min(nt,zl(Be,!1,mt.coordinates,!0,Ve,nt));break;case"Polygon":nt=Math.min(nt,xu(Be,!1,mt.coordinates,Ve,nt))}if(nt===0)return nt}return nt}(D,this.geometries);if(D.geometryType()==="LineString")return function(K,he){const Ee=K.geometry(),Be=Ee.flat().map(mt=>Jn([mt.x,mt.y],K.canonical));if(Ee.length===0)return NaN;const Ve=new Nc(Be[0][1]);let nt=1/0;for(const mt of he){switch(mt.type){case"Point":nt=Math.min(nt,zl(Be,!0,[mt.coordinates],!1,Ve,nt));break;case"LineString":nt=Math.min(nt,zl(Be,!0,mt.coordinates,!0,Ve,nt));break;case"Polygon":nt=Math.min(nt,xu(Be,!0,mt.coordinates,Ve,nt))}if(nt===0)return nt}return nt}(D,this.geometries);if(D.geometryType()==="Polygon")return function(K,he){const Ee=K.geometry();if(Ee.length===0||Ee[0].length===0)return NaN;const Be=Lu(Ee,0).map(mt=>mt.map(Pt=>Pt.map(Xt=>Jn([Xt.x,Xt.y],K.canonical)))),Ve=new Nc(Be[0][0][0][1]);let nt=1/0;for(const mt of he)for(const Pt of Be){switch(mt.type){case"Point":nt=Math.min(nt,xu([mt.coordinates],!1,Pt,Ve,nt));break;case"LineString":nt=Math.min(nt,xu(mt.coordinates,!0,Pt,Ve,nt));break;case"Polygon":nt=Math.min(nt,is(Pt,mt.coordinates,Ve,nt))}if(nt===0)return nt}return nt}(D,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const gc={"==":li,"!=":Ii,">":Ao,"<":xi,">=":Ro,"<=":So,array:yr,at:Qt,boolean:yr,case:Sa,coalesce:mi,collator:Li,format:bs,image:as,in:mr,"index-of":$r,interpolate:ci,"interpolate-hcl":ci,"interpolate-lab":ci,length:fs,let:Jr,literal:Lr,match:oa,number:yr,"number-format":Yi,object:yr,slice:ya,step:pa,string:yr,"to-boolean":zr,"to-color":zr,"to-number":zr,"to-string":zr,var:wt,within:Js,distance:Ju};class hl{constructor(D,K,he,Ee){this.name=D,this.type=K,this._evaluate=he,this.args=Ee}evaluate(D){return this._evaluate(D,this.args)}eachChild(D){this.args.forEach(D)}outputDefined(){return!1}static parse(D,K){const he=D[0],Ee=hl.definitions[he];if(!Ee)return K.error(`Unknown expression "${he}". If you wanted a literal array, use ["literal", [...]].`,0);const Be=Array.isArray(Ee)?Ee[0]:Ee.type,Ve=Array.isArray(Ee)?[[Ee[1],Ee[2]]]:Ee.overloads,nt=Ve.filter(([Pt])=>!Array.isArray(Pt)||Pt.length===D.length-1);let mt=null;for(const[Pt,Xt]of nt){mt=new Zr(K.registry,jc,K.path,null,K.scope);const er=[];let br=!1;for(let Rr=1;Rr{return br=er,Array.isArray(br)?`(${br.map(Ge).join(", ")})`:`(${Ge(br.type)}...)`;var br}).join(" | "),Xt=[];for(let er=1;er{K=D?K&&jc(he):K&&he instanceof Lr}),!!K&&$c(H)&&Qc(H,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function $c(H){if(H instanceof hl&&(H.name==="get"&&H.args.length===1||H.name==="feature-state"||H.name==="has"&&H.args.length===1||H.name==="properties"||H.name==="geometry-type"||H.name==="id"||/^filter-/.test(H.name))||H instanceof Js||H instanceof Ju)return!1;let D=!0;return H.eachChild(K=>{D&&!$c(K)&&(D=!1)}),D}function bu(H){if(H instanceof hl&&H.name==="feature-state")return!1;let D=!0;return H.eachChild(K=>{D&&!bu(K)&&(D=!1)}),D}function Qc(H,D){if(H instanceof hl&&D.indexOf(H.name)>=0)return!1;let K=!0;return H.eachChild(he=>{K&&!Qc(he,D)&&(K=!1)}),K}function sc(H){return{result:"success",value:H}}function wu(H){return{result:"error",value:H}}function eu(H){return H["property-type"]==="data-driven"||H["property-type"]==="cross-faded-data-driven"}function Sc(H){return!!H.expression&&H.expression.parameters.indexOf("zoom")>-1}function ef(H){return!!H.expression&&H.expression.interpolated}function ps(H){return H instanceof Number?"number":H instanceof String?"string":H instanceof Boolean?"boolean":Array.isArray(H)?"array":H===null?"null":typeof H}function Vc(H){return typeof H=="object"&&H!==null&&!Array.isArray(H)}function Zf(H){return H}function mf(H,D){const K=D.type==="color",he=H.stops&&typeof H.stops[0][0]=="object",Ee=he||!(he||H.property!==void 0),Be=H.type||(ef(D)?"exponential":"interval");if(K||D.type==="padding"){const Xt=K?Ot.parse:Ur.parse;(H=ce({},H)).stops&&(H.stops=H.stops.map(er=>[er[0],Xt(er[1])])),H.default=Xt(H.default?H.default:D.default)}if(H.colorSpace&&(Ve=H.colorSpace)!=="rgb"&&Ve!=="hcl"&&Ve!=="lab")throw new Error(`Unknown color space: "${H.colorSpace}"`);var Ve;let nt,mt,Pt;if(Be==="exponential")nt=xf;else if(Be==="interval")nt=tu;else if(Be==="categorical"){nt=_f,mt=Object.create(null);for(const Xt of H.stops)mt[Xt[0]]=Xt[1];Pt=typeof H.stops[0][0]}else{if(Be!=="identity")throw new Error(`Unknown function type "${Be}"`);nt=Fl}if(he){const Xt={},er=[];for(let jr=0;jrjr[0]),evaluate:({zoom:jr},Yr)=>xf({stops:br,base:H.base},D,jr).evaluate(jr,Yr)}}if(Ee){const Xt=Be==="exponential"?{name:"exponential",base:H.base!==void 0?H.base:1}:null;return{kind:"camera",interpolationType:Xt,interpolationFactor:ci.interpolationFactor.bind(void 0,Xt),zoomStops:H.stops.map(er=>er[0]),evaluate:({zoom:er})=>nt(H,D,er,mt,Pt)}}return{kind:"source",evaluate(Xt,er){const br=er&&er.properties?er.properties[H.property]:void 0;return br===void 0?Mc(H.default,D.default):nt(H,D,br,mt,Pt)}}}function Mc(H,D,K){return H!==void 0?H:D!==void 0?D:K!==void 0?K:void 0}function _f(H,D,K,he,Ee){return Mc(typeof K===Ee?he[K]:void 0,H.default,D.default)}function tu(H,D,K){if(ps(K)!=="number")return Mc(H.default,D.default);const he=H.stops.length;if(he===1||K<=H.stops[0][0])return H.stops[0][1];if(K>=H.stops[he-1][0])return H.stops[he-1][1];const Ee=ra(H.stops.map(Be=>Be[0]),K);return H.stops[Ee][1]}function xf(H,D,K){const he=H.base!==void 0?H.base:1;if(ps(K)!=="number")return Mc(H.default,D.default);const Ee=H.stops.length;if(Ee===1||K<=H.stops[0][0])return H.stops[0][1];if(K>=H.stops[Ee-1][0])return H.stops[Ee-1][1];const Be=ra(H.stops.map(Xt=>Xt[0]),K),Ve=function(Xt,er,br,Rr){const jr=Rr-br,Yr=Xt-br;return jr===0?0:er===1?Yr/jr:(Math.pow(er,Yr)-1)/(Math.pow(er,jr)-1)}(K,he,H.stops[Be][0],H.stops[Be+1][0]),nt=H.stops[Be][1],mt=H.stops[Be+1][1],Pt=Ci[D.type]||Zf;return typeof nt.evaluate=="function"?{evaluate(...Xt){const er=nt.evaluate.apply(void 0,Xt),br=mt.evaluate.apply(void 0,Xt);if(er!==void 0&&br!==void 0)return Pt(er,br,Ve,H.colorSpace)}}:Pt(nt,mt,Ve,H.colorSpace)}function Fl(H,D,K){switch(D.type){case"color":K=Ot.parse(K);break;case"formatted":K=na.fromString(K.toString());break;case"resolvedImage":K=Pa.fromString(K.toString());break;case"padding":K=Ur.parse(K);break;default:ps(K)===D.type||D.type==="enum"&&D.values[K]||(K=void 0)}return Mc(K,H.default,D.default)}hl.register(gc,{error:[{kind:"error"},[At],(H,[D])=>{throw new Er(D.evaluate(H))}],typeof:[At,[ir],(H,[D])=>Ge(dt(D.evaluate(H)))],"to-rgba":[ze(Je,4),[Rt],(H,[D])=>{const[K,he,Ee,Be]=D.evaluate(H).rgb;return[255*K,255*he,255*Ee,Be]}],rgb:[Rt,[Je,Je,Je],yf],rgba:[Rt,[Je,Je,Je,Je],yf],has:{type:St,overloads:[[[At],(H,[D])=>Jc(D.evaluate(H),H.properties())],[[At,Ut],(H,[D,K])=>Jc(D.evaluate(H),K.evaluate(H))]]},get:{type:ir,overloads:[[[At],(H,[D])=>Uc(D.evaluate(H),H.properties())],[[At,Ut],(H,[D,K])=>Uc(D.evaluate(H),K.evaluate(H))]]},"feature-state":[ir,[At],(H,[D])=>Uc(D.evaluate(H),H.featureState||{})],properties:[Ut,[],H=>H.properties()],"geometry-type":[At,[],H=>H.geometryType()],id:[ir,[],H=>H.id()],zoom:[Je,[],H=>H.globals.zoom],"heatmap-density":[Je,[],H=>H.globals.heatmapDensity||0],"line-progress":[Je,[],H=>H.globals.lineProgress||0],accumulated:[ir,[],H=>H.globals.accumulated===void 0?null:H.globals.accumulated],"+":[Je,$u(Je),(H,D)=>{let K=0;for(const he of D)K+=he.evaluate(H);return K}],"*":[Je,$u(Je),(H,D)=>{let K=1;for(const he of D)K*=he.evaluate(H);return K}],"-":{type:Je,overloads:[[[Je,Je],(H,[D,K])=>D.evaluate(H)-K.evaluate(H)],[[Je],(H,[D])=>-D.evaluate(H)]]},"/":[Je,[Je,Je],(H,[D,K])=>D.evaluate(H)/K.evaluate(H)],"%":[Je,[Je,Je],(H,[D,K])=>D.evaluate(H)%K.evaluate(H)],ln2:[Je,[],()=>Math.LN2],pi:[Je,[],()=>Math.PI],e:[Je,[],()=>Math.E],"^":[Je,[Je,Je],(H,[D,K])=>Math.pow(D.evaluate(H),K.evaluate(H))],sqrt:[Je,[Je],(H,[D])=>Math.sqrt(D.evaluate(H))],log10:[Je,[Je],(H,[D])=>Math.log(D.evaluate(H))/Math.LN10],ln:[Je,[Je],(H,[D])=>Math.log(D.evaluate(H))],log2:[Je,[Je],(H,[D])=>Math.log(D.evaluate(H))/Math.LN2],sin:[Je,[Je],(H,[D])=>Math.sin(D.evaluate(H))],cos:[Je,[Je],(H,[D])=>Math.cos(D.evaluate(H))],tan:[Je,[Je],(H,[D])=>Math.tan(D.evaluate(H))],asin:[Je,[Je],(H,[D])=>Math.asin(D.evaluate(H))],acos:[Je,[Je],(H,[D])=>Math.acos(D.evaluate(H))],atan:[Je,[Je],(H,[D])=>Math.atan(D.evaluate(H))],min:[Je,$u(Je),(H,D)=>Math.min(...D.map(K=>K.evaluate(H)))],max:[Je,$u(Je),(H,D)=>Math.max(...D.map(K=>K.evaluate(H)))],abs:[Je,[Je],(H,[D])=>Math.abs(D.evaluate(H))],round:[Je,[Je],(H,[D])=>{const K=D.evaluate(H);return K<0?-Math.round(-K):Math.round(K)}],floor:[Je,[Je],(H,[D])=>Math.floor(D.evaluate(H))],ceil:[Je,[Je],(H,[D])=>Math.ceil(D.evaluate(H))],"filter-==":[St,[At,ir],(H,[D,K])=>H.properties()[D.value]===K.value],"filter-id-==":[St,[ir],(H,[D])=>H.id()===D.value],"filter-type-==":[St,[At],(H,[D])=>H.geometryType()===D.value],"filter-<":[St,[At,ir],(H,[D,K])=>{const he=H.properties()[D.value],Ee=K.value;return typeof he==typeof Ee&&he{const K=H.id(),he=D.value;return typeof K==typeof he&&K":[St,[At,ir],(H,[D,K])=>{const he=H.properties()[D.value],Ee=K.value;return typeof he==typeof Ee&&he>Ee}],"filter-id->":[St,[ir],(H,[D])=>{const K=H.id(),he=D.value;return typeof K==typeof he&&K>he}],"filter-<=":[St,[At,ir],(H,[D,K])=>{const he=H.properties()[D.value],Ee=K.value;return typeof he==typeof Ee&&he<=Ee}],"filter-id-<=":[St,[ir],(H,[D])=>{const K=H.id(),he=D.value;return typeof K==typeof he&&K<=he}],"filter->=":[St,[At,ir],(H,[D,K])=>{const he=H.properties()[D.value],Ee=K.value;return typeof he==typeof Ee&&he>=Ee}],"filter-id->=":[St,[ir],(H,[D])=>{const K=H.id(),he=D.value;return typeof K==typeof he&&K>=he}],"filter-has":[St,[ir],(H,[D])=>D.value in H.properties()],"filter-has-id":[St,[],H=>H.id()!==null&&H.id()!==void 0],"filter-type-in":[St,[ze(At)],(H,[D])=>D.value.indexOf(H.geometryType())>=0],"filter-id-in":[St,[ze(ir)],(H,[D])=>D.value.indexOf(H.id())>=0],"filter-in-small":[St,[At,ze(ir)],(H,[D,K])=>K.value.indexOf(H.properties()[D.value])>=0],"filter-in-large":[St,[At,ze(ir)],(H,[D,K])=>function(he,Ee,Be,Ve){for(;Be<=Ve;){const nt=Be+Ve>>1;if(Ee[nt]===he)return!0;Ee[nt]>he?Ve=nt-1:Be=nt+1}return!1}(H.properties()[D.value],K.value,0,K.value.length-1)],all:{type:St,overloads:[[[St,St],(H,[D,K])=>D.evaluate(H)&&K.evaluate(H)],[$u(St),(H,D)=>{for(const K of D)if(!K.evaluate(H))return!1;return!0}]]},any:{type:St,overloads:[[[St,St],(H,[D,K])=>D.evaluate(H)||K.evaluate(H)],[$u(St),(H,D)=>{for(const K of D)if(K.evaluate(H))return!0;return!1}]]},"!":[St,[St],(H,[D])=>!D.evaluate(H)],"is-supported-script":[St,[At],(H,[D])=>{const K=H.globals&&H.globals.isSupportedScript;return!K||K(D.evaluate(H))}],upcase:[At,[At],(H,[D])=>D.evaluate(H).toUpperCase()],downcase:[At,[At],(H,[D])=>D.evaluate(H).toLowerCase()],concat:[At,$u(ir),(H,D)=>D.map(K=>vt(K.evaluate(H))).join("")],"resolved-locale":[At,[ar],(H,[D])=>D.evaluate(H).resolvedLocale()]});class ru{constructor(D,K){var he;this.expression=D,this._warningHistory={},this._evaluator=new Hr,this._defaultValue=K?(he=K).type==="color"&&Vc(he.default)?new Ot(0,0,0,0):he.type==="color"?Ot.parse(he.default)||null:he.type==="padding"?Ur.parse(he.default)||null:he.type==="variableAnchorOffsetCollection"?Aa.parse(he.default)||null:he.default===void 0?null:he.default:null,this._enumValues=K&&K.type==="enum"?K.values:null}evaluateWithoutErrorHandling(D,K,he,Ee,Be,Ve){return this._evaluator.globals=D,this._evaluator.feature=K,this._evaluator.featureState=he,this._evaluator.canonical=Ee,this._evaluator.availableImages=Be||null,this._evaluator.formattedSection=Ve,this.expression.evaluate(this._evaluator)}evaluate(D,K,he,Ee,Be,Ve){this._evaluator.globals=D,this._evaluator.feature=K||null,this._evaluator.featureState=he||null,this._evaluator.canonical=Ee,this._evaluator.availableImages=Be||null,this._evaluator.formattedSection=Ve||null;try{const nt=this.expression.evaluate(this._evaluator);if(nt==null||typeof nt=="number"&&nt!=nt)return this._defaultValue;if(this._enumValues&&!(nt in this._enumValues))throw new Er(`Expected value to be one of ${Object.keys(this._enumValues).map(mt=>JSON.stringify(mt)).join(", ")}, but found ${JSON.stringify(nt)} instead.`);return nt}catch(nt){return this._warningHistory[nt.message]||(this._warningHistory[nt.message]=!0,typeof console<"u"&&console.warn(nt.message)),this._defaultValue}}}function Uu(H){return Array.isArray(H)&&H.length>0&&typeof H[0]=="string"&&H[0]in gc}function $s(H,D){const K=new Zr(gc,jc,[],D?function(Ee){const Be={color:Rt,string:At,number:Je,enum:At,boolean:St,formatted:Mr,padding:fr,resolvedImage:dr,variableAnchorOffsetCollection:pt};return Ee.type==="array"?ze(Be[Ee.value]||ir,Ee.length):Be[Ee.type]}(D):void 0),he=K.parse(H,void 0,void 0,void 0,D&&D.type==="string"?{typeAnnotation:"coerce"}:void 0);return he?sc(new ru(he,D)):wu(K.errors)}class Qu{constructor(D,K){this.kind=D,this._styleExpression=K,this.isStateDependent=D!=="constant"&&!bu(K.expression)}evaluateWithoutErrorHandling(D,K,he,Ee,Be,Ve){return this._styleExpression.evaluateWithoutErrorHandling(D,K,he,Ee,Be,Ve)}evaluate(D,K,he,Ee,Be,Ve){return this._styleExpression.evaluate(D,K,he,Ee,Be,Ve)}}class Tu{constructor(D,K,he,Ee){this.kind=D,this.zoomStops=he,this._styleExpression=K,this.isStateDependent=D!=="camera"&&!bu(K.expression),this.interpolationType=Ee}evaluateWithoutErrorHandling(D,K,he,Ee,Be,Ve){return this._styleExpression.evaluateWithoutErrorHandling(D,K,he,Ee,Be,Ve)}evaluate(D,K,he,Ee,Be,Ve){return this._styleExpression.evaluate(D,K,he,Ee,Be,Ve)}interpolationFactor(D,K,he){return this.interpolationType?ci.interpolationFactor(this.interpolationType,D,K,he):0}}function au(H,D){const K=$s(H,D);if(K.result==="error")return K;const he=K.value.expression,Ee=$c(he);if(!Ee&&!eu(D))return wu([new Re("","data expressions not supported")]);const Be=Qc(he,["zoom"]);if(!Be&&!Sc(D))return wu([new Re("","zoom expressions not supported")]);const Ve=yc(he);return Ve||Be?Ve instanceof Re?wu([Ve]):Ve instanceof ci&&!ef(D)?wu([new Re("",'"interpolate" expressions cannot be used with this property')]):sc(Ve?new Tu(Ee?"camera":"composite",K.value,Ve.labels,Ve instanceof ci?Ve.interpolation:void 0):new Qu(Ee?"constant":"source",K.value)):wu([new Re("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ns{constructor(D,K){this._parameters=D,this._specification=K,ce(this,mf(this._parameters,this._specification))}static deserialize(D){return new Ns(D._parameters,D._specification)}static serialize(D){return{_parameters:D._parameters,_specification:D._specification}}}function yc(H){let D=null;if(H instanceof Jr)D=yc(H.result);else if(H instanceof mi){for(const K of H.args)if(D=yc(K),D)break}else(H instanceof pa||H instanceof ci)&&H.input instanceof hl&&H.input.name==="zoom"&&(D=H);return D instanceof Re||H.eachChild(K=>{const he=yc(K);he instanceof Re?D=he:!D&&he?D=new Re("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):D&&he&&D!==he&&(D=new Re("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),D}function Pu(H){if(H===!0||H===!1)return!0;if(!Array.isArray(H)||H.length===0)return!1;switch(H[0]){case"has":return H.length>=2&&H[1]!=="$id"&&H[1]!=="$type";case"in":return H.length>=3&&(typeof H[1]!="string"||Array.isArray(H[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return H.length!==3||Array.isArray(H[1])||Array.isArray(H[2]);case"any":case"all":for(const D of H.slice(1))if(!Pu(D)&&typeof D!="boolean")return!1;return!0;default:return!0}}const ec={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ec(H){if(H==null)return{filter:()=>!0,needGeometry:!1};Pu(H)||(H=lc(H));const D=$s(H,ec);if(D.result==="error")throw new Error(D.value.map(K=>`${K.key}: ${K.message}`).join(", "));return{filter:(K,he,Ee)=>D.value.evaluate(K,he,{},Ee),needGeometry:nh(H)}}function Cf(H,D){return HD?1:0}function nh(H){if(!Array.isArray(H))return!1;if(H[0]==="within"||H[0]==="distance")return!0;for(let D=1;D"||D==="<="||D===">="?kc(H[1],H[2],D):D==="any"?(K=H.slice(1),["any"].concat(K.map(lc))):D==="all"?["all"].concat(H.slice(1).map(lc)):D==="none"?["all"].concat(H.slice(1).map(lc).map(Cl)):D==="in"?nu(H[1],H.slice(2)):D==="!in"?Cl(nu(H[1],H.slice(2))):D==="has"?tf(H[1]):D!=="!has"||Cl(tf(H[1]));var K}function kc(H,D,K){switch(H){case"$type":return[`filter-type-${K}`,D];case"$id":return[`filter-id-${K}`,D];default:return[`filter-${K}`,H,D]}}function nu(H,D){if(D.length===0)return!1;switch(H){case"$type":return["filter-type-in",["literal",D]];case"$id":return["filter-id-in",["literal",D]];default:return D.length>200&&!D.some(K=>typeof K!=typeof D[0])?["filter-in-large",H,["literal",D.sort(Cf)]]:["filter-in-small",H,["literal",D]]}}function tf(H){switch(H){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",H]}}function Cl(H){return["!",H]}function uc(H){const D=typeof H;if(D==="number"||D==="boolean"||D==="string"||H==null)return JSON.stringify(H);if(Array.isArray(H)){let Ee="[";for(const Be of H)Ee+=`${uc(Be)},`;return`${Ee}]`}const K=Object.keys(H).sort();let he="{";for(let Ee=0;Eehe.maximum?[new xe(D,K,`${K} is greater than the maximum value ${he.maximum}`)]:[]}function _c(H){const D=H.valueSpec,K=Us(H.value.type);let he,Ee,Be,Ve={};const nt=K!=="categorical"&&H.value.property===void 0,mt=!nt,Pt=ps(H.value.stops)==="array"&&ps(H.value.stops[0])==="array"&&ps(H.value.stops[0][0])==="object",Xt=du({key:H.key,value:H.value,valueSpec:H.styleSpec.function,validateSpec:H.validateSpec,style:H.style,styleSpec:H.styleSpec,objectElementValidators:{stops:function(Rr){if(K==="identity")return[new xe(Rr.key,Rr.value,'identity function may not have a "stops" property')];let jr=[];const Yr=Rr.value;return jr=jr.concat(af({key:Rr.key,value:Yr,valueSpec:Rr.valueSpec,validateSpec:Rr.validateSpec,style:Rr.style,styleSpec:Rr.styleSpec,arrayElementValidator:er})),ps(Yr)==="array"&&Yr.length===0&&jr.push(new xe(Rr.key,Yr,"array must have at least one stop")),jr},default:function(Rr){return Rr.validateSpec({key:Rr.key,value:Rr.value,valueSpec:D,validateSpec:Rr.validateSpec,style:Rr.style,styleSpec:Rr.styleSpec})}}});return K==="identity"&&nt&&Xt.push(new xe(H.key,H.value,'missing required property "property"')),K==="identity"||H.value.stops||Xt.push(new xe(H.key,H.value,'missing required property "stops"')),K==="exponential"&&H.valueSpec.expression&&!ef(H.valueSpec)&&Xt.push(new xe(H.key,H.value,"exponential functions not supported")),H.styleSpec.$version>=8&&(mt&&!eu(H.valueSpec)?Xt.push(new xe(H.key,H.value,"property functions not supported")):nt&&!Sc(H.valueSpec)&&Xt.push(new xe(H.key,H.value,"zoom functions not supported"))),K!=="categorical"&&!Pt||H.value.property!==void 0||Xt.push(new xe(H.key,H.value,'"property" property is required')),Xt;function er(Rr){let jr=[];const Yr=Rr.value,ca=Rr.key;if(ps(Yr)!=="array")return[new xe(ca,Yr,`array expected, ${ps(Yr)} found`)];if(Yr.length!==2)return[new xe(ca,Yr,`array length 2 expected, length ${Yr.length} found`)];if(Pt){if(ps(Yr[0])!=="object")return[new xe(ca,Yr,`object expected, ${ps(Yr[0])} found`)];if(Yr[0].zoom===void 0)return[new xe(ca,Yr,"object stop key must have zoom")];if(Yr[0].value===void 0)return[new xe(ca,Yr,"object stop key must have value")];if(Be&&Be>Us(Yr[0].zoom))return[new xe(ca,Yr[0].zoom,"stop zoom values must appear in ascending order")];Us(Yr[0].zoom)!==Be&&(Be=Us(Yr[0].zoom),Ee=void 0,Ve={}),jr=jr.concat(du({key:`${ca}[0]`,value:Yr[0],valueSpec:{zoom:{}},validateSpec:Rr.validateSpec,style:Rr.style,styleSpec:Rr.styleSpec,objectElementValidators:{zoom:Rs,value:br}}))}else jr=jr.concat(br({key:`${ca}[0]`,value:Yr[0],valueSpec:{},validateSpec:Rr.validateSpec,style:Rr.style,styleSpec:Rr.styleSpec},Yr));return Uu(vu(Yr[1]))?jr.concat([new xe(`${ca}[1]`,Yr[1],"expressions are not allowed in function stops.")]):jr.concat(Rr.validateSpec({key:`${ca}[1]`,value:Yr[1],valueSpec:D,validateSpec:Rr.validateSpec,style:Rr.style,styleSpec:Rr.styleSpec}))}function br(Rr,jr){const Yr=ps(Rr.value),ca=Us(Rr.value),Ca=Rr.value!==null?Rr.value:jr;if(he){if(Yr!==he)return[new xe(Rr.key,Ca,`${Yr} stop domain type must match previous stop domain type ${he}`)]}else he=Yr;if(Yr!=="number"&&Yr!=="string"&&Yr!=="boolean")return[new xe(Rr.key,Ca,"stop domain value must be a number, string, or boolean")];if(Yr!=="number"&&K!=="categorical"){let un=`number expected, ${Yr} found`;return eu(D)&&K===void 0&&(un+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new xe(Rr.key,Ca,un)]}return K!=="categorical"||Yr!=="number"||isFinite(ca)&&Math.floor(ca)===ca?K!=="categorical"&&Yr==="number"&&Ee!==void 0&&canew xe(`${H.key}${he.key}`,H.value,he.message));const K=D.value.expression||D.value._styleExpression.expression;if(H.expressionContext==="property"&&H.propertyKey==="text-font"&&!K.outputDefined())return[new xe(H.key,H.value,`Invalid data expression for "${H.propertyKey}". Output values must be contained as literals within the expression.`)];if(H.expressionContext==="property"&&H.propertyType==="layout"&&!bu(K))return[new xe(H.key,H.value,'"feature-state" data expressions are not supported with layout properties.')];if(H.expressionContext==="filter"&&!bu(K))return[new xe(H.key,H.value,'"feature-state" data expressions are not supported with filters.')];if(H.expressionContext&&H.expressionContext.indexOf("cluster")===0){if(!Qc(K,["zoom","feature-state"]))return[new xe(H.key,H.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(H.expressionContext==="cluster-initial"&&!$c(K))return[new xe(H.key,H.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function iu(H){const D=H.key,K=H.value,he=H.valueSpec,Ee=[];return Array.isArray(he.values)?he.values.indexOf(Us(K))===-1&&Ee.push(new xe(D,K,`expected one of [${he.values.join(", ")}], ${JSON.stringify(K)} found`)):Object.keys(he.values).indexOf(Us(K))===-1&&Ee.push(new xe(D,K,`expected one of [${Object.keys(he.values).join(", ")}], ${JSON.stringify(K)} found`)),Ee}function xc(H){return Pu(vu(H.value))?ju(ce({},H,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Iu(H)}function Iu(H){const D=H.value,K=H.key;if(ps(D)!=="array")return[new xe(K,D,`array expected, ${ps(D)} found`)];const he=H.styleSpec;let Ee,Be=[];if(D.length<1)return[new xe(K,D,"filter array must have at least 1 element")];switch(Be=Be.concat(iu({key:`${K}[0]`,value:D[0],valueSpec:he.filter_operator,style:H.style,styleSpec:H.styleSpec})),Us(D[0])){case"<":case"<=":case">":case">=":D.length>=2&&Us(D[1])==="$type"&&Be.push(new xe(K,D,`"$type" cannot be use with operator "${D[0]}"`));case"==":case"!=":D.length!==3&&Be.push(new xe(K,D,`filter array for operator "${D[0]}" must have 3 elements`));case"in":case"!in":D.length>=2&&(Ee=ps(D[1]),Ee!=="string"&&Be.push(new xe(`${K}[1]`,D[1],`string expected, ${Ee} found`)));for(let Ve=2;Ve{Pt in K&&D.push(new xe(he,K[Pt],`"${Pt}" is prohibited for ref layers`))}),Ee.layers.forEach(Pt=>{Us(Pt.id)===nt&&(mt=Pt)}),mt?mt.ref?D.push(new xe(he,K.ref,"ref cannot reference another ref layer")):Ve=Us(mt.type):D.push(new xe(he,K.ref,`ref layer "${nt}" not found`))}else if(Ve!=="background")if(K.source){const mt=Ee.sources&&Ee.sources[K.source],Pt=mt&&Us(mt.type);mt?Pt==="vector"&&Ve==="raster"?D.push(new xe(he,K.source,`layer "${K.id}" requires a raster source`)):Pt!=="raster-dem"&&Ve==="hillshade"?D.push(new xe(he,K.source,`layer "${K.id}" requires a raster-dem source`)):Pt==="raster"&&Ve!=="raster"?D.push(new xe(he,K.source,`layer "${K.id}" requires a vector source`)):Pt!=="vector"||K["source-layer"]?Pt==="raster-dem"&&Ve!=="hillshade"?D.push(new xe(he,K.source,"raster-dem source can only be used with layer type 'hillshade'.")):Ve!=="line"||!K.paint||!K.paint["line-gradient"]||Pt==="geojson"&&mt.lineMetrics||D.push(new xe(he,K,`layer "${K.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):D.push(new xe(he,K,`layer "${K.id}" must specify a "source-layer"`)):D.push(new xe(he,K.source,`source "${K.source}" not found`))}else D.push(new xe(he,K,'missing required property "source"'));return D=D.concat(du({key:he,value:K,valueSpec:Be.layer,style:H.style,styleSpec:H.styleSpec,validateSpec:H.validateSpec,objectElementValidators:{"*":()=>[],type:()=>H.validateSpec({key:`${he}.type`,value:K.type,valueSpec:Be.layer.type,style:H.style,styleSpec:H.styleSpec,validateSpec:H.validateSpec,object:K,objectKey:"type"}),filter:xc,layout:mt=>du({layer:K,key:mt.key,value:mt.value,style:mt.style,styleSpec:mt.styleSpec,validateSpec:mt.validateSpec,objectElementValidators:{"*":Pt=>xl(ce({layerType:Ve},Pt))}}),paint:mt=>du({layer:K,key:mt.key,value:mt.value,style:mt.style,styleSpec:mt.styleSpec,validateSpec:mt.validateSpec,objectElementValidators:{"*":Pt=>Lf(ce({layerType:Ve},Pt))}})}})),D}function ou(H){const D=H.value,K=H.key,he=ps(D);return he!=="string"?[new xe(K,D,`string expected, ${he} found`)]:[]}const Ru={promoteId:function({key:H,value:D}){if(ps(D)==="string")return ou({key:H,value:D});{const K=[];for(const he in D)K.push(...ou({key:`${H}.${he}`,value:D[he]}));return K}}};function Au(H){const D=H.value,K=H.key,he=H.styleSpec,Ee=H.style,Be=H.validateSpec;if(!D.type)return[new xe(K,D,'"type" is required')];const Ve=Us(D.type);let nt;switch(Ve){case"vector":case"raster":return nt=du({key:K,value:D,valueSpec:he[`source_${Ve.replace("-","_")}`],style:H.style,styleSpec:he,objectElementValidators:Ru,validateSpec:Be}),nt;case"raster-dem":return nt=function(mt){var Pt;const Xt=(Pt=mt.sourceName)!==null&&Pt!==void 0?Pt:"",er=mt.value,br=mt.styleSpec,Rr=br.source_raster_dem,jr=mt.style;let Yr=[];const ca=ps(er);if(er===void 0)return Yr;if(ca!=="object")return Yr.push(new xe("source_raster_dem",er,`object expected, ${ca} found`)),Yr;const Ca=Us(er.encoding)==="custom",un=["redFactor","greenFactor","blueFactor","baseShift"],Ha=mt.value.encoding?`"${mt.value.encoding}"`:"Default";for(const rn in er)!Ca&&un.includes(rn)?Yr.push(new xe(rn,er[rn],`In "${Xt}": "${rn}" is only valid when "encoding" is set to "custom". ${Ha} encoding found`)):Rr[rn]?Yr=Yr.concat(mt.validateSpec({key:rn,value:er[rn],valueSpec:Rr[rn],validateSpec:mt.validateSpec,style:jr,styleSpec:br})):Yr.push(new xe(rn,er[rn],`unknown property "${rn}"`));return Yr}({sourceName:K,value:D,style:H.style,styleSpec:he,validateSpec:Be}),nt;case"geojson":if(nt=du({key:K,value:D,valueSpec:he.source_geojson,style:Ee,styleSpec:he,validateSpec:Be,objectElementValidators:Ru}),D.cluster)for(const mt in D.clusterProperties){const[Pt,Xt]=D.clusterProperties[mt],er=typeof Pt=="string"?[Pt,["accumulated"],["get",mt]]:Pt;nt.push(...ju({key:`${K}.${mt}.map`,value:Xt,validateSpec:Be,expressionContext:"cluster-map"})),nt.push(...ju({key:`${K}.${mt}.reduce`,value:er,validateSpec:Be,expressionContext:"cluster-reduce"}))}return nt;case"video":return du({key:K,value:D,valueSpec:he.source_video,style:Ee,validateSpec:Be,styleSpec:he});case"image":return du({key:K,value:D,valueSpec:he.source_image,style:Ee,validateSpec:Be,styleSpec:he});case"canvas":return[new xe(K,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return iu({key:`${K}.type`,value:D.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:Ee,validateSpec:Be,styleSpec:he})}}function Zs(H){const D=H.value,K=H.styleSpec,he=K.light,Ee=H.style;let Be=[];const Ve=ps(D);if(D===void 0)return Be;if(Ve!=="object")return Be=Be.concat([new xe("light",D,`object expected, ${Ve} found`)]),Be;for(const nt in D){const mt=nt.match(/^(.*)-transition$/);Be=Be.concat(mt&&he[mt[1]]&&he[mt[1]].transition?H.validateSpec({key:nt,value:D[nt],valueSpec:K.transition,validateSpec:H.validateSpec,style:Ee,styleSpec:K}):he[nt]?H.validateSpec({key:nt,value:D[nt],valueSpec:he[nt],validateSpec:H.validateSpec,style:Ee,styleSpec:K}):[new xe(nt,D[nt],`unknown property "${nt}"`)])}return Be}function Ol(H){const D=H.value,K=H.styleSpec,he=K.sky,Ee=H.style,Be=ps(D);if(D===void 0)return[];if(Be!=="object")return[new xe("sky",D,`object expected, ${Be} found`)];let Ve=[];for(const nt in D)Ve=Ve.concat(he[nt]?H.validateSpec({key:nt,value:D[nt],valueSpec:he[nt],style:Ee,styleSpec:K}):[new xe(nt,D[nt],`unknown property "${nt}"`)]);return Ve}function bl(H){const D=H.value,K=H.styleSpec,he=K.terrain,Ee=H.style;let Be=[];const Ve=ps(D);if(D===void 0)return Be;if(Ve!=="object")return Be=Be.concat([new xe("terrain",D,`object expected, ${Ve} found`)]),Be;for(const nt in D)Be=Be.concat(he[nt]?H.validateSpec({key:nt,value:D[nt],valueSpec:he[nt],validateSpec:H.validateSpec,style:Ee,styleSpec:K}):[new xe(nt,D[nt],`unknown property "${nt}"`)]);return Be}function tc(H){let D=[];const K=H.value,he=H.key;if(Array.isArray(K)){const Ee=[],Be=[];for(const Ve in K)K[Ve].id&&Ee.includes(K[Ve].id)&&D.push(new xe(he,K,`all the sprites' ids must be unique, but ${K[Ve].id} is duplicated`)),Ee.push(K[Ve].id),K[Ve].url&&Be.includes(K[Ve].url)&&D.push(new xe(he,K,`all the sprites' URLs must be unique, but ${K[Ve].url} is duplicated`)),Be.push(K[Ve].url),D=D.concat(du({key:`${he}[${Ve}]`,value:K[Ve],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:H.validateSpec}));return D}return ou({key:he,value:K})}const Su={"*":()=>[],array:af,boolean:function(H){const D=H.value,K=H.key,he=ps(D);return he!=="boolean"?[new xe(K,D,`boolean expected, ${he} found`)]:[]},number:Rs,color:function(H){const D=H.key,K=H.value,he=ps(K);return he!=="string"?[new xe(D,K,`color expected, ${he} found`)]:Ot.parse(String(K))?[]:[new xe(D,K,`color expected, "${K}" found`)]},constants:mc,enum:iu,filter:xc,function:_c,layer:nf,object:du,source:Au,light:Zs,sky:Ol,terrain:bl,projection:function(H){const D=H.value,K=H.styleSpec,he=K.projection,Ee=H.style,Be=ps(D);if(D===void 0)return[];if(Be!=="object")return[new xe("projection",D,`object expected, ${Be} found`)];let Ve=[];for(const nt in D)Ve=Ve.concat(he[nt]?H.validateSpec({key:nt,value:D[nt],valueSpec:he[nt],style:Ee,styleSpec:K}):[new xe(nt,D[nt],`unknown property "${nt}"`)]);return Ve},string:ou,formatted:function(H){return ou(H).length===0?[]:ju(H)},resolvedImage:function(H){return ou(H).length===0?[]:ju(H)},padding:function(H){const D=H.key,K=H.value;if(ps(K)==="array"){if(K.length<1||K.length>4)return[new xe(D,K,`padding requires 1 to 4 values; ${K.length} values found`)];const he={type:"number"};let Ee=[];for(let Be=0;Be[]}})),H.constants&&(K=K.concat(mc({key:"constants",value:H.constants,style:H,styleSpec:D,validateSpec:Cc}))),Or(K)}function qr(H){return function(D){return H(av(Sf({},D),{validateSpec:Cc}))}}function Or(H){return[].concat(H).sort((D,K)=>D.line-K.line)}function ua(H){return function(...D){return Or(H.apply(this,D))}}ur.source=ua(qr(Au)),ur.sprite=ua(qr(tc)),ur.glyphs=ua(qr(Ht)),ur.light=ua(qr(Zs)),ur.sky=ua(qr(Ol)),ur.terrain=ua(qr(bl)),ur.layer=ua(qr(nf)),ur.filter=ua(qr(xc)),ur.paintProperty=ua(qr(Lf)),ur.layoutProperty=ua(qr(xl));const Fa=ur,ja=Fa.light,sn=Fa.sky,gn=Fa.paintProperty,kn=Fa.layoutProperty;function Ja(H,D){let K=!1;if(D&&D.length)for(const he of D)H.fire(new q(new Error(he.message))),K=!0;return K}class _n{constructor(D,K,he){const Ee=this.cells=[];if(D instanceof ArrayBuffer){this.arrayBuffer=D;const Ve=new Int32Array(this.arrayBuffer);D=Ve[0],this.d=(K=Ve[1])+2*(he=Ve[2]);for(let mt=0;mt=er[jr+0]&&Ee>=er[jr+1])?(nt[Rr]=!0,Ve.push(Xt[Rr])):nt[Rr]=!1}}}}_forEachCell(D,K,he,Ee,Be,Ve,nt,mt){const Pt=this._convertToCellCoord(D),Xt=this._convertToCellCoord(K),er=this._convertToCellCoord(he),br=this._convertToCellCoord(Ee);for(let Rr=Pt;Rr<=er;Rr++)for(let jr=Xt;jr<=br;jr++){const Yr=this.d*jr+Rr;if((!mt||mt(this._convertFromCellCoord(Rr),this._convertFromCellCoord(jr),this._convertFromCellCoord(Rr+1),this._convertFromCellCoord(jr+1)))&&Be.call(this,D,K,he,Ee,Yr,Ve,nt,mt))return}}_convertFromCellCoord(D){return(D-this.padding)/this.scale}_convertToCellCoord(D){return Math.max(0,Math.min(this.d-1,Math.floor(D*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const D=this.cells,K=3+this.cells.length+1+1;let he=0;for(let Ve=0;Ve=0)continue;const Ve=H[Be];Ee[Be]=on[K].shallow.indexOf(Be)>=0?Ve:ji(Ve,D)}H instanceof Error&&(Ee.message=H.message)}if(Ee.$name)throw new Error("$name property is reserved for worker serialization logic.");return K!=="Object"&&(Ee.$name=K),Ee}function Ni(H){if(ki(H))return H;if(Array.isArray(H))return H.map(Ni);if(typeof H!="object")throw new Error("can't deserialize object of type "+typeof H);const D=zi(H)||"Object";if(!on[D])throw new Error(`can't deserialize unregistered class ${D}`);const{klass:K}=on[D];if(!K)throw new Error(`can't deserialize unregistered class ${D}`);if(K.deserialize)return K.deserialize(H);const he=Object.create(K.prototype);for(const Ee of Object.keys(H)){if(Ee==="$name")continue;const Be=H[Ee];he[Ee]=on[D].shallow.indexOf(Ee)>=0?Be:Ni(Be)}return he}class Bn{constructor(){this.first=!0}update(D,K){const he=Math.floor(D);return this.first?(this.first=!1,this.lastIntegerZoom=he,this.lastIntegerZoomTime=0,this.lastZoom=D,this.lastFloorZoom=he,!0):(this.lastFloorZoom>he?(this.lastIntegerZoom=he+1,this.lastIntegerZoomTime=K):this.lastFloorZoomH>=128&&H<=255,"Hangul Jamo":H=>H>=4352&&H<=4607,Khmer:H=>H>=6016&&H<=6143,"General Punctuation":H=>H>=8192&&H<=8303,"Letterlike Symbols":H=>H>=8448&&H<=8527,"Number Forms":H=>H>=8528&&H<=8591,"Miscellaneous Technical":H=>H>=8960&&H<=9215,"Control Pictures":H=>H>=9216&&H<=9279,"Optical Character Recognition":H=>H>=9280&&H<=9311,"Enclosed Alphanumerics":H=>H>=9312&&H<=9471,"Geometric Shapes":H=>H>=9632&&H<=9727,"Miscellaneous Symbols":H=>H>=9728&&H<=9983,"Miscellaneous Symbols and Arrows":H=>H>=11008&&H<=11263,"Ideographic Description Characters":H=>H>=12272&&H<=12287,"CJK Symbols and Punctuation":H=>H>=12288&&H<=12351,Katakana:H=>H>=12448&&H<=12543,Kanbun:H=>H>=12688&&H<=12703,"CJK Strokes":H=>H>=12736&&H<=12783,"Enclosed CJK Letters and Months":H=>H>=12800&&H<=13055,"CJK Compatibility":H=>H>=13056&&H<=13311,"Yijing Hexagram Symbols":H=>H>=19904&&H<=19967,"Private Use Area":H=>H>=57344&&H<=63743,"Vertical Forms":H=>H>=65040&&H<=65055,"CJK Compatibility Forms":H=>H>=65072&&H<=65103,"Small Form Variants":H=>H>=65104&&H<=65135,"Halfwidth and Fullwidth Forms":H=>H>=65280&&H<=65519};function Ki(H){for(const D of H)if(jo(D.charCodeAt(0)))return!0;return!1}function ko(H){for(const D of H)if(!os(D.charCodeAt(0)))return!1;return!0}function $o(H){const D=H.map(K=>{try{return new RegExp(`\\p{sc=${K}}`,"u").source}catch{return null}}).filter(K=>K);return new RegExp(D.join("|"),"u")}const Ls=$o(["Arab","Dupl","Mong","Ougr","Syrc"]);function os(H){return!Ls.test(String.fromCodePoint(H))}const As=$o(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function jo(H){return!(H!==746&&H!==747&&(H<4352||!(An["CJK Compatibility Forms"](H)&&!(H>=65097&&H<=65103)||An["CJK Compatibility"](H)||An["CJK Strokes"](H)||!(!An["CJK Symbols and Punctuation"](H)||H>=12296&&H<=12305||H>=12308&&H<=12319||H===12336)||An["Enclosed CJK Letters and Months"](H)||An["Ideographic Description Characters"](H)||An.Kanbun(H)||An.Katakana(H)&&H!==12540||!(!An["Halfwidth and Fullwidth Forms"](H)||H===65288||H===65289||H===65293||H>=65306&&H<=65310||H===65339||H===65341||H===65343||H>=65371&&H<=65503||H===65507||H>=65512&&H<=65519)||!(!An["Small Form Variants"](H)||H>=65112&&H<=65118||H>=65123&&H<=65126)||An["Vertical Forms"](H)||An["Yijing Hexagram Symbols"](H)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(H))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(H))||As.test(String.fromCodePoint(H)))))}function il(H){return!(jo(H)||function(D){return!!(An["Latin-1 Supplement"](D)&&(D===167||D===169||D===174||D===177||D===188||D===189||D===190||D===215||D===247)||An["General Punctuation"](D)&&(D===8214||D===8224||D===8225||D===8240||D===8241||D===8251||D===8252||D===8258||D===8263||D===8264||D===8265||D===8273)||An["Letterlike Symbols"](D)||An["Number Forms"](D)||An["Miscellaneous Technical"](D)&&(D>=8960&&D<=8967||D>=8972&&D<=8991||D>=8996&&D<=9e3||D===9003||D>=9085&&D<=9114||D>=9150&&D<=9165||D===9167||D>=9169&&D<=9179||D>=9186&&D<=9215)||An["Control Pictures"](D)&&D!==9251||An["Optical Character Recognition"](D)||An["Enclosed Alphanumerics"](D)||An["Geometric Shapes"](D)||An["Miscellaneous Symbols"](D)&&!(D>=9754&&D<=9759)||An["Miscellaneous Symbols and Arrows"](D)&&(D>=11026&&D<=11055||D>=11088&&D<=11097||D>=11192&&D<=11243)||An["CJK Symbols and Punctuation"](D)||An.Katakana(D)||An["Private Use Area"](D)||An["CJK Compatibility Forms"](D)||An["Small Form Variants"](D)||An["Halfwidth and Fullwidth Forms"](D)||D===8734||D===8756||D===8757||D>=9984&&D<=10087||D>=10102&&D<=10131||D===65532||D===65533)}(H))}const Qs=$o(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Ss(H){return Qs.test(String.fromCodePoint(H))}function fi(H,D){return!(!D&&Ss(H)||H>=2304&&H<=3583||H>=3840&&H<=4255||An.Khmer(H))}function ao(H){for(const D of H)if(Ss(D.charCodeAt(0)))return!0;return!1}const gs=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(H){this.pluginStatus=H.pluginStatus,this.pluginURL=H.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(H){this.applyArabicShaping=H.applyArabicShaping,this.processBidirectionalText=H.processBidirectionalText,this.processStyledBidirectionalText=H.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Jo{constructor(D,K){this.zoom=D,K?(this.now=K.now,this.fadeDuration=K.fadeDuration,this.zoomHistory=K.zoomHistory,this.transition=K.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Bn,this.transition={})}isSupportedScript(D){return function(K,he){for(const Ee of K)if(!fi(Ee.charCodeAt(0),he))return!1;return!0}(D,gs.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const D=this.zoom,K=D-Math.floor(D),he=this.crossFadingFactor();return D>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:K+(1-K)*he}:{fromScale:.5,toScale:1,t:1-(1-he)*K}}}class Bl{constructor(D,K){this.property=D,this.value=K,this.expression=function(he,Ee){if(Vc(he))return new Ns(he,Ee);if(Uu(he)){const Be=au(he,Ee);if(Be.result==="error")throw new Error(Be.value.map(Ve=>`${Ve.key}: ${Ve.message}`).join(", "));return Be.value}{let Be=he;return Ee.type==="color"&&typeof he=="string"?Be=Ot.parse(he):Ee.type!=="padding"||typeof he!="number"&&!Array.isArray(he)?Ee.type==="variableAnchorOffsetCollection"&&Array.isArray(he)&&(Be=Aa.parse(he)):Be=Ur.parse(he),{kind:"constant",evaluate:()=>Be}}}(K===void 0?D.specification.default:K,D.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(D,K,he){return this.property.possiblyEvaluate(this,D,K,he)}}class jl{constructor(D){this.property=D,this.value=new Bl(D,void 0)}transitioned(D,K){return new cc(this.property,this.value,K,M({},D.transition,this.transition),D.now)}untransitioned(){return new cc(this.property,this.value,null,{},0)}}class Vl{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitionablePropertyValues)}getValue(D){return u(this._values[D].value.value)}setValue(D,K){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new jl(this._values[D].property)),this._values[D].value=new Bl(this._values[D].property,K===null?void 0:u(K))}getTransition(D){return u(this._values[D].transition)}setTransition(D,K){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new jl(this._values[D].property)),this._values[D].transition=u(K)||void 0}serialize(){const D={};for(const K of Object.keys(this._values)){const he=this.getValue(K);he!==void 0&&(D[K]=he);const Ee=this.getTransition(K);Ee!==void 0&&(D[`${K}-transition`]=Ee)}return D}transitioned(D,K){const he=new ql(this._properties);for(const Ee of Object.keys(this._values))he._values[Ee]=this._values[Ee].transitioned(D,K._values[Ee]);return he}untransitioned(){const D=new ql(this._properties);for(const K of Object.keys(this._values))D._values[K]=this._values[K].untransitioned();return D}}class cc{constructor(D,K,he,Ee,Be){this.property=D,this.value=K,this.begin=Be+Ee.delay||0,this.end=this.begin+Ee.duration||0,D.specification.transition&&(Ee.delay||Ee.duration)&&(this.prior=he)}possiblyEvaluate(D,K,he){const Ee=D.now||0,Be=this.value.possiblyEvaluate(D,K,he),Ve=this.prior;if(Ve){if(Ee>this.end)return this.prior=null,Be;if(this.value.isDataDriven())return this.prior=null,Be;if(Ee=1)return 1;const Pt=mt*mt,Xt=Pt*mt;return 4*(mt<.5?Xt:3*(mt-Pt)+Xt-.75)}(nt))}}return Be}}class ql{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitioningPropertyValues)}possiblyEvaluate(D,K,he){const Ee=new rc(this._properties);for(const Be of Object.keys(this._values))Ee._values[Be]=this._values[Be].possiblyEvaluate(D,K,he);return Ee}hasTransition(){for(const D of Object.keys(this._values))if(this._values[D].prior)return!0;return!1}}class Vu{constructor(D){this._properties=D,this._values=Object.create(D.defaultPropertyValues)}hasValue(D){return this._values[D].value!==void 0}getValue(D){return u(this._values[D].value)}setValue(D,K){this._values[D]=new Bl(this._values[D].property,K===null?void 0:u(K))}serialize(){const D={};for(const K of Object.keys(this._values)){const he=this.getValue(K);he!==void 0&&(D[K]=he)}return D}possiblyEvaluate(D,K,he){const Ee=new rc(this._properties);for(const Be of Object.keys(this._values))Ee._values[Be]=this._values[Be].possiblyEvaluate(D,K,he);return Ee}}class ol{constructor(D,K,he){this.property=D,this.value=K,this.parameters=he}isConstant(){return this.value.kind==="constant"}constantOr(D){return this.value.kind==="constant"?this.value.value:D}evaluate(D,K,he,Ee){return this.property.evaluate(this.value,this.parameters,D,K,he,Ee)}}class rc{constructor(D){this._properties=D,this._values=Object.create(D.defaultPossiblyEvaluatedValues)}get(D){return this._values[D]}}class Vi{constructor(D){this.specification=D}possiblyEvaluate(D,K){if(D.isDataDriven())throw new Error("Value should not be data driven");return D.expression.evaluate(K)}interpolate(D,K,he){const Ee=Ci[this.specification.type];return Ee?Ee(D,K,he):D}}class eo{constructor(D,K){this.specification=D,this.overrides=K}possiblyEvaluate(D,K,he,Ee){return new ol(this,D.expression.kind==="constant"||D.expression.kind==="camera"?{kind:"constant",value:D.expression.evaluate(K,null,{},he,Ee)}:D.expression,K)}interpolate(D,K,he){if(D.value.kind!=="constant"||K.value.kind!=="constant")return D;if(D.value.value===void 0||K.value.value===void 0)return new ol(this,{kind:"constant",value:void 0},D.parameters);const Ee=Ci[this.specification.type];if(Ee){const Be=Ee(D.value.value,K.value.value,he);return new ol(this,{kind:"constant",value:Be},D.parameters)}return D}evaluate(D,K,he,Ee,Be,Ve){return D.kind==="constant"?D.value:D.evaluate(K,he,Ee,Be,Ve)}}class qu extends eo{possiblyEvaluate(D,K,he,Ee){if(D.value===void 0)return new ol(this,{kind:"constant",value:void 0},K);if(D.expression.kind==="constant"){const Be=D.expression.evaluate(K,null,{},he,Ee),Ve=D.property.specification.type==="resolvedImage"&&typeof Be!="string"?Be.name:Be,nt=this._calculate(Ve,Ve,Ve,K);return new ol(this,{kind:"constant",value:nt},K)}if(D.expression.kind==="camera"){const Be=this._calculate(D.expression.evaluate({zoom:K.zoom-1}),D.expression.evaluate({zoom:K.zoom}),D.expression.evaluate({zoom:K.zoom+1}),K);return new ol(this,{kind:"constant",value:Be},K)}return new ol(this,D.expression,K)}evaluate(D,K,he,Ee,Be,Ve){if(D.kind==="source"){const nt=D.evaluate(K,he,Ee,Be,Ve);return this._calculate(nt,nt,nt,K)}return D.kind==="composite"?this._calculate(D.evaluate({zoom:Math.floor(K.zoom)-1},he,Ee),D.evaluate({zoom:Math.floor(K.zoom)},he,Ee),D.evaluate({zoom:Math.floor(K.zoom)+1},he,Ee),K):D.value}_calculate(D,K,he,Ee){return Ee.zoom>Ee.zoomHistory.lastIntegerZoom?{from:D,to:K}:{from:he,to:K}}interpolate(D){return D}}class Du{constructor(D){this.specification=D}possiblyEvaluate(D,K,he,Ee){if(D.value!==void 0){if(D.expression.kind==="constant"){const Be=D.expression.evaluate(K,null,{},he,Ee);return this._calculate(Be,Be,Be,K)}return this._calculate(D.expression.evaluate(new Jo(Math.floor(K.zoom-1),K)),D.expression.evaluate(new Jo(Math.floor(K.zoom),K)),D.expression.evaluate(new Jo(Math.floor(K.zoom+1),K)),K)}}_calculate(D,K,he,Ee){return Ee.zoom>Ee.zoomHistory.lastIntegerZoom?{from:D,to:K}:{from:he,to:K}}interpolate(D){return D}}class wc{constructor(D){this.specification=D}possiblyEvaluate(D,K,he,Ee){return!!D.expression.evaluate(K,null,{},he,Ee)}interpolate(){return!1}}class De{constructor(D){this.properties=D,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const K in D){const he=D[K];he.specification.overridable&&this.overridableProperties.push(K);const Ee=this.defaultPropertyValues[K]=new Bl(he,void 0),Be=this.defaultTransitionablePropertyValues[K]=new jl(he);this.defaultTransitioningPropertyValues[K]=Be.untransitioned(),this.defaultPossiblyEvaluatedValues[K]=Ee.possiblyEvaluate({})}}}Wa("DataDrivenProperty",eo),Wa("DataConstantProperty",Vi),Wa("CrossFadedDataDrivenProperty",qu),Wa("CrossFadedProperty",Du),Wa("ColorRampProperty",wc);const I="-transition";class ne extends ae{constructor(D,K){if(super(),this.id=D.id,this.type=D.type,this._featureFilter={filter:()=>!0,needGeometry:!1},D.type!=="custom"&&(this.metadata=D.metadata,this.minzoom=D.minzoom,this.maxzoom=D.maxzoom,D.type!=="background"&&(this.source=D.source,this.sourceLayer=D["source-layer"],this.filter=D.filter),K.layout&&(this._unevaluatedLayout=new Vu(K.layout)),K.paint)){this._transitionablePaint=new Vl(K.paint);for(const he in D.paint)this.setPaintProperty(he,D.paint[he],{validate:!1});for(const he in D.layout)this.setLayoutProperty(he,D.layout[he],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new rc(K.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(D){return D==="visibility"?this.visibility:this._unevaluatedLayout.getValue(D)}setLayoutProperty(D,K,he={}){K!=null&&this._validate(kn,`layers.${this.id}.layout.${D}`,D,K,he)||(D!=="visibility"?this._unevaluatedLayout.setValue(D,K):this.visibility=K)}getPaintProperty(D){return D.endsWith(I)?this._transitionablePaint.getTransition(D.slice(0,-11)):this._transitionablePaint.getValue(D)}setPaintProperty(D,K,he={}){if(K!=null&&this._validate(gn,`layers.${this.id}.paint.${D}`,D,K,he))return!1;if(D.endsWith(I))return this._transitionablePaint.setTransition(D.slice(0,-11),K||void 0),!1;{const Ee=this._transitionablePaint._values[D],Be=Ee.property.specification["property-type"]==="cross-faded-data-driven",Ve=Ee.value.isDataDriven(),nt=Ee.value;this._transitionablePaint.setValue(D,K),this._handleSpecialPaintPropertyUpdate(D);const mt=this._transitionablePaint._values[D].value;return mt.isDataDriven()||Ve||Be||this._handleOverridablePaintPropertyUpdate(D,nt,mt)}}_handleSpecialPaintPropertyUpdate(D){}_handleOverridablePaintPropertyUpdate(D,K,he){return!1}isHidden(D){return!!(this.minzoom&&D=this.maxzoom)||this.visibility==="none"}updateTransitions(D){this._transitioningPaint=this._transitionablePaint.transitioned(D,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(D,K){D.getCrossfadeParameters&&(this._crossfadeParameters=D.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(D,void 0,K)),this.paint=this._transitioningPaint.possiblyEvaluate(D,void 0,K)}serialize(){const D={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&&(D.layout=D.layout||{},D.layout.visibility=this.visibility),p(D,(K,he)=>!(K===void 0||he==="layout"&&!Object.keys(K).length||he==="paint"&&!Object.keys(K).length))}_validate(D,K,he,Ee,Be={}){return(!Be||Be.validate!==!1)&&Ja(this,D.call(Fa,{key:K,layerType:this.type,objectKey:he,value:Ee,styleSpec:ie,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const D in this.paint._values){const K=this.paint.get(D);if(K instanceof ol&&eu(K.property.specification)&&(K.value.kind==="source"||K.value.kind==="composite")&&K.value.isStateDependent)return!0}return!1}}const Te={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Se{constructor(D,K){this._structArray=D,this._pos1=K*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Ie{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(D,K){return D._trim(),K&&(D.isTransferred=!0,K.push(D.arrayBuffer)),{length:D.length,arrayBuffer:D.arrayBuffer}}static deserialize(D){const K=Object.create(this.prototype);return K.arrayBuffer=D.arrayBuffer,K.length=D.length,K.capacity=D.arrayBuffer.byteLength/K.bytesPerElement,K._refreshViews(),K}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(D){this.reserve(D),this.length=D}reserve(D){if(D>this.capacity){this.capacity=Math.max(D,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const K=this.uint8;this._refreshViews(),K&&this.uint8.set(K)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ot(H,D=1){let K=0,he=0;return{members:H.map(Ee=>{const Be=Te[Ee.type].BYTES_PER_ELEMENT,Ve=K=yt(K,Math.max(D,Be)),nt=Ee.components||1;return he=Math.max(he,Be),K+=Be*nt,{name:Ee.name,type:Ee.type,components:nt,offset:Ve}}),size:yt(K,Math.max(he,D)),alignment:D}}function yt(H,D){return Math.ceil(H/D)*D}class Ct extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K){const he=this.length;return this.resize(he+1),this.emplace(he,D,K)}emplace(D,K,he){const Ee=2*D;return this.int16[Ee+0]=K,this.int16[Ee+1]=he,D}}Ct.prototype.bytesPerElement=4,Wa("StructArrayLayout2i4",Ct);class Wt extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,D,K,he)}emplace(D,K,he,Ee){const Be=3*D;return this.int16[Be+0]=K,this.int16[Be+1]=he,this.int16[Be+2]=Ee,D}}Wt.prototype.bytesPerElement=6,Wa("StructArrayLayout3i6",Wt);class nr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee){const Be=this.length;return this.resize(Be+1),this.emplace(Be,D,K,he,Ee)}emplace(D,K,he,Ee,Be){const Ve=4*D;return this.int16[Ve+0]=K,this.int16[Ve+1]=he,this.int16[Ve+2]=Ee,this.int16[Ve+3]=Be,D}}nr.prototype.bytesPerElement=8,Wa("StructArrayLayout4i8",nr);class or extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve){const nt=this.length;return this.resize(nt+1),this.emplace(nt,D,K,he,Ee,Be,Ve)}emplace(D,K,he,Ee,Be,Ve,nt){const mt=6*D;return this.int16[mt+0]=K,this.int16[mt+1]=he,this.int16[mt+2]=Ee,this.int16[mt+3]=Be,this.int16[mt+4]=Ve,this.int16[mt+5]=nt,D}}or.prototype.bytesPerElement=12,Wa("StructArrayLayout2i4i12",or);class Fr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve){const nt=this.length;return this.resize(nt+1),this.emplace(nt,D,K,he,Ee,Be,Ve)}emplace(D,K,he,Ee,Be,Ve,nt){const mt=4*D,Pt=8*D;return this.int16[mt+0]=K,this.int16[mt+1]=he,this.uint8[Pt+4]=Ee,this.uint8[Pt+5]=Be,this.uint8[Pt+6]=Ve,this.uint8[Pt+7]=nt,D}}Fr.prototype.bytesPerElement=8,Wa("StructArrayLayout2i4ub8",Fr);class Wr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K){const he=this.length;return this.resize(he+1),this.emplace(he,D,K)}emplace(D,K,he){const Ee=2*D;return this.float32[Ee+0]=K,this.float32[Ee+1]=he,D}}Wr.prototype.bytesPerElement=8,Wa("StructArrayLayout2f8",Wr);class je extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt){const er=this.length;return this.resize(er+1),this.emplace(er,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt)}emplace(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er){const br=10*D;return this.uint16[br+0]=K,this.uint16[br+1]=he,this.uint16[br+2]=Ee,this.uint16[br+3]=Be,this.uint16[br+4]=Ve,this.uint16[br+5]=nt,this.uint16[br+6]=mt,this.uint16[br+7]=Pt,this.uint16[br+8]=Xt,this.uint16[br+9]=er,D}}je.prototype.bytesPerElement=20,Wa("StructArrayLayout10ui20",je);class Ze extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br){const Rr=this.length;return this.resize(Rr+1),this.emplace(Rr,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br)}emplace(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr){const jr=12*D;return this.int16[jr+0]=K,this.int16[jr+1]=he,this.int16[jr+2]=Ee,this.int16[jr+3]=Be,this.uint16[jr+4]=Ve,this.uint16[jr+5]=nt,this.uint16[jr+6]=mt,this.uint16[jr+7]=Pt,this.int16[jr+8]=Xt,this.int16[jr+9]=er,this.int16[jr+10]=br,this.int16[jr+11]=Rr,D}}Ze.prototype.bytesPerElement=24,Wa("StructArrayLayout4i4ui4i24",Ze);class at extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,he){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,D,K,he)}emplace(D,K,he,Ee){const Be=3*D;return this.float32[Be+0]=K,this.float32[Be+1]=he,this.float32[Be+2]=Ee,D}}at.prototype.bytesPerElement=12,Wa("StructArrayLayout3f12",at);class lt extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(D){const K=this.length;return this.resize(K+1),this.emplace(K,D)}emplace(D,K){return this.uint32[1*D+0]=K,D}}lt.prototype.bytesPerElement=4,Wa("StructArrayLayout1ul4",lt);class Tt extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve,nt,mt,Pt){const Xt=this.length;return this.resize(Xt+1),this.emplace(Xt,D,K,he,Ee,Be,Ve,nt,mt,Pt)}emplace(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt){const er=10*D,br=5*D;return this.int16[er+0]=K,this.int16[er+1]=he,this.int16[er+2]=Ee,this.int16[er+3]=Be,this.int16[er+4]=Ve,this.int16[er+5]=nt,this.uint32[br+3]=mt,this.uint16[er+8]=Pt,this.uint16[er+9]=Xt,D}}Tt.prototype.bytesPerElement=20,Wa("StructArrayLayout6i1ul2ui20",Tt);class gt extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve){const nt=this.length;return this.resize(nt+1),this.emplace(nt,D,K,he,Ee,Be,Ve)}emplace(D,K,he,Ee,Be,Ve,nt){const mt=6*D;return this.int16[mt+0]=K,this.int16[mt+1]=he,this.int16[mt+2]=Ee,this.int16[mt+3]=Be,this.int16[mt+4]=Ve,this.int16[mt+5]=nt,D}}gt.prototype.bytesPerElement=12,Wa("StructArrayLayout2i2i2i12",gt);class Et extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be){const Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,D,K,he,Ee,Be)}emplace(D,K,he,Ee,Be,Ve){const nt=4*D,mt=8*D;return this.float32[nt+0]=K,this.float32[nt+1]=he,this.float32[nt+2]=Ee,this.int16[mt+6]=Be,this.int16[mt+7]=Ve,D}}Et.prototype.bytesPerElement=16,Wa("StructArrayLayout2f1f2i16",Et);class Yt extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve){const nt=this.length;return this.resize(nt+1),this.emplace(nt,D,K,he,Ee,Be,Ve)}emplace(D,K,he,Ee,Be,Ve,nt){const mt=16*D,Pt=4*D,Xt=8*D;return this.uint8[mt+0]=K,this.uint8[mt+1]=he,this.float32[Pt+1]=Ee,this.float32[Pt+2]=Be,this.int16[Xt+6]=Ve,this.int16[Xt+7]=nt,D}}Yt.prototype.bytesPerElement=16,Wa("StructArrayLayout2ub2f2i16",Yt);class rr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,he){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,D,K,he)}emplace(D,K,he,Ee){const Be=3*D;return this.uint16[Be+0]=K,this.uint16[Be+1]=he,this.uint16[Be+2]=Ee,D}}rr.prototype.bytesPerElement=6,Wa("StructArrayLayout3ui6",rr);class sr extends Ie{_refreshViews(){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)}emplaceBack(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca){const un=this.length;return this.resize(un+1),this.emplace(un,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca)}emplace(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca,un){const Ha=24*D,rn=12*D,Sn=48*D;return this.int16[Ha+0]=K,this.int16[Ha+1]=he,this.uint16[Ha+2]=Ee,this.uint16[Ha+3]=Be,this.uint32[rn+2]=Ve,this.uint32[rn+3]=nt,this.uint32[rn+4]=mt,this.uint16[Ha+10]=Pt,this.uint16[Ha+11]=Xt,this.uint16[Ha+12]=er,this.float32[rn+7]=br,this.float32[rn+8]=Rr,this.uint8[Sn+36]=jr,this.uint8[Sn+37]=Yr,this.uint8[Sn+38]=ca,this.uint32[rn+10]=Ca,this.int16[Ha+22]=un,D}}sr.prototype.bytesPerElement=48,Wa("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",sr);class Sr extends Ie{_refreshViews(){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)}emplaceBack(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca,un,Ha,rn,Sn,$n,Oi,qo,qi,Di,mo,so){const to=this.length;return this.resize(to+1),this.emplace(to,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca,un,Ha,rn,Sn,$n,Oi,qo,qi,Di,mo,so)}emplace(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca,un,Ha,rn,Sn,$n,Oi,qo,qi,Di,mo,so,to){const zn=32*D,To=16*D;return this.int16[zn+0]=K,this.int16[zn+1]=he,this.int16[zn+2]=Ee,this.int16[zn+3]=Be,this.int16[zn+4]=Ve,this.int16[zn+5]=nt,this.int16[zn+6]=mt,this.int16[zn+7]=Pt,this.uint16[zn+8]=Xt,this.uint16[zn+9]=er,this.uint16[zn+10]=br,this.uint16[zn+11]=Rr,this.uint16[zn+12]=jr,this.uint16[zn+13]=Yr,this.uint16[zn+14]=ca,this.uint16[zn+15]=Ca,this.uint16[zn+16]=un,this.uint16[zn+17]=Ha,this.uint16[zn+18]=rn,this.uint16[zn+19]=Sn,this.uint16[zn+20]=$n,this.uint16[zn+21]=Oi,this.uint16[zn+22]=qo,this.uint32[To+12]=qi,this.float32[To+13]=Di,this.float32[To+14]=mo,this.uint16[zn+30]=so,this.uint16[zn+31]=to,D}}Sr.prototype.bytesPerElement=64,Wa("StructArrayLayout8i15ui1ul2f2ui64",Sr);class Nr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D){const K=this.length;return this.resize(K+1),this.emplace(K,D)}emplace(D,K){return this.float32[1*D+0]=K,D}}Nr.prototype.bytesPerElement=4,Wa("StructArrayLayout1f4",Nr);class Qr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,he){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,D,K,he)}emplace(D,K,he,Ee){const Be=3*D;return this.uint16[6*D+0]=K,this.float32[Be+1]=he,this.float32[Be+2]=Ee,D}}Qr.prototype.bytesPerElement=12,Wa("StructArrayLayout1ui2f12",Qr);class ia extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,he){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,D,K,he)}emplace(D,K,he,Ee){const Be=4*D;return this.uint32[2*D+0]=K,this.uint16[Be+2]=he,this.uint16[Be+3]=Ee,D}}ia.prototype.bytesPerElement=8,Wa("StructArrayLayout1ul2ui8",ia);class _a extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K){const he=this.length;return this.resize(he+1),this.emplace(he,D,K)}emplace(D,K,he){const Ee=2*D;return this.uint16[Ee+0]=K,this.uint16[Ee+1]=he,D}}_a.prototype.bytesPerElement=4,Wa("StructArrayLayout2ui4",_a);class za extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D){const K=this.length;return this.resize(K+1),this.emplace(K,D)}emplace(D,K){return this.uint16[1*D+0]=K,D}}za.prototype.bytesPerElement=2,Wa("StructArrayLayout1ui2",za);class nn extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee){const Be=this.length;return this.resize(Be+1),this.emplace(Be,D,K,he,Ee)}emplace(D,K,he,Ee,Be){const Ve=4*D;return this.float32[Ve+0]=K,this.float32[Ve+1]=he,this.float32[Ve+2]=Ee,this.float32[Ve+3]=Be,D}}nn.prototype.bytesPerElement=16,Wa("StructArrayLayout4f16",nn);class en extends Se{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new i(this.anchorPointX,this.anchorPointY)}}en.prototype.size=20;class ln extends Tt{get(D){return new en(this,D)}}Wa("CollisionBoxArray",ln);class Nn extends Se{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(D){this._structArray.uint8[this._pos1+37]=D}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(D){this._structArray.uint8[this._pos1+38]=D}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(D){this._structArray.uint32[this._pos4+10]=D}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Nn.prototype.size=48;class pi extends sr{get(D){return new Nn(this,D)}}Wa("PlacedSymbolArray",pi);class ii extends Se{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(D){this._structArray.uint32[this._pos4+12]=D}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}ii.prototype.size=64;class Gi extends Sr{get(D){return new ii(this,D)}}Wa("SymbolInstanceArray",Gi);class Bo extends Nr{getoffsetX(D){return this.float32[1*D+0]}}Wa("GlyphOffsetArray",Bo);class No extends Wt{getx(D){return this.int16[3*D+0]}gety(D){return this.int16[3*D+1]}gettileUnitDistanceFromAnchor(D){return this.int16[3*D+2]}}Wa("SymbolLineVertexArray",No);class po extends Se{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}po.prototype.size=12;class Zo extends Qr{get(D){return new po(this,D)}}Wa("TextAnchorOffsetArray",Zo);class Hs extends Se{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Hs.prototype.size=8;class zs extends ia{get(D){return new Hs(this,D)}}Wa("FeatureIndexArray",zs);class xo extends Ct{}class bo extends Ct{}class vl extends Ct{}class Al extends or{}class pu extends Fr{}class pe extends Wr{}class Le extends je{}class Ye extends Ze{}class ut extends at{}class ht extends lt{}class xt extends gt{}class zt extends Yt{}class Dt extends rr{}class $t extends _a{}const Cr=ot([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ar}=Cr;class Vr{constructor(D=[]){this.segments=D}prepareSegment(D,K,he,Ee){let Be=this.segments[this.segments.length-1];return D>Vr.MAX_VERTEX_ARRAY_LENGTH&&m(`Max vertices per segment is ${Vr.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${D}`),(!Be||Be.vertexLength+D>Vr.MAX_VERTEX_ARRAY_LENGTH||Be.sortKey!==Ee)&&(Be={vertexOffset:K.length,primitiveOffset:he.length,vertexLength:0,primitiveLength:0},Ee!==void 0&&(Be.sortKey=Ee),this.segments.push(Be)),Be}get(){return this.segments}destroy(){for(const D of this.segments)for(const K in D.vaos)D.vaos[K].destroy()}static simpleSegment(D,K,he,Ee){return new Vr([{vertexOffset:D,primitiveOffset:K,vertexLength:he,primitiveLength:Ee,vaos:{},sortKey:0}])}}function Kr(H,D){return 256*(H=b(Math.floor(H),0,255))+b(Math.floor(D),0,255)}Vr.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Wa("SegmentVector",Vr);const aa=ot([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Ua={exports:{}},la={exports:{}};la.exports=function(H,D){var K,he,Ee,Be,Ve,nt,mt,Pt;for(he=H.length-(K=3&H.length),Ee=D,Ve=3432918353,nt=461845907,Pt=0;Pt>>16)*Ve&65535)<<16)&4294967295)<<15|mt>>>17))*nt+(((mt>>>16)*nt&65535)<<16)&4294967295)<<13|Ee>>>19))+((5*(Ee>>>16)&65535)<<16)&4294967295))+((58964+(Be>>>16)&65535)<<16);switch(mt=0,K){case 3:mt^=(255&H.charCodeAt(Pt+2))<<16;case 2:mt^=(255&H.charCodeAt(Pt+1))<<8;case 1:Ee^=mt=(65535&(mt=(mt=(65535&(mt^=255&H.charCodeAt(Pt)))*Ve+(((mt>>>16)*Ve&65535)<<16)&4294967295)<<15|mt>>>17))*nt+(((mt>>>16)*nt&65535)<<16)&4294967295}return Ee^=H.length,Ee=2246822507*(65535&(Ee^=Ee>>>16))+((2246822507*(Ee>>>16)&65535)<<16)&4294967295,Ee=3266489909*(65535&(Ee^=Ee>>>13))+((3266489909*(Ee>>>16)&65535)<<16)&4294967295,(Ee^=Ee>>>16)>>>0};var Ta=la.exports,ka={exports:{}};ka.exports=function(H,D){for(var K,he=H.length,Ee=D^he,Be=0;he>=4;)K=1540483477*(65535&(K=255&H.charCodeAt(Be)|(255&H.charCodeAt(++Be))<<8|(255&H.charCodeAt(++Be))<<16|(255&H.charCodeAt(++Be))<<24))+((1540483477*(K>>>16)&65535)<<16),Ee=1540483477*(65535&Ee)+((1540483477*(Ee>>>16)&65535)<<16)^(K=1540483477*(65535&(K^=K>>>24))+((1540483477*(K>>>16)&65535)<<16)),he-=4,++Be;switch(he){case 3:Ee^=(255&H.charCodeAt(Be+2))<<16;case 2:Ee^=(255&H.charCodeAt(Be+1))<<8;case 1:Ee=1540483477*(65535&(Ee^=255&H.charCodeAt(Be)))+((1540483477*(Ee>>>16)&65535)<<16)}return Ee=1540483477*(65535&(Ee^=Ee>>>13))+((1540483477*(Ee>>>16)&65535)<<16),(Ee^=Ee>>>15)>>>0};var Ba=Ta,Va=ka.exports;Ua.exports=Ba,Ua.exports.murmur3=Ba,Ua.exports.murmur2=Va;var Ma=r(Ua.exports);class mn{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(D,K,he,Ee){this.ids.push(Wn(D)),this.positions.push(K,he,Ee)}getPositions(D){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const K=Wn(D);let he=0,Ee=this.ids.length-1;for(;he>1;this.ids[Ve]>=K?Ee=Ve:he=Ve+1}const Be=[];for(;this.ids[he]===K;)Be.push({index:this.positions[3*he],start:this.positions[3*he+1],end:this.positions[3*he+2]}),he++;return Be}static serialize(D,K){const he=new Float64Array(D.ids),Ee=new Uint32Array(D.positions);return jn(he,Ee,0,he.length-1),K&&K.push(he.buffer,Ee.buffer),{ids:he,positions:Ee}}static deserialize(D){const K=new mn;return K.ids=D.ids,K.positions=D.positions,K.indexed=!0,K}}function Wn(H){const D=+H;return!isNaN(D)&&D<=Number.MAX_SAFE_INTEGER?D:Ma(String(H))}function jn(H,D,K,he){for(;K>1];let Be=K-1,Ve=he+1;for(;;){do Be++;while(H[Be]Ee);if(Be>=Ve)break;Zn(H,Be,Ve),Zn(D,3*Be,3*Ve),Zn(D,3*Be+1,3*Ve+1),Zn(D,3*Be+2,3*Ve+2)}Ve-K`u_${Ee}`),this.type=he}setUniform(D,K,he){D.set(he.constantOr(this.value))}getBinding(D,K,he){return this.type==="color"?new wi(D,K):new _i(D,K)}}class Ms{constructor(D,K){this.uniformNames=K.map(he=>`u_${he}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(D,K){this.pixelRatioFrom=K.pixelRatio,this.pixelRatioTo=D.pixelRatio,this.patternFrom=K.tlbr,this.patternTo=D.tlbr}setUniform(D,K,he,Ee){const Be=Ee==="u_pattern_to"?this.patternTo:Ee==="u_pattern_from"?this.patternFrom:Ee==="u_pixel_ratio_to"?this.pixelRatioTo:Ee==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Be&&D.set(Be)}getBinding(D,K,he){return he.substr(0,9)==="u_pattern"?new Po(D,K):new _i(D,K)}}class Kn{constructor(D,K,he,Ee){this.expression=D,this.type=he,this.maxValue=0,this.paintVertexAttributes=K.map(Be=>({name:`a_${Be}`,type:"Float32",components:he==="color"?2:1,offset:0})),this.paintVertexArray=new Ee}populatePaintArray(D,K,he,Ee,Be){const Ve=this.paintVertexArray.length,nt=this.expression.evaluate(new Jo(0),K,{},Ee,[],Be);this.paintVertexArray.resize(D),this._setPaintValue(Ve,D,nt)}updatePaintArray(D,K,he,Ee){const Be=this.expression.evaluate({zoom:0},he,Ee);this._setPaintValue(D,K,Be)}_setPaintValue(D,K,he){if(this.type==="color"){const Ee=Vo(he);for(let Be=D;Be`u_${nt}_t`),this.type=he,this.useIntegerZoom=Ee,this.zoom=Be,this.maxValue=0,this.paintVertexAttributes=K.map(nt=>({name:`a_${nt}`,type:"Float32",components:he==="color"?4:2,offset:0})),this.paintVertexArray=new Ve}populatePaintArray(D,K,he,Ee,Be){const Ve=this.expression.evaluate(new Jo(this.zoom),K,{},Ee,[],Be),nt=this.expression.evaluate(new Jo(this.zoom+1),K,{},Ee,[],Be),mt=this.paintVertexArray.length;this.paintVertexArray.resize(D),this._setPaintValue(mt,D,Ve,nt)}updatePaintArray(D,K,he,Ee){const Be=this.expression.evaluate({zoom:this.zoom},he,Ee),Ve=this.expression.evaluate({zoom:this.zoom+1},he,Ee);this._setPaintValue(D,K,Be,Ve)}_setPaintValue(D,K,he,Ee){if(this.type==="color"){const Be=Vo(he),Ve=Vo(Ee);for(let nt=D;nt`#define HAS_UNIFORM_${Ee}`))}return D}getBinderAttributes(){const D=[];for(const K in this.binders){const he=this.binders[K];if(he instanceof Kn||he instanceof go)for(let Ee=0;Ee!0){this.programConfigurations={};for(const Ee of D)this.programConfigurations[Ee.id]=new Es(Ee,K,he);this.needsUpload=!1,this._featureMap=new mn,this._bufferOffset=0}populatePaintArrays(D,K,he,Ee,Be,Ve){for(const nt in this.programConfigurations)this.programConfigurations[nt].populatePaintArrays(D,K,Ee,Be,Ve);K.id!==void 0&&this._featureMap.add(K.id,he,this._bufferOffset,D),this._bufferOffset=D,this.needsUpload=!0}updatePaintArrays(D,K,he,Ee){for(const Be of he)this.needsUpload=this.programConfigurations[Be.id].updatePaintArrays(D,this._featureMap,K,Be,Ee)||this.needsUpload}get(D){return this.programConfigurations[D]}upload(D){if(this.needsUpload){for(const K in this.programConfigurations)this.programConfigurations[K].upload(D);this.needsUpload=!1}}destroy(){for(const D in this.programConfigurations)this.programConfigurations[D].destroy()}}function Hl(H,D){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[H]||[H.replace(`${D}-`,"").replace(/-/g,"_")]}function Qo(H,D,K){const he={color:{source:Wr,composite:nn},number:{source:Nr,composite:Wr}},Ee=function(Be){return{"line-pattern":{source:Le,composite:Le},"fill-pattern":{source:Le,composite:Le},"fill-extrusion-pattern":{source:Le,composite:Le}}[Be]}(H);return Ee&&Ee[K]||he[D][K]}Wa("ConstantBinder",sl),Wa("CrossFadedConstantBinder",Ms),Wa("SourceExpressionBinder",Kn),Wa("CrossFadedCompositeBinder",Do),Wa("CompositeExpressionBinder",go),Wa("ProgramConfiguration",Es,{omit:["_buffers"]}),Wa("ProgramConfigurationSet",hs);const _s=8192,gu=Math.pow(2,14)-1,el=-gu-1;function cr(H){const D=_s/H.extent,K=H.loadGeometry();for(let he=0;heVe.x+1||mtVe.y+1)&&m("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return K}function fa(H,D){return{type:H.type,id:H.id,properties:H.properties,geometry:D?cr(H):[]}}function xa(H,D,K,he,Ee){H.emplaceBack(2*D+(he+1)/2,2*K+(Ee+1)/2)}class cn{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(K=>K.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new bo,this.indexArray=new Dt,this.segments=new Vr,this.programConfigurations=new hs(D.layers,D.zoom),this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,he){const Ee=this.layers[0],Be=[];let Ve=null,nt=!1;Ee.type==="circle"&&(Ve=Ee.layout.get("circle-sort-key"),nt=!Ve.isConstant());for(const{feature:mt,id:Pt,index:Xt,sourceLayerIndex:er}of D){const br=this.layers[0]._featureFilter.needGeometry,Rr=fa(mt,br);if(!this.layers[0]._featureFilter.filter(new Jo(this.zoom),Rr,he))continue;const jr=nt?Ve.evaluate(Rr,{},he):void 0,Yr={id:Pt,properties:mt.properties,type:mt.type,sourceLayerIndex:er,index:Xt,geometry:br?Rr.geometry:cr(mt),patterns:{},sortKey:jr};Be.push(Yr)}nt&&Be.sort((mt,Pt)=>mt.sortKey-Pt.sortKey);for(const mt of Be){const{geometry:Pt,index:Xt,sourceLayerIndex:er}=mt,br=D[Xt].feature;this.addFeature(mt,Pt,Xt,he),K.featureIndex.insert(br,Pt,Xt,er,this.index)}}update(D,K,he){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,he)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Ar),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(D,K,he,Ee){for(const Be of K)for(const Ve of Be){const nt=Ve.x,mt=Ve.y;if(nt<0||nt>=_s||mt<0||mt>=_s)continue;const Pt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,D.sortKey),Xt=Pt.vertexLength;xa(this.layoutVertexArray,nt,mt,-1,-1),xa(this.layoutVertexArray,nt,mt,1,-1),xa(this.layoutVertexArray,nt,mt,1,1),xa(this.layoutVertexArray,nt,mt,-1,1),this.indexArray.emplaceBack(Xt,Xt+1,Xt+2),this.indexArray.emplaceBack(Xt,Xt+3,Xt+2),Pt.vertexLength+=4,Pt.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,he,{},Ee)}}function In(H,D){for(let K=0;K1){if(Un(H,D))return!0;for(let he=0;he1?K:K.sub(D)._mult(Ee)._add(D))}function Ti(H,D){let K,he,Ee,Be=!1;for(let Ve=0;VeD.y!=Ee.y>D.y&&D.x<(Ee.x-he.x)*(D.y-he.y)/(Ee.y-he.y)+he.x&&(Be=!Be)}return Be}function si(H,D){let K=!1;for(let he=0,Ee=H.length-1;heD.y!=Ve.y>D.y&&D.x<(Ve.x-Be.x)*(D.y-Be.y)/(Ve.y-Be.y)+Be.x&&(K=!K)}return K}function Fn(H,D,K){const he=K[0],Ee=K[2];if(H.xEe.x&&D.x>Ee.x||H.yEe.y&&D.y>Ee.y)return!1;const Be=R(H,D,K[0]);return Be!==R(H,D,K[1])||Be!==R(H,D,K[2])||Be!==R(H,D,K[3])}function qa(H,D,K){const he=D.paint.get(H).value;return he.kind==="constant"?he.value:K.programConfigurations.get(D.id).getMaxValue(H)}function wn(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])}function Tn(H,D,K,he,Ee){if(!D[0]&&!D[1])return H;const Be=i.convert(D)._mult(Ee);K==="viewport"&&Be._rotate(-he);const Ve=[];for(let nt=0;ntro(ca,Yr))}(Pt,mt),Rr=er?Xt*nt:Xt;for(const jr of Ee)for(const Yr of jr){const ca=er?Yr:ro(Yr,mt);let Ca=Rr;const un=gi([],[Yr.x,Yr.y,0,1],mt);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Ca*=un[3]/Ve.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Ca*=Ve.cameraToCenterDistance/un[3]),Da(br,ca,Ca))return!0}return!1}}function ro(H,D){const K=gi([],[H.x,H.y,0,1],D);return new i(K[0]/K[3],K[1]/K[3])}class es extends cn{}let Fi;Wa("HeatmapBucket",es,{omit:["layers"]});var no={get paint(){return Fi=Fi||new De({"heatmap-radius":new eo(ie.paint_heatmap["heatmap-radius"]),"heatmap-weight":new eo(ie.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Vi(ie.paint_heatmap["heatmap-intensity"]),"heatmap-color":new wc(ie.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Vi(ie.paint_heatmap["heatmap-opacity"])})}};function oi(H,{width:D,height:K},he,Ee){if(Ee){if(Ee instanceof Uint8ClampedArray)Ee=new Uint8Array(Ee.buffer);else if(Ee.length!==D*K*he)throw new RangeError(`mismatched image size. expected: ${Ee.length} but got: ${D*K*he}`)}else Ee=new Uint8Array(D*K*he);return H.width=D,H.height=K,H.data=Ee,H}function Xo(H,{width:D,height:K},he){if(D===H.width&&K===H.height)return;const Ee=oi({},{width:D,height:K},he);ys(H,Ee,{x:0,y:0},{x:0,y:0},{width:Math.min(H.width,D),height:Math.min(H.height,K)},he),H.width=D,H.height=K,H.data=Ee.data}function ys(H,D,K,he,Ee,Be){if(Ee.width===0||Ee.height===0)return D;if(Ee.width>H.width||Ee.height>H.height||K.x>H.width-Ee.width||K.y>H.height-Ee.height)throw new RangeError("out of range source coordinates for image copy");if(Ee.width>D.width||Ee.height>D.height||he.x>D.width-Ee.width||he.y>D.height-Ee.height)throw new RangeError("out of range destination coordinates for image copy");const Ve=H.data,nt=D.data;if(Ve===nt)throw new Error("srcData equals dstData, so image is already copied");for(let mt=0;mt{D[H.evaluationKey]=mt;const Pt=H.expression.evaluate(D);Ee.data[Ve+nt+0]=Math.floor(255*Pt.r/Pt.a),Ee.data[Ve+nt+1]=Math.floor(255*Pt.g/Pt.a),Ee.data[Ve+nt+2]=Math.floor(255*Pt.b/Pt.a),Ee.data[Ve+nt+3]=Math.floor(255*Pt.a)};if(H.clips)for(let Ve=0,nt=0;Ve80*K){nt=1/0,mt=1/0;let Xt=-1/0,er=-1/0;for(let br=K;brXt&&(Xt=Rr),jr>er&&(er=jr)}Pt=Math.max(Xt-nt,er-mt),Pt=Pt!==0?32767/Pt:0}return ll(Be,Ve,K,nt,mt,Pt,0),Ve}function Fo(H,D,K,he,Ee){let Be;if(Ee===function(Ve,nt,mt,Pt){let Xt=0;for(let er=nt,br=mt-Pt;er0)for(let Ve=D;Ve=D;Ve-=he)Be=Kt(Ve/he|0,H[Ve],H[Ve+1],Be);return Be&&tt(Be,Be.next)&&(vr(Be),Be=Be.next),Be}function nc(H,D){if(!H)return H;D||(D=H);let K,he=H;do if(K=!1,he.steiner||!tt(he,he.next)&&Ue(he.prev,he,he.next)!==0)he=he.next;else{if(vr(he),he=D=he.prev,he===he.next)break;K=!0}while(K||he!==D);return D}function ll(H,D,K,he,Ee,Be,Ve){if(!H)return;!Ve&&Be&&function(mt,Pt,Xt,er){let br=mt;do br.z===0&&(br.z=W(br.x,br.y,Pt,Xt,er)),br.prevZ=br.prev,br.nextZ=br.next,br=br.next;while(br!==mt);br.prevZ.nextZ=null,br.prevZ=null,function(Rr){let jr,Yr=1;do{let ca,Ca=Rr;Rr=null;let un=null;for(jr=0;Ca;){jr++;let Ha=Ca,rn=0;for(let $n=0;$n0||Sn>0&&Ha;)rn!==0&&(Sn===0||!Ha||Ca.z<=Ha.z)?(ca=Ca,Ca=Ca.nextZ,rn--):(ca=Ha,Ha=Ha.nextZ,Sn--),un?un.nextZ=ca:Rr=ca,ca.prevZ=un,un=ca;Ca=Ha}un.nextZ=null,Yr*=2}while(jr>1)}(br)}(H,he,Ee,Be);let nt=H;for(;H.prev!==H.next;){const mt=H.prev,Pt=H.next;if(Be?qc(H,he,Ee,Be):Sl(H))D.push(mt.i,H.i,Pt.i),vr(H),H=Pt.next,nt=Pt.next;else if((H=Pt)===nt){Ve?Ve===1?ll(H=Hc(nc(H),D),D,K,he,Ee,Be,2):Ve===2&&ss(H,D,K,he,Ee,Be):ll(nc(H),D,K,he,Ee,Be,1);break}}}function Sl(H){const D=H.prev,K=H,he=H.next;if(Ue(D,K,he)>=0)return!1;const Ee=D.x,Be=K.x,Ve=he.x,nt=D.y,mt=K.y,Pt=he.y,Xt=EeBe?Ee>Ve?Ee:Ve:Be>Ve?Be:Ve,Rr=nt>mt?nt>Pt?nt:Pt:mt>Pt?mt:Pt;let jr=he.next;for(;jr!==D;){if(jr.x>=Xt&&jr.x<=br&&jr.y>=er&&jr.y<=Rr&&te(Ee,nt,Be,mt,Ve,Pt,jr.x,jr.y)&&Ue(jr.prev,jr,jr.next)>=0)return!1;jr=jr.next}return!0}function qc(H,D,K,he){const Ee=H.prev,Be=H,Ve=H.next;if(Ue(Ee,Be,Ve)>=0)return!1;const nt=Ee.x,mt=Be.x,Pt=Ve.x,Xt=Ee.y,er=Be.y,br=Ve.y,Rr=ntmt?nt>Pt?nt:Pt:mt>Pt?mt:Pt,ca=Xt>er?Xt>br?Xt:br:er>br?er:br,Ca=W(Rr,jr,D,K,he),un=W(Yr,ca,D,K,he);let Ha=H.prevZ,rn=H.nextZ;for(;Ha&&Ha.z>=Ca&&rn&&rn.z<=un;){if(Ha.x>=Rr&&Ha.x<=Yr&&Ha.y>=jr&&Ha.y<=ca&&Ha!==Ee&&Ha!==Ve&&te(nt,Xt,mt,er,Pt,br,Ha.x,Ha.y)&&Ue(Ha.prev,Ha,Ha.next)>=0||(Ha=Ha.prevZ,rn.x>=Rr&&rn.x<=Yr&&rn.y>=jr&&rn.y<=ca&&rn!==Ee&&rn!==Ve&&te(nt,Xt,mt,er,Pt,br,rn.x,rn.y)&&Ue(rn.prev,rn,rn.next)>=0))return!1;rn=rn.nextZ}for(;Ha&&Ha.z>=Ca;){if(Ha.x>=Rr&&Ha.x<=Yr&&Ha.y>=jr&&Ha.y<=ca&&Ha!==Ee&&Ha!==Ve&&te(nt,Xt,mt,er,Pt,br,Ha.x,Ha.y)&&Ue(Ha.prev,Ha,Ha.next)>=0)return!1;Ha=Ha.prevZ}for(;rn&&rn.z<=un;){if(rn.x>=Rr&&rn.x<=Yr&&rn.y>=jr&&rn.y<=ca&&rn!==Ee&&rn!==Ve&&te(nt,Xt,mt,er,Pt,br,rn.x,rn.y)&&Ue(rn.prev,rn,rn.next)>=0)return!1;rn=rn.nextZ}return!0}function Hc(H,D){let K=H;do{const he=K.prev,Ee=K.next.next;!tt(he,Ee)&&ft(he,K,K.next,Ee)&&It(he,Ee)&&It(Ee,he)&&(D.push(he.i,K.i,Ee.i),vr(K),vr(K.next),K=H=Ee),K=K.next}while(K!==H);return nc(K)}function ss(H,D,K,he,Ee,Be){let Ve=H;do{let nt=Ve.next.next;for(;nt!==Ve.prev;){if(Ve.i!==nt.i&&me(Ve,nt)){let mt=Jt(Ve,nt);return Ve=nc(Ve,Ve.next),mt=nc(mt,mt.next),ll(Ve,D,K,he,Ee,Be,0),void ll(mt,D,K,he,Ee,Be,0)}nt=nt.next}Ve=Ve.next}while(Ve!==H)}function js(H,D){return H.x-D.x}function ls(H,D){const K=function(Ee,Be){let Ve=Be;const nt=Ee.x,mt=Ee.y;let Pt,Xt=-1/0;do{if(mt<=Ve.y&&mt>=Ve.next.y&&Ve.next.y!==Ve.y){const Yr=Ve.x+(mt-Ve.y)*(Ve.next.x-Ve.x)/(Ve.next.y-Ve.y);if(Yr<=nt&&Yr>Xt&&(Xt=Yr,Pt=Ve.x=Ve.x&&Ve.x>=br&&nt!==Ve.x&&te(mtPt.x||Ve.x===Pt.x&&ye(Pt,Ve)))&&(Pt=Ve,jr=Yr)}Ve=Ve.next}while(Ve!==er);return Pt}(H,D);if(!K)return D;const he=Jt(K,H);return nc(he,he.next),nc(K,K.next)}function ye(H,D){return Ue(H.prev,H,D.prev)<0&&Ue(D.next,H,H.next)<0}function W(H,D,K,he,Ee){return(H=1431655765&((H=858993459&((H=252645135&((H=16711935&((H=(H-K)*Ee|0)|H<<8))|H<<4))|H<<2))|H<<1))|(D=1431655765&((D=858993459&((D=252645135&((D=16711935&((D=(D-he)*Ee|0)|D<<8))|D<<4))|D<<2))|D<<1))<<1}function de(H){let D=H,K=H;do(D.x=(H-Ve)*(Be-nt)&&(H-Ve)*(he-nt)>=(K-Ve)*(D-nt)&&(K-Ve)*(Be-nt)>=(Ee-Ve)*(he-nt)}function me(H,D){return H.next.i!==D.i&&H.prev.i!==D.i&&!function(K,he){let Ee=K;do{if(Ee.i!==K.i&&Ee.next.i!==K.i&&Ee.i!==he.i&&Ee.next.i!==he.i&&ft(Ee,Ee.next,K,he))return!0;Ee=Ee.next}while(Ee!==K);return!1}(H,D)&&(It(H,D)&&It(D,H)&&function(K,he){let Ee=K,Be=!1;const Ve=(K.x+he.x)/2,nt=(K.y+he.y)/2;do Ee.y>nt!=Ee.next.y>nt&&Ee.next.y!==Ee.y&&Ve<(Ee.next.x-Ee.x)*(nt-Ee.y)/(Ee.next.y-Ee.y)+Ee.x&&(Be=!Be),Ee=Ee.next;while(Ee!==K);return Be}(H,D)&&(Ue(H.prev,H,D.prev)||Ue(H,D.prev,D))||tt(H,D)&&Ue(H.prev,H,H.next)>0&&Ue(D.prev,D,D.next)>0)}function Ue(H,D,K){return(D.y-H.y)*(K.x-D.x)-(D.x-H.x)*(K.y-D.y)}function tt(H,D){return H.x===D.x&&H.y===D.y}function ft(H,D,K,he){const Ee=bt(Ue(H,D,K)),Be=bt(Ue(H,D,he)),Ve=bt(Ue(K,he,H)),nt=bt(Ue(K,he,D));return Ee!==Be&&Ve!==nt||!(Ee!==0||!st(H,K,D))||!(Be!==0||!st(H,he,D))||!(Ve!==0||!st(K,H,he))||!(nt!==0||!st(K,D,he))}function st(H,D,K){return D.x<=Math.max(H.x,K.x)&&D.x>=Math.min(H.x,K.x)&&D.y<=Math.max(H.y,K.y)&&D.y>=Math.min(H.y,K.y)}function bt(H){return H>0?1:H<0?-1:0}function It(H,D){return Ue(H.prev,H,H.next)<0?Ue(H,D,H.next)>=0&&Ue(H,H.prev,D)>=0:Ue(H,D,H.prev)<0||Ue(H,H.next,D)<0}function Jt(H,D){const K=Tr(H.i,H.x,H.y),he=Tr(D.i,D.x,D.y),Ee=H.next,Be=D.prev;return H.next=D,D.prev=H,K.next=Ee,Ee.prev=K,he.next=K,K.prev=he,Be.next=he,he.prev=Be,he}function Kt(H,D,K,he){const Ee=Tr(H,D,K);return he?(Ee.next=he.next,Ee.prev=he,he.next.prev=Ee,he.next=Ee):(Ee.prev=Ee,Ee.next=Ee),Ee}function vr(H){H.next.prev=H.prev,H.prev.next=H.next,H.prevZ&&(H.prevZ.nextZ=H.nextZ),H.nextZ&&(H.nextZ.prevZ=H.prevZ)}function Tr(H,D,K){return{i:H,x:D,y:K,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function wr(H,D,K){const he=K.patternDependencies;let Ee=!1;for(const Be of D){const Ve=Be.paint.get(`${H}-pattern`);Ve.isConstant()||(Ee=!0);const nt=Ve.constantOr(null);nt&&(Ee=!0,he[nt.to]=!0,he[nt.from]=!0)}return Ee}function tr(H,D,K,he,Ee){const Be=Ee.patternDependencies;for(const Ve of D){const nt=Ve.paint.get(`${H}-pattern`).value;if(nt.kind!=="constant"){let mt=nt.evaluate({zoom:he-1},K,{},Ee.availableImages),Pt=nt.evaluate({zoom:he},K,{},Ee.availableImages),Xt=nt.evaluate({zoom:he+1},K,{},Ee.availableImages);mt=mt&&mt.name?mt.name:mt,Pt=Pt&&Pt.name?Pt.name:Pt,Xt=Xt&&Xt.name?Xt.name:Xt,Be[mt]=!0,Be[Pt]=!0,Be[Xt]=!0,K.patterns[Ve.id]={min:mt,mid:Pt,max:Xt}}}return K}class pr{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(K=>K.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new vl,this.indexArray=new Dt,this.indexArray2=new $t,this.programConfigurations=new hs(D.layers,D.zoom),this.segments=new Vr,this.segments2=new Vr,this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,he){this.hasPattern=wr("fill",this.layers,K);const Ee=this.layers[0].layout.get("fill-sort-key"),Be=!Ee.isConstant(),Ve=[];for(const{feature:nt,id:mt,index:Pt,sourceLayerIndex:Xt}of D){const er=this.layers[0]._featureFilter.needGeometry,br=fa(nt,er);if(!this.layers[0]._featureFilter.filter(new Jo(this.zoom),br,he))continue;const Rr=Be?Ee.evaluate(br,{},he,K.availableImages):void 0,jr={id:mt,properties:nt.properties,type:nt.type,sourceLayerIndex:Xt,index:Pt,geometry:er?br.geometry:cr(nt),patterns:{},sortKey:Rr};Ve.push(jr)}Be&&Ve.sort((nt,mt)=>nt.sortKey-mt.sortKey);for(const nt of Ve){const{geometry:mt,index:Pt,sourceLayerIndex:Xt}=nt;if(this.hasPattern){const er=tr("fill",this.layers,nt,this.zoom,K);this.patternFeatures.push(er)}else this.addFeature(nt,mt,Pt,he,{});K.featureIndex.insert(D[Pt].feature,mt,Pt,Xt,this.index)}}update(D,K,he){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,he)}addFeatures(D,K,he){for(const Ee of this.patternFeatures)this.addFeature(Ee,Ee.geometry,Ee.index,K,he)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,su),this.indexBuffer=D.createIndexBuffer(this.indexArray),this.indexBuffer2=D.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(D,K,he,Ee,Be){for(const Ve of Lu(K,500)){let nt=0;for(const Rr of Ve)nt+=Rr.length;const mt=this.segments.prepareSegment(nt,this.layoutVertexArray,this.indexArray),Pt=mt.vertexLength,Xt=[],er=[];for(const Rr of Ve){if(Rr.length===0)continue;Rr!==Ve[0]&&er.push(Xt.length/2);const jr=this.segments2.prepareSegment(Rr.length,this.layoutVertexArray,this.indexArray2),Yr=jr.vertexLength;this.layoutVertexArray.emplaceBack(Rr[0].x,Rr[0].y),this.indexArray2.emplaceBack(Yr+Rr.length-1,Yr),Xt.push(Rr[0].x),Xt.push(Rr[0].y);for(let ca=1;ca>3}if(Ee--,he===1||he===2)Be+=H.readSVarint(),Ve+=H.readSVarint(),he===1&&(D&&nt.push(D),D=[]),D.push(new hn(Be,Ve));else{if(he!==7)throw new Error("unknown command "+he);D&&D.push(D[0].clone())}}return D&&nt.push(D),nt},fn.prototype.bbox=function(){var H=this._pbf;H.pos=this._geometry;for(var D=H.readVarint()+H.pos,K=1,he=0,Ee=0,Be=0,Ve=1/0,nt=-1/0,mt=1/0,Pt=-1/0;H.pos>3}if(he--,K===1||K===2)(Ee+=H.readSVarint())nt&&(nt=Ee),(Be+=H.readSVarint())Pt&&(Pt=Be);else if(K!==7)throw new Error("unknown command "+K)}return[Ve,mt,nt,Pt]},fn.prototype.toGeoJSON=function(H,D,K){var he,Ee,Be=this.extent*Math.pow(2,K),Ve=this.extent*H,nt=this.extent*D,mt=this.loadGeometry(),Pt=fn.types[this.type];function Xt(Rr){for(var jr=0;jr>3;Ee=Ve===1?he.readString():Ve===2?he.readFloat():Ve===3?he.readDouble():Ve===4?he.readVarint64():Ve===5?he.readVarint():Ve===6?he.readSVarint():Ve===7?he.readBoolean():null}return Ee}(K))}Io.prototype.feature=function(H){if(H<0||H>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[H];var D=this._pbf.readVarint()+this._pbf.pos;return new vi(this._pbf,D,this.extent,this._keys,this._values)};var vs=ai;function us(H,D,K){if(H===3){var he=new vs(K,K.readVarint()+K.pos);he.length&&(D[he.name]=he)}}an.VectorTile=function(H,D){this.layers=H.readFields(us,{},D)},an.VectorTileFeature=xn,an.VectorTileLayer=ai;const Ds=an.VectorTileFeature.types,rs=Math.pow(2,13);function ul(H,D,K,he,Ee,Be,Ve,nt){H.emplaceBack(D,K,2*Math.floor(he*rs)+Ve,Ee*rs*2,Be*rs*2,Math.round(nt))}class Uo{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(K=>K.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new Al,this.centroidVertexArray=new xo,this.indexArray=new Dt,this.programConfigurations=new hs(D.layers,D.zoom),this.segments=new Vr,this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,he){this.features=[],this.hasPattern=wr("fill-extrusion",this.layers,K);for(const{feature:Ee,id:Be,index:Ve,sourceLayerIndex:nt}of D){const mt=this.layers[0]._featureFilter.needGeometry,Pt=fa(Ee,mt);if(!this.layers[0]._featureFilter.filter(new Jo(this.zoom),Pt,he))continue;const Xt={id:Be,sourceLayerIndex:nt,index:Ve,geometry:mt?Pt.geometry:cr(Ee),properties:Ee.properties,type:Ee.type,patterns:{}};this.hasPattern?this.features.push(tr("fill-extrusion",this.layers,Xt,this.zoom,K)):this.addFeature(Xt,Xt.geometry,Ve,he,{}),K.featureIndex.insert(Ee,Xt.geometry,Ve,nt,this.index,!0)}}addFeatures(D,K,he){for(const Ee of this.features){const{geometry:Be}=Ee;this.addFeature(Ee,Be,Ee.index,K,he)}}update(D,K,he){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,he)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Ya),this.centroidVertexBuffer=D.createVertexBuffer(this.centroidVertexArray,Xa.members,!0),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(D,K,he,Ee,Be){for(const Ve of Lu(K,500)){const nt={x:0,y:0,vertexCount:0};let mt=0;for(const jr of Ve)mt+=jr.length;let Pt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const jr of Ve){if(jr.length===0||Fu(jr))continue;let Yr=0;for(let ca=0;ca=1){const un=jr[ca-1];if(!Vs(Ca,un)){Pt.vertexLength+4>Vr.MAX_VERTEX_ARRAY_LENGTH&&(Pt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ha=Ca.sub(un)._perp()._unit(),rn=un.dist(Ca);Yr+rn>32768&&(Yr=0),ul(this.layoutVertexArray,Ca.x,Ca.y,Ha.x,Ha.y,0,0,Yr),ul(this.layoutVertexArray,Ca.x,Ca.y,Ha.x,Ha.y,0,1,Yr),nt.x+=2*Ca.x,nt.y+=2*Ca.y,nt.vertexCount+=2,Yr+=rn,ul(this.layoutVertexArray,un.x,un.y,Ha.x,Ha.y,0,0,Yr),ul(this.layoutVertexArray,un.x,un.y,Ha.x,Ha.y,0,1,Yr),nt.x+=2*un.x,nt.y+=2*un.y,nt.vertexCount+=2;const Sn=Pt.vertexLength;this.indexArray.emplaceBack(Sn,Sn+2,Sn+1),this.indexArray.emplaceBack(Sn+1,Sn+2,Sn+3),Pt.vertexLength+=4,Pt.primitiveLength+=2}}}}if(Pt.vertexLength+mt>Vr.MAX_VERTEX_ARRAY_LENGTH&&(Pt=this.segments.prepareSegment(mt,this.layoutVertexArray,this.indexArray)),Ds[D.type]!=="Polygon")continue;const Xt=[],er=[],br=Pt.vertexLength;for(const jr of Ve)if(jr.length!==0){jr!==Ve[0]&&er.push(Xt.length/2);for(let Yr=0;Yr_s)||H.y===D.y&&(H.y<0||H.y>_s)}function Fu(H){return H.every(D=>D.x<0)||H.every(D=>D.x>_s)||H.every(D=>D.y<0)||H.every(D=>D.y>_s)}let fc;Wa("FillExtrusionBucket",Uo,{omit:["layers","features"]});var dh={get paint(){return fc=fc||new De({"fill-extrusion-opacity":new Vi(ie["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new eo(ie["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Vi(ie["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Vi(ie["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new qu(ie["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new eo(ie["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new eo(ie["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Vi(ie["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class ph extends ne{constructor(D){super(D,dh)}createBucket(D){return new Uo(D)}queryRadius(){return wn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(D,K,he,Ee,Be,Ve,nt,mt){const Pt=Tn(D,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Ve.angle,nt),Xt=this.paint.get("fill-extrusion-height").evaluate(K,he),er=this.paint.get("fill-extrusion-base").evaluate(K,he),br=function(jr,Yr,ca,Ca){const un=[];for(const Ha of jr){const rn=[Ha.x,Ha.y,0,1];gi(rn,rn,Yr),un.push(new i(rn[0]/rn[3],rn[1]/rn[3]))}return un}(Pt,mt),Rr=function(jr,Yr,ca,Ca){const un=[],Ha=[],rn=Ca[8]*Yr,Sn=Ca[9]*Yr,$n=Ca[10]*Yr,Oi=Ca[11]*Yr,qo=Ca[8]*ca,qi=Ca[9]*ca,Di=Ca[10]*ca,mo=Ca[11]*ca;for(const so of jr){const to=[],zn=[];for(const To of so){const _o=To.x,ts=To.y,Gl=Ca[0]*_o+Ca[4]*ts+Ca[12],Nl=Ca[1]*_o+Ca[5]*ts+Ca[13],Gc=Ca[2]*_o+Ca[6]*ts+Ca[14],ih=Ca[3]*_o+Ca[7]*ts+Ca[15],hc=Gc+$n,Rc=ih+Oi,Yf=Gl+qo,Kf=Nl+qi,Jf=Gc+Di,Ou=ih+mo,Wc=new i((Gl+rn)/Rc,(Nl+Sn)/Rc);Wc.z=hc/Rc,to.push(Wc);const Ff=new i(Yf/Ou,Kf/Ou);Ff.z=Jf/Ou,zn.push(Ff)}un.push(to),Ha.push(zn)}return[un,Ha]}(Ee,er,Xt,mt);return function(jr,Yr,ca){let Ca=1/0;Na(ca,Yr)&&(Ca=Mh(ca,Yr[0]));for(let un=0;unK.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(K=>{this.gradients[K.id]={}}),this.layoutVertexArray=new pu,this.layoutVertexArray2=new pe,this.indexArray=new Dt,this.programConfigurations=new hs(D.layers,D.zoom),this.segments=new Vr,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,he){this.hasPattern=wr("line",this.layers,K);const Ee=this.layers[0].layout.get("line-sort-key"),Be=!Ee.isConstant(),Ve=[];for(const{feature:nt,id:mt,index:Pt,sourceLayerIndex:Xt}of D){const er=this.layers[0]._featureFilter.needGeometry,br=fa(nt,er);if(!this.layers[0]._featureFilter.filter(new Jo(this.zoom),br,he))continue;const Rr=Be?Ee.evaluate(br,{},he):void 0,jr={id:mt,properties:nt.properties,type:nt.type,sourceLayerIndex:Xt,index:Pt,geometry:er?br.geometry:cr(nt),patterns:{},sortKey:Rr};Ve.push(jr)}Be&&Ve.sort((nt,mt)=>nt.sortKey-mt.sortKey);for(const nt of Ve){const{geometry:mt,index:Pt,sourceLayerIndex:Xt}=nt;if(this.hasPattern){const er=tr("line",this.layers,nt,this.zoom,K);this.patternFeatures.push(er)}else this.addFeature(nt,mt,Pt,he,{});K.featureIndex.insert(D[Pt].feature,mt,Pt,Xt,this.index)}}update(D,K,he){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,he)}addFeatures(D,K,he){for(const Ee of this.patternFeatures)this.addFeature(Ee,Ee.geometry,Ee.index,K,he)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=D.createVertexBuffer(this.layoutVertexArray2,Dh)),this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Rh),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(D){if(D.properties&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_end"))return{start:+D.properties.mapbox_clip_start,end:+D.properties.mapbox_clip_end}}addFeature(D,K,he,Ee,Be){const Ve=this.layers[0].layout,nt=Ve.get("line-join").evaluate(D,{}),mt=Ve.get("line-cap"),Pt=Ve.get("line-miter-limit"),Xt=Ve.get("line-round-limit");this.lineClips=this.lineFeatureClips(D);for(const er of K)this.addLine(er,D,nt,mt,Pt,Xt);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,he,Be,Ee)}addLine(D,K,he,Ee,Be,Ve){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Ca=0;Ca=2&&D[mt-1].equals(D[mt-2]);)mt--;let Pt=0;for(;Pt0;if(Oi&&Ca>Pt){const mo=br.dist(Rr);if(mo>2*Xt){const so=br.sub(br.sub(Rr)._mult(Xt/mo)._round());this.updateDistance(Rr,so),this.addCurrentVertex(so,Yr,0,0,er),Rr=so}}const qi=Rr&&jr;let Di=qi?he:nt?"butt":Ee;if(qi&&Di==="round"&&(SnBe&&(Di="bevel"),Di==="bevel"&&(Sn>2&&(Di="flipbevel"),Sn100)un=ca.mult(-1);else{const mo=Sn*Yr.add(ca).mag()/Yr.sub(ca).mag();un._perp()._mult(mo*(qo?-1:1))}this.addCurrentVertex(br,un,0,0,er),this.addCurrentVertex(br,un.mult(-1),0,0,er)}else if(Di==="bevel"||Di==="fakeround"){const mo=-Math.sqrt(Sn*Sn-1),so=qo?mo:0,to=qo?0:mo;if(Rr&&this.addCurrentVertex(br,Yr,so,to,er),Di==="fakeround"){const zn=Math.round(180*$n/Math.PI/20);for(let To=1;To2*Xt){const so=br.add(jr.sub(br)._mult(Xt/mo)._round());this.updateDistance(br,so),this.addCurrentVertex(so,ca,0,0,er),br=so}}}}addCurrentVertex(D,K,he,Ee,Be,Ve=!1){const nt=K.y*Ee-K.x,mt=-K.y-K.x*Ee;this.addHalfVertex(D,K.x+K.y*he,K.y-K.x*he,Ve,!1,he,Be),this.addHalfVertex(D,nt,mt,Ve,!0,-Ee,Be),this.distance>gh/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(D,K,he,Ee,Be,Ve))}addHalfVertex({x:D,y:K},he,Ee,Be,Ve,nt,mt){const Pt=.5*(this.lineClips?this.scaledDistance*(gh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((D<<1)+(Be?1:0),(K<<1)+(Ve?1:0),Math.round(63*he)+128,Math.round(63*Ee)+128,1+(nt===0?0:nt<0?-1:1)|(63&Pt)<<2,Pt>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const Xt=mt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Xt),mt.primitiveLength++),Ve?this.e2=Xt:this.e1=Xt}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(D,K){this.distance+=D.dist(K),this.updateScaledDistance()}}let yh,Zv;Wa("LineBucket",Eh,{omit:["layers","patternFeatures"]});var vv={get paint(){return Zv=Zv||new De({"line-opacity":new eo(ie.paint_line["line-opacity"]),"line-color":new eo(ie.paint_line["line-color"]),"line-translate":new Vi(ie.paint_line["line-translate"]),"line-translate-anchor":new Vi(ie.paint_line["line-translate-anchor"]),"line-width":new eo(ie.paint_line["line-width"]),"line-gap-width":new eo(ie.paint_line["line-gap-width"]),"line-offset":new eo(ie.paint_line["line-offset"]),"line-blur":new eo(ie.paint_line["line-blur"]),"line-dasharray":new Du(ie.paint_line["line-dasharray"]),"line-pattern":new qu(ie.paint_line["line-pattern"]),"line-gradient":new wc(ie.paint_line["line-gradient"])})},get layout(){return yh=yh||new De({"line-cap":new Vi(ie.layout_line["line-cap"]),"line-join":new eo(ie.layout_line["line-join"]),"line-miter-limit":new Vi(ie.layout_line["line-miter-limit"]),"line-round-limit":new Vi(ie.layout_line["line-round-limit"]),"line-sort-key":new eo(ie.layout_line["line-sort-key"])})}};class Pc extends eo{possiblyEvaluate(D,K){return K=new Jo(Math.floor(K.zoom),{now:K.now,fadeDuration:K.fadeDuration,zoomHistory:K.zoomHistory,transition:K.transition}),super.possiblyEvaluate(D,K)}evaluate(D,K,he,Ee){return K=M({},K,{zoom:Math.floor(K.zoom)}),super.evaluate(D,K,he,Ee)}}let dv;class Xv extends ne{constructor(D){super(D,vv),this.gradientVersion=0,dv||(dv=new Pc(vv.paint.properties["line-width"].specification),dv.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(D){if(D==="line-gradient"){const K=this.gradientExpression();this.stepInterpolant=!!function(he){return he._styleExpression!==void 0}(K)&&K._styleExpression.expression instanceof pa,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(D,K){super.recalculate(D,K),this.paint._values["line-floorwidth"]=dv.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,D)}createBucket(D){return new Eh(D)}queryRadius(D){const K=D,he=of(qa("line-width",this,K),qa("line-gap-width",this,K)),Ee=qa("line-offset",this,K);return he/2+Math.abs(Ee)+wn(this.paint.get("line-translate"))}queryIntersectsFeature(D,K,he,Ee,Be,Ve,nt){const mt=Tn(D,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Ve.angle,nt),Pt=nt/2*of(this.paint.get("line-width").evaluate(K,he),this.paint.get("line-gap-width").evaluate(K,he)),Xt=this.paint.get("line-offset").evaluate(K,he);return Xt&&(Ee=function(er,br){const Rr=[];for(let jr=0;jr=3){for(let ca=0;ca0?D+2*H:H}const kv=ot([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),pd=ot([{name:"a_projected_pos",components:3,type:"Float32"}],4);ot([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const gd=ot([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);ot([{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"}]);const Yv=ot([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Cv=ot([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Lv(H,D,K){return H.sections.forEach(he=>{he.text=function(Ee,Be,Ve){const nt=Be.layout.get("text-transform").evaluate(Ve,{});return nt==="uppercase"?Ee=Ee.toLocaleUpperCase():nt==="lowercase"&&(Ee=Ee.toLocaleLowerCase()),gs.applyArabicShaping&&(Ee=gs.applyArabicShaping(Ee)),Ee}(he.text,D,K)}),H}ot([{name:"triangle",components:3,type:"Uint16"}]),ot([{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"}]),ot([{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",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),ot([{type:"Float32",name:"offsetX"}]),ot([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ot([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const lu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var pl=24,zf=Ml,Kv=function(H,D,K,he,Ee){var Be,Ve,nt=8*Ee-he-1,mt=(1<>1,Xt=-7,er=Ee-1,br=-1,Rr=H[D+er];for(er+=br,Be=Rr&(1<<-Xt)-1,Rr>>=-Xt,Xt+=nt;Xt>0;Be=256*Be+H[D+er],er+=br,Xt-=8);for(Ve=Be&(1<<-Xt)-1,Be>>=-Xt,Xt+=he;Xt>0;Ve=256*Ve+H[D+er],er+=br,Xt-=8);if(Be===0)Be=1-Pt;else{if(Be===mt)return Ve?NaN:1/0*(Rr?-1:1);Ve+=Math.pow(2,he),Be-=Pt}return(Rr?-1:1)*Ve*Math.pow(2,Be-he)},yd=function(H,D,K,he,Ee,Be){var Ve,nt,mt,Pt=8*Be-Ee-1,Xt=(1<>1,br=Ee===23?Math.pow(2,-24)-Math.pow(2,-77):0,Rr=0,jr=1,Yr=D<0||D===0&&1/D<0?1:0;for(D=Math.abs(D),isNaN(D)||D===1/0?(nt=isNaN(D)?1:0,Ve=Xt):(Ve=Math.floor(Math.log(D)/Math.LN2),D*(mt=Math.pow(2,-Ve))<1&&(Ve--,mt*=2),(D+=Ve+er>=1?br/mt:br*Math.pow(2,1-er))*mt>=2&&(Ve++,mt/=2),Ve+er>=Xt?(nt=0,Ve=Xt):Ve+er>=1?(nt=(D*mt-1)*Math.pow(2,Ee),Ve+=er):(nt=D*Math.pow(2,er-1)*Math.pow(2,Ee),Ve=0));Ee>=8;H[K+Rr]=255&nt,Rr+=jr,nt/=256,Ee-=8);for(Ve=Ve<0;H[K+Rr]=255&Ve,Rr+=jr,Ve/=256,Pt-=8);H[K+Rr-jr]|=128*Yr};function Ml(H){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(H)?H:new Uint8Array(H||0),this.pos=0,this.type=0,this.length=this.buf.length}Ml.Varint=0,Ml.Fixed64=1,Ml.Bytes=2,Ml.Fixed32=5;var cp=4294967296,Pv=1/cp,$p=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function mh(H){return H.type===Ml.Bytes?H.readVarint()+H.pos:H.pos+1}function Iv(H,D,K){return K?4294967296*D+(H>>>0):4294967296*(D>>>0)+(H>>>0)}function Qp(H,D,K){var he=D<=16383?1:D<=2097151?2:D<=268435455?3:Math.floor(Math.log(D)/(7*Math.LN2));K.realloc(he);for(var Ee=K.pos-1;Ee>=H;Ee--)K.buf[Ee+he]=K.buf[Ee]}function fp(H,D){for(var K=0;K>>8,H[K+2]=D>>>16,H[K+3]=D>>>24}function Qy(H,D){return(H[D]|H[D+1]<<8|H[D+2]<<16)+(H[D+3]<<24)}Ml.prototype={destroy:function(){this.buf=null},readFields:function(H,D,K){for(K=K||this.length;this.pos>3,Be=this.pos;this.type=7&he,H(Ee,D,this),this.pos===Be&&this.skip(he)}return D},readMessage:function(H,D){return this.readFields(H,D,this.readVarint()+this.pos)},readFixed32:function(){var H=t0(this.buf,this.pos);return this.pos+=4,H},readSFixed32:function(){var H=Qy(this.buf,this.pos);return this.pos+=4,H},readFixed64:function(){var H=t0(this.buf,this.pos)+t0(this.buf,this.pos+4)*cp;return this.pos+=8,H},readSFixed64:function(){var H=t0(this.buf,this.pos)+Qy(this.buf,this.pos+4)*cp;return this.pos+=8,H},readFloat:function(){var H=Kv(this.buf,this.pos,!0,23,4);return this.pos+=4,H},readDouble:function(){var H=Kv(this.buf,this.pos,!0,52,8);return this.pos+=8,H},readVarint:function(H){var D,K,he=this.buf;return D=127&(K=he[this.pos++]),K<128?D:(D|=(127&(K=he[this.pos++]))<<7,K<128?D:(D|=(127&(K=he[this.pos++]))<<14,K<128?D:(D|=(127&(K=he[this.pos++]))<<21,K<128?D:function(Ee,Be,Ve){var nt,mt,Pt=Ve.buf;if(nt=(112&(mt=Pt[Ve.pos++]))>>4,mt<128||(nt|=(127&(mt=Pt[Ve.pos++]))<<3,mt<128)||(nt|=(127&(mt=Pt[Ve.pos++]))<<10,mt<128)||(nt|=(127&(mt=Pt[Ve.pos++]))<<17,mt<128)||(nt|=(127&(mt=Pt[Ve.pos++]))<<24,mt<128)||(nt|=(1&(mt=Pt[Ve.pos++]))<<31,mt<128))return Iv(Ee,nt,Be);throw new Error("Expected varint not more than 10 bytes")}(D|=(15&(K=he[this.pos]))<<28,H,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var H=this.readVarint();return H%2==1?(H+1)/-2:H/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var H=this.readVarint()+this.pos,D=this.pos;return this.pos=H,H-D>=12&&$p?function(K,he,Ee){return $p.decode(K.subarray(he,Ee))}(this.buf,D,H):function(K,he,Ee){for(var Be="",Ve=he;Ve239?4:Xt>223?3:Xt>191?2:1;if(Ve+br>Ee)break;br===1?Xt<128&&(er=Xt):br===2?(192&(nt=K[Ve+1]))==128&&(er=(31&Xt)<<6|63&nt)<=127&&(er=null):br===3?(mt=K[Ve+2],(192&(nt=K[Ve+1]))==128&&(192&mt)==128&&((er=(15&Xt)<<12|(63&nt)<<6|63&mt)<=2047||er>=55296&&er<=57343)&&(er=null)):br===4&&(mt=K[Ve+2],Pt=K[Ve+3],(192&(nt=K[Ve+1]))==128&&(192&mt)==128&&(192&Pt)==128&&((er=(15&Xt)<<18|(63&nt)<<12|(63&mt)<<6|63&Pt)<=65535||er>=1114112)&&(er=null)),er===null?(er=65533,br=1):er>65535&&(er-=65536,Be+=String.fromCharCode(er>>>10&1023|55296),er=56320|1023&er),Be+=String.fromCharCode(er),Ve+=br}return Be}(this.buf,D,H)},readBytes:function(){var H=this.readVarint()+this.pos,D=this.buf.subarray(this.pos,H);return this.pos=H,D},readPackedVarint:function(H,D){if(this.type!==Ml.Bytes)return H.push(this.readVarint(D));var K=mh(this);for(H=H||[];this.pos127;);else if(D===Ml.Bytes)this.pos=this.readVarint()+this.pos;else if(D===Ml.Fixed32)this.pos+=4;else{if(D!==Ml.Fixed64)throw new Error("Unimplemented type: "+D);this.pos+=8}},writeTag:function(H,D){this.writeVarint(H<<3|D)},realloc:function(H){for(var D=this.length||16;D268435455||H<0?function(D,K){var he,Ee;if(D>=0?(he=D%4294967296|0,Ee=D/4294967296|0):(Ee=~(-D/4294967296),4294967295^(he=~(-D%4294967296))?he=he+1|0:(he=0,Ee=Ee+1|0)),D>=18446744073709552e3||D<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");K.realloc(10),function(Be,Ve,nt){nt.buf[nt.pos++]=127&Be|128,Be>>>=7,nt.buf[nt.pos++]=127&Be|128,Be>>>=7,nt.buf[nt.pos++]=127&Be|128,Be>>>=7,nt.buf[nt.pos++]=127&Be|128,nt.buf[nt.pos]=127&(Be>>>=7)}(he,0,K),function(Be,Ve){var nt=(7&Be)<<4;Ve.buf[Ve.pos++]|=nt|((Be>>>=3)?128:0),Be&&(Ve.buf[Ve.pos++]=127&Be|((Be>>>=7)?128:0),Be&&(Ve.buf[Ve.pos++]=127&Be|((Be>>>=7)?128:0),Be&&(Ve.buf[Ve.pos++]=127&Be|((Be>>>=7)?128:0),Be&&(Ve.buf[Ve.pos++]=127&Be|((Be>>>=7)?128:0),Be&&(Ve.buf[Ve.pos++]=127&Be)))))}(Ee,K)}(H,this):(this.realloc(4),this.buf[this.pos++]=127&H|(H>127?128:0),H<=127||(this.buf[this.pos++]=127&(H>>>=7)|(H>127?128:0),H<=127||(this.buf[this.pos++]=127&(H>>>=7)|(H>127?128:0),H<=127||(this.buf[this.pos++]=H>>>7&127))))},writeSVarint:function(H){this.writeVarint(H<0?2*-H-1:2*H)},writeBoolean:function(H){this.writeVarint(!!H)},writeString:function(H){H=String(H),this.realloc(4*H.length),this.pos++;var D=this.pos;this.pos=function(he,Ee,Be){for(var Ve,nt,mt=0;mt55295&&Ve<57344){if(!nt){Ve>56319||mt+1===Ee.length?(he[Be++]=239,he[Be++]=191,he[Be++]=189):nt=Ve;continue}if(Ve<56320){he[Be++]=239,he[Be++]=191,he[Be++]=189,nt=Ve;continue}Ve=nt-55296<<10|Ve-56320|65536,nt=null}else nt&&(he[Be++]=239,he[Be++]=191,he[Be++]=189,nt=null);Ve<128?he[Be++]=Ve:(Ve<2048?he[Be++]=Ve>>6|192:(Ve<65536?he[Be++]=Ve>>12|224:(he[Be++]=Ve>>18|240,he[Be++]=Ve>>12&63|128),he[Be++]=Ve>>6&63|128),he[Be++]=63&Ve|128)}return Be}(this.buf,H,this.pos);var K=this.pos-D;K>=128&&Qp(D,K,this),this.pos=D-1,this.writeVarint(K),this.pos+=K},writeFloat:function(H){this.realloc(4),yd(this.buf,H,this.pos,!0,23,4),this.pos+=4},writeDouble:function(H){this.realloc(8),yd(this.buf,H,this.pos,!0,52,8),this.pos+=8},writeBytes:function(H){var D=H.length;this.writeVarint(D),this.realloc(D);for(var K=0;K=128&&Qp(K,he,this),this.pos=K-1,this.writeVarint(he),this.pos+=he},writeMessage:function(H,D,K){this.writeTag(H,Ml.Bytes),this.writeRawMessage(D,K)},writePackedVarint:function(H,D){D.length&&this.writeMessage(H,fp,D)},writePackedSVarint:function(H,D){D.length&&this.writeMessage(H,Tx,D)},writePackedBoolean:function(H,D){D.length&&this.writeMessage(H,Mx,D)},writePackedFloat:function(H,D){D.length&&this.writeMessage(H,Ax,D)},writePackedDouble:function(H,D){D.length&&this.writeMessage(H,Sx,D)},writePackedFixed32:function(H,D){D.length&&this.writeMessage(H,Ex,D)},writePackedSFixed32:function(H,D){D.length&&this.writeMessage(H,kx,D)},writePackedFixed64:function(H,D){D.length&&this.writeMessage(H,Cx,D)},writePackedSFixed64:function(H,D){D.length&&this.writeMessage(H,e0,D)},writeBytesField:function(H,D){this.writeTag(H,Ml.Bytes),this.writeBytes(D)},writeFixed32Field:function(H,D){this.writeTag(H,Ml.Fixed32),this.writeFixed32(D)},writeSFixed32Field:function(H,D){this.writeTag(H,Ml.Fixed32),this.writeSFixed32(D)},writeFixed64Field:function(H,D){this.writeTag(H,Ml.Fixed64),this.writeFixed64(D)},writeSFixed64Field:function(H,D){this.writeTag(H,Ml.Fixed64),this.writeSFixed64(D)},writeVarintField:function(H,D){this.writeTag(H,Ml.Varint),this.writeVarint(D)},writeSVarintField:function(H,D){this.writeTag(H,Ml.Varint),this.writeSVarint(D)},writeStringField:function(H,D){this.writeTag(H,Ml.Bytes),this.writeString(D)},writeFloatField:function(H,D){this.writeTag(H,Ml.Fixed32),this.writeFloat(D)},writeDoubleField:function(H,D){this.writeTag(H,Ml.Fixed64),this.writeDouble(D)},writeBooleanField:function(H,D){this.writeVarintField(H,!!D)}};var hg=r(zf);const r0=3;function Lx(H,D,K){H===1&&K.readMessage(em,D)}function em(H,D,K){if(H===3){const{id:he,bitmap:Ee,width:Be,height:Ve,left:nt,top:mt,advance:Pt}=K.readMessage(vg,{});D.push({id:he,bitmap:new xs({width:Be+2*r0,height:Ve+2*r0},Ee),metrics:{width:Be,height:Ve,left:nt,top:mt,advance:Pt}})}}function vg(H,D,K){H===1?D.id=K.readVarint():H===2?D.bitmap=K.readBytes():H===3?D.width=K.readVarint():H===4?D.height=K.readVarint():H===5?D.left=K.readSVarint():H===6?D.top=K.readSVarint():H===7&&(D.advance=K.readVarint())}const dg=r0;function a0(H){let D=0,K=0;for(const Ve of H)D+=Ve.w*Ve.h,K=Math.max(K,Ve.w);H.sort((Ve,nt)=>nt.h-Ve.h);const he=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(D/.95)),K),h:1/0}];let Ee=0,Be=0;for(const Ve of H)for(let nt=he.length-1;nt>=0;nt--){const mt=he[nt];if(!(Ve.w>mt.w||Ve.h>mt.h)){if(Ve.x=mt.x,Ve.y=mt.y,Be=Math.max(Be,Ve.y+Ve.h),Ee=Math.max(Ee,Ve.x+Ve.w),Ve.w===mt.w&&Ve.h===mt.h){const Pt=he.pop();nt=0&&he>=D&&i0[this.text.charCodeAt(he)];he--)K--;this.text=this.text.substring(D,K),this.sectionIndex=this.sectionIndex.slice(D,K)}substring(D,K){const he=new xd;return he.text=this.text.substring(D,K),he.sectionIndex=this.sectionIndex.slice(D,K),he.sections=this.sections,he}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((D,K)=>Math.max(D,this.sections[K].scale),0)}addTextSection(D,K){this.text+=D.text,this.sections.push(hp.forText(D.scale,D.fontStack||K));const he=this.sections.length-1;for(let Ee=0;Ee=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function n0(H,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr){const Yr=xd.fromFeature(H,Ee);let ca;er===e.ah.vertical&&Yr.verticalizePunctuation();const{processBidirectionalText:Ca,processStyledBidirectionalText:un}=gs;if(Ca&&Yr.sections.length===1){ca=[];const Sn=Ca(Yr.toString(),Jv(Yr,Pt,Be,D,he,Rr));for(const $n of Sn){const Oi=new xd;Oi.text=$n,Oi.sections=Yr.sections;for(let qo=0;qo<$n.length;qo++)Oi.sectionIndex.push(0);ca.push(Oi)}}else if(un){ca=[];const Sn=un(Yr.text,Yr.sectionIndex,Jv(Yr,Pt,Be,D,he,Rr));for(const $n of Sn){const Oi=new xd;Oi.text=$n[0],Oi.sectionIndex=$n[1],Oi.sections=Yr.sections,ca.push(Oi)}}else ca=function(Sn,$n){const Oi=[],qo=Sn.text;let qi=0;for(const Di of $n)Oi.push(Sn.substring(qi,Di)),qi=Di;return qi0&&Fh>lf&&(lf=Fh)}else{const Wl=Oi[tl.fontStack],uf=Wl&&Wl[Ll];if(uf&&uf.rect)Cd=uf.rect,cu=uf.metrics;else{const Fh=$n[tl.fontStack],bh=Fh&&Fh[Ll];if(!bh)continue;cu=bh.metrics}ku=(Wc-tl.scale)*pl}Of?(Sn.verticalizable=!0,$f.push({glyph:Ll,imageName:jh,x:ts,y:Gl+ku,vertical:Of,scale:tl.scale,fontStack:tl.fontStack,sectionIndex:El,metrics:cu,rect:Cd}),ts+=Vh*tl.scale+zn):($f.push({glyph:Ll,imageName:jh,x:ts,y:Gl+ku,vertical:Of,scale:tl.scale,fontStack:tl.fontStack,sectionIndex:El,metrics:cu,rect:Cd}),ts+=cu.advance*tl.scale+zn)}$f.length!==0&&(Nl=Math.max(ts-zn,Nl),Rx($f,0,$f.length-1,ih,lf)),ts=0;const xh=Di*Wc+lf;Tf.lineOffset=Math.max(lf,Ff),Gl+=xh,Gc=Math.max(xh,Gc),++hc}var Rc;const Yf=Gl-_d,{horizontalAlign:Kf,verticalAlign:Jf}=gg(mo);(function(Ou,Wc,Ff,Tf,$f,lf,xh,uu,tl){const El=(Wc-Ff)*$f;let Ll=0;Ll=lf!==xh?-uu*Tf-_d:(-Tf*tl+.5)*xh;for(const ku of Ou)for(const cu of ku.positionedGlyphs)cu.x+=El,cu.y+=Ll})(Sn.positionedLines,ih,Kf,Jf,Nl,Gc,Di,Yf,qi.length),Sn.top+=-Jf*Yf,Sn.bottom=Sn.top+Yf,Sn.left+=-Kf*Nl,Sn.right=Sn.left+Nl}(rn,D,K,he,ca,Ve,nt,mt,er,Pt,br,jr),!function(Sn){for(const $n of Sn)if($n.positionedGlyphs.length!==0)return!1;return!0}(Ha)&&rn}const i0={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Px={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Ix={40:!0};function o0(H,D,K,he,Ee,Be){if(D.imageName){const Ve=he[D.imageName];return Ve?Ve.displaySize[0]*D.scale*pl/Be+Ee:0}{const Ve=K[D.fontStack],nt=Ve&&Ve[H];return nt?nt.metrics.advance*D.scale+Ee:0}}function rm(H,D,K,he){const Ee=Math.pow(H-D,2);return he?H=0;let Pt=0;for(let er=0;erPt){const Xt=Math.ceil(Be/Pt);Ee*=Xt/Ve,Ve=Xt}return{x1:he,y1:Ee,x2:he+Be,y2:Ee+Ve}}function nm(H,D,K,he,Ee,Be){const Ve=H.image;let nt;if(Ve.content){const ca=Ve.content,Ca=Ve.pixelRatio||1;nt=[ca[0]/Ca,ca[1]/Ca,Ve.displaySize[0]-ca[2]/Ca,Ve.displaySize[1]-ca[3]/Ca]}const mt=D.left*Be,Pt=D.right*Be;let Xt,er,br,Rr;K==="width"||K==="both"?(Rr=Ee[0]+mt-he[3],er=Ee[0]+Pt+he[1]):(Rr=Ee[0]+(mt+Pt-Ve.displaySize[0])/2,er=Rr+Ve.displaySize[0]);const jr=D.top*Be,Yr=D.bottom*Be;return K==="height"||K==="both"?(Xt=Ee[1]+jr-he[0],br=Ee[1]+Yr+he[2]):(Xt=Ee[1]+(jr+Yr-Ve.displaySize[1])/2,br=Xt+Ve.displaySize[1]),{image:Ve,top:Xt,right:er,bottom:br,left:Rr,collisionPadding:nt}}const vp=255,$h=128,Dv=vp*$h;function im(H,D){const{expression:K}=D;if(K.kind==="constant")return{kind:"constant",layoutSize:K.evaluate(new Jo(H+1))};if(K.kind==="source")return{kind:"source"};{const{zoomStops:he,interpolationType:Ee}=K;let Be=0;for(;BeVe.id),this.index=D.index,this.pixelRatio=D.pixelRatio,this.sourceLayerIndex=D.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Cn([]),this.placementViewportMatrix=Cn([]);const K=this.layers[0]._unevaluatedLayout._values;this.textSizeData=im(this.zoom,K["text-size"]),this.iconSizeData=im(this.zoom,K["icon-size"]);const he=this.layers[0].layout,Ee=he.get("symbol-sort-key"),Be=he.get("symbol-z-order");this.canOverlap=yg(he,"text-overlap","text-allow-overlap")!=="never"||yg(he,"icon-overlap","icon-allow-overlap")!=="never"||he.get("text-ignore-placement")||he.get("icon-ignore-placement"),this.sortFeaturesByKey=Be!=="viewport-y"&&!Ee.isConstant(),this.sortFeaturesByY=(Be==="viewport-y"||Be==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,he.get("symbol-placement")==="point"&&(this.writingModes=he.get("text-writing-mode").map(Ve=>e.ah[Ve])),this.stateDependentLayerIds=this.layers.filter(Ve=>Ve.isStateDependent()).map(Ve=>Ve.id),this.sourceID=D.sourceID}createArrays(){this.text=new Hu(new hs(this.layers,this.zoom,D=>/^text/.test(D))),this.icon=new Hu(new hs(this.layers,this.zoom,D=>/^icon/.test(D))),this.glyphOffsetArray=new Bo,this.lineVertexArray=new No,this.symbolInstances=new Gi,this.textAnchorOffsets=new Zo}calculateGlyphDependencies(D,K,he,Ee,Be){for(let Ve=0;Ve0)&&(Ve.value.kind!=="constant"||Ve.value.value.length>0),Xt=mt.value.kind!=="constant"||!!mt.value.value||Object.keys(mt.parameters).length>0,er=Be.get("symbol-sort-key");if(this.features=[],!Pt&&!Xt)return;const br=K.iconDependencies,Rr=K.glyphDependencies,jr=K.availableImages,Yr=new Jo(this.zoom);for(const{feature:ca,id:Ca,index:un,sourceLayerIndex:Ha}of D){const rn=Ee._featureFilter.needGeometry,Sn=fa(ca,rn);if(!Ee._featureFilter.filter(Yr,Sn,he))continue;let $n,Oi;if(rn||(Sn.geometry=cr(ca)),Pt){const qi=Ee.getValueAndResolveTokens("text-field",Sn,he,jr),Di=na.factory(qi),mo=this.hasRTLText=this.hasRTLText||Fx(Di);(!mo||gs.getRTLTextPluginStatus()==="unavailable"||mo&&gs.isParsed())&&($n=Lv(Di,Ee,Sn))}if(Xt){const qi=Ee.getValueAndResolveTokens("icon-image",Sn,he,jr);Oi=qi instanceof Pa?qi:Pa.fromString(qi)}if(!$n&&!Oi)continue;const qo=this.sortFeaturesByKey?er.evaluate(Sn,{},he):void 0;if(this.features.push({id:Ca,text:$n,icon:Oi,index:un,sourceLayerIndex:Ha,geometry:Sn.geometry,properties:ca.properties,type:zx[ca.type],sortKey:qo}),Oi&&(br[Oi.name]=!0),$n){const qi=Ve.evaluate(Sn,{},he).join(","),Di=Be.get("text-rotation-alignment")!=="viewport"&&Be.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(const mo of $n.sections)if(mo.image)br[mo.image.name]=!0;else{const so=Ki($n.toString()),to=mo.fontStack||qi,zn=Rr[to]=Rr[to]||{};this.calculateGlyphDependencies(mo.text,zn,Di,this.allowVerticalPlacement,so)}}}Be.get("symbol-placement")==="line"&&(this.features=function(ca){const Ca={},un={},Ha=[];let rn=0;function Sn(qi){Ha.push(ca[qi]),rn++}function $n(qi,Di,mo){const so=un[qi];return delete un[qi],un[Di]=so,Ha[so].geometry[0].pop(),Ha[so].geometry[0]=Ha[so].geometry[0].concat(mo[0]),so}function Oi(qi,Di,mo){const so=Ca[Di];return delete Ca[Di],Ca[qi]=so,Ha[so].geometry[0].shift(),Ha[so].geometry[0]=mo[0].concat(Ha[so].geometry[0]),so}function qo(qi,Di,mo){const so=mo?Di[0][Di[0].length-1]:Di[0][0];return`${qi}:${so.x}:${so.y}`}for(let qi=0;qiqi.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((ca,Ca)=>ca.sortKey-Ca.sortKey)}update(D,K,he){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(D,K,this.layers,he),this.icon.programConfigurations.updatePaintArrays(D,K,this.layers,he))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(D){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(D),this.iconCollisionBox.upload(D)),this.text.upload(D,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(D,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(D,K){const he=this.lineVertexArray.length;if(D.segment!==void 0){let Ee=D.dist(K[D.segment+1]),Be=D.dist(K[D.segment]);const Ve={};for(let nt=D.segment+1;nt=0;nt--)Ve[nt]={x:K[nt].x,y:K[nt].y,tileUnitDistanceFromAnchor:Be},nt>0&&(Be+=K[nt-1].dist(K[nt]));for(let nt=0;nt0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(D,K){const he=D.placedSymbolArray.get(K),Ee=he.vertexStartIndex+4*he.numGlyphs;for(let Be=he.vertexStartIndex;BeEe[nt]-Ee[mt]||Be[mt]-Be[nt]),Ve}addToSortKeyRanges(D,K){const he=this.sortKeyRanges[this.sortKeyRanges.length-1];he&&he.sortKey===K?he.symbolInstanceEnd=D+1:this.sortKeyRanges.push({sortKey:K,symbolInstanceStart:D,symbolInstanceEnd:D+1})}sortFeatures(D){if(this.sortFeaturesByY&&this.sortedAngle!==D&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(D),this.sortedAngle=D,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const K of this.symbolInstanceIndexes){const he=this.symbolInstances.get(K);this.featureSortOrder.push(he.featureIndex),[he.rightJustifiedTextSymbolIndex,he.centerJustifiedTextSymbolIndex,he.leftJustifiedTextSymbolIndex].forEach((Ee,Be,Ve)=>{Ee>=0&&Ve.indexOf(Ee)===Be&&this.addIndicesForPlacedSymbol(this.text,Ee)}),he.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,he.verticalPlacedTextSymbolIndex),he.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,he.placedIconSymbolIndex),he.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,he.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let dp,pp;Wa("SymbolBucket",$v,{omit:["layers","collisionBoxArray","features","compareText"]}),$v.MAX_GLYPHS=65535,$v.addDynamicAttributes=zv;var _g={get paint(){return pp=pp||new De({"icon-opacity":new eo(ie.paint_symbol["icon-opacity"]),"icon-color":new eo(ie.paint_symbol["icon-color"]),"icon-halo-color":new eo(ie.paint_symbol["icon-halo-color"]),"icon-halo-width":new eo(ie.paint_symbol["icon-halo-width"]),"icon-halo-blur":new eo(ie.paint_symbol["icon-halo-blur"]),"icon-translate":new Vi(ie.paint_symbol["icon-translate"]),"icon-translate-anchor":new Vi(ie.paint_symbol["icon-translate-anchor"]),"text-opacity":new eo(ie.paint_symbol["text-opacity"]),"text-color":new eo(ie.paint_symbol["text-color"],{runtimeType:Rt,getOverride:H=>H.textColor,hasOverride:H=>!!H.textColor}),"text-halo-color":new eo(ie.paint_symbol["text-halo-color"]),"text-halo-width":new eo(ie.paint_symbol["text-halo-width"]),"text-halo-blur":new eo(ie.paint_symbol["text-halo-blur"]),"text-translate":new Vi(ie.paint_symbol["text-translate"]),"text-translate-anchor":new Vi(ie.paint_symbol["text-translate-anchor"])})},get layout(){return dp=dp||new De({"symbol-placement":new Vi(ie.layout_symbol["symbol-placement"]),"symbol-spacing":new Vi(ie.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Vi(ie.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new eo(ie.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Vi(ie.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Vi(ie.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Vi(ie.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Vi(ie.layout_symbol["icon-ignore-placement"]),"icon-optional":new Vi(ie.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Vi(ie.layout_symbol["icon-rotation-alignment"]),"icon-size":new eo(ie.layout_symbol["icon-size"]),"icon-text-fit":new Vi(ie.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Vi(ie.layout_symbol["icon-text-fit-padding"]),"icon-image":new eo(ie.layout_symbol["icon-image"]),"icon-rotate":new eo(ie.layout_symbol["icon-rotate"]),"icon-padding":new eo(ie.layout_symbol["icon-padding"]),"icon-keep-upright":new Vi(ie.layout_symbol["icon-keep-upright"]),"icon-offset":new eo(ie.layout_symbol["icon-offset"]),"icon-anchor":new eo(ie.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Vi(ie.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Vi(ie.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Vi(ie.layout_symbol["text-rotation-alignment"]),"text-field":new eo(ie.layout_symbol["text-field"]),"text-font":new eo(ie.layout_symbol["text-font"]),"text-size":new eo(ie.layout_symbol["text-size"]),"text-max-width":new eo(ie.layout_symbol["text-max-width"]),"text-line-height":new Vi(ie.layout_symbol["text-line-height"]),"text-letter-spacing":new eo(ie.layout_symbol["text-letter-spacing"]),"text-justify":new eo(ie.layout_symbol["text-justify"]),"text-radial-offset":new eo(ie.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Vi(ie.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new eo(ie.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new eo(ie.layout_symbol["text-anchor"]),"text-max-angle":new Vi(ie.layout_symbol["text-max-angle"]),"text-writing-mode":new Vi(ie.layout_symbol["text-writing-mode"]),"text-rotate":new eo(ie.layout_symbol["text-rotate"]),"text-padding":new Vi(ie.layout_symbol["text-padding"]),"text-keep-upright":new Vi(ie.layout_symbol["text-keep-upright"]),"text-transform":new eo(ie.layout_symbol["text-transform"]),"text-offset":new eo(ie.layout_symbol["text-offset"]),"text-allow-overlap":new Vi(ie.layout_symbol["text-allow-overlap"]),"text-overlap":new Vi(ie.layout_symbol["text-overlap"]),"text-ignore-placement":new Vi(ie.layout_symbol["text-ignore-placement"]),"text-optional":new Vi(ie.layout_symbol["text-optional"])})}};class wd{constructor(D){if(D.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=D.property.overrides?D.property.overrides.runtimeType:rt,this.defaultValue=D}evaluate(D){if(D.formattedSection){const K=this.defaultValue.property.overrides;if(K&&K.hasOverride(D.formattedSection))return K.getOverride(D.formattedSection)}return D.feature&&D.featureState?this.defaultValue.evaluate(D.feature,D.featureState):this.defaultValue.property.specification.default}eachChild(D){this.defaultValue.isConstant()||D(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Wa("FormatSectionOverride",wd,{omit:["defaultValue"]});class u0 extends ne{constructor(D){super(D,_g)}recalculate(D,K){if(super.recalculate(D,K),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),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"){const he=this.layout.get("text-writing-mode");if(he){const Ee=[];for(const Be of he)Ee.indexOf(Be)<0&&Ee.push(Be);this.layout._values["text-writing-mode"]=Ee}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(D,K,he,Ee){const Be=this.layout.get(D).evaluate(K,{},he,Ee),Ve=this._unevaluatedLayout._values[D];return Ve.isDataDriven()||Uu(Ve.value)||!Be?Be:function(nt,mt){return mt.replace(/{([^{}]+)}/g,(Pt,Xt)=>nt&&Xt in nt?String(nt[Xt]):"")}(K.properties,Be)}createBucket(D){return new $v(D)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const D of _g.paint.overridableProperties){if(!u0.hasPaintOverride(this.layout,D))continue;const K=this.paint.get(D),he=new wd(K),Ee=new ru(he,K.property.specification);let Be=null;Be=K.value.kind==="constant"||K.value.kind==="source"?new Qu("source",Ee):new Tu("composite",Ee,K.value.zoomStops),this.paint._values[D]=new ol(K.property,Be,K.parameters)}}_handleOverridablePaintPropertyUpdate(D,K,he){return!(!this.layout||K.isDataDriven()||he.isDataDriven())&&u0.hasPaintOverride(this.layout,D)}static hasPaintOverride(D,K){const he=D.get("text-field"),Ee=_g.paint.properties[K];let Be=!1;const Ve=nt=>{for(const mt of nt)if(Ee.overrides&&Ee.overrides.hasOverride(mt))return void(Be=!0)};if(he.value.kind==="constant"&&he.value.value instanceof na)Ve(he.value.value.sections);else if(he.value.kind==="source"){const nt=Pt=>{Be||(Pt instanceof Lr&&dt(Pt.value)===Mr?Ve(Pt.value.sections):Pt instanceof bs?Ve(Pt.sections):Pt.eachChild(nt))},mt=he.value;mt._styleExpression&&nt(mt._styleExpression.expression)}return Be}}let xg;var om={get paint(){return xg=xg||new De({"background-color":new Vi(ie.paint_background["background-color"]),"background-pattern":new Du(ie.paint_background["background-pattern"]),"background-opacity":new Vi(ie.paint_background["background-opacity"])})}};class gp extends ne{constructor(D){super(D,om)}}let c0;var bg={get paint(){return c0=c0||new De({"raster-opacity":new Vi(ie.paint_raster["raster-opacity"]),"raster-hue-rotate":new Vi(ie.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Vi(ie.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Vi(ie.paint_raster["raster-brightness-max"]),"raster-saturation":new Vi(ie.paint_raster["raster-saturation"]),"raster-contrast":new Vi(ie.paint_raster["raster-contrast"]),"raster-resampling":new Vi(ie.paint_raster["raster-resampling"]),"raster-fade-duration":new Vi(ie.paint_raster["raster-fade-duration"])})}};class Ox extends ne{constructor(D){super(D,bg)}}class sm extends ne{constructor(D){super(D,{}),this.onAdd=K=>{this.implementation.onAdd&&this.implementation.onAdd(K,K.painter.context.gl)},this.onRemove=K=>{this.implementation.onRemove&&this.implementation.onRemove(K,K.painter.context.gl)},this.implementation=D}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class yp{constructor(D){this._methodToThrottle=D,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const wg=63710088e-1;class Qh{constructor(D,K){if(isNaN(D)||isNaN(K))throw new Error(`Invalid LngLat object: (${D}, ${K})`);if(this.lng=+D,this.lat=+K,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Qh(S(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(D){const K=Math.PI/180,he=this.lat*K,Ee=D.lat*K,Be=Math.sin(he)*Math.sin(Ee)+Math.cos(he)*Math.cos(Ee)*Math.cos((D.lng-this.lng)*K);return wg*Math.acos(Math.min(Be,1))}static convert(D){if(D instanceof Qh)return D;if(Array.isArray(D)&&(D.length===2||D.length===3))return new Qh(Number(D[0]),Number(D[1]));if(!Array.isArray(D)&&typeof D=="object"&&D!==null)return new Qh(Number("lng"in D?D.lng:D.lon),Number(D.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 [, ]")}}const lm=2*Math.PI*wg;function f0(H){return lm*Math.cos(H*Math.PI/180)}function h0(H){return(180+H)/360}function um(H){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+H*Math.PI/360)))/360}function zh(H,D){return H/f0(D)}function Tg(H){return 360/Math.PI*Math.atan(Math.exp((180-360*H)*Math.PI/180))-90}class mp{constructor(D,K,he=0){this.x=+D,this.y=+K,this.z=+he}static fromLngLat(D,K=0){const he=Qh.convert(D);return new mp(h0(he.lng),um(he.lat),zh(K,he.lat))}toLngLat(){return new Qh(360*this.x-180,Tg(this.y))}toAltitude(){return this.z*f0(Tg(this.y))}meterInMercatorCoordinateUnits(){return 1/lm*(D=Tg(this.y),1/Math.cos(D*Math.PI/180));var D}}function cm(H,D,K){var he=2*Math.PI*6378137/256/Math.pow(2,K);return[H*he-2*Math.PI*6378137/2,D*he-2*Math.PI*6378137/2]}class Ag{constructor(D,K,he){if(!function(Ee,Be,Ve){return!(Ee<0||Ee>25||Ve<0||Ve>=Math.pow(2,Ee)||Be<0||Be>=Math.pow(2,Ee))}(D,K,he))throw new Error(`x=${K}, y=${he}, z=${D} outside of bounds. 0<=x<${Math.pow(2,D)}, 0<=y<${Math.pow(2,D)} 0<=z<=25 `);this.z=D,this.x=K,this.y=he,this.key=Td(0,D,D,K,he)}equals(D){return this.z===D.z&&this.x===D.x&&this.y===D.y}url(D,K,he){const Ee=(Ve=this.y,nt=this.z,mt=cm(256*(Be=this.x),256*(Ve=Math.pow(2,nt)-Ve-1),nt),Pt=cm(256*(Be+1),256*(Ve+1),nt),mt[0]+","+mt[1]+","+Pt[0]+","+Pt[1]);var Be,Ve,nt,mt,Pt;const Xt=function(er,br,Rr){let jr,Yr="";for(let ca=er;ca>0;ca--)jr=1<1?"@2x":"").replace(/{quadkey}/g,Xt).replace(/{bbox-epsg-3857}/g,Ee)}isChildOf(D){const K=this.z-D.z;return K>0&&D.x===this.x>>K&&D.y===this.y>>K}getTilePoint(D){const K=Math.pow(2,this.z);return new i((D.x*K-this.x)*_s,(D.y*K-this.y)*_s)}toString(){return`${this.z}/${this.x}/${this.y}`}}class fm{constructor(D,K){this.wrap=D,this.canonical=K,this.key=Td(D,K.z,K.z,K.x,K.y)}}class kh{constructor(D,K,he,Ee,Be){if(D= z; overscaledZ = ${D}; z = ${he}`);this.overscaledZ=D,this.wrap=K,this.canonical=new Ag(he,+Ee,+Be),this.key=Td(K,D,he,Ee,Be)}clone(){return new kh(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(D){return this.overscaledZ===D.overscaledZ&&this.wrap===D.wrap&&this.canonical.equals(D.canonical)}scaledTo(D){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);const K=this.canonical.z-D;return D>this.canonical.z?new kh(D,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new kh(D,this.wrap,D,this.canonical.x>>K,this.canonical.y>>K)}calculateScaledKey(D,K){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);const he=this.canonical.z-D;return D>this.canonical.z?Td(this.wrap*+K,D,this.canonical.z,this.canonical.x,this.canonical.y):Td(this.wrap*+K,D,D,this.canonical.x>>he,this.canonical.y>>he)}isChildOf(D){if(D.wrap!==this.wrap)return!1;const K=this.canonical.z-D.canonical.z;return D.overscaledZ===0||D.overscaledZ>K&&D.canonical.y===this.canonical.y>>K}children(D){if(this.overscaledZ>=D)return[new kh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const K=this.canonical.z+1,he=2*this.canonical.x,Ee=2*this.canonical.y;return[new kh(K,this.wrap,K,he,Ee),new kh(K,this.wrap,K,he+1,Ee),new kh(K,this.wrap,K,he,Ee+1),new kh(K,this.wrap,K,he+1,Ee+1)]}isLessThan(D){return this.wrapD.wrap)&&(this.overscaledZD.overscaledZ)&&(this.canonical.xD.canonical.x)&&this.canonical.ythis.max&&(this.max=er),er=this.dim+1||K<-1||K>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(K+1)*this.stride+(D+1)}unpack(D,K,he){return D*this.redFactor+K*this.greenFactor+he*this.blueFactor-this.baseShift}getPixels(){return new Xs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(D,K,he){if(this.dim!==D.dim)throw new Error("dem dimension mismatch");let Ee=K*this.dim,Be=K*this.dim+this.dim,Ve=he*this.dim,nt=he*this.dim+this.dim;switch(K){case-1:Ee=Be-1;break;case 1:Be=Ee+1}switch(he){case-1:Ve=nt-1;break;case 1:nt=Ve+1}const mt=-K*this.dim,Pt=-he*this.dim;for(let Xt=Ve;Xt=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${D} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[D]}}class vm{constructor(D,K,he,Ee,Be){this.type="Feature",this._vectorTileFeature=D,D._z=K,D._x=he,D._y=Ee,this.properties=D.properties,this.id=Be}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(D){this._geometry=D}toJSON(){const D={geometry:this.geometry};for(const K in this)K!=="_geometry"&&K!=="_vectorTileFeature"&&(D[K]=this[K]);return D}}class dm{constructor(D,K){this.tileID=D,this.x=D.canonical.x,this.y=D.canonical.y,this.z=D.canonical.z,this.grid=new _n(_s,16,0),this.grid3D=new _n(_s,16,0),this.featureIndexArray=new zs,this.promoteId=K}insert(D,K,he,Ee,Be,Ve){const nt=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(he,Ee,Be);const mt=Ve?this.grid3D:this.grid;for(let Pt=0;Pt=0&&er[3]>=0&&mt.insert(nt,er[0],er[1],er[2],er[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new an.VectorTile(new hg(this.rawTileData)).layers,this.sourceLayerCoder=new hm(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(D,K,he,Ee){this.loadVTLayers();const Be=D.params||{},Ve=_s/D.tileSize/D.scale,nt=Ec(Be.filter),mt=D.queryGeometry,Pt=D.queryPadding*Ve,Xt=Sg(mt),er=this.grid.query(Xt.minX-Pt,Xt.minY-Pt,Xt.maxX+Pt,Xt.maxY+Pt),br=Sg(D.cameraQueryGeometry),Rr=this.grid3D.query(br.minX-Pt,br.minY-Pt,br.maxX+Pt,br.maxY+Pt,(ca,Ca,un,Ha)=>function(rn,Sn,$n,Oi,qo){for(const Di of rn)if(Sn<=Di.x&&$n<=Di.y&&Oi>=Di.x&&qo>=Di.y)return!0;const qi=[new i(Sn,$n),new i(Sn,qo),new i(Oi,qo),new i(Oi,$n)];if(rn.length>2){for(const Di of qi)if(si(rn,Di))return!0}for(let Di=0;Di(Ha||(Ha=cr(rn)),Sn.queryIntersectsFeature(mt,rn,$n,Ha,this.z,D.transform,Ve,D.pixelPosMatrix)))}return jr}loadMatchingFeature(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er){const br=this.bucketLayerIDs[K];if(Ve&&!function(ca,Ca){for(let un=0;un=0)return!0;return!1}(Ve,br))return;const Rr=this.sourceLayerCoder.decode(he),jr=this.vtLayers[Rr].feature(Ee);if(Be.needGeometry){const ca=fa(jr,!0);if(!Be.filter(new Jo(this.tileID.overscaledZ),ca,this.tileID.canonical))return}else if(!Be.filter(new Jo(this.tileID.overscaledZ),jr))return;const Yr=this.getId(jr,Rr);for(let ca=0;ca{const nt=D instanceof rc?D.get(Ve):null;return nt&&nt.evaluate?nt.evaluate(K,he,Ee):nt})}function Sg(H){let D=1/0,K=1/0,he=-1/0,Ee=-1/0;for(const Be of H)D=Math.min(D,Be.x),K=Math.min(K,Be.y),he=Math.max(he,Be.x),Ee=Math.max(Ee,Be.y);return{minX:D,minY:K,maxX:he,maxY:Ee}}function gm(H,D){return D-H}function ym(H,D,K,he,Ee){const Be=[];for(let Ve=0;Ve=he&&er.x>=he||(Xt.x>=he?Xt=new i(he,Xt.y+(he-Xt.x)/(er.x-Xt.x)*(er.y-Xt.y))._round():er.x>=he&&(er=new i(he,Xt.y+(he-Xt.x)/(er.x-Xt.x)*(er.y-Xt.y))._round()),Xt.y>=Ee&&er.y>=Ee||(Xt.y>=Ee?Xt=new i(Xt.x+(Ee-Xt.y)/(er.y-Xt.y)*(er.x-Xt.x),Ee)._round():er.y>=Ee&&(er=new i(Xt.x+(Ee-Xt.y)/(er.y-Xt.y)*(er.x-Xt.x),Ee)._round()),mt&&Xt.equals(mt[mt.length-1])||(mt=[Xt],Be.push(mt)),mt.push(er)))))}}return Be}Wa("FeatureIndex",dm,{omit:["rawTileData","sourceLayerCoder"]});class Fv extends i{constructor(D,K,he,Ee){super(D,K),this.angle=he,Ee!==void 0&&(this.segment=Ee)}clone(){return new Fv(this.x,this.y,this.angle,this.segment)}}function mm(H,D,K,he,Ee){if(D.segment===void 0||K===0)return!0;let Be=D,Ve=D.segment+1,nt=0;for(;nt>-K/2;){if(Ve--,Ve<0)return!1;nt-=H[Ve].dist(Be),Be=H[Ve]}nt+=H[Ve].dist(H[Ve+1]),Ve++;const mt=[];let Pt=0;for(;nthe;)Pt-=mt.shift().angleDelta;if(Pt>Ee)return!1;Ve++,nt+=Xt.dist(er)}return!0}function _m(H){let D=0;for(let K=0;KPt){const jr=(Pt-mt)/Rr,Yr=Ci.number(er.x,br.x,jr),ca=Ci.number(er.y,br.y,jr),Ca=new Fv(Yr,ca,br.angleTo(er),Xt);return Ca._round(),!Ve||mm(H,Ca,nt,Ve,D)?Ca:void 0}mt+=Rr}}function Nx(H,D,K,he,Ee,Be,Ve,nt,mt){const Pt=xm(he,Be,Ve),Xt=bm(he,Ee),er=Xt*Ve,br=H[0].x===0||H[0].x===mt||H[0].y===0||H[0].y===mt;return D-er=0&&rn=0&&Sn=0&&br+Pt<=Xt){const $n=new Fv(rn,Sn,un,jr);$n._round(),he&&!mm(H,$n,Be,he,Ee)||Rr.push($n)}}er+=Ca}return nt||Rr.length||Ve||(Rr=ed(H,er/2,K,he,Ee,Be,Ve,!0,mt)),Rr}Wa("Anchor",Fv);const Ad=Ic;function wm(H,D,K,he){const Ee=[],Be=H.image,Ve=Be.pixelRatio,nt=Be.paddedRect.w-2*Ad,mt=Be.paddedRect.h-2*Ad;let Pt={x1:H.left,y1:H.top,x2:H.right,y2:H.bottom};const Xt=Be.stretchX||[[0,nt]],er=Be.stretchY||[[0,mt]],br=(zn,To)=>zn+To[1]-To[0],Rr=Xt.reduce(br,0),jr=er.reduce(br,0),Yr=nt-Rr,ca=mt-jr;let Ca=0,un=Rr,Ha=0,rn=jr,Sn=0,$n=Yr,Oi=0,qo=ca;if(Be.content&&he){const zn=Be.content,To=zn[2]-zn[0],_o=zn[3]-zn[1];(Be.textFitWidth||Be.textFitHeight)&&(Pt=am(H)),Ca=Sd(Xt,0,zn[0]),Ha=Sd(er,0,zn[1]),un=Sd(Xt,zn[0],zn[2]),rn=Sd(er,zn[1],zn[3]),Sn=zn[0]-Ca,Oi=zn[1]-Ha,$n=To-un,qo=_o-rn}const qi=Pt.x1,Di=Pt.y1,mo=Pt.x2-qi,so=Pt.y2-Di,to=(zn,To,_o,ts)=>{const Gl=_h(zn.stretch-Ca,un,mo,qi),Nl=v0(zn.fixed-Sn,$n,zn.stretch,Rr),Gc=_h(To.stretch-Ha,rn,so,Di),ih=v0(To.fixed-Oi,qo,To.stretch,jr),hc=_h(_o.stretch-Ca,un,mo,qi),Rc=v0(_o.fixed-Sn,$n,_o.stretch,Rr),Yf=_h(ts.stretch-Ha,rn,so,Di),Kf=v0(ts.fixed-Oi,qo,ts.stretch,jr),Jf=new i(Gl,Gc),Ou=new i(hc,Gc),Wc=new i(hc,Yf),Ff=new i(Gl,Yf),Tf=new i(Nl/Ve,ih/Ve),$f=new i(Rc/Ve,Kf/Ve),lf=D*Math.PI/180;if(lf){const tl=Math.sin(lf),El=Math.cos(lf),Ll=[El,-tl,tl,El];Jf._matMult(Ll),Ou._matMult(Ll),Ff._matMult(Ll),Wc._matMult(Ll)}const xh=zn.stretch+zn.fixed,uu=To.stretch+To.fixed;return{tl:Jf,tr:Ou,bl:Ff,br:Wc,tex:{x:Be.paddedRect.x+Ad+xh,y:Be.paddedRect.y+Ad+uu,w:_o.stretch+_o.fixed-xh,h:ts.stretch+ts.fixed-uu},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Tf,pixelOffsetBR:$f,minFontScaleX:$n/Ve/mo,minFontScaleY:qo/Ve/so,isSDF:K}};if(he&&(Be.stretchX||Be.stretchY)){const zn=Md(Xt,Yr,Rr),To=Md(er,ca,jr);for(let _o=0;_o0&&(Yr=Math.max(10,Yr),this.circleDiameter=Yr)}else{const br=!((er=Ve.image)===null||er===void 0)&&er.content&&(Ve.image.textFitWidth||Ve.image.textFitHeight)?am(Ve):{x1:Ve.left,y1:Ve.top,x2:Ve.right,y2:Ve.bottom};br.y1=br.y1*nt-mt[0],br.y2=br.y2*nt+mt[2],br.x1=br.x1*nt-mt[3],br.x2=br.x2*nt+mt[1];const Rr=Ve.collisionPadding;if(Rr&&(br.x1-=Rr[0]*nt,br.y1-=Rr[1]*nt,br.x2+=Rr[2]*nt,br.y2+=Rr[3]*nt),Xt){const jr=new i(br.x1,br.y1),Yr=new i(br.x2,br.y1),ca=new i(br.x1,br.y2),Ca=new i(br.x2,br.y2),un=Xt*Math.PI/180;jr._rotate(un),Yr._rotate(un),ca._rotate(un),Ca._rotate(un),br.x1=Math.min(jr.x,Yr.x,ca.x,Ca.x),br.x2=Math.max(jr.x,Yr.x,ca.x,Ca.x),br.y1=Math.min(jr.y,Yr.y,ca.y,Ca.y),br.y2=Math.max(jr.y,Yr.y,ca.y,Ca.y)}D.emplaceBack(K.x,K.y,br.x1,br.y1,br.x2,br.y2,he,Ee,Be)}this.boxEndIndex=D.length}}class Ux{constructor(D=[],K=(he,Ee)=>heEe?1:0){if(this.data=D,this.length=this.data.length,this.compare=K,this.length>0)for(let he=(this.length>>1)-1;he>=0;he--)this._down(he)}push(D){this.data.push(D),this._up(this.length++)}pop(){if(this.length===0)return;const D=this.data[0],K=this.data.pop();return--this.length>0&&(this.data[0]=K,this._down(0)),D}peek(){return this.data[0]}_up(D){const{data:K,compare:he}=this,Ee=K[D];for(;D>0;){const Be=D-1>>1,Ve=K[Be];if(he(Ee,Ve)>=0)break;K[D]=Ve,D=Be}K[D]=Ee}_down(D){const{data:K,compare:he}=this,Ee=this.length>>1,Be=K[D];for(;D=0)break;K[D]=K[Ve],D=Ve}K[D]=Be}}function jx(H,D=1,K=!1){let he=1/0,Ee=1/0,Be=-1/0,Ve=-1/0;const nt=H[0];for(let Rr=0;RrBe)&&(Be=jr.x),(!Rr||jr.y>Ve)&&(Ve=jr.y)}const mt=Math.min(Be-he,Ve-Ee);let Pt=mt/2;const Xt=new Ux([],Vx);if(mt===0)return new i(he,Ee);for(let Rr=he;Rrer.d||!er.d)&&(er=Rr,K&&console.log("found best %d after %d probes",Math.round(1e4*Rr.d)/1e4,br)),Rr.max-er.d<=D||(Pt=Rr.h/2,Xt.push(new ev(Rr.p.x-Pt,Rr.p.y-Pt,Pt,H)),Xt.push(new ev(Rr.p.x+Pt,Rr.p.y-Pt,Pt,H)),Xt.push(new ev(Rr.p.x-Pt,Rr.p.y+Pt,Pt,H)),Xt.push(new ev(Rr.p.x+Pt,Rr.p.y+Pt,Pt,H)),br+=4)}return K&&(console.log(`num probes: ${br}`),console.log(`best distance: ${er.d}`)),er.p}function Vx(H,D){return D.max-H.max}function ev(H,D,K,he){this.p=new i(H,D),this.h=K,this.d=function(Ee,Be){let Ve=!1,nt=1/0;for(let mt=0;mtEe.y!=jr.y>Ee.y&&Ee.x<(jr.x-Rr.x)*(Ee.y-Rr.y)/(jr.y-Rr.y)+Rr.x&&(Ve=!Ve),nt=Math.min(nt,Wi(Ee,Rr,jr))}}return(Ve?1:-1)*Math.sqrt(nt)}(this.p,he),this.max=this.d+this.h*Math.SQRT2}var sf;e.aq=void 0,(sf=e.aq||(e.aq={}))[sf.center=1]="center",sf[sf.left=2]="left",sf[sf.right=3]="right",sf[sf.top=4]="top",sf[sf.bottom=5]="bottom",sf[sf["top-left"]=6]="top-left",sf[sf["top-right"]=7]="top-right",sf[sf["bottom-left"]=8]="bottom-left",sf[sf["bottom-right"]=9]="bottom-right";const Ov=7,Mg=Number.POSITIVE_INFINITY;function Tm(H,D){return D[1]!==Mg?function(K,he,Ee){let Be=0,Ve=0;switch(he=Math.abs(he),Ee=Math.abs(Ee),K){case"top-right":case"top-left":case"top":Ve=Ee-Ov;break;case"bottom-right":case"bottom-left":case"bottom":Ve=-Ee+Ov}switch(K){case"top-right":case"bottom-right":case"right":Be=-he;break;case"top-left":case"bottom-left":case"left":Be=he}return[Be,Ve]}(H,D[0],D[1]):function(K,he){let Ee=0,Be=0;he<0&&(he=0);const Ve=he/Math.SQRT2;switch(K){case"top-right":case"top-left":Be=Ve-Ov;break;case"bottom-right":case"bottom-left":Be=-Ve+Ov;break;case"bottom":Be=-he+Ov;break;case"top":Be=he-Ov}switch(K){case"top-right":case"bottom-right":Ee=-Ve;break;case"top-left":case"bottom-left":Ee=Ve;break;case"left":Ee=he;break;case"right":Ee=-he}return[Ee,Be]}(H,D[0])}function Am(H,D,K){var he;const Ee=H.layout,Be=(he=Ee.get("text-variable-anchor-offset"))===null||he===void 0?void 0:he.evaluate(D,{},K);if(Be){const nt=Be.values,mt=[];for(let Pt=0;Ptbr*pl);Xt.startsWith("top")?er[1]-=Ov:Xt.startsWith("bottom")&&(er[1]+=Ov),mt[Pt+1]=er}return new Aa(mt)}const Ve=Ee.get("text-variable-anchor");if(Ve){let nt;nt=H._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[Ee.get("text-radial-offset").evaluate(D,{},K)*pl,Mg]:Ee.get("text-offset").evaluate(D,{},K).map(Pt=>Pt*pl);const mt=[];for(const Pt of Ve)mt.push(Pt,Tm(Pt,nt));return new Aa(mt)}return null}function Eg(H){switch(H){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function qx(H,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt){let er=Be.textMaxSize.evaluate(D,{});er===void 0&&(er=Ve);const br=H.layers[0].layout,Rr=br.get("icon-offset").evaluate(D,{},Xt),jr=Mm(K.horizontal),Yr=Ve/24,ca=H.tilePixelRatio*Yr,Ca=H.tilePixelRatio*er/24,un=H.tilePixelRatio*nt,Ha=H.tilePixelRatio*br.get("symbol-spacing"),rn=br.get("text-padding")*H.tilePixelRatio,Sn=function(zn,To,_o,ts=1){const Gl=zn.get("icon-padding").evaluate(To,{},_o),Nl=Gl&&Gl.values;return[Nl[0]*ts,Nl[1]*ts,Nl[2]*ts,Nl[3]*ts]}(br,D,Xt,H.tilePixelRatio),$n=br.get("text-max-angle")/180*Math.PI,Oi=br.get("text-rotation-alignment")!=="viewport"&&br.get("symbol-placement")!=="point",qo=br.get("icon-rotation-alignment")==="map"&&br.get("symbol-placement")!=="point",qi=br.get("symbol-placement"),Di=Ha/2,mo=br.get("icon-text-fit");let so;he&&mo!=="none"&&(H.allowVerticalPlacement&&K.vertical&&(so=nm(he,K.vertical,mo,br.get("icon-text-fit-padding"),Rr,Yr)),jr&&(he=nm(he,jr,mo,br.get("icon-text-fit-padding"),Rr,Yr)));const to=(zn,To)=>{To.x<0||To.x>=_s||To.y<0||To.y>=_s||function(_o,ts,Gl,Nl,Gc,ih,hc,Rc,Yf,Kf,Jf,Ou,Wc,Ff,Tf,$f,lf,xh,uu,tl,El,Ll,ku,cu,Cd){const jh=_o.addToLineVertexArray(ts,Gl);let Vh,Of,Wl,uf,Fh=0,bh=0,Qf=0,Rg=0,Dg=-1,m0=-1;const gv={};let zg=Ma("");if(_o.allowVerticalPlacement&&Nl.vertical){const Af=Rc.layout.get("text-rotate").evaluate(El,{},cu)+90;Wl=new d0(Yf,ts,Kf,Jf,Ou,Nl.vertical,Wc,Ff,Tf,Af),hc&&(uf=new d0(Yf,ts,Kf,Jf,Ou,hc,lf,xh,Tf,Af))}if(Gc){const Af=Rc.layout.get("icon-rotate").evaluate(El,{}),wh=Rc.layout.get("icon-text-fit")!=="none",Bv=wm(Gc,Af,ku,wh),qh=hc?wm(hc,Af,ku,wh):void 0;Of=new d0(Yf,ts,Kf,Jf,Ou,Gc,lf,xh,!1,Af),Fh=4*Bv.length;const td=_o.iconSizeData;let Hh=null;td.kind==="source"?(Hh=[$h*Rc.layout.get("icon-size").evaluate(El,{})],Hh[0]>Dv&&m(`${_o.layerIds[0]}: Value for "icon-size" is >= ${vp}. Reduce your "icon-size".`)):td.kind==="composite"&&(Hh=[$h*Ll.compositeIconSizes[0].evaluate(El,{},cu),$h*Ll.compositeIconSizes[1].evaluate(El,{},cu)],(Hh[0]>Dv||Hh[1]>Dv)&&m(`${_o.layerIds[0]}: Value for "icon-size" is >= ${vp}. Reduce your "icon-size".`)),_o.addSymbols(_o.icon,Bv,Hh,tl,uu,El,e.ah.none,ts,jh.lineStartIndex,jh.lineLength,-1,cu),Dg=_o.icon.placedSymbolArray.length-1,qh&&(bh=4*qh.length,_o.addSymbols(_o.icon,qh,Hh,tl,uu,El,e.ah.vertical,ts,jh.lineStartIndex,jh.lineLength,-1,cu),m0=_o.icon.placedSymbolArray.length-1)}const Fg=Object.keys(Nl.horizontal);for(const Af of Fg){const wh=Nl.horizontal[Af];if(!Vh){zg=Ma(wh.text);const qh=Rc.layout.get("text-rotate").evaluate(El,{},cu);Vh=new d0(Yf,ts,Kf,Jf,Ou,wh,Wc,Ff,Tf,qh)}const Bv=wh.positionedLines.length===1;if(Qf+=Sm(_o,ts,wh,ih,Rc,Tf,El,$f,jh,Nl.vertical?e.ah.horizontal:e.ah.horizontalOnly,Bv?Fg:[Af],gv,Dg,Ll,cu),Bv)break}Nl.vertical&&(Rg+=Sm(_o,ts,Nl.vertical,ih,Rc,Tf,El,$f,jh,e.ah.vertical,["vertical"],gv,m0,Ll,cu));const Og=Vh?Vh.boxStartIndex:_o.collisionBoxArray.length,Bg=Vh?Vh.boxEndIndex:_o.collisionBoxArray.length,Hx=Wl?Wl.boxStartIndex:_o.collisionBoxArray.length,Gx=Wl?Wl.boxEndIndex:_o.collisionBoxArray.length,Wx=Of?Of.boxStartIndex:_o.collisionBoxArray.length,Zx=Of?Of.boxEndIndex:_o.collisionBoxArray.length,Pm=uf?uf.boxStartIndex:_o.collisionBoxArray.length,Ld=uf?uf.boxEndIndex:_o.collisionBoxArray.length;let Dc=-1;const Pd=(Af,wh)=>Af&&Af.circleDiameter?Math.max(Af.circleDiameter,wh):wh;Dc=Pd(Vh,Dc),Dc=Pd(Wl,Dc),Dc=Pd(Of,Dc),Dc=Pd(uf,Dc);const Ng=Dc>-1?1:0;Ng&&(Dc*=Cd/pl),_o.glyphOffsetArray.length>=$v.MAX_GLYPHS&&m("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),El.sortKey!==void 0&&_o.addToSortKeyRanges(_o.symbolInstances.length,El.sortKey);const Im=Am(Rc,El,cu),[Xx,Rm]=function(Af,wh){const Bv=Af.length,qh=wh==null?void 0:wh.values;if((qh==null?void 0:qh.length)>0)for(let td=0;td=0?gv.right:-1,gv.center>=0?gv.center:-1,gv.left>=0?gv.left:-1,gv.vertical||-1,Dg,m0,zg,Og,Bg,Hx,Gx,Wx,Zx,Pm,Ld,Kf,Qf,Rg,Fh,bh,Ng,0,Wc,Dc,Xx,Rm)}(H,To,zn,K,he,Ee,so,H.layers[0],H.collisionBoxArray,D.index,D.sourceLayerIndex,H.index,ca,[rn,rn,rn,rn],Oi,mt,un,Sn,qo,Rr,D,Be,Pt,Xt,Ve)};if(qi==="line")for(const zn of ym(D.geometry,0,0,_s,_s)){const To=Nx(zn,Ha,$n,K.vertical||jr,he,24,Ca,H.overscaling,_s);for(const _o of To)jr&&Em(H,jr.text,Di,_o)||to(zn,_o)}else if(qi==="line-center"){for(const zn of D.geometry)if(zn.length>1){const To=Bx(zn,$n,K.vertical||jr,he,24,Ca);To&&to(zn,To)}}else if(D.type==="Polygon")for(const zn of Lu(D.geometry,0)){const To=jx(zn,16);to(zn[0],new Fv(To.x,To.y,0))}else if(D.type==="LineString")for(const zn of D.geometry)to(zn,new Fv(zn[0].x,zn[0].y,0));else if(D.type==="Point")for(const zn of D.geometry)for(const To of zn)to([To],new Fv(To.x,To.y,0))}function Sm(H,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr){const Yr=function(un,Ha,rn,Sn,$n,Oi,qo,qi){const Di=Sn.layout.get("text-rotate").evaluate(Oi,{})*Math.PI/180,mo=[];for(const so of Ha.positionedLines)for(const to of so.positionedGlyphs){if(!to.rect)continue;const zn=to.rect||{};let To=dg+1,_o=!0,ts=1,Gl=0;const Nl=($n||qi)&&to.vertical,Gc=to.metrics.advance*to.scale/2;if(qi&&Ha.verticalizable&&(Gl=so.lineOffset/2-(to.imageName?-(pl-to.metrics.width*to.scale)/2:(to.scale-1)*pl)),to.imageName){const tl=qo[to.imageName];_o=tl.sdf,ts=tl.pixelRatio,To=Ic/ts}const ih=$n?[to.x+Gc,to.y]:[0,0];let hc=$n?[0,0]:[to.x+Gc+rn[0],to.y+rn[1]-Gl],Rc=[0,0];Nl&&(Rc=hc,hc=[0,0]);const Yf=to.metrics.isDoubleResolution?2:1,Kf=(to.metrics.left-To)*to.scale-Gc+hc[0],Jf=(-to.metrics.top-To)*to.scale+hc[1],Ou=Kf+zn.w/Yf*to.scale/ts,Wc=Jf+zn.h/Yf*to.scale/ts,Ff=new i(Kf,Jf),Tf=new i(Ou,Jf),$f=new i(Kf,Wc),lf=new i(Ou,Wc);if(Nl){const tl=new i(-Gc,Gc-_d),El=-Math.PI/2,Ll=pl/2-Gc,ku=new i(5-_d-Ll,-(to.imageName?Ll:0)),cu=new i(...Rc);Ff._rotateAround(El,tl)._add(ku)._add(cu),Tf._rotateAround(El,tl)._add(ku)._add(cu),$f._rotateAround(El,tl)._add(ku)._add(cu),lf._rotateAround(El,tl)._add(ku)._add(cu)}if(Di){const tl=Math.sin(Di),El=Math.cos(Di),Ll=[El,-tl,tl,El];Ff._matMult(Ll),Tf._matMult(Ll),$f._matMult(Ll),lf._matMult(Ll)}const xh=new i(0,0),uu=new i(0,0);mo.push({tl:Ff,tr:Tf,bl:$f,br:lf,tex:zn,writingMode:Ha.writingMode,glyphOffset:ih,sectionIndex:to.sectionIndex,isSDF:_o,pixelOffsetTL:xh,pixelOffsetBR:uu,minFontScaleX:0,minFontScaleY:0})}return mo}(0,K,nt,Ee,Be,Ve,he,H.allowVerticalPlacement),ca=H.textSizeData;let Ca=null;ca.kind==="source"?(Ca=[$h*Ee.layout.get("text-size").evaluate(Ve,{})],Ca[0]>Dv&&m(`${H.layerIds[0]}: Value for "text-size" is >= ${vp}. Reduce your "text-size".`)):ca.kind==="composite"&&(Ca=[$h*Rr.compositeTextSizes[0].evaluate(Ve,{},jr),$h*Rr.compositeTextSizes[1].evaluate(Ve,{},jr)],(Ca[0]>Dv||Ca[1]>Dv)&&m(`${H.layerIds[0]}: Value for "text-size" is >= ${vp}. Reduce your "text-size".`)),H.addSymbols(H.text,Yr,Ca,nt,Be,Ve,Pt,D,mt.lineStartIndex,mt.lineLength,br,jr);for(const un of Xt)er[un]=H.text.placedSymbolArray.length-1;return 4*Yr.length}function Mm(H){for(const D in H)return H[D];return null}function Em(H,D,K,he){const Ee=H.compareText;if(D in Ee){const Be=Ee[D];for(let Ve=Be.length-1;Ve>=0;Ve--)if(he.dist(Be[Ve])>4;if(Ee!==1)throw new Error(`Got v${Ee} data when expected v1.`);const Be=km[15&he];if(!Be)throw new Error("Unrecognized array type.");const[Ve]=new Uint16Array(D,2,1),[nt]=new Uint32Array(D,4,1);return new kg(nt,Ve,Be,D)}constructor(D,K=64,he=Float64Array,Ee){if(isNaN(D)||D<0)throw new Error(`Unpexpected numItems value: ${D}.`);this.numItems=+D,this.nodeSize=Math.min(Math.max(+K,2),65535),this.ArrayType=he,this.IndexArrayType=D<65536?Uint16Array:Uint32Array;const Be=km.indexOf(this.ArrayType),Ve=2*D*this.ArrayType.BYTES_PER_ELEMENT,nt=D*this.IndexArrayType.BYTES_PER_ELEMENT,mt=(8-nt%8)%8;if(Be<0)throw new Error(`Unexpected typed array class: ${he}.`);Ee&&Ee instanceof ArrayBuffer?(this.data=Ee,this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+nt+mt,2*D),this._pos=2*D,this._finished=!0):(this.data=new ArrayBuffer(8+Ve+nt+mt),this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+nt+mt,2*D),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Be]),new Uint16Array(this.data,2,1)[0]=K,new Uint32Array(this.data,4,1)[0]=D)}add(D,K){const he=this._pos>>1;return this.ids[he]=he,this.coords[this._pos++]=D,this.coords[this._pos++]=K,he}finish(){const D=this._pos>>1;if(D!==this.numItems)throw new Error(`Added ${D} items when expected ${this.numItems}.`);return Cg(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(D,K,he,Ee){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Be,coords:Ve,nodeSize:nt}=this,mt=[0,Be.length-1,0],Pt=[];for(;mt.length;){const Xt=mt.pop()||0,er=mt.pop()||0,br=mt.pop()||0;if(er-br<=nt){for(let ca=br;ca<=er;ca++){const Ca=Ve[2*ca],un=Ve[2*ca+1];Ca>=D&&Ca<=he&&un>=K&&un<=Ee&&Pt.push(Be[ca])}continue}const Rr=br+er>>1,jr=Ve[2*Rr],Yr=Ve[2*Rr+1];jr>=D&&jr<=he&&Yr>=K&&Yr<=Ee&&Pt.push(Be[Rr]),(Xt===0?D<=jr:K<=Yr)&&(mt.push(br),mt.push(Rr-1),mt.push(1-Xt)),(Xt===0?he>=jr:Ee>=Yr)&&(mt.push(Rr+1),mt.push(er),mt.push(1-Xt))}return Pt}within(D,K,he){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Ee,coords:Be,nodeSize:Ve}=this,nt=[0,Ee.length-1,0],mt=[],Pt=he*he;for(;nt.length;){const Xt=nt.pop()||0,er=nt.pop()||0,br=nt.pop()||0;if(er-br<=Ve){for(let ca=br;ca<=er;ca++)wf(Be[2*ca],Be[2*ca+1],D,K)<=Pt&&mt.push(Ee[ca]);continue}const Rr=br+er>>1,jr=Be[2*Rr],Yr=Be[2*Rr+1];wf(jr,Yr,D,K)<=Pt&&mt.push(Ee[Rr]),(Xt===0?D-he<=jr:K-he<=Yr)&&(nt.push(br),nt.push(Rr-1),nt.push(1-Xt)),(Xt===0?D+he>=jr:K+he>=Yr)&&(nt.push(Rr+1),nt.push(er),nt.push(1-Xt))}return mt}}function Cg(H,D,K,he,Ee,Be){if(Ee-he<=K)return;const Ve=he+Ee>>1;Cm(H,D,Ve,he,Ee,Be),Cg(H,D,K,he,Ve-1,1-Be),Cg(H,D,K,Ve+1,Ee,1-Be)}function Cm(H,D,K,he,Ee,Be){for(;Ee>he;){if(Ee-he>600){const Pt=Ee-he+1,Xt=K-he+1,er=Math.log(Pt),br=.5*Math.exp(2*er/3),Rr=.5*Math.sqrt(er*br*(Pt-br)/Pt)*(Xt-Pt/2<0?-1:1);Cm(H,D,K,Math.max(he,Math.floor(K-Xt*br/Pt+Rr)),Math.min(Ee,Math.floor(K+(Pt-Xt)*br/Pt+Rr)),Be)}const Ve=D[2*K+Be];let nt=he,mt=Ee;for(Ed(H,D,he,K),D[2*Ee+Be]>Ve&&Ed(H,D,he,Ee);ntVe;)mt--}D[2*he+Be]===Ve?Ed(H,D,he,mt):(mt++,Ed(H,D,mt,Ee)),mt<=K&&(he=mt+1),K<=mt&&(Ee=mt-1)}}function Ed(H,D,K,he){p0(H,K,he),p0(D,2*K,2*he),p0(D,2*K+1,2*he+1)}function p0(H,D,K){const he=H[D];H[D]=H[K],H[K]=he}function wf(H,D,K,he){const Ee=H-K,Be=D-he;return Ee*Ee+Be*Be}var Lg;e.bg=void 0,(Lg=e.bg||(e.bg={})).create="create",Lg.load="load",Lg.fullLoad="fullLoad";let g0=null,kd=[];const Pg=1e3/60,y0="loadTime",Ig="fullLoadTime",Lm={mark(H){performance.mark(H)},frame(H){const D=H;g0!=null&&kd.push(D-g0),g0=D},clearMetrics(){g0=null,kd=[],performance.clearMeasures(y0),performance.clearMeasures(Ig);for(const H in e.bg)performance.clearMarks(e.bg[H])},getPerformanceMetrics(){performance.measure(y0,e.bg.create,e.bg.load),performance.measure(Ig,e.bg.create,e.bg.fullLoad);const H=performance.getEntriesByName(y0)[0].duration,D=performance.getEntriesByName(Ig)[0].duration,K=kd.length,he=1/(kd.reduce((Be,Ve)=>Be+Ve,0)/K/1e3),Ee=kd.filter(Be=>Be>Pg).reduce((Be,Ve)=>Be+(Ve-Pg)/Pg,0);return{loadTime:H,fullLoadTime:D,fps:he,percentDroppedFrames:Ee/(K+Ee)*100,totalFrames:K}}};e.$=class extends nr{},e.A=$i,e.B=sn,e.C=function(H){if(z==null){const D=H.navigator?H.navigator.userAgent:null;z=!!H.safari||!(!D||!(/\b(iPad|iPhone|iPod)\b/.test(D)||D.match("Safari")&&!D.match("Chrome")))}return z},e.D=Vi,e.E=ae,e.F=class{constructor(H,D){this.target=H,this.mapId=D,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new yp(()=>this.process()),this.subscription=function(K,he,Ee,Be){return K.addEventListener(he,Ee,!1),{unsubscribe:()=>{K.removeEventListener(he,Ee,!1)}}}(this.target,"message",K=>this.receive(K)),this.globalScope=P(self)?H:window}registerMessageHandler(H,D){this.messageHandlers[H]=D}sendAsync(H,D){return new Promise((K,he)=>{const Ee=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[Ee]={resolve:K,reject:he},D&&D.signal.addEventListener("abort",()=>{delete this.resolveRejects[Ee];const nt={id:Ee,type:"",origin:location.origin,targetMapId:H.targetMapId,sourceMapId:this.mapId};this.target.postMessage(nt)},{once:!0});const Be=[],Ve=Object.assign(Object.assign({},H),{id:Ee,sourceMapId:this.mapId,origin:location.origin,data:ji(H.data,Be)});this.target.postMessage(Ve,{transfer:Be})})}receive(H){const D=H.data,K=D.id;if(!(D.origin!=="file://"&&location.origin!=="file://"&&D.origin!=="resource://android"&&location.origin!=="resource://android"&&D.origin!==location.origin||D.targetMapId&&this.mapId!==D.targetMapId)){if(D.type===""){delete this.tasks[K];const he=this.abortControllers[K];return delete this.abortControllers[K],void(he&&he.abort())}if(P(self)||D.mustQueue)return this.tasks[K]=D,this.taskQueue.push(K),void this.invoker.trigger();this.processTask(K,D)}}process(){if(this.taskQueue.length===0)return;const H=this.taskQueue.shift(),D=this.tasks[H];delete this.tasks[H],this.taskQueue.length>0&&this.invoker.trigger(),D&&this.processTask(H,D)}processTask(H,D){return t(this,void 0,void 0,function*(){if(D.type===""){const Ee=this.resolveRejects[H];return delete this.resolveRejects[H],Ee?void(D.error?Ee.reject(Ni(D.error)):Ee.resolve(Ni(D.data))):void 0}if(!this.messageHandlers[D.type])return void this.completeTask(H,new Error(`Could not find a registered handler for ${D.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const K=Ni(D.data),he=new AbortController;this.abortControllers[H]=he;try{const Ee=yield this.messageHandlers[D.type](D.sourceMapId,K,he);this.completeTask(H,null,Ee)}catch(Ee){this.completeTask(H,Ee)}})}completeTask(H,D,K){const he=[];delete this.abortControllers[H];const Ee={id:H,type:"",sourceMapId:this.mapId,origin:location.origin,error:D?ji(D):null,data:ji(K,he)};this.target.postMessage(Ee,{transfer:he})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=oe,e.H=function(){var H=new $i(16);return $i!=Float32Array&&(H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[11]=0,H[12]=0,H[13]=0,H[14]=0),H[0]=1,H[5]=1,H[10]=1,H[15]=1,H},e.I=bf,e.J=function(H,D,K){var he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr=K[0],ca=K[1],Ca=K[2];return D===H?(H[12]=D[0]*Yr+D[4]*ca+D[8]*Ca+D[12],H[13]=D[1]*Yr+D[5]*ca+D[9]*Ca+D[13],H[14]=D[2]*Yr+D[6]*ca+D[10]*Ca+D[14],H[15]=D[3]*Yr+D[7]*ca+D[11]*Ca+D[15]):(Ee=D[1],Be=D[2],Ve=D[3],nt=D[4],mt=D[5],Pt=D[6],Xt=D[7],er=D[8],br=D[9],Rr=D[10],jr=D[11],H[0]=he=D[0],H[1]=Ee,H[2]=Be,H[3]=Ve,H[4]=nt,H[5]=mt,H[6]=Pt,H[7]=Xt,H[8]=er,H[9]=br,H[10]=Rr,H[11]=jr,H[12]=he*Yr+nt*ca+er*Ca+D[12],H[13]=Ee*Yr+mt*ca+br*Ca+D[13],H[14]=Be*Yr+Pt*ca+Rr*Ca+D[14],H[15]=Ve*Yr+Xt*ca+jr*Ca+D[15]),H},e.K=function(H,D,K){var he=K[0],Ee=K[1],Be=K[2];return H[0]=D[0]*he,H[1]=D[1]*he,H[2]=D[2]*he,H[3]=D[3]*he,H[4]=D[4]*Ee,H[5]=D[5]*Ee,H[6]=D[6]*Ee,H[7]=D[7]*Ee,H[8]=D[8]*Be,H[9]=D[9]*Be,H[10]=D[10]*Be,H[11]=D[11]*Be,H[12]=D[12],H[13]=D[13],H[14]=D[14],H[15]=D[15],H},e.L=Mn,e.M=function(H,D){const K={};for(let he=0;he{const D=window.document.createElement("video");return D.muted=!0,new Promise(K=>{D.onloadstart=()=>{K(D)};for(const he of H){const Ee=window.document.createElement("source");$(he)||(D.crossOrigin="Anonymous"),Ee.src=he,D.appendChild(Ee)}})},e.a4=function(){return _++},e.a5=ln,e.a6=$v,e.a7=Ec,e.a8=fa,e.a9=vm,e.aA=function(H){if(H.type==="custom")return new sm(H);switch(H.type){case"background":return new gp(H);case"circle":return new ri(H);case"fill":return new Ea(H);case"fill-extrusion":return new ph(H);case"heatmap":return new dl(H);case"hillshade":return new Lc(H);case"line":return new Xv(H);case"raster":return new Ox(H);case"symbol":return new u0(H)}},e.aB=u,e.aC=function(H,D){if(!H)return[{command:"setStyle",args:[D]}];let K=[];try{if(!Ae(H.version,D.version))return[{command:"setStyle",args:[D]}];Ae(H.center,D.center)||K.push({command:"setCenter",args:[D.center]}),Ae(H.zoom,D.zoom)||K.push({command:"setZoom",args:[D.zoom]}),Ae(H.bearing,D.bearing)||K.push({command:"setBearing",args:[D.bearing]}),Ae(H.pitch,D.pitch)||K.push({command:"setPitch",args:[D.pitch]}),Ae(H.sprite,D.sprite)||K.push({command:"setSprite",args:[D.sprite]}),Ae(H.glyphs,D.glyphs)||K.push({command:"setGlyphs",args:[D.glyphs]}),Ae(H.transition,D.transition)||K.push({command:"setTransition",args:[D.transition]}),Ae(H.light,D.light)||K.push({command:"setLight",args:[D.light]}),Ae(H.terrain,D.terrain)||K.push({command:"setTerrain",args:[D.terrain]}),Ae(H.sky,D.sky)||K.push({command:"setSky",args:[D.sky]}),Ae(H.projection,D.projection)||K.push({command:"setProjection",args:[D.projection]});const he={},Ee=[];(function(Ve,nt,mt,Pt){let Xt;for(Xt in nt=nt||{},Ve=Ve||{})Object.prototype.hasOwnProperty.call(Ve,Xt)&&(Object.prototype.hasOwnProperty.call(nt,Xt)||qe(Xt,mt,Pt));for(Xt in nt)Object.prototype.hasOwnProperty.call(nt,Xt)&&(Object.prototype.hasOwnProperty.call(Ve,Xt)?Ae(Ve[Xt],nt[Xt])||(Ve[Xt].type==="geojson"&&nt[Xt].type==="geojson"&&Qe(Ve,nt,Xt)?Fe(mt,{command:"setGeoJSONSourceData",args:[Xt,nt[Xt].data]}):et(Xt,nt,mt,Pt)):Ce(Xt,nt,mt))})(H.sources,D.sources,Ee,he);const Be=[];H.layers&&H.layers.forEach(Ve=>{"source"in Ve&&he[Ve.source]?K.push({command:"removeLayer",args:[Ve.id]}):Be.push(Ve)}),K=K.concat(Ee),function(Ve,nt,mt){nt=nt||[];const Pt=(Ve=Ve||[]).map(Xe),Xt=nt.map(Xe),er=Ve.reduce(Me,{}),br=nt.reduce(Me,{}),Rr=Pt.slice(),jr=Object.create(null);let Yr,ca,Ca,un,Ha;for(let rn=0,Sn=0;rn@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(K,he,Ee,Be)=>{const Ve=Ee||Be;return D[he]=!Ve||Ve.toLowerCase(),""}),D["max-age"]){const K=parseInt(D["max-age"],10);isNaN(K)?delete D["max-age"]:D["max-age"]=K}return D},e.ab=function(H,D){const K=[];for(const he in H)he in D||K.push(he);return K},e.ac=b,e.ad=function(H,D,K){var he=Math.sin(K),Ee=Math.cos(K),Be=D[0],Ve=D[1],nt=D[2],mt=D[3],Pt=D[4],Xt=D[5],er=D[6],br=D[7];return D!==H&&(H[8]=D[8],H[9]=D[9],H[10]=D[10],H[11]=D[11],H[12]=D[12],H[13]=D[13],H[14]=D[14],H[15]=D[15]),H[0]=Be*Ee+Pt*he,H[1]=Ve*Ee+Xt*he,H[2]=nt*Ee+er*he,H[3]=mt*Ee+br*he,H[4]=Pt*Ee-Be*he,H[5]=Xt*Ee-Ve*he,H[6]=er*Ee-nt*he,H[7]=br*Ee-mt*he,H},e.ae=function(H){var D=new $i(16);return D[0]=H[0],D[1]=H[1],D[2]=H[2],D[3]=H[3],D[4]=H[4],D[5]=H[5],D[6]=H[6],D[7]=H[7],D[8]=H[8],D[9]=H[9],D[10]=H[10],D[11]=H[11],D[12]=H[12],D[13]=H[13],D[14]=H[14],D[15]=H[15],D},e.af=gi,e.ag=function(H,D){let K=0,he=0;if(H.kind==="constant")he=H.layoutSize;else if(H.kind!=="source"){const{interpolationType:Ee,minZoom:Be,maxZoom:Ve}=H,nt=Ee?b(ci.interpolationFactor(Ee,D,Be,Ve),0,1):0;H.kind==="camera"?he=Ci.number(H.minSize,H.maxSize,nt):K=nt}return{uSizeT:K,uSize:he}},e.ai=function(H,{uSize:D,uSizeT:K},{lowerSize:he,upperSize:Ee}){return H.kind==="source"?he/$h:H.kind==="composite"?Ci.number(he/$h,Ee/$h,K):D},e.aj=zv,e.ak=function(H,D,K,he){const Ee=D.y-H.y,Be=D.x-H.x,Ve=he.y-K.y,nt=he.x-K.x,mt=Ve*Be-nt*Ee;if(mt===0)return null;const Pt=(nt*(H.y-K.y)-Ve*(H.x-K.x))/mt;return new i(H.x+Pt*Be,H.y+Pt*Ee)},e.al=ym,e.am=In,e.an=Cn,e.ao=function(H){let D=1/0,K=1/0,he=-1/0,Ee=-1/0;for(const Be of H)D=Math.min(D,Be.x),K=Math.min(K,Be.y),he=Math.max(he,Be.x),Ee=Math.max(Ee,Be.y);return[D,K,he,Ee]},e.ap=pl,e.ar=yg,e.as=function(H,D){var K=D[0],he=D[1],Ee=D[2],Be=D[3],Ve=D[4],nt=D[5],mt=D[6],Pt=D[7],Xt=D[8],er=D[9],br=D[10],Rr=D[11],jr=D[12],Yr=D[13],ca=D[14],Ca=D[15],un=K*nt-he*Ve,Ha=K*mt-Ee*Ve,rn=K*Pt-Be*Ve,Sn=he*mt-Ee*nt,$n=he*Pt-Be*nt,Oi=Ee*Pt-Be*mt,qo=Xt*Yr-er*jr,qi=Xt*ca-br*jr,Di=Xt*Ca-Rr*jr,mo=er*ca-br*Yr,so=er*Ca-Rr*Yr,to=br*Ca-Rr*ca,zn=un*to-Ha*so+rn*mo+Sn*Di-$n*qi+Oi*qo;return zn?(H[0]=(nt*to-mt*so+Pt*mo)*(zn=1/zn),H[1]=(Ee*so-he*to-Be*mo)*zn,H[2]=(Yr*Oi-ca*$n+Ca*Sn)*zn,H[3]=(br*$n-er*Oi-Rr*Sn)*zn,H[4]=(mt*Di-Ve*to-Pt*qi)*zn,H[5]=(K*to-Ee*Di+Be*qi)*zn,H[6]=(ca*rn-jr*Oi-Ca*Ha)*zn,H[7]=(Xt*Oi-br*rn+Rr*Ha)*zn,H[8]=(Ve*so-nt*Di+Pt*qo)*zn,H[9]=(he*Di-K*so-Be*qo)*zn,H[10]=(jr*$n-Yr*rn+Ca*un)*zn,H[11]=(er*rn-Xt*$n-Rr*un)*zn,H[12]=(nt*qi-Ve*mo-mt*qo)*zn,H[13]=(K*mo-he*qi+Ee*qo)*zn,H[14]=(Yr*Ha-jr*Sn-ca*un)*zn,H[15]=(Xt*Sn-er*Ha+br*un)*zn,H):null},e.at=Eg,e.au=gg,e.av=kg,e.aw=function(){const H={},D=ie.$version;for(const K in ie.$root){const he=ie.$root[K];if(he.required){let Ee=null;Ee=K==="version"?D:he.type==="array"?[]:{},Ee!=null&&(H[K]=Ee)}}return H},e.ax=Bn,e.ay=j,e.az=function(H){H=H.slice();const D=Object.create(null);for(let K=0;K25||he<0||he>=1||K<0||K>=1)},e.bc=function(H,D){return H[0]=D[0],H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[5]=D[1],H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[10]=D[2],H[11]=0,H[12]=0,H[13]=0,H[14]=0,H[15]=1,H},e.bd=class extends Wt{},e.be=wg,e.bf=Lm,e.bh=le,e.bi=function(H,D){Q.REGISTERED_PROTOCOLS[H]=D},e.bj=function(H){delete Q.REGISTERED_PROTOCOLS[H]},e.bk=function(H,D){const K={};for(let Ee=0;Eeto*pl)}let qi=Ve?"center":K.get("text-justify").evaluate(Pt,{},H.canonical);const Di=K.get("symbol-placement")==="point"?K.get("text-max-width").evaluate(Pt,{},H.canonical)*pl:1/0,mo=()=>{H.bucket.allowVerticalPlacement&&Ki(rn)&&(jr.vertical=n0(Yr,H.glyphMap,H.glyphPositions,H.imagePositions,Xt,Di,Be,Oi,"left",$n,Ca,e.ah.vertical,!0,br,er))};if(!Ve&&qo){const so=new Set;if(qi==="auto")for(let zn=0;znt(void 0,void 0,void 0,function*(){if(H.byteLength===0)return createImageBitmap(new ImageData(1,1));const D=new Blob([new Uint8Array(H)],{type:"image/png"});try{return createImageBitmap(D)}catch(K){throw new Error(`Could not load image because of ${K.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),e.e=M,e.f=H=>new Promise((D,K)=>{const he=new Image;he.onload=()=>{D(he),URL.revokeObjectURL(he.src),he.onload=null,window.requestAnimationFrame(()=>{he.src=B})},he.onerror=()=>K(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."));const Ee=new Blob([new Uint8Array(H)],{type:"image/png"});he.src=H.byteLength?URL.createObjectURL(Ee):B}),e.g=ue,e.h=(H,D)=>J(M(H,{type:"json"}),D),e.i=P,e.j=q,e.k=ee,e.l=(H,D)=>J(M(H,{type:"arrayBuffer"}),D),e.m=J,e.n=function(H){return new hg(H).readFields(Lx,[])},e.o=xs,e.p=a0,e.q=De,e.r=ja,e.s=$,e.t=Ja,e.u=Fa,e.v=ie,e.w=m,e.x=function([H,D,K]){return D+=90,D*=Math.PI/180,K*=Math.PI/180,{x:H*Math.cos(D)*Math.sin(K),y:H*Math.sin(D)*Math.sin(K),z:H*Math.cos(K)}},e.y=Ci,e.z=Jo}),A("worker",["./shared"],function(e){class t{constructor(ze){this.keyCache={},ze&&this.replace(ze)}replace(ze){this._layerConfigs={},this._layers={},this.update(ze,[])}update(ze,Ge){for(const ve of ze){this._layerConfigs[ve.id]=ve;const ge=this._layers[ve.id]=e.aA(ve);ge._featureFilter=e.a7(ge.filter),this.keyCache[ve.id]&&delete this.keyCache[ve.id]}for(const ve of Ge)delete this.keyCache[ve],delete this._layerConfigs[ve],delete this._layers[ve];this.familiesBySource={};const Oe=e.bk(Object.values(this._layerConfigs),this.keyCache);for(const ve of Oe){const ge=ve.map(Mt=>this._layers[Mt.id]),be=ge[0];if(be.visibility==="none")continue;const Pe=be.source||"";let We=this.familiesBySource[Pe];We||(We=this.familiesBySource[Pe]={});const ct=be.sourceLayer||"_geojsonTileLayer";let _t=We[ct];_t||(_t=We[ct]=[]),_t.push(ge)}}}class r{constructor(ze){const Ge={},Oe=[];for(const Pe in ze){const We=ze[Pe],ct=Ge[Pe]={};for(const _t in We){const Mt=We[+_t];if(!Mt||Mt.bitmap.width===0||Mt.bitmap.height===0)continue;const Nt={x:0,y:0,w:Mt.bitmap.width+2,h:Mt.bitmap.height+2};Oe.push(Nt),ct[_t]={rect:Nt,metrics:Mt.metrics}}}const{w:ve,h:ge}=e.p(Oe),be=new e.o({width:ve||1,height:ge||1});for(const Pe in ze){const We=ze[Pe];for(const ct in We){const _t=We[+ct];if(!_t||_t.bitmap.width===0||_t.bitmap.height===0)continue;const Mt=Ge[Pe][ct].rect;e.o.copy(_t.bitmap,be,{x:0,y:0},{x:Mt.x+1,y:Mt.y+1},_t.bitmap)}}this.image=be,this.positions=Ge}}e.bl("GlyphAtlas",r);class o{constructor(ze){this.tileID=new e.S(ze.tileID.overscaledZ,ze.tileID.wrap,ze.tileID.canonical.z,ze.tileID.canonical.x,ze.tileID.canonical.y),this.uid=ze.uid,this.zoom=ze.zoom,this.pixelRatio=ze.pixelRatio,this.tileSize=ze.tileSize,this.source=ze.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=ze.showCollisionBoxes,this.collectResourceTiming=!!ze.collectResourceTiming,this.returnDependencies=!!ze.returnDependencies,this.promoteId=ze.promoteId,this.inFlightDependencies=[]}parse(ze,Ge,Oe,ve){return e._(this,void 0,void 0,function*(){this.status="parsing",this.data=ze,this.collisionBoxArray=new e.a5;const ge=new e.bm(Object.keys(ze.layers).sort()),be=new e.bn(this.tileID,this.promoteId);be.bucketLayerIDs=[];const Pe={},We={featureIndex:be,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Oe},ct=Ge.familiesBySource[this.source];for(const Ia in ct){const va=ze.layers[Ia];if(!va)continue;va.version===1&&e.w(`Vector tile source "${this.source}" layer "${Ia}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const La=ge.encode(Ia),Ka=[];for(let Vt=0;Vt=Lt.maxzoom||Lt.visibility!=="none"&&(a(Vt,this.zoom,Oe),(Pe[Lt.id]=Lt.createBucket({index:be.bucketLayerIDs.length,layers:Vt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:La,sourceID:this.source})).populate(Ka,We,this.tileID.canonical),be.bucketLayerIDs.push(Vt.map(jt=>jt.id)))}}const _t=e.aF(We.glyphDependencies,Ia=>Object.keys(Ia).map(Number));this.inFlightDependencies.forEach(Ia=>Ia==null?void 0:Ia.abort()),this.inFlightDependencies=[];let Mt=Promise.resolve({});if(Object.keys(_t).length){const Ia=new AbortController;this.inFlightDependencies.push(Ia),Mt=ve.sendAsync({type:"GG",data:{stacks:_t,source:this.source,tileID:this.tileID,type:"glyphs"}},Ia)}const Nt=Object.keys(We.iconDependencies);let Bt=Promise.resolve({});if(Nt.length){const Ia=new AbortController;this.inFlightDependencies.push(Ia),Bt=ve.sendAsync({type:"GI",data:{icons:Nt,source:this.source,tileID:this.tileID,type:"icons"}},Ia)}const qt=Object.keys(We.patternDependencies);let Zt=Promise.resolve({});if(qt.length){const Ia=new AbortController;this.inFlightDependencies.push(Ia),Zt=ve.sendAsync({type:"GI",data:{icons:qt,source:this.source,tileID:this.tileID,type:"patterns"}},Ia)}const[lr,ta,da]=yield Promise.all([Mt,Bt,Zt]),wa=new r(lr),ma=new e.bo(ta,da);for(const Ia in Pe){const va=Pe[Ia];va instanceof e.a6?(a(va.layers,this.zoom,Oe),e.bp({bucket:va,glyphMap:lr,glyphPositions:wa.positions,imageMap:ta,imagePositions:ma.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):va.hasPattern&&(va instanceof e.bq||va instanceof e.br||va instanceof e.bs)&&(a(va.layers,this.zoom,Oe),va.addFeatures(We,this.tileID.canonical,ma.patternPositions))}return this.status="done",{buckets:Object.values(Pe).filter(Ia=>!Ia.isEmpty()),featureIndex:be,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:wa.image,imageAtlas:ma,glyphMap:this.returnDependencies?lr:null,iconMap:this.returnDependencies?ta:null,glyphPositions:this.returnDependencies?wa.positions:null}})}}function a(pt,ze,Ge){const Oe=new e.z(ze);for(const ve of pt)ve.recalculate(Oe,Ge)}class i{constructor(ze,Ge,Oe){this.actor=ze,this.layerIndex=Ge,this.availableImages=Oe,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(ze,Ge){return e._(this,void 0,void 0,function*(){const Oe=yield e.l(ze.request,Ge);try{return{vectorTile:new e.bt.VectorTile(new e.bu(Oe.data)),rawData:Oe.data,cacheControl:Oe.cacheControl,expires:Oe.expires}}catch(ve){const ge=new Uint8Array(Oe.data);let be=`Unable to parse the tile at ${ze.request.url}, `;throw be+=ge[0]===31&&ge[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${ve.message}`,new Error(be)}})}loadTile(ze){return e._(this,void 0,void 0,function*(){const Ge=ze.uid,Oe=!!(ze&&ze.request&&ze.request.collectResourceTiming)&&new e.bv(ze.request),ve=new o(ze);this.loading[Ge]=ve;const ge=new AbortController;ve.abort=ge;try{const be=yield this.loadVectorTile(ze,ge);if(delete this.loading[Ge],!be)return null;const Pe=be.rawData,We={};be.expires&&(We.expires=be.expires),be.cacheControl&&(We.cacheControl=be.cacheControl);const ct={};if(Oe){const Mt=Oe.finish();Mt&&(ct.resourceTiming=JSON.parse(JSON.stringify(Mt)))}ve.vectorTile=be.vectorTile;const _t=ve.parse(be.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[Ge]=ve,this.fetching[Ge]={rawTileData:Pe,cacheControl:We,resourceTiming:ct};try{const Mt=yield _t;return e.e({rawTileData:Pe.slice(0)},Mt,We,ct)}finally{delete this.fetching[Ge]}}catch(be){throw delete this.loading[Ge],ve.status="done",this.loaded[Ge]=ve,be}})}reloadTile(ze){return e._(this,void 0,void 0,function*(){const Ge=ze.uid;if(!this.loaded||!this.loaded[Ge])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const Oe=this.loaded[Ge];if(Oe.showCollisionBoxes=ze.showCollisionBoxes,Oe.status==="parsing"){const ve=yield Oe.parse(Oe.vectorTile,this.layerIndex,this.availableImages,this.actor);let ge;if(this.fetching[Ge]){const{rawTileData:be,cacheControl:Pe,resourceTiming:We}=this.fetching[Ge];delete this.fetching[Ge],ge=e.e({rawTileData:be.slice(0)},ve,Pe,We)}else ge=ve;return ge}if(Oe.status==="done"&&Oe.vectorTile)return Oe.parse(Oe.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(ze){return e._(this,void 0,void 0,function*(){const Ge=this.loading,Oe=ze.uid;Ge&&Ge[Oe]&&Ge[Oe].abort&&(Ge[Oe].abort.abort(),delete Ge[Oe])})}removeTile(ze){return e._(this,void 0,void 0,function*(){this.loaded&&this.loaded[ze.uid]&&delete this.loaded[ze.uid]})}}class n{constructor(){this.loaded={}}loadTile(ze){return e._(this,void 0,void 0,function*(){const{uid:Ge,encoding:Oe,rawImageData:ve,redFactor:ge,greenFactor:be,blueFactor:Pe,baseShift:We}=ze,ct=ve.width+2,_t=ve.height+2,Mt=e.b(ve)?new e.R({width:ct,height:_t},yield e.bw(ve,-1,-1,ct,_t)):ve,Nt=new e.bx(Ge,Mt,Oe,ge,be,Pe,We);return this.loaded=this.loaded||{},this.loaded[Ge]=Nt,Nt})}removeTile(ze){const Ge=this.loaded,Oe=ze.uid;Ge&&Ge[Oe]&&delete Ge[Oe]}}function s(pt,ze){if(pt.length!==0){c(pt[0],ze);for(var Ge=1;Ge=Math.abs(Pe)?Ge-We+Pe:Pe-We+Ge,Ge=We}Ge+Oe>=0!=!!ze&&pt.reverse()}var f=e.by(function pt(ze,Ge){var Oe,ve=ze&&ze.type;if(ve==="FeatureCollection")for(Oe=0;Oe>31}function P(pt,ze){for(var Ge=pt.loadGeometry(),Oe=pt.type,ve=0,ge=0,be=Ge.length,Pe=0;Pept},O=Math.fround||(L=new Float32Array(1),pt=>(L[0]=+pt,L[0]));var L;const N=3,U=5,Z=6;class Q{constructor(ze){this.options=Object.assign(Object.create(B),ze),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(ze){const{log:Ge,minZoom:Oe,maxZoom:ve}=this.options;Ge&&console.time("total time");const ge=`prepare ${ze.length} points`;Ge&&console.time(ge),this.points=ze;const be=[];for(let We=0;We=Oe;We--){const ct=+Date.now();Pe=this.trees[We]=this._createTree(this._cluster(Pe,We)),Ge&&console.log("z%d: %d clusters in %dms",We,Pe.numItems,+Date.now()-ct)}return Ge&&console.timeEnd("total time"),this}getClusters(ze,Ge){let Oe=((ze[0]+180)%360+360)%360-180;const ve=Math.max(-90,Math.min(90,ze[1]));let ge=ze[2]===180?180:((ze[2]+180)%360+360)%360-180;const be=Math.max(-90,Math.min(90,ze[3]));if(ze[2]-ze[0]>=360)Oe=-180,ge=180;else if(Oe>ge){const Mt=this.getClusters([Oe,ve,180,be],Ge),Nt=this.getClusters([-180,ve,ge,be],Ge);return Mt.concat(Nt)}const Pe=this.trees[this._limitZoom(Ge)],We=Pe.range(le(Oe),j(be),le(ge),j(ve)),ct=Pe.data,_t=[];for(const Mt of We){const Nt=this.stride*Mt;_t.push(ct[Nt+U]>1?ue(ct,Nt,this.clusterProps):this.points[ct[Nt+N]])}return _t}getChildren(ze){const Ge=this._getOriginId(ze),Oe=this._getOriginZoom(ze),ve="No cluster with the specified id.",ge=this.trees[Oe];if(!ge)throw new Error(ve);const be=ge.data;if(Ge*this.stride>=be.length)throw new Error(ve);const Pe=this.options.radius/(this.options.extent*Math.pow(2,Oe-1)),We=ge.within(be[Ge*this.stride],be[Ge*this.stride+1],Pe),ct=[];for(const _t of We){const Mt=_t*this.stride;be[Mt+4]===ze&&ct.push(be[Mt+U]>1?ue(be,Mt,this.clusterProps):this.points[be[Mt+N]])}if(ct.length===0)throw new Error(ve);return ct}getLeaves(ze,Ge,Oe){const ve=[];return this._appendLeaves(ve,ze,Ge=Ge||10,Oe=Oe||0,0),ve}getTile(ze,Ge,Oe){const ve=this.trees[this._limitZoom(ze)],ge=Math.pow(2,ze),{extent:be,radius:Pe}=this.options,We=Pe/be,ct=(Oe-We)/ge,_t=(Oe+1+We)/ge,Mt={features:[]};return this._addTileFeatures(ve.range((Ge-We)/ge,ct,(Ge+1+We)/ge,_t),ve.data,Ge,Oe,ge,Mt),Ge===0&&this._addTileFeatures(ve.range(1-We/ge,ct,1,_t),ve.data,ge,Oe,ge,Mt),Ge===ge-1&&this._addTileFeatures(ve.range(0,ct,We/ge,_t),ve.data,-1,Oe,ge,Mt),Mt.features.length?Mt:null}getClusterExpansionZoom(ze){let Ge=this._getOriginZoom(ze)-1;for(;Ge<=this.options.maxZoom;){const Oe=this.getChildren(ze);if(Ge++,Oe.length!==1)break;ze=Oe[0].properties.cluster_id}return Ge}_appendLeaves(ze,Ge,Oe,ve,ge){const be=this.getChildren(Ge);for(const Pe of be){const We=Pe.properties;if(We&&We.cluster?ge+We.point_count<=ve?ge+=We.point_count:ge=this._appendLeaves(ze,We.cluster_id,Oe,ve,ge):ge1;let _t,Mt,Nt;if(ct)_t=oe(Ge,We,this.clusterProps),Mt=Ge[We],Nt=Ge[We+1];else{const Zt=this.points[Ge[We+N]];_t=Zt.properties;const[lr,ta]=Zt.geometry.coordinates;Mt=le(lr),Nt=j(ta)}const Bt={type:1,geometry:[[Math.round(this.options.extent*(Mt*ge-Oe)),Math.round(this.options.extent*(Nt*ge-ve))]],tags:_t};let qt;qt=ct||this.options.generateId?Ge[We+N]:this.points[Ge[We+N]].id,qt!==void 0&&(Bt.id=qt),be.features.push(Bt)}}_limitZoom(ze){return Math.max(this.options.minZoom,Math.min(Math.floor(+ze),this.options.maxZoom+1))}_cluster(ze,Ge){const{radius:Oe,extent:ve,reduce:ge,minPoints:be}=this.options,Pe=Oe/(ve*Math.pow(2,Ge)),We=ze.data,ct=[],_t=this.stride;for(let Mt=0;MtGe&&(lr+=We[da+U])}if(lr>Zt&&lr>=be){let ta,da=Nt*Zt,wa=Bt*Zt,ma=-1;const Ia=((Mt/_t|0)<<5)+(Ge+1)+this.points.length;for(const va of qt){const La=va*_t;if(We[La+2]<=Ge)continue;We[La+2]=Ge;const Ka=We[La+U];da+=We[La]*Ka,wa+=We[La+1]*Ka,We[La+4]=Ia,ge&&(ta||(ta=this._map(We,Mt,!0),ma=this.clusterProps.length,this.clusterProps.push(ta)),ge(ta,this._map(We,La)))}We[Mt+4]=Ia,ct.push(da/lr,wa/lr,1/0,Ia,-1,lr),ge&&ct.push(ma)}else{for(let ta=0;ta<_t;ta++)ct.push(We[Mt+ta]);if(lr>1)for(const ta of qt){const da=ta*_t;if(!(We[da+2]<=Ge)){We[da+2]=Ge;for(let wa=0;wa<_t;wa++)ct.push(We[da+wa])}}}}return ct}_getOriginId(ze){return ze-this.points.length>>5}_getOriginZoom(ze){return(ze-this.points.length)%32}_map(ze,Ge,Oe){if(ze[Ge+U]>1){const be=this.clusterProps[ze[Ge+Z]];return Oe?Object.assign({},be):be}const ve=this.points[ze[Ge+N]].properties,ge=this.options.map(ve);return Oe&&ge===ve?Object.assign({},ge):ge}}function ue(pt,ze,Ge){return{type:"Feature",id:pt[ze+N],properties:oe(pt,ze,Ge),geometry:{type:"Point",coordinates:[(Oe=pt[ze],360*(Oe-.5)),J(pt[ze+1])]}};var Oe}function oe(pt,ze,Ge){const Oe=pt[ze+U],ve=Oe>=1e4?`${Math.round(Oe/1e3)}k`:Oe>=1e3?Math.round(Oe/100)/10+"k":Oe,ge=pt[ze+Z],be=ge===-1?{}:Object.assign({},Ge[ge]);return Object.assign(be,{cluster:!0,cluster_id:pt[ze+N],point_count:Oe,point_count_abbreviated:ve})}function le(pt){return pt/360+.5}function j(pt){const ze=Math.sin(pt*Math.PI/180),Ge=.5-.25*Math.log((1+ze)/(1-ze))/Math.PI;return Ge<0?0:Ge>1?1:Ge}function J(pt){const ze=(180-360*pt)*Math.PI/180;return 360*Math.atan(Math.exp(ze))/Math.PI-90}function $(pt,ze,Ge,Oe){let ve=Oe;const ge=ze+(Ge-ze>>1);let be,Pe=Ge-ze;const We=pt[ze],ct=pt[ze+1],_t=pt[Ge],Mt=pt[Ge+1];for(let Nt=ze+3;Ntve)be=Nt,ve=Bt;else if(Bt===ve){const qt=Math.abs(Nt-ge);qtOe&&(be-ze>3&&$(pt,ze,be,Oe),pt[be+2]=ve,Ge-be>3&&$(pt,be,Ge,Oe))}function X(pt,ze,Ge,Oe,ve,ge){let be=ve-Ge,Pe=ge-Oe;if(be!==0||Pe!==0){const We=((pt-Ge)*be+(ze-Oe)*Pe)/(be*be+Pe*Pe);We>1?(Ge=ve,Oe=ge):We>0&&(Ge+=be*We,Oe+=Pe*We)}return be=pt-Ge,Pe=ze-Oe,be*be+Pe*Pe}function re(pt,ze,Ge,Oe){const ve={id:pt??null,type:ze,geometry:Ge,tags:Oe,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(ze==="Point"||ze==="MultiPoint"||ze==="LineString")ee(ve,Ge);else if(ze==="Polygon")ee(ve,Ge[0]);else if(ze==="MultiLineString")for(const ge of Ge)ee(ve,ge);else if(ze==="MultiPolygon")for(const ge of Ge)ee(ve,ge[0]);return ve}function ee(pt,ze){for(let Ge=0;Ge0&&(be+=Oe?(ve*_t-ct*ge)/2:Math.sqrt(Math.pow(ct-ve,2)+Math.pow(_t-ge,2))),ve=ct,ge=_t}const Pe=ze.length-3;ze[2]=1,$(ze,0,Pe,Ge),ze[Pe+2]=1,ze.size=Math.abs(be),ze.start=0,ze.end=ze.size}function fe(pt,ze,Ge,Oe){for(let ve=0;ve1?1:Ge}function Fe(pt,ze,Ge,Oe,ve,ge,be,Pe){if(Oe/=ze,ge>=(Ge/=ze)&&be=Oe)return null;const We=[];for(const ct of pt){const _t=ct.geometry;let Mt=ct.type;const Nt=ve===0?ct.minX:ct.minY,Bt=ve===0?ct.maxX:ct.maxY;if(Nt>=Ge&&Bt=Oe)continue;let qt=[];if(Mt==="Point"||Mt==="MultiPoint")Ce(_t,qt,Ge,Oe,ve);else if(Mt==="LineString")qe(_t,qt,Ge,Oe,ve,!1,Pe.lineMetrics);else if(Mt==="MultiLineString")Qe(_t,qt,Ge,Oe,ve,!1);else if(Mt==="Polygon")Qe(_t,qt,Ge,Oe,ve,!0);else if(Mt==="MultiPolygon")for(const Zt of _t){const lr=[];Qe(Zt,lr,Ge,Oe,ve,!0),lr.length&&qt.push(lr)}if(qt.length){if(Pe.lineMetrics&&Mt==="LineString"){for(const Zt of qt)We.push(re(ct.id,Mt,Zt,ct.tags));continue}Mt!=="LineString"&&Mt!=="MultiLineString"||(qt.length===1?(Mt="LineString",qt=qt[0]):Mt="MultiLineString"),Mt!=="Point"&&Mt!=="MultiPoint"||(Mt=qt.length===3?"Point":"MultiPoint"),We.push(re(ct.id,Mt,qt,ct.tags))}}return We.length?We:null}function Ce(pt,ze,Ge,Oe,ve){for(let ge=0;ge=Ge&&be<=Oe&&Ke(ze,pt[ge],pt[ge+1],pt[ge+2])}}function qe(pt,ze,Ge,Oe,ve,ge,be){let Pe=et(pt);const We=ve===0?Xe:Me;let ct,_t,Mt=pt.start;for(let lr=0;lrGe&&(_t=We(Pe,ta,da,ma,Ia,Ge),be&&(Pe.start=Mt+ct*_t)):va>Oe?La=Ge&&(_t=We(Pe,ta,da,ma,Ia,Ge),Ka=!0),La>Oe&&va<=Oe&&(_t=We(Pe,ta,da,ma,Ia,Oe),Ka=!0),!ge&&Ka&&(be&&(Pe.end=Mt+ct*_t),ze.push(Pe),Pe=et(pt)),be&&(Mt+=ct)}let Nt=pt.length-3;const Bt=pt[Nt],qt=pt[Nt+1],Zt=ve===0?Bt:qt;Zt>=Ge&&Zt<=Oe&&Ke(Pe,Bt,qt,pt[Nt+2]),Nt=Pe.length-3,ge&&Nt>=3&&(Pe[Nt]!==Pe[0]||Pe[Nt+1]!==Pe[1])&&Ke(Pe,Pe[0],Pe[1],Pe[2]),Pe.length&&ze.push(Pe)}function et(pt){const ze=[];return ze.size=pt.size,ze.start=pt.start,ze.end=pt.end,ze}function Qe(pt,ze,Ge,Oe,ve,ge){for(const be of pt)qe(be,ze,Ge,Oe,ve,ge,!1)}function Ke(pt,ze,Ge,Oe){pt.push(ze,Ge,Oe)}function Xe(pt,ze,Ge,Oe,ve,ge){const be=(ge-ze)/(Oe-ze);return Ke(pt,ge,Ge+(ve-Ge)*be,1),be}function Me(pt,ze,Ge,Oe,ve,ge){const be=(ge-Ge)/(ve-Ge);return Ke(pt,ze+(Oe-ze)*be,ge,1),be}function xe(pt,ze){const Ge=[];for(let Oe=0;Oe0&&ze.size<(ve?be:Oe))return void(Ge.numPoints+=ze.length/3);const Pe=[];for(let We=0;Webe)&&(Ge.numSimplified++,Pe.push(ze[We],ze[We+1])),Ge.numPoints++;ve&&function(We,ct){let _t=0;for(let Mt=0,Nt=We.length,Bt=Nt-2;Mt0===ct)for(let Mt=0,Nt=We.length;Mt24)throw new Error("maxZoom should be in the 0-24 range");if(Ge.promoteId&&Ge.generateId)throw new Error("promoteId and generateId cannot be used together.");let ve=function(ge,be){const Pe=[];if(ge.type==="FeatureCollection")for(let We=0;We1&&console.time("creation"),Bt=this.tiles[Nt]=rt(ze,Ge,Oe,ve,ct),this.tileCoords.push({z:Ge,x:Oe,y:ve}),_t)){_t>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Ge,Oe,ve,Bt.numFeatures,Bt.numPoints,Bt.numSimplified),console.timeEnd("creation"));const Ka=`z${Ge}`;this.stats[Ka]=(this.stats[Ka]||0)+1,this.total++}if(Bt.source=ze,ge==null){if(Ge===ct.indexMaxZoom||Bt.numPoints<=ct.indexMaxPoints)continue}else{if(Ge===ct.maxZoom||Ge===ge)continue;if(ge!=null){const Ka=ge-Ge;if(Oe!==be>>Ka||ve!==Pe>>Ka)continue}}if(Bt.source=null,ze.length===0)continue;_t>1&&console.time("clipping");const qt=.5*ct.buffer/ct.extent,Zt=.5-qt,lr=.5+qt,ta=1+qt;let da=null,wa=null,ma=null,Ia=null,va=Fe(ze,Mt,Oe-qt,Oe+lr,0,Bt.minX,Bt.maxX,ct),La=Fe(ze,Mt,Oe+Zt,Oe+ta,0,Bt.minX,Bt.maxX,ct);ze=null,va&&(da=Fe(va,Mt,ve-qt,ve+lr,1,Bt.minY,Bt.maxY,ct),wa=Fe(va,Mt,ve+Zt,ve+ta,1,Bt.minY,Bt.maxY,ct),va=null),La&&(ma=Fe(La,Mt,ve-qt,ve+lr,1,Bt.minY,Bt.maxY,ct),Ia=Fe(La,Mt,ve+Zt,ve+ta,1,Bt.minY,Bt.maxY,ct),La=null),_t>1&&console.timeEnd("clipping"),We.push(da||[],Ge+1,2*Oe,2*ve),We.push(wa||[],Ge+1,2*Oe,2*ve+1),We.push(ma||[],Ge+1,2*Oe+1,2*ve),We.push(Ia||[],Ge+1,2*Oe+1,2*ve+1)}}getTile(ze,Ge,Oe){ze=+ze,Ge=+Ge,Oe=+Oe;const ve=this.options,{extent:ge,debug:be}=ve;if(ze<0||ze>24)return null;const Pe=1<1&&console.log("drilling down to z%d-%d-%d",ze,Ge,Oe);let ct,_t=ze,Mt=Ge,Nt=Oe;for(;!ct&&_t>0;)_t--,Mt>>=1,Nt>>=1,ct=this.tiles[Ut(_t,Mt,Nt)];return ct&&ct.source?(be>1&&(console.log("found parent tile z%d-%d-%d",_t,Mt,Nt),console.time("drilling down")),this.splitTile(ct.source,_t,Mt,Nt,ze,Ge,Oe),be>1&&console.timeEnd("drilling down"),this.tiles[We]?Re(this.tiles[We],ge):null):null}}function Ut(pt,ze,Ge){return 32*((1<{Mt.properties=Bt;const qt={};for(const Zt of Nt)qt[Zt]=We[Zt].evaluate(_t,Mt);return qt},be.reduce=(Bt,qt)=>{Mt.properties=qt;for(const Zt of Nt)_t.accumulated=Bt[Zt],Bt[Zt]=ct[Zt].evaluate(_t,Mt)},be}(ze)).load((yield this._pendingData).features):(ve=yield this._pendingData,new Rt(ve,ze.geojsonVtOptions)),this.loaded={};const ge={};if(Oe){const be=Oe.finish();be&&(ge.resourceTiming={},ge.resourceTiming[ze.source]=JSON.parse(JSON.stringify(be)))}return ge}catch(ge){if(delete this._pendingRequest,e.bB(ge))return{abandoned:!0};throw ge}var ve})}getData(){return e._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(ze){const Ge=this.loaded;return Ge&&Ge[ze.uid]?super.reloadTile(ze):this.loadTile(ze)}loadAndProcessGeoJSON(ze,Ge){return e._(this,void 0,void 0,function*(){let Oe=yield this.loadGeoJSON(ze,Ge);if(delete this._pendingRequest,typeof Oe!="object")throw new Error(`Input data given to '${ze.source}' is not a valid GeoJSON object.`);if(f(Oe,!0),ze.filter){const ve=e.bC(ze.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ve.result==="error")throw new Error(ve.value.map(be=>`${be.key}: ${be.message}`).join(", "));Oe={type:"FeatureCollection",features:Oe.features.filter(be=>ve.value.evaluate({zoom:0},be))}}return Oe})}loadGeoJSON(ze,Ge){return e._(this,void 0,void 0,function*(){const{promoteId:Oe}=ze;if(ze.request){const ve=yield e.h(ze.request,Ge);return this._dataUpdateable=ar(ve.data,Oe)?Mr(ve.data,Oe):void 0,ve.data}if(typeof ze.data=="string")try{const ve=JSON.parse(ze.data);return this._dataUpdateable=ar(ve,Oe)?Mr(ve,Oe):void 0,ve}catch{throw new Error(`Input data given to '${ze.source}' is not a valid GeoJSON object.`)}if(!ze.dataDiff)throw new Error(`Input data given to '${ze.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${ze.source}`);return function(ve,ge,be){var Pe,We,ct,_t;if(ge.removeAll&&ve.clear(),ge.remove)for(const Mt of ge.remove)ve.delete(Mt);if(ge.add)for(const Mt of ge.add){const Nt=ir(Mt,be);Nt!=null&&ve.set(Nt,Mt)}if(ge.update)for(const Mt of ge.update){let Nt=ve.get(Mt.id);if(Nt==null)continue;const Bt=!Mt.removeAllProperties&&(((Pe=Mt.removeProperties)===null||Pe===void 0?void 0:Pe.length)>0||((We=Mt.addOrUpdateProperties)===null||We===void 0?void 0:We.length)>0);if((Mt.newGeometry||Mt.removeAllProperties||Bt)&&(Nt=Object.assign({},Nt),ve.set(Mt.id,Nt),Bt&&(Nt.properties=Object.assign({},Nt.properties))),Mt.newGeometry&&(Nt.geometry=Mt.newGeometry),Mt.removeAllProperties)Nt.properties={};else if(((ct=Mt.removeProperties)===null||ct===void 0?void 0:ct.length)>0)for(const qt of Mt.removeProperties)Object.prototype.hasOwnProperty.call(Nt.properties,qt)&&delete Nt.properties[qt];if(((_t=Mt.addOrUpdateProperties)===null||_t===void 0?void 0:_t.length)>0)for(const{key:qt,value:Zt}of Mt.addOrUpdateProperties)Nt.properties[qt]=Zt}}(this._dataUpdateable,ze.dataDiff,Oe),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(ze){return e._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(ze){return this._geoJSONIndex.getClusterExpansionZoom(ze.clusterId)}getClusterChildren(ze){return this._geoJSONIndex.getChildren(ze.clusterId)}getClusterLeaves(ze){return this._geoJSONIndex.getLeaves(ze.clusterId,ze.limit,ze.offset)}}class dr{constructor(ze){this.self=ze,this.actor=new e.F(ze),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(Ge,Oe)=>{if(this.externalWorkerSourceTypes[Ge])throw new Error(`Worker source with name "${Ge}" already registered.`);this.externalWorkerSourceTypes[Ge]=Oe},this.self.addProtocol=e.bi,this.self.removeProtocol=e.bj,this.self.registerRTLTextPlugin=Ge=>{if(e.bD.isParsed())throw new Error("RTL text plugin already registered.");e.bD.setMethods(Ge)},this.actor.registerMessageHandler("LDT",(Ge,Oe)=>this._getDEMWorkerSource(Ge,Oe.source).loadTile(Oe)),this.actor.registerMessageHandler("RDT",(Ge,Oe)=>e._(this,void 0,void 0,function*(){this._getDEMWorkerSource(Ge,Oe.source).removeTile(Oe)})),this.actor.registerMessageHandler("GCEZ",(Ge,Oe)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Ge,Oe.type,Oe.source).getClusterExpansionZoom(Oe)})),this.actor.registerMessageHandler("GCC",(Ge,Oe)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Ge,Oe.type,Oe.source).getClusterChildren(Oe)})),this.actor.registerMessageHandler("GCL",(Ge,Oe)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Ge,Oe.type,Oe.source).getClusterLeaves(Oe)})),this.actor.registerMessageHandler("LD",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).loadData(Oe)),this.actor.registerMessageHandler("GD",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).getData()),this.actor.registerMessageHandler("LT",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).loadTile(Oe)),this.actor.registerMessageHandler("RT",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).reloadTile(Oe)),this.actor.registerMessageHandler("AT",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).abortTile(Oe)),this.actor.registerMessageHandler("RMT",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).removeTile(Oe)),this.actor.registerMessageHandler("RS",(Ge,Oe)=>e._(this,void 0,void 0,function*(){if(!this.workerSources[Ge]||!this.workerSources[Ge][Oe.type]||!this.workerSources[Ge][Oe.type][Oe.source])return;const ve=this.workerSources[Ge][Oe.type][Oe.source];delete this.workerSources[Ge][Oe.type][Oe.source],ve.removeSource!==void 0&&ve.removeSource(Oe)})),this.actor.registerMessageHandler("RM",Ge=>e._(this,void 0,void 0,function*(){delete this.layerIndexes[Ge],delete this.availableImages[Ge],delete this.workerSources[Ge],delete this.demWorkerSources[Ge]})),this.actor.registerMessageHandler("SR",(Ge,Oe)=>e._(this,void 0,void 0,function*(){this.referrer=Oe})),this.actor.registerMessageHandler("SRPS",(Ge,Oe)=>this._syncRTLPluginState(Ge,Oe)),this.actor.registerMessageHandler("IS",(Ge,Oe)=>e._(this,void 0,void 0,function*(){this.self.importScripts(Oe)})),this.actor.registerMessageHandler("SI",(Ge,Oe)=>this._setImages(Ge,Oe)),this.actor.registerMessageHandler("UL",(Ge,Oe)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(Ge).update(Oe.layers,Oe.removedIds)})),this.actor.registerMessageHandler("SL",(Ge,Oe)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(Ge).replace(Oe)}))}_setImages(ze,Ge){return e._(this,void 0,void 0,function*(){this.availableImages[ze]=Ge;for(const Oe in this.workerSources[ze]){const ve=this.workerSources[ze][Oe];for(const ge in ve)ve[ge].availableImages=Ge}})}_syncRTLPluginState(ze,Ge){return e._(this,void 0,void 0,function*(){if(e.bD.isParsed())return e.bD.getState();if(Ge.pluginStatus!=="loading")return e.bD.setState(Ge),Ge;const Oe=Ge.pluginURL;if(this.self.importScripts(Oe),e.bD.isParsed()){const ve={pluginStatus:"loaded",pluginURL:Oe};return e.bD.setState(ve),ve}throw e.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${Oe}`)})}_getAvailableImages(ze){let Ge=this.availableImages[ze];return Ge||(Ge=[]),Ge}_getLayerIndex(ze){let Ge=this.layerIndexes[ze];return Ge||(Ge=this.layerIndexes[ze]=new t),Ge}_getWorkerSource(ze,Ge,Oe){if(this.workerSources[ze]||(this.workerSources[ze]={}),this.workerSources[ze][Ge]||(this.workerSources[ze][Ge]={}),!this.workerSources[ze][Ge][Oe]){const ve={sendAsync:(ge,be)=>(ge.targetMapId=ze,this.actor.sendAsync(ge,be))};switch(Ge){case"vector":this.workerSources[ze][Ge][Oe]=new i(ve,this._getLayerIndex(ze),this._getAvailableImages(ze));break;case"geojson":this.workerSources[ze][Ge][Oe]=new fr(ve,this._getLayerIndex(ze),this._getAvailableImages(ze));break;default:this.workerSources[ze][Ge][Oe]=new this.externalWorkerSourceTypes[Ge](ve,this._getLayerIndex(ze),this._getAvailableImages(ze))}}return this.workerSources[ze][Ge][Oe]}_getDEMWorkerSource(ze,Ge){return this.demWorkerSources[ze]||(this.demWorkerSources[ze]={}),this.demWorkerSources[ze][Ge]||(this.demWorkerSources[ze][Ge]=new n),this.demWorkerSources[ze][Ge]}}return e.i(self)&&(self.worker=new dr(self)),dr}),A("index",["exports","./shared"],function(e,t){var r="4.7.1";let o,a;const i={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:De=>new Promise((I,ne)=>{const Te=requestAnimationFrame(I);De.signal.addEventListener("abort",()=>{cancelAnimationFrame(Te),ne(t.c())})}),getImageData(De,I=0){return this.getImageCanvasContext(De).getImageData(-I,-I,De.width+2*I,De.height+2*I)},getImageCanvasContext(De){const I=window.document.createElement("canvas"),ne=I.getContext("2d",{willReadFrequently:!0});if(!ne)throw new Error("failed to create canvas 2d context");return I.width=De.width,I.height=De.height,ne.drawImage(De,0,0,De.width,De.height),ne},resolveURL:De=>(o||(o=document.createElement("a")),o.href=De,o.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(a==null&&(a=matchMedia("(prefers-reduced-motion: reduce)")),a.matches)}};class n{static testProp(I){if(!n.docStyle)return I[0];for(let ne=0;ne{window.removeEventListener("click",n.suppressClickInternal,!0)},0)}static getScale(I){const ne=I.getBoundingClientRect();return{x:ne.width/I.offsetWidth||1,y:ne.height/I.offsetHeight||1,boundingClientRect:ne}}static getPoint(I,ne,Te){const Se=ne.boundingClientRect;return new t.P((Te.clientX-Se.left)/ne.x-I.clientLeft,(Te.clientY-Se.top)/ne.y-I.clientTop)}static mousePos(I,ne){const Te=n.getScale(I);return n.getPoint(I,Te,ne)}static touchPos(I,ne){const Te=[],Se=n.getScale(I);for(let Ie=0;Ie{c&&T(c),c=null,h=!0},f.onerror=()=>{v=!0,c=null},f.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(De){let I,ne,Te,Se;De.resetRequestQueue=()=>{I=[],ne=0,Te=0,Se={}},De.addThrottleControl=Ct=>{const Wt=Te++;return Se[Wt]=Ct,Wt},De.removeThrottleControl=Ct=>{delete Se[Ct],ot()},De.getImage=(Ct,Wt,nr=!0)=>new Promise((or,Fr)=>{s.supported&&(Ct.headers||(Ct.headers={}),Ct.headers.accept="image/webp,*/*"),t.e(Ct,{type:"image"}),I.push({abortController:Wt,requestParameters:Ct,supportImageRefresh:nr,state:"queued",onError:Wr=>{Fr(Wr)},onSuccess:Wr=>{or(Wr)}}),ot()});const Ie=Ct=>t._(this,void 0,void 0,function*(){Ct.state="running";const{requestParameters:Wt,supportImageRefresh:nr,onError:or,onSuccess:Fr,abortController:Wr}=Ct,je=nr===!1&&!t.i(self)&&!t.g(Wt.url)&&(!Wt.headers||Object.keys(Wt.headers).reduce((lt,Tt)=>lt&&Tt==="accept",!0));ne++;const Ze=je?yt(Wt,Wr):t.m(Wt,Wr);try{const lt=yield Ze;delete Ct.abortController,Ct.state="completed",lt.data instanceof HTMLImageElement||t.b(lt.data)?Fr(lt):lt.data&&Fr({data:yield(at=lt.data,typeof createImageBitmap=="function"?t.d(at):t.f(at)),cacheControl:lt.cacheControl,expires:lt.expires})}catch(lt){delete Ct.abortController,or(lt)}finally{ne--,ot()}var at}),ot=()=>{const Ct=(()=>{for(const Wt of Object.keys(Se))if(Se[Wt]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let Wt=ne;Wt0;Wt++){const nr=I.shift();nr.abortController.signal.aborted?Wt--:Ie(nr)}},yt=(Ct,Wt)=>new Promise((nr,or)=>{const Fr=new Image,Wr=Ct.url,je=Ct.credentials;je&&je==="include"?Fr.crossOrigin="use-credentials":(je&&je==="same-origin"||!t.s(Wr))&&(Fr.crossOrigin="anonymous"),Wt.signal.addEventListener("abort",()=>{Fr.src="",or(t.c())}),Fr.fetchPriority="high",Fr.onload=()=>{Fr.onerror=Fr.onload=null,nr({data:Fr})},Fr.onerror=()=>{Fr.onerror=Fr.onload=null,Wt.signal.aborted||or(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."))},Fr.src=Wr})}(l||(l={})),l.resetRequestQueue();class y{constructor(I){this._transformRequestFn=I}transformRequest(I,ne){return this._transformRequestFn&&this._transformRequestFn(I,ne)||{url:I}}setTransformRequest(I){this._transformRequestFn=I}}function b(De){var I=new t.A(3);return I[0]=De[0],I[1]=De[1],I[2]=De[2],I}var S,M=function(De,I,ne){return De[0]=I[0]-ne[0],De[1]=I[1]-ne[1],De[2]=I[2]-ne[2],De};S=new t.A(3),t.A!=Float32Array&&(S[0]=0,S[1]=0,S[2]=0);var _=function(De){var I=De[0],ne=De[1];return I*I+ne*ne};function w(De){const I=[];if(typeof De=="string")I.push({id:"default",url:De});else if(De&&De.length>0){const ne=[];for(const{id:Te,url:Se}of De){const Ie=`${Te}${Se}`;ne.indexOf(Ie)===-1&&(ne.push(Ie),I.push({id:Te,url:Se}))}}return I}function p(De,I,ne){const Te=De.split("?");return Te[0]+=`${I}${ne}`,Te.join("?")}(function(){var De=new t.A(2);t.A!=Float32Array&&(De[0]=0,De[1]=0)})();class u{constructor(I,ne,Te,Se){this.context=I,this.format=Te,this.texture=I.gl.createTexture(),this.update(ne,Se)}update(I,ne,Te){const{width:Se,height:Ie}=I,ot=!(this.size&&this.size[0]===Se&&this.size[1]===Ie||Te),{context:yt}=this,{gl:Ct}=yt;if(this.useMipmap=!!(ne&&ne.useMipmap),Ct.bindTexture(Ct.TEXTURE_2D,this.texture),yt.pixelStoreUnpackFlipY.set(!1),yt.pixelStoreUnpack.set(1),yt.pixelStoreUnpackPremultiplyAlpha.set(this.format===Ct.RGBA&&(!ne||ne.premultiply!==!1)),ot)this.size=[Se,Ie],I instanceof HTMLImageElement||I instanceof HTMLCanvasElement||I instanceof HTMLVideoElement||I instanceof ImageData||t.b(I)?Ct.texImage2D(Ct.TEXTURE_2D,0,this.format,this.format,Ct.UNSIGNED_BYTE,I):Ct.texImage2D(Ct.TEXTURE_2D,0,this.format,Se,Ie,0,this.format,Ct.UNSIGNED_BYTE,I.data);else{const{x:Wt,y:nr}=Te||{x:0,y:0};I instanceof HTMLImageElement||I instanceof HTMLCanvasElement||I instanceof HTMLVideoElement||I instanceof ImageData||t.b(I)?Ct.texSubImage2D(Ct.TEXTURE_2D,0,Wt,nr,Ct.RGBA,Ct.UNSIGNED_BYTE,I):Ct.texSubImage2D(Ct.TEXTURE_2D,0,Wt,nr,Se,Ie,Ct.RGBA,Ct.UNSIGNED_BYTE,I.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Ct.generateMipmap(Ct.TEXTURE_2D)}bind(I,ne,Te){const{context:Se}=this,{gl:Ie}=Se;Ie.bindTexture(Ie.TEXTURE_2D,this.texture),Te!==Ie.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(Te=Ie.LINEAR),I!==this.filter&&(Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_MAG_FILTER,I),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_MIN_FILTER,Te||I),this.filter=I),ne!==this.wrap&&(Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_WRAP_S,ne),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_WRAP_T,ne),this.wrap=ne)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:I}=this.context;I.deleteTexture(this.texture),this.texture=null}}function g(De){const{userImage:I}=De;return!!(I&&I.render&&I.render())&&(De.data.replace(new Uint8Array(I.data.buffer)),!0)}class m extends t.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(I){if(this.loaded!==I&&(this.loaded=I,I)){for(const{ids:ne,promiseResolve:Te}of this.requestors)Te(this._getImagesForIds(ne));this.requestors=[]}}getImage(I){const ne=this.images[I];if(ne&&!ne.data&&ne.spriteData){const Te=ne.spriteData;ne.data=new t.R({width:Te.width,height:Te.height},Te.context.getImageData(Te.x,Te.y,Te.width,Te.height).data),ne.spriteData=null}return ne}addImage(I,ne){if(this.images[I])throw new Error(`Image id ${I} already exist, use updateImage instead`);this._validate(I,ne)&&(this.images[I]=ne)}_validate(I,ne){let Te=!0;const Se=ne.data||ne.spriteData;return this._validateStretch(ne.stretchX,Se&&Se.width)||(this.fire(new t.j(new Error(`Image "${I}" has invalid "stretchX" value`))),Te=!1),this._validateStretch(ne.stretchY,Se&&Se.height)||(this.fire(new t.j(new Error(`Image "${I}" has invalid "stretchY" value`))),Te=!1),this._validateContent(ne.content,ne)||(this.fire(new t.j(new Error(`Image "${I}" has invalid "content" value`))),Te=!1),Te}_validateStretch(I,ne){if(!I)return!0;let Te=0;for(const Se of I){if(Se[0]{let Se=!0;if(!this.isLoaded())for(const Ie of I)this.images[Ie]||(Se=!1);this.isLoaded()||Se?ne(this._getImagesForIds(I)):this.requestors.push({ids:I,promiseResolve:ne})})}_getImagesForIds(I){const ne={};for(const Te of I){let Se=this.getImage(Te);Se||(this.fire(new t.k("styleimagemissing",{id:Te})),Se=this.getImage(Te)),Se?ne[Te]={data:Se.data.clone(),pixelRatio:Se.pixelRatio,sdf:Se.sdf,version:Se.version,stretchX:Se.stretchX,stretchY:Se.stretchY,content:Se.content,textFitWidth:Se.textFitWidth,textFitHeight:Se.textFitHeight,hasRenderCallback:!!(Se.userImage&&Se.userImage.render)}:t.w(`Image "${Te}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return ne}getPixelSize(){const{width:I,height:ne}=this.atlasImage;return{width:I,height:ne}}getPattern(I){const ne=this.patterns[I],Te=this.getImage(I);if(!Te)return null;if(ne&&ne.position.version===Te.version)return ne.position;if(ne)ne.position.version=Te.version;else{const Se={w:Te.data.width+2,h:Te.data.height+2,x:0,y:0},Ie=new t.I(Se,Te);this.patterns[I]={bin:Se,position:Ie}}return this._updatePatternAtlas(),this.patterns[I].position}bind(I){const ne=I.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u(I,this.atlasImage,ne.RGBA),this.atlasTexture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE)}_updatePatternAtlas(){const I=[];for(const Ie in this.patterns)I.push(this.patterns[Ie].bin);const{w:ne,h:Te}=t.p(I),Se=this.atlasImage;Se.resize({width:ne||1,height:Te||1});for(const Ie in this.patterns){const{bin:ot}=this.patterns[Ie],yt=ot.x+1,Ct=ot.y+1,Wt=this.getImage(Ie).data,nr=Wt.width,or=Wt.height;t.R.copy(Wt,Se,{x:0,y:0},{x:yt,y:Ct},{width:nr,height:or}),t.R.copy(Wt,Se,{x:0,y:or-1},{x:yt,y:Ct-1},{width:nr,height:1}),t.R.copy(Wt,Se,{x:0,y:0},{x:yt,y:Ct+or},{width:nr,height:1}),t.R.copy(Wt,Se,{x:nr-1,y:0},{x:yt-1,y:Ct},{width:1,height:or}),t.R.copy(Wt,Se,{x:0,y:0},{x:yt+nr,y:Ct},{width:1,height:or})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(I){for(const ne of I){if(this.callbackDispatchedThisFrame[ne])continue;this.callbackDispatchedThisFrame[ne]=!0;const Te=this.getImage(ne);Te||t.w(`Image with ID: "${ne}" was not found`),g(Te)&&this.updateImage(ne,Te)}}}const R=1e20;function P(De,I,ne,Te,Se,Ie,ot,yt,Ct){for(let Wt=I;Wt-1);Ct++,Ie[Ct]=yt,ot[Ct]=Wt,ot[Ct+1]=R}for(let yt=0,Ct=0;yt65535)throw new Error("glyphs > 65535 not supported");if(Te.ranges[Ie])return{stack:I,id:ne,glyph:Se};if(!this.url)throw new Error("glyphsUrl is not set");if(!Te.requests[Ie]){const yt=F.loadGlyphRange(I,Ie,this.url,this.requestManager);Te.requests[Ie]=yt}const ot=yield Te.requests[Ie];for(const yt in ot)this._doesCharSupportLocalGlyph(+yt)||(Te.glyphs[+yt]=ot[+yt]);return Te.ranges[Ie]=!0,{stack:I,id:ne,glyph:ot[ne]||null}})}_doesCharSupportLocalGlyph(I){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(I))}_tinySDF(I,ne,Te){const Se=this.localIdeographFontFamily;if(!Se||!this._doesCharSupportLocalGlyph(Te))return;let Ie=I.tinySDF;if(!Ie){let yt="400";/bold/i.test(ne)?yt="900":/medium/i.test(ne)?yt="500":/light/i.test(ne)&&(yt="200"),Ie=I.tinySDF=new F.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:Se,fontWeight:yt})}const ot=Ie.draw(String.fromCharCode(Te));return{id:Te,bitmap:new t.o({width:ot.width||60,height:ot.height||60},ot.data),metrics:{width:ot.glyphWidth/2||24,height:ot.glyphHeight/2||24,left:ot.glyphLeft/2+.5||0,top:ot.glyphTop/2-27.5||-8,advance:ot.glyphAdvance/2||24,isDoubleResolution:!0}}}}F.loadGlyphRange=function(De,I,ne,Te){return t._(this,void 0,void 0,function*(){const Se=256*I,Ie=Se+255,ot=Te.transformRequest(ne.replace("{fontstack}",De).replace("{range}",`${Se}-${Ie}`),"Glyphs"),yt=yield t.l(ot,new AbortController);if(!yt||!yt.data)throw new Error(`Could not load glyph range. range: ${I}, ${Se}-${Ie}`);const Ct={};for(const Wt of t.n(yt.data))Ct[Wt.id]=Wt;return Ct})},F.TinySDF=class{constructor({fontSize:De=24,buffer:I=3,radius:ne=8,cutoff:Te=.25,fontFamily:Se="sans-serif",fontWeight:Ie="normal",fontStyle:ot="normal"}={}){this.buffer=I,this.cutoff=Te,this.radius=ne;const yt=this.size=De+4*I,Ct=this._createCanvas(yt),Wt=this.ctx=Ct.getContext("2d",{willReadFrequently:!0});Wt.font=`${ot} ${Ie} ${De}px ${Se}`,Wt.textBaseline="alphabetic",Wt.textAlign="left",Wt.fillStyle="black",this.gridOuter=new Float64Array(yt*yt),this.gridInner=new Float64Array(yt*yt),this.f=new Float64Array(yt),this.z=new Float64Array(yt+1),this.v=new Uint16Array(yt)}_createCanvas(De){const I=document.createElement("canvas");return I.width=I.height=De,I}draw(De){const{width:I,actualBoundingBoxAscent:ne,actualBoundingBoxDescent:Te,actualBoundingBoxLeft:Se,actualBoundingBoxRight:Ie}=this.ctx.measureText(De),ot=Math.ceil(ne),yt=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(Ie-Se))),Ct=Math.min(this.size-this.buffer,ot+Math.ceil(Te)),Wt=yt+2*this.buffer,nr=Ct+2*this.buffer,or=Math.max(Wt*nr,0),Fr=new Uint8ClampedArray(or),Wr={data:Fr,width:Wt,height:nr,glyphWidth:yt,glyphHeight:Ct,glyphTop:ot,glyphLeft:0,glyphAdvance:I};if(yt===0||Ct===0)return Wr;const{ctx:je,buffer:Ze,gridInner:at,gridOuter:lt}=this;je.clearRect(Ze,Ze,yt,Ct),je.fillText(De,Ze,Ze+ot);const Tt=je.getImageData(Ze,Ze,yt,Ct);lt.fill(R,0,or),at.fill(0,0,or);for(let gt=0;gt0?sr*sr:0,at[rr]=sr<0?sr*sr:0}}P(lt,0,0,Wt,nr,Wt,this.f,this.v,this.z),P(at,Ze,Ze,yt,Ct,Wt,this.f,this.v,this.z);for(let gt=0;gt1&&(Ct=I[++yt]);const nr=Math.abs(Wt-Ct.left),or=Math.abs(Wt-Ct.right),Fr=Math.min(nr,or);let Wr;const je=Ie/Te*(Se+1);if(Ct.isDash){const Ze=Se-Math.abs(je);Wr=Math.sqrt(Fr*Fr+Ze*Ze)}else Wr=Se-Math.sqrt(Fr*Fr+je*je);this.data[ot+Wt]=Math.max(0,Math.min(255,Wr+128))}}}addRegularDash(I){for(let yt=I.length-1;yt>=0;--yt){const Ct=I[yt],Wt=I[yt+1];Ct.zeroLength?I.splice(yt,1):Wt&&Wt.isDash===Ct.isDash&&(Wt.left=Ct.left,I.splice(yt,1))}const ne=I[0],Te=I[I.length-1];ne.isDash===Te.isDash&&(ne.left=Te.left-this.width,Te.right=ne.right+this.width);const Se=this.width*this.nextRow;let Ie=0,ot=I[Ie];for(let yt=0;yt1&&(ot=I[++Ie]);const Ct=Math.abs(yt-ot.left),Wt=Math.abs(yt-ot.right),nr=Math.min(Ct,Wt);this.data[Se+yt]=Math.max(0,Math.min(255,(ot.isDash?nr:-nr)+128))}}addDash(I,ne){const Te=ne?7:0,Se=2*Te+1;if(this.nextRow+Se>this.height)return t.w("LineAtlas out of space"),null;let Ie=0;for(let yt=0;yt{ne.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Q]}numActive(){return Object.keys(this.active).length}}const oe=Math.floor(i.hardwareConcurrency/2);let le,j;function J(){return le||(le=new ue),le}ue.workerCount=t.C(globalThis)?Math.max(Math.min(oe,3),1):1;class ${constructor(I,ne){this.workerPool=I,this.actors=[],this.currentActor=0,this.id=ne;const Te=this.workerPool.acquire(ne);for(let Se=0;Se{ne.remove()}),this.actors=[],I&&this.workerPool.release(this.id)}registerMessageHandler(I,ne){for(const Te of this.actors)Te.registerMessageHandler(I,ne)}}function X(){return j||(j=new $(J(),t.G),j.registerMessageHandler("GR",(De,I,ne)=>t.m(I,ne))),j}function re(De,I){const ne=t.H();return t.J(ne,ne,[1,1,0]),t.K(ne,ne,[.5*De.width,.5*De.height,1]),t.L(ne,ne,De.calculatePosMatrix(I.toUnwrapped()))}function ee(De,I,ne,Te,Se,Ie){const ot=function(or,Fr,Wr){if(or)for(const je of or){const Ze=Fr[je];if(Ze&&Ze.source===Wr&&Ze.type==="fill-extrusion")return!0}else for(const je in Fr){const Ze=Fr[je];if(Ze.source===Wr&&Ze.type==="fill-extrusion")return!0}return!1}(Se&&Se.layers,I,De.id),yt=Ie.maxPitchScaleFactor(),Ct=De.tilesIn(Te,yt,ot);Ct.sort(q);const Wt=[];for(const or of Ct)Wt.push({wrappedTileID:or.tileID.wrapped().key,queryResults:or.tile.queryRenderedFeatures(I,ne,De._state,or.queryGeometry,or.cameraQueryGeometry,or.scale,Se,Ie,yt,re(De.transform,or.tileID))});const nr=function(or){const Fr={},Wr={};for(const je of or){const Ze=je.queryResults,at=je.wrappedTileID,lt=Wr[at]=Wr[at]||{};for(const Tt in Ze){const gt=Ze[Tt],Et=lt[Tt]=lt[Tt]||{},Yt=Fr[Tt]=Fr[Tt]||[];for(const rr of gt)Et[rr.featureIndex]||(Et[rr.featureIndex]=!0,Yt.push(rr))}}return Fr}(Wt);for(const or in nr)nr[or].forEach(Fr=>{const Wr=Fr.feature,je=De.getFeatureState(Wr.layer["source-layer"],Wr.id);Wr.source=Wr.layer.source,Wr.layer["source-layer"]&&(Wr.sourceLayer=Wr.layer["source-layer"]),Wr.state=je});return nr}function q(De,I){const ne=De.tileID,Te=I.tileID;return ne.overscaledZ-Te.overscaledZ||ne.canonical.y-Te.canonical.y||ne.wrap-Te.wrap||ne.canonical.x-Te.canonical.x}function ae(De,I,ne){return t._(this,void 0,void 0,function*(){let Te=De;if(De.url?Te=(yield t.h(I.transformRequest(De.url,"Source"),ne)).data:yield i.frameAsync(ne),!Te)return null;const Se=t.M(t.e(Te,De),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in Te&&Te.vector_layers&&(Se.vectorLayerIds=Te.vector_layers.map(Ie=>Ie.id)),Se})}class ie{constructor(I,ne){I&&(ne?this.setSouthWest(I).setNorthEast(ne):Array.isArray(I)&&(I.length===4?this.setSouthWest([I[0],I[1]]).setNorthEast([I[2],I[3]]):this.setSouthWest(I[0]).setNorthEast(I[1])))}setNorthEast(I){return this._ne=I instanceof t.N?new t.N(I.lng,I.lat):t.N.convert(I),this}setSouthWest(I){return this._sw=I instanceof t.N?new t.N(I.lng,I.lat):t.N.convert(I),this}extend(I){const ne=this._sw,Te=this._ne;let Se,Ie;if(I instanceof t.N)Se=I,Ie=I;else{if(!(I instanceof ie))return Array.isArray(I)?I.length===4||I.every(Array.isArray)?this.extend(ie.convert(I)):this.extend(t.N.convert(I)):I&&("lng"in I||"lon"in I)&&"lat"in I?this.extend(t.N.convert(I)):this;if(Se=I._sw,Ie=I._ne,!Se||!Ie)return this}return ne||Te?(ne.lng=Math.min(Se.lng,ne.lng),ne.lat=Math.min(Se.lat,ne.lat),Te.lng=Math.max(Ie.lng,Te.lng),Te.lat=Math.max(Ie.lat,Te.lat)):(this._sw=new t.N(Se.lng,Se.lat),this._ne=new t.N(Ie.lng,Ie.lat)),this}getCenter(){return new t.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new t.N(this.getWest(),this.getNorth())}getSouthEast(){return new t.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(I){const{lng:ne,lat:Te}=t.N.convert(I);let Se=this._sw.lng<=ne&&ne<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Se=this._sw.lng>=ne&&ne>=this._ne.lng),this._sw.lat<=Te&&Te<=this._ne.lat&&Se}static convert(I){return I instanceof ie?I:I&&new ie(I)}static fromLngLat(I,ne=0){const Te=360*ne/40075017,Se=Te/Math.cos(Math.PI/180*I.lat);return new ie(new t.N(I.lng-Se,I.lat-Te),new t.N(I.lng+Se,I.lat+Te))}adjustAntiMeridian(){const I=new t.N(this._sw.lng,this._sw.lat),ne=new t.N(this._ne.lng,this._ne.lat);return new ie(I,I.lng>ne.lng?new t.N(ne.lng+360,ne.lat):ne)}}class fe{constructor(I,ne,Te){this.bounds=ie.convert(this.validateBounds(I)),this.minzoom=ne||0,this.maxzoom=Te||24}validateBounds(I){return Array.isArray(I)&&I.length===4?[Math.max(-180,I[0]),Math.max(-90,I[1]),Math.min(180,I[2]),Math.min(90,I[3])]:[-180,-90,180,90]}contains(I){const ne=Math.pow(2,I.z),Te=Math.floor(t.O(this.bounds.getWest())*ne),Se=Math.floor(t.Q(this.bounds.getNorth())*ne),Ie=Math.ceil(t.O(this.bounds.getEast())*ne),ot=Math.ceil(t.Q(this.bounds.getSouth())*ne);return I.x>=Te&&I.x=Se&&I.y{this._options.tiles=I}),this}setUrl(I){return this.setSourceProperty(()=>{this.url=I,this._options.url=I}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return t.e({},this._options)}loadTile(I){return t._(this,void 0,void 0,function*(){const ne=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Te={request:this.map._requestManager.transformRequest(ne,"Tile"),uid:I.uid,tileID:I.tileID,zoom:I.tileID.overscaledZ,tileSize:this.tileSize*I.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Te.request.collectResourceTiming=this._collectResourceTiming;let Se="RT";if(I.actor&&I.state!=="expired"){if(I.state==="loading")return new Promise((Ie,ot)=>{I.reloadPromise={resolve:Ie,reject:ot}})}else I.actor=this.dispatcher.getActor(),Se="LT";I.abortController=new AbortController;try{const Ie=yield I.actor.sendAsync({type:Se,data:Te},I.abortController);if(delete I.abortController,I.aborted)return;this._afterTileLoadWorkerResponse(I,Ie)}catch(Ie){if(delete I.abortController,I.aborted)return;if(Ie&&Ie.status!==404)throw Ie;this._afterTileLoadWorkerResponse(I,null)}})}_afterTileLoadWorkerResponse(I,ne){if(ne&&ne.resourceTiming&&(I.resourceTiming=ne.resourceTiming),ne&&this.map._refreshExpiredTiles&&I.setExpiryData(ne),I.loadVectorData(ne,this.map.painter),I.reloadPromise){const Te=I.reloadPromise;I.reloadPromise=null,this.loadTile(I).then(Te.resolve).catch(Te.reject)}}abortTile(I){return t._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController),I.actor&&(yield I.actor.sendAsync({type:"AT",data:{uid:I.uid,type:this.type,source:this.id}}))})}unloadTile(I){return t._(this,void 0,void 0,function*(){I.unloadVectorData(),I.actor&&(yield I.actor.sendAsync({type:"RMT",data:{uid:I.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Ae extends t.E{constructor(I,ne,Te,Se){super(),this.id=I,this.dispatcher=Te,this.setEventedParent(Se),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.e({type:"raster"},ne),t.e(this,t.M(ne,["url","scheme","tileSize"]))}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const I=yield ae(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,I&&(t.e(this,I),I.bounds&&(this.tileBounds=new fe(I.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})))}catch(I){this._tileJSONRequest=null,this.fire(new t.j(I))}})}loaded(){return this._loaded}onAdd(I){this.map=I,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(I){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),I(),this.load()}setTiles(I){return this.setSourceProperty(()=>{this._options.tiles=I}),this}setUrl(I){return this.setSourceProperty(()=>{this.url=I,this._options.url=I}),this}serialize(){return t.e({},this._options)}hasTile(I){return!this.tileBounds||this.tileBounds.contains(I.canonical)}loadTile(I){return t._(this,void 0,void 0,function*(){const ne=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);I.abortController=new AbortController;try{const Te=yield l.getImage(this.map._requestManager.transformRequest(ne,"Tile"),I.abortController,this.map._refreshExpiredTiles);if(delete I.abortController,I.aborted)return void(I.state="unloaded");if(Te&&Te.data){this.map._refreshExpiredTiles&&Te.cacheControl&&Te.expires&&I.setExpiryData({cacheControl:Te.cacheControl,expires:Te.expires});const Se=this.map.painter.context,Ie=Se.gl,ot=Te.data;I.texture=this.map.painter.getTileTexture(ot.width),I.texture?I.texture.update(ot,{useMipmap:!0}):(I.texture=new u(Se,ot,Ie.RGBA,{useMipmap:!0}),I.texture.bind(Ie.LINEAR,Ie.CLAMP_TO_EDGE,Ie.LINEAR_MIPMAP_NEAREST)),I.state="loaded"}}catch(Te){if(delete I.abortController,I.aborted)I.state="unloaded";else if(Te)throw I.state="errored",Te}})}abortTile(I){return t._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController)})}unloadTile(I){return t._(this,void 0,void 0,function*(){I.texture&&this.map.painter.saveTileTexture(I.texture)})}hasTransition(){return!1}}class Fe extends Ae{constructor(I,ne,Te,Se){super(I,ne,Te,Se),this.type="raster-dem",this.maxzoom=22,this._options=t.e({type:"raster-dem"},ne),this.encoding=ne.encoding||"mapbox",this.redFactor=ne.redFactor,this.greenFactor=ne.greenFactor,this.blueFactor=ne.blueFactor,this.baseShift=ne.baseShift}loadTile(I){return t._(this,void 0,void 0,function*(){const ne=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Te=this.map._requestManager.transformRequest(ne,"Tile");I.neighboringTiles=this._getNeighboringTiles(I.tileID),I.abortController=new AbortController;try{const Se=yield l.getImage(Te,I.abortController,this.map._refreshExpiredTiles);if(delete I.abortController,I.aborted)return void(I.state="unloaded");if(Se&&Se.data){const Ie=Se.data;this.map._refreshExpiredTiles&&Se.cacheControl&&Se.expires&&I.setExpiryData({cacheControl:Se.cacheControl,expires:Se.expires});const ot=t.b(Ie)&&t.U()?Ie:yield this.readImageNow(Ie),yt={type:this.type,uid:I.uid,source:this.id,rawImageData:ot,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!I.actor||I.state==="expired"){I.actor=this.dispatcher.getActor();const Ct=yield I.actor.sendAsync({type:"LDT",data:yt});I.dem=Ct,I.needsHillshadePrepare=!0,I.needsTerrainPrepare=!0,I.state="loaded"}}}catch(Se){if(delete I.abortController,I.aborted)I.state="unloaded";else if(Se)throw I.state="errored",Se}})}readImageNow(I){return t._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&t.V()){const ne=I.width+2,Te=I.height+2;try{return new t.R({width:ne,height:Te},yield t.W(I,-1,-1,ne,Te))}catch{}}return i.getImageData(I,1)})}_getNeighboringTiles(I){const ne=I.canonical,Te=Math.pow(2,ne.z),Se=(ne.x-1+Te)%Te,Ie=ne.x===0?I.wrap-1:I.wrap,ot=(ne.x+1+Te)%Te,yt=ne.x+1===Te?I.wrap+1:I.wrap,Ct={};return Ct[new t.S(I.overscaledZ,Ie,ne.z,Se,ne.y).key]={backfilled:!1},Ct[new t.S(I.overscaledZ,yt,ne.z,ot,ne.y).key]={backfilled:!1},ne.y>0&&(Ct[new t.S(I.overscaledZ,Ie,ne.z,Se,ne.y-1).key]={backfilled:!1},Ct[new t.S(I.overscaledZ,I.wrap,ne.z,ne.x,ne.y-1).key]={backfilled:!1},Ct[new t.S(I.overscaledZ,yt,ne.z,ot,ne.y-1).key]={backfilled:!1}),ne.y+10&&t.e(Ie,{resourceTiming:Se}),this.fire(new t.k("data",Object.assign(Object.assign({},Ie),{sourceDataType:"metadata"}))),this.fire(new t.k("data",Object.assign(Object.assign({},Ie),{sourceDataType:"content"})))}catch(Te){if(this._pendingLoads--,this._removed)return void this.fire(new t.k("dataabort",{dataType:"source"}));this.fire(new t.j(Te))}})}loaded(){return this._pendingLoads===0}loadTile(I){return t._(this,void 0,void 0,function*(){const ne=I.actor?"RT":"LT";I.actor=this.actor;const Te={type:this.type,uid:I.uid,tileID:I.tileID,zoom:I.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};I.abortController=new AbortController;const Se=yield this.actor.sendAsync({type:ne,data:Te},I.abortController);delete I.abortController,I.unloadVectorData(),I.aborted||I.loadVectorData(Se,this.map.painter,ne==="RT")})}abortTile(I){return t._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController),I.aborted=!0})}unloadTile(I){return t._(this,void 0,void 0,function*(){I.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:I.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return t.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var qe=t.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class et extends t.E{constructor(I,ne,Te,Se){super(),this.id=I,this.dispatcher=Te,this.coordinates=ne.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Se),this.options=ne}load(I){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const ne=yield l.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,ne&&ne.data&&(this.image=ne.data,I&&(this.coordinates=I),this._finishLoading())}catch(ne){this._request=null,this._loaded=!0,this.fire(new t.j(ne))}})}loaded(){return this._loaded}updateImage(I){return I.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=I.url,this.load(I.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(I){this.map=I,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(I){this.coordinates=I;const ne=I.map(t.Z.fromLngLat);this.tileID=function(Se){let Ie=1/0,ot=1/0,yt=-1/0,Ct=-1/0;for(const Fr of Se)Ie=Math.min(Ie,Fr.x),ot=Math.min(ot,Fr.y),yt=Math.max(yt,Fr.x),Ct=Math.max(Ct,Fr.y);const Wt=Math.max(yt-Ie,Ct-ot),nr=Math.max(0,Math.floor(-Math.log(Wt)/Math.LN2)),or=Math.pow(2,nr);return new t.a1(nr,Math.floor((Ie+yt)/2*or),Math.floor((ot+Ct)/2*or))}(ne),this.minzoom=this.maxzoom=this.tileID.z;const Te=ne.map(Se=>this.tileID.getTilePoint(Se)._round());return this._boundsArray=new t.$,this._boundsArray.emplaceBack(Te[0].x,Te[0].y,0,0),this._boundsArray.emplaceBack(Te[1].x,Te[1].y,t.X,0),this._boundsArray.emplaceBack(Te[3].x,Te[3].y,0,t.X),this._boundsArray.emplaceBack(Te[2].x,Te[2].y,t.X,t.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const I=this.map.painter.context,ne=I.gl;this.boundsBuffer||(this.boundsBuffer=I.createVertexBuffer(this._boundsArray,qe.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u(I,this.image,ne.RGBA),this.texture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE));let Te=!1;for(const Se in this.tiles){const Ie=this.tiles[Se];Ie.state!=="loaded"&&(Ie.state="loaded",Ie.texture=this.texture,Te=!0)}Te&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(I){return t._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(I.tileID.canonical)?(this.tiles[String(I.tileID.wrap)]=I,I.buckets={}):I.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Qe extends et{constructor(I,ne,Te,Se){super(I,ne,Te,Se),this.roundZoom=!0,this.type="video",this.options=ne}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1;const I=this.options;this.urls=[];for(const ne of I.urls)this.urls.push(this.map._requestManager.transformRequest(ne,"Source").url);try{const ne=yield t.a3(this.urls);if(this._loaded=!0,!ne)return;this.video=ne,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(ne){this.fire(new t.j(ne))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(I){if(this.video){const ne=this.video.seekable;Ine.end(0)?this.fire(new t.j(new t.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${ne.start(0)} and ${ne.end(0)}-second mark.`))):this.video.currentTime=I}}getVideo(){return this.video}onAdd(I){this.map||(this.map=I,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const I=this.map.painter.context,ne=I.gl;this.boundsBuffer||(this.boundsBuffer=I.createVertexBuffer(this._boundsArray,qe.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE),ne.texSubImage2D(ne.TEXTURE_2D,0,0,0,ne.RGBA,ne.UNSIGNED_BYTE,this.video)):(this.texture=new u(I,this.video,ne.RGBA),this.texture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE));let Te=!1;for(const Se in this.tiles){const Ie=this.tiles[Se];Ie.state!=="loaded"&&(Ie.state="loaded",Ie.texture=this.texture,Te=!0)}Te&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Ke extends et{constructor(I,ne,Te,Se){super(I,ne,Te,Se),ne.coordinates?Array.isArray(ne.coordinates)&&ne.coordinates.length===4&&!ne.coordinates.some(Ie=>!Array.isArray(Ie)||Ie.length!==2||Ie.some(ot=>typeof ot!="number"))||this.fire(new t.j(new t.a2(`sources.${I}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.j(new t.a2(`sources.${I}`,null,'missing required property "coordinates"'))),ne.animate&&typeof ne.animate!="boolean"&&this.fire(new t.j(new t.a2(`sources.${I}`,null,'optional "animate" property must be a boolean value'))),ne.canvas?typeof ne.canvas=="string"||ne.canvas instanceof HTMLCanvasElement||this.fire(new t.j(new t.a2(`sources.${I}`,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 t.j(new t.a2(`sources.${I}`,null,'missing required property "canvas"'))),this.options=ne,this.animate=ne.animate===void 0||ne.animate}load(){return t._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.j(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())})}getCanvas(){return this.canvas}onAdd(I){this.map=I,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let I=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,I=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,I=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const ne=this.map.painter.context,Te=ne.gl;this.boundsBuffer||(this.boundsBuffer=ne.createVertexBuffer(this._boundsArray,qe.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?(I||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u(ne,this.canvas,Te.RGBA,{premultiply:!0});let Se=!1;for(const Ie in this.tiles){const ot=this.tiles[Ie];ot.state!=="loaded"&&(ot.state="loaded",ot.texture=this.texture,Se=!0)}Se&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const I of[this.canvas.width,this.canvas.height])if(isNaN(I)||I<=0)return!0;return!1}}const Xe={},Me=De=>{switch(De){case"geojson":return Ce;case"image":return et;case"raster":return Ae;case"raster-dem":return Fe;case"vector":return we;case"video":return Qe;case"canvas":return Ke}return Xe[De]},xe="RTLPluginLoaded";class ce extends t.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=X()}_syncState(I){return this.status=I,this.dispatcher.broadcast("SRPS",{pluginStatus:I,pluginURL:this.url}).catch(ne=>{throw this.status="error",ne})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(I){return t._(this,arguments,void 0,function*(ne,Te=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=i.resolveURL(ne),!this.url)throw new Error(`requested url ${ne} is invalid`);if(this.status==="unavailable"){if(!Te)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return t._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new t.k(xe))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Re=null;function $e(){return Re||(Re=new ce),Re}class rt{constructor(I,ne){this.timeAdded=0,this.fadeEndTime=0,this.tileID=I,this.uid=t.a4(),this.uses=0,this.tileSize=ne,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(I){const ne=I+this.timeAdded;neIe.getLayer(Wt)).filter(Boolean);if(Ct.length!==0){yt.layers=Ct,yt.stateDependentLayerIds&&(yt.stateDependentLayers=yt.stateDependentLayerIds.map(Wt=>Ct.filter(nr=>nr.id===Wt)[0]));for(const Wt of Ct)ot[Wt.id]=yt}}return ot}(I.buckets,ne.style),this.hasSymbolBuckets=!1;for(const Se in this.buckets){const Ie=this.buckets[Se];if(Ie instanceof t.a6){if(this.hasSymbolBuckets=!0,!Te)break;Ie.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const Se in this.buckets){const Ie=this.buckets[Se];if(Ie instanceof t.a6&&Ie.hasRTLText){this.hasRTLText=!0,$e().lazyLoad();break}}this.queryPadding=0;for(const Se in this.buckets){const Ie=this.buckets[Se];this.queryPadding=Math.max(this.queryPadding,ne.style.getLayer(Se).queryRadius(Ie))}I.imageAtlas&&(this.imageAtlas=I.imageAtlas),I.glyphAtlasImage&&(this.glyphAtlasImage=I.glyphAtlasImage)}else this.collisionBoxArray=new t.a5}unloadVectorData(){for(const I in this.buckets)this.buckets[I].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(I){return this.buckets[I.id]}upload(I){for(const Te in this.buckets){const Se=this.buckets[Te];Se.uploadPending()&&Se.upload(I)}const ne=I.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new u(I,this.imageAtlas.image,ne.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new u(I,this.glyphAtlasImage,ne.ALPHA),this.glyphAtlasImage=null)}prepare(I){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(I,this.imageAtlasTexture)}queryRenderedFeatures(I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:Se,cameraQueryGeometry:Ie,scale:ot,tileSize:this.tileSize,pixelPosMatrix:nr,transform:Ct,params:yt,queryPadding:this.queryPadding*Wt},I,ne,Te):{}}querySourceFeatures(I,ne){const Te=this.latestFeatureIndex;if(!Te||!Te.rawTileData)return;const Se=Te.loadVTLayers(),Ie=ne&&ne.sourceLayer?ne.sourceLayer:"",ot=Se._geojsonTileLayer||Se[Ie];if(!ot)return;const yt=t.a7(ne&&ne.filter),{z:Ct,x:Wt,y:nr}=this.tileID.canonical,or={z:Ct,x:Wt,y:nr};for(let Fr=0;FrTe)Se=!1;else if(ne)if(this.expirationTime{this.remove(I,Ie)},Te)),this.data[Se].push(Ie),this.order.push(Se),this.order.length>this.max){const ot=this._getAndRemoveByKey(this.order[0]);ot&&this.onRemove(ot)}return this}has(I){return I.wrapped().key in this.data}getAndRemove(I){return this.has(I)?this._getAndRemoveByKey(I.wrapped().key):null}_getAndRemoveByKey(I){const ne=this.data[I].shift();return ne.timeout&&clearTimeout(ne.timeout),this.data[I].length===0&&delete this.data[I],this.order.splice(this.order.indexOf(I),1),ne.value}getByKey(I){const ne=this.data[I];return ne?ne[0].value:null}get(I){return this.has(I)?this.data[I.wrapped().key][0].value:null}remove(I,ne){if(!this.has(I))return this;const Te=I.wrapped().key,Se=ne===void 0?0:this.data[Te].indexOf(ne),Ie=this.data[Te][Se];return this.data[Te].splice(Se,1),Ie.timeout&&clearTimeout(Ie.timeout),this.data[Te].length===0&&delete this.data[Te],this.onRemove(Ie.value),this.order.splice(this.order.indexOf(Te),1),this}setMaxSize(I){for(this.max=I;this.order.length>this.max;){const ne=this._getAndRemoveByKey(this.order[0]);ne&&this.onRemove(ne)}return this}filter(I){const ne=[];for(const Te in this.data)for(const Se of this.data[Te])I(Se.value)||ne.push(Se);for(const Te of ne)this.remove(Te.value.tileID,Te)}}class At{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(I,ne,Te){const Se=String(ne);if(this.stateChanges[I]=this.stateChanges[I]||{},this.stateChanges[I][Se]=this.stateChanges[I][Se]||{},t.e(this.stateChanges[I][Se],Te),this.deletedStates[I]===null){this.deletedStates[I]={};for(const Ie in this.state[I])Ie!==Se&&(this.deletedStates[I][Ie]=null)}else if(this.deletedStates[I]&&this.deletedStates[I][Se]===null){this.deletedStates[I][Se]={};for(const Ie in this.state[I][Se])Te[Ie]||(this.deletedStates[I][Se][Ie]=null)}else for(const Ie in Te)this.deletedStates[I]&&this.deletedStates[I][Se]&&this.deletedStates[I][Se][Ie]===null&&delete this.deletedStates[I][Se][Ie]}removeFeatureState(I,ne,Te){if(this.deletedStates[I]===null)return;const Se=String(ne);if(this.deletedStates[I]=this.deletedStates[I]||{},Te&&ne!==void 0)this.deletedStates[I][Se]!==null&&(this.deletedStates[I][Se]=this.deletedStates[I][Se]||{},this.deletedStates[I][Se][Te]=null);else if(ne!==void 0)if(this.stateChanges[I]&&this.stateChanges[I][Se])for(Te in this.deletedStates[I][Se]={},this.stateChanges[I][Se])this.deletedStates[I][Se][Te]=null;else this.deletedStates[I][Se]=null;else this.deletedStates[I]=null}getState(I,ne){const Te=String(ne),Se=t.e({},(this.state[I]||{})[Te],(this.stateChanges[I]||{})[Te]);if(this.deletedStates[I]===null)return{};if(this.deletedStates[I]){const Ie=this.deletedStates[I][ne];if(Ie===null)return{};for(const ot in Ie)delete Se[ot]}return Se}initializeTileState(I,ne){I.setFeatureState(this.state,ne)}coalesceChanges(I,ne){const Te={};for(const Se in this.stateChanges){this.state[Se]=this.state[Se]||{};const Ie={};for(const ot in this.stateChanges[Se])this.state[Se][ot]||(this.state[Se][ot]={}),t.e(this.state[Se][ot],this.stateChanges[Se][ot]),Ie[ot]=this.state[Se][ot];Te[Se]=Ie}for(const Se in this.deletedStates){this.state[Se]=this.state[Se]||{};const Ie={};if(this.deletedStates[Se]===null)for(const ot in this.state[Se])Ie[ot]={},this.state[Se][ot]={};else for(const ot in this.deletedStates[Se]){if(this.deletedStates[Se][ot]===null)this.state[Se][ot]={};else for(const yt of Object.keys(this.deletedStates[Se][ot]))delete this.state[Se][ot][yt];Ie[ot]=this.state[Se][ot]}Te[Se]=Te[Se]||{},t.e(Te[Se],Ie)}if(this.stateChanges={},this.deletedStates={},Object.keys(Te).length!==0)for(const Se in I)I[Se].setFeatureState(Te,ne)}}class St extends t.E{constructor(I,ne,Te){super(),this.id=I,this.dispatcher=Te,this.on("data",Se=>this._dataHandler(Se)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((Se,Ie,ot,yt)=>{const Ct=new(Me(Ie.type))(Se,Ie,ot,yt);if(Ct.id!==Se)throw new Error(`Expected Source id to be ${Se} instead of ${Ct.id}`);return Ct})(I,ne,Te,this),this._tiles={},this._cache=new Je(0,Se=>this._unloadTile(Se)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new At,this._didEmitContent=!1,this._updated=!1}onAdd(I){this.map=I,this._maxTileCacheSize=I?I._maxTileCacheSize:null,this._maxTileCacheZoomLevels=I?I._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(I)}onRemove(I){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(I)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const I in this._tiles){const ne=this._tiles[I];if(ne.state!=="loaded"&&ne.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const I=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,I&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(I,ne,Te){return t._(this,void 0,void 0,function*(){try{yield this._source.loadTile(I),this._tileLoaded(I,ne,Te)}catch(Se){I.state="errored",Se.status!==404?this._source.fire(new t.j(Se,{tile:I})):this.update(this.transform,this.terrain)}})}_unloadTile(I){this._source.unloadTile&&this._source.unloadTile(I)}_abortTile(I){this._source.abortTile&&this._source.abortTile(I),this._source.fire(new t.k("dataabort",{tile:I,coord:I.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(I){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const ne in this._tiles){const Te=this._tiles[ne];Te.upload(I),Te.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(I=>I.tileID).sort(Rt).map(I=>I.key)}getRenderableIds(I){const ne=[];for(const Te in this._tiles)this._isIdRenderable(Te,I)&&ne.push(this._tiles[Te]);return I?ne.sort((Te,Se)=>{const Ie=Te.tileID,ot=Se.tileID,yt=new t.P(Ie.canonical.x,Ie.canonical.y)._rotate(this.transform.angle),Ct=new t.P(ot.canonical.x,ot.canonical.y)._rotate(this.transform.angle);return Ie.overscaledZ-ot.overscaledZ||Ct.y-yt.y||Ct.x-yt.x}).map(Te=>Te.tileID.key):ne.map(Te=>Te.tileID).sort(Rt).map(Te=>Te.key)}hasRenderableParent(I){const ne=this.findLoadedParent(I,0);return!!ne&&this._isIdRenderable(ne.tileID.key)}_isIdRenderable(I,ne){return this._tiles[I]&&this._tiles[I].hasData()&&!this._coveredTiles[I]&&(ne||!this._tiles[I].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const I in this._tiles)this._tiles[I].state!=="errored"&&this._reloadTile(I,"reloading")}}_reloadTile(I,ne){return t._(this,void 0,void 0,function*(){const Te=this._tiles[I];Te&&(Te.state!=="loading"&&(Te.state=ne),yield this._loadTile(Te,I,ne))})}_tileLoaded(I,ne,Te){I.timeAdded=i.now(),Te==="expired"&&(I.refreshedUponExpiration=!0),this._setTileReloadTimer(ne,I),this.getSource().type==="raster-dem"&&I.dem&&this._backfillDEM(I),this._state.initializeTileState(I,this.map?this.map.painter:null),I.aborted||this._source.fire(new t.k("data",{dataType:"source",tile:I,coord:I.tileID}))}_backfillDEM(I){const ne=this.getRenderableIds();for(let Se=0;Se1||(Math.abs(ot)>1&&(Math.abs(ot+Ct)===1?ot+=Ct:Math.abs(ot-Ct)===1&&(ot-=Ct)),Ie.dem&&Se.dem&&(Se.dem.backfillBorder(Ie.dem,ot,yt),Se.neighboringTiles&&Se.neighboringTiles[Wt]&&(Se.neighboringTiles[Wt].backfilled=!0)))}}getTile(I){return this.getTileByID(I.key)}getTileByID(I){return this._tiles[I]}_retainLoadedChildren(I,ne,Te,Se){for(const Ie in this._tiles){let ot=this._tiles[Ie];if(Se[Ie]||!ot.hasData()||ot.tileID.overscaledZ<=ne||ot.tileID.overscaledZ>Te)continue;let yt=ot.tileID;for(;ot&&ot.tileID.overscaledZ>ne+1;){const Wt=ot.tileID.scaledTo(ot.tileID.overscaledZ-1);ot=this._tiles[Wt.key],ot&&ot.hasData()&&(yt=Wt)}let Ct=yt;for(;Ct.overscaledZ>ne;)if(Ct=Ct.scaledTo(Ct.overscaledZ-1),I[Ct.key]){Se[yt.key]=yt;break}}}findLoadedParent(I,ne){if(I.key in this._loadedParentTiles){const Te=this._loadedParentTiles[I.key];return Te&&Te.tileID.overscaledZ>=ne?Te:null}for(let Te=I.overscaledZ-1;Te>=ne;Te--){const Se=I.scaledTo(Te),Ie=this._getLoadedTile(Se);if(Ie)return Ie}}findLoadedSibling(I){return this._getLoadedTile(I)}_getLoadedTile(I){const ne=this._tiles[I.key];return ne&&ne.hasData()?ne:this._cache.getByKey(I.wrapped().key)}updateCacheSize(I){const ne=Math.ceil(I.width/this._source.tileSize)+1,Te=Math.ceil(I.height/this._source.tileSize)+1,Se=Math.floor(ne*Te*(this._maxTileCacheZoomLevels===null?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),Ie=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Se):Se;this._cache.setMaxSize(Ie)}handleWrapJump(I){const ne=Math.round((I-(this._prevLng===void 0?I:this._prevLng))/360);if(this._prevLng=I,ne){const Te={};for(const Se in this._tiles){const Ie=this._tiles[Se];Ie.tileID=Ie.tileID.unwrapTo(Ie.tileID.wrap+ne),Te[Ie.tileID.key]=Ie}this._tiles=Te;for(const Se in this._timers)clearTimeout(this._timers[Se]),delete this._timers[Se];for(const Se in this._tiles)this._setTileReloadTimer(Se,this._tiles[Se])}}_updateCoveredAndRetainedTiles(I,ne,Te,Se,Ie,ot){const yt={},Ct={},Wt=Object.keys(I),nr=i.now();for(const or of Wt){const Fr=I[or],Wr=this._tiles[or];if(!Wr||Wr.fadeEndTime!==0&&Wr.fadeEndTime<=nr)continue;const je=this.findLoadedParent(Fr,ne),Ze=this.findLoadedSibling(Fr),at=je||Ze||null;at&&(this._addTile(at.tileID),yt[at.tileID.key]=at.tileID),Ct[or]=Fr}this._retainLoadedChildren(Ct,Se,Te,I);for(const or in yt)I[or]||(this._coveredTiles[or]=!0,I[or]=yt[or]);if(ot){const or={},Fr={};for(const Wr of Ie)this._tiles[Wr.key].hasData()?or[Wr.key]=Wr:Fr[Wr.key]=Wr;for(const Wr in Fr){const je=Fr[Wr].children(this._source.maxzoom);this._tiles[je[0].key]&&this._tiles[je[1].key]&&this._tiles[je[2].key]&&this._tiles[je[3].key]&&(or[je[0].key]=I[je[0].key]=je[0],or[je[1].key]=I[je[1].key]=je[1],or[je[2].key]=I[je[2].key]=je[2],or[je[3].key]=I[je[3].key]=je[3],delete Fr[Wr])}for(const Wr in Fr){const je=Fr[Wr],Ze=this.findLoadedParent(je,this._source.minzoom),at=this.findLoadedSibling(je),lt=Ze||at||null;if(lt){or[lt.tileID.key]=I[lt.tileID.key]=lt.tileID;for(const Tt in or)or[Tt].isChildOf(lt.tileID)&&delete or[Tt]}}for(const Wr in this._tiles)or[Wr]||(this._coveredTiles[Wr]=!0)}}update(I,ne){if(!this._sourceLoaded||this._paused)return;let Te;this.transform=I,this.terrain=ne,this.updateCacheSize(I),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?Te=I.getVisibleUnwrappedCoordinates(this._source.tileID).map(nr=>new t.S(nr.canonical.z,nr.wrap,nr.canonical.z,nr.canonical.x,nr.canonical.y)):(Te=I.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:ne}),this._source.hasTile&&(Te=Te.filter(nr=>this._source.hasTile(nr)))):Te=[];const Se=I.coveringZoomLevel(this._source),Ie=Math.max(Se-St.maxOverzooming,this._source.minzoom),ot=Math.max(Se+St.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const nr={};for(const or of Te)if(or.canonical.z>this._source.minzoom){const Fr=or.scaledTo(or.canonical.z-1);nr[Fr.key]=Fr;const Wr=or.scaledTo(Math.max(this._source.minzoom,Math.min(or.canonical.z,5)));nr[Wr.key]=Wr}Te=Te.concat(Object.values(nr))}const yt=Te.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,yt&&this.fire(new t.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const Ct=this._updateRetainedTiles(Te,Se);Ut(this._source.type)&&this._updateCoveredAndRetainedTiles(Ct,Ie,ot,Se,Te,ne);for(const nr in Ct)this._tiles[nr].clearFadeHold();const Wt=t.ab(this._tiles,Ct);for(const nr of Wt){const or=this._tiles[nr];or.hasSymbolBuckets&&!or.holdingForFade()?or.setHoldDuration(this.map._fadeDuration):or.hasSymbolBuckets&&!or.symbolFadeFinished()||this._removeTile(nr)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const I in this._tiles)this._tiles[I].holdingForFade()&&this._removeTile(I)}_updateRetainedTiles(I,ne){var Te;const Se={},Ie={},ot=Math.max(ne-St.maxOverzooming,this._source.minzoom),yt=Math.max(ne+St.maxUnderzooming,this._source.minzoom),Ct={};for(const Wt of I){const nr=this._addTile(Wt);Se[Wt.key]=Wt,nr.hasData()||nethis._source.maxzoom){const Fr=Wt.children(this._source.maxzoom)[0],Wr=this.getTile(Fr);if(Wr&&Wr.hasData()){Se[Fr.key]=Fr;continue}}else{const Fr=Wt.children(this._source.maxzoom);if(Se[Fr[0].key]&&Se[Fr[1].key]&&Se[Fr[2].key]&&Se[Fr[3].key])continue}let or=nr.wasRequested();for(let Fr=Wt.overscaledZ-1;Fr>=ot;--Fr){const Wr=Wt.scaledTo(Fr);if(Ie[Wr.key])break;if(Ie[Wr.key]=!0,nr=this.getTile(Wr),!nr&&or&&(nr=this._addTile(Wr)),nr){const je=nr.hasData();if((je||!(!((Te=this.map)===null||Te===void 0)&&Te.cancelPendingTileRequestsWhileZooming)||or)&&(Se[Wr.key]=Wr),or=nr.wasRequested(),je)break}}}return Se}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const I in this._tiles){const ne=[];let Te,Se=this._tiles[I].tileID;for(;Se.overscaledZ>0;){if(Se.key in this._loadedParentTiles){Te=this._loadedParentTiles[Se.key];break}ne.push(Se.key);const Ie=Se.scaledTo(Se.overscaledZ-1);if(Te=this._getLoadedTile(Ie),Te)break;Se=Ie}for(const Ie of ne)this._loadedParentTiles[Ie]=Te}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const I in this._tiles){const ne=this._tiles[I].tileID,Te=this._getLoadedTile(ne);this._loadedSiblingTiles[ne.key]=Te}}_addTile(I){let ne=this._tiles[I.key];if(ne)return ne;ne=this._cache.getAndRemove(I),ne&&(this._setTileReloadTimer(I.key,ne),ne.tileID=I,this._state.initializeTileState(ne,this.map?this.map.painter:null),this._cacheTimers[I.key]&&(clearTimeout(this._cacheTimers[I.key]),delete this._cacheTimers[I.key],this._setTileReloadTimer(I.key,ne)));const Te=ne;return ne||(ne=new rt(I,this._source.tileSize*I.overscaleFactor()),this._loadTile(ne,I.key,ne.state)),ne.uses++,this._tiles[I.key]=ne,Te||this._source.fire(new t.k("dataloading",{tile:ne,coord:ne.tileID,dataType:"source"})),ne}_setTileReloadTimer(I,ne){I in this._timers&&(clearTimeout(this._timers[I]),delete this._timers[I]);const Te=ne.getExpiryTimeout();Te&&(this._timers[I]=setTimeout(()=>{this._reloadTile(I,"expired"),delete this._timers[I]},Te))}_removeTile(I){const ne=this._tiles[I];ne&&(ne.uses--,delete this._tiles[I],this._timers[I]&&(clearTimeout(this._timers[I]),delete this._timers[I]),ne.uses>0||(ne.hasData()&&ne.state!=="reloading"?this._cache.add(ne.tileID,ne,ne.getExpiryTimeout()):(ne.aborted=!0,this._abortTile(ne),this._unloadTile(ne))))}_dataHandler(I){const ne=I.sourceDataType;I.dataType==="source"&&ne==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&I.dataType==="source"&&ne==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const I in this._tiles)this._removeTile(I);this._cache.reset()}tilesIn(I,ne,Te){const Se=[],Ie=this.transform;if(!Ie)return Se;const ot=Te?Ie.getCameraQueryGeometry(I):I,yt=I.map(je=>Ie.pointCoordinate(je,this.terrain)),Ct=ot.map(je=>Ie.pointCoordinate(je,this.terrain)),Wt=this.getIds();let nr=1/0,or=1/0,Fr=-1/0,Wr=-1/0;for(const je of Ct)nr=Math.min(nr,je.x),or=Math.min(or,je.y),Fr=Math.max(Fr,je.x),Wr=Math.max(Wr,je.y);for(let je=0;je=0&>[1].y+Tt>=0){const Et=yt.map(rr=>at.getTilePoint(rr)),Yt=Ct.map(rr=>at.getTilePoint(rr));Se.push({tile:Ze,tileID:at,queryGeometry:Et,cameraQueryGeometry:Yt,scale:lt})}}return Se}getVisibleCoordinates(I){const ne=this.getRenderableIds(I).map(Te=>this._tiles[Te].tileID);for(const Te of ne)Te.posMatrix=this.transform.calculatePosMatrix(Te.toUnwrapped());return ne}hasTransition(){if(this._source.hasTransition())return!0;if(Ut(this._source.type)){const I=i.now();for(const ne in this._tiles)if(this._tiles[ne].fadeEndTime>=I)return!0}return!1}setFeatureState(I,ne,Te){this._state.updateState(I=I||"_geojsonTileLayer",ne,Te)}removeFeatureState(I,ne,Te){this._state.removeFeatureState(I=I||"_geojsonTileLayer",ne,Te)}getFeatureState(I,ne){return this._state.getState(I=I||"_geojsonTileLayer",ne)}setDependencies(I,ne,Te){const Se=this._tiles[I];Se&&Se.setDependencies(ne,Te)}reloadTilesForDependencies(I,ne){for(const Te in this._tiles)this._tiles[Te].hasDependency(I,ne)&&this._reloadTile(Te,"reloading");this._cache.filter(Te=>!Te.hasDependency(I,ne))}}function Rt(De,I){const ne=Math.abs(2*De.wrap)-+(De.wrap<0),Te=Math.abs(2*I.wrap)-+(I.wrap<0);return De.overscaledZ-I.overscaledZ||Te-ne||I.canonical.y-De.canonical.y||I.canonical.x-De.canonical.x}function Ut(De){return De==="raster"||De==="image"||De==="video"}St.maxOverzooming=10,St.maxUnderzooming=3;class ir{constructor(I,ne){this.reset(I,ne)}reset(I,ne){this.points=I||[],this._distances=[0];for(let Te=1;Te0?(Se-ot)/yt:0;return this.points[Ie].mult(1-Ct).add(this.points[ne].mult(Ct))}}function ar(De,I){let ne=!0;return De==="always"||De!=="never"&&I!=="never"||(ne=!1),ne}class Mr{constructor(I,ne,Te){const Se=this.boxCells=[],Ie=this.circleCells=[];this.xCellCount=Math.ceil(I/Te),this.yCellCount=Math.ceil(ne/Te);for(let ot=0;otthis.width||Se<0||ne>this.height)return[];const Ct=[];if(I<=0&&ne<=0&&this.width<=Te&&this.height<=Se){if(Ie)return[{key:null,x1:I,y1:ne,x2:Te,y2:Se}];for(let Wt=0;Wt0}hitTestCircle(I,ne,Te,Se,Ie){const ot=I-Te,yt=I+Te,Ct=ne-Te,Wt=ne+Te;if(yt<0||ot>this.width||Wt<0||Ct>this.height)return!1;const nr=[];return this._forEachCell(ot,Ct,yt,Wt,this._queryCellCircle,nr,{hitTest:!0,overlapMode:Se,circle:{x:I,y:ne,radius:Te},seenUids:{box:{},circle:{}}},Ie),nr.length>0}_queryCell(I,ne,Te,Se,Ie,ot,yt,Ct){const{seenUids:Wt,hitTest:nr,overlapMode:or}=yt,Fr=this.boxCells[Ie];if(Fr!==null){const je=this.bboxes;for(const Ze of Fr)if(!Wt.box[Ze]){Wt.box[Ze]=!0;const at=4*Ze,lt=this.boxKeys[Ze];if(I<=je[at+2]&&ne<=je[at+3]&&Te>=je[at+0]&&Se>=je[at+1]&&(!Ct||Ct(lt))&&(!nr||!ar(or,lt.overlapMode))&&(ot.push({key:lt,x1:je[at],y1:je[at+1],x2:je[at+2],y2:je[at+3]}),nr))return!0}}const Wr=this.circleCells[Ie];if(Wr!==null){const je=this.circles;for(const Ze of Wr)if(!Wt.circle[Ze]){Wt.circle[Ze]=!0;const at=3*Ze,lt=this.circleKeys[Ze];if(this._circleAndRectCollide(je[at],je[at+1],je[at+2],I,ne,Te,Se)&&(!Ct||Ct(lt))&&(!nr||!ar(or,lt.overlapMode))){const Tt=je[at],gt=je[at+1],Et=je[at+2];if(ot.push({key:lt,x1:Tt-Et,y1:gt-Et,x2:Tt+Et,y2:gt+Et}),nr)return!0}}}return!1}_queryCellCircle(I,ne,Te,Se,Ie,ot,yt,Ct){const{circle:Wt,seenUids:nr,overlapMode:or}=yt,Fr=this.boxCells[Ie];if(Fr!==null){const je=this.bboxes;for(const Ze of Fr)if(!nr.box[Ze]){nr.box[Ze]=!0;const at=4*Ze,lt=this.boxKeys[Ze];if(this._circleAndRectCollide(Wt.x,Wt.y,Wt.radius,je[at+0],je[at+1],je[at+2],je[at+3])&&(!Ct||Ct(lt))&&!ar(or,lt.overlapMode))return ot.push(!0),!0}}const Wr=this.circleCells[Ie];if(Wr!==null){const je=this.circles;for(const Ze of Wr)if(!nr.circle[Ze]){nr.circle[Ze]=!0;const at=3*Ze,lt=this.circleKeys[Ze];if(this._circlesCollide(je[at],je[at+1],je[at+2],Wt.x,Wt.y,Wt.radius)&&(!Ct||Ct(lt))&&!ar(or,lt.overlapMode))return ot.push(!0),!0}}}_forEachCell(I,ne,Te,Se,Ie,ot,yt,Ct){const Wt=this._convertToXCellCoord(I),nr=this._convertToYCellCoord(ne),or=this._convertToXCellCoord(Te),Fr=this._convertToYCellCoord(Se);for(let Wr=Wt;Wr<=or;Wr++)for(let je=nr;je<=Fr;je++)if(Ie.call(this,I,ne,Te,Se,this.xCellCount*je+Wr,ot,yt,Ct))return}_convertToXCellCoord(I){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(I*this.xScale)))}_convertToYCellCoord(I){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(I*this.yScale)))}_circlesCollide(I,ne,Te,Se,Ie,ot){const yt=Se-I,Ct=Ie-ne,Wt=Te+ot;return Wt*Wt>yt*yt+Ct*Ct}_circleAndRectCollide(I,ne,Te,Se,Ie,ot,yt){const Ct=(ot-Se)/2,Wt=Math.abs(I-(Se+Ct));if(Wt>Ct+Te)return!1;const nr=(yt-Ie)/2,or=Math.abs(ne-(Ie+nr));if(or>nr+Te)return!1;if(Wt<=Ct||or<=nr)return!0;const Fr=Wt-Ct,Wr=or-nr;return Fr*Fr+Wr*Wr<=Te*Te}}function fr(De,I,ne,Te,Se){const Ie=t.H();return I?(t.K(Ie,Ie,[1/Se,1/Se,1]),ne||t.ad(Ie,Ie,Te.angle)):t.L(Ie,Te.labelPlaneMatrix,De),Ie}function dr(De,I,ne,Te,Se){if(I){const Ie=t.ae(De);return t.K(Ie,Ie,[Se,Se,1]),ne||t.ad(Ie,Ie,-Te.angle),Ie}return Te.glCoordMatrix}function pt(De,I,ne,Te){let Se;Te?(Se=[De,I,Te(De,I),1],t.af(Se,Se,ne)):(Se=[De,I,0,1],Zt(Se,Se,ne));const Ie=Se[3];return{point:new t.P(Se[0]/Ie,Se[1]/Ie),signedDistanceFromCamera:Ie,isOccluded:!1}}function ze(De,I){return .5+De/I*.5}function Ge(De,I){return De.x>=-I[0]&&De.x<=I[0]&&De.y>=-I[1]&&De.y<=I[1]}function Oe(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr,je){const Ze=Te?De.textSizeData:De.iconSizeData,at=t.ag(Ze,ne.transform.zoom),lt=[256/ne.width*2+1,256/ne.height*2+1],Tt=Te?De.text.dynamicLayoutVertexArray:De.icon.dynamicLayoutVertexArray;Tt.clear();const gt=De.lineVertexArray,Et=Te?De.text.placedSymbolArray:De.icon.placedSymbolArray,Yt=ne.transform.width/ne.transform.height;let rr=!1;for(let sr=0;srMath.abs(ne.x-I.x)*Te?{useVertical:!0}:(De===t.ah.vertical?I.yne.x)?{needsFlipping:!0}:null}function be(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr){const or=ne/24,Fr=I.lineOffsetX*or,Wr=I.lineOffsetY*or;let je;if(I.numGlyphs>1){const Ze=I.glyphStartIndex+I.numGlyphs,at=I.lineStartIndex,lt=I.lineStartIndex+I.lineLength,Tt=ve(or,yt,Fr,Wr,Te,I,nr,De);if(!Tt)return{notEnoughRoom:!0};const gt=pt(Tt.first.point.x,Tt.first.point.y,ot,De.getElevation).point,Et=pt(Tt.last.point.x,Tt.last.point.y,ot,De.getElevation).point;if(Se&&!Te){const Yt=ge(I.writingMode,gt,Et,Wt);if(Yt)return Yt}je=[Tt.first];for(let Yt=I.glyphStartIndex+1;Yt0?gt.point:function(rr,sr,Sr,Nr,Qr,ia){return Pe(rr,sr,Sr,1,Qr,ia)}(De.tileAnchorPoint,Tt,at,0,Ie,De),Yt=ge(I.writingMode,at,Et,Wt);if(Yt)return Yt}const Ze=Nt(or*yt.getoffsetX(I.glyphStartIndex),Fr,Wr,Te,I.segment,I.lineStartIndex,I.lineStartIndex+I.lineLength,De,nr);if(!Ze||De.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};je=[Ze]}for(const Ze of je)t.aj(Ct,Ze.point,Ze.angle);return{}}function Pe(De,I,ne,Te,Se,Ie){const ot=De.add(De.sub(I)._unit()),yt=Se!==void 0?pt(ot.x,ot.y,Se,Ie.getElevation).point:ct(ot.x,ot.y,Ie).point,Ct=ne.sub(yt);return ne.add(Ct._mult(Te/Ct.mag()))}function We(De,I,ne){const Te=I.projectionCache;if(Te.projections[De])return Te.projections[De];const Se=new t.P(I.lineVertexArray.getx(De),I.lineVertexArray.gety(De)),Ie=ct(Se.x,Se.y,I);if(Ie.signedDistanceFromCamera>0)return Te.projections[De]=Ie.point,Te.anyProjectionOccluded=Te.anyProjectionOccluded||Ie.isOccluded,Ie.point;const ot=De-ne.direction;return function(yt,Ct,Wt,nr,or){return Pe(yt,Ct,Wt,nr,void 0,or)}(ne.distanceFromAnchor===0?I.tileAnchorPoint:new t.P(I.lineVertexArray.getx(ot),I.lineVertexArray.gety(ot)),Se,ne.previousVertex,ne.absOffsetX-ne.distanceFromAnchor+1,I)}function ct(De,I,ne){const Te=De+ne.translation[0],Se=I+ne.translation[1];let Ie;return!ne.pitchWithMap&&ne.projection.useSpecialProjectionForSymbols?(Ie=ne.projection.projectTileCoordinates(Te,Se,ne.unwrappedTileID,ne.getElevation),Ie.point.x=(.5*Ie.point.x+.5)*ne.width,Ie.point.y=(.5*-Ie.point.y+.5)*ne.height):(Ie=pt(Te,Se,ne.labelPlaneMatrix,ne.getElevation),Ie.isOccluded=!1),Ie}function _t(De,I,ne){return De._unit()._perp()._mult(I*ne)}function Mt(De,I,ne,Te,Se,Ie,ot,yt,Ct){if(yt.projectionCache.offsets[De])return yt.projectionCache.offsets[De];const Wt=ne.add(I);if(De+Ct.direction=Se)return yt.projectionCache.offsets[De]=Wt,Wt;const nr=We(De+Ct.direction,yt,Ct),or=_t(nr.sub(ne),ot,Ct.direction),Fr=ne.add(or),Wr=nr.add(or);return yt.projectionCache.offsets[De]=t.ak(Ie,Wt,Fr,Wr)||Wt,yt.projectionCache.offsets[De]}function Nt(De,I,ne,Te,Se,Ie,ot,yt,Ct){const Wt=Te?De-I:De+I;let nr=Wt>0?1:-1,or=0;Te&&(nr*=-1,or=Math.PI),nr<0&&(or+=Math.PI);let Fr,Wr=nr>0?Ie+Se:Ie+Se+1;yt.projectionCache.cachedAnchorPoint?Fr=yt.projectionCache.cachedAnchorPoint:(Fr=ct(yt.tileAnchorPoint.x,yt.tileAnchorPoint.y,yt).point,yt.projectionCache.cachedAnchorPoint=Fr);let je,Ze,at=Fr,lt=Fr,Tt=0,gt=0;const Et=Math.abs(Wt),Yt=[];let rr;for(;Tt+gt<=Et;){if(Wr+=nr,Wr=ot)return null;Tt+=gt,lt=at,Ze=je;const Nr={absOffsetX:Et,direction:nr,distanceFromAnchor:Tt,previousVertex:lt};if(at=We(Wr,yt,Nr),ne===0)Yt.push(lt),rr=at.sub(lt);else{let Qr;const ia=at.sub(lt);Qr=ia.mag()===0?_t(We(Wr+nr,yt,Nr).sub(at),ne,nr):_t(ia,ne,nr),Ze||(Ze=lt.add(Qr)),je=Mt(Wr,Qr,at,Ie,ot,Ze,ne,yt,Nr),Yt.push(Ze),rr=je.sub(Ze)}gt=rr.mag()}const sr=rr._mult((Et-Tt)/gt)._add(Ze||lt),Sr=or+Math.atan2(at.y-lt.y,at.x-lt.x);return Yt.push(sr),{point:sr,angle:Ct?Sr:0,path:Yt}}const Bt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function qt(De,I){for(let ne=0;ne=1;ii--)ln.push(nn.path[ii]);for(let ii=1;iiGi.signedDistanceFromCamera<=0)?[]:ii.map(Gi=>Gi.point)}let pi=[];if(ln.length>0){const ii=ln[0].clone(),Gi=ln[0].clone();for(let Bo=1;Bo=ia.x&&Gi.x<=_a.x&&ii.y>=ia.y&&Gi.y<=_a.y?[ln]:Gi.x_a.x||Gi.y_a.y?[]:t.al([ln],ia.x,ia.y,_a.x,_a.y)}for(const ii of pi){za.reset(ii,.25*Qr);let Gi=0;Gi=za.length<=.5*Qr?1:Math.ceil(za.paddedLength/Nn)+1;for(let Bo=0;Bopt(Se.x,Se.y,Te,ne.getElevation))}queryRenderedSymbols(I){if(I.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const ne=[];let Te=1/0,Se=1/0,Ie=-1/0,ot=-1/0;for(const nr of I){const or=new t.P(nr.x+lr,nr.y+lr);Te=Math.min(Te,or.x),Se=Math.min(Se,or.y),Ie=Math.max(Ie,or.x),ot=Math.max(ot,or.y),ne.push(or)}const yt=this.grid.query(Te,Se,Ie,ot).concat(this.ignoredGrid.query(Te,Se,Ie,ot)),Ct={},Wt={};for(const nr of yt){const or=nr.key;if(Ct[or.bucketInstanceId]===void 0&&(Ct[or.bucketInstanceId]={}),Ct[or.bucketInstanceId][or.featureIndex])continue;const Fr=[new t.P(nr.x1,nr.y1),new t.P(nr.x2,nr.y1),new t.P(nr.x2,nr.y2),new t.P(nr.x1,nr.y2)];t.am(ne,Fr)&&(Ct[or.bucketInstanceId][or.featureIndex]=!0,Wt[or.bucketInstanceId]===void 0&&(Wt[or.bucketInstanceId]=[]),Wt[or.bucketInstanceId].push(or.featureIndex))}return Wt}insertCollisionBox(I,ne,Te,Se,Ie,ot){(Te?this.ignoredGrid:this.grid).insert({bucketInstanceId:Se,featureIndex:Ie,collisionGroupID:ot,overlapMode:ne},I[0],I[1],I[2],I[3])}insertCollisionCircles(I,ne,Te,Se,Ie,ot){const yt=Te?this.ignoredGrid:this.grid,Ct={bucketInstanceId:Se,featureIndex:Ie,collisionGroupID:ot,overlapMode:ne};for(let Wt=0;Wt=this.screenRightBoundary||Sethis.screenBottomBoundary}isInsideGrid(I,ne,Te,Se){return Te>=0&&I=0&&nethis.projectAndGetPerspectiveRatio(Te,Qr.x,Qr.y,Se,Wt));Sr=Nr.some(Qr=>!Qr.isOccluded),sr=Nr.map(Qr=>Qr.point)}else Sr=!0;return{box:t.ao(sr),allPointsOccluded:!Sr}}}function da(De,I,ne){return I*(t.X/(De.tileSize*Math.pow(2,ne-De.tileID.overscaledZ)))}class wa{constructor(I,ne,Te,Se){this.opacity=I?Math.max(0,Math.min(1,I.opacity+(I.placed?ne:-ne))):Se&&Te?1:0,this.placed=Te}isHidden(){return this.opacity===0&&!this.placed}}class ma{constructor(I,ne,Te,Se,Ie){this.text=new wa(I?I.text:null,ne,Te,Ie),this.icon=new wa(I?I.icon:null,ne,Se,Ie)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ia{constructor(I,ne,Te){this.text=I,this.icon=ne,this.skipFade=Te}}class va{constructor(){this.invProjMatrix=t.H(),this.viewportMatrix=t.H(),this.circles=[]}}class La{constructor(I,ne,Te,Se,Ie){this.bucketInstanceId=I,this.featureIndex=ne,this.sourceLayerIndex=Te,this.bucketIndex=Se,this.tileID=Ie}}class Ka{constructor(I){this.crossSourceCollisions=I,this.maxGroupID=0,this.collisionGroups={}}get(I){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[I]){const ne=++this.maxGroupID;this.collisionGroups[I]={ID:ne,predicate:Te=>Te.collisionGroupID===ne}}return this.collisionGroups[I]}}function Vt(De,I,ne,Te,Se){const{horizontalAlign:Ie,verticalAlign:ot}=t.au(De);return new t.P(-(Ie-.5)*I+Te[0]*Se,-(ot-.5)*ne+Te[1]*Se)}class Lt{constructor(I,ne,Te,Se,Ie,ot){this.transform=I.clone(),this.terrain=Te,this.collisionIndex=new ta(this.transform,ne),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=Se,this.retainedQueryData={},this.collisionGroups=new Ka(Ie),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=ot,ot&&(ot.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(I){const ne=this.terrain;return ne?(Te,Se)=>ne.getElevation(I,Te,Se):null}getBucketParts(I,ne,Te,Se){const Ie=Te.getBucket(ne),ot=Te.latestFeatureIndex;if(!Ie||!ot||ne.id!==Ie.layerIds[0])return;const yt=Te.collisionBoxArray,Ct=Ie.layers[0].layout,Wt=Ie.layers[0].paint,nr=Math.pow(2,this.transform.zoom-Te.tileID.overscaledZ),or=Te.tileSize/t.X,Fr=Te.tileID.toUnwrapped(),Wr=this.transform.calculatePosMatrix(Fr),je=Ct.get("text-pitch-alignment")==="map",Ze=Ct.get("text-rotation-alignment")==="map",at=da(Te,1,this.transform.zoom),lt=this.collisionIndex.mapProjection.translatePosition(this.transform,Te,Wt.get("text-translate"),Wt.get("text-translate-anchor")),Tt=this.collisionIndex.mapProjection.translatePosition(this.transform,Te,Wt.get("icon-translate"),Wt.get("icon-translate-anchor")),gt=fr(Wr,je,Ze,this.transform,at);let Et=null;if(je){const rr=dr(Wr,je,Ze,this.transform,at);Et=t.L([],this.transform.labelPlaneMatrix,rr)}this.retainedQueryData[Ie.bucketInstanceId]=new La(Ie.bucketInstanceId,ot,Ie.sourceLayerIndex,Ie.index,Te.tileID);const Yt={bucket:Ie,layout:Ct,translationText:lt,translationIcon:Tt,posMatrix:Wr,unwrappedTileID:Fr,textLabelPlaneMatrix:gt,labelToScreenMatrix:Et,scale:nr,textPixelRatio:or,holdingForFade:Te.holdingForFade(),collisionBoxArray:yt,partiallyEvaluatedTextSize:t.ag(Ie.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Ie.sourceID)};if(Se)for(const rr of Ie.sortKeyRanges){const{sortKey:sr,symbolInstanceStart:Sr,symbolInstanceEnd:Nr}=rr;I.push({sortKey:sr,symbolInstanceStart:Sr,symbolInstanceEnd:Nr,parameters:Yt})}else I.push({symbolInstanceStart:0,symbolInstanceEnd:Ie.symbolInstances.length,parameters:Yt})}attemptAnchorPlacement(I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr,je,Ze,at,lt,Tt,gt){const Et=t.aq[I.textAnchor],Yt=[I.textOffset0,I.textOffset1],rr=Vt(Et,Te,Se,Yt,Ie),sr=this.collisionIndex.placeCollisionBox(ne,Fr,Ct,Wt,nr,yt,ot,at,or.predicate,gt,rr);if((!Tt||this.collisionIndex.placeCollisionBox(Tt,Fr,Ct,Wt,nr,yt,ot,lt,or.predicate,gt,rr).placeable)&&sr.placeable){let Sr;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Wr.crossTileID]&&this.prevPlacement.placements[Wr.crossTileID]&&this.prevPlacement.placements[Wr.crossTileID].text&&(Sr=this.prevPlacement.variableOffsets[Wr.crossTileID].anchor),Wr.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Wr.crossTileID]={textOffset:Yt,width:Te,height:Se,anchor:Et,textBoxScale:Ie,prevAnchor:Sr},this.markUsedJustification(je,Et,Wr,Ze),je.allowVerticalPlacement&&(this.markUsedOrientation(je,Ze,Wr),this.placedOrientations[Wr.crossTileID]=Ze),{shift:rr,placedGlyphBoxes:sr}}}placeLayerBucketPart(I,ne,Te){const{bucket:Se,layout:Ie,translationText:ot,translationIcon:yt,posMatrix:Ct,unwrappedTileID:Wt,textLabelPlaneMatrix:nr,labelToScreenMatrix:or,textPixelRatio:Fr,holdingForFade:Wr,collisionBoxArray:je,partiallyEvaluatedTextSize:Ze,collisionGroup:at}=I.parameters,lt=Ie.get("text-optional"),Tt=Ie.get("icon-optional"),gt=t.ar(Ie,"text-overlap","text-allow-overlap"),Et=gt==="always",Yt=t.ar(Ie,"icon-overlap","icon-allow-overlap"),rr=Yt==="always",sr=Ie.get("text-rotation-alignment")==="map",Sr=Ie.get("text-pitch-alignment")==="map",Nr=Ie.get("icon-text-fit")!=="none",Qr=Ie.get("symbol-z-order")==="viewport-y",ia=Et&&(rr||!Se.hasIconData()||Tt),_a=rr&&(Et||!Se.hasTextData()||lt);!Se.collisionArrays&&je&&Se.deserializeCollisionBoxes(je);const za=this._getTerrainElevationFunc(this.retainedQueryData[Se.bucketInstanceId].tileID),nn=(en,ln,Nn)=>{var pi,ii;if(ne[en.crossTileID])return;if(Wr)return void(this.placements[en.crossTileID]=new Ia(!1,!1,!1));let Gi=!1,Bo=!1,No=!0,po=null,Zo={box:null,placeable:!1,offscreen:null},Hs={box:null,placeable:!1,offscreen:null},zs=null,xo=null,bo=null,vl=0,Al=0,pu=0;ln.textFeatureIndex?vl=ln.textFeatureIndex:en.useRuntimeCollisionCircles&&(vl=en.featureIndex),ln.verticalTextFeatureIndex&&(Al=ln.verticalTextFeatureIndex);const pe=ln.textBox;if(pe){const ht=$t=>{let Cr=t.ah.horizontal;if(Se.allowVerticalPlacement&&!$t&&this.prevPlacement){const Ar=this.prevPlacement.placedOrientations[en.crossTileID];Ar&&(this.placedOrientations[en.crossTileID]=Ar,Cr=Ar,this.markUsedOrientation(Se,Cr,en))}return Cr},xt=($t,Cr)=>{if(Se.allowVerticalPlacement&&en.numVerticalGlyphVertices>0&&ln.verticalTextBox){for(const Ar of Se.writingModes)if(Ar===t.ah.vertical?(Zo=Cr(),Hs=Zo):Zo=$t(),Zo&&Zo.placeable)break}else Zo=$t()},zt=en.textAnchorOffsetStartIndex,Dt=en.textAnchorOffsetEndIndex;if(Dt===zt){const $t=(Cr,Ar)=>{const Vr=this.collisionIndex.placeCollisionBox(Cr,gt,Fr,Ct,Wt,Sr,sr,ot,at.predicate,za);return Vr&&Vr.placeable&&(this.markUsedOrientation(Se,Ar,en),this.placedOrientations[en.crossTileID]=Ar),Vr};xt(()=>$t(pe,t.ah.horizontal),()=>{const Cr=ln.verticalTextBox;return Se.allowVerticalPlacement&&en.numVerticalGlyphVertices>0&&Cr?$t(Cr,t.ah.vertical):{box:null,offscreen:null}}),ht(Zo&&Zo.placeable)}else{let $t=t.aq[(ii=(pi=this.prevPlacement)===null||pi===void 0?void 0:pi.variableOffsets[en.crossTileID])===null||ii===void 0?void 0:ii.anchor];const Cr=(Vr,Kr,aa)=>{const Ua=Vr.x2-Vr.x1,la=Vr.y2-Vr.y1,Ta=en.textBoxScale,ka=Nr&&Yt==="never"?Kr:null;let Ba=null,Va=gt==="never"?1:2,Ma="never";$t&&Va++;for(let mn=0;mnCr(pe,ln.iconBox,t.ah.horizontal),()=>{const Vr=ln.verticalTextBox;return Se.allowVerticalPlacement&&(!Zo||!Zo.placeable)&&en.numVerticalGlyphVertices>0&&Vr?Cr(Vr,ln.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}}),Zo&&(Gi=Zo.placeable,No=Zo.offscreen);const Ar=ht(Zo&&Zo.placeable);if(!Gi&&this.prevPlacement){const Vr=this.prevPlacement.variableOffsets[en.crossTileID];Vr&&(this.variableOffsets[en.crossTileID]=Vr,this.markUsedJustification(Se,Vr.anchor,en,Ar))}}}if(zs=Zo,Gi=zs&&zs.placeable,No=zs&&zs.offscreen,en.useRuntimeCollisionCircles){const ht=Se.text.placedSymbolArray.get(en.centerJustifiedTextSymbolIndex),xt=t.ai(Se.textSizeData,Ze,ht),zt=Ie.get("text-padding");xo=this.collisionIndex.placeCollisionCircles(gt,ht,Se.lineVertexArray,Se.glyphOffsetArray,xt,Ct,Wt,nr,or,Te,Sr,at.predicate,en.collisionCircleDiameter,zt,ot,za),xo.circles.length&&xo.collisionDetected&&!Te&&t.w("Collisions detected, but collision boxes are not shown"),Gi=Et||xo.circles.length>0&&!xo.collisionDetected,No=No&&xo.offscreen}if(ln.iconFeatureIndex&&(pu=ln.iconFeatureIndex),ln.iconBox){const ht=xt=>this.collisionIndex.placeCollisionBox(xt,Yt,Fr,Ct,Wt,Sr,sr,yt,at.predicate,za,Nr&&po?po:void 0);Hs&&Hs.placeable&&ln.verticalIconBox?(bo=ht(ln.verticalIconBox),Bo=bo.placeable):(bo=ht(ln.iconBox),Bo=bo.placeable),No=No&&bo.offscreen}const Le=lt||en.numHorizontalGlyphVertices===0&&en.numVerticalGlyphVertices===0,Ye=Tt||en.numIconVertices===0;Le||Ye?Ye?Le||(Bo=Bo&&Gi):Gi=Bo&&Gi:Bo=Gi=Bo&&Gi;const ut=Bo&&bo.placeable;if(Gi&&zs.placeable&&this.collisionIndex.insertCollisionBox(zs.box,gt,Ie.get("text-ignore-placement"),Se.bucketInstanceId,Hs&&Hs.placeable&&Al?Al:vl,at.ID),ut&&this.collisionIndex.insertCollisionBox(bo.box,Yt,Ie.get("icon-ignore-placement"),Se.bucketInstanceId,pu,at.ID),xo&&Gi&&this.collisionIndex.insertCollisionCircles(xo.circles,gt,Ie.get("text-ignore-placement"),Se.bucketInstanceId,vl,at.ID),Te&&this.storeCollisionData(Se.bucketInstanceId,Nn,ln,zs,bo,xo),en.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(Se.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[en.crossTileID]=new Ia(Gi||ia,Bo||_a,No||Se.justReloaded),ne[en.crossTileID]=!0};if(Qr){if(I.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const en=Se.getSortedSymbolIndexes(this.transform.angle);for(let ln=en.length-1;ln>=0;--ln){const Nn=en[ln];nn(Se.symbolInstances.get(Nn),Se.collisionArrays[Nn],Nn)}}else for(let en=I.symbolInstanceStart;en=0&&(I.text.placedSymbolArray.get(yt).crossTileID=Ie>=0&&yt!==Ie?0:Te.crossTileID)}markUsedOrientation(I,ne,Te){const Se=ne===t.ah.horizontal||ne===t.ah.horizontalOnly?ne:0,Ie=ne===t.ah.vertical?ne:0,ot=[Te.leftJustifiedTextSymbolIndex,Te.centerJustifiedTextSymbolIndex,Te.rightJustifiedTextSymbolIndex];for(const yt of ot)I.text.placedSymbolArray.get(yt).placedOrientation=Se;Te.verticalPlacedTextSymbolIndex&&(I.text.placedSymbolArray.get(Te.verticalPlacedTextSymbolIndex).placedOrientation=Ie)}commit(I){this.commitTime=I,this.zoomAtLastRecencyCheck=this.transform.zoom;const ne=this.prevPlacement;let Te=!1;this.prevZoomAdjustment=ne?ne.zoomAdjustment(this.transform.zoom):0;const Se=ne?ne.symbolFadeChange(I):1,Ie=ne?ne.opacities:{},ot=ne?ne.variableOffsets:{},yt=ne?ne.placedOrientations:{};for(const Ct in this.placements){const Wt=this.placements[Ct],nr=Ie[Ct];nr?(this.opacities[Ct]=new ma(nr,Se,Wt.text,Wt.icon),Te=Te||Wt.text!==nr.text.placed||Wt.icon!==nr.icon.placed):(this.opacities[Ct]=new ma(null,Se,Wt.text,Wt.icon,Wt.skipFade),Te=Te||Wt.text||Wt.icon)}for(const Ct in Ie){const Wt=Ie[Ct];if(!this.opacities[Ct]){const nr=new ma(Wt,Se,!1,!1);nr.isHidden()||(this.opacities[Ct]=nr,Te=Te||Wt.text.placed||Wt.icon.placed)}}for(const Ct in ot)this.variableOffsets[Ct]||!this.opacities[Ct]||this.opacities[Ct].isHidden()||(this.variableOffsets[Ct]=ot[Ct]);for(const Ct in yt)this.placedOrientations[Ct]||!this.opacities[Ct]||this.opacities[Ct].isHidden()||(this.placedOrientations[Ct]=yt[Ct]);if(ne&&ne.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");Te?this.lastPlacementChangeTime=I:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=ne?ne.lastPlacementChangeTime:I)}updateLayerOpacities(I,ne){const Te={};for(const Se of ne){const Ie=Se.getBucket(I);Ie&&Se.latestFeatureIndex&&I.id===Ie.layerIds[0]&&this.updateBucketOpacities(Ie,Se.tileID,Te,Se.collisionBoxArray)}}updateBucketOpacities(I,ne,Te,Se){I.hasTextData()&&(I.text.opacityVertexArray.clear(),I.text.hasVisibleVertices=!1),I.hasIconData()&&(I.icon.opacityVertexArray.clear(),I.icon.hasVisibleVertices=!1),I.hasIconCollisionBoxData()&&I.iconCollisionBox.collisionVertexArray.clear(),I.hasTextCollisionBoxData()&&I.textCollisionBox.collisionVertexArray.clear();const Ie=I.layers[0],ot=Ie.layout,yt=new ma(null,0,!1,!1,!0),Ct=ot.get("text-allow-overlap"),Wt=ot.get("icon-allow-overlap"),nr=Ie._unevaluatedLayout.hasValue("text-variable-anchor")||Ie._unevaluatedLayout.hasValue("text-variable-anchor-offset"),or=ot.get("text-rotation-alignment")==="map",Fr=ot.get("text-pitch-alignment")==="map",Wr=ot.get("icon-text-fit")!=="none",je=new ma(null,0,Ct&&(Wt||!I.hasIconData()||ot.get("icon-optional")),Wt&&(Ct||!I.hasTextData()||ot.get("text-optional")),!0);!I.collisionArrays&&Se&&(I.hasIconCollisionBoxData()||I.hasTextCollisionBoxData())&&I.deserializeCollisionBoxes(Se);const Ze=(lt,Tt,gt)=>{for(let Et=0;Et0,Sr=this.placedOrientations[Tt.crossTileID],Nr=Sr===t.ah.vertical,Qr=Sr===t.ah.horizontal||Sr===t.ah.horizontalOnly;if(gt>0||Et>0){const _a=Pa(rr.text);Ze(I.text,gt,Nr?sa:_a),Ze(I.text,Et,Qr?sa:_a);const za=rr.text.isHidden();[Tt.rightJustifiedTextSymbolIndex,Tt.centerJustifiedTextSymbolIndex,Tt.leftJustifiedTextSymbolIndex].forEach(ln=>{ln>=0&&(I.text.placedSymbolArray.get(ln).hidden=za||Nr?1:0)}),Tt.verticalPlacedTextSymbolIndex>=0&&(I.text.placedSymbolArray.get(Tt.verticalPlacedTextSymbolIndex).hidden=za||Qr?1:0);const nn=this.variableOffsets[Tt.crossTileID];nn&&this.markUsedJustification(I,nn.anchor,Tt,Sr);const en=this.placedOrientations[Tt.crossTileID];en&&(this.markUsedJustification(I,"left",Tt,en),this.markUsedOrientation(I,en,Tt))}if(sr){const _a=Pa(rr.icon),za=!(Wr&&Tt.verticalPlacedIconSymbolIndex&&Nr);Tt.placedIconSymbolIndex>=0&&(Ze(I.icon,Tt.numIconVertices,za?_a:sa),I.icon.placedSymbolArray.get(Tt.placedIconSymbolIndex).hidden=rr.icon.isHidden()),Tt.verticalPlacedIconSymbolIndex>=0&&(Ze(I.icon,Tt.numVerticalIconVertices,za?sa:_a),I.icon.placedSymbolArray.get(Tt.verticalPlacedIconSymbolIndex).hidden=rr.icon.isHidden())}const ia=at&&at.has(lt)?at.get(lt):{text:null,icon:null};if(I.hasIconCollisionBoxData()||I.hasTextCollisionBoxData()){const _a=I.collisionArrays[lt];if(_a){let za=new t.P(0,0);if(_a.textBox||_a.verticalTextBox){let nn=!0;if(nr){const en=this.variableOffsets[Yt];en?(za=Vt(en.anchor,en.width,en.height,en.textOffset,en.textBoxScale),or&&za._rotate(Fr?this.transform.angle:-this.transform.angle)):nn=!1}if(_a.textBox||_a.verticalTextBox){let en;_a.textBox&&(en=Nr),_a.verticalTextBox&&(en=Qr),jt(I.textCollisionBox.collisionVertexArray,rr.text.placed,!nn||en,ia.text,za.x,za.y)}}if(_a.iconBox||_a.verticalIconBox){const nn=!!(!Qr&&_a.verticalIconBox);let en;_a.iconBox&&(en=nn),_a.verticalIconBox&&(en=!nn),jt(I.iconCollisionBox.collisionVertexArray,rr.icon.placed,en,ia.icon,Wr?za.x:0,Wr?za.y:0)}}}}if(I.sortFeatures(this.transform.angle),this.retainedQueryData[I.bucketInstanceId]&&(this.retainedQueryData[I.bucketInstanceId].featureSortOrder=I.featureSortOrder),I.hasTextData()&&I.text.opacityVertexBuffer&&I.text.opacityVertexBuffer.updateData(I.text.opacityVertexArray),I.hasIconData()&&I.icon.opacityVertexBuffer&&I.icon.opacityVertexBuffer.updateData(I.icon.opacityVertexArray),I.hasIconCollisionBoxData()&&I.iconCollisionBox.collisionVertexBuffer&&I.iconCollisionBox.collisionVertexBuffer.updateData(I.iconCollisionBox.collisionVertexArray),I.hasTextCollisionBoxData()&&I.textCollisionBox.collisionVertexBuffer&&I.textCollisionBox.collisionVertexBuffer.updateData(I.textCollisionBox.collisionVertexArray),I.text.opacityVertexArray.length!==I.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${I.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${I.text.layoutVertexArray.length}) / 4`);if(I.icon.opacityVertexArray.length!==I.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${I.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${I.icon.layoutVertexArray.length}) / 4`);if(I.bucketInstanceId in this.collisionCircleArrays){const lt=this.collisionCircleArrays[I.bucketInstanceId];I.placementInvProjMatrix=lt.invProjMatrix,I.placementViewportMatrix=lt.viewportMatrix,I.collisionCircleArray=lt.circles,delete this.collisionCircleArrays[I.bucketInstanceId]}}symbolFadeChange(I){return this.fadeDuration===0?1:(I-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(I){return Math.max(0,(this.transform.zoom-I)/1.5)}hasTransitions(I){return this.stale||I-this.lastPlacementChangeTimeI}setStale(){this.stale=!0}}function jt(De,I,ne,Te,Se,Ie){Te&&Te.length!==0||(Te=[0,0,0,0]);const ot=Te[0]-lr,yt=Te[1]-lr,Ct=Te[2]-lr,Wt=Te[3]-lr;De.emplaceBack(I?1:0,ne?1:0,Se||0,Ie||0,ot,yt),De.emplaceBack(I?1:0,ne?1:0,Se||0,Ie||0,Ct,yt),De.emplaceBack(I?1:0,ne?1:0,Se||0,Ie||0,Ct,Wt),De.emplaceBack(I?1:0,ne?1:0,Se||0,Ie||0,ot,Wt)}const Ot=Math.pow(2,25),gr=Math.pow(2,24),Br=Math.pow(2,17),na=Math.pow(2,16),Ur=Math.pow(2,9),ga=Math.pow(2,8),Aa=Math.pow(2,1);function Pa(De){if(De.opacity===0&&!De.placed)return 0;if(De.opacity===1&&De.placed)return 4294967295;const I=De.placed?1:0,ne=Math.floor(127*De.opacity);return ne*Ot+I*gr+ne*Br+I*na+ne*Ur+I*ga+ne*Aa+I}const sa=0;function Oa(){return{isOccluded:(De,I,ne)=>!1,getPitchedTextCorrection:(De,I,ne)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(De,I,ne,Te){throw new Error("Not implemented.")},translatePosition:(De,I,ne,Te)=>function(Se,Ie,ot,yt,Ct=!1){if(!ot[0]&&!ot[1])return[0,0];const Wt=Ct?yt==="map"?Se.angle:0:yt==="viewport"?-Se.angle:0;if(Wt){const nr=Math.sin(Wt),or=Math.cos(Wt);ot=[ot[0]*or-ot[1]*nr,ot[0]*nr+ot[1]*or]}return[Ct?ot[0]:da(Ie,ot[0],Se.zoom),Ct?ot[1]:da(Ie,ot[1],Se.zoom)]}(De,I,ne,Te),getCircleRadiusCorrection:De=>1}}class dt{constructor(I){this._sortAcrossTiles=I.layout.get("symbol-z-order")!=="viewport-y"&&!I.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(I,ne,Te,Se,Ie){const ot=this._bucketParts;for(;this._currentTileIndexyt.sortKey-Ct.sortKey));this._currentPartIndex!this._forceFullPlacement&&i.now()-Se>2;for(;this._currentPlacementIndex>=0;){const ot=ne[I[this._currentPlacementIndex]],yt=this.placement.collisionIndex.transform.zoom;if(ot.type==="symbol"&&(!ot.minzoom||ot.minzoom<=yt)&&(!ot.maxzoom||ot.maxzoom>yt)){if(this._inProgressLayer||(this._inProgressLayer=new dt(ot)),this._inProgressLayer.continuePlacement(Te[ot.source],this.placement,this._showCollisionBoxes,ot,Ie))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(I){return this.placement.commit(I),this.placement}}const Lr=512/t.X/2;class Er{constructor(I,ne,Te){this.tileID=I,this.bucketInstanceId=Te,this._symbolsByKey={};const Se=new Map;for(let Ie=0;Ie({x:Math.floor(Ct.anchorX*Lr),y:Math.floor(Ct.anchorY*Lr)})),crossTileIDs:ot.map(Ct=>Ct.crossTileID)};if(yt.positions.length>128){const Ct=new t.av(yt.positions.length,16,Uint16Array);for(const{x:Wt,y:nr}of yt.positions)Ct.add(Wt,nr);Ct.finish(),delete yt.positions,yt.index=Ct}this._symbolsByKey[Ie]=yt}}getScaledCoordinates(I,ne){const{x:Te,y:Se,z:Ie}=this.tileID.canonical,{x:ot,y:yt,z:Ct}=ne.canonical,Wt=Lr/Math.pow(2,Ct-Ie),nr=(yt*t.X+I.anchorY)*Wt,or=Se*t.X*Lr;return{x:Math.floor((ot*t.X+I.anchorX)*Wt-Te*t.X*Lr),y:Math.floor(nr-or)}}findMatches(I,ne,Te){const Se=this.tileID.canonical.zI)}}class _r{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class yr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(I){const ne=Math.round((I-this.lng)/360);if(ne!==0)for(const Te in this.indexes){const Se=this.indexes[Te],Ie={};for(const ot in Se){const yt=Se[ot];yt.tileID=yt.tileID.unwrapTo(yt.tileID.wrap+ne),Ie[yt.tileID.key]=yt}this.indexes[Te]=Ie}this.lng=I}addBucket(I,ne,Te){if(this.indexes[I.overscaledZ]&&this.indexes[I.overscaledZ][I.key]){if(this.indexes[I.overscaledZ][I.key].bucketInstanceId===ne.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(I.overscaledZ,this.indexes[I.overscaledZ][I.key])}for(let Ie=0;IeI.overscaledZ)for(const yt in ot){const Ct=ot[yt];Ct.tileID.isChildOf(I)&&Ct.findMatches(ne.symbolInstances,I,Se)}else{const yt=ot[I.scaledTo(Number(Ie)).key];yt&&yt.findMatches(ne.symbolInstances,I,Se)}}for(let Ie=0;Ie{ne[Te]=!0});for(const Te in this.layerIndexes)ne[Te]||delete this.layerIndexes[Te]}}const zr=(De,I)=>t.t(De,I&&I.filter(ne=>ne.identifier!=="source.canvas")),Pr=t.aw();class Hr extends t.E{constructor(I,ne={}){super(),this._rtlPluginLoaded=()=>{for(const Te in this.sourceCaches){const Se=this.sourceCaches[Te].getSource().type;Se!=="vector"&&Se!=="geojson"||this.sourceCaches[Te].reload()}},this.map=I,this.dispatcher=new $(J(),I._getMapId()),this.dispatcher.registerMessageHandler("GG",(Te,Se)=>this.getGlyphs(Te,Se)),this.dispatcher.registerMessageHandler("GI",(Te,Se)=>this.getImages(Te,Se)),this.imageManager=new m,this.imageManager.setEventedParent(this),this.glyphManager=new F(I._requestManager,ne.localIdeographFontFamily),this.lineAtlas=new Z(256,512),this.crossTileSymbolIndex=new kr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",t.ay()),$e().on(xe,this._rtlPluginLoaded),this.on("data",Te=>{if(Te.dataType!=="source"||Te.sourceDataType!=="metadata")return;const Se=this.sourceCaches[Te.sourceId];if(!Se)return;const Ie=Se.getSource();if(Ie&&Ie.vectorLayerIds)for(const ot in this._layers){const yt=this._layers[ot];yt.source===Ie.id&&this._validateLayer(yt)}})}loadURL(I,ne={},Te){this.fire(new t.k("dataloading",{dataType:"style"})),ne.validate=typeof ne.validate!="boolean"||ne.validate;const Se=this.map._requestManager.transformRequest(I,"Style");this._loadStyleRequest=new AbortController;const Ie=this._loadStyleRequest;t.h(Se,this._loadStyleRequest).then(ot=>{this._loadStyleRequest=null,this._load(ot.data,ne,Te)}).catch(ot=>{this._loadStyleRequest=null,ot&&!Ie.signal.aborted&&this.fire(new t.j(ot))})}loadJSON(I,ne={},Te){this.fire(new t.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,ne.validate=ne.validate!==!1,this._load(I,ne,Te)}).catch(()=>{})}loadEmpty(){this.fire(new t.k("dataloading",{dataType:"style"})),this._load(Pr,{validate:!1})}_load(I,ne,Te){var Se;const Ie=ne.transformStyle?ne.transformStyle(Te,I):I;if(!ne.validate||!zr(this,t.u(Ie))){this._loaded=!0,this.stylesheet=Ie;for(const ot in Ie.sources)this.addSource(ot,Ie.sources[ot],{validate:!1});Ie.sprite?this._loadSprite(Ie.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Ie.glyphs),this._createLayers(),this.light=new L(this.stylesheet.light),this.sky=new U(this.stylesheet.sky),this.map.setTerrain((Se=this.stylesheet.terrain)!==null&&Se!==void 0?Se:null),this.fire(new t.k("data",{dataType:"style"})),this.fire(new t.k("style.load"))}}_createLayers(){const I=t.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",I),this._order=I.map(ne=>ne.id),this._layers={},this._serializedLayers=null;for(const ne of I){const Te=t.aA(ne);Te.setEventedParent(this,{layer:{id:ne.id}}),this._layers[ne.id]=Te}}_loadSprite(I,ne=!1,Te=void 0){let Se;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(Ie,ot,yt,Ct){return t._(this,void 0,void 0,function*(){const Wt=w(Ie),nr=yt>1?"@2x":"",or={},Fr={};for(const{id:Wr,url:je}of Wt){const Ze=ot.transformRequest(p(je,nr,".json"),"SpriteJSON");or[Wr]=t.h(Ze,Ct);const at=ot.transformRequest(p(je,nr,".png"),"SpriteImage");Fr[Wr]=l.getImage(at,Ct)}return yield Promise.all([...Object.values(or),...Object.values(Fr)]),function(Wr,je){return t._(this,void 0,void 0,function*(){const Ze={};for(const at in Wr){Ze[at]={};const lt=i.getImageCanvasContext((yield je[at]).data),Tt=(yield Wr[at]).data;for(const gt in Tt){const{width:Et,height:Yt,x:rr,y:sr,sdf:Sr,pixelRatio:Nr,stretchX:Qr,stretchY:ia,content:_a,textFitWidth:za,textFitHeight:nn}=Tt[gt];Ze[at][gt]={data:null,pixelRatio:Nr,sdf:Sr,stretchX:Qr,stretchY:ia,content:_a,textFitWidth:za,textFitHeight:nn,spriteData:{width:Et,height:Yt,x:rr,y:sr,context:lt}}}}return Ze})}(or,Fr)})}(I,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(Ie=>{if(this._spriteRequest=null,Ie)for(const ot in Ie){this._spritesImagesIds[ot]=[];const yt=this._spritesImagesIds[ot]?this._spritesImagesIds[ot].filter(Ct=>!(Ct in Ie)):[];for(const Ct of yt)this.imageManager.removeImage(Ct),this._changedImages[Ct]=!0;for(const Ct in Ie[ot]){const Wt=ot==="default"?Ct:`${ot}:${Ct}`;this._spritesImagesIds[ot].push(Wt),Wt in this.imageManager.images?this.imageManager.updateImage(Wt,Ie[ot][Ct],!1):this.imageManager.addImage(Wt,Ie[ot][Ct]),ne&&(this._changedImages[Wt]=!0)}}}).catch(Ie=>{this._spriteRequest=null,Se=Ie,this.fire(new t.j(Se))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),ne&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"})),Te&&Te(Se)})}_unloadSprite(){for(const I of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(I),this._changedImages[I]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}_validateLayer(I){const ne=this.sourceCaches[I.source];if(!ne)return;const Te=I.sourceLayer;if(!Te)return;const Se=ne.getSource();(Se.type==="geojson"||Se.vectorLayerIds&&Se.vectorLayerIds.indexOf(Te)===-1)&&this.fire(new t.j(new Error(`Source layer "${Te}" does not exist on source "${Se.id}" as specified by style layer "${I.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const I in this.sourceCaches)if(!this.sourceCaches[I].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(I,ne=!1){const Te=this._serializedAllLayers();if(!I||I.length===0)return Object.values(ne?t.aB(Te):Te);const Se=[];for(const Ie of I)if(Te[Ie]){const ot=ne?t.aB(Te[Ie]):Te[Ie];Se.push(ot)}return Se}_serializedAllLayers(){let I=this._serializedLayers;if(I)return I;I=this._serializedLayers={};const ne=Object.keys(this._layers);for(const Te of ne){const Se=this._layers[Te];Se.type!=="custom"&&(I[Te]=Se.serialize())}return I}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const I in this.sourceCaches)if(this.sourceCaches[I].hasTransition())return!0;for(const I in this._layers)if(this._layers[I].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(I){if(!this._loaded)return;const ne=this._changed;if(ne){const Se=Object.keys(this._updatedLayers),Ie=Object.keys(this._removedLayers);(Se.length||Ie.length)&&this._updateWorkerLayers(Se,Ie);for(const ot in this._updatedSources){const yt=this._updatedSources[ot];if(yt==="reload")this._reloadSource(ot);else{if(yt!=="clear")throw new Error(`Invalid action ${yt}`);this._clearSource(ot)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const ot in this._updatedPaintProps)this._layers[ot].updateTransitions(I);this.light.updateTransitions(I),this.sky.updateTransitions(I),this._resetUpdates()}const Te={};for(const Se in this.sourceCaches){const Ie=this.sourceCaches[Se];Te[Se]=Ie.used,Ie.used=!1}for(const Se of this._order){const Ie=this._layers[Se];Ie.recalculate(I,this._availableImages),!Ie.isHidden(I.zoom)&&Ie.source&&(this.sourceCaches[Ie.source].used=!0)}for(const Se in Te){const Ie=this.sourceCaches[Se];!!Te[Se]!=!!Ie.used&&Ie.fire(new t.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:Se}))}this.light.recalculate(I),this.sky.recalculate(I),this.z=I.zoom,ne&&this.fire(new t.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const I=Object.keys(this._changedImages);if(I.length){for(const ne in this.sourceCaches)this.sourceCaches[ne].reloadTilesForDependencies(["icons","patterns"],I);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const I in this.sourceCaches)this.sourceCaches[I].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(I,ne){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(I,!1),removedIds:ne})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(I,ne={}){var Te;this._checkLoaded();const Se=this.serialize();if(I=ne.transformStyle?ne.transformStyle(Se,I):I,((Te=ne.validate)===null||Te===void 0||Te)&&zr(this,t.u(I)))return!1;(I=t.aB(I)).layers=t.az(I.layers);const Ie=t.aC(Se,I),ot=this._getOperationsToPerform(Ie);if(ot.unimplemented.length>0)throw new Error(`Unimplemented: ${ot.unimplemented.join(", ")}.`);if(ot.operations.length===0)return!1;for(const yt of ot.operations)yt();return this.stylesheet=I,this._serializedLayers=null,!0}_getOperationsToPerform(I){const ne=[],Te=[];for(const Se of I)switch(Se.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":ne.push(()=>this.addLayer.apply(this,Se.args));break;case"removeLayer":ne.push(()=>this.removeLayer.apply(this,Se.args));break;case"setPaintProperty":ne.push(()=>this.setPaintProperty.apply(this,Se.args));break;case"setLayoutProperty":ne.push(()=>this.setLayoutProperty.apply(this,Se.args));break;case"setFilter":ne.push(()=>this.setFilter.apply(this,Se.args));break;case"addSource":ne.push(()=>this.addSource.apply(this,Se.args));break;case"removeSource":ne.push(()=>this.removeSource.apply(this,Se.args));break;case"setLayerZoomRange":ne.push(()=>this.setLayerZoomRange.apply(this,Se.args));break;case"setLight":ne.push(()=>this.setLight.apply(this,Se.args));break;case"setGeoJSONSourceData":ne.push(()=>this.setGeoJSONSourceData.apply(this,Se.args));break;case"setGlyphs":ne.push(()=>this.setGlyphs.apply(this,Se.args));break;case"setSprite":ne.push(()=>this.setSprite.apply(this,Se.args));break;case"setSky":ne.push(()=>this.setSky.apply(this,Se.args));break;case"setTerrain":ne.push(()=>this.map.setTerrain.apply(this,Se.args));break;case"setTransition":ne.push(()=>{});break;default:Te.push(Se.command)}return{operations:ne,unimplemented:Te}}addImage(I,ne){if(this.getImage(I))return this.fire(new t.j(new Error(`An image named "${I}" already exists.`)));this.imageManager.addImage(I,ne),this._afterImageUpdated(I)}updateImage(I,ne){this.imageManager.updateImage(I,ne)}getImage(I){return this.imageManager.getImage(I)}removeImage(I){if(!this.getImage(I))return this.fire(new t.j(new Error(`An image named "${I}" does not exist.`)));this.imageManager.removeImage(I),this._afterImageUpdated(I)}_afterImageUpdated(I){this._availableImages=this.imageManager.listImages(),this._changedImages[I]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(I,ne,Te={}){if(this._checkLoaded(),this.sourceCaches[I]!==void 0)throw new Error(`Source "${I}" already exists.`);if(!ne.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(ne).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(ne.type)>=0&&this._validate(t.u.source,`sources.${I}`,ne,null,Te))return;this.map&&this.map._collectResourceTiming&&(ne.collectResourceTiming=!0);const Se=this.sourceCaches[I]=new St(I,ne,this.dispatcher);Se.style=this,Se.setEventedParent(this,()=>({isSourceLoaded:Se.loaded(),source:Se.serialize(),sourceId:I})),Se.onAdd(this.map),this._changed=!0}removeSource(I){if(this._checkLoaded(),this.sourceCaches[I]===void 0)throw new Error("There is no source with this ID");for(const Te in this._layers)if(this._layers[Te].source===I)return this.fire(new t.j(new Error(`Source "${I}" cannot be removed while layer "${Te}" is using it.`)));const ne=this.sourceCaches[I];delete this.sourceCaches[I],delete this._updatedSources[I],ne.fire(new t.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:I})),ne.setEventedParent(null),ne.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(I,ne){if(this._checkLoaded(),this.sourceCaches[I]===void 0)throw new Error(`There is no source with this ID=${I}`);const Te=this.sourceCaches[I].getSource();if(Te.type!=="geojson")throw new Error(`geojsonSource.type is ${Te.type}, which is !== 'geojson`);Te.setData(ne),this._changed=!0}getSource(I){return this.sourceCaches[I]&&this.sourceCaches[I].getSource()}addLayer(I,ne,Te={}){this._checkLoaded();const Se=I.id;if(this.getLayer(Se))return void this.fire(new t.j(new Error(`Layer "${Se}" already exists on this map.`)));let Ie;if(I.type==="custom"){if(zr(this,t.aD(I)))return;Ie=t.aA(I)}else{if("source"in I&&typeof I.source=="object"&&(this.addSource(Se,I.source),I=t.aB(I),I=t.e(I,{source:Se})),this._validate(t.u.layer,`layers.${Se}`,I,{arrayIndex:-1},Te))return;Ie=t.aA(I),this._validateLayer(Ie),Ie.setEventedParent(this,{layer:{id:Se}})}const ot=ne?this._order.indexOf(ne):this._order.length;if(ne&&ot===-1)this.fire(new t.j(new Error(`Cannot add layer "${Se}" before non-existing layer "${ne}".`)));else{if(this._order.splice(ot,0,Se),this._layerOrderChanged=!0,this._layers[Se]=Ie,this._removedLayers[Se]&&Ie.source&&Ie.type!=="custom"){const yt=this._removedLayers[Se];delete this._removedLayers[Se],yt.type!==Ie.type?this._updatedSources[Ie.source]="clear":(this._updatedSources[Ie.source]="reload",this.sourceCaches[Ie.source].pause())}this._updateLayer(Ie),Ie.onAdd&&Ie.onAdd(this.map)}}moveLayer(I,ne){if(this._checkLoaded(),this._changed=!0,!this._layers[I])return void this.fire(new t.j(new Error(`The layer '${I}' does not exist in the map's style and cannot be moved.`)));if(I===ne)return;const Te=this._order.indexOf(I);this._order.splice(Te,1);const Se=ne?this._order.indexOf(ne):this._order.length;ne&&Se===-1?this.fire(new t.j(new Error(`Cannot move layer "${I}" before non-existing layer "${ne}".`))):(this._order.splice(Se,0,I),this._layerOrderChanged=!0)}removeLayer(I){this._checkLoaded();const ne=this._layers[I];if(!ne)return void this.fire(new t.j(new Error(`Cannot remove non-existing layer "${I}".`)));ne.setEventedParent(null);const Te=this._order.indexOf(I);this._order.splice(Te,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[I]=ne,delete this._layers[I],this._serializedLayers&&delete this._serializedLayers[I],delete this._updatedLayers[I],delete this._updatedPaintProps[I],ne.onRemove&&ne.onRemove(this.map)}getLayer(I){return this._layers[I]}getLayersOrder(){return[...this._order]}hasLayer(I){return I in this._layers}setLayerZoomRange(I,ne,Te){this._checkLoaded();const Se=this.getLayer(I);Se?Se.minzoom===ne&&Se.maxzoom===Te||(ne!=null&&(Se.minzoom=ne),Te!=null&&(Se.maxzoom=Te),this._updateLayer(Se)):this.fire(new t.j(new Error(`Cannot set the zoom range of non-existing layer "${I}".`)))}setFilter(I,ne,Te={}){this._checkLoaded();const Se=this.getLayer(I);if(Se){if(!t.aE(Se.filter,ne))return ne==null?(Se.filter=void 0,void this._updateLayer(Se)):void(this._validate(t.u.filter,`layers.${Se.id}.filter`,ne,null,Te)||(Se.filter=t.aB(ne),this._updateLayer(Se)))}else this.fire(new t.j(new Error(`Cannot filter non-existing layer "${I}".`)))}getFilter(I){return t.aB(this.getLayer(I).filter)}setLayoutProperty(I,ne,Te,Se={}){this._checkLoaded();const Ie=this.getLayer(I);Ie?t.aE(Ie.getLayoutProperty(ne),Te)||(Ie.setLayoutProperty(ne,Te,Se),this._updateLayer(Ie)):this.fire(new t.j(new Error(`Cannot style non-existing layer "${I}".`)))}getLayoutProperty(I,ne){const Te=this.getLayer(I);if(Te)return Te.getLayoutProperty(ne);this.fire(new t.j(new Error(`Cannot get style of non-existing layer "${I}".`)))}setPaintProperty(I,ne,Te,Se={}){this._checkLoaded();const Ie=this.getLayer(I);Ie?t.aE(Ie.getPaintProperty(ne),Te)||(Ie.setPaintProperty(ne,Te,Se)&&this._updateLayer(Ie),this._changed=!0,this._updatedPaintProps[I]=!0,this._serializedLayers=null):this.fire(new t.j(new Error(`Cannot style non-existing layer "${I}".`)))}getPaintProperty(I,ne){return this.getLayer(I).getPaintProperty(ne)}setFeatureState(I,ne){this._checkLoaded();const Te=I.source,Se=I.sourceLayer,Ie=this.sourceCaches[Te];if(Ie===void 0)return void this.fire(new t.j(new Error(`The source '${Te}' does not exist in the map's style.`)));const ot=Ie.getSource().type;ot==="geojson"&&Se?this.fire(new t.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):ot!=="vector"||Se?(I.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Ie.setFeatureState(Se,I.id,ne)):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(I,ne){this._checkLoaded();const Te=I.source,Se=this.sourceCaches[Te];if(Se===void 0)return void this.fire(new t.j(new Error(`The source '${Te}' does not exist in the map's style.`)));const Ie=Se.getSource().type,ot=Ie==="vector"?I.sourceLayer:void 0;Ie!=="vector"||ot?ne&&typeof I.id!="string"&&typeof I.id!="number"?this.fire(new t.j(new Error("A feature id is required to remove its specific state property."))):Se.removeFeatureState(ot,I.id,ne):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(I){this._checkLoaded();const ne=I.source,Te=I.sourceLayer,Se=this.sourceCaches[ne];if(Se!==void 0)return Se.getSource().type!=="vector"||Te?(I.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Se.getFeatureState(Te,I.id)):void this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new t.j(new Error(`The source '${ne}' does not exist in the map's style.`)))}getTransition(){return t.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const I=t.aF(this.sourceCaches,Ie=>Ie.serialize()),ne=this._serializeByIds(this._order,!0),Te=this.map.getTerrain()||void 0,Se=this.stylesheet;return t.aG({version:Se.version,name:Se.name,metadata:Se.metadata,light:Se.light,sky:Se.sky,center:Se.center,zoom:Se.zoom,bearing:Se.bearing,pitch:Se.pitch,sprite:Se.sprite,glyphs:Se.glyphs,transition:Se.transition,sources:I,layers:ne,terrain:Te},Ie=>Ie!==void 0)}_updateLayer(I){this._updatedLayers[I.id]=!0,I.source&&!this._updatedSources[I.source]&&this.sourceCaches[I.source].getSource().type!=="raster"&&(this._updatedSources[I.source]="reload",this.sourceCaches[I.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(I){const ne=ot=>this._layers[ot].type==="fill-extrusion",Te={},Se=[];for(let ot=this._order.length-1;ot>=0;ot--){const yt=this._order[ot];if(ne(yt)){Te[yt]=ot;for(const Ct of I){const Wt=Ct[yt];if(Wt)for(const nr of Wt)Se.push(nr)}}}Se.sort((ot,yt)=>yt.intersectionZ-ot.intersectionZ);const Ie=[];for(let ot=this._order.length-1;ot>=0;ot--){const yt=this._order[ot];if(ne(yt))for(let Ct=Se.length-1;Ct>=0;Ct--){const Wt=Se[Ct].feature;if(Te[Wt.layer.id]{const Sr=lt.featureSortOrder;if(Sr){const Nr=Sr.indexOf(rr.featureIndex);return Sr.indexOf(sr.featureIndex)-Nr}return sr.featureIndex-rr.featureIndex});for(const rr of Yt)Et.push(rr)}}for(const lt in je)je[lt].forEach(Tt=>{const gt=Tt.feature,Et=Wt[yt[lt].source].getFeatureState(gt.layer["source-layer"],gt.id);gt.source=gt.layer.source,gt.layer["source-layer"]&&(gt.sourceLayer=gt.layer["source-layer"]),gt.state=Et});return je}(this._layers,ot,this.sourceCaches,I,ne,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Ie)}querySourceFeatures(I,ne){ne&&ne.filter&&this._validate(t.u.filter,"querySourceFeatures.filter",ne.filter,null,ne);const Te=this.sourceCaches[I];return Te?function(Se,Ie){const ot=Se.getRenderableIds().map(Wt=>Se.getTileByID(Wt)),yt=[],Ct={};for(let Wt=0;WtFr.getTileByID(Wr)).sort((Wr,je)=>je.tileID.overscaledZ-Wr.tileID.overscaledZ||(Wr.tileID.isLessThan(je.tileID)?-1:1))}const or=this.crossTileSymbolIndex.addLayer(nr,Ct[nr.source],I.center.lng);ot=ot||or}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((Ie=Ie||this._layerOrderChanged||Te===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(i.now(),I.zoom))&&(this.pauseablePlacement=new vt(I,this.map.terrain,this._order,Ie,ne,Te,Se,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Ct),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.now()),yt=!0),ot&&this.pauseablePlacement.placement.setStale()),yt||ot)for(const Wt of this._order){const nr=this._layers[Wt];nr.type==="symbol"&&this.placement.updateLayerOpacities(nr,Ct[nr.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(i.now())}_releaseSymbolFadeTiles(){for(const I in this.sourceCaches)this.sourceCaches[I].releaseSymbolFadeTiles()}getImages(I,ne){return t._(this,void 0,void 0,function*(){const Te=yield this.imageManager.getImages(ne.icons);this._updateTilesForChangedImages();const Se=this.sourceCaches[ne.source];return Se&&Se.setDependencies(ne.tileID.key,ne.type,ne.icons),Te})}getGlyphs(I,ne){return t._(this,void 0,void 0,function*(){const Te=yield this.glyphManager.getGlyphs(ne.stacks),Se=this.sourceCaches[ne.source];return Se&&Se.setDependencies(ne.tileID.key,ne.type,[""]),Te})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(I,ne={}){this._checkLoaded(),I&&this._validate(t.u.glyphs,"glyphs",I,null,ne)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=I,this.glyphManager.entries={},this.glyphManager.setURL(I))}addSprite(I,ne,Te={},Se){this._checkLoaded();const Ie=[{id:I,url:ne}],ot=[...w(this.stylesheet.sprite),...Ie];this._validate(t.u.sprite,"sprite",ot,null,Te)||(this.stylesheet.sprite=ot,this._loadSprite(Ie,!0,Se))}removeSprite(I){this._checkLoaded();const ne=w(this.stylesheet.sprite);if(ne.find(Te=>Te.id===I)){if(this._spritesImagesIds[I])for(const Te of this._spritesImagesIds[I])this.imageManager.removeImage(Te),this._changedImages[Te]=!0;ne.splice(ne.findIndex(Te=>Te.id===I),1),this.stylesheet.sprite=ne.length>0?ne:void 0,delete this._spritesImagesIds[I],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}else this.fire(new t.j(new Error(`Sprite "${I}" doesn't exists on this map.`)))}getSprite(){return w(this.stylesheet.sprite)}setSprite(I,ne={},Te){this._checkLoaded(),I&&this._validate(t.u.sprite,"sprite",I,null,ne)||(this.stylesheet.sprite=I,I?this._loadSprite(I,!0,Te):(this._unloadSprite(),Te&&Te(null)))}}var Zr=t.Y([{name:"a_pos",type:"Int16",components:2}]);const Jr={prelude:wt(`#ifdef GL_ES +precision mediump float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +`,`#ifdef GL_ES +precision highp float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 +);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} +#ifdef TERRAIN3D +uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; +#endif +const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { +#ifdef TERRAIN3D +highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); +#else +return 1.0; +#endif +}float calculate_visibility(vec4 pos) { +#ifdef TERRAIN3D +vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; +#else +return 1.0; +#endif +}float ele(vec2 pos) { +#ifdef TERRAIN3D +vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; +#else +return 0.0; +#endif +}float get_elevation(vec2 pos) { +#ifdef TERRAIN3D +vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; +#else +return 0.0; +#endif +}`),background:wt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:wt(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:wt(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:wt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:wt(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:wt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:wt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 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_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:wt("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);}"),debug:wt("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,get_elevation(a_pos),1);}"),fill:wt(`#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);}`),fillOutline:wt(`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;}`),fillOutlinePattern:wt(`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;}`),fillPattern:wt(`#ifdef GL_ES +precision highp float; +#endif +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);}`),fillExtrusion:wt(`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; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +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; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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;}`),fillExtrusionPattern:wt(`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; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +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; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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;}`),hillshadePrepare:wt(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); +#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;}"),hillshade:wt(`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;}"),line:wt(`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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_width2=vec2(outset,inset);}`),lineGradient:wt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +#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,v_uv);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;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_width2=vec2(outset,inset);}`),linePattern:wt(`#ifdef GL_ES +precision highp float; +#endif +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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:wt(`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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +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);}`),raster:wt(`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;}"),symbolIcon:wt(`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 +}`,`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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;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;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:wt(`#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 inner_edge=(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);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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 bool u_is_along_line;uniform bool u_is_variable_anchor;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_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:wt(`#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 +}`,`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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,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);}`),terrain:wt("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:wt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:wt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:wt("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function wt(De,I){const ne=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,Te=I.match(/attribute ([\w]+) ([\w]+)/g),Se=De.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Ie=I.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),ot=Ie?Ie.concat(Se):Se,yt={};return{fragmentSource:De=De.replace(ne,(Ct,Wt,nr,or,Fr)=>(yt[Fr]=!0,Wt==="define"?` +#ifndef HAS_UNIFORM_u_${Fr} +varying ${nr} ${or} ${Fr}; +#else +uniform ${nr} ${or} u_${Fr}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${Fr} + ${nr} ${or} ${Fr} = u_${Fr}; +#endif +`)),vertexSource:I=I.replace(ne,(Ct,Wt,nr,or,Fr)=>{const Wr=or==="float"?"vec2":"vec4",je=Fr.match(/color/)?"color":Wr;return yt[Fr]?Wt==="define"?` +#ifndef HAS_UNIFORM_u_${Fr} +uniform lowp float u_${Fr}_t; +attribute ${nr} ${Wr} a_${Fr}; +varying ${nr} ${or} ${Fr}; +#else +uniform ${nr} ${or} u_${Fr}; +#endif +`:je==="vec4"?` +#ifndef HAS_UNIFORM_u_${Fr} + ${Fr} = a_${Fr}; +#else + ${nr} ${or} ${Fr} = u_${Fr}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${Fr} + ${Fr} = unpack_mix_${je}(a_${Fr}, u_${Fr}_t); +#else + ${nr} ${or} ${Fr} = u_${Fr}; +#endif +`:Wt==="define"?` +#ifndef HAS_UNIFORM_u_${Fr} +uniform lowp float u_${Fr}_t; +attribute ${nr} ${Wr} a_${Fr}; +#else +uniform ${nr} ${or} u_${Fr}; +#endif +`:je==="vec4"?` +#ifndef HAS_UNIFORM_u_${Fr} + ${nr} ${or} ${Fr} = a_${Fr}; +#else + ${nr} ${or} ${Fr} = u_${Fr}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${Fr} + ${nr} ${or} ${Fr} = unpack_mix_${je}(a_${Fr}, u_${Fr}_t); +#else + ${nr} ${or} ${Fr} = u_${Fr}; +#endif +`}),staticAttributes:Te,staticUniforms:ot}}class Qt{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(I,ne,Te,Se,Ie,ot,yt,Ct,Wt){this.context=I;let nr=this.boundPaintVertexBuffers.length!==Se.length;for(let or=0;!nr&&or({u_matrix:De,u_texture:0,u_ele_delta:I,u_fog_matrix:ne,u_fog_color:Te?Te.properties.get("fog-color"):t.aM.white,u_fog_ground_blend:Te?Te.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:Te?Te.calculateFogBlendOpacity(Se):0,u_horizon_color:Te?Te.properties.get("horizon-color"):t.aM.white,u_horizon_fog_blend:Te?Te.properties.get("horizon-fog-blend"):1});function $r(De){const I=[];for(let ne=0;ne({u_depth:new t.aH(rr,sr.u_depth),u_terrain:new t.aH(rr,sr.u_terrain),u_terrain_dim:new t.aI(rr,sr.u_terrain_dim),u_terrain_matrix:new t.aJ(rr,sr.u_terrain_matrix),u_terrain_unpack:new t.aK(rr,sr.u_terrain_unpack),u_terrain_exaggeration:new t.aI(rr,sr.u_terrain_exaggeration)}))(I,Yt),this.binderUniforms=Te?Te.getUniforms(I,Yt):[]}draw(I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr,je,Ze,at,lt,Tt){const gt=I.gl;if(this.failedToCreate)return;if(I.program.set(this.program),I.setDepthMode(Te),I.setStencilMode(Se),I.setColorMode(Ie),I.setCullFace(ot),Ct){I.activeTexture.set(gt.TEXTURE2),gt.bindTexture(gt.TEXTURE_2D,Ct.depthTexture),I.activeTexture.set(gt.TEXTURE3),gt.bindTexture(gt.TEXTURE_2D,Ct.texture);for(const Yt in this.terrainUniforms)this.terrainUniforms[Yt].set(Ct[Yt])}for(const Yt in this.fixedUniforms)this.fixedUniforms[Yt].set(yt[Yt]);Ze&&Ze.setUniforms(I,this.binderUniforms,Wr,{zoom:je});let Et=0;switch(ne){case gt.LINES:Et=2;break;case gt.TRIANGLES:Et=3;break;case gt.LINE_STRIP:Et=1}for(const Yt of Fr.get()){const rr=Yt.vaos||(Yt.vaos={});(rr[Wt]||(rr[Wt]=new Qt)).bind(I,this,nr,Ze?Ze.getPaintVertexBuffers():[],or,Yt.vertexOffset,at,lt,Tt),gt.drawElements(ne,Yt.primitiveLength*Et,gt.UNSIGNED_SHORT,Yt.primitiveOffset*Et*2)}}}function Sa(De,I,ne){const Te=1/da(ne,1,I.transform.tileZoom),Se=Math.pow(2,ne.tileID.overscaledZ),Ie=ne.tileSize*Math.pow(2,I.transform.tileZoom)/Se,ot=Ie*(ne.tileID.canonical.x+ne.tileID.wrap*Se),yt=Ie*ne.tileID.canonical.y;return{u_image:0,u_texsize:ne.imageAtlasTexture.size,u_scale:[Te,De.fromScale,De.toScale],u_fade:De.t,u_pixel_coord_upper:[ot>>16,yt>>16],u_pixel_coord_lower:[65535&ot,65535&yt]}}const ya=(De,I,ne,Te)=>{const Se=I.style.light,Ie=Se.properties.get("position"),ot=[Ie.x,Ie.y,Ie.z],yt=function(){var Wt=new t.A(9);return t.A!=Float32Array&&(Wt[1]=0,Wt[2]=0,Wt[3]=0,Wt[5]=0,Wt[6]=0,Wt[7]=0),Wt[0]=1,Wt[4]=1,Wt[8]=1,Wt}();Se.properties.get("anchor")==="viewport"&&function(Wt,nr){var or=Math.sin(nr),Fr=Math.cos(nr);Wt[0]=Fr,Wt[1]=or,Wt[2]=0,Wt[3]=-or,Wt[4]=Fr,Wt[5]=0,Wt[6]=0,Wt[7]=0,Wt[8]=1}(yt,-I.transform.angle),function(Wt,nr,or){var Fr=nr[0],Wr=nr[1],je=nr[2];Wt[0]=Fr*or[0]+Wr*or[3]+je*or[6],Wt[1]=Fr*or[1]+Wr*or[4]+je*or[7],Wt[2]=Fr*or[2]+Wr*or[5]+je*or[8]}(ot,ot,yt);const Ct=Se.properties.get("color");return{u_matrix:De,u_lightpos:ot,u_lightintensity:Se.properties.get("intensity"),u_lightcolor:[Ct.r,Ct.g,Ct.b],u_vertical_gradient:+ne,u_opacity:Te}},ra=(De,I,ne,Te,Se,Ie,ot)=>t.e(ya(De,I,ne,Te),Sa(Ie,I,ot),{u_height_factor:-Math.pow(2,Se.overscaledZ)/ot.tileSize/8}),pa=De=>({u_matrix:De}),pn=(De,I,ne,Te)=>t.e(pa(De),Sa(ne,I,Te)),Ga=(De,I)=>({u_matrix:De,u_world:I}),qn=(De,I,ne,Te,Se)=>t.e(pn(De,I,ne,Te),{u_world:Se}),Vn=(De,I,ne,Te)=>{const Se=De.transform;let Ie,ot;if(Te.paint.get("circle-pitch-alignment")==="map"){const yt=da(ne,1,Se.zoom);Ie=!0,ot=[yt,yt]}else Ie=!1,ot=Se.pixelsToGLUnits;return{u_camera_to_center_distance:Se.cameraToCenterDistance,u_scale_with_map:+(Te.paint.get("circle-pitch-scale")==="map"),u_matrix:De.translatePosMatrix(I.posMatrix,ne,Te.paint.get("circle-translate"),Te.paint.get("circle-translate-anchor")),u_pitch_with_map:+Ie,u_device_pixel_ratio:De.pixelRatio,u_extrude_scale:ot}},di=(De,I,ne)=>({u_matrix:De,u_inv_matrix:I,u_camera_to_center_distance:ne.cameraToCenterDistance,u_viewport_size:[ne.width,ne.height]}),yi=(De,I,ne=1)=>({u_matrix:De,u_color:I,u_overlay:0,u_overlay_scale:ne}),Ci=De=>({u_matrix:De}),ci=(De,I,ne,Te)=>({u_matrix:De,u_extrude_scale:da(I,1,ne),u_intensity:Te}),ei=(De,I,ne,Te)=>{const Se=t.H();t.aP(Se,0,De.width,De.height,0,0,1);const Ie=De.context.gl;return{u_matrix:Se,u_world:[Ie.drawingBufferWidth,Ie.drawingBufferHeight],u_image:ne,u_color_ramp:Te,u_opacity:I.paint.get("heatmap-opacity")}};function mi(De,I){const ne=Math.pow(2,I.canonical.z),Te=I.canonical.y;return[new t.Z(0,Te/ne).toLngLat().lat,new t.Z(0,(Te+1)/ne).toLngLat().lat]}const uo=(De,I,ne,Te)=>{const Se=De.transform;return{u_matrix:xi(De,I,ne,Te),u_ratio:1/da(I,1,Se.zoom),u_device_pixel_ratio:De.pixelRatio,u_units_to_pixels:[1/Se.pixelsToGLUnits[0],1/Se.pixelsToGLUnits[1]]}},Lo=(De,I,ne,Te,Se)=>t.e(uo(De,I,ne,Se),{u_image:0,u_image_height:Te}),Wo=(De,I,ne,Te,Se)=>{const Ie=De.transform,ot=Ii(I,Ie);return{u_matrix:xi(De,I,ne,Se),u_texsize:I.imageAtlasTexture.size,u_ratio:1/da(I,1,Ie.zoom),u_device_pixel_ratio:De.pixelRatio,u_image:0,u_scale:[ot,Te.fromScale,Te.toScale],u_fade:Te.t,u_units_to_pixels:[1/Ie.pixelsToGLUnits[0],1/Ie.pixelsToGLUnits[1]]}},li=(De,I,ne,Te,Se,Ie)=>{const ot=De.lineAtlas,yt=Ii(I,De.transform),Ct=ne.layout.get("line-cap")==="round",Wt=ot.getDash(Te.from,Ct),nr=ot.getDash(Te.to,Ct),or=Wt.width*Se.fromScale,Fr=nr.width*Se.toScale;return t.e(uo(De,I,ne,Ie),{u_patternscale_a:[yt/or,-Wt.height/2],u_patternscale_b:[yt/Fr,-nr.height/2],u_sdfgamma:ot.width/(256*Math.min(or,Fr)*De.pixelRatio)/2,u_image:0,u_tex_y_a:Wt.y,u_tex_y_b:nr.y,u_mix:Se.t})};function Ii(De,I){return 1/da(De,1,I.tileZoom)}function xi(De,I,ne,Te){return De.translatePosMatrix(Te?Te.posMatrix:I.tileID.posMatrix,I,ne.paint.get("line-translate"),ne.paint.get("line-translate-anchor"))}const Ao=(De,I,ne,Te,Se)=>{return{u_matrix:De,u_tl_parent:I,u_scale_parent:ne,u_buffer_scale:1,u_fade_t:Te.mix,u_opacity:Te.opacity*Se.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Se.paint.get("raster-brightness-min"),u_brightness_high:Se.paint.get("raster-brightness-max"),u_saturation_factor:(ot=Se.paint.get("raster-saturation"),ot>0?1-1/(1.001-ot):-ot),u_contrast_factor:(Ie=Se.paint.get("raster-contrast"),Ie>0?1/(1-Ie):1+Ie),u_spin_weights:So(Se.paint.get("raster-hue-rotate"))};var Ie,ot};function So(De){De*=Math.PI/180;const I=Math.sin(De),ne=Math.cos(De);return[(2*ne+1)/3,(-Math.sqrt(3)*I-ne+1)/3,(Math.sqrt(3)*I-ne+1)/3]}const Ro=(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr)=>{const je=ot.transform;return{u_is_size_zoom_constant:+(De==="constant"||De==="source"),u_is_size_feature_constant:+(De==="constant"||De==="camera"),u_size_t:I?I.uSizeT:0,u_size:I?I.uSize:0,u_camera_to_center_distance:je.cameraToCenterDistance,u_pitch:je.pitch/360*2*Math.PI,u_rotate_symbol:+ne,u_aspect_ratio:je.width/je.height,u_fade_change:ot.options.fadeDuration?ot.symbolFadeChange:1,u_matrix:yt,u_label_plane_matrix:Ct,u_coord_matrix:Wt,u_is_text:+or,u_pitch_with_map:+Te,u_is_along_line:Se,u_is_variable_anchor:Ie,u_texsize:Fr,u_texture:0,u_translation:nr,u_pitched_scale:Wr}},Li=(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr,je)=>{const Ze=ot.transform;return t.e(Ro(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,je),{u_gamma_scale:Te?Math.cos(Ze._pitch)*Ze.cameraToCenterDistance:1,u_device_pixel_ratio:ot.pixelRatio,u_is_halo:+Wr})},Yi=(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr)=>t.e(Li(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,!0,or,!0,Wr),{u_texsize_icon:Fr,u_texture_icon:1}),bs=(De,I,ne)=>({u_matrix:De,u_opacity:I,u_color:ne}),as=(De,I,ne,Te,Se,Ie)=>t.e(function(ot,yt,Ct,Wt){const nr=Ct.imageManager.getPattern(ot.from.toString()),or=Ct.imageManager.getPattern(ot.to.toString()),{width:Fr,height:Wr}=Ct.imageManager.getPixelSize(),je=Math.pow(2,Wt.tileID.overscaledZ),Ze=Wt.tileSize*Math.pow(2,Ct.transform.tileZoom)/je,at=Ze*(Wt.tileID.canonical.x+Wt.tileID.wrap*je),lt=Ze*Wt.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:nr.tl,u_pattern_br_a:nr.br,u_pattern_tl_b:or.tl,u_pattern_br_b:or.br,u_texsize:[Fr,Wr],u_mix:yt.t,u_pattern_size_a:nr.displaySize,u_pattern_size_b:or.displaySize,u_scale_a:yt.fromScale,u_scale_b:yt.toScale,u_tile_units_to_pixels:1/da(Wt,1,Ct.transform.tileZoom),u_pixel_coord_upper:[at>>16,lt>>16],u_pixel_coord_lower:[65535&at,65535<]}}(Te,Ie,ne,Se),{u_matrix:De,u_opacity:I}),fs={fillExtrusion:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_lightpos:new t.aN(De,I.u_lightpos),u_lightintensity:new t.aI(De,I.u_lightintensity),u_lightcolor:new t.aN(De,I.u_lightcolor),u_vertical_gradient:new t.aI(De,I.u_vertical_gradient),u_opacity:new t.aI(De,I.u_opacity)}),fillExtrusionPattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_lightpos:new t.aN(De,I.u_lightpos),u_lightintensity:new t.aI(De,I.u_lightintensity),u_lightcolor:new t.aN(De,I.u_lightcolor),u_vertical_gradient:new t.aI(De,I.u_vertical_gradient),u_height_factor:new t.aI(De,I.u_height_factor),u_image:new t.aH(De,I.u_image),u_texsize:new t.aO(De,I.u_texsize),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade),u_opacity:new t.aI(De,I.u_opacity)}),fill:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix)}),fillPattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_image:new t.aH(De,I.u_image),u_texsize:new t.aO(De,I.u_texsize),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade)}),fillOutline:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_world:new t.aO(De,I.u_world)}),fillOutlinePattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_world:new t.aO(De,I.u_world),u_image:new t.aH(De,I.u_image),u_texsize:new t.aO(De,I.u_texsize),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade)}),circle:(De,I)=>({u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_scale_with_map:new t.aH(De,I.u_scale_with_map),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_extrude_scale:new t.aO(De,I.u_extrude_scale),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_matrix:new t.aJ(De,I.u_matrix)}),collisionBox:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_pixel_extrude_scale:new t.aO(De,I.u_pixel_extrude_scale)}),collisionCircle:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_inv_matrix:new t.aJ(De,I.u_inv_matrix),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_viewport_size:new t.aO(De,I.u_viewport_size)}),debug:(De,I)=>({u_color:new t.aL(De,I.u_color),u_matrix:new t.aJ(De,I.u_matrix),u_overlay:new t.aH(De,I.u_overlay),u_overlay_scale:new t.aI(De,I.u_overlay_scale)}),clippingMask:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix)}),heatmap:(De,I)=>({u_extrude_scale:new t.aI(De,I.u_extrude_scale),u_intensity:new t.aI(De,I.u_intensity),u_matrix:new t.aJ(De,I.u_matrix)}),heatmapTexture:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_world:new t.aO(De,I.u_world),u_image:new t.aH(De,I.u_image),u_color_ramp:new t.aH(De,I.u_color_ramp),u_opacity:new t.aI(De,I.u_opacity)}),hillshade:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_image:new t.aH(De,I.u_image),u_latrange:new t.aO(De,I.u_latrange),u_light:new t.aO(De,I.u_light),u_shadow:new t.aL(De,I.u_shadow),u_highlight:new t.aL(De,I.u_highlight),u_accent:new t.aL(De,I.u_accent)}),hillshadePrepare:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_image:new t.aH(De,I.u_image),u_dimension:new t.aO(De,I.u_dimension),u_zoom:new t.aI(De,I.u_zoom),u_unpack:new t.aK(De,I.u_unpack)}),line:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels)}),lineGradient:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels),u_image:new t.aH(De,I.u_image),u_image_height:new t.aI(De,I.u_image_height)}),linePattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_texsize:new t.aO(De,I.u_texsize),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_image:new t.aH(De,I.u_image),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade)}),lineSDF:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels),u_patternscale_a:new t.aO(De,I.u_patternscale_a),u_patternscale_b:new t.aO(De,I.u_patternscale_b),u_sdfgamma:new t.aI(De,I.u_sdfgamma),u_image:new t.aH(De,I.u_image),u_tex_y_a:new t.aI(De,I.u_tex_y_a),u_tex_y_b:new t.aI(De,I.u_tex_y_b),u_mix:new t.aI(De,I.u_mix)}),raster:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_tl_parent:new t.aO(De,I.u_tl_parent),u_scale_parent:new t.aI(De,I.u_scale_parent),u_buffer_scale:new t.aI(De,I.u_buffer_scale),u_fade_t:new t.aI(De,I.u_fade_t),u_opacity:new t.aI(De,I.u_opacity),u_image0:new t.aH(De,I.u_image0),u_image1:new t.aH(De,I.u_image1),u_brightness_low:new t.aI(De,I.u_brightness_low),u_brightness_high:new t.aI(De,I.u_brightness_high),u_saturation_factor:new t.aI(De,I.u_saturation_factor),u_contrast_factor:new t.aI(De,I.u_contrast_factor),u_spin_weights:new t.aN(De,I.u_spin_weights)}),symbolIcon:(De,I)=>({u_is_size_zoom_constant:new t.aH(De,I.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(De,I.u_is_size_feature_constant),u_size_t:new t.aI(De,I.u_size_t),u_size:new t.aI(De,I.u_size),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_pitch:new t.aI(De,I.u_pitch),u_rotate_symbol:new t.aH(De,I.u_rotate_symbol),u_aspect_ratio:new t.aI(De,I.u_aspect_ratio),u_fade_change:new t.aI(De,I.u_fade_change),u_matrix:new t.aJ(De,I.u_matrix),u_label_plane_matrix:new t.aJ(De,I.u_label_plane_matrix),u_coord_matrix:new t.aJ(De,I.u_coord_matrix),u_is_text:new t.aH(De,I.u_is_text),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_is_along_line:new t.aH(De,I.u_is_along_line),u_is_variable_anchor:new t.aH(De,I.u_is_variable_anchor),u_texsize:new t.aO(De,I.u_texsize),u_texture:new t.aH(De,I.u_texture),u_translation:new t.aO(De,I.u_translation),u_pitched_scale:new t.aI(De,I.u_pitched_scale)}),symbolSDF:(De,I)=>({u_is_size_zoom_constant:new t.aH(De,I.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(De,I.u_is_size_feature_constant),u_size_t:new t.aI(De,I.u_size_t),u_size:new t.aI(De,I.u_size),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_pitch:new t.aI(De,I.u_pitch),u_rotate_symbol:new t.aH(De,I.u_rotate_symbol),u_aspect_ratio:new t.aI(De,I.u_aspect_ratio),u_fade_change:new t.aI(De,I.u_fade_change),u_matrix:new t.aJ(De,I.u_matrix),u_label_plane_matrix:new t.aJ(De,I.u_label_plane_matrix),u_coord_matrix:new t.aJ(De,I.u_coord_matrix),u_is_text:new t.aH(De,I.u_is_text),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_is_along_line:new t.aH(De,I.u_is_along_line),u_is_variable_anchor:new t.aH(De,I.u_is_variable_anchor),u_texsize:new t.aO(De,I.u_texsize),u_texture:new t.aH(De,I.u_texture),u_gamma_scale:new t.aI(De,I.u_gamma_scale),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_is_halo:new t.aH(De,I.u_is_halo),u_translation:new t.aO(De,I.u_translation),u_pitched_scale:new t.aI(De,I.u_pitched_scale)}),symbolTextAndIcon:(De,I)=>({u_is_size_zoom_constant:new t.aH(De,I.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(De,I.u_is_size_feature_constant),u_size_t:new t.aI(De,I.u_size_t),u_size:new t.aI(De,I.u_size),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_pitch:new t.aI(De,I.u_pitch),u_rotate_symbol:new t.aH(De,I.u_rotate_symbol),u_aspect_ratio:new t.aI(De,I.u_aspect_ratio),u_fade_change:new t.aI(De,I.u_fade_change),u_matrix:new t.aJ(De,I.u_matrix),u_label_plane_matrix:new t.aJ(De,I.u_label_plane_matrix),u_coord_matrix:new t.aJ(De,I.u_coord_matrix),u_is_text:new t.aH(De,I.u_is_text),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_is_along_line:new t.aH(De,I.u_is_along_line),u_is_variable_anchor:new t.aH(De,I.u_is_variable_anchor),u_texsize:new t.aO(De,I.u_texsize),u_texsize_icon:new t.aO(De,I.u_texsize_icon),u_texture:new t.aH(De,I.u_texture),u_texture_icon:new t.aH(De,I.u_texture_icon),u_gamma_scale:new t.aI(De,I.u_gamma_scale),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_is_halo:new t.aH(De,I.u_is_halo),u_translation:new t.aO(De,I.u_translation),u_pitched_scale:new t.aI(De,I.u_pitched_scale)}),background:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_opacity:new t.aI(De,I.u_opacity),u_color:new t.aL(De,I.u_color)}),backgroundPattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_opacity:new t.aI(De,I.u_opacity),u_image:new t.aH(De,I.u_image),u_pattern_tl_a:new t.aO(De,I.u_pattern_tl_a),u_pattern_br_a:new t.aO(De,I.u_pattern_br_a),u_pattern_tl_b:new t.aO(De,I.u_pattern_tl_b),u_pattern_br_b:new t.aO(De,I.u_pattern_br_b),u_texsize:new t.aO(De,I.u_texsize),u_mix:new t.aI(De,I.u_mix),u_pattern_size_a:new t.aO(De,I.u_pattern_size_a),u_pattern_size_b:new t.aO(De,I.u_pattern_size_b),u_scale_a:new t.aI(De,I.u_scale_a),u_scale_b:new t.aI(De,I.u_scale_b),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(De,I.u_tile_units_to_pixels)}),terrain:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_texture:new t.aH(De,I.u_texture),u_ele_delta:new t.aI(De,I.u_ele_delta),u_fog_matrix:new t.aJ(De,I.u_fog_matrix),u_fog_color:new t.aL(De,I.u_fog_color),u_fog_ground_blend:new t.aI(De,I.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(De,I.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(De,I.u_horizon_color),u_horizon_fog_blend:new t.aI(De,I.u_horizon_fog_blend)}),terrainDepth:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ele_delta:new t.aI(De,I.u_ele_delta)}),terrainCoords:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_texture:new t.aH(De,I.u_texture),u_terrain_coords_id:new t.aI(De,I.u_terrain_coords_id),u_ele_delta:new t.aI(De,I.u_ele_delta)}),sky:(De,I)=>({u_sky_color:new t.aL(De,I.u_sky_color),u_horizon_color:new t.aL(De,I.u_horizon_color),u_horizon:new t.aI(De,I.u_horizon),u_sky_horizon_blend:new t.aI(De,I.u_sky_horizon_blend)})};class Co{constructor(I,ne,Te){this.context=I;const Se=I.gl;this.buffer=Se.createBuffer(),this.dynamicDraw=!!Te,this.context.unbindVAO(),I.bindElementBuffer.set(this.buffer),Se.bufferData(Se.ELEMENT_ARRAY_BUFFER,ne.arrayBuffer,this.dynamicDraw?Se.DYNAMIC_DRAW:Se.STATIC_DRAW),this.dynamicDraw||delete ne.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(I){const ne=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),ne.bufferSubData(ne.ELEMENT_ARRAY_BUFFER,0,I.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Qa={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Jn{constructor(I,ne,Te,Se){this.length=ne.length,this.attributes=Te,this.itemSize=ne.bytesPerElement,this.dynamicDraw=Se,this.context=I;const Ie=I.gl;this.buffer=Ie.createBuffer(),I.bindVertexBuffer.set(this.buffer),Ie.bufferData(Ie.ARRAY_BUFFER,ne.arrayBuffer,this.dynamicDraw?Ie.DYNAMIC_DRAW:Ie.STATIC_DRAW),this.dynamicDraw||delete ne.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(I){if(I.length!==this.length)throw new Error(`Length of new data is ${I.length}, which doesn't match current length of ${this.length}`);const ne=this.context.gl;this.bind(),ne.bufferSubData(ne.ARRAY_BUFFER,0,I.arrayBuffer)}enableAttributes(I,ne){for(let Te=0;Te0){const rr=t.H();t.aQ(rr,gt.placementInvProjMatrix,De.transform.glCoordMatrix),t.aQ(rr,rr,gt.placementViewportMatrix),Ct.push({circleArray:Yt,circleOffset:nr,transform:Tt.posMatrix,invTransform:rr,coord:Tt}),Wt+=Yt.length/4,nr=Wt}Et&&yt.draw(Ie,ot.LINES,Eo.disabled,is.disabled,De.colorModeForRenderPass(),oo.disabled,{u_matrix:Tt.posMatrix,u_pixel_extrude_scale:[1/(or=De.transform).width,1/or.height]},De.style.map.terrain&&De.style.map.terrain.getTerrainData(Tt),ne.id,Et.layoutVertexBuffer,Et.indexBuffer,Et.segments,null,De.transform.zoom,null,null,Et.collisionVertexBuffer)}var or;if(!Se||!Ct.length)return;const Fr=De.useProgram("collisionCircle"),Wr=new t.aR;Wr.resize(4*Wt),Wr._trim();let je=0;for(const lt of Ct)for(let Tt=0;Tt=0&&(lt[gt.associatedIconIndex]={shiftedAnchor:Nn,angle:pi})}else qt(gt.numGlyphs,Ze)}if(Wt){at.clear();const Tt=De.icon.placedSymbolArray;for(let gt=0;gtDe.style.map.terrain.getElevation(ia,aa,Ua):null,Kr=ne.layout.get("text-rotation-alignment")==="map";Oe(za,ia.posMatrix,De,Se,Al,pe,lt,Wt,Kr,Ze,ia.toUnwrapped(),je.width,je.height,Le,Vr)}const ht=ia.posMatrix,xt=Se&&Sr||ut,zt=Tt||xt?zl:Al,Dt=pu,$t=ln&&ne.paint.get(Se?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Cr;Cr=ln?za.iconsInText?Yi(Nn.kind,Gi,gt,lt,Tt,xt,De,ht,zt,Dt,Le,No,zs,Qr):Li(Nn.kind,Gi,gt,lt,Tt,xt,De,ht,zt,Dt,Le,Se,No,!0,Qr):Ro(Nn.kind,Gi,gt,lt,Tt,xt,De,ht,zt,Dt,Le,Se,No,Qr);const Ar={program:ii,buffers:nn,uniformValues:Cr,atlasTexture:po,atlasTextureIcon:xo,atlasInterpolation:Zo,atlasInterpolationIcon:Hs,isSDF:ln,hasHalo:$t};if(Yt&&za.canOverlap){rr=!0;const Vr=nn.segments.get();for(const Kr of Vr)Nr.push({segments:new t.a0([Kr]),sortKey:Kr.sortKey,state:Ar,terrainData:Bo})}else Nr.push({segments:nn.segments,sortKey:0,state:Ar,terrainData:Bo})}rr&&Nr.sort((ia,_a)=>ia.sortKey-_a.sortKey);for(const ia of Nr){const _a=ia.state;if(Fr.activeTexture.set(Wr.TEXTURE0),_a.atlasTexture.bind(_a.atlasInterpolation,Wr.CLAMP_TO_EDGE),_a.atlasTextureIcon&&(Fr.activeTexture.set(Wr.TEXTURE1),_a.atlasTextureIcon&&_a.atlasTextureIcon.bind(_a.atlasInterpolationIcon,Wr.CLAMP_TO_EDGE)),_a.isSDF){const za=_a.uniformValues;_a.hasHalo&&(za.u_is_halo=1,Jc(_a.buffers,ia.segments,ne,De,_a.program,sr,nr,or,za,ia.terrainData)),za.u_is_halo=0}Jc(_a.buffers,ia.segments,ne,De,_a.program,sr,nr,or,_a.uniformValues,ia.terrainData)}}function Jc(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt){const nr=Te.context;Se.draw(nr,nr.gl.TRIANGLES,Ie,ot,yt,oo.disabled,Ct,Wt,ne.id,De.layoutVertexBuffer,De.indexBuffer,I,ne.paint,Te.transform.zoom,De.programConfigurations.get(ne.id),De.dynamicLayoutVertexBuffer,De.opacityVertexBuffer)}function Uc(De,I,ne,Te){const Se=De.context,Ie=Se.gl,ot=is.disabled,yt=new Bs([Ie.ONE,Ie.ONE],t.aM.transparent,[!0,!0,!0,!0]),Ct=I.getBucket(ne);if(!Ct)return;const Wt=Te.key;let nr=ne.heatmapFbos.get(Wt);nr||(nr=jc(Se,I.tileSize,I.tileSize),ne.heatmapFbos.set(Wt,nr)),Se.bindFramebuffer.set(nr.framebuffer),Se.viewport.set([0,0,I.tileSize,I.tileSize]),Se.clear({color:t.aM.transparent});const or=Ct.programConfigurations.get(ne.id),Fr=De.useProgram("heatmap",or),Wr=De.style.map.terrain.getTerrainData(Te);Fr.draw(Se,Ie.TRIANGLES,Eo.disabled,ot,yt,oo.disabled,ci(Te.posMatrix,I,De.transform.zoom,ne.paint.get("heatmap-intensity")),Wr,ne.id,Ct.layoutVertexBuffer,Ct.indexBuffer,Ct.segments,ne.paint,De.transform.zoom,or)}function $u(De,I,ne){const Te=De.context,Se=Te.gl;Te.setColorMode(De.colorModeForRenderPass());const Ie=$c(Te,I),ot=ne.key,yt=I.heatmapFbos.get(ot);yt&&(Te.activeTexture.set(Se.TEXTURE0),Se.bindTexture(Se.TEXTURE_2D,yt.colorAttachment.get()),Te.activeTexture.set(Se.TEXTURE1),Ie.bind(Se.LINEAR,Se.CLAMP_TO_EDGE),De.useProgram("heatmapTexture").draw(Te,Se.TRIANGLES,Eo.disabled,is.disabled,De.colorModeForRenderPass(),oo.disabled,ei(De,I,0,1),null,I.id,De.rasterBoundsBuffer,De.quadTriangleIndexBuffer,De.rasterBoundsSegments,I.paint,De.transform.zoom),yt.destroy(),I.heatmapFbos.delete(ot))}function jc(De,I,ne){var Te,Se;const Ie=De.gl,ot=Ie.createTexture();Ie.bindTexture(Ie.TEXTURE_2D,ot),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_WRAP_S,Ie.CLAMP_TO_EDGE),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_WRAP_T,Ie.CLAMP_TO_EDGE),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_MIN_FILTER,Ie.LINEAR),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_MAG_FILTER,Ie.LINEAR);const yt=(Te=De.HALF_FLOAT)!==null&&Te!==void 0?Te:Ie.UNSIGNED_BYTE,Ct=(Se=De.RGBA16F)!==null&&Se!==void 0?Se:Ie.RGBA;Ie.texImage2D(Ie.TEXTURE_2D,0,Ct,I,ne,0,Ie.RGBA,yt,null);const Wt=De.createFramebuffer(I,ne,!1,!1);return Wt.colorAttachment.set(ot),Wt}function $c(De,I){return I.colorRampTexture||(I.colorRampTexture=new u(De,I.colorRamp,De.gl.RGBA)),I.colorRampTexture}function bu(De,I,ne,Te,Se){if(!ne||!Te||!Te.imageAtlas)return;const Ie=Te.imageAtlas.patternPositions;let ot=Ie[ne.to.toString()],yt=Ie[ne.from.toString()];if(!ot&&yt&&(ot=yt),!yt&&ot&&(yt=ot),!ot||!yt){const Ct=Se.getPaintProperty(I);ot=Ie[Ct],yt=Ie[Ct]}ot&&yt&&De.setConstantPatternPositions(ot,yt)}function Qc(De,I,ne,Te,Se,Ie,ot){const yt=De.context.gl,Ct="fill-pattern",Wt=ne.paint.get(Ct),nr=Wt&&Wt.constantOr(1),or=ne.getCrossfadeParameters();let Fr,Wr,je,Ze,at;ot?(Wr=nr&&!ne.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Fr=yt.LINES):(Wr=nr?"fillPattern":"fill",Fr=yt.TRIANGLES);const lt=Wt.constantOr(null);for(const Tt of Te){const gt=I.getTile(Tt);if(nr&&!gt.patternsLoaded())continue;const Et=gt.getBucket(ne);if(!Et)continue;const Yt=Et.programConfigurations.get(ne.id),rr=De.useProgram(Wr,Yt),sr=De.style.map.terrain&&De.style.map.terrain.getTerrainData(Tt);nr&&(De.context.activeTexture.set(yt.TEXTURE0),gt.imageAtlasTexture.bind(yt.LINEAR,yt.CLAMP_TO_EDGE),Yt.updatePaintBuffers(or)),bu(Yt,Ct,lt,gt,ne);const Sr=sr?Tt:null,Nr=De.translatePosMatrix(Sr?Sr.posMatrix:Tt.posMatrix,gt,ne.paint.get("fill-translate"),ne.paint.get("fill-translate-anchor"));if(ot){Ze=Et.indexBuffer2,at=Et.segments2;const Qr=[yt.drawingBufferWidth,yt.drawingBufferHeight];je=Wr==="fillOutlinePattern"&&nr?qn(Nr,De,or,gt,Qr):Ga(Nr,Qr)}else Ze=Et.indexBuffer,at=Et.segments,je=nr?pn(Nr,De,or,gt):pa(Nr);rr.draw(De.context,Fr,Se,De.stencilModeForClipping(Tt),Ie,oo.disabled,je,sr,ne.id,Et.layoutVertexBuffer,Ze,at,ne.paint,De.transform.zoom,Yt)}}function sc(De,I,ne,Te,Se,Ie,ot){const yt=De.context,Ct=yt.gl,Wt="fill-extrusion-pattern",nr=ne.paint.get(Wt),or=nr.constantOr(1),Fr=ne.getCrossfadeParameters(),Wr=ne.paint.get("fill-extrusion-opacity"),je=nr.constantOr(null);for(const Ze of Te){const at=I.getTile(Ze),lt=at.getBucket(ne);if(!lt)continue;const Tt=De.style.map.terrain&&De.style.map.terrain.getTerrainData(Ze),gt=lt.programConfigurations.get(ne.id),Et=De.useProgram(or?"fillExtrusionPattern":"fillExtrusion",gt);or&&(De.context.activeTexture.set(Ct.TEXTURE0),at.imageAtlasTexture.bind(Ct.LINEAR,Ct.CLAMP_TO_EDGE),gt.updatePaintBuffers(Fr)),bu(gt,Wt,je,at,ne);const Yt=De.translatePosMatrix(Ze.posMatrix,at,ne.paint.get("fill-extrusion-translate"),ne.paint.get("fill-extrusion-translate-anchor")),rr=ne.paint.get("fill-extrusion-vertical-gradient"),sr=or?ra(Yt,De,rr,Wr,Ze,Fr,at):ya(Yt,De,rr,Wr);Et.draw(yt,yt.gl.TRIANGLES,Se,Ie,ot,oo.backCCW,sr,Tt,ne.id,lt.layoutVertexBuffer,lt.indexBuffer,lt.segments,ne.paint,De.transform.zoom,gt,De.style.map.terrain&<.centroidVertexBuffer)}}function wu(De,I,ne,Te,Se,Ie,ot){const yt=De.context,Ct=yt.gl,Wt=ne.fbo;if(!Wt)return;const nr=De.useProgram("hillshade"),or=De.style.map.terrain&&De.style.map.terrain.getTerrainData(I);yt.activeTexture.set(Ct.TEXTURE0),Ct.bindTexture(Ct.TEXTURE_2D,Wt.colorAttachment.get()),nr.draw(yt,Ct.TRIANGLES,Se,Ie,ot,oo.disabled,((Fr,Wr,je,Ze)=>{const at=je.paint.get("hillshade-shadow-color"),lt=je.paint.get("hillshade-highlight-color"),Tt=je.paint.get("hillshade-accent-color");let gt=je.paint.get("hillshade-illumination-direction")*(Math.PI/180);je.paint.get("hillshade-illumination-anchor")==="viewport"&&(gt-=Fr.transform.angle);const Et=!Fr.options.moving;return{u_matrix:Ze?Ze.posMatrix:Fr.transform.calculatePosMatrix(Wr.tileID.toUnwrapped(),Et),u_image:0,u_latrange:mi(0,Wr.tileID),u_light:[je.paint.get("hillshade-exaggeration"),gt],u_shadow:at,u_highlight:lt,u_accent:Tt}})(De,ne,Te,or?I:null),or,Te.id,De.rasterBoundsBuffer,De.quadTriangleIndexBuffer,De.rasterBoundsSegments)}function eu(De,I,ne,Te,Se,Ie){const ot=De.context,yt=ot.gl,Ct=I.dem;if(Ct&&Ct.data){const Wt=Ct.dim,nr=Ct.stride,or=Ct.getPixels();if(ot.activeTexture.set(yt.TEXTURE1),ot.pixelStoreUnpackPremultiplyAlpha.set(!1),I.demTexture=I.demTexture||De.getTileTexture(nr),I.demTexture){const Wr=I.demTexture;Wr.update(or,{premultiply:!1}),Wr.bind(yt.NEAREST,yt.CLAMP_TO_EDGE)}else I.demTexture=new u(ot,or,yt.RGBA,{premultiply:!1}),I.demTexture.bind(yt.NEAREST,yt.CLAMP_TO_EDGE);ot.activeTexture.set(yt.TEXTURE0);let Fr=I.fbo;if(!Fr){const Wr=new u(ot,{width:Wt,height:Wt,data:null},yt.RGBA);Wr.bind(yt.LINEAR,yt.CLAMP_TO_EDGE),Fr=I.fbo=ot.createFramebuffer(Wt,Wt,!0,!1),Fr.colorAttachment.set(Wr.texture)}ot.bindFramebuffer.set(Fr.framebuffer),ot.viewport.set([0,0,Wt,Wt]),De.useProgram("hillshadePrepare").draw(ot,yt.TRIANGLES,Te,Se,Ie,oo.disabled,((Wr,je)=>{const Ze=je.stride,at=t.H();return t.aP(at,0,t.X,-t.X,0,0,1),t.J(at,at,[0,-t.X,0]),{u_matrix:at,u_image:1,u_dimension:[Ze,Ze],u_zoom:Wr.overscaledZ,u_unpack:je.getUnpackVector()}})(I.tileID,Ct),null,ne.id,De.rasterBoundsBuffer,De.quadTriangleIndexBuffer,De.rasterBoundsSegments),I.needsHillshadePrepare=!1}}function Sc(De,I,ne,Te,Se,Ie){const ot=Te.paint.get("raster-fade-duration");if(!Ie&&ot>0){const yt=i.now(),Ct=(yt-De.timeAdded)/ot,Wt=I?(yt-I.timeAdded)/ot:-1,nr=ne.getSource(),or=Se.coveringZoomLevel({tileSize:nr.tileSize,roundZoom:nr.roundZoom}),Fr=!I||Math.abs(I.tileID.overscaledZ-or)>Math.abs(De.tileID.overscaledZ-or),Wr=Fr&&De.refreshedUponExpiration?1:t.ac(Fr?Ct:1-Wt,0,1);return De.refreshedUponExpiration&&Ct>=1&&(De.refreshedUponExpiration=!1),I?{opacity:1,mix:1-Wr}:{opacity:Wr,mix:0}}return{opacity:1,mix:0}}const ef=new t.aM(1,0,0,1),ps=new t.aM(0,1,0,1),Vc=new t.aM(0,0,1,1),Zf=new t.aM(1,0,1,1),mf=new t.aM(0,1,1,1);function Mc(De,I,ne,Te){tu(De,0,I+ne/2,De.transform.width,ne,Te)}function _f(De,I,ne,Te){tu(De,I-ne/2,0,ne,De.transform.height,Te)}function tu(De,I,ne,Te,Se,Ie){const ot=De.context,yt=ot.gl;yt.enable(yt.SCISSOR_TEST),yt.scissor(I*De.pixelRatio,ne*De.pixelRatio,Te*De.pixelRatio,Se*De.pixelRatio),ot.clear({color:Ie}),yt.disable(yt.SCISSOR_TEST)}function xf(De,I,ne){const Te=De.context,Se=Te.gl,Ie=ne.posMatrix,ot=De.useProgram("debug"),yt=Eo.disabled,Ct=is.disabled,Wt=De.colorModeForRenderPass(),nr="$debug",or=De.style.map.terrain&&De.style.map.terrain.getTerrainData(ne);Te.activeTexture.set(Se.TEXTURE0);const Fr=I.getTileByID(ne.key).latestRawTileData,Wr=Math.floor((Fr&&Fr.byteLength||0)/1024),je=I.getTile(ne).tileSize,Ze=512/Math.min(je,512)*(ne.overscaledZ/De.transform.zoom)*.5;let at=ne.canonical.toString();ne.overscaledZ!==ne.canonical.z&&(at+=` => ${ne.overscaledZ}`),function(lt,Tt){lt.initDebugOverlayCanvas();const gt=lt.debugOverlayCanvas,Et=lt.context.gl,Yt=lt.debugOverlayCanvas.getContext("2d");Yt.clearRect(0,0,gt.width,gt.height),Yt.shadowColor="white",Yt.shadowBlur=2,Yt.lineWidth=1.5,Yt.strokeStyle="white",Yt.textBaseline="top",Yt.font="bold 36px Open Sans, sans-serif",Yt.fillText(Tt,5,5),Yt.strokeText(Tt,5,5),lt.debugOverlayTexture.update(gt),lt.debugOverlayTexture.bind(Et.LINEAR,Et.CLAMP_TO_EDGE)}(De,`${at} ${Wr}kB`),ot.draw(Te,Se.TRIANGLES,yt,Ct,Bs.alphaBlended,oo.disabled,yi(Ie,t.aM.transparent,Ze),null,nr,De.debugBuffer,De.quadTriangleIndexBuffer,De.debugSegments),ot.draw(Te,Se.LINE_STRIP,yt,Ct,Wt,oo.disabled,yi(Ie,t.aM.red),or,nr,De.debugBuffer,De.tileBorderIndexBuffer,De.debugSegments)}function Fl(De,I,ne){const Te=De.context,Se=Te.gl,Ie=De.colorModeForRenderPass(),ot=new Eo(Se.LEQUAL,Eo.ReadWrite,De.depthRangeFor3D),yt=De.useProgram("terrain"),Ct=I.getTerrainMesh();Te.bindFramebuffer.set(null),Te.viewport.set([0,0,De.width,De.height]);for(const Wt of ne){const nr=De.renderToTexture.getTexture(Wt),or=I.getTerrainData(Wt.tileID);Te.activeTexture.set(Se.TEXTURE0),Se.bindTexture(Se.TEXTURE_2D,nr.texture);const Fr=De.transform.calculatePosMatrix(Wt.tileID.toUnwrapped()),Wr=I.getMeshFrameDelta(De.transform.zoom),je=De.transform.calculateFogMatrix(Wt.tileID.toUnwrapped()),Ze=mr(Fr,Wr,je,De.style.sky,De.transform.pitch);yt.draw(Te,Se.TRIANGLES,ot,is.disabled,Ie,oo.backCCW,Ze,or,"terrain",Ct.vertexBuffer,Ct.indexBuffer,Ct.segments)}}class ru{constructor(I,ne,Te){this.vertexBuffer=I,this.indexBuffer=ne,this.segments=Te}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Uu{constructor(I,ne){this.context=new Gf(I),this.transform=ne,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=St.maxUnderzooming+St.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new kr}resize(I,ne,Te){if(this.width=Math.floor(I*Te),this.height=Math.floor(ne*Te),this.pixelRatio=Te,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const Se of this.style._order)this.style._layers[Se].resize()}setup(){const I=this.context,ne=new t.aX;ne.emplaceBack(0,0),ne.emplaceBack(t.X,0),ne.emplaceBack(0,t.X),ne.emplaceBack(t.X,t.X),this.tileExtentBuffer=I.createVertexBuffer(ne,Zr.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);const Te=new t.aX;Te.emplaceBack(0,0),Te.emplaceBack(t.X,0),Te.emplaceBack(0,t.X),Te.emplaceBack(t.X,t.X),this.debugBuffer=I.createVertexBuffer(Te,Zr.members),this.debugSegments=t.a0.simpleSegment(0,0,4,5);const Se=new t.$;Se.emplaceBack(0,0,0,0),Se.emplaceBack(t.X,0,t.X,0),Se.emplaceBack(0,t.X,0,t.X),Se.emplaceBack(t.X,t.X,t.X,t.X),this.rasterBoundsBuffer=I.createVertexBuffer(Se,qe.members),this.rasterBoundsSegments=t.a0.simpleSegment(0,0,4,2);const Ie=new t.aX;Ie.emplaceBack(0,0),Ie.emplaceBack(1,0),Ie.emplaceBack(0,1),Ie.emplaceBack(1,1),this.viewportBuffer=I.createVertexBuffer(Ie,Zr.members),this.viewportSegments=t.a0.simpleSegment(0,0,4,2);const ot=new t.aZ;ot.emplaceBack(0),ot.emplaceBack(1),ot.emplaceBack(3),ot.emplaceBack(2),ot.emplaceBack(0),this.tileBorderIndexBuffer=I.createIndexBuffer(ot);const yt=new t.aY;yt.emplaceBack(0,1,2),yt.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=I.createIndexBuffer(yt);const Ct=this.context.gl;this.stencilClearMode=new is({func:Ct.ALWAYS,mask:0},0,255,Ct.ZERO,Ct.ZERO,Ct.ZERO)}clearStencil(){const I=this.context,ne=I.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const Te=t.H();t.aP(Te,0,this.width,this.height,0,0,1),t.K(Te,Te,[ne.drawingBufferWidth,ne.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(I,ne.TRIANGLES,Eo.disabled,this.stencilClearMode,Bs.disabled,oo.disabled,Ci(Te),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(I,ne){if(this.currentStencilSource===I.source||!I.isTileClipped()||!ne||!ne.length)return;this.currentStencilSource=I.source;const Te=this.context,Se=Te.gl;this.nextStencilID+ne.length>256&&this.clearStencil(),Te.setColorMode(Bs.disabled),Te.setDepthMode(Eo.disabled);const Ie=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const ot of ne){const yt=this._tileClippingMaskIDs[ot.key]=this.nextStencilID++,Ct=this.style.map.terrain&&this.style.map.terrain.getTerrainData(ot);Ie.draw(Te,Se.TRIANGLES,Eo.disabled,new is({func:Se.ALWAYS,mask:0},yt,255,Se.KEEP,Se.KEEP,Se.REPLACE),Bs.disabled,oo.disabled,Ci(ot.posMatrix),Ct,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const I=this.nextStencilID++,ne=this.context.gl;return new is({func:ne.NOTEQUAL,mask:255},I,255,ne.KEEP,ne.KEEP,ne.REPLACE)}stencilModeForClipping(I){const ne=this.context.gl;return new is({func:ne.EQUAL,mask:255},this._tileClippingMaskIDs[I.key],0,ne.KEEP,ne.KEEP,ne.REPLACE)}stencilConfigForOverlap(I){const ne=this.context.gl,Te=I.sort((ot,yt)=>yt.overscaledZ-ot.overscaledZ),Se=Te[Te.length-1].overscaledZ,Ie=Te[0].overscaledZ-Se+1;if(Ie>1){this.currentStencilSource=void 0,this.nextStencilID+Ie>256&&this.clearStencil();const ot={};for(let yt=0;yt({u_sky_color:lt.properties.get("sky-color"),u_horizon_color:lt.properties.get("horizon-color"),u_horizon:(Tt.height/2+Tt.getHorizon())*gt,u_sky_horizon_blend:lt.properties.get("sky-horizon-blend")*Tt.height/2*gt}))(Wt,Ct.style.map.transform,Ct.pixelRatio),Wr=new Eo(or.LEQUAL,Eo.ReadWrite,[0,1]),je=is.disabled,Ze=Ct.colorModeForRenderPass(),at=Ct.useProgram("sky");if(!Wt.mesh){const lt=new t.aX;lt.emplaceBack(-1,-1),lt.emplaceBack(1,-1),lt.emplaceBack(1,1),lt.emplaceBack(-1,1);const Tt=new t.aY;Tt.emplaceBack(0,1,2),Tt.emplaceBack(0,2,3),Wt.mesh=new ru(nr.createVertexBuffer(lt,Zr.members),nr.createIndexBuffer(Tt),t.a0.simpleSegment(0,0,lt.length,Tt.length))}at.draw(nr,or.TRIANGLES,Wr,je,Ze,oo.disabled,Fr,void 0,"sky",Wt.mesh.vertexBuffer,Wt.mesh.indexBuffer,Wt.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=ne.showOverdrawInspector,this.depthRangeFor3D=[0,1-(I._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=Te.length-1;this.currentLayer>=0;this.currentLayer--){const Ct=this.style._layers[Te[this.currentLayer]],Wt=Se[Ct.source],nr=Ie[Ct.source];this._renderTileClippingMasks(Ct,nr),this.renderLayer(this,Wt,Ct,nr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerat.source&&!at.isHidden(nr)?[Wt.sourceCaches[at.source]]:[]),Wr=Fr.filter(at=>at.getSource().type==="vector"),je=Fr.filter(at=>at.getSource().type!=="vector"),Ze=at=>{(!or||or.getSource().maxzoomZe(at)),or||je.forEach(at=>Ze(at)),or}(this.style,this.transform.zoom);Ct&&function(Wt,nr,or){for(let Fr=0;Fr0),Se&&(t.b0(ne,Te),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(Ie,ot){const yt=Ie.context,Ct=yt.gl,Wt=Bs.unblended,nr=new Eo(Ct.LEQUAL,Eo.ReadWrite,[0,1]),or=ot.getTerrainMesh(),Fr=ot.sourceCache.getRenderableTiles(),Wr=Ie.useProgram("terrainDepth");yt.bindFramebuffer.set(ot.getFramebuffer("depth").framebuffer),yt.viewport.set([0,0,Ie.width/devicePixelRatio,Ie.height/devicePixelRatio]),yt.clear({color:t.aM.transparent,depth:1});for(const je of Fr){const Ze=ot.getTerrainData(je.tileID),at={u_matrix:Ie.transform.calculatePosMatrix(je.tileID.toUnwrapped()),u_ele_delta:ot.getMeshFrameDelta(Ie.transform.zoom)};Wr.draw(yt,Ct.TRIANGLES,nr,is.disabled,Wt,oo.backCCW,at,Ze,"terrain",or.vertexBuffer,or.indexBuffer,or.segments)}yt.bindFramebuffer.set(null),yt.viewport.set([0,0,Ie.width,Ie.height])}(this,this.style.map.terrain),function(Ie,ot){const yt=Ie.context,Ct=yt.gl,Wt=Bs.unblended,nr=new Eo(Ct.LEQUAL,Eo.ReadWrite,[0,1]),or=ot.getTerrainMesh(),Fr=ot.getCoordsTexture(),Wr=ot.sourceCache.getRenderableTiles(),je=Ie.useProgram("terrainCoords");yt.bindFramebuffer.set(ot.getFramebuffer("coords").framebuffer),yt.viewport.set([0,0,Ie.width/devicePixelRatio,Ie.height/devicePixelRatio]),yt.clear({color:t.aM.transparent,depth:1}),ot.coordsIndex=[];for(const Ze of Wr){const at=ot.getTerrainData(Ze.tileID);yt.activeTexture.set(Ct.TEXTURE0),Ct.bindTexture(Ct.TEXTURE_2D,Fr.texture);const lt={u_matrix:Ie.transform.calculatePosMatrix(Ze.tileID.toUnwrapped()),u_terrain_coords_id:(255-ot.coordsIndex.length)/255,u_texture:0,u_ele_delta:ot.getMeshFrameDelta(Ie.transform.zoom)};je.draw(yt,Ct.TRIANGLES,nr,is.disabled,Wt,oo.backCCW,lt,at,"terrain",or.vertexBuffer,or.indexBuffer,or.segments),ot.coordsIndex.push(Ze.tileID.key)}yt.bindFramebuffer.set(null),yt.viewport.set([0,0,Ie.width,Ie.height])}(this,this.style.map.terrain))}renderLayer(I,ne,Te,Se){if(!Te.isHidden(this.transform.zoom)&&(Te.type==="background"||Te.type==="custom"||(Se||[]).length))switch(this.id=Te.id,Te.type){case"symbol":(function(Ie,ot,yt,Ct,Wt){if(Ie.renderPass!=="translucent")return;const nr=is.disabled,or=Ie.colorModeForRenderPass();(yt._unevaluatedLayout.hasValue("text-variable-anchor")||yt._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(Fr,Wr,je,Ze,at,lt,Tt,gt,Et){const Yt=Wr.transform,rr=Oa(),sr=at==="map",Sr=lt==="map";for(const Nr of Fr){const Qr=Ze.getTile(Nr),ia=Qr.getBucket(je);if(!ia||!ia.text||!ia.text.segments.get().length)continue;const _a=t.ag(ia.textSizeData,Yt.zoom),za=da(Qr,1,Wr.transform.zoom),nn=fr(Nr.posMatrix,Sr,sr,Wr.transform,za),en=je.layout.get("icon-text-fit")!=="none"&&ia.hasIconData();if(_a){const ln=Math.pow(2,Yt.zoom-Qr.tileID.overscaledZ),Nn=Wr.style.map.terrain?(ii,Gi)=>Wr.style.map.terrain.getElevation(Nr,ii,Gi):null,pi=rr.translatePosition(Yt,Qr,Tt,gt);gc(ia,sr,Sr,Et,Yt,nn,Nr.posMatrix,ln,_a,en,rr,pi,Nr.toUnwrapped(),Nn)}}}(Ct,Ie,yt,ot,yt.layout.get("text-rotation-alignment"),yt.layout.get("text-pitch-alignment"),yt.paint.get("text-translate"),yt.paint.get("text-translate-anchor"),Wt),yt.paint.get("icon-opacity").constantOr(1)!==0&&yf(Ie,ot,yt,Ct,!1,yt.paint.get("icon-translate"),yt.paint.get("icon-translate-anchor"),yt.layout.get("icon-rotation-alignment"),yt.layout.get("icon-pitch-alignment"),yt.layout.get("icon-keep-upright"),nr,or),yt.paint.get("text-opacity").constantOr(1)!==0&&yf(Ie,ot,yt,Ct,!0,yt.paint.get("text-translate"),yt.paint.get("text-translate-anchor"),yt.layout.get("text-rotation-alignment"),yt.layout.get("text-pitch-alignment"),yt.layout.get("text-keep-upright"),nr,or),ot.map.showCollisionBoxes&&(xu(Ie,ot,yt,Ct,!0),xu(Ie,ot,yt,Ct,!1))})(I,ne,Te,Se,this.style.placement.variableOffsets);break;case"circle":(function(Ie,ot,yt,Ct){if(Ie.renderPass!=="translucent")return;const Wt=yt.paint.get("circle-opacity"),nr=yt.paint.get("circle-stroke-width"),or=yt.paint.get("circle-stroke-opacity"),Fr=!yt.layout.get("circle-sort-key").isConstant();if(Wt.constantOr(1)===0&&(nr.constantOr(1)===0||or.constantOr(1)===0))return;const Wr=Ie.context,je=Wr.gl,Ze=Ie.depthModeForSublayer(0,Eo.ReadOnly),at=is.disabled,lt=Ie.colorModeForRenderPass(),Tt=[];for(let gt=0;gtgt.sortKey-Et.sortKey);for(const gt of Tt){const{programConfiguration:Et,program:Yt,layoutVertexBuffer:rr,indexBuffer:sr,uniformValues:Sr,terrainData:Nr}=gt.state;Yt.draw(Wr,je.TRIANGLES,Ze,at,lt,oo.disabled,Sr,Nr,yt.id,rr,sr,gt.segments,yt.paint,Ie.transform.zoom,Et)}})(I,ne,Te,Se);break;case"heatmap":(function(Ie,ot,yt,Ct){if(yt.paint.get("heatmap-opacity")===0)return;const Wt=Ie.context;if(Ie.style.map.terrain){for(const nr of Ct){const or=ot.getTile(nr);ot.hasRenderableParent(nr)||(Ie.renderPass==="offscreen"?Uc(Ie,or,yt,nr):Ie.renderPass==="translucent"&&$u(Ie,yt,nr))}Wt.viewport.set([0,0,Ie.width,Ie.height])}else Ie.renderPass==="offscreen"?function(nr,or,Fr,Wr){const je=nr.context,Ze=je.gl,at=is.disabled,lt=new Bs([Ze.ONE,Ze.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(Tt,gt,Et){const Yt=Tt.gl;Tt.activeTexture.set(Yt.TEXTURE1),Tt.viewport.set([0,0,gt.width/4,gt.height/4]);let rr=Et.heatmapFbos.get(t.aU);rr?(Yt.bindTexture(Yt.TEXTURE_2D,rr.colorAttachment.get()),Tt.bindFramebuffer.set(rr.framebuffer)):(rr=jc(Tt,gt.width/4,gt.height/4),Et.heatmapFbos.set(t.aU,rr))})(je,nr,Fr),je.clear({color:t.aM.transparent});for(let Tt=0;Tt20&&nr.texParameterf(nr.TEXTURE_2D,Wt.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Wt.extTextureFilterAnisotropicMax);const ia=Ie.style.map.terrain&&Ie.style.map.terrain.getTerrainData(Tt),_a=ia?Tt:null,za=_a?_a.posMatrix:Ie.transform.calculatePosMatrix(Tt.toUnwrapped(),lt),nn=Ao(za,Nr||[0,0],Sr||1,sr,yt);or instanceof et?Fr.draw(Wt,nr.TRIANGLES,gt,is.disabled,Wr,oo.disabled,nn,ia,yt.id,or.boundsBuffer,Ie.quadTriangleIndexBuffer,or.boundsSegments):Fr.draw(Wt,nr.TRIANGLES,gt,je[Tt.overscaledZ],Wr,oo.disabled,nn,ia,yt.id,Ie.rasterBoundsBuffer,Ie.quadTriangleIndexBuffer,Ie.rasterBoundsSegments)}})(I,ne,Te,Se);break;case"background":(function(Ie,ot,yt,Ct){const Wt=yt.paint.get("background-color"),nr=yt.paint.get("background-opacity");if(nr===0)return;const or=Ie.context,Fr=or.gl,Wr=Ie.transform,je=Wr.tileSize,Ze=yt.paint.get("background-pattern");if(Ie.isPatternMissing(Ze))return;const at=!Ze&&Wt.a===1&&nr===1&&Ie.opaquePassEnabledForLayer()?"opaque":"translucent";if(Ie.renderPass!==at)return;const lt=is.disabled,Tt=Ie.depthModeForSublayer(0,at==="opaque"?Eo.ReadWrite:Eo.ReadOnly),gt=Ie.colorModeForRenderPass(),Et=Ie.useProgram(Ze?"backgroundPattern":"background"),Yt=Ct||Wr.coveringTiles({tileSize:je,terrain:Ie.style.map.terrain});Ze&&(or.activeTexture.set(Fr.TEXTURE0),Ie.imageManager.bind(Ie.context));const rr=yt.getCrossfadeParameters();for(const sr of Yt){const Sr=Ct?sr.posMatrix:Ie.transform.calculatePosMatrix(sr.toUnwrapped()),Nr=Ze?as(Sr,nr,Ie,Ze,{tileID:sr,tileSize:je},rr):bs(Sr,nr,Wt),Qr=Ie.style.map.terrain&&Ie.style.map.terrain.getTerrainData(sr);Et.draw(or,Fr.TRIANGLES,Tt,lt,gt,oo.disabled,Nr,Qr,yt.id,Ie.tileExtentBuffer,Ie.quadTriangleIndexBuffer,Ie.tileExtentSegments)}})(I,0,Te,Se);break;case"custom":(function(Ie,ot,yt){const Ct=Ie.context,Wt=yt.implementation;if(Ie.renderPass==="offscreen"){const nr=Wt.prerender;nr&&(Ie.setCustomLayerDefaults(),Ct.setColorMode(Ie.colorModeForRenderPass()),nr.call(Wt,Ct.gl,Ie.transform.customLayerMatrix()),Ct.setDirty(),Ie.setBaseState())}else if(Ie.renderPass==="translucent"){Ie.setCustomLayerDefaults(),Ct.setColorMode(Ie.colorModeForRenderPass()),Ct.setStencilMode(is.disabled);const nr=Wt.renderingMode==="3d"?new Eo(Ie.context.gl.LEQUAL,Eo.ReadWrite,Ie.depthRangeFor3D):Ie.depthModeForSublayer(0,Eo.ReadOnly);Ct.setDepthMode(nr),Wt.render(Ct.gl,Ie.transform.customLayerMatrix(),{farZ:Ie.transform.farZ,nearZ:Ie.transform.nearZ,fov:Ie.transform._fov,modelViewProjectionMatrix:Ie.transform.modelViewProjectionMatrix,projectionMatrix:Ie.transform.projectionMatrix}),Ct.setDirty(),Ie.setBaseState(),Ct.bindFramebuffer.set(null)}})(I,0,Te)}}translatePosMatrix(I,ne,Te,Se,Ie){if(!Te[0]&&!Te[1])return I;const ot=Ie?Se==="map"?this.transform.angle:0:Se==="viewport"?-this.transform.angle:0;if(ot){const Wt=Math.sin(ot),nr=Math.cos(ot);Te=[Te[0]*nr-Te[1]*Wt,Te[0]*Wt+Te[1]*nr]}const yt=[Ie?Te[0]:da(ne,Te[0],this.transform.zoom),Ie?Te[1]:da(ne,Te[1],this.transform.zoom),0],Ct=new Float32Array(16);return t.J(Ct,I,yt),Ct}saveTileTexture(I){const ne=this._tileTextures[I.size[0]];ne?ne.push(I):this._tileTextures[I.size[0]]=[I]}getTileTexture(I){const ne=this._tileTextures[I];return ne&&ne.length>0?ne.pop():null}isPatternMissing(I){if(!I)return!1;if(!I.from||!I.to)return!0;const ne=this.imageManager.getPattern(I.from.toString()),Te=this.imageManager.getPattern(I.to.toString());return!ne||!Te}useProgram(I,ne){this.cache=this.cache||{};const Te=I+(ne?ne.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[Te]||(this.cache[Te]=new oa(this.context,Jr[I],ne,fs[I],this._showOverdrawInspector,this.style.map.terrain)),this.cache[Te]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const 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)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new u(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:I,drawingBufferHeight:ne}=this.context.gl;return this.width!==I||this.height!==ne}}class $s{constructor(I,ne){this.points=I,this.planes=ne}static fromInvProjectionMatrix(I,ne,Te){const Se=Math.pow(2,Te),Ie=[[-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(yt=>{const Ct=1/(yt=t.af([],yt,I))[3]/ne*Se;return t.b1(yt,yt,[Ct,Ct,1/yt[3],Ct])}),ot=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(yt=>{const Ct=function(Fr,Wr){var je=Wr[0],Ze=Wr[1],at=Wr[2],lt=je*je+Ze*Ze+at*at;return lt>0&&(lt=1/Math.sqrt(lt)),Fr[0]=Wr[0]*lt,Fr[1]=Wr[1]*lt,Fr[2]=Wr[2]*lt,Fr}([],function(Fr,Wr,je){var Ze=Wr[0],at=Wr[1],lt=Wr[2],Tt=je[0],gt=je[1],Et=je[2];return Fr[0]=at*Et-lt*gt,Fr[1]=lt*Tt-Ze*Et,Fr[2]=Ze*gt-at*Tt,Fr}([],M([],Ie[yt[0]],Ie[yt[1]]),M([],Ie[yt[2]],Ie[yt[1]]))),Wt=-((nr=Ct)[0]*(or=Ie[yt[1]])[0]+nr[1]*or[1]+nr[2]*or[2]);var nr,or;return Ct.concat(Wt)});return new $s(Ie,ot)}}class Qu{constructor(I,ne){this.min=I,this.max=ne,this.center=function(Te,Se,Ie){return Te[0]=.5*Se[0],Te[1]=.5*Se[1],Te[2]=.5*Se[2],Te}([],function(Te,Se,Ie){return Te[0]=Se[0]+Ie[0],Te[1]=Se[1]+Ie[1],Te[2]=Se[2]+Ie[2],Te}([],this.min,this.max))}quadrant(I){const ne=[I%2==0,I<2],Te=b(this.min),Se=b(this.max);for(let Ie=0;Ie=0&&ot++;if(ot===0)return 0;ot!==ne.length&&(Te=!1)}if(Te)return 2;for(let Se=0;Se<3;Se++){let Ie=Number.MAX_VALUE,ot=-Number.MAX_VALUE;for(let yt=0;ytthis.max[Se]-this.min[Se])return 0}return 1}}class Tu{constructor(I=0,ne=0,Te=0,Se=0){if(isNaN(I)||I<0||isNaN(ne)||ne<0||isNaN(Te)||Te<0||isNaN(Se)||Se<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=I,this.bottom=ne,this.left=Te,this.right=Se}interpolate(I,ne,Te){return ne.top!=null&&I.top!=null&&(this.top=t.y.number(I.top,ne.top,Te)),ne.bottom!=null&&I.bottom!=null&&(this.bottom=t.y.number(I.bottom,ne.bottom,Te)),ne.left!=null&&I.left!=null&&(this.left=t.y.number(I.left,ne.left,Te)),ne.right!=null&&I.right!=null&&(this.right=t.y.number(I.right,ne.right,Te)),this}getCenter(I,ne){const Te=t.ac((this.left+I-this.right)/2,0,I),Se=t.ac((this.top+ne-this.bottom)/2,0,ne);return new t.P(Te,Se)}equals(I){return this.top===I.top&&this.bottom===I.bottom&&this.left===I.left&&this.right===I.right}clone(){return new Tu(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const au=85.051129;class Ns{constructor(I,ne,Te,Se,Ie){this.tileSize=512,this._renderWorldCopies=Ie===void 0||!!Ie,this._minZoom=I||0,this._maxZoom=ne||22,this._minPitch=Te??0,this._maxPitch=Se??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Tu,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const I=new Ns(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return I.apply(this),I}apply(I){this.tileSize=I.tileSize,this.latRange=I.latRange,this.lngRange=I.lngRange,this.width=I.width,this.height=I.height,this._center=I._center,this._elevation=I._elevation,this.minElevationForCurrentTile=I.minElevationForCurrentTile,this.zoom=I.zoom,this.angle=I.angle,this._fov=I._fov,this._pitch=I._pitch,this._unmodified=I._unmodified,this._edgeInsets=I._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(I){this._minZoom!==I&&(this._minZoom=I,this.zoom=Math.max(this.zoom,I))}get maxZoom(){return this._maxZoom}set maxZoom(I){this._maxZoom!==I&&(this._maxZoom=I,this.zoom=Math.min(this.zoom,I))}get minPitch(){return this._minPitch}set minPitch(I){this._minPitch!==I&&(this._minPitch=I,this.pitch=Math.max(this.pitch,I))}get maxPitch(){return this._maxPitch}set maxPitch(I){this._maxPitch!==I&&(this._maxPitch=I,this.pitch=Math.min(this.pitch,I))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(I){I===void 0?I=!0:I===null&&(I=!1),this._renderWorldCopies=I}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(I){const ne=-t.b3(I,-180,180)*Math.PI/180;this.angle!==ne&&(this._unmodified=!1,this.angle=ne,this._calcMatrices(),this.rotationMatrix=function(){var Te=new t.A(4);return t.A!=Float32Array&&(Te[1]=0,Te[2]=0),Te[0]=1,Te[3]=1,Te}(),function(Te,Se,Ie){var ot=Se[0],yt=Se[1],Ct=Se[2],Wt=Se[3],nr=Math.sin(Ie),or=Math.cos(Ie);Te[0]=ot*or+Ct*nr,Te[1]=yt*or+Wt*nr,Te[2]=ot*-nr+Ct*or,Te[3]=yt*-nr+Wt*or}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(I){const ne=t.ac(I,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==ne&&(this._unmodified=!1,this._pitch=ne,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(I){I=Math.max(.01,Math.min(60,I)),this._fov!==I&&(this._unmodified=!1,this._fov=I/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(I){const ne=Math.min(Math.max(I,this.minZoom),this.maxZoom);this._zoom!==ne&&(this._unmodified=!1,this._zoom=ne,this.tileZoom=Math.max(0,Math.floor(ne)),this.scale=this.zoomScale(ne),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(I){I.lat===this._center.lat&&I.lng===this._center.lng||(this._unmodified=!1,this._center=I,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(I){I!==this._elevation&&(this._elevation=I,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(I){this._edgeInsets.equals(I)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,I,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(I){return this._edgeInsets.equals(I)}interpolatePadding(I,ne,Te){this._unmodified=!1,this._edgeInsets.interpolate(I,ne,Te),this._constrain(),this._calcMatrices()}coveringZoomLevel(I){const ne=(I.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/I.tileSize));return Math.max(0,ne)}getVisibleUnwrappedCoordinates(I){const ne=[new t.b4(0,I)];if(this._renderWorldCopies){const Te=this.pointCoordinate(new t.P(0,0)),Se=this.pointCoordinate(new t.P(this.width,0)),Ie=this.pointCoordinate(new t.P(this.width,this.height)),ot=this.pointCoordinate(new t.P(0,this.height)),yt=Math.floor(Math.min(Te.x,Se.x,Ie.x,ot.x)),Ct=Math.floor(Math.max(Te.x,Se.x,Ie.x,ot.x)),Wt=1;for(let nr=yt-Wt;nr<=Ct+Wt;nr++)nr!==0&&ne.push(new t.b4(nr,I))}return ne}coveringTiles(I){var ne,Te;let Se=this.coveringZoomLevel(I);const Ie=Se;if(I.minzoom!==void 0&&SeI.maxzoom&&(Se=I.maxzoom);const ot=this.pointCoordinate(this.getCameraPoint()),yt=t.Z.fromLngLat(this.center),Ct=Math.pow(2,Se),Wt=[Ct*ot.x,Ct*ot.y,0],nr=[Ct*yt.x,Ct*yt.y,0],or=$s.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,Se);let Fr=I.minzoom||0;!I.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Fr=Se);const Wr=I.terrain?2/Math.min(this.tileSize,I.tileSize)*this.tileSize:3,je=gt=>({aabb:new Qu([gt*Ct,0,0],[(gt+1)*Ct,Ct,0]),zoom:0,x:0,y:0,wrap:gt,fullyVisible:!1}),Ze=[],at=[],lt=Se,Tt=I.reparseOverscaled?Ie:Se;if(this._renderWorldCopies)for(let gt=1;gt<=3;gt++)Ze.push(je(-gt)),Ze.push(je(gt));for(Ze.push(je(0));Ze.length>0;){const gt=Ze.pop(),Et=gt.x,Yt=gt.y;let rr=gt.fullyVisible;if(!rr){const ia=gt.aabb.intersects(or);if(ia===0)continue;rr=ia===2}const sr=I.terrain?Wt:nr,Sr=gt.aabb.distanceX(sr),Nr=gt.aabb.distanceY(sr),Qr=Math.max(Math.abs(Sr),Math.abs(Nr));if(gt.zoom===lt||Qr>Wr+(1<=Fr){const ia=lt-gt.zoom,_a=Wt[0]-.5-(Et<>1),nn=gt.zoom+1;let en=gt.aabb.quadrant(ia);if(I.terrain){const ln=new t.S(nn,gt.wrap,nn,_a,za),Nn=I.terrain.getMinMaxElevation(ln),pi=(ne=Nn.minElevation)!==null&&ne!==void 0?ne:this.elevation,ii=(Te=Nn.maxElevation)!==null&&Te!==void 0?Te:this.elevation;en=new Qu([en.min[0],en.min[1],pi],[en.max[0],en.max[1],ii])}Ze.push({aabb:en,zoom:nn,x:_a,y:za,wrap:gt.wrap,fullyVisible:rr})}}return at.sort((gt,Et)=>gt.distanceSq-Et.distanceSq).map(gt=>gt.tileID)}resize(I,ne){this.width=I,this.height=ne,this.pixelsToGLUnits=[2/I,-2/ne],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(I){return Math.pow(2,I)}scaleZoom(I){return Math.log(I)/Math.LN2}project(I){const ne=t.ac(I.lat,-85.051129,au);return new t.P(t.O(I.lng)*this.worldSize,t.Q(ne)*this.worldSize)}unproject(I){return new t.Z(I.x/this.worldSize,I.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(I){const ne=this.elevation,Te=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,Se=this.pointLocation(this.centerPoint,I),Ie=I.getElevationForLngLatZoom(Se,this.tileZoom);if(!(this.elevation-Ie))return;const ot=Te+ne-Ie,yt=Math.cos(this._pitch)*this.cameraToCenterDistance/ot/t.b5(1,Se.lat),Ct=this.scaleZoom(yt/this.tileSize);this._elevation=Ie,this._center=Se,this.zoom=Ct}setLocationAtPoint(I,ne){const Te=this.pointCoordinate(ne),Se=this.pointCoordinate(this.centerPoint),Ie=this.locationCoordinate(I),ot=new t.Z(Ie.x-(Te.x-Se.x),Ie.y-(Te.y-Se.y));this.center=this.coordinateLocation(ot),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(I,ne){return ne?this.coordinatePoint(this.locationCoordinate(I),ne.getElevationForLngLatZoom(I,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(I))}pointLocation(I,ne){return this.coordinateLocation(this.pointCoordinate(I,ne))}locationCoordinate(I){return t.Z.fromLngLat(I)}coordinateLocation(I){return I&&I.toLngLat()}pointCoordinate(I,ne){if(ne){const Fr=ne.pointCoordinate(I);if(Fr!=null)return Fr}const Te=[I.x,I.y,0,1],Se=[I.x,I.y,1,1];t.af(Te,Te,this.pixelMatrixInverse),t.af(Se,Se,this.pixelMatrixInverse);const Ie=Te[3],ot=Se[3],yt=Te[1]/Ie,Ct=Se[1]/ot,Wt=Te[2]/Ie,nr=Se[2]/ot,or=Wt===nr?0:(0-Wt)/(nr-Wt);return new t.Z(t.y.number(Te[0]/Ie,Se[0]/ot,or)/this.worldSize,t.y.number(yt,Ct,or)/this.worldSize)}coordinatePoint(I,ne=0,Te=this.pixelMatrix){const Se=[I.x*this.worldSize,I.y*this.worldSize,ne,1];return t.af(Se,Se,Te),new t.P(Se[0]/Se[3],Se[1]/Se[3])}getBounds(){const I=Math.max(0,this.height/2-this.getHorizon());return new ie().extend(this.pointLocation(new t.P(0,I))).extend(this.pointLocation(new t.P(this.width,I))).extend(this.pointLocation(new t.P(this.width,this.height))).extend(this.pointLocation(new t.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new ie([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(I){I?(this.lngRange=[I.getWest(),I.getEast()],this.latRange=[I.getSouth(),I.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,au])}calculateTileMatrix(I){const ne=I.canonical,Te=this.worldSize/this.zoomScale(ne.z),Se=ne.x+Math.pow(2,ne.z)*I.wrap,Ie=t.an(new Float64Array(16));return t.J(Ie,Ie,[Se*Te,ne.y*Te,0]),t.K(Ie,Ie,[Te/t.X,Te/t.X,1]),Ie}calculatePosMatrix(I,ne=!1){const Te=I.key,Se=ne?this._alignedPosMatrixCache:this._posMatrixCache;if(Se[Te])return Se[Te];const Ie=this.calculateTileMatrix(I);return t.L(Ie,ne?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Ie),Se[Te]=new Float32Array(Ie),Se[Te]}calculateFogMatrix(I){const ne=I.key,Te=this._fogMatrixCache;if(Te[ne])return Te[ne];const Se=this.calculateTileMatrix(I);return t.L(Se,this.fogMatrix,Se),Te[ne]=new Float32Array(Se),Te[ne]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(I,ne){ne=t.ac(+ne,this.minZoom,this.maxZoom);const Te={center:new t.N(I.lng,I.lat),zoom:ne};let Se=this.lngRange;if(!this._renderWorldCopies&&Se===null){const gt=179.9999999999;Se=[-gt,gt]}const Ie=this.tileSize*this.zoomScale(Te.zoom);let ot=0,yt=Ie,Ct=0,Wt=Ie,nr=0,or=0;const{x:Fr,y:Wr}=this.size;if(this.latRange){const gt=this.latRange;ot=t.Q(gt[1])*Ie,yt=t.Q(gt[0])*Ie,yt-otyt&&(lt=yt-gt)}if(Se){const gt=(Ct+Wt)/2;let Et=je;this._renderWorldCopies&&(Et=t.b3(je,gt-Ie/2,gt+Ie/2));const Yt=Fr/2;Et-YtWt&&(at=Wt-Yt)}if(at!==void 0||lt!==void 0){const gt=new t.P(at??je,lt??Ze);Te.center=this.unproject.call({worldSize:Ie},gt).wrap()}return Te}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const I=this._unmodified,{center:ne,zoom:Te}=this.getConstrained(this.center,this.zoom);this.center=ne,this.zoom=Te,this._unmodified=I,this._constraining=!1}_calcMatrices(){if(!this.height)return;const I=this.centerOffset,ne=this.point.x,Te=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b5(1,this.center.lat)*this.worldSize;let Se=t.an(new Float64Array(16));t.K(Se,Se,[this.width/2,-this.height/2,1]),t.J(Se,Se,[1,-1,0]),this.labelPlaneMatrix=Se,Se=t.an(new Float64Array(16)),t.K(Se,Se,[1,-1,1]),t.J(Se,Se,[-1,-1,0]),t.K(Se,Se,[2/this.width,2/this.height,1]),this.glCoordMatrix=Se;const Ie=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),ot=Math.min(this.elevation,this.minElevationForCurrentTile),yt=Ie-ot*this._pixelPerMeter/Math.cos(this._pitch),Ct=ot<0?yt:Ie,Wt=Math.PI/2+this._pitch,nr=this._fov*(.5+I.y/this.height),or=Math.sin(nr)*Ct/Math.sin(t.ac(Math.PI-Wt-nr,.01,Math.PI-.01)),Fr=this.getHorizon(),Wr=2*Math.atan(Fr/this.cameraToCenterDistance)*(.5+I.y/(2*Fr)),je=Math.sin(Wr)*Ct/Math.sin(t.ac(Math.PI-Wt-Wr,.01,Math.PI-.01)),Ze=Math.min(or,je);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Ze+Ct),this.nearZ=this.height/50,Se=new Float64Array(16),t.b6(Se,this._fov,this.width/this.height,this.nearZ,this.farZ),Se[8]=2*-I.x/this.width,Se[9]=2*I.y/this.height,this.projectionMatrix=t.ae(Se),t.K(Se,Se,[1,-1,1]),t.J(Se,Se,[0,0,-this.cameraToCenterDistance]),t.b7(Se,Se,this._pitch),t.ad(Se,Se,this.angle),t.J(Se,Se,[-ne,-Te,0]),this.mercatorMatrix=t.K([],Se,[this.worldSize,this.worldSize,this.worldSize]),t.K(Se,Se,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.L(new Float64Array(16),this.labelPlaneMatrix,Se),t.J(Se,Se,[0,0,-this.elevation]),this.modelViewProjectionMatrix=Se,this.invModelViewProjectionMatrix=t.as([],Se),this.fogMatrix=new Float64Array(16),t.b6(this.fogMatrix,this._fov,this.width/this.height,Ie,this.farZ),this.fogMatrix[8]=2*-I.x/this.width,this.fogMatrix[9]=2*I.y/this.height,t.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),t.b7(this.fogMatrix,this.fogMatrix,this._pitch),t.ad(this.fogMatrix,this.fogMatrix,this.angle),t.J(this.fogMatrix,this.fogMatrix,[-ne,-Te,0]),t.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=t.L(new Float64Array(16),this.labelPlaneMatrix,Se);const at=this.width%2/2,lt=this.height%2/2,Tt=Math.cos(this.angle),gt=Math.sin(this.angle),Et=ne-Math.round(ne)+Tt*at+gt*lt,Yt=Te-Math.round(Te)+Tt*lt+gt*at,rr=new Float64Array(Se);if(t.J(rr,rr,[Et>.5?Et-1:Et,Yt>.5?Yt-1:Yt,0]),this.alignedModelViewProjectionMatrix=rr,Se=t.as(new Float64Array(16),this.pixelMatrix),!Se)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Se,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const I=this.pointCoordinate(new t.P(0,0)),ne=[I.x*this.worldSize,I.y*this.worldSize,0,1];return t.af(ne,ne,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const I=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,I))}getCameraQueryGeometry(I){const ne=this.getCameraPoint();if(I.length===1)return[I[0],ne];{let Te=ne.x,Se=ne.y,Ie=ne.x,ot=ne.y;for(const yt of I)Te=Math.min(Te,yt.x),Se=Math.min(Se,yt.y),Ie=Math.max(Ie,yt.x),ot=Math.max(ot,yt.y);return[new t.P(Te,Se),new t.P(Ie,Se),new t.P(Ie,ot),new t.P(Te,ot),new t.P(Te,Se)]}}lngLatToCameraDepth(I,ne){const Te=this.locationCoordinate(I),Se=[Te.x*this.worldSize,Te.y*this.worldSize,ne,1];return t.af(Se,Se,this.modelViewProjectionMatrix),Se[2]/Se[3]}}function yc(De,I){let ne,Te=!1,Se=null,Ie=null;const ot=()=>{Se=null,Te&&(De.apply(Ie,ne),Se=setTimeout(ot,I),Te=!1)};return(...yt)=>(Te=!0,Ie=this,ne=yt,Se||ot(),Se)}class Pu{constructor(I){this._getCurrentHash=()=>{const ne=window.location.hash.replace("#","");if(this._hashName){let Te;return ne.split("&").map(Se=>Se.split("=")).forEach(Se=>{Se[0]===this._hashName&&(Te=Se)}),(Te&&Te[1]||"").split("/")}return ne.split("/")},this._onHashChange=()=>{const ne=this._getCurrentHash();if(ne.length>=3&&!ne.some(Te=>isNaN(Te))){const Te=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(ne[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+ne[2],+ne[1]],zoom:+ne[0],bearing:Te,pitch:+(ne[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const ne=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,ne)},this._removeHash=()=>{const ne=this._getCurrentHash();if(ne.length===0)return;const Te=ne.join("/");let Se=Te;Se.split("&").length>0&&(Se=Se.split("&")[0]),this._hashName&&(Se=`${this._hashName}=${Te}`);let Ie=window.location.hash.replace(Se,"");Ie.startsWith("#&")?Ie=Ie.slice(0,1)+Ie.slice(2):Ie==="#"&&(Ie="");let ot=window.location.href.replace(/(#.+)?$/,Ie);ot=ot.replace("&&","&"),window.history.replaceState(window.history.state,null,ot)},this._updateHash=yc(this._updateHashUnthrottled,300),this._hashName=I&&encodeURIComponent(I)}addTo(I){return this._map=I,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(I){const ne=this._map.getCenter(),Te=Math.round(100*this._map.getZoom())/100,Se=Math.ceil((Te*Math.LN2+Math.log(512/360/.5))/Math.LN10),Ie=Math.pow(10,Se),ot=Math.round(ne.lng*Ie)/Ie,yt=Math.round(ne.lat*Ie)/Ie,Ct=this._map.getBearing(),Wt=this._map.getPitch();let nr="";if(nr+=I?`/${ot}/${yt}/${Te}`:`${Te}/${yt}/${ot}`,(Ct||Wt)&&(nr+="/"+Math.round(10*Ct)/10),Wt&&(nr+=`/${Math.round(Wt)}`),this._hashName){const or=this._hashName;let Fr=!1;const Wr=window.location.hash.slice(1).split("&").map(je=>{const Ze=je.split("=")[0];return Ze===or?(Fr=!0,`${Ze}=${nr}`):je}).filter(je=>je);return Fr||Wr.push(`${or}=${nr}`),`#${Wr.join("&")}`}return`#${nr}`}}const ec={linearity:.3,easing:t.b8(0,0,.3,1)},Ec=t.e({deceleration:2500,maxSpeed:1400},ec),Cf=t.e({deceleration:20,maxSpeed:1400},ec),nh=t.e({deceleration:1e3,maxSpeed:360},ec),lc=t.e({deceleration:1e3,maxSpeed:90},ec);class kc{constructor(I){this._map=I,this.clear()}clear(){this._inertiaBuffer=[]}record(I){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:i.now(),settings:I})}_drainInertiaBuffer(){const I=this._inertiaBuffer,ne=i.now();for(;I.length>0&&ne-I[0].time>160;)I.shift()}_onMoveEnd(I){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const ne={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:Ie}of this._inertiaBuffer)ne.zoom+=Ie.zoomDelta||0,ne.bearing+=Ie.bearingDelta||0,ne.pitch+=Ie.pitchDelta||0,Ie.panDelta&&ne.pan._add(Ie.panDelta),Ie.around&&(ne.around=Ie.around),Ie.pinchAround&&(ne.pinchAround=Ie.pinchAround);const Te=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,Se={};if(ne.pan.mag()){const Ie=tf(ne.pan.mag(),Te,t.e({},Ec,I||{}));Se.offset=ne.pan.mult(Ie.amount/ne.pan.mag()),Se.center=this._map.transform.center,nu(Se,Ie)}if(ne.zoom){const Ie=tf(ne.zoom,Te,Cf);Se.zoom=this._map.transform.zoom+Ie.amount,nu(Se,Ie)}if(ne.bearing){const Ie=tf(ne.bearing,Te,nh);Se.bearing=this._map.transform.bearing+t.ac(Ie.amount,-179,179),nu(Se,Ie)}if(ne.pitch){const Ie=tf(ne.pitch,Te,lc);Se.pitch=this._map.transform.pitch+Ie.amount,nu(Se,Ie)}if(Se.zoom||Se.bearing){const Ie=ne.pinchAround===void 0?ne.around:ne.pinchAround;Se.around=Ie?this._map.unproject(Ie):this._map.getCenter()}return this.clear(),t.e(Se,{noMoveStart:!0})}}function nu(De,I){(!De.duration||De.durationne.unproject(Ct)),yt=Ie.reduce((Ct,Wt,nr,or)=>Ct.add(Wt.div(or.length)),new t.P(0,0));super(I,{points:Ie,point:yt,lngLats:ot,lngLat:ne.unproject(yt),originalEvent:Te}),this._defaultPrevented=!1}}class rf extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(I,ne,Te){super(I,{originalEvent:Te}),this._defaultPrevented=!1}}class mc{constructor(I,ne){this._map=I,this._clickTolerance=ne.clickTolerance}reset(){delete this._mousedownPos}wheel(I){return this._firePreventable(new rf(I.type,this._map,I))}mousedown(I,ne){return this._mousedownPos=ne,this._firePreventable(new Cl(I.type,this._map,I))}mouseup(I){this._map.fire(new Cl(I.type,this._map,I))}click(I,ne){this._mousedownPos&&this._mousedownPos.dist(ne)>=this._clickTolerance||this._map.fire(new Cl(I.type,this._map,I))}dblclick(I){return this._firePreventable(new Cl(I.type,this._map,I))}mouseover(I){this._map.fire(new Cl(I.type,this._map,I))}mouseout(I){this._map.fire(new Cl(I.type,this._map,I))}touchstart(I){return this._firePreventable(new uc(I.type,this._map,I))}touchmove(I){this._map.fire(new uc(I.type,this._map,I))}touchend(I){this._map.fire(new uc(I.type,this._map,I))}touchcancel(I){this._map.fire(new uc(I.type,this._map,I))}_firePreventable(I){if(this._map.fire(I),I.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Us{constructor(I){this._map=I}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(I){this._map.fire(new Cl(I.type,this._map,I))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Cl("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(I){this._delayContextMenu?this._contextMenuEvent=I:this._ignoreContextMenu||this._map.fire(new Cl(I.type,this._map,I)),this._map.listens("contextmenu")&&I.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class vu{constructor(I){this._map=I}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(I){return this.transform.pointLocation(t.P.convert(I),this._map.terrain)}}class du{constructor(I,ne){this._map=I,this._tr=new vu(I),this._el=I.getCanvasContainer(),this._container=I.getContainer(),this._clickTolerance=ne.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(I,ne){this.isEnabled()&&I.shiftKey&&I.button===0&&(n.disableDrag(),this._startPos=this._lastPos=ne,this._active=!0)}mousemoveWindow(I,ne){if(!this._active)return;const Te=ne;if(this._lastPos.equals(Te)||!this._box&&Te.dist(this._startPos)Ie.fitScreenCoordinates(Te,Se,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",I)}keydown(I){this._active&&I.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",I))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(n.remove(this._box),this._box=null),n.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(I,ne){return this._map.fire(new t.k(I,{originalEvent:ne}))}}function af(De,I){if(De.length!==I.length)throw new Error(`The number of touches and points are not equal - touches ${De.length}, points ${I.length}`);const ne={};for(let Te=0;Tethis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=I.timeStamp),Te.length===this.numTouches&&(this.centroid=function(Se){const Ie=new t.P(0,0);for(const ot of Se)Ie._add(ot);return Ie.div(Se.length)}(ne),this.touches=af(Te,ne)))}touchmove(I,ne,Te){if(this.aborted||!this.centroid)return;const Se=af(Te,ne);for(const Ie in this.touches){const ot=Se[Ie];(!ot||ot.dist(this.touches[Ie])>30)&&(this.aborted=!0)}}touchend(I,ne,Te){if((!this.centroid||I.timeStamp-this.startTime>500)&&(this.aborted=!0),Te.length===0){const Se=!this.aborted&&this.centroid;if(this.reset(),Se)return Se}}}class _c{constructor(I){this.singleTap=new Rs(I),this.numTaps=I.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(I,ne,Te){this.singleTap.touchstart(I,ne,Te)}touchmove(I,ne,Te){this.singleTap.touchmove(I,ne,Te)}touchend(I,ne,Te){const Se=this.singleTap.touchend(I,ne,Te);if(Se){const Ie=I.timeStamp-this.lastTime<500,ot=!this.lastTap||this.lastTap.dist(Se)<30;if(Ie&&ot||this.reset(),this.count++,this.lastTime=I.timeStamp,this.lastTap=Se,this.count===this.numTaps)return this.reset(),Se}}}class ju{constructor(I){this._tr=new vu(I),this._zoomIn=new _c({numTouches:1,numTaps:2}),this._zoomOut=new _c({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(I,ne,Te){this._zoomIn.touchstart(I,ne,Te),this._zoomOut.touchstart(I,ne,Te)}touchmove(I,ne,Te){this._zoomIn.touchmove(I,ne,Te),this._zoomOut.touchmove(I,ne,Te)}touchend(I,ne,Te){const Se=this._zoomIn.touchend(I,ne,Te),Ie=this._zoomOut.touchend(I,ne,Te),ot=this._tr;return Se?(this._active=!0,I.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:yt=>yt.easeTo({duration:300,zoom:ot.zoom+1,around:ot.unproject(Se)},{originalEvent:I})}):Ie?(this._active=!0,I.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:yt=>yt.easeTo({duration:300,zoom:ot.zoom-1,around:ot.unproject(Ie)},{originalEvent:I})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class iu{constructor(I){this._enabled=!!I.enable,this._moveStateManager=I.moveStateManager,this._clickTolerance=I.clickTolerance||1,this._moveFunction=I.move,this._activateOnStart=!!I.activateOnStart,I.assignEvents(this),this.reset()}reset(I){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(I)}_move(...I){const ne=this._moveFunction(...I);if(ne.bearingDelta||ne.pitchDelta||ne.around||ne.panDelta)return this._active=!0,ne}dragStart(I,ne){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(I)&&(this._moveStateManager.startMove(I),this._lastPoint=ne.length?ne[0]:ne,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(I,ne){if(!this.isEnabled())return;const Te=this._lastPoint;if(!Te)return;if(I.preventDefault(),!this._moveStateManager.isValidMoveEvent(I))return void this.reset(I);const Se=ne.length?ne[0]:ne;return!this._moved&&Se.dist(Te){De.mousedown=De.dragStart,De.mousemoveWindow=De.dragMove,De.mouseup=De.dragEnd,De.contextmenu=I=>{I.preventDefault()}},xl=({enable:De,clickTolerance:I,bearingDegreesPerPixelMoved:ne=.8})=>{const Te=new Iu({checkCorrectEvent:Se=>n.mouseButton(Se)===0&&Se.ctrlKey||n.mouseButton(Se)===2});return new iu({clickTolerance:I,move:(Se,Ie)=>({bearingDelta:(Ie.x-Se.x)*ne}),moveStateManager:Te,enable:De,assignEvents:Lf})},nf=({enable:De,clickTolerance:I,pitchDegreesPerPixelMoved:ne=-.5})=>{const Te=new Iu({checkCorrectEvent:Se=>n.mouseButton(Se)===0&&Se.ctrlKey||n.mouseButton(Se)===2});return new iu({clickTolerance:I,move:(Se,Ie)=>({pitchDelta:(Ie.y-Se.y)*ne}),moveStateManager:Te,enable:De,assignEvents:Lf})};class ou{constructor(I,ne){this._clickTolerance=I.clickTolerance||1,this._map=ne,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(I){return I<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(I,ne,Te){return this._calculateTransform(I,ne,Te)}touchmove(I,ne,Te){if(this._active){if(!this._shouldBePrevented(Te.length))return I.preventDefault(),this._calculateTransform(I,ne,Te);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",I)}}touchend(I,ne,Te){this._calculateTransform(I,ne,Te),this._active&&this._shouldBePrevented(Te.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(I,ne,Te){Te.length>0&&(this._active=!0);const Se=af(Te,ne),Ie=new t.P(0,0),ot=new t.P(0,0);let yt=0;for(const Wt in Se){const nr=Se[Wt],or=this._touches[Wt];or&&(Ie._add(nr),ot._add(nr.sub(or)),yt++,Se[Wt]=nr)}if(this._touches=Se,this._shouldBePrevented(yt)||!ot.mag())return;const Ct=ot.div(yt);return this._sum._add(Ct),this._sum.mag()Math.abs(De.x)}class Cc extends Ru{constructor(I){super(),this._currentTouchCount=0,this._map=I}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(I,ne,Te){super.touchstart(I,ne,Te),this._currentTouchCount=Te.length}_start(I){this._lastPoints=I,Su(I[0].sub(I[1]))&&(this._valid=!1)}_move(I,ne,Te){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const Se=I[0].sub(this._lastPoints[0]),Ie=I[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(Se,Ie,Te.timeStamp),this._valid?(this._lastPoints=I,this._active=!0,{pitchDelta:(Se.y+Ie.y)/2*-.5}):void 0}gestureBeginsVertically(I,ne,Te){if(this._valid!==void 0)return this._valid;const Se=I.mag()>=2,Ie=ne.mag()>=2;if(!Se&&!Ie)return;if(!Se||!Ie)return this._firstMove===void 0&&(this._firstMove=Te),Te-this._firstMove<100&&void 0;const ot=I.y>0==ne.y>0;return Su(I)&&Su(ne)&&ot}}const Ht={panStep:100,bearingStep:15,pitchStep:10};class ur{constructor(I){this._tr=new vu(I);const ne=Ht;this._panStep=ne.panStep,this._bearingStep=ne.bearingStep,this._pitchStep=ne.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(I){if(I.altKey||I.ctrlKey||I.metaKey)return;let ne=0,Te=0,Se=0,Ie=0,ot=0;switch(I.keyCode){case 61:case 107:case 171:case 187:ne=1;break;case 189:case 109:case 173:ne=-1;break;case 37:I.shiftKey?Te=-1:(I.preventDefault(),Ie=-1);break;case 39:I.shiftKey?Te=1:(I.preventDefault(),Ie=1);break;case 38:I.shiftKey?Se=1:(I.preventDefault(),ot=-1);break;case 40:I.shiftKey?Se=-1:(I.preventDefault(),ot=1);break;default:return}return this._rotationDisabled&&(Te=0,Se=0),{cameraAnimation:yt=>{const Ct=this._tr;yt.easeTo({duration:300,easeId:"keyboardHandler",easing:qr,zoom:ne?Math.round(Ct.zoom)+ne*(I.shiftKey?2:1):Ct.zoom,bearing:Ct.bearing+Te*this._bearingStep,pitch:Ct.pitch+Se*this._pitchStep,offset:[-Ie*this._panStep,-ot*this._panStep],center:Ct.center},{originalEvent:I})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function qr(De){return De*(2-De)}const Or=4.000244140625;class ua{constructor(I,ne){this._onTimeout=Te=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Te)},this._map=I,this._tr=new vu(I),this._triggerRenderFrame=ne,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(I){this._defaultZoomRate=I}setWheelZoomRate(I){this._wheelZoomRate=I}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(I){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!I&&I.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(I){return!!this._map.cooperativeGestures.isEnabled()&&!(I.ctrlKey||this._map.cooperativeGestures.isBypassed(I))}wheel(I){if(!this.isEnabled())return;if(this._shouldBePrevented(I))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",I);let ne=I.deltaMode===WheelEvent.DOM_DELTA_LINE?40*I.deltaY:I.deltaY;const Te=i.now(),Se=Te-(this._lastWheelEventTime||0);this._lastWheelEventTime=Te,ne!==0&&ne%Or==0?this._type="wheel":ne!==0&&Math.abs(ne)<4?this._type="trackpad":Se>400?(this._type=null,this._lastValue=ne,this._timeout=setTimeout(this._onTimeout,40,I)):this._type||(this._type=Math.abs(Se*ne)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,ne+=this._lastValue)),I.shiftKey&&ne&&(ne/=4),this._type&&(this._lastWheelEvent=I,this._delta-=ne,this._active||this._start(I)),I.preventDefault()}_start(I){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const ne=n.mousePos(this._map.getCanvas(),I),Te=this._tr;this._around=ne.y>Te.transform.height/2-Te.transform.getHorizon()?t.N.convert(this._aroundCenter?Te.center:Te.unproject(ne)):t.N.convert(Te.center),this._aroundPoint=Te.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const I=this._tr.transform;if(this._delta!==0){const Ct=this._type==="wheel"&&Math.abs(this._delta)>Or?this._wheelZoomRate:this._defaultZoomRate;let Wt=2/(1+Math.exp(-Math.abs(this._delta*Ct)));this._delta<0&&Wt!==0&&(Wt=1/Wt);const nr=typeof this._targetZoom=="number"?I.zoomScale(this._targetZoom):I.scale;this._targetZoom=Math.min(I.maxZoom,Math.max(I.minZoom,I.scaleZoom(nr*Wt))),this._type==="wheel"&&(this._startZoom=I.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const ne=typeof this._targetZoom=="number"?this._targetZoom:I.zoom,Te=this._startZoom,Se=this._easing;let Ie,ot=!1;const yt=i.now()-this._lastWheelEventTime;if(this._type==="wheel"&&Te&&Se&&yt){const Ct=Math.min(yt/200,1),Wt=Se(Ct);Ie=t.y.number(Te,ne,Wt),Ct<1?this._frameId||(this._frameId=!0):ot=!0}else Ie=ne,ot=!0;return this._active=!0,ot&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ot,zoomDelta:Ie-I.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(I){let ne=t.b9;if(this._prevEase){const Te=this._prevEase,Se=(i.now()-Te.start)/Te.duration,Ie=Te.easing(Se+.01)-Te.easing(Se),ot=.27/Math.sqrt(Ie*Ie+1e-4)*.01,yt=Math.sqrt(.0729-ot*ot);ne=t.b8(ot,yt,.25,1)}return this._prevEase={start:i.now(),duration:I,easing:ne},ne}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Fa{constructor(I,ne){this._clickZoom=I,this._tapZoom=ne}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class ja{constructor(I){this._tr=new vu(I),this.reset()}reset(){this._active=!1}dblclick(I,ne){return I.preventDefault(),{cameraAnimation:Te=>{Te.easeTo({duration:300,zoom:this._tr.zoom+(I.shiftKey?-1:1),around:this._tr.unproject(ne)},{originalEvent:I})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class sn{constructor(){this._tap=new _c({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(I,ne,Te){if(!this._swipePoint)if(this._tapTime){const Se=ne[0],Ie=I.timeStamp-this._tapTime<500,ot=this._tapPoint.dist(Se)<30;Ie&&ot?Te.length>0&&(this._swipePoint=Se,this._swipeTouch=Te[0].identifier):this.reset()}else this._tap.touchstart(I,ne,Te)}touchmove(I,ne,Te){if(this._tapTime){if(this._swipePoint){if(Te[0].identifier!==this._swipeTouch)return;const Se=ne[0],Ie=Se.y-this._swipePoint.y;return this._swipePoint=Se,I.preventDefault(),this._active=!0,{zoomDelta:Ie/128}}}else this._tap.touchmove(I,ne,Te)}touchend(I,ne,Te){if(this._tapTime)this._swipePoint&&Te.length===0&&this.reset();else{const Se=this._tap.touchend(I,ne,Te);Se&&(this._tapTime=I.timeStamp,this._tapPoint=Se)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gn{constructor(I,ne,Te){this._el=I,this._mousePan=ne,this._touchPan=Te}enable(I){this._inertiaOptions=I||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class kn{constructor(I,ne,Te){this._pitchWithRotate=I.pitchWithRotate,this._mouseRotate=ne,this._mousePitch=Te}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Ja{constructor(I,ne,Te,Se){this._el=I,this._touchZoom=ne,this._touchRotate=Te,this._tapDragZoom=Se,this._rotationDisabled=!1,this._enabled=!0}enable(I){this._touchZoom.enable(I),this._rotationDisabled||this._touchRotate.enable(I),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class _n{constructor(I,ne){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=I,this._options=ne,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const I=this._map.getCanvasContainer();I.classList.add("maplibregl-cooperative-gestures"),this._container=n.create("div","maplibregl-cooperative-gesture-screen",I);let ne=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(ne=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const Te=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),Se=document.createElement("div");Se.className="maplibregl-desktop-message",Se.textContent=ne,this._container.appendChild(Se);const Ie=document.createElement("div");Ie.className="maplibregl-mobile-message",Ie.textContent=Te,this._container.appendChild(Ie),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(n.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(I){return I[this._bypassKey]}notifyGestureBlocked(I,ne){this._enabled&&(this._map.fire(new t.k("cooperativegestureprevented",{gestureType:I,originalEvent:ne})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const on=De=>De.zoom||De.drag||De.pitch||De.rotate;class Wa extends t.k{}function On(De){return De.panDelta&&De.panDelta.mag()||De.zoomDelta||De.bearingDelta||De.pitchDelta}class zi{constructor(I,ne){this.handleWindowEvent=Se=>{this.handleEvent(Se,`${Se.type}Window`)},this.handleEvent=(Se,Ie)=>{if(Se.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const ot=Se.type==="renderFrame"?void 0:Se,yt={needsRenderFrame:!1},Ct={},Wt={},nr=Se.touches,or=nr?this._getMapTouches(nr):void 0,Fr=or?n.touchPos(this._map.getCanvas(),or):n.mousePos(this._map.getCanvas(),Se);for(const{handlerName:Ze,handler:at,allowed:lt}of this._handlers){if(!at.isEnabled())continue;let Tt;this._blockedByActive(Wt,lt,Ze)?at.reset():at[Ie||Se.type]&&(Tt=at[Ie||Se.type](Se,Fr,or),this.mergeHandlerResult(yt,Ct,Tt,Ze,ot),Tt&&Tt.needsRenderFrame&&this._triggerRenderFrame()),(Tt||at.isActive())&&(Wt[Ze]=at)}const Wr={};for(const Ze in this._previousActiveHandlers)Wt[Ze]||(Wr[Ze]=ot);this._previousActiveHandlers=Wt,(Object.keys(Wr).length||On(yt))&&(this._changes.push([yt,Ct,Wr]),this._triggerRenderFrame()),(Object.keys(Wt).length||On(yt))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:je}=yt;je&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],je(this._map))},this._map=I,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new kc(I),this._bearingSnap=ne.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(ne);const Te=this._el;this._listeners=[[Te,"touchstart",{passive:!0}],[Te,"touchmove",{passive:!1}],[Te,"touchend",void 0],[Te,"touchcancel",void 0],[Te,"mousedown",void 0],[Te,"mousemove",void 0],[Te,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[Te,"mouseover",void 0],[Te,"mouseout",void 0],[Te,"dblclick",void 0],[Te,"click",void 0],[Te,"keydown",{capture:!1}],[Te,"keyup",void 0],[Te,"wheel",{passive:!1}],[Te,"contextmenu",void 0],[window,"blur",void 0]];for(const[Se,Ie,ot]of this._listeners)n.addEventListener(Se,Ie,Se===document?this.handleWindowEvent:this.handleEvent,ot)}destroy(){for(const[I,ne,Te]of this._listeners)n.removeEventListener(I,ne,I===document?this.handleWindowEvent:this.handleEvent,Te)}_addDefaultHandlers(I){const ne=this._map,Te=ne.getCanvasContainer();this._add("mapEvent",new mc(ne,I));const Se=ne.boxZoom=new du(ne,I);this._add("boxZoom",Se),I.interactive&&I.boxZoom&&Se.enable();const Ie=ne.cooperativeGestures=new _n(ne,I.cooperativeGestures);this._add("cooperativeGestures",Ie),I.cooperativeGestures&&Ie.enable();const ot=new ju(ne),yt=new ja(ne);ne.doubleClickZoom=new Fa(yt,ot),this._add("tapZoom",ot),this._add("clickZoom",yt),I.interactive&&I.doubleClickZoom&&ne.doubleClickZoom.enable();const Ct=new sn;this._add("tapDragZoom",Ct);const Wt=ne.touchPitch=new Cc(ne);this._add("touchPitch",Wt),I.interactive&&I.touchPitch&&ne.touchPitch.enable(I.touchPitch);const nr=xl(I),or=nf(I);ne.dragRotate=new kn(I,nr,or),this._add("mouseRotate",nr,["mousePitch"]),this._add("mousePitch",or,["mouseRotate"]),I.interactive&&I.dragRotate&&ne.dragRotate.enable();const Fr=(({enable:Tt,clickTolerance:gt})=>{const Et=new Iu({checkCorrectEvent:Yt=>n.mouseButton(Yt)===0&&!Yt.ctrlKey});return new iu({clickTolerance:gt,move:(Yt,rr)=>({around:rr,panDelta:rr.sub(Yt)}),activateOnStart:!0,moveStateManager:Et,enable:Tt,assignEvents:Lf})})(I),Wr=new ou(I,ne);ne.dragPan=new gn(Te,Fr,Wr),this._add("mousePan",Fr),this._add("touchPan",Wr,["touchZoom","touchRotate"]),I.interactive&&I.dragPan&&ne.dragPan.enable(I.dragPan);const je=new tc,Ze=new Ol;ne.touchZoomRotate=new Ja(Te,Ze,je,Ct),this._add("touchRotate",je,["touchPan","touchZoom"]),this._add("touchZoom",Ze,["touchPan","touchRotate"]),I.interactive&&I.touchZoomRotate&&ne.touchZoomRotate.enable(I.touchZoomRotate);const at=ne.scrollZoom=new ua(ne,()=>this._triggerRenderFrame());this._add("scrollZoom",at,["mousePan"]),I.interactive&&I.scrollZoom&&ne.scrollZoom.enable(I.scrollZoom);const lt=ne.keyboard=new ur(ne);this._add("keyboard",lt),I.interactive&&I.keyboard&&ne.keyboard.enable(),this._add("blockableMapEvent",new Us(ne))}_add(I,ne,Te){this._handlers.push({handlerName:I,handler:ne,allowed:Te}),this._handlersById[I]=ne}stop(I){if(!this._updatingCamera){for(const{handler:ne}of this._handlers)ne.reset();this._inertia.clear(),this._fireEvents({},{},I),this._changes=[]}}isActive(){for(const{handler:I}of this._handlers)if(I.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!on(this._eventsInProgress)||this.isZooming()}_blockedByActive(I,ne,Te){for(const Se in I)if(Se!==Te&&(!ne||ne.indexOf(Se)<0))return!0;return!1}_getMapTouches(I){const ne=[];for(const Te of I)this._el.contains(Te.target)&&ne.push(Te);return ne}mergeHandlerResult(I,ne,Te,Se,Ie){if(!Te)return;t.e(I,Te);const ot={handlerName:Se,originalEvent:Te.originalEvent||Ie};Te.zoomDelta!==void 0&&(ne.zoom=ot),Te.panDelta!==void 0&&(ne.drag=ot),Te.pitchDelta!==void 0&&(ne.pitch=ot),Te.bearingDelta!==void 0&&(ne.rotate=ot)}_applyChanges(){const I={},ne={},Te={};for(const[Se,Ie,ot]of this._changes)Se.panDelta&&(I.panDelta=(I.panDelta||new t.P(0,0))._add(Se.panDelta)),Se.zoomDelta&&(I.zoomDelta=(I.zoomDelta||0)+Se.zoomDelta),Se.bearingDelta&&(I.bearingDelta=(I.bearingDelta||0)+Se.bearingDelta),Se.pitchDelta&&(I.pitchDelta=(I.pitchDelta||0)+Se.pitchDelta),Se.around!==void 0&&(I.around=Se.around),Se.pinchAround!==void 0&&(I.pinchAround=Se.pinchAround),Se.noInertia&&(I.noInertia=Se.noInertia),t.e(ne,Ie),t.e(Te,ot);this._updateMapTransform(I,ne,Te),this._changes=[]}_updateMapTransform(I,ne,Te){const Se=this._map,Ie=Se._getTransformForUpdate(),ot=Se.terrain;if(!(On(I)||ot&&this._terrainMovement))return this._fireEvents(ne,Te,!0);let{panDelta:yt,zoomDelta:Ct,bearingDelta:Wt,pitchDelta:nr,around:or,pinchAround:Fr}=I;Fr!==void 0&&(or=Fr),Se._stop(!0),or=or||Se.transform.centerPoint;const Wr=Ie.pointLocation(yt?or.sub(yt):or);Wt&&(Ie.bearing+=Wt),nr&&(Ie.pitch+=nr),Ct&&(Ie.zoom+=Ct),ot?this._terrainMovement||!ne.drag&&!ne.zoom?ne.drag&&this._terrainMovement?Ie.center=Ie.pointLocation(Ie.centerPoint.sub(yt)):Ie.setLocationAtPoint(Wr,or):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Ie.setLocationAtPoint(Wr,or)):Ie.setLocationAtPoint(Wr,or),Se._applyUpdatedTransform(Ie),this._map._update(),I.noInertia||this._inertia.record(I),this._fireEvents(ne,Te,!0)}_fireEvents(I,ne,Te){const Se=on(this._eventsInProgress),Ie=on(I),ot={};for(const or in I){const{originalEvent:Fr}=I[or];this._eventsInProgress[or]||(ot[`${or}start`]=Fr),this._eventsInProgress[or]=I[or]}!Se&&Ie&&this._fireEvent("movestart",Ie.originalEvent);for(const or in ot)this._fireEvent(or,ot[or]);Ie&&this._fireEvent("move",Ie.originalEvent);for(const or in I){const{originalEvent:Fr}=I[or];this._fireEvent(or,Fr)}const yt={};let Ct;for(const or in this._eventsInProgress){const{handlerName:Fr,originalEvent:Wr}=this._eventsInProgress[or];this._handlersById[Fr].isActive()||(delete this._eventsInProgress[or],Ct=ne[Fr]||Wr,yt[`${or}end`]=Ct)}for(const or in yt)this._fireEvent(or,yt[or]);const Wt=on(this._eventsInProgress),nr=(Se||Ie)&&!Wt;if(nr&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const or=this._map._getTransformForUpdate();or.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(or)}if(Te&&nr){this._updatingCamera=!0;const or=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Fr=Wr=>Wr!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Wa("renderFrame",{timeStamp:I})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class ki extends t.E{constructor(I,ne){super(),this._renderFrameCallback=()=>{const Te=Math.min((i.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Te)),Te<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=I,this._bearingSnap=ne.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new t.N(this.transform.center.lng,this.transform.center.lat)}setCenter(I,ne){return this.jumpTo({center:I},ne)}panBy(I,ne,Te){return I=t.P.convert(I).mult(-1),this.panTo(this.transform.center,t.e({offset:I},ne),Te)}panTo(I,ne,Te){return this.easeTo(t.e({center:I},ne),Te)}getZoom(){return this.transform.zoom}setZoom(I,ne){return this.jumpTo({zoom:I},ne),this}zoomTo(I,ne,Te){return this.easeTo(t.e({zoom:I},ne),Te)}zoomIn(I,ne){return this.zoomTo(this.getZoom()+1,I,ne),this}zoomOut(I,ne){return this.zoomTo(this.getZoom()-1,I,ne),this}getBearing(){return this.transform.bearing}setBearing(I,ne){return this.jumpTo({bearing:I},ne),this}getPadding(){return this.transform.padding}setPadding(I,ne){return this.jumpTo({padding:I},ne),this}rotateTo(I,ne,Te){return this.easeTo(t.e({bearing:I},ne),Te)}resetNorth(I,ne){return this.rotateTo(0,t.e({duration:1e3},I),ne),this}resetNorthPitch(I,ne){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},I),ne),this}snapToNorth(I,ne){return Math.abs(this.getBearing()){if(this._zooming&&(Se.zoom=t.y.number(Ie,at,sr)),this._rotating&&(Se.bearing=t.y.number(ot,Wt,sr)),this._pitching&&(Se.pitch=t.y.number(yt,nr,sr)),this._padding&&(Se.interpolatePadding(Ct,or,sr),Wr=Se.centerPoint.add(Fr)),this.terrain&&!I.freezeElevation&&this._updateElevation(sr),Et)Se.setLocationAtPoint(Et,Yt);else{const Sr=Se.zoomScale(Se.zoom-Ie),Nr=at>Ie?Math.min(2,gt):Math.max(.5,gt),Qr=Math.pow(Nr,1-sr),ia=Se.unproject(lt.add(Tt.mult(sr*Qr)).mult(Sr));Se.setLocationAtPoint(Se.renderWorldCopies?ia.wrap():ia,Wr)}this._applyUpdatedTransform(Se),this._fireMoveEvents(ne)},sr=>{this.terrain&&I.freezeElevation&&this._finalizeElevation(),this._afterEase(ne,sr)},I),this}_prepareEase(I,ne,Te={}){this._moving=!0,ne||Te.moving||this.fire(new t.k("movestart",I)),this._zooming&&!Te.zooming&&this.fire(new t.k("zoomstart",I)),this._rotating&&!Te.rotating&&this.fire(new t.k("rotatestart",I)),this._pitching&&!Te.pitching&&this.fire(new t.k("pitchstart",I))}_prepareElevation(I){this._elevationCenter=I,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(I,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(I){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const ne=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(I<1&&ne!==this._elevationTarget){const Te=this._elevationTarget-this._elevationStart;this._elevationStart+=I*(Te-(ne-(Te*I+this._elevationStart))/(1-I)),this._elevationTarget=ne}this.transform.elevation=t.y.number(this._elevationStart,this._elevationTarget,I)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(I){const ne=I.getCameraPosition(),Te=this.terrain.getElevationForLngLatZoom(ne.lngLat,I.zoom);if(ne.altitudethis._elevateCameraIfInsideTerrain(Se)),this.transformCameraUpdate&&ne.push(Se=>this.transformCameraUpdate(Se)),!ne.length)return;const Te=I.clone();for(const Se of ne){const Ie=Te.clone(),{center:ot,zoom:yt,pitch:Ct,bearing:Wt,elevation:nr}=Se(Ie);ot&&(Ie.center=ot),yt!==void 0&&(Ie.zoom=yt),Ct!==void 0&&(Ie.pitch=Ct),Wt!==void 0&&(Ie.bearing=Wt),nr!==void 0&&(Ie.elevation=nr),Te.apply(Ie)}this.transform.apply(Te)}_fireMoveEvents(I){this.fire(new t.k("move",I)),this._zooming&&this.fire(new t.k("zoom",I)),this._rotating&&this.fire(new t.k("rotate",I)),this._pitching&&this.fire(new t.k("pitch",I))}_afterEase(I,ne){if(this._easeId&&ne&&this._easeId===ne)return;delete this._easeId;const Te=this._zooming,Se=this._rotating,Ie=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Te&&this.fire(new t.k("zoomend",I)),Se&&this.fire(new t.k("rotateend",I)),Ie&&this.fire(new t.k("pitchend",I)),this.fire(new t.k("moveend",I))}flyTo(I,ne){var Te;if(!I.essential&&i.prefersReducedMotion){const ln=t.M(I,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ln,ne)}this.stop(),I=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},I);const Se=this._getTransformForUpdate(),Ie=Se.zoom,ot=Se.bearing,yt=Se.pitch,Ct=Se.padding,Wt="bearing"in I?this._normalizeBearing(I.bearing,ot):ot,nr="pitch"in I?+I.pitch:yt,or="padding"in I?I.padding:Se.padding,Fr=t.P.convert(I.offset);let Wr=Se.centerPoint.add(Fr);const je=Se.pointLocation(Wr),{center:Ze,zoom:at}=Se.getConstrained(t.N.convert(I.center||je),(Te=I.zoom)!==null&&Te!==void 0?Te:Ie);this._normalizeCenter(Ze,Se);const lt=Se.zoomScale(at-Ie),Tt=Se.project(je),gt=Se.project(Ze).sub(Tt);let Et=I.curve;const Yt=Math.max(Se.width,Se.height),rr=Yt/lt,sr=gt.mag();if("minZoom"in I){const ln=t.ac(Math.min(I.minZoom,Ie,at),Se.minZoom,Se.maxZoom),Nn=Yt/Se.zoomScale(ln-Ie);Et=Math.sqrt(Nn/sr*2)}const Sr=Et*Et;function Nr(ln){const Nn=(rr*rr-Yt*Yt+(ln?-1:1)*Sr*Sr*sr*sr)/(2*(ln?rr:Yt)*Sr*sr);return Math.log(Math.sqrt(Nn*Nn+1)-Nn)}function Qr(ln){return(Math.exp(ln)-Math.exp(-ln))/2}function ia(ln){return(Math.exp(ln)+Math.exp(-ln))/2}const _a=Nr(!1);let za=function(ln){return ia(_a)/ia(_a+Et*ln)},nn=function(ln){return Yt*((ia(_a)*(Qr(Nn=_a+Et*ln)/ia(Nn))-Qr(_a))/Sr)/sr;var Nn},en=(Nr(!0)-_a)/Et;if(Math.abs(sr)<1e-6||!isFinite(en)){if(Math.abs(Yt-rr)<1e-6)return this.easeTo(I,ne);const ln=rr0,za=Nn=>Math.exp(ln*Et*Nn)}return I.duration="duration"in I?+I.duration:1e3*en/("screenSpeed"in I?+I.screenSpeed/Et:+I.speed),I.maxDuration&&I.duration>I.maxDuration&&(I.duration=0),this._zooming=!0,this._rotating=ot!==Wt,this._pitching=nr!==yt,this._padding=!Se.isPaddingEqual(or),this._prepareEase(ne,!1),this.terrain&&this._prepareElevation(Ze),this._ease(ln=>{const Nn=ln*en,pi=1/za(Nn);Se.zoom=ln===1?at:Ie+Se.scaleZoom(pi),this._rotating&&(Se.bearing=t.y.number(ot,Wt,ln)),this._pitching&&(Se.pitch=t.y.number(yt,nr,ln)),this._padding&&(Se.interpolatePadding(Ct,or,ln),Wr=Se.centerPoint.add(Fr)),this.terrain&&!I.freezeElevation&&this._updateElevation(ln);const ii=ln===1?Ze:Se.unproject(Tt.add(gt.mult(nn(Nn))).mult(pi));Se.setLocationAtPoint(Se.renderWorldCopies?ii.wrap():ii,Wr),this._applyUpdatedTransform(Se),this._fireMoveEvents(ne)},()=>{this.terrain&&I.freezeElevation&&this._finalizeElevation(),this._afterEase(ne)},I),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(I,ne){var Te;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const Se=this._onEaseEnd;delete this._onEaseEnd,Se.call(this,ne)}return I||(Te=this.handlers)===null||Te===void 0||Te.stop(!1),this}_ease(I,ne,Te){Te.animate===!1||Te.duration===0?(I(1),ne()):(this._easeStart=i.now(),this._easeOptions=Te,this._onEaseFrame=I,this._onEaseEnd=ne,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(I,ne){I=t.b3(I,-180,180);const Te=Math.abs(I-ne);return Math.abs(I-360-ne)180?-360:Te<-180?360:0}queryTerrainElevation(I){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(I),this.transform.tileZoom)-this.transform.elevation:null}}const ji={compact:!0,customAttribution:'MapLibre'};class Ni{constructor(I=ji){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=ne=>{!ne||ne.sourceDataType!=="metadata"&&ne.sourceDataType!=="visibility"&&ne.dataType!=="style"&&ne.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=I}getDefaultPosition(){return"bottom-right"}onAdd(I){return this._map=I,this._compact=this.options.compact,this._container=n.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=n.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=n.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){n.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(I,ne){const Te=this._map._getUIString(`AttributionControl.${ne}`);I.title=Te,I.setAttribute("aria-label",Te)}_updateAttributions(){if(!this._map.style)return;let I=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?I=I.concat(this.options.customAttribution.map(Se=>typeof Se!="string"?"":Se)):typeof this.options.customAttribution=="string"&&I.push(this.options.customAttribution)),this._map.style.stylesheet){const Se=this._map.style.stylesheet;this.styleOwner=Se.owner,this.styleId=Se.id}const ne=this._map.style.sourceCaches;for(const Se in ne){const Ie=ne[Se];if(Ie.used||Ie.usedForTerrain){const ot=Ie.getSource();ot.attribution&&I.indexOf(ot.attribution)<0&&I.push(ot.attribution)}}I=I.filter(Se=>String(Se).trim()),I.sort((Se,Ie)=>Se.length-Ie.length),I=I.filter((Se,Ie)=>{for(let ot=Ie+1;ot=0)return!1;return!0});const Te=I.join(" | ");Te!==this._attribHTML&&(this._attribHTML=Te,I.length?(this._innerContainer.innerHTML=Te,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Bn{constructor(I={}){this._updateCompact=()=>{const ne=this._container.children;if(ne.length){const Te=ne[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&Te.classList.add("maplibregl-compact"):Te.classList.remove("maplibregl-compact")}},this.options=I}getDefaultPosition(){return"bottom-left"}onAdd(I){this._map=I,this._compact=this.options&&this.options.compact,this._container=n.create("div","maplibregl-ctrl");const ne=n.create("a","maplibregl-ctrl-logo");return ne.target="_blank",ne.rel="noopener nofollow",ne.href="https://maplibre.org/",ne.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),ne.setAttribute("rel","noopener nofollow"),this._container.appendChild(ne),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){n.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class An{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(I){const ne=++this._id;return this._queue.push({callback:I,id:ne,cancelled:!1}),ne}remove(I){const ne=this._currentlyRunning,Te=ne?this._queue.concat(ne):this._queue;for(const Se of Te)if(Se.id===I)return void(Se.cancelled=!0)}run(I=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const ne=this._currentlyRunning=this._queue;this._queue=[];for(const Te of ne)if(!Te.cancelled&&(Te.callback(I),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ki=t.Y([{name:"a_pos3d",type:"Int16",components:3}]);class ko extends t.E{constructor(I){super(),this.sourceCache=I,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,I.usedForTerrain=!0,I.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(I,ne){this.sourceCache.update(I,ne),this._renderableTilesKeys=[];const Te={};for(const Se of I.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:ne}))Te[Se.key]=!0,this._renderableTilesKeys.push(Se.key),this._tiles[Se.key]||(Se.posMatrix=new Float64Array(16),t.aP(Se.posMatrix,0,t.X,0,t.X,0,1),this._tiles[Se.key]=new rt(Se,this.tileSize));for(const Se in this._tiles)Te[Se]||delete this._tiles[Se]}freeRtt(I){for(const ne in this._tiles){const Te=this._tiles[ne];(!I||Te.tileID.equals(I)||Te.tileID.isChildOf(I)||I.isChildOf(Te.tileID))&&(Te.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(I=>this.getTileByID(I))}getTileByID(I){return this._tiles[I]}getTerrainCoords(I){const ne={};for(const Te of this._renderableTilesKeys){const Se=this._tiles[Te].tileID;if(Se.canonical.equals(I.canonical)){const Ie=I.clone();Ie.posMatrix=new Float64Array(16),t.aP(Ie.posMatrix,0,t.X,0,t.X,0,1),ne[Te]=Ie}else if(Se.canonical.isChildOf(I.canonical)){const Ie=I.clone();Ie.posMatrix=new Float64Array(16);const ot=Se.canonical.z-I.canonical.z,yt=Se.canonical.x-(Se.canonical.x>>ot<>ot<>ot;t.aP(Ie.posMatrix,0,Wt,0,Wt,0,1),t.J(Ie.posMatrix,Ie.posMatrix,[-yt*Wt,-Ct*Wt,0]),ne[Te]=Ie}else if(I.canonical.isChildOf(Se.canonical)){const Ie=I.clone();Ie.posMatrix=new Float64Array(16);const ot=I.canonical.z-Se.canonical.z,yt=I.canonical.x-(I.canonical.x>>ot<>ot<>ot;t.aP(Ie.posMatrix,0,t.X,0,t.X,0,1),t.J(Ie.posMatrix,Ie.posMatrix,[yt*Wt,Ct*Wt,0]),t.K(Ie.posMatrix,Ie.posMatrix,[1/2**ot,1/2**ot,0]),ne[Te]=Ie}}return ne}getSourceTile(I,ne){const Te=this.sourceCache._source;let Se=I.overscaledZ-this.deltaZoom;if(Se>Te.maxzoom&&(Se=Te.maxzoom),Se=Te.minzoom&&(!Ie||!Ie.dem);)Ie=this.sourceCache.getTileByID(I.scaledTo(Se--).key);return Ie}tilesAfterTime(I=Date.now()){return Object.values(this._tiles).filter(ne=>ne.timeAdded>=I)}}class $o{constructor(I,ne,Te){this.painter=I,this.sourceCache=new ko(ne),this.options=Te,this.exaggeration=typeof Te.exaggeration=="number"?Te.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(I,ne,Te,Se=t.X){var Ie;if(!(ne>=0&&ne=0&&TeI.canonical.z&&(I.canonical.z>=Se?Ie=I.canonical.z-Se:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const ot=I.canonical.x-(I.canonical.x>>Ie<>Ie<>8<<4|Ie>>8,ne[ot+3]=0;const Te=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(ne.buffer)),Se=new u(I,Te,I.gl.RGBA,{premultiply:!1});return Se.bind(I.gl.NEAREST,I.gl.CLAMP_TO_EDGE),this._coordsTexture=Se,Se}pointCoordinate(I){this.painter.maybeDrawDepthAndCoords(!0);const ne=new Uint8Array(4),Te=this.painter.context,Se=Te.gl,Ie=Math.round(I.x*this.painter.pixelRatio/devicePixelRatio),ot=Math.round(I.y*this.painter.pixelRatio/devicePixelRatio),yt=Math.round(this.painter.height/devicePixelRatio);Te.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),Se.readPixels(Ie,yt-ot-1,1,1,Se.RGBA,Se.UNSIGNED_BYTE,ne),Te.bindFramebuffer.set(null);const Ct=ne[0]+(ne[2]>>4<<8),Wt=ne[1]+((15&ne[2])<<8),nr=this.coordsIndex[255-ne[3]],or=nr&&this.sourceCache.getTileByID(nr);if(!or)return null;const Fr=this._coordsTextureSize,Wr=(1<I.id!==ne),this._recentlyUsed.push(I.id)}stampObject(I){I.stamp=++this._stamp}getOrCreateFreeObject(){for(const ne of this._recentlyUsed)if(!this._objects[ne].inUse)return this._objects[ne];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const I=this._createObject(this._objects.length);return this._objects.push(I),I}freeObject(I){I.inUse=!1}freeAllObjects(){for(const I of this._objects)this.freeObject(I)}isFull(){return!(this._objects.length!I.inUse)===!1}}const os={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class As{constructor(I,ne){this.painter=I,this.terrain=ne,this.pool=new Ls(I.context,30,ne.sourceCache.tileSize*ne.qualityFactor)}destruct(){this.pool.destruct()}getTexture(I){return this.pool.getObjectForId(I.rtt[this._stacks.length-1].id).texture}prepareForRender(I,ne){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=I._order.filter(Te=>!I._layers[Te].isHidden(ne)),this._coordsDescendingInv={};for(const Te in I.sourceCaches){this._coordsDescendingInv[Te]={};const Se=I.sourceCaches[Te].getVisibleCoordinates();for(const Ie of Se){const ot=this.terrain.sourceCache.getTerrainCoords(Ie);for(const yt in ot)this._coordsDescendingInv[Te][yt]||(this._coordsDescendingInv[Te][yt]=[]),this._coordsDescendingInv[Te][yt].push(ot[yt])}}this._coordsDescendingInvStr={};for(const Te of I._order){const Se=I._layers[Te],Ie=Se.source;if(os[Se.type]&&!this._coordsDescendingInvStr[Ie]){this._coordsDescendingInvStr[Ie]={};for(const ot in this._coordsDescendingInv[Ie])this._coordsDescendingInvStr[Ie][ot]=this._coordsDescendingInv[Ie][ot].map(yt=>yt.key).sort().join()}}for(const Te of this._renderableTiles)for(const Se in this._coordsDescendingInvStr){const Ie=this._coordsDescendingInvStr[Se][Te.tileID.key];Ie&&Ie!==Te.rttCoords[Se]&&(Te.rtt=[])}}renderLayer(I){if(I.isHidden(this.painter.transform.zoom))return!1;const ne=I.type,Te=this.painter,Se=this._renderableLayerIds[this._renderableLayerIds.length-1]===I.id;if(os[ne]&&(this._prevType&&os[this._prevType]||this._stacks.push([]),this._prevType=ne,this._stacks[this._stacks.length-1].push(I.id),!Se))return!0;if(os[this._prevType]||os[ne]&&Se){this._prevType=ne;const Ie=this._stacks.length-1,ot=this._stacks[Ie]||[];for(const yt of this._renderableTiles){if(this.pool.isFull()&&(Fl(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(yt),yt.rtt[Ie]){const Wt=this.pool.getObjectForId(yt.rtt[Ie].id);if(Wt.stamp===yt.rtt[Ie].stamp){this.pool.useObject(Wt);continue}}const Ct=this.pool.getOrCreateFreeObject();this.pool.useObject(Ct),this.pool.stampObject(Ct),yt.rtt[Ie]={id:Ct.id,stamp:Ct.stamp},Te.context.bindFramebuffer.set(Ct.fbo.framebuffer),Te.context.clear({color:t.aM.transparent,stencil:0}),Te.currentStencilSource=void 0;for(let Wt=0;Wt{De.touchstart=De.dragStart,De.touchmoveWindow=De.dragMove,De.touchend=De.dragEnd},fi={showCompass:!0,showZoom:!0,visualizePitch:!1};class ao{constructor(I,ne,Te=!1){this.mousedown=ot=>{this.startMouse(t.e({},ot,{ctrlKey:!0,preventDefault:()=>ot.preventDefault()}),n.mousePos(this.element,ot)),n.addEventListener(window,"mousemove",this.mousemove),n.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=ot=>{this.moveMouse(ot,n.mousePos(this.element,ot))},this.mouseup=ot=>{this.mouseRotate.dragEnd(ot),this.mousePitch&&this.mousePitch.dragEnd(ot),this.offTemp()},this.touchstart=ot=>{ot.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=n.touchPos(this.element,ot.targetTouches)[0],this.startTouch(ot,this._startPos),n.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.addEventListener(window,"touchend",this.touchend))},this.touchmove=ot=>{ot.targetTouches.length!==1?this.reset():(this._lastPos=n.touchPos(this.element,ot.targetTouches)[0],this.moveTouch(ot,this._lastPos))},this.touchend=ot=>{ot.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const Se=I.dragRotate._mouseRotate.getClickTolerance(),Ie=I.dragRotate._mousePitch.getClickTolerance();this.element=ne,this.mouseRotate=xl({clickTolerance:Se,enable:!0}),this.touchRotate=(({enable:ot,clickTolerance:yt,bearingDegreesPerPixelMoved:Ct=.8})=>{const Wt=new bc;return new iu({clickTolerance:yt,move:(nr,or)=>({bearingDelta:(or.x-nr.x)*Ct}),moveStateManager:Wt,enable:ot,assignEvents:Ss})})({clickTolerance:Se,enable:!0}),this.map=I,Te&&(this.mousePitch=nf({clickTolerance:Ie,enable:!0}),this.touchPitch=(({enable:ot,clickTolerance:yt,pitchDegreesPerPixelMoved:Ct=-.5})=>{const Wt=new bc;return new iu({clickTolerance:yt,move:(nr,or)=>({pitchDelta:(or.y-nr.y)*Ct}),moveStateManager:Wt,enable:ot,assignEvents:Ss})})({clickTolerance:Ie,enable:!0})),n.addEventListener(ne,"mousedown",this.mousedown),n.addEventListener(ne,"touchstart",this.touchstart,{passive:!1}),n.addEventListener(ne,"touchcancel",this.reset)}startMouse(I,ne){this.mouseRotate.dragStart(I,ne),this.mousePitch&&this.mousePitch.dragStart(I,ne),n.disableDrag()}startTouch(I,ne){this.touchRotate.dragStart(I,ne),this.touchPitch&&this.touchPitch.dragStart(I,ne),n.disableDrag()}moveMouse(I,ne){const Te=this.map,{bearingDelta:Se}=this.mouseRotate.dragMove(I,ne)||{};if(Se&&Te.setBearing(Te.getBearing()+Se),this.mousePitch){const{pitchDelta:Ie}=this.mousePitch.dragMove(I,ne)||{};Ie&&Te.setPitch(Te.getPitch()+Ie)}}moveTouch(I,ne){const Te=this.map,{bearingDelta:Se}=this.touchRotate.dragMove(I,ne)||{};if(Se&&Te.setBearing(Te.getBearing()+Se),this.touchPitch){const{pitchDelta:Ie}=this.touchPitch.dragMove(I,ne)||{};Ie&&Te.setPitch(Te.getPitch()+Ie)}}off(){const I=this.element;n.removeEventListener(I,"mousedown",this.mousedown),n.removeEventListener(I,"touchstart",this.touchstart,{passive:!1}),n.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.removeEventListener(window,"touchend",this.touchend),n.removeEventListener(I,"touchcancel",this.reset),this.offTemp()}offTemp(){n.enableDrag(),n.removeEventListener(window,"mousemove",this.mousemove),n.removeEventListener(window,"mouseup",this.mouseup),n.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.removeEventListener(window,"touchend",this.touchend)}}let gs;function Jo(De,I,ne){const Te=new t.N(De.lng,De.lat);if(De=new t.N(De.lng,De.lat),I){const Se=new t.N(De.lng-360,De.lat),Ie=new t.N(De.lng+360,De.lat),ot=ne.locationPoint(De).distSqr(I);ne.locationPoint(Se).distSqr(I)180;){const Se=ne.locationPoint(De);if(Se.x>=0&&Se.y>=0&&Se.x<=ne.width&&Se.y<=ne.height)break;De.lng>ne.center.lng?De.lng-=360:De.lng+=360}return De.lng!==Te.lng&&ne.locationPoint(De).y>ne.height/2-ne.getHorizon()?De:Te}const Bl={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function jl(De,I,ne){const Te=De.classList;for(const Se in Bl)Te.remove(`maplibregl-${ne}-anchor-${Se}`);Te.add(`maplibregl-${ne}-anchor-${I}`)}class Vl extends t.E{constructor(I){if(super(),this._onKeyPress=ne=>{const Te=ne.code,Se=ne.charCode||ne.keyCode;Te!=="Space"&&Te!=="Enter"&&Se!==32&&Se!==13||this.togglePopup()},this._onMapClick=ne=>{const Te=ne.originalEvent.target,Se=this._element;this._popup&&(Te===Se||Se.contains(Te))&&this.togglePopup()},this._update=ne=>{var Te;if(!this._map)return;const Se=this._map.loaded()&&!this._map.isMoving();((ne==null?void 0:ne.type)==="terrain"||(ne==null?void 0:ne.type)==="render"&&!Se)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Jo(this._lngLat,this._flatPos,this._map.transform):(Te=this._lngLat)===null||Te===void 0?void 0:Te.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let Ie="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Ie=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Ie=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let ot="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?ot="rotateX(0deg)":this._pitchAlignment==="map"&&(ot=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||ne&&ne.type!=="moveend"||(this._pos=this._pos.round()),n.setTransform(this._element,`${Bl[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${ot} ${Ie}`),i.frameAsync(new AbortController).then(()=>{this._updateOpacity(ne&&ne.type==="moveend")}).catch(()=>{})},this._onMove=ne=>{if(!this._isDragging){const Te=this._clickTolerance||this._map._clickTolerance;this._isDragging=ne.point.dist(this._pointerdownPos)>=Te}this._isDragging&&(this._pos=ne.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new t.k("dragstart"))),this.fire(new t.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new t.k("dragend")),this._state="inactive"},this._addDragHandler=ne=>{this._element.contains(ne.originalEvent.target)&&(ne.preventDefault(),this._positionDelta=ne.point.sub(this._pos).add(this._offset),this._pointerdownPos=ne.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=I&&I.anchor||"center",this._color=I&&I.color||"#3FB1CE",this._scale=I&&I.scale||1,this._draggable=I&&I.draggable||!1,this._clickTolerance=I&&I.clickTolerance||0,this._subpixelPositioning=I&&I.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=I&&I.rotation||0,this._rotationAlignment=I&&I.rotationAlignment||"auto",this._pitchAlignment=I&&I.pitchAlignment&&I.pitchAlignment!=="auto"?I.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(I==null?void 0:I.opacity,I==null?void 0:I.opacityWhenCovered),I&&I.element)this._element=I.element,this._offset=t.P.convert(I&&I.offset||[0,0]);else{this._defaultMarker=!0,this._element=n.create("div");const ne=n.createNS("http://www.w3.org/2000/svg","svg"),Te=41,Se=27;ne.setAttributeNS(null,"display","block"),ne.setAttributeNS(null,"height",`${Te}px`),ne.setAttributeNS(null,"width",`${Se}px`),ne.setAttributeNS(null,"viewBox",`0 0 ${Se} ${Te}`);const Ie=n.createNS("http://www.w3.org/2000/svg","g");Ie.setAttributeNS(null,"stroke","none"),Ie.setAttributeNS(null,"stroke-width","1"),Ie.setAttributeNS(null,"fill","none"),Ie.setAttributeNS(null,"fill-rule","evenodd");const ot=n.createNS("http://www.w3.org/2000/svg","g");ot.setAttributeNS(null,"fill-rule","nonzero");const yt=n.createNS("http://www.w3.org/2000/svg","g");yt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),yt.setAttributeNS(null,"fill","#000000");const Ct=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const lt of Ct){const Tt=n.createNS("http://www.w3.org/2000/svg","ellipse");Tt.setAttributeNS(null,"opacity","0.04"),Tt.setAttributeNS(null,"cx","10.5"),Tt.setAttributeNS(null,"cy","5.80029008"),Tt.setAttributeNS(null,"rx",lt.rx),Tt.setAttributeNS(null,"ry",lt.ry),yt.appendChild(Tt)}const Wt=n.createNS("http://www.w3.org/2000/svg","g");Wt.setAttributeNS(null,"fill",this._color);const nr=n.createNS("http://www.w3.org/2000/svg","path");nr.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),Wt.appendChild(nr);const or=n.createNS("http://www.w3.org/2000/svg","g");or.setAttributeNS(null,"opacity","0.25"),or.setAttributeNS(null,"fill","#000000");const Fr=n.createNS("http://www.w3.org/2000/svg","path");Fr.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),or.appendChild(Fr);const Wr=n.createNS("http://www.w3.org/2000/svg","g");Wr.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Wr.setAttributeNS(null,"fill","#FFFFFF");const je=n.createNS("http://www.w3.org/2000/svg","g");je.setAttributeNS(null,"transform","translate(8.0, 8.0)");const Ze=n.createNS("http://www.w3.org/2000/svg","circle");Ze.setAttributeNS(null,"fill","#000000"),Ze.setAttributeNS(null,"opacity","0.25"),Ze.setAttributeNS(null,"cx","5.5"),Ze.setAttributeNS(null,"cy","5.5"),Ze.setAttributeNS(null,"r","5.4999962");const at=n.createNS("http://www.w3.org/2000/svg","circle");at.setAttributeNS(null,"fill","#FFFFFF"),at.setAttributeNS(null,"cx","5.5"),at.setAttributeNS(null,"cy","5.5"),at.setAttributeNS(null,"r","5.4999962"),je.appendChild(Ze),je.appendChild(at),ot.appendChild(yt),ot.appendChild(Wt),ot.appendChild(or),ot.appendChild(Wr),ot.appendChild(je),ne.appendChild(ot),ne.setAttributeNS(null,"height",Te*this._scale+"px"),ne.setAttributeNS(null,"width",Se*this._scale+"px"),this._element.appendChild(ne),this._offset=t.P.convert(I&&I.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",ne=>{ne.preventDefault()}),this._element.addEventListener("mousedown",ne=>{ne.preventDefault()}),jl(this._element,this._anchor,"marker"),I&&I.className)for(const ne of I.className.split(" "))this._element.classList.add(ne);this._popup=null}addTo(I){return this.remove(),this._map=I,this._element.setAttribute("aria-label",I._getUIString("Marker.Title")),I.getCanvasContainer().appendChild(this._element),I.on("move",this._update),I.on("moveend",this._update),I.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),n.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(I){return this._lngLat=t.N.convert(I),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(I){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),I){if(!("offset"in I.options)){const Se=Math.abs(13.5)/Math.SQRT2;I.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[Se,-1*(38.1-13.5+Se)],"bottom-right":[-Se,-1*(38.1-13.5+Se)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=I,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(I){return this._subpixelPositioning=I,this}getPopup(){return this._popup}togglePopup(){const I=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:I?(I.isOpen()?I.remove():(I.setLngLat(this._lngLat),I.addTo(this._map)),this):this}_updateOpacity(I=!1){var ne,Te;if(!(!((ne=this._map)===null||ne===void 0)&&ne.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(I)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const Se=this._map,Ie=Se.terrain.depthAtPoint(this._pos),ot=Se.terrain.getElevationForLngLatZoom(this._lngLat,Se.transform.tileZoom);if(Se.transform.lngLatToCameraDepth(this._lngLat,ot)-Ie<.006)return void(this._element.style.opacity=this._opacity);const yt=-this._offset.y/Se.transform._pixelPerMeter,Ct=Math.sin(Se.getPitch()*Math.PI/180)*yt,Wt=Se.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),nr=Se.transform.lngLatToCameraDepth(this._lngLat,ot+Ct)-Wt>.006;!((Te=this._popup)===null||Te===void 0)&&Te.isOpen()&&nr&&this._popup.remove(),this._element.style.opacity=nr?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(I){return this._offset=t.P.convert(I),this._update(),this}addClassName(I){this._element.classList.add(I)}removeClassName(I){this._element.classList.remove(I)}toggleClassName(I){return this._element.classList.toggle(I)}setDraggable(I){return this._draggable=!!I,this._map&&(I?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(I){return this._rotation=I||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(I){return this._rotationAlignment=I||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(I){return this._pitchAlignment=I&&I!=="auto"?I:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(I,ne){return I===void 0&&ne===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),I!==void 0&&(this._opacity=I),ne!==void 0&&(this._opacityWhenCovered=ne),this._map&&this._updateOpacity(!0),this}}const cc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let ql=0,Vu=!1;const ol={maxWidth:100,unit:"metric"};function rc(De,I,ne){const Te=ne&&ne.maxWidth||100,Se=De._container.clientHeight/2,Ie=De.unproject([0,Se]),ot=De.unproject([Te,Se]),yt=Ie.distanceTo(ot);if(ne&&ne.unit==="imperial"){const Ct=3.2808*yt;Ct>5280?Vi(I,Te,Ct/5280,De._getUIString("ScaleControl.Miles")):Vi(I,Te,Ct,De._getUIString("ScaleControl.Feet"))}else ne&&ne.unit==="nautical"?Vi(I,Te,yt/1852,De._getUIString("ScaleControl.NauticalMiles")):yt>=1e3?Vi(I,Te,yt/1e3,De._getUIString("ScaleControl.Kilometers")):Vi(I,Te,yt,De._getUIString("ScaleControl.Meters"))}function Vi(De,I,ne,Te){const Se=function(Ie){const ot=Math.pow(10,`${Math.floor(Ie)}`.length-1);let yt=Ie/ot;return yt=yt>=10?10:yt>=5?5:yt>=3?3:yt>=2?2:yt>=1?1:function(Ct){const Wt=Math.pow(10,Math.ceil(-Math.log(Ct)/Math.LN10));return Math.round(Ct*Wt)/Wt}(yt),ot*yt}(ne);De.style.width=I*(Se/ne)+"px",De.innerHTML=`${Se} ${Te}`}const eo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},qu=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Du(De){if(De){if(typeof De=="number"){const I=Math.round(Math.abs(De)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,De),"top-left":new t.P(I,I),"top-right":new t.P(-I,I),bottom:new t.P(0,-De),"bottom-left":new t.P(I,-I),"bottom-right":new t.P(-I,-I),left:new t.P(De,0),right:new t.P(-De,0)}}if(De instanceof t.P||Array.isArray(De)){const I=t.P.convert(De);return{center:I,top:I,"top-left":I,"top-right":I,bottom:I,"bottom-left":I,"bottom-right":I,left:I,right:I}}return{center:t.P.convert(De.center||[0,0]),top:t.P.convert(De.top||[0,0]),"top-left":t.P.convert(De["top-left"]||[0,0]),"top-right":t.P.convert(De["top-right"]||[0,0]),bottom:t.P.convert(De.bottom||[0,0]),"bottom-left":t.P.convert(De["bottom-left"]||[0,0]),"bottom-right":t.P.convert(De["bottom-right"]||[0,0]),left:t.P.convert(De.left||[0,0]),right:t.P.convert(De.right||[0,0])}}return Du(new t.P(0,0))}const wc=r;e.AJAXError=t.bh,e.Evented=t.E,e.LngLat=t.N,e.MercatorCoordinate=t.Z,e.Point=t.P,e.addProtocol=t.bi,e.config=t.a,e.removeProtocol=t.bj,e.AttributionControl=Ni,e.BoxZoomHandler=du,e.CanvasSource=Ke,e.CooperativeGesturesHandler=_n,e.DoubleClickZoomHandler=Fa,e.DragPanHandler=gn,e.DragRotateHandler=kn,e.EdgeInsets=Tu,e.FullscreenControl=class extends t.E{constructor(De={}){super(),this._onFullscreenChange=()=>{var I;let ne=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((I=ne==null?void 0:ne.shadowRoot)===null||I===void 0)&&I.fullscreenElement;)ne=ne.shadowRoot.fullscreenElement;ne===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,De&&De.container&&(De.container instanceof HTMLElement?this._container=De.container:t.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(De){return this._map=De,this._container||(this._container=this._map.getContainer()),this._controlContainer=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){n.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const De=this._fullscreenButton=n.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);n.create("span","maplibregl-ctrl-icon",De).setAttribute("aria-hidden","true"),De.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const De=this._getTitle();this._fullscreenButton.setAttribute("aria-label",De),this._fullscreenButton.title=De}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new t.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},e.GeoJSONSource=Ce,e.GeolocateControl=class extends t.E{constructor(De){super(),this._onSuccess=I=>{if(this._map){if(this._isOutOfMapMaxBounds(I))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",I)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=I,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(I),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(I),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",I)),this._finish()}},this._updateCamera=I=>{const ne=new t.N(I.coords.longitude,I.coords.latitude),Te=I.coords.accuracy,Se=this._map.getBearing(),Ie=t.e({bearing:Se},this.options.fitBoundsOptions),ot=ie.fromLngLat(ne,Te);this._map.fitBounds(ot,Ie,{geolocateSource:!0})},this._updateMarker=I=>{if(I){const ne=new t.N(I.coords.longitude,I.coords.latitude);this._accuracyCircleMarker.setLngLat(ne).addTo(this._map),this._userLocationDotMarker.setLngLat(ne).addTo(this._map),this._accuracy=I.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=I=>{if(this._map){if(this.options.trackUserLocation)if(I.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const ne=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=ne,this._geolocateButton.setAttribute("aria-label",ne),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(I.code===3&&Vu)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",I)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",I=>I.preventDefault()),this._geolocateButton=n.create("button","maplibregl-ctrl-geolocate",this._container),n.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=I=>{if(this._map){if(I===!1){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");const ne=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=ne,this._geolocateButton.setAttribute("aria-label",ne)}else{const ne=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=ne,this._geolocateButton.setAttribute("aria-label",ne)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=n.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Vl({element:this._dotElement}),this._circleElement=n.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Vl({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",ne=>{ne.geolocateSource||this._watchState!=="ACTIVE_LOCK"||ne.originalEvent&&ne.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new t.k("trackuserlocationend")),this.fire(new t.k("userlocationlostfocus")))})}},this.options=t.e({},cc,De)}onAdd(De){return this._map=De,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return t._(this,arguments,void 0,function*(I=!1){if(gs!==void 0&&!I)return gs;if(window.navigator.permissions===void 0)return gs=!!window.navigator.geolocation,gs;try{gs=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{gs=!!window.navigator.geolocation}return gs})}().then(I=>this._finishSetupUI(I)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),n.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ql=0,Vu=!1}_isOutOfMapMaxBounds(De){const I=this._map.getMaxBounds(),ne=De.coords;return I&&(ne.longitudeI.getEast()||ne.latitudeI.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const De=this._map.getBounds(),I=De.getSouthEast(),ne=De.getNorthEast(),Te=I.distanceTo(ne),Se=Math.ceil(this._accuracy/(Te/this._map._container.clientHeight)*2);this._circleElement.style.width=`${Se}px`,this._circleElement.style.height=`${Se}px`}trigger(){if(!this._setup)return t.w("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 t.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ql--,Vu=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new t.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.k("trackuserlocationstart")),this.fire(new t.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let De;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ql++,ql>1?(De={maximumAge:6e5,timeout:0},Vu=!0):(De=this.options.positionOptions,Vu=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,De)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},e.Hash=Pu,e.ImageSource=et,e.KeyboardHandler=ur,e.LngLatBounds=ie,e.LogoControl=Bn,e.Map=class extends ki{constructor(De){t.bf.mark(t.bg.create);const I=Object.assign(Object.assign({},Qs),De);if(I.minZoom!=null&&I.maxZoom!=null&&I.minZoom>I.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(I.minPitch!=null&&I.maxPitch!=null&&I.minPitch>I.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(I.minPitch!=null&&I.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(I.maxPitch!=null&&I.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Ns(I.minZoom,I.maxZoom,I.minPitch,I.maxPitch,I.renderWorldCopies),{bearingSnap:I.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new An,this._controls=[],this._mapId=t.a4(),this._contextLost=ne=>{ne.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:ne}))},this._contextRestored=ne=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:ne}))},this._onMapScroll=ne=>{if(ne.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=I.interactive,this._maxTileCacheSize=I.maxTileCacheSize,this._maxTileCacheZoomLevels=I.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=I.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=I.preserveDrawingBuffer===!0,this._antialias=I.antialias===!0,this._trackResize=I.trackResize===!0,this._bearingSnap=I.bearingSnap,this._refreshExpiredTiles=I.refreshExpiredTiles===!0,this._fadeDuration=I.fadeDuration,this._crossSourceCollisions=I.crossSourceCollisions===!0,this._collectResourceTiming=I.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},jo),I.locale),this._clickTolerance=I.clickTolerance,this._overridePixelRatio=I.pixelRatio,this._maxCanvasSize=I.maxCanvasSize,this.transformCameraUpdate=I.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=I.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=l.addThrottleControl(()=>this.isMoving()),this._requestManager=new y(I.transformRequest),typeof I.container=="string"){if(this._container=document.getElementById(I.container),!this._container)throw new Error(`Container '${I.container}' not found.`)}else{if(!(I.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=I.container}if(I.maxBounds&&this.setMaxBounds(I.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let ne=!1;const Te=yc(Se=>{this._trackResize&&!this._removed&&(this.resize(Se),this.redraw())},50);this._resizeObserver=new ResizeObserver(Se=>{ne?Te(Se):ne=!0}),this._resizeObserver.observe(this._container)}this.handlers=new zi(this,I),this._hash=I.hash&&new Pu(typeof I.hash=="string"&&I.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:I.center,zoom:I.zoom,bearing:I.bearing,pitch:I.pitch}),I.bounds&&(this.resize(),this.fitBounds(I.bounds,t.e({},I.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=I.localIdeographFontFamily,this._validateStyle=I.validateStyle,I.style&&this.setStyle(I.style,{localIdeographFontFamily:I.localIdeographFontFamily}),I.attributionControl&&this.addControl(new Ni(typeof I.attributionControl=="boolean"?void 0:I.attributionControl)),I.maplibreLogo&&this.addControl(new Bn,I.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",ne=>{this._update(ne.dataType==="style"),this.fire(new t.k(`${ne.dataType}data`,ne))}),this.on("dataloading",ne=>{this.fire(new t.k(`${ne.dataType}dataloading`,ne))}),this.on("dataabort",ne=>{this.fire(new t.k("sourcedataabort",ne))})}_getMapId(){return this._mapId}addControl(De,I){if(I===void 0&&(I=De.getDefaultPosition?De.getDefaultPosition():"top-right"),!De||!De.onAdd)return this.fire(new t.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const ne=De.onAdd(this);this._controls.push(De);const Te=this._controlPositions[I];return I.indexOf("bottom")!==-1?Te.insertBefore(ne,Te.firstChild):Te.appendChild(ne),this}removeControl(De){if(!De||!De.onRemove)return this.fire(new t.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const I=this._controls.indexOf(De);return I>-1&&this._controls.splice(I,1),De.onRemove(this),this}hasControl(De){return this._controls.indexOf(De)>-1}calculateCameraOptionsFromTo(De,I,ne,Te){return Te==null&&this.terrain&&(Te=this.terrain.getElevationForLngLatZoom(ne,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(De,I,ne,Te)}resize(De){var I;const ne=this._containerDimensions(),Te=ne[0],Se=ne[1],Ie=this._getClampedPixelRatio(Te,Se);if(this._resizeCanvas(Te,Se,Ie),this.painter.resize(Te,Se,Ie),this.painter.overLimit()){const yt=this.painter.context.gl;this._maxCanvasSize=[yt.drawingBufferWidth,yt.drawingBufferHeight];const Ct=this._getClampedPixelRatio(Te,Se);this._resizeCanvas(Te,Se,Ct),this.painter.resize(Te,Se,Ct)}this.transform.resize(Te,Se),(I=this._requestedCameraState)===null||I===void 0||I.resize(Te,Se);const ot=!this._moving;return ot&&(this.stop(),this.fire(new t.k("movestart",De)).fire(new t.k("move",De))),this.fire(new t.k("resize",De)),ot&&this.fire(new t.k("moveend",De)),this}_getClampedPixelRatio(De,I){const{0:ne,1:Te}=this._maxCanvasSize,Se=this.getPixelRatio(),Ie=De*Se,ot=I*Se;return Math.min(Ie>ne?ne/Ie:1,ot>Te?Te/ot:1)*Se}getPixelRatio(){var De;return(De=this._overridePixelRatio)!==null&&De!==void 0?De:devicePixelRatio}setPixelRatio(De){this._overridePixelRatio=De,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(De){return this.transform.setMaxBounds(ie.convert(De)),this._update()}setMinZoom(De){if((De=De??-2)>=-2&&De<=this.transform.maxZoom)return this.transform.minZoom=De,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=De,this._update(),this.getZoom()>De&&this.setZoom(De),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(De){if((De=De??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(De>=0&&De<=this.transform.maxPitch)return this.transform.minPitch=De,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(De>=this.transform.minPitch)return this.transform.maxPitch=De,this._update(),this.getPitch()>De&&this.setPitch(De),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(De){return this.transform.renderWorldCopies=De,this._update()}project(De){return this.transform.locationPoint(t.N.convert(De),this.style&&this.terrain)}unproject(De){return this.transform.pointLocation(t.P.convert(De),this.terrain)}isMoving(){var De;return this._moving||((De=this.handlers)===null||De===void 0?void 0:De.isMoving())}isZooming(){var De;return this._zooming||((De=this.handlers)===null||De===void 0?void 0:De.isZooming())}isRotating(){var De;return this._rotating||((De=this.handlers)===null||De===void 0?void 0:De.isRotating())}_createDelegatedListener(De,I,ne){if(De==="mouseenter"||De==="mouseover"){let Te=!1;return{layers:I,listener:ne,delegates:{mousemove:Ie=>{const ot=I.filter(Ct=>this.getLayer(Ct)),yt=ot.length!==0?this.queryRenderedFeatures(Ie.point,{layers:ot}):[];yt.length?Te||(Te=!0,ne.call(this,new Cl(De,this,Ie.originalEvent,{features:yt}))):Te=!1},mouseout:()=>{Te=!1}}}}if(De==="mouseleave"||De==="mouseout"){let Te=!1;return{layers:I,listener:ne,delegates:{mousemove:ot=>{const yt=I.filter(Ct=>this.getLayer(Ct));(yt.length!==0?this.queryRenderedFeatures(ot.point,{layers:yt}):[]).length?Te=!0:Te&&(Te=!1,ne.call(this,new Cl(De,this,ot.originalEvent)))},mouseout:ot=>{Te&&(Te=!1,ne.call(this,new Cl(De,this,ot.originalEvent)))}}}}{const Te=Se=>{const Ie=I.filter(yt=>this.getLayer(yt)),ot=Ie.length!==0?this.queryRenderedFeatures(Se.point,{layers:Ie}):[];ot.length&&(Se.features=ot,ne.call(this,Se),delete Se.features)};return{layers:I,listener:ne,delegates:{[De]:Te}}}}_saveDelegatedListener(De,I){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[De]=this._delegatedListeners[De]||[],this._delegatedListeners[De].push(I)}_removeDelegatedListener(De,I,ne){if(!this._delegatedListeners||!this._delegatedListeners[De])return;const Te=this._delegatedListeners[De];for(let Se=0;SeI.includes(ot))){for(const ot in Ie.delegates)this.off(ot,Ie.delegates[ot]);return void Te.splice(Se,1)}}}on(De,I,ne){if(ne===void 0)return super.on(De,I);const Te=this._createDelegatedListener(De,typeof I=="string"?[I]:I,ne);this._saveDelegatedListener(De,Te);for(const Se in Te.delegates)this.on(Se,Te.delegates[Se]);return this}once(De,I,ne){if(ne===void 0)return super.once(De,I);const Te=typeof I=="string"?[I]:I,Se=this._createDelegatedListener(De,Te,ne);for(const Ie in Se.delegates){const ot=Se.delegates[Ie];Se.delegates[Ie]=(...yt)=>{this._removeDelegatedListener(De,Te,ne),ot(...yt)}}this._saveDelegatedListener(De,Se);for(const Ie in Se.delegates)this.once(Ie,Se.delegates[Ie]);return this}off(De,I,ne){return ne===void 0?super.off(De,I):(this._removeDelegatedListener(De,typeof I=="string"?[I]:I,ne),this)}queryRenderedFeatures(De,I){if(!this.style)return[];let ne;const Te=De instanceof t.P||Array.isArray(De),Se=Te?De:[[0,0],[this.transform.width,this.transform.height]];if(I=I||(Te?{}:De)||{},Se instanceof t.P||typeof Se[0]=="number")ne=[t.P.convert(Se)];else{const Ie=t.P.convert(Se[0]),ot=t.P.convert(Se[1]);ne=[Ie,new t.P(ot.x,Ie.y),ot,new t.P(Ie.x,ot.y),Ie]}return this.style.queryRenderedFeatures(ne,I,this.transform)}querySourceFeatures(De,I){return this.style.querySourceFeatures(De,I)}setStyle(De,I){return(I=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},I)).diff!==!1&&I.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&De?(this._diffStyle(De,I),this):(this._localIdeographFontFamily=I.localIdeographFontFamily,this._updateStyle(De,I))}setTransformRequest(De){return this._requestManager.setTransformRequest(De),this}_getUIString(De){const I=this._locale[De];if(I==null)throw new Error(`Missing UI string '${De}'`);return I}_updateStyle(De,I){if(I.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(De,I));const ne=this.style&&I.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!De)),De?(this.style=new Hr(this,I||{}),this.style.setEventedParent(this,{style:this.style}),typeof De=="string"?this.style.loadURL(De,I,ne):this.style.loadJSON(De,I,ne),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Hr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(De,I){if(typeof De=="string"){const ne=this._requestManager.transformRequest(De,"Style");t.h(ne,new AbortController).then(Te=>{this._updateDiff(Te.data,I)}).catch(Te=>{Te&&this.fire(new t.j(Te))})}else typeof De=="object"&&this._updateDiff(De,I)}_updateDiff(De,I){try{this.style.setState(De,I)&&this._update(!0)}catch(ne){t.w(`Unable to perform style diff: ${ne.message||ne.error||ne}. Rebuilding the style from scratch.`),this._updateStyle(De,I)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w("There is no style added to the map.")}addSource(De,I){return this._lazyInitEmptyStyle(),this.style.addSource(De,I),this._update(!0)}isSourceLoaded(De){const I=this.style&&this.style.sourceCaches[De];if(I!==void 0)return I.loaded();this.fire(new t.j(new Error(`There is no source with ID '${De}'`)))}setTerrain(De){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),De){const I=this.style.sourceCaches[De.source];if(!I)throw new Error(`cannot load terrain, because there exists no source with ID: ${De.source}`);this.terrain===null&&I.reload();for(const ne in this.style._layers){const Te=this.style._layers[ne];Te.type==="hillshade"&&Te.source===De.source&&t.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new $o(this.painter,I,De),this.painter.renderToTexture=new As(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=ne=>{ne.dataType==="style"?this.terrain.sourceCache.freeRtt():ne.dataType==="source"&&ne.tile&&(ne.sourceId!==De.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(ne.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new t.k("terrain",{terrain:De})),this}getTerrain(){var De,I;return(I=(De=this.terrain)===null||De===void 0?void 0:De.options)!==null&&I!==void 0?I:null}areTilesLoaded(){const De=this.style&&this.style.sourceCaches;for(const I in De){const ne=De[I]._tiles;for(const Te in ne){const Se=ne[Te];if(Se.state!=="loaded"&&Se.state!=="errored")return!1}}return!0}removeSource(De){return this.style.removeSource(De),this._update(!0)}getSource(De){return this.style.getSource(De)}addImage(De,I,ne={}){const{pixelRatio:Te=1,sdf:Se=!1,stretchX:Ie,stretchY:ot,content:yt,textFitWidth:Ct,textFitHeight:Wt}=ne;if(this._lazyInitEmptyStyle(),!(I instanceof HTMLImageElement||t.b(I))){if(I.width===void 0||I.height===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:nr,height:or,data:Fr}=I,Wr=I;return this.style.addImage(De,{data:new t.R({width:nr,height:or},new Uint8Array(Fr)),pixelRatio:Te,stretchX:Ie,stretchY:ot,content:yt,textFitWidth:Ct,textFitHeight:Wt,sdf:Se,version:0,userImage:Wr}),Wr.onAdd&&Wr.onAdd(this,De),this}}{const{width:nr,height:or,data:Fr}=i.getImageData(I);this.style.addImage(De,{data:new t.R({width:nr,height:or},Fr),pixelRatio:Te,stretchX:Ie,stretchY:ot,content:yt,textFitWidth:Ct,textFitHeight:Wt,sdf:Se,version:0})}}updateImage(De,I){const ne=this.style.getImage(De);if(!ne)return this.fire(new t.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const Te=I instanceof HTMLImageElement||t.b(I)?i.getImageData(I):I,{width:Se,height:Ie,data:ot}=Te;if(Se===void 0||Ie===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(Se!==ne.data.width||Ie!==ne.data.height)return this.fire(new t.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const yt=!(I instanceof HTMLImageElement||t.b(I));return ne.data.replace(ot,yt),this.style.updateImage(De,ne),this}getImage(De){return this.style.getImage(De)}hasImage(De){return De?!!this.style.getImage(De):(this.fire(new t.j(new Error("Missing required image id"))),!1)}removeImage(De){this.style.removeImage(De)}loadImage(De){return l.getImage(this._requestManager.transformRequest(De,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(De,I){return this._lazyInitEmptyStyle(),this.style.addLayer(De,I),this._update(!0)}moveLayer(De,I){return this.style.moveLayer(De,I),this._update(!0)}removeLayer(De){return this.style.removeLayer(De),this._update(!0)}getLayer(De){return this.style.getLayer(De)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(De,I,ne){return this.style.setLayerZoomRange(De,I,ne),this._update(!0)}setFilter(De,I,ne={}){return this.style.setFilter(De,I,ne),this._update(!0)}getFilter(De){return this.style.getFilter(De)}setPaintProperty(De,I,ne,Te={}){return this.style.setPaintProperty(De,I,ne,Te),this._update(!0)}getPaintProperty(De,I){return this.style.getPaintProperty(De,I)}setLayoutProperty(De,I,ne,Te={}){return this.style.setLayoutProperty(De,I,ne,Te),this._update(!0)}getLayoutProperty(De,I){return this.style.getLayoutProperty(De,I)}setGlyphs(De,I={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(De,I),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(De,I,ne={}){return this._lazyInitEmptyStyle(),this.style.addSprite(De,I,ne,Te=>{Te||this._update(!0)}),this}removeSprite(De){return this._lazyInitEmptyStyle(),this.style.removeSprite(De),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(De,I={}){return this._lazyInitEmptyStyle(),this.style.setSprite(De,I,ne=>{ne||this._update(!0)}),this}setLight(De,I={}){return this._lazyInitEmptyStyle(),this.style.setLight(De,I),this._update(!0)}getLight(){return this.style.getLight()}setSky(De){return this._lazyInitEmptyStyle(),this.style.setSky(De),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(De,I){return this.style.setFeatureState(De,I),this._update()}removeFeatureState(De,I){return this.style.removeFeatureState(De,I),this._update()}getFeatureState(De){return this.style.getFeatureState(De)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let De=0,I=0;return this._container&&(De=this._container.clientWidth||400,I=this._container.clientHeight||300),[De,I]}_setupContainer(){const De=this._container;De.classList.add("maplibregl-map");const I=this._canvasContainer=n.create("div","maplibregl-canvas-container",De);this._interactive&&I.classList.add("maplibregl-interactive"),this._canvas=n.create("canvas","maplibregl-canvas",I),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const ne=this._containerDimensions(),Te=this._getClampedPixelRatio(ne[0],ne[1]);this._resizeCanvas(ne[0],ne[1],Te);const Se=this._controlContainer=n.create("div","maplibregl-control-container",De),Ie=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(ot=>{Ie[ot]=n.create("div",`maplibregl-ctrl-${ot} `,Se)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(De,I,ne){this._canvas.width=Math.floor(ne*De),this._canvas.height=Math.floor(ne*I),this._canvas.style.width=`${De}px`,this._canvas.style.height=`${I}px`}_setupPainter(){const De={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let I=null;this._canvas.addEventListener("webglcontextcreationerror",Te=>{I={requestedAttributes:De},Te&&(I.statusMessage=Te.statusMessage,I.type=Te.type)},{once:!0});const ne=this._canvas.getContext("webgl2",De)||this._canvas.getContext("webgl",De);if(!ne){const Te="Failed to initialize WebGL";throw I?(I.message=Te,new Error(JSON.stringify(I))):new Error(Te)}this.painter=new Uu(ne,this.transform),s.testSupport(ne)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(De){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||De,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(De){return this._update(),this._renderTaskQueue.add(De)}_cancelRenderFrame(De){this._renderTaskQueue.remove(De)}_render(De){const I=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(De),this._removed)return;let ne=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const Se=this.transform.zoom,Ie=i.now();this.style.zoomHistory.update(Se,Ie);const ot=new t.z(Se,{now:Ie,fadeDuration:I,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),yt=ot.crossFadingFactor();yt===1&&yt===this._crossFadingFactor||(ne=!0,this._crossFadingFactor=yt),this.style.update(ot)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,I,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:I,showPadding:this.showPadding}),this.fire(new t.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,t.bf.mark(t.bg.load),this.fire(new t.k("load"))),this.style&&(this.style.hasTransitions()||ne)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const Te=this._sourcesDirty||this._styleDirty||this._placementDirty;return Te||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||Te||(this._fullyLoaded=!0,t.bf.mark(t.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var De;this._hash&&this._hash.remove();for(const ne of this._controls)ne.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),l.removeThrottleControl(this._imageQueueHandle),(De=this._resizeObserver)===null||De===void 0||De.disconnect();const I=this.painter.context.gl.getExtension("WEBGL_lose_context");I!=null&&I.loseContext&&I.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),n.remove(this._canvasContainer),n.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),t.bf.clearMetrics(),this._removed=!0,this.fire(new t.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(De=>{t.bf.frame(De),this._frameRequest=null,this._render(De)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(De){this._showTileBoundaries!==De&&(this._showTileBoundaries=De,this._update())}get showPadding(){return!!this._showPadding}set showPadding(De){this._showPadding!==De&&(this._showPadding=De,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(De){this._showCollisionBoxes!==De&&(this._showCollisionBoxes=De,De?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(De){this._showOverdrawInspector!==De&&(this._showOverdrawInspector=De,this._update())}get repaint(){return!!this._repaint}set repaint(De){this._repaint!==De&&(this._repaint=De,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(De){this._vertices=De,this._update()}get version(){return il}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=Cl,e.MapTouchEvent=uc,e.MapWheelEvent=rf,e.Marker=Vl,e.NavigationControl=class{constructor(De){this._updateZoomButtons=()=>{const I=this._map.getZoom(),ne=I===this._map.getMaxZoom(),Te=I===this._map.getMinZoom();this._zoomInButton.disabled=ne,this._zoomOutButton.disabled=Te,this._zoomInButton.setAttribute("aria-disabled",ne.toString()),this._zoomOutButton.setAttribute("aria-disabled",Te.toString())},this._rotateCompassArrow=()=>{const I=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=I},this._setButtonTitle=(I,ne)=>{const Te=this._map._getUIString(`NavigationControl.${ne}`);I.title=Te,I.setAttribute("aria-label",Te)},this.options=t.e({},fi,De),this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",I=>I.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",I=>this._map.zoomIn({},{originalEvent:I})),n.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",I=>this._map.zoomOut({},{originalEvent:I})),n.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",I=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:I}):this._map.resetNorth({},{originalEvent:I})}),this._compassIcon=n.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(De){return this._map=De,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new ao(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){n.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(De,I){const ne=n.create("button",De,this._container);return ne.type="button",ne.addEventListener("click",I),ne}},e.Popup=class extends t.E{constructor(De){super(),this.remove=()=>(this._content&&n.remove(this._content),this._container&&(n.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),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new t.k("close"))),this),this._onMouseUp=I=>{this._update(I.point)},this._onMouseMove=I=>{this._update(I.point)},this._onDrag=I=>{this._update(I.point)},this._update=I=>{var ne;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=n.create("div","maplibregl-popup",this._map.getContainer()),this._tip=n.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const yt of this.options.className.split(" "))this._container.classList.add(yt);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Jo(this._lngLat,this._flatPos,this._map.transform):(ne=this._lngLat)===null||ne===void 0?void 0:ne.wrap(),this._trackPointer&&!I)return;const Te=this._flatPos=this._pos=this._trackPointer&&I?I:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&I?I:this._map.transform.locationPoint(this._lngLat));let Se=this.options.anchor;const Ie=Du(this.options.offset);if(!Se){const yt=this._container.offsetWidth,Ct=this._container.offsetHeight;let Wt;Wt=Te.y+Ie.bottom.ythis._map.transform.height-Ct?["bottom"]:[],Te.xthis._map.transform.width-yt/2&&Wt.push("right"),Se=Wt.length===0?"bottom":Wt.join("-")}let ot=Te.add(Ie[Se]);this.options.subpixelPositioning||(ot=ot.round()),n.setTransform(this._container,`${Bl[Se]} translate(${ot.x}px,${ot.y}px)`),jl(this._container,Se,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(eo),De)}addTo(De){return this._map&&this.remove(),this._map=De,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new t.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(De){return this._lngLat=t.N.convert(De),this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(De){return this.setDOMContent(document.createTextNode(De))}setHTML(De){const I=document.createDocumentFragment(),ne=document.createElement("body");let Te;for(ne.innerHTML=De;Te=ne.firstChild,Te;)I.appendChild(Te);return this.setDOMContent(I)}getMaxWidth(){var De;return(De=this._container)===null||De===void 0?void 0:De.style.maxWidth}setMaxWidth(De){return this.options.maxWidth=De,this._update(),this}setDOMContent(De){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=n.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(De),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(De){return this._container&&this._container.classList.add(De),this}removeClassName(De){return this._container&&this._container.classList.remove(De),this}setOffset(De){return this.options.offset=De,this._update(),this}toggleClassName(De){if(this._container)return this._container.classList.toggle(De)}setSubpixelPositioning(De){this.options.subpixelPositioning=De}_createCloseButton(){this.options.closeButton&&(this._closeButton=n.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const De=this._container.querySelector(qu);De&&De.focus()}},e.RasterDEMTileSource=Fe,e.RasterTileSource=Ae,e.ScaleControl=class{constructor(De){this._onMove=()=>{rc(this._map,this._container,this.options)},this.setUnit=I=>{this.options.unit=I,rc(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},ol),De)}getDefaultPosition(){return"bottom-left"}onAdd(De){return this._map=De,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-scale",De.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){n.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},e.ScrollZoomHandler=ua,e.Style=Hr,e.TerrainControl=class{constructor(De){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=De}onAdd(De){return this._map=De,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=n.create("button","maplibregl-ctrl-terrain",this._container),n.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){n.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=Cc,e.TwoFingersTouchRotateHandler=tc,e.TwoFingersTouchZoomHandler=Ol,e.TwoFingersTouchZoomRotateHandler=Ja,e.VectorTileSource=we,e.VideoSource=Qe,e.addSourceType=(De,I)=>t._(void 0,void 0,void 0,function*(){if(Me(De))throw new Error(`A source type called "${De}" already exists.`);((ne,Te)=>{Xe[ne]=Te})(De,I)}),e.clearPrewarmedResources=function(){const De=le;De&&(De.isPreloaded()&&De.numActive()===1?(De.release(Q),le=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()"))},e.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return $e().getRTLTextPluginStatus()},e.getVersion=function(){return wc},e.getWorkerCount=function(){return ue.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(De){return X().broadcast("IS",De)},e.prewarm=function(){J().acquire(Q)},e.setMaxParallelImageRequests=function(De){t.a.MAX_PARALLEL_IMAGE_REQUESTS=De},e.setRTLTextPlugin=function(De,I){return $e().setRTLTextPlugin(De,I)},e.setWorkerCount=function(De){ue.workerCount=De},e.setWorkerUrl=function(De){t.a.WORKER_URL=De}});var E=d;return E})}}),_R=He({"src/plots/map/layers.js"(Y,G){var d=Gr(),x=yl().sanitizeHTML,A=HT(),E=up();function e(i,n){this.subplot=i,this.uid=i.uid+"-"+n,this.index=n,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(n){this.visible?this.needsNewImage(n)?this.updateImage(n):this.needsNewSource(n)?(this.removeLayer(),this.updateSource(n),this.updateLayer(n)):this.needsNewLayer(n)?this.updateLayer(n):this.updateStyle(n):(this.updateSource(n),this.updateLayer(n)),this.visible=r(n)},t.needsNewImage=function(i){var n=this.subplot.map;return n.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var n=this.subplot.map;n.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var n=this.subplot.map;if(n.getSource(this.idSource)&&n.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=a(i);n.addSource(this.idSource,s)}},t.findFollowingMapLayerId=function(i){if(i==="traces")for(var n=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var n={},s={};switch(i.type){case"circle":d.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":d.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":d.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var c=i.symbol,f=A(c.textposition,c.iconsize);d.extendFlat(n,{"icon-image":c.icon+"-15","icon-size":c.iconsize/10,"text-field":c.text,"text-size":c.textfont.size,"text-anchor":f.anchor,"text-offset":f.offset,"symbol-placement":c.placement}),d.extendFlat(s,{"icon-color":i.color,"text-color":c.textfont.color,"text-opacity":i.opacity});break;case"raster":d.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:n,paint:s}}function a(i){var n=i.sourcetype,s=i.source,c={type:n},f;return n==="geojson"?f="data":n==="vector"?f=typeof s=="string"?"url":"tiles":n==="raster"?(f="tiles",c.tileSize=256):n==="image"&&(f="url",c.coordinates=i.coordinates),c[f]=s,i.sourceattribution&&(c.attribution=x(i.sourceattribution)),c}G.exports=function(n,s,c){var f=new e(n,s);return f.update(c),f}}}),xR=He({"src/plots/map/map.js"(Y,G){var d=mR(),x=Gr(),A=ip(),E=Ei(),e=io(),t=fh(),r=Wu(),o=bv(),a=o.drawMode,i=o.selectMode,n=dc().prepSelect,s=dc().clearOutline,c=dc().clearSelectionsCache,f=dc().selectOnClick,v=up(),h=_R();function T(_,w){this.id=w,this.gd=_;var p=_._fullLayout,u=_._context;this.container=p._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(_,w,p){var u=this,g;u.map?g=new Promise(function(m,R){u.updateMap(_,w,m,R)}):g=new Promise(function(m,R){u.createMap(_,w,m,R)}),p.push(g)},l.createMap=function(_,w,p,u){var g=this,m=w[g.id],R=g.styleObj=b(m.style),P=m.bounds,z=P?[[P.west,P.south],[P.east,P.north]]:null,F=g.map=new d.Map({container:g.div,style:R.style,center:M(m.center),zoom:m.zoom,bearing:m.bearing,pitch:m.pitch,maxBounds:z,interactive:!g.isStatic,preserveDrawingBuffer:g.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0})),B={};F.on("styleimagemissing",function(L){var N=L.id;if(!B[N]&&N.includes("-15")){B[N]=!0;var U=new Image(15,15);U.onload=function(){F.addImage(N,U)},U.crossOrigin="Anonymous",U.src="https://unpkg.com/maki@2.1.0/icons/"+N+".svg"}}),F.setTransformRequest(function(L){return L=L.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),L=L.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),L=L.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:L}}),F._canvas.style.left="0px",F._canvas.style.top="0px",g.rejectOnError(u),g.isStatic||g.initFx(_,w);var O=[];O.push(new Promise(function(L){F.once("load",L)})),O=O.concat(A.fetchTraceGeoData(_)),Promise.all(O).then(function(){g.fillBelowLookup(_,w),g.updateData(_),g.updateLayout(w),g.resolveOnRender(p)}).catch(u)},l.updateMap=function(_,w,p,u){var g=this,m=g.map,R=w[this.id];g.rejectOnError(u);var P=[],z=b(R.style);JSON.stringify(g.styleObj)!==JSON.stringify(z)&&(g.styleObj=z,m.setStyle(z.style),g.traceHash={},P.push(new Promise(function(F){m.once("styledata",F)}))),P=P.concat(A.fetchTraceGeoData(_)),Promise.all(P).then(function(){g.fillBelowLookup(_,w),g.updateData(_),g.updateLayout(w),g.resolveOnRender(p)}).catch(u)},l.fillBelowLookup=function(_,w){var p=w[this.id],u=p.layers,g,m,R=this.belowLookup={},P=!1;for(g=0;g<_.length;g++){var z=_[g][0].trace,F=z._module;typeof z.below=="string"?m=z.below:F.getBelow&&(m=F.getBelow(z,this)),m===""&&(P=!0),R["trace-"+z.uid]=m||""}for(g=0;g1)for(g=0;g-1&&f(z.originalEvent,u,[p.xaxis],[p.yaxis],p.id,P),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(_){var w=this,p=w.map,u=w.gd;if(w.isStatic)return;function g(z){var F=w.map.unproject(z);return[F.lng,F.lat]}var m=_.dragmode,R;R=function(z,F){if(F.isRect){var B=z.range={};B[w.id]=[g([F.xmin,F.ymin]),g([F.xmax,F.ymax])]}else{var O=z.lassoPoints={};O[w.id]=F.map(g)}};var P=w.dragOptions;w.dragOptions=x.extendDeep(P||{},{dragmode:_.dragmode,element:w.div,gd:u,plotinfo:{id:w.id,domain:_[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:R},xaxes:[w.xaxis],yaxes:[w.yaxis],subplot:w.id}),p.off("click",w.onClickInPanHandler),i(m)||a(m)?(p.dragPan.disable(),p.on("zoomstart",w.clearOutline),w.dragOptions.prepFn=function(z,F,B){n(z,F,B,w.dragOptions,m)},t.init(w.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",w.clearOutline),w.div.onmousedown=null,w.div.ontouchstart=null,w.div.removeEventListener("touchstart",w.div._ontouchstart),w.onClickInPanHandler=w.onClickInPanFn(w.dragOptions),p.on("click",w.onClickInPanHandler))},l.updateFramework=function(_){var w=_[this.id].domain,p=_._size,u=this.div.style;u.width=p.w*(w.x[1]-w.x[0])+"px",u.height=p.h*(w.y[1]-w.y[0])+"px",u.left=p.l+w.x[0]*p.w+"px",u.top=p.t+(1-w.y[1])*p.h+"px",this.xaxis._offset=p.l+w.x[0]*p.w,this.xaxis._length=p.w*(w.x[1]-w.x[0]),this.yaxis._offset=p.t+(1-w.y[1])*p.h,this.yaxis._length=p.h*(w.y[1]-w.y[0])},l.updateLayers=function(_){var w=_[this.id],p=w.layers,u=this.layerList,g;if(p.length!==u.length){for(g=0;gp/2){var u=S.split("|").join("
");_.text(u).attr("data-unformatted",u).call(r.convertToTspans,i),w=t.bBox(_.node())}_.attr("transform",d(-3,-w.height+8)),M.insert("rect",".static-attribution").attr({x:-w.width-6,y:-w.height-3,width:w.width+6,height:w.height+3,fill:"rgba(255, 255, 255, 0.75)"});var g=1;w.width+6>p&&(g=p/(w.width+6));var m=[c.l+c.w*h.x[1],c.t+c.h*(1-h.y[0])];M.attr("transform",d(m[0],m[1])+x(g))}},Y.updateFx=function(i){for(var n=i._fullLayout,s=n._subplots[a],c=0;c=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},G.exports=function(r,o){var a=o[0].trace,i=new E(r,a.uid),n=i.sourceId,s=d(o),c=i.below=r.belowLookup["trace-"+a.uid];return r.map.addSource(n,{type:"geojson",data:s.geojson}),i._addLayers(s,c),o[0].trace._glTrace=i,i}}}),MR=He({"src/traces/choroplethmap/index.js"(Y,G){G.exports={attributes:GT(),supplyDefaults:AR(),colorbar:Zd(),calc:G_(),plot:SR(),hoverPoints:Z_(),eventData:X_(),selectPoints:Y_(),styleOnSelect:function(d,x){if(x){var A=x[0].trace;A._glTrace.updateOnSelect(x)}},getBelow:function(d,x){for(var A=x.getMapLayers(),E=A.length-2;E>=0;E--){var e=A[E].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=E+1;t0?+h[f]:0),c.push({type:"Feature",geometry:{type:"Point",coordinates:b},properties:S})}}var _=E.extractOpts(a),w=_.reversescale?E.flipScale(_.colorscale):_.colorscale,p=w[0][1],u=A.opacity(p)<1?p:A.addOpacity(p,0),g=["interpolate",["linear"],["heatmap-density"],0,u];for(f=1;f=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},G.exports=function(t,r){var o=r[0].trace,a=new A(t,o.uid),i=a.sourceId,n=d(r),s=a.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:n.geojson}),a._addLayers(n,s),a}}}),IR=He({"src/traces/densitymap/hover.js"(Y,G){var d=io(),x=fx().hoverPoints,A=fx().getExtraText;G.exports=function(e,t,r){var o=x(e,t,r);if(o){var a=o[0],i=a.cd,n=i[0].trace,s=i[a.index];if(delete a.color,"z"in s){var c=a.subplot.mockAxis;a.z=s.z,a.zLabel=d.tickText(c,c.c2l(s.z),"hover").text}return a.extraText=A(n,s,i[0].t.labels),[a]}}}}),RR=He({"src/traces/densitymap/event_data.js"(Y,G){G.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x.z=A.z,x}}}),DR=He({"src/traces/densitymap/index.js"(Y,G){G.exports={attributes:ZT(),supplyDefaults:kR(),colorbar:Zd(),formatLabels:qT(),calc:CR(),plot:PR(),hoverPoints:IR(),eventData:RR(),getBelow:function(d,x){for(var A=x.getMapLayers(),E=0;E0;){l=b[b.length-1];var S=x[l];if(r[l]=0&&a[l].push(o[_])}r[l]=M}else{if(e[l]===E[l]){for(var w=[],p=[],u=0,M=y.length-1;M>=0;--M){var g=y[M];if(t[g]=!1,w.push(g),p.push(a[g]),u+=a[g].length,o[g]=s.length,g===l){y.length=M;break}}s.push(w);for(var m=new Array(u),M=0;M_&&(_=n.source[y]),n.target[y]>_&&(_=n.target[y]);var w=_+1;a.node._count=w;var p,u=a.node.groups,g={};for(y=0;y0&&e(B,w)&&e(O,w)&&!(g.hasOwnProperty(B)&&g.hasOwnProperty(O)&&g[B]===g[O])){g.hasOwnProperty(O)&&(O=g[O]),g.hasOwnProperty(B)&&(B=g[B]),B=+B,O=+O,h[B]=h[O]=!0;var L="";n.label&&n.label[y]&&(L=n.label[y]);var N=null;L&&T.hasOwnProperty(L)&&(N=T[L]),s.push({pointNumber:y,label:L,color:c?n.color[y]:n.color,hovercolor:f?n.hovercolor[y]:n.hovercolor,customdata:v?n.customdata[y]:n.customdata,concentrationscale:N,source:B,target:O,value:+F}),z.source.push(B),z.target.push(O)}}var U=w+u.length,Z=E(i.color),Q=E(i.customdata),ue=[];for(y=0;yw-1,childrenNodes:[],pointNumber:y,label:oe,color:Z?i.color[y]:i.color,customdata:Q?i.customdata[y]:i.customdata})}var le=!1;return o(U,z.source,z.target)&&(le=!0),{circular:le,links:s,nodes:ue,groups:u,groupLookup:g}}function o(a,i,n){for(var s=x.init2dArray(a,0),c=0;c1})}G.exports=function(i,n){var s=r(n);return A({circular:s.circular,_nodes:s.nodes,_links:s.links,_groups:s.groups,_groupLookup:s.groupLookup})}}}),BR=He({"node_modules/d3-quadtree/dist/d3-quadtree.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y):(d=d||self,x(d.d3=d.d3||{}))})(Y,function(d){function x(w){var p=+this._x.call(null,w),u=+this._y.call(null,w);return A(this.cover(p,u),p,u,w)}function A(w,p,u,g){if(isNaN(p)||isNaN(u))return w;var m,R=w._root,P={data:g},z=w._x0,F=w._y0,B=w._x1,O=w._y1,L,N,U,Z,Q,ue,oe,le;if(!R)return w._root=P,w;for(;R.length;)if((Q=p>=(L=(z+B)/2))?z=L:B=L,(ue=u>=(N=(F+O)/2))?F=N:O=N,m=R,!(R=R[oe=ue<<1|Q]))return m[oe]=P,w;if(U=+w._x.call(null,R.data),Z=+w._y.call(null,R.data),p===U&&u===Z)return P.next=R,m?m[oe]=P:w._root=P,w;do m=m?m[oe]=new Array(4):w._root=new Array(4),(Q=p>=(L=(z+B)/2))?z=L:B=L,(ue=u>=(N=(F+O)/2))?F=N:O=N;while((oe=ue<<1|Q)===(le=(Z>=N)<<1|U>=L));return m[le]=R,m[oe]=P,w}function E(w){var p,u,g=w.length,m,R,P=new Array(g),z=new Array(g),F=1/0,B=1/0,O=-1/0,L=-1/0;for(u=0;uO&&(O=m),RL&&(L=R));if(F>O||B>L)return this;for(this.cover(F,B).cover(O,L),u=0;uw||w>=m||g>p||p>=R;)switch(B=(pO||(z=Z.y0)>L||(F=Z.x1)=oe)<<1|w>=ue)&&(Z=N[N.length-1],N[N.length-1]=N[N.length-1-Q],N[N.length-1-Q]=Z)}else{var le=w-+this._x.call(null,U.data),j=p-+this._y.call(null,U.data),J=le*le+j*j;if(J=(N=(P+F)/2))?P=N:F=N,(Q=L>=(U=(z+B)/2))?z=U:B=U,p=u,!(u=u[ue=Q<<1|Z]))return this;if(!u.length)break;(p[ue+1&3]||p[ue+2&3]||p[ue+3&3])&&(g=p,oe=ue)}for(;u.data!==w;)if(m=u,!(u=u.next))return this;return(R=u.next)&&delete u.next,m?(R?m.next=R:delete m.next,this):p?(R?p[ue]=R:delete p[ue],(u=p[0]||p[1]||p[2]||p[3])&&u===(p[3]||p[2]||p[1]||p[0])&&!u.length&&(g?g[oe]=u:this._root=u),this):(this._root=R,this)}function n(w){for(var p=0,u=w.length;p=h.length)return l!=null&&_.sort(l),y!=null?y(_):_;for(var g=-1,m=_.length,R=h[w++],P,z,F=E(),B,O=p();++gh.length)return _;var p,u=T[w-1];return y!=null&&w>=h.length?p=_.entries():(p=[],_.each(function(g,m){p.push({key:m,values:M(g,w)})})),u!=null?p.sort(function(g,m){return u(g.key,m.key)}):p}return b={object:function(_){return S(_,0,t,r)},map:function(_){return S(_,0,o,a)},entries:function(_){return M(S(_,0,o,a),0)},key:function(_){return h.push(_),b},sortKeys:function(_){return T[h.length-1]=_,b},sortValues:function(_){return l=_,b},rollup:function(_){return y=_,b}}}function t(){return{}}function r(h,T,l){h[T]=l}function o(){return E()}function a(h,T,l){h.set(T,l)}function i(){}var n=E.prototype;i.prototype=s.prototype={constructor:i,has:n.has,add:function(h){return h+="",this[x+h]=h,this},remove:n.remove,clear:n.clear,values:n.keys,size:n.size,empty:n.empty,each:n.each};function s(h,T){var l=new i;if(h instanceof i)h.each(function(S){l.add(S)});else if(h){var y=-1,b=h.length;if(T==null)for(;++y=0&&(n=i.slice(s+1),i=i.slice(0,s)),i&&!a.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:n}})}E.prototype=A.prototype={constructor:E,on:function(o,a){var i=this._,n=e(o+"",i),s,c=-1,f=n.length;if(arguments.length<2){for(;++c0)for(var i=new Array(s),n=0,s,c;n=0&&w._call.call(null,p),w=w._next;--x}function l(){a=(o=n.now())+i,x=A=0;try{T()}finally{x=0,b(),a=0}}function y(){var w=n.now(),p=w-o;p>e&&(i-=p,o=w)}function b(){for(var w,p=t,u,g=1/0;p;)p._call?(g>p._time&&(g=p._time),w=p,p=p._next):(u=p._next,p._next=null,p=w?w._next=u:t=u);r=w,S(g)}function S(w){if(!x){A&&(A=clearTimeout(A));var p=w-a;p>24?(w<1/0&&(A=setTimeout(l,w-n.now()-i)),E&&(E=clearInterval(E))):(E||(o=n.now(),E=setInterval(y,e)),x=1,s(l))}}function M(w,p,u){var g=new v;return p=p==null?0:+p,g.restart(function(m){g.stop(),w(m+p)},p,u),g}function _(w,p,u){var g=new v,m=p;return p==null?(g.restart(w,p,u),g):(p=+p,u=u==null?c():+u,g.restart(function R(P){P+=m,g.restart(R,m+=p,u),w(P)},p,u),g)}d.interval=_,d.now=c,d.timeout=M,d.timer=h,d.timerFlush=T,Object.defineProperty(d,"__esModule",{value:!0})})}}),jR=He({"node_modules/d3-force/dist/d3-force.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y,BR(),vx(),NR(),UR()):x(d.d3=d.d3||{},d.d3,d.d3,d.d3,d.d3)})(Y,function(d,x,A,E,e){function t(w,p){var u;w==null&&(w=0),p==null&&(p=0);function g(){var m,R=u.length,P,z=0,F=0;for(m=0;mL.index){var ae=N-re.x-re.vx,ie=U-re.y-re.vy,fe=ae*ae+ie*ie;feN+q||$U+q||XF.r&&(F.r=F[B].r)}function z(){if(p){var F,B=p.length,O;for(u=new Array(B),F=0;F1?(Q==null?z.remove(Z):z.set(Z,U(Q)),p):z.get(Z)},find:function(Z,Q,ue){var oe=0,le=w.length,j,J,$,X,re;for(ue==null?ue=1/0:ue*=ue,oe=0;oe1?(B.on(Z,Q),p):B.on(Z)}}}function b(){var w,p,u,g=r(-30),m,R=1,P=1/0,z=.81;function F(N){var U,Z=w.length,Q=x.quadtree(w,v,h).visitAfter(O);for(u=N,U=0;U=P)return;(N.data!==p||N.next)&&(ue===0&&(ue=o(),j+=ue*ue),oe===0&&(oe=o(),j+=oe*oe),jE)if(!(Math.abs(l*v-h*T)>E)||!s)this._+="L"+(this._x1=o)+","+(this._y1=a);else{var b=i-c,S=n-f,M=v*v+h*h,_=b*b+S*S,w=Math.sqrt(M),p=Math.sqrt(y),u=s*Math.tan((x-Math.acos((M+y-_)/(2*w*p)))/2),g=u/p,m=u/w;Math.abs(g-1)>E&&(this._+="L"+(o+g*T)+","+(a+g*l)),this._+="A"+s+","+s+",0,0,"+ +(l*b>T*S)+","+(this._x1=o+m*v)+","+(this._y1=a+m*h)}},arc:function(o,a,i,n,s,c){o=+o,a=+a,i=+i,c=!!c;var f=i*Math.cos(n),v=i*Math.sin(n),h=o+f,T=a+v,l=1^c,y=c?n-s:s-n;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+h+","+T:(Math.abs(this._x1-h)>E||Math.abs(this._y1-T)>E)&&(this._+="L"+h+","+T),i&&(y<0&&(y=y%A+A),y>e?this._+="A"+i+","+i+",0,1,"+l+","+(o-f)+","+(a-v)+"A"+i+","+i+",0,1,"+l+","+(this._x1=h)+","+(this._y1=T):y>E&&(this._+="A"+i+","+i+",0,"+ +(y>=x)+","+l+","+(this._x1=o+i*Math.cos(s))+","+(this._y1=a+i*Math.sin(s))))},rect:function(o,a,i,n){this._+="M"+(this._x0=this._x1=+o)+","+(this._y0=this._y1=+a)+"h"+ +i+"v"+ +n+"h"+-i+"Z"},toString:function(){return this._}},d.path=r,Object.defineProperty(d,"__esModule",{value:!0})})}}),KT=He({"node_modules/d3-shape/dist/d3-shape.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y,VR()):(d=d||self,x(d.d3=d.d3||{},d.d3))})(Y,function(d,x){function A(wt){return function(){return wt}}var E=Math.abs,e=Math.atan2,t=Math.cos,r=Math.max,o=Math.min,a=Math.sin,i=Math.sqrt,n=1e-12,s=Math.PI,c=s/2,f=2*s;function v(wt){return wt>1?0:wt<-1?s:Math.acos(wt)}function h(wt){return wt>=1?c:wt<=-1?-c:Math.asin(wt)}function T(wt){return wt.innerRadius}function l(wt){return wt.outerRadius}function y(wt){return wt.startAngle}function b(wt){return wt.endAngle}function S(wt){return wt&&wt.padAngle}function M(wt,Qt,mr,$r,oa,Sa,ya,ra){var pa=mr-wt,pn=$r-Qt,Ga=ya-oa,qn=ra-Sa,Vn=qn*pa-Ga*pn;if(!(Vn*Vnbs*bs+as*as&&(xi=So,Ao=Ro),{cx:xi,cy:Ao,x01:-Ga,y01:-qn,x11:xi*(oa/Wo-1),y11:Ao*(oa/Wo-1)}}function w(){var wt=T,Qt=l,mr=A(0),$r=null,oa=y,Sa=b,ya=S,ra=null;function pa(){var pn,Ga,qn=+wt.apply(this,arguments),Vn=+Qt.apply(this,arguments),di=oa.apply(this,arguments)-c,yi=Sa.apply(this,arguments)-c,Ci=E(yi-di),ci=yi>di;if(ra||(ra=pn=x.path()),Vnn))ra.moveTo(0,0);else if(Ci>f-n)ra.moveTo(Vn*t(di),Vn*a(di)),ra.arc(0,0,Vn,di,yi,!ci),qn>n&&(ra.moveTo(qn*t(yi),qn*a(yi)),ra.arc(0,0,qn,yi,di,ci));else{var ei=di,mi=yi,uo=di,Lo=yi,Wo=Ci,li=Ci,Ii=ya.apply(this,arguments)/2,xi=Ii>n&&($r?+$r.apply(this,arguments):i(qn*qn+Vn*Vn)),Ao=o(E(Vn-qn)/2,+mr.apply(this,arguments)),So=Ao,Ro=Ao,Li,Yi;if(xi>n){var bs=h(xi/qn*a(Ii)),as=h(xi/Vn*a(Ii));(Wo-=bs*2)>n?(bs*=ci?1:-1,uo+=bs,Lo-=bs):(Wo=0,uo=Lo=(di+yi)/2),(li-=as*2)>n?(as*=ci?1:-1,ei+=as,mi-=as):(li=0,ei=mi=(di+yi)/2)}var fs=Vn*t(ei),Co=Vn*a(ei),Qa=qn*t(Lo),Jn=qn*a(Lo);if(Ao>n){var Os=Vn*t(mi),ds=Vn*a(mi),Ui=qn*t(uo),ms=qn*a(uo),Mo;if(Cin?Ro>n?(Li=_(Ui,ms,fs,Co,Vn,Ro,ci),Yi=_(Os,ds,Qa,Jn,Vn,Ro,ci),ra.moveTo(Li.cx+Li.x01,Li.cy+Li.y01),Ron)||!(Wo>n)?ra.lineTo(Qa,Jn):So>n?(Li=_(Qa,Jn,Os,ds,qn,-So,ci),Yi=_(fs,Co,Ui,ms,qn,-So,ci),ra.lineTo(Li.cx+Li.x01,Li.cy+Li.y01),So=Vn;--di)ra.point(mi[di],uo[di]);ra.lineEnd(),ra.areaEnd()}ci&&(mi[qn]=+wt(Ci,qn,Ga),uo[qn]=+mr(Ci,qn,Ga),ra.point(Qt?+Qt(Ci,qn,Ga):mi[qn],$r?+$r(Ci,qn,Ga):uo[qn]))}if(ei)return ra=null,ei+""||null}function pn(){return R().defined(oa).curve(ya).context(Sa)}return pa.x=function(Ga){return arguments.length?(wt=typeof Ga=="function"?Ga:A(+Ga),Qt=null,pa):wt},pa.x0=function(Ga){return arguments.length?(wt=typeof Ga=="function"?Ga:A(+Ga),pa):wt},pa.x1=function(Ga){return arguments.length?(Qt=Ga==null?null:typeof Ga=="function"?Ga:A(+Ga),pa):Qt},pa.y=function(Ga){return arguments.length?(mr=typeof Ga=="function"?Ga:A(+Ga),$r=null,pa):mr},pa.y0=function(Ga){return arguments.length?(mr=typeof Ga=="function"?Ga:A(+Ga),pa):mr},pa.y1=function(Ga){return arguments.length?($r=Ga==null?null:typeof Ga=="function"?Ga:A(+Ga),pa):$r},pa.lineX0=pa.lineY0=function(){return pn().x(wt).y(mr)},pa.lineY1=function(){return pn().x(wt).y($r)},pa.lineX1=function(){return pn().x(Qt).y(mr)},pa.defined=function(Ga){return arguments.length?(oa=typeof Ga=="function"?Ga:A(!!Ga),pa):oa},pa.curve=function(Ga){return arguments.length?(ya=Ga,Sa!=null&&(ra=ya(Sa)),pa):ya},pa.context=function(Ga){return arguments.length?(Ga==null?Sa=ra=null:ra=ya(Sa=Ga),pa):Sa},pa}function z(wt,Qt){return Qtwt?1:Qt>=wt?0:NaN}function F(wt){return wt}function B(){var wt=F,Qt=z,mr=null,$r=A(0),oa=A(f),Sa=A(0);function ya(ra){var pa,pn=ra.length,Ga,qn,Vn=0,di=new Array(pn),yi=new Array(pn),Ci=+$r.apply(this,arguments),ci=Math.min(f,Math.max(-f,oa.apply(this,arguments)-Ci)),ei,mi=Math.min(Math.abs(ci)/pn,Sa.apply(this,arguments)),uo=mi*(ci<0?-1:1),Lo;for(pa=0;pa0&&(Vn+=Lo);for(Qt!=null?di.sort(function(Wo,li){return Qt(yi[Wo],yi[li])}):mr!=null&&di.sort(function(Wo,li){return mr(ra[Wo],ra[li])}),pa=0,qn=Vn?(ci-pn*uo)/Vn:0;pa0?Lo*qn:0)+uo,yi[Ga]={data:ra[Ga],index:pa,value:Lo,startAngle:Ci,endAngle:ei,padAngle:mi};return yi}return ya.value=function(ra){return arguments.length?(wt=typeof ra=="function"?ra:A(+ra),ya):wt},ya.sortValues=function(ra){return arguments.length?(Qt=ra,mr=null,ya):Qt},ya.sort=function(ra){return arguments.length?(mr=ra,Qt=null,ya):mr},ya.startAngle=function(ra){return arguments.length?($r=typeof ra=="function"?ra:A(+ra),ya):$r},ya.endAngle=function(ra){return arguments.length?(oa=typeof ra=="function"?ra:A(+ra),ya):oa},ya.padAngle=function(ra){return arguments.length?(Sa=typeof ra=="function"?ra:A(+ra),ya):Sa},ya}var O=N(u);function L(wt){this._curve=wt}L.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(wt,Qt){this._curve.point(Qt*Math.sin(wt),Qt*-Math.cos(wt))}};function N(wt){function Qt(mr){return new L(wt(mr))}return Qt._curve=wt,Qt}function U(wt){var Qt=wt.curve;return wt.angle=wt.x,delete wt.x,wt.radius=wt.y,delete wt.y,wt.curve=function(mr){return arguments.length?Qt(N(mr)):Qt()._curve},wt}function Z(){return U(R().curve(O))}function Q(){var wt=P().curve(O),Qt=wt.curve,mr=wt.lineX0,$r=wt.lineX1,oa=wt.lineY0,Sa=wt.lineY1;return wt.angle=wt.x,delete wt.x,wt.startAngle=wt.x0,delete wt.x0,wt.endAngle=wt.x1,delete wt.x1,wt.radius=wt.y,delete wt.y,wt.innerRadius=wt.y0,delete wt.y0,wt.outerRadius=wt.y1,delete wt.y1,wt.lineStartAngle=function(){return U(mr())},delete wt.lineX0,wt.lineEndAngle=function(){return U($r())},delete wt.lineX1,wt.lineInnerRadius=function(){return U(oa())},delete wt.lineY0,wt.lineOuterRadius=function(){return U(Sa())},delete wt.lineY1,wt.curve=function(ya){return arguments.length?Qt(N(ya)):Qt()._curve},wt}function ue(wt,Qt){return[(Qt=+Qt)*Math.cos(wt-=Math.PI/2),Qt*Math.sin(wt)]}var oe=Array.prototype.slice;function le(wt){return wt.source}function j(wt){return wt.target}function J(wt){var Qt=le,mr=j,$r=g,oa=m,Sa=null;function ya(){var ra,pa=oe.call(arguments),pn=Qt.apply(this,pa),Ga=mr.apply(this,pa);if(Sa||(Sa=ra=x.path()),wt(Sa,+$r.apply(this,(pa[0]=pn,pa)),+oa.apply(this,pa),+$r.apply(this,(pa[0]=Ga,pa)),+oa.apply(this,pa)),ra)return Sa=null,ra+""||null}return ya.source=function(ra){return arguments.length?(Qt=ra,ya):Qt},ya.target=function(ra){return arguments.length?(mr=ra,ya):mr},ya.x=function(ra){return arguments.length?($r=typeof ra=="function"?ra:A(+ra),ya):$r},ya.y=function(ra){return arguments.length?(oa=typeof ra=="function"?ra:A(+ra),ya):oa},ya.context=function(ra){return arguments.length?(Sa=ra??null,ya):Sa},ya}function $(wt,Qt,mr,$r,oa){wt.moveTo(Qt,mr),wt.bezierCurveTo(Qt=(Qt+$r)/2,mr,Qt,oa,$r,oa)}function X(wt,Qt,mr,$r,oa){wt.moveTo(Qt,mr),wt.bezierCurveTo(Qt,mr=(mr+oa)/2,$r,mr,$r,oa)}function re(wt,Qt,mr,$r,oa){var Sa=ue(Qt,mr),ya=ue(Qt,mr=(mr+oa)/2),ra=ue($r,mr),pa=ue($r,oa);wt.moveTo(Sa[0],Sa[1]),wt.bezierCurveTo(ya[0],ya[1],ra[0],ra[1],pa[0],pa[1])}function ee(){return J($)}function q(){return J(X)}function ae(){var wt=J(re);return wt.angle=wt.x,delete wt.x,wt.radius=wt.y,delete wt.y,wt}var ie={draw:function(wt,Qt){var mr=Math.sqrt(Qt/s);wt.moveTo(mr,0),wt.arc(0,0,mr,0,f)}},fe={draw:function(wt,Qt){var mr=Math.sqrt(Qt/5)/2;wt.moveTo(-3*mr,-mr),wt.lineTo(-mr,-mr),wt.lineTo(-mr,-3*mr),wt.lineTo(mr,-3*mr),wt.lineTo(mr,-mr),wt.lineTo(3*mr,-mr),wt.lineTo(3*mr,mr),wt.lineTo(mr,mr),wt.lineTo(mr,3*mr),wt.lineTo(-mr,3*mr),wt.lineTo(-mr,mr),wt.lineTo(-3*mr,mr),wt.closePath()}},we=Math.sqrt(1/3),Ae=we*2,Fe={draw:function(wt,Qt){var mr=Math.sqrt(Qt/Ae),$r=mr*we;wt.moveTo(0,-mr),wt.lineTo($r,0),wt.lineTo(0,mr),wt.lineTo(-$r,0),wt.closePath()}},Ce=.8908130915292852,qe=Math.sin(s/10)/Math.sin(7*s/10),et=Math.sin(f/10)*qe,Qe=-Math.cos(f/10)*qe,Ke={draw:function(wt,Qt){var mr=Math.sqrt(Qt*Ce),$r=et*mr,oa=Qe*mr;wt.moveTo(0,-mr),wt.lineTo($r,oa);for(var Sa=1;Sa<5;++Sa){var ya=f*Sa/5,ra=Math.cos(ya),pa=Math.sin(ya);wt.lineTo(pa*mr,-ra*mr),wt.lineTo(ra*$r-pa*oa,pa*$r+ra*oa)}wt.closePath()}},Xe={draw:function(wt,Qt){var mr=Math.sqrt(Qt),$r=-mr/2;wt.rect($r,$r,mr,mr)}},Me=Math.sqrt(3),xe={draw:function(wt,Qt){var mr=-Math.sqrt(Qt/(Me*3));wt.moveTo(0,mr*2),wt.lineTo(-Me*mr,-mr),wt.lineTo(Me*mr,-mr),wt.closePath()}},ce=-.5,Re=Math.sqrt(3)/2,$e=1/Math.sqrt(12),rt=($e/2+1)*3,Je={draw:function(wt,Qt){var mr=Math.sqrt(Qt/rt),$r=mr/2,oa=mr*$e,Sa=$r,ya=mr*$e+mr,ra=-Sa,pa=ya;wt.moveTo($r,oa),wt.lineTo(Sa,ya),wt.lineTo(ra,pa),wt.lineTo(ce*$r-Re*oa,Re*$r+ce*oa),wt.lineTo(ce*Sa-Re*ya,Re*Sa+ce*ya),wt.lineTo(ce*ra-Re*pa,Re*ra+ce*pa),wt.lineTo(ce*$r+Re*oa,ce*oa-Re*$r),wt.lineTo(ce*Sa+Re*ya,ce*ya-Re*Sa),wt.lineTo(ce*ra+Re*pa,ce*pa-Re*ra),wt.closePath()}},At=[ie,fe,Fe,Xe,Ke,xe,Je];function St(){var wt=A(ie),Qt=A(64),mr=null;function $r(){var oa;if(mr||(mr=oa=x.path()),wt.apply(this,arguments).draw(mr,+Qt.apply(this,arguments)),oa)return mr=null,oa+""||null}return $r.type=function(oa){return arguments.length?(wt=typeof oa=="function"?oa:A(oa),$r):wt},$r.size=function(oa){return arguments.length?(Qt=typeof oa=="function"?oa:A(+oa),$r):Qt},$r.context=function(oa){return arguments.length?(mr=oa??null,$r):mr},$r}function Rt(){}function Ut(wt,Qt,mr){wt._context.bezierCurveTo((2*wt._x0+wt._x1)/3,(2*wt._y0+wt._y1)/3,(wt._x0+2*wt._x1)/3,(wt._y0+2*wt._y1)/3,(wt._x0+4*wt._x1+Qt)/6,(wt._y0+4*wt._y1+mr)/6)}function ir(wt){this._context=wt}ir.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:Ut(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(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1,this._line?this._context.lineTo(wt,Qt):this._context.moveTo(wt,Qt);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:Ut(this,wt,Qt);break}this._x0=this._x1,this._x1=wt,this._y0=this._y1,this._y1=Qt}};function ar(wt){return new ir(wt)}function Mr(wt){this._context=wt}Mr.prototype={areaStart:Rt,areaEnd:Rt,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(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1,this._x2=wt,this._y2=Qt;break;case 1:this._point=2,this._x3=wt,this._y3=Qt;break;case 2:this._point=3,this._x4=wt,this._y4=Qt,this._context.moveTo((this._x0+4*this._x1+wt)/6,(this._y0+4*this._y1+Qt)/6);break;default:Ut(this,wt,Qt);break}this._x0=this._x1,this._x1=wt,this._y0=this._y1,this._y1=Qt}};function fr(wt){return new Mr(wt)}function dr(wt){this._context=wt}dr.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(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var mr=(this._x0+4*this._x1+wt)/6,$r=(this._y0+4*this._y1+Qt)/6;this._line?this._context.lineTo(mr,$r):this._context.moveTo(mr,$r);break;case 3:this._point=4;default:Ut(this,wt,Qt);break}this._x0=this._x1,this._x1=wt,this._y0=this._y1,this._y1=Qt}};function pt(wt){return new dr(wt)}function ze(wt,Qt){this._basis=new ir(wt),this._beta=Qt}ze.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var wt=this._x,Qt=this._y,mr=wt.length-1;if(mr>0)for(var $r=wt[0],oa=Qt[0],Sa=wt[mr]-$r,ya=Qt[mr]-oa,ra=-1,pa;++ra<=mr;)pa=ra/mr,this._basis.point(this._beta*wt[ra]+(1-this._beta)*($r+pa*Sa),this._beta*Qt[ra]+(1-this._beta)*(oa+pa*ya));this._x=this._y=null,this._basis.lineEnd()},point:function(wt,Qt){this._x.push(+wt),this._y.push(+Qt)}};var Ge=function wt(Qt){function mr($r){return Qt===1?new ir($r):new ze($r,Qt)}return mr.beta=function($r){return wt(+$r)},mr}(.85);function Oe(wt,Qt,mr){wt._context.bezierCurveTo(wt._x1+wt._k*(wt._x2-wt._x0),wt._y1+wt._k*(wt._y2-wt._y0),wt._x2+wt._k*(wt._x1-Qt),wt._y2+wt._k*(wt._y1-mr),wt._x2,wt._y2)}function ve(wt,Qt){this._context=wt,this._k=(1-Qt)/6}ve.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:Oe(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1,this._line?this._context.lineTo(wt,Qt):this._context.moveTo(wt,Qt);break;case 1:this._point=2,this._x1=wt,this._y1=Qt;break;case 2:this._point=3;default:Oe(this,wt,Qt);break}this._x0=this._x1,this._x1=this._x2,this._x2=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var ge=function wt(Qt){function mr($r){return new ve($r,Qt)}return mr.tension=function($r){return wt(+$r)},mr}(0);function be(wt,Qt){this._context=wt,this._k=(1-Qt)/6}be.prototype={areaStart:Rt,areaEnd:Rt,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(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1,this._x3=wt,this._y3=Qt;break;case 1:this._point=2,this._context.moveTo(this._x4=wt,this._y4=Qt);break;case 2:this._point=3,this._x5=wt,this._y5=Qt;break;default:Oe(this,wt,Qt);break}this._x0=this._x1,this._x1=this._x2,this._x2=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var Pe=function wt(Qt){function mr($r){return new be($r,Qt)}return mr.tension=function($r){return wt(+$r)},mr}(0);function We(wt,Qt){this._context=wt,this._k=(1-Qt)/6}We.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(wt,Qt){switch(wt=+wt,Qt=+Qt,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:Oe(this,wt,Qt);break}this._x0=this._x1,this._x1=this._x2,this._x2=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var ct=function wt(Qt){function mr($r){return new We($r,Qt)}return mr.tension=function($r){return wt(+$r)},mr}(0);function _t(wt,Qt,mr){var $r=wt._x1,oa=wt._y1,Sa=wt._x2,ya=wt._y2;if(wt._l01_a>n){var ra=2*wt._l01_2a+3*wt._l01_a*wt._l12_a+wt._l12_2a,pa=3*wt._l01_a*(wt._l01_a+wt._l12_a);$r=($r*ra-wt._x0*wt._l12_2a+wt._x2*wt._l01_2a)/pa,oa=(oa*ra-wt._y0*wt._l12_2a+wt._y2*wt._l01_2a)/pa}if(wt._l23_a>n){var pn=2*wt._l23_2a+3*wt._l23_a*wt._l12_a+wt._l12_2a,Ga=3*wt._l23_a*(wt._l23_a+wt._l12_a);Sa=(Sa*pn+wt._x1*wt._l23_2a-Qt*wt._l12_2a)/Ga,ya=(ya*pn+wt._y1*wt._l23_2a-mr*wt._l12_2a)/Ga}wt._context.bezierCurveTo($r,oa,Sa,ya,wt._x2,wt._y2)}function Mt(wt,Qt){this._context=wt,this._alpha=Qt}Mt.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(wt,Qt){if(wt=+wt,Qt=+Qt,this._point){var mr=this._x2-wt,$r=this._y2-Qt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(mr*mr+$r*$r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(wt,Qt):this._context.moveTo(wt,Qt);break;case 1:this._point=2;break;case 2:this._point=3;default:_t(this,wt,Qt);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=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var Nt=function wt(Qt){function mr($r){return Qt?new Mt($r,Qt):new ve($r,0)}return mr.alpha=function($r){return wt(+$r)},mr}(.5);function Bt(wt,Qt){this._context=wt,this._alpha=Qt}Bt.prototype={areaStart:Rt,areaEnd:Rt,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(wt,Qt){if(wt=+wt,Qt=+Qt,this._point){var mr=this._x2-wt,$r=this._y2-Qt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(mr*mr+$r*$r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=wt,this._y3=Qt;break;case 1:this._point=2,this._context.moveTo(this._x4=wt,this._y4=Qt);break;case 2:this._point=3,this._x5=wt,this._y5=Qt;break;default:_t(this,wt,Qt);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=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var qt=function wt(Qt){function mr($r){return Qt?new Bt($r,Qt):new be($r,0)}return mr.alpha=function($r){return wt(+$r)},mr}(.5);function Zt(wt,Qt){this._context=wt,this._alpha=Qt}Zt.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(wt,Qt){if(wt=+wt,Qt=+Qt,this._point){var mr=this._x2-wt,$r=this._y2-Qt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(mr*mr+$r*$r,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:_t(this,wt,Qt);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=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var lr=function wt(Qt){function mr($r){return Qt?new Zt($r,Qt):new We($r,0)}return mr.alpha=function($r){return wt(+$r)},mr}(.5);function ta(wt){this._context=wt}ta.prototype={areaStart:Rt,areaEnd:Rt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(wt,Qt){wt=+wt,Qt=+Qt,this._point?this._context.lineTo(wt,Qt):(this._point=1,this._context.moveTo(wt,Qt))}};function da(wt){return new ta(wt)}function wa(wt){return wt<0?-1:1}function ma(wt,Qt,mr){var $r=wt._x1-wt._x0,oa=Qt-wt._x1,Sa=(wt._y1-wt._y0)/($r||oa<0&&-0),ya=(mr-wt._y1)/(oa||$r<0&&-0),ra=(Sa*oa+ya*$r)/($r+oa);return(wa(Sa)+wa(ya))*Math.min(Math.abs(Sa),Math.abs(ya),.5*Math.abs(ra))||0}function Ia(wt,Qt){var mr=wt._x1-wt._x0;return mr?(3*(wt._y1-wt._y0)/mr-Qt)/2:Qt}function va(wt,Qt,mr){var $r=wt._x0,oa=wt._y0,Sa=wt._x1,ya=wt._y1,ra=(Sa-$r)/3;wt._context.bezierCurveTo($r+ra,oa+ra*Qt,Sa-ra,ya-ra*mr,Sa,ya)}function La(wt){this._context=wt}La.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:va(this,this._t0,Ia(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(wt,Qt){var mr=NaN;if(wt=+wt,Qt=+Qt,!(wt===this._x1&&Qt===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(wt,Qt):this._context.moveTo(wt,Qt);break;case 1:this._point=2;break;case 2:this._point=3,va(this,Ia(this,mr=ma(this,wt,Qt)),mr);break;default:va(this,this._t0,mr=ma(this,wt,Qt));break}this._x0=this._x1,this._x1=wt,this._y0=this._y1,this._y1=Qt,this._t0=mr}}};function Ka(wt){this._context=new Vt(wt)}(Ka.prototype=Object.create(La.prototype)).point=function(wt,Qt){La.prototype.point.call(this,Qt,wt)};function Vt(wt){this._context=wt}Vt.prototype={moveTo:function(wt,Qt){this._context.moveTo(Qt,wt)},closePath:function(){this._context.closePath()},lineTo:function(wt,Qt){this._context.lineTo(Qt,wt)},bezierCurveTo:function(wt,Qt,mr,$r,oa,Sa){this._context.bezierCurveTo(Qt,wt,$r,mr,Sa,oa)}};function Lt(wt){return new La(wt)}function jt(wt){return new Ka(wt)}function Ot(wt){this._context=wt}Ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var wt=this._x,Qt=this._y,mr=wt.length;if(mr)if(this._line?this._context.lineTo(wt[0],Qt[0]):this._context.moveTo(wt[0],Qt[0]),mr===2)this._context.lineTo(wt[1],Qt[1]);else for(var $r=gr(wt),oa=gr(Qt),Sa=0,ya=1;ya=0;--Qt)oa[Qt]=(ya[Qt]-oa[Qt+1])/Sa[Qt];for(Sa[mr-1]=(wt[mr]+oa[mr-1])/2,Qt=0;Qt=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1,this._line?this._context.lineTo(wt,Qt):this._context.moveTo(wt,Qt);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,Qt),this._context.lineTo(wt,Qt);else{var mr=this._x*(1-this._t)+wt*this._t;this._context.lineTo(mr,this._y),this._context.lineTo(mr,Qt)}break}}this._x=wt,this._y=Qt}};function Ur(wt){return new na(wt,.5)}function ga(wt){return new na(wt,0)}function Aa(wt){return new na(wt,1)}function Pa(wt,Qt){if((ya=wt.length)>1)for(var mr=1,$r,oa,Sa=wt[Qt[0]],ya,ra=Sa.length;mr=0;)mr[Qt]=Qt;return mr}function Oa(wt,Qt){return wt[Qt]}function dt(){var wt=A([]),Qt=sa,mr=Pa,$r=Oa;function oa(Sa){var ya=wt.apply(this,arguments),ra,pa=Sa.length,pn=ya.length,Ga=new Array(pn),qn;for(ra=0;ra0){for(var mr,$r,oa=0,Sa=wt[0].length,ya;oa0)for(var mr,$r=0,oa,Sa,ya,ra,pa,pn=wt[Qt[0]].length;$r0?(oa[0]=ya,oa[1]=ya+=Sa):Sa<0?(oa[1]=ra,oa[0]=ra+=Sa):(oa[0]=0,oa[1]=Sa)}function Er(wt,Qt){if((oa=wt.length)>0){for(var mr=0,$r=wt[Qt[0]],oa,Sa=$r.length;mr0)||!((Sa=(oa=wt[Qt[0]]).length)>0))){for(var mr=0,$r=1,oa,Sa,ya;$rSa&&(Sa=oa,mr=Qt);return mr}function zr(wt){var Qt=wt.map(Pr);return sa(wt).sort(function(mr,$r){return Qt[mr]-Qt[$r]})}function Pr(wt){for(var Qt=0,mr=-1,$r=wt.length,oa;++mr<$r;)(oa=+wt[mr][1])&&(Qt+=oa);return Qt}function Hr(wt){return zr(wt).reverse()}function Zr(wt){var Qt=wt.length,mr,$r,oa=wt.map(Pr),Sa=yr(wt),ya=0,ra=0,pa=[],pn=[];for(mr=0;mr0;--re)ae(X*=.99),ie(),q(X),ie();function ee(){var fe=x.max($,function(Fe){return Fe.length}),we=U*(R-g)/(fe-1);z>we&&(z=we);var Ae=x.min($,function(Fe){return(R-g-(Fe.length-1)*z)/x.sum(Fe,f)});$.forEach(function(Fe){Fe.forEach(function(Ce,qe){Ce.y1=(Ce.y0=qe)+Ce.value*Ae})}),J.links.forEach(function(Fe){Fe.width=Fe.value*Ae})}function q(fe){$.forEach(function(we){we.forEach(function(Ae){if(Ae.targetLinks.length){var Fe=(x.sum(Ae.targetLinks,h)/x.sum(Ae.targetLinks,f)-v(Ae))*fe;Ae.y0+=Fe,Ae.y1+=Fe}})})}function ae(fe){$.slice().reverse().forEach(function(we){we.forEach(function(Ae){if(Ae.sourceLinks.length){var Fe=(x.sum(Ae.sourceLinks,T)/x.sum(Ae.sourceLinks,f)-v(Ae))*fe;Ae.y0+=Fe,Ae.y1+=Fe}})})}function ie(){$.forEach(function(fe){var we,Ae,Fe=g,Ce=fe.length,qe;for(fe.sort(c),qe=0;qe0&&(we.y0+=Ae,we.y1+=Ae),Fe=we.y1+z;if(Ae=Fe-z-R,Ae>0)for(Fe=we.y0-=Ae,we.y1-=Ae,qe=Ce-2;qe>=0;--qe)we=fe[qe],Ae=we.y1+z-Fe,Ae>0&&(we.y0-=Ae,we.y1-=Ae),Fe=we.y0})}}function j(J){J.nodes.forEach(function($){$.sourceLinks.sort(s),$.targetLinks.sort(n)}),J.nodes.forEach(function($){var X=$.y0,re=X;$.sourceLinks.forEach(function(ee){ee.y0=X+ee.width/2,X+=ee.width}),$.targetLinks.forEach(function(ee){ee.y1=re+ee.width/2,re+=ee.width})})}return Z};function _(u){return[u.source.x1,u.y0]}function w(u){return[u.target.x0,u.y1]}var p=function(){return E.linkHorizontal().source(_).target(w)};d.sankey=M,d.sankeyCenter=a,d.sankeyLeft=t,d.sankeyRight=r,d.sankeyJustify=o,d.sankeyLinkHorizontal=p,Object.defineProperty(d,"__esModule",{value:!0})})}}),HR=He({"node_modules/elementary-circuits-directed-graph/johnson.js"(Y,G){var d=YT();G.exports=function(A,E){var e=[],t=[],r=[],o={},a=[],i;function n(S){r[S]=!1,o.hasOwnProperty(S)&&Object.keys(o[S]).forEach(function(M){delete o[S][M],r[M]&&n(M)})}function s(S){var M=!1;t.push(S),r[S]=!0;var _,w;for(_=0;_=S})}function v(S){f(S);for(var M=A,_=d(M),w=_.components.filter(function(z){return z.length>1}),p=1/0,u,g=0;g"u"?"undefined":s(ve))!=="object"&&(ve=Ge.source=_(ze,ve)),(typeof ge>"u"?"undefined":s(ge))!=="object"&&(ge=Ge.target=_(ze,ge)),ve.sourceLinks.push(Ge),ge.targetLinks.push(Ge)}),pt}function Ut(pt){pt.nodes.forEach(function(ze){ze.partOfCycle=!1,ze.value=Math.max(x.sum(ze.sourceLinks,h),x.sum(ze.targetLinks,h)),ze.sourceLinks.forEach(function(Ge){Ge.circular&&(ze.partOfCycle=!0,ze.circularLinkType=Ge.circularLinkType)}),ze.targetLinks.forEach(function(Ge){Ge.circular&&(ze.partOfCycle=!0,ze.circularLinkType=Ge.circularLinkType)})})}function ir(pt){var ze=0,Ge=0,Oe=0,ve=0,ge=x.max(pt.nodes,function(be){return be.column});return pt.links.forEach(function(be){be.circular&&(be.circularLinkType=="top"?ze=ze+be.width:Ge=Ge+be.width,be.target.column==0&&(ve=ve+be.width),be.source.column==ge&&(Oe=Oe+be.width))}),ze=ze>0?ze+p+u:ze,Ge=Ge>0?Ge+p+u:Ge,Oe=Oe>0?Oe+p+u:Oe,ve=ve>0?ve+p+u:ve,{top:ze,bottom:Ge,left:ve,right:Oe}}function ar(pt,ze){var Ge=x.max(pt.nodes,function(ct){return ct.column}),Oe=et-Ce,ve=Qe-qe,ge=Oe+ze.right+ze.left,be=ve+ze.top+ze.bottom,Pe=Oe/ge,We=ve/be;return Ce=Ce*Pe+ze.left,et=ze.right==0?et:et*Pe,qe=qe*We+ze.top,Qe=Qe*We,pt.nodes.forEach(function(ct){ct.x0=Ce+ct.column*((et-Ce-Ke)/Ge),ct.x1=ct.x0+Ke}),We}function Mr(pt){var ze,Ge,Oe;for(ze=pt.nodes,Ge=[],Oe=0;ze.length;++Oe,ze=Ge,Ge=[])ze.forEach(function(ve){ve.depth=Oe,ve.sourceLinks.forEach(function(ge){Ge.indexOf(ge.target)<0&&!ge.circular&&Ge.push(ge.target)})});for(ze=pt.nodes,Ge=[],Oe=0;ze.length;++Oe,ze=Ge,Ge=[])ze.forEach(function(ve){ve.height=Oe,ve.targetLinks.forEach(function(ge){Ge.indexOf(ge.source)<0&&!ge.circular&&Ge.push(ge.source)})});pt.nodes.forEach(function(ve){ve.column=Math.floor(xe.call(null,ve,Oe))})}function fr(pt,ze,Ge){var Oe=A.nest().key(function(ct){return ct.column}).sortKeys(x.ascending).entries(pt.nodes).map(function(ct){return ct.values});be(Ge),We();for(var ve=1,ge=ze;ge>0;--ge)Pe(ve*=.99,Ge),We();function be(ct){if(Je){var _t=1/0;Oe.forEach(function(qt){var Zt=Qe*Je/(qt.length+1);_t=Zt<_t?Zt:_t}),Xe=_t}var Mt=x.min(Oe,function(qt){return(Qe-qe-(qt.length-1)*Xe)/x.sum(qt,h)});Mt=Mt*g,pt.links.forEach(function(qt){qt.width=qt.value*Mt});var Nt=ir(pt),Bt=ar(pt,Nt);Mt=Mt*Bt,pt.links.forEach(function(qt){qt.width=qt.value*Mt}),Oe.forEach(function(qt){var Zt=qt.length;qt.forEach(function(lr,ta){lr.depth==Oe.length-1&&Zt==1||lr.depth==0&&Zt==1?(lr.y0=Qe/2-lr.value*Mt,lr.y1=lr.y0+lr.value*Mt):lr.partOfCycle?B(lr,ct)==0?(lr.y0=Qe/2+ta,lr.y1=lr.y0+lr.value*Mt):lr.circularLinkType=="top"?(lr.y0=qe+ta,lr.y1=lr.y0+lr.value*Mt):(lr.y0=Qe-lr.value*Mt-ta,lr.y1=lr.y0+lr.value*Mt):Nt.top==0||Nt.bottom==0?(lr.y0=(Qe-qe)/Zt*ta,lr.y1=lr.y0+lr.value*Mt):(lr.y0=(Qe-qe)/2-Zt/2+ta,lr.y1=lr.y0+lr.value*Mt)})})}function Pe(ct,_t){var Mt=Oe.length;Oe.forEach(function(Nt){var Bt=Nt.length,qt=Nt[0].depth;Nt.forEach(function(Zt){var lr;if((Zt.sourceLinks.length||Zt.targetLinks.length)&&!(Zt.partOfCycle&&B(Zt,_t)>0))if(qt==0&&Bt==1)lr=Zt.y1-Zt.y0,Zt.y0=Qe/2-lr/2,Zt.y1=Qe/2+lr/2;else if(qt==Mt-1&&Bt==1)lr=Zt.y1-Zt.y0,Zt.y0=Qe/2-lr/2,Zt.y1=Qe/2+lr/2;else{var ta=0,da=x.mean(Zt.sourceLinks,y),wa=x.mean(Zt.targetLinks,l);da&&wa?ta=(da+wa)/2:ta=da||wa;var ma=(ta-T(Zt))*ct;Zt.y0+=ma,Zt.y1+=ma}})})}function We(){Oe.forEach(function(ct){var _t,Mt,Nt=qe,Bt=ct.length,qt;for(ct.sort(v),qt=0;qt0&&(_t.y0+=Mt,_t.y1+=Mt),Nt=_t.y1+Xe;if(Mt=Nt-Xe-Qe,Mt>0)for(Nt=_t.y0-=Mt,_t.y1-=Mt,qt=Bt-2;qt>=0;--qt)_t=ct[qt],Mt=_t.y1+Xe-Nt,Mt>0&&(_t.y0-=Mt,_t.y1-=Mt),Nt=_t.y0})}}function dr(pt){pt.nodes.forEach(function(ze){ze.sourceLinks.sort(f),ze.targetLinks.sort(c)}),pt.nodes.forEach(function(ze){var Ge=ze.y0,Oe=Ge,ve=ze.y1,ge=ve;ze.sourceLinks.forEach(function(be){be.circular?(be.y0=ve-be.width/2,ve=ve-be.width):(be.y0=Ge+be.width/2,Ge+=be.width)}),ze.targetLinks.forEach(function(be){be.circular?(be.y1=ge-be.width/2,ge=ge-be.width):(be.y1=Oe+be.width/2,Oe+=be.width)})})}return St}function R(Ce,qe,et){var Qe=0;if(et===null){for(var Ke=[],Xe=0;Xeqe.source.column)}function B(Ce,qe){var et=0;Ce.sourceLinks.forEach(function(Ke){et=Ke.circular&&!Ae(Ke,qe)?et+1:et});var Qe=0;return Ce.targetLinks.forEach(function(Ke){Qe=Ke.circular&&!Ae(Ke,qe)?Qe+1:Qe}),et+Qe}function O(Ce){var qe=Ce.source.sourceLinks,et=0;qe.forEach(function(Xe){et=Xe.circular?et+1:et});var Qe=Ce.target.targetLinks,Ke=0;return Qe.forEach(function(Xe){Ke=Xe.circular?Ke+1:Ke}),!(et>1||Ke>1)}function L(Ce,qe,et){return Ce.sort(Z),Ce.forEach(function(Qe,Ke){var Xe=0;if(Ae(Qe,et)&&O(Qe))Qe.circularPathData.verticalBuffer=Xe+Qe.width/2;else{var Me=0;for(Me;MeXe?xe:Xe}Qe.circularPathData.verticalBuffer=Xe+Qe.width/2}}),Ce}function N(Ce,qe,et,Qe){var Ke=5,Xe=x.min(Ce.links,function(ce){return ce.source.y0});Ce.links.forEach(function(ce){ce.circular&&(ce.circularPathData={})});var Me=Ce.links.filter(function(ce){return ce.circularLinkType=="top"});L(Me,qe,Qe);var xe=Ce.links.filter(function(ce){return ce.circularLinkType=="bottom"});L(xe,qe,Qe),Ce.links.forEach(function(ce){if(ce.circular){if(ce.circularPathData.arcRadius=ce.width+u,ce.circularPathData.leftNodeBuffer=Ke,ce.circularPathData.rightNodeBuffer=Ke,ce.circularPathData.sourceWidth=ce.source.x1-ce.source.x0,ce.circularPathData.sourceX=ce.source.x0+ce.circularPathData.sourceWidth,ce.circularPathData.targetX=ce.target.x0,ce.circularPathData.sourceY=ce.y0,ce.circularPathData.targetY=ce.y1,Ae(ce,Qe)&&O(ce))ce.circularPathData.leftSmallArcRadius=u+ce.width/2,ce.circularPathData.leftLargeArcRadius=u+ce.width/2,ce.circularPathData.rightSmallArcRadius=u+ce.width/2,ce.circularPathData.rightLargeArcRadius=u+ce.width/2,ce.circularLinkType=="bottom"?(ce.circularPathData.verticalFullExtent=ce.source.y1+p+ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.rightLargeArcRadius):(ce.circularPathData.verticalFullExtent=ce.source.y0-p-ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.rightLargeArcRadius);else{var Re=ce.source.column,$e=ce.circularLinkType,rt=Ce.links.filter(function(St){return St.source.column==Re&&St.circularLinkType==$e});ce.circularLinkType=="bottom"?rt.sort(ue):rt.sort(Q);var Je=0;rt.forEach(function(St,Rt){St.circularLinkID==ce.circularLinkID&&(ce.circularPathData.leftSmallArcRadius=u+ce.width/2+Je,ce.circularPathData.leftLargeArcRadius=u+ce.width/2+Rt*qe+Je),Je=Je+St.width}),Re=ce.target.column,rt=Ce.links.filter(function(St){return St.target.column==Re&&St.circularLinkType==$e}),ce.circularLinkType=="bottom"?rt.sort(le):rt.sort(oe),Je=0,rt.forEach(function(St,Rt){St.circularLinkID==ce.circularLinkID&&(ce.circularPathData.rightSmallArcRadius=u+ce.width/2+Je,ce.circularPathData.rightLargeArcRadius=u+ce.width/2+Rt*qe+Je),Je=Je+St.width}),ce.circularLinkType=="bottom"?(ce.circularPathData.verticalFullExtent=Math.max(et,ce.source.y1,ce.target.y1)+p+ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.rightLargeArcRadius):(ce.circularPathData.verticalFullExtent=Xe-p-ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.rightLargeArcRadius)}ce.circularPathData.leftInnerExtent=ce.circularPathData.sourceX+ce.circularPathData.leftNodeBuffer,ce.circularPathData.rightInnerExtent=ce.circularPathData.targetX-ce.circularPathData.rightNodeBuffer,ce.circularPathData.leftFullExtent=ce.circularPathData.sourceX+ce.circularPathData.leftLargeArcRadius+ce.circularPathData.leftNodeBuffer,ce.circularPathData.rightFullExtent=ce.circularPathData.targetX-ce.circularPathData.rightLargeArcRadius-ce.circularPathData.rightNodeBuffer}if(ce.circular)ce.path=U(ce);else{var At=E.linkHorizontal().source(function(St){var Rt=St.source.x0+(St.source.x1-St.source.x0),Ut=St.y0;return[Rt,Ut]}).target(function(St){var Rt=St.target.x0,Ut=St.y1;return[Rt,Ut]});ce.path=At(ce)}})}function U(Ce){var qe="";return Ce.circularLinkType=="top"?qe="M"+Ce.circularPathData.sourceX+" "+Ce.circularPathData.sourceY+" L"+Ce.circularPathData.leftInnerExtent+" "+Ce.circularPathData.sourceY+" A"+Ce.circularPathData.leftLargeArcRadius+" "+Ce.circularPathData.leftSmallArcRadius+" 0 0 0 "+Ce.circularPathData.leftFullExtent+" "+(Ce.circularPathData.sourceY-Ce.circularPathData.leftSmallArcRadius)+" L"+Ce.circularPathData.leftFullExtent+" "+Ce.circularPathData.verticalLeftInnerExtent+" A"+Ce.circularPathData.leftLargeArcRadius+" "+Ce.circularPathData.leftLargeArcRadius+" 0 0 0 "+Ce.circularPathData.leftInnerExtent+" "+Ce.circularPathData.verticalFullExtent+" L"+Ce.circularPathData.rightInnerExtent+" "+Ce.circularPathData.verticalFullExtent+" A"+Ce.circularPathData.rightLargeArcRadius+" "+Ce.circularPathData.rightLargeArcRadius+" 0 0 0 "+Ce.circularPathData.rightFullExtent+" "+Ce.circularPathData.verticalRightInnerExtent+" L"+Ce.circularPathData.rightFullExtent+" "+(Ce.circularPathData.targetY-Ce.circularPathData.rightSmallArcRadius)+" A"+Ce.circularPathData.rightLargeArcRadius+" "+Ce.circularPathData.rightSmallArcRadius+" 0 0 0 "+Ce.circularPathData.rightInnerExtent+" "+Ce.circularPathData.targetY+" L"+Ce.circularPathData.targetX+" "+Ce.circularPathData.targetY:qe="M"+Ce.circularPathData.sourceX+" "+Ce.circularPathData.sourceY+" L"+Ce.circularPathData.leftInnerExtent+" "+Ce.circularPathData.sourceY+" A"+Ce.circularPathData.leftLargeArcRadius+" "+Ce.circularPathData.leftSmallArcRadius+" 0 0 1 "+Ce.circularPathData.leftFullExtent+" "+(Ce.circularPathData.sourceY+Ce.circularPathData.leftSmallArcRadius)+" L"+Ce.circularPathData.leftFullExtent+" "+Ce.circularPathData.verticalLeftInnerExtent+" A"+Ce.circularPathData.leftLargeArcRadius+" "+Ce.circularPathData.leftLargeArcRadius+" 0 0 1 "+Ce.circularPathData.leftInnerExtent+" "+Ce.circularPathData.verticalFullExtent+" L"+Ce.circularPathData.rightInnerExtent+" "+Ce.circularPathData.verticalFullExtent+" A"+Ce.circularPathData.rightLargeArcRadius+" "+Ce.circularPathData.rightLargeArcRadius+" 0 0 1 "+Ce.circularPathData.rightFullExtent+" "+Ce.circularPathData.verticalRightInnerExtent+" L"+Ce.circularPathData.rightFullExtent+" "+(Ce.circularPathData.targetY+Ce.circularPathData.rightSmallArcRadius)+" A"+Ce.circularPathData.rightLargeArcRadius+" "+Ce.circularPathData.rightSmallArcRadius+" 0 0 1 "+Ce.circularPathData.rightInnerExtent+" "+Ce.circularPathData.targetY+" L"+Ce.circularPathData.targetX+" "+Ce.circularPathData.targetY,qe}function Z(Ce,qe){return j(Ce)==j(qe)?Ce.circularLinkType=="bottom"?ue(Ce,qe):Q(Ce,qe):j(qe)-j(Ce)}function Q(Ce,qe){return Ce.y0-qe.y0}function ue(Ce,qe){return qe.y0-Ce.y0}function oe(Ce,qe){return Ce.y1-qe.y1}function le(Ce,qe){return qe.y1-Ce.y1}function j(Ce){return Ce.target.column-Ce.source.column}function J(Ce){return Ce.target.x0-Ce.source.x1}function $(Ce,qe){var et=z(Ce),Qe=J(qe)/Math.tan(et),Ke=we(Ce)=="up"?Ce.y1+Qe:Ce.y1-Qe;return Ke}function X(Ce,qe){var et=z(Ce),Qe=J(qe)/Math.tan(et),Ke=we(Ce)=="up"?Ce.y1-Qe:Ce.y1+Qe;return Ke}function re(Ce,qe,et,Qe){Ce.links.forEach(function(Ke){if(!Ke.circular&&Ke.target.column-Ke.source.column>1){var Xe=Ke.source.column+1,Me=Ke.target.column-1,xe=1,ce=Me-Xe+1;for(xe=1;Xe<=Me;Xe++,xe++)Ce.nodes.forEach(function(Re){if(Re.column==Xe){var $e=xe/(ce+1),rt=Math.pow(1-$e,3),Je=3*$e*Math.pow(1-$e,2),At=3*Math.pow($e,2)*(1-$e),St=Math.pow($e,3),Rt=rt*Ke.y0+Je*Ke.y0+At*Ke.y1+St*Ke.y1,Ut=Rt-Ke.width/2,ir=Rt+Ke.width/2,ar;Ut>Re.y0&&UtRe.y0&&irRe.y1&&q(Mr,ar,qe,et)})):UtRe.y1&&(ar=ir-Re.y0+10,Re=q(Re,ar,qe,et),Ce.nodes.forEach(function(Mr){w(Mr,Qe)==w(Re,Qe)||Mr.column!=Re.column||Mr.y0Re.y1&&q(Mr,ar,qe,et)}))}})}})}function ee(Ce,qe){return Ce.y0>qe.y0&&Ce.y0qe.y0&&Ce.y1qe.y1}function q(Ce,qe,et,Qe){return Ce.y0+qe>=et&&Ce.y1+qe<=Qe&&(Ce.y0=Ce.y0+qe,Ce.y1=Ce.y1+qe,Ce.targetLinks.forEach(function(Ke){Ke.y1=Ke.y1+qe}),Ce.sourceLinks.forEach(function(Ke){Ke.y0=Ke.y0+qe})),Ce}function ae(Ce,qe,et,Qe){Ce.nodes.forEach(function(Ke){Qe&&Ke.y+(Ke.y1-Ke.y0)>qe&&(Ke.y=Ke.y-(Ke.y+(Ke.y1-Ke.y0)-qe));var Xe=Ce.links.filter(function(ce){return w(ce.source,et)==w(Ke,et)}),Me=Xe.length;Me>1&&Xe.sort(function(ce,Re){if(!ce.circular&&!Re.circular){if(ce.target.column==Re.target.column)return ce.y1-Re.y1;if(fe(ce,Re)){if(ce.target.column>Re.target.column){var $e=X(Re,ce);return ce.y1-$e}if(Re.target.column>ce.target.column){var rt=X(ce,Re);return rt-Re.y1}}else return ce.y1-Re.y1}if(ce.circular&&!Re.circular)return ce.circularLinkType=="top"?-1:1;if(Re.circular&&!ce.circular)return Re.circularLinkType=="top"?1:-1;if(ce.circular&&Re.circular)return ce.circularLinkType===Re.circularLinkType&&ce.circularLinkType=="top"?ce.target.column===Re.target.column?ce.target.y1-Re.target.y1:Re.target.column-ce.target.column:ce.circularLinkType===Re.circularLinkType&&ce.circularLinkType=="bottom"?ce.target.column===Re.target.column?Re.target.y1-ce.target.y1:ce.target.column-Re.target.column:ce.circularLinkType=="top"?-1:1});var xe=Ke.y0;Xe.forEach(function(ce){ce.y0=xe+ce.width/2,xe=xe+ce.width}),Xe.forEach(function(ce,Re){if(ce.circularLinkType=="bottom"){var $e=Re+1,rt=0;for($e;$e1&&Ke.sort(function(xe,ce){if(!xe.circular&&!ce.circular){if(xe.source.column==ce.source.column)return xe.y0-ce.y0;if(fe(xe,ce)){if(ce.source.column0?"up":"down"}function Ae(Ce,qe){return w(Ce.source,qe)==w(Ce.target,qe)}function Fe(Ce,qe,et){var Qe=Ce.nodes,Ke=Ce.links,Xe=!1,Me=!1;if(Ke.forEach(function(Je){Je.circularLinkType=="top"?Xe=!0:Je.circularLinkType=="bottom"&&(Me=!0)}),Xe==!1||Me==!1){var xe=x.min(Qe,function(Je){return Je.y0}),ce=x.max(Qe,function(Je){return Je.y1}),Re=ce-xe,$e=et-qe,rt=$e/Re;Qe.forEach(function(Je){var At=(Je.y1-Je.y0)*rt;Je.y0=(Je.y0-xe)*rt,Je.y1=Je.y0+At}),Ke.forEach(function(Je){Je.y0=(Je.y0-xe)*rt,Je.y1=(Je.y1-xe)*rt,Je.width=Je.width*rt})}}d.sankeyCircular=m,d.sankeyCenter=i,d.sankeyLeft=r,d.sankeyRight=o,d.sankeyJustify=a,Object.defineProperty(d,"__esModule",{value:!0})})}}),JT=He({"src/traces/sankey/constants.js"(Y,G){G.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"}}}}),WR=He({"src/traces/sankey/render.js"(Y,G){var d=jR(),x=(Gp(),Go(tp)).interpolateNumber,A=Qn(),E=qR(),e=GR(),t=JT(),r=Mf(),o=Ai(),a=vo(),i=Gr(),n=i.strTranslate,s=i.strRotate,c=Wv(),f=c.keyFun,v=c.repeat,h=c.unwrap,T=yl(),l=Ei(),y=df(),b=y.CAP_SHIFT,S=y.LINE_SPACING,M=3;function _($,X,re){var ee=h(X),q=ee.trace,ae=q.domain,ie=q.orientation==="h",fe=q.node.pad,we=q.node.thickness,Ae={justify:E.sankeyJustify,left:E.sankeyLeft,right:E.sankeyRight,center:E.sankeyCenter}[q.node.align],Fe=$.width*(ae.x[1]-ae.x[0]),Ce=$.height*(ae.y[1]-ae.y[0]),qe=ee._nodes,et=ee._links,Qe=ee.circular,Ke;Qe?Ke=e.sankeyCircular().circularLinkGap(0):Ke=E.sankey(),Ke.iterations(t.sankeyIterations).size(ie?[Fe,Ce]:[Ce,Fe]).nodeWidth(we).nodePadding(fe).nodeId(function(Mr){return Mr.pointNumber}).nodeAlign(Ae).nodes(qe).links(et);var Xe=Ke();Ke.nodePadding()=ze||(pt=ze-dr.y0,pt>1e-6&&(dr.y0+=pt,dr.y1+=pt)),ze=dr.y1+fe})}function Rt(Mr){var fr=Mr.map(function(ge,be){return{x0:ge.x0,index:be}}).sort(function(ge,be){return ge.x0-be.x0}),dr=[],pt=-1,ze,Ge=-1/0,Oe;for(Me=0;MeGe+we&&(pt+=1,ze=ve.x0),Ge=ve.x0,dr[pt]||(dr[pt]=[]),dr[pt].push(ve),Oe=ze-ve.x0,ve.x0+=Oe,ve.x1+=Oe}return dr}if(q.node.x.length&&q.node.y.length){for(Me=0;Me0?" L "+q.targetX+" "+q.targetY:"")+"Z"):(re="M "+(q.targetX-X)+" "+(q.targetY-ee)+" L "+(q.rightInnerExtent-X)+" "+(q.targetY-ee)+" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightSmallArcRadius+ee)+" 0 0 0 "+(q.rightFullExtent-ee-X)+" "+(q.targetY+q.rightSmallArcRadius)+" L "+(q.rightFullExtent-ee-X)+" "+q.verticalRightInnerExtent,ae&&ie?re+=" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightLargeArcRadius+ee)+" 0 0 0 "+(q.rightInnerExtent-ee-X)+" "+(q.verticalFullExtent+ee)+" L "+(q.rightFullExtent+ee-X-(q.rightLargeArcRadius-ee))+" "+(q.verticalFullExtent+ee)+" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightLargeArcRadius+ee)+" 0 0 0 "+(q.leftFullExtent+ee)+" "+q.verticalLeftInnerExtent:ae?re+=" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightSmallArcRadius-ee)+" 0 0 1 "+(q.rightFullExtent-X-ee-(q.rightLargeArcRadius-ee))+" "+(q.verticalFullExtent-ee)+" L "+(q.leftFullExtent+ee+(q.rightLargeArcRadius-ee))+" "+(q.verticalFullExtent-ee)+" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightSmallArcRadius-ee)+" 0 0 1 "+(q.leftFullExtent+ee)+" "+q.verticalLeftInnerExtent:re+=" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightLargeArcRadius+ee)+" 0 0 0 "+(q.rightInnerExtent-X)+" "+(q.verticalFullExtent+ee)+" L "+q.leftInnerExtent+" "+(q.verticalFullExtent+ee)+" A "+(q.leftLargeArcRadius+ee)+" "+(q.leftLargeArcRadius+ee)+" 0 0 0 "+(q.leftFullExtent+ee)+" "+q.verticalLeftInnerExtent,re+=" L "+(q.leftFullExtent+ee)+" "+(q.sourceY+q.leftSmallArcRadius)+" A "+(q.leftLargeArcRadius+ee)+" "+(q.leftSmallArcRadius+ee)+" 0 0 0 "+q.leftInnerExtent+" "+(q.sourceY-ee)+" L "+q.sourceX+" "+(q.sourceY-ee)+" L "+q.sourceX+" "+(q.sourceY+ee)+" L "+q.leftInnerExtent+" "+(q.sourceY+ee)+" A "+(q.leftLargeArcRadius-ee)+" "+(q.leftSmallArcRadius-ee)+" 0 0 1 "+(q.leftFullExtent-ee)+" "+(q.sourceY+q.leftSmallArcRadius)+" L "+(q.leftFullExtent-ee)+" "+q.verticalLeftInnerExtent,ae&&ie?re+=" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightSmallArcRadius-ee)+" 0 0 1 "+(q.leftFullExtent-ee-(q.rightLargeArcRadius-ee))+" "+(q.verticalFullExtent-ee)+" L "+(q.rightFullExtent+ee-X+(q.rightLargeArcRadius-ee))+" "+(q.verticalFullExtent-ee)+" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightSmallArcRadius-ee)+" 0 0 1 "+(q.rightFullExtent+ee-X)+" "+q.verticalRightInnerExtent:ae?re+=" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightLargeArcRadius+ee)+" 0 0 0 "+(q.leftFullExtent+ee)+" "+(q.verticalFullExtent+ee)+" L "+(q.rightFullExtent-X-ee)+" "+(q.verticalFullExtent+ee)+" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightLargeArcRadius+ee)+" 0 0 0 "+(q.rightFullExtent+ee-X)+" "+q.verticalRightInnerExtent:re+=" A "+(q.leftLargeArcRadius-ee)+" "+(q.leftLargeArcRadius-ee)+" 0 0 1 "+q.leftInnerExtent+" "+(q.verticalFullExtent-ee)+" L "+(q.rightInnerExtent-X)+" "+(q.verticalFullExtent-ee)+" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightLargeArcRadius-ee)+" 0 0 1 "+(q.rightFullExtent+ee-X)+" "+q.verticalRightInnerExtent,re+=" L "+(q.rightFullExtent+ee-X)+" "+(q.targetY+q.rightSmallArcRadius)+" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightSmallArcRadius-ee)+" 0 0 1 "+(q.rightInnerExtent-X)+" "+(q.targetY+ee)+" L "+(q.targetX-X)+" "+(q.targetY+ee)+(X>0?" L "+q.targetX+" "+q.targetY:"")+"Z"),re}function u(){var $=.5;function X(re){var ee=re.linkArrowLength;if(re.link.circular)return p(re.link,ee);var q=Math.abs((re.link.target.x0-re.link.source.x1)/2);ee>q&&(ee=q);var ae=re.link.source.x1,ie=re.link.target.x0-ee,fe=x(ae,ie),we=fe($),Ae=fe(1-$),Fe=re.link.y0-re.link.width/2,Ce=re.link.y0+re.link.width/2,qe=re.link.y1-re.link.width/2,et=re.link.y1+re.link.width/2,Qe="M"+ae+","+Fe,Ke="C"+we+","+Fe+" "+Ae+","+qe+" "+ie+","+qe,Xe="C"+Ae+","+et+" "+we+","+Ce+" "+ae+","+Ce,Me=ee>0?"L"+(ie+ee)+","+(qe+re.link.width/2):"";return Me+="L"+ie+","+et,Qe+Ke+Me+Xe+"Z"}return X}function g($,X){var re=r(X.color),ee=t.nodePadAcross,q=$.nodePad/2;X.dx=X.x1-X.x0,X.dy=X.y1-X.y0;var ae=X.dx,ie=Math.max(.5,X.dy),fe="node_"+X.pointNumber;return X.group&&(fe=i.randstr()),X.trace=$.trace,X.curveNumber=$.trace.index,{index:X.pointNumber,key:fe,partOfGroup:X.partOfGroup||!1,group:X.group,traceId:$.key,trace:$.trace,node:X,nodePad:$.nodePad,nodeLineColor:$.nodeLineColor,nodeLineWidth:$.nodeLineWidth,textFont:$.textFont,size:$.horizontal?$.height:$.width,visibleWidth:Math.ceil(ae),visibleHeight:ie,zoneX:-ee,zoneY:-q,zoneWidth:ae+2*ee,zoneHeight:ie+2*q,labelY:$.horizontal?X.dy/2+1:X.dx/2+1,left:X.originalLayer===1,sizeAcross:$.width,forceLayouts:$.forceLayouts,horizontal:$.horizontal,darkBackground:re.getBrightness()<=128,tinyColorHue:o.tinyRGB(re),tinyColorAlpha:re.getAlpha(),valueFormat:$.valueFormat,valueSuffix:$.valueSuffix,sankey:$.sankey,graph:$.graph,arrangement:$.arrangement,uniqueNodeLabelPathId:[$.guid,$.key,fe].join("_"),interactionState:$.interactionState,figure:$}}function m($){$.attr("transform",function(X){return n(X.node.x0.toFixed(3),X.node.y0.toFixed(3))})}function R($){$.call(m)}function P($,X){$.call(R),X.attr("d",u())}function z($){$.attr("width",function(X){return X.node.x1-X.node.x0}).attr("height",function(X){return X.visibleHeight})}function F($){return $.link.width>1||$.linkLineWidth>0}function B($){var X=n($.translateX,$.translateY);return X+($.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function O($,X,re){$.on(".basic",null).on("mouseover.basic",function(ee){!ee.interactionState.dragInProgress&&!ee.partOfGroup&&(re.hover(this,ee,X),ee.interactionState.hovered=[this,ee])}).on("mousemove.basic",function(ee){!ee.interactionState.dragInProgress&&!ee.partOfGroup&&(re.follow(this,ee),ee.interactionState.hovered=[this,ee])}).on("mouseout.basic",function(ee){!ee.interactionState.dragInProgress&&!ee.partOfGroup&&(re.unhover(this,ee,X),ee.interactionState.hovered=!1)}).on("click.basic",function(ee){ee.interactionState.hovered&&(re.unhover(this,ee,X),ee.interactionState.hovered=!1),!ee.interactionState.dragInProgress&&!ee.partOfGroup&&re.select(this,ee,X)})}function L($,X,re,ee){var q=A.behavior.drag().origin(function(ae){return{x:ae.node.x0+ae.visibleWidth/2,y:ae.node.y0+ae.visibleHeight/2}}).on("dragstart",function(ae){if(ae.arrangement!=="fixed"&&(i.ensureSingle(ee._fullLayout._infolayer,"g","dragcover",function(fe){ee._fullLayout._dragCover=fe}),i.raiseToTop(this),ae.interactionState.dragInProgress=ae.node,oe(ae.node),ae.interactionState.hovered&&(re.nodeEvents.unhover.apply(0,ae.interactionState.hovered),ae.interactionState.hovered=!1),ae.arrangement==="snap")){var ie=ae.traceId+"|"+ae.key;ae.forceLayouts[ie]?ae.forceLayouts[ie].alpha(1):N($,ie,ae),U($,X,ae,ie,ee)}}).on("drag",function(ae){if(ae.arrangement!=="fixed"){var ie=A.event.x,fe=A.event.y;ae.arrangement==="snap"?(ae.node.x0=ie-ae.visibleWidth/2,ae.node.x1=ie+ae.visibleWidth/2,ae.node.y0=fe-ae.visibleHeight/2,ae.node.y1=fe+ae.visibleHeight/2):(ae.arrangement==="freeform"&&(ae.node.x0=ie-ae.visibleWidth/2,ae.node.x1=ie+ae.visibleWidth/2),fe=Math.max(0,Math.min(ae.size-ae.visibleHeight/2,fe)),ae.node.y0=fe-ae.visibleHeight/2,ae.node.y1=fe+ae.visibleHeight/2),oe(ae.node),ae.arrangement!=="snap"&&(ae.sankey.update(ae.graph),P($.filter(le(ae)),X))}}).on("dragend",function(ae){if(ae.arrangement!=="fixed"){ae.interactionState.dragInProgress=!1;for(var ie=0;ie0)window.requestAnimationFrame(ae);else{var we=re.node.originalX;re.node.x0=we-re.visibleWidth/2,re.node.x1=we+re.visibleWidth/2,Q(re,q)}})}function Z($,X,re,ee){return function(){for(var ae=0,ie=0;ie0&&ee.forceLayouts[X].alpha(0)}}function Q($,X){for(var re=[],ee=[],q=0;q<$.graph.nodes.length;q++){var ae=($.graph.nodes[q].x0+$.graph.nodes[q].x1)/2,ie=($.graph.nodes[q].y0+$.graph.nodes[q].y1)/2;re.push(ae/$.figure.width),ee.push(ie/$.figure.height)}l.call("_guiRestyle",X,{"node.x":[re],"node.y":[ee]},$.trace.index).then(function(){X._fullLayout._dragCover&&X._fullLayout._dragCover.remove()})}function ue($){var X=[],re;for(re=0;re<$.length;re++)$[re].originalX=($[re].x0+$[re].x1)/2,$[re].originalY=($[re].y0+$[re].y1)/2,X.indexOf($[re].originalX)===-1&&X.push($[re].originalX);for(X.sort(function(ee,q){return ee-q}),re=0;re<$.length;re++)$[re].originalLayerIndex=X.indexOf($[re].originalX),$[re].originalLayer=$[re].originalLayerIndex/(X.length-1)}function oe($){$.lastDraggedX=$.x0+$.dx/2,$.lastDraggedY=$.y0+$.dy/2}function le($){return function(X){return X.node.originalX===$.node.originalX}}function j($){for(var X=0;X<$.length;X++)$[X].y=($[X].y0+$[X].y1)/2,$[X].x=($[X].x0+$[X].x1)/2}function J($){for(var X=0;X<$.length;X++)$[X].y0=$[X].y-$[X].dy/2,$[X].y1=$[X].y0+$[X].dy,$[X].x0=$[X].x-$[X].dx/2,$[X].x1=$[X].x0+$[X].dx}G.exports=function($,X,re,ee,q){var ae=$._context.staticPlot,ie=!1;i.ensureSingle($._fullLayout._infolayer,"g","first-render",function(){ie=!0});var fe=$._fullLayout._dragCover,we=re.filter(function(Xe){return h(Xe).trace.visible}).map(_.bind(null,ee)),Ae=X.selectAll("."+t.cn.sankey).data(we,f);Ae.exit().remove(),Ae.enter().append("g").classed(t.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events",ae?"none":"auto").attr("transform",B),Ae.each(function(Xe,Me){$._fullData[Me]._sankey=Xe;var xe="bgsankey-"+Xe.trace.uid+"-"+Me;i.ensureSingle($._fullLayout._draggers,"rect",xe),$._fullData[Me]._bgRect=A.select("."+xe),$._fullData[Me]._bgRect.style("pointer-events",ae?"none":"all").attr("width",Xe.width).attr("height",Xe.height).attr("x",Xe.translateX).attr("y",Xe.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})}),Ae.transition().ease(t.ease).duration(t.duration).attr("transform",B);var Fe=Ae.selectAll("."+t.cn.sankeyLinks).data(v,f);Fe.enter().append("g").classed(t.cn.sankeyLinks,!0).style("fill","none");var Ce=Fe.selectAll("."+t.cn.sankeyLink).data(function(Xe){var Me=Xe.graph.links;return Me.filter(function(xe){return xe.value}).map(w.bind(null,Xe))},f);Ce.enter().append("path").classed(t.cn.sankeyLink,!0).call(O,Ae,q.linkEvents),Ce.style("stroke",function(Xe){return F(Xe)?o.tinyRGB(r(Xe.linkLineColor)):Xe.tinyColorHue}).style("stroke-opacity",function(Xe){return F(Xe)?o.opacity(Xe.linkLineColor):Xe.tinyColorAlpha}).style("fill",function(Xe){return Xe.tinyColorHue}).style("fill-opacity",function(Xe){return Xe.tinyColorAlpha}).style("stroke-width",function(Xe){return F(Xe)?Xe.linkLineWidth:1}).attr("d",u()),Ce.style("opacity",function(){return $._context.staticPlot||ie||fe?1:0}).transition().ease(t.ease).duration(t.duration).style("opacity",1),Ce.exit().transition().ease(t.ease).duration(t.duration).style("opacity",0).remove();var qe=Ae.selectAll("."+t.cn.sankeyNodeSet).data(v,f);qe.enter().append("g").classed(t.cn.sankeyNodeSet,!0),qe.style("cursor",function(Xe){switch(Xe.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var et=qe.selectAll("."+t.cn.sankeyNode).data(function(Xe){var Me=Xe.graph.nodes;return ue(Me),Me.map(g.bind(null,Xe))},f);et.enter().append("g").classed(t.cn.sankeyNode,!0).call(m).style("opacity",function(Xe){return($._context.staticPlot||ie)&&!Xe.partOfGroup?1:0}),et.call(O,Ae,q.nodeEvents).call(L,Ce,q,$),et.transition().ease(t.ease).duration(t.duration).call(m).style("opacity",function(Xe){return Xe.partOfGroup?0:1}),et.exit().transition().ease(t.ease).duration(t.duration).style("opacity",0).remove();var Qe=et.selectAll("."+t.cn.nodeRect).data(v);Qe.enter().append("rect").classed(t.cn.nodeRect,!0).call(z),Qe.style("stroke-width",function(Xe){return Xe.nodeLineWidth}).style("stroke",function(Xe){return o.tinyRGB(r(Xe.nodeLineColor))}).style("stroke-opacity",function(Xe){return o.opacity(Xe.nodeLineColor)}).style("fill",function(Xe){return Xe.tinyColorHue}).style("fill-opacity",function(Xe){return Xe.tinyColorAlpha}),Qe.transition().ease(t.ease).duration(t.duration).call(z);var Ke=et.selectAll("."+t.cn.nodeLabel).data(v);Ke.enter().append("text").classed(t.cn.nodeLabel,!0).style("cursor","default"),Ke.attr("data-notex",1).text(function(Xe){return Xe.node.label}).each(function(Xe){var Me=A.select(this);a.font(Me,Xe.textFont),T.convertToTspans(Me,$)}).attr("text-anchor",function(Xe){return Xe.horizontal&&Xe.left?"end":"start"}).attr("transform",function(Xe){var Me=A.select(this),xe=T.lineCount(Me),ce=Xe.textFont.size*((xe-1)*S-b),Re=Xe.nodeLineWidth/2+M,$e=((Xe.horizontal?Xe.visibleHeight:Xe.visibleWidth)-ce)/2;Xe.horizontal&&(Xe.left?Re=-Re:Re+=Xe.visibleWidth);var rt=Xe.horizontal?"":"scale(-1,1)"+s(90);return n(Xe.horizontal?Re:$e,Xe.horizontal?$e:Re)+rt}),Ke.transition().ease(t.ease).duration(t.duration)}}}),$T=He({"src/traces/sankey/plot.js"(Y,G){var d=Qn(),x=Gr(),A=x.numberFormat,E=WR(),e=Wu(),t=Ai(),r=JT().cn,o=x._;function a(b){return b!==""}function i(b,S){return b.filter(function(M){return M.key===S.traceId})}function n(b,S){d.select(b).select("path").style("fill-opacity",S),d.select(b).select("rect").style("fill-opacity",S)}function s(b){d.select(b).select("text.name").style("fill","black")}function c(b){return function(S){return b.node.sourceLinks.indexOf(S.link)!==-1||b.node.targetLinks.indexOf(S.link)!==-1}}function f(b){return function(S){return S.node.sourceLinks.indexOf(b.link)!==-1||S.node.targetLinks.indexOf(b.link)!==-1}}function v(b,S,M){S&&M&&i(M,S).selectAll("."+r.sankeyLink).filter(c(S)).call(T.bind(0,S,M,!1))}function h(b,S,M){S&&M&&i(M,S).selectAll("."+r.sankeyLink).filter(c(S)).call(l.bind(0,S,M,!1))}function T(b,S,M,_){_.style("fill",function(w){if(!w.link.concentrationscale)return w.tinyColorHoverHue}).style("fill-opacity",function(w){if(!w.link.concentrationscale)return w.tinyColorHoverAlpha}),_.each(function(w){var p=w.link.label;p!==""&&i(S,b).selectAll("."+r.sankeyLink).filter(function(u){return u.link.label===p}).style("fill",function(u){if(!u.link.concentrationscale)return u.tinyColorHoverHue}).style("fill-opacity",function(u){if(!u.link.concentrationscale)return u.tinyColorHoverAlpha})}),M&&i(S,b).selectAll("."+r.sankeyNode).filter(f(b)).call(v)}function l(b,S,M,_){_.style("fill",function(w){return w.tinyColorHue}).style("fill-opacity",function(w){return w.tinyColorAlpha}),_.each(function(w){var p=w.link.label;p!==""&&i(S,b).selectAll("."+r.sankeyLink).filter(function(u){return u.link.label===p}).style("fill",function(u){return u.tinyColorHue}).style("fill-opacity",function(u){return u.tinyColorAlpha})}),M&&i(S,b).selectAll(r.sankeyNode).filter(f(b)).call(h)}function y(b,S){var M=b.hoverlabel||{},_=x.nestedProperty(M,S).get();return Array.isArray(_)?!1:_}G.exports=function(S,M){for(var _=S._fullLayout,w=_._paper,p=_._size,u=0;u"),color:y(j,"bgcolor")||t.addOpacity(ee.color,1),borderColor:y(j,"bordercolor"),fontFamily:y(j,"font.family"),fontSize:y(j,"font.size"),fontColor:y(j,"font.color"),fontWeight:y(j,"font.weight"),fontStyle:y(j,"font.style"),fontVariant:y(j,"font.variant"),fontTextcase:y(j,"font.textcase"),fontLineposition:y(j,"font.lineposition"),fontShadow:y(j,"font.shadow"),nameLength:y(j,"namelength"),textAlign:y(j,"align"),idealAlign:d.event.x"),color:y(j,"bgcolor")||le.tinyColorHue,borderColor:y(j,"bordercolor"),fontFamily:y(j,"font.family"),fontSize:y(j,"font.size"),fontColor:y(j,"font.color"),fontWeight:y(j,"font.weight"),fontStyle:y(j,"font.style"),fontVariant:y(j,"font.variant"),fontTextcase:y(j,"font.textcase"),fontLineposition:y(j,"font.lineposition"),fontShadow:y(j,"font.shadow"),nameLength:y(j,"namelength"),textAlign:y(j,"align"),idealAlign:"left",hovertemplate:j.hovertemplate,hovertemplateLabels:ae,eventData:[le.node]},{container:_._hoverlayer.node(),outerContainer:_._paper.node(),gd:S});n(we,.85),s(we)}}},ue=function(oe,le,j){S._fullLayout.hovermode!==!1&&(d.select(oe).call(h,le,j),le.node.trace.node.hoverinfo!=="skip"&&(le.node.fullData=le.node.trace,S.emit("plotly_unhover",{event:d.event,points:[le.node]})),e.loneUnhover(_._hoverlayer.node()))};E(S,w,M,{width:p.w,height:p.h,margin:{t:p.t,r:p.r,b:p.b,l:p.l}},{linkEvents:{hover:R,follow:L,unhover:N,select:m},nodeEvents:{hover:Z,follow:Q,unhover:ue,select:U}})}}}),ZR=He({"src/traces/sankey/base_plot.js"(Y){var G=hu().overrideAll,d=Uf().getModuleCalcData,x=$T(),A=Od(),E=xv(),e=fh(),t=dc().prepSelect,r=Gr(),o=Ei(),a="sankey";Y.name=a,Y.baseLayoutAttrOverrides=G({hoverlabel:A.hoverlabel},"plot","nested"),Y.plot=function(n){var s=d(n.calcdata,a)[0];x(n,s),Y.updateFx(n)},Y.clean=function(n,s,c,f){var v=f._has&&f._has(a),h=s._has&&s._has(a);v&&!h&&(f._paperdiv.selectAll(".sankey").remove(),f._paperdiv.selectAll(".bgsankey").remove())},Y.updateFx=function(n){for(var s=0;s0}G.exports=function(F,B,O,L){var N=F._fullLayout,U;b(O)&&L&&(U=L()),E.makeTraceGroups(N._indicatorlayer,B,"trace").each(function(Z){var Q=Z[0],ue=Q.trace,oe=d.select(this),le=ue._hasGauge,j=ue._isAngular,J=ue._isBullet,$=ue.domain,X={w:N._size.w*($.x[1]-$.x[0]),h:N._size.h*($.y[1]-$.y[0]),l:N._size.l+N._size.w*$.x[0],r:N._size.r+N._size.w*(1-$.x[1]),t:N._size.t+N._size.h*(1-$.y[1]),b:N._size.b+N._size.h*$.y[0]},re=X.l+X.w/2,ee=X.t+X.h/2,q=Math.min(X.w/2,X.h),ae=i.innerRadius*q,ie,fe,we,Ae=ue.align||"center";if(fe=ee,!le)ie=X.l+l[Ae]*X.w,we=function(ce){return g(ce,X.w,X.h)};else if(j&&(ie=re,fe=ee+q/2,we=function(ce){return m(ce,.9*ae)}),J){var Fe=i.bulletPadding,Ce=1-i.bulletNumberDomainSize+Fe;ie=X.l+(Ce+(1-Ce)*l[Ae])*X.w,we=function(ce){return g(ce,(i.bulletNumberDomainSize-Fe)*X.w,X.h)}}_(F,oe,Z,{numbersX:ie,numbersY:fe,numbersScaler:we,transitionOpts:O,onComplete:U});var qe,et;le&&(qe={range:ue.gauge.axis.range,color:ue.gauge.bgcolor,line:{color:ue.gauge.bordercolor,width:0},thickness:1},et={range:ue.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:ue.gauge.bordercolor,width:ue.gauge.borderwidth},thickness:1});var Qe=oe.selectAll("g.angular").data(j?Z:[]);Qe.exit().remove();var Ke=oe.selectAll("g.angularaxis").data(j?Z:[]);Ke.exit().remove(),j&&M(F,oe,Z,{radius:q,innerRadius:ae,gauge:Qe,layer:Ke,size:X,gaugeBg:qe,gaugeOutline:et,transitionOpts:O,onComplete:U});var Xe=oe.selectAll("g.bullet").data(J?Z:[]);Xe.exit().remove();var Me=oe.selectAll("g.bulletaxis").data(J?Z:[]);Me.exit().remove(),J&&S(F,oe,Z,{gauge:Xe,layer:Me,size:X,gaugeBg:qe,gaugeOutline:et,transitionOpts:O,onComplete:U});var xe=oe.selectAll("text.title").data(Z);xe.exit().remove(),xe.enter().append("text").classed("title",!0),xe.attr("text-anchor",function(){return J?T.right:T[ue.title.align]}).text(ue.title.text).call(a.font,ue.title.font).call(n.convertToTspans,F),xe.attr("transform",function(){var ce=X.l+X.w*l[ue.title.align],Re,$e=i.titlePadding,rt=a.bBox(xe.node());if(le){if(j)if(ue.gauge.axis.visible){var Je=a.bBox(Ke.node());Re=Je.top-$e-rt.bottom}else Re=X.t+X.h/2-q/2-rt.bottom-$e;J&&(Re=fe-(rt.top+rt.bottom)/2,ce=X.l-i.bulletPadding*X.w)}else Re=ue._numbersTop-$e-rt.bottom;return t(ce,Re)})})};function S(z,F,B,O){var L=B[0].trace,N=O.gauge,U=O.layer,Z=O.gaugeBg,Q=O.gaugeOutline,ue=O.size,oe=L.domain,le=O.transitionOpts,j=O.onComplete,J,$,X,re,ee;N.enter().append("g").classed("bullet",!0),N.attr("transform",t(ue.l,ue.t)),U.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),U.selectAll("g.xbulletaxistick,path,text").remove();var q=ue.h,ae=L.gauge.bar.thickness*q,ie=oe.x[0],fe=oe.x[0]+(oe.x[1]-oe.x[0])*(L._hasNumber||L._hasDelta?1-i.bulletNumberDomainSize:1);J=u(z,L.gauge.axis),J._id="xbulletaxis",J.domain=[ie,fe],J.setScale(),$=s.calcTicks(J),X=s.makeTransTickFn(J),re=s.getTickSigns(J)[2],ee=ue.t+ue.h,J.visible&&(s.drawTicks(z,J,{vals:J.ticks==="inside"?s.clipEnds(J,$):$,layer:U,path:s.makeTickPath(J,ee,re),transFn:X}),s.drawLabels(z,J,{vals:$,layer:U,transFn:X,labelFns:s.makeLabelFns(J,ee)}));function we(Ke){Ke.attr("width",function(Xe){return Math.max(0,J.c2p(Xe.range[1])-J.c2p(Xe.range[0]))}).attr("x",function(Xe){return J.c2p(Xe.range[0])}).attr("y",function(Xe){return .5*(1-Xe.thickness)*q}).attr("height",function(Xe){return Xe.thickness*q})}var Ae=[Z].concat(L.gauge.steps),Fe=N.selectAll("g.bg-bullet").data(Ae);Fe.enter().append("g").classed("bg-bullet",!0).append("rect"),Fe.select("rect").call(we).call(w),Fe.exit().remove();var Ce=N.selectAll("g.value-bullet").data([L.gauge.bar]);Ce.enter().append("g").classed("value-bullet",!0).append("rect"),Ce.select("rect").attr("height",ae).attr("y",(q-ae)/2).call(w),b(le)?Ce.select("rect").transition().duration(le.duration).ease(le.easing).each("end",function(){j&&j()}).each("interrupt",function(){j&&j()}).attr("width",Math.max(0,J.c2p(Math.min(L.gauge.axis.range[1],B[0].y)))):Ce.select("rect").attr("width",typeof B[0].y=="number"?Math.max(0,J.c2p(Math.min(L.gauge.axis.range[1],B[0].y))):0),Ce.exit().remove();var qe=B.filter(function(){return L.gauge.threshold.value||L.gauge.threshold.value===0}),et=N.selectAll("g.threshold-bullet").data(qe);et.enter().append("g").classed("threshold-bullet",!0).append("line"),et.select("line").attr("x1",J.c2p(L.gauge.threshold.value)).attr("x2",J.c2p(L.gauge.threshold.value)).attr("y1",(1-L.gauge.threshold.thickness)/2*q).attr("y2",(1-(1-L.gauge.threshold.thickness)/2)*q).call(h.stroke,L.gauge.threshold.line.color).style("stroke-width",L.gauge.threshold.line.width),et.exit().remove();var Qe=N.selectAll("g.gauge-outline").data([Q]);Qe.enter().append("g").classed("gauge-outline",!0).append("rect"),Qe.select("rect").call(we).call(w),Qe.exit().remove()}function M(z,F,B,O){var L=B[0].trace,N=O.size,U=O.radius,Z=O.innerRadius,Q=O.gaugeBg,ue=O.gaugeOutline,oe=[N.l+N.w/2,N.t+N.h/2+U/2],le=O.gauge,j=O.layer,J=O.transitionOpts,$=O.onComplete,X=Math.PI/2;function re(At){var St=L.gauge.axis.range[0],Rt=L.gauge.axis.range[1],Ut=(At-St)/(Rt-St)*Math.PI-X;return Ut<-X?-X:Ut>X?X:Ut}function ee(At){return d.svg.arc().innerRadius((Z+U)/2-At/2*(U-Z)).outerRadius((Z+U)/2+At/2*(U-Z)).startAngle(-X)}function q(At){At.attr("d",function(St){return ee(St.thickness).startAngle(re(St.range[0])).endAngle(re(St.range[1]))()})}var ae,ie,fe,we;le.enter().append("g").classed("angular",!0),le.attr("transform",t(oe[0],oe[1])),j.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),j.selectAll("g.xangularaxistick,path,text").remove(),ae=u(z,L.gauge.axis),ae.type="linear",ae.range=L.gauge.axis.range,ae._id="xangularaxis",ae.ticklabeloverflow="allow",ae.setScale();var Ae=function(At){return(ae.range[0]-At.x)/(ae.range[1]-ae.range[0])*Math.PI+Math.PI},Fe={},Ce=s.makeLabelFns(ae,0),qe=Ce.labelStandoff;Fe.xFn=function(At){var St=Ae(At);return Math.cos(St)*qe},Fe.yFn=function(At){var St=Ae(At),Rt=Math.sin(St)>0?.2:1;return-Math.sin(St)*(qe+At.fontSize*Rt)+Math.abs(Math.cos(St))*(At.fontSize*o)},Fe.anchorFn=function(At){var St=Ae(At),Rt=Math.cos(St);return Math.abs(Rt)<.1?"middle":Rt>0?"start":"end"},Fe.heightFn=function(At,St,Rt){var Ut=Ae(At);return-.5*(1+Math.sin(Ut))*Rt};var et=function(At){return t(oe[0]+U*Math.cos(At),oe[1]-U*Math.sin(At))};fe=function(At){return et(Ae(At))};var Qe=function(At){var St=Ae(At);return et(St)+"rotate("+-r(St)+")"};if(ie=s.calcTicks(ae),we=s.getTickSigns(ae)[2],ae.visible){we=ae.ticks==="inside"?-1:1;var Ke=(ae.linewidth||1)/2;s.drawTicks(z,ae,{vals:ie,layer:j,path:"M"+we*Ke+",0h"+we*ae.ticklen,transFn:Qe}),s.drawLabels(z,ae,{vals:ie,layer:j,transFn:fe,labelFns:Fe})}var Xe=[Q].concat(L.gauge.steps),Me=le.selectAll("g.bg-arc").data(Xe);Me.enter().append("g").classed("bg-arc",!0).append("path"),Me.select("path").call(q).call(w),Me.exit().remove();var xe=ee(L.gauge.bar.thickness),ce=le.selectAll("g.value-arc").data([L.gauge.bar]);ce.enter().append("g").classed("value-arc",!0).append("path");var Re=ce.select("path");b(J)?(Re.transition().duration(J.duration).ease(J.easing).each("end",function(){$&&$()}).each("interrupt",function(){$&&$()}).attrTween("d",p(xe,re(B[0].lastY),re(B[0].y))),L._lastValue=B[0].y):Re.attr("d",typeof B[0].y=="number"?xe.endAngle(re(B[0].y)):"M0,0Z"),Re.call(w),ce.exit().remove(),Xe=[];var $e=L.gauge.threshold.value;($e||$e===0)&&Xe.push({range:[$e,$e],color:L.gauge.threshold.color,line:{color:L.gauge.threshold.line.color,width:L.gauge.threshold.line.width},thickness:L.gauge.threshold.thickness});var rt=le.selectAll("g.threshold-arc").data(Xe);rt.enter().append("g").classed("threshold-arc",!0).append("path"),rt.select("path").call(q).call(w),rt.exit().remove();var Je=le.selectAll("g.gauge-outline").data([ue]);Je.enter().append("g").classed("gauge-outline",!0).append("path"),Je.select("path").call(q).call(w),Je.exit().remove()}function _(z,F,B,O){var L=B[0].trace,N=O.numbersX,U=O.numbersY,Z=L.align||"center",Q=T[Z],ue=O.transitionOpts,oe=O.onComplete,le=E.ensureSingle(F,"g","numbers"),j,J,$,X=[];L._hasNumber&&X.push("number"),L._hasDelta&&(X.push("delta"),L.delta.position==="left"&&X.reverse());var re=le.selectAll("text").data(X);re.enter().append("text"),re.attr("text-anchor",function(){return Q}).attr("class",function(et){return et}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),re.exit().remove();function ee(et,Qe,Ke,Xe){if(et.match("s")&&Ke>=0!=Xe>=0&&!Qe(Ke).slice(-1).match(y)&&!Qe(Xe).slice(-1).match(y)){var Me=et.slice().replace("s","f").replace(/\d+/,function(ce){return parseInt(ce)-1}),xe=u(z,{tickformat:Me});return function(ce){return Math.abs(ce)<1?s.tickText(xe,ce).text:Qe(ce)}}else return Qe}function q(){var et=u(z,{tickformat:L.number.valueformat},L._range);et.setScale(),s.prepTicks(et);var Qe=function(ce){return s.tickText(et,ce).text},Ke=L.number.suffix,Xe=L.number.prefix,Me=le.select("text.number");function xe(){var ce=typeof B[0].y=="number"?Xe+Qe(B[0].y)+Ke:"-";Me.text(ce).call(a.font,L.number.font).call(n.convertToTspans,z)}return b(ue)?Me.transition().duration(ue.duration).ease(ue.easing).each("end",function(){xe(),oe&&oe()}).each("interrupt",function(){xe(),oe&&oe()}).attrTween("text",function(){var ce=d.select(this),Re=A(B[0].lastY,B[0].y);L._lastValue=B[0].y;var $e=ee(L.number.valueformat,Qe,B[0].lastY,B[0].y);return function(rt){ce.text(Xe+$e(Re(rt))+Ke)}}):xe(),j=R(Xe+Qe(B[0].y)+Ke,L.number.font,Q,z),Me}function ae(){var et=u(z,{tickformat:L.delta.valueformat},L._range);et.setScale(),s.prepTicks(et);var Qe=function(rt){return s.tickText(et,rt).text},Ke=L.delta.suffix,Xe=L.delta.prefix,Me=function(rt){var Je=L.delta.relative?rt.relativeDelta:rt.delta;return Je},xe=function(rt,Je){return rt===0||typeof rt!="number"||isNaN(rt)?"-":(rt>0?L.delta.increasing.symbol:L.delta.decreasing.symbol)+Xe+Je(rt)+Ke},ce=function(rt){return rt.delta>=0?L.delta.increasing.color:L.delta.decreasing.color};L._deltaLastValue===void 0&&(L._deltaLastValue=Me(B[0]));var Re=le.select("text.delta");Re.call(a.font,L.delta.font).call(h.fill,ce({delta:L._deltaLastValue}));function $e(){Re.text(xe(Me(B[0]),Qe)).call(h.fill,ce(B[0])).call(n.convertToTspans,z)}return b(ue)?Re.transition().duration(ue.duration).ease(ue.easing).tween("text",function(){var rt=d.select(this),Je=Me(B[0]),At=L._deltaLastValue,St=ee(L.delta.valueformat,Qe,At,Je),Rt=A(At,Je);return L._deltaLastValue=Je,function(Ut){rt.text(xe(Rt(Ut),St)),rt.call(h.fill,ce({delta:Rt(Ut)}))}}).each("end",function(){$e(),oe&&oe()}).each("interrupt",function(){$e(),oe&&oe()}):$e(),J=R(xe(Me(B[0]),Qe),L.delta.font,Q,z),Re}var ie=L.mode+L.align,fe;if(L._hasDelta&&(fe=ae(),ie+=L.delta.position+L.delta.font.size+L.delta.font.family+L.delta.valueformat,ie+=L.delta.increasing.symbol+L.delta.decreasing.symbol,$=J),L._hasNumber&&(q(),ie+=L.number.font.size+L.number.font.family+L.number.valueformat+L.number.suffix+L.number.prefix,$=j),L._hasDelta&&L._hasNumber){var we=[(j.left+j.right)/2,(j.top+j.bottom)/2],Ae=[(J.left+J.right)/2,(J.top+J.bottom)/2],Fe,Ce,qe=.75*L.delta.font.size;L.delta.position==="left"&&(Fe=P(L,"deltaPos",0,-1*(j.width*l[L.align]+J.width*(1-l[L.align])+qe),ie,Math.min),Ce=we[1]-Ae[1],$={width:j.width+J.width+qe,height:Math.max(j.height,J.height),left:J.left+Fe,right:j.right,top:Math.min(j.top,J.top+Ce),bottom:Math.max(j.bottom,J.bottom+Ce)}),L.delta.position==="right"&&(Fe=P(L,"deltaPos",0,j.width*(1-l[L.align])+J.width*l[L.align]+qe,ie,Math.max),Ce=we[1]-Ae[1],$={width:j.width+J.width+qe,height:Math.max(j.height,J.height),left:j.left,right:J.right+Fe,top:Math.min(j.top,J.top+Ce),bottom:Math.max(j.bottom,J.bottom+Ce)}),L.delta.position==="bottom"&&(Fe=null,Ce=J.height,$={width:Math.max(j.width,J.width),height:j.height+J.height,left:Math.min(j.left,J.left),right:Math.max(j.right,J.right),top:j.bottom-j.height,bottom:j.bottom+J.height}),L.delta.position==="top"&&(Fe=null,Ce=j.top,$={width:Math.max(j.width,J.width),height:j.height+J.height,left:Math.min(j.left,J.left),right:Math.max(j.right,J.right),top:j.bottom-j.height-J.height,bottom:j.bottom}),fe.attr({dx:Fe,dy:Ce})}(L._hasNumber||L._hasDelta)&&le.attr("transform",function(){var et=O.numbersScaler($);ie+=et[2];var Qe=P(L,"numbersScale",1,et[0],ie,Math.min),Ke;L._scaleNumbers||(Qe=1),L._isAngular?Ke=U-Qe*$.bottom:Ke=U-Qe*($.top+$.bottom)/2,L._numbersTop=Qe*$.top+Ke;var Xe=$[Z];Z==="center"&&(Xe=($.left+$.right)/2);var Me=N-Qe*Xe;return Me=P(L,"numbersTranslate",0,Me,ie,Math.max),t(Me,Ke)+e(Qe)})}function w(z){z.each(function(F){h.stroke(d.select(this),F.line.color)}).each(function(F){h.fill(d.select(this),F.color)}).style("stroke-width",function(F){return F.line.width})}function p(z,F,B){return function(){var O=x(F,B);return function(L){return z.endAngle(O(L))()}}}function u(z,F,B){var O=z._fullLayout,L=E.extendFlat({type:"linear",ticks:"outside",range:B,showline:!0},F),N={type:"linear",_id:"x"+F._id},U={letter:"x",font:O.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function Z(Q,ue){return E.coerce(L,N,v,Q,ue)}return c(L,N,Z,U,O),f(L,N,Z,U),N}function g(z,F,B){var O=Math.min(F/z.width,B/z.height);return[O,z,F+"x"+B]}function m(z,F){var B=Math.sqrt(z.width/2*(z.width/2)+z.height*z.height),O=F/B;return[O,z,F]}function R(z,F,B,O){var L=document.createElementNS("http://www.w3.org/2000/svg","text"),N=d.select(L);return N.text(z).attr("x",0).attr("y",0).attr("text-anchor",B).attr("data-unformatted",z).call(n.convertToTspans,O).call(a.font,F),a.bBox(N.node())}function P(z,F,B,O,L,N){var U="_cache"+F;z[U]&&z[U].key===L||(z[U]={key:L,value:B});var Z=E.aggNums(N,null,[z[U].value,O],2);return z[U].value=Z,Z}}}),tD=He({"src/traces/indicator/index.js"(Y,G){G.exports={moduleType:"trace",name:"indicator",basePlotModule:JR(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:QT(),supplyDefaults:$R().supplyDefaults,calc:QR().calc,plot:eD(),meta:{}}}}),rD=He({"lib/indicator.js"(Y,G){G.exports=tD()}}),tA=He({"src/traces/table/attributes.js"(Y,G){var d=Lp(),x=ho().extendFlat,A=hu().overrideAll,E=Yl(),e=mu().attributes,t=Gu().descriptionOnlyNumbers;G.exports=A({domain:e({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:x({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:x({},E({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:x({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:x({},E({arrayOk:!0}))}},"calc","from-root")}}),aD=He({"src/traces/table/defaults.js"(Y,G){var d=Gr(),x=tA(),A=mu().defaults;function E(e,t){for(var r=e.columnorder||[],o=e.header.values.length,a=r.slice(0,o),i=a.slice().sort(function(c,f){return c-f}),n=a.map(function(c){return i.indexOf(c)}),s=n.length;s",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"}}}}),iD=He({"src/traces/table/data_preparation_helper.js"(Y,G){var d=rA(),x=ho().extendFlat,A=Hi(),E=ch().isTypedArray,e=ch().isArrayOrTypedArray;G.exports=function(v,h){var T=o(h.cells.values),l=function(Q){return Q.slice(h.header.values.length,Q.length)},y=o(h.header.values);y.length&&!y[0].length&&(y[0]=[""],y=o(y));var b=y.concat(l(T).map(function(){return a((y[0]||[""]).length)})),S=h.domain,M=Math.floor(v._fullLayout._size.w*(S.x[1]-S.x[0])),_=Math.floor(v._fullLayout._size.h*(S.y[1]-S.y[0])),w=h.header.values.length?b[0].map(function(){return h.header.height}):[d.emptyHeaderHeight],p=T.length?T[0].map(function(){return h.cells.height}):[],u=w.reduce(r,0),g=_-u,m=g+d.uplift,R=s(p,m),P=s(w,u),z=n(P,[]),F=n(R,z),B={},O=h._fullInput.columnorder;e(O)&&(O=Array.from(O)),O=O.concat(l(T.map(function(Q,ue){return ue})));var L=b.map(function(Q,ue){var oe=e(h.columnwidth)?h.columnwidth[Math.min(ue,h.columnwidth.length-1)]:h.columnwidth;return A(oe)?Number(oe):1}),N=L.reduce(r,0);L=L.map(function(Q){return Q/N*M});var U=Math.max(t(h.header.line.width),t(h.cells.line.width)),Z={key:h.uid+v._context.staticPlot,translateX:S.x[0]*v._fullLayout._size.w,translateY:v._fullLayout._size.h*(1-S.y[1]),size:v._fullLayout._size,width:M,maxLineWidth:U,height:_,columnOrder:O,groupHeight:_,rowBlocks:F,headerRowBlocks:z,scrollY:0,cells:x({},h.cells,{values:T}),headerCells:x({},h.header,{values:b}),gdColumns:b.map(function(Q){return Q[0]}),gdColumnsOriginalOrder:b.map(function(Q){return Q[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:b.map(function(Q,ue){var oe=B[Q];B[Q]=(oe||0)+1;var le=Q+"__"+B[Q];return{key:le,label:Q,specIndex:ue,xIndex:O[ue],xScale:i,x:void 0,calcdata:void 0,columnWidth:L[ue]}})};return Z.columns.forEach(function(Q){Q.calcdata=Z,Q.x=i(Q)}),Z};function t(f){if(e(f)){for(var v=0,h=0;h=v||_===f.length-1)&&(h[l]=b,b.key=M++,b.firstRowIndex=S,b.lastRowIndex=_,b=c(),l+=y,S=_+1,y=0);return h}function c(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}}),oD=He({"src/traces/table/data_split_helpers.js"(Y){var G=ho().extendFlat;Y.splitToPanels=function(x){var A=[0,0],E=G({},x,{key:"header",type:"header",page:0,prevPages:A,currentRepaint:[null,null],dragHandle:!0,values:x.calcdata.headerCells.values[x.specIndex],rowBlocks:x.calcdata.headerRowBlocks,calcdata:G({},x.calcdata,{cells:x.calcdata.headerCells})}),e=G({},x,{key:"cells1",type:"cells",page:0,prevPages:A,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks}),t=G({},x,{key:"cells2",type:"cells",page:1,prevPages:A,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks});return[e,t,E]},Y.splitToCells=function(x){var A=d(x);return(x.values||[]).slice(A[0],A[1]).map(function(E,e){var t=typeof E=="string"&&E.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:e+t,key:A[0]+e,column:x,calcdata:x.calcdata,page:x.page,rowBlocks:x.rowBlocks,value:E}})};function d(x){var A=x.rowBlocks[x.page],E=A?A.rows[0].rowIndex:0,e=A?E+A.rows.length:0;return[E,e]}}}),aA=He({"src/traces/table/plot.js"(Y,G){var d=rA(),x=Qn(),A=Gr(),E=A.numberFormat,e=Wv(),t=vo(),r=yl(),o=Gr().raiseToTop,a=Gr().strTranslate,i=Gr().cancelTransition,n=iD(),s=oD(),c=Ai();G.exports=function(ie,fe){var we=!ie._context.staticPlot,Ae=ie._fullLayout._paper.selectAll("."+d.cn.table).data(fe.map(function(Je){var At=e.unwrap(Je),St=At.trace;return n(ie,St)}),e.keyFun);Ae.exit().remove(),Ae.enter().append("g").classed(d.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),Ae.attr("width",function(Je){return Je.width+Je.size.l+Je.size.r}).attr("height",function(Je){return Je.height+Je.size.t+Je.size.b}).attr("transform",function(Je){return a(Je.translateX,Je.translateY)});var Fe=Ae.selectAll("."+d.cn.tableControlView).data(e.repeat,e.keyFun),Ce=Fe.enter().append("g").classed(d.cn.tableControlView,!0).style("box-sizing","content-box");if(we){var qe="onwheel"in document?"wheel":"mousewheel";Ce.on("mousemove",function(Je){Fe.filter(function(At){return Je===At}).call(l,ie)}).on(qe,function(Je){if(!Je.scrollbarState.wheeling){Je.scrollbarState.wheeling=!0;var At=Je.scrollY+x.event.deltaY,St=Q(ie,Fe,null,At)(Je);St||(x.event.stopPropagation(),x.event.preventDefault()),Je.scrollbarState.wheeling=!1}}).call(l,ie,!0)}Fe.attr("transform",function(Je){return a(Je.size.l,Je.size.t)});var et=Fe.selectAll("."+d.cn.scrollBackground).data(e.repeat,e.keyFun);et.enter().append("rect").classed(d.cn.scrollBackground,!0).attr("fill","none"),et.attr("width",function(Je){return Je.width}).attr("height",function(Je){return Je.height}),Fe.each(function(Je){t.setClipUrl(x.select(this),v(ie,Je),ie)});var Qe=Fe.selectAll("."+d.cn.yColumn).data(function(Je){return Je.columns},e.keyFun);Qe.enter().append("g").classed(d.cn.yColumn,!0),Qe.exit().remove(),Qe.attr("transform",function(Je){return a(Je.x,0)}),we&&Qe.call(x.behavior.drag().origin(function(Je){var At=x.select(this);return B(At,Je,-d.uplift),o(this),Je.calcdata.columnDragInProgress=!0,l(Fe.filter(function(St){return Je.calcdata.key===St.key}),ie),Je}).on("drag",function(Je){var At=x.select(this),St=function(ir){return(Je===ir?x.event.x:ir.x)+ir.columnWidth/2};Je.x=Math.max(-d.overdrag,Math.min(Je.calcdata.width+d.overdrag-Je.columnWidth,x.event.x));var Rt=T(Qe).filter(function(ir){return ir.calcdata.key===Je.calcdata.key}),Ut=Rt.sort(function(ir,ar){return St(ir)-St(ar)});Ut.forEach(function(ir,ar){ir.xIndex=ar,ir.x=Je===ir?ir.x:ir.xScale(ir)}),Qe.filter(function(ir){return Je!==ir}).transition().ease(d.transitionEase).duration(d.transitionDuration).attr("transform",function(ir){return a(ir.x,0)}),At.call(i).attr("transform",a(Je.x,-d.uplift))}).on("dragend",function(Je){var At=x.select(this),St=Je.calcdata;Je.x=Je.xScale(Je),Je.calcdata.columnDragInProgress=!1,B(At,Je,0),z(ie,St,St.columns.map(function(Rt){return Rt.xIndex}))})),Qe.each(function(Je){t.setClipUrl(x.select(this),h(ie,Je),ie)});var Ke=Qe.selectAll("."+d.cn.columnBlock).data(s.splitToPanels,e.keyFun);Ke.enter().append("g").classed(d.cn.columnBlock,!0).attr("id",function(Je){return Je.key}),Ke.style("cursor",function(Je){return Je.dragHandle?"ew-resize":Je.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var Xe=Ke.filter(L),Me=Ke.filter(O);we&&Me.call(x.behavior.drag().origin(function(Je){return x.event.stopPropagation(),Je}).on("drag",Q(ie,Fe,-1)).on("dragend",function(){})),y(ie,Fe,Xe,Ke),y(ie,Fe,Me,Ke);var xe=Fe.selectAll("."+d.cn.scrollAreaClip).data(e.repeat,e.keyFun);xe.enter().append("clipPath").classed(d.cn.scrollAreaClip,!0).attr("id",function(Je){return v(ie,Je)});var ce=xe.selectAll("."+d.cn.scrollAreaClipRect).data(e.repeat,e.keyFun);ce.enter().append("rect").classed(d.cn.scrollAreaClipRect,!0).attr("x",-d.overdrag).attr("y",-d.uplift).attr("fill","none"),ce.attr("width",function(Je){return Je.width+2*d.overdrag}).attr("height",function(Je){return Je.height+d.uplift});var Re=Qe.selectAll("."+d.cn.columnBoundary).data(e.repeat,e.keyFun);Re.enter().append("g").classed(d.cn.columnBoundary,!0);var $e=Qe.selectAll("."+d.cn.columnBoundaryClippath).data(e.repeat,e.keyFun);$e.enter().append("clipPath").classed(d.cn.columnBoundaryClippath,!0),$e.attr("id",function(Je){return h(ie,Je)});var rt=$e.selectAll("."+d.cn.columnBoundaryRect).data(e.repeat,e.keyFun);rt.enter().append("rect").classed(d.cn.columnBoundaryRect,!0).attr("fill","none"),rt.attr("width",function(Je){return Je.columnWidth+2*f(Je)}).attr("height",function(Je){return Je.calcdata.height+2*f(Je)+d.uplift}).attr("x",function(Je){return-f(Je)}).attr("y",function(Je){return-f(Je)}),Z(null,Me,Fe)};function f(ae){return Math.ceil(ae.calcdata.maxLineWidth/2)}function v(ae,ie){return"clip"+ae._fullLayout._uid+"_scrollAreaBottomClip_"+ie.key}function h(ae,ie){return"clip"+ae._fullLayout._uid+"_columnBoundaryClippath_"+ie.calcdata.key+"_"+ie.specIndex}function T(ae){return[].concat.apply([],ae.map(function(ie){return ie})).map(function(ie){return ie.__data__})}function l(ae,ie,fe){function we(Qe){var Ke=Qe.rowBlocks;return $(Ke,Ke.length-1)+(Ke.length?X(Ke[Ke.length-1],1/0):1)}var Ae=ae.selectAll("."+d.cn.scrollbarKit).data(e.repeat,e.keyFun);Ae.enter().append("g").classed(d.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),Ae.each(function(Qe){var Ke=Qe.scrollbarState;Ke.totalHeight=we(Qe),Ke.scrollableAreaHeight=Qe.groupHeight-N(Qe),Ke.currentlyVisibleHeight=Math.min(Ke.totalHeight,Ke.scrollableAreaHeight),Ke.ratio=Ke.currentlyVisibleHeight/Ke.totalHeight,Ke.barLength=Math.max(Ke.ratio*Ke.currentlyVisibleHeight,d.goldenRatio*d.scrollbarWidth),Ke.barWiggleRoom=Ke.currentlyVisibleHeight-Ke.barLength,Ke.wiggleRoom=Math.max(0,Ke.totalHeight-Ke.scrollableAreaHeight),Ke.topY=Ke.barWiggleRoom===0?0:Qe.scrollY/Ke.wiggleRoom*Ke.barWiggleRoom,Ke.bottomY=Ke.topY+Ke.barLength,Ke.dragMultiplier=Ke.wiggleRoom/Ke.barWiggleRoom}).attr("transform",function(Qe){var Ke=Qe.width+d.scrollbarWidth/2+d.scrollbarOffset;return a(Ke,N(Qe))});var Fe=Ae.selectAll("."+d.cn.scrollbar).data(e.repeat,e.keyFun);Fe.enter().append("g").classed(d.cn.scrollbar,!0);var Ce=Fe.selectAll("."+d.cn.scrollbarSlider).data(e.repeat,e.keyFun);Ce.enter().append("g").classed(d.cn.scrollbarSlider,!0),Ce.attr("transform",function(Qe){return a(0,Qe.scrollbarState.topY||0)});var qe=Ce.selectAll("."+d.cn.scrollbarGlyph).data(e.repeat,e.keyFun);qe.enter().append("line").classed(d.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",d.scrollbarWidth).attr("stroke-linecap","round").attr("y1",d.scrollbarWidth/2),qe.attr("y2",function(Qe){return Qe.scrollbarState.barLength-d.scrollbarWidth/2}).attr("stroke-opacity",function(Qe){return Qe.columnDragInProgress||!Qe.scrollbarState.barWiggleRoom||fe?0:.4}),qe.transition().delay(0).duration(0),qe.transition().delay(d.scrollbarHideDelay).duration(d.scrollbarHideDuration).attr("stroke-opacity",0);var et=Fe.selectAll("."+d.cn.scrollbarCaptureZone).data(e.repeat,e.keyFun);et.enter().append("line").classed(d.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",d.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(Qe){var Ke=x.event.y,Xe=this.getBoundingClientRect(),Me=Qe.scrollbarState,xe=Ke-Xe.top,ce=x.scale.linear().domain([0,Me.scrollableAreaHeight]).range([0,Me.totalHeight]).clamp(!0);Me.topY<=xe&&xe<=Me.bottomY||Q(ie,ae,null,ce(xe-Me.barLength/2))(Qe)}).call(x.behavior.drag().origin(function(Qe){return x.event.stopPropagation(),Qe.scrollbarState.scrollbarScrollInProgress=!0,Qe}).on("drag",Q(ie,ae)).on("dragend",function(){})),et.attr("y2",function(Qe){return Qe.scrollbarState.scrollableAreaHeight}),ie._context.staticPlot&&(qe.remove(),et.remove())}function y(ae,ie,fe,we){var Ae=b(fe),Fe=S(Ae);p(Fe);var Ce=M(Fe);g(Ce);var qe=w(Fe),et=_(qe);u(et),m(et,ie,we,ae),J(Fe)}function b(ae){var ie=ae.selectAll("."+d.cn.columnCells).data(e.repeat,e.keyFun);return ie.enter().append("g").classed(d.cn.columnCells,!0),ie.exit().remove(),ie}function S(ae){var ie=ae.selectAll("."+d.cn.columnCell).data(s.splitToCells,function(fe){return fe.keyWithinBlock});return ie.enter().append("g").classed(d.cn.columnCell,!0),ie.exit().remove(),ie}function M(ae){var ie=ae.selectAll("."+d.cn.cellRect).data(e.repeat,function(fe){return fe.keyWithinBlock});return ie.enter().append("rect").classed(d.cn.cellRect,!0),ie}function _(ae){var ie=ae.selectAll("."+d.cn.cellText).data(e.repeat,function(fe){return fe.keyWithinBlock});return ie.enter().append("text").classed(d.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){x.event.stopPropagation()}),ie}function w(ae){var ie=ae.selectAll("."+d.cn.cellTextHolder).data(e.repeat,function(fe){return fe.keyWithinBlock});return ie.enter().append("g").classed(d.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),ie}function p(ae){ae.each(function(ie,fe){var we=ie.calcdata.cells.font,Ae=ie.column.specIndex,Fe={size:F(we.size,Ae,fe),color:F(we.color,Ae,fe),family:F(we.family,Ae,fe),weight:F(we.weight,Ae,fe),style:F(we.style,Ae,fe),variant:F(we.variant,Ae,fe),textcase:F(we.textcase,Ae,fe),lineposition:F(we.lineposition,Ae,fe),shadow:F(we.shadow,Ae,fe)};ie.rowNumber=ie.key,ie.align=F(ie.calcdata.cells.align,Ae,fe),ie.cellBorderWidth=F(ie.calcdata.cells.line.width,Ae,fe),ie.font=Fe})}function u(ae){ae.each(function(ie){t.font(x.select(this),ie.font)})}function g(ae){ae.attr("width",function(ie){return ie.column.columnWidth}).attr("stroke-width",function(ie){return ie.cellBorderWidth}).each(function(ie){var fe=x.select(this);c.stroke(fe,F(ie.calcdata.cells.line.color,ie.column.specIndex,ie.rowNumber)),c.fill(fe,F(ie.calcdata.cells.fill.color,ie.column.specIndex,ie.rowNumber))})}function m(ae,ie,fe,we){ae.text(function(Ae){var Fe=Ae.column.specIndex,Ce=Ae.rowNumber,qe=Ae.value,et=typeof qe=="string",Qe=et&&qe.match(/
/i),Ke=!et||Qe;Ae.mayHaveMarkup=et&&qe.match(/[<&>]/);var Xe=R(qe);Ae.latex=Xe;var Me=Xe?"":F(Ae.calcdata.cells.prefix,Fe,Ce)||"",xe=Xe?"":F(Ae.calcdata.cells.suffix,Fe,Ce)||"",ce=Xe?null:F(Ae.calcdata.cells.format,Fe,Ce)||null,Re=Me+(ce?E(ce)(Ae.value):Ae.value)+xe,$e;Ae.wrappingNeeded=!Ae.wrapped&&!Ke&&!Xe&&($e=P(Re)),Ae.cellHeightMayIncrease=Qe||Xe||Ae.mayHaveMarkup||($e===void 0?P(Re):$e),Ae.needsConvertToTspans=Ae.mayHaveMarkup||Ae.wrappingNeeded||Ae.latex;var rt;if(Ae.wrappingNeeded){var Je=d.wrapSplitCharacter===" "?Re.replace(/Ae&&we.push(Fe),Ae+=et}return we}function Z(ae,ie,fe){var we=T(ie)[0];if(we!==void 0){var Ae=we.rowBlocks,Fe=we.calcdata,Ce=$(Ae,Ae.length),qe=we.calcdata.groupHeight-N(we),et=Fe.scrollY=Math.max(0,Math.min(Ce-qe,Fe.scrollY)),Qe=U(Ae,et,qe);Qe.length===1&&(Qe[0]===Ae.length-1?Qe.unshift(Qe[0]-1):Qe.push(Qe[0]+1)),Qe[0]%2&&Qe.reverse(),ie.each(function(Ke,Xe){Ke.page=Qe[Xe],Ke.scrollY=et}),ie.attr("transform",function(Ke){var Xe=$(Ke.rowBlocks,Ke.page)-Ke.scrollY;return a(0,Xe)}),ae&&(ue(ae,fe,ie,Qe,we.prevPages,we,0),ue(ae,fe,ie,Qe,we.prevPages,we,1),l(fe,ae))}}function Q(ae,ie,fe,we){return function(Fe){var Ce=Fe.calcdata?Fe.calcdata:Fe,qe=ie.filter(function(Xe){return Ce.key===Xe.key}),et=fe||Ce.scrollbarState.dragMultiplier,Qe=Ce.scrollY;Ce.scrollY=we===void 0?Ce.scrollY+et*x.event.dy:we;var Ke=qe.selectAll("."+d.cn.yColumn).selectAll("."+d.cn.columnBlock).filter(O);return Z(ae,Ke,qe),Ce.scrollY===Qe}}function ue(ae,ie,fe,we,Ae,Fe,Ce){var qe=we[Ce]!==Ae[Ce];qe&&(clearTimeout(Fe.currentRepaint[Ce]),Fe.currentRepaint[Ce]=setTimeout(function(){var et=fe.filter(function(Qe,Ke){return Ke===Ce&&we[Ke]!==Ae[Ke]});y(ae,ie,et,fe),Ae[Ce]=we[Ce]}))}function oe(ae,ie,fe,we){return function(){var Fe=x.select(ie.parentNode);Fe.each(function(Ce){var qe=Ce.fragments;Fe.selectAll("tspan.line").each(function(Re,$e){qe[$e].width=this.getComputedTextLength()});var et=qe[qe.length-1].width,Qe=qe.slice(0,-1),Ke=[],Xe,Me,xe=0,ce=Ce.column.columnWidth-2*d.cellPad;for(Ce.value="";Qe.length;)Xe=Qe.shift(),Me=Xe.width+et,xe+Me>ce&&(Ce.value+=Ke.join(d.wrapSpacer)+d.lineBreaker,Ke=[],xe=0),Ke.push(Xe.text),xe+=Me;xe&&(Ce.value+=Ke.join(d.wrapSpacer)),Ce.wrapped=!0}),Fe.selectAll("tspan.line").remove(),m(Fe.select("."+d.cn.cellText),fe,ae,we),x.select(ie.parentNode.parentNode).call(J)}}function le(ae,ie,fe,we,Ae){return function(){if(!Ae.settledY){var Ce=x.select(ie.parentNode),qe=ee(Ae),et=Ae.key-qe.firstRowIndex,Qe=qe.rows[et].rowHeight,Ke=Ae.cellHeightMayIncrease?ie.parentNode.getBoundingClientRect().height+2*d.cellPad:Qe,Xe=Math.max(Ke,Qe),Me=Xe-qe.rows[et].rowHeight;Me&&(qe.rows[et].rowHeight=Xe,ae.selectAll("."+d.cn.columnCell).call(J),Z(null,ae.filter(O),0),l(fe,we,!0)),Ce.attr("transform",function(){var xe=this,ce=xe.parentNode,Re=ce.getBoundingClientRect(),$e=x.select(xe.parentNode).select("."+d.cn.cellRect).node().getBoundingClientRect(),rt=xe.transform.baseVal.consolidate(),Je=$e.top-Re.top+(rt?rt.matrix.f:d.cellPad);return a(j(Ae,x.select(xe.parentNode).select("."+d.cn.cellTextHolder).node().getBoundingClientRect().width),Je)}),Ae.settledY=!0}}}function j(ae,ie){switch(ae.align){case"left":return d.cellPad;case"right":return ae.column.columnWidth-(ie||0)-d.cellPad;case"center":return(ae.column.columnWidth-(ie||0))/2;default:return d.cellPad}}function J(ae){ae.attr("transform",function(ie){var fe=ie.rowBlocks[0].auxiliaryBlocks.reduce(function(Ce,qe){return Ce+X(qe,1/0)},0),we=ee(ie),Ae=X(we,ie.key),Fe=Ae+fe;return a(0,Fe)}).selectAll("."+d.cn.cellRect).attr("height",function(ie){return q(ee(ie),ie.key).rowHeight})}function $(ae,ie){for(var fe=0,we=ie-1;we>=0;we--)fe+=re(ae[we]);return fe}function X(ae,ie){for(var fe=0,we=0;weE.length&&(A=A.slice(0,E.length)):A=[],t=0;t90&&(v-=180,i=-i),{angle:v,flip:i,p:x.c2p(e,A,E),offsetMultplier:n}}}}),gD=He({"src/traces/carpet/plot.js"(Y,G){var d=Qn(),x=vo(),A=nA(),E=iA(),e=pD(),t=yl(),r=Gr(),o=r.strRotate,a=r.strTranslate,i=df();G.exports=function(y,b,S,M){var _=y._context.staticPlot,w=b.xaxis,p=b.yaxis,u=y._fullLayout,g=u._clips;r.makeTraceGroups(M,S,"trace").each(function(m){var R=d.select(this),P=m[0],z=P.trace,F=z.aaxis,B=z.baxis,O=r.ensureSingle(R,"g","minorlayer"),L=r.ensureSingle(R,"g","majorlayer"),N=r.ensureSingle(R,"g","boundarylayer"),U=r.ensureSingle(R,"g","labellayer");R.style("opacity",z.opacity),s(w,p,L,F,"a",F._gridlines,!0),s(w,p,L,B,"b",B._gridlines,!0),s(w,p,O,F,"a",F._minorgridlines,!0),s(w,p,O,B,"b",B._minorgridlines,!0),s(w,p,N,F,"a-boundary",F._boundarylines,_),s(w,p,N,B,"b-boundary",B._boundarylines,_);var Z=c(y,w,p,z,P,U,F._labels,"a-label"),Q=c(y,w,p,z,P,U,B._labels,"b-label");f(y,U,z,P,w,p,Z,Q),n(z,P,g,w,p)})};function n(l,y,b,S,M){var _,w,p,u,g=b.select("#"+l._clipPathId);g.size()||(g=b.append("clipPath").classed("carpetclip",!0));var m=r.ensureSingle(g,"path","carpetboundary"),R=y.clipsegments,P=[];for(u=0;u0?"start":"end","data-notex":1}).call(x.font,R.font).text(R.text).call(t.convertToTspans,l),L=x.bBox(this);O.attr("transform",a(z.p[0],z.p[1])+o(z.angle)+a(R.axis.labelpadding*B,L.height*.3)),g=Math.max(g,L.width+R.axis.labelpadding)}),u.exit().remove(),m.maxExtent=g,m}function f(l,y,b,S,M,_,w,p){var u,g,m,R,P=r.aggNums(Math.min,null,b.a),z=r.aggNums(Math.max,null,b.a),F=r.aggNums(Math.min,null,b.b),B=r.aggNums(Math.max,null,b.b);u=.5*(P+z),g=F,m=b.ab2xy(u,g,!0),R=b.dxyda_rough(u,g),w.angle===void 0&&r.extendFlat(w,e(b,M,_,m,b.dxydb_rough(u,g))),T(l,y,b,S,m,R,b.aaxis,M,_,w,"a-title"),u=P,g=.5*(F+B),m=b.ab2xy(u,g,!0),R=b.dxydb_rough(u,g),p.angle===void 0&&r.extendFlat(p,e(b,M,_,m,b.dxyda_rough(u,g))),T(l,y,b,S,m,R,b.baxis,M,_,p,"b-title")}var v=i.LINE_SPACING,h=(1-i.MID_SHIFT)/v+1;function T(l,y,b,S,M,_,w,p,u,g,m){var R=[];w.title.text&&R.push(w.title.text);var P=y.selectAll("text."+m).data(R),z=g.maxExtent;P.enter().append("text").classed(m,!0),P.each(function(){var F=e(b,p,u,M,_);["start","both"].indexOf(w.showticklabels)===-1&&(z=0);var B=w.title.font.size;z+=B+w.title.offset;var O=g.angle+(g.flip<0?180:0),L=(O-F.angle+450)%360,N=L>90&&L<270,U=d.select(this);U.text(w.title.text).call(t.convertToTspans,l),N&&(z=(-t.lineCount(U)+h)*v*B-z),U.attr("transform",a(F.p[0],F.p[1])+o(F.angle)+a(0,z)).attr("text-anchor","middle").call(x.font,w.title.font)}),P.exit().remove()}}}),yD=He({"src/traces/carpet/cheater_basis.js"(Y,G){var d=Gr().isArrayOrTypedArray;G.exports=function(x,A,E){var e,t,r,o,a,i,n=[],s=d(x)?x.length:x,c=d(A)?A.length:A,f=d(x)?x:null,v=d(A)?A:null;f&&(r=(f.length-1)/(f[f.length-1]-f[0])/(s-1)),v&&(o=(v.length-1)/(v[v.length-1]-v[0])/(c-1));var h,T=1/0,l=-1/0;for(t=0;t=10)return null;for(var e=1/0,t=-1/0,r=A.length,o=0;o0&&(X=E.dxydi([],Z-1,ue,0,oe),ae.push(le[0]+X[0]/3),ie.push(le[1]+X[1]/3),re=E.dxydi([],Z-1,ue,1,oe),ae.push($[0]-re[0]/3),ie.push($[1]-re[1]/3)),ae.push($[0]),ie.push($[1]),le=$;else for(Z=E.a2i(U),j=Math.floor(Math.max(0,Math.min(F-2,Z))),J=Z-j,fe.length=F,fe.crossLength=B,fe.xy=function(we){return E.evalxy([],Z,we)},fe.dxy=function(we,Ae){return E.dxydj([],j,we,J,Ae)},Q=0;Q0&&(ee=E.dxydj([],j,Q-1,J,0),ae.push(le[0]+ee[0]/3),ie.push(le[1]+ee[1]/3),q=E.dxydj([],j,Q-1,J,1),ae.push($[0]-q[0]/3),ie.push($[1]-q[1]/3)),ae.push($[0]),ie.push($[1]),le=$;return fe.axisLetter=e,fe.axis=M,fe.crossAxis=g,fe.value=U,fe.constvar=t,fe.index=f,fe.x=ae,fe.y=ie,fe.smoothing=g.smoothing,fe}function N(U){var Z,Q,ue,oe,le,j=[],J=[],$={};if($.length=S.length,$.crossLength=u.length,e==="b")for(ue=Math.max(0,Math.min(B-2,U)),le=Math.min(1,Math.max(0,U-ue)),$.xy=function(X){return E.evalxy([],X,U)},$.dxy=function(X,re){return E.dxydi([],X,ue,re,le)},Z=0;ZS.length-1)&&_.push(x(N(o),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(f=s;fS.length-1)&&!(T<0||T>S.length-1))for(l=S[a],y=S[T],r=0;rS[S.length-1])&&w.push(x(L(h),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash})));M.startline&&p.push(x(N(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&p.push(x(N(S.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(i=5e-15,n=[Math.floor((S[S.length-1]-M.tick0)/M.dtick*(1+i)),Math.ceil((S[0]-M.tick0)/M.dtick/(1+i))].sort(function(U,Z){return U-Z}),s=n[0],c=n[1],f=s;f<=c;f++)v=M.tick0+M.dtick*f,_.push(x(L(v),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(f=s-1;fS[S.length-1])&&w.push(x(L(h),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash}));M.startline&&p.push(x(L(S[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&p.push(x(L(S[S.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}}}),xD=He({"src/traces/carpet/calc_labels.js"(Y,G){var d=io(),x=ho().extendFlat;G.exports=function(E,e){var t,r,o,a,i,n=e._labels=[],s=e._gridlines;for(t=0;t=0;t--)r[s-t]=x[c][t],o[s-t]=A[c][t];for(a.push({x:r,y:o,bicubic:i}),t=c,r=[],o=[];t>=0;t--)r[c-t]=x[t][0],o[c-t]=A[t][0];return a.push({x:r,y:o,bicubic:n}),a}}}),wD=He({"src/traces/carpet/smooth_fill_2d_array.js"(Y,G){var d=Gr();G.exports=function(A,E,e){var t,r,o,a=[],i=[],n=A[0].length,s=A.length;function c(Q,ue){var oe=0,le,j=0;return Q>0&&(le=A[ue][Q-1])!==void 0&&(j++,oe+=le),Q0&&(le=A[ue-1][Q])!==void 0&&(j++,oe+=le),ue0&&r0&&tu);return d.log("Smoother converged to",g,"after",R,"iterations"),A}}}),TD=He({"src/traces/carpet/constants.js"(Y,G){G.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),AD=He({"src/traces/carpet/catmull_rom.js"(Y,G){var d=.5;G.exports=function(A,E,e,t){var r=A[0]-E[0],o=A[1]-E[1],a=e[0]-E[0],i=e[1]-E[1],n=Math.pow(r*r+o*o,d/2),s=Math.pow(a*a+i*i,d/2),c=(s*s*r-n*n*a)*t,f=(s*s*o-n*n*i)*t,v=s*(n+s)*3,h=n*(n+s)*3;return[[E[0]+(v&&c/v),E[1]+(v&&f/v)],[E[0]-(h&&c/h),E[1]-(h&&f/h)]]}}}),SD=He({"src/traces/carpet/compute_control_points.js"(Y,G){var d=AD(),x=Gr().ensureArray;function A(E,e,t){var r=-.5*t[0]+1.5*e[0],o=-.5*t[1]+1.5*e[1];return[(2*r+E[0])/3,(2*o+E[1])/3]}G.exports=function(e,t,r,o,a,i){var n,s,c,f,v,h,T,l,y,b,S=r[0].length,M=r.length,_=a?3*S-2:S,w=i?3*M-2:M;for(e=x(e,w),t=x(t,w),c=0;cv&&_T&&wh||wl},o.setScale=function(){var _=o._x,w=o._y,p=A(o._xctrl,o._yctrl,_,w,c.smoothing,f.smoothing);o._xctrl=p[0],o._yctrl=p[1],o.evalxy=E([o._xctrl,o._yctrl],n,s,c.smoothing,f.smoothing),o.dxydi=e([o._xctrl,o._yctrl],c.smoothing,f.smoothing),o.dxydj=t([o._xctrl,o._yctrl],c.smoothing,f.smoothing)},o.i2a=function(_){var w=Math.max(0,Math.floor(_[0]),n-2),p=_[0]-w;return(1-p)*a[w]+p*a[w+1]},o.j2b=function(_){var w=Math.max(0,Math.floor(_[1]),n-2),p=_[1]-w;return(1-p)*i[w]+p*i[w+1]},o.ij2ab=function(_){return[o.i2a(_[0]),o.j2b(_[1])]},o.a2i=function(_){var w=Math.max(0,Math.min(x(_,a),n-2)),p=a[w],u=a[w+1];return Math.max(0,Math.min(n-1,w+(_-p)/(u-p)))},o.b2j=function(_){var w=Math.max(0,Math.min(x(_,i),s-2)),p=i[w],u=i[w+1];return Math.max(0,Math.min(s-1,w+(_-p)/(u-p)))},o.ab2ij=function(_){return[o.a2i(_[0]),o.b2j(_[1])]},o.i2c=function(_,w){return o.evalxy([],_,w)},o.ab2xy=function(_,w,p){if(!p&&(_a[n-1]|wi[s-1]))return[!1,!1];var u=o.a2i(_),g=o.b2j(w),m=o.evalxy([],u,g);if(p){var R=0,P=0,z=[],F,B,O,L;_a[n-1]?(F=n-2,B=1,R=(_-a[n-1])/(a[n-1]-a[n-2])):(F=Math.max(0,Math.min(n-2,Math.floor(u))),B=u-F),wi[s-1]?(O=s-2,L=1,P=(w-i[s-1])/(i[s-1]-i[s-2])):(O=Math.max(0,Math.min(s-2,Math.floor(g))),L=g-O),R&&(o.dxydi(z,F,O,B,L),m[0]+=z[0]*R,m[1]+=z[1]*R),P&&(o.dxydj(z,F,O,B,L),m[0]+=z[0]*P,m[1]+=z[1]*P)}return m},o.c2p=function(_,w,p){return[w.c2p(_[0]),p.c2p(_[1])]},o.p2x=function(_,w,p){return[w.p2c(_[0]),p.p2c(_[1])]},o.dadi=function(_){var w=Math.max(0,Math.min(a.length-2,_));return a[w+1]-a[w]},o.dbdj=function(_){var w=Math.max(0,Math.min(i.length-2,_));return i[w+1]-i[w]},o.dxyda=function(_,w,p,u){var g=o.dxydi(null,_,w,p,u),m=o.dadi(_,p);return[g[0]/m,g[1]/m]},o.dxydb=function(_,w,p,u){var g=o.dxydj(null,_,w,p,u),m=o.dbdj(w,u);return[g[0]/m,g[1]/m]},o.dxyda_rough=function(_,w,p){var u=y*(p||.1),g=o.ab2xy(_+u,w,!0),m=o.ab2xy(_-u,w,!0);return[(g[0]-m[0])*.5/u,(g[1]-m[1])*.5/u]},o.dxydb_rough=function(_,w,p){var u=b*(p||.1),g=o.ab2xy(_,w+u,!0),m=o.ab2xy(_,w-u,!0);return[(g[0]-m[0])*.5/u,(g[1]-m[1])*.5/u]},o.dpdx=function(_){return _._m},o.dpdy=function(_){return _._m}}}}),LD=He({"src/traces/carpet/calc.js"(Y,G){var d=io(),x=Gr().isArray1D,A=yD(),E=mD(),e=_D(),t=xD(),r=bD(),o=I1(),a=wD(),i=P1(),n=CD();G.exports=function(c,f){var v=d.getFromId(c,f.xaxis),h=d.getFromId(c,f.yaxis),T=f.aaxis,l=f.baxis,y=f.x,b=f.y,S=[];y&&x(y)&&S.push("x"),b&&x(b)&&S.push("y"),S.length&&i(f,T,l,"a","b",S);var M=f._a=f._a||f.a,_=f._b=f._b||f.b;y=f._x||f.x,b=f._y||f.y;var w={};if(f._cheater){var p=T.cheatertype==="index"?M.length:M,u=l.cheatertype==="index"?_.length:_;y=A(p,u,f.cheaterslope)}f._x=y=o(y),f._y=b=o(b),a(y,M,_),a(b,M,_),n(f),f.setScale();var g=E(y),m=E(b),R=.5*(g[1]-g[0]),P=.5*(g[1]+g[0]),z=.5*(m[1]-m[0]),F=.5*(m[1]+m[0]),B=1.3;return g=[P-R*B,P+R*B],m=[F-z*B,F+z*B],f._extremes[v._id]=d.findExtremes(v,g,{padded:!0}),f._extremes[h._id]=d.findExtremes(h,m,{padded:!0}),e(f,"a","b"),e(f,"b","a"),t(f,T),t(f,l),w.clipsegments=r(f._xctrl,f._yctrl,T,l),w.x=y,w.y=b,w.a=M,w.b=_,[w]}}}),PD=He({"src/traces/carpet/index.js"(Y,G){G.exports={attributes:dx(),supplyDefaults:dD(),plot:gD(),calc:LD(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Bc(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),ID=He({"lib/carpet.js"(Y,G){G.exports=PD()}}),oA=He({"src/traces/scattercarpet/attributes.js"(Y,G){var d=wv(),x=Zu(),A=cl(),E=Yo().hovertemplateAttrs,e=Yo().texttemplateAttrs,t=kl(),r=ho().extendFlat,o=x.marker,a=x.line,i=o.line;G.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:r({},x.mode,{dflt:"markers"}),text:r({},x.text,{}),texttemplate:e({editType:"plot"},{keys:["a","b","text"]}),hovertext:r({},x.hovertext,{}),line:{color:a.color,width:a.width,dash:a.dash,backoff:a.backoff,shape:r({},a.shape,{values:["linear","spline"]}),smoothing:a.smoothing,editType:"calc"},connectgaps:x.connectgaps,fill:r({},x.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:d(),marker:r({symbol:o.symbol,opacity:o.opacity,maxdisplayed:o.maxdisplayed,angle:o.angle,angleref:o.angleref,standoff:o.standoff,size:o.size,sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,line:r({width:i.width,editType:"calc"},t("marker.line")),gradient:o.gradient,editType:"calc"},t("marker")),textfont:x.textfont,textposition:x.textposition,selected:x.selected,unselected:x.unselected,hoverinfo:r({},A.hoverinfo,{flags:["a","b","text","name"]}),hoveron:x.hoveron,hovertemplate:E(),zorder:x.zorder}}}),RD=He({"src/traces/scattercarpet/defaults.js"(Y,G){var d=Gr(),x=jv(),A=Rl(),E=Kh(),e=nv(),t=V0(),r=iv(),o=Av(),a=oA();G.exports=function(n,s,c,f){function v(M,_){return d.coerce(n,s,a,M,_)}v("carpet"),s.xaxis="x",s.yaxis="y";var h=v("a"),T=v("b"),l=Math.min(h.length,T.length);if(!l){s.visible=!1;return}s._length=l,v("text"),v("texttemplate"),v("hovertext");var y=l0?w=M.labelprefix.replace(/ = $/,""):w=M._hovertitle,l.push(w+": "+_.toFixed(3)+M.labelsuffix)}if(!v.hovertemplate){var b=f.hi||v.hoverinfo,S=b.split("+");S.indexOf("all")!==-1&&(S=["a","b","text"]),S.indexOf("a")!==-1&&y(h.aaxis,f.a),S.indexOf("b")!==-1&&y(h.baxis,f.b),l.push("y: "+a.yLabel),S.indexOf("text")!==-1&&x(f,v,l),a.extraText=l.join("
")}return o}}}),BD=He({"src/traces/scattercarpet/event_data.js"(Y,G){G.exports=function(x,A,E,e,t){var r=e[t];return x.a=r.a,x.b=r.b,x.y=r.y,x}}}),ND=He({"src/traces/scattercarpet/index.js"(Y,G){G.exports={attributes:oA(),supplyDefaults:RD(),colorbar:ah(),formatLabels:DD(),calc:zD(),plot:FD(),style:Ih().style,styleOnSelect:Ih().styleOnSelect,hoverPoints:OD(),selectPoints:W0(),eventData:BD(),moduleType:"trace",name:"scattercarpet",basePlotModule:Bc(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),UD=He({"lib/scattercarpet.js"(Y,G){G.exports=ND()}}),sA=He({"src/traces/contourcarpet/attributes.js"(Y,G){var d=Y0(),x=fy(),A=kl(),E=ho().extendFlat,e=x.contours;G.exports=E({carpet:{valType:"string",editType:"calc"},z:d.z,a:d.x,a0:d.x0,da:d.dx,b:d.y,b0:d.y0,db:d.dy,text:d.text,hovertext:d.hovertext,transpose:d.transpose,atype:d.xtype,btype:d.ytype,fillcolor:x.fillcolor,autocontour:x.autocontour,ncontours:x.ncontours,contours:{type:e.type,start:e.start,end:e.end,size:e.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:e.showlines,showlabels:e.showlabels,labelfont:e.labelfont,labelformat:e.labelformat,operation:e.operation,value:e.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:x.line.color,width:x.line.width,dash:x.line.dash,smoothing:x.line.smoothing,editType:"plot"},zorder:x.zorder},A("",{cLetter:"z",autoColorDflt:!1}))}}),lA=He({"src/traces/contourcarpet/defaults.js"(Y,G){var d=Gr(),x=L1(),A=sA(),E=Fw(),e=H1(),t=G1();G.exports=function(o,a,i,n){function s(h,T){return d.coerce(o,a,A,h,T)}function c(h){return d.coerce2(o,a,A,h)}if(s("carpet"),o.a&&o.b){var f=x(o,a,s,n,"a","b");if(!f){a.visible=!1;return}s("text");var v=s("contours.type")==="constraint";v?E(o,a,s,n,i,{hasHover:!1}):(e(o,a,s,c),t(o,a,s,n,{hasHover:!1}))}else a._defaultColor=i,a._length=null;s("zorder")}}}),jD=He({"src/traces/contourcarpet/calc.js"(Y,G){var d=Sh(),x=Gr(),A=P1(),E=I1(),e=R1(),t=D1(),r=xw(),o=lA(),a=px(),i=Ew();G.exports=function(c,f){var v=f._carpetTrace=a(c,f);if(!(!v||!v.visible||v.visible==="legendonly")){if(!f.a||!f.b){var h=c.data[v.index],T=c.data[f.index];T.a||(T.a=h.a),T.b||(T.b=h.b),o(T,f,f._defaultColor,c._fullLayout)}var l=n(c,f);return i(f,f._z),l}};function n(s,c){var f=c._carpetTrace,v=f.aaxis,h=f.baxis,T,l,y,b,S,M,_;v._minDtick=0,h._minDtick=0,x.isArray1D(c.z)&&A(c,v,h,"a","b",["z"]),T=c._a=c._a||c.a,b=c._b=c._b||c.b,T=T?v.makeCalcdata(c,"_a"):[],b=b?h.makeCalcdata(c,"_b"):[],l=c.a0||0,y=c.da||1,S=c.b0||0,M=c.db||1,_=c._z=E(c._z||c.z,c.transpose),c._emptypoints=t(_),e(_,c._emptypoints);var w=x.maxRowLength(_),p=c.xtype==="scaled"?"":T,u=r(c,p,l,y,w,v),g=c.ytype==="scaled"?"":b,m=r(c,g,S,M,_.length,h),R={a:u,b:m,z:_};return c.contours.type==="levels"&&c.contours.coloring!=="none"&&d(s,c,{vals:_,containerStr:"",cLetter:"z"}),[R]}}}),VD=He({"src/traces/carpet/axis_aligned_line.js"(Y,G){var d=Gr().isArrayOrTypedArray;G.exports=function(x,A,E,e){var t,r,o,a,i,n,s,c,f,v,h,T,l,y=d(E)?"a":"b",b=y==="a"?x.aaxis:x.baxis,S=b.smoothing,M=y==="a"?x.a2i:x.b2j,_=y==="a"?E:e,w=y==="a"?e:E,p=y==="a"?A.a.length:A.b.length,u=y==="a"?A.b.length:A.a.length,g=Math.floor(y==="a"?x.b2j(w):x.a2i(w)),m=y==="a"?function(ue){return x.evalxy([],ue,g)}:function(ue){return x.evalxy([],g,ue)};S&&(o=Math.max(0,Math.min(u-2,g)),a=g-o,r=y==="a"?function(ue,oe){return x.dxydi([],ue,o,oe,a)}:function(ue,oe){return x.dxydj([],o,ue,a,oe)});var R=M(_[0]),P=M(_[1]),z=R0?Math.floor:Math.ceil,O=z>0?Math.ceil:Math.floor,L=z>0?Math.min:Math.max,N=z>0?Math.max:Math.min,U=B(R+F),Z=O(P-F);s=m(R);var Q=[[s]];for(t=U;t*z=0;fe--)q=N.clipsegments[fe],ae=x([],q.x,R.c2p),ie=x([],q.y,P.c2p),ae.reverse(),ie.reverse(),we.push(A(ae,ie,q.bicubic));var Ae="M"+we.join("L")+"Z";S(F,N.clipsegments,R,P,oe,j),M(O,F,R,P,ee,$,J,L,N,j,Ae),h(F,ue,p,B,Q,u,L),E.setClipUrl(F,L._clipPathId,p)})};function v(w,p){var u,g,m,R,P,z,F,B,O;for(u=0;uue&&(g.max=ue),g.len=g.max-g.min}function l(w,p,u){var g=w.getPointAtLength(p),m=w.getPointAtLength(u),R=m.x-g.x,P=m.y-g.y,z=Math.sqrt(R*R+P*P);return[R/z,P/z]}function y(w){var p=Math.sqrt(w[0]*w[0]+w[1]*w[1]);return[w[0]/p,w[1]/p]}function b(w,p){var u=Math.abs(w[0]*p[0]+w[1]*p[1]),g=Math.sqrt(1-u*u);return g/u}function S(w,p,u,g,m,R){var P,z,F,B,O=e.ensureSingle(w,"g","contourbg"),L=O.selectAll("path").data(R==="fill"&&!m?[0]:[]);L.enter().append("path"),L.exit().remove();var N=[];for(B=0;B=0&&(U=ae,Q=ue):Math.abs(N[1]-U[1])=0&&(U=ae,Q=ue):e.log("endpt to newendpt is not vert. or horz.",N,U,ae)}if(Q>=0)break;B+=ee(N,U),N=U}if(Q===p.edgepaths.length){e.log("unclosed perimeter path");break}F=Q,L=O.indexOf(F)===-1,L&&(F=O[0],B+=ee(N,U)+"Z",N=null)}for(F=0;F_):M=z>m,_=z;var F=v(m,R,P,z);F.pos=g,F.yc=(m+z)/2,F.i=u,F.dir=M?"increasing":"decreasing",F.x=F.pos,F.y=[P,R],w&&(F.orig_p=s[u]),b&&(F.tx=n.text[u]),S&&(F.htx=n.hovertext[u]),p.push(F)}else p.push({pos:g,empty:!0})}return n._extremes[f._id]=A.findExtremes(f,d.concat(l,T),{padded:!0}),p.length&&(p[0].t={labels:{open:x(i,"open:")+" ",high:x(i,"high:")+" ",low:x(i,"low:")+" ",close:x(i,"close:")+" "}}),p}function a(i,n,s){var c=s._minDiff;if(!c){var f=i._fullData,v=[];c=1/0;var h;for(h=0;h"+y.labels[z]+d.hoverLabelText(T,F,l.yhoverformat)):(O=x.extendFlat({},S),O.y0=O.y1=B,O.yLabelVal=F,O.yLabel=y.labels[z]+d.hoverLabelText(T,F,l.yhoverformat),O.name="",b.push(O),R[F]=O)}return b}function n(s,c,f,v){var h=s.cd,T=s.ya,l=h[0].trace,y=h[0].t,b=a(s,c,f,v);if(!b)return[];var S=b.index,M=h[S],_=b.index=M.i,w=M.dir;function p(F){return y.labels[F]+d.hoverLabelText(T,l[F][_],l.yhoverformat)}var u=M.hi||l.hoverinfo,g=u.split("+"),m=u==="all",R=m||g.indexOf("y")!==-1,P=m||g.indexOf("text")!==-1,z=R?[p("open"),p("high"),p("low"),p("close")+" "+r[w]]:[];return P&&e(M,l,z),b.extraText=z.join("
"),b.y0=b.y1=T.c2p(M.yc,!0),[b]}G.exports={hoverPoints:o,hoverSplit:i,hoverOnPoints:n}}}),hA=He({"src/traces/ohlc/select.js"(Y,G){G.exports=function(x,A){var E=x.cd,e=x.xaxis,t=x.yaxis,r=[],o,a=E[0].t.bPos||0;if(A===!1)for(o=0;oc?function(l){return l<=0}:function(l){return l>=0};a.c2g=function(l){var y=a.c2l(l)-s;return(T(y)?y:0)+h},a.g2c=function(l){return a.l2c(l+s-h)},a.g2p=function(l){return l*v},a.c2p=function(l){return a.g2p(a.c2g(l))}}}function t(a,i){return i==="degrees"?A(a):a}function r(a,i){return i==="degrees"?E(a):a}function o(a,i){var n=a.type;if(n==="linear"){var s=a.d2c,c=a.c2d;a.d2c=function(f,v){return t(s(f),v)},a.c2d=function(f,v){return c(r(f,v))}}a.makeCalcdata=function(f,v){var h=f[v],T=f._length,l,y,b=function(p){return a.d2c(p,f.thetaunit)};if(h)for(l=new Array(T),y=0;y0?p:1/0},M=A(b,S),_=d.mod(M+1,b.length);return[b[M],b[_]]}function v(y){return Math.abs(y)>1e-10?y:0}function h(y,b,S){b=b||0,S=S||0;for(var M=y.length,_=new Array(M),w=0;w0?1:0}function x(r){var o=r[0],a=r[1];if(!isFinite(o)||!isFinite(a))return[1,0];var i=(o+1)*(o+1)+a*a;return[(o*o+a*a-1)/i,2*a/i]}function A(r,o){var a=o[0],i=o[1];return[a*r.radius+r.cx,-i*r.radius+r.cy]}function E(r,o){return o*r.radius}function e(r,o,a,i){var n=A(r,x([a,o])),s=n[0],c=n[1],f=A(r,x([i,o])),v=f[0],h=f[1];if(o===0)return["M"+s+","+c,"L"+v+","+h].join(" ");var T=E(r,1/Math.abs(o));return["M"+s+","+c,"A"+T+","+T+" 0 0,"+(o<0?1:0)+" "+v+","+h].join(" ")}function t(r,o,a,i){var n=E(r,1/(o+1)),s=A(r,x([o,a])),c=s[0],f=s[1],v=A(r,x([o,i])),h=v[0],T=v[1];if(d(a)!==d(i)){var l=A(r,x([o,0])),y=l[0],b=l[1];return["M"+c+","+f,"A"+n+","+n+" 0 0,"+(0et?(Qe=ie,Ke=ie*et,xe=(fe-Ke)/X.h/2,Xe=[q[0],q[1]],Me=[ae[0]+xe,ae[1]-xe]):(Qe=fe/et,Ke=fe,xe=(ie-Qe)/X.w/2,Xe=[q[0]+xe,q[1]-xe],Me=[ae[0],ae[1]]),J.xLength2=Qe,J.yLength2=Ke,J.xDomain2=Xe,J.yDomain2=Me;var ce=J.xOffset2=X.l+X.w*Xe[0],Re=J.yOffset2=X.t+X.h*(1-Me[1]),$e=J.radius=Qe/Fe,rt=J.innerRadius=J.getHole(j)*$e,Je=J.cx=ce-$e*Ae[0],At=J.cy=Re+$e*Ae[3],St=J.cxx=Je-ce,Rt=J.cyy=At-Re,Ut=re.side,ir;Ut==="counterclockwise"?(ir=Ut,Ut="top"):Ut==="clockwise"&&(ir=Ut,Ut="bottom"),J.radialAxis=J.mockAxis(le,j,re,{_id:"x",side:Ut,_trueSide:ir,domain:[rt/X.w,$e/X.w]}),J.angularAxis=J.mockAxis(le,j,ee,{side:"right",domain:[0,Math.PI],autorange:!1}),J.doAutoRange(le,j),J.updateAngularAxis(le,j),J.updateRadialAxis(le,j),J.updateRadialAxisTitle(le,j),J.xaxis=J.mockCartesianAxis(le,j,{_id:"x",domain:Xe}),J.yaxis=J.mockCartesianAxis(le,j,{_id:"y",domain:Me});var ar=J.pathSubplot();J.clipPaths.forTraces.select("path").attr("d",ar).attr("transform",t(St,Rt)),$.frontplot.attr("transform",t(ce,Re)).call(o.setClipUrl,J._hasClipOnAxisFalse?null:J.clipIds.forTraces,J.gd),$.bg.attr("d",ar).attr("transform",t(Je,At)).call(r.fill,j.bgcolor)},U.mockAxis=function(le,j,J,$){var X=E.extendFlat({},J,$);return s(X,j,le),X},U.mockCartesianAxis=function(le,j,J){var $=this,X=$.isSmith,re=J._id,ee=E.extendFlat({type:"linear"},J);n(ee,le);var q={x:[0,2],y:[1,3]};return ee.setRange=function(){var ae=$.sectorBBox,ie=q[re],fe=$.radialAxis._rl,we=(fe[1]-fe[0])/(1-$.getHole(j));ee.range=[ae[ie[0]]*we,ae[ie[1]]*we]},ee.isPtWithinRange=re==="x"&&!X?function(ae){return $.isPtInside(ae)}:function(){return!0},ee.setRange(),ee.setScale(),ee},U.doAutoRange=function(le,j){var J=this,$=J.gd,X=J.radialAxis,re=J.getRadial(j);c($,X);var ee=X.range;if(re.range=ee.slice(),re._input.range=ee.slice(),X._rl=[X.r2l(ee[0],null,"gregorian"),X.r2l(ee[1],null,"gregorian")],X.minallowed!==void 0){var q=X.r2l(X.minallowed);X._rl[0]>X._rl[1]?X._rl[1]=Math.max(X._rl[1],q):X._rl[0]=Math.max(X._rl[0],q)}if(X.maxallowed!==void 0){var ae=X.r2l(X.maxallowed);X._rl[0]90&&fe<=270&&(we.tickangle=180);var Ce=Fe?function($e){var rt=z(J,m([$e.x,0]));return t(rt[0]-q,rt[1]-ae)}:function($e){return t(we.l2p($e.x)+ee,0)},qe=Fe?function($e){return P(J,$e.x,-1/0,1/0)}:function($e){return J.pathArc(we.r2p($e.x)+ee)},et=Z(ie);if(J.radialTickLayout!==et&&(X["radial-axis"].selectAll(".xtick").remove(),J.radialTickLayout=et),Ae){we.setScale();var Qe=0,Ke=Fe?(we.tickvals||[]).filter(function($e){return $e>=0}).map(function($e){return i.tickText(we,$e,!0,!1)}):i.calcTicks(we),Xe=Fe?Ke:i.clipEnds(we,Ke),Me=i.getTickSigns(we)[2];Fe&&((we.ticks==="top"&&we.side==="bottom"||we.ticks==="bottom"&&we.side==="top")&&(Me=-Me),we.ticks==="top"&&we.side==="top"&&(Qe=-we.ticklen),we.ticks==="bottom"&&we.side==="bottom"&&(Qe=we.ticklen)),i.drawTicks($,we,{vals:Ke,layer:X["radial-axis"],path:i.makeTickPath(we,0,Me),transFn:Ce,crisp:!1}),i.drawGrid($,we,{vals:Xe,layer:X["radial-grid"],path:qe,transFn:E.noop,crisp:!1}),i.drawLabels($,we,{vals:Ke,layer:X["radial-axis"],transFn:Ce,labelFns:i.makeLabelFns(we,Qe)})}var xe=J.radialAxisAngle=J.vangles?L(ue(O(ie.angle),J.vangles)):ie.angle,ce=t(q,ae),Re=ce+e(-xe);oe(X["radial-axis"],Ae&&(ie.showticklabels||ie.ticks),{transform:Re}),oe(X["radial-grid"],Ae&&ie.showgrid,{transform:Fe?"":ce}),oe(X["radial-line"].select("line"),Ae&&ie.showline,{x1:Fe?-re:ee,y1:0,x2:re,y2:0,transform:Re}).attr("stroke-width",ie.linewidth).call(r.stroke,ie.linecolor)},U.updateRadialAxisTitle=function(le,j,J){if(!this.isSmith){var $=this,X=$.gd,re=$.radius,ee=$.cx,q=$.cy,ae=$.getRadial(j),ie=$.id+"title",fe=0;if(ae.title){var we=o.bBox($.layers["radial-axis"].node()).height,Ae=ae.title.font.size,Fe=ae.side;fe=Fe==="top"?Ae:Fe==="counterclockwise"?-(we+Ae*.4):we+Ae*.8}var Ce=J!==void 0?J:$.radialAxisAngle,qe=O(Ce),et=Math.cos(qe),Qe=Math.sin(qe),Ke=ee+re/2*et+fe*Qe,Xe=q-re/2*Qe+fe*et;$.layers["radial-axis-title"]=T.draw(X,ie,{propContainer:ae,propName:$.id+".radialaxis.title",placeholder:F(X,"Click to enter radial axis title"),attributes:{x:Ke,y:Xe,"text-anchor":"middle"},transform:{rotate:-Ce}})}},U.updateAngularAxis=function(le,j){var J=this,$=J.gd,X=J.layers,re=J.radius,ee=J.innerRadius,q=J.cx,ae=J.cy,ie=J.getAngular(j),fe=J.angularAxis,we=J.isSmith;we||(J.fillViewInitialKey("angularaxis.rotation",ie.rotation),fe.setGeometry(),fe.setScale());var Ae=we?function(rt){var Je=z(J,m([0,rt.x]));return Math.atan2(Je[0]-q,Je[1]-ae)-Math.PI/2}:function(rt){return fe.t2g(rt.x)};fe.type==="linear"&&fe.thetaunit==="radians"&&(fe.tick0=L(fe.tick0),fe.dtick=L(fe.dtick));var Fe=function(rt){return t(q+re*Math.cos(rt),ae-re*Math.sin(rt))},Ce=we?function(rt){var Je=z(J,m([0,rt.x]));return t(Je[0],Je[1])}:function(rt){return Fe(Ae(rt))},qe=we?function(rt){var Je=z(J,m([0,rt.x])),At=Math.atan2(Je[0]-q,Je[1]-ae)-Math.PI/2;return t(Je[0],Je[1])+e(-L(At))}:function(rt){var Je=Ae(rt);return Fe(Je)+e(-L(Je))},et=we?function(rt){return R(J,rt.x,0,1/0)}:function(rt){var Je=Ae(rt),At=Math.cos(Je),St=Math.sin(Je);return"M"+[q+ee*At,ae-ee*St]+"L"+[q+re*At,ae-re*St]},Qe=i.makeLabelFns(fe,0),Ke=Qe.labelStandoff,Xe={};Xe.xFn=function(rt){var Je=Ae(rt);return Math.cos(Je)*Ke},Xe.yFn=function(rt){var Je=Ae(rt),At=Math.sin(Je)>0?.2:1;return-Math.sin(Je)*(Ke+rt.fontSize*At)+Math.abs(Math.cos(Je))*(rt.fontSize*w)},Xe.anchorFn=function(rt){var Je=Ae(rt),At=Math.cos(Je);return Math.abs(At)<.1?"middle":At>0?"start":"end"},Xe.heightFn=function(rt,Je,At){var St=Ae(rt);return-.5*(1+Math.sin(St))*At};var Me=Z(ie);J.angularTickLayout!==Me&&(X["angular-axis"].selectAll("."+fe._id+"tick").remove(),J.angularTickLayout=Me);var xe=we?[1/0].concat(fe.tickvals||[]).map(function(rt){return i.tickText(fe,rt,!0,!1)}):i.calcTicks(fe);we&&(xe[0].text="∞",xe[0].fontSize*=1.75);var ce;if(j.gridshape==="linear"?(ce=xe.map(Ae),E.angleDelta(ce[0],ce[1])<0&&(ce=ce.slice().reverse())):ce=null,J.vangles=ce,fe.type==="category"&&(xe=xe.filter(function(rt){return E.isAngleInsideSector(Ae(rt),J.sectorInRad)})),fe.visible){var Re=fe.ticks==="inside"?-1:1,$e=(fe.linewidth||1)/2;i.drawTicks($,fe,{vals:xe,layer:X["angular-axis"],path:"M"+Re*$e+",0h"+Re*fe.ticklen,transFn:qe,crisp:!1}),i.drawGrid($,fe,{vals:xe,layer:X["angular-grid"],path:et,transFn:E.noop,crisp:!1}),i.drawLabels($,fe,{vals:xe,layer:X["angular-axis"],repositionOnUpdate:!0,transFn:Ce,labelFns:Xe})}oe(X["angular-line"].select("path"),ie.showline,{d:J.pathSubplot(),transform:t(q,ae)}).attr("stroke-width",ie.linewidth).call(r.stroke,ie.linecolor)},U.updateFx=function(le,j){if(!this.gd._context.staticPlot){var J=!this.isSmith;J&&(this.updateAngularDrag(le),this.updateRadialDrag(le,j,0),this.updateRadialDrag(le,j,1)),this.updateHoverAndMainDrag(le)}},U.updateHoverAndMainDrag=function(le){var j=this,J=j.isSmith,$=j.gd,X=j.layers,re=le._zoomlayer,ee=p.MINZOOM,q=p.OFFEDGE,ae=j.radius,ie=j.innerRadius,fe=j.cx,we=j.cy,Ae=j.cxx,Fe=j.cyy,Ce=j.sectorInRad,qe=j.vangles,et=j.radialAxis,Qe=u.clampTiny,Ke=u.findXYatLength,Xe=u.findEnclosingVertexAngles,Me=p.cornerHalfWidth,xe=p.cornerLen/2,ce,Re,$e=f.makeDragger(X,"path","maindrag",le.dragmode===!1?"none":"crosshair");d.select($e).attr("d",j.pathSubplot()).attr("transform",t(fe,we)),$e.onmousemove=function(qt){h.hover($,qt,j.id),$._fullLayout._lasthover=$e,$._fullLayout._hoversubplot=j.id},$e.onmouseout=function(qt){$._dragging||v.unhover($,qt)};var rt={element:$e,gd:$,subplot:j.id,plotinfo:{id:j.id,xaxis:j.xaxis,yaxis:j.yaxis},xaxes:[j.xaxis],yaxes:[j.yaxis]},Je,At,St,Rt,Ut,ir,ar,Mr,fr;function dr(qt,Zt){return Math.sqrt(qt*qt+Zt*Zt)}function pt(qt,Zt){return dr(qt-Ae,Zt-Fe)}function ze(qt,Zt){return Math.atan2(Fe-Zt,qt-Ae)}function Ge(qt,Zt){return[qt*Math.cos(Zt),qt*Math.sin(-Zt)]}function Oe(qt,Zt){if(qt===0)return j.pathSector(2*Me);var lr=xe/qt,ta=Zt-lr,da=Zt+lr,wa=Math.max(0,Math.min(qt,ae)),ma=wa-Me,Ia=wa+Me;return"M"+Ge(ma,ta)+"A"+[ma,ma]+" 0,0,0 "+Ge(ma,da)+"L"+Ge(Ia,da)+"A"+[Ia,Ia]+" 0,0,1 "+Ge(Ia,ta)+"Z"}function ve(qt,Zt,lr){if(qt===0)return j.pathSector(2*Me);var ta=Ge(qt,Zt),da=Ge(qt,lr),wa=Qe((ta[0]+da[0])/2),ma=Qe((ta[1]+da[1])/2),Ia,va;if(wa&&ma){var La=ma/wa,Ka=-1/La,Vt=Ke(Me,La,wa,ma);Ia=Ke(xe,Ka,Vt[0][0],Vt[0][1]),va=Ke(xe,Ka,Vt[1][0],Vt[1][1])}else{var Lt,jt;ma?(Lt=xe,jt=Me):(Lt=Me,jt=xe),Ia=[[wa-Lt,ma-jt],[wa+Lt,ma-jt]],va=[[wa-Lt,ma+jt],[wa+Lt,ma+jt]]}return"M"+Ia.join("L")+"L"+va.reverse().join("L")+"Z"}function ge(){St=null,Rt=null,Ut=j.pathSubplot(),ir=!1;var qt=$._fullLayout[j.id];ar=x(qt.bgcolor).getLuminance(),Mr=f.makeZoombox(re,ar,fe,we,Ut),Mr.attr("fill-rule","evenodd"),fr=f.makeCorners(re,fe,we),b($)}function be(qt,Zt){return Zt=Math.max(Math.min(Zt,ae),ie),qtee?(qt-1&&qt===1&&y(Zt,$,[j.xaxis],[j.yaxis],j.id,rt),lr.indexOf("event")>-1&&h.click($,Zt,j.id)}rt.prepFn=function(qt,Zt,lr){var ta=$._fullLayout.dragmode,da=$e.getBoundingClientRect();$._fullLayout._calcInverseTransform($);var wa=$._fullLayout._invTransform;ce=$._fullLayout._invScaleX,Re=$._fullLayout._invScaleY;var ma=E.apply3DTransform(wa)(Zt-da.left,lr-da.top);if(Je=ma[0],At=ma[1],qe){var Ia=u.findPolygonOffset(ae,Ce[0],Ce[1],qe);Je+=Ae+Ia[0],At+=Fe+Ia[1]}switch(ta){case"zoom":rt.clickFn=Bt,J||(qe?rt.moveFn=_t:rt.moveFn=We,rt.doneFn=Mt,ge());break;case"select":case"lasso":l(qt,Zt,lr,rt,ta);break}},v.init(rt)},U.updateRadialDrag=function(le,j,J){var $=this,X=$.gd,re=$.layers,ee=$.radius,q=$.innerRadius,ae=$.cx,ie=$.cy,fe=$.radialAxis,we=p.radialDragBoxSize,Ae=we/2;if(!fe.visible)return;var Fe=O($.radialAxisAngle),Ce=fe._rl,qe=Ce[0],et=Ce[1],Qe=Ce[J],Ke=.75*(Ce[1]-Ce[0])/(1-$.getHole(j))/ee,Xe,Me,xe;J?(Xe=ae+(ee+Ae)*Math.cos(Fe),Me=ie-(ee+Ae)*Math.sin(Fe),xe="radialdrag"):(Xe=ae+(q-Ae)*Math.cos(Fe),Me=ie-(q-Ae)*Math.sin(Fe),xe="radialdrag-inner");var ce=f.makeRectDragger(re,xe,"crosshair",-Ae,-Ae,we,we),Re={element:ce,gd:X};le.dragmode===!1&&(Re.dragmode=!1),oe(d.select(ce),fe.visible&&q0!=(J?Je>qe:Je=90||X>90&&re>=450?Fe=1:q<=0&&ie<=0?Fe=0:Fe=Math.max(q,ie),X<=180&&re>=180||X>180&&re>=540?fe=-1:ee>=0&&ae>=0?fe=0:fe=Math.min(ee,ae),X<=270&&re>=270||X>270&&re>=630?we=-1:q>=0&&ie>=0?we=0:we=Math.min(q,ie),re>=360?Ae=1:ee<=0&&ae<=0?Ae=0:Ae=Math.max(ee,ae),[fe,we,Ae,Fe]}function ue(le,j){var J=function(X){return E.angleDist(le,X)},$=E.findIndexOfMin(j,J);return j[$]}function oe(le,j,J){return j?(le.attr("display",null),le.attr(J)):le&&le.attr("display","none"),le}}}),yA=He({"src/plots/polar/layout_attributes.js"(Y,G){var d=Xc(),x=jf(),A=mu().attributes,E=Gr().extendFlat,e=hu().overrideAll,t=e({color:x.color,showline:E({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:E({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({tickmode:x.minor.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,ticklabelstep:x.ticklabelstep,showticklabels:x.showticklabels,labelalias:x.labelalias,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,showexponent:x.showexponent,exponentformat:x.exponentformat,minexponent:x.minexponent,separatethousands:x.separatethousands,tickfont:x.tickfont,tickangle:x.tickangle,tickformat:x.tickformat,tickformatstops:x.tickformatstops,layer:x.layer},"plot","from-root"),o={visible:E({},x.visible,{dflt:!0}),type:E({},x.type,{values:["-","linear","log","date","category"]}),autotypenumbers:x.autotypenumbers,autorangeoptions:{minallowed:x.autorangeoptions.minallowed,maxallowed:x.autorangeoptions.maxallowed,clipmin:x.autorangeoptions.clipmin,clipmax:x.autorangeoptions.clipmax,include:x.autorangeoptions.include,editType:"plot"},autorange:E({},x.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:E({},x.minallowed,{editType:"plot"}),maxallowed:E({},x.maxallowed,{editType:"plot"}),range:E({},x.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:x.categoryorder,categoryarray:x.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:x.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:E({},x.title.text,{editType:"plot",dflt:""}),font:E({},x.title.font,{editType:"plot"}),editType:"plot"},hoverformat:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(o,t,r);var a={visible:E({},x.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:x.autotypenumbers,categoryorder:x.categoryorder,categoryarray:x.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(a,t,r),G.exports={domain:A({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:d.background},radialaxis:o,angularaxis:a,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),tz=He({"src/plots/polar/layout_defaults.js"(Y,G){var d=Gr(),x=Ai(),A=Gs(),E=Xd(),e=Uf().getSubplotData,t=Ep(),r=O0(),o=Vd(),a=qd(),i=p1(),n=ay(),s=Sb(),c=N0(),f=yA(),v=dA(),h=yx(),T=h.axisNames;function l(b,S,M,_){var w=M("bgcolor");_.bgColor=x.combine(w,_.paper_bgcolor);var p=M("sector");M("hole");var u=e(_.fullData,h.name,_.id),g=_.layoutOut,m;function R(we,Ae){return M(m+"."+we,Ae)}for(var P=0;P")}}G.exports={hoverPoints:x,makeHoverPointText:A}}}),nz=He({"src/traces/scatterpolar/index.js"(Y,G){G.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:_x(),categories:["polar","symbols","showLegend","scatter-like"],attributes:$y(),supplyDefaults:xx().supplyDefaults,colorbar:ah(),formatLabels:bx(),calc:rz(),plot:az(),style:Ih().style,styleOnSelect:Ih().styleOnSelect,hoverPoints:wx().hoverPoints,selectPoints:W0(),meta:{}}}}),iz=He({"lib/scatterpolar.js"(Y,G){G.exports=nz()}}),mA=He({"src/traces/scatterpolargl/attributes.js"(Y,G){var d=$y(),x=qy(),A=Yo().texttemplateAttrs;G.exports={mode:d.mode,r:d.r,theta:d.theta,r0:d.r0,dr:d.dr,theta0:d.theta0,dtheta:d.dtheta,thetaunit:d.thetaunit,text:d.text,texttemplate:A({editType:"plot"},{keys:["r","theta","text"]}),hovertext:d.hovertext,hovertemplate:d.hovertemplate,line:{color:x.line.color,width:x.line.width,dash:x.line.dash,editType:"calc"},connectgaps:x.connectgaps,marker:x.marker,fill:x.fill,fillcolor:x.fillcolor,textposition:x.textposition,textfont:x.textfont,hoverinfo:d.hoverinfo,selected:d.selected,unselected:d.unselected}}}),oz=He({"src/traces/scatterpolargl/defaults.js"(Y,G){var d=Gr(),x=Rl(),A=xx().handleRThetaDefaults,E=Kh(),e=nv(),t=iv(),r=Av(),o=jv().PTS_LINESONLY,a=mA();G.exports=function(n,s,c,f){function v(T,l){return d.coerce(n,s,a,T,l)}var h=A(n,s,f,v);if(!h){s.visible=!1;return}v("thetaunit"),v("mode",h=r&&(_.marker.cluster=y.tree),_.marker&&(_.markerSel.positions=_.markerUnsel.positions=_.marker.positions=g),_.line&&g.length>1&&t.extendFlat(_.line,e.linePositions(i,l,g)),_.text&&(t.extendFlat(_.text,{positions:g},e.textPosition(i,l,_.text,_.marker)),t.extendFlat(_.textSel,{positions:g},e.textPosition(i,l,_.text,_.markerSel)),t.extendFlat(_.textUnsel,{positions:g},e.textPosition(i,l,_.text,_.markerUnsel))),_.fill&&!v.fill2d&&(v.fill2d=!0),_.marker&&!v.scatter2d&&(v.scatter2d=!0),_.line&&!v.line2d&&(v.line2d=!0),_.text&&!v.glText&&(v.glText=!0),v.lineOptions.push(_.line),v.fillOptions.push(_.fill),v.markerOptions.push(_.marker),v.markerSelectedOptions.push(_.markerSel),v.markerUnselectedOptions.push(_.markerUnsel),v.textOptions.push(_.text),v.textSelectedOptions.push(_.textSel),v.textUnselectedOptions.push(_.textUnsel),v.selectBatch.push([]),v.unselectBatch.push([]),y.x=m,y.y=R,y.rawx=m,y.rawy=R,y.r=S,y.theta=M,y.positions=g,y._scene=v,y.index=v.count,v.count++}}),A(i,n,s)}},G.exports.reglPrecompiled=o}}),hz=He({"src/traces/scatterpolargl/index.js"(Y,G){var d=cz();d.plot=fz(),G.exports=d}}),vz=He({"lib/scatterpolargl.js"(Y,G){G.exports=hz()}}),_A=He({"src/traces/barpolar/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=ho().extendFlat,A=$y(),E=qv();G.exports={r:A.r,theta:A.theta,r0:A.r0,dr:A.dr,theta0:A.theta0,dtheta:A.dtheta,thetaunit:A.thetaunit,base:x({},E.base,{}),offset:x({},E.offset,{}),width:x({},E.width,{}),text:x({},E.text,{}),hovertext:x({},E.hovertext,{}),marker:e(),hoverinfo:A.hoverinfo,hovertemplate:d(),selected:E.selected,unselected:E.unselected};function e(){var t=x({},E.marker);return delete t.cornerradius,t}}}),xA=He({"src/traces/barpolar/layout_attributes.js"(Y,G){G.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),dz=He({"src/traces/barpolar/defaults.js"(Y,G){var d=Gr(),x=xx().handleRThetaDefaults,A=A1(),E=_A();G.exports=function(t,r,o,a){function i(s,c){return d.coerce(t,r,E,s,c)}var n=x(t,r,a,i);if(!n){r.visible=!1;return}i("thetaunit"),i("base"),i("offset"),i("width"),i("text"),i("hovertext"),i("hovertemplate"),A(t,r,i,o,a),d.coerceSelectionMarkerOpacity(r,i)}}}),pz=He({"src/traces/barpolar/layout_defaults.js"(Y,G){var d=Gr(),x=xA();G.exports=function(A,E,e){var t={},r;function o(n,s){return d.coerce(A[r]||{},E[r],x,n,s)}for(var a=0;a0?(f=s,v=c):(f=c,v=s);var h=e.findEnclosingVertexAngles(f,r.vangles)[0],T=e.findEnclosingVertexAngles(v,r.vangles)[1],l=[h,(f+v)/2,T];return e.pathPolygonAnnulus(i,n,f,v,l,o,a)}:function(i,n,s,c){return A.pathAnnulus(i,n,s,c,o,a)}}}}),yz=He({"src/traces/barpolar/hover.js"(Y,G){var d=Wu(),x=Gr(),A=Z0().getTraceColor,E=x.fillText,e=wx().makeHoverPointText,t=mx().isPtInsidePolygon;G.exports=function(o,a,i){var n=o.cd,s=n[0].trace,c=o.subplot,f=c.radialAxis,v=c.angularAxis,h=c.vangles,T=h?t:x.isPtInsideSector,l=o.maxHoverDistance,y=v._period||2*Math.PI,b=Math.abs(f.g2p(Math.sqrt(a*a+i*i))),S=Math.atan2(i,a);f.range[0]>f.range[1]&&(S+=Math.PI);var M=function(u){return T(b,S,[u.rp0,u.rp1],[u.thetag0,u.thetag1],h)?l+Math.min(1,Math.abs(u.thetag1-u.thetag0)/y)-1+(u.rp1-b)/(u.rp1-u.rp0)-1:1/0};if(d.getClosest(n,M,o),o.index!==!1){var _=o.index,w=n[_];o.x0=o.x1=w.ct[0],o.y0=o.y1=w.ct[1];var p=x.extendFlat({},w,{r:w.s,theta:w.p});return E(w,s,o),e(p,s,c,o),o.hovertemplate=s.hovertemplate,o.color=A(s,w),o.xLabelVal=o.yLabelVal=void 0,w.s<0&&(o.idealAlign="left"),[o]}}}}),mz=He({"src/traces/barpolar/index.js"(Y,G){G.exports={moduleType:"trace",name:"barpolar",basePlotModule:_x(),categories:["polar","bar","showLegend"],attributes:_A(),layoutAttributes:xA(),supplyDefaults:dz(),supplyLayoutDefaults:pz(),calc:bA().calc,crossTraceCalc:bA().crossTraceCalc,plot:gz(),colorbar:ah(),formatLabels:bx(),style:uv().style,styleOnSelect:uv().styleOnSelect,hoverPoints:yz(),selectPoints:X0(),meta:{}}}}),_z=He({"lib/barpolar.js"(Y,G){G.exports=mz()}}),wA=He({"src/plots/smith/constants.js"(Y,G){G.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),TA=He({"src/plots/smith/layout_attributes.js"(Y,G){var d=Xc(),x=jf(),A=mu().attributes,E=Gr().extendFlat,e=hu().overrideAll,t=e({color:x.color,showline:E({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:E({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({ticklen:x.ticklen,tickwidth:E({},x.tickwidth,{dflt:2}),tickcolor:x.tickcolor,showticklabels:x.showticklabels,labelalias:x.labelalias,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,tickfont:x.tickfont,tickformat:x.tickformat,hoverformat:x.hoverformat,layer:x.layer},"plot","from-root"),o=E({visible:E({},x.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:E({},x.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},t,r),a=E({visible:E({},x.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:x.ticks,editType:"calc"},t,r);G.exports={domain:A({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:d.background},realaxis:o,imaginaryaxis:a,editType:"calc"}}}),xz=He({"src/plots/smith/layout_defaults.js"(Y,G){var d=Gr(),x=Ai(),A=Gs(),E=Xd(),e=Uf().getSubplotData,t=qd(),r=Vd(),o=ay(),a=Uv(),i=TA(),n=wA(),s=n.axisNames,c=v(function(h){return d.isTypedArray(h)&&(h=Array.from(h)),h.slice().reverse().map(function(T){return-T}).concat([0]).concat(h)},String);function f(h,T,l,y){var b=l("bgcolor");y.bgColor=x.combine(b,y.paper_bgcolor);var S=e(y.fullData,n.name,y.id),M=y.layoutOut,_;function w(U,Z){return l(_+"."+U,Z)}for(var p=0;p")}}G.exports={hoverPoints:x,makeHoverPointText:A}}}),Ez=He({"src/traces/scattersmith/index.js"(Y,G){G.exports={moduleType:"trace",name:"scattersmith",basePlotModule:bz(),categories:["smith","symbols","showLegend","scatter-like"],attributes:AA(),supplyDefaults:wz(),colorbar:ah(),formatLabels:Tz(),calc:Az(),plot:Sz(),style:Ih().style,styleOnSelect:Ih().styleOnSelect,hoverPoints:Mz().hoverPoints,selectPoints:W0(),meta:{}}}}),kz=He({"lib/scattersmith.js"(Y,G){G.exports=Ez()}}),vh=He({"node_modules/world-calendars/dist/main.js"(Y,G){var d=Yc();function x(){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={}}d(x.prototype,{instance:function(o,a){o=(o||"gregorian").toLowerCase(),a=a||"";var i=this._localCals[o+"-"+a];if(!i&&this.calendars[o]&&(i=new this.calendars[o](a),this._localCals[o+"-"+a]=i),!i)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,o);return i},newDate:function(o,a,i,n,s){return n=(o!=null&&o.year?o.calendar():typeof n=="string"?this.instance(n,s):n)||this.instance(),n.newDate(o,a,i)},substituteDigits:function(o){return function(a){return(a+"").replace(/[0-9]/g,function(i){return o[i]})}},substituteChineseDigits:function(o,a){return function(i){for(var n="",s=0;i>0;){var c=i%10;n=(c===0?"":o[c]+a[s])+n,s++,i=Math.floor(i/10)}return n.indexOf(o[1]+a[1])===0&&(n=n.substr(1)),n||o[0]}}});function A(o,a,i,n){if(this._calendar=o,this._year=a,this._month=i,this._day=n,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function E(o,a){return o=""+o,"000000".substring(0,a-o.length)+o}d(A.prototype,{newDate:function(o,a,i){return this._calendar.newDate(o??this,a,i)},year:function(o){return arguments.length===0?this._year:this.set(o,"y")},month:function(o){return arguments.length===0?this._month:this.set(o,"m")},day:function(o){return arguments.length===0?this._day:this.set(o,"d")},date:function(o,a,i){if(!this._calendar.isValid(o,a,i))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=o,this._month=a,this._day=i,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(o,a){return this._calendar.add(this,o,a)},set:function(o,a){return this._calendar.set(this,o,a)},compareTo:function(o){if(this._calendar.name!==o._calendar.name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,o._calendar.local.name);var a=this._year!==o._year?this._year-o._year:this._month!==o._month?this.monthOfYear()-o.monthOfYear():this._day-o._day;return a===0?0:a<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(o){return this._calendar.fromJD(o)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(o){return this._calendar.fromJSDate(o)},toString:function(){return(this.year()<0?"-":"")+E(Math.abs(this.year()),4)+"-"+E(this.month(),2)+"-"+E(this.day(),2)}});function e(){this.shortYearCutoff="+10"}d(e.prototype,{_validateLevel:0,newDate:function(o,a,i){return o==null?this.today():(o.year&&(this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),i=o.day(),a=o.month(),o=o.year()),new A(this,o,a,i))},today:function(){return this.fromJSDate(new Date)},epoch:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return a.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return(a.year()<0?"-":"")+E(Math.abs(a.year()),4)},monthsInYear:function(o){return this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),12},monthOfYear:function(o,a){var i=this._validate(o,a,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return(i.month()+this.monthsInYear(i)-this.firstMonth)%this.monthsInYear(i)+this.minMonth},fromMonthOfYear:function(o,a){var i=(a+this.firstMonth-2*this.minMonth)%this.monthsInYear(o)+this.minMonth;return this._validate(o,i,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth),i},daysInYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return this.leapYear(a)?366:365},dayOfYear:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(o,a,i){return this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),{}},add:function(o,a,i){return this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate),this._correctAdd(o,this._add(o,a,i),a,i)},_add:function(o,a,i){if(this._validateLevel++,i==="d"||i==="w"){var n=o.toJD()+a*(i==="w"?this.daysInWeek():1),s=o.calendar().fromJD(n);return this._validateLevel--,[s.year(),s.month(),s.day()]}try{var c=o.year()+(i==="y"?a:0),f=o.monthOfYear()+(i==="m"?a:0),s=o.day(),v=function(l){for(;fy-1+l.minMonth;)c++,f-=y,y=l.monthsInYear(c)};i==="y"?(o.month()!==this.fromMonthOfYear(c,f)&&(f=this.newDate(c,o.month(),this.minDay).monthOfYear()),f=Math.min(f,this.monthsInYear(c)),s=Math.min(s,this.daysInMonth(c,this.fromMonthOfYear(c,f)))):i==="m"&&(v(this),s=Math.min(s,this.daysInMonth(c,this.fromMonthOfYear(c,f))));var h=[c,this.fromMonthOfYear(c,f),s];return this._validateLevel--,h}catch(T){throw this._validateLevel--,T}},_correctAdd:function(o,a,i,n){if(!this.hasYearZero&&(n==="y"||n==="m")&&(a[0]===0||o.year()>0!=a[0]>0)){var s={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],c=i<0?-1:1;a=this._add(o,i*s[0]+c*s[1],s[2])}return o.date(a[0],a[1],a[2])},set:function(o,a,i){this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate);var n=i==="y"?a:o.year(),s=i==="m"?a:o.month(),c=i==="d"?a:o.day();return(i==="y"||i==="m")&&(c=Math.min(c,this.daysInMonth(n,s))),o.date(n,s,c)},isValid:function(o,a,i){this._validateLevel++;var n=this.hasYearZero||o!==0;if(n){var s=this.newDate(o,a,this.minDay);n=a>=this.minMonth&&a-this.minMonth=this.minDay&&i-this.minDay13.5?13:1),T=s-(h>2.5?4716:4715);return T<=0&&T--,this.newDate(T,h,v)},toJSDate:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),s=new Date(n.year(),n.month()-1,n.day());return s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0),s.setHours(s.getHours()>12?s.getHours()+2:0),s},fromJSDate:function(o){return this.newDate(o.getFullYear(),o.getMonth()+1,o.getDate())}});var r=G.exports=new x;r.cdate=A,r.baseCalendar=e,r.calendars.gregorian=t}}),Cz=He({"node_modules/world-calendars/dist/plus.js"(){var Y=Yc(),G=vh();Y(G.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"}),G.local=G.regionalOptions[""],Y(G.cdate.prototype,{formatDate:function(d,x){return typeof d!="string"&&(x=d,d=""),this._calendar.formatDate(d||"",this,x)}}),Y(G.baseCalendar.prototype,{UNIX_EPOCH:G.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:24*60*60,TICKS_EPOCH:G.instance().jdEpoch,TICKS_PER_DAY:24*60*60*1e7,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(d,x,A){if(typeof d!="string"&&(A=x,x=d,d=""),!x)return"";if(x.calendar()!==this)throw G.local.invalidFormat||G.regionalOptions[""].invalidFormat;d=d||this.local.dateFormat,A=A||{};var E=A.dayNamesShort||this.local.dayNamesShort,e=A.dayNames||this.local.dayNames,t=A.monthNumbers||this.local.monthNumbers,r=A.monthNamesShort||this.local.monthNamesShort,o=A.monthNames||this.local.monthNames;A.calculateWeek||this.local.calculateWeek;for(var a=function(b,S){for(var M=1;y+M1},i=function(b,S,M,_){var w=""+S;if(a(b,_))for(;w.length1},y=function(R,P){var z=l(R,P),F=[2,3,z?4:2,z?4:2,10,11,20]["oyYJ@!".indexOf(R)+1],B=new RegExp("^-?\\d{1,"+F+"}"),O=x.substring(p).match(B);if(!O)throw(G.local.missingNumberAt||G.regionalOptions[""].missingNumberAt).replace(/\{0\}/,p);return p+=O[0].length,parseInt(O[0],10)},b=this,S=function(){if(typeof o=="function"){l("m");var R=o.call(b,x.substring(p));return p+=R.length,R}return y("m")},M=function(R,P,z,F){for(var B=l(R,F)?z:P,O=0;O-1){c=1,f=v;for(var m=this.daysInMonth(s,c);f>m;m=this.daysInMonth(s,c))c++,f-=m}return n>-1?this.fromJD(n):this.newDate(s,c,f)},determineDate:function(d,x,A,E,e){A&&typeof A!="object"&&(e=E,E=A,A=null),typeof E!="string"&&(e=E,E="");var t=this,r=function(o){try{return t.parseDate(E,o,e)}catch{}o=o.toLowerCase();for(var a=(o.match(/^c/)&&A?A.newDate():null)||t.today(),i=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,n=i.exec(o);n;)a.add(parseInt(n[1],10),n[2]||"d"),n=i.exec(o);return a};return x=x?x.newDate():null,d=d==null?x:typeof d=="string"?r(d):typeof d=="number"?isNaN(d)||d===1/0||d===-1/0?x:t.today().add(d,"d"):t.newDate(d),d}})}}),Lz=He({"node_modules/world-calendars/dist/calendars/chinese.js"(){var Y=vh(),G=Yc(),d=Y.instance();function x(n){this.local=this.regionalOptions[n||""]||this.regionalOptions[""]}x.prototype=new Y.baseCalendar,G(x.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(n,s){if(typeof n=="string"){var c=n.match(E);return c?c[0]:""}var f=this._validateYear(n),v=n.month(),h=""+this.toChineseMonth(f,v);return s&&h.length<2&&(h="0"+h),this.isIntercalaryMonth(f,v)&&(h+="i"),h},monthNames:function(n){if(typeof n=="string"){var s=n.match(e);return s?s[0]:""}var c=this._validateYear(n),f=n.month(),v=this.toChineseMonth(c,f),h=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][v-1];return this.isIntercalaryMonth(c,f)&&(h="闰"+h),h},monthNamesShort:function(n){if(typeof n=="string"){var s=n.match(t);return s?s[0]:""}var c=this._validateYear(n),f=n.month(),v=this.toChineseMonth(c,f),h=["一","二","三","四","五","六","七","八","九","十","十一","十二"][v-1];return this.isIntercalaryMonth(c,f)&&(h="闰"+h),h},parseMonth:function(n,s){n=this._validateYear(n);var c=parseInt(s),f;if(isNaN(c))s[0]==="闰"&&(f=!0,s=s.substring(1)),s[s.length-1]==="月"&&(s=s.substring(0,s.length-1)),c=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(s);else{var v=s[s.length-1];f=v==="i"||v==="I"}var h=this.toMonthIndex(n,c,f);return h},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(n,s){if(n.year&&(n=n.year()),typeof n!="number"||n<1888||n>2111)throw s.replace(/\{0\}/,this.local.name);return n},toMonthIndex:function(n,s,c){var f=this.intercalaryMonth(n),v=c&&s!==f;if(v||s<1||s>12)throw Y.local.invalidMonth.replace(/\{0\}/,this.local.name);var h;return f?!c&&s<=f?h=s-1:h=s:h=s-1,h},toChineseMonth:function(n,s){n.year&&(n=n.year(),s=n.month());var c=this.intercalaryMonth(n),f=c?12:11;if(s<0||s>f)throw Y.local.invalidMonth.replace(/\{0\}/,this.local.name);var v;return c?s>13;return c},isIntercalaryMonth:function(n,s){n.year&&(n=n.year(),s=n.month());var c=this.intercalaryMonth(n);return!!c&&c===s},leapYear:function(n){return this.intercalaryMonth(n)!==0},weekOfYear:function(n,s,c){var f=this._validateYear(n,Y.local.invalidyear),v=o[f-o[0]],h=v>>9&4095,T=v>>5&15,l=v&31,y;y=d.newDate(h,T,l),y.add(4-(y.dayOfWeek()||7),"d");var b=this.toJD(n,s,c)-y.toJD();return 1+Math.floor(b/7)},monthsInYear:function(n){return this.leapYear(n)?13:12},daysInMonth:function(n,s){n.year&&(s=n.month(),n=n.year()),n=this._validateYear(n);var c=r[n-r[0]],f=c>>13,v=f?12:11;if(s>v)throw Y.local.invalidMonth.replace(/\{0\}/,this.local.name);var h=c&1<<12-s?30:29;return h},weekDay:function(n,s,c){return(this.dayOfWeek(n,s,c)||7)<6},toJD:function(n,s,c){var f=this._validate(n,h,c,Y.local.invalidDate);n=this._validateYear(f.year()),s=f.month(),c=f.day();var v=this.isIntercalaryMonth(n,s),h=this.toChineseMonth(n,s),T=i(n,h,c,v);return d.toJD(T.year,T.month,T.day)},fromJD:function(n){var s=d.fromJD(n),c=a(s.year(),s.month(),s.day()),f=this.toMonthIndex(c.year,c.month,c.isIntercalary);return this.newDate(c.year,f,c.day)},fromString:function(n){var s=n.match(A),c=this._validateYear(+s[1]),f=+s[2],v=!!s[3],h=this.toMonthIndex(c,f,v),T=+s[4];return this.newDate(c,h,T)},add:function(n,s,c){var f=n.year(),v=n.month(),h=this.isIntercalaryMonth(f,v),T=this.toChineseMonth(f,v),l=Object.getPrototypeOf(x.prototype).add.call(this,n,s,c);if(c==="y"){var y=l.year(),b=l.month(),S=this.isIntercalaryMonth(y,T),M=h&&S?this.toMonthIndex(y,T,!0):this.toMonthIndex(y,T,!1);M!==b&&l.month(M)}return l}});var A=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,E=/^\d?\d[iI]?/m,e=/^闰?十?[一二三四五六七八九]?月/m,t=/^闰?十?[一二三四五六七八九]?/m;Y.calendars.chinese=x;var r=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],o=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function a(n,s,c,f){var v,h;if(typeof n=="object")v=n,h=s||{};else{var T=typeof n=="number"&&n>=1888&&n<=2111;if(!T)throw new Error("Solar year outside range 1888-2111");var l=typeof s=="number"&&s>=1&&s<=12;if(!l)throw new Error("Solar month outside range 1 - 12");var y=typeof c=="number"&&c>=1&&c<=31;if(!y)throw new Error("Solar day outside range 1 - 31");v={year:n,month:s,day:c},h={}}var b=o[v.year-o[0]],S=v.year<<9|v.month<<5|v.day;h.year=S>=b?v.year:v.year-1,b=o[h.year-o[0]];var M=b>>9&4095,_=b>>5&15,w=b&31,p,u=new Date(M,_-1,w),g=new Date(v.year,v.month-1,v.day);p=Math.round((g-u)/(24*3600*1e3));var m=r[h.year-r[0]],R;for(R=0;R<13;R++){var P=m&1<<12-R?30:29;if(p>13;return!z||R=1888&&n<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var y=typeof s=="number"&&s>=1&&s<=12;if(!y)throw new Error("Lunar month outside range 1 - 12");var b=typeof c=="number"&&c>=1&&c<=30;if(!b)throw new Error("Lunar day outside range 1 - 30");var S;typeof f=="object"?(S=!1,h=f):(S=!!f,h={}),T={year:n,month:s,day:c,isIntercalary:S}}var M;M=T.day-1;var _=r[T.year-r[0]],w=_>>13,p;w&&(T.month>w||T.isIntercalary)?p=T.month:p=T.month-1;for(var u=0;u>9&4095,P=m>>5&15,z=m&31,F=new Date(R,P-1,z+M);return h.year=F.getFullYear(),h.month=1+F.getMonth(),h.day=F.getDate(),h}}}),Pz=He({"node_modules/world-calendars/dist/calendars/coptic.js"(){var Y=vh(),G=Yc();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.prototype,{name:"Coptic",jdEpoch:18250295e-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:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),E=A.year()+(A.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear||Y.regionalOptions[""].invalidYear),13},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return(this.dayOfWeek(x,A,E)||7)<6},toJD:function(x,A,E){var e=this._validate(x,A,E,Y.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var A=Math.floor(x)+.5-this.jdEpoch,E=Math.floor((A-Math.floor((A+366)/1461))/365)+1;E<=0&&E--,A=Math.floor(x)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(A/30)+1,t=A-(e-1)*30+1;return this.newDate(E,e,t)}}),Y.calendars.coptic=d}}),Iz=He({"node_modules/world-calendars/dist/calendars/discworld.js"(){var Y=vh(),G=Yc();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(A){return this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear),!1},monthsInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear),13},daysInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear),400},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/8)+1},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);return(t.day()+1)%8},weekDay:function(A,E,e){var t=this.dayOfWeek(A,E,e);return t>=2&&t<=6},extraInfo:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);return{century:x[Math.floor((t.year()-1)/100)+1]||""}},toJD:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);return A=t.year()+(t.year()<0?1:0),E=t.month(),e=t.day(),e+(E>1?16:0)+(E>2?(E-2)*32:0)+(A-1)*400+this.jdEpoch-1},fromJD:function(A){A=Math.floor(A+.5)-Math.floor(this.jdEpoch)-1;var E=Math.floor(A/400)+1;A-=(E-1)*400,A+=A>15?16:0;var e=Math.floor(A/32)+1,t=A-(e-1)*32+1;return this.newDate(E<=0?E-1:E,e,t)}});var x={20:"Fruitbat",21:"Anchovy"};Y.calendars.discworld=d}}),Rz=He({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var Y=vh(),G=Yc();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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(E){var A=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),E=A.year()+(A.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear||Y.regionalOptions[""].invalidYear),13},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return(this.dayOfWeek(x,A,E)||7)<6},toJD:function(x,A,E){var e=this._validate(x,A,E,Y.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var A=Math.floor(x)+.5-this.jdEpoch,E=Math.floor((A-Math.floor((A+366)/1461))/365)+1;E<=0&&E--,A=Math.floor(x)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(A/30)+1,t=A-(e-1)*30+1;return this.newDate(E,e,t)}}),Y.calendars.ethiopian=d}}),Dz=He({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var Y=vh(),G=Yc();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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(A){var E=this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear);return this._leapYear(E.year())},_leapYear:function(A){return A=A<0?A+1:A,x(A*7+1,19)<7},monthsInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear),this._leapYear(A.year?A.year():A)?13:12},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear);return A=E.year(),this.toJD(A===-1?1:A+1,7,1)-this.toJD(A,7,1)},daysInMonth:function(A,E){return A.year&&(E=A.month(),A=A.year()),this._validate(A,E,this.minDay,Y.local.invalidMonth),E===12&&this.leapYear(A)||E===8&&x(this.daysInYear(A),10)===5?30:E===9&&x(this.daysInYear(A),10)===3?29:this.daysPerMonth[E-1]},weekDay:function(A,E,e){return this.dayOfWeek(A,E,e)!==6},extraInfo:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);return{yearType:(this.leapYear(t)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(t)%10-3]}},toJD:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);A=t.year(),E=t.month(),e=t.day();var r=A<=0?A+1:A,o=this.jdEpoch+this._delay1(r)+this._delay2(r)+e+1;if(E<7){for(var a=7;a<=this.monthsInYear(A);a++)o+=this.daysInMonth(A,a);for(var a=1;a=this.toJD(E===-1?1:E+1,7,1);)E++;for(var e=Athis.toJD(E,e,this.daysInMonth(E,e));)e++;var t=A-this.toJD(E,e,1)+1;return this.newDate(E,e,t)}});function x(A,E){return A-E*Math.floor(A/E)}Y.calendars.hebrew=d}}),zz=He({"node_modules/world-calendars/dist/calendars/islamic.js"(){var Y=vh(),G=Yc();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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īs","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(x){var A=this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear);return(A.year()*11+14)%30<11},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){return this.leapYear(x)?355:354},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===12&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return this.dayOfWeek(x,A,E)!==5},toJD:function(x,A,E){var e=this._validate(x,A,E,Y.local.invalidDate);return x=e.year(),A=e.month(),E=e.day(),x=x<=0?x+1:x,E+Math.ceil(29.5*(A-1))+(x-1)*354+Math.floor((3+11*x)/30)+this.jdEpoch-1},fromJD:function(x){x=Math.floor(x)+.5;var A=Math.floor((30*(x-this.jdEpoch)+10646)/10631);A=A<=0?A-1:A;var E=Math.min(12,Math.ceil((x-29-this.toJD(A,1,1))/29.5)+1),e=x-this.toJD(A,E,1)+1;return this.newDate(A,E,e)}}),Y.calendars.islamic=d}}),Fz=He({"node_modules/world-calendars/dist/calendars/julian.js"(){var Y=vh(),G=Yc();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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(E){var A=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),E=A.year()<0?A.year()+1:A.year();return E%4===0},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(4-(e.dayOfWeek()||7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===2&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return(this.dayOfWeek(x,A,E)||7)<6},toJD:function(x,A,E){var e=this._validate(x,A,E,Y.local.invalidDate);return x=e.year(),A=e.month(),E=e.day(),x<0&&x++,A<=2&&(x--,A+=12),Math.floor(365.25*(x+4716))+Math.floor(30.6001*(A+1))+E-1524.5},fromJD:function(x){var A=Math.floor(x+.5),E=A+1524,e=Math.floor((E-122.1)/365.25),t=Math.floor(365.25*e),r=Math.floor((E-t)/30.6001),o=r-Math.floor(r<14?1:13),a=e-Math.floor(o>2?4716:4715),i=E-t-Math.floor(30.6001*r);return a<=0&&a--,this.newDate(a,o,i)}}),Y.calendars.julian=d}}),Oz=He({"node_modules/world-calendars/dist/calendars/mayan.js"(){var Y=vh(),G=Yc();function d(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(E){return this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),!1},formatYear:function(E){var e=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear);E=e.year();var t=Math.floor(E/400);E=E%400,E+=E<0?400:0;var r=Math.floor(E/20);return t+"."+r+"."+E%20},forYear:function(E){if(E=E.split("."),E.length<3)throw"Invalid Mayan year";for(var e=0,t=0;t19||t>0&&r<0)throw"Invalid Mayan year";e=e*20+r}return e},monthsInYear:function(E){return this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),18},weekOfYear:function(E,e,t){return this._validate(E,e,t,Y.local.invalidDate),0},daysInYear:function(E){return this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),360},daysInMonth:function(E,e){return this._validate(E,e,this.minDay,Y.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(E,e,t){var r=this._validate(E,e,t,Y.local.invalidDate);return r.day()},weekDay:function(E,e,t){return this._validate(E,e,t,Y.local.invalidDate),!0},extraInfo:function(E,e,t){var r=this._validate(E,e,t,Y.local.invalidDate),o=r.toJD(),a=this._toHaab(o),i=this._toTzolkin(o);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[i[0]-1],tzolkinDay:i[0],tzolkinTrecena:i[1]}},_toHaab:function(E){E-=this.jdEpoch;var e=x(E+8+17*20,365);return[Math.floor(e/20)+1,x(e,20)]},_toTzolkin:function(E){return E-=this.jdEpoch,[A(E+20,20),A(E+4,13)]},toJD:function(E,e,t){var r=this._validate(E,e,t,Y.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(E){E=Math.floor(E)+.5-this.jdEpoch;var e=Math.floor(E/360);E=E%360,E+=E<0?360:0;var t=Math.floor(E/20),r=E%20;return this.newDate(e,t,r)}});function x(E,e){return E-e*Math.floor(E/e)}function A(E,e){return x(E-1,e)+1}Y.calendars.mayan=d}}),Bz=He({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var Y=vh(),G=Yc();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar;var x=Y.instance("gregorian");G(d.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(A){var E=this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear||Y.regionalOptions[""].invalidYear);return x.leapYear(E.year()+(E.year()<1?1:0)+1469)},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(1-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return(this.dayOfWeek(A,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Y.local.invalidMonth),r=t.year();r<0&&r++;for(var o=t.day(),a=1;a=this.toJD(E+1,1,1);)E++;for(var e=A-Math.floor(this.toJD(E,1,1)+.5)+1,t=1;e>this.daysInMonth(E,t);)e-=this.daysInMonth(E,t),t++;return this.newDate(E,t,e)}}),Y.calendars.nanakshahi=d}}),Nz=He({"node_modules/world-calendars/dist/calendars/nepali.js"(){var Y=vh(),G=Yc();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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(x){return this.daysInYear(x)!==this.daysPerYear},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){var A=this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear);if(x=A.year(),typeof this.NEPALI_CALENDAR_DATA[x]>"u")return this.daysPerYear;for(var E=0,e=this.minMonth;e<=12;e++)E+=this.NEPALI_CALENDAR_DATA[x][e];return E},daysInMonth:function(x,A){return x.year&&(A=x.month(),x=x.year()),this._validate(x,A,this.minDay,Y.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[x]>"u"?this.daysPerMonth[A-1]:this.NEPALI_CALENDAR_DATA[x][A]},weekDay:function(x,A,E){return this.dayOfWeek(x,A,E)!==6},toJD:function(x,A,E){var e=this._validate(x,A,E,Y.local.invalidDate);x=e.year(),A=e.month(),E=e.day();var t=Y.instance(),r=0,o=A,a=x;this._createMissingCalendarData(x);var i=x-(o>9||o===9&&E>=this.NEPALI_CALENDAR_DATA[a][0]?56:57);for(A!==9&&(r=E,o--);o!==9;)o<=0&&(o=12,a--),r+=this.NEPALI_CALENDAR_DATA[a][o],o--;return A===9?(r+=E-this.NEPALI_CALENDAR_DATA[a][0],r<0&&(r+=t.daysInYear(i))):r+=this.NEPALI_CALENDAR_DATA[a][9]-this.NEPALI_CALENDAR_DATA[a][0],t.newDate(i,1,1).add(r,"d").toJD()},fromJD:function(x){var A=Y.instance(),E=A.fromJD(x),e=E.year(),t=E.dayOfYear(),r=e+56;this._createMissingCalendarData(r);for(var o=9,a=this.NEPALI_CALENDAR_DATA[r][0],i=this.NEPALI_CALENDAR_DATA[r][o]-a+1;t>i;)o++,o>12&&(o=1,r++),i+=this.NEPALI_CALENDAR_DATA[r][o];var n=this.NEPALI_CALENDAR_DATA[r][o]-(i-t);return this.newDate(r,o,n)},_createMissingCalendarData:function(x){var A=this.daysPerMonth.slice(0);A.unshift(17);for(var E=x-1;E"u"&&(this.NEPALI_CALENDAR_DATA[E]=A)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),Y.calendars.nepali=d}}),Uz=He({"node_modules/world-calendars/dist/calendars/persian.js"(){var Y=vh(),G=Yc();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Chæharshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Chæ","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear);return((E.year()-(E.year()>0?474:473))%2820+474+38)*682%2816<682},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-((t.dayOfWeek()+1)%7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return this.dayOfWeek(A,E,e)!==5},toJD:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);A=t.year(),E=t.month(),e=t.day();var r=A-(A>=0?474:473),o=474+x(r,2820);return e+(E<=7?(E-1)*31:(E-1)*30+6)+Math.floor((o*682-110)/2816)+(o-1)*365+Math.floor(r/2820)*1029983+this.jdEpoch-1},fromJD:function(A){A=Math.floor(A)+.5;var E=A-this.toJD(475,1,1),e=Math.floor(E/1029983),t=x(E,1029983),r=2820;if(t!==1029982){var o=Math.floor(t/366),a=x(t,366);r=Math.floor((2134*o+2816*a+2815)/1028522)+o+1}var i=r+2820*e+474;i=i<=0?i-1:i;var n=A-this.toJD(i,1,1)+1,s=n<=186?Math.ceil(n/31):Math.ceil((n-6)/30),c=A-this.toJD(i,s,1)+1;return this.newDate(i,s,c)}});function x(A,E){return A-E*Math.floor(A/E)}Y.calendars.persian=d,Y.calendars.jalali=d}}),jz=He({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var Y=vh(),G=Yc(),d=Y.instance();function x(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}x.prototype=new Y.baseCalendar,G(x.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(e){var E=this._validate(e,this.minMonth,this.minDay,Y.local.invalidYear),e=this._t2gYear(E.year());return d.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,Y.local.invalidYear),r=this._t2gYear(t.year());return d.weekOfYear(r,t.month(),t.day())},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return(this.dayOfWeek(A,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Y.local.invalidDate),r=this._t2gYear(t.year());return d.toJD(r,t.month(),t.day())},fromJD:function(A){var E=d.fromJD(A),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(A){return A+this.yearsOffset+(A>=-this.yearsOffset&&A<=-1?1:0)},_g2tYear:function(A){return A-this.yearsOffset-(A>=1&&A<=this.yearsOffset?1:0)}}),Y.calendars.taiwan=x}}),Vz=He({"node_modules/world-calendars/dist/calendars/thai.js"(){var Y=vh(),G=Yc(),d=Y.instance();function x(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}x.prototype=new Y.baseCalendar,G(x.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(e){var E=this._validate(e,this.minMonth,this.minDay,Y.local.invalidYear),e=this._t2gYear(E.year());return d.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,Y.local.invalidYear),r=this._t2gYear(t.year());return d.weekOfYear(r,t.month(),t.day())},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return(this.dayOfWeek(A,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Y.local.invalidDate),r=this._t2gYear(t.year());return d.toJD(r,t.month(),t.day())},fromJD:function(A){var E=d.fromJD(A),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(A){return A-this.yearsOffset-(A>=1&&A<=this.yearsOffset?1:0)},_g2tYear:function(A){return A+this.yearsOffset+(A>=-this.yearsOffset&&A<=-1?1:0)}}),Y.calendars.thai=x}}),qz=He({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var Y=vh(),G=Yc();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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āthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear);return this.daysInYear(E.year())===355},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(A){for(var E=0,e=1;e<=12;e++)E+=this.daysInMonth(A,e);return E},daysInMonth:function(A,E){for(var e=this._validate(A,E,this.minDay,Y.local.invalidMonth),t=e.toJD()-24e5+.5,r=0,o=0;ot)return x[r]-x[r-1];r++}return 30},weekDay:function(A,E,e){return this.dayOfWeek(A,E,e)!==5},toJD:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate),r=12*(t.year()-1)+t.month()-15292,o=t.day()+x[r-1]-1;return o+24e5-.5},fromJD:function(A){for(var E=A-24e5+.5,e=0,t=0;tE);t++)e++;var r=e+15292,o=Math.floor((r-1)/12),a=o+1,i=r-12*o,n=E-x[e-1]+1;return this.newDate(a,i,n)},isValid:function(A,E,e){var t=Y.baseCalendar.prototype.isValid.apply(this,arguments);return t&&(A=A.year!=null?A.year:A,t=A>=1276&&A<=1500),t},_validate:function(A,E,e,t){var r=Y.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw t.replace(/\{0\}/,this.local.name);return r}}),Y.calendars.ummalqura=d;var x=[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]}}),Hz=He({"src/components/calendars/calendars.js"(Y,G){G.exports=vh(),Cz(),Lz(),Pz(),Iz(),Rz(),Dz(),zz(),Fz(),Oz(),Bz(),Nz(),Uz(),jz(),Vz(),qz()}}),Gz=He({"src/components/calendars/index.js"(Y,G){var d=Hz(),x=Gr(),A=lo(),E=A.EPOCHJD,e=A.ONEDAY,t={valType:"enumerated",values:x.sortObjectKeys(d.calendars),editType:"calc",dflt:"gregorian"},r=function(_,w,p,u){var g={};return g[p]=t,x.coerce(_,w,g,p,u)},o=function(_,w,p,u){for(var g=0;g + * @license MIT + *//*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *//*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + *//*! + * pad-left + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT license. + *//*! + * repeat-string + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + *//*! Bundled license information: + +native-promise-only/lib/npo.src.js: + (*! Native Promise Only + v0.8.1 (c) Kyle Simpson + MIT License: http://getify.mit-license.org + *) + +polybooljs/index.js: + (* + * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc + * @license MIT + * @preserve Project Home: https://github.com/voidqk/polybooljs + *) + +ieee754/index.js: + (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) + +buffer/index.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) + +safe-buffer/index.js: + (*! safe-buffer. MIT License. Feross Aboukhadijeh *) + +assert/build/internal/util/comparisons.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) + +object-assign/index.js: + (* + object-assign + (c) Sindre Sorhus + @license MIT + *) + +maplibre-gl/dist/maplibre-gl.js: + (** + * MapLibre GL JS + * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt + *) +*/return window.Plotly=Ch,Ch})}(Wm)),Wm.exports}var $A;function U8(){return $A||($A=1,function(uh){Object.defineProperty(uh,"__esModule",{value:!0}),uh.default=void 0;var Th=qs(O8()),Ch=qs(N8());function qs(Zh){return Zh&&Zh.__esModule?Zh:{default:Zh}}var vf=(0,Th.default)(Ch.default),Wh=vf;uh.default=Wh}(lb)),lb}var j8=U8();const V8=P8(j8),G8=({orgId:uh,runId:Th})=>{const[Ch,qs]=Gm.useState(!0),[vf,Wh]=Gm.useState(null),[Zh,wp]=Gm.useState([]);return Gm.useEffect(()=>{(async()=>{try{const Bh=await R8.getRunEvents(uh,Th),Nv={};Bh.forEach(mv=>{const Nh=mv.data,Sf=Nh.step||Nh.global_step;Sf!==void 0&&Object.entries(Nh).forEach(([av,ks])=>{av!=="step"&&av!=="global_step"&&(typeof ks=="number"||typeof ks=="string"&&!isNaN(Number(ks)))&&(Nv[av]||(Nv[av]=[]),Nv[av].push({step:Number(Sf),value:Number(ks)}))})});const rv=[];for(const[mv,Nh]of Object.entries(Nv))Nh.length>1&&(Nh.sort((Sf,av)=>Sf.step-av.step),rv.push({title:mv,x:Nh.map(Sf=>Sf.step),y:Nh.map(Sf=>Sf.value)}));wp(rv),qs(!1)}catch(Bh){console.error("Error fetching events:",Bh),Wh(Bh instanceof Error?Bh.message:"Error fetching metrics"),qs(!1)}})()},[uh,Th]),Ch?yv.jsx(C0,{sx:{display:"flex",justifyContent:"center",p:3},children:yv.jsx(I8,{})}):vf?yv.jsx(C0,{sx:{p:2},children:yv.jsxs(nb,{color:"error",children:["Error loading metrics: ",vf]})}):Zh.length===0?yv.jsx(C0,{sx:{p:2},children:yv.jsx(nb,{children:"No metrics data available for plotting"})}):yv.jsxs(C0,{children:[yv.jsx(nb,{variant:"h6",sx:{mb:2},children:"Metrics:"}),yv.jsx(C0,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(500px, 1fr))",gap:3},children:Zh.map((Lh,Bh)=>yv.jsx(C0,{sx:{minHeight:400},children:yv.jsx(V8,{data:[{x:Lh.x,y:Lh.y,type:"scatter",mode:"lines+markers",name:Lh.title,line:{color:"#1f77b4",width:2},marker:{size:6}}],layout:{title:{text:Lh.title,y:.95,x:.05,xanchor:"left",yanchor:"top",font:{size:16,color:"#333"}},xaxis:{title:"step",showgrid:!0,gridcolor:"#E1E5EA",zeroline:!1},yaxis:{title:Lh.title,showgrid:!0,gridcolor:"#E1E5EA",zeroline:!1},autosize:!0,margin:{t:60,r:30,l:60,b:50},plot_bgcolor:"white",paper_bgcolor:"white",showlegend:!0,legend:{x:1,y:1,xanchor:"right",yanchor:"top",bgcolor:"rgba(255, 255, 255, 0.8)",bordercolor:"#E1E5EA",borderwidth:1}},style:{width:"100%",height:"100%"},config:{responsive:!0,displayModeBar:!0,displaylogo:!1,modeBarButtonsToAdd:["toImage"],modeBarButtonsToRemove:["select2d","lasso2d"],toImageButtonOptions:{format:"png",filename:`${Lh.title}_${Th}`,height:800,width:1200,scale:2}}})},Bh))})]})};export{G8 as MetricsPlots}; diff --git a/openweights/dashboard/backend/static/assets/MetricsPlots-Dy5N4URR.js b/openweights/dashboard/backend/static/assets/MetricsPlots-Dy5N4URR.js new file mode 100644 index 0000000..19e4e6b --- /dev/null +++ b/openweights/dashboard/backend/static/assets/MetricsPlots-Dy5N4URR.js @@ -0,0 +1,3855 @@ +import{r as L8,g as P8,a as Gm,j as yv,B as C0,C as I8,T as nb,b as R8}from"./index-CmfXCDny.js";var ib={exports:{}},ob,ZA;function D8(){if(ZA)return ob;ZA=1;var uh="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ob=uh,ob}var sb,XA;function z8(){if(XA)return sb;XA=1;var uh=D8();function Th(){}function Ch(){}return Ch.resetWarningCache=Th,sb=function(){function qs(Zh,wp,Lh,Bh,Nv,rv){if(rv!==uh){var mv=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw mv.name="Invariant Violation",mv}}qs.isRequired=qs;function vf(){return qs}var Wh={array:qs,bigint:qs,bool:qs,func:qs,number:qs,object:qs,string:qs,symbol:qs,any:qs,arrayOf:vf,element:qs,elementType:qs,instanceOf:vf,node:qs,objectOf:vf,oneOf:vf,oneOfType:vf,shape:vf,exact:vf,checkPropTypes:Ch,resetWarningCache:Th};return Wh.PropTypes=Wh,Wh},sb}var YA;function F8(){return YA||(YA=1,ib.exports=z8()()),ib.exports}var lb={},ub={},KA;function O8(){return KA||(KA=1,function(uh){function Th(Go){"@babel/helpers - typeof";return Th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Fs){return typeof Fs}:function(Fs){return Fs&&typeof Symbol=="function"&&Fs.constructor===Symbol&&Fs!==Symbol.prototype?"symbol":typeof Fs},Th(Go)}Object.defineProperty(uh,"__esModule",{value:!0}),uh.default=Zm;var Ch=Zh(L8()),qs=vf(F8());function vf(Go){return Go&&Go.__esModule?Go:{default:Go}}function Wh(Go){if(typeof WeakMap!="function")return null;var Fs=new WeakMap,Tc=new WeakMap;return(Wh=function(Bf){return Bf?Tc:Fs})(Go)}function Zh(Go,Fs){if(Go&&Go.__esModule)return Go;if(Go===null||Th(Go)!=="object"&&typeof Go!="function")return{default:Go};var Tc=Wh(Fs);if(Tc&&Tc.has(Go))return Tc.get(Go);var Qn={},Bf=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Xl in Go)if(Xl!=="default"&&Object.prototype.hasOwnProperty.call(Go,Xl)){var co=Bf?Object.getOwnPropertyDescriptor(Go,Xl):null;co&&(co.get||co.set)?Object.defineProperty(Qn,Xl,co):Qn[Xl]=Go[Xl]}return Qn.default=Go,Tc&&Tc.set(Go,Qn),Qn}function wp(Go,Fs){if(!(Go instanceof Fs))throw new TypeError("Cannot call a class as a function")}function Lh(Go,Fs){for(var Tc=0;Tc"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ks(Go){return ks=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Tc){return Tc.__proto__||Object.getPrototypeOf(Tc)},ks(Go)}var He=["AfterExport","AfterPlot","Animated","AnimatingFrame","AnimationInterrupted","AutoSize","BeforeExport","BeforeHover","ButtonClicked","Click","ClickAnnotation","Deselect","DoubleClick","Framework","Hover","LegendClick","LegendDoubleClick","Relayout","Relayouting","Restyle","Redraw","Selected","Selecting","SliderChange","SliderEnd","SliderStart","SunburstClick","Transitioning","TransitionInterrupted","Unhover","WebGlContextLost"],L0=["plotly_restyle","plotly_redraw","plotly_relayout","plotly_relayouting","plotly_doubleclick","plotly_animated","plotly_sunburstclick"],Tp=typeof window<"u";function Zm(Go){var Fs=function(Tc){Nv(Bf,Tc);var Qn=mv(Bf);function Bf(Xl){var co;return wp(this,Bf),co=Qn.call(this,Xl),co.p=Promise.resolve(),co.resizeHandler=null,co.handlers={},co.syncWindowResize=co.syncWindowResize.bind(Sf(co)),co.syncEventHandlers=co.syncEventHandlers.bind(Sf(co)),co.attachUpdateEvents=co.attachUpdateEvents.bind(Sf(co)),co.getRef=co.getRef.bind(Sf(co)),co.handleUpdate=co.handleUpdate.bind(Sf(co)),co.figureCallback=co.figureCallback.bind(Sf(co)),co.updatePlotly=co.updatePlotly.bind(Sf(co)),co}return Bh(Bf,[{key:"updatePlotly",value:function(co,Ac,Hi){var lo=this;this.p=this.p.then(function(){if(!lo.unmounting){if(!lo.el)throw new Error("Missing element reference");return Go.react(lo.el,{data:lo.props.data,layout:lo.props.layout,config:lo.props.config,frames:lo.props.frames})}}).then(function(){lo.unmounting||(lo.syncWindowResize(co),lo.syncEventHandlers(),lo.figureCallback(Ac),Hi&&lo.attachUpdateEvents())}).catch(function(Uh){lo.props.onError&&lo.props.onError(Uh)})}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(co){this.unmounting=!1;var Ac=co.frames&&co.frames.length?co.frames.length:0,Hi=this.props.frames&&this.props.frames.length?this.props.frames.length:0,lo=!(co.layout===this.props.layout&&co.data===this.props.data&&co.config===this.props.config&&Hi===Ac),Uh=co.revision!==void 0,Xh=co.revision!==this.props.revision;!lo&&(!Uh||Uh&&!Xh)||this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&Tp&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),Go.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var co=this;!this.el||!this.el.removeListener||L0.forEach(function(Ac){co.el.on(Ac,co.handleUpdate)})}},{key:"removeUpdateEvents",value:function(){var co=this;!this.el||!this.el.removeListener||L0.forEach(function(Ac){co.el.removeListener(Ac,co.handleUpdate)})}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(co){if(typeof co=="function"){var Ac=this.el,Hi=Ac.data,lo=Ac.layout,Uh=this.el._transitionData?this.el._transitionData._frames:null,Xh={data:Hi,layout:lo,frames:Uh};co(Xh,this.el)}}},{key:"syncWindowResize",value:function(co){var Ac=this;Tp&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return Go.Plots.resize(Ac.el)},window.addEventListener("resize",this.resizeHandler),co&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(co){this.el=co,this.props.debug&&Tp&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var co=this;He.forEach(function(Ac){var Hi=co.props["on"+Ac],lo=co.handlers[Ac],Uh=!!lo;Hi&&!Uh?co.addEventHandler(Ac,Hi):!Hi&&Uh?co.removeEventHandler(Ac):Hi&&Uh&&Hi!==lo&&(co.removeEventHandler(Ac),co.addEventHandler(Ac,Hi))})}},{key:"addEventHandler",value:function(co,Ac){this.handlers[co]=Ac,this.el.on(this.getPlotlyEventName(co),this.handlers[co])}},{key:"removeEventHandler",value:function(co){this.el.removeListener(this.getPlotlyEventName(co),this.handlers[co]),delete this.handlers[co]}},{key:"getPlotlyEventName",value:function(co){return"plotly_"+co.toLowerCase()}},{key:"render",value:function(){return Ch.default.createElement("div",{id:this.props.divId,style:this.props.style,ref:this.getRef,className:this.props.className})}}]),Bf}(Ch.Component);return Fs.propTypes={data:qs.default.arrayOf(qs.default.object),config:qs.default.object,layout:qs.default.object,frames:qs.default.arrayOf(qs.default.object),revision:qs.default.number,onInitialized:qs.default.func,onPurge:qs.default.func,onError:qs.default.func,onUpdate:qs.default.func,debug:qs.default.bool,style:qs.default.object,className:qs.default.string,useResizeHandler:qs.default.bool,divId:qs.default.string},He.forEach(function(Tc){Fs.propTypes["on"+Tc]=qs.default.func}),Fs.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},Fs}}(ub)),ub}var Wm={exports:{}},B8=Wm.exports,JA;function N8(){return JA||(JA=1,function(uh){var Th={};(function(Ch,qs){uh.exports?uh.exports=qs():Ch.moduleName=qs()})(typeof self<"u"?self:B8,()=>{var Ch=(()=>{var qs=Object.create,vf=Object.defineProperty,Wh=Object.defineProperties,Zh=Object.getOwnPropertyDescriptor,wp=Object.getOwnPropertyDescriptors,Lh=Object.getOwnPropertyNames,Bh=Object.getOwnPropertySymbols,Nv=Object.getPrototypeOf,rv=Object.prototype.hasOwnProperty,mv=Object.prototype.propertyIsEnumerable,Nh=(Y,G,d)=>G in Y?vf(Y,G,{enumerable:!0,configurable:!0,writable:!0,value:d}):Y[G]=d,Sf=(Y,G)=>{for(var d in G||(G={}))rv.call(G,d)&&Nh(Y,d,G[d]);if(Bh)for(var d of Bh(G))mv.call(G,d)&&Nh(Y,d,G[d]);return Y},av=(Y,G)=>Wh(Y,wp(G)),ks=(Y,G)=>function(){return Y&&(G=(0,Y[Lh(Y)[0]])(Y=0)),G},He=(Y,G)=>function(){return G||(0,Y[Lh(Y)[0]])((G={exports:{}}).exports,G),G.exports},L0=(Y,G)=>{for(var d in G)vf(Y,d,{get:G[d],enumerable:!0})},Tp=(Y,G,d,x)=>{if(G&&typeof G=="object"||typeof G=="function")for(let A of Lh(G))!rv.call(Y,A)&&A!==d&&vf(Y,A,{get:()=>G[A],enumerable:!(x=Zh(G,A))||x.enumerable});return Y},Zm=(Y,G,d)=>(d=Y!=null?qs(Nv(Y)):{},Tp(vf(d,"default",{value:Y,enumerable:!0}),Y)),Go=Y=>Tp(vf({},"__esModule",{value:!0}),Y),Fs=He({"src/version.js"(Y){Y.version="3.0.1"}}),Tc=He({"node_modules/native-promise-only/lib/npo.src.js"(Y,G){(function(x,A,E){A[x]=A[x]||E(),typeof G<"u"&&G.exports&&(G.exports=A[x])})("Promise",typeof window<"u"?window:Y,function(){var x,A,E,e=Object.prototype.toString,t=typeof setImmediate<"u"?function(y){return setImmediate(y)}:setTimeout;try{Object.defineProperty({},"x",{}),x=function(y,b,S,M){return Object.defineProperty(y,b,{value:S,writable:!0,configurable:M!==!1})}}catch{x=function(b,S,M){return b[S]=M,b}}E=function(){var y,b,S;function M(_,w){this.fn=_,this.self=w,this.next=void 0}return{add:function(w,p){S=new M(w,p),b?b.next=S:y=S,b=S,S=void 0},drain:function(){var w=y;for(y=b=A=void 0;w;)w.fn.call(w.self),w=w.next}}}();function r(l,y){E.add(l,y),A||(A=t(E.drain))}function o(l){var y,b=typeof l;return l!=null&&(b=="object"||b=="function")&&(y=l.then),typeof y=="function"?y:!1}function a(){for(var l=0;l0&&r(a,b))}catch(S){s.call(new f(b),S)}}}function s(l){var y=this;y.triggered||(y.triggered=!0,y.def&&(y=y.def),y.msg=l,y.state=2,y.chain.length>0&&r(a,y))}function c(l,y,b,S){for(var M=0;MLe?1:pe>=Le?0:NaN}d.descending=function(pe,Le){return Lepe?1:Le>=pe?0:NaN},d.min=function(pe,Le){var Ye=-1,ut=pe.length,ht,xt;if(arguments.length===1){for(;++Ye=xt){ht=xt;break}for(;++Yext&&(ht=xt)}else{for(;++Ye=xt){ht=xt;break}for(;++Yext&&(ht=xt)}return ht},d.max=function(pe,Le){var Ye=-1,ut=pe.length,ht,xt;if(arguments.length===1){for(;++Ye=xt){ht=xt;break}for(;++Yeht&&(ht=xt)}else{for(;++Ye=xt){ht=xt;break}for(;++Yeht&&(ht=xt)}return ht},d.extent=function(pe,Le){var Ye=-1,ut=pe.length,ht,xt,zt;if(arguments.length===1){for(;++Ye=xt){ht=zt=xt;break}for(;++Yext&&(ht=xt),zt=xt){ht=zt=xt;break}for(;++Yext&&(ht=xt),zt1)return zt/($t-1)},d.deviation=function(){var pe=d.variance.apply(this,arguments);return pe&&Math.sqrt(pe)};function v(pe){return{left:function(Le,Ye,ut,ht){for(arguments.length<3&&(ut=0),arguments.length<4&&(ht=Le.length);ut>>1;pe(Le[xt],Ye)<0?ut=xt+1:ht=xt}return ut},right:function(Le,Ye,ut,ht){for(arguments.length<3&&(ut=0),arguments.length<4&&(ht=Le.length);ut>>1;pe(Le[xt],Ye)>0?ht=xt:ut=xt+1}return ut}}}var h=v(s);d.bisectLeft=h.left,d.bisect=d.bisectRight=h.right,d.bisector=function(pe){return v(pe.length===1?function(Le,Ye){return s(pe(Le),Ye)}:pe)},d.shuffle=function(pe,Le,Ye){(ut=arguments.length)<3&&(Ye=pe.length,ut<2&&(Le=0));for(var ut=Ye-Le,ht,xt;ut;)xt=Math.random()*ut--|0,ht=pe[ut+Le],pe[ut+Le]=pe[xt+Le],pe[xt+Le]=ht;return pe},d.permute=function(pe,Le){for(var Ye=Le.length,ut=new Array(Ye);Ye--;)ut[Ye]=pe[Le[Ye]];return ut},d.pairs=function(pe){for(var Le=0,Ye=pe.length-1,ut=pe[0],ht=new Array(Ye<0?0:Ye);Le=0;)for(zt=pe[Le],Ye=zt.length;--Ye>=0;)xt[--ht]=zt[Ye];return xt};var l=Math.abs;d.range=function(pe,Le,Ye){if(arguments.length<3&&(Ye=1,arguments.length<2&&(Le=pe,pe=0)),(Le-pe)/Ye===1/0)throw new Error("infinite range");var ut=[],ht=y(l(Ye)),xt=-1,zt;if(pe*=ht,Le*=ht,Ye*=ht,Ye<0)for(;(zt=pe+Ye*++xt)>Le;)ut.push(zt/ht);else for(;(zt=pe+Ye*++xt)=Le.length)return ht?ht.call(pe,$t):ut?$t.sort(ut):$t;for(var Ar=-1,Vr=$t.length,Kr=Le[Cr++],aa,Ua,la,Ta=new S,ka;++Ar=Le.length)return Dt;var Cr=[],Ar=Ye[$t++];return Dt.forEach(function(Vr,Kr){Cr.push({key:Vr,values:zt(Kr,$t)})}),Ar?Cr.sort(function(Vr,Kr){return Ar(Vr.key,Kr.key)}):Cr}return pe.map=function(Dt,$t){return xt($t,Dt,0)},pe.entries=function(Dt){return zt(xt(d.map,Dt,0),0)},pe.key=function(Dt){return Le.push(Dt),pe},pe.sortKeys=function(Dt){return Ye[Le.length-1]=Dt,pe},pe.sortValues=function(Dt){return ut=Dt,pe},pe.rollup=function(Dt){return ht=Dt,pe},pe},d.set=function(pe){var Le=new z;if(pe)for(var Ye=0,ut=pe.length;Ye=0&&(ut=pe.slice(Ye+1),pe=pe.slice(0,Ye)),pe)return arguments.length<2?this[pe].on(ut):this[pe].on(ut,Le);if(arguments.length===2){if(Le==null)for(pe in this)this.hasOwnProperty(pe)&&this[pe].on(ut,null);return this}};function Z(pe){var Le=[],Ye=new S;function ut(){for(var ht=Le,xt=-1,zt=ht.length,Dt;++xt=0&&(Ye=pe.slice(0,Le))!=="xmlns"&&(pe=pe.slice(Le+1)),fe.hasOwnProperty(Ye)?{space:fe[Ye],local:pe}:pe}},ee.attr=function(pe,Le){if(arguments.length<2){if(typeof pe=="string"){var Ye=this.node();return pe=d.ns.qualify(pe),pe.local?Ye.getAttributeNS(pe.space,pe.local):Ye.getAttribute(pe)}for(Le in pe)this.each(we(Le,pe[Le]));return this}return this.each(we(pe,Le))};function we(pe,Le){pe=d.ns.qualify(pe);function Ye(){this.removeAttribute(pe)}function ut(){this.removeAttributeNS(pe.space,pe.local)}function ht(){this.setAttribute(pe,Le)}function xt(){this.setAttributeNS(pe.space,pe.local,Le)}function zt(){var $t=Le.apply(this,arguments);$t==null?this.removeAttribute(pe):this.setAttribute(pe,$t)}function Dt(){var $t=Le.apply(this,arguments);$t==null?this.removeAttributeNS(pe.space,pe.local):this.setAttributeNS(pe.space,pe.local,$t)}return Le==null?pe.local?ut:Ye:typeof Le=="function"?pe.local?Dt:zt:pe.local?xt:ht}function Ae(pe){return pe.trim().replace(/\s+/g," ")}ee.classed=function(pe,Le){if(arguments.length<2){if(typeof pe=="string"){var Ye=this.node(),ut=(pe=Ce(pe)).length,ht=-1;if(Le=Ye.classList){for(;++ht=0;)(xt=Ye[ut])&&(ht&&ht!==xt.nextSibling&&ht.parentNode.insertBefore(xt,ht),ht=xt);return this},ee.sort=function(pe){pe=Re.apply(this,arguments);for(var Le=-1,Ye=this.length;++Le=Le&&(Le=ht+1);!($t=zt[Le])&&++Le0&&(pe=pe.slice(0,ht));var zt=Rt.get(pe);zt&&(pe=zt,xt=ir);function Dt(){var Ar=this[ut];Ar&&(this.removeEventListener(pe,Ar,Ar.$),delete this[ut])}function $t(){var Ar=xt(Le,A(arguments));Dt.call(this),this.addEventListener(pe,this[ut]=Ar,Ar.$=Ye),Ar._=Le}function Cr(){var Ar=new RegExp("^__on([^.]+)"+d.requote(pe)+"$"),Vr;for(var Kr in this)if(Vr=Kr.match(Ar)){var aa=this[Kr];this.removeEventListener(Vr[1],aa,aa.$),delete this[Kr]}}return ht?Le?$t:Dt:Le?N:Cr}var Rt=d.map({mouseenter:"mouseover",mouseleave:"mouseout"});E&&Rt.forEach(function(pe){"on"+pe in E&&Rt.remove(pe)});function Ut(pe,Le){return function(Ye){var ut=d.event;d.event=Ye,Le[0]=this.__data__;try{pe.apply(this,Le)}finally{d.event=ut}}}function ir(pe,Le){var Ye=Ut(pe,Le);return function(ut){var ht=this,xt=ut.relatedTarget;(!xt||xt!==ht&&!(xt.compareDocumentPosition(ht)&8))&&Ye.call(ht,ut)}}var ar,Mr=0;function fr(pe){var Le=".dragsuppress-"+ ++Mr,Ye="click"+Le,ut=d.select(t(pe)).on("touchmove"+Le,Q).on("dragstart"+Le,Q).on("selectstart"+Le,Q);if(ar==null&&(ar="onselectstart"in pe?!1:O(pe.style,"userSelect")),ar){var ht=e(pe).style,xt=ht[ar];ht[ar]="none"}return function(zt){if(ut.on(Le,null),ar&&(ht[ar]=xt),zt){var Dt=function(){ut.on(Ye,null)};ut.on(Ye,function(){Q(),Dt()},!0),setTimeout(Dt,0)}}}d.mouse=function(pe){return pt(pe,ue())};var dr=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function pt(pe,Le){Le.changedTouches&&(Le=Le.changedTouches[0]);var Ye=pe.ownerSVGElement||pe;if(Ye.createSVGPoint){var ut=Ye.createSVGPoint();if(dr<0){var ht=t(pe);if(ht.scrollX||ht.scrollY){Ye=d.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var xt=Ye[0][0].getScreenCTM();dr=!(xt.f||xt.e),Ye.remove()}}return dr?(ut.x=Le.pageX,ut.y=Le.pageY):(ut.x=Le.clientX,ut.y=Le.clientY),ut=ut.matrixTransform(pe.getScreenCTM().inverse()),[ut.x,ut.y]}var zt=pe.getBoundingClientRect();return[Le.clientX-zt.left-pe.clientLeft,Le.clientY-zt.top-pe.clientTop]}d.touch=function(pe,Le,Ye){if(arguments.length<3&&(Ye=Le,Le=ue().changedTouches),Le){for(var ut=0,ht=Le.length,xt;ut1?Pe:pe<-1?-Pe:Math.asin(pe)}function Nt(pe){return((pe=Math.exp(pe))-1/pe)/2}function Bt(pe){return((pe=Math.exp(pe))+1/pe)/2}function qt(pe){return((pe=Math.exp(2*pe))-1)/(pe+1)}var Zt=Math.SQRT2,lr=2,ta=4;d.interpolateZoom=function(pe,Le){var Ye=pe[0],ut=pe[1],ht=pe[2],xt=Le[0],zt=Le[1],Dt=Le[2],$t=xt-Ye,Cr=zt-ut,Ar=$t*$t+Cr*Cr,Vr,Kr;if(Ar0&&(Kn=Kn.transition().duration(zt)),Kn.call(Va.event)}function hi(){Ta&&Ta.domain(la.range().map(function(Kn){return(Kn-pe.x)/pe.k}).map(la.invert)),Ba&&Ba.domain(ka.range().map(function(Kn){return(Kn-pe.y)/pe.k}).map(ka.invert))}function _i(Kn){Dt++||Kn({type:"zoomstart"})}function Po(Kn){hi(),Kn({type:"zoom",scale:pe.k,translate:[pe.x,pe.y]})}function wi(Kn){--Dt||(Kn({type:"zoomend"}),Ye=null)}function Ji(){var Kn=this,go=Ua.of(Kn,arguments),Do=0,Es=d.select(t(Kn)).on(Cr,Qo).on(Ar,_s),hs=Ma(d.mouse(Kn)),Hl=fr(Kn);za.call(Kn),_i(go);function Qo(){Do=1,jn(d.mouse(Kn),hs),Po(go)}function _s(){Es.on(Cr,null).on(Ar,null),Hl(Do),wi(go)}}function Vo(){var Kn=this,go=Ua.of(Kn,arguments),Do={},Es=0,hs,Hl=".zoom-"+d.event.changedTouches[0].identifier,Qo="touchmove"+Hl,_s="touchend"+Hl,gu=[],el=d.select(Kn),cr=fr(Kn);xa(),_i(go),el.on($t,null).on(Kr,xa);function fa(){var Da=d.touches(Kn);return hs=pe.k,Da.forEach(function(Na){Na.identifier in Do&&(Do[Na.identifier]=Ma(Na))}),Da}function xa(){var Da=d.event.target;d.select(Da).on(Qo,cn).on(_s,In),gu.push(Da);for(var Na=d.event.changedTouches,Hn=0,Un=Na.length;Hn1){var Wi=Gn[0],Ti=Gn[1],si=Wi[0]-Ti[0],Fn=Wi[1]-Ti[1];Es=si*si+Fn*Fn}}function cn(){var Da=d.touches(Kn),Na,Hn,Un,Gn;za.call(Kn);for(var ti=0,Wi=Da.length;ti1?1:Le,Ye=Ye<0?0:Ye>1?1:Ye,ht=Ye<=.5?Ye*(1+Le):Ye+Le-Ye*Le,ut=2*Ye-ht;function xt(Dt){return Dt>360?Dt-=360:Dt<0&&(Dt+=360),Dt<60?ut+(ht-ut)*Dt/60:Dt<180?ht:Dt<240?ut+(ht-ut)*(240-Dt)/60:ut}function zt(Dt){return Math.round(xt(Dt)*255)}return new vt(zt(pe+120),zt(pe),zt(pe-120))}d.hcl=Vt;function Vt(pe,Le,Ye){return this instanceof Vt?(this.h=+pe,this.c=+Le,void(this.l=+Ye)):arguments.length<2?pe instanceof Vt?new Vt(pe.h,pe.c,pe.l):pe instanceof Ot?Pa(pe.l,pe.a,pe.b):Pa((pe=Pr((pe=d.rgb(pe)).r,pe.g,pe.b)).l,pe.a,pe.b):new Vt(pe,Le,Ye)}var Lt=Vt.prototype=new Ia;Lt.brighter=function(pe){return new Vt(this.h,this.c,Math.min(100,this.l+gr*(arguments.length?pe:1)))},Lt.darker=function(pe){return new Vt(this.h,this.c,Math.max(0,this.l-gr*(arguments.length?pe:1)))},Lt.rgb=function(){return jt(this.h,this.c,this.l).rgb()};function jt(pe,Le,Ye){return isNaN(pe)&&(pe=0),isNaN(Le)&&(Le=0),new Ot(Ye,Math.cos(pe*=We)*Le,Math.sin(pe)*Le)}d.lab=Ot;function Ot(pe,Le,Ye){return this instanceof Ot?(this.l=+pe,this.a=+Le,void(this.b=+Ye)):arguments.length<2?pe instanceof Ot?new Ot(pe.l,pe.a,pe.b):pe instanceof Vt?jt(pe.h,pe.c,pe.l):Pr((pe=vt(pe)).r,pe.g,pe.b):new Ot(pe,Le,Ye)}var gr=18,Br=.95047,na=1,Ur=1.08883,ga=Ot.prototype=new Ia;ga.brighter=function(pe){return new Ot(Math.min(100,this.l+gr*(arguments.length?pe:1)),this.a,this.b)},ga.darker=function(pe){return new Ot(Math.max(0,this.l-gr*(arguments.length?pe:1)),this.a,this.b)},ga.rgb=function(){return Aa(this.l,this.a,this.b)};function Aa(pe,Le,Ye){var ut=(pe+16)/116,ht=ut+Le/500,xt=ut-Ye/200;return ht=sa(ht)*Br,ut=sa(ut)*na,xt=sa(xt)*Ur,new vt(dt(3.2404542*ht-1.5371385*ut-.4985314*xt),dt(-.969266*ht+1.8760108*ut+.041556*xt),dt(.0556434*ht-.2040259*ut+1.0572252*xt))}function Pa(pe,Le,Ye){return pe>0?new Vt(Math.atan2(Ye,Le)*ct,Math.sqrt(Le*Le+Ye*Ye),pe):new Vt(NaN,NaN,pe)}function sa(pe){return pe>.206893034?pe*pe*pe:(pe-4/29)/7.787037}function Oa(pe){return pe>.008856?Math.pow(pe,1/3):7.787037*pe+4/29}function dt(pe){return Math.round(255*(pe<=.00304?12.92*pe:1.055*Math.pow(pe,1/2.4)-.055))}d.rgb=vt;function vt(pe,Le,Ye){return this instanceof vt?(this.r=~~pe,this.g=~~Le,void(this.b=~~Ye)):arguments.length<2?pe instanceof vt?new vt(pe.r,pe.g,pe.b):kr(""+pe,vt,Ka):new vt(pe,Le,Ye)}function Lr(pe){return new vt(pe>>16,pe>>8&255,pe&255)}function Er(pe){return Lr(pe)+""}var _r=vt.prototype=new Ia;_r.brighter=function(pe){pe=Math.pow(.7,arguments.length?pe:1);var Le=this.r,Ye=this.g,ut=this.b,ht=30;return!Le&&!Ye&&!ut?new vt(ht,ht,ht):(Le&&Le>4,ut=ut>>4|ut,ht=$t&240,ht=ht>>4|ht,xt=$t&15,xt=xt<<4|xt):pe.length===7&&(ut=($t&16711680)>>16,ht=($t&65280)>>8,xt=$t&255)),Le(ut,ht,xt))}function zr(pe,Le,Ye){var ut=Math.min(pe/=255,Le/=255,Ye/=255),ht=Math.max(pe,Le,Ye),xt=ht-ut,zt,Dt,$t=(ht+ut)/2;return xt?(Dt=$t<.5?xt/(ht+ut):xt/(2-ht-ut),pe==ht?zt=(Le-Ye)/xt+(Le0&&$t<1?0:zt),new va(zt,Dt,$t)}function Pr(pe,Le,Ye){pe=Hr(pe),Le=Hr(Le),Ye=Hr(Ye);var ut=Oa((.4124564*pe+.3575761*Le+.1804375*Ye)/Br),ht=Oa((.2126729*pe+.7151522*Le+.072175*Ye)/na),xt=Oa((.0193339*pe+.119192*Le+.9503041*Ye)/Ur);return Ot(116*ht-16,500*(ut-ht),200*(ht-xt))}function Hr(pe){return(pe/=255)<=.04045?pe/12.92:Math.pow((pe+.055)/1.055,2.4)}function Zr(pe){var Le=parseFloat(pe);return pe.charAt(pe.length-1)==="%"?Math.round(Le*2.55):Le}var Jr=d.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Jr.forEach(function(pe,Le){Jr.set(pe,Lr(Le))});function wt(pe){return typeof pe=="function"?pe:function(){return pe}}d.functor=wt,d.xhr=Qt(F);function Qt(pe){return function(Le,Ye,ut){return arguments.length===2&&typeof Ye=="function"&&(ut=Ye,Ye=null),mr(Le,Ye,pe,ut)}}function mr(pe,Le,Ye,ut){var ht={},xt=d.dispatch("beforesend","progress","load","error"),zt={},Dt=new XMLHttpRequest,$t=null;self.XDomainRequest&&!("withCredentials"in Dt)&&/^(http(s)?:)?\/\//.test(pe)&&(Dt=new XDomainRequest),"onload"in Dt?Dt.onload=Dt.onerror=Cr:Dt.onreadystatechange=function(){Dt.readyState>3&&Cr()};function Cr(){var Ar=Dt.status,Vr;if(!Ar&&oa(Dt)||Ar>=200&&Ar<300||Ar===304){try{Vr=Ye.call(ht,Dt)}catch(Kr){xt.error.call(ht,Kr);return}xt.load.call(ht,Vr)}else xt.error.call(ht,Dt)}return Dt.onprogress=function(Ar){var Vr=d.event;d.event=Ar;try{xt.progress.call(ht,Dt)}finally{d.event=Vr}},ht.header=function(Ar,Vr){return Ar=(Ar+"").toLowerCase(),arguments.length<2?zt[Ar]:(Vr==null?delete zt[Ar]:zt[Ar]=Vr+"",ht)},ht.mimeType=function(Ar){return arguments.length?(Le=Ar==null?null:Ar+"",ht):Le},ht.responseType=function(Ar){return arguments.length?($t=Ar,ht):$t},ht.response=function(Ar){return Ye=Ar,ht},["get","post"].forEach(function(Ar){ht[Ar]=function(){return ht.send.apply(ht,[Ar].concat(A(arguments)))}}),ht.send=function(Ar,Vr,Kr){if(arguments.length===2&&typeof Vr=="function"&&(Kr=Vr,Vr=null),Dt.open(Ar,pe,!0),Le!=null&&!("accept"in zt)&&(zt.accept=Le+",*/*"),Dt.setRequestHeader)for(var aa in zt)Dt.setRequestHeader(aa,zt[aa]);return Le!=null&&Dt.overrideMimeType&&Dt.overrideMimeType(Le),$t!=null&&(Dt.responseType=$t),Kr!=null&&ht.on("error",Kr).on("load",function(Ua){Kr(null,Ua)}),xt.beforesend.call(ht,Dt),Dt.send(Vr??null),ht},ht.abort=function(){return Dt.abort(),ht},d.rebind(ht,xt,"on"),ut==null?ht:ht.get($r(ut))}function $r(pe){return pe.length===1?function(Le,Ye){pe(Le==null?Ye:null)}:pe}function oa(pe){var Le=pe.responseType;return Le&&Le!=="text"?pe.response:pe.responseText}d.dsv=function(pe,Le){var Ye=new RegExp('["'+pe+` +]`),ut=pe.charCodeAt(0);function ht(Cr,Ar,Vr){arguments.length<3&&(Vr=Ar,Ar=null);var Kr=mr(Cr,Le,Ar==null?xt:zt(Ar),Vr);return Kr.row=function(aa){return arguments.length?Kr.response((Ar=aa)==null?xt:zt(aa)):Ar},Kr}function xt(Cr){return ht.parse(Cr.responseText)}function zt(Cr){return function(Ar){return ht.parse(Ar.responseText,Cr)}}ht.parse=function(Cr,Ar){var Vr;return ht.parseRows(Cr,function(Kr,aa){if(Vr)return Vr(Kr,aa-1);var Ua=function(la){for(var Ta={},ka=Kr.length,Ba=0;Ba=Ua)return Kr;if(Ba)return Ba=!1,Vr;var mn=la;if(Cr.charCodeAt(mn)===34){for(var Wn=mn;Wn++24?(isFinite(Le)&&(clearTimeout(pa),pa=setTimeout(qn,Le)),ra=0):(ra=1,pn(qn))}d.timer.flush=function(){Vn(),di()};function Vn(){for(var pe=Date.now(),Le=Sa;Le;)pe>=Le.t&&Le.c(pe-Le.t)&&(Le.c=null),Le=Le.n;return pe}function di(){for(var pe,Le=Sa,Ye=1/0;Le;)Le.c?(Le.t=0;--Dt)la.push(ht[Cr[Vr[Dt]][2]]);for(Dt=+aa;Dt1&&_t(pe[Ye[ut-2]],pe[Ye[ut-1]],pe[ht])<=0;)--ut;Ye[ut++]=ht}return Ye.slice(0,ut)}function ei(pe,Le){return pe[0]-Le[0]||pe[1]-Le[1]}d.geom.polygon=function(pe){return j(pe,mi),pe};var mi=d.geom.polygon.prototype=[];mi.area=function(){for(var pe=-1,Le=this.length,Ye,ut=this[Le-1],ht=0;++peGe)Dt=Dt.L;else if(zt=Le-Jn(Dt,Ye),zt>Ge){if(!Dt.R){ut=Dt;break}Dt=Dt.R}else{xt>-Ge?(ut=Dt.P,ht=Dt):zt>-Ge?(ut=Dt,ht=Dt.N):ut=ht=Dt;break}var $t=bs(pe);if(xi.insert(ut,$t),!(!ut&&!ht)){if(ut===ht){ws(ut),ht=bs(ut.site),xi.insert($t,ht),$t.edge=ht.edge=zo(ut.site,$t.site),Mo(ut),Mo(ht);return}if(!ht){$t.edge=zo(ut.site,$t.site);return}ws(ut),ws(ht);var Cr=ut.site,Ar=Cr.x,Vr=Cr.y,Kr=pe.x-Ar,aa=pe.y-Vr,Ua=ht.site,la=Ua.x-Ar,Ta=Ua.y-Vr,ka=2*(Kr*Ta-aa*la),Ba=Kr*Kr+aa*aa,Va=la*la+Ta*Ta,Ma={x:(Ta*Ba-aa*Va)/ka+Ar,y:(Kr*Va-la*Ba)/ka+Vr};bi(ht.edge,Cr,Ua,Ma),$t.edge=zo(Cr,pe,null,Ma),ht.edge=zo(pe,Ua,null,Ma),Mo(ut),Mo(ht)}}function Qa(pe,Le){var Ye=pe.site,ut=Ye.x,ht=Ye.y,xt=ht-Le;if(!xt)return ut;var zt=pe.P;if(!zt)return-1/0;Ye=zt.site;var Dt=Ye.x,$t=Ye.y,Cr=$t-Le;if(!Cr)return Dt;var Ar=Dt-ut,Vr=1/xt-1/Cr,Kr=Ar/Cr;return Vr?(-Kr+Math.sqrt(Kr*Kr-2*Vr*(Ar*Ar/(-2*Cr)-$t+Cr/2+ht-xt/2)))/Vr+ut:(ut+Dt)/2}function Jn(pe,Le){var Ye=pe.N;if(Ye)return Qa(Ye,Le);var ut=pe.site;return ut.y===Le?ut.x:1/0}function Os(pe){this.site=pe,this.edges=[]}Os.prototype.prepare=function(){for(var pe=this.edges,Le=pe.length,Ye;Le--;)Ye=pe[Le].edge,(!Ye.b||!Ye.a)&&pe.splice(Le,1);return pe.sort(Ui),pe.length};function ds(pe){for(var Le=pe[0][0],Ye=pe[1][0],ut=pe[0][1],ht=pe[1][1],xt,zt,Dt,$t,Cr=Ii,Ar=Cr.length,Vr,Kr,aa,Ua,la,Ta;Ar--;)if(Vr=Cr[Ar],!(!Vr||!Vr.prepare()))for(aa=Vr.edges,Ua=aa.length,Kr=0;KrGe||l($t-zt)>Ge)&&(aa.splice(Kr,0,new wl(wo(Vr.site,Ta,l(Dt-Le)Ge?{x:Le,y:l(xt-Le)Ge?{x:l(zt-ht)Ge?{x:Ye,y:l(xt-Ye)Ge?{x:l(zt-ut)=-Oe)){var Kr=$t*$t+Cr*Cr,aa=Ar*Ar+Ta*Ta,Ua=(Ta*Kr-Cr*aa)/Vr,la=($t*aa-Ar*Kr)/Vr,Ta=la+Dt,ka=Li.pop()||new ms;ka.arc=pe,ka.site=ht,ka.x=Ua+zt,ka.y=Ta+Math.sqrt(Ua*Ua+la*la),ka.cy=Ta,pe.circle=ka;for(var Ba=null,Va=Ro._;Va;)if(ka.y0)){if(la/=aa,aa<0){if(la0){if(la>Kr)return;la>Vr&&(Vr=la)}if(la=Ye-Dt,!(!aa&&la<0)){if(la/=aa,aa<0){if(la>Kr)return;la>Vr&&(Vr=la)}else if(aa>0){if(la0)){if(la/=Ua,Ua<0){if(la0){if(la>Kr)return;la>Vr&&(Vr=la)}if(la=ut-$t,!(!Ua&&la<0)){if(la/=Ua,Ua<0){if(la>Kr)return;la>Vr&&(Vr=la)}else if(Ua>0){if(la0&&(ht.a={x:Dt+Vr*aa,y:$t+Vr*Ua}),Kr<1&&(ht.b={x:Dt+Kr*aa,y:$t+Kr*Ua}),ht}}}}}}function Rn(pe){for(var Le=li,Ye=Ks(pe[0][0],pe[0][1],pe[1][0],pe[1][1]),ut=Le.length,ht;ut--;)ht=Le[ut],(!fo(ht,pe)||!Ye(ht)||l(ht.a.x-ht.b.x)=xt)return;if(Ar>Kr){if(!ut)ut={x:Ua,y:zt};else if(ut.y>=Dt)return;Ye={x:Ua,y:Dt}}else{if(!ut)ut={x:Ua,y:Dt};else if(ut.y1)if(Ar>Kr){if(!ut)ut={x:(zt-ka)/Ta,y:zt};else if(ut.y>=Dt)return;Ye={x:(Dt-ka)/Ta,y:Dt}}else{if(!ut)ut={x:(Dt-ka)/Ta,y:Dt};else if(ut.y=xt)return;Ye={x:xt,y:Ta*xt+ka}}else{if(!ut)ut={x:xt,y:Ta*xt+ka};else if(ut.x=Ar&&ka.x<=Kr&&ka.y>=Vr&&ka.y<=aa?[[Ar,aa],[Kr,aa],[Kr,Vr],[Ar,Vr]]:[];Ba.point=$t[la]}),Cr}function Dt($t){return $t.map(function(Cr,Ar){return{x:Math.round(ut(Cr,Ar)/Ge)*Ge,y:Math.round(ht(Cr,Ar)/Ge)*Ge,i:Ar}})}return zt.links=function($t){return Dl(Dt($t)).edges.filter(function(Cr){return Cr.l&&Cr.r}).map(function(Cr){return{source:$t[Cr.l.i],target:$t[Cr.r.i]}})},zt.triangles=function($t){var Cr=[];return Dl(Dt($t)).cells.forEach(function(Ar,Vr){for(var Kr=Ar.site,aa=Ar.edges.sort(Ui),Ua=-1,la=aa.length,Ta,ka=aa[la-1].edge,Ba=ka.l===Kr?ka.r:ka.l;++UaVa&&(Va=Ar.x),Ar.y>Ma&&(Ma=Ar.y),aa.push(Ar.x),Ua.push(Ar.y);else for(la=0;laVa&&(Va=mn),Wn>Ma&&(Ma=Wn),aa.push(mn),Ua.push(Wn)}var jn=Va-ka,Zn=Ma-Ba;jn>Zn?Ma=Ba+jn:Va=ka+Zn;function hi(wi,Ji,Vo,sl,Ms,Kn,go,Do){if(!(isNaN(Vo)||isNaN(sl)))if(wi.leaf){var Es=wi.x,hs=wi.y;if(Es!=null)if(l(Es-Vo)+l(hs-sl)<.01)_i(wi,Ji,Vo,sl,Ms,Kn,go,Do);else{var Hl=wi.point;wi.x=wi.y=wi.point=null,_i(wi,Hl,Es,hs,Ms,Kn,go,Do),_i(wi,Ji,Vo,sl,Ms,Kn,go,Do)}else wi.x=Vo,wi.y=sl,wi.point=Ji}else _i(wi,Ji,Vo,sl,Ms,Kn,go,Do)}function _i(wi,Ji,Vo,sl,Ms,Kn,go,Do){var Es=(Ms+go)*.5,hs=(Kn+Do)*.5,Hl=Vo>=Es,Qo=sl>=hs,_s=Qo<<1|Hl;wi.leaf=!1,wi=wi.nodes[_s]||(wi.nodes[_s]=ns()),Hl?Ms=Es:go=Es,Qo?Kn=hs:Do=hs,hi(wi,Ji,Vo,sl,Ms,Kn,go,Do)}var Po=ns();if(Po.add=function(wi){hi(Po,wi,+Vr(wi,++la),+Kr(wi,la),ka,Ba,Va,Ma)},Po.visit=function(wi){_u(wi,Po,ka,Ba,Va,Ma)},Po.find=function(wi){return Nc(Po,wi[0],wi[1],ka,Ba,Va,Ma)},la=-1,Le==null){for(;++laxt||Kr>zt||aa=mn,Zn=Ye>=Wn,hi=Zn<<1|jn,_i=hi+4;hi<_i;++hi)if(Ar=Ma[hi&3])switch(hi&3){case 0:Cr(Ar,Vr,Kr,mn,Wn);break;case 1:Cr(Ar,mn,Kr,aa,Wn);break;case 2:Cr(Ar,Vr,Wn,mn,Ua);break;case 3:Cr(Ar,mn,Wn,aa,Ua);break}}}(pe,ut,ht,xt,zt),$t}d.interpolateRgb=ml;function ml(pe,Le){pe=d.rgb(pe),Le=d.rgb(Le);var Ye=pe.r,ut=pe.g,ht=pe.b,xt=Le.r-Ye,zt=Le.g-ut,Dt=Le.b-ht;return function($t){return"#"+yr(Math.round(Ye+xt*$t))+yr(Math.round(ut+zt*$t))+yr(Math.round(ht+Dt*$t))}}d.interpolateObject=fl;function fl(pe,Le){var Ye={},ut={},ht;for(ht in pe)ht in Le?Ye[ht]=Ko(pe[ht],Le[ht]):ut[ht]=pe[ht];for(ht in Le)ht in pe||(ut[ht]=Le[ht]);return function(xt){for(ht in Ye)ut[ht]=Ye[ht](xt);return ut}}d.interpolateNumber=_l;function _l(pe,Le){return pe=+pe,Le=+Le,function(Ye){return pe*(1-Ye)+Le*Ye}}d.interpolateString=Yu;function Yu(pe,Le){var Ye=Ts.lastIndex=Tl.lastIndex=0,ut,ht,xt,zt=-1,Dt=[],$t=[];for(pe=pe+"",Le=Le+"";(ut=Ts.exec(pe))&&(ht=Tl.exec(Le));)(xt=ht.index)>Ye&&(xt=Le.slice(Ye,xt),Dt[zt]?Dt[zt]+=xt:Dt[++zt]=xt),(ut=ut[0])===(ht=ht[0])?Dt[zt]?Dt[zt]+=ht:Dt[++zt]=ht:(Dt[++zt]=null,$t.push({i:zt,x:_l(ut,ht)})),Ye=Tl.lastIndex;return Ye=0&&!(ut=d.interpolators[Ye](pe,Le)););return ut}d.interpolators=[function(pe,Le){var Ye=typeof Le;return(Ye==="string"?Jr.has(Le.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(Le)?ml:Yu:Le instanceof Ia?ml:Array.isArray(Le)?Cs:Ye==="object"&&isNaN(Le)?fl:_l)(pe,Le)}],d.interpolateArray=Cs;function Cs(pe,Le){var Ye=[],ut=[],ht=pe.length,xt=Le.length,zt=Math.min(pe.length,Le.length),Dt;for(Dt=0;Dt=0?pe.slice(0,Le):pe,ut=Le>=0?pe.slice(Le+1):"in";return Ye=Ul.get(Ye)||Nu,ut=Ku.get(ut)||F,Bs(ut(Ye.apply(null,x.call(arguments,1))))};function Bs(pe){return function(Le){return Le<=0?0:Le>=1?1:pe(Le)}}function Gf(pe){return function(Le){return 1-pe(1-Le)}}function Eo(pe){return function(Le){return .5*(Le<.5?pe(2*Le):2-pe(2-2*Le))}}function Wf(pe){return pe*pe}function is(pe){return pe*pe*pe}function oo(pe){if(pe<=0)return 0;if(pe>=1)return 1;var Le=pe*pe,Ye=Le*pe;return 4*(pe<.5?Ye:3*(pe-Le)+Ye-.75)}function pc(pe){return function(Le){return Math.pow(Le,pe)}}function xu(pe){return 1-Math.cos(pe*Pe)}function zl(pe){return Math.pow(2,10*(pe-1))}function Kc(pe){return 1-Math.sqrt(1-pe*pe)}function Ju(pe,Le){var Ye;return arguments.length<2&&(Le=.45),arguments.length?Ye=Le/ge*Math.asin(1/pe):(pe=1,Ye=Le/4),function(ut){return 1+pe*Math.pow(2,-10*ut)*Math.sin((ut-Ye)*ge/Le)}}function gc(pe){return pe||(pe=1.70158),function(Le){return Le*Le*((pe+1)*Le-pe)}}function hl(pe){return pe<1/2.75?7.5625*pe*pe:pe<2/2.75?7.5625*(pe-=1.5/2.75)*pe+.75:pe<2.5/2.75?7.5625*(pe-=2.25/2.75)*pe+.9375:7.5625*(pe-=2.625/2.75)*pe+.984375}d.interpolateHcl=yf;function yf(pe,Le){pe=d.hcl(pe),Le=d.hcl(Le);var Ye=pe.h,ut=pe.c,ht=pe.l,xt=Le.h-Ye,zt=Le.c-ut,Dt=Le.l-ht;return isNaN(zt)&&(zt=0,ut=isNaN(ut)?Le.c:ut),isNaN(xt)?(xt=0,Ye=isNaN(Ye)?Le.h:Ye):xt>180?xt-=360:xt<-180&&(xt+=360),function($t){return jt(Ye+xt*$t,ut+zt*$t,ht+Dt*$t)+""}}d.interpolateHsl=Jc;function Jc(pe,Le){pe=d.hsl(pe),Le=d.hsl(Le);var Ye=pe.h,ut=pe.s,ht=pe.l,xt=Le.h-Ye,zt=Le.s-ut,Dt=Le.l-ht;return isNaN(zt)&&(zt=0,ut=isNaN(ut)?Le.s:ut),isNaN(xt)?(xt=0,Ye=isNaN(Ye)?Le.h:Ye):xt>180?xt-=360:xt<-180&&(xt+=360),function($t){return Ka(Ye+xt*$t,ut+zt*$t,ht+Dt*$t)+""}}d.interpolateLab=Uc;function Uc(pe,Le){pe=d.lab(pe),Le=d.lab(Le);var Ye=pe.l,ut=pe.a,ht=pe.b,xt=Le.l-Ye,zt=Le.a-ut,Dt=Le.b-ht;return function($t){return Aa(Ye+xt*$t,ut+zt*$t,ht+Dt*$t)+""}}d.interpolateRound=$u;function $u(pe,Le){return Le-=pe,function(Ye){return Math.round(pe+Le*Ye)}}d.transform=function(pe){var Le=E.createElementNS(d.ns.prefix.svg,"g");return(d.transform=function(Ye){if(Ye!=null){Le.setAttribute("transform",Ye);var ut=Le.transform.baseVal.consolidate()}return new jc(ut?ut.matrix:sc)})(pe)};function jc(pe){var Le=[pe.a,pe.b],Ye=[pe.c,pe.d],ut=bu(Le),ht=$c(Le,Ye),xt=bu(Qc(Ye,Le,-ht))||0;Le[0]*Ye[1]180?Le+=360:Le-pe>180&&(pe+=360),ut.push({i:Ye.push(wu(Ye)+"rotate(",null,")")-2,x:_l(pe,Le)})):Le&&Ye.push(wu(Ye)+"rotate("+Le+")")}function ef(pe,Le,Ye,ut){pe!==Le?ut.push({i:Ye.push(wu(Ye)+"skewX(",null,")")-2,x:_l(pe,Le)}):Le&&Ye.push(wu(Ye)+"skewX("+Le+")")}function ps(pe,Le,Ye,ut){if(pe[0]!==Le[0]||pe[1]!==Le[1]){var ht=Ye.push(wu(Ye)+"scale(",null,",",null,")");ut.push({i:ht-4,x:_l(pe[0],Le[0])},{i:ht-2,x:_l(pe[1],Le[1])})}else(Le[0]!==1||Le[1]!==1)&&Ye.push(wu(Ye)+"scale("+Le+")")}function Vc(pe,Le){var Ye=[],ut=[];return pe=d.transform(pe),Le=d.transform(Le),eu(pe.translate,Le.translate,Ye,ut),Sc(pe.rotate,Le.rotate,Ye,ut),ef(pe.skew,Le.skew,Ye,ut),ps(pe.scale,Le.scale,Ye,ut),pe=Le=null,function(ht){for(var xt=-1,zt=ut.length,Dt;++xt0?xt=Ma:(Ye.c=null,Ye.t=NaN,Ye=null,Le.end({type:"end",alpha:xt=0})):Ma>0&&(Le.start({type:"start",alpha:xt=Ma}),Ye=Ga(pe.tick)),pe):xt},pe.start=function(){var Ma,mn=aa.length,Wn=Ua.length,jn=ut[0],Zn=ut[1],hi,_i;for(Ma=0;Ma=0;)xt.push(Ar=Cr[$t]),Ar.parent=Dt,Ar.depth=Dt.depth+1;Ye&&(Dt.value=0),Dt.children=Cr}else Ye&&(Dt.value=+Ye.call(ut,Dt,Dt.depth)||0),delete Dt.children;return Pu(ht,function(Vr){var Kr,aa;pe&&(Kr=Vr.children)&&Kr.sort(pe),Ye&&(aa=Vr.parent)&&(aa.value+=Vr.value)}),zt}return ut.sort=function(ht){return arguments.length?(pe=ht,ut):pe},ut.children=function(ht){return arguments.length?(Le=ht,ut):Le},ut.value=function(ht){return arguments.length?(Ye=ht,ut):Ye},ut.revalue=function(ht){return Ye&&(yc(ht,function(xt){xt.children&&(xt.value=0)}),Pu(ht,function(xt){var zt;xt.children||(xt.value=+Ye.call(ut,xt,xt.depth)||0),(zt=xt.parent)&&(zt.value+=xt.value)})),ht},ut};function Ns(pe,Le){return d.rebind(pe,Le,"sort","children","value"),pe.nodes=pe,pe.links=nh,pe}function yc(pe,Le){for(var Ye=[pe];(pe=Ye.pop())!=null;)if(Le(pe),(ht=pe.children)&&(ut=ht.length))for(var ut,ht;--ut>=0;)Ye.push(ht[ut])}function Pu(pe,Le){for(var Ye=[pe],ut=[];(pe=Ye.pop())!=null;)if(ut.push(pe),(zt=pe.children)&&(xt=zt.length))for(var ht=-1,xt,zt;++htht&&(ht=Dt),ut.push(Dt)}for(zt=0;ztut&&(Ye=Le,ut=ht);return Ye}function vu(pe){return pe.reduce(du,0)}function du(pe,Le){return pe+Le[1]}d.layout.histogram=function(){var pe=!0,Le=Number,Ye=_c,ut=af;function ht(xt,Kr){for(var Dt=[],$t=xt.map(Le,this),Cr=Ye.call(this,$t,Kr),Ar=ut.call(this,Cr,$t,Kr),Vr,Kr=-1,aa=$t.length,Ua=Ar.length-1,la=pe?1:1/aa,Ta;++Kr0)for(Kr=-1;++Kr=Cr[0]&&Ta<=Cr[1]&&(Vr=Dt[d.bisect(Ar,Ta,1,Ua)-1],Vr.y+=la,Vr.push(xt[Kr]));return Dt}return ht.value=function(xt){return arguments.length?(Le=xt,ht):Le},ht.range=function(xt){return arguments.length?(Ye=wt(xt),ht):Ye},ht.bins=function(xt){return arguments.length?(ut=typeof xt=="number"?function(zt){return Rs(zt,xt)}:wt(xt),ht):ut},ht.frequency=function(xt){return arguments.length?(pe=!!xt,ht):pe},ht};function af(pe,Le){return Rs(pe,Math.ceil(Math.log(Le.length)/Math.LN2+1))}function Rs(pe,Le){for(var Ye=-1,ut=+pe[0],ht=(pe[1]-ut)/Le,xt=[];++Ye<=Le;)xt[Ye]=ht*Ye+ut;return xt}function _c(pe){return[d.min(pe),d.max(pe)]}d.layout.pack=function(){var pe=d.layout.hierarchy().sort(ju),Le=0,Ye=[1,1],ut;function ht(xt,zt){var Dt=pe.call(this,xt,zt),$t=Dt[0],Cr=Ye[0],Ar=Ye[1],Vr=ut==null?Math.sqrt:typeof ut=="function"?ut:function(){return ut};if($t.x=$t.y=0,Pu($t,function(aa){aa.r=+Vr(aa.value)}),Pu($t,bc),Le){var Kr=Le*(ut?1:Math.max(2*$t.r/Cr,2*$t.r/Ar))/2;Pu($t,function(aa){aa.r+=Kr}),Pu($t,bc),Pu($t,function(aa){aa.r-=Kr})}return nf($t,Cr/2,Ar/2,ut?1:1/Math.max(2*$t.r/Cr,2*$t.r/Ar)),Dt}return ht.size=function(xt){return arguments.length?(Ye=xt,ht):Ye},ht.radius=function(xt){return arguments.length?(ut=xt==null||typeof xt=="function"?xt:+xt,ht):ut},ht.padding=function(xt){return arguments.length?(Le=+xt,ht):Le},Ns(ht,pe)};function ju(pe,Le){return pe.value-Le.value}function iu(pe,Le){var Ye=pe._pack_next;pe._pack_next=Le,Le._pack_prev=pe,Le._pack_next=Ye,Ye._pack_prev=Le}function xc(pe,Le){pe._pack_next=Le,Le._pack_prev=pe}function Iu(pe,Le){var Ye=Le.x-pe.x,ut=Le.y-pe.y,ht=pe.r+Le.r;return .999*ht*ht>Ye*Ye+ut*ut}function bc(pe){if(!(Le=pe.children)||!(Kr=Le.length))return;var Le,Ye=1/0,ut=-1/0,ht=1/0,xt=-1/0,zt,Dt,$t,Cr,Ar,Vr,Kr;function aa(Ma){Ye=Math.min(Ma.x-Ma.r,Ye),ut=Math.max(Ma.x+Ma.r,ut),ht=Math.min(Ma.y-Ma.r,ht),xt=Math.max(Ma.y+Ma.r,xt)}if(Le.forEach(Lf),zt=Le[0],zt.x=-zt.r,zt.y=0,aa(zt),Kr>1&&(Dt=Le[1],Dt.x=Dt.r,Dt.y=0,aa(Dt),Kr>2))for($t=Le[2],ou(zt,Dt,$t),aa($t),iu(zt,$t),zt._pack_prev=$t,iu($t,Dt),Dt=zt._pack_next,Cr=3;CrTa.x&&(Ta=mn),mn.depth>ka.depth&&(ka=mn)});var Ba=Le(la,Ta)/2-la.x,Va=Ye[0]/(Ta.x+Le(Ta,la)/2+Ba),Ma=Ye[1]/(ka.depth||1);yc(aa,function(mn){mn.x=(mn.x+Ba)*Va,mn.y=mn.depth*Ma})}return Kr}function xt(Ar){for(var Vr={A:null,children:[Ar]},Kr=[Vr],aa;(aa=Kr.pop())!=null;)for(var Ua=aa.children,la,Ta=0,ka=Ua.length;Ta0&&(Ol(tc(la,Ar,Kr),Ar,mn),ka+=mn,Ba+=mn),Va+=la.m,ka+=aa.m,Ma+=Ta.m,Ba+=Ua.m;la&&!Zs(Ua)&&(Ua.t=la,Ua.m+=Va-Ba),aa&&!Au(Ta)&&(Ta.t=aa,Ta.m+=ka-Ma,Kr=Ar)}return Kr}function Cr(Ar){Ar.x*=Ye[0],Ar.y=Ar.depth*Ye[1]}return ht.separation=function(Ar){return arguments.length?(Le=Ar,ht):Le},ht.size=function(Ar){return arguments.length?(ut=(Ye=Ar)==null?Cr:null,ht):ut?null:Ye},ht.nodeSize=function(Ar){return arguments.length?(ut=(Ye=Ar)==null?null:Cr,ht):ut?Ye:null},Ns(ht,pe)};function Ru(pe,Le){return pe.parent==Le.parent?1:2}function Au(pe){var Le=pe.children;return Le.length?Le[0]:pe.t}function Zs(pe){var Le=pe.children,Ye;return(Ye=Le.length)?Le[Ye-1]:pe.t}function Ol(pe,Le,Ye){var ut=Ye/(Le.i-pe.i);Le.c-=ut,Le.s+=Ye,pe.c+=ut,Le.z+=Ye,Le.m+=Ye}function bl(pe){for(var Le=0,Ye=0,ut=pe.children,ht=ut.length,xt;--ht>=0;)xt=ut[ht],xt.z+=Le,xt.m+=Le,Le+=xt.s+(Ye+=xt.c)}function tc(pe,Le,Ye){return pe.a.parent===Le.parent?pe.a:Ye}d.layout.cluster=function(){var pe=d.layout.hierarchy().sort(null).value(null),Le=Ru,Ye=[1,1],ut=!1;function ht(xt,zt){var Dt=pe.call(this,xt,zt),$t=Dt[0],Cr,Ar=0;Pu($t,function(la){var Ta=la.children;Ta&&Ta.length?(la.x=Cc(Ta),la.y=Su(Ta)):(la.x=Cr?Ar+=Le(la,Cr):0,la.y=0,Cr=la)});var Vr=Ht($t),Kr=ur($t),aa=Vr.x-Le(Vr,Kr)/2,Ua=Kr.x+Le(Kr,Vr)/2;return Pu($t,ut?function(la){la.x=(la.x-$t.x)*Ye[0],la.y=($t.y-la.y)*Ye[1]}:function(la){la.x=(la.x-aa)/(Ua-aa)*Ye[0],la.y=(1-($t.y?la.y/$t.y:1))*Ye[1]}),Dt}return ht.separation=function(xt){return arguments.length?(Le=xt,ht):Le},ht.size=function(xt){return arguments.length?(ut=(Ye=xt)==null,ht):ut?null:Ye},ht.nodeSize=function(xt){return arguments.length?(ut=(Ye=xt)!=null,ht):ut?Ye:null},Ns(ht,pe)};function Su(pe){return 1+d.max(pe,function(Le){return Le.y})}function Cc(pe){return pe.reduce(function(Le,Ye){return Le+Ye.x},0)/pe.length}function Ht(pe){var Le=pe.children;return Le&&Le.length?Ht(Le[0]):pe}function ur(pe){var Le=pe.children,Ye;return Le&&(Ye=Le.length)?ur(Le[Ye-1]):pe}d.layout.treemap=function(){var pe=d.layout.hierarchy(),Le=Math.round,Ye=[1,1],ut=null,ht=qr,xt=!1,zt,Dt="squarify",$t=.5*(1+Math.sqrt(5));function Cr(la,Ta){for(var ka=-1,Ba=la.length,Va,Ma;++ka0;)Ba.push(Ma=Va[Zn-1]),Ba.area+=Ma.area,Dt!=="squarify"||(Wn=Kr(Ba,jn))<=mn?(Va.pop(),mn=Wn):(Ba.area-=Ba.pop().area,aa(Ba,jn,ka,!1),jn=Math.min(ka.dx,ka.dy),Ba.length=Ba.area=0,mn=1/0);Ba.length&&(aa(Ba,jn,ka,!0),Ba.length=Ba.area=0),Ta.forEach(Ar)}}function Vr(la){var Ta=la.children;if(Ta&&Ta.length){var ka=ht(la),Ba=Ta.slice(),Va,Ma=[];for(Cr(Ba,ka.dx*ka.dy/la.value),Ma.area=0;Va=Ba.pop();)Ma.push(Va),Ma.area+=Va.area,Va.z!=null&&(aa(Ma,Va.z?ka.dx:ka.dy,ka,!Ba.length),Ma.length=Ma.area=0);Ta.forEach(Vr)}}function Kr(la,Ta){for(var ka=la.area,Ba,Va=0,Ma=1/0,mn=-1,Wn=la.length;++mnVa&&(Va=Ba));return ka*=ka,Ta*=Ta,ka?Math.max(Ta*Va*$t/ka,ka/(Ta*Ma*$t)):1/0}function aa(la,Ta,ka,Ba){var Va=-1,Ma=la.length,mn=ka.x,Wn=ka.y,jn=Ta?Le(la.area/Ta):0,Zn;if(Ta==ka.dx){for((Ba||jn>ka.dy)&&(jn=ka.dy);++Vaka.dx)&&(jn=ka.dx);++Va1);return pe+Le*ut*Math.sqrt(-2*Math.log(xt)/xt)}},logNormal:function(){var pe=d.random.normal.apply(d,arguments);return function(){return Math.exp(pe())}},bates:function(pe){var Le=d.random.irwinHall(pe);return function(){return Le()/pe}},irwinHall:function(pe){return function(){for(var Le=0,Ye=0;Ye2?Ja:ja,Cr=ut?mf:Zf;return ht=$t(pe,Le,Cr,Ye),xt=$t(Le,pe,Cr,Ko),Dt}function Dt($t){return ht($t)}return Dt.invert=function($t){return xt($t)},Dt.domain=function($t){return arguments.length?(pe=$t.map(Number),zt()):pe},Dt.range=function($t){return arguments.length?(Le=$t,zt()):Le},Dt.rangeRound=function($t){return Dt.range($t).interpolate($u)},Dt.clamp=function($t){return arguments.length?(ut=$t,zt()):ut},Dt.interpolate=function($t){return arguments.length?(Ye=$t,zt()):Ye},Dt.ticks=function($t){return zi(pe,$t)},Dt.tickFormat=function($t,Cr){return d3_scale_linearTickFormat(pe,$t,Cr)},Dt.nice=function($t){return Wa(pe,$t),zt()},Dt.copy=function(){return _n(pe,Le,Ye,ut)},zt()}function on(pe,Le){return d.rebind(pe,Le,"range","rangeRound","interpolate","clamp")}function Wa(pe,Le){return sn(pe,gn(On(pe,Le)[2])),sn(pe,gn(On(pe,Le)[2])),pe}function On(pe,Le){Le==null&&(Le=10);var Ye=ua(pe),ut=Ye[1]-Ye[0],ht=Math.pow(10,Math.floor(Math.log(ut/Le)/Math.LN10)),xt=Le/ut*ht;return xt<=.15?ht*=10:xt<=.35?ht*=5:xt<=.75&&(ht*=2),Ye[0]=Math.ceil(Ye[0]/ht)*ht,Ye[1]=Math.floor(Ye[1]/ht)*ht+ht*.5,Ye[2]=ht,Ye}function zi(pe,Le){return d.range.apply(d,On(pe,Le))}d.scale.log=function(){return ki(d.scale.linear().domain([0,1]),10,!0,[1,10])};function ki(pe,Le,Ye,ut){function ht(Dt){return(Ye?Math.log(Dt<0?0:Dt):-Math.log(Dt>0?0:-Dt))/Math.log(Le)}function xt(Dt){return Ye?Math.pow(Le,Dt):-Math.pow(Le,-Dt)}function zt(Dt){return pe(ht(Dt))}return zt.invert=function(Dt){return xt(pe.invert(Dt))},zt.domain=function(Dt){return arguments.length?(Ye=Dt[0]>=0,pe.domain((ut=Dt.map(Number)).map(ht)),zt):ut},zt.base=function(Dt){return arguments.length?(Le=+Dt,pe.domain(ut.map(ht)),zt):Le},zt.nice=function(){var Dt=sn(ut.map(ht),Ye?Math:ji);return pe.domain(Dt),ut=Dt.map(xt),zt},zt.ticks=function(){var Dt=ua(ut),$t=[],Cr=Dt[0],Ar=Dt[1],Vr=Math.floor(ht(Cr)),Kr=Math.ceil(ht(Ar)),aa=Le%1?2:Le;if(isFinite(Kr-Vr)){if(Ye){for(;Vr0;Ua--)$t.push(xt(Vr)*Ua);for(Vr=0;$t[Vr]Ar;Kr--);$t=$t.slice(Vr,Kr)}return $t},zt.copy=function(){return ki(pe.copy(),Le,Ye,ut)},on(zt,pe)}var ji={floor:function(pe){return-Math.ceil(-pe)},ceil:function(pe){return-Math.floor(-pe)}};d.scale.pow=function(){return Ni(d.scale.linear(),1,[0,1])};function Ni(pe,Le,Ye){var ut=Bn(Le),ht=Bn(1/Le);function xt(zt){return pe(ut(zt))}return xt.invert=function(zt){return ht(pe.invert(zt))},xt.domain=function(zt){return arguments.length?(pe.domain((Ye=zt.map(Number)).map(ut)),xt):Ye},xt.ticks=function(zt){return zi(Ye,zt)},xt.tickFormat=function(zt,Dt){return d3_scale_linearTickFormat(Ye,zt,Dt)},xt.nice=function(zt){return xt.domain(Wa(Ye,zt))},xt.exponent=function(zt){return arguments.length?(ut=Bn(Le=zt),ht=Bn(1/Le),pe.domain(Ye.map(ut)),xt):Le},xt.copy=function(){return Ni(pe.copy(),Le,Ye)},on(xt,pe)}function Bn(pe){return function(Le){return Le<0?-Math.pow(-Le,pe):Math.pow(Le,pe)}}d.scale.sqrt=function(){return d.scale.pow().exponent(.5)},d.scale.ordinal=function(){return An([],{t:"range",a:[[]]})};function An(pe,Le){var Ye,ut,ht;function xt(Dt){return ut[((Ye.get(Dt)||(Le.t==="range"?Ye.set(Dt,pe.push(Dt)):NaN))-1)%ut.length]}function zt(Dt,$t){return d.range(pe.length).map(function(Cr){return Dt+$t*Cr})}return xt.domain=function(Dt){if(!arguments.length)return pe;pe=[],Ye=new S;for(var $t=-1,Cr=Dt.length,Ar;++$t0?Ye[xt-1]:pe[0],xtKr?0:1;if(Ar=be)return $t(Ar,Ua)+(Cr?$t(Cr,1-Ua):"")+"Z";var la,Ta,ka,Ba,Va=0,Ma=0,mn,Wn,jn,Zn,hi,_i,Po,wi,Ji=[];if((Ba=(+zt.apply(this,arguments)||0)/2)&&(ka=ut===Ss?Math.sqrt(Cr*Cr+Ar*Ar):+ut.apply(this,arguments),Ua||(Ma*=-1),Ar&&(Ma=Mt(ka/Ar*Math.sin(Ba))),Cr&&(Va=Mt(ka/Cr*Math.sin(Ba)))),Ar){mn=Ar*Math.cos(Vr+Ma),Wn=Ar*Math.sin(Vr+Ma),jn=Ar*Math.cos(Kr-Ma),Zn=Ar*Math.sin(Kr-Ma);var Vo=Math.abs(Kr-Vr-2*Ma)<=ve?0:1;if(Ma&&jl(mn,Wn,jn,Zn)===Ua^Vo){var sl=(Vr+Kr)/2;mn=Ar*Math.cos(sl),Wn=Ar*Math.sin(sl),jn=Zn=null}}else mn=Wn=0;if(Cr){hi=Cr*Math.cos(Kr-Va),_i=Cr*Math.sin(Kr-Va),Po=Cr*Math.cos(Vr+Va),wi=Cr*Math.sin(Vr+Va);var Ms=Math.abs(Vr-Kr+2*Va)<=ve?0:1;if(Va&&jl(hi,_i,Po,wi)===1-Ua^Ms){var Kn=(Vr+Kr)/2;hi=Cr*Math.cos(Kn),_i=Cr*Math.sin(Kn),Po=wi=null}}else hi=_i=0;if(aa>Ge&&(la=Math.min(Math.abs(Ar-Cr)/2,+Ye.apply(this,arguments)))>.001){Ta=Cr0?0:1}function Vl(pe,Le,Ye,ut,ht){var xt=pe[0]-Le[0],zt=pe[1]-Le[1],Dt=(ht?ut:-ut)/Math.sqrt(xt*xt+zt*zt),$t=Dt*zt,Cr=-Dt*xt,Ar=pe[0]+$t,Vr=pe[1]+Cr,Kr=Le[0]+$t,aa=Le[1]+Cr,Ua=(Ar+Kr)/2,la=(Vr+aa)/2,Ta=Kr-Ar,ka=aa-Vr,Ba=Ta*Ta+ka*ka,Va=Ye-ut,Ma=Ar*aa-Kr*Vr,mn=(ka<0?-1:1)*Math.sqrt(Math.max(0,Va*Va*Ba-Ma*Ma)),Wn=(Ma*ka-Ta*mn)/Ba,jn=(-Ma*Ta-ka*mn)/Ba,Zn=(Ma*ka+Ta*mn)/Ba,hi=(-Ma*Ta+ka*mn)/Ba,_i=Wn-Ua,Po=jn-la,wi=Zn-Ua,Ji=hi-la;return _i*_i+Po*Po>wi*wi+Ji*Ji&&(Wn=Zn,jn=hi),[[Wn-$t,jn-Cr],[Wn*Ye/Va,jn*Ye/Va]]}function cc(){return!0}function ql(pe){var Le=yi,Ye=Ci,ut=cc,ht=ol,xt=ht.key,zt=.7;function Dt($t){var Cr=[],Ar=[],Vr=-1,Kr=$t.length,aa,Ua=wt(Le),la=wt(Ye);function Ta(){Cr.push("M",ht(pe(Ar),zt))}for(;++Vr1?pe.join("L"):pe+"Z"}function rc(pe){return pe.join("L")+"Z"}function Vi(pe){for(var Le=0,Ye=pe.length,ut=pe[0],ht=[ut[0],",",ut[1]];++Le1&&ht.push("H",ut[0]),ht.join("")}function eo(pe){for(var Le=0,Ye=pe.length,ut=pe[0],ht=[ut[0],",",ut[1]];++Le1){Dt=Le[1],xt=pe[$t],$t++,ut+="C"+(ht[0]+zt[0])+","+(ht[1]+zt[1])+","+(xt[0]-Dt[0])+","+(xt[1]-Dt[1])+","+xt[0]+","+xt[1];for(var Cr=2;Cr9&&(xt=Ye*3/Math.sqrt(xt),zt[Dt]=xt*ut,zt[Dt+1]=xt*ht));for(Dt=-1;++Dt<=$t;)xt=(pe[Math.min($t,Dt+1)][0]-pe[Math.max(0,Dt-1)][0])/(6*(1+zt[Dt]*zt[Dt])),Le.push([xt||0,zt[Dt]*xt||0]);return Le}function Ze(pe){return pe.length<3?ol(pe):pe[0]+I(pe,je(pe))}d.svg.line.radial=function(){var pe=ql(at);return pe.radius=pe.x,delete pe.x,pe.angle=pe.y,delete pe.y,pe};function at(pe){for(var Le,Ye=-1,ut=pe.length,ht,xt;++Yeve)+",1 "+Vr}function Cr(Ar,Vr,Kr,aa){return"Q 0,0 "+aa}return xt.radius=function(Ar){return arguments.length?(Ye=wt(Ar),xt):Ye},xt.source=function(Ar){return arguments.length?(pe=wt(Ar),xt):pe},xt.target=function(Ar){return arguments.length?(Le=wt(Ar),xt):Le},xt.startAngle=function(Ar){return arguments.length?(ut=wt(Ar),xt):ut},xt.endAngle=function(Ar){return arguments.length?(ht=wt(Ar),xt):ht},xt};function Et(pe){return pe.radius}d.svg.diagonal=function(){var pe=Tt,Le=gt,Ye=Yt;function ut(ht,xt){var zt=pe.call(this,ht,xt),Dt=Le.call(this,ht,xt),$t=(zt.y+Dt.y)/2,Cr=[zt,{x:zt.x,y:$t},{x:Dt.x,y:$t},Dt];return Cr=Cr.map(Ye),"M"+Cr[0]+"C"+Cr[1]+" "+Cr[2]+" "+Cr[3]}return ut.source=function(ht){return arguments.length?(pe=wt(ht),ut):pe},ut.target=function(ht){return arguments.length?(Le=wt(ht),ut):Le},ut.projection=function(ht){return arguments.length?(Ye=ht,ut):Ye},ut};function Yt(pe){return[pe.x,pe.y]}d.svg.diagonal.radial=function(){var pe=d.svg.diagonal(),Le=Yt,Ye=pe.projection;return pe.projection=function(ut){return arguments.length?Ye(rr(Le=ut)):Le},pe};function rr(pe){return function(){var Le=pe.apply(this,arguments),Ye=Le[0],ut=Le[1]-Pe;return[Ye*Math.cos(ut),Ye*Math.sin(ut)]}}d.svg.symbol=function(){var pe=Sr,Le=sr;function Ye(ut,ht){return(Qr.get(pe.call(this,ut,ht))||Nr)(Le.call(this,ut,ht))}return Ye.type=function(ut){return arguments.length?(pe=wt(ut),Ye):pe},Ye.size=function(ut){return arguments.length?(Le=wt(ut),Ye):Le},Ye};function sr(){return 64}function Sr(){return"circle"}function Nr(pe){var Le=Math.sqrt(pe/ve);return"M0,"+Le+"A"+Le+","+Le+" 0 1,1 0,"+-Le+"A"+Le+","+Le+" 0 1,1 0,"+Le+"Z"}var Qr=d.map({circle:Nr,cross:function(pe){var Le=Math.sqrt(pe/5)/2;return"M"+-3*Le+","+-Le+"H"+-Le+"V"+-3*Le+"H"+Le+"V"+-Le+"H"+3*Le+"V"+Le+"H"+Le+"V"+3*Le+"H"+-Le+"V"+Le+"H"+-3*Le+"Z"},diamond:function(pe){var Le=Math.sqrt(pe/(2*_a)),Ye=Le*_a;return"M0,"+-Le+"L"+Ye+",0 0,"+Le+" "+-Ye+",0Z"},square:function(pe){var Le=Math.sqrt(pe)/2;return"M"+-Le+","+-Le+"L"+Le+","+-Le+" "+Le+","+Le+" "+-Le+","+Le+"Z"},"triangle-down":function(pe){var Le=Math.sqrt(pe/ia),Ye=Le*ia/2;return"M0,"+Ye+"L"+Le+","+-Ye+" "+-Le+","+-Ye+"Z"},"triangle-up":function(pe){var Le=Math.sqrt(pe/ia),Ye=Le*ia/2;return"M0,"+-Ye+"L"+Le+","+Ye+" "+-Le+","+Ye+"Z"}});d.svg.symbolTypes=Qr.keys();var ia=Math.sqrt(3),_a=Math.tan(30*We);ee.transition=function(pe){for(var Le=pi||++Nn,Ye=No(pe),ut=[],ht,xt,zt=ii||{time:Date.now(),ease:oo,delay:0,duration:250},Dt=-1,$t=this.length;++Dt<$t;){ut.push(ht=[]);for(var Cr=this[Dt],Ar=-1,Vr=Cr.length;++Ar0;)Vr[--Ba].call(pe,ka);if(Ta>=1)return zt.event&&zt.event.end.call(pe,pe.__data__,Le),--xt.count?delete xt[ut]:delete pe[Ye],1}zt||(Dt=ht.time,$t=Ga(Kr,0,Dt),zt=xt[ut]={tween:new S,time:Dt,timer:$t,delay:ht.delay,duration:ht.duration,ease:ht.ease,index:Le},ht=null,++xt.count)}d.svg.axis=function(){var pe=d.scale.linear(),Le=Zo,Ye=6,ut=6,ht=3,xt=[10],zt=null,Dt;function $t(Cr){Cr.each(function(){var Ar=d.select(this),Vr=this.__chart__||pe,Kr=this.__chart__=pe.copy(),aa=zt??(Kr.ticks?Kr.ticks.apply(Kr,xt):Kr.domain()),Ua=Dt??(Kr.tickFormat?Kr.tickFormat.apply(Kr,xt):F),la=Ar.selectAll(".tick").data(aa,Kr),Ta=la.enter().insert("g",".domain").attr("class","tick").style("opacity",Ge),ka=d.transition(la.exit()).style("opacity",Ge).remove(),Ba=d.transition(la.order()).style("opacity",1),Va=Math.max(Ye,0)+ht,Ma,mn=Fa(Kr),Wn=Ar.selectAll(".domain").data([0]),jn=(Wn.enter().append("path").attr("class","domain"),d.transition(Wn));Ta.append("line"),Ta.append("text");var Zn=Ta.select("line"),hi=Ba.select("line"),_i=la.select("text").text(Ua),Po=Ta.select("text"),wi=Ba.select("text"),Ji=Le==="top"||Le==="left"?-1:1,Vo,sl,Ms,Kn;if(Le==="bottom"||Le==="top"?(Ma=zs,Vo="x",Ms="y",sl="x2",Kn="y2",_i.attr("dy",Ji<0?"0em":".71em").style("text-anchor","middle"),jn.attr("d","M"+mn[0]+","+Ji*ut+"V0H"+mn[1]+"V"+Ji*ut)):(Ma=xo,Vo="y",Ms="x",sl="y2",Kn="x2",_i.attr("dy",".32em").style("text-anchor",Ji<0?"end":"start"),jn.attr("d","M"+Ji*ut+","+mn[0]+"H0V"+mn[1]+"H"+Ji*ut)),Zn.attr(Kn,Ji*Ye),Po.attr(Ms,Ji*Va),hi.attr(sl,0).attr(Kn,Ji*Ye),wi.attr(Vo,0).attr(Ms,Ji*Va),Kr.rangeBand){var go=Kr,Do=go.rangeBand()/2;Vr=Kr=function(Es){return go(Es)+Do}}else Vr.rangeBand?Vr=Kr:ka.call(Ma,Kr,Vr);Ta.call(Ma,Vr,Kr),Ba.call(Ma,Kr,Kr)})}return $t.scale=function(Cr){return arguments.length?(pe=Cr,$t):pe},$t.orient=function(Cr){return arguments.length?(Le=Cr in Hs?Cr+"":Zo,$t):Le},$t.ticks=function(){return arguments.length?(xt=A(arguments),$t):xt},$t.tickValues=function(Cr){return arguments.length?(zt=Cr,$t):zt},$t.tickFormat=function(Cr){return arguments.length?(Dt=Cr,$t):Dt},$t.tickSize=function(Cr){var Ar=arguments.length;return Ar?(Ye=+Cr,ut=+arguments[Ar-1],$t):Ye},$t.innerTickSize=function(Cr){return arguments.length?(Ye=+Cr,$t):Ye},$t.outerTickSize=function(Cr){return arguments.length?(ut=+Cr,$t):ut},$t.tickPadding=function(Cr){return arguments.length?(ht=+Cr,$t):ht},$t.tickSubdivide=function(){return arguments.length&&$t},$t};var Zo="bottom",Hs={top:1,right:1,bottom:1,left:1};function zs(pe,Le,Ye){pe.attr("transform",function(ut){var ht=Le(ut);return"translate("+(isFinite(ht)?ht:Ye(ut))+",0)"})}function xo(pe,Le,Ye){pe.attr("transform",function(ut){var ht=Le(ut);return"translate(0,"+(isFinite(ht)?ht:Ye(ut))+")"})}d.svg.brush=function(){var pe=oe(Ar,"brushstart","brush","brushend"),Le=null,Ye=null,ut=[0,0],ht=[0,0],xt,zt,Dt=!0,$t=!0,Cr=vl[0];function Ar(la){la.each(function(){var Ta=d.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",Ua).on("touchstart.brush",Ua),ka=Ta.selectAll(".background").data([0]);ka.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),Ta.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var Ba=Ta.selectAll(".resize").data(Cr,F);Ba.exit().remove(),Ba.enter().append("g").attr("class",function(Wn){return"resize "+Wn}).style("cursor",function(Wn){return bo[Wn]}).append("rect").attr("x",function(Wn){return/[ew]$/.test(Wn)?-3:null}).attr("y",function(Wn){return/^[ns]/.test(Wn)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),Ba.style("display",Ar.empty()?"none":null);var Va=d.transition(Ta),Ma=d.transition(ka),mn;Le&&(mn=Fa(Le),Ma.attr("x",mn[0]).attr("width",mn[1]-mn[0]),Kr(Va)),Ye&&(mn=Fa(Ye),Ma.attr("y",mn[0]).attr("height",mn[1]-mn[0]),aa(Va)),Vr(Va)})}Ar.event=function(la){la.each(function(){var Ta=pe.of(this,arguments),ka={x:ut,y:ht,i:xt,j:zt},Ba=this.__chart__||ka;this.__chart__=ka,pi?d.select(this).transition().each("start.brush",function(){xt=Ba.i,zt=Ba.j,ut=Ba.x,ht=Ba.y,Ta({type:"brushstart"})}).tween("brush:brush",function(){var Va=Cs(ut,ka.x),Ma=Cs(ht,ka.y);return xt=zt=null,function(mn){ut=ka.x=Va(mn),ht=ka.y=Ma(mn),Ta({type:"brush",mode:"resize"})}}).each("end.brush",function(){xt=ka.i,zt=ka.j,Ta({type:"brush",mode:"resize"}),Ta({type:"brushend"})}):(Ta({type:"brushstart"}),Ta({type:"brush",mode:"resize"}),Ta({type:"brushend"}))})};function Vr(la){la.selectAll(".resize").attr("transform",function(Ta){return"translate("+ut[+/e$/.test(Ta)]+","+ht[+/^s/.test(Ta)]+")"})}function Kr(la){la.select(".extent").attr("x",ut[0]),la.selectAll(".extent,.n>rect,.s>rect").attr("width",ut[1]-ut[0])}function aa(la){la.select(".extent").attr("y",ht[0]),la.selectAll(".extent,.e>rect,.w>rect").attr("height",ht[1]-ht[0])}function Ua(){var la=this,Ta=d.select(d.event.target),ka=pe.of(la,arguments),Ba=d.select(la),Va=Ta.datum(),Ma=!/^(n|s)$/.test(Va)&&Le,mn=!/^(e|w)$/.test(Va)&&Ye,Wn=Ta.classed("extent"),jn=fr(la),Zn,hi=d.mouse(la),_i,Po=d.select(t(la)).on("keydown.brush",Vo).on("keyup.brush",sl);if(d.event.changedTouches?Po.on("touchmove.brush",Ms).on("touchend.brush",go):Po.on("mousemove.brush",Ms).on("mouseup.brush",go),Ba.interrupt().selectAll("*").interrupt(),Wn)hi[0]=ut[0]-hi[0],hi[1]=ht[0]-hi[1];else if(Va){var wi=+/w$/.test(Va),Ji=+/^n/.test(Va);_i=[ut[1-wi]-hi[0],ht[1-Ji]-hi[1]],hi[0]=ut[wi],hi[1]=ht[Ji]}else d.event.altKey&&(Zn=hi.slice());Ba.style("pointer-events","none").selectAll(".resize").style("display",null),d.select("body").style("cursor",Ta.style("cursor")),ka({type:"brushstart"}),Ms();function Vo(){d.event.keyCode==32&&(Wn||(Zn=null,hi[0]-=ut[1],hi[1]-=ht[1],Wn=2),Q())}function sl(){d.event.keyCode==32&&Wn==2&&(hi[0]+=ut[1],hi[1]+=ht[1],Wn=0,Q())}function Ms(){var Do=d.mouse(la),Es=!1;_i&&(Do[0]+=_i[0],Do[1]+=_i[1]),Wn||(d.event.altKey?(Zn||(Zn=[(ut[0]+ut[1])/2,(ht[0]+ht[1])/2]),hi[0]=ut[+(Do[0]0))return Ut;do Ut.push(ir=new Date(+At)),Re(At,Rt),ce(At);while(ir=St)for(;ce(St),!At(St);)St.setTime(St-1)},function(St,Rt){if(St>=St)if(Rt<0)for(;++Rt<=0;)for(;Re(St,-1),!At(St););else for(;--Rt>=0;)for(;Re(St,1),!At(St););})},$e&&(Je.count=function(At,St){return x.setTime(+At),A.setTime(+St),ce(x),ce(A),Math.floor($e(x,A))},Je.every=function(At){return At=Math.floor(At),!isFinite(At)||!(At>0)?null:At>1?Je.filter(rt?function(St){return rt(St)%At===0}:function(St){return Je.count(0,St)%At===0}):Je}),Je}var e=E(function(){},function(ce,Re){ce.setTime(+ce+Re)},function(ce,Re){return Re-ce});e.every=function(ce){return ce=Math.floor(ce),!isFinite(ce)||!(ce>0)?null:ce>1?E(function(Re){Re.setTime(Math.floor(Re/ce)*ce)},function(Re,$e){Re.setTime(+Re+$e*ce)},function(Re,$e){return($e-Re)/ce}):e};var t=e.range,r=1e3,o=6e4,a=36e5,i=864e5,n=6048e5,s=E(function(ce){ce.setTime(ce-ce.getMilliseconds())},function(ce,Re){ce.setTime(+ce+Re*r)},function(ce,Re){return(Re-ce)/r},function(ce){return ce.getUTCSeconds()}),c=s.range,f=E(function(ce){ce.setTime(ce-ce.getMilliseconds()-ce.getSeconds()*r)},function(ce,Re){ce.setTime(+ce+Re*o)},function(ce,Re){return(Re-ce)/o},function(ce){return ce.getMinutes()}),v=f.range,h=E(function(ce){ce.setTime(ce-ce.getMilliseconds()-ce.getSeconds()*r-ce.getMinutes()*o)},function(ce,Re){ce.setTime(+ce+Re*a)},function(ce,Re){return(Re-ce)/a},function(ce){return ce.getHours()}),T=h.range,l=E(function(ce){ce.setHours(0,0,0,0)},function(ce,Re){ce.setDate(ce.getDate()+Re)},function(ce,Re){return(Re-ce-(Re.getTimezoneOffset()-ce.getTimezoneOffset())*o)/i},function(ce){return ce.getDate()-1}),y=l.range;function b(ce){return E(function(Re){Re.setDate(Re.getDate()-(Re.getDay()+7-ce)%7),Re.setHours(0,0,0,0)},function(Re,$e){Re.setDate(Re.getDate()+$e*7)},function(Re,$e){return($e-Re-($e.getTimezoneOffset()-Re.getTimezoneOffset())*o)/n})}var S=b(0),M=b(1),_=b(2),w=b(3),p=b(4),u=b(5),g=b(6),m=S.range,R=M.range,P=_.range,z=w.range,F=p.range,B=u.range,O=g.range,L=E(function(ce){ce.setDate(1),ce.setHours(0,0,0,0)},function(ce,Re){ce.setMonth(ce.getMonth()+Re)},function(ce,Re){return Re.getMonth()-ce.getMonth()+(Re.getFullYear()-ce.getFullYear())*12},function(ce){return ce.getMonth()}),N=L.range,U=E(function(ce){ce.setMonth(0,1),ce.setHours(0,0,0,0)},function(ce,Re){ce.setFullYear(ce.getFullYear()+Re)},function(ce,Re){return Re.getFullYear()-ce.getFullYear()},function(ce){return ce.getFullYear()});U.every=function(ce){return!isFinite(ce=Math.floor(ce))||!(ce>0)?null:E(function(Re){Re.setFullYear(Math.floor(Re.getFullYear()/ce)*ce),Re.setMonth(0,1),Re.setHours(0,0,0,0)},function(Re,$e){Re.setFullYear(Re.getFullYear()+$e*ce)})};var Z=U.range,Q=E(function(ce){ce.setUTCSeconds(0,0)},function(ce,Re){ce.setTime(+ce+Re*o)},function(ce,Re){return(Re-ce)/o},function(ce){return ce.getUTCMinutes()}),ue=Q.range,oe=E(function(ce){ce.setUTCMinutes(0,0,0)},function(ce,Re){ce.setTime(+ce+Re*a)},function(ce,Re){return(Re-ce)/a},function(ce){return ce.getUTCHours()}),le=oe.range,j=E(function(ce){ce.setUTCHours(0,0,0,0)},function(ce,Re){ce.setUTCDate(ce.getUTCDate()+Re)},function(ce,Re){return(Re-ce)/i},function(ce){return ce.getUTCDate()-1}),J=j.range;function $(ce){return E(function(Re){Re.setUTCDate(Re.getUTCDate()-(Re.getUTCDay()+7-ce)%7),Re.setUTCHours(0,0,0,0)},function(Re,$e){Re.setUTCDate(Re.getUTCDate()+$e*7)},function(Re,$e){return($e-Re)/n})}var X=$(0),re=$(1),ee=$(2),q=$(3),ae=$(4),ie=$(5),fe=$(6),we=X.range,Ae=re.range,Fe=ee.range,Ce=q.range,qe=ae.range,et=ie.range,Qe=fe.range,Ke=E(function(ce){ce.setUTCDate(1),ce.setUTCHours(0,0,0,0)},function(ce,Re){ce.setUTCMonth(ce.getUTCMonth()+Re)},function(ce,Re){return Re.getUTCMonth()-ce.getUTCMonth()+(Re.getUTCFullYear()-ce.getUTCFullYear())*12},function(ce){return ce.getUTCMonth()}),Xe=Ke.range,Me=E(function(ce){ce.setUTCMonth(0,1),ce.setUTCHours(0,0,0,0)},function(ce,Re){ce.setUTCFullYear(ce.getUTCFullYear()+Re)},function(ce,Re){return Re.getUTCFullYear()-ce.getUTCFullYear()},function(ce){return ce.getUTCFullYear()});Me.every=function(ce){return!isFinite(ce=Math.floor(ce))||!(ce>0)?null:E(function(Re){Re.setUTCFullYear(Math.floor(Re.getUTCFullYear()/ce)*ce),Re.setUTCMonth(0,1),Re.setUTCHours(0,0,0,0)},function(Re,$e){Re.setUTCFullYear(Re.getUTCFullYear()+$e*ce)})};var xe=Me.range;d.timeDay=l,d.timeDays=y,d.timeFriday=u,d.timeFridays=B,d.timeHour=h,d.timeHours=T,d.timeInterval=E,d.timeMillisecond=e,d.timeMilliseconds=t,d.timeMinute=f,d.timeMinutes=v,d.timeMonday=M,d.timeMondays=R,d.timeMonth=L,d.timeMonths=N,d.timeSaturday=g,d.timeSaturdays=O,d.timeSecond=s,d.timeSeconds=c,d.timeSunday=S,d.timeSundays=m,d.timeThursday=p,d.timeThursdays=F,d.timeTuesday=_,d.timeTuesdays=P,d.timeWednesday=w,d.timeWednesdays=z,d.timeWeek=S,d.timeWeeks=m,d.timeYear=U,d.timeYears=Z,d.utcDay=j,d.utcDays=J,d.utcFriday=ie,d.utcFridays=et,d.utcHour=oe,d.utcHours=le,d.utcMillisecond=e,d.utcMilliseconds=t,d.utcMinute=Q,d.utcMinutes=ue,d.utcMonday=re,d.utcMondays=Ae,d.utcMonth=Ke,d.utcMonths=Xe,d.utcSaturday=fe,d.utcSaturdays=Qe,d.utcSecond=s,d.utcSeconds=c,d.utcSunday=X,d.utcSundays=we,d.utcThursday=ae,d.utcThursdays=qe,d.utcTuesday=ee,d.utcTuesdays=Fe,d.utcWednesday=q,d.utcWednesdays=Ce,d.utcWeek=X,d.utcWeeks=we,d.utcYear=Me,d.utcYears=xe,Object.defineProperty(d,"__esModule",{value:!0})})}}),Xl=He({"node_modules/d3-time-format/dist/d3-time-format.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y,Bf()):(d=d||self,x(d.d3=d.d3||{},d.d3))})(Y,function(d,x){function A(ze){if(0<=ze.y&&ze.y<100){var Ge=new Date(-1,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L);return Ge.setFullYear(ze.y),Ge}return new Date(ze.y,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L)}function E(ze){if(0<=ze.y&&ze.y<100){var Ge=new Date(Date.UTC(-1,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L));return Ge.setUTCFullYear(ze.y),Ge}return new Date(Date.UTC(ze.y,ze.m,ze.d,ze.H,ze.M,ze.S,ze.L))}function e(ze,Ge,Oe){return{y:ze,m:Ge,d:Oe,H:0,M:0,S:0,L:0}}function t(ze){var Ge=ze.dateTime,Oe=ze.date,ve=ze.time,ge=ze.periods,be=ze.days,Pe=ze.shortDays,We=ze.months,ct=ze.shortMonths,_t=c(ge),Mt=f(ge),Nt=c(be),Bt=f(be),qt=c(Pe),Zt=f(Pe),lr=c(We),ta=f(We),da=c(ct),wa=f(ct),ma={a:Aa,A:Pa,b:sa,B:Oa,c:null,d:L,e:L,f:ue,H:N,I:U,j:Z,L:Q,m:oe,M:le,p:dt,q:vt,Q:St,s:Rt,S:j,u:J,U:$,V:X,w:re,W:ee,x:null,X:null,y:q,Y:ae,Z:ie,"%":At},Ia={a:Lr,A:Er,b:_r,B:yr,c:null,d:fe,e:fe,f:qe,H:we,I:Ae,j:Fe,L:Ce,m:et,M:Qe,p:kr,q:zr,Q:St,s:Rt,S:Ke,u:Xe,U:Me,V:xe,w:ce,W:Re,x:null,X:null,y:$e,Y:rt,Z:Je,"%":At},va={a:jt,A:Ot,b:gr,B:Br,c:na,d:p,e:p,f:z,H:g,I:g,j:u,L:P,m:w,M:m,p:Lt,q:_,Q:B,s:O,S:R,u:h,U:T,V:l,w:v,W:y,x:Ur,X:ga,y:S,Y:b,Z:M,"%":F};ma.x=La(Oe,ma),ma.X=La(ve,ma),ma.c=La(Ge,ma),Ia.x=La(Oe,Ia),Ia.X=La(ve,Ia),Ia.c=La(Ge,Ia);function La(Pr,Hr){return function(Zr){var Jr=[],wt=-1,Qt=0,mr=Pr.length,$r,oa,Sa;for(Zr instanceof Date||(Zr=new Date(+Zr));++wt53)return null;"w"in Jr||(Jr.w=1),"Z"in Jr?(Qt=E(e(Jr.y,0,1)),mr=Qt.getUTCDay(),Qt=mr>4||mr===0?x.utcMonday.ceil(Qt):x.utcMonday(Qt),Qt=x.utcDay.offset(Qt,(Jr.V-1)*7),Jr.y=Qt.getUTCFullYear(),Jr.m=Qt.getUTCMonth(),Jr.d=Qt.getUTCDate()+(Jr.w+6)%7):(Qt=A(e(Jr.y,0,1)),mr=Qt.getDay(),Qt=mr>4||mr===0?x.timeMonday.ceil(Qt):x.timeMonday(Qt),Qt=x.timeDay.offset(Qt,(Jr.V-1)*7),Jr.y=Qt.getFullYear(),Jr.m=Qt.getMonth(),Jr.d=Qt.getDate()+(Jr.w+6)%7)}else("W"in Jr||"U"in Jr)&&("w"in Jr||(Jr.w="u"in Jr?Jr.u%7:"W"in Jr?1:0),mr="Z"in Jr?E(e(Jr.y,0,1)).getUTCDay():A(e(Jr.y,0,1)).getDay(),Jr.m=0,Jr.d="W"in Jr?(Jr.w+6)%7+Jr.W*7-(mr+5)%7:Jr.w+Jr.U*7-(mr+6)%7);return"Z"in Jr?(Jr.H+=Jr.Z/100|0,Jr.M+=Jr.Z%100,E(Jr)):A(Jr)}}function Vt(Pr,Hr,Zr,Jr){for(var wt=0,Qt=Hr.length,mr=Zr.length,$r,oa;wt=mr)return-1;if($r=Hr.charCodeAt(wt++),$r===37){if($r=Hr.charAt(wt++),oa=va[$r in r?Hr.charAt(wt++):$r],!oa||(Jr=oa(Pr,Zr,Jr))<0)return-1}else if($r!=Zr.charCodeAt(Jr++))return-1}return Jr}function Lt(Pr,Hr,Zr){var Jr=_t.exec(Hr.slice(Zr));return Jr?(Pr.p=Mt[Jr[0].toLowerCase()],Zr+Jr[0].length):-1}function jt(Pr,Hr,Zr){var Jr=qt.exec(Hr.slice(Zr));return Jr?(Pr.w=Zt[Jr[0].toLowerCase()],Zr+Jr[0].length):-1}function Ot(Pr,Hr,Zr){var Jr=Nt.exec(Hr.slice(Zr));return Jr?(Pr.w=Bt[Jr[0].toLowerCase()],Zr+Jr[0].length):-1}function gr(Pr,Hr,Zr){var Jr=da.exec(Hr.slice(Zr));return Jr?(Pr.m=wa[Jr[0].toLowerCase()],Zr+Jr[0].length):-1}function Br(Pr,Hr,Zr){var Jr=lr.exec(Hr.slice(Zr));return Jr?(Pr.m=ta[Jr[0].toLowerCase()],Zr+Jr[0].length):-1}function na(Pr,Hr,Zr){return Vt(Pr,Ge,Hr,Zr)}function Ur(Pr,Hr,Zr){return Vt(Pr,Oe,Hr,Zr)}function ga(Pr,Hr,Zr){return Vt(Pr,ve,Hr,Zr)}function Aa(Pr){return Pe[Pr.getDay()]}function Pa(Pr){return be[Pr.getDay()]}function sa(Pr){return ct[Pr.getMonth()]}function Oa(Pr){return We[Pr.getMonth()]}function dt(Pr){return ge[+(Pr.getHours()>=12)]}function vt(Pr){return 1+~~(Pr.getMonth()/3)}function Lr(Pr){return Pe[Pr.getUTCDay()]}function Er(Pr){return be[Pr.getUTCDay()]}function _r(Pr){return ct[Pr.getUTCMonth()]}function yr(Pr){return We[Pr.getUTCMonth()]}function kr(Pr){return ge[+(Pr.getUTCHours()>=12)]}function zr(Pr){return 1+~~(Pr.getUTCMonth()/3)}return{format:function(Pr){var Hr=La(Pr+="",ma);return Hr.toString=function(){return Pr},Hr},parse:function(Pr){var Hr=Ka(Pr+="",!1);return Hr.toString=function(){return Pr},Hr},utcFormat:function(Pr){var Hr=La(Pr+="",Ia);return Hr.toString=function(){return Pr},Hr},utcParse:function(Pr){var Hr=Ka(Pr+="",!0);return Hr.toString=function(){return Pr},Hr}}}var r={"-":"",_:" ",0:"0"},o=/^\s*\d+/,a=/^%/,i=/[\\^$*+?|[\]().{}]/g;function n(ze,Ge,Oe){var ve=ze<0?"-":"",ge=(ve?-ze:ze)+"",be=ge.length;return ve+(be68?1900:2e3),Oe+ve[0].length):-1}function M(ze,Ge,Oe){var ve=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(Ge.slice(Oe,Oe+6));return ve?(ze.Z=ve[1]?0:-(ve[2]+(ve[3]||"00")),Oe+ve[0].length):-1}function _(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+1));return ve?(ze.q=ve[0]*3-3,Oe+ve[0].length):-1}function w(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+2));return ve?(ze.m=ve[0]-1,Oe+ve[0].length):-1}function p(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+2));return ve?(ze.d=+ve[0],Oe+ve[0].length):-1}function u(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+3));return ve?(ze.m=0,ze.d=+ve[0],Oe+ve[0].length):-1}function g(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+2));return ve?(ze.H=+ve[0],Oe+ve[0].length):-1}function m(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+2));return ve?(ze.M=+ve[0],Oe+ve[0].length):-1}function R(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+2));return ve?(ze.S=+ve[0],Oe+ve[0].length):-1}function P(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+3));return ve?(ze.L=+ve[0],Oe+ve[0].length):-1}function z(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe,Oe+6));return ve?(ze.L=Math.floor(ve[0]/1e3),Oe+ve[0].length):-1}function F(ze,Ge,Oe){var ve=a.exec(Ge.slice(Oe,Oe+1));return ve?Oe+ve[0].length:-1}function B(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe));return ve?(ze.Q=+ve[0],Oe+ve[0].length):-1}function O(ze,Ge,Oe){var ve=o.exec(Ge.slice(Oe));return ve?(ze.s=+ve[0],Oe+ve[0].length):-1}function L(ze,Ge){return n(ze.getDate(),Ge,2)}function N(ze,Ge){return n(ze.getHours(),Ge,2)}function U(ze,Ge){return n(ze.getHours()%12||12,Ge,2)}function Z(ze,Ge){return n(1+x.timeDay.count(x.timeYear(ze),ze),Ge,3)}function Q(ze,Ge){return n(ze.getMilliseconds(),Ge,3)}function ue(ze,Ge){return Q(ze,Ge)+"000"}function oe(ze,Ge){return n(ze.getMonth()+1,Ge,2)}function le(ze,Ge){return n(ze.getMinutes(),Ge,2)}function j(ze,Ge){return n(ze.getSeconds(),Ge,2)}function J(ze){var Ge=ze.getDay();return Ge===0?7:Ge}function $(ze,Ge){return n(x.timeSunday.count(x.timeYear(ze)-1,ze),Ge,2)}function X(ze,Ge){var Oe=ze.getDay();return ze=Oe>=4||Oe===0?x.timeThursday(ze):x.timeThursday.ceil(ze),n(x.timeThursday.count(x.timeYear(ze),ze)+(x.timeYear(ze).getDay()===4),Ge,2)}function re(ze){return ze.getDay()}function ee(ze,Ge){return n(x.timeMonday.count(x.timeYear(ze)-1,ze),Ge,2)}function q(ze,Ge){return n(ze.getFullYear()%100,Ge,2)}function ae(ze,Ge){return n(ze.getFullYear()%1e4,Ge,4)}function ie(ze){var Ge=ze.getTimezoneOffset();return(Ge>0?"-":(Ge*=-1,"+"))+n(Ge/60|0,"0",2)+n(Ge%60,"0",2)}function fe(ze,Ge){return n(ze.getUTCDate(),Ge,2)}function we(ze,Ge){return n(ze.getUTCHours(),Ge,2)}function Ae(ze,Ge){return n(ze.getUTCHours()%12||12,Ge,2)}function Fe(ze,Ge){return n(1+x.utcDay.count(x.utcYear(ze),ze),Ge,3)}function Ce(ze,Ge){return n(ze.getUTCMilliseconds(),Ge,3)}function qe(ze,Ge){return Ce(ze,Ge)+"000"}function et(ze,Ge){return n(ze.getUTCMonth()+1,Ge,2)}function Qe(ze,Ge){return n(ze.getUTCMinutes(),Ge,2)}function Ke(ze,Ge){return n(ze.getUTCSeconds(),Ge,2)}function Xe(ze){var Ge=ze.getUTCDay();return Ge===0?7:Ge}function Me(ze,Ge){return n(x.utcSunday.count(x.utcYear(ze)-1,ze),Ge,2)}function xe(ze,Ge){var Oe=ze.getUTCDay();return ze=Oe>=4||Oe===0?x.utcThursday(ze):x.utcThursday.ceil(ze),n(x.utcThursday.count(x.utcYear(ze),ze)+(x.utcYear(ze).getUTCDay()===4),Ge,2)}function ce(ze){return ze.getUTCDay()}function Re(ze,Ge){return n(x.utcMonday.count(x.utcYear(ze)-1,ze),Ge,2)}function $e(ze,Ge){return n(ze.getUTCFullYear()%100,Ge,2)}function rt(ze,Ge){return n(ze.getUTCFullYear()%1e4,Ge,4)}function Je(){return"+0000"}function At(){return"%"}function St(ze){return+ze}function Rt(ze){return Math.floor(+ze/1e3)}var Ut;ir({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 ir(ze){return Ut=t(ze),d.timeFormat=Ut.format,d.timeParse=Ut.parse,d.utcFormat=Ut.utcFormat,d.utcParse=Ut.utcParse,Ut}var ar="%Y-%m-%dT%H:%M:%S.%LZ";function Mr(ze){return ze.toISOString()}var fr=Date.prototype.toISOString?Mr:d.utcFormat(ar);function dr(ze){var Ge=new Date(ze);return isNaN(Ge)?null:Ge}var pt=+new Date("2000-01-01T00:00:00.000Z")?dr:d.utcParse(ar);d.isoFormat=fr,d.isoParse=pt,d.timeFormatDefaultLocale=ir,d.timeFormatLocale=t,Object.defineProperty(d,"__esModule",{value:!0})})}}),co=He({"node_modules/d3-format/dist/d3-format.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y):(d=typeof globalThis<"u"?globalThis:d||self,x(d.d3=d.d3||{}))})(Y,function(d){function x(w){return Math.abs(w=Math.round(w))>=1e21?w.toLocaleString("en").replace(/,/g,""):w.toString(10)}function A(w,p){if((u=(w=p?w.toExponential(p-1):w.toExponential()).indexOf("e"))<0)return null;var u,g=w.slice(0,u);return[g.length>1?g[0]+g.slice(2):g,+w.slice(u+1)]}function E(w){return w=A(Math.abs(w)),w?w[1]:NaN}function e(w,p){return function(u,g){for(var m=u.length,R=[],P=0,z=w[0],F=0;m>0&&z>0&&(F+z+1>g&&(z=Math.max(1,g-F)),R.push(u.substring(m-=z,m+z)),!((F+=z+1)>g));)z=w[P=(P+1)%w.length];return R.reverse().join(p)}}function t(w){return function(p){return p.replace(/[0-9]/g,function(u){return w[+u]})}}var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(w){if(!(p=r.exec(w)))throw new Error("invalid format: "+w);var p;return new a({fill:p[1],align:p[2],sign:p[3],symbol:p[4],zero:p[5],width:p[6],comma:p[7],precision:p[8]&&p[8].slice(1),trim:p[9],type:p[10]})}o.prototype=a.prototype;function a(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+""}a.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function i(w){e:for(var p=w.length,u=1,g=-1,m;u0&&(g=0);break}return g>0?w.slice(0,g)+w.slice(m+1):w}var n;function s(w,p){var u=A(w,p);if(!u)return w+"";var g=u[0],m=u[1],R=m-(n=Math.max(-8,Math.min(8,Math.floor(m/3)))*3)+1,P=g.length;return R===P?g:R>P?g+new Array(R-P+1).join("0"):R>0?g.slice(0,R)+"."+g.slice(R):"0."+new Array(1-R).join("0")+A(w,Math.max(0,p+R-1))[0]}function c(w,p){var u=A(w,p);if(!u)return w+"";var g=u[0],m=u[1];return m<0?"0."+new Array(-m).join("0")+g:g.length>m+1?g.slice(0,m+1)+"."+g.slice(m+1):g+new Array(m-g.length+2).join("0")}var f={"%":function(w,p){return(w*100).toFixed(p)},b:function(w){return Math.round(w).toString(2)},c:function(w){return w+""},d:x,e:function(w,p){return w.toExponential(p)},f:function(w,p){return w.toFixed(p)},g:function(w,p){return w.toPrecision(p)},o:function(w){return Math.round(w).toString(8)},p:function(w,p){return c(w*100,p)},r:c,s,X:function(w){return Math.round(w).toString(16).toUpperCase()},x:function(w){return Math.round(w).toString(16)}};function v(w){return w}var h=Array.prototype.map,T=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function l(w){var p=w.grouping===void 0||w.thousands===void 0?v:e(h.call(w.grouping,Number),w.thousands+""),u=w.currency===void 0?"":w.currency[0]+"",g=w.currency===void 0?"":w.currency[1]+"",m=w.decimal===void 0?".":w.decimal+"",R=w.numerals===void 0?v:t(h.call(w.numerals,String)),P=w.percent===void 0?"%":w.percent+"",z=w.minus===void 0?"-":w.minus+"",F=w.nan===void 0?"NaN":w.nan+"";function B(L){L=o(L);var N=L.fill,U=L.align,Z=L.sign,Q=L.symbol,ue=L.zero,oe=L.width,le=L.comma,j=L.precision,J=L.trim,$=L.type;$==="n"?(le=!0,$="g"):f[$]||(j===void 0&&(j=12),J=!0,$="g"),(ue||N==="0"&&U==="=")&&(ue=!0,N="0",U="=");var X=Q==="$"?u:Q==="#"&&/[boxX]/.test($)?"0"+$.toLowerCase():"",re=Q==="$"?g:/[%p]/.test($)?P:"",ee=f[$],q=/[defgprs%]/.test($);j=j===void 0?6:/[gprs]/.test($)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function ae(ie){var fe=X,we=re,Ae,Fe,Ce;if($==="c")we=ee(ie)+we,ie="";else{ie=+ie;var qe=ie<0||1/ie<0;if(ie=isNaN(ie)?F:ee(Math.abs(ie),j),J&&(ie=i(ie)),qe&&+ie==0&&Z!=="+"&&(qe=!1),fe=(qe?Z==="("?Z:z:Z==="-"||Z==="("?"":Z)+fe,we=($==="s"?T[8+n/3]:"")+we+(qe&&Z==="("?")":""),q){for(Ae=-1,Fe=ie.length;++AeCe||Ce>57){we=(Ce===46?m+ie.slice(Ae+1):ie.slice(Ae))+we,ie=ie.slice(0,Ae);break}}}le&&!ue&&(ie=p(ie,1/0));var et=fe.length+ie.length+we.length,Qe=et>1)+fe+ie+we+Qe.slice(et);break;default:ie=Qe+fe+ie+we;break}return R(ie)}return ae.toString=function(){return L+""},ae}function O(L,N){var U=B((L=o(L),L.type="f",L)),Z=Math.max(-8,Math.min(8,Math.floor(E(N)/3)))*3,Q=Math.pow(10,-Z),ue=T[8+Z/3];return function(oe){return U(Q*oe)+ue}}return{format:B,formatPrefix:O}}var y;b({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function b(w){return y=l(w),d.format=y.format,d.formatPrefix=y.formatPrefix,y}function S(w){return Math.max(0,-E(Math.abs(w)))}function M(w,p){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(E(p)/3)))*3-E(Math.abs(w)))}function _(w,p){return w=Math.abs(w),p=Math.abs(p)-w,Math.max(0,E(p)-E(w))+1}d.FormatSpecifier=a,d.formatDefaultLocale=b,d.formatLocale=l,d.formatSpecifier=o,d.precisionFixed=S,d.precisionPrefix=M,d.precisionRound=_,Object.defineProperty(d,"__esModule",{value:!0})})}}),Ac=He({"node_modules/is-string-blank/index.js"(Y,G){G.exports=function(d){for(var x=d.length,A,E=0;E13)&&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}}}),Hi=He({"node_modules/fast-isnumeric/index.js"(Y,G){var d=Ac();G.exports=function(x){var A=typeof x;if(A==="string"){var E=x;if(x=+x,x===0&&d(E))return!1}else if(A!=="number")return!1;return x-x<1}}}),lo=He({"src/constants/numerical.js"(Y,G){G.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE*1e-4,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,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:24405875e-1,ALMOST_EQUAL:1-1e-6,LOG_CLIP:10,MINUS_SIGN:"−"}}}),Uh=He({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y):(d=typeof globalThis<"u"?globalThis:d||self,x(d["base64-arraybuffer"]={}))})(Y,function(d){for(var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",A=typeof Uint8Array>"u"?[]:new Uint8Array(256),E=0;E>2],n+=x[(o[a]&3)<<4|o[a+1]>>4],n+=x[(o[a+1]&15)<<2|o[a+2]>>6],n+=x[o[a+2]&63];return i%3===2?n=n.substring(0,n.length-1)+"=":i%3===1&&(n=n.substring(0,n.length-2)+"=="),n},t=function(r){var o=r.length*.75,a=r.length,i,n=0,s,c,f,v;r[r.length-1]==="="&&(o--,r[r.length-2]==="="&&o--);var h=new ArrayBuffer(o),T=new Uint8Array(h);for(i=0;i>4,T[n++]=(c&15)<<4|f>>2,T[n++]=(f&3)<<6|v&63;return h};d.decode=t,d.encode=e,Object.defineProperty(d,"__esModule",{value:!0})})}}),Xh=He({"src/lib/is_plain_object.js"(Y,G){G.exports=function(x){return window&&window.process&&window.process.versions?Object.prototype.toString.call(x)==="[object Object]":Object.prototype.toString.call(x)==="[object Object]"&&Object.getPrototypeOf(x).hasOwnProperty("hasOwnProperty")}}}),ch=He({"src/lib/array.js"(Y){var G=Uh().decode,d=Xh(),x=Array.isArray,A=ArrayBuffer,E=DataView;function e(s){return A.isView(s)&&!(s instanceof E)}Y.isTypedArray=e;function t(s){return x(s)||e(s)}Y.isArrayOrTypedArray=t;function r(s){return!t(s[0])}Y.isArray1D=r,Y.ensureArray=function(s,c){return x(s)||(s=[]),s.length=c,s};var o={u1c:typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,i1:typeof Int8Array>"u"?void 0:Int8Array,u1:typeof Uint8Array>"u"?void 0:Uint8Array,i2:typeof Int16Array>"u"?void 0:Int16Array,u2:typeof Uint16Array>"u"?void 0:Uint16Array,i4:typeof Int32Array>"u"?void 0:Int32Array,u4:typeof Uint32Array>"u"?void 0:Uint32Array,f4:typeof Float32Array>"u"?void 0:Float32Array,f8:typeof Float64Array>"u"?void 0:Float64Array};o.uint8c=o.u1c,o.uint8=o.u1,o.int8=o.i1,o.uint16=o.u2,o.int16=o.i2,o.uint32=o.u4,o.int32=o.i4,o.float32=o.f4,o.float64=o.f8;function a(s){return s.constructor===ArrayBuffer}Y.isArrayBuffer=a,Y.decodeTypedArraySpec=function(s){var c=[],f=i(s),v=f.dtype,h=o[v];if(!h)throw new Error('Error in dtype: "'+v+'"');var T=h.BYTES_PER_ELEMENT,l=f.bdata;a(l)||(l=G(l));var y=f.shape===void 0?[l.byteLength/T]:(""+f.shape).split(",");y.reverse();var b=y.length,S,M,_=+y[0],w=T*_,p=0;if(b===1)c=new h(l);else if(b===2)for(S=+y[1],M=0;M2)return h[S]=h[S]|e,y.set(b,null);if(l){for(c=S;c0)return Math.log(A)/Math.LN10;var e=Math.log(Math.min(E[0],E[1]))/Math.LN10;return d(e)||(e=Math.log(Math.max(E[0],E[1]))/Math.LN10-6),e}}}),rS=He({"src/lib/relink_private.js"(Y,G){var d=ch().isArrayOrTypedArray,x=Xh();G.exports=function A(E,e){for(var t in e){var r=e[t],o=E[t];if(o!==r)if(t.charAt(0)==="_"||typeof r=="function"){if(t in E)continue;E[t]=r}else if(d(r)&&d(o)&&x(r[0])){if(t==="customdata"||t==="ids")continue;for(var a=Math.min(r.length,o.length),i=0;iE/2?A-Math.round(A/E)*E:A}G.exports={mod:d,modHalf:x}}}),Mf=He({"node_modules/tinycolor2/tinycolor.js"(Y,G){(function(d){var x=/^\s+/,A=/\s+$/,E=0,e=d.round,t=d.min,r=d.max,o=d.random;function a(q,ae){if(q=q||"",ae=ae||{},q instanceof a)return q;if(!(this instanceof a))return new a(q,ae);var ie=i(q);this._originalInput=q,this._r=ie.r,this._g=ie.g,this._b=ie.b,this._a=ie.a,this._roundA=e(100*this._a)/100,this._format=ae.format||ie.format,this._gradientType=ae.gradientType,this._r<1&&(this._r=e(this._r)),this._g<1&&(this._g=e(this._g)),this._b<1&&(this._b=e(this._b)),this._ok=ie.ok,this._tc_id=E++}a.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 q=this.toRgb();return(q.r*299+q.g*587+q.b*114)/1e3},getLuminance:function(){var q=this.toRgb(),ae,ie,fe,we,Ae,Fe;return ae=q.r/255,ie=q.g/255,fe=q.b/255,ae<=.03928?we=ae/12.92:we=d.pow((ae+.055)/1.055,2.4),ie<=.03928?Ae=ie/12.92:Ae=d.pow((ie+.055)/1.055,2.4),fe<=.03928?Fe=fe/12.92:Fe=d.pow((fe+.055)/1.055,2.4),.2126*we+.7152*Ae+.0722*Fe},setAlpha:function(q){return this._a=L(q),this._roundA=e(100*this._a)/100,this},toHsv:function(){var q=f(this._r,this._g,this._b);return{h:q.h*360,s:q.s,v:q.v,a:this._a}},toHsvString:function(){var q=f(this._r,this._g,this._b),ae=e(q.h*360),ie=e(q.s*100),fe=e(q.v*100);return this._a==1?"hsv("+ae+", "+ie+"%, "+fe+"%)":"hsva("+ae+", "+ie+"%, "+fe+"%, "+this._roundA+")"},toHsl:function(){var q=s(this._r,this._g,this._b);return{h:q.h*360,s:q.s,l:q.l,a:this._a}},toHslString:function(){var q=s(this._r,this._g,this._b),ae=e(q.h*360),ie=e(q.s*100),fe=e(q.l*100);return this._a==1?"hsl("+ae+", "+ie+"%, "+fe+"%)":"hsla("+ae+", "+ie+"%, "+fe+"%, "+this._roundA+")"},toHex:function(q){return h(this._r,this._g,this._b,q)},toHexString:function(q){return"#"+this.toHex(q)},toHex8:function(q){return T(this._r,this._g,this._b,this._a,q)},toHex8String:function(q){return"#"+this.toHex8(q)},toRgb:function(){return{r:e(this._r),g:e(this._g),b:e(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+e(this._r)+", "+e(this._g)+", "+e(this._b)+")":"rgba("+e(this._r)+", "+e(this._g)+", "+e(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:e(N(this._r,255)*100)+"%",g:e(N(this._g,255)*100)+"%",b:e(N(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+e(N(this._r,255)*100)+"%, "+e(N(this._g,255)*100)+"%, "+e(N(this._b,255)*100)+"%)":"rgba("+e(N(this._r,255)*100)+"%, "+e(N(this._g,255)*100)+"%, "+e(N(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:B[h(this._r,this._g,this._b,!0)]||!1},toFilter:function(q){var ae="#"+l(this._r,this._g,this._b,this._a),ie=ae,fe=this._gradientType?"GradientType = 1, ":"";if(q){var we=a(q);ie="#"+l(we._r,we._g,we._b,we._a)}return"progid:DXImageTransform.Microsoft.gradient("+fe+"startColorstr="+ae+",endColorstr="+ie+")"},toString:function(q){var ae=!!q;q=q||this._format;var ie=!1,fe=this._a<1&&this._a>=0,we=!ae&&fe&&(q==="hex"||q==="hex6"||q==="hex3"||q==="hex4"||q==="hex8"||q==="name");return we?q==="name"&&this._a===0?this.toName():this.toRgbString():(q==="rgb"&&(ie=this.toRgbString()),q==="prgb"&&(ie=this.toPercentageRgbString()),(q==="hex"||q==="hex6")&&(ie=this.toHexString()),q==="hex3"&&(ie=this.toHexString(!0)),q==="hex4"&&(ie=this.toHex8String(!0)),q==="hex8"&&(ie=this.toHex8String()),q==="name"&&(ie=this.toName()),q==="hsl"&&(ie=this.toHslString()),q==="hsv"&&(ie=this.toHsvString()),ie||this.toHexString())},clone:function(){return a(this.toString())},_applyModification:function(q,ae){var ie=q.apply(null,[this].concat([].slice.call(ae)));return this._r=ie._r,this._g=ie._g,this._b=ie._b,this.setAlpha(ie._a),this},lighten:function(){return this._applyModification(M,arguments)},brighten:function(){return this._applyModification(_,arguments)},darken:function(){return this._applyModification(w,arguments)},desaturate:function(){return this._applyModification(y,arguments)},saturate:function(){return this._applyModification(b,arguments)},greyscale:function(){return this._applyModification(S,arguments)},spin:function(){return this._applyModification(p,arguments)},_applyCombination:function(q,ae){return q.apply(null,[this].concat([].slice.call(ae)))},analogous:function(){return this._applyCombination(P,arguments)},complement:function(){return this._applyCombination(u,arguments)},monochromatic:function(){return this._applyCombination(z,arguments)},splitcomplement:function(){return this._applyCombination(R,arguments)},triad:function(){return this._applyCombination(g,arguments)},tetrad:function(){return this._applyCombination(m,arguments)}},a.fromRatio=function(q,ae){if(typeof q=="object"){var ie={};for(var fe in q)q.hasOwnProperty(fe)&&(fe==="a"?ie[fe]=q[fe]:ie[fe]=le(q[fe]));q=ie}return a(q,ae)};function i(q){var ae={r:0,g:0,b:0},ie=1,fe=null,we=null,Ae=null,Fe=!1,Ce=!1;return typeof q=="string"&&(q=re(q)),typeof q=="object"&&(X(q.r)&&X(q.g)&&X(q.b)?(ae=n(q.r,q.g,q.b),Fe=!0,Ce=String(q.r).substr(-1)==="%"?"prgb":"rgb"):X(q.h)&&X(q.s)&&X(q.v)?(fe=le(q.s),we=le(q.v),ae=v(q.h,fe,we),Fe=!0,Ce="hsv"):X(q.h)&&X(q.s)&&X(q.l)&&(fe=le(q.s),Ae=le(q.l),ae=c(q.h,fe,Ae),Fe=!0,Ce="hsl"),q.hasOwnProperty("a")&&(ie=q.a)),ie=L(ie),{ok:Fe,format:q.format||Ce,r:t(255,r(ae.r,0)),g:t(255,r(ae.g,0)),b:t(255,r(ae.b,0)),a:ie}}function n(q,ae,ie){return{r:N(q,255)*255,g:N(ae,255)*255,b:N(ie,255)*255}}function s(q,ae,ie){q=N(q,255),ae=N(ae,255),ie=N(ie,255);var fe=r(q,ae,ie),we=t(q,ae,ie),Ae,Fe,Ce=(fe+we)/2;if(fe==we)Ae=Fe=0;else{var qe=fe-we;switch(Fe=Ce>.5?qe/(2-fe-we):qe/(fe+we),fe){case q:Ae=(ae-ie)/qe+(ae1&&(Ke-=1),Ke<1/6?et+(Qe-et)*6*Ke:Ke<1/2?Qe:Ke<2/3?et+(Qe-et)*(2/3-Ke)*6:et}if(ae===0)fe=we=Ae=ie;else{var Ce=ie<.5?ie*(1+ae):ie+ae-ie*ae,qe=2*ie-Ce;fe=Fe(qe,Ce,q+1/3),we=Fe(qe,Ce,q),Ae=Fe(qe,Ce,q-1/3)}return{r:fe*255,g:we*255,b:Ae*255}}function f(q,ae,ie){q=N(q,255),ae=N(ae,255),ie=N(ie,255);var fe=r(q,ae,ie),we=t(q,ae,ie),Ae,Fe,Ce=fe,qe=fe-we;if(Fe=fe===0?0:qe/fe,fe==we)Ae=0;else{switch(fe){case q:Ae=(ae-ie)/qe+(ae>1)+720)%360;--ae;)fe.h=(fe.h+we)%360,Ae.push(a(fe));return Ae}function z(q,ae){ae=ae||6;for(var ie=a(q).toHsv(),fe=ie.h,we=ie.s,Ae=ie.v,Fe=[],Ce=1/ae;ae--;)Fe.push(a({h:fe,s:we,v:Ae})),Ae=(Ae+Ce)%1;return Fe}a.mix=function(q,ae,ie){ie=ie===0?0:ie||50;var fe=a(q).toRgb(),we=a(ae).toRgb(),Ae=ie/100,Fe={r:(we.r-fe.r)*Ae+fe.r,g:(we.g-fe.g)*Ae+fe.g,b:(we.b-fe.b)*Ae+fe.b,a:(we.a-fe.a)*Ae+fe.a};return a(Fe)},a.readability=function(q,ae){var ie=a(q),fe=a(ae);return(d.max(ie.getLuminance(),fe.getLuminance())+.05)/(d.min(ie.getLuminance(),fe.getLuminance())+.05)},a.isReadable=function(q,ae,ie){var fe=a.readability(q,ae),we,Ae;switch(Ae=!1,we=ee(ie),we.level+we.size){case"AAsmall":case"AAAlarge":Ae=fe>=4.5;break;case"AAlarge":Ae=fe>=3;break;case"AAAsmall":Ae=fe>=7;break}return Ae},a.mostReadable=function(q,ae,ie){var fe=null,we=0,Ae,Fe,Ce,qe;ie=ie||{},Fe=ie.includeFallbackColors,Ce=ie.level,qe=ie.size;for(var et=0;etwe&&(we=Ae,fe=a(ae[et]));return a.isReadable(q,fe,{level:Ce,size:qe})||!Fe?fe:(ie.includeFallbackColors=!1,a.mostReadable(q,["#fff","#000"],ie))};var F=a.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"},B=a.hexNames=O(F);function O(q){var ae={};for(var ie in q)q.hasOwnProperty(ie)&&(ae[q[ie]]=ie);return ae}function L(q){return q=parseFloat(q),(isNaN(q)||q<0||q>1)&&(q=1),q}function N(q,ae){Q(q)&&(q="100%");var ie=ue(q);return q=t(ae,r(0,parseFloat(q))),ie&&(q=parseInt(q*ae,10)/100),d.abs(q-ae)<1e-6?1:q%ae/parseFloat(ae)}function U(q){return t(1,r(0,q))}function Z(q){return parseInt(q,16)}function Q(q){return typeof q=="string"&&q.indexOf(".")!=-1&&parseFloat(q)===1}function ue(q){return typeof q=="string"&&q.indexOf("%")!=-1}function oe(q){return q.length==1?"0"+q:""+q}function le(q){return q<=1&&(q=q*100+"%"),q}function j(q){return d.round(parseFloat(q)*255).toString(16)}function J(q){return Z(q)/255}var $=function(){var q="[-\\+]?\\d+%?",ae="[-\\+]?\\d*\\.\\d+%?",ie="(?:"+ae+")|(?:"+q+")",fe="[\\s|\\(]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")\\s*\\)?",we="[\\s|\\(]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")[,|\\s]+("+ie+")\\s*\\)?";return{CSS_UNIT:new RegExp(ie),rgb:new RegExp("rgb"+fe),rgba:new RegExp("rgba"+we),hsl:new RegExp("hsl"+fe),hsla:new RegExp("hsla"+we),hsv:new RegExp("hsv"+fe),hsva:new RegExp("hsva"+we),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 X(q){return!!$.CSS_UNIT.exec(q)}function re(q){q=q.replace(x,"").replace(A,"").toLowerCase();var ae=!1;if(F[q])q=F[q],ae=!0;else if(q=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ie;return(ie=$.rgb.exec(q))?{r:ie[1],g:ie[2],b:ie[3]}:(ie=$.rgba.exec(q))?{r:ie[1],g:ie[2],b:ie[3],a:ie[4]}:(ie=$.hsl.exec(q))?{h:ie[1],s:ie[2],l:ie[3]}:(ie=$.hsla.exec(q))?{h:ie[1],s:ie[2],l:ie[3],a:ie[4]}:(ie=$.hsv.exec(q))?{h:ie[1],s:ie[2],v:ie[3]}:(ie=$.hsva.exec(q))?{h:ie[1],s:ie[2],v:ie[3],a:ie[4]}:(ie=$.hex8.exec(q))?{r:Z(ie[1]),g:Z(ie[2]),b:Z(ie[3]),a:J(ie[4]),format:ae?"name":"hex8"}:(ie=$.hex6.exec(q))?{r:Z(ie[1]),g:Z(ie[2]),b:Z(ie[3]),format:ae?"name":"hex"}:(ie=$.hex4.exec(q))?{r:Z(ie[1]+""+ie[1]),g:Z(ie[2]+""+ie[2]),b:Z(ie[3]+""+ie[3]),a:J(ie[4]+""+ie[4]),format:ae?"name":"hex8"}:(ie=$.hex3.exec(q))?{r:Z(ie[1]+""+ie[1]),g:Z(ie[2]+""+ie[2]),b:Z(ie[3]+""+ie[3]),format:ae?"name":"hex"}:!1}function ee(q){var ae,ie;return q=q||{level:"AA",size:"small"},ae=(q.level||"AA").toUpperCase(),ie=(q.size||"small").toLowerCase(),ae!=="AA"&&ae!=="AAA"&&(ae="AA"),ie!=="small"&&ie!=="large"&&(ie="small"),{level:ae,size:ie}}typeof G<"u"&&G.exports?G.exports=a:window.tinycolor=a})(Math)}}),ho=He({"src/lib/extend.js"(Y){var G=Xh(),d=Array.isArray;function x(E,e){var t,r;for(t=0;t=0)))return a;if(f===3)s[f]>1&&(s[f]=1);else if(s[f]>=1)return a}var v=Math.round(s[0]*255)+", "+Math.round(s[1]*255)+", "+Math.round(s[2]*255);return c?"rgba("+v+", "+s[3]+")":"rgb("+v+")"}}}),Bd=He({"src/constants/interactions.js"(Y,G){G.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}}),R0=He({"src/lib/regex.js"(Y){Y.counter=function(G,d,x,A){var E=(d||"")+(x?"":"$"),e=A===!1?"":"^";return G==="xy"?new RegExp(e+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+E):new RegExp(e+G+"([2-9]|[1-9][0-9]+)?"+E)}}}),aS=He({"src/lib/coerce.js"(Y){var G=Hi(),d=Mf(),x=ho().extendFlat,A=cl(),E=Ap(),e=Ai(),t=Bd().DESELECTDIM,r=Hg(),o=R0().counter,a=P0().modHalf,i=ch().isArrayOrTypedArray,n=ch().isTypedArraySpec,s=ch().decodeTypedArraySpec;Y.valObjectMeta={data_array:{coerceFunction:function(f,v,h){v.set(i(f)?f:n(f)?s(f):h)}},enumerated:{coerceFunction:function(f,v,h,T){T.coerceNumber&&(f=+f),T.values.indexOf(f)===-1?v.set(h):v.set(f)},validateFunction:function(f,v){v.coerceNumber&&(f=+f);for(var h=v.values,T=0;TT.max?v.set(h):v.set(+f)}},integer:{coerceFunction:function(f,v,h,T){if((T.extras||[]).indexOf(f)!==-1){v.set(f);return}n(f)&&(f=s(f)),f%1||!G(f)||T.min!==void 0&&fT.max?v.set(h):v.set(+f)}},string:{coerceFunction:function(f,v,h,T){if(typeof f!="string"){var l=typeof f=="number";T.strict===!0||!l?v.set(h):v.set(String(f))}else T.noBlank&&!f?v.set(h):v.set(f)}},color:{coerceFunction:function(f,v,h){n(f)&&(f=s(f)),d(f).isValid()?v.set(f):v.set(h)}},colorlist:{coerceFunction:function(f,v,h){function T(l){return d(l).isValid()}!Array.isArray(f)||!f.length?v.set(h):f.every(T)?v.set(f):v.set(h)}},colorscale:{coerceFunction:function(f,v,h){v.set(E.get(f,h))}},angle:{coerceFunction:function(f,v,h){n(f)&&(f=s(f)),f==="auto"?v.set("auto"):G(f)?v.set(a(+f,360)):v.set(h)}},subplotid:{coerceFunction:function(f,v,h,T){var l=T.regex||o(h);if(typeof f=="string"&&l.test(f)){v.set(f);return}v.set(h)},validateFunction:function(f,v){var h=v.dflt;return f===h?!0:typeof f!="string"?!1:!!o(h).test(f)}},flaglist:{coerceFunction:function(f,v,h,T){if((T.extras||[]).indexOf(f)!==-1){v.set(f);return}if(typeof f!="string"){v.set(h);return}for(var l=f.split("+"),y=0;y/g),f=0;f1){var e=["LOG:"];for(E=0;E1){var t=[];for(E=0;E"),"long")}},A.warn=function(){var E;if(d.logging>0){var e=["WARN:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}},A.error=function(){var E;if(d.logging>0){var e=["ERROR:"];for(E=0;E0){var t=[];for(E=0;E"),"stick")}}}}),Ym=He({"src/lib/noop.js"(Y,G){G.exports=function(){}}}),fb=He({"src/lib/push_unique.js"(Y,G){G.exports=function(x,A){if(A instanceof RegExp){for(var E=A.toString(),e=0;e0){for(var e=[],t=0;t=l&&F<=y?F:e}if(typeof F!="string"&&typeof F!="number")return e;F=String(F);var U=h(B),Z=F.charAt(0);U&&(Z==="G"||Z==="g")&&(F=F.substr(1),B="");var Q=U&&B.substr(0,7)==="chinese",ue=F.match(Q?f:c);if(!ue)return e;var oe=ue[1],le=ue[3]||"1",j=Number(ue[5]||1),J=Number(ue[7]||0),$=Number(ue[9]||0),X=Number(ue[11]||0);if(U){if(oe.length===2)return e;oe=Number(oe);var re;try{var ee=n.getComponentMethod("calendars","getCal")(B);if(Q){var q=le.charAt(le.length-1)==="i";le=parseInt(le,10),re=ee.newDate(oe,ee.toMonthIndex(oe,le,q),j)}else re=ee.newDate(oe,Number(le),j)}catch{return e}return re?(re.toJD()-i)*t+J*r+$*o+X*a:e}oe.length===2?oe=(Number(oe)+2e3-v)%100+v:oe=Number(oe),le-=1;var ae=new Date(Date.UTC(2e3,le,j,J,$));return ae.setUTCFullYear(oe),ae.getUTCMonth()!==le||ae.getUTCDate()!==j?e:ae.getTime()+X*a},l=Y.MIN_MS=Y.dateTime2ms("-9999"),y=Y.MAX_MS=Y.dateTime2ms("9999-12-31 23:59:59.9999"),Y.isDateTime=function(F,B){return Y.dateTime2ms(F,B)!==e};function b(F,B){return String(F+Math.pow(10,B)).substr(1)}var S=90*t,M=3*r,_=5*o;Y.ms2DateTime=function(F,B,O){if(typeof F!="number"||!(F>=l&&F<=y))return e;B||(B=0);var L=Math.floor(A(F+.05,1)*10),N=Math.round(F-L/10),U,Z,Q,ue,oe,le;if(h(O)){var j=Math.floor(N/t)+i,J=Math.floor(A(F,t));try{U=n.getComponentMethod("calendars","getCal")(O).fromJD(j).formatDate("yyyy-mm-dd")}catch{U=s("G%Y-%m-%d")(new Date(N))}if(U.charAt(0)==="-")for(;U.length<11;)U="-0"+U.substr(1);else for(;U.length<10;)U="0"+U;Z=B=l+t&&F<=y-t))return e;var B=Math.floor(A(F+.05,1)*10),O=new Date(Math.round(F-B/10)),L=G("%Y-%m-%d")(O),N=O.getHours(),U=O.getMinutes(),Z=O.getSeconds(),Q=O.getUTCMilliseconds()*10+B;return w(L,N,U,Z,Q)};function w(F,B,O,L,N){if((B||O||L||N)&&(F+=" "+b(B,2)+":"+b(O,2),(L||N)&&(F+=":"+b(L,2),N))){for(var U=4;N%10===0;)U-=1,N/=10;F+="."+b(N,U)}return F}Y.cleanDate=function(F,B,O){if(F===e)return B;if(Y.isJSDate(F)||typeof F=="number"&&isFinite(F)){if(h(O))return x.error("JS Dates and milliseconds are incompatible with world calendars",F),B;if(F=Y.ms2DateTimeLocal(+F),!F&&B!==void 0)return B}else if(!Y.isDateTime(F,O))return x.error("unrecognized date",F),B;return F};var p=/%\d?f/g,u=/%h/g,g={1:"1",2:"1",3:"2",4:"2"};function m(F,B,O,L){F=F.replace(p,function(U){var Z=Math.min(+U.charAt(1)||6,6),Q=(B/1e3%1+2).toFixed(Z).substr(2).replace(/0+$/,"")||"0";return Q});var N=new Date(Math.floor(B+.05));if(F=F.replace(u,function(){return g[O("%q")(N)]}),h(L))try{F=n.getComponentMethod("calendars","worldCalFmt")(F,B,L)}catch{return"Invalid"}return O(F)(N)}var R=[59,59.9,59.99,59.999,59.9999];function P(F,B){var O=A(F+.05,t),L=b(Math.floor(O/r),2)+":"+b(A(Math.floor(O/o),60),2);if(B!=="M"){d(B)||(B=0);var N=Math.min(A(F/a,60),R[B]),U=(100+N).toFixed(B).substr(1);B>0&&(U=U.replace(/0+$/,"").replace(/[\.]$/,"")),L+=":"+U}return L}Y.formatDate=function(F,B,O,L,N,U){if(N=h(N)&&N,!B)if(O==="y")B=U.year;else if(O==="m")B=U.month;else if(O==="d")B=U.dayMonth+` +`+U.year;else return P(F,O)+` +`+m(U.dayMonthYear,F,L,N);return m(B,F,L,N)};var z=3*t;Y.incrementMonth=function(F,B,O){O=h(O)&&O;var L=A(F,t);if(F=Math.round(F-L),O)try{var N=Math.round(F/t)+i,U=n.getComponentMethod("calendars","getCal")(O),Z=U.fromJD(N);return B%12?U.add(Z,B,"m"):U.add(Z,B/12,"y"),(Z.toJD()-i)*t+L}catch{x.error("invalid ms "+F+" in calendar "+O)}var Q=new Date(F+z);return Q.setUTCMonth(Q.getUTCMonth()+B)+L-z},Y.findExactDates=function(F,B){for(var O=0,L=0,N=0,U=0,Z,Q,ue=h(B)&&n.getComponentMethod("calendars","getCal")(B),oe=0;oe1?(i[c-1]-i[0])/(c-1):1,h,T;for(v>=0?T=n?e:t:T=n?o:r,a+=v*E*(n?-1:1)*(v>=0?1:-1);s90&&d.log("Long binary search..."),s-1};function e(a,i){return ai}function o(a,i){return a>=i}Y.sorterAsc=function(a,i){return a-i},Y.sorterDes=function(a,i){return i-a},Y.distinctVals=function(a){var i=a.slice();i.sort(Y.sorterAsc);var n;for(n=i.length-1;n>-1&&i[n]===A;n--);for(var s=i[n]-i[0]||1,c=s/(n||1)/1e4,f=[],v,h=0;h<=n;h++){var T=i[h],l=T-v;v===void 0?(f.push(T),v=T):l>c&&(s=Math.min(s,l),f.push(T),v=T)}return{vals:f,minDiff:s}},Y.roundUp=function(a,i,n){for(var s=0,c=i.length-1,f,v=0,h=n?0:1,T=n?1:0,l=n?Math.ceil:Math.floor;s0&&(s=1),n&&s)return a.sort(i)}return s?a:a.reverse()},Y.findIndexOfMin=function(a,i){i=i||x;for(var n=1/0,s,c=0;cE.length)&&(e=E.length),G(A)||(A=!1),d(E[0])){for(r=new Array(e),t=0;tx.length-1)return x[x.length-1];var E=A%1;return E*x[Math.ceil(A)]+(1-E)*x[Math.floor(A)]}}}),OS=He({"src/lib/angles.js"(Y,G){var d=P0(),x=d.mod,A=d.modHalf,E=Math.PI,e=2*E;function t(T){return T/180*E}function r(T){return T/E*180}function o(T){return Math.abs(T[1]-T[0])>e-1e-14}function a(T,l){return A(l-T,e)}function i(T,l){return Math.abs(a(T,l))}function n(T,l){if(o(l))return!0;var y,b;l[0]b&&(b+=e);var S=x(T,e),M=S+e;return S>=y&&S<=b||M>=y&&M<=b}function s(T,l,y,b){if(!n(l,b))return!1;var S,M;return y[0]=S&&T<=M}function c(T,l,y,b,S,M,_){S=S||0,M=M||0;var w=o([y,b]),p,u,g,m,R;w?(p=0,u=E,g=e):y1/3&&d.x<2/3},Y.isRightAnchor=function(d){return d.xanchor==="right"||d.xanchor==="auto"&&d.x>=2/3},Y.isTopAnchor=function(d){return d.yanchor==="top"||d.yanchor==="auto"&&d.y>=2/3},Y.isMiddleAnchor=function(d){return d.yanchor==="middle"||d.yanchor==="auto"&&d.y>1/3&&d.y<2/3},Y.isBottomAnchor=function(d){return d.yanchor==="bottom"||d.yanchor==="auto"&&d.y<=1/3}}}),NS=He({"src/lib/geometry2d.js"(Y){var G=P0().mod;Y.segmentsIntersect=d;function d(t,r,o,a,i,n,s,c){var f=o-t,v=i-t,h=s-i,T=a-r,l=n-r,y=c-n,b=f*y-h*T;if(b===0)return null;var S=(v*y-h*l)/b,M=(v*T-f*l)/b;return M<0||M>1||S<0||S>1?null:{x:t+f*S,y:r+T*S}}Y.segmentDistance=function(r,o,a,i,n,s,c,f){if(d(r,o,a,i,n,s,c,f))return 0;var v=a-r,h=i-o,T=c-n,l=f-s,y=v*v+h*h,b=T*T+l*l,S=Math.min(x(v,h,y,n-r,s-o),x(v,h,y,c-r,f-o),x(T,l,b,r-n,o-s),x(T,l,b,a-n,i-s));return Math.sqrt(S)};function x(t,r,o,a,i){var n=a*t+i*r;if(n<0)return a*a+i*i;if(n>o){var s=a-t,c=i-r;return s*s+c*c}else{var f=a*r-i*t;return f*f/o}}var A,E,e;Y.getTextLocation=function(r,o,a,i){if((r!==E||i!==e)&&(A={},E=r,e=i),A[a])return A[a];var n=r.getPointAtLength(G(a-i/2,o)),s=r.getPointAtLength(G(a+i/2,o)),c=Math.atan((s.y-n.y)/(s.x-n.x)),f=r.getPointAtLength(G(a,o)),v=(f.x*4+n.x+s.x)/6,h=(f.y*4+n.y+s.y)/6,T={x:v,y:h,theta:c};return A[a]=T,T},Y.clearLocationCache=function(){E=null},Y.getVisibleSegment=function(r,o,a){var i=o.left,n=o.right,s=o.top,c=o.bottom,f=0,v=r.getTotalLength(),h=v,T,l;function y(S){var M=r.getPointAtLength(S);S===0?T=M:S===v&&(l=M);var _=M.xn?M.x-n:0,w=M.yc?M.y-c:0;return Math.sqrt(_*_+w*w)}for(var b=y(f);b;){if(f+=b+a,f>h)return;b=y(f)}for(b=y(h);b;){if(h-=b+a,f>h)return;b=y(h)}return{min:f,max:h,len:h-f,total:v,isClosed:f===0&&h===v&&Math.abs(T.x-l.x)<.1&&Math.abs(T.y-l.y)<.1}},Y.findPointOnPath=function(r,o,a,i){i=i||{};for(var n=i.pathLength||r.getTotalLength(),s=i.tolerance||.001,c=i.iterationLimit||30,f=r.getPointAtLength(0)[a]>r.getPointAtLength(n)[a]?-1:1,v=0,h=0,T=n,l,y,b;v0?T=l:h=l,v++}return y}}}),e1=He({"src/lib/throttle.js"(Y){var G={};Y.throttle=function(A,E,e){var t=G[A],r=Date.now();if(!t){for(var o in G)G[o].tst.ts+E){a();return}t.timer=setTimeout(function(){a(),t.timer=null},E)},Y.done=function(x){var A=G[x];return!A||!A.timer?Promise.resolve():new Promise(function(E){var e=A.onDone;A.onDone=function(){e&&e(),E(),A.onDone=null}})},Y.clear=function(x){if(x)d(G[x]),delete G[x];else for(var A in G)Y.clear(A)};function d(x){x&&x.timer!==null&&(clearTimeout(x.timer),x.timer=null)}}}),US=He({"src/lib/clear_responsive.js"(Y,G){G.exports=function(x){x._responsiveChartHandler&&(window.removeEventListener("resize",x._responsiveChartHandler),delete x._responsiveChartHandler)}}}),jS=He({"node_modules/is-mobile/index.js"(Y,G){G.exports=E,G.exports.isMobile=E,G.exports.default=E;var d=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,x=/CrOS/,A=/android|ipad|playbook|silk/i;function E(e){e||(e={});let t=e.ua;if(!t&&typeof navigator<"u"&&(t=navigator.userAgent),t&&t.headers&&typeof t.headers["user-agent"]=="string"&&(t=t.headers["user-agent"]),typeof t!="string")return!1;let r=d.test(t)&&!x.test(t)||!!e.tablet&&A.test(t);return!r&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&t.indexOf("Macintosh")!==-1&&t.indexOf("Safari")!==-1&&(r=!0),r}}}),VS=He({"src/lib/preserve_drawing_buffer.js"(Y,G){var d=Hi(),x=jS();G.exports=function(e){var t;if(e&&e.hasOwnProperty("userAgent")?t=e.userAgent:t=A(),typeof t!="string")return!0;var r=x({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!r)for(var o=t.split(" "),a=1;a-1;n--){var s=o[n];if(s.substr(0,8)==="Version/"){var c=s.substr(8).split(".")[0];if(d(c)&&(c=+c),c>=13)return!0}}}return r};function A(){var E;return typeof navigator<"u"&&(E=navigator.userAgent),E&&E.headers&&typeof E.headers["user-agent"]=="string"&&(E=E.headers["user-agent"]),E}}}),qS=He({"src/lib/make_trace_groups.js"(Y,G){var d=Qn();G.exports=function(A,E,e){var t=A.selectAll("g."+e.replace(/\s/g,".")).data(E,function(o){return o[0].trace.uid});t.exit().remove(),t.enter().append("g").attr("class",e),t.order();var r=A.classed("rangeplot")?"nodeRangePlot3":"node3";return t.each(function(o){o[0][r]=d.select(this)}),t}}}),HS=He({"src/lib/localize.js"(Y,G){var d=Ei();G.exports=function(A,E){for(var e=A._context.locale,t=0;t<2;t++){for(var r=A._context.locales,o=0;o<2;o++){var a=(r[e]||{}).dictionary;if(a){var i=a[E];if(i)return i}r=d.localeRegistry}var n=e.split("-")[0];if(n===e)break;e=n}return E}}}),gb=He({"src/lib/filter_unique.js"(Y,G){G.exports=function(x){for(var A={},E=[],e=0,t=0;t1?(E*x+E*A)/E:x+A,t=String(e).length;if(t>16){var r=String(A).length,o=String(x).length;if(t>=o+r){var a=parseFloat(e).toPrecision(12);a.indexOf("e+")===-1&&(e=+a)}}return e}}}),ZS=He({"src/lib/clean_number.js"(Y,G){var d=Hi(),x=lo().BADNUM,A=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;G.exports=function(e){return typeof e=="string"&&(e=e.replace(A,"")),d(e)?Number(e):x}}}),Gr=He({"src/lib/index.js"(Y,G){var d=Qn(),x=Xl().utcFormat,A=co().format,E=Hi(),e=lo(),t=e.FP_SAFE,r=-t,o=e.BADNUM,a=G.exports={};a.adjustFormat=function(ee){return!ee||/^\d[.]\df/.test(ee)||/[.]\d%/.test(ee)?ee:ee==="0.f"?"~f":/^\d%/.test(ee)?"~%":/^\ds/.test(ee)?"~s":!/^[~,.0$]/.test(ee)&&/[&fps]/.test(ee)?"~"+ee:ee};var i={};a.warnBadFormat=function(re){var ee=String(re);i[ee]||(i[ee]=1,a.warn('encountered bad format: "'+ee+'"'))},a.noFormat=function(re){return String(re)},a.numberFormat=function(re){var ee;try{ee=A(a.adjustFormat(re))}catch{return a.warnBadFormat(re),a.noFormat}return ee},a.nestedProperty=Hg(),a.keyedContainer=eS(),a.relativeAttr=tS(),a.isPlainObject=Xh(),a.toLogRange=Xm(),a.relinkPrivateKeys=rS();var n=ch();a.isArrayBuffer=n.isArrayBuffer,a.isTypedArray=n.isTypedArray,a.isArrayOrTypedArray=n.isArrayOrTypedArray,a.isArray1D=n.isArray1D,a.ensureArray=n.ensureArray,a.concat=n.concat,a.maxRowLength=n.maxRowLength,a.minRowLength=n.minRowLength;var s=P0();a.mod=s.mod,a.modHalf=s.modHalf;var c=aS();a.valObjectMeta=c.valObjectMeta,a.coerce=c.coerce,a.coerce2=c.coerce2,a.coerceFont=c.coerceFont,a.coercePattern=c.coercePattern,a.coerceHoverinfo=c.coerceHoverinfo,a.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,a.validate=c.validate;var f=zS();a.dateTime2ms=f.dateTime2ms,a.isDateTime=f.isDateTime,a.ms2DateTime=f.ms2DateTime,a.ms2DateTimeLocal=f.ms2DateTimeLocal,a.cleanDate=f.cleanDate,a.isJSDate=f.isJSDate,a.formatDate=f.formatDate,a.incrementMonth=f.incrementMonth,a.dateTick0=f.dateTick0,a.dfltRange=f.dfltRange,a.findExactDates=f.findExactDates,a.MIN_MS=f.MIN_MS,a.MAX_MS=f.MAX_MS;var v=Qm();a.findBin=v.findBin,a.sorterAsc=v.sorterAsc,a.sorterDes=v.sorterDes,a.distinctVals=v.distinctVals,a.roundUp=v.roundUp,a.sort=v.sort,a.findIndexOfMin=v.findIndexOfMin,a.sortObjectKeys=Ud();var h=FS();a.aggNums=h.aggNums,a.len=h.len,a.mean=h.mean,a.geometricMean=h.geometricMean,a.median=h.median,a.midRange=h.midRange,a.variance=h.variance,a.stdev=h.stdev,a.interp=h.interp;var T=Km();a.init2dArray=T.init2dArray,a.transposeRagged=T.transposeRagged,a.dot=T.dot,a.translationMatrix=T.translationMatrix,a.rotationMatrix=T.rotationMatrix,a.rotationXYMatrix=T.rotationXYMatrix,a.apply3DTransform=T.apply3DTransform,a.apply2DTransform=T.apply2DTransform,a.apply2DTransform2=T.apply2DTransform2,a.convertCssMatrix=T.convertCssMatrix,a.inverseTransformMatrix=T.inverseTransformMatrix;var l=OS();a.deg2rad=l.deg2rad,a.rad2deg=l.rad2deg,a.angleDelta=l.angleDelta,a.angleDist=l.angleDist,a.isFullCircle=l.isFullCircle,a.isAngleInsideSector=l.isAngleInsideSector,a.isPtInsideSector=l.isPtInsideSector,a.pathArc=l.pathArc,a.pathSector=l.pathSector,a.pathAnnulus=l.pathAnnulus;var y=BS();a.isLeftAnchor=y.isLeftAnchor,a.isCenterAnchor=y.isCenterAnchor,a.isRightAnchor=y.isRightAnchor,a.isTopAnchor=y.isTopAnchor,a.isMiddleAnchor=y.isMiddleAnchor,a.isBottomAnchor=y.isBottomAnchor;var b=NS();a.segmentsIntersect=b.segmentsIntersect,a.segmentDistance=b.segmentDistance,a.getTextLocation=b.getTextLocation,a.clearLocationCache=b.clearLocationCache,a.getVisibleSegment=b.getVisibleSegment,a.findPointOnPath=b.findPointOnPath;var S=ho();a.extendFlat=S.extendFlat,a.extendDeep=S.extendDeep,a.extendDeepAll=S.extendDeepAll,a.extendDeepNoArrays=S.extendDeepNoArrays;var M=Nd();a.log=M.log,a.warn=M.warn,a.error=M.error;var _=R0();a.counterRegex=_.counter;var w=e1();a.throttle=w.throttle,a.throttleDone=w.done,a.clearThrottle=w.clear;var p=Wg();a.getGraphDiv=p.getGraphDiv,a.isPlotDiv=p.isPlotDiv,a.removeElement=p.removeElement,a.addStyleRule=p.addStyleRule,a.addRelatedStyleRule=p.addRelatedStyleRule,a.deleteRelatedStyleRule=p.deleteRelatedStyleRule,a.setStyleOnHover=p.setStyleOnHover,a.getFullTransformMatrix=p.getFullTransformMatrix,a.getElementTransformMatrix=p.getElementTransformMatrix,a.getElementAndAncestors=p.getElementAndAncestors,a.equalDomRects=p.equalDomRects,a.clearResponsive=US(),a.preserveDrawingBuffer=VS(),a.makeTraceGroups=qS(),a._=HS(),a.notifier=cb(),a.filterUnique=gb(),a.filterVisible=GS(),a.pushUnique=fb(),a.increment=WS(),a.cleanNumber=ZS(),a.ensureNumber=function(ee){return E(ee)?(ee=Number(ee),ee>t||ee=ee?!1:E(re)&&re>=0&&re%1===0},a.noop=Ym(),a.identity=Xg(),a.repeat=function(re,ee){for(var q=new Array(ee),ae=0;aeq?Math.max(q,Math.min(ee,re)):Math.max(ee,Math.min(q,re))},a.bBoxIntersect=function(re,ee,q){return q=q||0,re.left<=ee.right+q&&ee.left<=re.right+q&&re.top<=ee.bottom+q&&ee.top<=re.bottom+q},a.simpleMap=function(re,ee,q,ae,ie){for(var fe=re.length,we=new Array(fe),Ae=0;Ae=Math.pow(2,q)?ie>10?(a.warn("randstr failed uniqueness"),we):re(ee,q,ae,(ie||0)+1):we},a.OptionControl=function(re,ee){re||(re={}),ee||(ee="opt");var q={};return q.optionList=[],q._newoption=function(ae){ae[ee]=re,q[ae.name]=ae,q.optionList.push(ae)},q["_"+ee]=re,q},a.smooth=function(re,ee){if(ee=Math.round(ee)||0,ee<2)return re;var q=re.length,ae=2*q,ie=2*ee-1,fe=new Array(ie),we=new Array(q),Ae,Fe,Ce,qe;for(Ae=0;Ae=ae&&(Ce-=ae*Math.floor(Ce/ae)),Ce<0?Ce=-1-Ce:Ce>=q&&(Ce=ae-1-Ce),qe+=re[Ce]*fe[Fe];we[Ae]=qe}return we},a.syncOrAsync=function(re,ee,q){var ae,ie;function fe(){return a.syncOrAsync(re,ee,q)}for(;re.length;)if(ie=re.splice(0,1)[0],ae=ie(ee),ae&&ae.then)return ae.then(fe);return q&&q(ee)},a.stripTrailingSlash=function(re){return re.substr(-1)==="/"?re.substr(0,re.length-1):re},a.noneOrAll=function(re,ee,q){if(re){var ae=!1,ie=!0,fe,we;for(fe=0;fe0?ie:0})},a.fillArray=function(re,ee,q,ae){if(ae=ae||a.identity,a.isArrayOrTypedArray(re))for(var ie=0;ie1?ie+we[1]:"";if(fe&&(we.length>1||Ae.length>4||q))for(;ae.test(Ae);)Ae=Ae.replace(ae,"$1"+fe+"$2");return Ae+Fe},a.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var O=/^\w*$/;a.templateString=function(re,ee){var q={};return re.replace(a.TEMPLATE_STRING_REGEX,function(ae,ie){var fe;return O.test(ie)?fe=ee[ie]:(q[ie]=q[ie]||a.nestedProperty(ee,ie).get,fe=q[ie](!0)),fe!==void 0?fe:""})};var L={max:10,count:0,name:"hovertemplate"};a.hovertemplateString=function(){return oe.apply(L,arguments)};var N={max:10,count:0,name:"texttemplate"};a.texttemplateString=function(){return oe.apply(N,arguments)};var U=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/;function Z(re){var ee=re.match(U);return ee?{key:ee[1],op:ee[2],number:Number(ee[3])}:{key:re,op:null,number:null}}var Q={max:10,count:0,name:"texttemplate",parseMultDiv:!0};a.texttemplateStringForShapes=function(){return oe.apply(Q,arguments)};var ue=/^[:|\|]/;function oe(re,ee,q){var ae=this,ie=arguments;return ee||(ee={}),re.replace(a.TEMPLATE_STRING_REGEX,function(fe,we,Ae){var Fe=we==="xother"||we==="yother",Ce=we==="_xother"||we==="_yother",qe=we==="_xother_"||we==="_yother_",et=we==="xother_"||we==="yother_",Qe=Fe||Ce||et||qe,Ke=we;(Ce||qe)&&(Ke=Ke.substring(1)),(et||qe)&&(Ke=Ke.substring(0,Ke.length-1));var Xe=null,Me=null;if(ae.parseMultDiv){var xe=Z(Ke);Ke=xe.key,Xe=xe.op,Me=xe.number}var ce;if(Qe){if(ce=ee[Ke],ce===void 0)return""}else{var Re,$e;for($e=3;$e=le&&we<=j,Ce=Ae>=le&&Ae<=j;if(Fe&&(ae=10*ae+we-le),Ce&&(ie=10*ie+Ae-le),!Fe||!Ce){if(ae!==ie)return ae-ie;if(we!==Ae)return we-Ae}}return ie-ae};var J=2e9;a.seedPseudoRandom=function(){J=2e9},a.pseudoRandom=function(){var re=J;return J=(69069*J+1)%4294967296,Math.abs(J-re)<429496729?a.pseudoRandom():J/4294967296},a.fillText=function(re,ee,q){var ae=Array.isArray(q)?function(we){q.push(we)}:function(we){q.text=we},ie=a.extractOption(re,ee,"htx","hovertext");if(a.isValidTextValue(ie))return ae(ie);var fe=a.extractOption(re,ee,"tx","text");if(a.isValidTextValue(fe))return ae(fe)},a.isValidTextValue=function(re){return re||re===0},a.formatPercent=function(re,ee){ee=ee||0;for(var q=(Math.round(100*re*Math.pow(10,ee))*Math.pow(.1,ee)).toFixed(ee)+"%",ae=0;ae1&&(Ce=1):Ce=0,a.strTranslate(ie-Ce*(q+we),fe-Ce*(ae+Ae))+a.strScale(Ce)+(Fe?"rotate("+Fe+(ee?"":" "+q+" "+ae)+")":"")},a.setTransormAndDisplay=function(re,ee){re.attr("transform",a.getTextTransform(ee)),re.style("display",ee.scale?null:"none")},a.ensureUniformFontSize=function(re,ee){var q=a.extendFlat({},ee);return q.size=Math.max(ee.size,re._fullLayout.uniformtext.minsize||0),q},a.join2=function(re,ee,q){var ae=re.length;return ae>1?re.slice(0,-1).join(ee)+q+re[ae-1]:re.join(ee)},a.bigFont=function(re){return Math.round(1.2*re)};var $=a.getFirefoxVersion(),X=$!==null&&$<86;a.getPositionFromD3Event=function(){return X?[d.event.layerX,d.event.layerY]:[d.event.offsetX,d.event.offsetY]}}}),XS=He({"build/plotcss.js"(){var Y=Gr(),G={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(x in G)d=x.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),Y.addStyleRule(d,G[x]);var d,x}}),yb=He({"node_modules/is-browser/client.js"(Y,G){G.exports=!0}}),mb=He({"node_modules/has-hover/index.js"(Y,G){var d=yb(),x;typeof window.matchMedia=="function"?x=!window.matchMedia("(hover: none)").matches:x=d,G.exports=x}}),Mp=He({"node_modules/events/events.js"(Y,G){var d=typeof Reflect=="object"?Reflect:null,x=d&&typeof d.apply=="function"?d.apply:function(M,_,w){return Function.prototype.apply.call(M,_,w)},A;d&&typeof d.ownKeys=="function"?A=d.ownKeys:Object.getOwnPropertySymbols?A=function(M){return Object.getOwnPropertyNames(M).concat(Object.getOwnPropertySymbols(M))}:A=function(M){return Object.getOwnPropertyNames(M)};function E(S){console&&console.warn&&console.warn(S)}var e=Number.isNaN||function(M){return M!==M};function t(){t.init.call(this)}G.exports=t,G.exports.once=l,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var r=10;function o(S){if(typeof S!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof S)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(S){if(typeof S!="number"||S<0||e(S))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+S+".");r=S}}),t.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(M){if(typeof M!="number"||M<0||e(M))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+M+".");return this._maxListeners=M,this};function a(S){return S._maxListeners===void 0?t.defaultMaxListeners:S._maxListeners}t.prototype.getMaxListeners=function(){return a(this)},t.prototype.emit=function(M){for(var _=[],w=1;w0&&(g=_[0]),g instanceof Error)throw g;var m=new Error("Unhandled error."+(g?" ("+g.message+")":""));throw m.context=g,m}var R=u[M];if(R===void 0)return!1;if(typeof R=="function")x(R,this,_);else for(var P=R.length,z=v(R,P),w=0;w0&&g.length>p&&!g.warned){g.warned=!0;var m=new Error("Possible EventEmitter memory leak detected. "+g.length+" "+String(M)+" listeners added. Use emitter.setMaxListeners() to increase limit");m.name="MaxListenersExceededWarning",m.emitter=S,m.type=M,m.count=g.length,E(m)}return S}t.prototype.addListener=function(M,_){return i(this,M,_,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(M,_){return i(this,M,_,!0)};function n(){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 s(S,M,_){var w={fired:!1,wrapFn:void 0,target:S,type:M,listener:_},p=n.bind(w);return p.listener=_,w.wrapFn=p,p}t.prototype.once=function(M,_){return o(_),this.on(M,s(this,M,_)),this},t.prototype.prependOnceListener=function(M,_){return o(_),this.prependListener(M,s(this,M,_)),this},t.prototype.removeListener=function(M,_){var w,p,u,g,m;if(o(_),p=this._events,p===void 0)return this;if(w=p[M],w===void 0)return this;if(w===_||w.listener===_)--this._eventsCount===0?this._events=Object.create(null):(delete p[M],p.removeListener&&this.emit("removeListener",M,w.listener||_));else if(typeof w!="function"){for(u=-1,g=w.length-1;g>=0;g--)if(w[g]===_||w[g].listener===_){m=w[g].listener,u=g;break}if(u<0)return this;u===0?w.shift():h(w,u),w.length===1&&(p[M]=w[0]),p.removeListener!==void 0&&this.emit("removeListener",M,m||_)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(M){var _,w,p;if(w=this._events,w===void 0)return this;if(w.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):w[M]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete w[M]),this;if(arguments.length===0){var u=Object.keys(w),g;for(p=0;p=0;p--)this.removeListener(M,_[p]);return this};function c(S,M,_){var w=S._events;if(w===void 0)return[];var p=w[M];return p===void 0?[]:typeof p=="function"?_?[p.listener||p]:[p]:_?T(p):v(p,p.length)}t.prototype.listeners=function(M){return c(this,M,!0)},t.prototype.rawListeners=function(M){return c(this,M,!1)},t.listenerCount=function(S,M){return typeof S.listenerCount=="function"?S.listenerCount(M):f.call(S,M)},t.prototype.listenerCount=f;function f(S){var M=this._events;if(M!==void 0){var _=M[S];if(typeof _=="function")return 1;if(_!==void 0)return _.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?A(this._events):[]};function v(S,M){for(var _=new Array(M),w=0;wx.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--)},E.startSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},E.stopSequence=function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},E.undo=function(t){var r,o;if(!(t.undoQueue===void 0||isNaN(t.undoQueue.index)||t.undoQueue.index<=0)){for(t.undoQueue.index--,r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=t.undoQueue.queue.length)){for(r=t.undoQueue.queue[t.undoQueue.index],t.undoQueue.inSequence=!0,o=0;o=L.length)return!1;if(P.dimensions===2){if(F++,z.length===F)return P;var N=z[F];if(!b(N))return!1;P=L[O][N]}else P=L[O]}else P=L}}return P}function b(P){return P===Math.round(P)&&P>=0}function S(P){var z,F;z=G.modules[P]._module,F=z.basePlotModule;var B={};B.type=null;var O=o({},x),L=o({},z.attributes);Y.crawl(L,function(Z,Q,ue,oe,le){n(O,le).set(void 0),Z===void 0&&n(L,le).set(void 0)}),o(B,O),G.traceIs(P,"noOpacity")&&delete B.opacity,G.traceIs(P,"showLegend")||(delete B.showlegend,delete B.legendgroup),G.traceIs(P,"noHover")&&(delete B.hoverinfo,delete B.hoverlabel),z.selectPoints||delete B.selectedpoints,o(B,L),F.attributes&&o(B,F.attributes),B.type=P;var N={meta:z.meta||{},categories:z.categories||{},animatable:!!z.animatable,type:P,attributes:w(B)};if(z.layoutAttributes){var U={};o(U,z.layoutAttributes),N.layoutAttributes=w(U)}return z.animatable||Y.crawl(N,function(Z){Y.isValObject(Z)&&"anim"in Z&&delete Z.anim}),N}function M(){var P={},z,F;o(P,A);for(z in G.subplotsRegistry)if(F=G.subplotsRegistry[z],!!F.layoutAttributes)if(Array.isArray(F.attr))for(var B=0;B=a&&(o._input||{})._templateitemname;n&&(i=a);var s=r+"["+i+"]",c;function f(){c={},n&&(c[s]={},c[s][x]=n)}f();function v(y,b){c[y]=b}function h(y,b){n?G.nestedProperty(c[s],y).set(b):c[s+"."+y]=b}function T(){var y=c;return f(),y}function l(y,b){y&&h(y,b);var S=T();for(var M in S)G.nestedProperty(t,M).set(S[M])}return{modifyBase:v,modifyItem:h,getUpdateObj:T,applyUpdate:l}}}}),Ef=He({"src/plots/cartesian/constants.js"(Y,G){var d=R0().counter;G.exports={idRegex:{x:d("x","( domain)?"),y:d("y","( domain)?")},attrRegex:d("[xy]axis"),xAxisMatch:d("xaxis"),yAxisMatch:d("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),oc=He({"src/plots/cartesian/axis_ids.js"(Y){var G=Ei(),d=Ef();Y.id2name=function(E){if(!(typeof E!="string"||!E.match(d.AX_ID_PATTERN))){var e=E.split(" ")[0].substr(1);return e==="1"&&(e=""),E.charAt(0)+"axis"+e}},Y.name2id=function(E){if(E.match(d.AX_NAME_PATTERN)){var e=E.substr(5);return e==="1"&&(e=""),E.charAt(0)+e}},Y.cleanId=function(E,e,t){var r=/( domain)$/.test(E);if(!(typeof E!="string"||!E.match(d.AX_ID_PATTERN))&&!(e&&E.charAt(0)!==e)&&!(r&&!t)){var o=E.split(" ")[0].substr(1).replace(/^0+/,"");return o==="1"&&(o=""),E.charAt(0)+o+(r&&t?" domain":"")}},Y.list=function(A,E,e){var t=A._fullLayout;if(!t)return[];var r=Y.listIds(A,E),o=new Array(r.length),a;for(a=0;at?1:-1:+(A.substr(1)||1)-+(E.substr(1)||1)},Y.ref2id=function(A){return/^[xyz]/.test(A)?A.split(" ")[0]:!1};function x(A,E){if(E&&E.length){for(var e=0;e0?".":"")+n;d.isPlainObject(s)?t(s,o,c,i+1):o(c,n,s)}})}}}),yu=He({"src/plots/plots.js"(Y,G){var d=Qn(),x=Xl().timeFormatLocale,A=co().formatLocale,E=Hi(),e=Uh(),t=Ei(),r=F0(),o=Gs(),a=Gr(),i=Ai(),n=lo().BADNUM,s=oc(),c=jd().clearOutline,f=t1(),v=Zg(),h=_b(),T=Uf().getModuleCalcData,l=a.relinkPrivateKeys,y=a._,b=G.exports={};a.extendFlat(b,t),b.attributes=cl(),b.attributes.type.values=b.allTypes,b.fontAttrs=Yl(),b.layoutAttributes=D0();var S=KS();b.executeAPICommand=S.executeAPICommand,b.computeAPICommandBindings=S.computeAPICommandBindings,b.manageCommandObserver=S.manageCommandObserver,b.hasSimpleAPICommandBindings=S.hasSimpleAPICommandBindings,b.redrawText=function(j){return j=a.getGraphDiv(j),new Promise(function(J){setTimeout(function(){j._fullLayout&&(t.getComponentMethod("annotations","draw")(j),t.getComponentMethod("legend","draw")(j),t.getComponentMethod("colorbar","draw")(j),J(b.previousPromises(j)))},300)})},b.resize=function(j){j=a.getGraphDiv(j);var J,$=new Promise(function(X,re){(!j||a.isHidden(j))&&re(new Error("Resize must be passed a displayed plot div element.")),j._redrawTimer&&clearTimeout(j._redrawTimer),j._resolveResize&&(J=j._resolveResize),j._resolveResize=X,j._redrawTimer=setTimeout(function(){if(!j.layout||j.layout.width&&j.layout.height||a.isHidden(j)){X(j);return}delete j.layout.width,delete j.layout.height;var ee=j.changed;j.autoplay=!0,t.call("relayout",j,{autosize:!0}).then(function(){j.changed=ee,j._resolveResize===X&&(delete j._resolveResize,X(j))})},100)});return J&&J($),$},b.previousPromises=function(j){if((j._promises||[]).length)return Promise.all(j._promises).then(function(){j._promises=[]})},b.addLinks=function(j){if(!(!j._context.showLink&&!j._context.showSources)){var J=j._fullLayout,$=a.ensureSingle(J._paper,"text","js-plot-link-container",function(ie){ie.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:i.defaultLine,"pointer-events":"all"}).each(function(){var fe=d.select(this);fe.append("tspan").classed("js-link-to-tool",!0),fe.append("tspan").classed("js-link-spacer",!0),fe.append("tspan").classed("js-sourcelinks",!0)})}),X=$.node(),re={y:J._paper.attr("height")-9};document.body.contains(X)&&X.getComputedTextLength()>=J.width-20?(re["text-anchor"]="start",re.x=5):(re["text-anchor"]="end",re.x=J._paper.attr("width")-7),$.attr(re);var ee=$.select(".js-link-to-tool"),q=$.select(".js-link-spacer"),ae=$.select(".js-sourcelinks");j._context.showSources&&j._context.showSources(j),j._context.showLink&&M(j,ee),q.text(ee.text()&&ae.text()?" - ":"")}};function M(j,J){J.text("");var $=J.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(j._context.linkText+" »");if(j._context.sendData)$.on("click",function(){b.sendDataToCloud(j)});else{var X=window.location.pathname.split("/"),re=window.location.search;$.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+X[2].split(".")[0]+"/"+X[1]+re})}}b.sendDataToCloud=function(j){var J=(window.PLOTLYENV||{}).BASE_URL||j._context.plotlyServerURL;if(J){j.emit("plotly_beforeexport");var $=d.select(j).append("div").attr("id","hiddenform").style("display","none"),X=$.append("form").attr({action:J+"/external",method:"post",target:"_blank"}),re=X.append("input").attr({type:"text",name:"data"});return re.node().value=b.graphJson(j,!1,"keepdata"),X.node().submit(),$.remove(),j.emit("plotly_afterexport"),!1}};var _=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],w=["year","month","dayMonth","dayMonthYear"];b.supplyDefaults=function(j,J){var $=J&&J.skipUpdateCalc,X=j._fullLayout||{};if(X._skipDefaults){delete X._skipDefaults;return}var re=j._fullLayout={},ee=j.layout||{},q=j._fullData||[],ae=j._fullData=[],ie=j.data||[],fe=j.calcdata||[],we=j._context||{},Ae;j._transitionData||b.createTransitionData(j),re._dfltTitle={plot:y(j,"Click to enter Plot title"),subtitle:y(j,"Click to enter Plot subtitle"),x:y(j,"Click to enter X axis title"),y:y(j,"Click to enter Y axis title"),colorbar:y(j,"Click to enter Colorscale title"),annotation:y(j,"new text")},re._traceWord=y(j,"trace");var Fe=g(j,_);if(re._mapboxAccessToken=we.mapboxAccessToken,X._initialAutoSizeIsDone){var Ce=X.width,qe=X.height;b.supplyLayoutGlobalDefaults(ee,re,Fe),ee.width||(re.width=Ce),ee.height||(re.height=qe),b.sanitizeMargins(re)}else{b.supplyLayoutGlobalDefaults(ee,re,Fe);var et=!ee.width||!ee.height,Qe=re.autosize,Ke=we.autosizable,Xe=et&&(Qe||Ke);Xe?b.plotAutoSize(j,ee,re):et&&b.sanitizeMargins(re),!Qe&&et&&(ee.width=re.width,ee.height=re.height)}re._d3locale=m(Fe,re.separators),re._extraFormat=g(j,w),re._initialAutoSizeIsDone=!0,re._dataLength=ie.length,re._modules=[],re._visibleModules=[],re._basePlotModules=[];var Me=re._subplots=u(),xe=re._splomAxes={x:{},y:{}},ce=re._splomSubplots={};re._splomGridDflt={},re._scatterStackOpts={},re._firstScatter={},re._alignmentOpts={},re._colorAxes={},re._requestRangeslider={},re._traceUids=p(q,ie),b.supplyDataDefaults(ie,ae,ee,re);var Re=Object.keys(xe.x),$e=Object.keys(xe.y);if(Re.length>1&&$e.length>1){for(t.getComponentMethod("grid","sizeDefaults")(ee,re),Ae=0;Ae15&&$e.length>15&&re.shapes.length===0&&re.images.length===0,b.linkSubplots(ae,re,q,X),b.cleanPlot(ae,re,q,X);var Rt=!!(X._has&&X._has("cartesian")),Ut=!!(re._has&&re._has("cartesian")),ir=Rt,ar=Ut;ir&&!ar?X._bgLayer.remove():ar&&!ir&&(re._shouldCreateBgLayer=!0),X._zoomlayer&&!j._dragging&&c({_fullLayout:X}),R(ae,re),l(re,X),t.getComponentMethod("colorscale","crossTraceDefaults")(ae,re),re._preGUI||(re._preGUI={}),re._tracePreGUI||(re._tracePreGUI={});var Mr=re._tracePreGUI,fr={},dr;for(dr in Mr)fr[dr]="old";for(Ae=0;Ae0){var we=1-2*ee;q=Math.round(we*q),ae=Math.round(we*ae)}}var Ae=b.layoutAttributes.width.min,Fe=b.layoutAttributes.height.min;q1,qe=!$.height&&Math.abs(X.height-ae)>1;(qe||Ce)&&(Ce&&(X.width=q),qe&&(X.height=ae)),J._initialAutoSize||(J._initialAutoSize={width:q,height:ae}),b.sanitizeMargins(X)},b.supplyLayoutModuleDefaults=function(j,J,$,X){var re=t.componentsRegistry,ee=J._basePlotModules,q,ae,ie,fe=t.subplotsRegistry.cartesian;for(q in re)ie=re[q],ie.includeBasePlot&&ie.includeBasePlot(j,J);ee.length||ee.push(fe),J._has("cartesian")&&(t.getComponentMethod("grid","contentDefaults")(j,J),fe.finalizeSubplots(j,J));for(var we in J._subplots)J._subplots[we].sort(a.subplotSort);for(ae=0;ae1&&($.l/=Qe,$.r/=Qe)}if(Fe){var Ke=($.t+$.b)/Fe;Ke>1&&($.t/=Ke,$.b/=Ke)}var Xe=$.xl!==void 0?$.xl:$.x,Me=$.xr!==void 0?$.xr:$.x,xe=$.yt!==void 0?$.yt:$.y,ce=$.yb!==void 0?$.yb:$.y;Ce[J]={l:{val:Xe,size:$.l+et},r:{val:Me,size:$.r+et},b:{val:ce,size:$.b+et},t:{val:xe,size:$.t+et}},qe[J]=1}if(!X._replotting)return b.doAutoMargin(j)}};function L(j){if("_redrawFromAutoMarginCount"in j._fullLayout)return!1;var J=s.list(j,"",!0);for(var $ in J)if(J[$].autoshift||J[$].shift)return!0;return!1}b.doAutoMargin=function(j){var J=j._fullLayout,$=J.width,X=J.height;J._size||(J._size={}),F(J);var re=J._size,ee=J.margin,q={t:0,b:0,l:0,r:0},ae=a.extendFlat({},re),ie=ee.l,fe=ee.r,we=ee.t,Ae=ee.b,Fe=J._pushmargin,Ce=J._pushmarginIds,qe=J.minreducedwidth,et=J.minreducedheight;if(ee.autoexpand!==!1){for(var Qe in Fe)Ce[Qe]||delete Fe[Qe];var Ke=j._fullLayout._reservedMargin;for(var Xe in Ke)for(var Me in Ke[Xe]){var xe=Ke[Xe][Me];q[Me]=Math.max(q[Me],xe)}Fe.base={l:{val:0,size:ie},r:{val:1,size:fe},t:{val:1,size:we},b:{val:0,size:Ae}};for(var ce in q){var Re=0;for(var $e in Fe)$e!=="base"&&E(Fe[$e][ce].size)&&(Re=Fe[$e][ce].size>Re?Fe[$e][ce].size:Re);var rt=Math.max(0,ee[ce]-Re);q[ce]=Math.max(0,q[ce]-rt)}for(var Je in Fe){var At=Fe[Je].l||{},St=Fe[Je].b||{},Rt=At.val,Ut=At.size,ir=St.val,ar=St.size,Mr=$-q.r-q.l,fr=X-q.t-q.b;for(var dr in Fe){if(E(Ut)&&Fe[dr].r){var pt=Fe[dr].r.val,ze=Fe[dr].r.size;if(pt>Rt){var Ge=(Ut*pt+(ze-Mr)*Rt)/(pt-Rt),Oe=(ze*(1-Rt)+(Ut-Mr)*(1-pt))/(pt-Rt);Ge+Oe>ie+fe&&(ie=Ge,fe=Oe)}}if(E(ar)&&Fe[dr].t){var ve=Fe[dr].t.val,ge=Fe[dr].t.size;if(ve>ir){var be=(ar*ve+(ge-fr)*ir)/(ve-ir),Pe=(ge*(1-ir)+(ar-fr)*(1-ve))/(ve-ir);be+Pe>Ae+we&&(Ae=be,we=Pe)}}}}}var We=a.constrain($-ee.l-ee.r,B,qe),ct=a.constrain(X-ee.t-ee.b,O,et),_t=Math.max(0,$-We),Mt=Math.max(0,X-ct);if(_t){var Nt=(ie+fe)/_t;Nt>1&&(ie/=Nt,fe/=Nt)}if(Mt){var Bt=(Ae+we)/Mt;Bt>1&&(Ae/=Bt,we/=Bt)}if(re.l=Math.round(ie)+q.l,re.r=Math.round(fe)+q.r,re.t=Math.round(we)+q.t,re.b=Math.round(Ae)+q.b,re.p=Math.round(ee.pad),re.w=Math.round($)-re.l-re.r,re.h=Math.round(X)-re.t-re.b,!J._replotting&&(b.didMarginChange(ae,re)||L(j))){"_redrawFromAutoMarginCount"in J?J._redrawFromAutoMarginCount++:J._redrawFromAutoMarginCount=1;var qt=3*(1+Object.keys(Ce).length);if(J._redrawFromAutoMarginCount1)return!0}return!1},b.graphJson=function(j,J,$,X,re,ee){(re&&J&&!j._fullData||re&&!J&&!j._fullLayout)&&b.supplyDefaults(j);var q=re?j._fullData:j.data,ae=re?j._fullLayout:j.layout,ie=(j._transitionData||{})._frames;function fe(Fe,Ce){if(typeof Fe=="function")return Ce?"_function_":null;if(a.isPlainObject(Fe)){var qe={},et;return Object.keys(Fe).sort().forEach(function(Me){if(["_","["].indexOf(Me.charAt(0))===-1){if(typeof Fe[Me]=="function"){Ce&&(qe[Me]="_function");return}if($==="keepdata"){if(Me.substr(Me.length-3)==="src")return}else if($==="keepstream"){if(et=Fe[Me+"src"],typeof et=="string"&&et.indexOf(":")>0&&!a.isPlainObject(Fe.stream))return}else if($!=="keepall"&&(et=Fe[Me+"src"],typeof et=="string"&&et.indexOf(":")>0))return;qe[Me]=fe(Fe[Me],Ce)}}),qe}var Qe=Array.isArray(Fe),Ke=a.isTypedArray(Fe);if((Qe||Ke)&&Fe.dtype&&Fe.shape){var Xe=Fe.bdata;return fe({dtype:Fe.dtype,shape:Fe.shape,bdata:a.isArrayBuffer(Xe)?e.encode(Xe):Xe},Ce)}return Qe?Fe.map(function(Me){return fe(Me,Ce)}):Ke?a.simpleMap(Fe,a.identity):a.isJSDate(Fe)?a.ms2DateTimeLocal(+Fe):Fe}var we={data:(q||[]).map(function(Fe){var Ce=fe(Fe);return J&&delete Ce.fit,Ce})};if(!J&&(we.layout=fe(ae),re)){var Ae=ae._size;we.layout.computed={margin:{b:Ae.b,l:Ae.l,r:Ae.r,t:Ae.t}}}return ie&&(we.frames=fe(ie)),ee&&(we.config=fe(j._context,!0)),X==="object"?we:JSON.stringify(we)},b.modifyFrames=function(j,J){var $,X,re,ee=j._transitionData._frames,q=j._transitionData._frameHash;for($=0;$0&&(j._transitioningWithDuration=!0),j._transitionData._interruptCallbacks.push(function(){X=!0}),$.redraw&&j._transitionData._interruptCallbacks.push(function(){return t.call("redraw",j)}),j._transitionData._interruptCallbacks.push(function(){j.emit("plotly_transitioninterrupted",[])});var Fe=0,Ce=0;function qe(){return Fe++,function(){Ce++,!X&&Ce===Fe&&ae(Ae)}}$.runFn(qe),setTimeout(qe())})}function ae(Ae){if(j._transitionData)return ee(j._transitionData._interruptCallbacks),Promise.resolve().then(function(){if($.redraw)return t.call("redraw",j)}).then(function(){j._transitioning=!1,j._transitioningWithDuration=!1,j.emit("plotly_transitioned",[])}).then(Ae)}function ie(){if(j._transitionData)return j._transitioning=!1,re(j._transitionData._interruptCallbacks)}var fe=[b.previousPromises,ie,$.prepareFn,b.rehover,b.reselect,q],we=a.syncOrAsync(fe,j);return(!we||!we.then)&&(we=Promise.resolve()),we.then(function(){return j})}b.doCalcdata=function(j,J){var $=s.list(j),X=j._fullData,re=j._fullLayout,ee,q,ae,ie,fe=new Array(X.length),we=(j.calcdata||[]).slice();for(j.calcdata=fe,re._numBoxes=0,re._numViolins=0,re._violinScaleGroupStats={},j._hmpixcount=0,j._hmlumcount=0,re._piecolormap={},re._sunburstcolormap={},re._treemapcolormap={},re._iciclecolormap={},re._funnelareacolormap={},ae=0;ae=0;ie--)if(ce[ie].enabled){ee._indexToPoints=ce[ie]._indexToPoints;break}q&&q.calc&&(xe=q.calc(j,ee))}(!Array.isArray(xe)||!xe[0])&&(xe=[{x:n,y:n}]),xe[0].t||(xe[0].t={}),xe[0].trace=ee,fe[Xe]=xe}}for(oe($,X,re),ae=0;aeae||Ce>ie)&&(ee.style("overflow","hidden"),Ae=ee.node().getBoundingClientRect(),Fe=Ae.width,Ce=Ae.height);var qe=+O.attr("x"),et=+O.attr("y"),Qe=j||O.node().getBoundingClientRect().height,Ke=-Qe/4;if(ue[0]==="y")q.attr({transform:"rotate("+[-90,qe,et]+")"+x(-Fe/2,Ke-Ce/2)});else if(ue[0]==="l")et=Ke-Ce/2;else if(ue[0]==="a"&&ue.indexOf("atitle")!==0)qe=0,et=Ke;else{var Xe=O.attr("text-anchor");qe=qe-Fe*(Xe==="middle"?.5:Xe==="end"?1:0),et=et+Ke-Ce/2}ee.attr({x:qe,y:et}),N&&N.call(O,q),le(q)})})):oe(),O};var t=/(<|<|<)/g,r=/(>|>|>)/g;function o(O){return O.replace(t,"\\lt ").replace(r,"\\gt ")}var a=[["$","$"],["\\(","\\)"]];function i(O,L,N){var U=parseInt((MathJax.version||"").split(".")[0]);if(U!==2&&U!==3){d.warn("No MathJax version:",MathJax.version);return}var Z,Q,ue,oe,le=function(){return Q=d.extendDeepAll({},MathJax.Hub.config),ue=MathJax.Hub.processSectionDelay,MathJax.Hub.processSectionDelay!==void 0&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:a},displayAlign:"left"})},j=function(){Q=d.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=a},J=function(){if(Z=MathJax.Hub.config.menuSettings.renderer,Z!=="SVG")return MathJax.Hub.setRenderer("SVG")},$=function(){Z=MathJax.config.startup.output,Z!=="svg"&&(MathJax.config.startup.output="svg")},X=function(){var fe="math-output-"+d.randstr({},64);oe=G.select("body").append("div").attr({id:fe}).style({visibility:"hidden",position:"absolute","font-size":L.fontSize+"px"}).text(o(O));var we=oe.node();return U===2?MathJax.Hub.Typeset(we):MathJax.typeset([we])},re=function(){var fe=oe.select(U===2?".MathJax_SVG":".MathJax"),we=!fe.empty()&&oe.select("svg").node();if(!we)d.log("There was an error in the tex syntax.",O),N();else{var Ae=we.getBoundingClientRect(),Fe;U===2?Fe=G.select("body").select("#MathJax_SVG_glyphs"):Fe=fe.select("defs"),N(fe,Fe,Ae)}oe.remove()},ee=function(){if(Z!=="SVG")return MathJax.Hub.setRenderer(Z)},q=function(){Z!=="svg"&&(MathJax.config.startup.output=Z)},ae=function(){return ue!==void 0&&(MathJax.Hub.processSectionDelay=ue),MathJax.Hub.Config(Q)},ie=function(){MathJax.config=Q};U===2?MathJax.Hub.Queue(le,J,X,re,ee,ae):U===3&&(j(),$(),MathJax.startup.defaultReady(),MathJax.startup.promise.then(function(){X(),re(),q(),ie()}))}var n={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},s={sub:"0.3em",sup:"-0.6em"},c={sub:"-0.21em",sup:"0.42em"},f="​",v=["http:","https:","mailto:","",void 0,":"],h=Y.NEWLINES=/(\r\n?|\n)/g,T=/(<[^<>]*>)/,l=/<(\/?)([^ >]*)(\s+(.*))?>/i,y=//i;Y.BR_TAG_ALL=//gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,S=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,M=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,_=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function w(O,L){if(!O)return null;var N=O.match(L),U=N&&(N[3]||N[4]);return U&&m(U)}var p=/(^|;)\s*color:/;Y.plainText=function(O,L){L=L||{};for(var N=L.len!==void 0&&L.len!==-1?L.len:1/0,U=L.allowedTags!==void 0?L.allowedTags:["br"],Z="...",Q=Z.length,ue=O.split(T),oe=[],le="",j=0,J=0;JQ?oe.push($.substr(0,q-Q)+Z):oe.push($.substr(0,q));break}le=""}}return oe.join("")};var u={mu:"μ",amp:"&",lt:"<",gt:">",nbsp:" ",times:"×",plusmn:"±",deg:"°"},g=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function m(O){return O.replace(g,function(L,N){var U;return N.charAt(0)==="#"?U=R(N.charAt(1)==="x"?parseInt(N.substr(2),16):parseInt(N.substr(1),10)):U=u[N],U||L})}Y.convertEntities=m;function R(O){if(!(O>1114111)){var L=String.fromCodePoint;if(L)return L(O);var N=String.fromCharCode;return O<=65535?N(O):N((O>>10)+55232,O%1024+56320)}}function P(O,L){L=L.replace(h," ");var N=!1,U=[],Z,Q=-1;function ue(){Q++;var Ce=document.createElementNS(A.svg,"tspan");G.select(Ce).attr({class:"line",dy:Q*E+"em"}),O.appendChild(Ce),Z=Ce;var qe=U;if(U=[{node:Ce}],qe.length>1)for(var et=1;et.",L);return}var qe=U.pop();Ce!==qe.type&&d.log("Start tag <"+qe.type+"> doesnt match end tag <"+Ce+">. Pretending it did match.",L),Z=U[U.length-1].node}var J=y.test(L);J?ue():(Z=O,U=[{node:O}]);for(var $=L.split(T),X=0;X<$.length;X++){var re=$[X],ee=re.match(l),q=ee&&ee[2].toLowerCase(),ae=n[q];if(q==="br")ue();else if(ae===void 0)le(Z,m(re));else if(ee[1])j(q);else{var ie=ee[4],fe={type:q},we=w(ie,b);if(we?(we=we.replace(p,"$1 fill:"),ae&&(we+=";"+ae)):ae&&(we=ae),we&&(fe.style=we),q==="a"){N=!0;var Ae=w(ie,S);if(Ae){var Fe=z(Ae);Fe&&(fe.href=Fe,fe.target=w(ie,M)||"_blank",fe.popup=w(ie,_))}}oe(fe)}}return N}function z(O){var L=encodeURI(decodeURI(O)),N=document.createElement("a"),U=document.createElement("a");N.href=O,U.href=L;var Z=N.protocol,Q=U.protocol;return v.indexOf(Z)!==-1&&v.indexOf(Q)!==-1?L:""}Y.sanitizeHTML=function(L){L=L.replace(h," ");for(var N=document.createElement("p"),U=N,Z=[],Q=L.split(T),ue=0;ue=0;y--,b++){var S=h[y];l[b]=[1-S[0],S[1]]}return l}function c(h,T){T=T||{};for(var l=h.domain,y=h.range,b=y.length,S=new Array(b),M=0;Mh-f?f=h-(v-h):v-h=0?y=o.colorscale.sequential:y=o.colorscale.sequentialminus,s._sync("colorscale",y)}}}}),Kl=He({"src/components/colorscale/index.js"(Y,G){var d=Ap(),x=Ah();G.exports={moduleType:"component",name:"colorscale",attributes:kl(),layoutAttributes:xb(),supplyLayoutDefaults:JS(),handleDefaults:pf(),crossTraceDefaults:$S(),calc:Sh(),scales:d.scales,defaultScale:d.defaultScale,getScale:d.get,isValidScale:d.isValid,hasColorscale:x.hasColorscale,extractOpts:x.extractOpts,extractScale:x.extractScale,flipScale:x.flipScale,makeColorScaleFunc:x.makeColorScaleFunc,makeColorScaleFuncFromTrace:x.makeColorScaleFuncFromTrace}}}),Rl=He({"src/traces/scatter/subtypes.js"(Y,G){var d=Gr(),x=ch().isTypedArraySpec;G.exports={hasLines:function(A){return A.visible&&A.mode&&A.mode.indexOf("lines")!==-1},hasMarkers:function(A){return A.visible&&(A.mode&&A.mode.indexOf("markers")!==-1||A.type==="splom")},hasText:function(A){return A.visible&&A.mode&&A.mode.indexOf("text")!==-1},isBubble:function(A){var E=A.marker;return d.isPlainObject(E)&&(d.isArrayOrTypedArray(E.size)||x(E.size))}}}}),B0=He({"src/traces/scatter/make_bubble_size_func.js"(Y,G){var d=Hi();G.exports=function(A,E){E||(E=2);var e=A.marker,t=e.sizeref||1,r=e.sizemin||0,o=e.sizemode==="area"?function(a){return Math.sqrt(a/t)}:function(a){return a/t};return function(a){var i=o(a/E);return d(i)&&i>0?Math.max(i,r):0}}}}),Ph=He({"src/components/fx/helpers.js"(Y){var G=Gr();Y.getSubplot=function(t){return t.subplot||t.xaxis+t.yaxis||t.geo},Y.isTraceInSubplots=function(t,r){if(t.type==="splom"){for(var o=t.xaxes||[],a=t.yaxes||[],i=0;i=0&&o.index2&&(r.push([a].concat(i.splice(0,2))),n="l",a=a=="m"?"l":"L");;){if(i.length==d[n])return i.unshift(a),r.push(i);if(i.length0&&(xe=100,Me=Me.replace("-open","")),Me.indexOf("-dot")>0&&(xe+=200,Me=Me.replace("-dot","")),Me=l.symbolNames.indexOf(Me),Me>=0&&(Me+=xe)}return Me%100>=p||Me>=400?0:Math.floor(Math.max(Me,0))};function g(Me,xe,ce,Re){var $e=Me%100;return l.symbolFuncs[$e](xe,ce,Re)+(Me>=200?u:"")}var m=A("~f"),R={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};l.gradient=function(Me,xe,ce,Re,$e,rt){var Je=R[Re];return P(Me,xe,ce,Je.type,$e,rt,Je.start,Je.stop,!1,Je.reversed)};function P(Me,xe,ce,Re,$e,rt,Je,At,St,Rt){var Ut=$e.length,ir;Re==="linear"?ir={node:"linearGradient",attrs:{x1:Je.x,y1:Je.y,x2:At.x,y2:At.y,gradientUnits:St?"userSpaceOnUse":"objectBoundingBox"},reversed:Rt}:Re==="radial"&&(ir={node:"radialGradient",reversed:Rt});for(var ar=new Array(Ut),Mr=0;Mr=0&&Me.i===void 0&&(Me.i=rt.i),xe.style("opacity",Re.selectedOpacityFn?Re.selectedOpacityFn(Me):Me.mo===void 0?Je.opacity:Me.mo),Re.ms2mrc){var St;Me.ms==="various"||Je.size==="various"?St=3:St=Re.ms2mrc(Me.ms),Me.mrc=St,Re.selectedSizeFn&&(St=Me.mrc=Re.selectedSizeFn(Me));var Rt=l.symbolNumber(Me.mx||Je.symbol)||0;Me.om=Rt%200>=100;var Ut=Xe(Me,ce),ir=ae(Me,ce);xe.attr("d",g(Rt,St,Ut,ir))}var ar=!1,Mr,fr,dr;if(Me.so)dr=At.outlierwidth,fr=At.outliercolor,Mr=Je.outliercolor;else{var pt=(At||{}).width;dr=(Me.mlw+1||pt+1||(Me.trace?(Me.trace.marker.line||{}).width:0)+1)-1||0,"mlc"in Me?fr=Me.mlcc=Re.lineScale(Me.mlc):x.isArrayOrTypedArray(At.color)?fr=r.defaultLine:fr=At.color,x.isArrayOrTypedArray(Je.color)&&(Mr=r.defaultLine,ar=!0),"mc"in Me?Mr=Me.mcc=Re.markerScale(Me.mc):Mr=Je.color||Je.colors||"rgba(0,0,0,0)",Re.selectedColorFn&&(Mr=Re.selectedColorFn(Me))}if(Me.om)xe.call(r.stroke,Mr).style({"stroke-width":(dr||1)+"px",fill:"none"});else{xe.style("stroke-width",(Me.isBlank?0:dr)+"px");var ze=Je.gradient,Ge=Me.mgt;Ge?ar=!0:Ge=ze&&ze.type,x.isArrayOrTypedArray(Ge)&&(Ge=Ge[0],R[Ge]||(Ge=0));var Oe=Je.pattern,ve=Oe&&l.getPatternAttr(Oe.shape,Me.i,"");if(Ge&&Ge!=="none"){var ge=Me.mgc;ge?ar=!0:ge=ze.color;var be=ce.uid;ar&&(be+="-"+Me.i),l.gradient(xe,$e,be,Ge,[[0,ge],[1,Mr]],"fill")}else if(ve){var Pe=!1,We=Oe.fgcolor;!We&&rt&&rt.color&&(We=rt.color,Pe=!0);var ct=l.getPatternAttr(We,Me.i,rt&&rt.color||null),_t=l.getPatternAttr(Oe.bgcolor,Me.i,null),Mt=Oe.fgopacity,Nt=l.getPatternAttr(Oe.size,Me.i,8),Bt=l.getPatternAttr(Oe.solidity,Me.i,.3);Pe=Pe||Me.mcc||x.isArrayOrTypedArray(Oe.shape)||x.isArrayOrTypedArray(Oe.bgcolor)||x.isArrayOrTypedArray(Oe.fgcolor)||x.isArrayOrTypedArray(Oe.size)||x.isArrayOrTypedArray(Oe.solidity);var qt=ce.uid;Pe&&(qt+="-"+Me.i),l.pattern(xe,"point",$e,qt,ve,Nt,Bt,Me.mcc,Oe.fillmode,_t,ct,Mt)}else x.isArrayOrTypedArray(Mr)?r.fill(xe,Mr[Me.i]):r.fill(xe,Mr);dr&&r.stroke(xe,fr)}},l.makePointStyleFns=function(Me){var xe={},ce=Me.marker;return xe.markerScale=l.tryColorscale(ce,""),xe.lineScale=l.tryColorscale(ce,"line"),t.traceIs(Me,"symbols")&&(xe.ms2mrc=v.isBubble(Me)?h(Me):function(){return(ce.size||6)/2}),Me.selectedpoints&&x.extendFlat(xe,l.makeSelectedPointStyleFns(Me)),xe},l.makeSelectedPointStyleFns=function(Me){var xe={},ce=Me.selected||{},Re=Me.unselected||{},$e=Me.marker||{},rt=ce.marker||{},Je=Re.marker||{},At=$e.opacity,St=rt.opacity,Rt=Je.opacity,Ut=St!==void 0,ir=Rt!==void 0;(x.isArrayOrTypedArray(At)||Ut||ir)&&(xe.selectedOpacityFn=function(ve){var ge=ve.mo===void 0?$e.opacity:ve.mo;return ve.selected?Ut?St:ge:ir?Rt:f*ge});var ar=$e.color,Mr=rt.color,fr=Je.color;(Mr||fr)&&(xe.selectedColorFn=function(ve){var ge=ve.mcc||ar;return ve.selected?Mr||ge:fr||ge});var dr=$e.size,pt=rt.size,ze=Je.size,Ge=pt!==void 0,Oe=ze!==void 0;return t.traceIs(Me,"symbols")&&(Ge||Oe)&&(xe.selectedSizeFn=function(ve){var ge=ve.mrc||dr/2;return ve.selected?Ge?pt/2:ge:Oe?ze/2:ge}),xe},l.makeSelectedTextStyleFns=function(Me){var xe={},ce=Me.selected||{},Re=Me.unselected||{},$e=Me.textfont||{},rt=ce.textfont||{},Je=Re.textfont||{},At=$e.color,St=rt.color,Rt=Je.color;return xe.selectedTextColorFn=function(Ut){var ir=Ut.tc||At;return Ut.selected?St||ir:Rt||(St?ir:r.addOpacity(ir,f))},xe},l.selectedPointStyle=function(Me,xe){if(!(!Me.size()||!xe.selectedpoints)){var ce=l.makeSelectedPointStyleFns(xe),Re=xe.marker||{},$e=[];ce.selectedOpacityFn&&$e.push(function(rt,Je){rt.style("opacity",ce.selectedOpacityFn(Je))}),ce.selectedColorFn&&$e.push(function(rt,Je){r.fill(rt,ce.selectedColorFn(Je))}),ce.selectedSizeFn&&$e.push(function(rt,Je){var At=Je.mx||Re.symbol||0,St=ce.selectedSizeFn(Je);rt.attr("d",g(l.symbolNumber(At),St,Xe(Je,xe),ae(Je,xe))),Je.mrc2=St}),$e.length&&Me.each(function(rt){for(var Je=d.select(this),At=0;At<$e.length;At++)$e[At](Je,rt)})}},l.tryColorscale=function(Me,xe){var ce=xe?x.nestedProperty(Me,xe).get():Me;if(ce){var Re=ce.color;if((ce.colorscale||ce._colorAx)&&x.isArrayOrTypedArray(Re))return o.makeColorScaleFuncFromTrace(ce)}return x.identity};var z={start:1,end:-1,middle:0,bottom:1,top:-1};function F(Me,xe,ce,Re,$e){var rt=d.select(Me.node().parentNode),Je=xe.indexOf("top")!==-1?"top":xe.indexOf("bottom")!==-1?"bottom":"middle",At=xe.indexOf("left")!==-1?"end":xe.indexOf("right")!==-1?"start":"middle",St=Re?Re/.8+1:0,Rt=(i.lineCount(Me)-1)*c+1,Ut=z[At]*St,ir=ce*.75+z[Je]*St+(z[Je]-1)*Rt*ce/2;Me.attr("text-anchor",At),$e||rt.attr("transform",a(Ut,ir))}function B(Me,xe){var ce=Me.ts||xe.textfont.size;return E(ce)&&ce>0?ce:0}l.textPointStyle=function(Me,xe,ce){if(Me.size()){var Re;if(xe.selectedpoints){var $e=l.makeSelectedTextStyleFns(xe);Re=$e.selectedTextColorFn}var rt=xe.texttemplate,Je=ce._fullLayout;Me.each(function(At){var St=d.select(this),Rt=rt?x.extractOption(At,xe,"txt","texttemplate"):x.extractOption(At,xe,"tx","text");if(!Rt&&Rt!==0){St.remove();return}if(rt){var Ut=xe._module.formatLabels,ir=Ut?Ut(At,xe,Je):{},ar={};T(ar,xe,At.i);var Mr=xe._meta||{};Rt=x.texttemplateString(Rt,ir,Je._d3locale,ar,At,Mr)}var fr=At.tp||xe.textposition,dr=B(At,xe),pt=Re?Re(At):At.tc||xe.textfont.color;St.call(l.font,{family:At.tf||xe.textfont.family,weight:At.tw||xe.textfont.weight,style:At.ty||xe.textfont.style,variant:At.tv||xe.textfont.variant,textcase:At.tC||xe.textfont.textcase,lineposition:At.tE||xe.textfont.lineposition,shadow:At.tS||xe.textfont.shadow,size:dr,color:pt}).text(Rt).call(i.convertToTspans,ce).call(F,fr,dr,At.mrc)})}},l.selectedTextStyle=function(Me,xe){if(!(!Me.size()||!xe.selectedpoints)){var ce=l.makeSelectedTextStyleFns(xe);Me.each(function(Re){var $e=d.select(this),rt=ce.selectedTextColorFn(Re),Je=Re.tp||xe.textposition,At=B(Re,xe);r.fill($e,rt);var St=t.traceIs(xe,"bar-like");F($e,Je,At,Re.mrc2||Re.mrc,St)})}};var O=.5;l.smoothopen=function(Me,xe){if(Me.length<3)return"M"+Me.join("L");var ce="M"+Me[0],Re=[],$e;for($e=1;$e=St||ve>=Ut&&ve<=St)&&(ge<=ir&&ge>=Rt||ge>=ir&&ge<=Rt)&&(Me=[ve,ge])}return Me}l.applyBackoff=j,l.makeTester=function(){var Me=x.ensureSingleById(d.select("body"),"svg","js-plotly-tester",function(ce){ce.attr(n.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})}),xe=x.ensureSingle(Me,"path","js-reference-point",function(ce){ce.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})});l.tester=Me,l.testref=xe},l.savedBBoxes={};var J=0,$=1e4;l.bBox=function(Me,xe,ce){ce||(ce=X(Me));var Re;if(ce){if(Re=l.savedBBoxes[ce],Re)return x.extendFlat({},Re)}else if(Me.childNodes.length===1){var $e=Me.childNodes[0];if(ce=X($e),ce){var rt=+$e.getAttribute("x")||0,Je=+$e.getAttribute("y")||0,At=$e.getAttribute("transform");if(!At){var St=l.bBox($e,!1,ce);return rt&&(St.left+=rt,St.right+=rt),Je&&(St.top+=Je,St.bottom+=Je),St}if(ce+="~"+rt+"~"+Je+"~"+At,Re=l.savedBBoxes[ce],Re)return x.extendFlat({},Re)}}var Rt,Ut;xe?Rt=Me:(Ut=l.tester.node(),Rt=Me.cloneNode(!0),Ut.appendChild(Rt)),d.select(Rt).attr("transform",null).call(i.positionText,0,0);var ir=Rt.getBoundingClientRect(),ar=l.testref.node().getBoundingClientRect();xe||Ut.removeChild(Rt);var Mr={height:ir.height,width:ir.width,left:ir.left-ar.left,top:ir.top-ar.top,right:ir.right-ar.left,bottom:ir.bottom-ar.top};return J>=$&&(l.savedBBoxes={},J=0),ce&&(l.savedBBoxes[ce]=Mr),J++,x.extendFlat({},Mr)};function X(Me){var xe=Me.getAttribute("data-unformatted");if(xe!==null)return xe+Me.getAttribute("data-math")+Me.getAttribute("text-anchor")+Me.getAttribute("style")}l.setClipUrl=function(Me,xe,ce){Me.attr("clip-path",re(xe,ce))};function re(Me,xe){if(!Me)return null;var ce=xe._context,Re=ce._exportedPlot?"":ce._baseUrl||"";return Re?"url('"+Re+"#"+Me+"')":"url(#"+Me+")"}l.getTranslate=function(Me){var xe=/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,ce=Me.attr?"attr":"getAttribute",Re=Me[ce]("transform")||"",$e=Re.replace(xe,function(rt,Je,At){return[Je,At].join(" ")}).split(" ");return{x:+$e[0]||0,y:+$e[1]||0}},l.setTranslate=function(Me,xe,ce){var Re=/(\btranslate\(.*?\);?)/,$e=Me.attr?"attr":"getAttribute",rt=Me.attr?"attr":"setAttribute",Je=Me[$e]("transform")||"";return xe=xe||0,ce=ce||0,Je=Je.replace(Re,"").trim(),Je+=a(xe,ce),Je=Je.trim(),Me[rt]("transform",Je),Je},l.getScale=function(Me){var xe=/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,ce=Me.attr?"attr":"getAttribute",Re=Me[ce]("transform")||"",$e=Re.replace(xe,function(rt,Je,At){return[Je,At].join(" ")}).split(" ");return{x:+$e[0]||1,y:+$e[1]||1}},l.setScale=function(Me,xe,ce){var Re=/(\bscale\(.*?\);?)/,$e=Me.attr?"attr":"getAttribute",rt=Me.attr?"attr":"setAttribute",Je=Me[$e]("transform")||"";return xe=xe||1,ce=ce||1,Je=Je.replace(Re,"").trim(),Je+="scale("+xe+","+ce+")",Je=Je.trim(),Me[rt]("transform",Je),Je};var ee=/\s*sc.*/;l.setPointGroupScale=function(Me,xe,ce){if(xe=xe||1,ce=ce||1,!!Me){var Re=xe===1&&ce===1?"":"scale("+xe+","+ce+")";Me.each(function(){var $e=(this.getAttribute("transform")||"").replace(ee,"");$e+=Re,$e=$e.trim(),this.setAttribute("transform",$e)})}};var q=/translate\([^)]*\)\s*$/;l.setTextPointsScale=function(Me,xe,ce){Me&&Me.each(function(){var Re,$e=d.select(this),rt=$e.select("text");if(rt.node()){var Je=parseFloat(rt.attr("x")||0),At=parseFloat(rt.attr("y")||0),St=($e.attr("transform")||"").match(q);xe===1&&ce===1?Re=[]:Re=[a(Je,At),"scale("+xe+","+ce+")",a(-Je,-At)],St&&Re.push(St),$e.attr("transform",Re.join(""))}})};function ae(Me,xe){var ce;return Me&&(ce=Me.mf),ce===void 0&&(ce=xe.marker&&xe.marker.standoff||0),!xe._geo&&!xe._xA?-ce:ce}l.getMarkerStandoff=ae;var ie=Math.atan2,fe=Math.cos,we=Math.sin;function Ae(Me,xe){var ce=xe[0],Re=xe[1];return[ce*fe(Me)-Re*we(Me),ce*we(Me)+Re*fe(Me)]}var Fe,Ce,qe,et,Qe,Ke;function Xe(Me,xe){var ce=Me.ma;ce===void 0&&(ce=xe.marker.angle,(!ce||x.isArrayOrTypedArray(ce))&&(ce=0));var Re,$e,rt=xe.marker.angleref;if(rt==="previous"||rt==="north"){if(xe._geo){var Je=xe._geo.project(Me.lonlat);Re=Je[0],$e=Je[1]}else{var At=xe._xA,St=xe._yA;if(At&&St)Re=At.c2p(Me.x),$e=St.c2p(Me.y);else return 90}if(xe._geo){var Rt=Me.lonlat[0],Ut=Me.lonlat[1],ir=xe._geo.project([Rt,Ut+1e-5]),ar=xe._geo.project([Rt+1e-5,Ut]),Mr=ie(ar[1]-$e,ar[0]-Re),fr=ie(ir[1]-$e,ir[0]-Re),dr;if(rt==="north")dr=ce/180*Math.PI;else if(rt==="previous"){var pt=Rt/180*Math.PI,ze=Ut/180*Math.PI,Ge=Fe/180*Math.PI,Oe=Ce/180*Math.PI,ve=Ge-pt,ge=fe(Oe)*we(ve),be=we(Oe)*fe(ze)-fe(Oe)*we(ze)*fe(ve);dr=-ie(ge,be)-Math.PI,Fe=Rt,Ce=Ut}var Pe=Ae(Mr,[fe(dr),0]),We=Ae(fr,[we(dr),0]);ce=ie(Pe[1]+We[1],Pe[0]+We[0])/Math.PI*180,rt==="previous"&&!(Ke===xe.uid&&Me.i===Qe+1)&&(ce=null)}if(rt==="previous"&&!xe._geo)if(Ke===xe.uid&&Me.i===Qe+1&&E(Re)&&E($e)){var ct=Re-qe,_t=$e-et,Mt=xe.line&&xe.line.shape||"",Nt=Mt.slice(Mt.length-1);Nt==="h"&&(_t=0),Nt==="v"&&(ct=0),ce+=ie(_t,ct)/Math.PI*180+90}else ce=null}return qe=Re,et=$e,Qe=Me.i,Ke=xe.uid,ce}l.getMarkerAngle=Xe}}),kp=He({"src/components/titles/index.js"(Y,G){var d=Qn(),x=Hi(),A=yu(),E=Ei(),e=Gr(),t=e.strTranslate,r=vo(),o=Ai(),a=yl(),i=Bd(),n=df().OPPOSITE_SIDE,s=/ [XY][0-9]* /,c=1.6,f=1.6;function v(h,T,l){var y=h._fullLayout,b=l.propContainer,S=l.propName,M=l.placeholder,_=l.traceIndex,w=l.avoid||{},p=l.attributes,u=l.transform,g=l.containerGroup,m=1,R=b.title,P=(R&&R.text?R.text:"").trim(),z=!1,F=R&&R.font?R.font:{},B=F.family,O=F.size,L=F.color,N=F.weight,U=F.style,Z=F.variant,Q=F.textcase,ue=F.lineposition,oe=F.shadow,le=l.subtitlePropName,j=!!le,J=l.subtitlePlaceholder,$=(b.title||{}).subtitle||{text:"",font:{}},X=$.text.trim(),re=!1,ee=1,q=$.font,ae=q.family,ie=q.size,fe=q.color,we=q.weight,Ae=q.style,Fe=q.variant,Ce=q.textcase,qe=q.lineposition,et=q.shadow,Qe;S==="title.text"?Qe="titleText":S.indexOf("axis")!==-1?Qe="axisTitleText":S.indexOf("colorbar"!==-1)&&(Qe="colorbarTitleText");var Ke=h._context.edits[Qe];function Xe(ar,Mr){return ar===void 0||Mr===void 0?!1:ar.replace(s," % ")===Mr.replace(s," % ")}P===""?m=0:Xe(P,M)&&(Ke||(P=""),m=.2,z=!0),j&&(X===""?ee=0:Xe(X,J)&&(Ke||(X=""),ee=.2,re=!0)),l._meta?P=e.templateString(P,l._meta):y._meta&&(P=e.templateString(P,y._meta));var Me=P||X||Ke,xe;g||(g=e.ensureSingle(y._infolayer,"g","g-"+T),xe=y._hColorbarMoveTitle);var ce=g.selectAll("text."+T).data(Me?[0]:[]);ce.enter().append("text"),ce.text(P).attr("class",T),ce.exit().remove();var Re=null,$e=T+"-subtitle",rt=X||Ke;if(j&&rt&&(Re=g.selectAll("text."+$e).data(rt?[0]:[]),Re.enter().append("text"),Re.text(X).attr("class",$e),Re.exit().remove()),!Me)return g;function Je(ar,Mr){e.syncOrAsync([At,St],{title:ar,subtitle:Mr})}function At(ar){var Mr=ar.title,fr=ar.subtitle,dr;!u&&xe&&(u={}),u?(dr="",u.rotate&&(dr+="rotate("+[u.rotate,p.x,p.y]+")"),(u.offset||xe)&&(dr+=t(0,(u.offset||0)-(xe||0)))):dr=null,Mr.attr("transform",dr);function pt(be){if(be){var Pe=d.select(be.node().parentNode).select("."+$e);if(!Pe.empty()){var We=be.node().getBBox();if(We.height){var ct=We.y+We.height+c*ie;Pe.attr("y",ct)}}}}if(Mr.style("opacity",m*o.opacity(L)).call(r.font,{color:o.rgb(L),size:d.round(O,2),family:B,weight:N,style:U,variant:Z,textcase:Q,shadow:oe,lineposition:ue}).attr(p).call(a.convertToTspans,h,pt),fr){var ze=g.select("."+T+"-math-group"),Ge=Mr.node().getBBox(),Oe=ze.node()?ze.node().getBBox():void 0,ve=Oe?Oe.y+Oe.height+c*ie:Ge.y+Ge.height+f*ie,ge=e.extendFlat({},p,{y:ve});fr.attr("transform",dr),fr.style("opacity",ee*o.opacity(fe)).call(r.font,{color:o.rgb(fe),size:d.round(ie,2),family:ae,weight:we,style:Ae,variant:Fe,textcase:Ce,shadow:et,lineposition:qe}).attr(ge).call(a.convertToTspans,h)}return A.previousPromises(h)}function St(ar){var Mr=ar.title,fr=d.select(Mr.node().parentNode);if(w&&w.selection&&w.side&&P){fr.attr("transform",null);var dr=n[w.side],pt=w.side==="left"||w.side==="top"?-1:1,ze=x(w.pad)?w.pad:2,Ge=r.bBox(fr.node()),Oe={t:0,b:0,l:0,r:0},ve=h._fullLayout._reservedMargin;for(var ge in ve)for(var be in ve[ge]){var Pe=ve[ge][be];Oe[be]=Math.max(Oe[be],Pe)}var We={left:Oe.l,top:Oe.t,right:y.width-Oe.r,bottom:y.height-Oe.b},ct=w.maxShift||pt*(We[w.side]-Ge[w.side]),_t=0;if(ct<0)_t=ct;else{var Mt=w.offsetLeft||0,Nt=w.offsetTop||0;Ge.left-=Mt,Ge.right-=Mt,Ge.top-=Nt,Ge.bottom-=Nt,w.selection.each(function(){var qt=r.bBox(this);e.bBoxIntersect(Ge,qt,ze)&&(_t=Math.max(_t,pt*(qt[w.side]-Ge[dr])+ze))}),_t=Math.min(ct,_t),b._titleScoot=Math.abs(_t)}if(_t>0||ct<0){var Bt={left:[-_t,0],right:[_t,0],top:[0,-_t],bottom:[0,_t]}[w.side];fr.attr("transform",t(Bt[0],Bt[1]))}}}ce.call(Je,Re);function Rt(ar,Mr){ar.text(Mr).on("mouseover.opacity",function(){d.select(this).transition().duration(i.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){d.select(this).transition().duration(i.HIDE_PLACEHOLDER).style("opacity",0)})}if(Ke&&(P?ce.on(".opacity",null):(Rt(ce,M),z=!0),ce.call(a.makeEditable,{gd:h}).on("edit",function(ar){_!==void 0?E.call("_guiRestyle",h,S,ar,_):E.call("_guiRelayout",h,S,ar)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Je)}).on("input",function(ar){this.text(ar||" ").call(a.positionText,p.x,p.y)}),j)){if(j&&!P){var Ut=ce.node().getBBox(),ir=Ut.y+Ut.height+f*ie;Re.attr("y",ir)}X?Re.on(".opacity",null):(Rt(Re,J),re=!0),Re.call(a.makeEditable,{gd:h}).on("edit",function(ar){E.call("_guiRelayout",h,"title.subtitle.text",ar)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(Je)}).on("input",function(ar){this.text(ar||" ").call(a.positionText,Re.attr("x"),Re.attr("y"))})}return ce.classed("js-placeholder",z),Re&&Re.classed("js-placeholder",re),g}G.exports={draw:v,SUBTITLE_PADDING_EM:f,SUBTITLE_PADDING_MATHJAX_EM:c}}}),Uv=He({"src/plots/cartesian/set_convert.js"(Y,G){var d=Qn(),x=Xl().utcFormat,A=Gr(),E=A.numberFormat,e=Hi(),t=A.cleanNumber,r=A.ms2DateTime,o=A.dateTime2ms,a=A.ensureNumber,i=A.isArrayOrTypedArray,n=lo(),s=n.FP_SAFE,c=n.BADNUM,f=n.LOG_CLIP,v=n.ONEWEEK,h=n.ONEDAY,T=n.ONEHOUR,l=n.ONEMIN,y=n.ONESEC,b=oc(),S=Ef(),M=S.HOUR_PATTERN,_=S.WEEKDAY_PATTERN;function w(u){return Math.pow(10,u)}function p(u){return u!=null}G.exports=function(g,m){m=m||{};var R=g._id||"x",P=R.charAt(0);function z(X,re){if(X>0)return Math.log(X)/Math.LN10;if(X<=0&&re&&g.range&&g.range.length===2){var ee=g.range[0],q=g.range[1];return .5*(ee+q-2*f*Math.abs(ee-q))}else return c}function F(X,re,ee,q){if((q||{}).msUTC&&e(X))return+X;var ae=o(X,ee||g.calendar);if(ae===c)if(e(X)){X=+X;var ie=Math.floor(A.mod(X+.05,1)*10),fe=Math.round(X-ie/10);ae=o(new Date(fe))+ie/10}else return c;return ae}function B(X,re,ee){return r(X,re,ee||g.calendar)}function O(X){return g._categories[Math.round(X)]}function L(X){if(p(X)){if(g._categoriesMap===void 0&&(g._categoriesMap={}),g._categoriesMap[X]!==void 0)return g._categoriesMap[X];g._categories.push(typeof X=="number"?String(X):X);var re=g._categories.length-1;return g._categoriesMap[X]=re,re}return c}function N(X,re){for(var ee=new Array(re),q=0;qg.range[1]&&(ee=!ee);for(var q=ee?-1:1,ae=q*X,ie=0,fe=0;feAe)ie=fe+1;else{ie=ae<(we+Ae)/2?fe:fe+1;break}}var Fe=g._B[ie]||0;return isFinite(Fe)?ue(X,g._m2,Fe):0},j=function(X){var re=g._rangebreaks.length;if(!re)return oe(X,g._m,g._b);for(var ee=0,q=0;qg._rangebreaks[q].pmax&&(ee=q+1);return oe(X,g._m2,g._B[ee])}}g.c2l=g.type==="log"?z:a,g.l2c=g.type==="log"?w:a,g.l2p=le,g.p2l=j,g.c2p=g.type==="log"?function(X,re){return le(z(X,re))}:le,g.p2c=g.type==="log"?function(X){return w(j(X))}:j,["linear","-"].indexOf(g.type)!==-1?(g.d2r=g.r2d=g.d2c=g.r2c=g.d2l=g.r2l=t,g.c2d=g.c2r=g.l2d=g.l2r=a,g.d2p=g.r2p=function(X){return g.l2p(t(X))},g.p2d=g.p2r=j,g.cleanPos=a):g.type==="log"?(g.d2r=g.d2l=function(X,re){return z(t(X),re)},g.r2d=g.r2c=function(X){return w(t(X))},g.d2c=g.r2l=t,g.c2d=g.l2r=a,g.c2r=z,g.l2d=w,g.d2p=function(X,re){return g.l2p(g.d2r(X,re))},g.p2d=function(X){return w(j(X))},g.r2p=function(X){return g.l2p(t(X))},g.p2r=j,g.cleanPos=a):g.type==="date"?(g.d2r=g.r2d=A.identity,g.d2c=g.r2c=g.d2l=g.r2l=F,g.c2d=g.c2r=g.l2d=g.l2r=B,g.d2p=g.r2p=function(X,re,ee){return g.l2p(F(X,0,ee))},g.p2d=g.p2r=function(X,re,ee){return B(j(X),re,ee)},g.cleanPos=function(X){return A.cleanDate(X,c,g.calendar)}):g.type==="category"?(g.d2c=g.d2l=L,g.r2d=g.c2d=g.l2d=O,g.d2r=g.d2l_noadd=Z,g.r2c=function(X){var re=Q(X);return re!==void 0?re:g.fraction2r(.5)},g.l2r=g.c2r=a,g.r2l=Q,g.d2p=function(X){return g.l2p(g.r2c(X))},g.p2d=function(X){return O(j(X))},g.r2p=g.d2p,g.p2r=j,g.cleanPos=function(X){return typeof X=="string"&&X!==""?X:a(X)}):g.type==="multicategory"&&(g.r2d=g.c2d=g.l2d=O,g.d2r=g.d2l_noadd=Z,g.r2c=function(X){var re=Z(X);return re!==void 0?re:g.fraction2r(.5)},g.r2c_just_indices=U,g.l2r=g.c2r=a,g.r2l=Z,g.d2p=function(X){return g.l2p(g.r2c(X))},g.p2d=function(X){return O(j(X))},g.r2p=g.d2p,g.p2r=j,g.cleanPos=function(X){return Array.isArray(X)||typeof X=="string"&&X!==""?X:a(X)},g.setupMultiCategory=function(X){var re=g._traceIndices,ee,q,ae=g._matchGroup;if(ae&&g._categories.length===0){for(var ie in ae)if(ie!==R){var fe=m[b.id2name(ie)];re=re.concat(fe._traceIndices)}}var we=[[0,{}],[0,{}]],Ae=[];for(ee=0;eefe[1]&&(q[ie?0:1]=ee),q[0]===q[1]){var we=g.l2r(re),Ae=g.l2r(ee);if(re!==void 0){var Fe=we+1;ee!==void 0&&(Fe=Math.min(Fe,Ae)),q[ie?1:0]=Fe}if(ee!==void 0){var Ce=Ae+1;re!==void 0&&(Ce=Math.max(Ce,we)),q[ie?0:1]=Ce}}}},g.cleanRange=function(X,re){g._cleanRange(X,re),g.limitRange(X)},g._cleanRange=function(X,re){re||(re={}),X||(X="range");var ee=A.nestedProperty(g,X).get(),q,ae;if(g.type==="date"?ae=A.dfltRange(g.calendar):P==="y"?ae=S.DFLTRANGEY:g._name==="realaxis"?ae=[0,1]:ae=re.dfltRange||S.DFLTRANGEX,ae=ae.slice(),(g.rangemode==="tozero"||g.rangemode==="nonnegative")&&(ae[0]=0),!ee||ee.length!==2){A.nestedProperty(g,X).set(ae);return}var ie=ee[0]===null,fe=ee[1]===null;for(g.type==="date"&&!g.autorange&&(ee[0]=A.cleanDate(ee[0],c,g.calendar),ee[1]=A.cleanDate(ee[1],c,g.calendar)),q=0;q<2;q++)if(g.type==="date"){if(!A.isDateTime(ee[q],g.calendar)){g[X]=ae;break}if(g.r2l(ee[0])===g.r2l(ee[1])){var we=A.constrain(g.r2l(ee[0]),A.MIN_MS+1e3,A.MAX_MS-1e3);ee[0]=g.l2r(we-1e3),ee[1]=g.l2r(we+1e3);break}}else{if(!e(ee[q]))if(!(ie||fe)&&e(ee[1-q]))ee[q]=ee[1-q]*(q?10:.1);else{g[X]=ae;break}if(ee[q]<-s?ee[q]=-s:ee[q]>s&&(ee[q]=s),ee[0]===ee[1]){var Ae=Math.max(1,Math.abs(ee[0]*1e-6));ee[0]-=Ae,ee[1]+=Ae}}},g.setScale=function(X){var re=m._size;if(g.overlaying){var ee=b.getFromId({_fullLayout:m},g.overlaying);g.domain=ee.domain}var q=X&&g._r?"_r":"range",ae=g.calendar;g.cleanRange(q);var ie=g.r2l(g[q][0],ae),fe=g.r2l(g[q][1],ae),we=P==="y";if(we?(g._offset=re.t+(1-g.domain[1])*re.h,g._length=re.h*(g.domain[1]-g.domain[0]),g._m=g._length/(ie-fe),g._b=-g._m*fe):(g._offset=re.l+g.domain[0]*re.w,g._length=re.w*(g.domain[1]-g.domain[0]),g._m=g._length/(fe-ie),g._b=-g._m*ie),g._rangebreaks=[],g._lBreaks=0,g._m2=0,g._B=[],g.rangebreaks){var Ae,Fe;if(g._rangebreaks=g.locateBreaks(Math.min(ie,fe),Math.max(ie,fe)),g._rangebreaks.length){for(Ae=0;Aefe&&(Ce=!Ce),Ce&&g._rangebreaks.reverse();var qe=Ce?-1:1;for(g._m2=qe*g._length/(Math.abs(fe-ie)-g._lBreaks),g._B.push(-g._m2*(we?fe:ie)),Ae=0;Aeae&&(ae+=7,ieae&&(ae+=24,ie=q&&ie=q&&X=Je.min&&(ceJe.max&&(Je.max=Re),$e=!1)}$e&&fe.push({min:ce,max:Re})}};for(ee=0;eey*2}function n(f){return Math.max(1,(f-1)/1e3)}function s(f,v){for(var h=f.length,T=n(h),l=0,y=0,b={},S=0;Sl*2}function c(f){return E(f[0])&&E(f[1])}}}),_v=He({"src/plots/cartesian/autorange.js"(Y,G){var d=Qn(),x=Hi(),A=Gr(),E=lo().FP_SAFE,e=Ei(),t=vo(),r=oc(),o=r.getFromId,a=r.isLinked;G.exports={applyAutorangeOptions:g,getAutoRange:i,makePadFn:s,doAutoRange:h,findExtremes:T,concatExtremes:v};function i(m,R){var P,z,F=[],B=m._fullLayout,O=s(B,R,0),L=s(B,R,1),N=v(m,R),U=N.min,Z=N.max;if(U.length===0||Z.length===0)return A.simpleMap(R.range,R.r2l);var Q=U[0].val,ue=Z[0].val;for(P=1;P0&&(Ae=re-O(ae)-L(ie),Ae>ee?Fe/Ae>q&&(fe=ae,we=ie,q=Fe/Ae):Fe/re>q&&(fe={val:ae.val,nopad:1},we={val:ie.val,nopad:1},q=Fe/re));function Ce(Xe,Me){return Math.max(Xe,L(Me))}if(Q===ue){var qe=Q-1,et=Q+1;if($)if(Q===0)F=[0,1];else{var Qe=(Q>0?Z:U).reduce(Ce,0),Ke=Q/(1-Math.min(.5,Qe/re));F=Q>0?[0,Ke]:[Ke,0]}else X?F=[Math.max(0,qe),Math.max(1,et)]:F=[qe,et]}else $?(fe.val>=0&&(fe={val:0,nopad:1}),we.val<=0&&(we={val:0,nopad:1})):X&&(fe.val-q*O(fe)<0&&(fe={val:0,nopad:1}),we.val<=0&&(we={val:1,nopad:1})),q=(we.val-fe.val-n(R,ae.val,ie.val))/(re-O(fe)-L(we)),F=[fe.val-q*O(fe),we.val+q*L(we)];return F=g(F,R),R.limitRange&&R.limitRange(),le&&F.reverse(),A.simpleMap(F,R.l2r||Number)}function n(m,R,P){var z=0;if(m.rangebreaks)for(var F=m.locateBreaks(R,P),B=0;B0?P.ppadplus:P.ppadminus)||P.ppad||0),ae=ee((m._m>0?P.ppadminus:P.ppadplus)||P.ppad||0),ie=ee(P.vpadplus||P.vpad),fe=ee(P.vpadminus||P.vpad);if(!U){if(X=1/0,re=-1/0,N)for(Q=0;Q0&&(X=ue),ue>re&&ue-E&&(X=ue),ue>re&&ue=Fe;Q--)Ae(Q);return{min:z,max:F,opts:P}}function l(m,R,P,z){b(m,R,P,z,M)}function y(m,R,P,z){b(m,R,P,z,_)}function b(m,R,P,z,F){for(var B=z.tozero,O=z.extrapad,L=!0,N=0;N=P&&(U.extrapad||!O)){L=!1;break}else F(R,U.val)&&U.pad<=P&&(O||!U.extrapad)&&(m.splice(N,1),N--)}if(L){var Z=B&&R===0;m.push({val:R,pad:Z?0:P,extrapad:Z?!1:O})}}function S(m){return x(m)&&Math.abs(m)=R}function w(m,R){var P=R.autorangeoptions;return P&&P.minallowed!==void 0&&u(R,P.minallowed,P.maxallowed)?P.minallowed:P&&P.clipmin!==void 0&&u(R,P.clipmin,P.clipmax)?Math.max(m,R.d2l(P.clipmin)):m}function p(m,R){var P=R.autorangeoptions;return P&&P.maxallowed!==void 0&&u(R,P.minallowed,P.maxallowed)?P.maxallowed:P&&P.clipmax!==void 0&&u(R,P.clipmin,P.clipmax)?Math.min(m,R.d2l(P.clipmax)):m}function u(m,R,P){return R!==void 0&&P!==void 0?(R=m.d2l(R),P=m.d2l(P),R=N&&(B=N,P=N),O<=N&&(O=N,z=N)}}return P=w(P,R),z=p(z,R),[P,z]}}}),io=He({"src/plots/cartesian/axes.js"(Y,G){var d=Qn(),x=Hi(),A=yu(),E=Ei(),e=Gr(),t=e.strTranslate,r=yl(),o=kp(),a=Ai(),i=vo(),n=jf(),s=wb(),c=lo(),f=c.ONEMAXYEAR,v=c.ONEAVGYEAR,h=c.ONEMINYEAR,T=c.ONEMAXQUARTER,l=c.ONEAVGQUARTER,y=c.ONEMINQUARTER,b=c.ONEMAXMONTH,S=c.ONEAVGMONTH,M=c.ONEMINMONTH,_=c.ONEWEEK,w=c.ONEDAY,p=w/2,u=c.ONEHOUR,g=c.ONEMIN,m=c.ONESEC,R=c.ONEMILLI,P=c.ONEMICROSEC,z=c.MINUS_SIGN,F=c.BADNUM,B={K:"zeroline"},O={K:"gridline",L:"path"},L={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},U={K:"tick",L:"text"},Z={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},Q=df(),ue=Q.MID_SHIFT,oe=Q.CAP_SHIFT,le=Q.LINE_SPACING,j=Q.OPPOSITE_SIDE,J=3,$=G.exports={};$.setConvert=Uv();var X=N0(),re=oc(),ee=re.idSort,q=re.isLinked;$.id2name=re.id2name,$.name2id=re.name2id,$.cleanId=re.cleanId,$.list=re.list,$.listIds=re.listIds,$.getFromId=re.getFromId,$.getFromTrace=re.getFromTrace;var ae=_v();$.getAutoRange=ae.getAutoRange,$.findExtremes=ae.findExtremes;var ie=1e-4;function fe(dt){var vt=(dt[1]-dt[0])*ie;return[dt[0]-vt,dt[1]+vt]}$.coerceRef=function(dt,vt,Lr,Er,_r,yr){var kr=Er.charAt(Er.length-1),zr=Lr._fullLayout._subplots[kr+"axis"],Pr=Er+"ref",Hr={};return _r||(_r=zr[0]||(typeof yr=="string"?yr:yr[0])),yr||(yr=_r),zr=zr.concat(zr.map(function(Zr){return Zr+" domain"})),Hr[Pr]={valType:"enumerated",values:zr.concat(yr?typeof yr=="string"?[yr]:yr:[]),dflt:_r},e.coerce(dt,vt,Hr,Pr)},$.getRefType=function(dt){return dt===void 0?dt:dt==="paper"?"paper":dt==="pixel"?"pixel":/( domain)$/.test(dt)?"domain":"range"},$.coercePosition=function(dt,vt,Lr,Er,_r,yr){var kr,zr,Pr=$.getRefType(Er);if(Pr!=="range")kr=e.ensureNumber,zr=Lr(_r,yr);else{var Hr=$.getFromId(vt,Er);yr=Hr.fraction2r(yr),zr=Lr(_r,yr),kr=Hr.cleanPos}dt[_r]=kr(zr)},$.cleanPosition=function(dt,vt,Lr){var Er=Lr==="paper"||Lr==="pixel"?e.ensureNumber:$.getFromId(vt,Lr).cleanPos;return Er(dt)},$.redrawComponents=function(dt,vt){vt=vt||$.listIds(dt);var Lr=dt._fullLayout;function Er(_r,yr,kr,zr){for(var Pr=E.getComponentMethod(_r,yr),Hr={},Zr=0;Zr2e-6||((Lr-dt._forceTick0)/dt._minDtick%1+1.000001)%1>2e-6)&&(dt._minDtick=0))},$.saveRangeInitial=function(dt,vt){for(var Lr=$.list(dt,"",!0),Er=!1,_r=0;_rJr*.3||Hr(Er)||Hr(_r))){var wt=Lr.dtick/2;dt+=dt+wtkr){var zr=Number(Lr.substr(1));yr.exactYears>kr&&zr%12===0?dt=$.tickIncrement(dt,"M6","reverse")+w*1.5:yr.exactMonths>kr?dt=$.tickIncrement(dt,"M1","reverse")+w*15.5:dt-=p;var Pr=$.tickIncrement(dt,Lr);if(Pr<=Er)return Pr}return dt}$.prepMinorTicks=function(dt,vt,Lr){if(!vt.minor.dtick){delete dt.dtick;var Er=vt.dtick&&x(vt._tmin),_r;if(Er){var yr=$.tickIncrement(vt._tmin,vt.dtick,!0);_r=[vt._tmin,yr*.99+vt._tmin*.01]}else{var kr=e.simpleMap(vt.range,vt.r2l);_r=[kr[0],.8*kr[0]+.2*kr[1]]}if(dt.range=e.simpleMap(_r,vt.l2r),dt._isMinor=!0,$.prepTicks(dt,Lr),Er){var zr=x(vt.dtick),Pr=x(dt.dtick),Hr=zr?vt.dtick:+vt.dtick.substring(1),Zr=Pr?dt.dtick:+dt.dtick.substring(1);zr&&Pr?et(Hr,Zr)?Hr===2*_&&Zr===2*w&&(dt.dtick=_):Hr===2*_&&Zr===3*w?dt.dtick=_:Hr===_&&!(vt._input.minor||{}).nticks?dt.dtick=w:Qe(Hr/Zr,2.5)?dt.dtick=Hr/2:dt.dtick=Hr:String(vt.dtick).charAt(0)==="M"?Pr?dt.dtick="M1":et(Hr,Zr)?Hr>=12&&Zr===2&&(dt.dtick="M3"):dt.dtick=vt.dtick:String(dt.dtick).charAt(0)==="L"?String(vt.dtick).charAt(0)==="L"?et(Hr,Zr)||(dt.dtick=Qe(Hr/Zr,2.5)?vt.dtick/2:vt.dtick):dt.dtick="D1":dt.dtick==="D2"&&+vt.dtick>1&&(dt.dtick=1)}dt.range=vt.range}vt.minor._tick0Init===void 0&&(dt.tick0=vt.tick0)};function et(dt,vt){return Math.abs((dt/vt+.5)%1-.5)<.001}function Qe(dt,vt){return Math.abs(dt/vt-1)<.001}$.prepTicks=function(dt,vt){var Lr=e.simpleMap(dt.range,dt.r2l,void 0,void 0,vt);if(dt.tickmode==="auto"||!dt.dtick){var Er=dt.nticks,_r;Er||(dt.type==="category"||dt.type==="multicategory"?(_r=dt.tickfont?e.bigFont(dt.tickfont.size||12):15,Er=dt._length/_r):(_r=dt._id.charAt(0)==="y"?40:80,Er=e.constrain(dt._length/_r,4,9)+1),dt._name==="radialaxis"&&(Er*=2)),dt.minor&&dt.minor.tickmode!=="array"||dt.tickmode==="array"&&(Er*=100),dt._roughDTick=Math.abs(Lr[1]-Lr[0])/Er,$.autoTicks(dt,dt._roughDTick),dt._minDtick>0&&dt.dtick0?(yr=Er-1,kr=Er):(yr=Er,kr=Er);var zr=dt[yr].value,Pr=dt[kr].value,Hr=Math.abs(Pr-zr),Zr=Lr||Hr,Jr=0;Zr>=h?Hr>=h&&Hr<=f?Jr=Hr:Jr=v:Lr===l&&Zr>=y?Hr>=y&&Hr<=T?Jr=Hr:Jr=l:Zr>=M?Hr>=M&&Hr<=b?Jr=Hr:Jr=S:Lr===_&&Zr>=_?Jr=_:Zr>=w?Jr=w:Lr===p&&Zr>=p?Jr=p:Lr===u&&Zr>=u&&(Jr=u);var wt;Jr>=Hr&&(Jr=Hr,wt=!0);var Qt=_r+Jr;if(vt.rangebreaks&&Jr>0){for(var mr=84,$r=0,oa=0;oa_&&(Jr=Hr)}(Jr>0||Er===0)&&(dt[Er].periodX=_r+Jr/2)}}$.calcTicks=function(vt,Lr){for(var Er=vt.type,_r=vt.calendar,yr=vt.ticklabelstep,kr=vt.ticklabelmode==="period",zr=vt.range[0]>vt.range[1],Pr=!vt.ticklabelindex||e.isArrayOrTypedArray(vt.ticklabelindex)?vt.ticklabelindex:[vt.ticklabelindex],Hr=e.simpleMap(vt.range,vt.r2l,void 0,void 0,Lr),Zr=Hr[1]=(ra?0:1);pa--){var pn=!pa;pa?(vt._dtickInit=vt.dtick,vt._tick0Init=vt.tick0):(vt.minor._dtickInit=vt.minor.dtick,vt.minor._tick0Init=vt.minor.tick0);var Ga=pa?vt:e.extendFlat({},vt,vt.minor);if(pn?$.prepMinorTicks(Ga,vt,Lr):$.prepTicks(Ga,Lr),Ga.tickmode==="array"){pa?(oa=[],mr=Re(vt,!pn)):(Sa=[],$r=Re(vt,!pn));continue}if(Ga.tickmode==="sync"){oa=[],mr=ce(vt);continue}var qn=fe(Hr),Vn=qn[0],di=qn[1],yi=x(Ga.dtick),Ci=Er==="log"&&!(yi||Ga.dtick.charAt(0)==="L"),ci=$.tickFirst(Ga,Lr);if(pa){if(vt._tmin=ci,ci=di:mi<=di;mi=$.tickIncrement(mi,Wo,Zr,_r)){if(pa&&uo++,Ga.rangebreaks&&!Zr){if(mi=wt)break}if(oa.length>Qt||mi===ei)break;ei=mi;var li={value:mi};pa?(Ci&&mi!==(mi|0)&&(li.simpleLabel=!0),yr>1&&uo%yr&&(li.skipLabel=!0),oa.push(li)):(li.minor=!0,Sa.push(li))}}if(!Sa||Sa.length<2)Pr=!1;else{var Ii=(Sa[1].value-Sa[0].value)*(zr?-1:1);Oa(Ii,vt.tickformat)||(Pr=!1)}if(!Pr)ya=oa;else{var xi=oa.concat(Sa);kr&&oa.length&&(xi=xi.slice(1)),xi=xi.sort(function(Pi,zo){return Pi.value-zo.value}).filter(function(Pi,zo,wo){return zo===0||Pi.value!==wo[zo-1].value});var Ao=xi.map(function(Pi,zo){return Pi.minor===void 0&&!Pi.skipLabel?zo:null}).filter(function(Pi){return Pi!==null});Ao.forEach(function(Pi){Pr.map(function(zo){var wo=Pi+zo;wo>=0&&wo-1;Qa--){if(oa[Qa].drop){oa.splice(Qa,1);continue}oa[Qa].value=Ur(oa[Qa].value,vt);var Ui=vt.c2p(oa[Qa].value);(Jn?ds>Ui-Os:dswt||biwt&&(wo.periodX=wt),bi_r&&wtv)vt/=v,Er=_r(10),dt.dtick="M"+12*ir(vt,Er,$e);else if(yr>S)vt/=S,dt.dtick="M"+ir(vt,1,rt);else if(yr>w){if(dt.dtick=ir(vt,w,dt._hasDayOfWeekBreaks?[1,2,7,14]:At),!Lr){var kr=$.getTickFormat(dt),zr=dt.ticklabelmode==="period";zr&&(dt._rawTick0=dt.tick0),/%[uVW]/.test(kr)?dt.tick0=e.dateTick0(dt.calendar,2):dt.tick0=e.dateTick0(dt.calendar,1),zr&&(dt._dowTick0=dt.tick0)}}else yr>u?dt.dtick=ir(vt,u,rt):yr>g?dt.dtick=ir(vt,g,Je):yr>m?dt.dtick=ir(vt,m,Je):(Er=_r(10),dt.dtick=ir(vt,Er,$e))}else if(dt.type==="log"){dt.tick0=0;var Pr=e.simpleMap(dt.range,dt.r2l);if(dt._isMinor&&(vt*=1.5),vt>.7)dt.dtick=Math.ceil(vt);else if(Math.abs(Pr[1]-Pr[0])<1){var Hr=1.5*Math.abs((Pr[1]-Pr[0])/vt);vt=Math.abs(Math.pow(10,Pr[1])-Math.pow(10,Pr[0]))/Hr,Er=_r(10),dt.dtick="L"+ir(vt,Er,$e)}else dt.dtick=vt>.3?"D2":"D1"}else dt.type==="category"||dt.type==="multicategory"?(dt.tick0=0,dt.dtick=Math.ceil(Math.max(vt,1))):na(dt)?(dt.tick0=0,Er=1,dt.dtick=ir(vt,Er,Ut)):(dt.tick0=0,Er=_r(10),dt.dtick=ir(vt,Er,$e));if(dt.dtick===0&&(dt.dtick=1),!x(dt.dtick)&&typeof dt.dtick!="string"){var Zr=dt.dtick;throw dt.dtick=1,"ax.dtick error: "+String(Zr)}};function ar(dt){var vt=dt.dtick;if(dt._tickexponent=0,!x(vt)&&typeof vt!="string"&&(vt=1),(dt.type==="category"||dt.type==="multicategory")&&(dt._tickround=null),dt.type==="date"){var Lr=dt.r2l(dt.tick0),Er=dt.l2r(Lr).replace(/(^-|i)/g,""),_r=Er.length;if(String(vt).charAt(0)==="M")_r>10||Er.substr(5)!=="01-01"?dt._tickround="d":dt._tickround=+vt.substr(1)%12===0?"y":"m";else if(vt>=w&&_r<=10||vt>=w*15)dt._tickround="d";else if(vt>=g&&_r<=16||vt>=u)dt._tickround="M";else if(vt>=m&&_r<=19||vt>=g)dt._tickround="S";else{var yr=dt.l2r(Lr+vt).replace(/^-/,"").length;dt._tickround=Math.max(_r,yr)-20,dt._tickround<0&&(dt._tickround=4)}}else if(x(vt)||vt.charAt(0)==="L"){var kr=dt.range.map(dt.r2d||Number);x(vt)||(vt=Number(vt.substr(1))),dt._tickround=2-Math.floor(Math.log(vt)/Math.LN10+.01);var zr=Math.max(Math.abs(kr[0]),Math.abs(kr[1])),Pr=Math.floor(Math.log(zr)/Math.LN10+.01),Hr=dt.minexponent===void 0?3:dt.minexponent;Math.abs(Pr)>Hr&&(be(dt.exponentformat)&&!Pe(Pr)?dt._tickexponent=3*Math.round((Pr-1)/3):dt._tickexponent=Pr)}else dt._tickround=null}$.tickIncrement=function(dt,vt,Lr,Er){var _r=Lr?-1:1;if(x(vt))return e.increment(dt,_r*vt);var yr=vt.charAt(0),kr=_r*Number(vt.substr(1));if(yr==="M")return e.incrementMonth(dt,kr,Er);if(yr==="L")return Math.log(Math.pow(10,dt)+kr)/Math.LN10;if(yr==="D"){var zr=vt==="D2"?Rt:St,Pr=dt+_r*.01,Hr=e.roundUp(e.mod(Pr,1),zr,Lr);return Math.floor(Pr)+Math.log(d.round(Math.pow(10,Hr),1))/Math.LN10}throw"unrecognized dtick "+String(vt)},$.tickFirst=function(dt,vt){var Lr=dt.r2l||Number,Er=e.simpleMap(dt.range,Lr,void 0,void 0,vt),_r=Er[1]=0&&Sa<=dt._length?oa:null};if(yr&&e.isArrayOrTypedArray(dt.ticktext)){var Jr=e.simpleMap(dt.range,dt.r2l),wt=(Math.abs(Jr[1]-Jr[0])-(dt._lBreaks||0))/1e4;for(Hr=0;Hr"+zr;else{var Hr=ga(dt),Zr=dt._trueSide||dt.side;(!Hr&&Zr==="top"||Hr&&Zr==="bottom")&&(kr+="
")}vt.text=kr}function dr(dt,vt,Lr,Er,_r){var yr=dt.dtick,kr=vt.x,zr=dt.tickformat,Pr=typeof yr=="string"&&yr.charAt(0);if(_r==="never"&&(_r=""),Er&&Pr!=="L"&&(yr="L3",Pr="L"),zr||Pr==="L")vt.text=We(Math.pow(10,kr),dt,_r,Er);else if(x(yr)||Pr==="D"&&e.mod(kr+.01,1)<.1){var Hr=Math.round(kr),Zr=Math.abs(Hr),Jr=dt.exponentformat;Jr==="power"||be(Jr)&&Pe(Hr)?(Hr===0?vt.text=1:Hr===1?vt.text="10":vt.text="10"+(Hr>1?"":z)+Zr+"",vt.fontSize*=1.25):(Jr==="e"||Jr==="E")&&Zr>2?vt.text="1"+Jr+(Hr>0?"+":z)+Zr:(vt.text=We(Math.pow(10,kr),dt,"","fakehover"),yr==="D1"&&dt._id.charAt(0)==="y"&&(vt.dy-=vt.fontSize/6))}else if(Pr==="D")vt.text=String(Math.round(Math.pow(10,e.mod(kr,1)))),vt.fontSize*=.75;else throw"unrecognized dtick "+String(yr);if(dt.dtick==="D1"){var wt=String(vt.text).charAt(0);(wt==="0"||wt==="1")&&(dt._id.charAt(0)==="y"?vt.dx-=vt.fontSize/4:(vt.dy+=vt.fontSize/2,vt.dx+=(dt.range[1]>dt.range[0]?1:-1)*vt.fontSize*(kr<0?.5:.25)))}}function pt(dt,vt){var Lr=dt._categories[Math.round(vt.x)];Lr===void 0&&(Lr=""),vt.text=String(Lr)}function ze(dt,vt,Lr){var Er=Math.round(vt.x),_r=dt._categories[Er]||[],yr=_r[1]===void 0?"":String(_r[1]),kr=_r[0]===void 0?"":String(_r[0]);Lr?vt.text=kr+" - "+yr:(vt.text=yr,vt.text2=kr)}function Ge(dt,vt,Lr,Er,_r){_r==="never"?_r="":dt.showexponent==="all"&&Math.abs(vt.x/dt.dtick)<1e-6&&(_r="hide"),vt.text=We(vt.x,dt,_r,Er)}function Oe(dt,vt,Lr,Er,_r){if(dt.thetaunit==="radians"&&!Lr){var yr=vt.x/180;if(yr===0)vt.text="0";else{var kr=ve(yr);if(kr[1]>=100)vt.text=We(e.deg2rad(vt.x),dt,_r,Er);else{var zr=vt.x<0;kr[1]===1?kr[0]===1?vt.text="π":vt.text=kr[0]+"π":vt.text=["",kr[0],"","⁄","",kr[1],"","π"].join(""),zr&&(vt.text=z+vt.text)}}}else vt.text=We(vt.x,dt,_r,Er)}function ve(dt){function vt(zr,Pr){return Math.abs(zr-Pr)<=1e-6}function Lr(zr,Pr){return vt(Pr,0)?zr:Lr(Pr,zr%Pr)}function Er(zr){for(var Pr=1;!vt(Math.round(zr*Pr)/Pr,zr);)Pr*=10;return Pr}var _r=Er(dt),yr=dt*_r,kr=Math.abs(Lr(yr,_r));return[Math.round(yr/kr),Math.round(_r/kr)]}var ge=["f","p","n","μ","m","","k","M","G","T"];function be(dt){return dt==="SI"||dt==="B"}function Pe(dt){return dt>14||dt<-15}function We(dt,vt,Lr,Er){var _r=dt<0,yr=vt._tickround,kr=Lr||vt.exponentformat||"B",zr=vt._tickexponent,Pr=$.getTickFormat(vt),Hr=vt.separatethousands;if(Er){var Zr={exponentformat:kr,minexponent:vt.minexponent,dtick:vt.showexponent==="none"?vt.dtick:x(dt)&&Math.abs(dt)||1,range:vt.showexponent==="none"?vt.range.map(vt.r2d):[0,dt||1]};ar(Zr),yr=(Number(Zr._tickround)||0)+4,zr=Zr._tickexponent,vt.hoverformat&&(Pr=vt.hoverformat)}if(Pr)return vt._numFormat(Pr)(dt).replace(/-/g,z);var Jr=Math.pow(10,-yr)/2;if(kr==="none"&&(zr=0),dt=Math.abs(dt),dt"+mr+"":kr==="B"&&zr===9?dt+="B":be(kr)&&(dt+=ge[zr/3+5])}return _r?z+dt:dt}$.getTickFormat=function(dt){var vt;function Lr(Pr){return typeof Pr!="string"?Pr:Number(Pr.replace("M",""))*S}function Er(Pr,Hr){var Zr=["L","D"];if(typeof Pr==typeof Hr){if(typeof Pr=="number")return Pr-Hr;var Jr=Zr.indexOf(Pr.charAt(0)),wt=Zr.indexOf(Hr.charAt(0));return Jr===wt?Number(Pr.replace(/(L|D)/g,""))-Number(Hr.replace(/(L|D)/g,"")):Jr-wt}else return typeof Pr=="number"?1:-1}function _r(Pr,Hr,Zr){var Jr=Zr||function(mr){return mr},wt=Hr[0],Qt=Hr[1];return(!wt&&typeof wt!="number"||Jr(wt)<=Jr(Pr))&&(!Qt&&typeof Qt!="number"||Jr(Qt)>=Jr(Pr))}function yr(Pr,Hr){var Zr=Hr[0]===null,Jr=Hr[1]===null,wt=Er(Pr,Hr[0])>=0,Qt=Er(Pr,Hr[1])<=0;return(Zr||wt)&&(Jr||Qt)}var kr,zr;if(dt.tickformatstops&&dt.tickformatstops.length>0)switch(dt.type){case"date":case"linear":{for(vt=0;vt=0&&_r.unshift(_r.splice(Zr,1).shift())}});var zr={false:{left:0,right:0}};return e.syncOrAsync(_r.map(function(Pr){return function(){if(Pr){var Hr=$.getFromId(dt,Pr);Lr||(Lr={}),Lr.axShifts=zr,Lr.overlayingShiftedAx=kr;var Zr=$.drawOne(dt,Hr,Lr);return Hr._shiftPusher&&Pa(Hr,Hr._fullDepth||0,zr,!0),Hr._r=Hr.range.slice(),Hr._rl=e.simpleMap(Hr._r,Hr.r2l),Zr}}}))},$.drawOne=function(dt,vt,Lr){Lr=Lr||{};var Er=Lr.axShifts||{},_r=Lr.overlayingShiftedAx||[],yr,kr,zr;vt.setScale();var Pr=dt._fullLayout,Hr=vt._id,Zr=Hr.charAt(0),Jr=$.counterLetter(Hr),wt=Pr._plots[vt._mainSubplot];if(!wt)return;if(vt._shiftPusher=vt.autoshift||_r.indexOf(vt._id)!==-1||_r.indexOf(vt.overlaying)!==-1,vt._shiftPusher&vt.anchor==="free"){var Qt=vt.linewidth/2||0;vt.ticks==="inside"&&(Qt+=vt.ticklen),Pa(vt,Qt,Er,!0),Pa(vt,vt.shift||0,Er,!1)}(Lr.skipTitle!==!0||vt._shift===void 0)&&(vt._shift=sa(vt,Er));var mr=wt[Zr+"axislayer"],$r=vt._mainLinePosition,oa=$r+=vt._shift,Sa=vt._mainMirrorPosition,ya=vt._vals=$.calcTicks(vt),ra=[vt.mirror,oa,Sa].join("_");for(yr=0;yr0?wo.bottom-Pi:0,zo))));var Js=0,Ql=0;if(vt._shiftPusher&&(Js=Math.max(zo,wo.height>0?Rn==="l"?Pi-wo.left:wo.right-Pi:0),vt.title.text!==Pr._dfltTitle[Zr]&&(Ql=(vt._titleStandoff||0)+(vt._titleScoot||0),Rn==="l"&&(Ql+=da(vt))),vt._fullDepth=Math.max(Js,Ql)),vt.automargin){bi={x:0,y:0,r:0,l:0,t:0,b:0};var Ws=[0,1],Is=typeof vt._shift=="number"?vt._shift:0;if(Zr==="x"){if(Rn==="b"?bi[Rn]=vt._depth:(bi[Rn]=vt._depth=Math.max(wo.width>0?Pi-wo.top:0,zo),Ws.reverse()),wo.width>0){var Dl=wo.right-(vt._offset+vt._length);Dl>0&&(bi.xr=1,bi.r=Dl);var Xu=vt._offset-wo.left;Xu>0&&(bi.xl=0,bi.l=Xu)}}else if(Rn==="l"?(vt._depth=Math.max(wo.height>0?Pi-wo.left:0,zo),bi[Rn]=vt._depth-Is):(vt._depth=Math.max(wo.height>0?wo.right-Pi:0,zo),bi[Rn]=vt._depth+Is,Ws.reverse()),wo.height>0){var Lu=wo.bottom-(vt._offset+vt._length);Lu>0&&(bi.yb=0,bi.b=Lu);var Bu=vt._offset-wo.top;Bu>0&&(bi.yt=1,bi.t=Bu)}bi[Jr]=vt.anchor==="free"?vt.position:vt._anchorAxis.domain[Ws[0]],vt.title.text!==Pr._dfltTitle[Zr]&&(bi[Rn]+=da(vt)+(vt.title.standoff||0)),vt.mirror&&vt.anchor!=="free"&&(wl={x:0,y:0,r:0,l:0,t:0,b:0},wl[fo]=vt.linewidth,vt.mirror&&vt.mirror!==!0&&(wl[fo]+=zo),vt.mirror===!0||vt.mirror==="ticks"?wl[Jr]=vt._anchorAxis.domain[Ws[1]]:(vt.mirror==="all"||vt.mirror==="allticks")&&(wl[Jr]=[vt._counterDomainMin,vt._counterDomainMax][Ws[1]]))}Ks&&($l=E.getComponentMethod("rangeslider","autoMarginOpts")(dt,vt)),typeof vt.automargin=="string"&&(ct(bi,vt.automargin),ct(wl,vt.automargin)),A.autoMargin(dt,Ka(vt),bi),A.autoMargin(dt,Vt(vt),wl),A.autoMargin(dt,Lt(vt),$l)}),e.syncOrAsync(Mo)}};function ct(dt,vt){if(dt){var Lr=Object.keys(Z).reduce(function(Er,_r){return vt.indexOf(_r)!==-1&&Z[_r].forEach(function(yr){Er[yr]=1}),Er},{});Object.keys(dt).forEach(function(Er){Lr[Er]||(Er.length===1?dt[Er]=0:delete dt[Er])})}}function _t(dt,vt){var Lr=[],Er,_r=function(yr,kr){var zr=yr.xbnd[kr];zr!==null&&Lr.push(e.extendFlat({},yr,{x:zr}))};if(vt.length){for(Er=0;Erdt.range[1],zr=dt.ticklabelposition&&dt.ticklabelposition.indexOf("inside")!==-1,Pr=!zr;if(Lr){var Hr=kr?-1:1;Lr=Lr*Hr}if(Er){var Zr=dt.side,Jr=zr&&(Zr==="top"||Zr==="left")||Pr&&(Zr==="bottom"||Zr==="right")?1:-1;Er=Er*Jr}return dt._id.charAt(0)==="x"?function(wt){return t(_r+dt._offset+dt.l2p(qt(wt))+Lr,yr+Er)}:function(wt){return t(yr+Er,_r+dt._offset+dt.l2p(qt(wt))+Lr)}};function qt(dt){return dt.periodX!==void 0?dt.periodX:dt.x}function Zt(dt){var vt=dt.ticklabelposition||"",Lr=function(Qt){return vt.indexOf(Qt)!==-1},Er=Lr("top"),_r=Lr("left"),yr=Lr("right"),kr=Lr("bottom"),zr=Lr("inside"),Pr=kr||_r||Er||yr;if(!Pr&&!zr)return[0,0];var Hr=dt.side,Zr=Pr?(dt.tickwidth||0)/2:0,Jr=J,wt=dt.tickfont?dt.tickfont.size:12;return(kr||Er)&&(Zr+=wt*oe,Jr+=(dt.linewidth||0)/2),(_r||yr)&&(Zr+=(dt.linewidth||0)/2,Jr+=J),zr&&Hr==="top"&&(Jr-=wt*(1-oe)),(_r||Er)&&(Zr=-Zr),(Hr==="bottom"||Hr==="right")&&(Jr=-Jr),[Pr?Zr:0,zr?Jr:0]}$.makeTickPath=function(dt,vt,Lr,Er){Er||(Er={});var _r=Er.minor;if(_r&&!dt.minor)return"";var yr=Er.len!==void 0?Er.len:_r?dt.minor.ticklen:dt.ticklen,kr=dt._id.charAt(0),zr=(dt.linewidth||1)/2;return kr==="x"?"M0,"+(vt+zr*Lr)+"v"+yr*Lr:"M"+(vt+zr*Lr)+",0h"+yr*Lr},$.makeLabelFns=function(dt,vt,Lr){var Er=dt.ticklabelposition||"",_r=function(ci){return Er.indexOf(ci)!==-1},yr=_r("top"),kr=_r("left"),zr=_r("right"),Pr=_r("bottom"),Hr=Pr||kr||yr||zr,Zr=_r("inside"),Jr=Er==="inside"&&dt.ticks==="inside"||!Zr&&dt.ticks==="outside"&&dt.tickson!=="boundaries",wt=0,Qt=0,mr=Jr?dt.ticklen:0;if(Zr?mr*=-1:Hr&&(mr=0),Jr&&(wt+=mr,Lr)){var $r=e.deg2rad(Lr);wt=mr*Math.cos($r)+1,Qt=mr*Math.sin($r)}dt.showticklabels&&(Jr||dt.showline)&&(wt+=.2*dt.tickfont.size),wt+=(dt.linewidth||1)/2*(Zr?-1:1);var oa={labelStandoff:wt,labelShift:Qt},Sa,ya,ra,pa,pn=0,Ga=dt.side,qn=dt._id.charAt(0),Vn=dt.tickangle,di;if(qn==="x")di=!Zr&&Ga==="bottom"||Zr&&Ga==="top",pa=di?1:-1,Zr&&(pa*=-1),Sa=Qt*pa,ya=vt+wt*pa,ra=di?1:-.2,Math.abs(Vn)===90&&(Zr?ra+=ue:Vn===-90&&Ga==="bottom"?ra=oe:Vn===90&&Ga==="top"?ra=ue:ra=.5,pn=ue/2*(Vn/90)),oa.xFn=function(ci){return ci.dx+Sa+pn*ci.fontSize},oa.yFn=function(ci){return ci.dy+ya+ci.fontSize*ra},oa.anchorFn=function(ci,ei){if(Hr){if(kr)return"end";if(zr)return"start"}return!x(ei)||ei===0||ei===180?"middle":ei*pa<0!==Zr?"end":"start"},oa.heightFn=function(ci,ei,mi){return ei<-60||ei>60?-.5*mi:dt.side==="top"!==Zr?-mi:0};else if(qn==="y"){if(di=!Zr&&Ga==="left"||Zr&&Ga==="right",pa=di?1:-1,Zr&&(pa*=-1),Sa=wt,ya=Qt*pa,ra=0,!Zr&&Math.abs(Vn)===90&&(Vn===-90&&Ga==="left"||Vn===90&&Ga==="right"?ra=oe:ra=.5),Zr){var yi=x(Vn)?+Vn:0;if(yi!==0){var Ci=e.deg2rad(yi);pn=Math.abs(Math.sin(Ci))*oe*pa,ra=0}}oa.xFn=function(ci){return ci.dx+vt-(Sa+ci.fontSize*ra)*pa+pn*ci.fontSize},oa.yFn=function(ci){return ci.dy+ya+ci.fontSize*ue},oa.anchorFn=function(ci,ei){return x(ei)&&Math.abs(ei)===90?"middle":di?"end":"start"},oa.heightFn=function(ci,ei,mi){return dt.side==="right"&&(ei*=-1),ei<-30?-mi:ei<30?-.5*mi:0}}return oa};function lr(dt){return[dt.text,dt.x,dt.axInfo,dt.font,dt.fontSize,dt.fontColor].join("_")}$.drawTicks=function(dt,vt,Lr){Lr=Lr||{};var Er=vt._id+"tick",_r=[].concat(vt.minor&&vt.minor.ticks?Lr.vals.filter(function(kr){return kr.minor&&!kr.noTick}):[]).concat(vt.ticks?Lr.vals.filter(function(kr){return!kr.minor&&!kr.noTick}):[]),yr=Lr.layer.selectAll("path."+Er).data(_r,lr);yr.exit().remove(),yr.enter().append("path").classed(Er,1).classed("ticks",1).classed("crisp",Lr.crisp!==!1).each(function(kr){return a.stroke(d.select(this),kr.minor?vt.minor.tickcolor:vt.tickcolor)}).style("stroke-width",function(kr){return i.crispRound(dt,kr.minor?vt.minor.tickwidth:vt.tickwidth,1)+"px"}).attr("d",Lr.path).style("display",null),Aa(vt,[N]),yr.attr("transform",Lr.transFn)},$.drawGrid=function(dt,vt,Lr){if(Lr=Lr||{},vt.tickmode!=="sync"){var Er=vt._id+"grid",_r=vt.minor&&vt.minor.showgrid,yr=_r?Lr.vals.filter(function(Sa){return Sa.minor}):[],kr=vt.showgrid?Lr.vals.filter(function(Sa){return!Sa.minor}):[],zr=Lr.counterAxis;if(zr&&$.shouldShowZeroLine(dt,vt,zr))for(var Pr=vt.tickmode==="array",Hr=0;Hr=0;mr--){var $r=mr?wt:Qt;if($r){var oa=$r.selectAll("path."+Er).data(mr?kr:yr,lr);oa.exit().remove(),oa.enter().append("path").classed(Er,1).classed("crisp",Lr.crisp!==!1),oa.attr("transform",Lr.transFn).attr("d",Lr.path).each(function(Sa){return a.stroke(d.select(this),Sa.minor?vt.minor.gridcolor:vt.gridcolor||"#ddd")}).style("stroke-dasharray",function(Sa){return i.dashStyle(Sa.minor?vt.minor.griddash:vt.griddash,Sa.minor?vt.minor.gridwidth:vt.gridwidth)}).style("stroke-width",function(Sa){return(Sa.minor?Jr:vt._gw)+"px"}).style("display",null),typeof Lr.path=="function"&&oa.attr("d",Lr.path)}}Aa(vt,[O,L])}},$.drawZeroLine=function(dt,vt,Lr){Lr=Lr||Lr;var Er=vt._id+"zl",_r=$.shouldShowZeroLine(dt,vt,Lr.counterAxis),yr=Lr.layer.selectAll("path."+Er).data(_r?[{x:0,id:vt._id}]:[]);yr.exit().remove(),yr.enter().append("path").classed(Er,1).classed("zl",1).classed("crisp",Lr.crisp!==!1).each(function(){Lr.layer.selectAll("path").sort(function(kr,zr){return ee(kr.id,zr.id)})}),yr.attr("transform",Lr.transFn).attr("d",Lr.path).call(a.stroke,vt.zerolinecolor||a.defaultLine).style("stroke-width",i.crispRound(dt,vt.zerolinewidth,vt._gw||1)+"px").style("display",null),Aa(vt,[B])},$.drawLabels=function(dt,vt,Lr){Lr=Lr||{};var Er=dt._fullLayout,_r=vt._id,yr=Lr.cls||_r+"tick",kr=Lr.vals.filter(function(li){return li.text}),zr=Lr.labelFns,Pr=Lr.secondary?0:vt.tickangle,Hr=(vt._prevTickAngles||{})[yr],Zr=Lr.layer.selectAll("g."+yr).data(vt.showticklabels?kr:[],lr),Jr=[];Zr.enter().append("g").classed(yr,1).append("text").attr("text-anchor","middle").each(function(li){var Ii=d.select(this),xi=dt._promises.length;Ii.call(r.positionText,zr.xFn(li),zr.yFn(li)).call(i.font,{family:li.font,size:li.fontSize,color:li.fontColor,weight:li.fontWeight,style:li.fontStyle,variant:li.fontVariant,textcase:li.fontTextcase,lineposition:li.fontLineposition,shadow:li.fontShadow}).text(li.text).call(r.convertToTspans,dt),dt._promises[xi]?Jr.push(dt._promises.pop().then(function(){wt(Ii,Pr)})):wt(Ii,Pr)}),Aa(vt,[U]),Zr.exit().remove(),Lr.repositionOnUpdate&&Zr.each(function(li){d.select(this).select("text").call(r.positionText,zr.xFn(li),zr.yFn(li))});function wt(li,Ii){li.each(function(xi){var Ao=d.select(this),So=Ao.select(".text-math-group"),Ro=zr.anchorFn(xi,Ii),Li=Lr.transFn.call(Ao.node(),xi)+(x(Ii)&&+Ii!=0?" rotate("+Ii+","+zr.xFn(xi)+","+(zr.yFn(xi)-xi.fontSize/2)+")":""),Yi=r.lineCount(Ao),bs=le*xi.fontSize,as=zr.heightFn(xi,x(Ii)?+Ii:0,(Yi-1)*bs);if(as&&(Li+=t(0,as)),So.empty()){var fs=Ao.select("text");fs.attr({transform:Li,"text-anchor":Ro}),fs.style("opacity",1),vt._adjustTickLabelsOverflow&&vt._adjustTickLabelsOverflow()}else{var Co=i.bBox(So.node()).width,Qa=Co*{end:-.5,start:.5}[Ro];So.attr("transform",Li+t(Qa,0))}})}vt._adjustTickLabelsOverflow=function(){var li=vt.ticklabeloverflow;if(!(!li||li==="allow")){var Ii=li.indexOf("hide")!==-1,xi=vt._id.charAt(0)==="x",Ao=0,So=xi?dt._fullLayout.width:dt._fullLayout.height;if(li.indexOf("domain")!==-1){var Ro=e.simpleMap(vt.range,vt.r2l);Ao=vt.l2p(Ro[0])+vt._offset,So=vt.l2p(Ro[1])+vt._offset}var Li=Math.min(Ao,So),Yi=Math.max(Ao,So),bs=vt.side,as=1/0,fs=-1/0;Zr.each(function(Os){var ds=d.select(this),Ui=ds.select(".text-math-group");if(Ui.empty()){var ms=i.bBox(ds.node()),Mo=0;xi?(ms.right>Yi||ms.leftYi||ms.top+(vt.tickangle?0:Os.fontSize/4)vt["_visibleLabelMin_"+Ro._id]?Os.style("display","none"):Yi.K==="tick"&&!Li&&Os.style("display",null)})})})})},wt(Zr,Hr+1?Hr:Pr);function Qt(){return Jr.length&&Promise.all(Jr)}var mr=null;function $r(){if(wt(Zr,Pr),kr.length&&vt.autotickangles&&(vt.type!=="log"||String(vt.dtick).charAt(0)!=="D")){mr=vt.autotickangles[0];var li=0,Ii=[],xi,Ao=1;Zr.each(function(wo){li=Math.max(li,wo.fontSize);var bi=vt.l2p(wo.x),wl=La(this),$l=i.bBox(wl.node());Ao=Math.max(Ao,r.lineCount(wl)),Ii.push({top:0,bottom:10,height:10,left:bi-$l.width/2,right:bi+$l.width/2+2,width:$l.width+2})});var So=(vt.tickson==="boundaries"||vt.showdividers)&&!Lr.secondary,Ro=kr.length,Li=Math.abs((kr[Ro-1].x-kr[0].x)*vt._m)/(Ro-1),Yi=So?Li/2:Li,bs=So?vt.ticklen:li*1.25*Ao,as=Math.sqrt(Math.pow(Yi,2)+Math.pow(bs,2)),fs=Yi/as,Co=vt.autotickangles.map(function(wo){return wo*Math.PI/180}),Qa=Co.find(function(wo){return Math.abs(Math.cos(wo))<=fs});Qa===void 0&&(Qa=Co.reduce(function(wo,bi){return Math.abs(Math.cos(wo))uo*mi&&(Ci=mi,Vn[qn]=di[qn]=ci[qn])}var Lo=Math.abs(Ci-yi);Lo-pa>0?(Lo-=pa,pa*=1+pa/Lo):pa=0,vt._id.charAt(0)!=="y"&&(pa=-pa),Vn[Ga]=ya.p2r(ya.r2p(di[Ga])+pn*pa),ya.autorange==="min"||ya.autorange==="max reversed"?(Vn[0]=null,ya._rangeInitial0=void 0,ya._rangeInitial1=void 0):(ya.autorange==="max"||ya.autorange==="min reversed")&&(Vn[1]=null,ya._rangeInitial0=void 0,ya._rangeInitial1=void 0),Er._insideTickLabelsUpdaterange[ya._name+".range"]=Vn}var Wo=e.syncOrAsync(oa);return Wo&&Wo.then&&dt._promises.push(Wo),Wo};function ta(dt,vt,Lr){var Er=vt._id+"divider",_r=Lr.vals,yr=Lr.layer.selectAll("path."+Er).data(_r,lr);yr.exit().remove(),yr.enter().insert("path",":first-child").classed(Er,1).classed("crisp",1).call(a.stroke,vt.dividercolor).style("stroke-width",i.crispRound(dt,vt.dividerwidth,1)+"px"),yr.attr("transform",Lr.transFn).attr("d",Lr.path)}$.getPxPosition=function(dt,vt){var Lr=dt._fullLayout._size,Er=vt._id.charAt(0),_r=vt.side,yr;if(vt.anchor!=="free"?yr=vt._anchorAxis:Er==="x"?yr={_offset:Lr.t+(1-(vt.position||0))*Lr.h,_length:0}:Er==="y"&&(yr={_offset:Lr.l+(vt.position||0)*Lr.w+vt._shift,_length:0}),_r==="top"||_r==="left")return yr._offset;if(_r==="bottom"||_r==="right")return yr._offset+yr._length};function da(dt){var vt=dt.title.font.size,Lr=(dt.title.text.match(r.BR_TAG_ALL)||[]).length;return dt.title.hasOwnProperty("standoff")?vt*(oe+Lr*le):Lr?vt*(Lr+1)*le:vt}function wa(dt,vt){var Lr=dt._fullLayout,Er=vt._id,_r=Er.charAt(0),yr=vt.title.font.size,kr,zr=(vt.title.text.match(r.BR_TAG_ALL)||[]).length;if(vt.title.hasOwnProperty("standoff"))vt.side==="bottom"||vt.side==="right"?kr=vt._depth+vt.title.standoff+yr*oe:(vt.side==="top"||vt.side==="left")&&(kr=vt._depth+vt.title.standoff+yr*(ue+zr*le));else{var Pr=ga(vt);if(vt.type==="multicategory")kr=vt._depth;else{var Hr=1.5*yr;Pr&&(Hr=.5*yr,vt.ticks==="outside"&&(Hr+=vt.ticklen)),kr=10+Hr+(vt.linewidth?vt.linewidth-1:0)}Pr||(_r==="x"?kr+=vt.side==="top"?yr*(vt.showticklabels?1:0):yr*(vt.showticklabels?1.5:.5):kr+=vt.side==="right"?yr*(vt.showticklabels?1:.5):yr*(vt.showticklabels?.5:0))}var Zr=$.getPxPosition(dt,vt),Jr,wt,Qt;_r==="x"?(wt=vt._offset+vt._length/2,Qt=vt.side==="top"?Zr-kr:Zr+kr):(Qt=vt._offset+vt._length/2,wt=vt.side==="right"?Zr+kr:Zr-kr,Jr={rotate:"-90",offset:0});var mr;if(vt.type!=="multicategory"){var $r=vt._selections[vt._id+"tick"];if(mr={selection:$r,side:vt.side},$r&&$r.node()&&$r.node().parentNode){var oa=i.getTranslate($r.node().parentNode);mr.offsetLeft=oa.x,mr.offsetTop=oa.y}vt.title.hasOwnProperty("standoff")&&(mr.pad=0)}return vt._titleStandoff=kr,o.draw(dt,Er+"title",{propContainer:vt,propName:vt._name+".title.text",placeholder:Lr._dfltTitle[_r],avoid:mr,transform:Jr,attributes:{x:wt,y:Qt,"text-anchor":"middle"}})}$.shouldShowZeroLine=function(dt,vt,Lr){var Er=e.simpleMap(vt.range,vt.r2l);return Er[0]*Er[1]<=0&&vt.zeroline&&(vt.type==="linear"||vt.type==="-")&&!(vt.rangebreaks&&vt.maskBreaks(0)===F)&&(ma(vt,0)||!Ia(dt,vt,Lr,Er)||va(dt,vt))},$.clipEnds=function(dt,vt){return vt.filter(function(Lr){return ma(dt,Lr.x)})};function ma(dt,vt){var Lr=dt.l2p(vt);return Lr>1&&Lr1)for(_r=1;_r=_r.min&&dt<_r.max)return _r.max}return dt}function ga(dt){return(dt.ticklabelposition||"").indexOf("inside")!==-1}function Aa(dt,vt){ga(dt._anchorAxis||{})&&dt._hideCounterAxisInsideTickLabels&&dt._hideCounterAxisInsideTickLabels(vt)}function Pa(dt,vt,Lr,Er){var _r=dt.anchor!=="free"&&(dt.overlaying===void 0||dt.overlaying===!1)?dt._id:dt.overlaying,yr;Er?yr=dt.side==="right"?vt:-vt:yr=vt,_r in Lr||(Lr[_r]={}),dt.side in Lr[_r]||(Lr[_r][dt.side]=0),Lr[_r][dt.side]+=yr}function sa(dt,vt){return dt.autoshift?vt[dt.overlaying][dt.side]:dt.shift||0}function Oa(dt,vt){return/%f/.test(vt)?dt>=P:/%L/.test(vt)?dt>=R:/%[SX]/.test(vt)?dt>=m:/%M/.test(vt)?dt>=g:/%[HI]/.test(vt)?dt>=u:/%p/.test(vt)?dt>=p:/%[Aadejuwx]/.test(vt)?dt>=w:/%[UVW]/.test(vt)?dt>=_:/%[Bbm]/.test(vt)?dt>=M:/%[q]/.test(vt)?dt>=y:/%[Yy]/.test(vt)?dt>=h:!0}}}),Sb=He({"src/plots/cartesian/autorange_options_defaults.js"(Y,G){G.exports=function(x,A,E){var e,t;if(E){var r=A==="reversed"||A==="min reversed"||A==="max reversed";e=E[r?1:0],t=E[r?0:1]}var o=x("autorangeoptions.minallowed",t===null?e:void 0),a=x("autorangeoptions.maxallowed",e===null?t:void 0);o===void 0&&x("autorangeoptions.clipmin"),a===void 0&&x("autorangeoptions.clipmax"),x("autorangeoptions.include")}}}),Mb=He({"src/plots/cartesian/range_defaults.js"(Y,G){var d=Sb();G.exports=function(A,E,e,t){var r=E._template||{},o=E.type||r.type||"-";e("minallowed"),e("maxallowed");var a=e("range");if(!a){var i;!t.noInsiderange&&o!=="log"&&(i=e("insiderange"),i&&(i[0]===null||i[1]===null)&&(E.insiderange=!1,i=void 0),i&&(a=e("range",i)))}var n=E.getAutorangeDflt(a,t),s=e("autorange",n),c;a&&(a[0]===null&&a[1]===null||(a[0]===null||a[1]===null)&&(s==="reversed"||s===!0)||a[0]!==null&&(s==="min"||s==="max reversed")||a[1]!==null&&(s==="max"||s==="min reversed"))&&(a=void 0,delete E.range,E.autorange=!0,c=!0),c||(n=E.getAutorangeDflt(a,t),s=e("autorange",n)),s&&(d(e,s,a),(o==="linear"||o==="-")&&e("rangemode")),E.cleanRange()}}}),eM=He({"node_modules/mouse-event-offset/index.js"(Y,G){var d={left:0,top:0};G.exports=x;function x(E,e,t){e=e||E.currentTarget||E.srcElement,Array.isArray(t)||(t=[0,0]);var r=E.clientX||0,o=E.clientY||0,a=A(e);return t[0]=r-a.left,t[1]=o-a.top,t}function A(E){return E===window||E===document||E===document.body?d:E.getBoundingClientRect()}}}),a1=He({"node_modules/has-passive-events/index.js"(Y,G){var d=yb();function x(){var A=!1;try{var E=Object.defineProperty({},"passive",{get:function(){A=!0}});window.addEventListener("test",null,E),window.removeEventListener("test",null,E)}catch{A=!1}return A}G.exports=d&&x()}}),tM=He({"src/components/dragelement/align.js"(Y,G){G.exports=function(x,A,E,e,t){var r=(x-E)/(e-E),o=r+A/(e-E),a=(r+o)/2;return t==="left"||t==="bottom"?r:t==="center"||t==="middle"?a:t==="right"||t==="top"?o:r<2/3-a?r:o>4/3-a?o:a}}}),rM=He({"src/components/dragelement/cursor.js"(Y,G){var d=Gr(),x=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];G.exports=function(E,e,t,r){return t==="left"?E=0:t==="center"?E=1:t==="right"?E=2:E=d.constrain(Math.floor(E*3),0,2),r==="bottom"?e=0:r==="middle"?e=1:r==="top"?e=2:e=d.constrain(Math.floor(e*3),0,2),x[e][E]}}}),aM=He({"src/components/dragelement/unhover.js"(Y,G){var d=z0(),x=e1(),A=Wg().getGraphDiv,E=Gg(),e=G.exports={};e.wrapped=function(t,r,o){t=A(t),t._fullLayout&&x.clear(t._fullLayout._uid+E.HOVERID),e.raw(t,r,o)},e.raw=function(r,o){var a=r._fullLayout,i=r._hoverdata;o||(o={}),!(o.target&&!r._dragged&&d.triggerHandler(r,"plotly_beforehover",o)===!1)&&(a._hoverlayer.selectAll("g").remove(),a._hoverlayer.selectAll("line").remove(),a._hoverlayer.selectAll("circle").remove(),r._hoverdata=void 0,o.target&&i&&r.emit("plotly_unhover",{event:o,points:i}))}}}),fh=He({"src/components/dragelement/index.js"(Y,G){var d=eM(),x=mb(),A=a1(),E=Gr().removeElement,e=Ef(),t=G.exports={};t.align=tM(),t.getCursor=rM();var r=aM();t.unhover=r.wrapped,t.unhoverRaw=r.raw,t.init=function(n){var s=n.gd,c=1,f=s._context.doubleClickDelay,v=n.element,h,T,l,y,b,S,M,_;s._mouseDownTime||(s._mouseDownTime=0),v.style.pointerEvents="all",v.onmousedown=u,A?(v._ontouchstart&&v.removeEventListener("touchstart",v._ontouchstart),v._ontouchstart=u,v.addEventListener("touchstart",u,{passive:!1})):v.ontouchstart=u;function w(R,P,z){return Math.abs(R)"u"&&typeof R.clientY>"u"&&(R.clientX=h,R.clientY=T),l=new Date().getTime(),l-s._mouseDownTimef&&(c=Math.max(c-1,1)),s._dragged)n.doneFn&&n.doneFn();else{var P;S.target===M?P=S:(P={target:M,srcElement:M,toElement:M},Object.keys(S).concat(Object.keys(S.__proto__)).forEach(z=>{var F=S[z];!P[z]&&typeof F!="function"&&(P[z]=F)})),n.clickFn&&n.clickFn(c,P),_||M.dispatchEvent(new MouseEvent("click",R))}s._dragging=!1,s._dragged=!1}};function o(){var i=document.createElement("div");i.className="dragcover";var n=i.style;return n.position="fixed",n.left=0,n.right=0,n.top=0,n.bottom=0,n.zIndex=999999999,n.background="none",document.body.appendChild(i),i}t.coverSlip=o;function a(i){return d(i.changedTouches?i.changedTouches[0]:i,document.body)}}}),xv=He({"src/lib/setcursor.js"(Y,G){G.exports=function(x,A){(x.attr("class")||"").split(" ").forEach(function(E){E.indexOf("cursor-")===0&&x.classed(E,!1)}),A&&x.classed("cursor-"+A,!0)}}}),nM=He({"src/lib/override_cursor.js"(Y,G){var d=xv(),x="data-savedcursor",A="!!";G.exports=function(e,t){var r=e.attr(x);if(t){if(!r){for(var o=(e.attr("class")||"").split(" "),a=0;a(a==="legend"?1:0));if(R===!1&&(n[a]=void 0),!(R===!1&&!c.uirevision)&&(v("uirevision",n.uirevision),R!==!1)){v("borderwidth");var P=v("orientation"),z=v("yref"),F=v("xref"),B=P==="h",O=z==="paper",L=F==="paper",N,U,Z,Q="left";B?(N=0,d.getComponentMethod("rangeslider","isVisible")(i.xaxis)?O?(U=1.1,Z="bottom"):(U=1,Z="top"):O?(U=-.1,Z="top"):(U=0,Z="bottom")):(U=1,Z="auto",L?N=1.02:(N=1,Q="right")),x.coerce(c,f,{x:{valType:"number",editType:"legend",min:L?-2:0,max:L?3:1,dflt:N}},"x"),x.coerce(c,f,{y:{valType:"number",editType:"legend",min:O?-2:0,max:O?3:1,dflt:U}},"y"),v("traceorder",w),r.isGrouped(n[a])&&v("tracegroupgap"),v("entrywidth"),v("entrywidthmode"),v("indentation"),v("itemsizing"),v("itemwidth"),v("itemclick"),v("itemdoubleclick"),v("groupclick"),v("xanchor",Q),v("yanchor",Z),v("valign"),x.noneOrAll(c,f,["x","y"]);var ue=v("title.text");if(ue){v("title.side",B?"left":"top");var oe=x.extendFlat({},h,{size:x.bigFont(h.size)});x.coerceFont(v,"title.font",oe)}}}}G.exports=function(i,n,s){var c,f=s.slice(),v=n.shapes;if(v)for(c=0;cR&&(m=R)}u[h][0]._groupMinRank=m,u[h][0]._preGroupSort=h}var P=function(N,U){return N[0]._groupMinRank-U[0]._groupMinRank||N[0]._preGroupSort-U[0]._preGroupSort},z=function(N,U){return N.trace.legendrank-U.trace.legendrank||N._preSort-U._preSort};for(u.forEach(function(N,U){N[0]._preGroupSort=U}),u.sort(P),h=0;h0)re=J.width;else return 0;return p?X:Math.min(re,$)};S.each(function(j){var J=d.select(this),$=A.ensureSingle(J,"g","layers");$.style("opacity",j[0].trace.opacity);var X=_.indentation,re=_.valign,ee=j[0].lineHeight,q=j[0].height;if(re==="middle"&&X===0||!ee||!q)$.attr("transform",null);else{var ae={top:1,bottom:-1}[re],ie=ae*(.5*(ee-q+3))||0,fe=_.indentation;$.attr("transform",E(fe,ie))}var we=$.selectAll("g.legendfill").data([j]);we.enter().append("g").classed("legendfill",!0);var Ae=$.selectAll("g.legendlines").data([j]);Ae.enter().append("g").classed("legendlines",!0);var Fe=$.selectAll("g.legendsymbols").data([j]);Fe.enter().append("g").classed("legendsymbols",!0),Fe.selectAll("g.legendpoints").data([j]).enter().append("g").classed("legendpoints",!0)}).each(le).each(F).each(O).each(B).each(N).each(ue).each(Q).each(P).each(z).each(U).each(Z);function P(j){var J=l(j),$=J.showFill,X=J.showLine,re=J.showGradientLine,ee=J.showGradientFill,q=J.anyFill,ae=J.anyLine,ie=j[0],fe=ie.trace,we,Ae,Fe=r(fe),Ce=Fe.colorscale,qe=Fe.reversescale,et=function(Re){if(Re.size())if($)e.fillGroupStyle(Re,M,!0);else{var $e="legendfill-"+fe.uid;e.gradient(Re,M,$e,T(qe),Ce,"fill")}},Qe=function(Re){if(Re.size()){var $e="legendline-"+fe.uid;e.lineGroupStyle(Re),e.gradient(Re,M,$e,T(qe),Ce,"stroke")}},Ke=o.hasMarkers(fe)||!q?"M5,0":ae?"M5,-2":"M5,-3",Xe=d.select(this),Me=Xe.select(".legendfill").selectAll("path").data($||ee?[j]:[]);if(Me.enter().append("path").classed("js-fill",!0),Me.exit().remove(),Me.attr("d",Ke+"h"+u+"v6h-"+u+"z").call(et),X||re){var xe=R(void 0,fe.line,v,c);Ae=A.minExtend(fe,{line:{width:xe}}),we=[A.minExtend(ie,{trace:Ae})]}var ce=Xe.select(".legendlines").selectAll("path").data(X||re?[we]:[]);ce.enter().append("path").classed("js-line",!0),ce.exit().remove(),ce.attr("d",Ke+(re?"l"+u+",0.0001":"h"+u)).call(X?e.lineGroupStyle:Qe)}function z(j){var J=l(j),$=J.anyFill,X=J.anyLine,re=J.showLine,ee=J.showMarker,q=j[0],ae=q.trace,ie=!ee&&!X&&!$&&o.hasText(ae),fe,we;function Ae(Me,xe,ce,Re){var $e=A.nestedProperty(ae,Me).get(),rt=A.isArrayOrTypedArray($e)&&xe?xe($e):$e;if(p&&rt&&Re!==void 0&&(rt=Re),ce){if(rtce[1])return ce[1]}return rt}function Fe(Me){return q._distinct&&q.index&&Me[q.index]?Me[q.index]:Me[0]}if(ee||ie||re){var Ce={},qe={};if(ee){Ce.mc=Ae("marker.color",Fe),Ce.mx=Ae("marker.symbol",Fe),Ce.mo=Ae("marker.opacity",A.mean,[.2,1]),Ce.mlc=Ae("marker.line.color",Fe),Ce.mlw=Ae("marker.line.width",A.mean,[0,5],f),qe.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var et=Ae("marker.size",A.mean,[2,16],s);Ce.ms=et,qe.marker.size=et}re&&(qe.line={width:Ae("line.width",Fe,[0,10],c)}),ie&&(Ce.tx="Aa",Ce.tp=Ae("textposition",Fe),Ce.ts=10,Ce.tc=Ae("textfont.color",Fe),Ce.tf=Ae("textfont.family",Fe),Ce.tw=Ae("textfont.weight",Fe),Ce.ty=Ae("textfont.style",Fe),Ce.tv=Ae("textfont.variant",Fe),Ce.tC=Ae("textfont.textcase",Fe),Ce.tE=Ae("textfont.lineposition",Fe),Ce.tS=Ae("textfont.shadow",Fe)),fe=[A.minExtend(q,Ce)],we=A.minExtend(ae,qe),we.selectedpoints=null,we.texttemplate=null}var Qe=d.select(this).select("g.legendpoints"),Ke=Qe.selectAll("path.scatterpts").data(ee?fe:[]);Ke.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",m),Ke.exit().remove(),Ke.call(e.pointStyle,we,M),ee&&(fe[0].mrc=3);var Xe=Qe.selectAll("g.pointtext").data(ie?fe:[]);Xe.enter().append("g").classed("pointtext",!0).append("text").attr("transform",m),Xe.exit().remove(),Xe.selectAll("text").call(e.textPointStyle,we,M)}function F(j){var J=j[0].trace,$=J.type==="waterfall";if(j[0]._distinct&&$){var X=j[0].trace[j[0].dir].marker;return j[0].mc=X.color,j[0].mlw=X.line.width,j[0].mlc=X.line.color,L(j,this,"waterfall")}var re=[];J.visible&&$&&(re=j[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 ee=d.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(re);ee.enter().append("path").classed("legendwaterfall",!0).attr("transform",m).style("stroke-miterlimit",1),ee.exit().remove(),ee.each(function(q){var ae=d.select(this),ie=J[q[0]].marker,fe=R(void 0,ie.line,h,f);ae.attr("d",q[1]).style("stroke-width",fe+"px").call(t.fill,ie.color),fe&&ae.call(t.stroke,ie.line.color)})}function B(j){L(j,this)}function O(j){L(j,this,"funnel")}function L(j,J,$){var X=j[0].trace,re=X.marker||{},ee=re.line||{},q=re.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",ae=$?X.visible&&X.type===$:x.traceIs(X,"bar"),ie=d.select(J).select("g.legendpoints").selectAll("path.legend"+$).data(ae?[j]:[]);ie.enter().append("path").classed("legend"+$,!0).attr("d",q).attr("transform",m),ie.exit().remove(),ie.each(function(fe){var we=d.select(this),Ae=fe[0],Fe=R(Ae.mlw,re.line,h,f);we.style("stroke-width",Fe+"px");var Ce=Ae.mcc;if(!_._inHover&&"mc"in Ae){var qe=r(re),et=qe.mid;et===void 0&&(et=(qe.max+qe.min)/2),Ce=e.tryColorscale(re,"")(et)}var Qe=Ce||Ae.mc||re.color,Ke=re.pattern,Xe=Ke&&e.getPatternAttr(Ke.shape,0,"");if(Xe){var Me=e.getPatternAttr(Ke.bgcolor,0,null),xe=e.getPatternAttr(Ke.fgcolor,0,null),ce=Ke.fgopacity,Re=y(Ke.size,8,10),$e=y(Ke.solidity,.5,1),rt="legend-"+X.uid;we.call(e.pattern,"legend",M,rt,Xe,Re,$e,Ce,Ke.fillmode,Me,xe,ce)}else we.call(t.fill,Qe);Fe&&t.stroke(we,Ae.mlc||ee.color)})}function N(j){var J=j[0].trace,$=d.select(this).select("g.legendpoints").selectAll("path.legendbox").data(J.visible&&x.traceIs(J,"box-violin")?[j]:[]);$.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",m),$.exit().remove(),$.each(function(){var X=d.select(this);if((J.boxpoints==="all"||J.points==="all")&&t.opacity(J.fillcolor)===0&&t.opacity((J.line||{}).color)===0){var re=A.minExtend(J,{marker:{size:p?s:A.constrain(J.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});$.call(e.pointStyle,re,M)}else{var ee=R(void 0,J.line,h,f);X.style("stroke-width",ee+"px").call(t.fill,J.fillcolor),ee&&t.stroke(X,J.line.color)}})}function U(j){var J=j[0].trace,$=d.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(J.visible&&J.type==="candlestick"?[j,j]:[]);$.enter().append("path").classed("legendcandle",!0).attr("d",function(X,re){return re?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"}).attr("transform",m).style("stroke-miterlimit",1),$.exit().remove(),$.each(function(X,re){var ee=d.select(this),q=J[re?"increasing":"decreasing"],ae=R(void 0,q.line,h,f);ee.style("stroke-width",ae+"px").call(t.fill,q.fillcolor),ae&&t.stroke(ee,q.line.color)})}function Z(j){var J=j[0].trace,$=d.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(J.visible&&J.type==="ohlc"?[j,j]:[]);$.enter().append("path").classed("legendohlc",!0).attr("d",function(X,re){return re?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"}).attr("transform",m).style("stroke-miterlimit",1),$.exit().remove(),$.each(function(X,re){var ee=d.select(this),q=J[re?"increasing":"decreasing"],ae=R(void 0,q.line,h,f);ee.style("fill","none").call(e.dashLine,q.line.dash,ae),ae&&t.stroke(ee,q.line.color)})}function Q(j){oe(j,this,"pie")}function ue(j){oe(j,this,"funnelarea")}function oe(j,J,$){var X=j[0],re=X.trace,ee=$?re.visible&&re.type===$:x.traceIs(re,$),q=d.select(J).select("g.legendpoints").selectAll("path.legend"+$).data(ee?[j]:[]);if(q.enter().append("path").classed("legend"+$,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",m),q.exit().remove(),q.size()){var ae=re.marker||{},ie=R(i(ae.line.width,X.pts),ae.line,h,f),fe="pieLike",we=A.minExtend(re,{marker:{line:{width:ie}}},fe),Ae=A.minExtend(X,{trace:we},fe);a(q,Ae,we,M)}}function le(j){var J=j[0].trace,$,X=[];if(J.visible)switch(J.type){case"histogram2d":case"heatmap":X=[["M-15,-2V4H15V-2Z"]],$=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":X=[["M-6,-6V6H6V-6Z"]],$=!0;break;case"densitymapbox":case"densitymap":X=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],$="radial";break;case"cone":X=[["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"]],$=!1;break;case"streamtube":X=[["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"]],$=!1;break;case"surface":X=[["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"]],$=!0;break;case"mesh3d":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],$=!1;break;case"volume":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],$=!0;break;case"isosurface":X=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],$=!1;break}var re=d.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(X);re.enter().append("path").classed("legend3dandfriends",!0).attr("transform",m).style("stroke-miterlimit",1),re.exit().remove(),re.each(function(ee,q){var ae=d.select(this),ie=r(J),fe=ie.colorscale,we=ie.reversescale,Ae=function(et){if(et.size()){var Qe="legendfill-"+J.uid;e.gradient(et,M,Qe,T(we,$==="radial"),fe,"fill")}},Fe;if(fe){if(!$){var qe=fe.length;Fe=q===0?fe[we?qe-1:0][1]:q===1?fe[we?0:qe-1][1]:fe[Math.floor((qe-1)/2)][1]}}else{var Ce=J.vertexcolor||J.facecolor||J.color;Fe=A.isArrayOrTypedArray(Ce)?Ce[q]||Ce[0]:Ce}ae.attr("d",ee[0]),Fe?ae.call(t.fill,Fe):ae.call(Ae)})}};function T(b,S){var M=S?"radial":"horizontal";return M+(b?"":"reversed")}function l(b){var S=b[0].trace,M=S.contours,_=o.hasLines(S),w=o.hasMarkers(S),p=S.visible&&S.fill&&S.fill!=="none",u=!1,g=!1;if(M){var m=M.coloring;m==="lines"?u=!0:_=m==="none"||m==="heatmap"||M.showlines,M.type==="constraint"?p=M._operation!=="=":(m==="fill"||m==="heatmap")&&(g=!0)}return{showMarker:w,showLine:_,showFill:p,showGradientLine:u,showGradientFill:g,anyLine:_||u,anyFill:p||g}}function y(b,S,M){return b&&A.isArrayOrTypedArray(b)?S:b>M?M:b}}}),Pb=He({"src/components/legend/draw.js"(Y,G){var d=Qn(),x=Gr(),A=yu(),E=Ei(),e=z0(),t=fh(),r=vo(),o=Ai(),a=yl(),i=iM(),n=Cb(),s=df(),c=s.LINE_SPACING,f=s.FROM_TL,v=s.FROM_BR,h=oM(),T=Lb(),l=n1(),y=1,b=/^legend[0-9]*$/;G.exports=function(U,Z){if(Z)M(U,Z);else{var Q=U._fullLayout,ue=Q._legends,oe=Q._infolayer.selectAll('[class^="legend"]');oe.each(function(){var $=d.select(this),X=$.attr("class"),re=X.split(" ")[0];re.match(b)&&ue.indexOf(re)===-1&&$.remove()});for(var le=0;le1)}var ae=Q.hiddenlabels||[];if(!j&&(!Q.showlegend||!J.length))return le.selectAll("."+ue).remove(),Q._topdefs.select("#"+oe).remove(),A.autoMargin(N,ue);var ie=x.ensureSingle(le,"g",ue,function(Ke){j||Ke.attr("pointer-events","all")}),fe=x.ensureSingleById(Q._topdefs,"clipPath",oe,function(Ke){Ke.append("rect")}),we=x.ensureSingle(ie,"rect","bg",function(Ke){Ke.attr("shape-rendering","crispEdges")});we.call(o.stroke,Z.bordercolor).call(o.fill,Z.bgcolor).style("stroke-width",Z.borderwidth+"px");var Ae=x.ensureSingle(ie,"g","scrollbox"),Fe=Z.title;Z._titleWidth=0,Z._titleHeight=0;var Ce;Fe.text?(Ce=x.ensureSingle(Ae,"text",ue+"titletext"),Ce.attr("text-anchor","start").call(r.font,Fe.font).text(Fe.text),m(Ce,Ae,N,Z,y)):Ae.selectAll("."+ue+"titletext").remove();var qe=x.ensureSingle(ie,"rect","scrollbar",function(Ke){Ke.attr(n.scrollBarEnterAttrs).call(o.fill,n.scrollBarColor)}),et=Ae.selectAll("g.groups").data(J);et.enter().append("g").attr("class","groups"),et.exit().remove();var Qe=et.selectAll("g.traces").data(x.identity);Qe.enter().append("g").attr("class","traces"),Qe.exit().remove(),Qe.style("opacity",function(Ke){var Xe=Ke[0].trace;return E.traceIs(Xe,"pie-like")?ae.indexOf(Ke[0].label)!==-1?.5:1:Xe.visible==="legendonly"?.5:1}).each(function(){d.select(this).call(p,N,Z)}).call(T,N,Z).each(function(){j||d.select(this).call(g,N,ue)}),x.syncOrAsync([A.previousPromises,function(){return z(N,et,Qe,Z)},function(){var Ke=Q._size,Xe=Z.borderwidth,Me=Z.xref==="paper",xe=Z.yref==="paper";if(Fe.text&&S(Ce,Z,Xe),!j){var ce,Re;Me?ce=Ke.l+Ke.w*Z.x-f[B(Z)]*Z._width:ce=Q.width*Z.x-f[B(Z)]*Z._width,xe?Re=Ke.t+Ke.h*(1-Z.y)-f[O(Z)]*Z._effHeight:Re=Q.height*(1-Z.y)-f[O(Z)]*Z._effHeight;var $e=F(N,ue,ce,Re);if($e)return;if(Q.margin.autoexpand){var rt=ce,Je=Re;ce=Me?x.constrain(ce,0,Q.width-Z._width):rt,Re=xe?x.constrain(Re,0,Q.height-Z._effHeight):Je,ce!==rt&&x.log("Constrain "+ue+".x to make legend fit inside graph"),Re!==Je&&x.log("Constrain "+ue+".y to make legend fit inside graph")}r.setTranslate(ie,ce,Re)}if(qe.on(".drag",null),ie.on("wheel",null),j||Z._height<=Z._maxHeight||N._context.staticPlot){var At=Z._effHeight;j&&(At=Z._height),we.attr({width:Z._width-Xe,height:At-Xe,x:Xe/2,y:Xe/2}),r.setTranslate(Ae,0,0),fe.select("rect").attr({width:Z._width-2*Xe,height:At-2*Xe,x:Xe,y:Xe}),r.setClipUrl(Ae,oe,N),r.setRect(qe,0,0,0,0),delete Z._scrollY}else{var St=Math.max(n.scrollBarMinHeight,Z._effHeight*Z._effHeight/Z._height),Rt=Z._effHeight-St-2*n.scrollBarMargin,Ut=Z._height-Z._effHeight,ir=Rt/Ut,ar=Math.min(Z._scrollY||0,Ut);we.attr({width:Z._width-2*Xe+n.scrollBarWidth+n.scrollBarMargin,height:Z._effHeight-Xe,x:Xe/2,y:Xe/2}),fe.select("rect").attr({width:Z._width-2*Xe+n.scrollBarWidth+n.scrollBarMargin,height:Z._effHeight-2*Xe,x:Xe,y:Xe+ar}),r.setClipUrl(Ae,oe,N),ve(ar,St,ir),ie.on("wheel",function(){ar=x.constrain(Z._scrollY+d.event.deltaY/Rt*Ut,0,Ut),ve(ar,St,ir),ar!==0&&ar!==Ut&&d.event.preventDefault()});var Mr,fr,dr,pt=function(ct,_t,Mt){var Nt=(Mt-_t)/ir+ct;return x.constrain(Nt,0,Ut)},ze=function(ct,_t,Mt){var Nt=(_t-Mt)/ir+ct;return x.constrain(Nt,0,Ut)},Ge=d.behavior.drag().on("dragstart",function(){var ct=d.event.sourceEvent;ct.type==="touchstart"?Mr=ct.changedTouches[0].clientY:Mr=ct.clientY,dr=ar}).on("drag",function(){var ct=d.event.sourceEvent;ct.buttons===2||ct.ctrlKey||(ct.type==="touchmove"?fr=ct.changedTouches[0].clientY:fr=ct.clientY,ar=pt(dr,Mr,fr),ve(ar,St,ir))});qe.call(Ge);var Oe=d.behavior.drag().on("dragstart",function(){var ct=d.event.sourceEvent;ct.type==="touchstart"&&(Mr=ct.changedTouches[0].clientY,dr=ar)}).on("drag",function(){var ct=d.event.sourceEvent;ct.type==="touchmove"&&(fr=ct.changedTouches[0].clientY,ar=ze(dr,Mr,fr),ve(ar,St,ir))});Ae.call(Oe)}function ve(ct,_t,Mt){Z._scrollY=N._fullLayout[ue]._scrollY=ct,r.setTranslate(Ae,0,-ct),r.setRect(qe,Z._width,n.scrollBarMargin+ct*Mt,n.scrollBarWidth,_t),fe.select("rect").attr("y",Xe+ct)}if(N._context.edits.legendPosition){var ge,be,Pe,We;ie.classed("cursor-move",!0),t.init({element:ie.node(),gd:N,prepFn:function(ct){if(ct.target!==qe.node()){var _t=r.getTranslate(ie);Pe=_t.x,We=_t.y}},moveFn:function(ct,_t){if(Pe!==void 0&&We!==void 0){var Mt=Pe+ct,Nt=We+_t;r.setTranslate(ie,Mt,Nt),ge=t.align(Mt,Z._width,Ke.l,Ke.l+Ke.w,Z.xanchor),be=t.align(Nt+Z._height,-Z._height,Ke.t+Ke.h,Ke.t,Z.yanchor)}},doneFn:function(){if(ge!==void 0&&be!==void 0){var ct={};ct[ue+".x"]=ge,ct[ue+".y"]=be,E.call("_guiRelayout",N,ct)}},clickFn:function(ct,_t){var Mt=le.selectAll("g.traces").filter(function(){var Nt=this.getBoundingClientRect();return _t.clientX>=Nt.left&&_t.clientX<=Nt.right&&_t.clientY>=Nt.top&&_t.clientY<=Nt.bottom});Mt.size()>0&&w(N,ie,Mt,ct,_t)}})}}],N)}}function _(N,U,Z){var Q=N[0],ue=Q.width,oe=U.entrywidthmode,le=Q.trace.legendwidth||U.entrywidth;return oe==="fraction"?U._maxWidth*le:Z+(le||ue)}function w(N,U,Z,Q,ue){var oe=Z.data()[0][0].trace,le={event:ue,node:Z.node(),curveNumber:oe.index,expandedIndex:oe.index,data:N.data,layout:N.layout,frames:N._transitionData._frames,config:N._context,fullData:N._fullData,fullLayout:N._fullLayout};oe._group&&(le.group=oe._group),E.traceIs(oe,"pie-like")&&(le.label=Z.datum()[0].label);var j=e.triggerHandler(N,"plotly_legendclick",le);if(Q===1){if(j===!1)return;U._clickTimeout=setTimeout(function(){N._fullLayout&&i(Z,N,Q)},N._context.doubleClickDelay)}else if(Q===2){U._clickTimeout&&clearTimeout(U._clickTimeout),N._legendMouseDownTime=0;var J=e.triggerHandler(N,"plotly_legenddoubleclick",le);J!==!1&&j!==!1&&i(Z,N,Q)}}function p(N,U,Z){var Q=L(Z),ue=N.data()[0][0],oe=ue.trace,le=E.traceIs(oe,"pie-like"),j=!Z._inHover&&U._context.edits.legendText&&!le,J=Z._maxNameLength,$,X;ue.groupTitle?($=ue.groupTitle.text,X=ue.groupTitle.font):(X=Z.font,Z.entries?$=ue.text:($=le?ue.label:oe.name,oe._meta&&($=x.templateString($,oe._meta))));var re=x.ensureSingle(N,"text",Q+"text");re.attr("text-anchor","start").call(r.font,X).text(j?u($,J):$);var ee=Z.indentation+Z.itemwidth+n.itemGap*2;a.positionText(re,ee,0),j?re.call(a.makeEditable,{gd:U,text:$}).call(m,N,U,Z).on("edit",function(q){this.text(u(q,J)).call(m,N,U,Z);var ae=ue.trace._fullInput||{},ie={};return ie.name=q,ae._isShape?E.call("_guiRelayout",U,"shapes["+oe.index+"].name",ie.name):E.call("_guiRestyle",U,ie,oe.index)}):m(re,N,U,Z)}function u(N,U){var Z=Math.max(4,U);if(N&&N.trim().length>=Z/2)return N;N=N||"";for(var Q=Z-N.length;Q>0;Q--)N+=" ";return N}function g(N,U,Z){var Q=U._context.doubleClickDelay,ue,oe=1,le=x.ensureSingle(N,"rect",Z+"toggle",function(j){U._context.staticPlot||j.style("cursor","pointer").attr("pointer-events","all"),j.call(o.fill,"rgba(0,0,0,0)")});U._context.staticPlot||(le.on("mousedown",function(){ue=new Date().getTime(),ue-U._legendMouseDownTimeQ&&(oe=Math.max(oe-1,1)),w(U,j,N,oe,d.event)}}))}function m(N,U,Z,Q,ue){Q._inHover&&N.attr("data-notex",!0),a.convertToTspans(N,Z,function(){R(U,Z,Q,ue)})}function R(N,U,Z,Q){var ue=N.data()[0][0];if(!Z._inHover&&ue&&!ue.trace.showlegend){N.remove();return}var oe=N.select("g[class*=math-group]"),le=oe.node(),j=L(Z);Z||(Z=U._fullLayout[j]);var J=Z.borderwidth,$;Q===y?$=Z.title.font:ue.groupTitle?$=ue.groupTitle.font:$=Z.font;var X=$.size*c,re,ee;if(le){var q=r.bBox(le);re=q.height,ee=q.width,Q===y?r.setTranslate(oe,J,J+re*.75):r.setTranslate(oe,0,re*.25)}else{var ae="."+j+(Q===y?"title":"")+"text",ie=N.select(ae),fe=a.lineCount(ie),we=ie.node();if(re=X*fe,ee=we?r.bBox(we).width:0,Q===y)Z.title.side==="left"&&(ee+=n.itemGap*2),a.positionText(ie,J+n.titlePad,J+X);else{var Ae=n.itemGap*2+Z.indentation+Z.itemwidth;ue.groupTitle&&(Ae=n.itemGap,ee-=Z.indentation+Z.itemwidth),a.positionText(ie,Ae,-X*((fe-1)/2-.3))}}Q===y?(Z._titleWidth=ee,Z._titleHeight=re):(ue.lineHeight=X,ue.height=Math.max(re,16)+3,ue.width=ee)}function P(N){var U=0,Z=0,Q=N.title.side;return Q&&(Q.indexOf("left")!==-1&&(U=N._titleWidth),Q.indexOf("top")!==-1&&(Z=N._titleHeight)),[U,Z]}function z(N,U,Z,Q){var ue=N._fullLayout,oe=L(Q);Q||(Q=ue[oe]);var le=ue._size,j=l.isVertical(Q),J=l.isGrouped(Q),$=Q.entrywidthmode==="fraction",X=Q.borderwidth,re=2*X,ee=n.itemGap,q=Q.indentation+Q.itemwidth+ee*2,ae=2*(X+ee),ie=O(Q),fe=Q.y<0||Q.y===0&&ie==="top",we=Q.y>1||Q.y===1&&ie==="bottom",Ae=Q.tracegroupgap,Fe={};Q._maxHeight=Math.max(fe||we?ue.height/2:le.h,30);var Ce=0;Q._width=0,Q._height=0;var qe=P(Q);if(j)Z.each(function(dr){var pt=dr[0].height;r.setTranslate(this,X+qe[0],X+qe[1]+Q._height+pt/2+ee),Q._height+=pt,Q._width=Math.max(Q._width,dr[0].width)}),Ce=q+Q._width,Q._width+=ee+q+re,Q._height+=ae,J&&(U.each(function(dr,pt){r.setTranslate(this,0,pt*Q.tracegroupgap)}),Q._height+=(Q._lgroupsLength-1)*Q.tracegroupgap);else{var et=B(Q),Qe=Q.x<0||Q.x===0&&et==="right",Ke=Q.x>1||Q.x===1&&et==="left",Xe=we||fe,Me=ue.width/2;Q._maxWidth=Math.max(Qe?Xe&&et==="left"?le.l+le.w:Me:Ke?Xe&&et==="right"?le.r+le.w:Me:le.w,2*q);var xe=0,ce=0;Z.each(function(dr){var pt=_(dr,Q,q);xe=Math.max(xe,pt),ce+=pt}),Ce=null;var Re=0;if(J){var $e=0,rt=0,Je=0;U.each(function(){var dr=0,pt=0;d.select(this).selectAll("g.traces").each(function(Ge){var Oe=_(Ge,Q,q),ve=Ge[0].height;r.setTranslate(this,qe[0],qe[1]+X+ee+ve/2+pt),pt+=ve,dr=Math.max(dr,Oe),Fe[Ge[0].trace.legendgroup]=dr});var ze=dr+ee;rt>0&&ze+X+rt>Q._maxWidth?(Re=Math.max(Re,rt),rt=0,Je+=$e+Ae,$e=pt):$e=Math.max($e,pt),r.setTranslate(this,rt,Je),rt+=ze}),Q._width=Math.max(Re,rt)+X,Q._height=Je+$e+ae}else{var At=Z.size(),St=ce+re+(At-1)*ee=Q._maxWidth&&(Re=Math.max(Re,ar),Ut=0,ir+=Rt,Q._height+=Rt,Rt=0),r.setTranslate(this,qe[0]+X+Ut,qe[1]+X+ir+pt/2+ee),ar=Ut+ze+ee,Ut+=Ge,Rt=Math.max(Rt,pt)}),St?(Q._width=Ut+re,Q._height=Rt+ae):(Q._width=Math.max(Re,ar)+re,Q._height+=Rt+ae)}}Q._width=Math.ceil(Math.max(Q._width+qe[0],Q._titleWidth+2*(X+n.titlePad))),Q._height=Math.ceil(Math.max(Q._height+qe[1],Q._titleHeight+2*(X+n.itemGap))),Q._effHeight=Math.min(Q._height,Q._maxHeight);var Mr=N._context.edits,fr=Mr.legendText||Mr.legendPosition;Z.each(function(dr){var pt=d.select(this).select("."+oe+"toggle"),ze=dr[0].height,Ge=dr[0].trace.legendgroup,Oe=_(dr,Q,q);J&&Ge!==""&&(Oe=Fe[Ge]);var ve=fr?q:Ce||Oe;!j&&!$&&(ve+=ee/2),r.setRect(pt,0,-ze/2,ve,ze)})}function F(N,U,Z,Q){var ue=N._fullLayout,oe=ue[U],le=B(oe),j=O(oe),J=oe.xref==="paper",$=oe.yref==="paper";N._fullLayout._reservedMargin[U]={};var X=oe.y<.5?"b":"t",re=oe.x<.5?"l":"r",ee={r:ue.width-Z,l:Z+oe._width,b:ue.height-Q,t:Q+oe._effHeight};if(J&&$)return A.autoMargin(N,U,{x:oe.x,y:oe.y,l:oe._width*f[le],r:oe._width*v[le],b:oe._effHeight*v[j],t:oe._effHeight*f[j]});J?N._fullLayout._reservedMargin[U][X]=ee[X]:$||oe.orientation==="v"?N._fullLayout._reservedMargin[U][re]=ee[re]:N._fullLayout._reservedMargin[U][X]=ee[X]}function B(N){return x.isRightAnchor(N)?"right":x.isCenterAnchor(N)?"center":"left"}function O(N){return x.isBottomAnchor(N)?"bottom":x.isMiddleAnchor(N)?"middle":"top"}function L(N){return N._id||"legend"}}}),Ib=He({"src/components/fx/hover.js"(Y){var G=Qn(),d=Hi(),x=Mf(),A=Gr(),E=A.pushUnique,e=A.strTranslate,t=A.strRotate,r=z0(),o=yl(),a=nM(),i=vo(),n=Ai(),s=fh(),c=io(),f=Ef().zindexSeparator,v=Ei(),h=Ph(),T=Gg(),l=kb(),y=Pb(),b=T.YANGLE,S=Math.PI*b/180,M=1/Math.sin(S),_=Math.cos(S),w=Math.sin(S),p=T.HOVERARROWSIZE,u=T.HOVERTEXTPAD,g={box:!0,ohlc:!0,violin:!0,candlestick:!0},m={scatter:!0,scattergl:!0,splom:!0};function R(q,ae){return q.distance-ae.distance}Y.hover=function(ae,ie,fe,we){ae=A.getGraphDiv(ae);var Ae=ie.target;A.throttle(ae._fullLayout._uid+T.HOVERID,T.HOVERMINTIME,function(){P(ae,ie,fe,we,Ae)})},Y.loneHover=function(ae,ie){var fe=!0;Array.isArray(ae)||(fe=!1,ae=[ae]);var we=ie.gd,Ae=X(we),Fe=re(we),Ce=ae.map(function(Re){var $e=Re._x0||Re.x0||Re.x||0,rt=Re._x1||Re.x1||Re.x||0,Je=Re._y0||Re.y0||Re.y||0,At=Re._y1||Re.y1||Re.y||0,St=Re.eventData;if(St){var Rt=Math.min($e,rt),Ut=Math.max($e,rt),ir=Math.min(Je,At),ar=Math.max(Je,At),Mr=Re.trace;if(v.traceIs(Mr,"gl3d")){var fr=we._fullLayout[Mr.scene]._scene.container,dr=fr.offsetLeft,pt=fr.offsetTop;Rt+=dr,Ut+=dr,ir+=pt,ar+=pt}St.bbox={x0:Rt+Fe,x1:Ut+Fe,y0:ir+Ae,y1:ar+Ae},ie.inOut_bbox&&ie.inOut_bbox.push(St.bbox)}else St=!1;return{color:Re.color||n.defaultLine,x0:Re.x0||Re.x||0,x1:Re.x1||Re.x||0,y0:Re.y0||Re.y||0,y1:Re.y1||Re.y||0,xLabel:Re.xLabel,yLabel:Re.yLabel,zLabel:Re.zLabel,text:Re.text,name:Re.name,idealAlign:Re.idealAlign,borderColor:Re.borderColor,fontFamily:Re.fontFamily,fontSize:Re.fontSize,fontColor:Re.fontColor,fontWeight:Re.fontWeight,fontStyle:Re.fontStyle,fontVariant:Re.fontVariant,nameLength:Re.nameLength,textAlign:Re.textAlign,trace:Re.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:Re.hovertemplate||!1,hovertemplateLabels:Re.hovertemplateLabels||!1,eventData:St}}),qe=!1,et=B(Ce,{gd:we,hovermode:"closest",rotateLabels:qe,bgColor:ie.bgColor||n.background,container:G.select(ie.container),outerContainer:ie.outerContainer||ie.container}),Qe=et.hoverLabels,Ke=5,Xe=0,Me=0;Qe.sort(function(Re,$e){return Re.y0-$e.y0}).each(function(Re,$e){var rt=Re.y0-Re.by/2;rt-KeUt[0]._length||Ia<0||Ia>ir[0]._length)return s.unhoverRaw(q,ae)}if(ae.pointerX=ma+Ut[0]._offset,ae.pointerY=Ia+ir[0]._offset,"xval"in ae?Oe=h.flat(Ae,ae.xval):Oe=h.p2c(Ut,ma),"yval"in ae?ve=h.flat(Ae,ae.yval):ve=h.p2c(ir,Ia),!d(Oe[0])||!d(ve[0]))return A.warn("Fx.hover failed",ae,q),s.unhoverRaw(q,ae)}var Ka=1/0;function Vt(ei,mi){for(be=0;beZt&&(ze.splice(0,Zt),Ka=ze[0].distance),Ke&&pt!==0&&ze.length===0){qt.distance=pt,qt.index=!1;var Ii=We._module.hoverPoints(qt,Nt,Bt,"closest",{hoverLayer:Ce._hoverlayer});if(Ii&&(Ii=Ii.filter(function(Yi){return Yi.spikeDistance<=pt})),Ii&&Ii.length){var xi,Ao=Ii.filter(function(Yi){return Yi.xa.showspikes&&Yi.xa.spikesnap!=="hovered data"});if(Ao.length){var So=Ao[0];d(So.x0)&&d(So.y0)&&(xi=jt(So),(!lr.vLinePoint||lr.vLinePoint.spikeDistance>xi.spikeDistance)&&(lr.vLinePoint=xi))}var Ro=Ii.filter(function(Yi){return Yi.ya.showspikes&&Yi.ya.spikesnap!=="hovered data"});if(Ro.length){var Li=Ro[0];d(Li.x0)&&d(Li.y0)&&(xi=jt(Li),(!lr.hLinePoint||lr.hLinePoint.spikeDistance>xi.spikeDistance)&&(lr.hLinePoint=xi))}}}}}Vt();function Lt(ei,mi,uo){for(var Lo=null,Wo=1/0,li,Ii=0;Ii0&&Math.abs(ei.distance)vt-1;Pr--)zr(ze[Pr]);ze=_r,Br()}var Hr=q._hoverdata,Zr=[],Jr=X(q),wt=re(q);for(ge=0;ge1||ze.length>1)||Xe==="closest"&&ta&&ze.length>1,di=n.combine(Ce.plot_bgcolor||n.background,Ce.paper_bgcolor),yi=B(ze,{gd:q,hovermode:Xe,rotateLabels:Vn,bgColor:di,container:Ce._hoverlayer,outerContainer:Ce._paper.node(),commonLabelOpts:Ce.hoverlabel,hoverdistance:Ce.hoverdistance}),Ci=yi.hoverLabels;if(h.isUnifiedHover(Xe)||(L(Ci,Vn,Ce,yi.commonLabelBoundingBox),Z(Ci,Vn,Ce._invScaleX,Ce._invScaleY)),we&&we.tagName){var ci=v.getComponentMethod("annotations","hasClickToShow")(q,Zr);a(G.select(we),ci?"pointer":"")}!we||fe||!oe(q,ae,Hr)||(Hr&&q.emit("plotly_unhover",{event:ae,points:Hr}),q.emit("plotly_hover",{event:ae,points:q._hoverdata,xaxes:Ut,yaxes:ir,xvals:Oe,yvals:ve}))}function z(q){return[q.trace.index,q.index,q.x0,q.y0,q.name,q.attr,q.xa?q.xa._id:"",q.ya?q.ya._id:""].join(",")}var F=/([\s\S]*)<\/extra>/;function B(q,ae){var ie=ae.gd,fe=ie._fullLayout,we=ae.hovermode,Ae=ae.rotateLabels,Fe=ae.bgColor,Ce=ae.container,qe=ae.outerContainer,et=ae.commonLabelOpts||{};if(q.length===0)return[[]];var Qe=ae.fontFamily||T.HOVERFONT,Ke=ae.fontSize||T.HOVERFONTSIZE,Xe=ae.fontWeight||fe.font.weight,Me=ae.fontStyle||fe.font.style,xe=ae.fontVariant||fe.font.variant,ce=ae.fontTextcase||fe.font.textcase,Re=ae.fontLineposition||fe.font.lineposition,$e=ae.fontShadow||fe.font.shadow,rt=q[0],Je=rt.xa,At=rt.ya,St=we.charAt(0),Rt=St+"Label",Ut=rt[Rt];if(Ut===void 0&&Je.type==="multicategory")for(var ir=0;irfe.width-Zr&&(Jr=fe.width-Zr),Oa.attr("d","M"+(zr-Jr)+",0L"+(zr-Jr+p)+","+Hr+p+"H"+Zr+"v"+Hr+(u*2+kr.height)+"H"+-Zr+"V"+Hr+p+"H"+(zr-Jr-p)+"Z"),zr=Jr,be.minX=zr-Zr,be.maxX=zr+Zr,Je.side==="top"?(be.minY=Pr-(u*2+kr.height),be.maxY=Pr-u):(be.minY=Pr+u,be.maxY=Pr+(u*2+kr.height))}else{var wt,Qt,mr;At.side==="right"?(wt="start",Qt=1,mr="",zr=Je._offset+Je._length):(wt="end",Qt=-1,mr="-",zr=Je._offset),Pr=At._offset+(rt.y0+rt.y1)/2,dt.attr("text-anchor",wt),Oa.attr("d","M0,0L"+mr+p+","+p+"V"+(u+kr.height/2)+"h"+mr+(u*2+kr.width)+"V-"+(u+kr.height/2)+"H"+mr+p+"V-"+p+"Z"),be.minY=Pr-(u+kr.height/2),be.maxY=Pr+(u+kr.height/2),At.side==="right"?(be.minX=zr+p,be.maxX=zr+p+(u*2+kr.width)):(be.minX=zr-p-(u*2+kr.width),be.maxX=zr-p);var $r=kr.height/2,oa=Mr-kr.top-$r,Sa="clip"+fe._uid+"commonlabel"+At._id,ya;if(zr=0?ga=gr:Br+Ia=0?ga=Br:na+Ia=0?Aa=jt:Ot+va=0?Aa=Ot:Ur+va=0,(sa.idealAlign==="top"||!pn)&&Ga?(mr-=oa/2,sa.anchor="end"):pn?(mr+=oa/2,sa.anchor="start"):sa.anchor="middle",sa.crossPos=mr;else{if(sa.pos=mr,pn=Qt+$r/2+pa<=fr,Ga=Qt-$r/2-pa>=0,(sa.idealAlign==="left"||!pn)&&Ga)Qt-=$r/2,sa.anchor="end";else if(pn)Qt+=$r/2,sa.anchor="start";else{sa.anchor="middle";var qn=pa/2,Vn=Qt+qn-fr,di=Qt-qn;Vn>0&&(Qt-=Vn),di<0&&(Qt+=-di)}sa.crossPos=Qt}Pr.attr("text-anchor",sa.anchor),Zr&&Hr.attr("text-anchor",sa.anchor),Oa.attr("transform",e(Qt,mr)+(Ae?t(b):""))}),{hoverLabels:Pa,commonLabelBoundingBox:be}}function O(q,ae,ie,fe,we,Ae){var Fe="",Ce="";q.nameOverride!==void 0&&(q.name=q.nameOverride),q.name&&(q.trace._meta&&(q.name=A.templateString(q.name,q.trace._meta)),Fe=j(q.name,q.nameLength));var qe=ie.charAt(0),et=qe==="x"?"y":"x";q.zLabel!==void 0?(q.xLabel!==void 0&&(Ce+="x: "+q.xLabel+"
"),q.yLabel!==void 0&&(Ce+="y: "+q.yLabel+"
"),q.trace.type!=="choropleth"&&q.trace.type!=="choroplethmapbox"&&q.trace.type!=="choroplethmap"&&(Ce+=(Ce?"z: ":"")+q.zLabel)):ae&&q[qe+"Label"]===we?Ce=q[et+"Label"]||"":q.xLabel===void 0?q.yLabel!==void 0&&q.trace.type!=="scattercarpet"&&(Ce=q.yLabel):q.yLabel===void 0?Ce=q.xLabel:Ce="("+q.xLabel+", "+q.yLabel+")",(q.text||q.text===0)&&!Array.isArray(q.text)&&(Ce+=(Ce?"
":"")+q.text),q.extraText!==void 0&&(Ce+=(Ce?"
":"")+q.extraText),Ae&&Ce===""&&!q.hovertemplate&&(Fe===""&&Ae.remove(),Ce=Fe);var Qe=q.hovertemplate||!1;if(Qe){var Ke=q.hovertemplateLabels||q;q[qe+"Label"]!==we&&(Ke[qe+"other"]=Ke[qe+"Val"],Ke[qe+"otherLabel"]=Ke[qe+"Label"]),Ce=A.hovertemplateString(Qe,Ke,fe._d3locale,q.eventData[0]||{},q.trace._meta),Ce=Ce.replace(F,function(Xe,Me){return Fe=j(Me,q.nameLength),""})}return[Ce,Fe]}function L(q,ae,ie,fe){var we=ae?"xa":"ya",Ae=ae?"ya":"xa",Fe=0,Ce=1,qe=q.size(),et=new Array(qe),Qe=0,Ke=fe.minX,Xe=fe.maxX,Me=fe.minY,xe=fe.maxY,ce=function(Oe){return Oe*ie._invScaleX},Re=function(Oe){return Oe*ie._invScaleY};q.each(function(Oe){var ve=Oe[we],ge=Oe[Ae],be=ve._id.charAt(0)==="x",Pe=ve.range;Qe===0&&Pe&&Pe[0]>Pe[1]!==be&&(Ce=-1);var We=0,ct=be?ie.width:ie.height;if(ie.hovermode==="x"||ie.hovermode==="y"){var _t=N(Oe,ae),Mt=Oe.anchor,Nt=Mt==="end"?-1:1,Bt,qt;if(Mt==="middle")Bt=Oe.crossPos+(be?Re(_t.y-Oe.by/2):ce(Oe.bx/2+Oe.tx2width/2)),qt=Bt+(be?Re(Oe.by):ce(Oe.bx));else if(be)Bt=Oe.crossPos+Re(p+_t.y)-Re(Oe.by/2-p),qt=Bt+Re(Oe.by);else{var Zt=ce(Nt*p+_t.x),lr=Zt+ce(Nt*Oe.bx);Bt=Oe.crossPos+Math.min(Zt,lr),qt=Oe.crossPos+Math.max(Zt,lr)}be?Me!==void 0&&xe!==void 0&&Math.min(qt,xe)-Math.max(Bt,Me)>1&&(ge.side==="left"?(We=ge._mainLinePosition,ct=ie.width):ct=ge._mainLinePosition):Ke!==void 0&&Xe!==void 0&&Math.min(qt,Xe)-Math.max(Bt,Ke)>1&&(ge.side==="top"?(We=ge._mainLinePosition,ct=ie.height):ct=ge._mainLinePosition)}et[Qe++]=[{datum:Oe,traceIndex:Oe.trace.index,dp:0,pos:Oe.pos,posref:Oe.posref,size:Oe.by*(be?M:1)/2,pmin:We,pmax:ct}]}),et.sort(function(Oe,ve){return Oe[0].posref-ve[0].posref||Ce*(ve[0].traceIndex-Oe[0].traceIndex)});var $e,rt,Je,At,St,Rt,Ut;function ir(Oe){var ve=Oe[0],ge=Oe[Oe.length-1];if(rt=ve.pmin-ve.pos-ve.dp+ve.size,Je=ge.pos+ge.dp+ge.size-ve.pmax,rt>.01){for(St=Oe.length-1;St>=0;St--)Oe[St].dp+=rt;$e=!1}if(!(Je<.01)){if(rt<-.01){for(St=Oe.length-1;St>=0;St--)Oe[St].dp-=Je;$e=!1}if($e){var be=0;for(At=0;Atve.pmax&&be++;for(At=Oe.length-1;At>=0&&!(be<=0);At--)Rt=Oe[At],Rt.pos>ve.pmax-1&&(Rt.del=!0,be--);for(At=0;At=0;St--)Oe[St].dp-=Je;for(At=Oe.length-1;At>=0&&!(be<=0);At--)Rt=Oe[At],Rt.pos+Rt.dp+Rt.size>ve.pmax&&(Rt.del=!0,be--)}}}for(;!$e&&Fe<=qe;){for(Fe++,$e=!0,At=0;At.01){for(St=Mr.length-1;St>=0;St--)Mr[St].dp+=rt;for(ar.push.apply(ar,Mr),et.splice(At+1,1),Ut=0,St=ar.length-1;St>=0;St--)Ut+=ar[St].dp;for(Je=Ut/ar.length,St=ar.length-1;St>=0;St--)ar[St].dp-=Je;$e=!1}else At++}et.forEach(ir)}for(At=et.length-1;At>=0;At--){var pt=et[At];for(St=pt.length-1;St>=0;St--){var ze=pt[St],Ge=ze.datum;Ge.offset=ze.dp,Ge.del=ze.del}}}function N(q,ae){var ie=0,fe=q.offset;return ae&&(fe*=-w,ie=q.offset*_),{x:ie,y:fe}}function U(q){var ae={start:1,end:-1,middle:0}[q.anchor],ie=ae*(p+u),fe=ie+ae*(q.txwidth+u),we=q.anchor==="middle";return we&&(ie-=q.tx2width/2,fe+=q.txwidth/2+u),{alignShift:ae,textShiftX:ie,text2ShiftX:fe}}function Z(q,ae,ie,fe){var we=function(Fe){return Fe*ie},Ae=function(Fe){return Fe*fe};q.each(function(Fe){var Ce=G.select(this);if(Fe.del)return Ce.remove();var qe=Ce.select("text.nums"),et=Fe.anchor,Qe=et==="end"?-1:1,Ke=U(Fe),Xe=N(Fe,ae),Me=Xe.x,xe=Xe.y,ce=et==="middle";Ce.select("path").attr("d",ce?"M-"+we(Fe.bx/2+Fe.tx2width/2)+","+Ae(xe-Fe.by/2)+"h"+we(Fe.bx)+"v"+Ae(Fe.by)+"h-"+we(Fe.bx)+"Z":"M0,0L"+we(Qe*p+Me)+","+Ae(p+xe)+"v"+Ae(Fe.by/2-p)+"h"+we(Qe*Fe.bx)+"v-"+Ae(Fe.by)+"H"+we(Qe*p+Me)+"V"+Ae(xe-p)+"Z");var Re=Me+Ke.textShiftX,$e=xe+Fe.ty0-Fe.by/2+u,rt=Fe.textAlign||"auto";rt!=="auto"&&(rt==="left"&&et!=="start"?(qe.attr("text-anchor","start"),Re=ce?-Fe.bx/2-Fe.tx2width/2+u:-Fe.bx-u):rt==="right"&&et!=="end"&&(qe.attr("text-anchor","end"),Re=ce?Fe.bx/2-Fe.tx2width/2-u:Fe.bx+u)),qe.call(o.positionText,we(Re),Ae($e)),Fe.tx2width&&(Ce.select("text.name").call(o.positionText,we(Ke.text2ShiftX+Ke.alignShift*u+Me),Ae(xe+Fe.ty0-Fe.by/2+u)),Ce.select("rect").call(i.setRect,we(Ke.text2ShiftX+(Ke.alignShift-1)*Fe.tx2width/2+Me),Ae(xe-Fe.by/2-1),we(Fe.tx2width),Ae(Fe.by+2)))})}function Q(q,ae){var ie=q.index,fe=q.trace||{},we=q.cd[0],Ae=q.cd[ie]||{};function Fe(Xe){return Xe||d(Xe)&&Xe===0}var Ce=Array.isArray(ie)?function(Xe,Me){var xe=A.castOption(we,ie,Xe);return Fe(xe)?xe:A.extractOption({},fe,"",Me)}:function(Xe,Me){return A.extractOption(Ae,fe,Xe,Me)};function qe(Xe,Me,xe){var ce=Ce(Me,xe);Fe(ce)&&(q[Xe]=ce)}if(qe("hoverinfo","hi","hoverinfo"),qe("bgcolor","hbg","hoverlabel.bgcolor"),qe("borderColor","hbc","hoverlabel.bordercolor"),qe("fontFamily","htf","hoverlabel.font.family"),qe("fontSize","hts","hoverlabel.font.size"),qe("fontColor","htc","hoverlabel.font.color"),qe("fontWeight","htw","hoverlabel.font.weight"),qe("fontStyle","hty","hoverlabel.font.style"),qe("fontVariant","htv","hoverlabel.font.variant"),qe("nameLength","hnl","hoverlabel.namelength"),qe("textAlign","hta","hoverlabel.align"),q.posref=ae==="y"||ae==="closest"&&fe.orientation==="h"?q.xa._offset+(q.x0+q.x1)/2:q.ya._offset+(q.y0+q.y1)/2,q.x0=A.constrain(q.x0,0,q.xa._length),q.x1=A.constrain(q.x1,0,q.xa._length),q.y0=A.constrain(q.y0,0,q.ya._length),q.y1=A.constrain(q.y1,0,q.ya._length),q.xLabelVal!==void 0&&(q.xLabel="xLabel"in q?q.xLabel:c.hoverLabelText(q.xa,q.xLabelVal,fe.xhoverformat),q.xVal=q.xa.c2d(q.xLabelVal)),q.yLabelVal!==void 0&&(q.yLabel="yLabel"in q?q.yLabel:c.hoverLabelText(q.ya,q.yLabelVal,fe.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 et=c.tickText(q.xa,q.xa.c2l(q.xerr),"hover").text;q.xerrneg!==void 0?q.xLabel+=" +"+et+" / -"+c.tickText(q.xa,q.xa.c2l(q.xerrneg),"hover").text:q.xLabel+=" ± "+et,ae==="x"&&(q.distance+=1)}if(!isNaN(q.yerr)&&!(q.ya.type==="log"&&q.yerr<=0)){var Qe=c.tickText(q.ya,q.ya.c2l(q.yerr),"hover").text;q.yerrneg!==void 0?q.yLabel+=" +"+Qe+" / -"+c.tickText(q.ya,q.ya.c2l(q.yerrneg),"hover").text:q.yLabel+=" ± "+Qe,ae==="y"&&(q.distance+=1)}var Ke=q.hoverinfo||q.trace.hoverinfo;return Ke&&Ke!=="all"&&(Ke=Array.isArray(Ke)?Ke:Ke.split("+"),Ke.indexOf("x")===-1&&(q.xLabel=void 0),Ke.indexOf("y")===-1&&(q.yLabel=void 0),Ke.indexOf("z")===-1&&(q.zLabel=void 0),Ke.indexOf("text")===-1&&(q.text=void 0),Ke.indexOf("name")===-1&&(q.name=void 0)),q}function ue(q,ae,ie){var fe=ie.container,we=ie.fullLayout,Ae=we._size,Fe=ie.event,Ce=!!ae.hLinePoint,qe=!!ae.vLinePoint,et,Qe;if(fe.selectAll(".spikeline").remove(),!!(qe||Ce)){var Ke=n.combine(we.plot_bgcolor,we.paper_bgcolor);if(Ce){var Xe=ae.hLinePoint,Me,xe;et=Xe&&Xe.xa,Qe=Xe&&Xe.ya;var ce=Qe.spikesnap;ce==="cursor"?(Me=Fe.pointerX,xe=Fe.pointerY):(Me=et._offset+Xe.x,xe=Qe._offset+Xe.y);var Re=x.readability(Xe.color,Ke)<1.5?n.contrast(Ke):Xe.color,$e=Qe.spikemode,rt=Qe.spikethickness,Je=Qe.spikecolor||Re,At=c.getPxPosition(q,Qe),St,Rt;if($e.indexOf("toaxis")!==-1||$e.indexOf("across")!==-1){if($e.indexOf("toaxis")!==-1&&(St=At,Rt=Me),$e.indexOf("across")!==-1){var Ut=Qe._counterDomainMin,ir=Qe._counterDomainMax;Qe.anchor==="free"&&(Ut=Math.min(Ut,Qe.position),ir=Math.max(ir,Qe.position)),St=Ae.l+Ut*Ae.w,Rt=Ae.l+ir*Ae.w}fe.insert("line",":first-child").attr({x1:St,x2:Rt,y1:xe,y2:xe,"stroke-width":rt,stroke:Je,"stroke-dasharray":i.dashStyle(Qe.spikedash,rt)}).classed("spikeline",!0).classed("crisp",!0),fe.insert("line",":first-child").attr({x1:St,x2:Rt,y1:xe,y2:xe,"stroke-width":rt+2,stroke:Ke}).classed("spikeline",!0).classed("crisp",!0)}$e.indexOf("marker")!==-1&&fe.insert("circle",":first-child").attr({cx:At+(Qe.side!=="right"?rt:-rt),cy:xe,r:rt,fill:Je}).classed("spikeline",!0)}if(qe){var ar=ae.vLinePoint,Mr,fr;et=ar&&ar.xa,Qe=ar&&ar.ya;var dr=et.spikesnap;dr==="cursor"?(Mr=Fe.pointerX,fr=Fe.pointerY):(Mr=et._offset+ar.x,fr=Qe._offset+ar.y);var pt=x.readability(ar.color,Ke)<1.5?n.contrast(Ke):ar.color,ze=et.spikemode,Ge=et.spikethickness,Oe=et.spikecolor||pt,ve=c.getPxPosition(q,et),ge,be;if(ze.indexOf("toaxis")!==-1||ze.indexOf("across")!==-1){if(ze.indexOf("toaxis")!==-1&&(ge=ve,be=fr),ze.indexOf("across")!==-1){var Pe=et._counterDomainMin,We=et._counterDomainMax;et.anchor==="free"&&(Pe=Math.min(Pe,et.position),We=Math.max(We,et.position)),ge=Ae.t+(1-We)*Ae.h,be=Ae.t+(1-Pe)*Ae.h}fe.insert("line",":first-child").attr({x1:Mr,x2:Mr,y1:ge,y2:be,"stroke-width":Ge,stroke:Oe,"stroke-dasharray":i.dashStyle(et.spikedash,Ge)}).classed("spikeline",!0).classed("crisp",!0),fe.insert("line",":first-child").attr({x1:Mr,x2:Mr,y1:ge,y2:be,"stroke-width":Ge+2,stroke:Ke}).classed("spikeline",!0).classed("crisp",!0)}ze.indexOf("marker")!==-1&&fe.insert("circle",":first-child").attr({cx:Mr,cy:ve-(et.side!=="top"?Ge:-Ge),r:Ge,fill:Oe}).classed("spikeline",!0)}}}function oe(q,ae,ie){if(!ie||ie.length!==q._hoverdata.length)return!0;for(var fe=ie.length-1;fe>=0;fe--){var we=ie[fe],Ae=q._hoverdata[fe];if(we.curveNumber!==Ae.curveNumber||String(we.pointNumber)!==String(Ae.pointNumber)||String(we.pointNumbers)!==String(Ae.pointNumbers))return!0}return!1}function le(q,ae){return!0}function j(q,ae){return o.plainText(q||"",{len:ae,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function J(q,ae){for(var ie=ae.charAt(0),fe=[],we=[],Ae=[],Fe=0;Fe"," plotly-logomark"," "," "," "," "," "," "," "," "," "," "," "," "," ",""].join("")}}}}),o1=He({"src/components/shapes/draw_newshape/constants.js"(Y,G){var d=32;G.exports={CIRCLE_SIDES:d,i000:0,i090:d/4,i180:d/2,i270:d/4*3,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),s1=He({"src/components/selections/helpers.js"(Y,G){var d=Gr().strTranslate;function x(t,r){switch(t.type){case"log":return t.p2d(r);case"date":return t.p2r(r,0,t.calendar);default:return t.p2r(r)}}function A(t,r){switch(t.type){case"log":return t.d2p(r);case"date":return t.r2p(r,0,t.calendar);default:return t.r2p(r)}}function E(t){var r=t._id.charAt(0)==="y"?1:0;return function(o){return x(t,o[r])}}function e(t){return d(t.xaxis._offset,t.yaxis._offset)}G.exports={p2r:x,r2p:A,axValue:E,getTransform:e}}}),Gd=He({"src/components/shapes/draw_newshape/helpers.js"(Y){var G=Yg(),d=o1(),x=d.CIRCLE_SIDES,A=d.SQRT2,E=s1(),e=E.p2r,t=E.r2p,r=[0,3,4,5,6,1,2],o=[0,3,4,1,2];Y.writePaths=function(n){var s=n.length;if(!s)return"M0,0Z";for(var c="",f=0;f0&&yl&&(b="X"),b});return f>l&&(y=y.replace(/[\s,]*X.*/,""),d.log("Ignoring extra params in segment "+c)),v+y})}function E(e,t){t=t||0;var r=0;return t&&e&&(e.type==="category"||e.type==="multicategory")&&(r=(e.r2p(1)-e.r2p(0))*t),r}}}),zb=He({"src/components/shapes/display_labels.js"(Y,G){var d=Gr(),x=io(),A=yl(),E=vo(),e=Gd().readPaths,t=Wd(),r=t.getPathString,o=Jm(),a=df().FROM_TL;G.exports=function(c,f,v,h){if(h.selectAll(".shape-label").remove(),!!(v.label.text||v.label.texttemplate)){var T;if(v.label.texttemplate){var l={};if(v.type!=="path"){var y=x.getFromId(c,v.xref),b=x.getFromId(c,v.yref);for(var S in o){var M=o[S](v,y,b);M!==void 0&&(l[S]=M)}}T=d.texttemplateStringForShapes(v.label.texttemplate,{},c._fullLayout._d3locale,l)}else T=v.label.text;var _={"data-index":f},w=v.label.font,p={"data-notex":1},u=h.append("g").attr(_).classed("shape-label",!0),g=u.append("text").attr(p).classed("shape-label-text",!0).text(T),m,R,P,z;if(v.path){var F=r(c,v),B=e(F,c);m=1/0,P=1/0,R=-1/0,z=-1/0;for(var O=0;O=s?h=c-v:h=v-c,-180/Math.PI*Math.atan2(h,T)}function n(s,c,f,v,h,T,l){var y=h.label.textposition,b=h.label.textangle,S=h.label.padding,M=h.type,_=Math.PI/180*T,w=Math.sin(_),p=Math.cos(_),u=h.label.xanchor,g=h.label.yanchor,m,R,P,z;if(M==="line"){y==="start"?(m=s,R=c):y==="end"?(m=f,R=v):(m=(s+f)/2,R=(c+v)/2),u==="auto"&&(y==="start"?b==="auto"?f>s?u="left":fs?u="right":fs?u="right":fs?u="left":f1&&!(Ke.length===2&&Ke[1][0]==="Z")&&(j===0&&(Ke[0][0]="M"),m[le]=Ke,B(),O())}}function fe(Ke,Xe){if(Ke===2){le=+Xe.srcElement.getAttribute("data-i"),j=+Xe.srcElement.getAttribute("data-j");var Me=m[le];!T(Me)&&!l(Me)&&ie()}}function we(Ke){ue=[];for(var Xe=0;XeB&&Pe>O&&!ve.shiftKey?s.getCursor(We/be,1-ct/Pe):"move";c(m,_t),St=_t.split("-")[0]}}function ar(ve){l(g)||(L&&(J=ce(R.xanchor)),N&&($=Re(R.yanchor)),R.type==="path"?Ae=R.path:(ue=L?R.x0:ce(R.x0),oe=N?R.y0:Re(R.y0),le=L?R.x1:ce(R.x1),j=N?R.y1:Re(R.y1)),uej?(X=oe,ae="y0",re=j,ie="y1"):(X=j,ae="y1",re=oe,ie="y0"),ir(ve),ze(z,R),Oe(m,R,g),At.moveFn=St==="move"?dr:pt,At.altKey=ve.altKey)}function Mr(){l(g)||(c(m),Ge(z),S(m,g,R),x.call("_guiRelayout",g,F.getUpdateObj()))}function fr(){l(g)||Ge(z)}function dr(ve,ge){if(R.type==="path"){var be=function(ct){return ct},Pe=be,We=be;L?Q("xanchor",R.xanchor=$e(J+ve)):(Pe=function(_t){return $e(ce(_t)+ve)},Ce&&Ce.type==="date"&&(Pe=v.encodeDate(Pe))),N?Q("yanchor",R.yanchor=rt($+ge)):(We=function(_t){return rt(Re(_t)+ge)},et&&et.type==="date"&&(We=v.encodeDate(We))),Q("path",R.path=_(Ae,Pe,We))}else L?Q("xanchor",R.xanchor=$e(J+ve)):(Q("x0",R.x0=$e(ue+ve)),Q("x1",R.x1=$e(le+ve))),N?Q("yanchor",R.yanchor=rt($+ge)):(Q("y0",R.y0=rt(oe+ge)),Q("y1",R.y1=rt(j+ge)));m.attr("d",h(g,R)),ze(z,R),r(g,P,R,Fe)}function pt(ve,ge){if(Z){var be=function(va){return va},Pe=be,We=be;L?Q("xanchor",R.xanchor=$e(J+ve)):(Pe=function(La){return $e(ce(La)+ve)},Ce&&Ce.type==="date"&&(Pe=v.encodeDate(Pe))),N?Q("yanchor",R.yanchor=rt($+ge)):(We=function(La){return rt(Re(La)+ge)},et&&et.type==="date"&&(We=v.encodeDate(We))),Q("path",R.path=_(Ae,Pe,We))}else if(U){if(St==="resize-over-start-point"){var ct=ue+ve,_t=N?oe-ge:oe+ge;Q("x0",R.x0=L?ct:$e(ct)),Q("y0",R.y0=N?_t:rt(_t))}else if(St==="resize-over-end-point"){var Mt=le+ve,Nt=N?j-ge:j+ge;Q("x1",R.x1=L?Mt:$e(Mt)),Q("y1",R.y1=N?Nt:rt(Nt))}}else{var Bt=function(va){return St.indexOf(va)!==-1},qt=Bt("n"),Zt=Bt("s"),lr=Bt("w"),ta=Bt("e"),da=qt?X+ge:X,wa=Zt?re+ge:re,ma=lr?ee+ve:ee,Ia=ta?q+ve:q;N&&(qt&&(da=X-ge),Zt&&(wa=re-ge)),(!N&&wa-da>O||N&&da-wa>O)&&(Q(ae,R[ae]=N?da:rt(da)),Q(ie,R[ie]=N?wa:rt(wa))),Ia-ma>B&&(Q(fe,R[fe]=L?ma:$e(ma)),Q(we,R[we]=L?Ia:$e(Ia)))}m.attr("d",h(g,R)),ze(z,R),r(g,P,R,Fe)}function ze(ve,ge){(L||N)&&be();function be(){var Pe=ge.type!=="path",We=ve.selectAll(".visual-cue").data([0]),ct=1;We.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":ct}).classed("visual-cue",!0);var _t=ce(L?ge.xanchor:A.midRange(Pe?[ge.x0,ge.x1]:v.extractPathCoords(ge.path,f.paramIsX))),Mt=Re(N?ge.yanchor:A.midRange(Pe?[ge.y0,ge.y1]:v.extractPathCoords(ge.path,f.paramIsY)));if(_t=v.roundPositionForSharpStrokeRendering(_t,ct),Mt=v.roundPositionForSharpStrokeRendering(Mt,ct),L&&N){var Nt="M"+(_t-1-ct)+","+(Mt-1-ct)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";We.attr("d",Nt)}else if(L){var Bt="M"+(_t-1-ct)+","+(Mt-9-ct)+"v18 h2 v-18 Z";We.attr("d",Bt)}else{var qt="M"+(_t-9-ct)+","+(Mt-1-ct)+"h18 v2 h-18 Z";We.attr("d",qt)}}}function Ge(ve){ve.selectAll(".visual-cue").remove()}function Oe(ve,ge,be){var Pe=ge.xref,We=ge.yref,ct=E.getFromId(be,Pe),_t=E.getFromId(be,We),Mt="";Pe!=="paper"&&!ct.autorange&&(Mt+=Pe),We!=="paper"&&!_t.autorange&&(Mt+=We),i.setClipUrl(ve,Mt?"clip"+be._fullLayout._uid+Mt:null,be)}}function _(g,m,R){return g.replace(f.segmentRE,function(P){var z=0,F=P.charAt(0),B=f.paramIsX[F],O=f.paramIsY[F],L=f.numParams[F],N=P.substr(1).replace(f.paramRE,function(U){return z>=L||(B[z]?U=m(U):O[z]&&(U=R(U)),z++),U});return F+N})}function w(g,m){if(y(g)){var R=m.node(),P=+R.getAttribute("data-index");if(P>=0){if(P===g._fullLayout._activeShapeIndex){p(g);return}g._fullLayout._activeShapeIndex=P,g._fullLayout._deactivateShape=p,T(g)}}}function p(g){if(y(g)){var m=g._fullLayout._activeShapeIndex;m>=0&&(o(g),delete g._fullLayout._activeShapeIndex,T(g))}}function u(g){if(y(g)){o(g);var m=g._fullLayout._activeShapeIndex,R=(g.layout||{}).shapes||[];if(m1?(oe=["toggleHover"],le=["resetViews"]):u?(ue=["zoomInGeo","zoomOutGeo"],oe=["hoverClosestGeo"],le=["resetGeo"]):p?(oe=["hoverClosest3d"],le=["resetCameraDefault3d","resetCameraLastSave3d"]):P?(ue=["zoomInMapbox","zoomOutMapbox"],oe=["toggleHover"],le=["resetViewMapbox"]):z?(ue=["zoomInMap","zoomOutMap"],oe=["toggleHover"],le=["resetViewMap"]):g?oe=["hoverClosestPie"]:O?(oe=["hoverClosestCartesian","hoverCompareCartesian"],le=["resetViewSankey"]):oe=["toggleHover"],w&&oe.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(s(T)||N)&&(oe=[]),w&&!L&&(ue=["zoomIn2d","zoomOut2d","autoScale2d"],le[0]!=="resetViews"&&(le=["resetScale2d"])),p?j=["zoom3d","pan3d","orbitRotation","tableRotation"]:w&&!L||R?j=["zoom2d","pan2d"]:P||z||u?j=["pan2d"]:F&&(j=["zoom2d"]),n(T)&&j.push("select2d","lasso2d");var J=[],$=function(q){J.indexOf(q)===-1&&oe.indexOf(q)!==-1&&J.push(q)};if(Array.isArray(M)){for(var X=[],re=0;reb?T.substr(b):l.substr(y))+S}function c(v,h){for(var T=h._size,l=T.h/T.w,y={},b=Object.keys(v),S=0;St*R&&!B)){for(b=0;bj&&ieoe&&(oe=ie);var we=(oe-ue)/(2*le);u/=we,ue=_.l2r(ue),oe=_.l2r(oe),_.range=_._input.range=U=O[1]||Z[1]<=O[0])&&Q[0]L[0])return!0}return!1}function S(O){var L=O._fullLayout,N=L._size,U=N.p,Z=i.list(O,"",!0),Q,ue,oe,le,j,J;if(L._paperdiv.style({width:O._context.responsive&&L.autosize&&!O._context._hasZeroWidth&&!O.layout.width?"100%":L.width+"px",height:O._context.responsive&&L.autosize&&!O._context._hasZeroHeight&&!O.layout.height?"100%":L.height+"px"}).selectAll(".main-svg").call(r.setSize,L.width,L.height),O._context.setBackground(O,L.paper_bgcolor),Y.drawMainTitle(O),a.manage(O),!L._has("cartesian"))return x.previousPromises(O);function $(Oe,ve,ge){var be=Oe._lw/2;if(Oe._id.charAt(0)==="x"){if(ve){if(ge==="top")return ve._offset-U-be}else return N.t+N.h*(1-(Oe.position||0))+be%1;return ve._offset+ve._length+U+be}if(ve){if(ge==="right")return ve._offset+ve._length+U+be}else return N.l+N.w*(Oe.position||0)+be%1;return ve._offset-U-be}for(Q=0;Q0){m(O,Q,j,le),oe.attr({x:ue,y:Q,"text-anchor":U,dy:z(L.yanchor)}).call(E.positionText,ue,Q);var J=(L.text.match(E.BR_TAG_ALL)||[]).length;if(J){var $=n.LINE_SPACING*J+n.MID_SHIFT;L.y===0&&($=-$),oe.selectAll(".line").each(function(){var ae=+this.getAttribute("dy").slice(0,-2)-$+"em";this.setAttribute("dy",ae)})}var X=G.selectAll(".gtitle-subtitle");if(X.node()){var re=oe.node().getBBox(),ee=re.y+re.height,q=ee+o.SUBTITLE_PADDING_EM*L.subtitle.font.size;X.attr({x:ue,y:q,"text-anchor":U,dy:z(L.yanchor)}).call(E.positionText,ue,q)}}}};function p(O,L,N,U,Z){var Q=L.yref==="paper"?O._fullLayout._size.h:O._fullLayout.height,ue=A.isTopAnchor(L)?U:U-Z,oe=N==="b"?Q-ue:ue;return A.isTopAnchor(L)&&N==="t"||A.isBottomAnchor(L)&&N==="b"?!1:oe.5?"t":"b",ue=O._fullLayout.margin[Q],oe=0;return L.yref==="paper"?oe=N+L.pad.t+L.pad.b:L.yref==="container"&&(oe=u(Q,U,Z,O._fullLayout.height,N)+L.pad.t+L.pad.b),oe>ue?oe:0}function m(O,L,N,U){var Z="title.automargin",Q=O._fullLayout.title,ue=Q.y>.5?"t":"b",oe={x:Q.x,y:Q.y,t:0,b:0},le={};Q.yref==="paper"&&p(O,Q,ue,L,U)?oe[ue]=N:Q.yref==="container"&&(le[ue]=N,O._fullLayout._reservedMargin[Z]=le),x.allowAutoMargin(O,Z),x.autoMargin(O,Z,oe)}function R(O,L){var N=O.title,U=O._size,Z=0;switch(L===h?Z=N.pad.l:L===l&&(Z=-N.pad.r),N.xref){case"paper":return U.l+U.w*N.x+Z;case"container":default:return O.width*N.x+Z}}function P(O,L){var N=O.title,U=O._size,Z=0;if(L==="0em"||!L?Z=-N.pad.b:L===n.CAP_SHIFT+"em"&&(Z=N.pad.t),N.y==="auto")return U.t/2;switch(N.yref){case"paper":return U.t+U.h-U.h*N.y+Z;case"container":default:return O.height-O.height*N.y+Z}}function z(O){return O==="top"?n.CAP_SHIFT+.3+"em":O==="bottom"?"-0.3em":n.MID_SHIFT+"em"}function F(O){var L=O.title,N=T;return A.isRightAnchor(L)?N=l:A.isLeftAnchor(L)&&(N=h),N}function B(O){var L=O.title,N="0em";return A.isTopAnchor(L)?N=n.CAP_SHIFT+"em":A.isMiddleAnchor(L)&&(N=n.MID_SHIFT+"em"),N}Y.doTraceStyle=function(O){var L=O.calcdata,N=[],U;for(U=0;U=0;F--){var B=M.append("path").attr(w).style("opacity",F?.1:p).call(E.stroke,g).call(E.fill,u).call(e.dashLine,F?"solid":R,F?4+m:m);if(s(B,h,y),P){var O=t(h.layout,"selections",y);B.style({cursor:"move"});var L={element:B.node(),plotinfo:b,gd:h,editHelpers:O,isActiveSelection:!0},N=d(_,h);x(N,B,L)}else B.style("pointer-events",F?"all":"none");z[F]=B}var U=z[0],Z=z[1];Z.node().addEventListener("click",function(){return c(h,U)})}}function s(h,T,l){var y=l.xref+l.yref;e.setClipUrl(h,"clip"+T._fullLayout._uid+y,T)}function c(h,T){if(i(h)){var l=T.node(),y=+l.getAttribute("data-index");if(y>=0){if(y===h._fullLayout._activeSelectionIndex){v(h);return}h._fullLayout._activeSelectionIndex=y,h._fullLayout._deactivateSelection=v,a(h)}}}function f(h){if(i(h)){var T=h._fullLayout.selections.length-1;h._fullLayout._activeSelectionIndex=T,h._fullLayout._deactivateSelection=v,a(h)}}function v(h){if(i(h)){var T=h._fullLayout._activeSelectionIndex;T>=0&&(A(h),delete h._fullLayout._activeSelectionIndex,a(h))}}}}),gM=He({"node_modules/polybooljs/lib/build-log.js"(Y,G){function d(){var x,A=0,E=!1;function e(t,r){return x.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),x}return x={list:[],segmentId:function(){return A++},checkIntersection:function(t,r){return e("check",{seg1:t,seg2:r})},segmentChop:function(t,r){return e("div_seg",{seg:t,pt:r}),e("chop",{seg:t,pt:r})},statusRemove:function(t){return e("pop_seg",{seg:t})},segmentUpdate:function(t){return e("seg_update",{seg:t})},segmentNew:function(t,r){return e("new_seg",{seg:t,primary:r})},segmentRemove:function(t){return e("rem_seg",{seg:t})},tempStatus:function(t,r,o){return e("temp_status",{seg:t,above:r,below:o})},rewind:function(t){return e("rewind",{seg:t})},status:function(t,r,o){return e("status",{seg:t,above:r,below:o})},vert:function(t){return t===E?x:(E=t,e("vert",{x:t}))},log:function(t){return typeof t!="string"&&(t=JSON.stringify(t,!1," ")),e("log",{txt:t})},reset:function(){return e("reset")},selected:function(t){return e("selected",{segs:t})},chainStart:function(t){return e("chain_start",{seg:t})},chainRemoveHead:function(t,r){return e("chain_rem_head",{index:t,pt:r})},chainRemoveTail:function(t,r){return e("chain_rem_tail",{index:t,pt:r})},chainNew:function(t,r){return e("chain_new",{pt1:t,pt2:r})},chainMatch:function(t){return e("chain_match",{index:t})},chainClose:function(t){return e("chain_close",{index:t})},chainAddHead:function(t,r){return e("chain_add_head",{index:t,pt:r})},chainAddTail:function(t,r){return e("chain_add_tail",{index:t,pt:r})},chainConnect:function(t,r){return e("chain_con",{index1:t,index2:r})},chainReverse:function(t){return e("chain_rev",{index:t})},chainJoin:function(t,r){return e("chain_join",{index1:t,index2:r})},done:function(){return e("done")}},x}G.exports=d}}),yM=He({"node_modules/polybooljs/lib/epsilon.js"(Y,G){function d(x){typeof x!="number"&&(x=1e-10);var A={epsilon:function(E){return typeof E=="number"&&(x=E),x},pointAboveOrOnLine:function(E,e,t){var r=e[0],o=e[1],a=t[0],i=t[1],n=E[0],s=E[1];return(a-r)*(s-o)-(i-o)*(n-r)>=-x},pointBetween:function(E,e,t){var r=E[1]-e[1],o=t[0]-e[0],a=E[0]-e[0],i=t[1]-e[1],n=a*o+r*i;if(n-x)},pointsSameX:function(E,e){return Math.abs(E[0]-e[0])x!=a-r>x&&(o-s)*(r-c)/(a-c)+s-t>x&&(i=!i),o=s,a=c}return i}};return A}G.exports=d}}),mM=He({"node_modules/polybooljs/lib/linked-list.js"(Y,G){var d={create:function(){var x={root:{root:!0,next:null},exists:function(A){return!(A===null||A===x.root)},isEmpty:function(){return x.root.next===null},getHead:function(){return x.root.next},insertBefore:function(A,E){for(var e=x.root,t=x.root.next;t!==null;){if(E(t)){A.prev=t.prev,A.next=t,t.prev.next=A,t.prev=A;return}e=t,t=t.next}e.next=A,A.prev=e,A.next=null},findTransition:function(A){for(var E=x.root,e=x.root.next;e!==null&&!A(e);)E=e,e=e.next;return{before:E===x.root?null:E,after:e,insert:function(t){return t.prev=E,t.next=e,E.next=t,e!==null&&(e.prev=t),t}}}};return x},node:function(x){return x.prev=null,x.next=null,x.remove=function(){x.prev.next=x.next,x.next&&(x.next.prev=x.prev),x.prev=null,x.next=null},x}};G.exports=d}}),_M=He({"node_modules/polybooljs/lib/intersecter.js"(Y,G){var d=mM();function x(A,E,e){function t(T,l){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:null,below:null},otherFill:null}}function r(T,l,y){return{id:e?e.segmentId():-1,start:T,end:l,myFill:{above:y.myFill.above,below:y.myFill.below},otherFill:null}}var o=d.create();function a(T,l,y,b,S,M){var _=E.pointsCompare(l,S);return _!==0?_:E.pointsSame(y,M)?0:T!==b?T?1:-1:E.pointAboveOrOnLine(y,b?S:M,b?M:S)?1:-1}function i(T,l){o.insertBefore(T,function(y){var b=a(T.isStart,T.pt,l,y.isStart,y.pt,y.other.pt);return b<0})}function n(T,l){var y=d.node({isStart:!0,pt:T.start,seg:T,primary:l,other:null,status:null});return i(y,T.end),y}function s(T,l,y){var b=d.node({isStart:!1,pt:l.end,seg:l,primary:y,other:T,status:null});T.other=b,i(b,T.pt)}function c(T,l){var y=n(T,l);return s(y,T,l),y}function f(T,l){e&&e.segmentChop(T.seg,l),T.other.remove(),T.seg.end=l,T.other.pt=l,i(T.other,T.pt)}function v(T,l){var y=r(l,T.seg.end,T.seg);return f(T,l),c(y,T.primary)}function h(T,l){var y=d.create();function b(B,O){var L=B.seg.start,N=B.seg.end,U=O.seg.start,Z=O.seg.end;return E.pointsCollinear(L,U,Z)?E.pointsCollinear(N,U,Z)||E.pointAboveOrOnLine(N,U,Z)?1:-1:E.pointAboveOrOnLine(L,U,Z)?1:-1}function S(B){return y.findTransition(function(O){var L=b(B,O.ev);return L>0})}function M(B,O){var L=B.seg,N=O.seg,U=L.start,Z=L.end,Q=N.start,ue=N.end;e&&e.checkIntersection(L,N);var oe=E.linesIntersect(U,Z,Q,ue);if(oe===!1){if(!E.pointsCollinear(U,Z,Q)||E.pointsSame(U,ue)||E.pointsSame(Z,Q))return!1;var le=E.pointsSame(U,Q),j=E.pointsSame(Z,ue);if(le&&j)return O;var J=!le&&E.pointBetween(U,Q,ue),$=!j&&E.pointBetween(Z,Q,ue);if(le)return $?v(O,Z):v(B,ue),O;J&&(j||($?v(O,Z):v(B,ue)),v(O,U))}else oe.alongA===0&&(oe.alongB===-1?v(B,Q):oe.alongB===0?v(B,oe.pt):oe.alongB===1&&v(B,ue)),oe.alongB===0&&(oe.alongA===-1?v(O,U):oe.alongA===0?v(O,oe.pt):oe.alongA===1&&v(O,Z));return!1}for(var _=[];!o.isEmpty();){var w=o.getHead();if(e&&e.vert(w.pt[0]),w.isStart){let B=function(){if(u){var O=M(w,u);if(O)return O}return g?M(w,g):!1};e&&e.segmentNew(w.seg,w.primary);var p=S(w),u=p.before?p.before.ev:null,g=p.after?p.after.ev:null;e&&e.tempStatus(w.seg,u?u.seg:!1,g?g.seg:!1);var m=B();if(m){if(A){var R;w.seg.myFill.below===null?R=!0:R=w.seg.myFill.above!==w.seg.myFill.below,R&&(m.seg.myFill.above=!m.seg.myFill.above)}else m.seg.otherFill=w.seg.myFill;e&&e.segmentUpdate(m.seg),w.other.remove(),w.remove()}if(o.getHead()!==w){e&&e.rewind(w.seg);continue}if(A){var R;w.seg.myFill.below===null?R=!0:R=w.seg.myFill.above!==w.seg.myFill.below,g?w.seg.myFill.below=g.seg.myFill.above:w.seg.myFill.below=T,R?w.seg.myFill.above=!w.seg.myFill.below:w.seg.myFill.above=w.seg.myFill.below}else if(w.seg.otherFill===null){var P;g?w.primary===g.primary?P=g.seg.otherFill.above:P=g.seg.myFill.above:P=w.primary?l:T,w.seg.otherFill={above:P,below:P}}e&&e.status(w.seg,u?u.seg:!1,g?g.seg:!1),w.other.status=p.insert(d.node({ev:w}))}else{var z=w.status;if(z===null)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(y.exists(z.prev)&&y.exists(z.next)&&M(z.prev.ev,z.next.ev),e&&e.statusRemove(z.ev.seg),z.remove(),!w.primary){var F=w.seg.myFill;w.seg.myFill=w.seg.otherFill,w.seg.otherFill=F}_.push(w.seg)}o.getHead().remove()}return e&&e.done(),_}return A?{addRegion:function(T){for(var l,y=T[T.length-1],b=0;br!=v>r&&t<(f-s)*(r-c)/(v-c)+s;h&&(o=!o)}return o}}}),ey=He({"src/lib/polygon.js"(Y,G){var d=Km().dot,x=lo().BADNUM,A=G.exports={};A.tester=function(e){var t=e.slice(),r=t[0][0],o=r,a=t[0][1],i=a,n;for((t[t.length-1][0]!==t[0][0]||t[t.length-1][1]!==t[0][1])&&t.push(t[0]),n=1;no||S===x||Si||y&&c(l))}function v(l,y){var b=l[0],S=l[1];if(b===x||bo||S===x||Si)return!1;var M=t.length,_=t[0][0],w=t[0][1],p=0,u,g,m,R,P;for(u=1;uMath.max(g,_)||S>Math.max(m,w)))if(Sn||Math.abs(d(v,c))>o)return!0;return!1},A.filter=function(e,t){var r=[e[0]],o=0,a=0;function i(s){e.push(s);var c=r.length,f=o;r.splice(a+1);for(var v=f+1;v1){var n=e.pop();i(n)}return{addPt:i,raw:e,filtered:r}}}}),SM=He({"src/components/selections/constants.js"(Y,G){G.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),MM=He({"src/components/selections/select.js"(Y,G){var d=TM(),x=AM(),A=Ei(),E=vo().dashStyle,e=Ai(),t=Wu(),r=Ph().makeEventData,o=bv(),a=o.freeMode,i=o.rectMode,n=o.drawMode,s=o.openMode,c=o.selectMode,f=Wd(),v=$g(),h=u1(),T=jd().clearOutline,l=Gd(),y=l.handleEllipse,b=l.readPaths,S=l1().newShapes,M=Db(),_=jb().activateLastSelection,w=Gr(),p=w.sorterAsc,u=ey(),g=e1(),m=oc().getFromId,R=Jg(),P=Qg().redrawReglTraces,z=SM(),F=z.MINSELECT,B=u.filter,O=u.tester,L=s1(),N=L.p2r,U=L.axValue,Z=L.getTransform;function Q(ze){return ze.subplot!==void 0}function ue(ze,Ge,Oe,ve,ge){var be=!Q(ve),Pe=a(ge),We=i(ge),ct=s(ge),_t=n(ge),Mt=c(ge),Nt=ge==="drawline",Bt=ge==="drawcircle",qt=Nt||Bt,Zt=ve.gd,lr=Zt._fullLayout,ta=Mt&&lr.newselection.mode==="immediate"&&be,da=lr._zoomlayer,wa=ve.element.getBoundingClientRect(),ma=ve.plotinfo,Ia=Z(ma),va=Ge-wa.left,La=Oe-wa.top;lr._calcInverseTransform(Zt);var Ka=w.apply3DTransform(lr._invTransform)(va,La);va=Ka[0],La=Ka[1];var Vt=lr._invScaleX,Lt=lr._invScaleY,jt=va,Ot=La,gr="M"+va+","+La,Br=ve.xaxes[0],na=ve.yaxes[0],Ur=Br._length,ga=na._length,Aa=ze.altKey&&!(n(ge)&&ct),Pa,sa,Oa,dt,vt,Lr,Er;X(ze,Zt,ve),Pe&&(Pa=B([[va,La]],z.BENDPX));var _r=da.selectAll("path.select-outline-"+ma.id).data([1]),yr=_t?lr.newshape:lr.newselection;_t&&(ve.hasText=yr.label.text||yr.label.texttemplate);var kr=_t&&!ct?yr.fillcolor:"rgba(0,0,0,0)",zr=yr.line.color||(be?e.contrast(Zt._fullLayout.plot_bgcolor):"#7f7f7f");_r.enter().append("path").attr("class","select-outline select-outline-"+ma.id).style({opacity:_t?yr.opacity/2:1,"stroke-dasharray":E(yr.line.dash,yr.line.width),"stroke-width":yr.line.width+"px","shape-rendering":"crispEdges"}).call(e.stroke,zr).call(e.fill,kr).attr("fill-rule","evenodd").classed("cursor-move",!!_t).attr("transform",Ia).attr("d",gr+"Z");var Pr=da.append("path").attr("class","zoombox-corners").style({fill:e.background,stroke:e.defaultLine,"stroke-width":1}).attr("transform",Ia).attr("d","M0,0Z");if(_t&&ve.hasText){var Hr=da.select(".label-temp");Hr.empty()&&(Hr=da.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Zr=lr._uid+z.SELECTID,Jr=[],wt=ie(Zt,ve.xaxes,ve.yaxes,ve.subplot);ta&&!ze.shiftKey&&(ve._clearSubplotSelections=function(){if(be){var mr=Br._id,$r=na._id;rt(Zt,mr,$r,wt);for(var oa=(Zt.layout||{}).selections||[],Sa=[],ya=!1,ra=0;ra=0){Zt._fullLayout._deactivateShape(Zt);return}if(!_t){var oa=lr.clickmode;g.done(Zr).then(function(){if(g.clear(Zr),mr===2){for(_r.remove(),vt=0;vt-1&&oe($r,Zt,ve.xaxes,ve.yaxes,ve.subplot,ve,_r),oa==="event"&&dr(Zt,void 0);t.click(Zt,$r,ma.id)}).catch(w.error)}},ve.doneFn=function(){Pr.remove(),g.done(Zr).then(function(){g.clear(Zr),!ta&&dt&&ve.selectionDefs&&(dt.subtract=Aa,ve.selectionDefs.push(dt),ve.mergedPolygons.length=0,[].push.apply(ve.mergedPolygons,Oa)),(ta||_t)&&q(ve,ta),ve.doneFnCompleted&&ve.doneFnCompleted(Jr),Mt&&dr(Zt,Er)}).catch(w.error)}}function oe(ze,Ge,Oe,ve,ge,be,Pe){var We=Ge._hoverdata,ct=Ge._fullLayout,_t=ct.clickmode,Mt=_t.indexOf("event")>-1,Nt=[],Bt,qt,Zt,lr,ta,da,wa,ma,Ia,va;if(we(We)){X(ze,Ge,be),Bt=ie(Ge,Oe,ve,ge);var La=Ae(We,Bt),Ka=La.pointNumbers.length>0;if(Ka?Ce(Bt,La):qe(Bt)&&(wa=Fe(La))){for(Pe&&Pe.remove(),va=0;va=0}function ee(ze){return ze._fullLayout._activeSelectionIndex>=0}function q(ze,Ge){var Oe=ze.dragmode,ve=ze.plotinfo,ge=ze.gd;re(ge)&&ge._fullLayout._deactivateShape(ge),ee(ge)&&ge._fullLayout._deactivateSelection(ge);var be=ge._fullLayout,Pe=be._zoomlayer,We=n(Oe),ct=c(Oe);if(We||ct){var _t=Pe.selectAll(".select-outline-"+ve.id);if(_t&&ge._fullLayout._outlining){var Mt;We&&(Mt=S(_t,ze)),Mt&&A.call("_guiRelayout",ge,{shapes:Mt});var Nt;ct&&!Q(ze)&&(Nt=M(_t,ze)),Nt&&(ge._fullLayout._noEmitSelectedAtStart=!0,A.call("_guiRelayout",ge,{selections:Nt}).then(function(){Ge&&_(ge)})),ge._fullLayout._outlining=!1}}ve.selection={},ve.selection.selectionDefs=ze.selectionDefs=[],ve.selection.mergedPolygons=ze.mergedPolygons=[]}function ae(ze){return ze._id}function ie(ze,Ge,Oe,ve){if(!ze.calcdata)return[];var ge=[],be=Ge.map(ae),Pe=Oe.map(ae),We,ct,_t;for(_t=0;_t0,be=ge?ve[0]:Oe;return Ge.selectedpoints?Ge.selectedpoints.indexOf(be)>-1:!1}function Ce(ze,Ge){var Oe=[],ve,ge,be,Pe;for(Pe=0;Pe0&&Oe.push(ve);if(Oe.length===1&&(be=Oe[0]===Ge.searchInfo,be&&(ge=Ge.searchInfo.cd[0].trace,ge.selectedpoints.length===Ge.pointNumbers.length))){for(Pe=0;Pe1||(Ge+=ve.selectedpoints.length,Ge>1)))return!1;return Ge===1}function et(ze,Ge,Oe){var ve;for(ve=0;ve-1&&Ge;if(!Pe&&Ge){var mr=At(ze,!0);if(mr.length){var $r=mr[0].xref,oa=mr[0].yref;if($r&&oa){var Sa=Ut(mr),ya=ar([m(ze,$r,"x"),m(ze,oa,"y")]);ya(Jr,Sa)}}ze._fullLayout._noEmitSelectedAtStart?ze._fullLayout._noEmitSelectedAtStart=!1:Qt&&dr(ze,Jr),Bt._reselect=!1}if(!Pe&&Bt._deselect){var ra=Bt._deselect;We=ra.xref,ct=ra.yref,$e(We,ct,Mt)||rt(ze,We,ct,ve),Qt&&(Jr.points.length?dr(ze,Jr):pt(ze)),Bt._deselect=!1}return{eventData:Jr,selectionTesters:Oe}}function Re(ze){var Ge=ze.calcdata;if(Ge)for(var Oe=0;Oe=0){kr._fullLayout._deactivateShape(kr);return}var zr=kr._fullLayout.clickmode;if(J(kr),_r===2&&!Me&&sa(),Xe)zr.indexOf("select")>-1&&p(yr,kr,rt,Je,we.id,Mt),zr.indexOf("event")>-1&&n.click(kr,yr,we.id);else if(_r===1&&Me){var Pr=et?ce:xe,Hr=et==="s"||Qe==="w"?0:1,Zr=Pr._name+".range["+Hr+"]",Jr=L(Pr,Hr),wt="left",Qt="middle";if(Pr.fixedrange)return;et?(Qt=et==="n"?"top":"bottom",Pr.side==="right"&&(wt="right")):Qe==="e"&&(wt="right"),kr._context.showAxisRangeEntryBoxes&&d.select(_t).call(o.makeEditable,{gd:kr,immediate:!0,background:kr._fullLayout.paper_bgcolor,text:String(Jr),fill:Pr.tickfont?Pr.tickfont.color:"#444",horizontalAlign:wt,verticalAlign:Qt}).on("edit",function(mr){var $r=Pr.d2r(mr);$r!==void 0&&t.call("_guiRelayout",kr,Zr,$r)})}}f.init(Mt);var qt,Zt,lr,ta,da,wa,ma,Ia,va,La;function Ka(_r,yr,kr){var zr=_t.getBoundingClientRect();qt=yr-zr.left,Zt=kr-zr.top,fe._fullLayout._calcInverseTransform(fe);var Pr=x.apply3DTransform(fe._fullLayout._invTransform)(qt,Zt);qt=Pr[0],Zt=Pr[1],lr={l:qt,r:qt,w:0,t:Zt,b:Zt,h:0},ta=fe._hmpixcount?fe._hmlumcount/fe._hmpixcount:E(fe._fullLayout.plot_bgcolor).getLuminance(),da="M0,0H"+Rt+"V"+Ut+"H0V0",wa=!1,ma="xy",La=!1,Ia=ue(Ke,ta,At,St,da),va=oe(Ke,At,St)}function Vt(_r,yr){if(fe._transitioningWithDuration)return!1;var kr=Math.max(0,Math.min(Rt,be*_r+qt)),zr=Math.max(0,Math.min(Ut,Pe*yr+Zt)),Pr=Math.abs(kr-qt),Hr=Math.abs(zr-Zt);lr.l=Math.min(qt,kr),lr.r=Math.max(qt,kr),lr.t=Math.min(Zt,zr),lr.b=Math.max(Zt,zr);function Zr(){ma="",lr.r=lr.l,lr.t=lr.b,va.attr("d","M0,0Z")}if(ir.isSubplotConstrained)Pr>R||Hr>R?(ma="xy",Pr/Rt>Hr/Ut?(Hr=Pr*Ut/Rt,Zt>zr?lr.t=Zt-Hr:lr.b=Zt+Hr):(Pr=Hr*Rt/Ut,qt>kr?lr.l=qt-Pr:lr.r=qt+Pr),va.attr("d",ee(lr))):Zr();else if(ar.isSubplotConstrained)if(Pr>R||Hr>R){ma="xy";var Jr=Math.min(lr.l/Rt,(Ut-lr.b)/Ut),wt=Math.max(lr.r/Rt,(Ut-lr.t)/Ut);lr.l=Jr*Rt,lr.r=wt*Rt,lr.b=(1-Jr)*Ut,lr.t=(1-wt)*Ut,va.attr("d",ee(lr))}else Zr();else!fr||Hr0){var mr;if(ar.isSubplotConstrained||!Mr&&fr.length===1){for(mr=0;mr1&&(Zr.maxallowed!==void 0&&pt===(Zr.range[0]1&&(Jr.maxallowed!==void 0&&ze===(Jr.range[0]=0?Math.min(fe,.9):1/(1/Math.max(fe,-.3)+3.222))}function Q(fe,we,Ae){return fe?fe==="nsew"?Ae?"":we==="pan"?"move":"crosshair":fe.toLowerCase()+"-resize":"pointer"}function ue(fe,we,Ae,Fe,Ce){return fe.append("path").attr("class","zoombox").style({fill:we>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",r(Ae,Fe)).attr("d",Ce+"Z")}function oe(fe,we,Ae){return fe.append("path").attr("class","zoombox-corners").style({fill:a.background,stroke:a.defaultLine,"stroke-width":1,opacity:0}).attr("transform",r(we,Ae)).attr("d","M0,0Z")}function le(fe,we,Ae,Fe,Ce,qe){fe.attr("d",Fe+"M"+Ae.l+","+Ae.t+"v"+Ae.h+"h"+Ae.w+"v-"+Ae.h+"h-"+Ae.w+"Z"),j(fe,we,Ce,qe)}function j(fe,we,Ae,Fe){Ae||(fe.transition().style("fill",Fe>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),we.transition().style("opacity",1).duration(200))}function J(fe){d.select(fe).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function $(fe){P&&fe.data&&fe._context.showTips&&(x.notifier(x._(fe,"Double-click to zoom back out"),"long"),P=!1)}function X(fe,we){return"M"+(fe.l-.5)+","+(we-R-.5)+"h-3v"+(2*R+1)+"h3ZM"+(fe.r+.5)+","+(we-R-.5)+"h3v"+(2*R+1)+"h-3Z"}function re(fe,we){return"M"+(we-R-.5)+","+(fe.t-.5)+"v-3h"+(2*R+1)+"v3ZM"+(we-R-.5)+","+(fe.b+.5)+"v3h"+(2*R+1)+"v-3Z"}function ee(fe){var we=Math.floor(Math.min(fe.b-fe.t,fe.r-fe.l,R)/2);return"M"+(fe.l-3.5)+","+(fe.t-.5+we)+"h3v"+-we+"h"+we+"v-3h-"+(we+3)+"ZM"+(fe.r+3.5)+","+(fe.t-.5+we)+"h-3v"+-we+"h"+-we+"v-3h"+(we+3)+"ZM"+(fe.r+3.5)+","+(fe.b+.5-we)+"h-3v"+we+"h"+-we+"v3h"+(we+3)+"ZM"+(fe.l-3.5)+","+(fe.b+.5-we)+"h3v"+we+"h"+we+"v3h-"+(we+3)+"Z"}function q(fe,we,Ae,Fe,Ce){for(var qe=!1,et={},Qe={},Ke,Xe,Me,xe,ce=(Ce||{}).xaHash,Re=(Ce||{}).yaHash,$e=0;$e1&&x.warn("Full array edits are incompatible with other edits",c);var b=i[""][""];if(t(b))a.set(null);else if(Array.isArray(b))a.set(b);else return x.warn("Unrecognized full array edit value",c,b),!0;return T?!1:(f(l,y),v(o),!0)}var S=Object.keys(i).map(Number).sort(A),M=a.get(),_=M||[],w=s(y,c).get(),p=[],u=-1,g=_.length,m,R,P,z,F,B,O,L;for(m=0;m_.length-(O?0:1)){x.warn("index out of range",c,P);continue}if(B!==void 0)F.length>1&&x.warn("Insertion & removal are incompatible with edits to the same index.",c,P),t(B)?p.push(P):O?(B==="add"&&(B={}),_.splice(P,0,B),w&&w.splice(P,0,{})):x.warn("Unrecognized full object edit value",c,P,B),u===-1&&(u=P);else for(R=0;R=0;m--)_.splice(p[m],1),w&&w.splice(p[m],1);if(_.length?M||a.set(_):a.set(null),T)return!1;if(f(l,y),h!==d){var N;if(u===-1)N=S;else{for(g=Math.max(_.length,g),N=[],m=0;m=u));m++)N.push(P);for(m=u;m0&&x.log("Clearing previous rejected promises from queue."),T._promises=[]},Y.cleanLayout=function(T){var l;T||(T={}),T.xaxis1&&(T.xaxis||(T.xaxis=T.xaxis1),delete T.xaxis1),T.yaxis1&&(T.yaxis||(T.yaxis=T.yaxis1),delete T.yaxis1),T.scene1&&(T.scene||(T.scene=T.scene1),delete T.scene1);var y=(A.subplotsRegistry.cartesian||{}).attrRegex;(A.subplotsRegistry.polar||{}).attrRegex,(A.subplotsRegistry.ternary||{}).attrRegex,(A.subplotsRegistry.gl3d||{}).attrRegex;var b=Object.keys(T);for(l=0;l3?(R.x=1.02,R.xanchor="left"):R.x<-2&&(R.x=-.02,R.xanchor="right"),R.y>3?(R.y=1.02,R.yanchor="bottom"):R.y<-2&&(R.y=-.02,R.yanchor="top")),T.dragmode==="rotate"&&(T.dragmode="orbit"),e.clean(T),T.template&&T.template.layout&&Y.cleanLayout(T.template.layout),T};function a(T,l){var y=T[l],b=l.charAt(0);y&&y!=="paper"&&(T[l]=t(y,b,!0))}Y.cleanData=function(T){for(var l=0;l0)return T.substr(0,l)}Y.hasParent=function(T,l){for(var y=v(l);y;){if(y in T)return!0;y=v(y)}return!1};var h=["x","y","z"];Y.clearAxisTypes=function(T,l,y){for(var b=0;b=ve.data.length||We<-ve.data.length)throw new Error(be+" must be valid indices for gd.data.");if(ge.indexOf(We,Pe+1)>-1||We>=0&&ge.indexOf(-ve.data.length+We)>-1||We<0&&ge.indexOf(ve.data.length+We)>-1)throw new Error("each index in "+be+" must be unique.")}}function N(ve,ge,be){if(!Array.isArray(ve.data))throw new Error("gd.data must be an array.");if(typeof ge>"u")throw new Error("currentIndices is a required argument.");if(Array.isArray(ge)||(ge=[ge]),L(ve,ge,"currentIndices"),typeof be<"u"&&!Array.isArray(be)&&(be=[be]),typeof be<"u"&&L(ve,be,"newIndices"),typeof be<"u"&&ge.length!==be.length)throw new Error("current and new indices must be of equal length.")}function U(ve,ge,be){var Pe,We;if(!Array.isArray(ve.data))throw new Error("gd.data must be an array.");if(typeof ge>"u")throw new Error("traces must be defined.");for(Array.isArray(ge)||(ge=[ge]),Pe=0;Pe"u")throw new Error("indices must be an integer or array of integers");L(ve,be,"indices");for(var ct in ge){if(!Array.isArray(ge[ct])||ge[ct].length!==be.length)throw new Error("attribute "+ct+" must be an array of length equal to indices array length");if(We&&(!(ct in Pe)||!Array.isArray(Pe[ct])||Pe[ct].length!==ge[ct].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}function Q(ve,ge,be,Pe){var We=A.isPlainObject(Pe),ct=[],_t,Mt,Nt,Bt,qt;Array.isArray(be)||(be=[be]),be=O(be,ve.data.length-1);for(var Zt in ge)for(var lr=0;lr=0&&qt=0&&qt"u")return Bt=Y.redraw(ve),t.add(ve,We,_t,ct,Mt),Bt;Array.isArray(be)||(be=[be]);try{N(ve,Pe,be)}catch(qt){throw ve.data.splice(ve.data.length-ge.length,ge.length),qt}return t.startSequence(ve),t.add(ve,We,_t,ct,Mt),Bt=Y.moveTraces(ve,Pe,be),t.stopSequence(ve),Bt}function $(ve,ge){ve=A.getGraphDiv(ve);var be=[],Pe=Y.addTraces,We=$,ct=[ve,be,ge],_t=[ve,ge],Mt,Nt;if(typeof ge>"u")throw new Error("indices must be an integer or array of integers.");for(Array.isArray(ge)||(ge=[ge]),L(ve,ge,"indices"),ge=O(ge,ve.data.length-1),ge.sort(A.sorterDes),Mt=0;Mt"u")for(be=[],Bt=0;Bt0&&typeof Ot.parts[na]!="string";)na--;var Ur=Ot.parts[na],ga=Ot.parts[na-1]+"."+Ur,Aa=Ot.parts.slice(0,na).join("."),Pa=E(ve.layout,Aa).get(),sa=E(Pe,Aa).get(),Oa=Ot.get();if(gr!==void 0){Ia[jt]=gr,va[jt]=Ur==="reverse"?gr:ee(Oa);var dt=o.getLayoutValObject(Pe,Ot.parts);if(dt&&dt.impliedEdits&&gr!==null)for(var vt in dt.impliedEdits)La(A.relativeAttr(jt,vt),dt.impliedEdits[vt]);if(["width","height"].indexOf(jt)!==-1)if(gr){La("autosize",null);var Lr=jt==="height"?"width":"height";La(Lr,Pe[Lr])}else Pe[jt]=ve._initialAutoSize[jt];else if(jt==="autosize")La("width",gr?null:Pe.width),La("height",gr?null:Pe.height);else if(ga.match(Ce))Lt(ga),E(Pe,Aa+"._inputRange").set(null);else if(ga.match(qe)){Lt(ga),E(Pe,Aa+"._inputRange").set(null);var Er=E(Pe,Aa).get();Er._inputDomain&&(Er._input.domain=Er._inputDomain.slice())}else ga.match(et)&&E(Pe,Aa+"._inputDomain").set(null);if(Ur==="type"){Vt=Pa;var _r=sa.type==="linear"&&gr==="log",yr=sa.type==="log"&&gr==="linear";if(_r||yr){if(!Vt||!Vt.range)La(Aa+".autorange",!0);else if(sa.autorange)_r&&(Vt.range=Vt.range[1]>Vt.range[0]?[1,2]:[2,1]);else{var kr=Vt.range[0],zr=Vt.range[1];_r?(kr<=0&&zr<=0&&La(Aa+".autorange",!0),kr<=0?kr=zr/1e6:zr<=0&&(zr=kr/1e6),La(Aa+".range[0]",Math.log(kr)/Math.LN10),La(Aa+".range[1]",Math.log(zr)/Math.LN10)):(La(Aa+".range[0]",Math.pow(10,kr)),La(Aa+".range[1]",Math.pow(10,zr)))}Array.isArray(Pe._subplots.polar)&&Pe._subplots.polar.length&&Pe[Ot.parts[0]]&&Ot.parts[1]==="radialaxis"&&delete Pe[Ot.parts[0]]._subplot.viewInitial["radialaxis.range"],r.getComponentMethod("annotations","convertCoords")(ve,sa,gr,La),r.getComponentMethod("images","convertCoords")(ve,sa,gr,La)}else La(Aa+".autorange",!0),La(Aa+".range",null);E(Pe,Aa+"._inputRange").set(null)}else if(Ur.match(_)){var Pr=E(Pe,jt).get(),Hr=(gr||{}).type;(!Hr||Hr==="-")&&(Hr="linear"),r.getComponentMethod("annotations","convertCoords")(ve,Pr,Hr,La),r.getComponentMethod("images","convertCoords")(ve,Pr,Hr,La)}var Zr=y.containerArrayMatch(jt);if(Zr){qt=Zr.array,Zt=Zr.index;var Jr=Zr.property,wt=dt||{editType:"calc"};Zt!==""&&Jr===""&&(y.isAddVal(gr)?va[jt]=null:y.isRemoveVal(gr)?va[jt]=(E(be,qt).get()||[])[Zt]:A.warn("unrecognized full object value",ge)),M.update(ma,wt),Bt[qt]||(Bt[qt]={});var Qt=Bt[qt][Zt];Qt||(Qt=Bt[qt][Zt]={}),Qt[Jr]=gr,delete ge[jt]}else Ur==="reverse"?(Pa.range?Pa.range.reverse():(La(Aa+".autorange",!0),Pa.range=[1,0]),sa.autorange?ma.calc=!0:ma.plot=!0):(jt==="dragmode"&&(gr===!1&&Oa!==!1||gr!==!1&&Oa===!1)||Pe._has("scatter-like")&&Pe._has("regl")&&jt==="dragmode"&&(gr==="lasso"||gr==="select")&&!(Oa==="lasso"||Oa==="select")?ma.plot=!0:dt?M.update(ma,dt):ma.calc=!0,Ot.set(gr))}}for(qt in Bt){var mr=y.applyContainerArrayChanges(ve,ct(be,qt),Bt[qt],ma,ct);mr||(ma.plot=!0)}for(var $r in Ka){Vt=i.getFromId(ve,$r);var oa=Vt&&Vt._constraintGroup;if(oa){ma.calc=!0;for(var Sa in oa)Ka[Sa]||(i.getFromId(ve,Sa)._constraintShrinkable=!0)}}(Ke(ve)||ge.height||ge.width)&&(ma.plot=!0);var ya=Pe.shapes;for(Zt=0;Zt1;)if(Pe.pop(),be=E(ge,Pe.join(".")+".uirevision").get(),be!==void 0)return be;return ge.uirevision}function rt(ve,ge){for(var be=0;be=We.length?We[0]:We[Bt]:We}function Mt(Bt){return Array.isArray(ct)?Bt>=ct.length?ct[0]:ct[Bt]:ct}function Nt(Bt,qt){var Zt=0;return function(){if(Bt&&++Zt===qt)return Bt()}}return new Promise(function(Bt,qt){function Zt(){if(Pe._frameQueue.length!==0){for(;Pe._frameQueue.length;){var Ur=Pe._frameQueue.pop();Ur.onInterrupt&&Ur.onInterrupt()}ve.emit("plotly_animationinterrupted",[])}}function lr(Ur){if(Ur.length!==0){for(var ga=0;gaPe._timeToNext&&da()};Ur()}var ma=0;function Ia(Ur){return Array.isArray(We)?ma>=We.length?Ur.transitionOpts=We[ma]:Ur.transitionOpts=We[0]:Ur.transitionOpts=We,ma++,Ur}var va,La,Ka=[],Vt=ge==null,Lt=Array.isArray(ge),jt=!Vt&&!Lt&&A.isPlainObject(ge);if(jt)Ka.push({type:"object",data:Ia(A.extendFlat({},ge))});else if(Vt||["string","number"].indexOf(typeof ge)!==-1)for(va=0;va0&&BrBr)&&na.push(La);Ka=na}}Ka.length>0?lr(Ka):(ve.emit("plotly_animated"),Bt())})}function dr(ve,ge,be){if(ve=A.getGraphDiv(ve),ge==null)return Promise.resolve();if(!A.isPlotDiv(ve))throw new Error("This element is not a Plotly plot: "+ve+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var Pe,We,ct,_t,Mt=ve._transitionData._frames,Nt=ve._transitionData._frameHash;if(!Array.isArray(ge))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+ge);var Bt=Mt.length+ge.length*2,qt=[],Zt={};for(Pe=ge.length-1;Pe>=0;Pe--)if(A.isPlainObject(ge[Pe])){var lr=ge[Pe].name,ta=(Nt[lr]||Zt[lr]||{}).name,da=ge[Pe].name,wa=Nt[ta]||Zt[ta];ta&&da&&typeof da=="number"&&wa&&wOt.index?-1:jt.index=0;Pe--){if(We=qt[Pe].frame,typeof We.name=="number"&&A.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!We.name)for(;Nt[We.name="frame "+ve._transitionData._counter++];);if(Nt[We.name]){for(ct=0;ct=0;be--)Pe=ge[be],ct.push({type:"delete",index:Pe}),_t.unshift({type:"insert",index:Pe,value:We[Pe]});var Mt=a.modifyFrames,Nt=a.modifyFrames,Bt=[ve,_t],qt=[ve,ct];return t&&t.add(ve,Mt,Bt,Nt,qt),a.modifyFrames(ve,ct)}function ze(ve){ve=A.getGraphDiv(ve);var ge=ve._fullLayout||{},be=ve._fullData||[];return a.cleanPlot([],{},be,ge),a.purge(ve),e.purge(ve),ge._container&&ge._container.remove(),delete ve._context,ve}function Ge(ve){var ge=ve._fullLayout,be=ve.getBoundingClientRect();if(!A.equalDomRects(be,ge._lastBBox)){var Pe=ge._invTransform=A.inverseTransformMatrix(A.getFullTransformMatrix(ve));ge._invScaleX=Math.sqrt(Pe[0][0]*Pe[0][0]+Pe[0][1]*Pe[0][1]+Pe[0][2]*Pe[0][2]),ge._invScaleY=Math.sqrt(Pe[1][0]*Pe[1][0]+Pe[1][1]*Pe[1][1]+Pe[1][2]*Pe[1][2]),ge._lastBBox=be}}function Oe(ve){var ge=G.select(ve),be=ve._fullLayout;if(be._calcInverseTransform=Ge,be._calcInverseTransform(ve),be._container=ge.selectAll(".plot-container").data([0]),be._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),be._paperdiv=be._container.selectAll(".svg-container").data([0]),be._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),be._glcontainer=be._paperdiv.selectAll(".gl-container").data([{}]),be._glcontainer.enter().append("div").classed("gl-container",!0),be._paperdiv.selectAll(".main-svg").remove(),be._paperdiv.select(".modebar-container").remove(),be._paper=be._paperdiv.insert("svg",":first-child").classed("main-svg",!0),be._toppaper=be._paperdiv.append("svg").classed("main-svg",!0),be._modebardiv=be._paperdiv.append("div"),delete be._modeBar,be._hoverpaper=be._paperdiv.append("svg").classed("main-svg",!0),!be._uid){var Pe={};G.selectAll("defs").each(function(){this.id&&(Pe[this.id.split("-")[1]]=1)}),be._uid=A.randstr(Pe)}be._paperdiv.selectAll(".main-svg").attr(h.svgAttrs),be._defs=be._paper.append("defs").attr("id","defs-"+be._uid),be._clips=be._defs.append("g").classed("clips",!0),be._topdefs=be._toppaper.append("defs").attr("id","topdefs-"+be._uid),be._topclips=be._topdefs.append("g").classed("clips",!0),be._bgLayer=be._paper.append("g").classed("bglayer",!0),be._draggers=be._paper.append("g").classed("draglayer",!0);var We=be._paper.append("g").classed("layer-below",!0);be._imageLowerLayer=We.append("g").classed("imagelayer",!0),be._shapeLowerLayer=We.append("g").classed("shapelayer",!0),be._cartesianlayer=be._paper.append("g").classed("cartesianlayer",!0),be._polarlayer=be._paper.append("g").classed("polarlayer",!0),be._smithlayer=be._paper.append("g").classed("smithlayer",!0),be._ternarylayer=be._paper.append("g").classed("ternarylayer",!0),be._geolayer=be._paper.append("g").classed("geolayer",!0),be._funnelarealayer=be._paper.append("g").classed("funnelarealayer",!0),be._pielayer=be._paper.append("g").classed("pielayer",!0),be._iciclelayer=be._paper.append("g").classed("iciclelayer",!0),be._treemaplayer=be._paper.append("g").classed("treemaplayer",!0),be._sunburstlayer=be._paper.append("g").classed("sunburstlayer",!0),be._indicatorlayer=be._toppaper.append("g").classed("indicatorlayer",!0),be._glimages=be._paper.append("g").classed("glimages",!0);var ct=be._toppaper.append("g").classed("layer-above",!0);be._imageUpperLayer=ct.append("g").classed("imagelayer",!0),be._shapeUpperLayer=ct.append("g").classed("shapelayer",!0),be._selectionLayer=be._toppaper.append("g").classed("selectionlayer",!0),be._infolayer=be._toppaper.append("g").classed("infolayer",!0),be._menulayer=be._toppaper.append("g").classed("menulayer",!0),be._zoomlayer=be._toppaper.append("g").classed("zoomlayer",!0),be._hoverlayer=be._hoverpaper.append("g").classed("hoverlayer",!0),be._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),ve.emit("plotly_framework")}Y.animate=fr,Y.addFrames=dr,Y.deleteFrames=pt,Y.addTraces=J,Y.deleteTraces=$,Y.extendTraces=le,Y.moveTraces=X,Y.prependTraces=j,Y.newPlot=B,Y._doPlot=u,Y.purge=ze,Y.react=Rt,Y.redraw=F,Y.relayout=we,Y.restyle=re,Y.setPlotConfig=m,Y.update=Xe,Y._guiRelayout=Me(we),Y._guiRestyle=Me(re),Y._guiUpdate=Me(Xe),Y._storeDirectGUIEdit=ie}}),id=He({"src/snapshot/helpers.js"(Y){var G=Ei();Y.getDelay=function(A){return A._has&&(A._has("gl3d")||A._has("mapbox")||A._has("map"))?500:0},Y.getRedrawFunc=function(A){return function(){G.getComponentMethod("colorbar","draw")(A)}},Y.encodeSVG=function(A){return"data:image/svg+xml,"+encodeURIComponent(A)},Y.encodeJSON=function(A){return"data:application/json,"+encodeURIComponent(A)};var d=window.URL||window.webkitURL;Y.createObjectURL=function(A){return d.createObjectURL(A)},Y.revokeObjectURL=function(A){return d.revokeObjectURL(A)},Y.createBlob=function(A,E){if(E==="svg")return new window.Blob([A],{type:"image/svg+xml;charset=utf-8"});if(E==="full-json")return new window.Blob([A],{type:"application/json;charset=utf-8"});var e=x(window.atob(A));return new window.Blob([e],{type:"image/"+E})},Y.octetStream=function(A){document.location.href="data:application/octet-stream"+A};function x(A){for(var E=A.length,e=new ArrayBuffer(E),t=new Uint8Array(e),r=0;r")!==-1?"":i.html(s).text()});return i.remove(),n}function o(a){return a.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}G.exports=function(i,n,s){var c=i._fullLayout,f=c._paper,v=c._toppaper,h=c.width,T=c.height,l;f.insert("rect",":first-child").call(x.setRect,0,0,h,T).call(A.fill,c.paper_bgcolor);var y=c._basePlotModules||[];for(l=0;l1&&M.push(s("object","layout"))),x.supplyDefaults(_);for(var u=_._fullData,g=w.length,m=0;mR.length&&S.push(s("unused",M,g.concat(R.length)));var L=R.length,N=Array.isArray(O);N&&(L=Math.min(L,O.length));var U,Z,Q,ue,oe;if(P.dimensions===2)for(Z=0;ZR[Z].length&&S.push(s("unused",M,g.concat(Z,R[Z].length)));var le=R[Z].length;for(U=0;U<(N?Math.min(le,O[Z].length):le);U++)Q=N?O[Z][U]:O,ue=m[Z][U],oe=R[Z][U],d.validate(ue,Q)?oe!==ue&&oe!==+ue&&S.push(s("dynamic",M,g.concat(Z,U),ue,oe)):S.push(s("value",M,g.concat(Z,U),ue))}else S.push(s("array",M,g.concat(Z),m[Z]));else for(Z=0;ZF?S.push({code:"unused",traceType:m,templateCount:z,dataCount:F}):F>z&&S.push({code:"reused",traceType:m,templateCount:z,dataCount:F})}}function B(O,L){for(var N in O)if(N.charAt(0)!=="_"){var U=O[N],Z=s(O,N,L);d(U)?(Array.isArray(O)&&U._template===!1&&U.templateitemname&&S.push({code:"missing",path:Z,templateitemname:U.templateitemname}),B(U,Z)):Array.isArray(U)&&c(U)&&B(U,Z)}}if(B({data:_,layout:M},""),S.length)return S.map(f)};function c(v){for(var h=0;h=0;f--){var v=e[f];if(v.type==="scatter"&&v.xaxis===s.xaxis&&v.yaxis===s.yaxis){v.opacity=void 0;break}}}}}}}),BM=He({"src/traces/scatter/layout_defaults.js"(Y,G){var d=Gr(),x=t1();G.exports=function(A,E){function e(r,o){return d.coerce(A,E,x,r,o)}var t=E.barmode==="group";E.scattermode==="group"&&e("scattergap",t?E.bargap:.2)}}}),Sv=He({"src/plots/cartesian/align_period.js"(Y,G){var d=Hi(),x=Gr(),A=x.dateTime2ms,E=x.incrementMonth,e=lo(),t=e.ONEAVGMONTH;G.exports=function(o,a,i,n){if(a.type!=="date")return{vals:n};var s=o[i+"periodalignment"];if(!s)return{vals:n};var c=o[i+"period"],f;if(d(c)){if(c=+c,c<=0)return{vals:n}}else if(typeof c=="string"&&c.charAt(0)==="M"){var v=+c.substring(1);if(v>0&&Math.round(v)===v)f=v;else return{vals:n}}for(var h=a.calendar,T=s==="start",l=s==="end",y=o[i+"period0"],b=A(y,h)||0,S=[],M=[],_=[],w=n.length,p=0;pu;)R=E(R,-f,h);for(;R<=u;)R=E(R,f,h);m=E(R,-f,h)}else{for(g=Math.round((u-b)/c),R=b+g*c;R>u;)R-=c;for(;R<=u;)R+=c;m=R-c}S[p]=T?m:l?R:(m+R)/2,M[p]=m,_[p]=R}return{vals:S,starts:M,ends:_}}}}),ov=He({"src/traces/scatter/colorscale_calc.js"(Y,G){var d=Ah().hasColorscale,x=Sh(),A=Rl();G.exports=function(e,t){A.hasLines(t)&&d(t,"line")&&x(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),A.hasMarkers(t)&&(d(t,"marker")&&x(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),d(t,"marker.line")&&x(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),Vv=He({"src/traces/scatter/arrays_to_calcdata.js"(Y,G){var d=Gr();G.exports=function(A,E){for(var e=0;eB&&m[L].gap;)L--;for(U=m[L].s,O=m.length-1;O>L;O--)m[O].s=U;for(;BN+O||!d(L))}for(var Z=0;Zz[h]&&h0?e:t)/(h._m*y*(h._m>0?e:t)))),Nt*=1e3}if(Bt===A){if(l&&(Bt=h.c2p(Mt.y,!0)),Bt===A)return!1;Bt*=1e3}return[Nt,Bt]}function ae(_t,Mt,Nt,Bt){var qt=Nt-_t,Zt=Bt-Mt,lr=.5-_t,ta=.5-Mt,da=qt*qt+Zt*Zt,wa=qt*lr+Zt*ta;if(wa>0&&wa1||Math.abs(lr.y-Nt[0][1])>1)&&(lr=[lr.x,lr.y],Bt&&Ae(lr,_t)qe||_t[1]Qe)return[a(_t[0],Ce,qe),a(_t[1],et,Qe)]}function At(_t,Mt){if(_t[0]===Mt[0]&&(_t[0]===Ce||_t[0]===qe)||_t[1]===Mt[1]&&(_t[1]===et||_t[1]===Qe))return!0}function St(_t,Mt){var Nt=[],Bt=Je(_t),qt=Je(Mt);return Bt&&qt&&At(Bt,qt)||(Bt&&Nt.push(Bt),qt&&Nt.push(qt)),Nt}function Rt(_t,Mt,Nt){return function(Bt,qt){var Zt=Je(Bt),lr=Je(qt),ta=[];if(Zt&&lr&&At(Zt,lr))return ta;Zt&&ta.push(Zt),lr&&ta.push(lr);var da=2*r.constrain((Bt[_t]+qt[_t])/2,Mt,Nt)-((Zt||Bt)[_t]+(lr||qt)[_t]);if(da){var wa;Zt&&lr?wa=da>0==Zt[_t]>lr[_t]?Zt:lr:wa=Zt||lr,wa[_t]+=da}return ta}}var Ut;p==="linear"||p==="spline"?Ut=rt:p==="hv"||p==="vh"?Ut=St:p==="hvh"?Ut=Rt(0,Ce,qe):p==="vhv"&&(Ut=Rt(1,et,Qe));function ir(_t,Mt){var Nt=Mt[0]-_t[0],Bt=(Mt[1]-_t[1])/Nt,qt=(_t[1]*Mt[0]-Mt[1]*_t[0])/Nt;return qt>0?[Bt>0?Ce:qe,Qe]:[Bt>0?qe:Ce,et]}function ar(_t){var Mt=_t[0],Nt=_t[1],Bt=Mt===z[F-1][0],qt=Nt===z[F-1][1];if(!(Bt&&qt))if(F>1){var Zt=Mt===z[F-2][0],lr=Nt===z[F-2][1];Bt&&(Mt===Ce||Mt===qe)&&Zt?lr?F--:z[F-1]=_t:qt&&(Nt===et||Nt===Qe)&&lr?Zt?F--:z[F-1]=_t:z[F++]=_t}else z[F++]=_t}function Mr(_t){z[F-1][0]!==_t[0]&&z[F-1][1]!==_t[1]&&ar([xe,ce]),ar(_t),Re=null,xe=ce=0}var fr=r.isArrayOrTypedArray(M);function dr(_t){if(_t&&S&&(_t.i=B,_t.d=s,_t.trace=f,_t.marker=fr?M[_t.i]:M,_t.backoff=S),ie=_t[0]/y,fe=_t[1]/b,Xe=_t[0]qe?qe:0,Me=_t[1]Qe?Qe:0,Xe||Me){if(!F)z[F++]=[Xe||_t[0],Me||_t[1]];else if(Re){var Mt=Ut(Re,_t);Mt.length>1&&(Mr(Mt[0]),z[F++]=Mt[1])}else $e=Ut(z[F-1],_t)[0],z[F++]=$e;var Nt=z[F-1];Xe&&Me&&(Nt[0]!==Xe||Nt[1]!==Me)?(Re&&(xe!==Xe&&ce!==Me?ar(xe&&ce?ir(Re,_t):[xe||Xe,ce||Me]):xe&&ce&&ar([xe,ce])),ar([Xe,Me])):xe-Xe&&ce-Me&&ar([Xe||xe,Me||ce]),Re=_t,xe=Xe,ce=Me}else Re&&Mr(Ut(Re,_t)[0]),z[F++]=_t}for(B=0;Bwe(Z,pt))break;L=Z,$=oe[0]*ue[0]+oe[1]*ue[1],$>j?(j=$,N=Z,Q=!1):$=s.length||!Z)break;dr(Z),O=Z}}Re&&ar([xe||Re[0],ce||Re[1]]),m.push(z.slice(0,F))}var ze=p.slice(p.length-1);if(S&&ze!=="h"&&ze!=="v"){for(var Ge=!1,Oe=-1,ve=[],ge=0;ge=0?i=v:(i=v=f,f++),i0,p=a(v,h,T);if(S=l.selectAll("g.trace").data(p,function(g){return g[0].trace.uid}),S.enter().append("g").attr("class",function(g){return"trace scatter trace"+g[0].trace.uid}).style("stroke-miterlimit",2),S.order(),n(v,S,h),w){b&&(M=b());var u=d.transition().duration(y.duration).ease(y.easing).each("end",function(){M&&M()}).each("interrupt",function(){M&&M()});u.each(function(){l.selectAll("g.trace").each(function(g,m){s(v,m,h,g,p,this,y)})})}else S.each(function(g,m){s(v,m,h,g,p,this,y)});_&&S.exit().remove(),l.selectAll("path:not([d])").remove()};function n(f,v,h){v.each(function(T){var l=E(d.select(this),"g","fills");t.setClipUrl(l,h.layerClipId,f);var y=T[0].trace,b=[];y._ownfill&&b.push("_ownFill"),y._nexttrace&&b.push("_nextFill");var S=l.selectAll("g").data(b,e);S.enter().append("g"),S.exit().each(function(M){y[M]=null}).remove(),S.order().each(function(M){y[M]=E(d.select(this),"path","js-fill")})})}function s(f,v,h,T,l,y,b){var S=f._context.staticPlot,M;c(f,v,h,T,l);var _=!!b&&b.duration>0;function w(ar){return _?ar.transition():ar}var p=h.xaxis,u=h.yaxis,g=T[0].trace,m=g.line,R=d.select(y),P=E(R,"g","errorbars"),z=E(R,"g","lines"),F=E(R,"g","points"),B=E(R,"g","text");if(x.getComponentMethod("errorbars","plot")(f,P,h,b),g.visible!==!0)return;w(R).style("opacity",g.opacity);var O,L,N=g.fill.charAt(g.fill.length-1);N!=="x"&&N!=="y"&&(N="");var U,Z;N==="y"?(U=1,Z=u.c2p(0,!0)):N==="x"&&(U=0,Z=p.c2p(0,!0)),T[0][h.isRangePlot?"nodeRangePlot3":"node3"]=R;var Q="",ue=[],oe=g._prevtrace,le=null,j=null;oe&&(Q=oe._prevRevpath||"",L=oe._nextFill,ue=oe._ownPolygons,le=oe._fillsegments,j=oe._fillElement);var J,$,X="",re="",ee,q,ae,ie,fe,we,Ae=[];g._polygons=[];var Fe=[],Ce=[],qe=A.noop;if(O=g._ownFill,r.hasLines(g)||g.fill!=="none"){L&&L.datum(T),["hv","vh","hvh","vhv"].indexOf(m.shape)!==-1?(ee=t.steps(m.shape),q=t.steps(m.shape.split("").reverse().join(""))):m.shape==="spline"?ee=q=function(ar){var Mr=ar[ar.length-1];return ar.length>1&&ar[0][0]===Mr[0]&&ar[0][1]===Mr[1]?t.smoothclosed(ar.slice(1),m.smoothing):t.smoothopen(ar,m.smoothing)}:ee=q=function(ar){return"M"+ar.join("L")},ae=function(ar){return q(ar.reverse())},Ce=o(T,{xaxis:p,yaxis:u,trace:g,connectGaps:g.connectgaps,baseTolerance:Math.max(m.width||1,3)/4,shape:m.shape,backoff:m.backoff,simplify:m.simplify,fill:g.fill}),Fe=new Array(Ce.length);var et=0;for(M=0;M=S[0]&&R.x<=S[1]&&R.y>=M[0]&&R.y<=M[1]}),u=Math.ceil(p.length/w),g=0;l.forEach(function(R,P){var z=R[0].trace;r.hasMarkers(z)&&z.marker.maxdisplayed>0&&P=Math.min(oe,le)&&h<=Math.max(oe,le)?0:1/0}var j=Math.max(3,ue.mrc||0),J=1-1/j,$=Math.abs(f.c2p(ue.x)-h);return $=Math.min(oe,le)&&T<=Math.max(oe,le)?0:1/0}var j=Math.max(3,ue.mrc||0),J=1-1/j,$=Math.abs(v.c2p(ue.y)-T);return $re!=Fe>=re&&(fe=ae[q-1][0],we=ae[q][0],Fe-Ae&&(ie=fe+(we-fe)*(re-Ae)/(Fe-Ae),j=Math.min(j,ie),J=Math.max(J,ie)));return j=Math.max(j,0),J=Math.min(J,f._length),{x0:j,x1:J,y0:re,y1:re}}if(y.indexOf("fills")!==-1&&c._fillElement){var U=L(c._fillElement)&&!L(c._fillExclusionElement);if(U){var Z=N(c._polygons);Z===null&&(Z={x0:l[0],x1:l[0],y0:l[1],y1:l[1]});var Q=e.defaultLine;return e.opacity(c.fillcolor)?Q=c.fillcolor:e.opacity((c.line||{}).color)&&(Q=c.line.color),d.extendFlat(o,{distance:o.maxHoverDistance,x0:Z.x0,x1:Z.x1,y0:Z.y0,y1:Z.y1,color:Q,hovertemplate:!1}),delete o.index,c.text&&!d.isArrayOrTypedArray(c.text)?o.text=String(c.text):o.text=c.name,[o]}}}}}),W0=He({"src/traces/scatter/select.js"(Y,G){var d=Rl();G.exports=function(A,E){var e=A.cd,t=A.xaxis,r=A.yaxis,o=[],a=e[0].trace,i,n,s,c,f=!d.hasMarkers(a)&&!d.hasText(a);if(f)return[];if(E===!1)for(i=0;i0&&(n["_"+a+"axes"]||{})[o])return n;if((n[a+"axis"]||a)===o){if(t(n,a))return n;if((n[a]||[]).length||n[a+"0"])return n}}}function e(r){return{v:"x",h:"y"}[r.orientation||"v"]}function t(r,o){var a=e(r),i=d(r,"box-violin"),n=d(r._fullInput||{},"candlestick");return i&&!n&&o===a&&r[a]===void 0&&r[a+"0"]===void 0}}}),p1=He({"src/plots/cartesian/category_order_defaults.js"(Y,G){var d=ch().isTypedArraySpec;function x(A,E){var e=E.dataAttr||A._id.charAt(0),t={},r,o,a;if(E.axData)r=E.axData;else for(r=[],o=0;o0||d(o),i;a&&(i="array");var n=t("categoryorder",i),s;n==="array"&&(s=t("categoryarray")),!a&&n==="array"&&(n=e.categoryorder="trace"),n==="trace"?e._initialCategories=[]:n==="array"?e._initialCategories=s.slice():(s=x(e,r).sort(),n==="category ascending"?e._initialCategories=s:n==="category descending"&&(e._initialCategories=s.reverse()))}}}}),ay=He({"src/plots/cartesian/line_grid_defaults.js"(Y,G){var d=Mf().mix,x=Xc(),A=Gr();G.exports=function(e,t,r,o){o=o||{};var a=o.dfltColor;function i(g,m){return A.coerce2(e,t,o.attributes,g,m)}var n=i("linecolor",a),s=i("linewidth"),c=r("showline",o.showLine||!!n||!!s);c||(delete t.linecolor,delete t.linewidth);var f=d(a,o.bgColor,o.blend||x.lightFraction).toRgbString(),v=i("gridcolor",f),h=i("gridwidth"),T=i("griddash"),l=r("showgrid",o.showGrid||!!v||!!h||!!T);if(l||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),o.hasMinor){var y=d(t.gridcolor,o.bgColor,67).toRgbString(),b=i("minor.gridcolor",y),S=i("minor.gridwidth",t.gridwidth||1),M=i("minor.griddash",t.griddash||"solid"),_=r("minor.showgrid",!!b||!!S||!!M);_||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!o.noZeroLine){var w=i("zerolinecolor",a),p=i("zerolinewidth"),u=r("zeroline",o.showGrid||!!w||!!p);u||(delete t.zerolinecolor,delete t.zerolinewidth)}}}}),ny=He({"src/plots/cartesian/axis_defaults.js"(Y,G){var d=Hi(),x=Ei(),A=Gr(),E=Gs(),e=rh(),t=jf(),r=Ep(),o=O0(),a=Vd(),i=qd(),n=p1(),s=ay(),c=Mb(),f=Uv(),v=Ef().WEEKDAY_PATTERN,h=Ef().HOUR_PATTERN;G.exports=function(S,M,_,w,p){var u=w.letter,g=w.font||{},m=w.splomStash||{},R=_("visible",!w.visibleDflt),P=M._template||{},z=M.type||P.type||"-",F;if(z==="date"){var B=x.getComponentMethod("calendars","handleDefaults");B(S,M,"calendar",w.calendar),w.noTicklabelmode||(F=_("ticklabelmode"))}!w.noTicklabelindex&&(z==="date"||z==="linear")&&_("ticklabelindex");var O="";(!w.noTicklabelposition||z==="multicategory")&&(O=A.coerce(S,M,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:F==="period"?["outside","inside"]:u==="x"?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),w.noTicklabeloverflow||_("ticklabeloverflow",O.indexOf("inside")!==-1?"hide past domain":z==="category"||z==="multicategory"?"allow":"hide past div"),f(M,p),c(S,M,_,w),n(S,M,_,w),z!=="category"&&!w.noHover&&_("hoverformat");var L=_("color"),N=L!==t.color.dflt?L:g.color,U=m.label||p._dfltTitle[u];if(i(S,M,_,z,w),!R)return M;_("title.text",U),A.coerceFont(_,"title.font",g,{overrideDflt:{size:A.bigFont(g.size),color:N}}),r(S,M,_,z);var Z=w.hasMinor;if(Z&&(E.newContainer(M,"minor"),r(S,M,_,z,{isMinor:!0})),a(S,M,_,z,w),o(S,M,_,w),Z){var Q=w.isMinor;w.isMinor=!0,o(S,M,_,w),w.isMinor=Q}s(S,M,_,{dfltColor:L,bgColor:w.bgColor,showGrid:w.showGrid,hasMinor:Z,attributes:t}),Z&&!M.minor.ticks&&!M.minor.showgrid&&delete M.minor,(M.showline||M.ticks)&&_("mirror");var ue=z==="multicategory";if(!w.noTickson&&(z==="category"||ue)&&(M.ticks||M.showgrid)){var oe;ue&&(oe="boundaries");var le=_("tickson",oe);le==="boundaries"&&delete M.ticklabelposition}if(ue){var j=_("showdividers");j&&(_("dividercolor"),_("dividerwidth"))}if(z==="date")if(e(S,M,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:T}),!M.rangebreaks.length)delete M.rangebreaks;else{for(var J=0;J=2){var u="",g,m;if(p.length===2){for(g=0;g<2;g++)if(m=y(p[g]),m){u=v;break}}var R=_("pattern",u);if(R===v)for(g=0;g<2;g++)m=y(p[g]),m&&(S.bounds[g]=p[g]=m-1);if(R)for(g=0;g<2;g++)switch(m=p[g],R){case v:if(!d(m)){S.enabled=!1;return}if(m=+m,m!==Math.floor(m)||m<0||m>=7){S.enabled=!1;return}S.bounds[g]=p[g]=m;break;case h:if(!d(m)){S.enabled=!1;return}if(m=+m,m<0||m>24){S.enabled=!1;return}S.bounds[g]=p[g]=m;break}if(M.autorange===!1){var P=M.range;if(P[0]P[1]){S.enabled=!1;return}}else if(p[0]>P[0]&&p[1]_[1]-1/4096&&(e.domain=f),x.noneOrAll(E.domain,e.domain,f),e.tickmode==="sync"&&(e.tickmode="auto")}return t("layer"),e}}}),VM=He({"src/plots/cartesian/layout_defaults.js"(Y,G){var d=Gr(),x=Ai(),A=Ph().isUnifiedHover,E=Rb(),e=Gs(),t=D0(),r=jf(),o=Jb(),a=ny(),i=Cp(),n=g1(),s=oc(),c=s.id2name,f=s.name2id,v=Ef().AX_ID_PATTERN,h=Ei(),T=h.traceIs,l=h.getComponentMethod;function y(b,S,M){Array.isArray(b[S])?b[S].push(M):b[S]=[M]}G.exports=function(S,M,_){var w=M.autotypenumbers,p={},u={},g={},m={},R={},P={},z={},F={},B={},O={},L,N;for(L=0;L<_.length;L++){var U=_[L];if(T(U,"cartesian")){var Z;if(U.xaxis)Z=c(U.xaxis),y(p,Z,U);else if(U.xaxes)for(N=0;N rect").call(E.setTranslate,0,0).call(E.setScale,1,1),M.plot.call(E.setTranslate,_._offset,w._offset).call(E.setScale,1,1);var p=M.plot.selectAll(".scatterlayer .trace");p.selectAll(".point").call(E.setPointGroupScale,1,1),p.selectAll(".textpoint").call(E.setTextPointsScale,1,1),p.call(E.hideOutsideRangePoints,M)}function c(M,_){var w=M.plotinfo,p=w.xaxis,u=w.yaxis,g=p._length,m=u._length,R=!!M.xr1,P=!!M.yr1,z=[];if(R){var F=A.simpleMap(M.xr0,p.r2l),B=A.simpleMap(M.xr1,p.r2l),O=F[1]-F[0],L=B[1]-B[0];z[0]=(F[0]*(1-_)+_*B[0]-F[0])/(F[1]-F[0])*g,z[2]=g*(1-_+_*L/O),p.range[0]=p.l2r(F[0]*(1-_)+_*B[0]),p.range[1]=p.l2r(F[1]*(1-_)+_*B[1])}else z[0]=0,z[2]=g;if(P){var N=A.simpleMap(M.yr0,u.r2l),U=A.simpleMap(M.yr1,u.r2l),Z=N[1]-N[0],Q=U[1]-U[0];z[1]=(N[1]*(1-_)+_*U[1]-N[1])/(N[0]-N[1])*m,z[3]=m*(1-_+_*Q/Z),u.range[0]=p.l2r(N[0]*(1-_)+_*U[0]),u.range[1]=u.l2r(N[1]*(1-_)+_*U[1])}else z[1]=0,z[3]=m;e.drawOne(r,p,{skipTitle:!0}),e.drawOne(r,u,{skipTitle:!0}),e.redrawComponents(r,[p._id,u._id]);var ue=R?g/z[2]:1,oe=P?m/z[3]:1,le=R?z[0]:0,j=P?z[1]:0,J=R?z[0]/z[2]*g:0,$=P?z[1]/z[3]*m:0,X=p._offset-J,re=u._offset-$;w.clipRect.call(E.setTranslate,le,j).call(E.setScale,1/ue,1/oe),w.plot.call(E.setTranslate,X,re).call(E.setScale,ue,oe),E.setPointGroupScale(w.zoomScalePts,1/ue,1/oe),E.setTextPointsScale(w.zoomScaleTxt,1/ue,1/oe)}var f;i&&(f=i());function v(){for(var M={},_=0;_a.duration?(v(),y=window.cancelAnimationFrame(S)):y=window.requestAnimationFrame(S)}return T=Date.now(),y=window.requestAnimationFrame(S),Promise.resolve()}}}),Bc=He({"src/plots/cartesian/index.js"(Y){var G=Qn(),d=Ei(),x=Gr(),A=yu(),E=vo(),e=Uf().getModuleCalcData,t=oc(),r=Ef(),o=Yh(),a=x.ensureSingle;function i(T,l,y){return x.ensureSingle(T,l,y,function(b){b.datum(y)})}var n=r.zindexSeparator;Y.name="cartesian",Y.attr=["xaxis","yaxis"],Y.idRoot=["x","y"],Y.idRegex=r.idRegex,Y.attrRegex=r.attrRegex,Y.attributes=jM(),Y.layoutAttributes=jf(),Y.supplyLayoutDefaults=VM(),Y.transitionAxes=qM(),Y.finalizeSubplots=function(T,l){var y=l._subplots,b=y.xaxis,S=y.yaxis,M=y.cartesian,_=M,w={},p={},u,g,m;for(u=0;u<_.length;u++){var R=_[u].split("y");w[R[0]]=1,p["y"+R[1]]=1}for(u=0;u0){var P=R.id;if(P.indexOf(n)!==-1)continue;P+=n+(u+1),R=x.extendFlat({},R,{id:P,plot:S._cartesianlayer.selectAll(".subplot").select("."+P)})}for(var z=[],F,B=0;B<_.length;B++){var O=_[B],L=O[0].trace;g===(L.zorder||0)&&L.xaxis+L.yaxis===m&&((l.indexOf(L.index)!==-1||L.carpet)&&(F&&F[0].trace.xaxis+F[0].trace.yaxis===m&&["tonextx","tonexty","tonext"].indexOf(L.fill)!==-1&&z.indexOf(F)===-1&&z.push(F),z.push(O)),F=O)}s(T,R,z,y,b)}}};function s(T,l,y,b,S){for(var M=r.traceLayerClasses,_=T._fullLayout,w=_._zindices,p=_._modules,u,g,m,R=[],P=[],z=0;z1&&(Z+=n+U),N.push(w+Z),_=0;_1,m=l.mainplotinfo;if(!l.mainplot||g)if(u)l.xlines=a(b,"path","xlines-above"),l.ylines=a(b,"path","ylines-above"),l.xaxislayer=a(b,"g","xaxislayer-above"),l.yaxislayer=a(b,"g","yaxislayer-above");else{if(!_){var R=a(b,"g","layer-subplot");l.shapelayer=a(R,"g","shapelayer"),l.imagelayer=a(R,"g","imagelayer"),m&&g?(l.minorGridlayer=m.minorGridlayer,l.gridlayer=m.gridlayer,l.zerolinelayer=m.zerolinelayer):(l.minorGridlayer=a(b,"g","minor-gridlayer"),l.gridlayer=a(b,"g","gridlayer"),l.zerolinelayer=a(b,"g","zerolinelayer"));var P=a(b,"g","layer-between");l.shapelayerBetween=a(P,"g","shapelayer"),l.imagelayerBetween=a(P,"g","imagelayer"),a(b,"path","xlines-below"),a(b,"path","ylines-below"),l.overlinesBelow=a(b,"g","overlines-below"),a(b,"g","xaxislayer-below"),a(b,"g","yaxislayer-below"),l.overaxesBelow=a(b,"g","overaxes-below")}l.overplot=a(b,"g","overplot"),l.plot=a(l.overplot,"g",S),_||(l.xlines=a(b,"path","xlines-above"),l.ylines=a(b,"path","ylines-above"),l.overlinesAbove=a(b,"g","overlines-above"),a(b,"g","xaxislayer-above"),a(b,"g","yaxislayer-above"),l.overaxesAbove=a(b,"g","overaxes-above"),l.xlines=b.select(".xlines-"+w),l.ylines=b.select(".ylines-"+p),l.xaxislayer=b.select(".xaxislayer-"+w),l.yaxislayer=b.select(".yaxislayer-"+p))}else{var z=m.plotgroup,F=S+"-x",B=S+"-y";l.minorGridlayer=m.minorGridlayer,l.gridlayer=m.gridlayer,l.zerolinelayer=m.zerolinelayer,a(m.overlinesBelow,"path",F),a(m.overlinesBelow,"path",B),a(m.overaxesBelow,"g",F),a(m.overaxesBelow,"g",B),l.plot=a(m.overplot,"g",S),a(m.overlinesAbove,"path",F),a(m.overlinesAbove,"path",B),a(m.overaxesAbove,"g",F),a(m.overaxesAbove,"g",B),l.xlines=z.select(".overlines-"+w).select("."+F),l.ylines=z.select(".overlines-"+p).select("."+B),l.xaxislayer=z.select(".overaxes-"+w).select("."+F),l.yaxislayer=z.select(".overaxes-"+p).select("."+B)}_||(u||(i(l.minorGridlayer,"g",l.xaxis._id),i(l.minorGridlayer,"g",l.yaxis._id),l.minorGridlayer.selectAll("g").map(function(O){return O[0]}).sort(t.idSort),i(l.gridlayer,"g",l.xaxis._id),i(l.gridlayer,"g",l.yaxis._id),l.gridlayer.selectAll("g").map(function(O){return O[0]}).sort(t.idSort)),l.xlines.style("fill","none").classed("crisp",!0),l.ylines.style("fill","none").classed("crisp",!0))}function v(T,l){if(T){var y={};T.each(function(p){var u=p[0],g=G.select(this);g.remove(),h(u,l),y[u]=!0});for(var b in l._plots)for(var S=l._plots[b],M=S.overlays||[],_=0;_=0,l=i.indexOf("end")>=0,y=c.backoff*v+n.standoff,b=f.backoff*h+n.startstandoff,S,M,_,w;if(s.nodeName==="line"){S={x:+a.attr("x1"),y:+a.attr("y1")},M={x:+a.attr("x2"),y:+a.attr("y2")};var p=S.x-M.x,u=S.y-M.y;if(_=Math.atan2(u,p),w=_+Math.PI,y&&b&&y+b>Math.sqrt(p*p+u*u)){Z();return}if(y){if(y*y>p*p+u*u){Z();return}var g=y*Math.cos(_),m=y*Math.sin(_);M.x+=g,M.y+=m,a.attr({x2:M.x,y2:M.y})}if(b){if(b*b>p*p+u*u){Z();return}var R=b*Math.cos(_),P=b*Math.sin(_);S.x-=R,S.y-=P,a.attr({x1:S.x,y1:S.y})}}else if(s.nodeName==="path"){var z=s.getTotalLength(),F="";if(z2/3?va="right":va="center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[va]}for(var $e=!1,rt=["x","y"],Je=0;Je1)&&(Rt===St?(We=Ut.r2fraction(b["a"+At]),(We<0||We>1)&&($e=!0)):$e=!0),Ge=Ut._offset+Ut.r2p(b[At]),ge=.5}else{var ct=Pe==="domain";At==="x"?(ve=b[At],Ge=ct?Ut._offset+Ut._length*ve:Ge=u.l+u.w*ve):(ve=1-b[At],Ge=ct?Ut._offset+Ut._length*ve:Ge=u.t+u.h*ve),ge=b.showarrow?.5:ve}if(b.showarrow){ze.head=Ge;var _t=b["a"+At];if(be=ar*Re(.5,b.xanchor)-Mr*Re(.5,b.yanchor),Rt===St){var Mt=t.getRefType(Rt);Mt==="domain"?(At==="y"&&(_t=1-_t),ze.tail=Ut._offset+Ut._length*_t):Mt==="paper"?At==="y"?(_t=1-_t,ze.tail=u.t+u.h*_t):ze.tail=u.l+u.w*_t:ze.tail=Ut._offset+Ut.r2p(_t),Oe=be}else ze.tail=Ge+_t,Oe=be+_t;ze.text=ze.tail+be;var Nt=p[At==="x"?"width":"height"];if(St==="paper"&&(ze.head=E.constrain(ze.head,1,Nt-1)),Rt==="pixel"){var Bt=-Math.max(ze.tail-3,ze.text),qt=Math.min(ze.tail+3,ze.text)-Nt;Bt>0?(ze.tail+=Bt,ze.text+=Bt):qt>0&&(ze.tail-=qt,ze.text-=qt)}ze.tail+=pt,ze.head+=pt}else be=fr*Re(ge,dr),Oe=be,ze.text=Ge+be;ze.text+=pt,be+=pt,Oe+=pt,b["_"+At+"padplus"]=fr/2+Oe,b["_"+At+"padminus"]=fr/2-Oe,b["_"+At+"size"]=fr,b["_"+At+"shift"]=be}if($e){le.remove();return}var Zt=0,lr=0;if(b.align!=="left"&&(Zt=(Xe-Qe)*(b.align==="center"?.5:1)),b.valign!=="top"&&(lr=(Me-Ke)*(b.valign==="middle"?.5:1)),qe)Ce.select("svg").attr({x:$+Zt-1,y:$+lr}).call(o.setClipUrl,re?O:null,y);else{var ta=$+lr-et.top,da=$+Zt-et.left;ie.call(i.positionText,da,ta).call(o.setClipUrl,re?O:null,y)}ee.select("rect").call(o.setRect,$,$,Xe,Me),X.call(o.setRect,j/2,j/2,xe-j,ce-j),le.call(o.setTranslate,Math.round(L.x.text-xe/2),Math.round(L.y.text-ce/2)),Z.attr({transform:"rotate("+N+","+L.x.text+","+L.y.text+")"});var wa=function(Ia,va){U.selectAll(".annotation-arrow-g").remove();var La=L.x.head,Ka=L.y.head,Vt=L.x.tail+Ia,Lt=L.y.tail+va,jt=L.x.text+Ia,Ot=L.y.text+va,gr=E.rotationXYMatrix(N,jt,Ot),Br=E.apply2DTransform(gr),na=E.apply2DTransform2(gr),Ur=+X.attr("width"),ga=+X.attr("height"),Aa=jt-.5*Ur,Pa=Aa+Ur,sa=Ot-.5*ga,Oa=sa+ga,dt=[[Aa,sa,Aa,Oa],[Aa,Oa,Pa,Oa],[Pa,Oa,Pa,sa],[Pa,sa,Aa,sa]].map(na);if(!dt.reduce(function(wt,Qt){return wt^!!E.segmentsIntersect(La,Ka,La+1e6,Ka+1e6,Qt[0],Qt[1],Qt[2],Qt[3])},!1)){dt.forEach(function(wt){var Qt=E.segmentsIntersect(Vt,Lt,La,Ka,wt[0],wt[1],wt[2],wt[3]);Qt&&(Vt=Qt.x,Lt=Qt.y)});var vt=b.arrowwidth,Lr=b.arrowcolor,Er=b.arrowside,_r=U.append("g").style({opacity:r.opacity(Lr)}).classed("annotation-arrow-g",!0),yr=_r.append("path").attr("d","M"+Vt+","+Lt+"L"+La+","+Ka).style("stroke-width",vt+"px").call(r.stroke,r.rgb(Lr));if(f(yr,Er,b),g.annotationPosition&&yr.node().parentNode&&!M){var kr=La,zr=Ka;if(b.standoff){var Pr=Math.sqrt(Math.pow(La-Vt,2)+Math.pow(Ka-Lt,2));kr+=b.standoff*(Vt-La)/Pr,zr+=b.standoff*(Lt-Ka)/Pr}var Hr=_r.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(Vt-kr)+","+(Lt-zr),transform:e(kr,zr)}).style("stroke-width",vt+6+"px").call(r.stroke,"rgba(0,0,0,0)").call(r.fill,"rgba(0,0,0,0)"),Zr,Jr;s.init({element:Hr.node(),gd:y,prepFn:function(){var wt=o.getTranslate(le);Zr=wt.x,Jr=wt.y,_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0)},moveFn:function(wt,Qt){var mr=Br(Zr,Jr),$r=mr[0]+wt,oa=mr[1]+Qt;le.call(o.setTranslate,$r,oa),F("x",T(_,wt,"x",u,b)),F("y",T(w,Qt,"y",u,b)),b.axref===b.xref&&F("ax",T(_,wt,"ax",u,b)),b.ayref===b.yref&&F("ay",T(w,Qt,"ay",u,b)),_r.attr("transform",e(wt,Qt)),Z.attr({transform:"rotate("+N+","+$r+","+oa+")"})},doneFn:function(){x.call("_guiRelayout",y,B());var wt=document.querySelector(".js-notes-box-panel");wt&&wt.redraw(wt.selectedObj)}})}}};if(b.showarrow&&wa(0,0),Q){var ma;s.init({element:le.node(),gd:y,prepFn:function(){ma=Z.attr("transform")},moveFn:function(Ia,va){var La="pointer";if(b.showarrow)b.axref===b.xref?F("ax",T(_,Ia,"ax",u,b)):F("ax",b.ax+Ia),b.ayref===b.yref?F("ay",T(w,va,"ay",u.w,b)):F("ay",b.ay+va),wa(Ia,va);else{if(M)return;var Ka,Vt;if(_)Ka=T(_,Ia,"x",u,b);else{var Lt=b._xsize/u.w,jt=b.x+(b._xshift-b.xshift)/u.w-Lt/2;Ka=s.align(jt+Ia/u.w,Lt,0,1,b.xanchor)}if(w)Vt=T(w,va,"y",u,b);else{var Ot=b._ysize/u.h,gr=b.y-(b._yshift+b.yshift)/u.h-Ot/2;Vt=s.align(gr-va/u.h,Ot,0,1,b.yanchor)}F("x",Ka),F("y",Vt),(!_||!w)&&(La=s.getCursor(_?.5:Ka,w?.5:Vt,b.xanchor,b.yanchor))}Z.attr({transform:e(Ia,va)+ma}),n(le,La)},clickFn:function(Ia,va){b.captureevents&&y.emit("plotly_clickannotation",oe(va))},doneFn:function(){n(le),x.call("_guiRelayout",y,B());var Ia=document.querySelector(".js-notes-box-panel");Ia&&Ia.redraw(Ia.selectedObj)}})}}g.annotationText?ie.call(i.makeEditable,{delegate:le,gd:y}).call(fe).on("edit",function(Ae){b.text=Ae,this.call(fe),F("text",Ae),_&&_.autorange&&z(_._name+".autorange",!0),w&&w.autorange&&z(w._name+".autorange",!0),x.call("_guiRelayout",y,B())}):ie.call(fe)}}}),WM=He({"src/components/annotations/click.js"(Y,G){var d=Gr(),x=Ei(),A=Gs().arrayEditor;G.exports={hasClickToShow:E,onClick:e};function E(o,a){var i=t(o,a);return i.on.length>0||i.explicitOff.length>0}function e(o,a){var i=t(o,a),n=i.on,s=i.off.concat(i.explicitOff),c={},f=o._fullLayout.annotations,v,h;if(n.length||s.length){for(v=0;v1){n=!0;break}}n?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+a+'"]').remove():(i._pdata=x(e.glplot.cameraParams,[t.xaxis.r2l(i.x)*r[0],t.yaxis.r2l(i.y)*r[1],t.zaxis.r2l(i.z)*r[2]]),d(e.graphDiv,i,a,e.id,i._xa,i._ya))}}}}),e5=He({"src/components/annotations3d/index.js"(Y,G){var d=Ei(),x=Gr();G.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:m1()}}},layoutAttributes:m1(),handleDefaults:JM(),includeBasePlot:A,convert:$M(),draw:QM()};function A(E,e){var t=d.subplotsRegistry.gl3d;if(t)for(var r=t.attrRegex,o=Object.keys(E),a=0;a0?l+v:v;return{ppad:v,ppadplus:h?b:S,ppadminus:h?S:b}}else return{ppad:v}}function o(a,i,n){var s=a._id.charAt(0)==="x"?"x":"y",c=a.type==="category"||a.type==="multicategory",f,v,h=0,T=0,l=c?a.r2c:a.d2c,y=i[s+"sizemode"]==="scaled";if(y?(f=i[s+"0"],v=i[s+"1"],c&&(h=i[s+"0shift"],T=i[s+"1shift"])):(f=i[s+"anchor"],v=i[s+"anchor"]),f!==void 0)return[l(f)+h,l(v)+T];if(i.path){var b=1/0,S=-1/0,M=i.path.match(A.segmentRE),_,w,p,u,g;for(a.type==="date"&&(l=E.decodeDate(l)),_=0;_S&&(S=g)));if(S>=b)return[b,S]}}}}),n5=He({"src/components/shapes/index.js"(Y,G){var d=c1();G.exports={moduleType:"component",name:"shapes",layoutAttributes:ew(),supplyLayoutDefaults:t5(),supplyDrawNewShapeDefaults:r5(),includeBasePlot:ry()("shapes"),calcAutorange:a5(),draw:d.draw,drawOne:d.drawOne}}}),tw=He({"src/components/images/attributes.js"(Y,G){var d=Ef(),x=Gs().templatedArray;ty(),G.exports=x("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",d.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",d.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),i5=He({"src/components/images/defaults.js"(Y,G){var d=Gr(),x=io(),A=rh(),E=tw(),e="images";G.exports=function(o,a){var i={name:e,handleItemDefaults:t};A(o,a,i)};function t(r,o,a){function i(y,b){return d.coerce(r,o,E,y,b)}var n=i("source"),s=i("visible",!!n);if(!s)return o;i("layer"),i("xanchor"),i("yanchor"),i("sizex"),i("sizey"),i("sizing"),i("opacity");for(var c={_fullLayout:a},f=["x","y"],v=0;v<2;v++){var h=f[v],T=x.coerceRef(r,o,c,h,"paper",void 0);if(T!=="paper"){var l=x.getFromId(c,T);l._imgIndices.push(o._index)}x.coercePosition(o,c,i,T,h,0)}return o}}}),o5=He({"src/components/images/draw.js"(Y,G){var d=Qn(),x=vo(),A=io(),E=oc(),e=Yh();G.exports=function(r){var o=r._fullLayout,a=[],i={},n=[],s,c;for(c=0;c0);f&&(s("active"),s("direction"),s("type"),s("showactive"),s("x"),s("y"),d.noneOrAll(a,i,["x","y"]),s("xanchor"),s("yanchor"),s("pad.t"),s("pad.r"),s("pad.b"),s("pad.l"),d.coerceFont(s,"font",n.font),s("bgcolor",n.paper_bgcolor),s("bordercolor"),s("borderwidth"))}function o(a,i){function n(c,f){return d.coerce(a,i,t,c,f)}var s=n("visible",a.method==="skip"||Array.isArray(a.args));s&&(n("method"),n("args"),n("args2"),n("label"),n("execute"))}}}),c5=He({"src/components/updatemenus/scrollbox.js"(Y,G){G.exports=e;var d=Qn(),x=Ai(),A=vo(),E=Gr();function e(t,r,o){this.gd=t,this.container=r,this.id=o,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}e.barWidth=2,e.barLength=20,e.barRadius=2,e.barPad=1,e.barColor="#808BA4",e.prototype.enable=function(r,o,a){var i=this.gd._fullLayout,n=i.width,s=i.height;this.position=r;var c=this.position.l,f=this.position.w,v=this.position.t,h=this.position.h,T=this.position.direction,l=T==="down",y=T==="left",b=T==="right",S=T==="up",M=f,_=h,w,p,u,g;!l&&!y&&!b&&!S&&(this.position.direction="down",l=!0);var m=l||S;m?(w=c,p=w+M,l?(u=v,g=Math.min(u+_,s),_=g-u):(g=v+_,u=Math.max(g-_,0),_=g-u)):(u=v,g=u+_,y?(p=c+M,w=Math.max(p-M,0),M=p-w):(w=c,p=Math.min(w+M,n),M=p-w)),this._box={l:w,t:u,w:M,h:_};var R=f>M,P=e.barLength+2*e.barPad,z=e.barWidth+2*e.barPad,F=c,B=v+h;B+z>s&&(B=s-z);var O=this.container.selectAll("rect.scrollbar-horizontal").data(R?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-horizontal",!0).call(x.fill,e.barColor),R?(this.hbar=O.attr({rx:e.barRadius,ry:e.barRadius,x:F,y:B,width:P,height:z}),this._hbarXMin=F+P/2,this._hbarTranslateMax=M-P):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var L=h>_,N=e.barWidth+2*e.barPad,U=e.barLength+2*e.barPad,Z=c+f,Q=v;Z+N>n&&(Z=n-N);var ue=this.container.selectAll("rect.scrollbar-vertical").data(L?[0]:[]);ue.exit().on(".drag",null).remove(),ue.enter().append("rect").classed("scrollbar-vertical",!0).call(x.fill,e.barColor),L?(this.vbar=ue.attr({rx:e.barRadius,ry:e.barRadius,x:Z,y:Q,width:N,height:U}),this._vbarYMin=Q+U/2,this._vbarTranslateMax=_-U):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var oe=this.id,le=w-.5,j=L?p+N+.5:p+.5,J=u-.5,$=R?g+z+.5:g+.5,X=i._topdefs.selectAll("#"+oe).data(R||L?[0]:[]);if(X.exit().remove(),X.enter().append("clipPath").attr("id",oe).append("rect"),R||L?(this._clipRect=X.select("rect").attr({x:Math.floor(le),y:Math.floor(J),width:Math.ceil(j)-Math.floor(le),height:Math.ceil($)-Math.floor(J)}),this.container.call(A.setClipUrl,oe,this.gd),this.bg.attr({x:c,y:v,width:f,height:h})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(A.setClipUrl,null),delete this._clipRect),R||L){var re=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(re);var ee=d.behavior.drag().on("dragstart",function(){d.event.sourceEvent.preventDefault(),d.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));R&&this.hbar.on(".drag",null).call(ee),L&&this.vbar.on(".drag",null).call(ee)}this.setTranslate(o,a)},e.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(A.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},e.prototype._onBoxDrag=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r-=d.event.dx),this.vbar&&(o-=d.event.dy),this.setTranslate(r,o)},e.prototype._onBoxWheel=function(){var r=this.translateX,o=this.translateY;this.hbar&&(r+=d.event.deltaY),this.vbar&&(o+=d.event.deltaY),this.setTranslate(r,o)},e.prototype._onBarDrag=function(){var r=this.translateX,o=this.translateY;if(this.hbar){var a=r+this._hbarXMin,i=a+this._hbarTranslateMax,n=E.constrain(d.event.x,a,i),s=(n-a)/(i-a),c=this.position.w-this._box.w;r=s*c}if(this.vbar){var f=o+this._vbarYMin,v=f+this._vbarTranslateMax,h=E.constrain(d.event.y,f,v),T=(h-f)/(v-f),l=this.position.h-this._box.h;o=T*l}this.setTranslate(r,o)},e.prototype.setTranslate=function(r,o){var a=this.position.w-this._box.w,i=this.position.h-this._box.h;if(r=E.constrain(r||0,0,a),o=E.constrain(o||0,0,i),this.translateX=r,this.translateY=o,this.container.call(A.setTranslate,this._box.l-this.position.l-r,this._box.t-this.position.t-o),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+r-.5),y:Math.floor(this.position.t+o-.5)}),this.hbar){var n=r/a;this.hbar.call(A.setTranslate,r+n*this._hbarTranslateMax,o)}if(this.vbar){var s=o/i;this.vbar.call(A.setTranslate,r,o+s*this._vbarTranslateMax)}}}}),f5=He({"src/components/updatemenus/draw.js"(Y,G){var d=Qn(),x=yu(),A=Ai(),E=vo(),e=Gr(),t=yl(),r=Gs().arrayEditor,o=df().LINE_SPACING,a=_1(),i=c5();G.exports=function(P){var z=P._fullLayout,F=e.filterVisible(z[a.name]);function B(oe){x.autoMargin(P,u(oe))}var O=z._menulayer.selectAll("g."+a.containerClassName).data(F.length>0?[0]:[]);if(O.enter().append("g").classed(a.containerClassName,!0).style("cursor","pointer"),O.exit().each(function(){d.select(this).selectAll("g."+a.headerGroupClassName).each(B)}).remove(),F.length!==0){var L=O.selectAll("g."+a.headerGroupClassName).data(F,n);L.enter().append("g").classed(a.headerGroupClassName,!0);for(var N=e.ensureSingle(O,"g",a.dropdownButtonGroupClassName,function(oe){oe.style("pointer-events","all")}),U=0;U0?[0]:[]);Z.enter().append("g").classed(a.containerClassName,!0).style("cursor",L?null:"ew-resize");function Q(j){j._commandObserver&&(j._commandObserver.remove(),delete j._commandObserver),x.autoMargin(O,f(j))}if(Z.exit().each(function(){d.select(this).selectAll("g."+a.groupClassName).each(Q)}).remove(),U.length!==0){var ue=Z.selectAll("g."+a.groupClassName).data(U,h);ue.enter().append("g").classed(a.groupClassName,!0),ue.exit().each(Q).remove();for(var oe=0;oe0&&(ue=ue.transition().duration(O.transition.duration).ease(O.transition.easing)),ue.attr("transform",t(Q-a.gripWidth*.5,O._dims.currentValueTotalHeight))}}function R(B,O){var L=B._dims;return L.inputAreaStart+a.stepInset+(L.inputAreaLength-2*a.stepInset)*Math.min(1,Math.max(0,O))}function P(B,O){var L=B._dims;return Math.min(1,Math.max(0,(O-a.stepInset-L.inputAreaStart)/(L.inputAreaLength-2*a.stepInset-2*L.inputAreaStart)))}function z(B,O,L){var N=L._dims,U=e.ensureSingle(B,"rect",a.railTouchRectClass,function(Z){Z.call(p,O,B,L).style("pointer-events","all")});U.attr({width:N.inputAreaLength,height:Math.max(N.inputAreaWidth,a.tickOffset+L.ticklen+N.labelHeight)}).call(A.fill,L.bgcolor).attr("opacity",0),E.setTranslate(U,0,N.currentValueTotalHeight)}function F(B,O){var L=O._dims,N=L.inputAreaLength-a.railInset*2,U=e.ensureSingle(B,"rect",a.railRectClass);U.attr({width:N,height:a.railWidth,rx:a.railRadius,ry:a.railRadius,"shape-rendering":"crispEdges"}).call(A.stroke,O.bordercolor).call(A.fill,O.bgcolor).style("stroke-width",O.borderwidth+"px"),E.setTranslate(U,a.railInset,(L.inputAreaWidth-a.railWidth)*.5+L.currentValueTotalHeight)}}}),p5=He({"src/components/sliders/index.js"(Y,G){var d=iy();G.exports={moduleType:"component",name:d.name,layoutAttributes:aw(),supplyLayoutDefaults:v5(),draw:d5()}}}),x1=He({"src/components/rangeslider/attributes.js"(Y,G){var d=Xc();G.exports={bgcolor:{valType:"color",dflt:d.background,editType:"plot"},bordercolor:{valType:"color",dflt:d.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}}),nw=He({"src/components/rangeslider/oppaxis_attributes.js"(Y,G){G.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}}),b1=He({"src/components/rangeslider/constants.js"(Y,G){G.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}}),g5=He({"src/components/rangeslider/helpers.js"(Y){var G=oc(),d=yl(),x=b1(),A=df().LINE_SPACING,E=x.name;function e(t){var r=t&&t[E];return r&&r.visible}Y.isVisible=e,Y.makeData=function(t){for(var r=G.list({_fullLayout:t},"x",!0),o=t.margin,a=[],i=0;i=Qe.max)qe=fe[et+1];else if(Ce=Qe.pmax)qe=fe[et+1];else if(Ce0?p.touches[0].clientX:0}function v(p,u,g,m){if(u._context.staticPlot)return;var R=p.select("rect."+c.slideBoxClassName).node(),P=p.select("rect."+c.grabAreaMinClassName).node(),z=p.select("rect."+c.grabAreaMaxClassName).node();function F(){var B=d.event,O=B.target,L=f(B),N=L-p.node().getBoundingClientRect().left,U=m.d2p(g._rl[0]),Z=m.d2p(g._rl[1]),Q=n.coverSlip();this.addEventListener("touchmove",ue),this.addEventListener("touchend",oe),Q.addEventListener("mousemove",ue),Q.addEventListener("mouseup",oe);function ue(le){var j=f(le),J=+j-L,$,X,re;switch(O){case R:if(re="ew-resize",U+J>g._length||Z+J<0)return;$=U+J,X=Z+J;break;case P:if(re="col-resize",U+J>g._length)return;$=U+J,X=Z;break;case z:if(re="col-resize",Z+J<0)return;$=U,X=Z+J;break;default:re="ew-resize",$=N,X=N+J;break}if(X<$){var ee=X;X=$,$=ee}m._pixelMin=$,m._pixelMax=X,s(d.select(Q),re),h(p,u,g,m)}function oe(){Q.removeEventListener("mousemove",ue),Q.removeEventListener("mouseup",oe),this.removeEventListener("touchmove",ue),this.removeEventListener("touchend",oe),E.removeElement(Q)}}p.on("mousedown",F),p.on("touchstart",F)}function h(p,u,g,m){function R(F){return g.l2r(E.constrain(F,m._rl[0],m._rl[1]))}var P=R(m.p2d(m._pixelMin)),z=R(m.p2d(m._pixelMax));window.requestAnimationFrame(function(){x.call("_guiRelayout",u,g._name+".range",[P,z])})}function T(p,u,g,m,R,P){var z=c.handleWidth/2;function F(le){return E.constrain(le,0,m._width)}function B(le){return E.constrain(le,0,m._height)}function O(le){return E.constrain(le,-z,m._width+z)}var L=F(m.d2p(g._rl[0])),N=F(m.d2p(g._rl[1]));if(p.select("rect."+c.slideBoxClassName).attr("x",L).attr("width",N-L),p.select("rect."+c.maskMinClassName).attr("width",L),p.select("rect."+c.maskMaxClassName).attr("x",N).attr("width",m._width-N),P.rangemode!=="match"){var U=m._height-B(m.d2pOppAxis(R._rl[1])),Z=m._height-B(m.d2pOppAxis(R._rl[0]));p.select("rect."+c.maskMinOppAxisClassName).attr("x",L).attr("height",U).attr("width",N-L),p.select("rect."+c.maskMaxOppAxisClassName).attr("x",L).attr("y",Z).attr("height",m._height-Z).attr("width",N-L),p.select("rect."+c.slideBoxClassName).attr("y",U).attr("height",Z-U)}var Q=.5,ue=Math.round(O(L-z))-Q,oe=Math.round(O(N-z))+Q;p.select("g."+c.grabberMinClassName).attr("transform",e(ue,Q)),p.select("g."+c.grabberMaxClassName).attr("transform",e(oe,Q))}function l(p,u,g,m){var R=E.ensureSingle(p,"rect",c.bgClassName,function(B){B.attr({x:0,y:0,"shape-rendering":"crispEdges"})}),P=m.borderwidth%2===0?m.borderwidth:m.borderwidth-1,z=-m._offsetShift,F=t.crispRound(u,m.borderwidth);R.attr({width:m._width+P,height:m._height+P,transform:e(z,z),"stroke-width":F}).call(r.stroke,m.bordercolor).call(r.fill,m.bgcolor)}function y(p,u,g,m){var R=u._fullLayout,P=E.ensureSingleById(R._topdefs,"clipPath",m._clipId,function(z){z.append("rect").attr({x:0,y:0})});P.select("rect").attr({width:m._width,height:m._height})}function b(p,u,g,m){var R=u.calcdata,P=p.selectAll("g."+c.rangePlotClassName).data(g._subplotsWith,E.identity);P.enter().append("g").attr("class",function(F){return c.rangePlotClassName+" "+F}).call(t.setClipUrl,m._clipId,u),P.order(),P.exit().remove();var z;P.each(function(F,B){var O=d.select(this),L=B===0,N=i.getFromId(u,F,"y"),U=N._name,Z=m[U],Q={data:[],layout:{xaxis:{type:g.type,domain:[0,1],range:m.range.slice(),calendar:g.calendar},width:m._width,height:m._height,margin:{t:0,b:0,l:0,r:0}},_context:u._context};g.rangebreaks&&(Q.layout.xaxis.rangebreaks=g.rangebreaks),Q.layout[U]={type:N.type,domain:[0,1],range:Z.rangemode!=="match"?Z.range.slice():N.range.slice(),calendar:N.calendar},N.rangebreaks&&(Q.layout[U].rangebreaks=N.rangebreaks),A.supplyDefaults(Q);var ue=Q._fullLayout.xaxis,oe=Q._fullLayout[U];ue.clearCalc(),ue.setScale(),oe.clearCalc(),oe.setScale();var le={id:F,plotgroup:O,xaxis:ue,yaxis:oe,isRangePlot:!0};L?z=le:(le.mainplot="xy",le.mainplotinfo=z),a.rangePlot(u,le,S(R,F))})}function S(p,u){for(var g=[],m=0;m0);if(y){var b=o(n,s,c);T("x",b[0]),T("y",b[1]),d.noneOrAll(i,n,["x","y"]),T("xanchor"),T("yanchor"),d.coerceFont(T,"font",s.font);var S=T("bgcolor");T("activecolor",x.contrast(S,t.lightAmount,t.darkAmount)),T("bordercolor"),T("borderwidth")}};function r(a,i,n,s){var c=s.calendar;function f(T,l){return d.coerce(a,i,e.buttons,T,l)}var v=f("visible");if(v){var h=f("step");h!=="all"&&(c&&c!=="gregorian"&&(h==="month"||h==="year")?i.stepmode="backward":f("stepmode"),f("count")),f("label")}}function o(a,i,n){for(var s=n.filter(function(h){return i[h].anchor===a._id}),c=0,f=0;f1)){delete c.grid;return}if(!T&&!l&&!y){var g=w("pattern")==="independent";g&&(T=!0)}_._hasSubplotGrid=T;var m=w("roworder"),R=m==="top to bottom",P=T?.2:.1,z=T?.3:.1,F,B;b&&c._splomGridDflt&&(F=c._splomGridDflt.xside,B=c._splomGridDflt.yside),_._domains={x:a("x",w,P,F,u),y:a("y",w,z,B,p,R)}}function a(s,c,f,v,h,T){var l=c(s+"gap",f),y=c("domain."+s);c(s+"side",v);for(var b=new Array(h),S=y[0],M=(y[1]-S)/(h-l),_=M*(1-l),w=0;w0,v=r._context.staticPlot;o.each(function(h){var T=h[0].trace,l=T.error_x||{},y=T.error_y||{},b;T.ids&&(b=function(w){return w.id});var S=E.hasMarkers(T)&&T.marker.maxdisplayed>0;!y.visible&&!l.visible&&(h=[]);var M=d.select(this).selectAll("g.errorbar").data(h,b);if(M.exit().remove(),!!h.length){l.visible||M.selectAll("path.xerror").remove(),y.visible||M.selectAll("path.yerror").remove(),M.style("opacity",1);var _=M.enter().append("g").classed("errorbar",!0);f&&_.style("opacity",0).transition().duration(i.duration).style("opacity",1),A.setClipUrl(M,a.layerClipId,r),M.each(function(w){var p=d.select(this),u=e(w,s,c);if(!(S&&!w.vis)){var g,m=p.select("path.yerror");if(y.visible&&x(u.x)&&x(u.yh)&&x(u.ys)){var R=y.width;g="M"+(u.x-R)+","+u.yh+"h"+2*R+"m-"+R+",0V"+u.ys,u.noYS||(g+="m-"+R+",0h"+2*R),n=!m.size(),n?m=p.append("path").style("vector-effect",v?"none":"non-scaling-stroke").classed("yerror",!0):f&&(m=m.transition().duration(i.duration).ease(i.easing)),m.attr("d",g)}else m.remove();var P=p.select("path.xerror");if(l.visible&&x(u.y)&&x(u.xh)&&x(u.xs)){var z=(l.copy_ystyle?y:l).width;g="M"+u.xh+","+(u.y-z)+"v"+2*z+"m0,-"+z+"H"+u.xs,u.noXS||(g+="m0,-"+z+"v"+2*z),n=!P.size(),n?P=p.append("path").style("vector-effect",v?"none":"non-scaling-stroke").classed("xerror",!0):f&&(P=P.transition().duration(i.duration).ease(i.easing)),P.attr("d",g)}else P.remove()}})}})};function e(t,r,o){var a={x:r.c2p(t.x),y:o.c2p(t.y)};return t.yh!==void 0&&(a.yh=o.c2p(t.yh),a.ys=o.c2p(t.ys),x(a.ys)||(a.noYS=!0,a.ys=o.c2p(t.ys,!0))),t.xh!==void 0&&(a.xh=r.c2p(t.xh),a.xs=r.c2p(t.xs),x(a.xs)||(a.noXS=!0,a.xs=r.c2p(t.xs,!0))),a}}}),k5=He({"src/components/errorbars/style.js"(Y,G){var d=Qn(),x=Ai();G.exports=function(E){E.each(function(e){var t=e[0].trace,r=t.error_y||{},o=t.error_x||{},a=d.select(this);a.selectAll("path.yerror").style("stroke-width",r.thickness+"px").call(x.stroke,r.color),o.copy_ystyle&&(o=r),a.selectAll("path.xerror").style("stroke-width",o.thickness+"px").call(x.stroke,o.color)})}}}),C5=He({"src/components/errorbars/index.js"(Y,G){var d=Gr(),x=hu().overrideAll,A=sw(),E={error_x:d.extendFlat({},A),error_y:d.extendFlat({},A)};delete E.error_x.copy_zstyle,delete E.error_y.copy_zstyle,delete E.error_y.copy_ystyle;var e={error_x:d.extendFlat({},A),error_y:d.extendFlat({},A),error_z:d.extendFlat({},A)};delete e.error_x.copy_ystyle,delete e.error_y.copy_ystyle,delete e.error_z.copy_ystyle,delete e.error_z.copy_zstyle,G.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:E,bar:E,histogram:E,scatter3d:x(e,"calc","nested"),scattergl:x(E,"calc","nested")}},supplyDefaults:S5(),calc:M5(),makeComputeError:lw(),plot:E5(),style:k5(),hoverInfo:t};function t(r,o,a){(o.error_y||{}).visible&&(a.yerr=r.yh-r.y,o.error_y.symmetric||(a.yerrneg=r.y-r.ys)),(o.error_x||{}).visible&&(a.xerr=r.xh-r.x,o.error_x.symmetric||(a.xerrneg=r.x-r.xs))}}}),L5=He({"src/components/colorbar/constants.js"(Y,G){G.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),P5=He({"src/components/colorbar/draw.js"(Y,G){var d=Qn(),x=Mf(),A=yu(),E=Ei(),e=io(),t=fh(),r=Gr(),o=r.strTranslate,a=ho().extendFlat,i=xv(),n=vo(),s=Ai(),c=kp(),f=yl(),v=Ah().flipScale,h=ny(),T=g1(),l=jf(),y=df(),b=y.LINE_SPACING,S=y.FROM_TL,M=y.FROM_BR,_=L5().cn;function w(P){var z=P._fullLayout,F=z._infolayer.selectAll("g."+_.colorbar).data(p(P),function(B){return B._id});F.enter().append("g").attr("class",function(B){return B._id}).classed(_.colorbar,!0),F.each(function(B){var O=d.select(this);r.ensureSingle(O,"rect",_.cbbg),r.ensureSingle(O,"g",_.cbfills),r.ensureSingle(O,"g",_.cblines),r.ensureSingle(O,"g",_.cbaxis,function(N){N.classed(_.crisp,!0)}),r.ensureSingle(O,"g",_.cbtitleunshift,function(N){N.append("g").classed(_.cbtitle,!0)}),r.ensureSingle(O,"rect",_.cboutline);var L=u(O,B,P);L&&L.then&&(P._promises||[]).push(L),P._context.edits.colorbarPosition&&g(O,B,P)}),F.exit().each(function(B){A.autoMargin(P,B._id)}).remove(),F.order()}function p(P){var z=P._fullLayout,F=P.calcdata,B=[],O,L,N,U;function Z(q){return a(q,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function Q(){typeof U.calc=="function"?U.calc(P,N,O):(O._fillgradient=L.reversescale?v(L.colorscale):L.colorscale,O._zrange=[L[U.min],L[U.max]])}for(var ue=0;ue1){var ze=Math.pow(10,Math.floor(Math.log(pt)/Math.LN10));fr*=ze*r.roundUp(pt/ze,[2,5,10]),(Math.abs(et.start)/et.size+1e-6)%1<2e-6&&(ar.tick0=0)}ar.dtick=fr}ar.domain=B?[Ut+J/ae.h,Ut+Re-J/ae.h]:[Ut+j/ae.w,Ut+Re-j/ae.w],ar.setScale(),P.attr("transform",o(Math.round(ae.l),Math.round(ae.t)));var Ge=P.select("."+_.cbtitleunshift).attr("transform",o(-Math.round(ae.l),-Math.round(ae.t))),Oe=ar.ticklabelposition,ve=ar.title.font.size,ge=P.select("."+_.cbaxis),be,Pe=0,We=0;function ct(qt,Zt){var lr={propContainer:ar,propName:z._propPrefix+"title",traceIndex:z._traceIndex,_meta:z._meta,placeholder:q._dfltTitle.colorbar,containerGroup:P.select("."+_.cbtitle)},ta=qt.charAt(0)==="h"?qt.substr(1):"h"+qt;P.selectAll("."+ta+",."+ta+"-math-group").remove(),c.draw(F,qt,a(lr,Zt||{}))}function _t(){if(B&&Mr||!B&&!Mr){var qt,Zt;Ae==="top"&&(qt=j+ae.l+$e*$,Zt=J+ae.t+rt*(1-Ut-Re)+3+ve*.75),Ae==="bottom"&&(qt=j+ae.l+$e*$,Zt=J+ae.t+rt*(1-Ut)-3-ve*.25),Ae==="right"&&(Zt=J+ae.t+rt*X+3+ve*.75,qt=j+ae.l+$e*Ut),ct(ar._id+"title",{attributes:{x:qt,y:Zt,"text-anchor":B?"start":"middle"}})}}function Mt(){if(B&&!Mr||!B&&Mr){var qt=ar.position||0,Zt=ar._offset+ar._length/2,lr,ta;if(Ae==="right")ta=Zt,lr=ae.l+$e*qt+10+ve*(ar.showticklabels?1:.5);else if(lr=Zt,Ae==="bottom"&&(ta=ae.t+rt*qt+10+(Oe.indexOf("inside")===-1?ar.tickfont.size:0)+(ar.ticks!=="intside"&&z.ticklen||0)),Ae==="top"){var da=we.text.split("
").length;ta=ae.t+rt*qt+10-Me-b*ve*da}ct((B?"h":"v")+ar._id+"title",{avoid:{selection:d.select(F).selectAll("g."+ar._id+"tick"),side:Ae,offsetTop:B?0:ae.t,offsetLeft:B?ae.l:0,maxShift:B?q.width:q.height},attributes:{x:lr,y:ta,"text-anchor":"middle"},transform:{rotate:B?-90:0,offset:0}})}}function Nt(){if(!B&&!Mr||B&&Mr){var qt=P.select("."+_.cbtitle),Zt=qt.select("text"),lr=[-Z/2,Z/2],ta=qt.select(".h"+ar._id+"title-math-group").node(),da=15.6;Zt.node()&&(da=parseInt(Zt.node().style.fontSize,10)*b);var wa;if(ta?(wa=n.bBox(ta),We=wa.width,Pe=wa.height,Pe>da&&(lr[1]-=(Pe-da)/2)):Zt.node()&&!Zt.classed(_.jsPlaceholder)&&(wa=n.bBox(Zt.node()),We=wa.width,Pe=wa.height),B){if(Pe){if(Pe+=5,Ae==="top")ar.domain[1]-=Pe/ae.h,lr[1]*=-1;else{ar.domain[0]+=Pe/ae.h;var ma=f.lineCount(Zt);lr[1]+=(1-ma)*da}qt.attr("transform",o(lr[0],lr[1])),ar.setScale()}}else We&&(Ae==="right"&&(ar.domain[0]+=(We+ve/2)/ae.w),qt.attr("transform",o(lr[0],lr[1])),ar.setScale())}P.selectAll("."+_.cbfills+",."+_.cblines).attr("transform",B?o(0,Math.round(ae.h*(1-ar.domain[1]))):o(Math.round(ae.w*ar.domain[0]),0)),ge.attr("transform",B?o(0,Math.round(-ae.t)):o(Math.round(-ae.l),0));var Ia=P.select("."+_.cbfills).selectAll("rect."+_.cbfill).attr("style","").data(Ke);Ia.enter().append("rect").classed(_.cbfill,!0).attr("style",""),Ia.exit().remove();var va=Fe.map(ar.c2p).map(Math.round).sort(function(jt,Ot){return jt-Ot});Ia.each(function(jt,Ot){var gr=[Ot===0?Fe[0]:(Ke[Ot]+Ke[Ot-1])/2,Ot===Ke.length-1?Fe[1]:(Ke[Ot]+Ke[Ot+1])/2].map(ar.c2p).map(Math.round);B&&(gr[1]=r.constrain(gr[1]+(gr[1]>gr[0])?1:-1,va[0],va[1]));var Br=d.select(this).attr(B?"x":"y",Je).attr(B?"y":"x",d.min(gr)).attr(B?"width":"height",Math.max(Me,2)).attr(B?"height":"width",Math.max(d.max(gr)-d.min(gr),2));if(z._fillgradient)n.gradient(Br,F,z._id,B?"vertical":"horizontalreversed",z._fillgradient,"fill");else{var na=qe(jt).replace("e-","");Br.attr("fill",x(na).toHexString())}});var La=P.select("."+_.cblines).selectAll("path."+_.cbline).data(fe.color&&fe.width?Xe:[]);La.enter().append("path").classed(_.cbline,!0),La.exit().remove(),La.each(function(jt){var Ot=Je,gr=Math.round(ar.c2p(jt))+fe.width/2%1;d.select(this).attr("d","M"+(B?Ot+","+gr:gr+","+Ot)+(B?"h":"v")+Me).call(n.lineGroupStyle,fe.width,Ce(jt),fe.dash)}),ge.selectAll("g."+ar._id+"tick,path").remove();var Ka=Je+Me+(Z||0)/2-(z.ticks==="outside"?1:0),Vt=e.calcTicks(ar),Lt=e.getTickSigns(ar)[2];return e.drawTicks(F,ar,{vals:ar.ticks==="inside"?e.clipEnds(ar,Vt):Vt,layer:ge,path:e.makeTickPath(ar,Ka,Lt),transFn:e.makeTransTickFn(ar)}),e.drawLabels(F,ar,{vals:Vt,layer:ge,transFn:e.makeTransTickLabelFn(ar),labelFns:e.makeLabelFns(ar,Ka)})}function Bt(){var qt,Zt=Me+Z/2;Oe.indexOf("inside")===-1&&(qt=n.bBox(ge.node()),Zt+=B?qt.width:qt.height),be=Ge.select("text");var lr=0,ta=B&&Ae==="top",da=!B&&Ae==="right",wa=0;if(be.node()&&!be.classed(_.jsPlaceholder)){var ma,Ia=Ge.select(".h"+ar._id+"title-math-group").node();Ia&&(B&&Mr||!B&&!Mr)?(qt=n.bBox(Ia),lr=qt.width,ma=qt.height):(qt=n.bBox(Ge.node()),lr=qt.right-ae.l-(B?Je:ir),ma=qt.bottom-ae.t-(B?ir:Je),!B&&Ae==="top"&&(Zt+=qt.height,wa=qt.height)),da&&(be.attr("transform",o(lr/2+ve/2,0)),lr*=2),Zt=Math.max(Zt,B?lr:ma)}var va=(B?j:J)*2+Zt+Q+Z/2,La=0;!B&&we.text&&le==="bottom"&&X<=0&&(La=va/2,va+=La,wa+=La),q._hColorbarMoveTitle=La,q._hColorbarMoveCBTitle=wa;var Ka=Q+Z,Vt=(B?Je:ir)-Ka/2-(B?j:0),Lt=(B?ir:Je)-(B?ce:J+wa-La);P.select("."+_.cbbg).attr("x",Vt).attr("y",Lt).attr(B?"width":"height",Math.max(va-La,2)).attr(B?"height":"width",Math.max(ce+Ka,2)).call(s.fill,ue).call(s.stroke,z.bordercolor).style("stroke-width",Q);var jt=da?Math.max(lr-10,0):0;P.selectAll("."+_.cboutline).attr("x",(B?Je:ir+j)+jt).attr("y",(B?ir+J-ce:Je)+(ta?Pe:0)).attr(B?"width":"height",Math.max(Me,2)).attr(B?"height":"width",Math.max(ce-(B?2*J+Pe:2*j+jt),2)).call(s.stroke,z.outlinecolor).style({fill:"none","stroke-width":Z});var Ot=B?At*va:0,gr=B?0:(1-St)*va-wa;if(Ot=ee?ae.l-Ot:-Ot,gr=re?ae.t-gr:-gr,P.attr("transform",o(Ot,gr)),!B&&(Q||x(ue).getAlpha()&&!x.equals(q.paper_bgcolor,ue))){var Br=ge.selectAll("text"),na=Br[0].length,Ur=P.select("."+_.cbbg).node(),ga=n.bBox(Ur),Aa=n.getTranslate(P),Pa=2;Br.each(function(zr,Pr){var Hr=0,Zr=na-1;if(Pr===Hr||Pr===Zr){var Jr=n.bBox(this),wt=n.getTranslate(this),Qt;if(Pr===Zr){var mr=Jr.right+wt.x,$r=ga.right+Aa.x+ir-Q-Pa+$;Qt=$r-mr,Qt>0&&(Qt=0)}else if(Pr===Hr){var oa=Jr.left+wt.x,Sa=ga.left+Aa.x+ir+Q+Pa;Qt=Sa-oa,Qt<0&&(Qt=0)}Qt&&(na<3?this.setAttribute("transform","translate("+Qt+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}})}var sa={},Oa=S[oe],dt=M[oe],vt=S[le],Lr=M[le],Er=va-Me;B?(L==="pixels"?(sa.y=X,sa.t=ce*vt,sa.b=ce*Lr):(sa.t=sa.b=0,sa.yt=X+O*vt,sa.yb=X-O*Lr),U==="pixels"?(sa.x=$,sa.l=va*Oa,sa.r=va*dt):(sa.l=Er*Oa,sa.r=Er*dt,sa.xl=$-N*Oa,sa.xr=$+N*dt)):(L==="pixels"?(sa.x=$,sa.l=ce*Oa,sa.r=ce*dt):(sa.l=sa.r=0,sa.xl=$+O*Oa,sa.xr=$-O*dt),U==="pixels"?(sa.y=1-X,sa.t=va*vt,sa.b=va*Lr):(sa.t=Er*vt,sa.b=Er*Lr,sa.yt=X-N*vt,sa.yb=X+N*Lr));var _r=z.y<.5?"b":"t",yr=z.x<.5?"l":"r";F._fullLayout._reservedMargin[z._id]={};var kr={r:q.width-Vt-Ot,l:Vt+sa.r,b:q.height-Lt-gr,t:Lt+sa.b};ee&&re?A.autoMargin(F,z._id,sa):ee?F._fullLayout._reservedMargin[z._id][_r]=kr[_r]:re||B?F._fullLayout._reservedMargin[z._id][yr]=kr[yr]:F._fullLayout._reservedMargin[z._id][_r]=kr[_r]}return r.syncOrAsync([A.previousPromises,_t,Nt,Mt,A.previousPromises,Bt],F)}function g(P,z,F){var B=z.orientation==="v",O=F._fullLayout,L=O._size,N,U,Z;t.init({element:P.node(),gd:F,prepFn:function(){N=P.attr("transform"),i(P)},moveFn:function(Q,ue){P.attr("transform",N+o(Q,ue)),U=t.align((B?z._uFrac:z._vFrac)+Q/L.w,B?z._thickFrac:z._lenFrac,0,1,z.xanchor),Z=t.align((B?z._vFrac:1-z._uFrac)-ue/L.h,B?z._lenFrac:z._thickFrac,0,1,z.yanchor);var oe=t.getCursor(U,Z,z.xanchor,z.yanchor);i(P,oe)},doneFn:function(){if(i(P),U!==void 0&&Z!==void 0){var Q={};Q[z._propPrefix+"x"]=U,Q[z._propPrefix+"y"]=Z,z._traceIndex!==void 0?E.call("_guiRestyle",F,Q,z._traceIndex):E.call("_guiRelayout",F,Q)}}})}function m(P,z,F){var B=z._levels,O=[],L=[],N,U,Z=B.end+B.size/100,Q=B.size,ue=1.001*F[0]-.001*F[1],oe=1.001*F[1]-.001*F[0];for(U=0;U<1e5&&(N=B.start+U*Q,!(Q>0?N>=Z:N<=Z));U++)N>ue&&N0?N>=Z:N<=Z));U++)N>F[0]&&N-1}G.exports=function(o,a){var i,n=o.data,s=o.layout,c=E([],n),f=E({},s,e(a.tileClass)),v=o._context||{};if(a.width&&(f.width=a.width),a.height&&(f.height=a.height),a.tileClass==="thumbnail"||a.tileClass==="themes__thumb"){f.annotations=[];var h=Object.keys(f);for(i=0;i=0)return v}else if(typeof v=="string"&&(v=v.trim(),v.slice(-1)==="%"&&d(v.slice(0,-1))&&(v=+v.slice(0,-1),v>=0)))return v+"%"}function f(v,h,T,l,y,b){b=b||{};var S=b.moduleHasSelected!==!1,M=b.moduleHasUnselected!==!1,_=b.moduleHasConstrain!==!1,w=b.moduleHasCliponaxis!==!1,p=b.moduleHasTextangle!==!1,u=b.moduleHasInsideanchor!==!1,g=!!b.hasPathbar,m=Array.isArray(y)||y==="auto",R=m||y==="inside",P=m||y==="outside";if(R||P){var z=i(l,"textfont",T.font),F=x.extendFlat({},z),B=v.textfont&&v.textfont.color,O=!B;if(O&&delete F.color,i(l,"insidetextfont",F),g){var L=x.extendFlat({},z);O&&delete L.color,i(l,"pathbar.textfont",L)}P&&i(l,"outsidetextfont",z),S&&l("selected.textfont.color"),M&&l("unselected.textfont.color"),_&&l("constraintext"),w&&l("cliponaxis"),p&&l("textangle"),l("texttemplate")}R&&u&&l("insidetextanchor")}G.exports={supplyDefaults:n,crossTraceDefaults:s,handleText:f,validateCornerradius:c}}}),cw=He({"src/traces/bar/layout_defaults.js"(Y,G){var d=Ei(),x=io(),A=Gr(),E=T1(),e=Jh().validateCornerradius;G.exports=function(t,r,o){function a(S,M){return A.coerce(t,r,E,S,M)}for(var i=!1,n=!1,s=!1,c={},f=a("barmode"),v=f==="group",h=0;h0&&!c[l]&&(s=!0),c[l]=!0),T.visible&&T.type==="histogram"){var y=x.getFromId({_fullLayout:r},T[T.orientation==="v"?"xaxis":"yaxis"]);y.type!=="category"&&(n=!0)}}if(!i){delete r.barmode;return}f!=="overlay"&&a("barnorm"),a("bargap",n&&!s?0:.2),a("bargroupgap");var b=a("barcornerradius");r.barcornerradius=e(b)}}}),oy=He({"src/traces/bar/arrays_to_calcdata.js"(Y,G){var d=Gr();G.exports=function(A,E){for(var e=0;er;if(!o)return E}return e!==void 0?e:A.dflt},Y.coerceColor=function(A,E,e){return d(E).isValid()?E:e!==void 0?e:A.dflt},Y.coerceEnumerated=function(A,E,e){return A.coerceNumber&&(E=+E),A.values.indexOf(E)!==-1?E:e!==void 0?e:A.dflt},Y.getValue=function(A,E){var e;return x(A)?E1||g.bargap===0&&g.bargroupgap===0&&!m[0].trace.marker.line.width)&&d.select(this).attr("shape-rendering","crispEdges")}),p.selectAll("g.points").each(function(m){var R=d.select(this),P=m[0].trace;c(R,P,w)}),e.getComponentMethod("errorbars","style")(p)}function c(w,p,u){A.pointStyle(w.selectAll("path"),p,u),f(w,p,u)}function f(w,p,u){w.selectAll("text").each(function(g){var m=d.select(this),R=E.ensureUniformFontSize(u,l(m,g,p,u));A.font(m,R)})}function v(w,p,u){var g=p[0].trace;g.selectedpoints?h(u,g,w):(c(u,g,w),e.getComponentMethod("errorbars","style")(u))}function h(w,p,u){A.selectedPointStyle(w.selectAll("path"),p),T(w.selectAll("text"),p,u)}function T(w,p,u){w.each(function(g){var m=d.select(this),R;if(g.selected){R=E.ensureUniformFontSize(u,l(m,g,p,u));var P=p.selected.textfont&&p.selected.textfont.color;P&&(R.color=P),A.font(m,R)}else A.selectedTextStyle(m,p)})}function l(w,p,u,g){var m=g._fullLayout.font,R=u.textfont;if(w.classed("bartext-inside")){var P=_(p,u);R=b(u,p.i,m,P)}else w.classed("bartext-outside")&&(R=S(u,p.i,m));return R}function y(w,p,u){return M(o,w.textfont,p,u)}function b(w,p,u,g){var m=y(w,p,u),R=w._input.textfont===void 0||w._input.textfont.color===void 0||Array.isArray(w.textfont.color)&&w.textfont.color[p]===void 0;return R&&(m={color:x.contrast(g),family:m.family,size:m.size,weight:m.weight,style:m.style,variant:m.variant,textcase:m.textcase,lineposition:m.lineposition,shadow:m.shadow}),M(a,w.insidetextfont,p,m)}function S(w,p,u){var g=y(w,p,u);return M(i,w.outsidetextfont,p,g)}function M(w,p,u,g){p=p||{};var m=n.getValue(p.family,u),R=n.getValue(p.size,u),P=n.getValue(p.color,u),z=n.getValue(p.weight,u),F=n.getValue(p.style,u),B=n.getValue(p.variant,u),O=n.getValue(p.textcase,u),L=n.getValue(p.lineposition,u),N=n.getValue(p.shadow,u);return{family:n.coerceString(w.family,m,g.family),size:n.coerceNumber(w.size,R,g.size),color:n.coerceColor(w.color,P,g.color),weight:n.coerceString(w.weight,z,g.weight),style:n.coerceString(w.style,F,g.style),variant:n.coerceString(w.variant,B,g.variant),textcase:n.coerceString(w.variant,O,g.textcase),lineposition:n.coerceString(w.variant,L,g.lineposition),shadow:n.coerceString(w.variant,N,g.shadow)}}function _(w,p){return p.type==="waterfall"?p[w.dir].marker.color:w.mcc||w.mc||p.marker.color}G.exports={style:s,styleTextPoints:f,styleOnSelect:v,getInsideTextFont:b,getOutsideTextFont:S,getBarColor:_,resizeText:t}}}),Dp=He({"src/traces/bar/plot.js"(Y,G){var d=Qn(),x=Hi(),A=Gr(),E=yl(),e=Ai(),t=vo(),r=Ei(),o=io().tickText,a=hh(),i=a.recordMinTextSize,n=a.clearMinTextSize,s=uv(),c=S1(),f=Rp(),v=qv(),h=v.text,T=v.textposition,l=Ph().appendArrayPointValue,y=f.TEXTPAD;function b(Q){return Q.id}function S(Q){if(Q.ids)return b}function M(Q){return(Q>0)-(Q<0)}function _(Q,ue){return Q0}function g(Q,ue,oe,le,j,J){var $=ue.xaxis,X=ue.yaxis,re=Q._fullLayout,ee=Q._context.staticPlot;j||(j={mode:re.barmode,norm:re.barmode,gap:re.bargap,groupgap:re.bargroupgap},n("bar",re));var q=A.makeTraceGroups(le,oe,"trace bars").each(function(ae){var ie=d.select(this),fe=ae[0].trace,we=ae[0].t,Ae=fe.type==="waterfall",Fe=fe.type==="funnel",Ce=fe.type==="histogram",qe=fe.type==="bar",et=qe||Fe,Qe=0;Ae&&fe.connector.visible&&fe.connector.mode==="between"&&(Qe=fe.connector.line.width/2);var Ke=fe.orientation==="h",Xe=u(j),Me=A.ensureSingle(ie,"g","points"),xe=S(fe),ce=Me.selectAll("g.point").data(A.identity,xe);ce.enter().append("g").classed("point",!0),ce.exit().remove(),ce.each(function($e,rt){var Je=d.select(this),At=w($e,$,X,Ke),St=At[0][0],Rt=At[0][1],Ut=At[1][0],ir=At[1][1],ar=(Ke?Rt-St:ir-Ut)===0;ar&&et&&c.getLineWidth(fe,$e)&&(ar=!1),ar||(ar=!x(St)||!x(Rt)||!x(Ut)||!x(ir)),$e.isBlank=ar,ar&&(Ke?Rt=St:ir=Ut),Qe&&!ar&&(Ke?(St-=_(St,Rt)*Qe,Rt+=_(St,Rt)*Qe):(Ut-=_(Ut,ir)*Qe,ir+=_(Ut,ir)*Qe));var Mr,fr;if(fe.type==="waterfall"){if(!ar){var dr=fe[$e.dir].marker;Mr=dr.line.width,fr=dr.color}}else Mr=c.getLineWidth(fe,$e),fr=$e.mc||fe.marker.color;function pt(Ka){var Vt=d.round(Mr/2%1,2);return j.gap===0&&j.groupgap===0?d.round(Math.round(Ka)-Vt,2):Ka}function ze(Ka,Vt,Lt){return Lt&&Ka===Vt?Ka:Math.abs(Ka-Vt)>=2?pt(Ka):Ka>Vt?Math.ceil(Ka):Math.floor(Ka)}var Ge=e.opacity(fr),Oe=Ge<1||Mr>.01?pt:ze;Q._context.staticPlot||(St=Oe(St,Rt,Ke),Rt=Oe(Rt,St,Ke),Ut=Oe(Ut,ir,!Ke),ir=Oe(ir,Ut,!Ke));var ve=Ke?$.c2p:X.c2p,ge;$e.s0>0?ge=$e._sMax:$e.s0<0?ge=$e._sMin:ge=$e.s1>0?$e._sMax:$e._sMin;function be(Ka,Vt){if(!Ka)return 0;var Lt=Math.abs(Ke?ir-Ut:Rt-St),jt=Math.abs(Ke?Rt-St:ir-Ut),Ot=Oe(Math.abs(ve(ge,!0)-ve(0,!0))),gr=$e.hasB?Math.min(Lt/2,jt/2):Math.min(Lt/2,Ot),Br;if(Vt==="%"){var na=Math.min(50,Ka);Br=Lt*(na/100)}else Br=Ka;return Oe(Math.max(Math.min(Br,gr),0))}var Pe=qe||Ce?be(we.cornerradiusvalue,we.cornerradiusform):0,We,ct,_t="M"+St+","+Ut+"V"+ir+"H"+Rt+"V"+Ut+"Z",Mt=0;if(Pe&&$e.s){var Nt=M($e.s0)===0||M($e.s)===M($e.s0)?$e.s1:$e.s0;if(Mt=Oe($e.hasB?0:Math.abs(ve(ge,!0)-ve(Nt,!0))),Mt0?Math.sqrt(Mt*(2*Pe-Mt)):0,da=Bt>0?Math.max:Math.min;We="M"+St+","+Ut+"V"+(ir-lr*qt)+"H"+da(Rt-(Pe-Mt)*Bt,St)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+Rt+","+(ir-Pe*qt-ta)+"V"+(Ut+Pe*qt+ta)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+da(Rt-(Pe-Mt)*Bt,St)+","+(Ut+lr*qt)+"Z"}else if($e.hasB)We="M"+(St+Pe*Bt)+","+Ut+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+St+","+(Ut+Pe*qt)+"V"+(ir-Pe*qt)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+(St+Pe*Bt)+","+ir+"H"+(Rt-Pe*Bt)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+Rt+","+(ir-Pe*qt)+"V"+(Ut+Pe*qt)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+(Rt-Pe*Bt)+","+Ut+"Z";else{ct=Math.abs(ir-Ut)+Mt;var wa=ct0?Math.sqrt(Mt*(2*Pe-Mt)):0,Ia=qt>0?Math.max:Math.min;We="M"+(St+wa*Bt)+","+Ut+"V"+Ia(ir-(Pe-Mt)*qt,Ut)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+(St+Pe*Bt-ma)+","+ir+"H"+(Rt-Pe*Bt+ma)+"A "+Pe+","+Pe+" 0 0 "+Zt+" "+(Rt-wa*Bt)+","+Ia(ir-(Pe-Mt)*qt,Ut)+"V"+Ut+"Z"}}else We=_t}else We=_t;var va=p(A.ensureSingle(Je,"path"),re,j,J);if(va.style("vector-effect",ee?"none":"non-scaling-stroke").attr("d",isNaN((Rt-St)*(ir-Ut))||ar&&Q._context.staticPlot?"M0,0Z":We).call(t.setClipUrl,ue.layerClipId,Q),!re.uniformtext.mode&&Xe){var La=t.makePointStyleFns(fe);t.singlePointStyle($e,va,fe,La,Q)}m(Q,ue,Je,ae,rt,St,Rt,Ut,ir,Pe,Mt,j,J),ue.layerClipId&&t.hideOutsideRangePoint($e,Je.select("text"),$,X,fe.xcalendar,fe.ycalendar)});var Re=fe.cliponaxis===!1;t.setClipUrl(ie,Re?null:ue.layerClipId,Q)});r.getComponentMethod("errorbars","plot")(Q,q,ue,j)}function m(Q,ue,oe,le,j,J,$,X,re,ee,q,ae,ie){var fe=ue.xaxis,we=ue.yaxis,Ae=Q._fullLayout,Fe;function Ce(ct,_t,Mt){var Nt=A.ensureSingle(ct,"text").text(_t).attr({class:"bartext bartext-"+Fe,"text-anchor":"middle","data-notex":1}).call(t.font,Mt).call(E.convertToTspans,Q);return Nt}var qe=le[0].trace,et=qe.orientation==="h",Qe=L(Ae,le,j,fe,we);Fe=N(qe,j);var Ke=ae.mode==="stack"||ae.mode==="relative",Xe=le[j],Me=!Ke||Xe._outmost,xe=Xe.hasB,ce=ee&&ee-q>y;if(!Qe||Fe==="none"||(Xe.isBlank||J===$||X===re)&&(Fe==="auto"||Fe==="inside")){oe.select("text").remove();return}var Re=Ae.font,$e=s.getBarColor(le[j],qe),rt=s.getInsideTextFont(qe,j,Re,$e),Je=s.getOutsideTextFont(qe,j,Re),At=qe.insidetextanchor||"end",St=oe.datum();et?fe.type==="log"&&St.s0<=0&&(fe.range[0]0&&pt>0,Oe;ce?xe?Oe=R(ir-2*ee,ar,dr,pt,et)||R(ir,ar-2*ee,dr,pt,et):et?Oe=R(ir-(ee-q),ar,dr,pt,et)||R(ir,ar-2*(ee-q),dr,pt,et):Oe=R(ir,ar-(ee-q),dr,pt,et)||R(ir-2*(ee-q),ar,dr,pt,et):Oe=R(ir,ar,dr,pt,et),Ge&&Oe?Fe="inside":(Fe="outside",Mr.remove(),Mr=null)}else Fe="inside";if(!Mr){ze=A.ensureUniformFontSize(Q,Fe==="outside"?Je:rt),Mr=Ce(oe,Qe,ze);var ve=Mr.attr("transform");if(Mr.attr("transform",""),fr=t.bBox(Mr.node()),dr=fr.width,pt=fr.height,Mr.attr("transform",ve),dr<=0||pt<=0){Mr.remove();return}}var ge=qe.textangle,be,Pe;Fe==="outside"?(Pe=qe.constraintext==="both"||qe.constraintext==="outside",be=O(J,$,X,re,fr,{isHorizontal:et,constrained:Pe,angle:ge})):(Pe=qe.constraintext==="both"||qe.constraintext==="inside",be=F(J,$,X,re,fr,{isHorizontal:et,constrained:Pe,angle:ge,anchor:At,hasB:xe,r:ee,overhead:q})),be.fontSize=ze.size,i(qe.type==="histogram"?"bar":qe.type,be,Ae),Xe.transform=be;var We=p(Mr,Ae,ae,ie);A.setTransormAndDisplay(We,be)}function R(Q,ue,oe,le,j){if(Q<0||ue<0)return!1;var J=oe<=Q&&le<=ue,$=oe<=ue&&le<=Q,X=j?Q>=oe*(ue/le):ue>=le*(Q/oe);return J||$||X}function P(Q){return Q==="auto"?0:Q}function z(Q,ue){var oe=Math.PI/180*ue,le=Math.abs(Math.sin(oe)),j=Math.abs(Math.cos(oe));return{x:Q.width*j+Q.height*le,y:Q.width*le+Q.height*j}}function F(Q,ue,oe,le,j,J){var $=!!J.isHorizontal,X=!!J.constrained,re=J.angle||0,ee=J.anchor,q=ee==="end",ae=ee==="start",ie=J.leftToRight||0,fe=(ie+1)/2,we=1-fe,Ae=J.hasB,Fe=J.r,Ce=J.overhead,qe=j.width,et=j.height,Qe=Math.abs(ue-Q),Ke=Math.abs(le-oe),Xe=Qe>2*y&&Ke>2*y?y:0;Qe-=2*Xe,Ke-=2*Xe;var Me=P(re);re==="auto"&&!(qe<=Qe&&et<=Ke)&&(qe>Qe||et>Ke)&&(!(qe>Ke||et>Qe)||qey){var $e=B(Q,ue,oe,le,xe,Fe,Ce,$,Ae);ce=$e.scale,Re=$e.pad}else ce=1,X&&(ce=Math.min(1,Qe/xe.x,Ke/xe.y)),Re=0;var rt=j.left*we+j.right*fe,Je=(j.top+j.bottom)/2,At=(Q+y)*we+(ue-y)*fe,St=(oe+le)/2,Rt=0,Ut=0;if(ae||q){var ir=($?xe.x:xe.y)/2;Fe&&(q||Ae)&&(Xe+=Re);var ar=$?_(Q,ue):_(oe,le);$?ae?(At=Q+ar*Xe,Rt=-ar*ir):(At=ue-ar*Xe,Rt=ar*ir):ae?(St=oe+ar*Xe,Ut=-ar*ir):(St=le-ar*Xe,Ut=ar*ir)}return{textX:rt,textY:Je,targetX:At,targetY:St,anchorX:Rt,anchorY:Ut,scale:ce,rotate:Me}}function B(Q,ue,oe,le,j,J,$,X,re){var ee=Math.max(0,Math.abs(ue-Q)-2*y),q=Math.max(0,Math.abs(le-oe)-2*y),ae=J-y,ie=$?ae-Math.sqrt(ae*ae-(ae-$)*(ae-$)):ae,fe=re?ae*2:X?ae-$:2*ie,we=re?ae*2:X?2*ie:ae-$,Ae,Fe,Ce,qe,et;return j.y/j.x>=q/(ee-fe)?qe=q/j.y:j.y/j.x<=(q-we)/ee?qe=ee/j.x:!re&&X?(Ae=j.x*j.x+j.y*j.y/4,Fe=-2*j.x*(ee-ae)-j.y*(q/2-ae),Ce=(ee-ae)*(ee-ae)+(q/2-ae)*(q/2-ae)-ae*ae,qe=(-Fe+Math.sqrt(Fe*Fe-4*Ae*Ce))/(2*Ae)):re?(Ae=(j.x*j.x+j.y*j.y)/4,Fe=-j.x*(ee/2-ae)-j.y*(q/2-ae),Ce=(ee/2-ae)*(ee/2-ae)+(q/2-ae)*(q/2-ae)-ae*ae,qe=(-Fe+Math.sqrt(Fe*Fe-4*Ae*Ce))/(2*Ae)):(Ae=j.x*j.x/4+j.y*j.y,Fe=-j.x*(ee/2-ae)-2*j.y*(q-ae),Ce=(ee/2-ae)*(ee/2-ae)+(q-ae)*(q-ae)-ae*ae,qe=(-Fe+Math.sqrt(Fe*Fe-4*Ae*Ce))/(2*Ae)),qe=Math.min(1,qe),X?et=Math.max(0,ae-Math.sqrt(Math.max(0,ae*ae-(ae-(q-j.y*qe)/2)*(ae-(q-j.y*qe)/2)))-$):et=Math.max(0,ae-Math.sqrt(Math.max(0,ae*ae-(ae-(ee-j.x*qe)/2)*(ae-(ee-j.x*qe)/2)))-$),{scale:qe,pad:et}}function O(Q,ue,oe,le,j,J){var $=!!J.isHorizontal,X=!!J.constrained,re=J.angle||0,ee=j.width,q=j.height,ae=Math.abs(ue-Q),ie=Math.abs(le-oe),fe;$?fe=ie>2*y?y:0:fe=ae>2*y?y:0;var we=1;X&&(we=$?Math.min(1,ie/q):Math.min(1,ae/ee));var Ae=P(re),Fe=z(j,Ae),Ce=($?Fe.x:Fe.y)/2,qe=(j.left+j.right)/2,et=(j.top+j.bottom)/2,Qe=(Q+ue)/2,Ke=(oe+le)/2,Xe=0,Me=0,xe=$?_(ue,Q):_(oe,le);return $?(Qe=ue-xe*fe,Xe=xe*Ce):(Ke=le+xe*fe,Me=-xe*Ce),{textX:qe,textY:et,targetX:Qe,targetY:Ke,anchorX:Xe,anchorY:Me,scale:we,rotate:Ae}}function L(Q,ue,oe,le,j){var J=ue[0].trace,$=J.texttemplate,X;return $?X=U(Q,ue,oe,le,j):J.textinfo?X=Z(ue,oe,le,j):X=c.getValue(J.text,oe),c.coerceString(h,X)}function N(Q,ue){var oe=c.getValue(Q.textposition,ue);return c.coerceEnumerated(T,oe)}function U(Q,ue,oe,le,j){var J=ue[0].trace,$=A.castOption(J,oe,"texttemplate");if(!$)return"";var X=J.type==="histogram",re=J.type==="waterfall",ee=J.type==="funnel",q=J.orientation==="h",ae,ie,fe,we;q?(ae="y",ie=j,fe="x",we=le):(ae="x",ie=le,fe="y",we=j);function Ae(Xe){return o(ie,ie.c2l(Xe),!0).text}function Fe(Xe){return o(we,we.c2l(Xe),!0).text}var Ce=ue[oe],qe={};qe.label=Ce.p,qe.labelLabel=qe[ae+"Label"]=Ae(Ce.p);var et=A.castOption(J,Ce.i,"text");(et===0||et)&&(qe.text=et),qe.value=Ce.s,qe.valueLabel=qe[fe+"Label"]=Fe(Ce.s);var Qe={};l(Qe,J,Ce.i),(X||Qe.x===void 0)&&(Qe.x=q?qe.value:qe.label),(X||Qe.y===void 0)&&(Qe.y=q?qe.label:qe.value),(X||Qe.xLabel===void 0)&&(Qe.xLabel=q?qe.valueLabel:qe.labelLabel),(X||Qe.yLabel===void 0)&&(Qe.yLabel=q?qe.labelLabel:qe.valueLabel),re&&(qe.delta=+Ce.rawS||Ce.s,qe.deltaLabel=Fe(qe.delta),qe.final=Ce.v,qe.finalLabel=Fe(qe.final),qe.initial=qe.final-qe.delta,qe.initialLabel=Fe(qe.initial)),ee&&(qe.value=Ce.s,qe.valueLabel=Fe(qe.value),qe.percentInitial=Ce.begR,qe.percentInitialLabel=A.formatPercent(Ce.begR),qe.percentPrevious=Ce.difR,qe.percentPreviousLabel=A.formatPercent(Ce.difR),qe.percentTotal=Ce.sumR,qe.percenTotalLabel=A.formatPercent(Ce.sumR));var Ke=A.castOption(J,Ce.i,"customdata");return Ke&&(qe.customdata=Ke),A.texttemplateString($,qe,Q._d3locale,Qe,qe,J._meta||{})}function Z(Q,ue,oe,le){var j=Q[0].trace,J=j.orientation==="h",$=j.type==="waterfall",X=j.type==="funnel";function re(Ke){var Xe=J?le:oe;return o(Xe,Ke,!0).text}function ee(Ke){var Xe=J?oe:le;return o(Xe,+Ke,!0).text}var q=j.textinfo,ae=Q[ue],ie=q.split("+"),fe=[],we,Ae=function(Ke){return ie.indexOf(Ke)!==-1};if(Ae("label")&&fe.push(re(Q[ue].p)),Ae("text")&&(we=A.castOption(j,ae.i,"text"),(we===0||we)&&fe.push(we)),$){var Fe=+ae.rawS||ae.s,Ce=ae.v,qe=Ce-Fe;Ae("initial")&&fe.push(ee(qe)),Ae("delta")&&fe.push(ee(Fe)),Ae("final")&&fe.push(ee(Ce))}if(X){Ae("value")&&fe.push(ee(ae.s));var et=0;Ae("percent initial")&&et++,Ae("percent previous")&&et++,Ae("percent total")&&et++;var Qe=et>1;Ae("percent initial")&&(we=A.formatPercent(ae.begR),Qe&&(we+=" of initial"),fe.push(we)),Ae("percent previous")&&(we=A.formatPercent(ae.difR),Qe&&(we+=" of previous"),fe.push(we)),Ae("percent total")&&(we=A.formatPercent(ae.sumR),Qe&&(we+=" of total"),fe.push(we))}return fe.join("
")}G.exports={plot:g,toMoveInsideBar:F}}}),Z0=He({"src/traces/bar/hover.js"(Y,G){var d=Wu(),x=Ei(),A=Ai(),E=Gr().fillText,e=S1().getLineWidth,t=io().hoverLabelText,r=lo().BADNUM;function o(n,s,c,f,v){var h=a(n,s,c,f,v);if(h){var T=h.cd,l=T[0].trace,y=T[h.index];return h.color=i(l,y),x.getComponentMethod("errorbars","hoverInfo")(y,l,h),[h]}}function a(n,s,c,f,v){var h=n.cd,T=h[0].trace,l=h[0].t,y=f==="closest",b=T.type==="waterfall",S=n.maxHoverDistance,M=n.maxSpikeDistance,_,w,p,u,g,m,R;T.orientation==="h"?(_=c,w=s,p="y",u="x",g=le,m=Q):(_=s,w=c,p="x",u="y",m=le,g=Q);var P=T[p+"period"],z=y||P;function F(we){return O(we,-1)}function B(we){return O(we,1)}function O(we,Ae){var Fe=we.w;return we[p]+Ae*Fe/2}function L(we){return we[p+"End"]-we[p+"Start"]}var N=y?F:P?function(we){return we.p-L(we)/2}:function(we){return Math.min(F(we),we.p-l.bardelta/2)},U=y?B:P?function(we){return we.p+L(we)/2}:function(we){return Math.max(B(we),we.p+l.bardelta/2)};function Z(we,Ae,Fe){return v.finiteRange&&(Fe=0),d.inbox(we-_,Ae-_,Fe+Math.min(1,Math.abs(Ae-we)/R)-1)}function Q(we){return Z(N(we),U(we),S)}function ue(we){return Z(F(we),B(we),M)}function oe(we){var Ae=we[u];if(b){var Fe=Math.abs(we.rawS)||0;w>0?Ae+=Fe:w<0&&(Ae-=Fe)}return Ae}function le(we){var Ae=w,Fe=we.b,Ce=oe(we);return d.inbox(Fe-Ae,Ce-Ae,S+(Ce-Ae)/(Ce-Fe)-1)}function j(we){var Ae=w,Fe=we.b,Ce=oe(we);return d.inbox(Fe-Ae,Ce-Ae,M+(Ce-Ae)/(Ce-Fe)-1)}var J=n[p+"a"],$=n[u+"a"];R=Math.abs(J.r2c(J.range[1])-J.r2c(J.range[0]));function X(we){return(g(we)+m(we))/2}var re=d.getDistanceFunction(f,g,m,X);if(d.getClosest(h,re,n),n.index!==!1&&h[n.index].p!==r){z||(N=function(we){return Math.min(F(we),we.p-l.bargroupwidth/2)},U=function(we){return Math.max(B(we),we.p+l.bargroupwidth/2)});var ee=n.index,q=h[ee],ae=T.base?q.b+q.s:q.s;n[u+"0"]=n[u+"1"]=$.c2p(q[u],!0),n[u+"LabelVal"]=ae;var ie=l.extents[l.extents.round(q.p)];n[p+"0"]=J.c2p(y?N(q):ie[0],!0),n[p+"1"]=J.c2p(y?U(q):ie[1],!0);var fe=q.orig_p!==void 0;return n[p+"LabelVal"]=fe?q.orig_p:q.p,n.labelLabel=t(J,n[p+"LabelVal"],T[p+"hoverformat"]),n.valueLabel=t($,n[u+"LabelVal"],T[u+"hoverformat"]),n.baseLabel=t($,q.b,T[u+"hoverformat"]),n.spikeDistance=(j(q)+ue(q))/2,n[p+"Spike"]=J.c2p(q.p,!0),E(q,T,n),n.hovertemplate=T.hovertemplate,n}}function i(n,s){var c=s.mcc||n.marker.color,f=s.mlcc||n.marker.line.color,v=e(n,s);if(A.opacity(c))return c;if(A.opacity(f)&&v)return f}G.exports={hoverPoints:o,hoverOnBars:a,getTraceColor:i}}}),j5=He({"src/traces/bar/event_data.js"(Y,G){G.exports=function(x,A,E){return x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),E.orientation==="h"?(x.label=x.y,x.value=x.x):(x.label=x.x,x.value=x.y),x}}}),X0=He({"src/traces/bar/select.js"(Y,G){G.exports=function(A,E){var e=A.cd,t=A.xaxis,r=A.yaxis,o=e[0].trace,a=o.type==="funnel",i=o.orientation==="h",n=[],s;if(E===!1)for(s=0;s0?(P="v",p>0?z=Math.min(g,u):z=Math.min(u)):p>0?(P="h",z=Math.min(g)):z=0;if(!z){c.visible=!1;return}c._length=z;var N=f("orientation",P);c._hasPreCompStats?N==="v"&&p===0?(f("x0",0),f("dx",1)):N==="h"&&w===0&&(f("y0",0),f("dy",1)):N==="v"&&p===0?f("x0"):N==="h"&&w===0&&f("y0");var U=x.getComponentMethod("calendars","handleTraceDefaults");U(s,c,["x","y"],v)}function i(s,c,f,v){var h=v.prefix,T=d.coerce2(s,c,r,"marker.outliercolor"),l=f("marker.line.outliercolor"),y="outliers";c._hasPreCompStats?y="all":(T||l)&&(y="suspectedoutliers");var b=f(h+"points",y);b?(f("jitter",b==="all"?.3:0),f("pointpos",b==="all"?-1.5:0),f("marker.symbol"),f("marker.opacity"),f("marker.size"),f("marker.angle"),f("marker.color",c.line.color),f("marker.line.color"),f("marker.line.width"),b==="suspectedoutliers"&&(f("marker.line.outliercolor",c.marker.color),f("marker.line.outlierwidth")),f("selected.marker.color"),f("unselected.marker.color"),f("selected.marker.size"),f("unselected.marker.size"),f("text"),f("hovertext")):delete c.marker;var S=f("hoveron");(S==="all"||S.indexOf("points")!==-1)&&f("hovertemplate"),d.coerceSelectionMarkerOpacity(c,f)}function n(s,c){var f,v;function h(b){return d.coerce(v._input,v,r,b)}for(var T=0;Toe.uf};if(M._hasPreCompStats){var ee=M[z],q=function(ar){return P.d2c((M[ar]||[])[m])},ae=1/0,ie=-1/0;for(m=0;m=oe.q1&&oe.q3>=oe.med){var we=q("lowerfence");oe.lf=we!==e&&we<=oe.q1?we:v(oe,j,J);var Ae=q("upperfence");oe.uf=Ae!==e&&Ae>=oe.q3?Ae:h(oe,j,J);var Fe=q("mean");oe.mean=Fe!==e?Fe:J?E.mean(j,J):(oe.q1+oe.q3)/2;var Ce=q("sd");oe.sd=Fe!==e&&Ce>=0?Ce:J?E.stdev(j,J,oe.mean):oe.q3-oe.q1,oe.lo=T(oe),oe.uo=l(oe);var qe=q("notchspan");qe=qe!==e&&qe>0?qe:y(oe,J),oe.ln=oe.med-qe,oe.un=oe.med+qe;var et=oe.lf,Qe=oe.uf;M.boxpoints&&j.length&&(et=Math.min(et,j[0]),Qe=Math.max(Qe,j[J-1])),M.notched&&(et=Math.min(et,oe.ln),Qe=Math.max(Qe,oe.un)),oe.min=et,oe.max=Qe}else{E.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+oe.q1,"median = "+oe.med,"q3 = "+oe.q3].join(` +`));var Ke;oe.med!==e?Ke=oe.med:oe.q1!==e?oe.q3!==e?Ke=(oe.q1+oe.q3)/2:Ke=oe.q1:oe.q3!==e?Ke=oe.q3:Ke=0,oe.med=Ke,oe.q1=oe.q3=Ke,oe.lf=oe.uf=Ke,oe.mean=oe.sd=Ke,oe.ln=oe.un=Ke,oe.min=oe.max=Ke}ae=Math.min(ae,oe.min),ie=Math.max(ie,oe.max),oe.pts2=le.filter(re),u.push(oe)}}M._extremes[P._id]=x.findExtremes(P,[ae,ie],{padded:!0})}else{var Xe=P.makeCalcdata(M,z),Me=o(Q,ue),xe=Q.length,ce=a(xe);for(m=0;m=0&&Re0){if(oe={},oe.pos=oe[B]=Q[m],le=oe.pts=ce[m].sort(c),j=oe[z]=le.map(f),J=j.length,oe.min=j[0],oe.max=j[J-1],oe.mean=E.mean(j,J),oe.sd=E.stdev(j,J,oe.mean)*M.sdmultiple,oe.med=E.interp(j,.5),J%2&&(At||St)){var Rt,Ut;At?(Rt=j.slice(0,J/2),Ut=j.slice(J/2+1)):St&&(Rt=j.slice(0,J/2+1),Ut=j.slice(J/2)),oe.q1=E.interp(Rt,.5),oe.q3=E.interp(Ut,.5)}else oe.q1=E.interp(j,.25),oe.q3=E.interp(j,.75);oe.lf=v(oe,j,J),oe.uf=h(oe,j,J),oe.lo=T(oe),oe.uo=l(oe);var ir=y(oe,J);oe.ln=oe.med-ir,oe.un=oe.med+ir,$e=Math.min($e,oe.ln),rt=Math.max(rt,oe.un),oe.pts2=le.filter(re),u.push(oe)}M.notched&&E.isTypedArray(Xe)&&(Xe=Array.from(Xe)),M._extremes[P._id]=x.findExtremes(P,M.notched?Xe.concat([$e,rt]):Xe,{padded:!0})}return s(u,M),u.length>0?(u[0].t={num:_[g],dPos:ue,posLetter:B,valLetter:z,labels:{med:t(S,"median:"),min:t(S,"min:"),q1:t(S,"q1:"),q3:t(S,"q3:"),max:t(S,"max:"),mean:M.boxmean==="sd"||M.sizemode==="sd"?t(S,"mean ± σ:").replace("σ",M.sdmultiple===1?"σ":M.sdmultiple+"σ"):t(S,"mean:"),lf:t(S,"lower fence:"),uf:t(S,"upper fence:")}},_[g]++,u):[{t:{empty:!0}}]};function r(b,S,M,_){var w=S in b,p=S+"0"in b,u="d"+S in b;if(w||p&&u){var g=M.makeCalcdata(b,S),m=A(b,M,S,g).vals;return[m,g]}var R;p?R=b[S+"0"]:"name"in b&&(M.type==="category"||d(b.name)&&["linear","log"].indexOf(M.type)!==-1||E.isDateTime(b.name)&&M.type==="date")?R=b.name:R=_;for(var P=M.type==="multicategory"?M.r2c_just_indices(R):M.d2c(R,0,b[S+"calendar"]),z=b._length,F=new Array(z),B=0;B1,p=1-s[r+"gap"],u=1-s[r+"groupgap"];for(v=0;v0;if(P==="positive"?(oe=z*(R?1:.5),J=j,le=J=B):P==="negative"?(oe=J=B,le=z*(R?1:.5),$=j):(oe=le=z,J=$=j),ie){var fe=g.pointpos,we=g.jitter,Ae=g.marker.size/2,Fe=0;fe+we>=0&&(Fe=j*(fe+we),Fe>oe?(ae=!0,ee=Ae,X=Fe):Fe>J&&(ee=Ae,X=oe)),Fe<=oe&&(X=oe);var Ce=0;fe-we<=0&&(Ce=-j*(fe-we),Ce>le?(ae=!0,q=Ae,re=Ce):Ce>$&&(q=Ae,re=le)),Ce<=le&&(re=le)}else X=oe,re=le;var qe=new Array(T.length);for(h=0;hM.lo&&(N.so=!0)}return w});S.enter().append("path").classed("point",!0),S.exit().remove(),S.call(A.translatePoints,f,v)}function a(i,n,s,c){var f=n.val,v=n.pos,h=!!v.rangebreaks,T=c.bPos,l=c.bPosPxOffset||0,y=s.boxmean||(s.meanline||{}).visible,b,S;Array.isArray(c.bdPos)?(b=c.bdPos[0],S=c.bdPos[1]):(b=c.bdPos,S=c.bdPos);var M=i.selectAll("path.mean").data(s.type==="box"&&s.boxmean||s.type==="violin"&&s.box.visible&&s.meanline.visible?x.identity:[]);M.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),M.exit().remove(),M.each(function(_){var w=v.c2l(_.pos+T,!0),p=v.l2p(w-b)+l,u=v.l2p(w+S)+l,g=h?(p+u)/2:v.l2p(w)+l,m=f.c2p(_.mean,!0),R=f.c2p(_.mean-_.sd,!0),P=f.c2p(_.mean+_.sd,!0);s.orientation==="h"?d.select(this).attr("d","M"+m+","+p+"V"+u+(y==="sd"?"m0,0L"+R+","+g+"L"+m+","+p+"L"+P+","+g+"Z":"")):d.select(this).attr("d","M"+p+","+m+"H"+u+(y==="sd"?"m0,0L"+g+","+R+"L"+p+","+m+"L"+g+","+P+"Z":""))})}G.exports={plot:t,plotBoxAndWhiskers:r,plotPoints:o,plotBoxMean:a}}}),C1=He({"src/traces/box/style.js"(Y,G){var d=Qn(),x=Ai(),A=vo();function E(t,r,o){var a=o||d.select(t).selectAll("g.trace.boxes");a.style("opacity",function(i){return i[0].trace.opacity}),a.each(function(i){var n=d.select(this),s=i[0].trace,c=s.line.width;function f(T,l,y,b){T.style("stroke-width",l+"px").call(x.stroke,y).call(x.fill,b)}var v=n.selectAll("path.box");if(s.type==="candlestick")v.each(function(T){if(!T.empty){var l=d.select(this),y=s[T.dir];f(l,y.line.width,y.line.color,y.fillcolor),l.style("opacity",s.selectedpoints&&!T.selected?.3:1)}});else{f(v,c,s.line.color,s.fillcolor),n.selectAll("path.mean").style({"stroke-width":c,"stroke-dasharray":2*c+"px,"+c+"px"}).call(x.stroke,s.line.color);var h=n.selectAll("path.point");A.pointStyle(h,s,t)}})}function e(t,r,o){var a=r[0].trace,i=o.selectAll("path.point");a.selectedpoints?A.selectedPointStyle(i,a):A.pointStyle(i,a,t)}G.exports={style:E,styleOnSelect:e}}}),hw=He({"src/traces/box/hover.js"(Y,G){var d=io(),x=Gr(),A=Wu(),E=Ai(),e=x.fillText;function t(a,i,n,s){var c=a.cd,f=c[0].trace,v=f.hoveron,h=[],T;return v.indexOf("boxes")!==-1&&(h=h.concat(r(a,i,n,s))),v.indexOf("points")!==-1&&(T=o(a,i,n)),s==="closest"?T?[T]:h:(T&&h.push(T),h)}function r(a,i,n,s){var c=a.cd,f=a.xa,v=a.ya,h=c[0].trace,T=c[0].t,l=h.type==="violin",y,b,S,M,_,w,p,u,g,m,R,P=T.bdPos,z,F,B=T.wHover,O=function(Ce){return S.c2l(Ce.pos)+T.bPos-S.c2l(w)};l&&h.side!=="both"?(h.side==="positive"&&(g=function(Ce){var qe=O(Ce);return A.inbox(qe,qe+B,m)},z=P,F=0),h.side==="negative"&&(g=function(Ce){var qe=O(Ce);return A.inbox(qe-B,qe,m)},z=0,F=P)):(g=function(Ce){var qe=O(Ce);return A.inbox(qe-B,qe+B,m)},z=F=P);var L;l?L=function(Ce){return A.inbox(Ce.span[0]-_,Ce.span[1]-_,m)}:L=function(Ce){return A.inbox(Ce.min-_,Ce.max-_,m)},h.orientation==="h"?(_=i,w=n,p=L,u=g,y="y",S=v,b="x",M=f):(_=n,w=i,p=g,u=L,y="x",S=f,b="y",M=v);var N=Math.min(1,P/Math.abs(S.r2c(S.range[1])-S.r2c(S.range[0])));m=a.maxHoverDistance-N,R=a.maxSpikeDistance-N;function U(Ce){return(p(Ce)+u(Ce))/2}var Z=A.getDistanceFunction(s,p,u,U);if(A.getClosest(c,Z,a),a.index===!1)return[];var Q=c[a.index],ue=h.line.color,oe=(h.marker||{}).color;E.opacity(ue)&&h.line.width?a.color=ue:E.opacity(oe)&&h.boxpoints?a.color=oe:a.color=h.fillcolor,a[y+"0"]=S.c2p(Q.pos+T.bPos-F,!0),a[y+"1"]=S.c2p(Q.pos+T.bPos+z,!0),a[y+"LabelVal"]=Q.orig_p!==void 0?Q.orig_p:Q.pos;var le=y+"Spike";a.spikeDistance=U(Q)*R/m,a[le]=S.c2p(Q.pos,!0);var j=h.boxmean||h.sizemode==="sd"||(h.meanline||{}).visible,J=h.boxpoints||h.points,$=J&&j?["max","uf","q3","med","mean","q1","lf","min"]:J&&!j?["max","uf","q3","med","q1","lf","min"]:!J&&j?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],X=M.range[1]0&&(o=!0);for(var s=0;st){var r=t-E[x];return E[x]=t,r}}else return E[x]=t,t;return 0},max:function(x,A,E,e){var t=e[A];if(d(t))if(t=Number(t),d(E[x])){if(E[x]p&&pE){var m=u===x?1:6,R=u===x?"M12":"M1";return function(P,z){var F=T.c2d(P,x,l),B=F.indexOf("-",m);B>0&&(F=F.substr(0,B));var O=T.d2c(F,0,l);if(Or?c>E?c>x*1.1?x:c>A*1.1?A:E:c>e?e:c>t?t:r:Math.pow(10,Math.floor(Math.log(c)/Math.LN10))}function n(c,f,v,h,T,l){if(h&&c>E){var y=s(f,T,l),b=s(v,T,l),S=c===x?0:1;return y[S]!==b[S]}return Math.floor(v/c)-Math.floor(f/c)>.1}function s(c,f,v){var h=f.c2d(c,x,v).split("-");return h[0]===""&&(h.unshift(),h[0]="-"+h[0]),h}}}),_w=He({"src/traces/histogram/calc.js"(Y,G){var d=Hi(),x=Gr(),A=Ei(),E=io(),e=oy(),t=pw(),r=gw(),o=yw(),a=mw();function i(v,h){var T=[],l=[],y=h.orientation==="h",b=E.getFromId(v,y?h.yaxis:h.xaxis),S=y?"y":"x",M={x:"y",y:"x"}[S],_=h[S+"calendar"],w=h.cumulative,p,u=n(v,h,b,S),g=u[0],m=u[1],R=typeof g.size=="string",P=[],z=R?P:g,F=[],B=[],O=[],L=0,N=h.histnorm,U=h.histfunc,Z=N.indexOf("density")!==-1,Q,ue,oe;w.enabled&&Z&&(N=N.replace(/ ?density$/,""),Z=!1);var le=U==="max"||U==="min",j=le?null:0,J=t.count,$=r[N],X=!1,re=function(xe){return b.r2c(xe,0,_)},ee;for(x.isArrayOrTypedArray(h[M])&&U!=="count"&&(ee=h[M],X=U==="avg",J=t[U]),p=re(g.start),ue=re(g.end)+(p-E.tickIncrement(p,g.size,!1,_))/1e6;p=0&&oe=Ke;p--)if(l[p]){Xe=p;break}for(p=Ke;p<=Xe;p++)if(d(T[p])&&d(l[p])){var Me={p:T[p],s:l[p],b:0};w.enabled||(Me.pts=O[p],fe?Me.ph0=Me.ph1=O[p].length?m[O[p][0]]:T[p]:(h._computePh=!0,Me.ph0=qe(P[p]),Me.ph1=qe(P[p+1],!0))),Qe.push(Me)}return Qe.length===1&&(Qe[0].width1=E.tickIncrement(Qe[0].p,g.size,!1,_)-Qe[0].p),e(Qe,h),x.isArrayOrTypedArray(h.selectedpoints)&&x.tagSelected(Qe,h,Fe),Qe}function n(v,h,T,l,y){var b=l+"bins",S=v._fullLayout,M=h["_"+l+"bingroup"],_=S._histogramBinOpts[M],w=S.barmode==="overlay",p,u,g,m,R,P,z,F=function(Ce){return T.r2c(Ce,0,m)},B=function(Ce){return T.c2r(Ce,0,m)},O=T.type==="date"?function(Ce){return Ce||Ce===0?x.cleanDate(Ce,null,m):null}:function(Ce){return d(Ce)?Number(Ce):null};function L(Ce,qe,et){qe[Ce+"Found"]?(qe[Ce]=O(qe[Ce]),qe[Ce]===null&&(qe[Ce]=et[Ce])):(P[Ce]=qe[Ce]=et[Ce],x.nestedProperty(u[0],b+"."+Ce).set(et[Ce]))}if(h["_"+l+"autoBinFinished"])delete h["_"+l+"autoBinFinished"];else{u=_.traces;var N=[],U=!0,Z=!1,Q=!1;for(p=0;p"u"){if(y)return[oe,R,!0];oe=s(v,h,T,l,b)}z=g.cumulative||{},z.enabled&&z.currentbin!=="include"&&(z.direction==="decreasing"?oe.start=B(E.tickIncrement(F(oe.start),oe.size,!0,m)):oe.end=B(E.tickIncrement(F(oe.end),oe.size,!1,m))),_.size=oe.size,_.sizeFound||(P.size=oe.size,x.nestedProperty(u[0],b+".size").set(oe.size)),L("start",_,oe),L("end",_,oe)}R=h["_"+l+"pos0"],delete h["_"+l+"pos0"];var j=h._input[b]||{},J=x.extendFlat({},_),$=_.start,X=T.r2l(j.start),re=X!==void 0;if((_.startFound||re)&&X!==T.r2l($)){var ee=re?X:x.aggNums(Math.min,null,R),q={type:T.type==="category"||T.type==="multicategory"?"linear":T.type,r2l:T.r2l,dtick:_.size,tick0:$,calendar:m,range:[ee,E.tickIncrement(ee,_.size,!1,m)].map(T.l2r)},ae=E.tickFirst(q);ae>T.r2l(ee)&&(ae=E.tickIncrement(ae,_.size,!0,m)),J.start=T.l2r(ae),re||x.nestedProperty(h,b+".start").set(J.start)}var ie=_.end,fe=T.r2l(j.end),we=fe!==void 0;if((_.endFound||we)&&fe!==T.r2l(ie)){var Ae=we?fe:x.aggNums(Math.max,null,R);J.end=T.l2r(Ae),we||x.nestedProperty(h,b+".start").set(J.end)}var Fe="autobin"+l;return h._input[Fe]===!1&&(h._input[b]=x.extendFlat({},h[b]||{}),delete h._input[Fe],delete h[Fe]),[J,R]}function s(v,h,T,l,y){var b=v._fullLayout,S=c(v,h),M=!1,_=1/0,w=[h],p,u,g;for(p=0;p=0;l--)M(l);else if(h==="increasing"){for(l=1;l=0;l--)v[l]+=v[l+1];T==="exclude"&&(v.push(0),v.shift())}}G.exports={calc:i,calcAllAutoBins:n}}}),X5=He({"src/traces/histogram2d/calc.js"(Y,G){var d=Gr(),x=io(),A=pw(),E=gw(),e=yw(),t=mw(),r=_w().calcAllAutoBins;G.exports=function(s,c){var f=x.getFromId(s,c.xaxis),v=x.getFromId(s,c.yaxis),h=c.xcalendar,T=c.ycalendar,l=function(ze){return f.r2c(ze,0,h)},y=function(ze){return v.r2c(ze,0,T)},b=function(ze){return f.c2r(ze,0,h)},S=function(ze){return v.c2r(ze,0,T)},M,_,w,p,u=r(s,c,f,"x"),g=u[0],m=u[1],R=r(s,c,v,"y"),P=R[0],z=R[1],F=c._length;m.length>F&&m.splice(F,m.length-F),z.length>F&&z.splice(F,z.length-F);var B=[],O=[],L=[],N=typeof g.size=="string",U=typeof P.size=="string",Z=[],Q=[],ue=N?Z:g,oe=U?Q:P,le=0,j=[],J=[],$=c.histnorm,X=c.histfunc,re=$.indexOf("density")!==-1,ee=X==="max"||X==="min",q=ee?null:0,ae=A.count,ie=E[$],fe=!1,we=[],Ae=[],Fe="z"in c?c.z:"marker"in c&&Array.isArray(c.marker.color)?c.marker.color:"";Fe&&X!=="count"&&(fe=X==="avg",ae=A[X]);var Ce=g.size,qe=l(g.start),et=l(g.end)+(qe-x.tickIncrement(qe,Ce,!1,h))/1e6;for(M=qe;M=0&&w=0&&p<$e&&(le+=ae(w,M,B[p],Fe,j[p]),J[p][w].push(M),At&&(Rt[w]===void 0?Rt[w]=dr:Rt[w]!==dr&&(At=!1)),St&&(Ut[p]===void 0?Ut[p]=pt:Ut[p]!==pt&&(St=!1)),ir=Math.min(ir,dr-Z[w]),ar=Math.min(ar,Z[w+1]-dr),Mr=Math.min(Mr,pt-Q[p]),fr=Math.min(fr,Q[p+1]-pt))}if(fe)for(p=0;p<$e;p++)le+=e(B[p],j[p]);if(ie)for(p=0;p<$e;p++)ie(B[p],le,we,Ae[p]);return{x:m,xRanges:i(Z,At&&Rt,ir,ar,f,h),x0:Xe,dx:Ke,y:z,yRanges:i(Q,St&&Ut,Mr,fr,v,T),y0:Je,dy:rt,z:B,pts:J}};function o(n,s,c,f){var v=new Array(n),h;if(f)for(h=0;hx;i++)a=e(r,o,E(a));return a>x&&d.log("interp2d didn't converge quickly",a),r};function e(t,r,o){var a=0,i,n,s,c,f,v,h,T,l,y,b,S,M;for(c=0;cS&&(a=Math.max(a,Math.abs(t[n][s]-b)/(M-S))))}return a}}}),D1=He({"src/traces/heatmap/find_empties.js"(Y,G){var d=Gr().maxRowLength;G.exports=function(A){var E=[],e={},t=[],r=A[0],o=[],a=[0,0,0],i=d(A),n,s,c,f,v,h,T,l;for(s=0;s=0;v--)f=t[v],s=f[0],c=f[1],h=((e[[s-1,c]]||a)[2]+(e[[s+1,c]]||a)[2]+(e[[s,c-1]]||a)[2]+(e[[s,c+1]]||a)[2])/20,h&&(T[f]=[s,c,h],t.splice(v,1),l=!0);if(!l)throw"findEmpties iterated with no new neighbors";for(f in T)e[f]=T[f],E.push(T[f])}return E.sort(function(y,b){return b[2]-y[2]})}}}),xw=He({"src/traces/heatmap/make_bound_array.js"(Y,G){var d=Ei(),x=Gr().isArrayOrTypedArray;G.exports=function(E,e,t,r,o,a){var i=[],n=d.traceIs(E,"contour"),s=d.traceIs(E,"histogram"),c,f,v,h=x(e)&&e.length>1;if(h&&!s&&a.type!=="category"){var T=e.length;if(T<=o){if(n)i=Array.from(e).slice(0,o);else if(o===1)a.type==="log"?i=[.5*e[0],2*e[0]]:i=[e[0]-.5,e[0]+.5];else if(a.type==="log"){for(i=[Math.pow(e[0],1.5)/Math.pow(e[1],.5)],v=1;v1){var $=(J[J.length-1]-J[0])/(J.length-1),X=Math.abs($/100);for(F=0;FX)return!1}return!0}T._islinear=!1,l.type==="log"||y.type==="log"?M==="fast"&&L("log axis found"):N(_)?N(g)?T._islinear=!0:M==="fast"&&L("y scale is not linear"):M==="fast"&&L("x scale is not linear");var U=x.maxRowLength(z),Z=T.xtype==="scaled"?"":_,Q=n(T,Z,w,p,U,l),ue=T.ytype==="scaled"?"":g,oe=n(T,ue,m,R,z.length,y);T._extremes[l._id]=A.findExtremes(l,Q),T._extremes[y._id]=A.findExtremes(y,oe);var le={x:Q,y:oe,z,text:T._text||T.text,hovertext:T._hovertext||T.hovertext};if(T.xperiodalignment&&u&&(le.orig_x=u),T.yperiodalignment&&P&&(le.orig_y=P),Z&&Z.length===Q.length-1&&(le.xCenter=Z),ue&&ue.length===oe.length-1&&(le.yCenter=ue),S&&(le.xRanges=B.xRanges,le.yRanges=B.yRanges,le.pts=B.pts),b||t(h,T,{vals:z,cLetter:"z"}),b&&T.contours&&T.contours.coloring==="heatmap"){var j={type:T.type==="contour"?"heatmap":"histogram2d",xcalendar:T.xcalendar,ycalendar:T.ycalendar};le.xfill=n(j,Z,w,p,U,l),le.yfill=n(j,ue,m,R,z.length,y)}return[le]};function c(v){for(var h=[],T=v.length,l=0;l0;)re=g.c2p(N[ie]),ie--;for(re0;)ae=m.c2p(U[ie]),ie--;ae=g._length||re<=0||q>=m._length||ae<=0;if(et){var Qe=P.selectAll("image").data([]);Qe.exit().remove(),y(P);return}var Ke,Xe;Ae==="fast"?(Ke=j,Xe=le):(Ke=Ce,Xe=qe);var Me=document.createElement("canvas");Me.width=Ke,Me.height=Xe;var xe=Me.getContext("2d",{willReadFrequently:!0}),ce=n(F,{noNumericCheck:!0,returnArray:!0}),Re,$e;Ae==="fast"?(Re=J?function(pa){return j-1-pa}:t.identity,$e=$?function(pa){return le-1-pa}:t.identity):(Re=function(pa){return t.constrain(Math.round(g.c2p(N[pa])-X),0,Ce)},$e=function(pa){return t.constrain(Math.round(m.c2p(U[pa])-q),0,qe)});var rt=$e(0),Je=[rt,rt],At=J?0:1,St=$?0:1,Rt=0,Ut=0,ir=0,ar=0,Mr,fr,dr,pt,ze;function Ge(pa,pn){if(pa!==void 0){var Ga=ce(pa);return Ga[0]=Math.round(Ga[0]),Ga[1]=Math.round(Ga[1]),Ga[2]=Math.round(Ga[2]),Rt+=pn,Ut+=Ga[0]*pn,ir+=Ga[1]*pn,ar+=Ga[2]*pn,Ga}return[0,0,0,0]}function Oe(pa,pn,Ga,qn){var Vn=pa[Ga.bin0];if(Vn===void 0)return Ge(void 0,1);var di=pa[Ga.bin1],yi=pn[Ga.bin0],Ci=pn[Ga.bin1],ci=di-Vn||0,ei=yi-Vn||0,mi;return di===void 0?Ci===void 0?mi=0:yi===void 0?mi=2*(Ci-Vn):mi=(2*Ci-yi-Vn)*2/3:Ci===void 0?yi===void 0?mi=0:mi=(2*Vn-di-yi)*2/3:yi===void 0?mi=(2*Ci-di-Vn)*2/3:mi=Ci+Vn-di-yi,Ge(Vn+Ga.frac*ci+qn.frac*(ei+Ga.frac*mi))}if(Ae!=="default"){var ve=0,ge;try{ge=new Uint8Array(Ke*Xe*4)}catch{ge=new Array(Ke*Xe*4)}if(Ae==="smooth"){var be=Z||N,Pe=Q||U,We=new Array(be.length),ct=new Array(Pe.length),_t=new Array(Ce),Mt=Z?S:b,Nt=Q?S:b,Bt,qt,Zt;for(ie=0;ieAa||Aa>m._length))for(fe=Br;fesa||sa>g._length)){var Oa=o({x:Pa,y:ga},F,_._fullLayout);Oa.x=Pa,Oa.y=ga;var dt=z.z[ie][fe];dt===void 0?(Oa.z="",Oa.zLabel=""):(Oa.z=dt,Oa.zLabel=e.tickText(Vt,dt,"hover").text);var vt=z.text&&z.text[ie]&&z.text[ie][fe];(vt===void 0||vt===!1)&&(vt=""),Oa.text=vt;var Lr=t.texttemplateString(La,Oa,_._fullLayout._d3locale,Oa,F._meta||{});if(Lr){var Er=Lr.split("
"),_r=Er.length,yr=0;for(we=0;we<_r;we++)yr=Math.max(yr,Er[we].length);Ur.push({l:_r,c:yr,t:Lr,x:sa,y:Aa,z:dt})}}}}var kr=F.textfont,zr=kr.size,Pr=_._fullLayout.font.size;if(!zr||zr==="auto"){var Hr=1/0,Zr=1/0,Jr=0,wt=0;for(we=0;we=y[0].length||R<0||R>y.length)return}else{if(d.inbox(o-T[0],o-T[T.length-1],0)>0||d.inbox(a-l[0],a-l[l.length-1],0)>0)return;if(s){var P;for(w=[2*T[0]-T[1]],P=1;P=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),fy=He({"src/traces/contour/attributes.js"(Y,G){var d=Y0(),x=Zu(),A=Gu(),E=A.axisHoverFormat,e=A.descriptionOnlyNumbers,t=kl(),r=Nf().dash,o=Yl(),a=ho().extendFlat,i=q1(),n=i.COMPARISON_OPS2,s=i.INTERVAL_OPS,c=x.line;G.exports=a({z:d.z,x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:x.xperiod0,yperiod0:x.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,text:d.text,hovertext:d.hovertext,transpose:d.transpose,xtype:d.xtype,ytype:d.ytype,xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:d.hovertemplate,texttemplate:a({},d.texttemplate,{}),textfont:a({},d.textfont,{}),hoverongaps:d.hoverongaps,connectgaps:a({},d.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:o({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:e("contour label")},operation:{valType:"enumerated",values:[].concat(n).concat(s),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:a({},c.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:r,smoothing:a({},c.smoothing,{}),editType:"plot"},zorder:x.zorder},t("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),Sw=He({"src/traces/histogram2dcontour/attributes.js"(Y,G){var d=V1(),x=fy(),A=kl(),E=Gu().axisHoverFormat,e=ho().extendFlat;G.exports=e({x:d.x,y:d.y,z:d.z,marker:d.marker,histnorm:d.histnorm,histfunc:d.histfunc,nbinsx:d.nbinsx,xbins:d.xbins,nbinsy:d.nbinsy,ybins:d.ybins,autobinx:d.autobinx,autobiny:d.autobiny,bingroup:d.bingroup,xbingroup:d.xbingroup,ybingroup:d.ybingroup,autocontour:x.autocontour,ncontours:x.ncontours,contours:x.contours,line:{color:x.line.color,width:e({},x.line.width,{dflt:.5}),dash:x.line.dash,smoothing:x.line.smoothing,editType:"plot"},xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z",1),hovertemplate:d.hovertemplate,texttemplate:x.texttemplate,textfont:x.textfont},A("",{cLetter:"z",editTypeOverride:"calc"}))}}),H1=He({"src/traces/contour/contours_defaults.js"(Y,G){G.exports=function(x,A,E,e){var t=e("contours.start"),r=e("contours.end"),o=t===!1||r===!1,a=E("contours.size"),i;o?i=A.autocontour=!0:i=E("autocontour",!1),(i||!a)&&E("ncontours")}}}),Mw=He({"src/traces/contour/label_defaults.js"(Y,G){var d=Gr();G.exports=function(A,E,e,t){t||(t={});var r=A("contours.showlabels");if(r){var o=E.font;d.coerceFont(A,"contours.labelfont",o,{overrideDflt:{color:e}}),A("contours.labelformat")}t.hasHover!==!1&&A("zhoverformat")}}}),G1=He({"src/traces/contour/style_defaults.js"(Y,G){var d=pf(),x=Mw();G.exports=function(E,e,t,r,o){var a=t("contours.coloring"),i,n="";a==="fill"&&(i=t("contours.showlines")),i!==!1&&(a!=="lines"&&(n=t("line.color","#000")),t("line.width",.5),t("line.dash")),a!=="none"&&(E.showlegend!==!0&&(e.showlegend=!1),e._dfltShowLegend=!1,d(E,e,r,t,{prefix:"",cLetter:"z"})),t("line.smoothing"),x(t,r,n,o)}}}),oE=He({"src/traces/histogram2dcontour/defaults.js"(Y,G){var d=Gr(),x=Aw(),A=H1(),E=G1(),e=cy(),t=Sw();G.exports=function(o,a,i,n){function s(f,v){return d.coerce(o,a,t,f,v)}function c(f){return d.coerce2(o,a,t,f)}x(o,a,s,n),a.visible!==!1&&(A(o,a,s,c),E(o,a,s,n),s("xhoverformat"),s("yhoverformat"),s("hovertemplate"),a.contours&&a.contours.coloring==="heatmap"&&e(s,n))}}}),Ew=He({"src/traces/contour/set_contours.js"(Y,G){var d=io(),x=Gr();G.exports=function(e,t){var r=e.contours;if(e.autocontour){var o=e.zmin,a=e.zmax;(e.zauto||o===void 0)&&(o=x.aggNums(Math.min,null,t)),(e.zauto||a===void 0)&&(a=x.aggNums(Math.max,null,t));var i=A(o,a,e.ncontours);r.size=i.dtick,r.start=d.tickFirst(i),i.range.reverse(),r.end=d.tickFirst(i),r.start===o&&(r.start+=r.size),r.end===a&&(r.end-=r.size),r.start>r.end&&(r.start=r.end=(r.start+r.end)/2),e._input.contours||(e._input.contours={}),x.extendFlat(e._input.contours,{start:r.start,end:r.end,size:r.size}),e._input.autocontour=!0}else if(r.type!=="constraint"){var n=r.start,s=r.end,c=e._input.contours;if(n>s&&(r.start=c.start=s,s=r.end=c.end=n,n=r.start),!(r.size>0)){var f;n===s?f=1:f=A(n,s,e.ncontours).dtick,c.size=r.size=f}}};function A(E,e,t){var r={type:"linear",range:[E,e]};return d.autoTicks(r,(e-E)/(t||15)),r}}}),hy=He({"src/traces/contour/end_plus.js"(Y,G){G.exports=function(x){return x.end+x.size/1e6}}}),kw=He({"src/traces/contour/calc.js"(Y,G){var d=Kl(),x=z1(),A=Ew(),E=hy();G.exports=function(t,r){var o=x(t,r),a=o[0].z;A(r,a);var i=r.contours,n=d.extractOpts(r),s;if(i.coloring==="heatmap"&&n.auto&&r.autocontour===!1){var c=i.start,f=E(i),v=i.size||1,h=Math.floor((f-c)/v)+1;isFinite(v)||(v=1,h=1);var T=c-v/2,l=T+h*v;s=[T,l]}else s=a;return d.calc(t,r,{vals:s,cLetter:"z"}),o}}}),vy=He({"src/traces/contour/constants.js"(Y,G){G.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}}}}),Cw=He({"src/traces/contour/make_crossings.js"(Y,G){var d=vy();G.exports=function(E){var e=E[0].z,t=e.length,r=e[0].length,o=t===2||r===2,a,i,n,s,c,f,v,h,T;for(i=0;iA?0:1)+(E[0][1]>A?0:2)+(E[1][1]>A?0:4)+(E[1][0]>A?0:8);if(e===5||e===10){var t=(E[0][0]+E[0][1]+E[1][0]+E[1][1])/4;return A>t?e===5?713:1114:e===5?104:208}return e===15?0:e}}}),Lw=He({"src/traces/contour/find_all_paths.js"(Y,G){var d=Gr(),x=vy();G.exports=function(a,i,n){var s,c,f,v,h;for(i=i||.01,n=n||.01,f=0;f20?(f=x.CHOOSESADDLE[f][(v[0]||v[1])<0?0:1],o.crossings[c]=x.SADDLEREMAINDER[f]):delete o.crossings[c],v=x.NEWDELTA[f],!v){d.log("Found bad marching index:",f,a,o.level);break}h.push(r(o,a,v)),a[0]+=v[0],a[1]+=v[1],c=a.join(","),A(h[h.length-1],h[h.length-2],n,s)&&h.pop();var M=v[0]&&(a[0]<0||a[0]>l-2)||v[1]&&(a[1]<0||a[1]>T-2),_=a[0]===y[0]&&a[1]===y[1]&&v[0]===b[0]&&v[1]===b[1];if(_||i&&M)break;f=o.crossings[c]}S===1e4&&d.log("Infinite loop in contour?");var w=A(h[0],h[h.length-1],n,s),p=0,u=.2*o.smoothing,g=[],m=0,R,P,z,F,B,O,L,N,U,Z,Q;for(S=1;S=m;S--)if(R=g[S],R=m&&R+g[P]N&&U--,o.edgepaths[U]=Q.concat(h,Z));break}j||(o.edgepaths[N]=h.concat(Z))}for(N=0;N20&&a?o===208||o===1114?n=i[0]===0?1:-1:s=i[1]===0?1:-1:x.BOTTOMSTART.indexOf(o)!==-1?s=1:x.LEFTSTART.indexOf(o)!==-1?n=1:x.TOPSTART.indexOf(o)!==-1?s=-1:n=-1,[n,s]}function r(o,a,i){var n=a[0]+Math.max(i[0],0),s=a[1]+Math.max(i[1],0),c=o.z[s][n],f=o.xaxis,v=o.yaxis;if(i[1]){var h=(o.level-c)/(o.z[s][n+1]-c),T=(h!==1?(1-h)*f.c2l(o.x[n]):0)+(h!==0?h*f.c2l(o.x[n+1]):0);return[f.c2p(f.l2c(T),!0),v.c2p(o.y[s],!0),n+h,s]}else{var l=(o.level-c)/(o.z[s+1][n]-c),y=(l!==1?(1-l)*v.c2l(o.y[s]):0)+(l!==0?l*v.c2l(o.y[s+1]):0);return[f.c2p(o.x[n],!0),v.c2p(v.l2c(y),!0),n,s+l]}}}}),sE=He({"src/traces/contour/constraint_mapping.js"(Y,G){var d=q1(),x=Hi();G.exports={"[]":E("[]"),"][":E("]["),">":e(">"),"<":e("<"),"=":e("=")};function A(t,r){var o=Array.isArray(r),a;function i(n){return x(n)?+n:null}return d.COMPARISON_OPS2.indexOf(t)!==-1?a=i(o?r[0]:r):d.INTERVAL_OPS.indexOf(t)!==-1?a=o?[i(r[0]),i(r[1])]:[i(r),i(r)]:d.SET_OPS.indexOf(t)!==-1&&(a=o?r.map(i):[i(r)]),a}function E(t){return function(r){r=A(t,r);var o=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return{start:o,end:a,size:a-o}}}function e(t){return function(r){return r=A(t,r),{start:r,end:1/0,size:1/0}}}}}),Pw=He({"src/traces/contour/empty_pathinfo.js"(Y,G){var d=Gr(),x=sE(),A=hy();G.exports=function(e,t,r){for(var o=e.type==="constraint"?x[e._operation](e.value):e,a=o.size,i=[],n=A(o),s=r.trace._carpetTrace,c=s?{xaxis:s.aaxis,yaxis:s.baxis,x:r.a,y:r.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:r.x,y:r.y},f=o.start;f1e3){d.warn("Too many contours, clipping at 1000",e);break}return i}}}),Iw=He({"src/traces/contour/convert_to_constraints.js"(Y,G){var d=Gr();G.exports=function(A,E){var e,t,r,o=function(n){return n.reverse()},a=function(n){return n};switch(E){case"=":case"<":return A;case">":for(A.length!==1&&d.warn("Contour data invalid for the specified inequality operation."),t=A[0],e=0;er.level||r.starts.length&&t===r.level)}break;case"constraint":if(A.prefixBoundary=!1,A.edgepaths.length)return;var o=A.x.length,a=A.y.length,i=-1/0,n=1/0;for(e=0;e":s>i&&(A.prefixBoundary=!0);break;case"<":(si||A.starts.length&&f===n)&&(A.prefixBoundary=!0);break;case"][":c=Math.min(s[0],s[1]),f=Math.max(s[0],s[1]),ci&&(A.prefixBoundary=!0);break}break}}}}),W1=He({"src/traces/contour/plot.js"(Y){var G=Qn(),d=Gr(),x=vo(),A=Kl(),E=yl(),e=io(),t=Uv(),r=O1(),o=Cw(),a=Lw(),i=Pw(),n=Iw(),s=Rw(),c=vy(),f=c.LABELOPTIMIZER;Y.plot=function(_,w,p,u){var g=w.xaxis,m=w.yaxis;d.makeTraceGroups(u,p,"contour").each(function(R){var P=G.select(this),z=R[0],F=z.trace,B=z.x,O=z.y,L=F.contours,N=i(L,w,z),U=d.ensureSingle(P,"g","heatmapcoloring"),Z=[];L.coloring==="heatmap"&&(Z=[R]),r(_,w,Z,U),o(N),a(N);var Q=g.c2p(B[0],!0),ue=g.c2p(B[B.length-1],!0),oe=m.c2p(O[0],!0),le=m.c2p(O[O.length-1],!0),j=[[Q,le],[ue,le],[ue,oe],[Q,oe]],J=N;L.type==="constraint"&&(J=n(N,L._operation)),v(P,j,L),h(P,J,j,L),l(P,N,_,z,L),b(P,w,_,z,j)})};function v(M,_,w){var p=d.ensureSingle(M,"g","contourbg"),u=p.selectAll("path").data(w.coloring==="fill"?[0]:[]);u.enter().append("path"),u.exit().remove(),u.attr("d","M"+_.join("L")+"Z").style("stroke","none")}function h(M,_,w,p){var u=p.coloring==="fill"||p.type==="constraint"&&p._operation!=="=",g="M"+w.join("L")+"Z";u&&s(_,p);var m=d.ensureSingle(M,"g","contourfill"),R=m.selectAll("path").data(u?_:[]);R.enter().append("path"),R.exit().remove(),R.each(function(P){var z=(P.prefixBoundary?g:"")+T(P,w);z?G.select(this).attr("d",z).style("stroke","none"):G.select(this).remove()})}function T(M,_){var w="",p=0,u=M.edgepaths.map(function(Q,ue){return ue}),g=!0,m,R,P,z,F,B;function O(Q){return Math.abs(Q[1]-_[0][1])<.01}function L(Q){return Math.abs(Q[1]-_[2][1])<.01}function N(Q){return Math.abs(Q[0]-_[0][0])<.01}function U(Q){return Math.abs(Q[0]-_[2][0])<.01}for(;u.length;){for(B=x.smoothopen(M.edgepaths[p],M.smoothing),w+=g?B:B.replace(/^M/,"L"),u.splice(u.indexOf(p),1),m=M.edgepaths[p][M.edgepaths[p].length-1],z=-1,P=0;P<4;P++){if(!m){d.log("Missing end?",p,M);break}for(O(m)&&!U(m)?R=_[1]:N(m)?R=_[0]:L(m)?R=_[3]:U(m)&&(R=_[2]),F=0;F=0&&(R=Z,z=F):Math.abs(m[1]-R[1])<.01?Math.abs(m[1]-Z[1])<.01&&(Z[0]-m[0])*(R[0]-Z[0])>=0&&(R=Z,z=F):d.log("endpt to newendpt is not vert. or horz.",m,R,Z)}if(m=R,z>=0)break;w+="L"+R}if(z===M.edgepaths.length){d.log("unclosed perimeter path");break}p=z,g=u.indexOf(p)===-1,g&&(p=u[0],w+="Z")}for(p=0;pf.MAXCOST*2)break;O&&(R/=2),m=z-R/2,P=m+R*1.5}if(B<=f.MAXCOST)return F};function y(M,_,w,p){var u=_.width/2,g=_.height/2,m=M.x,R=M.y,P=M.theta,z=Math.cos(P)*u,F=Math.sin(P)*u,B=(m>p.center?p.right-m:m-p.left)/(z+Math.abs(Math.sin(P)*g)),O=(R>p.middle?p.bottom-R:R-p.top)/(Math.abs(F)+Math.cos(P)*g);if(B<1||O<1)return 1/0;var L=f.EDGECOST*(1/(B-1)+1/(O-1));L+=f.ANGLECOST*P*P;for(var N=m-z,U=R-F,Z=m+z,Q=R+F,ue=0;ue=b)&&(r<=y&&(r=y),o>=b&&(o=b),i=Math.floor((o-r)/a)+1,n=0),l=0;ly&&(v.unshift(y),h.unshift(h[0])),v[v.length-1]2?s.value=s.value.slice(2):s.length===0?s.value=[0,1]:s.length<2?(c=parseFloat(s.value[0]),s.value=[c,c+1]):s.value=[parseFloat(s.value[0]),parseFloat(s.value[1])]:d(s.value)&&(c=parseFloat(s.value),s.value=[c,c+1])):(n("contours.value",0),d(s.value)||(r(s.value)?s.value=parseFloat(s.value[0]):s.value=0))}}}),cE=He({"src/traces/contour/defaults.js"(Y,G){var d=Gr(),x=L1(),A=Tv(),E=Fw(),e=H1(),t=G1(),r=cy(),o=fy();G.exports=function(i,n,s,c){function f(l,y){return d.coerce(i,n,o,l,y)}function v(l){return d.coerce2(i,n,o,l)}var h=x(i,n,f,c);if(!h){n.visible=!1;return}A(i,n,c,f),f("xhoverformat"),f("yhoverformat"),f("text"),f("hovertext"),f("hoverongaps"),f("hovertemplate");var T=f("contours.type")==="constraint";f("connectgaps",d.isArray1D(n.z)),T?E(i,n,f,c,s):(e(i,n,f,v),t(i,n,f,c)),n.contours&&n.contours.coloring==="heatmap"&&r(f,c),f("zorder")}}}),fE=He({"src/traces/contour/index.js"(Y,G){G.exports={attributes:fy(),supplyDefaults:cE(),calc:kw(),plot:W1().plot,style:Z1(),colorbar:X1(),hoverPoints:zw(),moduleType:"trace",name:"contour",basePlotModule:Bc(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),hE=He({"lib/contour.js"(Y,G){G.exports=fE()}}),Ow=He({"src/traces/scatterternary/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=Yo().texttemplateAttrs,A=wv(),E=Zu(),e=cl(),t=kl(),r=Nf().dash,o=ho().extendFlat,a=E.marker,i=E.line,n=a.line;G.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:o({},E.mode,{dflt:"markers"}),text:o({},E.text,{}),texttemplate:x({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:o({},E.hovertext,{}),line:{color:i.color,width:i.width,dash:r,backoff:i.backoff,shape:o({},i.shape,{values:["linear","spline"]}),smoothing:i.smoothing,editType:"calc"},connectgaps:E.connectgaps,cliponaxis:E.cliponaxis,fill:o({},E.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:A(),marker:o({symbol:a.symbol,opacity:a.opacity,angle:a.angle,angleref:a.angleref,standoff:a.standoff,maxdisplayed:a.maxdisplayed,size:a.size,sizeref:a.sizeref,sizemin:a.sizemin,sizemode:a.sizemode,line:o({width:n.width,editType:"calc"},t("marker.line")),gradient:a.gradient,editType:"calc"},t("marker")),textfont:E.textfont,textposition:E.textposition,selected:E.selected,unselected:E.unselected,hoverinfo:o({},e.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:E.hoveron,hovertemplate:d()}}}),vE=He({"src/traces/scatterternary/defaults.js"(Y,G){var d=Gr(),x=jv(),A=Rl(),E=Kh(),e=nv(),t=V0(),r=iv(),o=Av(),a=Ow();G.exports=function(n,s,c,f){function v(M,_){return d.coerce(n,s,a,M,_)}var h=v("a"),T=v("b"),l=v("c"),y;if(h?(y=h.length,T?(y=Math.min(y,T.length),l&&(y=Math.min(y,l.length))):l?y=Math.min(y,l.length):y=0):T&&l&&(y=Math.min(T.length,l.length)),!y){s.visible=!1;return}s._length=y,v("sum"),v("text"),v("hovertext"),s.hoveron!=="fills"&&v("hovertemplate");var b=y"),o.hovertemplate=f.hovertemplate,r}}}),mE=He({"src/traces/scatterternary/event_data.js"(Y,G){G.exports=function(x,A,E,e,t){if(A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),e[t]){var r=e[t];x.a=r.a,x.b=r.b,x.c=r.c}else x.a=A.a,x.b=A.b,x.c=A.c;return x}}}),_E=He({"src/plots/ternary/ternary.js"(Y,G){var d=Qn(),x=Mf(),A=Ei(),E=Gr(),e=E.strTranslate,t=E._,r=Ai(),o=vo(),a=Uv(),i=ho().extendFlat,n=yu(),s=io(),c=fh(),f=Wu(),v=bv(),h=v.freeMode,T=v.rectMode,l=kp(),y=dc().prepSelect,b=dc().selectOnClick,S=dc().clearOutline,M=dc().clearSelectionsCache,_=Ef();function w(L,N){this.id=L.id,this.graphDiv=L.graphDiv,this.init(N),this.makeFramework(N),this.updateFx(N),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}G.exports=w;var p=w.prototype;p.init=function(L){this.container=L._ternarylayer,this.defs=L._defs,this.layoutId=L._uid,this.traceHash={},this.layers={}},p.plot=function(L,N){var U=this,Z=N[U.id],Q=N._size;U._hasClipOnAxisFalse=!1;for(var ue=0;ueu*J?(fe=J,ie=fe*u):(ie=j,fe=ie/u),we=oe*ie/j,Ae=le*fe/J,q=N.l+N.w*Q-ie/2,ae=N.t+N.h*(1-ue)-fe/2,U.x0=q,U.y0=ae,U.w=ie,U.h=fe,U.sum=$,U.xaxis={type:"linear",range:[X+2*ee-$,$-X-2*re],domain:[Q-we/2,Q+we/2],_id:"x"},a(U.xaxis,U.graphDiv._fullLayout),U.xaxis.setScale(),U.xaxis.isPtWithinRange=function(Re){return Re.a>=U.aaxis.range[0]&&Re.a<=U.aaxis.range[1]&&Re.b>=U.baxis.range[1]&&Re.b<=U.baxis.range[0]&&Re.c>=U.caxis.range[1]&&Re.c<=U.caxis.range[0]},U.yaxis={type:"linear",range:[X,$-re-ee],domain:[ue-Ae/2,ue+Ae/2],_id:"y"},a(U.yaxis,U.graphDiv._fullLayout),U.yaxis.setScale(),U.yaxis.isPtWithinRange=function(){return!0};var Fe=U.yaxis.domain[0],Ce=U.aaxis=i({},L.aaxis,{range:[X,$-re-ee],side:"left",tickangle:(+L.aaxis.tickangle||0)-30,domain:[Fe,Fe+Ae*u],anchor:"free",position:0,_id:"y",_length:ie});a(Ce,U.graphDiv._fullLayout),Ce.setScale();var qe=U.baxis=i({},L.baxis,{range:[$-X-ee,re],side:"bottom",domain:U.xaxis.domain,anchor:"free",position:0,_id:"x",_length:ie});a(qe,U.graphDiv._fullLayout),qe.setScale();var et=U.caxis=i({},L.caxis,{range:[$-X-re,ee],side:"right",tickangle:(+L.caxis.tickangle||0)+30,domain:[Fe,Fe+Ae*u],anchor:"free",position:0,_id:"y",_length:ie});a(et,U.graphDiv._fullLayout),et.setScale();var Qe="M"+q+","+(ae+fe)+"h"+ie+"l-"+ie/2+",-"+fe+"Z";U.clipDef.select("path").attr("d",Qe),U.layers.plotbg.select("path").attr("d",Qe);var Ke="M0,"+fe+"h"+ie+"l-"+ie/2+",-"+fe+"Z";U.clipDefRelative.select("path").attr("d",Ke);var Xe=e(q,ae);U.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Xe),U.clipDefRelative.select("path").attr("transform",null);var Me=e(q-qe._offset,ae+fe);U.layers.baxis.attr("transform",Me),U.layers.bgrid.attr("transform",Me);var xe=e(q+ie/2,ae)+"rotate(30)"+e(0,-Ce._offset);U.layers.aaxis.attr("transform",xe),U.layers.agrid.attr("transform",xe);var ce=e(q+ie/2,ae)+"rotate(-30)"+e(0,-et._offset);U.layers.caxis.attr("transform",ce),U.layers.cgrid.attr("transform",ce),U.drawAxes(!0),U.layers.aline.select("path").attr("d",Ce.showline?"M"+q+","+(ae+fe)+"l"+ie/2+",-"+fe:"M0,0").call(r.stroke,Ce.linecolor||"#000").style("stroke-width",(Ce.linewidth||0)+"px"),U.layers.bline.select("path").attr("d",qe.showline?"M"+q+","+(ae+fe)+"h"+ie:"M0,0").call(r.stroke,qe.linecolor||"#000").style("stroke-width",(qe.linewidth||0)+"px"),U.layers.cline.select("path").attr("d",et.showline?"M"+(q+ie/2)+","+ae+"l"+ie/2+","+fe:"M0,0").call(r.stroke,et.linecolor||"#000").style("stroke-width",(et.linewidth||0)+"px"),U.graphDiv._context.staticPlot||U.initInteractions(),o.setClipUrl(U.layers.frontplot,U._hasClipOnAxisFalse?null:U.clipId,U.graphDiv)},p.drawAxes=function(L){var N=this,U=N.graphDiv,Z=N.id.substr(7)+"title",Q=N.layers,ue=N.aaxis,oe=N.baxis,le=N.caxis;if(N.drawAx(ue),N.drawAx(oe),N.drawAx(le),L){var j=Math.max(ue.showticklabels?ue.tickfont.size/2:0,(le.showticklabels?le.tickfont.size*.75:0)+(le.ticks==="outside"?le.ticklen*.87:0)),J=(oe.showticklabels?oe.tickfont.size:0)+(oe.ticks==="outside"?oe.ticklen:0)+3;Q["a-title"]=l.draw(U,"a"+Z,{propContainer:ue,propName:N.id+".aaxis.title",placeholder:t(U,"Click to enter Component A title"),attributes:{x:N.x0+N.w/2,y:N.y0-ue.title.font.size/3-j,"text-anchor":"middle"}}),Q["b-title"]=l.draw(U,"b"+Z,{propContainer:oe,propName:N.id+".baxis.title",placeholder:t(U,"Click to enter Component B title"),attributes:{x:N.x0-J,y:N.y0+N.h+oe.title.font.size*.83+J,"text-anchor":"middle"}}),Q["c-title"]=l.draw(U,"c"+Z,{propContainer:le,propName:N.id+".caxis.title",placeholder:t(U,"Click to enter Component C title"),attributes:{x:N.x0+N.w+J,y:N.y0+N.h+le.title.font.size*.83+J,"text-anchor":"middle"}})}},p.drawAx=function(L){var N=this,U=N.graphDiv,Z=L._name,Q=Z.charAt(0),ue=L._id,oe=N.layers[Z],le=30,j=Q+"tickLayout",J=g(L);N[j]!==J&&(oe.selectAll("."+ue+"tick").remove(),N[j]=J),L.setScale();var $=s.calcTicks(L),X=s.clipEnds(L,$),re=s.makeTransTickFn(L),ee=s.getTickSigns(L)[2],q=E.deg2rad(le),ae=ee*(L.linewidth||1)/2,ie=ee*L.ticklen,fe=N.w,we=N.h,Ae=Q==="b"?"M0,"+ae+"l"+Math.sin(q)*ie+","+Math.cos(q)*ie:"M"+ae+",0l"+Math.cos(q)*ie+","+-Math.sin(q)*ie,Fe={a:"M0,0l"+we+",-"+fe/2,b:"M0,0l-"+fe/2+",-"+we,c:"M0,0l-"+we+","+fe/2}[Q];s.drawTicks(U,L,{vals:L.ticks==="inside"?X:$,layer:oe,path:Ae,transFn:re,crisp:!1}),s.drawGrid(U,L,{vals:X,layer:N.layers[Q+"grid"],path:Fe,transFn:re,crisp:!1}),s.drawLabels(U,L,{vals:$,layer:oe,transFn:re,labelFns:s.makeLabelFns(L,0,le)})};function g(L){return L.ticks+String(L.ticklen)+String(L.showticklabels)}var m=_.MINZOOM/2+.87,R="m-0.87,.5h"+m+"v3h-"+(m+5.2)+"l"+(m/2+2.6)+",-"+(m*.87+4.5)+"l2.6,1.5l-"+m/2+","+m*.87+"Z",P="m0.87,.5h-"+m+"v3h"+(m+5.2)+"l-"+(m/2+2.6)+",-"+(m*.87+4.5)+"l-2.6,1.5l"+m/2+","+m*.87+"Z",z="m0,1l"+m/2+","+m*.87+"l2.6,-1.5l-"+(m/2+2.6)+",-"+(m*.87+4.5)+"l-"+(m/2+2.6)+","+(m*.87+4.5)+"l2.6,1.5l"+m/2+",-"+m*.87+"Z",F="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",B=!0;p.clearOutline=function(){M(this.dragOptions),S(this.dragOptions.gd)},p.initInteractions=function(){var L=this,N=L.layers.plotbg.select("path").node(),U=L.graphDiv,Z=U._fullLayout._zoomlayer,Q,ue;this.dragOptions={element:N,gd:U,plotinfo:{id:L.id,domain:U._fullLayout[L.id].domain,xaxis:L.xaxis,yaxis:L.yaxis},subplot:L.id,prepFn:function(Me,xe,ce){L.dragOptions.xaxes=[L.xaxis],L.dragOptions.yaxes=[L.yaxis],Q=U._fullLayout._invScaleX,ue=U._fullLayout._invScaleY;var Re=L.dragOptions.dragmode=U._fullLayout.dragmode;h(Re)?L.dragOptions.minDrag=1:L.dragOptions.minDrag=void 0,Re==="zoom"?(L.dragOptions.moveFn=qe,L.dragOptions.clickFn=fe,L.dragOptions.doneFn=et,we(Me,xe,ce)):Re==="pan"?(L.dragOptions.moveFn=Ke,L.dragOptions.clickFn=fe,L.dragOptions.doneFn=Xe,Qe(),L.clearOutline(U)):(T(Re)||h(Re))&&y(Me,xe,ce,L.dragOptions,Re)}};var oe,le,j,J,$,X,re,ee,q,ae;function ie(Me){var xe={};return xe[L.id+".aaxis.min"]=Me.a,xe[L.id+".baxis.min"]=Me.b,xe[L.id+".caxis.min"]=Me.c,xe}function fe(Me,xe){var ce=U._fullLayout.clickmode;O(U),Me===2&&(U.emit("plotly_doubleclick",null),A.call("_guiRelayout",U,ie({a:0,b:0,c:0}))),ce.indexOf("select")>-1&&Me===1&&b(xe,U,[L.xaxis],[L.yaxis],L.id,L.dragOptions),ce.indexOf("event")>-1&&f.click(U,xe,L.id)}function we(Me,xe,ce){var Re=N.getBoundingClientRect();oe=xe-Re.left,le=ce-Re.top,U._fullLayout._calcInverseTransform(U);var $e=U._fullLayout._invTransform,rt=E.apply3DTransform($e)(oe,le);oe=rt[0],le=rt[1],j={a:L.aaxis.range[0],b:L.baxis.range[1],c:L.caxis.range[1]},$=j,J=L.aaxis.range[1]-j.a,X=x(L.graphDiv._fullLayout[L.id].bgcolor).getLuminance(),re="M0,"+L.h+"L"+L.w/2+", 0L"+L.w+","+L.h+"Z",ee=!1,q=Z.append("path").attr("class","zoombox").attr("transform",e(L.x0,L.y0)).style({fill:X>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",re),ae=Z.append("path").attr("class","zoombox-corners").attr("transform",e(L.x0,L.y0)).style({fill:r.background,stroke:r.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),L.clearOutline(U)}function Ae(Me,xe){return 1-xe/L.h}function Fe(Me,xe){return 1-(Me+(L.h-xe)/Math.sqrt(3))/L.w}function Ce(Me,xe){return(Me-(L.h-xe)/Math.sqrt(3))/L.w}function qe(Me,xe){var ce=oe+Me*Q,Re=le+xe*ue,$e=Math.max(0,Math.min(1,Ae(oe,le),Ae(ce,Re))),rt=Math.max(0,Math.min(1,Fe(oe,le),Fe(ce,Re))),Je=Math.max(0,Math.min(1,Ce(oe,le),Ce(ce,Re))),At=($e/2+Je)*L.w,St=(1-$e/2-rt)*L.w,Rt=(At+St)/2,Ut=St-At,ir=(1-$e)*L.h,ar=ir-Ut/u;Ut<_.MINZOOM?($=j,q.attr("d",re),ae.attr("d","M0,0Z")):($={a:j.a+$e*J,b:j.b+rt*J,c:j.c+Je*J},q.attr("d",re+"M"+At+","+ir+"H"+St+"L"+Rt+","+ar+"L"+At+","+ir+"Z"),ae.attr("d","M"+oe+","+le+F+"M"+At+","+ir+R+"M"+St+","+ir+P+"M"+Rt+","+ar+z)),ee||(q.transition().style("fill",X>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),ae.transition().style("opacity",1).duration(200),ee=!0),U.emit("plotly_relayouting",ie($))}function et(){O(U),$!==j&&(A.call("_guiRelayout",U,ie($)),B&&U.data&&U._context.showTips&&(E.notifier(t(U,"Double-click to zoom back out"),"long"),B=!1))}function Qe(){j={a:L.aaxis.range[0],b:L.baxis.range[1],c:L.caxis.range[1]},$=j}function Ke(Me,xe){var ce=Me/L.xaxis._m,Re=xe/L.yaxis._m;$={a:j.a-Re,b:j.b+(ce+Re)/2,c:j.c-(ce-Re)/2};var $e=[$.a,$.b,$.c].sort(E.sorterAsc),rt={a:$e.indexOf($.a),b:$e.indexOf($.b),c:$e.indexOf($.c)};$e[0]<0&&($e[1]+$e[0]/2<0?($e[2]+=$e[0]+$e[1],$e[0]=$e[1]=0):($e[2]+=$e[0]/2,$e[1]+=$e[0]/2,$e[0]=0),$={a:$e[rt.a],b:$e[rt.b],c:$e[rt.c]},xe=(j.a-$.a)*L.yaxis._m,Me=(j.c-$.c-j.b+$.b)*L.xaxis._m);var Je=e(L.x0+Me,L.y0+xe);L.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",Je);var At=e(-Me,-xe);L.clipDefRelative.select("path").attr("transform",At),L.aaxis.range=[$.a,L.sum-$.b-$.c],L.baxis.range=[L.sum-$.a-$.c,$.b],L.caxis.range=[L.sum-$.a-$.b,$.c],L.drawAxes(!1),L._hasClipOnAxisFalse&&L.plotContainer.select(".scatterlayer").selectAll(".trace").call(o.hideOutsideRangePoints,L),U.emit("plotly_relayouting",ie($))}function Xe(){A.call("_guiRelayout",U,ie($))}N.onmousemove=function(Me){f.hover(U,Me,L.id),U._fullLayout._lasthover=N,U._fullLayout._hoversubplot=L.id},N.onmouseout=function(Me){U._dragging||c.unhover(U,Me)},c.init(this.dragOptions)};function O(L){d.select(L).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}}}),Bw=He({"src/plots/ternary/layout_attributes.js"(Y,G){var d=Xc(),x=mu().attributes,A=jf(),E=hu().overrideAll,e=ho().extendFlat,t={title:{text:A.title.text,font:A.title.font},color:A.color,tickmode:A.minor.tickmode,nticks:e({},A.nticks,{dflt:6,min:1}),tick0:A.tick0,dtick:A.dtick,tickvals:A.tickvals,ticktext:A.ticktext,ticks:A.ticks,ticklen:A.ticklen,tickwidth:A.tickwidth,tickcolor:A.tickcolor,ticklabelstep:A.ticklabelstep,showticklabels:A.showticklabels,labelalias:A.labelalias,showtickprefix:A.showtickprefix,tickprefix:A.tickprefix,showticksuffix:A.showticksuffix,ticksuffix:A.ticksuffix,showexponent:A.showexponent,exponentformat:A.exponentformat,minexponent:A.minexponent,separatethousands:A.separatethousands,tickfont:A.tickfont,tickangle:A.tickangle,tickformat:A.tickformat,tickformatstops:A.tickformatstops,hoverformat:A.hoverformat,showline:e({},A.showline,{dflt:!0}),linecolor:A.linecolor,linewidth:A.linewidth,showgrid:e({},A.showgrid,{dflt:!0}),gridcolor:A.gridcolor,gridwidth:A.gridwidth,griddash:A.griddash,layer:A.layer,min:{valType:"number",dflt:0,min:0}},r=G.exports=E({domain:x({name:"ternary"}),bgcolor:{valType:"color",dflt:d.background},sum:{valType:"number",dflt:1,min:0},aaxis:t,baxis:t,caxis:t},"plot","from-root");r.uirevision={valType:"any",editType:"none"},r.aaxis.uirevision=r.baxis.uirevision=r.caxis.uirevision={valType:"any",editType:"none"}}}),Xd=He({"src/plots/subplot_defaults.js"(Y,G){var d=Gr(),x=Gs(),A=mu().defaults;G.exports=function(e,t,r,o){var a=o.type,i=o.attributes,n=o.handleDefaults,s=o.partition||"x",c=t._subplots[a],f=c.length,v=f&&c[0].replace(/\d+$/,""),h,T;function l(M,_){return d.coerce(h,T,i,M,_)}for(var y=0;y=y&&(w.min=0,p.min=0,u.min=0,f.aaxis&&delete f.aaxis.min,f.baxis&&delete f.baxis.min,f.caxis&&delete f.caxis.min)}function c(f,v,h,T){var l=i[v._name];function y(g,m){return A.coerce(f,v,l,g,m)}y("uirevision",T.uirevision),v.type="linear";var b=y("color"),S=b!==l.color.dflt?b:h.font.color,M=v._name,_=M.charAt(0).toUpperCase(),w="Component "+_,p=y("title.text",w);v._hovertitle=p===w?p:_,A.coerceFont(y,"title.font",h.font,{overrideDflt:{size:A.bigFont(h.font.size),color:S}}),y("min"),o(f,v,y,"linear"),t(f,v,y,"linear"),e(f,v,y,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),r(f,v,y,{outerTicks:!0});var u=y("showticklabels");u&&(A.coerceFont(y,"tickfont",h.font,{overrideDflt:{color:S}}),y("tickangle"),y("tickformat")),a(f,v,y,{dfltColor:b,bgColor:h.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:l}),y("hoverformat"),y("layer")}}}),bE=He({"src/plots/ternary/index.js"(Y){var G=_E(),d=Uf().getSubplotCalcData,x=Gr().counterRegex,A="ternary";Y.name=A;var E=Y.attr="subplot";Y.idRoot=A,Y.idRegex=Y.attrRegex=x(A);var e=Y.attributes={};e[E]={valType:"subplotid",dflt:"ternary",editType:"calc"},Y.layoutAttributes=Bw(),Y.supplyLayoutDefaults=xE(),Y.plot=function(r){for(var o=r._fullLayout,a=r.calcdata,i=o._subplots[A],n=0;n0){var M=r.xa,_=r.ya,w,p,u,g,m;f.orientation==="h"?(m=o,w="y",u=_,p="x",g=M):(m=a,w="x",u=M,p="y",g=_);var R=c[r.index];if(m>=R.span[0]&&m<=R.span[1]){var P=x.extendFlat({},r),z=g.c2p(m,!0),F=e.getKdeValue(R,f,m),B=e.getPositionOnKdePath(R,f,z),O=u._offset,L=u._length;P[w+"0"]=B[0],P[w+"1"]=B[1],P[p+"0"]=P[p+"1"]=z,P[p+"Label"]=p+": "+A.hoverLabelText(g,m,f[p+"hoverformat"])+", "+c[0].t.labels.kde+" "+F.toFixed(3);for(var N=0,U=0;U path").each(function(h){if(!h.isBlank){var T=v.marker;d.select(this).call(A.fill,h.mc||T.color).call(A.stroke,h.mlc||T.line.color).call(x.dashLine,T.line.dash,h.mlw||T.line.width).style("opacity",v.selectedpoints&&!h.selected?E:1)}}),r(f,v,a),f.selectAll(".regions").each(function(){d.select(this).selectAll("path").style("stroke-width",0).call(A.fill,v.connector.fillcolor)}),f.selectAll(".lines").each(function(){var h=v.connector.line;x.lineGroupStyle(d.select(this).selectAll("path"),h.width,h.color,h.dash)})})}G.exports={style:o}}}),UE=He({"src/traces/funnel/hover.js"(Y,G){var d=Ai().opacity,x=Z0().hoverOnBars,A=Gr().formatPercent;G.exports=function(t,r,o,a,i){var n=x(t,r,o,a,i);if(n){var s=n.cd,c=s[0].trace,f=c.orientation==="h",v=n.index,h=s[v],T=f?"x":"y";n[T+"LabelVal"]=h.s,n.percentInitial=h.begR,n.percentInitialLabel=A(h.begR,1),n.percentPrevious=h.difR,n.percentPreviousLabel=A(h.difR,1),n.percentTotal=h.sumR,n.percentTotalLabel=A(h.sumR,1);var l=h.hi||c.hoverinfo,y=[];if(l&&l!=="none"&&l!=="skip"){var b=l==="all",S=l.split("+"),M=function(_){return b||S.indexOf(_)!==-1};M("percent initial")&&y.push(n.percentInitialLabel+" of initial"),M("percent previous")&&y.push(n.percentPreviousLabel+" of previous"),M("percent total")&&y.push(n.percentTotalLabel+" of total")}return n.extraText=y.join("
"),n.color=E(c,h),[n]}};function E(e,t){var r=e.marker,o=t.mc||r.color,a=t.mlc||r.line.color,i=t.mlw||r.line.width;if(d(o))return o;if(d(a)&&i)return a}}}),jE=He({"src/traces/funnel/event_data.js"(Y,G){G.exports=function(x,A){return x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,"percentInitial"in A&&(x.percentInitial=A.percentInitial),"percentPrevious"in A&&(x.percentPrevious=A.percentPrevious),"percentTotal"in A&&(x.percentTotal=A.percentTotal),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),x}}}),VE=He({"src/traces/funnel/index.js"(Y,G){G.exports={attributes:jw(),layoutAttributes:Vw(),supplyDefaults:qw().supplyDefaults,crossTraceDefaults:qw().crossTraceDefaults,supplyLayoutDefaults:DE(),calc:FE(),crossTraceCalc:OE(),plot:BE(),style:NE().style,hoverPoints:UE(),eventData:jE(),selectPoints:X0(),moduleType:"trace",name:"funnel",basePlotModule:Bc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),qE=He({"lib/funnel.js"(Y,G){G.exports=VE()}}),HE=He({"src/traces/waterfall/constants.js"(Y,G){G.exports={eventDataKeys:["initial","delta","final"]}}}),Hw=He({"src/traces/waterfall/attributes.js"(Y,G){var d=qv(),x=Zu().line,A=cl(),E=Gu().axisHoverFormat,e=Yo().hovertemplateAttrs,t=Yo().texttemplateAttrs,r=HE(),o=ho().extendFlat,a=Ai();function i(n){return{marker:{color:o({},d.marker.color,{arrayOk:!1,editType:"style"}),line:{color:o({},d.marker.line.color,{arrayOk:!1,editType:"style"}),width:o({},d.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}G.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:d.x,x0:d.x0,dx:d.dx,y:d.y,y0:d.y0,dy:d.dy,xperiod:d.xperiod,yperiod:d.yperiod,xperiod0:d.xperiod0,yperiod0:d.yperiod0,xperiodalignment:d.xperiodalignment,yperiodalignment:d.yperiodalignment,xhoverformat:E("x"),yhoverformat:E("y"),hovertext:d.hovertext,hovertemplate:e({},{keys:r.eventDataKeys}),hoverinfo:o({},A.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:t({editType:"plot"},{keys:r.eventDataKeys.concat(["label"])}),text:d.text,textposition:d.textposition,insidetextanchor:d.insidetextanchor,textangle:d.textangle,textfont:d.textfont,insidetextfont:d.insidetextfont,outsidetextfont:d.outsidetextfont,constraintext:d.constraintext,cliponaxis:d.cliponaxis,orientation:d.orientation,offset:d.offset,width:d.width,increasing:i(),decreasing:i(),totals:i(),connector:{line:{color:o({},x.color,{dflt:a.defaultLine}),width:o({},x.width,{editType:"plot"}),dash:x.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:d.offsetgroup,alignmentgroup:d.alignmentgroup,zorder:d.zorder}}}),Gw=He({"src/traces/waterfall/layout_attributes.js"(Y,G){G.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"}}}}),K0=He({"src/constants/delta.js"(Y,G){G.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"▲"},DECREASING:{COLOR:"#FF4136",SYMBOL:"▼"}}}}),Ww=He({"src/traces/waterfall/defaults.js"(Y,G){var d=Gr(),x=Pp(),A=Jh().handleText,E=j0(),e=Tv(),t=Hw(),r=Ai(),o=K0(),a=o.INCREASING.COLOR,i=o.DECREASING.COLOR,n="#4499FF";function s(v,h,T){v(h+".marker.color",T),v(h+".marker.line.color",r.defaultLine),v(h+".marker.line.width")}function c(v,h,T,l){function y(w,p){return d.coerce(v,h,t,w,p)}var b=E(v,h,l,y);if(!b){h.visible=!1;return}e(v,h,l,y),y("xhoverformat"),y("yhoverformat"),y("measure"),y("orientation",h.x&&!h.y?"h":"v"),y("base"),y("offset"),y("width"),y("text"),y("hovertext"),y("hovertemplate");var S=y("textposition");A(v,h,l,y,S,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),h.textposition!=="none"&&(y("texttemplate"),h.texttemplate||y("textinfo")),s(y,"increasing",a),s(y,"decreasing",i),s(y,"totals",n);var M=y("connector.visible");if(M){y("connector.mode");var _=y("connector.line.width");_&&(y("connector.line.color"),y("connector.line.dash"))}y("zorder")}function f(v,h){var T,l;function y(S){return d.coerce(l._input,l,t,S)}if(h.waterfallmode==="group")for(var b=0;b0&&(y?m+="M"+u[0]+","+g[1]+"V"+g[0]:m+="M"+u[1]+","+g[0]+"H"+u[0]),b!=="between"&&(_.isSum||w path").each(function(h){if(!h.isBlank){var T=v[h.dir].marker;d.select(this).call(A.fill,T.color).call(A.stroke,T.line.color).call(x.dashLine,T.line.dash,T.line.width).style("opacity",v.selectedpoints&&!h.selected?E:1)}}),r(f,v,a),f.selectAll(".lines").each(function(){var h=v.connector.line;x.lineGroupStyle(d.select(this).selectAll("path"),h.width,h.color,h.dash)})})}G.exports={style:o}}}),KE=He({"src/traces/waterfall/hover.js"(Y,G){var d=io().hoverLabelText,x=Ai().opacity,A=Z0().hoverOnBars,E=K0(),e={increasing:E.INCREASING.SYMBOL,decreasing:E.DECREASING.SYMBOL};G.exports=function(o,a,i,n,s){var c=A(o,a,i,n,s);if(!c)return;var f=c.cd,v=f[0].trace,h=v.orientation==="h",T=h?"x":"y",l=h?o.xa:o.ya;function y(R){return d(l,R,v[T+"hoverformat"])}var b=c.index,S=f[b],M=S.isSum?S.b+S.s:S.rawS;c.initial=S.b+S.s-M,c.delta=M,c.final=c.initial+c.delta;var _=y(Math.abs(c.delta));c.deltaLabel=M<0?"("+_+")":_,c.finalLabel=y(c.final),c.initialLabel=y(c.initial);var w=S.hi||v.hoverinfo,p=[];if(w&&w!=="none"&&w!=="skip"){var u=w==="all",g=w.split("+"),m=function(R){return u||g.indexOf(R)!==-1};S.isSum||(m("final")&&(h?!m("x"):!m("y"))&&p.push(c.finalLabel),m("delta")&&(M<0?p.push(c.deltaLabel+" "+e.decreasing):p.push(c.deltaLabel+" "+e.increasing)),m("initial")&&p.push("Initial: "+c.initialLabel))}return p.length&&(c.extraText=p.join("
")),c.color=t(v,S),[c]};function t(r,o){var a=r[o.dir].marker,i=a.color,n=a.line.color,s=a.line.width;if(x(i))return i;if(x(n)&&s)return n}}}),JE=He({"src/traces/waterfall/event_data.js"(Y,G){G.exports=function(x,A){return x.x="xVal"in A?A.xVal:A.x,x.y="yVal"in A?A.yVal:A.y,"initial"in A&&(x.initial=A.initial),"delta"in A&&(x.delta=A.delta),"final"in A&&(x.final=A.final),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),x}}}),$E=He({"src/traces/waterfall/index.js"(Y,G){G.exports={attributes:Hw(),layoutAttributes:Gw(),supplyDefaults:Ww().supplyDefaults,crossTraceDefaults:Ww().crossTraceDefaults,supplyLayoutDefaults:GE(),calc:WE(),crossTraceCalc:ZE(),plot:XE(),style:YE().style,hoverPoints:KE(),eventData:JE(),selectPoints:X0(),moduleType:"trace",name:"waterfall",basePlotModule:Bc(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),QE=He({"lib/waterfall.js"(Y,G){G.exports=$E()}}),J0=He({"src/traces/image/constants.js"(Y,G){G.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(d){return d.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(d){return d.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(d){var x=d.slice(0,3);return x[1]=x[1]+"%",x[2]=x[2]+"%",x},suffix:["°","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(d){var x=d.slice(0,4);return x[1]=x[1]+"%",x[2]=x[2]+"%",x},suffix:["°","%","%",""]}}}}}),Zw=He({"src/traces/image/attributes.js"(Y,G){var d=cl(),x=Zu().zorder,A=Yo().hovertemplateAttrs,E=ho().extendFlat,e=J0().colormodel,t=["rgb","rgba","rgba256","hsl","hsla"],r=[],o=[];for(i=0;i0)throw new Error("Invalid string. Length must be a multiple of 4");var v=c.indexOf("=");v===-1&&(v=f);var h=v===f?0:4-v%4;return[v,h]}function r(c){var f=t(c),v=f[0],h=f[1];return(v+h)*3/4-h}function o(c,f,v){return(f+v)*3/4-v}function a(c){var f,v=t(c),h=v[0],T=v[1],l=new x(o(c,h,T)),y=0,b=T>0?h-4:h,S;for(S=0;S>16&255,l[y++]=f>>8&255,l[y++]=f&255;return T===2&&(f=d[c.charCodeAt(S)]<<2|d[c.charCodeAt(S+1)]>>4,l[y++]=f&255),T===1&&(f=d[c.charCodeAt(S)]<<10|d[c.charCodeAt(S+1)]<<4|d[c.charCodeAt(S+2)]>>2,l[y++]=f>>8&255,l[y++]=f&255),l}function i(c){return G[c>>18&63]+G[c>>12&63]+G[c>>6&63]+G[c&63]}function n(c,f,v){for(var h,T=[],l=f;lb?b:y+l));return h===1?(f=c[v-1],T.push(G[f>>2]+G[f<<4&63]+"==")):h===2&&(f=(c[v-2]<<8)+c[v-1],T.push(G[f>>10]+G[f>>4&63]+G[f<<2&63]+"=")),T.join("")}}}),rk=He({"node_modules/ieee754/index.js"(Y){Y.read=function(G,d,x,A,E){var e,t,r=E*8-A-1,o=(1<>1,i=-7,n=x?E-1:0,s=x?-1:1,c=G[d+n];for(n+=s,e=c&(1<<-i)-1,c>>=-i,i+=r;i>0;e=e*256+G[d+n],n+=s,i-=8);for(t=e&(1<<-i)-1,e>>=-i,i+=A;i>0;t=t*256+G[d+n],n+=s,i-=8);if(e===0)e=1-a;else{if(e===o)return t?NaN:(c?-1:1)*(1/0);t=t+Math.pow(2,A),e=e-a}return(c?-1:1)*t*Math.pow(2,e-A)},Y.write=function(G,d,x,A,E,e){var t,r,o,a=e*8-E-1,i=(1<>1,s=E===23?Math.pow(2,-24)-Math.pow(2,-77):0,c=A?0:e-1,f=A?1:-1,v=d<0||d===0&&1/d<0?1:0;for(d=Math.abs(d),isNaN(d)||d===1/0?(r=isNaN(d)?1:0,t=i):(t=Math.floor(Math.log(d)/Math.LN2),d*(o=Math.pow(2,-t))<1&&(t--,o*=2),t+n>=1?d+=s/o:d+=s*Math.pow(2,1-n),d*o>=2&&(t++,o/=2),t+n>=i?(r=0,t=i):t+n>=1?(r=(d*o-1)*Math.pow(2,E),t=t+n):(r=d*Math.pow(2,n-1)*Math.pow(2,E),t=0));E>=8;G[x+c]=r&255,c+=f,r/=256,E-=8);for(t=t<0;G[x+c]=t&255,c+=f,t/=256,a-=8);G[x+c-f]|=v*128}}}),zp=He({"node_modules/buffer/index.js"(Y){var G=tk(),d=rk(),x=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Y.Buffer=t,Y.SlowBuffer=T,Y.INSPECT_MAX_BYTES=50;var A=2147483647;Y.kMaxLength=A,t.TYPED_ARRAY_SUPPORT=E(),!t.TYPED_ARRAY_SUPPORT&&typeof console<"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.");function E(){try{const Me=new Uint8Array(1),xe={foo:function(){return 42}};return Object.setPrototypeOf(xe,Uint8Array.prototype),Object.setPrototypeOf(Me,xe),Me.foo()===42}catch{return!1}}Object.defineProperty(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}});function e(Me){if(Me>A)throw new RangeError('The value "'+Me+'" is invalid for option "size"');const xe=new Uint8Array(Me);return Object.setPrototypeOf(xe,t.prototype),xe}function t(Me,xe,ce){if(typeof Me=="number"){if(typeof xe=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return i(Me)}return r(Me,xe,ce)}t.poolSize=8192;function r(Me,xe,ce){if(typeof Me=="string")return n(Me,xe);if(ArrayBuffer.isView(Me))return c(Me);if(Me==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Me);if(qe(Me,ArrayBuffer)||Me&&qe(Me.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(qe(Me,SharedArrayBuffer)||Me&&qe(Me.buffer,SharedArrayBuffer)))return f(Me,xe,ce);if(typeof Me=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Re=Me.valueOf&&Me.valueOf();if(Re!=null&&Re!==Me)return t.from(Re,xe,ce);const $e=v(Me);if($e)return $e;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Me[Symbol.toPrimitive]=="function")return t.from(Me[Symbol.toPrimitive]("string"),xe,ce);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Me)}t.from=function(Me,xe,ce){return r(Me,xe,ce)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array);function o(Me){if(typeof Me!="number")throw new TypeError('"size" argument must be of type number');if(Me<0)throw new RangeError('The value "'+Me+'" is invalid for option "size"')}function a(Me,xe,ce){return o(Me),Me<=0?e(Me):xe!==void 0?typeof ce=="string"?e(Me).fill(xe,ce):e(Me).fill(xe):e(Me)}t.alloc=function(Me,xe,ce){return a(Me,xe,ce)};function i(Me){return o(Me),e(Me<0?0:h(Me)|0)}t.allocUnsafe=function(Me){return i(Me)},t.allocUnsafeSlow=function(Me){return i(Me)};function n(Me,xe){if((typeof xe!="string"||xe==="")&&(xe="utf8"),!t.isEncoding(xe))throw new TypeError("Unknown encoding: "+xe);const ce=l(Me,xe)|0;let Re=e(ce);const $e=Re.write(Me,xe);return $e!==ce&&(Re=Re.slice(0,$e)),Re}function s(Me){const xe=Me.length<0?0:h(Me.length)|0,ce=e(xe);for(let Re=0;Re=A)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+A.toString(16)+" bytes");return Me|0}function T(Me){return+Me!=Me&&(Me=0),t.alloc(+Me)}t.isBuffer=function(xe){return xe!=null&&xe._isBuffer===!0&&xe!==t.prototype},t.compare=function(xe,ce){if(qe(xe,Uint8Array)&&(xe=t.from(xe,xe.offset,xe.byteLength)),qe(ce,Uint8Array)&&(ce=t.from(ce,ce.offset,ce.byteLength)),!t.isBuffer(xe)||!t.isBuffer(ce))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(xe===ce)return 0;let Re=xe.length,$e=ce.length;for(let rt=0,Je=Math.min(Re,$e);rt$e.length?(t.isBuffer(Je)||(Je=t.from(Je)),Je.copy($e,rt)):Uint8Array.prototype.set.call($e,Je,rt);else if(t.isBuffer(Je))Je.copy($e,rt);else throw new TypeError('"list" argument must be an Array of Buffers');rt+=Je.length}return $e};function l(Me,xe){if(t.isBuffer(Me))return Me.length;if(ArrayBuffer.isView(Me)||qe(Me,ArrayBuffer))return Me.byteLength;if(typeof Me!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Me);const ce=Me.length,Re=arguments.length>2&&arguments[2]===!0;if(!Re&&ce===0)return 0;let $e=!1;for(;;)switch(xe){case"ascii":case"latin1":case"binary":return ce;case"utf8":case"utf-8":return fe(Me).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce*2;case"hex":return ce>>>1;case"base64":return Fe(Me).length;default:if($e)return Re?-1:fe(Me).length;xe=(""+xe).toLowerCase(),$e=!0}}t.byteLength=l;function y(Me,xe,ce){let Re=!1;if((xe===void 0||xe<0)&&(xe=0),xe>this.length||((ce===void 0||ce>this.length)&&(ce=this.length),ce<=0)||(ce>>>=0,xe>>>=0,ce<=xe))return"";for(Me||(Me="utf8");;)switch(Me){case"hex":return O(this,xe,ce);case"utf8":case"utf-8":return R(this,xe,ce);case"ascii":return F(this,xe,ce);case"latin1":case"binary":return B(this,xe,ce);case"base64":return m(this,xe,ce);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,xe,ce);default:if(Re)throw new TypeError("Unknown encoding: "+Me);Me=(Me+"").toLowerCase(),Re=!0}}t.prototype._isBuffer=!0;function b(Me,xe,ce){const Re=Me[xe];Me[xe]=Me[ce],Me[ce]=Re}t.prototype.swap16=function(){const xe=this.length;if(xe%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let ce=0;cece&&(xe+=" ... "),""},x&&(t.prototype[x]=t.prototype.inspect),t.prototype.compare=function(xe,ce,Re,$e,rt){if(qe(xe,Uint8Array)&&(xe=t.from(xe,xe.offset,xe.byteLength)),!t.isBuffer(xe))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof xe);if(ce===void 0&&(ce=0),Re===void 0&&(Re=xe?xe.length:0),$e===void 0&&($e=0),rt===void 0&&(rt=this.length),ce<0||Re>xe.length||$e<0||rt>this.length)throw new RangeError("out of range index");if($e>=rt&&ce>=Re)return 0;if($e>=rt)return-1;if(ce>=Re)return 1;if(ce>>>=0,Re>>>=0,$e>>>=0,rt>>>=0,this===xe)return 0;let Je=rt-$e,At=Re-ce;const St=Math.min(Je,At),Rt=this.slice($e,rt),Ut=xe.slice(ce,Re);for(let ir=0;ir2147483647?ce=2147483647:ce<-2147483648&&(ce=-2147483648),ce=+ce,et(ce)&&(ce=$e?0:Me.length-1),ce<0&&(ce=Me.length+ce),ce>=Me.length){if($e)return-1;ce=Me.length-1}else if(ce<0)if($e)ce=0;else return-1;if(typeof xe=="string"&&(xe=t.from(xe,Re)),t.isBuffer(xe))return xe.length===0?-1:M(Me,xe,ce,Re,$e);if(typeof xe=="number")return xe=xe&255,typeof Uint8Array.prototype.indexOf=="function"?$e?Uint8Array.prototype.indexOf.call(Me,xe,ce):Uint8Array.prototype.lastIndexOf.call(Me,xe,ce):M(Me,[xe],ce,Re,$e);throw new TypeError("val must be string, number or Buffer")}function M(Me,xe,ce,Re,$e){let rt=1,Je=Me.length,At=xe.length;if(Re!==void 0&&(Re=String(Re).toLowerCase(),Re==="ucs2"||Re==="ucs-2"||Re==="utf16le"||Re==="utf-16le")){if(Me.length<2||xe.length<2)return-1;rt=2,Je/=2,At/=2,ce/=2}function St(Ut,ir){return rt===1?Ut[ir]:Ut.readUInt16BE(ir*rt)}let Rt;if($e){let Ut=-1;for(Rt=ce;RtJe&&(ce=Je-At),Rt=ce;Rt>=0;Rt--){let Ut=!0;for(let ir=0;ir$e&&(Re=$e)):Re=$e;const rt=xe.length;Re>rt/2&&(Re=rt/2);let Je;for(Je=0;Je>>0,isFinite(Re)?(Re=Re>>>0,$e===void 0&&($e="utf8")):($e=Re,Re=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const rt=this.length-ce;if((Re===void 0||Re>rt)&&(Re=rt),xe.length>0&&(Re<0||ce<0)||ce>this.length)throw new RangeError("Attempt to write outside buffer bounds");$e||($e="utf8");let Je=!1;for(;;)switch($e){case"hex":return _(this,xe,ce,Re);case"utf8":case"utf-8":return w(this,xe,ce,Re);case"ascii":case"latin1":case"binary":return p(this,xe,ce,Re);case"base64":return u(this,xe,ce,Re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,xe,ce,Re);default:if(Je)throw new TypeError("Unknown encoding: "+$e);$e=(""+$e).toLowerCase(),Je=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function m(Me,xe,ce){return xe===0&&ce===Me.length?G.fromByteArray(Me):G.fromByteArray(Me.slice(xe,ce))}function R(Me,xe,ce){ce=Math.min(Me.length,ce);const Re=[];let $e=xe;for(;$e239?4:rt>223?3:rt>191?2:1;if($e+At<=ce){let St,Rt,Ut,ir;switch(At){case 1:rt<128&&(Je=rt);break;case 2:St=Me[$e+1],(St&192)===128&&(ir=(rt&31)<<6|St&63,ir>127&&(Je=ir));break;case 3:St=Me[$e+1],Rt=Me[$e+2],(St&192)===128&&(Rt&192)===128&&(ir=(rt&15)<<12|(St&63)<<6|Rt&63,ir>2047&&(ir<55296||ir>57343)&&(Je=ir));break;case 4:St=Me[$e+1],Rt=Me[$e+2],Ut=Me[$e+3],(St&192)===128&&(Rt&192)===128&&(Ut&192)===128&&(ir=(rt&15)<<18|(St&63)<<12|(Rt&63)<<6|Ut&63,ir>65535&&ir<1114112&&(Je=ir))}}Je===null?(Je=65533,At=1):Je>65535&&(Je-=65536,Re.push(Je>>>10&1023|55296),Je=56320|Je&1023),Re.push(Je),$e+=At}return z(Re)}var P=4096;function z(Me){const xe=Me.length;if(xe<=P)return String.fromCharCode.apply(String,Me);let ce="",Re=0;for(;ReRe)&&(ce=Re);let $e="";for(let rt=xe;rtRe&&(xe=Re),ce<0?(ce+=Re,ce<0&&(ce=0)):ce>Re&&(ce=Re),cece)throw new RangeError("Trying to access beyond buffer length")}t.prototype.readUintLE=t.prototype.readUIntLE=function(xe,ce,Re){xe=xe>>>0,ce=ce>>>0,Re||N(xe,ce,this.length);let $e=this[xe],rt=1,Je=0;for(;++Je>>0,ce=ce>>>0,Re||N(xe,ce,this.length);let $e=this[xe+--ce],rt=1;for(;ce>0&&(rt*=256);)$e+=this[xe+--ce]*rt;return $e},t.prototype.readUint8=t.prototype.readUInt8=function(xe,ce){return xe=xe>>>0,ce||N(xe,1,this.length),this[xe]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(xe,ce){return xe=xe>>>0,ce||N(xe,2,this.length),this[xe]|this[xe+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(xe,ce){return xe=xe>>>0,ce||N(xe,2,this.length),this[xe]<<8|this[xe+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(xe,ce){return xe=xe>>>0,ce||N(xe,4,this.length),(this[xe]|this[xe+1]<<8|this[xe+2]<<16)+this[xe+3]*16777216},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(xe,ce){return xe=xe>>>0,ce||N(xe,4,this.length),this[xe]*16777216+(this[xe+1]<<16|this[xe+2]<<8|this[xe+3])},t.prototype.readBigUInt64LE=Ke(function(xe){xe=xe>>>0,ee(xe,"offset");const ce=this[xe],Re=this[xe+7];(ce===void 0||Re===void 0)&&q(xe,this.length-8);const $e=ce+this[++xe]*2**8+this[++xe]*2**16+this[++xe]*2**24,rt=this[++xe]+this[++xe]*2**8+this[++xe]*2**16+Re*2**24;return BigInt($e)+(BigInt(rt)<>>0,ee(xe,"offset");const ce=this[xe],Re=this[xe+7];(ce===void 0||Re===void 0)&&q(xe,this.length-8);const $e=ce*2**24+this[++xe]*2**16+this[++xe]*2**8+this[++xe],rt=this[++xe]*2**24+this[++xe]*2**16+this[++xe]*2**8+Re;return(BigInt($e)<>>0,ce=ce>>>0,Re||N(xe,ce,this.length);let $e=this[xe],rt=1,Je=0;for(;++Je=rt&&($e-=Math.pow(2,8*ce)),$e},t.prototype.readIntBE=function(xe,ce,Re){xe=xe>>>0,ce=ce>>>0,Re||N(xe,ce,this.length);let $e=ce,rt=1,Je=this[xe+--$e];for(;$e>0&&(rt*=256);)Je+=this[xe+--$e]*rt;return rt*=128,Je>=rt&&(Je-=Math.pow(2,8*ce)),Je},t.prototype.readInt8=function(xe,ce){return xe=xe>>>0,ce||N(xe,1,this.length),this[xe]&128?(255-this[xe]+1)*-1:this[xe]},t.prototype.readInt16LE=function(xe,ce){xe=xe>>>0,ce||N(xe,2,this.length);const Re=this[xe]|this[xe+1]<<8;return Re&32768?Re|4294901760:Re},t.prototype.readInt16BE=function(xe,ce){xe=xe>>>0,ce||N(xe,2,this.length);const Re=this[xe+1]|this[xe]<<8;return Re&32768?Re|4294901760:Re},t.prototype.readInt32LE=function(xe,ce){return xe=xe>>>0,ce||N(xe,4,this.length),this[xe]|this[xe+1]<<8|this[xe+2]<<16|this[xe+3]<<24},t.prototype.readInt32BE=function(xe,ce){return xe=xe>>>0,ce||N(xe,4,this.length),this[xe]<<24|this[xe+1]<<16|this[xe+2]<<8|this[xe+3]},t.prototype.readBigInt64LE=Ke(function(xe){xe=xe>>>0,ee(xe,"offset");const ce=this[xe],Re=this[xe+7];(ce===void 0||Re===void 0)&&q(xe,this.length-8);const $e=this[xe+4]+this[xe+5]*2**8+this[xe+6]*2**16+(Re<<24);return(BigInt($e)<>>0,ee(xe,"offset");const ce=this[xe],Re=this[xe+7];(ce===void 0||Re===void 0)&&q(xe,this.length-8);const $e=(ce<<24)+this[++xe]*2**16+this[++xe]*2**8+this[++xe];return(BigInt($e)<>>0,ce||N(xe,4,this.length),d.read(this,xe,!0,23,4)},t.prototype.readFloatBE=function(xe,ce){return xe=xe>>>0,ce||N(xe,4,this.length),d.read(this,xe,!1,23,4)},t.prototype.readDoubleLE=function(xe,ce){return xe=xe>>>0,ce||N(xe,8,this.length),d.read(this,xe,!0,52,8)},t.prototype.readDoubleBE=function(xe,ce){return xe=xe>>>0,ce||N(xe,8,this.length),d.read(this,xe,!1,52,8)};function U(Me,xe,ce,Re,$e,rt){if(!t.isBuffer(Me))throw new TypeError('"buffer" argument must be a Buffer instance');if(xe>$e||xeMe.length)throw new RangeError("Index out of range")}t.prototype.writeUintLE=t.prototype.writeUIntLE=function(xe,ce,Re,$e){if(xe=+xe,ce=ce>>>0,Re=Re>>>0,!$e){const At=Math.pow(2,8*Re)-1;U(this,xe,ce,Re,At,0)}let rt=1,Je=0;for(this[ce]=xe&255;++Je>>0,Re=Re>>>0,!$e){const At=Math.pow(2,8*Re)-1;U(this,xe,ce,Re,At,0)}let rt=Re-1,Je=1;for(this[ce+rt]=xe&255;--rt>=0&&(Je*=256);)this[ce+rt]=xe/Je&255;return ce+Re},t.prototype.writeUint8=t.prototype.writeUInt8=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,1,255,0),this[ce]=xe&255,ce+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,2,65535,0),this[ce]=xe&255,this[ce+1]=xe>>>8,ce+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,2,65535,0),this[ce]=xe>>>8,this[ce+1]=xe&255,ce+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,4,4294967295,0),this[ce+3]=xe>>>24,this[ce+2]=xe>>>16,this[ce+1]=xe>>>8,this[ce]=xe&255,ce+4},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,4,4294967295,0),this[ce]=xe>>>24,this[ce+1]=xe>>>16,this[ce+2]=xe>>>8,this[ce+3]=xe&255,ce+4};function Z(Me,xe,ce,Re,$e){re(xe,Re,$e,Me,ce,7);let rt=Number(xe&BigInt(4294967295));Me[ce++]=rt,rt=rt>>8,Me[ce++]=rt,rt=rt>>8,Me[ce++]=rt,rt=rt>>8,Me[ce++]=rt;let Je=Number(xe>>BigInt(32)&BigInt(4294967295));return Me[ce++]=Je,Je=Je>>8,Me[ce++]=Je,Je=Je>>8,Me[ce++]=Je,Je=Je>>8,Me[ce++]=Je,ce}function Q(Me,xe,ce,Re,$e){re(xe,Re,$e,Me,ce,7);let rt=Number(xe&BigInt(4294967295));Me[ce+7]=rt,rt=rt>>8,Me[ce+6]=rt,rt=rt>>8,Me[ce+5]=rt,rt=rt>>8,Me[ce+4]=rt;let Je=Number(xe>>BigInt(32)&BigInt(4294967295));return Me[ce+3]=Je,Je=Je>>8,Me[ce+2]=Je,Je=Je>>8,Me[ce+1]=Je,Je=Je>>8,Me[ce]=Je,ce+8}t.prototype.writeBigUInt64LE=Ke(function(xe,ce=0){return Z(this,xe,ce,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeBigUInt64BE=Ke(function(xe,ce=0){return Q(this,xe,ce,BigInt(0),BigInt("0xffffffffffffffff"))}),t.prototype.writeIntLE=function(xe,ce,Re,$e){if(xe=+xe,ce=ce>>>0,!$e){const St=Math.pow(2,8*Re-1);U(this,xe,ce,Re,St-1,-St)}let rt=0,Je=1,At=0;for(this[ce]=xe&255;++rt>0)-At&255;return ce+Re},t.prototype.writeIntBE=function(xe,ce,Re,$e){if(xe=+xe,ce=ce>>>0,!$e){const St=Math.pow(2,8*Re-1);U(this,xe,ce,Re,St-1,-St)}let rt=Re-1,Je=1,At=0;for(this[ce+rt]=xe&255;--rt>=0&&(Je*=256);)xe<0&&At===0&&this[ce+rt+1]!==0&&(At=1),this[ce+rt]=(xe/Je>>0)-At&255;return ce+Re},t.prototype.writeInt8=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,1,127,-128),xe<0&&(xe=255+xe+1),this[ce]=xe&255,ce+1},t.prototype.writeInt16LE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,2,32767,-32768),this[ce]=xe&255,this[ce+1]=xe>>>8,ce+2},t.prototype.writeInt16BE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,2,32767,-32768),this[ce]=xe>>>8,this[ce+1]=xe&255,ce+2},t.prototype.writeInt32LE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,4,2147483647,-2147483648),this[ce]=xe&255,this[ce+1]=xe>>>8,this[ce+2]=xe>>>16,this[ce+3]=xe>>>24,ce+4},t.prototype.writeInt32BE=function(xe,ce,Re){return xe=+xe,ce=ce>>>0,Re||U(this,xe,ce,4,2147483647,-2147483648),xe<0&&(xe=4294967295+xe+1),this[ce]=xe>>>24,this[ce+1]=xe>>>16,this[ce+2]=xe>>>8,this[ce+3]=xe&255,ce+4},t.prototype.writeBigInt64LE=Ke(function(xe,ce=0){return Z(this,xe,ce,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),t.prototype.writeBigInt64BE=Ke(function(xe,ce=0){return Q(this,xe,ce,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ue(Me,xe,ce,Re,$e,rt){if(ce+Re>Me.length)throw new RangeError("Index out of range");if(ce<0)throw new RangeError("Index out of range")}function oe(Me,xe,ce,Re,$e){return xe=+xe,ce=ce>>>0,$e||ue(Me,xe,ce,4),d.write(Me,xe,ce,Re,23,4),ce+4}t.prototype.writeFloatLE=function(xe,ce,Re){return oe(this,xe,ce,!0,Re)},t.prototype.writeFloatBE=function(xe,ce,Re){return oe(this,xe,ce,!1,Re)};function le(Me,xe,ce,Re,$e){return xe=+xe,ce=ce>>>0,$e||ue(Me,xe,ce,8),d.write(Me,xe,ce,Re,52,8),ce+8}t.prototype.writeDoubleLE=function(xe,ce,Re){return le(this,xe,ce,!0,Re)},t.prototype.writeDoubleBE=function(xe,ce,Re){return le(this,xe,ce,!1,Re)},t.prototype.copy=function(xe,ce,Re,$e){if(!t.isBuffer(xe))throw new TypeError("argument should be a Buffer");if(Re||(Re=0),!$e&&$e!==0&&($e=this.length),ce>=xe.length&&(ce=xe.length),ce||(ce=0),$e>0&&$e=this.length)throw new RangeError("Index out of range");if($e<0)throw new RangeError("sourceEnd out of bounds");$e>this.length&&($e=this.length),xe.length-ce<$e-Re&&($e=xe.length-ce+Re);const rt=$e-Re;return this===xe&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(ce,Re,$e):Uint8Array.prototype.set.call(xe,this.subarray(Re,$e),ce),rt},t.prototype.fill=function(xe,ce,Re,$e){if(typeof xe=="string"){if(typeof ce=="string"?($e=ce,ce=0,Re=this.length):typeof Re=="string"&&($e=Re,Re=this.length),$e!==void 0&&typeof $e!="string")throw new TypeError("encoding must be a string");if(typeof $e=="string"&&!t.isEncoding($e))throw new TypeError("Unknown encoding: "+$e);if(xe.length===1){const Je=xe.charCodeAt(0);($e==="utf8"&&Je<128||$e==="latin1")&&(xe=Je)}}else typeof xe=="number"?xe=xe&255:typeof xe=="boolean"&&(xe=Number(xe));if(ce<0||this.length>>0,Re=Re===void 0?this.length:Re>>>0,xe||(xe=0);let rt;if(typeof xe=="number")for(rt=ce;rt2**32?$e=$(String(ce)):typeof ce=="bigint"&&($e=String(ce),(ce>BigInt(2)**BigInt(32)||ce<-(BigInt(2)**BigInt(32)))&&($e=$($e)),$e+="n"),Re+=` It must be ${xe}. Received ${$e}`,Re},RangeError);function $(Me){let xe="",ce=Me.length;const Re=Me[0]==="-"?1:0;for(;ce>=Re+4;ce-=3)xe=`_${Me.slice(ce-3,ce)}${xe}`;return`${Me.slice(0,ce)}${xe}`}function X(Me,xe,ce){ee(xe,"offset"),(Me[xe]===void 0||Me[xe+ce]===void 0)&&q(xe,Me.length-(ce+1))}function re(Me,xe,ce,Re,$e,rt){if(Me>ce||Me= 0${Je} and < 2${Je} ** ${(rt+1)*8}${Je}`:At=`>= -(2${Je} ** ${(rt+1)*8-1}${Je}) and < 2 ** ${(rt+1)*8-1}${Je}`,new j.ERR_OUT_OF_RANGE("value",At,Me)}X(Re,$e,rt)}function ee(Me,xe){if(typeof Me!="number")throw new j.ERR_INVALID_ARG_TYPE(xe,"number",Me)}function q(Me,xe,ce){throw Math.floor(Me)!==Me?(ee(Me,ce),new j.ERR_OUT_OF_RANGE("offset","an integer",Me)):xe<0?new j.ERR_BUFFER_OUT_OF_BOUNDS:new j.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${xe}`,Me)}var ae=/[^+/0-9A-Za-z-_]/g;function ie(Me){if(Me=Me.split("=")[0],Me=Me.trim().replace(ae,""),Me.length<2)return"";for(;Me.length%4!==0;)Me=Me+"=";return Me}function fe(Me,xe){xe=xe||1/0;let ce;const Re=Me.length;let $e=null;const rt=[];for(let Je=0;Je55295&&ce<57344){if(!$e){if(ce>56319){(xe-=3)>-1&&rt.push(239,191,189);continue}else if(Je+1===Re){(xe-=3)>-1&&rt.push(239,191,189);continue}$e=ce;continue}if(ce<56320){(xe-=3)>-1&&rt.push(239,191,189),$e=ce;continue}ce=($e-55296<<10|ce-56320)+65536}else $e&&(xe-=3)>-1&&rt.push(239,191,189);if($e=null,ce<128){if((xe-=1)<0)break;rt.push(ce)}else if(ce<2048){if((xe-=2)<0)break;rt.push(ce>>6|192,ce&63|128)}else if(ce<65536){if((xe-=3)<0)break;rt.push(ce>>12|224,ce>>6&63|128,ce&63|128)}else if(ce<1114112){if((xe-=4)<0)break;rt.push(ce>>18|240,ce>>12&63|128,ce>>6&63|128,ce&63|128)}else throw new Error("Invalid code point")}return rt}function we(Me){const xe=[];for(let ce=0;ce>8,$e=ce%256,rt.push($e),rt.push(Re);return rt}function Fe(Me){return G.toByteArray(ie(Me))}function Ce(Me,xe,ce,Re){let $e;for($e=0;$e=xe.length||$e>=Me.length);++$e)xe[$e+ce]=Me[$e];return $e}function qe(Me,xe){return Me instanceof xe||Me!=null&&Me.constructor!=null&&Me.constructor.name!=null&&Me.constructor.name===xe.name}function et(Me){return Me!==Me}var Qe=function(){const Me="0123456789abcdef",xe=new Array(256);for(let ce=0;ce<16;++ce){const Re=ce*16;for(let $e=0;$e<16;++$e)xe[Re+$e]=Me[ce]+Me[$e]}return xe}();function Ke(Me){return typeof BigInt>"u"?Xe:Me}function Xe(){throw new Error("BigInt not supported")}}}),K1=He({"node_modules/has-symbols/shams.js"(Y,G){G.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var x={},A=Symbol("test"),E=Object(A);if(typeof A=="string"||Object.prototype.toString.call(A)!=="[object Symbol]"||Object.prototype.toString.call(E)!=="[object Symbol]")return!1;var e=42;x[A]=e;for(A in x)return!1;if(typeof Object.keys=="function"&&Object.keys(x).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(x).length!==0)return!1;var t=Object.getOwnPropertySymbols(x);if(t.length!==1||t[0]!==A||!Object.prototype.propertyIsEnumerable.call(x,A))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var r=Object.getOwnPropertyDescriptor(x,A);if(r.value!==e||r.enumerable!==!0)return!1}return!0}}}),dy=He({"node_modules/has-tostringtag/shams.js"(Y,G){var d=K1();G.exports=function(){return d()&&!!Symbol.toStringTag}}}),ak=He({"node_modules/es-errors/index.js"(Y,G){G.exports=Error}}),nk=He({"node_modules/es-errors/eval.js"(Y,G){G.exports=EvalError}}),ik=He({"node_modules/es-errors/range.js"(Y,G){G.exports=RangeError}}),ok=He({"node_modules/es-errors/ref.js"(Y,G){G.exports=ReferenceError}}),Yw=He({"node_modules/es-errors/syntax.js"(Y,G){G.exports=SyntaxError}}),py=He({"node_modules/es-errors/type.js"(Y,G){G.exports=TypeError}}),sk=He({"node_modules/es-errors/uri.js"(Y,G){G.exports=URIError}}),lk=He({"node_modules/has-symbols/index.js"(Y,G){var d=typeof Symbol<"u"&&Symbol,x=K1();G.exports=function(){return typeof d!="function"||typeof Symbol!="function"||typeof d("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:x()}}}),uk=He({"node_modules/has-proto/index.js"(Y,G){var d={foo:{}},x=Object;G.exports=function(){return{__proto__:d}.foo===d.foo&&!({__proto__:null}instanceof x)}}}),ck=He({"node_modules/function-bind/implementation.js"(Y,G){var d="Function.prototype.bind called on incompatible ",x=Object.prototype.toString,A=Math.max,E="[object Function]",e=function(a,i){for(var n=[],s=0;s"u"||!h?d:h(Uint8Array),y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?d:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?d:ArrayBuffer,"%ArrayIteratorPrototype%":f&&h?h([][Symbol.iterator]()):d,"%AsyncFromSyncIteratorPrototype%":d,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%Atomics%":typeof Atomics>"u"?d:Atomics,"%BigInt%":typeof BigInt>"u"?d:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?d:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?d:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?d:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":x,"%eval%":eval,"%EvalError%":A,"%Float32Array%":typeof Float32Array>"u"?d:Float32Array,"%Float64Array%":typeof Float64Array>"u"?d:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?d:FinalizationRegistry,"%Function%":a,"%GeneratorFunction%":T,"%Int8Array%":typeof Int8Array>"u"?d:Int8Array,"%Int16Array%":typeof Int16Array>"u"?d:Int16Array,"%Int32Array%":typeof Int32Array>"u"?d:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f&&h?h(h([][Symbol.iterator]())):d,"%JSON%":typeof JSON=="object"?JSON:d,"%Map%":typeof Map>"u"?d:Map,"%MapIteratorPrototype%":typeof Map>"u"||!f||!h?d:h(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?d:Promise,"%Proxy%":typeof Proxy>"u"?d:Proxy,"%RangeError%":E,"%ReferenceError%":e,"%Reflect%":typeof Reflect>"u"?d:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?d:Set,"%SetIteratorPrototype%":typeof Set>"u"||!f||!h?d:h(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?d:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f&&h?h(""[Symbol.iterator]()):d,"%Symbol%":f?Symbol:d,"%SyntaxError%":t,"%ThrowTypeError%":c,"%TypedArray%":l,"%TypeError%":r,"%Uint8Array%":typeof Uint8Array>"u"?d:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?d:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?d:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?d:Uint32Array,"%URIError%":o,"%WeakMap%":typeof WeakMap>"u"?d:WeakMap,"%WeakRef%":typeof WeakRef>"u"?d:WeakRef,"%WeakSet%":typeof WeakSet>"u"?d:WeakSet};if(h)try{null.error}catch(O){b=h(h(O)),y["%Error.prototype%"]=b}var b,S=function O(L){var N;if(L==="%AsyncFunction%")N=i("async function () {}");else if(L==="%GeneratorFunction%")N=i("function* () {}");else if(L==="%AsyncGeneratorFunction%")N=i("async function* () {}");else if(L==="%AsyncGenerator%"){var U=O("%AsyncGeneratorFunction%");U&&(N=U.prototype)}else if(L==="%AsyncIteratorPrototype%"){var Z=O("%AsyncGenerator%");Z&&h&&(N=h(Z.prototype))}return y[L]=N,N},M={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=J1(),w=fk(),p=_.call(Function.call,Array.prototype.concat),u=_.call(Function.apply,Array.prototype.splice),g=_.call(Function.call,String.prototype.replace),m=_.call(Function.call,String.prototype.slice),R=_.call(Function.call,RegExp.prototype.exec),P=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,z=/\\(\\)?/g,F=function(L){var N=m(L,0,1),U=m(L,-1);if(N==="%"&&U!=="%")throw new t("invalid intrinsic syntax, expected closing `%`");if(U==="%"&&N!=="%")throw new t("invalid intrinsic syntax, expected opening `%`");var Z=[];return g(L,P,function(Q,ue,oe,le){Z[Z.length]=oe?g(le,z,"$1"):ue||Q}),Z},B=function(L,N){var U=L,Z;if(w(M,U)&&(Z=M[U],U="%"+Z[0]+"%"),w(y,U)){var Q=y[U];if(Q===T&&(Q=S(U)),typeof Q>"u"&&!N)throw new r("intrinsic "+L+" exists, but is not available. Please file an issue!");return{alias:Z,name:U,value:Q}}throw new t("intrinsic "+L+" does not exist!")};G.exports=function(L,N){if(typeof L!="string"||L.length===0)throw new r("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof N!="boolean")throw new r('"allowMissing" argument must be a boolean');if(R(/^%?[^%]*%?$/,L)===null)throw new t("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var U=F(L),Z=U.length>0?U[0]:"",Q=B("%"+Z+"%",N),ue=Q.name,oe=Q.value,le=!1,j=Q.alias;j&&(Z=j[0],u(U,p([0,1],j)));for(var J=1,$=!0;J=U.length){var q=n(oe,X);$=!!q,$&&"get"in q&&!("originalValue"in q.get)?oe=q.get:oe=oe[X]}else $=w(oe,X),oe=oe[X];$&&!le&&(y[ue]=oe)}}return oe}}}),$1=He({"node_modules/es-define-property/index.js"(Y,G){var d=$0(),x=d("%Object.defineProperty%",!0)||!1;if(x)try{x({},"a",{value:1})}catch{x=!1}G.exports=x}}),gy=He({"node_modules/gopd/index.js"(Y,G){var d=$0(),x=d("%Object.getOwnPropertyDescriptor%",!0);if(x)try{x([],"length")}catch{x=null}G.exports=x}}),hk=He({"node_modules/define-data-property/index.js"(Y,G){var d=$1(),x=Yw(),A=py(),E=gy();G.exports=function(t,r,o){if(!t||typeof t!="object"&&typeof t!="function")throw new A("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new A("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new A("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new A("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new A("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new A("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,n=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,c=!!E&&E(t,r);if(d)d(t,r,{configurable:n===null&&c?c.configurable:!n,enumerable:a===null&&c?c.enumerable:!a,value:o,writable:i===null&&c?c.writable:!i});else if(s||!a&&!i&&!n)t[r]=o;else throw new x("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}}),Kw=He({"node_modules/has-property-descriptors/index.js"(Y,G){var d=$1(),x=function(){return!!d};x.hasArrayLengthDefineBug=function(){if(!d)return null;try{return d([],"length",{value:1}).length!==1}catch{return!0}},G.exports=x}}),vk=He({"node_modules/set-function-length/index.js"(Y,G){var d=$0(),x=hk(),A=Kw()(),E=gy(),e=py(),t=d("%Math.floor%");G.exports=function(o,a){if(typeof o!="function")throw new e("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||t(a)!==a)throw new e("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in o&&E){var c=E(o,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(s=!1)}return(n||s||!i)&&(A?x(o,"length",a,!0,!0):x(o,"length",a)),o}}}),yy=He({"node_modules/call-bind/index.js"(Y,G){var d=J1(),x=$0(),A=vk(),E=py(),e=x("%Function.prototype.apply%"),t=x("%Function.prototype.call%"),r=x("%Reflect.apply%",!0)||d.call(t,e),o=$1(),a=x("%Math.max%");G.exports=function(s){if(typeof s!="function")throw new E("a function is required");var c=r(d,t,arguments);return A(c,1+a(0,s.length-(arguments.length-1)),!0)};var i=function(){return r(d,e,arguments)};o?o(G.exports,"apply",{value:i}):G.exports.apply=i}}),Q0=He({"node_modules/call-bind/callBound.js"(Y,G){var d=$0(),x=yy(),A=x(d("String.prototype.indexOf"));G.exports=function(e,t){var r=d(e,!!t);return typeof r=="function"&&A(e,".prototype.")>-1?x(r):r}}}),dk=He({"node_modules/is-arguments/index.js"(Y,G){var d=dy()(),x=Q0(),A=x("Object.prototype.toString"),E=function(o){return d&&o&&typeof o=="object"&&Symbol.toStringTag in o?!1:A(o)==="[object Arguments]"},e=function(o){return E(o)?!0:o!==null&&typeof o=="object"&&typeof o.length=="number"&&o.length>=0&&A(o)!=="[object Array]"&&A(o.callee)==="[object Function]"},t=function(){return E(arguments)}();E.isLegacyArguments=e,G.exports=t?E:e}}),pk=He({"node_modules/is-generator-function/index.js"(Y,G){var d=Object.prototype.toString,x=Function.prototype.toString,A=/^\s*(?:function)?\*/,E=dy()(),e=Object.getPrototypeOf,t=function(){if(!E)return!1;try{return Function("return function*() {}")()}catch{}},r;G.exports=function(a){if(typeof a!="function")return!1;if(A.test(x.call(a)))return!0;if(!E){var i=d.call(a);return i==="[object GeneratorFunction]"}if(!e)return!1;if(typeof r>"u"){var n=t();r=n?e(n):!1}return e(a)===r}}}),gk=He({"node_modules/is-callable/index.js"(Y,G){var d=Function.prototype.toString,x=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,A,E;if(typeof x=="function"&&typeof Object.defineProperty=="function")try{A=Object.defineProperty({},"length",{get:function(){throw E}}),E={},x(function(){throw 42},null,A)}catch(y){y!==E&&(x=null)}else x=null;var e=/^\s*class\b/,t=function(b){try{var S=d.call(b);return e.test(S)}catch{return!1}},r=function(b){try{return t(b)?!1:(d.call(b),!0)}catch{return!1}},o=Object.prototype.toString,a="[object Object]",i="[object Function]",n="[object GeneratorFunction]",s="[object HTMLAllCollection]",c="[object HTML document.all class]",f="[object HTMLCollection]",v=typeof Symbol=="function"&&!!Symbol.toStringTag,h=!(0 in[,]),T=function(){return!1};typeof document=="object"&&(l=document.all,o.call(l)===o.call(document.all)&&(T=function(b){if((h||!b)&&(typeof b>"u"||typeof b=="object"))try{var S=o.call(b);return(S===s||S===c||S===f||S===a)&&b("")==null}catch{}return!1}));var l;G.exports=x?function(b){if(T(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;try{x(b,null,A)}catch(S){if(S!==E)return!1}return!t(b)&&r(b)}:function(b){if(T(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;if(v)return r(b);if(t(b))return!1;var S=o.call(b);return S!==i&&S!==n&&!/^\[object HTML/.test(S)?!1:r(b)}}}),Jw=He({"node_modules/for-each/index.js"(Y,G){var d=gk(),x=Object.prototype.toString,A=Object.prototype.hasOwnProperty,E=function(a,i,n){for(var s=0,c=a.length;s=3&&(s=n),x.call(a)==="[object Array]"?E(a,i,s):typeof a=="string"?e(a,i,s):t(a,i,s)};G.exports=r}}),$w=He({"node_modules/available-typed-arrays/index.js"(Y,G){var d=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],x=typeof globalThis>"u"?window:globalThis;G.exports=function(){for(var E=[],e=0;e"u"?window:globalThis,a=x(),i=E("String.prototype.slice"),n=Object.getPrototypeOf,s=E("Array.prototype.indexOf",!0)||function(T,l){for(var y=0;y-1?l:l!=="Object"?!1:v(T)}return e?f(T):null}}}),mk=He({"node_modules/is-typed-array/index.js"(Y,G){var d=Jw(),x=$w(),A=Q0(),E=A("Object.prototype.toString"),e=dy()(),t=gy(),r=typeof globalThis>"u"?window:globalThis,o=x(),a=A("Array.prototype.indexOf",!0)||function(v,h){for(var T=0;T-1}return t?c(v):!1}}}),Qw=He({"node_modules/util/support/types.js"(Y){var G=dk(),d=pk(),x=yk(),A=mk();function E(Ae){return Ae.call.bind(Ae)}var e=typeof BigInt<"u",t=typeof Symbol<"u",r=E(Object.prototype.toString),o=E(Number.prototype.valueOf),a=E(String.prototype.valueOf),i=E(Boolean.prototype.valueOf);e&&(n=E(BigInt.prototype.valueOf));var n;t&&(s=E(Symbol.prototype.valueOf));var s;function c(Ae,Fe){if(typeof Ae!="object")return!1;try{return Fe(Ae),!0}catch{return!1}}Y.isArgumentsObject=G,Y.isGeneratorFunction=d,Y.isTypedArray=A;function f(Ae){return typeof Promise<"u"&&Ae instanceof Promise||Ae!==null&&typeof Ae=="object"&&typeof Ae.then=="function"&&typeof Ae.catch=="function"}Y.isPromise=f;function v(Ae){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(Ae):A(Ae)||Z(Ae)}Y.isArrayBufferView=v;function h(Ae){return x(Ae)==="Uint8Array"}Y.isUint8Array=h;function T(Ae){return x(Ae)==="Uint8ClampedArray"}Y.isUint8ClampedArray=T;function l(Ae){return x(Ae)==="Uint16Array"}Y.isUint16Array=l;function y(Ae){return x(Ae)==="Uint32Array"}Y.isUint32Array=y;function b(Ae){return x(Ae)==="Int8Array"}Y.isInt8Array=b;function S(Ae){return x(Ae)==="Int16Array"}Y.isInt16Array=S;function M(Ae){return x(Ae)==="Int32Array"}Y.isInt32Array=M;function _(Ae){return x(Ae)==="Float32Array"}Y.isFloat32Array=_;function w(Ae){return x(Ae)==="Float64Array"}Y.isFloat64Array=w;function p(Ae){return x(Ae)==="BigInt64Array"}Y.isBigInt64Array=p;function u(Ae){return x(Ae)==="BigUint64Array"}Y.isBigUint64Array=u;function g(Ae){return r(Ae)==="[object Map]"}g.working=typeof Map<"u"&&g(new Map);function m(Ae){return typeof Map>"u"?!1:g.working?g(Ae):Ae instanceof Map}Y.isMap=m;function R(Ae){return r(Ae)==="[object Set]"}R.working=typeof Set<"u"&&R(new Set);function P(Ae){return typeof Set>"u"?!1:R.working?R(Ae):Ae instanceof Set}Y.isSet=P;function z(Ae){return r(Ae)==="[object WeakMap]"}z.working=typeof WeakMap<"u"&&z(new WeakMap);function F(Ae){return typeof WeakMap>"u"?!1:z.working?z(Ae):Ae instanceof WeakMap}Y.isWeakMap=F;function B(Ae){return r(Ae)==="[object WeakSet]"}B.working=typeof WeakSet<"u"&&B(new WeakSet);function O(Ae){return B(Ae)}Y.isWeakSet=O;function L(Ae){return r(Ae)==="[object ArrayBuffer]"}L.working=typeof ArrayBuffer<"u"&&L(new ArrayBuffer);function N(Ae){return typeof ArrayBuffer>"u"?!1:L.working?L(Ae):Ae instanceof ArrayBuffer}Y.isArrayBuffer=N;function U(Ae){return r(Ae)==="[object DataView]"}U.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&U(new DataView(new ArrayBuffer(1),0,1));function Z(Ae){return typeof DataView>"u"?!1:U.working?U(Ae):Ae instanceof DataView}Y.isDataView=Z;var Q=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function ue(Ae){return r(Ae)==="[object SharedArrayBuffer]"}function oe(Ae){return typeof Q>"u"?!1:(typeof ue.working>"u"&&(ue.working=ue(new Q)),ue.working?ue(Ae):Ae instanceof Q)}Y.isSharedArrayBuffer=oe;function le(Ae){return r(Ae)==="[object AsyncFunction]"}Y.isAsyncFunction=le;function j(Ae){return r(Ae)==="[object Map Iterator]"}Y.isMapIterator=j;function J(Ae){return r(Ae)==="[object Set Iterator]"}Y.isSetIterator=J;function $(Ae){return r(Ae)==="[object Generator]"}Y.isGeneratorObject=$;function X(Ae){return r(Ae)==="[object WebAssembly.Module]"}Y.isWebAssemblyCompiledModule=X;function re(Ae){return c(Ae,o)}Y.isNumberObject=re;function ee(Ae){return c(Ae,a)}Y.isStringObject=ee;function q(Ae){return c(Ae,i)}Y.isBooleanObject=q;function ae(Ae){return e&&c(Ae,n)}Y.isBigIntObject=ae;function ie(Ae){return t&&c(Ae,s)}Y.isSymbolObject=ie;function fe(Ae){return re(Ae)||ee(Ae)||q(Ae)||ae(Ae)||ie(Ae)}Y.isBoxedPrimitive=fe;function we(Ae){return typeof Uint8Array<"u"&&(N(Ae)||oe(Ae))}Y.isAnyArrayBuffer=we,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(Ae){Object.defineProperty(Y,Ae,{enumerable:!1,value:function(){throw new Error(Ae+" is not supported in userland")}})})}}),e2=He({"node_modules/util/support/isBufferBrowser.js"(Y,G){G.exports=function(x){return x&&typeof x=="object"&&typeof x.copy=="function"&&typeof x.fill=="function"&&typeof x.readUInt8=="function"}}}),t2=He({"(disabled):node_modules/util/util.js"(Y){var G=Object.getOwnPropertyDescriptors||function(Z){for(var Q=Object.keys(Z),ue={},oe=0;oe=oe)return J;switch(J){case"%s":return String(ue[Q++]);case"%d":return Number(ue[Q++]);case"%j":try{return JSON.stringify(ue[Q++])}catch{return"[Circular]"}default:return J}}),j=ue[Q];Q"u")return function(){return Y.deprecate(U,Z).apply(this,arguments)};var Q=!1;function ue(){if(!Q){if(process.throwDeprecation)throw new Error(Z);process.traceDeprecation?console.trace(Z):console.error(Z),Q=!0}return U.apply(this,arguments)}return ue};var x={},A=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),A=new RegExp("^"+E+"$","i");var E;Y.debuglog=function(U){if(U=U.toUpperCase(),!x[U])if(A.test(U)){var Z=process.pid;x[U]=function(){var Q=Y.format.apply(Y,arguments);console.error("%s %d: %s",U,Z,Q)}}else x[U]=function(){};return x[U]};function e(U,Z){var Q={seen:[],stylize:r};return arguments.length>=3&&(Q.depth=arguments[2]),arguments.length>=4&&(Q.colors=arguments[3]),h(Z)?Q.showHidden=Z:Z&&Y._extend(Q,Z),M(Q.showHidden)&&(Q.showHidden=!1),M(Q.depth)&&(Q.depth=2),M(Q.colors)&&(Q.colors=!1),M(Q.customInspect)&&(Q.customInspect=!0),Q.colors&&(Q.stylize=t),a(Q,U,Q.depth)}Y.inspect=e,e.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]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(U,Z){var Q=e.styles[Z];return Q?"\x1B["+e.colors[Q][0]+"m"+U+"\x1B["+e.colors[Q][1]+"m":U}function r(U,Z){return U}function o(U){var Z={};return U.forEach(function(Q,ue){Z[Q]=!0}),Z}function a(U,Z,Q){if(U.customInspect&&Z&&g(Z.inspect)&&Z.inspect!==Y.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var ue=Z.inspect(Q,U);return b(ue)||(ue=a(U,ue,Q)),ue}var oe=i(U,Z);if(oe)return oe;var le=Object.keys(Z),j=o(le);if(U.showHidden&&(le=Object.getOwnPropertyNames(Z)),u(Z)&&(le.indexOf("message")>=0||le.indexOf("description")>=0))return n(Z);if(le.length===0){if(g(Z)){var J=Z.name?": "+Z.name:"";return U.stylize("[Function"+J+"]","special")}if(_(Z))return U.stylize(RegExp.prototype.toString.call(Z),"regexp");if(p(Z))return U.stylize(Date.prototype.toString.call(Z),"date");if(u(Z))return n(Z)}var $="",X=!1,re=["{","}"];if(v(Z)&&(X=!0,re=["[","]"]),g(Z)){var ee=Z.name?": "+Z.name:"";$=" [Function"+ee+"]"}if(_(Z)&&($=" "+RegExp.prototype.toString.call(Z)),p(Z)&&($=" "+Date.prototype.toUTCString.call(Z)),u(Z)&&($=" "+n(Z)),le.length===0&&(!X||Z.length==0))return re[0]+$+re[1];if(Q<0)return _(Z)?U.stylize(RegExp.prototype.toString.call(Z),"regexp"):U.stylize("[Object]","special");U.seen.push(Z);var q;return X?q=s(U,Z,Q,j,le):q=le.map(function(ae){return c(U,Z,Q,j,ae,X)}),U.seen.pop(),f(q,$,re)}function i(U,Z){if(M(Z))return U.stylize("undefined","undefined");if(b(Z)){var Q="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize(Q,"string")}if(y(Z))return U.stylize(""+Z,"number");if(h(Z))return U.stylize(""+Z,"boolean");if(T(Z))return U.stylize("null","null")}function n(U){return"["+Error.prototype.toString.call(U)+"]"}function s(U,Z,Q,ue,oe){for(var le=[],j=0,J=Z.length;j-1&&(le?J=J.split(` +`).map(function(X){return" "+X}).join(` +`).slice(2):J=` +`+J.split(` +`).map(function(X){return" "+X}).join(` +`))):J=U.stylize("[Circular]","special")),M(j)){if(le&&oe.match(/^\d+$/))return J;j=JSON.stringify(""+oe),j.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(j=j.slice(1,-1),j=U.stylize(j,"name")):(j=j.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),j=U.stylize(j,"string"))}return j+": "+J}function f(U,Z,Q){var ue=U.reduce(function(oe,le){return le.indexOf(` +`)>=0,oe+le.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ue>60?Q[0]+(Z===""?"":Z+` + `)+" "+U.join(`, + `)+" "+Q[1]:Q[0]+Z+" "+U.join(", ")+" "+Q[1]}Y.types=Qw();function v(U){return Array.isArray(U)}Y.isArray=v;function h(U){return typeof U=="boolean"}Y.isBoolean=h;function T(U){return U===null}Y.isNull=T;function l(U){return U==null}Y.isNullOrUndefined=l;function y(U){return typeof U=="number"}Y.isNumber=y;function b(U){return typeof U=="string"}Y.isString=b;function S(U){return typeof U=="symbol"}Y.isSymbol=S;function M(U){return U===void 0}Y.isUndefined=M;function _(U){return w(U)&&R(U)==="[object RegExp]"}Y.isRegExp=_,Y.types.isRegExp=_;function w(U){return typeof U=="object"&&U!==null}Y.isObject=w;function p(U){return w(U)&&R(U)==="[object Date]"}Y.isDate=p,Y.types.isDate=p;function u(U){return w(U)&&(R(U)==="[object Error]"||U instanceof Error)}Y.isError=u,Y.types.isNativeError=u;function g(U){return typeof U=="function"}Y.isFunction=g;function m(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Y.isPrimitive=m,Y.isBuffer=e2();function R(U){return Object.prototype.toString.call(U)}function P(U){return U<10?"0"+U.toString(10):U.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var U=new Date,Z=[P(U.getHours()),P(U.getMinutes()),P(U.getSeconds())].join(":");return[U.getDate(),z[U.getMonth()],Z].join(" ")}Y.log=function(){console.log("%s - %s",F(),Y.format.apply(Y,arguments))},Y.inherits=od(),Y._extend=function(U,Z){if(!Z||!w(Z))return U;for(var Q=Object.keys(Z),ue=Q.length;ue--;)U[Q[ue]]=Z[Q[ue]];return U};function B(U,Z){return Object.prototype.hasOwnProperty.call(U,Z)}var O=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Y.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if(O&&Z[O]){var Q=Z[O];if(typeof Q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Q}function Q(){for(var ue,oe,le=new Promise(function($,X){ue=$,oe=X}),j=[],J=0;J0?this.tail.next=h:this.head=h,this.tail=h,++this.length}},{key:"unshift",value:function(v){var h={data:v,next:this.head};this.length===0&&(this.tail=h),this.head=h,++this.length}},{key:"shift",value:function(){if(this.length!==0){var v=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,v}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(v){if(this.length===0)return"";for(var h=this.head,T=""+h.data;h=h.next;)T+=v+h.data;return T}},{key:"concat",value:function(v){if(this.length===0)return o.alloc(0);for(var h=o.allocUnsafe(v>>>0),T=this.head,l=0;T;)s(T.data,h,l),l+=T.data.length,T=T.next;return h}},{key:"consume",value:function(v,h){var T;return vy.length?y.length:v;if(b===y.length?l+=y:l+=y.slice(0,v),v-=b,v===0){b===y.length?(++T,h.next?this.head=h.next:this.head=this.tail=null):(this.head=h,h.data=y.slice(b));break}++T}return this.length-=T,l}},{key:"_getBuffer",value:function(v){var h=o.allocUnsafe(v),T=this.head,l=1;for(T.data.copy(h),v-=T.data.length;T=T.next;){var y=T.data,b=v>y.length?y.length:v;if(y.copy(h,h.length-v,0,b),v-=b,v===0){b===y.length?(++l,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=y.slice(b));break}++l}return this.length-=l,h}},{key:n,value:function(v,h){return i(this,x({},h,{depth:0,customInspect:!1}))}}]),c}()}}),r2=He({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"(Y,G){function d(r,o){var a=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(o?o(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(e,this,r)):process.nextTick(e,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(s){!o&&s?a._writableState?a._writableState.errorEmitted?process.nextTick(A,a):(a._writableState.errorEmitted=!0,process.nextTick(x,a,s)):process.nextTick(x,a,s):o?(process.nextTick(A,a),o(s)):process.nextTick(A,a)}),this)}function x(r,o){e(r,o),A(r)}function A(r){r._writableState&&!r._writableState.emitClose||r._readableState&&!r._readableState.emitClose||r.emit("close")}function E(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function e(r,o){r.emit("error",o)}function t(r,o){var a=r._readableState,i=r._writableState;a&&a.autoDestroy||i&&i.autoDestroy?r.destroy(o):r.emit("error",o)}G.exports={destroy:d,undestroy:E,errorOrDestroy:t}}}),Fp=He({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"(Y,G){function d(o,a){o.prototype=Object.create(a.prototype),o.prototype.constructor=o,o.__proto__=a}var x={};function A(o,a,i){i||(i=Error);function n(c,f,v){return typeof a=="string"?a:a(c,f,v)}var s=function(c){d(f,c);function f(v,h,T){return c.call(this,n(v,h,T))||this}return f}(i);s.prototype.name=i.name,s.prototype.code=o,x[o]=s}function E(o,a){if(Array.isArray(o)){var i=o.length;return o=o.map(function(n){return String(n)}),i>2?"one of ".concat(a," ").concat(o.slice(0,i-1).join(", "),", or ")+o[i-1]:i===2?"one of ".concat(a," ").concat(o[0]," or ").concat(o[1]):"of ".concat(a," ").concat(o[0])}else return"of ".concat(a," ").concat(String(o))}function e(o,a,i){return o.substr(0,a.length)===a}function t(o,a,i){return(i===void 0||i>o.length)&&(i=o.length),o.substring(i-a.length,i)===a}function r(o,a,i){return typeof i!="number"&&(i=0),i+a.length>o.length?!1:o.indexOf(a,i)!==-1}A("ERR_INVALID_OPT_VALUE",function(o,a){return'The value "'+a+'" is invalid for option "'+o+'"'},TypeError),A("ERR_INVALID_ARG_TYPE",function(o,a,i){var n;typeof a=="string"&&e(a,"not ")?(n="must not be",a=a.replace(/^not /,"")):n="must be";var s;if(t(o," argument"))s="The ".concat(o," ").concat(n," ").concat(E(a,"type"));else{var c=r(o,".")?"property":"argument";s='The "'.concat(o,'" ').concat(c," ").concat(n," ").concat(E(a,"type"))}return s+=". Received type ".concat(typeof i),s},TypeError),A("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),A("ERR_METHOD_NOT_IMPLEMENTED",function(o){return"The "+o+" method is not implemented"}),A("ERR_STREAM_PREMATURE_CLOSE","Premature close"),A("ERR_STREAM_DESTROYED",function(o){return"Cannot call "+o+" 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(o){return"Unknown encoding: "+o},TypeError),A("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),G.exports.codes=x}}),a2=He({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(Y,G){var d=Fp().codes.ERR_INVALID_OPT_VALUE;function x(E,e,t){return E.highWaterMark!=null?E.highWaterMark:e?E[t]:null}function A(E,e,t,r){var o=x(e,r,t);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var a=r?t:"highWaterMark";throw new d(a,o)}return Math.floor(o)}return E.objectMode?16:16*1024}G.exports={getHighWaterMark:A}}}),xk=He({"node_modules/util-deprecate/browser.js"(Y,G){G.exports=d;function d(A,E){if(x("noDeprecation"))return A;var e=!1;function t(){if(!e){if(x("throwDeprecation"))throw new Error(E);x("traceDeprecation")?console.trace(E):console.warn(E),e=!0}return A.apply(this,arguments)}return t}function x(A){try{if(!window.localStorage)return!1}catch{return!1}var E=window.localStorage[A];return E==null?!1:String(E).toLowerCase()==="true"}}}),n2=He({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(Y,G){G.exports=p;function d(j){var J=this;this.next=null,this.entry=null,this.finish=function(){le(J,j)}}var x;p.WritableState=_;var A={deprecate:xk()},E=Xw(),e=zp().Buffer,t=window.Uint8Array||function(){};function r(j){return e.from(j)}function o(j){return e.isBuffer(j)||j instanceof t}var a=r2(),i=a2(),n=i.getHighWaterMark,s=Fp().codes,c=s.ERR_INVALID_ARG_TYPE,f=s.ERR_METHOD_NOT_IMPLEMENTED,v=s.ERR_MULTIPLE_CALLBACK,h=s.ERR_STREAM_CANNOT_PIPE,T=s.ERR_STREAM_DESTROYED,l=s.ERR_STREAM_NULL_VALUES,y=s.ERR_STREAM_WRITE_AFTER_END,b=s.ERR_UNKNOWN_ENCODING,S=a.errorOrDestroy;od()(p,E);function M(){}function _(j,J,$){x=x||Op(),j=j||{},typeof $!="boolean"&&($=J instanceof x),this.objectMode=!!j.objectMode,$&&(this.objectMode=this.objectMode||!!j.writableObjectMode),this.highWaterMark=n(this,j,"writableHighWaterMark",$),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var X=j.decodeStrings===!1;this.decodeStrings=!X,this.defaultEncoding=j.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(re){B(J,re)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=j.emitClose!==!1,this.autoDestroy=!!j.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}_.prototype.getBuffer=function(){for(var J=this.bufferedRequest,$=[];J;)$.push(J),J=J.next;return $},function(){try{Object.defineProperty(_.prototype,"buffer",{get:A.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var w;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(w=Function.prototype[Symbol.hasInstance],Object.defineProperty(p,Symbol.hasInstance,{value:function(J){return w.call(this,J)?!0:this!==p?!1:J&&J._writableState instanceof _}})):w=function(J){return J instanceof this};function p(j){x=x||Op();var J=this instanceof x;if(!J&&!w.call(p,this))return new p(j);this._writableState=new _(j,this,J),this.writable=!0,j&&(typeof j.write=="function"&&(this._write=j.write),typeof j.writev=="function"&&(this._writev=j.writev),typeof j.destroy=="function"&&(this._destroy=j.destroy),typeof j.final=="function"&&(this._final=j.final)),E.call(this)}p.prototype.pipe=function(){S(this,new h)};function u(j,J){var $=new y;S(j,$),process.nextTick(J,$)}function g(j,J,$,X){var re;return $===null?re=new l:typeof $!="string"&&!J.objectMode&&(re=new c("chunk",["string","Buffer"],$)),re?(S(j,re),process.nextTick(X,re),!1):!0}p.prototype.write=function(j,J,$){var X=this._writableState,re=!1,ee=!X.objectMode&&o(j);return ee&&!e.isBuffer(j)&&(j=r(j)),typeof J=="function"&&($=J,J=null),ee?J="buffer":J||(J=X.defaultEncoding),typeof $!="function"&&($=M),X.ending?u(this,$):(ee||g(this,X,j,$))&&(X.pendingcb++,re=R(this,X,ee,j,J,$)),re},p.prototype.cork=function(){this._writableState.corked++},p.prototype.uncork=function(){var j=this._writableState;j.corked&&(j.corked--,!j.writing&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&N(this,j))},p.prototype.setDefaultEncoding=function(J){if(typeof J=="string"&&(J=J.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((J+"").toLowerCase())>-1))throw new b(J);return this._writableState.defaultEncoding=J,this},Object.defineProperty(p.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function m(j,J,$){return!j.objectMode&&j.decodeStrings!==!1&&typeof J=="string"&&(J=e.from(J,$)),J}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function R(j,J,$,X,re,ee){if(!$){var q=m(J,X,re);X!==q&&($=!0,re="buffer",X=q)}var ae=J.objectMode?1:X.length;J.length+=ae;var ie=J.length>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function t(T,l,y){var b=l.length-1;if(b=0?(S>0&&(T.lastNeed=S-1),S):--b=0?(S>0&&(T.lastNeed=S-2),S):--b=0?(S>0&&(S===2?S=0:T.lastNeed=S-3),S):0))}function r(T,l,y){if((l[0]&192)!==128)return T.lastNeed=0,"�";if(T.lastNeed>1&&l.length>1){if((l[1]&192)!==128)return T.lastNeed=1,"�";if(T.lastNeed>2&&l.length>2&&(l[2]&192)!==128)return T.lastNeed=2,"�"}}function o(T){var l=this.lastTotal-this.lastNeed,y=r(this,T);if(y!==void 0)return y;if(this.lastNeed<=T.length)return T.copy(this.lastChar,l,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,l,0,T.length),this.lastNeed-=T.length}function a(T,l){var y=t(this,T,l);if(!this.lastNeed)return T.toString("utf8",l);this.lastTotal=y;var b=T.length-(y-this.lastNeed);return T.copy(this.lastChar,0,b),T.toString("utf8",l,b)}function i(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+"�":l}function n(T,l){if((T.length-l)%2===0){var y=T.toString("utf16le",l);if(y){var b=y.charCodeAt(y.length-1);if(b>=55296&&b<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],y.slice(0,-1)}return y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",l,T.length-1)}function s(T){var l=T&&T.length?this.write(T):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return l+this.lastChar.toString("utf16le",0,y)}return l}function c(T,l){var y=(T.length-l)%3;return y===0?T.toString("base64",l):(this.lastNeed=3-y,this.lastTotal=3,y===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",l,T.length-y))}function f(T){var l=T&&T.length?this.write(T):"";return this.lastNeed?l+this.lastChar.toString("base64",0,3-this.lastNeed):l}function v(T){return T.toString(this.encoding)}function h(T){return T&&T.length?this.write(T):""}}}),Q1=He({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(Y,G){var d=Fp().codes.ERR_STREAM_PREMATURE_CLOSE;function x(t){var r=!1;return function(){if(!r){r=!0;for(var o=arguments.length,a=new Array(o),i=0;i0)if(typeof q!="string"&&!we.objectMode&&Object.getPrototypeOf(q)!==E.prototype&&(q=t(q)),ie)we.endEmitted?M(ee,new l):m(ee,we,q,!0);else if(we.ended)M(ee,new h);else{if(we.destroyed)return!1;we.reading=!1,we.decoder&&!ae?(q=we.decoder.write(q),we.objectMode||q.length!==0?m(ee,we,q,!1):N(ee,we)):m(ee,we,q,!1)}else ie||(we.reading=!1,N(ee,we))}return!we.ended&&(we.length=P?ee=P:(ee--,ee|=ee>>>1,ee|=ee>>>2,ee|=ee>>>4,ee|=ee>>>8,ee|=ee>>>16,ee++),ee}function F(ee,q){return ee<=0||q.length===0&&q.ended?0:q.objectMode?1:ee!==ee?q.flowing&&q.length?q.buffer.head.data.length:q.length:(ee>q.highWaterMark&&(q.highWaterMark=z(ee)),ee<=q.length?ee:q.ended?q.length:(q.needReadable=!0,0))}u.prototype.read=function(ee){a("read",ee),ee=parseInt(ee,10);var q=this._readableState,ae=ee;if(ee!==0&&(q.emittedReadable=!1),ee===0&&q.needReadable&&((q.highWaterMark!==0?q.length>=q.highWaterMark:q.length>0)||q.ended))return a("read: emitReadable",q.length,q.ended),q.length===0&&q.ended?$(this):O(this),null;if(ee=F(ee,q),ee===0&&q.ended)return q.length===0&&$(this),null;var ie=q.needReadable;a("need readable",ie),(q.length===0||q.length-ee0?fe=J(ee,q):fe=null,fe===null?(q.needReadable=q.length<=q.highWaterMark,ee=0):(q.length-=ee,q.awaitDrain=0),q.length===0&&(q.ended||(q.needReadable=!0),ae!==ee&&q.ended&&$(this)),fe!==null&&this.emit("data",fe),fe};function B(ee,q){if(a("onEofChunk"),!q.ended){if(q.decoder){var ae=q.decoder.end();ae&&ae.length&&(q.buffer.push(ae),q.length+=q.objectMode?1:ae.length)}q.ended=!0,q.sync?O(ee):(q.needReadable=!1,q.emittedReadable||(q.emittedReadable=!0,L(ee)))}}function O(ee){var q=ee._readableState;a("emitReadable",q.needReadable,q.emittedReadable),q.needReadable=!1,q.emittedReadable||(a("emitReadable",q.flowing),q.emittedReadable=!0,process.nextTick(L,ee))}function L(ee){var q=ee._readableState;a("emitReadable_",q.destroyed,q.length,q.ended),!q.destroyed&&(q.length||q.ended)&&(ee.emit("readable"),q.emittedReadable=!1),q.needReadable=!q.flowing&&!q.ended&&q.length<=q.highWaterMark,j(ee)}function N(ee,q){q.readingMore||(q.readingMore=!0,process.nextTick(U,ee,q))}function U(ee,q){for(;!q.reading&&!q.ended&&(q.length1&&re(ie.pipes,ee)!==-1)&&!qe&&(a("false write response, pause",ie.awaitDrain),ie.awaitDrain++),ae.pause())}function Ke(ce){a("onerror",ce),xe(),ee.removeListener("error",Ke),x(ee,"error")===0&&M(ee,ce)}w(ee,"error",Ke);function Xe(){ee.removeListener("finish",Me),xe()}ee.once("close",Xe);function Me(){a("onfinish"),ee.removeListener("close",Xe),xe()}ee.once("finish",Me);function xe(){a("unpipe"),ae.unpipe(ee)}return ee.emit("pipe",ae),ie.flowing||(a("pipe resume"),ae.resume()),ee};function Z(ee){return function(){var ae=ee._readableState;a("pipeOnDrain",ae.awaitDrain),ae.awaitDrain&&ae.awaitDrain--,ae.awaitDrain===0&&x(ee,"data")&&(ae.flowing=!0,j(ee))}}u.prototype.unpipe=function(ee){var q=this._readableState,ae={hasUnpiped:!1};if(q.pipesCount===0)return this;if(q.pipesCount===1)return ee&&ee!==q.pipes?this:(ee||(ee=q.pipes),q.pipes=null,q.pipesCount=0,q.flowing=!1,ee&&ee.emit("unpipe",this,ae),this);if(!ee){var ie=q.pipes,fe=q.pipesCount;q.pipes=null,q.pipesCount=0,q.flowing=!1;for(var we=0;we0,ie.flowing!==!1&&this.resume()):ee==="readable"&&!ie.endEmitted&&!ie.readableListening&&(ie.readableListening=ie.needReadable=!0,ie.flowing=!1,ie.emittedReadable=!1,a("on readable",ie.length,ie.reading),ie.length?O(this):ie.reading||process.nextTick(ue,this)),ae},u.prototype.addListener=u.prototype.on,u.prototype.removeListener=function(ee,q){var ae=A.prototype.removeListener.call(this,ee,q);return ee==="readable"&&process.nextTick(Q,this),ae},u.prototype.removeAllListeners=function(ee){var q=A.prototype.removeAllListeners.apply(this,arguments);return(ee==="readable"||ee===void 0)&&process.nextTick(Q,this),q};function Q(ee){var q=ee._readableState;q.readableListening=ee.listenerCount("readable")>0,q.resumeScheduled&&!q.paused?q.flowing=!0:ee.listenerCount("data")>0&&ee.resume()}function ue(ee){a("readable nexttick read 0"),ee.read(0)}u.prototype.resume=function(){var ee=this._readableState;return ee.flowing||(a("resume"),ee.flowing=!ee.readableListening,oe(this,ee)),ee.paused=!1,this};function oe(ee,q){q.resumeScheduled||(q.resumeScheduled=!0,process.nextTick(le,ee,q))}function le(ee,q){a("resume",q.reading),q.reading||ee.read(0),q.resumeScheduled=!1,ee.emit("resume"),j(ee),q.flowing&&!q.reading&&ee.read(0)}u.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function j(ee){var q=ee._readableState;for(a("flow",q.flowing);q.flowing&&ee.read()!==null;);}u.prototype.wrap=function(ee){var q=this,ae=this._readableState,ie=!1;ee.on("end",function(){if(a("wrapped end"),ae.decoder&&!ae.ended){var Ae=ae.decoder.end();Ae&&Ae.length&&q.push(Ae)}q.push(null)}),ee.on("data",function(Ae){if(a("wrapped data"),ae.decoder&&(Ae=ae.decoder.write(Ae)),!(ae.objectMode&&Ae==null)&&!(!ae.objectMode&&(!Ae||!Ae.length))){var Fe=q.push(Ae);Fe||(ie=!0,ee.pause())}});for(var fe in ee)this[fe]===void 0&&typeof ee[fe]=="function"&&(this[fe]=function(Fe){return function(){return ee[Fe].apply(ee,arguments)}}(fe));for(var we=0;we<_.length;we++)ee.on(_[we],this.emit.bind(this,_[we]));return this._read=function(Ae){a("wrapped _read",Ae),ie&&(ie=!1,ee.resume())},this},typeof Symbol=="function"&&(u.prototype[Symbol.asyncIterator]=function(){return b===void 0&&(b=wk()),b(this)}),Object.defineProperty(u.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(u.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(u.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(q){this._readableState&&(this._readableState.flowing=q)}}),u._fromList=J,Object.defineProperty(u.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function J(ee,q){if(q.length===0)return null;var ae;return q.objectMode?ae=q.buffer.shift():!ee||ee>=q.length?(q.decoder?ae=q.buffer.join(""):q.buffer.length===1?ae=q.buffer.first():ae=q.buffer.concat(q.length),q.buffer.clear()):ae=q.buffer.consume(ee,q.decoder),ae}function $(ee){var q=ee._readableState;a("endReadable",q.endEmitted),q.endEmitted||(q.ended=!0,process.nextTick(X,q,ee))}function X(ee,q){if(a("endReadableNT",ee.endEmitted,ee.length),!ee.endEmitted&&ee.length===0&&(ee.endEmitted=!0,q.readable=!1,q.emit("end"),ee.autoDestroy)){var ae=q._writableState;(!ae||ae.autoDestroy&&ae.finished)&&q.destroy()}}typeof Symbol=="function"&&(u.from=function(ee,q){return S===void 0&&(S=Tk()),S(u,ee,q)});function re(ee,q){for(var ae=0,ie=ee.length;ae0;return o(y,S,M,function(_){T||(T=_),_&&l.forEach(a),!S&&(l.forEach(a),h(T))})});return f.reduce(i)}G.exports=s}}),Mk=He({"node_modules/stream-browserify/index.js"(Y,G){G.exports=A;var d=Mp().EventEmitter,x=od();x(A,d),A.Readable=o2(),A.Writable=n2(),A.Duplex=Op(),A.Transform=s2(),A.PassThrough=Ak(),A.finished=Q1(),A.pipeline=Sk(),A.Stream=A;function A(){d.call(this)}A.prototype.pipe=function(E,e){var t=this;function r(f){E.writable&&E.write(f)===!1&&t.pause&&t.pause()}t.on("data",r);function o(){t.readable&&t.resume&&t.resume()}E.on("drain",o),!E._isStdio&&(!e||e.end!==!1)&&(t.on("end",i),t.on("close",n));var a=!1;function i(){a||(a=!0,E.end())}function n(){a||(a=!0,typeof E.destroy=="function"&&E.destroy())}function s(f){if(c(),d.listenerCount(this,"error")===0)throw f}t.on("error",s),E.on("error",s);function c(){t.removeListener("data",r),E.removeListener("drain",o),t.removeListener("end",i),t.removeListener("close",n),t.removeListener("error",s),E.removeListener("error",s),t.removeListener("end",c),t.removeListener("close",c),E.removeListener("close",c)}return t.on("end",c),t.on("close",c),E.on("close",c),E.emit("pipe",t),E}}}),eg=He({"node_modules/util/util.js"(Y){var G=Object.getOwnPropertyDescriptors||function(Z){for(var Q=Object.keys(Z),ue={},oe=0;oe=oe)return J;switch(J){case"%s":return String(ue[Q++]);case"%d":return Number(ue[Q++]);case"%j":try{return JSON.stringify(ue[Q++])}catch{return"[Circular]"}default:return J}}),j=ue[Q];Q"u")return function(){return Y.deprecate(U,Z).apply(this,arguments)};var Q=!1;function ue(){if(!Q){if(process.throwDeprecation)throw new Error(Z);process.traceDeprecation?console.trace(Z):console.error(Z),Q=!0}return U.apply(this,arguments)}return ue};var x={},A=/^$/;E="false",E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),A=new RegExp("^"+E+"$","i");var E;Y.debuglog=function(U){if(U=U.toUpperCase(),!x[U])if(A.test(U)){var Z=process.pid;x[U]=function(){var Q=Y.format.apply(Y,arguments);console.error("%s %d: %s",U,Z,Q)}}else x[U]=function(){};return x[U]};function e(U,Z){var Q={seen:[],stylize:r};return arguments.length>=3&&(Q.depth=arguments[2]),arguments.length>=4&&(Q.colors=arguments[3]),h(Z)?Q.showHidden=Z:Z&&Y._extend(Q,Z),M(Q.showHidden)&&(Q.showHidden=!1),M(Q.depth)&&(Q.depth=2),M(Q.colors)&&(Q.colors=!1),M(Q.customInspect)&&(Q.customInspect=!0),Q.colors&&(Q.stylize=t),a(Q,U,Q.depth)}Y.inspect=e,e.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]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function t(U,Z){var Q=e.styles[Z];return Q?"\x1B["+e.colors[Q][0]+"m"+U+"\x1B["+e.colors[Q][1]+"m":U}function r(U,Z){return U}function o(U){var Z={};return U.forEach(function(Q,ue){Z[Q]=!0}),Z}function a(U,Z,Q){if(U.customInspect&&Z&&g(Z.inspect)&&Z.inspect!==Y.inspect&&!(Z.constructor&&Z.constructor.prototype===Z)){var ue=Z.inspect(Q,U);return b(ue)||(ue=a(U,ue,Q)),ue}var oe=i(U,Z);if(oe)return oe;var le=Object.keys(Z),j=o(le);if(U.showHidden&&(le=Object.getOwnPropertyNames(Z)),u(Z)&&(le.indexOf("message")>=0||le.indexOf("description")>=0))return n(Z);if(le.length===0){if(g(Z)){var J=Z.name?": "+Z.name:"";return U.stylize("[Function"+J+"]","special")}if(_(Z))return U.stylize(RegExp.prototype.toString.call(Z),"regexp");if(p(Z))return U.stylize(Date.prototype.toString.call(Z),"date");if(u(Z))return n(Z)}var $="",X=!1,re=["{","}"];if(v(Z)&&(X=!0,re=["[","]"]),g(Z)){var ee=Z.name?": "+Z.name:"";$=" [Function"+ee+"]"}if(_(Z)&&($=" "+RegExp.prototype.toString.call(Z)),p(Z)&&($=" "+Date.prototype.toUTCString.call(Z)),u(Z)&&($=" "+n(Z)),le.length===0&&(!X||Z.length==0))return re[0]+$+re[1];if(Q<0)return _(Z)?U.stylize(RegExp.prototype.toString.call(Z),"regexp"):U.stylize("[Object]","special");U.seen.push(Z);var q;return X?q=s(U,Z,Q,j,le):q=le.map(function(ae){return c(U,Z,Q,j,ae,X)}),U.seen.pop(),f(q,$,re)}function i(U,Z){if(M(Z))return U.stylize("undefined","undefined");if(b(Z)){var Q="'"+JSON.stringify(Z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize(Q,"string")}if(y(Z))return U.stylize(""+Z,"number");if(h(Z))return U.stylize(""+Z,"boolean");if(T(Z))return U.stylize("null","null")}function n(U){return"["+Error.prototype.toString.call(U)+"]"}function s(U,Z,Q,ue,oe){for(var le=[],j=0,J=Z.length;j-1&&(le?J=J.split(` +`).map(function(X){return" "+X}).join(` +`).slice(2):J=` +`+J.split(` +`).map(function(X){return" "+X}).join(` +`))):J=U.stylize("[Circular]","special")),M(j)){if(le&&oe.match(/^\d+$/))return J;j=JSON.stringify(""+oe),j.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(j=j.slice(1,-1),j=U.stylize(j,"name")):(j=j.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),j=U.stylize(j,"string"))}return j+": "+J}function f(U,Z,Q){var ue=U.reduce(function(oe,le){return le.indexOf(` +`)>=0,oe+le.replace(/\u001b\[\d\d?m/g,"").length+1},0);return ue>60?Q[0]+(Z===""?"":Z+` + `)+" "+U.join(`, + `)+" "+Q[1]:Q[0]+Z+" "+U.join(", ")+" "+Q[1]}Y.types=Qw();function v(U){return Array.isArray(U)}Y.isArray=v;function h(U){return typeof U=="boolean"}Y.isBoolean=h;function T(U){return U===null}Y.isNull=T;function l(U){return U==null}Y.isNullOrUndefined=l;function y(U){return typeof U=="number"}Y.isNumber=y;function b(U){return typeof U=="string"}Y.isString=b;function S(U){return typeof U=="symbol"}Y.isSymbol=S;function M(U){return U===void 0}Y.isUndefined=M;function _(U){return w(U)&&R(U)==="[object RegExp]"}Y.isRegExp=_,Y.types.isRegExp=_;function w(U){return typeof U=="object"&&U!==null}Y.isObject=w;function p(U){return w(U)&&R(U)==="[object Date]"}Y.isDate=p,Y.types.isDate=p;function u(U){return w(U)&&(R(U)==="[object Error]"||U instanceof Error)}Y.isError=u,Y.types.isNativeError=u;function g(U){return typeof U=="function"}Y.isFunction=g;function m(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}Y.isPrimitive=m,Y.isBuffer=e2();function R(U){return Object.prototype.toString.call(U)}function P(U){return U<10?"0"+U.toString(10):U.toString(10)}var z=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function F(){var U=new Date,Z=[P(U.getHours()),P(U.getMinutes()),P(U.getSeconds())].join(":");return[U.getDate(),z[U.getMonth()],Z].join(" ")}Y.log=function(){console.log("%s - %s",F(),Y.format.apply(Y,arguments))},Y.inherits=od(),Y._extend=function(U,Z){if(!Z||!w(Z))return U;for(var Q=Object.keys(Z),ue=Q.length;ue--;)U[Q[ue]]=Z[Q[ue]];return U};function B(U,Z){return Object.prototype.hasOwnProperty.call(U,Z)}var O=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;Y.promisify=function(Z){if(typeof Z!="function")throw new TypeError('The "original" argument must be of type Function');if(O&&Z[O]){var Q=Z[O];if(typeof Q!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Q,O,{value:Q,enumerable:!1,writable:!1,configurable:!0}),Q}function Q(){for(var ue,oe,le=new Promise(function($,X){ue=$,oe=X}),j=[],J=0;J"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function i(y){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},i(y)}var n={},s,c;function f(y,b,S){S||(S=Error);function M(w,p,u){return typeof b=="string"?b:b(w,p,u)}var _=function(w){E(u,w);var p=t(u);function u(g,m,R){var P;return A(this,u),P=p.call(this,M(g,m,R)),P.code=y,P}return x(u)}(S);n[y]=_}function v(y,b){if(Array.isArray(y)){var S=y.length;return y=y.map(function(M){return String(M)}),S>2?"one of ".concat(b," ").concat(y.slice(0,S-1).join(", "),", or ")+y[S-1]:S===2?"one of ".concat(b," ").concat(y[0]," or ").concat(y[1]):"of ".concat(b," ").concat(y[0])}else return"of ".concat(b," ").concat(String(y))}function h(y,b,S){return y.substr(0,b.length)===b}function T(y,b,S){return(S===void 0||S>y.length)&&(S=y.length),y.substring(S-b.length,S)===b}function l(y,b,S){return typeof S!="number"&&(S=0),S+b.length>y.length?!1:y.indexOf(b,S)!==-1}f("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),f("ERR_INVALID_ARG_TYPE",function(y,b,S){s===void 0&&(s=_y()),s(typeof y=="string","'name' must be a string");var M;typeof b=="string"&&h(b,"not ")?(M="must not be",b=b.replace(/^not /,"")):M="must be";var _;if(T(y," argument"))_="The ".concat(y," ").concat(M," ").concat(v(b,"type"));else{var w=l(y,".")?"property":"argument";_='The "'.concat(y,'" ').concat(w," ").concat(M," ").concat(v(b,"type"))}return _+=". Received type ".concat(d(S)),_},TypeError),f("ERR_INVALID_ARG_VALUE",function(y,b){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";c===void 0&&(c=eg());var M=c.inspect(b);return M.length>128&&(M="".concat(M.slice(0,128),"...")),"The argument '".concat(y,"' ").concat(S,". Received ").concat(M)},TypeError),f("ERR_INVALID_RETURN_VALUE",function(y,b,S){var M;return S&&S.constructor&&S.constructor.name?M="instance of ".concat(S.constructor.name):M="type ".concat(d(S)),"Expected ".concat(y,' to be returned from the "').concat(b,'"')+" function but got ".concat(M,".")},TypeError),f("ERR_MISSING_ARGS",function(){for(var y=arguments.length,b=new Array(y),S=0;S0,"At least one arg needs to be specified");var M="The ",_=b.length;switch(b=b.map(function(w){return'"'.concat(w,'"')}),_){case 1:M+="".concat(b[0]," argument");break;case 2:M+="".concat(b[0]," and ").concat(b[1]," arguments");break;default:M+=b.slice(0,_-1).join(", "),M+=", and ".concat(b[_-1]," arguments");break}return"".concat(M," must be specified")},TypeError),G.exports.codes=n}}),Ek=He({"node_modules/assert/build/internal/assert/assertion_error.js"(Y,G){function d(N,U){var Z=Object.keys(N);if(Object.getOwnPropertySymbols){var Q=Object.getOwnPropertySymbols(N);U&&(Q=Q.filter(function(ue){return Object.getOwnPropertyDescriptor(N,ue).enumerable})),Z.push.apply(Z,Q)}return Z}function x(N){for(var U=1;U"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function h(N){return Function.toString.call(N).indexOf("[native code]")!==-1}function T(N,U){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Q,ue){return Q.__proto__=ue,Q},T(N,U)}function l(N){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(Z){return Z.__proto__||Object.getPrototypeOf(Z)},l(N)}function y(N){"@babel/helpers - typeof";return y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(U){return typeof U}:function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},y(N)}var b=eg(),S=b.inspect,M=l2(),_=M.codes.ERR_INVALID_ARG_TYPE;function w(N,U,Z){return(Z===void 0||Z>N.length)&&(Z=N.length),N.substring(Z-U.length,Z)===U}function p(N,U){if(U=Math.floor(U),N.length==0||U==0)return"";var Z=N.length*U;for(U=Math.floor(Math.log(U)/Math.log(2));U;)N+=N,U--;return N+=N.substring(0,Z-N.length),N}var u="",g="",m="",R="",P={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},z=10;function F(N){var U=Object.keys(N),Z=Object.create(Object.getPrototypeOf(N));return U.forEach(function(Q){Z[Q]=N[Q]}),Object.defineProperty(Z,"message",{value:N.message}),Z}function B(N){return S(N,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function O(N,U,Z){var Q="",ue="",oe=0,le="",j=!1,J=B(N),$=J.split(` +`),X=B(U).split(` +`),re=0,ee="";if(Z==="strictEqual"&&y(N)==="object"&&y(U)==="object"&&N!==null&&U!==null&&(Z="strictEqualObject"),$.length===1&&X.length===1&&$[0]!==X[0]){var q=$[0].length+X[0].length;if(q<=z){if((y(N)!=="object"||N===null)&&(y(U)!=="object"||U===null)&&(N!==0||U!==0))return"".concat(P[Z],` + +`)+"".concat($[0]," !== ").concat(X[0],` +`)}else if(Z!=="strictEqualObject"){var ae=process.stderr&&process.stderr.isTTY?process.stderr.columns:80;if(q2&&(ee=` + `.concat(p(" ",re),"^"),re=0)}}}for(var ie=$[$.length-1],fe=X[X.length-1];ie===fe&&(re++<2?le=` + `.concat(ie).concat(le):Q=ie,$.pop(),X.pop(),!($.length===0||X.length===0));)ie=$[$.length-1],fe=X[X.length-1];var we=Math.max($.length,X.length);if(we===0){var Ae=J.split(` +`);if(Ae.length>30)for(Ae[26]="".concat(u,"...").concat(R);Ae.length>27;)Ae.pop();return"".concat(P.notIdentical,` + +`).concat(Ae.join(` +`),` +`)}re>3&&(le=` +`.concat(u,"...").concat(R).concat(le),j=!0),Q!==""&&(le=` + `.concat(Q).concat(le),Q="");var Fe=0,Ce=P[Z]+` +`.concat(g,"+ actual").concat(R," ").concat(m,"- expected").concat(R),qe=" ".concat(u,"...").concat(R," Lines skipped");for(re=0;re1&&re>2&&(et>4?(ue+=` +`.concat(u,"...").concat(R),j=!0):et>3&&(ue+=` + `.concat(X[re-2]),Fe++),ue+=` + `.concat(X[re-1]),Fe++),oe=re,Q+=` +`.concat(m,"-").concat(R," ").concat(X[re]),Fe++;else if(X.length1&&re>2&&(et>4?(ue+=` +`.concat(u,"...").concat(R),j=!0):et>3&&(ue+=` + `.concat($[re-2]),Fe++),ue+=` + `.concat($[re-1]),Fe++),oe=re,ue+=` +`.concat(g,"+").concat(R," ").concat($[re]),Fe++;else{var Qe=X[re],Ke=$[re],Xe=Ke!==Qe&&(!w(Ke,",")||Ke.slice(0,-1)!==Qe);Xe&&w(Qe,",")&&Qe.slice(0,-1)===Ke&&(Xe=!1,Ke+=","),Xe?(et>1&&re>2&&(et>4?(ue+=` +`.concat(u,"...").concat(R),j=!0):et>3&&(ue+=` + `.concat($[re-2]),Fe++),ue+=` + `.concat($[re-1]),Fe++),oe=re,ue+=` +`.concat(g,"+").concat(R," ").concat(Ke),Q+=` +`.concat(m,"-").concat(R," ").concat(Qe),Fe+=2):(ue+=Q,Q="",(et===1||re===0)&&(ue+=` + `.concat(Ke),Fe++))}if(Fe>20&&re30)for(q[26]="".concat(u,"...").concat(R);q.length>27;)q.pop();q.length===1?oe=Z.call(this,"".concat(ee," ").concat(q[0])):oe=Z.call(this,"".concat(ee,` + +`).concat(q.join(` +`),` +`))}else{var ae=B($),ie="",fe=P[j];j==="notDeepEqual"||j==="notEqual"?(ae="".concat(P[j],` + +`).concat(ae),ae.length>1024&&(ae="".concat(ae.slice(0,1021),"..."))):(ie="".concat(B(X)),ae.length>512&&(ae="".concat(ae.slice(0,509),"...")),ie.length>512&&(ie="".concat(ie.slice(0,509),"...")),j==="deepEqual"||j==="equal"?ae="".concat(fe,` + +`).concat(ae,` + +should equal + +`):ie=" ".concat(j," ").concat(ie)),oe=Z.call(this,"".concat(ae).concat(ie))}return Error.stackTraceLimit=re,oe.generatedMessage=!le,Object.defineProperty(s(oe),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),oe.code="ERR_ASSERTION",oe.actual=$,oe.expected=X,oe.operator=j,Error.captureStackTrace&&Error.captureStackTrace(s(oe),J),oe.stack,oe.name="AssertionError",n(oe)}return t(Q,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:U,value:function(oe,le){return S(this,x(x({},le),{},{customInspect:!1,depth:0}))}}]),Q}(c(Error),S.custom);G.exports=L}}),u2=He({"node_modules/object-keys/isArguments.js"(Y,G){var d=Object.prototype.toString;G.exports=function(A){var E=d.call(A),e=E==="[object Arguments]";return e||(e=E!=="[object Array]"&&A!==null&&typeof A=="object"&&typeof A.length=="number"&&A.length>=0&&d.call(A.callee)==="[object Function]"),e}}}),kk=He({"node_modules/object-keys/implementation.js"(Y,G){var d;Object.keys||(x=Object.prototype.hasOwnProperty,A=Object.prototype.toString,E=u2(),e=Object.prototype.propertyIsEnumerable,t=!e.call({toString:null},"toString"),r=e.call(function(){},"prototype"),o=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=function(c){var f=c.constructor;return f&&f.prototype===c},i={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},n=function(){if(typeof window>"u")return!1;for(var c in window)try{if(!i["$"+c]&&x.call(window,c)&&window[c]!==null&&typeof window[c]=="object")try{a(window[c])}catch{return!0}}catch{return!0}return!1}(),s=function(c){if(typeof window>"u"||!n)return a(c);try{return a(c)}catch{return!1}},d=function(f){var v=f!==null&&typeof f=="object",h=A.call(f)==="[object Function]",T=E(f),l=v&&A.call(f)==="[object String]",y=[];if(!v&&!h&&!T)throw new TypeError("Object.keys called on a non-object");var b=r&&h;if(l&&f.length>0&&!x.call(f,0))for(var S=0;S0)for(var M=0;M2?arguments[2]:{},f=d(s);x&&(f=E.call(f,Object.getOwnPropertySymbols(s)));for(var v=0;vXe.length)&&(Me=Xe.length);for(var xe=0,ce=new Array(Me);xe10)return!0;for(var Me=0;Me57)return!0}return Xe.length===10&&Xe>=Math.pow(2,32)}function L(Xe){return Object.keys(Xe).filter(O).concat(s(Xe).filter(Object.prototype.propertyIsEnumerable.bind(Xe)))}function N(Xe,Me){if(Xe===Me)return 0;for(var xe=Xe.length,ce=Me.length,Re=0,$e=Math.min(xe,ce);Re<$e;++Re)if(Xe[Re]!==Me[Re]){xe=Xe[Re],ce=Me[Re];break}return xe1?j-1:0),$=1;$1?j-1:0),$=1;$1?j-1:0),$=1;$1?j-1:0),$=1;$0)return t(i);if(s==="number"&&isNaN(i)===!1)return n.long?o(i):r(i);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(i))};function t(i){if(i=String(i),!(i.length>100)){var n=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(n){var s=parseFloat(n[1]),c=(n[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return s*e;case"days":case"day":case"d":return s*E;case"hours":case"hour":case"hrs":case"hr":case"h":return s*A;case"minutes":case"minute":case"mins":case"min":case"m":return s*x;case"seconds":case"second":case"secs":case"sec":case"s":return s*d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}function r(i){return i>=E?Math.round(i/E)+"d":i>=A?Math.round(i/A)+"h":i>=x?Math.round(i/x)+"m":i>=d?Math.round(i/d)+"s":i+"ms"}function o(i){return a(i,E,"day")||a(i,A,"hour")||a(i,x,"minute")||a(i,d,"second")||i+" ms"}function a(i,n,s){if(!(i=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}Y.formatters.j=function(r){try{return JSON.stringify(r)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}};function x(r){var o=this.useColors;if(r[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+r[0]+(o?"%c ":" ")+"+"+Y.humanize(this.diff),!!o){var a="color: "+this.color;r.splice(1,0,a,"color: inherit");var i=0,n=0;r[0].replace(/%[a-zA-Z%]/g,function(s){s!=="%%"&&(i++,s==="%c"&&(n=i))}),r.splice(n,0,a)}}function A(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function E(r){try{r==null?Y.storage.removeItem("debug"):Y.storage.debug=r}catch{}}function e(){var r;try{r=Y.storage.debug}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=Th.DEBUG),r}Y.enable(e());function t(){try{return window.localStorage}catch{}}}}),Nk=He({"node_modules/stream-parser/index.js"(Y,G){var d=_y(),x=Bk()("stream-parser");G.exports=r;var A=-1,E=0,e=1,t=2;function r(l){var y=l&&typeof l._transform=="function",b=l&&typeof l._write=="function";if(!y&&!b)throw new Error("must pass a Writable or Transform stream in");x("extending Parser into stream"),l._bytes=a,l._skipBytes=i,y&&(l._passthrough=n),y?l._transform=c:l._write=s}function o(l){x("initializing parser stream"),l._parserBytesLeft=0,l._parserBuffers=[],l._parserBuffered=0,l._parserState=A,l._parserCallback=null,typeof l.push=="function"&&(l._parserOutput=l.push.bind(l)),l._parserInit=!0}function a(l,y){d(!this._parserCallback,'there is already a "callback" set!'),d(isFinite(l)&&l>0,'can only buffer a finite number of bytes > 0, got "'+l+'"'),this._parserInit||o(this),x("buffering %o bytes",l),this._parserBytesLeft=l,this._parserCallback=y,this._parserState=E}function i(l,y){d(!this._parserCallback,'there is already a "callback" set!'),d(l>0,'can only skip > 0 bytes, got "'+l+'"'),this._parserInit||o(this),x("skipping %o bytes",l),this._parserBytesLeft=l,this._parserCallback=y,this._parserState=e}function n(l,y){d(!this._parserCallback,'There is already a "callback" set!'),d(l>0,'can only pass through > 0 bytes, got "'+l+'"'),this._parserInit||o(this),x("passing through %o bytes",l),this._parserBytesLeft=l,this._parserCallback=y,this._parserState=t}function s(l,y,b){this._parserInit||o(this),x("write(%o bytes)",l.length),typeof y=="function"&&(b=y),h(this,l,null,b)}function c(l,y,b){this._parserInit||o(this),x("transform(%o bytes)",l.length),typeof y!="function"&&(y=this._parserOutput),h(this,l,y,b)}function f(l,y,b,S){return l._parserBytesLeft<=0?S(new Error("got data but not currently parsing anything")):y.length<=l._parserBytesLeft?function(){return v(l,y,b,S)}:function(){var M=y.slice(0,l._parserBytesLeft);return v(l,M,b,function(_){if(_)return S(_);if(y.length>M.length)return function(){return f(l,y.slice(M.length),b,S)}})}}function v(l,y,b,S){if(l._parserBytesLeft-=y.length,x("%o bytes left for stream piece",l._parserBytesLeft),l._parserState===E?(l._parserBuffers.push(y),l._parserBuffered+=y.length):l._parserState===t&&b(y),l._parserBytesLeft===0){var M=l._parserCallback;if(M&&l._parserState===E&&l._parserBuffers.length>1&&(y=Buffer.concat(l._parserBuffers,l._parserBuffered)),l._parserState!==E&&(y=null),l._parserCallback=null,l._parserBuffered=0,l._parserState=A,l._parserBuffers.splice(0),M){var _=[];y&&_.push(y),b&&_.push(b);var w=M.length>_.length;w&&_.push(T(S));var p=M.apply(l,_);if(!w||S===p)return S}}else return S}var h=T(f);function T(l){return function(){for(var y=l.apply(this,arguments);typeof y=="function";)y=y();return y}}}}),Jl=He({"node_modules/probe-image-size/lib/common.js"(Y){var G=Mk().Transform,d=Nk();function x(){G.call(this,{readableObjectMode:!0})}x.prototype=Object.create(G.prototype),x.prototype.constructor=x,d(x.prototype),Y.ParserStream=x,Y.sliceEq=function(E,e,t){for(var r=e,o=0;o>4&15,f=n[4]&15,v=n[5]>>4&15,h=d(n,6),T=8,l=0;lh.width||v.width===h.width&&v.height>h.height?v:h}),c=n.reduce(function(v,h){return v.height>h.height||v.height===h.height&&v.width>h.width?v:h}),f;return s.width>c.height||s.width===c.height&&s.height>c.width?f=s:f=c,f}G.exports.readSizeFromMeta=function(n){var s={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(a(n,s),!!s.sizes.length){var c=i(s.sizes),f=1;s.transforms.forEach(function(h){var T={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},l={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if(h.type==="imir"&&(h.value===0?f=l[f]:(f=l[f],f=T[f],f=T[f])),h.type==="irot")for(var y=0;y0&&!this.aborted;){var t=this.ifds_to_read.shift();t.offset&&this.scan_ifd(t.id,t.offset,E)}},A.prototype.read_uint16=function(E){var e=this.input;if(E+2>e.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?e[E]*256+e[E+1]:e[E]+e[E+1]*256},A.prototype.read_uint32=function(E){var e=this.input;if(E+4>e.length)throw d("unexpected EOF","EBADDATA");return this.big_endian?e[E]*16777216+e[E+1]*65536+e[E+2]*256+e[E+3]:e[E]+e[E+1]*256+e[E+2]*65536+e[E+3]*16777216},A.prototype.is_subifd_link=function(E,e){return E===0&&e===34665||E===0&&e===34853||E===34665&&e===40965},A.prototype.exif_format_length=function(E){switch(E){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},A.prototype.exif_format_read=function(E,e){var t;switch(E){case 1:case 2:return t=this.input[e],t;case 6:return t=this.input[e],t|(t&128)*33554430;case 3:return t=this.read_uint16(e),t;case 8:return t=this.read_uint16(e),t|(t&32768)*131070;case 4:return t=this.read_uint32(e),t;case 9:return t=this.read_uint32(e),t|0;case 5:case 10:case 11:case 12:return null;case 7:return null;default:return null}},A.prototype.scan_ifd=function(E,e,t){var r=this.read_uint16(e);e+=2;for(var o=0;othis.input.length)throw d("unexpected EOF","EBADDATA");for(var h=[],T=f,l=0;l0&&(this.ifds_to_read.push({id:a,offset:h[0]}),v=!0);var b={is_big_endian:this.big_endian,ifd:E,tag:a,format:i,count:n,entry_offset:e+this.start,data_length:c,data_offset:f+this.start,value:h,is_subifd_link:v};if(t(b)===!1){this.aborted=!0;return}e+=12}E===0&&this.ifds_to_read.push({id:1,offset:this.read_uint32(e)})},G.exports.ExifParser=A,G.exports.get_orientation=function(E){var e=0;try{return new A(E,0,E.length).each(function(t){if(t.ifd===0&&t.tag===274&&Array.isArray(t.value))return e=t.value[0],!1}),e}catch{return-1}}}}),jk=He({"node_modules/probe-image-size/lib/parse_sync/avif.js"(Y,G){var d=Jl().str2arr,x=Jl().sliceEq,A=Jl().readUInt32BE,E=Uk(),e=t_(),t=d("ftyp");G.exports=function(r){if(x(r,4,t)){var o=E.unbox(r,0);if(o){var a=E.getMimeType(o.data);if(a){for(var i,n=o.end;;){var s=E.unbox(r,n);if(!s)break;if(n=s.end,s.boxtype==="mdat")return;if(s.boxtype==="meta"){i=s.data;break}}if(i){var c=E.readSizeFromMeta(i);if(c){var f={width:c.width,height:c.height,type:a.type,mime:a.mime,wUnits:"px",hUnits:"px"};if(c.variants.length>1&&(f.variants=c.variants),c.orientation&&(f.orientation=c.orientation),c.exif_location&&c.exif_location.offset+c.exif_location.length<=r.length){var v=A(r,c.exif_location.offset),h=r.slice(c.exif_location.offset+v+4,c.exif_location.offset+c.exif_location.length),T=e.get_orientation(h);T>0&&(f.orientation=T)}return f}}}}}}}}),Vk=He({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(Y,G){var d=Jl().str2arr,x=Jl().sliceEq,A=Jl().readUInt16LE,E=d("BM");G.exports=function(e){if(!(e.length<26)&&x(e,0,E))return{width:A(e,18),height:A(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),qk=He({"node_modules/probe-image-size/lib/parse_sync/gif.js"(Y,G){var d=Jl().str2arr,x=Jl().sliceEq,A=Jl().readUInt16LE,E=d("GIF87a"),e=d("GIF89a");G.exports=function(t){if(!(t.length<10)&&!(!x(t,0,E)&&!x(t,0,e)))return{width:A(t,6),height:A(t,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),Hk=He({"node_modules/probe-image-size/lib/parse_sync/ico.js"(Y,G){var d=Jl().readUInt16LE,x=0,A=1,E=16;G.exports=function(e){var t=d(e,0),r=d(e,2),o=d(e,4);if(!(t!==x||r!==A||!o)){for(var a=[],i={width:0,height:0},n=0;ni.width||c>i.height)&&(i=f)}return{width:i.width,height:i.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),Gk=He({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(Y,G){var d=Jl().readUInt16BE,x=Jl().str2arr,A=Jl().sliceEq,E=t_(),e=x("Exif\0\0");G.exports=function(t){if(!(t.length<2)&&!(t[0]!==255||t[1]!==216||t[2]!==255))for(var r=2;;){for(;;){if(t.length-r<2)return;if(t[r++]===255)break}for(var o=t[r++],a;o===255;)o=t[r++];if(208<=o&&o<=217||o===1)a=0;else if(192<=o&&o<=254){if(t.length-r<2)return;a=d(t,r)-2,r+=2}else return;if(o===217||o===218)return;var i;if(o===225&&a>=10&&A(t,r,e)&&(i=E.get_orientation(t.slice(r+6,r+a))),a>=5&&192<=o&&o<=207&&o!==196&&o!==200&&o!==204){if(t.length-r0&&(n.orientation=i),n}r+=a}}}}),Wk=He({"node_modules/probe-image-size/lib/parse_sync/png.js"(Y,G){var d=Jl().str2arr,x=Jl().sliceEq,A=Jl().readUInt32BE,E=d(`‰PNG\r + +`),e=d("IHDR");G.exports=function(t){if(!(t.length<24)&&x(t,0,E)&&x(t,12,e))return{width:A(t,16),height:A(t,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),Zk=He({"node_modules/probe-image-size/lib/parse_sync/psd.js"(Y,G){var d=Jl().str2arr,x=Jl().sliceEq,A=Jl().readUInt32BE,E=d("8BPS\0");G.exports=function(e){if(!(e.length<22)&&x(e,0,E))return{width:A(e,18),height:A(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),Xk=He({"node_modules/probe-image-size/lib/parse_sync/svg.js"(Y,G){function d(s){return s===32||s===9||s===13||s===10}function x(s){return typeof s=="number"&&isFinite(s)&&s>0}function A(s){var c=0,f=s.length;for(s[0]===239&&s[1]===187&&s[2]===191&&(c=3);c]*>/,e=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,t=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,r=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,o=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,a=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function i(s){var c=s.match(t),f=s.match(r),v=s.match(o);return{width:c&&(c[1]||c[2]),height:f&&(f[1]||f[2]),viewbox:v&&(v[1]||v[2])}}function n(s){return a.test(s)?s.match(a)[0]:"px"}G.exports=function(s){if(A(s)){for(var c="",f=0;f>14&16383)+1,type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function i(n,s){return{width:(n[s+6]<<16|n[s+5]<<8|n[s+4])+1,height:(n[s+9]<n.length)){for(;s+8=10?c=c||o(n,s+8):h==="VP8L"&&T>=9?c=c||a(n,s+8):h==="VP8X"&&T>=10?c=c||i(n,s+8):h==="EXIF"&&(f=e.get_orientation(n.slice(s+8,s+8+T)),s=1/0),s+=8+T}if(c)return f>0&&(c.orientation=f),c}}}}}),Jk=He({"node_modules/probe-image-size/lib/parsers_sync.js"(Y,G){G.exports={avif:jk(),bmp:Vk(),gif:qk(),ico:Hk(),jpeg:Gk(),png:Wk(),psd:Zk(),svg:Xk(),tiff:Yk(),webp:Kk()}}}),$k=He({"node_modules/probe-image-size/sync.js"(Y,G){var d=Jk();function x(A){for(var E=Object.keys(d),e=0;e0;)R=c.c2p(M+B*u),B--;for(B=0;z===void 0&&B0;)F=f.c2p(_+B*g),B--;if(Rj[0];if(J||$){var X=m+L/2,re=z+N/2;oe+="transform:"+A(X+"px",re+"px")+"scale("+(J?-1:1)+","+($?-1:1)+")"+A(-X+"px",-re+"px")+";"}}ue.attr("style",oe);var ee=new Promise(function(q){if(y._hasZ)q();else if(y._hasSource)if(y._canvas&&y._canvas.el.width===w&&y._canvas.el.height===p&&y._canvas.source===y.source)q();else{var ae=document.createElement("canvas");ae.width=w,ae.height=p;var ie=ae.getContext("2d",{willReadFrequently:!0});y._image=y._image||new Image;var fe=y._image;fe.onload=function(){ie.drawImage(fe,0,0),y._canvas={el:ae,source:y.source},q()},fe.setAttribute("src",y.source)}}).then(function(){var q,ae;if(y._hasZ)ae=Q(function(we,Ae){var Fe=S[Ae][we];return x.isTypedArray(Fe)&&(Fe=Array.from(Fe)),Fe}),q=ae.toDataURL("image/png");else if(y._hasSource)if(b)q=y.source;else{var ie=y._canvas.el.getContext("2d",{willReadFrequently:!0}),fe=ie.getImageData(0,0,w,p).data;ae=Q(function(we,Ae){var Fe=4*(Ae*w+we);return[fe[Fe],fe[Fe+1],fe[Fe+2],fe[Fe+3]]}),q=ae.toDataURL("image/png")}ue.attr({"xlink:href":q,height:N,width:L,x:m,y:z})});a._promises.push(ee)})}}}),rC=He({"src/traces/image/style.js"(Y,G){var d=Qn();G.exports=function(A){d.select(A).selectAll(".im image").style("opacity",function(E){return E[0].trace.opacity})}}}),aC=He({"src/traces/image/hover.js"(Y,G){var d=Wu(),x=Gr(),A=x.isArrayOrTypedArray,E=J0();G.exports=function(t,r,o){var a=t.cd[0],i=a.trace,n=t.xa,s=t.ya;if(!(d.inbox(r-a.x0,r-(a.x0+a.w*i.dx),0)>0||d.inbox(o-a.y0,o-(a.y0+a.h*i.dy),0)>0)){var c=Math.floor((r-a.x0)/i.dx),f=Math.floor(Math.abs(o-a.y0)/i.dy),v;if(i._hasZ?v=a.z[f][c]:i._hasSource&&(v=i._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(c,f,1,1).data),!!v){var h=a.hi||i.hoverinfo,T;if(h){var l=h.split("+");l.indexOf("all")!==-1&&(l=["color"]),l.indexOf("color")!==-1&&(T=!0)}var y=E.colormodel[i.colormodel],b=y.colormodel||i.colormodel,S=b.length,M=i._scaler(v),_=y.suffix,w=[];(i.hovertemplate||T)&&(w.push("["+[M[0]+_[0],M[1]+_[1],M[2]+_[2]].join(", ")),S===4&&w.push(", "+M[3]+_[3]),w.push("]"),w=w.join(""),t.extraText=b.toUpperCase()+": "+w);var p;A(i.hovertext)&&A(i.hovertext[f])?p=i.hovertext[f][c]:A(i.text)&&A(i.text[f])&&(p=i.text[f][c]);var u=s.c2p(a.y0+(f+.5)*i.dy),g=a.x0+(c+.5)*i.dx,m=a.y0+(f+.5)*i.dy,R="["+v.slice(0,i.colormodel.length).join(", ")+"]";return[x.extendFlat(t,{index:[f,c],x0:n.c2p(a.x0+c*i.dx),x1:n.c2p(a.x0+(c+1)*i.dx),y0:u,y1:u,color:M,xVal:g,xLabelVal:g,yVal:m,yLabelVal:m,zLabelVal:R,text:p,hovertemplateLabels:{zLabel:R,colorLabel:w,"color[0]Label":M[0]+_[0],"color[1]Label":M[1]+_[1],"color[2]Label":M[2]+_[2],"color[3]Label":M[3]+_[3]}})]}}}}}),nC=He({"src/traces/image/event_data.js"(Y,G){G.exports=function(x,A){return"xVal"in A&&(x.x=A.xVal),"yVal"in A&&(x.y=A.yVal),A.xa&&(x.xaxis=A.xa),A.ya&&(x.yaxis=A.ya),x.color=A.color,x.colormodel=A.trace.colormodel,x.z||(x.z=A.color),x}}}),iC=He({"src/traces/image/index.js"(Y,G){G.exports={attributes:Zw(),supplyDefaults:ek(),calc:eC(),plot:tC(),style:rC(),hoverPoints:aC(),eventData:nC(),moduleType:"trace",name:"image",basePlotModule:Bc(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),oC=He({"lib/image.js"(Y,G){G.exports=iC()}}),Bp=He({"src/traces/pie/attributes.js"(Y,G){var d=cl(),x=mu().attributes,A=Yl(),E=Xc(),e=Yo().hovertemplateAttrs,t=Yo().texttemplateAttrs,r=ho().extendFlat,o=Nf().pattern,a=A({editType:"plot",arrayOk:!0,colorEditType:"plot"});G.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:E.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:o,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:r({},d.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:e({},{keys:["label","color","value","percent","text"]}),texttemplate:t({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:r({},a,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:r({},a,{}),outsidetextfont:r({},a,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:r({},a,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:x({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),Np=He({"src/traces/pie/defaults.js"(Y,G){var d=Hi(),x=Gr(),A=Bp(),E=mu().defaults,e=Jh().handleText,t=Gr().coercePattern;function r(i,n){var s=x.isArrayOrTypedArray(i),c=x.isArrayOrTypedArray(n),f=Math.min(s?i.length:1/0,c?n.length:1/0);if(isFinite(f)||(f=0),f&&c){for(var v,h=0;h0){v=!0;break}}v||(f=0)}return{hasLabels:s,hasValues:c,len:f}}function o(i,n,s,c,f){var v=c("marker.line.width");v&&c("marker.line.color",f?void 0:s.paper_bgcolor);var h=c("marker.colors");t(c,"marker.pattern",h),i.marker&&!n.marker.pattern.fgcolor&&(n.marker.pattern.fgcolor=i.marker.colors),n.marker.pattern.bgcolor||(n.marker.pattern.bgcolor=s.paper_bgcolor)}function a(i,n,s,c){function f(m,R){return x.coerce(i,n,A,m,R)}var v=f("labels"),h=f("values"),T=r(v,h),l=T.len;if(n._hasLabels=T.hasLabels,n._hasValues=T.hasValues,!n._hasLabels&&n._hasValues&&(f("label0"),f("dlabel")),!l){n.visible=!1;return}n._length=l,o(i,n,c,f,!0),f("scalegroup");var y=f("text"),b=f("texttemplate"),S;if(b||(S=f("textinfo",x.isArrayOrTypedArray(y)?"text+percent":"percent")),f("hovertext"),f("hovertemplate"),b||S&&S!=="none"){var M=f("textposition");e(i,n,c,f,M,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1});var _=Array.isArray(M)||M==="auto",w=_||M==="outside";w&&f("automargin"),(M==="inside"||M==="auto"||Array.isArray(M))&&f("insidetextorientation")}else S==="none"&&f("textposition","none");E(n,c,f);var p=f("hole"),u=f("title.text");if(u){var g=f("title.position",p?"middle center":"top center");!p&&g==="middle center"&&(n.title.position="top center"),x.coerceFont(f,"title.font",c.font)}f("sort"),f("direction"),f("rotation"),f("pull")}G.exports={handleLabelsAndValues:r,handleMarkerDefaults:o,supplyDefaults:a}}}),r_=He({"src/traces/pie/layout_attributes.js"(Y,G){G.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),sC=He({"src/traces/pie/layout_defaults.js"(Y,G){var d=Gr(),x=r_();G.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("hiddenlabels"),t("piecolorway",e.colorway),t("extendpiecolors")}}}),tg=He({"src/traces/pie/calc.js"(Y,G){var d=Hi(),x=Mf(),A=Ai(),E={};function e(a,i){var n=[],s=a._fullLayout,c=s.hiddenlabels||[],f=i.labels,v=i.marker.colors||[],h=i.values,T=i._length,l=i._hasValues&&T,y,b;if(i.dlabel)for(f=new Array(T),y=0;y=0});var R=i.type==="funnelarea"?w:i.sort;return R&&n.sort(function(P,z){return z.v-P.v}),n[0]&&(n[0].vTotal=_),n}function t(a){return function(n,s){return!n||(n=x(n),!n.isValid())?!1:(n=A.addOpacity(n,n.getAlpha()),a[s]||(a[s]=n),n)}}function r(a,i){var n=(i||{}).type;n||(n="pie");var s=a._fullLayout,c=a.calcdata,f=s[n+"colorway"],v=s["_"+n+"colormap"];s["extend"+n+"colors"]&&(f=o(f,E));for(var h=0,T=0;T0&&($e+=St*ce.pxmid[0],rt+=St*ce.pxmid[1])}ce.cxFinal=$e,ce.cyFinal=rt;function Rt(pt,ze,Ge,Oe){var ve=Oe*(ze[0]-pt[0]),ge=Oe*(ze[1]-pt[1]);return"a"+Oe*fe.r+","+Oe*fe.r+" 0 "+ce.largeArc+(Ge?" 1 ":" 0 ")+ve+","+ge}var Ut=we.hole;if(ce.v===fe.vTotal){var ir="M"+($e+ce.px0[0])+","+(rt+ce.px0[1])+Rt(ce.px0,ce.pxmid,!0,1)+Rt(ce.pxmid,ce.px0,!0,1)+"Z";Ut?At.attr("d","M"+($e+Ut*ce.px0[0])+","+(rt+Ut*ce.px0[1])+Rt(ce.px0,ce.pxmid,!1,Ut)+Rt(ce.pxmid,ce.px0,!1,Ut)+"Z"+ir):At.attr("d",ir)}else{var ar=Rt(ce.px0,ce.px1,!0,1);if(Ut){var Mr=1-Ut;At.attr("d","M"+($e+Ut*ce.px1[0])+","+(rt+Ut*ce.px1[1])+Rt(ce.px1,ce.px0,!1,Ut)+"l"+Mr*ce.px0[0]+","+Mr*ce.px0[1]+ar+"Z")}else At.attr("d","M"+$e+","+rt+"l"+ce.px0[0]+","+ce.px0[1]+ar+"Z")}le(J,ce,fe);var fr=f.castOption(we.textposition,ce.pts),dr=Je.selectAll("g.slicetext").data(ce.text&&fr!=="none"?[0]:[]);dr.enter().append("g").classed("slicetext",!0),dr.exit().remove(),dr.each(function(){var pt=t.ensureSingle(d.select(this),"text","",function(We){We.attr("data-notex",1)}),ze=t.ensureUniformFontSize(J,fr==="outside"?b(we,ce,re.font):S(we,ce,re.font));pt.text(ce.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(e.font,ze).call(a.convertToTspans,J);var Ge=e.bBox(pt.node()),Oe;if(fr==="outside")Oe=z(Ge,ce);else if(Oe=_(Ge,ce,fe),fr==="auto"&&Oe.scale<1){var ve=t.ensureUniformFontSize(J,we.outsidetextfont);pt.call(e.font,ve),Ge=e.bBox(pt.node()),Oe=z(Ge,ce)}var ge=Oe.textPosAngle,be=ge===void 0?ce.pxmid:oe(fe.r,ge);if(Oe.targetX=$e+be[0]*Oe.rCenter+(Oe.x||0),Oe.targetY=rt+be[1]*Oe.rCenter+(Oe.y||0),j(Oe,Ge),Oe.outside){var Pe=Oe.targetY;ce.yLabelMin=Pe-Ge.height/2,ce.yLabelMid=Pe,ce.yLabelMax=Pe+Ge.height/2,ce.labelExtraX=0,ce.labelExtraY=0,Ce=!0}Oe.fontSize=ze.size,n(we.type,Oe,re),ae[Re].transform=Oe,t.setTransormAndDisplay(pt,Oe)})});var qe=d.select(this).selectAll("g.titletext").data(we.title.text?[0]:[]);if(qe.enter().append("g").classed("titletext",!0),qe.exit().remove(),qe.each(function(){var ce=t.ensureSingle(d.select(this),"text","",function(rt){rt.attr("data-notex",1)}),Re=we.title.text;we._meta&&(Re=t.templateString(Re,we._meta)),ce.text(Re).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(e.font,we.title.font).call(a.convertToTspans,J);var $e;we.title.position==="middle center"?$e=F(fe):$e=B(fe,ee),ce.attr("transform",o($e.x,$e.y)+r(Math.min(1,$e.scale))+o($e.tx,$e.ty))}),Ce&&U(Fe,we),l(Ae,we),Ce&&we.automargin){var et=e.bBox(ie.node()),Qe=we.domain,Ke=ee.w*(Qe.x[1]-Qe.x[0]),Xe=ee.h*(Qe.y[1]-Qe.y[0]),Me=(.5*Ke-fe.r)/ee.w,xe=(.5*Xe-fe.r)/ee.h;x.autoMargin(J,"pie."+we.uid+".automargin",{xl:Qe.x[0]-Me,xr:Qe.x[1]+Me,yb:Qe.y[0]-xe,yt:Qe.y[1]+xe,l:Math.max(fe.cx-fe.r-et.left,0),r:Math.max(et.right-(fe.cx+fe.r),0),b:Math.max(et.bottom-(fe.cy+fe.r),0),t:Math.max(fe.cy-fe.r-et.top,0),pad:5})}})});setTimeout(function(){q.selectAll("tspan").each(function(){var ae=d.select(this);ae.attr("dy")&&ae.attr("dy",ae.attr("dy"))})},0)}function l(J,$){J.each(function(X){var re=d.select(this);if(!X.labelExtraX&&!X.labelExtraY){re.select("path.textline").remove();return}var ee=re.select("g.slicetext text");X.transform.targetX+=X.labelExtraX,X.transform.targetY+=X.labelExtraY,t.setTransormAndDisplay(ee,X.transform);var q=X.cxFinal+X.pxmid[0],ae=X.cyFinal+X.pxmid[1],ie="M"+q+","+ae,fe=(X.yLabelMax-X.yLabelMin)*(X.pxmid[0]<0?-1:1)/4;if(X.labelExtraX){var we=X.labelExtraX*X.pxmid[1]/X.pxmid[0],Ae=X.yLabelMid+X.labelExtraY-(X.cyFinal+X.pxmid[1]);Math.abs(we)>Math.abs(Ae)?ie+="l"+Ae*X.pxmid[0]/X.pxmid[1]+","+Ae+"H"+(q+X.labelExtraX+fe):ie+="l"+X.labelExtraX+","+we+"v"+(Ae-we)+"h"+fe}else ie+="V"+(X.yLabelMid+X.labelExtraY)+"h"+fe;t.ensureSingle(re,"path","textline").call(E.stroke,$.outsidetextfont.color).attr({"stroke-width":Math.min(2,$.outsidetextfont.size/8),d:ie,fill:"none"})})}function y(J,$,X){var re=X[0],ee=re.cx,q=re.cy,ae=re.trace,ie=ae.type==="funnelarea";"_hasHoverLabel"in ae||(ae._hasHoverLabel=!1),"_hasHoverEvent"in ae||(ae._hasHoverEvent=!1),J.on("mouseover",function(fe){var we=$._fullLayout,Ae=$._fullData[ae.index];if(!($._dragging||we.hovermode===!1)){var Fe=Ae.hoverinfo;if(Array.isArray(Fe)&&(Fe=A.castHoverinfo({hoverinfo:[f.castOption(Fe,fe.pts)],_module:ae._module},we,0)),Fe==="all"&&(Fe="label+text+value+percent+name"),Ae.hovertemplate||Fe!=="none"&&Fe!=="skip"&&Fe){var Ce=fe.rInscribed||0,qe=ee+fe.pxmid[0]*(1-Ce),et=q+fe.pxmid[1]*(1-Ce),Qe=we.separators,Ke=[];if(Fe&&Fe.indexOf("label")!==-1&&Ke.push(fe.label),fe.text=f.castOption(Ae.hovertext||Ae.text,fe.pts),Fe&&Fe.indexOf("text")!==-1){var Xe=fe.text;t.isValidTextValue(Xe)&&Ke.push(Xe)}fe.value=fe.v,fe.valueLabel=f.formatPieValue(fe.v,Qe),Fe&&Fe.indexOf("value")!==-1&&Ke.push(fe.valueLabel),fe.percent=fe.v/re.vTotal,fe.percentLabel=f.formatPiePercent(fe.percent,Qe),Fe&&Fe.indexOf("percent")!==-1&&Ke.push(fe.percentLabel);var Me=Ae.hoverlabel,xe=Me.font,ce=[];A.loneHover({trace:ae,x0:qe-Ce*re.r,x1:qe+Ce*re.r,y:et,_x0:ie?ee+fe.TL[0]:qe-Ce*re.r,_x1:ie?ee+fe.TR[0]:qe+Ce*re.r,_y0:ie?q+fe.TL[1]:et-Ce*re.r,_y1:ie?q+fe.BL[1]:et+Ce*re.r,text:Ke.join("
"),name:Ae.hovertemplate||Fe.indexOf("name")!==-1?Ae.name:void 0,idealAlign:fe.pxmid[0]<0?"left":"right",color:f.castOption(Me.bgcolor,fe.pts)||fe.color,borderColor:f.castOption(Me.bordercolor,fe.pts),fontFamily:f.castOption(xe.family,fe.pts),fontSize:f.castOption(xe.size,fe.pts),fontColor:f.castOption(xe.color,fe.pts),nameLength:f.castOption(Me.namelength,fe.pts),textAlign:f.castOption(Me.align,fe.pts),hovertemplate:f.castOption(Ae.hovertemplate,fe.pts),hovertemplateLabels:fe,eventData:[v(fe,Ae)]},{container:we._hoverlayer.node(),outerContainer:we._paper.node(),gd:$,inOut_bbox:ce}),fe.bbox=ce[0],ae._hasHoverLabel=!0}ae._hasHoverEvent=!0,$.emit("plotly_hover",{points:[v(fe,Ae)],event:d.event})}}),J.on("mouseout",function(fe){var we=$._fullLayout,Ae=$._fullData[ae.index],Fe=d.select(this).datum();ae._hasHoverEvent&&(fe.originalEvent=d.event,$.emit("plotly_unhover",{points:[v(Fe,Ae)],event:d.event}),ae._hasHoverEvent=!1),ae._hasHoverLabel&&(A.loneUnhover(we._hoverlayer.node()),ae._hasHoverLabel=!1)}),J.on("click",function(fe){var we=$._fullLayout,Ae=$._fullData[ae.index];$._dragging||we.hovermode===!1||($._hoverdata=[v(fe,Ae)],A.click($,d.event))})}function b(J,$,X){var re=f.castOption(J.outsidetextfont.color,$.pts)||f.castOption(J.textfont.color,$.pts)||X.color,ee=f.castOption(J.outsidetextfont.family,$.pts)||f.castOption(J.textfont.family,$.pts)||X.family,q=f.castOption(J.outsidetextfont.size,$.pts)||f.castOption(J.textfont.size,$.pts)||X.size,ae=f.castOption(J.outsidetextfont.weight,$.pts)||f.castOption(J.textfont.weight,$.pts)||X.weight,ie=f.castOption(J.outsidetextfont.style,$.pts)||f.castOption(J.textfont.style,$.pts)||X.style,fe=f.castOption(J.outsidetextfont.variant,$.pts)||f.castOption(J.textfont.variant,$.pts)||X.variant,we=f.castOption(J.outsidetextfont.textcase,$.pts)||f.castOption(J.textfont.textcase,$.pts)||X.textcase,Ae=f.castOption(J.outsidetextfont.lineposition,$.pts)||f.castOption(J.textfont.lineposition,$.pts)||X.lineposition,Fe=f.castOption(J.outsidetextfont.shadow,$.pts)||f.castOption(J.textfont.shadow,$.pts)||X.shadow;return{color:re,family:ee,size:q,weight:ae,style:ie,variant:fe,textcase:we,lineposition:Ae,shadow:Fe}}function S(J,$,X){var re=f.castOption(J.insidetextfont.color,$.pts);!re&&J._input.textfont&&(re=f.castOption(J._input.textfont.color,$.pts));var ee=f.castOption(J.insidetextfont.family,$.pts)||f.castOption(J.textfont.family,$.pts)||X.family,q=f.castOption(J.insidetextfont.size,$.pts)||f.castOption(J.textfont.size,$.pts)||X.size,ae=f.castOption(J.insidetextfont.weight,$.pts)||f.castOption(J.textfont.weight,$.pts)||X.weight,ie=f.castOption(J.insidetextfont.style,$.pts)||f.castOption(J.textfont.style,$.pts)||X.style,fe=f.castOption(J.insidetextfont.variant,$.pts)||f.castOption(J.textfont.variant,$.pts)||X.variant,we=f.castOption(J.insidetextfont.textcase,$.pts)||f.castOption(J.textfont.textcase,$.pts)||X.textcase,Ae=f.castOption(J.insidetextfont.lineposition,$.pts)||f.castOption(J.textfont.lineposition,$.pts)||X.lineposition,Fe=f.castOption(J.insidetextfont.shadow,$.pts)||f.castOption(J.textfont.shadow,$.pts)||X.shadow;return{color:re||E.contrast($.color),family:ee,size:q,weight:ae,style:ie,variant:fe,textcase:we,lineposition:Ae,shadow:Fe}}function M(J,$){for(var X,re,ee=0;ee=-4;Me-=2)Xe(Math.PI*Me,"tan");for(Me=4;Me>=-4;Me-=2)Xe(Math.PI*(Me+1),"tan")}if(Fe||qe){for(Me=4;Me>=-4;Me-=2)Xe(Math.PI*(Me+1.5),"rad");for(Me=4;Me>=-4;Me-=2)Xe(Math.PI*(Me+.5),"rad")}}if(ie||et||Fe){var xe=Math.sqrt(J.width*J.width+J.height*J.height);if(Ke={scale:ee*re*2/xe,rCenter:1-ee,rotate:0},Ke.textPosAngle=($.startangle+$.stopangle)/2,Ke.scale>=1)return Ke;Qe.push(Ke)}(et||qe)&&(Ke=p(J,re,ae,fe,we),Ke.textPosAngle=($.startangle+$.stopangle)/2,Qe.push(Ke)),(et||Ce)&&(Ke=u(J,re,ae,fe,we),Ke.textPosAngle=($.startangle+$.stopangle)/2,Qe.push(Ke));for(var ce=0,Re=0,$e=0;$e=1)break}return Qe[ce]}function w(J,$){var X=J.startangle,re=J.stopangle;return X>$&&$>re||X<$&&$0?1:-1)/2,y:q/(1+X*X/(re*re)),outside:!0}}function F(J){var $=Math.sqrt(J.titleBox.width*J.titleBox.width+J.titleBox.height*J.titleBox.height);return{x:J.cx,y:J.cy,scale:J.trace.hole*J.r*2/$,tx:0,ty:-J.titleBox.height/2+J.trace.title.font.size}}function B(J,$){var X=1,re=1,ee,q=J.trace,ae={x:J.cx,y:J.cy},ie={tx:0,ty:0};ie.ty+=q.title.font.size,ee=N(q),q.title.position.indexOf("top")!==-1?(ae.y-=(1+ee)*J.r,ie.ty-=J.titleBox.height):q.title.position.indexOf("bottom")!==-1&&(ae.y+=(1+ee)*J.r);var fe=O(J.r,J.trace.aspectratio),we=$.w*(q.domain.x[1]-q.domain.x[0])/2;return q.title.position.indexOf("left")!==-1?(we=we+fe,ae.x-=(1+ee)*fe,ie.tx+=J.titleBox.width/2):q.title.position.indexOf("center")!==-1?we*=2:q.title.position.indexOf("right")!==-1&&(we=we+fe,ae.x+=(1+ee)*fe,ie.tx-=J.titleBox.width/2),X=we/J.titleBox.width,re=L(J,$)/J.titleBox.height,{x:ae.x,y:ae.y,scale:Math.min(X,re),tx:ie.tx,ty:ie.ty}}function O(J,$){return J/($===void 0?1:$)}function L(J,$){var X=J.trace,re=$.h*(X.domain.y[1]-X.domain.y[0]);return Math.min(J.titleBox.height,re/2)}function N(J){var $=J.pull;if(!$)return 0;var X;if(t.isArrayOrTypedArray($))for($=0,X=0;X$&&($=J.pull[X]);return $}function U(J,$){var X,re,ee,q,ae,ie,fe,we,Ae,Fe,Ce,qe,et;function Qe(xe,ce){return xe.pxmid[1]-ce.pxmid[1]}function Ke(xe,ce){return ce.pxmid[1]-xe.pxmid[1]}function Xe(xe,ce){ce||(ce={});var Re=ce.labelExtraY+(re?ce.yLabelMax:ce.yLabelMin),$e=re?xe.yLabelMin:xe.yLabelMax,rt=re?xe.yLabelMax:xe.yLabelMin,Je=xe.cyFinal+ae(xe.px0[1],xe.px1[1]),At=Re-$e,St,Rt,Ut,ir,ar,Mr;if(At*fe>0&&(xe.labelExtraY=At),!!t.isArrayOrTypedArray($.pull))for(Rt=0;Rt=(f.castOption($.pull,Ut.pts)||0))&&((xe.pxmid[1]-Ut.pxmid[1])*fe>0?(ir=Ut.cyFinal+ae(Ut.px0[1],Ut.px1[1]),At=ir-$e-xe.labelExtraY,At*fe>0&&(xe.labelExtraY+=At)):(rt+xe.labelExtraY-Je)*fe>0&&(St=3*ie*Math.abs(Rt-Fe.indexOf(xe)),ar=Ut.cxFinal+q(Ut.px0[0],Ut.px1[0]),Mr=ar+St-(xe.cxFinal+xe.pxmid[0])-xe.labelExtraX,Mr*ie>0&&(xe.labelExtraX+=Mr)))}for(re=0;re<2;re++)for(ee=re?Qe:Ke,ae=re?Math.max:Math.min,fe=re?1:-1,X=0;X<2;X++){for(q=X?Math.max:Math.min,ie=X?1:-1,we=J[re][X],we.sort(ee),Ae=J[1-re][X],Fe=Ae.concat(we),qe=[],Ce=0;Ce1?(we=X.r,Ae=we/ee.aspectratio):(Ae=X.r,we=Ae*ee.aspectratio),we*=(1+ee.baseratio)/2,fe=we*Ae}ae=Math.min(ae,fe/X.vTotal)}for(re=0;re$.vTotal/2?1:0,we.halfangle=Math.PI*Math.min(we.v/$.vTotal,.5),we.ring=1-re.hole,we.rInscribed=P(we,$))}function oe(J,$){return[J*Math.sin($),-J*Math.cos($)]}function le(J,$,X){var re=J._fullLayout,ee=X.trace,q=ee.texttemplate,ae=ee.textinfo;if(!q&&ae&&ae!=="none"){var ie=ae.split("+"),fe=function(ce){return ie.indexOf(ce)!==-1},we=fe("label"),Ae=fe("text"),Fe=fe("value"),Ce=fe("percent"),qe=re.separators,et;if(et=we?[$.label]:[],Ae){var Qe=f.getFirstFilled(ee.text,$.pts);h(Qe)&&et.push(Qe)}Fe&&et.push(f.formatPieValue($.v,qe)),Ce&&et.push(f.formatPiePercent($.v/X.vTotal,qe)),$.text=et.join("
")}function Ke(ce){return{label:ce.label,value:ce.v,valueLabel:f.formatPieValue(ce.v,re.separators),percent:ce.v/X.vTotal,percentLabel:f.formatPiePercent(ce.v/X.vTotal,re.separators),color:ce.color,text:ce.text,customdata:t.castOption(ee,ce.i,"customdata")}}if(q){var Xe=t.castOption(ee,$.i,"texttemplate");if(!Xe)$.text="";else{var Me=Ke($),xe=f.getFirstFilled(ee.text,$.pts);(h(xe)||xe==="")&&(Me.text=xe),$.text=t.texttemplateString(Xe,Me,J._fullLayout._d3locale,Me,ee._meta||{})}}}function j(J,$){var X=J.rotate*Math.PI/180,re=Math.cos(X),ee=Math.sin(X),q=($.left+$.right)/2,ae=($.top+$.bottom)/2;J.textX=q*re-ae*ee,J.textY=q*ee+ae*re,J.noCenter=!0}G.exports={plot:T,formatSliceLabel:le,transformInsideText:_,determineInsideTextFont:S,positionTitleOutside:B,prerenderTitles:M,layoutAreas:Z,attachFxHandlers:y,computeTransform:j}}}),uC=He({"src/traces/pie/style.js"(Y,G){var d=Qn(),x=U0(),A=hh().resizeText;G.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");A(e,t,"pie"),t.each(function(r){var o=r[0],a=o.trace,i=d.select(this);i.style({opacity:a.opacity}),i.selectAll("path.surface").each(function(n){d.select(this).call(x,n,a,e)})})}}}),cC=He({"src/traces/pie/base_plot.js"(Y){var G=yu();Y.name="pie",Y.plot=function(d,x,A,E){G.plotBasePlot(Y.name,d,x,A,E)},Y.clean=function(d,x,A,E){G.cleanBasePlot(Y.name,d,x,A,E)}}}),fC=He({"src/traces/pie/index.js"(Y,G){G.exports={attributes:Bp(),supplyDefaults:Np().supplyDefaults,supplyLayoutDefaults:sC(),layoutAttributes:r_(),calc:tg().calc,crossTraceCalc:tg().crossTraceCalc,plot:a_().plot,style:uC(),styleOne:U0(),moduleType:"trace",name:"pie",basePlotModule:cC(),categories:["pie-like","pie","showLegend"],meta:{}}}}),hC=He({"lib/pie.js"(Y,G){G.exports=fC()}}),vC=He({"src/traces/sunburst/base_plot.js"(Y){var G=yu();Y.name="sunburst",Y.plot=function(d,x,A,E){G.plotBasePlot(Y.name,d,x,A,E)},Y.clean=function(d,x,A,E){G.cleanBasePlot(Y.name,d,x,A,E)}}}),d2=He({"src/traces/sunburst/constants.js"(Y,G){G.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),xy=He({"src/traces/sunburst/attributes.js"(Y,G){var d=cl(),x=Yo().hovertemplateAttrs,A=Yo().texttemplateAttrs,E=kl(),e=mu().attributes,t=Bp(),r=d2(),o=ho().extendFlat,a=Nf().pattern;G.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:o({colors:{valType:"data_array",editType:"calc"},line:{color:o({},t.marker.line.color,{dflt:null}),width:o({},t.marker.line.width,{dflt:1}),editType:"calc"},pattern:a,editType:"calc"},E("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:t.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:A({editType:"plot"},{keys:r.eventDataKeys.concat(["label","value"])}),hovertext:t.hovertext,hoverinfo:o({},d.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:x({},{keys:r.eventDataKeys}),textfont:t.textfont,insidetextorientation:t.insidetextorientation,insidetextfont:t.insidetextfont,outsidetextfont:o({},t.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:t.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:e({name:"sunburst",trace:!0,editType:"calc"})}}}),p2=He({"src/traces/sunburst/layout_attributes.js"(Y,G){G.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),dC=He({"src/traces/sunburst/defaults.js"(Y,G){var d=Gr(),x=xy(),A=mu().defaults,E=Jh().handleText,e=Np().handleMarkerDefaults,t=Kl(),r=t.hasColorscale,o=t.handleDefaults;G.exports=function(i,n,s,c){function f(S,M){return d.coerce(i,n,x,S,M)}var v=f("labels"),h=f("parents");if(!v||!v.length||!h||!h.length){n.visible=!1;return}var T=f("values");T&&T.length?f("branchvalues"):f("count"),f("level"),f("maxdepth"),e(i,n,c,f);var l=n._hasColorscale=r(i,"marker","colors")||(i.marker||{}).coloraxis;l&&o(i,n,c,f,{prefix:"marker.",cLetter:"c"}),f("leaf.opacity",l?1:.7);var y=f("text");f("texttemplate"),n.texttemplate||f("textinfo",d.isArrayOrTypedArray(y)?"text+label":"label"),f("hovertext"),f("hovertemplate");var b="auto";E(i,n,c,f,b,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),f("insidetextorientation"),f("sort"),f("rotation"),f("root.color"),A(n,c,f),n._length=null}}}),pC=He({"src/traces/sunburst/layout_defaults.js"(Y,G){var d=Gr(),x=p2();G.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("sunburstcolorway",e.colorway),t("extendsunburstcolors")}}}),by=He({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y):(d=d||self,x(d.d3=d.d3||{}))})(Y,function(d){function x(Oe,ve){return Oe.parent===ve.parent?1:2}function A(Oe){return Oe.reduce(E,0)/Oe.length}function E(Oe,ve){return Oe+ve.x}function e(Oe){return 1+Oe.reduce(t,0)}function t(Oe,ve){return Math.max(Oe,ve.y)}function r(Oe){for(var ve;ve=Oe.children;)Oe=ve[0];return Oe}function o(Oe){for(var ve;ve=Oe.children;)Oe=ve[ve.length-1];return Oe}function a(){var Oe=x,ve=1,ge=1,be=!1;function Pe(We){var ct,_t=0;We.eachAfter(function(Zt){var lr=Zt.children;lr?(Zt.x=A(lr),Zt.y=e(lr)):(Zt.x=ct?_t+=Oe(Zt,ct):0,Zt.y=0,ct=Zt)});var Mt=r(We),Nt=o(We),Bt=Mt.x-Oe(Mt,Nt)/2,qt=Nt.x+Oe(Nt,Mt)/2;return We.eachAfter(be?function(Zt){Zt.x=(Zt.x-We.x)*ve,Zt.y=(We.y-Zt.y)*ge}:function(Zt){Zt.x=(Zt.x-Bt)/(qt-Bt)*ve,Zt.y=(1-(We.y?Zt.y/We.y:1))*ge})}return Pe.separation=function(We){return arguments.length?(Oe=We,Pe):Oe},Pe.size=function(We){return arguments.length?(be=!1,ve=+We[0],ge=+We[1],Pe):be?null:[ve,ge]},Pe.nodeSize=function(We){return arguments.length?(be=!0,ve=+We[0],ge=+We[1],Pe):be?[ve,ge]:null},Pe}function i(Oe){var ve=0,ge=Oe.children,be=ge&&ge.length;if(!be)ve=1;else for(;--be>=0;)ve+=ge[be].value;Oe.value=ve}function n(){return this.eachAfter(i)}function s(Oe){var ve=this,ge,be=[ve],Pe,We,ct;do for(ge=be.reverse(),be=[];ve=ge.pop();)if(Oe(ve),Pe=ve.children,Pe)for(We=0,ct=Pe.length;We=0;--Pe)ge.push(be[Pe]);return this}function f(Oe){for(var ve=this,ge=[ve],be=[],Pe,We,ct;ve=ge.pop();)if(be.push(ve),Pe=ve.children,Pe)for(We=0,ct=Pe.length;We=0;)ge+=be[Pe].value;ve.value=ge})}function h(Oe){return this.eachBefore(function(ve){ve.children&&ve.children.sort(Oe)})}function T(Oe){for(var ve=this,ge=l(ve,Oe),be=[ve];ve!==ge;)ve=ve.parent,be.push(ve);for(var Pe=be.length;Oe!==ge;)be.splice(Pe,0,Oe),Oe=Oe.parent;return be}function l(Oe,ve){if(Oe===ve)return Oe;var ge=Oe.ancestors(),be=ve.ancestors(),Pe=null;for(Oe=ge.pop(),ve=be.pop();Oe===ve;)Pe=Oe,Oe=ge.pop(),ve=be.pop();return Pe}function y(){for(var Oe=this,ve=[Oe];Oe=Oe.parent;)ve.push(Oe);return ve}function b(){var Oe=[];return this.each(function(ve){Oe.push(ve)}),Oe}function S(){var Oe=[];return this.eachBefore(function(ve){ve.children||Oe.push(ve)}),Oe}function M(){var Oe=this,ve=[];return Oe.each(function(ge){ge!==Oe&&ve.push({source:ge.parent,target:ge})}),ve}function _(Oe,ve){var ge=new m(Oe),be=+Oe.value&&(ge.value=Oe.value),Pe,We=[ge],ct,_t,Mt,Nt;for(ve==null&&(ve=p);Pe=We.pop();)if(be&&(Pe.value=+Pe.data.value),(_t=ve(Pe.data))&&(Nt=_t.length))for(Pe.children=new Array(Nt),Mt=Nt-1;Mt>=0;--Mt)We.push(ct=Pe.children[Mt]=new m(_t[Mt])),ct.parent=Pe,ct.depth=Pe.depth+1;return ge.eachBefore(g)}function w(){return _(this).eachBefore(u)}function p(Oe){return Oe.children}function u(Oe){Oe.data=Oe.data.data}function g(Oe){var ve=0;do Oe.height=ve;while((Oe=Oe.parent)&&Oe.height<++ve)}function m(Oe){this.data=Oe,this.depth=this.height=0,this.parent=null}m.prototype=_.prototype={constructor:m,count:n,each:s,eachAfter:f,eachBefore:c,sum:v,sort:h,path:T,ancestors:y,descendants:b,leaves:S,links:M,copy:w};var R=Array.prototype.slice;function P(Oe){for(var ve=Oe.length,ge,be;ve;)be=Math.random()*ve--|0,ge=Oe[ve],Oe[ve]=Oe[be],Oe[be]=ge;return Oe}function z(Oe){for(var ve=0,ge=(Oe=P(R.call(Oe))).length,be=[],Pe,We;ve0&&ge*ge>be*be+Pe*Pe}function L(Oe,ve){for(var ge=0;geMt?(Pe=(Nt+Mt-We)/(2*Nt),_t=Math.sqrt(Math.max(0,Mt/Nt-Pe*Pe)),ge.x=Oe.x-Pe*be-_t*ct,ge.y=Oe.y-Pe*ct+_t*be):(Pe=(Nt+We-Mt)/(2*Nt),_t=Math.sqrt(Math.max(0,We/Nt-Pe*Pe)),ge.x=ve.x+Pe*be-_t*ct,ge.y=ve.y+Pe*ct+_t*be)):(ge.x=ve.x+ge.r,ge.y=ve.y)}function oe(Oe,ve){var ge=Oe.r+ve.r-1e-6,be=ve.x-Oe.x,Pe=ve.y-Oe.y;return ge>0&&ge*ge>be*be+Pe*Pe}function le(Oe){var ve=Oe._,ge=Oe.next._,be=ve.r+ge.r,Pe=(ve.x*ge.r+ge.x*ve.r)/be,We=(ve.y*ge.r+ge.y*ve.r)/be;return Pe*Pe+We*We}function j(Oe){this._=Oe,this.next=null,this.previous=null}function J(Oe){if(!(Pe=Oe.length))return 0;var ve,ge,be,Pe,We,ct,_t,Mt,Nt,Bt,qt;if(ve=Oe[0],ve.x=0,ve.y=0,!(Pe>1))return ve.r;if(ge=Oe[1],ve.x=-ge.r,ge.x=ve.r,ge.y=0,!(Pe>2))return ve.r+ge.r;ue(ge,ve,be=Oe[2]),ve=new j(ve),ge=new j(ge),be=new j(be),ve.next=be.previous=ge,ge.next=ve.previous=be,be.next=ge.previous=ve;e:for(_t=3;_t0)throw new Error("cycle");return _t}return ge.id=function(be){return arguments.length?(Oe=re(be),ge):Oe},ge.parentId=function(be){return arguments.length?(ve=re(be),ge):ve},ge}function ce(Oe,ve){return Oe.parent===ve.parent?1:2}function Re(Oe){var ve=Oe.children;return ve?ve[0]:Oe.t}function $e(Oe){var ve=Oe.children;return ve?ve[ve.length-1]:Oe.t}function rt(Oe,ve,ge){var be=ge/(ve.i-Oe.i);ve.c-=be,ve.s+=ge,Oe.c+=be,ve.z+=ge,ve.m+=ge}function Je(Oe){for(var ve=0,ge=0,be=Oe.children,Pe=be.length,We;--Pe>=0;)We=be[Pe],We.z+=ve,We.m+=ve,ve+=We.s+(ge+=We.c)}function At(Oe,ve,ge){return Oe.a.parent===ve.parent?Oe.a:ge}function St(Oe,ve){this._=Oe,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=ve}St.prototype=Object.create(m.prototype);function Rt(Oe){for(var ve=new St(Oe,0),ge,be=[ve],Pe,We,ct,_t;ge=be.pop();)if(We=ge._.children)for(ge.children=new Array(_t=We.length),ct=_t-1;ct>=0;--ct)be.push(Pe=ge.children[ct]=new St(We[ct],ct)),Pe.parent=ge;return(ve.parent=new St(null,0)).children=[ve],ve}function Ut(){var Oe=ce,ve=1,ge=1,be=null;function Pe(Nt){var Bt=Rt(Nt);if(Bt.eachAfter(We),Bt.parent.m=-Bt.z,Bt.eachBefore(ct),be)Nt.eachBefore(Mt);else{var qt=Nt,Zt=Nt,lr=Nt;Nt.eachBefore(function(Ia){Ia.xZt.x&&(Zt=Ia),Ia.depth>lr.depth&&(lr=Ia)});var ta=qt===Zt?1:Oe(qt,Zt)/2,da=ta-qt.x,wa=ve/(Zt.x+ta+da),ma=ge/(lr.depth||1);Nt.eachBefore(function(Ia){Ia.x=(Ia.x+da)*wa,Ia.y=Ia.depth*ma})}return Nt}function We(Nt){var Bt=Nt.children,qt=Nt.parent.children,Zt=Nt.i?qt[Nt.i-1]:null;if(Bt){Je(Nt);var lr=(Bt[0].z+Bt[Bt.length-1].z)/2;Zt?(Nt.z=Zt.z+Oe(Nt._,Zt._),Nt.m=Nt.z-lr):Nt.z=lr}else Zt&&(Nt.z=Zt.z+Oe(Nt._,Zt._));Nt.parent.A=_t(Nt,Zt,Nt.parent.A||qt[0])}function ct(Nt){Nt._.x=Nt.z+Nt.parent.m,Nt.m+=Nt.parent.m}function _t(Nt,Bt,qt){if(Bt){for(var Zt=Nt,lr=Nt,ta=Bt,da=Zt.parent.children[0],wa=Zt.m,ma=lr.m,Ia=ta.m,va=da.m,La;ta=$e(ta),Zt=Re(Zt),ta&&Zt;)da=Re(da),lr=$e(lr),lr.a=Nt,La=ta.z+Ia-Zt.z-wa+Oe(ta._,Zt._),La>0&&(rt(At(ta,Nt,qt),Nt,La),wa+=La,ma+=La),Ia+=ta.m,wa+=Zt.m,va+=da.m,ma+=lr.m;ta&&!$e(lr)&&(lr.t=ta,lr.m+=Ia-ma),Zt&&!Re(da)&&(da.t=Zt,da.m+=wa-va,qt=Nt)}return qt}function Mt(Nt){Nt.x*=ve,Nt.y=Nt.depth*ge}return Pe.separation=function(Nt){return arguments.length?(Oe=Nt,Pe):Oe},Pe.size=function(Nt){return arguments.length?(be=!1,ve=+Nt[0],ge=+Nt[1],Pe):be?null:[ve,ge]},Pe.nodeSize=function(Nt){return arguments.length?(be=!0,ve=+Nt[0],ge=+Nt[1],Pe):be?[ve,ge]:null},Pe}function ir(Oe,ve,ge,be,Pe){for(var We=Oe.children,ct,_t=-1,Mt=We.length,Nt=Oe.value&&(Pe-ge)/Oe.value;++_tIa&&(Ia=Nt),Vt=wa*wa*Ka,va=Math.max(Ia/Vt,Vt/ma),va>La){wa-=Nt;break}La=va}ct.push(Mt={value:wa,dice:lr1?be:1)},ge}(ar);function dr(){var Oe=fr,ve=!1,ge=1,be=1,Pe=[0],We=ee,ct=ee,_t=ee,Mt=ee,Nt=ee;function Bt(Zt){return Zt.x0=Zt.y0=0,Zt.x1=ge,Zt.y1=be,Zt.eachBefore(qt),Pe=[0],ve&&Zt.eachBefore(Fe),Zt}function qt(Zt){var lr=Pe[Zt.depth],ta=Zt.x0+lr,da=Zt.y0+lr,wa=Zt.x1-lr,ma=Zt.y1-lr;wa=Zt-1){var Ia=We[qt];Ia.x0=ta,Ia.y0=da,Ia.x1=wa,Ia.y1=ma;return}for(var va=Nt[qt],La=lr/2+va,Ka=qt+1,Vt=Zt-1;Ka>>1;Nt[Lt]ma-da){var gr=(ta*Ot+wa*jt)/lr;Bt(qt,Ka,jt,ta,da,gr,ma),Bt(Ka,Zt,Ot,gr,da,wa,ma)}else{var Br=(da*Ot+ma*jt)/lr;Bt(qt,Ka,jt,ta,da,wa,Br),Bt(Ka,Zt,Ot,ta,Br,wa,ma)}}}function ze(Oe,ve,ge,be,Pe){(Oe.depth&1?ir:Ce)(Oe,ve,ge,be,Pe)}var Ge=function Oe(ve){function ge(be,Pe,We,ct,_t){if((Mt=be._squarify)&&Mt.ratio===ve)for(var Mt,Nt,Bt,qt,Zt=-1,lr,ta=Mt.length,da=be.value;++Zt1?be:1)},ge}(ar);d.cluster=a,d.hierarchy=_,d.pack=ie,d.packEnclose=z,d.packSiblings=$,d.partition=qe,d.stratify=xe,d.tree=Ut,d.treemap=dr,d.treemapBinary=pt,d.treemapDice=Ce,d.treemapResquarify=Ge,d.treemapSlice=ir,d.treemapSliceDice=ze,d.treemapSquarify=fr,Object.defineProperty(d,"__esModule",{value:!0})})}}),wy=He({"src/traces/sunburst/calc.js"(Y){var G=by(),d=Hi(),x=Gr(),A=Kl().makeColorScaleFuncFromTrace,E=tg().makePullColorFn,e=tg().generateExtendedColors,t=Kl().calc,r=lo().ALMOST_EQUAL,o={},a={},i={};Y.calc=function(s,c){var f=s._fullLayout,v=c.ids,h=x.isArrayOrTypedArray(v),T=c.labels,l=c.parents,y=c.values,b=x.isArrayOrTypedArray(y),S=[],M={},_={},w=function($,X){M[$]?M[$].push(X):M[$]=[X],_[X]=1},p=function($){return $||typeof $=="number"},u=function($){return!b||d(y[$])&&y[$]>=0},g,m,R;h?(g=Math.min(v.length,l.length),m=function($){return p(v[$])&&u($)},R=function($){return String(v[$])}):(g=Math.min(T.length,l.length),m=function($){return p(T[$])&&u($)},R=function($){return String(T[$])}),b&&(g=Math.min(g,y.length));for(var P=0;P1){for(var N=x.randstr(),U=0;U>8&15|G>>4&240,G>>4&15|G&240,(G&15)<<4|G&15,1):d===8?Ty(G>>24&255,G>>16&255,G>>8&255,(G&255)/255):d===4?Ty(G>>12&15|G>>8&240,G>>8&15|G>>4&240,G>>4&15|G&240,((G&15)<<4|G&15)/255):null):(G=S2.exec(Y))?new Vf(G[1],G[2],G[3],1):(G=M2.exec(Y))?new Vf(G[1]*255/100,G[2]*255/100,G[3]*255/100,1):(G=E2.exec(Y))?Ty(G[1],G[2],G[3],G[4]):(G=k2.exec(Y))?Ty(G[1]*255/100,G[2]*255/100,G[3]*255/100,G[4]):(G=C2.exec(Y))?b2(G[1],G[2]/100,G[3]/100,1):(G=L2.exec(Y))?b2(G[1],G[2]/100,G[3]/100,G[4]):l_.hasOwnProperty(Y)?m2(l_[Y]):Y==="transparent"?new Vf(NaN,NaN,NaN,0):null}function m2(Y){return new Vf(Y>>16&255,Y>>8&255,Y&255,1)}function Ty(Y,G,d,x){return x<=0&&(Y=G=d=NaN),new Vf(Y,G,d,x)}function i_(Y){return Y instanceof sd||(Y=ag(Y)),Y?(Y=Y.rgb(),new Vf(Y.r,Y.g,Y.b,Y.opacity)):new Vf}function Ay(Y,G,d,x){return arguments.length===1?i_(Y):new Vf(Y,G,d,x??1)}function Vf(Y,G,d,x){this.r=+Y,this.g=+G,this.b=+d,this.opacity=+x}function _2(){return`#${Kd(this.r)}${Kd(this.g)}${Kd(this.b)}`}function mC(){return`#${Kd(this.r)}${Kd(this.g)}${Kd(this.b)}${Kd((isNaN(this.opacity)?1:this.opacity)*255)}`}function x2(){const Y=Sy(this.opacity);return`${Y===1?"rgb(":"rgba("}${Yd(this.r)}, ${Yd(this.g)}, ${Yd(this.b)}${Y===1?")":`, ${Y})`}`}function Sy(Y){return isNaN(Y)?1:Math.max(0,Math.min(1,Y))}function Yd(Y){return Math.max(0,Math.min(255,Math.round(Y)||0))}function Kd(Y){return Y=Yd(Y),(Y<16?"0":"")+Y.toString(16)}function b2(Y,G,d,x){return x<=0?Y=G=d=NaN:d<=0||d>=1?Y=G=NaN:G<=0&&(Y=NaN),new cv(Y,G,d,x)}function w2(Y){if(Y instanceof cv)return new cv(Y.h,Y.s,Y.l,Y.opacity);if(Y instanceof sd||(Y=ag(Y)),!Y)return new cv;if(Y instanceof cv)return Y;Y=Y.rgb();var G=Y.r/255,d=Y.g/255,x=Y.b/255,A=Math.min(G,d,x),E=Math.max(G,d,x),e=NaN,t=E-A,r=(E+A)/2;return t?(G===E?e=(d-x)/t+(d0&&r<1?0:e,new cv(e,t,r,Y.opacity)}function o_(Y,G,d,x){return arguments.length===1?w2(Y):new cv(Y,G,d,x??1)}function cv(Y,G,d,x){this.h=+Y,this.s=+G,this.l=+d,this.opacity=+x}function T2(Y){return Y=(Y||0)%360,Y<0?Y+360:Y}function My(Y){return Math.max(0,Math.min(1,Y||0))}function s_(Y,G,d){return(Y<60?G+(d-G)*Y/60:Y<180?d:Y<240?G+(d-G)*(240-Y)/60:G)*255}var ld,Jd,$d,jp,fv,A2,S2,M2,E2,k2,C2,L2,l_,u_=ks({"node_modules/d3-color/src/color.js"(){n_(),ld=.7,Jd=1/ld,$d="\\s*([+-]?\\d+)\\s*",jp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fv="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",A2=/^#([0-9a-f]{3,8})$/,S2=new RegExp(`^rgb\\(${$d},${$d},${$d}\\)$`),M2=new RegExp(`^rgb\\(${fv},${fv},${fv}\\)$`),E2=new RegExp(`^rgba\\(${$d},${$d},${$d},${jp}\\)$`),k2=new RegExp(`^rgba\\(${fv},${fv},${fv},${jp}\\)$`),C2=new RegExp(`^hsl\\(${jp},${fv},${fv}\\)$`),L2=new RegExp(`^hsla\\(${jp},${fv},${fv},${jp}\\)$`),l_={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},Up(sd,ag,{copy(Y){return Object.assign(new this.constructor,this,Y)},displayable(){return this.rgb().displayable()},hex:g2,formatHex:g2,formatHex8:gC,formatHsl:yC,formatRgb:y2,toString:y2}),Up(Vf,Ay,rg(sd,{brighter(Y){return Y=Y==null?Jd:Math.pow(Jd,Y),new Vf(this.r*Y,this.g*Y,this.b*Y,this.opacity)},darker(Y){return Y=Y==null?ld:Math.pow(ld,Y),new Vf(this.r*Y,this.g*Y,this.b*Y,this.opacity)},rgb(){return this},clamp(){return new Vf(Yd(this.r),Yd(this.g),Yd(this.b),Sy(this.opacity))},displayable(){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:_2,formatHex:_2,formatHex8:mC,formatRgb:x2,toString:x2})),Up(cv,o_,rg(sd,{brighter(Y){return Y=Y==null?Jd:Math.pow(Jd,Y),new cv(this.h,this.s,this.l*Y,this.opacity)},darker(Y){return Y=Y==null?ld:Math.pow(ld,Y),new cv(this.h,this.s,this.l*Y,this.opacity)},rgb(){var Y=this.h%360+(this.h<0)*360,G=isNaN(Y)||isNaN(this.s)?0:this.s,d=this.l,x=d+(d<.5?d:1-d)*G,A=2*d-x;return new Vf(s_(Y>=240?Y-240:Y+120,A,x),s_(Y,A,x),s_(Y<120?Y+240:Y-120,A,x),this.opacity)},clamp(){return new cv(T2(this.h),My(this.s),My(this.l),Sy(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const Y=Sy(this.opacity);return`${Y===1?"hsl(":"hsla("}${T2(this.h)}, ${My(this.s)*100}%, ${My(this.l)*100}%${Y===1?")":`, ${Y})`}`}}))}}),c_,f_,P2=ks({"node_modules/d3-color/src/math.js"(){c_=Math.PI/180,f_=180/Math.PI}});function I2(Y){if(Y instanceof Mv)return new Mv(Y.l,Y.a,Y.b,Y.opacity);if(Y instanceof Hv)return R2(Y);Y instanceof Vf||(Y=i_(Y));var G=g_(Y.r),d=g_(Y.g),x=g_(Y.b),A=v_((.2225045*G+.7168786*d+.0606169*x)/__),E,e;return G===d&&d===x?E=e=A:(E=v_((.4360747*G+.3850649*d+.1430804*x)/m_),e=v_((.0139322*G+.0971045*d+.7141733*x)/x_)),new Mv(116*A-16,500*(E-A),200*(A-e),Y.opacity)}function h_(Y,G,d,x){return arguments.length===1?I2(Y):new Mv(Y,G,d,x??1)}function Mv(Y,G,d,x){this.l=+Y,this.a=+G,this.b=+d,this.opacity=+x}function v_(Y){return Y>D2?Math.pow(Y,.3333333333333333):Y/w_+b_}function d_(Y){return Y>Qd?Y*Y*Y:w_*(Y-b_)}function p_(Y){return 255*(Y<=.0031308?12.92*Y:1.055*Math.pow(Y,.4166666666666667)-.055)}function g_(Y){return(Y/=255)<=.04045?Y/12.92:Math.pow((Y+.055)/1.055,2.4)}function _C(Y){if(Y instanceof Hv)return new Hv(Y.h,Y.c,Y.l,Y.opacity);if(Y instanceof Mv||(Y=I2(Y)),Y.a===0&&Y.b===0)return new Hv(NaN,0=1?(d=1,G-1):Math.floor(d*G),A=Y[x],E=Y[x+1],e=x>0?Y[x-1]:2*A-E,t=x()=>Y}});function U2(Y,G){return function(d){return Y+d*G}}function TC(Y,G,d){return Y=Math.pow(Y,d),G=Math.pow(G,d)-Y,d=1/d,function(x){return Math.pow(Y+x*G,d)}}function Cy(Y,G){var d=G-Y;return d?U2(Y,d>180||d<-180?d-360*Math.round(d/360):d):og(isNaN(Y)?G:Y)}function AC(Y){return(Y=+Y)==1?qf:function(G,d){return d-G?TC(G,d,Y):og(isNaN(G)?d:G)}}function qf(Y,G){var d=G-Y;return d?U2(Y,d):og(isNaN(Y)?G:Y)}var Hp=ks({"node_modules/d3-interpolate/src/color.js"(){N2()}});function j2(Y){return function(G){var d=G.length,x=new Array(d),A=new Array(d),E=new Array(d),e,t;for(e=0;ed&&(E=G.slice(d,E),t[e]?t[e]+=E:t[++e]=E),(x=x[0])===(A=A[0])?t[e]?t[e]+=A:t[++e]=A:(t[++e]=null,r.push({i:e,x:Ev(x,A)})),d=Ry.lastIndex;return d180?a+=360:a-o>180&&(o+=360),n.push({i:i.push(A(i)+"rotate(",null,x)-2,x:Ev(o,a)})):a&&i.push(A(i)+"rotate("+a+x)}function t(o,a,i,n){o!==a?n.push({i:i.push(A(i)+"skewX(",null,x)-2,x:Ev(o,a)}):a&&i.push(A(i)+"skewX("+a+x)}function r(o,a,i,n,s,c){if(o!==i||a!==n){var f=s.push(A(s)+"scale(",null,",",null,")");c.push({i:f-4,x:Ev(o,i)},{i:f-2,x:Ev(a,n)})}else(i!==1||n!==1)&&s.push(A(s)+"scale("+i+","+n+")")}return function(o,a){var i=[],n=[];return o=Y(o),a=Y(a),E(o.translateX,o.translateY,a.translateX,a.translateY,i,n),e(o.rotate,a.rotate,i,n),t(o.skewX,a.skewX,i,n),r(o.scaleX,o.scaleY,a.scaleX,a.scaleY,i,n),o=a=null,function(s){for(var c=-1,f=n.length,v;++cDy,interpolateArray:()=>SC,interpolateBasis:()=>F2,interpolateBasisClosed:()=>O2,interpolateCubehelix:()=>d3,interpolateCubehelixLong:()=>p3,interpolateDate:()=>X2,interpolateDiscrete:()=>kC,interpolateHcl:()=>f3,interpolateHclLong:()=>h3,interpolateHsl:()=>l3,interpolateHslLong:()=>u3,interpolateHue:()=>LC,interpolateLab:()=>qC,interpolateNumber:()=>Ev,interpolateNumberArray:()=>C_,interpolateObject:()=>K2,interpolateRgb:()=>Ly,interpolateRgbBasis:()=>V2,interpolateRgbBasisClosed:()=>q2,interpolateRound:()=>IC,interpolateString:()=>$2,interpolateTransformCss:()=>r3,interpolateTransformSvg:()=>a3,interpolateZoom:()=>o3,piecewise:()=>ZC,quantize:()=>YC});var Gp=ks({"node_modules/d3-interpolate/src/index.js"(){zy(),Z2(),k_(),B2(),Y2(),CC(),PC(),Py(),L_(),J2(),RC(),Q2(),BC(),jC(),H2(),VC(),HC(),GC(),WC(),XC(),KC()}}),I_=He({"src/traces/sunburst/fill_one.js"(Y,G){var d=vo(),x=Ai();G.exports=function(E,e,t,r,o){var a=e.data.data,i=a.i,n=o||a.color;if(i>=0){e.i=a.i;var s=t.marker;s.pattern?(!s.colors||!s.pattern.shape)&&(s.color=n,e.color=n):(s.color=n,e.color=n),d.pointStyle(E,t,r,e)}else x.fill(E,n)}}}),g3=He({"src/traces/sunburst/style.js"(Y,G){var d=Qn(),x=Ai(),A=Gr(),E=hh().resizeText,e=I_();function t(o){var a=o._fullLayout._sunburstlayer.selectAll(".trace");E(o,a,"sunburst"),a.each(function(i){var n=d.select(this),s=i[0],c=s.trace;n.style("opacity",c.opacity),n.selectAll("path.surface").each(function(f){d.select(this).call(r,f,c,o)})})}function r(o,a,i,n){var s=a.data.data,c=!a.children,f=s.i,v=A.castOption(i,f,"marker.line.color")||x.defaultLine,h=A.castOption(i,f,"marker.line.width")||0;o.call(e,a,i,n).style("stroke-width",h).call(x.stroke,v).style("opacity",c?i.leaf.opacity:null)}G.exports={style:t,styleOne:r}}}),ud=He({"src/traces/sunburst/helpers.js"(Y){var G=Gr(),d=Ai(),x=xv(),A=Hd();Y.findEntryWithLevel=function(r,o){var a;return o&&r.eachAfter(function(i){if(Y.getPtId(i)===o)return a=i.copy()}),a||r},Y.findEntryWithChild=function(r,o){var a;return r.eachAfter(function(i){for(var n=i.children||[],s=0;s0)},Y.getMaxDepth=function(r){return r.maxdepth>=0?r.maxdepth:1/0},Y.isHeader=function(r,o){return!(Y.isLeaf(r)||r.depth===o._maxDepth-1)};function t(r){return r.data.data.pid}Y.getParent=function(r,o){return Y.findEntryWithLevel(r,t(o))},Y.listPath=function(r,o){var a=r.parent;if(!a)return[];var i=o?[a.data[o]]:[a];return Y.listPath(a,o).concat(i)},Y.getPath=function(r){return Y.listPath(r,"label").join("/")+"/"},Y.formatValue=A.formatPieValue,Y.formatPercent=function(r,o){var a=G.formatPercent(r,0);return a==="0%"&&(a=A.formatPiePercent(r,o)),a}}}),By=He({"src/traces/sunburst/fx.js"(Y,G){var d=Qn(),x=Ei(),A=Ph().appendArrayPointValue,E=Wu(),e=Gr(),t=z0(),r=ud(),o=Hd(),a=o.formatPieValue;G.exports=function(s,c,f,v,h){var T=v[0],l=T.trace,y=T.hierarchy,b=l.type==="sunburst",S=l.type==="treemap"||l.type==="icicle";"_hasHoverLabel"in l||(l._hasHoverLabel=!1),"_hasHoverEvent"in l||(l._hasHoverEvent=!1);var M=function(p){var u=f._fullLayout;if(!(f._dragging||u.hovermode===!1)){var g=f._fullData[l.index],m=p.data.data,R=m.i,P=r.isHierarchyRoot(p),z=r.getParent(y,p),F=r.getValue(p),B=function(ae){return e.castOption(g,R,ae)},O=B("hovertemplate"),L=E.castHoverinfo(g,u,R),N=u.separators,U;if(O||L&&L!=="none"&&L!=="skip"){var Z,Q;b&&(Z=T.cx+p.pxmid[0]*(1-p.rInscribed),Q=T.cy+p.pxmid[1]*(1-p.rInscribed)),S&&(Z=p._hoverX,Q=p._hoverY);var ue={},oe=[],le=[],j=function(ae){return oe.indexOf(ae)!==-1};L&&(oe=L==="all"?g._module.attributes.hoverinfo.flags:L.split("+")),ue.label=m.label,j("label")&&ue.label&&le.push(ue.label),m.hasOwnProperty("v")&&(ue.value=m.v,ue.valueLabel=a(ue.value,N),j("value")&&le.push(ue.valueLabel)),ue.currentPath=p.currentPath=r.getPath(p.data),j("current path")&&!P&&le.push(ue.currentPath);var J,$=[],X=function(){$.indexOf(J)===-1&&(le.push(J),$.push(J))};ue.percentParent=p.percentParent=F/r.getValue(z),ue.parent=p.parentString=r.getPtLabel(z),j("percent parent")&&(J=r.formatPercent(ue.percentParent,N)+" of "+ue.parent,X()),ue.percentEntry=p.percentEntry=F/r.getValue(c),ue.entry=p.entry=r.getPtLabel(c),j("percent entry")&&!P&&!p.onPathbar&&(J=r.formatPercent(ue.percentEntry,N)+" of "+ue.entry,X()),ue.percentRoot=p.percentRoot=F/r.getValue(y),ue.root=p.root=r.getPtLabel(y),j("percent root")&&!P&&(J=r.formatPercent(ue.percentRoot,N)+" of "+ue.root,X()),ue.text=B("hovertext")||B("text"),j("text")&&(J=ue.text,e.isValidTextValue(J)&&le.push(J)),U=[i(p,g,h.eventDataKeys)];var re={trace:g,y:Q,_x0:p._x0,_x1:p._x1,_y0:p._y0,_y1:p._y1,text:le.join("
"),name:O||j("name")?g.name:void 0,color:B("hoverlabel.bgcolor")||m.color,borderColor:B("hoverlabel.bordercolor"),fontFamily:B("hoverlabel.font.family"),fontSize:B("hoverlabel.font.size"),fontColor:B("hoverlabel.font.color"),fontWeight:B("hoverlabel.font.weight"),fontStyle:B("hoverlabel.font.style"),fontVariant:B("hoverlabel.font.variant"),nameLength:B("hoverlabel.namelength"),textAlign:B("hoverlabel.align"),hovertemplate:O,hovertemplateLabels:ue,eventData:U};b&&(re.x0=Z-p.rInscribed*p.rpx1,re.x1=Z+p.rInscribed*p.rpx1,re.idealAlign=p.pxmid[0]<0?"left":"right"),S&&(re.x=Z,re.idealAlign=Z<0?"left":"right");var ee=[];E.loneHover(re,{container:u._hoverlayer.node(),outerContainer:u._paper.node(),gd:f,inOut_bbox:ee}),U[0].bbox=ee[0],l._hasHoverLabel=!0}if(S){var q=s.select("path.surface");h.styleOne(q,p,g,f,{hovered:!0})}l._hasHoverEvent=!0,f.emit("plotly_hover",{points:U||[i(p,g,h.eventDataKeys)],event:d.event})}},_=function(p){var u=f._fullLayout,g=f._fullData[l.index],m=d.select(this).datum();if(l._hasHoverEvent&&(p.originalEvent=d.event,f.emit("plotly_unhover",{points:[i(m,g,h.eventDataKeys)],event:d.event}),l._hasHoverEvent=!1),l._hasHoverLabel&&(E.loneUnhover(u._hoverlayer.node()),l._hasHoverLabel=!1),S){var R=s.select("path.surface");h.styleOne(R,m,g,f,{hovered:!1})}},w=function(p){var u=f._fullLayout,g=f._fullData[l.index],m=b&&(r.isHierarchyRoot(p)||r.isLeaf(p)),R=r.getPtId(p),P=r.isEntry(p)?r.findEntryWithChild(y,R):r.findEntryWithLevel(y,R),z=r.getPtId(P),F={points:[i(p,g,h.eventDataKeys)],event:d.event};m||(F.nextLevel=z);var B=t.triggerHandler(f,"plotly_"+l.type+"click",F);if(B!==!1&&u.hovermode&&(f._hoverdata=[i(p,g,h.eventDataKeys)],E.click(f,d.event)),!m&&B!==!1&&!f._dragging&&!f._transitioning){x.call("_storeDirectGUIEdit",g,u._tracePreGUI[g.uid],{level:g.level});var O={data:[{level:z}],traces:[l.index]},L={frame:{redraw:!1,duration:h.transitionTime},transition:{duration:h.transitionTime,easing:h.transitionEasing},mode:"immediate",fromcurrent:!0};E.loneUnhover(u._hoverlayer.node()),x.call("animate",f,O,L)}};s.on("mouseover",M),s.on("mouseout",_),s.on("click",w)};function i(n,s,c){for(var f=n.data.data,v={curveNumber:s.index,pointNumber:f.i,data:s._input,fullData:s},h=0;hrt.x1?2*Math.PI:0)+ae;Je=ce.rpx1qe?2*Math.PI:0)+ae;$e={x0:Je,x1:Je}}else $e={rpx0:oe,rpx1:oe},E.extendFlat($e,xe(ce));else $e={rpx0:0,rpx1:0};else $e={x0:ae,x1:ae};return x($e,rt)}function Me(ce){var Re=$[T.getPtId(ce)],$e,rt=ce.transform;if(Re)$e=Re;else if($e={rpx1:ce.rpx1,transform:{textPosAngle:rt.textPosAngle,scale:0,rotate:rt.rotate,rCenter:rt.rCenter,x:rt.x,y:rt.y}},J)if(ce.parent)if(qe){var Je=ce.x1>qe?2*Math.PI:0;$e.x0=$e.x1=Je}else E.extendFlat($e,xe(ce));else $e.x0=$e.x1=ae;else $e.x0=$e.x1=ae;var At=x($e.transform.textPosAngle,ce.transform.textPosAngle),St=x($e.rpx1,ce.rpx1),Rt=x($e.x0,ce.x0),Ut=x($e.x1,ce.x1),ir=x($e.transform.scale,rt.scale),ar=x($e.transform.rotate,rt.rotate),Mr=rt.rCenter===0?3:$e.transform.rCenter===0?1/3:1,fr=x($e.transform.rCenter,rt.rCenter),dr=function(pt){return fr(Math.pow(pt,Mr))};return function(pt){var ze=St(pt),Ge=Rt(pt),Oe=Ut(pt),ve=dr(pt),ge=we(ze,(Ge+Oe)/2),be=At(pt),Pe={pxmid:ge,rpx1:ze,transform:{textPosAngle:be,rCenter:ve,x:rt.x,y:rt.y}};return r(B.type,rt,m),{transform:{targetX:Fe(Pe),targetY:Ce(Pe),scale:ir(pt),rotate:ar(pt),rCenter:ve}}}}function xe(ce){var Re=ce.parent,$e=$[T.getPtId(Re)],rt={};if($e){var Je=Re.children,At=Je.indexOf(ce),St=Je.length,Rt=x($e.x0,$e.x1);rt.x0=Rt(At/St),rt.x1=Rt(At/St)}else rt.x0=rt.x1=0;return rt}}function y(_){return d.partition().size([2*Math.PI,_.height+1])(_)}Y.formatSliceLabel=function(_,w,p,u,g){var m=p.texttemplate,R=p.textinfo;if(!m&&(!R||R==="none"))return"";var P=g.separators,z=u[0],F=_.data.data,B=z.hierarchy,O=T.isHierarchyRoot(_),L=T.getParent(B,_),N=T.getValue(_);if(!m){var U=R.split("+"),Z=function(ee){return U.indexOf(ee)!==-1},Q=[],ue;if(Z("label")&&F.label&&Q.push(F.label),F.hasOwnProperty("v")&&Z("value")&&Q.push(T.formatValue(F.v,P)),!O){Z("current path")&&Q.push(T.getPath(_.data));var oe=0;Z("percent parent")&&oe++,Z("percent entry")&&oe++,Z("percent root")&&oe++;var le=oe>1;if(oe){var j,J=function(ee){ue=T.formatPercent(j,P),le&&(ue+=" of "+ee),Q.push(ue)};Z("percent parent")&&!O&&(j=N/T.getValue(L),J("parent")),Z("percent entry")&&(j=N/T.getValue(w),J("entry")),Z("percent root")&&(j=N/T.getValue(B),J("root"))}}return Z("text")&&(ue=E.castOption(p,F.i,"text"),E.isValidTextValue(ue)&&Q.push(ue)),Q.join("
")}var $=E.castOption(p,F.i,"texttemplate");if(!$)return"";var X={};F.label&&(X.label=F.label),F.hasOwnProperty("v")&&(X.value=F.v,X.valueLabel=T.formatValue(F.v,P)),X.currentPath=T.getPath(_.data),O||(X.percentParent=N/T.getValue(L),X.percentParentLabel=T.formatPercent(X.percentParent,P),X.parent=T.getPtLabel(L)),X.percentEntry=N/T.getValue(w),X.percentEntryLabel=T.formatPercent(X.percentEntry,P),X.entry=T.getPtLabel(w),X.percentRoot=N/T.getValue(B),X.percentRootLabel=T.formatPercent(X.percentRoot,P),X.root=T.getPtLabel(B),F.hasOwnProperty("color")&&(X.color=F.color);var re=E.castOption(p,F.i,"text");return(E.isValidTextValue(re)||re==="")&&(X.text=re),X.customdata=E.castOption(p,F.i,"customdata"),E.texttemplateString($,X,g._d3locale,X,p._meta||{})};function b(_){return _.rpx0===0&&E.isFullCircle([_.x0,_.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(_.halfangle)),_.ring/2))}function S(_){return M(_.rpx1,_.transform.textPosAngle)}function M(_,w){return[_*Math.sin(w),-_*Math.cos(w)]}}}),JC=He({"src/traces/sunburst/index.js"(Y,G){G.exports={moduleType:"trace",name:"sunburst",basePlotModule:vC(),categories:[],animatable:!0,attributes:xy(),layoutAttributes:p2(),supplyDefaults:dC(),supplyLayoutDefaults:pC(),calc:wy().calc,crossTraceCalc:wy().crossTraceCalc,plot:R_().plot,style:g3().style,colorbar:ah(),meta:{}}}}),$C=He({"lib/sunburst.js"(Y,G){G.exports=JC()}}),QC=He({"src/traces/treemap/base_plot.js"(Y){var G=yu();Y.name="treemap",Y.plot=function(d,x,A,E){G.plotBasePlot(Y.name,d,x,A,E)},Y.clean=function(d,x,A,E){G.cleanBasePlot(Y.name,d,x,A,E)}}}),Wp=He({"src/traces/treemap/constants.js"(Y,G){G.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),D_=He({"src/traces/treemap/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=Yo().texttemplateAttrs,A=kl(),E=mu().attributes,e=Bp(),t=xy(),r=Wp(),o=ho().extendFlat,a=Nf().pattern;G.exports={labels:t.labels,parents:t.parents,values:t.values,branchvalues:t.branchvalues,count:t.count,level:t.level,maxdepth:t.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:o({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:t.marker.colors,pattern:a,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:t.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},A("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:o({},e.textfont,{}),editType:"calc"},text:e.text,textinfo:t.textinfo,texttemplate:x({editType:"plot"},{keys:r.eventDataKeys.concat(["label","value"])}),hovertext:e.hovertext,hoverinfo:t.hoverinfo,hovertemplate:d({},{keys:r.eventDataKeys}),textfont:e.textfont,insidetextfont:e.insidetextfont,outsidetextfont:o({},e.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:e.sort,root:t.root,domain:E({name:"treemap",trace:!0,editType:"calc"})}}}),y3=He({"src/traces/treemap/layout_attributes.js"(Y,G){G.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),eL=He({"src/traces/treemap/defaults.js"(Y,G){var d=Gr(),x=D_(),A=Ai(),E=mu().defaults,e=Jh().handleText,t=Rp().TEXTPAD,r=Np().handleMarkerDefaults,o=Kl(),a=o.hasColorscale,i=o.handleDefaults;G.exports=function(s,c,f,v){function h(g,m){return d.coerce(s,c,x,g,m)}var T=h("labels"),l=h("parents");if(!T||!T.length||!l||!l.length){c.visible=!1;return}var y=h("values");y&&y.length?h("branchvalues"):h("count"),h("level"),h("maxdepth");var b=h("tiling.packing");b==="squarify"&&h("tiling.squarifyratio"),h("tiling.flip"),h("tiling.pad");var S=h("text");h("texttemplate"),c.texttemplate||h("textinfo",d.isArrayOrTypedArray(S)?"text+label":"label"),h("hovertext"),h("hovertemplate");var M=h("pathbar.visible"),_="auto";e(s,c,v,h,_,{hasPathbar:M,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("textposition");var w=c.textposition.indexOf("bottom")!==-1;r(s,c,v,h);var p=c._hasColorscale=a(s,"marker","colors")||(s.marker||{}).coloraxis;p?i(s,c,v,h,{prefix:"marker.",cLetter:"c"}):h("marker.depthfade",!(c.marker.colors||[]).length);var u=c.textfont.size*2;h("marker.pad.t",w?u/4:u),h("marker.pad.l",u/4),h("marker.pad.r",u/4),h("marker.pad.b",w?u:u/4),h("marker.cornerradius"),c._hovered={marker:{line:{width:2,color:A.contrast(v.paper_bgcolor)}}},M&&(h("pathbar.thickness",c.pathbar.textfont.size+2*t),h("pathbar.side"),h("pathbar.edgeshape")),h("sort"),h("root.color"),E(c,v,h),c._length=null}}}),tL=He({"src/traces/treemap/layout_defaults.js"(Y,G){var d=Gr(),x=y3();G.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("treemapcolorway",e.colorway),t("extendtreemapcolors")}}}),m3=He({"src/traces/treemap/calc.js"(Y){var G=wy();Y.calc=function(d,x){return G.calc(d,x)},Y.crossTraceCalc=function(d){return G._runCrossTraceCalc("treemap",d)}}}),_3=He({"src/traces/treemap/flip_tree.js"(Y,G){G.exports=function d(x,A,E){var e;E.swapXY&&(e=x.x0,x.x0=x.y0,x.y0=e,e=x.x1,x.x1=x.y1,x.y1=e),E.flipX&&(e=x.x0,x.x0=A[0]-x.x1,x.x1=A[0]-e),E.flipY&&(e=x.y0,x.y0=A[1]-x.y1,x.y1=A[1]-e);var t=x.children;if(t)for(var r=0;r0)for(var u=0;u").join(" ")||"";var le=x.ensureSingle(ue,"g","slicetext"),j=x.ensureSingle(le,"text","",function($){$.attr("data-notex",1)}),J=x.ensureUniformFontSize(s,o.determineTextFont(B,Q,z.font,{onPathbar:!0}));j.text(Q._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(A.font,J).call(E.convertToTspans,s),Q.textBB=A.bBox(j.node()),Q.transform=_(Q,{fontSize:J.size,onPathbar:!0}),Q.transform.fontSize=J.size,p?j.transition().attrTween("transform",function($){var X=m($,i,R,[l,y]);return function(re){return w(X(re))}}):j.attr("transform",w(Q))})}}}),aL=He({"src/traces/treemap/plot_one.js"(Y,G){var d=Qn(),x=(Gp(),Go(tp)).interpolate,A=ud(),E=Gr(),e=Rp().TEXTPAD,t=Dp(),r=t.toMoveInsideBar,o=hh(),a=o.recordMinTextSize,i=Wp(),n=rL();function s(c){return A.isHierarchyRoot(c)?"":A.getPtId(c)}G.exports=function(f,v,h,T,l){var y=f._fullLayout,b=v[0],S=b.trace,M=S.type,_=M==="icicle",w=b.hierarchy,p=A.findEntryWithLevel(w,S.level),u=d.select(h),g=u.selectAll("g.pathbar"),m=u.selectAll("g.slice");if(!p){g.remove(),m.remove();return}var R=A.isHierarchyRoot(p),P=!y.uniformtext.mode&&A.hasTransition(T),z=A.getMaxDepth(S),F=function(fr){return fr.data.depth-p.data.depth-1?N+Q:-(Z+Q):0,oe={x0:U,x1:U,y0:ue,y1:ue+Z},le=function(fr,dr,pt){var ze=S.tiling.pad,Ge=function(be){return be-ze<=dr.x0},Oe=function(be){return be+ze>=dr.x1},ve=function(be){return be-ze<=dr.y0},ge=function(be){return be+ze>=dr.y1};return fr.x0===dr.x0&&fr.x1===dr.x1&&fr.y0===dr.y0&&fr.y1===dr.y1?{x0:fr.x0,x1:fr.x1,y0:fr.y0,y1:fr.y1}:{x0:Ge(fr.x0-ze)?0:Oe(fr.x0-ze)?pt[0]:fr.x0,x1:Ge(fr.x1+ze)?0:Oe(fr.x1+ze)?pt[0]:fr.x1,y0:ve(fr.y0-ze)?0:ge(fr.y0-ze)?pt[1]:fr.y0,y1:ve(fr.y1+ze)?0:ge(fr.y1+ze)?pt[1]:fr.y1}},j=null,J={},$={},X=null,re=function(fr,dr){return dr?J[s(fr)]:$[s(fr)]},ee=function(fr,dr,pt,ze){if(dr)return J[s(w)]||oe;var Ge=$[S.level]||pt;return F(fr)?le(fr,Ge,ze):{}};b.hasMultipleRoots&&R&&z++,S._maxDepth=z,S._backgroundColor=y.paper_bgcolor,S._entryDepth=p.data.depth,S._atRootLevel=R;var q=-L/2+B.l+B.w*(O.x[1]+O.x[0])/2,ae=-N/2+B.t+B.h*(1-(O.y[1]+O.y[0])/2),ie=function(fr){return q+fr},fe=function(fr){return ae+fr},we=fe(0),Ae=ie(0),Fe=function(fr){return Ae+fr},Ce=function(fr){return we+fr};function qe(fr,dr){return fr+","+dr}var et=Fe(0),Qe=function(fr){fr.x=Math.max(et,fr.x)},Ke=S.pathbar.edgeshape,Xe=function(fr){var dr=Fe(Math.max(Math.min(fr.x0,fr.x0),0)),pt=Fe(Math.min(Math.max(fr.x1,fr.x1),U)),ze=Ce(fr.y0),Ge=Ce(fr.y1),Oe=Z/2,ve={},ge={};ve.x=dr,ge.x=pt,ve.y=ge.y=(ze+Ge)/2;var be={x:dr,y:ze},Pe={x:pt,y:ze},We={x:pt,y:Ge},ct={x:dr,y:Ge};return Ke===">"?(be.x-=Oe,Pe.x-=Oe,We.x-=Oe,ct.x-=Oe):Ke==="/"?(We.x-=Oe,ct.x-=Oe,ve.x-=Oe/2,ge.x-=Oe/2):Ke==="\\"?(be.x-=Oe,Pe.x-=Oe,ve.x-=Oe/2,ge.x-=Oe/2):Ke==="<"&&(ve.x-=Oe,ge.x-=Oe),Qe(be),Qe(ct),Qe(ve),Qe(Pe),Qe(We),Qe(ge),"M"+qe(be.x,be.y)+"L"+qe(Pe.x,Pe.y)+"L"+qe(ge.x,ge.y)+"L"+qe(We.x,We.y)+"L"+qe(ct.x,ct.y)+"L"+qe(ve.x,ve.y)+"Z"},Me=S[_?"tiling":"marker"].pad,xe=function(fr){return S.textposition.indexOf(fr)!==-1},ce=xe("top"),Re=xe("left"),$e=xe("right"),rt=xe("bottom"),Je=function(fr){var dr=ie(fr.x0),pt=ie(fr.x1),ze=fe(fr.y0),Ge=fe(fr.y1),Oe=pt-dr,ve=Ge-ze;if(!Oe||!ve)return"";var ge=S.marker.cornerradius||0,be=Math.min(ge,Oe/2,ve/2);be&&fr.data&&fr.data.data&&fr.data.data.label&&(ce&&(be=Math.min(be,Me.t)),Re&&(be=Math.min(be,Me.l)),$e&&(be=Math.min(be,Me.r)),rt&&(be=Math.min(be,Me.b)));var Pe=function(We,ct){return be?"a"+qe(be,be)+" 0 0 1 "+qe(We,ct):""};return"M"+qe(dr,ze+be)+Pe(be,-be)+"L"+qe(pt-be,ze)+Pe(be,be)+"L"+qe(pt,Ge-be)+Pe(-be,be)+"L"+qe(dr+be,Ge)+Pe(-be,-be)+"Z"},At=function(fr,dr){var pt=fr.x0,ze=fr.x1,Ge=fr.y0,Oe=fr.y1,ve=fr.textBB,ge=ce||dr.isHeader&&!rt,be=ge?"start":rt?"end":"middle",Pe=xe("right"),We=xe("left")||dr.onPathbar,ct=We?-1:Pe?1:0;if(dr.isHeader){if(pt+=(_?Me:Me.l)-e,ze-=(_?Me:Me.r)-e,pt>=ze){var _t=(pt+ze)/2;pt=_t,ze=_t}var Mt;rt?(Mt=Oe-(_?Me:Me.b),Ge-1,flipY:O.tiling.flip.indexOf("y")>-1,pad:{inner:O.tiling.pad,top:O.marker.pad.t,left:O.marker.pad.l,right:O.marker.pad.r,bottom:O.marker.pad.b}}),ue=Q.descendants(),oe=1/0,le=-1/0;ue.forEach(function(re){var ee=re.depth;ee>=O._maxDepth?(re.x0=re.x1=(re.x0+re.x1)/2,re.y0=re.y1=(re.y0+re.y1)/2):(oe=Math.min(oe,ee),le=Math.max(le,ee))}),h=h.data(ue,o.getPtId),O._maxVisibleLayers=isFinite(le)?le-oe+1:0,h.enter().append("g").classed("slice",!0),u(h,n,P,[l,y],M),h.order();var j=null;if(p&&R){var J=o.getPtId(R);h.each(function(re){j===null&&o.getPtId(re)===J&&(j={x0:re.x0,x1:re.x1,y0:re.y0,y1:re.y1})})}var $=function(){return j||{x0:0,x1:l,y0:0,y1:y}},X=h;return p&&(X=X.transition().each("end",function(){var re=d.select(this);o.setSliceCursor(re,c,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),X.each(function(re){var ee=o.isHeader(re,O);re._x0=b(re.x0),re._x1=b(re.x1),re._y0=S(re.y0),re._y1=S(re.y1),re._hoverX=b(re.x1-O.marker.pad.r),re._hoverY=S(U?re.y1-O.marker.pad.b/2:re.y0+O.marker.pad.t/2);var q=d.select(this),ae=x.ensureSingle(q,"path","surface",function(Ce){Ce.style("pointer-events",z?"none":"all")});p?ae.transition().attrTween("d",function(Ce){var qe=g(Ce,n,$(),[l,y]);return function(et){return M(qe(et))}}):ae.attr("d",M),q.call(a,v,c,f,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,c,{isTransitioning:c._transitioning}),ae.call(t,re,O,c,{hovered:!1}),re.x0===re.x1||re.y0===re.y1?re._text="":ee?re._text=Z?"":o.getPtLabel(re)||"":re._text=i(re,v,O,f,F)||"";var ie=x.ensureSingle(q,"g","slicetext"),fe=x.ensureSingle(ie,"text","",function(Ce){Ce.attr("data-notex",1)}),we=x.ensureUniformFontSize(c,o.determineTextFont(O,re,F.font)),Ae=re._text||" ",Fe=ee&&Ae.indexOf("
")===-1;fe.text(Ae).classed("slicetext",!0).attr("text-anchor",N?"end":L||Fe?"start":"middle").call(A.font,we).call(E.convertToTspans,c),re.textBB=A.bBox(fe.node()),re.transform=_(re,{fontSize:we.size,isHeader:ee}),re.transform.fontSize=we.size,p?fe.transition().attrTween("transform",function(Ce){var qe=m(Ce,n,$(),[l,y]);return function(et){return w(qe(et))}}):fe.attr("transform",w(re))}),j}}}),iL=He({"src/traces/treemap/plot.js"(Y,G){var d=b3(),x=nL();G.exports=function(E,e,t,r){return d(E,e,t,r,{type:"treemap",drawDescendants:x})}}}),oL=He({"src/traces/treemap/index.js"(Y,G){G.exports={moduleType:"trace",name:"treemap",basePlotModule:QC(),categories:[],animatable:!0,attributes:D_(),layoutAttributes:y3(),supplyDefaults:eL(),supplyLayoutDefaults:tL(),calc:m3().calc,crossTraceCalc:m3().crossTraceCalc,plot:iL(),style:z_().style,colorbar:ah(),meta:{}}}}),sL=He({"lib/treemap.js"(Y,G){G.exports=oL()}}),lL=He({"src/traces/icicle/base_plot.js"(Y){var G=yu();Y.name="icicle",Y.plot=function(d,x,A,E){G.plotBasePlot(Y.name,d,x,A,E)},Y.clean=function(d,x,A,E){G.cleanBasePlot(Y.name,d,x,A,E)}}}),w3=He({"src/traces/icicle/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=Yo().texttemplateAttrs,A=kl(),E=mu().attributes,e=Bp(),t=xy(),r=D_(),o=Wp(),a=ho().extendFlat,i=Nf().pattern;G.exports={labels:t.labels,parents:t.parents,values:t.values,branchvalues:t.branchvalues,count:t.count,level:t.level,maxdepth:t.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:r.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:a({colors:t.marker.colors,line:t.marker.line,pattern:i,editType:"calc"},A("marker",{colorAttr:"colors",anim:!1})),leaf:t.leaf,pathbar:r.pathbar,text:e.text,textinfo:t.textinfo,texttemplate:x({editType:"plot"},{keys:o.eventDataKeys.concat(["label","value"])}),hovertext:e.hovertext,hoverinfo:t.hoverinfo,hovertemplate:d({},{keys:o.eventDataKeys}),textfont:e.textfont,insidetextfont:e.insidetextfont,outsidetextfont:r.outsidetextfont,textposition:r.textposition,sort:e.sort,root:t.root,domain:E({name:"icicle",trace:!0,editType:"calc"})}}}),T3=He({"src/traces/icicle/layout_attributes.js"(Y,G){G.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),uL=He({"src/traces/icicle/defaults.js"(Y,G){var d=Gr(),x=w3(),A=Ai(),E=mu().defaults,e=Jh().handleText,t=Rp().TEXTPAD,r=Np().handleMarkerDefaults,o=Kl(),a=o.hasColorscale,i=o.handleDefaults;G.exports=function(s,c,f,v){function h(w,p){return d.coerce(s,c,x,w,p)}var T=h("labels"),l=h("parents");if(!T||!T.length||!l||!l.length){c.visible=!1;return}var y=h("values");y&&y.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),h("tiling.orientation"),h("tiling.flip"),h("tiling.pad");var b=h("text");h("texttemplate"),c.texttemplate||h("textinfo",d.isArrayOrTypedArray(b)?"text+label":"label"),h("hovertext"),h("hovertemplate");var S=h("pathbar.visible"),M="auto";e(s,c,v,h,M,{hasPathbar:S,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("textposition"),r(s,c,v,h);var _=c._hasColorscale=a(s,"marker","colors")||(s.marker||{}).coloraxis;_&&i(s,c,v,h,{prefix:"marker.",cLetter:"c"}),h("leaf.opacity",_?1:.7),c._hovered={marker:{line:{width:2,color:A.contrast(v.paper_bgcolor)}}},S&&(h("pathbar.thickness",c.pathbar.textfont.size+2*t),h("pathbar.side"),h("pathbar.edgeshape")),h("sort"),h("root.color"),E(c,v,h),c._length=null}}}),cL=He({"src/traces/icicle/layout_defaults.js"(Y,G){var d=Gr(),x=T3();G.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("iciclecolorway",e.colorway),t("extendiciclecolors")}}}),A3=He({"src/traces/icicle/calc.js"(Y){var G=wy();Y.calc=function(d,x){return G.calc(d,x)},Y.crossTraceCalc=function(d){return G._runCrossTraceCalc("icicle",d)}}}),fL=He({"src/traces/icicle/partition.js"(Y,G){var d=by(),x=_3();G.exports=function(E,e,t){var r=t.flipX,o=t.flipY,a=t.orientation==="h",i=t.maxDepth,n=e[0],s=e[1];i&&(n=(E.height+1)*e[0]/Math.min(E.height+1,i),s=(E.height+1)*e[1]/Math.min(E.height+1,i));var c=d.partition().padding(t.pad.inner).size(a?[e[1],n]:[e[0],s])(E);return(a||r||o)&&x(c,e,{swapXY:a,flipX:r,flipY:o}),c}}}),S3=He({"src/traces/icicle/style.js"(Y,G){var d=Qn(),x=Ai(),A=Gr(),E=hh().resizeText,e=I_();function t(o){var a=o._fullLayout._iciclelayer.selectAll(".trace");E(o,a,"icicle"),a.each(function(i){var n=d.select(this),s=i[0],c=s.trace;n.style("opacity",c.opacity),n.selectAll("path.surface").each(function(f){d.select(this).call(r,f,c,o)})})}function r(o,a,i,n){var s=a.data.data,c=!a.children,f=s.i,v=A.castOption(i,f,"marker.line.color")||x.defaultLine,h=A.castOption(i,f,"marker.line.width")||0;o.call(e,a,i,n).style("stroke-width",h).call(x.stroke,v).style("opacity",c?i.leaf.opacity:null)}G.exports={style:t,styleOne:r}}}),hL=He({"src/traces/icicle/draw_descendants.js"(Y,G){var d=Qn(),x=Gr(),A=vo(),E=yl(),e=fL(),t=S3().styleOne,r=Wp(),o=ud(),a=By(),i=R_().formatSliceLabel,n=!1;G.exports=function(c,f,v,h,T){var l=T.width,y=T.height,b=T.viewX,S=T.viewY,M=T.pathSlice,_=T.toMoveInsideSlice,w=T.strTransform,p=T.hasTransition,u=T.handleSlicesExit,g=T.makeUpdateSliceInterpolator,m=T.makeUpdateTextInterpolator,R=T.prevEntry,P={},z=c._context.staticPlot,F=c._fullLayout,B=f[0],O=B.trace,L=O.textposition.indexOf("left")!==-1,N=O.textposition.indexOf("right")!==-1,U=O.textposition.indexOf("bottom")!==-1,Z=e(v,[l,y],{flipX:O.tiling.flip.indexOf("x")>-1,flipY:O.tiling.flip.indexOf("y")>-1,orientation:O.tiling.orientation,pad:{inner:O.tiling.pad},maxDepth:O._maxDepth}),Q=Z.descendants(),ue=1/0,oe=-1/0;Q.forEach(function(X){var re=X.depth;re>=O._maxDepth?(X.x0=X.x1=(X.x0+X.x1)/2,X.y0=X.y1=(X.y0+X.y1)/2):(ue=Math.min(ue,re),oe=Math.max(oe,re))}),h=h.data(Q,o.getPtId),O._maxVisibleLayers=isFinite(oe)?oe-ue+1:0,h.enter().append("g").classed("slice",!0),u(h,n,P,[l,y],M),h.order();var le=null;if(p&&R){var j=o.getPtId(R);h.each(function(X){le===null&&o.getPtId(X)===j&&(le={x0:X.x0,x1:X.x1,y0:X.y0,y1:X.y1})})}var J=function(){return le||{x0:0,x1:l,y0:0,y1:y}},$=h;return p&&($=$.transition().each("end",function(){var X=d.select(this);o.setSliceCursor(X,c,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})})),$.each(function(X){X._x0=b(X.x0),X._x1=b(X.x1),X._y0=S(X.y0),X._y1=S(X.y1),X._hoverX=b(X.x1-O.tiling.pad),X._hoverY=S(U?X.y1-O.tiling.pad/2:X.y0+O.tiling.pad/2);var re=d.select(this),ee=x.ensureSingle(re,"path","surface",function(fe){fe.style("pointer-events",z?"none":"all")});p?ee.transition().attrTween("d",function(fe){var we=g(fe,n,J(),[l,y],{orientation:O.tiling.orientation,flipX:O.tiling.flip.indexOf("x")>-1,flipY:O.tiling.flip.indexOf("y")>-1});return function(Ae){return M(we(Ae))}}):ee.attr("d",M),re.call(a,v,c,f,{styleOne:t,eventDataKeys:r.eventDataKeys,transitionTime:r.CLICK_TRANSITION_TIME,transitionEasing:r.CLICK_TRANSITION_EASING}).call(o.setSliceCursor,c,{isTransitioning:c._transitioning}),ee.call(t,X,O,c,{hovered:!1}),X.x0===X.x1||X.y0===X.y1?X._text="":X._text=i(X,v,O,f,F)||"";var q=x.ensureSingle(re,"g","slicetext"),ae=x.ensureSingle(q,"text","",function(fe){fe.attr("data-notex",1)}),ie=x.ensureUniformFontSize(c,o.determineTextFont(O,X,F.font));ae.text(X._text||" ").classed("slicetext",!0).attr("text-anchor",N?"end":L?"start":"middle").call(A.font,ie).call(E.convertToTspans,c),X.textBB=A.bBox(ae.node()),X.transform=_(X,{fontSize:ie.size}),X.transform.fontSize=ie.size,p?ae.transition().attrTween("transform",function(fe){var we=m(fe,n,J(),[l,y]);return function(Ae){return w(we(Ae))}}):ae.attr("transform",w(X))}),le}}}),vL=He({"src/traces/icicle/plot.js"(Y,G){var d=b3(),x=hL();G.exports=function(E,e,t,r){return d(E,e,t,r,{type:"icicle",drawDescendants:x})}}}),dL=He({"src/traces/icicle/index.js"(Y,G){G.exports={moduleType:"trace",name:"icicle",basePlotModule:lL(),categories:[],animatable:!0,attributes:w3(),layoutAttributes:T3(),supplyDefaults:uL(),supplyLayoutDefaults:cL(),calc:A3().calc,crossTraceCalc:A3().crossTraceCalc,plot:vL(),style:S3().style,colorbar:ah(),meta:{}}}}),pL=He({"lib/icicle.js"(Y,G){G.exports=dL()}}),gL=He({"src/traces/funnelarea/base_plot.js"(Y){var G=yu();Y.name="funnelarea",Y.plot=function(d,x,A,E){G.plotBasePlot(Y.name,d,x,A,E)},Y.clean=function(d,x,A,E){G.cleanBasePlot(Y.name,d,x,A,E)}}}),M3=He({"src/traces/funnelarea/attributes.js"(Y,G){var d=Bp(),x=cl(),A=mu().attributes,E=Yo().hovertemplateAttrs,e=Yo().texttemplateAttrs,t=ho().extendFlat;G.exports={labels:d.labels,label0:d.label0,dlabel:d.dlabel,values:d.values,marker:{colors:d.marker.colors,line:{color:t({},d.marker.line.color,{dflt:null}),width:t({},d.marker.line.width,{dflt:1}),editType:"calc"},pattern:d.marker.pattern,editType:"calc"},text:d.text,hovertext:d.hovertext,scalegroup:t({},d.scalegroup,{}),textinfo:t({},d.textinfo,{flags:["label","text","value","percent"]}),texttemplate:e({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:t({},x.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:E({},{keys:["label","color","value","text","percent"]}),textposition:t({},d.textposition,{values:["inside","none"],dflt:"inside"}),textfont:d.textfont,insidetextfont:d.insidetextfont,title:{text:d.title.text,font:d.title.font,position:t({},d.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:A({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),E3=He({"src/traces/funnelarea/layout_attributes.js"(Y,G){var d=r_().hiddenlabels;G.exports={hiddenlabels:d,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),yL=He({"src/traces/funnelarea/defaults.js"(Y,G){var d=Gr(),x=M3(),A=mu().defaults,E=Jh().handleText,e=Np().handleLabelsAndValues,t=Np().handleMarkerDefaults;G.exports=function(o,a,i,n){function s(M,_){return d.coerce(o,a,x,M,_)}var c=s("labels"),f=s("values"),v=e(c,f),h=v.len;if(a._hasLabels=v.hasLabels,a._hasValues=v.hasValues,!a._hasLabels&&a._hasValues&&(s("label0"),s("dlabel")),!h){a.visible=!1;return}a._length=h,t(o,a,n,s),s("scalegroup");var T=s("text"),l=s("texttemplate"),y;if(l||(y=s("textinfo",Array.isArray(T)?"text+percent":"percent")),s("hovertext"),s("hovertemplate"),l||y&&y!=="none"){var b=s("textposition");E(o,a,n,s,b,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else y==="none"&&s("textposition","none");A(a,n,s);var S=s("title.text");S&&(s("title.position"),d.coerceFont(s,"title.font",n.font)),s("aspectratio"),s("baseratio")}}}),mL=He({"src/traces/funnelarea/layout_defaults.js"(Y,G){var d=Gr(),x=E3();G.exports=function(E,e){function t(r,o){return d.coerce(E,e,x,r,o)}t("hiddenlabels"),t("funnelareacolorway",e.colorway),t("extendfunnelareacolors")}}}),k3=He({"src/traces/funnelarea/calc.js"(Y,G){var d=tg();function x(E,e){return d.calc(E,e)}function A(E){d.crossTraceCalc(E,{type:"funnelarea"})}G.exports={calc:x,crossTraceCalc:A}}}),_L=He({"src/traces/funnelarea/plot.js"(Y,G){var d=Qn(),x=vo(),A=Gr(),E=A.strScale,e=A.strTranslate,t=yl(),r=Dp(),o=r.toMoveInsideBar,a=hh(),i=a.recordMinTextSize,n=a.clearMinTextSize,s=Hd(),c=a_(),f=c.attachFxHandlers,v=c.determineInsideTextFont,h=c.layoutAreas,T=c.prerenderTitles,l=c.positionTitleOutside,y=c.formatSliceLabel;G.exports=function(w,p){var u=w._context.staticPlot,g=w._fullLayout;n("funnelarea",g),T(p,w),h(p,g._size),A.makeTraceGroups(g._funnelarealayer,p,"trace").each(function(m){var R=d.select(this),P=m[0],z=P.trace;M(m),R.each(function(){var F=d.select(this).selectAll("g.slice").data(m);F.enter().append("g").classed("slice",!0),F.exit().remove(),F.each(function(O,L){if(O.hidden){d.select(this).selectAll("path,g").remove();return}O.pointNumber=O.i,O.curveNumber=z.index;var N=P.cx,U=P.cy,Z=d.select(this),Q=Z.selectAll("path.surface").data([O]);Q.enter().append("path").classed("surface",!0).style({"pointer-events":u?"none":"all"}),Z.call(f,w,m);var ue="M"+(N+O.TR[0])+","+(U+O.TR[1])+b(O.TR,O.BR)+b(O.BR,O.BL)+b(O.BL,O.TL)+"Z";Q.attr("d",ue),y(w,O,P);var oe=s.castOption(z.textposition,O.pts),le=Z.selectAll("g.slicetext").data(O.text&&oe!=="none"?[0]:[]);le.enter().append("g").classed("slicetext",!0),le.exit().remove(),le.each(function(){var j=A.ensureSingle(d.select(this),"text","",function(ie){ie.attr("data-notex",1)}),J=A.ensureUniformFontSize(w,v(z,O,g.font));j.text(O.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(x.font,J).call(t.convertToTspans,w);var $=x.bBox(j.node()),X,re,ee,q=Math.min(O.BL[1],O.BR[1])+U,ae=Math.max(O.TL[1],O.TR[1])+U;re=Math.max(O.TL[0],O.BL[0])+N,ee=Math.min(O.TR[0],O.BR[0])+N,X=o(re,ee,q,ae,$,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"}),X.fontSize=J.size,i(z.type,X,g),m[L].transform=X,A.setTransormAndDisplay(j,X)})});var B=d.select(this).selectAll("g.titletext").data(z.title.text?[0]:[]);B.enter().append("g").classed("titletext",!0),B.exit().remove(),B.each(function(){var O=A.ensureSingle(d.select(this),"text","",function(U){U.attr("data-notex",1)}),L=z.title.text;z._meta&&(L=A.templateString(L,z._meta)),O.text(L).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(x.font,z.title.font).call(t.convertToTspans,w);var N=l(P,g._size);O.attr("transform",e(N.x,N.y)+E(Math.min(1,N.scale))+e(N.tx,N.ty))})})})};function b(_,w){var p=w[0]-_[0],u=w[1]-_[1];return"l"+p+","+u}function S(_,w){return[.5*(_[0]+w[0]),.5*(_[1]+w[1])]}function M(_){if(!_.length)return;var w=_[0],p=w.trace,u=p.aspectratio,g=p.baseratio;g>.999&&(g=.999);var m=Math.pow(g,2),R=w.vTotal,P=R*m/(1-m),z=R,F=P/R;function B(){var fe=Math.sqrt(F);return{x:fe,y:-fe}}function O(){var fe=B();return[fe.x,fe.y]}var L,N=[];N.push(O());var U,Z;for(U=_.length-1;U>-1;U--)if(Z=_[U],!Z.hidden){var Q=Z.v/z;F+=Q,N.push(O())}var ue=1/0,oe=-1/0;for(U=0;U-1;U--)if(Z=_[U],!Z.hidden){q+=1;var ae=N[q][0],ie=N[q][1];Z.TL=[-ae,ie],Z.TR=[ae,ie],Z.BL=re,Z.BR=ee,Z.pxmid=S(Z.TR,Z.BR),re=Z.TL,ee=Z.TR}}}}),xL=He({"src/traces/funnelarea/style.js"(Y,G){var d=Qn(),x=U0(),A=hh().resizeText;G.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");A(e,t,"funnelarea"),t.each(function(r){var o=r[0],a=o.trace,i=d.select(this);i.style({opacity:a.opacity}),i.selectAll("path.surface").each(function(n){d.select(this).call(x,n,a,e)})})}}}),bL=He({"src/traces/funnelarea/index.js"(Y,G){G.exports={moduleType:"trace",name:"funnelarea",basePlotModule:gL(),categories:["pie-like","funnelarea","showLegend"],attributes:M3(),layoutAttributes:E3(),supplyDefaults:yL(),supplyLayoutDefaults:mL(),calc:k3().calc,crossTraceCalc:k3().crossTraceCalc,plot:_L(),style:xL(),styleOne:U0(),meta:{}}}}),wL=He({"lib/funnelarea.js"(Y,G){G.exports=bL()}}),Hf=He({"stackgl_modules/index.js"(Y,G){(function(){var d={1964:function(e,t,r){e.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot3d:r(4100),gl_scatter3d:r(8418),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}},4793:function(e,t,r){function o(ve,ge){if(!(ve instanceof ge))throw new TypeError("Cannot call a class as a function")}function a(ve,ge){for(var be=0;bew)throw new RangeError('The value "'+ve+'" is invalid for option "size"');var ge=new Uint8Array(ve);return Object.setPrototypeOf(ge,g.prototype),ge}function g(ve,ge,be){if(typeof ve=="number"){if(typeof ge=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return z(ve)}return m(ve,ge,be)}g.poolSize=8192;function m(ve,ge,be){if(typeof ve=="string")return F(ve,ge);if(ArrayBuffer.isView(ve))return O(ve);if(ve==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+b(ve));if(dr(ve,ArrayBuffer)||ve&&dr(ve.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(dr(ve,SharedArrayBuffer)||ve&&dr(ve.buffer,SharedArrayBuffer)))return L(ve,ge,be);if(typeof ve=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var Pe=ve.valueOf&&ve.valueOf();if(Pe!=null&&Pe!==ve)return g.from(Pe,ge,be);var We=N(ve);if(We)return We;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ve[Symbol.toPrimitive]=="function")return g.from(ve[Symbol.toPrimitive]("string"),ge,be);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+b(ve))}g.from=function(ve,ge,be){return m(ve,ge,be)},Object.setPrototypeOf(g.prototype,Uint8Array.prototype),Object.setPrototypeOf(g,Uint8Array);function R(ve){if(typeof ve!="number")throw new TypeError('"size" argument must be of type number');if(ve<0)throw new RangeError('The value "'+ve+'" is invalid for option "size"')}function P(ve,ge,be){return R(ve),ve<=0?u(ve):ge!==void 0?typeof be=="string"?u(ve).fill(ge,be):u(ve).fill(ge):u(ve)}g.alloc=function(ve,ge,be){return P(ve,ge,be)};function z(ve){return R(ve),u(ve<0?0:U(ve)|0)}g.allocUnsafe=function(ve){return z(ve)},g.allocUnsafeSlow=function(ve){return z(ve)};function F(ve,ge){if((typeof ge!="string"||ge==="")&&(ge="utf8"),!g.isEncoding(ge))throw new TypeError("Unknown encoding: "+ge);var be=Z(ve,ge)|0,Pe=u(be),We=Pe.write(ve,ge);return We!==be&&(Pe=Pe.slice(0,We)),Pe}function B(ve){for(var ge=ve.length<0?0:U(ve.length)|0,be=u(ge),Pe=0;Pe=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return ve|0}g.isBuffer=function(ge){return ge!=null&&ge._isBuffer===!0&&ge!==g.prototype},g.compare=function(ge,be){if(dr(ge,Uint8Array)&&(ge=g.from(ge,ge.offset,ge.byteLength)),dr(be,Uint8Array)&&(be=g.from(be,be.offset,be.byteLength)),!g.isBuffer(ge)||!g.isBuffer(be))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(ge===be)return 0;for(var Pe=ge.length,We=be.length,ct=0,_t=Math.min(Pe,We);ct<_t;++ct)if(ge[ct]!==be[ct]){Pe=ge[ct],We=be[ct];break}return PeWe.length?(g.isBuffer(_t)||(_t=g.from(_t)),_t.copy(We,ct)):Uint8Array.prototype.set.call(We,_t,ct);else if(g.isBuffer(_t))_t.copy(We,ct);else throw new TypeError('"list" argument must be an Array of Buffers');ct+=_t.length}return We};function Z(ve,ge){if(g.isBuffer(ve))return ve.length;if(ArrayBuffer.isView(ve)||dr(ve,ArrayBuffer))return ve.byteLength;if(typeof ve!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+b(ve));var be=ve.length,Pe=arguments.length>2&&arguments[2]===!0;if(!Pe&&be===0)return 0;for(var We=!1;;)switch(ge){case"ascii":case"latin1":case"binary":return be;case"utf8":case"utf-8":return Ut(ve).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return be*2;case"hex":return be>>>1;case"base64":return Mr(ve).length;default:if(We)return Pe?-1:Ut(ve).length;ge=(""+ge).toLowerCase(),We=!0}}g.byteLength=Z;function Q(ve,ge,be){var Pe=!1;if((ge===void 0||ge<0)&&(ge=0),ge>this.length||((be===void 0||be>this.length)&&(be=this.length),be<=0)||(be>>>=0,ge>>>=0,be<=ge))return"";for(ve||(ve="utf8");;)switch(ve){case"hex":return Ae(this,ge,be);case"utf8":case"utf-8":return q(this,ge,be);case"ascii":return fe(this,ge,be);case"latin1":case"binary":return we(this,ge,be);case"base64":return ee(this,ge,be);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fe(this,ge,be);default:if(Pe)throw new TypeError("Unknown encoding: "+ve);ve=(ve+"").toLowerCase(),Pe=!0}}g.prototype._isBuffer=!0;function ue(ve,ge,be){var Pe=ve[ge];ve[ge]=ve[be],ve[be]=Pe}g.prototype.swap16=function(){var ge=this.length;if(ge%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var be=0;bebe&&(ge+=" ... "),""},_&&(g.prototype[_]=g.prototype.inspect),g.prototype.compare=function(ge,be,Pe,We,ct){if(dr(ge,Uint8Array)&&(ge=g.from(ge,ge.offset,ge.byteLength)),!g.isBuffer(ge))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+b(ge));if(be===void 0&&(be=0),Pe===void 0&&(Pe=ge?ge.length:0),We===void 0&&(We=0),ct===void 0&&(ct=this.length),be<0||Pe>ge.length||We<0||ct>this.length)throw new RangeError("out of range index");if(We>=ct&&be>=Pe)return 0;if(We>=ct)return-1;if(be>=Pe)return 1;if(be>>>=0,Pe>>>=0,We>>>=0,ct>>>=0,this===ge)return 0;for(var _t=ct-We,Mt=Pe-be,Nt=Math.min(_t,Mt),Bt=this.slice(We,ct),qt=ge.slice(be,Pe),Zt=0;Zt2147483647?be=2147483647:be<-2147483648&&(be=-2147483648),be=+be,pt(be)&&(be=We?0:ve.length-1),be<0&&(be=ve.length+be),be>=ve.length){if(We)return-1;be=ve.length-1}else if(be<0)if(We)be=0;else return-1;if(typeof ge=="string"&&(ge=g.from(ge,Pe)),g.isBuffer(ge))return ge.length===0?-1:le(ve,ge,be,Pe,We);if(typeof ge=="number")return ge=ge&255,typeof Uint8Array.prototype.indexOf=="function"?We?Uint8Array.prototype.indexOf.call(ve,ge,be):Uint8Array.prototype.lastIndexOf.call(ve,ge,be):le(ve,[ge],be,Pe,We);throw new TypeError("val must be string, number or Buffer")}function le(ve,ge,be,Pe,We){var ct=1,_t=ve.length,Mt=ge.length;if(Pe!==void 0&&(Pe=String(Pe).toLowerCase(),Pe==="ucs2"||Pe==="ucs-2"||Pe==="utf16le"||Pe==="utf-16le")){if(ve.length<2||ge.length<2)return-1;ct=2,_t/=2,Mt/=2,be/=2}function Nt(ta,da){return ct===1?ta[da]:ta.readUInt16BE(da*ct)}var Bt;if(We){var qt=-1;for(Bt=be;Bt<_t;Bt++)if(Nt(ve,Bt)===Nt(ge,qt===-1?0:Bt-qt)){if(qt===-1&&(qt=Bt),Bt-qt+1===Mt)return qt*ct}else qt!==-1&&(Bt-=Bt-qt),qt=-1}else for(be+Mt>_t&&(be=_t-Mt),Bt=be;Bt>=0;Bt--){for(var Zt=!0,lr=0;lrWe&&(Pe=We)):Pe=We;var ct=ge.length;Pe>ct/2&&(Pe=ct/2);var _t;for(_t=0;_t>>0,isFinite(Pe)?(Pe=Pe>>>0,We===void 0&&(We="utf8")):(We=Pe,Pe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ct=this.length-be;if((Pe===void 0||Pe>ct)&&(Pe=ct),ge.length>0&&(Pe<0||be<0)||be>this.length)throw new RangeError("Attempt to write outside buffer bounds");We||(We="utf8");for(var _t=!1;;)switch(We){case"hex":return j(this,ge,be,Pe);case"utf8":case"utf-8":return J(this,ge,be,Pe);case"ascii":case"latin1":case"binary":return $(this,ge,be,Pe);case"base64":return X(this,ge,be,Pe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return re(this,ge,be,Pe);default:if(_t)throw new TypeError("Unknown encoding: "+We);We=(""+We).toLowerCase(),_t=!0}},g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ee(ve,ge,be){return ge===0&&be===ve.length?S.fromByteArray(ve):S.fromByteArray(ve.slice(ge,be))}function q(ve,ge,be){be=Math.min(ve.length,be);for(var Pe=[],We=ge;We239?4:ct>223?3:ct>191?2:1;if(We+Mt<=be){var Nt=void 0,Bt=void 0,qt=void 0,Zt=void 0;switch(Mt){case 1:ct<128&&(_t=ct);break;case 2:Nt=ve[We+1],(Nt&192)===128&&(Zt=(ct&31)<<6|Nt&63,Zt>127&&(_t=Zt));break;case 3:Nt=ve[We+1],Bt=ve[We+2],(Nt&192)===128&&(Bt&192)===128&&(Zt=(ct&15)<<12|(Nt&63)<<6|Bt&63,Zt>2047&&(Zt<55296||Zt>57343)&&(_t=Zt));break;case 4:Nt=ve[We+1],Bt=ve[We+2],qt=ve[We+3],(Nt&192)===128&&(Bt&192)===128&&(qt&192)===128&&(Zt=(ct&15)<<18|(Nt&63)<<12|(Bt&63)<<6|qt&63,Zt>65535&&Zt<1114112&&(_t=Zt))}}_t===null?(_t=65533,Mt=1):_t>65535&&(_t-=65536,Pe.push(_t>>>10&1023|55296),_t=56320|_t&1023),Pe.push(_t),We+=Mt}return ie(Pe)}var ae=4096;function ie(ve){var ge=ve.length;if(ge<=ae)return String.fromCharCode.apply(String,ve);for(var be="",Pe=0;PePe)&&(be=Pe);for(var We="",ct=ge;ctPe&&(ge=Pe),be<0?(be+=Pe,be<0&&(be=0)):be>Pe&&(be=Pe),bebe)throw new RangeError("Trying to access beyond buffer length")}g.prototype.readUintLE=g.prototype.readUIntLE=function(ge,be,Pe){ge=ge>>>0,be=be>>>0,Pe||Ce(ge,be,this.length);for(var We=this[ge],ct=1,_t=0;++_t>>0,be=be>>>0,Pe||Ce(ge,be,this.length);for(var We=this[ge+--be],ct=1;be>0&&(ct*=256);)We+=this[ge+--be]*ct;return We},g.prototype.readUint8=g.prototype.readUInt8=function(ge,be){return ge=ge>>>0,be||Ce(ge,1,this.length),this[ge]},g.prototype.readUint16LE=g.prototype.readUInt16LE=function(ge,be){return ge=ge>>>0,be||Ce(ge,2,this.length),this[ge]|this[ge+1]<<8},g.prototype.readUint16BE=g.prototype.readUInt16BE=function(ge,be){return ge=ge>>>0,be||Ce(ge,2,this.length),this[ge]<<8|this[ge+1]},g.prototype.readUint32LE=g.prototype.readUInt32LE=function(ge,be){return ge=ge>>>0,be||Ce(ge,4,this.length),(this[ge]|this[ge+1]<<8|this[ge+2]<<16)+this[ge+3]*16777216},g.prototype.readUint32BE=g.prototype.readUInt32BE=function(ge,be){return ge=ge>>>0,be||Ce(ge,4,this.length),this[ge]*16777216+(this[ge+1]<<16|this[ge+2]<<8|this[ge+3])},g.prototype.readBigUInt64LE=Ge(function(ge){ge=ge>>>0,Je(ge,"offset");var be=this[ge],Pe=this[ge+7];(be===void 0||Pe===void 0)&&At(ge,this.length-8);var We=be+this[++ge]*Math.pow(2,8)+this[++ge]*Math.pow(2,16)+this[++ge]*Math.pow(2,24),ct=this[++ge]+this[++ge]*Math.pow(2,8)+this[++ge]*Math.pow(2,16)+Pe*Math.pow(2,24);return BigInt(We)+(BigInt(ct)<>>0,Je(ge,"offset");var be=this[ge],Pe=this[ge+7];(be===void 0||Pe===void 0)&&At(ge,this.length-8);var We=be*Math.pow(2,24)+this[++ge]*Math.pow(2,16)+this[++ge]*Math.pow(2,8)+this[++ge],ct=this[++ge]*Math.pow(2,24)+this[++ge]*Math.pow(2,16)+this[++ge]*Math.pow(2,8)+Pe;return(BigInt(We)<>>0,be=be>>>0,Pe||Ce(ge,be,this.length);for(var We=this[ge],ct=1,_t=0;++_t=ct&&(We-=Math.pow(2,8*be)),We},g.prototype.readIntBE=function(ge,be,Pe){ge=ge>>>0,be=be>>>0,Pe||Ce(ge,be,this.length);for(var We=be,ct=1,_t=this[ge+--We];We>0&&(ct*=256);)_t+=this[ge+--We]*ct;return ct*=128,_t>=ct&&(_t-=Math.pow(2,8*be)),_t},g.prototype.readInt8=function(ge,be){return ge=ge>>>0,be||Ce(ge,1,this.length),this[ge]&128?(255-this[ge]+1)*-1:this[ge]},g.prototype.readInt16LE=function(ge,be){ge=ge>>>0,be||Ce(ge,2,this.length);var Pe=this[ge]|this[ge+1]<<8;return Pe&32768?Pe|4294901760:Pe},g.prototype.readInt16BE=function(ge,be){ge=ge>>>0,be||Ce(ge,2,this.length);var Pe=this[ge+1]|this[ge]<<8;return Pe&32768?Pe|4294901760:Pe},g.prototype.readInt32LE=function(ge,be){return ge=ge>>>0,be||Ce(ge,4,this.length),this[ge]|this[ge+1]<<8|this[ge+2]<<16|this[ge+3]<<24},g.prototype.readInt32BE=function(ge,be){return ge=ge>>>0,be||Ce(ge,4,this.length),this[ge]<<24|this[ge+1]<<16|this[ge+2]<<8|this[ge+3]},g.prototype.readBigInt64LE=Ge(function(ge){ge=ge>>>0,Je(ge,"offset");var be=this[ge],Pe=this[ge+7];(be===void 0||Pe===void 0)&&At(ge,this.length-8);var We=this[ge+4]+this[ge+5]*Math.pow(2,8)+this[ge+6]*Math.pow(2,16)+(Pe<<24);return(BigInt(We)<>>0,Je(ge,"offset");var be=this[ge],Pe=this[ge+7];(be===void 0||Pe===void 0)&&At(ge,this.length-8);var We=(be<<24)+this[++ge]*Math.pow(2,16)+this[++ge]*Math.pow(2,8)+this[++ge];return(BigInt(We)<>>0,be||Ce(ge,4,this.length),M.read(this,ge,!0,23,4)},g.prototype.readFloatBE=function(ge,be){return ge=ge>>>0,be||Ce(ge,4,this.length),M.read(this,ge,!1,23,4)},g.prototype.readDoubleLE=function(ge,be){return ge=ge>>>0,be||Ce(ge,8,this.length),M.read(this,ge,!0,52,8)},g.prototype.readDoubleBE=function(ge,be){return ge=ge>>>0,be||Ce(ge,8,this.length),M.read(this,ge,!1,52,8)};function qe(ve,ge,be,Pe,We,ct){if(!g.isBuffer(ve))throw new TypeError('"buffer" argument must be a Buffer instance');if(ge>We||geve.length)throw new RangeError("Index out of range")}g.prototype.writeUintLE=g.prototype.writeUIntLE=function(ge,be,Pe,We){if(ge=+ge,be=be>>>0,Pe=Pe>>>0,!We){var ct=Math.pow(2,8*Pe)-1;qe(this,ge,be,Pe,ct,0)}var _t=1,Mt=0;for(this[be]=ge&255;++Mt>>0,Pe=Pe>>>0,!We){var ct=Math.pow(2,8*Pe)-1;qe(this,ge,be,Pe,ct,0)}var _t=Pe-1,Mt=1;for(this[be+_t]=ge&255;--_t>=0&&(Mt*=256);)this[be+_t]=ge/Mt&255;return be+Pe},g.prototype.writeUint8=g.prototype.writeUInt8=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,1,255,0),this[be]=ge&255,be+1},g.prototype.writeUint16LE=g.prototype.writeUInt16LE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,2,65535,0),this[be]=ge&255,this[be+1]=ge>>>8,be+2},g.prototype.writeUint16BE=g.prototype.writeUInt16BE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,2,65535,0),this[be]=ge>>>8,this[be+1]=ge&255,be+2},g.prototype.writeUint32LE=g.prototype.writeUInt32LE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,4,4294967295,0),this[be+3]=ge>>>24,this[be+2]=ge>>>16,this[be+1]=ge>>>8,this[be]=ge&255,be+4},g.prototype.writeUint32BE=g.prototype.writeUInt32BE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,4,4294967295,0),this[be]=ge>>>24,this[be+1]=ge>>>16,this[be+2]=ge>>>8,this[be+3]=ge&255,be+4};function et(ve,ge,be,Pe,We){rt(ge,Pe,We,ve,be,7);var ct=Number(ge&BigInt(4294967295));ve[be++]=ct,ct=ct>>8,ve[be++]=ct,ct=ct>>8,ve[be++]=ct,ct=ct>>8,ve[be++]=ct;var _t=Number(ge>>BigInt(32)&BigInt(4294967295));return ve[be++]=_t,_t=_t>>8,ve[be++]=_t,_t=_t>>8,ve[be++]=_t,_t=_t>>8,ve[be++]=_t,be}function Qe(ve,ge,be,Pe,We){rt(ge,Pe,We,ve,be,7);var ct=Number(ge&BigInt(4294967295));ve[be+7]=ct,ct=ct>>8,ve[be+6]=ct,ct=ct>>8,ve[be+5]=ct,ct=ct>>8,ve[be+4]=ct;var _t=Number(ge>>BigInt(32)&BigInt(4294967295));return ve[be+3]=_t,_t=_t>>8,ve[be+2]=_t,_t=_t>>8,ve[be+1]=_t,_t=_t>>8,ve[be]=_t,be+8}g.prototype.writeBigUInt64LE=Ge(function(ge){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return et(this,ge,be,BigInt(0),BigInt("0xffffffffffffffff"))}),g.prototype.writeBigUInt64BE=Ge(function(ge){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Qe(this,ge,be,BigInt(0),BigInt("0xffffffffffffffff"))}),g.prototype.writeIntLE=function(ge,be,Pe,We){if(ge=+ge,be=be>>>0,!We){var ct=Math.pow(2,8*Pe-1);qe(this,ge,be,Pe,ct-1,-ct)}var _t=0,Mt=1,Nt=0;for(this[be]=ge&255;++_t>0)-Nt&255;return be+Pe},g.prototype.writeIntBE=function(ge,be,Pe,We){if(ge=+ge,be=be>>>0,!We){var ct=Math.pow(2,8*Pe-1);qe(this,ge,be,Pe,ct-1,-ct)}var _t=Pe-1,Mt=1,Nt=0;for(this[be+_t]=ge&255;--_t>=0&&(Mt*=256);)ge<0&&Nt===0&&this[be+_t+1]!==0&&(Nt=1),this[be+_t]=(ge/Mt>>0)-Nt&255;return be+Pe},g.prototype.writeInt8=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,1,127,-128),ge<0&&(ge=255+ge+1),this[be]=ge&255,be+1},g.prototype.writeInt16LE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,2,32767,-32768),this[be]=ge&255,this[be+1]=ge>>>8,be+2},g.prototype.writeInt16BE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,2,32767,-32768),this[be]=ge>>>8,this[be+1]=ge&255,be+2},g.prototype.writeInt32LE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,4,2147483647,-2147483648),this[be]=ge&255,this[be+1]=ge>>>8,this[be+2]=ge>>>16,this[be+3]=ge>>>24,be+4},g.prototype.writeInt32BE=function(ge,be,Pe){return ge=+ge,be=be>>>0,Pe||qe(this,ge,be,4,2147483647,-2147483648),ge<0&&(ge=4294967295+ge+1),this[be]=ge>>>24,this[be+1]=ge>>>16,this[be+2]=ge>>>8,this[be+3]=ge&255,be+4},g.prototype.writeBigInt64LE=Ge(function(ge){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return et(this,ge,be,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),g.prototype.writeBigInt64BE=Ge(function(ge){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return Qe(this,ge,be,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ke(ve,ge,be,Pe,We,ct){if(be+Pe>ve.length)throw new RangeError("Index out of range");if(be<0)throw new RangeError("Index out of range")}function Xe(ve,ge,be,Pe,We){return ge=+ge,be=be>>>0,We||Ke(ve,ge,be,4),M.write(ve,ge,be,Pe,23,4),be+4}g.prototype.writeFloatLE=function(ge,be,Pe){return Xe(this,ge,be,!0,Pe)},g.prototype.writeFloatBE=function(ge,be,Pe){return Xe(this,ge,be,!1,Pe)};function Me(ve,ge,be,Pe,We){return ge=+ge,be=be>>>0,We||Ke(ve,ge,be,8),M.write(ve,ge,be,Pe,52,8),be+8}g.prototype.writeDoubleLE=function(ge,be,Pe){return Me(this,ge,be,!0,Pe)},g.prototype.writeDoubleBE=function(ge,be,Pe){return Me(this,ge,be,!1,Pe)},g.prototype.copy=function(ge,be,Pe,We){if(!g.isBuffer(ge))throw new TypeError("argument should be a Buffer");if(Pe||(Pe=0),!We&&We!==0&&(We=this.length),be>=ge.length&&(be=ge.length),be||(be=0),We>0&&We=this.length)throw new RangeError("Index out of range");if(We<0)throw new RangeError("sourceEnd out of bounds");We>this.length&&(We=this.length),ge.length-be>>0,Pe=Pe===void 0?this.length:Pe>>>0,ge||(ge=0);var _t;if(typeof ge=="number")for(_t=be;_tMath.pow(2,32)?We=Re(String(be)):typeof be=="bigint"&&(We=String(be),(be>Math.pow(BigInt(2),BigInt(32))||be<-Math.pow(BigInt(2),BigInt(32)))&&(We=Re(We)),We+="n"),Pe+=" It must be ".concat(ge,". Received ").concat(We),Pe},RangeError);function Re(ve){for(var ge="",be=ve.length,Pe=ve[0]==="-"?1:0;be>=Pe+4;be-=3)ge="_".concat(ve.slice(be-3,be)).concat(ge);return"".concat(ve.slice(0,be)).concat(ge)}function $e(ve,ge,be){Je(ge,"offset"),(ve[ge]===void 0||ve[ge+be]===void 0)&&At(ge,ve.length-(be+1))}function rt(ve,ge,be,Pe,We,ct){if(ve>be||ve= 0".concat(_t," and < 2").concat(_t," ** ").concat((ct+1)*8).concat(_t):Mt=">= -(2".concat(_t," ** ").concat((ct+1)*8-1).concat(_t,") and < 2 ** ")+"".concat((ct+1)*8-1).concat(_t),new xe.ERR_OUT_OF_RANGE("value",Mt,ve)}$e(Pe,We,ct)}function Je(ve,ge){if(typeof ve!="number")throw new xe.ERR_INVALID_ARG_TYPE(ge,"number",ve)}function At(ve,ge,be){throw Math.floor(ve)!==ve?(Je(ve,be),new xe.ERR_OUT_OF_RANGE("offset","an integer",ve)):ge<0?new xe.ERR_BUFFER_OUT_OF_BOUNDS:new xe.ERR_OUT_OF_RANGE("offset",">= ".concat(0," and <= ").concat(ge),ve)}var St=/[^+/0-9A-Za-z-_]/g;function Rt(ve){if(ve=ve.split("=")[0],ve=ve.trim().replace(St,""),ve.length<2)return"";for(;ve.length%4!==0;)ve=ve+"=";return ve}function Ut(ve,ge){ge=ge||1/0;for(var be,Pe=ve.length,We=null,ct=[],_t=0;_t55295&&be<57344){if(!We){if(be>56319){(ge-=3)>-1&&ct.push(239,191,189);continue}else if(_t+1===Pe){(ge-=3)>-1&&ct.push(239,191,189);continue}We=be;continue}if(be<56320){(ge-=3)>-1&&ct.push(239,191,189),We=be;continue}be=(We-55296<<10|be-56320)+65536}else We&&(ge-=3)>-1&&ct.push(239,191,189);if(We=null,be<128){if((ge-=1)<0)break;ct.push(be)}else if(be<2048){if((ge-=2)<0)break;ct.push(be>>6|192,be&63|128)}else if(be<65536){if((ge-=3)<0)break;ct.push(be>>12|224,be>>6&63|128,be&63|128)}else if(be<1114112){if((ge-=4)<0)break;ct.push(be>>18|240,be>>12&63|128,be>>6&63|128,be&63|128)}else throw new Error("Invalid code point")}return ct}function ir(ve){for(var ge=[],be=0;be>8,We=be%256,ct.push(We),ct.push(Pe);return ct}function Mr(ve){return S.toByteArray(Rt(ve))}function fr(ve,ge,be,Pe){var We;for(We=0;We=ge.length||We>=ve.length);++We)ge[We+be]=ve[We];return We}function dr(ve,ge){return ve instanceof ge||ve!=null&&ve.constructor!=null&&ve.constructor.name!=null&&ve.constructor.name===ge.name}function pt(ve){return ve!==ve}var ze=function(){for(var ve="0123456789abcdef",ge=new Array(256),be=0;be<16;++be)for(var Pe=be*16,We=0;We<16;++We)ge[Pe+We]=ve[be]+ve[We];return ge}();function Ge(ve){return typeof BigInt>"u"?Oe:ve}function Oe(){throw new Error("BigInt not supported")}},9216:function(e){e.exports=a,e.exports.isMobile=a,e.exports.default=a;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,o=/android|ipad|playbook|silk/i;function a(i){i||(i={});var n=i.ua;if(!n&&typeof navigator<"u"&&(n=navigator.userAgent),n&&n.headers&&typeof n.headers["user-agent"]=="string"&&(n=n.headers["user-agent"]),typeof n!="string")return!1;var s=t.test(n)&&!r.test(n)||!!i.tablet&&o.test(n);return!s&&i.tablet&&i.featureDetect&&navigator&&navigator.maxTouchPoints>1&&n.indexOf("Macintosh")!==-1&&n.indexOf("Safari")!==-1&&(s=!0),s}},6296:function(e,t,r){e.exports=c;var o=r(7261),a=r(9977),i=r(1811);function n(f,v){this._controllerNames=Object.keys(f),this._controllerList=this._controllerNames.map(function(h){return f[h]}),this._mode=v,this._active=f[v],this._active||(this._mode="turntable",this._active=f.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=n.prototype;s.flush=function(f){for(var v=this._controllerList,h=0;h"u"?r(1538):WeakMap,a=r(2762),i=r(8116),n=new o;function s(c){var f=n.get(c),v=f&&(f._triangleBuffer.handle||f._triangleBuffer.buffer);if(!v||!c.isBuffer(v)){var h=a(c,new Float32Array([-1,-1,-1,4,4,-1]));f=i(c,[{buffer:h,type:c.FLOAT,size:2}]),f._triangleBuffer=h,n.set(c,f)}f.bind(),c.drawArrays(c.TRIANGLES,0,3),f.unbind()}e.exports=s},1085:function(e,t,r){var o=r(1371);e.exports=a;function a(i,n,s){n=typeof n=="number"?n:1,s=s||": ";var c=i.split(/\r?\n/),f=String(c.length+n-1).length;return c.map(function(v,h){var T=h+n,l=String(T).length,y=o(T,f-l);return y+s+v}).join(` +`)}},3952:function(e,t,r){e.exports=i;var o=r(3250);function a(n,s){for(var c=new Array(s+1),f=0;f0)throw new Error("Invalid string. Length must be a multiple of 4");var M=b.indexOf("=");M===-1&&(M=S);var _=M===S?0:4-M%4;return[M,_]}function f(b){var S=c(b),M=S[0],_=S[1];return(M+_)*3/4-_}function v(b,S,M){return(S+M)*3/4-M}function h(b){var S,M=c(b),_=M[0],w=M[1],p=new a(v(b,_,w)),u=0,g=w>0?_-4:_,m;for(m=0;m>16&255,p[u++]=S>>8&255,p[u++]=S&255;return w===2&&(S=o[b.charCodeAt(m)]<<2|o[b.charCodeAt(m+1)]>>4,p[u++]=S&255),w===1&&(S=o[b.charCodeAt(m)]<<10|o[b.charCodeAt(m+1)]<<4|o[b.charCodeAt(m+2)]>>2,p[u++]=S>>8&255,p[u++]=S&255),p}function T(b){return r[b>>18&63]+r[b>>12&63]+r[b>>6&63]+r[b&63]}function l(b,S,M){for(var _,w=[],p=S;pg?g:u+p));return _===1?(S=b[M-1],w.push(r[S>>2]+r[S<<4&63]+"==")):_===2&&(S=(b[M-2]<<8)+b[M-1],w.push(r[S>>10]+r[S>>4&63]+r[S<<2&63]+"=")),w.join("")}},3865:function(e,t,r){var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]).add(n[0].mul(i[1])),i[1].mul(n[1]))}},1318:function(e){e.exports=t;function t(r,o){return r[0].mul(o[1]).cmp(o[0].mul(r[1]))}},8697:function(e,t,r){var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]),i[1].mul(n[0]))}},7842:function(e,t,r){var o=r(6330),a=r(1533),i=r(2651),n=r(6768),s=r(869),c=r(8697);e.exports=f;function f(v,h){if(o(v))return h?c(v,f(h)):[v[0].clone(),v[1].clone()];var T=0,l,y;if(a(v))l=v.clone();else if(typeof v=="string")l=n(v);else{if(v===0)return[i(0),i(1)];if(v===Math.floor(v))l=i(v);else{for(;v!==Math.floor(v);)v=v*Math.pow(2,256),T-=256;l=i(v)}}if(o(h))l.mul(h[1]),y=h[0].clone();else if(a(h))y=h.clone();else if(typeof h=="string")y=n(h);else if(!h)y=i(1);else if(h===Math.floor(h))y=i(h);else{for(;h!==Math.floor(h);)h=h*Math.pow(2,256),T+=256;y=i(h)}return T>0?l=l.ushln(T):T<0&&(y=y.ushln(-T)),s(l,y)}},6330:function(e,t,r){var o=r(1533);e.exports=a;function a(i){return Array.isArray(i)&&i.length===2&&o(i[0])&&o(i[1])}},5716:function(e,t,r){var o=r(6859);e.exports=a;function a(i){return i.cmp(new o(0))}},1369:function(e,t,r){var o=r(5716);e.exports=a;function a(i){var n=i.length,s=i.words,c=0;if(n===1)c=s[0];else if(n===2)c=s[0]+s[1]*67108864;else for(var f=0;f20?52:c+32}},1533:function(e,t,r){r(6859),e.exports=o;function o(a){return a&&typeof a=="object"&&!!a.words}},2651:function(e,t,r){var o=r(6859),a=r(2361);e.exports=i;function i(n){var s=a.exponent(n);return s<52?new o(n):new o(n*Math.pow(2,52-s)).ushln(s-52)}},869:function(e,t,r){var o=r(2651),a=r(5716);e.exports=i;function i(n,s){var c=a(n),f=a(s);if(c===0)return[o(0),o(1)];if(f===0)return[o(0),o(0)];f<0&&(n=n.neg(),s=s.neg());var v=n.gcd(s);return v.cmpn(1)?[n.div(v),s.div(v)]:[n,s]}},6768:function(e,t,r){var o=r(6859);e.exports=a;function a(i){return new o(i)}},6504:function(e,t,r){var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[0]),i[1].mul(n[1]))}},7721:function(e,t,r){var o=r(5716);e.exports=a;function a(i){return o(i[0])*o(i[1])}},5572:function(e,t,r){var o=r(869);e.exports=a;function a(i,n){return o(i[0].mul(n[1]).sub(i[1].mul(n[0])),i[1].mul(n[1]))}},946:function(e,t,r){var o=r(1369),a=r(4025);e.exports=i;function i(n){var s=n[0],c=n[1];if(s.cmpn(0)===0)return 0;var f=s.abs().divmod(c.abs()),v=f.div,h=o(v),T=f.mod,l=s.negative!==c.negative?-1:1;if(T.cmpn(0)===0)return l*h;if(h){var y=a(h)+4,b=o(T.ushln(y).divRound(c));return l*(h+b*Math.pow(2,-y))}else{var S=c.bitLength()-T.bitLength()+53,b=o(T.ushln(S).divRound(c));return S<1023?l*b*Math.pow(2,-S):(b*=Math.pow(2,-1023),l*b*Math.pow(2,1023-S))}}},2478:function(e){function t(s,c,f,v,h){for(var T=h+1;v<=h;){var l=v+h>>>1,y=s[l],b=f!==void 0?f(y,c):y-c;b>=0?(T=l,h=l-1):v=l+1}return T}function r(s,c,f,v,h){for(var T=h+1;v<=h;){var l=v+h>>>1,y=s[l],b=f!==void 0?f(y,c):y-c;b>0?(T=l,h=l-1):v=l+1}return T}function o(s,c,f,v,h){for(var T=v-1;v<=h;){var l=v+h>>>1,y=s[l],b=f!==void 0?f(y,c):y-c;b<0?(T=l,v=l+1):h=l-1}return T}function a(s,c,f,v,h){for(var T=v-1;v<=h;){var l=v+h>>>1,y=s[l],b=f!==void 0?f(y,c):y-c;b<=0?(T=l,v=l+1):h=l-1}return T}function i(s,c,f,v,h){for(;v<=h;){var T=v+h>>>1,l=s[T],y=f!==void 0?f(l,c):l-c;if(y===0)return T;y<=0?v=T+1:h=T-1}return-1}function n(s,c,f,v,h,T){return typeof f=="function"?T(s,c,f,v===void 0?0:v|0,h===void 0?s.length-1:h|0):T(s,c,void 0,f===void 0?0:f|0,v===void 0?s.length-1:v|0)}e.exports={ge:function(s,c,f,v,h){return n(s,c,f,v,h,t)},gt:function(s,c,f,v,h){return n(s,c,f,v,h,r)},lt:function(s,c,f,v,h){return n(s,c,f,v,h,o)},le:function(s,c,f,v,h){return n(s,c,f,v,h,a)},eq:function(s,c,f,v,h){return n(s,c,f,v,h,i)}}},8828:function(e,t){"use restrict";var r=32;t.INT_BITS=r,t.INT_MAX=2147483647,t.INT_MIN=-1<0)-(i<0)},t.abs=function(i){var n=i>>r-1;return(i^n)-n},t.min=function(i,n){return n^(i^n)&-(i65535)<<4,i>>>=n,s=(i>255)<<3,i>>>=s,n|=s,s=(i>15)<<2,i>>>=s,n|=s,s=(i>3)<<1,i>>>=s,n|=s,n|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var n=32;return i&=-i,i&&n--,i&65535&&(n-=16),i&16711935&&(n-=8),i&252645135&&(n-=4),i&858993459&&(n-=2),i&1431655765&&(n-=1),n}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var a=new Array(256);(function(i){for(var n=0;n<256;++n){var s=n,c=n,f=7;for(s>>>=1;s;s>>>=1)c<<=1,c|=s&1,--f;i[n]=c<>>8&255]<<16|a[i>>>16&255]<<8|a[i>>>24&255]},t.interleave2=function(i,n){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,n&=65535,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,i|n<<1},t.deinterleave2=function(i,n){return i=i>>>n&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,n,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,i|=n<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,n){return i=i>>>n&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var n=i|i-1;return n+1|(~n&-~n)-1>>>o(i)+1}},6859:function(e,t,r){e=r.nmd(e),function(o,a){function i(O,L){if(!O)throw new Error(L||"Assertion failed")}function n(O,L){O.super_=L;var N=function(){};N.prototype=L.prototype,O.prototype=new N,O.prototype.constructor=O}function s(O,L,N){if(s.isBN(O))return O;this.negative=0,this.words=null,this.length=0,this.red=null,O!==null&&((L==="le"||L==="be")&&(N=L,L=10),this._init(O||0,L||10,N||"be"))}typeof o=="object"?o.exports=s:a.BN=s,s.BN=s,s.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=r(7790).Buffer}catch{}s.isBN=function(L){return L instanceof s?!0:L!==null&&typeof L=="object"&&L.constructor.wordSize===s.wordSize&&Array.isArray(L.words)},s.max=function(L,N){return L.cmp(N)>0?L:N},s.min=function(L,N){return L.cmp(N)<0?L:N},s.prototype._init=function(L,N,U){if(typeof L=="number")return this._initNumber(L,N,U);if(typeof L=="object")return this._initArray(L,N,U);N==="hex"&&(N=16),i(N===(N|0)&&N>=2&&N<=36),L=L.toString().replace(/\s+/g,"");var Z=0;L[0]==="-"&&(Z++,this.negative=1),Z=0;Z-=3)ue=L[Z]|L[Z-1]<<8|L[Z-2]<<16,this.words[Q]|=ue<>>26-oe&67108863,oe+=24,oe>=26&&(oe-=26,Q++);else if(U==="le")for(Z=0,Q=0;Z>>26-oe&67108863,oe+=24,oe>=26&&(oe-=26,Q++);return this.strip()};function f(O,L){var N=O.charCodeAt(L);return N>=65&&N<=70?N-55:N>=97&&N<=102?N-87:N-48&15}function v(O,L,N){var U=f(O,N);return N-1>=L&&(U|=f(O,N-1)<<4),U}s.prototype._parseHex=function(L,N,U){this.length=Math.ceil((L.length-N)/6),this.words=new Array(this.length);for(var Z=0;Z=N;Z-=2)oe=v(L,N,Z)<=18?(Q-=18,ue+=1,this.words[ue]|=oe>>>26):Q+=8;else{var le=L.length-N;for(Z=le%2===0?N+1:N;Z=18?(Q-=18,ue+=1,this.words[ue]|=oe>>>26):Q+=8}this.strip()};function h(O,L,N,U){for(var Z=0,Q=Math.min(O.length,N),ue=L;ue=49?Z+=oe-49+10:oe>=17?Z+=oe-17+10:Z+=oe}return Z}s.prototype._parseBase=function(L,N,U){this.words=[0],this.length=1;for(var Z=0,Q=1;Q<=67108863;Q*=N)Z++;Z--,Q=Q/N|0;for(var ue=L.length-U,oe=ue%Z,le=Math.min(ue,ue-oe)+U,j=0,J=U;J1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var T=["","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"],l=[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],y=[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];s.prototype.toString=function(L,N){L=L||10,N=N|0||1;var U;if(L===16||L==="hex"){U="";for(var Z=0,Q=0,ue=0;ue>>24-Z&16777215,Q!==0||ue!==this.length-1?U=T[6-le.length]+le+U:U=le+U,Z+=2,Z>=26&&(Z-=26,ue--)}for(Q!==0&&(U=Q.toString(16)+U);U.length%N!==0;)U="0"+U;return this.negative!==0&&(U="-"+U),U}if(L===(L|0)&&L>=2&&L<=36){var j=l[L],J=y[L];U="";var $=this.clone();for($.negative=0;!$.isZero();){var X=$.modn(J).toString(L);$=$.idivn(J),$.isZero()?U=X+U:U=T[j-X.length]+X+U}for(this.isZero()&&(U="0"+U);U.length%N!==0;)U="0"+U;return this.negative!==0&&(U="-"+U),U}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var L=this.words[0];return this.length===2?L+=this.words[1]*67108864:this.length===3&&this.words[2]===1?L+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-L:L},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(L,N){return i(typeof c<"u"),this.toArrayLike(c,L,N)},s.prototype.toArray=function(L,N){return this.toArrayLike(Array,L,N)},s.prototype.toArrayLike=function(L,N,U){var Z=this.byteLength(),Q=U||Math.max(1,Z);i(Z<=Q,"byte array longer than desired length"),i(Q>0,"Requested array length <= 0"),this.strip();var ue=N==="le",oe=new L(Q),le,j,J=this.clone();if(ue){for(j=0;!J.isZero();j++)le=J.andln(255),J.iushrn(8),oe[j]=le;for(;j=4096&&(U+=13,N>>>=13),N>=64&&(U+=7,N>>>=7),N>=8&&(U+=4,N>>>=4),N>=2&&(U+=2,N>>>=2),U+N},s.prototype._zeroBits=function(L){if(L===0)return 26;var N=L,U=0;return N&8191||(U+=13,N>>>=13),N&127||(U+=7,N>>>=7),N&15||(U+=4,N>>>=4),N&3||(U+=2,N>>>=2),N&1||U++,U},s.prototype.bitLength=function(){var L=this.words[this.length-1],N=this._countBits(L);return(this.length-1)*26+N};function b(O){for(var L=new Array(O.bitLength()),N=0;N>>Z}return L}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var L=0,N=0;NL.length?this.clone().ior(L):L.clone().ior(this)},s.prototype.uor=function(L){return this.length>L.length?this.clone().iuor(L):L.clone().iuor(this)},s.prototype.iuand=function(L){var N;this.length>L.length?N=L:N=this;for(var U=0;UL.length?this.clone().iand(L):L.clone().iand(this)},s.prototype.uand=function(L){return this.length>L.length?this.clone().iuand(L):L.clone().iuand(this)},s.prototype.iuxor=function(L){var N,U;this.length>L.length?(N=this,U=L):(N=L,U=this);for(var Z=0;ZL.length?this.clone().ixor(L):L.clone().ixor(this)},s.prototype.uxor=function(L){return this.length>L.length?this.clone().iuxor(L):L.clone().iuxor(this)},s.prototype.inotn=function(L){i(typeof L=="number"&&L>=0);var N=Math.ceil(L/26)|0,U=L%26;this._expand(N),U>0&&N--;for(var Z=0;Z0&&(this.words[Z]=~this.words[Z]&67108863>>26-U),this.strip()},s.prototype.notn=function(L){return this.clone().inotn(L)},s.prototype.setn=function(L,N){i(typeof L=="number"&&L>=0);var U=L/26|0,Z=L%26;return this._expand(U+1),N?this.words[U]=this.words[U]|1<L.length?(U=this,Z=L):(U=L,Z=this);for(var Q=0,ue=0;ue>>26;for(;Q!==0&&ue>>26;if(this.length=U.length,Q!==0)this.words[this.length]=Q,this.length++;else if(U!==this)for(;ueL.length?this.clone().iadd(L):L.clone().iadd(this)},s.prototype.isub=function(L){if(L.negative!==0){L.negative=0;var N=this.iadd(L);return L.negative=1,N._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(L),this.negative=1,this._normSign();var U=this.cmp(L);if(U===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,Q;U>0?(Z=this,Q=L):(Z=L,Q=this);for(var ue=0,oe=0;oe>26,this.words[oe]=N&67108863;for(;ue!==0&&oe>26,this.words[oe]=N&67108863;if(ue===0&&oe>>26,$=le&67108863,X=Math.min(j,L.length-1),re=Math.max(0,j-O.length+1);re<=X;re++){var ee=j-re|0;Z=O.words[ee]|0,Q=L.words[re]|0,ue=Z*Q+$,J+=ue/67108864|0,$=ue&67108863}N.words[j]=$|0,le=J|0}return le!==0?N.words[j]=le|0:N.length--,N.strip()}var M=function(L,N,U){var Z=L.words,Q=N.words,ue=U.words,oe=0,le,j,J,$=Z[0]|0,X=$&8191,re=$>>>13,ee=Z[1]|0,q=ee&8191,ae=ee>>>13,ie=Z[2]|0,fe=ie&8191,we=ie>>>13,Ae=Z[3]|0,Fe=Ae&8191,Ce=Ae>>>13,qe=Z[4]|0,et=qe&8191,Qe=qe>>>13,Ke=Z[5]|0,Xe=Ke&8191,Me=Ke>>>13,xe=Z[6]|0,ce=xe&8191,Re=xe>>>13,$e=Z[7]|0,rt=$e&8191,Je=$e>>>13,At=Z[8]|0,St=At&8191,Rt=At>>>13,Ut=Z[9]|0,ir=Ut&8191,ar=Ut>>>13,Mr=Q[0]|0,fr=Mr&8191,dr=Mr>>>13,pt=Q[1]|0,ze=pt&8191,Ge=pt>>>13,Oe=Q[2]|0,ve=Oe&8191,ge=Oe>>>13,be=Q[3]|0,Pe=be&8191,We=be>>>13,ct=Q[4]|0,_t=ct&8191,Mt=ct>>>13,Nt=Q[5]|0,Bt=Nt&8191,qt=Nt>>>13,Zt=Q[6]|0,lr=Zt&8191,ta=Zt>>>13,da=Q[7]|0,wa=da&8191,ma=da>>>13,Ia=Q[8]|0,va=Ia&8191,La=Ia>>>13,Ka=Q[9]|0,Vt=Ka&8191,Lt=Ka>>>13;U.negative=L.negative^N.negative,U.length=19,le=Math.imul(X,fr),j=Math.imul(X,dr),j=j+Math.imul(re,fr)|0,J=Math.imul(re,dr);var jt=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(jt>>>26)|0,jt&=67108863,le=Math.imul(q,fr),j=Math.imul(q,dr),j=j+Math.imul(ae,fr)|0,J=Math.imul(ae,dr),le=le+Math.imul(X,ze)|0,j=j+Math.imul(X,Ge)|0,j=j+Math.imul(re,ze)|0,J=J+Math.imul(re,Ge)|0;var Ot=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,le=Math.imul(fe,fr),j=Math.imul(fe,dr),j=j+Math.imul(we,fr)|0,J=Math.imul(we,dr),le=le+Math.imul(q,ze)|0,j=j+Math.imul(q,Ge)|0,j=j+Math.imul(ae,ze)|0,J=J+Math.imul(ae,Ge)|0,le=le+Math.imul(X,ve)|0,j=j+Math.imul(X,ge)|0,j=j+Math.imul(re,ve)|0,J=J+Math.imul(re,ge)|0;var gr=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(gr>>>26)|0,gr&=67108863,le=Math.imul(Fe,fr),j=Math.imul(Fe,dr),j=j+Math.imul(Ce,fr)|0,J=Math.imul(Ce,dr),le=le+Math.imul(fe,ze)|0,j=j+Math.imul(fe,Ge)|0,j=j+Math.imul(we,ze)|0,J=J+Math.imul(we,Ge)|0,le=le+Math.imul(q,ve)|0,j=j+Math.imul(q,ge)|0,j=j+Math.imul(ae,ve)|0,J=J+Math.imul(ae,ge)|0,le=le+Math.imul(X,Pe)|0,j=j+Math.imul(X,We)|0,j=j+Math.imul(re,Pe)|0,J=J+Math.imul(re,We)|0;var Br=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Br>>>26)|0,Br&=67108863,le=Math.imul(et,fr),j=Math.imul(et,dr),j=j+Math.imul(Qe,fr)|0,J=Math.imul(Qe,dr),le=le+Math.imul(Fe,ze)|0,j=j+Math.imul(Fe,Ge)|0,j=j+Math.imul(Ce,ze)|0,J=J+Math.imul(Ce,Ge)|0,le=le+Math.imul(fe,ve)|0,j=j+Math.imul(fe,ge)|0,j=j+Math.imul(we,ve)|0,J=J+Math.imul(we,ge)|0,le=le+Math.imul(q,Pe)|0,j=j+Math.imul(q,We)|0,j=j+Math.imul(ae,Pe)|0,J=J+Math.imul(ae,We)|0,le=le+Math.imul(X,_t)|0,j=j+Math.imul(X,Mt)|0,j=j+Math.imul(re,_t)|0,J=J+Math.imul(re,Mt)|0;var na=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(na>>>26)|0,na&=67108863,le=Math.imul(Xe,fr),j=Math.imul(Xe,dr),j=j+Math.imul(Me,fr)|0,J=Math.imul(Me,dr),le=le+Math.imul(et,ze)|0,j=j+Math.imul(et,Ge)|0,j=j+Math.imul(Qe,ze)|0,J=J+Math.imul(Qe,Ge)|0,le=le+Math.imul(Fe,ve)|0,j=j+Math.imul(Fe,ge)|0,j=j+Math.imul(Ce,ve)|0,J=J+Math.imul(Ce,ge)|0,le=le+Math.imul(fe,Pe)|0,j=j+Math.imul(fe,We)|0,j=j+Math.imul(we,Pe)|0,J=J+Math.imul(we,We)|0,le=le+Math.imul(q,_t)|0,j=j+Math.imul(q,Mt)|0,j=j+Math.imul(ae,_t)|0,J=J+Math.imul(ae,Mt)|0,le=le+Math.imul(X,Bt)|0,j=j+Math.imul(X,qt)|0,j=j+Math.imul(re,Bt)|0,J=J+Math.imul(re,qt)|0;var Ur=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,le=Math.imul(ce,fr),j=Math.imul(ce,dr),j=j+Math.imul(Re,fr)|0,J=Math.imul(Re,dr),le=le+Math.imul(Xe,ze)|0,j=j+Math.imul(Xe,Ge)|0,j=j+Math.imul(Me,ze)|0,J=J+Math.imul(Me,Ge)|0,le=le+Math.imul(et,ve)|0,j=j+Math.imul(et,ge)|0,j=j+Math.imul(Qe,ve)|0,J=J+Math.imul(Qe,ge)|0,le=le+Math.imul(Fe,Pe)|0,j=j+Math.imul(Fe,We)|0,j=j+Math.imul(Ce,Pe)|0,J=J+Math.imul(Ce,We)|0,le=le+Math.imul(fe,_t)|0,j=j+Math.imul(fe,Mt)|0,j=j+Math.imul(we,_t)|0,J=J+Math.imul(we,Mt)|0,le=le+Math.imul(q,Bt)|0,j=j+Math.imul(q,qt)|0,j=j+Math.imul(ae,Bt)|0,J=J+Math.imul(ae,qt)|0,le=le+Math.imul(X,lr)|0,j=j+Math.imul(X,ta)|0,j=j+Math.imul(re,lr)|0,J=J+Math.imul(re,ta)|0;var ga=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(ga>>>26)|0,ga&=67108863,le=Math.imul(rt,fr),j=Math.imul(rt,dr),j=j+Math.imul(Je,fr)|0,J=Math.imul(Je,dr),le=le+Math.imul(ce,ze)|0,j=j+Math.imul(ce,Ge)|0,j=j+Math.imul(Re,ze)|0,J=J+Math.imul(Re,Ge)|0,le=le+Math.imul(Xe,ve)|0,j=j+Math.imul(Xe,ge)|0,j=j+Math.imul(Me,ve)|0,J=J+Math.imul(Me,ge)|0,le=le+Math.imul(et,Pe)|0,j=j+Math.imul(et,We)|0,j=j+Math.imul(Qe,Pe)|0,J=J+Math.imul(Qe,We)|0,le=le+Math.imul(Fe,_t)|0,j=j+Math.imul(Fe,Mt)|0,j=j+Math.imul(Ce,_t)|0,J=J+Math.imul(Ce,Mt)|0,le=le+Math.imul(fe,Bt)|0,j=j+Math.imul(fe,qt)|0,j=j+Math.imul(we,Bt)|0,J=J+Math.imul(we,qt)|0,le=le+Math.imul(q,lr)|0,j=j+Math.imul(q,ta)|0,j=j+Math.imul(ae,lr)|0,J=J+Math.imul(ae,ta)|0,le=le+Math.imul(X,wa)|0,j=j+Math.imul(X,ma)|0,j=j+Math.imul(re,wa)|0,J=J+Math.imul(re,ma)|0;var Aa=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Aa>>>26)|0,Aa&=67108863,le=Math.imul(St,fr),j=Math.imul(St,dr),j=j+Math.imul(Rt,fr)|0,J=Math.imul(Rt,dr),le=le+Math.imul(rt,ze)|0,j=j+Math.imul(rt,Ge)|0,j=j+Math.imul(Je,ze)|0,J=J+Math.imul(Je,Ge)|0,le=le+Math.imul(ce,ve)|0,j=j+Math.imul(ce,ge)|0,j=j+Math.imul(Re,ve)|0,J=J+Math.imul(Re,ge)|0,le=le+Math.imul(Xe,Pe)|0,j=j+Math.imul(Xe,We)|0,j=j+Math.imul(Me,Pe)|0,J=J+Math.imul(Me,We)|0,le=le+Math.imul(et,_t)|0,j=j+Math.imul(et,Mt)|0,j=j+Math.imul(Qe,_t)|0,J=J+Math.imul(Qe,Mt)|0,le=le+Math.imul(Fe,Bt)|0,j=j+Math.imul(Fe,qt)|0,j=j+Math.imul(Ce,Bt)|0,J=J+Math.imul(Ce,qt)|0,le=le+Math.imul(fe,lr)|0,j=j+Math.imul(fe,ta)|0,j=j+Math.imul(we,lr)|0,J=J+Math.imul(we,ta)|0,le=le+Math.imul(q,wa)|0,j=j+Math.imul(q,ma)|0,j=j+Math.imul(ae,wa)|0,J=J+Math.imul(ae,ma)|0,le=le+Math.imul(X,va)|0,j=j+Math.imul(X,La)|0,j=j+Math.imul(re,va)|0,J=J+Math.imul(re,La)|0;var Pa=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Pa>>>26)|0,Pa&=67108863,le=Math.imul(ir,fr),j=Math.imul(ir,dr),j=j+Math.imul(ar,fr)|0,J=Math.imul(ar,dr),le=le+Math.imul(St,ze)|0,j=j+Math.imul(St,Ge)|0,j=j+Math.imul(Rt,ze)|0,J=J+Math.imul(Rt,Ge)|0,le=le+Math.imul(rt,ve)|0,j=j+Math.imul(rt,ge)|0,j=j+Math.imul(Je,ve)|0,J=J+Math.imul(Je,ge)|0,le=le+Math.imul(ce,Pe)|0,j=j+Math.imul(ce,We)|0,j=j+Math.imul(Re,Pe)|0,J=J+Math.imul(Re,We)|0,le=le+Math.imul(Xe,_t)|0,j=j+Math.imul(Xe,Mt)|0,j=j+Math.imul(Me,_t)|0,J=J+Math.imul(Me,Mt)|0,le=le+Math.imul(et,Bt)|0,j=j+Math.imul(et,qt)|0,j=j+Math.imul(Qe,Bt)|0,J=J+Math.imul(Qe,qt)|0,le=le+Math.imul(Fe,lr)|0,j=j+Math.imul(Fe,ta)|0,j=j+Math.imul(Ce,lr)|0,J=J+Math.imul(Ce,ta)|0,le=le+Math.imul(fe,wa)|0,j=j+Math.imul(fe,ma)|0,j=j+Math.imul(we,wa)|0,J=J+Math.imul(we,ma)|0,le=le+Math.imul(q,va)|0,j=j+Math.imul(q,La)|0,j=j+Math.imul(ae,va)|0,J=J+Math.imul(ae,La)|0,le=le+Math.imul(X,Vt)|0,j=j+Math.imul(X,Lt)|0,j=j+Math.imul(re,Vt)|0,J=J+Math.imul(re,Lt)|0;var sa=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(sa>>>26)|0,sa&=67108863,le=Math.imul(ir,ze),j=Math.imul(ir,Ge),j=j+Math.imul(ar,ze)|0,J=Math.imul(ar,Ge),le=le+Math.imul(St,ve)|0,j=j+Math.imul(St,ge)|0,j=j+Math.imul(Rt,ve)|0,J=J+Math.imul(Rt,ge)|0,le=le+Math.imul(rt,Pe)|0,j=j+Math.imul(rt,We)|0,j=j+Math.imul(Je,Pe)|0,J=J+Math.imul(Je,We)|0,le=le+Math.imul(ce,_t)|0,j=j+Math.imul(ce,Mt)|0,j=j+Math.imul(Re,_t)|0,J=J+Math.imul(Re,Mt)|0,le=le+Math.imul(Xe,Bt)|0,j=j+Math.imul(Xe,qt)|0,j=j+Math.imul(Me,Bt)|0,J=J+Math.imul(Me,qt)|0,le=le+Math.imul(et,lr)|0,j=j+Math.imul(et,ta)|0,j=j+Math.imul(Qe,lr)|0,J=J+Math.imul(Qe,ta)|0,le=le+Math.imul(Fe,wa)|0,j=j+Math.imul(Fe,ma)|0,j=j+Math.imul(Ce,wa)|0,J=J+Math.imul(Ce,ma)|0,le=le+Math.imul(fe,va)|0,j=j+Math.imul(fe,La)|0,j=j+Math.imul(we,va)|0,J=J+Math.imul(we,La)|0,le=le+Math.imul(q,Vt)|0,j=j+Math.imul(q,Lt)|0,j=j+Math.imul(ae,Vt)|0,J=J+Math.imul(ae,Lt)|0;var Oa=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Oa>>>26)|0,Oa&=67108863,le=Math.imul(ir,ve),j=Math.imul(ir,ge),j=j+Math.imul(ar,ve)|0,J=Math.imul(ar,ge),le=le+Math.imul(St,Pe)|0,j=j+Math.imul(St,We)|0,j=j+Math.imul(Rt,Pe)|0,J=J+Math.imul(Rt,We)|0,le=le+Math.imul(rt,_t)|0,j=j+Math.imul(rt,Mt)|0,j=j+Math.imul(Je,_t)|0,J=J+Math.imul(Je,Mt)|0,le=le+Math.imul(ce,Bt)|0,j=j+Math.imul(ce,qt)|0,j=j+Math.imul(Re,Bt)|0,J=J+Math.imul(Re,qt)|0,le=le+Math.imul(Xe,lr)|0,j=j+Math.imul(Xe,ta)|0,j=j+Math.imul(Me,lr)|0,J=J+Math.imul(Me,ta)|0,le=le+Math.imul(et,wa)|0,j=j+Math.imul(et,ma)|0,j=j+Math.imul(Qe,wa)|0,J=J+Math.imul(Qe,ma)|0,le=le+Math.imul(Fe,va)|0,j=j+Math.imul(Fe,La)|0,j=j+Math.imul(Ce,va)|0,J=J+Math.imul(Ce,La)|0,le=le+Math.imul(fe,Vt)|0,j=j+Math.imul(fe,Lt)|0,j=j+Math.imul(we,Vt)|0,J=J+Math.imul(we,Lt)|0;var dt=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(dt>>>26)|0,dt&=67108863,le=Math.imul(ir,Pe),j=Math.imul(ir,We),j=j+Math.imul(ar,Pe)|0,J=Math.imul(ar,We),le=le+Math.imul(St,_t)|0,j=j+Math.imul(St,Mt)|0,j=j+Math.imul(Rt,_t)|0,J=J+Math.imul(Rt,Mt)|0,le=le+Math.imul(rt,Bt)|0,j=j+Math.imul(rt,qt)|0,j=j+Math.imul(Je,Bt)|0,J=J+Math.imul(Je,qt)|0,le=le+Math.imul(ce,lr)|0,j=j+Math.imul(ce,ta)|0,j=j+Math.imul(Re,lr)|0,J=J+Math.imul(Re,ta)|0,le=le+Math.imul(Xe,wa)|0,j=j+Math.imul(Xe,ma)|0,j=j+Math.imul(Me,wa)|0,J=J+Math.imul(Me,ma)|0,le=le+Math.imul(et,va)|0,j=j+Math.imul(et,La)|0,j=j+Math.imul(Qe,va)|0,J=J+Math.imul(Qe,La)|0,le=le+Math.imul(Fe,Vt)|0,j=j+Math.imul(Fe,Lt)|0,j=j+Math.imul(Ce,Vt)|0,J=J+Math.imul(Ce,Lt)|0;var vt=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(vt>>>26)|0,vt&=67108863,le=Math.imul(ir,_t),j=Math.imul(ir,Mt),j=j+Math.imul(ar,_t)|0,J=Math.imul(ar,Mt),le=le+Math.imul(St,Bt)|0,j=j+Math.imul(St,qt)|0,j=j+Math.imul(Rt,Bt)|0,J=J+Math.imul(Rt,qt)|0,le=le+Math.imul(rt,lr)|0,j=j+Math.imul(rt,ta)|0,j=j+Math.imul(Je,lr)|0,J=J+Math.imul(Je,ta)|0,le=le+Math.imul(ce,wa)|0,j=j+Math.imul(ce,ma)|0,j=j+Math.imul(Re,wa)|0,J=J+Math.imul(Re,ma)|0,le=le+Math.imul(Xe,va)|0,j=j+Math.imul(Xe,La)|0,j=j+Math.imul(Me,va)|0,J=J+Math.imul(Me,La)|0,le=le+Math.imul(et,Vt)|0,j=j+Math.imul(et,Lt)|0,j=j+Math.imul(Qe,Vt)|0,J=J+Math.imul(Qe,Lt)|0;var Lr=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Lr>>>26)|0,Lr&=67108863,le=Math.imul(ir,Bt),j=Math.imul(ir,qt),j=j+Math.imul(ar,Bt)|0,J=Math.imul(ar,qt),le=le+Math.imul(St,lr)|0,j=j+Math.imul(St,ta)|0,j=j+Math.imul(Rt,lr)|0,J=J+Math.imul(Rt,ta)|0,le=le+Math.imul(rt,wa)|0,j=j+Math.imul(rt,ma)|0,j=j+Math.imul(Je,wa)|0,J=J+Math.imul(Je,ma)|0,le=le+Math.imul(ce,va)|0,j=j+Math.imul(ce,La)|0,j=j+Math.imul(Re,va)|0,J=J+Math.imul(Re,La)|0,le=le+Math.imul(Xe,Vt)|0,j=j+Math.imul(Xe,Lt)|0,j=j+Math.imul(Me,Vt)|0,J=J+Math.imul(Me,Lt)|0;var Er=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(Er>>>26)|0,Er&=67108863,le=Math.imul(ir,lr),j=Math.imul(ir,ta),j=j+Math.imul(ar,lr)|0,J=Math.imul(ar,ta),le=le+Math.imul(St,wa)|0,j=j+Math.imul(St,ma)|0,j=j+Math.imul(Rt,wa)|0,J=J+Math.imul(Rt,ma)|0,le=le+Math.imul(rt,va)|0,j=j+Math.imul(rt,La)|0,j=j+Math.imul(Je,va)|0,J=J+Math.imul(Je,La)|0,le=le+Math.imul(ce,Vt)|0,j=j+Math.imul(ce,Lt)|0,j=j+Math.imul(Re,Vt)|0,J=J+Math.imul(Re,Lt)|0;var _r=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(_r>>>26)|0,_r&=67108863,le=Math.imul(ir,wa),j=Math.imul(ir,ma),j=j+Math.imul(ar,wa)|0,J=Math.imul(ar,ma),le=le+Math.imul(St,va)|0,j=j+Math.imul(St,La)|0,j=j+Math.imul(Rt,va)|0,J=J+Math.imul(Rt,La)|0,le=le+Math.imul(rt,Vt)|0,j=j+Math.imul(rt,Lt)|0,j=j+Math.imul(Je,Vt)|0,J=J+Math.imul(Je,Lt)|0;var yr=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(yr>>>26)|0,yr&=67108863,le=Math.imul(ir,va),j=Math.imul(ir,La),j=j+Math.imul(ar,va)|0,J=Math.imul(ar,La),le=le+Math.imul(St,Vt)|0,j=j+Math.imul(St,Lt)|0,j=j+Math.imul(Rt,Vt)|0,J=J+Math.imul(Rt,Lt)|0;var kr=(oe+le|0)+((j&8191)<<13)|0;oe=(J+(j>>>13)|0)+(kr>>>26)|0,kr&=67108863,le=Math.imul(ir,Vt),j=Math.imul(ir,Lt),j=j+Math.imul(ar,Vt)|0,J=Math.imul(ar,Lt);var zr=(oe+le|0)+((j&8191)<<13)|0;return oe=(J+(j>>>13)|0)+(zr>>>26)|0,zr&=67108863,ue[0]=jt,ue[1]=Ot,ue[2]=gr,ue[3]=Br,ue[4]=na,ue[5]=Ur,ue[6]=ga,ue[7]=Aa,ue[8]=Pa,ue[9]=sa,ue[10]=Oa,ue[11]=dt,ue[12]=vt,ue[13]=Lr,ue[14]=Er,ue[15]=_r,ue[16]=yr,ue[17]=kr,ue[18]=zr,oe!==0&&(ue[19]=oe,U.length++),U};Math.imul||(M=S);function _(O,L,N){N.negative=L.negative^O.negative,N.length=O.length+L.length;for(var U=0,Z=0,Q=0;Q>>26)|0,Z+=ue>>>26,ue&=67108863}N.words[Q]=oe,U=ue,ue=Z}return U!==0?N.words[Q]=U:N.length--,N.strip()}function w(O,L,N){var U=new p;return U.mulp(O,L,N)}s.prototype.mulTo=function(L,N){var U,Z=this.length+L.length;return this.length===10&&L.length===10?U=M(this,L,N):Z<63?U=S(this,L,N):Z<1024?U=_(this,L,N):U=w(this,L,N),U};function p(O,L){this.x=O,this.y=L}p.prototype.makeRBT=function(L){for(var N=new Array(L),U=s.prototype._countBits(L)-1,Z=0;Z>=1;return Z},p.prototype.permute=function(L,N,U,Z,Q,ue){for(var oe=0;oe>>1)Q++;return 1<>>13,U[2*ue+1]=Q&8191,Q=Q>>>13;for(ue=2*N;ue>=26,N+=Z/67108864|0,N+=Q>>>26,this.words[U]=Q&67108863}return N!==0&&(this.words[U]=N,this.length++),this},s.prototype.muln=function(L){return this.clone().imuln(L)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(L){var N=b(L);if(N.length===0)return new s(1);for(var U=this,Z=0;Z=0);var N=L%26,U=(L-N)/26,Z=67108863>>>26-N<<26-N,Q;if(N!==0){var ue=0;for(Q=0;Q>>26-N}ue&&(this.words[Q]=ue,this.length++)}if(U!==0){for(Q=this.length-1;Q>=0;Q--)this.words[Q+U]=this.words[Q];for(Q=0;Q=0);var Z;N?Z=(N-N%26)/26:Z=0;var Q=L%26,ue=Math.min((L-Q)/26,this.length),oe=67108863^67108863>>>Q<ue)for(this.length-=ue,j=0;j=0&&(J!==0||j>=Z);j--){var $=this.words[j]|0;this.words[j]=J<<26-Q|$>>>Q,J=$&oe}return le&&J!==0&&(le.words[le.length++]=J),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(L,N,U){return i(this.negative===0),this.iushrn(L,N,U)},s.prototype.shln=function(L){return this.clone().ishln(L)},s.prototype.ushln=function(L){return this.clone().iushln(L)},s.prototype.shrn=function(L){return this.clone().ishrn(L)},s.prototype.ushrn=function(L){return this.clone().iushrn(L)},s.prototype.testn=function(L){i(typeof L=="number"&&L>=0);var N=L%26,U=(L-N)/26,Z=1<=0);var N=L%26,U=(L-N)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=U)return this;if(N!==0&&U++,this.length=Math.min(U,this.length),N!==0){var Z=67108863^67108863>>>N<=67108864;N++)this.words[N]-=67108864,N===this.length-1?this.words[N+1]=1:this.words[N+1]++;return this.length=Math.max(this.length,N+1),this},s.prototype.isubn=function(L){if(i(typeof L=="number"),i(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 N=0;N>26)-(le/67108864|0),this.words[Q+U]=ue&67108863}for(;Q>26,this.words[Q+U]=ue&67108863;if(oe===0)return this.strip();for(i(oe===-1),oe=0,Q=0;Q>26,this.words[Q]=ue&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(L,N){var U=this.length-L.length,Z=this.clone(),Q=L,ue=Q.words[Q.length-1]|0,oe=this._countBits(ue);U=26-oe,U!==0&&(Q=Q.ushln(U),Z.iushln(U),ue=Q.words[Q.length-1]|0);var le=Z.length-Q.length,j;if(N!=="mod"){j=new s(null),j.length=le+1,j.words=new Array(j.length);for(var J=0;J=0;X--){var re=(Z.words[Q.length+X]|0)*67108864+(Z.words[Q.length+X-1]|0);for(re=Math.min(re/ue|0,67108863),Z._ishlnsubmul(Q,re,X);Z.negative!==0;)re--,Z.negative=0,Z._ishlnsubmul(Q,1,X),Z.isZero()||(Z.negative^=1);j&&(j.words[X]=re)}return j&&j.strip(),Z.strip(),N!=="div"&&U!==0&&Z.iushrn(U),{div:j||null,mod:Z}},s.prototype.divmod=function(L,N,U){if(i(!L.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var Z,Q,ue;return this.negative!==0&&L.negative===0?(ue=this.neg().divmod(L,N),N!=="mod"&&(Z=ue.div.neg()),N!=="div"&&(Q=ue.mod.neg(),U&&Q.negative!==0&&Q.iadd(L)),{div:Z,mod:Q}):this.negative===0&&L.negative!==0?(ue=this.divmod(L.neg(),N),N!=="mod"&&(Z=ue.div.neg()),{div:Z,mod:ue.mod}):this.negative&L.negative?(ue=this.neg().divmod(L.neg(),N),N!=="div"&&(Q=ue.mod.neg(),U&&Q.negative!==0&&Q.isub(L)),{div:ue.div,mod:Q}):L.length>this.length||this.cmp(L)<0?{div:new s(0),mod:this}:L.length===1?N==="div"?{div:this.divn(L.words[0]),mod:null}:N==="mod"?{div:null,mod:new s(this.modn(L.words[0]))}:{div:this.divn(L.words[0]),mod:new s(this.modn(L.words[0]))}:this._wordDiv(L,N)},s.prototype.div=function(L){return this.divmod(L,"div",!1).div},s.prototype.mod=function(L){return this.divmod(L,"mod",!1).mod},s.prototype.umod=function(L){return this.divmod(L,"mod",!0).mod},s.prototype.divRound=function(L){var N=this.divmod(L);if(N.mod.isZero())return N.div;var U=N.div.negative!==0?N.mod.isub(L):N.mod,Z=L.ushrn(1),Q=L.andln(1),ue=U.cmp(Z);return ue<0||Q===1&&ue===0?N.div:N.div.negative!==0?N.div.isubn(1):N.div.iaddn(1)},s.prototype.modn=function(L){i(L<=67108863);for(var N=(1<<26)%L,U=0,Z=this.length-1;Z>=0;Z--)U=(N*U+(this.words[Z]|0))%L;return U},s.prototype.idivn=function(L){i(L<=67108863);for(var N=0,U=this.length-1;U>=0;U--){var Z=(this.words[U]|0)+N*67108864;this.words[U]=Z/L|0,N=Z%L}return this.strip()},s.prototype.divn=function(L){return this.clone().idivn(L)},s.prototype.egcd=function(L){i(L.negative===0),i(!L.isZero());var N=this,U=L.clone();N.negative!==0?N=N.umod(L):N=N.clone();for(var Z=new s(1),Q=new s(0),ue=new s(0),oe=new s(1),le=0;N.isEven()&&U.isEven();)N.iushrn(1),U.iushrn(1),++le;for(var j=U.clone(),J=N.clone();!N.isZero();){for(var $=0,X=1;!(N.words[0]&X)&&$<26;++$,X<<=1);if($>0)for(N.iushrn($);$-- >0;)(Z.isOdd()||Q.isOdd())&&(Z.iadd(j),Q.isub(J)),Z.iushrn(1),Q.iushrn(1);for(var re=0,ee=1;!(U.words[0]&ee)&&re<26;++re,ee<<=1);if(re>0)for(U.iushrn(re);re-- >0;)(ue.isOdd()||oe.isOdd())&&(ue.iadd(j),oe.isub(J)),ue.iushrn(1),oe.iushrn(1);N.cmp(U)>=0?(N.isub(U),Z.isub(ue),Q.isub(oe)):(U.isub(N),ue.isub(Z),oe.isub(Q))}return{a:ue,b:oe,gcd:U.iushln(le)}},s.prototype._invmp=function(L){i(L.negative===0),i(!L.isZero());var N=this,U=L.clone();N.negative!==0?N=N.umod(L):N=N.clone();for(var Z=new s(1),Q=new s(0),ue=U.clone();N.cmpn(1)>0&&U.cmpn(1)>0;){for(var oe=0,le=1;!(N.words[0]&le)&&oe<26;++oe,le<<=1);if(oe>0)for(N.iushrn(oe);oe-- >0;)Z.isOdd()&&Z.iadd(ue),Z.iushrn(1);for(var j=0,J=1;!(U.words[0]&J)&&j<26;++j,J<<=1);if(j>0)for(U.iushrn(j);j-- >0;)Q.isOdd()&&Q.iadd(ue),Q.iushrn(1);N.cmp(U)>=0?(N.isub(U),Z.isub(Q)):(U.isub(N),Q.isub(Z))}var $;return N.cmpn(1)===0?$=Z:$=Q,$.cmpn(0)<0&&$.iadd(L),$},s.prototype.gcd=function(L){if(this.isZero())return L.abs();if(L.isZero())return this.abs();var N=this.clone(),U=L.clone();N.negative=0,U.negative=0;for(var Z=0;N.isEven()&&U.isEven();Z++)N.iushrn(1),U.iushrn(1);do{for(;N.isEven();)N.iushrn(1);for(;U.isEven();)U.iushrn(1);var Q=N.cmp(U);if(Q<0){var ue=N;N=U,U=ue}else if(Q===0||U.cmpn(1)===0)break;N.isub(U)}while(!0);return U.iushln(Z)},s.prototype.invm=function(L){return this.egcd(L).a.umod(L)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(L){return this.words[0]&L},s.prototype.bincn=function(L){i(typeof L=="number");var N=L%26,U=(L-N)/26,Z=1<>>26,oe&=67108863,this.words[ue]=oe}return Q!==0&&(this.words[ue]=Q,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(L){var N=L<0;if(this.negative!==0&&!N)return-1;if(this.negative===0&&N)return 1;this.strip();var U;if(this.length>1)U=1;else{N&&(L=-L),i(L<=67108863,"Number is too big");var Z=this.words[0]|0;U=Z===L?0:ZL.length)return 1;if(this.length=0;U--){var Z=this.words[U]|0,Q=L.words[U]|0;if(Z!==Q){ZQ&&(N=1);break}}return N},s.prototype.gtn=function(L){return this.cmpn(L)===1},s.prototype.gt=function(L){return this.cmp(L)===1},s.prototype.gten=function(L){return this.cmpn(L)>=0},s.prototype.gte=function(L){return this.cmp(L)>=0},s.prototype.ltn=function(L){return this.cmpn(L)===-1},s.prototype.lt=function(L){return this.cmp(L)===-1},s.prototype.lten=function(L){return this.cmpn(L)<=0},s.prototype.lte=function(L){return this.cmp(L)<=0},s.prototype.eqn=function(L){return this.cmpn(L)===0},s.prototype.eq=function(L){return this.cmp(L)===0},s.red=function(L){return new F(L)},s.prototype.toRed=function(L){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),L.convertTo(this)._forceRed(L)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(L){return this.red=L,this},s.prototype.forceRed=function(L){return i(!this.red,"Already a number in reduction context"),this._forceRed(L)},s.prototype.redAdd=function(L){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,L)},s.prototype.redIAdd=function(L){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,L)},s.prototype.redSub=function(L){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,L)},s.prototype.redISub=function(L){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,L)},s.prototype.redShl=function(L){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,L)},s.prototype.redMul=function(L){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,L),this.red.mul(this,L)},s.prototype.redIMul=function(L){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,L),this.red.imul(this,L)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(L){return i(this.red&&!L.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,L)};var u={k256:null,p224:null,p192:null,p25519:null};function g(O,L){this.name=O,this.p=new s(L,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}g.prototype._tmp=function(){var L=new s(null);return L.words=new Array(Math.ceil(this.n/13)),L},g.prototype.ireduce=function(L){var N=L,U;do this.split(N,this.tmp),N=this.imulK(N),N=N.iadd(this.tmp),U=N.bitLength();while(U>this.n);var Z=U0?N.isub(this.p):N.strip!==void 0?N.strip():N._strip(),N},g.prototype.split=function(L,N){L.iushrn(this.n,0,N)},g.prototype.imulK=function(L){return L.imul(this.k)};function m(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(m,g),m.prototype.split=function(L,N){for(var U=4194303,Z=Math.min(L.length,9),Q=0;Q>>22,ue=oe}ue>>>=22,L.words[Q-10]=ue,ue===0&&L.length>10?L.length-=10:L.length-=9},m.prototype.imulK=function(L){L.words[L.length]=0,L.words[L.length+1]=0,L.length+=2;for(var N=0,U=0;U>>=26,L.words[U]=Q,N=Z}return N!==0&&(L.words[L.length++]=N),L},s._prime=function(L){if(u[L])return u[L];var N;if(L==="k256")N=new m;else if(L==="p224")N=new R;else if(L==="p192")N=new P;else if(L==="p25519")N=new z;else throw new Error("Unknown prime "+L);return u[L]=N,N};function F(O){if(typeof O=="string"){var L=s._prime(O);this.m=L.p,this.prime=L}else i(O.gtn(1),"modulus must be greater than 1"),this.m=O,this.prime=null}F.prototype._verify1=function(L){i(L.negative===0,"red works only with positives"),i(L.red,"red works only with red numbers")},F.prototype._verify2=function(L,N){i((L.negative|N.negative)===0,"red works only with positives"),i(L.red&&L.red===N.red,"red works only with red numbers")},F.prototype.imod=function(L){return this.prime?this.prime.ireduce(L)._forceRed(this):L.umod(this.m)._forceRed(this)},F.prototype.neg=function(L){return L.isZero()?L.clone():this.m.sub(L)._forceRed(this)},F.prototype.add=function(L,N){this._verify2(L,N);var U=L.add(N);return U.cmp(this.m)>=0&&U.isub(this.m),U._forceRed(this)},F.prototype.iadd=function(L,N){this._verify2(L,N);var U=L.iadd(N);return U.cmp(this.m)>=0&&U.isub(this.m),U},F.prototype.sub=function(L,N){this._verify2(L,N);var U=L.sub(N);return U.cmpn(0)<0&&U.iadd(this.m),U._forceRed(this)},F.prototype.isub=function(L,N){this._verify2(L,N);var U=L.isub(N);return U.cmpn(0)<0&&U.iadd(this.m),U},F.prototype.shl=function(L,N){return this._verify1(L),this.imod(L.ushln(N))},F.prototype.imul=function(L,N){return this._verify2(L,N),this.imod(L.imul(N))},F.prototype.mul=function(L,N){return this._verify2(L,N),this.imod(L.mul(N))},F.prototype.isqr=function(L){return this.imul(L,L.clone())},F.prototype.sqr=function(L){return this.mul(L,L)},F.prototype.sqrt=function(L){if(L.isZero())return L.clone();var N=this.m.andln(3);if(i(N%2===1),N===3){var U=this.m.add(new s(1)).iushrn(2);return this.pow(L,U)}for(var Z=this.m.subn(1),Q=0;!Z.isZero()&&Z.andln(1)===0;)Q++,Z.iushrn(1);i(!Z.isZero());var ue=new s(1).toRed(this),oe=ue.redNeg(),le=this.m.subn(1).iushrn(1),j=this.m.bitLength();for(j=new s(2*j*j).toRed(this);this.pow(j,le).cmp(oe)!==0;)j.redIAdd(oe);for(var J=this.pow(j,Z),$=this.pow(L,Z.addn(1).iushrn(1)),X=this.pow(L,Z),re=Q;X.cmp(ue)!==0;){for(var ee=X,q=0;ee.cmp(ue)!==0;q++)ee=ee.redSqr();i(q=0;Q--){for(var J=N.words[Q],$=j-1;$>=0;$--){var X=J>>$&1;if(ue!==Z[0]&&(ue=this.sqr(ue)),X===0&&oe===0){le=0;continue}oe<<=1,oe|=X,le++,!(le!==U&&(Q!==0||$!==0))&&(ue=this.mul(ue,Z[oe]),le=0,oe=0)}j=26}return ue},F.prototype.convertTo=function(L){var N=L.umod(this.m);return N===L?N.clone():N},F.prototype.convertFrom=function(L){var N=L.clone();return N.red=null,N},s.mont=function(L){return new B(L)};function B(O){F.call(this,O),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(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)}n(B,F),B.prototype.convertTo=function(L){return this.imod(L.ushln(this.shift))},B.prototype.convertFrom=function(L){var N=this.imod(L.mul(this.rinv));return N.red=null,N},B.prototype.imul=function(L,N){if(L.isZero()||N.isZero())return L.words[0]=0,L.length=1,L;var U=L.imul(N),Z=U.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Q=U.isub(Z).iushrn(this.shift),ue=Q;return Q.cmp(this.m)>=0?ue=Q.isub(this.m):Q.cmpn(0)<0&&(ue=Q.iadd(this.m)),ue._forceRed(this)},B.prototype.mul=function(L,N){if(L.isZero()||N.isZero())return new s(0)._forceRed(this);var U=L.mul(N),Z=U.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Q=U.isub(Z).iushrn(this.shift),ue=Q;return Q.cmp(this.m)>=0?ue=Q.isub(this.m):Q.cmpn(0)<0&&(ue=Q.iadd(this.m)),ue._forceRed(this)},B.prototype.invm=function(L){var N=this.imod(L._invmp(this.m).mul(this.r2));return N._forceRed(this)}}(e,this)},6204:function(e){e.exports=t;function t(r){var o,a,i,n=r.length,s=0;for(o=0;o>>1;if(!(p<=0)){var u,g=o.mallocDouble(2*p*_),m=o.mallocInt32(_);if(_=s(y,p,g,m),_>0){if(p===1&&M)a.init(_),u=a.sweepComplete(p,S,0,_,g,m,0,_,g,m);else{var R=o.mallocDouble(2*p*w),P=o.mallocInt32(w);w=s(b,p,R,P),w>0&&(a.init(_+w),p===1?u=a.sweepBipartite(p,S,0,_,g,m,0,w,R,P):u=i(p,S,M,_,g,m,w,R,P),o.free(R),o.free(P))}o.free(g),o.free(m)}return u}}}var f;function v(y,b){f.push([y,b])}function h(y){return f=[],c(y,y,v,!0),f}function T(y,b){return f=[],c(y,b,v,!1),f}function l(y,b,S){switch(arguments.length){case 1:return h(y);case 2:return typeof b=="function"?c(y,y,b,!0):T(y,b);case 3:return c(y,b,S,!1);default:throw new Error("box-intersect: Invalid arguments")}}},2455:function(e,t){function r(){function i(c,f,v,h,T,l,y,b,S,M,_){for(var w=2*c,p=h,u=w*h;pS-b?i(c,f,v,h,T,l,y,b,S,M,_):n(c,f,v,h,T,l,y,b,S,M,_)}return s}function o(){function i(v,h,T,l,y,b,S,M,_,w,p){for(var u=2*v,g=l,m=u*l;gw-_?l?i(v,h,T,y,b,S,M,_,w,p,u):n(v,h,T,y,b,S,M,_,w,p,u):l?s(v,h,T,y,b,S,M,_,w,p,u):c(v,h,T,y,b,S,M,_,w,p,u)}return f}function a(i){return i?r():o()}t.partial=a(!1),t.full=a(!0)},7150:function(e,t,r){e.exports=O;var o=r(1888),a=r(8828),i=r(2455),n=i.partial,s=i.full,c=r(855),f=r(3545),v=r(8105),h=128,T=1<<22,l=1<<22,y=v("!(lo>=p0)&&!(p1>=hi)"),b=v("lo===p0"),S=v("lo0;){J-=1;var re=J*p,ee=m[re],q=m[re+1],ae=m[re+2],ie=m[re+3],fe=m[re+4],we=m[re+5],Ae=J*u,Fe=R[Ae],Ce=R[Ae+1],qe=we&1,et=!!(we&16),Qe=Q,Ke=ue,Xe=le,Me=j;if(qe&&(Qe=le,Ke=j,Xe=Q,Me=ue),!(we&2&&(ae=S(L,ee,q,ae,Qe,Ke,Ce),q>=ae))&&!(we&4&&(q=M(L,ee,q,ae,Qe,Ke,Fe),q>=ae))){var xe=ae-q,ce=fe-ie;if(et){if(L*xe*(xe+ce)v&&T[w+f]>M;--_,w-=y){for(var p=w,u=w+y,g=0;g>>1,M=2*c,_=S,w=T[M*S+f];y=R?(_=m,w=R):g>=z?(_=u,w=g):(_=P,w=z):R>=z?(_=m,w=R):z>=g?(_=u,w=g):(_=P,w=z);for(var O=M*(b-1),L=M*_,F=0;F=p0)&&!(p1>=hi)":f};function r(v){return t[v]}function o(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+u];if(R===S)if(p===m)p+=1,w+=M;else{for(var P=0;M>P;++P){var z=y[_+P];y[_+P]=y[w],y[w++]=z}var F=b[m];b[m]=b[p],b[p++]=F}}return p}function a(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+u];if(RP;++P){var z=y[_+P];y[_+P]=y[w],y[w++]=z}var F=b[m];b[m]=b[p],b[p++]=F}}return p}function i(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+g];if(R<=S)if(p===m)p+=1,w+=M;else{for(var P=0;M>P;++P){var z=y[_+P];y[_+P]=y[w],y[w++]=z}var F=b[m];b[m]=b[p],b[p++]=F}}return p}function n(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+g];if(R<=S)if(p===m)p+=1,w+=M;else{for(var P=0;M>P;++P){var z=y[_+P];y[_+P]=y[w],y[w++]=z}var F=b[m];b[m]=b[p],b[p++]=F}}return p}function s(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+u],P=y[_+g];if(R<=S&&S<=P)if(p===m)p+=1,w+=M;else{for(var z=0;M>z;++z){var F=y[_+z];y[_+z]=y[w],y[w++]=F}var B=b[m];b[m]=b[p],b[p++]=B}}return p}function c(v,h,T,l,y,b,S){for(var M=2*v,_=M*T,w=_,p=T,u=h,g=v+h,m=T;l>m;++m,_+=M){var R=y[_+u],P=y[_+g];if(Rz;++z){var F=y[_+z];y[_+z]=y[w],y[w++]=F}var B=b[m];b[m]=b[p],b[p++]=B}}return p}function f(v,h,T,l,y,b,S,M){for(var _=2*v,w=_*T,p=w,u=T,g=h,m=v+h,R=T;l>R;++R,w+=_){var P=y[w+g],z=y[w+m];if(!(P>=S)&&!(M>=z))if(u===R)u+=1,p+=_;else{for(var F=0;_>F;++F){var B=y[w+F];y[w+F]=y[p],y[p++]=B}var O=b[R];b[R]=b[u],b[u++]=O}}return u}},4192:function(e){e.exports=r;var t=32;function r(h,T){T<=4*t?o(0,T-1,h):v(0,T-1,h)}function o(h,T,l){for(var y=2*(h+1),b=h+1;b<=T;++b){for(var S=l[y++],M=l[y++],_=b,w=y-2;_-- >h;){var p=l[w-2],u=l[w-1];if(pl[T+1]:!0}function f(h,T,l,y){h*=2;var b=y[h];return b>1,_=M-y,w=M+y,p=b,u=_,g=M,m=w,R=S,P=h+1,z=T-1,F=0;c(p,u,l)&&(F=p,p=u,u=F),c(m,R,l)&&(F=m,m=R,R=F),c(p,g,l)&&(F=p,p=g,g=F),c(u,g,l)&&(F=u,u=g,g=F),c(p,m,l)&&(F=p,p=m,m=F),c(g,m,l)&&(F=g,g=m,m=F),c(u,R,l)&&(F=u,u=R,R=F),c(u,g,l)&&(F=u,u=g,g=F),c(m,R,l)&&(F=m,m=R,R=F);for(var B=l[2*u],O=l[2*u+1],L=l[2*m],N=l[2*m+1],U=2*p,Z=2*g,Q=2*R,ue=2*b,oe=2*M,le=2*S,j=0;j<2;++j){var J=l[U+j],$=l[Z+j],X=l[Q+j];l[ue+j]=J,l[oe+j]=$,l[le+j]=X}i(_,h,l),i(w,T,l);for(var re=P;re<=z;++re)if(f(re,B,O,l))re!==P&&a(re,P,l),++P;else if(!f(re,L,N,l))for(;;)if(f(z,L,N,l)){f(z,B,O,l)?(n(re,P,z,l),++P,--z):(a(re,z,l),--z);break}else{if(--z>>1;i(y,$);for(var X=0,re=0,oe=0;oe<$;++oe){var ee=y[2*oe+1]|0;if(ee>=n)ee=ee-n|0,S(v,h,re--,ee);else if(ee>=0)S(c,f,X--,ee);else if(ee<=-n){ee=-ee-n|0;for(var q=0;q>>1;i(y,$);for(var X=0,re=0,ee=0,oe=0;oe<$;++oe){var q=y[2*oe+1]|0,ae=q&1;if(oe<$-1&&q>>1===y[2*oe+3]>>1&&(ae=2,oe+=1),q<0){for(var ie=-(q>>1)-1,fe=0;fe>1)-1;ae===0?S(c,f,X--,ie):ae===1?S(v,h,re--,ie):ae===2&&S(T,l,ee--,ie)}}}function p(g,m,R,P,z,F,B,O,L,N,U,Z){var Q=0,ue=2*g,oe=m,le=m+g,j=1,J=1;P?J=n:j=n;for(var $=z;$>>1;i(y,q);for(var ae=0,$=0;$=n?(fe=!P,X-=n):(fe=!!P,X-=1),fe)M(c,f,ae++,X);else{var we=Z[X],Ae=ue*X,Fe=U[Ae+m+1],Ce=U[Ae+m+1+g];e:for(var qe=0;qe>>1;i(y,X);for(var re=0,le=0;le=n)c[re++]=j-n;else{j-=1;var q=U[j],ae=Q*j,ie=N[ae+m+1],fe=N[ae+m+1+g];e:for(var we=0;we=0;--we)if(c[we]===j){for(var qe=we+1;qe0;){for(var y=c.pop(),h=c.pop(),b=-1,S=-1,T=v[h],_=1;_=0||(s.flip(h,y),a(n,s,c,b,h,S),a(n,s,c,h,S,b),a(n,s,c,S,y,b),a(n,s,c,y,b,S))}}},5023:function(e,t,r){var o=r(2478);e.exports=f;function a(v,h,T,l,y,b,S){this.cells=v,this.neighbor=h,this.flags=l,this.constraint=T,this.active=y,this.next=b,this.boundary=S}var i=a.prototype;function n(v,h){return v[0]-h[0]||v[1]-h[1]||v[2]-h[2]}i.locate=function(){var v=[0,0,0];return function(h,T,l){var y=h,b=T,S=l;return T0||S.length>0;){for(;b.length>0;){var u=b.pop();if(M[u]!==-y){M[u]=y,_[u];for(var g=0;g<3;++g){var m=p[3*u+g];m>=0&&M[m]===0&&(w[3*u+g]?S.push(m):(b.push(m),M[m]=y))}}}var R=S;S=b,b=R,S.length=0,y=-y}var P=c(_,M,h);return T?P.concat(l.boundary):P}},8902:function(e,t,r){var o=r(2478),a=r(3250)[3],i=0,n=1,s=2;e.exports=S;function c(M,_,w,p,u){this.a=M,this.b=_,this.idx=w,this.lowerIds=p,this.upperIds=u}function f(M,_,w,p){this.a=M,this.b=_,this.type=w,this.idx=p}function v(M,_){var w=M.a[0]-_.a[0]||M.a[1]-_.a[1]||M.type-_.type;return w||M.type!==i&&(w=a(M.a,M.b,_.b),w)?w:M.idx-_.idx}function h(M,_){return a(M.a,M.b,_)}function T(M,_,w,p,u){for(var g=o.lt(_,p,h),m=o.gt(_,p,h),R=g;R1&&a(w[z[B-2]],w[z[B-1]],p)>0;)M.push([z[B-1],z[B-2],u]),B-=1;z.length=B,z.push(u);for(var F=P.upperIds,B=F.length;B>1&&a(w[F[B-2]],w[F[B-1]],p)<0;)M.push([F[B-2],F[B-1],u]),B-=1;F.length=B,F.push(u)}}function l(M,_){var w;return M.a[0]<_.a[0]?w=a(M.a,M.b,_.a):w=a(_.b,_.a,M.a),w||(_.b[0]P[0]&&u.push(new f(P,R,s,g),new f(R,P,n,g))}u.sort(v);for(var z=u[0].a[0]-(1+Math.abs(u[0].a[0]))*Math.pow(2,-52),F=[new c([z,1],[z,0],-1,[],[])],B=[],g=0,O=u.length;g=0}}(),i.removeTriangle=function(c,f,v){var h=this.stars;n(h[c],f,v),n(h[f],v,c),n(h[v],c,f)},i.addTriangle=function(c,f,v){var h=this.stars;h[c].push(f,v),h[f].push(v,c),h[v].push(c,f)},i.opposite=function(c,f){for(var v=this.stars[f],h=1,T=v.length;h=0;--L){var J=B[L];N=J[0];var $=z[N],X=$[0],re=$[1],ee=P[X],q=P[re];if((ee[0]-q[0]||ee[1]-q[1])<0){var ae=X;X=re,re=ae}$[0]=X;var ie=$[1]=J[1],fe;for(O&&(fe=$[2]);L>0&&B[L-1][0]===N;){var J=B[--L],we=J[1];O?z.push([ie,we,fe]):z.push([ie,we]),ie=we}O?z.push([ie,re,fe]):z.push([ie,re])}return U}function _(P,z,F){for(var B=z.length,O=new o(B),L=[],N=0;Nz[2]?1:0)}function u(P,z,F){if(P.length!==0){if(z)for(var B=0;B0||N.length>0}function R(P,z,F){var B;if(F){B=z;for(var O=new Array(z.length),L=0;LM+1)throw new Error(b+" map requires nshades to be at least size "+y.length);Array.isArray(f.alpha)?f.alpha.length!==2?_=[1,1]:_=f.alpha.slice():typeof f.alpha=="number"?_=[f.alpha,f.alpha]:_=[1,1],v=y.map(function(R){return Math.round(R.index*M)}),_[0]=Math.min(Math.max(_[0],0),1),_[1]=Math.min(Math.max(_[1],0),1);var p=y.map(function(R,P){var z=y[P].index,F=y[P].rgb.slice();return F.length===4&&F[3]>=0&&F[3]<=1||(F[3]=_[0]+(_[1]-_[0])*z),F}),u=[];for(w=0;w=0}function f(v,h,T,l){var y=o(h,T,l);if(y===0){var b=a(o(v,h,T)),S=a(o(v,h,l));if(b===S){if(b===0){var M=c(v,h,T),_=c(v,h,l);return M===_?0:M?1:-1}return 0}else{if(S===0)return b>0||c(v,h,l)?-1:1;if(b===0)return S>0||c(v,h,T)?1:-1}return a(S-b)}var w=o(v,h,T);if(w>0)return y>0&&o(v,h,l)>0?1:-1;if(w<0)return y>0||o(v,h,l)>0?1:-1;var p=o(v,h,l);return p>0||c(v,h,T)?1:-1}},8572:function(e){e.exports=function(r){return r<0?-1:r>0?1:0}},8507:function(e){e.exports=o;var t=Math.min;function r(a,i){return a-i}function o(a,i){var n=a.length,s=a.length-i.length;if(s)return s;switch(n){case 0:return 0;case 1:return a[0]-i[0];case 2:return a[0]+a[1]-i[0]-i[1]||t(a[0],a[1])-t(i[0],i[1]);case 3:var c=a[0]+a[1],f=i[0]+i[1];if(s=c+a[2]-(f+i[2]),s)return s;var v=t(a[0],a[1]),h=t(i[0],i[1]);return t(v,a[2])-t(h,i[2])||t(v+a[2],c)-t(h+i[2],f);case 4:var T=a[0],l=a[1],y=a[2],b=a[3],S=i[0],M=i[1],_=i[2],w=i[3];return T+l+y+b-(S+M+_+w)||t(T,l,y,b)-t(S,M,_,w,S)||t(T+l,T+y,T+b,l+y,l+b,y+b)-t(S+M,S+_,S+w,M+_,M+w,_+w)||t(T+l+y,T+l+b,T+y+b,l+y+b)-t(S+M+_,S+M+w,S+_+w,M+_+w);default:for(var p=a.slice().sort(r),u=i.slice().sort(r),g=0;gr[a][0]&&(a=i);return oa?[[a],[o]]:[[o]]}},4750:function(e,t,r){e.exports=a;var o=r(3090);function a(i){var n=o(i),s=n.length;if(s<=2)return[];for(var c=new Array(s),f=n[s-1],v=0;v=f[S]&&(b+=1);l[y]=b}}return c}function s(c,f){try{return o(c,!0)}catch{var v=a(c);if(v.length<=f)return[];var h=i(c,v),T=o(h,!0);return n(T,v)}}},4769:function(e){function t(o,a,i,n,s,c){var f=6*s*s-6*s,v=3*s*s-4*s+1,h=-6*s*s+6*s,T=3*s*s-2*s;if(o.length){c||(c=new Array(o.length));for(var l=o.length-1;l>=0;--l)c[l]=f*o[l]+v*a[l]+h*i[l]+T*n[l];return c}return f*o+v*a+h*i[l]+T*n}function r(o,a,i,n,s,c){var f=s-1,v=s*s,h=f*f,T=(1+2*s)*h,l=s*h,y=v*(3-2*s),b=v*f;if(o.length){c||(c=new Array(o.length));for(var S=o.length-1;S>=0;--S)c[S]=T*o[S]+l*a[S]+y*i[S]+b*n[S];return c}return T*o+l*a+y*i+b*n}e.exports=r,e.exports.derivative=t},7642:function(e,t,r){var o=r(8954),a=r(1682);e.exports=c;function i(f,v){this.point=f,this.index=v}function n(f,v){for(var h=f.point,T=v.point,l=h.length,y=0;y=2)return!1;F[O]=L}return!0}):z=z.filter(function(F){for(var B=0;B<=T;++B){var O=g[F[B]];if(O<0)return!1;F[B]=O}return!0}),T&1)for(var b=0;b>>31},e.exports.exponent=function(i){var n=e.exports.hi(i);return(n<<1>>>21)-1023},e.exports.fraction=function(i){var n=e.exports.lo(i),s=e.exports.hi(i),c=s&(1<<20)-1;return s&2146435072&&(c+=1048576),[n,c]},e.exports.denormalized=function(i){var n=e.exports.hi(i);return!(n&2146435072)}},1338:function(e){function t(a,i,n){var s=a[n]|0;if(s<=0)return[];var c=new Array(s),f;if(n===a.length-1)for(f=0;f"u"&&(i=0),typeof a){case"number":if(a>0)return r(a|0,i);break;case"object":if(typeof a.length=="number")return t(a,i,0);break}return[]}e.exports=o},3134:function(e,t,r){e.exports=a;var o=r(1682);function a(i,n){var s=i.length;if(typeof n!="number"){n=0;for(var c=0;c=T-1)for(var w=b.length-1,u=v-h[T-1],p=0;p=T-1){var _=b.length-1;v-h[T-1];for(var w=0;w=0;--T)if(v[--h])return!1;return!0},s.jump=function(v){var h=this.lastT(),T=this.dimension;if(!(v0;--p)l.push(i(M[p-1],_[p-1],arguments[p])),y.push(0)}},s.push=function(v){var h=this.lastT(),T=this.dimension;if(!(v1e-6?1/S:0;this._time.push(v);for(var u=T;u>0;--u){var g=i(_[u-1],w[u-1],arguments[u]);l.push(g),y.push((g-l[b++])*p)}}},s.set=function(v){var h=this.dimension;if(!(v0;--M)T.push(i(b[M-1],S[M-1],arguments[M])),l.push(0)}},s.move=function(v){var h=this.lastT(),T=this.dimension;if(!(v<=h||arguments.length!==T+1)){var l=this._state,y=this._velocity,b=l.length-this.dimension,S=this.bounds,M=S[0],_=S[1],w=v-h,p=w>1e-6?1/w:0;this._time.push(v);for(var u=T;u>0;--u){var g=arguments[u];l.push(i(M[u-1],_[u-1],l[b++]+g)),y.push(g*p)}}},s.idle=function(v){var h=this.lastT();if(!(v=0;--p)l.push(i(M[p],_[p],l[b]+w*y[b])),y.push(0),b+=1}};function c(v){for(var h=new Array(v),T=0;T=0;--P){var u=g[P];m[P]<=0?g[P]=new o(u._color,u.key,u.value,g[P+1],u.right,u._count+1):g[P]=new o(u._color,u.key,u.value,u.left,g[P+1],u._count+1)}for(var P=g.length-1;P>1;--P){var z=g[P-1],u=g[P];if(z._color===r||u._color===r)break;var F=g[P-2];if(F.left===z)if(z.left===u){var B=F.right;if(B&&B._color===t)z._color=r,F.right=i(r,B),F._color=t,P-=1;else{if(F._color=t,F.left=z.right,z._color=r,z.right=F,g[P-2]=z,g[P-1]=u,n(F),n(z),P>=3){var O=g[P-3];O.left===F?O.left=z:O.right=z}break}}else{var B=F.right;if(B&&B._color===t)z._color=r,F.right=i(r,B),F._color=t,P-=1;else{if(z.right=u.left,F._color=t,F.left=u.right,u._color=r,u.left=z,u.right=F,g[P-2]=u,g[P-1]=z,n(F),n(z),n(u),P>=3){var O=g[P-3];O.left===F?O.left=u:O.right=u}break}}else if(z.right===u){var B=F.left;if(B&&B._color===t)z._color=r,F.left=i(r,B),F._color=t,P-=1;else{if(F._color=t,F.right=z.left,z._color=r,z.left=F,g[P-2]=z,g[P-1]=u,n(F),n(z),P>=3){var O=g[P-3];O.right===F?O.right=z:O.left=z}break}}else{var B=F.left;if(B&&B._color===t)z._color=r,F.left=i(r,B),F._color=t,P-=1;else{if(z.left=u.right,F._color=t,F.right=u.left,u._color=r,u.right=z,u.left=F,g[P-2]=u,g[P-1]=z,n(F),n(z),n(u),P>=3){var O=g[P-3];O.right===F?O.right=u:O.left=u}break}}}return g[0]._color=r,new s(p,g[0])};function f(_,w){if(w.left){var p=f(_,w.left);if(p)return p}var p=_(w.key,w.value);if(p)return p;if(w.right)return f(_,w.right)}function v(_,w,p,u){var g=w(_,u.key);if(g<=0){if(u.left){var m=v(_,w,p,u.left);if(m)return m}var m=p(u.key,u.value);if(m)return m}if(u.right)return v(_,w,p,u.right)}function h(_,w,p,u,g){var m=p(_,g.key),R=p(w,g.key),P;if(m<=0&&(g.left&&(P=h(_,w,p,u,g.left),P)||R>0&&(P=u(g.key,g.value),P)))return P;if(R>0&&g.right)return h(_,w,p,u,g.right)}c.forEach=function(w,p,u){if(this.root)switch(arguments.length){case 1:return f(w,this.root);case 2:return v(p,this._compare,w,this.root);case 3:return this._compare(p,u)>=0?void 0:h(p,u,this._compare,w,this.root)}},Object.defineProperty(c,"begin",{get:function(){for(var _=[],w=this.root;w;)_.push(w),w=w.left;return new T(this,_)}}),Object.defineProperty(c,"end",{get:function(){for(var _=[],w=this.root;w;)_.push(w),w=w.right;return new T(this,_)}}),c.at=function(_){if(_<0)return new T(this,[]);for(var w=this.root,p=[];;){if(p.push(w),w.left){if(_=w.right._count)break;w=w.right}else break}return new T(this,[])},c.ge=function(_){for(var w=this._compare,p=this.root,u=[],g=0;p;){var m=w(_,p.key);u.push(p),m<=0&&(g=u.length),m<=0?p=p.left:p=p.right}return u.length=g,new T(this,u)},c.gt=function(_){for(var w=this._compare,p=this.root,u=[],g=0;p;){var m=w(_,p.key);u.push(p),m<0&&(g=u.length),m<0?p=p.left:p=p.right}return u.length=g,new T(this,u)},c.lt=function(_){for(var w=this._compare,p=this.root,u=[],g=0;p;){var m=w(_,p.key);u.push(p),m>0&&(g=u.length),m<=0?p=p.left:p=p.right}return u.length=g,new T(this,u)},c.le=function(_){for(var w=this._compare,p=this.root,u=[],g=0;p;){var m=w(_,p.key);u.push(p),m>=0&&(g=u.length),m<0?p=p.left:p=p.right}return u.length=g,new T(this,u)},c.find=function(_){for(var w=this._compare,p=this.root,u=[];p;){var g=w(_,p.key);if(u.push(p),g===0)return new T(this,u);g<=0?p=p.left:p=p.right}return new T(this,[])},c.remove=function(_){var w=this.find(_);return w?w.remove():this},c.get=function(_){for(var w=this._compare,p=this.root;p;){var u=w(_,p.key);if(u===0)return p.value;u<=0?p=p.left:p=p.right}};function T(_,w){this.tree=_,this._stack=w}var l=T.prototype;Object.defineProperty(l,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(l,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),l.clone=function(){return new T(this.tree,this._stack.slice())};function y(_,w){_.key=w.key,_.value=w.value,_.left=w.left,_.right=w.right,_._color=w._color,_._count=w._count}function b(_){for(var w,p,u,g,m=_.length-1;m>=0;--m){if(w=_[m],m===0){w._color=r;return}if(p=_[m-1],p.left===w){if(u=p.right,u.right&&u.right._color===t){if(u=p.right=a(u),g=u.right=a(u.right),p.right=u.left,u.left=p,u.right=g,u._color=p._color,w._color=r,p._color=r,g._color=r,n(p),n(u),m>1){var R=_[m-2];R.left===p?R.left=u:R.right=u}_[m-1]=u;return}else if(u.left&&u.left._color===t){if(u=p.right=a(u),g=u.left=a(u.left),p.right=g.left,u.left=g.right,g.left=p,g.right=u,g._color=p._color,p._color=r,u._color=r,w._color=r,n(p),n(u),n(g),m>1){var R=_[m-2];R.left===p?R.left=g:R.right=g}_[m-1]=g;return}if(u._color===r)if(p._color===t){p._color=r,p.right=i(t,u);return}else{p.right=i(t,u);continue}else{if(u=a(u),p.right=u.left,u.left=p,u._color=p._color,p._color=t,n(p),n(u),m>1){var R=_[m-2];R.left===p?R.left=u:R.right=u}_[m-1]=u,_[m]=p,m+1<_.length?_[m+1]=w:_.push(w),m=m+2}}else{if(u=p.left,u.left&&u.left._color===t){if(u=p.left=a(u),g=u.left=a(u.left),p.left=u.right,u.right=p,u.left=g,u._color=p._color,w._color=r,p._color=r,g._color=r,n(p),n(u),m>1){var R=_[m-2];R.right===p?R.right=u:R.left=u}_[m-1]=u;return}else if(u.right&&u.right._color===t){if(u=p.left=a(u),g=u.right=a(u.right),p.left=g.right,u.right=g.left,g.right=p,g.left=u,g._color=p._color,p._color=r,u._color=r,w._color=r,n(p),n(u),n(g),m>1){var R=_[m-2];R.right===p?R.right=g:R.left=g}_[m-1]=g;return}if(u._color===r)if(p._color===t){p._color=r,p.left=i(t,u);return}else{p.left=i(t,u);continue}else{if(u=a(u),p.left=u.right,u.right=p,u._color=p._color,p._color=t,n(p),n(u),m>1){var R=_[m-2];R.right===p?R.right=u:R.left=u}_[m-1]=u,_[m]=p,m+1<_.length?_[m+1]=w:_.push(w),m=m+2}}}}l.remove=function(){var _=this._stack;if(_.length===0)return this.tree;var w=new Array(_.length),p=_[_.length-1];w[w.length-1]=new o(p._color,p.key,p.value,p.left,p.right,p._count);for(var u=_.length-2;u>=0;--u){var p=_[u];p.left===_[u+1]?w[u]=new o(p._color,p.key,p.value,w[u+1],p.right,p._count):w[u]=new o(p._color,p.key,p.value,p.left,w[u+1],p._count)}if(p=w[w.length-1],p.left&&p.right){var g=w.length;for(p=p.left;p.right;)w.push(p),p=p.right;var m=w[g-1];w.push(new o(p._color,m.key,m.value,p.left,p.right,p._count)),w[g-1].key=p.key,w[g-1].value=p.value;for(var u=w.length-2;u>=g;--u)p=w[u],w[u]=new o(p._color,p.key,p.value,p.left,w[u+1],p._count);w[g-1].left=w[g]}if(p=w[w.length-1],p._color===t){var R=w[w.length-2];R.left===p?R.left=null:R.right===p&&(R.right=null),w.pop();for(var u=0;u0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(l,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(l,"index",{get:function(){var _=0,w=this._stack;if(w.length===0){var p=this.tree.root;return p?p._count:0}else w[w.length-1].left&&(_=w[w.length-1].left._count);for(var u=w.length-2;u>=0;--u)w[u+1]===w[u].right&&(++_,w[u].left&&(_+=w[u].left._count));return _},enumerable:!0}),l.next=function(){var _=this._stack;if(_.length!==0){var w=_[_.length-1];if(w.right)for(w=w.right;w;)_.push(w),w=w.left;else for(_.pop();_.length>0&&_[_.length-1].right===w;)w=_[_.length-1],_.pop()}},Object.defineProperty(l,"hasNext",{get:function(){var _=this._stack;if(_.length===0)return!1;if(_[_.length-1].right)return!0;for(var w=_.length-1;w>0;--w)if(_[w-1].left===_[w])return!0;return!1}}),l.update=function(_){var w=this._stack;if(w.length===0)throw new Error("Can't update empty node!");var p=new Array(w.length),u=w[w.length-1];p[p.length-1]=new o(u._color,u.key,_,u.left,u.right,u._count);for(var g=w.length-2;g>=0;--g)u=w[g],u.left===w[g+1]?p[g]=new o(u._color,u.key,u.value,p[g+1],u.right,u._count):p[g]=new o(u._color,u.key,u.value,u.left,p[g+1],u._count);return new s(this.tree._compare,p[0])},l.prev=function(){var _=this._stack;if(_.length!==0){var w=_[_.length-1];if(w.left)for(w=w.left;w;)_.push(w),w=w.right;else for(_.pop();_.length>0&&_[_.length-1].left===w;)w=_[_.length-1],_.pop()}},Object.defineProperty(l,"hasPrev",{get:function(){var _=this._stack;if(_.length===0)return!1;if(_[_.length-1].left)return!0;for(var w=_.length-1;w>0;--w)if(_[w-1].right===_[w])return!0;return!1}});function S(_,w){return _w?1:0}function M(_){return new s(_||S,null)}},3837:function(e,t,r){e.exports=P;var o=r(4935),a=r(501),i=r(5304),n=r(6429),s=r(6444),c=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),f=ArrayBuffer,v=DataView;function h(z){return f.isView(z)&&!(z instanceof v)}function T(z){return Array.isArray(z)||h(z)}function l(z,F){return z[0]=F[0],z[1]=F[1],z[2]=F[2],z}function y(z){this.gl=z,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=i(z)}var b=y.prototype;b.update=function(z){z=z||{};function F(X,re,ee){if(ee in z){var q=z[ee],ae=this[ee],ie;(X?T(q)&&T(q[0]):T(q))?this[ee]=ie=[re(q[0]),re(q[1]),re(q[2])]:this[ee]=ie=[re(q),re(q),re(q)];for(var fe=0;fe<3;++fe)if(ie[fe]!==ae[fe])return!0}return!1}var B=F.bind(this,!1,Number),O=F.bind(this,!1,Boolean),L=F.bind(this,!1,String),N=F.bind(this,!0,function(X){if(T(X)){if(X.length===3)return[+X[0],+X[1],+X[2],1];if(X.length===4)return[+X[0],+X[1],+X[2],+X[3]]}return[0,0,0,1]}),U,Z=!1,Q=!1;if("bounds"in z)for(var ue=z.bounds,oe=0;oe<2;++oe)for(var le=0;le<3;++le)ue[oe][le]!==this.bounds[oe][le]&&(Q=!0),this.bounds[oe][le]=ue[oe][le];if("ticks"in z){U=z.ticks,Z=!0,this.autoTicks=!1;for(var oe=0;oe<3;++oe)this.tickSpacing[oe]=0}else B("tickSpacing")&&(this.autoTicks=!0,Q=!0);if(this._firstInit&&("ticks"in z||"tickSpacing"in z||(this.autoTicks=!0),Q=!0,Z=!0,this._firstInit=!1),Q&&this.autoTicks&&(U=s.create(this.bounds,this.tickSpacing),Z=!0),Z){for(var oe=0;oe<3;++oe)U[oe].sort(function(re,ee){return re.x-ee.x});s.equal(U,this.ticks)?Z=!1:this.ticks=U}O("tickEnable"),L("tickFont")&&(Z=!0),L("tickFontStyle")&&(Z=!0),L("tickFontWeight")&&(Z=!0),L("tickFontVariant")&&(Z=!0),B("tickSize"),B("tickAngle"),B("tickPad"),N("tickColor");var j=L("labels");L("labelFont")&&(j=!0),L("labelFontStyle")&&(j=!0),L("labelFontWeight")&&(j=!0),L("labelFontVariant")&&(j=!0),O("labelEnable"),B("labelSize"),B("labelPad"),N("labelColor"),O("lineEnable"),O("lineMirror"),B("lineWidth"),N("lineColor"),O("lineTickEnable"),O("lineTickMirror"),B("lineTickLength"),B("lineTickWidth"),N("lineTickColor"),O("gridEnable"),B("gridWidth"),N("gridColor"),O("zeroEnable"),N("zeroLineColor"),B("zeroLineWidth"),O("backgroundEnable"),N("backgroundColor");var J=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],$=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(j||Z)&&this._text.update(this.bounds,this.labels,J,this.ticks,$):this._text=o(this.gl,this.bounds,this.labels,J,this.ticks,$),this._lines&&Z&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=a(this.gl,this.bounds,this.ticks))};function S(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}var M=[new S,new S,new S];function _(z,F,B,O,L){for(var N=z.primalOffset,U=z.primalMinor,Z=z.mirrorOffset,Q=z.mirrorMinor,ue=O[F],oe=0;oe<3;++oe)if(F!==oe){var le=N,j=Z,J=U,$=Q;ue&1<0?(J[oe]=-1,$[oe]=0):(J[oe]=0,$[oe]=1)}}var w=[0,0,0],p={model:c,view:c,projection:c,_ortho:!1};b.isOpaque=function(){return!0},b.isTransparent=function(){return!1},b.drawTransparent=function(z){};var u=0,g=[0,0,0],m=[0,0,0],R=[0,0,0];b.draw=function(z){z=z||p;for(var ee=this.gl,F=z.model||c,B=z.view||c,O=z.projection||c,L=this.bounds,N=z._ortho||!1,U=n(F,B,O,L,N),Z=U.cubeEdges,Q=U.axis,ue=B[12],oe=B[13],le=B[14],j=B[15],J=N?2:1,$=J*this.pixelRatio*(O[3]*ue+O[7]*oe+O[11]*le+O[15]*j)/ee.drawingBufferHeight,X=0;X<3;++X)this.lastCubeProps.cubeEdges[X]=Z[X],this.lastCubeProps.axis[X]=Q[X];for(var re=M,X=0;X<3;++X)_(M[X],X,this.bounds,Z,Q);for(var ee=this.gl,q=w,X=0;X<3;++X)this.backgroundEnable[X]?q[X]=Q[X]:q[X]=0;this._background.draw(F,B,O,L,q,this.backgroundColor),this._lines.bind(F,B,O,this);for(var X=0;X<3;++X){var ae=[0,0,0];Q[X]>0?ae[X]=L[1][X]:ae[X]=L[0][X];for(var ie=0;ie<2;++ie){var fe=(X+1+ie)%3,we=(X+1+(ie^1))%3;this.gridEnable[fe]&&this._lines.drawGrid(fe,we,this.bounds,ae,this.gridColor[fe],this.gridWidth[fe]*this.pixelRatio)}for(var ie=0;ie<2;++ie){var fe=(X+1+ie)%3,we=(X+1+(ie^1))%3;this.zeroEnable[we]&&Math.min(L[0][we],L[1][we])<=0&&Math.max(L[0][we],L[1][we])>=0&&this._lines.drawZero(fe,we,this.bounds,ae,this.zeroLineColor[we],this.zeroLineWidth[we]*this.pixelRatio)}}for(var X=0;X<3;++X){this.lineEnable[X]&&this._lines.drawAxisLine(X,this.bounds,re[X].primalOffset,this.lineColor[X],this.lineWidth[X]*this.pixelRatio),this.lineMirror[X]&&this._lines.drawAxisLine(X,this.bounds,re[X].mirrorOffset,this.lineColor[X],this.lineWidth[X]*this.pixelRatio);for(var Ae=l(g,re[X].primalMinor),Fe=l(m,re[X].mirrorMinor),Ce=this.lineTickLength,ie=0;ie<3;++ie){var qe=$/F[5*ie];Ae[ie]*=Ce[ie]*qe,Fe[ie]*=Ce[ie]*qe}this.lineTickEnable[X]&&this._lines.drawAxisTicks(X,re[X].primalOffset,Ae,this.lineTickColor[X],this.lineTickWidth[X]*this.pixelRatio),this.lineTickMirror[X]&&this._lines.drawAxisTicks(X,re[X].mirrorOffset,Fe,this.lineTickColor[X],this.lineTickWidth[X]*this.pixelRatio)}this._lines.unbind(),this._text.bind(F,B,O,this.pixelRatio);var et,Qe=.5,Ke,Xe;function Me(Je){Xe=[0,0,0],Xe[Je]=1}function xe(Je,At,St){var Rt=(Je+1)%3,Ut=(Je+2)%3,ir=At[Rt],ar=At[Ut],Mr=St[Rt],fr=St[Ut];if(ir>0&&fr>0){Me(Rt);return}else if(ir>0&&fr<0){Me(Rt);return}else if(ir<0&&fr>0){Me(Rt);return}else if(ir<0&&fr<0){Me(Rt);return}else if(ar>0&&Mr>0){Me(Ut);return}else if(ar>0&&Mr<0){Me(Ut);return}else if(ar<0&&Mr>0){Me(Ut);return}else if(ar<0&&Mr<0){Me(Ut);return}}for(var X=0;X<3;++X){for(var ce=re[X].primalMinor,Re=re[X].mirrorMinor,$e=l(R,re[X].primalOffset),ie=0;ie<3;++ie)this.lineTickEnable[X]&&($e[ie]+=$*ce[ie]*Math.max(this.lineTickLength[ie],0)/F[5*ie]);var rt=[0,0,0];if(rt[X]=1,this.tickEnable[X]){this.tickAngle[X]===-3600?(this.tickAngle[X]=0,this.tickAlign[X]="auto"):this.tickAlign[X]=-1,Ke=1,et=[this.tickAlign[X],Qe,Ke],et[0]==="auto"?et[0]=u:et[0]=parseInt(""+et[0]),Xe=[0,0,0],xe(X,ce,Re);for(var ie=0;ie<3;++ie)$e[ie]+=$*ce[ie]*this.tickPad[ie]/F[5*ie];this._text.drawTicks(X,this.tickSize[X],this.tickAngle[X],$e,this.tickColor[X],rt,Xe,et)}if(this.labelEnable[X]){Ke=0,Xe=[0,0,0],this.labels[X].length>4&&(Me(X),Ke=1),et=[this.labelAlign[X],Qe,Ke],et[0]==="auto"?et[0]=u:et[0]=parseInt(""+et[0]);for(var ie=0;ie<3;++ie)$e[ie]+=$*ce[ie]*this.labelPad[ie]/F[5*ie];$e[X]+=.5*(L[0][X]+L[1][X]),this._text.drawLabel(X,this.labelSize[X],this.labelAngle[X],$e,this.labelColor[X],[0,0,0],Xe,et)}}this._text.unbind()},b.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null};function P(z,F){var B=new y(z);return B.update(F),B}},5304:function(e,t,r){e.exports=c;var o=r(2762),a=r(8116),i=r(1879).bg;function n(f,v,h,T){this.gl=f,this.buffer=v,this.vao=h,this.shader=T}var s=n.prototype;s.draw=function(f,v,h,T,l,y){for(var b=!1,S=0;S<3;++S)b=b||l[S];if(b){var M=this.gl;M.enable(M.POLYGON_OFFSET_FILL),M.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:f,view:v,projection:h,bounds:T,enable:l,colors:y},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),M.disable(M.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()};function c(f){for(var v=[],h=[],T=0,l=0;l<3;++l)for(var y=(l+1)%3,b=(l+2)%3,S=[0,0,0],M=[0,0,0],_=-1;_<=1;_+=2){h.push(T,T+2,T+1,T+1,T+2,T+3),S[l]=_,M[l]=_;for(var w=-1;w<=1;w+=2){S[y]=w;for(var p=-1;p<=1;p+=2)S[b]=p,v.push(S[0],S[1],S[2],M[0],M[1],M[2]),T+=1}var u=y;y=b,b=u}var g=o(f,new Float32Array(v)),m=o(f,new Uint16Array(h),f.ELEMENT_ARRAY_BUFFER),R=a(f,[{buffer:g,type:f.FLOAT,size:3,offset:0,stride:24},{buffer:g,type:f.FLOAT,size:3,offset:12,stride:24}],m),P=i(f);return P.attributes.position.location=0,P.attributes.normal.location=1,new n(f,g,R,P)}},6429:function(e,t,r){e.exports=_;var o=r(8828),a=r(6760),i=r(5202),n=r(3250),s=new Array(16),c=new Array(8),f=new Array(8),v=new Array(3),h=[0,0,0];(function(){for(var w=0;w<8;++w)c[w]=[1,1,1,1],f[w]=[1,1,1]})();function T(w,p,u){for(var g=0;g<4;++g){w[g]=u[12+g];for(var m=0;m<3;++m)w[g]+=p[m]*u[4*m+g]}}var l=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]];function y(w){for(var p=0;pQ&&(B|=1<Q){B|=1<f[P][1])&&(re=P);for(var ee=-1,P=0;P<3;++P){var q=re^1<f[ae][0]&&(ae=q)}}var ie=b;ie[0]=ie[1]=ie[2]=0,ie[o.log2(ee^re)]=re&ee,ie[o.log2(re^ae)]=re&ae;var fe=ae^7;fe===B||fe===X?(fe=ee^7,ie[o.log2(ae^fe)]=fe&ae):ie[o.log2(ee^fe)]=feⅇfor(var we=S,Ae=B,N=0;N<3;++N)Ae&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); +} +`]),c=o([`precision highp float; +#define GLSLIFY 1 + +uniform vec4 color; +void main() { + gl_FragColor = color; +}`]);t.Q=function(h){return a(h,s,c,null,[{name:"position",type:"vec3"}])};var f=o([`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); +} +`]),v=o([`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]; +}`]);t.bg=function(h){return a(h,f,v,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(e,t,r){e.exports=y;var o=r(2762),a=r(8116),i=r(4359),n=r(1879).Q,s=window||process.global||{},c=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};var f=3;function v(b,S,M,_){this.gl=b,this.shader=S,this.buffer=M,this.vao=_,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var h=v.prototype,T=[0,0];h.bind=function(b,S,M,_){this.vao.bind(),this.shader.bind();var w=this.shader.uniforms;w.model=b,w.view=S,w.projection=M,w.pixelScale=_,T[0]=this.gl.drawingBufferWidth,T[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=T},h.unbind=function(){this.vao.unbind()},h.update=function(b,S,M,_,w){var p=[];function u(N,U,Z,Q,ue,oe){var le=[Z.style,Z.weight,Z.variant,Z.family].join("_"),j=c[le];j||(j=c[le]={});var J=j[U];J||(J=j[U]=l(U,{triangles:!0,font:Z.family,fontStyle:Z.style,fontWeight:Z.weight,fontVariant:Z.variant,textAlign:"center",textBaseline:"middle",lineSpacing:ue,styletags:oe}));for(var $=(Q||12)/12,X=J.positions,re=J.cells,ee=0,q=re.length;ee=0;--ie){var fe=X[ae[ie]];p.push($*fe[0],-$*fe[1],N)}}for(var g=[0,0,0],m=[0,0,0],R=[0,0,0],P=[0,0,0],z=1.25,F={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},B=0;B<3;++B){R[B]=p.length/f|0,u(.5*(b[0][B]+b[1][B]),S[B],M[B],12,z,F),P[B]=(p.length/f|0)-R[B],g[B]=p.length/f|0;for(var O=0;O<_[B].length;++O)if(_[B][O].text){var L={family:_[B][O].font||w[B].family,style:w[B].fontStyle||w[B].style,weight:w[B].fontWeight||w[B].weight,variant:w[B].fontVariant||w[B].variant};u(_[B][O].x,_[B][O].text,L,_[B][O].fontSize||12,z,F)}m[B]=(p.length/f|0)-g[B]}this.buffer.update(p),this.tickOffset=g,this.tickCount=m,this.labelOffset=R,this.labelCount=P},h.drawTicks=function(b,S,M,_,w,p,u,g){this.tickCount[b]&&(this.shader.uniforms.axis=p,this.shader.uniforms.color=w,this.shader.uniforms.angle=M,this.shader.uniforms.scale=S,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=g,this.vao.draw(this.gl.TRIANGLES,this.tickCount[b],this.tickOffset[b]))},h.drawLabel=function(b,S,M,_,w,p,u,g){this.labelCount[b]&&(this.shader.uniforms.axis=p,this.shader.uniforms.color=w,this.shader.uniforms.angle=M,this.shader.uniforms.scale=S,this.shader.uniforms.offset=_,this.shader.uniforms.alignDir=u,this.shader.uniforms.alignOpt=g,this.vao.draw(this.gl.TRIANGLES,this.labelCount[b],this.labelOffset[b]))},h.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()};function l(b,S){try{return i(b,S)}catch(M){return console.warn('error vectorizing text:"'+b+'" error:',M),{cells:[],positions:[]}}}function y(b,S,M,_,w,p){var u=o(b),g=a(b,[{buffer:u,size:3}]),m=n(b);m.attributes.position.location=0;var R=new v(b,m,u,g);return R.update(S,M,_,w,p),R}},6444:function(e,t){t.create=o,t.equal=a;function r(i,n){var s=i+"",c=s.indexOf("."),f=0;c>=0&&(f=s.length-c-1);var v=Math.pow(10,f),h=Math.round(i*n*v),T=h+"";if(T.indexOf("e")>=0)return T;var l=h/v,y=h%v;h<0?(l=-Math.ceil(l)|0,y=-y|0):(l=Math.floor(l)|0,y=y|0);var b=""+l;if(h<0&&(b="-"+b),f){for(var S=""+y;S.length=i[0][c];--v)f.push({x:v*n[c],text:r(n[c],v)});s.push(f)}return s}function a(i,n){for(var s=0;s<3;++s){if(i[s].length!==n[s].length)return!1;for(var c=0;cb)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return l.bufferSubData(y,_,M),b}function v(l,y){for(var b=o.malloc(l.length,y),S=l.length,M=0;M=0;--S){if(y[S]!==b)return!1;b*=l[S]}return!0}c.update=function(l,y){if(typeof y!="number"&&(y=-1),this.bind(),typeof l=="object"&&typeof l.shape<"u"){var b=l.dtype;if(n.indexOf(b)<0&&(b="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){var S=gl.getExtension("OES_element_index_uint");S&&b!=="uint16"?b="uint32":b="uint16"}if(b===l.dtype&&h(l.shape,l.stride))l.offset===0&&l.data.length===l.shape[0]?this.length=f(this.gl,this.type,this.length,this.usage,l.data,y):this.length=f(this.gl,this.type,this.length,this.usage,l.data.subarray(l.offset,l.shape[0]),y);else{var M=o.malloc(l.size,b),_=i(M,l.shape);a.assign(_,l),y<0?this.length=f(this.gl,this.type,this.length,this.usage,M,y):this.length=f(this.gl,this.type,this.length,this.usage,M.subarray(0,l.size),y),o.free(M)}}else if(Array.isArray(l)){var w;this.type===this.gl.ELEMENT_ARRAY_BUFFER?w=v(l,"uint16"):w=v(l,"float32"),y<0?this.length=f(this.gl,this.type,this.length,this.usage,w,y):this.length=f(this.gl,this.type,this.length,this.usage,w.subarray(0,l.length),y),o.free(w)}else if(typeof l=="object"&&typeof l.length=="number")this.length=f(this.gl,this.type,this.length,this.usage,l,y);else if(typeof l=="number"||l===void 0){if(y>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");l=l|0,l<=0&&(l=1),this.gl.bufferData(this.type,l|0,this.usage),this.length=l}else throw new Error("gl-buffer: Invalid data type")};function T(l,y,b,S){if(b=b||l.ARRAY_BUFFER,S=S||l.DYNAMIC_DRAW,b!==l.ARRAY_BUFFER&&b!==l.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(S!==l.DYNAMIC_DRAW&&S!==l.STATIC_DRAW&&S!==l.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 M=l.createBuffer(),_=new s(l,b,M,0,S);return _.update(y),_}e.exports=T},6405:function(e,t,r){var o=r(2931);e.exports=function(i,n){var s=i.positions,c=i.vectors,f={positions:[],vertexIntensity:[],vertexIntensityBounds:i.vertexIntensityBounds,vectors:[],cells:[],coneOffset:i.coneOffset,colormap:i.colormap};if(i.positions.length===0)return n&&(n[0]=[0,0,0],n[1]=[0,0,0]),f;for(var v=0,h=1/0,T=-1/0,l=1/0,y=-1/0,b=1/0,S=-1/0,M=null,_=null,w=[],p=1/0,u=!1,g=i.coneSizemode==="raw",m=0;mv&&(v=o.length(P)),m&&!g){var z=2*o.distance(M,R)/(o.length(_)+o.length(P));z?(p=Math.min(p,z),u=!1):u=!0}u||(M=R,_=P),w.push(P)}var F=[h,l,b],B=[T,y,S];n&&(n[0]=F,n[1]=B),v===0&&(v=1);var O=1/v;isFinite(p)||(p=1),f.vectorScale=p;var L=i.coneSize||(g?1:.5);i.absoluteConeSize&&(L=i.absoluteConeSize*O),f.coneScale=L;for(var m=0,N=0;m=1},l.isTransparent=function(){return this.opacity<1},l.pickSlots=1,l.setPickBase=function(w){this.pickId=w};function y(w){for(var p=v({colormap:w,nshades:256,format:"rgba"}),u=new Uint8Array(256*4),g=0;g<256;++g){for(var m=p[g],R=0;R<3;++R)u[4*g+R]=m[R];u[4*g+3]=m[3]*255}return f(u,[256,256,4],[4,0,1])}function b(w){for(var p=w.length,u=new Array(p),g=0;g0){var N=this.triShader;N.bind(),N.uniforms=z,this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}},l.drawPick=function(w){w=w||{};for(var p=this.gl,u=w.model||h,g=w.view||h,m=w.projection||h,R=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],P=0;P<3;++P)R[0][P]=Math.max(R[0][P],this.clipBounds[0][P]),R[1][P]=Math.min(R[1][P],this.clipBounds[1][P]);this._model=[].slice.call(u),this._view=[].slice.call(g),this._projection=[].slice.call(m),this._resolution=[p.drawingBufferWidth,p.drawingBufferHeight];var z={model:u,view:g,projection:m,clipBounds:R,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},F=this.pickShader;F.bind(),F.uniforms=z,this.triangleCount>0&&(this.triangleVAO.bind(),p.drawArrays(p.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind())},l.pick=function(w){if(!w||w.id!==this.pickId)return null;var p=w.value[0]+256*w.value[1]+65536*w.value[2],u=this.cells[p],g=this.positions[u[1]].slice(0,3),m={position:g,dataCoordinate:g,index:Math.floor(u[1]/48)};return this.traceType==="cone"?m.index=Math.floor(u[1]/48):this.traceType==="streamtube"&&(m.intensity=this.intensity[u[1]],m.velocity=this.vectors[u[1]].slice(0,3),m.divergence=this.vectors[u[1]][3],m.index=p),m},l.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()};function S(w,p){var u=o(w,p.meshShader.vertex,p.meshShader.fragment,null,p.meshShader.attributes);return u.attributes.position.location=0,u.attributes.color.location=2,u.attributes.uv.location=3,u.attributes.vector.location=4,u}function M(w,p){var u=o(w,p.pickShader.vertex,p.pickShader.fragment,null,p.pickShader.attributes);return u.attributes.position.location=0,u.attributes.id.location=1,u.attributes.vector.location=4,u}function _(w,p,u){var g=u.shaders;arguments.length===1&&(p=w,w=p.gl);var m=S(w,g),R=M(w,g),P=n(w,f(new Uint8Array([255,255,255,255]),[1,1,4]));P.generateMipmap(),P.minFilter=w.LINEAR_MIPMAP_LINEAR,P.magFilter=w.LINEAR;var z=a(w),F=a(w),B=a(w),O=a(w),L=a(w),N=i(w,[{buffer:z,type:w.FLOAT,size:4},{buffer:L,type:w.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:B,type:w.FLOAT,size:4},{buffer:O,type:w.FLOAT,size:2},{buffer:F,type:w.FLOAT,size:4}]),U=new T(w,P,m,R,z,F,L,B,O,N,u.traceType||"cone");return U.update(p),U}e.exports=_},614:function(e,t,r){var o=r(3236),a=o([`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; +} +`]),i=o([`#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; +} +`]),n=o([`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; +} +`]),s=o([`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); +}`]);t.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:n,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(e){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171:function(e,t,r){var o=r(737);e.exports=function(i){return o[i]}},9165:function(e,t,r){e.exports=T;var o=r(2762),a=r(8116),i=r(3436),n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(l,y,b,S){this.gl=l,this.shader=S,this.buffer=y,this.vao=b,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 c=s.prototype;c.isOpaque=function(){return!this.hasAlpha},c.isTransparent=function(){return this.hasAlpha},c.drawTransparent=c.draw=function(l){var y=this.gl,b=this.shader.uniforms;this.shader.bind();var S=b.view=l.view||n,M=b.projection=l.projection||n;b.model=l.model||n,b.clipBounds=this.clipBounds,b.opacity=this.opacity;var _=S[12],w=S[13],p=S[14],u=S[15],g=l._ortho||!1,m=g?2:1,R=m*this.pixelRatio*(M[3]*_+M[7]*w+M[11]*p+M[15]*u)/y.drawingBufferHeight;this.vao.bind();for(var P=0;P<3;++P)y.lineWidth(this.lineWidth[P]*this.pixelRatio),b.capSize=this.capSize[P]*R,this.lineCount[P]&&y.drawArrays(y.LINES,this.lineOffset[P],this.lineCount[P]);this.vao.unbind()};function f(l,y){for(var b=0;b<3;++b)l[0][b]=Math.min(l[0][b],y[b]),l[1][b]=Math.max(l[1][b],y[b])}var v=function(){for(var l=new Array(3),y=0;y<3;++y){for(var b=[],S=1;S<=2;++S)for(var M=-1;M<=1;M+=2){var _=(S+y)%3,w=[0,0,0];w[_]=M,b.push(w)}l[y]=b}return l}();function h(l,y,b,S){for(var M=v[S],_=0;_0){var z=g.slice();z[p]+=R[1][p],M.push(g[0],g[1],g[2],P[0],P[1],P[2],P[3],0,0,0,z[0],z[1],z[2],P[0],P[1],P[2],P[3],0,0,0),f(this.bounds,z),w+=2+h(M,z,P,p)}}}this.lineCount[p]=w-this.lineOffset[p]}this.buffer.update(M)}},c.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()};function T(l){var y=l.gl,b=o(y),S=a(y,[{buffer:b,type:y.FLOAT,size:3,offset:0,stride:40},{buffer:b,type:y.FLOAT,size:4,offset:12,stride:40},{buffer:b,type:y.FLOAT,size:3,offset:28,stride:40}]),M=i(y);M.attributes.position.location=0,M.attributes.color.location=1,M.attributes.offset.location=2;var _=new s(y,b,S,M);return _.update(l),_}},3436:function(e,t,r){var o=r(3236),a=r(9405),i=o([`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; +}`]),n=o([`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; +}`]);e.exports=function(s){return a(s,i,n,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(e,t,r){var o=r(7766);e.exports=w;var a=null,i,n,s,c;function f(p){var u=p.getParameter(p.FRAMEBUFFER_BINDING),g=p.getParameter(p.RENDERBUFFER_BINDING),m=p.getParameter(p.TEXTURE_BINDING_2D);return[u,g,m]}function v(p,u){p.bindFramebuffer(p.FRAMEBUFFER,u[0]),p.bindRenderbuffer(p.RENDERBUFFER,u[1]),p.bindTexture(p.TEXTURE_2D,u[2])}function h(p,u){var g=p.getParameter(u.MAX_COLOR_ATTACHMENTS_WEBGL);a=new Array(g+1);for(var m=0;m<=g;++m){for(var R=new Array(g),P=0;P1&&F.drawBuffersWEBGL(a[z]);var U=g.getExtension("WEBGL_depth_texture");U?B?p.depth=l(g,R,P,U.UNSIGNED_INT_24_8_WEBGL,g.DEPTH_STENCIL,g.DEPTH_STENCIL_ATTACHMENT):O&&(p.depth=l(g,R,P,g.UNSIGNED_SHORT,g.DEPTH_COMPONENT,g.DEPTH_ATTACHMENT)):O&&B?p._depth_rb=y(g,R,P,g.DEPTH_STENCIL,g.DEPTH_STENCIL_ATTACHMENT):O?p._depth_rb=y(g,R,P,g.DEPTH_COMPONENT16,g.DEPTH_ATTACHMENT):B&&(p._depth_rb=y(g,R,P,g.STENCIL_INDEX,g.STENCIL_ATTACHMENT));var Z=g.checkFramebufferStatus(g.FRAMEBUFFER);if(Z!==g.FRAMEBUFFER_COMPLETE){p._destroyed=!0,g.bindFramebuffer(g.FRAMEBUFFER,null),g.deleteFramebuffer(p.handle),p.handle=null,p.depth&&(p.depth.dispose(),p.depth=null),p._depth_rb&&(g.deleteRenderbuffer(p._depth_rb),p._depth_rb=null);for(var N=0;NR||g<0||g>R)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");p._shape[0]=u,p._shape[1]=g;for(var P=f(m),z=0;zP||g<0||g>P)throw new Error("gl-fbo: Parameters are too large for FBO");m=m||{};var z=1;if("color"in m){if(z=Math.max(m.color|0,0),z<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(z>1)if(R){if(z>p.getParameter(R.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+z+" draw buffers")}else throw new Error("gl-fbo: Multiple draw buffer extension not supported")}var F=p.UNSIGNED_BYTE,B=p.getExtension("OES_texture_float");if(m.float&&z>0){if(!B)throw new Error("gl-fbo: Context does not support floating point textures");F=p.FLOAT}else m.preferFloat&&z>0&&B&&(F=p.FLOAT);var O=!0;"depth"in m&&(O=!!m.depth);var L=!1;return"stencil"in m&&(L=!!m.stencil),new S(p,u,g,F,z,O,L,R)}},2992:function(e,t,r){var o=r(3387).sprintf,a=r(5171),i=r(1848),n=r(1085);e.exports=s;function s(c,f,v){var h=i(f)||"of unknown name (see npm glsl-shader-name)",T="unknown type";v!==void 0&&(T=v===a.FRAGMENT_SHADER?"fragment":"vertex");for(var l=o(`Error compiling %s shader %s: +`,T,h),y=o("%s%s",l,c),b=c.split(` +`),S={},M=0;M 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; +} +`]),s=o([`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); +}`]),c=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(f){return a(f,i,n,null,c)},t.createPickShader=function(f){return a(f,i,s,null,c)}},5714:function(e,t,r){e.exports=p;var o=r(2762),a=r(8116),i=r(7766),n=new Uint8Array(4),s=new Float32Array(n.buffer);function c(u,g,m,R){return n[0]=R,n[1]=m,n[2]=g,n[3]=u,s[0]}var f=r(2478),v=r(9618),h=r(7319),T=h.createShader,l=h.createPickShader,y=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function b(u,g){for(var m=0,R=0;R<3;++R){var P=u[R]-g[R];m+=P*P}return Math.sqrt(m)}function S(u){for(var g=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],m=0;m<3;++m)g[0][m]=Math.max(u[0][m],g[0][m]),g[1][m]=Math.min(u[1][m],g[1][m]);return g}function M(u,g,m,R){this.arcLength=u,this.position=g,this.index=m,this.dataCoordinate=R}function _(u,g,m,R,P,z){this.gl=u,this.shader=g,this.pickShader=m,this.buffer=R,this.vao=P,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=z,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var w=_.prototype;w.isTransparent=function(){return this.hasAlpha},w.isOpaque=function(){return!this.hasAlpha},w.pickSlots=1,w.setPickBase=function(u){this.pickId=u},w.drawTransparent=w.draw=function(u){if(this.vertexCount){var g=this.gl,m=this.shader,R=this.vao;m.bind(),m.uniforms={model:u.model||y,view:u.view||y,projection:u.projection||y,clipBounds:S(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[g.drawingBufferWidth,g.drawingBufferHeight],pixelRatio:this.pixelRatio},R.bind(),R.draw(g.TRIANGLE_STRIP,this.vertexCount),R.unbind()}},w.drawPick=function(u){if(this.vertexCount){var g=this.gl,m=this.pickShader,R=this.vao;m.bind(),m.uniforms={model:u.model||y,view:u.view||y,projection:u.projection||y,pickId:this.pickId,clipBounds:S(this.clipBounds),screenShape:[g.drawingBufferWidth,g.drawingBufferHeight],pixelRatio:this.pixelRatio},R.bind(),R.draw(g.TRIANGLE_STRIP,this.vertexCount),R.unbind()}},w.update=function(u){var g,m;this.dirty=!0;var R=!!u.connectGaps;"dashScale"in u&&(this.dashScale=u.dashScale),this.hasAlpha=!1,"opacity"in u&&(this.opacity=+u.opacity,this.opacity<1&&(this.hasAlpha=!0));var P=[],z=[],F=[],B=0,O=0,L=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],N=u.position||u.positions;if(N){var U=u.color||u.colors||[0,0,0,1],Z=u.lineWidth||1,Q=!1;e:for(g=1;g0){for(var le=0;le<24;++le)P.push(P[P.length-12]);O+=2,Q=!0}continue e}L[0][m]=Math.min(L[0][m],ue[m],oe[m]),L[1][m]=Math.max(L[1][m],ue[m],oe[m])}var j,J;Array.isArray(U[0])?(j=U.length>g-1?U[g-1]:U.length>0?U[U.length-1]:[0,0,0,1],J=U.length>g?U[g]:U.length>0?U[U.length-1]:[0,0,0,1]):j=J=U,j.length===3&&(j=[j[0],j[1],j[2],1]),J.length===3&&(J=[J[0],J[1],J[2],1]),!this.hasAlpha&&j[3]<1&&(this.hasAlpha=!0);var $;Array.isArray(Z)?$=Z.length>g-1?Z[g-1]:Z.length>0?Z[Z.length-1]:[0,0,0,1]:$=Z;var X=B;if(B+=b(ue,oe),Q){for(m=0;m<2;++m)P.push(ue[0],ue[1],ue[2],oe[0],oe[1],oe[2],X,$,j[0],j[1],j[2],j[3]);O+=2,Q=!1}P.push(ue[0],ue[1],ue[2],oe[0],oe[1],oe[2],X,$,j[0],j[1],j[2],j[3],ue[0],ue[1],ue[2],oe[0],oe[1],oe[2],X,-$,j[0],j[1],j[2],j[3],oe[0],oe[1],oe[2],ue[0],ue[1],ue[2],B,-$,J[0],J[1],J[2],J[3],oe[0],oe[1],oe[2],ue[0],ue[1],ue[2],B,$,J[0],J[1],J[2],J[3]),O+=4}}if(this.buffer.update(P),z.push(B),F.push(N[N.length-1].slice()),this.bounds=L,this.vertexCount=O,this.points=F,this.arcLength=z,"dashes"in u){var re=u.dashes,ee=re.slice();for(ee.unshift(0),g=1;g1.0001)return null;m+=g[M]}return Math.abs(m-1)>.001?null:[_,c(v,g),g]}},840:function(e,t,r){var o=r(3236),a=o([`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; +} +`]),i=o([`#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; +} +`]),n=o([`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; +}`]),s=o([`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; +}`]),c=o([`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; +}`]),f=o([`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; +}`]),v=o([`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; +}`]),h=o([`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); +}`]),T=o([`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; +}`]),l=o([`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))); +}`]),y=o([`precision highp float; +#define GLSLIFY 1 + +uniform vec3 contourColor; + +void main() { + gl_FragColor = vec4(contourColor, 1.0); +} +`]);t.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:n,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:c,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:v,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:T,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},t.contourShader={vertex:l,fragment:y,attributes:[{name:"position",type:"vec3"}]}},7201:function(e,t,r){var o=1e-6,a=1e-6,i=r(9405),n=r(2762),s=r(8116),c=r(7766),f=r(8406),v=r(6760),h=r(7608),T=r(9618),l=r(6729),y=r(7765),b=r(1888),S=r(840),M=r(7626),_=S.meshShader,w=S.wireShader,p=S.pointShader,u=S.pickShader,g=S.pointPickShader,m=S.contourShader,R=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function P(le,j,J,$,X,re,ee,q,ae,ie,fe,we,Ae,Fe,Ce,qe,et,Qe,Ke,Xe,Me,xe,ce,Re,$e,rt,Je){this.gl=le,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=j,this.dirty=!0,this.triShader=J,this.lineShader=$,this.pointShader=X,this.pickShader=re,this.pointPickShader=ee,this.contourShader=q,this.trianglePositions=ae,this.triangleColors=fe,this.triangleNormals=Ae,this.triangleUVs=we,this.triangleIds=ie,this.triangleVAO=Fe,this.triangleCount=0,this.lineWidth=1,this.edgePositions=Ce,this.edgeColors=et,this.edgeUVs=Qe,this.edgeIds=qe,this.edgeVAO=Ke,this.edgeCount=0,this.pointPositions=Xe,this.pointColors=xe,this.pointUVs=ce,this.pointSizes=Re,this.pointIds=Me,this.pointVAO=$e,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=rt,this.contourVAO=Je,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=R,this._view=R,this._projection=R,this._resolution=[1,1]}var z=P.prototype;z.isOpaque=function(){return!this.hasAlpha},z.isTransparent=function(){return this.hasAlpha},z.pickSlots=1,z.setPickBase=function(le){this.pickId=le};function F(le,j){if(!j||!j.length)return 1;for(var J=0;Jle&&J>0){var $=(j[J][0]-le)/(j[J][0]-j[J-1][0]);return j[J][1]*(1-$)+$*j[J-1][1]}}return 1}function B(le,j){for(var J=l({colormap:le,nshades:256,format:"rgba"}),$=new Uint8Array(256*4),X=0;X<256;++X){for(var re=J[X],ee=0;ee<3;++ee)$[4*X+ee]=re[ee];j?$[4*X+3]=255*F(X/255,j):$[4*X+3]=255*re[3]}return T($,[256,256,4],[4,0,1])}function O(le){for(var j=le.length,J=new Array(j),$=0;$0){var Ae=this.triShader;Ae.bind(),Ae.uniforms=q,this.triangleVAO.bind(),j.drawArrays(j.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var Ae=this.lineShader;Ae.bind(),Ae.uniforms=q,this.edgeVAO.bind(),j.lineWidth(this.lineWidth*this.pixelRatio),j.drawArrays(j.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()}if(this.pointCount>0){var Ae=this.pointShader;Ae.bind(),Ae.uniforms=q,this.pointVAO.bind(),j.drawArrays(j.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var Ae=this.contourShader;Ae.bind(),Ae.uniforms=q,this.contourVAO.bind(),j.drawArrays(j.LINES,0,this.contourCount),this.contourVAO.unbind()}},z.drawPick=function(le){le=le||{};for(var j=this.gl,J=le.model||R,$=le.view||R,X=le.projection||R,re=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],ee=0;ee<3;++ee)re[0][ee]=Math.max(re[0][ee],this.clipBounds[0][ee]),re[1][ee]=Math.min(re[1][ee],this.clipBounds[1][ee]);this._model=[].slice.call(J),this._view=[].slice.call($),this._projection=[].slice.call(X),this._resolution=[j.drawingBufferWidth,j.drawingBufferHeight];var q={model:J,view:$,projection:X,clipBounds:re,pickId:this.pickId/255},ae=this.pickShader;if(ae.bind(),ae.uniforms=q,this.triangleCount>0&&(this.triangleVAO.bind(),j.drawArrays(j.TRIANGLES,0,this.triangleCount*3),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),j.lineWidth(this.lineWidth*this.pixelRatio),j.drawArrays(j.LINES,0,this.edgeCount*2),this.edgeVAO.unbind()),this.pointCount>0){var ae=this.pointPickShader;ae.bind(),ae.uniforms=q,this.pointVAO.bind(),j.drawArrays(j.POINTS,0,this.pointCount),this.pointVAO.unbind()}},z.pick=function(le){if(!le||le.id!==this.pickId)return null;for(var j=le.value[0]+256*le.value[1]+65536*le.value[2],J=this.cells[j],$=this.positions,X=new Array(J.length),re=0;reMath.abs(u))l.rotate(R,0,0,-p*g*Math.PI*_.rotateSpeed/window.innerWidth);else if(!_._ortho){var P=-_.zoomSpeed*m*u/window.innerHeight*(R-l.lastT())/20;l.pan(R,0,0,b*(Math.exp(P)-1))}}},!0)},_.enableMouseListeners(),_}},799:function(e,t,r){var o=r(3236),a=r(9405),i=o([`precision mediump float; +#define GLSLIFY 1 +attribute vec2 position; +varying vec2 uv; +void main() { + uv = position; + gl_Position = vec4(position, 0, 1); +}`]),n=o([`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); +}`]);e.exports=function(s){return a(s,i,n,null,[{name:"position",type:"vec2"}])}},4100:function(e,t,r){var o=r(4437),a=r(3837),i=r(5445),n=r(4449),s=r(3589),c=r(2260),f=r(7169),v=r(351),h=r(4772),T=r(4040),l=r(799),y=r(9216)({tablet:!0,featureDetect:!0});e.exports={createScene:w,createCamera:o};function b(){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 S(u,g){var m=null;try{m=u.getContext("webgl",g),m||(m=u.getContext("experimental-webgl",g))}catch{return null}return m}function M(u){var g=Math.round(Math.log(Math.abs(u))/Math.log(10));if(g<0){var m=Math.round(Math.pow(10,-g));return Math.ceil(u*m)/m}else if(g>0){var m=Math.round(Math.pow(10,g));return Math.ceil(u/m)*m}return Math.ceil(u)}function _(u){return typeof u=="boolean"?u:!0}function w(u){u=u||{},u.camera=u.camera||{};var g=u.canvas;if(!g)if(g=document.createElement("canvas"),u.container){var m=u.container;m.appendChild(g)}else document.body.appendChild(g);var R=u.gl;if(R||(u.glOptions&&(y=!!u.glOptions.preserveDrawingBuffer),R=S(g,u.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:y})),!R)throw new Error("webgl not supported");var P=u.bounds||[[-10,-10,-10],[10,10,10]],z=new b,F=c(R,R.drawingBufferWidth,R.drawingBufferHeight,{preferFloat:!y}),B=l(R),O=u.cameraObject&&u.cameraObject._ortho===!0||u.camera.projection&&u.camera.projection.type==="orthographic"||!1,L={eye:u.camera.eye||[2,0,0],center:u.camera.center||[0,0,0],up:u.camera.up||[0,1,0],zoomMin:u.camera.zoomMax||.1,zoomMax:u.camera.zoomMin||100,mode:u.camera.mode||"turntable",_ortho:O},N=u.axes||{},U=a(R,N);U.enable=!N.disable;var Z=u.spikes||{},Q=n(R,Z),ue=[],oe=[],le=[],j=[],J=!0,ee=!0,$=new Array(16),X=new Array(16),re={view:null,projection:$,model:X,_ortho:!1},ee=!0,q=[R.drawingBufferWidth,R.drawingBufferHeight],ae=u.cameraObject||o(g,L),ie={gl:R,contextLost:!1,pixelRatio:u.pixelRatio||1,canvas:g,selection:z,camera:ae,axes:U,axesPixels:null,spikes:Q,bounds:P,objects:ue,shape:q,aspect:u.aspectRatio||[1,1,1],pickRadius:u.pickRadius||10,zNear:u.zNear||.01,zFar:u.zFar||1e3,fovy:u.fovy||Math.PI/4,clearColor:u.clearColor||[0,0,0,0],autoResize:_(u.autoResize),autoBounds:_(u.autoBounds),autoScale:!!u.autoScale,autoCenter:_(u.autoCenter),clipToBounds:_(u.clipToBounds),snapToData:!!u.snapToData,onselect:u.onselect||null,onrender:u.onrender||null,onclick:u.onclick||null,cameraParams:re,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(Xe){this.aspect[0]=Xe.x,this.aspect[1]=Xe.y,this.aspect[2]=Xe.z,ee=!0},setBounds:function(Xe,Me){this.bounds[0][Xe]=Me.min,this.bounds[1][Xe]=Me.max},setClearColor:function(Xe){this.clearColor=Xe},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)}},fe=[R.drawingBufferWidth/ie.pixelRatio|0,R.drawingBufferHeight/ie.pixelRatio|0];function we(){if(!ie._stopped&&ie.autoResize){var Xe=g.parentNode,Me=1,xe=1;Xe&&Xe!==document.body?(Me=Xe.clientWidth,xe=Xe.clientHeight):(Me=window.innerWidth,xe=window.innerHeight);var ce=Math.ceil(Me*ie.pixelRatio)|0,Re=Math.ceil(xe*ie.pixelRatio)|0;if(ce!==g.width||Re!==g.height){g.width=ce,g.height=Re;var $e=g.style;$e.position=$e.position||"absolute",$e.left="0px",$e.top="0px",$e.width=Me+"px",$e.height=xe+"px",J=!0}}}ie.autoResize&&we(),window.addEventListener("resize",we);function Ae(){for(var Xe=ue.length,Me=j.length,xe=0;xe0&&le[Me-1]===0;)le.pop(),j.pop().dispose()}ie.update=function(Xe){ie._stopped||(J=!0,ee=!0)},ie.add=function(Xe){ie._stopped||(Xe.axes=U,ue.push(Xe),oe.push(-1),J=!0,ee=!0,Ae())},ie.remove=function(Xe){if(!ie._stopped){var Me=ue.indexOf(Xe);Me<0||(ue.splice(Me,1),oe.pop(),J=!0,ee=!0,Ae())}},ie.dispose=function(){if(!ie._stopped&&(ie._stopped=!0,window.removeEventListener("resize",we),g.removeEventListener("webglcontextlost",Fe),ie.mouseListener.enabled=!1,!ie.contextLost)){U.dispose(),Q.dispose();for(var Xe=0;Xez.distance)continue;for(var St=0;St1e-6?(y=Math.acos(b),S=Math.sin(y),M=Math.sin((1-i)*y)/S,_=Math.sin(i*y)/S):(M=1-i,_=i),r[0]=M*n+_*v,r[1]=M*s+_*h,r[2]=M*c+_*T,r[3]=M*f+_*l,r}},5964:function(e){e.exports=function(t){return!t&&t!==0?"":t.toString()}},9366:function(e,t,r){var o=r(4359);e.exports=i;var a={};function i(n,s,c){var f=[s.style,s.weight,s.variant,s.family].join("_"),v=a[f];if(v||(v=a[f]={}),n in v)return v[n];var h={textAlign:"center",textBaseline:"middle",lineHeight:1,font:s.family,fontStyle:s.style,fontWeight:s.weight,fontVariant:s.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0}};h.triangles=!0;var T=o(n,h);h.triangles=!1;var l=o(n,h),y,b;if(c&&c!==1){for(y=0;y 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; + } +}`]),n=a([`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; + } +}`]),s=a([`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; + } +} +`]),c=a([`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; +} +`]),f=a([`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); +}`]),v=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:i,fragment:c,attributes:v},T={vertex:n,fragment:c,attributes:v},l={vertex:s,fragment:c,attributes:v},y={vertex:i,fragment:f,attributes:v},b={vertex:n,fragment:f,attributes:v},S={vertex:s,fragment:f,attributes:v};function M(_,w){var p=o(_,w),u=p.attributes;return u.position.location=0,u.color.location=1,u.glyph.location=2,u.id.location=3,p}t.createPerspective=function(_){return M(_,h)},t.createOrtho=function(_){return M(_,T)},t.createProject=function(_){return M(_,l)},t.createPickPerspective=function(_){return M(_,y)},t.createPickOrtho=function(_){return M(_,b)},t.createPickProject=function(_){return M(_,S)}},8418:function(e,t,r){var o=r(5219),a=r(2762),i=r(8116),n=r(1888),s=r(6760),c=r(1283),f=r(9366),v=r(5964),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=ArrayBuffer,l=DataView;function y(X){return T.isView(X)&&!(X instanceof l)}function b(X){return Array.isArray(X)||y(X)}e.exports=$;function S(X,re){var ee=X[0],q=X[1],ae=X[2],ie=X[3];return X[0]=re[0]*ee+re[4]*q+re[8]*ae+re[12]*ie,X[1]=re[1]*ee+re[5]*q+re[9]*ae+re[13]*ie,X[2]=re[2]*ee+re[6]*q+re[10]*ae+re[14]*ie,X[3]=re[3]*ee+re[7]*q+re[11]*ae+re[15]*ie,X}function M(X,re,ee,q){return S(q,q),S(q,q),S(q,q)}function _(X,re){this.index=X,this.dataCoordinate=this.position=re}function w(X){return X===!0||X>1?1:X}function p(X,re,ee,q,ae,ie,fe,we,Ae,Fe,Ce,qe){this.gl=X,this.pixelRatio=1,this.shader=re,this.orthoShader=ee,this.projectShader=q,this.pointBuffer=ae,this.colorBuffer=ie,this.glyphBuffer=fe,this.idBuffer=we,this.vao=Ae,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[.6666666666666666,.6666666666666666,.6666666666666666],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=Fe,this.pickOrthoShader=Ce,this.pickProjectShader=qe,this.points=[],this._selectResult=new _(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}var u=p.prototype;u.pickSlots=1,u.setPickBase=function(X){this.pickId=X},u.isTransparent=function(){if(this.hasAlpha)return!0;for(var X=0;X<3;++X)if(this.axesProject[X]&&this.projectHasAlpha)return!0;return!1},u.isOpaque=function(){if(!this.hasAlpha)return!0;for(var X=0;X<3;++X)if(this.axesProject[X]&&!this.projectHasAlpha)return!0;return!1};var g=[0,0],m=[0,0,0],R=[0,0,0],P=[0,0,0,1],z=[0,0,0,1],F=h.slice(),B=[0,0,0],O=[[0,0,0],[0,0,0]];function L(X){return X[0]=X[1]=X[2]=0,X}function N(X,re){return X[0]=re[0],X[1]=re[1],X[2]=re[2],X[3]=1,X}function U(X,re,ee,q){return X[0]=re[0],X[1]=re[1],X[2]=re[2],X[ee]=q,X}function Z(X){for(var re=O,ee=0;ee<2;++ee)for(var q=0;q<3;++q)re[ee][q]=Math.max(Math.min(X[ee][q],1e8),-1e8);return re}function Q(X,re,ee,q){var ae=re.axesProject,ie=re.gl,fe=X.uniforms,we=ee.model||h,Ae=ee.view||h,Fe=ee.projection||h,Ce=re.axesBounds,qe=Z(re.clipBounds),et;re.axes&&re.axes.lastCubeProps?et=re.axes.lastCubeProps.axis:et=[1,1,1],g[0]=2/ie.drawingBufferWidth,g[1]=2/ie.drawingBufferHeight,X.bind(),fe.view=Ae,fe.projection=Fe,fe.screenSize=g,fe.highlightId=re.highlightId,fe.highlightScale=re.highlightScale,fe.clipBounds=qe,fe.pickGroup=re.pickId/255,fe.pixelRatio=q;for(var Qe=0;Qe<3;++Qe)if(ae[Qe]){fe.scale=re.projectScale[Qe],fe.opacity=re.projectOpacity[Qe];for(var Ke=F,Xe=0;Xe<16;++Xe)Ke[Xe]=0;for(var Xe=0;Xe<4;++Xe)Ke[5*Xe]=1;Ke[5*Qe]=0,et[Qe]<0?Ke[12+Qe]=Ce[0][Qe]:Ke[12+Qe]=Ce[1][Qe],s(Ke,we,Ke),fe.model=Ke;var Me=(Qe+1)%3,xe=(Qe+2)%3,ce=L(m),Re=L(R);ce[Me]=1,Re[xe]=1;var $e=M(Fe,Ae,we,N(P,ce)),rt=M(Fe,Ae,we,N(z,Re));if(Math.abs($e[1])>Math.abs(rt[1])){var Je=$e;$e=rt,rt=Je,Je=ce,ce=Re,Re=Je;var At=Me;Me=xe,xe=At}$e[0]<0&&(ce[Me]=-1),rt[1]>0&&(Re[xe]=-1);for(var St=0,Rt=0,Xe=0;Xe<4;++Xe)St+=Math.pow(we[4*Me+Xe],2),Rt+=Math.pow(we[4*xe+Xe],2);ce[Me]/=Math.sqrt(St),Re[xe]/=Math.sqrt(Rt),fe.axes[0]=ce,fe.axes[1]=Re,fe.fragClipBounds[0]=U(B,qe[0],Qe,-1e8),fe.fragClipBounds[1]=U(B,qe[1],Qe,1e8),re.vao.bind(),re.vao.draw(ie.TRIANGLES,re.vertexCount),re.lineWidth>0&&(ie.lineWidth(re.lineWidth*q),re.vao.draw(ie.LINES,re.lineVertexCount,re.vertexCount)),re.vao.unbind()}}var ue=[-1e8,-1e8,-1e8],oe=[1e8,1e8,1e8],le=[ue,oe];function j(X,re,ee,q,ae,ie,fe){var we=ee.gl;if((ie===ee.projectHasAlpha||fe)&&Q(re,ee,q,ae),ie===ee.hasAlpha||fe){X.bind();var Ae=X.uniforms;Ae.model=q.model||h,Ae.view=q.view||h,Ae.projection=q.projection||h,g[0]=2/we.drawingBufferWidth,g[1]=2/we.drawingBufferHeight,Ae.screenSize=g,Ae.highlightId=ee.highlightId,Ae.highlightScale=ee.highlightScale,Ae.fragClipBounds=le,Ae.clipBounds=ee.axes.bounds,Ae.opacity=ee.opacity,Ae.pickGroup=ee.pickId/255,Ae.pixelRatio=ae,ee.vao.bind(),ee.vao.draw(we.TRIANGLES,ee.vertexCount),ee.lineWidth>0&&(we.lineWidth(ee.lineWidth*ae),ee.vao.draw(we.LINES,ee.lineVertexCount,ee.vertexCount)),ee.vao.unbind()}}u.draw=function(X){var re=this.useOrtho?this.orthoShader:this.shader;j(re,this.projectShader,this,X,this.pixelRatio,!1,!1)},u.drawTransparent=function(X){var re=this.useOrtho?this.orthoShader:this.shader;j(re,this.projectShader,this,X,this.pixelRatio,!0,!1)},u.drawPick=function(X){var re=this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader;j(re,this.pickProjectShader,this,X,1,!0,!0)},u.pick=function(X){if(!X||X.id!==this.pickId)return null;var re=X.value[2]+(X.value[1]<<8)+(X.value[0]<<16);if(re>=this.pointCount||re<0)return null;var ee=this.points[re],q=this._selectResult;q.index=re;for(var ae=0;ae<3;++ae)q.position[ae]=q.dataCoordinate[ae]=ee[ae];return q},u.highlight=function(X){if(!X)this.highlightId=[1,1,1,1];else{var re=X.index,ee=re&255,q=re>>8&255,ae=re>>16&255;this.highlightId=[ee/255,q/255,ae/255,0]}};function J(X,re,ee,q){var ae;b(X)?re0){var dr=0,pt=xe,ze=[0,0,0,1],Ge=[0,0,0,1],Oe=b(et)&&b(et[0]),ve=b(Xe)&&b(Xe[0]);e:for(var q=0;q0?1-Rt[0][0]:Mt<0?1+Rt[1][0]:1,Nt*=Nt>0?1-Rt[0][1]:Nt<0?1+Rt[1][1]:1;for(var Bt=[Mt,Nt],da=At.cells||[],wa=At.positions||[],rt=0;rtthis.buffer.length){a.free(this.buffer);for(var b=this.buffer=a.mallocUint8(n(y*l*4)),S=0;Sb)for(l=b;ly)for(l=y;l=0){for(var O=B.type.charAt(B.type.length-1)|0,L=new Array(O),N=0;N=0;)U+=1;z[F]=U}var Z=new Array(b.length);function Q(){_.program=n.program(w,_._vref,_._fref,P,z);for(var ue=0;ue=0){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+_+": "+w);s(v,h,p[0],l,u,y,_)}else if(w.indexOf("mat")>=0){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new o("","Invalid data type for attribute "+_+": "+w);c(v,h,p,l,u,y,_)}else throw new o("","Unknown data type for attribute "+_+": "+w);break}}return y}},3327:function(e,t,r){var o=r(216),a=r(8866);e.exports=s;function i(c){return function(){return c}}function n(c,f){for(var v=new Array(c),h=0;h4)throw new a("","Invalid data type");switch(U.charAt(0)){case"b":case"i":c["uniform"+Z+"iv"](h[z],F);break;case"v":c["uniform"+Z+"fv"](h[z],F);break;default:throw new a("","Unrecognized data type for vector "+name+": "+U)}}else if(U.indexOf("mat")===0&&U.length===4){if(Z=U.charCodeAt(U.length-1)-48,Z<2||Z>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+U);c["uniformMatrix"+Z+"fv"](h[z],!1,F);break}else throw new a("","Unknown uniform data type for "+name+": "+U)}}}}}function y(w,p){if(typeof p!="object")return[[w,p]];var u=[];for(var g in p){var m=p[g],R=w;parseInt(g)+""===g?R+="["+g+"]":R+="."+g,typeof m=="object"?u.push.apply(u,y(R,m)):u.push([R,m])}return u}function b(w){switch(w){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":return 0;case"float":return 0;default:var p=w.indexOf("vec");if(0<=p&&p<=1&&w.length===4+p){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new a("","Invalid data type");return w.charAt(0)==="b"?n(u,!1):n(u,0)}else if(w.indexOf("mat")===0&&w.length===4){var u=w.charCodeAt(w.length-1)-48;if(u<2||u>4)throw new a("","Invalid uniform dimension type for matrix "+name+": "+w);return n(u*u,0)}else throw new a("","Unknown uniform data type for "+name+": "+w)}}function S(w,p,u){if(typeof u=="object"){var g=M(u);Object.defineProperty(w,p,{get:i(g),set:l(u),enumerable:!0,configurable:!1})}else h[u]?Object.defineProperty(w,p,{get:T(u),set:l(u),enumerable:!0,configurable:!1}):w[p]=b(v[u].type)}function M(w){var p;if(Array.isArray(w)){p=new Array(w.length);for(var u=0;u1){v[0]in c||(c[v[0]]=[]),c=c[v[0]];for(var h=1;h1)for(var y=0;y"u"?r(606):WeakMap,n=new i,s=0;function c(S,M,_,w,p,u,g){this.id=S,this.src=M,this.type=_,this.shader=w,this.count=u,this.programs=[],this.cache=g}c.prototype.dispose=function(){if(--this.count===0){for(var S=this.cache,M=S.gl,_=this.programs,w=0,p=_.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; +} +`]),i=o([`#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; +} +`]),n=o([`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; +} +`]),s=o([`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); +}`]);t.meshShader={vertex:a,fragment:i,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:n,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(e,t,r){var o=r(2931),a=r(9970),i=["xyz","xzy","yxz","yzx","zxy","zyx"],n=function(b,S,M,_){for(var w=b.points,p=b.velocities,u=b.divergences,g=[],m=[],R=[],P=[],z=[],F=[],B=0,O=0,L=a.create(),N=a.create(),U=8,Z=0;Z0)for(var le=0;leS)return _-1}return _},f=function(b,S,M){return bM?M:b},v=function(b,S,M){var _=S.vectors,w=S.meshgrid,p=b[0],u=b[1],g=b[2],m=w[0].length,R=w[1].length,P=w[2].length,z=c(w[0],p),F=c(w[1],u),B=c(w[2],g),O=z+1,L=F+1,N=B+1;if(z=f(z,0,m-1),O=f(O,0,m-1),F=f(F,0,R-1),L=f(L,0,R-1),B=f(B,0,P-1),N=f(N,0,P-1),z<0||F<0||B<0||O>m-1||L>R-1||N>P-1)return o.create();var U=w[0][z],Z=w[0][O],Q=w[1][F],ue=w[1][L],oe=w[2][B],le=w[2][N],j=(p-U)/(Z-U),J=(u-Q)/(ue-Q),$=(g-oe)/(le-oe);isFinite(j)||(j=.5),isFinite(J)||(J=.5),isFinite($)||($=.5);var X,re,ee,q,ae,ie;switch(M.reversedX&&(z=m-1-z,O=m-1-O),M.reversedY&&(F=R-1-F,L=R-1-L),M.reversedZ&&(B=P-1-B,N=P-1-N),M.filled){case 5:ae=B,ie=N,ee=F*P,q=L*P,X=z*P*R,re=O*P*R;break;case 4:ae=B,ie=N,X=z*P,re=O*P,ee=F*P*m,q=L*P*m;break;case 3:ee=F,q=L,ae=B*R,ie=N*R,X=z*R*P,re=O*R*P;break;case 2:ee=F,q=L,X=z*R,re=O*R,ae=B*R*m,ie=N*R*m;break;case 1:X=z,re=O,ae=B*m,ie=N*m,ee=F*m*P,q=L*m*P;break;default:X=z,re=O,ee=F*m,q=L*m,ae=B*m*R,ie=N*m*R;break}var fe=_[X+ee+ae],we=_[X+ee+ie],Ae=_[X+q+ae],Fe=_[X+q+ie],Ce=_[re+ee+ae],qe=_[re+ee+ie],et=_[re+q+ae],Qe=_[re+q+ie],Ke=o.create(),Xe=o.create(),Me=o.create(),xe=o.create();o.lerp(Ke,fe,Ce,j),o.lerp(Xe,we,qe,j),o.lerp(Me,Ae,et,j),o.lerp(xe,Fe,Qe,j);var ce=o.create(),Re=o.create();o.lerp(ce,Ke,Me,J),o.lerp(Re,Xe,xe,J);var $e=o.create();return o.lerp($e,ce,Re,$),$e},h=function(b){var S=1/0;b.sort(function(p,u){return p-u});for(var M=b.length,_=1;_O||QeL||KeN)},Z=o.distance(S[0],S[1]),Q=10*Z/_,ue=Q*Q,oe=1,le=0,j=M.length;j>1&&(oe=T(M));for(var J=0;Jle&&(le=fe),ae.push(fe),P.push({points:X,velocities:re,divergences:ae});for(var we=0;we<_*100&&X.length<_&&U($);){we++;var Ae=o.clone(ee),Fe=o.squaredLength(Ae);if(Fe===0)break;if(Fe>ue&&o.scale(Ae,Ae,Q/Math.sqrt(Fe)),o.add(Ae,Ae,$),ee=m(Ae),o.squaredDistance(q,Ae)-ue>-1e-4*ue){X.push(Ae),q=Ae,re.push(ee);var ie=R(Ae,ee),fe=o.length(ie);isFinite(fe)&&fe>le&&(le=fe),ae.push(fe)}$=Ae}}var Ce=s(P,b.colormap,le,oe);return p?Ce.tubeScale=p:(le===0&&(le=1),Ce.tubeScale=w*.5*oe/le),Ce};var l=r(6740),y=r(6405).createMesh;e.exports.createTubeMesh=function(b,S){return y(b,S,{shaders:l,traceType:"streamtube"})}},990:function(e,t,r){var o=r(9405),a=r(3236),i=a([`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; + mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); + vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 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); +} +`]),n=a([`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 — 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; +} +`]),s=a([`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; + mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0)); + vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 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); +} +`]),c=a([`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)); +} +`]);t.createShader=function(f){var v=o(f,i,n,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v.attributes.normal.location=2,v},t.createPickShader=function(f){var v=o(f,i,c,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v.attributes.normal.location=2,v},t.createContourShader=function(f){var v=o(f,s,n,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v},t.createPickContourShader=function(f){var v=o(f,s,c,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return v.attributes.uv.location=0,v.attributes.f.location=1,v}},9499:function(e,t,r){e.exports=re;var o=r(8828),a=r(2762),i=r(8116),n=r(7766),s=r(1888),c=r(6729),f=r(5298),v=r(9994),h=r(9618),T=r(3711),l=r(6760),y=r(7608),b=r(2478),S=r(6199),M=r(990),_=M.createShader,w=M.createContourShader,p=M.createPickShader,u=M.createPickContourShader,g=4*10,m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],R=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],P=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];(function(){for(var ee=0;ee<3;++ee){var q=P[ee],ae=(ee+1)%3,ie=(ee+2)%3;q[ae+0]=1,q[ie+3]=1,q[ee+6]=1}})();function z(ee,q,ae,ie,fe){this.position=ee,this.index=q,this.uv=ae,this.level=ie,this.dataCoordinate=fe}var F=256;function B(ee,q,ae,ie,fe,we,Ae,Fe,Ce,qe,et,Qe,Ke,Xe,Me){this.gl=ee,this.shape=q,this.bounds=ae,this.objectOffset=Me,this.intensityBounds=[],this._shader=ie,this._pickShader=fe,this._coordinateBuffer=we,this._vao=Ae,this._colorMap=Fe,this._contourShader=Ce,this._contourPickShader=qe,this._contourBuffer=et,this._contourVAO=Qe,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new z([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=Ke,this._dynamicVAO=Xe,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=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var O=B.prototype;O.genColormap=function(ee,q){var ae=!1,ie=v([c({colormap:ee,nshades:F,format:"rgba"}).map(function(fe,we){var Ae=q?L(we/255,q):fe[3];return Ae<1&&(ae=!0),[fe[0],fe[1],fe[2],255*Ae]})]);return f.divseq(ie,255),this.hasAlphaScale=ae,ie},O.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},O.isOpaque=function(){return!this.isTransparent()},O.pickSlots=1,O.setPickBase=function(ee){this.pickId=ee};function L(ee,q){if(!q||!q.length)return 1;for(var ae=0;aeee&&ae>0){var ie=(q[ae][0]-ee)/(q[ae][0]-q[ae-1][0]);return q[ae][1]*(1-ie)+ie*q[ae-1][1]}}return 1}var N=[0,0,0],U={showSurface:!1,showContour:!1,projections:[m.slice(),m.slice(),m.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function Z(ee,q){var ae,ie,fe,we=q.axes&&q.axes.lastCubeProps.axis||N,Ae=q.showSurface,Fe=q.showContour;for(ae=0;ae<3;++ae)for(Ae=Ae||q.surfaceProject[ae],ie=0;ie<3;++ie)Fe=Fe||q.contourProject[ae][ie];for(ae=0;ae<3;++ae){var Ce=U.projections[ae];for(ie=0;ie<16;++ie)Ce[ie]=0;for(ie=0;ie<4;++ie)Ce[5*ie]=1;Ce[5*ae]=0,Ce[12+ae]=q.axesBounds[+(we[ae]>0)][ae],l(Ce,ee.model,Ce);var qe=U.clipBounds[ae];for(fe=0;fe<2;++fe)for(ie=0;ie<3;++ie)qe[fe][ie]=ee.clipBounds[fe][ie];qe[0][ae]=-1e8,qe[1][ae]=1e8}return U.showSurface=Ae,U.showContour=Fe,U}var Q={model:m,view:m,projection:m,inverseModel:m.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},ue=m.slice(),oe=[1,0,0,0,1,0,0,0,1];function le(ee,q){ee=ee||{};var ae=this.gl;ae.disable(ae.CULL_FACE),this._colorMap.bind(0);var ie=Q;ie.model=ee.model||m,ie.view=ee.view||m,ie.projection=ee.projection||m,ie.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],ie.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],ie.objectOffset=this.objectOffset,ie.contourColor=this.contourColor[0],ie.inverseModel=y(ie.inverseModel,ie.model);for(var fe=0;fe<2;++fe)for(var we=ie.clipBounds[fe],Ae=0;Ae<3;++Ae)we[Ae]=Math.min(Math.max(this.clipBounds[fe][Ae],-1e8),1e8);ie.kambient=this.ambientLight,ie.kdiffuse=this.diffuseLight,ie.kspecular=this.specularLight,ie.roughness=this.roughness,ie.fresnel=this.fresnel,ie.opacity=this.opacity,ie.height=0,ie.permutation=oe,ie.vertexColor=this.vertexColor;var Fe=ue;for(l(Fe,ie.view,ie.model),l(Fe,ie.projection,Fe),y(Fe,Fe),fe=0;fe<3;++fe)ie.eyePosition[fe]=Fe[12+fe]/Fe[15];var Ce=Fe[15];for(fe=0;fe<3;++fe)Ce+=this.lightPosition[fe]*Fe[4*fe+3];for(fe=0;fe<3;++fe){var qe=Fe[12+fe];for(Ae=0;Ae<3;++Ae)qe+=Fe[4*Ae+fe]*this.lightPosition[Ae];ie.lightPosition[fe]=qe/Ce}var et=Z(ie,this);if(et.showSurface){for(this._shader.bind(),this._shader.uniforms=ie,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(ae.TRIANGLES,this._vertexCount),fe=0;fe<3;++fe)!this.surfaceProject[fe]||!this.vertexCount||(this._shader.uniforms.model=et.projections[fe],this._shader.uniforms.clipBounds=et.clipBounds[fe],this._vao.draw(ae.TRIANGLES,this._vertexCount));this._vao.unbind()}if(et.showContour){var Qe=this._contourShader;ie.kambient=1,ie.kdiffuse=0,ie.kspecular=0,ie.opacity=1,Qe.bind(),Qe.uniforms=ie;var Ke=this._contourVAO;for(Ke.bind(),fe=0;fe<3;++fe)for(Qe.uniforms.permutation=P[fe],ae.lineWidth(this.contourWidth[fe]*this.pixelRatio),Ae=0;Ae>4)/16)/255,fe=Math.floor(ie),we=ie-fe,Ae=q[1]*(ee.value[1]+(ee.value[2]&15)/16)/255,Fe=Math.floor(Ae),Ce=Ae-Fe;fe+=1,Fe+=1;var qe=ae.position;qe[0]=qe[1]=qe[2]=0;for(var et=0;et<2;++et)for(var Qe=et?we:1-we,Ke=0;Ke<2;++Ke)for(var Xe=Ke?Ce:1-Ce,Me=fe+et,xe=Fe+Ke,ce=Qe*Xe,Re=0;Re<3;++Re)qe[Re]+=this._field[Re].get(Me,xe)*ce;for(var $e=this._pickResult.level,rt=0;rt<3;++rt)if($e[rt]=b.le(this.contourLevels[rt],qe[rt]),$e[rt]<0)this.contourLevels[rt].length>0&&($e[rt]=0);else if($e[rt]Math.abs(At-qe[rt])&&($e[rt]+=1)}for(ae.index[0]=we<.5?fe:fe+1,ae.index[1]=Ce<.5?Fe:Fe+1,ae.uv[0]=ie/q[0],ae.uv[1]=Ae/q[1],Re=0;Re<3;++Re)ae.dataCoordinate[Re]=this._field[Re].get(ae.index[0],ae.index[1]);return ae},O.padField=function(ee,q){var ae=q.shape.slice(),ie=ee.shape.slice();f.assign(ee.lo(1,1).hi(ae[0],ae[1]),q),f.assign(ee.lo(1).hi(ae[0],1),q.hi(ae[0],1)),f.assign(ee.lo(1,ie[1]-1).hi(ae[0],1),q.lo(0,ae[1]-1).hi(ae[0],1)),f.assign(ee.lo(0,1).hi(1,ae[1]),q.hi(1)),f.assign(ee.lo(ie[0]-1,1).hi(1,ae[1]),q.lo(ae[0]-1)),ee.set(0,0,q.get(0,0)),ee.set(0,ie[1]-1,q.get(0,ae[1]-1)),ee.set(ie[0]-1,0,q.get(ae[0]-1,0)),ee.set(ie[0]-1,ie[1]-1,q.get(ae[0]-1,ae[1]-1))};function J(ee,q){return Array.isArray(ee)?[q(ee[0]),q(ee[1]),q(ee[2])]:[q(ee),q(ee),q(ee)]}function $(ee){return Array.isArray(ee)?ee.length===3?[ee[0],ee[1],ee[2],1]:[ee[0],ee[1],ee[2],ee[3]]:[0,0,0,1]}function X(ee){if(Array.isArray(ee)){if(Array.isArray(ee))return[$(ee[0]),$(ee[1]),$(ee[2])];var q=$(ee);return[q.slice(),q.slice(),q.slice()]}}O.update=function(ee){ee=ee||{},this.objectOffset=ee.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in ee&&(this.contourWidth=J(ee.contourWidth,Number)),"showContour"in ee&&(this.showContour=J(ee.showContour,Boolean)),"showSurface"in ee&&(this.showSurface=!!ee.showSurface),"contourTint"in ee&&(this.contourTint=J(ee.contourTint,Boolean)),"contourColor"in ee&&(this.contourColor=X(ee.contourColor)),"contourProject"in ee&&(this.contourProject=J(ee.contourProject,function(Oa){return J(Oa,Boolean)})),"surfaceProject"in ee&&(this.surfaceProject=ee.surfaceProject),"dynamicColor"in ee&&(this.dynamicColor=X(ee.dynamicColor)),"dynamicTint"in ee&&(this.dynamicTint=J(ee.dynamicTint,Number)),"dynamicWidth"in ee&&(this.dynamicWidth=J(ee.dynamicWidth,Number)),"opacity"in ee&&(this.opacity=ee.opacity),"opacityscale"in ee&&(this.opacityscale=ee.opacityscale),"colorBounds"in ee&&(this.colorBounds=ee.colorBounds),"vertexColor"in ee&&(this.vertexColor=ee.vertexColor?1:0),"colormap"in ee&&this._colorMap.setPixels(this.genColormap(ee.colormap,this.opacityscale));var q=ee.field||ee.coords&&ee.coords[2]||null,ae=!1;if(q||(this._field[2].shape[0]||this._field[2].shape[2]?q=this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):q=this._field[2].hi(0,0)),"field"in ee||"coords"in ee){var ie=(q.shape[0]+2)*(q.shape[1]+2);ie>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(o.nextPow2(ie))),this._field[2]=h(this._field[2].data,[q.shape[0]+2,q.shape[1]+2]),this.padField(this._field[2],q),this.shape=q.shape.slice();for(var fe=this.shape,we=0;we<2;++we)this._field[2].size>this._field[we].data.length&&(s.freeFloat(this._field[we].data),this._field[we].data=s.mallocFloat(this._field[2].size)),this._field[we]=h(this._field[we].data,[fe[0]+2,fe[1]+2]);if(ee.coords){var Ae=ee.coords;if(!Array.isArray(Ae)||Ae.length!==3)throw new Error("gl-surface: invalid coordinates for x/y");for(we=0;we<2;++we){var Fe=Ae[we];for(Ke=0;Ke<2;++Ke)if(Fe.shape[Ke]!==fe[Ke])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[we],Fe)}}else if(ee.ticks){var Ce=ee.ticks;if(!Array.isArray(Ce)||Ce.length!==2)throw new Error("gl-surface: invalid ticks");for(we=0;we<2;++we){var qe=Ce[we];if((Array.isArray(qe)||qe.length)&&(qe=h(qe)),qe.shape[0]!==fe[we])throw new Error("gl-surface: invalid tick length");var et=h(qe.data,fe);et.stride[we]=qe.stride[0],et.stride[we^1]=0,this.padField(this._field[we],et)}}else{for(we=0;we<2;++we){var Qe=[0,0];Qe[we]=1,this._field[we]=h(this._field[we].data,[fe[0]+2,fe[1]+2],Qe,0)}this._field[0].set(0,0,0);for(var Ke=0;Ke0){for(var Pa=0;Pa<5;++Pa)qt.pop();Oe-=1}continue e}}}da.push(Oe)}this._contourOffsets[Zt]=ta,this._contourCounts[Zt]=da}var sa=s.mallocFloat(qt.length);for(we=0;wez||R<0||R>z)throw new Error("gl-texture2d: Invalid texture size");return g._shape=[m,R],g.bind(),P.texImage2D(P.TEXTURE_2D,0,g.format,m,R,0,g.format,g.type,null),g._mipLevels=[0],g}function l(g,m,R,P,z,F){this.gl=g,this.handle=m,this.format=z,this.type=F,this._shape=[R,P],this._mipLevels=[0],this._magFilter=g.NEAREST,this._minFilter=g.NEAREST,this._wrapS=g.CLAMP_TO_EDGE,this._wrapT=g.CLAMP_TO_EDGE,this._anisoSamples=1;var B=this,O=[this._wrapS,this._wrapT];Object.defineProperties(O,[{get:function(){return B._wrapS},set:function(N){return B.wrapS=N}},{get:function(){return B._wrapT},set:function(N){return B.wrapT=N}}]),this._wrapVector=O;var L=[this._shape[0],this._shape[1]];Object.defineProperties(L,[{get:function(){return B._shape[0]},set:function(N){return B.width=N}},{get:function(){return B._shape[1]},set:function(N){return B.height=N}}]),this._shapeVector=L}var y=l.prototype;Object.defineProperties(y,{minFilter:{get:function(){return this._minFilter},set:function(g){this.bind();var m=this.gl;if(this.type===m.FLOAT&&n.indexOf(g)>=0&&(m.getExtension("OES_texture_float_linear")||(g=m.NEAREST)),s.indexOf(g)<0)throw new Error("gl-texture2d: Unknown filter mode "+g);return m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,g),this._minFilter=g}},magFilter:{get:function(){return this._magFilter},set:function(g){this.bind();var m=this.gl;if(this.type===m.FLOAT&&n.indexOf(g)>=0&&(m.getExtension("OES_texture_float_linear")||(g=m.NEAREST)),s.indexOf(g)<0)throw new Error("gl-texture2d: Unknown filter mode "+g);return m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,g),this._magFilter=g}},mipSamples:{get:function(){return this._anisoSamples},set:function(g){var m=this._anisoSamples;if(this._anisoSamples=Math.max(g,1)|0,m!==this._anisoSamples){var R=this.gl.getExtension("EXT_texture_filter_anisotropic");R&&this.gl.texParameterf(this.gl.TEXTURE_2D,R.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(g){if(this.bind(),c.indexOf(g)<0)throw new Error("gl-texture2d: Unknown wrap mode "+g);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,g),this._wrapS=g}},wrapT:{get:function(){return this._wrapT},set:function(g){if(this.bind(),c.indexOf(g)<0)throw new Error("gl-texture2d: Unknown wrap mode "+g);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,g),this._wrapT=g}},wrap:{get:function(){return this._wrapVector},set:function(g){if(Array.isArray(g)||(g=[g,g]),g.length!==2)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var m=0;m<2;++m)if(c.indexOf(g[m])<0)throw new Error("gl-texture2d: Unknown wrap mode "+g);this._wrapS=g[0],this._wrapT=g[1];var R=this.gl;return this.bind(),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,this._wrapS),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,this._wrapT),g}},shape:{get:function(){return this._shapeVector},set:function(g){if(!Array.isArray(g))g=[g|0,g|0];else if(g.length!==2)throw new Error("gl-texture2d: Invalid texture shape");return T(this,g[0]|0,g[1]|0),[g[0]|0,g[1]|0]}},width:{get:function(){return this._shape[0]},set:function(g){return g=g|0,T(this,g,this._shape[1]),g}},height:{get:function(){return this._shape[1]},set:function(g){return g=g|0,T(this,this._shape[0],g),g}}}),y.bind=function(g){var m=this.gl;return g!==void 0&&m.activeTexture(m.TEXTURE0+(g|0)),m.bindTexture(m.TEXTURE_2D,this.handle),g!==void 0?g|0:m.getParameter(m.ACTIVE_TEXTURE)-m.TEXTURE0},y.dispose=function(){this.gl.deleteTexture(this.handle)},y.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var g=Math.min(this._shape[0],this._shape[1]),m=0;g>0;++m,g>>>=1)this._mipLevels.indexOf(m)<0&&this._mipLevels.push(m)},y.setPixels=function(g,m,R,P){var z=this.gl;this.bind(),Array.isArray(m)?(P=R,R=m[1]|0,m=m[0]|0):(m=m||0,R=R||0),P=P||0;var F=v(g)?g:g.raw;if(F){var B=this._mipLevels.indexOf(P)<0;B?(z.texImage2D(z.TEXTURE_2D,0,this.format,this.format,this.type,F),this._mipLevels.push(P)):z.texSubImage2D(z.TEXTURE_2D,P,m,R,this.format,this.type,F)}else if(g.shape&&g.stride&&g.data){if(g.shape.length<2||m+g.shape[1]>this._shape[1]>>>P||R+g.shape[0]>this._shape[0]>>>P||m<0||R<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");S(z,m,R,P,this.format,this.type,this._mipLevels,g)}else throw new Error("gl-texture2d: Unsupported data type")};function b(g,m){return g.length===3?m[2]===1&&m[1]===g[0]*g[2]&&m[0]===g[2]:m[0]===1&&m[1]===g[0]}function S(g,m,R,P,z,F,B,O){var L=O.dtype,N=O.shape.slice();if(N.length<2||N.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var U=0,Z=0,Q=b(N,O.stride.slice());if(L==="float32"?U=g.FLOAT:L==="float64"?(U=g.FLOAT,Q=!1,L="float32"):L==="uint8"?U=g.UNSIGNED_BYTE:(U=g.UNSIGNED_BYTE,Q=!1,L="uint8"),N.length===2)Z=g.LUMINANCE,N=[N[0],N[1],1],O=o(O.data,N,[O.stride[0],O.stride[1],1],O.offset);else if(N.length===3){if(N[2]===1)Z=g.ALPHA;else if(N[2]===2)Z=g.LUMINANCE_ALPHA;else if(N[2]===3)Z=g.RGB;else if(N[2]===4)Z=g.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");N[2]}else throw new Error("gl-texture2d: Invalid shape for texture");if((Z===g.LUMINANCE||Z===g.ALPHA)&&(z===g.LUMINANCE||z===g.ALPHA)&&(Z=z),Z!==z)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var ue=O.size,oe=B.indexOf(P)<0;if(oe&&B.push(P),U===F&&Q)O.offset===0&&O.data.length===ue?oe?g.texImage2D(g.TEXTURE_2D,P,z,N[0],N[1],0,z,F,O.data):g.texSubImage2D(g.TEXTURE_2D,P,m,R,N[0],N[1],z,F,O.data):oe?g.texImage2D(g.TEXTURE_2D,P,z,N[0],N[1],0,z,F,O.data.subarray(O.offset,O.offset+ue)):g.texSubImage2D(g.TEXTURE_2D,P,m,R,N[0],N[1],z,F,O.data.subarray(O.offset,O.offset+ue));else{var le;F===g.FLOAT?le=i.mallocFloat32(ue):le=i.mallocUint8(ue);var j=o(le,N,[N[2],N[2]*N[0],1]);U===g.FLOAT&&F===g.UNSIGNED_BYTE?h(j,O):a.assign(j,O),oe?g.texImage2D(g.TEXTURE_2D,P,z,N[0],N[1],0,z,F,le.subarray(0,ue)):g.texSubImage2D(g.TEXTURE_2D,P,m,R,N[0],N[1],z,F,le.subarray(0,ue)),F===g.FLOAT?i.freeFloat32(le):i.freeUint8(le)}}function M(g){var m=g.createTexture();return g.bindTexture(g.TEXTURE_2D,m),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MIN_FILTER,g.NEAREST),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_MAG_FILTER,g.NEAREST),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_S,g.CLAMP_TO_EDGE),g.texParameteri(g.TEXTURE_2D,g.TEXTURE_WRAP_T,g.CLAMP_TO_EDGE),m}function _(g,m,R,P,z){var F=g.getParameter(g.MAX_TEXTURE_SIZE);if(m<0||m>F||R<0||R>F)throw new Error("gl-texture2d: Invalid texture shape");if(z===g.FLOAT&&!g.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var B=M(g);return g.texImage2D(g.TEXTURE_2D,0,P,m,R,0,P,z,null),new l(g,B,m,R,P,z)}function w(g,m,R,P,z,F){var B=M(g);return g.texImage2D(g.TEXTURE_2D,0,z,z,F,m),new l(g,B,R,P,z,F)}function p(g,m){var R=m.dtype,P=m.shape.slice(),z=g.getParameter(g.MAX_TEXTURE_SIZE);if(P[0]<0||P[0]>z||P[1]<0||P[1]>z)throw new Error("gl-texture2d: Invalid texture size");var F=b(P,m.stride.slice()),B=0;R==="float32"?B=g.FLOAT:R==="float64"?(B=g.FLOAT,F=!1,R="float32"):R==="uint8"?B=g.UNSIGNED_BYTE:(B=g.UNSIGNED_BYTE,F=!1,R="uint8");var O=0;if(P.length===2)O=g.LUMINANCE,P=[P[0],P[1],1],m=o(m.data,P,[m.stride[0],m.stride[1],1],m.offset);else if(P.length===3)if(P[2]===1)O=g.ALPHA;else if(P[2]===2)O=g.LUMINANCE_ALPHA;else if(P[2]===3)O=g.RGB;else if(P[2]===4)O=g.RGBA;else throw new Error("gl-texture2d: Invalid shape for pixel coords");else throw new Error("gl-texture2d: Invalid shape for texture");B===g.FLOAT&&!g.getExtension("OES_texture_float")&&(B=g.UNSIGNED_BYTE,F=!1);var L,N,U=m.size;if(F)m.offset===0&&m.data.length===U?L=m.data:L=m.data.subarray(m.offset,m.offset+U);else{var Z=[P[2],P[2]*P[0],1];N=i.malloc(U,R);var Q=o(N,P,Z,0);(R==="float32"||R==="float64")&&B===g.UNSIGNED_BYTE?h(Q,m):a.assign(Q,m),L=N.subarray(0,U)}var ue=M(g);return g.texImage2D(g.TEXTURE_2D,0,O,P[0],P[1],0,O,B,L),F||i.free(N),new l(g,ue,P[0],P[1],O,B)}function u(g){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(n||f(g),typeof arguments[1]=="number")return _(g,arguments[1],arguments[2],arguments[3]||g.RGBA,arguments[4]||g.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return _(g,arguments[1][0]|0,arguments[1][1]|0,arguments[2]||g.RGBA,arguments[3]||g.UNSIGNED_BYTE);if(typeof arguments[1]=="object"){var m=arguments[1],R=v(m)?m:m.raw;if(R)return w(g,R,m.width|0,m.height|0,arguments[2]||g.RGBA,arguments[3]||g.UNSIGNED_BYTE);if(m.shape&&m.data&&m.stride)return p(g,m)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}},1433:function(e){function t(r,o,a){o?o.bind():r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,null);var i=r.getParameter(r.MAX_VERTEX_ATTRIBS)|0;if(a){if(a.length>i)throw new Error("gl-vao: Too many vertex attributes");for(var n=0;n1?0:Math.acos(h)}},9226:function(e){e.exports=t;function t(r,o){return r[0]=Math.ceil(o[0]),r[1]=Math.ceil(o[1]),r[2]=Math.ceil(o[2]),r}},3126:function(e){e.exports=t;function t(r){var o=new Float32Array(3);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o}},3990:function(e){e.exports=t;function t(r,o){return r[0]=o[0],r[1]=o[1],r[2]=o[2],r}},1091:function(e){e.exports=t;function t(){var r=new Float32Array(3);return r[0]=0,r[1]=0,r[2]=0,r}},5911:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[0],f=a[1],v=a[2];return r[0]=n*v-s*f,r[1]=s*c-i*v,r[2]=i*f-n*c,r}},5455:function(e,t,r){e.exports=r(7056)},7056:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2];return Math.sqrt(a*a+i*i+n*n)}},4008:function(e,t,r){e.exports=r(6690)},6690:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]/a[0],r[1]=o[1]/a[1],r[2]=o[2]/a[2],r}},244:function(e){e.exports=t;function t(r,o){return r[0]*o[0]+r[1]*o[1]+r[2]*o[2]}},2613:function(e){e.exports=1e-6},9922:function(e,t,r){e.exports=a;var o=r(2613);function a(i,n){var s=i[0],c=i[1],f=i[2],v=n[0],h=n[1],T=n[2];return Math.abs(s-v)<=o*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(c-h)<=o*Math.max(1,Math.abs(c),Math.abs(h))&&Math.abs(f-T)<=o*Math.max(1,Math.abs(f),Math.abs(T))}},9265:function(e){e.exports=t;function t(r,o){return r[0]===o[0]&&r[1]===o[1]&&r[2]===o[2]}},2681:function(e){e.exports=t;function t(r,o){return r[0]=Math.floor(o[0]),r[1]=Math.floor(o[1]),r[2]=Math.floor(o[2]),r}},5137:function(e,t,r){e.exports=a;var o=r(1091)();function a(i,n,s,c,f,v){var h,T;for(n||(n=3),s||(s=0),c?T=Math.min(c*n+s,i.length):T=i.length,h=s;h0&&(s=1/Math.sqrt(s),r[0]=o[0]*s,r[1]=o[1]*s,r[2]=o[2]*s),r}},7636:function(e){e.exports=t;function t(r,o){o=o||1;var a=Math.random()*2*Math.PI,i=Math.random()*2-1,n=Math.sqrt(1-i*i)*o;return r[0]=Math.cos(a)*n,r[1]=Math.sin(a)*n,r[2]=i*o,r}},6894:function(e){e.exports=t;function t(r,o,a,i){var n=a[1],s=a[2],c=o[1]-n,f=o[2]-s,v=Math.sin(i),h=Math.cos(i);return r[0]=o[0],r[1]=n+c*h-f*v,r[2]=s+c*v+f*h,r}},109:function(e){e.exports=t;function t(r,o,a,i){var n=a[0],s=a[2],c=o[0]-n,f=o[2]-s,v=Math.sin(i),h=Math.cos(i);return r[0]=n+f*v+c*h,r[1]=o[1],r[2]=s+f*h-c*v,r}},8692:function(e){e.exports=t;function t(r,o,a,i){var n=a[0],s=a[1],c=o[0]-n,f=o[1]-s,v=Math.sin(i),h=Math.cos(i);return r[0]=n+c*h-f*v,r[1]=s+c*v+f*h,r[2]=o[2],r}},2447:function(e){e.exports=t;function t(r,o){return r[0]=Math.round(o[0]),r[1]=Math.round(o[1]),r[2]=Math.round(o[2]),r}},6621:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a,r[1]=o[1]*a,r[2]=o[2]*a,r}},8489:function(e){e.exports=t;function t(r,o,a,i){return r[0]=o[0]+a[0]*i,r[1]=o[1]+a[1]*i,r[2]=o[2]+a[2]*i,r}},1463:function(e){e.exports=t;function t(r,o,a,i){return r[0]=o,r[1]=a,r[2]=i,r}},6141:function(e,t,r){e.exports=r(2953)},5486:function(e,t,r){e.exports=r(3066)},2953:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2];return a*a+i*i+n*n}},3066:function(e){e.exports=t;function t(r){var o=r[0],a=r[1],i=r[2];return o*o+a*a+i*i}},2229:function(e,t,r){e.exports=r(6843)},6843:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]-a[0],r[1]=o[1]-a[1],r[2]=o[2]-a[2],r}},492:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2];return r[0]=i*a[0]+n*a[3]+s*a[6],r[1]=i*a[1]+n*a[4]+s*a[7],r[2]=i*a[2]+n*a[5]+s*a[8],r}},5673:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[3]*i+a[7]*n+a[11]*s+a[15];return c=c||1,r[0]=(a[0]*i+a[4]*n+a[8]*s+a[12])/c,r[1]=(a[1]*i+a[5]*n+a[9]*s+a[13])/c,r[2]=(a[2]*i+a[6]*n+a[10]*s+a[14])/c,r}},264:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[0],f=a[1],v=a[2],h=a[3],T=h*i+f*s-v*n,l=h*n+v*i-c*s,y=h*s+c*n-f*i,b=-c*i-f*n-v*s;return r[0]=T*h+b*-c+l*-v-y*-f,r[1]=l*h+b*-f+y*-c-T*-v,r[2]=y*h+b*-v+T*-f-l*-c,r}},4361:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]+a[0],r[1]=o[1]+a[1],r[2]=o[2]+a[2],r[3]=o[3]+a[3],r}},2335:function(e){e.exports=t;function t(r){var o=new Float32Array(4);return o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],o}},2933:function(e){e.exports=t;function t(r,o){return r[0]=o[0],r[1]=o[1],r[2]=o[2],r[3]=o[3],r}},7536:function(e){e.exports=t;function t(){var r=new Float32Array(4);return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}},4691:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2],s=o[3]-r[3];return Math.sqrt(a*a+i*i+n*n+s*s)}},1373:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]/a[0],r[1]=o[1]/a[1],r[2]=o[2]/a[2],r[3]=o[3]/a[3],r}},3750:function(e){e.exports=t;function t(r,o){return r[0]*o[0]+r[1]*o[1]+r[2]*o[2]+r[3]*o[3]}},3390:function(e){e.exports=t;function t(r,o,a,i){var n=new Float32Array(4);return n[0]=r,n[1]=o,n[2]=a,n[3]=i,n}},9970:function(e,t,r){e.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(e){e.exports=t;function t(r,o){return r[0]=1/o[0],r[1]=1/o[1],r[2]=1/o[2],r[3]=1/o[3],r}},6808:function(e){e.exports=t;function t(r){var o=r[0],a=r[1],i=r[2],n=r[3];return Math.sqrt(o*o+a*a+i*i+n*n)}},2573:function(e){e.exports=t;function t(r,o,a,i){var n=o[0],s=o[1],c=o[2],f=o[3];return r[0]=n+i*(a[0]-n),r[1]=s+i*(a[1]-s),r[2]=c+i*(a[2]-c),r[3]=f+i*(a[3]-f),r}},160:function(e){e.exports=t;function t(r,o,a){return r[0]=Math.max(o[0],a[0]),r[1]=Math.max(o[1],a[1]),r[2]=Math.max(o[2],a[2]),r[3]=Math.max(o[3],a[3]),r}},2334:function(e){e.exports=t;function t(r,o,a){return r[0]=Math.min(o[0],a[0]),r[1]=Math.min(o[1],a[1]),r[2]=Math.min(o[2],a[2]),r[3]=Math.min(o[3],a[3]),r}},3576:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a[0],r[1]=o[1]*a[1],r[2]=o[2]*a[2],r[3]=o[3]*a[3],r}},1498:function(e){e.exports=t;function t(r,o){return r[0]=-o[0],r[1]=-o[1],r[2]=-o[2],r[3]=-o[3],r}},5177:function(e){e.exports=t;function t(r,o){var a=o[0],i=o[1],n=o[2],s=o[3],c=a*a+i*i+n*n+s*s;return c>0&&(c=1/Math.sqrt(c),r[0]=a*c,r[1]=i*c,r[2]=n*c,r[3]=s*c),r}},9131:function(e,t,r){var o=r(5177),a=r(9288);e.exports=i;function i(n,s){return s=s||1,n[0]=Math.random(),n[1]=Math.random(),n[2]=Math.random(),n[3]=Math.random(),o(n,n),a(n,n,s),n}},9288:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]*a,r[1]=o[1]*a,r[2]=o[2]*a,r[3]=o[3]*a,r}},4844:function(e){e.exports=t;function t(r,o,a,i){return r[0]=o[0]+a[0]*i,r[1]=o[1]+a[1]*i,r[2]=o[2]+a[2]*i,r[3]=o[3]+a[3]*i,r}},4578:function(e){e.exports=t;function t(r,o,a,i,n){return r[0]=o,r[1]=a,r[2]=i,r[3]=n,r}},7960:function(e){e.exports=t;function t(r,o){var a=o[0]-r[0],i=o[1]-r[1],n=o[2]-r[2],s=o[3]-r[3];return a*a+i*i+n*n+s*s}},483:function(e){e.exports=t;function t(r){var o=r[0],a=r[1],i=r[2],n=r[3];return o*o+a*a+i*i+n*n}},6860:function(e){e.exports=t;function t(r,o,a){return r[0]=o[0]-a[0],r[1]=o[1]-a[1],r[2]=o[2]-a[2],r[3]=o[3]-a[3],r}},5352:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=o[3];return r[0]=a[0]*i+a[4]*n+a[8]*s+a[12]*c,r[1]=a[1]*i+a[5]*n+a[9]*s+a[13]*c,r[2]=a[2]*i+a[6]*n+a[10]*s+a[14]*c,r[3]=a[3]*i+a[7]*n+a[11]*s+a[15]*c,r}},4041:function(e){e.exports=t;function t(r,o,a){var i=o[0],n=o[1],s=o[2],c=a[0],f=a[1],v=a[2],h=a[3],T=h*i+f*s-v*n,l=h*n+v*i-c*s,y=h*s+c*n-f*i,b=-c*i-f*n-v*s;return r[0]=T*h+b*-c+l*-v-y*-f,r[1]=l*h+b*-f+y*-c-T*-v,r[2]=y*h+b*-v+T*-f-l*-c,r[3]=o[3],r}},1848:function(e,t,r){var o=r(4905),a=r(6468);e.exports=i;function i(n){for(var s=Array.isArray(n)?n:o(n),c=0;c0)continue;Re=Me.slice(0,1).join("")}return ee(Re),Q+=Re.length,L=L.slice(Re.length),L.length}while(!0)}function et(){return/[^a-fA-F0-9]/.test(B)?(ee(L.join("")),F=c,P):(L.push(B),O=B,P+1)}function Qe(){return B==="."||/[eE]/.test(B)?(L.push(B),F=b,O=B,P+1):B==="x"&&L.length===1&&L[0]==="0"?(F=u,L.push(B),O=B,P+1):/[^\d]/.test(B)?(ee(L.join("")),F=c,P):(L.push(B),O=B,P+1)}function Ke(){return B==="f"&&(L.push(B),O=B,P+=1),/[eE]/.test(B)||(B==="-"||B==="+")&&/[eE]/.test(O)?(L.push(B),O=B,P+1):/[^\d]/.test(B)?(ee(L.join("")),F=c,P):(L.push(B),O=B,P+1)}function Xe(){if(/[^\d\w_]/.test(B)){var Me=L.join("");return re[Me]?F=_:X[Me]?F=M:F=S,ee(L.join("")),F=c,P}return L.push(B),O=B,P+1}}},3508:function(e,t,r){var o=r(6852);o=o.slice().filter(function(a){return!/^(gl\_|texture)/.test(a)}),e.exports=o.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(e){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932:function(e,t,r){var o=r(620);e.exports=o.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(e){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827:function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(e,t,r){var o=r(5874);e.exports=a;function a(i,n){var s=o(n),c=[];return c=c.concat(s(i)),c=c.concat(s(null)),c}},3236:function(e){e.exports=function(t){typeof t=="string"&&(t=[t]);for(var r=[].slice.call(arguments,1),o=[],a=0;a>1,T=-7,l=a?n-1:0,y=a?-1:1,b=r[o+l];for(l+=y,s=b&(1<<-T)-1,b>>=-T,T+=f;T>0;s=s*256+r[o+l],l+=y,T-=8);for(c=s&(1<<-T)-1,s>>=-T,T+=i;T>0;c=c*256+r[o+l],l+=y,T-=8);if(s===0)s=1-h;else{if(s===v)return c?NaN:(b?-1:1)*(1/0);c=c+Math.pow(2,i),s=s-h}return(b?-1:1)*c*Math.pow(2,s-i)},t.write=function(r,o,a,i,n,s){var c,f,v,h=s*8-n-1,T=(1<>1,y=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=i?0:s-1,S=i?1:-1,M=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(f=isNaN(o)?1:0,c=T):(c=Math.floor(Math.log(o)/Math.LN2),o*(v=Math.pow(2,-c))<1&&(c--,v*=2),c+l>=1?o+=y/v:o+=y*Math.pow(2,1-l),o*v>=2&&(c++,v/=2),c+l>=T?(f=0,c=T):c+l>=1?(f=(o*v-1)*Math.pow(2,n),c=c+l):(f=o*Math.pow(2,l-1)*Math.pow(2,n),c=0));n>=8;r[a+b]=f&255,b+=S,f/=256,n-=8);for(c=c<0;r[a+b]=c&255,b+=S,c/=256,h-=8);r[a+b-S]|=M*128}},8954:function(e,t,r){e.exports=l;var o=r(3250),a=r(6803).Fw;function i(y,b,S){this.vertices=y,this.adjacent=b,this.boundary=S,this.lastVisited=-1}i.prototype.flip=function(){var y=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=y;var b=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=b};function n(y,b,S){this.vertices=y,this.cell=b,this.index=S}function s(y,b){return a(y.vertices,b.vertices)}function c(y){return function(){var b=this.tuple;return y.apply(this,b)}}function f(y){var b=o[y+1];return b||(b=o),c(b)}var v=[];function h(y,b,S){this.dimension=y,this.vertices=b,this.simplices=S,this.interior=S.filter(function(w){return!w.boundary}),this.tuple=new Array(y+1);for(var M=0;M<=y;++M)this.tuple[M]=this.vertices[M];var _=v[y];_||(_=v[y]=f(y)),this.orient=_}var T=h.prototype;T.handleBoundaryDegeneracy=function(y,b){var S=this.dimension,M=this.vertices.length-1,_=this.tuple,w=this.vertices,p=[y];for(y.lastVisited=-M;p.length>0;){y=p.pop();for(var u=y.adjacent,g=0;g<=S;++g){var m=u[g];if(!(!m.boundary||m.lastVisited<=-M)){for(var R=m.vertices,P=0;P<=S;++P){var z=R[P];z<0?_[P]=b:_[P]=w[z]}var F=this.orient();if(F>0)return m;m.lastVisited=-M,F===0&&p.push(m)}}}return null},T.walk=function(y,b){var S=this.vertices.length-1,M=this.dimension,_=this.vertices,w=this.tuple,p=b?this.interior.length*Math.random()|0:this.interior.length-1,u=this.interior[p];e:for(;!u.boundary;){for(var g=u.vertices,m=u.adjacent,R=0;R<=M;++R)w[R]=_[g[R]];u.lastVisited=S;for(var R=0;R<=M;++R){var P=m[R];if(!(P.lastVisited>=S)){var z=w[R];w[R]=y;var F=this.orient();if(w[R]=z,F<0){u=P;continue e}else P.boundary?P.lastVisited=-S:P.lastVisited=S}}return}return u},T.addPeaks=function(y,b){var S=this.vertices.length-1,M=this.dimension,_=this.vertices,w=this.tuple,p=this.interior,u=this.simplices,g=[b];b.lastVisited=S,b.vertices[b.vertices.indexOf(-1)]=S,b.boundary=!1,p.push(b);for(var m=[];g.length>0;){var b=g.pop(),R=b.vertices,P=b.adjacent,z=R.indexOf(S);if(!(z<0)){for(var F=0;F<=M;++F)if(F!==z){var B=P[F];if(!(!B.boundary||B.lastVisited>=S)){var O=B.vertices;if(B.lastVisited!==-S){for(var L=0,N=0;N<=M;++N)O[N]<0?(L=N,w[N]=y):w[N]=_[O[N]];var U=this.orient();if(U>0){O[L]=S,B.boundary=!1,p.push(B),g.push(B),B.lastVisited=S;continue}else B.lastVisited=-S}var Z=B.adjacent,Q=R.slice(),ue=P.slice(),oe=new i(Q,ue,!0);u.push(oe);var le=Z.indexOf(b);if(!(le<0)){Z[le]=oe,ue[z]=B,Q[F]=-1,ue[F]=b,P[F]=oe,oe.flip();for(var N=0;N<=M;++N){var j=Q[N];if(!(j<0||j===S)){for(var J=new Array(M-1),$=0,X=0;X<=M;++X){var re=Q[X];re<0||X===N||(J[$++]=re)}m.push(new n(J,oe,N))}}}}}}}m.sort(s);for(var F=0;F+1=0?p[g++]=u[R]:m=R&1;if(m===(y&1)){var P=p[0];p[0]=p[1],p[1]=P}b.push(p)}}return b};function l(y,b){var S=y.length;if(S===0)throw new Error("Must have at least d+1 points");var M=y[0].length;if(S<=M)throw new Error("Must input at least d+1 points");var _=y.slice(0,M+1),w=o.apply(void 0,_);if(w===0)throw new Error("Input not in general position");for(var p=new Array(M+1),u=0;u<=M;++u)p[u]=u;w<0&&(p[0]=1,p[1]=0);for(var g=new i(p,new Array(M+1),!1),m=g.adjacent,R=new Array(M+2),u=0;u<=M;++u){for(var P=p.slice(),z=0;z<=M;++z)z===u&&(P[z]=-1);var F=P[0];P[0]=P[1],P[1]=F;var B=new i(P,new Array(M+1),!0);m[u]=B,R[u]=B}R[M+1]=g;for(var u=0;u<=M;++u)for(var P=m[u].vertices,O=m[u].adjacent,z=0;z<=M;++z){var L=P[z];if(L<0){O[z]=g;continue}for(var N=0;N<=M;++N)m[N].vertices.indexOf(L)<0&&(O[z]=m[N])}for(var U=new h(M,_,R),Z=!!b,u=M+1;u3*(R+1)?h(this,m):this.left.insert(m):this.left=w([m]);else if(m[0]>this.mid)this.right?4*(this.right.count+1)>3*(R+1)?h(this,m):this.right.insert(m):this.right=w([m]);else{var P=o.ge(this.leftPoints,m,M),z=o.ge(this.rightPoints,m,_);this.leftPoints.splice(P,0,m),this.rightPoints.splice(z,0,m)}},c.remove=function(m){var R=this.count-this.leftPoints;if(m[1]3*(R-1))return T(this,m);var z=this.left.remove(m);return z===n?(this.left=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else if(m[0]>this.mid){if(!this.right)return a;var F=this.left?this.left.count:0;if(4*F>3*(R-1))return T(this,m);var z=this.right.remove(m);return z===n?(this.right=null,this.count-=1,i):(z===i&&(this.count-=1),z)}else{if(this.count===1)return this.leftPoints[0]===m?n:a;if(this.leftPoints.length===1&&this.leftPoints[0]===m){if(this.left&&this.right){for(var B=this,O=this.left;O.right;)B=O,O=O.right;if(B===this)O.right=this.right;else{var L=this.left,z=this.right;B.count-=O.count,B.right=O.left,O.left=L,O.right=z}f(this,O),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?f(this,this.left):f(this,this.right);return i}for(var L=o.ge(this.leftPoints,m,M);L=0&&m[z][1]>=R;--z){var F=P(m[z]);if(F)return F}}function b(m,R){for(var P=0;Pthis.mid){if(this.right){var P=this.right.queryPoint(m,R);if(P)return P}return y(this.rightPoints,m,R)}else return b(this.leftPoints,R)},c.queryInterval=function(m,R,P){if(mthis.mid&&this.right){var z=this.right.queryInterval(m,R,P);if(z)return z}return Rthis.mid?y(this.rightPoints,m,P):b(this.leftPoints,P)};function S(m,R){return m-R}function M(m,R){var P=m[0]-R[0];return P||m[1]-R[1]}function _(m,R){var P=m[1]-R[1];return P||m[0]-R[0]}function w(m){if(m.length===0)return null;for(var R=[],P=0;P>1],F=[],B=[],O=[],P=0;P13)&&o!==32&&o!==133&&o!==160&&o!==5760&&o!==6158&&(o<8192||o>8205)&&o!==8232&&o!==8233&&o!==8239&&o!==8287&&o!==8288&&o!==12288&&o!==65279)return!1;return!0}},395:function(e){function t(r,o,a){return r*(1-a)+o*a}e.exports=t},2652:function(e,t,r){var o=r(4335),a=r(6864),i=r(1903),n=r(9921),s=r(7608),c=r(5665),f={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},v=a(),h=a(),T=[0,0,0,0],l=[[0,0,0],[0,0,0],[0,0,0]],y=[0,0,0];e.exports=function(w,p,u,g,m,R){if(p||(p=[0,0,0]),u||(u=[0,0,0]),g||(g=[0,0,0]),m||(m=[0,0,0,1]),R||(R=[0,0,0,1]),!o(v,w)||(i(h,v),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(n(h)<1e-8)))return!1;var P=v[3],z=v[7],F=v[11],B=v[12],O=v[13],L=v[14],N=v[15];if(P!==0||z!==0||F!==0){T[0]=P,T[1]=z,T[2]=F,T[3]=N;var U=s(h,h);if(!U)return!1;c(h,h),b(m,T,h)}else m[0]=m[1]=m[2]=0,m[3]=1;if(p[0]=B,p[1]=O,p[2]=L,S(l,v),u[0]=f.length(l[0]),f.normalize(l[0],l[0]),g[0]=f.dot(l[0],l[1]),M(l[1],l[1],l[0],1,-g[0]),u[1]=f.length(l[1]),f.normalize(l[1],l[1]),g[0]/=u[1],g[1]=f.dot(l[0],l[2]),M(l[2],l[2],l[0],1,-g[1]),g[2]=f.dot(l[1],l[2]),M(l[2],l[2],l[1],1,-g[2]),u[2]=f.length(l[2]),f.normalize(l[2],l[2]),g[1]/=u[2],g[2]/=u[2],f.cross(y,l[1],l[2]),f.dot(l[0],y)<0)for(var Z=0;Z<3;Z++)u[Z]*=-1,l[Z][0]*=-1,l[Z][1]*=-1,l[Z][2]*=-1;return R[0]=.5*Math.sqrt(Math.max(1+l[0][0]-l[1][1]-l[2][2],0)),R[1]=.5*Math.sqrt(Math.max(1-l[0][0]+l[1][1]-l[2][2],0)),R[2]=.5*Math.sqrt(Math.max(1-l[0][0]-l[1][1]+l[2][2],0)),R[3]=.5*Math.sqrt(Math.max(1+l[0][0]+l[1][1]+l[2][2],0)),l[2][1]>l[1][2]&&(R[0]=-R[0]),l[0][2]>l[2][0]&&(R[1]=-R[1]),l[1][0]>l[0][1]&&(R[2]=-R[2]),!0};function b(_,w,p){var u=w[0],g=w[1],m=w[2],R=w[3];return _[0]=p[0]*u+p[4]*g+p[8]*m+p[12]*R,_[1]=p[1]*u+p[5]*g+p[9]*m+p[13]*R,_[2]=p[2]*u+p[6]*g+p[10]*m+p[14]*R,_[3]=p[3]*u+p[7]*g+p[11]*m+p[15]*R,_}function S(_,w){_[0][0]=w[0],_[0][1]=w[1],_[0][2]=w[2],_[1][0]=w[4],_[1][1]=w[5],_[1][2]=w[6],_[2][0]=w[8],_[2][1]=w[9],_[2][2]=w[10]}function M(_,w,p,u,g){_[0]=w[0]*u+p[0]*g,_[1]=w[1]*u+p[1]*g,_[2]=w[2]*u+p[2]*g}},4335:function(e){e.exports=function(r,o){var a=o[15];if(a===0)return!1;for(var i=1/a,n=0;n<16;n++)r[n]=o[n]*i;return!0}},7442:function(e,t,r){var o=r(6658),a=r(7182),i=r(2652),n=r(9921),s=r(8648),c=T(),f=T(),v=T();e.exports=h;function h(b,S,M,_){if(n(S)===0||n(M)===0)return!1;var w=i(S,c.translate,c.scale,c.skew,c.perspective,c.quaternion),p=i(M,f.translate,f.scale,f.skew,f.perspective,f.quaternion);return!w||!p?!1:(o(v.translate,c.translate,f.translate,_),o(v.skew,c.skew,f.skew,_),o(v.scale,c.scale,f.scale,_),o(v.perspective,c.perspective,f.perspective,_),s(v.quaternion,c.quaternion,f.quaternion,_),a(b,v.translate,v.scale,v.skew,v.perspective,v.quaternion),!0)}function T(){return{translate:l(),scale:l(1),skew:l(),perspective:y(),quaternion:y()}}function l(b){return[b||0,b||0,b||0]}function y(){return[0,0,0,1]}},7182:function(e,t,r){var o={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)};o.create();var a=o.create();e.exports=function(n,s,c,f,v,h){return o.identity(n),o.fromRotationTranslation(n,h,s),n[3]=v[0],n[7]=v[1],n[11]=v[2],n[15]=v[3],o.identity(a),f[2]!==0&&(a[9]=f[2],o.multiply(n,n,a)),f[1]!==0&&(a[9]=0,a[8]=f[1],o.multiply(n,n,a)),f[0]!==0&&(a[8]=0,a[4]=f[0],o.multiply(n,n,a)),o.scale(n,n,c),n}},1811:function(e,t,r){var o=r(2478),a=r(7442),i=r(7608),n=r(5567),s=r(2408),c=r(7089),f=r(6582),v=r(7656);r(2504);var h=r(3536),T=[0,0,0];e.exports=S;function l(M){this._components=M.slice(),this._time=[0],this.prevMatrix=M.slice(),this.nextMatrix=M.slice(),this.computedMatrix=M.slice(),this.computedInverse=M.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]}var y=l.prototype;y.recalcMatrix=function(M){var _=this._time,w=o.le(_,M),p=this.computedMatrix;if(!(w<0)){var u=this._components;if(w===_.length-1)for(var g=16*w,m=0;m<16;++m)p[m]=u[g++];else{for(var R=_[w+1]-_[w],g=16*w,P=this.prevMatrix,z=!0,m=0;m<16;++m)P[m]=u[g++];for(var F=this.nextMatrix,m=0;m<16;++m)F[m]=u[g++],z=z&&P[m]===F[m];if(R<1e-6||z)for(var m=0;m<16;++m)p[m]=P[m];else a(p,P,F,(M-_[w])/R)}var B=this.computedUp;B[0]=p[1],B[1]=p[5],B[2]=p[9],h(B,B);var O=this.computedInverse;i(O,p);var L=this.computedEye,N=O[15];L[0]=O[12]/N,L[1]=O[13]/N,L[2]=O[14]/N;for(var U=this.computedCenter,Z=Math.exp(this.computedRadius[0]),m=0;m<3;++m)U[m]=L[m]-p[2+4*m]*Z}},y.idle=function(M){if(!(M1&&o(i[f[l-2]],i[f[l-1]],T)<=0;)l-=1,f.pop();for(f.push(h),l=v.length;l>1&&o(i[v[l-2]],i[v[l-1]],T)>=0;)l-=1,v.pop();v.push(h)}for(var y=new Array(v.length+f.length-2),b=0,s=0,S=f.length;s0;--M)y[b++]=v[M];return y}},351:function(e,t,r){e.exports=a;var o=r(4687);function a(i,n){n||(n=i,i=window);var s=0,c=0,f=0,v={shift:!1,alt:!1,control:!1,meta:!1},h=!1;function T(m){var R=!1;return"altKey"in m&&(R=R||m.altKey!==v.alt,v.alt=!!m.altKey),"shiftKey"in m&&(R=R||m.shiftKey!==v.shift,v.shift=!!m.shiftKey),"ctrlKey"in m&&(R=R||m.ctrlKey!==v.control,v.control=!!m.ctrlKey),"metaKey"in m&&(R=R||m.metaKey!==v.meta,v.meta=!!m.metaKey),R}function l(m,R){var P=o.x(R),z=o.y(R);"buttons"in R&&(m=R.buttons|0),(m!==s||P!==c||z!==f||T(R))&&(s=m|0,c=P||0,f=z||0,n&&n(s,c,f,v))}function y(m){l(0,m)}function b(){(s||c||f||v.shift||v.alt||v.meta||v.control)&&(c=f=0,s=0,v.shift=v.alt=v.control=v.meta=!1,n&&n(0,0,0,v))}function S(m){T(m)&&n&&n(s,c,f,v)}function M(m){o.buttons(m)===0?l(0,m):l(s,m)}function _(m){l(s|o.buttons(m),m)}function w(m){l(s&~o.buttons(m),m)}function p(){h||(h=!0,i.addEventListener("mousemove",M),i.addEventListener("mousedown",_),i.addEventListener("mouseup",w),i.addEventListener("mouseleave",y),i.addEventListener("mouseenter",y),i.addEventListener("mouseout",y),i.addEventListener("mouseover",y),i.addEventListener("blur",b),i.addEventListener("keyup",S),i.addEventListener("keydown",S),i.addEventListener("keypress",S),i!==window&&(window.addEventListener("blur",b),window.addEventListener("keyup",S),window.addEventListener("keydown",S),window.addEventListener("keypress",S)))}function u(){h&&(h=!1,i.removeEventListener("mousemove",M),i.removeEventListener("mousedown",_),i.removeEventListener("mouseup",w),i.removeEventListener("mouseleave",y),i.removeEventListener("mouseenter",y),i.removeEventListener("mouseout",y),i.removeEventListener("mouseover",y),i.removeEventListener("blur",b),i.removeEventListener("keyup",S),i.removeEventListener("keydown",S),i.removeEventListener("keypress",S),i!==window&&(window.removeEventListener("blur",b),window.removeEventListener("keyup",S),window.removeEventListener("keydown",S),window.removeEventListener("keypress",S)))}p();var g={element:i};return Object.defineProperties(g,{enabled:{get:function(){return h},set:function(m){m?p():u()},enumerable:!0},buttons:{get:function(){return s},enumerable:!0},x:{get:function(){return c},enumerable:!0},y:{get:function(){return f},enumerable:!0},mods:{get:function(){return v},enumerable:!0}}),g}},24:function(e){var t={left:0,top:0};e.exports=r;function r(a,i,n){i=i||a.currentTarget||a.srcElement,Array.isArray(n)||(n=[0,0]);var s=a.clientX||0,c=a.clientY||0,f=o(i);return n[0]=s-f.left,n[1]=c-f.top,n}function o(a){return a===window||a===document||a===document.body?t:a.getBoundingClientRect()}},4687:function(e,t){function r(n){if(typeof n=="object"){if("buttons"in n)return n.buttons;if("which"in n){var s=n.which;if(s===2)return 4;if(s===3)return 2;if(s>0)return 1<=0)return 1<0){if(ue=1,j[$++]=v(p[R],b,S,M),R+=U,_>0)for(Q=1,P=p[R],X=j[$]=v(P,b,S,M),q=j[$+re],fe=j[$+ae],Fe=j[$+we],(X!==q||X!==fe||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,q,fe,Fe,b,S,M),Ce=J[$]=oe++),$+=1,R+=U,Q=2;Q<_;++Q)P=p[R],X=j[$]=v(P,b,S,M),q=j[$+re],fe=j[$+ae],Fe=j[$+we],(X!==q||X!==fe||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,q,fe,Fe,b,S,M),Ce=J[$]=oe++,Fe!==q&&f(J[$+re],Ce,N,F,Fe,q,b,S,M)),$+=1,R+=U;for(R+=Z,$=0,qe=re,re=ee,ee=qe,qe=ae,ae=ie,ie=qe,qe=we,we=Ae,Ae=qe,ue=2;ue0)for(Q=1,P=p[R],X=j[$]=v(P,b,S,M),q=j[$+re],fe=j[$+ae],Fe=j[$+we],(X!==q||X!==fe||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,q,fe,Fe,b,S,M),Ce=J[$]=oe++,Fe!==fe&&f(J[$+ae],Ce,O,N,fe,Fe,b,S,M)),$+=1,R+=U,Q=2;Q<_;++Q)P=p[R],X=j[$]=v(P,b,S,M),q=j[$+re],fe=j[$+ae],Fe=j[$+we],(X!==q||X!==fe||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,q,fe,Fe,b,S,M),Ce=J[$]=oe++,Fe!==fe&&f(J[$+ae],Ce,O,N,fe,Fe,b,S,M),Fe!==q&&f(J[$+re],Ce,N,F,Fe,q,b,S,M)),$+=1,R+=U;ue&1&&($=0),qe=re,re=ee,ee=qe,qe=ae,ae=ie,ie=qe,qe=we,we=Ae,Ae=qe,R+=Z}}T(J),T(j)}},"false,1,0":function(c,f,v,h,T){return function(y,b,S,M){var _=y.shape[0]|0,w=y.shape[1]|0,p=y.data,u=y.offset|0,g=y.stride[0]|0,m=y.stride[1]|0,R=u,P,z=-g|0,F=0,B=-m|0,O=0,L=-g-m|0,N=0,U=m|0,Z=g-m*w|0,Q=0,ue=0,oe=0,le=2*w|0,j=h(le),J=h(le),$=0,X=0,re=-1,ee=-1,q=0,ae=-w|0,ie=w|0,fe=0,we=-w-1|0,Ae=w-1|0,Fe=0,Ce=0,qe=0;for(ue=0;ue0){if(Q=1,j[$++]=v(p[R],b,S,M),R+=U,w>0)for(ue=1,P=p[R],X=j[$]=v(P,b,S,M),fe=j[$+ae],q=j[$+re],Fe=j[$+we],(X!==fe||X!==q||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,fe,q,Fe,b,S,M),Ce=J[$]=oe++),$+=1,R+=U,ue=2;ue0)for(ue=1,P=p[R],X=j[$]=v(P,b,S,M),fe=j[$+ae],q=j[$+re],Fe=j[$+we],(X!==fe||X!==q||X!==Fe)&&(F=p[R+z],O=p[R+B],N=p[R+L],c(Q,ue,P,F,O,N,X,fe,q,Fe,b,S,M),Ce=J[$]=oe++,Fe!==fe&&f(J[$+ae],Ce,N,F,Fe,fe,b,S,M)),$+=1,R+=U,ue=2;ue 0"),typeof s.vertex!="function"&&c("Must specify vertex creation function"),typeof s.cell!="function"&&c("Must specify cell creation function"),typeof s.phase!="function"&&c("Must specify phase function");for(var T=s.getters||[],l=new Array(v),y=0;y=0?l[y]=!0:l[y]=!1;return i(s.vertex,s.cell,s.phase,h,f,l)}},6199:function(e,t,r){var o=r(1338),a={zero:function(S,M,_,w){var p=S[0],u=_[0];w|=0;var g=0,m=u;for(g=0;g2&&g[1]>2&&w(u.pick(-1,-1).lo(1,1).hi(g[0]-2,g[1]-2),p.pick(-1,-1,0).lo(1,1).hi(g[0]-2,g[1]-2),p.pick(-1,-1,1).lo(1,1).hi(g[0]-2,g[1]-2)),g[1]>2&&(_(u.pick(0,-1).lo(1).hi(g[1]-2),p.pick(0,-1,1).lo(1).hi(g[1]-2)),M(p.pick(0,-1,0).lo(1).hi(g[1]-2))),g[1]>2&&(_(u.pick(g[0]-1,-1).lo(1).hi(g[1]-2),p.pick(g[0]-1,-1,1).lo(1).hi(g[1]-2)),M(p.pick(g[0]-1,-1,0).lo(1).hi(g[1]-2))),g[0]>2&&(_(u.pick(-1,0).lo(1).hi(g[0]-2),p.pick(-1,0,0).lo(1).hi(g[0]-2)),M(p.pick(-1,0,1).lo(1).hi(g[0]-2))),g[0]>2&&(_(u.pick(-1,g[1]-1).lo(1).hi(g[0]-2),p.pick(-1,g[1]-1,0).lo(1).hi(g[0]-2)),M(p.pick(-1,g[1]-1,1).lo(1).hi(g[0]-2))),p.set(0,0,0,0),p.set(0,0,1,0),p.set(g[0]-1,0,0,0),p.set(g[0]-1,0,1,0),p.set(0,g[1]-1,0,0),p.set(0,g[1]-1,1,0),p.set(g[0]-1,g[1]-1,0,0),p.set(g[0]-1,g[1]-1,1,0),p}}function b(S){var M=S.join(),g=v[M];if(g)return g;for(var _=S.length,w=[h,T],p=1;p<=_;++p)w.push(l(p));var u=y,g=u.apply(void 0,w);return v[M]=g,g}e.exports=function(M,_,w){if(Array.isArray(w)||(typeof w=="string"?w=o(_.dimension,w):w=o(_.dimension,"clamp")),_.size===0)return M;if(_.dimension===0)return M.set(0),M;var p=b(w);return p(M,_)}},4317:function(e){function t(n,s){var c=Math.floor(s),f=s-c,v=0<=c&&c0;){O<64?(_=O,O=0):(_=64,O-=64);for(var L=v[1]|0;L>0;){L<64?(w=L,L=0):(w=64,L-=64),l=F+O*u+L*g,S=B+O*R+L*P;var N=0,U=0,Z=0,Q=m,ue=u-p*m,oe=g-_*u,le=z,j=R-p*z,J=P-_*R;for(Z=0;Z0;){P<64?(_=P,P=0):(_=64,P-=64);for(var z=v[0]|0;z>0;){z<64?(M=z,z=0):(M=64,z-=64),l=m+P*p+z*w,S=R+P*g+z*u;var F=0,B=0,O=p,L=w-_*p,N=g,U=u-_*g;for(B=0;B0;){B<64?(w=B,B=0):(w=64,B-=64);for(var O=v[0]|0;O>0;){O<64?(M=O,O=0):(M=64,O-=64);for(var L=v[1]|0;L>0;){L<64?(_=L,L=0):(_=64,L-=64),l=z+B*g+O*p+L*u,S=F+B*P+O*m+L*R;var N=0,U=0,Z=0,Q=g,ue=p-w*g,oe=u-M*p,le=P,j=m-w*P,J=R-M*m;for(Z=0;Z<_;++Z){for(U=0;Uy;){N=0,U=F-_;t:for(O=0;OQ)break t;U+=m,N+=R}for(N=F,U=F-_,O=0;O>1,L=O-z,N=O+z,U=F,Z=L,Q=O,ue=N,oe=B,le=b+1,j=S-1,J=!0,$,X,re,ee,q,ae,ie,fe,we,Ae=0,Fe=0,Ce=0,qe,et,Qe,Ke,Xe,Me,xe,ce,Re,$e,rt,Je,At,St,Rt,Ut,ir=g,ar=T(ir),Mr=T(ir);et=w*U,Qe=w*Z,Ut=_;e:for(qe=0;qe0){X=U,U=Z,Z=X;break e}if(Ce<0)break e;Ut+=R}et=w*ue,Qe=w*oe,Ut=_;e:for(qe=0;qe0){X=ue,ue=oe,oe=X;break e}if(Ce<0)break e;Ut+=R}et=w*U,Qe=w*Q,Ut=_;e:for(qe=0;qe0){X=U,U=Q,Q=X;break e}if(Ce<0)break e;Ut+=R}et=w*Z,Qe=w*Q,Ut=_;e:for(qe=0;qe0){X=Z,Z=Q,Q=X;break e}if(Ce<0)break e;Ut+=R}et=w*U,Qe=w*ue,Ut=_;e:for(qe=0;qe0){X=U,U=ue,ue=X;break e}if(Ce<0)break e;Ut+=R}et=w*Q,Qe=w*ue,Ut=_;e:for(qe=0;qe0){X=Q,Q=ue,ue=X;break e}if(Ce<0)break e;Ut+=R}et=w*Z,Qe=w*oe,Ut=_;e:for(qe=0;qe0){X=Z,Z=oe,oe=X;break e}if(Ce<0)break e;Ut+=R}et=w*Z,Qe=w*Q,Ut=_;e:for(qe=0;qe0){X=Z,Z=Q,Q=X;break e}if(Ce<0)break e;Ut+=R}et=w*ue,Qe=w*oe,Ut=_;e:for(qe=0;qe0){X=ue,ue=oe,oe=X;break e}if(Ce<0)break e;Ut+=R}for(et=w*U,Qe=w*Z,Ke=w*Q,Xe=w*ue,Me=w*oe,xe=w*F,ce=w*O,Re=w*B,Rt=0,Ut=_,qe=0;qe0)j--;else if(Ce<0){for(et=w*ae,Qe=w*le,Ke=w*j,Ut=_,qe=0;qe0)for(;;){ie=_+j*w,Rt=0;e:for(qe=0;qe0){if(--jB){e:for(;;){for(ie=_+le*w,Rt=0,Ut=_,qe=0;qe1&&y?S(l,y[0],y[1]):S(l)}var f={"uint32,1,0":function(h,T){return function(l){var y=l.data,b=l.offset|0,S=l.shape,M=l.stride,_=M[0]|0,w=S[0]|0,p=M[1]|0,u=S[1]|0,g=p,m=p,R=1;w<=32?h(0,w-1,y,b,_,p,w,u,g,m,R):T(0,w-1,y,b,_,p,w,u,g,m,R)}}};function v(h,T){var l=[T,h].join(","),y=f[l],b=n(h,T),S=c(h,T,b);return y(b,S)}e.exports=v},446:function(e,t,r){var o=r(7640),a={};function i(n){var s=n.order,c=n.dtype,f=[s,c],v=f.join(":"),h=a[v];return h||(a[v]=h=o(s,c)),h(n),n}e.exports=i},9618:function(e,t,r){var o=r(7163),a=typeof Float64Array<"u";function i(T,l){return T[0]-l[0]}function n(){var T=this.stride,l=new Array(T.length),y;for(y=0;y=0&&(p=_|0,w+=g*p,u-=p),new b(this.data,u,g,w)},S.step=function(_){var w=this.shape[0],p=this.stride[0],u=this.offset,g=0,m=Math.ceil;return typeof _=="number"&&(g=_|0,g<0?(u+=p*(w-1),w=m(-w/g)):w=m(w/g),p*=g),new b(this.data,w,p,u)},S.transpose=function(_){_=_===void 0?0:_|0;var w=this.shape,p=this.stride;return new b(this.data,w[_],p[_],this.offset)},S.pick=function(_){var w=[],p=[],u=this.offset;typeof _=="number"&&_>=0?u=u+this.stride[0]*_|0:(w.push(this.shape[0]),p.push(this.stride[0]));var g=l[w.length+1];return g(this.data,w,p,u)},function(_,w,p,u){return new b(_,w[0],p[0],u)}},2:function(T,l,y){function b(M,_,w,p,u,g){this.data=M,this.shape=[_,w],this.stride=[p,u],this.offset=g|0}var S=b.prototype;return S.dtype=T,S.dimension=2,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(S,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),S.set=function(_,w,p){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w,p):this.data[this.offset+this.stride[0]*_+this.stride[1]*w]=p},S.get=function(_,w){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w):this.data[this.offset+this.stride[0]*_+this.stride[1]*w]},S.index=function(_,w){return this.offset+this.stride[0]*_+this.stride[1]*w},S.hi=function(_,w){return new b(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,this.stride[0],this.stride[1],this.offset)},S.lo=function(_,w){var p=this.offset,u=0,g=this.shape[0],m=this.shape[1],R=this.stride[0],P=this.stride[1];return typeof _=="number"&&_>=0&&(u=_|0,p+=R*u,g-=u),typeof w=="number"&&w>=0&&(u=w|0,p+=P*u,m-=u),new b(this.data,g,m,R,P,p)},S.step=function(_,w){var p=this.shape[0],u=this.shape[1],g=this.stride[0],m=this.stride[1],R=this.offset,P=0,z=Math.ceil;return typeof _=="number"&&(P=_|0,P<0?(R+=g*(p-1),p=z(-p/P)):p=z(p/P),g*=P),typeof w=="number"&&(P=w|0,P<0?(R+=m*(u-1),u=z(-u/P)):u=z(u/P),m*=P),new b(this.data,p,u,g,m,R)},S.transpose=function(_,w){_=_===void 0?0:_|0,w=w===void 0?1:w|0;var p=this.shape,u=this.stride;return new b(this.data,p[_],p[w],u[_],u[w],this.offset)},S.pick=function(_,w){var p=[],u=[],g=this.offset;typeof _=="number"&&_>=0?g=g+this.stride[0]*_|0:(p.push(this.shape[0]),u.push(this.stride[0])),typeof w=="number"&&w>=0?g=g+this.stride[1]*w|0:(p.push(this.shape[1]),u.push(this.stride[1]));var m=l[p.length+1];return m(this.data,p,u,g)},function(_,w,p,u){return new b(_,w[0],w[1],p[0],p[1],u)}},3:function(T,l,y){function b(M,_,w,p,u,g,m,R){this.data=M,this.shape=[_,w,p],this.stride=[u,g,m],this.offset=R|0}var S=b.prototype;return S.dtype=T,S.dimension=3,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(S,"order",{get:function(){var _=Math.abs(this.stride[0]),w=Math.abs(this.stride[1]),p=Math.abs(this.stride[2]);return _>w?w>p?[2,1,0]:_>p?[1,2,0]:[1,0,2]:_>p?[2,0,1]:p>w?[0,1,2]:[0,2,1]}}),S.set=function(_,w,p,u){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p,u):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p]=u},S.get=function(_,w,p){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p]},S.index=function(_,w,p){return this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p},S.hi=function(_,w,p){return new b(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,typeof p!="number"||p<0?this.shape[2]:p|0,this.stride[0],this.stride[1],this.stride[2],this.offset)},S.lo=function(_,w,p){var u=this.offset,g=0,m=this.shape[0],R=this.shape[1],P=this.shape[2],z=this.stride[0],F=this.stride[1],B=this.stride[2];return typeof _=="number"&&_>=0&&(g=_|0,u+=z*g,m-=g),typeof w=="number"&&w>=0&&(g=w|0,u+=F*g,R-=g),typeof p=="number"&&p>=0&&(g=p|0,u+=B*g,P-=g),new b(this.data,m,R,P,z,F,B,u)},S.step=function(_,w,p){var u=this.shape[0],g=this.shape[1],m=this.shape[2],R=this.stride[0],P=this.stride[1],z=this.stride[2],F=this.offset,B=0,O=Math.ceil;return typeof _=="number"&&(B=_|0,B<0?(F+=R*(u-1),u=O(-u/B)):u=O(u/B),R*=B),typeof w=="number"&&(B=w|0,B<0?(F+=P*(g-1),g=O(-g/B)):g=O(g/B),P*=B),typeof p=="number"&&(B=p|0,B<0?(F+=z*(m-1),m=O(-m/B)):m=O(m/B),z*=B),new b(this.data,u,g,m,R,P,z,F)},S.transpose=function(_,w,p){_=_===void 0?0:_|0,w=w===void 0?1:w|0,p=p===void 0?2:p|0;var u=this.shape,g=this.stride;return new b(this.data,u[_],u[w],u[p],g[_],g[w],g[p],this.offset)},S.pick=function(_,w,p){var u=[],g=[],m=this.offset;typeof _=="number"&&_>=0?m=m+this.stride[0]*_|0:(u.push(this.shape[0]),g.push(this.stride[0])),typeof w=="number"&&w>=0?m=m+this.stride[1]*w|0:(u.push(this.shape[1]),g.push(this.stride[1])),typeof p=="number"&&p>=0?m=m+this.stride[2]*p|0:(u.push(this.shape[2]),g.push(this.stride[2]));var R=l[u.length+1];return R(this.data,u,g,m)},function(_,w,p,u){return new b(_,w[0],w[1],w[2],p[0],p[1],p[2],u)}},4:function(T,l,y){function b(M,_,w,p,u,g,m,R,P,z){this.data=M,this.shape=[_,w,p,u],this.stride=[g,m,R,P],this.offset=z|0}var S=b.prototype;return S.dtype=T,S.dimension=4,Object.defineProperty(S,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(S,"order",{get:y}),S.set=function(_,w,p,u,g){return T==="generic"?this.data.set(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p+this.stride[3]*u,g):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p+this.stride[3]*u]=g},S.get=function(_,w,p,u){return T==="generic"?this.data.get(this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p+this.stride[3]*u):this.data[this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p+this.stride[3]*u]},S.index=function(_,w,p,u){return this.offset+this.stride[0]*_+this.stride[1]*w+this.stride[2]*p+this.stride[3]*u},S.hi=function(_,w,p,u){return new b(this.data,typeof _!="number"||_<0?this.shape[0]:_|0,typeof w!="number"||w<0?this.shape[1]:w|0,typeof p!="number"||p<0?this.shape[2]:p|0,typeof u!="number"||u<0?this.shape[3]:u|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},S.lo=function(_,w,p,u){var g=this.offset,m=0,R=this.shape[0],P=this.shape[1],z=this.shape[2],F=this.shape[3],B=this.stride[0],O=this.stride[1],L=this.stride[2],N=this.stride[3];return typeof _=="number"&&_>=0&&(m=_|0,g+=B*m,R-=m),typeof w=="number"&&w>=0&&(m=w|0,g+=O*m,P-=m),typeof p=="number"&&p>=0&&(m=p|0,g+=L*m,z-=m),typeof u=="number"&&u>=0&&(m=u|0,g+=N*m,F-=m),new b(this.data,R,P,z,F,B,O,L,N,g)},S.step=function(_,w,p,u){var g=this.shape[0],m=this.shape[1],R=this.shape[2],P=this.shape[3],z=this.stride[0],F=this.stride[1],B=this.stride[2],O=this.stride[3],L=this.offset,N=0,U=Math.ceil;return typeof _=="number"&&(N=_|0,N<0?(L+=z*(g-1),g=U(-g/N)):g=U(g/N),z*=N),typeof w=="number"&&(N=w|0,N<0?(L+=F*(m-1),m=U(-m/N)):m=U(m/N),F*=N),typeof p=="number"&&(N=p|0,N<0?(L+=B*(R-1),R=U(-R/N)):R=U(R/N),B*=N),typeof u=="number"&&(N=u|0,N<0?(L+=O*(P-1),P=U(-P/N)):P=U(P/N),O*=N),new b(this.data,g,m,R,P,z,F,B,O,L)},S.transpose=function(_,w,p,u){_=_===void 0?0:_|0,w=w===void 0?1:w|0,p=p===void 0?2:p|0,u=u===void 0?3:u|0;var g=this.shape,m=this.stride;return new b(this.data,g[_],g[w],g[p],g[u],m[_],m[w],m[p],m[u],this.offset)},S.pick=function(_,w,p,u){var g=[],m=[],R=this.offset;typeof _=="number"&&_>=0?R=R+this.stride[0]*_|0:(g.push(this.shape[0]),m.push(this.stride[0])),typeof w=="number"&&w>=0?R=R+this.stride[1]*w|0:(g.push(this.shape[1]),m.push(this.stride[1])),typeof p=="number"&&p>=0?R=R+this.stride[2]*p|0:(g.push(this.shape[2]),m.push(this.stride[2])),typeof u=="number"&&u>=0?R=R+this.stride[3]*u|0:(g.push(this.shape[3]),m.push(this.stride[3]));var P=l[g.length+1];return P(this.data,g,m,R)},function(_,w,p,u){return new b(_,w[0],w[1],w[2],w[3],p[0],p[1],p[2],p[3],u)}},5:function(l,y,b){function S(_,w,p,u,g,m,R,P,z,F,B,O){this.data=_,this.shape=[w,p,u,g,m],this.stride=[R,P,z,F,B],this.offset=O|0}var M=S.prototype;return M.dtype=l,M.dimension=5,Object.defineProperty(M,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(M,"order",{get:b}),M.set=function(w,p,u,g,m,R){return l==="generic"?this.data.set(this.offset+this.stride[0]*w+this.stride[1]*p+this.stride[2]*u+this.stride[3]*g+this.stride[4]*m,R):this.data[this.offset+this.stride[0]*w+this.stride[1]*p+this.stride[2]*u+this.stride[3]*g+this.stride[4]*m]=R},M.get=function(w,p,u,g,m){return l==="generic"?this.data.get(this.offset+this.stride[0]*w+this.stride[1]*p+this.stride[2]*u+this.stride[3]*g+this.stride[4]*m):this.data[this.offset+this.stride[0]*w+this.stride[1]*p+this.stride[2]*u+this.stride[3]*g+this.stride[4]*m]},M.index=function(w,p,u,g,m){return this.offset+this.stride[0]*w+this.stride[1]*p+this.stride[2]*u+this.stride[3]*g+this.stride[4]*m},M.hi=function(w,p,u,g,m){return new S(this.data,typeof w!="number"||w<0?this.shape[0]:w|0,typeof p!="number"||p<0?this.shape[1]:p|0,typeof u!="number"||u<0?this.shape[2]:u|0,typeof g!="number"||g<0?this.shape[3]:g|0,typeof m!="number"||m<0?this.shape[4]:m|0,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},M.lo=function(w,p,u,g,m){var R=this.offset,P=0,z=this.shape[0],F=this.shape[1],B=this.shape[2],O=this.shape[3],L=this.shape[4],N=this.stride[0],U=this.stride[1],Z=this.stride[2],Q=this.stride[3],ue=this.stride[4];return typeof w=="number"&&w>=0&&(P=w|0,R+=N*P,z-=P),typeof p=="number"&&p>=0&&(P=p|0,R+=U*P,F-=P),typeof u=="number"&&u>=0&&(P=u|0,R+=Z*P,B-=P),typeof g=="number"&&g>=0&&(P=g|0,R+=Q*P,O-=P),typeof m=="number"&&m>=0&&(P=m|0,R+=ue*P,L-=P),new S(this.data,z,F,B,O,L,N,U,Z,Q,ue,R)},M.step=function(w,p,u,g,m){var R=this.shape[0],P=this.shape[1],z=this.shape[2],F=this.shape[3],B=this.shape[4],O=this.stride[0],L=this.stride[1],N=this.stride[2],U=this.stride[3],Z=this.stride[4],Q=this.offset,ue=0,oe=Math.ceil;return typeof w=="number"&&(ue=w|0,ue<0?(Q+=O*(R-1),R=oe(-R/ue)):R=oe(R/ue),O*=ue),typeof p=="number"&&(ue=p|0,ue<0?(Q+=L*(P-1),P=oe(-P/ue)):P=oe(P/ue),L*=ue),typeof u=="number"&&(ue=u|0,ue<0?(Q+=N*(z-1),z=oe(-z/ue)):z=oe(z/ue),N*=ue),typeof g=="number"&&(ue=g|0,ue<0?(Q+=U*(F-1),F=oe(-F/ue)):F=oe(F/ue),U*=ue),typeof m=="number"&&(ue=m|0,ue<0?(Q+=Z*(B-1),B=oe(-B/ue)):B=oe(B/ue),Z*=ue),new S(this.data,R,P,z,F,B,O,L,N,U,Z,Q)},M.transpose=function(w,p,u,g,m){w=w===void 0?0:w|0,p=p===void 0?1:p|0,u=u===void 0?2:u|0,g=g===void 0?3:g|0,m=m===void 0?4:m|0;var R=this.shape,P=this.stride;return new S(this.data,R[w],R[p],R[u],R[g],R[m],P[w],P[p],P[u],P[g],P[m],this.offset)},M.pick=function(w,p,u,g,m){var R=[],P=[],z=this.offset;typeof w=="number"&&w>=0?z=z+this.stride[0]*w|0:(R.push(this.shape[0]),P.push(this.stride[0])),typeof p=="number"&&p>=0?z=z+this.stride[1]*p|0:(R.push(this.shape[1]),P.push(this.stride[1])),typeof u=="number"&&u>=0?z=z+this.stride[2]*u|0:(R.push(this.shape[2]),P.push(this.stride[2])),typeof g=="number"&&g>=0?z=z+this.stride[3]*g|0:(R.push(this.shape[3]),P.push(this.stride[3])),typeof m=="number"&&m>=0?z=z+this.stride[4]*m|0:(R.push(this.shape[4]),P.push(this.stride[4]));var F=y[R.length+1];return F(this.data,R,P,z)},function(w,p,u,g){return new S(w,p[0],p[1],p[2],p[3],p[4],u[0],u[1],u[2],u[3],u[4],g)}}};function c(T,l){var y=l===-1?"T":String(l),b=s[y];return l===-1?b(T):l===0?b(T,v[T][0]):b(T,v[T],n)}function f(T){if(o(T))return"buffer";if(a)switch(Object.prototype.toString.call(T)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(T)?"array":"generic"}var v={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};function h(T,l,y,b){if(T===void 0){var u=v.array[0];return u([])}else typeof T=="number"&&(T=[T]);l===void 0&&(l=[T.length]);var S=l.length;if(y===void 0){y=new Array(S);for(var M=S-1,_=1;M>=0;--M)y[M]=_,_*=l[M]}if(b===void 0){b=0;for(var M=0;M>>0;e.exports=n;function n(s,c){if(isNaN(s)||isNaN(c))return NaN;if(s===c)return s;if(s===0)return c<0?-a:a;var f=o.hi(s),v=o.lo(s);return c>s==s>0?v===i?(f+=1,v=0):v+=1:v===0?(v=i,f-=1):v-=1,o.pack(v,f)}},8406:function(e,t){var r=1e-6,o=1e-6;t.vertexNormals=function(a,i,n){for(var s=i.length,c=new Array(s),f=n===void 0?r:n,v=0;vf)for(var R=c[l],P=1/Math.sqrt(p*g),m=0;m<3;++m){var z=(m+1)%3,F=(m+2)%3;R[m]+=P*(u[z]*w[F]-u[F]*w[z])}}for(var v=0;vf)for(var P=1/Math.sqrt(B),m=0;m<3;++m)R[m]*=P;else for(var m=0;m<3;++m)R[m]=0}return c},t.faceNormals=function(a,i,n){for(var s=a.length,c=new Array(s),f=n===void 0?o:n,v=0;vf?M=1/Math.sqrt(M):M=0;for(var l=0;l<3;++l)S[l]*=M;c[v]=S}return c}},4081:function(e){e.exports=t;function t(r,o,a,i,n,s,c,f,v,h){var T=o+s+h;if(l>0){var l=Math.sqrt(T+1);r[0]=.5*(c-v)/l,r[1]=.5*(f-i)/l,r[2]=.5*(a-s)/l,r[3]=.5*l}else{var y=Math.max(o,s,h),l=Math.sqrt(2*y-T+1);o>=y?(r[0]=.5*l,r[1]=.5*(n+a)/l,r[2]=.5*(f+i)/l,r[3]=.5*(c-v)/l):s>=y?(r[0]=.5*(a+n)/l,r[1]=.5*l,r[2]=.5*(v+c)/l,r[3]=.5*(f-i)/l):(r[0]=.5*(i+f)/l,r[1]=.5*(c+v)/l,r[2]=.5*l,r[3]=.5*(a-n)/l)}return r}},9977:function(e,t,r){e.exports=l;var o=r(9215),a=r(6582),i=r(7399),n=r(7608),s=r(4081);function c(y,b,S){return Math.sqrt(Math.pow(y,2)+Math.pow(b,2)+Math.pow(S,2))}function f(y,b,S,M){return Math.sqrt(Math.pow(y,2)+Math.pow(b,2)+Math.pow(S,2)+Math.pow(M,2))}function v(y,b){var S=b[0],M=b[1],_=b[2],w=b[3],p=f(S,M,_,w);p>1e-6?(y[0]=S/p,y[1]=M/p,y[2]=_/p,y[3]=w/p):(y[0]=y[1]=y[2]=0,y[3]=1)}function h(y,b,S){this.radius=o([S]),this.center=o(b),this.rotation=o(y),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 T=h.prototype;T.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},T.recalcMatrix=function(y){this.radius.curve(y),this.center.curve(y),this.rotation.curve(y);var b=this.computedRotation;v(b,b);var S=this.computedMatrix;i(S,b);var M=this.computedCenter,_=this.computedEye,w=this.computedUp,p=Math.exp(this.computedRadius[0]);_[0]=M[0]+p*S[2],_[1]=M[1]+p*S[6],_[2]=M[2]+p*S[10],w[0]=S[1],w[1]=S[5],w[2]=S[9];for(var u=0;u<3;++u){for(var g=0,m=0;m<3;++m)g+=S[u+4*m]*_[m];S[12+u]=-g}},T.getMatrix=function(y,b){this.recalcMatrix(y);var S=this.computedMatrix;if(b){for(var M=0;M<16;++M)b[M]=S[M];return b}return S},T.idle=function(y){this.center.idle(y),this.radius.idle(y),this.rotation.idle(y)},T.flush=function(y){this.center.flush(y),this.radius.flush(y),this.rotation.flush(y)},T.pan=function(y,b,S,M){b=b||0,S=S||0,M=M||0,this.recalcMatrix(y);var _=this.computedMatrix,w=_[1],p=_[5],u=_[9],g=c(w,p,u);w/=g,p/=g,u/=g;var m=_[0],R=_[4],P=_[8],z=m*w+R*p+P*u;m-=w*z,R-=p*z,P-=u*z;var F=c(m,R,P);m/=F,R/=F,P/=F,_[2],_[6],_[10];var B=m*b+w*S,O=R*b+p*S,L=P*b+u*S;this.center.move(y,B,O,L);var N=Math.exp(this.computedRadius[0]);N=Math.max(1e-4,N+M),this.radius.set(y,Math.log(N))},T.rotate=function(y,b,S,M){this.recalcMatrix(y),b=b||0,S=S||0;var _=this.computedMatrix,w=_[0],p=_[4],u=_[8],g=_[1],m=_[5],R=_[9],P=_[2],z=_[6],F=_[10],B=b*w+S*g,O=b*p+S*m,L=b*u+S*R,N=-(z*L-F*O),U=-(F*B-P*L),Z=-(P*O-z*B),Q=Math.sqrt(Math.max(0,1-Math.pow(N,2)-Math.pow(U,2)-Math.pow(Z,2))),ue=f(N,U,Z,Q);ue>1e-6?(N/=ue,U/=ue,Z/=ue,Q/=ue):(N=U=Z=0,Q=1);var oe=this.computedRotation,le=oe[0],j=oe[1],J=oe[2],$=oe[3],X=le*Q+$*N+j*Z-J*U,re=j*Q+$*U+J*N-le*Z,ee=J*Q+$*Z+le*U-j*N,q=$*Q-le*N-j*U-J*Z;if(M){N=P,U=z,Z=F;var ae=Math.sin(M)/c(N,U,Z);N*=ae,U*=ae,Z*=ae,Q=Math.cos(b),X=X*Q+q*N+re*Z-ee*U,re=re*Q+q*U+ee*N-X*Z,ee=ee*Q+q*Z+X*U-re*N,q=q*Q-X*N-re*U-ee*Z}var ie=f(X,re,ee,q);ie>1e-6?(X/=ie,re/=ie,ee/=ie,q/=ie):(X=re=ee=0,q=1),this.rotation.set(y,X,re,ee,q)},T.lookAt=function(y,b,S,M){this.recalcMatrix(y),S=S||this.computedCenter,b=b||this.computedEye,M=M||this.computedUp;var _=this.computedMatrix;a(_,b,S,M);var w=this.computedRotation;s(w,_[0],_[1],_[2],_[4],_[5],_[6],_[8],_[9],_[10]),v(w,w),this.rotation.set(y,w[0],w[1],w[2],w[3]);for(var p=0,u=0;u<3;++u)p+=Math.pow(S[u]-b[u],2);this.radius.set(y,.5*Math.log(Math.max(p,1e-6))),this.center.set(y,S[0],S[1],S[2])},T.translate=function(y,b,S,M){this.center.move(y,b||0,S||0,M||0)},T.setMatrix=function(y,b){var S=this.computedRotation;s(S,b[0],b[1],b[2],b[4],b[5],b[6],b[8],b[9],b[10]),v(S,S),this.rotation.set(y,S[0],S[1],S[2],S[3]);var M=this.computedMatrix;n(M,b);var _=M[15];if(Math.abs(_)>1e-6){var w=M[12]/_,p=M[13]/_,u=M[14]/_;this.recalcMatrix(y);var g=Math.exp(this.computedRadius[0]);this.center.set(y,w-M[2]*g,p-M[6]*g,u-M[10]*g),this.radius.idle(y)}else this.center.idle(y),this.radius.idle(y)},T.setDistance=function(y,b){b>0&&this.radius.set(y,Math.log(b))},T.setDistanceLimits=function(y,b){y>0?y=Math.log(y):y=-1/0,b>0?b=Math.log(b):b=1/0,b=Math.max(b,y),this.radius.bounds[0][0]=y,this.radius.bounds[1][0]=b},T.getDistanceLimits=function(y){var b=this.radius.bounds;return y?(y[0]=Math.exp(b[0][0]),y[1]=Math.exp(b[1][0]),y):[Math.exp(b[0][0]),Math.exp(b[1][0])]},T.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]}},T.fromJSON=function(y){var b=this.lastT(),S=y.center;S&&this.center.set(b,S[0],S[1],S[2]);var M=y.rotation;M&&this.rotation.set(b,M[0],M[1],M[2],M[3]);var _=y.distance;_&&_>0&&this.radius.set(b,Math.log(_)),this.setDistanceLimits(y.zoomMin,y.zoomMax)};function l(y){y=y||{};var b=y.center||[0,0,0],S=y.rotation||[0,0,0,1],M=y.radius||1;b=[].slice.call(b,0,3),S=[].slice.call(S,0,4),v(S,S);var _=new h(S,b,Math.log(M));return _.setDistanceLimits(y.zoomMin,y.zoomMax),("eye"in y||"up"in y)&&_.lookAt(0,y.eye,y.center,y.up),_}},1371:function(e,t,r){var o=r(3233);e.exports=function(i,n,s){return s=typeof s<"u"?s+"":" ",o(s,n)+i}},3202:function(e){e.exports=function(r,o){o||(o=[0,""]),r=String(r);var a=parseFloat(r,10);return o[0]=a,o[1]=r.match(/[\d.\-\+]*\s*(.*)/)[1]||"",o}},3088:function(e,t,r){e.exports=a;var o=r(3140);function a(i,n){for(var s=n.length|0,c=i.length,f=[new Array(s),new Array(s)],v=0;v0){m=f[z][u][0],P=z;break}R=m[P^1];for(var F=0;F<2;++F)for(var B=f[F][u],O=0;O0&&(m=L,R=N,P=F)}return g||m&&l(m,P),R}function b(p,u){var g=f[u][p][0],m=[p];l(g,u);for(var R=g[u^1];;){for(;R!==p;)m.push(R),R=y(m[m.length-2],R,!1);if(f[0][p].length+f[1][p].length===0)break;var P=m[m.length-1],z=p,F=m[1],B=y(P,z,!0);if(o(n[P],n[z],n[F],n[B])<0)break;m.push(p),R=y(P,z)}return m}function S(p,u){return u[1]===u[u.length-1]}for(var v=0;v0;){f[0][v].length;var w=b(v,M);S(_,w)?_.push.apply(_,w):(_.length>0&&T.push(_),_=w)}_.length>0&&T.push(_)}return T}},5609:function(e,t,r){e.exports=a;var o=r(3134);function a(i,n){for(var s=o(i,n.length),c=new Array(n.length),f=new Array(n.length),v=[],h=0;h0;){var l=v.pop();c[l]=!1;for(var y=s[l],h=0;h0}_=_.filter(w);for(var p=_.length,u=new Array(p),g=new Array(p),M=0;M0;){var ae=re.pop(),ie=Q[ae];c(ie,function(Ce,qe){return Ce-qe});var fe=ie.length,we=ee[ae],Ae;if(we===0){var B=_[ae];Ae=[B]}for(var M=0;M=0)&&(ee[Fe]=we^1,re.push(Fe),we===0)){var B=_[Fe];X(B)||(B.reverse(),Ae.push(B))}}we===0&&q.push(Ae)}return q}},5085:function(e,t,r){e.exports=y;var o=r(3250)[3],a=r(4209),i=r(3352),n=r(2478);function s(){return!0}function c(b){return function(S,M){var _=b[S];return _?!!_.queryPoint(M,s):!1}}function f(b){for(var S={},M=0;M0&&S[_]===M[0])w=b[_-1];else return 1;for(var p=1;w;){var u=w.key,g=o(M,u[0],u[1]);if(u[0][0]0)p=-1,w=w.right;else return 0;else if(g>0)w=w.left;else if(g<0)p=1,w=w.right;else return 0}return p}}function h(b){return 1}function T(b){return function(M){return b(M[0],M[1])?0:1}}function l(b,S){return function(_){return b(_[0],_[1])?0:S(_)}}function y(b){for(var S=b.length,M=[],_=[],w=0;w=h?(u=1,m=h+2*y+S):(u=-y/h,m=y*u+S)):(u=0,b>=0?(g=0,m=S):-b>=l?(g=1,m=l+2*b+S):(g=-b/l,m=b*g+S));else if(g<0)g=0,y>=0?(u=0,m=S):-y>=h?(u=1,m=h+2*y+S):(u=-y/h,m=y*u+S);else{var R=1/p;u*=R,g*=R,m=u*(h*u+T*g+2*y)+g*(T*u+l*g+2*b)+S}else{var P,z,F,B;u<0?(P=T+y,z=l+b,z>P?(F=z-P,B=h-2*T+l,F>=B?(u=1,g=0,m=h+2*y+S):(u=F/B,g=1-u,m=u*(h*u+T*g+2*y)+g*(T*u+l*g+2*b)+S)):(u=0,z<=0?(g=1,m=l+2*b+S):b>=0?(g=0,m=S):(g=-b/l,m=b*g+S))):g<0?(P=T+b,z=h+y,z>P?(F=z-P,B=h-2*T+l,F>=B?(g=1,u=0,m=l+2*b+S):(g=F/B,u=1-g,m=u*(h*u+T*g+2*y)+g*(T*u+l*g+2*b)+S)):(g=0,z<=0?(u=1,m=h+2*y+S):y>=0?(u=0,m=S):(u=-y/h,m=y*u+S))):(F=l+b-T-y,F<=0?(u=0,g=1,m=l+2*b+S):(B=h-2*T+l,F>=B?(u=1,g=0,m=h+2*y+S):(u=F/B,g=1-u,m=u*(h*u+T*g+2*y)+g*(T*u+l*g+2*b)+S)))}for(var O=1-u-g,v=0;v0){var l=s[f-1];if(o(h,l)===0&&i(l)!==T){f-=1;continue}}s[f++]=h}}return s.length=f,s}},3233:function(e){var t="",r;e.exports=o;function o(a,i){if(typeof a!="string")throw new TypeError("expected a string");if(i===1)return a;if(i===2)return a+a;var n=a.length*i;if(r!==a||typeof r>"u")r=a,t="";else if(t.length>=n)return t.substr(0,n);for(;n>t.length&&i>1;)i&1&&(t+=a),i>>=1,a+=a;return t+=a,t=t.substr(0,n),t}},3025:function(e,t,r){e.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(e){e.exports=t;function t(r){for(var o=r.length,a=r[r.length-1],i=o,n=o-2;n>=0;--n){var s=a,c=r[n];a=s+c;var f=a-s,v=c-f;v&&(r[--i]=a,a=v)}for(var h=0,n=i;n0){if(z<=0)return F;B=P+z}else if(P<0){if(z>=0)return F;B=-(P+z)}else return F;var O=f*B;return F>=O||F<=-O?F:b(g,m,R)},function(g,m,R,P){var z=g[0]-P[0],F=m[0]-P[0],B=R[0]-P[0],O=g[1]-P[1],L=m[1]-P[1],N=R[1]-P[1],U=g[2]-P[2],Z=m[2]-P[2],Q=R[2]-P[2],ue=F*N,oe=B*L,le=B*O,j=z*N,J=z*L,$=F*O,X=U*(ue-oe)+Z*(le-j)+Q*(J-$),re=(Math.abs(ue)+Math.abs(oe))*Math.abs(U)+(Math.abs(le)+Math.abs(j))*Math.abs(Z)+(Math.abs(J)+Math.abs($))*Math.abs(Q),ee=v*re;return X>ee||-X>ee?X:S(g,m,R,P)}];function _(u){var g=M[u.length];return g||(g=M[u.length]=y(u.length)),g.apply(void 0,u)}function w(u,g,m,R,P,z,F){return function(O,L,N,U,Z){switch(arguments.length){case 0:case 1:return 0;case 2:return R(O,L);case 3:return P(O,L,N);case 4:return z(O,L,N,U);case 5:return F(O,L,N,U,Z)}for(var Q=new Array(arguments.length),ue=0;ue0&&h>0||v<0&&h<0)return!1;var T=o(c,n,s),l=o(f,n,s);return T>0&&l>0||T<0&&l<0?!1:v===0&&h===0&&T===0&&l===0?a(n,s,c,f):!0}},8545:function(e){e.exports=r;function t(o,a){var i=o+a,n=i-o,s=i-n,c=a-n,f=o-s,v=f+c;return v?[v,i]:[i]}function r(o,a){var i=o.length|0,n=a.length|0;if(i===1&&n===1)return t(o[0],-a[0]);var s=i+n,c=new Array(s),f=0,v=0,h=0,T=Math.abs,l=o[v],y=T(l),b=-a[h],S=T(b),M,_;y=n?(M=l,v+=1,v=n?(M=l,v+=1,v"u"&&(M=s(y));var _=y.length;if(_===0||M<1)return{cells:[],vertexIds:[],vertexWeights:[]};var w=c(b,+S),p=f(y,M),u=v(p,b,w,+S),g=h(p,b.length|0),m=n(M)(y,p.data,g,w),R=T(p),P=[].slice.call(u.data,0,u.shape[0]);return a.free(w),a.free(p.data),a.free(u.data),a.free(g),{cells:m,vertexIds:R,vertexWeights:P}}},1570:function(e){e.exports=r;var t=[function(){function a(i,n,s,c){for(var f=i.length,v=[],h=0;h>1,b=s[2*y+1];if(b===h)return y;h>1,b=s[2*y+1];if(b===h)return y;h>1,b=s[2*y+1];if(b===h)return y;h0)-(i<0)},t.abs=function(i){var n=i>>r-1;return(i^n)-n},t.min=function(i,n){return n^(i^n)&-(i65535)<<4,i>>>=n,s=(i>255)<<3,i>>>=s,n|=s,s=(i>15)<<2,i>>>=s,n|=s,s=(i>3)<<1,i>>>=s,n|=s,n|i>>1},t.log10=function(i){return i>=1e9?9:i>=1e8?8:i>=1e7?7:i>=1e6?6:i>=1e5?5:i>=1e4?4:i>=1e3?3:i>=100?2:i>=10?1:0},t.popCount=function(i){return i=i-(i>>>1&1431655765),i=(i&858993459)+(i>>>2&858993459),(i+(i>>>4)&252645135)*16843009>>>24};function o(i){var n=32;return i&=-i,i&&n--,i&65535&&(n-=16),i&16711935&&(n-=8),i&252645135&&(n-=4),i&858993459&&(n-=2),i&1431655765&&(n-=1),n}t.countTrailingZeros=o,t.nextPow2=function(i){return i+=i===0,--i,i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i+1},t.prevPow2=function(i){return i|=i>>>1,i|=i>>>2,i|=i>>>4,i|=i>>>8,i|=i>>>16,i-(i>>>1)},t.parity=function(i){return i^=i>>>16,i^=i>>>8,i^=i>>>4,i&=15,27030>>>i&1};var a=new Array(256);(function(i){for(var n=0;n<256;++n){var s=n,c=n,f=7;for(s>>>=1;s;s>>>=1)c<<=1,c|=s&1,--f;i[n]=c<>>8&255]<<16|a[i>>>16&255]<<8|a[i>>>24&255]},t.interleave2=function(i,n){return i&=65535,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,n&=65535,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,i|n<<1},t.deinterleave2=function(i,n){return i=i>>>n&1431655765,i=(i|i>>>1)&858993459,i=(i|i>>>2)&252645135,i=(i|i>>>4)&16711935,i=(i|i>>>16)&65535,i<<16>>16},t.interleave3=function(i,n,s){return i&=1023,i=(i|i<<16)&4278190335,i=(i|i<<8)&251719695,i=(i|i<<4)&3272356035,i=(i|i<<2)&1227133513,n&=1023,n=(n|n<<16)&4278190335,n=(n|n<<8)&251719695,n=(n|n<<4)&3272356035,n=(n|n<<2)&1227133513,i|=n<<1,s&=1023,s=(s|s<<16)&4278190335,s=(s|s<<8)&251719695,s=(s|s<<4)&3272356035,s=(s|s<<2)&1227133513,i|s<<2},t.deinterleave3=function(i,n){return i=i>>>n&1227133513,i=(i|i>>>2)&3272356035,i=(i|i>>>4)&251719695,i=(i|i>>>8)&4278190335,i=(i|i>>>16)&1023,i<<22>>22},t.nextCombination=function(i){var n=i|i-1;return n+1|(~n&-~n)-1>>>o(i)+1}},2014:function(e,t,r){"use restrict";var o=r(3105),a=r(4623);function i(u){for(var g=0,m=Math.max,R=0,P=u.length;R>1,F=c(u[z],g);F<=0?(F===0&&(P=z),m=z+1):F>0&&(R=z-1)}return P}t.findCell=T;function l(u,g){for(var m=new Array(u.length),R=0,P=m.length;R=u.length||c(u[Q],z)!==0););}return m}t.incidence=l;function y(u,g){if(!g)return l(h(S(u,0)),u);for(var m=new Array(g),R=0;R>>L&1&&O.push(P[L]);g.push(O)}return v(g)}t.explode=b;function S(u,g){if(g<0)return[];for(var m=[],R=(1<>1:(le>>1)-1}function R(le){for(var j=g(le);;){var J=j,$=2*le+1,X=2*(le+1),re=le;if($0;){var J=m(le);if(J>=0){var $=g(J);if(j<$){u(le,J),le=J;continue}}return le}}function z(){if(U>0){var le=O[0];return u(0,U-1),U-=1,R(0),le}return-1}function F(le,j){var J=O[le];return y[J]===j?le:(y[J]=-1/0,P(le),z(),y[J]=j,U+=1,P(U-1))}function B(le){if(!b[le]){b[le]=!0;var j=T[le],J=l[le];T[J]>=0&&(T[J]=j),l[j]>=0&&(l[j]=J),L[j]>=0&&F(L[j],p(j)),L[J]>=0&&F(L[J],p(J))}}for(var O=[],L=new Array(v),S=0;S>1;S>=0;--S)R(S);for(;;){var Z=z();if(Z<0||y[Z]>f)break;B(Z)}for(var Q=[],S=0;S=0&&J>=0&&j!==J){var $=L[j],X=L[J];$!==X&&oe.push([$,X])}}),a.unique(a.normalize(oe)),{positions:Q,edges:oe}}},1303:function(e,t,r){e.exports=i;var o=r(3250);function a(n,s){var c,f;if(s[0][0]s[1][0])c=s[1],f=s[0];else{var v=Math.min(n[0][1],n[1][1]),h=Math.max(n[0][1],n[1][1]),T=Math.min(s[0][1],s[1][1]),l=Math.max(s[0][1],s[1][1]);return hl?v-l:h-l}var y,b;n[0][1]s[1][0])c=s[1],f=s[0];else return a(s,n);var v,h;if(n[0][0]n[1][0])v=n[1],h=n[0];else return-a(n,s);var T=o(c,f,h),l=o(c,f,v);if(T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;if(T=o(h,v,f),l=o(h,v,c),T<0){if(l<=0)return T}else if(T>0){if(l>=0)return T}else if(l)return l;return f[0]-h[0]}},4209:function(e,t,r){e.exports=l;var o=r(2478),a=r(3840),i=r(3250),n=r(1303);function s(y,b,S){this.slabs=y,this.coordinates=b,this.horizontal=S}var c=s.prototype;function f(y,b){return y.y-b}function v(y,b){for(var S=null;y;){var M=y.key,_,w;M[0][0]0)if(b[0]!==M[1][0])S=y,y=y.right;else{var u=v(y.right,b);if(u)return u;y=y.left}else{if(b[0]!==M[1][0])return y;var u=v(y.right,b);if(u)return u;y=y.left}}return S}c.castUp=function(y){var b=o.le(this.coordinates,y[0]);if(b<0)return-1;this.slabs[b];var S=v(this.slabs[b],y),M=-1;if(S&&(M=S.value),this.coordinates[b]===y[0]){var _=null;if(S&&(_=S.key),b>0){var w=v(this.slabs[b-1],y);w&&(_?n(w.key,_)>0&&(_=w.key,M=w.value):(M=w.value,_=w.key))}var p=this.horizontal[b];if(p.length>0){var u=o.ge(p,y[1],f);if(u=p.length)return M;g=p[u]}}if(g.start)if(_){var m=i(_[0],_[1],[y[0],g.y]);_[0][0]>_[1][0]&&(m=-m),m>0&&(M=g.index)}else M=g.index;else g.y!==y[1]&&(M=g.index)}}}return M};function h(y,b,S,M){this.y=y,this.index=b,this.start=S,this.closed=M}function T(y,b,S,M){this.x=y,this.segment=b,this.create=S,this.index=M}function l(y){for(var b=y.length,S=2*b,M=new Array(S),_=0;_1&&(b=1);for(var S=1-b,M=v.length,_=new Array(M),w=0;w0||y>0&&_<0){var w=n(b,_,S,y);T.push(w),l.push(w.slice())}_<0?l.push(S.slice()):_>0?T.push(S.slice()):(T.push(S.slice()),l.push(S.slice())),y=_}return{positive:T,negative:l}}function c(v,h){for(var T=[],l=i(v[v.length-1],h),y=v[v.length-1],b=v[0],S=0;S0||l>0&&M<0)&&T.push(n(y,M,b,l)),M>=0&&T.push(b.slice()),l=M}return T}function f(v,h){for(var T=[],l=i(v[v.length-1],h),y=v[v.length-1],b=v[0],S=0;S0||l>0&&M<0)&&T.push(n(y,M,b,l)),M<=0&&T.push(b.slice()),l=M}return T}},3387:function(e,t,r){var o;(function(){var a={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 i(v){return s(f(v),arguments)}function n(v,h){return i.apply(null,[v].concat(h||[]))}function s(v,h){var T=1,l=v.length,y,b="",S,M,_,w,p,u,g,m;for(S=0;S=0),_.type){case"b":y=parseInt(y,10).toString(2);break;case"c":y=String.fromCharCode(parseInt(y,10));break;case"d":case"i":y=parseInt(y,10);break;case"j":y=JSON.stringify(y,null,_.width?parseInt(_.width):0);break;case"e":y=_.precision?parseFloat(y).toExponential(_.precision):parseFloat(y).toExponential();break;case"f":y=_.precision?parseFloat(y).toFixed(_.precision):parseFloat(y);break;case"g":y=_.precision?String(Number(y.toPrecision(_.precision))):parseFloat(y);break;case"o":y=(parseInt(y,10)>>>0).toString(8);break;case"s":y=String(y),y=_.precision?y.substring(0,_.precision):y;break;case"t":y=String(!!y),y=_.precision?y.substring(0,_.precision):y;break;case"T":y=Object.prototype.toString.call(y).slice(8,-1).toLowerCase(),y=_.precision?y.substring(0,_.precision):y;break;case"u":y=parseInt(y,10)>>>0;break;case"v":y=y.valueOf(),y=_.precision?y.substring(0,_.precision):y;break;case"x":y=(parseInt(y,10)>>>0).toString(16);break;case"X":y=(parseInt(y,10)>>>0).toString(16).toUpperCase();break}a.json.test(_.type)?b+=y:(a.number.test(_.type)&&(!g||_.sign)?(m=g?"+":"-",y=y.toString().replace(a.sign,"")):m="",p=_.pad_char?_.pad_char==="0"?"0":_.pad_char.charAt(1):" ",u=_.width-(m+y).length,w=_.width&&u>0?p.repeat(u):"",b+=_.align?m+y+w:p==="0"?m+w+y:w+m+y)}return b}var c=Object.create(null);function f(v){if(c[v])return c[v];for(var h=v,T,l=[],y=0;h;){if((T=a.text.exec(h))!==null)l.push(T[0]);else if((T=a.modulo.exec(h))!==null)l.push("%");else if((T=a.placeholder.exec(h))!==null){if(T[2]){y|=1;var b=[],S=T[2],M=[];if((M=a.key.exec(S))!==null)for(b.push(M[1]);(S=S.substring(M[0].length))!=="";)if((M=a.key_access.exec(S))!==null)b.push(M[1]);else if((M=a.index_access.exec(S))!==null)b.push(M[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");T[2]=b}else y|=2;if(y===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");l.push({placeholder:T[0],param_no:T[1],keys:T[2],sign:T[3],pad_char:T[4],align:T[5],width:T[6],precision:T[7],type:T[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");h=h.substring(T[0].length)}return c[v]=l}t.sprintf=i,t.vsprintf=n,typeof window<"u"&&(window.sprintf=i,window.vsprintf=n,o=(function(){return{sprintf:i,vsprintf:n}}).call(t,r,t,e),o!==void 0&&(e.exports=o))})()},3711:function(e,t,r){e.exports=f;var o=r(2640),a=r(781),i={"2d":function(v,h,T){var l=v({order:h,scalarArguments:3,getters:T==="generic"?[0]:void 0,phase:function(b,S,M,_){return b>_|0},vertex:function(b,S,M,_,w,p,u,g,m,R,P,z,F){var B=(u<<0)+(g<<1)+(m<<2)+(R<<3)|0;if(!(B===0||B===15))switch(B){case 0:P.push([b-.5,S-.5]);break;case 1:P.push([b-.25-.25*(_+M-2*F)/(M-_),S-.25-.25*(w+M-2*F)/(M-w)]);break;case 2:P.push([b-.75-.25*(-_-M+2*F)/(_-M),S-.25-.25*(p+_-2*F)/(_-p)]);break;case 3:P.push([b-.5,S-.5-.5*(w+M+p+_-4*F)/(M-w+_-p)]);break;case 4:P.push([b-.25-.25*(p+w-2*F)/(w-p),S-.75-.25*(-w-M+2*F)/(w-M)]);break;case 5:P.push([b-.5-.5*(_+M+p+w-4*F)/(M-_+w-p),S-.5]);break;case 6:P.push([b-.5-.25*(-_-M+p+w)/(_-M+w-p),S-.5-.25*(-w-M+p+_)/(w-M+_-p)]);break;case 7:P.push([b-.75-.25*(p+w-2*F)/(w-p),S-.75-.25*(p+_-2*F)/(_-p)]);break;case 8:P.push([b-.75-.25*(-p-w+2*F)/(p-w),S-.75-.25*(-p-_+2*F)/(p-_)]);break;case 9:P.push([b-.5-.25*(_+M+-p-w)/(M-_+p-w),S-.5-.25*(w+M+-p-_)/(M-w+p-_)]);break;case 10:P.push([b-.5-.5*(-_-M+-p-w+4*F)/(_-M+p-w),S-.5]);break;case 11:P.push([b-.25-.25*(-p-w+2*F)/(p-w),S-.75-.25*(w+M-2*F)/(M-w)]);break;case 12:P.push([b-.5,S-.5-.5*(-w-M+-p-_+4*F)/(w-M+p-_)]);break;case 13:P.push([b-.75-.25*(_+M-2*F)/(M-_),S-.25-.25*(-p-_+2*F)/(p-_)]);break;case 14:P.push([b-.25-.25*(-_-M+2*F)/(_-M),S-.25-.25*(-w-M+2*F)/(w-M)]);break;case 15:P.push([b-.5,S-.5]);break}},cell:function(b,S,M,_,w,p,u,g,m){w?g.push([b,S]):g.push([S,b])}});return function(y,b){var S=[],M=[];return l(y,S,M,b),{positions:S,cells:M}}}};function n(v,h){var T=v.length+"d",l=i[T];if(l)return l(o,v,h)}function s(v,h){for(var T=a(v,h),l=T.length,y=new Array(l),b=new Array(l),S=0;SMath.max(_,w)?p[2]=1:_>Math.max(M,w)?p[0]=1:p[1]=1;for(var u=0,g=0,m=0;m<3;++m)u+=S[m]*S[m],g+=p[m]*S[m];for(var m=0;m<3;++m)p[m]-=g/u*S[m];return s(p,p),p}function T(S,M,_,w,p,u,g,m){this.center=o(_),this.up=o(w),this.right=o(p),this.radius=o([u]),this.angle=o([g,m]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(S,M),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 R=0;R<16;++R)this.computedMatrix[R]=.5;this.recalcMatrix(0)}var l=T.prototype;l.setDistanceLimits=function(S,M){S>0?S=Math.log(S):S=-1/0,M>0?M=Math.log(M):M=1/0,M=Math.max(M,S),this.radius.bounds[0][0]=S,this.radius.bounds[1][0]=M},l.getDistanceLimits=function(S){var M=this.radius.bounds[0];return S?(S[0]=Math.exp(M[0][0]),S[1]=Math.exp(M[1][0]),S):[Math.exp(M[0][0]),Math.exp(M[1][0])]},l.recalcMatrix=function(S){this.center.curve(S),this.up.curve(S),this.right.curve(S),this.radius.curve(S),this.angle.curve(S);for(var M=this.computedUp,_=this.computedRight,w=0,p=0,u=0;u<3;++u)p+=M[u]*_[u],w+=M[u]*M[u];for(var g=Math.sqrt(w),m=0,u=0;u<3;++u)_[u]-=M[u]*p/w,m+=_[u]*_[u],M[u]/=g;for(var R=Math.sqrt(m),u=0;u<3;++u)_[u]/=R;var P=this.computedToward;n(P,M,_),s(P,P);for(var z=Math.exp(this.computedRadius[0]),F=this.computedAngle[0],B=this.computedAngle[1],O=Math.cos(F),L=Math.sin(F),N=Math.cos(B),U=Math.sin(B),Z=this.computedCenter,Q=O*N,ue=L*N,oe=U,le=-O*U,j=-L*U,J=N,$=this.computedEye,X=this.computedMatrix,u=0;u<3;++u){var re=Q*_[u]+ue*P[u]+oe*M[u];X[4*u+1]=le*_[u]+j*P[u]+J*M[u],X[4*u+2]=re,X[4*u+3]=0}var ee=X[1],q=X[5],ae=X[9],ie=X[2],fe=X[6],we=X[10],Ae=q*we-ae*fe,Fe=ae*ie-ee*we,Ce=ee*fe-q*ie,qe=f(Ae,Fe,Ce);Ae/=qe,Fe/=qe,Ce/=qe,X[0]=Ae,X[4]=Fe,X[8]=Ce;for(var u=0;u<3;++u)$[u]=Z[u]+X[2+4*u]*z;for(var u=0;u<3;++u){for(var m=0,et=0;et<3;++et)m+=X[u+4*et]*$[et];X[12+u]=-m}X[15]=1},l.getMatrix=function(S,M){this.recalcMatrix(S);var _=this.computedMatrix;if(M){for(var w=0;w<16;++w)M[w]=_[w];return M}return _};var y=[0,0,0];l.rotate=function(S,M,_,w){if(this.angle.move(S,M,_),w){this.recalcMatrix(S);var p=this.computedMatrix;y[0]=p[2],y[1]=p[6],y[2]=p[10];for(var u=this.computedUp,g=this.computedRight,m=this.computedToward,R=0;R<3;++R)p[4*R]=u[R],p[4*R+1]=g[R],p[4*R+2]=m[R];i(p,p,w,y);for(var R=0;R<3;++R)u[R]=p[4*R],g[R]=p[4*R+1];this.up.set(S,u[0],u[1],u[2]),this.right.set(S,g[0],g[1],g[2])}},l.pan=function(S,M,_,w){M=M||0,_=_||0,w=w||0,this.recalcMatrix(S);var p=this.computedMatrix;Math.exp(this.computedRadius[0]);var u=p[1],g=p[5],m=p[9],R=f(u,g,m);u/=R,g/=R,m/=R;var P=p[0],z=p[4],F=p[8],B=P*u+z*g+F*m;P-=u*B,z-=g*B,F-=m*B;var O=f(P,z,F);P/=O,z/=O,F/=O;var L=P*M+u*_,N=z*M+g*_,U=F*M+m*_;this.center.move(S,L,N,U);var Z=Math.exp(this.computedRadius[0]);Z=Math.max(1e-4,Z+w),this.radius.set(S,Math.log(Z))},l.translate=function(S,M,_,w){this.center.move(S,M||0,_||0,w||0)},l.setMatrix=function(S,M,_,w){var p=1;typeof _=="number"&&(p=_|0),(p<0||p>3)&&(p=1);var u=(p+2)%3;M||(this.recalcMatrix(S),M=this.computedMatrix);var g=M[p],m=M[p+4],R=M[p+8];if(w){var z=Math.abs(g),F=Math.abs(m),B=Math.abs(R),O=Math.max(z,F,B);z===O?(g=g<0?-1:1,m=R=0):B===O?(R=R<0?-1:1,g=m=0):(m=m<0?-1:1,g=R=0)}else{var P=f(g,m,R);g/=P,m/=P,R/=P}var L=M[u],N=M[u+4],U=M[u+8],Z=L*g+N*m+U*R;L-=g*Z,N-=m*Z,U-=R*Z;var Q=f(L,N,U);L/=Q,N/=Q,U/=Q;var ue=m*U-R*N,oe=R*L-g*U,le=g*N-m*L,j=f(ue,oe,le);ue/=j,oe/=j,le/=j,this.center.jump(S,Me,xe,ce),this.radius.idle(S),this.up.jump(S,g,m,R),this.right.jump(S,L,N,U);var J,$;if(p===2){var X=M[1],re=M[5],ee=M[9],q=X*L+re*N+ee*U,ae=X*ue+re*oe+ee*le;Ae<0?J=-Math.PI/2:J=Math.PI/2,$=Math.atan2(ae,q)}else{var ie=M[2],fe=M[6],we=M[10],Ae=ie*g+fe*m+we*R,Fe=ie*L+fe*N+we*U,Ce=ie*ue+fe*oe+we*le;J=Math.asin(v(Ae)),$=Math.atan2(Ce,Fe)}this.angle.jump(S,$,J),this.recalcMatrix(S);var qe=M[2],et=M[6],Qe=M[10],Ke=this.computedMatrix;a(Ke,M);var Xe=Ke[15],Me=Ke[12]/Xe,xe=Ke[13]/Xe,ce=Ke[14]/Xe,Re=Math.exp(this.computedRadius[0]);this.center.jump(S,Me-qe*Re,xe-et*Re,ce-Qe*Re)},l.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},l.idle=function(S){this.center.idle(S),this.up.idle(S),this.right.idle(S),this.radius.idle(S),this.angle.idle(S)},l.flush=function(S){this.center.flush(S),this.up.flush(S),this.right.flush(S),this.radius.flush(S),this.angle.flush(S)},l.setDistance=function(S,M){M>0&&this.radius.set(S,Math.log(M))},l.lookAt=function(S,M,_,w){this.recalcMatrix(S),M=M||this.computedEye,_=_||this.computedCenter,w=w||this.computedUp;var p=w[0],u=w[1],g=w[2],m=f(p,u,g);if(!(m<1e-6)){p/=m,u/=m,g/=m;var R=M[0]-_[0],P=M[1]-_[1],z=M[2]-_[2],F=f(R,P,z);if(!(F<1e-6)){R/=F,P/=F,z/=F;var B=this.computedRight,O=B[0],L=B[1],N=B[2],U=p*O+u*L+g*N;O-=U*p,L-=U*u,N-=U*g;var Z=f(O,L,N);if(!(Z<.01&&(O=u*z-g*P,L=g*R-p*z,N=p*P-u*R,Z=f(O,L,N),Z<1e-6))){O/=Z,L/=Z,N/=Z,this.up.set(S,p,u,g),this.right.set(S,O,L,N),this.center.set(S,_[0],_[1],_[2]),this.radius.set(S,Math.log(F));var Q=u*N-g*L,ue=g*O-p*N,oe=p*L-u*O,le=f(Q,ue,oe);Q/=le,ue/=le,oe/=le;var j=p*R+u*P+g*z,J=O*R+L*P+N*z,$=Q*R+ue*P+oe*z,X=Math.asin(v(j)),re=Math.atan2($,J),ee=this.angle._state,q=ee[ee.length-1],ae=ee[ee.length-2];q=q%(2*Math.PI);var ie=Math.abs(q+2*Math.PI-re),fe=Math.abs(q-re),we=Math.abs(q-2*Math.PI-re);ie0?N.pop():new ArrayBuffer(O)}t.mallocArrayBuffer=y;function b(B){return new Uint8Array(y(B),0,B)}t.mallocUint8=b;function S(B){return new Uint16Array(y(2*B),0,B)}t.mallocUint16=S;function M(B){return new Uint32Array(y(4*B),0,B)}t.mallocUint32=M;function _(B){return new Int8Array(y(B),0,B)}t.mallocInt8=_;function w(B){return new Int16Array(y(2*B),0,B)}t.mallocInt16=w;function p(B){return new Int32Array(y(4*B),0,B)}t.mallocInt32=p;function u(B){return new Float32Array(y(4*B),0,B)}t.mallocFloat32=t.mallocFloat=u;function g(B){return new Float64Array(y(8*B),0,B)}t.mallocFloat64=t.mallocDouble=g;function m(B){return n?new Uint8ClampedArray(y(B),0,B):b(B)}t.mallocUint8Clamped=m;function R(B){return s?new BigUint64Array(y(8*B),0,B):null}t.mallocBigUint64=R;function P(B){return c?new BigInt64Array(y(8*B),0,B):null}t.mallocBigInt64=P;function z(B){return new DataView(y(B),0,B)}t.mallocDataView=z;function F(B){B=o.nextPow2(B);var O=o.log2(B),L=h[O];return L.length>0?L.pop():new i(B)}t.mallocBuffer=F,t.clearCache=function(){for(var O=0;O<32;++O)f.UINT8[O].length=0,f.UINT16[O].length=0,f.UINT32[O].length=0,f.INT8[O].length=0,f.INT16[O].length=0,f.INT32[O].length=0,f.FLOAT[O].length=0,f.DOUBLE[O].length=0,f.BIGUINT64[O].length=0,f.BIGINT64[O].length=0,f.UINT8C[O].length=0,v[O].length=0,h[O].length=0}},1755:function(e){"use restrict";e.exports=t;function t(o){this.roots=new Array(o),this.ranks=new Array(o);for(var a=0;a",N="",U=L.length,Z=N.length,Q=F[0]===y||F[0]===M,ue=0,oe=-Z;ue>-1&&(ue=B.indexOf(L,ue),!(ue===-1||(oe=B.indexOf(N,ue+U),oe===-1)||oe<=ue));){for(var le=ue;le=oe)O[le]=null,B=B.substr(0,le)+" "+B.substr(le+1);else if(O[le]!==null){var j=O[le].indexOf(F[0]);j===-1?O[le]+=F:Q&&(O[le]=O[le].substr(0,j+1)+(1+parseInt(O[le][j+1]))+O[le].substr(j+2))}var J=ue+U,$=B.substr(J,oe-J),X=$.indexOf(L);X!==-1?ue=X:ue=oe+Z}return O}function p(z,F,B){for(var O=F.textAlign||"start",L=F.textBaseline||"alphabetic",N=[1<<30,1<<30],U=[0,0],Z=z.length,Q=0;Q/g,` +`):B=B.replace(/\/g," ");var U="",Z=[];for(q=0;q-1?parseInt(ce[1+rt]):0,St=Je>-1?parseInt(Re[1+Je]):0;At!==St&&($e=$e.replace(Ce(),"?px "),fe*=Math.pow(.75,St-At),$e=$e.replace("?px ",Ce())),ie+=.25*j*(St-At)}if(N.superscripts===!0){var Rt=ce.indexOf(y),Ut=Re.indexOf(y),ir=Rt>-1?parseInt(ce[1+Rt]):0,ar=Ut>-1?parseInt(Re[1+Ut]):0;ir!==ar&&($e=$e.replace(Ce(),"?px "),fe*=Math.pow(.75,ar-ir),$e=$e.replace("?px ",Ce())),ie-=.25*j*(ar-ir)}if(N.bolds===!0){var Mr=ce.indexOf(v)>-1,fr=Re.indexOf(v)>-1;!Mr&&fr&&(dr?$e=$e.replace("italic ","italic bold "):$e="bold "+$e),Mr&&!fr&&($e=$e.replace("bold ",""))}if(N.italics===!0){var dr=ce.indexOf(T)>-1,pt=Re.indexOf(T)>-1;!dr&&pt&&($e="italic "+$e),dr&&!pt&&($e=$e.replace("italic ",""))}F.font=$e}for(ee=0;ee0&&(L=O.size),O.lineSpacing&&O.lineSpacing>0&&(N=O.lineSpacing),O.styletags&&O.styletags.breaklines&&(U.breaklines=!!O.styletags.breaklines),O.styletags&&O.styletags.bolds&&(U.bolds=!!O.styletags.bolds),O.styletags&&O.styletags.italics&&(U.italics=!!O.styletags.italics),O.styletags&&O.styletags.subscripts&&(U.subscripts=!!O.styletags.subscripts),O.styletags&&O.styletags.superscripts&&(U.superscripts=!!O.styletags.superscripts)),B.font=[O.fontStyle,O.fontVariant,O.fontWeight,L+"px",O.font].filter(function(Q){return Q}).join(" "),B.textAlign="start",B.textBaseline="alphabetic",B.direction="ltr";var Z=u(F,B,z,L,N,U);return R(Z,O,L)}},1538:function(e){(function(){if(typeof ses<"u"&&ses.ok&&!ses.ok())return;function r(g){g.permitHostObjects___&&g.permitHostObjects___(r)}typeof ses<"u"&&(ses.weakMapPermitHostObjects=r);var o=!1;if(typeof WeakMap=="function"){var a=WeakMap;if(!(typeof navigator<"u"&&/Firefox/.test(navigator.userAgent))){var i=new a,n=Object.freeze({});if(i.set(n,1),i.get(n)!==1)o=!0;else{e.exports=WeakMap;return}}}var s=Object.getOwnPropertyNames,c=Object.defineProperty,f=Object.isExtensible,v="weakmap:",h=v+"ident:"+Math.random()+"___";if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function"&&typeof ArrayBuffer=="function"&&typeof Uint8Array=="function"){var T=new ArrayBuffer(25),l=new Uint8Array(T);crypto.getRandomValues(l),h=v+"rand:"+Array.prototype.map.call(l,function(g){return(g%36).toString(36)}).join("")+"___"}function y(g){return!(g.substr(0,v.length)==v&&g.substr(g.length-3)==="___")}if(c(Object,"getOwnPropertyNames",{value:function(m){return s(m).filter(y)}}),"getPropertyNames"in Object){var b=Object.getPropertyNames;c(Object,"getPropertyNames",{value:function(m){return b(m).filter(y)}})}function S(g){if(g!==Object(g))throw new TypeError("Not an object: "+g);var m=g[h];if(m&&m.key===g)return m;if(f(g)){m={key:g};try{return c(g,h,{value:m,writable:!1,enumerable:!1,configurable:!1}),m}catch{return}}}(function(){var g=Object.freeze;c(Object,"freeze",{value:function(z){return S(z),g(z)}});var m=Object.seal;c(Object,"seal",{value:function(z){return S(z),m(z)}});var R=Object.preventExtensions;c(Object,"preventExtensions",{value:function(z){return S(z),R(z)}})})();function M(g){return g.prototype=null,Object.freeze(g)}var _=!1;function w(){!_&&typeof console<"u"&&(_=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}var p=0,u=function(){this instanceof u||w();var g=[],m=[],R=p++;function P(O,L){var N,U=S(O);return U?R in U?U[R]:L:(N=g.indexOf(O),N>=0?m[N]:L)}function z(O){var L=S(O);return L?R in L:g.indexOf(O)>=0}function F(O,L){var N,U=S(O);return U?U[R]=L:(N=g.indexOf(O),N>=0?m[N]=L:(N=g.length,m[N]=L,g[N]=O)),this}function B(O){var L=S(O),N,U;return L?R in L&&delete L[R]:(N=g.indexOf(O),N<0?!1:(U=g.length-1,g[N]=void 0,m[N]=m[U],g[N]=g[U],g.length=U,m.length=U,!0))}return Object.create(u.prototype,{get___:{value:M(P)},has___:{value:M(z)},set___:{value:M(F)},delete___:{value:M(B)}})};u.prototype=Object.create(Object.prototype,{get:{value:function(m,R){return this.get___(m,R)},writable:!0,configurable:!0},has:{value:function(m){return this.has___(m)},writable:!0,configurable:!0},set:{value:function(m,R){return this.set___(m,R)},writable:!0,configurable:!0},delete:{value:function(m){return this.delete___(m)},writable:!0,configurable:!0}}),typeof a=="function"?function(){o&&typeof Proxy<"u"&&(Proxy=void 0);function g(){this instanceof u||w();var m=new a,R=void 0,P=!1;function z(L,N){return R?m.has(L)?m.get(L):R.get___(L,N):m.get(L,N)}function F(L){return m.has(L)||(R?R.has___(L):!1)}var B;o?B=function(L,N){return m.set(L,N),m.has(L)||(R||(R=new u),R.set(L,N)),this}:B=function(L,N){if(P)try{m.set(L,N)}catch{R||(R=new u),R.set___(L,N)}else m.set(L,N);return this};function O(L){var N=!!m.delete(L);return R&&R.delete___(L)||N}return Object.create(u.prototype,{get___:{value:M(z)},has___:{value:M(F)},set___:{value:M(B)},delete___:{value:M(O)},permitHostObjects___:{value:M(function(L){if(L===r)P=!0;else throw new Error("bogus call to permitHostObjects___")})}})}g.prototype=u.prototype,e.exports=g,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():(typeof Proxy<"u"&&(Proxy=void 0),e.exports=u)})()},236:function(e,t,r){var o=r(8284);e.exports=a;function a(){var i={};return function(n){if((typeof n!="object"||n===null)&&typeof n!="function")throw new Error("Weakmap-shim: Key must be object");var s=n.valueOf(i);return s&&s.identity===i?s:o(n,i)}}},8284:function(e){e.exports=t;function t(r,o){var a={identity:o},i=r.valueOf;return Object.defineProperty(r,"valueOf",{value:function(n){return n!==o?i.apply(this,arguments):a},writable:!0}),a}},606:function(e,t,r){var o=r(236);e.exports=a;function a(){var i=o();return{get:function(n,s){var c=i(n);return c.hasOwnProperty("value")?c.value:s},set:function(n,s){return i(n).value=s,this},has:function(n){return"value"in i(n)},delete:function(n){return delete i(n).value}}}},3349:function(e){function t(){return function(s,c,f,v,h,T){var l=s[0],y=f[0],b=[0],S=y;v|=0;var M=0,_=y;for(M=0;M=0!=p>=0&&h.push(b[0]+.5+.5*(w+p)/(w-p))}v+=_,++b[0]}}}function r(){return t()}var o=r;function a(s){var c={};return function(v,h,T){var l=v.dtype,y=v.order,b=[l,y.join()].join(),S=c[b];return S||(c[b]=S=s([l,y])),S(v.shape.slice(0),v.data,v.stride,v.offset|0,h,T)}}function i(s){return a(o.bind(void 0,s))}function n(s){return i({funcName:s.funcName})}e.exports=n({funcName:"zeroCrossings"})},781:function(e,t,r){e.exports=a;var o=r(3349);function a(i,n){var s=[];return n=+n||0,o(i.hi(i.shape[0]-1),s,n),s}},7790:function(){}},x={};function A(e){var t=x[e];if(t!==void 0)return t.exports;var r=x[e]={id:e,loaded:!1,exports:{}};return d[e].call(r.exports,r,r.exports,A),r.loaded=!0,r.exports}(function(){A.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}()})(),function(){A.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}();var E=A(1964);G.exports=E})()}}),C3=He({"node_modules/color-name/index.js"(Y,G){G.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]}}}),TL=He({"node_modules/color-normalize/node_modules/color-parse/index.js"(Y,G){var d=C3();G.exports=A;var x={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function A(E){var e,t=[],r=1,o;if(typeof E=="string")if(E=E.toLowerCase(),d[E])t=d[E].slice(),o="rgb";else if(E==="transparent")r=0,o="rgb",t=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(E)){var a=E.slice(1),i=a.length,n=i<=4;r=1,n?(t=[parseInt(a[0]+a[0],16),parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16)],i===4&&(r=parseInt(a[3]+a[3],16)/255)):(t=[parseInt(a[0]+a[1],16),parseInt(a[2]+a[3],16),parseInt(a[4]+a[5],16)],i===8&&(r=parseInt(a[6]+a[7],16)/255)),t[0]||(t[0]=0),t[1]||(t[1]=0),t[2]||(t[2]=0),o="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(E)){var s=e[1],c=s==="rgb",a=s.replace(/a$/,"");o=a;var i=a==="cmyk"?4:a==="gray"?1:3;t=e[2].trim().split(/\s*[,\/]\s*|\s+/).map(function(h,T){if(/%$/.test(h))return T===i?parseFloat(h)/100:a==="rgb"?parseFloat(h)*255/100:parseFloat(h);if(a[T]==="h"){if(/deg$/.test(h))return parseFloat(h);if(x[h]!==void 0)return x[h]}return parseFloat(h)}),s===a&&t.push(1),r=c||t[i]===void 0?1:t[i],t=t.slice(0,i)}else E.length>10&&/[0-9](?:\s|\/)/.test(E)&&(t=E.match(/([0-9]+)/g).map(function(f){return parseFloat(f)}),o=E.match(/([a-z])/ig).join("").toLowerCase());else isNaN(E)?Array.isArray(E)||E.length?(t=[E[0],E[1],E[2]],o="rgb",r=E.length===4?E[3]:1):E instanceof Object&&(E.r!=null||E.red!=null||E.R!=null?(o="rgb",t=[E.r||E.red||E.R||0,E.g||E.green||E.G||0,E.b||E.blue||E.B||0]):(o="hsl",t=[E.h||E.hue||E.H||0,E.s||E.saturation||E.S||0,E.l||E.lightness||E.L||E.b||E.brightness]),r=E.a||E.alpha||E.opacity||1,E.opacity!=null&&(r/=100)):(o="rgb",t=[E>>>16,(E&65280)>>>8,E&255]);return{space:o,values:t,alpha:r}}}}),AL=He({"node_modules/color-normalize/node_modules/color-rgba/index.js"(Y,G){var d=TL();G.exports=function(E){Array.isArray(E)&&E.raw&&(E=String.raw.apply(null,arguments));var e,t=d(E);if(!t.space)return[];var r=[0,0,0],o=t.space[0]==="h"?[360,100,100]:[255,255,255];return e=Array(3),e[0]=Math.min(Math.max(t.values[0],r[0]),o[0]),e[1]=Math.min(Math.max(t.values[1],r[1]),o[1]),e[2]=Math.min(Math.max(t.values[2],r[2]),o[2]),t.space[0]==="h"&&(e=x(e)),e.push(Math.min(Math.max(t.alpha,0),1)),e};function x(A){var E=A[0]/360,e=A[1]/100,t=A[2]/100,r,o,a,i,n,s=0;if(e===0)return n=t*255,[n,n,n];for(o=t<.5?t*(1+e):t+e-t*e,r=2*t-o,i=[0,0,0];s<3;)a=E+1/3*-(s-1),a<0?a++:a>1&&a--,n=6*a<1?r+(o-r)*6*a:2*a<1?o:3*a<2?r+(o-r)*(2/3-a)*6:r,i[s++]=n*255;return i}}}),Ny=He({"node_modules/clamp/index.js"(Y,G){G.exports=d;function d(x,A,E){return AE?E:x:xA?A:x}}}),F_=He({"node_modules/dtype/index.js"(Y,G){G.exports=function(d){switch(d){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),rp=He({"node_modules/color-normalize/index.js"(Y,G){var d=AL(),x=Ny(),A=F_();G.exports=function(t,r){(r==="float"||!r)&&(r="array"),r==="uint"&&(r="uint8"),r==="uint_clamped"&&(r="uint8_clamped");var o=A(r),a=new o(4),i=r!=="uint8"&&r!=="uint8_clamped";return(!t.length||typeof t=="string")&&(t=d(t),t[0]/=255,t[1]/=255,t[2]/=255),E(t)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3]!=null?t[3]:255,i&&(a[0]/=255,a[1]/=255,a[2]/=255,a[3]/=255),a):(i?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=t[3]!=null?t[3]:1):(a[0]=x(Math.floor(t[0]*255),0,255),a[1]=x(Math.floor(t[1]*255),0,255),a[2]=x(Math.floor(t[2]*255),0,255),a[3]=t[3]==null?255:x(Math.floor(t[3]*255),0,255)),a)};function E(e){return!!(e instanceof Uint8Array||e instanceof Uint8ClampedArray||Array.isArray(e)&&(e[0]>1||e[0]===0)&&(e[1]>1||e[1]===0)&&(e[2]>1||e[2]===0)&&(!e[3]||e[3]>1))}}}),cd=He({"src/lib/str2rgbarray.js"(Y,G){var d=rp();function x(A){return A?d(A):[0,0,0,1]}G.exports=x}}),fd=He({"src/lib/gl_format_color.js"(Y,G){var d=Hi(),x=Mf(),A=rp(),E=Kl(),e=Xc().defaultLine,t=ch().isArrayOrTypedArray,r=A(e),o=1;function a(f,v){var h=f;return h[3]*=v,h}function i(f){if(d(f))return r;var v=A(f);return v.length?v:r}function n(f){return d(f)?f:o}function s(f,v,h){var T=f.color;T&&T._inputArray&&(T=T._inputArray);var l=t(T),y=t(v),b=E.extractOpts(f),S=[],M,_,w,p,u;if(b.colorscale!==void 0?M=E.makeColorScaleFuncFromTrace(f):M=i,l?_=function(m,R){return m[R]===void 0?r:A(M(m[R]))}:_=i,y?w=function(m,R){return m[R]===void 0?o:n(m[R])}:w=n,l||y)for(var g=0;g0){var h=o.c2l(f);o._lowerLogErrorBound||(o._lowerLogErrorBound=h),o._lowerErrorBound=Math.min(o._lowerLogErrorBound,h)}}else i[n]=[-s[0]*r,s[1]*r]}return i}function A(e){for(var t=0;t-1?-1:R.indexOf("right")>-1?1:0}function b(R){return R==null?0:R.indexOf("top")>-1?-1:R.indexOf("bottom")>-1?1:0}function S(R){var P=0,z=0,F=[P,z];if(Array.isArray(R))for(var B=0;B=0){var Z=T(N.position,N.delaunayColor,N.delaunayAxis);Z.opacity=R.opacity,this.delaunayMesh?this.delaunayMesh.update(Z):(Z.gl=P,this.delaunayMesh=E(Z),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},h.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())};function m(R,P){var z=new v(R,P.uid);return z.update(P),z}G.exports=m}}),P3=He({"src/traces/scatter3d/attributes.js"(Y,G){var d=Zu(),x=Yl(),A=kl(),E=Gu().axisHoverFormat,e=Yo().hovertemplateAttrs,t=Yo().texttemplateAttrs,r=cl(),o=L3(),a=O_(),i=ho().extendFlat,n=hu().overrideAll,s=Ud(),c=d.line,f=d.marker,v=f.line,h=i({width:c.width,dash:{valType:"enumerated",values:s(o),dflt:"solid"}},A("line"));function T(y){return{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}}var l=G.exports=n({x:d.x,y:d.y,z:{valType:"data_array"},text:i({},d.text,{}),texttemplate:t({},{}),hovertext:i({},d.hovertext,{}),hovertemplate:e(),xhoverformat:E("x"),yhoverformat:E("y"),zhoverformat:E("z"),mode:i({},d.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:T(),y:T(),z:T()},connectgaps:d.connectgaps,line:h,marker:i({symbol:{valType:"enumerated",values:s(a),dflt:"circle",arrayOk:!0},size:i({},f.size,{dflt:8}),sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode,opacity:i({},f.opacity,{arrayOk:!1}),colorbar:f.colorbar,line:i({width:i({},v.width,{arrayOk:!1})},A("marker.line"))},A("marker")),textposition:i({},d.textposition,{dflt:"top center"}),textfont:x({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:r.opacity,hoverinfo:i({},r.hoverinfo)},"calc","nested");l.x.editType=l.y.editType=l.z.editType="calc+clearAxisTypes"}}),EL=He({"src/traces/scatter3d/defaults.js"(Y,G){var d=Ei(),x=Gr(),A=Rl(),E=Kh(),e=nv(),t=iv(),r=P3();G.exports=function(i,n,s,c){function f(M,_){return x.coerce(i,n,r,M,_)}var v=o(i,n,f,c);if(!v){n.visible=!1;return}f("text"),f("hovertext"),f("hovertemplate"),f("xhoverformat"),f("yhoverformat"),f("zhoverformat"),f("mode"),A.hasMarkers(n)&&E(i,n,s,c,f,{noSelect:!0,noAngle:!0}),A.hasLines(n)&&(f("connectgaps"),e(i,n,s,c,f)),A.hasText(n)&&(f("texttemplate"),t(i,n,c,f,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var h=(n.line||{}).color,T=(n.marker||{}).color;f("surfaceaxis")>=0&&f("surfacecolor",h||T);for(var l=["x","y","z"],y=0;y<3;++y){var b="projection."+l[y];f(b+".show")&&(f(b+".opacity"),f(b+".scale"))}var S=d.getComponentMethod("errorbars","supplyDefaults");S(i,n,h||T||s,{axis:"z"}),S(i,n,h||T||s,{axis:"y",inherit:"z"}),S(i,n,h||T||s,{axis:"x",inherit:"z"})};function o(a,i,n,s){var c=0,f=n("x"),v=n("y"),h=n("z"),T=d.getComponentMethod("calendars","handleTraceDefaults");return T(a,i,["x","y","z"],s),f&&v&&h&&(c=Math.min(f.length,v.length,h.length),i._length=i._xlength=i._ylength=i._zlength=c),c}}}),kL=He({"src/traces/scatter3d/calc.js"(Y,G){var d=Vv(),x=ov();G.exports=function(E,e){var t=[{x:!1,y:!1,trace:e,t:{}}];return d(t,e),x(E,e),t}}}),CL=He({"node_modules/get-canvas-context/index.js"(Y,G){G.exports=d;function d(x,A){if(typeof x!="string")throw new TypeError("must specify type string");if(A=A||{},typeof document>"u"&&!A.canvas)return null;var E=A.canvas||document.createElement("canvas");typeof A.width=="number"&&(E.width=A.width),typeof A.height=="number"&&(E.height=A.height);var e=A,t;try{var r=[x];x.indexOf("webgl")===0&&r.push("experimental-"+x);for(var o=0;o/g," "));i[n]=v,s.tickmode=c}}r.ticks=i;for(var n=0;n<3;++n){.5*(t.glplot.bounds[0][n]+t.glplot.bounds[1][n]);for(var h=0;h<2;++h)r.bounds[h][n]=t.glplot.bounds[h][n]}t.contourLevels=E(i)}}}),DL=He({"src/plots/gl3d/scene.js"(Y,G){var d=Hf().gl_plot3d,x=d.createCamera,A=d.createScene,E=LL(),e=a1(),t=Ei(),r=Gr(),o=r.preserveDrawingBuffer(),a=io(),i=Wu(),n=cd(),s=I3(),c=Qb(),f=PL(),v=IL(),h=RL(),T=_v().applyAutorangeOptions,l,y,b=!1;function S(z,F){var B=document.createElement("div"),O=z.container;this.graphDiv=z.graphDiv;var L=document.createElementNS("http://www.w3.org/2000/svg","svg");L.style.position="absolute",L.style.top=L.style.left="0px",L.style.width=L.style.height="100%",L.style["z-index"]=20,L.style["pointer-events"]="none",B.appendChild(L),this.svgContainer=L,B.id=z.id,B.style.position="absolute",B.style.top=B.style.left="0px",B.style.width=B.style.height="100%",O.appendChild(B),this.fullLayout=F,this.id=z.id||"scene",this.fullSceneLayout=F[this.id],this.plotArgs=[[],{},{}],this.axesOptions=f(F,F[this.id]),this.spikeOptions=v(F[this.id]),this.container=B,this.staticMode=!!z.staticPlot,this.pixelRatio=this.pixelRatio||z.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=t.getComponentMethod("annotations3d","convert"),this.drawAnnotations=t.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var M=S.prototype;M.prepareOptions=function(){var z=this,F={canvas:z.canvas,gl:z.gl,glOptions:{preserveDrawingBuffer:o,premultipliedAlpha:!0,antialias:!0},container:z.container,axes:z.axesOptions,spikes:z.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:z.camera,pixelRatio:z.pixelRatio};if(z.staticMode){if(!y&&(l=document.createElement("canvas"),y=E({canvas:l,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}),!y))throw new Error("error creating static canvas/context for image server");F.gl=y,F.canvas=l}return F};var _=!0;M.tryCreatePlot=function(){var z=this,F=z.prepareOptions(),B=!0;try{z.glplot=A(F)}catch{if(z.staticMode||!_||o)B=!1;else{r.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{o=F.glOptions.preserveDrawingBuffer=!0,z.glplot=A(F)}catch{o=F.glOptions.preserveDrawingBuffer=!1,B=!1}}}return _=!1,B},M.initializeGLCamera=function(){var z=this,F=z.fullSceneLayout.camera,B=F.projection.type==="orthographic";z.camera=x(z.container,{center:[F.center.x,F.center.y,F.center.z],eye:[F.eye.x,F.eye.y,F.eye.z],up:[F.up.x,F.up.y,F.up.z],_ortho:B,zoomMin:.01,zoomMax:100,mode:"orbit"})},M.initializeGLPlot=function(){var z=this;z.initializeGLCamera();var F=z.tryCreatePlot();if(!F)return s(z);z.traces={},z.make4thDimension();var B=z.graphDiv,O=B.layout,L=function(){var U={};return z.isCameraChanged(O)&&(U[z.id+".camera"]=z.getCamera()),z.isAspectChanged(O)&&(U[z.id+".aspectratio"]=z.glplot.getAspectratio(),O[z.id].aspectmode!=="manual"&&(z.fullSceneLayout.aspectmode=O[z.id].aspectmode=U[z.id+".aspectmode"]="manual")),U},N=function(U){if(U.fullSceneLayout.dragmode!==!1){var Z=L();U.saveLayout(O),U.graphDiv.emit("plotly_relayout",Z)}};return z.glplot.canvas&&(z.glplot.canvas.addEventListener("mouseup",function(){N(z)}),z.glplot.canvas.addEventListener("touchstart",function(){b=!0}),z.glplot.canvas.addEventListener("wheel",function(U){if(B._context._scrollZoom.gl3d){if(z.camera._ortho){var Z=U.deltaX>U.deltaY?1.1:.9090909090909091,Q=z.glplot.getAspectratio();z.glplot.setAspectratio({x:Z*Q.x,y:Z*Q.y,z:Z*Q.z})}N(z)}},e?{passive:!1}:!1),z.glplot.canvas.addEventListener("mousemove",function(){if(z.fullSceneLayout.dragmode!==!1&&z.camera.mouseListener.buttons!==0){var U=L();z.graphDiv.emit("plotly_relayouting",U)}}),z.staticMode||z.glplot.canvas.addEventListener("webglcontextlost",function(U){B&&B.emit&&B.emit("plotly_webglcontextlost",{event:U,layer:z.id})},!1)),z.glplot.oncontextloss=function(){z.recoverContext()},z.glplot.onrender=function(){z.render()},!0},M.render=function(){var z=this,F=z.graphDiv,B,O=z.svgContainer,L=z.container.getBoundingClientRect();F._fullLayout._calcInverseTransform(F);var N=F._fullLayout._invScaleX,U=F._fullLayout._invScaleY,Z=L.width*N,Q=L.height*U;O.setAttributeNS(null,"viewBox","0 0 "+Z+" "+Q),O.setAttributeNS(null,"width",Z),O.setAttributeNS(null,"height",Q),h(z),z.glplot.axes.update(z.axesOptions);for(var ue=Object.keys(z.traces),oe=null,le=z.glplot.selection,j=0;j")):B.type==="isosurface"||B.type==="volume"?(ee.valueLabel=a.hoverLabelText(z._mockAxis,z._mockAxis.d2l(le.traceCoordinate[3]),B.valuehoverformat),we.push("value: "+ee.valueLabel),le.textLabel&&we.push(le.textLabel),fe=we.join("
")):fe=le.textLabel;var Ae={x:le.traceCoordinate[0],y:le.traceCoordinate[1],z:le.traceCoordinate[2],data:X._input,fullData:X,curveNumber:X.index,pointNumber:re};i.appendArrayPointValue(Ae,X,re),B._module.eventData&&(Ae=X._module.eventData(Ae,le,X,{},re));var Fe={points:[Ae]};if(z.fullSceneLayout.hovermode){var Ce=[];i.loneHover({trace:X,x:(.5+.5*$[0]/$[3])*Z,y:(.5-.5*$[1]/$[3])*Q,xLabel:ee.xLabel,yLabel:ee.yLabel,zLabel:ee.zLabel,text:fe,name:oe.name,color:i.castHoverOption(X,re,"bgcolor")||oe.color,borderColor:i.castHoverOption(X,re,"bordercolor"),fontFamily:i.castHoverOption(X,re,"font.family"),fontSize:i.castHoverOption(X,re,"font.size"),fontColor:i.castHoverOption(X,re,"font.color"),nameLength:i.castHoverOption(X,re,"namelength"),textAlign:i.castHoverOption(X,re,"align"),hovertemplate:r.castOption(X,re,"hovertemplate"),hovertemplateLabels:r.extendFlat({},Ae,ee),eventData:[Ae]},{container:O,gd:F,inOut_bbox:Ce}),Ae.bbox=Ce[0]}le.distance<5&&(le.buttons||b)?F.emit("plotly_click",Fe):F.emit("plotly_hover",Fe),this.oldEventData=Fe}else i.loneUnhover(O),this.oldEventData&&F.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;z.drawAnnotations(z)},M.recoverContext=function(){var z=this;z.glplot.dispose();var F=function(){if(z.glplot.gl.isContextLost()){requestAnimationFrame(F);return}if(!z.initializeGLPlot()){r.error("Catastrophic and unrecoverable WebGL error. Context lost.");return}z.plot.apply(z,z.plotArgs)};requestAnimationFrame(F)};var w=["xaxis","yaxis","zaxis"];function p(z,F,B){for(var O=z.fullSceneLayout,L=0;L<3;L++){var N=w[L],U=N.charAt(0),Z=O[N],Q=F[U],ue=F[U+"calendar"],oe=F["_"+U+"length"];if(!r.isArrayOrTypedArray(Q))B[0][L]=Math.min(B[0][L],0),B[1][L]=Math.max(B[1][L],oe-1);else for(var le,j=0;j<(oe||Q.length);j++)if(r.isArrayOrTypedArray(Q[j]))for(var J=0;JX[1][U])X[0][U]=-1,X[1][U]=1;else{var qe=X[1][U]-X[0][U];X[0][U]-=qe/32,X[1][U]+=qe/32}if(ee=[X[0][U],X[1][U]],ee=T(ee,Q),X[0][U]=ee[0],X[1][U]=ee[1],Q.isReversed()){var et=X[0][U];X[0][U]=X[1][U],X[1][U]=et}}else ee=Q.range,X[0][U]=Q.r2l(ee[0]),X[1][U]=Q.r2l(ee[1]);X[0][U]===X[1][U]&&(X[0][U]-=1,X[1][U]+=1),Q.range=[X[0][U],X[1][U]],Q.limitRange(),O.glplot.setBounds(U,{min:Q.range[0]*J[U],max:Q.range[1]*J[U]})}var Qe,Ke=oe.aspectmode;if(Ke==="cube")Qe=[1,1,1];else if(Ke==="manual"){var Xe=oe.aspectratio;Qe=[Xe.x,Xe.y,Xe.z]}else if(Ke==="auto"||Ke==="data"){var Me=[1,1,1];for(U=0;U<3;++U){Q=oe[w[U]],ue=Q.type;var xe=re[ue];Me[U]=Math.pow(xe.acc,1/xe.count)/J[U]}Ke==="data"||Math.max.apply(null,Me)/Math.min.apply(null,Me)<=4?Qe=Me:Qe=[1,1,1]}else throw new Error("scene.js aspectRatio was not one of the enumerated types");oe.aspectratio.x=le.aspectratio.x=Qe[0],oe.aspectratio.y=le.aspectratio.y=Qe[1],oe.aspectratio.z=le.aspectratio.z=Qe[2],O.glplot.setAspectratio(oe.aspectratio),O.viewInitial.aspectratio||(O.viewInitial.aspectratio={x:oe.aspectratio.x,y:oe.aspectratio.y,z:oe.aspectratio.z}),O.viewInitial.aspectmode||(O.viewInitial.aspectmode=oe.aspectmode);var ce=oe.domain||null,Re=F._size||null;if(ce&&Re){var $e=O.container.style;$e.position="absolute",$e.left=Re.l+ce.x[0]*Re.w+"px",$e.top=Re.t+(1-ce.y[1])*Re.h+"px",$e.width=Re.w*(ce.x[1]-ce.x[0])+"px",$e.height=Re.h*(ce.y[1]-ce.y[0])+"px"}O.glplot.redraw()}},M.destroy=function(){var z=this;z.glplot&&(z.camera.mouseListener.enabled=!1,z.container.removeEventListener("wheel",z.camera.wheelListener),z.camera=null,z.glplot.dispose(),z.container.parentNode.removeChild(z.container),z.glplot=null)};function g(z){return[[z.eye.x,z.eye.y,z.eye.z],[z.center.x,z.center.y,z.center.z],[z.up.x,z.up.y,z.up.z]]}function m(z){return{up:{x:z.up[0],y:z.up[1],z:z.up[2]},center:{x:z.center[0],y:z.center[1],z:z.center[2]},eye:{x:z.eye[0],y:z.eye[1],z:z.eye[2]},projection:{type:z._ortho===!0?"orthographic":"perspective"}}}M.getCamera=function(){var z=this;return z.camera.view.recalcMatrix(z.camera.view.lastT()),m(z.camera)},M.setViewport=function(z){var F=this,B=z.camera;F.camera.lookAt.apply(this,g(B)),F.glplot.setAspectratio(z.aspectratio);var O=B.projection.type==="orthographic",L=F.camera._ortho;O!==L&&(F.glplot.redraw(),F.glplot.clearRGBA(),F.glplot.dispose(),F.initializeGLPlot())},M.isCameraChanged=function(z){var F=this,B=F.getCamera(),O=r.nestedProperty(z,F.id+".camera"),L=O.get();function N(ue,oe,le,j){var J=["up","center","eye"],$=["x","y","z"];return oe[J[le]]&&ue[J[le]][$[j]]===oe[J[le]][$[j]]}var U=!1;if(L===void 0)U=!0;else{for(var Z=0;Z<3;Z++)for(var Q=0;Q<3;Q++)if(!N(B,L,Z,Q)){U=!0;break}(!L.projection||B.projection&&B.projection.type!==L.projection.type)&&(U=!0)}return U},M.isAspectChanged=function(z){var F=this,B=F.glplot.getAspectratio(),O=r.nestedProperty(z,F.id+".aspectratio"),L=O.get();return L===void 0||L.x!==B.x||L.y!==B.y||L.z!==B.z},M.saveLayout=function(z){var F=this,B=F.fullLayout,O,L,N,U,Z,Q,ue=F.isCameraChanged(z),oe=F.isAspectChanged(z),le=ue||oe;if(le){var j={};if(ue&&(O=F.getCamera(),L=r.nestedProperty(z,F.id+".camera"),N=L.get(),j[F.id+".camera"]=N),oe&&(U=F.glplot.getAspectratio(),Z=r.nestedProperty(z,F.id+".aspectratio"),Q=Z.get(),j[F.id+".aspectratio"]=Q),t.call("_storeDirectGUIEdit",z,B._preGUI,j),ue){L.set(O);var J=r.nestedProperty(B,F.id+".camera");J.set(O)}if(oe){Z.set(U);var $=r.nestedProperty(B,F.id+".aspectratio");$.set(U),F.glplot.redraw()}}return le},M.updateFx=function(z,F){var B=this,O=B.camera;if(O)if(z==="orbit")O.mode="orbit",O.keyBindingMode="rotate";else if(z==="turntable"){O.up=[0,0,1],O.mode="turntable",O.keyBindingMode="rotate";var L=B.graphDiv,N=L._fullLayout,U=B.fullSceneLayout.camera,Z=U.up.x,Q=U.up.y,ue=U.up.z;if(ue/Math.sqrt(Z*Z+Q*Q+ue*ue)<.999){var oe=B.id+".camera.up",le={x:0,y:0,z:1},j={};j[oe]=le;var J=L.layout;t.call("_storeDirectGUIEdit",J,N._preGUI,j),U.up=le,r.nestedProperty(J,oe).set(le)}}else O.keyBindingMode=z;B.fullSceneLayout.hovermode=F};function R(z,F,B){for(var O=0,L=B-1;O0)for(var Z=255/U,Q=0;Q<3;++Q)z[N+Q]=Math.min(Z*z[N+Q],255)}}M.toImage=function(z){var F=this;z||(z="png"),F.staticMode&&F.container.appendChild(l),F.glplot.redraw();var B=F.glplot.gl,O=B.drawingBufferWidth,L=B.drawingBufferHeight;B.bindFramebuffer(B.FRAMEBUFFER,null);var N=new Uint8Array(O*L*4);B.readPixels(0,0,O,L,B.RGBA,B.UNSIGNED_BYTE,N),R(N,O,L),P(N,O,L);var U=document.createElement("canvas");U.width=O,U.height=L;var Z=U.getContext("2d",{willReadFrequently:!0}),Q=Z.createImageData(O,L);Q.data.set(N),Z.putImageData(Q,0,0);var ue;switch(z){case"jpeg":ue=U.toDataURL("image/jpeg");break;case"webp":ue=U.toDataURL("image/webp");break;default:ue=U.toDataURL("image/png")}return F.staticMode&&F.container.removeChild(l),ue},M.setConvert=function(){for(var z=this,F=0;F<3;F++){var B=z.fullSceneLayout[w[F]];a.setConvert(B,z.fullLayout),B.setScale=r.noop}},M.make4thDimension=function(){var z=this,F=z.graphDiv,B=F._fullLayout;z._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},a.setConvert(z._mockAxis,B)},G.exports=S}}),zL=He({"src/plots/gl3d/layout/attributes.js"(Y,G){G.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),R3=He({"src/plots/gl3d/layout/axis_attributes.js"(Y,G){var d=Ai(),x=jf(),A=ho().extendFlat,E=hu().overrideAll;G.exports=E({visible:x.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:d.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:x.color,categoryorder:x.categoryorder,categoryarray:x.categoryarray,title:{text:x.title.text,font:x.title.font},type:A({},x.type,{values:["-","linear","log","date","category"]}),autotypenumbers:x.autotypenumbers,autorange:x.autorange,autorangeoptions:{minallowed:x.autorangeoptions.minallowed,maxallowed:x.autorangeoptions.maxallowed,clipmin:x.autorangeoptions.clipmin,clipmax:x.autorangeoptions.clipmax,include:x.autorangeoptions.include,editType:"plot"},rangemode:x.rangemode,minallowed:x.minallowed,maxallowed:x.maxallowed,range:A({},x.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:x.minor.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,mirror:x.mirror,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,showticklabels:x.showticklabels,labelalias:x.labelalias,tickfont:x.tickfont,tickangle:x.tickangle,tickprefix:x.tickprefix,showtickprefix:x.showtickprefix,ticksuffix:x.ticksuffix,showticksuffix:x.showticksuffix,showexponent:x.showexponent,exponentformat:x.exponentformat,minexponent:x.minexponent,separatethousands:x.separatethousands,tickformat:x.tickformat,tickformatstops:x.tickformatstops,hoverformat:x.hoverformat,showline:x.showline,linecolor:x.linecolor,linewidth:x.linewidth,showgrid:x.showgrid,gridcolor:A({},x.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:x.gridwidth,zeroline:x.zeroline,zerolinecolor:x.zerolinecolor,zerolinewidth:x.zerolinewidth},"plot","from-root")}}),D3=He({"src/plots/gl3d/layout/layout_attributes.js"(Y,G){var d=R3(),x=mu().attributes,A=ho().extendFlat,E=Gr().counterRegex;function e(t,r,o){return{x:{valType:"number",dflt:t,editType:"camera"},y:{valType:"number",dflt:r,editType:"camera"},z:{valType:"number",dflt:o,editType:"camera"},editType:"camera"}}G.exports={_arrayAttrRegexps:[E("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:A(e(0,0,1),{}),center:A(e(0,0,0),{}),eye:A(e(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:x({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:d,yaxis:d,zaxis:d,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"}}}),FL=He({"src/plots/gl3d/layout/axis_defaults.js"(Y,G){var d=Mf().mix,x=Gr(),A=Gs(),E=R3(),e=Jb(),t=ny(),r=["xaxis","yaxis","zaxis"],o=100*136/187;G.exports=function(i,n,s){var c,f;function v(l,y){return x.coerce(c,f,E,l,y)}for(var h=0;h1;function v(h){if(!f){var T=d.validate(n[h],t[h]);if(T)return n[h]}}E(n,s,c,{type:o,attributes:t,handleDefaults:a,fullLayout:s,font:s.font,fullData:c,getDfltFromLayout:v,autotypenumbersDflt:s.autotypenumbers,paper_bgcolor:s.paper_bgcolor,calendar:s.calendar})};function a(i,n,s,c){for(var f=s("bgcolor"),v=x.combine(f,c.paper_bgcolor),h=["up","center","eye"],T=0;T.999)&&(M="turntable")}else M="turntable";s("dragmode",M),s("hovermode",c.getDfltFromLayout("hovermode"))}}}),ap=He({"src/plots/gl3d/index.js"(Y){var G=hu().overrideAll,d=Od(),x=DL(),A=Uf().getSubplotData,E=Gr(),e=Yh(),t="gl3d",r="scene";Y.name=t,Y.attr=r,Y.idRoot=r,Y.idRegex=Y.attrRegex=E.counterRegex("scene"),Y.attributes=zL(),Y.layoutAttributes=D3(),Y.baseLayoutAttrOverrides=G({hoverlabel:d.hoverlabel},"plot","nested"),Y.supplyLayoutDefaults=OL(),Y.plot=function(a){for(var i=a._fullLayout,n=a._fullData,s=i._subplots[t],c=0;c0){R=c[P];break}return R}function T(g,m){if(!(g<1||m<1)){for(var R=v(g),P=v(m),z=1,F=0;FS;)P--,P/=h(P),P++,P1?z:1};function M(g,m,R){var P=R[8]+R[2]*m[0]+R[5]*m[1];return g[0]=(R[6]+R[0]*m[0]+R[3]*m[1])/P,g[1]=(R[7]+R[1]*m[0]+R[4]*m[1])/P,g}function _(g,m,R){return w(g,m,M,R),g}function w(g,m,R,P){for(var z=[0,0],F=g.shape[0],B=g.shape[1],O=0;O0&&this.contourStart[P]!==null&&this.contourEnd[P]!==null&&this.contourEnd[P]>this.contourStart[P]))for(m[P]=!0,z=this.contourStart[P];zQ&&(this.minValues[N]=Q),this.maxValues[N]c&&(o.isomin=null,o.isomax=null);var f=n("x"),v=n("y"),h=n("z"),T=n("value");if(!f||!f.length||!v||!v.length||!h||!h.length||!T||!T.length){o.visible=!1;return}var l=x.getComponentMethod("calendars","handleTraceDefaults");l(r,o,["x","y","z"],i),n("valuehoverformat"),["x","y","z"].forEach(function(M){n(M+"hoverformat");var _="caps."+M,w=n(_+".show");w&&n(_+".fill");var p="slices."+M,u=n(p+".show");u&&(n(p+".fill"),n(p+".locations"))});var y=n("spaceframe.show");y&&n("spaceframe.fill");var b=n("surface.show");b&&(n("surface.count"),n("surface.fill"),n("surface.pattern"));var S=n("contour.show");S&&(n("contour.color"),n("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(M){n(M)}),E(r,o,i,n,{prefix:"",cLetter:"c"}),o._length=null}G.exports={supplyDefaults:e,supplyIsoDefaults:t}}}),N_=He({"src/traces/streamtube/calc.js"(Y,G){var d=Gr(),x=Sh();function A(r,o){o._len=Math.min(o.u.length,o.v.length,o.w.length,o.x.length,o.y.length,o.z.length),o._u=t(o.u,o._len),o._v=t(o.v,o._len),o._w=t(o.w,o._len),o._x=t(o.x,o._len),o._y=t(o.y,o._len),o._z=t(o.z,o._len);var a=E(o);o._gridFill=a.fill,o._Xs=a.Xs,o._Ys=a.Ys,o._Zs=a.Zs,o._len=a.len;var i=0,n,s,c;o.starts&&(n=t(o.starts.x||[]),s=t(o.starts.y||[]),c=t(o.starts.z||[]),i=Math.min(n.length,s.length,c.length)),o._startsX=n||[],o._startsY=s||[],o._startsZ=c||[];var f=0,v=1/0,h;for(h=0;h1&&(u=o[n-1],m=a[n-1],P=i[n-1]),s=0;su?"-":"+")+"x"),S=S.replace("y",(g>m?"-":"+")+"y"),S=S.replace("z",(R>P?"-":"+")+"z");var O=function(){n=0,z=[],F=[],B=[]};(!n||n0;v--){var h=Math.min(f[v],f[v-1]),T=Math.max(f[v],f[v-1]);if(T>h&&h-1}function ae(pt,ze){return pt===null?ze:pt}function ie(pt,ze,Ge){ue();var Oe=[ze],ve=[Ge];if(X>=1)Oe=[ze],ve=[Ge];else if(X>0){var ge=ee(ze,Ge);Oe=ge.xyzv,ve=ge.abc}for(var be=0;be-1?Ge[We]:Q(ct,_t,Mt);Bt>-1?Pe[We]=Bt:Pe[We]=le(ct,_t,Mt,ae(pt,Nt))}j(Pe[0],Pe[1],Pe[2])}}function fe(pt,ze,Ge){var Oe=function(ve,ge,be){ie(pt,[ze[ve],ze[ge],ze[be]],[Ge[ve],Ge[ge],Ge[be]])};Oe(0,1,2),Oe(2,3,0)}function we(pt,ze,Ge){var Oe=function(ve,ge,be){ie(pt,[ze[ve],ze[ge],ze[be]],[Ge[ve],Ge[ge],Ge[be]])};Oe(0,1,2),Oe(3,0,1),Oe(2,3,0),Oe(1,2,3)}function Ae(pt,ze,Ge,Oe){var ve=pt[3];veOe&&(ve=Oe);for(var ge=(pt[3]-ve)/(pt[3]-ze[3]+1e-9),be=[],Pe=0;Pe<4;Pe++)be[Pe]=(1-ge)*pt[Pe]+ge*ze[Pe];return be}function Fe(pt,ze,Ge){return pt>=ze&&pt<=Ge}function Ce(pt){var ze=.001*(O-B);return pt>=B-ze&&pt<=O+ze}function qe(pt){for(var ze=[],Ge=0;Ge<4;Ge++){var Oe=pt[Ge];ze.push([c._x[Oe],c._y[Oe],c._z[Oe],c._value[Oe]])}return ze}var et=3;function Qe(pt,ze,Ge,Oe,ve,ge){ge||(ge=1),Ge=[-1,-1,-1];var be=!1,Pe=[Fe(ze[0][3],Oe,ve),Fe(ze[1][3],Oe,ve),Fe(ze[2][3],Oe,ve)];if(!Pe[0]&&!Pe[1]&&!Pe[2])return!1;var We=function(_t,Mt,Nt){return Ce(Mt[0][3])&&Ce(Mt[1][3])&&Ce(Mt[2][3])?(ie(_t,Mt,Nt),!0):gePe?[z,ge]:[ge,F];Rt(ze,We[0],We[1])}}var ct=[[Math.min(B,F),Math.max(B,F)],[Math.min(z,O),Math.max(z,O)]];["x","y","z"].forEach(function(_t){for(var Mt=[],Nt=0;Nt0&&(da.push(Ia.id),_t==="x"?wa.push([Ia.distRatio,0,0]):_t==="y"?wa.push([0,Ia.distRatio,0]):wa.push([0,0,Ia.distRatio]))}else _t==="x"?ta=Mr(1,u-1):_t==="y"?ta=Mr(1,g-1):ta=Mr(1,m-1);da.length>0&&(_t==="x"?Mt[Bt]=Ut(pt,da,qt,Zt,wa,Mt[Bt]):_t==="y"?Mt[Bt]=ir(pt,da,qt,Zt,wa,Mt[Bt]):Mt[Bt]=ar(pt,da,qt,Zt,wa,Mt[Bt]),Bt++),ta.length>0&&(_t==="x"?Mt[Bt]=$e(pt,ta,qt,Zt,Mt[Bt]):_t==="y"?Mt[Bt]=rt(pt,ta,qt,Zt,Mt[Bt]):Mt[Bt]=Je(pt,ta,qt,Zt,Mt[Bt]),Bt++)}var va=c.caps[_t];va.show&&va.fill&&(re(va.fill),_t==="x"?Mt[Bt]=$e(pt,[0,u-1],qt,Zt,Mt[Bt]):_t==="y"?Mt[Bt]=rt(pt,[0,g-1],qt,Zt,Mt[Bt]):Mt[Bt]=Je(pt,[0,m-1],qt,Zt,Mt[Bt]),Bt++)}}),b===0&&oe(),c._meshX=L,c._meshY=N,c._meshZ=U,c._meshIntensity=Z,c._Xs=_,c._Ys=w,c._Zs=p}return dr(),c}function s(c,f){var v=c.glplot.gl,h=d({gl:v}),T=new o(c,h,f.uid);return h._trace=T,T.update(f),c.glplot.add(h),T}G.exports={findNearestOnAxis:r,generateIsoMeshes:n,createIsosurfaceTrace:s}}}),HL=He({"src/traces/isosurface/index.js"(Y,G){G.exports={attributes:B_(),supplyDefaults:F3().supplyDefaults,calc:O3(),colorbar:{min:"cmin",max:"cmax"},plot:U_().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:ap(),categories:["gl3d","showLegend"],meta:{}}}}),GL=He({"lib/isosurface.js"(Y,G){G.exports=HL()}}),B3=He({"src/traces/volume/attributes.js"(Y,G){var d=kl(),x=B_(),A=Uy(),E=cl(),e=ho().extendFlat,t=hu().overrideAll,r=G.exports=t(e({x:x.x,y:x.y,z:x.z,value:x.value,isomin:x.isomin,isomax:x.isomax,surface:x.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:x.slices,caps:x.caps,text:x.text,hovertext:x.hovertext,xhoverformat:x.xhoverformat,yhoverformat:x.yhoverformat,zhoverformat:x.zhoverformat,valuehoverformat:x.valuehoverformat,hovertemplate:x.hovertemplate},d("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:x.colorbar,opacity:x.opacity,opacityscale:A.opacityscale,lightposition:x.lightposition,lighting:x.lighting,flatshading:x.flatshading,contour:x.contour,hoverinfo:e({},E.hoverinfo),showlegend:e({},E.showlegend,{dflt:!1})}),"calc","nested");r.x.editType=r.y.editType=r.z.editType=r.value.editType="calc+clearAxisTypes"}}),WL=He({"src/traces/volume/defaults.js"(Y,G){var d=Gr(),x=B3(),A=F3().supplyIsoDefaults,E=z3().opacityscaleDefaults;G.exports=function(t,r,o,a){function i(n,s){return d.coerce(t,r,x,n,s)}A(t,r,o,a,i),E(t,r,a,i)}}}),ZL=He({"src/traces/volume/convert.js"(Y,G){var d=Hf().gl_mesh3d,x=fd().parseColorScale,A=Gr().isArrayOrTypedArray,E=cd(),e=Kl().extractOpts,t=lg(),r=U_().findNearestOnAxis,o=U_().generateIsoMeshes;function a(s,c,f){this.scene=s,this.uid=f,this.mesh=c,this.name="",this.data=null,this.showContour=!1}var i=a.prototype;i.handlePick=function(s){if(s.object===this.mesh){var c=s.data.index,f=this.data._meshX[c],v=this.data._meshY[c],h=this.data._meshZ[c],T=this.data._Ys.length,l=this.data._Zs.length,y=r(f,this.data._Xs).id,b=r(v,this.data._Ys).id,S=r(h,this.data._Zs).id,M=s.index=S+l*b+l*T*y;s.traceCoordinate=[this.data._meshX[M],this.data._meshY[M],this.data._meshZ[M],this.data._value[M]];var _=this.data.hovertext||this.data.text;return A(_)&&_[M]!==void 0?s.textLabel=_[M]:_&&(s.textLabel=_),!0}},i.update=function(s){var c=this.scene,f=c.fullSceneLayout;this.data=o(s);function v(b,S,M,_){return S.map(function(w){return b.d2l(w,0,_)*M})}var h=t(v(f.xaxis,s._meshX,c.dataScale[0],s.xcalendar),v(f.yaxis,s._meshY,c.dataScale[1],s.ycalendar),v(f.zaxis,s._meshZ,c.dataScale[2],s.zcalendar)),T=t(s._meshI,s._meshJ,s._meshK),l={positions:h,cells:T,lightPosition:[s.lightposition.x,s.lightposition.y,s.lightposition.z],ambient:s.lighting.ambient,diffuse:s.lighting.diffuse,specular:s.lighting.specular,roughness:s.lighting.roughness,fresnel:s.lighting.fresnel,vertexNormalsEpsilon:s.lighting.vertexnormalsepsilon,faceNormalsEpsilon:s.lighting.facenormalsepsilon,opacity:s.opacity,opacityscale:s.opacityscale,contourEnable:s.contour.show,contourColor:E(s.contour.color).slice(0,3),contourWidth:s.contour.width,useFacetNormals:s.flatshading},y=e(s);l.vertexIntensity=s._meshIntensity,l.vertexIntensityBounds=[y.min,y.max],l.colormap=x(s),this.mesh.update(l)},i.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function n(s,c){var f=s.glplot.gl,v=d({gl:f}),h=new a(s,v,c.uid);return v._trace=h,h.update(c),s.glplot.add(v),h}G.exports=n}}),XL=He({"src/traces/volume/index.js"(Y,G){G.exports={attributes:B3(),supplyDefaults:WL(),calc:O3(),colorbar:{min:"cmin",max:"cmax"},plot:ZL(),moduleType:"trace",name:"volume",basePlotModule:ap(),categories:["gl3d","showLegend"],meta:{}}}}),YL=He({"lib/volume.js"(Y,G){G.exports=XL()}}),KL=He({"src/traces/mesh3d/defaults.js"(Y,G){var d=Ei(),x=Gr(),A=pf(),E=sg();G.exports=function(t,r,o,a){function i(v,h){return x.coerce(t,r,E,v,h)}function n(v){var h=v.map(function(T){var l=i(T);return l&&x.isArrayOrTypedArray(l)?l:null});return h.every(function(T){return T&&T.length===h[0].length})&&h}var s=n(["x","y","z"]);if(!s){r.visible=!1;return}if(n(["i","j","k"]),r.i&&(!r.j||!r.k)||r.j&&(!r.k||!r.i)||r.k&&(!r.i||!r.j)){r.visible=!1;return}var c=d.getComponentMethod("calendars","handleTraceDefaults");c(t,r,["x","y","z"],a),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach(function(v){i(v)});var f=i("contour.show");f&&(i("contour.color"),i("contour.width")),"intensity"in t?(i("intensity"),i("intensitymode"),A(t,r,a,i,{prefix:"",cLetter:"c"})):(r.showscale=!1,"facecolor"in t?i("facecolor"):"vertexcolor"in t?i("vertexcolor"):i("color",o)),i("text"),i("hovertext"),i("hovertemplate"),i("xhoverformat"),i("yhoverformat"),i("zhoverformat"),r._length=null}}}),JL=He({"src/traces/mesh3d/calc.js"(Y,G){var d=Sh();G.exports=function(A,E){E.intensity&&d(A,E,{vals:E.intensity,containerStr:"",cLetter:"c"})}}}),$L=He({"src/traces/mesh3d/convert.js"(Y,G){var d=Hf().gl_mesh3d,x=Hf().delaunay_triangulate,A=Hf().alpha_shape,E=Hf().convex_hull,e=fd().parseColorScale,t=Gr().isArrayOrTypedArray,r=cd(),o=Kl().extractOpts,a=lg();function i(l,y,b){this.scene=l,this.uid=b,this.mesh=y,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var n=i.prototype;n.handlePick=function(l){if(l.object===this.mesh){var y=l.index=l.data.index;l.data._cellCenter?l.traceCoordinate=l.data.dataCoordinate:l.traceCoordinate=[this.data.x[y],this.data.y[y],this.data.z[y]];var b=this.data.hovertext||this.data.text;return t(b)&&b[y]!==void 0?l.textLabel=b[y]:b&&(l.textLabel=b),!0}};function s(l){for(var y=[],b=l.length,S=0;S=y-.5)return!1;return!0}n.update=function(l){var y=this.scene,b=y.fullSceneLayout;this.data=l;var S=l.x.length,M=a(c(b.xaxis,l.x,y.dataScale[0],l.xcalendar),c(b.yaxis,l.y,y.dataScale[1],l.ycalendar),c(b.zaxis,l.z,y.dataScale[2],l.zcalendar)),_;if(l.i&&l.j&&l.k){if(l.i.length!==l.j.length||l.j.length!==l.k.length||!h(l.i,S)||!h(l.j,S)||!h(l.k,S))return;_=a(f(l.i),f(l.j),f(l.k))}else l.alphahull===0?_=E(M):l.alphahull>0?_=A(l.alphahull,M):_=v(l.delaunayaxis,M);var w={positions:M,cells:_,lightPosition:[l.lightposition.x,l.lightposition.y,l.lightposition.z],ambient:l.lighting.ambient,diffuse:l.lighting.diffuse,specular:l.lighting.specular,roughness:l.lighting.roughness,fresnel:l.lighting.fresnel,vertexNormalsEpsilon:l.lighting.vertexnormalsepsilon,faceNormalsEpsilon:l.lighting.facenormalsepsilon,opacity:l.opacity,contourEnable:l.contour.show,contourColor:r(l.contour.color).slice(0,3),contourWidth:l.contour.width,useFacetNormals:l.flatshading};if(l.intensity){var p=o(l);this.color="#fff";var u=l.intensitymode;w[u+"Intensity"]=l.intensity,w[u+"IntensityBounds"]=[p.min,p.max],w.colormap=e(l)}else l.vertexcolor?(this.color=l.vertexcolor[0],w.vertexColors=s(l.vertexcolor)):l.facecolor?(this.color=l.facecolor[0],w.cellColors=s(l.facecolor)):(this.color=l.color,w.meshColor=r(l.color));this.mesh.update(w)},n.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};function T(l,y){var b=l.glplot.gl,S=d({gl:b}),M=new i(l,S,y.uid);return S._trace=M,M.update(y),l.glplot.add(S),M}G.exports=T}}),QL=He({"src/traces/mesh3d/index.js"(Y,G){G.exports={attributes:sg(),supplyDefaults:KL(),calc:JL(),colorbar:{min:"cmin",max:"cmax"},plot:$L(),moduleType:"trace",name:"mesh3d",basePlotModule:ap(),categories:["gl3d","showLegend"],meta:{}}}}),eP=He({"lib/mesh3d.js"(Y,G){G.exports=QL()}}),N3=He({"src/traces/cone/attributes.js"(Y,G){var d=kl(),x=Gu().axisHoverFormat,A=Yo().hovertemplateAttrs,E=sg(),e=cl(),t=ho().extendFlat,r={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:A({editType:"calc"},{keys:["norm"]}),uhoverformat:x("u",1),vhoverformat:x("v",1),whoverformat:x("w",1),xhoverformat:x("x"),yhoverformat:x("y"),zhoverformat:x("z"),showlegend:t({},e.showlegend,{dflt:!1})};t(r,d("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"}));var o=["opacity","lightposition","lighting"];o.forEach(function(a){r[a]=E[a]}),r.hoverinfo=t({},e.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),G.exports=r}}),tP=He({"src/traces/cone/defaults.js"(Y,G){var d=Gr(),x=pf(),A=N3();G.exports=function(e,t,r,o){function a(T,l){return d.coerce(e,t,A,T,l)}var i=a("u"),n=a("v"),s=a("w"),c=a("x"),f=a("y"),v=a("z");if(!i||!i.length||!n||!n.length||!s||!s.length||!c||!c.length||!f||!f.length||!v||!v.length){t.visible=!1;return}var h=a("sizemode");a("sizeref",h==="raw"?1:.5),a("anchor"),a("lighting.ambient"),a("lighting.diffuse"),a("lighting.specular"),a("lighting.roughness"),a("lighting.fresnel"),a("lightposition.x"),a("lightposition.y"),a("lightposition.z"),x(e,t,o,a,{prefix:"",cLetter:"c"}),a("text"),a("hovertext"),a("hovertemplate"),a("uhoverformat"),a("vhoverformat"),a("whoverformat"),a("xhoverformat"),a("yhoverformat"),a("zhoverformat"),t._length=null}}}),rP=He({"src/traces/cone/calc.js"(Y,G){var d=Sh();G.exports=function(A,E){for(var e=E.u,t=E.v,r=E.w,o=Math.min(E.x.length,E.y.length,E.z.length,e.length,t.length,r.length),a=-1/0,i=1/0,n=0;n2?h=f.slice(1,v-1):v===2?h=[(f[0]+f[1])/2]:h=f,h}function n(f){var v=f.length;return v===1?[.5,.5]:[f[1]-f[0],f[v-1]-f[v-2]]}function s(f,v){var h=f.fullSceneLayout,T=f.dataScale,l=v._len,y={};function b(le,j){var J=h[j],$=T[r[j]];return A.simpleMap(le,function(X){return J.d2l(X)*$})}if(y.vectors=t(b(v._u,"xaxis"),b(v._v,"yaxis"),b(v._w,"zaxis"),l),!l)return{positions:[],cells:[]};var S=b(v._Xs,"xaxis"),M=b(v._Ys,"yaxis"),_=b(v._Zs,"zaxis");y.meshgrid=[S,M,_],y.gridFill=v._gridFill;var w=v._slen;if(w)y.startingPositions=t(b(v._startsX,"xaxis"),b(v._startsY,"yaxis"),b(v._startsZ,"zaxis"));else{for(var p=M[0],u=i(S),g=i(_),m=new Array(u.length*g.length),R=0,P=0;Pp&&(p=R[0]),R[1]u&&(u=R[1])}function m(R){switch(R.type){case"GeometryCollection":R.geometries.forEach(m);break;case"Point":g(R.coordinates);break;case"MultiPoint":R.coordinates.forEach(g);break}}b.arcs.forEach(function(R){for(var P=-1,z=R.length,F;++Pp&&(p=F[0]),F[1]u&&(u=F[1])});for(M in b.objects)m(b.objects[M]);return[_,w,p,u]}function e(b,S){for(var M,_=b.length,w=_-S;w<--_;)M=b[w],b[w++]=b[_],b[_]=M}function t(b,S){return typeof S=="string"&&(S=b.objects[S]),S.type==="GeometryCollection"?{type:"FeatureCollection",features:S.geometries.map(function(M){return r(b,M)})}:r(b,S)}function r(b,S){var M=S.id,_=S.bbox,w=S.properties==null?{}:S.properties,p=o(b,S);return M==null&&_==null?{type:"Feature",properties:w,geometry:p}:_==null?{type:"Feature",id:M,properties:w,geometry:p}:{type:"Feature",id:M,bbox:_,properties:w,geometry:p}}function o(b,S){var M=A(b.transform),_=b.arcs;function w(P,z){z.length&&z.pop();for(var F=_[P<0?~P:P],B=0,O=F.length;B1)_=s(b,S,M);else for(w=0,_=new Array(p=b.arcs.length);w1)for(var z=1,F=g(R[0]),B,O;zF&&(O=R[0],R[0]=R[z],R[z]=O,F=B);return R}).filter(function(m){return m.length>0})}}function h(b,S){for(var M=0,_=b.length;M<_;){var w=M+_>>>1;b[w]=2))throw new Error("n must be ≥2");m=b.bbox||E(b);var M=m[0],_=m[1],w=m[2],p=m[3],u;S={scale:[w-M?(w-M)/(u-1):1,p-_?(p-_)/(u-1):1],translate:[M,_]}}else m=b.bbox;var g=l(S),m,R,P=b.objects,z={};function F(L){return g(L)}function B(L){var N;switch(L.type){case"GeometryCollection":N={type:"GeometryCollection",geometries:L.geometries.map(B)};break;case"Point":N={type:"Point",coordinates:F(L.coordinates)};break;case"MultiPoint":N={type:"MultiPoint",coordinates:L.coordinates.map(F)};break;default:return L}return L.id!=null&&(N.id=L.id),L.bbox!=null&&(N.bbox=L.bbox),L.properties!=null&&(N.properties=L.properties),N}function O(L){var N=0,U=1,Z=L.length,Q,ue=new Array(Z);for(ue[0]=g(L[0],0);++N0&&(E.push(e),e=[])}return e.length>0&&E.push(e),E},Y.makeLine=function(d){return d.length===1?{type:"LineString",coordinates:d[0]}:{type:"MultiLineString",coordinates:d}},Y.makePolygon=function(d){if(d.length===1)return{type:"Polygon",coordinates:d};for(var x=new Array(d.length),A=0;Ae(B,z)),F)}function r(P,z,F={}){for(const O of P){if(O.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(O[O.length-1].length!==O[0].length)throw new Error("First and last Position are not equivalent.");for(let L=0;Lr(B,z)),F)}function a(P,z,F={}){if(P.length<2)throw new Error("coordinates must be an array of two or more positions");return A({type:"LineString",coordinates:P},z,F)}function i(P,z,F={}){return n(P.map(B=>a(B,z)),F)}function n(P,z={}){const F={type:"FeatureCollection"};return z.id&&(F.id=z.id),z.bbox&&(F.bbox=z.bbox),F.features=P,F}function s(P,z,F={}){return A({type:"MultiLineString",coordinates:P},z,F)}function c(P,z,F={}){return A({type:"MultiPoint",coordinates:P},z,F)}function f(P,z,F={}){return A({type:"MultiPolygon",coordinates:P},z,F)}function v(P,z,F={}){return A({type:"GeometryCollection",geometries:P},z,F)}function h(P,z=0){if(z&&!(z>=0))throw new Error("precision must be a positive number");const F=Math.pow(10,z||0);return Math.round(P*F)/F}function T(P,z="kilometers"){const F=d[z];if(!F)throw new Error(z+" units is invalid");return P*F}function l(P,z="kilometers"){const F=d[z];if(!F)throw new Error(z+" units is invalid");return P/F}function y(P,z){return M(l(P,z))}function b(P){let z=P%360;return z<0&&(z+=360),z}function S(P){return P=P%360,P>0?P>180?P-360:P:P<-180?P+360:P}function M(P){return P%(2*Math.PI)*180/Math.PI}function _(P){return P%360*Math.PI/180}function w(P,z="kilometers",F="kilometers"){if(!(P>=0))throw new Error("length must be a positive number");return T(l(P,z),F)}function p(P,z="meters",F="kilometers"){if(!(P>=0))throw new Error("area must be a positive number");const B=x[z];if(!B)throw new Error("invalid original units");const O=x[F];if(!O)throw new Error("invalid final units");return P/B*O}function u(P){return!isNaN(P)&&P!==null&&!Array.isArray(P)}function g(P){return P!==null&&typeof P=="object"&&!Array.isArray(P)}function m(P){if(!P)throw new Error("bbox is required");if(!Array.isArray(P))throw new Error("bbox must be an Array");if(P.length!==4&&P.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");P.forEach(z=>{if(!u(z))throw new Error("bbox must only contain numbers")})}function R(P){if(!P)throw new Error("id is required");if(["string","number"].indexOf(typeof P)===-1)throw new Error("id must be a number or a string")}Y.areaFactors=x,Y.azimuthToBearing=S,Y.bearingToAzimuth=b,Y.convertArea=p,Y.convertLength=w,Y.degreesToRadians=_,Y.earthRadius=G,Y.factors=d,Y.feature=A,Y.featureCollection=n,Y.geometry=E,Y.geometryCollection=v,Y.isNumber=u,Y.isObject=g,Y.lengthToDegrees=y,Y.lengthToRadians=l,Y.lineString=a,Y.lineStrings=i,Y.multiLineString=s,Y.multiPoint=c,Y.multiPolygon=f,Y.point=e,Y.points=t,Y.polygon=r,Y.polygons=o,Y.radiansToDegrees=M,Y.radiansToLength=T,Y.round=h,Y.validateBBox=m,Y.validateId=R}}),H_=He({"node_modules/@turf/meta/dist/cjs/index.cjs"(Y){Object.defineProperty(Y,"__esModule",{value:!0});var G=q_();function d(l,y,b){if(l!==null)for(var S,M,_,w,p,u,g,m=0,R=0,P,z=l.type,F=z==="FeatureCollection",B=z==="Feature",O=F?l.features.length:1,L=0;Lu||F>g||B>m){p=R,u=S,g=F,m=B,_=0;return}var O=G.lineString.call(void 0,[p,R],b.properties);if(y(O,S,M,B,_)===!1)return!1;_++,p=R})===!1)return!1}}})}function c(l,y,b){var S=b,M=!1;return s(l,function(_,w,p,u,g){M===!1&&b===void 0?S=_:S=y(S,_,w,p,u,g),M=!0}),S}function f(l,y){if(!l)throw new Error("geojson is required");i(l,function(b,S,M){if(b.geometry!==null){var _=b.geometry.type,w=b.geometry.coordinates;switch(_){case"LineString":if(y(b,S,M,0,0)===!1)return!1;break;case"Polygon":for(var p=0;pi+A(n),0)}function A(a){let i=0,n;switch(a.type){case"Polygon":return E(a.coordinates);case"MultiPolygon":for(n=0;n0){i+=Math.abs(r(a[0]));for(let n=1;n=i?(s+2)%i:s+2],h=c[0]*t,T=f[1]*t,l=v[0]*t;n+=(l-h)*Math.sin(T),s++}return n*e}var o=x;Y.area=x,Y.default=o}}),dP=He({"node_modules/@turf/centroid/dist/cjs/index.cjs"(Y){Object.defineProperty(Y,"__esModule",{value:!0});var G=q_(),d=H_();function x(E,e={}){let t=0,r=0,o=0;return d.coordEach.call(void 0,E,function(a){t+=a[0],r+=a[1],o++},!0),G.point.call(void 0,[t/o,r/o],e.properties)}var A=x;Y.centroid=x,Y.default=A}}),pP=He({"node_modules/@turf/bbox/dist/cjs/index.cjs"(Y){Object.defineProperty(Y,"__esModule",{value:!0});var G=H_();function d(A,E={}){if(A.bbox!=null&&E.recompute!==!0)return A.bbox;const e=[1/0,1/0,-1/0,-1/0];return G.coordEach.call(void 0,A,t=>{e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]0&&z[F+1][0]<0)return F;return null}switch(w==="RUS"||w==="FJI"?u=function(z){var F;if(P(z)===null)F=z;else for(F=new Array(z.length),R=0;RF?B[O++]=[z[R][0]+360,z[R][1]]:R===F?(B[O++]=z[R],B[O++]=[z[R][0],-90]):B[O++]=z[R];var L=i.tester(B);L.pts.pop(),p.push(L)}:u=function(z){p.push(i.tester(z))},M.type){case"MultiPolygon":for(g=0;g<_.length;g++)for(m=0;m<_[g].length;m++)u(_[g][m]);break;case"Polygon":for(g=0;g<_.length;g++)u(_[g]);break}return p}function h(S){var M=S.geojson,_=window.PlotlyGeoAssets||{},w=typeof M=="string"?_[M]:M;return o(w)?w:(r.error("Oops ... something went wrong when fetching "+M),!1)}function T(S){var M=S[0].trace,_=h(M);if(!_)return!1;var w={},p=[],u;for(u=0;u0?L.properties.ct=l(L):L.properties.ct=[NaN,NaN],B.fIn=z,B.fOut=L,p.push(L)}else r.log(["Location",B.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete w[F]}switch(_.type){case"FeatureCollection":var R=_.features;for(u=0;up&&(p=m,_=g)}else _=M;return E(_).geometry.coordinates}function y(S){var M=window.PlotlyGeoAssets||{},_=[];function w(R){return new Promise(function(P,z){d.json(R,function(F,B){if(F){delete M[R];var O=F.status===404?'GeoJSON at URL "'+R+'" does not exist.':"Unexpected error while fetching from "+R;return z(new Error(O))}return M[R]=B,P(B)})})}function p(R){return new Promise(function(P,z){var F=0,B=setInterval(function(){if(M[R]&&M[R]!=="pending")return clearInterval(B),P(M[R]);if(F>100)return clearInterval(B),z("Unexpected error while fetching from "+R);F++},50)})}for(var u=0;u")}}}),yP=He({"src/traces/scattergeo/event_data.js"(Y,G){G.exports=function(x,A,E,e,t){x.lon=A.lon,x.lat=A.lat,x.location=A.loc?A.loc:null;var r=e[t];return r.fIn&&r.fIn.properties&&(x.properties=r.fIn.properties),x}}}),mP=He({"src/traces/scattergeo/select.js"(Y,G){var d=Rl(),x=lo().BADNUM;G.exports=function(E,e){var t=E.cd,r=E.xaxis,o=E.yaxis,a=[],i=t[0].trace,n,s,c,f,v,h=!d.hasMarkers(i)&&!d.hasText(i);if(h)return[];if(e===!1)for(v=0;vX?1:$>=X?0:NaN}function A($){return $.length===1&&($=E($)),{left:function(X,re,ee,q){for(ee==null&&(ee=0),q==null&&(q=X.length);ee>>1;$(X[ae],re)<0?ee=ae+1:q=ae}return ee},right:function(X,re,ee,q){for(ee==null&&(ee=0),q==null&&(q=X.length);ee>>1;$(X[ae],re)>0?q=ae:ee=ae+1}return ee}}}function E($){return function(X,re){return x($(X),re)}}var e=A(x),t=e.right,r=e.left;function o($,X){X==null&&(X=a);for(var re=0,ee=$.length-1,q=$[0],ae=new Array(ee<0?0:ee);re$?1:X>=$?0:NaN}function s($){return $===null?NaN:+$}function c($,X){var re=$.length,ee=0,q=-1,ae=0,ie,fe,we=0;if(X==null)for(;++q1)return we/(ee-1)}function f($,X){var re=c($,X);return re&&Math.sqrt(re)}function v($,X){var re=$.length,ee=-1,q,ae,ie;if(X==null){for(;++ee=q)for(ae=ie=q;++eeq&&(ae=q),ie=q)for(ae=ie=q;++eeq&&(ae=q),ie0)return[$];if((ee=X<$)&&(ae=$,$=X,X=ae),(fe=u($,X,re))===0||!isFinite(fe))return[];if(fe>0)for($=Math.ceil($/fe),X=Math.floor(X/fe),ie=new Array(ae=Math.ceil(X-$+1));++q=0?(ae>=M?10:ae>=_?5:ae>=w?2:1)*Math.pow(10,q):-Math.pow(10,-q)/(ae>=M?10:ae>=_?5:ae>=w?2:1)}function g($,X,re){var ee=Math.abs(X-$)/Math.max(0,re),q=Math.pow(10,Math.floor(Math.log(ee)/Math.LN10)),ae=ee/q;return ae>=M?q*=10:ae>=_?q*=5:ae>=w&&(q*=2),X<$?-q:q}function m($){return Math.ceil(Math.log($.length)/Math.LN2)+1}function R(){var $=b,X=v,re=m;function ee(q){var ae,ie=q.length,fe,we=new Array(ie);for(ae=0;aeCe;)qe.pop(),--et;var Qe=new Array(et+1),Ke;for(ae=0;ae<=et;++ae)Ke=Qe[ae]=[],Ke.x0=ae>0?qe[ae-1]:Fe,Ke.x1=ae=1)return+re($[ee-1],ee-1,$);var ee,q=(ee-1)*X,ae=Math.floor(q),ie=+re($[ae],ae,$),fe=+re($[ae+1],ae+1,$);return ie+(fe-ie)*(q-ae)}}function z($,X,re){return $=l.call($,s).sort(x),Math.ceil((re-X)/(2*(P($,.75)-P($,.25))*Math.pow($.length,-1/3)))}function F($,X,re){return Math.ceil((re-X)/(3.5*f($)*Math.pow($.length,-1/3)))}function B($,X){var re=$.length,ee=-1,q,ae;if(X==null){for(;++ee=q)for(ae=q;++eeae&&(ae=q)}else for(;++ee=q)for(ae=q;++eeae&&(ae=q);return ae}function O($,X){var re=$.length,ee=re,q=-1,ae,ie=0;if(X==null)for(;++q=0;)for(ie=$[X],re=ie.length;--re>=0;)ae[--q]=ie[re];return ae}function U($,X){var re=$.length,ee=-1,q,ae;if(X==null){for(;++ee=q)for(ae=q;++eeq&&(ae=q)}else for(;++ee=q)for(ae=q;++eeq&&(ae=q);return ae}function Z($,X){for(var re=X.length,ee=new Array(re);re--;)ee[re]=$[X[re]];return ee}function Q($,X){if(re=$.length){var re,ee=0,q=0,ae,ie=$[q];for(X==null&&(X=x);++ee0?1:Ht<0?-1:0},p=Math.sqrt,u=Math.tan;function g(Ht){return Ht>1?0:Ht<-1?a:Math.acos(Ht)}function m(Ht){return Ht>1?i:Ht<-1?-i:Math.asin(Ht)}function R(Ht){return(Ht=_(Ht/2))*Ht}function P(){}function z(Ht,ur){Ht&&B.hasOwnProperty(Ht.type)&&B[Ht.type](Ht,ur)}var F={Feature:function(Ht,ur){z(Ht.geometry,ur)},FeatureCollection:function(Ht,ur){for(var qr=Ht.features,Or=-1,ua=qr.length;++Or=0?1:-1,ua=Or*qr,Fa=l(ur),ja=_(ur),sn=j*ja,gn=le*Fa+sn*l(ua),kn=sn*Or*_(ua);U.add(T(kn,gn)),oe=Ht,le=Fa,j=ja}function q(Ht){return Z.reset(),N(Ht,J),Z*2}function ae(Ht){return[T(Ht[1],Ht[0]),m(Ht[2])]}function ie(Ht){var ur=Ht[0],qr=Ht[1],Or=l(qr);return[Or*l(ur),Or*_(ur),_(qr)]}function fe(Ht,ur){return Ht[0]*ur[0]+Ht[1]*ur[1]+Ht[2]*ur[2]}function we(Ht,ur){return[Ht[1]*ur[2]-Ht[2]*ur[1],Ht[2]*ur[0]-Ht[0]*ur[2],Ht[0]*ur[1]-Ht[1]*ur[0]]}function Ae(Ht,ur){Ht[0]+=ur[0],Ht[1]+=ur[1],Ht[2]+=ur[2]}function Fe(Ht,ur){return[Ht[0]*ur,Ht[1]*ur,Ht[2]*ur]}function Ce(Ht){var ur=p(Ht[0]*Ht[0]+Ht[1]*Ht[1]+Ht[2]*Ht[2]);Ht[0]/=ur,Ht[1]/=ur,Ht[2]/=ur}var qe,et,Qe,Ke,Xe,Me,xe,ce,Re=A(),$e,rt,Je={point:At,lineStart:Rt,lineEnd:Ut,polygonStart:function(){Je.point=ir,Je.lineStart=ar,Je.lineEnd=Mr,Re.reset(),J.polygonStart()},polygonEnd:function(){J.polygonEnd(),Je.point=At,Je.lineStart=Rt,Je.lineEnd=Ut,U<0?(qe=-(Qe=180),et=-(Ke=90)):Re>r?Ke=90:Re<-r&&(et=-90),rt[0]=qe,rt[1]=Qe},sphere:function(){qe=-(Qe=180),et=-(Ke=90)}};function At(Ht,ur){$e.push(rt=[qe=Ht,Qe=Ht]),urKe&&(Ke=ur)}function St(Ht,ur){var qr=ie([Ht*f,ur*f]);if(ce){var Or=we(ce,qr),ua=[Or[1],-Or[0],0],Fa=we(ua,Or);Ce(Fa),Fa=ae(Fa);var ja=Ht-Xe,sn=ja>0?1:-1,gn=Fa[0]*c*sn,kn,Ja=v(ja)>180;Ja^(sn*XeKe&&(Ke=kn)):(gn=(gn+360)%360-180,Ja^(sn*XeKe&&(Ke=ur))),Ja?Htfr(qe,Qe)&&(Qe=Ht):fr(Ht,Qe)>fr(qe,Qe)&&(qe=Ht):Qe>=qe?(HtQe&&(Qe=Ht)):Ht>Xe?fr(qe,Ht)>fr(qe,Qe)&&(Qe=Ht):fr(Ht,Qe)>fr(qe,Qe)&&(qe=Ht)}else $e.push(rt=[qe=Ht,Qe=Ht]);urKe&&(Ke=ur),ce=qr,Xe=Ht}function Rt(){Je.point=St}function Ut(){rt[0]=qe,rt[1]=Qe,Je.point=At,ce=null}function ir(Ht,ur){if(ce){var qr=Ht-Xe;Re.add(v(qr)>180?qr+(qr>0?360:-360):qr)}else Me=Ht,xe=ur;J.point(Ht,ur),St(Ht,ur)}function ar(){J.lineStart()}function Mr(){ir(Me,xe),J.lineEnd(),v(Re)>r&&(qe=-(Qe=180)),rt[0]=qe,rt[1]=Qe,ce=null}function fr(Ht,ur){return(ur-=Ht)<0?ur+360:ur}function dr(Ht,ur){return Ht[0]-ur[0]}function pt(Ht,ur){return Ht[0]<=Ht[1]?Ht[0]<=ur&&ur<=Ht[1]:urfr(Or[0],Or[1])&&(Or[1]=ua[1]),fr(ua[0],Or[1])>fr(Or[0],Or[1])&&(Or[0]=ua[0])):Fa.push(Or=ua);for(ja=-1/0,qr=Fa.length-1,ur=0,Or=Fa[qr];ur<=qr;Or=ua,++ur)ua=Fa[ur],(sn=fr(Or[1],ua[0]))>ja&&(ja=sn,qe=ua[0],Qe=Or[1])}return $e=rt=null,qe===1/0||et===1/0?[[NaN,NaN],[NaN,NaN]]:[[qe,et],[Qe,Ke]]}var Ge,Oe,ve,ge,be,Pe,We,ct,_t,Mt,Nt,Bt,qt,Zt,lr,ta,da={sphere:P,point:wa,lineStart:Ia,lineEnd:Ka,polygonStart:function(){da.lineStart=Vt,da.lineEnd=Lt},polygonEnd:function(){da.lineStart=Ia,da.lineEnd=Ka}};function wa(Ht,ur){Ht*=f,ur*=f;var qr=l(ur);ma(qr*l(Ht),qr*_(Ht),_(ur))}function ma(Ht,ur,qr){++Ge,ve+=(Ht-ve)/Ge,ge+=(ur-ge)/Ge,be+=(qr-be)/Ge}function Ia(){da.point=va}function va(Ht,ur){Ht*=f,ur*=f;var qr=l(ur);Zt=qr*l(Ht),lr=qr*_(Ht),ta=_(ur),da.point=La,ma(Zt,lr,ta)}function La(Ht,ur){Ht*=f,ur*=f;var qr=l(ur),Or=qr*l(Ht),ua=qr*_(Ht),Fa=_(ur),ja=T(p((ja=lr*Fa-ta*ua)*ja+(ja=ta*Or-Zt*Fa)*ja+(ja=Zt*ua-lr*Or)*ja),Zt*Or+lr*ua+ta*Fa);Oe+=ja,Pe+=ja*(Zt+(Zt=Or)),We+=ja*(lr+(lr=ua)),ct+=ja*(ta+(ta=Fa)),ma(Zt,lr,ta)}function Ka(){da.point=wa}function Vt(){da.point=jt}function Lt(){Ot(Bt,qt),da.point=wa}function jt(Ht,ur){Bt=Ht,qt=ur,Ht*=f,ur*=f,da.point=Ot;var qr=l(ur);Zt=qr*l(Ht),lr=qr*_(Ht),ta=_(ur),ma(Zt,lr,ta)}function Ot(Ht,ur){Ht*=f,ur*=f;var qr=l(ur),Or=qr*l(Ht),ua=qr*_(Ht),Fa=_(ur),ja=lr*Fa-ta*ua,sn=ta*Or-Zt*Fa,gn=Zt*ua-lr*Or,kn=p(ja*ja+sn*sn+gn*gn),Ja=m(kn),_n=kn&&-Ja/kn;_t+=_n*ja,Mt+=_n*sn,Nt+=_n*gn,Oe+=Ja,Pe+=Ja*(Zt+(Zt=Or)),We+=Ja*(lr+(lr=ua)),ct+=Ja*(ta+(ta=Fa)),ma(Zt,lr,ta)}function gr(Ht){Ge=Oe=ve=ge=be=Pe=We=ct=_t=Mt=Nt=0,N(Ht,da);var ur=_t,qr=Mt,Or=Nt,ua=ur*ur+qr*qr+Or*Or;return uaa?Ht+Math.round(-Ht/s)*s:Ht,ur]}Ur.invert=Ur;function ga(Ht,ur,qr){return(Ht%=s)?ur||qr?na(Pa(Ht),sa(ur,qr)):Pa(Ht):ur||qr?sa(ur,qr):Ur}function Aa(Ht){return function(ur,qr){return ur+=Ht,[ur>a?ur-s:ur<-a?ur+s:ur,qr]}}function Pa(Ht){var ur=Aa(Ht);return ur.invert=Aa(-Ht),ur}function sa(Ht,ur){var qr=l(Ht),Or=_(Ht),ua=l(ur),Fa=_(ur);function ja(sn,gn){var kn=l(gn),Ja=l(sn)*kn,_n=_(sn)*kn,on=_(gn),Wa=on*qr+Ja*Or;return[T(_n*ua-Wa*Fa,Ja*qr-on*Or),m(Wa*ua+_n*Fa)]}return ja.invert=function(sn,gn){var kn=l(gn),Ja=l(sn)*kn,_n=_(sn)*kn,on=_(gn),Wa=on*ua-_n*Fa;return[T(_n*ua+on*Fa,Ja*qr+Wa*Or),m(Wa*qr-Ja*Or)]},ja}function Oa(Ht){Ht=ga(Ht[0]*f,Ht[1]*f,Ht.length>2?Ht[2]*f:0);function ur(qr){return qr=Ht(qr[0]*f,qr[1]*f),qr[0]*=c,qr[1]*=c,qr}return ur.invert=function(qr){return qr=Ht.invert(qr[0]*f,qr[1]*f),qr[0]*=c,qr[1]*=c,qr},ur}function dt(Ht,ur,qr,Or,ua,Fa){if(qr){var ja=l(ur),sn=_(ur),gn=Or*qr;ua==null?(ua=ur+Or*s,Fa=ur-gn/2):(ua=vt(ja,ua),Fa=vt(ja,Fa),(Or>0?uaFa)&&(ua+=Or*s));for(var kn,Ja=ua;Or>0?Ja>Fa:Ja1&&Ht.push(Ht.pop().concat(Ht.shift()))},result:function(){var qr=Ht;return Ht=[],ur=null,qr}}}function _r(Ht,ur){return v(Ht[0]-ur[0])=0;--sn)ua.point((_n=Ja[sn])[0],_n[1]);else Or(on.x,on.p.x,-1,ua);on=on.p}on=on.o,Ja=on.z,Wa=!Wa}while(!on.v);ua.lineEnd()}}}function zr(Ht){if(ur=Ht.length){for(var ur,qr=0,Or=Ht[0],ua;++qr=0?1:-1,os=Ls*$o,As=os>a,jo=zi*Ki;if(Pr.add(T(jo*Ls*_(os),ki*ko+jo*l(os))),ja+=As?$o+Ls*s:$o,As^Wa>=qr^Bn>=qr){var il=we(ie(on),ie(Ni));Ce(il);var Qs=we(Fa,il);Ce(Qs);var Ss=(As^$o>=0?-1:1)*m(Qs[2]);(Or>Ss||Or===Ss&&(il[0]||il[1]))&&(sn+=As^$o>=0?1:-1)}}return(ja<-r||ja0){for(gn||(ua.polygonStart(),gn=!0),ua.lineStart(),ko=0;ko1&&An&2&&Ki.push(Ki.pop().concat(Ki.shift())),Ja.push(Ki.filter(wt))}}return on}}function wt(Ht){return Ht.length>1}function Qt(Ht,ur){return((Ht=Ht.x)[0]<0?Ht[1]-i-r:i-Ht[1])-((ur=ur.x)[0]<0?ur[1]-i-r:i-ur[1])}var mr=Jr(function(){return!0},$r,Sa,[-a,-i]);function $r(Ht){var ur=NaN,qr=NaN,Or=NaN,ua;return{lineStart:function(){Ht.lineStart(),ua=1},point:function(Fa,ja){var sn=Fa>0?a:-a,gn=v(Fa-ur);v(gn-a)0?i:-i),Ht.point(Or,qr),Ht.lineEnd(),Ht.lineStart(),Ht.point(sn,qr),Ht.point(Fa,qr),ua=0):Or!==sn&&gn>=a&&(v(ur-Or)r?h((_(ur)*(Fa=l(Or))*_(qr)-_(Or)*(ua=l(ur))*_(Ht))/(ua*Fa*ja)):(ur+Or)/2}function Sa(Ht,ur,qr,Or){var ua;if(Ht==null)ua=qr*i,Or.point(-a,ua),Or.point(0,ua),Or.point(a,ua),Or.point(a,0),Or.point(a,-ua),Or.point(0,-ua),Or.point(-a,-ua),Or.point(-a,0),Or.point(-a,ua);else if(v(Ht[0]-ur[0])>r){var Fa=Ht[0]0,ua=v(ur)>r;function Fa(Ja,_n,on,Wa){dt(Wa,Ht,qr,on,Ja,_n)}function ja(Ja,_n){return l(Ja)*l(_n)>ur}function sn(Ja){var _n,on,Wa,On,zi;return{lineStart:function(){On=Wa=!1,zi=1},point:function(ki,ji){var Ni=[ki,ji],Bn,An=ja(ki,ji),Ki=Or?An?0:kn(ki,ji):An?kn(ki+(ki<0?a:-a),ji):0;if(!_n&&(On=Wa=An)&&Ja.lineStart(),An!==Wa&&(Bn=gn(_n,Ni),(!Bn||_r(_n,Bn)||_r(Ni,Bn))&&(Ni[2]=1)),An!==Wa)zi=0,An?(Ja.lineStart(),Bn=gn(Ni,_n),Ja.point(Bn[0],Bn[1])):(Bn=gn(_n,Ni),Ja.point(Bn[0],Bn[1],2),Ja.lineEnd()),_n=Bn;else if(ua&&_n&&Or^An){var ko;!(Ki&on)&&(ko=gn(Ni,_n,!0))&&(zi=0,Or?(Ja.lineStart(),Ja.point(ko[0][0],ko[0][1]),Ja.point(ko[1][0],ko[1][1]),Ja.lineEnd()):(Ja.point(ko[1][0],ko[1][1]),Ja.lineEnd(),Ja.lineStart(),Ja.point(ko[0][0],ko[0][1],3)))}An&&(!_n||!_r(_n,Ni))&&Ja.point(Ni[0],Ni[1]),_n=Ni,Wa=An,on=Ki},lineEnd:function(){Wa&&Ja.lineEnd(),_n=null},clean:function(){return zi|(On&&Wa)<<1}}}function gn(Ja,_n,on){var Wa=ie(Ja),On=ie(_n),zi=[1,0,0],ki=we(Wa,On),ji=fe(ki,ki),Ni=ki[0],Bn=ji-Ni*Ni;if(!Bn)return!on&&Ja;var An=ur*ji/Bn,Ki=-ur*Ni/Bn,ko=we(zi,ki),$o=Fe(zi,An),Ls=Fe(ki,Ki);Ae($o,Ls);var os=ko,As=fe($o,os),jo=fe(os,os),il=As*As-jo*(fe($o,$o)-1);if(!(il<0)){var Qs=p(il),Ss=Fe(os,(-As-Qs)/jo);if(Ae(Ss,$o),Ss=ae(Ss),!on)return Ss;var fi=Ja[0],ao=_n[0],gs=Ja[1],Jo=_n[1],Bl;ao0^Ss[1]<(v(Ss[0]-fi)a^(fi<=Ss[0]&&Ss[0]<=ao)){var ql=Fe(os,(-As+Qs)/jo);return Ae(ql,$o),[Ss,ae(ql)]}}}function kn(Ja,_n){var on=Or?Ht:a-Ht,Wa=0;return Ja<-on?Wa|=1:Ja>on&&(Wa|=2),_n<-on?Wa|=4:_n>on&&(Wa|=8),Wa}return Jr(ja,sn,Fa,Or?[0,-Ht]:[-a,Ht-a])}function ra(Ht,ur,qr,Or,ua,Fa){var ja=Ht[0],sn=Ht[1],gn=ur[0],kn=ur[1],Ja=0,_n=1,on=gn-ja,Wa=kn-sn,On;if(On=qr-ja,!(!on&&On>0)){if(On/=on,on<0){if(On0){if(On>_n)return;On>Ja&&(Ja=On)}if(On=ua-ja,!(!on&&On<0)){if(On/=on,on<0){if(On>_n)return;On>Ja&&(Ja=On)}else if(on>0){if(On0)){if(On/=Wa,Wa<0){if(On0){if(On>_n)return;On>Ja&&(Ja=On)}if(On=Fa-sn,!(!Wa&&On<0)){if(On/=Wa,Wa<0){if(On>_n)return;On>Ja&&(Ja=On)}else if(Wa>0){if(On0&&(Ht[0]=ja+Ja*on,Ht[1]=sn+Ja*Wa),_n<1&&(ur[0]=ja+_n*on,ur[1]=sn+_n*Wa),!0}}}}}var pa=1e9,pn=-pa;function Ga(Ht,ur,qr,Or){function ua(kn,Ja){return Ht<=kn&&kn<=qr&&ur<=Ja&&Ja<=Or}function Fa(kn,Ja,_n,on){var Wa=0,On=0;if(kn==null||(Wa=ja(kn,_n))!==(On=ja(Ja,_n))||gn(kn,Ja)<0^_n>0)do on.point(Wa===0||Wa===3?Ht:qr,Wa>1?Or:ur);while((Wa=(Wa+_n+4)%4)!==On);else on.point(Ja[0],Ja[1])}function ja(kn,Ja){return v(kn[0]-Ht)0?0:3:v(kn[0]-qr)0?2:1:v(kn[1]-ur)0?1:0:Ja>0?3:2}function sn(kn,Ja){return gn(kn.x,Ja.x)}function gn(kn,Ja){var _n=ja(kn,1),on=ja(Ja,1);return _n!==on?_n-on:_n===0?Ja[1]-kn[1]:_n===1?kn[0]-Ja[0]:_n===2?kn[1]-Ja[1]:Ja[0]-kn[0]}return function(kn){var Ja=kn,_n=Er(),on,Wa,On,zi,ki,ji,Ni,Bn,An,Ki,ko,$o={point:Ls,lineStart:il,lineEnd:Qs,polygonStart:As,polygonEnd:jo};function Ls(fi,ao){ua(fi,ao)&&Ja.point(fi,ao)}function os(){for(var fi=0,ao=0,gs=Wa.length;aoOr&&(Vu-cc)*(Or-ql)>(ol-ql)*(Ht-cc)&&++fi:ol<=Or&&(Vu-cc)*(Or-ql)<(ol-ql)*(Ht-cc)&&--fi;return fi}function As(){Ja=_n,on=[],Wa=[],ko=!0}function jo(){var fi=os(),ao=ko&&fi,gs=(on=x.merge(on)).length;(ao||gs)&&(kn.polygonStart(),ao&&(kn.lineStart(),Fa(null,null,1,kn),kn.lineEnd()),gs&&kr(on,sn,fi,Fa,kn),kn.polygonEnd()),Ja=kn,on=Wa=On=null}function il(){$o.point=Ss,Wa&&Wa.push(On=[]),Ki=!0,An=!1,Ni=Bn=NaN}function Qs(){on&&(Ss(zi,ki),ji&&An&&_n.rejoin(),on.push(_n.result())),$o.point=Ls,An&&Ja.lineEnd()}function Ss(fi,ao){var gs=ua(fi,ao);if(Wa&&On.push([fi,ao]),Ki)zi=fi,ki=ao,ji=gs,Ki=!1,gs&&(Ja.lineStart(),Ja.point(fi,ao));else if(gs&&An)Ja.point(fi,ao);else{var Jo=[Ni=Math.max(pn,Math.min(pa,Ni)),Bn=Math.max(pn,Math.min(pa,Bn))],Bl=[fi=Math.max(pn,Math.min(pa,fi)),ao=Math.max(pn,Math.min(pa,ao))];ra(Jo,Bl,Ht,ur,qr,Or)?(An||(Ja.lineStart(),Ja.point(Jo[0],Jo[1])),Ja.point(Bl[0],Bl[1]),gs||Ja.lineEnd(),ko=!1):gs&&(Ja.lineStart(),Ja.point(fi,ao),ko=!1)}Ni=fi,Bn=ao,An=gs}return $o}}function qn(){var Ht=0,ur=0,qr=960,Or=500,ua,Fa,ja;return ja={stream:function(sn){return ua&&Fa===sn?ua:ua=Ga(Ht,ur,qr,Or)(Fa=sn)},extent:function(sn){return arguments.length?(Ht=+sn[0][0],ur=+sn[0][1],qr=+sn[1][0],Or=+sn[1][1],ua=Fa=null,ja):[[Ht,ur],[qr,Or]]}}}var Vn=A(),di,yi,Ci,ci={sphere:P,point:P,lineStart:ei,lineEnd:P,polygonStart:P,polygonEnd:P};function ei(){ci.point=uo,ci.lineEnd=mi}function mi(){ci.point=ci.lineEnd=P}function uo(Ht,ur){Ht*=f,ur*=f,di=Ht,yi=_(ur),Ci=l(ur),ci.point=Lo}function Lo(Ht,ur){Ht*=f,ur*=f;var qr=_(ur),Or=l(ur),ua=v(Ht-di),Fa=l(ua),ja=_(ua),sn=Or*ja,gn=Ci*qr-yi*Or*Fa,kn=yi*qr+Ci*Or*Fa;Vn.add(T(p(sn*sn+gn*gn),kn)),di=Ht,yi=qr,Ci=Or}function Wo(Ht){return Vn.reset(),N(Ht,ci),+Vn}var li=[null,null],Ii={type:"LineString",coordinates:li};function xi(Ht,ur){return li[0]=Ht,li[1]=ur,Wo(Ii)}var Ao={Feature:function(Ht,ur){return Ro(Ht.geometry,ur)},FeatureCollection:function(Ht,ur){for(var qr=Ht.features,Or=-1,ua=qr.length;++Or0&&(ua=xi(Ht[Fa],Ht[Fa-1]),ua>0&&qr<=ua&&Or<=ua&&(qr+Or-ua)*(1-Math.pow((qr-Or)/ua,2))r}).map(on)).concat(x.range(y(Fa/kn)*kn,ua,kn).filter(function(Bn){return v(Bn%_n)>r}).map(Wa))}return ji.lines=function(){return Ni().map(function(Bn){return{type:"LineString",coordinates:Bn}})},ji.outline=function(){return{type:"Polygon",coordinates:[On(Or).concat(zi(ja).slice(1),On(qr).reverse().slice(1),zi(sn).reverse().slice(1))]}},ji.extent=function(Bn){return arguments.length?ji.extentMajor(Bn).extentMinor(Bn):ji.extentMinor()},ji.extentMajor=function(Bn){return arguments.length?(Or=+Bn[0][0],qr=+Bn[1][0],sn=+Bn[0][1],ja=+Bn[1][1],Or>qr&&(Bn=Or,Or=qr,qr=Bn),sn>ja&&(Bn=sn,sn=ja,ja=Bn),ji.precision(ki)):[[Or,sn],[qr,ja]]},ji.extentMinor=function(Bn){return arguments.length?(ur=+Bn[0][0],Ht=+Bn[1][0],Fa=+Bn[0][1],ua=+Bn[1][1],ur>Ht&&(Bn=ur,ur=Ht,Ht=Bn),Fa>ua&&(Bn=Fa,Fa=ua,ua=Bn),ji.precision(ki)):[[ur,Fa],[Ht,ua]]},ji.step=function(Bn){return arguments.length?ji.stepMajor(Bn).stepMinor(Bn):ji.stepMinor()},ji.stepMajor=function(Bn){return arguments.length?(Ja=+Bn[0],_n=+Bn[1],ji):[Ja,_n]},ji.stepMinor=function(Bn){return arguments.length?(gn=+Bn[0],kn=+Bn[1],ji):[gn,kn]},ji.precision=function(Bn){return arguments.length?(ki=+Bn,on=Qa(Fa,ua,90),Wa=Jn(ur,Ht,ki),On=Qa(sn,ja,90),zi=Jn(Or,qr,ki),ji):ki},ji.extentMajor([[-180,-90+r],[180,90-r]]).extentMinor([[-180,-80-r],[180,80+r]])}function ds(){return Os()()}function Ui(Ht,ur){var qr=Ht[0]*f,Or=Ht[1]*f,ua=ur[0]*f,Fa=ur[1]*f,ja=l(Or),sn=_(Or),gn=l(Fa),kn=_(Fa),Ja=ja*l(qr),_n=ja*_(qr),on=gn*l(ua),Wa=gn*_(ua),On=2*m(p(R(Fa-Or)+ja*gn*R(ua-qr))),zi=_(On),ki=On?function(ji){var Ni=_(ji*=On)/zi,Bn=_(On-ji)/zi,An=Bn*Ja+Ni*on,Ki=Bn*_n+Ni*Wa,ko=Bn*sn+Ni*kn;return[T(Ki,An)*c,T(ko,p(An*An+Ki*Ki))*c]}:function(){return[qr*c,Or*c]};return ki.distance=On,ki}function ms(Ht){return Ht}var Mo=A(),ws=A(),Ks,Rn,fo,Pi,zo={point:P,lineStart:P,lineEnd:P,polygonStart:function(){zo.lineStart=wo,zo.lineEnd=$l},polygonEnd:function(){zo.lineStart=zo.lineEnd=zo.point=P,Mo.add(v(ws)),ws.reset()},result:function(){var Ht=Mo/2;return Mo.reset(),Ht}};function wo(){zo.point=bi}function bi(Ht,ur){zo.point=wl,Ks=fo=Ht,Rn=Pi=ur}function wl(Ht,ur){ws.add(Pi*Ht-fo*ur),fo=Ht,Pi=ur}function $l(){wl(Ks,Rn)}var Js=1/0,Ql=Js,Ws=-Js,Is=Ws,Dl={point:Xu,lineStart:P,lineEnd:P,polygonStart:P,polygonEnd:P,result:function(){var Ht=[[Js,Ql],[Ws,Is]];return Ws=Is=-(Ql=Js=1/0),Ht}};function Xu(Ht,ur){HtWs&&(Ws=Ht),urIs&&(Is=ur)}var Lu=0,Bu=0,kf=0,gf=0,ns=0,_u=0,Nc=0,ml=0,fl=0,_l,Yu,Ts,Tl,Ko={point:Cs,lineStart:Nu,lineEnd:Bs,polygonStart:function(){Ko.lineStart=Gf,Ko.lineEnd=Eo},polygonEnd:function(){Ko.point=Cs,Ko.lineStart=Nu,Ko.lineEnd=Bs},result:function(){var Ht=fl?[Nc/fl,ml/fl]:_u?[gf/_u,ns/_u]:kf?[Lu/kf,Bu/kf]:[NaN,NaN];return Lu=Bu=kf=gf=ns=_u=Nc=ml=fl=0,Ht}};function Cs(Ht,ur){Lu+=Ht,Bu+=ur,++kf}function Nu(){Ko.point=Ul}function Ul(Ht,ur){Ko.point=Ku,Cs(Ts=Ht,Tl=ur)}function Ku(Ht,ur){var qr=Ht-Ts,Or=ur-Tl,ua=p(qr*qr+Or*Or);gf+=ua*(Ts+Ht)/2,ns+=ua*(Tl+ur)/2,_u+=ua,Cs(Ts=Ht,Tl=ur)}function Bs(){Ko.point=Cs}function Gf(){Ko.point=Wf}function Eo(){is(_l,Yu)}function Wf(Ht,ur){Ko.point=is,Cs(_l=Ts=Ht,Yu=Tl=ur)}function is(Ht,ur){var qr=Ht-Ts,Or=ur-Tl,ua=p(qr*qr+Or*Or);gf+=ua*(Ts+Ht)/2,ns+=ua*(Tl+ur)/2,_u+=ua,ua=Tl*Ht-Ts*ur,Nc+=ua*(Ts+Ht),ml+=ua*(Tl+ur),fl+=ua*3,Cs(Ts=Ht,Tl=ur)}function oo(Ht){this._context=Ht}oo.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,ur){switch(this._point){case 0:{this._context.moveTo(Ht,ur),this._point=1;break}case 1:{this._context.lineTo(Ht,ur);break}default:{this._context.moveTo(Ht+this._radius,ur),this._context.arc(Ht,ur,this._radius,0,s);break}}},result:P};var pc=A(),xu,zl,Kc,Ju,gc,hl={point:P,lineStart:function(){hl.point=yf},lineEnd:function(){xu&&Jc(zl,Kc),hl.point=P},polygonStart:function(){xu=!0},polygonEnd:function(){xu=null},result:function(){var Ht=+pc;return pc.reset(),Ht}};function yf(Ht,ur){hl.point=Jc,zl=Ju=Ht,Kc=gc=ur}function Jc(Ht,ur){Ju-=Ht,gc-=ur,pc.add(p(Ju*Ju+gc*gc)),Ju=Ht,gc=ur}function Uc(){this._string=[]}Uc.prototype={_radius:4.5,_circle:$u(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,ur){switch(this._point){case 0:{this._string.push("M",Ht,",",ur),this._point=1;break}case 1:{this._string.push("L",Ht,",",ur);break}default:{this._circle==null&&(this._circle=$u(this._radius)),this._string.push("M",Ht,",",ur,this._circle);break}}},result:function(){if(this._string.length){var Ht=this._string.join("");return this._string=[],Ht}else return null}};function $u(Ht){return"m0,"+Ht+"a"+Ht+","+Ht+" 0 1,1 0,"+-2*Ht+"a"+Ht+","+Ht+" 0 1,1 0,"+2*Ht+"z"}function jc(Ht,ur){var qr=4.5,Or,ua;function Fa(ja){return ja&&(typeof qr=="function"&&ua.pointRadius(+qr.apply(this,arguments)),N(ja,Or(ua))),ua.result()}return Fa.area=function(ja){return N(ja,Or(zo)),zo.result()},Fa.measure=function(ja){return N(ja,Or(hl)),hl.result()},Fa.bounds=function(ja){return N(ja,Or(Dl)),Dl.result()},Fa.centroid=function(ja){return N(ja,Or(Ko)),Ko.result()},Fa.projection=function(ja){return arguments.length?(Or=ja==null?(Ht=null,ms):(Ht=ja).stream,Fa):Ht},Fa.context=function(ja){return arguments.length?(ua=ja==null?(ur=null,new Uc):new oo(ur=ja),typeof qr!="function"&&ua.pointRadius(qr),Fa):ur},Fa.pointRadius=function(ja){return arguments.length?(qr=typeof ja=="function"?ja:(ua.pointRadius(+ja),+ja),Fa):qr},Fa.projection(Ht).context(ur)}function $c(Ht){return{stream:bu(Ht)}}function bu(Ht){return function(ur){var qr=new Qc;for(var Or in Ht)qr[Or]=Ht[Or];return qr.stream=ur,qr}}function Qc(){}Qc.prototype={constructor:Qc,point:function(Ht,ur){this.stream.point(Ht,ur)},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 sc(Ht,ur,qr){var Or=Ht.clipExtent&&Ht.clipExtent();return Ht.scale(150).translate([0,0]),Or!=null&&Ht.clipExtent(null),N(qr,Ht.stream(Dl)),ur(Dl.result()),Or!=null&&Ht.clipExtent(Or),Ht}function wu(Ht,ur,qr){return sc(Ht,function(Or){var ua=ur[1][0]-ur[0][0],Fa=ur[1][1]-ur[0][1],ja=Math.min(ua/(Or[1][0]-Or[0][0]),Fa/(Or[1][1]-Or[0][1])),sn=+ur[0][0]+(ua-ja*(Or[1][0]+Or[0][0]))/2,gn=+ur[0][1]+(Fa-ja*(Or[1][1]+Or[0][1]))/2;Ht.scale(150*ja).translate([sn,gn])},qr)}function eu(Ht,ur,qr){return wu(Ht,[[0,0],ur],qr)}function Sc(Ht,ur,qr){return sc(Ht,function(Or){var ua=+ur,Fa=ua/(Or[1][0]-Or[0][0]),ja=(ua-Fa*(Or[1][0]+Or[0][0]))/2,sn=-Fa*Or[0][1];Ht.scale(150*Fa).translate([ja,sn])},qr)}function ef(Ht,ur,qr){return sc(Ht,function(Or){var ua=+ur,Fa=ua/(Or[1][1]-Or[0][1]),ja=-Fa*Or[0][0],sn=(ua-Fa*(Or[1][1]+Or[0][1]))/2;Ht.scale(150*Fa).translate([ja,sn])},qr)}var ps=16,Vc=l(30*f);function Zf(Ht,ur){return+ur?Mc(Ht,ur):mf(Ht)}function mf(Ht){return bu({point:function(ur,qr){ur=Ht(ur,qr),this.stream.point(ur[0],ur[1])}})}function Mc(Ht,ur){function qr(Or,ua,Fa,ja,sn,gn,kn,Ja,_n,on,Wa,On,zi,ki){var ji=kn-Or,Ni=Ja-ua,Bn=ji*ji+Ni*Ni;if(Bn>4*ur&&zi--){var An=ja+on,Ki=sn+Wa,ko=gn+On,$o=p(An*An+Ki*Ki+ko*ko),Ls=m(ko/=$o),os=v(v(ko)-1)ur||v((ji*Qs+Ni*Ss)/Bn-.5)>.3||ja*on+sn*Wa+gn*On2?fi[2]%360*f:0,Qs()):[sn*c,gn*c,kn*c]},jo.angle=function(fi){return arguments.length?(_n=fi%360*f,Qs()):_n*c},jo.reflectX=function(fi){return arguments.length?(on=fi?-1:1,Qs()):on<0},jo.reflectY=function(fi){return arguments.length?(Wa=fi?-1:1,Qs()):Wa<0},jo.precision=function(fi){return arguments.length?(ko=Zf($o,Ki=fi*fi),Ss()):p(Ki)},jo.fitExtent=function(fi,ao){return wu(jo,fi,ao)},jo.fitSize=function(fi,ao){return eu(jo,fi,ao)},jo.fitWidth=function(fi,ao){return Sc(jo,fi,ao)},jo.fitHeight=function(fi,ao){return ef(jo,fi,ao)};function Qs(){var fi=Fl(qr,0,0,on,Wa,_n).apply(null,ur(Fa,ja)),ao=(_n?Fl:xf)(qr,Or-fi[0],ua-fi[1],on,Wa,_n);return Ja=ga(sn,gn,kn),$o=na(ur,ao),Ls=na(Ja,$o),ko=Zf($o,Ki),Ss()}function Ss(){return os=As=null,jo}return function(){return ur=Ht.apply(this,arguments),jo.invert=ur.invert&&il,Qs()}}function $s(Ht){var ur=0,qr=a/3,Or=Uu(Ht),ua=Or(ur,qr);return ua.parallels=function(Fa){return arguments.length?Or(ur=Fa[0]*f,qr=Fa[1]*f):[ur*c,qr*c]},ua}function Qu(Ht){var ur=l(Ht);function qr(Or,ua){return[Or*ur,_(ua)/ur]}return qr.invert=function(Or,ua){return[Or/ur,m(ua*ur)]},qr}function Tu(Ht,ur){var qr=_(Ht),Or=(qr+_(ur))/2;if(v(Or)=.12&&ki<.234&&zi>=-.425&&zi<-.214?ua:ki>=.166&&ki<.234&&zi>=-.214&&zi<-.115?ja:qr).invert(on)},Ja.stream=function(on){return Ht&&ur===on?Ht:Ht=yc([qr.stream(ur=on),ua.stream(on),ja.stream(on)])},Ja.precision=function(on){return arguments.length?(qr.precision(on),ua.precision(on),ja.precision(on),_n()):qr.precision()},Ja.scale=function(on){return arguments.length?(qr.scale(on),ua.scale(on*.35),ja.scale(on),Ja.translate(qr.translate())):qr.scale()},Ja.translate=function(on){if(!arguments.length)return qr.translate();var Wa=qr.scale(),On=+on[0],zi=+on[1];return Or=qr.translate(on).clipExtent([[On-.455*Wa,zi-.238*Wa],[On+.455*Wa,zi+.238*Wa]]).stream(kn),Fa=ua.translate([On-.307*Wa,zi+.201*Wa]).clipExtent([[On-.425*Wa+r,zi+.12*Wa+r],[On-.214*Wa-r,zi+.234*Wa-r]]).stream(kn),sn=ja.translate([On-.205*Wa,zi+.212*Wa]).clipExtent([[On-.214*Wa+r,zi+.166*Wa+r],[On-.115*Wa-r,zi+.234*Wa-r]]).stream(kn),_n()},Ja.fitExtent=function(on,Wa){return wu(Ja,on,Wa)},Ja.fitSize=function(on,Wa){return eu(Ja,on,Wa)},Ja.fitWidth=function(on,Wa){return Sc(Ja,on,Wa)},Ja.fitHeight=function(on,Wa){return ef(Ja,on,Wa)};function _n(){return Ht=ur=null,Ja}return Ja.scale(1070)}function ec(Ht){return function(ur,qr){var Or=l(ur),ua=l(qr),Fa=Ht(Or*ua);return[Fa*ua*_(ur),Fa*_(qr)]}}function Ec(Ht){return function(ur,qr){var Or=p(ur*ur+qr*qr),ua=Ht(Or),Fa=_(ua),ja=l(ua);return[T(ur*Fa,Or*ja),m(Or&&qr*Fa/Or)]}}var Cf=ec(function(Ht){return p(2/(1+Ht))});Cf.invert=Ec(function(Ht){return 2*m(Ht/2)});function nh(){return ru(Cf).scale(124.75).clipAngle(180-.001)}var lc=ec(function(Ht){return(Ht=g(Ht))&&Ht/_(Ht)});lc.invert=Ec(function(Ht){return Ht});function kc(){return ru(lc).scale(79.4188).clipAngle(180-.001)}function nu(Ht,ur){return[Ht,S(u((i+ur)/2))]}nu.invert=function(Ht,ur){return[Ht,2*h(b(ur))-i]};function tf(){return Cl(nu).scale(961/s)}function Cl(Ht){var ur=ru(Ht),qr=ur.center,Or=ur.scale,ua=ur.translate,Fa=ur.clipExtent,ja=null,sn,gn,kn;ur.scale=function(_n){return arguments.length?(Or(_n),Ja()):Or()},ur.translate=function(_n){return arguments.length?(ua(_n),Ja()):ua()},ur.center=function(_n){return arguments.length?(qr(_n),Ja()):qr()},ur.clipExtent=function(_n){return arguments.length?(_n==null?ja=sn=gn=kn=null:(ja=+_n[0][0],sn=+_n[0][1],gn=+_n[1][0],kn=+_n[1][1]),Ja()):ja==null?null:[[ja,sn],[gn,kn]]};function Ja(){var _n=a*Or(),on=ur(Oa(ur.rotate()).invert([0,0]));return Fa(ja==null?[[on[0]-_n,on[1]-_n],[on[0]+_n,on[1]+_n]]:Ht===nu?[[Math.max(on[0]-_n,ja),sn],[Math.min(on[0]+_n,gn),kn]]:[[ja,Math.max(on[1]-_n,sn)],[gn,Math.min(on[1]+_n,kn)]])}return Ja()}function uc(Ht){return u((i+Ht)/2)}function rf(Ht,ur){var qr=l(Ht),Or=Ht===ur?_(Ht):S(qr/l(ur))/S(uc(ur)/uc(Ht)),ua=qr*M(uc(Ht),Or)/Or;if(!Or)return nu;function Fa(ja,sn){ua>0?sn<-i+r&&(sn=-i+r):sn>i-r&&(sn=i-r);var gn=ua/M(uc(sn),Or);return[gn*_(Or*ja),ua-gn*l(Or*ja)]}return Fa.invert=function(ja,sn){var gn=ua-sn,kn=w(Or)*p(ja*ja+gn*gn),Ja=T(ja,v(gn))*w(gn);return gn*Or<0&&(Ja-=a*w(ja)*w(gn)),[Ja/Or,2*h(M(ua/kn,1/Or))-i]},Fa}function mc(){return $s(rf).scale(109.5).parallels([30,30])}function Us(Ht,ur){return[Ht,ur]}Us.invert=Us;function vu(){return ru(Us).scale(152.63)}function du(Ht,ur){var qr=l(Ht),Or=Ht===ur?_(Ht):(qr-l(ur))/(ur-Ht),ua=qr/Or+Ht;if(v(Or)r&&--Or>0);return[Ht/(.8707+(Fa=qr*qr)*(-.131979+Fa*(-.013791+Fa*Fa*Fa*(.003971-.001529*Fa)))),qr]};function Au(){return ru(Ru).scale(175.295)}function Zs(Ht,ur){return[l(ur)*_(Ht),_(ur)]}Zs.invert=Ec(m);function Ol(){return ru(Zs).scale(249.5).clipAngle(90+r)}function bl(Ht,ur){var qr=l(ur),Or=1+l(Ht)*qr;return[qr*_(Ht)/Or,_(ur)/Or]}bl.invert=Ec(function(Ht){return 2*h(Ht)});function tc(){return ru(bl).scale(250).clipAngle(142)}function Su(Ht,ur){return[S(u((i+ur)/2)),-Ht]}Su.invert=function(Ht,ur){return[-ur,2*h(b(Ht))-i]};function Cc(){var Ht=Cl(Su),ur=Ht.center,qr=Ht.rotate;return Ht.center=function(Or){return arguments.length?ur([-Or[1],Or[0]]):(Or=ur(),[Or[1],-Or[0]])},Ht.rotate=function(Or){return arguments.length?qr([Or[0],Or[1],Or.length>2?Or[2]+90:90]):(Or=qr(),[Or[0],Or[1],Or[2]-90])},qr([0,0,90]).scale(159.155)}d.geoAlbers=Ns,d.geoAlbersUsa=Pu,d.geoArea=q,d.geoAzimuthalEqualArea=nh,d.geoAzimuthalEqualAreaRaw=Cf,d.geoAzimuthalEquidistant=kc,d.geoAzimuthalEquidistantRaw=lc,d.geoBounds=ze,d.geoCentroid=gr,d.geoCircle=Lr,d.geoClipAntimeridian=mr,d.geoClipCircle=ya,d.geoClipExtent=qn,d.geoClipRectangle=Ga,d.geoConicConformal=mc,d.geoConicConformalRaw=rf,d.geoConicEqualArea=au,d.geoConicEqualAreaRaw=Tu,d.geoConicEquidistant=af,d.geoConicEquidistantRaw=du,d.geoContains=Co,d.geoDistance=xi,d.geoEqualEarth=Lf,d.geoEqualEarthRaw=bc,d.geoEquirectangular=vu,d.geoEquirectangularRaw=Us,d.geoGnomonic=nf,d.geoGnomonicRaw=xl,d.geoGraticule=Os,d.geoGraticule10=ds,d.geoIdentity=ou,d.geoInterpolate=Ui,d.geoLength=Wo,d.geoMercator=tf,d.geoMercatorRaw=nu,d.geoNaturalEarth1=Au,d.geoNaturalEarth1Raw=Ru,d.geoOrthographic=Ol,d.geoOrthographicRaw=Zs,d.geoPath=jc,d.geoProjection=ru,d.geoProjectionMutator=Uu,d.geoRotation=Oa,d.geoStereographic=tc,d.geoStereographicRaw=bl,d.geoStream=N,d.geoTransform=$c,d.geoTransverseMercator=Cc,d.geoTransverseMercatorRaw=Su,Object.defineProperty(d,"__esModule",{value:!0})})}}),_P=He({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y,H3(),Vy()):x(d.d3=d.d3||{},d.d3,d.d3)})(Y,function(d,x,A){var E=Math.abs,e=Math.atan,t=Math.atan2,r=Math.cos,o=Math.exp,a=Math.floor,i=Math.log,n=Math.max,s=Math.min,c=Math.pow,f=Math.round,v=Math.sign||function(je){return je>0?1:je<0?-1:0},h=Math.sin,T=Math.tan,l=1e-6,y=1e-12,b=Math.PI,S=b/2,M=b/4,_=Math.SQRT1_2,w=F(2),p=F(b),u=b*2,g=180/b,m=b/180;function R(je){return je?je/Math.sin(je):1}function P(je){return je>1?S:je<-1?-S:Math.asin(je)}function z(je){return je>1?0:je<-1?b:Math.acos(je)}function F(je){return je>0?Math.sqrt(je):0}function B(je){return je=o(2*je),(je-1)/(je+1)}function O(je){return(o(je)-o(-je))/2}function L(je){return(o(je)+o(-je))/2}function N(je){return i(je+F(je*je+1))}function U(je){return i(je+F(je*je-1))}function Z(je){var Ze=T(je/2),at=2*i(r(je/2))/(Ze*Ze);function lt(Tt,gt){var Et=r(Tt),Yt=r(gt),rr=h(gt),sr=Yt*Et,Sr=-((1-sr?i((1+sr)/2)/(1-sr):-.5)+at/(1+sr));return[Sr*Yt*h(Tt),Sr*rr]}return lt.invert=function(Tt,gt){var Et=F(Tt*Tt+gt*gt),Yt=-je/2,rr=50,sr;if(!Et)return[0,0];do{var Sr=Yt/2,Nr=r(Sr),Qr=h(Sr),ia=Qr/Nr,_a=-i(E(Nr));Yt-=sr=(2/ia*_a-at*ia-Et)/(-_a/(Qr*Qr)+1-at/(2*Nr*Nr))*(Nr<0?.7:1)}while(E(sr)>l&&--rr>0);var za=h(Yt);return[t(Tt*za,Et*r(Yt)),P(gt*za/Et)]},lt}function Q(){var je=S,Ze=x.geoProjectionMutator(Z),at=Ze(je);return at.radius=function(lt){return arguments.length?Ze(je=lt*m):je*g},at.scale(179.976).clipAngle(147)}function ue(je,Ze){var at=r(Ze),lt=R(z(at*r(je/=2)));return[2*at*h(je)*lt,h(Ze)*lt]}ue.invert=function(je,Ze){if(!(je*je+4*Ze*Ze>b*b+l)){var at=je,lt=Ze,Tt=25;do{var gt=h(at),Et=h(at/2),Yt=r(at/2),rr=h(lt),sr=r(lt),Sr=h(2*lt),Nr=rr*rr,Qr=sr*sr,ia=Et*Et,_a=1-Qr*Yt*Yt,za=_a?z(sr*Yt)*F(nn=1/_a):nn=0,nn,en=2*za*sr*Et-je,ln=za*rr-Ze,Nn=nn*(Qr*ia+za*sr*Yt*Nr),pi=nn*(.5*gt*Sr-za*2*rr*Et),ii=nn*.25*(Sr*Et-za*rr*Qr*gt),Gi=nn*(Nr*Yt+za*ia*sr),Bo=pi*ii-Gi*Nn;if(!Bo)break;var No=(ln*pi-en*Gi)/Bo,po=(en*ii-ln*Nn)/Bo;at-=No,lt-=po}while((E(No)>l||E(po)>l)&&--Tt>0);return[at,lt]}};function oe(){return x.geoProjection(ue).scale(152.63)}function le(je){var Ze=h(je),at=r(je),lt=je>=0?1:-1,Tt=T(lt*je),gt=(1+Ze-at)/2;function Et(Yt,rr){var sr=r(rr),Sr=r(Yt/=2);return[(1+sr)*h(Yt),(lt*rr>-t(Sr,Tt)-.001?0:-lt*10)+gt+h(rr)*at-(1+sr)*Ze*Sr]}return Et.invert=function(Yt,rr){var sr=0,Sr=0,Nr=50;do{var Qr=r(sr),ia=h(sr),_a=r(Sr),za=h(Sr),nn=1+_a,en=nn*ia-Yt,ln=gt+za*at-nn*Ze*Qr-rr,Nn=nn*Qr/2,pi=-ia*za,ii=Ze*nn*ia/2,Gi=at*_a+Ze*Qr*za,Bo=pi*ii-Gi*Nn,No=(ln*pi-en*Gi)/Bo/2,po=(en*ii-ln*Nn)/Bo;E(po)>2&&(po/=2),sr-=No,Sr-=po}while((E(No)>l||E(po)>l)&&--Nr>0);return lt*Sr>-t(r(sr),Tt)-.001?[sr*2,Sr]:null},Et}function j(){var je=20*m,Ze=je>=0?1:-1,at=T(Ze*je),lt=x.geoProjectionMutator(le),Tt=lt(je),gt=Tt.stream;return Tt.parallel=function(Et){return arguments.length?(at=T((Ze=(je=Et*m)>=0?1:-1)*je),lt(je)):je*g},Tt.stream=function(Et){var Yt=Tt.rotate(),rr=gt(Et),sr=(Tt.rotate([0,0]),gt(Et)),Sr=Tt.precision();return Tt.rotate(Yt),rr.sphere=function(){sr.polygonStart(),sr.lineStart();for(var Nr=Ze*-180;Ze*Nr<180;Nr+=Ze*90)sr.point(Nr,Ze*90);if(je)for(;Ze*(Nr-=3*Ze*Sr)>=-180;)sr.point(Nr,Ze*-t(r(Nr*m/2),at)*g);sr.lineEnd(),sr.polygonEnd()},rr},Tt.scale(218.695).center([0,28.0974])}function J(je,Ze){var at=T(Ze/2),lt=F(1-at*at),Tt=1+lt*r(je/=2),gt=h(je)*lt/Tt,Et=at/Tt,Yt=gt*gt,rr=Et*Et;return[4/3*gt*(3+Yt-3*rr),4/3*Et*(3+3*Yt-rr)]}J.invert=function(je,Ze){if(je*=3/8,Ze*=3/8,!je&&E(Ze)>1)return null;var at=je*je,lt=Ze*Ze,Tt=1+at+lt,gt=F((Tt-F(Tt*Tt-4*Ze*Ze))/2),Et=P(gt)/3,Yt=gt?U(E(Ze/gt))/3:N(E(je))/3,rr=r(Et),sr=L(Yt),Sr=sr*sr-rr*rr;return[v(je)*2*t(O(Yt)*rr,.25-Sr),v(Ze)*2*t(sr*h(Et),.25+Sr)]};function $(){return x.geoProjection(J).scale(66.1603)}var X=F(8),re=i(1+w);function ee(je,Ze){var at=E(Ze);return aty&&--lt>0);return[je/(r(at)*(X-1/h(at))),v(Ze)*at]};function q(){return x.geoProjection(ee).scale(112.314)}function ae(je){var Ze=2*b/je;function at(lt,Tt){var gt=x.geoAzimuthalEquidistantRaw(lt,Tt);if(E(lt)>S){var Et=t(gt[1],gt[0]),Yt=F(gt[0]*gt[0]+gt[1]*gt[1]),rr=Ze*f((Et-S)/Ze)+S,sr=t(h(Et-=rr),2-r(Et));Et=rr+P(b/Yt*h(sr))-sr,gt[0]=Yt*r(Et),gt[1]=Yt*h(Et)}return gt}return at.invert=function(lt,Tt){var gt=F(lt*lt+Tt*Tt);if(gt>S){var Et=t(Tt,lt),Yt=Ze*f((Et-S)/Ze)+S,rr=Et>Yt?-1:1,sr=gt*r(Yt-Et),Sr=1/T(rr*z((sr-b)/F(b*(b-2*sr)+gt*gt)));Et=Yt+2*e((Sr+rr*F(Sr*Sr-3))/3),lt=gt*r(Et),Tt=gt*h(Et)}return x.geoAzimuthalEquidistantRaw.invert(lt,Tt)},at}function ie(){var je=5,Ze=x.geoProjectionMutator(ae),at=Ze(je),lt=at.stream,Tt=.01,gt=-r(Tt*m),Et=h(Tt*m);return at.lobes=function(Yt){return arguments.length?Ze(je=+Yt):je},at.stream=function(Yt){var rr=at.rotate(),sr=lt(Yt),Sr=(at.rotate([0,0]),lt(Yt));return at.rotate(rr),sr.sphere=function(){Sr.polygonStart(),Sr.lineStart();for(var Nr=0,Qr=360/je,ia=2*b/je,_a=90-180/je,za=S;Nr0&&E(Tt)>l);return lt<0?NaN:at}function Ce(je,Ze,at){return Ze===void 0&&(Ze=40),at===void 0&&(at=y),function(lt,Tt,gt,Et){var Yt,rr,sr;gt=gt===void 0?0:+gt,Et=Et===void 0?0:+Et;for(var Sr=0;SrYt){gt-=rr/=2,Et-=sr/=2;continue}Yt=_a;var za=(gt>0?-1:1)*at,nn=(Et>0?-1:1)*at,en=je(gt+za,Et),ln=je(gt,Et+nn),Nn=(en[0]-Nr[0])/za,pi=(en[1]-Nr[1])/za,ii=(ln[0]-Nr[0])/nn,Gi=(ln[1]-Nr[1])/nn,Bo=Gi*Nn-pi*ii,No=(E(Bo)<.5?.5:1)/Bo;if(rr=(ia*ii-Qr*Gi)*No,sr=(Qr*pi-ia*Nn)*No,gt+=rr,Et+=sr,E(rr)0&&(Yt[1]*=1+rr/1.5*Yt[0]*Yt[0]),Yt}return lt.invert=Ce(lt),lt}function et(){return x.geoProjection(qe()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])}function Qe(je,Ze){var at=je*h(Ze),lt=30,Tt;do Ze-=Tt=(Ze+h(Ze)-at)/(1+r(Ze));while(E(Tt)>l&&--lt>0);return Ze/2}function Ke(je,Ze,at){function lt(Tt,gt){return[je*Tt*r(gt=Qe(at,gt)),Ze*h(gt)]}return lt.invert=function(Tt,gt){return gt=P(gt/Ze),[Tt/(je*r(gt)),P((2*gt+h(2*gt))/at)]},lt}var Xe=Ke(w/S,w,b);function Me(){return x.geoProjection(Xe).scale(169.529)}var xe=2.00276,ce=1.11072;function Re(je,Ze){var at=Qe(b,Ze);return[xe*je/(1/r(Ze)+ce/r(at)),(Ze+w*h(at))/xe]}Re.invert=function(je,Ze){var at=xe*Ze,lt=Ze<0?-M:M,Tt=25,gt,Et;do Et=at-w*h(lt),lt-=gt=(h(2*lt)+2*lt-b*h(Et))/(2*r(2*lt)+2+b*r(Et)*w*r(lt));while(E(gt)>l&&--Tt>0);return Et=at-w*h(lt),[je*(1/r(Et)+ce/r(lt))/xe,Et]};function $e(){return x.geoProjection(Re).scale(160.857)}function rt(je){var Ze=0,at=x.geoProjectionMutator(je),lt=at(Ze);return lt.parallel=function(Tt){return arguments.length?at(Ze=Tt*m):Ze*g},lt}function Je(je,Ze){return[je*r(Ze),Ze]}Je.invert=function(je,Ze){return[je/r(Ze),Ze]};function At(){return x.geoProjection(Je).scale(152.63)}function St(je){if(!je)return Je;var Ze=1/T(je);function at(lt,Tt){var gt=Ze+je-Tt,Et=gt&<*r(Tt)/gt;return[gt*h(Et),Ze-gt*r(Et)]}return at.invert=function(lt,Tt){var gt=F(lt*lt+(Tt=Ze-Tt)*Tt),Et=Ze+je-gt;return[gt/r(Et)*t(lt,Tt),Et]},at}function Rt(){return rt(St).scale(123.082).center([0,26.1441]).parallel(45)}function Ut(je){function Ze(at,lt){var Tt=S-lt,gt=Tt&&at*je*h(Tt)/Tt;return[Tt*h(gt)/je,S-Tt*r(gt)]}return Ze.invert=function(at,lt){var Tt=at*je,gt=S-lt,Et=F(Tt*Tt+gt*gt),Yt=t(Tt,gt);return[(Et?Et/h(Et):1)*Yt/je,S-Et]},Ze}function ir(){var je=.5,Ze=x.geoProjectionMutator(Ut),at=Ze(je);return at.fraction=function(lt){return arguments.length?Ze(je=+lt):je},at.scale(158.837)}var ar=Ke(1,4/b,b);function Mr(){return x.geoProjection(ar).scale(152.63)}function fr(je,Ze,at,lt,Tt,gt){var Et=r(gt),Yt;if(E(je)>1||E(gt)>1)Yt=z(at*Tt+Ze*lt*Et);else{var rr=h(je/2),sr=h(gt/2);Yt=2*P(F(rr*rr+Ze*lt*sr*sr))}return E(Yt)>l?[Yt,t(lt*h(gt),Ze*Tt-at*lt*Et)]:[0,0]}function dr(je,Ze,at){return z((je*je+Ze*Ze-at*at)/(2*je*Ze))}function pt(je){return je-2*b*a((je+b)/(2*b))}function ze(je,Ze,at){for(var lt=[[je[0],je[1],h(je[1]),r(je[1])],[Ze[0],Ze[1],h(Ze[1]),r(Ze[1])],[at[0],at[1],h(at[1]),r(at[1])]],Tt=lt[2],gt,Et=0;Et<3;++Et,Tt=gt)gt=lt[Et],Tt.v=fr(gt[1]-Tt[1],Tt[3],Tt[2],gt[3],gt[2],gt[0]-Tt[0]),Tt.point=[0,0];var Yt=dr(lt[0].v[0],lt[2].v[0],lt[1].v[0]),rr=dr(lt[0].v[0],lt[1].v[0],lt[2].v[0]),sr=b-Yt;lt[2].point[1]=0,lt[0].point[0]=-(lt[1].point[0]=lt[0].v[0]/2);var Sr=[lt[2].point[0]=lt[0].point[0]+lt[2].v[0]*r(Yt),2*(lt[0].point[1]=lt[1].point[1]=lt[2].v[0]*h(Yt))];function Nr(Qr,ia){var _a=h(ia),za=r(ia),nn=new Array(3),en;for(en=0;en<3;++en){var ln=lt[en];if(nn[en]=fr(ia-ln[1],ln[3],ln[2],za,_a,Qr-ln[0]),!nn[en][0])return ln.point;nn[en][1]=pt(nn[en][1]-ln.v[1])}var Nn=Sr.slice();for(en=0;en<3;++en){var pi=en==2?0:en+1,ii=dr(lt[en].v[0],nn[en][0],nn[pi][0]);nn[en][1]<0&&(ii=-ii),en?en==1?(ii=rr-ii,Nn[0]-=nn[en][0]*r(ii),Nn[1]-=nn[en][0]*h(ii)):(ii=sr-ii,Nn[0]+=nn[en][0]*r(ii),Nn[1]+=nn[en][0]*h(ii)):(Nn[0]+=nn[en][0]*r(ii),Nn[1]-=nn[en][0]*h(ii))}return Nn[0]/=3,Nn[1]/=3,Nn}return Nr}function Ge(je){return je[0]*=m,je[1]*=m,je}function Oe(){return ve([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function ve(je,Ze,at){var lt=x.geoCentroid({type:"MultiPoint",coordinates:[je,Ze,at]}),Tt=[-lt[0],-lt[1]],gt=x.geoRotation(Tt),Et=ze(Ge(gt(je)),Ge(gt(Ze)),Ge(gt(at)));Et.invert=Ce(Et);var Yt=x.geoProjection(Et).rotate(Tt),rr=Yt.center;return delete Yt.rotate,Yt.center=function(sr){return arguments.length?rr(gt(sr)):gt.invert(rr())},Yt.clipAngle(90)}function ge(je,Ze){var at=F(1-h(Ze));return[2/p*je*at,p*(1-at)]}ge.invert=function(je,Ze){var at=(at=Ze/p-1)*at;return[at>0?je*F(b/at)/2:0,P(1-at)]};function be(){return x.geoProjection(ge).scale(95.6464).center([0,30])}function Pe(je){var Ze=T(je);function at(lt,Tt){return[lt,(lt?lt/h(lt):1)*(h(Tt)*r(lt)-Ze*r(Tt))]}return at.invert=Ze?function(lt,Tt){lt&&(Tt*=h(lt)/lt);var gt=r(lt);return[lt,2*t(F(gt*gt+Ze*Ze-Tt*Tt)-gt,Ze-Tt)]}:function(lt,Tt){return[lt,P(lt?Tt*T(lt)/lt:Tt)]},at}function We(){return rt(Pe).scale(249.828).clipAngle(90)}var ct=F(3);function _t(je,Ze){return[ct*je*(2*r(2*Ze/3)-1)/p,ct*p*h(Ze/3)]}_t.invert=function(je,Ze){var at=3*P(Ze/(ct*p));return[p*je/(ct*(2*r(2*at/3)-1)),at]};function Mt(){return x.geoProjection(_t).scale(156.19)}function Nt(je){var Ze=r(je);function at(lt,Tt){return[lt*Ze,h(Tt)/Ze]}return at.invert=function(lt,Tt){return[lt/Ze,P(Tt*Ze)]},at}function Bt(){return rt(Nt).parallel(38.58).scale(195.044)}function qt(je){var Ze=r(je);function at(lt,Tt){return[lt*Ze,(1+Ze)*T(Tt/2)]}return at.invert=function(lt,Tt){return[lt/Ze,e(Tt/(1+Ze))*2]},at}function Zt(){return rt(qt).scale(124.75)}function lr(je,Ze){var at=F(8/(3*b));return[at*je*(1-E(Ze)/b),at*Ze]}lr.invert=function(je,Ze){var at=F(8/(3*b)),lt=Ze/at;return[je/(at*(1-E(lt)/b)),lt]};function ta(){return x.geoProjection(lr).scale(165.664)}function da(je,Ze){var at=F(4-3*h(E(Ze)));return[2/F(6*b)*je*at,v(Ze)*F(2*b/3)*(2-at)]}da.invert=function(je,Ze){var at=2-E(Ze)/F(2*b/3);return[je*F(6*b)/(2*at),v(Ze)*P((4-at*at)/3)]};function wa(){return x.geoProjection(da).scale(165.664)}function ma(je,Ze){var at=F(b*(4+b));return[2/at*je*(1+F(1-4*Ze*Ze/(b*b))),4/at*Ze]}ma.invert=function(je,Ze){var at=F(b*(4+b))/2;return[je*at/(1+F(1-Ze*Ze*(4+b)/(4*b))),Ze*at/2]};function Ia(){return x.geoProjection(ma).scale(180.739)}function va(je,Ze){var at=(2+S)*h(Ze);Ze/=2;for(var lt=0,Tt=1/0;lt<10&&E(Tt)>l;lt++){var gt=r(Ze);Ze-=Tt=(Ze+h(Ze)*(gt+2)-at)/(2*gt*(1+gt))}return[2/F(b*(4+b))*je*(1+r(Ze)),2*F(b/(4+b))*h(Ze)]}va.invert=function(je,Ze){var at=Ze*F((4+b)/b)/2,lt=P(at),Tt=r(lt);return[je/(2/F(b*(4+b))*(1+Tt)),P((lt+at*(Tt+2))/(2+S))]};function La(){return x.geoProjection(va).scale(180.739)}function Ka(je,Ze){return[je*(1+r(Ze))/F(2+b),2*Ze/F(2+b)]}Ka.invert=function(je,Ze){var at=F(2+b),lt=Ze*at/2;return[at*je/(1+r(lt)),lt]};function Vt(){return x.geoProjection(Ka).scale(173.044)}function Lt(je,Ze){for(var at=(1+S)*h(Ze),lt=0,Tt=1/0;lt<10&&E(Tt)>l;lt++)Ze-=Tt=(Ze+h(Ze)-at)/(1+r(Ze));return at=F(2+b),[je*(1+r(Ze))/at,2*Ze/at]}Lt.invert=function(je,Ze){var at=1+S,lt=F(at/2);return[je*2*lt/(1+r(Ze*=lt)),P((Ze+h(Ze))/at)]};function jt(){return x.geoProjection(Lt).scale(173.044)}var Ot=3+2*w;function gr(je,Ze){var at=h(je/=2),lt=r(je),Tt=F(r(Ze)),gt=r(Ze/=2),Et=h(Ze)/(gt+w*lt*Tt),Yt=F(2/(1+Et*Et)),rr=F((w*gt+(lt+at)*Tt)/(w*gt+(lt-at)*Tt));return[Ot*(Yt*(rr-1/rr)-2*i(rr)),Ot*(Yt*Et*(rr+1/rr)-2*e(Et))]}gr.invert=function(je,Ze){if(!(gt=J.invert(je/1.2,Ze*1.065)))return null;var at=gt[0],lt=gt[1],Tt=20,gt;je/=Ot,Ze/=Ot;do{var Et=at/2,Yt=lt/2,rr=h(Et),sr=r(Et),Sr=h(Yt),Nr=r(Yt),Qr=r(lt),ia=F(Qr),_a=Sr/(Nr+w*sr*ia),za=_a*_a,nn=F(2/(1+za)),en=w*Nr+(sr+rr)*ia,ln=w*Nr+(sr-rr)*ia,Nn=en/ln,pi=F(Nn),ii=pi-1/pi,Gi=pi+1/pi,Bo=nn*ii-2*i(pi)-je,No=nn*_a*Gi-2*e(_a)-Ze,po=Sr&&_*ia*rr*za/Sr,Zo=(w*sr*Nr+ia)/(2*(Nr+w*sr*ia)*(Nr+w*sr*ia)*ia),Hs=-.5*_a*nn*nn*nn,zs=Hs*po,xo=Hs*Zo,bo=(bo=2*Nr+w*ia*(sr-rr))*bo*pi,vl=(w*sr*Nr*ia+Qr)/bo,Al=-(w*rr*Sr)/(ia*bo),pu=ii*zs-2*vl/pi+nn*(vl+vl/Nn),pe=ii*xo-2*Al/pi+nn*(Al+Al/Nn),Le=_a*Gi*zs-2*po/(1+za)+nn*Gi*po+nn*_a*(vl-vl/Nn),Ye=_a*Gi*xo-2*Zo/(1+za)+nn*Gi*Zo+nn*_a*(Al-Al/Nn),ut=pe*Le-Ye*pu;if(!ut)break;var ht=(No*pe-Bo*Ye)/ut,xt=(Bo*Le-No*pu)/ut;at-=ht,lt=n(-S,s(S,lt-xt))}while((E(ht)>l||E(xt)>l)&&--Tt>0);return E(E(lt)-S)lt){var Nr=F(Sr),Qr=t(sr,rr),ia=at*f(Qr/at),_a=Qr-ia,za=je*r(_a),nn=(je*h(_a)-_a*h(za))/(S-za),en=_r(_a,nn),ln=(b-je)/yr(en,za,b);rr=Nr;var Nn=50,pi;do rr-=pi=(je+yr(en,za,rr)*ln-Nr)/(en(rr)*ln);while(E(pi)>l&&--Nn>0);sr=_a*h(rr),rrlt){var rr=F(Yt),sr=t(Et,gt),Sr=at*f(sr/at),Nr=sr-Sr;gt=rr*r(Nr),Et=rr*h(Nr);for(var Qr=gt-S,ia=h(gt),_a=Et/ia,za=gtl||E(_a)>l)&&--za>0);return[Nr,Qr]},rr}var Pr=zr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555);function Hr(){return x.geoProjection(Pr).scale(149.995)}var Zr=zr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742);function Jr(){return x.geoProjection(Zr).scale(153.93)}var wt=zr(5/6*b,-.62636,-.0344,0,1.3493,-.05524,0,.045);function Qt(){return x.geoProjection(wt).scale(130.945)}function mr(je,Ze){var at=je*je,lt=Ze*Ze;return[je*(1-.162388*lt)*(.87-952426e-9*at*at),Ze*(1+lt/12)]}mr.invert=function(je,Ze){var at=je,lt=Ze,Tt=50,gt;do{var Et=lt*lt;lt-=gt=(lt*(1+Et/12)-Ze)/(1+Et/4)}while(E(gt)>l&&--Tt>0);Tt=50,je/=1-.162388*Et;do{var Yt=(Yt=at*at)*Yt;at-=gt=(at*(.87-952426e-9*Yt)-je)/(.87-.00476213*Yt)}while(E(gt)>l&&--Tt>0);return[at,lt]};function $r(){return x.geoProjection(mr).scale(131.747)}var oa=zr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Sa(){return x.geoProjection(oa).scale(131.087)}function ya(je){var Ze=je(S,0)[0]-je(-S,0)[0];function at(lt,Tt){var gt=lt>0?-.5:.5,Et=je(lt+gt*b,Tt);return Et[0]-=gt*Ze,Et}return je.invert&&(at.invert=function(lt,Tt){var gt=lt>0?-.5:.5,Et=je.invert(lt+gt*Ze,Tt),Yt=Et[0]-gt*b;return Yt<-b?Yt+=2*b:Yt>b&&(Yt-=2*b),Et[0]=Yt,Et}),at}function ra(je,Ze){var at=v(je),lt=v(Ze),Tt=r(Ze),gt=r(je)*Tt,Et=h(je)*Tt,Yt=h(lt*Ze);je=E(t(Et,Yt)),Ze=P(gt),E(je-S)>l&&(je%=S);var rr=pa(je>b/4?S-je:je,Ze);return je>b/4&&(Yt=rr[0],rr[0]=-rr[1],rr[1]=-Yt),rr[0]*=at,rr[1]*=-lt,rr}ra.invert=function(je,Ze){E(je)>1&&(je=v(je)*2-je),E(Ze)>1&&(Ze=v(Ze)*2-Ze);var at=v(je),lt=v(Ze),Tt=-at*je,gt=-lt*Ze,Et=gt/Tt<1,Yt=pn(Et?gt:Tt,Et?Tt:gt),rr=Yt[0],sr=Yt[1],Sr=r(sr);return Et&&(rr=-S-rr),[at*(t(h(rr)*Sr,-h(sr))+b),lt*P(r(rr)*Sr)]};function pa(je,Ze){if(Ze===S)return[0,0];var at=h(Ze),lt=at*at,Tt=lt*lt,gt=1+Tt,Et=1+3*Tt,Yt=1-Tt,rr=P(1/F(gt)),sr=Yt+lt*gt*rr,Sr=(1-at)/sr,Nr=F(Sr),Qr=Sr*gt,ia=F(Qr),_a=Nr*Yt,za,nn;if(je===0)return[0,-(_a+lt*ia)];var en=r(Ze),ln=1/en,Nn=2*at*en,pi=(-3*lt+rr*Et)*Nn,ii=(-sr*en-(1-at)*pi)/(sr*sr),Gi=.5*ii/Nr,Bo=Yt*Gi-2*lt*Nr*Nn,No=lt*gt*ii+Sr*Et*Nn,po=-ln*Nn,Zo=-ln*No,Hs=-2*ln*Bo,zs=4*je/b,xo;if(je>.222*b||Ze.175*b){if(za=(_a+lt*F(Qr*(1+Tt)-_a*_a))/(1+Tt),je>b/4)return[za,za];var bo=za,vl=.5*za;za=.5*(vl+bo),nn=50;do{var Al=F(Qr-za*za),pu=za*(Hs+po*Al)+Zo*P(za/ia)-zs;if(!pu)break;pu<0?vl=za:bo=za,za=.5*(vl+bo)}while(E(bo-vl)>l&&--nn>0)}else{za=l,nn=25;do{var pe=za*za,Le=F(Qr-pe),Ye=Hs+po*Le,ut=za*Ye+Zo*P(za/ia)-zs,ht=Ye+(Zo-po*pe)/Le;za-=xo=Le?ut/ht:0}while(E(xo)>l&&--nn>0)}return[za,-_a-lt*F(Qr-za*za)]}function pn(je,Ze){for(var at=0,lt=1,Tt=.5,gt=50;;){var Et=Tt*Tt,Yt=F(Tt),rr=P(1/F(1+Et)),sr=1-Et+Tt*(1+Et)*rr,Sr=(1-Yt)/sr,Nr=F(Sr),Qr=Sr*(1+Et),ia=Nr*(1-Et),_a=Qr-je*je,za=F(_a),nn=Ze+ia+Tt*za;if(E(lt-at)0?at=Tt:lt=Tt,Tt=.5*(at+lt)}if(!gt)return null;var en=P(Yt),ln=r(en),Nn=1/ln,pi=2*Yt*ln,ii=(-3*Tt+rr*(1+3*Et))*pi,Gi=(-sr*ln-(1-Yt)*ii)/(sr*sr),Bo=.5*Gi/Nr,No=(1-Et)*Bo-2*Tt*Nr*pi,po=-2*Nn*No,Zo=-Nn*pi,Hs=-Nn*(Tt*(1+Et)*Gi+Sr*(1+3*Et)*pi);return[b/4*(je*(po+Zo*za)+Hs*P(je/F(Qr))),en]}function Ga(){return x.geoProjection(ya(ra)).scale(239.75)}function qn(je,Ze,at){var lt,Tt,gt;return je?(lt=Vn(je,at),Ze?(Tt=Vn(Ze,1-at),gt=Tt[1]*Tt[1]+at*lt[0]*lt[0]*Tt[0]*Tt[0],[[lt[0]*Tt[2]/gt,lt[1]*lt[2]*Tt[0]*Tt[1]/gt],[lt[1]*Tt[1]/gt,-lt[0]*lt[2]*Tt[0]*Tt[2]/gt],[lt[2]*Tt[1]*Tt[2]/gt,-at*lt[0]*lt[1]*Tt[0]/gt]]):[[lt[0],0],[lt[1],0],[lt[2],0]]):(Tt=Vn(Ze,1-at),[[0,Tt[0]/Tt[1]],[1/Tt[1],0],[Tt[2]/Tt[1],0]])}function Vn(je,Ze){var at,lt,Tt,gt,Et;if(Ze=1-l)return at=(1-Ze)/4,lt=L(je),gt=B(je),Tt=1/lt,Et=lt*O(je),[gt+at*(Et-je)/(lt*lt),Tt-at*gt*Tt*(Et-je),Tt+at*gt*Tt*(Et+je),2*e(o(je))-S+at*(Et-je)/lt];var Yt=[1,0,0,0,0,0,0,0,0],rr=[F(Ze),0,0,0,0,0,0,0,0],sr=0;for(lt=F(1-Ze),Et=1;E(rr[sr]/Yt[sr])>l&&sr<8;)at=Yt[sr++],rr[sr]=(at-lt)/2,Yt[sr]=(at+lt)/2,lt=F(at*lt),Et*=2;Tt=Et*Yt[sr]*je;do gt=rr[sr]*h(lt=Tt)/Yt[sr],Tt=(P(gt)+Tt)/2;while(--sr);return[h(Tt),gt=r(Tt),gt/r(Tt-lt),Tt]}function di(je,Ze,at){var lt=E(je),Tt=E(Ze),gt=O(Tt);if(lt){var Et=1/h(lt),Yt=1/(T(lt)*T(lt)),rr=-(Yt+at*(gt*gt*Et*Et)-1+at),sr=(at-1)*Yt,Sr=(-rr+F(rr*rr-4*sr))/2;return[yi(e(1/F(Sr)),at)*v(je),yi(e(F((Sr/Yt-1)/at)),1-at)*v(Ze)]}return[0,yi(e(gt),1-at)*v(Ze)]}function yi(je,Ze){if(!Ze)return je;if(Ze===1)return i(T(je/2+M));for(var at=1,lt=F(1-Ze),Tt=F(Ze),gt=0;E(Tt)>l;gt++){if(je%b){var Et=e(lt*T(je)/at);Et<0&&(Et+=b),je+=Et+~~(je/b)*b}else je+=je;Tt=(at+lt)/2,lt=F(at*lt),Tt=((at=Tt)-lt)/2}return je/(c(2,gt)*at)}function Ci(je,Ze){var at=(w-1)/(w+1),lt=F(1-at*at),Tt=yi(S,lt*lt),gt=-1,Et=i(T(b/4+E(Ze)/2)),Yt=o(gt*Et)/F(at),rr=ci(Yt*r(gt*je),Yt*h(gt*je)),sr=di(rr[0],rr[1],lt*lt);return[-sr[1],(Ze>=0?1:-1)*(.5*Tt-sr[0])]}function ci(je,Ze){var at=je*je,lt=Ze+1,Tt=1-at-Ze*Ze;return[.5*((je>=0?S:-S)-t(Tt,2*je)),-.25*i(Tt*Tt+4*at)+.5*i(lt*lt+at)]}function ei(je,Ze){var at=Ze[0]*Ze[0]+Ze[1]*Ze[1];return[(je[0]*Ze[0]+je[1]*Ze[1])/at,(je[1]*Ze[0]-je[0]*Ze[1])/at]}Ci.invert=function(je,Ze){var at=(w-1)/(w+1),lt=F(1-at*at),Tt=yi(S,lt*lt),gt=-1,Et=qn(.5*Tt-Ze,-je,lt*lt),Yt=ei(Et[0],Et[1]),rr=t(Yt[1],Yt[0])/gt;return[rr,2*e(o(.5/gt*i(at*Yt[0]*Yt[0]+at*Yt[1]*Yt[1])))-S]};function mi(){return x.geoProjection(ya(Ci)).scale(151.496)}function uo(je){var Ze=h(je),at=r(je),lt=Lo(je);lt.invert=Lo(-je);function Tt(gt,Et){var Yt=lt(gt,Et);gt=Yt[0],Et=Yt[1];var rr=h(Et),sr=r(Et),Sr=r(gt),Nr=z(Ze*rr+at*sr*Sr),Qr=h(Nr),ia=E(Qr)>l?Nr/Qr:1;return[ia*at*h(gt),(E(gt)>S?ia:-ia)*(Ze*sr-at*rr*Sr)]}return Tt.invert=function(gt,Et){var Yt=F(gt*gt+Et*Et),rr=-h(Yt),sr=r(Yt),Sr=Yt*sr,Nr=-Et*rr,Qr=Yt*Ze,ia=F(Sr*Sr+Nr*Nr-Qr*Qr),_a=t(Sr*Qr+Nr*ia,Nr*Qr-Sr*ia),za=(Yt>S?-1:1)*t(gt*rr,Yt*r(_a)*sr+Et*h(_a)*rr);return lt.invert(za,_a)},Tt}function Lo(je){var Ze=h(je),at=r(je);return function(lt,Tt){var gt=r(Tt),Et=r(lt)*gt,Yt=h(lt)*gt,rr=h(Tt);return[t(Yt,Et*at-rr*Ze),P(rr*at+Et*Ze)]}}function Wo(){var je=0,Ze=x.geoProjectionMutator(uo),at=Ze(je),lt=at.rotate,Tt=at.stream,gt=x.geoCircle();return at.parallel=function(Et){if(!arguments.length)return je*g;var Yt=at.rotate();return Ze(je=Et*m).rotate(Yt)},at.rotate=function(Et){return arguments.length?(lt.call(at,[Et[0],Et[1]-je*g]),gt.center([-Et[0],-Et[1]]),at):(Et=lt.call(at),Et[1]+=je*g,Et)},at.stream=function(Et){return Et=Tt(Et),Et.sphere=function(){Et.polygonStart();var Yt=.01,rr=gt.radius(90-Yt)().coordinates[0],sr=rr.length-1,Sr=-1,Nr;for(Et.lineStart();++Sr=0;)Et.point((Nr=rr[Sr])[0],Nr[1]);Et.lineEnd(),Et.polygonEnd()},Et},at.scale(79.4187).parallel(45).clipAngle(180-.001)}var li=3,Ii=P(1-1/li)*g,xi=Nt(0);function Ao(je){var Ze=Ii*m,at=ge(b,Ze)[0]-ge(-b,Ze)[0],lt=xi(0,Ze)[1],Tt=ge(0,Ze)[1],gt=p-Tt,Et=u/je,Yt=4/u,rr=lt+gt*gt*4/u;function sr(Sr,Nr){var Qr,ia=E(Nr);if(ia>Ze){var _a=s(je-1,n(0,a((Sr+b)/Et)));Sr+=b*(je-1)/je-_a*Et,Qr=ge(Sr,ia),Qr[0]=Qr[0]*u/at-u*(je-1)/(2*je)+_a*u/je,Qr[1]=lt+(Qr[1]-Tt)*4*gt/u,Nr<0&&(Qr[1]=-Qr[1])}else Qr=xi(Sr,Nr);return Qr[0]*=Yt,Qr[1]/=rr,Qr}return sr.invert=function(Sr,Nr){Sr/=Yt,Nr*=rr;var Qr=E(Nr);if(Qr>lt){var ia=s(je-1,n(0,a((Sr+b)/Et)));Sr=(Sr+b*(je-1)/je-ia*Et)*at/u;var _a=ge.invert(Sr,.25*(Qr-lt)*u/gt+Tt);return _a[0]-=b*(je-1)/je-ia*Et,Nr<0&&(_a[1]=-_a[1]),_a}return xi.invert(Sr,Nr)},sr}function So(je,Ze){return[je,Ze&1?90-l:Ii]}function Ro(je,Ze){return[je,Ze&1?-90+l:-Ii]}function Li(je){return[je[0]*(1-l),je[1]]}function Yi(je){var Ze=[].concat(A.range(-180,180+je/2,je).map(So),A.range(180,-180-je/2,-je).map(Ro));return{type:"Polygon",coordinates:[je===180?Ze.map(Li):Ze]}}function bs(){var je=4,Ze=x.geoProjectionMutator(Ao),at=Ze(je),lt=at.stream;return at.lobes=function(Tt){return arguments.length?Ze(je=+Tt):je},at.stream=function(Tt){var gt=at.rotate(),Et=lt(Tt),Yt=(at.rotate([0,0]),lt(Tt));return at.rotate(gt),Et.sphere=function(){x.geoStream(Yi(180/je),Yt)},Et},at.scale(239.75)}function as(je){var Ze=1+je,at=h(1/Ze),lt=P(at),Tt=2*F(b/(gt=b+4*lt*Ze)),gt,Et=.5*Tt*(Ze+F(je*(2+je))),Yt=je*je,rr=Ze*Ze;function sr(Sr,Nr){var Qr=1-h(Nr),ia,_a;if(Qr&&Qr<2){var za=S-Nr,nn=25,en;do{var ln=h(za),Nn=r(za),pi=lt+t(ln,Ze-Nn),ii=1+rr-2*Ze*Nn;za-=en=(za-Yt*lt-Ze*ln+ii*pi-.5*Qr*gt)/(2*Ze*ln*pi)}while(E(en)>y&&--nn>0);ia=Tt*F(ii),_a=Sr*pi/b}else ia=Tt*(je+Qr),_a=Sr*lt/b;return[ia*h(_a),Et-ia*r(_a)]}return sr.invert=function(Sr,Nr){var Qr=Sr*Sr+(Nr-=Et)*Nr,ia=(1+rr-Qr/(Tt*Tt))/(2*Ze),_a=z(ia),za=h(_a),nn=lt+t(za,Ze-ia);return[P(Sr/F(Qr))*b/nn,P(1-2*(_a-Yt*lt-Ze*za+(1+rr-2*Ze*ia)*nn)/gt)]},sr}function fs(){var je=1,Ze=x.geoProjectionMutator(as),at=Ze(je);return at.ratio=function(lt){return arguments.length?Ze(je=+lt):je},at.scale(167.774).center([0,18.67])}var Co=.7109889596207567,Qa=.0528035274542;function Jn(je,Ze){return Ze>-Co?(je=Xe(je,Ze),je[1]+=Qa,je):Je(je,Ze)}Jn.invert=function(je,Ze){return Ze>-Co?Xe.invert(je,Ze-Qa):Je.invert(je,Ze)};function Os(){return x.geoProjection(Jn).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}function ds(je,Ze){return E(Ze)>Co?(je=Xe(je,Ze),je[1]-=Ze>0?Qa:-Qa,je):Je(je,Ze)}ds.invert=function(je,Ze){return E(Ze)>Co?Xe.invert(je,Ze+(Ze>0?Qa:-Qa)):Je.invert(je,Ze)};function Ui(){return x.geoProjection(ds).scale(152.63)}function ms(je,Ze,at,lt){var Tt=F(4*b/(2*at+(1+je-Ze/2)*h(2*at)+(je+Ze)/2*h(4*at)+Ze/2*h(6*at))),gt=F(lt*h(at)*F((1+je*r(2*at)+Ze*r(4*at))/(1+je+Ze))),Et=at*rr(1);function Yt(Nr){return F(1+je*r(2*Nr)+Ze*r(4*Nr))}function rr(Nr){var Qr=Nr*at;return(2*Qr+(1+je-Ze/2)*h(2*Qr)+(je+Ze)/2*h(4*Qr)+Ze/2*h(6*Qr))/at}function sr(Nr){return Yt(Nr)*h(Nr)}var Sr=function(Nr,Qr){var ia=at*Fe(rr,Et*h(Qr)/at,Qr/b);isNaN(ia)&&(ia=at*v(Qr));var _a=Tt*Yt(ia);return[_a*gt*Nr/b*r(ia),_a/gt*h(ia)]};return Sr.invert=function(Nr,Qr){var ia=Fe(sr,Qr*gt/Tt);return[Nr*b/(r(ia)*Tt*gt*Yt(ia)),P(at*rr(ia/at)/Et)]},at===0&&(Tt=F(lt/b),Sr=function(Nr,Qr){return[Nr*Tt,h(Qr)/Tt]},Sr.invert=function(Nr,Qr){return[Nr/Tt,P(Qr*Tt)]}),Sr}function Mo(){var je=1,Ze=0,at=45*m,lt=2,Tt=x.geoProjectionMutator(ms),gt=Tt(je,Ze,at,lt);return gt.a=function(Et){return arguments.length?Tt(je=+Et,Ze,at,lt):je},gt.b=function(Et){return arguments.length?Tt(je,Ze=+Et,at,lt):Ze},gt.psiMax=function(Et){return arguments.length?Tt(je,Ze,at=+Et*m,lt):at*g},gt.ratio=function(Et){return arguments.length?Tt(je,Ze,at,lt=+Et):lt},gt.scale(180.739)}function ws(je,Ze,at,lt,Tt,gt,Et,Yt,rr,sr,Sr){if(Sr.nanEncountered)return NaN;var Nr,Qr,ia,_a,za,nn,en,ln,Nn,pi;if(Nr=at-Ze,Qr=je(Ze+Nr*.25),ia=je(at-Nr*.25),isNaN(Qr)){Sr.nanEncountered=!0;return}if(isNaN(ia)){Sr.nanEncountered=!0;return}return _a=Nr*(lt+4*Qr+Tt)/12,za=Nr*(Tt+4*ia+gt)/12,nn=_a+za,pi=(nn-Et)/15,sr>rr?(Sr.maxDepthCount++,nn+pi):Math.abs(pi)>1;do rr[nn]>ia?za=nn:_a=nn,nn=_a+za>>1;while(nn>_a);var en=rr[nn+1]-rr[nn];return en&&(en=(ia-rr[nn+1])/en),(nn+1+en)/Et}var Nr=2*Sr(1)/b*gt/at,Qr=function(ia,_a){var za=Sr(E(h(_a))),nn=lt(za)*ia;return za/=Nr,[nn,_a>=0?za:-za]};return Qr.invert=function(ia,_a){var za;return _a*=Nr,E(_a)<1&&(za=v(_a)*P(Tt(E(_a))*gt)),[ia/lt(E(_a)),za]},Qr}function fo(){var je=0,Ze=2.5,at=1.183136,lt=x.geoProjectionMutator(Rn),Tt=lt(je,Ze,at);return Tt.alpha=function(gt){return arguments.length?lt(je=+gt,Ze,at):je},Tt.k=function(gt){return arguments.length?lt(je,Ze=+gt,at):Ze},Tt.gamma=function(gt){return arguments.length?lt(je,Ze,at=+gt):at},Tt.scale(152.63)}function Pi(je,Ze){return E(je[0]-Ze[0])=0;--rr)at=je[1][rr],lt=at[0][0],Tt=at[0][1],gt=at[1][1],Et=at[2][0],Yt=at[2][1],Ze.push(zo([[Et-l,Yt-l],[Et-l,gt+l],[lt+l,gt+l],[lt+l,Tt-l]],30));return{type:"Polygon",coordinates:[A.merge(Ze)]}}function bi(je,Ze,at){var lt,Tt;function gt(rr,sr){for(var Sr=sr<0?-1:1,Nr=Ze[+(sr<0)],Qr=0,ia=Nr.length-1;QrNr[Qr][2][0];++Qr);var _a=je(rr-Nr[Qr][1][0],sr);return _a[0]+=je(Nr[Qr][1][0],Sr*sr>Sr*Nr[Qr][0][1]?Nr[Qr][0][1]:sr)[0],_a}at?gt.invert=at(gt):je.invert&&(gt.invert=function(rr,sr){for(var Sr=Tt[+(sr<0)],Nr=Ze[+(sr<0)],Qr=0,ia=Sr.length;Qr_a&&(za=ia,ia=_a,_a=za),[[Nr,ia],[Qr,_a]]})}),Et):Ze.map(function(sr){return sr.map(function(Sr){return[[Sr[0][0]*g,Sr[0][1]*g],[Sr[1][0]*g,Sr[1][1]*g],[Sr[2][0]*g,Sr[2][1]*g]]})})},Ze!=null&&Et.lobes(Ze),Et}var wl=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function $l(){return bi(Re,wl).scale(160.857)}var Js=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Ql(){return bi(ds,Js).scale(152.63)}var Ws=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]];function Is(){return bi(Xe,Ws).scale(169.529)}var Dl=[[[[-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 Xu(){return bi(Xe,Dl).scale(169.529).rotate([20,0])}var Lu=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]];function Bu(){return bi(Jn,Lu,Ce).rotate([-20,-55]).scale(164.263).center([0,-5.4036])}var kf=[[[[-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 gf(){return bi(Je,kf).scale(152.63).rotate([-20,0])}function ns(je,Ze){return[3/u*je*F(b*b/3-Ze*Ze),Ze]}ns.invert=function(je,Ze){return[u/3*je/F(b*b/3-Ze*Ze),Ze]};function _u(){return x.geoProjection(ns).scale(158.837)}function Nc(je){function Ze(at,lt){if(E(E(lt)-S)2)return null;at/=2,lt/=2;var gt=at*at,Et=lt*lt,Yt=2*lt/(1+gt+Et);return Yt=c((1+Yt)/(1-Yt),1/je),[t(2*at,1-gt-Et)/je,P((Yt-1)/(Yt+1))]},Ze}function ml(){var je=.5,Ze=x.geoProjectionMutator(Nc),at=Ze(je);return at.spacing=function(lt){return arguments.length?Ze(je=+lt):je},at.scale(124.75)}var fl=b/w;function _l(je,Ze){return[je*(1+F(r(Ze)))/2,Ze/(r(Ze/2)*r(je/6))]}_l.invert=function(je,Ze){var at=E(je),lt=E(Ze),Tt=l,gt=S;ltl||E(nn)>l)&&--Tt>0);return Tt&&[at,lt]};function Tl(){return x.geoProjection(Ts).scale(139.98)}function Ko(je,Ze){return[h(je)/r(Ze),T(Ze)*r(je)]}Ko.invert=function(je,Ze){var at=je*je,lt=Ze*Ze,Tt=lt+1,gt=at+Tt,Et=je?_*F((gt-F(gt*gt-4*at))/at):1/F(Tt);return[P(je*Et),v(Ze)*z(Et)]};function Cs(){return x.geoProjection(Ko).scale(144.049).clipAngle(90-.001)}function Nu(je){var Ze=r(je),at=T(M+je/2);function lt(Tt,gt){var Et=gt-je,Yt=E(Et)=0;)Sr=je[sr],Nr=Sr[0]+Yt*(ia=Nr)-rr*Qr,Qr=Sr[1]+Yt*Qr+rr*ia;return Nr=Yt*(ia=Nr)-rr*Qr,Qr=Yt*Qr+rr*ia,[Nr,Qr]}return at.invert=function(lt,Tt){var gt=20,Et=lt,Yt=Tt;do{for(var rr=Ze,sr=je[rr],Sr=sr[0],Nr=sr[1],Qr=0,ia=0,_a;--rr>=0;)sr=je[rr],Qr=Sr+Et*(_a=Qr)-Yt*ia,ia=Nr+Et*ia+Yt*_a,Sr=sr[0]+Et*(_a=Sr)-Yt*Nr,Nr=sr[1]+Et*Nr+Yt*_a;Qr=Sr+Et*(_a=Qr)-Yt*ia,ia=Nr+Et*ia+Yt*_a,Sr=Et*(_a=Sr)-Yt*Nr-lt,Nr=Et*Nr+Yt*_a-Tt;var za=Qr*Qr+ia*ia,nn,en;Et-=nn=(Sr*Qr+Nr*ia)/za,Yt-=en=(Nr*Qr-Sr*ia)/za}while(E(nn)+E(en)>l*l&&--gt>0);if(gt){var ln=F(Et*Et+Yt*Yt),Nn=2*e(ln*.5),pi=h(Nn);return[t(Et*pi,ln*r(Nn)),ln?P(Yt*pi/ln):0]}},at}var Eo=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Wf=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],is=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],oo=[[.9245,0],[0,0],[.01943,0]],pc=[[.721316,0],[0,0],[-.00881625,-.00617325]];function xu(){return hl(Eo,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)}function zl(){return hl(Wf,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Kc(){return hl(is,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function Ju(){return hl(oo,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function gc(){return hl(pc,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function hl(je,Ze){var at=x.geoProjection(Gf(je)).rotate(Ze).clipAngle(90),lt=x.geoRotation(Ze),Tt=at.center;return delete at.rotate,at.center=function(gt){return arguments.length?Tt(lt(gt)):lt.invert(Tt())},at}var yf=F(6),Jc=F(7);function Uc(je,Ze){var at=P(7*h(Ze)/(3*yf));return[yf*je*(2*r(2*at/3)-1)/Jc,9*h(at/3)/Jc]}Uc.invert=function(je,Ze){var at=3*P(Ze*Jc/9);return[je*Jc/(yf*(2*r(2*at/3)-1)),P(h(at)*3*yf/7)]};function $u(){return x.geoProjection(Uc).scale(164.859)}function jc(je,Ze){for(var at=(1+_)*h(Ze),lt=Ze,Tt=0,gt;Tt<25&&(lt-=gt=(h(lt/2)+h(lt)-at)/(.5*r(lt/2)+r(lt)),!(E(gt)y&&--lt>0);return gt=at*at,Et=gt*gt,Yt=gt*Et,[je/(.84719-.13063*gt+Yt*Yt*(-.04515+.05494*gt-.02326*Et+.00331*Yt)),at]};function wu(){return x.geoProjection(sc).scale(175.295)}function eu(je,Ze){return[je*(1+r(Ze))/2,2*(Ze-T(Ze/2))]}eu.invert=function(je,Ze){for(var at=Ze/2,lt=0,Tt=1/0;lt<10&&E(Tt)>l;++lt){var gt=r(Ze/2);Ze-=Tt=(Ze-T(Ze/2)-at)/(1-.5/(gt*gt))}return[2*je/(1+r(Ze)),Ze]};function Sc(){return x.geoProjection(eu).scale(152.63)}var ef=[[[[-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 ps(){return bi(fe(1/0),ef).rotate([20,0]).scale(152.63)}function Vc(je,Ze){var at=h(Ze),lt=r(Ze),Tt=v(je);if(je===0||E(Ze)===S)return[0,Ze];if(Ze===0)return[je,0];if(E(je)===S)return[je*lt,S*at];var gt=b/(2*je)-2*je/b,Et=2*Ze/b,Yt=(1-Et*Et)/(at-Et),rr=gt*gt,sr=Yt*Yt,Sr=1+rr/sr,Nr=1+sr/rr,Qr=(gt*at/Yt-gt/2)/Sr,ia=(sr*at/rr+Yt/2)/Nr,_a=Qr*Qr+lt*lt/Sr,za=ia*ia-(sr*at*at/rr+Yt*at-1)/Nr;return[S*(Qr+F(_a)*Tt),S*(ia+F(za<0?0:za)*v(-Ze*gt)*Tt)]}Vc.invert=function(je,Ze){je/=S,Ze/=S;var at=je*je,lt=Ze*Ze,Tt=at+lt,gt=b*b;return[je?(Tt-1+F((1-Tt)*(1-Tt)+4*at))/(2*je)*S:0,Fe(function(Et){return Tt*(b*h(Et)-2*Et)*b+4*Et*Et*(Ze-h(Et))+2*b*Et-gt*Ze},0)]};function Zf(){return x.geoProjection(Vc).scale(127.267)}var mf=1.0148,Mc=.23185,_f=-.14499,tu=.02406,xf=mf,Fl=5*Mc,ru=7*_f,Uu=9*tu,$s=1.790857183;function Qu(je,Ze){var at=Ze*Ze;return[je,Ze*(mf+at*at*(Mc+at*(_f+tu*at)))]}Qu.invert=function(je,Ze){Ze>$s?Ze=$s:Ze<-$s&&(Ze=-$s);var at=Ze,lt;do{var Tt=at*at;at-=lt=(at*(mf+Tt*Tt*(Mc+Tt*(_f+tu*Tt)))-Ze)/(xf+Tt*Tt*(Fl+Tt*(ru+Uu*Tt)))}while(E(lt)>l);return[je,at]};function Tu(){return x.geoProjection(Qu).scale(139.319)}function au(je,Ze){if(E(Ze)l&&--Tt>0);return Et=T(lt),[(E(Ze)=0;)if(lt=Ze[Yt],at[0]===lt[0]&&at[1]===lt[1]){if(gt)return[gt,at];gt=at}}}function Cl(je){for(var Ze=je.length,at=[],lt=je[Ze-1],Tt=0;Tt0?[-lt[0],0]:[180-lt[0],180])};var Ze=mc.map(function(at){return{face:at,project:je(at)}});return[-1,0,0,1,0,1,4,5].forEach(function(at,lt){var Tt=Ze[at];Tt&&(Tt.children||(Tt.children=[])).push(Ze[lt])}),lc(Ze[0],function(at,lt){return Ze[at<-b/2?lt<0?6:4:at<0?lt<0?2:0:atlt^ia>lt&&at<(Qr-sr)*(lt-Sr)/(ia-Sr)+sr&&(Tt=!Tt)}return Tt}function xl(je,Ze){var at=Ze.stream,lt;if(!at)throw new Error("invalid projection");switch(je&&je.type){case"Feature":lt=ou;break;case"FeatureCollection":lt=nf;break;default:lt=Au;break}return lt(je,at)}function nf(je,Ze){return{type:"FeatureCollection",features:je.features.map(function(at){return ou(at,Ze)})}}function ou(je,Ze){return{type:"Feature",id:je.id,properties:je.properties,geometry:Au(je.geometry,Ze)}}function Ru(je,Ze){return{type:"GeometryCollection",geometries:je.geometries.map(function(at){return Au(at,Ze)})}}function Au(je,Ze){if(!je)return null;if(je.type==="GeometryCollection")return Ru(je,Ze);var at;switch(je.type){case"Point":at=bl;break;case"MultiPoint":at=bl;break;case"LineString":at=tc;break;case"MultiLineString":at=tc;break;case"Polygon":at=Su;break;case"MultiPolygon":at=Su;break;case"Sphere":at=Su;break;default:return null}return x.geoStream(je,Ze(at)),at.result()}var Zs=[],Ol=[],bl={point:function(je,Ze){Zs.push([je,Ze])},result:function(){var je=Zs.length?Zs.length<2?{type:"Point",coordinates:Zs[0]}:{type:"MultiPoint",coordinates:Zs}:null;return Zs=[],je}},tc={lineStart:Iu,point:function(je,Ze){Zs.push([je,Ze])},lineEnd:function(){Zs.length&&(Ol.push(Zs),Zs=[])},result:function(){var je=Ol.length?Ol.length<2?{type:"LineString",coordinates:Ol[0]}:{type:"MultiLineString",coordinates:Ol}:null;return Ol=[],je}},Su={polygonStart:Iu,lineStart:Iu,point:function(je,Ze){Zs.push([je,Ze])},lineEnd:function(){var je=Zs.length;if(je){do Zs.push(Zs[0].slice());while(++je<4);Ol.push(Zs),Zs=[]}},polygonEnd:Iu,result:function(){if(!Ol.length)return null;var je=[],Ze=[];return Ol.forEach(function(at){bc(at)?je.push([at]):Ze.push(at)}),Ze.forEach(function(at){var lt=at[0];je.some(function(Tt){if(Lf(Tt[0],lt))return Tt.push(at),!0})||je.push([at])}),Ol=[],je.length?je.length>1?{type:"MultiPolygon",coordinates:je}:{type:"Polygon",coordinates:je[0]}:null}};function Cc(je){var Ze=je(S,0)[0]-je(-S,0)[0];function at(lt,Tt){var gt=E(lt)0?lt-b:lt+b,Tt),Yt=(Et[0]-Et[1])*_,rr=(Et[0]+Et[1])*_;if(gt)return[Yt,rr];var sr=Ze*_,Sr=Yt>0^rr>0?-1:1;return[Sr*Yt-v(rr)*sr,Sr*rr-v(Yt)*sr]}return je.invert&&(at.invert=function(lt,Tt){var gt=(lt+Tt)*_,Et=(Tt-lt)*_,Yt=E(gt)<.5*Ze&&E(Et)<.5*Ze;if(!Yt){var rr=Ze*_,sr=gt>0^Et>0?-1:1,Sr=-sr*lt+(Et>0?1:-1)*rr,Nr=-sr*Tt+(gt>0?1:-1)*rr;gt=(-Sr-Nr)*_,Et=(Sr-Nr)*_}var Qr=je.invert(gt,Et);return Yt||(Qr[0]+=gt>0?b:-b),Qr}),x.geoProjection(at).rotate([-90,-90,45]).clipAngle(180-.001)}function Ht(){return Cc(ra).scale(176.423)}function ur(){return Cc(Ci).scale(111.48)}function qr(je,Ze){if(!(0<=(Ze=+Ze)&&Ze<=20))throw new Error("invalid digits");function at(sr){var Sr=sr.length,Nr=2,Qr=new Array(Sr);for(Qr[0]=+sr[0].toFixed(Ze),Qr[1]=+sr[1].toFixed(Ze);Nr2||ia[0]!=Sr[0]||ia[1]!=Sr[1])&&(Nr.push(ia),Sr=ia)}return Nr.length===1&&sr.length>1&&Nr.push(at(sr[sr.length-1])),Nr}function gt(sr){return sr.map(Tt)}function Et(sr){if(sr==null)return sr;var Sr;switch(sr.type){case"GeometryCollection":Sr={type:"GeometryCollection",geometries:sr.geometries.map(Et)};break;case"Point":Sr={type:"Point",coordinates:at(sr.coordinates)};break;case"MultiPoint":Sr={type:sr.type,coordinates:lt(sr.coordinates)};break;case"LineString":Sr={type:sr.type,coordinates:Tt(sr.coordinates)};break;case"MultiLineString":case"Polygon":Sr={type:sr.type,coordinates:gt(sr.coordinates)};break;case"MultiPolygon":Sr={type:"MultiPolygon",coordinates:sr.coordinates.map(gt)};break;default:return sr}return sr.bbox!=null&&(Sr.bbox=sr.bbox),Sr}function Yt(sr){var Sr={type:"Feature",properties:sr.properties,geometry:Et(sr.geometry)};return sr.id!=null&&(Sr.id=sr.id),sr.bbox!=null&&(Sr.bbox=sr.bbox),Sr}if(je!=null)switch(je.type){case"Feature":return Yt(je);case"FeatureCollection":{var rr={type:"FeatureCollection",features:je.features.map(Yt)};return je.bbox!=null&&(rr.bbox=je.bbox),rr}default:return Et(je)}return je}function Or(je){var Ze=h(je);function at(lt,Tt){var gt=Ze?T(lt*Ze/2)/Ze:lt/2;if(!Tt)return[2*gt,-je];var Et=2*e(gt*h(Tt)),Yt=1/T(Tt);return[h(Et)*Yt,Tt+(1-r(Et))*Yt-je]}return at.invert=function(lt,Tt){if(E(Tt+=je)l&&--Yt>0);var Qr=lt*(sr=T(Et)),ia=T(E(Tt)0?S:-S)*(rr+Tt*(Sr-Et)/2+Tt*Tt*(Sr-2*rr+Et)/2)]}ja.invert=function(je,Ze){var at=Ze/S,lt=at*90,Tt=s(18,E(lt/5)),gt=n(0,a(Tt));do{var Et=Fa[gt][1],Yt=Fa[gt+1][1],rr=Fa[s(19,gt+2)][1],sr=rr-Et,Sr=rr-2*Yt+Et,Nr=2*(E(at)-Yt)/sr,Qr=Sr/sr,ia=Nr*(1-Qr*Nr*(1-2*Qr*Nr));if(ia>=0||gt===1){lt=(Ze>=0?5:-5)*(ia+Tt);var _a=50,za;do Tt=s(18,E(lt)/5),gt=a(Tt),ia=Tt-gt,Et=Fa[gt][1],Yt=Fa[gt+1][1],rr=Fa[s(19,gt+2)][1],lt-=(za=(Ze>=0?S:-S)*(Yt+ia*(rr-Et)/2+ia*ia*(rr-2*Yt+Et)/2)-Ze)*g;while(E(za)>y&&--_a>0);break}}while(--gt>=0);var nn=Fa[gt][0],en=Fa[gt+1][0],ln=Fa[s(19,gt+2)][0];return[je/(en+ia*(ln-nn)/2+ia*ia*(ln-2*en+nn)/2),lt*m]};function sn(){return x.geoProjection(ja).scale(152.63)}function gn(je){function Ze(at,lt){var Tt=r(lt),gt=(je-1)/(je-Tt*r(at));return[gt*Tt*h(at),gt*h(lt)]}return Ze.invert=function(at,lt){var Tt=at*at+lt*lt,gt=F(Tt),Et=(je-F(1-Tt*(je+1)/(je-1)))/((je-1)/gt+gt/(je-1));return[t(at*Et,gt*F(1-Et*Et)),gt?P(lt*Et/gt):0]},Ze}function kn(je,Ze){var at=gn(je);if(!Ze)return at;var lt=r(Ze),Tt=h(Ze);function gt(Et,Yt){var rr=at(Et,Yt),sr=rr[1],Sr=sr*Tt/(je-1)+lt;return[rr[0]*lt/Sr,sr/Sr]}return gt.invert=function(Et,Yt){var rr=(je-1)/(je-1-Yt*Tt);return at.invert(rr*Et,rr*Yt*lt)},gt}function Ja(){var je=2,Ze=0,at=x.geoProjectionMutator(kn),lt=at(je,Ze);return lt.distance=function(Tt){return arguments.length?at(je=+Tt,Ze):je},lt.tilt=function(Tt){return arguments.length?at(je,Ze=Tt*m):Ze*g},lt.scale(432.147).clipAngle(z(1/je)*g-1e-6)}var _n=1e-4,on=1e4,Wa=-180,On=Wa+_n,zi=180,ki=zi-_n,ji=-90,Ni=ji+_n,Bn=90,An=Bn-_n;function Ki(je){return je.length>0}function ko(je){return Math.floor(je*on)/on}function $o(je){return je===ji||je===Bn?[0,je]:[Wa,ko(je)]}function Ls(je){var Ze=je[0],at=je[1],lt=!1;return Ze<=On?(Ze=Wa,lt=!0):Ze>=ki&&(Ze=zi,lt=!0),at<=Ni?(at=ji,lt=!0):at>=An&&(at=Bn,lt=!0),lt?[Ze,at]:je}function os(je){return je.map(Ls)}function As(je,Ze,at){for(var lt=0,Tt=je.length;lt=ki||Sr<=Ni||Sr>=An){gt[Et]=Ls(rr);for(var Nr=Et+1;NrOn&&iaNi&&_a=Yt)break;at.push({index:-1,polygon:Ze,ring:gt=gt.slice(Nr-1)}),gt[0]=$o(gt[0][1]),Et=-1,Yt=gt.length}}}}function jo(je){var Ze,at=je.length,lt={},Tt={},gt,Et,Yt,rr,sr;for(Ze=0;Ze0?b-Yt:Yt)*g],sr=x.geoProjection(je(Et)).rotate(rr),Sr=x.geoRotation(rr),Nr=sr.center;return delete sr.rotate,sr.center=function(Qr){return arguments.length?Nr(Sr(Qr)):Sr.invert(Nr())},sr.clipAngle(90)}function Jo(je){var Ze=r(je);function at(lt,Tt){var gt=x.geoGnomonicRaw(lt,Tt);return gt[0]*=Ze,gt}return at.invert=function(lt,Tt){return x.geoGnomonicRaw.invert(lt/Ze,Tt)},at}function Bl(){return jl([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function jl(je,Ze){return gs(Jo,je,Ze)}function Vl(je){if(!(je*=2))return x.geoAzimuthalEquidistantRaw;var Ze=-je/2,at=-Ze,lt=je*je,Tt=T(at),gt=.5/h(at);function Et(Yt,rr){var sr=z(r(rr)*r(Yt-Ze)),Sr=z(r(rr)*r(Yt-at)),Nr=rr<0?-1:1;return sr*=sr,Sr*=Sr,[(sr-Sr)/(2*je),Nr*F(4*lt*Sr-(lt-sr+Sr)*(lt-sr+Sr))/(2*je)]}return Et.invert=function(Yt,rr){var sr=rr*rr,Sr=r(F(sr+(Qr=Yt+Ze)*Qr)),Nr=r(F(sr+(Qr=Yt+at)*Qr)),Qr,ia;return[t(ia=Sr-Nr,Qr=(Sr+Nr)*Tt),(rr<0?-1:1)*z(F(Qr*Qr+ia*ia)*gt)]},Et}function cc(){return ql([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function ql(je,Ze){return gs(Vl,je,Ze)}function Vu(je,Ze){if(E(Ze)l&&--Yt>0);return[v(je)*(F(Tt*Tt+4)+Tt)*b/4,S*Et]};function wc(){return x.geoProjection(Du).scale(127.16)}function De(je,Ze,at,lt,Tt){function gt(Et,Yt){var rr=at*h(lt*Yt),sr=F(1-rr*rr),Sr=F(2/(1+sr*r(Et*=Tt)));return[je*sr*Sr*h(Et),Ze*rr*Sr]}return gt.invert=function(Et,Yt){var rr=Et/je,sr=Yt/Ze,Sr=F(rr*rr+sr*sr),Nr=2*P(Sr/2);return[t(Et*T(Nr),je*Sr)/Tt,Sr&&P(Yt*h(Nr)/(Ze*at*Sr))/lt]},gt}function I(je,Ze,at,lt){var Tt=b/3;je=n(je,l),Ze=n(Ze,l),je=s(je,S),Ze=s(Ze,b-l),at=n(at,0),at=s(at,100-l),lt=n(lt,l);var gt=at/100+1,Et=lt/100,Yt=z(gt*r(Tt))/Tt,rr=h(je)/h(Yt*S),sr=Ze/b,Sr=F(Et*h(je/2)/h(Ze/2)),Nr=Sr/F(sr*rr*Yt),Qr=1/(Sr*F(sr*rr*Yt));return De(Nr,Qr,rr,Yt,sr)}function ne(){var je=65*m,Ze=60*m,at=20,lt=200,Tt=x.geoProjectionMutator(I),gt=Tt(je,Ze,at,lt);return gt.poleline=function(Et){return arguments.length?Tt(je=+Et*m,Ze,at,lt):je*g},gt.parallels=function(Et){return arguments.length?Tt(je,Ze=+Et*m,at,lt):Ze*g},gt.inflation=function(Et){return arguments.length?Tt(je,Ze,at=+Et,lt):at},gt.ratio=function(Et){return arguments.length?Tt(je,Ze,at,lt=+Et):lt},gt.scale(163.775)}function Te(){return ne().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)}var Se=4*b+3*F(3),Ie=2*F(2*b*F(3)/Se),ot=Ke(Ie*F(3)/b,Ie,Se/6);function yt(){return x.geoProjection(ot).scale(176.84)}function Ct(je,Ze){return[je*F(1-3*Ze*Ze/(b*b)),Ze]}Ct.invert=function(je,Ze){return[je/F(1-3*Ze*Ze/(b*b)),Ze]};function Wt(){return x.geoProjection(Ct).scale(152.63)}function nr(je,Ze){var at=r(Ze),lt=r(je)*at,Tt=1-lt,gt=r(je=t(h(je)*at,-h(Ze))),Et=h(je);return at=F(1-lt*lt),[Et*at-gt*Tt,-gt*at-Et*Tt]}nr.invert=function(je,Ze){var at=(je*je+Ze*Ze)/-2,lt=F(-at*(2+at)),Tt=Ze*at+je*lt,gt=je*at-Ze*lt,Et=F(gt*gt+Tt*Tt);return[t(lt*Tt,Et*(1+at)),Et?-P(lt*gt/Et):0]};function or(){return x.geoProjection(nr).rotate([0,-90,45]).scale(124.75).clipAngle(180-.001)}function Fr(je,Ze){var at=ue(je,Ze);return[(at[0]+je/S)/2,(at[1]+Ze)/2]}Fr.invert=function(je,Ze){var at=je,lt=Ze,Tt=25;do{var gt=r(lt),Et=h(lt),Yt=h(2*lt),rr=Et*Et,sr=gt*gt,Sr=h(at),Nr=r(at/2),Qr=h(at/2),ia=Qr*Qr,_a=1-sr*Nr*Nr,za=_a?z(gt*Nr)*F(nn=1/_a):nn=0,nn,en=.5*(2*za*gt*Qr+at/S)-je,ln=.5*(za*Et+lt)-Ze,Nn=.5*nn*(sr*ia+za*gt*Nr*rr)+.5/S,pi=nn*(Sr*Yt/4-za*Et*Qr),ii=.125*nn*(Yt*Qr-za*Et*sr*Sr),Gi=.5*nn*(rr*Nr+za*ia*gt)+.5,Bo=pi*ii-Gi*Nn,No=(ln*pi-en*Gi)/Bo,po=(en*ii-ln*Nn)/Bo;at-=No,lt-=po}while((E(No)>l||E(po)>l)&&--Tt>0);return[at,lt]};function Wr(){return x.geoProjection(Fr).scale(158.837)}d.geoNaturalEarth=x.geoNaturalEarth1,d.geoNaturalEarthRaw=x.geoNaturalEarth1Raw,d.geoAiry=Q,d.geoAiryRaw=Z,d.geoAitoff=oe,d.geoAitoffRaw=ue,d.geoArmadillo=j,d.geoArmadilloRaw=le,d.geoAugust=$,d.geoAugustRaw=J,d.geoBaker=q,d.geoBakerRaw=ee,d.geoBerghaus=ie,d.geoBerghausRaw=ae,d.geoBertin1953=et,d.geoBertin1953Raw=qe,d.geoBoggs=$e,d.geoBoggsRaw=Re,d.geoBonne=Rt,d.geoBonneRaw=St,d.geoBottomley=ir,d.geoBottomleyRaw=Ut,d.geoBromley=Mr,d.geoBromleyRaw=ar,d.geoChamberlin=ve,d.geoChamberlinRaw=ze,d.geoChamberlinAfrica=Oe,d.geoCollignon=be,d.geoCollignonRaw=ge,d.geoCraig=We,d.geoCraigRaw=Pe,d.geoCraster=Mt,d.geoCrasterRaw=_t,d.geoCylindricalEqualArea=Bt,d.geoCylindricalEqualAreaRaw=Nt,d.geoCylindricalStereographic=Zt,d.geoCylindricalStereographicRaw=qt,d.geoEckert1=ta,d.geoEckert1Raw=lr,d.geoEckert2=wa,d.geoEckert2Raw=da,d.geoEckert3=Ia,d.geoEckert3Raw=ma,d.geoEckert4=La,d.geoEckert4Raw=va,d.geoEckert5=Vt,d.geoEckert5Raw=Ka,d.geoEckert6=jt,d.geoEckert6Raw=Lt,d.geoEisenlohr=Br,d.geoEisenlohrRaw=gr,d.geoFahey=ga,d.geoFaheyRaw=Ur,d.geoFoucaut=Pa,d.geoFoucautRaw=Aa,d.geoFoucautSinusoidal=Oa,d.geoFoucautSinusoidalRaw=sa,d.geoGilbert=Lr,d.geoGingery=kr,d.geoGingeryRaw=Er,d.geoGinzburg4=Hr,d.geoGinzburg4Raw=Pr,d.geoGinzburg5=Jr,d.geoGinzburg5Raw=Zr,d.geoGinzburg6=Qt,d.geoGinzburg6Raw=wt,d.geoGinzburg8=$r,d.geoGinzburg8Raw=mr,d.geoGinzburg9=Sa,d.geoGinzburg9Raw=oa,d.geoGringorten=Ga,d.geoGringortenRaw=ra,d.geoGuyou=mi,d.geoGuyouRaw=Ci,d.geoHammer=Ae,d.geoHammerRaw=fe,d.geoHammerRetroazimuthal=Wo,d.geoHammerRetroazimuthalRaw=uo,d.geoHealpix=bs,d.geoHealpixRaw=Ao,d.geoHill=fs,d.geoHillRaw=as,d.geoHomolosine=Ui,d.geoHomolosineRaw=ds,d.geoHufnagel=Mo,d.geoHufnagelRaw=ms,d.geoHyperelliptical=fo,d.geoHyperellipticalRaw=Rn,d.geoInterrupt=bi,d.geoInterruptedBoggs=$l,d.geoInterruptedHomolosine=Ql,d.geoInterruptedMollweide=Is,d.geoInterruptedMollweideHemispheres=Xu,d.geoInterruptedSinuMollweide=Bu,d.geoInterruptedSinusoidal=gf,d.geoKavrayskiy7=_u,d.geoKavrayskiy7Raw=ns,d.geoLagrange=ml,d.geoLagrangeRaw=Nc,d.geoLarrivee=Yu,d.geoLarriveeRaw=_l,d.geoLaskowski=Tl,d.geoLaskowskiRaw=Ts,d.geoLittrow=Cs,d.geoLittrowRaw=Ko,d.geoLoximuthal=Ul,d.geoLoximuthalRaw=Nu,d.geoMiller=Bs,d.geoMillerRaw=Ku,d.geoModifiedStereographic=hl,d.geoModifiedStereographicRaw=Gf,d.geoModifiedStereographicAlaska=xu,d.geoModifiedStereographicGs48=zl,d.geoModifiedStereographicGs50=Kc,d.geoModifiedStereographicMiller=Ju,d.geoModifiedStereographicLee=gc,d.geoMollweide=Me,d.geoMollweideRaw=Xe,d.geoMtFlatPolarParabolic=$u,d.geoMtFlatPolarParabolicRaw=Uc,d.geoMtFlatPolarQuartic=$c,d.geoMtFlatPolarQuarticRaw=jc,d.geoMtFlatPolarSinusoidal=Qc,d.geoMtFlatPolarSinusoidalRaw=bu,d.geoNaturalEarth2=wu,d.geoNaturalEarth2Raw=sc,d.geoNellHammer=Sc,d.geoNellHammerRaw=eu,d.geoInterruptedQuarticAuthalic=ps,d.geoNicolosi=Zf,d.geoNicolosiRaw=Vc,d.geoPatterson=Tu,d.geoPattersonRaw=Qu,d.geoPolyconic=Ns,d.geoPolyconicRaw=au,d.geoPolyhedral=lc,d.geoPolyhedralButterfly=Us,d.geoPolyhedralCollignon=af,d.geoPolyhedralWaterman=Rs,d.geoProject=xl,d.geoGringortenQuincuncial=Ht,d.geoPeirceQuincuncial=ur,d.geoPierceQuincuncial=ur,d.geoQuantize=qr,d.geoQuincuncial=Cc,d.geoRectangularPolyconic=ua,d.geoRectangularPolyconicRaw=Or,d.geoRobinson=sn,d.geoRobinsonRaw=ja,d.geoSatellite=Ja,d.geoSatelliteRaw=kn,d.geoSinuMollweide=Os,d.geoSinuMollweideRaw=Jn,d.geoSinusoidal=At,d.geoSinusoidalRaw=Je,d.geoStitch=Ss,d.geoTimes=ao,d.geoTimesRaw=fi,d.geoTwoPointAzimuthal=jl,d.geoTwoPointAzimuthalRaw=Jo,d.geoTwoPointAzimuthalUsa=Bl,d.geoTwoPointEquidistant=ql,d.geoTwoPointEquidistantRaw=Vl,d.geoTwoPointEquidistantUsa=cc,d.geoVanDerGrinten=ol,d.geoVanDerGrintenRaw=Vu,d.geoVanDerGrinten2=Vi,d.geoVanDerGrinten2Raw=rc,d.geoVanDerGrinten3=qu,d.geoVanDerGrinten3Raw=eo,d.geoVanDerGrinten4=wc,d.geoVanDerGrinten4Raw=Du,d.geoWagner=ne,d.geoWagner7=Te,d.geoWagnerRaw=I,d.geoWagner4=yt,d.geoWagner4Raw=ot,d.geoWagner6=Wt,d.geoWagner6Raw=Ct,d.geoWiechel=or,d.geoWiechelRaw=nr,d.geoWinkel3=Wr,d.geoWinkel3Raw=Fr,Object.defineProperty(d,"__esModule",{value:!0})})}}),xP=He({"src/plots/geo/zoom.js"(Y,G){var d=Qn(),x=Gr(),A=Ei(),E=Math.PI/180,e=180/Math.PI,t={cursor:"pointer"},r={cursor:"auto"};function o(g,m){var R=g.projection,P;return m._isScoped?P=n:m._isClipped?P=c:P=s,P(g,R)}G.exports=o;function a(g,m){return d.behavior.zoom().translate(m.translate()).scale(m.scale())}function i(g,m,R){var P=g.id,z=g.graphDiv,F=z.layout,B=F[P],O=z._fullLayout,L=O[P],N={},U={};function Z(Q,ue){N[P+"."+Q]=x.nestedProperty(B,Q).get(),A.call("_storeDirectGUIEdit",F,O._preGUI,N);var oe=x.nestedProperty(L,Q);oe.get()!==ue&&(oe.set(ue),x.nestedProperty(B,Q).set(ue),U[P+"."+Q]=ue)}R(Z),Z("projection.scale",m.scale()/g.fitScale),Z("fitbounds",!1),z.emit("plotly_relayout",U)}function n(g,m){var R=a(g,m);function P(){d.select(this).style(t)}function z(){m.scale(d.event.scale).translate(d.event.translate),g.render(!0);var O=m.invert(g.midPt);g.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":m.scale()/g.fitScale,"geo.center.lon":O[0],"geo.center.lat":O[1]})}function F(O){var L=m.invert(g.midPt);O("center.lon",L[0]),O("center.lat",L[1])}function B(){d.select(this).style(r),i(g,m,F)}return R.on("zoomstart",P).on("zoom",z).on("zoomend",B),R}function s(g,m){var R=a(g,m),P=2,z,F,B,O,L,N,U,Z,Q;function ue(X){return m.invert(X)}function oe(X){var re=ue(X);if(!re)return!0;var ee=m(re);return Math.abs(ee[0]-X[0])>P||Math.abs(ee[1]-X[1])>P}function le(){d.select(this).style(t),z=d.mouse(this),F=m.rotate(),B=m.translate(),O=F,L=ue(z)}function j(){if(N=d.mouse(this),oe(z)){R.scale(m.scale()),R.translate(m.translate());return}m.scale(d.event.scale),m.translate([B[0],d.event.translate[1]]),L?ue(N)&&(Z=ue(N),U=[O[0]+(Z[0]-L[0]),F[1],F[2]],m.rotate(U),O=U):(z=N,L=ue(z)),Q=!0,g.render(!0);var X=m.rotate(),re=m.invert(g.midPt);g.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":m.scale()/g.fitScale,"geo.center.lon":re[0],"geo.center.lat":re[1],"geo.projection.rotation.lon":-X[0]})}function J(){d.select(this).style(r),Q&&i(g,m,$)}function $(X){var re=m.rotate(),ee=m.invert(g.midPt);X("projection.rotation.lon",-re[0]),X("center.lon",ee[0]),X("center.lat",ee[1])}return R.on("zoomstart",le).on("zoom",j).on("zoomend",J),R}function c(g,m){m.rotate(),m.scale();var R=a(g,m),P=u(R,"zoomstart","zoom","zoomend"),z=0,F=R.on,B;R.on("zoomstart",function(){d.select(this).style(t);var Z=d.mouse(this),Q=m.rotate(),ue=Q,oe=m.translate(),le=v(Q);B=f(m,Z),F.call(R,"zoom",function(){var j=d.mouse(this);if(m.scale(d.event.scale),!B)Z=j,B=f(m,Z);else if(f(m,j)){m.rotate(Q).translate(oe);var J=f(m,j),$=T(B,J),X=M(h(le,$)),re=l(X,B,ue);(!isFinite(re[0])||!isFinite(re[1])||!isFinite(re[2]))&&(re=ue),m.rotate(re),ue=re}L(P.of(this,arguments))}),O(P.of(this,arguments))}).on("zoomend",function(){d.select(this).style(r),F.call(R,"zoom",null),N(P.of(this,arguments)),i(g,m,U)}).on("zoom.redraw",function(){g.render(!0);var Z=m.rotate();g.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":m.scale()/g.fitScale,"geo.projection.rotation.lon":-Z[0],"geo.projection.rotation.lat":-Z[1]})});function O(Z){z++||Z({type:"zoomstart"})}function L(Z){Z({type:"zoom"})}function N(Z){--z||Z({type:"zoomend"})}function U(Z){var Q=m.rotate();Z("projection.rotation.lon",-Q[0]),Z("projection.rotation.lat",-Q[1])}return d.rebind(R,P,"on")}function f(g,m){var R=g.invert(m);return R&&isFinite(R[0])&&isFinite(R[1])&&_(R)}function v(g){var m=.5*g[0]*E,R=.5*g[1]*E,P=.5*g[2]*E,z=Math.sin(m),F=Math.cos(m),B=Math.sin(R),O=Math.cos(R),L=Math.sin(P),N=Math.cos(P);return[F*O*N+z*B*L,z*O*N-F*B*L,F*B*N+z*O*L,F*O*L-z*B*N]}function h(g,m){var R=g[0],P=g[1],z=g[2],F=g[3],B=m[0],O=m[1],L=m[2],N=m[3];return[R*B-P*O-z*L-F*N,R*O+P*B+z*N-F*L,R*L-P*N+z*B+F*O,R*N+P*L-z*O+F*B]}function T(g,m){if(!(!g||!m)){var R=p(g,m),P=Math.sqrt(w(R,R)),z=.5*Math.acos(Math.max(-1,Math.min(1,w(g,m)))),F=Math.sin(z)/P;return P&&[Math.cos(z),R[2]*F,-R[1]*F,R[0]*F]}}function l(g,m,R){var P=S(m,2,g[0]);P=S(P,1,g[1]),P=S(P,0,g[2]-R[2]);var z=m[0],F=m[1],B=m[2],O=P[0],L=P[1],N=P[2],U=Math.atan2(F,z)*e,Z=Math.sqrt(z*z+F*F),Q,ue;Math.abs(L)>Z?(ue=(L>0?90:-90)-U,Q=0):(ue=Math.asin(L/Z)*e-U,Q=Math.sqrt(Z*Z-L*L));var oe=180-ue-2*U,le=(Math.atan2(N,O)-Math.atan2(B,Q))*e,j=(Math.atan2(N,O)-Math.atan2(B,-Q))*e,J=y(R[0],R[1],ue,le),$=y(R[0],R[1],oe,j);return J<=$?[ue,le,R[2]]:[oe,j,R[2]]}function y(g,m,R,P){var z=b(R-g),F=b(P-m);return Math.sqrt(z*z+F*F)}function b(g){return(g%360+540)%360-180}function S(g,m,R){var P=R*E,z=g.slice(),F=m===0?1:0,B=m===2?1:2,O=Math.cos(P),L=Math.sin(P);return z[F]=g[F]*O-g[B]*L,z[B]=g[B]*O+g[F]*L,z}function M(g){return[Math.atan2(2*(g[0]*g[1]+g[2]*g[3]),1-2*(g[1]*g[1]+g[2]*g[2]))*e,Math.asin(Math.max(-1,Math.min(1,2*(g[0]*g[2]-g[3]*g[1]))))*e,Math.atan2(2*(g[0]*g[3]+g[1]*g[2]),1-2*(g[2]*g[2]+g[3]*g[3]))*e]}function _(g){var m=g[0]*E,R=g[1]*E,P=Math.cos(R);return[P*Math.cos(m),P*Math.sin(m),Math.sin(R)]}function w(g,m){for(var R=0,P=0,z=g.length;P0&&L._module.calcGeoJSON(O,P)}if(!z){var N=this.updateProjection(R,P);if(N)return;(!this.viewInitial||this.scope!==F.scope)&&this.saveViewInitial(F)}this.scope=F.scope,this.updateBaseLayers(P,F),this.updateDims(P,F),this.updateFx(P,F),s.generalUpdatePerTraceModule(this.graphDiv,this,R,F);var U=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=U.selectAll(".point"),this.dataPoints.text=U.selectAll("text"),this.dataPaths.line=U.selectAll(".js-line");var Z=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=Z.selectAll("path"),this._render()},p.updateProjection=function(R,P){var z=this.graphDiv,F=P[this.id],B=P._size,O=F.domain,L=F.projection,N=F.lonaxis,U=F.lataxis,Z=N._ax,Q=U._ax,ue=this.projection=u(F),oe=[[B.l+B.w*O.x[0],B.t+B.h*(1-O.y[1])],[B.l+B.w*O.x[1],B.t+B.h*(1-O.y[0])]],le=F.center||{},j=L.rotation||{},J=N.range||[],$=U.range||[];if(F.fitbounds){Z._length=oe[1][0]-oe[0][0],Q._length=oe[1][1]-oe[0][1],Z.range=f(z,Z),Q.range=f(z,Q);var X=(Z.range[0]+Z.range[1])/2,re=(Q.range[0]+Q.range[1])/2;if(F._isScoped)le={lon:X,lat:re};else if(F._isClipped){le={lon:X,lat:re},j={lon:X,lat:re,roll:j.roll};var ee=L.type,q=b.lonaxisSpan[ee]/2||180,ae=b.lataxisSpan[ee]/2||90;J=[X-q,X+q],$=[re-ae,re+ae]}else le={lon:X,lat:re},j={lon:X,lat:j.lat,roll:j.roll}}ue.center([le.lon-j.lon,le.lat-j.lat]).rotate([-j.lon,-j.lat,j.roll]).parallels(L.parallels);var ie=m(J,$);ue.fitExtent(oe,ie);var fe=this.bounds=ue.getBounds(ie),we=this.fitScale=ue.scale(),Ae=ue.translate();if(F.fitbounds){var Fe=ue.getBounds(m(Z.range,Q.range)),Ce=Math.min((fe[1][0]-fe[0][0])/(Fe[1][0]-Fe[0][0]),(fe[1][1]-fe[0][1])/(Fe[1][1]-Fe[0][1]));isFinite(Ce)?ue.scale(Ce*we):r.warn("Something went wrong during"+this.id+"fitbounds computations.")}else ue.scale(L.scale*we);var qe=this.midPt=[(fe[0][0]+fe[1][0])/2,(fe[0][1]+fe[1][1])/2];if(ue.translate([Ae[0]+(qe[0]-Ae[0]),Ae[1]+(qe[1]-Ae[1])]).clipExtent(fe),F._isAlbersUsa){var et=ue([le.lon,le.lat]),Qe=ue.translate();ue.translate([Qe[0]-(et[0]-Qe[0]),Qe[1]-(et[1]-Qe[1])])}},p.updateBaseLayers=function(R,P){var z=this,F=z.topojson,B=z.layers,O=z.basePaths;function L(oe){return oe==="lonaxis"||oe==="lataxis"}function N(oe){return!!b.lineLayers[oe]}function U(oe){return!!b.fillLayers[oe]}var Z=this.hasChoropleth?b.layersForChoropleth:b.layers,Q=Z.filter(function(oe){return N(oe)||U(oe)?P["show"+oe]:L(oe)?P[oe].showgrid:!0}),ue=z.framework.selectAll(".layer").data(Q,String);ue.exit().each(function(oe){delete B[oe],delete O[oe],d.select(this).remove()}),ue.enter().append("g").attr("class",function(oe){return"layer "+oe}).each(function(oe){var le=B[oe]=d.select(this);oe==="bg"?z.bgRect=le.append("rect").style("pointer-events","all"):L(oe)?O[oe]=le.append("path").style("fill","none"):oe==="backplot"?le.append("g").classed("choroplethlayer",!0):oe==="frontplot"?le.append("g").classed("scatterlayer",!0):N(oe)?O[oe]=le.append("path").style("fill","none").style("stroke-miterlimit",2):U(oe)&&(O[oe]=le.append("path").style("stroke","none"))}),ue.order(),ue.each(function(oe){var le=O[oe],j=b.layerNameToAdjective[oe];oe==="frame"?le.datum(b.sphereSVG):N(oe)||U(oe)?le.datum(_(F,F.objects[oe])):L(oe)&&le.datum(g(oe,P,R)).call(a.stroke,P[oe].gridcolor).call(i.dashLine,P[oe].griddash,P[oe].gridwidth),N(oe)?le.call(a.stroke,P[j+"color"]).call(i.dashLine,"",P[j+"width"]):U(oe)&&le.call(a.fill,P[j+"color"])})},p.updateDims=function(R,P){var z=this.bounds,F=(P.framewidth||0)/2,B=z[0][0]-F,O=z[0][1]-F,L=z[1][0]-B+F,N=z[1][1]-O+F;i.setRect(this.clipRect,B,O,L,N),this.bgRect.call(i.setRect,B,O,L,N).call(a.fill,P.bgcolor),this.xaxis._offset=B,this.xaxis._length=L,this.yaxis._offset=O,this.yaxis._length=N},p.updateFx=function(R,P){var z=this,F=z.graphDiv,B=z.bgRect,O=R.dragmode,L=R.clickmode;if(z.isStatic)return;function N(){var ue=z.viewInitial,oe={};for(var le in ue)oe[z.id+"."+le]=ue[le];t.call("_guiRelayout",F,oe),F.emit("plotly_doubleclick",null)}function U(ue){return z.projection.invert([ue[0]+z.xaxis._offset,ue[1]+z.yaxis._offset])}var Z=function(ue,oe){if(oe.isRect){var le=ue.range={};le[z.id]=[U([oe.xmin,oe.ymin]),U([oe.xmax,oe.ymax])]}else{var j=ue.lassoPoints={};j[z.id]=oe.map(U)}},Q={element:z.bgRect.node(),gd:F,plotinfo:{id:z.id,xaxis:z.xaxis,yaxis:z.yaxis,fillRangeItems:Z},xaxes:[z.xaxis],yaxes:[z.yaxis],subplot:z.id,clickFn:function(ue){ue===2&&T(F)}};O==="pan"?(B.node().onmousedown=null,B.call(y(z,P)),B.on("dblclick.zoom",N),F._context._scrollZoom.geo||B.on("wheel.zoom",null)):(O==="select"||O==="lasso")&&(B.on(".zoom",null),Q.prepFn=function(ue,oe,le){h(ue,oe,le,Q,O)},v.init(Q)),B.on("mousemove",function(){var ue=z.projection.invert(r.getPositionFromD3Event());if(!ue)return v.unhover(F,d.event);z.xaxis.p2c=function(){return ue[0]},z.yaxis.p2c=function(){return ue[1]},n.hover(F,d.event,z.id)}),B.on("mouseout",function(){F._dragging||v.unhover(F,d.event)}),B.on("click",function(){O!=="select"&&O!=="lasso"&&(L.indexOf("select")>-1&&l(d.event,F,[z.xaxis],[z.yaxis],z.id,Q),L.indexOf("event")>-1&&n.click(F,d.event))})},p.makeFramework=function(){var R=this,P=R.graphDiv,z=P._fullLayout,F="clip"+z._uid+R.id;R.clipDef=z._clips.append("clipPath").attr("id",F),R.clipRect=R.clipDef.append("rect"),R.framework=d.select(R.container).append("g").attr("class","geo "+R.id).call(i.setClipUrl,F,P),R.project=function(B){var O=R.projection(B);return O?[O[0]-R.xaxis._offset,O[1]-R.yaxis._offset]:[null,null]},R.xaxis={_id:"x",c2p:function(B){return R.project(B)[0]}},R.yaxis={_id:"y",c2p:function(B){return R.project(B)[1]}},R.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},c.setConvert(R.mockAxis,z)},p.saveViewInitial=function(R){var P=R.center||{},z=R.projection,F=z.rotation||{};this.viewInitial={fitbounds:R.fitbounds,"projection.scale":z.scale};var B;R._isScoped?B={"center.lon":P.lon,"center.lat":P.lat}:R._isClipped?B={"projection.rotation.lon":F.lon,"projection.rotation.lat":F.lat}:B={"center.lon":P.lon,"center.lat":P.lat,"projection.rotation.lon":F.lon},r.extendFlat(this.viewInitial,B)},p.render=function(R){this._hasMarkerAngles&&R?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},p._render=function(){var R=this.projection,P=R.getPath(),z;function F(O){var L=R(O.lonlat);return L?o(L[0],L[1]):null}function B(O){return R.isLonLatOverEdges(O.lonlat)?"none":null}for(z in this.basePaths)this.basePaths[z].attr("d",P);for(z in this.dataPaths)this.dataPaths[z].attr("d",function(O){return P(O.geojson)});for(z in this.dataPoints)this.dataPoints[z].attr("display",B).attr("transform",F)};function u(R){var P=R.projection,z=P.type,F=b.projNames[z];F="geo"+r.titleCase(F);for(var B=x[F]||e[F],O=B(),L=R._isSatellite?Math.acos(1/P.distance)*180/Math.PI:R._isClipped?b.lonaxisSpan[z]/2:null,N=["center","rotate","parallels","clipExtent"],U=function(ue){return ue?O:[]},Z=0;Zj}else return!1},O.getPath=function(){return A().projection(O)},O.getBounds=function(ue){return O.getPath().bounds(ue)},O.precision(b.precision),R._isSatellite&&O.tilt(P.tilt).distance(P.distance),L&&O.clipAngle(L-b.clipPad),O}function g(R,P,z){var F=1e-6,B=2.5,O=P[R],L=b.scopeDefaults[P.scope],N,U,Z;R==="lonaxis"?(N=L.lonaxisRange,U=L.lataxisRange,Z=function(re,ee){return[re,ee]}):R==="lataxis"&&(N=L.lataxisRange,U=L.lonaxisRange,Z=function(re,ee){return[ee,re]});var Q={type:"linear",range:[N[0],N[1]-F],tick0:O.tick0,dtick:O.dtick};c.setConvert(Q,z);var ue=c.calcTicks(Q);!P.isScoped&&R==="lonaxis"&&ue.pop();for(var oe=ue.length,le=new Array(oe),j=0;j0&&B<0&&(B+=360);var N=(B-F)/4;return{type:"Polygon",coordinates:[[[F,O],[F,L],[F+N,L],[F+2*N,L],[F+3*N,L],[B,L],[B,O],[B-N,O],[B-2*N,O],[B-3*N,O],[F,O]]]}}}}),G3=He({"src/plots/geo/layout_attributes.js"(Y,G){var d=Xc(),x=mu().attributes,A=Nf().dash,E=jy(),e=hu().overrideAll,t=Ud(),r={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:d.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:A},o=G.exports=e({domain:x({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:t(E.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:t(E.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:d.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:E.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:E.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:E.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:E.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:d.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:d.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:d.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:d.background},lonaxis:r,lataxis:r},"plot","from-root");o.uirevision={valType:"any",editType:"none"}}}),wP=He({"src/plots/geo/layout_defaults.js"(Y,G){var d=Gr(),x=Xd(),A=Uf().getSubplotData,E=jy(),e=G3(),t=E.axesNames;G.exports=function(a,i,n){x(a,i,n,{type:"geo",attributes:e,handleDefaults:r,fullData:n,partition:"y"})};function r(o,a,i,n){var s=A(n.fullData,"geo",n.id),c=s.map(function($){return $.index}),f=i("resolution"),v=i("scope"),h=E.scopeDefaults[v],T=i("projection.type",h.projType),l=a._isAlbersUsa=T==="albers usa";l&&(v=a.scope="usa");var y=a._isScoped=v!=="world",b=a._isSatellite=T==="satellite",S=a._isConic=T.indexOf("conic")!==-1||T==="albers",M=a._isClipped=!!E.lonaxisSpan[T];if(o.visible===!1){var _=d.extendDeep({},a._template);_.showcoastlines=!1,_.showcountries=!1,_.showframe=!1,_.showlakes=!1,_.showland=!1,_.showocean=!1,_.showrivers=!1,_.showsubunits=!1,_.lonaxis&&(_.lonaxis.showgrid=!1),_.lataxis&&(_.lataxis.showgrid=!1),a._template=_}for(var w=i("visible"),p,u=0;u0&&U<0&&(U+=360);var Z=(N+U)/2,Q;if(!l){var ue=y?h.projRotate:[Z,0,0];Q=i("projection.rotation.lon",ue[0]),i("projection.rotation.lat",ue[1]),i("projection.rotation.roll",ue[2]),p=i("showcoastlines",!y&&w),p&&(i("coastlinecolor"),i("coastlinewidth")),p=i("showocean",w?void 0:!1),p&&i("oceancolor")}var oe,le;if(l?(oe=-96.6,le=38.7):(oe=y?Z:Q,le=(L[0]+L[1])/2),i("center.lon",oe),i("center.lat",le),b&&(i("projection.tilt"),i("projection.distance")),S){var j=h.projParallels||[0,60];i("projection.parallels",j)}i("projection.scale"),p=i("showland",w?void 0:!1),p&&i("landcolor"),p=i("showlakes",w?void 0:!1),p&&i("lakecolor"),p=i("showrivers",w?void 0:!1),p&&(i("rivercolor"),i("riverwidth")),p=i("showcountries",y&&v!=="usa"&&w),p&&(i("countrycolor"),i("countrywidth")),(v==="usa"||v==="north america"&&f===50)&&(i("showsubunits",w),i("subunitcolor"),i("subunitwidth")),y||(p=i("showframe",w),p&&(i("framecolor"),i("framewidth"))),i("bgcolor");var J=i("fitbounds");J&&(delete a.projection.scale,y?(delete a.center.lon,delete a.center.lat):M?(delete a.center.lon,delete a.center.lat,delete a.projection.rotation.lon,delete a.projection.rotation.lat,delete a.lonaxis.range,delete a.lataxis.range):(delete a.center.lon,delete a.center.lat,delete a.projection.rotation.lon))}}}),W3=He({"src/plots/geo/index.js"(Y,G){var d=Uf().getSubplotCalcData,x=Gr().counterRegex,A=bP(),E="geo",e=x(E),t={};t[E]={valType:"subplotid",dflt:E,editType:"calc"};function r(i){for(var n=i._fullLayout,s=i.calcdata,c=n._subplots[E],f=0;f")}}}}),X_=He({"src/traces/choropleth/event_data.js"(Y,G){G.exports=function(x,A,E,e,t){x.location=A.location,x.z=A.z;var r=e[t];return r.fIn&&r.fIn.properties&&(x.properties=r.fIn.properties),x.ct=r.ct,x}}}),Y_=He({"src/traces/choropleth/select.js"(Y,G){G.exports=function(x,A){var E=x.cd,e=x.xaxis,t=x.yaxis,r=[],o,a,i,n,s;if(A===!1)for(o=0;o=Math.min(U,Z)&&T<=Math.max(U,Z)?0:1/0}if(P=Math.min(Q,ue)&&l<=Math.max(Q,ue)?0:1/0}B=Math.sqrt(P*P+z*z),u=b[R]}}}else for(R=b.length-1;R>-1;R--)p=b[R],g=v[p],m=h[p],P=c.c2p(g)-T,z=f.c2p(m)-l,F=Math.sqrt(P*P+z*z),F100},Y.isDotSymbol=function(d){return typeof d=="string"?G.DOT_RE.test(d):d>200}}}),kP=He({"src/traces/scattergl/defaults.js"(Y,G){var d=Gr(),x=Ei(),A=J_(),E=qy(),e=jv(),t=Rl(),r=j0(),o=Tv(),a=Kh(),i=nv(),n=Av(),s=iv();G.exports=function(f,v,h,T){function l(u,g){return d.coerce(f,v,E,u,g)}var y=f.marker?A.isOpenSymbol(f.marker.symbol):!1,b=t.isBubble(f),S=r(f,v,T,l);if(!S){v.visible=!1;return}o(f,v,T,l),l("xhoverformat"),l("yhoverformat");var M=S>>1,f=r[c],v=a!==void 0?a(f,o):f-o;v>=0?(s=c,n=c-1):i=c+1}return s}function x(r,o,a,i,n){for(var s=n+1;i<=n;){var c=i+n>>>1,f=r[c],v=a!==void 0?a(f,o):f-o;v>0?(s=c,n=c-1):i=c+1}return s}function A(r,o,a,i,n){for(var s=i-1;i<=n;){var c=i+n>>>1,f=r[c],v=a!==void 0?a(f,o):f-o;v<0?(s=c,i=c+1):n=c-1}return s}function E(r,o,a,i,n){for(var s=i-1;i<=n;){var c=i+n>>>1,f=r[c],v=a!==void 0?a(f,o):f-o;v<=0?(s=c,i=c+1):n=c-1}return s}function e(r,o,a,i,n){for(;i<=n;){var s=i+n>>>1,c=r[s],f=a!==void 0?a(c,o):c-o;if(f===0)return s;f<=0?i=s+1:n=s-1}return-1}function t(r,o,a,i,n,s){return typeof a=="function"?s(r,o,a,i===void 0?0:i|0,n===void 0?r.length-1:n|0):s(r,o,void 0,a===void 0?0:a|0,i===void 0?r.length-1:i|0)}G.exports={ge:function(r,o,a,i,n){return t(r,o,a,i,n,d)},gt:function(r,o,a,i,n){return t(r,o,a,i,n,x)},lt:function(r,o,a,i,n){return t(r,o,a,i,n,A)},le:function(r,o,a,i,n){return t(r,o,a,i,n,E)},eq:function(r,o,a,i,n){return t(r,o,a,i,n,e)}}}}),Gv=He({"node_modules/pick-by-alias/index.js"(Y,G){G.exports=function(E,e,t){var r={},o,a;if(typeof e=="string"&&(e=x(e)),Array.isArray(e)){var i={};for(a=0;a1&&(A=arguments),typeof A=="string"?A=A.split(/\s/).map(parseFloat):typeof A=="number"&&(A=[A]),A.length&&typeof A[0]=="number"?A.length===1?E={width:A[0],height:A[0],x:0,y:0}:A.length===2?E={width:A[0],height:A[1],x:0,y:0}:E={x:A[0],y:A[1],width:A[2]-A[0]||0,height:A[3]-A[1]||0}:A&&(A=d(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"}),E={x:A.left||0,y:A.top||0},A.width==null?A.right?E.width=A.right-E.x:E.width=0:E.width=A.width,A.height==null?A.bottom?E.height=A.bottom-E.y:E.height=0:E.height=A.height),E}}}),Xp=He({"node_modules/array-bounds/index.js"(Y,G){G.exports=d;function d(x,A){if(!x||x.length==null)throw Error("Argument should be an array");A==null?A=1:A=Math.floor(A);for(var E=Array(A*2),e=0;et&&(t=x[o]),x[o]>>1,b;v.dtype||(v.dtype="array"),typeof v.dtype=="string"?b=new(a(v.dtype))(y):v.dtype&&(b=v.dtype,Array.isArray(b)&&(b.length=y));for(let P=0;Ph||L>n){for(let re=0;reie||Z>fe||Q<$||ue=oe||q===ae)return;let we=S[ee];ae===void 0&&(ae=we.length);for(let Me=q;Me=B&&ce<=L&&Re>=O&&Re<=N&&le.push(xe)}let Ae=M[ee],Fe=Ae[q*4+0],Ce=Ae[q*4+1],qe=Ae[q*4+2],et=Ae[q*4+3],Qe=J(Ae,q+1),Ke=re*.5,Xe=ee+1;j($,X,Ke,Xe,Fe,Ce||qe||et||Qe),j($,X+Ke,Ke,Xe,Ce,qe||et||Qe),j($+Ke,X,Ke,Xe,qe,et||Qe),j($+Ke,X+Ke,Ke,Xe,et,Qe)}function J($,X){let re=null,ee=0;for(;re===null;)if(re=$[X*4+ee],ee++,ee>$.length)return null;return re}return le}function m(P,z,F,B,O){let L=[];for(let N=0;N1&&(f=1),f<-1&&(f=-1),c*Math.acos(f)},t=function(a,i,n,s,c,f,v,h,T,l,y,b){var S=Math.pow(c,2),M=Math.pow(f,2),_=Math.pow(y,2),w=Math.pow(b,2),p=S*M-S*w-M*_;p<0&&(p=0),p/=S*w+M*_,p=Math.sqrt(p)*(v===h?-1:1);var u=p*c/f*b,g=p*-f/c*y,m=l*u-T*g+(a+n)/2,R=T*u+l*g+(i+s)/2,P=(y-u)/c,z=(b-g)/f,F=(-y-u)/c,B=(-b-g)/f,O=e(1,0,P,z),L=e(P,z,F,B);return h===0&&L>0&&(L-=x),h===1&&L<0&&(L+=x),[m,R,O,L]},r=function(a){var i=a.px,n=a.py,s=a.cx,c=a.cy,f=a.rx,v=a.ry,h=a.xAxisRotation,T=h===void 0?0:h,l=a.largeArcFlag,y=l===void 0?0:l,b=a.sweepFlag,S=b===void 0?0:b,M=[];if(f===0||v===0)return[];var _=Math.sin(T*x/360),w=Math.cos(T*x/360),p=w*(i-s)/2+_*(n-c)/2,u=-_*(i-s)/2+w*(n-c)/2;if(p===0&&u===0)return[];f=Math.abs(f),v=Math.abs(v);var g=Math.pow(p,2)/Math.pow(f,2)+Math.pow(u,2)/Math.pow(v,2);g>1&&(f*=Math.sqrt(g),v*=Math.sqrt(g));var m=t(i,n,s,c,f,v,y,S,_,w,p,u),R=d(m,4),P=R[0],z=R[1],F=R[2],B=R[3],O=Math.abs(B)/(x/4);Math.abs(1-O)<1e-7&&(O=1);var L=Math.max(Math.ceil(O),1);B/=L;for(var N=0;N4?(o=l[l.length-4],a=l[l.length-3]):(o=f,a=v),r.push(l)}return r}function A(e,t,r,o){return["C",e,t,r,o,r,o]}function E(e,t,r,o,a,i){return["C",e/3+2/3*r,t/3+2/3*o,a/3+2/3*r,i/3+2/3*o,a,i]}}}),Y3=He({"node_modules/is-svg-path/index.js"(Y,G){G.exports=function(x){return typeof x!="string"?!1:(x=x.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(x)&&/[\dz]$/i.test(x)&&x.length>4))}}}),OP=He({"node_modules/svg-path-bounds/index.js"(Y,G){var d=Yg(),x=X3(),A=FP(),E=Y3(),e=_y();G.exports=t;function t(r){if(Array.isArray(r)&&r.length===1&&typeof r[0]=="string"&&(r=r[0]),typeof r=="string"&&(e(E(r),"String is not an SVG path."),r=d(r)),e(Array.isArray(r),"Argument should be a string or an array of path segments."),r=x(r),r=A(r),!r.length)return[0,0,0,0];for(var o=[1/0,1/0,-1/0,-1/0],a=0,i=r.length;ao[2]&&(o[2]=n[s+0]),n[s+1]>o[3]&&(o[3]=n[s+1]);return o}}}),BP=He({"node_modules/normalize-svg-path/index.js"(Y,G){var d=Math.PI,x=o(120);G.exports=A;function A(a){for(var i,n=[],s=0,c=0,f=0,v=0,h=null,T=null,l=0,y=0,b=0,S=a.length;b7&&(n.push(M.splice(0,7)),M.unshift("C"));break;case"S":var w=l,p=y;(i=="C"||i=="S")&&(w+=w-s,p+=p-c),M=["C",w,p,M[1],M[2],M[3],M[4]];break;case"T":i=="Q"||i=="T"?(h=l*2-h,T=y*2-T):(h=l,T=y),M=e(l,y,h,T,M[1],M[2]);break;case"Q":h=M[1],T=M[2],M=e(l,y,M[1],M[2],M[3],M[4]);break;case"L":M=E(l,y,M[1],M[2]);break;case"H":M=E(l,y,M[1],y);break;case"V":M=E(l,y,l,M[1]);break;case"Z":M=E(l,y,f,v);break}i=_,l=M[M.length-2],y=M[M.length-1],M.length>4?(s=M[M.length-4],c=M[M.length-3]):(s=l,c=y),n.push(M)}return n}function E(a,i,n,s){return["C",a,i,n,s,n,s]}function e(a,i,n,s,c,f){return["C",a/3+2/3*n,i/3+2/3*s,c/3+2/3*n,f/3+2/3*s,c,f]}function t(a,i,n,s,c,f,v,h,T,l){if(l)m=l[0],R=l[1],u=l[2],g=l[3];else{var y=r(a,i,-c);a=y.x,i=y.y,y=r(h,T,-c),h=y.x,T=y.y;var b=(a-h)/2,S=(i-T)/2,M=b*b/(n*n)+S*S/(s*s);M>1&&(M=Math.sqrt(M),n=M*n,s=M*s);var _=n*n,w=s*s,p=(f==v?-1:1)*Math.sqrt(Math.abs((_*w-_*S*S-w*b*b)/(_*S*S+w*b*b)));p==1/0&&(p=1);var u=p*n*S/s+(a+h)/2,g=p*-s*b/n+(i+T)/2,m=Math.asin(((i-g)/s).toFixed(9)),R=Math.asin(((T-g)/s).toFixed(9));m=aR&&(m=m-d*2),!v&&R>m&&(R=R-d*2)}if(Math.abs(R-m)>x){var P=R,z=h,F=T;R=m+x*(v&&R>m?1:-1),h=u+n*Math.cos(R),T=g+s*Math.sin(R);var B=t(h,T,n,s,c,0,v,z,F,[R,P,u,g])}var O=Math.tan((R-m)/4),L=4/3*n*O,N=4/3*s*O,U=[2*a-(a+L*Math.sin(m)),2*i-(i-N*Math.cos(m)),h+L*Math.sin(R),T-N*Math.cos(R),h,T];if(l)return U;B&&(U=U.concat(B));for(var Z=0;Z0?r.strokeStyle="white":r.strokeStyle="black",r.lineWidth=Math.abs(h)),r.translate(c*.5,f*.5),r.scale(y,y),i()){var b=new Path2D(n);r.fill(b),h&&r.stroke(b)}else{var S=x(n);A(r,S),r.fill(),h&&r.stroke()}r.setTransform(1,0,0,1,0,0);var M=e(r,{cutoff:s.cutoff!=null?s.cutoff:.5,radius:s.radius!=null?s.radius:v*.5});return M}var a;function i(){if(a!=null)return a;var n=document.createElement("canvas").getContext("2d");if(n.canvas.width=n.canvas.height=1,!window.Path2D)return a=!1;var s=new Path2D("M0,0h1v1h-1v-1Z");n.fillStyle="black",n.fill(s);var c=n.getImageData(0,0,1,1);return a=c&&c.data&&c.data[3]===255}}}),Kp=He({"src/traces/scattergl/convert.js"(Y,G){var d=Hi(),x=jP(),A=rp(),E=Ei(),e=Gr(),t=e.isArrayOrTypedArray,r=vo(),o=oc(),a=fd().formatColor,i=Rl(),n=B0(),s=J_(),c=op(),f=Bd().DESELECTDIM,v={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},h=Ph().appendArrayPointValue;function T(B,O){var L,N={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},U=B._context.plotGlPixelRatio;if(O.visible!==!0)return N;if(i.hasText(O)&&(N.text=l(B,O),N.textSel=M(B,O,O.selected),N.textUnsel=M(B,O,O.unselected)),i.hasMarkers(O)&&(N.marker=b(B,O),N.markerSel=S(B,O,O.selected),N.markerUnsel=S(B,O,O.unselected),!O.unselected&&t(O.marker.opacity))){var Z=O.marker.opacity;for(N.markerUnsel.opacity=new Array(Z.length),L=0;L500?"bold":"normal":B}function b(B,O){var L=O._length,N=O.marker,U={},Z,Q=t(N.symbol),ue=t(N.angle),oe=t(N.color),le=t(N.line.color),j=t(N.opacity),J=t(N.size),$=t(N.line.width),X;if(Q||(X=s.isOpenSymbol(N.symbol)),Q||oe||le||j||ue){U.symbols=new Array(L),U.angles=new Array(L),U.colors=new Array(L),U.borderColors=new Array(L);var re=N.symbol,ee=N.angle,q=a(N,N.opacity,L),ae=a(N.line,N.opacity,L);if(!t(ae[0])){var ie=ae;for(ae=Array(L),Z=0;Zc.TOO_MANY_POINTS||i.hasMarkers(O)?"rect":"round";if(le&&O.connectgaps){var J=Z[0],$=Z[1];for(Q=0;Q1?oe[Q]:oe[0]:oe,X=t(le)?le.length>1?le[Q]:le[0]:le,re=v[$],ee=v[X],q=j?j/.8+1:0,ae=-ee*q-ee*.5;Z.offset[Q]=[re*q/J,ae/J]}}return Z}G.exports={style:T,markerStyle:b,markerSelection:S,linePositions:P,errorBarPositions:z,textPosition:F}}}),K3=He({"src/traces/scattergl/scene_update.js"(Y,G){var d=Gr();G.exports=function(A,E){var e=E._scene,t={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},r={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return E._scene||(e=E._scene={},e.init=function(){d.extendFlat(e,r,t)},e.init(),e.update=function(a){var i=d.repeat(a,e.count);if(e.fill2d&&e.fill2d.update(i),e.scatter2d&&e.scatter2d.update(i),e.line2d&&e.line2d.update(i),e.error2d&&e.error2d.update(i.concat(i)),e.select2d&&e.select2d.update(i),e.glText)for(var n=0;n=f,u=w*2,g={},m,R=S.makeCalcdata(y,"x"),P=M.makeCalcdata(y,"y"),z=e(y,S,"x",R),F=e(y,M,"y",P),B=z.vals,O=F.vals;y._x=B,y._y=O,y.xperiodalignment&&(y._origX=R,y._xStarts=z.starts,y._xEnds=z.ends),y.yperiodalignment&&(y._origY=P,y._yStarts=F.starts,y._yEnds=F.ends);var L=new Array(u),N=new Array(w);for(m=0;m1&&x.extendFlat(_.line,n.linePositions(T,y,b)),_.errorX||_.errorY){var w=n.errorBarPositions(T,y,b,S,M);_.errorX&&x.extendFlat(_.errorX,w.x),_.errorY&&x.extendFlat(_.errorY,w.y)}return _.text&&(x.extendFlat(_.text,{positions:b},n.textPosition(T,y,_.text,_.marker)),x.extendFlat(_.textSel,{positions:b},n.textPosition(T,y,_.text,_.markerSel)),x.extendFlat(_.textUnsel,{positions:b},n.textPosition(T,y,_.text,_.markerUnsel))),_}}}),J3=He({"src/traces/scattergl/edit_style.js"(Y,G){var d=Gr(),x=Ai(),A=Bd().DESELECTDIM;function E(e){var t=e[0],r=t.trace,o=t.t,a=o._scene,i=o.index,n=a.selectBatch[i],s=a.unselectBatch[i],c=a.textOptions[i],f=a.textSelectedOptions[i]||{},v=a.textUnselectedOptions[i]||{},h=d.extendFlat({},c),T,l;if(n.length||s.length){var y=f.color,b=v.color,S=c.color,M=d.isArrayOrTypedArray(S);for(h.color=new Array(r._length),T=0;T>>24,r=(E&16711680)>>>16,o=(E&65280)>>>8,a=E&255;return e===!1?[t,r,o,a]:[t/255,r/255,o/255,a/255]}}}),Yc=He({"node_modules/object-assign/index.js"(Y,G){var d=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;function E(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function e(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var r={},o=0;o<10;o++)r["_"+String.fromCharCode(o)]=o;var a=Object.getOwnPropertyNames(r).map(function(n){return r[n]});if(a.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(n){i[n]=n}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}G.exports=e()?Object.assign:function(t,r){for(var o,a=E(t),i,n=1;ng.length)&&(m=g.length);for(var R=0,P=new Array(m);R 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; +} +`]),oe.vert=h([`precision highp float; +#define GLSLIFY 1 + +attribute float x, y, xFract, yFract; +attribute float size, borderSize; +attribute vec4 colorId, borderColorId; +attribute float isActive; + +// \`invariant\` effectively turns off optimizations for the position. +// We need this because -fast-math on M1 Macs is re-ordering +// floating point operations in a way that causes floating point +// precision limits to put points in the wrong locations. +invariant gl_Position; + +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; +} +`]),b&&(oe.frag=oe.frag.replace("smoothstep","smoothStep"),ue.frag=ue.frag.replace("smoothstep","smoothStep")),this.drawCircle=g(oe)}w.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},w.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},w.prototype.draw=function(){for(var g=this,m=arguments.length,R=new Array(m),P=0;Pxe)?Xe.tree=f(Ke,{bounds:Je}):xe&&xe.length&&(Xe.tree=xe),Xe.tree){var At={primitive:"points",usage:"static",data:Xe.tree,type:"uint32"};Xe.elements?Xe.elements(At):Xe.elements=B.elements(At)}var St=S.float32(Ke);ce({data:St,usage:"dynamic"});var Rt=S.fract32(Ke,St);return Re({data:Rt,usage:"dynamic"}),$e({data:new Uint8Array(rt),type:"uint8",usage:"stream"}),Ke}},{marker:function(Ke,Xe,Me){var xe=Xe.activation;if(xe.forEach(function(Rt){return Rt&&Rt.destroy&&Rt.destroy()}),xe.length=0,!Ke||typeof Ke[0]=="number"){var ce=g.addMarker(Ke);xe[ce]=!0}else{for(var Re=[],$e=0,rt=Math.min(Ke.length,Xe.count);$e=0)return z;var F;if(g instanceof Uint8Array||g instanceof Uint8ClampedArray)F=g;else{F=new Uint8Array(g.length);for(var B=0,O=g.length;BP*4&&(this.tooManyColors=!0),this.updatePalette(R),z.length===1?z[0]:z},w.prototype.updatePalette=function(g){if(!this.tooManyColors){var m=this.maxColors,R=this.paletteTexture,P=Math.ceil(g.length*.25/m);if(P>1){g=g.slice();for(var z=g.length*.25%m;z80*L){ue=le=B[0],oe=j=B[1];for(var re=L;rele&&(le=J),$>j&&(j=$);X=Math.max(le-ue,j-oe),X=X!==0?32767/X:0}return E(Z,Q,L,ue,oe,X,0),Q}function x(B,O,L,N,U){var Z,Q;if(U===F(B,O,L,N)>0)for(Z=O;Z=O;Z-=N)Q=R(Z,B[Z],B[Z+1],Q);return Q&&S(Q,Q.next)&&(P(Q),Q=Q.next),Q}function A(B,O){if(!B)return B;O||(O=B);var L=B,N;do if(N=!1,!L.steiner&&(S(L,L.next)||b(L.prev,L,L.next)===0)){if(P(L),L=O=L.prev,L===L.next)break;N=!0}else L=L.next;while(N||L!==O);return O}function E(B,O,L,N,U,Z,Q){if(B){!Q&&Z&&f(B,N,U,Z);for(var ue=B,oe,le;B.prev!==B.next;){if(oe=B.prev,le=B.next,Z?t(B,N,U,Z):e(B)){O.push(oe.i/L|0),O.push(B.i/L|0),O.push(le.i/L|0),P(B),B=le.next,ue=le.next;continue}if(B=le,B===ue){Q?Q===1?(B=r(A(B),O,L),E(B,O,L,N,U,Z,2)):Q===2&&o(B,O,L,N,U,Z):E(A(B),O,L,N,U,Z,1);break}}}}function e(B){var O=B.prev,L=B,N=B.next;if(b(O,L,N)>=0)return!1;for(var U=O.x,Z=L.x,Q=N.x,ue=O.y,oe=L.y,le=N.y,j=UZ?U>Q?U:Q:Z>Q?Z:Q,X=ue>oe?ue>le?ue:le:oe>le?oe:le,re=N.next;re!==O;){if(re.x>=j&&re.x<=$&&re.y>=J&&re.y<=X&&l(U,ue,Z,oe,Q,le,re.x,re.y)&&b(re.prev,re,re.next)>=0)return!1;re=re.next}return!0}function t(B,O,L,N){var U=B.prev,Z=B,Q=B.next;if(b(U,Z,Q)>=0)return!1;for(var ue=U.x,oe=Z.x,le=Q.x,j=U.y,J=Z.y,$=Q.y,X=ueoe?ue>le?ue:le:oe>le?oe:le,q=j>J?j>$?j:$:J>$?J:$,ae=h(X,re,O,L,N),ie=h(ee,q,O,L,N),fe=B.prevZ,we=B.nextZ;fe&&fe.z>=ae&&we&&we.z<=ie;){if(fe.x>=X&&fe.x<=ee&&fe.y>=re&&fe.y<=q&&fe!==U&&fe!==Q&&l(ue,j,oe,J,le,$,fe.x,fe.y)&&b(fe.prev,fe,fe.next)>=0||(fe=fe.prevZ,we.x>=X&&we.x<=ee&&we.y>=re&&we.y<=q&&we!==U&&we!==Q&&l(ue,j,oe,J,le,$,we.x,we.y)&&b(we.prev,we,we.next)>=0))return!1;we=we.nextZ}for(;fe&&fe.z>=ae;){if(fe.x>=X&&fe.x<=ee&&fe.y>=re&&fe.y<=q&&fe!==U&&fe!==Q&&l(ue,j,oe,J,le,$,fe.x,fe.y)&&b(fe.prev,fe,fe.next)>=0)return!1;fe=fe.prevZ}for(;we&&we.z<=ie;){if(we.x>=X&&we.x<=ee&&we.y>=re&&we.y<=q&&we!==U&&we!==Q&&l(ue,j,oe,J,le,$,we.x,we.y)&&b(we.prev,we,we.next)>=0)return!1;we=we.nextZ}return!0}function r(B,O,L){var N=B;do{var U=N.prev,Z=N.next.next;!S(U,Z)&&M(U,N,N.next,Z)&&u(U,Z)&&u(Z,U)&&(O.push(U.i/L|0),O.push(N.i/L|0),O.push(Z.i/L|0),P(N),P(N.next),N=B=Z),N=N.next}while(N!==B);return A(N)}function o(B,O,L,N,U,Z){var Q=B;do{for(var ue=Q.next.next;ue!==Q.prev;){if(Q.i!==ue.i&&y(Q,ue)){var oe=m(Q,ue);Q=A(Q,Q.next),oe=A(oe,oe.next),E(Q,O,L,N,U,Z,0),E(oe,O,L,N,U,Z,0);return}ue=ue.next}Q=Q.next}while(Q!==B)}function a(B,O,L,N){var U=[],Z,Q,ue,oe,le;for(Z=0,Q=O.length;Z=L.next.y&&L.next.y!==L.y){var ue=L.x+(U-L.y)*(L.next.x-L.x)/(L.next.y-L.y);if(ue<=N&&ue>Z&&(Z=ue,Q=L.x=L.x&&L.x>=le&&N!==L.x&&l(UQ.x||L.x===Q.x&&c(Q,L)))&&(Q=L,J=$)),L=L.next;while(L!==oe);return Q}function c(B,O){return b(B.prev,B,O.prev)<0&&b(O.next,B,B.next)<0}function f(B,O,L,N){var U=B;do U.z===0&&(U.z=h(U.x,U.y,O,L,N)),U.prevZ=U.prev,U.nextZ=U.next,U=U.next;while(U!==B);U.prevZ.nextZ=null,U.prevZ=null,v(U)}function v(B){var O,L,N,U,Z,Q,ue,oe,le=1;do{for(L=B,B=null,Z=null,Q=0;L;){for(Q++,N=L,ue=0,O=0;O0||oe>0&&N;)ue!==0&&(oe===0||!N||L.z<=N.z)?(U=L,L=L.nextZ,ue--):(U=N,N=N.nextZ,oe--),Z?Z.nextZ=U:B=U,U.prevZ=Z,Z=U;L=N}Z.nextZ=null,le*=2}while(Q>1);return B}function h(B,O,L,N,U){return B=(B-L)*U|0,O=(O-N)*U|0,B=(B|B<<8)&16711935,B=(B|B<<4)&252645135,B=(B|B<<2)&858993459,B=(B|B<<1)&1431655765,O=(O|O<<8)&16711935,O=(O|O<<4)&252645135,O=(O|O<<2)&858993459,O=(O|O<<1)&1431655765,B|O<<1}function T(B){var O=B,L=B;do(O.x=(B-Q)*(Z-ue)&&(B-Q)*(N-ue)>=(L-Q)*(O-ue)&&(L-Q)*(Z-ue)>=(U-Q)*(N-ue)}function y(B,O){return B.next.i!==O.i&&B.prev.i!==O.i&&!p(B,O)&&(u(B,O)&&u(O,B)&&g(B,O)&&(b(B.prev,B,O.prev)||b(B,O.prev,O))||S(B,O)&&b(B.prev,B,B.next)>0&&b(O.prev,O,O.next)>0)}function b(B,O,L){return(O.y-B.y)*(L.x-O.x)-(O.x-B.x)*(L.y-O.y)}function S(B,O){return B.x===O.x&&B.y===O.y}function M(B,O,L,N){var U=w(b(B,O,L)),Z=w(b(B,O,N)),Q=w(b(L,N,B)),ue=w(b(L,N,O));return!!(U!==Z&&Q!==ue||U===0&&_(B,L,O)||Z===0&&_(B,N,O)||Q===0&&_(L,B,N)||ue===0&&_(L,O,N))}function _(B,O,L){return O.x<=Math.max(B.x,L.x)&&O.x>=Math.min(B.x,L.x)&&O.y<=Math.max(B.y,L.y)&&O.y>=Math.min(B.y,L.y)}function w(B){return B>0?1:B<0?-1:0}function p(B,O){var L=B;do{if(L.i!==B.i&&L.next.i!==B.i&&L.i!==O.i&&L.next.i!==O.i&&M(L,L.next,B,O))return!0;L=L.next}while(L!==B);return!1}function u(B,O){return b(B.prev,B,B.next)<0?b(B,O,B.next)>=0&&b(B,B.prev,O)>=0:b(B,O,B.prev)<0||b(B,B.next,O)<0}function g(B,O){var L=B,N=!1,U=(B.x+O.x)/2,Z=(B.y+O.y)/2;do L.y>Z!=L.next.y>Z&&L.next.y!==L.y&&U<(L.next.x-L.x)*(Z-L.y)/(L.next.y-L.y)+L.x&&(N=!N),L=L.next;while(L!==B);return N}function m(B,O){var L=new z(B.i,B.x,B.y),N=new z(O.i,O.x,O.y),U=B.next,Z=O.prev;return B.next=O,O.prev=B,L.next=U,U.prev=L,N.next=L,L.prev=N,Z.next=N,N.prev=Z,N}function R(B,O,L,N){var U=new z(B,O,L);return N?(U.next=N.next,U.prev=N,N.next.prev=U,N.next=U):(U.prev=U,U.next=U),U}function P(B){B.next.prev=B.prev,B.prev.next=B.next,B.prevZ&&(B.prevZ.nextZ=B.nextZ),B.nextZ&&(B.nextZ.prevZ=B.prevZ)}function z(B,O,L){this.i=B,this.x=O,this.y=L,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}d.deviation=function(B,O,L,N){var U=O&&O.length,Z=U?O[0]*L:B.length,Q=Math.abs(F(B,0,Z,L));if(U)for(var ue=0,oe=O.length;ue0&&(N+=B[U-1].length,L.holes.push(N))}return L}}}),XP=He({"node_modules/array-normalize/index.js"(Y,G){var d=Xp();G.exports=x;function x(A,E,e){if(!A||A.length==null)throw Error("Argument should be an array");E==null&&(E=1),e==null&&(e=d(A,E));for(var t=0;t-1}}}),oT=He({"node_modules/es5-ext/string/#/contains/index.js"(Y,G){G.exports=s6()()?String.prototype.contains:l6()}}),vd=He({"node_modules/d/index.js"(Y,G){var d=Jp(),x=nT(),A=rx(),E=iT(),e=oT(),t=G.exports=function(r,o){var a,i,n,s,c;return arguments.length<2||typeof r!="string"?(s=o,o=r,r=null):s=arguments[2],d(r)?(a=e.call(r,"c"),i=e.call(r,"e"),n=e.call(r,"w")):(a=n=!0,i=!1),c={value:o,configurable:a,enumerable:i,writable:n},s?A(E(s),c):c};t.gs=function(r,o,a){var i,n,s,c;return typeof r!="string"?(s=a,a=o,o=r,r=null):s=arguments[3],d(o)?x(o)?d(a)?x(a)||(s=a,a=void 0):a=void 0:(s=o,o=a=void 0):o=void 0,d(r)?(i=e.call(r,"c"),n=e.call(r,"e")):(i=!0,n=!1),c={get:o,set:a,configurable:i,enumerable:n},s?A(E(s),c):c}}}),Hy=He({"node_modules/es5-ext/function/is-arguments.js"(Y,G){var d=Object.prototype.toString,x=d.call(function(){return arguments}());G.exports=function(A){return d.call(A)===x}}}),Gy=He({"node_modules/es5-ext/string/is-string.js"(Y,G){var d=Object.prototype.toString,x=d.call("");G.exports=function(A){return typeof A=="string"||A&&typeof A=="object"&&(A instanceof String||d.call(A)===x)||!1}}}),u6=He({"node_modules/ext/global-this/is-implemented.js"(Y,G){G.exports=function(){return typeof globalThis!="object"||!globalThis?!1:globalThis.Array===Array}}}),c6=He({"node_modules/ext/global-this/implementation.js"(Y,G){var d=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};G.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return d()}try{return __global__||d()}finally{delete Object.prototype.__global__}}()}}),Wy=He({"node_modules/ext/global-this/index.js"(Y,G){G.exports=u6()()?globalThis:c6()}}),f6=He({"node_modules/es6-symbol/is-implemented.js"(Y,G){var d=Wy(),x={object:!0,symbol:!0};G.exports=function(){var A=d.Symbol,E;if(typeof A!="function")return!1;E=A("test symbol");try{String(E)}catch{return!1}return!(!x[typeof A.iterator]||!x[typeof A.toPrimitive]||!x[typeof A.toStringTag])}}}),h6=He({"node_modules/es6-symbol/is-symbol.js"(Y,G){G.exports=function(d){return d?typeof d=="symbol"?!0:!d.constructor||d.constructor.name!=="Symbol"?!1:d[d.constructor.toStringTag]==="Symbol":!1}}}),sT=He({"node_modules/es6-symbol/validate-symbol.js"(Y,G){var d=h6();G.exports=function(x){if(!d(x))throw new TypeError(x+" is not a symbol");return x}}}),v6=He({"node_modules/es6-symbol/lib/private/generate-name.js"(Y,G){var d=vd(),x=Object.create,A=Object.defineProperty,E=Object.prototype,e=x(null);G.exports=function(t){for(var r=0,o,a;e[t+(r||"")];)++r;return t+=r||"",e[t]=!0,o="@@"+t,A(E,o,d.gs(null,function(i){a||(a=!0,A(this,o,d(i)),a=!1)})),o}}}),d6=He({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(Y,G){var d=vd(),x=Wy().Symbol;G.exports=function(A){return Object.defineProperties(A,{hasInstance:d("",x&&x.hasInstance||A("hasInstance")),isConcatSpreadable:d("",x&&x.isConcatSpreadable||A("isConcatSpreadable")),iterator:d("",x&&x.iterator||A("iterator")),match:d("",x&&x.match||A("match")),replace:d("",x&&x.replace||A("replace")),search:d("",x&&x.search||A("search")),species:d("",x&&x.species||A("species")),split:d("",x&&x.split||A("split")),toPrimitive:d("",x&&x.toPrimitive||A("toPrimitive")),toStringTag:d("",x&&x.toStringTag||A("toStringTag")),unscopables:d("",x&&x.unscopables||A("unscopables"))})}}}),p6=He({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(Y,G){var d=vd(),x=sT(),A=Object.create(null);G.exports=function(E){return Object.defineProperties(E,{for:d(function(e){return A[e]?A[e]:A[e]=E(String(e))}),keyFor:d(function(e){var t;x(e);for(t in A)if(A[t]===e)return t})})}}}),g6=He({"node_modules/es6-symbol/polyfill.js"(Y,G){var d=vd(),x=sT(),A=Wy().Symbol,E=v6(),e=d6(),t=p6(),r=Object.create,o=Object.defineProperties,a=Object.defineProperty,i,n,s;if(typeof A=="function")try{String(A()),s=!0}catch{}else A=null;n=function(f){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return i(f)},G.exports=i=function c(f){var v;if(this instanceof c)throw new TypeError("Symbol is not a constructor");return s?A(f):(v=r(n.prototype),f=f===void 0?"":String(f),o(v,{__description__:d("",f),__name__:d("",E(f))}))},e(i),t(i),o(n.prototype,{constructor:d(i),toString:d("",function(){return this.__name__})}),o(i.prototype,{toString:d(function(){return"Symbol ("+x(this).__description__+")"}),valueOf:d(function(){return x(this)})}),a(i.prototype,i.toPrimitive,d("",function(){var c=x(this);return typeof c=="symbol"?c:c.toString()})),a(i.prototype,i.toStringTag,d("c","Symbol")),a(n.prototype,i.toStringTag,d("c",i.prototype[i.toStringTag])),a(n.prototype,i.toPrimitive,d("c",i.prototype[i.toPrimitive]))}}),lp=He({"node_modules/es6-symbol/index.js"(Y,G){G.exports=f6()()?Wy().Symbol:g6()}}),y6=He({"node_modules/es5-ext/array/#/clear.js"(Y,G){var d=hd();G.exports=function(){return d(this).length=0,this}}}),fg=He({"node_modules/es5-ext/object/valid-callable.js"(Y,G){G.exports=function(d){if(typeof d!="function")throw new TypeError(d+" is not a function");return d}}}),m6=He({"node_modules/type/string/coerce.js"(Y,G){var d=Jp(),x=tx(),A=Object.prototype.toString;G.exports=function(E){if(!d(E))return null;if(x(E)){var e=E.toString;if(typeof e!="function"||e===A)return null}try{return""+E}catch{return null}}}}),_6=He({"node_modules/type/lib/safe-to-string.js"(Y,G){G.exports=function(d){try{return d.toString()}catch{try{return String(d)}catch{return null}}}}}),x6=He({"node_modules/type/lib/to-short-string.js"(Y,G){var d=_6(),x=/[\n\r\u2028\u2029]/g;G.exports=function(A){var E=d(A);return E===null?"":(E.length>100&&(E=E.slice(0,99)+"…"),E=E.replace(x,function(e){switch(e){case` +`:return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}}),E)}}}),lT=He({"node_modules/type/lib/resolve-exception.js"(Y,G){var d=Jp(),x=tx(),A=m6(),E=x6(),e=function(t,r){return t.replace("%v",E(r))};G.exports=function(t,r,o){if(!x(o))throw new TypeError(e(r,t));if(!d(t)){if("default"in o)return o.default;if(o.isOptional)return null}var a=A(o.errorMessage);throw d(a)||(a=r),new TypeError(e(a,t))}}}),b6=He({"node_modules/type/value/ensure.js"(Y,G){var d=lT(),x=Jp();G.exports=function(A){return x(A)?A:d(A,"Cannot use %v",arguments[1])}}}),w6=He({"node_modules/type/plain-function/ensure.js"(Y,G){var d=lT(),x=nT();G.exports=function(A){return x(A)?A:d(A,"%v is not a plain function",arguments[1])}}}),T6=He({"node_modules/es5-ext/array/from/is-implemented.js"(Y,G){G.exports=function(){var d=Array.from,x,A;return typeof d!="function"?!1:(x=["raz","dwa"],A=d(x),!!(A&&A!==x&&A[1]==="dwa"))}}}),A6=He({"node_modules/es5-ext/function/is-function.js"(Y,G){var d=Object.prototype.toString,x=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);G.exports=function(A){return typeof A=="function"&&x(d.call(A))}}}),S6=He({"node_modules/es5-ext/math/sign/is-implemented.js"(Y,G){G.exports=function(){var d=Math.sign;return typeof d!="function"?!1:d(10)===1&&d(-20)===-1}}}),M6=He({"node_modules/es5-ext/math/sign/shim.js"(Y,G){G.exports=function(d){return d=Number(d),isNaN(d)||d===0?d:d>0?1:-1}}}),E6=He({"node_modules/es5-ext/math/sign/index.js"(Y,G){G.exports=S6()()?Math.sign:M6()}}),k6=He({"node_modules/es5-ext/number/to-integer.js"(Y,G){var d=E6(),x=Math.abs,A=Math.floor;G.exports=function(E){return isNaN(E)?0:(E=Number(E),E===0||!isFinite(E)?E:d(E)*A(x(E)))}}}),C6=He({"node_modules/es5-ext/number/to-pos-integer.js"(Y,G){var d=k6(),x=Math.max;G.exports=function(A){return x(0,d(A))}}}),L6=He({"node_modules/es5-ext/array/from/shim.js"(Y,G){var d=lp().iterator,x=Hy(),A=A6(),E=C6(),e=fg(),t=hd(),r=sp(),o=Gy(),a=Array.isArray,i=Function.prototype.call,n={configurable:!0,enumerable:!0,writable:!0,value:null},s=Object.defineProperty;G.exports=function(c){var f=arguments[1],v=arguments[2],h,T,l,y,b,S,M,_,w,p;if(c=Object(t(c)),r(f)&&e(f),!this||this===Array||!A(this)){if(!f){if(x(c))return b=c.length,b!==1?Array.apply(null,c):(y=new Array(1),y[0]=c[0],y);if(a(c)){for(y=new Array(b=c.length),T=0;T=55296&&S<=56319&&(p+=c[++T])),p=f?i.call(f,v,p,l):p,h?(n.value=p,s(y,l,n)):y[l]=p,++l;b=l}}if(b===void 0)for(b=E(c.length),h&&(y=new h(b)),T=0;T=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__){o(this,"__redo__",e("c",[n]));return}this.__redo__.forEach(function(s,c){s>=n&&(this.__redo__[c]=++s)},this),this.__redo__.push(n)}}),_onDelete:e(function(n){var s;n>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(s=this.__redo__.indexOf(n),s!==-1&&this.__redo__.splice(s,1),this.__redo__.forEach(function(c,f){c>n&&(this.__redo__[f]=--c)},this)))}),_onClear:e(function(){this.__redo__&&d.call(this.__redo__),this.__nextIndex__=0})}))),o(i.prototype,r.iterator,e(function(){return this}))}}),O6=He({"node_modules/es6-iterator/array.js"(Y,G){var d=ex(),x=oT(),A=vd(),E=lp(),e=uT(),t=Object.defineProperty,r;r=G.exports=function(o,a){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e.call(this,o),a?x.call(a,"key+value")?a="key+value":x.call(a,"key")?a="key":a="value":a="value",t(this,"__kind__",A("",a))},d&&d(r,e),delete r.prototype.constructor,r.prototype=Object.create(e.prototype,{_resolve:A(function(o){return this.__kind__==="value"?this.__list__[o]:this.__kind__==="key+value"?[o,this.__list__[o]]:o})}),t(r.prototype,E.toStringTag,A("c","Array Iterator"))}}),B6=He({"node_modules/es6-iterator/string.js"(Y,G){var d=ex(),x=vd(),A=lp(),E=uT(),e=Object.defineProperty,t;t=G.exports=function(r){if(!(this instanceof t))throw new TypeError("Constructor requires 'new'");r=String(r),E.call(this,r),e(this,"__length__",x("",r.length))},d&&d(t,E),delete t.prototype.constructor,t.prototype=Object.create(E.prototype,{_next:x(function(){if(this.__list__){if(this.__nextIndex__=55296&&a<=56319?o+this.__list__[this.__nextIndex__++]:o)})}),e(t.prototype,A.toStringTag,x("c","String Iterator"))}}),N6=He({"node_modules/es6-iterator/is-iterable.js"(Y,G){var d=Hy(),x=sp(),A=Gy(),E=lp().iterator,e=Array.isArray;G.exports=function(t){return x(t)?e(t)||A(t)||d(t)?!0:typeof t[E]=="function":!1}}}),U6=He({"node_modules/es6-iterator/valid-iterable.js"(Y,G){var d=N6();G.exports=function(x){if(!d(x))throw new TypeError(x+" is not iterable");return x}}}),cT=He({"node_modules/es6-iterator/get.js"(Y,G){var d=Hy(),x=Gy(),A=O6(),E=B6(),e=U6(),t=lp().iterator;G.exports=function(r){return typeof e(r)[t]=="function"?r[t]():d(r)?new A(r):x(r)?new E(r):new A(r)}}}),j6=He({"node_modules/es6-iterator/for-of.js"(Y,G){var d=Hy(),x=fg(),A=Gy(),E=cT(),e=Array.isArray,t=Function.prototype.call,r=Array.prototype.some;G.exports=function(o,a){var i,n=arguments[2],s,c,f,v,h,T,l;if(e(o)||d(o)?i="array":A(o)?i="string":o=E(o),x(a),c=function(){f=!0},i==="array"){r.call(o,function(y){return t.call(a,n,y,c),f});return}if(i==="string"){for(h=o.length,v=0;v=55296&&l<=56319&&(T+=o[++v])),t.call(a,n,T,c),!f);++v);return}for(s=o.next();!s.done;){if(t.call(a,n,s.value,c),f)return;s=o.next()}}}}),V6=He({"node_modules/es6-weak-map/is-native-implemented.js"(Y,G){G.exports=function(){return typeof WeakMap!="function"?!1:Object.prototype.toString.call(new WeakMap)==="[object WeakMap]"}()}}),q6=He({"node_modules/es6-weak-map/polyfill.js"(Y,G){var d=sp(),x=ex(),A=$P(),E=hd(),e=QP(),t=vd(),r=cT(),o=j6(),a=lp().toStringTag,i=V6(),n=Array.isArray,s=Object.defineProperty,c=Object.prototype.hasOwnProperty,f=Object.getPrototypeOf,v;G.exports=v=function(){var h=arguments[0],T;if(!(this instanceof v))throw new TypeError("Constructor requires 'new'");return T=i&&x&&WeakMap!==v?x(new WeakMap,f(this)):this,d(h)&&(n(h)||(h=r(h))),s(T,"__weakMapData__",t("c","$weakMap$"+e())),h&&o(h,function(l){E(l),T.set(l[0],l[1])}),T},i&&(x&&x(v,WeakMap),v.prototype=Object.create(WeakMap.prototype,{constructor:t(v)})),Object.defineProperties(v.prototype,{delete:t(function(h){return c.call(A(h),this.__weakMapData__)?(delete h[this.__weakMapData__],!0):!1}),get:t(function(h){if(c.call(A(h),this.__weakMapData__))return h[this.__weakMapData__]}),has:t(function(h){return c.call(A(h),this.__weakMapData__)}),set:t(function(h,T){return s(A(h),this.__weakMapData__,t("c",T)),this}),toString:t(function(){return"[object WeakMap]"})}),s(v.prototype,a,t("c","WeakMap"))}}),fT=He({"node_modules/es6-weak-map/index.js"(Y,G){G.exports=YP()()?WeakMap:q6()}}),H6=He({"node_modules/array-find-index/index.js"(Y,G){G.exports=function(d,x,A){if(typeof Array.prototype.findIndex=="function")return d.findIndex(x,A);if(typeof x!="function")throw new TypeError("predicate must be a function");var E=Object(d),e=E.length;if(e===0)return-1;for(var t=0;t 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; + } + } +} +`,l=` +precision highp float; + +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; +} +`;G.exports=y;function y(b,S){if(!(this instanceof y))return new y(b,S);if(typeof b=="function"?(S||(S={}),S.regl=b):S=b,S.length&&(S.positions=S),b=S.regl,!b.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=b._gl,this.regl=b,this.passes=[],this.shaders=y.shaders.has(b)?y.shaders.get(b):y.shaders.set(b,y.createShaders(b)).get(b),this.update(S)}y.dashMult=2,y.maxPatternLength=256,y.precisionThreshold=3e6,y.maxPoints=1e4,y.maxLines=2048,y.shaders=new i,y.createShaders=function(b){let S=b.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),M={primitive:"triangle strip",instances:b.prop("count"),count:4,offset:0,uniforms:{miterMode:(u,g)=>g.join==="round"?2:1,miterLimit:b.prop("miterLimit"),scale:b.prop("scale"),scaleFract:b.prop("scaleFract"),translateFract:b.prop("translateFract"),translate:b.prop("translate"),thickness:b.prop("thickness"),dashTexture:b.prop("dashTexture"),opacity:b.prop("opacity"),pixelRatio:b.context("pixelRatio"),id:b.prop("id"),dashLength:b.prop("dashLength"),viewport:(u,g)=>[g.viewport.x,g.viewport.y,u.viewportWidth,u.viewportHeight],depth:b.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(u,g)=>!g.overlay},stencil:{enable:!1},scissor:{enable:!0,box:b.prop("viewport")},viewport:b.prop("viewport")},_=b(A({vert:c,frag:f,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:b.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:b.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:b.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},M)),w;try{w=b(A({cull:{enable:!0,face:"back"},vert:T,frag:l,attributes:{lineEnd:{buffer:S,divisor:0,stride:8,offset:0},lineTop:{buffer:S,divisor:0,stride:8,offset:4},aColor:{buffer:b.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:b.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:b.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},M))}catch{w=_}return{fill:b({primitive:"triangle",elements:(u,g)=>g.triangles,offset:0,vert:v,frag:h,uniforms:{scale:b.prop("scale"),color:b.prop("fill"),scaleFract:b.prop("scaleFract"),translateFract:b.prop("translateFract"),translate:b.prop("translate"),opacity:b.prop("opacity"),pixelRatio:b.context("pixelRatio"),id:b.prop("id"),viewport:(u,g)=>[g.viewport.x,g.viewport.y,u.viewportWidth,u.viewportHeight]},attributes:{position:{buffer:b.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:b.prop("positionFractBuffer"),stride:8,offset:8}},blend:M.blend,depth:{enable:!1},scissor:M.scissor,stencil:M.stencil,viewport:M.viewport}),rect:_,miter:w}},y.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},y.prototype.render=function(...b){b.length&&this.update(...b),this.draw()},y.prototype.draw=function(...b){return(b.length?b:this.passes).forEach((S,M)=>{if(S&&Array.isArray(S))return this.draw(...S);typeof S=="number"&&(S=this.passes[S]),S&&S.count>1&&S.opacity&&(this.regl._refresh(),S.fill&&S.triangles&&S.triangles.length>2&&this.shaders.fill(S),S.thickness&&(S.scale[0]*S.viewport.width>y.precisionThreshold||S.scale[1]*S.viewport.height>y.precisionThreshold?this.shaders.rect(S):S.join==="rect"||!S.join&&(S.thickness<=2||S.count>=y.maxPoints)?this.shaders.rect(S):this.shaders.miter(S)))}),this},y.prototype.update=function(b){if(!b)return;b.length!=null?typeof b[0]=="number"&&(b=[{positions:b}]):Array.isArray(b)||(b=[b]);let{regl:S,gl:M}=this;if(b.forEach((w,p)=>{let u=this.passes[p];if(w!==void 0){if(w===null){this.passes[p]=null;return}if(typeof w[0]=="number"&&(w={positions:w}),w=E(w,{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"}),u||(this.passes[p]=u={id:p,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:S.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:S.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:S.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:S.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},w=A({},y.defaults,w)),w.thickness!=null&&(u.thickness=parseFloat(w.thickness)),w.opacity!=null&&(u.opacity=parseFloat(w.opacity)),w.miterLimit!=null&&(u.miterLimit=parseFloat(w.miterLimit)),w.overlay!=null&&(u.overlay=!!w.overlay,poe-le),Z=[],Q=0,ue=u.hole!=null?u.hole[0]:null;if(ue!=null){let oe=s(U,le=>le>=ue);U=U.slice(0,oe),U.push(ue)}for(let oe=0;oe$-ue+(U[oe]-Q)),J=t(le,j);J=J.map($=>$+Q+($+Q{b.colorBuffer.destroy(),b.positionBuffer.destroy(),b.dashTexture.destroy()}),this.passes.length=0,this}}}),G6=He({"node_modules/regl-error2d/index.js"(Y,G){var d=Xp(),x=rp(),A=Q3(),E=Gv(),e=Yc(),t=Yp(),{float32:r,fract32:o}=Q_();G.exports=i;var a=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]];function i(n,s){if(typeof n=="function"?(s||(s={}),s.regl=n):s=n,s.length&&(s.positions=s),n=s.regl,!n.hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let c=n._gl,f,v,h,T,l,y,b={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},S=[];return T=n.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),v=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),h=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),l=n.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),y=n.buffer({usage:"static",type:"float",data:a}),p(s),f=n({vert:` + precision highp float; + + attribute vec2 position, positionFract; + attribute vec4 error; + attribute vec4 color; + + attribute vec2 direction, lineOffset, capOffset; + + uniform vec4 viewport; + uniform float lineWidth, capSize; + uniform vec2 scale, scaleFract, translate, translateFract; + + varying vec4 fragColor; + + void main() { + fragColor = color / 255.; + + vec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset; + + vec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw; + + vec2 position = position + dxy; + + vec2 pos = (position + translate) * scale + + (positionFract + translateFract) * scale + + (position + translate) * scaleFract + + (positionFract + translateFract) * scaleFract; + + pos += pixelOffset / viewport.zw; + + gl_Position = vec4(pos * 2. - 1., 0, 1); + } + `,frag:` + precision highp float; + + varying vec4 fragColor; + + uniform float opacity; + + void main() { + gl_FragColor = fragColor; + gl_FragColor.a *= opacity; + } + `,uniforms:{range:n.prop("range"),lineWidth:n.prop("lineWidth"),capSize:n.prop("capSize"),opacity:n.prop("opacity"),scale:n.prop("scale"),translate:n.prop("translate"),scaleFract:n.prop("scaleFract"),translateFract:n.prop("translateFract"),viewport:(g,m)=>[m.viewport.x,m.viewport.y,g.viewportWidth,g.viewportHeight]},attributes:{color:{buffer:T,offset:(g,m)=>m.offset*4,divisor:1},position:{buffer:v,offset:(g,m)=>m.offset*8,divisor:1},positionFract:{buffer:h,offset:(g,m)=>m.offset*8,divisor:1},error:{buffer:l,offset:(g,m)=>m.offset*16,divisor:1},direction:{buffer:y,stride:24,offset:0},lineOffset:{buffer:y,stride:24,offset:8},capOffset:{buffer:y,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:n.prop("viewport")},viewport:n.prop("viewport"),stencil:!1,instances:n.prop("count"),count:a.length}),e(M,{update:p,draw:_,destroy:u,regl:n,gl:c,canvas:c.canvas,groups:S}),M;function M(g){g?p(g):g===null&&u(),_()}function _(g){if(typeof g=="number")return w(g);g&&!Array.isArray(g)&&(g=[g]),n._refresh(),S.forEach((m,R)=>{if(m){if(g&&(g[R]?m.draw=!0:m.draw=!1),!m.draw){m.draw=!0;return}w(R)}})}function w(g){typeof g=="number"&&(g=S[g]),g!=null&&g&&g.count&&g.color&&g.opacity&&g.positions&&g.positions.length>1&&(g.scaleRatio=[g.scale[0]*g.viewport.width,g.scale[1]*g.viewport.height],f(g),g.after&&g.after(g))}function p(g){if(!g)return;g.length!=null?typeof g[0]=="number"&&(g=[{positions:g}]):Array.isArray(g)||(g=[g]);let m=0,R=0;if(M.groups=S=g.map((F,B)=>{let O=S[B];if(F)typeof F=="function"?F={after:F}:typeof F[0]=="number"&&(F={positions:F});else return O;return F=E(F,{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"}),O||(S[B]=O={id:B,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},F=e({},b,F)),A(O,F,[{lineWidth:L=>+L*.5,capSize:L=>+L*.5,opacity:parseFloat,errors:L=>(L=t(L),R+=L.length,L),positions:(L,N)=>(L=t(L,"float64"),N.count=Math.floor(L.length/2),N.bounds=d(L,2),N.offset=m,m+=N.count,L)},{color:(L,N)=>{let U=N.count;if(L||(L="transparent"),!Array.isArray(L)||typeof L[0]=="number"){let Q=L;L=Array(U);for(let ue=0;ue{let Z=N.bounds;return L||(L=Z),N.scale=[1/(L[2]-L[0]),1/(L[3]-L[1])],N.translate=[-L[0],-L[1]],N.scaleFract=o(N.scale),N.translateFract=o(N.translate),L},viewport:L=>{let N;return Array.isArray(L)?N={x:L[0],y:L[1],width:L[2]-L[0],height:L[3]-L[1]}:L?(N={x:L.x||L.left||0,y:L.y||L.top||0},L.right?N.width=L.right-N.x:N.width=L.w||L.width||0,L.bottom?N.height=L.bottom-N.y:N.height=L.h||L.height||0):N={x:0,y:0,width:c.drawingBufferWidth,height:c.drawingBufferHeight},N}}]),O}),m||R){let F=S.reduce((N,U,Z)=>N+(U?U.count:0),0),B=new Float64Array(F*2),O=new Uint8Array(F*4),L=new Float32Array(F*4);S.forEach((N,U)=>{if(!N)return;let{positions:Z,count:Q,offset:ue,color:oe,errors:le}=N;Q&&(O.set(oe,ue*4),L.set(le,ue*4),B.set(Z,ue*2))});var P=r(B);v(P);var z=o(B,P);h(z),T(O),l(L)}}function u(){v.destroy(),h.destroy(),T.destroy(),l.destroy(),y.destroy()}}}}),W6=He({"node_modules/unquote/index.js"(Y,G){var d=/[\'\"]/;G.exports=function(A){return A?(d.test(A.charAt(0))&&(A=A.substr(1)),d.test(A.charAt(A.length-1))&&(A=A.substr(0,A.length-1)),A):""}}}),vT=He({"node_modules/css-global-keywords/index.json"(){}}),dT=He({"node_modules/css-system-font-keywords/index.json"(){}}),pT=He({"node_modules/css-font-weight-keywords/index.json"(){}}),gT=He({"node_modules/css-font-style-keywords/index.json"(){}}),yT=He({"node_modules/css-font-stretch-keywords/index.json"(){}}),Z6=He({"node_modules/parenthesis/index.js"(Y,G){function d(E,e){if(typeof E!="string")return[E];var t=[E];typeof e=="string"||Array.isArray(e)?e={brackets:e}:e||(e={});var r=e.brackets?Array.isArray(e.brackets)?e.brackets:[e.brackets]:["{}","[]","()"],o=e.escape||"___",a=!!e.flat;r.forEach(function(s){var c=new RegExp(["\\",s[0],"[^\\",s[0],"\\",s[1],"]*\\",s[1]].join("")),f=[];function v(h,T,l){var y=t.push(h.slice(s[0].length,-s[1].length))-1;return f.push(y),o+y+o}t.forEach(function(h,T){for(var l,y=0;h!=l;)if(l=h,h=h.replace(c,v),y++>1e4)throw Error("References have circular dependency. Please, check them.");t[T]=h}),f=f.reverse(),t=t.map(function(h){return f.forEach(function(T){h=h.replace(new RegExp("(\\"+o+T+"\\"+o+")","g"),s[0]+"$1"+s[1])}),h})});var i=new RegExp("\\"+o+"([0-9]+)\\"+o);function n(s,c,f){for(var v=[],h,T=0;h=i.exec(s);){if(T++>1e4)throw Error("Circular references in parenthesis");v.push(s.slice(0,h.index)),v.push(n(c[h[1]],c)),s=s.slice(h.index+h[0].length)}return v.push(s),v}return a?t:n(t[0],t)}function x(E,e){if(e&&e.flat){var t=e&&e.escape||"___",r=E[0],o;if(!r)return"";for(var a=new RegExp("\\"+t+"([0-9]+)\\"+t),i=0;r!=o;){if(i++>1e4)throw Error("Circular references in "+E);o=r,r=r.replace(a,n)}return r}return E.reduce(function s(c,f){return Array.isArray(f)&&(f=f.reduce(s,"")),c+f},"");function n(s,c){if(E[c]==null)throw Error("Reference "+c+"is undefined");return E[c]}}function A(E,e){return Array.isArray(E)?x(E,e):d(E,e)}A.parse=d,A.stringify=x,G.exports=A}}),X6=He({"node_modules/string-split-by/index.js"(Y,G){var d=Z6();G.exports=function(A,E,e){if(A==null)throw Error("First argument should be a string");if(E==null)throw Error("Separator should be a string or a RegExp");e?(typeof e=="string"||Array.isArray(e))&&(e={ignore:e}):e={},e.escape==null&&(e.escape=!0),e.ignore==null?e.ignore=["[]","()","{}","<>",'""',"''","``","“”","«»"]:(typeof e.ignore=="string"&&(e.ignore=[e.ignore]),e.ignore=e.ignore.map(function(c){return c.length===1&&(c=c+c),c}));var t=d.parse(A,{flat:!0,brackets:e.ignore}),r=t[0],o=r.split(E);if(e.escape){for(var a=[],i=0;i1&&fa===xa&&(fa==='"'||fa==="'"))return['"'+r(cr.substr(1,cr.length-2))+'"'];var cn=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(cr);if(cn)return o(cr.substr(0,cn.index)).concat(o(cn[1])).concat(o(cr.substr(cn.index+cn[0].length)));var In=cr.split(".");if(In.length===1)return['"'+r(cr)+'"'];for(var Da=[],Na=0;Na"u"?1:window.devicePixelRatio,ti=!1,Wi={},Ti=function(qa){},si=function(){};if(typeof fa=="string"?xa=document.querySelector(fa):typeof fa=="object"&&(y(fa)?xa=fa:b(fa)?(Da=fa,In=Da.canvas):("gl"in fa?Da=fa.gl:"canvas"in fa?In=M(fa.canvas):"container"in fa&&(cn=M(fa.container)),"attributes"in fa&&(Na=fa.attributes),"extensions"in fa&&(Hn=S(fa.extensions)),"optionalExtensions"in fa&&(Un=S(fa.optionalExtensions)),"onDone"in fa&&(Ti=fa.onDone),"profile"in fa&&(ti=!!fa.profile),"pixelRatio"in fa&&(Gn=+fa.pixelRatio),"cachedCode"in fa&&(Wi=fa.cachedCode))),xa&&(xa.nodeName.toLowerCase()==="canvas"?In=xa:cn=xa),!Da){if(!In){var Fn=T(cn||document.body,Ti,Gn);if(!Fn)return null;In=Fn.canvas,si=Fn.onDestroy}Na.premultipliedAlpha===void 0&&(Na.premultipliedAlpha=!0),Da=l(In,Na)}return Da?{gl:Da,canvas:In,container:cn,extensions:Hn,optionalExtensions:Un,pixelRatio:Gn,profile:ti,cachedCode:Wi,onDone:Ti,onDestroy:si}:(si(),Ti("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function w(cr,fa){var xa={};function cn(Na){var Hn=Na.toLowerCase(),Un;try{Un=xa[Hn]=cr.getExtension(Hn)}catch{}return!!Un}for(var In=0;In65535)<<4,cr>>>=fa,xa=(cr>255)<<3,cr>>>=xa,fa|=xa,xa=(cr>15)<<2,cr>>>=xa,fa|=xa,xa=(cr>3)<<1,cr>>>=xa,fa|=xa,fa|cr>>1}function L(){var cr=p(8,function(){return[]});function fa(Da){var Na=B(Da),Hn=cr[O(Na)>>2];return Hn.length>0?Hn.pop():new ArrayBuffer(Na)}function xa(Da){cr[O(Da.byteLength)>>2].push(Da)}function cn(Da,Na){var Hn=null;switch(Da){case u:Hn=new Int8Array(fa(Na),0,Na);break;case g:Hn=new Uint8Array(fa(Na),0,Na);break;case m:Hn=new Int16Array(fa(2*Na),0,Na);break;case R:Hn=new Uint16Array(fa(2*Na),0,Na);break;case P:Hn=new Int32Array(fa(4*Na),0,Na);break;case z:Hn=new Uint32Array(fa(4*Na),0,Na);break;case F:Hn=new Float32Array(fa(4*Na),0,Na);break;default:return null}return Hn.length!==Na?Hn.subarray(0,Na):Hn}function In(Da){xa(Da.buffer)}return{alloc:fa,free:xa,allocType:cn,freeType:In}}var N=L();N.zero=L();var U=3408,Z=3410,Q=3411,ue=3412,oe=3413,le=3414,j=3415,J=33901,$=33902,X=3379,re=3386,ee=34921,q=36347,ae=36348,ie=35661,fe=35660,we=34930,Ae=36349,Fe=34076,Ce=34024,qe=7936,et=7937,Qe=7938,Ke=35724,Xe=34047,Me=36063,xe=34852,ce=3553,Re=34067,$e=34069,rt=33984,Je=6408,At=5126,St=5121,Rt=36160,Ut=36053,ir=36064,ar=16384,Mr=function(cr,fa){var xa=1;fa.ext_texture_filter_anisotropic&&(xa=cr.getParameter(Xe));var cn=1,In=1;fa.webgl_draw_buffers&&(cn=cr.getParameter(xe),In=cr.getParameter(Me));var Da=!!fa.oes_texture_float;if(Da){var Na=cr.createTexture();cr.bindTexture(ce,Na),cr.texImage2D(ce,0,Je,1,1,0,Je,At,null);var Hn=cr.createFramebuffer();if(cr.bindFramebuffer(Rt,Hn),cr.framebufferTexture2D(Rt,ir,ce,Na,0),cr.bindTexture(ce,null),cr.checkFramebufferStatus(Rt)!==Ut)Da=!1;else{cr.viewport(0,0,1,1),cr.clearColor(1,0,0,1),cr.clear(ar);var Un=N.allocType(At,4);cr.readPixels(0,0,1,1,Je,At,Un),cr.getError()?Da=!1:(cr.deleteFramebuffer(Hn),cr.deleteTexture(Na),Da=Un[0]===1),N.freeType(Un)}}var Gn=typeof navigator<"u"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),ti=!0;if(!Gn){var Wi=cr.createTexture(),Ti=N.allocType(St,36);cr.activeTexture(rt),cr.bindTexture(Re,Wi),cr.texImage2D($e,0,Je,3,3,0,Je,St,Ti),N.freeType(Ti),cr.bindTexture(Re,null),cr.deleteTexture(Wi),ti=!cr.getError()}return{colorBits:[cr.getParameter(Z),cr.getParameter(Q),cr.getParameter(ue),cr.getParameter(oe)],depthBits:cr.getParameter(le),stencilBits:cr.getParameter(j),subpixelBits:cr.getParameter(U),extensions:Object.keys(fa).filter(function(si){return!!fa[si]}),maxAnisotropic:xa,maxDrawbuffers:cn,maxColorAttachments:In,pointSizeDims:cr.getParameter(J),lineWidthDims:cr.getParameter($),maxViewportDims:cr.getParameter(re),maxCombinedTextureUnits:cr.getParameter(ie),maxCubeMapSize:cr.getParameter(Fe),maxRenderbufferSize:cr.getParameter(Ce),maxTextureUnits:cr.getParameter(we),maxTextureSize:cr.getParameter(X),maxAttributes:cr.getParameter(ee),maxVertexUniforms:cr.getParameter(q),maxVertexTextureUnits:cr.getParameter(fe),maxVaryingVectors:cr.getParameter(ae),maxFragmentUniforms:cr.getParameter(Ae),glsl:cr.getParameter(Ke),renderer:cr.getParameter(et),vendor:cr.getParameter(qe),version:cr.getParameter(Qe),readFloat:Da,npotTextureCube:ti}},fr=function(cr){return cr instanceof Uint8Array||cr instanceof Uint16Array||cr instanceof Uint32Array||cr instanceof Int8Array||cr instanceof Int16Array||cr instanceof Int32Array||cr instanceof Float32Array||cr instanceof Float64Array||cr instanceof Uint8ClampedArray};function dr(cr){return!!cr&&typeof cr=="object"&&Array.isArray(cr.shape)&&Array.isArray(cr.stride)&&typeof cr.offset=="number"&&cr.shape.length===cr.stride.length&&(Array.isArray(cr.data)||fr(cr.data))}var pt=function(cr){return Object.keys(cr).map(function(fa){return cr[fa]})},ze={shape:Pe,flatten:be};function Ge(cr,fa,xa){for(var cn=0;cn0){var $i;if(Array.isArray(wn[0])){Xn=va(wn);for(var Cn=1,Mn=1;Mn0){if(typeof Cn[0]=="number"){var gi=N.allocType(Pn.dtype,Cn.length);gr(gi,Cn),Xn(gi,Si),N.freeType(gi)}else if(Array.isArray(Cn[0])||fr(Cn[0])){yn=va(Cn);var ri=Ia(Cn,yn,Pn.dtype);Xn(ri,Si),N.freeType(ri)}}}else if(dr(Cn)){yn=Cn.shape;var ro=Cn.stride,es=0,Fi=0,no=0,oi=0;yn.length===1?(es=yn[0],Fi=1,no=ro[0],oi=0):yn.length===2&&(es=yn[0],Fi=yn[1],no=ro[0],oi=ro[1]);var Xo=Array.isArray(Cn.data)?Pn.dtype:Ot(Cn.data),ys=N.allocType(Xo,es*Fi);Br(ys,Cn.data,es,Fi,no,oi,Cn.offset),Xn(ys,Si),N.freeType(ys)}return Ri}return Tn||Ri(qa),Ri._reglType="buffer",Ri._buffer=Pn,Ri.subdata=$i,xa.profile&&(Ri.stats=Pn.stats),Ri.destroy=function(){Ti(Pn)},Ri}function Fn(){pt(Da).forEach(function(qa){qa.buffer=cr.createBuffer(),cr.bindBuffer(qa.type,qa.buffer),cr.bufferData(qa.type,qa.persistentData||qa.byteLength,qa.usage)})}return xa.profile&&(fa.getTotalBufferSize=function(){var qa=0;return Object.keys(Da).forEach(function(wn){qa+=Da[wn].stats.size}),qa}),{create:si,createStream:Un,destroyStream:Gn,clear:function(){pt(Da).forEach(Ti),Hn.forEach(Ti)},getBuffer:function(qa){return qa&&qa._buffer instanceof Na?qa._buffer:null},restore:Fn,_initBuffer:Wi}}var Ur=0,ga=0,Aa=1,Pa=1,sa=4,Oa=4,dt={points:Ur,point:ga,lines:Aa,line:Pa,triangles:sa,triangle:Oa,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},vt=0,Lr=1,Er=4,_r=5120,yr=5121,kr=5122,zr=5123,Pr=5124,Hr=5125,Zr=34963,Jr=35040,wt=35044;function Qt(cr,fa,xa,cn){var In={},Da=0,Na={uint8:yr,uint16:zr};fa.oes_element_index_uint&&(Na.uint32=Hr);function Hn(Fn){this.id=Da++,In[this.id]=this,this.buffer=Fn,this.primType=Er,this.vertCount=0,this.type=0}Hn.prototype.bind=function(){this.buffer.bind()};var Un=[];function Gn(Fn){var qa=Un.pop();return qa||(qa=new Hn(xa.create(null,Zr,!0,!1)._buffer)),Wi(qa,Fn,Jr,-1,-1,0,0),qa}function ti(Fn){Un.push(Fn)}function Wi(Fn,qa,wn,Tn,Ln,Pn,Ri){Fn.buffer.bind();var Xn;if(qa){var $i=Ri;!Ri&&(!fr(qa)||dr(qa)&&!fr(qa.data))&&($i=fa.oes_element_index_uint?Hr:zr),xa._initBuffer(Fn.buffer,qa,wn,$i,3)}else cr.bufferData(Zr,Pn,wn),Fn.buffer.dtype=Xn||yr,Fn.buffer.usage=wn,Fn.buffer.dimension=3,Fn.buffer.byteLength=Pn;if(Xn=Ri,!Ri){switch(Fn.buffer.dtype){case yr:case _r:Xn=yr;break;case zr:case kr:Xn=zr;break;case Hr:case Pr:Xn=Hr;break}Fn.buffer.dtype=Xn}Fn.type=Xn;var Cn=Ln;Cn<0&&(Cn=Fn.buffer.byteLength,Xn===zr?Cn>>=1:Xn===Hr&&(Cn>>=2)),Fn.vertCount=Cn;var Mn=Tn;if(Tn<0){Mn=Er;var Si=Fn.buffer.dimension;Si===1&&(Mn=vt),Si===2&&(Mn=Lr),Si===3&&(Mn=Er)}Fn.primType=Mn}function Ti(Fn){cn.elementsCount--,delete In[Fn.id],Fn.buffer.destroy(),Fn.buffer=null}function si(Fn,qa){var wn=xa.create(null,Zr,!0),Tn=new Hn(wn._buffer);cn.elementsCount++;function Ln(Pn){if(!Pn)wn(),Tn.primType=Er,Tn.vertCount=0,Tn.type=yr;else if(typeof Pn=="number")wn(Pn),Tn.primType=Er,Tn.vertCount=Pn|0,Tn.type=yr;else{var Ri=null,Xn=wt,$i=-1,Cn=-1,Mn=0,Si=0;Array.isArray(Pn)||fr(Pn)||dr(Pn)?Ri=Pn:("data"in Pn&&(Ri=Pn.data),"usage"in Pn&&(Xn=ma[Pn.usage]),"primitive"in Pn&&($i=dt[Pn.primitive]),"count"in Pn&&(Cn=Pn.count|0),"type"in Pn&&(Si=Na[Pn.type]),"length"in Pn?Mn=Pn.length|0:(Mn=Cn,Si===zr||Si===kr?Mn*=2:(Si===Hr||Si===Pr)&&(Mn*=4))),Wi(Tn,Ri,Xn,$i,Cn,Mn,Si)}return Ln}return Ln(Fn),Ln._reglType="elements",Ln._elements=Tn,Ln.subdata=function(Pn,Ri){return wn.subdata(Pn,Ri),Ln},Ln.destroy=function(){Ti(Tn)},Ln}return{create:si,createStream:Gn,destroyStream:ti,getElements:function(Fn){return typeof Fn=="function"&&Fn._elements instanceof Hn?Fn._elements:null},clear:function(){pt(In).forEach(Ti)}}}var mr=new Float32Array(1),$r=new Uint32Array(mr.buffer),oa=5123;function Sa(cr){for(var fa=N.allocType(oa,cr.length),xa=0;xa>>31<<15,Da=(cn<<1>>>24)-127,Na=cn>>13&1023;if(Da<-24)fa[xa]=In;else if(Da<-14){var Hn=-14-Da;fa[xa]=In+(Na+1024>>Hn)}else Da>15?fa[xa]=In+31744:fa[xa]=In+(Da+15<<10)+Na}return fa}function ya(cr){return Array.isArray(cr)||fr(cr)}var ra=34467,pa=3553,pn=34067,Ga=34069,qn=6408,Vn=6406,di=6407,yi=6409,Ci=6410,ci=32854,ei=32855,mi=36194,uo=32819,Lo=32820,Wo=33635,li=34042,Ii=6402,xi=34041,Ao=35904,So=35906,Ro=36193,Li=33776,Yi=33777,bs=33778,as=33779,fs=35986,Co=35987,Qa=34798,Jn=35840,Os=35841,ds=35842,Ui=35843,ms=36196,Mo=5121,ws=5123,Ks=5125,Rn=5126,fo=10242,Pi=10243,zo=10497,wo=33071,bi=33648,wl=10240,$l=10241,Js=9728,Ql=9729,Ws=9984,Is=9985,Dl=9986,Xu=9987,Lu=33170,Bu=4352,kf=4353,gf=4354,ns=34046,_u=3317,Nc=37440,ml=37441,fl=37443,_l=37444,Yu=33984,Ts=[Ws,Dl,Is,Xu],Tl=[0,yi,Ci,di,qn],Ko={};Ko[yi]=Ko[Vn]=Ko[Ii]=1,Ko[xi]=Ko[Ci]=2,Ko[di]=Ko[Ao]=3,Ko[qn]=Ko[So]=4;function Cs(cr){return"[object "+cr+"]"}var Nu=Cs("HTMLCanvasElement"),Ul=Cs("OffscreenCanvas"),Ku=Cs("CanvasRenderingContext2D"),Bs=Cs("ImageBitmap"),Gf=Cs("HTMLImageElement"),Eo=Cs("HTMLVideoElement"),Wf=Object.keys(We).concat([Nu,Ul,Ku,Bs,Gf,Eo]),is=[];is[Mo]=1,is[Rn]=4,is[Ro]=2,is[ws]=2,is[Ks]=4;var oo=[];oo[ci]=2,oo[ei]=2,oo[mi]=2,oo[xi]=4,oo[Li]=.5,oo[Yi]=.5,oo[bs]=1,oo[as]=1,oo[fs]=.5,oo[Co]=1,oo[Qa]=1,oo[Jn]=.5,oo[Os]=.25,oo[ds]=.5,oo[Ui]=.25,oo[ms]=.5;function pc(cr){return Array.isArray(cr)&&(cr.length===0||typeof cr[0]=="number")}function xu(cr){if(!Array.isArray(cr))return!1;var fa=cr.length;return!(fa===0||!ya(cr[0]))}function zl(cr){return Object.prototype.toString.call(cr)}function Kc(cr){return zl(cr)===Nu}function Ju(cr){return zl(cr)===Ul}function gc(cr){return zl(cr)===Ku}function hl(cr){return zl(cr)===Bs}function yf(cr){return zl(cr)===Gf}function Jc(cr){return zl(cr)===Eo}function Uc(cr){if(!cr)return!1;var fa=zl(cr);return Wf.indexOf(fa)>=0?!0:pc(cr)||xu(cr)||dr(cr)}function $u(cr){return We[Object.prototype.toString.call(cr)]|0}function jc(cr,fa){var xa=fa.length;switch(cr.type){case Mo:case ws:case Ks:case Rn:var cn=N.allocType(cr.type,xa);cn.set(fa),cr.data=cn;break;case Ro:cr.data=Sa(fa);break}}function $c(cr,fa){return N.allocType(cr.type===Ro?Rn:cr.type,fa)}function bu(cr,fa){cr.type===Ro?(cr.data=Sa(fa),N.freeType(fa)):cr.data=fa}function Qc(cr,fa,xa,cn,In,Da){for(var Na=cr.width,Hn=cr.height,Un=cr.channels,Gn=Na*Hn*Un,ti=$c(cr,Gn),Wi=0,Ti=0;Ti=1;)Hn+=Na*Un*Un,Un/=2;return Hn}else return Na*xa*cn}function wu(cr,fa,xa,cn,In,Da,Na){var Hn={"don't care":Bu,"dont care":Bu,nice:gf,fast:kf},Un={repeat:zo,clamp:wo,mirror:bi},Gn={nearest:Js,linear:Ql},ti=d({mipmap:Xu,"nearest mipmap nearest":Ws,"linear mipmap nearest":Is,"nearest mipmap linear":Dl,"linear mipmap linear":Xu},Gn),Wi={none:0,browser:_l},Ti={uint8:Mo,rgba4:uo,rgb565:Wo,"rgb5 a1":Lo},si={alpha:Vn,luminance:yi,"luminance alpha":Ci,rgb:di,rgba:qn,rgba4:ci,"rgb5 a1":ei,rgb565:mi},Fn={};fa.ext_srgb&&(si.srgb=Ao,si.srgba=So),fa.oes_texture_float&&(Ti.float32=Ti.float=Rn),fa.oes_texture_half_float&&(Ti.float16=Ti["half float"]=Ro),fa.webgl_depth_texture&&(d(si,{depth:Ii,"depth stencil":xi}),d(Ti,{uint16:ws,uint32:Ks,"depth stencil":li})),fa.webgl_compressed_texture_s3tc&&d(Fn,{"rgb s3tc dxt1":Li,"rgba s3tc dxt1":Yi,"rgba s3tc dxt3":bs,"rgba s3tc dxt5":as}),fa.webgl_compressed_texture_atc&&d(Fn,{"rgb atc":fs,"rgba atc explicit alpha":Co,"rgba atc interpolated alpha":Qa}),fa.webgl_compressed_texture_pvrtc&&d(Fn,{"rgb pvrtc 4bppv1":Jn,"rgb pvrtc 2bppv1":Os,"rgba pvrtc 4bppv1":ds,"rgba pvrtc 2bppv1":Ui}),fa.webgl_compressed_texture_etc1&&(Fn["rgb etc1"]=ms);var qa=Array.prototype.slice.call(cr.getParameter(ra));Object.keys(Fn).forEach(function(W){var de=Fn[W];qa.indexOf(de)>=0&&(si[W]=de)});var wn=Object.keys(si);xa.textureFormats=wn;var Tn=[];Object.keys(si).forEach(function(W){var de=si[W];Tn[de]=W});var Ln=[];Object.keys(Ti).forEach(function(W){var de=Ti[W];Ln[de]=W});var Pn=[];Object.keys(Gn).forEach(function(W){var de=Gn[W];Pn[de]=W});var Ri=[];Object.keys(ti).forEach(function(W){var de=ti[W];Ri[de]=W});var Xn=[];Object.keys(Un).forEach(function(W){var de=Un[W];Xn[de]=W});var $i=wn.reduce(function(W,de){var te=si[de];return te===yi||te===Vn||te===yi||te===Ci||te===Ii||te===xi||fa.ext_srgb&&(te===Ao||te===So)?W[te]=te:te===ei||de.indexOf("rgba")>=0?W[te]=qn:W[te]=di,W},{});function Cn(){this.internalformat=qn,this.format=qn,this.type=Mo,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=_l,this.width=0,this.height=0,this.channels=0}function Mn(W,de){W.internalformat=de.internalformat,W.format=de.format,W.type=de.type,W.compressed=de.compressed,W.premultiplyAlpha=de.premultiplyAlpha,W.flipY=de.flipY,W.unpackAlignment=de.unpackAlignment,W.colorSpace=de.colorSpace,W.width=de.width,W.height=de.height,W.channels=de.channels}function Si(W,de){if(!(typeof de!="object"||!de)){if("premultiplyAlpha"in de&&(W.premultiplyAlpha=de.premultiplyAlpha),"flipY"in de&&(W.flipY=de.flipY),"alignment"in de&&(W.unpackAlignment=de.alignment),"colorSpace"in de&&(W.colorSpace=Wi[de.colorSpace]),"type"in de){var te=de.type;W.type=Ti[te]}var me=W.width,Ue=W.height,tt=W.channels,ft=!1;"shape"in de?(me=de.shape[0],Ue=de.shape[1],de.shape.length===3&&(tt=de.shape[2],ft=!0)):("radius"in de&&(me=Ue=de.radius),"width"in de&&(me=de.width),"height"in de&&(Ue=de.height),"channels"in de&&(tt=de.channels,ft=!0)),W.width=me|0,W.height=Ue|0,W.channels=tt|0;var st=!1;if("format"in de){var bt=de.format,It=W.internalformat=si[bt];W.format=$i[It],bt in Ti&&("type"in de||(W.type=Ti[bt])),bt in Fn&&(W.compressed=!0),st=!0}!ft&&st?W.channels=Ko[W.format]:ft&&!st&&W.channels!==Tl[W.format]&&(W.format=W.internalformat=Tl[W.channels])}}function yn(W){cr.pixelStorei(Nc,W.flipY),cr.pixelStorei(ml,W.premultiplyAlpha),cr.pixelStorei(fl,W.colorSpace),cr.pixelStorei(_u,W.unpackAlignment)}function gi(){Cn.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function ri(W,de){var te=null;if(Uc(de)?te=de:de&&(Si(W,de),"x"in de&&(W.xOffset=de.x|0),"y"in de&&(W.yOffset=de.y|0),Uc(de.data)&&(te=de.data)),de.copy){var me=In.viewportWidth,Ue=In.viewportHeight;W.width=W.width||me-W.xOffset,W.height=W.height||Ue-W.yOffset,W.needsCopy=!0}else if(!te)W.width=W.width||1,W.height=W.height||1,W.channels=W.channels||4;else if(fr(te))W.channels=W.channels||4,W.data=te,!("type"in de)&&W.type===Mo&&(W.type=$u(te));else if(pc(te))W.channels=W.channels||4,jc(W,te),W.alignment=1,W.needsFree=!0;else if(dr(te)){var tt=te.data;!Array.isArray(tt)&&W.type===Mo&&(W.type=$u(tt));var ft=te.shape,st=te.stride,bt,It,Jt,Kt,vr,Tr;ft.length===3?(Jt=ft[2],Tr=st[2]):(Jt=1,Tr=1),bt=ft[0],It=ft[1],Kt=st[0],vr=st[1],W.alignment=1,W.width=bt,W.height=It,W.channels=Jt,W.format=W.internalformat=Tl[Jt],W.needsFree=!0,Qc(W,tt,Kt,vr,Tr,te.offset)}else if(Kc(te)||Ju(te)||gc(te))Kc(te)||Ju(te)?W.element=te:W.element=te.canvas,W.width=W.element.width,W.height=W.element.height,W.channels=4;else if(hl(te))W.element=te,W.width=te.width,W.height=te.height,W.channels=4;else if(yf(te))W.element=te,W.width=te.naturalWidth,W.height=te.naturalHeight,W.channels=4;else if(Jc(te))W.element=te,W.width=te.videoWidth,W.height=te.videoHeight,W.channels=4;else if(xu(te)){var wr=W.width||te[0].length,tr=W.height||te.length,pr=W.channels;ya(te[0][0])?pr=pr||te[0][0].length:pr=pr||1;for(var xr=ze.shape(te),ea=1,ha=0;ha>=Ue,te.height>>=Ue,ri(te,me[Ue]),W.mipmask|=1<=0&&!("faces"in de)&&(W.genMipmaps=!0)}if("mag"in de){var me=de.mag;W.magFilter=Gn[me]}var Ue=W.wrapS,tt=W.wrapT;if("wrap"in de){var ft=de.wrap;typeof ft=="string"?Ue=tt=Un[ft]:Array.isArray(ft)&&(Ue=Un[ft[0]],tt=Un[ft[1]])}else{if("wrapS"in de){var st=de.wrapS;Ue=Un[st]}if("wrapT"in de){var bt=de.wrapT;tt=Un[bt]}}if(W.wrapS=Ue,W.wrapT=tt,"anisotropic"in de&&(de.anisotropic,W.anisotropic=de.anisotropic),"mipmap"in de){var It=!1;switch(typeof de.mipmap){case"string":W.mipmapHint=Hn[de.mipmap],W.genMipmaps=!0,It=!0;break;case"boolean":It=W.genMipmaps=de.mipmap;break;case"object":W.genMipmaps=!1,It=!0;break}It&&!("min"in de)&&(W.minFilter=Ws)}}function Lc(W,de){cr.texParameteri(de,$l,W.minFilter),cr.texParameteri(de,wl,W.magFilter),cr.texParameteri(de,fo,W.wrapS),cr.texParameteri(de,Pi,W.wrapT),fa.ext_texture_filter_anisotropic&&cr.texParameteri(de,ns,W.anisotropic),W.genMipmaps&&(cr.hint(Lu,W.mipmapHint),cr.generateMipmap(de))}var Pf=0,su={},zu=xa.maxTextureUnits,Fo=Array(zu).map(function(){return null});function nc(W){Cn.call(this),this.mipmask=0,this.internalformat=qn,this.id=Pf++,this.refCount=1,this.target=W,this.texture=cr.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Eu,Na.profile&&(this.stats={size:0})}function ll(W){cr.activeTexture(Yu),cr.bindTexture(W.target,W.texture)}function Sl(){var W=Fo[0];W?cr.bindTexture(W.target,W.texture):cr.bindTexture(pa,null)}function qc(W){var de=W.texture,te=W.unit,me=W.target;te>=0&&(cr.activeTexture(Yu+te),cr.bindTexture(me,null),Fo[te]=null),cr.deleteTexture(de),W.texture=null,W.params=null,W.pixels=null,W.refCount=0,delete su[W.id],Da.textureCount--}d(nc.prototype,{bind:function(){var W=this;W.bindCount+=1;var de=W.unit;if(de<0){for(var te=0;te0)continue;me.unit=-1}Fo[te]=W,de=te;break}Na.profile&&Da.maxTextureUnits>vr)-Jt,Tr.height=Tr.height||(te.height>>vr)-Kt,ll(te),es(Tr,pa,Jt,Kt,vr),Sl(),oi(Tr),me}function tt(ft,st){var bt=ft|0,It=st|0||bt;if(bt===te.width&&It===te.height)return me;me.width=te.width=bt,me.height=te.height=It,ll(te);for(var Jt=0;te.mipmask>>Jt;++Jt){var Kt=bt>>Jt,vr=It>>Jt;if(!Kt||!vr)break;cr.texImage2D(pa,Jt,te.format,Kt,vr,0,te.format,te.type,null)}return Sl(),Na.profile&&(te.stats.size=sc(te.internalformat,te.type,bt,It,!1,!1)),me}return me(W,de),me.subimage=Ue,me.resize=tt,me._reglType="texture2d",me._texture=te,Na.profile&&(me.stats=te.stats),me.destroy=function(){te.decRef()},me}function ss(W,de,te,me,Ue,tt){var ft=new nc(pn);su[ft.id]=ft,Da.cubeCount++;var st=new Array(6);function bt(Kt,vr,Tr,wr,tr,pr){var xr,ea=ft.texInfo;for(Eu.call(ea),xr=0;xr<6;++xr)st[xr]=Mu();if(typeof Kt=="number"||!Kt){var ha=Kt|0||1;for(xr=0;xr<6;++xr)ys(st[xr],ha,ha)}else if(typeof Kt=="object")if(vr)xs(st[0],Kt),xs(st[1],vr),xs(st[2],Tr),xs(st[3],wr),xs(st[4],tr),xs(st[5],pr);else if(ac(ea,Kt),Si(ft,Kt),"faces"in Kt){var Ea=Kt.faces;for(xr=0;xr<6;++xr)Mn(st[xr],ft),xs(st[xr],Ea[xr])}else for(xr=0;xr<6;++xr)xs(st[xr],Kt);for(Mn(ft,st[0]),ea.genMipmaps?ft.mipmask=(st[0].width<<1)-1:ft.mipmask=st[0].mipmask,ft.internalformat=st[0].internalformat,bt.width=st[0].width,bt.height=st[0].height,ll(ft),xr=0;xr<6;++xr)Xs(st[xr],Ga+xr);for(Lc(ea,pn),Sl(),Na.profile&&(ft.stats.size=sc(ft.internalformat,ft.type,bt.width,bt.height,ea.genMipmaps,!0)),bt.format=Tn[ft.internalformat],bt.type=Ln[ft.type],bt.mag=Pn[ea.magFilter],bt.min=Ri[ea.minFilter],bt.wrapS=Xn[ea.wrapS],bt.wrapT=Xn[ea.wrapT],xr=0;xr<6;++xr)dl(st[xr]);return bt}function It(Kt,vr,Tr,wr,tr){var pr=Tr|0,xr=wr|0,ea=tr|0,ha=no();return Mn(ha,ft),ha.width=0,ha.height=0,ri(ha,vr),ha.width=ha.width||(ft.width>>ea)-pr,ha.height=ha.height||(ft.height>>ea)-xr,ll(ft),es(ha,Ga+Kt,pr,xr,ea),Sl(),oi(ha),bt}function Jt(Kt){var vr=Kt|0;if(vr!==ft.width){bt.width=ft.width=vr,bt.height=ft.height=vr,ll(ft);for(var Tr=0;Tr<6;++Tr)for(var wr=0;ft.mipmask>>wr;++wr)cr.texImage2D(Ga+Tr,wr,ft.format,vr>>wr,vr>>wr,0,ft.format,ft.type,null);return Sl(),Na.profile&&(ft.stats.size=sc(ft.internalformat,ft.type,bt.width,bt.height,!1,!0)),bt}}return bt(W,de,te,me,Ue,tt),bt.subimage=It,bt.resize=Jt,bt._reglType="textureCube",bt._texture=ft,Na.profile&&(bt.stats=ft.stats),bt.destroy=function(){ft.decRef()},bt}function js(){for(var W=0;W>me,te.height>>me,0,te.internalformat,te.type,null);else for(var Ue=0;Ue<6;++Ue)cr.texImage2D(Ga+Ue,me,te.internalformat,te.width>>me,te.height>>me,0,te.internalformat,te.type,null);Lc(te.texInfo,te.target)})}function ye(){for(var W=0;W=0?Mu=!0:Un.indexOf(dl)>=0&&(Mu=!1))),("depthTexture"in Fo||"depthStencilTexture"in Fo)&&(zu=!!(Fo.depthTexture||Fo.depthStencilTexture)),"depth"in Fo&&(typeof Fo.depth=="boolean"?xs=Fo.depth:(Lc=Fo.depth,Xs=!1)),"stencil"in Fo&&(typeof Fo.stencil=="boolean"?Xs=Fo.stencil:(Pf=Fo.stencil,xs=!1)),"depthStencil"in Fo&&(typeof Fo.depthStencil=="boolean"?xs=Xs=Fo.depthStencil:(su=Fo.depthStencil,xs=!1,Xs=!1))}var ll=null,Sl=null,qc=null,Hc=null;if(Array.isArray(Ps))ll=Ps.map(si);else if(Ps)ll=[si(Ps)];else for(ll=new Array(ac),oi=0;oi0&&(no.depth=gi[0].depth,no.stencil=gi[0].stencil,no.depthStencil=gi[0].depthStencil),gi[Fi]?gi[Fi](no):gi[Fi]=Cn(no)}return d(ri,{width:oi,height:oi,color:dl})}function ro(es){var Fi,no=es|0;if(no===ri.width)return ri;var oi=ri.color;for(Fi=0;Fi=Xo.byteLength?ys.subdata(Xo):(ys.destroy(),Mn.buffers[Fi]=null)),Mn.buffers[Fi]||(ys=Mn.buffers[Fi]=In.create(no,mc,!1,!0)),oi.buffer=In.getBuffer(ys),oi.size=oi.buffer.dimension|0,oi.normalized=!1,oi.type=oi.buffer.dtype,oi.offset=0,oi.stride=0,oi.divisor=0,oi.state=1,ro[Fi]=1}else In.getBuffer(no)?(oi.buffer=In.getBuffer(no),oi.size=oi.buffer.dimension|0,oi.normalized=!1,oi.type=oi.buffer.dtype,oi.offset=0,oi.stride=0,oi.divisor=0,oi.state=1):In.getBuffer(no.buffer)?(oi.buffer=In.getBuffer(no.buffer),oi.size=(+no.size||oi.buffer.dimension)|0,oi.normalized=!!no.normalized||!1,"type"in no?oi.type=ta[no.type]:oi.type=oi.buffer.dtype,oi.offset=(no.offset||0)|0,oi.stride=(no.stride||0)|0,oi.divisor=(no.divisor||0)|0,oi.state=1):"x"in no&&(oi.x=+no.x||0,oi.y=+no.y||0,oi.z=+no.z||0,oi.w=+no.w||0,oi.state=2)}for(var xs=0;xs1)for(var yn=0;ynqa&&(qa=wn.stats.uniformsCount)}),qa},xa.getMaxAttributesCount=function(){var qa=0;return ti.forEach(function(wn){wn.stats.attributesCount>qa&&(qa=wn.stats.attributesCount)}),qa});function Fn(){In={},Da={};for(var qa=0;qa>>4&15)+fa.charAt(cn&15);return xa}function Au(cr){for(var fa="",xa=-1,cn,In;++xa>>6&31,128|cn&63):cn<=65535?fa+=String.fromCharCode(224|cn>>>12&15,128|cn>>>6&63,128|cn&63):cn<=2097151&&(fa+=String.fromCharCode(240|cn>>>18&7,128|cn>>>12&63,128|cn>>>6&63,128|cn&63));return fa}function Zs(cr){for(var fa=Array(cr.length>>2),xa=0;xa>5]|=(cr.charCodeAt(xa/8)&255)<<24-xa%32;return fa}function Ol(cr){for(var fa="",xa=0;xa>5]>>>24-xa%32&255);return fa}function bl(cr,fa){return cr>>>fa|cr<<32-fa}function tc(cr,fa){return cr>>>fa}function Su(cr,fa,xa){return cr&fa^~cr&xa}function Cc(cr,fa,xa){return cr&fa^cr&xa^fa&xa}function Ht(cr){return bl(cr,2)^bl(cr,13)^bl(cr,22)}function ur(cr){return bl(cr,6)^bl(cr,11)^bl(cr,25)}function qr(cr){return bl(cr,7)^bl(cr,18)^tc(cr,3)}function Or(cr){return bl(cr,17)^bl(cr,19)^tc(cr,10)}var ua=new Array(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);function Fa(cr,fa){var xa=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),cn=new Array(64),In,Da,Na,Hn,Un,Gn,ti,Wi,Ti,si,Fn,qa;for(cr[fa>>5]|=128<<24-fa%32,cr[(fa+64>>9<<4)+15]=fa,Ti=0;Ti>16)+(fa>>16)+(xa>>16);return cn<<16|xa&65535}function sn(cr){return Array.prototype.slice.call(cr)}function gn(cr){return sn(cr).join("")}function kn(cr){var fa=cr&&cr.cache,xa=0,cn=[],In=[],Da=[];function Na(Fn,qa){var wn=qa&&qa.stable;if(!wn){for(var Tn=0;Tn0&&(Fn.push(Ln,"="),Fn.push.apply(Fn,sn(arguments)),Fn.push(";")),Ln}return d(qa,{def:Tn,toString:function(){return gn([wn.length>0?"var "+wn.join(",")+";":"",gn(Fn)])}})}function Un(){var Fn=Hn(),qa=Hn(),wn=Fn.toString,Tn=qa.toString;function Ln(Pn,Ri){qa(Pn,Ri,"=",Fn.def(Pn,Ri),";")}return d(function(){Fn.apply(Fn,sn(arguments))},{def:Fn.def,entry:Fn,exit:qa,save:Ln,set:function(Pn,Ri,Xn){Ln(Pn,Ri),Fn(Pn,Ri,"=",Xn,";")},toString:function(){return wn()+Tn()}})}function Gn(){var Fn=gn(arguments),qa=Un(),wn=Un(),Tn=qa.toString,Ln=wn.toString;return d(qa,{then:function(){return qa.apply(qa,sn(arguments)),this},else:function(){return wn.apply(wn,sn(arguments)),this},toString:function(){var Pn=Ln();return Pn&&(Pn="else{"+Pn+"}"),gn(["if(",Fn,"){",Tn(),"}",Pn])}})}var ti=Hn(),Wi={};function Ti(Fn,qa){var wn=[];function Tn(){var $i="a"+wn.length;return wn.push($i),$i}qa=qa||0;for(var Ln=0;Ln":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},ka={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Ba={cw:ut,ccw:ht};function Va(cr){return Array.isArray(cr)||fr(cr)||dr(cr)}function Ma(cr){return cr.sort(function(fa,xa){return fa===wc?-1:xa===wc?1:fa=1,cn>=2,fa)}else if(xa===Ni){var In=cr.data;return new mn(In.thisDep,In.contextDep,In.propDep,fa)}else{if(xa===Bn)return new mn(!1,!1,!1,fa);if(xa===An){for(var Da=!1,Na=!1,Hn=!1,Un=0;Un=1&&(Na=!0),ti>=2&&(Hn=!0)}else Gn.type===Ni&&(Da=Da||Gn.data.thisDep,Na=Na||Gn.data.contextDep,Hn=Hn||Gn.data.propDep)}return new mn(Da,Na,Hn,fa)}else return new mn(xa===ji,xa===ki,xa===zi,fa)}}var hi=new mn(!1,!1,!1,function(){});function _i(cr,fa,xa,cn,In,Da,Na,Hn,Un,Gn,ti,Wi,Ti,si,Fn,qa){var wn=Gn.Record,Tn={add:32774,subtract:32778,"reverse subtract":32779};xa.ext_blend_minmax&&(Tn.min=xt,Tn.max=zt);var Ln=xa.angle_instanced_arrays,Pn=xa.webgl_draw_buffers,Ri=xa.oes_vertex_array_object,Xn={dirty:!0,profile:qa.profile},$i={},Cn=[],Mn={},Si={};function yn(st){return st.replace(".","_")}function gi(st,bt,It){var Jt=yn(st);Cn.push(st),$i[Jt]=Xn[Jt]=!!It,Mn[Jt]=bt}function ri(st,bt,It){var Jt=yn(st);Cn.push(st),Array.isArray(It)?(Xn[Jt]=It.slice(),$i[Jt]=It.slice()):Xn[Jt]=$i[Jt]=It,Si[Jt]=bt}function ro(st){return!!isNaN(st)}gi(Ki,Sr),gi(ko,sr),ri($o,"blendColor",[0,0,0,0]),ri(Ls,"blendEquationSeparate",[Vr,Vr]),ri(os,"blendFuncSeparate",[Ar,Cr,Ar,Cr]),gi(As,Qr,!0),ri(jo,"depthFunc",Kr),ri(il,"depthRange",[0,1]),ri(Qs,"depthMask",!0),ri(Ss,Ss,[!0,!0,!0,!0]),gi(fi,rr),ri(ao,"cullFace",Ye),ri(gs,gs,ht),ri(Jo,Jo,1),gi(Bl,_a),ri(jl,"polygonOffset",[0,0]),gi(Vl,za),gi(cc,nn),ri(ql,"sampleCoverage",[1,!1]),gi(Vu,Nr),ri(ol,"stencilMask",-1),ri(rc,"stencilFunc",[Dt,0,-1]),ri(Vi,"stencilOpSeparate",[Le,$t,$t,$t]),ri(eo,"stencilOpSeparate",[Ye,$t,$t,$t]),gi(qu,ia),ri(Du,"scissor",[0,0,cr.drawingBufferWidth,cr.drawingBufferHeight]),ri(wc,wc,[0,0,cr.drawingBufferWidth,cr.drawingBufferHeight]);var es={gl:cr,context:Ti,strings:fa,next:$i,current:Xn,draw:Wi,elements:Da,buffer:In,shader:ti,attributes:Gn.state,vao:Gn,uniforms:Un,framebuffer:Hn,extensions:xa,timer:si,isBufferArgs:Va},Fi={primTypes:dt,compareFuncs:Ta,blendFuncs:la,blendEquations:Tn,stencilOps:ka,glTypes:ta,orientationType:Ba};Pn&&(Fi.backBuffer=[Ye],Fi.drawBuffer=p(cn.maxDrawbuffers,function(st){return st===0?[0]:p(st,function(bt){return Ua+bt})}));var no=0;function oi(){var st=kn({cache:Fn}),bt=st.link,It=st.global;st.id=no++,st.batchId="0";var Jt=bt(es),Kt=st.shared={props:"a0"};Object.keys(es).forEach(function(pr){Kt[pr]=It.def(Jt,".",pr)});var vr=st.next={},Tr=st.current={};Object.keys(Si).forEach(function(pr){Array.isArray(Xn[pr])&&(vr[pr]=It.def(Kt.next,".",pr),Tr[pr]=It.def(Kt.current,".",pr))});var wr=st.constants={};Object.keys(Fi).forEach(function(pr){wr[pr]=It.def(JSON.stringify(Fi[pr]))}),st.invoke=function(pr,xr){switch(xr.type){case On:var ea=["this",Kt.context,Kt.props,st.batchId];return pr.def(bt(xr.data),".call(",ea.slice(0,Math.max(xr.data.length+1,4)),")");case zi:return pr.def(Kt.props,xr.data);case ki:return pr.def(Kt.context,xr.data);case ji:return pr.def("this",xr.data);case Ni:return xr.data.append(st,pr),xr.data.ref;case Bn:return xr.data.toString();case An:return xr.data.map(function(ha){return st.invoke(pr,ha)})}},st.attribCache={};var tr={};return st.scopeAttrib=function(pr){var xr=fa.id(pr);if(xr in tr)return tr[xr];var ea=Gn.scope[xr];ea||(ea=Gn.scope[xr]=new wn);var ha=tr[xr]=bt(ea);return ha},st}function Xo(st){var bt=st.static,It=st.dynamic,Jt;if(De in bt){var Kt=!!bt[De];Jt=jn(function(Tr,wr){return Kt}),Jt.enable=Kt}else if(De in It){var vr=It[De];Jt=Zn(vr,function(Tr,wr){return Tr.invoke(wr,vr)})}return Jt}function ys(st,bt){var It=st.static,Jt=st.dynamic;if(I in It){var Kt=It[I];return Kt?(Kt=Hn.getFramebuffer(Kt),jn(function(Tr,wr){var tr=Tr.link(Kt),pr=Tr.shared;wr.set(pr.framebuffer,".next",tr);var xr=pr.context;return wr.set(xr,"."+Fr,tr+".width"),wr.set(xr,"."+Wr,tr+".height"),tr})):jn(function(Tr,wr){var tr=Tr.shared;wr.set(tr.framebuffer,".next","null");var pr=tr.context;return wr.set(pr,"."+Fr,pr+"."+lt),wr.set(pr,"."+Wr,pr+"."+Tt),"null"})}else if(I in Jt){var vr=Jt[I];return Zn(vr,function(Tr,wr){var tr=Tr.invoke(wr,vr),pr=Tr.shared,xr=pr.framebuffer,ea=wr.def(xr,".getFramebuffer(",tr,")");wr.set(xr,".next",ea);var ha=pr.context;return wr.set(ha,"."+Fr,ea+"?"+ea+".width:"+ha+"."+lt),wr.set(ha,"."+Wr,ea+"?"+ea+".height:"+ha+"."+Tt),ea})}else return null}function xs(st,bt,It){var Jt=st.static,Kt=st.dynamic;function vr(tr){if(tr in Jt){var pr=Jt[tr],xr=!0,ea=pr.x|0,ha=pr.y|0,Ea,tn;return"width"in pr?Ea=pr.width|0:xr=!1,"height"in pr?tn=pr.height|0:xr=!1,new mn(!xr&&bt&&bt.thisDep,!xr&&bt&&bt.contextDep,!xr&&bt&&bt.propDep,function(an,hn){var xn=an.shared.context,fn=Ea;"width"in pr||(fn=hn.def(xn,".",Fr,"-",ea));var En=tn;return"height"in pr||(En=hn.def(xn,".",Wr,"-",ha)),[ea,ha,fn,En]})}else if(tr in Kt){var Xa=Kt[tr],Ya=Zn(Xa,function(an,hn){var xn=an.invoke(hn,Xa),fn=an.shared.context,En=hn.def(xn,".x|0"),Yn=hn.def(xn,".y|0"),vi=hn.def('"width" in ',xn,"?",xn,".width|0:","(",fn,".",Fr,"-",En,")"),ai=hn.def('"height" in ',xn,"?",xn,".height|0:","(",fn,".",Wr,"-",Yn,")");return[En,Yn,vi,ai]});return bt&&(Ya.thisDep=Ya.thisDep||bt.thisDep,Ya.contextDep=Ya.contextDep||bt.contextDep,Ya.propDep=Ya.propDep||bt.propDep),Ya}else return bt?new mn(bt.thisDep,bt.contextDep,bt.propDep,function(an,hn){var xn=an.shared.context;return[0,0,hn.def(xn,".",Fr),hn.def(xn,".",Wr)]}):null}var Tr=vr(wc);if(Tr){var wr=Tr;Tr=new mn(Tr.thisDep,Tr.contextDep,Tr.propDep,function(tr,pr){var xr=wr.append(tr,pr),ea=tr.shared.context;return pr.set(ea,"."+je,xr[2]),pr.set(ea,"."+Ze,xr[3]),xr})}return{viewport:Tr,scissor_box:vr(Du)}}function Xs(st,bt){var It=st.static,Jt=typeof It[Te]=="string"&&typeof It[ne]=="string";if(Jt){if(Object.keys(bt.dynamic).length>0)return null;var Kt=bt.static,vr=Object.keys(Kt);if(vr.length>0&&typeof Kt[vr[0]]=="number"){for(var Tr=[],wr=0;wr"+En+"?"+xr+".constant["+En+"]:0;"}).join(""),"}}else{","if(",Ea,"(",xr,".buffer)){",an,"=",tn,".createStream(",Et,",",xr,".buffer);","}else{",an,"=",tn,".getBuffer(",xr,".buffer);","}",hn,'="type" in ',xr,"?",ha.glTypes,"[",xr,".type]:",an,".dtype;",Xa.normalized,"=!!",xr,".normalized;");function xn(fn){pr(Xa[fn],"=",xr,".",fn,"|0;")}return xn("size"),xn("offset"),xn("stride"),xn("divisor"),pr("}}"),pr.exit("if(",Xa.isStream,"){",tn,".destroyStream(",an,");","}"),Xa}Kt[vr]=Zn(Tr,wr)}),Kt}function Lc(st){var bt=st.static,It=st.dynamic,Jt={};return Object.keys(bt).forEach(function(Kt){var vr=bt[Kt];Jt[Kt]=jn(function(Tr,wr){return typeof vr=="number"||typeof vr=="boolean"?""+vr:Tr.link(vr)})}),Object.keys(It).forEach(function(Kt){var vr=It[Kt];Jt[Kt]=Zn(vr,function(Tr,wr){return Tr.invoke(wr,vr)})}),Jt}function Pf(st,bt,It,Jt,Kt){st.static,st.dynamic;var vr=Xs(st,bt),Tr=ys(st),wr=xs(st,Tr),tr=Mu(st),pr=dl(st),xr=Ps(st,Kt,vr);function ea(an){var hn=wr[an];hn&&(pr[an]=hn)}ea(wc),ea(yn(Du));var ha=Object.keys(pr).length>0,Ea={framebuffer:Tr,draw:tr,shader:xr,state:pr,dirty:ha,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(Ea.profile=Xo(st),Ea.uniforms=Eu(It),Ea.drawVAO=Ea.scopeVAO=tr.vao,!Ea.drawVAO&&xr.program&&!vr&&xa.angle_instanced_arrays&&tr.static.elements){var tn=!0,Xa=xr.program.attributes.map(function(an){var hn=bt.static[an];return tn=tn&&!!hn,hn});if(tn&&Xa.length>0){var Ya=Gn.getVAO(Gn.createVAO({attributes:Xa,elements:tr.static.elements}));Ea.drawVAO=new mn(null,null,null,function(an,hn){return an.link(Ya)}),Ea.useVAO=!0}}return vr?Ea.useVAO=!0:Ea.attributes=ac(bt),Ea.context=Lc(Jt),Ea}function su(st,bt,It){var Jt=st.shared,Kt=Jt.context,vr=st.scope();Object.keys(It).forEach(function(Tr){bt.save(Kt,"."+Tr);var wr=It[Tr],tr=wr.append(st,bt);Array.isArray(tr)?vr(Kt,".",Tr,"=[",tr.join(),"];"):vr(Kt,".",Tr,"=",tr,";")}),bt(vr)}function zu(st,bt,It,Jt){var Kt=st.shared,vr=Kt.gl,Tr=Kt.framebuffer,wr;Pn&&(wr=bt.def(Kt.extensions,".webgl_draw_buffers"));var tr=st.constants,pr=tr.drawBuffer,xr=tr.backBuffer,ea;It?ea=It.append(st,bt):ea=bt.def(Tr,".next"),Jt||bt("if(",ea,"!==",Tr,".cur){"),bt("if(",ea,"){",vr,".bindFramebuffer(",aa,",",ea,".framebuffer);"),Pn&&bt(wr,".drawBuffersWEBGL(",pr,"[",ea,".colorAttachments.length]);"),bt("}else{",vr,".bindFramebuffer(",aa,",null);"),Pn&&bt(wr,".drawBuffersWEBGL(",xr,");"),bt("}",Tr,".cur=",ea,";"),Jt||bt("}")}function Fo(st,bt,It){var Jt=st.shared,Kt=Jt.gl,vr=st.current,Tr=st.next,wr=Jt.current,tr=Jt.next,pr=st.cond(wr,".dirty");Cn.forEach(function(xr){var ea=yn(xr);if(!(ea in It.state)){var ha,Ea;if(ea in Tr){ha=Tr[ea],Ea=vr[ea];var tn=p(Xn[ea].length,function(Ya){return pr.def(ha,"[",Ya,"]")});pr(st.cond(tn.map(function(Ya,an){return Ya+"!=="+Ea+"["+an+"]"}).join("||")).then(Kt,".",Si[ea],"(",tn,");",tn.map(function(Ya,an){return Ea+"["+an+"]="+Ya}).join(";"),";"))}else{ha=pr.def(tr,".",ea);var Xa=st.cond(ha,"!==",wr,".",ea);pr(Xa),ea in Mn?Xa(st.cond(ha).then(Kt,".enable(",Mn[ea],");").else(Kt,".disable(",Mn[ea],");"),wr,".",ea,"=",ha,";"):Xa(Kt,".",Si[ea],"(",ha,");",wr,".",ea,"=",ha,";")}}}),Object.keys(It.state).length===0&&pr(wr,".dirty=false;"),bt(pr)}function nc(st,bt,It,Jt){var Kt=st.shared,vr=st.current,Tr=Kt.current,wr=Kt.gl,tr;Ma(Object.keys(It)).forEach(function(pr){var xr=It[pr];if(!(Jt&&!Jt(xr))){var ea=xr.append(st,bt);if(Mn[pr]){var ha=Mn[pr];Wn(xr)?(tr=st.link(ea,{stable:!0}),bt(st.cond(tr).then(wr,".enable(",ha,");").else(wr,".disable(",ha,");")),bt(Tr,".",pr,"=",tr,";")):(bt(st.cond(ea).then(wr,".enable(",ha,");").else(wr,".disable(",ha,");")),bt(Tr,".",pr,"=",ea,";"))}else if(ya(ea)){var Ea=vr[pr];bt(wr,".",Si[pr],"(",ea,");",ea.map(function(tn,Xa){return Ea+"["+Xa+"]="+tn}).join(";"),";")}else Wn(xr)?(tr=st.link(ea,{stable:!0}),bt(wr,".",Si[pr],"(",tr,");",Tr,".",pr,"=",tr,";")):bt(wr,".",Si[pr],"(",ea,");",Tr,".",pr,"=",ea,";")}})}function ll(st,bt){Ln&&(st.instancing=bt.def(st.shared.extensions,".angle_instanced_arrays"))}function Sl(st,bt,It,Jt,Kt){var vr=st.shared,Tr=st.stats,wr=vr.current,tr=vr.timer,pr=It.profile;function xr(){return typeof performance>"u"?"Date.now()":"performance.now()"}var ea,ha;function Ea(xn){ea=bt.def(),xn(ea,"=",xr(),";"),typeof Kt=="string"?xn(Tr,".count+=",Kt,";"):xn(Tr,".count++;"),si&&(Jt?(ha=bt.def(),xn(ha,"=",tr,".getNumPendingQueries();")):xn(tr,".beginQuery(",Tr,");"))}function tn(xn){xn(Tr,".cpuTime+=",xr(),"-",ea,";"),si&&(Jt?xn(tr,".pushScopeStats(",ha,",",tr,".getNumPendingQueries(),",Tr,");"):xn(tr,".endQuery();"))}function Xa(xn){var fn=bt.def(wr,".profile");bt(wr,".profile=",xn,";"),bt.exit(wr,".profile=",fn,";")}var Ya;if(pr){if(Wn(pr)){pr.enable?(Ea(bt),tn(bt.exit),Xa("true")):Xa("false");return}Ya=pr.append(st,bt),Xa(Ya)}else Ya=bt.def(wr,".profile");var an=st.block();Ea(an),bt("if(",Ya,"){",an,"}");var hn=st.block();tn(hn),bt.exit("if(",Ya,"){",hn,"}")}function qc(st,bt,It,Jt,Kt){var vr=st.shared;function Tr(tr){switch(tr){case ln:case Gi:case Zo:return 2;case Nn:case Bo:case Hs:return 3;case pi:case No:case zs:return 4;default:return 1}}function wr(tr,pr,xr){var ea=vr.gl,ha=bt.def(tr,".location"),Ea=bt.def(vr.attributes,"[",ha,"]"),tn=xr.state,Xa=xr.buffer,Ya=[xr.x,xr.y,xr.z,xr.w],an=["buffer","normalized","offset","stride"];function hn(){bt("if(!",Ea,".buffer){",ea,".enableVertexAttribArray(",ha,");}");var fn=xr.type,En;if(xr.size?En=bt.def(xr.size,"||",pr):En=pr,bt("if(",Ea,".type!==",fn,"||",Ea,".size!==",En,"||",an.map(function(vi){return Ea+"."+vi+"!=="+xr[vi]}).join("||"),"){",ea,".bindBuffer(",Et,",",Xa,".buffer);",ea,".vertexAttribPointer(",[ha,En,fn,xr.normalized,xr.stride,xr.offset],");",Ea,".type=",fn,";",Ea,".size=",En,";",an.map(function(vi){return Ea+"."+vi+"="+xr[vi]+";"}).join(""),"}"),Ln){var Yn=xr.divisor;bt("if(",Ea,".divisor!==",Yn,"){",st.instancing,".vertexAttribDivisorANGLE(",[ha,Yn],");",Ea,".divisor=",Yn,";}")}}function xn(){bt("if(",Ea,".buffer){",ea,".disableVertexAttribArray(",ha,");",Ea,".buffer=null;","}if(",Ja.map(function(fn,En){return Ea+"."+fn+"!=="+Ya[En]}).join("||"),"){",ea,".vertexAttrib4f(",ha,",",Ya,");",Ja.map(function(fn,En){return Ea+"."+fn+"="+Ya[En]+";"}).join(""),"}")}tn===on?hn():tn===Wa?xn():(bt("if(",tn,"===",on,"){"),hn(),bt("}else{"),xn(),bt("}"))}Jt.forEach(function(tr){var pr=tr.name,xr=It.attributes[pr],ea;if(xr){if(!Kt(xr))return;ea=xr.append(st,bt)}else{if(!Kt(hi))return;var ha=st.scopeAttrib(pr);ea={},Object.keys(new wn).forEach(function(Ea){ea[Ea]=bt.def(ha,".",Ea)})}wr(st.link(tr),Tr(tr.info.type),ea)})}function Hc(st,bt,It,Jt,Kt,vr){for(var Tr=st.shared,wr=Tr.gl,tr,pr=0;pr1){for(var Io=[],yo=[],vs=0;vs>1)",Xa],");")}function Yn(){It(Ya,".drawArraysInstancedANGLE(",[ha,Ea,tn,Xa],");")}xr&&xr!=="null"?hn?En():(It("if(",xr,"){"),En(),It("}else{"),Yn(),It("}")):Yn()}function fn(){function En(){It(vr+".drawElements("+[ha,tn,an,Ea+"<<(("+an+"-"+_n+")>>1)"]+");")}function Yn(){It(vr+".drawArrays("+[ha,Ea,tn]+");")}xr&&xr!=="null"?hn?En():(It("if(",xr,"){"),En(),It("}else{"),Yn(),It("}")):Yn()}Ln&&(typeof Xa!="number"||Xa>=0)?typeof Xa=="string"?(It("if(",Xa,">0){"),xn(),It("}else if(",Xa,"<0){"),fn(),It("}")):xn():fn()}function js(st,bt,It,Jt,Kt){var vr=oi(),Tr=vr.proc("body",Kt);return Ln&&(vr.instancing=Tr.def(vr.shared.extensions,".angle_instanced_arrays")),st(vr,Tr,It,Jt),vr.compile().body}function ls(st,bt,It,Jt){ll(st,bt),It.useVAO?It.drawVAO?bt(st.shared.vao,".setVAO(",It.drawVAO.append(st,bt),");"):bt(st.shared.vao,".setVAO(",st.shared.vao,".targetVAO);"):(bt(st.shared.vao,".setVAO(null);"),qc(st,bt,It,Jt.attributes,function(){return!0})),Hc(st,bt,It,Jt.uniforms,function(){return!0},!1),ss(st,bt,bt,It)}function ye(st,bt){var It=st.proc("draw",1);ll(st,It),su(st,It,bt.context),zu(st,It,bt.framebuffer),Fo(st,It,bt),nc(st,It,bt.state),Sl(st,It,bt,!1,!0);var Jt=bt.shader.progVar.append(st,It);if(It(st.shared.gl,".useProgram(",Jt,".program);"),bt.shader.program)ls(st,It,bt,bt.shader.program);else{It(st.shared.vao,".setVAO(null);");var Kt=st.global.def("{}"),vr=It.def(Jt,".id"),Tr=It.def(Kt,"[",vr,"]");It(st.cond(Tr).then(Tr,".call(this,a0);").else(Tr,"=",Kt,"[",vr,"]=",st.link(function(wr){return js(ls,st,bt,wr,1)}),"(",Jt,");",Tr,".call(this,a0);"))}Object.keys(bt.state).length>0&&It(st.shared.current,".dirty=true;"),st.shared.vao&&It(st.shared.vao,".setVAO(null);")}function W(st,bt,It,Jt){st.batchId="a1",ll(st,bt);function Kt(){return!0}qc(st,bt,It,Jt.attributes,Kt),Hc(st,bt,It,Jt.uniforms,Kt,!1),ss(st,bt,bt,It)}function de(st,bt,It,Jt){ll(st,bt);var Kt=It.contextDep,vr=bt.def(),Tr="a0",wr="a1",tr=bt.def();st.shared.props=tr,st.batchId=vr;var pr=st.scope(),xr=st.scope();bt(pr.entry,"for(",vr,"=0;",vr,"<",wr,";++",vr,"){",tr,"=",Tr,"[",vr,"];",xr,"}",pr.exit);function ea(an){return an.contextDep&&Kt||an.propDep}function ha(an){return!ea(an)}if(It.needsContext&&su(st,xr,It.context),It.needsFramebuffer&&zu(st,xr,It.framebuffer),nc(st,xr,It.state,ea),It.profile&&ea(It.profile)&&Sl(st,xr,It,!1,!0),Jt)It.useVAO?It.drawVAO?ea(It.drawVAO)?xr(st.shared.vao,".setVAO(",It.drawVAO.append(st,xr),");"):pr(st.shared.vao,".setVAO(",It.drawVAO.append(st,pr),");"):pr(st.shared.vao,".setVAO(",st.shared.vao,".targetVAO);"):(pr(st.shared.vao,".setVAO(null);"),qc(st,pr,It,Jt.attributes,ha),qc(st,xr,It,Jt.attributes,ea)),Hc(st,pr,It,Jt.uniforms,ha,!1),Hc(st,xr,It,Jt.uniforms,ea,!0),ss(st,pr,xr,It);else{var Ea=st.global.def("{}"),tn=It.shader.progVar.append(st,xr),Xa=xr.def(tn,".id"),Ya=xr.def(Ea,"[",Xa,"]");xr(st.shared.gl,".useProgram(",tn,".program);","if(!",Ya,"){",Ya,"=",Ea,"[",Xa,"]=",st.link(function(an){return js(W,st,It,an,2)}),"(",tn,");}",Ya,".call(this,a0[",vr,"],",vr,");")}}function te(st,bt){var It=st.proc("batch",2);st.batchId="0",ll(st,It);var Jt=!1,Kt=!0;Object.keys(bt.context).forEach(function(Ea){Jt=Jt||bt.context[Ea].propDep}),Jt||(su(st,It,bt.context),Kt=!1);var vr=bt.framebuffer,Tr=!1;vr?(vr.propDep?Jt=Tr=!0:vr.contextDep&&Jt&&(Tr=!0),Tr||zu(st,It,vr)):zu(st,It,null),bt.state.viewport&&bt.state.viewport.propDep&&(Jt=!0);function wr(Ea){return Ea.contextDep&&Jt||Ea.propDep}Fo(st,It,bt),nc(st,It,bt.state,function(Ea){return!wr(Ea)}),(!bt.profile||!wr(bt.profile))&&Sl(st,It,bt,!1,"a1"),bt.contextDep=Jt,bt.needsContext=Kt,bt.needsFramebuffer=Tr;var tr=bt.shader.progVar;if(tr.contextDep&&Jt||tr.propDep)de(st,It,bt,null);else{var pr=tr.append(st,It);if(It(st.shared.gl,".useProgram(",pr,".program);"),bt.shader.program)de(st,It,bt,bt.shader.program);else{It(st.shared.vao,".setVAO(null);");var xr=st.global.def("{}"),ea=It.def(pr,".id"),ha=It.def(xr,"[",ea,"]");It(st.cond(ha).then(ha,".call(this,a0,a1);").else(ha,"=",xr,"[",ea,"]=",st.link(function(Ea){return js(de,st,bt,Ea,2)}),"(",pr,");",ha,".call(this,a0,a1);"))}}Object.keys(bt.state).length>0&&It(st.shared.current,".dirty=true;"),st.shared.vao&&It(st.shared.vao,".setVAO(null);")}function me(st,bt){var It=st.proc("scope",3);st.batchId="a2";var Jt=st.shared,Kt=Jt.current;if(su(st,It,bt.context),bt.framebuffer&&bt.framebuffer.append(st,It),Ma(Object.keys(bt.state)).forEach(function(wr){var tr=bt.state[wr],pr=tr.append(st,It);ya(pr)?pr.forEach(function(xr,ea){ro(xr)?It.set(st.next[wr],"["+ea+"]",xr):It.set(st.next[wr],"["+ea+"]",st.link(xr,{stable:!0}))}):Wn(tr)?It.set(Jt.next,"."+wr,st.link(pr,{stable:!0})):It.set(Jt.next,"."+wr,pr)}),Sl(st,It,bt,!0,!0),[Se,yt,ot,Ct,Ie].forEach(function(wr){var tr=bt.draw[wr];if(tr){var pr=tr.append(st,It);ro(pr)?It.set(Jt.draw,"."+wr,pr):It.set(Jt.draw,"."+wr,st.link(pr),{stable:!0})}}),Object.keys(bt.uniforms).forEach(function(wr){var tr=bt.uniforms[wr].append(st,It);Array.isArray(tr)&&(tr="["+tr.map(function(pr){return ro(pr)?pr:st.link(pr,{stable:!0})})+"]"),It.set(Jt.uniforms,"["+st.link(fa.id(wr),{stable:!0})+"]",tr)}),Object.keys(bt.attributes).forEach(function(wr){var tr=bt.attributes[wr].append(st,It),pr=st.scopeAttrib(wr);Object.keys(new wn).forEach(function(xr){It.set(pr,"."+xr,tr[xr])})}),bt.scopeVAO){var vr=bt.scopeVAO.append(st,It);ro(vr)?It.set(Jt.vao,".targetVAO",vr):It.set(Jt.vao,".targetVAO",st.link(vr,{stable:!0}))}function Tr(wr){var tr=bt.shader[wr];if(tr){var pr=tr.append(st,It);ro(pr)?It.set(Jt.shader,"."+wr,pr):It.set(Jt.shader,"."+wr,st.link(pr,{stable:!0}))}}Tr(ne),Tr(Te),Object.keys(bt.state).length>0&&(It(Kt,".dirty=true;"),It.exit(Kt,".dirty=true;")),It("a1(",st.shared.context,",a0,",st.batchId,");")}function Ue(st){if(!(typeof st!="object"||ya(st))){for(var bt=Object.keys(st),It=0;It=0;--ss){var js=ro[ss];js&&js(si,null,0)}xa.flush(),Gn&&Gn.update()}function ys(){!oi&&ro.length>0&&(oi=f.next(Xo))}function xs(){oi&&(f.cancel(Xo),oi=null)}function Xs(ss){ss.preventDefault(),xs(),es.forEach(function(js){js()})}function Ps(ss){xa.getError(),In.restore(),Xn.restore(),Tn.restore(),$i.restore(),Cn.restore(),Mn.restore(),Pn.restore(),Gn&&Gn.restore(),Si.procs.refresh(),ys(),Fi.forEach(function(js){js()})}ri&&(ri.addEventListener(Es,Xs,!1),ri.addEventListener(hs,Ps,!1));function Mu(){ro.length=0,xs(),ri&&(ri.removeEventListener(Es,Xs),ri.removeEventListener(hs,Ps)),Xn.clear(),Mn.clear(),Cn.clear(),Pn.clear(),$i.clear(),Ln.clear(),Tn.clear(),Gn&&Gn.clear(),no.forEach(function(ss){ss()})}function dl(ss){function js(Kt){var vr=d({},Kt);delete vr.uniforms,delete vr.attributes,delete vr.context,delete vr.vao,"stencil"in vr&&vr.stencil.op&&(vr.stencil.opBack=vr.stencil.opFront=vr.stencil.op,delete vr.stencil.op);function Tr(wr){if(wr in vr){var tr=vr[wr];delete vr[wr],Object.keys(tr).forEach(function(pr){vr[wr+"."+pr]=tr[pr]})}}return Tr("blend"),Tr("depth"),Tr("cull"),Tr("stencil"),Tr("polygonOffset"),Tr("scissor"),Tr("sample"),"vao"in Kt&&(vr.vao=Kt.vao),vr}function ls(Kt,vr){var Tr={},wr={};return Object.keys(Kt).forEach(function(tr){var pr=Kt[tr];if(c.isDynamic(pr)){wr[tr]=c.unbox(pr,tr);return}else if(vr&&Array.isArray(pr)){for(var xr=0;xr0)return ft.call(this,It(Kt|0),Kt|0)}else if(Array.isArray(Kt)){if(Kt.length)return ft.call(this,Kt,Kt.length)}else return tt.call(this,Kt)}return d(Jt,{stats:me,destroy:function(){Ue.destroy()}})}var Eu=Mn.setFBO=dl({framebuffer:c.define.call(null,Hl,"framebuffer")});function ac(ss,js){var ls=0;Si.procs.poll();var ye=js.color;ye&&(xa.clearColor(+ye[0]||0,+ye[1]||0,+ye[2]||0,+ye[3]||0),ls|=Ms),"depth"in js&&(xa.clearDepth(+js.depth),ls|=Kn),"stencil"in js&&(xa.clearStencil(js.stencil|0),ls|=go),xa.clear(ls)}function Lc(ss){if("framebuffer"in ss)if(ss.framebuffer&&ss.framebuffer_reglType==="framebufferCube")for(var js=0;js<6;++js)Eu(d({framebuffer:ss.framebuffer.faces[js]},ss),ac);else Eu(ss,ac);else ac(null,ss)}function Pf(ss){ro.push(ss);function js(){var ls=gu(ro,ss);function ye(){var W=gu(ro,ye);ro[W]=ro[ro.length-1],ro.length-=1,ro.length<=0&&xs()}ro[ls]=ye}return ys(),{cancel:js}}function su(){var ss=gi.viewport,js=gi.scissor_box;ss[0]=ss[1]=js[0]=js[1]=0,si.viewportWidth=si.framebufferWidth=si.drawingBufferWidth=ss[2]=js[2]=xa.drawingBufferWidth,si.viewportHeight=si.framebufferHeight=si.drawingBufferHeight=ss[3]=js[3]=xa.drawingBufferHeight}function zu(){si.tick+=1,si.time=nc(),su(),Si.procs.poll()}function Fo(){$i.refresh(),su(),Si.procs.refresh(),Gn&&Gn.update()}function nc(){return(v()-ti)/1e3}Fo();function ll(ss,js){var ls;switch(ss){case"frame":return Pf(js);case"lost":ls=es;break;case"restore":ls=Fi;break;case"destroy":ls=no;break}return ls.push(js),{cancel:function(){for(var ye=0;ye=0},read:yn,destroy:Mu,_gl:xa,_refresh:Fo,poll:function(){zu(),Gn&&Gn.update()},now:nc,stats:Na,getCachedCode:Sl,preloadCachedCode:qc});return fa.onDone(null,Hc),Hc}return el})}}),$6=He({"node_modules/gl-util/context.js"(Y,G){var d=Gv();G.exports=function(o){if(o?typeof o=="string"&&(o={container:o}):o={},A(o)?o={container:o}:E(o)?o={container:o}:e(o)?o={gl:o}:o=d(o,{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),o.pixelRatio||(o.pixelRatio=window.pixelRatio||1),o.gl)return o.gl;if(o.canvas&&(o.container=o.canvas.parentNode),o.container){if(typeof o.container=="string"){var a=document.querySelector(o.container);if(!a)throw Error("Element "+o.container+" is not found");o.container=a}A(o.container)?(o.canvas=o.container,o.container=o.canvas.parentNode):o.canvas||(o.canvas=t(),o.container.appendChild(o.canvas),x(o))}else if(!o.canvas)if(typeof document<"u")o.container=document.body||document.documentElement,o.canvas=t(),o.container.appendChild(o.canvas),x(o);else throw Error("Not DOM environment. Use headless-gl.");return o.gl||["webgl","experimental-webgl","webgl-experimental"].some(function(i){try{o.gl=o.canvas.getContext(i,o.attrs)}catch{}return o.gl}),o.gl};function x(r){if(r.container)if(r.container==document.body)document.body.style.width||(r.canvas.width=r.width||r.pixelRatio*window.innerWidth),document.body.style.height||(r.canvas.height=r.height||r.pixelRatio*window.innerHeight);else{var o=r.container.getBoundingClientRect();r.canvas.width=r.width||o.right-o.left,r.canvas.height=r.height||o.bottom-o.top}}function A(r){return typeof r.getContext=="function"&&"width"in r&&"height"in r}function E(r){return typeof r.nodeName=="string"&&typeof r.appendChild=="function"&&typeof r.getBoundingClientRect=="function"}function e(r){return typeof r.drawArrays=="function"||typeof r.drawElements=="function"}function t(){var r=document.createElement("canvas");return r.style.position="absolute",r.style.top=0,r.style.left=0,r}}}),Q6=He({"node_modules/font-atlas/index.js"(Y,G){var d=_T(),x=[32,126];G.exports=A;function A(E){E=E||{};var e=E.shape?E.shape:E.canvas?[E.canvas.width,E.canvas.height]:[512,512],t=E.canvas||document.createElement("canvas"),r=E.font,o=typeof E.step=="number"?[E.step,E.step]:E.step||[32,32],a=E.chars||x;if(r&&typeof r!="string"&&(r=d(r)),!Array.isArray(a))a=String(a).split("");else if(a.length===2&&typeof a[0]=="number"&&typeof a[1]=="number"){for(var i=[],n=a[0],s=0;n<=a[1];n++)i[s++]=String.fromCharCode(n);a=i}e=e.slice(),t.width=e[0],t.height=e[1];var c=t.getContext("2d");c.fillStyle="#000",c.fillRect(0,0,t.width,t.height),c.font=r,c.textAlign="center",c.textBaseline="middle",c.fillStyle="#fff";for(var f=o[0]/2,v=o[1]/2,n=0;ne[0]-o[0]/2&&(f=o[0]/2,v+=o[1]);return t}}}),bT=He({"node_modules/bit-twiddle/twiddle.js"(Y){"use restrict";var G=32;Y.INT_BITS=G,Y.INT_MAX=2147483647,Y.INT_MIN=-1<0)-(A<0)},Y.abs=function(A){var E=A>>G-1;return(A^E)-E},Y.min=function(A,E){return E^(A^E)&-(A65535)<<4,A>>>=E,e=(A>255)<<3,A>>>=e,E|=e,e=(A>15)<<2,A>>>=e,E|=e,e=(A>3)<<1,A>>>=e,E|=e,E|A>>1},Y.log10=function(A){return A>=1e9?9:A>=1e8?8:A>=1e7?7:A>=1e6?6:A>=1e5?5:A>=1e4?4:A>=1e3?3:A>=100?2:A>=10?1:0},Y.popCount=function(A){return A=A-(A>>>1&1431655765),A=(A&858993459)+(A>>>2&858993459),(A+(A>>>4)&252645135)*16843009>>>24};function d(A){var E=32;return A&=-A,A&&E--,A&65535&&(E-=16),A&16711935&&(E-=8),A&252645135&&(E-=4),A&858993459&&(E-=2),A&1431655765&&(E-=1),E}Y.countTrailingZeros=d,Y.nextPow2=function(A){return A+=A===0,--A,A|=A>>>1,A|=A>>>2,A|=A>>>4,A|=A>>>8,A|=A>>>16,A+1},Y.prevPow2=function(A){return A|=A>>>1,A|=A>>>2,A|=A>>>4,A|=A>>>8,A|=A>>>16,A-(A>>>1)},Y.parity=function(A){return A^=A>>>16,A^=A>>>8,A^=A>>>4,A&=15,27030>>>A&1};var x=new Array(256);(function(A){for(var E=0;E<256;++E){var e=E,t=E,r=7;for(e>>>=1;e;e>>>=1)t<<=1,t|=e&1,--r;A[E]=t<>>8&255]<<16|x[A>>>16&255]<<8|x[A>>>24&255]},Y.interleave2=function(A,E){return A&=65535,A=(A|A<<8)&16711935,A=(A|A<<4)&252645135,A=(A|A<<2)&858993459,A=(A|A<<1)&1431655765,E&=65535,E=(E|E<<8)&16711935,E=(E|E<<4)&252645135,E=(E|E<<2)&858993459,E=(E|E<<1)&1431655765,A|E<<1},Y.deinterleave2=function(A,E){return A=A>>>E&1431655765,A=(A|A>>>1)&858993459,A=(A|A>>>2)&252645135,A=(A|A>>>4)&16711935,A=(A|A>>>16)&65535,A<<16>>16},Y.interleave3=function(A,E,e){return A&=1023,A=(A|A<<16)&4278190335,A=(A|A<<8)&251719695,A=(A|A<<4)&3272356035,A=(A|A<<2)&1227133513,E&=1023,E=(E|E<<16)&4278190335,E=(E|E<<8)&251719695,E=(E|E<<4)&3272356035,E=(E|E<<2)&1227133513,A|=E<<1,e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,A|e<<2},Y.deinterleave3=function(A,E){return A=A>>>E&1227133513,A=(A|A>>>2)&3272356035,A=(A|A>>>4)&251719695,A=(A|A>>>8)&4278190335,A=(A|A>>>16)&1023,A<<22>>22},Y.nextCombination=function(A){var E=A|A-1;return E+1|(~E&-~E)-1>>>d(A)+1}}}),eI=He({"node_modules/dup/dup.js"(Y,G){function d(E,e,t){var r=E[t]|0;if(r<=0)return[];var o=new Array(r),a;if(t===E.length-1)for(a=0;a"u"&&(e=0),typeof E){case"number":if(E>0)return x(E|0,e);break;case"object":if(typeof E.length=="number")return d(E,e,0);break}return[]}G.exports=A}}),tI=He({"node_modules/typedarray-pool/pool.js"(Y){var G=bT(),d=eI(),x=zp().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:d([32,0]),UINT16:d([32,0]),UINT32:d([32,0]),BIGUINT64:d([32,0]),INT8:d([32,0]),INT16:d([32,0]),INT32:d([32,0]),BIGINT64:d([32,0]),FLOAT:d([32,0]),DOUBLE:d([32,0]),DATA:d([32,0]),UINT8C:d([32,0]),BUFFER:d([32,0])});var A=typeof Uint8ClampedArray<"u",E=typeof BigUint64Array<"u",e=typeof BigInt64Array<"u",t=window.__TYPEDARRAY_POOL;t.UINT8C||(t.UINT8C=d([32,0])),t.BIGUINT64||(t.BIGUINT64=d([32,0])),t.BIGINT64||(t.BIGINT64=d([32,0])),t.BUFFER||(t.BUFFER=d([32,0]));var r=t.DATA,o=t.BUFFER;Y.free=function(u){if(x.isBuffer(u))o[G.log2(u.length)].push(u);else{if(Object.prototype.toString.call(u)!=="[object ArrayBuffer]"&&(u=u.buffer),!u)return;var g=u.length||u.byteLength,m=G.log2(g)|0;r[m].push(u)}};function a(p){if(p){var u=p.length||p.byteLength,g=G.log2(u);r[g].push(p)}}function i(p){a(p.buffer)}Y.freeUint8=Y.freeUint16=Y.freeUint32=Y.freeBigUint64=Y.freeInt8=Y.freeInt16=Y.freeInt32=Y.freeBigInt64=Y.freeFloat32=Y.freeFloat=Y.freeFloat64=Y.freeDouble=Y.freeUint8Clamped=Y.freeDataView=i,Y.freeArrayBuffer=a,Y.freeBuffer=function(u){o[G.log2(u.length)].push(u)},Y.malloc=function(u,g){if(g===void 0||g==="arraybuffer")return n(u);switch(g){case"uint8":return s(u);case"uint16":return c(u);case"uint32":return f(u);case"int8":return v(u);case"int16":return h(u);case"int32":return T(u);case"float":case"float32":return l(u);case"double":case"float64":return y(u);case"uint8_clamped":return b(u);case"bigint64":return M(u);case"biguint64":return S(u);case"buffer":return w(u);case"data":case"dataview":return _(u);default:return null}return null};function n(u){var u=G.nextPow2(u),g=G.log2(u),m=r[g];return m.length>0?m.pop():new ArrayBuffer(u)}Y.mallocArrayBuffer=n;function s(p){return new Uint8Array(n(p),0,p)}Y.mallocUint8=s;function c(p){return new Uint16Array(n(2*p),0,p)}Y.mallocUint16=c;function f(p){return new Uint32Array(n(4*p),0,p)}Y.mallocUint32=f;function v(p){return new Int8Array(n(p),0,p)}Y.mallocInt8=v;function h(p){return new Int16Array(n(2*p),0,p)}Y.mallocInt16=h;function T(p){return new Int32Array(n(4*p),0,p)}Y.mallocInt32=T;function l(p){return new Float32Array(n(4*p),0,p)}Y.mallocFloat32=Y.mallocFloat=l;function y(p){return new Float64Array(n(8*p),0,p)}Y.mallocFloat64=Y.mallocDouble=y;function b(p){return A?new Uint8ClampedArray(n(p),0,p):s(p)}Y.mallocUint8Clamped=b;function S(p){return E?new BigUint64Array(n(8*p),0,p):null}Y.mallocBigUint64=S;function M(p){return e?new BigInt64Array(n(8*p),0,p):null}Y.mallocBigInt64=M;function _(p){return new DataView(n(p),0,p)}Y.mallocDataView=_;function w(p){p=G.nextPow2(p);var u=G.log2(p),g=o[u];return g.length>0?g.pop():new x(p)}Y.mallocBuffer=w,Y.clearCache=function(){for(var u=0;u<32;++u)t.UINT8[u].length=0,t.UINT16[u].length=0,t.UINT32[u].length=0,t.INT8[u].length=0,t.INT16[u].length=0,t.INT32[u].length=0,t.FLOAT[u].length=0,t.DOUBLE[u].length=0,t.BIGUINT64[u].length=0,t.BIGINT64[u].length=0,t.UINT8C[u].length=0,r[u].length=0,o[u].length=0}}}),rI=He({"node_modules/is-plain-obj/index.js"(Y,G){var d=Object.prototype.toString;G.exports=function(x){var A;return d.call(x)==="[object Object]"&&(A=Object.getPrototypeOf(x),A===null||A===Object.getPrototypeOf({}))}}}),wT=He({"node_modules/parse-unit/index.js"(Y,G){G.exports=function(x,A){A||(A=[0,""]),x=String(x);var E=parseFloat(x,10);return A[0]=E,A[1]=x.match(/[\d.\-\+]*\s*(.*)/)[1]||"",A}}}),aI=He({"node_modules/to-px/topx.js"(Y,G){var d=wT();G.exports=e;var x=96;function A(t,r){var o=d(getComputedStyle(t).getPropertyValue(r));return o[0]*e(o[1],t)}function E(t,r){var o=document.createElement("div");o.style["font-size"]="128"+t,r.appendChild(o);var a=A(o,"font-size")/128;return r.removeChild(o),a}function e(t,r){switch(r=r||document.body,t=(t||"px").trim().toLowerCase(),(r===window||r===document)&&(r=document.body),t){case"%":return r.clientHeight/100;case"ch":case"ex":return E(t,r);case"em":return A(r,"font-size");case"rem":return A(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return x;case"cm":return x/2.54;case"mm":return x/25.4;case"pt":return x/72;case"pc":return x/6}return 1}}}),nI=He({"node_modules/detect-kerning/index.js"(Y,G){G.exports=E;var d=E.canvas=document.createElement("canvas"),x=d.getContext("2d"),A=e([32,126]);E.createPairs=e,E.ascii=A;function E(t,r){Array.isArray(t)&&(t=t.join(", "));var o={},a,i=16,n=.05;r&&(r.length===2&&typeof r[0]=="number"?a=e(r):Array.isArray(r)?a=r:(r.o?a=e(r.o):r.pairs&&(a=r.pairs),r.fontSize&&(i=r.fontSize),r.threshold!=null&&(n=r.threshold))),a||(a=A),x.font=i+"px "+t;for(var s=0;si*n){var h=(v-f)/i;o[c]=h*1e3}}return o}function e(t){for(var r=[],o=t[0];o<=t[1];o++)for(var a=String.fromCharCode(o),i=t[0];i0;o-=4)if(r[o]!==0)return Math.floor((o-3)*.25/t)}}}),oI=He({"node_modules/gl-text/dist.js"(Y,G){var d=J6(),x=Gv(),A=xT(),E=$6(),e=fT(),t=rp(),r=Q6(),o=tI(),a=cg(),i=rI(),n=wT(),s=aI(),c=nI(),f=Yc(),v=iI(),h=Yp(),T=bT(),l=T.nextPow2,y=new e,b=!1;document.body&&(S=document.body.appendChild(document.createElement("div")),S.style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(S).fontStretch&&(b=!0),document.body.removeChild(S));var S,M=function(p){_(p)?(p={regl:p},this.gl=p.regl._gl):this.gl=E(p),this.shader=y.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=p.regl||A({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),y.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(i(p)?p:{})};M.prototype.createShader=function(){var p=this.regl,u=p({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:p.prop("count"),offset:p.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:p.this("sizeBuffer")},width:{offset:0,stride:8,buffer:p.this("sizeBuffer")},char:p.this("charBuffer"),position:p.this("position")},uniforms:{atlasSize:function(m,R){return[R.atlas.width,R.atlas.height]},atlasDim:function(m,R){return[R.atlas.cols,R.atlas.rows]},atlas:function(m,R){return R.atlas.texture},charStep:function(m,R){return R.atlas.step},em:function(m,R){return R.atlas.em},color:p.prop("color"),opacity:p.prop("opacity"),viewport:p.this("viewportArray"),scale:p.this("scale"),align:p.prop("align"),baseline:p.prop("baseline"),translate:p.this("translate"),positionOffset:p.prop("positionOffset")},primitive:"points",viewport:p.this("viewport"),vert:` + precision highp float; + attribute float width, charOffset, char; + attribute vec2 position; + uniform float fontSize, charStep, em, align, baseline; + uniform vec4 viewport; + uniform vec4 color; + uniform vec2 atlasSize, atlasDim, scale, translate, positionOffset; + varying vec2 charCoord, charId; + varying float charWidth; + varying vec4 fontColor; + void main () { + vec2 offset = floor(em * (vec2(align + charOffset, baseline) + + vec2(positionOffset.x, -positionOffset.y))) + / (viewport.zw * scale.xy); + + vec2 position = (position + translate) * scale; + position += offset * scale; + + charCoord = position * viewport.zw + viewport.xy; + + gl_Position = vec4(position * 2. - 1., 0, 1); + + gl_PointSize = charStep; + + charId.x = mod(char, atlasDim.x); + charId.y = floor(char / atlasDim.x); + + charWidth = width * em; + + fontColor = color / 255.; + }`,frag:` + precision highp float; + uniform float fontSize, charStep, opacity; + uniform vec2 atlasSize; + uniform vec4 viewport; + uniform sampler2D atlas; + varying vec4 fontColor; + varying vec2 charCoord, charId; + varying float charWidth; + + float lightness(vec4 color) { + return color.r * 0.299 + color.g * 0.587 + color.b * 0.114; + } + + void main () { + vec2 uv = gl_FragCoord.xy - charCoord + charStep * .5; + float halfCharStep = floor(charStep * .5 + .5); + + // invert y and shift by 1px (FF expecially needs that) + uv.y = charStep - uv.y; + + // ignore points outside of character bounding box + float halfCharWidth = ceil(charWidth * .5); + if (floor(uv.x) > 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; + }`}),g={};return{regl:p,draw:u,atlas:g}},M.prototype.update=function(p){var u=this;if(typeof p=="string")p={text:p};else if(!p)return;p=x(p,{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),p.opacity!=null&&(Array.isArray(p.opacity)?this.opacity=p.opacity.map(function(ce){return parseFloat(ce)}):this.opacity=parseFloat(p.opacity)),p.viewport!=null&&(this.viewport=a(p.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]),p.kerning!=null&&(this.kerning=p.kerning),p.offset!=null&&(typeof p.offset=="number"&&(p.offset=[p.offset,0]),this.positionOffset=h(p.offset)),p.direction&&(this.direction=p.direction),p.range&&(this.range=p.range,this.scale=[1/(p.range[2]-p.range[0]),1/(p.range[3]-p.range[1])],this.translate=[-p.range[0],-p.range[1]]),p.scale&&(this.scale=p.scale),p.translate&&(this.translate=p.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),!this.font.length&&!p.font&&(p.font=M.baseFontSize+"px sans-serif");var g=!1,m=!1;if(p.font&&(Array.isArray(p.font)?p.font:[p.font]).forEach(function(ce,Re){if(typeof ce=="string")try{ce=d.parse(ce)}catch{ce=d.parse(M.baseFontSize+"px "+ce)}else{var $e=ce.style,rt=ce.weight,Je=ce.stretch,At=ce.variant;ce=d.parse(d.stringify(ce)),$e&&(ce.style=$e),rt&&(ce.weight=rt),Je&&(ce.stretch=Je),At&&(ce.variant=At)}var St=d.stringify({size:M.baseFontSize,family:ce.family,stretch:b?ce.stretch:void 0,variant:ce.variant,weight:ce.weight,style:ce.style}),Rt=n(ce.size),Ut=Math.round(Rt[0]*s(Rt[1]));if(Ut!==u.fontSize[Re]&&(m=!0,u.fontSize[Re]=Ut),(!u.font[Re]||St!=u.font[Re].baseString)&&(g=!0,u.font[Re]=M.fonts[St],!u.font[Re])){var ir=ce.family.join(", "),ar=[ce.style];ce.style!=ce.variant&&ar.push(ce.variant),ce.variant!=ce.weight&&ar.push(ce.weight),b&&ce.weight!=ce.stretch&&ar.push(ce.stretch),u.font[Re]={baseString:St,family:ir,weight:ce.weight,stretch:ce.stretch,style:ce.style,variant:ce.variant,width:{},kerning:{},metrics:v(ir,{origin:"top",fontSize:M.baseFontSize,fontStyle:ar.join(" ")})},M.fonts[St]=u.font[Re]}}),(g||m)&&this.font.forEach(function(ce,Re){var $e=d.stringify({size:u.fontSize[Re],family:ce.family,stretch:b?ce.stretch:void 0,variant:ce.variant,weight:ce.weight,style:ce.style});if(u.fontAtlas[Re]=u.shader.atlas[$e],!u.fontAtlas[Re]){var rt=ce.metrics;u.shader.atlas[$e]=u.fontAtlas[Re]={fontString:$e,step:Math.ceil(u.fontSize[Re]*rt.bottom*.5)*2,em:u.fontSize[Re],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:u.regl.texture()}}p.text==null&&(p.text=u.text)}),typeof p.text=="string"&&p.position&&p.position.length>2){for(var R=Array(p.position.length*.5),P=0;P2){for(var B=!p.position[0].length,O=o.mallocFloat(this.count*2),L=0,N=0;L1?u.align[Re]:u.align[0]:u.align;if(typeof $e=="number")return $e;switch($e){case"right":case"end":return-ce;case"center":case"centre":case"middle":return-ce*.5}return 0})),this.baseline==null&&p.baseline==null&&(p.baseline=0),p.baseline!=null&&(this.baseline=p.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map(function(ce,Re){var $e=(u.font[Re]||u.font[0]).metrics,rt=0;return rt+=$e.bottom*.5,typeof ce=="number"?rt+=ce-$e.baseline:rt+=-$e[ce],rt*=-1,rt})),p.color!=null)if(p.color||(p.color="transparent"),typeof p.color=="string"||!isNaN(p.color))this.color=t(p.color,"uint8");else{var Fe;if(typeof p.color[0]=="number"&&p.color.length>this.counts.length){var Ce=p.color.length;Fe=o.mallocUint8(Ce);for(var qe=(p.color.subarray||p.color.slice).bind(p.color),et=0;et4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2;if(Xe){var Me=Math.max(this.position.length*.5||0,this.color.length*.25||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,this.positionOffset.length*.5||0);this.batch=Array(Me);for(var xe=0;xe1?this.counts[xe]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[xe]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(xe*4,xe*4+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[xe]:this.opacity,baseline:this.baselineOffset[xe]!=null?this.baselineOffset[xe]:this.baselineOffset[0],align:this.align?this.alignOffset[xe]!=null?this.alignOffset[xe]:this.alignOffset[0]:0,atlas:this.fontAtlas[xe]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(xe*2,xe*2+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={};function _(w){return typeof w=="function"&&w._gl&&w.prop&&w.texture&&w.buffer}G.exports=M}}),ax=He({"src/lib/prepare_regl.js"(Y,G){var d=I3(),x=xT();G.exports=function(E,e,t){var r=E._fullLayout,o=!0;return r._glcanvas.each(function(a){if(a.regl){a.regl.preloadCachedCode(t);return}if(!(a.pick&&!r._has("parcoords"))){try{a.regl=x({canvas:this,attributes:{antialias:!a.pick,preserveDrawingBuffer:!0},pixelRatio:E._context.plotGlPixelRatio||window.devicePixelRatio,extensions:e||[],cachedCode:t||{}})}catch{o=!1}a.regl||(o=!1),o&&this.addEventListener("webglcontextlost",function(i){E&&E.emit&&E.emit("plotly_webglcontextlost",{event:i,layer:a.key})},!1)}}),o||d({container:r._glcontainer.node()}),o}}}),TT=He({"src/traces/scattergl/plot.js"(c,G){var d=eT(),x=hT(),A=G6(),E=oI(),e=Gr(),t=bv().selectMode,r=ax(),o=Rl(),a=Kb(),i=J3().styleTextSelection,n={};function s(f,v,h,T){var l=f._size,y=f.width*T,b=f.height*T,S=l.l*T,M=l.b*T,_=l.r*T,w=l.t*T,p=l.w*T,u=l.h*T;return[S+v.domain[0]*p,M+h.domain[0]*u,y-_-(1-v.domain[1])*p,b-w-(1-h.domain[1])*u]}var c=G.exports=function(v,h,T){if(T.length){var l=v._fullLayout,y=h._scene,b=h.xaxis,S=h.yaxis,M,_;if(y){var w=r(v,["ANGLE_instanced_arrays","OES_element_index_uint"],n);if(!w){y.init();return}var p=y.count,u=l._glcanvas.data()[0].regl;if(a(v,h,T),y.dirty){if((y.line2d||y.error2d)&&!(y.scatter2d||y.fill2d||y.glText)&&u.clear({}),y.error2d===!0&&(y.error2d=A(u)),y.line2d===!0&&(y.line2d=x(u)),y.scatter2d===!0&&(y.scatter2d=d(u)),y.fill2d===!0&&(y.fill2d=x(u)),y.glText===!0)for(y.glText=new Array(p),M=0;My.glText.length){var g=p-y.glText.length;for(M=0;Mie&&(isNaN(ae[fe])||isNaN(ae[fe+1]));)fe-=2;q.positions=ae.slice(ie,fe+2)}return q}),y.line2d.update(y.lineOptions)),y.error2d){var P=(y.errorXOptions||[]).concat(y.errorYOptions||[]);y.error2d.update(P)}y.scatter2d&&y.scatter2d.update(y.markerOptions),y.fillOrder=e.repeat(null,p),y.fill2d&&(y.fillOptions=y.fillOptions.map(function(q,ae){var ie=T[ae];if(!(!q||!ie||!ie[0]||!ie[0].trace)){var fe=ie[0],we=fe.trace,Ae=fe.t,Fe=y.lineOptions[ae],Ce,qe,et=[];we._ownfill&&et.push(ae),we._nexttrace&&et.push(ae+1),et.length&&(y.fillOrder[ae]=et);var Qe=[],Ke=Fe&&Fe.positions||Ae.positions,Xe,Me;if(we.fill==="tozeroy"){for(Xe=0;XeXe&&isNaN(Ke[Me+1]);)Me-=2;Ke[Xe+1]!==0&&(Qe=[Ke[Xe],0]),Qe=Qe.concat(Ke.slice(Xe,Me+2)),Ke[Me+1]!==0&&(Qe=Qe.concat([Ke[Me],0]))}else if(we.fill==="tozerox"){for(Xe=0;XeXe&&isNaN(Ke[Me]);)Me-=2;Ke[Xe]!==0&&(Qe=[0,Ke[Xe+1]]),Qe=Qe.concat(Ke.slice(Xe,Me+2)),Ke[Me]!==0&&(Qe=Qe.concat([0,Ke[Me+1]]))}else if(we.fill==="toself"||we.fill==="tonext"){for(Qe=[],Ce=0,q.splitNull=!0,qe=0;qe-1;for(M=0;Mb&&h||yi,m;for(g?m=h.sizeAvg||Math.max(h.size,3):m=A(c,v),S=0;S{this.draw(),this.dirty=!0,this.planned=null})):(this.draw(),this.dirty=!0,E(()=>{this.dirty=!1})),this)},o.prototype.update=function(...s){if(!s.length)return;for(let v=0;vm||!h.lower&&g{c[T+y]=v})}this.scatter.draw(...c)}return this},o.prototype.destroy=function(){return this.traces.forEach(s=>{s.buffer&&s.buffer.destroy&&s.buffer.destroy()}),this.traces=null,this.passes=null,this.scatter.destroy(),this};function a(s,c,f){let v=s.id!=null?s.id:s,h=c,T=f;return v<<16|(h&255)<<8|T&255}function i(s,c,f){let v,h,T,l,y=s[c],b=s[f];return y.length>2?(y[0],y[2],v=y[1],h=y[3]):y.length?(v=y[0],h=y[1]):(y.x,v=y.y,y.x+y.width,h=y.y+y.height),b.length>2?(T=b[0],l=b[2],b[1],b[3]):b.length?(T=b[0],l=b[1]):(T=b.x,b.y,l=b.x+b.width,b.y+b.height),[T,v,l,h]}function n(s){if(typeof s=="number")return[s,s,s,s];if(s.length===2)return[s[0],s[1],s[0],s[1]];{let c=t(s);return[c.x,c.y,c.x+c.width,c.y+c.height]}}}}),gI=He({"src/traces/splom/plot.js"(Y,G){var d=pI(),x=Gr(),A=oc(),E=bv().selectMode;G.exports=function(r,o,a){if(a.length)for(var i=0;i-1,B=E(h)||!!i.selectedpoints||F,O=!0;if(B){var L=i._length;if(i.selectedpoints){s.selectBatch=i.selectedpoints;var N=i.selectedpoints,U={};for(y=0;y=Z[Q][0]&&U<=Z[Q][1])return!0;return!1}function c(U){U.attr("x",-d.bar.captureWidth/2).attr("width",d.bar.captureWidth)}function f(U){U.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function v(U){if(!U.brush.filterSpecified)return"0,"+U.height;for(var Z=h(U.brush.filter.getConsolidated(),U.height),Q=[0],ue,oe,le,j=Z.length?Z[0][0]:null,J=0;JU[1]+Q||Z=.9*U[1]+.1*U[0]?"n":Z<=.9*U[0]+.1*U[1]?"s":"ns"}function l(){x.select(document.body).style("cursor",null)}function y(U){U.attr("stroke-dasharray",v)}function b(U,Z){var Q=x.select(U).selectAll(".highlight, .highlight-shadow"),ue=Z?Q.transition().duration(d.bar.snapDuration).each("end",Z):Q;y(ue)}function S(U,Z){var Q=U.brush,ue=Q.filterSpecified,oe=NaN,le={},j;if(ue){var J=U.height,$=Q.filter.getConsolidated(),X=h($,J),re=NaN,ee=NaN,q=NaN;for(j=0;j<=X.length;j++){var ae=X[j];if(ae&&ae[0]<=Z&&Z<=ae[1]){re=j;break}else if(ee=j?j-1:NaN,ae&&ae[0]>Z){q=j;break}}if(oe=re,isNaN(oe)&&(isNaN(ee)||isNaN(q)?oe=isNaN(ee)?q:ee:oe=Z-X[ee][1]=Fe[0]&&Ae<=Fe[1]){le.clickableOrdinalRange=Fe;break}}}return le}function M(U,Z){x.event.sourceEvent.stopPropagation();var Q=Z.height-x.mouse(U)[1]-2*d.verticalPadding,ue=Z.unitToPaddedPx.invert(Q),oe=Z.brush,le=S(Z,Q),j=le.interval,J=oe.svgBrush;if(J.wasDragged=!1,J.grabbingBar=le.region==="ns",J.grabbingBar){var $=j.map(Z.unitToPaddedPx);J.grabPoint=Q-$[0]-d.verticalPadding,J.barLength=$[1]-$[0]}J.clickableOrdinalRange=le.clickableOrdinalRange,J.stayingIntervals=Z.multiselect&&oe.filterSpecified?oe.filter.getConsolidated():[],j&&(J.stayingIntervals=J.stayingIntervals.filter(function(X){return X[0]!==j[0]&&X[1]!==j[1]})),J.startExtent=le.region?j[le.region==="s"?1:0]:ue,Z.parent.inBrushDrag=!0,J.brushStartCallback()}function _(U,Z){x.event.sourceEvent.stopPropagation();var Q=Z.height-x.mouse(U)[1]-2*d.verticalPadding,ue=Z.brush.svgBrush;ue.wasDragged=!0,ue._dragging=!0,ue.grabbingBar?ue.newExtent=[Q-ue.grabPoint,Q+ue.barLength-ue.grabPoint].map(Z.unitToPaddedPx.invert):ue.newExtent=[ue.startExtent,Z.unitToPaddedPx.invert(Q)].sort(e),Z.brush.filterSpecified=!0,ue.extent=ue.stayingIntervals.concat([ue.newExtent]),ue.brushCallback(Z),b(U.parentNode)}function w(U,Z){var Q=Z.brush,ue=Q.filter,oe=Q.svgBrush;oe._dragging||(p(U,Z),_(U,Z),Z.brush.svgBrush.wasDragged=!1),oe._dragging=!1;var le=x.event;le.sourceEvent.stopPropagation();var j=oe.grabbingBar;if(oe.grabbingBar=!1,oe.grabLocation=void 0,Z.parent.inBrushDrag=!1,l(),!oe.wasDragged){oe.wasDragged=void 0,oe.clickableOrdinalRange?Q.filterSpecified&&Z.multiselect?oe.extent.push(oe.clickableOrdinalRange):(oe.extent=[oe.clickableOrdinalRange],Q.filterSpecified=!0):j?(oe.extent=oe.stayingIntervals,oe.extent.length===0&&z(Q)):z(Q),oe.brushCallback(Z),b(U.parentNode),oe.brushEndCallback(Q.filterSpecified?ue.getConsolidated():[]);return}var J=function(){ue.set(ue.getConsolidated())};if(Z.ordinal){var $=Z.unitTickvals;$[$.length-1]<$[0]&&$.reverse(),oe.newExtent=[n(0,$,oe.newExtent[0],oe.stayingIntervals),n(1,$,oe.newExtent[1],oe.stayingIntervals)];var X=oe.newExtent[1]>oe.newExtent[0];oe.extent=oe.stayingIntervals.concat(X?[oe.newExtent]:[]),oe.extent.length||z(Q),oe.brushCallback(Z),X?b(U.parentNode,J):(J(),b(U.parentNode))}else J();oe.brushEndCallback(Q.filterSpecified?ue.getConsolidated():[])}function p(U,Z){var Q=Z.height-x.mouse(U)[1]-2*d.verticalPadding,ue=S(Z,Q),oe="crosshair";ue.clickableOrdinalRange?oe="pointer":ue.region&&(oe=ue.region+"-resize"),x.select(document.body).style("cursor",oe)}function u(U){U.on("mousemove",function(Z){x.event.preventDefault(),Z.parent.inBrushDrag||p(this,Z)}).on("mouseleave",function(Z){Z.parent.inBrushDrag||l()}).call(x.behavior.drag().on("dragstart",function(Z){M(this,Z)}).on("drag",function(Z){_(this,Z)}).on("dragend",function(Z){w(this,Z)}))}function g(U,Z){return U[0]-Z[0]}function m(U,Z,Q){var ue=Q._context.staticPlot,oe=U.selectAll(".background").data(E);oe.enter().append("rect").classed("background",!0).call(c).call(f).style("pointer-events",ue?"none":"auto").attr("transform",t(0,d.verticalPadding)),oe.call(u).attr("height",function(J){return J.height-d.verticalPadding});var le=U.selectAll(".highlight-shadow").data(E);le.enter().append("line").classed("highlight-shadow",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width+d.bar.strokeWidth).attr("stroke",Z).attr("opacity",d.bar.strokeOpacity).attr("stroke-linecap","butt"),le.attr("y1",function(J){return J.height}).call(y);var j=U.selectAll(".highlight").data(E);j.enter().append("line").classed("highlight",!0).attr("x",-d.bar.width/2).attr("stroke-width",d.bar.width-d.bar.strokeWidth).attr("stroke",d.bar.fillColor).attr("opacity",d.bar.fillOpacity).attr("stroke-linecap","butt"),j.attr("y1",function(J){return J.height}).call(y)}function R(U,Z,Q){var ue=U.selectAll("."+d.cn.axisBrush).data(E,A);ue.enter().append("g").classed(d.cn.axisBrush,!0),m(ue,Z,Q)}function P(U){return U.svgBrush.extent.map(function(Z){return Z.slice()})}function z(U){U.filterSpecified=!1,U.svgBrush.extent=[[-1/0,1/0]]}function F(U){return function(Q){var ue=Q.brush,oe=P(ue),le=oe.slice();ue.filter.set(le),U()}}function B(U){for(var Z=U.slice(),Q=[],ue,oe=Z.shift();oe;){for(ue=oe.slice();(oe=Z.shift())&&oe[0]<=ue[1];)ue[1]=Math.max(ue[1],oe[1]);Q.push(ue)}return Q.length===1&&Q[0][0]>Q[0][1]&&(Q=[]),Q}function O(){var U=[],Z,Q;return{set:function(ue){U=ue.map(function(oe){return oe.slice().sort(e)}).sort(g),U.length===1&&U[0][0]===-1/0&&U[0][1]===1/0&&(U=[[0,-1]]),Z=B(U),Q=U.reduce(function(oe,le){return[Math.min(oe[0],le[0]),Math.max(oe[1],le[1])]},[1/0,-1/0])},get:function(){return U.slice()},getConsolidated:function(){return Z},getBounds:function(){return Q}}}function L(U,Z,Q,ue,oe,le){var j=O();return j.set(Q),{filter:j,filterSpecified:Z,svgBrush:{extent:[],brushStartCallback:ue,brushCallback:F(oe),brushEndCallback:le}}}function N(U,Z){if(Array.isArray(U[0])?(U=U.map(function(ue){return ue.sort(e)}),Z.multiselect?U=B(U.sort(g)):U=[U[0]]):U=[U.sort(e)],Z.tickvals){var Q=Z.tickvals.slice().sort(e);if(U=U.map(function(ue){var oe=[n(0,Q,ue[0],[]),n(1,Q,ue[1],[])];if(oe[1]>oe[0])return oe}).filter(function(ue){return ue}),!U.length)return}return U.length>1?U:U[0]}G.exports={makeBrush:L,ensureAxisBrush:R,cleanRanges:N}}}),AI=He({"src/traces/parcoords/defaults.js"(Y,G){var d=Gr(),x=Ah().hasColorscale,A=pf(),E=mu().defaults,e=rh(),t=io(),r=MT(),o=ET(),a=Zy().maxDimensionCount,i=nx();function n(c,f,v,h,T){var l=T("line.color",v);if(x(c,"line")&&d.isArrayOrTypedArray(l)){if(l.length)return T("line.colorscale"),A(c,f,h,T,{prefix:"line.",cLetter:"c"}),l.length;f.line.color=v}return 1/0}function s(c,f,v,h){function T(M,_){return d.coerce(c,f,r.dimensions,M,_)}var l=T("values"),y=T("visible");if(l&&l.length||(y=f.visible=!1),y){T("label"),T("tickvals"),T("ticktext"),T("tickformat");var b=T("range");f._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:b},t.setConvert(f._ax,h.layout),T("multiselect");var S=T("constraintrange");S&&(f.constraintrange=o.cleanRanges(S,f))}}G.exports=function(f,v,h,T){function l(_,w){return d.coerce(f,v,r,_,w)}var y=f.dimensions;Array.isArray(y)&&y.length>a&&(d.log("parcoords traces support up to "+a+" dimensions at the moment"),y.splice(a));var b=e(f,v,{name:"dimensions",layout:T,handleItemDefaults:s}),S=n(f,v,h,T,l);E(v,T,l),(!Array.isArray(b)||!b.length)&&(v.visible=!1),i(v,b,"values",S);var M=d.extendFlat({},T.font,{size:Math.round(T.font.size/1.2)});d.coerceFont(l,"labelfont",M),d.coerceFont(l,"tickfont",M,{autoShadowDflt:!0}),d.coerceFont(l,"rangefont",M),l("labelangle"),l("labelside"),l("unselected.line.color"),l("unselected.line.opacity")}}}),SI=He({"src/traces/parcoords/calc.js"(Y,G){var d=Gr().isArrayOrTypedArray,x=Kl(),A=Wv().wrap;G.exports=function(t,r){var o,a;return x.hasColorscale(r,"line")&&d(r.line.color)?(o=r.line.color,a=x.extractOpts(r.line).colorscale,x.calc(t,r,{vals:o,containerStr:"line",cLetter:"c"})):(o=E(r._length),a=[[0,r.line.color],[1,r.line.color]]),A({lineColor:o,cscale:a})};function E(e){for(var t=new Array(e),r=0;r>>16,(Y&65280)>>>8,Y&255],alpha:1};if(typeof Y=="number")return{space:"rgb",values:[Y>>>16,(Y&65280)>>>8,Y&255],alpha:1};if(Y=String(Y).toLowerCase(),ix.default[Y])A=ix.default[Y].slice(),e="rgb";else if(Y==="transparent")E=0,e="rgb",A=[0,0,0];else if(Y[0]==="#"){var t=Y.slice(1),r=t.length,o=r<=4;E=1,o?(A=[parseInt(t[0]+t[0],16),parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16)],r===4&&(E=parseInt(t[3]+t[3],16)/255)):(A=[parseInt(t[0]+t[1],16),parseInt(t[2]+t[3],16),parseInt(t[4]+t[5],16)],r===8&&(E=parseInt(t[6]+t[7],16)/255)),A[0]||(A[0]=0),A[1]||(A[1]=0),A[2]||(A[2]=0),e="rgb"}else if(x=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(Y)){var a=x[1];e=a.replace(/a$/,"");var i=e==="cmyk"?4:e==="gray"?1:3;A=x[2].trim().split(/\s*[,\/]\s*|\s+/),e==="color"&&(e=A.shift()),A=A.map(function(n,s){if(n[n.length-1]==="%")return n=parseFloat(n)/100,s===3?n:e==="rgb"?n*255:e[0]==="h"||e[0]==="l"&&!s?n*100:e==="lab"?n*125:e==="lch"?s<2?n*150:n*360:e[0]==="o"&&!s?n:e==="oklab"?n*.4:e==="oklch"?s<2?n*.4:n*360:n;if(e[s]==="h"||s===2&&e[e.length-1]==="h"){if(ox[n]!==void 0)return ox[n];if(n.endsWith("deg"))return parseFloat(n);if(n.endsWith("turn"))return parseFloat(n)*360;if(n.endsWith("grad"))return parseFloat(n)*360/400;if(n.endsWith("rad"))return parseFloat(n)*180/Math.PI}return n==="none"?0:parseFloat(n)}),E=A.length>i?A.pop():1}else/[0-9](?:\s|\/|,)/.test(Y)&&(A=Y.match(/([0-9]+)/g).map(function(n){return parseFloat(n)}),e=((d=(G=Y.match(/([a-z])/ig))==null?void 0:G.join(""))==null?void 0:d.toLowerCase())||"rgb");return{space:e,values:A,alpha:E}}var ix,kT,ox,EI=ks({"node_modules/color-parse/index.js"(){ix=Zm(C3()),kT=MI,ox={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Xy,CT=ks({"node_modules/color-space/rgb.js"(){Xy={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),Yy,kI=ks({"node_modules/color-space/hsl.js"(){CT(),Yy={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(Y){var G=Y[0]/360,d=Y[1]/100,x=Y[2]/100,A,E,e,t,r,o=0;if(d===0)return r=x*255,[r,r,r];for(E=x<.5?x*(1+d):x+d-x*d,A=2*x-E,t=[0,0,0];o<3;)e=G+1/3*-(o-1),e<0?e++:e>1&&e--,r=6*e<1?A+(E-A)*6*e:2*e<1?E:3*e<2?A+(E-A)*(2/3-e)*6:A,t[o++]=r*255;return t}},Xy.hsl=function(Y){var G=Y[0]/255,d=Y[1]/255,x=Y[2]/255,A=Math.min(G,d,x),E=Math.max(G,d,x),e=E-A,t,r,o;return E===A?t=0:G===E?t=(d-x)/e:d===E?t=2+(x-G)/e:x===E&&(t=4+(G-d)/e),t=Math.min(t*60,360),t<0&&(t+=360),o=(A+E)/2,E===A?r=0:o<=.5?r=e/(E+A):r=e/(2-E-A),[t,r*100,o*100]}}}),LT={};L0(LT,{default:()=>CI});function CI(Y){Array.isArray(Y)&&Y.raw&&(Y=String.raw(...arguments)),Y instanceof Number&&(Y=+Y);var G,d=kT(Y);if(!d.space)return[];const x=d.space[0]==="h"?Yy.min:Xy.min,A=d.space[0]==="h"?Yy.max:Xy.max;return G=Array(3),G[0]=Math.min(Math.max(d.values[0],x[0]),A[0]),G[1]=Math.min(Math.max(d.values[1],x[1]),A[1]),G[2]=Math.min(Math.max(d.values[2],x[2]),A[2]),d.space[0]==="h"&&(G=Yy.rgb(G)),G.push(Math.min(Math.max(d.alpha,0),1)),G}var LI=ks({"node_modules/color-rgba/index.js"(){EI(),CT(),kI()}}),PT=He({"src/traces/parcoords/helpers.js"(Y){var G=Gr().isTypedArray;Y.convertTypedArray=function(d){return G(d)?Array.prototype.slice.call(d):d},Y.isOrdinal=function(d){return!!d.tickvals},Y.isVisible=function(d){return d.visible||!("visible"in d)}}}),PI=He({"src/traces/parcoords/lines.js"(Y,G){var d=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join(` +`),x=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join(` +`),A=Zy().maxDimensionCount,E=Gr(),e=1e-6,t=2048,r=new Uint8Array(4),o=new Uint8Array(4),a={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function i(w){w.read({x:0,y:0,width:1,height:1,data:r})}function n(w,p,u,g,m){var R=w._gl;R.enable(R.SCISSOR_TEST),R.scissor(p,u,g,m),w.clear({color:[0,0,0,0],depth:1})}function s(w,p,u,g,m,R){var P=R.key;function z(F){var B=Math.min(g,m-F*g);F===0&&(window.cancelAnimationFrame(u.currentRafs[P]),delete u.currentRafs[P],n(w,R.scissorX,R.scissorY,R.scissorWidth,R.viewBoxSize[1])),!u.clearOnly&&(R.count=2*B,R.offset=2*F*g,p(R),F*g+B>>8*p)%256/255}function h(w,p,u){for(var g=new Array(w*(A+4)),m=0,R=0;RCe&&(Ce=ee[fe].dim1.canvasX,Ae=fe);ie===0&&n(m,0,0,B.canvasWidth,B.canvasHeight);var qe=j(u);for(fe=0;fefe._length&&(Xe=Xe.slice(0,fe._length));var Me=fe.tickvals,xe;function ce(At,St){return{val:At,text:xe[St]}}function Re(At,St){return At.val-St.val}if(A(Me)&&Me.length){x.isTypedArray(Me)&&(Me=Array.from(Me)),xe=fe.ticktext,!A(xe)||!xe.length?xe=Me.map(E(fe.tickformat)):xe.length>Me.length?xe=xe.slice(0,Me.length):Me.length>xe.length&&(Me=Me.slice(0,xe.length));for(var $e=1;$e=St||ar>=Rt)return;var Mr=Je.lineLayer.readPixel(ir,Rt-1-ar),fr=Mr[3]!==0,dr=fr?Mr[2]+256*(Mr[1]+256*Mr[0]):null,pt={x:ir,y:ar,clientX:At.clientX,clientY:At.clientY,dataIndex:Je.model.key,curveNumber:dr};dr!==Ae&&(fr?J.hover(pt):J.unhover&&J.unhover(pt),Ae=dr)}}),we.style("opacity",function(Je){return Je.pick?0:1}),re.style("background","rgba(255, 255, 255, 0)");var Ce=re.selectAll("."+T.cn.parcoords).data(fe,c);Ce.exit().remove(),Ce.enter().append("g").classed(T.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),Ce.attr("transform",function(Je){return o(Je.model.translateX,Je.model.translateY)});var qe=Ce.selectAll("."+T.cn.parcoordsControlView).data(f,c);qe.enter().append("g").classed(T.cn.parcoordsControlView,!0),qe.attr("transform",function(Je){return o(Je.model.pad.l,Je.model.pad.t)});var et=qe.selectAll("."+T.cn.yAxis).data(function(Je){return Je.dimensions},c);et.enter().append("g").classed(T.cn.yAxis,!0),qe.each(function(Je){N(et,Je,q)}),we.each(function(Je){if(Je.viewModel){!Je.lineLayer||J?Je.lineLayer=y(this,Je):Je.lineLayer.update(Je),(Je.key||Je.key===0)&&(Je.viewModel[Je.key]=Je.lineLayer);var At=!Je.context||J;Je.lineLayer.render(Je.viewModel.panels,At)}}),et.attr("transform",function(Je){return o(Je.xScale(Je.xIndex),0)}),et.call(d.behavior.drag().origin(function(Je){return Je}).on("drag",function(Je){var At=Je.parent;ie.linePickActive(!1),Je.x=Math.max(-T.overdrag,Math.min(Je.model.width+T.overdrag,d.event.x)),Je.canvasX=Je.x*Je.model.canvasPixelRatio,et.sort(function(St,Rt){return St.x-Rt.x}).each(function(St,Rt){St.xIndex=Rt,St.x=Je===St?St.x:St.xScale(St.xIndex),St.canvasX=St.x*St.model.canvasPixelRatio}),N(et,At,q),et.filter(function(St){return Math.abs(Je.xIndex-St.xIndex)!==0}).attr("transform",function(St){return o(St.xScale(St.xIndex),0)}),d.select(this).attr("transform",o(Je.x,0)),et.each(function(St,Rt,Ut){Ut===Je.parent.key&&(At.dimensions[Rt]=St)}),At.contextLayer&&At.contextLayer.render(At.panels,!1,!P(At)),At.focusLayer.render&&At.focusLayer.render(At.panels)}).on("dragend",function(Je){var At=Je.parent;Je.x=Je.xScale(Je.xIndex),Je.canvasX=Je.x*Je.model.canvasPixelRatio,N(et,At,q),d.select(this).attr("transform",function(St){return o(St.x,0)}),At.contextLayer&&At.contextLayer.render(At.panels,!1,!P(At)),At.focusLayer&&At.focusLayer.render(At.panels),At.pickLayer&&At.pickLayer.render(At.panels,!0),ie.linePickActive(!0),J&&J.axesMoved&&J.axesMoved(At.key,At.dimensions.map(function(St){return St.crossfilterDimensionIndex}))})),et.exit().remove();var Qe=et.selectAll("."+T.cn.axisOverlays).data(f,c);Qe.enter().append("g").classed(T.cn.axisOverlays,!0),Qe.selectAll("."+T.cn.axis).remove();var Ke=Qe.selectAll("."+T.cn.axis).data(f,c);Ke.enter().append("g").classed(T.cn.axis,!0),Ke.each(function(Je){var At=Je.model.height/Je.model.tickDistance,St=Je.domainScale,Rt=St.domain();d.select(this).call(d.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(At,Je.tickFormat).tickValues(Je.ordinal?Rt:null).tickFormat(function(Ut){return h.isOrdinal(Je)?Ut:Z(Je.model.dimensions[Je.visibleIndex],Ut)}).scale(St)),i.font(Ke.selectAll("text"),Je.model.tickFont)}),Ke.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),Ke.selectAll("text").style("cursor","default");var Xe=Qe.selectAll("."+T.cn.axisHeading).data(f,c);Xe.enter().append("g").classed(T.cn.axisHeading,!0);var Me=Xe.selectAll("."+T.cn.axisTitle).data(f,c);Me.enter().append("text").classed(T.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",$?"none":"auto"),Me.text(function(Je){return Je.label}).each(function(Je){var At=d.select(this);i.font(At,Je.model.labelFont),a.convertToTspans(At,oe)}).attr("transform",function(Je){var At=L(Je.model.labelAngle,Je.model.labelSide),St=T.axisTitleOffset;return(At.dir>0?"":o(0,2*St+Je.model.height))+r(At.degrees)+o(-St*At.dx,-St*At.dy)}).attr("text-anchor",function(Je){var At=L(Je.model.labelAngle,Je.model.labelSide),St=Math.abs(At.dx),Rt=Math.abs(At.dy);return 2*St>Rt?At.dir*At.dx<0?"start":"end":"middle"});var xe=Qe.selectAll("."+T.cn.axisExtent).data(f,c);xe.enter().append("g").classed(T.cn.axisExtent,!0);var ce=xe.selectAll("."+T.cn.axisExtentTop).data(f,c);ce.enter().append("g").classed(T.cn.axisExtentTop,!0),ce.attr("transform",o(0,-T.axisExtentOffset));var Re=ce.selectAll("."+T.cn.axisExtentTopText).data(f,c);Re.enter().append("text").classed(T.cn.axisExtentTopText,!0).call(B),Re.text(function(Je){return Q(Je,!0)}).each(function(Je){i.font(d.select(this),Je.model.rangeFont)});var $e=xe.selectAll("."+T.cn.axisExtentBottom).data(f,c);$e.enter().append("g").classed(T.cn.axisExtentBottom,!0),$e.attr("transform",function(Je){return o(0,Je.model.height+T.axisExtentOffset)});var rt=$e.selectAll("."+T.cn.axisExtentBottomText).data(f,c);rt.enter().append("text").classed(T.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(B),rt.text(function(Je){return Q(Je,!1)}).each(function(Je){i.font(d.select(this),Je.model.rangeFont)}),l.ensureAxisBrush(Qe,ae,oe)}}}),IT=He({"src/traces/parcoords/plot.js"(r,G){var d=II(),x=ax(),A=PT().isVisible,E={};function e(o,a,i){var n=a.indexOf(i),s=o.indexOf(n);return s===-1&&(s+=a.length),s}function t(o,a){return function(n,s){return e(o,a,n)-e(o,a,s)}}var r=G.exports=function(a,i){var n=a._fullLayout,s=x(a,[],E);if(s){var c={},f={},v={},h={},T=n._size;i.forEach(function(M,_){var w=M[0].trace;v[_]=w.index;var p=h[_]=w.index;c[_]=a.data[p].dimensions,f[_]=a.data[p].dimensions.slice()});var l=function(M,_,w){var p=f[M][_],u=w.map(function(F){return F.slice()}),g="dimensions["+_+"].constraintrange",m=n._tracePreGUI[a._fullData[v[M]]._fullInput.uid];if(m[g]===void 0){var R=p.constraintrange;m[g]=R||null}var P=a._fullData[v[M]].dimensions[_];u.length?(u.length===1&&(u=u[0]),p.constraintrange=u,P.constraintrange=u.slice(),u=[u]):(delete p.constraintrange,delete P.constraintrange,u=null);var z={};z[g]=u,a.emit("plotly_restyle",[z,[h[M]]])},y=function(M){a.emit("plotly_hover",M)},b=function(M){a.emit("plotly_unhover",M)},S=function(M,_){var w=t(_,f[M].filter(A));c[M].sort(w),f[M].filter(function(p){return!A(p)}).sort(function(p){return f[M].indexOf(p)}).forEach(function(p){c[M].splice(c[M].indexOf(p),1),c[M].splice(f[M].indexOf(p),0,p)}),a.emit("plotly_restyle",[{dimensions:[c[M]]},[h[M]]])};d(a,i,{width:T.w,height:T.h,margin:{t:T.t,r:T.r,b:T.b,l:T.l}},{filterChanged:l,hover:y,unhover:b,axesMoved:S})}};r.reglPrecompiled=E}}),RI=He({"src/traces/parcoords/base_plot.js"(Y){var G=Qn(),d=Uf().getModuleCalcData,x=IT(),A=Yh();Y.name="parcoords",Y.plot=function(E){var e=d(E.calcdata,"parcoords")[0];e.length&&x(E,e)},Y.clean=function(E,e,t,r){var o=r._has&&r._has("parcoords"),a=e._has&&e._has("parcoords");o&&!a&&(r._paperdiv.selectAll(".parcoords").remove(),r._glimages.selectAll("*").remove())},Y.toSVG=function(E){var e=E._fullLayout._glimages,t=G.select(E).selectAll(".svg-container"),r=t.filter(function(a,i){return i===t.size()-1}).selectAll(".gl-canvas-context, .gl-canvas-focus");function o(){var a=this,i=a.toDataURL("image/png"),n=e.append("svg:image");n.attr({xmlns:A.svg,"xlink:href":i,preserveAspectRatio:"none",x:0,y:0,width:a.style.width,height:a.style.height})}r.each(o),window.setTimeout(function(){G.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}}}),DI=He({"src/traces/parcoords/base_index.js"(Y,G){G.exports={attributes:MT(),supplyDefaults:AI(),calc:SI(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:RI(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),zI=He({"src/traces/parcoords/index.js"(Y,G){var d=DI();d.plot=IT(),G.exports=d}}),FI=He({"lib/parcoords.js"(Y,G){G.exports=zI()}}),RT=He({"src/traces/parcats/attributes.js"(Y,G){var d=ho().extendFlat,x=cl(),A=Yl(),E=kl(),e=Yo().hovertemplateAttrs,t=mu().attributes,r=d({editType:"calc"},E("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability"]})});G.exports={domain:t({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:d({},x.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:e({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:A({editType:"calc"}),tickfont:A({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:r,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),OI=He({"src/traces/parcats/defaults.js"(Y,G){var d=Gr(),x=Ah().hasColorscale,A=pf(),E=mu().defaults,e=rh(),t=RT(),r=nx(),o=ch().isTypedArraySpec;function a(n,s,c,f,v){v("line.shape"),v("line.hovertemplate");var h=v("line.color",f.colorway[0]);if(x(n,"line")&&d.isArrayOrTypedArray(h)){if(h.length)return v("line.colorscale"),A(n,s,f,v,{prefix:"line.",cLetter:"c"}),h.length;s.line.color=c}return 1/0}function i(n,s){function c(b,S){return d.coerce(n,s,t.dimensions,b,S)}var f=c("values"),v=c("visible");if(f&&f.length||(v=s.visible=!1),v){c("label"),c("displayindex",s._index);var h=n.categoryarray,T=d.isArrayOrTypedArray(h)&&h.length>0||o(h),l;T&&(l="array");var y=c("categoryorder",l);y==="array"?(c("categoryarray"),c("ticktext")):(delete n.categoryarray,delete n.ticktext),!T&&y==="array"&&(s.categoryorder="trace")}}G.exports=function(s,c,f,v){function h(b,S){return d.coerce(s,c,t,b,S)}var T=e(s,c,{name:"dimensions",handleItemDefaults:i}),l=a(s,c,f,v,h);E(c,v,h),(!Array.isArray(T)||!T.length)&&(c.visible=!1),r(c,T,"values",l),h("hoveron"),h("hovertemplate"),h("arrangement"),h("bundlecolors"),h("sortpaths"),h("counts");var y=v.font;d.coerceFont(h,"labelfont",y,{overrideDflt:{size:Math.round(y.size)}}),d.coerceFont(h,"tickfont",y,{autoShadowDflt:!0,overrideDflt:{size:Math.round(y.size/1.2)}})}}}),BI=He({"src/traces/parcats/calc.js"(Y,G){var d=Wv().wrap,x=Ah().hasColorscale,A=Sh(),E=gb(),e=vo(),t=Gr(),r=Hi();G.exports=function(y,b){var S=t.filterVisible(b.dimensions);if(S.length===0)return[];var M=S.map(function(j){var J;if(j.categoryorder==="trace")J=null;else if(j.categoryorder==="array")J=j.categoryarray;else{J=E(j.values);for(var $=!0,X=0;X=l.length||y[l[b]]!==void 0)return!1;y[l[b]]=!0}return!0}}}),NI=He({"src/traces/parcats/parcats.js"(Y,G){var d=Qn(),x=(Gp(),Go(tp)).interpolateNumber,A=f1(),E=Wu(),e=Gr(),t=e.strTranslate,r=vo(),o=Mf(),a=yl();function i(X,re,ee,q){var ae=re._context.staticPlot,ie=X.map(oe.bind(0,re,ee)),fe=q.selectAll("g.parcatslayer").data([null]);fe.enter().append("g").attr("class","parcatslayer").style("pointer-events",ae?"none":"all");var we=fe.selectAll("g.trace.parcats").data(ie,n),Ae=we.enter().append("g").attr("class","trace parcats");we.attr("transform",function(ce){return t(ce.x,ce.y)}),Ae.append("g").attr("class","paths");var Fe=we.select("g.paths"),Ce=Fe.selectAll("path.path").data(function(ce){return ce.paths},n);Ce.attr("fill",function(ce){return ce.model.color});var qe=Ce.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",function(ce){return ce.model.color}).attr("fill-opacity",0);y(qe),Ce.attr("d",function(ce){return ce.svgD}),qe.empty()||Ce.sort(c),Ce.exit().remove(),Ce.on("mouseover",f).on("mouseout",v).on("click",l),Ae.append("g").attr("class","dimensions");var et=we.select("g.dimensions"),Qe=et.selectAll("g.dimension").data(function(ce){return ce.dimensions},n);Qe.enter().append("g").attr("class","dimension"),Qe.attr("transform",function(ce){return t(ce.x,0)}),Qe.exit().remove();var Ke=Qe.selectAll("g.category").data(function(ce){return ce.categories},n),Xe=Ke.enter().append("g").attr("class","category");Ke.attr("transform",function(ce){return t(0,ce.y)}),Xe.append("rect").attr("class","catrect").attr("pointer-events","none"),Ke.select("rect.catrect").attr("fill","none").attr("width",function(ce){return ce.width}).attr("height",function(ce){return ce.height}),M(Xe);var Me=Ke.selectAll("rect.bandrect").data(function(ce){return ce.bands},n);Me.each(function(){e.raiseToTop(this)}),Me.attr("fill",function(ce){return ce.color});var xe=Me.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",function(ce){return ce.color}).attr("fill-opacity",0);Me.attr("fill",function(ce){return ce.color}).attr("width",function(ce){return ce.width}).attr("height",function(ce){return ce.height}).attr("y",function(ce){return ce.y}).attr("cursor",function(ce){return ce.parcatsViewModel.arrangement==="fixed"?"default":ce.parcatsViewModel.arrangement==="perpendicular"?"ns-resize":"move"}),w(xe),Me.exit().remove(),Xe.append("text").attr("class","catlabel").attr("pointer-events","none"),Ke.select("text.catlabel").attr("text-anchor",function(ce){return s(ce)?"start":"end"}).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",function(ce){return s(ce)?ce.width+5:-5}).attr("y",function(ce){return ce.height/2}).text(function(ce){return ce.model.categoryLabel}).each(function(ce){r.font(d.select(this),ce.parcatsViewModel.categorylabelfont),a.convertToTspans(d.select(this),re)}),Xe.append("text").attr("class","dimlabel"),Ke.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",function(ce){return ce.parcatsViewModel.arrangement==="fixed"?"default":"ew-resize"}).attr("x",function(ce){return ce.width/2}).attr("y",-5).text(function(ce,Re){return Re===0?ce.parcatsViewModel.model.dimensions[ce.model.dimensionInd].dimensionLabel:null}).each(function(ce){r.font(d.select(this),ce.parcatsViewModel.labelfont)}),Ke.selectAll("rect.bandrect").on("mouseover",B).on("mouseout",O),Ke.exit().remove(),Qe.call(d.behavior.drag().origin(function(ce){return{x:ce.x,y:0}}).on("dragstart",L).on("drag",N).on("dragend",U)),we.each(function(ce){ce.traceSelection=d.select(this),ce.pathSelection=d.select(this).selectAll("g.paths").selectAll("path.path"),ce.dimensionSelection=d.select(this).selectAll("g.dimensions").selectAll("g.dimension")}),we.exit().remove()}G.exports=function(X,re,ee,q){i(ee,X,q,re)};function n(X){return X.key}function s(X){var re=X.parcatsViewModel.dimensions.length,ee=X.parcatsViewModel.dimensions[re-1].model.dimensionInd;return X.model.dimensionInd===ee}function c(X,re){return X.model.rawColor>re.model.rawColor?1:X.model.rawColor"),Je=d.mouse(ae)[0];E.loneHover({trace:ie,x:Ke-we.left+Ae.left,y:Xe-we.top+Ae.top,text:rt,color:X.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:Me,idealAlign:Je1&&Fe.displayInd===Ae.dimensions.length-1?(et=fe.left,Qe="left"):(et=fe.left+fe.width,Qe="right");var Ke=we.model.count,Xe=we.model.categoryLabel,Me=Ke/we.parcatsViewModel.model.count,xe={countLabel:Ke,categoryLabel:Xe,probabilityLabel:Me.toFixed(3)},ce=[];we.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&ce.push(["Count:",xe.countLabel].join(" ")),we.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&ce.push(["P("+xe.categoryLabel+"):",xe.probabilityLabel].join(" "));var Re=ce.join("
");return{trace:Ce,x:q*(et-re.left),y:ae*(qe-re.top),text:Re,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:Qe,hovertemplate:Ce.hovertemplate,hovertemplateLabels:xe,eventData:[{data:Ce._input,fullData:Ce,count:Ke,category:Xe,probability:Me}]}}function z(X,re,ee){var q=[];return d.select(ee.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each(function(){var ae=this;q.push(P(X,re,ae))}),q}function F(X,re,ee){X._fullLayout._calcInverseTransform(X);var q=X._fullLayout._invScaleX,ae=X._fullLayout._invScaleY,ie=ee.getBoundingClientRect(),fe=d.select(ee).datum(),we=fe.categoryViewModel,Ae=we.parcatsViewModel,Fe=Ae.model.dimensions[we.model.dimensionInd],Ce=Ae.trace,qe=ie.y+ie.height/2,et,Qe;Ae.dimensions.length>1&&Fe.displayInd===Ae.dimensions.length-1?(et=ie.left,Qe="left"):(et=ie.left+ie.width,Qe="right");var Ke=we.model.categoryLabel,Xe=fe.parcatsViewModel.model.count,Me=0;fe.categoryViewModel.bands.forEach(function(Ut){Ut.color===fe.color&&(Me+=Ut.count)});var xe=we.model.count,ce=0;Ae.pathSelection.each(function(Ut){Ut.model.color===fe.color&&(ce+=Ut.model.count)});var Re=Me/Xe,$e=Me/ce,rt=Me/xe,Je={countLabel:Me,categoryLabel:Ke,probabilityLabel:Re.toFixed(3)},At=[];we.parcatsViewModel.hoverinfoItems.indexOf("count")!==-1&&At.push(["Count:",Je.countLabel].join(" ")),we.parcatsViewModel.hoverinfoItems.indexOf("probability")!==-1&&(At.push("P(color ∩ "+Ke+"): "+Je.probabilityLabel),At.push("P("+Ke+" | color): "+$e.toFixed(3)),At.push("P(color | "+Ke+"): "+rt.toFixed(3)));var St=At.join("
"),Rt=o.mostReadable(fe.color,["black","white"]);return{trace:Ce,x:q*(et-re.left),y:ae*(qe-re.top),text:St,color:fe.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:Rt,fontSize:10,idealAlign:Qe,hovertemplate:Ce.hovertemplate,hovertemplateLabels:Je,eventData:[{data:Ce._input,fullData:Ce,category:Ke,count:Xe,probability:Re,categorycount:xe,colorcount:ce,bandcolorcount:Me}]}}function B(X){if(!X.parcatsViewModel.dragDimension&&X.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1){var re=d.mouse(this)[1];if(re<-1)return;var ee=X.parcatsViewModel.graphDiv,q=ee._fullLayout,ae=q._paperdiv.node().getBoundingClientRect(),ie=X.parcatsViewModel.hoveron,fe=this;if(ie==="color"?(g(fe),R(fe,"plotly_hover",d.event)):(u(fe),m(fe,"plotly_hover",d.event)),X.parcatsViewModel.hoverinfoItems.indexOf("none")===-1){var we;ie==="category"?we=P(ee,ae,fe):ie==="color"?we=F(ee,ae,fe):ie==="dimension"&&(we=z(ee,ae,fe)),we&&E.loneHover(we,{container:q._hoverlayer.node(),outerContainer:q._paper.node(),gd:ee})}}}function O(X){var re=X.parcatsViewModel;if(!re.dragDimension&&(y(re.pathSelection),M(re.dimensionSelection.selectAll("g.category")),w(re.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),E.loneUnhover(re.graphDiv._fullLayout._hoverlayer.node()),re.pathSelection.sort(c),re.hoverinfoItems.indexOf("skip")===-1)){var ee=X.parcatsViewModel.hoveron,q=this;ee==="color"?R(q,"plotly_unhover",d.event):m(q,"plotly_unhover",d.event)}}function L(X){X.parcatsViewModel.arrangement!=="fixed"&&(X.dragDimensionDisplayInd=X.model.displayInd,X.initialDragDimensionDisplayInds=X.parcatsViewModel.model.dimensions.map(function(re){return re.displayInd}),X.dragHasMoved=!1,X.dragCategoryDisplayInd=null,d.select(this).selectAll("g.category").select("rect.catrect").each(function(re){var ee=d.mouse(this)[0],q=d.mouse(this)[1];-2<=ee&&ee<=re.width+2&&-2<=q&&q<=re.height+2&&(X.dragCategoryDisplayInd=re.model.displayInd,X.initialDragCategoryDisplayInds=X.model.categories.map(function(ae){return ae.displayInd}),re.model.dragY=re.y,e.raiseToTop(this.parentNode),d.select(this.parentNode).selectAll("rect.bandrect").each(function(ae){ae.yCe.y+Ce.height/2&&(ie.model.displayInd=Ce.model.displayInd,Ce.model.displayInd=we),X.dragCategoryDisplayInd=ie.model.displayInd}if(X.dragCategoryDisplayInd===null||X.parcatsViewModel.arrangement==="freeform"){ae.model.dragX=d.event.x;var qe=X.parcatsViewModel.dimensions[ee],et=X.parcatsViewModel.dimensions[q];qe!==void 0&&ae.model.dragXet.x&&(ae.model.displayInd=et.model.displayInd,et.model.displayInd=X.dragDimensionDisplayInd),X.dragDimensionDisplayInd=ae.model.displayInd}J(X.parcatsViewModel),j(X.parcatsViewModel),ue(X.parcatsViewModel),Q(X.parcatsViewModel)}}function U(X){if(X.parcatsViewModel.arrangement!=="fixed"&&X.dragDimensionDisplayInd!==null){d.select(this).selectAll("text").attr("font-weight","normal");var re={},ee=Z(X.parcatsViewModel),q=X.parcatsViewModel.model.dimensions.map(function(et){return et.displayInd}),ae=X.initialDragDimensionDisplayInds.some(function(et,Qe){return et!==q[Qe]});ae&&q.forEach(function(et,Qe){var Ke=X.parcatsViewModel.model.dimensions[Qe].containerInd;re["dimensions["+Ke+"].displayindex"]=et});var ie=!1;if(X.dragCategoryDisplayInd!==null){var fe=X.model.categories.map(function(et){return et.displayInd});if(ie=X.initialDragCategoryDisplayInds.some(function(et,Qe){return et!==fe[Qe]}),ie){var we=X.model.categories.slice().sort(function(et,Qe){return et.displayInd-Qe.displayInd}),Ae=we.map(function(et){return et.categoryValue}),Fe=we.map(function(et){return et.categoryLabel});re["dimensions["+X.model.containerInd+"].categoryarray"]=[Ae],re["dimensions["+X.model.containerInd+"].ticktext"]=[Fe],re["dimensions["+X.model.containerInd+"].categoryorder"]="array"}}if(X.parcatsViewModel.hoverinfoItems.indexOf("skip")===-1&&!X.dragHasMoved&&X.potentialClickBand&&(X.parcatsViewModel.hoveron==="color"?R(X.potentialClickBand,"plotly_click",d.event.sourceEvent):m(X.potentialClickBand,"plotly_click",d.event.sourceEvent)),X.model.dragX=null,X.dragCategoryDisplayInd!==null){var Ce=X.parcatsViewModel.dimensions[X.dragDimensionDisplayInd].categories[X.dragCategoryDisplayInd];Ce.model.dragY=null,X.dragCategoryDisplayInd=null}X.dragDimensionDisplayInd=null,X.parcatsViewModel.dragDimension=null,X.dragHasMoved=null,X.potentialClickBand=null,J(X.parcatsViewModel),j(X.parcatsViewModel);var qe=d.transition().duration(300).ease("cubic-in-out");qe.each(function(){ue(X.parcatsViewModel,!0),Q(X.parcatsViewModel,!0)}).each("end",function(){(ae||ie)&&A.restyle(X.parcatsViewModel.graphDiv,re,[ee])})}}function Z(X){for(var re,ee=X.graphDiv._fullData,q=0;q=0;Ae--)Fe+="C"+fe[Ae]+","+(re[Ae+1]+q)+" "+ie[Ae]+","+(re[Ae]+q)+" "+(X[Ae]+ee[Ae])+","+(re[Ae]+q),Fe+="l-"+ee[Ae]+",0 ";return Fe+="Z",Fe}function j(X){var re=X.dimensions,ee=X.model,q=re.map(function(Mr){return Mr.categories.map(function(fr){return fr.y})}),ae=X.model.dimensions.map(function(Mr){return Mr.categories.map(function(fr){return fr.displayInd})}),ie=X.model.dimensions.map(function(Mr){return Mr.displayInd}),fe=X.dimensions.map(function(Mr){return Mr.model.dimensionInd}),we=re.map(function(Mr){return Mr.x}),Ae=re.map(function(Mr){return Mr.width}),Fe=[];for(var Ce in ee.paths)ee.paths.hasOwnProperty(Ce)&&Fe.push(ee.paths[Ce]);function qe(Mr){var fr=Mr.categoryInds.map(function(pt,ze){return ae[ze][pt]}),dr=fe.map(function(pt){return fr[pt]});return dr}Fe.sort(function(Mr,fr){var dr=qe(Mr),pt=qe(fr);return X.sortpaths==="backward"&&(dr.reverse(),pt.reverse()),dr.push(Mr.valueInds[0]),pt.push(fr.valueInds[0]),X.bundlecolors&&(dr.unshift(Mr.rawColor),pt.unshift(fr.rawColor)),drpt?1:0});for(var et=new Array(Fe.length),Qe=re[0].model.count,Ke=re[0].categories.map(function(Mr){return Mr.height}).reduce(function(Mr,fr){return Mr+fr}),Xe=0;Xe0?xe=Ke*(Me.count/Qe):xe=0;for(var ce=new Array(q.length),Re=0;Re1?fe=(X.width-2*ee-q)/(ae-1):fe=0,we=ee,Ae=we+fe*ie;var Fe=[],Ce=X.model.maxCats,qe=re.categories.length,et=8,Qe=re.count,Ke=X.height-et*(Ce-1),Xe,Me,xe,ce,Re,$e=(Ce-qe)*et/2,rt=re.categories.map(function(Je){return{displayInd:Je.displayInd,categoryInd:Je.categoryInd}});for(rt.sort(function(Je,At){return Je.displayInd-At.displayInd}),Re=0;Re0?Xe=Me.count/Qe*Ke:Xe=0,xe={key:Me.valueInds[0],model:Me,width:q,height:Xe,y:Me.dragY!==null?Me.dragY:$e,bands:[],parcatsViewModel:X},$e=$e+Xe+et,Fe.push(xe);return{key:re.dimensionInd,x:re.dragX!==null?re.dragX:Ae,y:0,width:q,model:re,categories:Fe,parcatsViewModel:X,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}}}),DT=He({"src/traces/parcats/plot.js"(Y,G){var d=NI();G.exports=function(A,E,e,t){var r=A._fullLayout,o=r._paper,a=r._size;d(A,o,E,{width:a.w,height:a.h,margin:{t:a.t,r:a.r,b:a.b,l:a.l}},e,t)}}}),UI=He({"src/traces/parcats/base_plot.js"(Y){var G=Uf().getModuleCalcData,d=DT(),x="parcats";Y.name=x,Y.plot=function(A,E,e,t){var r=G(A.calcdata,x);if(r.length){var o=r[0];d(A,o,e,t)}},Y.clean=function(A,E,e,t){var r=t._has&&t._has("parcats"),o=E._has&&E._has("parcats");r&&!o&&t._paperdiv.selectAll(".parcats").remove()}}}),jI=He({"src/traces/parcats/index.js"(Y,G){G.exports={attributes:RT(),supplyDefaults:OI(),calc:BI(),plot:DT(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:UI(),categories:["noOpacity"],meta:{}}}}),VI=He({"lib/parcats.js"(Y,G){G.exports=jI()}}),dd=He({"src/plots/mapbox/constants.js"(Y,G){var d=Ud(),x="1.13.4",A='©
OpenStreetMap contributors',E=['© Carto',A].join(" "),e=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under ODbL'].join(" "),t=['Map tiles by Stamen Design','under CC BY 3.0',"|",'Data by OpenStreetMap contributors','under CC BY SA'].join(" "),r={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:A,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:E,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:E,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:e,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:t,tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},o=d(r);G.exports={requiredVersion:x,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:r,styleValuesNonMapbox:o,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+x+"."].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:",o.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')`}}}}),Ky=He({"src/plots/mapbox/layout_attributes.js"(Y,G){var d=Gr(),x=Ai().defaultLine,A=mu().attributes,E=Yl(),e=Zu().textposition,t=hu().overrideAll,r=Gs().templatedArray,o=dd(),a=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});a.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=G.exports=t({_arrayAttrRegexps:[d.counterRegex("mapbox",".layers",!0)],domain:A({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:o.styleValuesMapbox.concat(o.styleValuesNonMapbox),dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:x},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:x}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:a,textposition:d.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),sx=He({"src/traces/scattermapbox/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=Yo().texttemplateAttrs,A=wv(),E=Zp(),e=Zu(),t=Ky(),r=cl(),o=kl(),a=ho().extendFlat,i=hu().overrideAll,n=Ky(),s=E.line,c=E.marker;G.exports=i({lon:E.lon,lat:E.lat,cluster:{enabled:{valType:"boolean"},maxzoom:a({},n.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:a({},c.opacity,{dflt:1})},mode:a({},e.mode,{dflt:"markers"}),text:a({},e.text,{}),texttemplate:x({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:a({},e.hovertext,{}),line:{color:s.color,width:s.width},connectgaps:e.connectgaps,marker:a({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode},o("marker")),fill:E.fill,fillcolor:A(),textfont:t.layers.symbol.textfont,textposition:t.layers.symbol.textposition,below:{valType:"string"},selected:{marker:e.selected.marker},unselected:{marker:e.unselected.marker},hoverinfo:a({},r.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d()},"calc","nested")}}),zT=He({"src/traces/scattermapbox/constants.js"(Y,G){var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];G.exports={isSupportedFont:function(x){return d.indexOf(x)!==-1}}}}),qI=He({"src/traces/scattermapbox/defaults.js"(Y,G){var d=Gr(),x=Rl(),A=Kh(),E=nv(),e=iv(),t=Av(),r=sx(),o=zT().isSupportedFont;G.exports=function(n,s,c,f){function v(g,m){return d.coerce(n,s,r,g,m)}function h(g,m){return d.coerce2(n,s,r,g,m)}var T=a(n,s,v);if(!T){s.visible=!1;return}if(v("text"),v("texttemplate"),v("hovertext"),v("hovertemplate"),v("mode"),v("below"),x.hasMarkers(s)){A(n,s,c,f,v,{noLine:!0,noAngle:!0}),v("marker.allowoverlap"),v("marker.angle");var l=s.marker;l.symbol!=="circle"&&(d.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),d.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}x.hasLines(s)&&(E(n,s,c,f,v,{noDash:!0}),v("connectgaps"));var y=h("cluster.maxzoom"),b=h("cluster.step"),S=h("cluster.color",s.marker&&s.marker.color||c),M=h("cluster.size"),_=h("cluster.opacity"),w=y!==!1||b!==!1||S!==!1||M!==!1||_!==!1,p=v("cluster.enabled",w);if(p||x.hasText(s)){var u=f.font.family;e(n,s,f,v,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}v("fill"),s.fill!=="none"&&t(n,s,c,v),d.coerceSelectionMarkerOpacity(s,v)};function a(i,n,s){var c=s("lon")||[],f=s("lat")||[],v=Math.min(c.length,f.length);return n._length=v,v}}}),FT=He({"src/traces/scattermapbox/format_labels.js"(Y,G){var d=io();G.exports=function(A,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,a=A.lonlat;return t.lonLabel=d.tickText(o,o.c2l(a[0]),!0).text,t.latLabel=d.tickText(o,o.c2l(a[1]),!0).text,t}}}),OT=He({"src/plots/mapbox/convert_text_opts.js"(Y,G){var d=Gr();G.exports=function(A,E){var e=A.split(" "),t=e[0],r=e[1],o=d.isArrayOrTypedArray(E)?d.mean(E):E,a=.5+o/100,i=1.5+o/100,n=["",""],s=[0,0];switch(t){case"top":n[0]="top",s[1]=-i;break;case"bottom":n[0]="bottom",s[1]=i;break}switch(r){case"left":n[1]="right",s[0]=-a;break;case"right":n[1]="left",s[0]=a;break}var c;return n[0]&&n[1]?c=n.join("-"):n[0]?c=n[0]:n[1]?c=n[1]:c="center",{anchor:c,offset:s}}}}),HI=He({"src/traces/scattermapbox/convert.js"(Y,G){var d=Hi(),x=Gr(),A=lo().BADNUM,E=np(),e=Kl(),t=vo(),r=B0(),o=Rl(),a=zT().isSupportedFont,i=OT(),n=Ph().appendArrayPointValue,s=yl().NEWLINES,c=yl().BR_TAG_ALL;G.exports=function(_,w){var p=w[0].trace,u=p.visible===!0&&p._length!==0,g=p.fill!=="none",m=o.hasLines(p),R=o.hasMarkers(p),P=o.hasText(p),z=R&&p.marker.symbol==="circle",F=R&&p.marker.symbol!=="circle",B=p.cluster&&p.cluster.enabled,O=f("fill"),L=f("line"),N=f("circle"),U=f("symbol"),Z={fill:O,line:L,circle:N,symbol:U};if(!u)return Z;var Q;if((g||m)&&(Q=E.calcTraceToLineCoords(w)),g&&(O.geojson=E.makePolygon(Q),O.layout.visibility="visible",x.extendFlat(O.paint,{"fill-color":p.fillcolor})),m&&(L.geojson=E.makeLine(Q),L.layout.visibility="visible",x.extendFlat(L.paint,{"line-width":p.line.width,"line-color":p.line.color,"line-opacity":p.opacity})),z){var ue=v(w);N.geojson=ue.geojson,N.layout.visibility="visible",B&&(N.filter=["!",["has","point_count"]],Z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":b(p.cluster.color,p.cluster.step),"circle-radius":b(p.cluster.size,p.cluster.step),"circle-opacity":b(p.cluster.opacity,p.cluster.step)}},Z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(p),"text-size":12}}),x.extendFlat(N.paint,{"circle-color":ue.mcc,"circle-radius":ue.mrc,"circle-opacity":ue.mo})}if(z&&B&&(N.filter=["!",["has","point_count"]]),(F||P)&&(U.geojson=h(w,_),x.extendFlat(U.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(x.extendFlat(U.layout,{"icon-size":p.marker.size/10}),"angle"in p.marker&&p.marker.angle!=="auto"&&x.extendFlat(U.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),U.layout["icon-allow-overlap"]=p.marker.allowoverlap,x.extendFlat(U.paint,{"icon-opacity":p.opacity*p.marker.opacity,"icon-color":p.marker.color})),P)){var oe=(p.marker||{}).size,le=i(p.textposition,oe);x.extendFlat(U.layout,{"text-size":p.textfont.size,"text-anchor":le.anchor,"text-offset":le.offset,"text-font":S(p)}),x.extendFlat(U.paint,{"text-color":p.textfont.color,"text-opacity":p.opacity})}return Z};function f(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function v(M){var _=M[0].trace,w=_.marker,p=_.selectedpoints,u=x.isArrayOrTypedArray(w.color),g=x.isArrayOrTypedArray(w.size),m=x.isArrayOrTypedArray(w.opacity),R;function P(oe){return _.opacity*oe}function z(oe){return oe/2}var F;u&&(e.hasColorscale(_,"marker")?F=e.makeColorScaleFuncFromTrace(w):F=x.identity);var B;g&&(B=r(_));var O;m&&(O=function(oe){var le=d(oe)?+x.constrain(oe,0,1):0;return P(le)});var L=[];for(R=0;R850?R+=" Black":u>750?R+=" Extra Bold":u>650?R+=" Bold":u>550?R+=" Semi Bold":u>450?R+=" Medium":u>350?R+=" Regular":u>250?R+=" Light":u>150?R+=" Extra Light":R+=" Thin"):g.slice(0,2).join(" ")==="Open Sans"?(R="Open Sans",u>750?R+=" Extrabold":u>650?R+=" Bold":u>550?R+=" Semibold":u>350?R+=" Regular":R+=" Light"):g.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(R="Klokantech Noto Sans",g[3]==="CJK"&&(R+=" CJK"),R+=u>500?" Bold":" Regular")),m&&(R+=" Italic"),R==="Open Sans Regular Italic"?R="Open Sans Italic":R==="Open Sans Regular Bold"?R="Open Sans Bold":R==="Open Sans Regular Bold Italic"?R="Open Sans Bold Italic":R==="Klokantech Noto Sans Regular Italic"&&(R="Klokantech Noto Sans Italic"),a(R)||(R=w);var P=R.split(", ");return P}}}),GI=He({"src/traces/scattermapbox/plot.js"(Y,G){var d=Gr(),x=HI(),A=dd().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,a,i){this.type="scattermapbox",this.subplot=r,this.uid=o,this.clusterEnabled=a,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:A+o+"-fill",line:A+o+"-line",circle:A+o+"-circle",symbol:A+o+"-symbol",cluster:A+o+"-cluster",clusterCount:A+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,a){var i={type:"geojson",data:o.geojson};a&&a.enabled&&d.extendFlat(i,{cluster:!0,clusterMaxZoom:a.maxzoom});var n=this.subplot.map.getSource(this.sourceIds[r]);n?n.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,a){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var n=this.layerIds[r],s,c=this.subplot.getMapLayers(),f=0;f=0;m--){var R=g[m];n.removeLayer(h.layerIds[R])}u||n.removeSource(h.sourceIds.circle)}function y(u){for(var g=E.nonCluster,m=0;m=0;m--){var R=g[m];n.removeLayer(h.layerIds[R]),u||n.removeSource(h.sourceIds[R])}}function S(u){v?l(u):b(u)}function M(u){f?T(u):y(u)}function _(){for(var u=f?E.cluster:E.nonCluster,g=0;g=0;i--){var n=a[i];o.removeLayer(this.layerIds[n]),o.removeSource(this.sourceIds[n])}},G.exports=function(o,a){var i=a[0].trace,n=i.cluster&&i.cluster.enabled,s=i.visible!==!0,c=new e(o,i.uid,n,s),f=x(o.gd,a),v=c.below=o.belowLookup["trace-"+i.uid],h,T,l;if(n)for(c.addSource("circle",f.circle,i.cluster),h=0;h=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=S*360,_=i-M;function w(B){var O=B.lonlat;if(O[0]===e||y&&T.indexOf(B.i+1)===-1)return 1/0;var L=x.modHalf(O[0],360),N=O[1],U=h.project([L,N]),Z=U.x-f.c2p([_,N]),Q=U.y-v.c2p([L,n]),ue=Math.max(3,B.mrc||0);return Math.max(Math.sqrt(Z*Z+Q*Q)-ue,1-3/ue)}if(d.getClosest(s,w,a),a.index!==!1){var p=s[a.index],u=p.lonlat,g=[x.modHalf(u[0],360)+M,u[1]],m=f.c2p(g),R=v.c2p(g),P=p.mrc||1;a.x0=m-P,a.x1=m+P,a.y0=R-P,a.y1=R+P;var z={};z[c.subplot]={_subplot:h};var F=c._module.formatLabels(p,c,z);return a.lonLabel=F.lonLabel,a.latLabel=F.latLabel,a.color=A(c,p),a.extraText=o(c,p,s[0].t.labels),a.hovertemplate=c.hovertemplate,[a]}}function o(a,i,n){if(a.hovertemplate)return;var s=i.hi||a.hoverinfo,c=s.split("+"),f=c.indexOf("all")!==-1,v=c.indexOf("lon")!==-1,h=c.indexOf("lat")!==-1,T=i.lonlat,l=[];function y(b){return b+"°"}return f||v&&h?l.push("("+y(T[1])+", "+y(T[0])+")"):v?l.push(n.lon+y(T[0])):h&&l.push(n.lat+y(T[1])),(f||c.indexOf("text")!==-1)&&E(i,a,l),l.join("
")}G.exports={hoverPoints:r,getExtraText:o}}}),WI=He({"src/traces/scattermapbox/event_data.js"(Y,G){G.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x}}}),ZI=He({"src/traces/scattermapbox/select.js"(Y,G){var d=Gr(),x=Rl(),A=lo().BADNUM;G.exports=function(e,t){var r=e.cd,o=e.xaxis,a=e.yaxis,i=[],n=r[0].trace,s;if(!x.hasMarkers(n))return[];if(t===!1)for(s=0;s"u"&&(C=1e-6);var V,se,_e,ke,Ne;for(_e=k,Ne=0;Ne<8;Ne++){if(ke=this.sampleCurveX(_e)-k,Math.abs(ke)se)return se;for(;Vke?V=_e:se=_e,_e=(se-V)*.5+V}return _e},a.prototype.solve=function(k,C){return this.sampleCurveY(this.solveCurveX(k,C))};var i=n;function n(k,C){this.x=k,this.y=C}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(k){return this.clone()._add(k)},sub:function(k){return this.clone()._sub(k)},multByPoint:function(k){return this.clone()._multByPoint(k)},divByPoint:function(k){return this.clone()._divByPoint(k)},mult:function(k){return this.clone()._mult(k)},div:function(k){return this.clone()._div(k)},rotate:function(k){return this.clone()._rotate(k)},rotateAround:function(k,C){return this.clone()._rotateAround(k,C)},matMult:function(k){return this.clone()._matMult(k)},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(k){return this.x===k.x&&this.y===k.y},dist:function(k){return Math.sqrt(this.distSqr(k))},distSqr:function(k){var C=k.x-this.x,V=k.y-this.y;return C*C+V*V},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(k){return Math.atan2(this.y-k.y,this.x-k.x)},angleWith:function(k){return this.angleWithSep(k.x,k.y)},angleWithSep:function(k,C){return Math.atan2(this.x*C-this.y*k,this.x*k+this.y*C)},_matMult:function(k){var C=k[0]*this.x+k[1]*this.y,V=k[2]*this.x+k[3]*this.y;return this.x=C,this.y=V,this},_add:function(k){return this.x+=k.x,this.y+=k.y,this},_sub:function(k){return this.x-=k.x,this.y-=k.y,this},_mult:function(k){return this.x*=k,this.y*=k,this},_div:function(k){return this.x/=k,this.y/=k,this},_multByPoint:function(k){return this.x*=k.x,this.y*=k.y,this},_divByPoint:function(k){return this.x/=k.x,this.y/=k.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var k=this.y;return this.y=this.x,this.x=-k,this},_rotate:function(k){var C=Math.cos(k),V=Math.sin(k),se=C*this.x-V*this.y,_e=V*this.x+C*this.y;return this.x=se,this.y=_e,this},_rotateAround:function(k,C){var V=Math.cos(k),se=Math.sin(k),_e=C.x+V*(this.x-C.x)-se*(this.y-C.y),ke=C.y+se*(this.x-C.x)+V*(this.y-C.y);return this.x=_e,this.y=ke,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(k){return k instanceof n?k:Array.isArray(k)?new n(k[0],k[1]):k};var s=typeof self<"u"?self:{};function c(k,C){if(Array.isArray(k)){if(!Array.isArray(C)||k.length!==C.length)return!1;for(var V=0;V=1)return 1;var C=k*k,V=C*k;return 4*(k<.5?V:3*(k-C)+V-.75)}function h(k,C,V,se){var _e=new o(k,C,V,se);return function(ke){return _e.solve(ke)}}var T=h(.25,.1,.25,1);function l(k,C,V){return Math.min(V,Math.max(C,k))}function y(k,C,V){var se=V-C,_e=((k-C)%se+se)%se+C;return _e===C?V:_e}function b(k,C,V){if(!k.length)return V(null,[]);var se=k.length,_e=new Array(k.length),ke=null;k.forEach(function(Ne,it){C(Ne,function(kt,Ft){kt&&(ke=kt),_e[it]=Ft,--se===0&&V(ke,_e)})})}function S(k){var C=[];for(var V in k)C.push(k[V]);return C}function M(k,C){var V=[];for(var se in k)se in C||V.push(se);return V}function _(k){for(var C=[],V=arguments.length-1;V-- >0;)C[V]=arguments[V+1];for(var se=0,_e=C;se<_e.length;se+=1){var ke=_e[se];for(var Ne in ke)k[Ne]=ke[Ne]}return k}function w(k,C){for(var V={},se=0;se>C/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,k)}return k()}function m(k){return k<=1?1:Math.pow(2,Math.ceil(Math.log(k)/Math.LN2))}function R(k){return k?/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(k):!1}function P(k,C){k.forEach(function(V){C[V]&&(C[V]=C[V].bind(C))})}function z(k,C){return k.indexOf(C,k.length-C.length)!==-1}function F(k,C,V){var se={};for(var _e in k)se[_e]=C.call(V||this,k[_e],_e,k);return se}function B(k,C,V){var se={};for(var _e in k)C.call(V||this,k[_e],_e,k)&&(se[_e]=k[_e]);return se}function O(k){return Array.isArray(k)?k.map(O):typeof k=="object"&&k?F(k,O):k}function L(k,C){for(var V=0;V=0)return!0;return!1}var N={};function U(k){N[k]||(typeof console<"u"&&console.warn(k),N[k]=!0)}function Z(k,C,V){return(V.y-k.y)*(C.x-k.x)>(C.y-k.y)*(V.x-k.x)}function Q(k){for(var C=0,V=0,se=k.length,_e=se-1,ke=void 0,Ne=void 0;V@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,V={};if(k.replace(C,function(_e,ke,Ne,it){var kt=Ne||it;return V[ke]=kt?kt.toLowerCase():!0,""}),V["max-age"]){var se=parseInt(V["max-age"],10);isNaN(se)?delete V["max-age"]:V["max-age"]=se}return V}var j=null;function J(k){if(j==null){var C=k.navigator?k.navigator.userAgent:null;j=!!k.safari||!!(C&&(/\b(iPad|iPhone|iPod)\b/.test(C)||C.match("Safari")&&!C.match("Chrome")))}return j}function $(k){try{var C=s[k];return C.setItem("_mapbox_test_",1),C.removeItem("_mapbox_test_"),!0}catch{return!1}}function X(k){return s.btoa(encodeURIComponent(k).replace(/%([0-9A-F]{2})/g,function(C,V){return String.fromCharCode(+("0x"+V))}))}function re(k){return decodeURIComponent(s.atob(k).split("").map(function(C){return"%"+("00"+C.charCodeAt(0).toString(16)).slice(-2)}).join(""))}var ee=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),q=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,ae=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,ie,fe,we={now:ee,frame:function(C){var V=q(C);return{cancel:function(){return ae(V)}}},getImageData:function(C,V){V===void 0&&(V=0);var se=s.document.createElement("canvas"),_e=se.getContext("2d");if(!_e)throw new Error("failed to create canvas 2d context");return se.width=C.width,se.height=C.height,_e.drawImage(C,0,0,C.width,C.height),_e.getImageData(-V,-V,C.width+2*V,C.height+2*V)},resolveURL:function(C){return ie||(ie=s.document.createElement("a")),ie.href=C,ie.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return s.matchMedia?(fe==null&&(fe=s.matchMedia("(prefers-reduced-motion: reduce)")),fe.matches):!1}},Ae={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},Fe={supported:!1,testSupport:Ke},Ce,qe=!1,et,Qe=!1;s.document&&(et=s.document.createElement("img"),et.onload=function(){Ce&&Xe(Ce),Ce=null,Qe=!0},et.onerror=function(){qe=!0,Ce=null},et.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function Ke(k){qe||!et||(Qe?Xe(k):Ce=k)}function Xe(k){var C=k.createTexture();k.bindTexture(k.TEXTURE_2D,C);try{if(k.texImage2D(k.TEXTURE_2D,0,k.RGBA,k.RGBA,k.UNSIGNED_BYTE,et),k.isContextLost())return;Fe.supported=!0}catch{}k.deleteTexture(C),qe=!0}var Me="01";function xe(){for(var k="1",C="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",V="",se=0;se<10;se++)V+=C[Math.floor(Math.random()*62)];var _e=12*60*60*1e3,ke=[k,Me,V].join(""),Ne=Date.now()+_e;return{token:ke,tokenExpiresAt:Ne}}var ce=function(C,V){this._transformRequestFn=C,this._customAccessToken=V,this._createSkuToken()};ce.prototype._createSkuToken=function(){var C=xe();this._skuToken=C.token,this._skuTokenExpiresAt=C.tokenExpiresAt},ce.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},ce.prototype.transformRequest=function(C,V){return this._transformRequestFn?this._transformRequestFn(C,V)||{url:C}:{url:C}},ce.prototype.normalizeStyleURL=function(C,V){if(!Re(C))return C;var se=Rt(C);return se.path="/styles/v1"+se.path,this._makeAPIURL(se,this._customAccessToken||V)},ce.prototype.normalizeGlyphsURL=function(C,V){if(!Re(C))return C;var se=Rt(C);return se.path="/fonts/v1"+se.path,this._makeAPIURL(se,this._customAccessToken||V)},ce.prototype.normalizeSourceURL=function(C,V){if(!Re(C))return C;var se=Rt(C);return se.path="/v4/"+se.authority+".json",se.params.push("secure"),this._makeAPIURL(se,this._customAccessToken||V)},ce.prototype.normalizeSpriteURL=function(C,V,se,_e){var ke=Rt(C);return Re(C)?(ke.path="/styles/v1"+ke.path+"/sprite"+V+se,this._makeAPIURL(ke,this._customAccessToken||_e)):(ke.path+=""+V+se,Ut(ke))},ce.prototype.normalizeTileURL=function(C,V){if(this._isSkuTokenExpired()&&this._createSkuToken(),C&&!Re(C))return C;var se=Rt(C),_e=/(\.(png|jpg)\d*)(?=$)/,ke=/^.+\/v4\//,Ne=we.devicePixelRatio>=2||V===512?"@2x":"",it=Fe.supported?".webp":"$1";se.path=se.path.replace(_e,""+Ne+it),se.path=se.path.replace(ke,"/"),se.path="/v4"+se.path;var kt=this._customAccessToken||At(se.params)||Ae.ACCESS_TOKEN;return Ae.REQUIRE_ACCESS_TOKEN&&kt&&this._skuToken&&se.params.push("sku="+this._skuToken),this._makeAPIURL(se,kt)},ce.prototype.canonicalizeTileURL=function(C,V){var se="/v4/",_e=/\.[\w]+$/,ke=Rt(C);if(!ke.path.match(/(^\/v4\/)/)||!ke.path.match(_e))return C;var Ne="mapbox://tiles/";Ne+=ke.path.replace(se,"");var it=ke.params;return V&&(it=it.filter(function(kt){return!kt.match(/^access_token=/)})),it.length&&(Ne+="?"+it.join("&")),Ne},ce.prototype.canonicalizeTileset=function(C,V){for(var se=V?Re(V):!1,_e=[],ke=0,Ne=C.tiles||[];ke=0&&C.params.splice(ke,1)}if(_e.path!=="/"&&(C.path=""+_e.path+C.path),!Ae.REQUIRE_ACCESS_TOKEN)return Ut(C);if(V=V||Ae.ACCESS_TOKEN,!V)throw new Error("An API access token is required to use Mapbox GL. "+se);if(V[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+se);return C.params=C.params.filter(function(Ne){return Ne.indexOf("access_token")===-1}),C.params.push("access_token="+V),Ut(C)};function Re(k){return k.indexOf("mapbox:")===0}var $e=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function rt(k){return $e.test(k)}function Je(k){return k.indexOf("sku=")>0&&rt(k)}function At(k){for(var C=0,V=k;C=1&&s.localStorage.setItem(V,JSON.stringify(this.eventData))}catch{U("Unable to write to LocalStorage")}},Mr.prototype.processRequests=function(C){},Mr.prototype.postEvent=function(C,V,se,_e){var ke=this;if(Ae.EVENTS_URL){var Ne=Rt(Ae.EVENTS_URL);Ne.params.push("access_token="+(_e||Ae.ACCESS_TOKEN||""));var it={event:this.type,created:new Date(C).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:Me,userId:this.anonId},kt=V?_(it,V):it,Ft={url:Ut(Ne),headers:{"Content-Type":"text/plain"},body:JSON.stringify([kt])};this.pendingRequest=Ur(Ft,function(Gt){ke.pendingRequest=null,se(Gt),ke.saveEventData(),ke.processRequests(_e)})}},Mr.prototype.queueRequest=function(C,V){this.queue.push(C),this.processRequests(V)};var fr=function(k){function C(){k.call(this,"map.load"),this.success={},this.skuToken=""}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postMapLoadEvent=function(se,_e,ke,Ne){this.skuToken=ke,(Ae.EVENTS_URL&&Ne||Ae.ACCESS_TOKEN&&Array.isArray(se)&&se.some(function(it){return Re(it)||rt(it)}))&&this.queueRequest({id:_e,timestamp:Date.now()},Ne)},C.prototype.processRequests=function(se){var _e=this;if(!(this.pendingRequest||this.queue.length===0)){var ke=this.queue.shift(),Ne=ke.id,it=ke.timestamp;Ne&&this.success[Ne]||(this.anonId||this.fetchEventData(),R(this.anonId)||(this.anonId=g()),this.postEvent(it,{skuToken:this.skuToken},function(kt){kt||Ne&&(_e.success[Ne]=!0)},se))}},C}(Mr),dr=function(k){function C(V){k.call(this,"appUserTurnstile"),this._customAccessToken=V}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.postTurnstileEvent=function(se,_e){Ae.EVENTS_URL&&Ae.ACCESS_TOKEN&&Array.isArray(se)&&se.some(function(ke){return Re(ke)||rt(ke)})&&this.queueRequest(Date.now(),_e)},C.prototype.processRequests=function(se){var _e=this;if(!(this.pendingRequest||this.queue.length===0)){(!this.anonId||!this.eventData.lastSuccess||!this.eventData.tokenU)&&this.fetchEventData();var ke=ar(Ae.ACCESS_TOKEN),Ne=ke?ke.u:Ae.ACCESS_TOKEN,it=Ne!==this.eventData.tokenU;R(this.anonId)||(this.anonId=g(),it=!0);var kt=this.queue.shift();if(this.eventData.lastSuccess){var Ft=new Date(this.eventData.lastSuccess),Gt=new Date(kt),hr=(kt-this.eventData.lastSuccess)/(24*60*60*1e3);it=it||hr>=1||hr<-1||Ft.getDate()!==Gt.getDate()}else it=!0;if(!it)return this.processRequests();this.postEvent(kt,{"enabled.telemetry":!1},function(Dr){Dr||(_e.eventData.lastSuccess=kt,_e.eventData.tokenU=Ne)},se)}},C}(Mr),pt=new dr,ze=pt.postTurnstileEvent.bind(pt),Ge=new fr,Oe=Ge.postMapLoadEvent.bind(Ge),ve="mapbox-tiles",ge=500,be=50,Pe=1e3*60*7,We;function ct(){s.caches&&!We&&(We=s.caches.open(ve))}var _t;function Mt(k,C){if(_t===void 0)try{new Response(new ReadableStream),_t=!0}catch{_t=!1}_t?C(k.body):k.blob().then(C)}function Nt(k,C,V){if(ct(),!!We){var se={status:C.status,statusText:C.statusText,headers:new s.Headers};C.headers.forEach(function(Ne,it){return se.headers.set(it,Ne)});var _e=le(C.headers.get("Cache-Control")||"");if(!_e["no-store"]){_e["max-age"]&&se.headers.set("Expires",new Date(V+_e["max-age"]*1e3).toUTCString());var ke=new Date(se.headers.get("Expires")).getTime()-V;keDate.now()&&!V["no-cache"]}var lr=1/0;function ta(k){lr++,lr>be&&(k.getActor().send("enforceCacheSizeLimit",ge),lr=0)}function da(k){ct(),We&&We.then(function(C){C.keys().then(function(V){for(var se=0;se=200&&V.status<300||V.status===0)&&V.response!==null){var _e=V.response;if(k.type==="json")try{_e=JSON.parse(V.response)}catch(ke){return C(ke)}C(null,_e,V.getResponseHeader("Cache-Control"),V.getResponseHeader("Expires"))}else C(new Ka(V.statusText,V.status,k.url))},V.send(k.body),{cancel:function(){return V.abort()}}}var gr=function(k,C){if(!Lt(k.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return jt(k,C);if(oe()&&self.worker&&self.worker.actor){var V=!0;return self.worker.actor.send("getResource",k,C,void 0,V)}}return Ot(k,C)},Br=function(k,C){return gr(_(k,{type:"json"}),C)},na=function(k,C){return gr(_(k,{type:"arrayBuffer"}),C)},Ur=function(k,C){return gr(_(k,{method:"POST"}),C)};function ga(k){var C=s.document.createElement("a");return C.href=k,C.protocol===s.document.location.protocol&&C.host===s.document.location.host}var Aa="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Pa(k,C,V,se){var _e=new s.Image,ke=s.URL;_e.onload=function(){C(null,_e),ke.revokeObjectURL(_e.src),_e.onload=null,s.requestAnimationFrame(function(){_e.src=Aa})},_e.onerror=function(){return C(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 Ne=new s.Blob([new Uint8Array(k)],{type:"image/png"});_e.cacheControl=V,_e.expires=se,_e.src=k.byteLength?ke.createObjectURL(Ne):Aa}function sa(k,C){var V=new s.Blob([new Uint8Array(k)],{type:"image/png"});s.createImageBitmap(V).then(function(se){C(null,se)}).catch(function(se){C(new Error("Could not load image because of "+se.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}var Oa,dt,vt=function(){Oa=[],dt=0};vt();var Lr=function(k,C){if(Fe.supported&&(k.headers||(k.headers={}),k.headers.accept="image/webp,*/*"),dt>=Ae.MAX_PARALLEL_IMAGE_REQUESTS){var V={requestParameters:k,callback:C,cancelled:!1,cancel:function(){this.cancelled=!0}};return Oa.push(V),V}dt++;var se=!1,_e=function(){if(!se)for(se=!0,dt--;Oa.length&&dt0||this._oneTimeListeners&&this._oneTimeListeners[C]&&this._oneTimeListeners[C].length>0||this._eventedParent&&this._eventedParent.listens(C)},Pr.prototype.setEventedParent=function(C,V){return this._eventedParent=C,this._eventedParentData=V,this};var Hr=8,Zr={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"}},Jr={"*":{type:"source"}},wt=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Qt={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},mr={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},$r={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},oa={type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},Sa={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"}}},ya={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"}}},ra={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"}},pa=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],pn={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ga={"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"}},qn={"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"}},Vn={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},di={"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"}},yi={"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"}},Ci={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ci={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ei={type:"array",value:"*"},mi={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},uo={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Lo={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Wo={type:"array",value:"*",minimum:1},li={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}},Ii=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],xi={"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"}},Ao={"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"}},So={"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"}},Ro={"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"}},Li={"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"}},Yi={"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"}},bs={"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"}},as={"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"}},fs={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Co={"*":{type:"string"}},Qa={$version:Hr,$root:Zr,sources:Jr,source:wt,source_vector:Qt,source_raster:mr,source_raster_dem:$r,source_geojson:oa,source_video:Sa,source_image:ya,layer:ra,layout:pa,layout_background:pn,layout_fill:Ga,layout_circle:qn,layout_heatmap:Vn,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:di,layout_symbol:yi,layout_raster:Ci,layout_hillshade:ci,filter:ei,filter_operator:mi,geometry_type:uo,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:Lo,expression:Wo,light:li,paint:Ii,paint_fill:xi,"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:Ao,paint_circle:So,paint_heatmap:Ro,paint_symbol:Li,paint_raster:Yi,paint_hillshade:bs,paint_background:as,transition:fs,"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:Co},Jn=function(C,V,se,_e){this.message=(C?C+": ":"")+se,_e&&(this.identifier=_e),V!=null&&V.__line__&&(this.line=V.__line__)};function Os(k){var C=k.key,V=k.value;return V?[new Jn(C,V,"constants have been deprecated as of v8")]:[]}function ds(k){for(var C=[],V=arguments.length-1;V-- >0;)C[V]=arguments[V+1];for(var se=0,_e=C;se<_e.length;se+=1){var ke=_e[se];for(var Ne in ke)k[Ne]=ke[Ne]}return k}function Ui(k){return k instanceof Number||k instanceof String||k instanceof Boolean?k.valueOf():k}function ms(k){if(Array.isArray(k))return k.map(ms);if(k instanceof Object&&!(k instanceof Number||k instanceof String||k instanceof Boolean)){var C={};for(var V in k)C[V]=ms(k[V]);return C}return Ui(k)}var Mo=function(k){function C(V,se){k.call(this,se),this.message=se,this.key=V}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C}(Error),ws=function(C,V){V===void 0&&(V=[]),this.parent=C,this.bindings={};for(var se=0,_e=V;se<_e.length;se+=1){var ke=_e[se],Ne=ke[0],it=ke[1];this.bindings[Ne]=it}};ws.prototype.concat=function(C){return new ws(this,C)},ws.prototype.get=function(C){if(this.bindings[C])return this.bindings[C];if(this.parent)return this.parent.get(C);throw new Error(C+" not found in scope.")},ws.prototype.has=function(C){return this.bindings[C]?!0:this.parent?this.parent.has(C):!1};var Ks={kind:"null"},Rn={kind:"number"},fo={kind:"string"},Pi={kind:"boolean"},zo={kind:"color"},wo={kind:"object"},bi={kind:"value"},wl={kind:"error"},$l={kind:"collator"},Js={kind:"formatted"},Ql={kind:"resolvedImage"};function Ws(k,C){return{kind:"array",itemType:k,N:C}}function Is(k){if(k.kind==="array"){var C=Is(k.itemType);return typeof k.N=="number"?"array<"+C+", "+k.N+">":k.itemType.kind==="value"?"array":"array<"+C+">"}else return k.kind}var Dl=[Ks,Rn,fo,Pi,zo,Js,wo,Ws(bi),Ql];function Xu(k,C){if(C.kind==="error")return null;if(k.kind==="array"){if(C.kind==="array"&&(C.N===0&&C.itemType.kind==="value"||!Xu(k.itemType,C.itemType))&&(typeof k.N!="number"||k.N===C.N))return null}else{if(k.kind===C.kind)return null;if(k.kind==="value")for(var V=0,se=Dl;V255?255:Ft}function _e(Ft){return Ft<0?0:Ft>1?1:Ft}function ke(Ft){return Ft[Ft.length-1]==="%"?se(parseFloat(Ft)/100*255):se(parseInt(Ft))}function Ne(Ft){return Ft[Ft.length-1]==="%"?_e(parseFloat(Ft)/100):_e(parseFloat(Ft))}function it(Ft,Gt,hr){return hr<0?hr+=1:hr>1&&(hr-=1),hr*6<1?Ft+(Gt-Ft)*hr*6:hr*2<1?Gt:hr*3<2?Ft+(Gt-Ft)*(2/3-hr)*6:Ft}function kt(Ft){var Gt=Ft.replace(/ /g,"").toLowerCase();if(Gt in V)return V[Gt].slice();if(Gt[0]==="#"){if(Gt.length===4){var hr=parseInt(Gt.substr(1),16);return hr>=0&&hr<=4095?[(hr&3840)>>4|(hr&3840)>>8,hr&240|(hr&240)>>4,hr&15|(hr&15)<<4,1]:null}else if(Gt.length===7){var hr=parseInt(Gt.substr(1),16);return hr>=0&&hr<=16777215?[(hr&16711680)>>16,(hr&65280)>>8,hr&255,1]:null}return null}var Dr=Gt.indexOf("("),Ir=Gt.indexOf(")");if(Dr!==-1&&Ir+1===Gt.length){var Xr=Gt.substr(0,Dr),ba=Gt.substr(Dr+1,Ir-(Dr+1)).split(","),Za=1;switch(Xr){case"rgba":if(ba.length!==4)return null;Za=Ne(ba.pop());case"rgb":return ba.length!==3?null:[ke(ba[0]),ke(ba[1]),ke(ba[2]),Za];case"hsla":if(ba.length!==4)return null;Za=Ne(ba.pop());case"hsl":if(ba.length!==3)return null;var Ra=(parseFloat(ba[0])%360+360)%360/360,dn=Ne(ba[1]),$a=Ne(ba[2]),vn=$a<=.5?$a*(dn+1):$a+dn-$a*dn,bn=$a*2-vn;return[se(it(bn,vn,Ra+1/3)*255),se(it(bn,vn,Ra)*255),se(it(bn,vn,Ra-1/3)*255),Za];default:return null}}return null}try{C.parseCSSColor=kt}catch{}}),gf=kf.parseCSSColor,ns=function(C,V,se,_e){_e===void 0&&(_e=1),this.r=C,this.g=V,this.b=se,this.a=_e};ns.parse=function(C){if(C){if(C instanceof ns)return C;if(typeof C=="string"){var V=gf(C);if(V)return new ns(V[0]/255*V[3],V[1]/255*V[3],V[2]/255*V[3],V[3])}}},ns.prototype.toString=function(){var C=this.toArray(),V=C[0],se=C[1],_e=C[2],ke=C[3];return"rgba("+Math.round(V)+","+Math.round(se)+","+Math.round(_e)+","+ke+")"},ns.prototype.toArray=function(){var C=this,V=C.r,se=C.g,_e=C.b,ke=C.a;return ke===0?[0,0,0,0]:[V*255/ke,se*255/ke,_e*255/ke,ke]},ns.black=new ns(0,0,0,1),ns.white=new ns(1,1,1,1),ns.transparent=new ns(0,0,0,0),ns.red=new ns(1,0,0,1);var _u=function(C,V,se){C?this.sensitivity=V?"variant":"case":this.sensitivity=V?"accent":"base",this.locale=se,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};_u.prototype.compare=function(C,V){return this.collator.compare(C,V)},_u.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Nc=function(C,V,se,_e,ke){this.text=C,this.image=V,this.scale=se,this.fontStack=_e,this.textColor=ke},ml=function(C){this.sections=C};ml.fromString=function(C){return new ml([new Nc(C,null,null,null,null)])},ml.prototype.isEmpty=function(){return this.sections.length===0?!0:!this.sections.some(function(C){return C.text.length!==0||C.image&&C.image.name.length!==0})},ml.factory=function(C){return C instanceof ml?C:ml.fromString(C)},ml.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(C){return C.text}).join("")},ml.prototype.serialize=function(){for(var C=["format"],V=0,se=this.sections;V=0&&k<=255&&typeof C=="number"&&C>=0&&C<=255&&typeof V=="number"&&V>=0&&V<=255)){var _e=typeof se=="number"?[k,C,V,se]:[k,C,V];return"Invalid rgba value ["+_e.join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}return typeof se>"u"||typeof se=="number"&&se>=0&&se<=1?null:"Invalid rgba value ["+[k,C,V,se].join(", ")+"]: 'a' must be between 0 and 1."}function Yu(k){if(k===null)return!0;if(typeof k=="string")return!0;if(typeof k=="boolean")return!0;if(typeof k=="number")return!0;if(k instanceof ns)return!0;if(k instanceof _u)return!0;if(k instanceof ml)return!0;if(k instanceof fl)return!0;if(Array.isArray(k)){for(var C=0,V=k;C2){var it=C[1];if(typeof it!="string"||!(it in Nu)||it==="object")return V.error('The item type argument of "array" must be one of string, number, boolean',1);Ne=Nu[it],se++}else Ne=bi;var kt;if(C.length>3){if(C[2]!==null&&(typeof C[2]!="number"||C[2]<0||C[2]!==Math.floor(C[2])))return V.error('The length argument to "array" must be a positive integer literal',2);kt=C[2],se++}_e=Ws(Ne,kt)}else _e=Nu[ke];for(var Ft=[];se1)&&V.push(_e)}}return V.concat(this.args.map(function(ke){return ke.serialize()}))};var Ku=function(C){this.type=Js,this.sections=C};Ku.parse=function(C,V){if(C.length<2)return V.error("Expected at least one argument.");var se=C[1];if(!Array.isArray(se)&&typeof se=="object")return V.error("First argument must be an image or text section.");for(var _e=[],ke=!1,Ne=1;Ne<=C.length-1;++Ne){var it=C[Ne];if(ke&&typeof it=="object"&&!Array.isArray(it)){ke=!1;var kt=null;if(it["font-scale"]&&(kt=V.parse(it["font-scale"],1,Rn),!kt))return null;var Ft=null;if(it["text-font"]&&(Ft=V.parse(it["text-font"],1,Ws(fo)),!Ft))return null;var Gt=null;if(it["text-color"]&&(Gt=V.parse(it["text-color"],1,zo),!Gt))return null;var hr=_e[_e.length-1];hr.scale=kt,hr.font=Ft,hr.textColor=Gt}else{var Dr=V.parse(C[Ne],1,bi);if(!Dr)return null;var Ir=Dr.type.kind;if(Ir!=="string"&&Ir!=="value"&&Ir!=="null"&&Ir!=="resolvedImage")return V.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");ke=!0,_e.push({content:Dr,scale:null,font:null,textColor:null})}}return new Ku(_e)},Ku.prototype.evaluate=function(C){var V=function(se){var _e=se.content.evaluate(C);return Ts(_e)===Ql?new Nc("",_e,null,null,null):new Nc(Tl(_e),null,se.scale?se.scale.evaluate(C):null,se.font?se.font.evaluate(C).join(","):null,se.textColor?se.textColor.evaluate(C):null)};return new ml(this.sections.map(V))},Ku.prototype.eachChild=function(C){for(var V=0,se=this.sections;V-1),se},Bs.prototype.eachChild=function(C){C(this.input)},Bs.prototype.outputDefined=function(){return!1},Bs.prototype.serialize=function(){return["image",this.input.serialize()]};var Gf={"to-boolean":Pi,"to-color":zo,"to-number":Rn,"to-string":fo},Eo=function(C,V){this.type=C,this.args=V};Eo.parse=function(C,V){if(C.length<2)return V.error("Expected at least one argument.");var se=C[0];if((se==="to-boolean"||se==="to-string")&&C.length!==2)return V.error("Expected one argument.");for(var _e=Gf[se],ke=[],Ne=1;Ne4?se="Invalid rbga value "+JSON.stringify(V)+": expected an array containing either three or four numeric values.":se=_l(V[0],V[1],V[2],V[3]),!se))return new ns(V[0]/255,V[1]/255,V[2]/255,V[3])}throw new Cs(se||"Could not parse color from value '"+(typeof V=="string"?V:String(JSON.stringify(V)))+"'")}else if(this.type.kind==="number"){for(var kt=null,Ft=0,Gt=this.args;Ft=C[2]||k[1]<=C[1]||k[3]>=C[3])}function yf(k,C){var V=Ju(k[0]),se=gc(k[1]),_e=Math.pow(2,C.z);return[Math.round(V*_e*zl),Math.round(se*_e*zl)]}function Jc(k,C,V){var se=k[0]-C[0],_e=k[1]-C[1],ke=k[0]-V[0],Ne=k[1]-V[1];return se*Ne-ke*_e===0&&se*ke<=0&&_e*Ne<=0}function Uc(k,C,V){return C[1]>k[1]!=V[1]>k[1]&&k[0]<(V[0]-C[0])*(k[1]-C[1])/(V[1]-C[1])+C[0]}function $u(k,C){for(var V=!1,se=0,_e=C.length;se<_e;se++)for(var ke=C[se],Ne=0,it=ke.length;Ne0&&hr<0||Gt<0&&hr>0}function Qc(k,C,V,se){var _e=[C[0]-k[0],C[1]-k[1]],ke=[se[0]-V[0],se[1]-V[1]];return $c(ke,_e)===0?!1:!!(bu(k,C,V,se)&&bu(V,se,k,C))}function sc(k,C,V){for(var se=0,_e=V;se<_e.length;se+=1)for(var ke=_e[se],Ne=0;NeV[2]){var _e=se*.5,ke=k[0]-V[0]>_e?-se:V[0]-k[0]>_e?se:0;ke===0&&(ke=k[0]-V[2]>_e?-se:V[2]-k[0]>_e?se:0),k[0]+=ke}Kc(C,k)}function Vc(k){k[0]=k[1]=1/0,k[2]=k[3]=-1/0}function Zf(k,C,V,se){for(var _e=Math.pow(2,se.z)*zl,ke=[se.x*zl,se.y*zl],Ne=[],it=0,kt=k;it=0)return!1;var V=!0;return k.eachChild(function(se){V&&!ru(se,C)&&(V=!1)}),V}var Uu=function(C,V){this.type=V.type,this.name=C,this.boundExpression=V};Uu.parse=function(C,V){if(C.length!==2||typeof C[1]!="string")return V.error("'var' expression requires exactly one string literal argument.");var se=C[1];return V.scope.has(se)?new Uu(se,V.scope.get(se)):V.error('Unknown variable "'+se+'". Make sure "'+se+'" has been bound in an enclosing "let" expression before using it.',1)},Uu.prototype.evaluate=function(C){return this.boundExpression.evaluate(C)},Uu.prototype.eachChild=function(){},Uu.prototype.outputDefined=function(){return!1},Uu.prototype.serialize=function(){return["var",this.name]};var $s=function(C,V,se,_e,ke){V===void 0&&(V=[]),_e===void 0&&(_e=new ws),ke===void 0&&(ke=[]),this.registry=C,this.path=V,this.key=V.map(function(Ne){return"["+Ne+"]"}).join(""),this.scope=_e,this.errors=ke,this.expectedType=se};$s.prototype.parse=function(C,V,se,_e,ke){return ke===void 0&&(ke={}),V?this.concat(V,se,_e)._parse(C,ke):this._parse(C,ke)},$s.prototype._parse=function(C,V){(C===null||typeof C=="string"||typeof C=="boolean"||typeof C=="number")&&(C=["literal",C]);function se(Gt,hr,Dr){return Dr==="assert"?new Ul(hr,[Gt]):Dr==="coerce"?new Eo(hr,[Gt]):Gt}if(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 _e=C[0];if(typeof _e!="string")return this.error("Expression name must be a string, but found "+typeof _e+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var ke=this.registry[_e];if(ke){var Ne=ke.parse(C,this);if(!Ne)return null;if(this.expectedType){var it=this.expectedType,kt=Ne.type;if((it.kind==="string"||it.kind==="number"||it.kind==="boolean"||it.kind==="object"||it.kind==="array")&&kt.kind==="value")Ne=se(Ne,it,V.typeAnnotation||"assert");else if((it.kind==="color"||it.kind==="formatted"||it.kind==="resolvedImage")&&(kt.kind==="value"||kt.kind==="string"))Ne=se(Ne,it,V.typeAnnotation||"coerce");else if(this.checkSubtype(it,kt))return null}if(!(Ne instanceof Ko)&&Ne.type.kind!=="resolvedImage"&&Qu(Ne)){var Ft=new is;try{Ne=new Ko(Ne.type,Ne.evaluate(Ft))}catch(Gt){return this.error(Gt.message),null}}return Ne}return this.error('Unknown expression "'+_e+'". If you wanted a literal array, use ["literal", [...]].',0)}else return typeof C>"u"?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.")},$s.prototype.concat=function(C,V,se){var _e=typeof C=="number"?this.path.concat(C):this.path,ke=se?this.scope.concat(se):this.scope;return new $s(this.registry,_e,V||null,ke,this.errors)},$s.prototype.error=function(C){for(var V=[],se=arguments.length-1;se-- >0;)V[se]=arguments[se+1];var _e=""+this.key+V.map(function(ke){return"["+ke+"]"}).join("");this.errors.push(new Mo(_e,C))},$s.prototype.checkSubtype=function(C,V){var se=Xu(C,V);return se&&this.error(se),se};function Qu(k){if(k instanceof Uu)return Qu(k.boundExpression);if(k instanceof oo&&k.name==="error")return!1;if(k instanceof xu)return!1;if(k instanceof tu)return!1;var C=k instanceof Eo||k instanceof Ul,V=!0;return k.eachChild(function(se){C?V=V&&Qu(se):V=V&&se instanceof Ko}),V?xf(k)&&ru(k,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Tu(k,C){for(var V=k.length-1,se=0,_e=V,ke=0,Ne,it;se<=_e;)if(ke=Math.floor((se+_e)/2),Ne=k[ke],it=k[ke+1],Ne<=C){if(ke===V||CC)_e=ke-1;else throw new Cs("Input is not a number.");return 0}var au=function(C,V,se){this.type=C,this.input=V,this.labels=[],this.outputs=[];for(var _e=0,ke=se;_e=it)return V.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Ft);var hr=V.parse(kt,Gt,ke);if(!hr)return null;ke=ke||hr.type,_e.push([it,hr])}return new au(ke,se,_e)},au.prototype.evaluate=function(C){var V=this.labels,se=this.outputs;if(V.length===1)return se[0].evaluate(C);var _e=this.input.evaluate(C);if(_e<=V[0])return se[0].evaluate(C);var ke=V.length;if(_e>=V[ke-1])return se[ke-1].evaluate(C);var Ne=Tu(V,_e);return se[Ne].evaluate(C)},au.prototype.eachChild=function(C){C(this.input);for(var V=0,se=this.outputs;V0&&C.push(this.labels[V]),C.push(this.outputs[V].serialize());return C};function Ns(k,C,V){return k*(1-V)+C*V}function yc(k,C,V){return new ns(Ns(k.r,C.r,V),Ns(k.g,C.g,V),Ns(k.b,C.b,V),Ns(k.a,C.a,V))}function Pu(k,C,V){return k.map(function(se,_e){return Ns(se,C[_e],V)})}var ec=Object.freeze({__proto__:null,number:Ns,color:yc,array:Pu}),Ec=.95047,Cf=1,nh=1.08883,lc=4/29,kc=6/29,nu=3*kc*kc,tf=kc*kc*kc,Cl=Math.PI/180,uc=180/Math.PI;function rf(k){return k>tf?Math.pow(k,1/3):k/nu+lc}function mc(k){return k>kc?k*k*k:nu*(k-lc)}function Us(k){return 255*(k<=.0031308?12.92*k:1.055*Math.pow(k,1/2.4)-.055)}function vu(k){return k/=255,k<=.04045?k/12.92:Math.pow((k+.055)/1.055,2.4)}function du(k){var C=vu(k.r),V=vu(k.g),se=vu(k.b),_e=rf((.4124564*C+.3575761*V+.1804375*se)/Ec),ke=rf((.2126729*C+.7151522*V+.072175*se)/Cf),Ne=rf((.0193339*C+.119192*V+.9503041*se)/nh);return{l:116*ke-16,a:500*(_e-ke),b:200*(ke-Ne),alpha:k.a}}function af(k){var C=(k.l+16)/116,V=isNaN(k.a)?C:C+k.a/500,se=isNaN(k.b)?C:C-k.b/200;return C=Cf*mc(C),V=Ec*mc(V),se=nh*mc(se),new ns(Us(3.2404542*V-1.5371385*C-.4985314*se),Us(-.969266*V+1.8760108*C+.041556*se),Us(.0556434*V-.2040259*C+1.0572252*se),k.alpha)}function Rs(k,C,V){return{l:Ns(k.l,C.l,V),a:Ns(k.a,C.a,V),b:Ns(k.b,C.b,V),alpha:Ns(k.alpha,C.alpha,V)}}function _c(k){var C=du(k),V=C.l,se=C.a,_e=C.b,ke=Math.atan2(_e,se)*uc;return{h:ke<0?ke+360:ke,c:Math.sqrt(se*se+_e*_e),l:V,alpha:k.a}}function ju(k){var C=k.h*Cl,V=k.c,se=k.l;return af({l:se,a:Math.cos(C)*V,b:Math.sin(C)*V,alpha:k.alpha})}function iu(k,C,V){var se=C-k;return k+V*(se>180||se<-180?se-360*Math.round(se/360):se)}function xc(k,C,V){return{h:iu(k.h,C.h,V),c:Ns(k.c,C.c,V),l:Ns(k.l,C.l,V),alpha:Ns(k.alpha,C.alpha,V)}}var Iu={forward:du,reverse:af,interpolate:Rs},bc={forward:_c,reverse:ju,interpolate:xc},Lf=Object.freeze({__proto__:null,lab:Iu,hcl:bc}),xl=function(C,V,se,_e,ke){this.type=C,this.operator=V,this.interpolation=se,this.input=_e,this.labels=[],this.outputs=[];for(var Ne=0,it=ke;Ne1}))return V.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_e={name:"cubic-bezier",controlPoints:kt}}else return V.error("Unknown interpolation type "+String(_e[0]),1,0);if(C.length-1<4)return V.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if((C.length-1)%2!==0)return V.error("Expected an even number of arguments.");if(ke=V.parse(ke,2,Rn),!ke)return null;var Ft=[],Gt=null;se==="interpolate-hcl"||se==="interpolate-lab"?Gt=zo:V.expectedType&&V.expectedType.kind!=="value"&&(Gt=V.expectedType);for(var hr=0;hr=Dr)return V.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',Xr);var Za=V.parse(Ir,ba,Gt);if(!Za)return null;Gt=Gt||Za.type,Ft.push([Dr,Za])}return Gt.kind!=="number"&&Gt.kind!=="color"&&!(Gt.kind==="array"&&Gt.itemType.kind==="number"&&typeof Gt.N=="number")?V.error("Type "+Is(Gt)+" is not interpolatable."):new xl(Gt,se,_e,ke,Ft)},xl.prototype.evaluate=function(C){var V=this.labels,se=this.outputs;if(V.length===1)return se[0].evaluate(C);var _e=this.input.evaluate(C);if(_e<=V[0])return se[0].evaluate(C);var ke=V.length;if(_e>=V[ke-1])return se[ke-1].evaluate(C);var Ne=Tu(V,_e),it=V[Ne],kt=V[Ne+1],Ft=xl.interpolationFactor(this.interpolation,_e,it,kt),Gt=se[Ne].evaluate(C),hr=se[Ne+1].evaluate(C);return this.operator==="interpolate"?ec[this.type.kind.toLowerCase()](Gt,hr,Ft):this.operator==="interpolate-hcl"?bc.reverse(bc.interpolate(bc.forward(Gt),bc.forward(hr),Ft)):Iu.reverse(Iu.interpolate(Iu.forward(Gt),Iu.forward(hr),Ft))},xl.prototype.eachChild=function(C){C(this.input);for(var V=0,se=this.outputs;V=se.length)throw new Cs("Array index out of bounds: "+V+" > "+(se.length-1)+".");if(V!==Math.floor(V))throw new Cs("Array index must be an integer, but found "+V+" instead.");return se[V]},Au.prototype.eachChild=function(C){C(this.index),C(this.input)},Au.prototype.outputDefined=function(){return!1},Au.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Zs=function(C,V){this.type=Pi,this.needle=C,this.haystack=V};Zs.parse=function(C,V){if(C.length!==3)return V.error("Expected 2 arguments, but found "+(C.length-1)+" instead.");var se=V.parse(C[1],1,bi),_e=V.parse(C[2],2,bi);return!se||!_e?null:Lu(se.type,[Pi,fo,Rn,Ks,bi])?new Zs(se,_e):V.error("Expected first argument to be of type boolean, string, number or null, but found "+Is(se.type)+" instead")},Zs.prototype.evaluate=function(C){var V=this.needle.evaluate(C),se=this.haystack.evaluate(C);if(!se)return!1;if(!Bu(V,["boolean","string","number","null"]))throw new Cs("Expected first argument to be of type boolean, string, number or null, but found "+Is(Ts(V))+" instead.");if(!Bu(se,["string","array"]))throw new Cs("Expected second argument to be of type array or string, but found "+Is(Ts(se))+" instead.");return se.indexOf(V)>=0},Zs.prototype.eachChild=function(C){C(this.needle),C(this.haystack)},Zs.prototype.outputDefined=function(){return!0},Zs.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Ol=function(C,V,se){this.type=Rn,this.needle=C,this.haystack=V,this.fromIndex=se};Ol.parse=function(C,V){if(C.length<=2||C.length>=5)return V.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var se=V.parse(C[1],1,bi),_e=V.parse(C[2],2,bi);if(!se||!_e)return null;if(!Lu(se.type,[Pi,fo,Rn,Ks,bi]))return V.error("Expected first argument to be of type boolean, string, number or null, but found "+Is(se.type)+" instead");if(C.length===4){var ke=V.parse(C[3],3,Rn);return ke?new Ol(se,_e,ke):null}else return new Ol(se,_e)},Ol.prototype.evaluate=function(C){var V=this.needle.evaluate(C),se=this.haystack.evaluate(C);if(!Bu(V,["boolean","string","number","null"]))throw new Cs("Expected first argument to be of type boolean, string, number or null, but found "+Is(Ts(V))+" instead.");if(!Bu(se,["string","array"]))throw new Cs("Expected second argument to be of type array or string, but found "+Is(Ts(se))+" instead.");if(this.fromIndex){var _e=this.fromIndex.evaluate(C);return se.indexOf(V,_e)}return se.indexOf(V)},Ol.prototype.eachChild=function(C){C(this.needle),C(this.haystack),this.fromIndex&&C(this.fromIndex)},Ol.prototype.outputDefined=function(){return!1},Ol.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 bl=function(C,V,se,_e,ke,Ne){this.inputType=C,this.type=V,this.input=se,this.cases=_e,this.outputs=ke,this.otherwise=Ne};bl.parse=function(C,V){if(C.length<5)return V.error("Expected at least 4 arguments, but found only "+(C.length-1)+".");if(C.length%2!==1)return V.error("Expected an even number of arguments.");var se,_e;V.expectedType&&V.expectedType.kind!=="value"&&(_e=V.expectedType);for(var ke={},Ne=[],it=2;itNumber.MAX_SAFE_INTEGER)return Gt.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof Ir=="number"&&Math.floor(Ir)!==Ir)return Gt.error("Numeric branch labels must be integer values.");if(!se)se=Ts(Ir);else if(Gt.checkSubtype(se,Ts(Ir)))return null;if(typeof ke[String(Ir)]<"u")return Gt.error("Branch labels must be unique.");ke[String(Ir)]=Ne.length}var Xr=V.parse(Ft,it,_e);if(!Xr)return null;_e=_e||Xr.type,Ne.push(Xr)}var ba=V.parse(C[1],1,bi);if(!ba)return null;var Za=V.parse(C[C.length-1],C.length-1,_e);return!Za||ba.type.kind!=="value"&&V.concat(1).checkSubtype(se,ba.type)?null:new bl(se,_e,ba,ke,Ne,Za)},bl.prototype.evaluate=function(C){var V=this.input.evaluate(C),se=Ts(V)===this.inputType&&this.outputs[this.cases[V]]||this.otherwise;return se.evaluate(C)},bl.prototype.eachChild=function(C){C(this.input),this.outputs.forEach(C),C(this.otherwise)},bl.prototype.outputDefined=function(){return this.outputs.every(function(C){return C.outputDefined()})&&this.otherwise.outputDefined()},bl.prototype.serialize=function(){for(var C=this,V=["match",this.input.serialize()],se=Object.keys(this.cases).sort(),_e=[],ke={},Ne=0,it=se;Ne=5)return V.error("Expected 3 or 4 arguments, but found "+(C.length-1)+" instead.");var se=V.parse(C[1],1,bi),_e=V.parse(C[2],2,Rn);if(!se||!_e)return null;if(!Lu(se.type,[Ws(bi),fo,bi]))return V.error("Expected first argument to be of type array or string, but found "+Is(se.type)+" instead");if(C.length===4){var ke=V.parse(C[3],3,Rn);return ke?new Su(se.type,se,_e,ke):null}else return new Su(se.type,se,_e)},Su.prototype.evaluate=function(C){var V=this.input.evaluate(C),se=this.beginIndex.evaluate(C);if(!Bu(V,["string","array"]))throw new Cs("Expected first argument to be of type array or string, but found "+Is(Ts(V))+" instead.");if(this.endIndex){var _e=this.endIndex.evaluate(C);return V.slice(se,_e)}return V.slice(se)},Su.prototype.eachChild=function(C){C(this.input),C(this.beginIndex),this.endIndex&&C(this.endIndex)},Su.prototype.outputDefined=function(){return!1},Su.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()]};function Cc(k,C){return k==="=="||k==="!="?C.kind==="boolean"||C.kind==="string"||C.kind==="number"||C.kind==="null"||C.kind==="value":C.kind==="string"||C.kind==="number"||C.kind==="value"}function Ht(k,C,V){return C===V}function ur(k,C,V){return C!==V}function qr(k,C,V){return CV}function ua(k,C,V){return C<=V}function Fa(k,C,V){return C>=V}function ja(k,C,V,se){return se.compare(C,V)===0}function sn(k,C,V,se){return!ja(k,C,V,se)}function gn(k,C,V,se){return se.compare(C,V)<0}function kn(k,C,V,se){return se.compare(C,V)>0}function Ja(k,C,V,se){return se.compare(C,V)<=0}function _n(k,C,V,se){return se.compare(C,V)>=0}function on(k,C,V){var se=k!=="=="&&k!=="!=";return function(){function _e(ke,Ne,it){this.type=Pi,this.lhs=ke,this.rhs=Ne,this.collator=it,this.hasUntypedArgument=ke.type.kind==="value"||Ne.type.kind==="value"}return _e.parse=function(Ne,it){if(Ne.length!==3&&Ne.length!==4)return it.error("Expected two or three arguments.");var kt=Ne[0],Ft=it.parse(Ne[1],1,bi);if(!Ft)return null;if(!Cc(kt,Ft.type))return it.concat(1).error('"'+kt+`" comparisons are not supported for type '`+Is(Ft.type)+"'.");var Gt=it.parse(Ne[2],2,bi);if(!Gt)return null;if(!Cc(kt,Gt.type))return it.concat(2).error('"'+kt+`" comparisons are not supported for type '`+Is(Gt.type)+"'.");if(Ft.type.kind!==Gt.type.kind&&Ft.type.kind!=="value"&&Gt.type.kind!=="value")return it.error("Cannot compare types '"+Is(Ft.type)+"' and '"+Is(Gt.type)+"'.");se&&(Ft.type.kind==="value"&&Gt.type.kind!=="value"?Ft=new Ul(Gt.type,[Ft]):Ft.type.kind!=="value"&&Gt.type.kind==="value"&&(Gt=new Ul(Ft.type,[Gt])));var hr=null;if(Ne.length===4){if(Ft.type.kind!=="string"&&Gt.type.kind!=="string"&&Ft.type.kind!=="value"&&Gt.type.kind!=="value")return it.error("Cannot use collator to compare non-string types.");if(hr=it.parse(Ne[3],3,$l),!hr)return null}return new _e(Ft,Gt,hr)},_e.prototype.evaluate=function(Ne){var it=this.lhs.evaluate(Ne),kt=this.rhs.evaluate(Ne);if(se&&this.hasUntypedArgument){var Ft=Ts(it),Gt=Ts(kt);if(Ft.kind!==Gt.kind||!(Ft.kind==="string"||Ft.kind==="number"))throw new Cs('Expected arguments for "'+k+'" to be (string, string) or (number, number), but found ('+Ft.kind+", "+Gt.kind+") instead.")}if(this.collator&&!se&&this.hasUntypedArgument){var hr=Ts(it),Dr=Ts(kt);if(hr.kind!=="string"||Dr.kind!=="string")return C(Ne,it,kt)}return this.collator?V(Ne,it,kt,this.collator.evaluate(Ne)):C(Ne,it,kt)},_e.prototype.eachChild=function(Ne){Ne(this.lhs),Ne(this.rhs),this.collator&&Ne(this.collator)},_e.prototype.outputDefined=function(){return!0},_e.prototype.serialize=function(){var Ne=[k];return this.eachChild(function(it){Ne.push(it.serialize())}),Ne},_e}()}var Wa=on("==",Ht,ja),On=on("!=",ur,sn),zi=on("<",qr,gn),ki=on(">",Or,kn),ji=on("<=",ua,Ja),Ni=on(">=",Fa,_n),Bn=function(C,V,se,_e,ke){this.type=fo,this.number=C,this.locale=V,this.currency=se,this.minFractionDigits=_e,this.maxFractionDigits=ke};Bn.parse=function(C,V){if(C.length!==3)return V.error("Expected two arguments.");var se=V.parse(C[1],1,Rn);if(!se)return null;var _e=C[2];if(typeof _e!="object"||Array.isArray(_e))return V.error("NumberFormat options argument must be an object.");var ke=null;if(_e.locale&&(ke=V.parse(_e.locale,1,fo),!ke))return null;var Ne=null;if(_e.currency&&(Ne=V.parse(_e.currency,1,fo),!Ne))return null;var it=null;if(_e["min-fraction-digits"]&&(it=V.parse(_e["min-fraction-digits"],1,Rn),!it))return null;var kt=null;return _e["max-fraction-digits"]&&(kt=V.parse(_e["max-fraction-digits"],1,Rn),!kt)?null:new Bn(se,ke,Ne,it,kt)},Bn.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))},Bn.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)},Bn.prototype.outputDefined=function(){return!1},Bn.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 An=function(C){this.type=Rn,this.input=C};An.parse=function(C,V){if(C.length!==2)return V.error("Expected 1 argument, but found "+(C.length-1)+" instead.");var se=V.parse(C[1],1);return se?se.type.kind!=="array"&&se.type.kind!=="string"&&se.type.kind!=="value"?V.error("Expected argument of type string or array, but found "+Is(se.type)+" instead."):new An(se):null},An.prototype.evaluate=function(C){var V=this.input.evaluate(C);if(typeof V=="string")return V.length;if(Array.isArray(V))return V.length;throw new Cs("Expected value to be of type string or array, but found "+Is(Ts(V))+" instead.")},An.prototype.eachChild=function(C){C(this.input)},An.prototype.outputDefined=function(){return!1},An.prototype.serialize=function(){var C=["length"];return this.eachChild(function(V){C.push(V.serialize())}),C};var Ki={"==":Wa,"!=":On,">":ki,"<":zi,">=":Ni,"<=":ji,array:Ul,at:Au,boolean:Ul,case:tc,coalesce:ou,collator:xu,format:Ku,image:Bs,in:Zs,"index-of":Ol,interpolate:xl,"interpolate-hcl":xl,"interpolate-lab":xl,length:An,let:Ru,literal:Ko,match:bl,number:Ul,"number-format":Bn,object:Ul,slice:Su,step:au,string:Ul,"to-boolean":Eo,"to-color":Eo,"to-number":Eo,"to-string":Eo,var:Uu,within:tu};function ko(k,C){var V=C[0],se=C[1],_e=C[2],ke=C[3];V=V.evaluate(k),se=se.evaluate(k),_e=_e.evaluate(k);var Ne=ke?ke.evaluate(k):1,it=_l(V,se,_e,Ne);if(it)throw new Cs(it);return new ns(V/255*Ne,se/255*Ne,_e/255*Ne,Ne)}function $o(k,C){return k in C}function Ls(k,C){var V=C[k];return typeof V>"u"?null:V}function os(k,C,V,se){for(;V<=se;){var _e=V+se>>1;if(C[_e]===k)return!0;C[_e]>k?se=_e-1:V=_e+1}return!1}function As(k){return{type:k}}oo.register(Ki,{error:[wl,[fo],function(k,C){var V=C[0];throw new Cs(V.evaluate(k))}],typeof:[fo,[bi],function(k,C){var V=C[0];return Is(Ts(V.evaluate(k)))}],"to-rgba":[Ws(Rn,4),[zo],function(k,C){var V=C[0];return V.evaluate(k).toArray()}],rgb:[zo,[Rn,Rn,Rn],ko],rgba:[zo,[Rn,Rn,Rn,Rn],ko],has:{type:Pi,overloads:[[[fo],function(k,C){var V=C[0];return $o(V.evaluate(k),k.properties())}],[[fo,wo],function(k,C){var V=C[0],se=C[1];return $o(V.evaluate(k),se.evaluate(k))}]]},get:{type:bi,overloads:[[[fo],function(k,C){var V=C[0];return Ls(V.evaluate(k),k.properties())}],[[fo,wo],function(k,C){var V=C[0],se=C[1];return Ls(V.evaluate(k),se.evaluate(k))}]]},"feature-state":[bi,[fo],function(k,C){var V=C[0];return Ls(V.evaluate(k),k.featureState||{})}],properties:[wo,[],function(k){return k.properties()}],"geometry-type":[fo,[],function(k){return k.geometryType()}],id:[bi,[],function(k){return k.id()}],zoom:[Rn,[],function(k){return k.globals.zoom}],"heatmap-density":[Rn,[],function(k){return k.globals.heatmapDensity||0}],"line-progress":[Rn,[],function(k){return k.globals.lineProgress||0}],accumulated:[bi,[],function(k){return k.globals.accumulated===void 0?null:k.globals.accumulated}],"+":[Rn,As(Rn),function(k,C){for(var V=0,se=0,_e=C;se<_e.length;se+=1){var ke=_e[se];V+=ke.evaluate(k)}return V}],"*":[Rn,As(Rn),function(k,C){for(var V=1,se=0,_e=C;se<_e.length;se+=1){var ke=_e[se];V*=ke.evaluate(k)}return V}],"-":{type:Rn,overloads:[[[Rn,Rn],function(k,C){var V=C[0],se=C[1];return V.evaluate(k)-se.evaluate(k)}],[[Rn],function(k,C){var V=C[0];return-V.evaluate(k)}]]},"/":[Rn,[Rn,Rn],function(k,C){var V=C[0],se=C[1];return V.evaluate(k)/se.evaluate(k)}],"%":[Rn,[Rn,Rn],function(k,C){var V=C[0],se=C[1];return V.evaluate(k)%se.evaluate(k)}],ln2:[Rn,[],function(){return Math.LN2}],pi:[Rn,[],function(){return Math.PI}],e:[Rn,[],function(){return Math.E}],"^":[Rn,[Rn,Rn],function(k,C){var V=C[0],se=C[1];return Math.pow(V.evaluate(k),se.evaluate(k))}],sqrt:[Rn,[Rn],function(k,C){var V=C[0];return Math.sqrt(V.evaluate(k))}],log10:[Rn,[Rn],function(k,C){var V=C[0];return Math.log(V.evaluate(k))/Math.LN10}],ln:[Rn,[Rn],function(k,C){var V=C[0];return Math.log(V.evaluate(k))}],log2:[Rn,[Rn],function(k,C){var V=C[0];return Math.log(V.evaluate(k))/Math.LN2}],sin:[Rn,[Rn],function(k,C){var V=C[0];return Math.sin(V.evaluate(k))}],cos:[Rn,[Rn],function(k,C){var V=C[0];return Math.cos(V.evaluate(k))}],tan:[Rn,[Rn],function(k,C){var V=C[0];return Math.tan(V.evaluate(k))}],asin:[Rn,[Rn],function(k,C){var V=C[0];return Math.asin(V.evaluate(k))}],acos:[Rn,[Rn],function(k,C){var V=C[0];return Math.acos(V.evaluate(k))}],atan:[Rn,[Rn],function(k,C){var V=C[0];return Math.atan(V.evaluate(k))}],min:[Rn,As(Rn),function(k,C){return Math.min.apply(Math,C.map(function(V){return V.evaluate(k)}))}],max:[Rn,As(Rn),function(k,C){return Math.max.apply(Math,C.map(function(V){return V.evaluate(k)}))}],abs:[Rn,[Rn],function(k,C){var V=C[0];return Math.abs(V.evaluate(k))}],round:[Rn,[Rn],function(k,C){var V=C[0],se=V.evaluate(k);return se<0?-Math.round(-se):Math.round(se)}],floor:[Rn,[Rn],function(k,C){var V=C[0];return Math.floor(V.evaluate(k))}],ceil:[Rn,[Rn],function(k,C){var V=C[0];return Math.ceil(V.evaluate(k))}],"filter-==":[Pi,[fo,bi],function(k,C){var V=C[0],se=C[1];return k.properties()[V.value]===se.value}],"filter-id-==":[Pi,[bi],function(k,C){var V=C[0];return k.id()===V.value}],"filter-type-==":[Pi,[fo],function(k,C){var V=C[0];return k.geometryType()===V.value}],"filter-<":[Pi,[fo,bi],function(k,C){var V=C[0],se=C[1],_e=k.properties()[V.value],ke=se.value;return typeof _e==typeof ke&&_e":[Pi,[fo,bi],function(k,C){var V=C[0],se=C[1],_e=k.properties()[V.value],ke=se.value;return typeof _e==typeof ke&&_e>ke}],"filter-id->":[Pi,[bi],function(k,C){var V=C[0],se=k.id(),_e=V.value;return typeof se==typeof _e&&se>_e}],"filter-<=":[Pi,[fo,bi],function(k,C){var V=C[0],se=C[1],_e=k.properties()[V.value],ke=se.value;return typeof _e==typeof ke&&_e<=ke}],"filter-id-<=":[Pi,[bi],function(k,C){var V=C[0],se=k.id(),_e=V.value;return typeof se==typeof _e&&se<=_e}],"filter->=":[Pi,[fo,bi],function(k,C){var V=C[0],se=C[1],_e=k.properties()[V.value],ke=se.value;return typeof _e==typeof ke&&_e>=ke}],"filter-id->=":[Pi,[bi],function(k,C){var V=C[0],se=k.id(),_e=V.value;return typeof se==typeof _e&&se>=_e}],"filter-has":[Pi,[bi],function(k,C){var V=C[0];return V.value in k.properties()}],"filter-has-id":[Pi,[],function(k){return k.id()!==null&&k.id()!==void 0}],"filter-type-in":[Pi,[Ws(fo)],function(k,C){var V=C[0];return V.value.indexOf(k.geometryType())>=0}],"filter-id-in":[Pi,[Ws(bi)],function(k,C){var V=C[0];return V.value.indexOf(k.id())>=0}],"filter-in-small":[Pi,[fo,Ws(bi)],function(k,C){var V=C[0],se=C[1];return se.value.indexOf(k.properties()[V.value])>=0}],"filter-in-large":[Pi,[fo,Ws(bi)],function(k,C){var V=C[0],se=C[1];return os(k.properties()[V.value],se.value,0,se.value.length-1)}],all:{type:Pi,overloads:[[[Pi,Pi],function(k,C){var V=C[0],se=C[1];return V.evaluate(k)&&se.evaluate(k)}],[As(Pi),function(k,C){for(var V=0,se=C;V-1}function fi(k){return!!k.expression&&k.expression.interpolated}function ao(k){return k instanceof Number?"number":k instanceof String?"string":k instanceof Boolean?"boolean":Array.isArray(k)?"array":k===null?"null":typeof k}function gs(k){return typeof k=="object"&&k!==null&&!Array.isArray(k)}function Jo(k){return k}function Bl(k,C){var V=C.type==="color",se=k.stops&&typeof k.stops[0][0]=="object",_e=se||k.property!==void 0,ke=se||!_e,Ne=k.type||(fi(C)?"exponential":"interval");if(V&&(k=ds({},k),k.stops&&(k.stops=k.stops.map(function(ni){return[ni[0],ns.parse(ni[1])]})),k.default?k.default=ns.parse(k.default):k.default=ns.parse(C.default)),k.colorSpace&&k.colorSpace!=="rgb"&&!Lf[k.colorSpace])throw new Error("Unknown color space: "+k.colorSpace);var it,kt,Ft;if(Ne==="exponential")it=ql;else if(Ne==="interval")it=cc;else if(Ne==="categorical"){it=Vl,kt=Object.create(null);for(var Gt=0,hr=k.stops;Gt=k.stops[se-1][0])return k.stops[se-1][1];var _e=Tu(k.stops.map(function(ke){return ke[0]}),V);return k.stops[_e][1]}function ql(k,C,V){var se=k.base!==void 0?k.base:1;if(ao(V)!=="number")return jl(k.default,C.default);var _e=k.stops.length;if(_e===1||V<=k.stops[0][0])return k.stops[0][1];if(V>=k.stops[_e-1][0])return k.stops[_e-1][1];var ke=Tu(k.stops.map(function(hr){return hr[0]}),V),Ne=ol(V,se,k.stops[ke][0],k.stops[ke+1][0]),it=k.stops[ke][1],kt=k.stops[ke+1][1],Ft=ec[C.type]||Jo;if(k.colorSpace&&k.colorSpace!=="rgb"){var Gt=Lf[k.colorSpace];Ft=function(hr,Dr){return Gt.reverse(Gt.interpolate(Gt.forward(hr),Gt.forward(Dr),Ne))}}return typeof it.evaluate=="function"?{evaluate:function(){for(var Dr=[],Ir=arguments.length;Ir--;)Dr[Ir]=arguments[Ir];var Xr=it.evaluate.apply(void 0,Dr),ba=kt.evaluate.apply(void 0,Dr);if(!(Xr===void 0||ba===void 0))return Ft(Xr,ba,Ne)}}:Ft(it,kt,Ne)}function Vu(k,C,V){return C.type==="color"?V=ns.parse(V):C.type==="formatted"?V=ml.fromString(V.toString()):C.type==="resolvedImage"?V=fl.fromString(V.toString()):ao(V)!==C.type&&(C.type!=="enum"||!C.values[V])&&(V=void 0),jl(V,k.default,C.default)}function ol(k,C,V,se){var _e=se-V,ke=k-V;return _e===0?0:C===1?ke/_e:(Math.pow(C,ke)-1)/(Math.pow(C,_e)-1)}var rc=function(C,V){this.expression=C,this._warningHistory={},this._evaluator=new is,this._defaultValue=V?Se(V):null,this._enumValues=V&&V.type==="enum"?V.values:null};rc.prototype.evaluateWithoutErrorHandling=function(C,V,se,_e,ke,Ne){return this._evaluator.globals=C,this._evaluator.feature=V,this._evaluator.featureState=se,this._evaluator.canonical=_e,this._evaluator.availableImages=ke||null,this._evaluator.formattedSection=Ne,this.expression.evaluate(this._evaluator)},rc.prototype.evaluate=function(C,V,se,_e,ke,Ne){this._evaluator.globals=C,this._evaluator.feature=V||null,this._evaluator.featureState=se||null,this._evaluator.canonical=_e,this._evaluator.availableImages=ke||null,this._evaluator.formattedSection=Ne||null;try{var it=this.expression.evaluate(this._evaluator);if(it==null||typeof it=="number"&&it!==it)return this._defaultValue;if(this._enumValues&&!(it in this._enumValues))throw new Cs("Expected value to be one of "+Object.keys(this._enumValues).map(function(kt){return JSON.stringify(kt)}).join(", ")+", but found "+JSON.stringify(it)+" instead.");return it}catch(kt){return this._warningHistory[kt.message]||(this._warningHistory[kt.message]=!0,typeof console<"u"&&console.warn(kt.message)),this._defaultValue}};function Vi(k){return Array.isArray(k)&&k.length>0&&typeof k[0]=="string"&&k[0]in Ki}function eo(k,C){var V=new $s(Ki,[],C?Te(C):void 0),se=V.parse(k,void 0,void 0,void 0,C&&C.type==="string"?{typeAnnotation:"coerce"}:void 0);return se?jo(new rc(se,C)):il(V.errors)}var qu=function(C,V){this.kind=C,this._styleExpression=V,this.isStateDependent=C!=="constant"&&!Fl(V.expression)};qu.prototype.evaluateWithoutErrorHandling=function(C,V,se,_e,ke,Ne){return this._styleExpression.evaluateWithoutErrorHandling(C,V,se,_e,ke,Ne)},qu.prototype.evaluate=function(C,V,se,_e,ke,Ne){return this._styleExpression.evaluate(C,V,se,_e,ke,Ne)};var Du=function(C,V,se,_e){this.kind=C,this.zoomStops=se,this._styleExpression=V,this.isStateDependent=C!=="camera"&&!Fl(V.expression),this.interpolationType=_e};Du.prototype.evaluateWithoutErrorHandling=function(C,V,se,_e,ke,Ne){return this._styleExpression.evaluateWithoutErrorHandling(C,V,se,_e,ke,Ne)},Du.prototype.evaluate=function(C,V,se,_e,ke,Ne){return this._styleExpression.evaluate(C,V,se,_e,ke,Ne)},Du.prototype.interpolationFactor=function(C,V,se){return this.interpolationType?xl.interpolationFactor(this.interpolationType,C,V,se):0};function wc(k,C){if(k=eo(k,C),k.result==="error")return k;var V=k.value.expression,se=xf(V);if(!se&&!Qs(C))return il([new Mo("","data expressions not supported")]);var _e=ru(V,["zoom"]);if(!_e&&!Ss(C))return il([new Mo("","zoom expressions not supported")]);var ke=ne(V);if(!ke&&!_e)return il([new Mo("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(ke instanceof Mo)return il([ke]);if(ke instanceof xl&&!fi(C))return il([new Mo("",'"interpolate" expressions cannot be used with this property')]);if(!ke)return jo(se?new qu("constant",k.value):new qu("source",k.value));var Ne=ke instanceof xl?ke.interpolation:void 0;return jo(se?new Du("camera",k.value,ke.labels,Ne):new Du("composite",k.value,ke.labels,Ne))}var De=function(C,V){this._parameters=C,this._specification=V,ds(this,Bl(this._parameters,this._specification))};De.deserialize=function(C){return new De(C._parameters,C._specification)},De.serialize=function(C){return{_parameters:C._parameters,_specification:C._specification}};function I(k,C){if(gs(k))return new De(k,C);if(Vi(k)){var V=wc(k,C);if(V.result==="error")throw new Error(V.value.map(function(_e){return _e.key+": "+_e.message}).join(", "));return V.value}else{var se=k;return typeof k=="string"&&C.type==="color"&&(se=ns.parse(k)),{kind:"constant",evaluate:function(){return se}}}}function ne(k){var C=null;if(k instanceof Ru)C=ne(k.result);else if(k instanceof ou)for(var V=0,se=k.args;Vse.maximum?[new Jn(C,V,V+" is greater than the maximum value "+se.maximum)]:[]}function Ct(k){var C=k.valueSpec,V=Ui(k.value.type),se,_e={},ke,Ne,it=V!=="categorical"&&k.value.property===void 0,kt=!it,Ft=ao(k.value.stops)==="array"&&ao(k.value.stops[0])==="array"&&ao(k.value.stops[0][0])==="object",Gt=Ie({key:k.key,value:k.value,valueSpec:k.styleSpec.function,style:k.style,styleSpec:k.styleSpec,objectElementValidators:{stops:hr,default:Xr}});return V==="identity"&&it&&Gt.push(new Jn(k.key,k.value,'missing required property "property"')),V!=="identity"&&!k.value.stops&&Gt.push(new Jn(k.key,k.value,'missing required property "stops"')),V==="exponential"&&k.valueSpec.expression&&!fi(k.valueSpec)&&Gt.push(new Jn(k.key,k.value,"exponential functions not supported")),k.styleSpec.$version>=8&&(kt&&!Qs(k.valueSpec)?Gt.push(new Jn(k.key,k.value,"property functions not supported")):it&&!Ss(k.valueSpec)&&Gt.push(new Jn(k.key,k.value,"zoom functions not supported"))),(V==="categorical"||Ft)&&k.value.property===void 0&&Gt.push(new Jn(k.key,k.value,'"property" property is required')),Gt;function hr(ba){if(V==="identity")return[new Jn(ba.key,ba.value,'identity function may not have a "stops" property')];var Za=[],Ra=ba.value;return Za=Za.concat(ot({key:ba.key,value:Ra,valueSpec:ba.valueSpec,style:ba.style,styleSpec:ba.styleSpec,arrayElementValidator:Dr})),ao(Ra)==="array"&&Ra.length===0&&Za.push(new Jn(ba.key,Ra,"array must have at least one stop")),Za}function Dr(ba){var Za=[],Ra=ba.value,dn=ba.key;if(ao(Ra)!=="array")return[new Jn(dn,Ra,"array expected, "+ao(Ra)+" found")];if(Ra.length!==2)return[new Jn(dn,Ra,"array length 2 expected, length "+Ra.length+" found")];if(Ft){if(ao(Ra[0])!=="object")return[new Jn(dn,Ra,"object expected, "+ao(Ra[0])+" found")];if(Ra[0].zoom===void 0)return[new Jn(dn,Ra,"object stop key must have zoom")];if(Ra[0].value===void 0)return[new Jn(dn,Ra,"object stop key must have value")];if(Ne&&Ne>Ui(Ra[0].zoom))return[new Jn(dn,Ra[0].zoom,"stop zoom values must appear in ascending order")];Ui(Ra[0].zoom)!==Ne&&(Ne=Ui(Ra[0].zoom),ke=void 0,_e={}),Za=Za.concat(Ie({key:dn+"[0]",value:Ra[0],valueSpec:{zoom:{}},style:ba.style,styleSpec:ba.styleSpec,objectElementValidators:{zoom:yt,value:Ir}}))}else Za=Za.concat(Ir({key:dn+"[0]",value:Ra[0],valueSpec:{},style:ba.style,styleSpec:ba.styleSpec},Ra));return Vi(ms(Ra[1]))?Za.concat([new Jn(dn+"[1]",Ra[1],"expressions are not allowed in function stops.")]):Za.concat(No({key:dn+"[1]",value:Ra[1],valueSpec:C,style:ba.style,styleSpec:ba.styleSpec}))}function Ir(ba,Za){var Ra=ao(ba.value),dn=Ui(ba.value),$a=ba.value!==null?ba.value:Za;if(!se)se=Ra;else if(Ra!==se)return[new Jn(ba.key,$a,Ra+" stop domain type must match previous stop domain type "+se)];if(Ra!=="number"&&Ra!=="string"&&Ra!=="boolean")return[new Jn(ba.key,$a,"stop domain value must be a number, string, or boolean")];if(Ra!=="number"&&V!=="categorical"){var vn="number expected, "+Ra+" found";return Qs(C)&&V===void 0&&(vn+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Jn(ba.key,$a,vn)]}return V==="categorical"&&Ra==="number"&&(!isFinite(dn)||Math.floor(dn)!==dn)?[new Jn(ba.key,$a,"integer expected, found "+dn)]:V!=="categorical"&&Ra==="number"&&ke!==void 0&&dn=2&&k[1]!=="$id"&&k[1]!=="$type";case"in":return k.length>=3&&(typeof k[1]!="string"||Array.isArray(k[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return k.length!==3||Array.isArray(k[1])||Array.isArray(k[2]);case"any":case"all":for(var C=0,V=k.slice(1);CC?1:0}function lt(k){if(!Array.isArray(k))return!1;if(k[0]==="within")return!0;for(var C=1;C"||C==="<="||C===">="?gt(k[1],k[2],C):C==="any"?Et(k.slice(1)):C==="all"?["all"].concat(k.slice(1).map(Tt)):C==="none"?["all"].concat(k.slice(1).map(Tt).map(sr)):C==="in"?Yt(k[1],k.slice(2)):C==="!in"?sr(Yt(k[1],k.slice(2))):C==="has"?rr(k[1]):C==="!has"?sr(rr(k[1])):C==="within"?k:!0;return V}function gt(k,C,V){switch(k){case"$type":return["filter-type-"+V,C];case"$id":return["filter-id-"+V,C];default:return["filter-"+V,k,C]}}function Et(k){return["any"].concat(k.map(Tt))}function Yt(k,C){if(C.length===0)return!1;switch(k){case"$type":return["filter-type-in",["literal",C]];case"$id":return["filter-id-in",["literal",C]];default:return C.length>200&&!C.some(function(V){return typeof V!=typeof C[0]})?["filter-in-large",k,["literal",C.sort(at)]]:["filter-in-small",k,["literal",C]]}}function rr(k){switch(k){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",k]}}function sr(k){return["!",k]}function Sr(k){return Wr(ms(k.value))?Wt(ds({},k,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Nr(k)}function Nr(k){var C=k.value,V=k.key;if(ao(C)!=="array")return[new Jn(V,C,"array expected, "+ao(C)+" found")];var se=k.styleSpec,_e,ke=[];if(C.length<1)return[new Jn(V,C,"filter array must have at least 1 element")];switch(ke=ke.concat(Fr({key:V+"[0]",value:C[0],valueSpec:se.filter_operator,style:k.style,styleSpec:k.styleSpec})),Ui(C[0])){case"<":case"<=":case">":case">=":C.length>=2&&Ui(C[1])==="$type"&&ke.push(new Jn(V,C,'"$type" cannot be use with operator "'+C[0]+'"'));case"==":case"!=":C.length!==3&&ke.push(new Jn(V,C,'filter array for operator "'+C[0]+'" must have 3 elements'));case"in":case"!in":C.length>=2&&(_e=ao(C[1]),_e!=="string"&&ke.push(new Jn(V+"[1]",C[1],"string expected, "+_e+" found")));for(var Ne=2;Ne=Gt[Ir+0]&&se>=Gt[Ir+1])?(Ne[Dr]=!0,ke.push(Ft[Dr])):Ne[Dr]=!1}}},Ye.prototype._forEachCell=function(k,C,V,se,_e,ke,Ne,it){for(var kt=this._convertToCellCoord(k),Ft=this._convertToCellCoord(C),Gt=this._convertToCellCoord(V),hr=this._convertToCellCoord(se),Dr=kt;Dr<=Gt;Dr++)for(var Ir=Ft;Ir<=hr;Ir++){var Xr=this.d*Ir+Dr;if(!(it&&!it(this._convertFromCellCoord(Dr),this._convertFromCellCoord(Ir),this._convertFromCellCoord(Dr+1),this._convertFromCellCoord(Ir+1)))&&_e.call(this,k,C,V,se,Xr,ke,Ne,it))return}},Ye.prototype._convertFromCellCoord=function(k){return(k-this.padding)/this.scale},Ye.prototype._convertToCellCoord=function(k){return Math.max(0,Math.min(this.d-1,Math.floor(k*this.scale)+this.padding))},Ye.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var k=this.cells,C=Le+this.cells.length+1+1,V=0,se=0;se=0)){var hr=k[Gt];Ft[Gt]=xt[kt].shallow.indexOf(Gt)>=0?hr:Ar(hr,C)}k instanceof Error&&(Ft.message=k.message)}if(Ft.$name)throw new Error("$name property is reserved for worker serialization logic.");return kt!=="Object"&&(Ft.$name=kt),Ft}throw new Error("can't serialize object of type "+typeof k)}function Vr(k){if(k==null||typeof k=="boolean"||typeof k=="number"||typeof k=="string"||k instanceof Boolean||k instanceof Number||k instanceof String||k instanceof Date||k instanceof RegExp||$t(k)||Cr(k)||ArrayBuffer.isView(k)||k instanceof ut)return k;if(Array.isArray(k))return k.map(Vr);if(typeof k=="object"){var C=k.$name||"Object",V=xt[C],se=V.klass;if(!se)throw new Error("can't deserialize unregistered class "+C);if(se.deserialize)return se.deserialize(k);for(var _e=Object.create(se.prototype),ke=0,Ne=Object.keys(k);ke=0?kt:Vr(kt)}}return _e}throw new Error("can't deserialize object of type "+typeof k)}var Kr=function(){this.first=!0};Kr.prototype.update=function(C,V){var se=Math.floor(C);return this.first?(this.first=!1,this.lastIntegerZoom=se,this.lastIntegerZoomTime=0,this.lastZoom=C,this.lastFloorZoom=se,!0):(this.lastFloorZoom>se?(this.lastIntegerZoom=se+1,this.lastIntegerZoomTime=V):this.lastFloorZoom=128&&k<=255},Arabic:function(k){return k>=1536&&k<=1791},"Arabic Supplement":function(k){return k>=1872&&k<=1919},"Arabic Extended-A":function(k){return k>=2208&&k<=2303},"Hangul Jamo":function(k){return k>=4352&&k<=4607},"Unified Canadian Aboriginal Syllabics":function(k){return k>=5120&&k<=5759},Khmer:function(k){return k>=6016&&k<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(k){return k>=6320&&k<=6399},"General Punctuation":function(k){return k>=8192&&k<=8303},"Letterlike Symbols":function(k){return k>=8448&&k<=8527},"Number Forms":function(k){return k>=8528&&k<=8591},"Miscellaneous Technical":function(k){return k>=8960&&k<=9215},"Control Pictures":function(k){return k>=9216&&k<=9279},"Optical Character Recognition":function(k){return k>=9280&&k<=9311},"Enclosed Alphanumerics":function(k){return k>=9312&&k<=9471},"Geometric Shapes":function(k){return k>=9632&&k<=9727},"Miscellaneous Symbols":function(k){return k>=9728&&k<=9983},"Miscellaneous Symbols and Arrows":function(k){return k>=11008&&k<=11263},"CJK Radicals Supplement":function(k){return k>=11904&&k<=12031},"Kangxi Radicals":function(k){return k>=12032&&k<=12255},"Ideographic Description Characters":function(k){return k>=12272&&k<=12287},"CJK Symbols and Punctuation":function(k){return k>=12288&&k<=12351},Hiragana:function(k){return k>=12352&&k<=12447},Katakana:function(k){return k>=12448&&k<=12543},Bopomofo:function(k){return k>=12544&&k<=12591},"Hangul Compatibility Jamo":function(k){return k>=12592&&k<=12687},Kanbun:function(k){return k>=12688&&k<=12703},"Bopomofo Extended":function(k){return k>=12704&&k<=12735},"CJK Strokes":function(k){return k>=12736&&k<=12783},"Katakana Phonetic Extensions":function(k){return k>=12784&&k<=12799},"Enclosed CJK Letters and Months":function(k){return k>=12800&&k<=13055},"CJK Compatibility":function(k){return k>=13056&&k<=13311},"CJK Unified Ideographs Extension A":function(k){return k>=13312&&k<=19903},"Yijing Hexagram Symbols":function(k){return k>=19904&&k<=19967},"CJK Unified Ideographs":function(k){return k>=19968&&k<=40959},"Yi Syllables":function(k){return k>=40960&&k<=42127},"Yi Radicals":function(k){return k>=42128&&k<=42191},"Hangul Jamo Extended-A":function(k){return k>=43360&&k<=43391},"Hangul Syllables":function(k){return k>=44032&&k<=55215},"Hangul Jamo Extended-B":function(k){return k>=55216&&k<=55295},"Private Use Area":function(k){return k>=57344&&k<=63743},"CJK Compatibility Ideographs":function(k){return k>=63744&&k<=64255},"Arabic Presentation Forms-A":function(k){return k>=64336&&k<=65023},"Vertical Forms":function(k){return k>=65040&&k<=65055},"CJK Compatibility Forms":function(k){return k>=65072&&k<=65103},"Small Form Variants":function(k){return k>=65104&&k<=65135},"Arabic Presentation Forms-B":function(k){return k>=65136&&k<=65279},"Halfwidth and Fullwidth Forms":function(k){return k>=65280&&k<=65519}};function Ua(k){for(var C=0,V=k;C=65097&&k<=65103)||aa["CJK Compatibility Ideographs"](k)||aa["CJK Compatibility"](k)||aa["CJK Radicals Supplement"](k)||aa["CJK Strokes"](k)||aa["CJK Symbols and Punctuation"](k)&&!(k>=12296&&k<=12305)&&!(k>=12308&&k<=12319)&&k!==12336||aa["CJK Unified Ideographs Extension A"](k)||aa["CJK Unified Ideographs"](k)||aa["Enclosed CJK Letters and Months"](k)||aa["Hangul Compatibility Jamo"](k)||aa["Hangul Jamo Extended-A"](k)||aa["Hangul Jamo Extended-B"](k)||aa["Hangul Jamo"](k)||aa["Hangul Syllables"](k)||aa.Hiragana(k)||aa["Ideographic Description Characters"](k)||aa.Kanbun(k)||aa["Kangxi Radicals"](k)||aa["Katakana Phonetic Extensions"](k)||aa.Katakana(k)&&k!==12540||aa["Halfwidth and Fullwidth Forms"](k)&&k!==65288&&k!==65289&&k!==65293&&!(k>=65306&&k<=65310)&&k!==65339&&k!==65341&&k!==65343&&!(k>=65371&&k<=65503)&&k!==65507&&!(k>=65512&&k<=65519)||aa["Small Form Variants"](k)&&!(k>=65112&&k<=65118)&&!(k>=65123&&k<=65126)||aa["Unified Canadian Aboriginal Syllabics"](k)||aa["Unified Canadian Aboriginal Syllabics Extended"](k)||aa["Vertical Forms"](k)||aa["Yijing Hexagram Symbols"](k)||aa["Yi Syllables"](k)||aa["Yi Radicals"](k))}function Va(k){return!!(aa["Latin-1 Supplement"](k)&&(k===167||k===169||k===174||k===177||k===188||k===189||k===190||k===215||k===247)||aa["General Punctuation"](k)&&(k===8214||k===8224||k===8225||k===8240||k===8241||k===8251||k===8252||k===8258||k===8263||k===8264||k===8265||k===8273)||aa["Letterlike Symbols"](k)||aa["Number Forms"](k)||aa["Miscellaneous Technical"](k)&&(k>=8960&&k<=8967||k>=8972&&k<=8991||k>=8996&&k<=9e3||k===9003||k>=9085&&k<=9114||k>=9150&&k<=9165||k===9167||k>=9169&&k<=9179||k>=9186&&k<=9215)||aa["Control Pictures"](k)&&k!==9251||aa["Optical Character Recognition"](k)||aa["Enclosed Alphanumerics"](k)||aa["Geometric Shapes"](k)||aa["Miscellaneous Symbols"](k)&&!(k>=9754&&k<=9759)||aa["Miscellaneous Symbols and Arrows"](k)&&(k>=11026&&k<=11055||k>=11088&&k<=11097||k>=11192&&k<=11243)||aa["CJK Symbols and Punctuation"](k)||aa.Katakana(k)||aa["Private Use Area"](k)||aa["CJK Compatibility Forms"](k)||aa["Small Form Variants"](k)||aa["Halfwidth and Fullwidth Forms"](k)||k===8734||k===8756||k===8757||k>=9984&&k<=10087||k>=10102&&k<=10131||k===65532||k===65533)}function Ma(k){return!(Ba(k)||Va(k))}function mn(k){return aa.Arabic(k)||aa["Arabic Supplement"](k)||aa["Arabic Extended-A"](k)||aa["Arabic Presentation Forms-A"](k)||aa["Arabic Presentation Forms-B"](k)}function Wn(k){return k>=1424&&k<=2303||aa["Arabic Presentation Forms-A"](k)||aa["Arabic Presentation Forms-B"](k)}function jn(k,C){return!(!C&&Wn(k)||k>=2304&&k<=3583||k>=3840&&k<=4255||aa.Khmer(k))}function Zn(k){for(var C=0,V=k;C-1&&(wi=_i.error),Po&&Po(k)};function sl(){Ms.fire(new kr("pluginStateChange",{pluginStatus:wi,pluginURL:Ji}))}var Ms=new Pr,Kn=function(){return wi},go=function(k){return k({pluginStatus:wi,pluginURL:Ji}),Ms.on("pluginStateChange",k),k},Do=function(k,C,V){if(V===void 0&&(V=!1),wi===_i.deferred||wi===_i.loading||wi===_i.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ji=we.resolveURL(k),wi=_i.deferred,Po=C,sl(),V||Es()},Es=function(){if(wi!==_i.deferred||!Ji)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");wi=_i.loading,sl(),Ji&&na({url:Ji},function(k){k?Vo(k):(wi=_i.loaded,sl())})},hs={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return wi===_i.loaded||hs.applyArabicShaping!=null},isLoading:function(){return wi===_i.loading},setState:function(C){wi=C.pluginStatus,Ji=C.pluginURL},isParsed:function(){return hs.applyArabicShaping!=null&&hs.processBidirectionalText!=null&&hs.processStyledBidirectionalText!=null},getPluginURL:function(){return Ji}},Hl=function(){!hs.isLoading()&&!hs.isLoaded()&&Kn()==="deferred"&&Es()},Qo=function(C,V){this.zoom=C,V?(this.now=V.now,this.fadeDuration=V.fadeDuration,this.zoomHistory=V.zoomHistory,this.transition=V.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Kr,this.transition={})};Qo.prototype.isSupportedScript=function(C){return hi(C,hs.isLoaded())},Qo.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Qo.prototype.getCrossfadeParameters=function(){var C=this.zoom,V=C-Math.floor(C),se=this.crossFadingFactor();return C>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:V+(1-V)*se}:{fromScale:.5,toScale:1,t:1-(1-se)*V}};var _s=function(C,V){this.property=C,this.value=V,this.expression=I(V===void 0?C.specification.default:V,C.specification)};_s.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},_s.prototype.possiblyEvaluate=function(C,V,se){return this.property.possiblyEvaluate(this,C,V,se)};var gu=function(C){this.property=C,this.value=new _s(C,void 0)};gu.prototype.transitioned=function(C,V){return new cr(this.property,this.value,V,_({},C.transition,this.transition),C.now)},gu.prototype.untransitioned=function(){return new cr(this.property,this.value,null,{},0)};var el=function(C){this._properties=C,this._values=Object.create(C.defaultTransitionablePropertyValues)};el.prototype.getValue=function(C){return O(this._values[C].value.value)},el.prototype.setValue=function(C,V){this._values.hasOwnProperty(C)||(this._values[C]=new gu(this._values[C].property)),this._values[C].value=new _s(this._values[C].property,V===null?void 0:O(V))},el.prototype.getTransition=function(C){return O(this._values[C].transition)},el.prototype.setTransition=function(C,V){this._values.hasOwnProperty(C)||(this._values[C]=new gu(this._values[C].property)),this._values[C].transition=O(V)||void 0},el.prototype.serialize=function(){for(var C={},V=0,se=Object.keys(this._values);Vthis.end)return this.prior=null,ke;if(this.value.isDataDriven())return this.prior=null,ke;if(_eNe.zoomHistory.lastIntegerZoom?{from:se,to:_e}:{from:ke,to:_e}},C.prototype.interpolate=function(se){return se},C}(Na),Un=function(C){this.specification=C};Un.prototype.possiblyEvaluate=function(C,V,se,_e){if(C.value!==void 0)if(C.expression.kind==="constant"){var ke=C.expression.evaluate(V,null,{},se,_e);return this._calculate(ke,ke,ke,V)}else return this._calculate(C.expression.evaluate(new Qo(Math.floor(V.zoom-1),V)),C.expression.evaluate(new Qo(Math.floor(V.zoom),V)),C.expression.evaluate(new Qo(Math.floor(V.zoom+1),V)),V)},Un.prototype._calculate=function(C,V,se,_e){var ke=_e.zoom;return ke>_e.zoomHistory.lastIntegerZoom?{from:C,to:V}:{from:se,to:V}},Un.prototype.interpolate=function(C){return C};var Gn=function(C){this.specification=C};Gn.prototype.possiblyEvaluate=function(C,V,se,_e){return!!C.expression.evaluate(V,null,{},se,_e)},Gn.prototype.interpolate=function(){return!1};var ti=function(C){this.properties=C,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(var V in C){var se=C[V];se.specification.overridable&&this.overridableProperties.push(V);var _e=this.defaultPropertyValues[V]=new _s(se,void 0),ke=this.defaultTransitionablePropertyValues[V]=new gu(se);this.defaultTransitioningPropertyValues[V]=ke.untransitioned(),this.defaultPossiblyEvaluatedValues[V]=_e.possiblyEvaluate({})}};zt("DataDrivenProperty",Na),zt("DataConstantProperty",Da),zt("CrossFadedDataDrivenProperty",Hn),zt("CrossFadedProperty",Un),zt("ColorRampProperty",Gn);var Wi="-transition",Ti=function(k){function C(V,se){if(k.call(this),this.id=V.id,this.type=V.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},V.type!=="custom"&&(V=V,this.metadata=V.metadata,this.minzoom=V.minzoom,this.maxzoom=V.maxzoom,V.type!=="background"&&(this.source=V.source,this.sourceLayer=V["source-layer"],this.filter=V.filter),se.layout&&(this._unevaluatedLayout=new xa(se.layout)),se.paint)){this._transitionablePaint=new el(se.paint);for(var _e in V.paint)this.setPaintProperty(_e,V.paint[_e],{validate:!1});for(var ke in V.layout)this.setLayoutProperty(ke,V.layout[ke],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new In(se.paint)}}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},C.prototype.getLayoutProperty=function(se){return se==="visibility"?this.visibility:this._unevaluatedLayout.getValue(se)},C.prototype.setLayoutProperty=function(se,_e,ke){if(ke===void 0&&(ke={}),_e!=null){var Ne="layers."+this.id+".layout."+se;if(this._validate(Al,Ne,se,_e,ke))return}if(se==="visibility"){this.visibility=_e;return}this._unevaluatedLayout.setValue(se,_e)},C.prototype.getPaintProperty=function(se){return z(se,Wi)?this._transitionablePaint.getTransition(se.slice(0,-Wi.length)):this._transitionablePaint.getValue(se)},C.prototype.setPaintProperty=function(se,_e,ke){if(ke===void 0&&(ke={}),_e!=null){var Ne="layers."+this.id+".paint."+se;if(this._validate(vl,Ne,se,_e,ke))return!1}if(z(se,Wi))return this._transitionablePaint.setTransition(se.slice(0,-Wi.length),_e||void 0),!1;var it=this._transitionablePaint._values[se],kt=it.property.specification["property-type"]==="cross-faded-data-driven",Ft=it.value.isDataDriven(),Gt=it.value;this._transitionablePaint.setValue(se,_e),this._handleSpecialPaintPropertyUpdate(se);var hr=this._transitionablePaint._values[se].value,Dr=hr.isDataDriven();return Dr||Ft||kt||this._handleOverridablePaintPropertyUpdate(se,Gt,hr)},C.prototype._handleSpecialPaintPropertyUpdate=function(se){},C.prototype._handleOverridablePaintPropertyUpdate=function(se,_e,ke){return!1},C.prototype.isHidden=function(se){return this.minzoom&&se=this.maxzoom?!0:this.visibility==="none"},C.prototype.updateTransitions=function(se){this._transitioningPaint=this._transitionablePaint.transitioned(se,this._transitioningPaint)},C.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},C.prototype.recalculate=function(se,_e){se.getCrossfadeParameters&&(this._crossfadeParameters=se.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(se,void 0,_e)),this.paint=this._transitioningPaint.possiblyEvaluate(se,void 0,_e)},C.prototype.serialize=function(){var se={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&&(se.layout=se.layout||{},se.layout.visibility=this.visibility),B(se,function(_e,ke){return _e!==void 0&&!(ke==="layout"&&!Object.keys(_e).length)&&!(ke==="paint"&&!Object.keys(_e).length)})},C.prototype._validate=function(se,_e,ke,Ne,it){return it===void 0&&(it={}),it&&it.validate===!1?!1:pu(this,se.call(xo,{key:_e,layerType:this.type,objectKey:ke,value:Ne,styleSpec:Qa,style:{glyphs:!0,sprite:!0}}))},C.prototype.is3D=function(){return!1},C.prototype.isTileClipped=function(){return!1},C.prototype.hasOffscreenPass=function(){return!1},C.prototype.resize=function(){},C.prototype.isStateDependent=function(){for(var se in this.paint._values){var _e=this.paint.get(se);if(!(!(_e instanceof cn)||!Qs(_e.property.specification))&&(_e.value.kind==="source"||_e.value.kind==="composite")&&_e.value.isStateDependent)return!0}return!1},C}(Pr),si={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Fn=function(C,V){this._structArray=C,this._pos1=V*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},qa=128,wn=5,Tn=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};Tn.serialize=function(C,V){return C._trim(),V&&(C.isTransferred=!0,V.push(C.arrayBuffer)),{length:C.length,arrayBuffer:C.arrayBuffer}},Tn.deserialize=function(C){var V=Object.create(this.prototype);return V.arrayBuffer=C.arrayBuffer,V.length=C.length,V.capacity=C.arrayBuffer.byteLength/V.bytesPerElement,V._refreshViews(),V},Tn.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Tn.prototype.clear=function(){this.length=0},Tn.prototype.resize=function(C){this.reserve(C),this.length=C},Tn.prototype.reserve=function(C){if(C>this.capacity){this.capacity=Math.max(C,Math.floor(this.capacity*wn),qa),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var V=this.uint8;this._refreshViews(),V&&this.uint8.set(V)}},Tn.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};function Ln(k,C){C===void 0&&(C=1);var V=0,se=0,_e=k.map(function(Ne){var it=Pn(Ne.type),kt=V=Ri(V,Math.max(C,it)),Ft=Ne.components||1;return se=Math.max(se,it),V+=it*Ft,{name:Ne.name,type:Ne.type,components:Ft,offset:kt}}),ke=Ri(V,Math.max(se,C));return{members:_e,size:ke,alignment:C}}function Pn(k){return si[k].BYTES_PER_ELEMENT}function Ri(k,C){return Math.ceil(k/C)*C}var Xn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e){var ke=this.length;return this.resize(ke+1),this.emplace(ke,se,_e)},C.prototype.emplace=function(se,_e,ke){var Ne=se*2;return this.int16[Ne+0]=_e,this.int16[Ne+1]=ke,se},C}(Tn);Xn.prototype.bytesPerElement=4,zt("StructArrayLayout2i4",Xn);var $i=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne){var it=this.length;return this.resize(it+1),this.emplace(it,se,_e,ke,Ne)},C.prototype.emplace=function(se,_e,ke,Ne,it){var kt=se*4;return this.int16[kt+0]=_e,this.int16[kt+1]=ke,this.int16[kt+2]=Ne,this.int16[kt+3]=it,se},C}(Tn);$i.prototype.bytesPerElement=8,zt("StructArrayLayout4i8",$i);var Cn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt){var Ft=this.length;return this.resize(Ft+1),this.emplace(Ft,se,_e,ke,Ne,it,kt)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft){var Gt=se*6;return this.int16[Gt+0]=_e,this.int16[Gt+1]=ke,this.int16[Gt+2]=Ne,this.int16[Gt+3]=it,this.int16[Gt+4]=kt,this.int16[Gt+5]=Ft,se},C}(Tn);Cn.prototype.bytesPerElement=12,zt("StructArrayLayout2i4i12",Cn);var Mn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt){var Ft=this.length;return this.resize(Ft+1),this.emplace(Ft,se,_e,ke,Ne,it,kt)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft){var Gt=se*4,hr=se*8;return this.int16[Gt+0]=_e,this.int16[Gt+1]=ke,this.uint8[hr+4]=Ne,this.uint8[hr+5]=it,this.uint8[hr+6]=kt,this.uint8[hr+7]=Ft,se},C}(Tn);Mn.prototype.bytesPerElement=8,zt("StructArrayLayout2i4ub8",Mn);var Si=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e){var ke=this.length;return this.resize(ke+1),this.emplace(ke,se,_e)},C.prototype.emplace=function(se,_e,ke){var Ne=se*2;return this.float32[Ne+0]=_e,this.float32[Ne+1]=ke,se},C}(Tn);Si.prototype.bytesPerElement=8,zt("StructArrayLayout2f8",Si);var yn=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr){var Ir=this.length;return this.resize(Ir+1),this.emplace(Ir,se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir){var Xr=se*10;return this.uint16[Xr+0]=_e,this.uint16[Xr+1]=ke,this.uint16[Xr+2]=Ne,this.uint16[Xr+3]=it,this.uint16[Xr+4]=kt,this.uint16[Xr+5]=Ft,this.uint16[Xr+6]=Gt,this.uint16[Xr+7]=hr,this.uint16[Xr+8]=Dr,this.uint16[Xr+9]=Ir,se},C}(Tn);yn.prototype.bytesPerElement=20,zt("StructArrayLayout10ui20",yn);var gi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr){var ba=this.length;return this.resize(ba+1),this.emplace(ba,se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba){var Za=se*12;return this.int16[Za+0]=_e,this.int16[Za+1]=ke,this.int16[Za+2]=Ne,this.int16[Za+3]=it,this.uint16[Za+4]=kt,this.uint16[Za+5]=Ft,this.uint16[Za+6]=Gt,this.uint16[Za+7]=hr,this.int16[Za+8]=Dr,this.int16[Za+9]=Ir,this.int16[Za+10]=Xr,this.int16[Za+11]=ba,se},C}(Tn);gi.prototype.bytesPerElement=24,zt("StructArrayLayout4i4ui4i24",gi);var ri=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke){var Ne=this.length;return this.resize(Ne+1),this.emplace(Ne,se,_e,ke)},C.prototype.emplace=function(se,_e,ke,Ne){var it=se*3;return this.float32[it+0]=_e,this.float32[it+1]=ke,this.float32[it+2]=Ne,se},C}(Tn);ri.prototype.bytesPerElement=12,zt("StructArrayLayout3f12",ri);var ro=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var _e=this.length;return this.resize(_e+1),this.emplace(_e,se)},C.prototype.emplace=function(se,_e){var ke=se*1;return this.uint32[ke+0]=_e,se},C}(Tn);ro.prototype.bytesPerElement=4,zt("StructArrayLayout1ul4",ro);var es=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.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)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr){var Dr=this.length;return this.resize(Dr+1),this.emplace(Dr,se,_e,ke,Ne,it,kt,Ft,Gt,hr)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr){var Ir=se*10,Xr=se*5;return this.int16[Ir+0]=_e,this.int16[Ir+1]=ke,this.int16[Ir+2]=Ne,this.int16[Ir+3]=it,this.int16[Ir+4]=kt,this.int16[Ir+5]=Ft,this.uint32[Xr+3]=Gt,this.uint16[Ir+8]=hr,this.uint16[Ir+9]=Dr,se},C}(Tn);es.prototype.bytesPerElement=20,zt("StructArrayLayout6i1ul2ui20",es);var Fi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt){var Ft=this.length;return this.resize(Ft+1),this.emplace(Ft,se,_e,ke,Ne,it,kt)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft){var Gt=se*6;return this.int16[Gt+0]=_e,this.int16[Gt+1]=ke,this.int16[Gt+2]=Ne,this.int16[Gt+3]=it,this.int16[Gt+4]=kt,this.int16[Gt+5]=Ft,se},C}(Tn);Fi.prototype.bytesPerElement=12,zt("StructArrayLayout2i2i2i12",Fi);var no=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it){var kt=this.length;return this.resize(kt+1),this.emplace(kt,se,_e,ke,Ne,it)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt){var Ft=se*4,Gt=se*8;return this.float32[Ft+0]=_e,this.float32[Ft+1]=ke,this.float32[Ft+2]=Ne,this.int16[Gt+6]=it,this.int16[Gt+7]=kt,se},C}(Tn);no.prototype.bytesPerElement=16,zt("StructArrayLayout2f1f2i16",no);var oi=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne){var it=this.length;return this.resize(it+1),this.emplace(it,se,_e,ke,Ne)},C.prototype.emplace=function(se,_e,ke,Ne,it){var kt=se*12,Ft=se*3;return this.uint8[kt+0]=_e,this.uint8[kt+1]=ke,this.float32[Ft+1]=Ne,this.float32[Ft+2]=it,se},C}(Tn);oi.prototype.bytesPerElement=12,zt("StructArrayLayout2ub2f12",oi);var Xo=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke){var Ne=this.length;return this.resize(Ne+1),this.emplace(Ne,se,_e,ke)},C.prototype.emplace=function(se,_e,ke,Ne){var it=se*3;return this.uint16[it+0]=_e,this.uint16[it+1]=ke,this.uint16[it+2]=Ne,se},C}(Tn);Xo.prototype.bytesPerElement=6,zt("StructArrayLayout3ui6",Xo);var ys=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.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)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a){var vn=this.length;return this.resize(vn+1),this.emplace(vn,se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a,vn){var bn=se*24,Dn=se*12,ui=se*48;return this.int16[bn+0]=_e,this.int16[bn+1]=ke,this.uint16[bn+2]=Ne,this.uint16[bn+3]=it,this.uint32[Dn+2]=kt,this.uint32[Dn+3]=Ft,this.uint32[Dn+4]=Gt,this.uint16[bn+10]=hr,this.uint16[bn+11]=Dr,this.uint16[bn+12]=Ir,this.float32[Dn+7]=Xr,this.float32[Dn+8]=ba,this.uint8[ui+36]=Za,this.uint8[ui+37]=Ra,this.uint8[ui+38]=dn,this.uint32[Dn+10]=$a,this.int16[bn+22]=vn,se},C}(Tn);ys.prototype.bytesPerElement=48,zt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ys);var xs=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.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)},C.prototype.emplaceBack=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a,vn,bn,Dn,ui,ni,Zi,Mi,Bi,Ho,Xi,Qi){var cs=this.length;return this.resize(cs+1),this.emplace(cs,se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a,vn,bn,Dn,ui,ni,Zi,Mi,Bi,Ho,Xi,Qi)},C.prototype.emplace=function(se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a,vn,bn,Dn,ui,ni,Zi,Mi,Bi,Ho,Xi,Qi,cs){var Oo=se*34,rl=se*17;return this.int16[Oo+0]=_e,this.int16[Oo+1]=ke,this.int16[Oo+2]=Ne,this.int16[Oo+3]=it,this.int16[Oo+4]=kt,this.int16[Oo+5]=Ft,this.int16[Oo+6]=Gt,this.int16[Oo+7]=hr,this.uint16[Oo+8]=Dr,this.uint16[Oo+9]=Ir,this.uint16[Oo+10]=Xr,this.uint16[Oo+11]=ba,this.uint16[Oo+12]=Za,this.uint16[Oo+13]=Ra,this.uint16[Oo+14]=dn,this.uint16[Oo+15]=$a,this.uint16[Oo+16]=vn,this.uint16[Oo+17]=bn,this.uint16[Oo+18]=Dn,this.uint16[Oo+19]=ui,this.uint16[Oo+20]=ni,this.uint16[Oo+21]=Zi,this.uint16[Oo+22]=Mi,this.uint32[rl+12]=Bi,this.float32[rl+13]=Ho,this.float32[rl+14]=Xi,this.float32[rl+15]=Qi,this.float32[rl+16]=cs,se},C}(Tn);xs.prototype.bytesPerElement=68,zt("StructArrayLayout8i15ui1ul4f68",xs);var Xs=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var _e=this.length;return this.resize(_e+1),this.emplace(_e,se)},C.prototype.emplace=function(se,_e){var ke=se*1;return this.float32[ke+0]=_e,se},C}(Tn);Xs.prototype.bytesPerElement=4,zt("StructArrayLayout1f4",Xs);var Ps=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke){var Ne=this.length;return this.resize(Ne+1),this.emplace(Ne,se,_e,ke)},C.prototype.emplace=function(se,_e,ke,Ne){var it=se*3;return this.int16[it+0]=_e,this.int16[it+1]=ke,this.int16[it+2]=Ne,se},C}(Tn);Ps.prototype.bytesPerElement=6,zt("StructArrayLayout3i6",Ps);var Mu=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke){var Ne=this.length;return this.resize(Ne+1),this.emplace(Ne,se,_e,ke)},C.prototype.emplace=function(se,_e,ke,Ne){var it=se*2,kt=se*4;return this.uint32[it+0]=_e,this.uint16[kt+2]=ke,this.uint16[kt+3]=Ne,se},C}(Tn);Mu.prototype.bytesPerElement=8,zt("StructArrayLayout1ul2ui8",Mu);var dl=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e){var ke=this.length;return this.resize(ke+1),this.emplace(ke,se,_e)},C.prototype.emplace=function(se,_e,ke){var Ne=se*2;return this.uint16[Ne+0]=_e,this.uint16[Ne+1]=ke,se},C}(Tn);dl.prototype.bytesPerElement=4,zt("StructArrayLayout2ui4",dl);var Eu=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se){var _e=this.length;return this.resize(_e+1),this.emplace(_e,se)},C.prototype.emplace=function(se,_e){var ke=se*1;return this.uint16[ke+0]=_e,se},C}(Tn);Eu.prototype.bytesPerElement=2,zt("StructArrayLayout1ui2",Eu);var ac=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},C.prototype.emplaceBack=function(se,_e,ke,Ne){var it=this.length;return this.resize(it+1),this.emplace(it,se,_e,ke,Ne)},C.prototype.emplace=function(se,_e,ke,Ne,it){var kt=se*4;return this.float32[kt+0]=_e,this.float32[kt+1]=ke,this.float32[kt+2]=Ne,this.float32[kt+3]=it,se},C}(Tn);ac.prototype.bytesPerElement=16,zt("StructArrayLayout4f16",ac);var Lc=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var V={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 V.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},V.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},V.x1.get=function(){return this._structArray.int16[this._pos2+2]},V.y1.get=function(){return this._structArray.int16[this._pos2+3]},V.x2.get=function(){return this._structArray.int16[this._pos2+4]},V.y2.get=function(){return this._structArray.int16[this._pos2+5]},V.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},V.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},V.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},V.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(C.prototype,V),C}(Fn);Lc.prototype.size=20;var Pf=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new Lc(this,se)},C}(es);zt("CollisionBoxArray",Pf);var su=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var V={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 V.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},V.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},V.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},V.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},V.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},V.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},V.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},V.segment.get=function(){return this._structArray.uint16[this._pos2+10]},V.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},V.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},V.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},V.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},V.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},V.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},V.placedOrientation.set=function(se){this._structArray.uint8[this._pos1+37]=se},V.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},V.hidden.set=function(se){this._structArray.uint8[this._pos1+38]=se},V.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},V.crossTileID.set=function(se){this._structArray.uint32[this._pos4+10]=se},V.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(C.prototype,V),C}(Fn);su.prototype.size=48;var zu=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new su(this,se)},C}(ys);zt("PlacedSymbolArray",zu);var Fo=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var V={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 V.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},V.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},V.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},V.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},V.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},V.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},V.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},V.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},V.key.get=function(){return this._structArray.uint16[this._pos2+8]},V.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},V.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},V.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},V.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},V.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},V.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},V.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},V.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},V.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},V.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},V.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},V.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},V.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},V.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},V.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},V.crossTileID.set=function(se){this._structArray.uint32[this._pos4+12]=se},V.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},V.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},V.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},V.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(C.prototype,V),C}(Fn);Fo.prototype.size=68;var nc=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new Fo(this,se)},C}(xs);zt("SymbolInstanceArray",nc);var ll=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getoffsetX=function(se){return this.float32[se*1+0]},C}(Xs);zt("GlyphOffsetArray",ll);var Sl=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.getx=function(se){return this.int16[se*3+0]},C.prototype.gety=function(se){return this.int16[se*3+1]},C.prototype.gettileUnitDistanceFromAnchor=function(se){return this.int16[se*3+2]},C}(Ps);zt("SymbolLineVertexArray",Sl);var qc=function(k){function C(){k.apply(this,arguments)}k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C;var V={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return V.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},V.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},V.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(C.prototype,V),C}(Fn);qc.prototype.size=8;var Hc=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.get=function(se){return new qc(this,se)},C}(Mu);zt("FeatureIndexArray",Hc);var ss=Ln([{name:"a_pos",components:2,type:"Int16"}],4),js=ss.members,ls=function(C){C===void 0&&(C=[]),this.segments=C};ls.prototype.prepareSegment=function(C,V,se,_e){var ke=this.segments[this.segments.length-1];return C>ls.MAX_VERTEX_ARRAY_LENGTH&&U("Max vertices per segment is "+ls.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+C),(!ke||ke.vertexLength+C>ls.MAX_VERTEX_ARRAY_LENGTH||ke.sortKey!==_e)&&(ke={vertexOffset:V.length,primitiveOffset:se.length,vertexLength:0,primitiveLength:0},_e!==void 0&&(ke.sortKey=_e),this.segments.push(ke)),ke},ls.prototype.get=function(){return this.segments},ls.prototype.destroy=function(){for(var C=0,V=this.segments;C>>16)*kt&65535)<<16)&4294967295,Gt=Gt<<15|Gt>>>17,Gt=(Gt&65535)*Ft+(((Gt>>>16)*Ft&65535)<<16)&4294967295,Ne^=Gt,Ne=Ne<<13|Ne>>>19,it=(Ne&65535)*5+(((Ne>>>16)*5&65535)<<16)&4294967295,Ne=(it&65535)+27492+(((it>>>16)+58964&65535)<<16);switch(Gt=0,_e){case 3:Gt^=(V.charCodeAt(hr+2)&255)<<16;case 2:Gt^=(V.charCodeAt(hr+1)&255)<<8;case 1:Gt^=V.charCodeAt(hr)&255,Gt=(Gt&65535)*kt+(((Gt>>>16)*kt&65535)<<16)&4294967295,Gt=Gt<<15|Gt>>>17,Gt=(Gt&65535)*Ft+(((Gt>>>16)*Ft&65535)<<16)&4294967295,Ne^=Gt}return Ne^=V.length,Ne^=Ne>>>16,Ne=(Ne&65535)*2246822507+(((Ne>>>16)*2246822507&65535)<<16)&4294967295,Ne^=Ne>>>13,Ne=(Ne&65535)*3266489909+(((Ne>>>16)*3266489909&65535)<<16)&4294967295,Ne^=Ne>>>16,Ne>>>0}k.exports=C}),te=t(function(k){function C(V,se){for(var _e=V.length,ke=se^_e,Ne=0,it;_e>=4;)it=V.charCodeAt(Ne)&255|(V.charCodeAt(++Ne)&255)<<8|(V.charCodeAt(++Ne)&255)<<16|(V.charCodeAt(++Ne)&255)<<24,it=(it&65535)*1540483477+(((it>>>16)*1540483477&65535)<<16),it^=it>>>24,it=(it&65535)*1540483477+(((it>>>16)*1540483477&65535)<<16),ke=(ke&65535)*1540483477+(((ke>>>16)*1540483477&65535)<<16)^it,_e-=4,++Ne;switch(_e){case 3:ke^=(V.charCodeAt(Ne+2)&255)<<16;case 2:ke^=(V.charCodeAt(Ne+1)&255)<<8;case 1:ke^=V.charCodeAt(Ne)&255,ke=(ke&65535)*1540483477+(((ke>>>16)*1540483477&65535)<<16)}return ke^=ke>>>13,ke=(ke&65535)*1540483477+(((ke>>>16)*1540483477&65535)<<16),ke^=ke>>>15,ke>>>0}k.exports=C}),me=de,Ue=de,tt=te;me.murmur3=Ue,me.murmur2=tt;var ft=function(){this.ids=[],this.positions=[],this.indexed=!1};ft.prototype.add=function(C,V,se,_e){this.ids.push(bt(C)),this.positions.push(V,se,_e)},ft.prototype.getPositions=function(C){for(var V=bt(C),se=0,_e=this.ids.length-1;se<_e;){var ke=se+_e>>1;this.ids[ke]>=V?_e=ke:se=ke+1}for(var Ne=[];this.ids[se]===V;){var it=this.positions[3*se],kt=this.positions[3*se+1],Ft=this.positions[3*se+2];Ne.push({index:it,start:kt,end:Ft}),se++}return Ne},ft.serialize=function(C,V){var se=new Float64Array(C.ids),_e=new Uint32Array(C.positions);return It(se,_e,0,se.length-1),V&&V.push(se.buffer,_e.buffer),{ids:se,positions:_e}},ft.deserialize=function(C){var V=new ft;return V.ids=C.ids,V.positions=C.positions,V.indexed=!0,V};var st=Math.pow(2,53)-1;function bt(k){var C=+k;return!isNaN(C)&&C<=st?C:me(String(k))}function It(k,C,V,se){for(;V>1],ke=V-1,Ne=se+1;;){do ke++;while(k[ke]<_e);do Ne--;while(k[Ne]>_e);if(ke>=Ne)break;Jt(k,ke,Ne),Jt(C,3*ke,3*Ne),Jt(C,3*ke+1,3*Ne+1),Jt(C,3*ke+2,3*Ne+2)}Ne-VNe.x+1||ktNe.y+1)&&U("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return V}function Ds(k,C){return{type:k.type,id:k.id,properties:k.properties,geometry:C?us(k):[]}}function rs(k,C,V,se,_e){k.emplaceBack(C*2+(se+1)/2,V*2+(_e+1)/2)}var ul=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(V){return V.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new Xn,this.indexArray=new Xo,this.segments=new ls,this.programConfigurations=new fn(C.layers,C.zoom),this.stateDependentLayerIds=this.layers.filter(function(V){return V.isStateDependent()}).map(function(V){return V.id})};ul.prototype.populate=function(C,V,se){var _e=this.layers[0],ke=[],Ne=null;_e.type==="circle"&&(Ne=_e.layout.get("circle-sort-key"));for(var it=0,kt=C;it=ai||Dr<0||Dr>=ai)){var Ir=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,C.sortKey),Xr=Ir.vertexLength;rs(this.layoutVertexArray,hr,Dr,-1,-1),rs(this.layoutVertexArray,hr,Dr,1,-1),rs(this.layoutVertexArray,hr,Dr,1,1),rs(this.layoutVertexArray,hr,Dr,-1,1),this.indexArray.emplaceBack(Xr,Xr+1,Xr+2),this.indexArray.emplaceBack(Xr,Xr+3,Xr+2),Ir.vertexLength+=4,Ir.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,C,se,{},_e)},zt("CircleBucket",ul,{omit:["layers"]});function Uo(k,C){for(var V=0;V=3){for(var ke=0;ke<_e.length;ke++)if(Rf(k,_e[ke]))return!0}if(dh(k,_e,V))return!0}return!1}function dh(k,C,V){if(k.length>1){if(ph(k,C))return!0;for(var se=0;se1?k.distSqr(V):k.distSqr(V.sub(C)._mult(_e)._add(C))}function Rh(k,C){for(var V=!1,se,_e,ke,Ne=0;NeC.y!=ke.y>C.y&&C.x<(ke.x-_e.x)*(C.y-_e.y)/(ke.y-_e.y)+_e.x&&(V=!V)}return V}function Rf(k,C){for(var V=!1,se=0,_e=k.length-1;seC.y!=Ne.y>C.y&&C.x<(Ne.x-ke.x)*(C.y-ke.y)/(Ne.y-ke.y)+ke.x&&(V=!V)}return V}function Dh(k,C,V,se,_e){for(var ke=0,Ne=k;ke=it.x&&_e>=it.y)return!0}var kt=[new i(C,V),new i(C,_e),new i(se,_e),new i(se,V)];if(k.length>2)for(var Ft=0,Gt=kt;Ft_e.x&&C.x>_e.x||k.y_e.y&&C.y>_e.y)return!1;var ke=Z(k,C,V[0]);return ke!==Z(k,C,V[1])||ke!==Z(k,C,V[2])||ke!==Z(k,C,V[3])}function Df(k,C,V){var se=C.paint.get(k).value;return se.kind==="constant"?se.value:V.programConfigurations.get(C.id).getMaxValue(k)}function gh(k){return Math.sqrt(k[0]*k[0]+k[1]*k[1])}function Eh(k,C,V,se,_e){if(!C[0]&&!C[1])return k;var ke=i.convert(C)._mult(_e);V==="viewport"&&ke._rotate(-se);for(var Ne=[],it=0;it0&&(ke=1/Math.sqrt(ke)),k[0]=C[0]*ke,k[1]=C[1]*ke,k[2]=C[2]*ke,k}function Tx(k,C){return k[0]*C[0]+k[1]*C[1]+k[2]*C[2]}function Ax(k,C,V){var se=C[0],_e=C[1],ke=C[2],Ne=V[0],it=V[1],kt=V[2];return k[0]=_e*kt-ke*it,k[1]=ke*Ne-se*kt,k[2]=se*it-_e*Ne,k}function Sx(k,C,V){var se=C[0],_e=C[1],ke=C[2];return k[0]=se*V[0]+_e*V[3]+ke*V[6],k[1]=se*V[1]+_e*V[4]+ke*V[7],k[2]=se*V[2]+_e*V[5]+ke*V[8],k}var Mx=Iv;(function(){var k=Pv();return function(C,V,se,_e,ke,Ne){var it,kt;for(V||(V=3),se||(se=0),_e?kt=Math.min(_e*V+se,C.length):kt=C.length,it=se;itk.width||_e.height>k.height||V.x>k.width-_e.width||V.y>k.height-_e.height)throw new RangeError("out of range source coordinates for image copy");if(_e.width>C.width||_e.height>C.height||se.x>C.width-_e.width||se.y>C.height-_e.height)throw new RangeError("out of range destination coordinates for image copy");for(var Ne=k.data,it=C.data,kt=0;kt<_e.height;kt++)for(var Ft=((V.y+kt)*k.width+V.x)*ke,Gt=((se.y+kt)*C.width+se.x)*ke,hr=0;hr<_e.width*ke;hr++)it[Gt+hr]=Ne[Ft+hr];return C}var Ic=function(C,V){vg(this,C,1,V)};Ic.prototype.resize=function(C){dg(this,C,1)},Ic.prototype.clone=function(){return new Ic({width:this.width,height:this.height},new Uint8Array(this.data))},Ic.copy=function(C,V,se,_e,ke){a0(C,V,se,_e,ke,1)};var bf=function(C,V){vg(this,C,4,V)};bf.prototype.resize=function(C){dg(this,C,4)},bf.prototype.replace=function(C,V){V?this.data.set(C):C instanceof Uint8ClampedArray?this.data=new Uint8Array(C.buffer):this.data=C},bf.prototype.clone=function(){return new bf({width:this.width,height:this.height},new Uint8Array(this.data))},bf.copy=function(C,V,se,_e,ke){a0(C,V,se,_e,ke,4)},zt("AlphaImage",Ic),zt("RGBAImage",bf);var tm=new ti({"heatmap-radius":new Na(Qa.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Na(Qa.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Da(Qa.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Gn(Qa.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Da(Qa.paint_heatmap["heatmap-opacity"])}),Rv={paint:tm};function _d(k){var C={},V=k.resolution||256,se=k.clips?k.clips.length:1,_e=k.image||new bf({width:V,height:se}),ke=function(dn,$a,vn){C[k.evaluationKey]=vn;var bn=k.expression.evaluate(C);_e.data[dn+$a+0]=Math.floor(bn.r*255/bn.a),_e.data[dn+$a+1]=Math.floor(bn.g*255/bn.a),_e.data[dn+$a+2]=Math.floor(bn.b*255/bn.a),_e.data[dn+$a+3]=Math.floor(bn.a*255)};if(k.clips)for(var Ft=0,Gt=0;Ft80*V){it=Ft=k[0],kt=Gt=k[1];for(var Xr=V;Xr<_e;Xr+=V)hr=k[Xr],Dr=k[Xr+1],hrFt&&(Ft=hr),Dr>Gt&&(Gt=Dr);Ir=Math.max(Ft-it,Gt-kt),Ir=Ir!==0?1/Ir:0}return Jv(ke,Ne,V,it,kt,Ir),Ne}function pg(k,C,V,se,_e){var ke,Ne;if(_e===bg(k,C,V,se)>0)for(ke=C;ke=C;ke-=se)Ne=om(ke,k[ke],k[ke+1],Ne);return Ne&&bd(Ne,Ne.next)&&(gp(Ne),Ne=Ne.next),Ne}function pv(k,C){if(!k)return k;C||(C=k);var V=k,se;do if(se=!1,!V.steiner&&(bd(V,V.next)||Hu(V.prev,V,V.next)===0)){if(gp(V),V=C=V.prev,V===V.next)break;se=!0}else V=V.next;while(se||V!==C);return C}function Jv(k,C,V,se,_e,ke,Ne){if(k){!Ne&&ke&&yg(k,se,_e,ke);for(var it=k,kt,Ft;k.prev!==k.next;){if(kt=k.prev,Ft=k.next,ke?Rx(k,se,_e,ke):gg(k)){C.push(kt.i/V),C.push(k.i/V),C.push(Ft.i/V),gp(k),k=Ft.next,it=Ft.next;continue}if(k=Ft,k===it){Ne?Ne===1?(k=Dx(pv(k),C,V),Jv(k,C,V,se,_e,ke,2)):Ne===2&&am(k,C,V,se,_e,ke):Jv(pv(k),C,V,se,_e,ke,1);break}}}}function gg(k){var C=k.prev,V=k,se=k.next;if(Hu(C,V,se)>=0)return!1;for(var _e=k.next.next;_e!==k.prev;){if(zv(C.x,C.y,V.x,V.y,se.x,se.y,_e.x,_e.y)&&Hu(_e.prev,_e,_e.next)>=0)return!1;_e=_e.next}return!0}function Rx(k,C,V,se){var _e=k.prev,ke=k,Ne=k.next;if(Hu(_e,ke,Ne)>=0)return!1;for(var it=_e.xke.x?_e.x>Ne.x?_e.x:Ne.x:ke.x>Ne.x?ke.x:Ne.x,Gt=_e.y>ke.y?_e.y>Ne.y?_e.y:Ne.y:ke.y>Ne.y?ke.y:Ne.y,hr=mg(it,kt,C,V,se),Dr=mg(Ft,Gt,C,V,se),Ir=k.prevZ,Xr=k.nextZ;Ir&&Ir.z>=hr&&Xr&&Xr.z<=Dr;){if(Ir!==k.prev&&Ir!==k.next&&zv(_e.x,_e.y,ke.x,ke.y,Ne.x,Ne.y,Ir.x,Ir.y)&&Hu(Ir.prev,Ir,Ir.next)>=0||(Ir=Ir.prevZ,Xr!==k.prev&&Xr!==k.next&&zv(_e.x,_e.y,ke.x,ke.y,Ne.x,Ne.y,Xr.x,Xr.y)&&Hu(Xr.prev,Xr,Xr.next)>=0))return!1;Xr=Xr.nextZ}for(;Ir&&Ir.z>=hr;){if(Ir!==k.prev&&Ir!==k.next&&zv(_e.x,_e.y,ke.x,ke.y,Ne.x,Ne.y,Ir.x,Ir.y)&&Hu(Ir.prev,Ir,Ir.next)>=0)return!1;Ir=Ir.prevZ}for(;Xr&&Xr.z<=Dr;){if(Xr!==k.prev&&Xr!==k.next&&zv(_e.x,_e.y,ke.x,ke.y,Ne.x,Ne.y,Xr.x,Xr.y)&&Hu(Xr.prev,Xr,Xr.next)>=0)return!1;Xr=Xr.nextZ}return!0}function Dx(k,C,V){var se=k;do{var _e=se.prev,ke=se.next.next;!bd(_e,ke)&&$v(_e,se,se.next,ke)&&wd(_e,ke)&&wd(ke,_e)&&(C.push(_e.i/V),C.push(se.i/V),C.push(ke.i/V),gp(se),gp(se.next),se=k=ke),se=se.next}while(se!==k);return pv(se)}function am(k,C,V,se,_e,ke){var Ne=k;do{for(var it=Ne.next.next;it!==Ne.prev;){if(Ne.i!==it.i&&Fx(Ne,it)){var kt=xg(Ne,it);Ne=pv(Ne,Ne.next),kt=pv(kt,kt.next),Jv(Ne,C,V,se,_e,ke),Jv(kt,C,V,se,_e,ke);return}it=it.next}Ne=Ne.next}while(Ne!==k)}function nm(k,C,V,se){var _e=[],ke,Ne,it,kt,Ft;for(ke=0,Ne=C.length;ke=V.next.y&&V.next.y!==V.y){var it=V.x+(_e-V.y)*(V.next.x-V.x)/(V.next.y-V.y);if(it<=se&&it>ke){if(ke=it,it===se){if(_e===V.y)return V;if(_e===V.next.y)return V.next}Ne=V.x=V.x&&V.x>=Ft&&se!==V.x&&zv(_eNe.x||V.x===Ne.x&&im(Ne,V)))&&(Ne=V,hr=Dr)),V=V.next;while(V!==kt);return Ne}function im(k,C){return Hu(k.prev,k,C.prev)<0&&Hu(C.next,k,k.next)<0}function yg(k,C,V,se){var _e=k;do _e.z===null&&(_e.z=mg(_e.x,_e.y,C,V,se)),_e.prevZ=_e.prev,_e.nextZ=_e.next,_e=_e.next;while(_e!==k);_e.prevZ.nextZ=null,_e.prevZ=null,zx(_e)}function zx(k){var C,V,se,_e,ke,Ne,it,kt,Ft=1;do{for(V=k,k=null,ke=null,Ne=0;V;){for(Ne++,se=V,it=0,C=0;C0||kt>0&&se;)it!==0&&(kt===0||!se||V.z<=se.z)?(_e=V,V=V.nextZ,it--):(_e=se,se=se.nextZ,kt--),ke?ke.nextZ=_e:k=_e,_e.prevZ=ke,ke=_e;V=se}ke.nextZ=null,Ft*=2}while(Ne>1);return k}function mg(k,C,V,se,_e){return k=32767*(k-V)*_e,C=32767*(C-se)*_e,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,C=(C|C<<8)&16711935,C=(C|C<<4)&252645135,C=(C|C<<2)&858993459,C=(C|C<<1)&1431655765,k|C<<1}function l0(k){var C=k,V=k;do(C.x=0&&(k-Ne)*(se-it)-(V-Ne)*(C-it)>=0&&(V-Ne)*(ke-it)-(_e-Ne)*(se-it)>=0}function Fx(k,C){return k.next.i!==C.i&&k.prev.i!==C.i&&!_g(k,C)&&(wd(k,C)&&wd(C,k)&&u0(k,C)&&(Hu(k.prev,k,C.prev)||Hu(k,C.prev,C))||bd(k,C)&&Hu(k.prev,k,k.next)>0&&Hu(C.prev,C,C.next)>0)}function Hu(k,C,V){return(C.y-k.y)*(V.x-C.x)-(C.x-k.x)*(V.y-C.y)}function bd(k,C){return k.x===C.x&&k.y===C.y}function $v(k,C,V,se){var _e=pp(Hu(k,C,V)),ke=pp(Hu(k,C,se)),Ne=pp(Hu(V,se,k)),it=pp(Hu(V,se,C));return!!(_e!==ke&&Ne!==it||_e===0&&dp(k,V,C)||ke===0&&dp(k,se,C)||Ne===0&&dp(V,k,se)||it===0&&dp(V,C,se))}function dp(k,C,V){return C.x<=Math.max(k.x,V.x)&&C.x>=Math.min(k.x,V.x)&&C.y<=Math.max(k.y,V.y)&&C.y>=Math.min(k.y,V.y)}function pp(k){return k>0?1:k<0?-1:0}function _g(k,C){var V=k;do{if(V.i!==k.i&&V.next.i!==k.i&&V.i!==C.i&&V.next.i!==C.i&&$v(V,V.next,k,C))return!0;V=V.next}while(V!==k);return!1}function wd(k,C){return Hu(k.prev,k,k.next)<0?Hu(k,C,k.next)>=0&&Hu(k,k.prev,C)>=0:Hu(k,C,k.prev)<0||Hu(k,k.next,C)<0}function u0(k,C){var V=k,se=!1,_e=(k.x+C.x)/2,ke=(k.y+C.y)/2;do V.y>ke!=V.next.y>ke&&V.next.y!==V.y&&_e<(V.next.x-V.x)*(ke-V.y)/(V.next.y-V.y)+V.x&&(se=!se),V=V.next;while(V!==k);return se}function xg(k,C){var V=new c0(k.i,k.x,k.y),se=new c0(C.i,C.x,C.y),_e=k.next,ke=C.prev;return k.next=C,C.prev=k,V.next=_e,_e.prev=V,se.next=V,V.prev=se,ke.next=se,se.prev=ke,se}function om(k,C,V,se){var _e=new c0(k,C,V);return se?(_e.next=se.next,_e.prev=se,se.next.prev=_e,se.next=_e):(_e.prev=_e,_e.next=_e),_e}function gp(k){k.next.prev=k.prev,k.prev.next=k.next,k.prevZ&&(k.prevZ.nextZ=k.nextZ),k.nextZ&&(k.nextZ.prevZ=k.prevZ)}function c0(k,C,V){this.i=k,this.x=C,this.y=V,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}s0.deviation=function(k,C,V,se){var _e=C&&C.length,ke=_e?C[0]*V:k.length,Ne=Math.abs(bg(k,0,ke,V));if(_e)for(var it=0,kt=C.length;it0&&(se+=k[_e-1].length,V.holes.push(se))}return V},o0.default=rm;function Ox(k,C,V,se,_e){sm(k,C,V,se||k.length-1,_e||wg)}function sm(k,C,V,se,_e){for(;se>V;){if(se-V>600){var ke=se-V+1,Ne=C-V+1,it=Math.log(ke),kt=.5*Math.exp(2*it/3),Ft=.5*Math.sqrt(it*kt*(ke-kt)/ke)*(Ne-ke/2<0?-1:1),Gt=Math.max(V,Math.floor(C-Ne*kt/ke+Ft)),hr=Math.min(se,Math.floor(C+(ke-Ne)*kt/ke+Ft));sm(k,C,Gt,hr,_e)}var Dr=k[C],Ir=V,Xr=se;for(yp(k,V,C),_e(k[se],Dr)>0&&yp(k,V,se);Ir0;)Xr--}_e(k[V],Dr)===0?yp(k,V,Xr):(Xr++,yp(k,Xr,se)),Xr<=C&&(V=Xr+1),C<=Xr&&(se=Xr-1)}}function yp(k,C,V){var se=k[C];k[C]=k[V],k[V]=se}function wg(k,C){return kC?1:0}function Qh(k,C){var V=k.length;if(V<=1)return[k];for(var se=[],_e,ke,Ne=0;Ne1)for(var kt=0;kt>3}if(se--,V===1||V===2)_e+=k.readSVarint(),ke+=k.readSVarint(),V===1&&(it&&Ne.push(it),it=[]),it.push(new i(_e,ke));else if(V===7)it&&it.push(it[0].clone());else throw new Error("unknown command "+V)}return it&&Ne.push(it),Ne},Qv.prototype.bbox=function(){var k=this._pbf;k.pos=this._geometry;for(var C=k.readVarint()+k.pos,V=1,se=0,_e=0,ke=0,Ne=1/0,it=-1/0,kt=1/0,Ft=-1/0;k.pos>3}if(se--,V===1||V===2)_e+=k.readSVarint(),ke+=k.readSVarint(),_eit&&(it=_e),keFt&&(Ft=ke);else if(V!==7)throw new Error("unknown command "+V)}return[Ne,kt,it,Ft]},Qv.prototype.toGeoJSON=function(k,C,V){var se=this.extent*Math.pow(2,V),_e=this.extent*k,ke=this.extent*C,Ne=this.loadGeometry(),it=Qv.types[this.type],kt,Ft;function Gt(Ir){for(var Xr=0;Xr>3;C=se===1?k.readString():se===2?k.readFloat():se===3?k.readDouble():se===4?k.readVarint64():se===5?k.readVarint():se===6?k.readSVarint():se===7?k.readBoolean():null}return C}gm.prototype.feature=function(k){if(k<0||k>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[k];var C=this._pbf.readVarint()+this._pbf.pos;return new Td(this._pbf,C,this.extent,this._keys,this._values)};var mm=_m;function _m(k,C){this.layers=k.readFields(xm,{},C)}function xm(k,C,V){if(k===3){var se=new Sg(V,V.readVarint()+V.pos);se.length&&(C[se.name]=se)}}var bm=mm,Bx=Td,Nx=Sg,ed={VectorTile:bm,VectorTileFeature:Bx,VectorTileLayer:Nx},Ad=ed.VectorTileFeature.types,wm=500,Sd=Math.pow(2,13);function Md(k,C,V,se,_e,ke,Ne,it){k.emplaceBack(C,V,Math.floor(se*Sd)*2+Ne,_e*Sd*2,ke*Sd*2,Math.round(it))}var _h=function(C){this.zoom=C.zoom,this.overscaling=C.overscaling,this.layers=C.layers,this.layerIds=this.layers.map(function(V){return V.id}),this.index=C.index,this.hasPattern=!1,this.layoutVertexArray=new Cn,this.indexArray=new Xo,this.programConfigurations=new fn(C.layers,C.zoom),this.segments=new ls,this.stateDependentLayerIds=this.layers.filter(function(V){return V.isStateDependent()}).map(function(V){return V.id})};_h.prototype.populate=function(C,V,se){this.features=[],this.hasPattern=f0("fill-extrusion",this.layers,V);for(var _e=0,ke=C;_e=1){var vn=Za[dn-1];if(!v0($a,vn)){Ir.vertexLength+4>ls.MAX_VERTEX_ARRAY_LENGTH&&(Ir=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var bn=$a.sub(vn)._perp()._unit(),Dn=vn.dist($a);Ra+Dn>32768&&(Ra=0),Md(this.layoutVertexArray,$a.x,$a.y,bn.x,bn.y,0,0,Ra),Md(this.layoutVertexArray,$a.x,$a.y,bn.x,bn.y,0,1,Ra),Ra+=Dn,Md(this.layoutVertexArray,vn.x,vn.y,bn.x,bn.y,0,0,Ra),Md(this.layoutVertexArray,vn.x,vn.y,bn.x,bn.y,0,1,Ra);var ui=Ir.vertexLength;this.indexArray.emplaceBack(ui,ui+2,ui+1),this.indexArray.emplaceBack(ui+1,ui+2,ui+3),Ir.vertexLength+=4,Ir.primitiveLength+=2}}}}if(Ir.vertexLength+Ft>ls.MAX_VERTEX_ARRAY_LENGTH&&(Ir=this.segments.prepareSegment(Ft,this.layoutVertexArray,this.indexArray)),Ad[C.type]==="Polygon"){for(var ni=[],Zi=[],Mi=Ir.vertexLength,Bi=0,Ho=kt;Biai)||k.y===C.y&&(k.y<0||k.y>ai)}function d0(k){return k.every(function(C){return C.x<0})||k.every(function(C){return C.x>ai})||k.every(function(C){return C.y<0})||k.every(function(C){return C.y>ai})}var Ux=new ti({"fill-extrusion-opacity":new Da(Qa["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Na(Qa["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Da(Qa["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Da(Qa["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Hn(Qa["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Na(Qa["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Na(Qa["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Da(Qa["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),jx={paint:Ux},Vx=function(k){function C(V){k.call(this,V,jx)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.createBucket=function(se){return new _h(se)},C.prototype.queryRadius=function(){return gh(this.paint.get("fill-extrusion-translate"))},C.prototype.is3D=function(){return!0},C.prototype.queryIntersectsFeature=function(se,_e,ke,Ne,it,kt,Ft,Gt){var hr=Eh(se,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),kt.angle,Ft),Dr=this.paint.get("fill-extrusion-height").evaluate(_e,ke),Ir=this.paint.get("fill-extrusion-base").evaluate(_e,ke),Xr=Tm(hr,Gt,kt,0),ba=Mg(Ne,Ir,Dr,Gt),Za=ba[0],Ra=ba[1];return Ov(Za,Ra,Xr)},C}(Ti);function ev(k,C){return k.x*C.x+k.y*C.y}function sf(k,C){if(k.length===1){for(var V=0,se=C[V++],_e;!_e||se.equals(_e);)if(_e=C[V++],!_e)return 1/0;for(;V=2&&C[Ft-1].equals(C[Ft-2]);)Ft--;for(var Gt=0;Gt0;if(ni&&dn>Gt){var Mi=Ir.dist(Xr);if(Mi>2*hr){var Bi=Ir.sub(Ir.sub(Xr)._mult(hr/Mi)._round());this.updateDistance(Xr,Bi),this.addCurrentVertex(Bi,Za,0,0,Dr),Xr=Bi}}var Ho=Xr&&ba,Xi=Ho?se:kt?"butt":_e;if(Ho&&Xi==="round"&&(Dnke&&(Xi="bevel"),Xi==="bevel"&&(Dn>2&&(Xi="flipbevel"),Dn100)$a=Ra.mult(-1);else{var Qi=Dn*Za.add(Ra).mag()/Za.sub(Ra).mag();$a._perp()._mult(Qi*(Zi?-1:1))}this.addCurrentVertex(Ir,$a,0,0,Dr),this.addCurrentVertex(Ir,$a.mult(-1),0,0,Dr)}else if(Xi==="bevel"||Xi==="fakeround"){var cs=-Math.sqrt(Dn*Dn-1),Oo=Zi?cs:0,rl=Zi?0:cs;if(Xr&&this.addCurrentVertex(Ir,Za,Oo,rl,Dr),Xi==="fakeround")for(var Il=Math.round(ui*180/Math.PI/Cg),al=1;al2*hr){var Oc=Ir.add(ba.sub(Ir)._mult(hr/ff)._round());this.updateDistance(Ir,Oc),this.addCurrentVertex(Oc,Ra,0,0,Dr),Ir=Oc}}}}},wf.prototype.addCurrentVertex=function(C,V,se,_e,ke,Ne){Ne===void 0&&(Ne=!1);var it=V.x+V.y*se,kt=V.y-V.x*se,Ft=-V.x+V.y*_e,Gt=-V.y-V.x*_e;this.addHalfVertex(C,it,kt,Ne,!1,se,ke),this.addHalfVertex(C,Ft,Gt,Ne,!0,-_e,ke),this.distance>p0/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(C,V,se,_e,ke,Ne))},wf.prototype.addHalfVertex=function(C,V,se,_e,ke,Ne,it){var kt=C.x,Ft=C.y,Gt=this.lineClips?this.scaledDistance*(p0-1):this.scaledDistance,hr=Gt*Ed;if(this.layoutVertexArray.emplaceBack((kt<<1)+(_e?1:0),(Ft<<1)+(ke?1:0),Math.round(Em*V)+128,Math.round(Em*se)+128,(Ne===0?0:Ne<0?-1:1)+1|(hr&63)<<2,hr>>6),this.lineClips){var Dr=this.scaledDistance-this.lineClips.start,Ir=this.lineClips.end-this.lineClips.start,Xr=Dr/Ir;this.layoutVertexArray2.emplaceBack(Xr,this.lineClipsArray.length)}var ba=it.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,ba),it.primitiveLength++),ke?this.e2=ba:this.e1=ba},wf.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},wf.prototype.updateDistance=function(C,V){this.distance+=C.dist(V),this.updateScaledDistance()},zt("LineBucket",wf,{omit:["layers","patternFeatures"]});var Lg=new ti({"line-cap":new Da(Qa.layout_line["line-cap"]),"line-join":new Na(Qa.layout_line["line-join"]),"line-miter-limit":new Da(Qa.layout_line["line-miter-limit"]),"line-round-limit":new Da(Qa.layout_line["line-round-limit"]),"line-sort-key":new Na(Qa.layout_line["line-sort-key"])}),g0=new ti({"line-opacity":new Na(Qa.paint_line["line-opacity"]),"line-color":new Na(Qa.paint_line["line-color"]),"line-translate":new Da(Qa.paint_line["line-translate"]),"line-translate-anchor":new Da(Qa.paint_line["line-translate-anchor"]),"line-width":new Na(Qa.paint_line["line-width"]),"line-gap-width":new Na(Qa.paint_line["line-gap-width"]),"line-offset":new Na(Qa.paint_line["line-offset"]),"line-blur":new Na(Qa.paint_line["line-blur"]),"line-dasharray":new Un(Qa.paint_line["line-dasharray"]),"line-pattern":new Hn(Qa.paint_line["line-pattern"]),"line-gradient":new Gn(Qa.paint_line["line-gradient"])}),kd={paint:g0,layout:Lg},Pg=function(k){function C(){k.apply(this,arguments)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.possiblyEvaluate=function(se,_e){return _e=new Qo(Math.floor(_e.zoom),{now:_e.now,fadeDuration:_e.fadeDuration,zoomHistory:_e.zoomHistory,transition:_e.transition}),k.prototype.possiblyEvaluate.call(this,se,_e)},C.prototype.evaluate=function(se,_e,ke,Ne){return _e=_({},_e,{zoom:Math.floor(_e.zoom)}),k.prototype.evaluate.call(this,se,_e,ke,Ne)},C}(Na),y0=new Pg(kd.paint.properties["line-width"].specification);y0.useIntegerZoom=!0;var Ig=function(k){function C(V){k.call(this,V,kd),this.gradientVersion=0}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype._handleSpecialPaintPropertyUpdate=function(se){if(se==="line-gradient"){var _e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=_e._styleExpression.expression instanceof au,this.gradientVersion=(this.gradientVersion+1)%f}},C.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},C.prototype.recalculate=function(se,_e){k.prototype.recalculate.call(this,se,_e),this.paint._values["line-floorwidth"]=y0.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,se)},C.prototype.createBucket=function(se){return new wf(se)},C.prototype.queryRadius=function(se){var _e=se,ke=Lm(Df("line-width",this,_e),Df("line-gap-width",this,_e)),Ne=Df("line-offset",this,_e);return ke/2+Math.abs(Ne)+gh(this.paint.get("line-translate"))},C.prototype.queryIntersectsFeature=function(se,_e,ke,Ne,it,kt,Ft){var Gt=Eh(se,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),kt.angle,Ft),hr=Ft/2*Lm(this.paint.get("line-width").evaluate(_e,ke),this.paint.get("line-gap-width").evaluate(_e,ke)),Dr=this.paint.get("line-offset").evaluate(_e,ke);return Dr&&(Ne=H(Ne,Dr*Ft)),fc(Gt,Ne,hr)},C.prototype.isTileClipped=function(){return!0},C}(Ti);function Lm(k,C){return C>0?C+2*k:k}function H(k,C){for(var V=[],se=new i(0,0),_e=0;_e":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Xt(k){for(var C="",V=0;V>1,Gt=-7,hr=V?_e-1:0,Dr=V?-1:1,Ir=k[C+hr];for(hr+=Dr,ke=Ir&(1<<-Gt)-1,Ir>>=-Gt,Gt+=it;Gt>0;ke=ke*256+k[C+hr],hr+=Dr,Gt-=8);for(Ne=ke&(1<<-Gt)-1,ke>>=-Gt,Gt+=se;Gt>0;Ne=Ne*256+k[C+hr],hr+=Dr,Gt-=8);if(ke===0)ke=1-Ft;else{if(ke===kt)return Ne?NaN:(Ir?-1:1)*(1/0);Ne=Ne+Math.pow(2,se),ke=ke-Ft}return(Ir?-1:1)*Ne*Math.pow(2,ke-se)},Rr=function(k,C,V,se,_e,ke){var Ne,it,kt,Ft=ke*8-_e-1,Gt=(1<>1,Dr=_e===23?Math.pow(2,-24)-Math.pow(2,-77):0,Ir=se?0:ke-1,Xr=se?1:-1,ba=C<0||C===0&&1/C<0?1:0;for(C=Math.abs(C),isNaN(C)||C===1/0?(it=isNaN(C)?1:0,Ne=Gt):(Ne=Math.floor(Math.log(C)/Math.LN2),C*(kt=Math.pow(2,-Ne))<1&&(Ne--,kt*=2),Ne+hr>=1?C+=Dr/kt:C+=Dr*Math.pow(2,1-hr),C*kt>=2&&(Ne++,kt/=2),Ne+hr>=Gt?(it=0,Ne=Gt):Ne+hr>=1?(it=(C*kt-1)*Math.pow(2,_e),Ne=Ne+hr):(it=C*Math.pow(2,hr-1)*Math.pow(2,_e),Ne=0));_e>=8;k[V+Ir]=it&255,Ir+=Xr,it/=256,_e-=8);for(Ne=Ne<<_e|it,Ft+=_e;Ft>0;k[V+Ir]=Ne&255,Ir+=Xr,Ne/=256,Ft-=8);k[V+Ir-Xr]|=ba*128},jr={read:br,write:Rr},Yr=ca;function ca(k){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(k)?k:new Uint8Array(k||0),this.pos=0,this.type=0,this.length=this.buf.length}ca.Varint=0,ca.Fixed64=1,ca.Bytes=2,ca.Fixed32=5;var Ca=65536*65536,un=1/Ca,Ha=12,rn=typeof TextDecoder>"u"?null:new TextDecoder("utf8");ca.prototype={destroy:function(){this.buf=null},readFields:function(k,C,V){for(V=V||this.length;this.pos>3,ke=this.pos;this.type=se&7,k(_e,C,this),this.pos===ke&&this.skip(se)}return C},readMessage:function(k,C){return this.readFields(k,C,this.readVarint()+this.pos)},readFixed32:function(){var k=ih(this.buf,this.pos);return this.pos+=4,k},readSFixed32:function(){var k=Rc(this.buf,this.pos);return this.pos+=4,k},readFixed64:function(){var k=ih(this.buf,this.pos)+ih(this.buf,this.pos+4)*Ca;return this.pos+=8,k},readSFixed64:function(){var k=ih(this.buf,this.pos)+Rc(this.buf,this.pos+4)*Ca;return this.pos+=8,k},readFloat:function(){var k=jr.read(this.buf,this.pos,!0,23,4);return this.pos+=4,k},readDouble:function(){var k=jr.read(this.buf,this.pos,!0,52,8);return this.pos+=8,k},readVarint:function(k){var C=this.buf,V,se;return se=C[this.pos++],V=se&127,se<128||(se=C[this.pos++],V|=(se&127)<<7,se<128)||(se=C[this.pos++],V|=(se&127)<<14,se<128)||(se=C[this.pos++],V|=(se&127)<<21,se<128)?V:(se=C[this.pos],V|=(se&15)<<28,Sn(V,k,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var k=this.readVarint();return k%2===1?(k+1)/-2:k/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var k=this.readVarint()+this.pos,C=this.pos;return this.pos=k,k-C>=Ha&&rn?Kf(this.buf,C,k):Yf(this.buf,C,k)},readBytes:function(){var k=this.readVarint()+this.pos,C=this.buf.subarray(this.pos,k);return this.pos=k,C},readPackedVarint:function(k,C){if(this.type!==ca.Bytes)return k.push(this.readVarint(C));var V=$n(this);for(k=k||[];this.pos127;);else if(C===ca.Bytes)this.pos=this.readVarint()+this.pos;else if(C===ca.Fixed32)this.pos+=4;else if(C===ca.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+C)},writeTag:function(k,C){this.writeVarint(k<<3|C)},realloc:function(k){for(var C=this.length||16;C268435455||k<0){qo(k,this);return}this.realloc(4),this.buf[this.pos++]=k&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=(k>>>=7)&127|(k>127?128:0),!(k<=127)&&(this.buf[this.pos++]=k>>>7&127)))},writeSVarint:function(k){this.writeVarint(k<0?-k*2-1:k*2)},writeBoolean:function(k){this.writeVarint(!!k)},writeString:function(k){k=String(k),this.realloc(k.length*4),this.pos++;var C=this.pos;this.pos=Jf(this.buf,k,this.pos);var V=this.pos-C;V>=128&&mo(C,V,this),this.pos=C-1,this.writeVarint(V),this.pos+=V},writeFloat:function(k){this.realloc(4),jr.write(this.buf,k,this.pos,!0,23,4),this.pos+=4},writeDouble:function(k){this.realloc(8),jr.write(this.buf,k,this.pos,!0,52,8),this.pos+=8},writeBytes:function(k){var C=k.length;this.writeVarint(C),this.realloc(C);for(var V=0;V=128&&mo(V,se,this),this.pos=V-1,this.writeVarint(se),this.pos+=se},writeMessage:function(k,C,V){this.writeTag(k,ca.Bytes),this.writeRawMessage(C,V)},writePackedVarint:function(k,C){C.length&&this.writeMessage(k,so,C)},writePackedSVarint:function(k,C){C.length&&this.writeMessage(k,to,C)},writePackedBoolean:function(k,C){C.length&&this.writeMessage(k,_o,C)},writePackedFloat:function(k,C){C.length&&this.writeMessage(k,zn,C)},writePackedDouble:function(k,C){C.length&&this.writeMessage(k,To,C)},writePackedFixed32:function(k,C){C.length&&this.writeMessage(k,ts,C)},writePackedSFixed32:function(k,C){C.length&&this.writeMessage(k,Gl,C)},writePackedFixed64:function(k,C){C.length&&this.writeMessage(k,Nl,C)},writePackedSFixed64:function(k,C){C.length&&this.writeMessage(k,Gc,C)},writeBytesField:function(k,C){this.writeTag(k,ca.Bytes),this.writeBytes(C)},writeFixed32Field:function(k,C){this.writeTag(k,ca.Fixed32),this.writeFixed32(C)},writeSFixed32Field:function(k,C){this.writeTag(k,ca.Fixed32),this.writeSFixed32(C)},writeFixed64Field:function(k,C){this.writeTag(k,ca.Fixed64),this.writeFixed64(C)},writeSFixed64Field:function(k,C){this.writeTag(k,ca.Fixed64),this.writeSFixed64(C)},writeVarintField:function(k,C){this.writeTag(k,ca.Varint),this.writeVarint(C)},writeSVarintField:function(k,C){this.writeTag(k,ca.Varint),this.writeSVarint(C)},writeStringField:function(k,C){this.writeTag(k,ca.Bytes),this.writeString(C)},writeFloatField:function(k,C){this.writeTag(k,ca.Fixed32),this.writeFloat(C)},writeDoubleField:function(k,C){this.writeTag(k,ca.Fixed64),this.writeDouble(C)},writeBooleanField:function(k,C){this.writeVarintField(k,!!C)}};function Sn(k,C,V){var se=V.buf,_e,ke;if(ke=se[V.pos++],_e=(ke&112)>>4,ke<128||(ke=se[V.pos++],_e|=(ke&127)<<3,ke<128)||(ke=se[V.pos++],_e|=(ke&127)<<10,ke<128)||(ke=se[V.pos++],_e|=(ke&127)<<17,ke<128)||(ke=se[V.pos++],_e|=(ke&127)<<24,ke<128)||(ke=se[V.pos++],_e|=(ke&1)<<31,ke<128))return Oi(k,_e,C);throw new Error("Expected varint not more than 10 bytes")}function $n(k){return k.type===ca.Bytes?k.readVarint()+k.pos:k.pos+1}function Oi(k,C,V){return V?C*4294967296+(k>>>0):(C>>>0)*4294967296+(k>>>0)}function qo(k,C){var V,se;if(k>=0?(V=k%4294967296|0,se=k/4294967296|0):(V=~(-k%4294967296),se=~(-k/4294967296),V^4294967295?V=V+1|0:(V=0,se=se+1|0)),k>=18446744073709552e3||k<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");C.realloc(10),qi(V,se,C),Di(se,C)}function qi(k,C,V){V.buf[V.pos++]=k&127|128,k>>>=7,V.buf[V.pos++]=k&127|128,k>>>=7,V.buf[V.pos++]=k&127|128,k>>>=7,V.buf[V.pos++]=k&127|128,k>>>=7,V.buf[V.pos]=k&127}function Di(k,C){var V=(k&7)<<4;C.buf[C.pos++]|=V|((k>>>=3)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127|((k>>>=7)?128:0),k&&(C.buf[C.pos++]=k&127)))))}function mo(k,C,V){var se=C<=16383?1:C<=2097151?2:C<=268435455?3:Math.floor(Math.log(C)/(Math.LN2*7));V.realloc(se);for(var _e=V.pos-1;_e>=k;_e--)V.buf[_e+se]=V.buf[_e]}function so(k,C){for(var V=0;V>>8,k[V+2]=C>>>16,k[V+3]=C>>>24}function Rc(k,C){return(k[C]|k[C+1]<<8|k[C+2]<<16)+(k[C+3]<<24)}function Yf(k,C,V){for(var se="",_e=C;_e239?4:ke>223?3:ke>191?2:1;if(_e+it>V)break;var kt,Ft,Gt;it===1?ke<128&&(Ne=ke):it===2?(kt=k[_e+1],(kt&192)===128&&(Ne=(ke&31)<<6|kt&63,Ne<=127&&(Ne=null))):it===3?(kt=k[_e+1],Ft=k[_e+2],(kt&192)===128&&(Ft&192)===128&&(Ne=(ke&15)<<12|(kt&63)<<6|Ft&63,(Ne<=2047||Ne>=55296&&Ne<=57343)&&(Ne=null))):it===4&&(kt=k[_e+1],Ft=k[_e+2],Gt=k[_e+3],(kt&192)===128&&(Ft&192)===128&&(Gt&192)===128&&(Ne=(ke&15)<<18|(kt&63)<<12|(Ft&63)<<6|Gt&63,(Ne<=65535||Ne>=1114112)&&(Ne=null))),Ne===null?(Ne=65533,it=1):Ne>65535&&(Ne-=65536,se+=String.fromCharCode(Ne>>>10&1023|55296),Ne=56320|Ne&1023),se+=String.fromCharCode(Ne),_e+=it}return se}function Kf(k,C,V){return rn.decode(k.subarray(C,V))}function Jf(k,C,V){for(var se=0,_e,ke;se55295&&_e<57344)if(ke)if(_e<56320){k[V++]=239,k[V++]=191,k[V++]=189,ke=_e;continue}else _e=ke-55296<<10|_e-56320|65536,ke=null;else{_e>56319||se+1===C.length?(k[V++]=239,k[V++]=191,k[V++]=189):ke=_e;continue}else ke&&(k[V++]=239,k[V++]=191,k[V++]=189,ke=null);_e<128?k[V++]=_e:(_e<2048?k[V++]=_e>>6|192:(_e<65536?k[V++]=_e>>12|224:(k[V++]=_e>>18|240,k[V++]=_e>>12&63|128),k[V++]=_e>>6&63|128),k[V++]=_e&63|128)}return V}var Ou=3;function Wc(k,C,V){k===1&&V.readMessage(Ff,C)}function Ff(k,C,V){if(k===3){var se=V.readMessage(Tf,{}),_e=se.id,ke=se.bitmap,Ne=se.width,it=se.height,kt=se.left,Ft=se.top,Gt=se.advance;C.push({id:_e,bitmap:new Ic({width:Ne+2*Ou,height:it+2*Ou},ke),metrics:{width:Ne,height:it,left:kt,top:Ft,advance:Gt}})}}function Tf(k,C,V){k===1?C.id=V.readVarint():k===2?C.bitmap=V.readBytes():k===3?C.width=V.readVarint():k===4?C.height=V.readVarint():k===5?C.left=V.readSVarint():k===6?C.top=V.readSVarint():k===7&&(C.advance=V.readVarint())}function $f(k){return new Yr(k).readFields(Wc,[])}var lf=Ou;function xh(k){for(var C=0,V=0,se=0,_e=k;se<_e.length;se+=1){var ke=_e[se];C+=ke.w*ke.h,V=Math.max(V,ke.w)}k.sort(function(Za,Ra){return Ra.h-Za.h});for(var Ne=Math.max(Math.ceil(Math.sqrt(C/.95)),V),it=[{x:0,y:0,w:Ne,h:1/0}],kt=0,Ft=0,Gt=0,hr=k;Gt=0;Ir--){var Xr=it[Ir];if(!(Dr.w>Xr.w||Dr.h>Xr.h)){if(Dr.x=Xr.x,Dr.y=Xr.y,Ft=Math.max(Ft,Dr.y+Dr.h),kt=Math.max(kt,Dr.x+Dr.w),Dr.w===Xr.w&&Dr.h===Xr.h){var ba=it.pop();Ir=0&&_e>=C&&bh[this.text.charCodeAt(_e)];_e--)se--;this.text=this.text.substring(C,se),this.sectionIndex=this.sectionIndex.slice(C,se)},Wl.prototype.substring=function(C,V){var se=new Wl;return se.text=this.text.substring(C,V),se.sectionIndex=this.sectionIndex.slice(C,V),se.sections=this.sections,se},Wl.prototype.toString=function(){return this.text},Wl.prototype.getMaxScale=function(){var C=this;return this.sectionIndex.reduce(function(V,se){return Math.max(V,C.sections[se].scale)},0)},Wl.prototype.addTextSection=function(C,V){this.text+=C.text,this.sections.push(Of.forText(C.scale,C.fontStack||V));for(var se=this.sections.length-1,_e=0;_e=Vh?null:++this.imageSectionID:(this.imageSectionID=jh,this.imageSectionID)};function uf(k,C){for(var V=[],se=k.text,_e=0,ke=0,Ne=C;ke=0,Gt=0,hr=0;hr0&&Oc>Zi&&(Zi=Oc)}else{var nl=V[Bi.fontStack],Ys=nl&&nl[Xi];if(Ys&&Ys.rect)Oo=Ys.rect,cs=Ys.metrics;else{var Zl=C[Bi.fontStack],fu=Zl&&Zl[Xi];if(!fu)continue;cs=fu.metrics}Qi=(bn-Bi.scale)*er}al?(k.verticalizable=!0,ni.push({glyph:Xi,imageName:rl,x:Dr,y:Ir+Qi,vertical:al,scale:Bi.scale,fontStack:Bi.fontStack,sectionIndex:Ho,metrics:cs,rect:Oo}),Dr+=Il*Bi.scale+Ft):(ni.push({glyph:Xi,imageName:rl,x:Dr,y:Ir+Qi,vertical:al,scale:Bi.scale,fontStack:Bi.fontStack,sectionIndex:Ho,metrics:cs,rect:Oo}),Dr+=cs.advance*Bi.scale+Ft)}if(ni.length!==0){var eh=Dr-Ft;Xr=Math.max(eh,Xr),Gx(ni,0,ni.length-1,Za,Zi)}Dr=0;var th=ke*bn+Zi;ui.lineOffset=Math.max(Zi,Dn),Ir+=th,ba=Math.max(th,ba),++Ra}var hf=Ir-cu,oh=Bg(Ne),sh=oh.horizontalAlign,Zc=oh.verticalAlign;Wx(k.positionedLines,Za,sh,Zc,Xr,ba,ke,hf,_e.length),k.top+=-Zc*hf,k.bottom=k.top+hf,k.left+=-sh*Xr,k.right=k.left+Xr}function Gx(k,C,V,se,_e){if(!(!se&&!_e))for(var ke=k[V],Ne=ke.metrics.advance*ke.scale,it=(k[V].x+Ne)*se,kt=C;kt<=V;kt++)k[kt].x-=it,k[kt].y+=_e}function Wx(k,C,V,se,_e,ke,Ne,it,kt){var Ft=(C-V)*_e,Gt=0;ke!==Ne?Gt=-it*se-cu:Gt=(-se*kt+.5)*Ne;for(var hr=0,Dr=k;hr-V/2;){if(Ne--,Ne<0)return!1;it-=k[Ne].dist(ke),ke=k[Ne]}it+=k[Ne].dist(k[Ne+1]),Ne++;for(var kt=[],Ft=0;itse;)Ft-=kt.shift().angleDelta;if(Ft>_e)return!1;Ne++,it+=hr.dist(Dr)}return!0}function Af(k){for(var C=0,V=0;VFt){var Xr=(Ft-kt)/Ir,ba=Ns(hr.x,Dr.x,Xr),Za=Ns(hr.y,Dr.y,Xr),Ra=new Ld(ba,Za,Dr.angleTo(hr),Gt);return Ra._round(),!Ne||Rm(k,Ra,it,Ne,C)?Ra:void 0}kt+=Ir}}function td(k,C,V,se,_e,ke,Ne,it,kt){var Ft=wh(se,ke,Ne),Gt=Bv(se,_e),hr=Gt*Ne,Dr=k[0].x===0||k[0].x===kt||k[0].y===0||k[0].y===kt;C-hr=0&&vn=0&&bn=0&&Dr+Ft<=Gt){var Dn=new Ld(vn,bn,dn,Xr);Dn._round(),(!se||Rm(k,Dn,ke,se,_e))&&Ir.push(Dn)}}hr+=Ra}return!it&&!Ir.length&&!Ne&&(Ir=Hh(k,hr/2,V,se,_e,ke,Ne,!0,kt)),Ir}function SA(k,C,V,se,_e){for(var ke=[],Ne=0;Ne=se&&hr.x>=se)&&(Gt.x>=se?Gt=new i(se,Gt.y+(hr.y-Gt.y)*((se-Gt.x)/(hr.x-Gt.x)))._round():hr.x>=se&&(hr=new i(se,Gt.y+(hr.y-Gt.y)*((se-Gt.x)/(hr.x-Gt.x)))._round()),!(Gt.y>=_e&&hr.y>=_e)&&(Gt.y>=_e?Gt=new i(Gt.x+(hr.x-Gt.x)*((_e-Gt.y)/(hr.y-Gt.y)),_e)._round():hr.y>=_e&&(hr=new i(Gt.x+(hr.x-Gt.x)*((_e-Gt.y)/(hr.y-Gt.y)),_e)._round()),(!kt||!Gt.equals(kt[kt.length-1]))&&(kt=[Gt],ke.push(kt)),kt.push(hr)))))}return ke}var _0=uu;function MA(k,C,V,se){var _e=[],ke=k.image,Ne=ke.pixelRatio,it=ke.paddedRect.w-2*_0,kt=ke.paddedRect.h-2*_0,Ft=k.right-k.left,Gt=k.bottom-k.top,hr=ke.stretchX||[[0,it]],Dr=ke.stretchY||[[0,kt]],Ir=function(nl,Ys){return nl+Ys[1]-Ys[0]},Xr=hr.reduce(Ir,0),ba=Dr.reduce(Ir,0),Za=it-Xr,Ra=kt-ba,dn=0,$a=Xr,vn=0,bn=ba,Dn=0,ui=Za,ni=0,Zi=Ra;if(ke.content&&se){var Mi=ke.content;dn=Dm(hr,0,Mi[0]),vn=Dm(Dr,0,Mi[1]),$a=Dm(hr,Mi[0],Mi[2]),bn=Dm(Dr,Mi[1],Mi[3]),Dn=Mi[0]-dn,ni=Mi[1]-vn,ui=Mi[2]-Mi[0]-$a,Zi=Mi[3]-Mi[1]-bn}var Bi=function(nl,Ys,Zl,fu){var ic=zm(nl.stretch-dn,$a,Ft,k.left),vc=Fm(nl.fixed-Dn,ui,nl.stretch,Xr),ff=zm(Ys.stretch-vn,bn,Gt,k.top),Oc=Fm(Ys.fixed-ni,Zi,Ys.stretch,ba),eh=zm(Zl.stretch-dn,$a,Ft,k.left),th=Fm(Zl.fixed-Dn,ui,Zl.stretch,Xr),hf=zm(fu.stretch-vn,bn,Gt,k.top),oh=Fm(fu.fixed-ni,Zi,fu.stretch,ba),sh=new i(ic,ff),Zc=new i(eh,ff),lh=new i(eh,hf),Oh=new i(ic,hf),nd=new i(vc/Ne,Oc/Ne),Dd=new i(th/Ne,oh/Ne),zd=C*Math.PI/180;if(zd){var Fd=Math.sin(zd),E0=Math.cos(zd),tv=[E0,-Fd,Fd,E0];sh._matMult(tv),Zc._matMult(tv),Oh._matMult(tv),lh._matMult(tv)}var Vm=nl.stretch+nl.fixed,rb=Zl.stretch+Zl.fixed,qm=Ys.stretch+Ys.fixed,ab=fu.stretch+fu.fixed,Gh={x:ke.paddedRect.x+_0+Vm,y:ke.paddedRect.y+_0+qm,w:rb-Vm,h:ab-qm},k0=ui/Ne/Ft,Hm=Zi/Ne/Gt;return{tl:sh,tr:Zc,bl:Oh,br:lh,tex:Gh,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:nd,pixelOffsetBR:Dd,minFontScaleX:k0,minFontScaleY:Hm,isSDF:V}};if(!se||!ke.stretchX&&!ke.stretchY)_e.push(Bi({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:it+1},{fixed:0,stretch:kt+1}));else for(var Ho=EA(hr,Za,Xr),Xi=EA(Dr,Ra,ba),Qi=0;Qi0&&(Xr=Math.max(10,Xr),this.circleDiameter=Xr)}else{var ba=Ne.top*it-kt,Za=Ne.bottom*it+kt,Ra=Ne.left*it-kt,dn=Ne.right*it+kt,$a=Ne.collisionPadding;if($a&&(Ra-=$a[0]*it,ba-=$a[1]*it,dn+=$a[2]*it,Za+=$a[3]*it),Gt){var vn=new i(Ra,ba),bn=new i(dn,ba),Dn=new i(Ra,Za),ui=new i(dn,Za),ni=Gt*Math.PI/180;vn._rotate(ni),bn._rotate(ni),Dn._rotate(ni),ui._rotate(ni),Ra=Math.min(vn.x,bn.x,Dn.x,ui.x),dn=Math.max(vn.x,bn.x,Dn.x,ui.x),ba=Math.min(vn.y,bn.y,Dn.y,ui.y),Za=Math.max(vn.y,bn.y,Dn.y,ui.y)}C.emplaceBack(V.x,V.y,Ra,ba,dn,Za,se,_e,ke)}this.boxEndIndex=C.length},x0=function(C,V){if(C===void 0&&(C=[]),V===void 0&&(V=Yz),this.data=C,this.length=this.data.length,this.compare=V,this.length>0)for(var se=(this.length>>1)-1;se>=0;se--)this._down(se)};x0.prototype.push=function(C){this.data.push(C),this.length++,this._up(this.length-1)},x0.prototype.pop=function(){if(this.length!==0){var C=this.data[0],V=this.data.pop();return this.length--,this.length>0&&(this.data[0]=V,this._down(0)),C}},x0.prototype.peek=function(){return this.data[0]},x0.prototype._up=function(C){for(var V=this,se=V.data,_e=V.compare,ke=se[C];C>0;){var Ne=C-1>>1,it=se[Ne];if(_e(ke,it)>=0)break;se[C]=it,C=Ne}se[C]=ke},x0.prototype._down=function(C){for(var V=this,se=V.data,_e=V.compare,ke=this.length>>1,Ne=se[C];C=0)break;se[C]=kt,C=it}se[C]=Ne};function Yz(k,C){return kC?1:0}function Kz(k,C,V){V===void 0&&(V=!1);for(var se=1/0,_e=1/0,ke=-1/0,Ne=-1/0,it=k[0],kt=0;ktke)&&(ke=Ft.x),(!kt||Ft.y>Ne)&&(Ne=Ft.y)}var Gt=ke-se,hr=Ne-_e,Dr=Math.min(Gt,hr),Ir=Dr/2,Xr=new x0([],Jz);if(Dr===0)return new i(se,_e);for(var ba=se;baRa.d||!Ra.d)&&(Ra=$a,V&&console.log("found best %d after %d probes",Math.round(1e4*$a.d)/1e4,dn)),!($a.max-Ra.d<=C)&&(Ir=$a.h/2,Xr.push(new b0($a.p.x-Ir,$a.p.y-Ir,Ir,k)),Xr.push(new b0($a.p.x+Ir,$a.p.y-Ir,Ir,k)),Xr.push(new b0($a.p.x-Ir,$a.p.y+Ir,Ir,k)),Xr.push(new b0($a.p.x+Ir,$a.p.y+Ir,Ir,k)),dn+=4)}return V&&(console.log("num probes: "+dn),console.log("best distance: "+Ra.d)),Ra.p}function Jz(k,C){return C.max-k.max}function b0(k,C,V,se){this.p=new i(k,C),this.h=V,this.d=$z(this.p,se),this.max=this.d+this.h*Math.SQRT2}function $z(k,C){for(var V=!1,se=1/0,_e=0;_ek.y!=Gt.y>k.y&&k.x<(Gt.x-Ft.x)*(k.y-Ft.y)/(Gt.y-Ft.y)+Ft.x&&(V=!V),se=Math.min(se,hv(k,Ft,Gt))}return(V?1:-1)*Math.sqrt(se)}function Qz(k){for(var C=0,V=0,se=0,_e=k[0],ke=0,Ne=_e.length,it=Ne-1;ke=ai||tv.y<0||tv.y>=ai||r8(k,tv,E0,V,se,_e,Xi,k.layers[0],k.collisionBoxArray,C.index,C.sourceLayerIndex,k.index,Ra,bn,ni,kt,$a,Dn,Zi,Ir,C,ke,Ft,Gt,Ne)};if(Mi==="line")for(var cs=0,Oo=SA(C.geometry,0,0,ai,ai);cs1){var ff=qh(vc,ui,V.vertical||Xr,se,ba,dn);ff&&Qi(vc,ff)}}else if(C.type==="Polygon")for(var Oc=0,eh=Qh(C.geometry,0);OcId&&U(k.layerIds[0]+': Value for "text-size" is >= '+Ug+'. Reduce your "text-size".')):Za.kind==="composite"&&(Ra=[Dc*Ir.compositeTextSizes[0].evaluate(Ne,{},Xr),Dc*Ir.compositeTextSizes[1].evaluate(Ne,{},Xr)],(Ra[0]>Id||Ra[1]>Id)&&U(k.layerIds[0]+': Value for "text-size" is >= '+Ug+'. Reduce your "text-size".')),k.addSymbols(k.text,ba,Ra,it,ke,Ne,Ft,C,kt.lineStartIndex,kt.lineLength,Dr,Xr);for(var dn=0,$a=Gt;dn<$a.length;dn+=1){var vn=$a[dn];hr[vn]=k.text.placedSymbolArray.length-1}return ba.length*4}function LA(k){for(var C in k)return k[C];return null}function r8(k,C,V,se,_e,ke,Ne,it,kt,Ft,Gt,hr,Dr,Ir,Xr,ba,Za,Ra,dn,$a,vn,bn,Dn,ui,ni){var Zi,Mi=k.addToLineVertexArray(C,V),Bi,Ho,Xi,Qi,cs=0,Oo=0,rl=0,Il=0,al=-1,nl=-1,Ys={},Zl=me(""),fu=0,ic=0;if(it._unevaluatedLayout.getValue("text-radial-offset")===void 0?(Zi=it.layout.get("text-offset").evaluate(vn,{},ui).map(function(qg){return qg*er}),fu=Zi[0],ic=Zi[1]):(fu=it.layout.get("text-radial-offset").evaluate(vn,{},ui)*er,ic=Yx),k.allowVerticalPlacement&&se.vertical){var vc=it.layout.get("text-rotate").evaluate(vn,{},ui),ff=vc+90,Oc=se.vertical;Xi=new Om(kt,C,Ft,Gt,hr,Oc,Dr,Ir,Xr,ff),Ne&&(Qi=new Om(kt,C,Ft,Gt,hr,Ne,Za,Ra,Xr,ff))}if(_e){var eh=it.layout.get("icon-rotate").evaluate(vn,{}),th=it.layout.get("icon-text-fit")!=="none",hf=MA(_e,eh,Dn,th),oh=Ne?MA(Ne,eh,Dn,th):void 0;Ho=new Om(kt,C,Ft,Gt,hr,_e,Za,Ra,!1,eh),cs=hf.length*4;var sh=k.iconSizeData,Zc=null;sh.kind==="source"?(Zc=[Dc*it.layout.get("icon-size").evaluate(vn,{})],Zc[0]>Id&&U(k.layerIds[0]+': Value for "icon-size" is >= '+Ug+'. Reduce your "icon-size".')):sh.kind==="composite"&&(Zc=[Dc*bn.compositeIconSizes[0].evaluate(vn,{},ui),Dc*bn.compositeIconSizes[1].evaluate(vn,{},ui)],(Zc[0]>Id||Zc[1]>Id)&&U(k.layerIds[0]+': Value for "icon-size" is >= '+Ug+'. Reduce your "icon-size".')),k.addSymbols(k.icon,hf,Zc,$a,dn,vn,!1,C,Mi.lineStartIndex,Mi.lineLength,-1,ui),al=k.icon.placedSymbolArray.length-1,oh&&(Oo=oh.length*4,k.addSymbols(k.icon,oh,Zc,$a,dn,vn,ku.vertical,C,Mi.lineStartIndex,Mi.lineLength,-1,ui),nl=k.icon.placedSymbolArray.length-1)}for(var lh in se.horizontal){var Oh=se.horizontal[lh];if(!Bi){Zl=me(Oh.text);var nd=it.layout.get("text-rotate").evaluate(vn,{},ui);Bi=new Om(kt,C,Ft,Gt,hr,Oh,Dr,Ir,Xr,nd)}var Dd=Oh.positionedLines.length===1;if(rl+=CA(k,C,Oh,ke,it,Xr,vn,ba,Mi,se.vertical?ku.horizontal:ku.horizontalOnly,Dd?Object.keys(se.horizontal):[lh],Ys,al,bn,ui),Dd)break}se.vertical&&(Il+=CA(k,C,se.vertical,ke,it,Xr,vn,ba,Mi,ku.vertical,["vertical"],Ys,nl,bn,ui));var zd=Bi?Bi.boxStartIndex:k.collisionBoxArray.length,Fd=Bi?Bi.boxEndIndex:k.collisionBoxArray.length,E0=Xi?Xi.boxStartIndex:k.collisionBoxArray.length,tv=Xi?Xi.boxEndIndex:k.collisionBoxArray.length,Vm=Ho?Ho.boxStartIndex:k.collisionBoxArray.length,rb=Ho?Ho.boxEndIndex:k.collisionBoxArray.length,qm=Qi?Qi.boxStartIndex:k.collisionBoxArray.length,ab=Qi?Qi.boxEndIndex:k.collisionBoxArray.length,Gh=-1,k0=function(qg,WA){return qg&&qg.circleDiameter?Math.max(qg.circleDiameter,WA):WA};Gh=k0(Bi,Gh),Gh=k0(Xi,Gh),Gh=k0(Ho,Gh),Gh=k0(Qi,Gh);var Hm=Gh>-1?1:0;Hm&&(Gh*=ni/er),k.glyphOffsetArray.length>=Pl.MAX_GLYPHS&&U("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),vn.sortKey!==void 0&&k.addToSortKeyRanges(k.symbolInstances.length,vn.sortKey),k.symbolInstances.emplaceBack(C.x,C.y,Ys.right>=0?Ys.right:-1,Ys.center>=0?Ys.center:-1,Ys.left>=0?Ys.left:-1,Ys.vertical||-1,al,nl,Zl,zd,Fd,E0,tv,Vm,rb,qm,ab,Ft,rl,Il,cs,Oo,Hm,0,Dr,fu,ic,Gh)}function a8(k,C,V,se){var _e=k.compareText;if(!(C in _e))_e[C]=[];else for(var ke=_e[C],Ne=ke.length-1;Ne>=0;Ne--)if(se.dist(ke[Ne])0)&&(Ne.value.kind!=="constant"||Ne.value.value.length>0),Gt=kt.value.kind!=="constant"||!!kt.value.value||Object.keys(kt.parameters).length>0,hr=ke.get("symbol-sort-key");if(this.features=[],!(!Ft&&!Gt)){for(var Dr=V.iconDependencies,Ir=V.glyphDependencies,Xr=V.availableImages,ba=new Qo(this.zoom),Za=0,Ra=C;Za=0;for(var Il=0,al=Zi.sections;Il=0;kt--)Ne[kt]={x:V[kt].x,y:V[kt].y,tileUnitDistanceFromAnchor:ke},kt>0&&(ke+=V[kt-1].dist(V[kt]));for(var Ft=0;Ft0},Pl.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Pl.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Pl.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Pl.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Pl.prototype.addIndicesForPlacedSymbol=function(C,V){for(var se=C.placedSymbolArray.get(V),_e=se.vertexStartIndex+se.numGlyphs*4,ke=se.vertexStartIndex;ke<_e;ke+=4)C.indexArray.emplaceBack(ke,ke+1,ke+2),C.indexArray.emplaceBack(ke+1,ke+2,ke+3)},Pl.prototype.getSortedSymbolIndexes=function(C){if(this.sortedAngle===C&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var V=Math.sin(C),se=Math.cos(C),_e=[],ke=[],Ne=[],it=0;it1||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 se=0,_e=this.symbolInstanceIndexes;se<_e.length;se+=1){var ke=_e[se],Ne=this.symbolInstances.get(ke);this.featureSortOrder.push(Ne.featureIndex),[Ne.rightJustifiedTextSymbolIndex,Ne.centerJustifiedTextSymbolIndex,Ne.leftJustifiedTextSymbolIndex].forEach(function(it,kt,Ft){it>=0&&Ft.indexOf(it)===kt&&V.addIndicesForPlacedSymbol(V.text,it)}),Ne.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,Ne.verticalPlacedTextSymbolIndex),Ne.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ne.placedIconSymbolIndex),Ne.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,Ne.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},zt("SymbolBucket",Pl,{omit:["layers","collisionBoxArray","features","compareText"]}),Pl.MAX_GLYPHS=65535,Pl.addDynamicAttributes=Jx;function s8(k,C){return C.replace(/{([^{}]+)}/g,function(V,se){return se in k?String(k[se]):""})}var l8=new ti({"symbol-placement":new Da(Qa.layout_symbol["symbol-placement"]),"symbol-spacing":new Da(Qa.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Da(Qa.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Na(Qa.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Da(Qa.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Da(Qa.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Da(Qa.layout_symbol["icon-ignore-placement"]),"icon-optional":new Da(Qa.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Da(Qa.layout_symbol["icon-rotation-alignment"]),"icon-size":new Na(Qa.layout_symbol["icon-size"]),"icon-text-fit":new Da(Qa.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Da(Qa.layout_symbol["icon-text-fit-padding"]),"icon-image":new Na(Qa.layout_symbol["icon-image"]),"icon-rotate":new Na(Qa.layout_symbol["icon-rotate"]),"icon-padding":new Da(Qa.layout_symbol["icon-padding"]),"icon-keep-upright":new Da(Qa.layout_symbol["icon-keep-upright"]),"icon-offset":new Na(Qa.layout_symbol["icon-offset"]),"icon-anchor":new Na(Qa.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Da(Qa.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Da(Qa.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Da(Qa.layout_symbol["text-rotation-alignment"]),"text-field":new Na(Qa.layout_symbol["text-field"]),"text-font":new Na(Qa.layout_symbol["text-font"]),"text-size":new Na(Qa.layout_symbol["text-size"]),"text-max-width":new Na(Qa.layout_symbol["text-max-width"]),"text-line-height":new Da(Qa.layout_symbol["text-line-height"]),"text-letter-spacing":new Na(Qa.layout_symbol["text-letter-spacing"]),"text-justify":new Na(Qa.layout_symbol["text-justify"]),"text-radial-offset":new Na(Qa.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Da(Qa.layout_symbol["text-variable-anchor"]),"text-anchor":new Na(Qa.layout_symbol["text-anchor"]),"text-max-angle":new Da(Qa.layout_symbol["text-max-angle"]),"text-writing-mode":new Da(Qa.layout_symbol["text-writing-mode"]),"text-rotate":new Na(Qa.layout_symbol["text-rotate"]),"text-padding":new Da(Qa.layout_symbol["text-padding"]),"text-keep-upright":new Da(Qa.layout_symbol["text-keep-upright"]),"text-transform":new Na(Qa.layout_symbol["text-transform"]),"text-offset":new Na(Qa.layout_symbol["text-offset"]),"text-allow-overlap":new Da(Qa.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Da(Qa.layout_symbol["text-ignore-placement"]),"text-optional":new Da(Qa.layout_symbol["text-optional"])}),u8=new ti({"icon-opacity":new Na(Qa.paint_symbol["icon-opacity"]),"icon-color":new Na(Qa.paint_symbol["icon-color"]),"icon-halo-color":new Na(Qa.paint_symbol["icon-halo-color"]),"icon-halo-width":new Na(Qa.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Na(Qa.paint_symbol["icon-halo-blur"]),"icon-translate":new Da(Qa.paint_symbol["icon-translate"]),"icon-translate-anchor":new Da(Qa.paint_symbol["icon-translate-anchor"]),"text-opacity":new Na(Qa.paint_symbol["text-opacity"]),"text-color":new Na(Qa.paint_symbol["text-color"],{runtimeType:zo,getOverride:function(k){return k.textColor},hasOverride:function(k){return!!k.textColor}}),"text-halo-color":new Na(Qa.paint_symbol["text-halo-color"]),"text-halo-width":new Na(Qa.paint_symbol["text-halo-width"]),"text-halo-blur":new Na(Qa.paint_symbol["text-halo-blur"]),"text-translate":new Da(Qa.paint_symbol["text-translate"]),"text-translate-anchor":new Da(Qa.paint_symbol["text-translate-anchor"])}),$x={paint:u8,layout:l8},A0=function(C){this.type=C.property.overrides?C.property.overrides.runtimeType:Ks,this.defaultValue=C};A0.prototype.evaluate=function(C){if(C.formattedSection){var V=this.defaultValue.property.overrides;if(V&&V.hasOverride(C.formattedSection))return V.getOverride(C.formattedSection)}return C.feature&&C.featureState?this.defaultValue.evaluate(C.feature,C.featureState):this.defaultValue.property.specification.default},A0.prototype.eachChild=function(C){if(!this.defaultValue.isConstant()){var V=this.defaultValue.value;C(V._styleExpression.expression)}},A0.prototype.outputDefined=function(){return!1},A0.prototype.serialize=function(){return null},zt("FormatSectionOverride",A0,{omit:["defaultValue"]});var c8=function(k){function C(V){k.call(this,V,$x)}return k&&(C.__proto__=k),C.prototype=Object.create(k&&k.prototype),C.prototype.constructor=C,C.prototype.recalculate=function(se,_e){if(k.prototype.recalculate.call(this,se,_e),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 ke=this.layout.get("text-writing-mode");if(ke){for(var Ne=[],it=0,kt=ke;it",targetMapId:_e,sourceMapId:Ne.mapId})}}},S0.prototype.receive=function(C){var V=C.data,se=V.id;if(se&&!(V.targetMapId&&this.mapId!==V.targetMapId))if(V.type===""){delete this.tasks[se];var _e=this.cancelCallbacks[se];delete this.cancelCallbacks[se],_e&&_e()}else oe()||V.mustQueue?(this.tasks[se]=V,this.taskQueue.push(se),this.invoker.trigger()):this.processTask(se,V)},S0.prototype.process=function(){if(this.taskQueue.length){var C=this.taskQueue.shift(),V=this.tasks[C];delete this.tasks[C],this.taskQueue.length&&this.invoker.trigger(),V&&this.processTask(C,V)}},S0.prototype.processTask=function(C,V){var se=this;if(V.type===""){var _e=this.callbacks[C];delete this.callbacks[C],_e&&(V.error?_e(Vr(V.error)):_e(null,Vr(V.data)))}else{var ke=!1,Ne=J(this.globalScope)?void 0:[],it=V.hasCallback?function(Dr,Ir){ke=!0,delete se.cancelCallbacks[C],se.target.postMessage({id:C,type:"",sourceMapId:se.mapId,error:Dr?Ar(Dr):null,data:Ar(Ir,Ne)},Ne)}:function(Dr){ke=!0},kt=null,Ft=Vr(V.data);if(this.parent[V.type])kt=this.parent[V.type](V.sourceMapId,Ft,it);else if(this.parent.getWorkerSource){var Gt=V.type.split("."),hr=this.parent.getWorkerSource(V.sourceMapId,Gt[0],Ft.source);kt=hr[Gt[1]](Ft,it)}else it(new Error("Could not find function "+V.type));!ke&&kt&&kt.cancel&&(this.cancelCallbacks[C]=kt.cancel)}},S0.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};function b8(k,C,V){C=Math.pow(2,V)-C-1;var se=zA(k*256,C*256,V),_e=zA((k+1)*256,(C+1)*256,V);return se[0]+","+se[1]+","+_e[0]+","+_e[1]}function zA(k,C,V){var se=2*Math.PI*6378137/256/Math.pow(2,V),_e=k*se-2*Math.PI*6378137/2,ke=C*se-2*Math.PI*6378137/2;return[_e,ke]}var zc=function(C,V){C&&(V?this.setSouthWest(C).setNorthEast(V):C.length===4?this.setSouthWest([C[0],C[1]]).setNorthEast([C[2],C[3]]):this.setSouthWest(C[0]).setNorthEast(C[1]))};zc.prototype.setNorthEast=function(C){return this._ne=C instanceof Cu?new Cu(C.lng,C.lat):Cu.convert(C),this},zc.prototype.setSouthWest=function(C){return this._sw=C instanceof Cu?new Cu(C.lng,C.lat):Cu.convert(C),this},zc.prototype.extend=function(C){var V=this._sw,se=this._ne,_e,ke;if(C instanceof Cu)_e=C,ke=C;else if(C instanceof zc){if(_e=C._sw,ke=C._ne,!_e||!ke)return this}else{if(Array.isArray(C))if(C.length===4||C.every(Array.isArray)){var Ne=C;return this.extend(zc.convert(Ne))}else{var it=C;return this.extend(Cu.convert(it))}return this}return!V&&!se?(this._sw=new Cu(_e.lng,_e.lat),this._ne=new Cu(ke.lng,ke.lat)):(V.lng=Math.min(_e.lng,V.lng),V.lat=Math.min(_e.lat,V.lat),se.lng=Math.max(ke.lng,se.lng),se.lat=Math.max(ke.lat,se.lat)),this},zc.prototype.getCenter=function(){return new Cu((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},zc.prototype.getSouthWest=function(){return this._sw},zc.prototype.getNorthEast=function(){return this._ne},zc.prototype.getNorthWest=function(){return new Cu(this.getWest(),this.getNorth())},zc.prototype.getSouthEast=function(){return new Cu(this.getEast(),this.getSouth())},zc.prototype.getWest=function(){return this._sw.lng},zc.prototype.getSouth=function(){return this._sw.lat},zc.prototype.getEast=function(){return this._ne.lng},zc.prototype.getNorth=function(){return this._ne.lat},zc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},zc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},zc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},zc.prototype.contains=function(C){var V=Cu.convert(C),se=V.lng,_e=V.lat,ke=this._sw.lat<=_e&&_e<=this._ne.lat,Ne=this._sw.lng<=se&&se<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Ne=this._sw.lng>=se&&se>=this._ne.lng),ke&&Ne},zc.convert=function(C){return!C||C instanceof zc?C:new zc(C)};var FA=63710088e-1,Cu=function(C,V){if(isNaN(C)||isNaN(V))throw new Error("Invalid LngLat object: ("+C+", "+V+")");if(this.lng=+C,this.lat=+V,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Cu.prototype.wrap=function(){return new Cu(y(this.lng,-180,180),this.lat)},Cu.prototype.toArray=function(){return[this.lng,this.lat]},Cu.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Cu.prototype.distanceTo=function(C){var V=Math.PI/180,se=this.lat*V,_e=C.lat*V,ke=Math.sin(se)*Math.sin(_e)+Math.cos(se)*Math.cos(_e)*Math.cos((C.lng-this.lng)*V),Ne=FA*Math.acos(Math.min(ke,1));return Ne},Cu.prototype.toBounds=function(C){C===void 0&&(C=0);var V=40075017,se=360*C/V,_e=se/Math.cos(Math.PI/180*this.lat);return new zc(new Cu(this.lng-_e,this.lat-se),new Cu(this.lng+_e,this.lat+se))},Cu.convert=function(C){if(C instanceof Cu)return C;if(Array.isArray(C)&&(C.length===2||C.length===3))return new Cu(Number(C[0]),Number(C[1]));if(!Array.isArray(C)&&typeof C=="object"&&C!==null)return new Cu(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 OA=2*Math.PI*FA;function BA(k){return OA*Math.cos(k*Math.PI/180)}function NA(k){return(180+k)/360}function UA(k){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+k*Math.PI/360)))/360}function jA(k,C){return k/BA(C)}function w8(k){return k*360-180}function eb(k){var C=180-k*360;return 360/Math.PI*Math.atan(Math.exp(C*Math.PI/180))-90}function T8(k,C){return k*BA(eb(C))}function A8(k){return 1/Math.cos(k*Math.PI/180)}var xp=function(C,V,se){se===void 0&&(se=0),this.x=+C,this.y=+V,this.z=+se};xp.fromLngLat=function(C,V){V===void 0&&(V=0);var se=Cu.convert(C);return new xp(NA(se.lng),UA(se.lat),jA(V,se.lat))},xp.prototype.toLngLat=function(){return new Cu(w8(this.x),eb(this.y))},xp.prototype.toAltitude=function(){return T8(this.z,this.y)},xp.prototype.meterInMercatorCoordinateUnits=function(){return 1/OA*A8(eb(this.y))};var bp=function(C,V,se){this.z=C,this.x=V,this.y=se,this.key=Vg(0,C,C,V,se)};bp.prototype.equals=function(C){return this.z===C.z&&this.x===C.x&&this.y===C.y},bp.prototype.url=function(C,V){var se=b8(this.x,this.y,this.z),_e=S8(this.z,this.x,this.y);return C[(this.x+this.y)%C.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(V==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",_e).replace("{bbox-epsg-3857}",se)},bp.prototype.getTilePoint=function(C){var V=Math.pow(2,this.z);return new i((C.x*V-this.x)*ai,(C.y*V-this.y)*ai)},bp.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var VA=function(C,V){this.wrap=C,this.canonical=V,this.key=Vg(C,V.z,V.z,V.x,V.y)},Fc=function(C,V,se,_e,ke){this.overscaledZ=C,this.wrap=V,this.canonical=new bp(se,+_e,+ke),this.key=Vg(V,C,se,_e,ke)};Fc.prototype.equals=function(C){return this.overscaledZ===C.overscaledZ&&this.wrap===C.wrap&&this.canonical.equals(C.canonical)},Fc.prototype.scaledTo=function(C){var V=this.canonical.z-C;return C>this.canonical.z?new Fc(C,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Fc(C,this.wrap,C,this.canonical.x>>V,this.canonical.y>>V)},Fc.prototype.calculateScaledKey=function(C,V){var se=this.canonical.z-C;return C>this.canonical.z?Vg(this.wrap*+V,C,this.canonical.z,this.canonical.x,this.canonical.y):Vg(this.wrap*+V,C,C,this.canonical.x>>se,this.canonical.y>>se)},Fc.prototype.isChildOf=function(C){if(C.wrap!==this.wrap)return!1;var V=this.canonical.z-C.canonical.z;return C.overscaledZ===0||C.overscaledZ>V&&C.canonical.y===this.canonical.y>>V},Fc.prototype.children=function(C){if(this.overscaledZ>=C)return[new Fc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var V=this.canonical.z+1,se=this.canonical.x*2,_e=this.canonical.y*2;return[new Fc(V,this.wrap,V,se,_e),new Fc(V,this.wrap,V,se+1,_e),new Fc(V,this.wrap,V,se,_e+1),new Fc(V,this.wrap,V,se+1,_e+1)]},Fc.prototype.isLessThan=function(C){return this.wrapC.wrap?!1:this.overscaledZC.overscaledZ?!1:this.canonical.xC.canonical.x?!1:this.canonical.y0;ke--)_e=1<=this.dim+1||V<-1||V>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(V+1)*this.stride+(C+1)},rd.prototype._unpackMapbox=function(C,V,se){return(C*256*256+V*256+se)/10-1e4},rd.prototype._unpackTerrarium=function(C,V,se){return C*256+V+se/256-32768},rd.prototype.getPixels=function(){return new bf({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},rd.prototype.backfillBorder=function(C,V,se){if(this.dim!==C.dim)throw new Error("dem dimension mismatch");var _e=V*this.dim,ke=V*this.dim+this.dim,Ne=se*this.dim,it=se*this.dim+this.dim;switch(V){case-1:_e=ke-1;break;case 1:ke=_e+1;break}switch(se){case-1:Ne=it-1;break;case 1:it=Ne+1;break}for(var kt=-V*this.dim,Ft=-se*this.dim,Gt=Ne;Gt=0&&hr[3]>=0&&kt.insert(it,hr[0],hr[1],hr[2],hr[3])}},ad.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new ed.VectorTile(new Yr(this.rawTileData)).layers,this.sourceLayerCoder=new Um(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},ad.prototype.query=function(C,V,se,_e){var ke=this;this.loadVTLayers();for(var Ne=C.params||{},it=ai/C.tileSize/C.scale,kt=Ze(Ne.filter),Ft=C.queryGeometry,Gt=C.queryPadding*it,hr=HA(Ft),Dr=this.grid.query(hr.minX-Gt,hr.minY-Gt,hr.maxX+Gt,hr.maxY+Gt),Ir=HA(C.cameraQueryGeometry),Xr=this.grid3D.query(Ir.minX-Gt,Ir.minY-Gt,Ir.maxX+Gt,Ir.maxY+Gt,function(Dn,ui,ni,Zi){return Dh(C.cameraQueryGeometry,Dn-Gt,ui-Gt,ni+Gt,Zi+Gt)}),ba=0,Za=Xr;ba_e)ke=!1;else if(!V)ke=!0;else if(this.expirationTime=Hr.maxzoom)&&Hr.visibility!=="none"){c(Pr,this.zoom,Ot);var Zr=Aa[Hr.id]=Hr.createBucket({index:ga.bucketLayerIDs.length,layers:Pr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:vt,sourceID:this.source});Zr.populate(Lr,Pa,this.tileID.canonical),ga.bucketLayerIDs.push(Pr.map(function(ra){return ra.id}))}}}}var Jr,wt,Qt,mr,$r=e.mapObject(Pa.glyphDependencies,function(ra){return Object.keys(ra).map(Number)});Object.keys($r).length?gr.send("getGlyphs",{uid:this.uid,stacks:$r},function(ra,pa){Jr||(Jr=ra,wt=pa,ya.call(na))}):wt={};var oa=Object.keys(Pa.iconDependencies);oa.length?gr.send("getImages",{icons:oa,source:this.source,tileID:this.tileID,type:"icons"},function(ra,pa){Jr||(Jr=ra,Qt=pa,ya.call(na))}):Qt={};var Sa=Object.keys(Pa.patternDependencies);Sa.length?gr.send("getImages",{icons:Sa,source:this.source,tileID:this.tileID,type:"patterns"},function(ra,pa){Jr||(Jr=ra,mr=pa,ya.call(na))}):mr={},ya.call(this);function ya(){if(Jr)return Br(Jr);if(wt&&Qt&&mr){var ra=new n(wt),pa=new e.ImageAtlas(Qt,mr);for(var pn in Aa){var Ga=Aa[pn];Ga instanceof e.SymbolBucket?(c(Ga.layers,this.zoom,Ot),e.performSymbolLayout(Ga,wt,ra.positions,Qt,pa.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):Ga.hasPattern&&(Ga instanceof e.LineBucket||Ga instanceof e.FillBucket||Ga instanceof e.FillExtrusionBucket)&&(c(Ga.layers,this.zoom,Ot),Ga.addFeatures(Pa,this.tileID.canonical,pa.patternPositions))}this.status="done",Br(null,{buckets:e.values(Aa).filter(function(qn){return!qn.isEmpty()}),featureIndex:ga,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ra.image,imageAtlas:pa,glyphMap:this.returnDependencies?wt:null,iconMap:this.returnDependencies?Qt:null,glyphPositions:this.returnDependencies?ra.positions:null})}}};function c(Vt,Lt,jt){for(var Ot=new e.EvaluationParameters(Lt),gr=0,Br=Vt;gr=0!=!!Lt&&Vt.reverse()}var M=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,_=function(Lt){this._feature=Lt,this.extent=e.EXTENT,this.type=Lt.type,this.properties=Lt.tags,"id"in Lt&&!isNaN(Lt.id)&&(this.id=parseInt(Lt.id,10))};_.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Lt=[],jt=0,Ot=this._feature.geometry;jt"u"&&(Ot.push(Ur),ga=Ot.length-1,Br[Ur]=ga),Lt.writeVarint(ga);var Aa=jt.properties[Ur],Pa=typeof Aa;Pa!=="string"&&Pa!=="boolean"&&Pa!=="number"&&(Aa=JSON.stringify(Aa));var sa=Pa+":"+Aa,Oa=na[sa];typeof Oa>"u"&&(gr.push(Aa),Oa=gr.length-1,na[sa]=Oa),Lt.writeVarint(Oa)}}function Q(Vt,Lt){return(Lt<<3)+(Vt&7)}function ue(Vt){return Vt<<1^Vt>>31}function oe(Vt,Lt){for(var jt=Vt.loadGeometry(),Ot=Vt.type,gr=0,Br=0,na=jt.length,Ur=0;Ur>1;J(Vt,Lt,na,Ot,gr,Br%2),j(Vt,Lt,jt,Ot,na-1,Br+1),j(Vt,Lt,jt,na+1,gr,Br+1)}}function J(Vt,Lt,jt,Ot,gr,Br){for(;gr>Ot;){if(gr-Ot>600){var na=gr-Ot+1,Ur=jt-Ot+1,ga=Math.log(na),Aa=.5*Math.exp(2*ga/3),Pa=.5*Math.sqrt(ga*Aa*(na-Aa)/na)*(Ur-na/2<0?-1:1),sa=Math.max(Ot,Math.floor(jt-Ur*Aa/na+Pa)),Oa=Math.min(gr,Math.floor(jt+(na-Ur)*Aa/na+Pa));J(Vt,Lt,jt,sa,Oa,Br)}var dt=Lt[2*jt+Br],vt=Ot,Lr=gr;for($(Vt,Lt,Ot,jt),Lt[2*gr+Br]>dt&&$(Vt,Lt,Ot,gr);vtdt;)Lr--}Lt[2*Ot+Br]===dt?$(Vt,Lt,Ot,Lr):(Lr++,$(Vt,Lt,Lr,gr)),Lr<=jt&&(Ot=Lr+1),jt<=Lr&&(gr=Lr-1)}}function $(Vt,Lt,jt,Ot){X(Vt,jt,Ot),X(Lt,2*jt,2*Ot),X(Lt,2*jt+1,2*Ot+1)}function X(Vt,Lt,jt){var Ot=Vt[Lt];Vt[Lt]=Vt[jt],Vt[jt]=Ot}function re(Vt,Lt,jt,Ot,gr,Br,na){for(var Ur=[0,Vt.length-1,0],ga=[],Aa,Pa;Ur.length;){var sa=Ur.pop(),Oa=Ur.pop(),dt=Ur.pop();if(Oa-dt<=na){for(var vt=dt;vt<=Oa;vt++)Aa=Lt[2*vt],Pa=Lt[2*vt+1],Aa>=jt&&Aa<=gr&&Pa>=Ot&&Pa<=Br&&ga.push(Vt[vt]);continue}var Lr=Math.floor((dt+Oa)/2);Aa=Lt[2*Lr],Pa=Lt[2*Lr+1],Aa>=jt&&Aa<=gr&&Pa>=Ot&&Pa<=Br&&ga.push(Vt[Lr]);var Er=(sa+1)%2;(sa===0?jt<=Aa:Ot<=Pa)&&(Ur.push(dt),Ur.push(Lr-1),Ur.push(Er)),(sa===0?gr>=Aa:Br>=Pa)&&(Ur.push(Lr+1),Ur.push(Oa),Ur.push(Er))}return ga}function ee(Vt,Lt,jt,Ot,gr,Br){for(var na=[0,Vt.length-1,0],Ur=[],ga=gr*gr;na.length;){var Aa=na.pop(),Pa=na.pop(),sa=na.pop();if(Pa-sa<=Br){for(var Oa=sa;Oa<=Pa;Oa++)q(Lt[2*Oa],Lt[2*Oa+1],jt,Ot)<=ga&&Ur.push(Vt[Oa]);continue}var dt=Math.floor((sa+Pa)/2),vt=Lt[2*dt],Lr=Lt[2*dt+1];q(vt,Lr,jt,Ot)<=ga&&Ur.push(Vt[dt]);var Er=(Aa+1)%2;(Aa===0?jt-gr<=vt:Ot-gr<=Lr)&&(na.push(sa),na.push(dt-1),na.push(Er)),(Aa===0?jt+gr>=vt:Ot+gr>=Lr)&&(na.push(dt+1),na.push(Pa),na.push(Er))}return Ur}function q(Vt,Lt,jt,Ot){var gr=Vt-jt,Br=Lt-Ot;return gr*gr+Br*Br}var ae=function(Vt){return Vt[0]},ie=function(Vt){return Vt[1]},fe=function(Lt,jt,Ot,gr,Br){jt===void 0&&(jt=ae),Ot===void 0&&(Ot=ie),gr===void 0&&(gr=64),Br===void 0&&(Br=Float64Array),this.nodeSize=gr,this.points=Lt;for(var na=Lt.length<65536?Uint16Array:Uint32Array,Ur=this.ids=new na(Lt.length),ga=this.coords=new Br(Lt.length*2),Aa=0;Aa=gr;Pa--){var sa=+Date.now();ga=this._cluster(ga,Pa),this.trees[Pa]=new fe(ga,ce,Re,na,Float32Array),Ot&&console.log("z%d: %d clusters in %dms",Pa,ga.length,+Date.now()-sa)}return Ot&&console.timeEnd("total time"),this},Ae.prototype.getClusters=function(Lt,jt){var Ot=((Lt[0]+180)%360+360)%360-180,gr=Math.max(-90,Math.min(90,Lt[1])),Br=Lt[2]===180?180:((Lt[2]+180)%360+360)%360-180,na=Math.max(-90,Math.min(90,Lt[3]));if(Lt[2]-Lt[0]>=360)Ot=-180,Br=180;else if(Ot>Br){var Ur=this.getClusters([Ot,gr,180,na],jt),ga=this.getClusters([-180,gr,Br,na],jt);return Ur.concat(ga)}for(var Aa=this.trees[this._limitZoom(jt)],Pa=Aa.range(Qe(Ot),Ke(na),Qe(Br),Ke(gr)),sa=[],Oa=0,dt=Pa;Oajt&&(Lr+=kr.numPoints||1)}if(Lr>=ga){for(var zr=sa.x*vt,Pr=sa.y*vt,Hr=Ur&&vt>1?this._map(sa,!0):null,Zr=(Pa<<5)+(jt+1)+this.points.length,Jr=0,wt=dt;Jr1)for(var oa=0,Sa=dt;oa>5},Ae.prototype._getOriginZoom=function(Lt){return(Lt-this.points.length)%32},Ae.prototype._map=function(Lt,jt){if(Lt.numPoints)return jt?xe({},Lt.properties):Lt.properties;var Ot=this.points[Lt.index].properties,gr=this.options.map(Ot);return jt&&gr===Ot?xe({},gr):gr};function Fe(Vt,Lt,jt,Ot,gr){return{x:Vt,y:Lt,zoom:1/0,id:jt,parentId:-1,numPoints:Ot,properties:gr}}function Ce(Vt,Lt){var jt=Vt.geometry.coordinates,Ot=jt[0],gr=jt[1];return{x:Qe(Ot),y:Ke(gr),zoom:1/0,index:Lt,parentId:-1}}function qe(Vt){return{type:"Feature",id:Vt.id,properties:et(Vt),geometry:{type:"Point",coordinates:[Xe(Vt.x),Me(Vt.y)]}}}function et(Vt){var Lt=Vt.numPoints,jt=Lt>=1e4?Math.round(Lt/1e3)+"k":Lt>=1e3?Math.round(Lt/100)/10+"k":Lt;return xe(xe({},Vt.properties),{cluster:!0,cluster_id:Vt.id,point_count:Lt,point_count_abbreviated:jt})}function Qe(Vt){return Vt/360+.5}function Ke(Vt){var Lt=Math.sin(Vt*Math.PI/180),jt=.5-.25*Math.log((1+Lt)/(1-Lt))/Math.PI;return jt<0?0:jt>1?1:jt}function Xe(Vt){return(Vt-.5)*360}function Me(Vt){var Lt=(180-Vt*360)*Math.PI/180;return 360*Math.atan(Math.exp(Lt))/Math.PI-90}function xe(Vt,Lt){for(var jt in Lt)Vt[jt]=Lt[jt];return Vt}function ce(Vt){return Vt.x}function Re(Vt){return Vt.y}function $e(Vt,Lt,jt,Ot){for(var gr=Ot,Br=jt-Lt>>1,na=jt-Lt,Ur,ga=Vt[Lt],Aa=Vt[Lt+1],Pa=Vt[jt],sa=Vt[jt+1],Oa=Lt+3;Oagr)Ur=Oa,gr=dt;else if(dt===gr){var vt=Math.abs(Oa-Br);vtOt&&(Ur-Lt>3&&$e(Vt,Lt,Ur,Ot),Vt[Ur+2]=gr,jt-Ur>3&&$e(Vt,Ur,jt,Ot))}function rt(Vt,Lt,jt,Ot,gr,Br){var na=gr-jt,Ur=Br-Ot;if(na!==0||Ur!==0){var ga=((Vt-jt)*na+(Lt-Ot)*Ur)/(na*na+Ur*Ur);ga>1?(jt=gr,Ot=Br):ga>0&&(jt+=na*ga,Ot+=Ur*ga)}return na=Vt-jt,Ur=Lt-Ot,na*na+Ur*Ur}function Je(Vt,Lt,jt,Ot){var gr={id:typeof Vt>"u"?null:Vt,type:Lt,geometry:jt,tags:Ot,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return At(gr),gr}function At(Vt){var Lt=Vt.geometry,jt=Vt.type;if(jt==="Point"||jt==="MultiPoint"||jt==="LineString")St(Vt,Lt);else if(jt==="Polygon"||jt==="MultiLineString")for(var Ot=0;Ot0&&(Ot?na+=(gr*Aa-ga*Br)/2:na+=Math.sqrt(Math.pow(ga-gr,2)+Math.pow(Aa-Br,2))),gr=ga,Br=Aa}var Pa=Lt.length-3;Lt[2]=1,$e(Lt,0,Pa,jt),Lt[Pa+2]=1,Lt.size=Math.abs(na),Lt.start=0,Lt.end=Lt.size}function Mr(Vt,Lt,jt,Ot){for(var gr=0;gr1?1:jt}function pt(Vt,Lt,jt,Ot,gr,Br,na,Ur){if(jt/=Lt,Ot/=Lt,Br>=jt&&na=Ot)return null;for(var ga=[],Aa=0;Aa=jt&&vt=Ot)continue;var Lr=[];if(Oa==="Point"||Oa==="MultiPoint")ze(sa,Lr,jt,Ot,gr);else if(Oa==="LineString")Ge(sa,Lr,jt,Ot,gr,!1,Ur.lineMetrics);else if(Oa==="MultiLineString")ve(sa,Lr,jt,Ot,gr,!1);else if(Oa==="Polygon")ve(sa,Lr,jt,Ot,gr,!0);else if(Oa==="MultiPolygon")for(var Er=0;Er=jt&&na<=Ot&&(Lt.push(Vt[Br]),Lt.push(Vt[Br+1]),Lt.push(Vt[Br+2]))}}function Ge(Vt,Lt,jt,Ot,gr,Br,na){for(var Ur=Oe(Vt),ga=gr===0?be:Pe,Aa=Vt.start,Pa,sa,Oa=0;Oajt&&(sa=ga(Ur,dt,vt,Er,_r,jt),na&&(Ur.start=Aa+Pa*sa)):yr>Ot?kr=jt&&(sa=ga(Ur,dt,vt,Er,_r,jt),zr=!0),kr>Ot&&yr<=Ot&&(sa=ga(Ur,dt,vt,Er,_r,Ot),zr=!0),!Br&&zr&&(na&&(Ur.end=Aa+Pa*sa),Lt.push(Ur),Ur=Oe(Vt)),na&&(Aa+=Pa)}var Pr=Vt.length-3;dt=Vt[Pr],vt=Vt[Pr+1],Lr=Vt[Pr+2],yr=gr===0?dt:vt,yr>=jt&&yr<=Ot&&ge(Ur,dt,vt,Lr),Pr=Ur.length-3,Br&&Pr>=3&&(Ur[Pr]!==Ur[0]||Ur[Pr+1]!==Ur[1])&&ge(Ur,Ur[0],Ur[1],Ur[2]),Ur.length&&Lt.push(Ur)}function Oe(Vt){var Lt=[];return Lt.size=Vt.size,Lt.start=Vt.start,Lt.end=Vt.end,Lt}function ve(Vt,Lt,jt,Ot,gr,Br){for(var na=0;nana.maxX&&(na.maxX=Pa),sa>na.maxY&&(na.maxY=sa)}return na}function qt(Vt,Lt,jt,Ot){var gr=Lt.geometry,Br=Lt.type,na=[];if(Br==="Point"||Br==="MultiPoint")for(var Ur=0;Ur0&&Lt.size<(gr?na:Ot)){jt.numPoints+=Lt.length/3;return}for(var Ur=[],ga=0;gana)&&(jt.numSimplified++,Ur.push(Lt[ga]),Ur.push(Lt[ga+1])),jt.numPoints++;gr&&lr(Ur,Br),Vt.push(Ur)}function lr(Vt,Lt){for(var jt=0,Ot=0,gr=Vt.length,Br=gr-2;Ot0===Lt)for(Ot=0,gr=Vt.length;Ot24)throw new Error("maxZoom should be in the 0-24 range");if(Lt.promoteId&&Lt.generateId)throw new Error("promoteId and generateId cannot be used together.");var Ot=Rt(Vt,Lt);this.tiles={},this.tileCoords=[],jt&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",Lt.indexMaxZoom,Lt.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),Ot=We(Ot,Lt),Ot.length&&this.splitTile(Ot,0,0,0),jt&&(Ot.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}da.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},da.prototype.splitTile=function(Vt,Lt,jt,Ot,gr,Br,na){for(var Ur=[Vt,Lt,jt,Ot],ga=this.options,Aa=ga.debug;Ur.length;){Ot=Ur.pop(),jt=Ur.pop(),Lt=Ur.pop(),Vt=Ur.pop();var Pa=1<1&&console.time("creation"),Oa=this.tiles[sa]=Bt(Vt,Lt,jt,Ot,ga),this.tileCoords.push({z:Lt,x:jt,y:Ot}),Aa)){Aa>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Lt,jt,Ot,Oa.numFeatures,Oa.numPoints,Oa.numSimplified),console.timeEnd("creation"));var dt="z"+Lt;this.stats[dt]=(this.stats[dt]||0)+1,this.total++}if(Oa.source=Vt,gr){if(Lt===ga.maxZoom||Lt===gr)continue;var vt=1<1&&console.time("clipping");var Lr=.5*ga.buffer/ga.extent,Er=.5-Lr,_r=.5+Lr,yr=1+Lr,kr,zr,Pr,Hr,Zr,Jr;kr=zr=Pr=Hr=null,Zr=pt(Vt,Pa,jt-Lr,jt+_r,0,Oa.minX,Oa.maxX,ga),Jr=pt(Vt,Pa,jt+Er,jt+yr,0,Oa.minX,Oa.maxX,ga),Vt=null,Zr&&(kr=pt(Zr,Pa,Ot-Lr,Ot+_r,1,Oa.minY,Oa.maxY,ga),zr=pt(Zr,Pa,Ot+Er,Ot+yr,1,Oa.minY,Oa.maxY,ga),Zr=null),Jr&&(Pr=pt(Jr,Pa,Ot-Lr,Ot+_r,1,Oa.minY,Oa.maxY,ga),Hr=pt(Jr,Pa,Ot+Er,Ot+yr,1,Oa.minY,Oa.maxY,ga),Jr=null),Aa>1&&console.timeEnd("clipping"),Ur.push(kr||[],Lt+1,jt*2,Ot*2),Ur.push(zr||[],Lt+1,jt*2,Ot*2+1),Ur.push(Pr||[],Lt+1,jt*2+1,Ot*2),Ur.push(Hr||[],Lt+1,jt*2+1,Ot*2+1)}}},da.prototype.getTile=function(Vt,Lt,jt){var Ot=this.options,gr=Ot.extent,Br=Ot.debug;if(Vt<0||Vt>24)return null;var na=1<1&&console.log("drilling down to z%d-%d-%d",Vt,Lt,jt);for(var ga=Vt,Aa=Lt,Pa=jt,sa;!sa&&ga>0;)ga--,Aa=Math.floor(Aa/2),Pa=Math.floor(Pa/2),sa=this.tiles[wa(ga,Aa,Pa)];return!sa||!sa.source?null:(Br>1&&console.log("found parent tile z%d-%d-%d",ga,Aa,Pa),Br>1&&console.time("drilling down"),this.splitTile(sa.source,ga,Aa,Pa,Vt,Lt,jt),Br>1&&console.timeEnd("drilling down"),this.tiles[Ur]?Mt(this.tiles[Ur],gr):null)};function wa(Vt,Lt,jt){return((1<=0?0:ye.button},r.remove=function(ye){ye.parentNode&&ye.parentNode.removeChild(ye)};function h(ye,W,de){var te,me,Ue,tt=e.browser.devicePixelRatio>1?"@2x":"",ft=e.getJSON(W.transformRequest(W.normalizeSpriteURL(ye,tt,".json"),e.ResourceType.SpriteJSON),function(It,Jt){ft=null,Ue||(Ue=It,te=Jt,bt())}),st=e.getImage(W.transformRequest(W.normalizeSpriteURL(ye,tt,".png"),e.ResourceType.SpriteImage),function(It,Jt){st=null,Ue||(Ue=It,me=Jt,bt())});function bt(){if(Ue)de(Ue);else if(te&&me){var It=e.browser.getImageData(me),Jt={};for(var Kt in te){var vr=te[Kt],Tr=vr.width,wr=vr.height,tr=vr.x,pr=vr.y,xr=vr.sdf,ea=vr.pixelRatio,ha=vr.stretchX,Ea=vr.stretchY,tn=vr.content,Xa=new e.RGBAImage({width:Tr,height:wr});e.RGBAImage.copy(It,Xa,{x:tr,y:pr},{x:0,y:0},{width:Tr,height:wr}),Jt[Kt]={data:Xa,pixelRatio:ea,sdf:xr,stretchX:ha,stretchY:Ea,content:tn}}de(null,Jt)}}return{cancel:function(){ft&&(ft.cancel(),ft=null),st&&(st.cancel(),st=null)}}}function T(ye){var W=ye.userImage;if(W&&W.render){var de=W.render();if(de)return ye.data.replace(new Uint8Array(W.data.buffer)),!0}return!1}var l=1,y=function(ye){function W(){ye.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.isLoaded=function(){return this.loaded},W.prototype.setLoaded=function(te){if(this.loaded!==te&&(this.loaded=te,te)){for(var me=0,Ue=this.requestors;me=0?1.2:1))}w.prototype.draw=function(ye){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(ye,this.buffer,this.middle);for(var W=this.ctx.getImageData(0,0,this.size,this.size),de=new Uint8ClampedArray(this.size*this.size),te=0;te65535){It(new Error("glyphs > 65535 not supported"));return}if(vr.ranges[wr]){It(null,{stack:Jt,id:Kt,glyph:Tr});return}var tr=vr.requests[wr];tr||(tr=vr.requests[wr]=[],g.loadGlyphRange(Jt,wr,te.url,te.requestManager,function(pr,xr){if(xr){for(var ea in xr)te._doesCharSupportLocalGlyph(+ea)||(vr.glyphs[+ea]=xr[+ea]);vr.ranges[wr]=!0}for(var ha=0,Ea=tr;ha1&&(bt=W[++st]);var Jt=Math.abs(It-bt.left),Kt=Math.abs(It-bt.right),vr=Math.min(Jt,Kt),Tr=void 0,wr=Ue/te*(me+1);if(bt.isDash){var tr=me-Math.abs(wr);Tr=Math.sqrt(vr*vr+tr*tr)}else Tr=me-Math.sqrt(vr*vr+wr*wr);this.data[ft+It]=Math.max(0,Math.min(255,Tr+128))}},F.prototype.addRegularDash=function(W){for(var de=W.length-1;de>=0;--de){var te=W[de],me=W[de+1];te.zeroLength?W.splice(de,1):me&&me.isDash===te.isDash&&(me.left=te.left,W.splice(de,1))}var Ue=W[0],tt=W[W.length-1];Ue.isDash===tt.isDash&&(Ue.left=tt.left-this.width,tt.right=Ue.right+this.width);for(var ft=this.width*this.nextRow,st=0,bt=W[st],It=0;It1&&(bt=W[++st]);var Jt=Math.abs(It-bt.left),Kt=Math.abs(It-bt.right),vr=Math.min(Jt,Kt),Tr=bt.isDash?vr:-vr;this.data[ft+It]=Math.max(0,Math.min(255,Tr+128))}},F.prototype.addDash=function(W,de){var te=de?7:0,me=2*te+1;if(this.nextRow+me>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var Ue=0,tt=0;tt=te.minX&&W.x=te.minY&&W.y0&&(It[new e.OverscaledTileID(te.overscaledZ,ft,me.z,tt,me.y-1).key]={backfilled:!1},It[new e.OverscaledTileID(te.overscaledZ,te.wrap,me.z,me.x,me.y-1).key]={backfilled:!1},It[new e.OverscaledTileID(te.overscaledZ,bt,me.z,st,me.y-1).key]={backfilled:!1}),me.y+10&&(Ue.resourceTiming=te._resourceTiming,te._resourceTiming=[]),te.fire(new e.Event("data",Ue))})},W.prototype.onAdd=function(te){this.map=te,this.load()},W.prototype.setData=function(te){var me=this;return this._data=te,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(Ue){if(Ue){me.fire(new e.ErrorEvent(Ue));return}var tt={dataType:"source",sourceDataType:"content"};me._collectResourceTiming&&me._resourceTiming&&me._resourceTiming.length>0&&(tt.resourceTiming=me._resourceTiming,me._resourceTiming=[]),me.fire(new e.Event("data",tt))}),this},W.prototype.getClusterExpansionZoom=function(te,me){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:te,source:this.id},me),this},W.prototype.getClusterChildren=function(te,me){return this.actor.send("geojson.getClusterChildren",{clusterId:te,source:this.id},me),this},W.prototype.getClusterLeaves=function(te,me,Ue,tt){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:te,limit:me,offset:Ue},tt),this},W.prototype._updateWorkerData=function(te){var me=this;this._loaded=!1;var Ue=e.extend({},this.workerOptions),tt=this._data;typeof tt=="string"?(Ue.request=this.map._requestManager.transformRequest(e.browser.resolveURL(tt),e.ResourceType.Source),Ue.request.collectResourceTiming=this._collectResourceTiming):Ue.data=JSON.stringify(tt),this.actor.send(this.type+".loadData",Ue,function(ft,st){me._removed||st&&st.abandoned||(me._loaded=!0,st&&st.resourceTiming&&st.resourceTiming[me.id]&&(me._resourceTiming=st.resourceTiming[me.id].slice(0)),me.actor.send(me.type+".coalesce",{source:Ue.source},null),te(ft))})},W.prototype.loaded=function(){return this._loaded},W.prototype.loadTile=function(te,me){var Ue=this,tt=te.actor?"reloadTile":"loadTile";te.actor=this.actor;var ft={type:this.type,uid:te.uid,tileID:te.tileID,zoom:te.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};te.request=this.actor.send(tt,ft,function(st,bt){return delete te.request,te.unloadVectorData(),te.aborted?me(null):st?me(st):(te.loadVectorData(bt,Ue.map.painter,tt==="reloadTile"),me(null))})},W.prototype.abortTile=function(te){te.request&&(te.request.cancel(),delete te.request),te.aborted=!0},W.prototype.unloadTile=function(te){te.unloadVectorData(),this.actor.send("removeTile",{uid:te.uid,type:this.type,source:this.id})},W.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},W.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},W.prototype.hasTransition=function(){return!1},W}(e.Evented),ue=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),oe=function(ye){function W(de,te,me,Ue){ye.call(this),this.id=de,this.dispatcher=me,this.coordinates=te.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Ue),this.options=te}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.load=function(te,me){var Ue=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),function(tt,ft){Ue._loaded=!0,tt?Ue.fire(new e.ErrorEvent(tt)):ft&&(Ue.image=ft,te&&(Ue.coordinates=te),me&&me(),Ue._finishLoading())})},W.prototype.loaded=function(){return this._loaded},W.prototype.updateImage=function(te){var me=this;return!this.image||!te.url?this:(this.options.url=te.url,this.load(te.coordinates,function(){me.texture=null}),this)},W.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},W.prototype.onAdd=function(te){this.map=te,this.load()},W.prototype.setCoordinates=function(te){var me=this;this.coordinates=te;var Ue=te.map(e.MercatorCoordinate.fromLngLat);this.tileID=le(Ue),this.minzoom=this.maxzoom=this.tileID.z;var tt=Ue.map(function(ft){return me.tileID.getTilePoint(ft)._round()});return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(tt[0].x,tt[0].y,0,0),this._boundsArray.emplaceBack(tt[1].x,tt[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(tt[3].x,tt[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(tt[2].x,tt[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},W.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||!this.image)){var te=this.map.painter.context,me=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,ue.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(te,this.image,me.RGBA),this.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE));for(var Ue in this.tiles){var tt=this.tiles[Ue];tt.state!=="loaded"&&(tt.state="loaded",tt.texture=this.texture)}}},W.prototype.loadTile=function(te,me){this.tileID&&this.tileID.equals(te.tileID.canonical)?(this.tiles[String(te.tileID.wrap)]=te,te.buckets={},me(null)):(te.state="errored",me(null))},W.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},W.prototype.hasTransition=function(){return!1},W}(e.Evented);function le(ye){for(var W=1/0,de=1/0,te=-1/0,me=-1/0,Ue=0,tt=ye;Ueme.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+me.start(0)+" and "+me.end(0)+"-second mark."))):this.video.currentTime=te}},W.prototype.getVideo=function(){return this.video},W.prototype.onAdd=function(te){this.map||(this.map=te,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},W.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var te=this.map.painter.context,me=te.gl;this.boundsBuffer||(this.boundsBuffer=te.createVertexBuffer(this._boundsArray,ue.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE),me.texSubImage2D(me.TEXTURE_2D,0,0,0,me.RGBA,me.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(te,this.video,me.RGBA),this.texture.bind(me.LINEAR,me.CLAMP_TO_EDGE));for(var Ue in this.tiles){var tt=this.tiles[Ue];tt.state!=="loaded"&&(tt.state="loaded",tt.texture=this.texture)}}},W.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},W.prototype.hasTransition=function(){return this.video&&!this.video.paused},W}(oe),J=function(ye){function W(de,te,me,Ue){ye.call(this,de,te,me,Ue),te.coordinates?(!Array.isArray(te.coordinates)||te.coordinates.length!==4||te.coordinates.some(function(tt){return!Array.isArray(tt)||tt.length!==2||tt.some(function(ft){return typeof ft!="number"})}))&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+de,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+de,null,'missing required property "coordinates"'))),te.animate&&typeof te.animate!="boolean"&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+de,null,'optional "animate" property must be a boolean value'))),te.canvas?typeof te.canvas!="string"&&!(te.canvas instanceof e.window.HTMLCanvasElement)&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+de,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+de,null,'missing required property "canvas"'))),this.options=te,this.animate=te.animate!==void 0?te.animate:!0}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.load=function(){if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},W.prototype.getCanvas=function(){return this.canvas},W.prototype.onAdd=function(te){this.map=te,this.load(),this.canvas&&this.animate&&this.play()},W.prototype.onRemove=function(){this.pause()},W.prototype.prepare=function(){var te=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,te=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,te=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var me=this.map.painter.context,Ue=me.gl;this.boundsBuffer||(this.boundsBuffer=me.createVertexBuffer(this._boundsArray,ue.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(te||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(me,this.canvas,Ue.RGBA,{premultiply:!0});for(var tt in this.tiles){var ft=this.tiles[tt];ft.state!=="loaded"&&(ft.state="loaded",ft.texture=this.texture)}}},W.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},W.prototype.hasTransition=function(){return this._playing},W.prototype._hasInvalidDimensions=function(){for(var te=0,me=[this.canvas.width,this.canvas.height];tethis.max){var ft=this._getAndRemoveByKey(this.order[0]);ft&&this.onRemove(ft)}return this},Ce.prototype.has=function(W){return W.wrapped().key in this.data},Ce.prototype.getAndRemove=function(W){return this.has(W)?this._getAndRemoveByKey(W.wrapped().key):null},Ce.prototype._getAndRemoveByKey=function(W){var de=this.data[W].shift();return de.timeout&&clearTimeout(de.timeout),this.data[W].length===0&&delete this.data[W],this.order.splice(this.order.indexOf(W),1),de.value},Ce.prototype.getByKey=function(W){var de=this.data[W];return de?de[0].value:null},Ce.prototype.get=function(W){if(!this.has(W))return null;var de=this.data[W.wrapped().key][0];return de.value},Ce.prototype.remove=function(W,de){if(!this.has(W))return this;var te=W.wrapped().key,me=de===void 0?0:this.data[te].indexOf(de),Ue=this.data[te][me];return this.data[te].splice(me,1),Ue.timeout&&clearTimeout(Ue.timeout),this.data[te].length===0&&delete this.data[te],this.onRemove(Ue.value),this.order.splice(this.order.indexOf(te),1),this},Ce.prototype.setMaxSize=function(W){for(this.max=W;this.order.length>this.max;){var de=this._getAndRemoveByKey(this.order[0]);de&&this.onRemove(de)}return this},Ce.prototype.filter=function(W){var de=[];for(var te in this.data)for(var me=0,Ue=this.data[te];me1||(Math.abs(Jt)>1&&(Math.abs(Jt+vr)===1?Jt+=vr:Math.abs(Jt-vr)===1&&(Jt-=vr)),!(!It.dem||!bt.dem)&&(bt.dem.backfillBorder(It.dem,Jt,Kt),bt.neighboringTiles&&bt.neighboringTiles[Tr]&&(bt.neighboringTiles[Tr].backfilled=!0)))}},W.prototype.getTile=function(te){return this.getTileByID(te.key)},W.prototype.getTileByID=function(te){return this._tiles[te]},W.prototype._retainLoadedChildren=function(te,me,Ue,tt){for(var ft in this._tiles){var st=this._tiles[ft];if(!(tt[ft]||!st.hasData()||st.tileID.overscaledZ<=me||st.tileID.overscaledZ>Ue)){for(var bt=st.tileID;st&&st.tileID.overscaledZ>me+1;){var It=st.tileID.scaledTo(st.tileID.overscaledZ-1);st=this._tiles[It.key],st&&st.hasData()&&(bt=It)}for(var Jt=bt;Jt.overscaledZ>me;)if(Jt=Jt.scaledTo(Jt.overscaledZ-1),te[Jt.key]){tt[bt.key]=bt;break}}}},W.prototype.findLoadedParent=function(te,me){if(te.key in this._loadedParentTiles){var Ue=this._loadedParentTiles[te.key];return Ue&&Ue.tileID.overscaledZ>=me?Ue:null}for(var tt=te.overscaledZ-1;tt>=me;tt--){var ft=te.scaledTo(tt),st=this._getLoadedTile(ft);if(st)return st}},W.prototype._getLoadedTile=function(te){var me=this._tiles[te.key];if(me&&me.hasData())return me;var Ue=this._cache.getByKey(te.wrapped().key);return Ue},W.prototype.updateCacheSize=function(te){var me=Math.ceil(te.width/this._source.tileSize)+1,Ue=Math.ceil(te.height/this._source.tileSize)+1,tt=me*Ue,ft=5,st=Math.floor(tt*ft),bt=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,st):st;this._cache.setMaxSize(bt)},W.prototype.handleWrapJump=function(te){var me=this._prevLng===void 0?te:this._prevLng,Ue=te-me,tt=Ue/360,ft=Math.round(tt);if(this._prevLng=te,ft){var st={};for(var bt in this._tiles){var It=this._tiles[bt];It.tileID=It.tileID.unwrapTo(It.tileID.wrap+ft),st[It.tileID.key]=It}this._tiles=st;for(var Jt in this._timers)clearTimeout(this._timers[Jt]),delete this._timers[Jt];for(var Kt in this._tiles){var vr=this._tiles[Kt];this._setTileReloadTimer(Kt,vr)}}},W.prototype.update=function(te){var me=this;if(this.transform=te,!(!this._sourceLoaded||this._paused)){this.updateCacheSize(te),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};var Ue;this.used?this._source.tileID?Ue=te.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(hn){return new e.OverscaledTileID(hn.canonical.z,hn.wrap,hn.canonical.z,hn.canonical.x,hn.canonical.y)}):(Ue=te.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(Ue=Ue.filter(function(hn){return me._source.hasTile(hn)}))):Ue=[];var tt=te.coveringZoomLevel(this._source),ft=Math.max(tt-W.maxOverzooming,this._source.minzoom),st=Math.max(tt+W.maxUnderzooming,this._source.minzoom),bt=this._updateRetainedTiles(Ue,tt);if(ga(this._source.type)){for(var It={},Jt={},Kt=Object.keys(bt),vr=0,Tr=Kt;vrthis._source.maxzoom){var xr=tr.children(this._source.maxzoom)[0],ea=this.getTile(xr);if(ea&&ea.hasData()){Ue[xr.key]=xr;continue}}else{var ha=tr.children(this._source.maxzoom);if(Ue[ha[0].key]&&Ue[ha[1].key]&&Ue[ha[2].key]&&Ue[ha[3].key])continue}for(var Ea=pr.wasRequested(),tn=tr.overscaledZ-1;tn>=ft;--tn){var Xa=tr.scaledTo(tn);if(tt[Xa.key]||(tt[Xa.key]=!0,pr=this.getTile(Xa),!pr&&Ea&&(pr=this._addTile(Xa)),pr&&(Ue[Xa.key]=Xa,Ea=pr.wasRequested(),pr.hasData())))break}}}return Ue},W.prototype._updateLoadedParentTileCache=function(){this._loadedParentTiles={};for(var te in this._tiles){for(var me=[],Ue=void 0,tt=this._tiles[te].tileID;tt.overscaledZ>0;){if(tt.key in this._loadedParentTiles){Ue=this._loadedParentTiles[tt.key];break}me.push(tt.key);var ft=tt.scaledTo(tt.overscaledZ-1);if(Ue=this._getLoadedTile(ft),Ue)break;tt=ft}for(var st=0,bt=me;st0)&&(me.hasData()&&me.state!=="reloading"?this._cache.add(me.tileID,me,me.getExpiryTimeout()):(me.aborted=!0,this._abortTile(me),this._unloadTile(me))))},W.prototype.clearTiles=function(){this._shouldReloadOnResume=!1,this._paused=!1;for(var te in this._tiles)this._removeTile(te);this._cache.reset()},W.prototype.tilesIn=function(te,me,Ue){var tt=this,ft=[],st=this.transform;if(!st)return ft;for(var bt=Ue?st.getCameraQueryGeometry(te):te,It=te.map(function(tn){return st.pointCoordinate(tn)}),Jt=bt.map(function(tn){return st.pointCoordinate(tn)}),Kt=this.getIds(),vr=1/0,Tr=1/0,wr=-1/0,tr=-1/0,pr=0,xr=Jt;pr=0&&xn[1].y+hn>=0){var fn=It.map(function(Yn){return Ya.getTilePoint(Yn)}),En=Jt.map(function(Yn){return Ya.getTilePoint(Yn)});ft.push({tile:Xa,tileID:Ya,queryGeometry:fn,cameraQueryGeometry:En,scale:an})}}},Ea=0;Ea=e.browser.now())return!0}return!1},W.prototype.setFeatureState=function(te,me,Ue){te=te||"_geojsonTileLayer",this._state.updateState(te,me,Ue)},W.prototype.removeFeatureState=function(te,me,Ue){te=te||"_geojsonTileLayer",this._state.removeFeatureState(te,me,Ue)},W.prototype.getFeatureState=function(te,me){return te=te||"_geojsonTileLayer",this._state.getState(te,me)},W.prototype.setDependencies=function(te,me,Ue){var tt=this._tiles[te];tt&&tt.setDependencies(me,Ue)},W.prototype.reloadTilesForDependencies=function(te,me){for(var Ue in this._tiles){var tt=this._tiles[Ue];tt.hasDependency(te,me)&&this._reloadTile(Ue,"reloading")}this._cache.filter(function(ft){return!ft.hasDependency(te,me)})},W}(e.Evented);na.maxOverzooming=10,na.maxUnderzooming=3;function Ur(ye,W){var de=Math.abs(ye.wrap*2)-+(ye.wrap<0),te=Math.abs(W.wrap*2)-+(W.wrap<0);return ye.overscaledZ-W.overscaledZ||te-de||W.canonical.y-ye.canonical.y||W.canonical.x-ye.canonical.x}function ga(ye){return ye==="raster"||ye==="image"||ye==="video"}function Aa(){return new e.window.Worker(ls.workerUrl)}var Pa="mapboxgl_preloaded_worker_pool",sa=function(){this.active={}};sa.prototype.acquire=function(W){if(!this.workers)for(this.workers=[];this.workers.length0?(me-tt)/ft:0;return this.points[Ue].mult(1-st).add(this.points[de].mult(st))};var ra=function(W,de,te){var me=this.boxCells=[],Ue=this.circleCells=[];this.xCellCount=Math.ceil(W/te),this.yCellCount=Math.ceil(de/te);for(var tt=0;ttthis.width||me<0||de>this.height)return Ue?!1:[];var ft=[];if(W<=0&&de<=0&&this.width<=te&&this.height<=me){if(Ue)return!0;for(var st=0;st0:ft}},ra.prototype._queryCircle=function(W,de,te,me,Ue){var tt=W-te,ft=W+te,st=de-te,bt=de+te;if(ft<0||tt>this.width||bt<0||st>this.height)return me?!1:[];var It=[],Jt={hitTest:me,circle:{x:W,y:de,radius:te},seenUids:{box:{},circle:{}}};return this._forEachCell(tt,st,ft,bt,this._queryCellCircle,It,Jt,Ue),me?It.length>0:It},ra.prototype.query=function(W,de,te,me,Ue){return this._query(W,de,te,me,!1,Ue)},ra.prototype.hitTest=function(W,de,te,me,Ue){return this._query(W,de,te,me,!0,Ue)},ra.prototype.hitTestCircle=function(W,de,te,me){return this._queryCircle(W,de,te,!0,me)},ra.prototype._queryCell=function(W,de,te,me,Ue,tt,ft,st){var bt=ft.seenUids,It=this.boxCells[Ue];if(It!==null)for(var Jt=this.bboxes,Kt=0,vr=It;Kt=Jt[wr+0]&&me>=Jt[wr+1]&&(!st||st(this.boxKeys[Tr]))){if(ft.hitTest)return tt.push(!0),!0;tt.push({key:this.boxKeys[Tr],x1:Jt[wr],y1:Jt[wr+1],x2:Jt[wr+2],y2:Jt[wr+3]})}}}var tr=this.circleCells[Ue];if(tr!==null)for(var pr=this.circles,xr=0,ea=tr;xrft*ft+st*st},ra.prototype._circleAndRectCollide=function(W,de,te,me,Ue,tt,ft){var st=(tt-me)/2,bt=Math.abs(W-(me+st));if(bt>st+te)return!1;var It=(ft-Ue)/2,Jt=Math.abs(de-(Ue+It));if(Jt>It+te)return!1;if(bt<=st||Jt<=It)return!0;var Kt=bt-st,vr=Jt-It;return Kt*Kt+vr*vr<=te*te};function pa(ye,W,de,te,me){var Ue=e.create();return W?(e.scale(Ue,Ue,[1/me,1/me,1]),de||e.rotateZ(Ue,Ue,te.angle)):e.multiply(Ue,te.labelPlaneMatrix,ye),Ue}function pn(ye,W,de,te,me){if(W){var Ue=e.clone(ye);return e.scale(Ue,Ue,[me,me,1]),de||e.rotateZ(Ue,Ue,-te.angle),Ue}else return te.glCoordMatrix}function Ga(ye,W){var de=[ye.x,ye.y,0,1];Wo(de,de,W);var te=de[3];return{point:new e.Point(de[0]/te,de[1]/te),signedDistanceFromCamera:te}}function qn(ye,W){return .5+.5*(ye/W)}function Vn(ye,W){var de=ye[0]/ye[3],te=ye[1]/ye[3],me=de>=-W[0]&&de<=W[0]&&te>=-W[1]&&te<=W[1];return me}function di(ye,W,de,te,me,Ue,tt,ft){var st=te?ye.textSizeData:ye.iconSizeData,bt=e.evaluateSizeForZoom(st,de.transform.zoom),It=[256/de.width*2+1,256/de.height*2+1],Jt=te?ye.text.dynamicLayoutVertexArray:ye.icon.dynamicLayoutVertexArray;Jt.clear();for(var Kt=ye.lineVertexArray,vr=te?ye.text.placedSymbolArray:ye.icon.placedSymbolArray,Tr=de.transform.width/de.transform.height,wr=!1,tr=0;trUe)return{useVertical:!0}}return(ye===e.WritingMode.vertical?W.yde.x)?{needsFlipping:!0}:null}function ci(ye,W,de,te,me,Ue,tt,ft,st,bt,It,Jt,Kt,vr){var Tr=W/24,wr=ye.lineOffsetX*Tr,tr=ye.lineOffsetY*Tr,pr;if(ye.numGlyphs>1){var xr=ye.glyphStartIndex+ye.numGlyphs,ea=ye.lineStartIndex,ha=ye.lineStartIndex+ye.lineLength,Ea=yi(Tr,ft,wr,tr,de,It,Jt,ye,st,Ue,Kt);if(!Ea)return{notEnoughRoom:!0};var tn=Ga(Ea.first.point,tt).point,Xa=Ga(Ea.last.point,tt).point;if(te&&!de){var Ya=Ci(ye.writingMode,tn,Xa,vr);if(Ya)return Ya}pr=[Ea.first];for(var an=ye.glyphStartIndex+1;an0?En.point:ei(Jt,fn,hn,1,me),vi=Ci(ye.writingMode,hn,Yn,vr);if(vi)return vi}var ai=mi(Tr*ft.getoffsetX(ye.glyphStartIndex),wr,tr,de,It,Jt,ye.segment,ye.lineStartIndex,ye.lineStartIndex+ye.lineLength,st,Ue,Kt);if(!ai)return{notEnoughRoom:!0};pr=[ai]}for(var Io=0,yo=pr;Io0?1:-1,Tr=0;te&&(vr*=-1,Tr=Math.PI),vr<0&&(Tr+=Math.PI);for(var wr=vr>0?ft+tt:ft+tt+1,tr=me,pr=me,xr=0,ea=0,ha=Math.abs(Kt),Ea=[];xr+ea<=ha;){if(wr+=vr,wr=st)return null;if(pr=tr,Ea.push(tr),tr=Jt[wr],tr===void 0){var tn=new e.Point(bt.getx(wr),bt.gety(wr)),Xa=Ga(tn,It);if(Xa.signedDistanceFromCamera>0)tr=Jt[wr]=Xa.point;else{var Ya=wr-vr,an=xr===0?Ue:new e.Point(bt.getx(Ya),bt.gety(Ya));tr=ei(an,tn,pr,ha-xr+1,It)}}xr+=ea,ea=pr.dist(tr)}var hn=(ha-xr)/ea,xn=tr.sub(pr),fn=xn.mult(hn)._add(pr);fn._add(xn._unit()._perp()._mult(de*vr));var En=Tr+Math.atan2(tr.y-pr.y,tr.x-pr.x);return Ea.push(fn),{point:fn,angle:En,path:Ea}}var uo=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Lo(ye,W){for(var de=0;de=1;vs--)yo.push(ai.path[vs]);for(var us=1;us0){for(var Uo=yo[0].clone(),Vs=yo[0].clone(),Fu=1;Fu=En.x&&Vs.x<=Yn.x&&Uo.y>=En.y&&Vs.y<=Yn.y?ul=[yo]:Vs.xYn.x||Vs.yYn.y?ul=[]:ul=e.clipLine([yo],En.x,En.y,Yn.x,Yn.y)}for(var fc=0,dh=ul;fc=this.screenRightBoundary||methis.screenBottomBoundary},Ii.prototype.isInsideGrid=function(W,de,te,me){return te>=0&&W=0&&de0){var ha;return this.prevPlacement&&this.prevPlacement.variableOffsets[Kt.crossTileID]&&this.prevPlacement.placements[Kt.crossTileID]&&this.prevPlacement.placements[Kt.crossTileID].text&&(ha=this.prevPlacement.variableOffsets[Kt.crossTileID].anchor),this.variableOffsets[Kt.crossTileID]={textOffset:tr,width:te,height:me,anchor:W,textBoxScale:Ue,prevAnchor:ha},this.markUsedJustification(vr,W,Kt,Tr),vr.allowVerticalPlacement&&(this.markUsedOrientation(vr,Tr,Kt),this.placedOrientations[Kt.crossTileID]=Tr),{shift:pr,placedGlyphBoxes:xr}}},Co.prototype.placeLayerBucketPart=function(W,de,te){var me=this,Ue=W.parameters,tt=Ue.bucket,ft=Ue.layout,st=Ue.posMatrix,bt=Ue.textLabelPlaneMatrix,It=Ue.labelToScreenMatrix,Jt=Ue.textPixelRatio,Kt=Ue.holdingForFade,vr=Ue.collisionBoxArray,Tr=Ue.partiallyEvaluatedTextSize,wr=Ue.collisionGroup,tr=ft.get("text-optional"),pr=ft.get("icon-optional"),xr=ft.get("text-allow-overlap"),ea=ft.get("icon-allow-overlap"),ha=ft.get("text-rotation-alignment")==="map",Ea=ft.get("text-pitch-alignment")==="map",tn=ft.get("icon-text-fit")!=="none",Xa=ft.get("symbol-z-order")==="viewport-y",Ya=xr&&(ea||!tt.hasIconData()||pr),an=ea&&(xr||!tt.hasTextData()||tr);!tt.collisionArrays&&vr&&tt.deserializeCollisionBoxes(vr);var hn=function(ai,Io){if(!de[ai.crossTileID]){if(Kt){me.placements[ai.crossTileID]=new Ro(!1,!1,!1);return}var yo=!1,vs=!1,us=!0,Ds=null,rs={box:null,offscreen:null},ul={box:null,offscreen:null},Uo=null,Vs=null,Fu=null,fc=0,dh=0,ph=0;Io.textFeatureIndex?fc=Io.textFeatureIndex:ai.useRuntimeCollisionCircles&&(fc=ai.featureIndex),Io.verticalTextFeatureIndex&&(dh=Io.verticalTextFeatureIndex);var If=Io.textBox;if(If){var Mh=function(lu){var pl=e.WritingMode.horizontal;if(tt.allowVerticalPlacement&&!lu&&me.prevPlacement){var zf=me.prevPlacement.placedOrientations[ai.crossTileID];zf&&(me.placedOrientations[ai.crossTileID]=zf,pl=zf,me.markUsedOrientation(tt,pl,ai))}return pl},hv=function(lu,pl){if(tt.allowVerticalPlacement&&ai.numVerticalGlyphVertices>0&&Io.verticalTextBox)for(var zf=0,Kv=tt.writingModes;zf0&&(Xf=Xf.filter(function(lu){return lu!==Df.anchor}),Xf.unshift(Df.anchor))}var gh=function(lu,pl,zf){for(var Kv=lu.x2-lu.x1,yd=lu.y2-lu.y1,Ml=ai.textBoxScale,cp=tn&&!ea?pl:null,Pv={box:[],offscreen:!1},$p=xr?Xf.length*2:Xf.length,mh=0;mh<$p;++mh){var Iv=Xf[mh%Xf.length],Qp=mh>=Xf.length,fp=me.attemptAnchorPlacement(Iv,lu,Kv,yd,Ml,ha,Ea,Jt,st,wr,Qp,ai,tt,zf,cp);if(fp&&(Pv=fp.placedGlyphBoxes,Pv&&Pv.box&&Pv.box.length)){yo=!0,Ds=fp.shift;break}}return Pv},Eh=function(){return gh(If,Io.iconBox,e.WritingMode.horizontal)},yh=function(){var lu=Io.verticalTextBox,pl=rs&&rs.box&&rs.box.length;return tt.allowVerticalPlacement&&!pl&&ai.numVerticalGlyphVertices>0&&lu?gh(lu,Io.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}};hv(Eh,yh),rs&&(yo=rs.box,us=rs.offscreen);var Zv=Mh(rs&&rs.box);if(!yo&&me.prevPlacement){var vv=me.prevPlacement.variableOffsets[ai.crossTileID];vv&&(me.variableOffsets[ai.crossTileID]=vv,me.markUsedJustification(tt,vv.anchor,ai,Zv))}}else{var Rh=function(lu,pl){var zf=me.collisionIndex.placeCollisionBox(lu,xr,Jt,st,wr.predicate);return zf&&zf.box&&zf.box.length&&(me.markUsedOrientation(tt,pl,ai),me.placedOrientations[ai.crossTileID]=pl),zf},Rf=function(){return Rh(If,e.WritingMode.horizontal)},Dh=function(){var lu=Io.verticalTextBox;return tt.allowVerticalPlacement&&ai.numVerticalGlyphVertices>0&&lu?Rh(lu,e.WritingMode.vertical):{box:null,offscreen:null}};hv(Rf,Dh),Mh(rs&&rs.box&&rs.box.length)}}if(Uo=rs,yo=Uo&&Uo.box&&Uo.box.length>0,us=Uo&&Uo.offscreen,ai.useRuntimeCollisionCircles){var Pc=tt.text.placedSymbolArray.get(ai.centerJustifiedTextSymbolIndex),dv=e.evaluateSizeForFeature(tt.textSizeData,Tr,Pc),Xv=ft.get("text-padding"),of=ai.collisionCircleDiameter;Vs=me.collisionIndex.placeCollisionCircles(xr,Pc,tt.lineVertexArray,tt.glyphOffsetArray,dv,st,bt,It,te,Ea,wr.predicate,of,Xv),yo=xr||Vs.circles.length>0&&!Vs.collisionDetected,us=us&&Vs.offscreen}if(Io.iconFeatureIndex&&(ph=Io.iconFeatureIndex),Io.iconBox){var kv=function(lu){var pl=tn&&Ds?fs(lu,Ds.x,Ds.y,ha,Ea,me.transform.angle):lu;return me.collisionIndex.placeCollisionBox(pl,ea,Jt,st,wr.predicate)};ul&&ul.box&&ul.box.length&&Io.verticalIconBox?(Fu=kv(Io.verticalIconBox),vs=Fu.box.length>0):(Fu=kv(Io.iconBox),vs=Fu.box.length>0),us=us&&Fu.offscreen}var pd=tr||ai.numHorizontalGlyphVertices===0&&ai.numVerticalGlyphVertices===0,gd=pr||ai.numIconVertices===0;if(!pd&&!gd?vs=yo=vs&&yo:gd?pd||(vs=vs&&yo):yo=vs&&yo,yo&&Uo&&Uo.box&&(ul&&ul.box&&dh?me.collisionIndex.insertCollisionBox(Uo.box,ft.get("text-ignore-placement"),tt.bucketInstanceId,dh,wr.ID):me.collisionIndex.insertCollisionBox(Uo.box,ft.get("text-ignore-placement"),tt.bucketInstanceId,fc,wr.ID)),vs&&Fu&&me.collisionIndex.insertCollisionBox(Fu.box,ft.get("icon-ignore-placement"),tt.bucketInstanceId,ph,wr.ID),Vs&&(yo&&me.collisionIndex.insertCollisionCircles(Vs.circles,ft.get("text-ignore-placement"),tt.bucketInstanceId,fc,wr.ID),te)){var Yv=tt.bucketInstanceId,Cv=me.collisionCircleArrays[Yv];Cv===void 0&&(Cv=me.collisionCircleArrays[Yv]=new Li);for(var Lv=0;Lv=0;--fn){var En=xn[fn];hn(tt.symbolInstances.get(En),tt.collisionArrays[En])}else for(var Yn=W.symbolInstanceStart;Yn=0&&(tt>=0&&It!==tt?W.text.placedSymbolArray.get(It).crossTileID=0:W.text.placedSymbolArray.get(It).crossTileID=te.crossTileID)}},Co.prototype.markUsedOrientation=function(W,de,te){for(var me=de===e.WritingMode.horizontal||de===e.WritingMode.horizontalOnly?de:0,Ue=de===e.WritingMode.vertical?de:0,tt=[te.leftJustifiedTextSymbolIndex,te.centerJustifiedTextSymbolIndex,te.rightJustifiedTextSymbolIndex],ft=0,st=tt;ft0||Ea>0,hn=ea.numIconVertices>0,xn=me.placedOrientations[ea.crossTileID],fn=xn===e.WritingMode.vertical,En=xn===e.WritingMode.horizontal||xn===e.WritingMode.horizontalOnly;if(an){var Yn=Ks(Ya.text),vi=fn?Rn:Yn;Tr(W.text,ha,vi);var ai=En?Rn:Yn;Tr(W.text,Ea,ai);var Io=Ya.text.isHidden();[ea.rightJustifiedTextSymbolIndex,ea.centerJustifiedTextSymbolIndex,ea.leftJustifiedTextSymbolIndex].forEach(function(ph){ph>=0&&(W.text.placedSymbolArray.get(ph).hidden=Io||fn?1:0)}),ea.verticalPlacedTextSymbolIndex>=0&&(W.text.placedSymbolArray.get(ea.verticalPlacedTextSymbolIndex).hidden=Io||En?1:0);var yo=me.variableOffsets[ea.crossTileID];yo&&me.markUsedJustification(W,yo.anchor,ea,xn);var vs=me.placedOrientations[ea.crossTileID];vs&&(me.markUsedJustification(W,"left",ea,vs),me.markUsedOrientation(W,vs,ea))}if(hn){var us=Ks(Ya.icon),Ds=!(Kt&&ea.verticalPlacedIconSymbolIndex&&fn);if(ea.placedIconSymbolIndex>=0){var rs=Ds?us:Rn;Tr(W.icon,ea.numIconVertices,rs),W.icon.placedSymbolArray.get(ea.placedIconSymbolIndex).hidden=Ya.icon.isHidden()}if(ea.verticalPlacedIconSymbolIndex>=0){var ul=Ds?Rn:us;Tr(W.icon,ea.numVerticalIconVertices,ul),W.icon.placedSymbolArray.get(ea.verticalPlacedIconSymbolIndex).hidden=Ya.icon.isHidden()}}if(W.hasIconCollisionBoxData()||W.hasTextCollisionBoxData()){var Uo=W.collisionArrays[xr];if(Uo){var Vs=new e.Point(0,0);if(Uo.textBox||Uo.verticalTextBox){var Fu=!0;if(bt){var fc=me.variableOffsets[tn];fc?(Vs=as(fc.anchor,fc.width,fc.height,fc.textOffset,fc.textBoxScale),It&&Vs._rotate(Jt?me.transform.angle:-me.transform.angle)):Fu=!1}Uo.textBox&&Qa(W.textCollisionBox.collisionVertexArray,Ya.text.placed,!Fu||fn,Vs.x,Vs.y),Uo.verticalTextBox&&Qa(W.textCollisionBox.collisionVertexArray,Ya.text.placed,!Fu||En,Vs.x,Vs.y)}var dh=!!(!En&&Uo.verticalIconBox);Uo.iconBox&&Qa(W.iconCollisionBox.collisionVertexArray,Ya.icon.placed,dh,Kt?Vs.x:0,Kt?Vs.y:0),Uo.verticalIconBox&&Qa(W.iconCollisionBox.collisionVertexArray,Ya.icon.placed,!dh,Kt?Vs.x:0,Kt?Vs.y:0)}}},tr=0;trW},Co.prototype.setStale=function(){this.stale=!0};function Qa(ye,W,de,te,me){ye.emplaceBack(W?1:0,de?1:0,te||0,me||0),ye.emplaceBack(W?1:0,de?1:0,te||0,me||0),ye.emplaceBack(W?1:0,de?1:0,te||0,me||0),ye.emplaceBack(W?1:0,de?1:0,te||0,me||0)}var Jn=Math.pow(2,25),Os=Math.pow(2,24),ds=Math.pow(2,17),Ui=Math.pow(2,16),ms=Math.pow(2,9),Mo=Math.pow(2,8),ws=Math.pow(2,1);function Ks(ye){if(ye.opacity===0&&!ye.placed)return 0;if(ye.opacity===1&&ye.placed)return 4294967295;var W=ye.placed?1:0,de=Math.floor(ye.opacity*127);return de*Jn+W*Os+de*ds+W*Ui+de*ms+W*Mo+de*ws+W}var Rn=0,fo=function(W){this._sortAcrossTiles=W.layout.get("symbol-z-order")!=="viewport-y"&&W.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};fo.prototype.continuePlacement=function(W,de,te,me,Ue){for(var tt=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var ft=W[this._currentPlacementIndex],st=de[ft],bt=this.placement.collisionIndex.transform.zoom;if(st.type==="symbol"&&(!st.minzoom||st.minzoom<=bt)&&(!st.maxzoom||st.maxzoom>bt)){this._inProgressLayer||(this._inProgressLayer=new fo(st));var It=this._inProgressLayer.continuePlacement(te[st.source],this.placement,this._showCollisionBoxes,st,tt);if(It)return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Pi.prototype.commit=function(W){return this.placement.commit(W),this.placement};var zo=512/e.EXTENT/2,wo=function(W,de,te){this.tileID=W,this.indexedSymbolInstances={},this.bucketInstanceId=te;for(var me=0;meW.overscaledZ)for(var bt in st){var It=st[bt];It.tileID.isChildOf(W)&&It.findMatches(de.symbolInstances,W,tt)}else{var Jt=W.scaledTo(Number(ft)),Kt=st[Jt.key];Kt&&Kt.findMatches(de.symbolInstances,W,tt)}}for(var vr=0;vr0)throw new Error("Unimplemented: "+tt.map(function(ft){return ft.command}).join(", ")+".");return Ue.forEach(function(ft){ft.command!=="setTransition"&&me[ft.command].apply(me,ft.args)}),this.stylesheet=te,!0},W.prototype.addImage=function(te,me){if(this.getImage(te))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(te,me),this._afterImageUpdated(te)},W.prototype.updateImage=function(te,me){this.imageManager.updateImage(te,me)},W.prototype.getImage=function(te){return this.imageManager.getImage(te)},W.prototype.removeImage=function(te){if(!this.getImage(te))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(te),this._afterImageUpdated(te)},W.prototype._afterImageUpdated=function(te){this._availableImages=this.imageManager.listImages(),this._changedImages[te]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},W.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},W.prototype.addSource=function(te,me,Ue){var tt=this;if(Ue===void 0&&(Ue={}),this._checkLoaded(),this.sourceCaches[te]!==void 0)throw new Error("There is already a source with this ID");if(!me.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(me).join(", ")+".");var ft=["vector","raster","geojson","video","image"],st=ft.indexOf(me.type)>=0;if(!(st&&this._validate(e.validateStyle.source,"sources."+te,me,null,Ue))){this.map&&this.map._collectResourceTiming&&(me.collectResourceTiming=!0);var bt=this.sourceCaches[te]=new na(te,me,this.dispatcher);bt.style=this,bt.setEventedParent(this,function(){return{isSourceLoaded:tt.loaded(),source:bt.serialize(),sourceId:te}}),bt.onAdd(this.map),this._changed=!0}},W.prototype.removeSource=function(te){if(this._checkLoaded(),this.sourceCaches[te]===void 0)throw new Error("There is no source with this ID");for(var me in this._layers)if(this._layers[me].source===te)return this.fire(new e.ErrorEvent(new Error('Source "'+te+'" cannot be removed while layer "'+me+'" is using it.')));var Ue=this.sourceCaches[te];delete this.sourceCaches[te],delete this._updatedSources[te],Ue.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:te})),Ue.setEventedParent(null),Ue.clearTiles(),Ue.onRemove&&Ue.onRemove(this.map),this._changed=!0},W.prototype.setGeoJSONSourceData=function(te,me){this._checkLoaded();var Ue=this.sourceCaches[te].getSource();Ue.setData(me),this._changed=!0},W.prototype.getSource=function(te){return this.sourceCaches[te]&&this.sourceCaches[te].getSource()},W.prototype.addLayer=function(te,me,Ue){Ue===void 0&&(Ue={}),this._checkLoaded();var tt=te.id;if(this.getLayer(tt)){this.fire(new e.ErrorEvent(new Error('Layer with id "'+tt+'" already exists on this map')));return}var ft;if(te.type==="custom"){if(Js(this,e.validateCustomStyleLayer(te)))return;ft=e.createStyleLayer(te)}else{if(typeof te.source=="object"&&(this.addSource(tt,te.source),te=e.clone$1(te),te=e.extend(te,{source:tt})),this._validate(e.validateStyle.layer,"layers."+tt,te,{arrayIndex:-1},Ue))return;ft=e.createStyleLayer(te),this._validateLayer(ft),ft.setEventedParent(this,{layer:{id:tt}}),this._serializedLayers[ft.id]=ft.serialize()}var st=me?this._order.indexOf(me):this._order.length;if(me&&st===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+me+'" does not exist on this map.')));return}if(this._order.splice(st,0,tt),this._layerOrderChanged=!0,this._layers[tt]=ft,this._removedLayers[tt]&&ft.source&&ft.type!=="custom"){var bt=this._removedLayers[tt];delete this._removedLayers[tt],bt.type!==ft.type?this._updatedSources[ft.source]="clear":(this._updatedSources[ft.source]="reload",this.sourceCaches[ft.source].pause())}this._updateLayer(ft),ft.onAdd&&ft.onAdd(this.map)},W.prototype.moveLayer=function(te,me){this._checkLoaded(),this._changed=!0;var Ue=this._layers[te];if(!Ue){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be moved.")));return}if(te!==me){var tt=this._order.indexOf(te);this._order.splice(tt,1);var ft=me?this._order.indexOf(me):this._order.length;if(me&&ft===-1){this.fire(new e.ErrorEvent(new Error('Layer with id "'+me+'" does not exist on this map.')));return}this._order.splice(ft,0,te),this._layerOrderChanged=!0}},W.prototype.removeLayer=function(te){this._checkLoaded();var me=this._layers[te];if(!me){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be removed.")));return}me.setEventedParent(null);var Ue=this._order.indexOf(te);this._order.splice(Ue,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[te]=me,delete this._layers[te],delete this._serializedLayers[te],delete this._updatedLayers[te],delete this._updatedPaintProps[te],me.onRemove&&me.onRemove(this.map)},W.prototype.getLayer=function(te){return this._layers[te]},W.prototype.hasLayer=function(te){return te in this._layers},W.prototype.setLayerZoomRange=function(te,me,Ue){this._checkLoaded();var tt=this.getLayer(te);if(!tt){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot have zoom extent.")));return}tt.minzoom===me&&tt.maxzoom===Ue||(me!=null&&(tt.minzoom=me),Ue!=null&&(tt.maxzoom=Ue),this._updateLayer(tt))},W.prototype.setFilter=function(te,me,Ue){Ue===void 0&&(Ue={}),this._checkLoaded();var tt=this.getLayer(te);if(!tt){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be filtered.")));return}if(!e.deepEqual(tt.filter,me)){if(me==null){tt.filter=void 0,this._updateLayer(tt);return}this._validate(e.validateStyle.filter,"layers."+tt.id+".filter",me,null,Ue)||(tt.filter=e.clone$1(me),this._updateLayer(tt))}},W.prototype.getFilter=function(te){return e.clone$1(this.getLayer(te).filter)},W.prototype.setLayoutProperty=function(te,me,Ue,tt){tt===void 0&&(tt={}),this._checkLoaded();var ft=this.getLayer(te);if(!ft){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}e.deepEqual(ft.getLayoutProperty(me),Ue)||(ft.setLayoutProperty(me,Ue,tt),this._updateLayer(ft))},W.prototype.getLayoutProperty=function(te,me){var Ue=this.getLayer(te);if(!Ue){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style.")));return}return Ue.getLayoutProperty(me)},W.prototype.setPaintProperty=function(te,me,Ue,tt){tt===void 0&&(tt={}),this._checkLoaded();var ft=this.getLayer(te);if(!ft){this.fire(new e.ErrorEvent(new Error("The layer '"+te+"' does not exist in the map's style and cannot be styled.")));return}if(!e.deepEqual(ft.getPaintProperty(me),Ue)){var st=ft.setPaintProperty(me,Ue,tt);st&&this._updateLayer(ft),this._changed=!0,this._updatedPaintProps[te]=!0}},W.prototype.getPaintProperty=function(te,me){return this.getLayer(te).getPaintProperty(me)},W.prototype.setFeatureState=function(te,me){this._checkLoaded();var Ue=te.source,tt=te.sourceLayer,ft=this.sourceCaches[Ue];if(ft===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+Ue+"' does not exist in the map's style.")));return}var st=ft.getSource().type;if(st==="geojson"&&tt){this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(st==="vector"&&!tt){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),ft.setFeatureState(tt,te.id,me)},W.prototype.removeFeatureState=function(te,me){this._checkLoaded();var Ue=te.source,tt=this.sourceCaches[Ue];if(tt===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+Ue+"' does not exist in the map's style.")));return}var ft=tt.getSource().type,st=ft==="vector"?te.sourceLayer:void 0;if(ft==="vector"&&!st){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(me&&typeof te.id!="string"&&typeof te.id!="number"){this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));return}tt.removeFeatureState(st,te.id,me)},W.prototype.getFeatureState=function(te){this._checkLoaded();var me=te.source,Ue=te.sourceLayer,tt=this.sourceCaches[me];if(tt===void 0){this.fire(new e.ErrorEvent(new Error("The source '"+me+"' does not exist in the map's style.")));return}var ft=tt.getSource().type;if(ft==="vector"&&!Ue){this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return te.id===void 0&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),tt.getFeatureState(Ue,te.id)},W.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},W.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,function(te){return te.serialize()}),layers:this._serializeLayers(this._order)},function(te){return te!==void 0})},W.prototype._updateLayer=function(te){this._updatedLayers[te.id]=!0,te.source&&!this._updatedSources[te.source]&&this.sourceCaches[te.source].getSource().type!=="raster"&&(this._updatedSources[te.source]="reload",this.sourceCaches[te.source].pause()),this._changed=!0},W.prototype._flattenAndSortRenderedFeatures=function(te){for(var me=this,Ue=function(En){return me._layers[En].type==="fill-extrusion"},tt={},ft=[],st=this._order.length-1;st>=0;st--){var bt=this._order[st];if(Ue(bt)){tt[bt]=st;for(var It=0,Jt=te;It=0;xr--){var ea=this._order[xr];if(Ue(ea))for(var ha=ft.length-1;ha>=0;ha--){var Ea=ft[ha].feature;if(tt[Ea.layer.id] 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;}`,hl=`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 +}`,yf=`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;}`,Jc=`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,Uc="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;}",$u=`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 +}`,jc="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;}",$c=`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 +}`,bu=` +#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);}`,Qc=`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +#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,v_uv);gl_FragColor=color*(alpha*opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,sc=` +#define scale 0.015873016 +attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`,wu=`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 +}`,eu=` +#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;}`,Sc=`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 +}`,ef=` +#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);}`,ps=`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 +}`,Vc="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;}",Zf=`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 +}`,mf=`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));}`,Mc=`#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 +}`,_f=`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);}`,tu=`#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 +}`,xf=`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);}`,Fl=Rs(Lu,Bu),ru=Rs(kf,gf),Uu=Rs(ns,_u),$s=Rs(Nc,ml),Qu=Rs(fl,_l),Tu=Rs(Yu,Ts),au=Rs(Tl,Ko),Ns=Rs(Cs,Nu),yc=Rs(Ul,Ku),Pu=Rs(Bs,Gf),ec=Rs(Eo,Wf),Ec=Rs(is,oo),Cf=Rs(pc,xu),nh=Rs(zl,Kc),lc=Rs(Ju,gc),kc=Rs(hl,yf),nu=Rs(Jc,Uc),tf=Rs($u,jc),Cl=Rs($c,bu),uc=Rs(Qc,sc),rf=Rs(wu,eu),mc=Rs(Sc,ef),Us=Rs(ps,Vc),vu=Rs(Zf,mf),du=Rs(Mc,_f),af=Rs(tu,xf);function Rs(ye,W){var de=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,te=W.match(/attribute ([\w]+) ([\w]+)/g),me=ye.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Ue=W.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),tt=Ue?Ue.concat(me):me,ft={};return ye=ye.replace(de,function(st,bt,It,Jt,Kt){return ft[Kt]=!0,bt==="define"?` +#ifndef HAS_UNIFORM_u_`+Kt+` +varying `+It+" "+Jt+" "+Kt+`; +#else +uniform `+It+" "+Jt+" u_"+Kt+`; +#endif +`:` +#ifdef HAS_UNIFORM_u_`+Kt+` + `+It+" "+Jt+" "+Kt+" = u_"+Kt+`; +#endif +`}),W=W.replace(de,function(st,bt,It,Jt,Kt){var vr=Jt==="float"?"vec2":"vec4",Tr=Kt.match(/color/)?"color":vr;return ft[Kt]?bt==="define"?` +#ifndef HAS_UNIFORM_u_`+Kt+` +uniform lowp float u_`+Kt+`_t; +attribute `+It+" "+vr+" a_"+Kt+`; +varying `+It+" "+Jt+" "+Kt+`; +#else +uniform `+It+" "+Jt+" u_"+Kt+`; +#endif +`:Tr==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Kt+` + `+Kt+" = a_"+Kt+`; +#else + `+It+" "+Jt+" "+Kt+" = u_"+Kt+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+Kt+` + `+Kt+" = unpack_mix_"+Tr+"(a_"+Kt+", u_"+Kt+`_t); +#else + `+It+" "+Jt+" "+Kt+" = u_"+Kt+`; +#endif +`:bt==="define"?` +#ifndef HAS_UNIFORM_u_`+Kt+` +uniform lowp float u_`+Kt+`_t; +attribute `+It+" "+vr+" a_"+Kt+`; +#else +uniform `+It+" "+Jt+" u_"+Kt+`; +#endif +`:Tr==="vec4"?` +#ifndef HAS_UNIFORM_u_`+Kt+` + `+It+" "+Jt+" "+Kt+" = a_"+Kt+`; +#else + `+It+" "+Jt+" "+Kt+" = u_"+Kt+`; +#endif +`:` +#ifndef HAS_UNIFORM_u_`+Kt+` + `+It+" "+Jt+" "+Kt+" = unpack_mix_"+Tr+"(a_"+Kt+", u_"+Kt+`_t); +#else + `+It+" "+Jt+" "+Kt+" = u_"+Kt+`; +#endif +`}),{fragmentSource:ye,vertexSource:W,staticAttributes:te,staticUniforms:tt}}var _c=Object.freeze({__proto__:null,prelude:Fl,background:ru,backgroundPattern:Uu,circle:$s,clippingMask:Qu,heatmap:Tu,heatmapTexture:au,collisionBox:Ns,collisionCircle:yc,debug:Pu,fill:ec,fillOutline:Ec,fillOutlinePattern:Cf,fillPattern:nh,fillExtrusion:lc,fillExtrusionPattern:kc,hillshadePrepare:nu,hillshade:tf,line:Cl,lineGradient:uc,linePattern:rf,lineSDF:mc,raster:Us,symbolIcon:vu,symbolSDF:du,symbolTextAndIcon:af}),ju=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};ju.prototype.bind=function(W,de,te,me,Ue,tt,ft,st){this.context=W;for(var bt=this.boundPaintVertexBuffers.length!==me.length,It=0;!bt&&It>16,ft>>16],u_pixel_coord_lower:[tt&65535,ft&65535]}}function bc(ye,W,de,te){var me=de.imageManager.getPattern(ye.from.toString()),Ue=de.imageManager.getPattern(ye.to.toString()),tt=de.imageManager.getPixelSize(),ft=tt.width,st=tt.height,bt=Math.pow(2,te.tileID.overscaledZ),It=te.tileSize*Math.pow(2,de.transform.tileZoom)/bt,Jt=It*(te.tileID.canonical.x+te.tileID.wrap*bt),Kt=It*te.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:me.tl,u_pattern_br_a:me.br,u_pattern_tl_b:Ue.tl,u_pattern_br_b:Ue.br,u_texsize:[ft,st],u_mix:W.t,u_pattern_size_a:me.displaySize,u_pattern_size_b:Ue.displaySize,u_scale_a:W.fromScale,u_scale_b:W.toScale,u_tile_units_to_pixels:1/xi(te,1,de.transform.tileZoom),u_pixel_coord_upper:[Jt>>16,Kt>>16],u_pixel_coord_lower:[Jt&65535,Kt&65535]}}var Lf=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_lightpos:new e.Uniform3f(ye,W.u_lightpos),u_lightintensity:new e.Uniform1f(ye,W.u_lightintensity),u_lightcolor:new e.Uniform3f(ye,W.u_lightcolor),u_vertical_gradient:new e.Uniform1f(ye,W.u_vertical_gradient),u_opacity:new e.Uniform1f(ye,W.u_opacity)}},xl=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_lightpos:new e.Uniform3f(ye,W.u_lightpos),u_lightintensity:new e.Uniform1f(ye,W.u_lightintensity),u_lightcolor:new e.Uniform3f(ye,W.u_lightcolor),u_vertical_gradient:new e.Uniform1f(ye,W.u_vertical_gradient),u_height_factor:new e.Uniform1f(ye,W.u_height_factor),u_image:new e.Uniform1i(ye,W.u_image),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ye,W.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ye,W.u_pixel_coord_lower),u_scale:new e.Uniform3f(ye,W.u_scale),u_fade:new e.Uniform1f(ye,W.u_fade),u_opacity:new e.Uniform1f(ye,W.u_opacity)}},nf=function(ye,W,de,te){var me=W.style.light,Ue=me.properties.get("position"),tt=[Ue.x,Ue.y,Ue.z],ft=e.create$1();me.properties.get("anchor")==="viewport"&&e.fromRotation(ft,-W.transform.angle),e.transformMat3(tt,tt,ft);var st=me.properties.get("color");return{u_matrix:ye,u_lightpos:tt,u_lightintensity:me.properties.get("intensity"),u_lightcolor:[st.r,st.g,st.b],u_vertical_gradient:+de,u_opacity:te}},ou=function(ye,W,de,te,me,Ue,tt){return e.extend(nf(ye,W,de,te),Iu(Ue,W,tt),{u_height_factor:-Math.pow(2,me.overscaledZ)/tt.tileSize/8})},Ru=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix)}},Au=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_image:new e.Uniform1i(ye,W.u_image),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ye,W.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ye,W.u_pixel_coord_lower),u_scale:new e.Uniform3f(ye,W.u_scale),u_fade:new e.Uniform1f(ye,W.u_fade)}},Zs=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_world:new e.Uniform2f(ye,W.u_world)}},Ol=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_world:new e.Uniform2f(ye,W.u_world),u_image:new e.Uniform1i(ye,W.u_image),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_pixel_coord_upper:new e.Uniform2f(ye,W.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ye,W.u_pixel_coord_lower),u_scale:new e.Uniform3f(ye,W.u_scale),u_fade:new e.Uniform1f(ye,W.u_fade)}},bl=function(ye){return{u_matrix:ye}},tc=function(ye,W,de,te){return e.extend(bl(ye),Iu(de,W,te))},Su=function(ye,W){return{u_matrix:ye,u_world:W}},Cc=function(ye,W,de,te,me){return e.extend(tc(ye,W,de,te),{u_world:me})},Ht=function(ye,W){return{u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(ye,W.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(ye,W.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(ye,W.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix)}},ur=function(ye,W,de,te){var me=ye.transform,Ue,tt;if(te.paint.get("circle-pitch-alignment")==="map"){var ft=xi(de,1,me.zoom);Ue=!0,tt=[ft,ft]}else Ue=!1,tt=me.pixelsToGLUnits;return{u_camera_to_center_distance:me.cameraToCenterDistance,u_scale_with_map:+(te.paint.get("circle-pitch-scale")==="map"),u_matrix:ye.translatePosMatrix(W.posMatrix,de,te.paint.get("circle-translate"),te.paint.get("circle-translate-anchor")),u_pitch_with_map:+Ue,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:tt}},qr=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(ye,W.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(ye,W.u_extrude_scale),u_overscale_factor:new e.Uniform1f(ye,W.u_overscale_factor)}},Or=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_inv_matrix:new e.UniformMatrix4f(ye,W.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(ye,W.u_viewport_size)}},ua=function(ye,W,de){var te=xi(de,1,W.zoom),me=Math.pow(2,W.zoom-de.tileID.overscaledZ),Ue=de.tileID.overscaleFactor();return{u_matrix:ye,u_camera_to_center_distance:W.cameraToCenterDistance,u_pixels_to_tile_units:te,u_extrude_scale:[W.pixelsToGLUnits[0]/(te*me),W.pixelsToGLUnits[1]/(te*me)],u_overscale_factor:Ue}},Fa=function(ye,W,de){return{u_matrix:ye,u_inv_matrix:W,u_camera_to_center_distance:de.cameraToCenterDistance,u_viewport_size:[de.width,de.height]}},ja=function(ye,W){return{u_color:new e.UniformColor(ye,W.u_color),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_overlay:new e.Uniform1i(ye,W.u_overlay),u_overlay_scale:new e.Uniform1f(ye,W.u_overlay_scale)}},sn=function(ye,W,de){return de===void 0&&(de=1),{u_matrix:ye,u_color:W,u_overlay:0,u_overlay_scale:de}},gn=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix)}},kn=function(ye){return{u_matrix:ye}},Ja=function(ye,W){return{u_extrude_scale:new e.Uniform1f(ye,W.u_extrude_scale),u_intensity:new e.Uniform1f(ye,W.u_intensity),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix)}},_n=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_world:new e.Uniform2f(ye,W.u_world),u_image:new e.Uniform1i(ye,W.u_image),u_color_ramp:new e.Uniform1i(ye,W.u_color_ramp),u_opacity:new e.Uniform1f(ye,W.u_opacity)}},on=function(ye,W,de,te){return{u_matrix:ye,u_extrude_scale:xi(W,1,de),u_intensity:te}},Wa=function(ye,W,de,te){var me=e.create();e.ortho(me,0,ye.width,ye.height,0,0,1);var Ue=ye.context.gl;return{u_matrix:me,u_world:[Ue.drawingBufferWidth,Ue.drawingBufferHeight],u_image:de,u_color_ramp:te,u_opacity:W.paint.get("heatmap-opacity")}},On=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_image:new e.Uniform1i(ye,W.u_image),u_latrange:new e.Uniform2f(ye,W.u_latrange),u_light:new e.Uniform2f(ye,W.u_light),u_shadow:new e.UniformColor(ye,W.u_shadow),u_highlight:new e.UniformColor(ye,W.u_highlight),u_accent:new e.UniformColor(ye,W.u_accent)}},zi=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_image:new e.Uniform1i(ye,W.u_image),u_dimension:new e.Uniform2f(ye,W.u_dimension),u_zoom:new e.Uniform1f(ye,W.u_zoom),u_unpack:new e.Uniform4f(ye,W.u_unpack)}},ki=function(ye,W,de){var te=de.paint.get("hillshade-shadow-color"),me=de.paint.get("hillshade-highlight-color"),Ue=de.paint.get("hillshade-accent-color"),tt=de.paint.get("hillshade-illumination-direction")*(Math.PI/180);de.paint.get("hillshade-illumination-anchor")==="viewport"&&(tt-=ye.transform.angle);var ft=!ye.options.moving;return{u_matrix:ye.transform.calculatePosMatrix(W.tileID.toUnwrapped(),ft),u_image:0,u_latrange:Ni(ye,W.tileID),u_light:[de.paint.get("hillshade-exaggeration"),tt],u_shadow:te,u_highlight:me,u_accent:Ue}},ji=function(ye,W){var de=W.stride,te=e.create();return e.ortho(te,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(te,te,[0,-e.EXTENT,0]),{u_matrix:te,u_image:1,u_dimension:[de,de],u_zoom:ye.overscaledZ,u_unpack:W.getUnpackVector()}};function Ni(ye,W){var de=Math.pow(2,W.canonical.z),te=W.canonical.y;return[new e.MercatorCoordinate(0,te/de).toLngLat().lat,new e.MercatorCoordinate(0,(te+1)/de).toLngLat().lat]}var Bn=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_ratio:new e.Uniform1f(ye,W.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(ye,W.u_units_to_pixels)}},An=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_ratio:new e.Uniform1f(ye,W.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(ye,W.u_units_to_pixels),u_image:new e.Uniform1i(ye,W.u_image),u_image_height:new e.Uniform1f(ye,W.u_image_height)}},Ki=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_ratio:new e.Uniform1f(ye,W.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_image:new e.Uniform1i(ye,W.u_image),u_units_to_pixels:new e.Uniform2f(ye,W.u_units_to_pixels),u_scale:new e.Uniform3f(ye,W.u_scale),u_fade:new e.Uniform1f(ye,W.u_fade)}},ko=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_ratio:new e.Uniform1f(ye,W.u_ratio),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(ye,W.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(ye,W.u_patternscale_a),u_patternscale_b:new e.Uniform2f(ye,W.u_patternscale_b),u_sdfgamma:new e.Uniform1f(ye,W.u_sdfgamma),u_image:new e.Uniform1i(ye,W.u_image),u_tex_y_a:new e.Uniform1f(ye,W.u_tex_y_a),u_tex_y_b:new e.Uniform1f(ye,W.u_tex_y_b),u_mix:new e.Uniform1f(ye,W.u_mix)}},$o=function(ye,W,de){var te=ye.transform;return{u_matrix:il(ye,W,de),u_ratio:1/xi(W,1,te.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/te.pixelsToGLUnits[0],1/te.pixelsToGLUnits[1]]}},Ls=function(ye,W,de,te){return e.extend($o(ye,W,de),{u_image:0,u_image_height:te})},os=function(ye,W,de,te){var me=ye.transform,Ue=jo(W,me);return{u_matrix:il(ye,W,de),u_texsize:W.imageAtlasTexture.size,u_ratio:1/xi(W,1,me.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[Ue,te.fromScale,te.toScale],u_fade:te.t,u_units_to_pixels:[1/me.pixelsToGLUnits[0],1/me.pixelsToGLUnits[1]]}},As=function(ye,W,de,te,me){var Ue=ye.transform,tt=ye.lineAtlas,ft=jo(W,Ue),st=de.layout.get("line-cap")==="round",bt=tt.getDash(te.from,st),It=tt.getDash(te.to,st),Jt=bt.width*me.fromScale,Kt=It.width*me.toScale;return e.extend($o(ye,W,de),{u_patternscale_a:[ft/Jt,-bt.height/2],u_patternscale_b:[ft/Kt,-It.height/2],u_sdfgamma:tt.width/(Math.min(Jt,Kt)*256*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:bt.y,u_tex_y_b:It.y,u_mix:me.t})};function jo(ye,W){return 1/xi(ye,1,W.tileZoom)}function il(ye,W,de){return ye.translatePosMatrix(W.tileID.posMatrix,W,de.paint.get("line-translate"),de.paint.get("line-translate-anchor"))}var Qs=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_tl_parent:new e.Uniform2f(ye,W.u_tl_parent),u_scale_parent:new e.Uniform1f(ye,W.u_scale_parent),u_buffer_scale:new e.Uniform1f(ye,W.u_buffer_scale),u_fade_t:new e.Uniform1f(ye,W.u_fade_t),u_opacity:new e.Uniform1f(ye,W.u_opacity),u_image0:new e.Uniform1i(ye,W.u_image0),u_image1:new e.Uniform1i(ye,W.u_image1),u_brightness_low:new e.Uniform1f(ye,W.u_brightness_low),u_brightness_high:new e.Uniform1f(ye,W.u_brightness_high),u_saturation_factor:new e.Uniform1f(ye,W.u_saturation_factor),u_contrast_factor:new e.Uniform1f(ye,W.u_contrast_factor),u_spin_weights:new e.Uniform3f(ye,W.u_spin_weights)}},Ss=function(ye,W,de,te,me){return{u_matrix:ye,u_tl_parent:W,u_scale_parent:de,u_buffer_scale:1,u_fade_t:te.mix,u_opacity:te.opacity*me.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:me.paint.get("raster-brightness-min"),u_brightness_high:me.paint.get("raster-brightness-max"),u_saturation_factor:gs(me.paint.get("raster-saturation")),u_contrast_factor:ao(me.paint.get("raster-contrast")),u_spin_weights:fi(me.paint.get("raster-hue-rotate"))}};function fi(ye){ye*=Math.PI/180;var W=Math.sin(ye),de=Math.cos(ye);return[(2*de+1)/3,(-Math.sqrt(3)*W-de+1)/3,(Math.sqrt(3)*W-de+1)/3]}function ao(ye){return ye>0?1/(1-ye):1+ye}function gs(ye){return ye>0?1-1/(1.001-ye):-ye}var Jo=function(ye,W){return{u_is_size_zoom_constant:new e.Uniform1i(ye,W.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(ye,W.u_is_size_feature_constant),u_size_t:new e.Uniform1f(ye,W.u_size_t),u_size:new e.Uniform1f(ye,W.u_size),u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_pitch:new e.Uniform1f(ye,W.u_pitch),u_rotate_symbol:new e.Uniform1i(ye,W.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(ye,W.u_aspect_ratio),u_fade_change:new e.Uniform1f(ye,W.u_fade_change),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(ye,W.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(ye,W.u_coord_matrix),u_is_text:new e.Uniform1i(ye,W.u_is_text),u_pitch_with_map:new e.Uniform1i(ye,W.u_pitch_with_map),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_texture:new e.Uniform1i(ye,W.u_texture)}},Bl=function(ye,W){return{u_is_size_zoom_constant:new e.Uniform1i(ye,W.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(ye,W.u_is_size_feature_constant),u_size_t:new e.Uniform1f(ye,W.u_size_t),u_size:new e.Uniform1f(ye,W.u_size),u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_pitch:new e.Uniform1f(ye,W.u_pitch),u_rotate_symbol:new e.Uniform1i(ye,W.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(ye,W.u_aspect_ratio),u_fade_change:new e.Uniform1f(ye,W.u_fade_change),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(ye,W.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(ye,W.u_coord_matrix),u_is_text:new e.Uniform1i(ye,W.u_is_text),u_pitch_with_map:new e.Uniform1i(ye,W.u_pitch_with_map),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_texture:new e.Uniform1i(ye,W.u_texture),u_gamma_scale:new e.Uniform1f(ye,W.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(ye,W.u_is_halo)}},jl=function(ye,W){return{u_is_size_zoom_constant:new e.Uniform1i(ye,W.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(ye,W.u_is_size_feature_constant),u_size_t:new e.Uniform1f(ye,W.u_size_t),u_size:new e.Uniform1f(ye,W.u_size),u_camera_to_center_distance:new e.Uniform1f(ye,W.u_camera_to_center_distance),u_pitch:new e.Uniform1f(ye,W.u_pitch),u_rotate_symbol:new e.Uniform1i(ye,W.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(ye,W.u_aspect_ratio),u_fade_change:new e.Uniform1f(ye,W.u_fade_change),u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(ye,W.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(ye,W.u_coord_matrix),u_is_text:new e.Uniform1i(ye,W.u_is_text),u_pitch_with_map:new e.Uniform1i(ye,W.u_pitch_with_map),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_texsize_icon:new e.Uniform2f(ye,W.u_texsize_icon),u_texture:new e.Uniform1i(ye,W.u_texture),u_texture_icon:new e.Uniform1i(ye,W.u_texture_icon),u_gamma_scale:new e.Uniform1f(ye,W.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(ye,W.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(ye,W.u_is_halo)}},Vl=function(ye,W,de,te,me,Ue,tt,ft,st,bt){var It=me.transform;return{u_is_size_zoom_constant:+(ye==="constant"||ye==="source"),u_is_size_feature_constant:+(ye==="constant"||ye==="camera"),u_size_t:W?W.uSizeT:0,u_size:W?W.uSize:0,u_camera_to_center_distance:It.cameraToCenterDistance,u_pitch:It.pitch/360*2*Math.PI,u_rotate_symbol:+de,u_aspect_ratio:It.width/It.height,u_fade_change:me.options.fadeDuration?me.symbolFadeChange:1,u_matrix:Ue,u_label_plane_matrix:tt,u_coord_matrix:ft,u_is_text:+st,u_pitch_with_map:+te,u_texsize:bt,u_texture:0}},cc=function(ye,W,de,te,me,Ue,tt,ft,st,bt,It){var Jt=me.transform;return e.extend(Vl(ye,W,de,te,me,Ue,tt,ft,st,bt),{u_gamma_scale:te?Math.cos(Jt._pitch)*Jt.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+It})},ql=function(ye,W,de,te,me,Ue,tt,ft,st,bt){return e.extend(cc(ye,W,de,te,me,Ue,tt,ft,!0,st,!0),{u_texsize_icon:bt,u_texture_icon:1})},Vu=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_opacity:new e.Uniform1f(ye,W.u_opacity),u_color:new e.UniformColor(ye,W.u_color)}},ol=function(ye,W){return{u_matrix:new e.UniformMatrix4f(ye,W.u_matrix),u_opacity:new e.Uniform1f(ye,W.u_opacity),u_image:new e.Uniform1i(ye,W.u_image),u_pattern_tl_a:new e.Uniform2f(ye,W.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(ye,W.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(ye,W.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(ye,W.u_pattern_br_b),u_texsize:new e.Uniform2f(ye,W.u_texsize),u_mix:new e.Uniform1f(ye,W.u_mix),u_pattern_size_a:new e.Uniform2f(ye,W.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(ye,W.u_pattern_size_b),u_scale_a:new e.Uniform1f(ye,W.u_scale_a),u_scale_b:new e.Uniform1f(ye,W.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(ye,W.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(ye,W.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(ye,W.u_tile_units_to_pixels)}},rc=function(ye,W,de){return{u_matrix:ye,u_opacity:W,u_color:de}},Vi=function(ye,W,de,te,me,Ue){return e.extend(bc(te,Ue,de,me),{u_matrix:ye,u_opacity:W})},eo={fillExtrusion:Lf,fillExtrusionPattern:xl,fill:Ru,fillPattern:Au,fillOutline:Zs,fillOutlinePattern:Ol,circle:Ht,collisionBox:qr,collisionCircle:Or,debug:ja,clippingMask:gn,heatmap:Ja,heatmapTexture:_n,hillshade:On,hillshadePrepare:zi,line:Bn,lineGradient:An,linePattern:Ki,lineSDF:ko,raster:Qs,symbolIcon:Jo,symbolSDF:Bl,symbolTextAndIcon:jl,background:Vu,backgroundPattern:ol},qu;function Du(ye,W,de,te,me,Ue,tt){for(var ft=ye.context,st=ft.gl,bt=ye.useProgram("collisionBox"),It=[],Jt=0,Kt=0,vr=0;vr0){var ha=e.create(),Ea=pr;e.mul(ha,tr.placementInvProjMatrix,ye.transform.glCoordMatrix),e.mul(ha,ha,tr.placementViewportMatrix),It.push({circleArray:ea,circleOffset:Kt,transform:Ea,invTransform:ha}),Jt+=ea.length/4,Kt=Jt}xr&&bt.draw(ft,st.LINES,wa.disabled,va.disabled,ye.colorModeForRenderPass(),gr.disabled,ua(pr,ye.transform,wr),de.id,xr.layoutVertexBuffer,xr.indexBuffer,xr.segments,null,ye.transform.zoom,null,null,xr.collisionVertexBuffer)}}if(!(!tt||!It.length)){var tn=ye.useProgram("collisionCircle"),Xa=new e.StructArrayLayout2f1f2i16;Xa.resize(Jt*4),Xa._trim();for(var Ya=0,an=0,hn=It;an=0&&(Tr[tr.associatedIconIndex]={shiftedAnchor:En,angle:Yn})}}if(It){vr.clear();for(var ai=ye.icon.placedSymbolArray,Io=0;Io0){var tt=e.browser.now(),ft=(tt-ye.timeAdded)/Ue,st=W?(tt-W.timeAdded)/Ue:-1,bt=de.getSource(),It=me.coveringZoomLevel({tileSize:bt.tileSize,roundZoom:bt.roundZoom}),Jt=!W||Math.abs(W.tileID.overscaledZ-It)>Math.abs(ye.tileID.overscaledZ-It),Kt=Jt&&ye.refreshedUponExpiration?1:e.clamp(Jt?ft:1-st,0,1);return ye.refreshedUponExpiration&&ft>=1&&(ye.refreshedUponExpiration=!1),W?{opacity:1,mix:1-Kt}:{opacity:Kt,mix:0}}else return{opacity:1,mix:0}}function sr(ye,W,de){var te=de.paint.get("background-color"),me=de.paint.get("background-opacity");if(me!==0){var Ue=ye.context,tt=Ue.gl,ft=ye.transform,st=ft.tileSize,bt=de.paint.get("background-pattern");if(!ye.isPatternMissing(bt)){var It=!bt&&te.a===1&&me===1&&ye.opaquePassEnabledForLayer()?"opaque":"translucent";if(ye.renderPass===It){var Jt=va.disabled,Kt=ye.depthModeForSublayer(0,It==="opaque"?wa.ReadWrite:wa.ReadOnly),vr=ye.colorModeForRenderPass(),Tr=ye.useProgram(bt?"backgroundPattern":"background"),wr=ft.coveringTiles({tileSize:st});bt&&(Ue.activeTexture.set(tt.TEXTURE0),ye.imageManager.bind(ye.context));for(var tr=de.getCrossfadeParameters(),pr=0,xr=wr;pr "+de.overscaledZ);var pr=tr+" "+vr+"kb";Gi(ye,pr),tt.draw(te,me.TRIANGLES,ft,st,Lt.alphaBlended,gr.disabled,sn(Ue,e.Color.transparent,wr),It,ye.debugBuffer,ye.quadTriangleIndexBuffer,ye.debugSegments)}function Gi(ye,W){ye.initDebugOverlayCanvas();var de=ye.debugOverlayCanvas,te=ye.context.gl,me=ye.debugOverlayCanvas.getContext("2d");me.clearRect(0,0,de.width,de.height),me.shadowColor="white",me.shadowBlur=2,me.lineWidth=1.5,me.strokeStyle="white",me.textBaseline="top",me.font="bold 36px Open Sans, sans-serif",me.fillText(W,5,5),me.strokeText(W,5,5),ye.debugOverlayTexture.update(de),ye.debugOverlayTexture.bind(te.LINEAR,te.CLAMP_TO_EDGE)}function Bo(ye,W,de){var te=ye.context,me=de.implementation;if(ye.renderPass==="offscreen"){var Ue=me.prerender;Ue&&(ye.setCustomLayerDefaults(),te.setColorMode(ye.colorModeForRenderPass()),Ue.call(me,te.gl,ye.transform.customLayerMatrix()),te.setDirty(),ye.setBaseState())}else if(ye.renderPass==="translucent"){ye.setCustomLayerDefaults(),te.setColorMode(ye.colorModeForRenderPass()),te.setStencilMode(va.disabled);var tt=me.renderingMode==="3d"?new wa(ye.context.gl.LEQUAL,wa.ReadWrite,ye.depthRangeFor3D):ye.depthModeForSublayer(0,wa.ReadOnly);te.setDepthMode(tt),me.render(te.gl,ye.transform.customLayerMatrix()),te.setDirty(),ye.setBaseState(),te.bindFramebuffer.set(null)}}var No={symbol:I,circle:Ct,heatmap:Wt,line:Wr,fill:je,"fill-extrusion":at,hillshade:Tt,raster:Yt,background:sr,debug:pi,custom:Bo},po=function(W,de){this.context=new Br(W),this.transform=de,this._tileTextures={},this.setup(),this.numSublayers=na.maxUnderzooming+na.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new $l,this.gpuTimers={}};po.prototype.resize=function(W,de){if(this.width=W*e.browser.devicePixelRatio,this.height=de*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var te=0,me=this.style._order;te256&&this.clearStencil(),te.setColorMode(Lt.disabled),te.setDepthMode(wa.disabled);var Ue=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var tt=0,ft=de;tt256&&this.clearStencil();var W=this.nextStencilID++,de=this.context.gl;return new va({func:de.NOTEQUAL,mask:255},W,255,de.KEEP,de.KEEP,de.REPLACE)},po.prototype.stencilModeForClipping=function(W){var de=this.context.gl;return new va({func:de.EQUAL,mask:255},this._tileClippingMaskIDs[W.key],0,de.KEEP,de.KEEP,de.REPLACE)},po.prototype.stencilConfigForOverlap=function(W){var de,te=this.context.gl,me=W.sort(function(bt,It){return It.overscaledZ-bt.overscaledZ}),Ue=me[me.length-1].overscaledZ,tt=me[0].overscaledZ-Ue+1;if(tt>1){this.currentStencilSource=void 0,this.nextStencilID+tt>256&&this.clearStencil();for(var ft={},st=0;st=0;this.currentLayer--){var ha=this.style._layers[me[this.currentLayer]],Ea=Ue[ha.source],tn=st[ha.source];this._renderTileClippingMasks(ha,tn),this.renderLayer(this,Ea,ha,tn)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?de.pop():null},po.prototype.isPatternMissing=function(W){if(!W)return!1;if(!W.from||!W.to)return!0;var de=this.imageManager.getPattern(W.from.toString()),te=this.imageManager.getPattern(W.to.toString());return!de||!te},po.prototype.useProgram=function(W,de){this.cache=this.cache||{};var te=""+W+(de?de.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[te]||(this.cache[te]=new xc(this.context,W,_c[W],de,eo[W],this._showOverdrawInspector)),this.cache[te]},po.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()},po.prototype.setBaseState=function(){var W=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(W.FUNC_ADD)},po.prototype.initDebugOverlayCanvas=function(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var W=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,W.RGBA)}},po.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var Zo=function(W,de){this.points=W,this.planes=de};Zo.fromInvProjectionMatrix=function(W,de,te){var me=[[-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]],Ue=Math.pow(2,te),tt=me.map(function(bt){return e.transformMat4([],bt,W)}).map(function(bt){return e.scale$1([],bt,1/bt[3]/de*Ue)}),ft=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],st=ft.map(function(bt){var It=e.sub([],tt[bt[0]],tt[bt[1]]),Jt=e.sub([],tt[bt[2]],tt[bt[1]]),Kt=e.normalize([],e.cross([],It,Jt)),vr=-e.dot(Kt,tt[bt[1]]);return Kt.concat(vr)});return new Zo(tt,st)};var Hs=function(W,de){this.min=W,this.max=de,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};Hs.prototype.quadrant=function(W){for(var de=[W%2===0,W<2],te=e.clone$2(this.min),me=e.clone$2(this.max),Ue=0;Ue=0;if(tt===0)return 0;tt!==de.length&&(te=!1)}if(te)return 2;for(var st=0;st<3;st++){for(var bt=Number.MAX_VALUE,It=-Number.MAX_VALUE,Jt=0;Jtthis.max[st]-this.min[st])return 0}return 1};var zs=function(W,de,te,me){if(W===void 0&&(W=0),de===void 0&&(de=0),te===void 0&&(te=0),me===void 0&&(me=0),isNaN(W)||W<0||isNaN(de)||de<0||isNaN(te)||te<0||isNaN(me)||me<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=W,this.bottom=de,this.left=te,this.right=me};zs.prototype.interpolate=function(W,de,te){return de.top!=null&&W.top!=null&&(this.top=e.number(W.top,de.top,te)),de.bottom!=null&&W.bottom!=null&&(this.bottom=e.number(W.bottom,de.bottom,te)),de.left!=null&&W.left!=null&&(this.left=e.number(W.left,de.left,te)),de.right!=null&&W.right!=null&&(this.right=e.number(W.right,de.right,te)),this},zs.prototype.getCenter=function(W,de){var te=e.clamp((this.left+W-this.right)/2,0,W),me=e.clamp((this.top+de-this.bottom)/2,0,de);return new e.Point(te,me)},zs.prototype.equals=function(W){return this.top===W.top&&this.bottom===W.bottom&&this.left===W.left&&this.right===W.right},zs.prototype.clone=function(){return new zs(this.top,this.bottom,this.left,this.right)},zs.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var xo=function(W,de,te,me,Ue){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=Ue===void 0?!0:Ue,this._minZoom=W||0,this._maxZoom=de||22,this._minPitch=te??0,this._maxPitch=me??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new zs,this._posMatrixCache={},this._alignedPosMatrixCache={}},bo={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}};xo.prototype.clone=function(){var W=new xo(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return W.tileSize=this.tileSize,W.latRange=this.latRange,W.width=this.width,W.height=this.height,W._center=this._center,W.zoom=this.zoom,W.angle=this.angle,W._fov=this._fov,W._pitch=this._pitch,W._unmodified=this._unmodified,W._edgeInsets=this._edgeInsets.clone(),W._calcMatrices(),W},bo.minZoom.get=function(){return this._minZoom},bo.minZoom.set=function(ye){this._minZoom!==ye&&(this._minZoom=ye,this.zoom=Math.max(this.zoom,ye))},bo.maxZoom.get=function(){return this._maxZoom},bo.maxZoom.set=function(ye){this._maxZoom!==ye&&(this._maxZoom=ye,this.zoom=Math.min(this.zoom,ye))},bo.minPitch.get=function(){return this._minPitch},bo.minPitch.set=function(ye){this._minPitch!==ye&&(this._minPitch=ye,this.pitch=Math.max(this.pitch,ye))},bo.maxPitch.get=function(){return this._maxPitch},bo.maxPitch.set=function(ye){this._maxPitch!==ye&&(this._maxPitch=ye,this.pitch=Math.min(this.pitch,ye))},bo.renderWorldCopies.get=function(){return this._renderWorldCopies},bo.renderWorldCopies.set=function(ye){ye===void 0?ye=!0:ye===null&&(ye=!1),this._renderWorldCopies=ye},bo.worldSize.get=function(){return this.tileSize*this.scale},bo.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},bo.size.get=function(){return new e.Point(this.width,this.height)},bo.bearing.get=function(){return-this.angle/Math.PI*180},bo.bearing.set=function(ye){var W=-e.wrap(ye,-180,180)*Math.PI/180;this.angle!==W&&(this._unmodified=!1,this.angle=W,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},bo.pitch.get=function(){return this._pitch/Math.PI*180},bo.pitch.set=function(ye){var W=e.clamp(ye,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==W&&(this._unmodified=!1,this._pitch=W,this._calcMatrices())},bo.fov.get=function(){return this._fov/Math.PI*180},bo.fov.set=function(ye){ye=Math.max(.01,Math.min(60,ye)),this._fov!==ye&&(this._unmodified=!1,this._fov=ye/180*Math.PI,this._calcMatrices())},bo.zoom.get=function(){return this._zoom},bo.zoom.set=function(ye){var W=Math.min(Math.max(ye,this.minZoom),this.maxZoom);this._zoom!==W&&(this._unmodified=!1,this._zoom=W,this.scale=this.zoomScale(W),this.tileZoom=Math.floor(W),this.zoomFraction=W-this.tileZoom,this._constrain(),this._calcMatrices())},bo.center.get=function(){return this._center},bo.center.set=function(ye){ye.lat===this._center.lat&&ye.lng===this._center.lng||(this._unmodified=!1,this._center=ye,this._constrain(),this._calcMatrices())},bo.padding.get=function(){return this._edgeInsets.toJSON()},bo.padding.set=function(ye){this._edgeInsets.equals(ye)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,ye,1),this._calcMatrices())},bo.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},xo.prototype.isPaddingEqual=function(W){return this._edgeInsets.equals(W)},xo.prototype.interpolatePadding=function(W,de,te){this._unmodified=!1,this._edgeInsets.interpolate(W,de,te),this._constrain(),this._calcMatrices()},xo.prototype.coveringZoomLevel=function(W){var de=(W.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/W.tileSize));return Math.max(0,de)},xo.prototype.getVisibleUnwrappedCoordinates=function(W){var de=[new e.UnwrappedTileID(0,W)];if(this._renderWorldCopies)for(var te=this.pointCoordinate(new e.Point(0,0)),me=this.pointCoordinate(new e.Point(this.width,0)),Ue=this.pointCoordinate(new e.Point(this.width,this.height)),tt=this.pointCoordinate(new e.Point(0,this.height)),ft=Math.floor(Math.min(te.x,me.x,Ue.x,tt.x)),st=Math.floor(Math.max(te.x,me.x,Ue.x,tt.x)),bt=1,It=ft-bt;It<=st+bt;It++)It!==0&&de.push(new e.UnwrappedTileID(It,W));return de},xo.prototype.coveringTiles=function(W){var de=this.coveringZoomLevel(W),te=de;if(W.minzoom!==void 0&&deW.maxzoom&&(de=W.maxzoom);var me=e.MercatorCoordinate.fromLngLat(this.center),Ue=Math.pow(2,de),tt=[Ue*me.x,Ue*me.y,0],ft=Zo.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,de),st=W.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(st=de);var bt=3,It=function(fn){return{aabb:new Hs([fn*Ue,0,0],[(fn+1)*Ue,Ue,0]),zoom:0,x:0,y:0,wrap:fn,fullyVisible:!1}},Jt=[],Kt=[],vr=de,Tr=W.reparseOverscaled?te:de;if(this._renderWorldCopies)for(var wr=1;wr<=3;wr++)Jt.push(It(-wr)),Jt.push(It(wr));for(Jt.push(It(0));Jt.length>0;){var tr=Jt.pop(),pr=tr.x,xr=tr.y,ea=tr.fullyVisible;if(!ea){var ha=tr.aabb.intersects(ft);if(ha===0)continue;ea=ha===2}var Ea=tr.aabb.distanceX(tt),tn=tr.aabb.distanceY(tt),Xa=Math.max(Math.abs(Ea),Math.abs(tn)),Ya=bt+(1<Ya&&tr.zoom>=st){Kt.push({tileID:new e.OverscaledTileID(tr.zoom===vr?Tr:tr.zoom,tr.wrap,tr.zoom,pr,xr),distanceSq:e.sqrLen([tt[0]-.5-pr,tt[1]-.5-xr])});continue}for(var an=0;an<4;an++){var hn=(pr<<1)+an%2,xn=(xr<<1)+(an>>1);Jt.push({aabb:tr.aabb.quadrant(an),zoom:tr.zoom+1,x:hn,y:xn,wrap:tr.wrap,fullyVisible:ea})}}return Kt.sort(function(fn,En){return fn.distanceSq-En.distanceSq}).map(function(fn){return fn.tileID})},xo.prototype.resize=function(W,de){this.width=W,this.height=de,this.pixelsToGLUnits=[2/W,-2/de],this._constrain(),this._calcMatrices()},bo.unmodified.get=function(){return this._unmodified},xo.prototype.zoomScale=function(W){return Math.pow(2,W)},xo.prototype.scaleZoom=function(W){return Math.log(W)/Math.LN2},xo.prototype.project=function(W){var de=e.clamp(W.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(W.lng)*this.worldSize,e.mercatorYfromLat(de)*this.worldSize)},xo.prototype.unproject=function(W){return new e.MercatorCoordinate(W.x/this.worldSize,W.y/this.worldSize).toLngLat()},bo.point.get=function(){return this.project(this.center)},xo.prototype.setLocationAtPoint=function(W,de){var te=this.pointCoordinate(de),me=this.pointCoordinate(this.centerPoint),Ue=this.locationCoordinate(W),tt=new e.MercatorCoordinate(Ue.x-(te.x-me.x),Ue.y-(te.y-me.y));this.center=this.coordinateLocation(tt),this._renderWorldCopies&&(this.center=this.center.wrap())},xo.prototype.locationPoint=function(W){return this.coordinatePoint(this.locationCoordinate(W))},xo.prototype.pointLocation=function(W){return this.coordinateLocation(this.pointCoordinate(W))},xo.prototype.locationCoordinate=function(W){return e.MercatorCoordinate.fromLngLat(W)},xo.prototype.coordinateLocation=function(W){return W.toLngLat()},xo.prototype.pointCoordinate=function(W){var de=0,te=[W.x,W.y,0,1],me=[W.x,W.y,1,1];e.transformMat4(te,te,this.pixelMatrixInverse),e.transformMat4(me,me,this.pixelMatrixInverse);var Ue=te[3],tt=me[3],ft=te[0]/Ue,st=me[0]/tt,bt=te[1]/Ue,It=me[1]/tt,Jt=te[2]/Ue,Kt=me[2]/tt,vr=Jt===Kt?0:(de-Jt)/(Kt-Jt);return new e.MercatorCoordinate(e.number(ft,st,vr)/this.worldSize,e.number(bt,It,vr)/this.worldSize)},xo.prototype.coordinatePoint=function(W){var de=[W.x*this.worldSize,W.y*this.worldSize,0,1];return e.transformMat4(de,de,this.pixelMatrix),new e.Point(de[0]/de[3],de[1]/de[3])},xo.prototype.getBounds=function(){return new e.LngLatBounds().extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},xo.prototype.getMaxBounds=function(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])},xo.prototype.setMaxBounds=function(W){W?(this.lngRange=[W.getWest(),W.getEast()],this.latRange=[W.getSouth(),W.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},xo.prototype.calculatePosMatrix=function(W,de){de===void 0&&(de=!1);var te=W.key,me=de?this._alignedPosMatrixCache:this._posMatrixCache;if(me[te])return me[te];var Ue=W.canonical,tt=this.worldSize/this.zoomScale(Ue.z),ft=Ue.x+Math.pow(2,Ue.z)*W.wrap,st=e.identity(new Float64Array(16));return e.translate(st,st,[ft*tt,Ue.y*tt,0]),e.scale(st,st,[tt/e.EXTENT,tt/e.EXTENT,1]),e.multiply(st,de?this.alignedProjMatrix:this.projMatrix,st),me[te]=new Float32Array(st),me[te]},xo.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},xo.prototype._constrain=function(){if(!(!this.center||!this.width||!this.height||this._constraining)){this._constraining=!0;var W=-90,de=90,te=-180,me=180,Ue,tt,ft,st,bt=this.size,It=this._unmodified;if(this.latRange){var Jt=this.latRange;W=e.mercatorYfromLat(Jt[1])*this.worldSize,de=e.mercatorYfromLat(Jt[0])*this.worldSize,Ue=de-Wde&&(st=de-tr)}if(this.lngRange){var pr=vr.x,xr=bt.x/2;pr-xrme&&(ft=me-xr)}(ft!==void 0||st!==void 0)&&(this.center=this.unproject(new e.Point(ft!==void 0?ft:vr.x,st!==void 0?st:vr.y))),this._unmodified=It,this._constraining=!1}},xo.prototype._calcMatrices=function(){if(this.height){var W=this._fov/2,de=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(W)*this.height;var te=Math.PI/2+this._pitch,me=this._fov*(.5+de.y/this.height),Ue=Math.sin(me)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-te-me,.01,Math.PI-.01)),tt=this.point,ft=tt.x,st=tt.y,bt=Math.cos(Math.PI/2-this._pitch)*Ue+this.cameraToCenterDistance,It=bt*1.01,Jt=this.height/50,Kt=new Float64Array(16);e.perspective(Kt,this._fov,this.width/this.height,Jt,It),Kt[8]=-de.x*2/this.width,Kt[9]=de.y*2/this.height,e.scale(Kt,Kt,[1,-1,1]),e.translate(Kt,Kt,[0,0,-this.cameraToCenterDistance]),e.rotateX(Kt,Kt,this._pitch),e.rotateZ(Kt,Kt,this.angle),e.translate(Kt,Kt,[-ft,-st,0]),this.mercatorMatrix=e.scale([],Kt,[this.worldSize,this.worldSize,this.worldSize]),e.scale(Kt,Kt,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=Kt,this.invProjMatrix=e.invert([],this.projMatrix);var vr=this.width%2/2,Tr=this.height%2/2,wr=Math.cos(this.angle),tr=Math.sin(this.angle),pr=ft-Math.round(ft)+wr*vr+tr*Tr,xr=st-Math.round(st)+wr*Tr+tr*vr,ea=new Float64Array(Kt);if(e.translate(ea,ea,[pr>.5?pr-1:pr,xr>.5?xr-1:xr,0]),this.alignedProjMatrix=ea,Kt=e.create(),e.scale(Kt,Kt,[this.width/2,-this.height/2,1]),e.translate(Kt,Kt,[1,-1,0]),this.labelPlaneMatrix=Kt,Kt=e.create(),e.scale(Kt,Kt,[1,-1,1]),e.translate(Kt,Kt,[-1,-1,0]),e.scale(Kt,Kt,[2/this.width,2/this.height,1]),this.glCoordMatrix=Kt,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),Kt=e.invert(new Float64Array(16),this.pixelMatrix),!Kt)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Kt,this._posMatrixCache={},this._alignedPosMatrixCache={}}},xo.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var W=this.pointCoordinate(new e.Point(0,0)),de=[W.x*this.worldSize,W.y*this.worldSize,0,1],te=e.transformMat4(de,de,this.pixelMatrix);return te[3]/this.cameraToCenterDistance},xo.prototype.getCameraPoint=function(){var W=this._pitch,de=Math.tan(W)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,de))},xo.prototype.getCameraQueryGeometry=function(W){var de=this.getCameraPoint();if(W.length===1)return[W[0],de];for(var te=de.x,me=de.y,Ue=de.x,tt=de.y,ft=0,st=W;ft=3&&!W.some(function(te){return isNaN(te)})){var de=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(W[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+W[2],+W[1]],zoom:+W[0],bearing:de,pitch:+(W[4]||0)}),!0}return!1},Al.prototype._updateHashUnthrottled=function(){var W=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,W)}catch{}};var pu={linearity:.3,easing:e.bezier(0,0,.3,1)},pe=e.extend({deceleration:2500,maxSpeed:1400},pu),Le=e.extend({deceleration:20,maxSpeed:1400},pu),Ye=e.extend({deceleration:1e3,maxSpeed:360},pu),ut=e.extend({deceleration:1e3,maxSpeed:90},pu),ht=function(W){this._map=W,this.clear()};ht.prototype.clear=function(){this._inertiaBuffer=[]},ht.prototype.record=function(W){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:W})},ht.prototype._drainInertiaBuffer=function(){for(var W=this._inertiaBuffer,de=e.browser.now(),te=160;W.length>0&&de-W[0].time>te;)W.shift()},ht.prototype._onMoveEnd=function(W){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var de={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},te=0,me=this._inertiaBuffer;te=this._clickTolerance||this._map.fire(new Dt(W.type,this._map,W))},Ar.prototype.dblclick=function(W){return this._firePreventable(new Dt(W.type,this._map,W))},Ar.prototype.mouseover=function(W){this._map.fire(new Dt(W.type,this._map,W))},Ar.prototype.mouseout=function(W){this._map.fire(new Dt(W.type,this._map,W))},Ar.prototype.touchstart=function(W){return this._firePreventable(new $t(W.type,this._map,W))},Ar.prototype.touchmove=function(W){this._map.fire(new $t(W.type,this._map,W))},Ar.prototype.touchend=function(W){this._map.fire(new $t(W.type,this._map,W))},Ar.prototype.touchcancel=function(W){this._map.fire(new $t(W.type,this._map,W))},Ar.prototype._firePreventable=function(W){if(this._map.fire(W),W.defaultPrevented)return{}},Ar.prototype.isEnabled=function(){return!0},Ar.prototype.isActive=function(){return!1},Ar.prototype.enable=function(){},Ar.prototype.disable=function(){};var Vr=function(W){this._map=W};Vr.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Vr.prototype.mousemove=function(W){this._map.fire(new Dt(W.type,this._map,W))},Vr.prototype.mousedown=function(){this._delayContextMenu=!0},Vr.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Dt("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Vr.prototype.contextmenu=function(W){this._delayContextMenu?this._contextMenuEvent=W:this._map.fire(new Dt(W.type,this._map,W)),this._map.listens("contextmenu")&&W.preventDefault()},Vr.prototype.isEnabled=function(){return!0},Vr.prototype.isActive=function(){return!1},Vr.prototype.enable=function(){},Vr.prototype.disable=function(){};var Kr=function(W,de){this._map=W,this._el=W.getCanvasContainer(),this._container=W.getContainer(),this._clickTolerance=de.clickTolerance||1};Kr.prototype.isEnabled=function(){return!!this._enabled},Kr.prototype.isActive=function(){return!!this._active},Kr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Kr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Kr.prototype.mousedown=function(W,de){this.isEnabled()&&W.shiftKey&&W.button===0&&(r.disableDrag(),this._startPos=this._lastPos=de,this._active=!0)},Kr.prototype.mousemoveWindow=function(W,de){if(this._active){var te=de;if(!(this._lastPos.equals(te)||!this._box&&te.dist(this._startPos)this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=W.timeStamp),te.length===this.numTouches&&(this.centroid=Ua(de),this.touches=aa(te,de)))},Ba.prototype.touchmove=function(W,de,te){if(!(this.aborted||!this.centroid)){var me=aa(te,de);for(var Ue in this.touches){var tt=this.touches[Ue],ft=me[Ue];(!ft||ft.dist(tt)>ka)&&(this.aborted=!0)}}},Ba.prototype.touchend=function(W,de,te){if((!this.centroid||W.timeStamp-this.startTime>Ta)&&(this.aborted=!0),te.length===0){var me=!this.aborted&&this.centroid;if(this.reset(),me)return me}};var Va=function(W){this.singleTap=new Ba(W),this.numTaps=W.numTaps,this.reset()};Va.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Va.prototype.touchstart=function(W,de,te){this.singleTap.touchstart(W,de,te)},Va.prototype.touchmove=function(W,de,te){this.singleTap.touchmove(W,de,te)},Va.prototype.touchend=function(W,de,te){var me=this.singleTap.touchend(W,de,te);if(me){var Ue=W.timeStamp-this.lastTime0&&(this._active=!0);var me=aa(te,de),Ue=new e.Point(0,0),tt=new e.Point(0,0),ft=0;for(var st in me){var bt=me[st],It=this._touches[st];It&&(Ue._add(bt),tt._add(bt.sub(It)),ft++,me[st]=bt)}if(this._touches=me,!(ftMath.abs(ye.x)}var Qo=100,_s=function(ye){function W(){ye.apply(this,arguments)}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.reset=function(){ye.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},W.prototype._start=function(te){this._lastPoints=te,Hl(te[0].sub(te[1]))&&(this._valid=!1)},W.prototype._move=function(te,me,Ue){var tt=te[0].sub(this._lastPoints[0]),ft=te[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(tt,ft,Ue.timeStamp),!!this._valid){this._lastPoints=te,this._active=!0;var st=(tt.y+ft.y)/2,bt=-.5;return{pitchDelta:st*bt}}},W.prototype.gestureBeginsVertically=function(te,me,Ue){if(this._valid!==void 0)return this._valid;var tt=2,ft=te.mag()>=tt,st=me.mag()>=tt;if(!(!ft&&!st)){if(!ft||!st)return this._firstMove===void 0&&(this._firstMove=Ue),Ue-this._firstMove0==me.y>0;return Hl(te)&&Hl(me)&&bt}},W}(Vo),gu={panStep:100,bearingStep:15,pitchStep:10},el=function(){var W=gu;this._panStep=W.panStep,this._bearingStep=W.bearingStep,this._pitchStep=W.pitchStep,this._rotationDisabled=!1};el.prototype.reset=function(){this._active=!1},el.prototype.keydown=function(W){var de=this;if(!(W.altKey||W.ctrlKey||W.metaKey)){var te=0,me=0,Ue=0,tt=0,ft=0;switch(W.keyCode){case 61:case 107:case 171:case 187:te=1;break;case 189:case 109:case 173:te=-1;break;case 37:W.shiftKey?me=-1:(W.preventDefault(),tt=-1);break;case 39:W.shiftKey?me=1:(W.preventDefault(),tt=1);break;case 38:W.shiftKey?Ue=1:(W.preventDefault(),ft=-1);break;case 40:W.shiftKey?Ue=-1:(W.preventDefault(),ft=1);break;default:return}return this._rotationDisabled&&(me=0,Ue=0),{cameraAnimation:function(st){var bt=st.getZoom();st.easeTo({duration:300,easeId:"keyboardHandler",easing:cr,zoom:te?Math.round(bt)+te*(W.shiftKey?2:1):bt,bearing:st.getBearing()+me*de._bearingStep,pitch:st.getPitch()+Ue*de._pitchStep,offset:[-tt*de._panStep,-ft*de._panStep],center:st.getCenter()},{originalEvent:W})}}}},el.prototype.enable=function(){this._enabled=!0},el.prototype.disable=function(){this._enabled=!1,this.reset()},el.prototype.isEnabled=function(){return this._enabled},el.prototype.isActive=function(){return this._active},el.prototype.disableRotation=function(){this._rotationDisabled=!0},el.prototype.enableRotation=function(){this._rotationDisabled=!1};function cr(ye){return ye*(2-ye)}var fa=4.000244140625,xa=1/100,cn=1/450,In=2,Da=function(W,de){this._map=W,this._el=W.getCanvasContainer(),this._handler=de,this._delta=0,this._defaultZoomRate=xa,this._wheelZoomRate=cn,e.bindAll(["_onTimeout"],this)};Da.prototype.setZoomRate=function(W){this._defaultZoomRate=W},Da.prototype.setWheelZoomRate=function(W){this._wheelZoomRate=W},Da.prototype.isEnabled=function(){return!!this._enabled},Da.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},Da.prototype.isZooming=function(){return!!this._zooming},Da.prototype.enable=function(W){this.isEnabled()||(this._enabled=!0,this._aroundCenter=W&&W.around==="center")},Da.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Da.prototype.wheel=function(W){if(this.isEnabled()){var de=W.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?W.deltaY*40:W.deltaY,te=e.browser.now(),me=te-(this._lastWheelEventTime||0);this._lastWheelEventTime=te,de!==0&&de%fa===0?this._type="wheel":de!==0&&Math.abs(de)<4?this._type="trackpad":me>400?(this._type=null,this._lastValue=de,this._timeout=setTimeout(this._onTimeout,40,W)):this._type||(this._type=Math.abs(me*de)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,de+=this._lastValue)),W.shiftKey&&de&&(de=de/4),this._type&&(this._lastWheelEvent=W,this._delta-=de,this._active||this._start(W)),W.preventDefault()}},Da.prototype._onTimeout=function(W){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(W)},Da.prototype._start=function(W){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 de=r.mousePos(this._el,W);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(de)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},Da.prototype.renderFrame=function(){var W=this;if(this._frameId&&(this._frameId=null,!!this.isActive())){var de=this._map.transform;if(this._delta!==0){var te=this._type==="wheel"&&Math.abs(this._delta)>fa?this._wheelZoomRate:this._defaultZoomRate,me=In/(1+Math.exp(-Math.abs(this._delta*te)));this._delta<0&&me!==0&&(me=1/me);var Ue=typeof this._targetZoom=="number"?de.zoomScale(this._targetZoom):de.scale;this._targetZoom=Math.min(de.maxZoom,Math.max(de.minZoom,de.scaleZoom(Ue*me))),this._type==="wheel"&&(this._startZoom=de.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var tt=typeof this._targetZoom=="number"?this._targetZoom:de.zoom,ft=this._startZoom,st=this._easing,bt=!1,It;if(this._type==="wheel"&&ft&&st){var Jt=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),Kt=st(Jt);It=e.number(ft,tt,Kt),Jt<1?this._frameId||(this._frameId=!0):bt=!0}else It=tt,bt=!0;return this._active=!0,bt&&(this._active=!1,this._finishTimeout=setTimeout(function(){W._zooming=!1,W._handler._triggerRenderFrame(),delete W._targetZoom,delete W._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!bt,zoomDelta:It-de.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},Da.prototype._smoothOutEasing=function(W){var de=e.ease;if(this._prevEase){var te=this._prevEase,me=(e.browser.now()-te.start)/te.duration,Ue=te.easing(me+.01)-te.easing(me),tt=.27/Math.sqrt(Ue*Ue+1e-4)*.01,ft=Math.sqrt(.27*.27-tt*tt);de=e.bezier(tt,ft,.25,1)}return this._prevEase={start:e.browser.now(),duration:W,easing:de},de},Da.prototype.reset=function(){this._active=!1};var Na=function(W,de){this._clickZoom=W,this._tapZoom=de};Na.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Na.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Na.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Na.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var Hn=function(){this.reset()};Hn.prototype.reset=function(){this._active=!1},Hn.prototype.dblclick=function(W,de){return W.preventDefault(),{cameraAnimation:function(te){te.easeTo({duration:300,zoom:te.getZoom()+(W.shiftKey?-1:1),around:te.unproject(de)},{originalEvent:W})}}},Hn.prototype.enable=function(){this._enabled=!0},Hn.prototype.disable=function(){this._enabled=!1,this.reset()},Hn.prototype.isEnabled=function(){return this._enabled},Hn.prototype.isActive=function(){return this._active};var Un=function(){this._tap=new Va({numTouches:1,numTaps:1}),this.reset()};Un.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Un.prototype.touchstart=function(W,de,te){this._swipePoint||(this._tapTime&&W.timeStamp-this._tapTime>la&&this.reset(),this._tapTime?te.length>0&&(this._swipePoint=de[0],this._swipeTouch=te[0].identifier):this._tap.touchstart(W,de,te))},Un.prototype.touchmove=function(W,de,te){if(!this._tapTime)this._tap.touchmove(W,de,te);else if(this._swipePoint){if(te[0].identifier!==this._swipeTouch)return;var me=de[0],Ue=me.y-this._swipePoint.y;return this._swipePoint=me,W.preventDefault(),this._active=!0,{zoomDelta:Ue/128}}},Un.prototype.touchend=function(W,de,te){if(this._tapTime)this._swipePoint&&te.length===0&&this.reset();else{var me=this._tap.touchend(W,de,te);me&&(this._tapTime=W.timeStamp)}},Un.prototype.touchcancel=function(){this.reset()},Un.prototype.enable=function(){this._enabled=!0},Un.prototype.disable=function(){this._enabled=!1,this.reset()},Un.prototype.isEnabled=function(){return this._enabled},Un.prototype.isActive=function(){return this._active};var Gn=function(W,de,te){this._el=W,this._mousePan=de,this._touchPan=te};Gn.prototype.enable=function(W){this._inertiaOptions=W||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},Gn.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},Gn.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},Gn.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var ti=function(W,de,te){this._pitchWithRotate=W.pitchWithRotate,this._mouseRotate=de,this._mousePitch=te};ti.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},ti.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},ti.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},ti.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Wi=function(W,de,te,me){this._el=W,this._touchZoom=de,this._touchRotate=te,this._tapDragZoom=me,this._rotationDisabled=!1,this._enabled=!0};Wi.prototype.enable=function(W){this._touchZoom.enable(W),this._rotationDisabled||this._touchRotate.enable(W),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Wi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Wi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Wi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Wi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Wi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Ti=function(ye){return ye.zoom||ye.drag||ye.pitch||ye.rotate},si=function(ye){function W(){ye.apply(this,arguments)}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W}(e.Event);function Fn(ye){return ye.panDelta&&ye.panDelta.mag()||ye.zoomDelta||ye.bearingDelta||ye.pitchDelta}var qa=function(W,de){this._map=W,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ht(W),this._bearingSnap=de.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(de),e.bindAll(["handleEvent","handleWindowEvent"],this);var te=this._el;this._listeners=[[te,"touchstart",{passive:!0}],[te,"touchmove",{passive:!1}],[te,"touchend",void 0],[te,"touchcancel",void 0],[te,"mousedown",void 0],[te,"mousemove",void 0],[te,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[te,"mouseover",void 0],[te,"mouseout",void 0],[te,"dblclick",void 0],[te,"click",void 0],[te,"keydown",{capture:!1}],[te,"keyup",void 0],[te,"wheel",{passive:!1}],[te,"contextmenu",void 0],[e.window,"blur",void 0]];for(var me=0,Ue=this._listeners;meft?Math.min(2,Ea):Math.max(.5,Ea),fn=Math.pow(xn,1-an),En=tt.unproject(ea.add(ha.mult(an*fn)).mult(hn));tt.setLocationAtPoint(tt.renderWorldCopies?En.wrap():En,tr)}Ue._fireMoveEvents(me)},function(an){Ue._afterEase(me,an)},te),this},W.prototype._prepareEase=function(te,me,Ue){Ue===void 0&&(Ue={}),this._moving=!0,!me&&!Ue.moving&&this.fire(new e.Event("movestart",te)),this._zooming&&!Ue.zooming&&this.fire(new e.Event("zoomstart",te)),this._rotating&&!Ue.rotating&&this.fire(new e.Event("rotatestart",te)),this._pitching&&!Ue.pitching&&this.fire(new e.Event("pitchstart",te))},W.prototype._fireMoveEvents=function(te){this.fire(new e.Event("move",te)),this._zooming&&this.fire(new e.Event("zoom",te)),this._rotating&&this.fire(new e.Event("rotate",te)),this._pitching&&this.fire(new e.Event("pitch",te))},W.prototype._afterEase=function(te,me){if(!(this._easeId&&me&&this._easeId===me)){delete this._easeId;var Ue=this._zooming,tt=this._rotating,ft=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Ue&&this.fire(new e.Event("zoomend",te)),tt&&this.fire(new e.Event("rotateend",te)),ft&&this.fire(new e.Event("pitchend",te)),this.fire(new e.Event("moveend",te))}},W.prototype.flyTo=function(te,me){var Ue=this;if(!te.essential&&e.browser.prefersReducedMotion){var tt=e.pick(te,["center","zoom","bearing","pitch","around"]);return this.jumpTo(tt,me)}this.stop(),te=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},te);var ft=this.transform,st=this.getZoom(),bt=this.getBearing(),It=this.getPitch(),Jt=this.getPadding(),Kt="zoom"in te?e.clamp(+te.zoom,ft.minZoom,ft.maxZoom):st,vr="bearing"in te?this._normalizeBearing(te.bearing,bt):bt,Tr="pitch"in te?+te.pitch:It,wr="padding"in te?te.padding:ft.padding,tr=ft.zoomScale(Kt-st),pr=e.Point.convert(te.offset),xr=ft.centerPoint.add(pr),ea=ft.pointLocation(xr),ha=e.LngLat.convert(te.center||ea);this._normalizeCenter(ha);var Ea=ft.project(ea),tn=ft.project(ha).sub(Ea),Xa=te.curve,Ya=Math.max(ft.width,ft.height),an=Ya/tr,hn=tn.mag();if("minZoom"in te){var xn=e.clamp(Math.min(te.minZoom,st,Kt),ft.minZoom,ft.maxZoom),fn=Ya/ft.zoomScale(xn-st);Xa=Math.sqrt(fn/hn*2)}var En=Xa*Xa;function Yn(Uo){var Vs=(an*an-Ya*Ya+(Uo?-1:1)*En*En*hn*hn)/(2*(Uo?an:Ya)*En*hn);return Math.log(Math.sqrt(Vs*Vs+1)-Vs)}function vi(Uo){return(Math.exp(Uo)-Math.exp(-Uo))/2}function ai(Uo){return(Math.exp(Uo)+Math.exp(-Uo))/2}function Io(Uo){return vi(Uo)/ai(Uo)}var yo=Yn(0),vs=function(Uo){return ai(yo)/ai(yo+Xa*Uo)},us=function(Uo){return Ya*((ai(yo)*Io(yo+Xa*Uo)-vi(yo))/En)/hn},Ds=(Yn(1)-yo)/Xa;if(Math.abs(hn)<1e-6||!isFinite(Ds)){if(Math.abs(Ya-an)<1e-6)return this.easeTo(te,me);var rs=ante.maxDuration&&(te.duration=0),this._zooming=!0,this._rotating=bt!==vr,this._pitching=Tr!==It,this._padding=!ft.isPaddingEqual(wr),this._prepareEase(me,!1),this._ease(function(Uo){var Vs=Uo*Ds,Fu=1/vs(Vs);ft.zoom=Uo===1?Kt:st+ft.scaleZoom(Fu),Ue._rotating&&(ft.bearing=e.number(bt,vr,Uo)),Ue._pitching&&(ft.pitch=e.number(It,Tr,Uo)),Ue._padding&&(ft.interpolatePadding(Jt,wr,Uo),xr=ft.centerPoint.add(pr));var fc=Uo===1?ha:ft.unproject(Ea.add(tn.mult(us(Vs))).mult(Fu));ft.setLocationAtPoint(ft.renderWorldCopies?fc.wrap():fc,xr),Ue._fireMoveEvents(me)},function(){return Ue._afterEase(me)},te),this},W.prototype.isEasing=function(){return!!this._easeFrameId},W.prototype.stop=function(){return this._stop()},W.prototype._stop=function(te,me){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var Ue=this._onEaseEnd;delete this._onEaseEnd,Ue.call(this,me)}if(!te){var tt=this.handlers;tt&&tt.stop(!1)}return this},W.prototype._ease=function(te,me,Ue){Ue.animate===!1||Ue.duration===0?(te(1),me()):(this._easeStart=e.browser.now(),this._easeOptions=Ue,this._onEaseFrame=te,this._onEaseEnd=me,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},W.prototype._renderFrameCallback=function(){var te=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(te)),te<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},W.prototype._normalizeBearing=function(te,me){te=e.wrap(te,-180,180);var Ue=Math.abs(te-me);return Math.abs(te-360-me)180?-360:Ue<-180?360:0}},W}(e.Evented),Tn=function(W){W===void 0&&(W={}),this.options=W,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Tn.prototype.getDefaultPosition=function(){return"bottom-right"},Tn.prototype.onAdd=function(W){var de=this.options&&this.options.compact;return this._map=W,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),de&&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),de===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Tn.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Tn.prototype._setElementTitle=function(W,de){var te=this._map._getUIString("AttributionControl."+de);W.title=te,W.setAttribute("aria-label",te)},Tn.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Tn.prototype._updateEditLink=function(){var W=this._editLink;W||(W=this._editLink=this._container.querySelector(".mapbox-improve-map"));var de=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(W){var te=de.reduce(function(me,Ue,tt){return Ue.value&&(me+=Ue.key+"="+Ue.value+(tt=0)return!1;return!0});var ft=W.join(" | ");ft!==this._attribHTML&&(this._attribHTML=ft,W.length?(this._innerContainer.innerHTML=ft,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Tn.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Ln=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};Ln.prototype.onAdd=function(W){this._map=W,this._container=r.create("div","mapboxgl-ctrl");var de=r.create("a","mapboxgl-ctrl-logo");return de.target="_blank",de.rel="noopener nofollow",de.href="https://www.mapbox.com/",de.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),de.setAttribute("rel","noopener nofollow"),this._container.appendChild(de),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ln.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ln.prototype.getDefaultPosition=function(){return"bottom-left"},Ln.prototype._updateLogo=function(W){(!W||W.sourceDataType==="metadata")&&(this._container.style.display=this._logoRequired()?"block":"none")},Ln.prototype._logoRequired=function(){if(this._map.style){var W=this._map.style.sourceCaches;for(var de in W){var te=W[de].getSource();if(te.mapbox_logo)return!0}return!1}},Ln.prototype._updateCompact=function(){var W=this._container.children;if(W.length){var de=W[0];this._map.getCanvasContainer().offsetWidth<250?de.classList.add("mapboxgl-compact"):de.classList.remove("mapboxgl-compact")}};var Pn=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Pn.prototype.add=function(W){var de=++this._id,te=this._queue;return te.push({callback:W,id:de,cancelled:!1}),de},Pn.prototype.remove=function(W){for(var de=this._currentlyRunning,te=de?this._queue.concat(de):this._queue,me=0,Ue=te;mete.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(te.minPitch!=null&&te.maxPitch!=null&&te.minPitch>te.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(te.minPitch!=null&&te.minPitchgi)throw new Error("maxPitch must be less than or equal to "+gi);var Ue=new xo(te.minZoom,te.maxZoom,te.minPitch,te.maxPitch,te.renderWorldCopies);if(ye.call(this,Ue,te),this._interactive=te.interactive,this._maxTileCacheSize=te.maxTileCacheSize,this._failIfMajorPerformanceCaveat=te.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=te.preserveDrawingBuffer,this._antialias=te.antialias,this._trackResize=te.trackResize,this._bearingSnap=te.bearingSnap,this._refreshExpiredTiles=te.refreshExpiredTiles,this._fadeDuration=te.fadeDuration,this._crossSourceCollisions=te.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=te.collectResourceTiming,this._renderTaskQueue=new Pn,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},Ri,te.locale),this._clickTolerance=te.clickTolerance,this._requestManager=new e.RequestManager(te.transformRequest,te.accessToken),typeof te.container=="string"){if(this._container=e.window.document.getElementById(te.container),!this._container)throw new Error("Container '"+te.container+"' not found.")}else if(te.container instanceof $i)this._container=te.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(te.maxBounds&&this.setMaxBounds(te.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return me._update(!1)}),this.on("moveend",function(){return me._update(!1)}),this.on("zoom",function(){return me._update(!0)}),typeof e.window<"u"&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new qa(this,te);var tt=typeof te.hash=="string"&&te.hash||void 0;this._hash=te.hash&&new Al(tt).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:te.center,zoom:te.zoom,bearing:te.bearing,pitch:te.pitch}),te.bounds&&(this.resize(),this.fitBounds(te.bounds,e.extend({},te.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=te.localIdeographFontFamily,te.style&&this.setStyle(te.style,{localIdeographFontFamily:te.localIdeographFontFamily}),te.attributionControl&&this.addControl(new Tn({customAttribution:te.customAttribution})),this.addControl(new Ln,te.logoPosition),this.on("style.load",function(){me.transform.unmodified&&me.jumpTo(me.style.stylesheet)}),this.on("data",function(ft){me._update(ft.dataType==="style"),me.fire(new e.Event(ft.dataType+"data",ft))}),this.on("dataloading",function(ft){me.fire(new e.Event(ft.dataType+"dataloading",ft))})}ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W;var de={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return W.prototype._getMapId=function(){return this._mapId},W.prototype.addControl=function(me,Ue){if(Ue===void 0&&(me.getDefaultPosition?Ue=me.getDefaultPosition():Ue="top-right"),!me||!me.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var tt=me.onAdd(this);this._controls.push(me);var ft=this._controlPositions[Ue];return Ue.indexOf("bottom")!==-1?ft.insertBefore(tt,ft.firstChild):ft.appendChild(tt),this},W.prototype.removeControl=function(me){if(!me||!me.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var Ue=this._controls.indexOf(me);return Ue>-1&&this._controls.splice(Ue,1),me.onRemove(this),this},W.prototype.hasControl=function(me){return this._controls.indexOf(me)>-1},W.prototype.resize=function(me){var Ue=this._containerDimensions(),tt=Ue[0],ft=Ue[1];this._resizeCanvas(tt,ft),this.transform.resize(tt,ft),this.painter.resize(tt,ft);var st=!this._moving;return st&&(this.stop(),this.fire(new e.Event("movestart",me)).fire(new e.Event("move",me))),this.fire(new e.Event("resize",me)),st&&this.fire(new e.Event("moveend",me)),this},W.prototype.getBounds=function(){return this.transform.getBounds()},W.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},W.prototype.setMaxBounds=function(me){return this.transform.setMaxBounds(e.LngLatBounds.convert(me)),this._update()},W.prototype.setMinZoom=function(me){if(me=me??Mn,me>=Mn&&me<=this.transform.maxZoom)return this.transform.minZoom=me,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=me,this._update(),this.getZoom()>me&&this.setZoom(me),this;throw new Error("maxZoom must be greater than the current minZoom")},W.prototype.getMaxZoom=function(){return this.transform.maxZoom},W.prototype.setMinPitch=function(me){if(me=me??yn,me=yn&&me<=this.transform.maxPitch)return this.transform.minPitch=me,this._update(),this.getPitch()gi)throw new Error("maxPitch must be less than or equal to "+gi);if(me>=this.transform.minPitch)return this.transform.maxPitch=me,this._update(),this.getPitch()>me&&this.setPitch(me),this;throw new Error("maxPitch must be greater than the current minPitch")},W.prototype.getMaxPitch=function(){return this.transform.maxPitch},W.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},W.prototype.setRenderWorldCopies=function(me){return this.transform.renderWorldCopies=me,this._update()},W.prototype.project=function(me){return this.transform.locationPoint(e.LngLat.convert(me))},W.prototype.unproject=function(me){return this.transform.pointLocation(e.Point.convert(me))},W.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},W.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},W.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},W.prototype._createDelegatedListener=function(me,Ue,tt){var ft=this,st;if(me==="mouseenter"||me==="mouseover"){var bt=!1,It=function(tr){var pr=ft.getLayer(Ue)?ft.queryRenderedFeatures(tr.point,{layers:[Ue]}):[];pr.length?bt||(bt=!0,tt.call(ft,new Dt(me,ft,tr.originalEvent,{features:pr}))):bt=!1},Jt=function(){bt=!1};return{layer:Ue,listener:tt,delegates:{mousemove:It,mouseout:Jt}}}else if(me==="mouseleave"||me==="mouseout"){var Kt=!1,vr=function(tr){var pr=ft.getLayer(Ue)?ft.queryRenderedFeatures(tr.point,{layers:[Ue]}):[];pr.length?Kt=!0:Kt&&(Kt=!1,tt.call(ft,new Dt(me,ft,tr.originalEvent)))},Tr=function(tr){Kt&&(Kt=!1,tt.call(ft,new Dt(me,ft,tr.originalEvent)))};return{layer:Ue,listener:tt,delegates:{mousemove:vr,mouseout:Tr}}}else{var wr=function(tr){var pr=ft.getLayer(Ue)?ft.queryRenderedFeatures(tr.point,{layers:[Ue]}):[];pr.length&&(tr.features=pr,tt.call(ft,tr),delete tr.features)};return{layer:Ue,listener:tt,delegates:(st={},st[me]=wr,st)}}},W.prototype.on=function(me,Ue,tt){if(tt===void 0)return ye.prototype.on.call(this,me,Ue);var ft=this._createDelegatedListener(me,Ue,tt);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[me]=this._delegatedListeners[me]||[],this._delegatedListeners[me].push(ft);for(var st in ft.delegates)this.on(st,ft.delegates[st]);return this},W.prototype.once=function(me,Ue,tt){if(tt===void 0)return ye.prototype.once.call(this,me,Ue);var ft=this._createDelegatedListener(me,Ue,tt);for(var st in ft.delegates)this.once(st,ft.delegates[st]);return this},W.prototype.off=function(me,Ue,tt){var ft=this;if(tt===void 0)return ye.prototype.off.call(this,me,Ue);var st=function(bt){for(var It=bt[me],Jt=0;Jt180;){var tt=de.locationPoint(ye);if(tt.x>=0&&tt.y>=0&&tt.x<=de.width&&tt.y<=de.height)break;ye.lng>de.center.lng?ye.lng-=360:ye.lng+=360}return ye}var ys={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function xs(ye,W,de){var te=ye.classList;for(var me in ys)te.remove("mapboxgl-"+de+"-anchor-"+me);te.add("mapboxgl-"+de+"-anchor-"+W)}var Xs=function(ye){function W(de,te){if(ye.call(this),(de instanceof e.window.HTMLElement||te)&&(de=e.extend({element:de},te)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=de&&de.anchor||"center",this._color=de&&de.color||"#3FB1CE",this._scale=de&&de.scale||1,this._draggable=de&&de.draggable||!1,this._clickTolerance=de&&de.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=de&&de.rotation||0,this._rotationAlignment=de&&de.rotationAlignment||"auto",this._pitchAlignment=de&&de.pitchAlignment&&de.pitchAlignment!=="auto"?de.pitchAlignment:this._rotationAlignment,!de||!de.element){this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var me=r.createNS("http://www.w3.org/2000/svg","svg"),Ue=41,tt=27;me.setAttributeNS(null,"display","block"),me.setAttributeNS(null,"height",Ue+"px"),me.setAttributeNS(null,"width",tt+"px"),me.setAttributeNS(null,"viewBox","0 0 "+tt+" "+Ue);var ft=r.createNS("http://www.w3.org/2000/svg","g");ft.setAttributeNS(null,"stroke","none"),ft.setAttributeNS(null,"stroke-width","1"),ft.setAttributeNS(null,"fill","none"),ft.setAttributeNS(null,"fill-rule","evenodd");var st=r.createNS("http://www.w3.org/2000/svg","g");st.setAttributeNS(null,"fill-rule","nonzero");var bt=r.createNS("http://www.w3.org/2000/svg","g");bt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),bt.setAttributeNS(null,"fill","#000000");for(var It=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}],Jt=0,Kt=It;Jt=me}this._isDragging&&(this._pos=te.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag")))},W.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new e.Event("dragend")),this._state="inactive"},W.prototype._addDragHandler=function(te){this._element.contains(te.originalEvent.target)&&(te.preventDefault(),this._positionDelta=te.point.sub(this._pos).add(this._offset),this._pointerdownPos=te.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},W.prototype.setDraggable=function(te){return this._draggable=!!te,this._map&&(te?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},W.prototype.isDraggable=function(){return this._draggable},W.prototype.setRotation=function(te){return this._rotation=te||0,this._update(),this},W.prototype.getRotation=function(){return this._rotation},W.prototype.setRotationAlignment=function(te){return this._rotationAlignment=te||"auto",this._update(),this},W.prototype.getRotationAlignment=function(){return this._rotationAlignment},W.prototype.setPitchAlignment=function(te){return this._pitchAlignment=te&&te!=="auto"?te:this._rotationAlignment,this._update(),this},W.prototype.getPitchAlignment=function(){return this._pitchAlignment},W}(e.Evented),Ps={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Mu;function dl(ye){Mu!==void 0?ye(Mu):e.window.navigator.permissions!==void 0?e.window.navigator.permissions.query({name:"geolocation"}).then(function(W){Mu=W.state!=="denied",ye(Mu)}):(Mu=!!e.window.navigator.geolocation,ye(Mu))}var Eu=0,ac=!1,Lc=function(ye){function W(de){ye.call(this),this.options=e.extend({},Ps,de),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.onAdd=function(te){return this._map=te,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),dl(this._setupUI),this._container},W.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Eu=0,ac=!1},W.prototype._isOutOfMapMaxBounds=function(te){var me=this._map.getMaxBounds(),Ue=te.coords;return me&&(Ue.longitudeme.getEast()||Ue.latitudeme.getNorth())},W.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");break}},W.prototype._onSuccess=function(te){if(this._map){if(this._isOutOfMapMaxBounds(te)){this._setErrorState(),this.fire(new e.Event("outofmaxbounds",te)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=te,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");break}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(te),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(te),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",te)),this._finish()}},W.prototype._updateCamera=function(te){var me=new e.LngLat(te.coords.longitude,te.coords.latitude),Ue=te.coords.accuracy,tt=this._map.getBearing(),ft=e.extend({bearing:tt},this.options.fitBoundsOptions);this._map.fitBounds(me.toBounds(Ue),ft,{geolocateSource:!0})},W.prototype._updateMarker=function(te){if(te){var me=new e.LngLat(te.coords.longitude,te.coords.latitude);this._accuracyCircleMarker.setLngLat(me).addTo(this._map),this._userLocationDotMarker.setLngLat(me).addTo(this._map),this._accuracy=te.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},W.prototype._updateCircleRadius=function(){var te=this._map._container.clientHeight/2,me=this._map.unproject([0,te]),Ue=this._map.unproject([1,te]),tt=me.distanceTo(Ue),ft=Math.ceil(2*this._accuracy/tt);this._circleElement.style.width=ft+"px",this._circleElement.style.height=ft+"px"},W.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},W.prototype._onError=function(te){if(this._map){if(this.options.trackUserLocation)if(te.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 me=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=me,this._geolocateButton.setAttribute("aria-label",me),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(te.code===3&&ac)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",te)),this._finish()}},W.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},W.prototype._setupUI=function(te){var me=this;if(this._container.addEventListener("contextmenu",function(ft){return ft.preventDefault()}),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",te===!1){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var Ue=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=Ue,this._geolocateButton.setAttribute("aria-label",Ue)}else{var tt=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=tt,this._geolocateButton.setAttribute("aria-label",tt)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Xs(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Xs({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(ft){var st=ft.originalEvent&&ft.originalEvent.type==="resize";!ft.geolocateSource&&me._watchState==="ACTIVE_LOCK"&&!st&&(me._watchState="BACKGROUND",me._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),me._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),me.fire(new e.Event("trackuserlocationend")))})},W.prototype.trigger=function(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Eu--,ac=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"));break}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");break}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Eu++;var te;Eu>1?(te={maximumAge:6e5,timeout:0},ac=!0):(te=this.options.positionOptions,ac=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,te)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},W.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},W}(e.Evented),Pf={maxWidth:100,unit:"metric"},su=function(W){this.options=e.extend({},Pf,W),e.bindAll(["_onMove","setUnit"],this)};su.prototype.getDefaultPosition=function(){return"bottom-left"},su.prototype._onMove=function(){zu(this._map,this._container,this.options)},su.prototype.onAdd=function(W){return this._map=W,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",W.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},su.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},su.prototype.setUnit=function(W){this.options.unit=W,zu(this._map,this._container,this.options)};function zu(ye,W,de){var te=de&&de.maxWidth||100,me=ye._container.clientHeight/2,Ue=ye.unproject([0,me]),tt=ye.unproject([te,me]),ft=Ue.distanceTo(tt);if(de&&de.unit==="imperial"){var st=3.2808*ft;if(st>5280){var bt=st/5280;Fo(W,te,bt,ye._getUIString("ScaleControl.Miles"))}else Fo(W,te,st,ye._getUIString("ScaleControl.Feet"))}else if(de&&de.unit==="nautical"){var It=ft/1852;Fo(W,te,It,ye._getUIString("ScaleControl.NauticalMiles"))}else ft>=1e3?Fo(W,te,ft/1e3,ye._getUIString("ScaleControl.Kilometers")):Fo(W,te,ft,ye._getUIString("ScaleControl.Meters"))}function Fo(ye,W,de,te){var me=ll(de),Ue=me/de;ye.style.width=W*Ue+"px",ye.innerHTML=me+" "+te}function nc(ye){var W=Math.pow(10,Math.ceil(-Math.log(ye)/Math.LN10));return Math.round(ye*W)/W}function ll(ye){var W=Math.pow(10,(""+Math.floor(ye)).length-1),de=ye/W;return de=de>=10?10:de>=5?5:de>=3?3:de>=2?2:de>=1?1:nc(de),W*de}var Sl=function(W){this._fullscreen=!1,W&&W.container&&(W.container instanceof e.window.HTMLElement?this._container=W.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};Sl.prototype.onAdd=function(W){return this._map=W,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Sl.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Sl.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},Sl.prototype._setupUI=function(){var W=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",W).setAttribute("aria-hidden",!0),W.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Sl.prototype._updateTitle=function(){var W=this._getTitle();this._fullscreenButton.setAttribute("aria-label",W),this._fullscreenButton.title=W},Sl.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Sl.prototype._isFullscreen=function(){return this._fullscreen},Sl.prototype._changeIcon=function(){var W=e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement;W===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Sl.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var qc={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Hc=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),ss=function(ye){function W(de){ye.call(this),this.options=e.extend(Object.create(qc),de),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return ye&&(W.__proto__=ye),W.prototype=Object.create(ye&&ye.prototype),W.prototype.constructor=W,W.prototype.addTo=function(te){return this._map&&this.remove(),this._map=te,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this},W.prototype.isOpen=function(){return!!this._map},W.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},W.prototype.getLngLat=function(){return this._lngLat},W.prototype.setLngLat=function(te){return this._lngLat=e.LngLat.convert(te),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},W.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},W.prototype.getElement=function(){return this._container},W.prototype.setText=function(te){return this.setDOMContent(e.window.document.createTextNode(te))},W.prototype.setHTML=function(te){var me=e.window.document.createDocumentFragment(),Ue=e.window.document.createElement("body"),tt;for(Ue.innerHTML=te;tt=Ue.firstChild,!!tt;)me.appendChild(tt);return this.setDOMContent(me)},W.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},W.prototype.setMaxWidth=function(te){return this.options.maxWidth=te,this._update(),this},W.prototype.setDOMContent=function(te){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(te),this._createCloseButton(),this._update(),this._focusFirstElement(),this},W.prototype.addClassName=function(te){this._container&&this._container.classList.add(te)},W.prototype.removeClassName=function(te){this._container&&this._container.classList.remove(te)},W.prototype.setOffset=function(te){return this.options.offset=te,this._update(),this},W.prototype.toggleClassName=function(te){if(this._container)return this._container.classList.toggle(te)},W.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},W.prototype._onMouseUp=function(te){this._update(te.point)},W.prototype._onMouseMove=function(te){this._update(te.point)},W.prototype._onDrag=function(te){this._update(te.point)},W.prototype._update=function(te){var me=this,Ue=this._lngLat||this._trackPointer;if(!(!this._map||!Ue||!this._content)&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(vr){return me._container.classList.add(vr)}),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=Xo(this._lngLat,this._pos,this._map.transform)),!(this._trackPointer&&!te))){var tt=this._pos=this._trackPointer&&te?te:this._map.project(this._lngLat),ft=this.options.anchor,st=js(this.options.offset);if(!ft){var bt=this._container.offsetWidth,It=this._container.offsetHeight,Jt;tt.y+st.bottom.ythis._map.transform.height-It?Jt=["bottom"]:Jt=[],tt.xthis._map.transform.width-bt/2&&Jt.push("right"),Jt.length===0?ft="bottom":ft=Jt.join("-")}var Kt=tt.add(st[ft]).round();r.setTransform(this._container,ys[ft]+" translate("+Kt.x+"px,"+Kt.y+"px)"),xs(this._container,ft,"popup")}},W.prototype._focusFirstElement=function(){if(!(!this.options.focusAfterOpen||!this._container)){var te=this._container.querySelector(Hc);te&&te.focus()}},W.prototype._onClose=function(){this.remove()},W}(e.Evented);function js(ye){if(ye)if(typeof ye=="number"){var W=Math.round(Math.sqrt(.5*Math.pow(ye,2)));return{center:new e.Point(0,0),top:new e.Point(0,ye),"top-left":new e.Point(W,W),"top-right":new e.Point(-W,W),bottom:new e.Point(0,-ye),"bottom-left":new e.Point(W,-W),"bottom-right":new e.Point(-W,-W),left:new e.Point(ye,0),right:new e.Point(-ye,0)}}else if(ye instanceof e.Point||Array.isArray(ye)){var de=e.Point.convert(ye);return{center:de,top:de,"top-left":de,"top-right":de,bottom:de,"bottom-left":de,"bottom-right":de,left:de,right:de}}else return{center:e.Point.convert(ye.center||[0,0]),top:e.Point.convert(ye.top||[0,0]),"top-left":e.Point.convert(ye["top-left"]||[0,0]),"top-right":e.Point.convert(ye["top-right"]||[0,0]),bottom:e.Point.convert(ye.bottom||[0,0]),"bottom-left":e.Point.convert(ye["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(ye["bottom-right"]||[0,0]),left:e.Point.convert(ye.left||[0,0]),right:e.Point.convert(ye.right||[0,0])};else return js(new e.Point(0,0))}var ls={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:ro,NavigationControl:no,GeolocateControl:Lc,AttributionControl:Tn,ScaleControl:su,FullscreenControl:Sl,Popup:ss,Marker:Xs,Style:Dl,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:Lr,clearPrewarmedResources:Er,get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(ye){e.config.ACCESS_TOKEN=ye},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(ye){e.config.API_URL=ye},get workerCount(){return sa.workerCount},set workerCount(ye){sa.workerCount=ye},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(ye){e.config.MAX_PARALLEL_IMAGE_REQUESTS=ye},clearStorage:function(W){e.clearTileCache(W)},workerUrl:""};return ls}),A})}}),XI=He({"src/plots/mapbox/layers.js"(Y,G){var d=Gr(),x=yl().sanitizeHTML,A=OT(),E=dd();function e(i,n){this.subplot=i,this.uid=i.uid+"-"+n,this.index=n,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(n){this.visible?this.needsNewImage(n)?this.updateImage(n):this.needsNewSource(n)?(this.removeLayer(),this.updateSource(n),this.updateLayer(n)):this.needsNewLayer(n)?this.updateLayer(n):this.updateStyle(n):(this.updateSource(n),this.updateLayer(n)),this.visible=r(n)},t.needsNewImage=function(i){var n=this.subplot.map;return n.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var n=this.subplot.map;n.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapboxLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var n=this.subplot.map;if(n.getSource(this.idSource)&&n.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=a(i);n.addSource(this.idSource,s)}},t.findFollowingMapboxLayerId=function(i){if(i==="traces")for(var n=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var n={},s={};switch(i.type){case"circle":d.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":d.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":d.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var c=i.symbol,f=A(c.textposition,c.iconsize);d.extendFlat(n,{"icon-image":c.icon+"-15","icon-size":c.iconsize/10,"text-field":c.text,"text-size":c.textfont.size,"text-anchor":f.anchor,"text-offset":f.offset,"symbol-placement":c.placement}),d.extendFlat(s,{"icon-color":i.color,"text-color":c.textfont.color,"text-opacity":i.opacity});break;case"raster":d.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:n,paint:s}}function a(i){var n=i.sourcetype,s=i.source,c={type:n},f;return n==="geojson"?f="data":n==="vector"?f=typeof s=="string"?"url":"tiles":n==="raster"?(f="tiles",c.tileSize=256):n==="image"&&(f="url",c.coordinates=i.coordinates),c[f]=s,i.sourceattribution&&(c.attribution=x(i.sourceattribution)),c}G.exports=function(n,s,c){var f=new e(n,s);return f.update(c),f}}}),YI=He({"src/plots/mapbox/mapbox.js"(Y,G){var d=BT(),x=Gr(),A=ip(),E=Ei(),e=io(),t=fh(),r=Wu(),o=bv(),a=o.drawMode,i=o.selectMode,n=dc().prepSelect,s=dc().clearOutline,c=dc().clearSelectionsCache,f=dc().selectOnClick,v=dd(),h=XI();function T(_,w){this.id=w,this.gd=_;var p=_._fullLayout,u=_._context;this.container=p._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(_,w,p){var u=this,g=w[u.id];u.map&&g.accesstoken!==u.accessToken&&(u.map.remove(),u.map=null,u.styleObj=null,u.traceHash={},u.layerList=[]);var m;u.map?m=new Promise(function(R,P){u.updateMap(_,w,R,P)}):m=new Promise(function(R,P){u.createMap(_,w,R,P)}),p.push(m)},l.createMap=function(_,w,p,u){var g=this,m=w[g.id],R=g.styleObj=b(m.style,w);g.accessToken=m.accesstoken;var P=m.bounds,z=P?[[P.west,P.south],[P.east,P.north]]:null,F=g.map=new d.Map({container:g.div,style:R.style,center:M(m.center),zoom:m.zoom,bearing:m.bearing,pitch:m.pitch,maxBounds:z,interactive:!g.isStatic,preserveDrawingBuffer:g.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0}));F._canvas.style.left="0px",F._canvas.style.top="0px",g.rejectOnError(u),g.isStatic||g.initFx(_,w);var B=[];B.push(new Promise(function(O){F.once("load",O)})),B=B.concat(A.fetchTraceGeoData(_)),Promise.all(B).then(function(){g.fillBelowLookup(_,w),g.updateData(_),g.updateLayout(w),g.resolveOnRender(p)}).catch(u)},l.updateMap=function(_,w,p,u){var g=this,m=g.map,R=w[this.id];g.rejectOnError(u);var P=[],z=b(R.style,w);JSON.stringify(g.styleObj)!==JSON.stringify(z)&&(g.styleObj=z,m.setStyle(z.style),g.traceHash={},P.push(new Promise(function(F){m.once("styledata",F)}))),P=P.concat(A.fetchTraceGeoData(_)),Promise.all(P).then(function(){g.fillBelowLookup(_,w),g.updateData(_),g.updateLayout(w),g.resolveOnRender(p)}).catch(u)},l.fillBelowLookup=function(_,w){var p=w[this.id],u=p.layers,g,m,R=this.belowLookup={},P=!1;for(g=0;g<_.length;g++){var z=_[g][0].trace,F=z._module;typeof z.below=="string"?m=z.below:F.getBelow&&(m=F.getBelow(z,this)),m===""&&(P=!0),R["trace-"+z.uid]=m||""}for(g=0;g1)for(g=0;g-1&&f(z.originalEvent,u,[p.xaxis],[p.yaxis],p.id,P),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(_){var w=this,p=w.map,u=w.gd;if(w.isStatic)return;function g(z){var F=w.map.unproject(z);return[F.lng,F.lat]}var m=_.dragmode,R;R=function(z,F){if(F.isRect){var B=z.range={};B[w.id]=[g([F.xmin,F.ymin]),g([F.xmax,F.ymax])]}else{var O=z.lassoPoints={};O[w.id]=F.map(g)}};var P=w.dragOptions;w.dragOptions=x.extendDeep(P||{},{dragmode:_.dragmode,element:w.div,gd:u,plotinfo:{id:w.id,domain:_[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:R},xaxes:[w.xaxis],yaxes:[w.yaxis],subplot:w.id}),p.off("click",w.onClickInPanHandler),i(m)||a(m)?(p.dragPan.disable(),p.on("zoomstart",w.clearOutline),w.dragOptions.prepFn=function(z,F,B){n(z,F,B,w.dragOptions,m)},t.init(w.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",w.clearOutline),w.div.onmousedown=null,w.div.ontouchstart=null,w.div.removeEventListener("touchstart",w.div._ontouchstart),w.onClickInPanHandler=w.onClickInPanFn(w.dragOptions),p.on("click",w.onClickInPanHandler))},l.updateFramework=function(_){var w=_[this.id].domain,p=_._size,u=this.div.style;u.width=p.w*(w.x[1]-w.x[0])+"px",u.height=p.h*(w.y[1]-w.y[0])+"px",u.left=p.l+w.x[0]*p.w+"px",u.top=p.t+(1-w.y[1])*p.h+"px",this.xaxis._offset=p.l+w.x[0]*p.w,this.xaxis._length=p.w*(w.x[1]-w.x[0]),this.yaxis._offset=p.t+(1-w.y[1])*p.h,this.yaxis._length=p.h*(w.y[1]-w.y[0])},l.updateLayers=function(_){var w=_[this.id],p=w.layers,u=this.layerList,g;if(p.length!==u.length){for(g=0;gB/2){var O=R.split("|").join("
");z.text(O).attr("data-unformatted",O).call(o.convertToTspans,h),F=r.bBox(z.node())}z.attr("transform",x(-3,-F.height+8)),P.insert("rect",".static-attribution").attr({x:-F.width-6,y:-F.height-3,width:F.width+6,height:F.height+3,fill:"rgba(255, 255, 255, 0.75)"});var L=1;F.width+6>B&&(L=B/(F.width+6));var N=[y.l+y.w*M.x[1],y.t+y.h*(1-M.y[0])];P.attr("transform",x(N[0],N[1])+A(L))}};function f(h,T){var l=h._fullLayout,y=h._context;if(y.mapboxAccessToken==="")return"";for(var b=[],S=[],M=!1,_=!1,w=0;w1&&d.warn(n.multipleTokensErrorMsg),b[0]):(S.length&&d.log(["Listed mapbox access token(s)",S.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}function v(h){return typeof h=="string"&&(n.styleValuesMapbox.indexOf(h)!==-1||h.indexOf("mapbox://")===0||h.indexOf("stamen")===0)}Y.updateFx=function(h){for(var T=h._fullLayout,l=T._subplots[i],y=0;y=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},G.exports=function(r,o){var a=o[0].trace,i=new E(r,a.uid),n=i.sourceId,s=d(o),c=i.below=r.belowLookup["trace-"+a.uid];return r.map.addSource(n,{type:"geojson",data:s.geojson}),i._addLayers(s,c),o[0].trace._glTrace=i,i}}}),tR=He({"src/traces/choroplethmapbox/index.js"(Y,G){G.exports={attributes:NT(),supplyDefaults:QI(),colorbar:Zd(),calc:G_(),plot:eR(),hoverPoints:Z_(),eventData:X_(),selectPoints:Y_(),styleOnSelect:function(d,x){if(x){var A=x[0].trace;A._glTrace.updateOnSelect(x)}},getBelow:function(d,x){for(var A=x.getMapLayers(),E=A.length-2;E>=0;E--){var e=A[E].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=E+1;t0?+h[f]:0),c.push({type:"Feature",geometry:{type:"Point",coordinates:b},properties:S})}}var _=E.extractOpts(a),w=_.reversescale?E.flipScale(_.colorscale):_.colorscale,p=w[0][1],u=A.opacity(p)<1?p:A.addOpacity(p,0),g=["interpolate",["linear"],["heatmap-density"],0,u];for(f=1;f=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},G.exports=function(t,r){var o=r[0].trace,a=new A(t,o.uid),i=a.sourceId,n=d(r),s=a.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:n.geojson}),a._addLayers(n,s),a}}}),sR=He({"src/traces/densitymapbox/hover.js"(Y,G){var d=io(),x=lx().hoverPoints,A=lx().getExtraText;G.exports=function(e,t,r){var o=x(e,t,r);if(o){var a=o[0],i=a.cd,n=i[0].trace,s=i[a.index];if(delete a.color,"z"in s){var c=a.subplot.mockAxis;a.z=s.z,a.zLabel=d.tickText(c,c.c2l(s.z),"hover").text}return a.extraText=A(n,s,i[0].t.labels),[a]}}}}),lR=He({"src/traces/densitymapbox/event_data.js"(Y,G){G.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x.z=A.z,x}}}),uR=He({"src/traces/densitymapbox/index.js"(Y,G){G.exports={attributes:jT(),supplyDefaults:aR(),colorbar:Zd(),formatLabels:FT(),calc:nR(),plot:oR(),hoverPoints:sR(),eventData:lR(),getBelow:function(d,x){for(var A=x.getMapLayers(),E=0;EESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":`{name:latin} +{name:nonlatin}`,"text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":`{name:latin} +{name:nonlatin}`,"text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":`{name:latin} +{name:nonlatin}`,"text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),hR=He({"src/plots/map/styles/arcgis-sat.js"(Y,G){G.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI © ESRI"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),up=He({"src/plots/map/constants.js"(Y,G){var d=Ud(),x=fR(),A=hR(),E='© OpenStreetMap contributors',e="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",t="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",r="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json",i="https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json",n={basic:r,streets:r,outdoors:r,light:e,dark:t,satellite:A,"satellite-streets":x,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:E,tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":e,"carto-darkmatter":t,"carto-voyager":r,"carto-positron-nolabels":o,"carto-darkmatter-nolabels":a,"carto-voyager-nolabels":i},s=d(n);G.exports={styleValueDflt:"basic",stylesMap:n,styleValuesMap:s,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",s.join(", "),"or use a tile service."].join(` +`),mapOnErrorMsg:"Map error."}}}),Jy=He({"src/plots/map/layout_attributes.js"(Y,G){var d=Gr(),x=Ai().defaultLine,A=mu().attributes,E=Yl(),e=Zu().textposition,t=hu().overrideAll,r=Gs().templatedArray,o=up(),a=E({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});a.family.dflt="Open Sans Regular, Arial Unicode MS Regular";var i=G.exports=t({_arrayAttrRegexps:[d.counterRegex("map",".layers",!0)],domain:A({name:"map"}),style:{valType:"any",values:o.styleValuesMap,dflt:o.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:r("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:x},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:x}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:a,textposition:d.extendFlat({},e,{arrayOk:!1})}})},"plot","from-root");i.uirevision={valType:"any",editType:"none"}}}),cx=He({"src/traces/scattermap/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=Yo().texttemplateAttrs,A=wv(),E=Zp(),e=Zu(),t=Jy(),r=cl(),o=kl(),a=ho().extendFlat,i=hu().overrideAll,n=Jy(),s=E.line,c=E.marker;G.exports=i({lon:E.lon,lat:E.lat,cluster:{enabled:{valType:"boolean"},maxzoom:a({},n.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:a({},c.opacity,{dflt:1})},mode:a({},e.mode,{dflt:"markers"}),text:a({},e.text,{}),texttemplate:x({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:a({},e.hovertext,{}),line:{color:s.color,width:s.width},connectgaps:e.connectgaps,marker:a({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:c.opacity,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode},o("marker")),fill:E.fill,fillcolor:A(),textfont:t.layers.symbol.textfont,textposition:t.layers.symbol.textposition,below:{valType:"string"},selected:{marker:e.selected.marker},unselected:{marker:e.unselected.marker},hoverinfo:a({},r.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:d()},"calc","nested")}}),VT=He({"src/traces/scattermap/constants.js"(Y,G){var d=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];G.exports={isSupportedFont:function(x){return d.indexOf(x)!==-1}}}}),vR=He({"src/traces/scattermap/defaults.js"(Y,G){var d=Gr(),x=Rl(),A=Kh(),E=nv(),e=iv(),t=Av(),r=cx(),o=VT().isSupportedFont;G.exports=function(n,s,c,f){function v(g,m){return d.coerce(n,s,r,g,m)}function h(g,m){return d.coerce2(n,s,r,g,m)}var T=a(n,s,v);if(!T){s.visible=!1;return}if(v("text"),v("texttemplate"),v("hovertext"),v("hovertemplate"),v("mode"),v("below"),x.hasMarkers(s)){A(n,s,c,f,v,{noLine:!0,noAngle:!0}),v("marker.allowoverlap"),v("marker.angle");var l=s.marker;l.symbol!=="circle"&&(d.isArrayOrTypedArray(l.size)&&(l.size=l.size[0]),d.isArrayOrTypedArray(l.color)&&(l.color=l.color[0]))}x.hasLines(s)&&(E(n,s,c,f,v,{noDash:!0}),v("connectgaps"));var y=h("cluster.maxzoom"),b=h("cluster.step"),S=h("cluster.color",s.marker&&s.marker.color||c),M=h("cluster.size"),_=h("cluster.opacity"),w=y!==!1||b!==!1||S!==!1||M!==!1||_!==!1,p=v("cluster.enabled",w);if(p||x.hasText(s)){var u=f.font.family;e(n,s,f,v,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:o(u)?u:"Open Sans Regular",weight:f.font.weight,style:f.font.style,size:f.font.size,color:f.font.color}})}v("fill"),s.fill!=="none"&&t(n,s,c,v),d.coerceSelectionMarkerOpacity(s,v)};function a(i,n,s){var c=s("lon")||[],f=s("lat")||[],v=Math.min(c.length,f.length);return n._length=v,v}}}),qT=He({"src/traces/scattermap/format_labels.js"(Y,G){var d=io();G.exports=function(A,E,e){var t={},r=e[E.subplot]._subplot,o=r.mockAxis,a=A.lonlat;return t.lonLabel=d.tickText(o,o.c2l(a[0]),!0).text,t.latLabel=d.tickText(o,o.c2l(a[1]),!0).text,t}}}),HT=He({"src/plots/map/convert_text_opts.js"(Y,G){var d=Gr();G.exports=function(A,E){var e=A.split(" "),t=e[0],r=e[1],o=d.isArrayOrTypedArray(E)?d.mean(E):E,a=.5+o/100,i=1.5+o/100,n=["",""],s=[0,0];switch(t){case"top":n[0]="top",s[1]=-i;break;case"bottom":n[0]="bottom",s[1]=i;break}switch(r){case"left":n[1]="right",s[0]=-a;break;case"right":n[1]="left",s[0]=a;break}var c;return n[0]&&n[1]?c=n.join("-"):n[0]?c=n[0]:n[1]?c=n[1]:c="center",{anchor:c,offset:s}}}}),dR=He({"src/traces/scattermap/convert.js"(Y,G){var d=Hi(),x=Gr(),A=lo().BADNUM,E=np(),e=Kl(),t=vo(),r=B0(),o=Rl(),a=VT().isSupportedFont,i=HT(),n=Ph().appendArrayPointValue,s=yl().NEWLINES,c=yl().BR_TAG_ALL;G.exports=function(_,w){var p=w[0].trace,u=p.visible===!0&&p._length!==0,g=p.fill!=="none",m=o.hasLines(p),R=o.hasMarkers(p),P=o.hasText(p),z=R&&p.marker.symbol==="circle",F=R&&p.marker.symbol!=="circle",B=p.cluster&&p.cluster.enabled,O=f("fill"),L=f("line"),N=f("circle"),U=f("symbol"),Z={fill:O,line:L,circle:N,symbol:U};if(!u)return Z;var Q;if((g||m)&&(Q=E.calcTraceToLineCoords(w)),g&&(O.geojson=E.makePolygon(Q),O.layout.visibility="visible",x.extendFlat(O.paint,{"fill-color":p.fillcolor})),m&&(L.geojson=E.makeLine(Q),L.layout.visibility="visible",x.extendFlat(L.paint,{"line-width":p.line.width,"line-color":p.line.color,"line-opacity":p.opacity})),z){var ue=v(w);N.geojson=ue.geojson,N.layout.visibility="visible",B&&(N.filter=["!",["has","point_count"]],Z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":b(p.cluster.color,p.cluster.step),"circle-radius":b(p.cluster.size,p.cluster.step),"circle-opacity":b(p.cluster.opacity,p.cluster.step)}},Z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":S(p),"text-size":12}}),x.extendFlat(N.paint,{"circle-color":ue.mcc,"circle-radius":ue.mrc,"circle-opacity":ue.mo})}if(z&&B&&(N.filter=["!",["has","point_count"]]),(F||P)&&(U.geojson=h(w,_),x.extendFlat(U.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),F&&(x.extendFlat(U.layout,{"icon-size":p.marker.size/10}),"angle"in p.marker&&p.marker.angle!=="auto"&&x.extendFlat(U.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),U.layout["icon-allow-overlap"]=p.marker.allowoverlap,x.extendFlat(U.paint,{"icon-opacity":p.opacity*p.marker.opacity,"icon-color":p.marker.color})),P)){var oe=(p.marker||{}).size,le=i(p.textposition,oe);x.extendFlat(U.layout,{"text-size":p.textfont.size,"text-anchor":le.anchor,"text-offset":le.offset,"text-font":S(p)}),x.extendFlat(U.paint,{"text-color":p.textfont.color,"text-opacity":p.opacity})}return Z};function f(M){return{type:M,geojson:E.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function v(M){var _=M[0].trace,w=_.marker,p=_.selectedpoints,u=x.isArrayOrTypedArray(w.color),g=x.isArrayOrTypedArray(w.size),m=x.isArrayOrTypedArray(w.opacity),R;function P(oe){return _.opacity*oe}function z(oe){return oe/2}var F;u&&(e.hasColorscale(_,"marker")?F=e.makeColorScaleFuncFromTrace(w):F=x.identity);var B;g&&(B=r(_));var O;m&&(O=function(oe){var le=d(oe)?+x.constrain(oe,0,1):0;return P(le)});var L=[];for(R=0;R850?R+=" Black":u>750?R+=" Extra Bold":u>650?R+=" Bold":u>550?R+=" Semi Bold":u>450?R+=" Medium":u>350?R+=" Regular":u>250?R+=" Light":u>150?R+=" Extra Light":R+=" Thin"):g.slice(0,2).join(" ")==="Open Sans"?(R="Open Sans",u>750?R+=" Extrabold":u>650?R+=" Bold":u>550?R+=" Semibold":u>350?R+=" Regular":R+=" Light"):g.slice(0,3).join(" ")==="Klokantech Noto Sans"&&(R="Klokantech Noto Sans",g[3]==="CJK"&&(R+=" CJK"),R+=u>500?" Bold":" Regular")),m&&(R+=" Italic"),R==="Open Sans Regular Italic"?R="Open Sans Italic":R==="Open Sans Regular Bold"?R="Open Sans Bold":R==="Open Sans Regular Bold Italic"?R="Open Sans Bold Italic":R==="Klokantech Noto Sans Regular Italic"&&(R="Klokantech Noto Sans Italic"),a(R)||(R=w);var P=R.split(", ");return P}}}),pR=He({"src/traces/scattermap/plot.js"(Y,G){var d=Gr(),x=dR(),A=up().traceLayerPrefix,E={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function e(r,o,a,i){this.type="scattermap",this.subplot=r,this.uid=o,this.clusterEnabled=a,this.isHidden=i,this.sourceIds={fill:"source-"+o+"-fill",line:"source-"+o+"-line",circle:"source-"+o+"-circle",symbol:"source-"+o+"-symbol",cluster:"source-"+o+"-circle",clusterCount:"source-"+o+"-circle"},this.layerIds={fill:A+o+"-fill",line:A+o+"-line",circle:A+o+"-circle",symbol:A+o+"-symbol",cluster:A+o+"-cluster",clusterCount:A+o+"-cluster-count"},this.below=null}var t=e.prototype;t.addSource=function(r,o,a){var i={type:"geojson",data:o.geojson};a&&a.enabled&&d.extendFlat(i,{cluster:!0,clusterMaxZoom:a.maxzoom});var n=this.subplot.map.getSource(this.sourceIds[r]);n?n.setData(o.geojson):this.subplot.map.addSource(this.sourceIds[r],i)},t.setSourceData=function(r,o){this.subplot.map.getSource(this.sourceIds[r]).setData(o.geojson)},t.addLayer=function(r,o,a){var i={type:o.type,id:this.layerIds[r],source:this.sourceIds[r],layout:o.layout,paint:o.paint};o.filter&&(i.filter=o.filter);for(var n=this.layerIds[r],s,c=this.subplot.getMapLayers(),f=0;f=0;m--){var R=g[m];n.removeLayer(h.layerIds[R])}u||n.removeSource(h.sourceIds.circle)}function y(u){for(var g=E.nonCluster,m=0;m=0;m--){var R=g[m];n.removeLayer(h.layerIds[R]),u||n.removeSource(h.sourceIds[R])}}function S(u){v?l(u):b(u)}function M(u){f?T(u):y(u)}function _(){for(var u=f?E.cluster:E.nonCluster,g=0;g=0;i--){var n=a[i];o.removeLayer(this.layerIds[n]),o.removeSource(this.sourceIds[n])}},G.exports=function(o,a){var i=a[0].trace,n=i.cluster&&i.cluster.enabled,s=i.visible!==!0,c=new e(o,i.uid,n,s),f=x(o.gd,a),v=c.below=o.belowLookup["trace-"+i.uid],h,T,l;if(n)for(c.addSource("circle",f.circle,i.cluster),h=0;h=0?Math.floor((i+180)/360):Math.ceil((i-180)/360),M=S*360,_=i-M;function w(B){var O=B.lonlat;if(O[0]===e||y&&T.indexOf(B.i+1)===-1)return 1/0;var L=x.modHalf(O[0],360),N=O[1],U=h.project([L,N]),Z=U.x-f.c2p([_,N]),Q=U.y-v.c2p([L,n]),ue=Math.max(3,B.mrc||0);return Math.max(Math.sqrt(Z*Z+Q*Q)-ue,1-3/ue)}if(d.getClosest(s,w,a),a.index!==!1){var p=s[a.index],u=p.lonlat,g=[x.modHalf(u[0],360)+M,u[1]],m=f.c2p(g),R=v.c2p(g),P=p.mrc||1;a.x0=m-P,a.x1=m+P,a.y0=R-P,a.y1=R+P;var z={};z[c.subplot]={_subplot:h};var F=c._module.formatLabels(p,c,z);return a.lonLabel=F.lonLabel,a.latLabel=F.latLabel,a.color=A(c,p),a.extraText=o(c,p,s[0].t.labels),a.hovertemplate=c.hovertemplate,[a]}}function o(a,i,n){if(a.hovertemplate)return;var s=i.hi||a.hoverinfo,c=s.split("+"),f=c.indexOf("all")!==-1,v=c.indexOf("lon")!==-1,h=c.indexOf("lat")!==-1,T=i.lonlat,l=[];function y(b){return b+"°"}return f||v&&h?l.push("("+y(T[1])+", "+y(T[0])+")"):v?l.push(n.lon+y(T[0])):h&&l.push(n.lat+y(T[1])),(f||c.indexOf("text")!==-1)&&E(i,a,l),l.join("
")}G.exports={hoverPoints:r,getExtraText:o}}}),gR=He({"src/traces/scattermap/event_data.js"(Y,G){G.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x}}}),yR=He({"src/traces/scattermap/select.js"(Y,G){var d=Gr(),x=Rl(),A=lo().BADNUM;G.exports=function(e,t){var r=e.cd,o=e.xaxis,a=e.yaxis,i=[],n=r[0].trace,s;if(!x.hasMarkers(n))return[];if(t===!1)for(s=0;s1)return 1;for(var K=H,he=0;he<8;he++){var Ee=this.sampleCurveX(K)-H;if(Math.abs(Ee)Ee?Ve=K:nt=K,K=.5*(nt-Ve)+Ve;return K},solve:function(H,D){return this.sampleCurveY(this.solveCurveX(H,D))}};var c=r(n);let f,v;function h(){return f==null&&(f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),f}function T(){if(v==null&&(v=!1,h())){const D=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(D){for(let he=0;he<5*5;he++){const Ee=4*he;D.fillStyle=`rgb(${Ee},${Ee+1},${Ee+2})`,D.fillRect(he%5,Math.floor(he/5),1,1)}const K=D.getImageData(0,0,5,5).data;for(let he=0;he<5*5*4;he++)if(he%4!=3&&K[he]!==he){v=!0;break}}}return v||!1}function l(H,D,K,he){const Ee=new c(H,D,K,he);return Be=>Ee.solve(Be)}const y=l(.25,.1,.25,1);function b(H,D,K){return Math.min(K,Math.max(D,H))}function S(H,D,K){const he=K-D,Ee=((H-D)%he+he)%he+D;return Ee===D?K:Ee}function M(H,...D){for(const K of D)for(const he in K)H[he]=K[he];return H}let _=1;function w(H,D,K){const he={};for(const Ee in H)he[Ee]=D.call(this,H[Ee],Ee,H);return he}function p(H,D,K){const he={};for(const Ee in H)D.call(this,H[Ee],Ee,H)&&(he[Ee]=H[Ee]);return he}function u(H){return Array.isArray(H)?H.map(u):typeof H=="object"&&H?w(H,u):H}const g={};function m(H){g[H]||(typeof console<"u"&&console.warn(H),g[H]=!0)}function R(H,D,K){return(K.y-H.y)*(D.x-H.x)>(D.y-H.y)*(K.x-H.x)}function P(H){return typeof WorkerGlobalScope<"u"&&H!==void 0&&H instanceof WorkerGlobalScope}let z=null;function F(H){return typeof ImageBitmap<"u"&&H instanceof ImageBitmap}const B="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function O(H,D,K,he,Ee){return t(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const Be=new VideoFrame(H,{timestamp:0});try{const Ve=Be==null?void 0:Be.format;if(!Ve||!Ve.startsWith("BGR")&&!Ve.startsWith("RGB"))throw new Error(`Unrecognized format ${Ve}`);const nt=Ve.startsWith("BGR"),mt=new Uint8ClampedArray(he*Ee*4);if(yield Be.copyTo(mt,function(Pt,Xt,er,br,Rr){const jr=4*Math.max(-Xt,0),Yr=(Math.max(0,er)-er)*br*4+jr,ca=4*br,Ca=Math.max(0,Xt),un=Math.max(0,er);return{rect:{x:Ca,y:un,width:Math.min(Pt.width,Xt+br)-Ca,height:Math.min(Pt.height,er+Rr)-un},layout:[{offset:Yr,stride:ca}]}}(H,D,K,he,Ee)),nt)for(let Pt=0;PtP(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,J=function(H,D){if(/:\/\//.test(H.url)&&!/^https?:|^file:/.test(H.url)){const he=ue(H.url);if(he)return he(H,D);if(P(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:H,targetMapId:oe},D)}if(!(/^file:/.test(K=H.url)||/^file:/.test(j())&&!/^\w+:/.test(K))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(he,Ee){return t(this,void 0,void 0,function*(){const Be=new Request(he.url,{method:he.method||"GET",body:he.body,credentials:he.credentials,headers:he.headers,cache:he.cache,referrer:j(),signal:Ee.signal});he.type!=="json"||Be.headers.has("Accept")||Be.headers.set("Accept","application/json");const Ve=yield fetch(Be);if(!Ve.ok){const Pt=yield Ve.blob();throw new le(Ve.status,Ve.statusText,he.url,Pt)}let nt;nt=he.type==="arrayBuffer"||he.type==="image"?Ve.arrayBuffer():he.type==="json"?Ve.json():Ve.text();const mt=yield nt;if(Ee.signal.aborted)throw Z();return{data:mt,cacheControl:Ve.headers.get("Cache-Control"),expires:Ve.headers.get("Expires")}})}(H,D);if(P(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:H,mustQueue:!0,targetMapId:oe},D)}var K;return function(he,Ee){return new Promise((Be,Ve)=>{var nt;const mt=new XMLHttpRequest;mt.open(he.method||"GET",he.url,!0),he.type!=="arrayBuffer"&&he.type!=="image"||(mt.responseType="arraybuffer");for(const Pt in he.headers)mt.setRequestHeader(Pt,he.headers[Pt]);he.type==="json"&&(mt.responseType="text",!((nt=he.headers)===null||nt===void 0)&&nt.Accept||mt.setRequestHeader("Accept","application/json")),mt.withCredentials=he.credentials==="include",mt.onerror=()=>{Ve(new Error(mt.statusText))},mt.onload=()=>{if(!Ee.signal.aborted)if((mt.status>=200&&mt.status<300||mt.status===0)&&mt.response!==null){let Pt=mt.response;if(he.type==="json")try{Pt=JSON.parse(mt.response)}catch(Xt){return void Ve(Xt)}Be({data:Pt,cacheControl:mt.getResponseHeader("Cache-Control"),expires:mt.getResponseHeader("Expires")})}else{const Pt=new Blob([mt.response],{type:mt.getResponseHeader("Content-Type")});Ve(new le(mt.status,mt.statusText,he.url,Pt))}},Ee.signal.addEventListener("abort",()=>{mt.abort(),Ve(Z())}),mt.send(he.body)})}(H,D)};function $(H){if(!H||H.indexOf("://")<=0||H.indexOf("data:image/")===0||H.indexOf("blob:")===0)return!0;const D=new URL(H),K=window.location;return D.protocol===K.protocol&&D.host===K.host}function X(H,D,K){K[H]&&K[H].indexOf(D)!==-1||(K[H]=K[H]||[],K[H].push(D))}function re(H,D,K){if(K&&K[H]){const he=K[H].indexOf(D);he!==-1&&K[H].splice(he,1)}}class ee{constructor(D,K={}){M(this,K),this.type=D}}class q extends ee{constructor(D,K={}){super("error",M({error:D},K))}}class ae{on(D,K){return this._listeners=this._listeners||{},X(D,K,this._listeners),this}off(D,K){return re(D,K,this._listeners),re(D,K,this._oneTimeListeners),this}once(D,K){return K?(this._oneTimeListeners=this._oneTimeListeners||{},X(D,K,this._oneTimeListeners),this):new Promise(he=>this.once(D,he))}fire(D,K){typeof D=="string"&&(D=new ee(D,K||{}));const he=D.type;if(this.listens(he)){D.target=this;const Ee=this._listeners&&this._listeners[he]?this._listeners[he].slice():[];for(const nt of Ee)nt.call(this,D);const Be=this._oneTimeListeners&&this._oneTimeListeners[he]?this._oneTimeListeners[he].slice():[];for(const nt of Be)re(he,nt,this._oneTimeListeners),nt.call(this,D);const Ve=this._eventedParent;Ve&&(M(D,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),Ve.fire(D))}else D instanceof q&&console.error(D.error);return this}listens(D){return this._listeners&&this._listeners[D]&&this._listeners[D].length>0||this._oneTimeListeners&&this._oneTimeListeners[D]&&this._oneTimeListeners[D].length>0||this._eventedParent&&this._eventedParent.listens(D)}setEventedParent(D,K){return this._eventedParent=D,this._eventedParentData=K,this}}var ie={$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"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:{},"viewport-glyph":{},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-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},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"}}};const fe=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function we(H,D){const K={};for(const he in H)he!=="ref"&&(K[he]=H[he]);return fe.forEach(he=>{he in D&&(K[he]=D[he])}),K}function Ae(H,D){if(Array.isArray(H)){if(!Array.isArray(D)||H.length!==D.length)return!1;for(let K=0;K`:H.itemType.kind==="value"?"array":`array<${D}>`}return H.kind}const Oe=[rt,Je,At,St,Rt,Mr,Ut,ze(ir),fr,dr,pt];function ve(H,D){if(D.kind==="error")return null;if(H.kind==="array"){if(D.kind==="array"&&(D.N===0&&D.itemType.kind==="value"||!ve(H.itemType,D.itemType))&&(typeof H.N!="number"||H.N===D.N))return null}else{if(H.kind===D.kind)return null;if(H.kind==="value"){for(const K of Oe)if(!ve(K,D))return null}}return`Expected ${Ge(H)} but found ${Ge(D)} instead.`}function ge(H,D){return D.some(K=>K.kind===H.kind)}function be(H,D){return D.some(K=>K==="null"?H===null:K==="array"?Array.isArray(H):K==="object"?H&&!Array.isArray(H)&&typeof H=="object":K===typeof H)}function Pe(H,D){return H.kind==="array"&&D.kind==="array"?H.itemType.kind===D.itemType.kind&&typeof H.N=="number":H.kind===D.kind}const We=.96422,ct=.82521,_t=4/29,Mt=6/29,Nt=3*Mt*Mt,Bt=Mt*Mt*Mt,qt=Math.PI/180,Zt=180/Math.PI;function lr(H){return(H%=360)<0&&(H+=360),H}function ta([H,D,K,he]){let Ee,Be;const Ve=wa((.2225045*(H=da(H))+.7168786*(D=da(D))+.0606169*(K=da(K)))/1);H===D&&D===K?Ee=Be=Ve:(Ee=wa((.4360747*H+.3850649*D+.1430804*K)/We),Be=wa((.0139322*H+.0971045*D+.7141733*K)/ct));const nt=116*Ve-16;return[nt<0?0:nt,500*(Ee-Ve),200*(Ve-Be),he]}function da(H){return H<=.04045?H/12.92:Math.pow((H+.055)/1.055,2.4)}function wa(H){return H>Bt?Math.pow(H,1/3):H/Nt+_t}function ma([H,D,K,he]){let Ee=(H+16)/116,Be=isNaN(D)?Ee:Ee+D/500,Ve=isNaN(K)?Ee:Ee-K/200;return Ee=1*va(Ee),Be=We*va(Be),Ve=ct*va(Ve),[Ia(3.1338561*Be-1.6168667*Ee-.4906146*Ve),Ia(-.9787684*Be+1.9161415*Ee+.033454*Ve),Ia(.0719453*Be-.2289914*Ee+1.4052427*Ve),he]}function Ia(H){return(H=H<=.00304?12.92*H:1.055*Math.pow(H,1/2.4)-.055)<0?0:H>1?1:H}function va(H){return H>Mt?H*H*H:Nt*(H-_t)}function La(H){return parseInt(H.padEnd(2,H),16)/255}function Ka(H,D){return Vt(D?H/100:H,0,1)}function Vt(H,D,K){return Math.min(Math.max(D,H),K)}function Lt(H){return!H.some(Number.isNaN)}const jt={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]};class Ot{constructor(D,K,he,Ee=1,Be=!0){this.r=D,this.g=K,this.b=he,this.a=Ee,Be||(this.r*=Ee,this.g*=Ee,this.b*=Ee,Ee||this.overwriteGetter("rgb",[D,K,he,Ee]))}static parse(D){if(D instanceof Ot)return D;if(typeof D!="string")return;const K=function(he){if((he=he.toLowerCase().trim())==="transparent")return[0,0,0,0];const Ee=jt[he];if(Ee){const[Ve,nt,mt]=Ee;return[Ve/255,nt/255,mt/255,1]}if(he.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(he)){const Ve=he.length<6?1:2;let nt=1;return[La(he.slice(nt,nt+=Ve)),La(he.slice(nt,nt+=Ve)),La(he.slice(nt,nt+=Ve)),La(he.slice(nt,nt+Ve)||"ff")]}if(he.startsWith("rgb")){const Ve=he.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Ve){const[nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca,un]=Ve,Ha=[Xt||" ",Rr||" ",ca].join("");if(Ha===" "||Ha===" /"||Ha===",,"||Ha===",,,"){const rn=[Pt,br,Yr].join(""),Sn=rn==="%%%"?100:rn===""?255:0;if(Sn){const $n=[Vt(+mt/Sn,0,1),Vt(+er/Sn,0,1),Vt(+jr/Sn,0,1),Ca?Ka(+Ca,un):1];if(Lt($n))return $n}}return}}const Be=he.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(Be){const[Ve,nt,mt,Pt,Xt,er,br,Rr,jr]=Be,Yr=[mt||" ",Xt||" ",br].join("");if(Yr===" "||Yr===" /"||Yr===",,"||Yr===",,,"){const ca=[+nt,Vt(+Pt,0,100),Vt(+er,0,100),Rr?Ka(+Rr,jr):1];if(Lt(ca))return function([Ca,un,Ha,rn]){function Sn($n){const Oi=($n+Ca/30)%12,qo=un*Math.min(Ha,1-Ha);return Ha-qo*Math.max(-1,Math.min(Oi-3,9-Oi,1))}return Ca=lr(Ca),un/=100,Ha/=100,[Sn(0),Sn(8),Sn(4),rn]}(ca)}}}(D);return K?new Ot(...K,!1):void 0}get rgb(){const{r:D,g:K,b:he,a:Ee}=this,Be=Ee||1/0;return this.overwriteGetter("rgb",[D/Be,K/Be,he/Be,Ee])}get hcl(){return this.overwriteGetter("hcl",function(D){const[K,he,Ee,Be]=ta(D),Ve=Math.sqrt(he*he+Ee*Ee);return[Math.round(1e4*Ve)?lr(Math.atan2(Ee,he)*Zt):NaN,Ve,K,Be]}(this.rgb))}get lab(){return this.overwriteGetter("lab",ta(this.rgb))}overwriteGetter(D,K){return Object.defineProperty(this,D,{value:K}),K}toString(){const[D,K,he,Ee]=this.rgb;return`rgba(${[D,K,he].map(Be=>Math.round(255*Be)).join(",")},${Ee})`}}Ot.black=new Ot(0,0,0,1),Ot.white=new Ot(1,1,1,1),Ot.transparent=new Ot(0,0,0,0),Ot.red=new Ot(1,0,0,1);class gr{constructor(D,K,he){this.sensitivity=D?K?"variant":"case":K?"accent":"base",this.locale=he,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(D,K){return this.collator.compare(D,K)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Br{constructor(D,K,he,Ee,Be){this.text=D,this.image=K,this.scale=he,this.fontStack=Ee,this.textColor=Be}}class na{constructor(D){this.sections=D}static fromString(D){return new na([new Br(D,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(D=>D.text.length!==0||D.image&&D.image.name.length!==0)}static factory(D){return D instanceof na?D:na.fromString(D)}toString(){return this.sections.length===0?"":this.sections.map(D=>D.text).join("")}}class Ur{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof Ur)return D;if(typeof D=="number")return new Ur([D,D,D,D]);if(Array.isArray(D)&&!(D.length<1||D.length>4)){for(const K of D)if(typeof K!="number")return;switch(D.length){case 1:D=[D[0],D[0],D[0],D[0]];break;case 2:D=[D[0],D[1],D[0],D[1]];break;case 3:D=[D[0],D[1],D[2],D[1]]}return new Ur(D)}}toString(){return JSON.stringify(this.values)}}const ga=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Aa{constructor(D){this.values=D.slice()}static parse(D){if(D instanceof Aa)return D;if(Array.isArray(D)&&!(D.length<1)&&D.length%2==0){for(let K=0;K=0&&H<=255&&typeof D=="number"&&D>=0&&D<=255&&typeof K=="number"&&K>=0&&K<=255?he===void 0||typeof he=="number"&&he>=0&&he<=1?null:`Invalid rgba value [${[H,D,K,he].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof he=="number"?[H,D,K,he]:[H,D,K]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Oa(H){if(H===null||typeof H=="string"||typeof H=="boolean"||typeof H=="number"||H instanceof Ot||H instanceof gr||H instanceof na||H instanceof Ur||H instanceof Aa||H instanceof Pa)return!0;if(Array.isArray(H)){for(const D of H)if(!Oa(D))return!1;return!0}if(typeof H=="object"){for(const D in H)if(!Oa(H[D]))return!1;return!0}return!1}function dt(H){if(H===null)return rt;if(typeof H=="string")return At;if(typeof H=="boolean")return St;if(typeof H=="number")return Je;if(H instanceof Ot)return Rt;if(H instanceof gr)return ar;if(H instanceof na)return Mr;if(H instanceof Ur)return fr;if(H instanceof Aa)return pt;if(H instanceof Pa)return dr;if(Array.isArray(H)){const D=H.length;let K;for(const he of H){const Ee=dt(he);if(K){if(K===Ee)continue;K=ir;break}K=Ee}return ze(K||ir,D)}return Ut}function vt(H){const D=typeof H;return H===null?"":D==="string"||D==="number"||D==="boolean"?String(H):H instanceof Ot||H instanceof na||H instanceof Ur||H instanceof Aa||H instanceof Pa?H.toString():JSON.stringify(H)}class Lr{constructor(D,K){this.type=D,this.value=K}static parse(D,K){if(D.length!==2)return K.error(`'literal' expression requires exactly one argument, but found ${D.length-1} instead.`);if(!Oa(D[1]))return K.error("invalid value");const he=D[1];let Ee=dt(he);const Be=K.expectedType;return Ee.kind!=="array"||Ee.N!==0||!Be||Be.kind!=="array"||typeof Be.N=="number"&&Be.N!==0||(Ee=Be),new Lr(Ee,he)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Er{constructor(D){this.name="ExpressionEvaluationError",this.message=D}toJSON(){return this.message}}const _r={string:At,number:Je,boolean:St,object:Ut};class yr{constructor(D,K){this.type=D,this.args=K}static parse(D,K){if(D.length<2)return K.error("Expected at least one argument.");let he,Ee=1;const Be=D[0];if(Be==="array"){let nt,mt;if(D.length>2){const Pt=D[1];if(typeof Pt!="string"||!(Pt in _r)||Pt==="object")return K.error('The item type argument of "array" must be one of string, number, boolean',1);nt=_r[Pt],Ee++}else nt=ir;if(D.length>3){if(D[2]!==null&&(typeof D[2]!="number"||D[2]<0||D[2]!==Math.floor(D[2])))return K.error('The length argument to "array" must be a positive integer literal',2);mt=D[2],Ee++}he=ze(nt,mt)}else{if(!_r[Be])throw new Error(`Types doesn't contain name = ${Be}`);he=_r[Be]}const Ve=[];for(;EeD.outputDefined())}}const kr={"to-boolean":St,"to-color":Rt,"to-number":Je,"to-string":At};class zr{constructor(D,K){this.type=D,this.args=K}static parse(D,K){if(D.length<2)return K.error("Expected at least one argument.");const he=D[0];if(!kr[he])throw new Error(`Can't parse ${he} as it is not part of the known types`);if((he==="to-boolean"||he==="to-string")&&D.length!==2)return K.error("Expected one argument.");const Ee=kr[he],Be=[];for(let Ve=1;Ve4?`Invalid rbga value ${JSON.stringify(K)}: expected an array containing either three or four numeric values.`:sa(K[0],K[1],K[2],K[3]),!he))return new Ot(K[0]/255,K[1]/255,K[2]/255,K[3])}throw new Er(he||`Could not parse color from value '${typeof K=="string"?K:JSON.stringify(K)}'`)}case"padding":{let K;for(const he of this.args){K=he.evaluate(D);const Ee=Ur.parse(K);if(Ee)return Ee}throw new Er(`Could not parse padding from value '${typeof K=="string"?K:JSON.stringify(K)}'`)}case"variableAnchorOffsetCollection":{let K;for(const he of this.args){K=he.evaluate(D);const Ee=Aa.parse(K);if(Ee)return Ee}throw new Er(`Could not parse variableAnchorOffsetCollection from value '${typeof K=="string"?K:JSON.stringify(K)}'`)}case"number":{let K=null;for(const he of this.args){if(K=he.evaluate(D),K===null)return 0;const Ee=Number(K);if(!isNaN(Ee))return Ee}throw new Er(`Could not convert ${JSON.stringify(K)} to number.`)}case"formatted":return na.fromString(vt(this.args[0].evaluate(D)));case"resolvedImage":return Pa.fromString(vt(this.args[0].evaluate(D)));default:return vt(this.args[0].evaluate(D))}}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}const Pr=["Unknown","Point","LineString","Polygon"];class Hr{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Pr[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(D){let K=this._parseColorCache[D];return K||(K=this._parseColorCache[D]=Ot.parse(D)),K}}class Zr{constructor(D,K,he=[],Ee,Be=new $e,Ve=[]){this.registry=D,this.path=he,this.key=he.map(nt=>`[${nt}]`).join(""),this.scope=Be,this.errors=Ve,this.expectedType=Ee,this._isConstant=K}parse(D,K,he,Ee,Be={}){return K?this.concat(K,he,Ee)._parse(D,Be):this._parse(D,Be)}_parse(D,K){function he(Ee,Be,Ve){return Ve==="assert"?new yr(Be,[Ee]):Ve==="coerce"?new zr(Be,[Ee]):Ee}if(D!==null&&typeof D!="string"&&typeof D!="boolean"&&typeof D!="number"||(D=["literal",D]),Array.isArray(D)){if(D.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const Ee=D[0];if(typeof Ee!="string")return this.error(`Expression name must be a string, but found ${typeof Ee} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const Be=this.registry[Ee];if(Be){let Ve=Be.parse(D,this);if(!Ve)return null;if(this.expectedType){const nt=this.expectedType,mt=Ve.type;if(nt.kind!=="string"&&nt.kind!=="number"&&nt.kind!=="boolean"&&nt.kind!=="object"&&nt.kind!=="array"||mt.kind!=="value")if(nt.kind!=="color"&&nt.kind!=="formatted"&&nt.kind!=="resolvedImage"||mt.kind!=="value"&&mt.kind!=="string")if(nt.kind!=="padding"||mt.kind!=="value"&&mt.kind!=="number"&&mt.kind!=="array")if(nt.kind!=="variableAnchorOffsetCollection"||mt.kind!=="value"&&mt.kind!=="array"){if(this.checkSubtype(nt,mt))return null}else Ve=he(Ve,nt,K.typeAnnotation||"coerce");else Ve=he(Ve,nt,K.typeAnnotation||"coerce");else Ve=he(Ve,nt,K.typeAnnotation||"coerce");else Ve=he(Ve,nt,K.typeAnnotation||"assert")}if(!(Ve instanceof Lr)&&Ve.type.kind!=="resolvedImage"&&this._isConstant(Ve)){const nt=new Hr;try{Ve=new Lr(Ve.type,Ve.evaluate(nt))}catch(mt){return this.error(mt.message),null}}return Ve}return this.error(`Unknown expression "${Ee}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(D===void 0?"'undefined' value invalid. Use null instead.":typeof D=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof D} instead.`)}concat(D,K,he){const Ee=typeof D=="number"?this.path.concat(D):this.path,Be=he?this.scope.concat(he):this.scope;return new Zr(this.registry,this._isConstant,Ee,K||null,Be,this.errors)}error(D,...K){const he=`${this.key}${K.map(Ee=>`[${Ee}]`).join("")}`;this.errors.push(new Re(he,D))}checkSubtype(D,K){const he=ve(D,K);return he&&this.error(he),he}}class Jr{constructor(D,K){this.type=K.type,this.bindings=[].concat(D),this.result=K}evaluate(D){return this.result.evaluate(D)}eachChild(D){for(const K of this.bindings)D(K[1]);D(this.result)}static parse(D,K){if(D.length<4)return K.error(`Expected at least 3 arguments, but found ${D.length-1} instead.`);const he=[];for(let Be=1;Be=he.length)throw new Er(`Array index out of bounds: ${K} > ${he.length-1}.`);if(K!==Math.floor(K))throw new Er(`Array index must be an integer, but found ${K} instead.`);return he[K]}eachChild(D){D(this.index),D(this.input)}outputDefined(){return!1}}class mr{constructor(D,K){this.type=St,this.needle=D,this.haystack=K}static parse(D,K){if(D.length!==3)return K.error(`Expected 2 arguments, but found ${D.length-1} instead.`);const he=K.parse(D[1],1,ir),Ee=K.parse(D[2],2,ir);return he&&Ee?ge(he.type,[St,At,Je,rt,ir])?new mr(he,Ee):K.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(he.type)} instead`):null}evaluate(D){const K=this.needle.evaluate(D),he=this.haystack.evaluate(D);if(!he)return!1;if(!be(K,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(dt(K))} instead.`);if(!be(he,["string","array"]))throw new Er(`Expected second argument to be of type array or string, but found ${Ge(dt(he))} instead.`);return he.indexOf(K)>=0}eachChild(D){D(this.needle),D(this.haystack)}outputDefined(){return!0}}class $r{constructor(D,K,he){this.type=Je,this.needle=D,this.haystack=K,this.fromIndex=he}static parse(D,K){if(D.length<=2||D.length>=5)return K.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);const he=K.parse(D[1],1,ir),Ee=K.parse(D[2],2,ir);if(!he||!Ee)return null;if(!ge(he.type,[St,At,Je,rt,ir]))return K.error(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(he.type)} instead`);if(D.length===4){const Be=K.parse(D[3],3,Je);return Be?new $r(he,Ee,Be):null}return new $r(he,Ee)}evaluate(D){const K=this.needle.evaluate(D),he=this.haystack.evaluate(D);if(!be(K,["boolean","string","number","null"]))throw new Er(`Expected first argument to be of type boolean, string, number or null, but found ${Ge(dt(K))} instead.`);let Ee;if(this.fromIndex&&(Ee=this.fromIndex.evaluate(D)),be(he,["string"])){const Be=he.indexOf(K,Ee);return Be===-1?-1:[...he.slice(0,Be)].length}if(be(he,["array"]))return he.indexOf(K,Ee);throw new Er(`Expected second argument to be of type array or string, but found ${Ge(dt(he))} instead.`)}eachChild(D){D(this.needle),D(this.haystack),this.fromIndex&&D(this.fromIndex)}outputDefined(){return!1}}class oa{constructor(D,K,he,Ee,Be,Ve){this.inputType=D,this.type=K,this.input=he,this.cases=Ee,this.outputs=Be,this.otherwise=Ve}static parse(D,K){if(D.length<5)return K.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if(D.length%2!=1)return K.error("Expected an even number of arguments.");let he,Ee;K.expectedType&&K.expectedType.kind!=="value"&&(Ee=K.expectedType);const Be={},Ve=[];for(let Pt=2;PtNumber.MAX_SAFE_INTEGER)return br.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof jr=="number"&&Math.floor(jr)!==jr)return br.error("Numeric branch labels must be integer values.");if(he){if(br.checkSubtype(he,dt(jr)))return null}else he=dt(jr);if(Be[String(jr)]!==void 0)return br.error("Branch labels must be unique.");Be[String(jr)]=Ve.length}const Rr=K.parse(er,Pt,Ee);if(!Rr)return null;Ee=Ee||Rr.type,Ve.push(Rr)}const nt=K.parse(D[1],1,ir);if(!nt)return null;const mt=K.parse(D[D.length-1],D.length-1,Ee);return mt?nt.type.kind!=="value"&&K.concat(1).checkSubtype(he,nt.type)?null:new oa(he,Ee,nt,Be,Ve,mt):null}evaluate(D){const K=this.input.evaluate(D);return(dt(K)===this.inputType&&this.outputs[this.cases[K]]||this.otherwise).evaluate(D)}eachChild(D){D(this.input),this.outputs.forEach(D),D(this.otherwise)}outputDefined(){return this.outputs.every(D=>D.outputDefined())&&this.otherwise.outputDefined()}}class Sa{constructor(D,K,he){this.type=D,this.branches=K,this.otherwise=he}static parse(D,K){if(D.length<4)return K.error(`Expected at least 3 arguments, but found only ${D.length-1}.`);if(D.length%2!=0)return K.error("Expected an odd number of arguments.");let he;K.expectedType&&K.expectedType.kind!=="value"&&(he=K.expectedType);const Ee=[];for(let Ve=1;VeK.outputDefined())&&this.otherwise.outputDefined()}}class ya{constructor(D,K,he,Ee){this.type=D,this.input=K,this.beginIndex=he,this.endIndex=Ee}static parse(D,K){if(D.length<=2||D.length>=5)return K.error(`Expected 3 or 4 arguments, but found ${D.length-1} instead.`);const he=K.parse(D[1],1,ir),Ee=K.parse(D[2],2,Je);if(!he||!Ee)return null;if(!ge(he.type,[ze(ir),At,ir]))return K.error(`Expected first argument to be of type array or string, but found ${Ge(he.type)} instead`);if(D.length===4){const Be=K.parse(D[3],3,Je);return Be?new ya(he.type,he,Ee,Be):null}return new ya(he.type,he,Ee)}evaluate(D){const K=this.input.evaluate(D),he=this.beginIndex.evaluate(D);let Ee;if(this.endIndex&&(Ee=this.endIndex.evaluate(D)),be(K,["string"]))return[...K].slice(he,Ee).join("");if(be(K,["array"]))return K.slice(he,Ee);throw new Er(`Expected first argument to be of type array or string, but found ${Ge(dt(K))} instead.`)}eachChild(D){D(this.input),D(this.beginIndex),this.endIndex&&D(this.endIndex)}outputDefined(){return!1}}function ra(H,D){const K=H.length-1;let he,Ee,Be=0,Ve=K,nt=0;for(;Be<=Ve;)if(nt=Math.floor((Be+Ve)/2),he=H[nt],Ee=H[nt+1],he<=D){if(nt===K||DD))throw new Er("Input is not a number.");Ve=nt-1}return 0}class pa{constructor(D,K,he){this.type=D,this.input=K,this.labels=[],this.outputs=[];for(const[Ee,Be]of he)this.labels.push(Ee),this.outputs.push(Be)}static parse(D,K){if(D.length-1<4)return K.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return K.error("Expected an even number of arguments.");const he=K.parse(D[1],1,Je);if(!he)return null;const Ee=[];let Be=null;K.expectedType&&K.expectedType.kind!=="value"&&(Be=K.expectedType);for(let Ve=1;Ve=nt)return K.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',Pt);const er=K.parse(mt,Xt,Be);if(!er)return null;Be=Be||er.type,Ee.push([nt,er])}return new pa(Be,he,Ee)}evaluate(D){const K=this.labels,he=this.outputs;if(K.length===1)return he[0].evaluate(D);const Ee=this.input.evaluate(D);if(Ee<=K[0])return he[0].evaluate(D);const Be=K.length;return Ee>=K[Be-1]?he[Be-1].evaluate(D):he[ra(K,Ee)].evaluate(D)}eachChild(D){D(this.input);for(const K of this.outputs)D(K)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function pn(H){return H&&H.__esModule&&Object.prototype.hasOwnProperty.call(H,"default")?H.default:H}var Ga=qn;function qn(H,D,K,he){this.cx=3*H,this.bx=3*(K-H)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*D,this.by=3*(he-D)-this.cy,this.ay=1-this.cy-this.by,this.p1x=H,this.p1y=D,this.p2x=K,this.p2y=he}qn.prototype={sampleCurveX:function(H){return((this.ax*H+this.bx)*H+this.cx)*H},sampleCurveY:function(H){return((this.ay*H+this.by)*H+this.cy)*H},sampleCurveDerivativeX:function(H){return(3*this.ax*H+2*this.bx)*H+this.cx},solveCurveX:function(H,D){if(D===void 0&&(D=1e-6),H<0)return 0;if(H>1)return 1;for(var K=H,he=0;he<8;he++){var Ee=this.sampleCurveX(K)-H;if(Math.abs(Ee)Ee?Ve=K:nt=K,K=.5*(nt-Ve)+Ve;return K},solve:function(H,D){return this.sampleCurveY(this.solveCurveX(H,D))}};var Vn=pn(Ga);function di(H,D,K){return H+K*(D-H)}function yi(H,D,K){return H.map((he,Ee)=>di(he,D[Ee],K))}const Ci={number:di,color:function(H,D,K,he="rgb"){switch(he){case"rgb":{const[Ee,Be,Ve,nt]=yi(H.rgb,D.rgb,K);return new Ot(Ee,Be,Ve,nt,!1)}case"hcl":{const[Ee,Be,Ve,nt]=H.hcl,[mt,Pt,Xt,er]=D.hcl;let br,Rr;if(isNaN(Ee)||isNaN(mt))isNaN(Ee)?isNaN(mt)?br=NaN:(br=mt,Ve!==1&&Ve!==0||(Rr=Pt)):(br=Ee,Xt!==1&&Xt!==0||(Rr=Be));else{let un=mt-Ee;mt>Ee&&un>180?un-=360:mt180&&(un+=360),br=Ee+K*un}const[jr,Yr,ca,Ca]=function([un,Ha,rn,Sn]){return un=isNaN(un)?0:un*qt,ma([rn,Math.cos(un)*Ha,Math.sin(un)*Ha,Sn])}([br,Rr??di(Be,Pt,K),di(Ve,Xt,K),di(nt,er,K)]);return new Ot(jr,Yr,ca,Ca,!1)}case"lab":{const[Ee,Be,Ve,nt]=ma(yi(H.lab,D.lab,K));return new Ot(Ee,Be,Ve,nt,!1)}}},array:yi,padding:function(H,D,K){return new Ur(yi(H.values,D.values,K))},variableAnchorOffsetCollection:function(H,D,K){const he=H.values,Ee=D.values;if(he.length!==Ee.length)throw new Er(`Cannot interpolate values of different length. from: ${H.toString()}, to: ${D.toString()}`);const Be=[];for(let Ve=0;Vetypeof Xt!="number"||Xt<0||Xt>1))return K.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);Ee={name:"cubic-bezier",controlPoints:Pt}}}if(D.length-1<4)return K.error(`Expected at least 4 arguments, but found only ${D.length-1}.`);if((D.length-1)%2!=0)return K.error("Expected an even number of arguments.");if(Be=K.parse(Be,2,Je),!Be)return null;const nt=[];let mt=null;he==="interpolate-hcl"||he==="interpolate-lab"?mt=Rt:K.expectedType&&K.expectedType.kind!=="value"&&(mt=K.expectedType);for(let Pt=0;Pt=Xt)return K.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',br);const jr=K.parse(er,Rr,mt);if(!jr)return null;mt=mt||jr.type,nt.push([Xt,jr])}return Pe(mt,Je)||Pe(mt,Rt)||Pe(mt,fr)||Pe(mt,pt)||Pe(mt,ze(Je))?new ci(mt,he,Ee,Be,nt):K.error(`Type ${Ge(mt)} is not interpolatable.`)}evaluate(D){const K=this.labels,he=this.outputs;if(K.length===1)return he[0].evaluate(D);const Ee=this.input.evaluate(D);if(Ee<=K[0])return he[0].evaluate(D);const Be=K.length;if(Ee>=K[Be-1])return he[Be-1].evaluate(D);const Ve=ra(K,Ee),nt=ci.interpolationFactor(this.interpolation,Ee,K[Ve],K[Ve+1]),mt=he[Ve].evaluate(D),Pt=he[Ve+1].evaluate(D);switch(this.operator){case"interpolate":return Ci[this.type.kind](mt,Pt,nt);case"interpolate-hcl":return Ci.color(mt,Pt,nt,"hcl");case"interpolate-lab":return Ci.color(mt,Pt,nt,"lab")}}eachChild(D){D(this.input);for(const K of this.outputs)D(K)}outputDefined(){return this.outputs.every(D=>D.outputDefined())}}function ei(H,D,K,he){const Ee=he-K,Be=H-K;return Ee===0?0:D===1?Be/Ee:(Math.pow(D,Be)-1)/(Math.pow(D,Ee)-1)}class mi{constructor(D,K){this.type=D,this.args=K}static parse(D,K){if(D.length<2)return K.error("Expectected at least one argument.");let he=null;const Ee=K.expectedType;Ee&&Ee.kind!=="value"&&(he=Ee);const Be=[];for(const nt of D.slice(1)){const mt=K.parse(nt,1+Be.length,he,void 0,{typeAnnotation:"omit"});if(!mt)return null;he=he||mt.type,Be.push(mt)}if(!he)throw new Error("No output type");const Ve=Ee&&Be.some(nt=>ve(Ee,nt.type));return new mi(Ve?ir:he,Be)}evaluate(D){let K,he=null,Ee=0;for(const Be of this.args)if(Ee++,he=Be.evaluate(D),he&&he instanceof Pa&&!he.available&&(K||(K=he.name),he=null,Ee===this.args.length&&(he=K)),he!==null)break;return he}eachChild(D){this.args.forEach(D)}outputDefined(){return this.args.every(D=>D.outputDefined())}}function uo(H,D){return H==="=="||H==="!="?D.kind==="boolean"||D.kind==="string"||D.kind==="number"||D.kind==="null"||D.kind==="value":D.kind==="string"||D.kind==="number"||D.kind==="value"}function Lo(H,D,K,he){return he.compare(D,K)===0}function Wo(H,D,K){const he=H!=="=="&&H!=="!=";return class QA{constructor(Be,Ve,nt){this.type=St,this.lhs=Be,this.rhs=Ve,this.collator=nt,this.hasUntypedArgument=Be.type.kind==="value"||Ve.type.kind==="value"}static parse(Be,Ve){if(Be.length!==3&&Be.length!==4)return Ve.error("Expected two or three arguments.");const nt=Be[0];let mt=Ve.parse(Be[1],1,ir);if(!mt)return null;if(!uo(nt,mt.type))return Ve.concat(1).error(`"${nt}" comparisons are not supported for type '${Ge(mt.type)}'.`);let Pt=Ve.parse(Be[2],2,ir);if(!Pt)return null;if(!uo(nt,Pt.type))return Ve.concat(2).error(`"${nt}" comparisons are not supported for type '${Ge(Pt.type)}'.`);if(mt.type.kind!==Pt.type.kind&&mt.type.kind!=="value"&&Pt.type.kind!=="value")return Ve.error(`Cannot compare types '${Ge(mt.type)}' and '${Ge(Pt.type)}'.`);he&&(mt.type.kind==="value"&&Pt.type.kind!=="value"?mt=new yr(Pt.type,[mt]):mt.type.kind!=="value"&&Pt.type.kind==="value"&&(Pt=new yr(mt.type,[Pt])));let Xt=null;if(Be.length===4){if(mt.type.kind!=="string"&&Pt.type.kind!=="string"&&mt.type.kind!=="value"&&Pt.type.kind!=="value")return Ve.error("Cannot use collator to compare non-string types.");if(Xt=Ve.parse(Be[3],3,ar),!Xt)return null}return new QA(mt,Pt,Xt)}evaluate(Be){const Ve=this.lhs.evaluate(Be),nt=this.rhs.evaluate(Be);if(he&&this.hasUntypedArgument){const mt=dt(Ve),Pt=dt(nt);if(mt.kind!==Pt.kind||mt.kind!=="string"&&mt.kind!=="number")throw new Er(`Expected arguments for "${H}" to be (string, string) or (number, number), but found (${mt.kind}, ${Pt.kind}) instead.`)}if(this.collator&&!he&&this.hasUntypedArgument){const mt=dt(Ve),Pt=dt(nt);if(mt.kind!=="string"||Pt.kind!=="string")return D(Be,Ve,nt)}return this.collator?K(Be,Ve,nt,this.collator.evaluate(Be)):D(Be,Ve,nt)}eachChild(Be){Be(this.lhs),Be(this.rhs),this.collator&&Be(this.collator)}outputDefined(){return!0}}}const li=Wo("==",function(H,D,K){return D===K},Lo),Ii=Wo("!=",function(H,D,K){return D!==K},function(H,D,K,he){return!Lo(0,D,K,he)}),xi=Wo("<",function(H,D,K){return D",function(H,D,K){return D>K},function(H,D,K,he){return he.compare(D,K)>0}),So=Wo("<=",function(H,D,K){return D<=K},function(H,D,K,he){return he.compare(D,K)<=0}),Ro=Wo(">=",function(H,D,K){return D>=K},function(H,D,K,he){return he.compare(D,K)>=0});class Li{constructor(D,K,he){this.type=ar,this.locale=he,this.caseSensitive=D,this.diacriticSensitive=K}static parse(D,K){if(D.length!==2)return K.error("Expected one argument.");const he=D[1];if(typeof he!="object"||Array.isArray(he))return K.error("Collator options argument must be an object.");const Ee=K.parse(he["case-sensitive"]!==void 0&&he["case-sensitive"],1,St);if(!Ee)return null;const Be=K.parse(he["diacritic-sensitive"]!==void 0&&he["diacritic-sensitive"],1,St);if(!Be)return null;let Ve=null;return he.locale&&(Ve=K.parse(he.locale,1,At),!Ve)?null:new Li(Ee,Be,Ve)}evaluate(D){return new gr(this.caseSensitive.evaluate(D),this.diacriticSensitive.evaluate(D),this.locale?this.locale.evaluate(D):null)}eachChild(D){D(this.caseSensitive),D(this.diacriticSensitive),this.locale&&D(this.locale)}outputDefined(){return!1}}class Yi{constructor(D,K,he,Ee,Be){this.type=At,this.number=D,this.locale=K,this.currency=he,this.minFractionDigits=Ee,this.maxFractionDigits=Be}static parse(D,K){if(D.length!==3)return K.error("Expected two arguments.");const he=K.parse(D[1],1,Je);if(!he)return null;const Ee=D[2];if(typeof Ee!="object"||Array.isArray(Ee))return K.error("NumberFormat options argument must be an object.");let Be=null;if(Ee.locale&&(Be=K.parse(Ee.locale,1,At),!Be))return null;let Ve=null;if(Ee.currency&&(Ve=K.parse(Ee.currency,1,At),!Ve))return null;let nt=null;if(Ee["min-fraction-digits"]&&(nt=K.parse(Ee["min-fraction-digits"],1,Je),!nt))return null;let mt=null;return Ee["max-fraction-digits"]&&(mt=K.parse(Ee["max-fraction-digits"],1,Je),!mt)?null:new Yi(he,Be,Ve,nt,mt)}evaluate(D){return new Intl.NumberFormat(this.locale?this.locale.evaluate(D):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(D):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(D):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(D):void 0}).format(this.number.evaluate(D))}eachChild(D){D(this.number),this.locale&&D(this.locale),this.currency&&D(this.currency),this.minFractionDigits&&D(this.minFractionDigits),this.maxFractionDigits&&D(this.maxFractionDigits)}outputDefined(){return!1}}class bs{constructor(D){this.type=Mr,this.sections=D}static parse(D,K){if(D.length<2)return K.error("Expected at least one argument.");const he=D[1];if(!Array.isArray(he)&&typeof he=="object")return K.error("First argument must be an image or text section.");const Ee=[];let Be=!1;for(let Ve=1;Ve<=D.length-1;++Ve){const nt=D[Ve];if(Be&&typeof nt=="object"&&!Array.isArray(nt)){Be=!1;let mt=null;if(nt["font-scale"]&&(mt=K.parse(nt["font-scale"],1,Je),!mt))return null;let Pt=null;if(nt["text-font"]&&(Pt=K.parse(nt["text-font"],1,ze(At)),!Pt))return null;let Xt=null;if(nt["text-color"]&&(Xt=K.parse(nt["text-color"],1,Rt),!Xt))return null;const er=Ee[Ee.length-1];er.scale=mt,er.font=Pt,er.textColor=Xt}else{const mt=K.parse(D[Ve],1,ir);if(!mt)return null;const Pt=mt.type.kind;if(Pt!=="string"&&Pt!=="value"&&Pt!=="null"&&Pt!=="resolvedImage")return K.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");Be=!0,Ee.push({content:mt,scale:null,font:null,textColor:null})}}return new bs(Ee)}evaluate(D){return new na(this.sections.map(K=>{const he=K.content.evaluate(D);return dt(he)===dr?new Br("",he,null,null,null):new Br(vt(he),null,K.scale?K.scale.evaluate(D):null,K.font?K.font.evaluate(D).join(","):null,K.textColor?K.textColor.evaluate(D):null)}))}eachChild(D){for(const K of this.sections)D(K.content),K.scale&&D(K.scale),K.font&&D(K.font),K.textColor&&D(K.textColor)}outputDefined(){return!1}}class as{constructor(D){this.type=dr,this.input=D}static parse(D,K){if(D.length!==2)return K.error("Expected two arguments.");const he=K.parse(D[1],1,At);return he?new as(he):K.error("No image name provided.")}evaluate(D){const K=this.input.evaluate(D),he=Pa.fromString(K);return he&&D.availableImages&&(he.available=D.availableImages.indexOf(K)>-1),he}eachChild(D){D(this.input)}outputDefined(){return!1}}class fs{constructor(D){this.type=Je,this.input=D}static parse(D,K){if(D.length!==2)return K.error(`Expected 1 argument, but found ${D.length-1} instead.`);const he=K.parse(D[1],1);return he?he.type.kind!=="array"&&he.type.kind!=="string"&&he.type.kind!=="value"?K.error(`Expected argument of type string or array, but found ${Ge(he.type)} instead.`):new fs(he):null}evaluate(D){const K=this.input.evaluate(D);if(typeof K=="string")return[...K].length;if(Array.isArray(K))return K.length;throw new Er(`Expected value to be of type string or array, but found ${Ge(dt(K))} instead.`)}eachChild(D){D(this.input)}outputDefined(){return!1}}const Co=8192;function Qa(H,D){const K=(180+H[0])/360,he=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+H[1]*Math.PI/360)))/360,Ee=Math.pow(2,D.z);return[Math.round(K*Ee*Co),Math.round(he*Ee*Co)]}function Jn(H,D){const K=Math.pow(2,D.z);return[(Ee=(H[0]/Co+D.x)/K,360*Ee-180),(he=(H[1]/Co+D.y)/K,360/Math.PI*Math.atan(Math.exp((180-360*he)*Math.PI/180))-90)];var he,Ee}function Os(H,D){H[0]=Math.min(H[0],D[0]),H[1]=Math.min(H[1],D[1]),H[2]=Math.max(H[2],D[0]),H[3]=Math.max(H[3],D[1])}function ds(H,D){return!(H[0]<=D[0]||H[2]>=D[2]||H[1]<=D[1]||H[3]>=D[3])}function Ui(H,D,K){const he=H[0]-D[0],Ee=H[1]-D[1],Be=H[0]-K[0],Ve=H[1]-K[1];return he*Ve-Be*Ee==0&&he*Be<=0&&Ee*Ve<=0}function ms(H,D,K,he){return(Ee=[he[0]-K[0],he[1]-K[1]])[0]*(Be=[D[0]-H[0],D[1]-H[1]])[1]-Ee[1]*Be[0]!=0&&!(!Pi(H,D,K,he)||!Pi(K,he,H,D));var Ee,Be}function Mo(H,D,K){for(const he of K)for(let Ee=0;Ee(Ee=H)[1]!=(Ve=nt[mt+1])[1]>Ee[1]&&Ee[0]<(Ve[0]-Be[0])*(Ee[1]-Be[1])/(Ve[1]-Be[1])+Be[0]&&(he=!he)}var Ee,Be,Ve;return he}function Ks(H,D){for(const K of D)if(ws(H,K))return!0;return!1}function Rn(H,D){for(const K of H)if(!ws(K,D))return!1;for(let K=0;K0&&nt<0||Ve<0&&nt>0}function zo(H,D,K){const he=[];for(let Ee=0;EeK[2]){const Ee=.5*he;let Be=H[0]-K[0]>Ee?-he:K[0]-H[0]>Ee?he:0;Be===0&&(Be=H[0]-K[2]>Ee?-he:K[2]-H[0]>Ee?he:0),H[0]+=Be}Os(D,H)}function wl(H,D,K,he){const Ee=Math.pow(2,he.z)*Co,Be=[he.x*Co,he.y*Co],Ve=[];for(const nt of H)for(const mt of nt){const Pt=[mt.x+Be[0],mt.y+Be[1]];bi(Pt,D,K,Ee),Ve.push(Pt)}return Ve}function $l(H,D,K,he){const Ee=Math.pow(2,he.z)*Co,Be=[he.x*Co,he.y*Co],Ve=[];for(const mt of H){const Pt=[];for(const Xt of mt){const er=[Xt.x+Be[0],Xt.y+Be[1]];Os(D,er),Pt.push(er)}Ve.push(Pt)}if(D[2]-D[0]<=Ee/2){(nt=D)[0]=nt[1]=1/0,nt[2]=nt[3]=-1/0;for(const mt of Ve)for(const Pt of mt)bi(Pt,D,K,Ee)}var nt;return Ve}class Js{constructor(D,K){this.type=St,this.geojson=D,this.geometries=K}static parse(D,K){if(D.length!==2)return K.error(`'within' expression requires exactly one argument, but found ${D.length-1} instead.`);if(Oa(D[1])){const he=D[1];if(he.type==="FeatureCollection"){const Ee=[];for(const Be of he.features){const{type:Ve,coordinates:nt}=Be.geometry;Ve==="Polygon"&&Ee.push(nt),Ve==="MultiPolygon"&&Ee.push(...nt)}if(Ee.length)return new Js(he,{type:"MultiPolygon",coordinates:Ee})}else if(he.type==="Feature"){const Ee=he.geometry.type;if(Ee==="Polygon"||Ee==="MultiPolygon")return new Js(he,he.geometry)}else if(he.type==="Polygon"||he.type==="MultiPolygon")return new Js(he,he)}return K.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return function(K,he){const Ee=[1/0,1/0,-1/0,-1/0],Be=[1/0,1/0,-1/0,-1/0],Ve=K.canonicalID();if(he.type==="Polygon"){const nt=zo(he.coordinates,Be,Ve),mt=wl(K.geometry(),Ee,Be,Ve);if(!ds(Ee,Be))return!1;for(const Pt of mt)if(!ws(Pt,nt))return!1}if(he.type==="MultiPolygon"){const nt=wo(he.coordinates,Be,Ve),mt=wl(K.geometry(),Ee,Be,Ve);if(!ds(Ee,Be))return!1;for(const Pt of mt)if(!Ks(Pt,nt))return!1}return!0}(D,this.geometries);if(D.geometryType()==="LineString")return function(K,he){const Ee=[1/0,1/0,-1/0,-1/0],Be=[1/0,1/0,-1/0,-1/0],Ve=K.canonicalID();if(he.type==="Polygon"){const nt=zo(he.coordinates,Be,Ve),mt=$l(K.geometry(),Ee,Be,Ve);if(!ds(Ee,Be))return!1;for(const Pt of mt)if(!Rn(Pt,nt))return!1}if(he.type==="MultiPolygon"){const nt=wo(he.coordinates,Be,Ve),mt=$l(K.geometry(),Ee,Be,Ve);if(!ds(Ee,Be))return!1;for(const Pt of mt)if(!fo(Pt,nt))return!1}return!0}(D,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Ql=class{constructor(H=[],D=(K,he)=>Khe?1:0){if(this.data=H,this.length=this.data.length,this.compare=D,this.length>0)for(let K=(this.length>>1)-1;K>=0;K--)this._down(K)}push(H){this.data.push(H),this._up(this.length++)}pop(){if(this.length===0)return;const H=this.data[0],D=this.data.pop();return--this.length>0&&(this.data[0]=D,this._down(0)),H}peek(){return this.data[0]}_up(H){const{data:D,compare:K}=this,he=D[H];for(;H>0;){const Ee=H-1>>1,Be=D[Ee];if(K(he,Be)>=0)break;D[H]=Be,H=Ee}D[H]=he}_down(H){const{data:D,compare:K}=this,he=this.length>>1,Ee=D[H];for(;H=0)break;D[H]=D[Be],H=Be}D[H]=Ee}};function Ws(H,D,K,he,Ee){Is(H,D,K,he||H.length-1,Ee||Xu)}function Is(H,D,K,he,Ee){for(;he>K;){if(he-K>600){var Be=he-K+1,Ve=D-K+1,nt=Math.log(Be),mt=.5*Math.exp(2*nt/3),Pt=.5*Math.sqrt(nt*mt*(Be-mt)/Be)*(Ve-Be/2<0?-1:1);Is(H,D,Math.max(K,Math.floor(D-Ve*mt/Be+Pt)),Math.min(he,Math.floor(D+(Be-Ve)*mt/Be+Pt)),Ee)}var Xt=H[D],er=K,br=he;for(Dl(H,K,D),Ee(H[he],Xt)>0&&Dl(H,K,he);er0;)br--}Ee(H[K],Xt)===0?Dl(H,K,br):Dl(H,++br,he),br<=D&&(K=br+1),D<=br&&(he=br-1)}}function Dl(H,D,K){var he=H[D];H[D]=H[K],H[K]=he}function Xu(H,D){return HD?1:0}function Lu(H,D){if(H.length<=1)return[H];const K=[];let he,Ee;for(const Be of H){const Ve=kf(Be);Ve!==0&&(Be.area=Math.abs(Ve),Ee===void 0&&(Ee=Ve<0),Ee===Ve<0?(he&&K.push(he),he=[Be]):he.push(Be))}if(he&&K.push(he),D>1)for(let Be=0;Be1?(Pt=D[mt+1][0],Xt=D[mt+1][1]):Rr>0&&(Pt+=er/this.kx*Rr,Xt+=br/this.ky*Rr)),er=this.wrap(K[0]-Pt)*this.kx,br=(K[1]-Xt)*this.ky;const jr=er*er+br*br;jr180;)D-=360;return D}}function ml(H,D){return D[0]-H[0]}function fl(H){return H[1]-H[0]+1}function _l(H,D){return H[1]>=H[0]&&H[1]H[1])return[null,null];const K=fl(H);if(D){if(K===2)return[H,null];const Ee=Math.floor(K/2);return[[H[0],H[0]+Ee],[H[0]+Ee,H[1]]]}if(K===1)return[H,null];const he=Math.floor(K/2)-1;return[[H[0],H[0]+he],[H[0]+he+1,H[1]]]}function Ts(H,D){if(!_l(D,H.length))return[1/0,1/0,-1/0,-1/0];const K=[1/0,1/0,-1/0,-1/0];for(let he=D[0];he<=D[1];++he)Os(K,H[he]);return K}function Tl(H){const D=[1/0,1/0,-1/0,-1/0];for(const K of H)for(const he of K)Os(D,he);return D}function Ko(H){return H[0]!==-1/0&&H[1]!==-1/0&&H[2]!==1/0&&H[3]!==1/0}function Cs(H,D,K){if(!Ko(H)||!Ko(D))return NaN;let he=0,Ee=0;return H[2]D[2]&&(he=H[0]-D[2]),H[1]>D[3]&&(Ee=H[1]-D[3]),H[3]=he)return he;if(ds(Ee,Be)){if(Wf(H,D))return 0}else if(Wf(D,H))return 0;let Ve=1/0;for(const nt of H)for(let mt=0,Pt=nt.length,Xt=Pt-1;mt0;){const mt=Ve.pop();if(mt[0]>=Be)continue;const Pt=mt[1],Xt=D?50:100;if(fl(Pt)<=Xt){if(!_l(Pt,H.length))return NaN;if(D){const er=Eo(H,Pt,K,he);if(isNaN(er)||er===0)return er;Be=Math.min(Be,er)}else for(let er=Pt[0];er<=Pt[1];++er){const br=Gf(H[er],K,he);if(Be=Math.min(Be,br),Be===0)return 0}}else{const er=Yu(Pt,D);oo(Ve,Be,he,H,nt,er[0]),oo(Ve,Be,he,H,nt,er[1])}}return Be}function zl(H,D,K,he,Ee,Be=1/0){let Ve=Math.min(Be,Ee.distance(H[0],K[0]));if(Ve===0)return Ve;const nt=new Ql([[0,[0,H.length-1],[0,K.length-1]]],ml);for(;nt.length>0;){const mt=nt.pop();if(mt[0]>=Ve)continue;const Pt=mt[1],Xt=mt[2],er=D?50:100,br=he?50:100;if(fl(Pt)<=er&&fl(Xt)<=br){if(!_l(Pt,H.length)&&_l(Xt,K.length))return NaN;let Rr;if(D&&he)Rr=Ku(H,Pt,K,Xt,Ee),Ve=Math.min(Ve,Rr);else if(D&&!he){const jr=H.slice(Pt[0],Pt[1]+1);for(let Yr=Xt[0];Yr<=Xt[1];++Yr)if(Rr=Nu(K[Yr],jr,Ee),Ve=Math.min(Ve,Rr),Ve===0)return Ve}else if(!D&&he){const jr=K.slice(Xt[0],Xt[1]+1);for(let Yr=Pt[0];Yr<=Pt[1];++Yr)if(Rr=Nu(H[Yr],jr,Ee),Ve=Math.min(Ve,Rr),Ve===0)return Ve}else Rr=Bs(H,Pt,K,Xt,Ee),Ve=Math.min(Ve,Rr)}else{const Rr=Yu(Pt,D),jr=Yu(Xt,he);pc(nt,Ve,Ee,H,K,Rr[0],jr[0]),pc(nt,Ve,Ee,H,K,Rr[0],jr[1]),pc(nt,Ve,Ee,H,K,Rr[1],jr[0]),pc(nt,Ve,Ee,H,K,Rr[1],jr[1])}}return Ve}function Kc(H){return H.type==="MultiPolygon"?H.coordinates.map(D=>({type:"Polygon",coordinates:D})):H.type==="MultiLineString"?H.coordinates.map(D=>({type:"LineString",coordinates:D})):H.type==="MultiPoint"?H.coordinates.map(D=>({type:"Point",coordinates:D})):[H]}class Ju{constructor(D,K){this.type=Je,this.geojson=D,this.geometries=K}static parse(D,K){if(D.length!==2)return K.error(`'distance' expression requires exactly one argument, but found ${D.length-1} instead.`);if(Oa(D[1])){const he=D[1];if(he.type==="FeatureCollection")return new Ju(he,he.features.map(Ee=>Kc(Ee.geometry)).flat());if(he.type==="Feature")return new Ju(he,Kc(he.geometry));if("type"in he&&"coordinates"in he)return new Ju(he,Kc(he))}return K.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(D){if(D.geometry()!=null&&D.canonicalID()!=null){if(D.geometryType()==="Point")return function(K,he){const Ee=K.geometry(),Be=Ee.flat().map(mt=>Jn([mt.x,mt.y],K.canonical));if(Ee.length===0)return NaN;const Ve=new Nc(Be[0][1]);let nt=1/0;for(const mt of he){switch(mt.type){case"Point":nt=Math.min(nt,zl(Be,!1,[mt.coordinates],!1,Ve,nt));break;case"LineString":nt=Math.min(nt,zl(Be,!1,mt.coordinates,!0,Ve,nt));break;case"Polygon":nt=Math.min(nt,xu(Be,!1,mt.coordinates,Ve,nt))}if(nt===0)return nt}return nt}(D,this.geometries);if(D.geometryType()==="LineString")return function(K,he){const Ee=K.geometry(),Be=Ee.flat().map(mt=>Jn([mt.x,mt.y],K.canonical));if(Ee.length===0)return NaN;const Ve=new Nc(Be[0][1]);let nt=1/0;for(const mt of he){switch(mt.type){case"Point":nt=Math.min(nt,zl(Be,!0,[mt.coordinates],!1,Ve,nt));break;case"LineString":nt=Math.min(nt,zl(Be,!0,mt.coordinates,!0,Ve,nt));break;case"Polygon":nt=Math.min(nt,xu(Be,!0,mt.coordinates,Ve,nt))}if(nt===0)return nt}return nt}(D,this.geometries);if(D.geometryType()==="Polygon")return function(K,he){const Ee=K.geometry();if(Ee.length===0||Ee[0].length===0)return NaN;const Be=Lu(Ee,0).map(mt=>mt.map(Pt=>Pt.map(Xt=>Jn([Xt.x,Xt.y],K.canonical)))),Ve=new Nc(Be[0][0][0][1]);let nt=1/0;for(const mt of he)for(const Pt of Be){switch(mt.type){case"Point":nt=Math.min(nt,xu([mt.coordinates],!1,Pt,Ve,nt));break;case"LineString":nt=Math.min(nt,xu(mt.coordinates,!0,Pt,Ve,nt));break;case"Polygon":nt=Math.min(nt,is(Pt,mt.coordinates,Ve,nt))}if(nt===0)return nt}return nt}(D,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const gc={"==":li,"!=":Ii,">":Ao,"<":xi,">=":Ro,"<=":So,array:yr,at:Qt,boolean:yr,case:Sa,coalesce:mi,collator:Li,format:bs,image:as,in:mr,"index-of":$r,interpolate:ci,"interpolate-hcl":ci,"interpolate-lab":ci,length:fs,let:Jr,literal:Lr,match:oa,number:yr,"number-format":Yi,object:yr,slice:ya,step:pa,string:yr,"to-boolean":zr,"to-color":zr,"to-number":zr,"to-string":zr,var:wt,within:Js,distance:Ju};class hl{constructor(D,K,he,Ee){this.name=D,this.type=K,this._evaluate=he,this.args=Ee}evaluate(D){return this._evaluate(D,this.args)}eachChild(D){this.args.forEach(D)}outputDefined(){return!1}static parse(D,K){const he=D[0],Ee=hl.definitions[he];if(!Ee)return K.error(`Unknown expression "${he}". If you wanted a literal array, use ["literal", [...]].`,0);const Be=Array.isArray(Ee)?Ee[0]:Ee.type,Ve=Array.isArray(Ee)?[[Ee[1],Ee[2]]]:Ee.overloads,nt=Ve.filter(([Pt])=>!Array.isArray(Pt)||Pt.length===D.length-1);let mt=null;for(const[Pt,Xt]of nt){mt=new Zr(K.registry,jc,K.path,null,K.scope);const er=[];let br=!1;for(let Rr=1;Rr{return br=er,Array.isArray(br)?`(${br.map(Ge).join(", ")})`:`(${Ge(br.type)}...)`;var br}).join(" | "),Xt=[];for(let er=1;er{K=D?K&&jc(he):K&&he instanceof Lr}),!!K&&$c(H)&&Qc(H,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function $c(H){if(H instanceof hl&&(H.name==="get"&&H.args.length===1||H.name==="feature-state"||H.name==="has"&&H.args.length===1||H.name==="properties"||H.name==="geometry-type"||H.name==="id"||/^filter-/.test(H.name))||H instanceof Js||H instanceof Ju)return!1;let D=!0;return H.eachChild(K=>{D&&!$c(K)&&(D=!1)}),D}function bu(H){if(H instanceof hl&&H.name==="feature-state")return!1;let D=!0;return H.eachChild(K=>{D&&!bu(K)&&(D=!1)}),D}function Qc(H,D){if(H instanceof hl&&D.indexOf(H.name)>=0)return!1;let K=!0;return H.eachChild(he=>{K&&!Qc(he,D)&&(K=!1)}),K}function sc(H){return{result:"success",value:H}}function wu(H){return{result:"error",value:H}}function eu(H){return H["property-type"]==="data-driven"||H["property-type"]==="cross-faded-data-driven"}function Sc(H){return!!H.expression&&H.expression.parameters.indexOf("zoom")>-1}function ef(H){return!!H.expression&&H.expression.interpolated}function ps(H){return H instanceof Number?"number":H instanceof String?"string":H instanceof Boolean?"boolean":Array.isArray(H)?"array":H===null?"null":typeof H}function Vc(H){return typeof H=="object"&&H!==null&&!Array.isArray(H)}function Zf(H){return H}function mf(H,D){const K=D.type==="color",he=H.stops&&typeof H.stops[0][0]=="object",Ee=he||!(he||H.property!==void 0),Be=H.type||(ef(D)?"exponential":"interval");if(K||D.type==="padding"){const Xt=K?Ot.parse:Ur.parse;(H=ce({},H)).stops&&(H.stops=H.stops.map(er=>[er[0],Xt(er[1])])),H.default=Xt(H.default?H.default:D.default)}if(H.colorSpace&&(Ve=H.colorSpace)!=="rgb"&&Ve!=="hcl"&&Ve!=="lab")throw new Error(`Unknown color space: "${H.colorSpace}"`);var Ve;let nt,mt,Pt;if(Be==="exponential")nt=xf;else if(Be==="interval")nt=tu;else if(Be==="categorical"){nt=_f,mt=Object.create(null);for(const Xt of H.stops)mt[Xt[0]]=Xt[1];Pt=typeof H.stops[0][0]}else{if(Be!=="identity")throw new Error(`Unknown function type "${Be}"`);nt=Fl}if(he){const Xt={},er=[];for(let jr=0;jrjr[0]),evaluate:({zoom:jr},Yr)=>xf({stops:br,base:H.base},D,jr).evaluate(jr,Yr)}}if(Ee){const Xt=Be==="exponential"?{name:"exponential",base:H.base!==void 0?H.base:1}:null;return{kind:"camera",interpolationType:Xt,interpolationFactor:ci.interpolationFactor.bind(void 0,Xt),zoomStops:H.stops.map(er=>er[0]),evaluate:({zoom:er})=>nt(H,D,er,mt,Pt)}}return{kind:"source",evaluate(Xt,er){const br=er&&er.properties?er.properties[H.property]:void 0;return br===void 0?Mc(H.default,D.default):nt(H,D,br,mt,Pt)}}}function Mc(H,D,K){return H!==void 0?H:D!==void 0?D:K!==void 0?K:void 0}function _f(H,D,K,he,Ee){return Mc(typeof K===Ee?he[K]:void 0,H.default,D.default)}function tu(H,D,K){if(ps(K)!=="number")return Mc(H.default,D.default);const he=H.stops.length;if(he===1||K<=H.stops[0][0])return H.stops[0][1];if(K>=H.stops[he-1][0])return H.stops[he-1][1];const Ee=ra(H.stops.map(Be=>Be[0]),K);return H.stops[Ee][1]}function xf(H,D,K){const he=H.base!==void 0?H.base:1;if(ps(K)!=="number")return Mc(H.default,D.default);const Ee=H.stops.length;if(Ee===1||K<=H.stops[0][0])return H.stops[0][1];if(K>=H.stops[Ee-1][0])return H.stops[Ee-1][1];const Be=ra(H.stops.map(Xt=>Xt[0]),K),Ve=function(Xt,er,br,Rr){const jr=Rr-br,Yr=Xt-br;return jr===0?0:er===1?Yr/jr:(Math.pow(er,Yr)-1)/(Math.pow(er,jr)-1)}(K,he,H.stops[Be][0],H.stops[Be+1][0]),nt=H.stops[Be][1],mt=H.stops[Be+1][1],Pt=Ci[D.type]||Zf;return typeof nt.evaluate=="function"?{evaluate(...Xt){const er=nt.evaluate.apply(void 0,Xt),br=mt.evaluate.apply(void 0,Xt);if(er!==void 0&&br!==void 0)return Pt(er,br,Ve,H.colorSpace)}}:Pt(nt,mt,Ve,H.colorSpace)}function Fl(H,D,K){switch(D.type){case"color":K=Ot.parse(K);break;case"formatted":K=na.fromString(K.toString());break;case"resolvedImage":K=Pa.fromString(K.toString());break;case"padding":K=Ur.parse(K);break;default:ps(K)===D.type||D.type==="enum"&&D.values[K]||(K=void 0)}return Mc(K,H.default,D.default)}hl.register(gc,{error:[{kind:"error"},[At],(H,[D])=>{throw new Er(D.evaluate(H))}],typeof:[At,[ir],(H,[D])=>Ge(dt(D.evaluate(H)))],"to-rgba":[ze(Je,4),[Rt],(H,[D])=>{const[K,he,Ee,Be]=D.evaluate(H).rgb;return[255*K,255*he,255*Ee,Be]}],rgb:[Rt,[Je,Je,Je],yf],rgba:[Rt,[Je,Je,Je,Je],yf],has:{type:St,overloads:[[[At],(H,[D])=>Jc(D.evaluate(H),H.properties())],[[At,Ut],(H,[D,K])=>Jc(D.evaluate(H),K.evaluate(H))]]},get:{type:ir,overloads:[[[At],(H,[D])=>Uc(D.evaluate(H),H.properties())],[[At,Ut],(H,[D,K])=>Uc(D.evaluate(H),K.evaluate(H))]]},"feature-state":[ir,[At],(H,[D])=>Uc(D.evaluate(H),H.featureState||{})],properties:[Ut,[],H=>H.properties()],"geometry-type":[At,[],H=>H.geometryType()],id:[ir,[],H=>H.id()],zoom:[Je,[],H=>H.globals.zoom],"heatmap-density":[Je,[],H=>H.globals.heatmapDensity||0],"line-progress":[Je,[],H=>H.globals.lineProgress||0],accumulated:[ir,[],H=>H.globals.accumulated===void 0?null:H.globals.accumulated],"+":[Je,$u(Je),(H,D)=>{let K=0;for(const he of D)K+=he.evaluate(H);return K}],"*":[Je,$u(Je),(H,D)=>{let K=1;for(const he of D)K*=he.evaluate(H);return K}],"-":{type:Je,overloads:[[[Je,Je],(H,[D,K])=>D.evaluate(H)-K.evaluate(H)],[[Je],(H,[D])=>-D.evaluate(H)]]},"/":[Je,[Je,Je],(H,[D,K])=>D.evaluate(H)/K.evaluate(H)],"%":[Je,[Je,Je],(H,[D,K])=>D.evaluate(H)%K.evaluate(H)],ln2:[Je,[],()=>Math.LN2],pi:[Je,[],()=>Math.PI],e:[Je,[],()=>Math.E],"^":[Je,[Je,Je],(H,[D,K])=>Math.pow(D.evaluate(H),K.evaluate(H))],sqrt:[Je,[Je],(H,[D])=>Math.sqrt(D.evaluate(H))],log10:[Je,[Je],(H,[D])=>Math.log(D.evaluate(H))/Math.LN10],ln:[Je,[Je],(H,[D])=>Math.log(D.evaluate(H))],log2:[Je,[Je],(H,[D])=>Math.log(D.evaluate(H))/Math.LN2],sin:[Je,[Je],(H,[D])=>Math.sin(D.evaluate(H))],cos:[Je,[Je],(H,[D])=>Math.cos(D.evaluate(H))],tan:[Je,[Je],(H,[D])=>Math.tan(D.evaluate(H))],asin:[Je,[Je],(H,[D])=>Math.asin(D.evaluate(H))],acos:[Je,[Je],(H,[D])=>Math.acos(D.evaluate(H))],atan:[Je,[Je],(H,[D])=>Math.atan(D.evaluate(H))],min:[Je,$u(Je),(H,D)=>Math.min(...D.map(K=>K.evaluate(H)))],max:[Je,$u(Je),(H,D)=>Math.max(...D.map(K=>K.evaluate(H)))],abs:[Je,[Je],(H,[D])=>Math.abs(D.evaluate(H))],round:[Je,[Je],(H,[D])=>{const K=D.evaluate(H);return K<0?-Math.round(-K):Math.round(K)}],floor:[Je,[Je],(H,[D])=>Math.floor(D.evaluate(H))],ceil:[Je,[Je],(H,[D])=>Math.ceil(D.evaluate(H))],"filter-==":[St,[At,ir],(H,[D,K])=>H.properties()[D.value]===K.value],"filter-id-==":[St,[ir],(H,[D])=>H.id()===D.value],"filter-type-==":[St,[At],(H,[D])=>H.geometryType()===D.value],"filter-<":[St,[At,ir],(H,[D,K])=>{const he=H.properties()[D.value],Ee=K.value;return typeof he==typeof Ee&&he{const K=H.id(),he=D.value;return typeof K==typeof he&&K":[St,[At,ir],(H,[D,K])=>{const he=H.properties()[D.value],Ee=K.value;return typeof he==typeof Ee&&he>Ee}],"filter-id->":[St,[ir],(H,[D])=>{const K=H.id(),he=D.value;return typeof K==typeof he&&K>he}],"filter-<=":[St,[At,ir],(H,[D,K])=>{const he=H.properties()[D.value],Ee=K.value;return typeof he==typeof Ee&&he<=Ee}],"filter-id-<=":[St,[ir],(H,[D])=>{const K=H.id(),he=D.value;return typeof K==typeof he&&K<=he}],"filter->=":[St,[At,ir],(H,[D,K])=>{const he=H.properties()[D.value],Ee=K.value;return typeof he==typeof Ee&&he>=Ee}],"filter-id->=":[St,[ir],(H,[D])=>{const K=H.id(),he=D.value;return typeof K==typeof he&&K>=he}],"filter-has":[St,[ir],(H,[D])=>D.value in H.properties()],"filter-has-id":[St,[],H=>H.id()!==null&&H.id()!==void 0],"filter-type-in":[St,[ze(At)],(H,[D])=>D.value.indexOf(H.geometryType())>=0],"filter-id-in":[St,[ze(ir)],(H,[D])=>D.value.indexOf(H.id())>=0],"filter-in-small":[St,[At,ze(ir)],(H,[D,K])=>K.value.indexOf(H.properties()[D.value])>=0],"filter-in-large":[St,[At,ze(ir)],(H,[D,K])=>function(he,Ee,Be,Ve){for(;Be<=Ve;){const nt=Be+Ve>>1;if(Ee[nt]===he)return!0;Ee[nt]>he?Ve=nt-1:Be=nt+1}return!1}(H.properties()[D.value],K.value,0,K.value.length-1)],all:{type:St,overloads:[[[St,St],(H,[D,K])=>D.evaluate(H)&&K.evaluate(H)],[$u(St),(H,D)=>{for(const K of D)if(!K.evaluate(H))return!1;return!0}]]},any:{type:St,overloads:[[[St,St],(H,[D,K])=>D.evaluate(H)||K.evaluate(H)],[$u(St),(H,D)=>{for(const K of D)if(K.evaluate(H))return!0;return!1}]]},"!":[St,[St],(H,[D])=>!D.evaluate(H)],"is-supported-script":[St,[At],(H,[D])=>{const K=H.globals&&H.globals.isSupportedScript;return!K||K(D.evaluate(H))}],upcase:[At,[At],(H,[D])=>D.evaluate(H).toUpperCase()],downcase:[At,[At],(H,[D])=>D.evaluate(H).toLowerCase()],concat:[At,$u(ir),(H,D)=>D.map(K=>vt(K.evaluate(H))).join("")],"resolved-locale":[At,[ar],(H,[D])=>D.evaluate(H).resolvedLocale()]});class ru{constructor(D,K){var he;this.expression=D,this._warningHistory={},this._evaluator=new Hr,this._defaultValue=K?(he=K).type==="color"&&Vc(he.default)?new Ot(0,0,0,0):he.type==="color"?Ot.parse(he.default)||null:he.type==="padding"?Ur.parse(he.default)||null:he.type==="variableAnchorOffsetCollection"?Aa.parse(he.default)||null:he.default===void 0?null:he.default:null,this._enumValues=K&&K.type==="enum"?K.values:null}evaluateWithoutErrorHandling(D,K,he,Ee,Be,Ve){return this._evaluator.globals=D,this._evaluator.feature=K,this._evaluator.featureState=he,this._evaluator.canonical=Ee,this._evaluator.availableImages=Be||null,this._evaluator.formattedSection=Ve,this.expression.evaluate(this._evaluator)}evaluate(D,K,he,Ee,Be,Ve){this._evaluator.globals=D,this._evaluator.feature=K||null,this._evaluator.featureState=he||null,this._evaluator.canonical=Ee,this._evaluator.availableImages=Be||null,this._evaluator.formattedSection=Ve||null;try{const nt=this.expression.evaluate(this._evaluator);if(nt==null||typeof nt=="number"&&nt!=nt)return this._defaultValue;if(this._enumValues&&!(nt in this._enumValues))throw new Er(`Expected value to be one of ${Object.keys(this._enumValues).map(mt=>JSON.stringify(mt)).join(", ")}, but found ${JSON.stringify(nt)} instead.`);return nt}catch(nt){return this._warningHistory[nt.message]||(this._warningHistory[nt.message]=!0,typeof console<"u"&&console.warn(nt.message)),this._defaultValue}}}function Uu(H){return Array.isArray(H)&&H.length>0&&typeof H[0]=="string"&&H[0]in gc}function $s(H,D){const K=new Zr(gc,jc,[],D?function(Ee){const Be={color:Rt,string:At,number:Je,enum:At,boolean:St,formatted:Mr,padding:fr,resolvedImage:dr,variableAnchorOffsetCollection:pt};return Ee.type==="array"?ze(Be[Ee.value]||ir,Ee.length):Be[Ee.type]}(D):void 0),he=K.parse(H,void 0,void 0,void 0,D&&D.type==="string"?{typeAnnotation:"coerce"}:void 0);return he?sc(new ru(he,D)):wu(K.errors)}class Qu{constructor(D,K){this.kind=D,this._styleExpression=K,this.isStateDependent=D!=="constant"&&!bu(K.expression)}evaluateWithoutErrorHandling(D,K,he,Ee,Be,Ve){return this._styleExpression.evaluateWithoutErrorHandling(D,K,he,Ee,Be,Ve)}evaluate(D,K,he,Ee,Be,Ve){return this._styleExpression.evaluate(D,K,he,Ee,Be,Ve)}}class Tu{constructor(D,K,he,Ee){this.kind=D,this.zoomStops=he,this._styleExpression=K,this.isStateDependent=D!=="camera"&&!bu(K.expression),this.interpolationType=Ee}evaluateWithoutErrorHandling(D,K,he,Ee,Be,Ve){return this._styleExpression.evaluateWithoutErrorHandling(D,K,he,Ee,Be,Ve)}evaluate(D,K,he,Ee,Be,Ve){return this._styleExpression.evaluate(D,K,he,Ee,Be,Ve)}interpolationFactor(D,K,he){return this.interpolationType?ci.interpolationFactor(this.interpolationType,D,K,he):0}}function au(H,D){const K=$s(H,D);if(K.result==="error")return K;const he=K.value.expression,Ee=$c(he);if(!Ee&&!eu(D))return wu([new Re("","data expressions not supported")]);const Be=Qc(he,["zoom"]);if(!Be&&!Sc(D))return wu([new Re("","zoom expressions not supported")]);const Ve=yc(he);return Ve||Be?Ve instanceof Re?wu([Ve]):Ve instanceof ci&&!ef(D)?wu([new Re("",'"interpolate" expressions cannot be used with this property')]):sc(Ve?new Tu(Ee?"camera":"composite",K.value,Ve.labels,Ve instanceof ci?Ve.interpolation:void 0):new Qu(Ee?"constant":"source",K.value)):wu([new Re("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Ns{constructor(D,K){this._parameters=D,this._specification=K,ce(this,mf(this._parameters,this._specification))}static deserialize(D){return new Ns(D._parameters,D._specification)}static serialize(D){return{_parameters:D._parameters,_specification:D._specification}}}function yc(H){let D=null;if(H instanceof Jr)D=yc(H.result);else if(H instanceof mi){for(const K of H.args)if(D=yc(K),D)break}else(H instanceof pa||H instanceof ci)&&H.input instanceof hl&&H.input.name==="zoom"&&(D=H);return D instanceof Re||H.eachChild(K=>{const he=yc(K);he instanceof Re?D=he:!D&&he?D=new Re("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):D&&he&&D!==he&&(D=new Re("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),D}function Pu(H){if(H===!0||H===!1)return!0;if(!Array.isArray(H)||H.length===0)return!1;switch(H[0]){case"has":return H.length>=2&&H[1]!=="$id"&&H[1]!=="$type";case"in":return H.length>=3&&(typeof H[1]!="string"||Array.isArray(H[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return H.length!==3||Array.isArray(H[1])||Array.isArray(H[2]);case"any":case"all":for(const D of H.slice(1))if(!Pu(D)&&typeof D!="boolean")return!1;return!0;default:return!0}}const ec={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ec(H){if(H==null)return{filter:()=>!0,needGeometry:!1};Pu(H)||(H=lc(H));const D=$s(H,ec);if(D.result==="error")throw new Error(D.value.map(K=>`${K.key}: ${K.message}`).join(", "));return{filter:(K,he,Ee)=>D.value.evaluate(K,he,{},Ee),needGeometry:nh(H)}}function Cf(H,D){return HD?1:0}function nh(H){if(!Array.isArray(H))return!1;if(H[0]==="within"||H[0]==="distance")return!0;for(let D=1;D"||D==="<="||D===">="?kc(H[1],H[2],D):D==="any"?(K=H.slice(1),["any"].concat(K.map(lc))):D==="all"?["all"].concat(H.slice(1).map(lc)):D==="none"?["all"].concat(H.slice(1).map(lc).map(Cl)):D==="in"?nu(H[1],H.slice(2)):D==="!in"?Cl(nu(H[1],H.slice(2))):D==="has"?tf(H[1]):D!=="!has"||Cl(tf(H[1]));var K}function kc(H,D,K){switch(H){case"$type":return[`filter-type-${K}`,D];case"$id":return[`filter-id-${K}`,D];default:return[`filter-${K}`,H,D]}}function nu(H,D){if(D.length===0)return!1;switch(H){case"$type":return["filter-type-in",["literal",D]];case"$id":return["filter-id-in",["literal",D]];default:return D.length>200&&!D.some(K=>typeof K!=typeof D[0])?["filter-in-large",H,["literal",D.sort(Cf)]]:["filter-in-small",H,["literal",D]]}}function tf(H){switch(H){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",H]}}function Cl(H){return["!",H]}function uc(H){const D=typeof H;if(D==="number"||D==="boolean"||D==="string"||H==null)return JSON.stringify(H);if(Array.isArray(H)){let Ee="[";for(const Be of H)Ee+=`${uc(Be)},`;return`${Ee}]`}const K=Object.keys(H).sort();let he="{";for(let Ee=0;Eehe.maximum?[new xe(D,K,`${K} is greater than the maximum value ${he.maximum}`)]:[]}function _c(H){const D=H.valueSpec,K=Us(H.value.type);let he,Ee,Be,Ve={};const nt=K!=="categorical"&&H.value.property===void 0,mt=!nt,Pt=ps(H.value.stops)==="array"&&ps(H.value.stops[0])==="array"&&ps(H.value.stops[0][0])==="object",Xt=du({key:H.key,value:H.value,valueSpec:H.styleSpec.function,validateSpec:H.validateSpec,style:H.style,styleSpec:H.styleSpec,objectElementValidators:{stops:function(Rr){if(K==="identity")return[new xe(Rr.key,Rr.value,'identity function may not have a "stops" property')];let jr=[];const Yr=Rr.value;return jr=jr.concat(af({key:Rr.key,value:Yr,valueSpec:Rr.valueSpec,validateSpec:Rr.validateSpec,style:Rr.style,styleSpec:Rr.styleSpec,arrayElementValidator:er})),ps(Yr)==="array"&&Yr.length===0&&jr.push(new xe(Rr.key,Yr,"array must have at least one stop")),jr},default:function(Rr){return Rr.validateSpec({key:Rr.key,value:Rr.value,valueSpec:D,validateSpec:Rr.validateSpec,style:Rr.style,styleSpec:Rr.styleSpec})}}});return K==="identity"&&nt&&Xt.push(new xe(H.key,H.value,'missing required property "property"')),K==="identity"||H.value.stops||Xt.push(new xe(H.key,H.value,'missing required property "stops"')),K==="exponential"&&H.valueSpec.expression&&!ef(H.valueSpec)&&Xt.push(new xe(H.key,H.value,"exponential functions not supported")),H.styleSpec.$version>=8&&(mt&&!eu(H.valueSpec)?Xt.push(new xe(H.key,H.value,"property functions not supported")):nt&&!Sc(H.valueSpec)&&Xt.push(new xe(H.key,H.value,"zoom functions not supported"))),K!=="categorical"&&!Pt||H.value.property!==void 0||Xt.push(new xe(H.key,H.value,'"property" property is required')),Xt;function er(Rr){let jr=[];const Yr=Rr.value,ca=Rr.key;if(ps(Yr)!=="array")return[new xe(ca,Yr,`array expected, ${ps(Yr)} found`)];if(Yr.length!==2)return[new xe(ca,Yr,`array length 2 expected, length ${Yr.length} found`)];if(Pt){if(ps(Yr[0])!=="object")return[new xe(ca,Yr,`object expected, ${ps(Yr[0])} found`)];if(Yr[0].zoom===void 0)return[new xe(ca,Yr,"object stop key must have zoom")];if(Yr[0].value===void 0)return[new xe(ca,Yr,"object stop key must have value")];if(Be&&Be>Us(Yr[0].zoom))return[new xe(ca,Yr[0].zoom,"stop zoom values must appear in ascending order")];Us(Yr[0].zoom)!==Be&&(Be=Us(Yr[0].zoom),Ee=void 0,Ve={}),jr=jr.concat(du({key:`${ca}[0]`,value:Yr[0],valueSpec:{zoom:{}},validateSpec:Rr.validateSpec,style:Rr.style,styleSpec:Rr.styleSpec,objectElementValidators:{zoom:Rs,value:br}}))}else jr=jr.concat(br({key:`${ca}[0]`,value:Yr[0],valueSpec:{},validateSpec:Rr.validateSpec,style:Rr.style,styleSpec:Rr.styleSpec},Yr));return Uu(vu(Yr[1]))?jr.concat([new xe(`${ca}[1]`,Yr[1],"expressions are not allowed in function stops.")]):jr.concat(Rr.validateSpec({key:`${ca}[1]`,value:Yr[1],valueSpec:D,validateSpec:Rr.validateSpec,style:Rr.style,styleSpec:Rr.styleSpec}))}function br(Rr,jr){const Yr=ps(Rr.value),ca=Us(Rr.value),Ca=Rr.value!==null?Rr.value:jr;if(he){if(Yr!==he)return[new xe(Rr.key,Ca,`${Yr} stop domain type must match previous stop domain type ${he}`)]}else he=Yr;if(Yr!=="number"&&Yr!=="string"&&Yr!=="boolean")return[new xe(Rr.key,Ca,"stop domain value must be a number, string, or boolean")];if(Yr!=="number"&&K!=="categorical"){let un=`number expected, ${Yr} found`;return eu(D)&&K===void 0&&(un+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new xe(Rr.key,Ca,un)]}return K!=="categorical"||Yr!=="number"||isFinite(ca)&&Math.floor(ca)===ca?K!=="categorical"&&Yr==="number"&&Ee!==void 0&&canew xe(`${H.key}${he.key}`,H.value,he.message));const K=D.value.expression||D.value._styleExpression.expression;if(H.expressionContext==="property"&&H.propertyKey==="text-font"&&!K.outputDefined())return[new xe(H.key,H.value,`Invalid data expression for "${H.propertyKey}". Output values must be contained as literals within the expression.`)];if(H.expressionContext==="property"&&H.propertyType==="layout"&&!bu(K))return[new xe(H.key,H.value,'"feature-state" data expressions are not supported with layout properties.')];if(H.expressionContext==="filter"&&!bu(K))return[new xe(H.key,H.value,'"feature-state" data expressions are not supported with filters.')];if(H.expressionContext&&H.expressionContext.indexOf("cluster")===0){if(!Qc(K,["zoom","feature-state"]))return[new xe(H.key,H.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(H.expressionContext==="cluster-initial"&&!$c(K))return[new xe(H.key,H.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function iu(H){const D=H.key,K=H.value,he=H.valueSpec,Ee=[];return Array.isArray(he.values)?he.values.indexOf(Us(K))===-1&&Ee.push(new xe(D,K,`expected one of [${he.values.join(", ")}], ${JSON.stringify(K)} found`)):Object.keys(he.values).indexOf(Us(K))===-1&&Ee.push(new xe(D,K,`expected one of [${Object.keys(he.values).join(", ")}], ${JSON.stringify(K)} found`)),Ee}function xc(H){return Pu(vu(H.value))?ju(ce({},H,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Iu(H)}function Iu(H){const D=H.value,K=H.key;if(ps(D)!=="array")return[new xe(K,D,`array expected, ${ps(D)} found`)];const he=H.styleSpec;let Ee,Be=[];if(D.length<1)return[new xe(K,D,"filter array must have at least 1 element")];switch(Be=Be.concat(iu({key:`${K}[0]`,value:D[0],valueSpec:he.filter_operator,style:H.style,styleSpec:H.styleSpec})),Us(D[0])){case"<":case"<=":case">":case">=":D.length>=2&&Us(D[1])==="$type"&&Be.push(new xe(K,D,`"$type" cannot be use with operator "${D[0]}"`));case"==":case"!=":D.length!==3&&Be.push(new xe(K,D,`filter array for operator "${D[0]}" must have 3 elements`));case"in":case"!in":D.length>=2&&(Ee=ps(D[1]),Ee!=="string"&&Be.push(new xe(`${K}[1]`,D[1],`string expected, ${Ee} found`)));for(let Ve=2;Ve{Pt in K&&D.push(new xe(he,K[Pt],`"${Pt}" is prohibited for ref layers`))}),Ee.layers.forEach(Pt=>{Us(Pt.id)===nt&&(mt=Pt)}),mt?mt.ref?D.push(new xe(he,K.ref,"ref cannot reference another ref layer")):Ve=Us(mt.type):D.push(new xe(he,K.ref,`ref layer "${nt}" not found`))}else if(Ve!=="background")if(K.source){const mt=Ee.sources&&Ee.sources[K.source],Pt=mt&&Us(mt.type);mt?Pt==="vector"&&Ve==="raster"?D.push(new xe(he,K.source,`layer "${K.id}" requires a raster source`)):Pt!=="raster-dem"&&Ve==="hillshade"?D.push(new xe(he,K.source,`layer "${K.id}" requires a raster-dem source`)):Pt==="raster"&&Ve!=="raster"?D.push(new xe(he,K.source,`layer "${K.id}" requires a vector source`)):Pt!=="vector"||K["source-layer"]?Pt==="raster-dem"&&Ve!=="hillshade"?D.push(new xe(he,K.source,"raster-dem source can only be used with layer type 'hillshade'.")):Ve!=="line"||!K.paint||!K.paint["line-gradient"]||Pt==="geojson"&&mt.lineMetrics||D.push(new xe(he,K,`layer "${K.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):D.push(new xe(he,K,`layer "${K.id}" must specify a "source-layer"`)):D.push(new xe(he,K.source,`source "${K.source}" not found`))}else D.push(new xe(he,K,'missing required property "source"'));return D=D.concat(du({key:he,value:K,valueSpec:Be.layer,style:H.style,styleSpec:H.styleSpec,validateSpec:H.validateSpec,objectElementValidators:{"*":()=>[],type:()=>H.validateSpec({key:`${he}.type`,value:K.type,valueSpec:Be.layer.type,style:H.style,styleSpec:H.styleSpec,validateSpec:H.validateSpec,object:K,objectKey:"type"}),filter:xc,layout:mt=>du({layer:K,key:mt.key,value:mt.value,style:mt.style,styleSpec:mt.styleSpec,validateSpec:mt.validateSpec,objectElementValidators:{"*":Pt=>xl(ce({layerType:Ve},Pt))}}),paint:mt=>du({layer:K,key:mt.key,value:mt.value,style:mt.style,styleSpec:mt.styleSpec,validateSpec:mt.validateSpec,objectElementValidators:{"*":Pt=>Lf(ce({layerType:Ve},Pt))}})}})),D}function ou(H){const D=H.value,K=H.key,he=ps(D);return he!=="string"?[new xe(K,D,`string expected, ${he} found`)]:[]}const Ru={promoteId:function({key:H,value:D}){if(ps(D)==="string")return ou({key:H,value:D});{const K=[];for(const he in D)K.push(...ou({key:`${H}.${he}`,value:D[he]}));return K}}};function Au(H){const D=H.value,K=H.key,he=H.styleSpec,Ee=H.style,Be=H.validateSpec;if(!D.type)return[new xe(K,D,'"type" is required')];const Ve=Us(D.type);let nt;switch(Ve){case"vector":case"raster":return nt=du({key:K,value:D,valueSpec:he[`source_${Ve.replace("-","_")}`],style:H.style,styleSpec:he,objectElementValidators:Ru,validateSpec:Be}),nt;case"raster-dem":return nt=function(mt){var Pt;const Xt=(Pt=mt.sourceName)!==null&&Pt!==void 0?Pt:"",er=mt.value,br=mt.styleSpec,Rr=br.source_raster_dem,jr=mt.style;let Yr=[];const ca=ps(er);if(er===void 0)return Yr;if(ca!=="object")return Yr.push(new xe("source_raster_dem",er,`object expected, ${ca} found`)),Yr;const Ca=Us(er.encoding)==="custom",un=["redFactor","greenFactor","blueFactor","baseShift"],Ha=mt.value.encoding?`"${mt.value.encoding}"`:"Default";for(const rn in er)!Ca&&un.includes(rn)?Yr.push(new xe(rn,er[rn],`In "${Xt}": "${rn}" is only valid when "encoding" is set to "custom". ${Ha} encoding found`)):Rr[rn]?Yr=Yr.concat(mt.validateSpec({key:rn,value:er[rn],valueSpec:Rr[rn],validateSpec:mt.validateSpec,style:jr,styleSpec:br})):Yr.push(new xe(rn,er[rn],`unknown property "${rn}"`));return Yr}({sourceName:K,value:D,style:H.style,styleSpec:he,validateSpec:Be}),nt;case"geojson":if(nt=du({key:K,value:D,valueSpec:he.source_geojson,style:Ee,styleSpec:he,validateSpec:Be,objectElementValidators:Ru}),D.cluster)for(const mt in D.clusterProperties){const[Pt,Xt]=D.clusterProperties[mt],er=typeof Pt=="string"?[Pt,["accumulated"],["get",mt]]:Pt;nt.push(...ju({key:`${K}.${mt}.map`,value:Xt,validateSpec:Be,expressionContext:"cluster-map"})),nt.push(...ju({key:`${K}.${mt}.reduce`,value:er,validateSpec:Be,expressionContext:"cluster-reduce"}))}return nt;case"video":return du({key:K,value:D,valueSpec:he.source_video,style:Ee,validateSpec:Be,styleSpec:he});case"image":return du({key:K,value:D,valueSpec:he.source_image,style:Ee,validateSpec:Be,styleSpec:he});case"canvas":return[new xe(K,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return iu({key:`${K}.type`,value:D.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:Ee,validateSpec:Be,styleSpec:he})}}function Zs(H){const D=H.value,K=H.styleSpec,he=K.light,Ee=H.style;let Be=[];const Ve=ps(D);if(D===void 0)return Be;if(Ve!=="object")return Be=Be.concat([new xe("light",D,`object expected, ${Ve} found`)]),Be;for(const nt in D){const mt=nt.match(/^(.*)-transition$/);Be=Be.concat(mt&&he[mt[1]]&&he[mt[1]].transition?H.validateSpec({key:nt,value:D[nt],valueSpec:K.transition,validateSpec:H.validateSpec,style:Ee,styleSpec:K}):he[nt]?H.validateSpec({key:nt,value:D[nt],valueSpec:he[nt],validateSpec:H.validateSpec,style:Ee,styleSpec:K}):[new xe(nt,D[nt],`unknown property "${nt}"`)])}return Be}function Ol(H){const D=H.value,K=H.styleSpec,he=K.sky,Ee=H.style,Be=ps(D);if(D===void 0)return[];if(Be!=="object")return[new xe("sky",D,`object expected, ${Be} found`)];let Ve=[];for(const nt in D)Ve=Ve.concat(he[nt]?H.validateSpec({key:nt,value:D[nt],valueSpec:he[nt],style:Ee,styleSpec:K}):[new xe(nt,D[nt],`unknown property "${nt}"`)]);return Ve}function bl(H){const D=H.value,K=H.styleSpec,he=K.terrain,Ee=H.style;let Be=[];const Ve=ps(D);if(D===void 0)return Be;if(Ve!=="object")return Be=Be.concat([new xe("terrain",D,`object expected, ${Ve} found`)]),Be;for(const nt in D)Be=Be.concat(he[nt]?H.validateSpec({key:nt,value:D[nt],valueSpec:he[nt],validateSpec:H.validateSpec,style:Ee,styleSpec:K}):[new xe(nt,D[nt],`unknown property "${nt}"`)]);return Be}function tc(H){let D=[];const K=H.value,he=H.key;if(Array.isArray(K)){const Ee=[],Be=[];for(const Ve in K)K[Ve].id&&Ee.includes(K[Ve].id)&&D.push(new xe(he,K,`all the sprites' ids must be unique, but ${K[Ve].id} is duplicated`)),Ee.push(K[Ve].id),K[Ve].url&&Be.includes(K[Ve].url)&&D.push(new xe(he,K,`all the sprites' URLs must be unique, but ${K[Ve].url} is duplicated`)),Be.push(K[Ve].url),D=D.concat(du({key:`${he}[${Ve}]`,value:K[Ve],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:H.validateSpec}));return D}return ou({key:he,value:K})}const Su={"*":()=>[],array:af,boolean:function(H){const D=H.value,K=H.key,he=ps(D);return he!=="boolean"?[new xe(K,D,`boolean expected, ${he} found`)]:[]},number:Rs,color:function(H){const D=H.key,K=H.value,he=ps(K);return he!=="string"?[new xe(D,K,`color expected, ${he} found`)]:Ot.parse(String(K))?[]:[new xe(D,K,`color expected, "${K}" found`)]},constants:mc,enum:iu,filter:xc,function:_c,layer:nf,object:du,source:Au,light:Zs,sky:Ol,terrain:bl,projection:function(H){const D=H.value,K=H.styleSpec,he=K.projection,Ee=H.style,Be=ps(D);if(D===void 0)return[];if(Be!=="object")return[new xe("projection",D,`object expected, ${Be} found`)];let Ve=[];for(const nt in D)Ve=Ve.concat(he[nt]?H.validateSpec({key:nt,value:D[nt],valueSpec:he[nt],style:Ee,styleSpec:K}):[new xe(nt,D[nt],`unknown property "${nt}"`)]);return Ve},string:ou,formatted:function(H){return ou(H).length===0?[]:ju(H)},resolvedImage:function(H){return ou(H).length===0?[]:ju(H)},padding:function(H){const D=H.key,K=H.value;if(ps(K)==="array"){if(K.length<1||K.length>4)return[new xe(D,K,`padding requires 1 to 4 values; ${K.length} values found`)];const he={type:"number"};let Ee=[];for(let Be=0;Be[]}})),H.constants&&(K=K.concat(mc({key:"constants",value:H.constants,style:H,styleSpec:D,validateSpec:Cc}))),Or(K)}function qr(H){return function(D){return H(av(Sf({},D),{validateSpec:Cc}))}}function Or(H){return[].concat(H).sort((D,K)=>D.line-K.line)}function ua(H){return function(...D){return Or(H.apply(this,D))}}ur.source=ua(qr(Au)),ur.sprite=ua(qr(tc)),ur.glyphs=ua(qr(Ht)),ur.light=ua(qr(Zs)),ur.sky=ua(qr(Ol)),ur.terrain=ua(qr(bl)),ur.layer=ua(qr(nf)),ur.filter=ua(qr(xc)),ur.paintProperty=ua(qr(Lf)),ur.layoutProperty=ua(qr(xl));const Fa=ur,ja=Fa.light,sn=Fa.sky,gn=Fa.paintProperty,kn=Fa.layoutProperty;function Ja(H,D){let K=!1;if(D&&D.length)for(const he of D)H.fire(new q(new Error(he.message))),K=!0;return K}class _n{constructor(D,K,he){const Ee=this.cells=[];if(D instanceof ArrayBuffer){this.arrayBuffer=D;const Ve=new Int32Array(this.arrayBuffer);D=Ve[0],this.d=(K=Ve[1])+2*(he=Ve[2]);for(let mt=0;mt=er[jr+0]&&Ee>=er[jr+1])?(nt[Rr]=!0,Ve.push(Xt[Rr])):nt[Rr]=!1}}}}_forEachCell(D,K,he,Ee,Be,Ve,nt,mt){const Pt=this._convertToCellCoord(D),Xt=this._convertToCellCoord(K),er=this._convertToCellCoord(he),br=this._convertToCellCoord(Ee);for(let Rr=Pt;Rr<=er;Rr++)for(let jr=Xt;jr<=br;jr++){const Yr=this.d*jr+Rr;if((!mt||mt(this._convertFromCellCoord(Rr),this._convertFromCellCoord(jr),this._convertFromCellCoord(Rr+1),this._convertFromCellCoord(jr+1)))&&Be.call(this,D,K,he,Ee,Yr,Ve,nt,mt))return}}_convertFromCellCoord(D){return(D-this.padding)/this.scale}_convertToCellCoord(D){return Math.max(0,Math.min(this.d-1,Math.floor(D*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const D=this.cells,K=3+this.cells.length+1+1;let he=0;for(let Ve=0;Ve=0)continue;const Ve=H[Be];Ee[Be]=on[K].shallow.indexOf(Be)>=0?Ve:ji(Ve,D)}H instanceof Error&&(Ee.message=H.message)}if(Ee.$name)throw new Error("$name property is reserved for worker serialization logic.");return K!=="Object"&&(Ee.$name=K),Ee}function Ni(H){if(ki(H))return H;if(Array.isArray(H))return H.map(Ni);if(typeof H!="object")throw new Error("can't deserialize object of type "+typeof H);const D=zi(H)||"Object";if(!on[D])throw new Error(`can't deserialize unregistered class ${D}`);const{klass:K}=on[D];if(!K)throw new Error(`can't deserialize unregistered class ${D}`);if(K.deserialize)return K.deserialize(H);const he=Object.create(K.prototype);for(const Ee of Object.keys(H)){if(Ee==="$name")continue;const Be=H[Ee];he[Ee]=on[D].shallow.indexOf(Ee)>=0?Be:Ni(Be)}return he}class Bn{constructor(){this.first=!0}update(D,K){const he=Math.floor(D);return this.first?(this.first=!1,this.lastIntegerZoom=he,this.lastIntegerZoomTime=0,this.lastZoom=D,this.lastFloorZoom=he,!0):(this.lastFloorZoom>he?(this.lastIntegerZoom=he+1,this.lastIntegerZoomTime=K):this.lastFloorZoomH>=128&&H<=255,"Hangul Jamo":H=>H>=4352&&H<=4607,Khmer:H=>H>=6016&&H<=6143,"General Punctuation":H=>H>=8192&&H<=8303,"Letterlike Symbols":H=>H>=8448&&H<=8527,"Number Forms":H=>H>=8528&&H<=8591,"Miscellaneous Technical":H=>H>=8960&&H<=9215,"Control Pictures":H=>H>=9216&&H<=9279,"Optical Character Recognition":H=>H>=9280&&H<=9311,"Enclosed Alphanumerics":H=>H>=9312&&H<=9471,"Geometric Shapes":H=>H>=9632&&H<=9727,"Miscellaneous Symbols":H=>H>=9728&&H<=9983,"Miscellaneous Symbols and Arrows":H=>H>=11008&&H<=11263,"Ideographic Description Characters":H=>H>=12272&&H<=12287,"CJK Symbols and Punctuation":H=>H>=12288&&H<=12351,Katakana:H=>H>=12448&&H<=12543,Kanbun:H=>H>=12688&&H<=12703,"CJK Strokes":H=>H>=12736&&H<=12783,"Enclosed CJK Letters and Months":H=>H>=12800&&H<=13055,"CJK Compatibility":H=>H>=13056&&H<=13311,"Yijing Hexagram Symbols":H=>H>=19904&&H<=19967,"Private Use Area":H=>H>=57344&&H<=63743,"Vertical Forms":H=>H>=65040&&H<=65055,"CJK Compatibility Forms":H=>H>=65072&&H<=65103,"Small Form Variants":H=>H>=65104&&H<=65135,"Halfwidth and Fullwidth Forms":H=>H>=65280&&H<=65519};function Ki(H){for(const D of H)if(jo(D.charCodeAt(0)))return!0;return!1}function ko(H){for(const D of H)if(!os(D.charCodeAt(0)))return!1;return!0}function $o(H){const D=H.map(K=>{try{return new RegExp(`\\p{sc=${K}}`,"u").source}catch{return null}}).filter(K=>K);return new RegExp(D.join("|"),"u")}const Ls=$o(["Arab","Dupl","Mong","Ougr","Syrc"]);function os(H){return!Ls.test(String.fromCodePoint(H))}const As=$o(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function jo(H){return!(H!==746&&H!==747&&(H<4352||!(An["CJK Compatibility Forms"](H)&&!(H>=65097&&H<=65103)||An["CJK Compatibility"](H)||An["CJK Strokes"](H)||!(!An["CJK Symbols and Punctuation"](H)||H>=12296&&H<=12305||H>=12308&&H<=12319||H===12336)||An["Enclosed CJK Letters and Months"](H)||An["Ideographic Description Characters"](H)||An.Kanbun(H)||An.Katakana(H)&&H!==12540||!(!An["Halfwidth and Fullwidth Forms"](H)||H===65288||H===65289||H===65293||H>=65306&&H<=65310||H===65339||H===65341||H===65343||H>=65371&&H<=65503||H===65507||H>=65512&&H<=65519)||!(!An["Small Form Variants"](H)||H>=65112&&H<=65118||H>=65123&&H<=65126)||An["Vertical Forms"](H)||An["Yijing Hexagram Symbols"](H)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(H))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(H))||As.test(String.fromCodePoint(H)))))}function il(H){return!(jo(H)||function(D){return!!(An["Latin-1 Supplement"](D)&&(D===167||D===169||D===174||D===177||D===188||D===189||D===190||D===215||D===247)||An["General Punctuation"](D)&&(D===8214||D===8224||D===8225||D===8240||D===8241||D===8251||D===8252||D===8258||D===8263||D===8264||D===8265||D===8273)||An["Letterlike Symbols"](D)||An["Number Forms"](D)||An["Miscellaneous Technical"](D)&&(D>=8960&&D<=8967||D>=8972&&D<=8991||D>=8996&&D<=9e3||D===9003||D>=9085&&D<=9114||D>=9150&&D<=9165||D===9167||D>=9169&&D<=9179||D>=9186&&D<=9215)||An["Control Pictures"](D)&&D!==9251||An["Optical Character Recognition"](D)||An["Enclosed Alphanumerics"](D)||An["Geometric Shapes"](D)||An["Miscellaneous Symbols"](D)&&!(D>=9754&&D<=9759)||An["Miscellaneous Symbols and Arrows"](D)&&(D>=11026&&D<=11055||D>=11088&&D<=11097||D>=11192&&D<=11243)||An["CJK Symbols and Punctuation"](D)||An.Katakana(D)||An["Private Use Area"](D)||An["CJK Compatibility Forms"](D)||An["Small Form Variants"](D)||An["Halfwidth and Fullwidth Forms"](D)||D===8734||D===8756||D===8757||D>=9984&&D<=10087||D>=10102&&D<=10131||D===65532||D===65533)}(H))}const Qs=$o(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Ss(H){return Qs.test(String.fromCodePoint(H))}function fi(H,D){return!(!D&&Ss(H)||H>=2304&&H<=3583||H>=3840&&H<=4255||An.Khmer(H))}function ao(H){for(const D of H)if(Ss(D.charCodeAt(0)))return!0;return!1}const gs=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(H){this.pluginStatus=H.pluginStatus,this.pluginURL=H.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(H){this.applyArabicShaping=H.applyArabicShaping,this.processBidirectionalText=H.processBidirectionalText,this.processStyledBidirectionalText=H.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class Jo{constructor(D,K){this.zoom=D,K?(this.now=K.now,this.fadeDuration=K.fadeDuration,this.zoomHistory=K.zoomHistory,this.transition=K.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Bn,this.transition={})}isSupportedScript(D){return function(K,he){for(const Ee of K)if(!fi(Ee.charCodeAt(0),he))return!1;return!0}(D,gs.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const D=this.zoom,K=D-Math.floor(D),he=this.crossFadingFactor();return D>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:K+(1-K)*he}:{fromScale:.5,toScale:1,t:1-(1-he)*K}}}class Bl{constructor(D,K){this.property=D,this.value=K,this.expression=function(he,Ee){if(Vc(he))return new Ns(he,Ee);if(Uu(he)){const Be=au(he,Ee);if(Be.result==="error")throw new Error(Be.value.map(Ve=>`${Ve.key}: ${Ve.message}`).join(", "));return Be.value}{let Be=he;return Ee.type==="color"&&typeof he=="string"?Be=Ot.parse(he):Ee.type!=="padding"||typeof he!="number"&&!Array.isArray(he)?Ee.type==="variableAnchorOffsetCollection"&&Array.isArray(he)&&(Be=Aa.parse(he)):Be=Ur.parse(he),{kind:"constant",evaluate:()=>Be}}}(K===void 0?D.specification.default:K,D.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(D,K,he){return this.property.possiblyEvaluate(this,D,K,he)}}class jl{constructor(D){this.property=D,this.value=new Bl(D,void 0)}transitioned(D,K){return new cc(this.property,this.value,K,M({},D.transition,this.transition),D.now)}untransitioned(){return new cc(this.property,this.value,null,{},0)}}class Vl{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitionablePropertyValues)}getValue(D){return u(this._values[D].value.value)}setValue(D,K){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new jl(this._values[D].property)),this._values[D].value=new Bl(this._values[D].property,K===null?void 0:u(K))}getTransition(D){return u(this._values[D].transition)}setTransition(D,K){Object.prototype.hasOwnProperty.call(this._values,D)||(this._values[D]=new jl(this._values[D].property)),this._values[D].transition=u(K)||void 0}serialize(){const D={};for(const K of Object.keys(this._values)){const he=this.getValue(K);he!==void 0&&(D[K]=he);const Ee=this.getTransition(K);Ee!==void 0&&(D[`${K}-transition`]=Ee)}return D}transitioned(D,K){const he=new ql(this._properties);for(const Ee of Object.keys(this._values))he._values[Ee]=this._values[Ee].transitioned(D,K._values[Ee]);return he}untransitioned(){const D=new ql(this._properties);for(const K of Object.keys(this._values))D._values[K]=this._values[K].untransitioned();return D}}class cc{constructor(D,K,he,Ee,Be){this.property=D,this.value=K,this.begin=Be+Ee.delay||0,this.end=this.begin+Ee.duration||0,D.specification.transition&&(Ee.delay||Ee.duration)&&(this.prior=he)}possiblyEvaluate(D,K,he){const Ee=D.now||0,Be=this.value.possiblyEvaluate(D,K,he),Ve=this.prior;if(Ve){if(Ee>this.end)return this.prior=null,Be;if(this.value.isDataDriven())return this.prior=null,Be;if(Ee=1)return 1;const Pt=mt*mt,Xt=Pt*mt;return 4*(mt<.5?Xt:3*(mt-Pt)+Xt-.75)}(nt))}}return Be}}class ql{constructor(D){this._properties=D,this._values=Object.create(D.defaultTransitioningPropertyValues)}possiblyEvaluate(D,K,he){const Ee=new rc(this._properties);for(const Be of Object.keys(this._values))Ee._values[Be]=this._values[Be].possiblyEvaluate(D,K,he);return Ee}hasTransition(){for(const D of Object.keys(this._values))if(this._values[D].prior)return!0;return!1}}class Vu{constructor(D){this._properties=D,this._values=Object.create(D.defaultPropertyValues)}hasValue(D){return this._values[D].value!==void 0}getValue(D){return u(this._values[D].value)}setValue(D,K){this._values[D]=new Bl(this._values[D].property,K===null?void 0:u(K))}serialize(){const D={};for(const K of Object.keys(this._values)){const he=this.getValue(K);he!==void 0&&(D[K]=he)}return D}possiblyEvaluate(D,K,he){const Ee=new rc(this._properties);for(const Be of Object.keys(this._values))Ee._values[Be]=this._values[Be].possiblyEvaluate(D,K,he);return Ee}}class ol{constructor(D,K,he){this.property=D,this.value=K,this.parameters=he}isConstant(){return this.value.kind==="constant"}constantOr(D){return this.value.kind==="constant"?this.value.value:D}evaluate(D,K,he,Ee){return this.property.evaluate(this.value,this.parameters,D,K,he,Ee)}}class rc{constructor(D){this._properties=D,this._values=Object.create(D.defaultPossiblyEvaluatedValues)}get(D){return this._values[D]}}class Vi{constructor(D){this.specification=D}possiblyEvaluate(D,K){if(D.isDataDriven())throw new Error("Value should not be data driven");return D.expression.evaluate(K)}interpolate(D,K,he){const Ee=Ci[this.specification.type];return Ee?Ee(D,K,he):D}}class eo{constructor(D,K){this.specification=D,this.overrides=K}possiblyEvaluate(D,K,he,Ee){return new ol(this,D.expression.kind==="constant"||D.expression.kind==="camera"?{kind:"constant",value:D.expression.evaluate(K,null,{},he,Ee)}:D.expression,K)}interpolate(D,K,he){if(D.value.kind!=="constant"||K.value.kind!=="constant")return D;if(D.value.value===void 0||K.value.value===void 0)return new ol(this,{kind:"constant",value:void 0},D.parameters);const Ee=Ci[this.specification.type];if(Ee){const Be=Ee(D.value.value,K.value.value,he);return new ol(this,{kind:"constant",value:Be},D.parameters)}return D}evaluate(D,K,he,Ee,Be,Ve){return D.kind==="constant"?D.value:D.evaluate(K,he,Ee,Be,Ve)}}class qu extends eo{possiblyEvaluate(D,K,he,Ee){if(D.value===void 0)return new ol(this,{kind:"constant",value:void 0},K);if(D.expression.kind==="constant"){const Be=D.expression.evaluate(K,null,{},he,Ee),Ve=D.property.specification.type==="resolvedImage"&&typeof Be!="string"?Be.name:Be,nt=this._calculate(Ve,Ve,Ve,K);return new ol(this,{kind:"constant",value:nt},K)}if(D.expression.kind==="camera"){const Be=this._calculate(D.expression.evaluate({zoom:K.zoom-1}),D.expression.evaluate({zoom:K.zoom}),D.expression.evaluate({zoom:K.zoom+1}),K);return new ol(this,{kind:"constant",value:Be},K)}return new ol(this,D.expression,K)}evaluate(D,K,he,Ee,Be,Ve){if(D.kind==="source"){const nt=D.evaluate(K,he,Ee,Be,Ve);return this._calculate(nt,nt,nt,K)}return D.kind==="composite"?this._calculate(D.evaluate({zoom:Math.floor(K.zoom)-1},he,Ee),D.evaluate({zoom:Math.floor(K.zoom)},he,Ee),D.evaluate({zoom:Math.floor(K.zoom)+1},he,Ee),K):D.value}_calculate(D,K,he,Ee){return Ee.zoom>Ee.zoomHistory.lastIntegerZoom?{from:D,to:K}:{from:he,to:K}}interpolate(D){return D}}class Du{constructor(D){this.specification=D}possiblyEvaluate(D,K,he,Ee){if(D.value!==void 0){if(D.expression.kind==="constant"){const Be=D.expression.evaluate(K,null,{},he,Ee);return this._calculate(Be,Be,Be,K)}return this._calculate(D.expression.evaluate(new Jo(Math.floor(K.zoom-1),K)),D.expression.evaluate(new Jo(Math.floor(K.zoom),K)),D.expression.evaluate(new Jo(Math.floor(K.zoom+1),K)),K)}}_calculate(D,K,he,Ee){return Ee.zoom>Ee.zoomHistory.lastIntegerZoom?{from:D,to:K}:{from:he,to:K}}interpolate(D){return D}}class wc{constructor(D){this.specification=D}possiblyEvaluate(D,K,he,Ee){return!!D.expression.evaluate(K,null,{},he,Ee)}interpolate(){return!1}}class De{constructor(D){this.properties=D,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const K in D){const he=D[K];he.specification.overridable&&this.overridableProperties.push(K);const Ee=this.defaultPropertyValues[K]=new Bl(he,void 0),Be=this.defaultTransitionablePropertyValues[K]=new jl(he);this.defaultTransitioningPropertyValues[K]=Be.untransitioned(),this.defaultPossiblyEvaluatedValues[K]=Ee.possiblyEvaluate({})}}}Wa("DataDrivenProperty",eo),Wa("DataConstantProperty",Vi),Wa("CrossFadedDataDrivenProperty",qu),Wa("CrossFadedProperty",Du),Wa("ColorRampProperty",wc);const I="-transition";class ne extends ae{constructor(D,K){if(super(),this.id=D.id,this.type=D.type,this._featureFilter={filter:()=>!0,needGeometry:!1},D.type!=="custom"&&(this.metadata=D.metadata,this.minzoom=D.minzoom,this.maxzoom=D.maxzoom,D.type!=="background"&&(this.source=D.source,this.sourceLayer=D["source-layer"],this.filter=D.filter),K.layout&&(this._unevaluatedLayout=new Vu(K.layout)),K.paint)){this._transitionablePaint=new Vl(K.paint);for(const he in D.paint)this.setPaintProperty(he,D.paint[he],{validate:!1});for(const he in D.layout)this.setLayoutProperty(he,D.layout[he],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new rc(K.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(D){return D==="visibility"?this.visibility:this._unevaluatedLayout.getValue(D)}setLayoutProperty(D,K,he={}){K!=null&&this._validate(kn,`layers.${this.id}.layout.${D}`,D,K,he)||(D!=="visibility"?this._unevaluatedLayout.setValue(D,K):this.visibility=K)}getPaintProperty(D){return D.endsWith(I)?this._transitionablePaint.getTransition(D.slice(0,-11)):this._transitionablePaint.getValue(D)}setPaintProperty(D,K,he={}){if(K!=null&&this._validate(gn,`layers.${this.id}.paint.${D}`,D,K,he))return!1;if(D.endsWith(I))return this._transitionablePaint.setTransition(D.slice(0,-11),K||void 0),!1;{const Ee=this._transitionablePaint._values[D],Be=Ee.property.specification["property-type"]==="cross-faded-data-driven",Ve=Ee.value.isDataDriven(),nt=Ee.value;this._transitionablePaint.setValue(D,K),this._handleSpecialPaintPropertyUpdate(D);const mt=this._transitionablePaint._values[D].value;return mt.isDataDriven()||Ve||Be||this._handleOverridablePaintPropertyUpdate(D,nt,mt)}}_handleSpecialPaintPropertyUpdate(D){}_handleOverridablePaintPropertyUpdate(D,K,he){return!1}isHidden(D){return!!(this.minzoom&&D=this.maxzoom)||this.visibility==="none"}updateTransitions(D){this._transitioningPaint=this._transitionablePaint.transitioned(D,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(D,K){D.getCrossfadeParameters&&(this._crossfadeParameters=D.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(D,void 0,K)),this.paint=this._transitioningPaint.possiblyEvaluate(D,void 0,K)}serialize(){const D={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&&(D.layout=D.layout||{},D.layout.visibility=this.visibility),p(D,(K,he)=>!(K===void 0||he==="layout"&&!Object.keys(K).length||he==="paint"&&!Object.keys(K).length))}_validate(D,K,he,Ee,Be={}){return(!Be||Be.validate!==!1)&&Ja(this,D.call(Fa,{key:K,layerType:this.type,objectKey:he,value:Ee,styleSpec:ie,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const D in this.paint._values){const K=this.paint.get(D);if(K instanceof ol&&eu(K.property.specification)&&(K.value.kind==="source"||K.value.kind==="composite")&&K.value.isStateDependent)return!0}return!1}}const Te={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Se{constructor(D,K){this._structArray=D,this._pos1=K*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Ie{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(D,K){return D._trim(),K&&(D.isTransferred=!0,K.push(D.arrayBuffer)),{length:D.length,arrayBuffer:D.arrayBuffer}}static deserialize(D){const K=Object.create(this.prototype);return K.arrayBuffer=D.arrayBuffer,K.length=D.length,K.capacity=D.arrayBuffer.byteLength/K.bytesPerElement,K._refreshViews(),K}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(D){this.reserve(D),this.length=D}reserve(D){if(D>this.capacity){this.capacity=Math.max(D,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const K=this.uint8;this._refreshViews(),K&&this.uint8.set(K)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function ot(H,D=1){let K=0,he=0;return{members:H.map(Ee=>{const Be=Te[Ee.type].BYTES_PER_ELEMENT,Ve=K=yt(K,Math.max(D,Be)),nt=Ee.components||1;return he=Math.max(he,Be),K+=Be*nt,{name:Ee.name,type:Ee.type,components:nt,offset:Ve}}),size:yt(K,Math.max(he,D)),alignment:D}}function yt(H,D){return Math.ceil(H/D)*D}class Ct extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K){const he=this.length;return this.resize(he+1),this.emplace(he,D,K)}emplace(D,K,he){const Ee=2*D;return this.int16[Ee+0]=K,this.int16[Ee+1]=he,D}}Ct.prototype.bytesPerElement=4,Wa("StructArrayLayout2i4",Ct);class Wt extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,D,K,he)}emplace(D,K,he,Ee){const Be=3*D;return this.int16[Be+0]=K,this.int16[Be+1]=he,this.int16[Be+2]=Ee,D}}Wt.prototype.bytesPerElement=6,Wa("StructArrayLayout3i6",Wt);class nr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee){const Be=this.length;return this.resize(Be+1),this.emplace(Be,D,K,he,Ee)}emplace(D,K,he,Ee,Be){const Ve=4*D;return this.int16[Ve+0]=K,this.int16[Ve+1]=he,this.int16[Ve+2]=Ee,this.int16[Ve+3]=Be,D}}nr.prototype.bytesPerElement=8,Wa("StructArrayLayout4i8",nr);class or extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve){const nt=this.length;return this.resize(nt+1),this.emplace(nt,D,K,he,Ee,Be,Ve)}emplace(D,K,he,Ee,Be,Ve,nt){const mt=6*D;return this.int16[mt+0]=K,this.int16[mt+1]=he,this.int16[mt+2]=Ee,this.int16[mt+3]=Be,this.int16[mt+4]=Ve,this.int16[mt+5]=nt,D}}or.prototype.bytesPerElement=12,Wa("StructArrayLayout2i4i12",or);class Fr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve){const nt=this.length;return this.resize(nt+1),this.emplace(nt,D,K,he,Ee,Be,Ve)}emplace(D,K,he,Ee,Be,Ve,nt){const mt=4*D,Pt=8*D;return this.int16[mt+0]=K,this.int16[mt+1]=he,this.uint8[Pt+4]=Ee,this.uint8[Pt+5]=Be,this.uint8[Pt+6]=Ve,this.uint8[Pt+7]=nt,D}}Fr.prototype.bytesPerElement=8,Wa("StructArrayLayout2i4ub8",Fr);class Wr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K){const he=this.length;return this.resize(he+1),this.emplace(he,D,K)}emplace(D,K,he){const Ee=2*D;return this.float32[Ee+0]=K,this.float32[Ee+1]=he,D}}Wr.prototype.bytesPerElement=8,Wa("StructArrayLayout2f8",Wr);class je extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt){const er=this.length;return this.resize(er+1),this.emplace(er,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt)}emplace(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er){const br=10*D;return this.uint16[br+0]=K,this.uint16[br+1]=he,this.uint16[br+2]=Ee,this.uint16[br+3]=Be,this.uint16[br+4]=Ve,this.uint16[br+5]=nt,this.uint16[br+6]=mt,this.uint16[br+7]=Pt,this.uint16[br+8]=Xt,this.uint16[br+9]=er,D}}je.prototype.bytesPerElement=20,Wa("StructArrayLayout10ui20",je);class Ze extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br){const Rr=this.length;return this.resize(Rr+1),this.emplace(Rr,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br)}emplace(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr){const jr=12*D;return this.int16[jr+0]=K,this.int16[jr+1]=he,this.int16[jr+2]=Ee,this.int16[jr+3]=Be,this.uint16[jr+4]=Ve,this.uint16[jr+5]=nt,this.uint16[jr+6]=mt,this.uint16[jr+7]=Pt,this.int16[jr+8]=Xt,this.int16[jr+9]=er,this.int16[jr+10]=br,this.int16[jr+11]=Rr,D}}Ze.prototype.bytesPerElement=24,Wa("StructArrayLayout4i4ui4i24",Ze);class at extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,he){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,D,K,he)}emplace(D,K,he,Ee){const Be=3*D;return this.float32[Be+0]=K,this.float32[Be+1]=he,this.float32[Be+2]=Ee,D}}at.prototype.bytesPerElement=12,Wa("StructArrayLayout3f12",at);class lt extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(D){const K=this.length;return this.resize(K+1),this.emplace(K,D)}emplace(D,K){return this.uint32[1*D+0]=K,D}}lt.prototype.bytesPerElement=4,Wa("StructArrayLayout1ul4",lt);class Tt extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve,nt,mt,Pt){const Xt=this.length;return this.resize(Xt+1),this.emplace(Xt,D,K,he,Ee,Be,Ve,nt,mt,Pt)}emplace(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt){const er=10*D,br=5*D;return this.int16[er+0]=K,this.int16[er+1]=he,this.int16[er+2]=Ee,this.int16[er+3]=Be,this.int16[er+4]=Ve,this.int16[er+5]=nt,this.uint32[br+3]=mt,this.uint16[er+8]=Pt,this.uint16[er+9]=Xt,D}}Tt.prototype.bytesPerElement=20,Wa("StructArrayLayout6i1ul2ui20",Tt);class gt extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve){const nt=this.length;return this.resize(nt+1),this.emplace(nt,D,K,he,Ee,Be,Ve)}emplace(D,K,he,Ee,Be,Ve,nt){const mt=6*D;return this.int16[mt+0]=K,this.int16[mt+1]=he,this.int16[mt+2]=Ee,this.int16[mt+3]=Be,this.int16[mt+4]=Ve,this.int16[mt+5]=nt,D}}gt.prototype.bytesPerElement=12,Wa("StructArrayLayout2i2i2i12",gt);class Et extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be){const Ve=this.length;return this.resize(Ve+1),this.emplace(Ve,D,K,he,Ee,Be)}emplace(D,K,he,Ee,Be,Ve){const nt=4*D,mt=8*D;return this.float32[nt+0]=K,this.float32[nt+1]=he,this.float32[nt+2]=Ee,this.int16[mt+6]=Be,this.int16[mt+7]=Ve,D}}Et.prototype.bytesPerElement=16,Wa("StructArrayLayout2f1f2i16",Et);class Yt extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee,Be,Ve){const nt=this.length;return this.resize(nt+1),this.emplace(nt,D,K,he,Ee,Be,Ve)}emplace(D,K,he,Ee,Be,Ve,nt){const mt=16*D,Pt=4*D,Xt=8*D;return this.uint8[mt+0]=K,this.uint8[mt+1]=he,this.float32[Pt+1]=Ee,this.float32[Pt+2]=Be,this.int16[Xt+6]=Ve,this.int16[Xt+7]=nt,D}}Yt.prototype.bytesPerElement=16,Wa("StructArrayLayout2ub2f2i16",Yt);class rr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,he){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,D,K,he)}emplace(D,K,he,Ee){const Be=3*D;return this.uint16[Be+0]=K,this.uint16[Be+1]=he,this.uint16[Be+2]=Ee,D}}rr.prototype.bytesPerElement=6,Wa("StructArrayLayout3ui6",rr);class sr extends Ie{_refreshViews(){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)}emplaceBack(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca){const un=this.length;return this.resize(un+1),this.emplace(un,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca)}emplace(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca,un){const Ha=24*D,rn=12*D,Sn=48*D;return this.int16[Ha+0]=K,this.int16[Ha+1]=he,this.uint16[Ha+2]=Ee,this.uint16[Ha+3]=Be,this.uint32[rn+2]=Ve,this.uint32[rn+3]=nt,this.uint32[rn+4]=mt,this.uint16[Ha+10]=Pt,this.uint16[Ha+11]=Xt,this.uint16[Ha+12]=er,this.float32[rn+7]=br,this.float32[rn+8]=Rr,this.uint8[Sn+36]=jr,this.uint8[Sn+37]=Yr,this.uint8[Sn+38]=ca,this.uint32[rn+10]=Ca,this.int16[Ha+22]=un,D}}sr.prototype.bytesPerElement=48,Wa("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",sr);class Sr extends Ie{_refreshViews(){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)}emplaceBack(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca,un,Ha,rn,Sn,$n,Oi,qo,qi,Di,mo,so){const to=this.length;return this.resize(to+1),this.emplace(to,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca,un,Ha,rn,Sn,$n,Oi,qo,qi,Di,mo,so)}emplace(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr,ca,Ca,un,Ha,rn,Sn,$n,Oi,qo,qi,Di,mo,so,to){const zn=32*D,To=16*D;return this.int16[zn+0]=K,this.int16[zn+1]=he,this.int16[zn+2]=Ee,this.int16[zn+3]=Be,this.int16[zn+4]=Ve,this.int16[zn+5]=nt,this.int16[zn+6]=mt,this.int16[zn+7]=Pt,this.uint16[zn+8]=Xt,this.uint16[zn+9]=er,this.uint16[zn+10]=br,this.uint16[zn+11]=Rr,this.uint16[zn+12]=jr,this.uint16[zn+13]=Yr,this.uint16[zn+14]=ca,this.uint16[zn+15]=Ca,this.uint16[zn+16]=un,this.uint16[zn+17]=Ha,this.uint16[zn+18]=rn,this.uint16[zn+19]=Sn,this.uint16[zn+20]=$n,this.uint16[zn+21]=Oi,this.uint16[zn+22]=qo,this.uint32[To+12]=qi,this.float32[To+13]=Di,this.float32[To+14]=mo,this.uint16[zn+30]=so,this.uint16[zn+31]=to,D}}Sr.prototype.bytesPerElement=64,Wa("StructArrayLayout8i15ui1ul2f2ui64",Sr);class Nr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D){const K=this.length;return this.resize(K+1),this.emplace(K,D)}emplace(D,K){return this.float32[1*D+0]=K,D}}Nr.prototype.bytesPerElement=4,Wa("StructArrayLayout1f4",Nr);class Qr extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,he){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,D,K,he)}emplace(D,K,he,Ee){const Be=3*D;return this.uint16[6*D+0]=K,this.float32[Be+1]=he,this.float32[Be+2]=Ee,D}}Qr.prototype.bytesPerElement=12,Wa("StructArrayLayout1ui2f12",Qr);class ia extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K,he){const Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,D,K,he)}emplace(D,K,he,Ee){const Be=4*D;return this.uint32[2*D+0]=K,this.uint16[Be+2]=he,this.uint16[Be+3]=Ee,D}}ia.prototype.bytesPerElement=8,Wa("StructArrayLayout1ul2ui8",ia);class _a extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D,K){const he=this.length;return this.resize(he+1),this.emplace(he,D,K)}emplace(D,K,he){const Ee=2*D;return this.uint16[Ee+0]=K,this.uint16[Ee+1]=he,D}}_a.prototype.bytesPerElement=4,Wa("StructArrayLayout2ui4",_a);class za extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(D){const K=this.length;return this.resize(K+1),this.emplace(K,D)}emplace(D,K){return this.uint16[1*D+0]=K,D}}za.prototype.bytesPerElement=2,Wa("StructArrayLayout1ui2",za);class nn extends Ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(D,K,he,Ee){const Be=this.length;return this.resize(Be+1),this.emplace(Be,D,K,he,Ee)}emplace(D,K,he,Ee,Be){const Ve=4*D;return this.float32[Ve+0]=K,this.float32[Ve+1]=he,this.float32[Ve+2]=Ee,this.float32[Ve+3]=Be,D}}nn.prototype.bytesPerElement=16,Wa("StructArrayLayout4f16",nn);class en extends Se{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new i(this.anchorPointX,this.anchorPointY)}}en.prototype.size=20;class ln extends Tt{get(D){return new en(this,D)}}Wa("CollisionBoxArray",ln);class Nn extends Se{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(D){this._structArray.uint8[this._pos1+37]=D}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(D){this._structArray.uint8[this._pos1+38]=D}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(D){this._structArray.uint32[this._pos4+10]=D}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Nn.prototype.size=48;class pi extends sr{get(D){return new Nn(this,D)}}Wa("PlacedSymbolArray",pi);class ii extends Se{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(D){this._structArray.uint32[this._pos4+12]=D}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}ii.prototype.size=64;class Gi extends Sr{get(D){return new ii(this,D)}}Wa("SymbolInstanceArray",Gi);class Bo extends Nr{getoffsetX(D){return this.float32[1*D+0]}}Wa("GlyphOffsetArray",Bo);class No extends Wt{getx(D){return this.int16[3*D+0]}gety(D){return this.int16[3*D+1]}gettileUnitDistanceFromAnchor(D){return this.int16[3*D+2]}}Wa("SymbolLineVertexArray",No);class po extends Se{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}po.prototype.size=12;class Zo extends Qr{get(D){return new po(this,D)}}Wa("TextAnchorOffsetArray",Zo);class Hs extends Se{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Hs.prototype.size=8;class zs extends ia{get(D){return new Hs(this,D)}}Wa("FeatureIndexArray",zs);class xo extends Ct{}class bo extends Ct{}class vl extends Ct{}class Al extends or{}class pu extends Fr{}class pe extends Wr{}class Le extends je{}class Ye extends Ze{}class ut extends at{}class ht extends lt{}class xt extends gt{}class zt extends Yt{}class Dt extends rr{}class $t extends _a{}const Cr=ot([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ar}=Cr;class Vr{constructor(D=[]){this.segments=D}prepareSegment(D,K,he,Ee){let Be=this.segments[this.segments.length-1];return D>Vr.MAX_VERTEX_ARRAY_LENGTH&&m(`Max vertices per segment is ${Vr.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${D}`),(!Be||Be.vertexLength+D>Vr.MAX_VERTEX_ARRAY_LENGTH||Be.sortKey!==Ee)&&(Be={vertexOffset:K.length,primitiveOffset:he.length,vertexLength:0,primitiveLength:0},Ee!==void 0&&(Be.sortKey=Ee),this.segments.push(Be)),Be}get(){return this.segments}destroy(){for(const D of this.segments)for(const K in D.vaos)D.vaos[K].destroy()}static simpleSegment(D,K,he,Ee){return new Vr([{vertexOffset:D,primitiveOffset:K,vertexLength:he,primitiveLength:Ee,vaos:{},sortKey:0}])}}function Kr(H,D){return 256*(H=b(Math.floor(H),0,255))+b(Math.floor(D),0,255)}Vr.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Wa("SegmentVector",Vr);const aa=ot([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Ua={exports:{}},la={exports:{}};la.exports=function(H,D){var K,he,Ee,Be,Ve,nt,mt,Pt;for(he=H.length-(K=3&H.length),Ee=D,Ve=3432918353,nt=461845907,Pt=0;Pt>>16)*Ve&65535)<<16)&4294967295)<<15|mt>>>17))*nt+(((mt>>>16)*nt&65535)<<16)&4294967295)<<13|Ee>>>19))+((5*(Ee>>>16)&65535)<<16)&4294967295))+((58964+(Be>>>16)&65535)<<16);switch(mt=0,K){case 3:mt^=(255&H.charCodeAt(Pt+2))<<16;case 2:mt^=(255&H.charCodeAt(Pt+1))<<8;case 1:Ee^=mt=(65535&(mt=(mt=(65535&(mt^=255&H.charCodeAt(Pt)))*Ve+(((mt>>>16)*Ve&65535)<<16)&4294967295)<<15|mt>>>17))*nt+(((mt>>>16)*nt&65535)<<16)&4294967295}return Ee^=H.length,Ee=2246822507*(65535&(Ee^=Ee>>>16))+((2246822507*(Ee>>>16)&65535)<<16)&4294967295,Ee=3266489909*(65535&(Ee^=Ee>>>13))+((3266489909*(Ee>>>16)&65535)<<16)&4294967295,(Ee^=Ee>>>16)>>>0};var Ta=la.exports,ka={exports:{}};ka.exports=function(H,D){for(var K,he=H.length,Ee=D^he,Be=0;he>=4;)K=1540483477*(65535&(K=255&H.charCodeAt(Be)|(255&H.charCodeAt(++Be))<<8|(255&H.charCodeAt(++Be))<<16|(255&H.charCodeAt(++Be))<<24))+((1540483477*(K>>>16)&65535)<<16),Ee=1540483477*(65535&Ee)+((1540483477*(Ee>>>16)&65535)<<16)^(K=1540483477*(65535&(K^=K>>>24))+((1540483477*(K>>>16)&65535)<<16)),he-=4,++Be;switch(he){case 3:Ee^=(255&H.charCodeAt(Be+2))<<16;case 2:Ee^=(255&H.charCodeAt(Be+1))<<8;case 1:Ee=1540483477*(65535&(Ee^=255&H.charCodeAt(Be)))+((1540483477*(Ee>>>16)&65535)<<16)}return Ee=1540483477*(65535&(Ee^=Ee>>>13))+((1540483477*(Ee>>>16)&65535)<<16),(Ee^=Ee>>>15)>>>0};var Ba=Ta,Va=ka.exports;Ua.exports=Ba,Ua.exports.murmur3=Ba,Ua.exports.murmur2=Va;var Ma=r(Ua.exports);class mn{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(D,K,he,Ee){this.ids.push(Wn(D)),this.positions.push(K,he,Ee)}getPositions(D){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const K=Wn(D);let he=0,Ee=this.ids.length-1;for(;he>1;this.ids[Ve]>=K?Ee=Ve:he=Ve+1}const Be=[];for(;this.ids[he]===K;)Be.push({index:this.positions[3*he],start:this.positions[3*he+1],end:this.positions[3*he+2]}),he++;return Be}static serialize(D,K){const he=new Float64Array(D.ids),Ee=new Uint32Array(D.positions);return jn(he,Ee,0,he.length-1),K&&K.push(he.buffer,Ee.buffer),{ids:he,positions:Ee}}static deserialize(D){const K=new mn;return K.ids=D.ids,K.positions=D.positions,K.indexed=!0,K}}function Wn(H){const D=+H;return!isNaN(D)&&D<=Number.MAX_SAFE_INTEGER?D:Ma(String(H))}function jn(H,D,K,he){for(;K>1];let Be=K-1,Ve=he+1;for(;;){do Be++;while(H[Be]Ee);if(Be>=Ve)break;Zn(H,Be,Ve),Zn(D,3*Be,3*Ve),Zn(D,3*Be+1,3*Ve+1),Zn(D,3*Be+2,3*Ve+2)}Ve-K`u_${Ee}`),this.type=he}setUniform(D,K,he){D.set(he.constantOr(this.value))}getBinding(D,K,he){return this.type==="color"?new wi(D,K):new _i(D,K)}}class Ms{constructor(D,K){this.uniformNames=K.map(he=>`u_${he}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(D,K){this.pixelRatioFrom=K.pixelRatio,this.pixelRatioTo=D.pixelRatio,this.patternFrom=K.tlbr,this.patternTo=D.tlbr}setUniform(D,K,he,Ee){const Be=Ee==="u_pattern_to"?this.patternTo:Ee==="u_pattern_from"?this.patternFrom:Ee==="u_pixel_ratio_to"?this.pixelRatioTo:Ee==="u_pixel_ratio_from"?this.pixelRatioFrom:null;Be&&D.set(Be)}getBinding(D,K,he){return he.substr(0,9)==="u_pattern"?new Po(D,K):new _i(D,K)}}class Kn{constructor(D,K,he,Ee){this.expression=D,this.type=he,this.maxValue=0,this.paintVertexAttributes=K.map(Be=>({name:`a_${Be}`,type:"Float32",components:he==="color"?2:1,offset:0})),this.paintVertexArray=new Ee}populatePaintArray(D,K,he,Ee,Be){const Ve=this.paintVertexArray.length,nt=this.expression.evaluate(new Jo(0),K,{},Ee,[],Be);this.paintVertexArray.resize(D),this._setPaintValue(Ve,D,nt)}updatePaintArray(D,K,he,Ee){const Be=this.expression.evaluate({zoom:0},he,Ee);this._setPaintValue(D,K,Be)}_setPaintValue(D,K,he){if(this.type==="color"){const Ee=Vo(he);for(let Be=D;Be`u_${nt}_t`),this.type=he,this.useIntegerZoom=Ee,this.zoom=Be,this.maxValue=0,this.paintVertexAttributes=K.map(nt=>({name:`a_${nt}`,type:"Float32",components:he==="color"?4:2,offset:0})),this.paintVertexArray=new Ve}populatePaintArray(D,K,he,Ee,Be){const Ve=this.expression.evaluate(new Jo(this.zoom),K,{},Ee,[],Be),nt=this.expression.evaluate(new Jo(this.zoom+1),K,{},Ee,[],Be),mt=this.paintVertexArray.length;this.paintVertexArray.resize(D),this._setPaintValue(mt,D,Ve,nt)}updatePaintArray(D,K,he,Ee){const Be=this.expression.evaluate({zoom:this.zoom},he,Ee),Ve=this.expression.evaluate({zoom:this.zoom+1},he,Ee);this._setPaintValue(D,K,Be,Ve)}_setPaintValue(D,K,he,Ee){if(this.type==="color"){const Be=Vo(he),Ve=Vo(Ee);for(let nt=D;nt`#define HAS_UNIFORM_${Ee}`))}return D}getBinderAttributes(){const D=[];for(const K in this.binders){const he=this.binders[K];if(he instanceof Kn||he instanceof go)for(let Ee=0;Ee!0){this.programConfigurations={};for(const Ee of D)this.programConfigurations[Ee.id]=new Es(Ee,K,he);this.needsUpload=!1,this._featureMap=new mn,this._bufferOffset=0}populatePaintArrays(D,K,he,Ee,Be,Ve){for(const nt in this.programConfigurations)this.programConfigurations[nt].populatePaintArrays(D,K,Ee,Be,Ve);K.id!==void 0&&this._featureMap.add(K.id,he,this._bufferOffset,D),this._bufferOffset=D,this.needsUpload=!0}updatePaintArrays(D,K,he,Ee){for(const Be of he)this.needsUpload=this.programConfigurations[Be.id].updatePaintArrays(D,this._featureMap,K,Be,Ee)||this.needsUpload}get(D){return this.programConfigurations[D]}upload(D){if(this.needsUpload){for(const K in this.programConfigurations)this.programConfigurations[K].upload(D);this.needsUpload=!1}}destroy(){for(const D in this.programConfigurations)this.programConfigurations[D].destroy()}}function Hl(H,D){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[H]||[H.replace(`${D}-`,"").replace(/-/g,"_")]}function Qo(H,D,K){const he={color:{source:Wr,composite:nn},number:{source:Nr,composite:Wr}},Ee=function(Be){return{"line-pattern":{source:Le,composite:Le},"fill-pattern":{source:Le,composite:Le},"fill-extrusion-pattern":{source:Le,composite:Le}}[Be]}(H);return Ee&&Ee[K]||he[D][K]}Wa("ConstantBinder",sl),Wa("CrossFadedConstantBinder",Ms),Wa("SourceExpressionBinder",Kn),Wa("CrossFadedCompositeBinder",Do),Wa("CompositeExpressionBinder",go),Wa("ProgramConfiguration",Es,{omit:["_buffers"]}),Wa("ProgramConfigurationSet",hs);const _s=8192,gu=Math.pow(2,14)-1,el=-gu-1;function cr(H){const D=_s/H.extent,K=H.loadGeometry();for(let he=0;heVe.x+1||mtVe.y+1)&&m("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return K}function fa(H,D){return{type:H.type,id:H.id,properties:H.properties,geometry:D?cr(H):[]}}function xa(H,D,K,he,Ee){H.emplaceBack(2*D+(he+1)/2,2*K+(Ee+1)/2)}class cn{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(K=>K.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new bo,this.indexArray=new Dt,this.segments=new Vr,this.programConfigurations=new hs(D.layers,D.zoom),this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,he){const Ee=this.layers[0],Be=[];let Ve=null,nt=!1;Ee.type==="circle"&&(Ve=Ee.layout.get("circle-sort-key"),nt=!Ve.isConstant());for(const{feature:mt,id:Pt,index:Xt,sourceLayerIndex:er}of D){const br=this.layers[0]._featureFilter.needGeometry,Rr=fa(mt,br);if(!this.layers[0]._featureFilter.filter(new Jo(this.zoom),Rr,he))continue;const jr=nt?Ve.evaluate(Rr,{},he):void 0,Yr={id:Pt,properties:mt.properties,type:mt.type,sourceLayerIndex:er,index:Xt,geometry:br?Rr.geometry:cr(mt),patterns:{},sortKey:jr};Be.push(Yr)}nt&&Be.sort((mt,Pt)=>mt.sortKey-Pt.sortKey);for(const mt of Be){const{geometry:Pt,index:Xt,sourceLayerIndex:er}=mt,br=D[Xt].feature;this.addFeature(mt,Pt,Xt,he),K.featureIndex.insert(br,Pt,Xt,er,this.index)}}update(D,K,he){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,he)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Ar),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(D,K,he,Ee){for(const Be of K)for(const Ve of Be){const nt=Ve.x,mt=Ve.y;if(nt<0||nt>=_s||mt<0||mt>=_s)continue;const Pt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,D.sortKey),Xt=Pt.vertexLength;xa(this.layoutVertexArray,nt,mt,-1,-1),xa(this.layoutVertexArray,nt,mt,1,-1),xa(this.layoutVertexArray,nt,mt,1,1),xa(this.layoutVertexArray,nt,mt,-1,1),this.indexArray.emplaceBack(Xt,Xt+1,Xt+2),this.indexArray.emplaceBack(Xt,Xt+3,Xt+2),Pt.vertexLength+=4,Pt.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,he,{},Ee)}}function In(H,D){for(let K=0;K1){if(Un(H,D))return!0;for(let he=0;he1?K:K.sub(D)._mult(Ee)._add(D))}function Ti(H,D){let K,he,Ee,Be=!1;for(let Ve=0;VeD.y!=Ee.y>D.y&&D.x<(Ee.x-he.x)*(D.y-he.y)/(Ee.y-he.y)+he.x&&(Be=!Be)}return Be}function si(H,D){let K=!1;for(let he=0,Ee=H.length-1;heD.y!=Ve.y>D.y&&D.x<(Ve.x-Be.x)*(D.y-Be.y)/(Ve.y-Be.y)+Be.x&&(K=!K)}return K}function Fn(H,D,K){const he=K[0],Ee=K[2];if(H.xEe.x&&D.x>Ee.x||H.yEe.y&&D.y>Ee.y)return!1;const Be=R(H,D,K[0]);return Be!==R(H,D,K[1])||Be!==R(H,D,K[2])||Be!==R(H,D,K[3])}function qa(H,D,K){const he=D.paint.get(H).value;return he.kind==="constant"?he.value:K.programConfigurations.get(D.id).getMaxValue(H)}function wn(H){return Math.sqrt(H[0]*H[0]+H[1]*H[1])}function Tn(H,D,K,he,Ee){if(!D[0]&&!D[1])return H;const Be=i.convert(D)._mult(Ee);K==="viewport"&&Be._rotate(-he);const Ve=[];for(let nt=0;ntro(ca,Yr))}(Pt,mt),Rr=er?Xt*nt:Xt;for(const jr of Ee)for(const Yr of jr){const ca=er?Yr:ro(Yr,mt);let Ca=Rr;const un=gi([],[Yr.x,Yr.y,0,1],mt);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Ca*=un[3]/Ve.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Ca*=Ve.cameraToCenterDistance/un[3]),Da(br,ca,Ca))return!0}return!1}}function ro(H,D){const K=gi([],[H.x,H.y,0,1],D);return new i(K[0]/K[3],K[1]/K[3])}class es extends cn{}let Fi;Wa("HeatmapBucket",es,{omit:["layers"]});var no={get paint(){return Fi=Fi||new De({"heatmap-radius":new eo(ie.paint_heatmap["heatmap-radius"]),"heatmap-weight":new eo(ie.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Vi(ie.paint_heatmap["heatmap-intensity"]),"heatmap-color":new wc(ie.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Vi(ie.paint_heatmap["heatmap-opacity"])})}};function oi(H,{width:D,height:K},he,Ee){if(Ee){if(Ee instanceof Uint8ClampedArray)Ee=new Uint8Array(Ee.buffer);else if(Ee.length!==D*K*he)throw new RangeError(`mismatched image size. expected: ${Ee.length} but got: ${D*K*he}`)}else Ee=new Uint8Array(D*K*he);return H.width=D,H.height=K,H.data=Ee,H}function Xo(H,{width:D,height:K},he){if(D===H.width&&K===H.height)return;const Ee=oi({},{width:D,height:K},he);ys(H,Ee,{x:0,y:0},{x:0,y:0},{width:Math.min(H.width,D),height:Math.min(H.height,K)},he),H.width=D,H.height=K,H.data=Ee.data}function ys(H,D,K,he,Ee,Be){if(Ee.width===0||Ee.height===0)return D;if(Ee.width>H.width||Ee.height>H.height||K.x>H.width-Ee.width||K.y>H.height-Ee.height)throw new RangeError("out of range source coordinates for image copy");if(Ee.width>D.width||Ee.height>D.height||he.x>D.width-Ee.width||he.y>D.height-Ee.height)throw new RangeError("out of range destination coordinates for image copy");const Ve=H.data,nt=D.data;if(Ve===nt)throw new Error("srcData equals dstData, so image is already copied");for(let mt=0;mt{D[H.evaluationKey]=mt;const Pt=H.expression.evaluate(D);Ee.data[Ve+nt+0]=Math.floor(255*Pt.r/Pt.a),Ee.data[Ve+nt+1]=Math.floor(255*Pt.g/Pt.a),Ee.data[Ve+nt+2]=Math.floor(255*Pt.b/Pt.a),Ee.data[Ve+nt+3]=Math.floor(255*Pt.a)};if(H.clips)for(let Ve=0,nt=0;Ve80*K){nt=1/0,mt=1/0;let Xt=-1/0,er=-1/0;for(let br=K;brXt&&(Xt=Rr),jr>er&&(er=jr)}Pt=Math.max(Xt-nt,er-mt),Pt=Pt!==0?32767/Pt:0}return ll(Be,Ve,K,nt,mt,Pt,0),Ve}function Fo(H,D,K,he,Ee){let Be;if(Ee===function(Ve,nt,mt,Pt){let Xt=0;for(let er=nt,br=mt-Pt;er0)for(let Ve=D;Ve=D;Ve-=he)Be=Kt(Ve/he|0,H[Ve],H[Ve+1],Be);return Be&&tt(Be,Be.next)&&(vr(Be),Be=Be.next),Be}function nc(H,D){if(!H)return H;D||(D=H);let K,he=H;do if(K=!1,he.steiner||!tt(he,he.next)&&Ue(he.prev,he,he.next)!==0)he=he.next;else{if(vr(he),he=D=he.prev,he===he.next)break;K=!0}while(K||he!==D);return D}function ll(H,D,K,he,Ee,Be,Ve){if(!H)return;!Ve&&Be&&function(mt,Pt,Xt,er){let br=mt;do br.z===0&&(br.z=W(br.x,br.y,Pt,Xt,er)),br.prevZ=br.prev,br.nextZ=br.next,br=br.next;while(br!==mt);br.prevZ.nextZ=null,br.prevZ=null,function(Rr){let jr,Yr=1;do{let ca,Ca=Rr;Rr=null;let un=null;for(jr=0;Ca;){jr++;let Ha=Ca,rn=0;for(let $n=0;$n0||Sn>0&&Ha;)rn!==0&&(Sn===0||!Ha||Ca.z<=Ha.z)?(ca=Ca,Ca=Ca.nextZ,rn--):(ca=Ha,Ha=Ha.nextZ,Sn--),un?un.nextZ=ca:Rr=ca,ca.prevZ=un,un=ca;Ca=Ha}un.nextZ=null,Yr*=2}while(jr>1)}(br)}(H,he,Ee,Be);let nt=H;for(;H.prev!==H.next;){const mt=H.prev,Pt=H.next;if(Be?qc(H,he,Ee,Be):Sl(H))D.push(mt.i,H.i,Pt.i),vr(H),H=Pt.next,nt=Pt.next;else if((H=Pt)===nt){Ve?Ve===1?ll(H=Hc(nc(H),D),D,K,he,Ee,Be,2):Ve===2&&ss(H,D,K,he,Ee,Be):ll(nc(H),D,K,he,Ee,Be,1);break}}}function Sl(H){const D=H.prev,K=H,he=H.next;if(Ue(D,K,he)>=0)return!1;const Ee=D.x,Be=K.x,Ve=he.x,nt=D.y,mt=K.y,Pt=he.y,Xt=EeBe?Ee>Ve?Ee:Ve:Be>Ve?Be:Ve,Rr=nt>mt?nt>Pt?nt:Pt:mt>Pt?mt:Pt;let jr=he.next;for(;jr!==D;){if(jr.x>=Xt&&jr.x<=br&&jr.y>=er&&jr.y<=Rr&&te(Ee,nt,Be,mt,Ve,Pt,jr.x,jr.y)&&Ue(jr.prev,jr,jr.next)>=0)return!1;jr=jr.next}return!0}function qc(H,D,K,he){const Ee=H.prev,Be=H,Ve=H.next;if(Ue(Ee,Be,Ve)>=0)return!1;const nt=Ee.x,mt=Be.x,Pt=Ve.x,Xt=Ee.y,er=Be.y,br=Ve.y,Rr=ntmt?nt>Pt?nt:Pt:mt>Pt?mt:Pt,ca=Xt>er?Xt>br?Xt:br:er>br?er:br,Ca=W(Rr,jr,D,K,he),un=W(Yr,ca,D,K,he);let Ha=H.prevZ,rn=H.nextZ;for(;Ha&&Ha.z>=Ca&&rn&&rn.z<=un;){if(Ha.x>=Rr&&Ha.x<=Yr&&Ha.y>=jr&&Ha.y<=ca&&Ha!==Ee&&Ha!==Ve&&te(nt,Xt,mt,er,Pt,br,Ha.x,Ha.y)&&Ue(Ha.prev,Ha,Ha.next)>=0||(Ha=Ha.prevZ,rn.x>=Rr&&rn.x<=Yr&&rn.y>=jr&&rn.y<=ca&&rn!==Ee&&rn!==Ve&&te(nt,Xt,mt,er,Pt,br,rn.x,rn.y)&&Ue(rn.prev,rn,rn.next)>=0))return!1;rn=rn.nextZ}for(;Ha&&Ha.z>=Ca;){if(Ha.x>=Rr&&Ha.x<=Yr&&Ha.y>=jr&&Ha.y<=ca&&Ha!==Ee&&Ha!==Ve&&te(nt,Xt,mt,er,Pt,br,Ha.x,Ha.y)&&Ue(Ha.prev,Ha,Ha.next)>=0)return!1;Ha=Ha.prevZ}for(;rn&&rn.z<=un;){if(rn.x>=Rr&&rn.x<=Yr&&rn.y>=jr&&rn.y<=ca&&rn!==Ee&&rn!==Ve&&te(nt,Xt,mt,er,Pt,br,rn.x,rn.y)&&Ue(rn.prev,rn,rn.next)>=0)return!1;rn=rn.nextZ}return!0}function Hc(H,D){let K=H;do{const he=K.prev,Ee=K.next.next;!tt(he,Ee)&&ft(he,K,K.next,Ee)&&It(he,Ee)&&It(Ee,he)&&(D.push(he.i,K.i,Ee.i),vr(K),vr(K.next),K=H=Ee),K=K.next}while(K!==H);return nc(K)}function ss(H,D,K,he,Ee,Be){let Ve=H;do{let nt=Ve.next.next;for(;nt!==Ve.prev;){if(Ve.i!==nt.i&&me(Ve,nt)){let mt=Jt(Ve,nt);return Ve=nc(Ve,Ve.next),mt=nc(mt,mt.next),ll(Ve,D,K,he,Ee,Be,0),void ll(mt,D,K,he,Ee,Be,0)}nt=nt.next}Ve=Ve.next}while(Ve!==H)}function js(H,D){return H.x-D.x}function ls(H,D){const K=function(Ee,Be){let Ve=Be;const nt=Ee.x,mt=Ee.y;let Pt,Xt=-1/0;do{if(mt<=Ve.y&&mt>=Ve.next.y&&Ve.next.y!==Ve.y){const Yr=Ve.x+(mt-Ve.y)*(Ve.next.x-Ve.x)/(Ve.next.y-Ve.y);if(Yr<=nt&&Yr>Xt&&(Xt=Yr,Pt=Ve.x=Ve.x&&Ve.x>=br&&nt!==Ve.x&&te(mtPt.x||Ve.x===Pt.x&&ye(Pt,Ve)))&&(Pt=Ve,jr=Yr)}Ve=Ve.next}while(Ve!==er);return Pt}(H,D);if(!K)return D;const he=Jt(K,H);return nc(he,he.next),nc(K,K.next)}function ye(H,D){return Ue(H.prev,H,D.prev)<0&&Ue(D.next,H,H.next)<0}function W(H,D,K,he,Ee){return(H=1431655765&((H=858993459&((H=252645135&((H=16711935&((H=(H-K)*Ee|0)|H<<8))|H<<4))|H<<2))|H<<1))|(D=1431655765&((D=858993459&((D=252645135&((D=16711935&((D=(D-he)*Ee|0)|D<<8))|D<<4))|D<<2))|D<<1))<<1}function de(H){let D=H,K=H;do(D.x=(H-Ve)*(Be-nt)&&(H-Ve)*(he-nt)>=(K-Ve)*(D-nt)&&(K-Ve)*(Be-nt)>=(Ee-Ve)*(he-nt)}function me(H,D){return H.next.i!==D.i&&H.prev.i!==D.i&&!function(K,he){let Ee=K;do{if(Ee.i!==K.i&&Ee.next.i!==K.i&&Ee.i!==he.i&&Ee.next.i!==he.i&&ft(Ee,Ee.next,K,he))return!0;Ee=Ee.next}while(Ee!==K);return!1}(H,D)&&(It(H,D)&&It(D,H)&&function(K,he){let Ee=K,Be=!1;const Ve=(K.x+he.x)/2,nt=(K.y+he.y)/2;do Ee.y>nt!=Ee.next.y>nt&&Ee.next.y!==Ee.y&&Ve<(Ee.next.x-Ee.x)*(nt-Ee.y)/(Ee.next.y-Ee.y)+Ee.x&&(Be=!Be),Ee=Ee.next;while(Ee!==K);return Be}(H,D)&&(Ue(H.prev,H,D.prev)||Ue(H,D.prev,D))||tt(H,D)&&Ue(H.prev,H,H.next)>0&&Ue(D.prev,D,D.next)>0)}function Ue(H,D,K){return(D.y-H.y)*(K.x-D.x)-(D.x-H.x)*(K.y-D.y)}function tt(H,D){return H.x===D.x&&H.y===D.y}function ft(H,D,K,he){const Ee=bt(Ue(H,D,K)),Be=bt(Ue(H,D,he)),Ve=bt(Ue(K,he,H)),nt=bt(Ue(K,he,D));return Ee!==Be&&Ve!==nt||!(Ee!==0||!st(H,K,D))||!(Be!==0||!st(H,he,D))||!(Ve!==0||!st(K,H,he))||!(nt!==0||!st(K,D,he))}function st(H,D,K){return D.x<=Math.max(H.x,K.x)&&D.x>=Math.min(H.x,K.x)&&D.y<=Math.max(H.y,K.y)&&D.y>=Math.min(H.y,K.y)}function bt(H){return H>0?1:H<0?-1:0}function It(H,D){return Ue(H.prev,H,H.next)<0?Ue(H,D,H.next)>=0&&Ue(H,H.prev,D)>=0:Ue(H,D,H.prev)<0||Ue(H,H.next,D)<0}function Jt(H,D){const K=Tr(H.i,H.x,H.y),he=Tr(D.i,D.x,D.y),Ee=H.next,Be=D.prev;return H.next=D,D.prev=H,K.next=Ee,Ee.prev=K,he.next=K,K.prev=he,Be.next=he,he.prev=Be,he}function Kt(H,D,K,he){const Ee=Tr(H,D,K);return he?(Ee.next=he.next,Ee.prev=he,he.next.prev=Ee,he.next=Ee):(Ee.prev=Ee,Ee.next=Ee),Ee}function vr(H){H.next.prev=H.prev,H.prev.next=H.next,H.prevZ&&(H.prevZ.nextZ=H.nextZ),H.nextZ&&(H.nextZ.prevZ=H.prevZ)}function Tr(H,D,K){return{i:H,x:D,y:K,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function wr(H,D,K){const he=K.patternDependencies;let Ee=!1;for(const Be of D){const Ve=Be.paint.get(`${H}-pattern`);Ve.isConstant()||(Ee=!0);const nt=Ve.constantOr(null);nt&&(Ee=!0,he[nt.to]=!0,he[nt.from]=!0)}return Ee}function tr(H,D,K,he,Ee){const Be=Ee.patternDependencies;for(const Ve of D){const nt=Ve.paint.get(`${H}-pattern`).value;if(nt.kind!=="constant"){let mt=nt.evaluate({zoom:he-1},K,{},Ee.availableImages),Pt=nt.evaluate({zoom:he},K,{},Ee.availableImages),Xt=nt.evaluate({zoom:he+1},K,{},Ee.availableImages);mt=mt&&mt.name?mt.name:mt,Pt=Pt&&Pt.name?Pt.name:Pt,Xt=Xt&&Xt.name?Xt.name:Xt,Be[mt]=!0,Be[Pt]=!0,Be[Xt]=!0,K.patterns[Ve.id]={min:mt,mid:Pt,max:Xt}}}return K}class pr{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(K=>K.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new vl,this.indexArray=new Dt,this.indexArray2=new $t,this.programConfigurations=new hs(D.layers,D.zoom),this.segments=new Vr,this.segments2=new Vr,this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,he){this.hasPattern=wr("fill",this.layers,K);const Ee=this.layers[0].layout.get("fill-sort-key"),Be=!Ee.isConstant(),Ve=[];for(const{feature:nt,id:mt,index:Pt,sourceLayerIndex:Xt}of D){const er=this.layers[0]._featureFilter.needGeometry,br=fa(nt,er);if(!this.layers[0]._featureFilter.filter(new Jo(this.zoom),br,he))continue;const Rr=Be?Ee.evaluate(br,{},he,K.availableImages):void 0,jr={id:mt,properties:nt.properties,type:nt.type,sourceLayerIndex:Xt,index:Pt,geometry:er?br.geometry:cr(nt),patterns:{},sortKey:Rr};Ve.push(jr)}Be&&Ve.sort((nt,mt)=>nt.sortKey-mt.sortKey);for(const nt of Ve){const{geometry:mt,index:Pt,sourceLayerIndex:Xt}=nt;if(this.hasPattern){const er=tr("fill",this.layers,nt,this.zoom,K);this.patternFeatures.push(er)}else this.addFeature(nt,mt,Pt,he,{});K.featureIndex.insert(D[Pt].feature,mt,Pt,Xt,this.index)}}update(D,K,he){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,he)}addFeatures(D,K,he){for(const Ee of this.patternFeatures)this.addFeature(Ee,Ee.geometry,Ee.index,K,he)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,su),this.indexBuffer=D.createIndexBuffer(this.indexArray),this.indexBuffer2=D.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(D,K,he,Ee,Be){for(const Ve of Lu(K,500)){let nt=0;for(const Rr of Ve)nt+=Rr.length;const mt=this.segments.prepareSegment(nt,this.layoutVertexArray,this.indexArray),Pt=mt.vertexLength,Xt=[],er=[];for(const Rr of Ve){if(Rr.length===0)continue;Rr!==Ve[0]&&er.push(Xt.length/2);const jr=this.segments2.prepareSegment(Rr.length,this.layoutVertexArray,this.indexArray2),Yr=jr.vertexLength;this.layoutVertexArray.emplaceBack(Rr[0].x,Rr[0].y),this.indexArray2.emplaceBack(Yr+Rr.length-1,Yr),Xt.push(Rr[0].x),Xt.push(Rr[0].y);for(let ca=1;ca>3}if(Ee--,he===1||he===2)Be+=H.readSVarint(),Ve+=H.readSVarint(),he===1&&(D&&nt.push(D),D=[]),D.push(new hn(Be,Ve));else{if(he!==7)throw new Error("unknown command "+he);D&&D.push(D[0].clone())}}return D&&nt.push(D),nt},fn.prototype.bbox=function(){var H=this._pbf;H.pos=this._geometry;for(var D=H.readVarint()+H.pos,K=1,he=0,Ee=0,Be=0,Ve=1/0,nt=-1/0,mt=1/0,Pt=-1/0;H.pos>3}if(he--,K===1||K===2)(Ee+=H.readSVarint())nt&&(nt=Ee),(Be+=H.readSVarint())Pt&&(Pt=Be);else if(K!==7)throw new Error("unknown command "+K)}return[Ve,mt,nt,Pt]},fn.prototype.toGeoJSON=function(H,D,K){var he,Ee,Be=this.extent*Math.pow(2,K),Ve=this.extent*H,nt=this.extent*D,mt=this.loadGeometry(),Pt=fn.types[this.type];function Xt(Rr){for(var jr=0;jr>3;Ee=Ve===1?he.readString():Ve===2?he.readFloat():Ve===3?he.readDouble():Ve===4?he.readVarint64():Ve===5?he.readVarint():Ve===6?he.readSVarint():Ve===7?he.readBoolean():null}return Ee}(K))}Io.prototype.feature=function(H){if(H<0||H>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[H];var D=this._pbf.readVarint()+this._pbf.pos;return new vi(this._pbf,D,this.extent,this._keys,this._values)};var vs=ai;function us(H,D,K){if(H===3){var he=new vs(K,K.readVarint()+K.pos);he.length&&(D[he.name]=he)}}an.VectorTile=function(H,D){this.layers=H.readFields(us,{},D)},an.VectorTileFeature=xn,an.VectorTileLayer=ai;const Ds=an.VectorTileFeature.types,rs=Math.pow(2,13);function ul(H,D,K,he,Ee,Be,Ve,nt){H.emplaceBack(D,K,2*Math.floor(he*rs)+Ve,Ee*rs*2,Be*rs*2,Math.round(nt))}class Uo{constructor(D){this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(K=>K.id),this.index=D.index,this.hasPattern=!1,this.layoutVertexArray=new Al,this.centroidVertexArray=new xo,this.indexArray=new Dt,this.programConfigurations=new hs(D.layers,D.zoom),this.segments=new Vr,this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,he){this.features=[],this.hasPattern=wr("fill-extrusion",this.layers,K);for(const{feature:Ee,id:Be,index:Ve,sourceLayerIndex:nt}of D){const mt=this.layers[0]._featureFilter.needGeometry,Pt=fa(Ee,mt);if(!this.layers[0]._featureFilter.filter(new Jo(this.zoom),Pt,he))continue;const Xt={id:Be,sourceLayerIndex:nt,index:Ve,geometry:mt?Pt.geometry:cr(Ee),properties:Ee.properties,type:Ee.type,patterns:{}};this.hasPattern?this.features.push(tr("fill-extrusion",this.layers,Xt,this.zoom,K)):this.addFeature(Xt,Xt.geometry,Ve,he,{}),K.featureIndex.insert(Ee,Xt.geometry,Ve,nt,this.index,!0)}}addFeatures(D,K,he){for(const Ee of this.features){const{geometry:Be}=Ee;this.addFeature(Ee,Be,Ee.index,K,he)}}update(D,K,he){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,he)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Ya),this.centroidVertexBuffer=D.createVertexBuffer(this.centroidVertexArray,Xa.members,!0),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(D,K,he,Ee,Be){for(const Ve of Lu(K,500)){const nt={x:0,y:0,vertexCount:0};let mt=0;for(const jr of Ve)mt+=jr.length;let Pt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const jr of Ve){if(jr.length===0||Fu(jr))continue;let Yr=0;for(let ca=0;ca=1){const un=jr[ca-1];if(!Vs(Ca,un)){Pt.vertexLength+4>Vr.MAX_VERTEX_ARRAY_LENGTH&&(Pt=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ha=Ca.sub(un)._perp()._unit(),rn=un.dist(Ca);Yr+rn>32768&&(Yr=0),ul(this.layoutVertexArray,Ca.x,Ca.y,Ha.x,Ha.y,0,0,Yr),ul(this.layoutVertexArray,Ca.x,Ca.y,Ha.x,Ha.y,0,1,Yr),nt.x+=2*Ca.x,nt.y+=2*Ca.y,nt.vertexCount+=2,Yr+=rn,ul(this.layoutVertexArray,un.x,un.y,Ha.x,Ha.y,0,0,Yr),ul(this.layoutVertexArray,un.x,un.y,Ha.x,Ha.y,0,1,Yr),nt.x+=2*un.x,nt.y+=2*un.y,nt.vertexCount+=2;const Sn=Pt.vertexLength;this.indexArray.emplaceBack(Sn,Sn+2,Sn+1),this.indexArray.emplaceBack(Sn+1,Sn+2,Sn+3),Pt.vertexLength+=4,Pt.primitiveLength+=2}}}}if(Pt.vertexLength+mt>Vr.MAX_VERTEX_ARRAY_LENGTH&&(Pt=this.segments.prepareSegment(mt,this.layoutVertexArray,this.indexArray)),Ds[D.type]!=="Polygon")continue;const Xt=[],er=[],br=Pt.vertexLength;for(const jr of Ve)if(jr.length!==0){jr!==Ve[0]&&er.push(Xt.length/2);for(let Yr=0;Yr_s)||H.y===D.y&&(H.y<0||H.y>_s)}function Fu(H){return H.every(D=>D.x<0)||H.every(D=>D.x>_s)||H.every(D=>D.y<0)||H.every(D=>D.y>_s)}let fc;Wa("FillExtrusionBucket",Uo,{omit:["layers","features"]});var dh={get paint(){return fc=fc||new De({"fill-extrusion-opacity":new Vi(ie["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new eo(ie["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Vi(ie["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Vi(ie["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new qu(ie["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new eo(ie["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new eo(ie["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Vi(ie["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class ph extends ne{constructor(D){super(D,dh)}createBucket(D){return new Uo(D)}queryRadius(){return wn(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(D,K,he,Ee,Be,Ve,nt,mt){const Pt=Tn(D,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),Ve.angle,nt),Xt=this.paint.get("fill-extrusion-height").evaluate(K,he),er=this.paint.get("fill-extrusion-base").evaluate(K,he),br=function(jr,Yr,ca,Ca){const un=[];for(const Ha of jr){const rn=[Ha.x,Ha.y,0,1];gi(rn,rn,Yr),un.push(new i(rn[0]/rn[3],rn[1]/rn[3]))}return un}(Pt,mt),Rr=function(jr,Yr,ca,Ca){const un=[],Ha=[],rn=Ca[8]*Yr,Sn=Ca[9]*Yr,$n=Ca[10]*Yr,Oi=Ca[11]*Yr,qo=Ca[8]*ca,qi=Ca[9]*ca,Di=Ca[10]*ca,mo=Ca[11]*ca;for(const so of jr){const to=[],zn=[];for(const To of so){const _o=To.x,ts=To.y,Gl=Ca[0]*_o+Ca[4]*ts+Ca[12],Nl=Ca[1]*_o+Ca[5]*ts+Ca[13],Gc=Ca[2]*_o+Ca[6]*ts+Ca[14],ih=Ca[3]*_o+Ca[7]*ts+Ca[15],hc=Gc+$n,Rc=ih+Oi,Yf=Gl+qo,Kf=Nl+qi,Jf=Gc+Di,Ou=ih+mo,Wc=new i((Gl+rn)/Rc,(Nl+Sn)/Rc);Wc.z=hc/Rc,to.push(Wc);const Ff=new i(Yf/Ou,Kf/Ou);Ff.z=Jf/Ou,zn.push(Ff)}un.push(to),Ha.push(zn)}return[un,Ha]}(Ee,er,Xt,mt);return function(jr,Yr,ca){let Ca=1/0;Na(ca,Yr)&&(Ca=Mh(ca,Yr[0]));for(let un=0;unK.id),this.index=D.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(K=>{this.gradients[K.id]={}}),this.layoutVertexArray=new pu,this.layoutVertexArray2=new pe,this.indexArray=new Dt,this.programConfigurations=new hs(D.layers,D.zoom),this.segments=new Vr,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(K=>K.isStateDependent()).map(K=>K.id)}populate(D,K,he){this.hasPattern=wr("line",this.layers,K);const Ee=this.layers[0].layout.get("line-sort-key"),Be=!Ee.isConstant(),Ve=[];for(const{feature:nt,id:mt,index:Pt,sourceLayerIndex:Xt}of D){const er=this.layers[0]._featureFilter.needGeometry,br=fa(nt,er);if(!this.layers[0]._featureFilter.filter(new Jo(this.zoom),br,he))continue;const Rr=Be?Ee.evaluate(br,{},he):void 0,jr={id:mt,properties:nt.properties,type:nt.type,sourceLayerIndex:Xt,index:Pt,geometry:er?br.geometry:cr(nt),patterns:{},sortKey:Rr};Ve.push(jr)}Be&&Ve.sort((nt,mt)=>nt.sortKey-mt.sortKey);for(const nt of Ve){const{geometry:mt,index:Pt,sourceLayerIndex:Xt}=nt;if(this.hasPattern){const er=tr("line",this.layers,nt,this.zoom,K);this.patternFeatures.push(er)}else this.addFeature(nt,mt,Pt,he,{});K.featureIndex.insert(D[Pt].feature,mt,Pt,Xt,this.index)}}update(D,K,he){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(D,K,this.stateDependentLayers,he)}addFeatures(D,K,he){for(const Ee of this.patternFeatures)this.addFeature(Ee,Ee.geometry,Ee.index,K,he)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(D){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=D.createVertexBuffer(this.layoutVertexArray2,Dh)),this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,Rh),this.indexBuffer=D.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(D),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(D){if(D.properties&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(D.properties,"mapbox_clip_end"))return{start:+D.properties.mapbox_clip_start,end:+D.properties.mapbox_clip_end}}addFeature(D,K,he,Ee,Be){const Ve=this.layers[0].layout,nt=Ve.get("line-join").evaluate(D,{}),mt=Ve.get("line-cap"),Pt=Ve.get("line-miter-limit"),Xt=Ve.get("line-round-limit");this.lineClips=this.lineFeatureClips(D);for(const er of K)this.addLine(er,D,nt,mt,Pt,Xt);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D,he,Be,Ee)}addLine(D,K,he,Ee,Be,Ve){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let Ca=0;Ca=2&&D[mt-1].equals(D[mt-2]);)mt--;let Pt=0;for(;Pt0;if(Oi&&Ca>Pt){const mo=br.dist(Rr);if(mo>2*Xt){const so=br.sub(br.sub(Rr)._mult(Xt/mo)._round());this.updateDistance(Rr,so),this.addCurrentVertex(so,Yr,0,0,er),Rr=so}}const qi=Rr&&jr;let Di=qi?he:nt?"butt":Ee;if(qi&&Di==="round"&&(SnBe&&(Di="bevel"),Di==="bevel"&&(Sn>2&&(Di="flipbevel"),Sn100)un=ca.mult(-1);else{const mo=Sn*Yr.add(ca).mag()/Yr.sub(ca).mag();un._perp()._mult(mo*(qo?-1:1))}this.addCurrentVertex(br,un,0,0,er),this.addCurrentVertex(br,un.mult(-1),0,0,er)}else if(Di==="bevel"||Di==="fakeround"){const mo=-Math.sqrt(Sn*Sn-1),so=qo?mo:0,to=qo?0:mo;if(Rr&&this.addCurrentVertex(br,Yr,so,to,er),Di==="fakeround"){const zn=Math.round(180*$n/Math.PI/20);for(let To=1;To2*Xt){const so=br.add(jr.sub(br)._mult(Xt/mo)._round());this.updateDistance(br,so),this.addCurrentVertex(so,ca,0,0,er),br=so}}}}addCurrentVertex(D,K,he,Ee,Be,Ve=!1){const nt=K.y*Ee-K.x,mt=-K.y-K.x*Ee;this.addHalfVertex(D,K.x+K.y*he,K.y-K.x*he,Ve,!1,he,Be),this.addHalfVertex(D,nt,mt,Ve,!0,-Ee,Be),this.distance>gh/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(D,K,he,Ee,Be,Ve))}addHalfVertex({x:D,y:K},he,Ee,Be,Ve,nt,mt){const Pt=.5*(this.lineClips?this.scaledDistance*(gh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((D<<1)+(Be?1:0),(K<<1)+(Ve?1:0),Math.round(63*he)+128,Math.round(63*Ee)+128,1+(nt===0?0:nt<0?-1:1)|(63&Pt)<<2,Pt>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const Xt=mt.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,Xt),mt.primitiveLength++),Ve?this.e2=Xt:this.e1=Xt}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(D,K){this.distance+=D.dist(K),this.updateScaledDistance()}}let yh,Zv;Wa("LineBucket",Eh,{omit:["layers","patternFeatures"]});var vv={get paint(){return Zv=Zv||new De({"line-opacity":new eo(ie.paint_line["line-opacity"]),"line-color":new eo(ie.paint_line["line-color"]),"line-translate":new Vi(ie.paint_line["line-translate"]),"line-translate-anchor":new Vi(ie.paint_line["line-translate-anchor"]),"line-width":new eo(ie.paint_line["line-width"]),"line-gap-width":new eo(ie.paint_line["line-gap-width"]),"line-offset":new eo(ie.paint_line["line-offset"]),"line-blur":new eo(ie.paint_line["line-blur"]),"line-dasharray":new Du(ie.paint_line["line-dasharray"]),"line-pattern":new qu(ie.paint_line["line-pattern"]),"line-gradient":new wc(ie.paint_line["line-gradient"])})},get layout(){return yh=yh||new De({"line-cap":new Vi(ie.layout_line["line-cap"]),"line-join":new eo(ie.layout_line["line-join"]),"line-miter-limit":new Vi(ie.layout_line["line-miter-limit"]),"line-round-limit":new Vi(ie.layout_line["line-round-limit"]),"line-sort-key":new eo(ie.layout_line["line-sort-key"])})}};class Pc extends eo{possiblyEvaluate(D,K){return K=new Jo(Math.floor(K.zoom),{now:K.now,fadeDuration:K.fadeDuration,zoomHistory:K.zoomHistory,transition:K.transition}),super.possiblyEvaluate(D,K)}evaluate(D,K,he,Ee){return K=M({},K,{zoom:Math.floor(K.zoom)}),super.evaluate(D,K,he,Ee)}}let dv;class Xv extends ne{constructor(D){super(D,vv),this.gradientVersion=0,dv||(dv=new Pc(vv.paint.properties["line-width"].specification),dv.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(D){if(D==="line-gradient"){const K=this.gradientExpression();this.stepInterpolant=!!function(he){return he._styleExpression!==void 0}(K)&&K._styleExpression.expression instanceof pa,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(D,K){super.recalculate(D,K),this.paint._values["line-floorwidth"]=dv.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,D)}createBucket(D){return new Eh(D)}queryRadius(D){const K=D,he=of(qa("line-width",this,K),qa("line-gap-width",this,K)),Ee=qa("line-offset",this,K);return he/2+Math.abs(Ee)+wn(this.paint.get("line-translate"))}queryIntersectsFeature(D,K,he,Ee,Be,Ve,nt){const mt=Tn(D,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),Ve.angle,nt),Pt=nt/2*of(this.paint.get("line-width").evaluate(K,he),this.paint.get("line-gap-width").evaluate(K,he)),Xt=this.paint.get("line-offset").evaluate(K,he);return Xt&&(Ee=function(er,br){const Rr=[];for(let jr=0;jr=3){for(let ca=0;ca0?D+2*H:H}const kv=ot([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),pd=ot([{name:"a_projected_pos",components:3,type:"Float32"}],4);ot([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const gd=ot([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);ot([{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"}]);const Yv=ot([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Cv=ot([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Lv(H,D,K){return H.sections.forEach(he=>{he.text=function(Ee,Be,Ve){const nt=Be.layout.get("text-transform").evaluate(Ve,{});return nt==="uppercase"?Ee=Ee.toLocaleUpperCase():nt==="lowercase"&&(Ee=Ee.toLocaleLowerCase()),gs.applyArabicShaping&&(Ee=gs.applyArabicShaping(Ee)),Ee}(he.text,D,K)}),H}ot([{name:"triangle",components:3,type:"Uint16"}]),ot([{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"}]),ot([{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",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),ot([{type:"Float32",name:"offsetX"}]),ot([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),ot([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const lu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var pl=24,zf=Ml,Kv=function(H,D,K,he,Ee){var Be,Ve,nt=8*Ee-he-1,mt=(1<>1,Xt=-7,er=Ee-1,br=-1,Rr=H[D+er];for(er+=br,Be=Rr&(1<<-Xt)-1,Rr>>=-Xt,Xt+=nt;Xt>0;Be=256*Be+H[D+er],er+=br,Xt-=8);for(Ve=Be&(1<<-Xt)-1,Be>>=-Xt,Xt+=he;Xt>0;Ve=256*Ve+H[D+er],er+=br,Xt-=8);if(Be===0)Be=1-Pt;else{if(Be===mt)return Ve?NaN:1/0*(Rr?-1:1);Ve+=Math.pow(2,he),Be-=Pt}return(Rr?-1:1)*Ve*Math.pow(2,Be-he)},yd=function(H,D,K,he,Ee,Be){var Ve,nt,mt,Pt=8*Be-Ee-1,Xt=(1<>1,br=Ee===23?Math.pow(2,-24)-Math.pow(2,-77):0,Rr=0,jr=1,Yr=D<0||D===0&&1/D<0?1:0;for(D=Math.abs(D),isNaN(D)||D===1/0?(nt=isNaN(D)?1:0,Ve=Xt):(Ve=Math.floor(Math.log(D)/Math.LN2),D*(mt=Math.pow(2,-Ve))<1&&(Ve--,mt*=2),(D+=Ve+er>=1?br/mt:br*Math.pow(2,1-er))*mt>=2&&(Ve++,mt/=2),Ve+er>=Xt?(nt=0,Ve=Xt):Ve+er>=1?(nt=(D*mt-1)*Math.pow(2,Ee),Ve+=er):(nt=D*Math.pow(2,er-1)*Math.pow(2,Ee),Ve=0));Ee>=8;H[K+Rr]=255&nt,Rr+=jr,nt/=256,Ee-=8);for(Ve=Ve<0;H[K+Rr]=255&Ve,Rr+=jr,Ve/=256,Pt-=8);H[K+Rr-jr]|=128*Yr};function Ml(H){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(H)?H:new Uint8Array(H||0),this.pos=0,this.type=0,this.length=this.buf.length}Ml.Varint=0,Ml.Fixed64=1,Ml.Bytes=2,Ml.Fixed32=5;var cp=4294967296,Pv=1/cp,$p=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function mh(H){return H.type===Ml.Bytes?H.readVarint()+H.pos:H.pos+1}function Iv(H,D,K){return K?4294967296*D+(H>>>0):4294967296*(D>>>0)+(H>>>0)}function Qp(H,D,K){var he=D<=16383?1:D<=2097151?2:D<=268435455?3:Math.floor(Math.log(D)/(7*Math.LN2));K.realloc(he);for(var Ee=K.pos-1;Ee>=H;Ee--)K.buf[Ee+he]=K.buf[Ee]}function fp(H,D){for(var K=0;K>>8,H[K+2]=D>>>16,H[K+3]=D>>>24}function Qy(H,D){return(H[D]|H[D+1]<<8|H[D+2]<<16)+(H[D+3]<<24)}Ml.prototype={destroy:function(){this.buf=null},readFields:function(H,D,K){for(K=K||this.length;this.pos>3,Be=this.pos;this.type=7&he,H(Ee,D,this),this.pos===Be&&this.skip(he)}return D},readMessage:function(H,D){return this.readFields(H,D,this.readVarint()+this.pos)},readFixed32:function(){var H=t0(this.buf,this.pos);return this.pos+=4,H},readSFixed32:function(){var H=Qy(this.buf,this.pos);return this.pos+=4,H},readFixed64:function(){var H=t0(this.buf,this.pos)+t0(this.buf,this.pos+4)*cp;return this.pos+=8,H},readSFixed64:function(){var H=t0(this.buf,this.pos)+Qy(this.buf,this.pos+4)*cp;return this.pos+=8,H},readFloat:function(){var H=Kv(this.buf,this.pos,!0,23,4);return this.pos+=4,H},readDouble:function(){var H=Kv(this.buf,this.pos,!0,52,8);return this.pos+=8,H},readVarint:function(H){var D,K,he=this.buf;return D=127&(K=he[this.pos++]),K<128?D:(D|=(127&(K=he[this.pos++]))<<7,K<128?D:(D|=(127&(K=he[this.pos++]))<<14,K<128?D:(D|=(127&(K=he[this.pos++]))<<21,K<128?D:function(Ee,Be,Ve){var nt,mt,Pt=Ve.buf;if(nt=(112&(mt=Pt[Ve.pos++]))>>4,mt<128||(nt|=(127&(mt=Pt[Ve.pos++]))<<3,mt<128)||(nt|=(127&(mt=Pt[Ve.pos++]))<<10,mt<128)||(nt|=(127&(mt=Pt[Ve.pos++]))<<17,mt<128)||(nt|=(127&(mt=Pt[Ve.pos++]))<<24,mt<128)||(nt|=(1&(mt=Pt[Ve.pos++]))<<31,mt<128))return Iv(Ee,nt,Be);throw new Error("Expected varint not more than 10 bytes")}(D|=(15&(K=he[this.pos]))<<28,H,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var H=this.readVarint();return H%2==1?(H+1)/-2:H/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var H=this.readVarint()+this.pos,D=this.pos;return this.pos=H,H-D>=12&&$p?function(K,he,Ee){return $p.decode(K.subarray(he,Ee))}(this.buf,D,H):function(K,he,Ee){for(var Be="",Ve=he;Ve239?4:Xt>223?3:Xt>191?2:1;if(Ve+br>Ee)break;br===1?Xt<128&&(er=Xt):br===2?(192&(nt=K[Ve+1]))==128&&(er=(31&Xt)<<6|63&nt)<=127&&(er=null):br===3?(mt=K[Ve+2],(192&(nt=K[Ve+1]))==128&&(192&mt)==128&&((er=(15&Xt)<<12|(63&nt)<<6|63&mt)<=2047||er>=55296&&er<=57343)&&(er=null)):br===4&&(mt=K[Ve+2],Pt=K[Ve+3],(192&(nt=K[Ve+1]))==128&&(192&mt)==128&&(192&Pt)==128&&((er=(15&Xt)<<18|(63&nt)<<12|(63&mt)<<6|63&Pt)<=65535||er>=1114112)&&(er=null)),er===null?(er=65533,br=1):er>65535&&(er-=65536,Be+=String.fromCharCode(er>>>10&1023|55296),er=56320|1023&er),Be+=String.fromCharCode(er),Ve+=br}return Be}(this.buf,D,H)},readBytes:function(){var H=this.readVarint()+this.pos,D=this.buf.subarray(this.pos,H);return this.pos=H,D},readPackedVarint:function(H,D){if(this.type!==Ml.Bytes)return H.push(this.readVarint(D));var K=mh(this);for(H=H||[];this.pos127;);else if(D===Ml.Bytes)this.pos=this.readVarint()+this.pos;else if(D===Ml.Fixed32)this.pos+=4;else{if(D!==Ml.Fixed64)throw new Error("Unimplemented type: "+D);this.pos+=8}},writeTag:function(H,D){this.writeVarint(H<<3|D)},realloc:function(H){for(var D=this.length||16;D268435455||H<0?function(D,K){var he,Ee;if(D>=0?(he=D%4294967296|0,Ee=D/4294967296|0):(Ee=~(-D/4294967296),4294967295^(he=~(-D%4294967296))?he=he+1|0:(he=0,Ee=Ee+1|0)),D>=18446744073709552e3||D<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");K.realloc(10),function(Be,Ve,nt){nt.buf[nt.pos++]=127&Be|128,Be>>>=7,nt.buf[nt.pos++]=127&Be|128,Be>>>=7,nt.buf[nt.pos++]=127&Be|128,Be>>>=7,nt.buf[nt.pos++]=127&Be|128,nt.buf[nt.pos]=127&(Be>>>=7)}(he,0,K),function(Be,Ve){var nt=(7&Be)<<4;Ve.buf[Ve.pos++]|=nt|((Be>>>=3)?128:0),Be&&(Ve.buf[Ve.pos++]=127&Be|((Be>>>=7)?128:0),Be&&(Ve.buf[Ve.pos++]=127&Be|((Be>>>=7)?128:0),Be&&(Ve.buf[Ve.pos++]=127&Be|((Be>>>=7)?128:0),Be&&(Ve.buf[Ve.pos++]=127&Be|((Be>>>=7)?128:0),Be&&(Ve.buf[Ve.pos++]=127&Be)))))}(Ee,K)}(H,this):(this.realloc(4),this.buf[this.pos++]=127&H|(H>127?128:0),H<=127||(this.buf[this.pos++]=127&(H>>>=7)|(H>127?128:0),H<=127||(this.buf[this.pos++]=127&(H>>>=7)|(H>127?128:0),H<=127||(this.buf[this.pos++]=H>>>7&127))))},writeSVarint:function(H){this.writeVarint(H<0?2*-H-1:2*H)},writeBoolean:function(H){this.writeVarint(!!H)},writeString:function(H){H=String(H),this.realloc(4*H.length),this.pos++;var D=this.pos;this.pos=function(he,Ee,Be){for(var Ve,nt,mt=0;mt55295&&Ve<57344){if(!nt){Ve>56319||mt+1===Ee.length?(he[Be++]=239,he[Be++]=191,he[Be++]=189):nt=Ve;continue}if(Ve<56320){he[Be++]=239,he[Be++]=191,he[Be++]=189,nt=Ve;continue}Ve=nt-55296<<10|Ve-56320|65536,nt=null}else nt&&(he[Be++]=239,he[Be++]=191,he[Be++]=189,nt=null);Ve<128?he[Be++]=Ve:(Ve<2048?he[Be++]=Ve>>6|192:(Ve<65536?he[Be++]=Ve>>12|224:(he[Be++]=Ve>>18|240,he[Be++]=Ve>>12&63|128),he[Be++]=Ve>>6&63|128),he[Be++]=63&Ve|128)}return Be}(this.buf,H,this.pos);var K=this.pos-D;K>=128&&Qp(D,K,this),this.pos=D-1,this.writeVarint(K),this.pos+=K},writeFloat:function(H){this.realloc(4),yd(this.buf,H,this.pos,!0,23,4),this.pos+=4},writeDouble:function(H){this.realloc(8),yd(this.buf,H,this.pos,!0,52,8),this.pos+=8},writeBytes:function(H){var D=H.length;this.writeVarint(D),this.realloc(D);for(var K=0;K=128&&Qp(K,he,this),this.pos=K-1,this.writeVarint(he),this.pos+=he},writeMessage:function(H,D,K){this.writeTag(H,Ml.Bytes),this.writeRawMessage(D,K)},writePackedVarint:function(H,D){D.length&&this.writeMessage(H,fp,D)},writePackedSVarint:function(H,D){D.length&&this.writeMessage(H,Tx,D)},writePackedBoolean:function(H,D){D.length&&this.writeMessage(H,Mx,D)},writePackedFloat:function(H,D){D.length&&this.writeMessage(H,Ax,D)},writePackedDouble:function(H,D){D.length&&this.writeMessage(H,Sx,D)},writePackedFixed32:function(H,D){D.length&&this.writeMessage(H,Ex,D)},writePackedSFixed32:function(H,D){D.length&&this.writeMessage(H,kx,D)},writePackedFixed64:function(H,D){D.length&&this.writeMessage(H,Cx,D)},writePackedSFixed64:function(H,D){D.length&&this.writeMessage(H,e0,D)},writeBytesField:function(H,D){this.writeTag(H,Ml.Bytes),this.writeBytes(D)},writeFixed32Field:function(H,D){this.writeTag(H,Ml.Fixed32),this.writeFixed32(D)},writeSFixed32Field:function(H,D){this.writeTag(H,Ml.Fixed32),this.writeSFixed32(D)},writeFixed64Field:function(H,D){this.writeTag(H,Ml.Fixed64),this.writeFixed64(D)},writeSFixed64Field:function(H,D){this.writeTag(H,Ml.Fixed64),this.writeSFixed64(D)},writeVarintField:function(H,D){this.writeTag(H,Ml.Varint),this.writeVarint(D)},writeSVarintField:function(H,D){this.writeTag(H,Ml.Varint),this.writeSVarint(D)},writeStringField:function(H,D){this.writeTag(H,Ml.Bytes),this.writeString(D)},writeFloatField:function(H,D){this.writeTag(H,Ml.Fixed32),this.writeFloat(D)},writeDoubleField:function(H,D){this.writeTag(H,Ml.Fixed64),this.writeDouble(D)},writeBooleanField:function(H,D){this.writeVarintField(H,!!D)}};var hg=r(zf);const r0=3;function Lx(H,D,K){H===1&&K.readMessage(em,D)}function em(H,D,K){if(H===3){const{id:he,bitmap:Ee,width:Be,height:Ve,left:nt,top:mt,advance:Pt}=K.readMessage(vg,{});D.push({id:he,bitmap:new xs({width:Be+2*r0,height:Ve+2*r0},Ee),metrics:{width:Be,height:Ve,left:nt,top:mt,advance:Pt}})}}function vg(H,D,K){H===1?D.id=K.readVarint():H===2?D.bitmap=K.readBytes():H===3?D.width=K.readVarint():H===4?D.height=K.readVarint():H===5?D.left=K.readSVarint():H===6?D.top=K.readSVarint():H===7&&(D.advance=K.readVarint())}const dg=r0;function a0(H){let D=0,K=0;for(const Ve of H)D+=Ve.w*Ve.h,K=Math.max(K,Ve.w);H.sort((Ve,nt)=>nt.h-Ve.h);const he=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(D/.95)),K),h:1/0}];let Ee=0,Be=0;for(const Ve of H)for(let nt=he.length-1;nt>=0;nt--){const mt=he[nt];if(!(Ve.w>mt.w||Ve.h>mt.h)){if(Ve.x=mt.x,Ve.y=mt.y,Be=Math.max(Be,Ve.y+Ve.h),Ee=Math.max(Ee,Ve.x+Ve.w),Ve.w===mt.w&&Ve.h===mt.h){const Pt=he.pop();nt=0&&he>=D&&i0[this.text.charCodeAt(he)];he--)K--;this.text=this.text.substring(D,K),this.sectionIndex=this.sectionIndex.slice(D,K)}substring(D,K){const he=new xd;return he.text=this.text.substring(D,K),he.sectionIndex=this.sectionIndex.slice(D,K),he.sections=this.sections,he}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((D,K)=>Math.max(D,this.sections[K].scale),0)}addTextSection(D,K){this.text+=D.text,this.sections.push(hp.forText(D.scale,D.fontStack||K));const he=this.sections.length-1;for(let Ee=0;Ee=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function n0(H,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr){const Yr=xd.fromFeature(H,Ee);let ca;er===e.ah.vertical&&Yr.verticalizePunctuation();const{processBidirectionalText:Ca,processStyledBidirectionalText:un}=gs;if(Ca&&Yr.sections.length===1){ca=[];const Sn=Ca(Yr.toString(),Jv(Yr,Pt,Be,D,he,Rr));for(const $n of Sn){const Oi=new xd;Oi.text=$n,Oi.sections=Yr.sections;for(let qo=0;qo<$n.length;qo++)Oi.sectionIndex.push(0);ca.push(Oi)}}else if(un){ca=[];const Sn=un(Yr.text,Yr.sectionIndex,Jv(Yr,Pt,Be,D,he,Rr));for(const $n of Sn){const Oi=new xd;Oi.text=$n[0],Oi.sectionIndex=$n[1],Oi.sections=Yr.sections,ca.push(Oi)}}else ca=function(Sn,$n){const Oi=[],qo=Sn.text;let qi=0;for(const Di of $n)Oi.push(Sn.substring(qi,Di)),qi=Di;return qi0&&Fh>lf&&(lf=Fh)}else{const Wl=Oi[tl.fontStack],uf=Wl&&Wl[Ll];if(uf&&uf.rect)Cd=uf.rect,cu=uf.metrics;else{const Fh=$n[tl.fontStack],bh=Fh&&Fh[Ll];if(!bh)continue;cu=bh.metrics}ku=(Wc-tl.scale)*pl}Of?(Sn.verticalizable=!0,$f.push({glyph:Ll,imageName:jh,x:ts,y:Gl+ku,vertical:Of,scale:tl.scale,fontStack:tl.fontStack,sectionIndex:El,metrics:cu,rect:Cd}),ts+=Vh*tl.scale+zn):($f.push({glyph:Ll,imageName:jh,x:ts,y:Gl+ku,vertical:Of,scale:tl.scale,fontStack:tl.fontStack,sectionIndex:El,metrics:cu,rect:Cd}),ts+=cu.advance*tl.scale+zn)}$f.length!==0&&(Nl=Math.max(ts-zn,Nl),Rx($f,0,$f.length-1,ih,lf)),ts=0;const xh=Di*Wc+lf;Tf.lineOffset=Math.max(lf,Ff),Gl+=xh,Gc=Math.max(xh,Gc),++hc}var Rc;const Yf=Gl-_d,{horizontalAlign:Kf,verticalAlign:Jf}=gg(mo);(function(Ou,Wc,Ff,Tf,$f,lf,xh,uu,tl){const El=(Wc-Ff)*$f;let Ll=0;Ll=lf!==xh?-uu*Tf-_d:(-Tf*tl+.5)*xh;for(const ku of Ou)for(const cu of ku.positionedGlyphs)cu.x+=El,cu.y+=Ll})(Sn.positionedLines,ih,Kf,Jf,Nl,Gc,Di,Yf,qi.length),Sn.top+=-Jf*Yf,Sn.bottom=Sn.top+Yf,Sn.left+=-Kf*Nl,Sn.right=Sn.left+Nl}(rn,D,K,he,ca,Ve,nt,mt,er,Pt,br,jr),!function(Sn){for(const $n of Sn)if($n.positionedGlyphs.length!==0)return!1;return!0}(Ha)&&rn}const i0={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Px={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Ix={40:!0};function o0(H,D,K,he,Ee,Be){if(D.imageName){const Ve=he[D.imageName];return Ve?Ve.displaySize[0]*D.scale*pl/Be+Ee:0}{const Ve=K[D.fontStack],nt=Ve&&Ve[H];return nt?nt.metrics.advance*D.scale+Ee:0}}function rm(H,D,K,he){const Ee=Math.pow(H-D,2);return he?H=0;let Pt=0;for(let er=0;erPt){const Xt=Math.ceil(Be/Pt);Ee*=Xt/Ve,Ve=Xt}return{x1:he,y1:Ee,x2:he+Be,y2:Ee+Ve}}function nm(H,D,K,he,Ee,Be){const Ve=H.image;let nt;if(Ve.content){const ca=Ve.content,Ca=Ve.pixelRatio||1;nt=[ca[0]/Ca,ca[1]/Ca,Ve.displaySize[0]-ca[2]/Ca,Ve.displaySize[1]-ca[3]/Ca]}const mt=D.left*Be,Pt=D.right*Be;let Xt,er,br,Rr;K==="width"||K==="both"?(Rr=Ee[0]+mt-he[3],er=Ee[0]+Pt+he[1]):(Rr=Ee[0]+(mt+Pt-Ve.displaySize[0])/2,er=Rr+Ve.displaySize[0]);const jr=D.top*Be,Yr=D.bottom*Be;return K==="height"||K==="both"?(Xt=Ee[1]+jr-he[0],br=Ee[1]+Yr+he[2]):(Xt=Ee[1]+(jr+Yr-Ve.displaySize[1])/2,br=Xt+Ve.displaySize[1]),{image:Ve,top:Xt,right:er,bottom:br,left:Rr,collisionPadding:nt}}const vp=255,$h=128,Dv=vp*$h;function im(H,D){const{expression:K}=D;if(K.kind==="constant")return{kind:"constant",layoutSize:K.evaluate(new Jo(H+1))};if(K.kind==="source")return{kind:"source"};{const{zoomStops:he,interpolationType:Ee}=K;let Be=0;for(;BeVe.id),this.index=D.index,this.pixelRatio=D.pixelRatio,this.sourceLayerIndex=D.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Cn([]),this.placementViewportMatrix=Cn([]);const K=this.layers[0]._unevaluatedLayout._values;this.textSizeData=im(this.zoom,K["text-size"]),this.iconSizeData=im(this.zoom,K["icon-size"]);const he=this.layers[0].layout,Ee=he.get("symbol-sort-key"),Be=he.get("symbol-z-order");this.canOverlap=yg(he,"text-overlap","text-allow-overlap")!=="never"||yg(he,"icon-overlap","icon-allow-overlap")!=="never"||he.get("text-ignore-placement")||he.get("icon-ignore-placement"),this.sortFeaturesByKey=Be!=="viewport-y"&&!Ee.isConstant(),this.sortFeaturesByY=(Be==="viewport-y"||Be==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,he.get("symbol-placement")==="point"&&(this.writingModes=he.get("text-writing-mode").map(Ve=>e.ah[Ve])),this.stateDependentLayerIds=this.layers.filter(Ve=>Ve.isStateDependent()).map(Ve=>Ve.id),this.sourceID=D.sourceID}createArrays(){this.text=new Hu(new hs(this.layers,this.zoom,D=>/^text/.test(D))),this.icon=new Hu(new hs(this.layers,this.zoom,D=>/^icon/.test(D))),this.glyphOffsetArray=new Bo,this.lineVertexArray=new No,this.symbolInstances=new Gi,this.textAnchorOffsets=new Zo}calculateGlyphDependencies(D,K,he,Ee,Be){for(let Ve=0;Ve0)&&(Ve.value.kind!=="constant"||Ve.value.value.length>0),Xt=mt.value.kind!=="constant"||!!mt.value.value||Object.keys(mt.parameters).length>0,er=Be.get("symbol-sort-key");if(this.features=[],!Pt&&!Xt)return;const br=K.iconDependencies,Rr=K.glyphDependencies,jr=K.availableImages,Yr=new Jo(this.zoom);for(const{feature:ca,id:Ca,index:un,sourceLayerIndex:Ha}of D){const rn=Ee._featureFilter.needGeometry,Sn=fa(ca,rn);if(!Ee._featureFilter.filter(Yr,Sn,he))continue;let $n,Oi;if(rn||(Sn.geometry=cr(ca)),Pt){const qi=Ee.getValueAndResolveTokens("text-field",Sn,he,jr),Di=na.factory(qi),mo=this.hasRTLText=this.hasRTLText||Fx(Di);(!mo||gs.getRTLTextPluginStatus()==="unavailable"||mo&&gs.isParsed())&&($n=Lv(Di,Ee,Sn))}if(Xt){const qi=Ee.getValueAndResolveTokens("icon-image",Sn,he,jr);Oi=qi instanceof Pa?qi:Pa.fromString(qi)}if(!$n&&!Oi)continue;const qo=this.sortFeaturesByKey?er.evaluate(Sn,{},he):void 0;if(this.features.push({id:Ca,text:$n,icon:Oi,index:un,sourceLayerIndex:Ha,geometry:Sn.geometry,properties:ca.properties,type:zx[ca.type],sortKey:qo}),Oi&&(br[Oi.name]=!0),$n){const qi=Ve.evaluate(Sn,{},he).join(","),Di=Be.get("text-rotation-alignment")!=="viewport"&&Be.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(const mo of $n.sections)if(mo.image)br[mo.image.name]=!0;else{const so=Ki($n.toString()),to=mo.fontStack||qi,zn=Rr[to]=Rr[to]||{};this.calculateGlyphDependencies(mo.text,zn,Di,this.allowVerticalPlacement,so)}}}Be.get("symbol-placement")==="line"&&(this.features=function(ca){const Ca={},un={},Ha=[];let rn=0;function Sn(qi){Ha.push(ca[qi]),rn++}function $n(qi,Di,mo){const so=un[qi];return delete un[qi],un[Di]=so,Ha[so].geometry[0].pop(),Ha[so].geometry[0]=Ha[so].geometry[0].concat(mo[0]),so}function Oi(qi,Di,mo){const so=Ca[Di];return delete Ca[Di],Ca[qi]=so,Ha[so].geometry[0].shift(),Ha[so].geometry[0]=mo[0].concat(Ha[so].geometry[0]),so}function qo(qi,Di,mo){const so=mo?Di[0][Di[0].length-1]:Di[0][0];return`${qi}:${so.x}:${so.y}`}for(let qi=0;qiqi.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((ca,Ca)=>ca.sortKey-Ca.sortKey)}update(D,K,he){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(D,K,this.layers,he),this.icon.programConfigurations.updatePaintArrays(D,K,this.layers,he))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(D){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(D),this.iconCollisionBox.upload(D)),this.text.upload(D,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(D,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(D,K){const he=this.lineVertexArray.length;if(D.segment!==void 0){let Ee=D.dist(K[D.segment+1]),Be=D.dist(K[D.segment]);const Ve={};for(let nt=D.segment+1;nt=0;nt--)Ve[nt]={x:K[nt].x,y:K[nt].y,tileUnitDistanceFromAnchor:Be},nt>0&&(Be+=K[nt-1].dist(K[nt]));for(let nt=0;nt0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(D,K){const he=D.placedSymbolArray.get(K),Ee=he.vertexStartIndex+4*he.numGlyphs;for(let Be=he.vertexStartIndex;BeEe[nt]-Ee[mt]||Be[mt]-Be[nt]),Ve}addToSortKeyRanges(D,K){const he=this.sortKeyRanges[this.sortKeyRanges.length-1];he&&he.sortKey===K?he.symbolInstanceEnd=D+1:this.sortKeyRanges.push({sortKey:K,symbolInstanceStart:D,symbolInstanceEnd:D+1})}sortFeatures(D){if(this.sortFeaturesByY&&this.sortedAngle!==D&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(D),this.sortedAngle=D,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const K of this.symbolInstanceIndexes){const he=this.symbolInstances.get(K);this.featureSortOrder.push(he.featureIndex),[he.rightJustifiedTextSymbolIndex,he.centerJustifiedTextSymbolIndex,he.leftJustifiedTextSymbolIndex].forEach((Ee,Be,Ve)=>{Ee>=0&&Ve.indexOf(Ee)===Be&&this.addIndicesForPlacedSymbol(this.text,Ee)}),he.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,he.verticalPlacedTextSymbolIndex),he.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,he.placedIconSymbolIndex),he.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,he.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let dp,pp;Wa("SymbolBucket",$v,{omit:["layers","collisionBoxArray","features","compareText"]}),$v.MAX_GLYPHS=65535,$v.addDynamicAttributes=zv;var _g={get paint(){return pp=pp||new De({"icon-opacity":new eo(ie.paint_symbol["icon-opacity"]),"icon-color":new eo(ie.paint_symbol["icon-color"]),"icon-halo-color":new eo(ie.paint_symbol["icon-halo-color"]),"icon-halo-width":new eo(ie.paint_symbol["icon-halo-width"]),"icon-halo-blur":new eo(ie.paint_symbol["icon-halo-blur"]),"icon-translate":new Vi(ie.paint_symbol["icon-translate"]),"icon-translate-anchor":new Vi(ie.paint_symbol["icon-translate-anchor"]),"text-opacity":new eo(ie.paint_symbol["text-opacity"]),"text-color":new eo(ie.paint_symbol["text-color"],{runtimeType:Rt,getOverride:H=>H.textColor,hasOverride:H=>!!H.textColor}),"text-halo-color":new eo(ie.paint_symbol["text-halo-color"]),"text-halo-width":new eo(ie.paint_symbol["text-halo-width"]),"text-halo-blur":new eo(ie.paint_symbol["text-halo-blur"]),"text-translate":new Vi(ie.paint_symbol["text-translate"]),"text-translate-anchor":new Vi(ie.paint_symbol["text-translate-anchor"])})},get layout(){return dp=dp||new De({"symbol-placement":new Vi(ie.layout_symbol["symbol-placement"]),"symbol-spacing":new Vi(ie.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Vi(ie.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new eo(ie.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Vi(ie.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Vi(ie.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Vi(ie.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Vi(ie.layout_symbol["icon-ignore-placement"]),"icon-optional":new Vi(ie.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Vi(ie.layout_symbol["icon-rotation-alignment"]),"icon-size":new eo(ie.layout_symbol["icon-size"]),"icon-text-fit":new Vi(ie.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Vi(ie.layout_symbol["icon-text-fit-padding"]),"icon-image":new eo(ie.layout_symbol["icon-image"]),"icon-rotate":new eo(ie.layout_symbol["icon-rotate"]),"icon-padding":new eo(ie.layout_symbol["icon-padding"]),"icon-keep-upright":new Vi(ie.layout_symbol["icon-keep-upright"]),"icon-offset":new eo(ie.layout_symbol["icon-offset"]),"icon-anchor":new eo(ie.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Vi(ie.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Vi(ie.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Vi(ie.layout_symbol["text-rotation-alignment"]),"text-field":new eo(ie.layout_symbol["text-field"]),"text-font":new eo(ie.layout_symbol["text-font"]),"text-size":new eo(ie.layout_symbol["text-size"]),"text-max-width":new eo(ie.layout_symbol["text-max-width"]),"text-line-height":new Vi(ie.layout_symbol["text-line-height"]),"text-letter-spacing":new eo(ie.layout_symbol["text-letter-spacing"]),"text-justify":new eo(ie.layout_symbol["text-justify"]),"text-radial-offset":new eo(ie.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Vi(ie.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new eo(ie.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new eo(ie.layout_symbol["text-anchor"]),"text-max-angle":new Vi(ie.layout_symbol["text-max-angle"]),"text-writing-mode":new Vi(ie.layout_symbol["text-writing-mode"]),"text-rotate":new eo(ie.layout_symbol["text-rotate"]),"text-padding":new Vi(ie.layout_symbol["text-padding"]),"text-keep-upright":new Vi(ie.layout_symbol["text-keep-upright"]),"text-transform":new eo(ie.layout_symbol["text-transform"]),"text-offset":new eo(ie.layout_symbol["text-offset"]),"text-allow-overlap":new Vi(ie.layout_symbol["text-allow-overlap"]),"text-overlap":new Vi(ie.layout_symbol["text-overlap"]),"text-ignore-placement":new Vi(ie.layout_symbol["text-ignore-placement"]),"text-optional":new Vi(ie.layout_symbol["text-optional"])})}};class wd{constructor(D){if(D.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=D.property.overrides?D.property.overrides.runtimeType:rt,this.defaultValue=D}evaluate(D){if(D.formattedSection){const K=this.defaultValue.property.overrides;if(K&&K.hasOverride(D.formattedSection))return K.getOverride(D.formattedSection)}return D.feature&&D.featureState?this.defaultValue.evaluate(D.feature,D.featureState):this.defaultValue.property.specification.default}eachChild(D){this.defaultValue.isConstant()||D(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Wa("FormatSectionOverride",wd,{omit:["defaultValue"]});class u0 extends ne{constructor(D){super(D,_g)}recalculate(D,K){if(super.recalculate(D,K),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),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"){const he=this.layout.get("text-writing-mode");if(he){const Ee=[];for(const Be of he)Ee.indexOf(Be)<0&&Ee.push(Be);this.layout._values["text-writing-mode"]=Ee}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(D,K,he,Ee){const Be=this.layout.get(D).evaluate(K,{},he,Ee),Ve=this._unevaluatedLayout._values[D];return Ve.isDataDriven()||Uu(Ve.value)||!Be?Be:function(nt,mt){return mt.replace(/{([^{}]+)}/g,(Pt,Xt)=>nt&&Xt in nt?String(nt[Xt]):"")}(K.properties,Be)}createBucket(D){return new $v(D)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const D of _g.paint.overridableProperties){if(!u0.hasPaintOverride(this.layout,D))continue;const K=this.paint.get(D),he=new wd(K),Ee=new ru(he,K.property.specification);let Be=null;Be=K.value.kind==="constant"||K.value.kind==="source"?new Qu("source",Ee):new Tu("composite",Ee,K.value.zoomStops),this.paint._values[D]=new ol(K.property,Be,K.parameters)}}_handleOverridablePaintPropertyUpdate(D,K,he){return!(!this.layout||K.isDataDriven()||he.isDataDriven())&&u0.hasPaintOverride(this.layout,D)}static hasPaintOverride(D,K){const he=D.get("text-field"),Ee=_g.paint.properties[K];let Be=!1;const Ve=nt=>{for(const mt of nt)if(Ee.overrides&&Ee.overrides.hasOverride(mt))return void(Be=!0)};if(he.value.kind==="constant"&&he.value.value instanceof na)Ve(he.value.value.sections);else if(he.value.kind==="source"){const nt=Pt=>{Be||(Pt instanceof Lr&&dt(Pt.value)===Mr?Ve(Pt.value.sections):Pt instanceof bs?Ve(Pt.sections):Pt.eachChild(nt))},mt=he.value;mt._styleExpression&&nt(mt._styleExpression.expression)}return Be}}let xg;var om={get paint(){return xg=xg||new De({"background-color":new Vi(ie.paint_background["background-color"]),"background-pattern":new Du(ie.paint_background["background-pattern"]),"background-opacity":new Vi(ie.paint_background["background-opacity"])})}};class gp extends ne{constructor(D){super(D,om)}}let c0;var bg={get paint(){return c0=c0||new De({"raster-opacity":new Vi(ie.paint_raster["raster-opacity"]),"raster-hue-rotate":new Vi(ie.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Vi(ie.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Vi(ie.paint_raster["raster-brightness-max"]),"raster-saturation":new Vi(ie.paint_raster["raster-saturation"]),"raster-contrast":new Vi(ie.paint_raster["raster-contrast"]),"raster-resampling":new Vi(ie.paint_raster["raster-resampling"]),"raster-fade-duration":new Vi(ie.paint_raster["raster-fade-duration"])})}};class Ox extends ne{constructor(D){super(D,bg)}}class sm extends ne{constructor(D){super(D,{}),this.onAdd=K=>{this.implementation.onAdd&&this.implementation.onAdd(K,K.painter.context.gl)},this.onRemove=K=>{this.implementation.onRemove&&this.implementation.onRemove(K,K.painter.context.gl)},this.implementation=D}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class yp{constructor(D){this._methodToThrottle=D,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const wg=63710088e-1;class Qh{constructor(D,K){if(isNaN(D)||isNaN(K))throw new Error(`Invalid LngLat object: (${D}, ${K})`);if(this.lng=+D,this.lat=+K,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Qh(S(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(D){const K=Math.PI/180,he=this.lat*K,Ee=D.lat*K,Be=Math.sin(he)*Math.sin(Ee)+Math.cos(he)*Math.cos(Ee)*Math.cos((D.lng-this.lng)*K);return wg*Math.acos(Math.min(Be,1))}static convert(D){if(D instanceof Qh)return D;if(Array.isArray(D)&&(D.length===2||D.length===3))return new Qh(Number(D[0]),Number(D[1]));if(!Array.isArray(D)&&typeof D=="object"&&D!==null)return new Qh(Number("lng"in D?D.lng:D.lon),Number(D.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 [, ]")}}const lm=2*Math.PI*wg;function f0(H){return lm*Math.cos(H*Math.PI/180)}function h0(H){return(180+H)/360}function um(H){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+H*Math.PI/360)))/360}function zh(H,D){return H/f0(D)}function Tg(H){return 360/Math.PI*Math.atan(Math.exp((180-360*H)*Math.PI/180))-90}class mp{constructor(D,K,he=0){this.x=+D,this.y=+K,this.z=+he}static fromLngLat(D,K=0){const he=Qh.convert(D);return new mp(h0(he.lng),um(he.lat),zh(K,he.lat))}toLngLat(){return new Qh(360*this.x-180,Tg(this.y))}toAltitude(){return this.z*f0(Tg(this.y))}meterInMercatorCoordinateUnits(){return 1/lm*(D=Tg(this.y),1/Math.cos(D*Math.PI/180));var D}}function cm(H,D,K){var he=2*Math.PI*6378137/256/Math.pow(2,K);return[H*he-2*Math.PI*6378137/2,D*he-2*Math.PI*6378137/2]}class Ag{constructor(D,K,he){if(!function(Ee,Be,Ve){return!(Ee<0||Ee>25||Ve<0||Ve>=Math.pow(2,Ee)||Be<0||Be>=Math.pow(2,Ee))}(D,K,he))throw new Error(`x=${K}, y=${he}, z=${D} outside of bounds. 0<=x<${Math.pow(2,D)}, 0<=y<${Math.pow(2,D)} 0<=z<=25 `);this.z=D,this.x=K,this.y=he,this.key=Td(0,D,D,K,he)}equals(D){return this.z===D.z&&this.x===D.x&&this.y===D.y}url(D,K,he){const Ee=(Ve=this.y,nt=this.z,mt=cm(256*(Be=this.x),256*(Ve=Math.pow(2,nt)-Ve-1),nt),Pt=cm(256*(Be+1),256*(Ve+1),nt),mt[0]+","+mt[1]+","+Pt[0]+","+Pt[1]);var Be,Ve,nt,mt,Pt;const Xt=function(er,br,Rr){let jr,Yr="";for(let ca=er;ca>0;ca--)jr=1<1?"@2x":"").replace(/{quadkey}/g,Xt).replace(/{bbox-epsg-3857}/g,Ee)}isChildOf(D){const K=this.z-D.z;return K>0&&D.x===this.x>>K&&D.y===this.y>>K}getTilePoint(D){const K=Math.pow(2,this.z);return new i((D.x*K-this.x)*_s,(D.y*K-this.y)*_s)}toString(){return`${this.z}/${this.x}/${this.y}`}}class fm{constructor(D,K){this.wrap=D,this.canonical=K,this.key=Td(D,K.z,K.z,K.x,K.y)}}class kh{constructor(D,K,he,Ee,Be){if(D= z; overscaledZ = ${D}; z = ${he}`);this.overscaledZ=D,this.wrap=K,this.canonical=new Ag(he,+Ee,+Be),this.key=Td(K,D,he,Ee,Be)}clone(){return new kh(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(D){return this.overscaledZ===D.overscaledZ&&this.wrap===D.wrap&&this.canonical.equals(D.canonical)}scaledTo(D){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);const K=this.canonical.z-D;return D>this.canonical.z?new kh(D,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new kh(D,this.wrap,D,this.canonical.x>>K,this.canonical.y>>K)}calculateScaledKey(D,K){if(D>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${D}; overscaledZ = ${this.overscaledZ}`);const he=this.canonical.z-D;return D>this.canonical.z?Td(this.wrap*+K,D,this.canonical.z,this.canonical.x,this.canonical.y):Td(this.wrap*+K,D,D,this.canonical.x>>he,this.canonical.y>>he)}isChildOf(D){if(D.wrap!==this.wrap)return!1;const K=this.canonical.z-D.canonical.z;return D.overscaledZ===0||D.overscaledZ>K&&D.canonical.y===this.canonical.y>>K}children(D){if(this.overscaledZ>=D)return[new kh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const K=this.canonical.z+1,he=2*this.canonical.x,Ee=2*this.canonical.y;return[new kh(K,this.wrap,K,he,Ee),new kh(K,this.wrap,K,he+1,Ee),new kh(K,this.wrap,K,he,Ee+1),new kh(K,this.wrap,K,he+1,Ee+1)]}isLessThan(D){return this.wrapD.wrap)&&(this.overscaledZD.overscaledZ)&&(this.canonical.xD.canonical.x)&&this.canonical.ythis.max&&(this.max=er),er=this.dim+1||K<-1||K>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(K+1)*this.stride+(D+1)}unpack(D,K,he){return D*this.redFactor+K*this.greenFactor+he*this.blueFactor-this.baseShift}getPixels(){return new Xs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(D,K,he){if(this.dim!==D.dim)throw new Error("dem dimension mismatch");let Ee=K*this.dim,Be=K*this.dim+this.dim,Ve=he*this.dim,nt=he*this.dim+this.dim;switch(K){case-1:Ee=Be-1;break;case 1:Be=Ee+1}switch(he){case-1:Ve=nt-1;break;case 1:nt=Ve+1}const mt=-K*this.dim,Pt=-he*this.dim;for(let Xt=Ve;Xt=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${D} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[D]}}class vm{constructor(D,K,he,Ee,Be){this.type="Feature",this._vectorTileFeature=D,D._z=K,D._x=he,D._y=Ee,this.properties=D.properties,this.id=Be}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(D){this._geometry=D}toJSON(){const D={geometry:this.geometry};for(const K in this)K!=="_geometry"&&K!=="_vectorTileFeature"&&(D[K]=this[K]);return D}}class dm{constructor(D,K){this.tileID=D,this.x=D.canonical.x,this.y=D.canonical.y,this.z=D.canonical.z,this.grid=new _n(_s,16,0),this.grid3D=new _n(_s,16,0),this.featureIndexArray=new zs,this.promoteId=K}insert(D,K,he,Ee,Be,Ve){const nt=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(he,Ee,Be);const mt=Ve?this.grid3D:this.grid;for(let Pt=0;Pt=0&&er[3]>=0&&mt.insert(nt,er[0],er[1],er[2],er[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new an.VectorTile(new hg(this.rawTileData)).layers,this.sourceLayerCoder=new hm(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(D,K,he,Ee){this.loadVTLayers();const Be=D.params||{},Ve=_s/D.tileSize/D.scale,nt=Ec(Be.filter),mt=D.queryGeometry,Pt=D.queryPadding*Ve,Xt=Sg(mt),er=this.grid.query(Xt.minX-Pt,Xt.minY-Pt,Xt.maxX+Pt,Xt.maxY+Pt),br=Sg(D.cameraQueryGeometry),Rr=this.grid3D.query(br.minX-Pt,br.minY-Pt,br.maxX+Pt,br.maxY+Pt,(ca,Ca,un,Ha)=>function(rn,Sn,$n,Oi,qo){for(const Di of rn)if(Sn<=Di.x&&$n<=Di.y&&Oi>=Di.x&&qo>=Di.y)return!0;const qi=[new i(Sn,$n),new i(Sn,qo),new i(Oi,qo),new i(Oi,$n)];if(rn.length>2){for(const Di of qi)if(si(rn,Di))return!0}for(let Di=0;Di(Ha||(Ha=cr(rn)),Sn.queryIntersectsFeature(mt,rn,$n,Ha,this.z,D.transform,Ve,D.pixelPosMatrix)))}return jr}loadMatchingFeature(D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er){const br=this.bucketLayerIDs[K];if(Ve&&!function(ca,Ca){for(let un=0;un=0)return!0;return!1}(Ve,br))return;const Rr=this.sourceLayerCoder.decode(he),jr=this.vtLayers[Rr].feature(Ee);if(Be.needGeometry){const ca=fa(jr,!0);if(!Be.filter(new Jo(this.tileID.overscaledZ),ca,this.tileID.canonical))return}else if(!Be.filter(new Jo(this.tileID.overscaledZ),jr))return;const Yr=this.getId(jr,Rr);for(let ca=0;ca{const nt=D instanceof rc?D.get(Ve):null;return nt&&nt.evaluate?nt.evaluate(K,he,Ee):nt})}function Sg(H){let D=1/0,K=1/0,he=-1/0,Ee=-1/0;for(const Be of H)D=Math.min(D,Be.x),K=Math.min(K,Be.y),he=Math.max(he,Be.x),Ee=Math.max(Ee,Be.y);return{minX:D,minY:K,maxX:he,maxY:Ee}}function gm(H,D){return D-H}function ym(H,D,K,he,Ee){const Be=[];for(let Ve=0;Ve=he&&er.x>=he||(Xt.x>=he?Xt=new i(he,Xt.y+(he-Xt.x)/(er.x-Xt.x)*(er.y-Xt.y))._round():er.x>=he&&(er=new i(he,Xt.y+(he-Xt.x)/(er.x-Xt.x)*(er.y-Xt.y))._round()),Xt.y>=Ee&&er.y>=Ee||(Xt.y>=Ee?Xt=new i(Xt.x+(Ee-Xt.y)/(er.y-Xt.y)*(er.x-Xt.x),Ee)._round():er.y>=Ee&&(er=new i(Xt.x+(Ee-Xt.y)/(er.y-Xt.y)*(er.x-Xt.x),Ee)._round()),mt&&Xt.equals(mt[mt.length-1])||(mt=[Xt],Be.push(mt)),mt.push(er)))))}}return Be}Wa("FeatureIndex",dm,{omit:["rawTileData","sourceLayerCoder"]});class Fv extends i{constructor(D,K,he,Ee){super(D,K),this.angle=he,Ee!==void 0&&(this.segment=Ee)}clone(){return new Fv(this.x,this.y,this.angle,this.segment)}}function mm(H,D,K,he,Ee){if(D.segment===void 0||K===0)return!0;let Be=D,Ve=D.segment+1,nt=0;for(;nt>-K/2;){if(Ve--,Ve<0)return!1;nt-=H[Ve].dist(Be),Be=H[Ve]}nt+=H[Ve].dist(H[Ve+1]),Ve++;const mt=[];let Pt=0;for(;nthe;)Pt-=mt.shift().angleDelta;if(Pt>Ee)return!1;Ve++,nt+=Xt.dist(er)}return!0}function _m(H){let D=0;for(let K=0;KPt){const jr=(Pt-mt)/Rr,Yr=Ci.number(er.x,br.x,jr),ca=Ci.number(er.y,br.y,jr),Ca=new Fv(Yr,ca,br.angleTo(er),Xt);return Ca._round(),!Ve||mm(H,Ca,nt,Ve,D)?Ca:void 0}mt+=Rr}}function Nx(H,D,K,he,Ee,Be,Ve,nt,mt){const Pt=xm(he,Be,Ve),Xt=bm(he,Ee),er=Xt*Ve,br=H[0].x===0||H[0].x===mt||H[0].y===0||H[0].y===mt;return D-er=0&&rn=0&&Sn=0&&br+Pt<=Xt){const $n=new Fv(rn,Sn,un,jr);$n._round(),he&&!mm(H,$n,Be,he,Ee)||Rr.push($n)}}er+=Ca}return nt||Rr.length||Ve||(Rr=ed(H,er/2,K,he,Ee,Be,Ve,!0,mt)),Rr}Wa("Anchor",Fv);const Ad=Ic;function wm(H,D,K,he){const Ee=[],Be=H.image,Ve=Be.pixelRatio,nt=Be.paddedRect.w-2*Ad,mt=Be.paddedRect.h-2*Ad;let Pt={x1:H.left,y1:H.top,x2:H.right,y2:H.bottom};const Xt=Be.stretchX||[[0,nt]],er=Be.stretchY||[[0,mt]],br=(zn,To)=>zn+To[1]-To[0],Rr=Xt.reduce(br,0),jr=er.reduce(br,0),Yr=nt-Rr,ca=mt-jr;let Ca=0,un=Rr,Ha=0,rn=jr,Sn=0,$n=Yr,Oi=0,qo=ca;if(Be.content&&he){const zn=Be.content,To=zn[2]-zn[0],_o=zn[3]-zn[1];(Be.textFitWidth||Be.textFitHeight)&&(Pt=am(H)),Ca=Sd(Xt,0,zn[0]),Ha=Sd(er,0,zn[1]),un=Sd(Xt,zn[0],zn[2]),rn=Sd(er,zn[1],zn[3]),Sn=zn[0]-Ca,Oi=zn[1]-Ha,$n=To-un,qo=_o-rn}const qi=Pt.x1,Di=Pt.y1,mo=Pt.x2-qi,so=Pt.y2-Di,to=(zn,To,_o,ts)=>{const Gl=_h(zn.stretch-Ca,un,mo,qi),Nl=v0(zn.fixed-Sn,$n,zn.stretch,Rr),Gc=_h(To.stretch-Ha,rn,so,Di),ih=v0(To.fixed-Oi,qo,To.stretch,jr),hc=_h(_o.stretch-Ca,un,mo,qi),Rc=v0(_o.fixed-Sn,$n,_o.stretch,Rr),Yf=_h(ts.stretch-Ha,rn,so,Di),Kf=v0(ts.fixed-Oi,qo,ts.stretch,jr),Jf=new i(Gl,Gc),Ou=new i(hc,Gc),Wc=new i(hc,Yf),Ff=new i(Gl,Yf),Tf=new i(Nl/Ve,ih/Ve),$f=new i(Rc/Ve,Kf/Ve),lf=D*Math.PI/180;if(lf){const tl=Math.sin(lf),El=Math.cos(lf),Ll=[El,-tl,tl,El];Jf._matMult(Ll),Ou._matMult(Ll),Ff._matMult(Ll),Wc._matMult(Ll)}const xh=zn.stretch+zn.fixed,uu=To.stretch+To.fixed;return{tl:Jf,tr:Ou,bl:Ff,br:Wc,tex:{x:Be.paddedRect.x+Ad+xh,y:Be.paddedRect.y+Ad+uu,w:_o.stretch+_o.fixed-xh,h:ts.stretch+ts.fixed-uu},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Tf,pixelOffsetBR:$f,minFontScaleX:$n/Ve/mo,minFontScaleY:qo/Ve/so,isSDF:K}};if(he&&(Be.stretchX||Be.stretchY)){const zn=Md(Xt,Yr,Rr),To=Md(er,ca,jr);for(let _o=0;_o0&&(Yr=Math.max(10,Yr),this.circleDiameter=Yr)}else{const br=!((er=Ve.image)===null||er===void 0)&&er.content&&(Ve.image.textFitWidth||Ve.image.textFitHeight)?am(Ve):{x1:Ve.left,y1:Ve.top,x2:Ve.right,y2:Ve.bottom};br.y1=br.y1*nt-mt[0],br.y2=br.y2*nt+mt[2],br.x1=br.x1*nt-mt[3],br.x2=br.x2*nt+mt[1];const Rr=Ve.collisionPadding;if(Rr&&(br.x1-=Rr[0]*nt,br.y1-=Rr[1]*nt,br.x2+=Rr[2]*nt,br.y2+=Rr[3]*nt),Xt){const jr=new i(br.x1,br.y1),Yr=new i(br.x2,br.y1),ca=new i(br.x1,br.y2),Ca=new i(br.x2,br.y2),un=Xt*Math.PI/180;jr._rotate(un),Yr._rotate(un),ca._rotate(un),Ca._rotate(un),br.x1=Math.min(jr.x,Yr.x,ca.x,Ca.x),br.x2=Math.max(jr.x,Yr.x,ca.x,Ca.x),br.y1=Math.min(jr.y,Yr.y,ca.y,Ca.y),br.y2=Math.max(jr.y,Yr.y,ca.y,Ca.y)}D.emplaceBack(K.x,K.y,br.x1,br.y1,br.x2,br.y2,he,Ee,Be)}this.boxEndIndex=D.length}}class Ux{constructor(D=[],K=(he,Ee)=>heEe?1:0){if(this.data=D,this.length=this.data.length,this.compare=K,this.length>0)for(let he=(this.length>>1)-1;he>=0;he--)this._down(he)}push(D){this.data.push(D),this._up(this.length++)}pop(){if(this.length===0)return;const D=this.data[0],K=this.data.pop();return--this.length>0&&(this.data[0]=K,this._down(0)),D}peek(){return this.data[0]}_up(D){const{data:K,compare:he}=this,Ee=K[D];for(;D>0;){const Be=D-1>>1,Ve=K[Be];if(he(Ee,Ve)>=0)break;K[D]=Ve,D=Be}K[D]=Ee}_down(D){const{data:K,compare:he}=this,Ee=this.length>>1,Be=K[D];for(;D=0)break;K[D]=K[Ve],D=Ve}K[D]=Be}}function jx(H,D=1,K=!1){let he=1/0,Ee=1/0,Be=-1/0,Ve=-1/0;const nt=H[0];for(let Rr=0;RrBe)&&(Be=jr.x),(!Rr||jr.y>Ve)&&(Ve=jr.y)}const mt=Math.min(Be-he,Ve-Ee);let Pt=mt/2;const Xt=new Ux([],Vx);if(mt===0)return new i(he,Ee);for(let Rr=he;Rrer.d||!er.d)&&(er=Rr,K&&console.log("found best %d after %d probes",Math.round(1e4*Rr.d)/1e4,br)),Rr.max-er.d<=D||(Pt=Rr.h/2,Xt.push(new ev(Rr.p.x-Pt,Rr.p.y-Pt,Pt,H)),Xt.push(new ev(Rr.p.x+Pt,Rr.p.y-Pt,Pt,H)),Xt.push(new ev(Rr.p.x-Pt,Rr.p.y+Pt,Pt,H)),Xt.push(new ev(Rr.p.x+Pt,Rr.p.y+Pt,Pt,H)),br+=4)}return K&&(console.log(`num probes: ${br}`),console.log(`best distance: ${er.d}`)),er.p}function Vx(H,D){return D.max-H.max}function ev(H,D,K,he){this.p=new i(H,D),this.h=K,this.d=function(Ee,Be){let Ve=!1,nt=1/0;for(let mt=0;mtEe.y!=jr.y>Ee.y&&Ee.x<(jr.x-Rr.x)*(Ee.y-Rr.y)/(jr.y-Rr.y)+Rr.x&&(Ve=!Ve),nt=Math.min(nt,Wi(Ee,Rr,jr))}}return(Ve?1:-1)*Math.sqrt(nt)}(this.p,he),this.max=this.d+this.h*Math.SQRT2}var sf;e.aq=void 0,(sf=e.aq||(e.aq={}))[sf.center=1]="center",sf[sf.left=2]="left",sf[sf.right=3]="right",sf[sf.top=4]="top",sf[sf.bottom=5]="bottom",sf[sf["top-left"]=6]="top-left",sf[sf["top-right"]=7]="top-right",sf[sf["bottom-left"]=8]="bottom-left",sf[sf["bottom-right"]=9]="bottom-right";const Ov=7,Mg=Number.POSITIVE_INFINITY;function Tm(H,D){return D[1]!==Mg?function(K,he,Ee){let Be=0,Ve=0;switch(he=Math.abs(he),Ee=Math.abs(Ee),K){case"top-right":case"top-left":case"top":Ve=Ee-Ov;break;case"bottom-right":case"bottom-left":case"bottom":Ve=-Ee+Ov}switch(K){case"top-right":case"bottom-right":case"right":Be=-he;break;case"top-left":case"bottom-left":case"left":Be=he}return[Be,Ve]}(H,D[0],D[1]):function(K,he){let Ee=0,Be=0;he<0&&(he=0);const Ve=he/Math.SQRT2;switch(K){case"top-right":case"top-left":Be=Ve-Ov;break;case"bottom-right":case"bottom-left":Be=-Ve+Ov;break;case"bottom":Be=-he+Ov;break;case"top":Be=he-Ov}switch(K){case"top-right":case"bottom-right":Ee=-Ve;break;case"top-left":case"bottom-left":Ee=Ve;break;case"left":Ee=he;break;case"right":Ee=-he}return[Ee,Be]}(H,D[0])}function Am(H,D,K){var he;const Ee=H.layout,Be=(he=Ee.get("text-variable-anchor-offset"))===null||he===void 0?void 0:he.evaluate(D,{},K);if(Be){const nt=Be.values,mt=[];for(let Pt=0;Ptbr*pl);Xt.startsWith("top")?er[1]-=Ov:Xt.startsWith("bottom")&&(er[1]+=Ov),mt[Pt+1]=er}return new Aa(mt)}const Ve=Ee.get("text-variable-anchor");if(Ve){let nt;nt=H._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[Ee.get("text-radial-offset").evaluate(D,{},K)*pl,Mg]:Ee.get("text-offset").evaluate(D,{},K).map(Pt=>Pt*pl);const mt=[];for(const Pt of Ve)mt.push(Pt,Tm(Pt,nt));return new Aa(mt)}return null}function Eg(H){switch(H){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function qx(H,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt){let er=Be.textMaxSize.evaluate(D,{});er===void 0&&(er=Ve);const br=H.layers[0].layout,Rr=br.get("icon-offset").evaluate(D,{},Xt),jr=Mm(K.horizontal),Yr=Ve/24,ca=H.tilePixelRatio*Yr,Ca=H.tilePixelRatio*er/24,un=H.tilePixelRatio*nt,Ha=H.tilePixelRatio*br.get("symbol-spacing"),rn=br.get("text-padding")*H.tilePixelRatio,Sn=function(zn,To,_o,ts=1){const Gl=zn.get("icon-padding").evaluate(To,{},_o),Nl=Gl&&Gl.values;return[Nl[0]*ts,Nl[1]*ts,Nl[2]*ts,Nl[3]*ts]}(br,D,Xt,H.tilePixelRatio),$n=br.get("text-max-angle")/180*Math.PI,Oi=br.get("text-rotation-alignment")!=="viewport"&&br.get("symbol-placement")!=="point",qo=br.get("icon-rotation-alignment")==="map"&&br.get("symbol-placement")!=="point",qi=br.get("symbol-placement"),Di=Ha/2,mo=br.get("icon-text-fit");let so;he&&mo!=="none"&&(H.allowVerticalPlacement&&K.vertical&&(so=nm(he,K.vertical,mo,br.get("icon-text-fit-padding"),Rr,Yr)),jr&&(he=nm(he,jr,mo,br.get("icon-text-fit-padding"),Rr,Yr)));const to=(zn,To)=>{To.x<0||To.x>=_s||To.y<0||To.y>=_s||function(_o,ts,Gl,Nl,Gc,ih,hc,Rc,Yf,Kf,Jf,Ou,Wc,Ff,Tf,$f,lf,xh,uu,tl,El,Ll,ku,cu,Cd){const jh=_o.addToLineVertexArray(ts,Gl);let Vh,Of,Wl,uf,Fh=0,bh=0,Qf=0,Rg=0,Dg=-1,m0=-1;const gv={};let zg=Ma("");if(_o.allowVerticalPlacement&&Nl.vertical){const Af=Rc.layout.get("text-rotate").evaluate(El,{},cu)+90;Wl=new d0(Yf,ts,Kf,Jf,Ou,Nl.vertical,Wc,Ff,Tf,Af),hc&&(uf=new d0(Yf,ts,Kf,Jf,Ou,hc,lf,xh,Tf,Af))}if(Gc){const Af=Rc.layout.get("icon-rotate").evaluate(El,{}),wh=Rc.layout.get("icon-text-fit")!=="none",Bv=wm(Gc,Af,ku,wh),qh=hc?wm(hc,Af,ku,wh):void 0;Of=new d0(Yf,ts,Kf,Jf,Ou,Gc,lf,xh,!1,Af),Fh=4*Bv.length;const td=_o.iconSizeData;let Hh=null;td.kind==="source"?(Hh=[$h*Rc.layout.get("icon-size").evaluate(El,{})],Hh[0]>Dv&&m(`${_o.layerIds[0]}: Value for "icon-size" is >= ${vp}. Reduce your "icon-size".`)):td.kind==="composite"&&(Hh=[$h*Ll.compositeIconSizes[0].evaluate(El,{},cu),$h*Ll.compositeIconSizes[1].evaluate(El,{},cu)],(Hh[0]>Dv||Hh[1]>Dv)&&m(`${_o.layerIds[0]}: Value for "icon-size" is >= ${vp}. Reduce your "icon-size".`)),_o.addSymbols(_o.icon,Bv,Hh,tl,uu,El,e.ah.none,ts,jh.lineStartIndex,jh.lineLength,-1,cu),Dg=_o.icon.placedSymbolArray.length-1,qh&&(bh=4*qh.length,_o.addSymbols(_o.icon,qh,Hh,tl,uu,El,e.ah.vertical,ts,jh.lineStartIndex,jh.lineLength,-1,cu),m0=_o.icon.placedSymbolArray.length-1)}const Fg=Object.keys(Nl.horizontal);for(const Af of Fg){const wh=Nl.horizontal[Af];if(!Vh){zg=Ma(wh.text);const qh=Rc.layout.get("text-rotate").evaluate(El,{},cu);Vh=new d0(Yf,ts,Kf,Jf,Ou,wh,Wc,Ff,Tf,qh)}const Bv=wh.positionedLines.length===1;if(Qf+=Sm(_o,ts,wh,ih,Rc,Tf,El,$f,jh,Nl.vertical?e.ah.horizontal:e.ah.horizontalOnly,Bv?Fg:[Af],gv,Dg,Ll,cu),Bv)break}Nl.vertical&&(Rg+=Sm(_o,ts,Nl.vertical,ih,Rc,Tf,El,$f,jh,e.ah.vertical,["vertical"],gv,m0,Ll,cu));const Og=Vh?Vh.boxStartIndex:_o.collisionBoxArray.length,Bg=Vh?Vh.boxEndIndex:_o.collisionBoxArray.length,Hx=Wl?Wl.boxStartIndex:_o.collisionBoxArray.length,Gx=Wl?Wl.boxEndIndex:_o.collisionBoxArray.length,Wx=Of?Of.boxStartIndex:_o.collisionBoxArray.length,Zx=Of?Of.boxEndIndex:_o.collisionBoxArray.length,Pm=uf?uf.boxStartIndex:_o.collisionBoxArray.length,Ld=uf?uf.boxEndIndex:_o.collisionBoxArray.length;let Dc=-1;const Pd=(Af,wh)=>Af&&Af.circleDiameter?Math.max(Af.circleDiameter,wh):wh;Dc=Pd(Vh,Dc),Dc=Pd(Wl,Dc),Dc=Pd(Of,Dc),Dc=Pd(uf,Dc);const Ng=Dc>-1?1:0;Ng&&(Dc*=Cd/pl),_o.glyphOffsetArray.length>=$v.MAX_GLYPHS&&m("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),El.sortKey!==void 0&&_o.addToSortKeyRanges(_o.symbolInstances.length,El.sortKey);const Im=Am(Rc,El,cu),[Xx,Rm]=function(Af,wh){const Bv=Af.length,qh=wh==null?void 0:wh.values;if((qh==null?void 0:qh.length)>0)for(let td=0;td=0?gv.right:-1,gv.center>=0?gv.center:-1,gv.left>=0?gv.left:-1,gv.vertical||-1,Dg,m0,zg,Og,Bg,Hx,Gx,Wx,Zx,Pm,Ld,Kf,Qf,Rg,Fh,bh,Ng,0,Wc,Dc,Xx,Rm)}(H,To,zn,K,he,Ee,so,H.layers[0],H.collisionBoxArray,D.index,D.sourceLayerIndex,H.index,ca,[rn,rn,rn,rn],Oi,mt,un,Sn,qo,Rr,D,Be,Pt,Xt,Ve)};if(qi==="line")for(const zn of ym(D.geometry,0,0,_s,_s)){const To=Nx(zn,Ha,$n,K.vertical||jr,he,24,Ca,H.overscaling,_s);for(const _o of To)jr&&Em(H,jr.text,Di,_o)||to(zn,_o)}else if(qi==="line-center"){for(const zn of D.geometry)if(zn.length>1){const To=Bx(zn,$n,K.vertical||jr,he,24,Ca);To&&to(zn,To)}}else if(D.type==="Polygon")for(const zn of Lu(D.geometry,0)){const To=jx(zn,16);to(zn[0],new Fv(To.x,To.y,0))}else if(D.type==="LineString")for(const zn of D.geometry)to(zn,new Fv(zn[0].x,zn[0].y,0));else if(D.type==="Point")for(const zn of D.geometry)for(const To of zn)to([To],new Fv(To.x,To.y,0))}function Sm(H,D,K,he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr){const Yr=function(un,Ha,rn,Sn,$n,Oi,qo,qi){const Di=Sn.layout.get("text-rotate").evaluate(Oi,{})*Math.PI/180,mo=[];for(const so of Ha.positionedLines)for(const to of so.positionedGlyphs){if(!to.rect)continue;const zn=to.rect||{};let To=dg+1,_o=!0,ts=1,Gl=0;const Nl=($n||qi)&&to.vertical,Gc=to.metrics.advance*to.scale/2;if(qi&&Ha.verticalizable&&(Gl=so.lineOffset/2-(to.imageName?-(pl-to.metrics.width*to.scale)/2:(to.scale-1)*pl)),to.imageName){const tl=qo[to.imageName];_o=tl.sdf,ts=tl.pixelRatio,To=Ic/ts}const ih=$n?[to.x+Gc,to.y]:[0,0];let hc=$n?[0,0]:[to.x+Gc+rn[0],to.y+rn[1]-Gl],Rc=[0,0];Nl&&(Rc=hc,hc=[0,0]);const Yf=to.metrics.isDoubleResolution?2:1,Kf=(to.metrics.left-To)*to.scale-Gc+hc[0],Jf=(-to.metrics.top-To)*to.scale+hc[1],Ou=Kf+zn.w/Yf*to.scale/ts,Wc=Jf+zn.h/Yf*to.scale/ts,Ff=new i(Kf,Jf),Tf=new i(Ou,Jf),$f=new i(Kf,Wc),lf=new i(Ou,Wc);if(Nl){const tl=new i(-Gc,Gc-_d),El=-Math.PI/2,Ll=pl/2-Gc,ku=new i(5-_d-Ll,-(to.imageName?Ll:0)),cu=new i(...Rc);Ff._rotateAround(El,tl)._add(ku)._add(cu),Tf._rotateAround(El,tl)._add(ku)._add(cu),$f._rotateAround(El,tl)._add(ku)._add(cu),lf._rotateAround(El,tl)._add(ku)._add(cu)}if(Di){const tl=Math.sin(Di),El=Math.cos(Di),Ll=[El,-tl,tl,El];Ff._matMult(Ll),Tf._matMult(Ll),$f._matMult(Ll),lf._matMult(Ll)}const xh=new i(0,0),uu=new i(0,0);mo.push({tl:Ff,tr:Tf,bl:$f,br:lf,tex:zn,writingMode:Ha.writingMode,glyphOffset:ih,sectionIndex:to.sectionIndex,isSDF:_o,pixelOffsetTL:xh,pixelOffsetBR:uu,minFontScaleX:0,minFontScaleY:0})}return mo}(0,K,nt,Ee,Be,Ve,he,H.allowVerticalPlacement),ca=H.textSizeData;let Ca=null;ca.kind==="source"?(Ca=[$h*Ee.layout.get("text-size").evaluate(Ve,{})],Ca[0]>Dv&&m(`${H.layerIds[0]}: Value for "text-size" is >= ${vp}. Reduce your "text-size".`)):ca.kind==="composite"&&(Ca=[$h*Rr.compositeTextSizes[0].evaluate(Ve,{},jr),$h*Rr.compositeTextSizes[1].evaluate(Ve,{},jr)],(Ca[0]>Dv||Ca[1]>Dv)&&m(`${H.layerIds[0]}: Value for "text-size" is >= ${vp}. Reduce your "text-size".`)),H.addSymbols(H.text,Yr,Ca,nt,Be,Ve,Pt,D,mt.lineStartIndex,mt.lineLength,br,jr);for(const un of Xt)er[un]=H.text.placedSymbolArray.length-1;return 4*Yr.length}function Mm(H){for(const D in H)return H[D];return null}function Em(H,D,K,he){const Ee=H.compareText;if(D in Ee){const Be=Ee[D];for(let Ve=Be.length-1;Ve>=0;Ve--)if(he.dist(Be[Ve])>4;if(Ee!==1)throw new Error(`Got v${Ee} data when expected v1.`);const Be=km[15&he];if(!Be)throw new Error("Unrecognized array type.");const[Ve]=new Uint16Array(D,2,1),[nt]=new Uint32Array(D,4,1);return new kg(nt,Ve,Be,D)}constructor(D,K=64,he=Float64Array,Ee){if(isNaN(D)||D<0)throw new Error(`Unpexpected numItems value: ${D}.`);this.numItems=+D,this.nodeSize=Math.min(Math.max(+K,2),65535),this.ArrayType=he,this.IndexArrayType=D<65536?Uint16Array:Uint32Array;const Be=km.indexOf(this.ArrayType),Ve=2*D*this.ArrayType.BYTES_PER_ELEMENT,nt=D*this.IndexArrayType.BYTES_PER_ELEMENT,mt=(8-nt%8)%8;if(Be<0)throw new Error(`Unexpected typed array class: ${he}.`);Ee&&Ee instanceof ArrayBuffer?(this.data=Ee,this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+nt+mt,2*D),this._pos=2*D,this._finished=!0):(this.data=new ArrayBuffer(8+Ve+nt+mt),this.ids=new this.IndexArrayType(this.data,8,D),this.coords=new this.ArrayType(this.data,8+nt+mt,2*D),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+Be]),new Uint16Array(this.data,2,1)[0]=K,new Uint32Array(this.data,4,1)[0]=D)}add(D,K){const he=this._pos>>1;return this.ids[he]=he,this.coords[this._pos++]=D,this.coords[this._pos++]=K,he}finish(){const D=this._pos>>1;if(D!==this.numItems)throw new Error(`Added ${D} items when expected ${this.numItems}.`);return Cg(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(D,K,he,Ee){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Be,coords:Ve,nodeSize:nt}=this,mt=[0,Be.length-1,0],Pt=[];for(;mt.length;){const Xt=mt.pop()||0,er=mt.pop()||0,br=mt.pop()||0;if(er-br<=nt){for(let ca=br;ca<=er;ca++){const Ca=Ve[2*ca],un=Ve[2*ca+1];Ca>=D&&Ca<=he&&un>=K&&un<=Ee&&Pt.push(Be[ca])}continue}const Rr=br+er>>1,jr=Ve[2*Rr],Yr=Ve[2*Rr+1];jr>=D&&jr<=he&&Yr>=K&&Yr<=Ee&&Pt.push(Be[Rr]),(Xt===0?D<=jr:K<=Yr)&&(mt.push(br),mt.push(Rr-1),mt.push(1-Xt)),(Xt===0?he>=jr:Ee>=Yr)&&(mt.push(Rr+1),mt.push(er),mt.push(1-Xt))}return Pt}within(D,K,he){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:Ee,coords:Be,nodeSize:Ve}=this,nt=[0,Ee.length-1,0],mt=[],Pt=he*he;for(;nt.length;){const Xt=nt.pop()||0,er=nt.pop()||0,br=nt.pop()||0;if(er-br<=Ve){for(let ca=br;ca<=er;ca++)wf(Be[2*ca],Be[2*ca+1],D,K)<=Pt&&mt.push(Ee[ca]);continue}const Rr=br+er>>1,jr=Be[2*Rr],Yr=Be[2*Rr+1];wf(jr,Yr,D,K)<=Pt&&mt.push(Ee[Rr]),(Xt===0?D-he<=jr:K-he<=Yr)&&(nt.push(br),nt.push(Rr-1),nt.push(1-Xt)),(Xt===0?D+he>=jr:K+he>=Yr)&&(nt.push(Rr+1),nt.push(er),nt.push(1-Xt))}return mt}}function Cg(H,D,K,he,Ee,Be){if(Ee-he<=K)return;const Ve=he+Ee>>1;Cm(H,D,Ve,he,Ee,Be),Cg(H,D,K,he,Ve-1,1-Be),Cg(H,D,K,Ve+1,Ee,1-Be)}function Cm(H,D,K,he,Ee,Be){for(;Ee>he;){if(Ee-he>600){const Pt=Ee-he+1,Xt=K-he+1,er=Math.log(Pt),br=.5*Math.exp(2*er/3),Rr=.5*Math.sqrt(er*br*(Pt-br)/Pt)*(Xt-Pt/2<0?-1:1);Cm(H,D,K,Math.max(he,Math.floor(K-Xt*br/Pt+Rr)),Math.min(Ee,Math.floor(K+(Pt-Xt)*br/Pt+Rr)),Be)}const Ve=D[2*K+Be];let nt=he,mt=Ee;for(Ed(H,D,he,K),D[2*Ee+Be]>Ve&&Ed(H,D,he,Ee);ntVe;)mt--}D[2*he+Be]===Ve?Ed(H,D,he,mt):(mt++,Ed(H,D,mt,Ee)),mt<=K&&(he=mt+1),K<=mt&&(Ee=mt-1)}}function Ed(H,D,K,he){p0(H,K,he),p0(D,2*K,2*he),p0(D,2*K+1,2*he+1)}function p0(H,D,K){const he=H[D];H[D]=H[K],H[K]=he}function wf(H,D,K,he){const Ee=H-K,Be=D-he;return Ee*Ee+Be*Be}var Lg;e.bg=void 0,(Lg=e.bg||(e.bg={})).create="create",Lg.load="load",Lg.fullLoad="fullLoad";let g0=null,kd=[];const Pg=1e3/60,y0="loadTime",Ig="fullLoadTime",Lm={mark(H){performance.mark(H)},frame(H){const D=H;g0!=null&&kd.push(D-g0),g0=D},clearMetrics(){g0=null,kd=[],performance.clearMeasures(y0),performance.clearMeasures(Ig);for(const H in e.bg)performance.clearMarks(e.bg[H])},getPerformanceMetrics(){performance.measure(y0,e.bg.create,e.bg.load),performance.measure(Ig,e.bg.create,e.bg.fullLoad);const H=performance.getEntriesByName(y0)[0].duration,D=performance.getEntriesByName(Ig)[0].duration,K=kd.length,he=1/(kd.reduce((Be,Ve)=>Be+Ve,0)/K/1e3),Ee=kd.filter(Be=>Be>Pg).reduce((Be,Ve)=>Be+(Ve-Pg)/Pg,0);return{loadTime:H,fullLoadTime:D,fps:he,percentDroppedFrames:Ee/(K+Ee)*100,totalFrames:K}}};e.$=class extends nr{},e.A=$i,e.B=sn,e.C=function(H){if(z==null){const D=H.navigator?H.navigator.userAgent:null;z=!!H.safari||!(!D||!(/\b(iPad|iPhone|iPod)\b/.test(D)||D.match("Safari")&&!D.match("Chrome")))}return z},e.D=Vi,e.E=ae,e.F=class{constructor(H,D){this.target=H,this.mapId=D,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new yp(()=>this.process()),this.subscription=function(K,he,Ee,Be){return K.addEventListener(he,Ee,!1),{unsubscribe:()=>{K.removeEventListener(he,Ee,!1)}}}(this.target,"message",K=>this.receive(K)),this.globalScope=P(self)?H:window}registerMessageHandler(H,D){this.messageHandlers[H]=D}sendAsync(H,D){return new Promise((K,he)=>{const Ee=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[Ee]={resolve:K,reject:he},D&&D.signal.addEventListener("abort",()=>{delete this.resolveRejects[Ee];const nt={id:Ee,type:"",origin:location.origin,targetMapId:H.targetMapId,sourceMapId:this.mapId};this.target.postMessage(nt)},{once:!0});const Be=[],Ve=Object.assign(Object.assign({},H),{id:Ee,sourceMapId:this.mapId,origin:location.origin,data:ji(H.data,Be)});this.target.postMessage(Ve,{transfer:Be})})}receive(H){const D=H.data,K=D.id;if(!(D.origin!=="file://"&&location.origin!=="file://"&&D.origin!=="resource://android"&&location.origin!=="resource://android"&&D.origin!==location.origin||D.targetMapId&&this.mapId!==D.targetMapId)){if(D.type===""){delete this.tasks[K];const he=this.abortControllers[K];return delete this.abortControllers[K],void(he&&he.abort())}if(P(self)||D.mustQueue)return this.tasks[K]=D,this.taskQueue.push(K),void this.invoker.trigger();this.processTask(K,D)}}process(){if(this.taskQueue.length===0)return;const H=this.taskQueue.shift(),D=this.tasks[H];delete this.tasks[H],this.taskQueue.length>0&&this.invoker.trigger(),D&&this.processTask(H,D)}processTask(H,D){return t(this,void 0,void 0,function*(){if(D.type===""){const Ee=this.resolveRejects[H];return delete this.resolveRejects[H],Ee?void(D.error?Ee.reject(Ni(D.error)):Ee.resolve(Ni(D.data))):void 0}if(!this.messageHandlers[D.type])return void this.completeTask(H,new Error(`Could not find a registered handler for ${D.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const K=Ni(D.data),he=new AbortController;this.abortControllers[H]=he;try{const Ee=yield this.messageHandlers[D.type](D.sourceMapId,K,he);this.completeTask(H,null,Ee)}catch(Ee){this.completeTask(H,Ee)}})}completeTask(H,D,K){const he=[];delete this.abortControllers[H];const Ee={id:H,type:"",sourceMapId:this.mapId,origin:location.origin,error:D?ji(D):null,data:ji(K,he)};this.target.postMessage(Ee,{transfer:he})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=oe,e.H=function(){var H=new $i(16);return $i!=Float32Array&&(H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[11]=0,H[12]=0,H[13]=0,H[14]=0),H[0]=1,H[5]=1,H[10]=1,H[15]=1,H},e.I=bf,e.J=function(H,D,K){var he,Ee,Be,Ve,nt,mt,Pt,Xt,er,br,Rr,jr,Yr=K[0],ca=K[1],Ca=K[2];return D===H?(H[12]=D[0]*Yr+D[4]*ca+D[8]*Ca+D[12],H[13]=D[1]*Yr+D[5]*ca+D[9]*Ca+D[13],H[14]=D[2]*Yr+D[6]*ca+D[10]*Ca+D[14],H[15]=D[3]*Yr+D[7]*ca+D[11]*Ca+D[15]):(Ee=D[1],Be=D[2],Ve=D[3],nt=D[4],mt=D[5],Pt=D[6],Xt=D[7],er=D[8],br=D[9],Rr=D[10],jr=D[11],H[0]=he=D[0],H[1]=Ee,H[2]=Be,H[3]=Ve,H[4]=nt,H[5]=mt,H[6]=Pt,H[7]=Xt,H[8]=er,H[9]=br,H[10]=Rr,H[11]=jr,H[12]=he*Yr+nt*ca+er*Ca+D[12],H[13]=Ee*Yr+mt*ca+br*Ca+D[13],H[14]=Be*Yr+Pt*ca+Rr*Ca+D[14],H[15]=Ve*Yr+Xt*ca+jr*Ca+D[15]),H},e.K=function(H,D,K){var he=K[0],Ee=K[1],Be=K[2];return H[0]=D[0]*he,H[1]=D[1]*he,H[2]=D[2]*he,H[3]=D[3]*he,H[4]=D[4]*Ee,H[5]=D[5]*Ee,H[6]=D[6]*Ee,H[7]=D[7]*Ee,H[8]=D[8]*Be,H[9]=D[9]*Be,H[10]=D[10]*Be,H[11]=D[11]*Be,H[12]=D[12],H[13]=D[13],H[14]=D[14],H[15]=D[15],H},e.L=Mn,e.M=function(H,D){const K={};for(let he=0;he{const D=window.document.createElement("video");return D.muted=!0,new Promise(K=>{D.onloadstart=()=>{K(D)};for(const he of H){const Ee=window.document.createElement("source");$(he)||(D.crossOrigin="Anonymous"),Ee.src=he,D.appendChild(Ee)}})},e.a4=function(){return _++},e.a5=ln,e.a6=$v,e.a7=Ec,e.a8=fa,e.a9=vm,e.aA=function(H){if(H.type==="custom")return new sm(H);switch(H.type){case"background":return new gp(H);case"circle":return new ri(H);case"fill":return new Ea(H);case"fill-extrusion":return new ph(H);case"heatmap":return new dl(H);case"hillshade":return new Lc(H);case"line":return new Xv(H);case"raster":return new Ox(H);case"symbol":return new u0(H)}},e.aB=u,e.aC=function(H,D){if(!H)return[{command:"setStyle",args:[D]}];let K=[];try{if(!Ae(H.version,D.version))return[{command:"setStyle",args:[D]}];Ae(H.center,D.center)||K.push({command:"setCenter",args:[D.center]}),Ae(H.zoom,D.zoom)||K.push({command:"setZoom",args:[D.zoom]}),Ae(H.bearing,D.bearing)||K.push({command:"setBearing",args:[D.bearing]}),Ae(H.pitch,D.pitch)||K.push({command:"setPitch",args:[D.pitch]}),Ae(H.sprite,D.sprite)||K.push({command:"setSprite",args:[D.sprite]}),Ae(H.glyphs,D.glyphs)||K.push({command:"setGlyphs",args:[D.glyphs]}),Ae(H.transition,D.transition)||K.push({command:"setTransition",args:[D.transition]}),Ae(H.light,D.light)||K.push({command:"setLight",args:[D.light]}),Ae(H.terrain,D.terrain)||K.push({command:"setTerrain",args:[D.terrain]}),Ae(H.sky,D.sky)||K.push({command:"setSky",args:[D.sky]}),Ae(H.projection,D.projection)||K.push({command:"setProjection",args:[D.projection]});const he={},Ee=[];(function(Ve,nt,mt,Pt){let Xt;for(Xt in nt=nt||{},Ve=Ve||{})Object.prototype.hasOwnProperty.call(Ve,Xt)&&(Object.prototype.hasOwnProperty.call(nt,Xt)||qe(Xt,mt,Pt));for(Xt in nt)Object.prototype.hasOwnProperty.call(nt,Xt)&&(Object.prototype.hasOwnProperty.call(Ve,Xt)?Ae(Ve[Xt],nt[Xt])||(Ve[Xt].type==="geojson"&&nt[Xt].type==="geojson"&&Qe(Ve,nt,Xt)?Fe(mt,{command:"setGeoJSONSourceData",args:[Xt,nt[Xt].data]}):et(Xt,nt,mt,Pt)):Ce(Xt,nt,mt))})(H.sources,D.sources,Ee,he);const Be=[];H.layers&&H.layers.forEach(Ve=>{"source"in Ve&&he[Ve.source]?K.push({command:"removeLayer",args:[Ve.id]}):Be.push(Ve)}),K=K.concat(Ee),function(Ve,nt,mt){nt=nt||[];const Pt=(Ve=Ve||[]).map(Xe),Xt=nt.map(Xe),er=Ve.reduce(Me,{}),br=nt.reduce(Me,{}),Rr=Pt.slice(),jr=Object.create(null);let Yr,ca,Ca,un,Ha;for(let rn=0,Sn=0;rn@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(K,he,Ee,Be)=>{const Ve=Ee||Be;return D[he]=!Ve||Ve.toLowerCase(),""}),D["max-age"]){const K=parseInt(D["max-age"],10);isNaN(K)?delete D["max-age"]:D["max-age"]=K}return D},e.ab=function(H,D){const K=[];for(const he in H)he in D||K.push(he);return K},e.ac=b,e.ad=function(H,D,K){var he=Math.sin(K),Ee=Math.cos(K),Be=D[0],Ve=D[1],nt=D[2],mt=D[3],Pt=D[4],Xt=D[5],er=D[6],br=D[7];return D!==H&&(H[8]=D[8],H[9]=D[9],H[10]=D[10],H[11]=D[11],H[12]=D[12],H[13]=D[13],H[14]=D[14],H[15]=D[15]),H[0]=Be*Ee+Pt*he,H[1]=Ve*Ee+Xt*he,H[2]=nt*Ee+er*he,H[3]=mt*Ee+br*he,H[4]=Pt*Ee-Be*he,H[5]=Xt*Ee-Ve*he,H[6]=er*Ee-nt*he,H[7]=br*Ee-mt*he,H},e.ae=function(H){var D=new $i(16);return D[0]=H[0],D[1]=H[1],D[2]=H[2],D[3]=H[3],D[4]=H[4],D[5]=H[5],D[6]=H[6],D[7]=H[7],D[8]=H[8],D[9]=H[9],D[10]=H[10],D[11]=H[11],D[12]=H[12],D[13]=H[13],D[14]=H[14],D[15]=H[15],D},e.af=gi,e.ag=function(H,D){let K=0,he=0;if(H.kind==="constant")he=H.layoutSize;else if(H.kind!=="source"){const{interpolationType:Ee,minZoom:Be,maxZoom:Ve}=H,nt=Ee?b(ci.interpolationFactor(Ee,D,Be,Ve),0,1):0;H.kind==="camera"?he=Ci.number(H.minSize,H.maxSize,nt):K=nt}return{uSizeT:K,uSize:he}},e.ai=function(H,{uSize:D,uSizeT:K},{lowerSize:he,upperSize:Ee}){return H.kind==="source"?he/$h:H.kind==="composite"?Ci.number(he/$h,Ee/$h,K):D},e.aj=zv,e.ak=function(H,D,K,he){const Ee=D.y-H.y,Be=D.x-H.x,Ve=he.y-K.y,nt=he.x-K.x,mt=Ve*Be-nt*Ee;if(mt===0)return null;const Pt=(nt*(H.y-K.y)-Ve*(H.x-K.x))/mt;return new i(H.x+Pt*Be,H.y+Pt*Ee)},e.al=ym,e.am=In,e.an=Cn,e.ao=function(H){let D=1/0,K=1/0,he=-1/0,Ee=-1/0;for(const Be of H)D=Math.min(D,Be.x),K=Math.min(K,Be.y),he=Math.max(he,Be.x),Ee=Math.max(Ee,Be.y);return[D,K,he,Ee]},e.ap=pl,e.ar=yg,e.as=function(H,D){var K=D[0],he=D[1],Ee=D[2],Be=D[3],Ve=D[4],nt=D[5],mt=D[6],Pt=D[7],Xt=D[8],er=D[9],br=D[10],Rr=D[11],jr=D[12],Yr=D[13],ca=D[14],Ca=D[15],un=K*nt-he*Ve,Ha=K*mt-Ee*Ve,rn=K*Pt-Be*Ve,Sn=he*mt-Ee*nt,$n=he*Pt-Be*nt,Oi=Ee*Pt-Be*mt,qo=Xt*Yr-er*jr,qi=Xt*ca-br*jr,Di=Xt*Ca-Rr*jr,mo=er*ca-br*Yr,so=er*Ca-Rr*Yr,to=br*Ca-Rr*ca,zn=un*to-Ha*so+rn*mo+Sn*Di-$n*qi+Oi*qo;return zn?(H[0]=(nt*to-mt*so+Pt*mo)*(zn=1/zn),H[1]=(Ee*so-he*to-Be*mo)*zn,H[2]=(Yr*Oi-ca*$n+Ca*Sn)*zn,H[3]=(br*$n-er*Oi-Rr*Sn)*zn,H[4]=(mt*Di-Ve*to-Pt*qi)*zn,H[5]=(K*to-Ee*Di+Be*qi)*zn,H[6]=(ca*rn-jr*Oi-Ca*Ha)*zn,H[7]=(Xt*Oi-br*rn+Rr*Ha)*zn,H[8]=(Ve*so-nt*Di+Pt*qo)*zn,H[9]=(he*Di-K*so-Be*qo)*zn,H[10]=(jr*$n-Yr*rn+Ca*un)*zn,H[11]=(er*rn-Xt*$n-Rr*un)*zn,H[12]=(nt*qi-Ve*mo-mt*qo)*zn,H[13]=(K*mo-he*qi+Ee*qo)*zn,H[14]=(Yr*Ha-jr*Sn-ca*un)*zn,H[15]=(Xt*Sn-er*Ha+br*un)*zn,H):null},e.at=Eg,e.au=gg,e.av=kg,e.aw=function(){const H={},D=ie.$version;for(const K in ie.$root){const he=ie.$root[K];if(he.required){let Ee=null;Ee=K==="version"?D:he.type==="array"?[]:{},Ee!=null&&(H[K]=Ee)}}return H},e.ax=Bn,e.ay=j,e.az=function(H){H=H.slice();const D=Object.create(null);for(let K=0;K25||he<0||he>=1||K<0||K>=1)},e.bc=function(H,D){return H[0]=D[0],H[1]=0,H[2]=0,H[3]=0,H[4]=0,H[5]=D[1],H[6]=0,H[7]=0,H[8]=0,H[9]=0,H[10]=D[2],H[11]=0,H[12]=0,H[13]=0,H[14]=0,H[15]=1,H},e.bd=class extends Wt{},e.be=wg,e.bf=Lm,e.bh=le,e.bi=function(H,D){Q.REGISTERED_PROTOCOLS[H]=D},e.bj=function(H){delete Q.REGISTERED_PROTOCOLS[H]},e.bk=function(H,D){const K={};for(let Ee=0;Eeto*pl)}let qi=Ve?"center":K.get("text-justify").evaluate(Pt,{},H.canonical);const Di=K.get("symbol-placement")==="point"?K.get("text-max-width").evaluate(Pt,{},H.canonical)*pl:1/0,mo=()=>{H.bucket.allowVerticalPlacement&&Ki(rn)&&(jr.vertical=n0(Yr,H.glyphMap,H.glyphPositions,H.imagePositions,Xt,Di,Be,Oi,"left",$n,Ca,e.ah.vertical,!0,br,er))};if(!Ve&&qo){const so=new Set;if(qi==="auto")for(let zn=0;znt(void 0,void 0,void 0,function*(){if(H.byteLength===0)return createImageBitmap(new ImageData(1,1));const D=new Blob([new Uint8Array(H)],{type:"image/png"});try{return createImageBitmap(D)}catch(K){throw new Error(`Could not load image because of ${K.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),e.e=M,e.f=H=>new Promise((D,K)=>{const he=new Image;he.onload=()=>{D(he),URL.revokeObjectURL(he.src),he.onload=null,window.requestAnimationFrame(()=>{he.src=B})},he.onerror=()=>K(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."));const Ee=new Blob([new Uint8Array(H)],{type:"image/png"});he.src=H.byteLength?URL.createObjectURL(Ee):B}),e.g=ue,e.h=(H,D)=>J(M(H,{type:"json"}),D),e.i=P,e.j=q,e.k=ee,e.l=(H,D)=>J(M(H,{type:"arrayBuffer"}),D),e.m=J,e.n=function(H){return new hg(H).readFields(Lx,[])},e.o=xs,e.p=a0,e.q=De,e.r=ja,e.s=$,e.t=Ja,e.u=Fa,e.v=ie,e.w=m,e.x=function([H,D,K]){return D+=90,D*=Math.PI/180,K*=Math.PI/180,{x:H*Math.cos(D)*Math.sin(K),y:H*Math.sin(D)*Math.sin(K),z:H*Math.cos(K)}},e.y=Ci,e.z=Jo}),A("worker",["./shared"],function(e){class t{constructor(ze){this.keyCache={},ze&&this.replace(ze)}replace(ze){this._layerConfigs={},this._layers={},this.update(ze,[])}update(ze,Ge){for(const ve of ze){this._layerConfigs[ve.id]=ve;const ge=this._layers[ve.id]=e.aA(ve);ge._featureFilter=e.a7(ge.filter),this.keyCache[ve.id]&&delete this.keyCache[ve.id]}for(const ve of Ge)delete this.keyCache[ve],delete this._layerConfigs[ve],delete this._layers[ve];this.familiesBySource={};const Oe=e.bk(Object.values(this._layerConfigs),this.keyCache);for(const ve of Oe){const ge=ve.map(Mt=>this._layers[Mt.id]),be=ge[0];if(be.visibility==="none")continue;const Pe=be.source||"";let We=this.familiesBySource[Pe];We||(We=this.familiesBySource[Pe]={});const ct=be.sourceLayer||"_geojsonTileLayer";let _t=We[ct];_t||(_t=We[ct]=[]),_t.push(ge)}}}class r{constructor(ze){const Ge={},Oe=[];for(const Pe in ze){const We=ze[Pe],ct=Ge[Pe]={};for(const _t in We){const Mt=We[+_t];if(!Mt||Mt.bitmap.width===0||Mt.bitmap.height===0)continue;const Nt={x:0,y:0,w:Mt.bitmap.width+2,h:Mt.bitmap.height+2};Oe.push(Nt),ct[_t]={rect:Nt,metrics:Mt.metrics}}}const{w:ve,h:ge}=e.p(Oe),be=new e.o({width:ve||1,height:ge||1});for(const Pe in ze){const We=ze[Pe];for(const ct in We){const _t=We[+ct];if(!_t||_t.bitmap.width===0||_t.bitmap.height===0)continue;const Mt=Ge[Pe][ct].rect;e.o.copy(_t.bitmap,be,{x:0,y:0},{x:Mt.x+1,y:Mt.y+1},_t.bitmap)}}this.image=be,this.positions=Ge}}e.bl("GlyphAtlas",r);class o{constructor(ze){this.tileID=new e.S(ze.tileID.overscaledZ,ze.tileID.wrap,ze.tileID.canonical.z,ze.tileID.canonical.x,ze.tileID.canonical.y),this.uid=ze.uid,this.zoom=ze.zoom,this.pixelRatio=ze.pixelRatio,this.tileSize=ze.tileSize,this.source=ze.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=ze.showCollisionBoxes,this.collectResourceTiming=!!ze.collectResourceTiming,this.returnDependencies=!!ze.returnDependencies,this.promoteId=ze.promoteId,this.inFlightDependencies=[]}parse(ze,Ge,Oe,ve){return e._(this,void 0,void 0,function*(){this.status="parsing",this.data=ze,this.collisionBoxArray=new e.a5;const ge=new e.bm(Object.keys(ze.layers).sort()),be=new e.bn(this.tileID,this.promoteId);be.bucketLayerIDs=[];const Pe={},We={featureIndex:be,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:Oe},ct=Ge.familiesBySource[this.source];for(const Ia in ct){const va=ze.layers[Ia];if(!va)continue;va.version===1&&e.w(`Vector tile source "${this.source}" layer "${Ia}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const La=ge.encode(Ia),Ka=[];for(let Vt=0;Vt=Lt.maxzoom||Lt.visibility!=="none"&&(a(Vt,this.zoom,Oe),(Pe[Lt.id]=Lt.createBucket({index:be.bucketLayerIDs.length,layers:Vt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:La,sourceID:this.source})).populate(Ka,We,this.tileID.canonical),be.bucketLayerIDs.push(Vt.map(jt=>jt.id)))}}const _t=e.aF(We.glyphDependencies,Ia=>Object.keys(Ia).map(Number));this.inFlightDependencies.forEach(Ia=>Ia==null?void 0:Ia.abort()),this.inFlightDependencies=[];let Mt=Promise.resolve({});if(Object.keys(_t).length){const Ia=new AbortController;this.inFlightDependencies.push(Ia),Mt=ve.sendAsync({type:"GG",data:{stacks:_t,source:this.source,tileID:this.tileID,type:"glyphs"}},Ia)}const Nt=Object.keys(We.iconDependencies);let Bt=Promise.resolve({});if(Nt.length){const Ia=new AbortController;this.inFlightDependencies.push(Ia),Bt=ve.sendAsync({type:"GI",data:{icons:Nt,source:this.source,tileID:this.tileID,type:"icons"}},Ia)}const qt=Object.keys(We.patternDependencies);let Zt=Promise.resolve({});if(qt.length){const Ia=new AbortController;this.inFlightDependencies.push(Ia),Zt=ve.sendAsync({type:"GI",data:{icons:qt,source:this.source,tileID:this.tileID,type:"patterns"}},Ia)}const[lr,ta,da]=yield Promise.all([Mt,Bt,Zt]),wa=new r(lr),ma=new e.bo(ta,da);for(const Ia in Pe){const va=Pe[Ia];va instanceof e.a6?(a(va.layers,this.zoom,Oe),e.bp({bucket:va,glyphMap:lr,glyphPositions:wa.positions,imageMap:ta,imagePositions:ma.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):va.hasPattern&&(va instanceof e.bq||va instanceof e.br||va instanceof e.bs)&&(a(va.layers,this.zoom,Oe),va.addFeatures(We,this.tileID.canonical,ma.patternPositions))}return this.status="done",{buckets:Object.values(Pe).filter(Ia=>!Ia.isEmpty()),featureIndex:be,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:wa.image,imageAtlas:ma,glyphMap:this.returnDependencies?lr:null,iconMap:this.returnDependencies?ta:null,glyphPositions:this.returnDependencies?wa.positions:null}})}}function a(pt,ze,Ge){const Oe=new e.z(ze);for(const ve of pt)ve.recalculate(Oe,Ge)}class i{constructor(ze,Ge,Oe){this.actor=ze,this.layerIndex=Ge,this.availableImages=Oe,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(ze,Ge){return e._(this,void 0,void 0,function*(){const Oe=yield e.l(ze.request,Ge);try{return{vectorTile:new e.bt.VectorTile(new e.bu(Oe.data)),rawData:Oe.data,cacheControl:Oe.cacheControl,expires:Oe.expires}}catch(ve){const ge=new Uint8Array(Oe.data);let be=`Unable to parse the tile at ${ze.request.url}, `;throw be+=ge[0]===31&&ge[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${ve.message}`,new Error(be)}})}loadTile(ze){return e._(this,void 0,void 0,function*(){const Ge=ze.uid,Oe=!!(ze&&ze.request&&ze.request.collectResourceTiming)&&new e.bv(ze.request),ve=new o(ze);this.loading[Ge]=ve;const ge=new AbortController;ve.abort=ge;try{const be=yield this.loadVectorTile(ze,ge);if(delete this.loading[Ge],!be)return null;const Pe=be.rawData,We={};be.expires&&(We.expires=be.expires),be.cacheControl&&(We.cacheControl=be.cacheControl);const ct={};if(Oe){const Mt=Oe.finish();Mt&&(ct.resourceTiming=JSON.parse(JSON.stringify(Mt)))}ve.vectorTile=be.vectorTile;const _t=ve.parse(be.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[Ge]=ve,this.fetching[Ge]={rawTileData:Pe,cacheControl:We,resourceTiming:ct};try{const Mt=yield _t;return e.e({rawTileData:Pe.slice(0)},Mt,We,ct)}finally{delete this.fetching[Ge]}}catch(be){throw delete this.loading[Ge],ve.status="done",this.loaded[Ge]=ve,be}})}reloadTile(ze){return e._(this,void 0,void 0,function*(){const Ge=ze.uid;if(!this.loaded||!this.loaded[Ge])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const Oe=this.loaded[Ge];if(Oe.showCollisionBoxes=ze.showCollisionBoxes,Oe.status==="parsing"){const ve=yield Oe.parse(Oe.vectorTile,this.layerIndex,this.availableImages,this.actor);let ge;if(this.fetching[Ge]){const{rawTileData:be,cacheControl:Pe,resourceTiming:We}=this.fetching[Ge];delete this.fetching[Ge],ge=e.e({rawTileData:be.slice(0)},ve,Pe,We)}else ge=ve;return ge}if(Oe.status==="done"&&Oe.vectorTile)return Oe.parse(Oe.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(ze){return e._(this,void 0,void 0,function*(){const Ge=this.loading,Oe=ze.uid;Ge&&Ge[Oe]&&Ge[Oe].abort&&(Ge[Oe].abort.abort(),delete Ge[Oe])})}removeTile(ze){return e._(this,void 0,void 0,function*(){this.loaded&&this.loaded[ze.uid]&&delete this.loaded[ze.uid]})}}class n{constructor(){this.loaded={}}loadTile(ze){return e._(this,void 0,void 0,function*(){const{uid:Ge,encoding:Oe,rawImageData:ve,redFactor:ge,greenFactor:be,blueFactor:Pe,baseShift:We}=ze,ct=ve.width+2,_t=ve.height+2,Mt=e.b(ve)?new e.R({width:ct,height:_t},yield e.bw(ve,-1,-1,ct,_t)):ve,Nt=new e.bx(Ge,Mt,Oe,ge,be,Pe,We);return this.loaded=this.loaded||{},this.loaded[Ge]=Nt,Nt})}removeTile(ze){const Ge=this.loaded,Oe=ze.uid;Ge&&Ge[Oe]&&delete Ge[Oe]}}function s(pt,ze){if(pt.length!==0){c(pt[0],ze);for(var Ge=1;Ge=Math.abs(Pe)?Ge-We+Pe:Pe-We+Ge,Ge=We}Ge+Oe>=0!=!!ze&&pt.reverse()}var f=e.by(function pt(ze,Ge){var Oe,ve=ze&&ze.type;if(ve==="FeatureCollection")for(Oe=0;Oe>31}function P(pt,ze){for(var Ge=pt.loadGeometry(),Oe=pt.type,ve=0,ge=0,be=Ge.length,Pe=0;Pept},O=Math.fround||(L=new Float32Array(1),pt=>(L[0]=+pt,L[0]));var L;const N=3,U=5,Z=6;class Q{constructor(ze){this.options=Object.assign(Object.create(B),ze),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(ze){const{log:Ge,minZoom:Oe,maxZoom:ve}=this.options;Ge&&console.time("total time");const ge=`prepare ${ze.length} points`;Ge&&console.time(ge),this.points=ze;const be=[];for(let We=0;We=Oe;We--){const ct=+Date.now();Pe=this.trees[We]=this._createTree(this._cluster(Pe,We)),Ge&&console.log("z%d: %d clusters in %dms",We,Pe.numItems,+Date.now()-ct)}return Ge&&console.timeEnd("total time"),this}getClusters(ze,Ge){let Oe=((ze[0]+180)%360+360)%360-180;const ve=Math.max(-90,Math.min(90,ze[1]));let ge=ze[2]===180?180:((ze[2]+180)%360+360)%360-180;const be=Math.max(-90,Math.min(90,ze[3]));if(ze[2]-ze[0]>=360)Oe=-180,ge=180;else if(Oe>ge){const Mt=this.getClusters([Oe,ve,180,be],Ge),Nt=this.getClusters([-180,ve,ge,be],Ge);return Mt.concat(Nt)}const Pe=this.trees[this._limitZoom(Ge)],We=Pe.range(le(Oe),j(be),le(ge),j(ve)),ct=Pe.data,_t=[];for(const Mt of We){const Nt=this.stride*Mt;_t.push(ct[Nt+U]>1?ue(ct,Nt,this.clusterProps):this.points[ct[Nt+N]])}return _t}getChildren(ze){const Ge=this._getOriginId(ze),Oe=this._getOriginZoom(ze),ve="No cluster with the specified id.",ge=this.trees[Oe];if(!ge)throw new Error(ve);const be=ge.data;if(Ge*this.stride>=be.length)throw new Error(ve);const Pe=this.options.radius/(this.options.extent*Math.pow(2,Oe-1)),We=ge.within(be[Ge*this.stride],be[Ge*this.stride+1],Pe),ct=[];for(const _t of We){const Mt=_t*this.stride;be[Mt+4]===ze&&ct.push(be[Mt+U]>1?ue(be,Mt,this.clusterProps):this.points[be[Mt+N]])}if(ct.length===0)throw new Error(ve);return ct}getLeaves(ze,Ge,Oe){const ve=[];return this._appendLeaves(ve,ze,Ge=Ge||10,Oe=Oe||0,0),ve}getTile(ze,Ge,Oe){const ve=this.trees[this._limitZoom(ze)],ge=Math.pow(2,ze),{extent:be,radius:Pe}=this.options,We=Pe/be,ct=(Oe-We)/ge,_t=(Oe+1+We)/ge,Mt={features:[]};return this._addTileFeatures(ve.range((Ge-We)/ge,ct,(Ge+1+We)/ge,_t),ve.data,Ge,Oe,ge,Mt),Ge===0&&this._addTileFeatures(ve.range(1-We/ge,ct,1,_t),ve.data,ge,Oe,ge,Mt),Ge===ge-1&&this._addTileFeatures(ve.range(0,ct,We/ge,_t),ve.data,-1,Oe,ge,Mt),Mt.features.length?Mt:null}getClusterExpansionZoom(ze){let Ge=this._getOriginZoom(ze)-1;for(;Ge<=this.options.maxZoom;){const Oe=this.getChildren(ze);if(Ge++,Oe.length!==1)break;ze=Oe[0].properties.cluster_id}return Ge}_appendLeaves(ze,Ge,Oe,ve,ge){const be=this.getChildren(Ge);for(const Pe of be){const We=Pe.properties;if(We&&We.cluster?ge+We.point_count<=ve?ge+=We.point_count:ge=this._appendLeaves(ze,We.cluster_id,Oe,ve,ge):ge1;let _t,Mt,Nt;if(ct)_t=oe(Ge,We,this.clusterProps),Mt=Ge[We],Nt=Ge[We+1];else{const Zt=this.points[Ge[We+N]];_t=Zt.properties;const[lr,ta]=Zt.geometry.coordinates;Mt=le(lr),Nt=j(ta)}const Bt={type:1,geometry:[[Math.round(this.options.extent*(Mt*ge-Oe)),Math.round(this.options.extent*(Nt*ge-ve))]],tags:_t};let qt;qt=ct||this.options.generateId?Ge[We+N]:this.points[Ge[We+N]].id,qt!==void 0&&(Bt.id=qt),be.features.push(Bt)}}_limitZoom(ze){return Math.max(this.options.minZoom,Math.min(Math.floor(+ze),this.options.maxZoom+1))}_cluster(ze,Ge){const{radius:Oe,extent:ve,reduce:ge,minPoints:be}=this.options,Pe=Oe/(ve*Math.pow(2,Ge)),We=ze.data,ct=[],_t=this.stride;for(let Mt=0;MtGe&&(lr+=We[da+U])}if(lr>Zt&&lr>=be){let ta,da=Nt*Zt,wa=Bt*Zt,ma=-1;const Ia=((Mt/_t|0)<<5)+(Ge+1)+this.points.length;for(const va of qt){const La=va*_t;if(We[La+2]<=Ge)continue;We[La+2]=Ge;const Ka=We[La+U];da+=We[La]*Ka,wa+=We[La+1]*Ka,We[La+4]=Ia,ge&&(ta||(ta=this._map(We,Mt,!0),ma=this.clusterProps.length,this.clusterProps.push(ta)),ge(ta,this._map(We,La)))}We[Mt+4]=Ia,ct.push(da/lr,wa/lr,1/0,Ia,-1,lr),ge&&ct.push(ma)}else{for(let ta=0;ta<_t;ta++)ct.push(We[Mt+ta]);if(lr>1)for(const ta of qt){const da=ta*_t;if(!(We[da+2]<=Ge)){We[da+2]=Ge;for(let wa=0;wa<_t;wa++)ct.push(We[da+wa])}}}}return ct}_getOriginId(ze){return ze-this.points.length>>5}_getOriginZoom(ze){return(ze-this.points.length)%32}_map(ze,Ge,Oe){if(ze[Ge+U]>1){const be=this.clusterProps[ze[Ge+Z]];return Oe?Object.assign({},be):be}const ve=this.points[ze[Ge+N]].properties,ge=this.options.map(ve);return Oe&&ge===ve?Object.assign({},ge):ge}}function ue(pt,ze,Ge){return{type:"Feature",id:pt[ze+N],properties:oe(pt,ze,Ge),geometry:{type:"Point",coordinates:[(Oe=pt[ze],360*(Oe-.5)),J(pt[ze+1])]}};var Oe}function oe(pt,ze,Ge){const Oe=pt[ze+U],ve=Oe>=1e4?`${Math.round(Oe/1e3)}k`:Oe>=1e3?Math.round(Oe/100)/10+"k":Oe,ge=pt[ze+Z],be=ge===-1?{}:Object.assign({},Ge[ge]);return Object.assign(be,{cluster:!0,cluster_id:pt[ze+N],point_count:Oe,point_count_abbreviated:ve})}function le(pt){return pt/360+.5}function j(pt){const ze=Math.sin(pt*Math.PI/180),Ge=.5-.25*Math.log((1+ze)/(1-ze))/Math.PI;return Ge<0?0:Ge>1?1:Ge}function J(pt){const ze=(180-360*pt)*Math.PI/180;return 360*Math.atan(Math.exp(ze))/Math.PI-90}function $(pt,ze,Ge,Oe){let ve=Oe;const ge=ze+(Ge-ze>>1);let be,Pe=Ge-ze;const We=pt[ze],ct=pt[ze+1],_t=pt[Ge],Mt=pt[Ge+1];for(let Nt=ze+3;Ntve)be=Nt,ve=Bt;else if(Bt===ve){const qt=Math.abs(Nt-ge);qtOe&&(be-ze>3&&$(pt,ze,be,Oe),pt[be+2]=ve,Ge-be>3&&$(pt,be,Ge,Oe))}function X(pt,ze,Ge,Oe,ve,ge){let be=ve-Ge,Pe=ge-Oe;if(be!==0||Pe!==0){const We=((pt-Ge)*be+(ze-Oe)*Pe)/(be*be+Pe*Pe);We>1?(Ge=ve,Oe=ge):We>0&&(Ge+=be*We,Oe+=Pe*We)}return be=pt-Ge,Pe=ze-Oe,be*be+Pe*Pe}function re(pt,ze,Ge,Oe){const ve={id:pt??null,type:ze,geometry:Ge,tags:Oe,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(ze==="Point"||ze==="MultiPoint"||ze==="LineString")ee(ve,Ge);else if(ze==="Polygon")ee(ve,Ge[0]);else if(ze==="MultiLineString")for(const ge of Ge)ee(ve,ge);else if(ze==="MultiPolygon")for(const ge of Ge)ee(ve,ge[0]);return ve}function ee(pt,ze){for(let Ge=0;Ge0&&(be+=Oe?(ve*_t-ct*ge)/2:Math.sqrt(Math.pow(ct-ve,2)+Math.pow(_t-ge,2))),ve=ct,ge=_t}const Pe=ze.length-3;ze[2]=1,$(ze,0,Pe,Ge),ze[Pe+2]=1,ze.size=Math.abs(be),ze.start=0,ze.end=ze.size}function fe(pt,ze,Ge,Oe){for(let ve=0;ve1?1:Ge}function Fe(pt,ze,Ge,Oe,ve,ge,be,Pe){if(Oe/=ze,ge>=(Ge/=ze)&&be=Oe)return null;const We=[];for(const ct of pt){const _t=ct.geometry;let Mt=ct.type;const Nt=ve===0?ct.minX:ct.minY,Bt=ve===0?ct.maxX:ct.maxY;if(Nt>=Ge&&Bt=Oe)continue;let qt=[];if(Mt==="Point"||Mt==="MultiPoint")Ce(_t,qt,Ge,Oe,ve);else if(Mt==="LineString")qe(_t,qt,Ge,Oe,ve,!1,Pe.lineMetrics);else if(Mt==="MultiLineString")Qe(_t,qt,Ge,Oe,ve,!1);else if(Mt==="Polygon")Qe(_t,qt,Ge,Oe,ve,!0);else if(Mt==="MultiPolygon")for(const Zt of _t){const lr=[];Qe(Zt,lr,Ge,Oe,ve,!0),lr.length&&qt.push(lr)}if(qt.length){if(Pe.lineMetrics&&Mt==="LineString"){for(const Zt of qt)We.push(re(ct.id,Mt,Zt,ct.tags));continue}Mt!=="LineString"&&Mt!=="MultiLineString"||(qt.length===1?(Mt="LineString",qt=qt[0]):Mt="MultiLineString"),Mt!=="Point"&&Mt!=="MultiPoint"||(Mt=qt.length===3?"Point":"MultiPoint"),We.push(re(ct.id,Mt,qt,ct.tags))}}return We.length?We:null}function Ce(pt,ze,Ge,Oe,ve){for(let ge=0;ge=Ge&&be<=Oe&&Ke(ze,pt[ge],pt[ge+1],pt[ge+2])}}function qe(pt,ze,Ge,Oe,ve,ge,be){let Pe=et(pt);const We=ve===0?Xe:Me;let ct,_t,Mt=pt.start;for(let lr=0;lrGe&&(_t=We(Pe,ta,da,ma,Ia,Ge),be&&(Pe.start=Mt+ct*_t)):va>Oe?La=Ge&&(_t=We(Pe,ta,da,ma,Ia,Ge),Ka=!0),La>Oe&&va<=Oe&&(_t=We(Pe,ta,da,ma,Ia,Oe),Ka=!0),!ge&&Ka&&(be&&(Pe.end=Mt+ct*_t),ze.push(Pe),Pe=et(pt)),be&&(Mt+=ct)}let Nt=pt.length-3;const Bt=pt[Nt],qt=pt[Nt+1],Zt=ve===0?Bt:qt;Zt>=Ge&&Zt<=Oe&&Ke(Pe,Bt,qt,pt[Nt+2]),Nt=Pe.length-3,ge&&Nt>=3&&(Pe[Nt]!==Pe[0]||Pe[Nt+1]!==Pe[1])&&Ke(Pe,Pe[0],Pe[1],Pe[2]),Pe.length&&ze.push(Pe)}function et(pt){const ze=[];return ze.size=pt.size,ze.start=pt.start,ze.end=pt.end,ze}function Qe(pt,ze,Ge,Oe,ve,ge){for(const be of pt)qe(be,ze,Ge,Oe,ve,ge,!1)}function Ke(pt,ze,Ge,Oe){pt.push(ze,Ge,Oe)}function Xe(pt,ze,Ge,Oe,ve,ge){const be=(ge-ze)/(Oe-ze);return Ke(pt,ge,Ge+(ve-Ge)*be,1),be}function Me(pt,ze,Ge,Oe,ve,ge){const be=(ge-Ge)/(ve-Ge);return Ke(pt,ze+(Oe-ze)*be,ge,1),be}function xe(pt,ze){const Ge=[];for(let Oe=0;Oe0&&ze.size<(ve?be:Oe))return void(Ge.numPoints+=ze.length/3);const Pe=[];for(let We=0;Webe)&&(Ge.numSimplified++,Pe.push(ze[We],ze[We+1])),Ge.numPoints++;ve&&function(We,ct){let _t=0;for(let Mt=0,Nt=We.length,Bt=Nt-2;Mt0===ct)for(let Mt=0,Nt=We.length;Mt24)throw new Error("maxZoom should be in the 0-24 range");if(Ge.promoteId&&Ge.generateId)throw new Error("promoteId and generateId cannot be used together.");let ve=function(ge,be){const Pe=[];if(ge.type==="FeatureCollection")for(let We=0;We1&&console.time("creation"),Bt=this.tiles[Nt]=rt(ze,Ge,Oe,ve,ct),this.tileCoords.push({z:Ge,x:Oe,y:ve}),_t)){_t>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",Ge,Oe,ve,Bt.numFeatures,Bt.numPoints,Bt.numSimplified),console.timeEnd("creation"));const Ka=`z${Ge}`;this.stats[Ka]=(this.stats[Ka]||0)+1,this.total++}if(Bt.source=ze,ge==null){if(Ge===ct.indexMaxZoom||Bt.numPoints<=ct.indexMaxPoints)continue}else{if(Ge===ct.maxZoom||Ge===ge)continue;if(ge!=null){const Ka=ge-Ge;if(Oe!==be>>Ka||ve!==Pe>>Ka)continue}}if(Bt.source=null,ze.length===0)continue;_t>1&&console.time("clipping");const qt=.5*ct.buffer/ct.extent,Zt=.5-qt,lr=.5+qt,ta=1+qt;let da=null,wa=null,ma=null,Ia=null,va=Fe(ze,Mt,Oe-qt,Oe+lr,0,Bt.minX,Bt.maxX,ct),La=Fe(ze,Mt,Oe+Zt,Oe+ta,0,Bt.minX,Bt.maxX,ct);ze=null,va&&(da=Fe(va,Mt,ve-qt,ve+lr,1,Bt.minY,Bt.maxY,ct),wa=Fe(va,Mt,ve+Zt,ve+ta,1,Bt.minY,Bt.maxY,ct),va=null),La&&(ma=Fe(La,Mt,ve-qt,ve+lr,1,Bt.minY,Bt.maxY,ct),Ia=Fe(La,Mt,ve+Zt,ve+ta,1,Bt.minY,Bt.maxY,ct),La=null),_t>1&&console.timeEnd("clipping"),We.push(da||[],Ge+1,2*Oe,2*ve),We.push(wa||[],Ge+1,2*Oe,2*ve+1),We.push(ma||[],Ge+1,2*Oe+1,2*ve),We.push(Ia||[],Ge+1,2*Oe+1,2*ve+1)}}getTile(ze,Ge,Oe){ze=+ze,Ge=+Ge,Oe=+Oe;const ve=this.options,{extent:ge,debug:be}=ve;if(ze<0||ze>24)return null;const Pe=1<1&&console.log("drilling down to z%d-%d-%d",ze,Ge,Oe);let ct,_t=ze,Mt=Ge,Nt=Oe;for(;!ct&&_t>0;)_t--,Mt>>=1,Nt>>=1,ct=this.tiles[Ut(_t,Mt,Nt)];return ct&&ct.source?(be>1&&(console.log("found parent tile z%d-%d-%d",_t,Mt,Nt),console.time("drilling down")),this.splitTile(ct.source,_t,Mt,Nt,ze,Ge,Oe),be>1&&console.timeEnd("drilling down"),this.tiles[We]?Re(this.tiles[We],ge):null):null}}function Ut(pt,ze,Ge){return 32*((1<{Mt.properties=Bt;const qt={};for(const Zt of Nt)qt[Zt]=We[Zt].evaluate(_t,Mt);return qt},be.reduce=(Bt,qt)=>{Mt.properties=qt;for(const Zt of Nt)_t.accumulated=Bt[Zt],Bt[Zt]=ct[Zt].evaluate(_t,Mt)},be}(ze)).load((yield this._pendingData).features):(ve=yield this._pendingData,new Rt(ve,ze.geojsonVtOptions)),this.loaded={};const ge={};if(Oe){const be=Oe.finish();be&&(ge.resourceTiming={},ge.resourceTiming[ze.source]=JSON.parse(JSON.stringify(be)))}return ge}catch(ge){if(delete this._pendingRequest,e.bB(ge))return{abandoned:!0};throw ge}var ve})}getData(){return e._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(ze){const Ge=this.loaded;return Ge&&Ge[ze.uid]?super.reloadTile(ze):this.loadTile(ze)}loadAndProcessGeoJSON(ze,Ge){return e._(this,void 0,void 0,function*(){let Oe=yield this.loadGeoJSON(ze,Ge);if(delete this._pendingRequest,typeof Oe!="object")throw new Error(`Input data given to '${ze.source}' is not a valid GeoJSON object.`);if(f(Oe,!0),ze.filter){const ve=e.bC(ze.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ve.result==="error")throw new Error(ve.value.map(be=>`${be.key}: ${be.message}`).join(", "));Oe={type:"FeatureCollection",features:Oe.features.filter(be=>ve.value.evaluate({zoom:0},be))}}return Oe})}loadGeoJSON(ze,Ge){return e._(this,void 0,void 0,function*(){const{promoteId:Oe}=ze;if(ze.request){const ve=yield e.h(ze.request,Ge);return this._dataUpdateable=ar(ve.data,Oe)?Mr(ve.data,Oe):void 0,ve.data}if(typeof ze.data=="string")try{const ve=JSON.parse(ze.data);return this._dataUpdateable=ar(ve,Oe)?Mr(ve,Oe):void 0,ve}catch{throw new Error(`Input data given to '${ze.source}' is not a valid GeoJSON object.`)}if(!ze.dataDiff)throw new Error(`Input data given to '${ze.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${ze.source}`);return function(ve,ge,be){var Pe,We,ct,_t;if(ge.removeAll&&ve.clear(),ge.remove)for(const Mt of ge.remove)ve.delete(Mt);if(ge.add)for(const Mt of ge.add){const Nt=ir(Mt,be);Nt!=null&&ve.set(Nt,Mt)}if(ge.update)for(const Mt of ge.update){let Nt=ve.get(Mt.id);if(Nt==null)continue;const Bt=!Mt.removeAllProperties&&(((Pe=Mt.removeProperties)===null||Pe===void 0?void 0:Pe.length)>0||((We=Mt.addOrUpdateProperties)===null||We===void 0?void 0:We.length)>0);if((Mt.newGeometry||Mt.removeAllProperties||Bt)&&(Nt=Object.assign({},Nt),ve.set(Mt.id,Nt),Bt&&(Nt.properties=Object.assign({},Nt.properties))),Mt.newGeometry&&(Nt.geometry=Mt.newGeometry),Mt.removeAllProperties)Nt.properties={};else if(((ct=Mt.removeProperties)===null||ct===void 0?void 0:ct.length)>0)for(const qt of Mt.removeProperties)Object.prototype.hasOwnProperty.call(Nt.properties,qt)&&delete Nt.properties[qt];if(((_t=Mt.addOrUpdateProperties)===null||_t===void 0?void 0:_t.length)>0)for(const{key:qt,value:Zt}of Mt.addOrUpdateProperties)Nt.properties[qt]=Zt}}(this._dataUpdateable,ze.dataDiff,Oe),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(ze){return e._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(ze){return this._geoJSONIndex.getClusterExpansionZoom(ze.clusterId)}getClusterChildren(ze){return this._geoJSONIndex.getChildren(ze.clusterId)}getClusterLeaves(ze){return this._geoJSONIndex.getLeaves(ze.clusterId,ze.limit,ze.offset)}}class dr{constructor(ze){this.self=ze,this.actor=new e.F(ze),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(Ge,Oe)=>{if(this.externalWorkerSourceTypes[Ge])throw new Error(`Worker source with name "${Ge}" already registered.`);this.externalWorkerSourceTypes[Ge]=Oe},this.self.addProtocol=e.bi,this.self.removeProtocol=e.bj,this.self.registerRTLTextPlugin=Ge=>{if(e.bD.isParsed())throw new Error("RTL text plugin already registered.");e.bD.setMethods(Ge)},this.actor.registerMessageHandler("LDT",(Ge,Oe)=>this._getDEMWorkerSource(Ge,Oe.source).loadTile(Oe)),this.actor.registerMessageHandler("RDT",(Ge,Oe)=>e._(this,void 0,void 0,function*(){this._getDEMWorkerSource(Ge,Oe.source).removeTile(Oe)})),this.actor.registerMessageHandler("GCEZ",(Ge,Oe)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Ge,Oe.type,Oe.source).getClusterExpansionZoom(Oe)})),this.actor.registerMessageHandler("GCC",(Ge,Oe)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Ge,Oe.type,Oe.source).getClusterChildren(Oe)})),this.actor.registerMessageHandler("GCL",(Ge,Oe)=>e._(this,void 0,void 0,function*(){return this._getWorkerSource(Ge,Oe.type,Oe.source).getClusterLeaves(Oe)})),this.actor.registerMessageHandler("LD",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).loadData(Oe)),this.actor.registerMessageHandler("GD",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).getData()),this.actor.registerMessageHandler("LT",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).loadTile(Oe)),this.actor.registerMessageHandler("RT",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).reloadTile(Oe)),this.actor.registerMessageHandler("AT",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).abortTile(Oe)),this.actor.registerMessageHandler("RMT",(Ge,Oe)=>this._getWorkerSource(Ge,Oe.type,Oe.source).removeTile(Oe)),this.actor.registerMessageHandler("RS",(Ge,Oe)=>e._(this,void 0,void 0,function*(){if(!this.workerSources[Ge]||!this.workerSources[Ge][Oe.type]||!this.workerSources[Ge][Oe.type][Oe.source])return;const ve=this.workerSources[Ge][Oe.type][Oe.source];delete this.workerSources[Ge][Oe.type][Oe.source],ve.removeSource!==void 0&&ve.removeSource(Oe)})),this.actor.registerMessageHandler("RM",Ge=>e._(this,void 0,void 0,function*(){delete this.layerIndexes[Ge],delete this.availableImages[Ge],delete this.workerSources[Ge],delete this.demWorkerSources[Ge]})),this.actor.registerMessageHandler("SR",(Ge,Oe)=>e._(this,void 0,void 0,function*(){this.referrer=Oe})),this.actor.registerMessageHandler("SRPS",(Ge,Oe)=>this._syncRTLPluginState(Ge,Oe)),this.actor.registerMessageHandler("IS",(Ge,Oe)=>e._(this,void 0,void 0,function*(){this.self.importScripts(Oe)})),this.actor.registerMessageHandler("SI",(Ge,Oe)=>this._setImages(Ge,Oe)),this.actor.registerMessageHandler("UL",(Ge,Oe)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(Ge).update(Oe.layers,Oe.removedIds)})),this.actor.registerMessageHandler("SL",(Ge,Oe)=>e._(this,void 0,void 0,function*(){this._getLayerIndex(Ge).replace(Oe)}))}_setImages(ze,Ge){return e._(this,void 0,void 0,function*(){this.availableImages[ze]=Ge;for(const Oe in this.workerSources[ze]){const ve=this.workerSources[ze][Oe];for(const ge in ve)ve[ge].availableImages=Ge}})}_syncRTLPluginState(ze,Ge){return e._(this,void 0,void 0,function*(){if(e.bD.isParsed())return e.bD.getState();if(Ge.pluginStatus!=="loading")return e.bD.setState(Ge),Ge;const Oe=Ge.pluginURL;if(this.self.importScripts(Oe),e.bD.isParsed()){const ve={pluginStatus:"loaded",pluginURL:Oe};return e.bD.setState(ve),ve}throw e.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${Oe}`)})}_getAvailableImages(ze){let Ge=this.availableImages[ze];return Ge||(Ge=[]),Ge}_getLayerIndex(ze){let Ge=this.layerIndexes[ze];return Ge||(Ge=this.layerIndexes[ze]=new t),Ge}_getWorkerSource(ze,Ge,Oe){if(this.workerSources[ze]||(this.workerSources[ze]={}),this.workerSources[ze][Ge]||(this.workerSources[ze][Ge]={}),!this.workerSources[ze][Ge][Oe]){const ve={sendAsync:(ge,be)=>(ge.targetMapId=ze,this.actor.sendAsync(ge,be))};switch(Ge){case"vector":this.workerSources[ze][Ge][Oe]=new i(ve,this._getLayerIndex(ze),this._getAvailableImages(ze));break;case"geojson":this.workerSources[ze][Ge][Oe]=new fr(ve,this._getLayerIndex(ze),this._getAvailableImages(ze));break;default:this.workerSources[ze][Ge][Oe]=new this.externalWorkerSourceTypes[Ge](ve,this._getLayerIndex(ze),this._getAvailableImages(ze))}}return this.workerSources[ze][Ge][Oe]}_getDEMWorkerSource(ze,Ge){return this.demWorkerSources[ze]||(this.demWorkerSources[ze]={}),this.demWorkerSources[ze][Ge]||(this.demWorkerSources[ze][Ge]=new n),this.demWorkerSources[ze][Ge]}}return e.i(self)&&(self.worker=new dr(self)),dr}),A("index",["exports","./shared"],function(e,t){var r="4.7.1";let o,a;const i={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:De=>new Promise((I,ne)=>{const Te=requestAnimationFrame(I);De.signal.addEventListener("abort",()=>{cancelAnimationFrame(Te),ne(t.c())})}),getImageData(De,I=0){return this.getImageCanvasContext(De).getImageData(-I,-I,De.width+2*I,De.height+2*I)},getImageCanvasContext(De){const I=window.document.createElement("canvas"),ne=I.getContext("2d",{willReadFrequently:!0});if(!ne)throw new Error("failed to create canvas 2d context");return I.width=De.width,I.height=De.height,ne.drawImage(De,0,0,De.width,De.height),ne},resolveURL:De=>(o||(o=document.createElement("a")),o.href=De,o.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(a==null&&(a=matchMedia("(prefers-reduced-motion: reduce)")),a.matches)}};class n{static testProp(I){if(!n.docStyle)return I[0];for(let ne=0;ne{window.removeEventListener("click",n.suppressClickInternal,!0)},0)}static getScale(I){const ne=I.getBoundingClientRect();return{x:ne.width/I.offsetWidth||1,y:ne.height/I.offsetHeight||1,boundingClientRect:ne}}static getPoint(I,ne,Te){const Se=ne.boundingClientRect;return new t.P((Te.clientX-Se.left)/ne.x-I.clientLeft,(Te.clientY-Se.top)/ne.y-I.clientTop)}static mousePos(I,ne){const Te=n.getScale(I);return n.getPoint(I,Te,ne)}static touchPos(I,ne){const Te=[],Se=n.getScale(I);for(let Ie=0;Ie{c&&T(c),c=null,h=!0},f.onerror=()=>{v=!0,c=null},f.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(De){let I,ne,Te,Se;De.resetRequestQueue=()=>{I=[],ne=0,Te=0,Se={}},De.addThrottleControl=Ct=>{const Wt=Te++;return Se[Wt]=Ct,Wt},De.removeThrottleControl=Ct=>{delete Se[Ct],ot()},De.getImage=(Ct,Wt,nr=!0)=>new Promise((or,Fr)=>{s.supported&&(Ct.headers||(Ct.headers={}),Ct.headers.accept="image/webp,*/*"),t.e(Ct,{type:"image"}),I.push({abortController:Wt,requestParameters:Ct,supportImageRefresh:nr,state:"queued",onError:Wr=>{Fr(Wr)},onSuccess:Wr=>{or(Wr)}}),ot()});const Ie=Ct=>t._(this,void 0,void 0,function*(){Ct.state="running";const{requestParameters:Wt,supportImageRefresh:nr,onError:or,onSuccess:Fr,abortController:Wr}=Ct,je=nr===!1&&!t.i(self)&&!t.g(Wt.url)&&(!Wt.headers||Object.keys(Wt.headers).reduce((lt,Tt)=>lt&&Tt==="accept",!0));ne++;const Ze=je?yt(Wt,Wr):t.m(Wt,Wr);try{const lt=yield Ze;delete Ct.abortController,Ct.state="completed",lt.data instanceof HTMLImageElement||t.b(lt.data)?Fr(lt):lt.data&&Fr({data:yield(at=lt.data,typeof createImageBitmap=="function"?t.d(at):t.f(at)),cacheControl:lt.cacheControl,expires:lt.expires})}catch(lt){delete Ct.abortController,or(lt)}finally{ne--,ot()}var at}),ot=()=>{const Ct=(()=>{for(const Wt of Object.keys(Se))if(Se[Wt]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let Wt=ne;Wt0;Wt++){const nr=I.shift();nr.abortController.signal.aborted?Wt--:Ie(nr)}},yt=(Ct,Wt)=>new Promise((nr,or)=>{const Fr=new Image,Wr=Ct.url,je=Ct.credentials;je&&je==="include"?Fr.crossOrigin="use-credentials":(je&&je==="same-origin"||!t.s(Wr))&&(Fr.crossOrigin="anonymous"),Wt.signal.addEventListener("abort",()=>{Fr.src="",or(t.c())}),Fr.fetchPriority="high",Fr.onload=()=>{Fr.onerror=Fr.onload=null,nr({data:Fr})},Fr.onerror=()=>{Fr.onerror=Fr.onload=null,Wt.signal.aborted||or(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."))},Fr.src=Wr})}(l||(l={})),l.resetRequestQueue();class y{constructor(I){this._transformRequestFn=I}transformRequest(I,ne){return this._transformRequestFn&&this._transformRequestFn(I,ne)||{url:I}}setTransformRequest(I){this._transformRequestFn=I}}function b(De){var I=new t.A(3);return I[0]=De[0],I[1]=De[1],I[2]=De[2],I}var S,M=function(De,I,ne){return De[0]=I[0]-ne[0],De[1]=I[1]-ne[1],De[2]=I[2]-ne[2],De};S=new t.A(3),t.A!=Float32Array&&(S[0]=0,S[1]=0,S[2]=0);var _=function(De){var I=De[0],ne=De[1];return I*I+ne*ne};function w(De){const I=[];if(typeof De=="string")I.push({id:"default",url:De});else if(De&&De.length>0){const ne=[];for(const{id:Te,url:Se}of De){const Ie=`${Te}${Se}`;ne.indexOf(Ie)===-1&&(ne.push(Ie),I.push({id:Te,url:Se}))}}return I}function p(De,I,ne){const Te=De.split("?");return Te[0]+=`${I}${ne}`,Te.join("?")}(function(){var De=new t.A(2);t.A!=Float32Array&&(De[0]=0,De[1]=0)})();class u{constructor(I,ne,Te,Se){this.context=I,this.format=Te,this.texture=I.gl.createTexture(),this.update(ne,Se)}update(I,ne,Te){const{width:Se,height:Ie}=I,ot=!(this.size&&this.size[0]===Se&&this.size[1]===Ie||Te),{context:yt}=this,{gl:Ct}=yt;if(this.useMipmap=!!(ne&&ne.useMipmap),Ct.bindTexture(Ct.TEXTURE_2D,this.texture),yt.pixelStoreUnpackFlipY.set(!1),yt.pixelStoreUnpack.set(1),yt.pixelStoreUnpackPremultiplyAlpha.set(this.format===Ct.RGBA&&(!ne||ne.premultiply!==!1)),ot)this.size=[Se,Ie],I instanceof HTMLImageElement||I instanceof HTMLCanvasElement||I instanceof HTMLVideoElement||I instanceof ImageData||t.b(I)?Ct.texImage2D(Ct.TEXTURE_2D,0,this.format,this.format,Ct.UNSIGNED_BYTE,I):Ct.texImage2D(Ct.TEXTURE_2D,0,this.format,Se,Ie,0,this.format,Ct.UNSIGNED_BYTE,I.data);else{const{x:Wt,y:nr}=Te||{x:0,y:0};I instanceof HTMLImageElement||I instanceof HTMLCanvasElement||I instanceof HTMLVideoElement||I instanceof ImageData||t.b(I)?Ct.texSubImage2D(Ct.TEXTURE_2D,0,Wt,nr,Ct.RGBA,Ct.UNSIGNED_BYTE,I):Ct.texSubImage2D(Ct.TEXTURE_2D,0,Wt,nr,Se,Ie,Ct.RGBA,Ct.UNSIGNED_BYTE,I.data)}this.useMipmap&&this.isSizePowerOfTwo()&&Ct.generateMipmap(Ct.TEXTURE_2D)}bind(I,ne,Te){const{context:Se}=this,{gl:Ie}=Se;Ie.bindTexture(Ie.TEXTURE_2D,this.texture),Te!==Ie.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(Te=Ie.LINEAR),I!==this.filter&&(Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_MAG_FILTER,I),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_MIN_FILTER,Te||I),this.filter=I),ne!==this.wrap&&(Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_WRAP_S,ne),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_WRAP_T,ne),this.wrap=ne)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:I}=this.context;I.deleteTexture(this.texture),this.texture=null}}function g(De){const{userImage:I}=De;return!!(I&&I.render&&I.render())&&(De.data.replace(new Uint8Array(I.data.buffer)),!0)}class m extends t.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(I){if(this.loaded!==I&&(this.loaded=I,I)){for(const{ids:ne,promiseResolve:Te}of this.requestors)Te(this._getImagesForIds(ne));this.requestors=[]}}getImage(I){const ne=this.images[I];if(ne&&!ne.data&&ne.spriteData){const Te=ne.spriteData;ne.data=new t.R({width:Te.width,height:Te.height},Te.context.getImageData(Te.x,Te.y,Te.width,Te.height).data),ne.spriteData=null}return ne}addImage(I,ne){if(this.images[I])throw new Error(`Image id ${I} already exist, use updateImage instead`);this._validate(I,ne)&&(this.images[I]=ne)}_validate(I,ne){let Te=!0;const Se=ne.data||ne.spriteData;return this._validateStretch(ne.stretchX,Se&&Se.width)||(this.fire(new t.j(new Error(`Image "${I}" has invalid "stretchX" value`))),Te=!1),this._validateStretch(ne.stretchY,Se&&Se.height)||(this.fire(new t.j(new Error(`Image "${I}" has invalid "stretchY" value`))),Te=!1),this._validateContent(ne.content,ne)||(this.fire(new t.j(new Error(`Image "${I}" has invalid "content" value`))),Te=!1),Te}_validateStretch(I,ne){if(!I)return!0;let Te=0;for(const Se of I){if(Se[0]{let Se=!0;if(!this.isLoaded())for(const Ie of I)this.images[Ie]||(Se=!1);this.isLoaded()||Se?ne(this._getImagesForIds(I)):this.requestors.push({ids:I,promiseResolve:ne})})}_getImagesForIds(I){const ne={};for(const Te of I){let Se=this.getImage(Te);Se||(this.fire(new t.k("styleimagemissing",{id:Te})),Se=this.getImage(Te)),Se?ne[Te]={data:Se.data.clone(),pixelRatio:Se.pixelRatio,sdf:Se.sdf,version:Se.version,stretchX:Se.stretchX,stretchY:Se.stretchY,content:Se.content,textFitWidth:Se.textFitWidth,textFitHeight:Se.textFitHeight,hasRenderCallback:!!(Se.userImage&&Se.userImage.render)}:t.w(`Image "${Te}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return ne}getPixelSize(){const{width:I,height:ne}=this.atlasImage;return{width:I,height:ne}}getPattern(I){const ne=this.patterns[I],Te=this.getImage(I);if(!Te)return null;if(ne&&ne.position.version===Te.version)return ne.position;if(ne)ne.position.version=Te.version;else{const Se={w:Te.data.width+2,h:Te.data.height+2,x:0,y:0},Ie=new t.I(Se,Te);this.patterns[I]={bin:Se,position:Ie}}return this._updatePatternAtlas(),this.patterns[I].position}bind(I){const ne=I.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new u(I,this.atlasImage,ne.RGBA),this.atlasTexture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE)}_updatePatternAtlas(){const I=[];for(const Ie in this.patterns)I.push(this.patterns[Ie].bin);const{w:ne,h:Te}=t.p(I),Se=this.atlasImage;Se.resize({width:ne||1,height:Te||1});for(const Ie in this.patterns){const{bin:ot}=this.patterns[Ie],yt=ot.x+1,Ct=ot.y+1,Wt=this.getImage(Ie).data,nr=Wt.width,or=Wt.height;t.R.copy(Wt,Se,{x:0,y:0},{x:yt,y:Ct},{width:nr,height:or}),t.R.copy(Wt,Se,{x:0,y:or-1},{x:yt,y:Ct-1},{width:nr,height:1}),t.R.copy(Wt,Se,{x:0,y:0},{x:yt,y:Ct+or},{width:nr,height:1}),t.R.copy(Wt,Se,{x:nr-1,y:0},{x:yt-1,y:Ct},{width:1,height:or}),t.R.copy(Wt,Se,{x:0,y:0},{x:yt+nr,y:Ct},{width:1,height:or})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(I){for(const ne of I){if(this.callbackDispatchedThisFrame[ne])continue;this.callbackDispatchedThisFrame[ne]=!0;const Te=this.getImage(ne);Te||t.w(`Image with ID: "${ne}" was not found`),g(Te)&&this.updateImage(ne,Te)}}}const R=1e20;function P(De,I,ne,Te,Se,Ie,ot,yt,Ct){for(let Wt=I;Wt-1);Ct++,Ie[Ct]=yt,ot[Ct]=Wt,ot[Ct+1]=R}for(let yt=0,Ct=0;yt65535)throw new Error("glyphs > 65535 not supported");if(Te.ranges[Ie])return{stack:I,id:ne,glyph:Se};if(!this.url)throw new Error("glyphsUrl is not set");if(!Te.requests[Ie]){const yt=F.loadGlyphRange(I,Ie,this.url,this.requestManager);Te.requests[Ie]=yt}const ot=yield Te.requests[Ie];for(const yt in ot)this._doesCharSupportLocalGlyph(+yt)||(Te.glyphs[+yt]=ot[+yt]);return Te.ranges[Ie]=!0,{stack:I,id:ne,glyph:ot[ne]||null}})}_doesCharSupportLocalGlyph(I){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(I))}_tinySDF(I,ne,Te){const Se=this.localIdeographFontFamily;if(!Se||!this._doesCharSupportLocalGlyph(Te))return;let Ie=I.tinySDF;if(!Ie){let yt="400";/bold/i.test(ne)?yt="900":/medium/i.test(ne)?yt="500":/light/i.test(ne)&&(yt="200"),Ie=I.tinySDF=new F.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:Se,fontWeight:yt})}const ot=Ie.draw(String.fromCharCode(Te));return{id:Te,bitmap:new t.o({width:ot.width||60,height:ot.height||60},ot.data),metrics:{width:ot.glyphWidth/2||24,height:ot.glyphHeight/2||24,left:ot.glyphLeft/2+.5||0,top:ot.glyphTop/2-27.5||-8,advance:ot.glyphAdvance/2||24,isDoubleResolution:!0}}}}F.loadGlyphRange=function(De,I,ne,Te){return t._(this,void 0,void 0,function*(){const Se=256*I,Ie=Se+255,ot=Te.transformRequest(ne.replace("{fontstack}",De).replace("{range}",`${Se}-${Ie}`),"Glyphs"),yt=yield t.l(ot,new AbortController);if(!yt||!yt.data)throw new Error(`Could not load glyph range. range: ${I}, ${Se}-${Ie}`);const Ct={};for(const Wt of t.n(yt.data))Ct[Wt.id]=Wt;return Ct})},F.TinySDF=class{constructor({fontSize:De=24,buffer:I=3,radius:ne=8,cutoff:Te=.25,fontFamily:Se="sans-serif",fontWeight:Ie="normal",fontStyle:ot="normal"}={}){this.buffer=I,this.cutoff=Te,this.radius=ne;const yt=this.size=De+4*I,Ct=this._createCanvas(yt),Wt=this.ctx=Ct.getContext("2d",{willReadFrequently:!0});Wt.font=`${ot} ${Ie} ${De}px ${Se}`,Wt.textBaseline="alphabetic",Wt.textAlign="left",Wt.fillStyle="black",this.gridOuter=new Float64Array(yt*yt),this.gridInner=new Float64Array(yt*yt),this.f=new Float64Array(yt),this.z=new Float64Array(yt+1),this.v=new Uint16Array(yt)}_createCanvas(De){const I=document.createElement("canvas");return I.width=I.height=De,I}draw(De){const{width:I,actualBoundingBoxAscent:ne,actualBoundingBoxDescent:Te,actualBoundingBoxLeft:Se,actualBoundingBoxRight:Ie}=this.ctx.measureText(De),ot=Math.ceil(ne),yt=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(Ie-Se))),Ct=Math.min(this.size-this.buffer,ot+Math.ceil(Te)),Wt=yt+2*this.buffer,nr=Ct+2*this.buffer,or=Math.max(Wt*nr,0),Fr=new Uint8ClampedArray(or),Wr={data:Fr,width:Wt,height:nr,glyphWidth:yt,glyphHeight:Ct,glyphTop:ot,glyphLeft:0,glyphAdvance:I};if(yt===0||Ct===0)return Wr;const{ctx:je,buffer:Ze,gridInner:at,gridOuter:lt}=this;je.clearRect(Ze,Ze,yt,Ct),je.fillText(De,Ze,Ze+ot);const Tt=je.getImageData(Ze,Ze,yt,Ct);lt.fill(R,0,or),at.fill(0,0,or);for(let gt=0;gt0?sr*sr:0,at[rr]=sr<0?sr*sr:0}}P(lt,0,0,Wt,nr,Wt,this.f,this.v,this.z),P(at,Ze,Ze,yt,Ct,Wt,this.f,this.v,this.z);for(let gt=0;gt1&&(Ct=I[++yt]);const nr=Math.abs(Wt-Ct.left),or=Math.abs(Wt-Ct.right),Fr=Math.min(nr,or);let Wr;const je=Ie/Te*(Se+1);if(Ct.isDash){const Ze=Se-Math.abs(je);Wr=Math.sqrt(Fr*Fr+Ze*Ze)}else Wr=Se-Math.sqrt(Fr*Fr+je*je);this.data[ot+Wt]=Math.max(0,Math.min(255,Wr+128))}}}addRegularDash(I){for(let yt=I.length-1;yt>=0;--yt){const Ct=I[yt],Wt=I[yt+1];Ct.zeroLength?I.splice(yt,1):Wt&&Wt.isDash===Ct.isDash&&(Wt.left=Ct.left,I.splice(yt,1))}const ne=I[0],Te=I[I.length-1];ne.isDash===Te.isDash&&(ne.left=Te.left-this.width,Te.right=ne.right+this.width);const Se=this.width*this.nextRow;let Ie=0,ot=I[Ie];for(let yt=0;yt1&&(ot=I[++Ie]);const Ct=Math.abs(yt-ot.left),Wt=Math.abs(yt-ot.right),nr=Math.min(Ct,Wt);this.data[Se+yt]=Math.max(0,Math.min(255,(ot.isDash?nr:-nr)+128))}}addDash(I,ne){const Te=ne?7:0,Se=2*Te+1;if(this.nextRow+Se>this.height)return t.w("LineAtlas out of space"),null;let Ie=0;for(let yt=0;yt{ne.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[Q]}numActive(){return Object.keys(this.active).length}}const oe=Math.floor(i.hardwareConcurrency/2);let le,j;function J(){return le||(le=new ue),le}ue.workerCount=t.C(globalThis)?Math.max(Math.min(oe,3),1):1;class ${constructor(I,ne){this.workerPool=I,this.actors=[],this.currentActor=0,this.id=ne;const Te=this.workerPool.acquire(ne);for(let Se=0;Se{ne.remove()}),this.actors=[],I&&this.workerPool.release(this.id)}registerMessageHandler(I,ne){for(const Te of this.actors)Te.registerMessageHandler(I,ne)}}function X(){return j||(j=new $(J(),t.G),j.registerMessageHandler("GR",(De,I,ne)=>t.m(I,ne))),j}function re(De,I){const ne=t.H();return t.J(ne,ne,[1,1,0]),t.K(ne,ne,[.5*De.width,.5*De.height,1]),t.L(ne,ne,De.calculatePosMatrix(I.toUnwrapped()))}function ee(De,I,ne,Te,Se,Ie){const ot=function(or,Fr,Wr){if(or)for(const je of or){const Ze=Fr[je];if(Ze&&Ze.source===Wr&&Ze.type==="fill-extrusion")return!0}else for(const je in Fr){const Ze=Fr[je];if(Ze.source===Wr&&Ze.type==="fill-extrusion")return!0}return!1}(Se&&Se.layers,I,De.id),yt=Ie.maxPitchScaleFactor(),Ct=De.tilesIn(Te,yt,ot);Ct.sort(q);const Wt=[];for(const or of Ct)Wt.push({wrappedTileID:or.tileID.wrapped().key,queryResults:or.tile.queryRenderedFeatures(I,ne,De._state,or.queryGeometry,or.cameraQueryGeometry,or.scale,Se,Ie,yt,re(De.transform,or.tileID))});const nr=function(or){const Fr={},Wr={};for(const je of or){const Ze=je.queryResults,at=je.wrappedTileID,lt=Wr[at]=Wr[at]||{};for(const Tt in Ze){const gt=Ze[Tt],Et=lt[Tt]=lt[Tt]||{},Yt=Fr[Tt]=Fr[Tt]||[];for(const rr of gt)Et[rr.featureIndex]||(Et[rr.featureIndex]=!0,Yt.push(rr))}}return Fr}(Wt);for(const or in nr)nr[or].forEach(Fr=>{const Wr=Fr.feature,je=De.getFeatureState(Wr.layer["source-layer"],Wr.id);Wr.source=Wr.layer.source,Wr.layer["source-layer"]&&(Wr.sourceLayer=Wr.layer["source-layer"]),Wr.state=je});return nr}function q(De,I){const ne=De.tileID,Te=I.tileID;return ne.overscaledZ-Te.overscaledZ||ne.canonical.y-Te.canonical.y||ne.wrap-Te.wrap||ne.canonical.x-Te.canonical.x}function ae(De,I,ne){return t._(this,void 0,void 0,function*(){let Te=De;if(De.url?Te=(yield t.h(I.transformRequest(De.url,"Source"),ne)).data:yield i.frameAsync(ne),!Te)return null;const Se=t.M(t.e(Te,De),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in Te&&Te.vector_layers&&(Se.vectorLayerIds=Te.vector_layers.map(Ie=>Ie.id)),Se})}class ie{constructor(I,ne){I&&(ne?this.setSouthWest(I).setNorthEast(ne):Array.isArray(I)&&(I.length===4?this.setSouthWest([I[0],I[1]]).setNorthEast([I[2],I[3]]):this.setSouthWest(I[0]).setNorthEast(I[1])))}setNorthEast(I){return this._ne=I instanceof t.N?new t.N(I.lng,I.lat):t.N.convert(I),this}setSouthWest(I){return this._sw=I instanceof t.N?new t.N(I.lng,I.lat):t.N.convert(I),this}extend(I){const ne=this._sw,Te=this._ne;let Se,Ie;if(I instanceof t.N)Se=I,Ie=I;else{if(!(I instanceof ie))return Array.isArray(I)?I.length===4||I.every(Array.isArray)?this.extend(ie.convert(I)):this.extend(t.N.convert(I)):I&&("lng"in I||"lon"in I)&&"lat"in I?this.extend(t.N.convert(I)):this;if(Se=I._sw,Ie=I._ne,!Se||!Ie)return this}return ne||Te?(ne.lng=Math.min(Se.lng,ne.lng),ne.lat=Math.min(Se.lat,ne.lat),Te.lng=Math.max(Ie.lng,Te.lng),Te.lat=Math.max(Ie.lat,Te.lat)):(this._sw=new t.N(Se.lng,Se.lat),this._ne=new t.N(Ie.lng,Ie.lat)),this}getCenter(){return new t.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new t.N(this.getWest(),this.getNorth())}getSouthEast(){return new t.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(I){const{lng:ne,lat:Te}=t.N.convert(I);let Se=this._sw.lng<=ne&&ne<=this._ne.lng;return this._sw.lng>this._ne.lng&&(Se=this._sw.lng>=ne&&ne>=this._ne.lng),this._sw.lat<=Te&&Te<=this._ne.lat&&Se}static convert(I){return I instanceof ie?I:I&&new ie(I)}static fromLngLat(I,ne=0){const Te=360*ne/40075017,Se=Te/Math.cos(Math.PI/180*I.lat);return new ie(new t.N(I.lng-Se,I.lat-Te),new t.N(I.lng+Se,I.lat+Te))}adjustAntiMeridian(){const I=new t.N(this._sw.lng,this._sw.lat),ne=new t.N(this._ne.lng,this._ne.lat);return new ie(I,I.lng>ne.lng?new t.N(ne.lng+360,ne.lat):ne)}}class fe{constructor(I,ne,Te){this.bounds=ie.convert(this.validateBounds(I)),this.minzoom=ne||0,this.maxzoom=Te||24}validateBounds(I){return Array.isArray(I)&&I.length===4?[Math.max(-180,I[0]),Math.max(-90,I[1]),Math.min(180,I[2]),Math.min(90,I[3])]:[-180,-90,180,90]}contains(I){const ne=Math.pow(2,I.z),Te=Math.floor(t.O(this.bounds.getWest())*ne),Se=Math.floor(t.Q(this.bounds.getNorth())*ne),Ie=Math.ceil(t.O(this.bounds.getEast())*ne),ot=Math.ceil(t.Q(this.bounds.getSouth())*ne);return I.x>=Te&&I.x=Se&&I.y{this._options.tiles=I}),this}setUrl(I){return this.setSourceProperty(()=>{this.url=I,this._options.url=I}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return t.e({},this._options)}loadTile(I){return t._(this,void 0,void 0,function*(){const ne=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Te={request:this.map._requestManager.transformRequest(ne,"Tile"),uid:I.uid,tileID:I.tileID,zoom:I.tileID.overscaledZ,tileSize:this.tileSize*I.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};Te.request.collectResourceTiming=this._collectResourceTiming;let Se="RT";if(I.actor&&I.state!=="expired"){if(I.state==="loading")return new Promise((Ie,ot)=>{I.reloadPromise={resolve:Ie,reject:ot}})}else I.actor=this.dispatcher.getActor(),Se="LT";I.abortController=new AbortController;try{const Ie=yield I.actor.sendAsync({type:Se,data:Te},I.abortController);if(delete I.abortController,I.aborted)return;this._afterTileLoadWorkerResponse(I,Ie)}catch(Ie){if(delete I.abortController,I.aborted)return;if(Ie&&Ie.status!==404)throw Ie;this._afterTileLoadWorkerResponse(I,null)}})}_afterTileLoadWorkerResponse(I,ne){if(ne&&ne.resourceTiming&&(I.resourceTiming=ne.resourceTiming),ne&&this.map._refreshExpiredTiles&&I.setExpiryData(ne),I.loadVectorData(ne,this.map.painter),I.reloadPromise){const Te=I.reloadPromise;I.reloadPromise=null,this.loadTile(I).then(Te.resolve).catch(Te.reject)}}abortTile(I){return t._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController),I.actor&&(yield I.actor.sendAsync({type:"AT",data:{uid:I.uid,type:this.type,source:this.id}}))})}unloadTile(I){return t._(this,void 0,void 0,function*(){I.unloadVectorData(),I.actor&&(yield I.actor.sendAsync({type:"RMT",data:{uid:I.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Ae extends t.E{constructor(I,ne,Te,Se){super(),this.id=I,this.dispatcher=Te,this.setEventedParent(Se),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.e({type:"raster"},ne),t.e(this,t.M(ne,["url","scheme","tileSize"]))}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const I=yield ae(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,I&&(t.e(this,I),I.bounds&&(this.tileBounds=new fe(I.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})))}catch(I){this._tileJSONRequest=null,this.fire(new t.j(I))}})}loaded(){return this._loaded}onAdd(I){this.map=I,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(I){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),I(),this.load()}setTiles(I){return this.setSourceProperty(()=>{this._options.tiles=I}),this}setUrl(I){return this.setSourceProperty(()=>{this.url=I,this._options.url=I}),this}serialize(){return t.e({},this._options)}hasTile(I){return!this.tileBounds||this.tileBounds.contains(I.canonical)}loadTile(I){return t._(this,void 0,void 0,function*(){const ne=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);I.abortController=new AbortController;try{const Te=yield l.getImage(this.map._requestManager.transformRequest(ne,"Tile"),I.abortController,this.map._refreshExpiredTiles);if(delete I.abortController,I.aborted)return void(I.state="unloaded");if(Te&&Te.data){this.map._refreshExpiredTiles&&Te.cacheControl&&Te.expires&&I.setExpiryData({cacheControl:Te.cacheControl,expires:Te.expires});const Se=this.map.painter.context,Ie=Se.gl,ot=Te.data;I.texture=this.map.painter.getTileTexture(ot.width),I.texture?I.texture.update(ot,{useMipmap:!0}):(I.texture=new u(Se,ot,Ie.RGBA,{useMipmap:!0}),I.texture.bind(Ie.LINEAR,Ie.CLAMP_TO_EDGE,Ie.LINEAR_MIPMAP_NEAREST)),I.state="loaded"}}catch(Te){if(delete I.abortController,I.aborted)I.state="unloaded";else if(Te)throw I.state="errored",Te}})}abortTile(I){return t._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController)})}unloadTile(I){return t._(this,void 0,void 0,function*(){I.texture&&this.map.painter.saveTileTexture(I.texture)})}hasTransition(){return!1}}class Fe extends Ae{constructor(I,ne,Te,Se){super(I,ne,Te,Se),this.type="raster-dem",this.maxzoom=22,this._options=t.e({type:"raster-dem"},ne),this.encoding=ne.encoding||"mapbox",this.redFactor=ne.redFactor,this.greenFactor=ne.greenFactor,this.blueFactor=ne.blueFactor,this.baseShift=ne.baseShift}loadTile(I){return t._(this,void 0,void 0,function*(){const ne=I.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),Te=this.map._requestManager.transformRequest(ne,"Tile");I.neighboringTiles=this._getNeighboringTiles(I.tileID),I.abortController=new AbortController;try{const Se=yield l.getImage(Te,I.abortController,this.map._refreshExpiredTiles);if(delete I.abortController,I.aborted)return void(I.state="unloaded");if(Se&&Se.data){const Ie=Se.data;this.map._refreshExpiredTiles&&Se.cacheControl&&Se.expires&&I.setExpiryData({cacheControl:Se.cacheControl,expires:Se.expires});const ot=t.b(Ie)&&t.U()?Ie:yield this.readImageNow(Ie),yt={type:this.type,uid:I.uid,source:this.id,rawImageData:ot,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!I.actor||I.state==="expired"){I.actor=this.dispatcher.getActor();const Ct=yield I.actor.sendAsync({type:"LDT",data:yt});I.dem=Ct,I.needsHillshadePrepare=!0,I.needsTerrainPrepare=!0,I.state="loaded"}}}catch(Se){if(delete I.abortController,I.aborted)I.state="unloaded";else if(Se)throw I.state="errored",Se}})}readImageNow(I){return t._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&t.V()){const ne=I.width+2,Te=I.height+2;try{return new t.R({width:ne,height:Te},yield t.W(I,-1,-1,ne,Te))}catch{}}return i.getImageData(I,1)})}_getNeighboringTiles(I){const ne=I.canonical,Te=Math.pow(2,ne.z),Se=(ne.x-1+Te)%Te,Ie=ne.x===0?I.wrap-1:I.wrap,ot=(ne.x+1+Te)%Te,yt=ne.x+1===Te?I.wrap+1:I.wrap,Ct={};return Ct[new t.S(I.overscaledZ,Ie,ne.z,Se,ne.y).key]={backfilled:!1},Ct[new t.S(I.overscaledZ,yt,ne.z,ot,ne.y).key]={backfilled:!1},ne.y>0&&(Ct[new t.S(I.overscaledZ,Ie,ne.z,Se,ne.y-1).key]={backfilled:!1},Ct[new t.S(I.overscaledZ,I.wrap,ne.z,ne.x,ne.y-1).key]={backfilled:!1},Ct[new t.S(I.overscaledZ,yt,ne.z,ot,ne.y-1).key]={backfilled:!1}),ne.y+10&&t.e(Ie,{resourceTiming:Se}),this.fire(new t.k("data",Object.assign(Object.assign({},Ie),{sourceDataType:"metadata"}))),this.fire(new t.k("data",Object.assign(Object.assign({},Ie),{sourceDataType:"content"})))}catch(Te){if(this._pendingLoads--,this._removed)return void this.fire(new t.k("dataabort",{dataType:"source"}));this.fire(new t.j(Te))}})}loaded(){return this._pendingLoads===0}loadTile(I){return t._(this,void 0,void 0,function*(){const ne=I.actor?"RT":"LT";I.actor=this.actor;const Te={type:this.type,uid:I.uid,tileID:I.tileID,zoom:I.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};I.abortController=new AbortController;const Se=yield this.actor.sendAsync({type:ne,data:Te},I.abortController);delete I.abortController,I.unloadVectorData(),I.aborted||I.loadVectorData(Se,this.map.painter,ne==="RT")})}abortTile(I){return t._(this,void 0,void 0,function*(){I.abortController&&(I.abortController.abort(),delete I.abortController),I.aborted=!0})}unloadTile(I){return t._(this,void 0,void 0,function*(){I.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:I.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return t.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var qe=t.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class et extends t.E{constructor(I,ne,Te,Se){super(),this.id=I,this.dispatcher=Te,this.coordinates=ne.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(Se),this.options=ne}load(I){return t._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const ne=yield l.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,ne&&ne.data&&(this.image=ne.data,I&&(this.coordinates=I),this._finishLoading())}catch(ne){this._request=null,this._loaded=!0,this.fire(new t.j(ne))}})}loaded(){return this._loaded}updateImage(I){return I.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=I.url,this.load(I.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(I){this.map=I,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(I){this.coordinates=I;const ne=I.map(t.Z.fromLngLat);this.tileID=function(Se){let Ie=1/0,ot=1/0,yt=-1/0,Ct=-1/0;for(const Fr of Se)Ie=Math.min(Ie,Fr.x),ot=Math.min(ot,Fr.y),yt=Math.max(yt,Fr.x),Ct=Math.max(Ct,Fr.y);const Wt=Math.max(yt-Ie,Ct-ot),nr=Math.max(0,Math.floor(-Math.log(Wt)/Math.LN2)),or=Math.pow(2,nr);return new t.a1(nr,Math.floor((Ie+yt)/2*or),Math.floor((ot+Ct)/2*or))}(ne),this.minzoom=this.maxzoom=this.tileID.z;const Te=ne.map(Se=>this.tileID.getTilePoint(Se)._round());return this._boundsArray=new t.$,this._boundsArray.emplaceBack(Te[0].x,Te[0].y,0,0),this._boundsArray.emplaceBack(Te[1].x,Te[1].y,t.X,0),this._boundsArray.emplaceBack(Te[3].x,Te[3].y,0,t.X),this._boundsArray.emplaceBack(Te[2].x,Te[2].y,t.X,t.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const I=this.map.painter.context,ne=I.gl;this.boundsBuffer||(this.boundsBuffer=I.createVertexBuffer(this._boundsArray,qe.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new u(I,this.image,ne.RGBA),this.texture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE));let Te=!1;for(const Se in this.tiles){const Ie=this.tiles[Se];Ie.state!=="loaded"&&(Ie.state="loaded",Ie.texture=this.texture,Te=!0)}Te&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(I){return t._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(I.tileID.canonical)?(this.tiles[String(I.tileID.wrap)]=I,I.buckets={}):I.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Qe extends et{constructor(I,ne,Te,Se){super(I,ne,Te,Se),this.roundZoom=!0,this.type="video",this.options=ne}load(){return t._(this,void 0,void 0,function*(){this._loaded=!1;const I=this.options;this.urls=[];for(const ne of I.urls)this.urls.push(this.map._requestManager.transformRequest(ne,"Source").url);try{const ne=yield t.a3(this.urls);if(this._loaded=!0,!ne)return;this.video=ne,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(ne){this.fire(new t.j(ne))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(I){if(this.video){const ne=this.video.seekable;Ine.end(0)?this.fire(new t.j(new t.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${ne.start(0)} and ${ne.end(0)}-second mark.`))):this.video.currentTime=I}}getVideo(){return this.video}onAdd(I){this.map||(this.map=I,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const I=this.map.painter.context,ne=I.gl;this.boundsBuffer||(this.boundsBuffer=I.createVertexBuffer(this._boundsArray,qe.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE),ne.texSubImage2D(ne.TEXTURE_2D,0,0,0,ne.RGBA,ne.UNSIGNED_BYTE,this.video)):(this.texture=new u(I,this.video,ne.RGBA),this.texture.bind(ne.LINEAR,ne.CLAMP_TO_EDGE));let Te=!1;for(const Se in this.tiles){const Ie=this.tiles[Se];Ie.state!=="loaded"&&(Ie.state="loaded",Ie.texture=this.texture,Te=!0)}Te&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class Ke extends et{constructor(I,ne,Te,Se){super(I,ne,Te,Se),ne.coordinates?Array.isArray(ne.coordinates)&&ne.coordinates.length===4&&!ne.coordinates.some(Ie=>!Array.isArray(Ie)||Ie.length!==2||Ie.some(ot=>typeof ot!="number"))||this.fire(new t.j(new t.a2(`sources.${I}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.j(new t.a2(`sources.${I}`,null,'missing required property "coordinates"'))),ne.animate&&typeof ne.animate!="boolean"&&this.fire(new t.j(new t.a2(`sources.${I}`,null,'optional "animate" property must be a boolean value'))),ne.canvas?typeof ne.canvas=="string"||ne.canvas instanceof HTMLCanvasElement||this.fire(new t.j(new t.a2(`sources.${I}`,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 t.j(new t.a2(`sources.${I}`,null,'missing required property "canvas"'))),this.options=ne,this.animate=ne.animate===void 0||ne.animate}load(){return t._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.j(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())})}getCanvas(){return this.canvas}onAdd(I){this.map=I,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let I=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,I=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,I=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const ne=this.map.painter.context,Te=ne.gl;this.boundsBuffer||(this.boundsBuffer=ne.createVertexBuffer(this._boundsArray,qe.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?(I||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new u(ne,this.canvas,Te.RGBA,{premultiply:!0});let Se=!1;for(const Ie in this.tiles){const ot=this.tiles[Ie];ot.state!=="loaded"&&(ot.state="loaded",ot.texture=this.texture,Se=!0)}Se&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const I of[this.canvas.width,this.canvas.height])if(isNaN(I)||I<=0)return!0;return!1}}const Xe={},Me=De=>{switch(De){case"geojson":return Ce;case"image":return et;case"raster":return Ae;case"raster-dem":return Fe;case"vector":return we;case"video":return Qe;case"canvas":return Ke}return Xe[De]},xe="RTLPluginLoaded";class ce extends t.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=X()}_syncState(I){return this.status=I,this.dispatcher.broadcast("SRPS",{pluginStatus:I,pluginURL:this.url}).catch(ne=>{throw this.status="error",ne})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(I){return t._(this,arguments,void 0,function*(ne,Te=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=i.resolveURL(ne),!this.url)throw new Error(`requested url ${ne} is invalid`);if(this.status==="unavailable"){if(!Te)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return t._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new t.k(xe))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let Re=null;function $e(){return Re||(Re=new ce),Re}class rt{constructor(I,ne){this.timeAdded=0,this.fadeEndTime=0,this.tileID=I,this.uid=t.a4(),this.uses=0,this.tileSize=ne,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(I){const ne=I+this.timeAdded;neIe.getLayer(Wt)).filter(Boolean);if(Ct.length!==0){yt.layers=Ct,yt.stateDependentLayerIds&&(yt.stateDependentLayers=yt.stateDependentLayerIds.map(Wt=>Ct.filter(nr=>nr.id===Wt)[0]));for(const Wt of Ct)ot[Wt.id]=yt}}return ot}(I.buckets,ne.style),this.hasSymbolBuckets=!1;for(const Se in this.buckets){const Ie=this.buckets[Se];if(Ie instanceof t.a6){if(this.hasSymbolBuckets=!0,!Te)break;Ie.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const Se in this.buckets){const Ie=this.buckets[Se];if(Ie instanceof t.a6&&Ie.hasRTLText){this.hasRTLText=!0,$e().lazyLoad();break}}this.queryPadding=0;for(const Se in this.buckets){const Ie=this.buckets[Se];this.queryPadding=Math.max(this.queryPadding,ne.style.getLayer(Se).queryRadius(Ie))}I.imageAtlas&&(this.imageAtlas=I.imageAtlas),I.glyphAtlasImage&&(this.glyphAtlasImage=I.glyphAtlasImage)}else this.collisionBoxArray=new t.a5}unloadVectorData(){for(const I in this.buckets)this.buckets[I].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(I){return this.buckets[I.id]}upload(I){for(const Te in this.buckets){const Se=this.buckets[Te];Se.uploadPending()&&Se.upload(I)}const ne=I.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new u(I,this.imageAtlas.image,ne.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new u(I,this.glyphAtlasImage,ne.ALPHA),this.glyphAtlasImage=null)}prepare(I){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(I,this.imageAtlasTexture)}queryRenderedFeatures(I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:Se,cameraQueryGeometry:Ie,scale:ot,tileSize:this.tileSize,pixelPosMatrix:nr,transform:Ct,params:yt,queryPadding:this.queryPadding*Wt},I,ne,Te):{}}querySourceFeatures(I,ne){const Te=this.latestFeatureIndex;if(!Te||!Te.rawTileData)return;const Se=Te.loadVTLayers(),Ie=ne&&ne.sourceLayer?ne.sourceLayer:"",ot=Se._geojsonTileLayer||Se[Ie];if(!ot)return;const yt=t.a7(ne&&ne.filter),{z:Ct,x:Wt,y:nr}=this.tileID.canonical,or={z:Ct,x:Wt,y:nr};for(let Fr=0;FrTe)Se=!1;else if(ne)if(this.expirationTime{this.remove(I,Ie)},Te)),this.data[Se].push(Ie),this.order.push(Se),this.order.length>this.max){const ot=this._getAndRemoveByKey(this.order[0]);ot&&this.onRemove(ot)}return this}has(I){return I.wrapped().key in this.data}getAndRemove(I){return this.has(I)?this._getAndRemoveByKey(I.wrapped().key):null}_getAndRemoveByKey(I){const ne=this.data[I].shift();return ne.timeout&&clearTimeout(ne.timeout),this.data[I].length===0&&delete this.data[I],this.order.splice(this.order.indexOf(I),1),ne.value}getByKey(I){const ne=this.data[I];return ne?ne[0].value:null}get(I){return this.has(I)?this.data[I.wrapped().key][0].value:null}remove(I,ne){if(!this.has(I))return this;const Te=I.wrapped().key,Se=ne===void 0?0:this.data[Te].indexOf(ne),Ie=this.data[Te][Se];return this.data[Te].splice(Se,1),Ie.timeout&&clearTimeout(Ie.timeout),this.data[Te].length===0&&delete this.data[Te],this.onRemove(Ie.value),this.order.splice(this.order.indexOf(Te),1),this}setMaxSize(I){for(this.max=I;this.order.length>this.max;){const ne=this._getAndRemoveByKey(this.order[0]);ne&&this.onRemove(ne)}return this}filter(I){const ne=[];for(const Te in this.data)for(const Se of this.data[Te])I(Se.value)||ne.push(Se);for(const Te of ne)this.remove(Te.value.tileID,Te)}}class At{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(I,ne,Te){const Se=String(ne);if(this.stateChanges[I]=this.stateChanges[I]||{},this.stateChanges[I][Se]=this.stateChanges[I][Se]||{},t.e(this.stateChanges[I][Se],Te),this.deletedStates[I]===null){this.deletedStates[I]={};for(const Ie in this.state[I])Ie!==Se&&(this.deletedStates[I][Ie]=null)}else if(this.deletedStates[I]&&this.deletedStates[I][Se]===null){this.deletedStates[I][Se]={};for(const Ie in this.state[I][Se])Te[Ie]||(this.deletedStates[I][Se][Ie]=null)}else for(const Ie in Te)this.deletedStates[I]&&this.deletedStates[I][Se]&&this.deletedStates[I][Se][Ie]===null&&delete this.deletedStates[I][Se][Ie]}removeFeatureState(I,ne,Te){if(this.deletedStates[I]===null)return;const Se=String(ne);if(this.deletedStates[I]=this.deletedStates[I]||{},Te&&ne!==void 0)this.deletedStates[I][Se]!==null&&(this.deletedStates[I][Se]=this.deletedStates[I][Se]||{},this.deletedStates[I][Se][Te]=null);else if(ne!==void 0)if(this.stateChanges[I]&&this.stateChanges[I][Se])for(Te in this.deletedStates[I][Se]={},this.stateChanges[I][Se])this.deletedStates[I][Se][Te]=null;else this.deletedStates[I][Se]=null;else this.deletedStates[I]=null}getState(I,ne){const Te=String(ne),Se=t.e({},(this.state[I]||{})[Te],(this.stateChanges[I]||{})[Te]);if(this.deletedStates[I]===null)return{};if(this.deletedStates[I]){const Ie=this.deletedStates[I][ne];if(Ie===null)return{};for(const ot in Ie)delete Se[ot]}return Se}initializeTileState(I,ne){I.setFeatureState(this.state,ne)}coalesceChanges(I,ne){const Te={};for(const Se in this.stateChanges){this.state[Se]=this.state[Se]||{};const Ie={};for(const ot in this.stateChanges[Se])this.state[Se][ot]||(this.state[Se][ot]={}),t.e(this.state[Se][ot],this.stateChanges[Se][ot]),Ie[ot]=this.state[Se][ot];Te[Se]=Ie}for(const Se in this.deletedStates){this.state[Se]=this.state[Se]||{};const Ie={};if(this.deletedStates[Se]===null)for(const ot in this.state[Se])Ie[ot]={},this.state[Se][ot]={};else for(const ot in this.deletedStates[Se]){if(this.deletedStates[Se][ot]===null)this.state[Se][ot]={};else for(const yt of Object.keys(this.deletedStates[Se][ot]))delete this.state[Se][ot][yt];Ie[ot]=this.state[Se][ot]}Te[Se]=Te[Se]||{},t.e(Te[Se],Ie)}if(this.stateChanges={},this.deletedStates={},Object.keys(Te).length!==0)for(const Se in I)I[Se].setFeatureState(Te,ne)}}class St extends t.E{constructor(I,ne,Te){super(),this.id=I,this.dispatcher=Te,this.on("data",Se=>this._dataHandler(Se)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((Se,Ie,ot,yt)=>{const Ct=new(Me(Ie.type))(Se,Ie,ot,yt);if(Ct.id!==Se)throw new Error(`Expected Source id to be ${Se} instead of ${Ct.id}`);return Ct})(I,ne,Te,this),this._tiles={},this._cache=new Je(0,Se=>this._unloadTile(Se)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new At,this._didEmitContent=!1,this._updated=!1}onAdd(I){this.map=I,this._maxTileCacheSize=I?I._maxTileCacheSize:null,this._maxTileCacheZoomLevels=I?I._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(I)}onRemove(I){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(I)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const I in this._tiles){const ne=this._tiles[I];if(ne.state!=="loaded"&&ne.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const I=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,I&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(I,ne,Te){return t._(this,void 0,void 0,function*(){try{yield this._source.loadTile(I),this._tileLoaded(I,ne,Te)}catch(Se){I.state="errored",Se.status!==404?this._source.fire(new t.j(Se,{tile:I})):this.update(this.transform,this.terrain)}})}_unloadTile(I){this._source.unloadTile&&this._source.unloadTile(I)}_abortTile(I){this._source.abortTile&&this._source.abortTile(I),this._source.fire(new t.k("dataabort",{tile:I,coord:I.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(I){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const ne in this._tiles){const Te=this._tiles[ne];Te.upload(I),Te.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(I=>I.tileID).sort(Rt).map(I=>I.key)}getRenderableIds(I){const ne=[];for(const Te in this._tiles)this._isIdRenderable(Te,I)&&ne.push(this._tiles[Te]);return I?ne.sort((Te,Se)=>{const Ie=Te.tileID,ot=Se.tileID,yt=new t.P(Ie.canonical.x,Ie.canonical.y)._rotate(this.transform.angle),Ct=new t.P(ot.canonical.x,ot.canonical.y)._rotate(this.transform.angle);return Ie.overscaledZ-ot.overscaledZ||Ct.y-yt.y||Ct.x-yt.x}).map(Te=>Te.tileID.key):ne.map(Te=>Te.tileID).sort(Rt).map(Te=>Te.key)}hasRenderableParent(I){const ne=this.findLoadedParent(I,0);return!!ne&&this._isIdRenderable(ne.tileID.key)}_isIdRenderable(I,ne){return this._tiles[I]&&this._tiles[I].hasData()&&!this._coveredTiles[I]&&(ne||!this._tiles[I].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const I in this._tiles)this._tiles[I].state!=="errored"&&this._reloadTile(I,"reloading")}}_reloadTile(I,ne){return t._(this,void 0,void 0,function*(){const Te=this._tiles[I];Te&&(Te.state!=="loading"&&(Te.state=ne),yield this._loadTile(Te,I,ne))})}_tileLoaded(I,ne,Te){I.timeAdded=i.now(),Te==="expired"&&(I.refreshedUponExpiration=!0),this._setTileReloadTimer(ne,I),this.getSource().type==="raster-dem"&&I.dem&&this._backfillDEM(I),this._state.initializeTileState(I,this.map?this.map.painter:null),I.aborted||this._source.fire(new t.k("data",{dataType:"source",tile:I,coord:I.tileID}))}_backfillDEM(I){const ne=this.getRenderableIds();for(let Se=0;Se1||(Math.abs(ot)>1&&(Math.abs(ot+Ct)===1?ot+=Ct:Math.abs(ot-Ct)===1&&(ot-=Ct)),Ie.dem&&Se.dem&&(Se.dem.backfillBorder(Ie.dem,ot,yt),Se.neighboringTiles&&Se.neighboringTiles[Wt]&&(Se.neighboringTiles[Wt].backfilled=!0)))}}getTile(I){return this.getTileByID(I.key)}getTileByID(I){return this._tiles[I]}_retainLoadedChildren(I,ne,Te,Se){for(const Ie in this._tiles){let ot=this._tiles[Ie];if(Se[Ie]||!ot.hasData()||ot.tileID.overscaledZ<=ne||ot.tileID.overscaledZ>Te)continue;let yt=ot.tileID;for(;ot&&ot.tileID.overscaledZ>ne+1;){const Wt=ot.tileID.scaledTo(ot.tileID.overscaledZ-1);ot=this._tiles[Wt.key],ot&&ot.hasData()&&(yt=Wt)}let Ct=yt;for(;Ct.overscaledZ>ne;)if(Ct=Ct.scaledTo(Ct.overscaledZ-1),I[Ct.key]){Se[yt.key]=yt;break}}}findLoadedParent(I,ne){if(I.key in this._loadedParentTiles){const Te=this._loadedParentTiles[I.key];return Te&&Te.tileID.overscaledZ>=ne?Te:null}for(let Te=I.overscaledZ-1;Te>=ne;Te--){const Se=I.scaledTo(Te),Ie=this._getLoadedTile(Se);if(Ie)return Ie}}findLoadedSibling(I){return this._getLoadedTile(I)}_getLoadedTile(I){const ne=this._tiles[I.key];return ne&&ne.hasData()?ne:this._cache.getByKey(I.wrapped().key)}updateCacheSize(I){const ne=Math.ceil(I.width/this._source.tileSize)+1,Te=Math.ceil(I.height/this._source.tileSize)+1,Se=Math.floor(ne*Te*(this._maxTileCacheZoomLevels===null?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),Ie=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,Se):Se;this._cache.setMaxSize(Ie)}handleWrapJump(I){const ne=Math.round((I-(this._prevLng===void 0?I:this._prevLng))/360);if(this._prevLng=I,ne){const Te={};for(const Se in this._tiles){const Ie=this._tiles[Se];Ie.tileID=Ie.tileID.unwrapTo(Ie.tileID.wrap+ne),Te[Ie.tileID.key]=Ie}this._tiles=Te;for(const Se in this._timers)clearTimeout(this._timers[Se]),delete this._timers[Se];for(const Se in this._tiles)this._setTileReloadTimer(Se,this._tiles[Se])}}_updateCoveredAndRetainedTiles(I,ne,Te,Se,Ie,ot){const yt={},Ct={},Wt=Object.keys(I),nr=i.now();for(const or of Wt){const Fr=I[or],Wr=this._tiles[or];if(!Wr||Wr.fadeEndTime!==0&&Wr.fadeEndTime<=nr)continue;const je=this.findLoadedParent(Fr,ne),Ze=this.findLoadedSibling(Fr),at=je||Ze||null;at&&(this._addTile(at.tileID),yt[at.tileID.key]=at.tileID),Ct[or]=Fr}this._retainLoadedChildren(Ct,Se,Te,I);for(const or in yt)I[or]||(this._coveredTiles[or]=!0,I[or]=yt[or]);if(ot){const or={},Fr={};for(const Wr of Ie)this._tiles[Wr.key].hasData()?or[Wr.key]=Wr:Fr[Wr.key]=Wr;for(const Wr in Fr){const je=Fr[Wr].children(this._source.maxzoom);this._tiles[je[0].key]&&this._tiles[je[1].key]&&this._tiles[je[2].key]&&this._tiles[je[3].key]&&(or[je[0].key]=I[je[0].key]=je[0],or[je[1].key]=I[je[1].key]=je[1],or[je[2].key]=I[je[2].key]=je[2],or[je[3].key]=I[je[3].key]=je[3],delete Fr[Wr])}for(const Wr in Fr){const je=Fr[Wr],Ze=this.findLoadedParent(je,this._source.minzoom),at=this.findLoadedSibling(je),lt=Ze||at||null;if(lt){or[lt.tileID.key]=I[lt.tileID.key]=lt.tileID;for(const Tt in or)or[Tt].isChildOf(lt.tileID)&&delete or[Tt]}}for(const Wr in this._tiles)or[Wr]||(this._coveredTiles[Wr]=!0)}}update(I,ne){if(!this._sourceLoaded||this._paused)return;let Te;this.transform=I,this.terrain=ne,this.updateCacheSize(I),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?Te=I.getVisibleUnwrappedCoordinates(this._source.tileID).map(nr=>new t.S(nr.canonical.z,nr.wrap,nr.canonical.z,nr.canonical.x,nr.canonical.y)):(Te=I.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:ne}),this._source.hasTile&&(Te=Te.filter(nr=>this._source.hasTile(nr)))):Te=[];const Se=I.coveringZoomLevel(this._source),Ie=Math.max(Se-St.maxOverzooming,this._source.minzoom),ot=Math.max(Se+St.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const nr={};for(const or of Te)if(or.canonical.z>this._source.minzoom){const Fr=or.scaledTo(or.canonical.z-1);nr[Fr.key]=Fr;const Wr=or.scaledTo(Math.max(this._source.minzoom,Math.min(or.canonical.z,5)));nr[Wr.key]=Wr}Te=Te.concat(Object.values(nr))}const yt=Te.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,yt&&this.fire(new t.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const Ct=this._updateRetainedTiles(Te,Se);Ut(this._source.type)&&this._updateCoveredAndRetainedTiles(Ct,Ie,ot,Se,Te,ne);for(const nr in Ct)this._tiles[nr].clearFadeHold();const Wt=t.ab(this._tiles,Ct);for(const nr of Wt){const or=this._tiles[nr];or.hasSymbolBuckets&&!or.holdingForFade()?or.setHoldDuration(this.map._fadeDuration):or.hasSymbolBuckets&&!or.symbolFadeFinished()||this._removeTile(nr)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const I in this._tiles)this._tiles[I].holdingForFade()&&this._removeTile(I)}_updateRetainedTiles(I,ne){var Te;const Se={},Ie={},ot=Math.max(ne-St.maxOverzooming,this._source.minzoom),yt=Math.max(ne+St.maxUnderzooming,this._source.minzoom),Ct={};for(const Wt of I){const nr=this._addTile(Wt);Se[Wt.key]=Wt,nr.hasData()||nethis._source.maxzoom){const Fr=Wt.children(this._source.maxzoom)[0],Wr=this.getTile(Fr);if(Wr&&Wr.hasData()){Se[Fr.key]=Fr;continue}}else{const Fr=Wt.children(this._source.maxzoom);if(Se[Fr[0].key]&&Se[Fr[1].key]&&Se[Fr[2].key]&&Se[Fr[3].key])continue}let or=nr.wasRequested();for(let Fr=Wt.overscaledZ-1;Fr>=ot;--Fr){const Wr=Wt.scaledTo(Fr);if(Ie[Wr.key])break;if(Ie[Wr.key]=!0,nr=this.getTile(Wr),!nr&&or&&(nr=this._addTile(Wr)),nr){const je=nr.hasData();if((je||!(!((Te=this.map)===null||Te===void 0)&&Te.cancelPendingTileRequestsWhileZooming)||or)&&(Se[Wr.key]=Wr),or=nr.wasRequested(),je)break}}}return Se}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const I in this._tiles){const ne=[];let Te,Se=this._tiles[I].tileID;for(;Se.overscaledZ>0;){if(Se.key in this._loadedParentTiles){Te=this._loadedParentTiles[Se.key];break}ne.push(Se.key);const Ie=Se.scaledTo(Se.overscaledZ-1);if(Te=this._getLoadedTile(Ie),Te)break;Se=Ie}for(const Ie of ne)this._loadedParentTiles[Ie]=Te}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const I in this._tiles){const ne=this._tiles[I].tileID,Te=this._getLoadedTile(ne);this._loadedSiblingTiles[ne.key]=Te}}_addTile(I){let ne=this._tiles[I.key];if(ne)return ne;ne=this._cache.getAndRemove(I),ne&&(this._setTileReloadTimer(I.key,ne),ne.tileID=I,this._state.initializeTileState(ne,this.map?this.map.painter:null),this._cacheTimers[I.key]&&(clearTimeout(this._cacheTimers[I.key]),delete this._cacheTimers[I.key],this._setTileReloadTimer(I.key,ne)));const Te=ne;return ne||(ne=new rt(I,this._source.tileSize*I.overscaleFactor()),this._loadTile(ne,I.key,ne.state)),ne.uses++,this._tiles[I.key]=ne,Te||this._source.fire(new t.k("dataloading",{tile:ne,coord:ne.tileID,dataType:"source"})),ne}_setTileReloadTimer(I,ne){I in this._timers&&(clearTimeout(this._timers[I]),delete this._timers[I]);const Te=ne.getExpiryTimeout();Te&&(this._timers[I]=setTimeout(()=>{this._reloadTile(I,"expired"),delete this._timers[I]},Te))}_removeTile(I){const ne=this._tiles[I];ne&&(ne.uses--,delete this._tiles[I],this._timers[I]&&(clearTimeout(this._timers[I]),delete this._timers[I]),ne.uses>0||(ne.hasData()&&ne.state!=="reloading"?this._cache.add(ne.tileID,ne,ne.getExpiryTimeout()):(ne.aborted=!0,this._abortTile(ne),this._unloadTile(ne))))}_dataHandler(I){const ne=I.sourceDataType;I.dataType==="source"&&ne==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&I.dataType==="source"&&ne==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const I in this._tiles)this._removeTile(I);this._cache.reset()}tilesIn(I,ne,Te){const Se=[],Ie=this.transform;if(!Ie)return Se;const ot=Te?Ie.getCameraQueryGeometry(I):I,yt=I.map(je=>Ie.pointCoordinate(je,this.terrain)),Ct=ot.map(je=>Ie.pointCoordinate(je,this.terrain)),Wt=this.getIds();let nr=1/0,or=1/0,Fr=-1/0,Wr=-1/0;for(const je of Ct)nr=Math.min(nr,je.x),or=Math.min(or,je.y),Fr=Math.max(Fr,je.x),Wr=Math.max(Wr,je.y);for(let je=0;je=0&>[1].y+Tt>=0){const Et=yt.map(rr=>at.getTilePoint(rr)),Yt=Ct.map(rr=>at.getTilePoint(rr));Se.push({tile:Ze,tileID:at,queryGeometry:Et,cameraQueryGeometry:Yt,scale:lt})}}return Se}getVisibleCoordinates(I){const ne=this.getRenderableIds(I).map(Te=>this._tiles[Te].tileID);for(const Te of ne)Te.posMatrix=this.transform.calculatePosMatrix(Te.toUnwrapped());return ne}hasTransition(){if(this._source.hasTransition())return!0;if(Ut(this._source.type)){const I=i.now();for(const ne in this._tiles)if(this._tiles[ne].fadeEndTime>=I)return!0}return!1}setFeatureState(I,ne,Te){this._state.updateState(I=I||"_geojsonTileLayer",ne,Te)}removeFeatureState(I,ne,Te){this._state.removeFeatureState(I=I||"_geojsonTileLayer",ne,Te)}getFeatureState(I,ne){return this._state.getState(I=I||"_geojsonTileLayer",ne)}setDependencies(I,ne,Te){const Se=this._tiles[I];Se&&Se.setDependencies(ne,Te)}reloadTilesForDependencies(I,ne){for(const Te in this._tiles)this._tiles[Te].hasDependency(I,ne)&&this._reloadTile(Te,"reloading");this._cache.filter(Te=>!Te.hasDependency(I,ne))}}function Rt(De,I){const ne=Math.abs(2*De.wrap)-+(De.wrap<0),Te=Math.abs(2*I.wrap)-+(I.wrap<0);return De.overscaledZ-I.overscaledZ||Te-ne||I.canonical.y-De.canonical.y||I.canonical.x-De.canonical.x}function Ut(De){return De==="raster"||De==="image"||De==="video"}St.maxOverzooming=10,St.maxUnderzooming=3;class ir{constructor(I,ne){this.reset(I,ne)}reset(I,ne){this.points=I||[],this._distances=[0];for(let Te=1;Te0?(Se-ot)/yt:0;return this.points[Ie].mult(1-Ct).add(this.points[ne].mult(Ct))}}function ar(De,I){let ne=!0;return De==="always"||De!=="never"&&I!=="never"||(ne=!1),ne}class Mr{constructor(I,ne,Te){const Se=this.boxCells=[],Ie=this.circleCells=[];this.xCellCount=Math.ceil(I/Te),this.yCellCount=Math.ceil(ne/Te);for(let ot=0;otthis.width||Se<0||ne>this.height)return[];const Ct=[];if(I<=0&&ne<=0&&this.width<=Te&&this.height<=Se){if(Ie)return[{key:null,x1:I,y1:ne,x2:Te,y2:Se}];for(let Wt=0;Wt0}hitTestCircle(I,ne,Te,Se,Ie){const ot=I-Te,yt=I+Te,Ct=ne-Te,Wt=ne+Te;if(yt<0||ot>this.width||Wt<0||Ct>this.height)return!1;const nr=[];return this._forEachCell(ot,Ct,yt,Wt,this._queryCellCircle,nr,{hitTest:!0,overlapMode:Se,circle:{x:I,y:ne,radius:Te},seenUids:{box:{},circle:{}}},Ie),nr.length>0}_queryCell(I,ne,Te,Se,Ie,ot,yt,Ct){const{seenUids:Wt,hitTest:nr,overlapMode:or}=yt,Fr=this.boxCells[Ie];if(Fr!==null){const je=this.bboxes;for(const Ze of Fr)if(!Wt.box[Ze]){Wt.box[Ze]=!0;const at=4*Ze,lt=this.boxKeys[Ze];if(I<=je[at+2]&&ne<=je[at+3]&&Te>=je[at+0]&&Se>=je[at+1]&&(!Ct||Ct(lt))&&(!nr||!ar(or,lt.overlapMode))&&(ot.push({key:lt,x1:je[at],y1:je[at+1],x2:je[at+2],y2:je[at+3]}),nr))return!0}}const Wr=this.circleCells[Ie];if(Wr!==null){const je=this.circles;for(const Ze of Wr)if(!Wt.circle[Ze]){Wt.circle[Ze]=!0;const at=3*Ze,lt=this.circleKeys[Ze];if(this._circleAndRectCollide(je[at],je[at+1],je[at+2],I,ne,Te,Se)&&(!Ct||Ct(lt))&&(!nr||!ar(or,lt.overlapMode))){const Tt=je[at],gt=je[at+1],Et=je[at+2];if(ot.push({key:lt,x1:Tt-Et,y1:gt-Et,x2:Tt+Et,y2:gt+Et}),nr)return!0}}}return!1}_queryCellCircle(I,ne,Te,Se,Ie,ot,yt,Ct){const{circle:Wt,seenUids:nr,overlapMode:or}=yt,Fr=this.boxCells[Ie];if(Fr!==null){const je=this.bboxes;for(const Ze of Fr)if(!nr.box[Ze]){nr.box[Ze]=!0;const at=4*Ze,lt=this.boxKeys[Ze];if(this._circleAndRectCollide(Wt.x,Wt.y,Wt.radius,je[at+0],je[at+1],je[at+2],je[at+3])&&(!Ct||Ct(lt))&&!ar(or,lt.overlapMode))return ot.push(!0),!0}}const Wr=this.circleCells[Ie];if(Wr!==null){const je=this.circles;for(const Ze of Wr)if(!nr.circle[Ze]){nr.circle[Ze]=!0;const at=3*Ze,lt=this.circleKeys[Ze];if(this._circlesCollide(je[at],je[at+1],je[at+2],Wt.x,Wt.y,Wt.radius)&&(!Ct||Ct(lt))&&!ar(or,lt.overlapMode))return ot.push(!0),!0}}}_forEachCell(I,ne,Te,Se,Ie,ot,yt,Ct){const Wt=this._convertToXCellCoord(I),nr=this._convertToYCellCoord(ne),or=this._convertToXCellCoord(Te),Fr=this._convertToYCellCoord(Se);for(let Wr=Wt;Wr<=or;Wr++)for(let je=nr;je<=Fr;je++)if(Ie.call(this,I,ne,Te,Se,this.xCellCount*je+Wr,ot,yt,Ct))return}_convertToXCellCoord(I){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(I*this.xScale)))}_convertToYCellCoord(I){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(I*this.yScale)))}_circlesCollide(I,ne,Te,Se,Ie,ot){const yt=Se-I,Ct=Ie-ne,Wt=Te+ot;return Wt*Wt>yt*yt+Ct*Ct}_circleAndRectCollide(I,ne,Te,Se,Ie,ot,yt){const Ct=(ot-Se)/2,Wt=Math.abs(I-(Se+Ct));if(Wt>Ct+Te)return!1;const nr=(yt-Ie)/2,or=Math.abs(ne-(Ie+nr));if(or>nr+Te)return!1;if(Wt<=Ct||or<=nr)return!0;const Fr=Wt-Ct,Wr=or-nr;return Fr*Fr+Wr*Wr<=Te*Te}}function fr(De,I,ne,Te,Se){const Ie=t.H();return I?(t.K(Ie,Ie,[1/Se,1/Se,1]),ne||t.ad(Ie,Ie,Te.angle)):t.L(Ie,Te.labelPlaneMatrix,De),Ie}function dr(De,I,ne,Te,Se){if(I){const Ie=t.ae(De);return t.K(Ie,Ie,[Se,Se,1]),ne||t.ad(Ie,Ie,-Te.angle),Ie}return Te.glCoordMatrix}function pt(De,I,ne,Te){let Se;Te?(Se=[De,I,Te(De,I),1],t.af(Se,Se,ne)):(Se=[De,I,0,1],Zt(Se,Se,ne));const Ie=Se[3];return{point:new t.P(Se[0]/Ie,Se[1]/Ie),signedDistanceFromCamera:Ie,isOccluded:!1}}function ze(De,I){return .5+De/I*.5}function Ge(De,I){return De.x>=-I[0]&&De.x<=I[0]&&De.y>=-I[1]&&De.y<=I[1]}function Oe(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr,je){const Ze=Te?De.textSizeData:De.iconSizeData,at=t.ag(Ze,ne.transform.zoom),lt=[256/ne.width*2+1,256/ne.height*2+1],Tt=Te?De.text.dynamicLayoutVertexArray:De.icon.dynamicLayoutVertexArray;Tt.clear();const gt=De.lineVertexArray,Et=Te?De.text.placedSymbolArray:De.icon.placedSymbolArray,Yt=ne.transform.width/ne.transform.height;let rr=!1;for(let sr=0;srMath.abs(ne.x-I.x)*Te?{useVertical:!0}:(De===t.ah.vertical?I.yne.x)?{needsFlipping:!0}:null}function be(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr){const or=ne/24,Fr=I.lineOffsetX*or,Wr=I.lineOffsetY*or;let je;if(I.numGlyphs>1){const Ze=I.glyphStartIndex+I.numGlyphs,at=I.lineStartIndex,lt=I.lineStartIndex+I.lineLength,Tt=ve(or,yt,Fr,Wr,Te,I,nr,De);if(!Tt)return{notEnoughRoom:!0};const gt=pt(Tt.first.point.x,Tt.first.point.y,ot,De.getElevation).point,Et=pt(Tt.last.point.x,Tt.last.point.y,ot,De.getElevation).point;if(Se&&!Te){const Yt=ge(I.writingMode,gt,Et,Wt);if(Yt)return Yt}je=[Tt.first];for(let Yt=I.glyphStartIndex+1;Yt0?gt.point:function(rr,sr,Sr,Nr,Qr,ia){return Pe(rr,sr,Sr,1,Qr,ia)}(De.tileAnchorPoint,Tt,at,0,Ie,De),Yt=ge(I.writingMode,at,Et,Wt);if(Yt)return Yt}const Ze=Nt(or*yt.getoffsetX(I.glyphStartIndex),Fr,Wr,Te,I.segment,I.lineStartIndex,I.lineStartIndex+I.lineLength,De,nr);if(!Ze||De.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};je=[Ze]}for(const Ze of je)t.aj(Ct,Ze.point,Ze.angle);return{}}function Pe(De,I,ne,Te,Se,Ie){const ot=De.add(De.sub(I)._unit()),yt=Se!==void 0?pt(ot.x,ot.y,Se,Ie.getElevation).point:ct(ot.x,ot.y,Ie).point,Ct=ne.sub(yt);return ne.add(Ct._mult(Te/Ct.mag()))}function We(De,I,ne){const Te=I.projectionCache;if(Te.projections[De])return Te.projections[De];const Se=new t.P(I.lineVertexArray.getx(De),I.lineVertexArray.gety(De)),Ie=ct(Se.x,Se.y,I);if(Ie.signedDistanceFromCamera>0)return Te.projections[De]=Ie.point,Te.anyProjectionOccluded=Te.anyProjectionOccluded||Ie.isOccluded,Ie.point;const ot=De-ne.direction;return function(yt,Ct,Wt,nr,or){return Pe(yt,Ct,Wt,nr,void 0,or)}(ne.distanceFromAnchor===0?I.tileAnchorPoint:new t.P(I.lineVertexArray.getx(ot),I.lineVertexArray.gety(ot)),Se,ne.previousVertex,ne.absOffsetX-ne.distanceFromAnchor+1,I)}function ct(De,I,ne){const Te=De+ne.translation[0],Se=I+ne.translation[1];let Ie;return!ne.pitchWithMap&&ne.projection.useSpecialProjectionForSymbols?(Ie=ne.projection.projectTileCoordinates(Te,Se,ne.unwrappedTileID,ne.getElevation),Ie.point.x=(.5*Ie.point.x+.5)*ne.width,Ie.point.y=(.5*-Ie.point.y+.5)*ne.height):(Ie=pt(Te,Se,ne.labelPlaneMatrix,ne.getElevation),Ie.isOccluded=!1),Ie}function _t(De,I,ne){return De._unit()._perp()._mult(I*ne)}function Mt(De,I,ne,Te,Se,Ie,ot,yt,Ct){if(yt.projectionCache.offsets[De])return yt.projectionCache.offsets[De];const Wt=ne.add(I);if(De+Ct.direction=Se)return yt.projectionCache.offsets[De]=Wt,Wt;const nr=We(De+Ct.direction,yt,Ct),or=_t(nr.sub(ne),ot,Ct.direction),Fr=ne.add(or),Wr=nr.add(or);return yt.projectionCache.offsets[De]=t.ak(Ie,Wt,Fr,Wr)||Wt,yt.projectionCache.offsets[De]}function Nt(De,I,ne,Te,Se,Ie,ot,yt,Ct){const Wt=Te?De-I:De+I;let nr=Wt>0?1:-1,or=0;Te&&(nr*=-1,or=Math.PI),nr<0&&(or+=Math.PI);let Fr,Wr=nr>0?Ie+Se:Ie+Se+1;yt.projectionCache.cachedAnchorPoint?Fr=yt.projectionCache.cachedAnchorPoint:(Fr=ct(yt.tileAnchorPoint.x,yt.tileAnchorPoint.y,yt).point,yt.projectionCache.cachedAnchorPoint=Fr);let je,Ze,at=Fr,lt=Fr,Tt=0,gt=0;const Et=Math.abs(Wt),Yt=[];let rr;for(;Tt+gt<=Et;){if(Wr+=nr,Wr=ot)return null;Tt+=gt,lt=at,Ze=je;const Nr={absOffsetX:Et,direction:nr,distanceFromAnchor:Tt,previousVertex:lt};if(at=We(Wr,yt,Nr),ne===0)Yt.push(lt),rr=at.sub(lt);else{let Qr;const ia=at.sub(lt);Qr=ia.mag()===0?_t(We(Wr+nr,yt,Nr).sub(at),ne,nr):_t(ia,ne,nr),Ze||(Ze=lt.add(Qr)),je=Mt(Wr,Qr,at,Ie,ot,Ze,ne,yt,Nr),Yt.push(Ze),rr=je.sub(Ze)}gt=rr.mag()}const sr=rr._mult((Et-Tt)/gt)._add(Ze||lt),Sr=or+Math.atan2(at.y-lt.y,at.x-lt.x);return Yt.push(sr),{point:sr,angle:Ct?Sr:0,path:Yt}}const Bt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function qt(De,I){for(let ne=0;ne=1;ii--)ln.push(nn.path[ii]);for(let ii=1;iiGi.signedDistanceFromCamera<=0)?[]:ii.map(Gi=>Gi.point)}let pi=[];if(ln.length>0){const ii=ln[0].clone(),Gi=ln[0].clone();for(let Bo=1;Bo=ia.x&&Gi.x<=_a.x&&ii.y>=ia.y&&Gi.y<=_a.y?[ln]:Gi.x_a.x||Gi.y_a.y?[]:t.al([ln],ia.x,ia.y,_a.x,_a.y)}for(const ii of pi){za.reset(ii,.25*Qr);let Gi=0;Gi=za.length<=.5*Qr?1:Math.ceil(za.paddedLength/Nn)+1;for(let Bo=0;Bopt(Se.x,Se.y,Te,ne.getElevation))}queryRenderedSymbols(I){if(I.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const ne=[];let Te=1/0,Se=1/0,Ie=-1/0,ot=-1/0;for(const nr of I){const or=new t.P(nr.x+lr,nr.y+lr);Te=Math.min(Te,or.x),Se=Math.min(Se,or.y),Ie=Math.max(Ie,or.x),ot=Math.max(ot,or.y),ne.push(or)}const yt=this.grid.query(Te,Se,Ie,ot).concat(this.ignoredGrid.query(Te,Se,Ie,ot)),Ct={},Wt={};for(const nr of yt){const or=nr.key;if(Ct[or.bucketInstanceId]===void 0&&(Ct[or.bucketInstanceId]={}),Ct[or.bucketInstanceId][or.featureIndex])continue;const Fr=[new t.P(nr.x1,nr.y1),new t.P(nr.x2,nr.y1),new t.P(nr.x2,nr.y2),new t.P(nr.x1,nr.y2)];t.am(ne,Fr)&&(Ct[or.bucketInstanceId][or.featureIndex]=!0,Wt[or.bucketInstanceId]===void 0&&(Wt[or.bucketInstanceId]=[]),Wt[or.bucketInstanceId].push(or.featureIndex))}return Wt}insertCollisionBox(I,ne,Te,Se,Ie,ot){(Te?this.ignoredGrid:this.grid).insert({bucketInstanceId:Se,featureIndex:Ie,collisionGroupID:ot,overlapMode:ne},I[0],I[1],I[2],I[3])}insertCollisionCircles(I,ne,Te,Se,Ie,ot){const yt=Te?this.ignoredGrid:this.grid,Ct={bucketInstanceId:Se,featureIndex:Ie,collisionGroupID:ot,overlapMode:ne};for(let Wt=0;Wt=this.screenRightBoundary||Sethis.screenBottomBoundary}isInsideGrid(I,ne,Te,Se){return Te>=0&&I=0&&nethis.projectAndGetPerspectiveRatio(Te,Qr.x,Qr.y,Se,Wt));Sr=Nr.some(Qr=>!Qr.isOccluded),sr=Nr.map(Qr=>Qr.point)}else Sr=!0;return{box:t.ao(sr),allPointsOccluded:!Sr}}}function da(De,I,ne){return I*(t.X/(De.tileSize*Math.pow(2,ne-De.tileID.overscaledZ)))}class wa{constructor(I,ne,Te,Se){this.opacity=I?Math.max(0,Math.min(1,I.opacity+(I.placed?ne:-ne))):Se&&Te?1:0,this.placed=Te}isHidden(){return this.opacity===0&&!this.placed}}class ma{constructor(I,ne,Te,Se,Ie){this.text=new wa(I?I.text:null,ne,Te,Ie),this.icon=new wa(I?I.icon:null,ne,Se,Ie)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ia{constructor(I,ne,Te){this.text=I,this.icon=ne,this.skipFade=Te}}class va{constructor(){this.invProjMatrix=t.H(),this.viewportMatrix=t.H(),this.circles=[]}}class La{constructor(I,ne,Te,Se,Ie){this.bucketInstanceId=I,this.featureIndex=ne,this.sourceLayerIndex=Te,this.bucketIndex=Se,this.tileID=Ie}}class Ka{constructor(I){this.crossSourceCollisions=I,this.maxGroupID=0,this.collisionGroups={}}get(I){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[I]){const ne=++this.maxGroupID;this.collisionGroups[I]={ID:ne,predicate:Te=>Te.collisionGroupID===ne}}return this.collisionGroups[I]}}function Vt(De,I,ne,Te,Se){const{horizontalAlign:Ie,verticalAlign:ot}=t.au(De);return new t.P(-(Ie-.5)*I+Te[0]*Se,-(ot-.5)*ne+Te[1]*Se)}class Lt{constructor(I,ne,Te,Se,Ie,ot){this.transform=I.clone(),this.terrain=Te,this.collisionIndex=new ta(this.transform,ne),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=Se,this.retainedQueryData={},this.collisionGroups=new Ka(Ie),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=ot,ot&&(ot.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(I){const ne=this.terrain;return ne?(Te,Se)=>ne.getElevation(I,Te,Se):null}getBucketParts(I,ne,Te,Se){const Ie=Te.getBucket(ne),ot=Te.latestFeatureIndex;if(!Ie||!ot||ne.id!==Ie.layerIds[0])return;const yt=Te.collisionBoxArray,Ct=Ie.layers[0].layout,Wt=Ie.layers[0].paint,nr=Math.pow(2,this.transform.zoom-Te.tileID.overscaledZ),or=Te.tileSize/t.X,Fr=Te.tileID.toUnwrapped(),Wr=this.transform.calculatePosMatrix(Fr),je=Ct.get("text-pitch-alignment")==="map",Ze=Ct.get("text-rotation-alignment")==="map",at=da(Te,1,this.transform.zoom),lt=this.collisionIndex.mapProjection.translatePosition(this.transform,Te,Wt.get("text-translate"),Wt.get("text-translate-anchor")),Tt=this.collisionIndex.mapProjection.translatePosition(this.transform,Te,Wt.get("icon-translate"),Wt.get("icon-translate-anchor")),gt=fr(Wr,je,Ze,this.transform,at);let Et=null;if(je){const rr=dr(Wr,je,Ze,this.transform,at);Et=t.L([],this.transform.labelPlaneMatrix,rr)}this.retainedQueryData[Ie.bucketInstanceId]=new La(Ie.bucketInstanceId,ot,Ie.sourceLayerIndex,Ie.index,Te.tileID);const Yt={bucket:Ie,layout:Ct,translationText:lt,translationIcon:Tt,posMatrix:Wr,unwrappedTileID:Fr,textLabelPlaneMatrix:gt,labelToScreenMatrix:Et,scale:nr,textPixelRatio:or,holdingForFade:Te.holdingForFade(),collisionBoxArray:yt,partiallyEvaluatedTextSize:t.ag(Ie.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(Ie.sourceID)};if(Se)for(const rr of Ie.sortKeyRanges){const{sortKey:sr,symbolInstanceStart:Sr,symbolInstanceEnd:Nr}=rr;I.push({sortKey:sr,symbolInstanceStart:Sr,symbolInstanceEnd:Nr,parameters:Yt})}else I.push({symbolInstanceStart:0,symbolInstanceEnd:Ie.symbolInstances.length,parameters:Yt})}attemptAnchorPlacement(I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr,je,Ze,at,lt,Tt,gt){const Et=t.aq[I.textAnchor],Yt=[I.textOffset0,I.textOffset1],rr=Vt(Et,Te,Se,Yt,Ie),sr=this.collisionIndex.placeCollisionBox(ne,Fr,Ct,Wt,nr,yt,ot,at,or.predicate,gt,rr);if((!Tt||this.collisionIndex.placeCollisionBox(Tt,Fr,Ct,Wt,nr,yt,ot,lt,or.predicate,gt,rr).placeable)&&sr.placeable){let Sr;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Wr.crossTileID]&&this.prevPlacement.placements[Wr.crossTileID]&&this.prevPlacement.placements[Wr.crossTileID].text&&(Sr=this.prevPlacement.variableOffsets[Wr.crossTileID].anchor),Wr.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Wr.crossTileID]={textOffset:Yt,width:Te,height:Se,anchor:Et,textBoxScale:Ie,prevAnchor:Sr},this.markUsedJustification(je,Et,Wr,Ze),je.allowVerticalPlacement&&(this.markUsedOrientation(je,Ze,Wr),this.placedOrientations[Wr.crossTileID]=Ze),{shift:rr,placedGlyphBoxes:sr}}}placeLayerBucketPart(I,ne,Te){const{bucket:Se,layout:Ie,translationText:ot,translationIcon:yt,posMatrix:Ct,unwrappedTileID:Wt,textLabelPlaneMatrix:nr,labelToScreenMatrix:or,textPixelRatio:Fr,holdingForFade:Wr,collisionBoxArray:je,partiallyEvaluatedTextSize:Ze,collisionGroup:at}=I.parameters,lt=Ie.get("text-optional"),Tt=Ie.get("icon-optional"),gt=t.ar(Ie,"text-overlap","text-allow-overlap"),Et=gt==="always",Yt=t.ar(Ie,"icon-overlap","icon-allow-overlap"),rr=Yt==="always",sr=Ie.get("text-rotation-alignment")==="map",Sr=Ie.get("text-pitch-alignment")==="map",Nr=Ie.get("icon-text-fit")!=="none",Qr=Ie.get("symbol-z-order")==="viewport-y",ia=Et&&(rr||!Se.hasIconData()||Tt),_a=rr&&(Et||!Se.hasTextData()||lt);!Se.collisionArrays&&je&&Se.deserializeCollisionBoxes(je);const za=this._getTerrainElevationFunc(this.retainedQueryData[Se.bucketInstanceId].tileID),nn=(en,ln,Nn)=>{var pi,ii;if(ne[en.crossTileID])return;if(Wr)return void(this.placements[en.crossTileID]=new Ia(!1,!1,!1));let Gi=!1,Bo=!1,No=!0,po=null,Zo={box:null,placeable:!1,offscreen:null},Hs={box:null,placeable:!1,offscreen:null},zs=null,xo=null,bo=null,vl=0,Al=0,pu=0;ln.textFeatureIndex?vl=ln.textFeatureIndex:en.useRuntimeCollisionCircles&&(vl=en.featureIndex),ln.verticalTextFeatureIndex&&(Al=ln.verticalTextFeatureIndex);const pe=ln.textBox;if(pe){const ht=$t=>{let Cr=t.ah.horizontal;if(Se.allowVerticalPlacement&&!$t&&this.prevPlacement){const Ar=this.prevPlacement.placedOrientations[en.crossTileID];Ar&&(this.placedOrientations[en.crossTileID]=Ar,Cr=Ar,this.markUsedOrientation(Se,Cr,en))}return Cr},xt=($t,Cr)=>{if(Se.allowVerticalPlacement&&en.numVerticalGlyphVertices>0&&ln.verticalTextBox){for(const Ar of Se.writingModes)if(Ar===t.ah.vertical?(Zo=Cr(),Hs=Zo):Zo=$t(),Zo&&Zo.placeable)break}else Zo=$t()},zt=en.textAnchorOffsetStartIndex,Dt=en.textAnchorOffsetEndIndex;if(Dt===zt){const $t=(Cr,Ar)=>{const Vr=this.collisionIndex.placeCollisionBox(Cr,gt,Fr,Ct,Wt,Sr,sr,ot,at.predicate,za);return Vr&&Vr.placeable&&(this.markUsedOrientation(Se,Ar,en),this.placedOrientations[en.crossTileID]=Ar),Vr};xt(()=>$t(pe,t.ah.horizontal),()=>{const Cr=ln.verticalTextBox;return Se.allowVerticalPlacement&&en.numVerticalGlyphVertices>0&&Cr?$t(Cr,t.ah.vertical):{box:null,offscreen:null}}),ht(Zo&&Zo.placeable)}else{let $t=t.aq[(ii=(pi=this.prevPlacement)===null||pi===void 0?void 0:pi.variableOffsets[en.crossTileID])===null||ii===void 0?void 0:ii.anchor];const Cr=(Vr,Kr,aa)=>{const Ua=Vr.x2-Vr.x1,la=Vr.y2-Vr.y1,Ta=en.textBoxScale,ka=Nr&&Yt==="never"?Kr:null;let Ba=null,Va=gt==="never"?1:2,Ma="never";$t&&Va++;for(let mn=0;mnCr(pe,ln.iconBox,t.ah.horizontal),()=>{const Vr=ln.verticalTextBox;return Se.allowVerticalPlacement&&(!Zo||!Zo.placeable)&&en.numVerticalGlyphVertices>0&&Vr?Cr(Vr,ln.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}}),Zo&&(Gi=Zo.placeable,No=Zo.offscreen);const Ar=ht(Zo&&Zo.placeable);if(!Gi&&this.prevPlacement){const Vr=this.prevPlacement.variableOffsets[en.crossTileID];Vr&&(this.variableOffsets[en.crossTileID]=Vr,this.markUsedJustification(Se,Vr.anchor,en,Ar))}}}if(zs=Zo,Gi=zs&&zs.placeable,No=zs&&zs.offscreen,en.useRuntimeCollisionCircles){const ht=Se.text.placedSymbolArray.get(en.centerJustifiedTextSymbolIndex),xt=t.ai(Se.textSizeData,Ze,ht),zt=Ie.get("text-padding");xo=this.collisionIndex.placeCollisionCircles(gt,ht,Se.lineVertexArray,Se.glyphOffsetArray,xt,Ct,Wt,nr,or,Te,Sr,at.predicate,en.collisionCircleDiameter,zt,ot,za),xo.circles.length&&xo.collisionDetected&&!Te&&t.w("Collisions detected, but collision boxes are not shown"),Gi=Et||xo.circles.length>0&&!xo.collisionDetected,No=No&&xo.offscreen}if(ln.iconFeatureIndex&&(pu=ln.iconFeatureIndex),ln.iconBox){const ht=xt=>this.collisionIndex.placeCollisionBox(xt,Yt,Fr,Ct,Wt,Sr,sr,yt,at.predicate,za,Nr&&po?po:void 0);Hs&&Hs.placeable&&ln.verticalIconBox?(bo=ht(ln.verticalIconBox),Bo=bo.placeable):(bo=ht(ln.iconBox),Bo=bo.placeable),No=No&&bo.offscreen}const Le=lt||en.numHorizontalGlyphVertices===0&&en.numVerticalGlyphVertices===0,Ye=Tt||en.numIconVertices===0;Le||Ye?Ye?Le||(Bo=Bo&&Gi):Gi=Bo&&Gi:Bo=Gi=Bo&&Gi;const ut=Bo&&bo.placeable;if(Gi&&zs.placeable&&this.collisionIndex.insertCollisionBox(zs.box,gt,Ie.get("text-ignore-placement"),Se.bucketInstanceId,Hs&&Hs.placeable&&Al?Al:vl,at.ID),ut&&this.collisionIndex.insertCollisionBox(bo.box,Yt,Ie.get("icon-ignore-placement"),Se.bucketInstanceId,pu,at.ID),xo&&Gi&&this.collisionIndex.insertCollisionCircles(xo.circles,gt,Ie.get("text-ignore-placement"),Se.bucketInstanceId,vl,at.ID),Te&&this.storeCollisionData(Se.bucketInstanceId,Nn,ln,zs,bo,xo),en.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(Se.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[en.crossTileID]=new Ia(Gi||ia,Bo||_a,No||Se.justReloaded),ne[en.crossTileID]=!0};if(Qr){if(I.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const en=Se.getSortedSymbolIndexes(this.transform.angle);for(let ln=en.length-1;ln>=0;--ln){const Nn=en[ln];nn(Se.symbolInstances.get(Nn),Se.collisionArrays[Nn],Nn)}}else for(let en=I.symbolInstanceStart;en=0&&(I.text.placedSymbolArray.get(yt).crossTileID=Ie>=0&&yt!==Ie?0:Te.crossTileID)}markUsedOrientation(I,ne,Te){const Se=ne===t.ah.horizontal||ne===t.ah.horizontalOnly?ne:0,Ie=ne===t.ah.vertical?ne:0,ot=[Te.leftJustifiedTextSymbolIndex,Te.centerJustifiedTextSymbolIndex,Te.rightJustifiedTextSymbolIndex];for(const yt of ot)I.text.placedSymbolArray.get(yt).placedOrientation=Se;Te.verticalPlacedTextSymbolIndex&&(I.text.placedSymbolArray.get(Te.verticalPlacedTextSymbolIndex).placedOrientation=Ie)}commit(I){this.commitTime=I,this.zoomAtLastRecencyCheck=this.transform.zoom;const ne=this.prevPlacement;let Te=!1;this.prevZoomAdjustment=ne?ne.zoomAdjustment(this.transform.zoom):0;const Se=ne?ne.symbolFadeChange(I):1,Ie=ne?ne.opacities:{},ot=ne?ne.variableOffsets:{},yt=ne?ne.placedOrientations:{};for(const Ct in this.placements){const Wt=this.placements[Ct],nr=Ie[Ct];nr?(this.opacities[Ct]=new ma(nr,Se,Wt.text,Wt.icon),Te=Te||Wt.text!==nr.text.placed||Wt.icon!==nr.icon.placed):(this.opacities[Ct]=new ma(null,Se,Wt.text,Wt.icon,Wt.skipFade),Te=Te||Wt.text||Wt.icon)}for(const Ct in Ie){const Wt=Ie[Ct];if(!this.opacities[Ct]){const nr=new ma(Wt,Se,!1,!1);nr.isHidden()||(this.opacities[Ct]=nr,Te=Te||Wt.text.placed||Wt.icon.placed)}}for(const Ct in ot)this.variableOffsets[Ct]||!this.opacities[Ct]||this.opacities[Ct].isHidden()||(this.variableOffsets[Ct]=ot[Ct]);for(const Ct in yt)this.placedOrientations[Ct]||!this.opacities[Ct]||this.opacities[Ct].isHidden()||(this.placedOrientations[Ct]=yt[Ct]);if(ne&&ne.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");Te?this.lastPlacementChangeTime=I:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=ne?ne.lastPlacementChangeTime:I)}updateLayerOpacities(I,ne){const Te={};for(const Se of ne){const Ie=Se.getBucket(I);Ie&&Se.latestFeatureIndex&&I.id===Ie.layerIds[0]&&this.updateBucketOpacities(Ie,Se.tileID,Te,Se.collisionBoxArray)}}updateBucketOpacities(I,ne,Te,Se){I.hasTextData()&&(I.text.opacityVertexArray.clear(),I.text.hasVisibleVertices=!1),I.hasIconData()&&(I.icon.opacityVertexArray.clear(),I.icon.hasVisibleVertices=!1),I.hasIconCollisionBoxData()&&I.iconCollisionBox.collisionVertexArray.clear(),I.hasTextCollisionBoxData()&&I.textCollisionBox.collisionVertexArray.clear();const Ie=I.layers[0],ot=Ie.layout,yt=new ma(null,0,!1,!1,!0),Ct=ot.get("text-allow-overlap"),Wt=ot.get("icon-allow-overlap"),nr=Ie._unevaluatedLayout.hasValue("text-variable-anchor")||Ie._unevaluatedLayout.hasValue("text-variable-anchor-offset"),or=ot.get("text-rotation-alignment")==="map",Fr=ot.get("text-pitch-alignment")==="map",Wr=ot.get("icon-text-fit")!=="none",je=new ma(null,0,Ct&&(Wt||!I.hasIconData()||ot.get("icon-optional")),Wt&&(Ct||!I.hasTextData()||ot.get("text-optional")),!0);!I.collisionArrays&&Se&&(I.hasIconCollisionBoxData()||I.hasTextCollisionBoxData())&&I.deserializeCollisionBoxes(Se);const Ze=(lt,Tt,gt)=>{for(let Et=0;Et0,Sr=this.placedOrientations[Tt.crossTileID],Nr=Sr===t.ah.vertical,Qr=Sr===t.ah.horizontal||Sr===t.ah.horizontalOnly;if(gt>0||Et>0){const _a=Pa(rr.text);Ze(I.text,gt,Nr?sa:_a),Ze(I.text,Et,Qr?sa:_a);const za=rr.text.isHidden();[Tt.rightJustifiedTextSymbolIndex,Tt.centerJustifiedTextSymbolIndex,Tt.leftJustifiedTextSymbolIndex].forEach(ln=>{ln>=0&&(I.text.placedSymbolArray.get(ln).hidden=za||Nr?1:0)}),Tt.verticalPlacedTextSymbolIndex>=0&&(I.text.placedSymbolArray.get(Tt.verticalPlacedTextSymbolIndex).hidden=za||Qr?1:0);const nn=this.variableOffsets[Tt.crossTileID];nn&&this.markUsedJustification(I,nn.anchor,Tt,Sr);const en=this.placedOrientations[Tt.crossTileID];en&&(this.markUsedJustification(I,"left",Tt,en),this.markUsedOrientation(I,en,Tt))}if(sr){const _a=Pa(rr.icon),za=!(Wr&&Tt.verticalPlacedIconSymbolIndex&&Nr);Tt.placedIconSymbolIndex>=0&&(Ze(I.icon,Tt.numIconVertices,za?_a:sa),I.icon.placedSymbolArray.get(Tt.placedIconSymbolIndex).hidden=rr.icon.isHidden()),Tt.verticalPlacedIconSymbolIndex>=0&&(Ze(I.icon,Tt.numVerticalIconVertices,za?sa:_a),I.icon.placedSymbolArray.get(Tt.verticalPlacedIconSymbolIndex).hidden=rr.icon.isHidden())}const ia=at&&at.has(lt)?at.get(lt):{text:null,icon:null};if(I.hasIconCollisionBoxData()||I.hasTextCollisionBoxData()){const _a=I.collisionArrays[lt];if(_a){let za=new t.P(0,0);if(_a.textBox||_a.verticalTextBox){let nn=!0;if(nr){const en=this.variableOffsets[Yt];en?(za=Vt(en.anchor,en.width,en.height,en.textOffset,en.textBoxScale),or&&za._rotate(Fr?this.transform.angle:-this.transform.angle)):nn=!1}if(_a.textBox||_a.verticalTextBox){let en;_a.textBox&&(en=Nr),_a.verticalTextBox&&(en=Qr),jt(I.textCollisionBox.collisionVertexArray,rr.text.placed,!nn||en,ia.text,za.x,za.y)}}if(_a.iconBox||_a.verticalIconBox){const nn=!!(!Qr&&_a.verticalIconBox);let en;_a.iconBox&&(en=nn),_a.verticalIconBox&&(en=!nn),jt(I.iconCollisionBox.collisionVertexArray,rr.icon.placed,en,ia.icon,Wr?za.x:0,Wr?za.y:0)}}}}if(I.sortFeatures(this.transform.angle),this.retainedQueryData[I.bucketInstanceId]&&(this.retainedQueryData[I.bucketInstanceId].featureSortOrder=I.featureSortOrder),I.hasTextData()&&I.text.opacityVertexBuffer&&I.text.opacityVertexBuffer.updateData(I.text.opacityVertexArray),I.hasIconData()&&I.icon.opacityVertexBuffer&&I.icon.opacityVertexBuffer.updateData(I.icon.opacityVertexArray),I.hasIconCollisionBoxData()&&I.iconCollisionBox.collisionVertexBuffer&&I.iconCollisionBox.collisionVertexBuffer.updateData(I.iconCollisionBox.collisionVertexArray),I.hasTextCollisionBoxData()&&I.textCollisionBox.collisionVertexBuffer&&I.textCollisionBox.collisionVertexBuffer.updateData(I.textCollisionBox.collisionVertexArray),I.text.opacityVertexArray.length!==I.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${I.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${I.text.layoutVertexArray.length}) / 4`);if(I.icon.opacityVertexArray.length!==I.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${I.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${I.icon.layoutVertexArray.length}) / 4`);if(I.bucketInstanceId in this.collisionCircleArrays){const lt=this.collisionCircleArrays[I.bucketInstanceId];I.placementInvProjMatrix=lt.invProjMatrix,I.placementViewportMatrix=lt.viewportMatrix,I.collisionCircleArray=lt.circles,delete this.collisionCircleArrays[I.bucketInstanceId]}}symbolFadeChange(I){return this.fadeDuration===0?1:(I-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(I){return Math.max(0,(this.transform.zoom-I)/1.5)}hasTransitions(I){return this.stale||I-this.lastPlacementChangeTimeI}setStale(){this.stale=!0}}function jt(De,I,ne,Te,Se,Ie){Te&&Te.length!==0||(Te=[0,0,0,0]);const ot=Te[0]-lr,yt=Te[1]-lr,Ct=Te[2]-lr,Wt=Te[3]-lr;De.emplaceBack(I?1:0,ne?1:0,Se||0,Ie||0,ot,yt),De.emplaceBack(I?1:0,ne?1:0,Se||0,Ie||0,Ct,yt),De.emplaceBack(I?1:0,ne?1:0,Se||0,Ie||0,Ct,Wt),De.emplaceBack(I?1:0,ne?1:0,Se||0,Ie||0,ot,Wt)}const Ot=Math.pow(2,25),gr=Math.pow(2,24),Br=Math.pow(2,17),na=Math.pow(2,16),Ur=Math.pow(2,9),ga=Math.pow(2,8),Aa=Math.pow(2,1);function Pa(De){if(De.opacity===0&&!De.placed)return 0;if(De.opacity===1&&De.placed)return 4294967295;const I=De.placed?1:0,ne=Math.floor(127*De.opacity);return ne*Ot+I*gr+ne*Br+I*na+ne*Ur+I*ga+ne*Aa+I}const sa=0;function Oa(){return{isOccluded:(De,I,ne)=>!1,getPitchedTextCorrection:(De,I,ne)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(De,I,ne,Te){throw new Error("Not implemented.")},translatePosition:(De,I,ne,Te)=>function(Se,Ie,ot,yt,Ct=!1){if(!ot[0]&&!ot[1])return[0,0];const Wt=Ct?yt==="map"?Se.angle:0:yt==="viewport"?-Se.angle:0;if(Wt){const nr=Math.sin(Wt),or=Math.cos(Wt);ot=[ot[0]*or-ot[1]*nr,ot[0]*nr+ot[1]*or]}return[Ct?ot[0]:da(Ie,ot[0],Se.zoom),Ct?ot[1]:da(Ie,ot[1],Se.zoom)]}(De,I,ne,Te),getCircleRadiusCorrection:De=>1}}class dt{constructor(I){this._sortAcrossTiles=I.layout.get("symbol-z-order")!=="viewport-y"&&!I.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(I,ne,Te,Se,Ie){const ot=this._bucketParts;for(;this._currentTileIndexyt.sortKey-Ct.sortKey));this._currentPartIndex!this._forceFullPlacement&&i.now()-Se>2;for(;this._currentPlacementIndex>=0;){const ot=ne[I[this._currentPlacementIndex]],yt=this.placement.collisionIndex.transform.zoom;if(ot.type==="symbol"&&(!ot.minzoom||ot.minzoom<=yt)&&(!ot.maxzoom||ot.maxzoom>yt)){if(this._inProgressLayer||(this._inProgressLayer=new dt(ot)),this._inProgressLayer.continuePlacement(Te[ot.source],this.placement,this._showCollisionBoxes,ot,Ie))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(I){return this.placement.commit(I),this.placement}}const Lr=512/t.X/2;class Er{constructor(I,ne,Te){this.tileID=I,this.bucketInstanceId=Te,this._symbolsByKey={};const Se=new Map;for(let Ie=0;Ie({x:Math.floor(Ct.anchorX*Lr),y:Math.floor(Ct.anchorY*Lr)})),crossTileIDs:ot.map(Ct=>Ct.crossTileID)};if(yt.positions.length>128){const Ct=new t.av(yt.positions.length,16,Uint16Array);for(const{x:Wt,y:nr}of yt.positions)Ct.add(Wt,nr);Ct.finish(),delete yt.positions,yt.index=Ct}this._symbolsByKey[Ie]=yt}}getScaledCoordinates(I,ne){const{x:Te,y:Se,z:Ie}=this.tileID.canonical,{x:ot,y:yt,z:Ct}=ne.canonical,Wt=Lr/Math.pow(2,Ct-Ie),nr=(yt*t.X+I.anchorY)*Wt,or=Se*t.X*Lr;return{x:Math.floor((ot*t.X+I.anchorX)*Wt-Te*t.X*Lr),y:Math.floor(nr-or)}}findMatches(I,ne,Te){const Se=this.tileID.canonical.zI)}}class _r{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class yr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(I){const ne=Math.round((I-this.lng)/360);if(ne!==0)for(const Te in this.indexes){const Se=this.indexes[Te],Ie={};for(const ot in Se){const yt=Se[ot];yt.tileID=yt.tileID.unwrapTo(yt.tileID.wrap+ne),Ie[yt.tileID.key]=yt}this.indexes[Te]=Ie}this.lng=I}addBucket(I,ne,Te){if(this.indexes[I.overscaledZ]&&this.indexes[I.overscaledZ][I.key]){if(this.indexes[I.overscaledZ][I.key].bucketInstanceId===ne.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(I.overscaledZ,this.indexes[I.overscaledZ][I.key])}for(let Ie=0;IeI.overscaledZ)for(const yt in ot){const Ct=ot[yt];Ct.tileID.isChildOf(I)&&Ct.findMatches(ne.symbolInstances,I,Se)}else{const yt=ot[I.scaledTo(Number(Ie)).key];yt&&yt.findMatches(ne.symbolInstances,I,Se)}}for(let Ie=0;Ie{ne[Te]=!0});for(const Te in this.layerIndexes)ne[Te]||delete this.layerIndexes[Te]}}const zr=(De,I)=>t.t(De,I&&I.filter(ne=>ne.identifier!=="source.canvas")),Pr=t.aw();class Hr extends t.E{constructor(I,ne={}){super(),this._rtlPluginLoaded=()=>{for(const Te in this.sourceCaches){const Se=this.sourceCaches[Te].getSource().type;Se!=="vector"&&Se!=="geojson"||this.sourceCaches[Te].reload()}},this.map=I,this.dispatcher=new $(J(),I._getMapId()),this.dispatcher.registerMessageHandler("GG",(Te,Se)=>this.getGlyphs(Te,Se)),this.dispatcher.registerMessageHandler("GI",(Te,Se)=>this.getImages(Te,Se)),this.imageManager=new m,this.imageManager.setEventedParent(this),this.glyphManager=new F(I._requestManager,ne.localIdeographFontFamily),this.lineAtlas=new Z(256,512),this.crossTileSymbolIndex=new kr,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",t.ay()),$e().on(xe,this._rtlPluginLoaded),this.on("data",Te=>{if(Te.dataType!=="source"||Te.sourceDataType!=="metadata")return;const Se=this.sourceCaches[Te.sourceId];if(!Se)return;const Ie=Se.getSource();if(Ie&&Ie.vectorLayerIds)for(const ot in this._layers){const yt=this._layers[ot];yt.source===Ie.id&&this._validateLayer(yt)}})}loadURL(I,ne={},Te){this.fire(new t.k("dataloading",{dataType:"style"})),ne.validate=typeof ne.validate!="boolean"||ne.validate;const Se=this.map._requestManager.transformRequest(I,"Style");this._loadStyleRequest=new AbortController;const Ie=this._loadStyleRequest;t.h(Se,this._loadStyleRequest).then(ot=>{this._loadStyleRequest=null,this._load(ot.data,ne,Te)}).catch(ot=>{this._loadStyleRequest=null,ot&&!Ie.signal.aborted&&this.fire(new t.j(ot))})}loadJSON(I,ne={},Te){this.fire(new t.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,ne.validate=ne.validate!==!1,this._load(I,ne,Te)}).catch(()=>{})}loadEmpty(){this.fire(new t.k("dataloading",{dataType:"style"})),this._load(Pr,{validate:!1})}_load(I,ne,Te){var Se;const Ie=ne.transformStyle?ne.transformStyle(Te,I):I;if(!ne.validate||!zr(this,t.u(Ie))){this._loaded=!0,this.stylesheet=Ie;for(const ot in Ie.sources)this.addSource(ot,Ie.sources[ot],{validate:!1});Ie.sprite?this._loadSprite(Ie.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(Ie.glyphs),this._createLayers(),this.light=new L(this.stylesheet.light),this.sky=new U(this.stylesheet.sky),this.map.setTerrain((Se=this.stylesheet.terrain)!==null&&Se!==void 0?Se:null),this.fire(new t.k("data",{dataType:"style"})),this.fire(new t.k("style.load"))}}_createLayers(){const I=t.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",I),this._order=I.map(ne=>ne.id),this._layers={},this._serializedLayers=null;for(const ne of I){const Te=t.aA(ne);Te.setEventedParent(this,{layer:{id:ne.id}}),this._layers[ne.id]=Te}}_loadSprite(I,ne=!1,Te=void 0){let Se;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(Ie,ot,yt,Ct){return t._(this,void 0,void 0,function*(){const Wt=w(Ie),nr=yt>1?"@2x":"",or={},Fr={};for(const{id:Wr,url:je}of Wt){const Ze=ot.transformRequest(p(je,nr,".json"),"SpriteJSON");or[Wr]=t.h(Ze,Ct);const at=ot.transformRequest(p(je,nr,".png"),"SpriteImage");Fr[Wr]=l.getImage(at,Ct)}return yield Promise.all([...Object.values(or),...Object.values(Fr)]),function(Wr,je){return t._(this,void 0,void 0,function*(){const Ze={};for(const at in Wr){Ze[at]={};const lt=i.getImageCanvasContext((yield je[at]).data),Tt=(yield Wr[at]).data;for(const gt in Tt){const{width:Et,height:Yt,x:rr,y:sr,sdf:Sr,pixelRatio:Nr,stretchX:Qr,stretchY:ia,content:_a,textFitWidth:za,textFitHeight:nn}=Tt[gt];Ze[at][gt]={data:null,pixelRatio:Nr,sdf:Sr,stretchX:Qr,stretchY:ia,content:_a,textFitWidth:za,textFitHeight:nn,spriteData:{width:Et,height:Yt,x:rr,y:sr,context:lt}}}}return Ze})}(or,Fr)})}(I,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(Ie=>{if(this._spriteRequest=null,Ie)for(const ot in Ie){this._spritesImagesIds[ot]=[];const yt=this._spritesImagesIds[ot]?this._spritesImagesIds[ot].filter(Ct=>!(Ct in Ie)):[];for(const Ct of yt)this.imageManager.removeImage(Ct),this._changedImages[Ct]=!0;for(const Ct in Ie[ot]){const Wt=ot==="default"?Ct:`${ot}:${Ct}`;this._spritesImagesIds[ot].push(Wt),Wt in this.imageManager.images?this.imageManager.updateImage(Wt,Ie[ot][Ct],!1):this.imageManager.addImage(Wt,Ie[ot][Ct]),ne&&(this._changedImages[Wt]=!0)}}}).catch(Ie=>{this._spriteRequest=null,Se=Ie,this.fire(new t.j(Se))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),ne&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"})),Te&&Te(Se)})}_unloadSprite(){for(const I of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(I),this._changedImages[I]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}_validateLayer(I){const ne=this.sourceCaches[I.source];if(!ne)return;const Te=I.sourceLayer;if(!Te)return;const Se=ne.getSource();(Se.type==="geojson"||Se.vectorLayerIds&&Se.vectorLayerIds.indexOf(Te)===-1)&&this.fire(new t.j(new Error(`Source layer "${Te}" does not exist on source "${Se.id}" as specified by style layer "${I.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const I in this.sourceCaches)if(!this.sourceCaches[I].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(I,ne=!1){const Te=this._serializedAllLayers();if(!I||I.length===0)return Object.values(ne?t.aB(Te):Te);const Se=[];for(const Ie of I)if(Te[Ie]){const ot=ne?t.aB(Te[Ie]):Te[Ie];Se.push(ot)}return Se}_serializedAllLayers(){let I=this._serializedLayers;if(I)return I;I=this._serializedLayers={};const ne=Object.keys(this._layers);for(const Te of ne){const Se=this._layers[Te];Se.type!=="custom"&&(I[Te]=Se.serialize())}return I}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const I in this.sourceCaches)if(this.sourceCaches[I].hasTransition())return!0;for(const I in this._layers)if(this._layers[I].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(I){if(!this._loaded)return;const ne=this._changed;if(ne){const Se=Object.keys(this._updatedLayers),Ie=Object.keys(this._removedLayers);(Se.length||Ie.length)&&this._updateWorkerLayers(Se,Ie);for(const ot in this._updatedSources){const yt=this._updatedSources[ot];if(yt==="reload")this._reloadSource(ot);else{if(yt!=="clear")throw new Error(`Invalid action ${yt}`);this._clearSource(ot)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const ot in this._updatedPaintProps)this._layers[ot].updateTransitions(I);this.light.updateTransitions(I),this.sky.updateTransitions(I),this._resetUpdates()}const Te={};for(const Se in this.sourceCaches){const Ie=this.sourceCaches[Se];Te[Se]=Ie.used,Ie.used=!1}for(const Se of this._order){const Ie=this._layers[Se];Ie.recalculate(I,this._availableImages),!Ie.isHidden(I.zoom)&&Ie.source&&(this.sourceCaches[Ie.source].used=!0)}for(const Se in Te){const Ie=this.sourceCaches[Se];!!Te[Se]!=!!Ie.used&&Ie.fire(new t.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:Se}))}this.light.recalculate(I),this.sky.recalculate(I),this.z=I.zoom,ne&&this.fire(new t.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const I=Object.keys(this._changedImages);if(I.length){for(const ne in this.sourceCaches)this.sourceCaches[ne].reloadTilesForDependencies(["icons","patterns"],I);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const I in this.sourceCaches)this.sourceCaches[I].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(I,ne){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(I,!1),removedIds:ne})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(I,ne={}){var Te;this._checkLoaded();const Se=this.serialize();if(I=ne.transformStyle?ne.transformStyle(Se,I):I,((Te=ne.validate)===null||Te===void 0||Te)&&zr(this,t.u(I)))return!1;(I=t.aB(I)).layers=t.az(I.layers);const Ie=t.aC(Se,I),ot=this._getOperationsToPerform(Ie);if(ot.unimplemented.length>0)throw new Error(`Unimplemented: ${ot.unimplemented.join(", ")}.`);if(ot.operations.length===0)return!1;for(const yt of ot.operations)yt();return this.stylesheet=I,this._serializedLayers=null,!0}_getOperationsToPerform(I){const ne=[],Te=[];for(const Se of I)switch(Se.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":ne.push(()=>this.addLayer.apply(this,Se.args));break;case"removeLayer":ne.push(()=>this.removeLayer.apply(this,Se.args));break;case"setPaintProperty":ne.push(()=>this.setPaintProperty.apply(this,Se.args));break;case"setLayoutProperty":ne.push(()=>this.setLayoutProperty.apply(this,Se.args));break;case"setFilter":ne.push(()=>this.setFilter.apply(this,Se.args));break;case"addSource":ne.push(()=>this.addSource.apply(this,Se.args));break;case"removeSource":ne.push(()=>this.removeSource.apply(this,Se.args));break;case"setLayerZoomRange":ne.push(()=>this.setLayerZoomRange.apply(this,Se.args));break;case"setLight":ne.push(()=>this.setLight.apply(this,Se.args));break;case"setGeoJSONSourceData":ne.push(()=>this.setGeoJSONSourceData.apply(this,Se.args));break;case"setGlyphs":ne.push(()=>this.setGlyphs.apply(this,Se.args));break;case"setSprite":ne.push(()=>this.setSprite.apply(this,Se.args));break;case"setSky":ne.push(()=>this.setSky.apply(this,Se.args));break;case"setTerrain":ne.push(()=>this.map.setTerrain.apply(this,Se.args));break;case"setTransition":ne.push(()=>{});break;default:Te.push(Se.command)}return{operations:ne,unimplemented:Te}}addImage(I,ne){if(this.getImage(I))return this.fire(new t.j(new Error(`An image named "${I}" already exists.`)));this.imageManager.addImage(I,ne),this._afterImageUpdated(I)}updateImage(I,ne){this.imageManager.updateImage(I,ne)}getImage(I){return this.imageManager.getImage(I)}removeImage(I){if(!this.getImage(I))return this.fire(new t.j(new Error(`An image named "${I}" does not exist.`)));this.imageManager.removeImage(I),this._afterImageUpdated(I)}_afterImageUpdated(I){this._availableImages=this.imageManager.listImages(),this._changedImages[I]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(I,ne,Te={}){if(this._checkLoaded(),this.sourceCaches[I]!==void 0)throw new Error(`Source "${I}" already exists.`);if(!ne.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(ne).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(ne.type)>=0&&this._validate(t.u.source,`sources.${I}`,ne,null,Te))return;this.map&&this.map._collectResourceTiming&&(ne.collectResourceTiming=!0);const Se=this.sourceCaches[I]=new St(I,ne,this.dispatcher);Se.style=this,Se.setEventedParent(this,()=>({isSourceLoaded:Se.loaded(),source:Se.serialize(),sourceId:I})),Se.onAdd(this.map),this._changed=!0}removeSource(I){if(this._checkLoaded(),this.sourceCaches[I]===void 0)throw new Error("There is no source with this ID");for(const Te in this._layers)if(this._layers[Te].source===I)return this.fire(new t.j(new Error(`Source "${I}" cannot be removed while layer "${Te}" is using it.`)));const ne=this.sourceCaches[I];delete this.sourceCaches[I],delete this._updatedSources[I],ne.fire(new t.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:I})),ne.setEventedParent(null),ne.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(I,ne){if(this._checkLoaded(),this.sourceCaches[I]===void 0)throw new Error(`There is no source with this ID=${I}`);const Te=this.sourceCaches[I].getSource();if(Te.type!=="geojson")throw new Error(`geojsonSource.type is ${Te.type}, which is !== 'geojson`);Te.setData(ne),this._changed=!0}getSource(I){return this.sourceCaches[I]&&this.sourceCaches[I].getSource()}addLayer(I,ne,Te={}){this._checkLoaded();const Se=I.id;if(this.getLayer(Se))return void this.fire(new t.j(new Error(`Layer "${Se}" already exists on this map.`)));let Ie;if(I.type==="custom"){if(zr(this,t.aD(I)))return;Ie=t.aA(I)}else{if("source"in I&&typeof I.source=="object"&&(this.addSource(Se,I.source),I=t.aB(I),I=t.e(I,{source:Se})),this._validate(t.u.layer,`layers.${Se}`,I,{arrayIndex:-1},Te))return;Ie=t.aA(I),this._validateLayer(Ie),Ie.setEventedParent(this,{layer:{id:Se}})}const ot=ne?this._order.indexOf(ne):this._order.length;if(ne&&ot===-1)this.fire(new t.j(new Error(`Cannot add layer "${Se}" before non-existing layer "${ne}".`)));else{if(this._order.splice(ot,0,Se),this._layerOrderChanged=!0,this._layers[Se]=Ie,this._removedLayers[Se]&&Ie.source&&Ie.type!=="custom"){const yt=this._removedLayers[Se];delete this._removedLayers[Se],yt.type!==Ie.type?this._updatedSources[Ie.source]="clear":(this._updatedSources[Ie.source]="reload",this.sourceCaches[Ie.source].pause())}this._updateLayer(Ie),Ie.onAdd&&Ie.onAdd(this.map)}}moveLayer(I,ne){if(this._checkLoaded(),this._changed=!0,!this._layers[I])return void this.fire(new t.j(new Error(`The layer '${I}' does not exist in the map's style and cannot be moved.`)));if(I===ne)return;const Te=this._order.indexOf(I);this._order.splice(Te,1);const Se=ne?this._order.indexOf(ne):this._order.length;ne&&Se===-1?this.fire(new t.j(new Error(`Cannot move layer "${I}" before non-existing layer "${ne}".`))):(this._order.splice(Se,0,I),this._layerOrderChanged=!0)}removeLayer(I){this._checkLoaded();const ne=this._layers[I];if(!ne)return void this.fire(new t.j(new Error(`Cannot remove non-existing layer "${I}".`)));ne.setEventedParent(null);const Te=this._order.indexOf(I);this._order.splice(Te,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[I]=ne,delete this._layers[I],this._serializedLayers&&delete this._serializedLayers[I],delete this._updatedLayers[I],delete this._updatedPaintProps[I],ne.onRemove&&ne.onRemove(this.map)}getLayer(I){return this._layers[I]}getLayersOrder(){return[...this._order]}hasLayer(I){return I in this._layers}setLayerZoomRange(I,ne,Te){this._checkLoaded();const Se=this.getLayer(I);Se?Se.minzoom===ne&&Se.maxzoom===Te||(ne!=null&&(Se.minzoom=ne),Te!=null&&(Se.maxzoom=Te),this._updateLayer(Se)):this.fire(new t.j(new Error(`Cannot set the zoom range of non-existing layer "${I}".`)))}setFilter(I,ne,Te={}){this._checkLoaded();const Se=this.getLayer(I);if(Se){if(!t.aE(Se.filter,ne))return ne==null?(Se.filter=void 0,void this._updateLayer(Se)):void(this._validate(t.u.filter,`layers.${Se.id}.filter`,ne,null,Te)||(Se.filter=t.aB(ne),this._updateLayer(Se)))}else this.fire(new t.j(new Error(`Cannot filter non-existing layer "${I}".`)))}getFilter(I){return t.aB(this.getLayer(I).filter)}setLayoutProperty(I,ne,Te,Se={}){this._checkLoaded();const Ie=this.getLayer(I);Ie?t.aE(Ie.getLayoutProperty(ne),Te)||(Ie.setLayoutProperty(ne,Te,Se),this._updateLayer(Ie)):this.fire(new t.j(new Error(`Cannot style non-existing layer "${I}".`)))}getLayoutProperty(I,ne){const Te=this.getLayer(I);if(Te)return Te.getLayoutProperty(ne);this.fire(new t.j(new Error(`Cannot get style of non-existing layer "${I}".`)))}setPaintProperty(I,ne,Te,Se={}){this._checkLoaded();const Ie=this.getLayer(I);Ie?t.aE(Ie.getPaintProperty(ne),Te)||(Ie.setPaintProperty(ne,Te,Se)&&this._updateLayer(Ie),this._changed=!0,this._updatedPaintProps[I]=!0,this._serializedLayers=null):this.fire(new t.j(new Error(`Cannot style non-existing layer "${I}".`)))}getPaintProperty(I,ne){return this.getLayer(I).getPaintProperty(ne)}setFeatureState(I,ne){this._checkLoaded();const Te=I.source,Se=I.sourceLayer,Ie=this.sourceCaches[Te];if(Ie===void 0)return void this.fire(new t.j(new Error(`The source '${Te}' does not exist in the map's style.`)));const ot=Ie.getSource().type;ot==="geojson"&&Se?this.fire(new t.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):ot!=="vector"||Se?(I.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Ie.setFeatureState(Se,I.id,ne)):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(I,ne){this._checkLoaded();const Te=I.source,Se=this.sourceCaches[Te];if(Se===void 0)return void this.fire(new t.j(new Error(`The source '${Te}' does not exist in the map's style.`)));const Ie=Se.getSource().type,ot=Ie==="vector"?I.sourceLayer:void 0;Ie!=="vector"||ot?ne&&typeof I.id!="string"&&typeof I.id!="number"?this.fire(new t.j(new Error("A feature id is required to remove its specific state property."))):Se.removeFeatureState(ot,I.id,ne):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(I){this._checkLoaded();const ne=I.source,Te=I.sourceLayer,Se=this.sourceCaches[ne];if(Se!==void 0)return Se.getSource().type!=="vector"||Te?(I.id===void 0&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),Se.getFeatureState(Te,I.id)):void this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new t.j(new Error(`The source '${ne}' does not exist in the map's style.`)))}getTransition(){return t.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const I=t.aF(this.sourceCaches,Ie=>Ie.serialize()),ne=this._serializeByIds(this._order,!0),Te=this.map.getTerrain()||void 0,Se=this.stylesheet;return t.aG({version:Se.version,name:Se.name,metadata:Se.metadata,light:Se.light,sky:Se.sky,center:Se.center,zoom:Se.zoom,bearing:Se.bearing,pitch:Se.pitch,sprite:Se.sprite,glyphs:Se.glyphs,transition:Se.transition,sources:I,layers:ne,terrain:Te},Ie=>Ie!==void 0)}_updateLayer(I){this._updatedLayers[I.id]=!0,I.source&&!this._updatedSources[I.source]&&this.sourceCaches[I.source].getSource().type!=="raster"&&(this._updatedSources[I.source]="reload",this.sourceCaches[I.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(I){const ne=ot=>this._layers[ot].type==="fill-extrusion",Te={},Se=[];for(let ot=this._order.length-1;ot>=0;ot--){const yt=this._order[ot];if(ne(yt)){Te[yt]=ot;for(const Ct of I){const Wt=Ct[yt];if(Wt)for(const nr of Wt)Se.push(nr)}}}Se.sort((ot,yt)=>yt.intersectionZ-ot.intersectionZ);const Ie=[];for(let ot=this._order.length-1;ot>=0;ot--){const yt=this._order[ot];if(ne(yt))for(let Ct=Se.length-1;Ct>=0;Ct--){const Wt=Se[Ct].feature;if(Te[Wt.layer.id]{const Sr=lt.featureSortOrder;if(Sr){const Nr=Sr.indexOf(rr.featureIndex);return Sr.indexOf(sr.featureIndex)-Nr}return sr.featureIndex-rr.featureIndex});for(const rr of Yt)Et.push(rr)}}for(const lt in je)je[lt].forEach(Tt=>{const gt=Tt.feature,Et=Wt[yt[lt].source].getFeatureState(gt.layer["source-layer"],gt.id);gt.source=gt.layer.source,gt.layer["source-layer"]&&(gt.sourceLayer=gt.layer["source-layer"]),gt.state=Et});return je}(this._layers,ot,this.sourceCaches,I,ne,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(Ie)}querySourceFeatures(I,ne){ne&&ne.filter&&this._validate(t.u.filter,"querySourceFeatures.filter",ne.filter,null,ne);const Te=this.sourceCaches[I];return Te?function(Se,Ie){const ot=Se.getRenderableIds().map(Wt=>Se.getTileByID(Wt)),yt=[],Ct={};for(let Wt=0;WtFr.getTileByID(Wr)).sort((Wr,je)=>je.tileID.overscaledZ-Wr.tileID.overscaledZ||(Wr.tileID.isLessThan(je.tileID)?-1:1))}const or=this.crossTileSymbolIndex.addLayer(nr,Ct[nr.source],I.center.lng);ot=ot||or}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((Ie=Ie||this._layerOrderChanged||Te===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(i.now(),I.zoom))&&(this.pauseablePlacement=new vt(I,this.map.terrain,this._order,Ie,ne,Te,Se,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,Ct),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.now()),yt=!0),ot&&this.pauseablePlacement.placement.setStale()),yt||ot)for(const Wt of this._order){const nr=this._layers[Wt];nr.type==="symbol"&&this.placement.updateLayerOpacities(nr,Ct[nr.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(i.now())}_releaseSymbolFadeTiles(){for(const I in this.sourceCaches)this.sourceCaches[I].releaseSymbolFadeTiles()}getImages(I,ne){return t._(this,void 0,void 0,function*(){const Te=yield this.imageManager.getImages(ne.icons);this._updateTilesForChangedImages();const Se=this.sourceCaches[ne.source];return Se&&Se.setDependencies(ne.tileID.key,ne.type,ne.icons),Te})}getGlyphs(I,ne){return t._(this,void 0,void 0,function*(){const Te=yield this.glyphManager.getGlyphs(ne.stacks),Se=this.sourceCaches[ne.source];return Se&&Se.setDependencies(ne.tileID.key,ne.type,[""]),Te})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(I,ne={}){this._checkLoaded(),I&&this._validate(t.u.glyphs,"glyphs",I,null,ne)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=I,this.glyphManager.entries={},this.glyphManager.setURL(I))}addSprite(I,ne,Te={},Se){this._checkLoaded();const Ie=[{id:I,url:ne}],ot=[...w(this.stylesheet.sprite),...Ie];this._validate(t.u.sprite,"sprite",ot,null,Te)||(this.stylesheet.sprite=ot,this._loadSprite(Ie,!0,Se))}removeSprite(I){this._checkLoaded();const ne=w(this.stylesheet.sprite);if(ne.find(Te=>Te.id===I)){if(this._spritesImagesIds[I])for(const Te of this._spritesImagesIds[I])this.imageManager.removeImage(Te),this._changedImages[Te]=!0;ne.splice(ne.findIndex(Te=>Te.id===I),1),this.stylesheet.sprite=ne.length>0?ne:void 0,delete this._spritesImagesIds[I],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}else this.fire(new t.j(new Error(`Sprite "${I}" doesn't exists on this map.`)))}getSprite(){return w(this.stylesheet.sprite)}setSprite(I,ne={},Te){this._checkLoaded(),I&&this._validate(t.u.sprite,"sprite",I,null,ne)||(this.stylesheet.sprite=I,I?this._loadSprite(I,!0,Te):(this._unloadSprite(),Te&&Te(null)))}}var Zr=t.Y([{name:"a_pos",type:"Int16",components:2}]);const Jr={prelude:wt(`#ifdef GL_ES +precision mediump float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +`,`#ifdef GL_ES +precision highp float; +#else +#if !defined(lowp) +#define lowp +#endif +#if !defined(mediump) +#define mediump +#endif +#if !defined(highp) +#define highp +#endif +#endif +vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 +);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} +#ifdef TERRAIN3D +uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; +#endif +const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { +#ifdef TERRAIN3D +highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); +#else +return 1.0; +#endif +}float calculate_visibility(vec4 pos) { +#ifdef TERRAIN3D +vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; +#else +return 1.0; +#endif +}float ele(vec2 pos) { +#ifdef TERRAIN3D +vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; +#else +return 0.0; +#endif +}float get_elevation(vec2 pos) { +#ifdef TERRAIN3D +vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration; +#else +return 0.0; +#endif +}`),background:wt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:wt(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:wt(`varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main() { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; +#pragma mapbox: define highp vec4 color +#pragma mapbox: define mediump float radius +#pragma mapbox: define lowp float blur +#pragma mapbox: define lowp float opacity +#pragma mapbox: define highp vec4 stroke_color +#pragma mapbox: define mediump float stroke_width +#pragma mapbox: define lowp float stroke_opacity +void main(void) { +#pragma mapbox: initialize highp vec4 color +#pragma mapbox: initialize mediump float radius +#pragma mapbox: initialize lowp float blur +#pragma mapbox: initialize lowp float opacity +#pragma mapbox: initialize highp vec4 stroke_color +#pragma mapbox: initialize mediump float stroke_width +#pragma mapbox: initialize lowp float stroke_opacity +vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:wt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:wt(`uniform highp float u_intensity;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#define GAUSS_COEF 0.3989422804014327 +void main() { +#pragma mapbox: initialize highp float weight +float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; +#pragma mapbox: define highp float weight +#pragma mapbox: define mediump float radius +const highp float ZERO=1.0/255.0/16.0; +#define GAUSS_COEF 0.3989422804014327 +void main(void) { +#pragma mapbox: initialize highp float weight +#pragma mapbox: initialize mediump float radius +vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:wt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(0.0); +#endif +}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:wt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 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_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:wt("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);}"),debug:wt("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,get_elevation(a_pos),1);}"),fill:wt(`#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);}`),fillOutline:wt(`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;}`),fillOutlinePattern:wt(`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;}`),fillPattern:wt(`#ifdef GL_ES +precision highp float; +#endif +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);}`),fillExtrusion:wt(`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; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +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; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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;}`),fillExtrusionPattern:wt(`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; +#ifdef TERRAIN3D +attribute vec2 a_centroid; +#endif +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; +#ifdef TERRAIN3D +float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); +#else +float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; +#endif +base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;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;}`),hillshadePrepare:wt(`#ifdef GL_ES +precision highp float; +#endif +uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); +#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;}"),hillshade:wt(`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;}"),line:wt(`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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_width2=vec2(outset,inset);}`),lineGradient:wt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; +#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,v_uv);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;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; +#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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_width2=vec2(outset,inset);}`),linePattern:wt(`#ifdef GL_ES +precision highp float; +#endif +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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:wt(`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; +#ifdef TERRAIN3D +v_gamma_scale=1.0; +#else +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; +#endif +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);}`),raster:wt(`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;}"),symbolIcon:wt(`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 +}`,`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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;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;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:wt(`#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 inner_edge=(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);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity); +#ifdef OVERDRAW_INSPECTOR +gl_FragColor=vec4(1.0); +#endif +}`,`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 bool u_is_along_line;uniform bool u_is_variable_anchor;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_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:wt(`#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 +}`,`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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} +#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;float ele=get_elevation(a_pos);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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,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);}`),terrain:wt("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:wt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:wt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:wt("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function wt(De,I){const ne=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,Te=I.match(/attribute ([\w]+) ([\w]+)/g),Se=De.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),Ie=I.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),ot=Ie?Ie.concat(Se):Se,yt={};return{fragmentSource:De=De.replace(ne,(Ct,Wt,nr,or,Fr)=>(yt[Fr]=!0,Wt==="define"?` +#ifndef HAS_UNIFORM_u_${Fr} +varying ${nr} ${or} ${Fr}; +#else +uniform ${nr} ${or} u_${Fr}; +#endif +`:` +#ifdef HAS_UNIFORM_u_${Fr} + ${nr} ${or} ${Fr} = u_${Fr}; +#endif +`)),vertexSource:I=I.replace(ne,(Ct,Wt,nr,or,Fr)=>{const Wr=or==="float"?"vec2":"vec4",je=Fr.match(/color/)?"color":Wr;return yt[Fr]?Wt==="define"?` +#ifndef HAS_UNIFORM_u_${Fr} +uniform lowp float u_${Fr}_t; +attribute ${nr} ${Wr} a_${Fr}; +varying ${nr} ${or} ${Fr}; +#else +uniform ${nr} ${or} u_${Fr}; +#endif +`:je==="vec4"?` +#ifndef HAS_UNIFORM_u_${Fr} + ${Fr} = a_${Fr}; +#else + ${nr} ${or} ${Fr} = u_${Fr}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${Fr} + ${Fr} = unpack_mix_${je}(a_${Fr}, u_${Fr}_t); +#else + ${nr} ${or} ${Fr} = u_${Fr}; +#endif +`:Wt==="define"?` +#ifndef HAS_UNIFORM_u_${Fr} +uniform lowp float u_${Fr}_t; +attribute ${nr} ${Wr} a_${Fr}; +#else +uniform ${nr} ${or} u_${Fr}; +#endif +`:je==="vec4"?` +#ifndef HAS_UNIFORM_u_${Fr} + ${nr} ${or} ${Fr} = a_${Fr}; +#else + ${nr} ${or} ${Fr} = u_${Fr}; +#endif +`:` +#ifndef HAS_UNIFORM_u_${Fr} + ${nr} ${or} ${Fr} = unpack_mix_${je}(a_${Fr}, u_${Fr}_t); +#else + ${nr} ${or} ${Fr} = u_${Fr}; +#endif +`}),staticAttributes:Te,staticUniforms:ot}}class Qt{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(I,ne,Te,Se,Ie,ot,yt,Ct,Wt){this.context=I;let nr=this.boundPaintVertexBuffers.length!==Se.length;for(let or=0;!nr&&or({u_matrix:De,u_texture:0,u_ele_delta:I,u_fog_matrix:ne,u_fog_color:Te?Te.properties.get("fog-color"):t.aM.white,u_fog_ground_blend:Te?Te.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:Te?Te.calculateFogBlendOpacity(Se):0,u_horizon_color:Te?Te.properties.get("horizon-color"):t.aM.white,u_horizon_fog_blend:Te?Te.properties.get("horizon-fog-blend"):1});function $r(De){const I=[];for(let ne=0;ne({u_depth:new t.aH(rr,sr.u_depth),u_terrain:new t.aH(rr,sr.u_terrain),u_terrain_dim:new t.aI(rr,sr.u_terrain_dim),u_terrain_matrix:new t.aJ(rr,sr.u_terrain_matrix),u_terrain_unpack:new t.aK(rr,sr.u_terrain_unpack),u_terrain_exaggeration:new t.aI(rr,sr.u_terrain_exaggeration)}))(I,Yt),this.binderUniforms=Te?Te.getUniforms(I,Yt):[]}draw(I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr,je,Ze,at,lt,Tt){const gt=I.gl;if(this.failedToCreate)return;if(I.program.set(this.program),I.setDepthMode(Te),I.setStencilMode(Se),I.setColorMode(Ie),I.setCullFace(ot),Ct){I.activeTexture.set(gt.TEXTURE2),gt.bindTexture(gt.TEXTURE_2D,Ct.depthTexture),I.activeTexture.set(gt.TEXTURE3),gt.bindTexture(gt.TEXTURE_2D,Ct.texture);for(const Yt in this.terrainUniforms)this.terrainUniforms[Yt].set(Ct[Yt])}for(const Yt in this.fixedUniforms)this.fixedUniforms[Yt].set(yt[Yt]);Ze&&Ze.setUniforms(I,this.binderUniforms,Wr,{zoom:je});let Et=0;switch(ne){case gt.LINES:Et=2;break;case gt.TRIANGLES:Et=3;break;case gt.LINE_STRIP:Et=1}for(const Yt of Fr.get()){const rr=Yt.vaos||(Yt.vaos={});(rr[Wt]||(rr[Wt]=new Qt)).bind(I,this,nr,Ze?Ze.getPaintVertexBuffers():[],or,Yt.vertexOffset,at,lt,Tt),gt.drawElements(ne,Yt.primitiveLength*Et,gt.UNSIGNED_SHORT,Yt.primitiveOffset*Et*2)}}}function Sa(De,I,ne){const Te=1/da(ne,1,I.transform.tileZoom),Se=Math.pow(2,ne.tileID.overscaledZ),Ie=ne.tileSize*Math.pow(2,I.transform.tileZoom)/Se,ot=Ie*(ne.tileID.canonical.x+ne.tileID.wrap*Se),yt=Ie*ne.tileID.canonical.y;return{u_image:0,u_texsize:ne.imageAtlasTexture.size,u_scale:[Te,De.fromScale,De.toScale],u_fade:De.t,u_pixel_coord_upper:[ot>>16,yt>>16],u_pixel_coord_lower:[65535&ot,65535&yt]}}const ya=(De,I,ne,Te)=>{const Se=I.style.light,Ie=Se.properties.get("position"),ot=[Ie.x,Ie.y,Ie.z],yt=function(){var Wt=new t.A(9);return t.A!=Float32Array&&(Wt[1]=0,Wt[2]=0,Wt[3]=0,Wt[5]=0,Wt[6]=0,Wt[7]=0),Wt[0]=1,Wt[4]=1,Wt[8]=1,Wt}();Se.properties.get("anchor")==="viewport"&&function(Wt,nr){var or=Math.sin(nr),Fr=Math.cos(nr);Wt[0]=Fr,Wt[1]=or,Wt[2]=0,Wt[3]=-or,Wt[4]=Fr,Wt[5]=0,Wt[6]=0,Wt[7]=0,Wt[8]=1}(yt,-I.transform.angle),function(Wt,nr,or){var Fr=nr[0],Wr=nr[1],je=nr[2];Wt[0]=Fr*or[0]+Wr*or[3]+je*or[6],Wt[1]=Fr*or[1]+Wr*or[4]+je*or[7],Wt[2]=Fr*or[2]+Wr*or[5]+je*or[8]}(ot,ot,yt);const Ct=Se.properties.get("color");return{u_matrix:De,u_lightpos:ot,u_lightintensity:Se.properties.get("intensity"),u_lightcolor:[Ct.r,Ct.g,Ct.b],u_vertical_gradient:+ne,u_opacity:Te}},ra=(De,I,ne,Te,Se,Ie,ot)=>t.e(ya(De,I,ne,Te),Sa(Ie,I,ot),{u_height_factor:-Math.pow(2,Se.overscaledZ)/ot.tileSize/8}),pa=De=>({u_matrix:De}),pn=(De,I,ne,Te)=>t.e(pa(De),Sa(ne,I,Te)),Ga=(De,I)=>({u_matrix:De,u_world:I}),qn=(De,I,ne,Te,Se)=>t.e(pn(De,I,ne,Te),{u_world:Se}),Vn=(De,I,ne,Te)=>{const Se=De.transform;let Ie,ot;if(Te.paint.get("circle-pitch-alignment")==="map"){const yt=da(ne,1,Se.zoom);Ie=!0,ot=[yt,yt]}else Ie=!1,ot=Se.pixelsToGLUnits;return{u_camera_to_center_distance:Se.cameraToCenterDistance,u_scale_with_map:+(Te.paint.get("circle-pitch-scale")==="map"),u_matrix:De.translatePosMatrix(I.posMatrix,ne,Te.paint.get("circle-translate"),Te.paint.get("circle-translate-anchor")),u_pitch_with_map:+Ie,u_device_pixel_ratio:De.pixelRatio,u_extrude_scale:ot}},di=(De,I,ne)=>({u_matrix:De,u_inv_matrix:I,u_camera_to_center_distance:ne.cameraToCenterDistance,u_viewport_size:[ne.width,ne.height]}),yi=(De,I,ne=1)=>({u_matrix:De,u_color:I,u_overlay:0,u_overlay_scale:ne}),Ci=De=>({u_matrix:De}),ci=(De,I,ne,Te)=>({u_matrix:De,u_extrude_scale:da(I,1,ne),u_intensity:Te}),ei=(De,I,ne,Te)=>{const Se=t.H();t.aP(Se,0,De.width,De.height,0,0,1);const Ie=De.context.gl;return{u_matrix:Se,u_world:[Ie.drawingBufferWidth,Ie.drawingBufferHeight],u_image:ne,u_color_ramp:Te,u_opacity:I.paint.get("heatmap-opacity")}};function mi(De,I){const ne=Math.pow(2,I.canonical.z),Te=I.canonical.y;return[new t.Z(0,Te/ne).toLngLat().lat,new t.Z(0,(Te+1)/ne).toLngLat().lat]}const uo=(De,I,ne,Te)=>{const Se=De.transform;return{u_matrix:xi(De,I,ne,Te),u_ratio:1/da(I,1,Se.zoom),u_device_pixel_ratio:De.pixelRatio,u_units_to_pixels:[1/Se.pixelsToGLUnits[0],1/Se.pixelsToGLUnits[1]]}},Lo=(De,I,ne,Te,Se)=>t.e(uo(De,I,ne,Se),{u_image:0,u_image_height:Te}),Wo=(De,I,ne,Te,Se)=>{const Ie=De.transform,ot=Ii(I,Ie);return{u_matrix:xi(De,I,ne,Se),u_texsize:I.imageAtlasTexture.size,u_ratio:1/da(I,1,Ie.zoom),u_device_pixel_ratio:De.pixelRatio,u_image:0,u_scale:[ot,Te.fromScale,Te.toScale],u_fade:Te.t,u_units_to_pixels:[1/Ie.pixelsToGLUnits[0],1/Ie.pixelsToGLUnits[1]]}},li=(De,I,ne,Te,Se,Ie)=>{const ot=De.lineAtlas,yt=Ii(I,De.transform),Ct=ne.layout.get("line-cap")==="round",Wt=ot.getDash(Te.from,Ct),nr=ot.getDash(Te.to,Ct),or=Wt.width*Se.fromScale,Fr=nr.width*Se.toScale;return t.e(uo(De,I,ne,Ie),{u_patternscale_a:[yt/or,-Wt.height/2],u_patternscale_b:[yt/Fr,-nr.height/2],u_sdfgamma:ot.width/(256*Math.min(or,Fr)*De.pixelRatio)/2,u_image:0,u_tex_y_a:Wt.y,u_tex_y_b:nr.y,u_mix:Se.t})};function Ii(De,I){return 1/da(De,1,I.tileZoom)}function xi(De,I,ne,Te){return De.translatePosMatrix(Te?Te.posMatrix:I.tileID.posMatrix,I,ne.paint.get("line-translate"),ne.paint.get("line-translate-anchor"))}const Ao=(De,I,ne,Te,Se)=>{return{u_matrix:De,u_tl_parent:I,u_scale_parent:ne,u_buffer_scale:1,u_fade_t:Te.mix,u_opacity:Te.opacity*Se.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:Se.paint.get("raster-brightness-min"),u_brightness_high:Se.paint.get("raster-brightness-max"),u_saturation_factor:(ot=Se.paint.get("raster-saturation"),ot>0?1-1/(1.001-ot):-ot),u_contrast_factor:(Ie=Se.paint.get("raster-contrast"),Ie>0?1/(1-Ie):1+Ie),u_spin_weights:So(Se.paint.get("raster-hue-rotate"))};var Ie,ot};function So(De){De*=Math.PI/180;const I=Math.sin(De),ne=Math.cos(De);return[(2*ne+1)/3,(-Math.sqrt(3)*I-ne+1)/3,(Math.sqrt(3)*I-ne+1)/3]}const Ro=(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr)=>{const je=ot.transform;return{u_is_size_zoom_constant:+(De==="constant"||De==="source"),u_is_size_feature_constant:+(De==="constant"||De==="camera"),u_size_t:I?I.uSizeT:0,u_size:I?I.uSize:0,u_camera_to_center_distance:je.cameraToCenterDistance,u_pitch:je.pitch/360*2*Math.PI,u_rotate_symbol:+ne,u_aspect_ratio:je.width/je.height,u_fade_change:ot.options.fadeDuration?ot.symbolFadeChange:1,u_matrix:yt,u_label_plane_matrix:Ct,u_coord_matrix:Wt,u_is_text:+or,u_pitch_with_map:+Te,u_is_along_line:Se,u_is_variable_anchor:Ie,u_texsize:Fr,u_texture:0,u_translation:nr,u_pitched_scale:Wr}},Li=(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr,je)=>{const Ze=ot.transform;return t.e(Ro(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,je),{u_gamma_scale:Te?Math.cos(Ze._pitch)*Ze.cameraToCenterDistance:1,u_device_pixel_ratio:ot.pixelRatio,u_is_halo:+Wr})},Yi=(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,or,Fr,Wr)=>t.e(Li(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt,nr,!0,or,!0,Wr),{u_texsize_icon:Fr,u_texture_icon:1}),bs=(De,I,ne)=>({u_matrix:De,u_opacity:I,u_color:ne}),as=(De,I,ne,Te,Se,Ie)=>t.e(function(ot,yt,Ct,Wt){const nr=Ct.imageManager.getPattern(ot.from.toString()),or=Ct.imageManager.getPattern(ot.to.toString()),{width:Fr,height:Wr}=Ct.imageManager.getPixelSize(),je=Math.pow(2,Wt.tileID.overscaledZ),Ze=Wt.tileSize*Math.pow(2,Ct.transform.tileZoom)/je,at=Ze*(Wt.tileID.canonical.x+Wt.tileID.wrap*je),lt=Ze*Wt.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:nr.tl,u_pattern_br_a:nr.br,u_pattern_tl_b:or.tl,u_pattern_br_b:or.br,u_texsize:[Fr,Wr],u_mix:yt.t,u_pattern_size_a:nr.displaySize,u_pattern_size_b:or.displaySize,u_scale_a:yt.fromScale,u_scale_b:yt.toScale,u_tile_units_to_pixels:1/da(Wt,1,Ct.transform.tileZoom),u_pixel_coord_upper:[at>>16,lt>>16],u_pixel_coord_lower:[65535&at,65535<]}}(Te,Ie,ne,Se),{u_matrix:De,u_opacity:I}),fs={fillExtrusion:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_lightpos:new t.aN(De,I.u_lightpos),u_lightintensity:new t.aI(De,I.u_lightintensity),u_lightcolor:new t.aN(De,I.u_lightcolor),u_vertical_gradient:new t.aI(De,I.u_vertical_gradient),u_opacity:new t.aI(De,I.u_opacity)}),fillExtrusionPattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_lightpos:new t.aN(De,I.u_lightpos),u_lightintensity:new t.aI(De,I.u_lightintensity),u_lightcolor:new t.aN(De,I.u_lightcolor),u_vertical_gradient:new t.aI(De,I.u_vertical_gradient),u_height_factor:new t.aI(De,I.u_height_factor),u_image:new t.aH(De,I.u_image),u_texsize:new t.aO(De,I.u_texsize),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade),u_opacity:new t.aI(De,I.u_opacity)}),fill:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix)}),fillPattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_image:new t.aH(De,I.u_image),u_texsize:new t.aO(De,I.u_texsize),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade)}),fillOutline:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_world:new t.aO(De,I.u_world)}),fillOutlinePattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_world:new t.aO(De,I.u_world),u_image:new t.aH(De,I.u_image),u_texsize:new t.aO(De,I.u_texsize),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade)}),circle:(De,I)=>({u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_scale_with_map:new t.aH(De,I.u_scale_with_map),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_extrude_scale:new t.aO(De,I.u_extrude_scale),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_matrix:new t.aJ(De,I.u_matrix)}),collisionBox:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_pixel_extrude_scale:new t.aO(De,I.u_pixel_extrude_scale)}),collisionCircle:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_inv_matrix:new t.aJ(De,I.u_inv_matrix),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_viewport_size:new t.aO(De,I.u_viewport_size)}),debug:(De,I)=>({u_color:new t.aL(De,I.u_color),u_matrix:new t.aJ(De,I.u_matrix),u_overlay:new t.aH(De,I.u_overlay),u_overlay_scale:new t.aI(De,I.u_overlay_scale)}),clippingMask:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix)}),heatmap:(De,I)=>({u_extrude_scale:new t.aI(De,I.u_extrude_scale),u_intensity:new t.aI(De,I.u_intensity),u_matrix:new t.aJ(De,I.u_matrix)}),heatmapTexture:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_world:new t.aO(De,I.u_world),u_image:new t.aH(De,I.u_image),u_color_ramp:new t.aH(De,I.u_color_ramp),u_opacity:new t.aI(De,I.u_opacity)}),hillshade:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_image:new t.aH(De,I.u_image),u_latrange:new t.aO(De,I.u_latrange),u_light:new t.aO(De,I.u_light),u_shadow:new t.aL(De,I.u_shadow),u_highlight:new t.aL(De,I.u_highlight),u_accent:new t.aL(De,I.u_accent)}),hillshadePrepare:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_image:new t.aH(De,I.u_image),u_dimension:new t.aO(De,I.u_dimension),u_zoom:new t.aI(De,I.u_zoom),u_unpack:new t.aK(De,I.u_unpack)}),line:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels)}),lineGradient:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels),u_image:new t.aH(De,I.u_image),u_image_height:new t.aI(De,I.u_image_height)}),linePattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_texsize:new t.aO(De,I.u_texsize),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_image:new t.aH(De,I.u_image),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels),u_scale:new t.aN(De,I.u_scale),u_fade:new t.aI(De,I.u_fade)}),lineSDF:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ratio:new t.aI(De,I.u_ratio),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_units_to_pixels:new t.aO(De,I.u_units_to_pixels),u_patternscale_a:new t.aO(De,I.u_patternscale_a),u_patternscale_b:new t.aO(De,I.u_patternscale_b),u_sdfgamma:new t.aI(De,I.u_sdfgamma),u_image:new t.aH(De,I.u_image),u_tex_y_a:new t.aI(De,I.u_tex_y_a),u_tex_y_b:new t.aI(De,I.u_tex_y_b),u_mix:new t.aI(De,I.u_mix)}),raster:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_tl_parent:new t.aO(De,I.u_tl_parent),u_scale_parent:new t.aI(De,I.u_scale_parent),u_buffer_scale:new t.aI(De,I.u_buffer_scale),u_fade_t:new t.aI(De,I.u_fade_t),u_opacity:new t.aI(De,I.u_opacity),u_image0:new t.aH(De,I.u_image0),u_image1:new t.aH(De,I.u_image1),u_brightness_low:new t.aI(De,I.u_brightness_low),u_brightness_high:new t.aI(De,I.u_brightness_high),u_saturation_factor:new t.aI(De,I.u_saturation_factor),u_contrast_factor:new t.aI(De,I.u_contrast_factor),u_spin_weights:new t.aN(De,I.u_spin_weights)}),symbolIcon:(De,I)=>({u_is_size_zoom_constant:new t.aH(De,I.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(De,I.u_is_size_feature_constant),u_size_t:new t.aI(De,I.u_size_t),u_size:new t.aI(De,I.u_size),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_pitch:new t.aI(De,I.u_pitch),u_rotate_symbol:new t.aH(De,I.u_rotate_symbol),u_aspect_ratio:new t.aI(De,I.u_aspect_ratio),u_fade_change:new t.aI(De,I.u_fade_change),u_matrix:new t.aJ(De,I.u_matrix),u_label_plane_matrix:new t.aJ(De,I.u_label_plane_matrix),u_coord_matrix:new t.aJ(De,I.u_coord_matrix),u_is_text:new t.aH(De,I.u_is_text),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_is_along_line:new t.aH(De,I.u_is_along_line),u_is_variable_anchor:new t.aH(De,I.u_is_variable_anchor),u_texsize:new t.aO(De,I.u_texsize),u_texture:new t.aH(De,I.u_texture),u_translation:new t.aO(De,I.u_translation),u_pitched_scale:new t.aI(De,I.u_pitched_scale)}),symbolSDF:(De,I)=>({u_is_size_zoom_constant:new t.aH(De,I.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(De,I.u_is_size_feature_constant),u_size_t:new t.aI(De,I.u_size_t),u_size:new t.aI(De,I.u_size),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_pitch:new t.aI(De,I.u_pitch),u_rotate_symbol:new t.aH(De,I.u_rotate_symbol),u_aspect_ratio:new t.aI(De,I.u_aspect_ratio),u_fade_change:new t.aI(De,I.u_fade_change),u_matrix:new t.aJ(De,I.u_matrix),u_label_plane_matrix:new t.aJ(De,I.u_label_plane_matrix),u_coord_matrix:new t.aJ(De,I.u_coord_matrix),u_is_text:new t.aH(De,I.u_is_text),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_is_along_line:new t.aH(De,I.u_is_along_line),u_is_variable_anchor:new t.aH(De,I.u_is_variable_anchor),u_texsize:new t.aO(De,I.u_texsize),u_texture:new t.aH(De,I.u_texture),u_gamma_scale:new t.aI(De,I.u_gamma_scale),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_is_halo:new t.aH(De,I.u_is_halo),u_translation:new t.aO(De,I.u_translation),u_pitched_scale:new t.aI(De,I.u_pitched_scale)}),symbolTextAndIcon:(De,I)=>({u_is_size_zoom_constant:new t.aH(De,I.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(De,I.u_is_size_feature_constant),u_size_t:new t.aI(De,I.u_size_t),u_size:new t.aI(De,I.u_size),u_camera_to_center_distance:new t.aI(De,I.u_camera_to_center_distance),u_pitch:new t.aI(De,I.u_pitch),u_rotate_symbol:new t.aH(De,I.u_rotate_symbol),u_aspect_ratio:new t.aI(De,I.u_aspect_ratio),u_fade_change:new t.aI(De,I.u_fade_change),u_matrix:new t.aJ(De,I.u_matrix),u_label_plane_matrix:new t.aJ(De,I.u_label_plane_matrix),u_coord_matrix:new t.aJ(De,I.u_coord_matrix),u_is_text:new t.aH(De,I.u_is_text),u_pitch_with_map:new t.aH(De,I.u_pitch_with_map),u_is_along_line:new t.aH(De,I.u_is_along_line),u_is_variable_anchor:new t.aH(De,I.u_is_variable_anchor),u_texsize:new t.aO(De,I.u_texsize),u_texsize_icon:new t.aO(De,I.u_texsize_icon),u_texture:new t.aH(De,I.u_texture),u_texture_icon:new t.aH(De,I.u_texture_icon),u_gamma_scale:new t.aI(De,I.u_gamma_scale),u_device_pixel_ratio:new t.aI(De,I.u_device_pixel_ratio),u_is_halo:new t.aH(De,I.u_is_halo),u_translation:new t.aO(De,I.u_translation),u_pitched_scale:new t.aI(De,I.u_pitched_scale)}),background:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_opacity:new t.aI(De,I.u_opacity),u_color:new t.aL(De,I.u_color)}),backgroundPattern:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_opacity:new t.aI(De,I.u_opacity),u_image:new t.aH(De,I.u_image),u_pattern_tl_a:new t.aO(De,I.u_pattern_tl_a),u_pattern_br_a:new t.aO(De,I.u_pattern_br_a),u_pattern_tl_b:new t.aO(De,I.u_pattern_tl_b),u_pattern_br_b:new t.aO(De,I.u_pattern_br_b),u_texsize:new t.aO(De,I.u_texsize),u_mix:new t.aI(De,I.u_mix),u_pattern_size_a:new t.aO(De,I.u_pattern_size_a),u_pattern_size_b:new t.aO(De,I.u_pattern_size_b),u_scale_a:new t.aI(De,I.u_scale_a),u_scale_b:new t.aI(De,I.u_scale_b),u_pixel_coord_upper:new t.aO(De,I.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(De,I.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(De,I.u_tile_units_to_pixels)}),terrain:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_texture:new t.aH(De,I.u_texture),u_ele_delta:new t.aI(De,I.u_ele_delta),u_fog_matrix:new t.aJ(De,I.u_fog_matrix),u_fog_color:new t.aL(De,I.u_fog_color),u_fog_ground_blend:new t.aI(De,I.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(De,I.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(De,I.u_horizon_color),u_horizon_fog_blend:new t.aI(De,I.u_horizon_fog_blend)}),terrainDepth:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_ele_delta:new t.aI(De,I.u_ele_delta)}),terrainCoords:(De,I)=>({u_matrix:new t.aJ(De,I.u_matrix),u_texture:new t.aH(De,I.u_texture),u_terrain_coords_id:new t.aI(De,I.u_terrain_coords_id),u_ele_delta:new t.aI(De,I.u_ele_delta)}),sky:(De,I)=>({u_sky_color:new t.aL(De,I.u_sky_color),u_horizon_color:new t.aL(De,I.u_horizon_color),u_horizon:new t.aI(De,I.u_horizon),u_sky_horizon_blend:new t.aI(De,I.u_sky_horizon_blend)})};class Co{constructor(I,ne,Te){this.context=I;const Se=I.gl;this.buffer=Se.createBuffer(),this.dynamicDraw=!!Te,this.context.unbindVAO(),I.bindElementBuffer.set(this.buffer),Se.bufferData(Se.ELEMENT_ARRAY_BUFFER,ne.arrayBuffer,this.dynamicDraw?Se.DYNAMIC_DRAW:Se.STATIC_DRAW),this.dynamicDraw||delete ne.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(I){const ne=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),ne.bufferSubData(ne.ELEMENT_ARRAY_BUFFER,0,I.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Qa={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Jn{constructor(I,ne,Te,Se){this.length=ne.length,this.attributes=Te,this.itemSize=ne.bytesPerElement,this.dynamicDraw=Se,this.context=I;const Ie=I.gl;this.buffer=Ie.createBuffer(),I.bindVertexBuffer.set(this.buffer),Ie.bufferData(Ie.ARRAY_BUFFER,ne.arrayBuffer,this.dynamicDraw?Ie.DYNAMIC_DRAW:Ie.STATIC_DRAW),this.dynamicDraw||delete ne.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(I){if(I.length!==this.length)throw new Error(`Length of new data is ${I.length}, which doesn't match current length of ${this.length}`);const ne=this.context.gl;this.bind(),ne.bufferSubData(ne.ARRAY_BUFFER,0,I.arrayBuffer)}enableAttributes(I,ne){for(let Te=0;Te0){const rr=t.H();t.aQ(rr,gt.placementInvProjMatrix,De.transform.glCoordMatrix),t.aQ(rr,rr,gt.placementViewportMatrix),Ct.push({circleArray:Yt,circleOffset:nr,transform:Tt.posMatrix,invTransform:rr,coord:Tt}),Wt+=Yt.length/4,nr=Wt}Et&&yt.draw(Ie,ot.LINES,Eo.disabled,is.disabled,De.colorModeForRenderPass(),oo.disabled,{u_matrix:Tt.posMatrix,u_pixel_extrude_scale:[1/(or=De.transform).width,1/or.height]},De.style.map.terrain&&De.style.map.terrain.getTerrainData(Tt),ne.id,Et.layoutVertexBuffer,Et.indexBuffer,Et.segments,null,De.transform.zoom,null,null,Et.collisionVertexBuffer)}var or;if(!Se||!Ct.length)return;const Fr=De.useProgram("collisionCircle"),Wr=new t.aR;Wr.resize(4*Wt),Wr._trim();let je=0;for(const lt of Ct)for(let Tt=0;Tt=0&&(lt[gt.associatedIconIndex]={shiftedAnchor:Nn,angle:pi})}else qt(gt.numGlyphs,Ze)}if(Wt){at.clear();const Tt=De.icon.placedSymbolArray;for(let gt=0;gtDe.style.map.terrain.getElevation(ia,aa,Ua):null,Kr=ne.layout.get("text-rotation-alignment")==="map";Oe(za,ia.posMatrix,De,Se,Al,pe,lt,Wt,Kr,Ze,ia.toUnwrapped(),je.width,je.height,Le,Vr)}const ht=ia.posMatrix,xt=Se&&Sr||ut,zt=Tt||xt?zl:Al,Dt=pu,$t=ln&&ne.paint.get(Se?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Cr;Cr=ln?za.iconsInText?Yi(Nn.kind,Gi,gt,lt,Tt,xt,De,ht,zt,Dt,Le,No,zs,Qr):Li(Nn.kind,Gi,gt,lt,Tt,xt,De,ht,zt,Dt,Le,Se,No,!0,Qr):Ro(Nn.kind,Gi,gt,lt,Tt,xt,De,ht,zt,Dt,Le,Se,No,Qr);const Ar={program:ii,buffers:nn,uniformValues:Cr,atlasTexture:po,atlasTextureIcon:xo,atlasInterpolation:Zo,atlasInterpolationIcon:Hs,isSDF:ln,hasHalo:$t};if(Yt&&za.canOverlap){rr=!0;const Vr=nn.segments.get();for(const Kr of Vr)Nr.push({segments:new t.a0([Kr]),sortKey:Kr.sortKey,state:Ar,terrainData:Bo})}else Nr.push({segments:nn.segments,sortKey:0,state:Ar,terrainData:Bo})}rr&&Nr.sort((ia,_a)=>ia.sortKey-_a.sortKey);for(const ia of Nr){const _a=ia.state;if(Fr.activeTexture.set(Wr.TEXTURE0),_a.atlasTexture.bind(_a.atlasInterpolation,Wr.CLAMP_TO_EDGE),_a.atlasTextureIcon&&(Fr.activeTexture.set(Wr.TEXTURE1),_a.atlasTextureIcon&&_a.atlasTextureIcon.bind(_a.atlasInterpolationIcon,Wr.CLAMP_TO_EDGE)),_a.isSDF){const za=_a.uniformValues;_a.hasHalo&&(za.u_is_halo=1,Jc(_a.buffers,ia.segments,ne,De,_a.program,sr,nr,or,za,ia.terrainData)),za.u_is_halo=0}Jc(_a.buffers,ia.segments,ne,De,_a.program,sr,nr,or,_a.uniformValues,ia.terrainData)}}function Jc(De,I,ne,Te,Se,Ie,ot,yt,Ct,Wt){const nr=Te.context;Se.draw(nr,nr.gl.TRIANGLES,Ie,ot,yt,oo.disabled,Ct,Wt,ne.id,De.layoutVertexBuffer,De.indexBuffer,I,ne.paint,Te.transform.zoom,De.programConfigurations.get(ne.id),De.dynamicLayoutVertexBuffer,De.opacityVertexBuffer)}function Uc(De,I,ne,Te){const Se=De.context,Ie=Se.gl,ot=is.disabled,yt=new Bs([Ie.ONE,Ie.ONE],t.aM.transparent,[!0,!0,!0,!0]),Ct=I.getBucket(ne);if(!Ct)return;const Wt=Te.key;let nr=ne.heatmapFbos.get(Wt);nr||(nr=jc(Se,I.tileSize,I.tileSize),ne.heatmapFbos.set(Wt,nr)),Se.bindFramebuffer.set(nr.framebuffer),Se.viewport.set([0,0,I.tileSize,I.tileSize]),Se.clear({color:t.aM.transparent});const or=Ct.programConfigurations.get(ne.id),Fr=De.useProgram("heatmap",or),Wr=De.style.map.terrain.getTerrainData(Te);Fr.draw(Se,Ie.TRIANGLES,Eo.disabled,ot,yt,oo.disabled,ci(Te.posMatrix,I,De.transform.zoom,ne.paint.get("heatmap-intensity")),Wr,ne.id,Ct.layoutVertexBuffer,Ct.indexBuffer,Ct.segments,ne.paint,De.transform.zoom,or)}function $u(De,I,ne){const Te=De.context,Se=Te.gl;Te.setColorMode(De.colorModeForRenderPass());const Ie=$c(Te,I),ot=ne.key,yt=I.heatmapFbos.get(ot);yt&&(Te.activeTexture.set(Se.TEXTURE0),Se.bindTexture(Se.TEXTURE_2D,yt.colorAttachment.get()),Te.activeTexture.set(Se.TEXTURE1),Ie.bind(Se.LINEAR,Se.CLAMP_TO_EDGE),De.useProgram("heatmapTexture").draw(Te,Se.TRIANGLES,Eo.disabled,is.disabled,De.colorModeForRenderPass(),oo.disabled,ei(De,I,0,1),null,I.id,De.rasterBoundsBuffer,De.quadTriangleIndexBuffer,De.rasterBoundsSegments,I.paint,De.transform.zoom),yt.destroy(),I.heatmapFbos.delete(ot))}function jc(De,I,ne){var Te,Se;const Ie=De.gl,ot=Ie.createTexture();Ie.bindTexture(Ie.TEXTURE_2D,ot),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_WRAP_S,Ie.CLAMP_TO_EDGE),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_WRAP_T,Ie.CLAMP_TO_EDGE),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_MIN_FILTER,Ie.LINEAR),Ie.texParameteri(Ie.TEXTURE_2D,Ie.TEXTURE_MAG_FILTER,Ie.LINEAR);const yt=(Te=De.HALF_FLOAT)!==null&&Te!==void 0?Te:Ie.UNSIGNED_BYTE,Ct=(Se=De.RGBA16F)!==null&&Se!==void 0?Se:Ie.RGBA;Ie.texImage2D(Ie.TEXTURE_2D,0,Ct,I,ne,0,Ie.RGBA,yt,null);const Wt=De.createFramebuffer(I,ne,!1,!1);return Wt.colorAttachment.set(ot),Wt}function $c(De,I){return I.colorRampTexture||(I.colorRampTexture=new u(De,I.colorRamp,De.gl.RGBA)),I.colorRampTexture}function bu(De,I,ne,Te,Se){if(!ne||!Te||!Te.imageAtlas)return;const Ie=Te.imageAtlas.patternPositions;let ot=Ie[ne.to.toString()],yt=Ie[ne.from.toString()];if(!ot&&yt&&(ot=yt),!yt&&ot&&(yt=ot),!ot||!yt){const Ct=Se.getPaintProperty(I);ot=Ie[Ct],yt=Ie[Ct]}ot&&yt&&De.setConstantPatternPositions(ot,yt)}function Qc(De,I,ne,Te,Se,Ie,ot){const yt=De.context.gl,Ct="fill-pattern",Wt=ne.paint.get(Ct),nr=Wt&&Wt.constantOr(1),or=ne.getCrossfadeParameters();let Fr,Wr,je,Ze,at;ot?(Wr=nr&&!ne.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Fr=yt.LINES):(Wr=nr?"fillPattern":"fill",Fr=yt.TRIANGLES);const lt=Wt.constantOr(null);for(const Tt of Te){const gt=I.getTile(Tt);if(nr&&!gt.patternsLoaded())continue;const Et=gt.getBucket(ne);if(!Et)continue;const Yt=Et.programConfigurations.get(ne.id),rr=De.useProgram(Wr,Yt),sr=De.style.map.terrain&&De.style.map.terrain.getTerrainData(Tt);nr&&(De.context.activeTexture.set(yt.TEXTURE0),gt.imageAtlasTexture.bind(yt.LINEAR,yt.CLAMP_TO_EDGE),Yt.updatePaintBuffers(or)),bu(Yt,Ct,lt,gt,ne);const Sr=sr?Tt:null,Nr=De.translatePosMatrix(Sr?Sr.posMatrix:Tt.posMatrix,gt,ne.paint.get("fill-translate"),ne.paint.get("fill-translate-anchor"));if(ot){Ze=Et.indexBuffer2,at=Et.segments2;const Qr=[yt.drawingBufferWidth,yt.drawingBufferHeight];je=Wr==="fillOutlinePattern"&&nr?qn(Nr,De,or,gt,Qr):Ga(Nr,Qr)}else Ze=Et.indexBuffer,at=Et.segments,je=nr?pn(Nr,De,or,gt):pa(Nr);rr.draw(De.context,Fr,Se,De.stencilModeForClipping(Tt),Ie,oo.disabled,je,sr,ne.id,Et.layoutVertexBuffer,Ze,at,ne.paint,De.transform.zoom,Yt)}}function sc(De,I,ne,Te,Se,Ie,ot){const yt=De.context,Ct=yt.gl,Wt="fill-extrusion-pattern",nr=ne.paint.get(Wt),or=nr.constantOr(1),Fr=ne.getCrossfadeParameters(),Wr=ne.paint.get("fill-extrusion-opacity"),je=nr.constantOr(null);for(const Ze of Te){const at=I.getTile(Ze),lt=at.getBucket(ne);if(!lt)continue;const Tt=De.style.map.terrain&&De.style.map.terrain.getTerrainData(Ze),gt=lt.programConfigurations.get(ne.id),Et=De.useProgram(or?"fillExtrusionPattern":"fillExtrusion",gt);or&&(De.context.activeTexture.set(Ct.TEXTURE0),at.imageAtlasTexture.bind(Ct.LINEAR,Ct.CLAMP_TO_EDGE),gt.updatePaintBuffers(Fr)),bu(gt,Wt,je,at,ne);const Yt=De.translatePosMatrix(Ze.posMatrix,at,ne.paint.get("fill-extrusion-translate"),ne.paint.get("fill-extrusion-translate-anchor")),rr=ne.paint.get("fill-extrusion-vertical-gradient"),sr=or?ra(Yt,De,rr,Wr,Ze,Fr,at):ya(Yt,De,rr,Wr);Et.draw(yt,yt.gl.TRIANGLES,Se,Ie,ot,oo.backCCW,sr,Tt,ne.id,lt.layoutVertexBuffer,lt.indexBuffer,lt.segments,ne.paint,De.transform.zoom,gt,De.style.map.terrain&<.centroidVertexBuffer)}}function wu(De,I,ne,Te,Se,Ie,ot){const yt=De.context,Ct=yt.gl,Wt=ne.fbo;if(!Wt)return;const nr=De.useProgram("hillshade"),or=De.style.map.terrain&&De.style.map.terrain.getTerrainData(I);yt.activeTexture.set(Ct.TEXTURE0),Ct.bindTexture(Ct.TEXTURE_2D,Wt.colorAttachment.get()),nr.draw(yt,Ct.TRIANGLES,Se,Ie,ot,oo.disabled,((Fr,Wr,je,Ze)=>{const at=je.paint.get("hillshade-shadow-color"),lt=je.paint.get("hillshade-highlight-color"),Tt=je.paint.get("hillshade-accent-color");let gt=je.paint.get("hillshade-illumination-direction")*(Math.PI/180);je.paint.get("hillshade-illumination-anchor")==="viewport"&&(gt-=Fr.transform.angle);const Et=!Fr.options.moving;return{u_matrix:Ze?Ze.posMatrix:Fr.transform.calculatePosMatrix(Wr.tileID.toUnwrapped(),Et),u_image:0,u_latrange:mi(0,Wr.tileID),u_light:[je.paint.get("hillshade-exaggeration"),gt],u_shadow:at,u_highlight:lt,u_accent:Tt}})(De,ne,Te,or?I:null),or,Te.id,De.rasterBoundsBuffer,De.quadTriangleIndexBuffer,De.rasterBoundsSegments)}function eu(De,I,ne,Te,Se,Ie){const ot=De.context,yt=ot.gl,Ct=I.dem;if(Ct&&Ct.data){const Wt=Ct.dim,nr=Ct.stride,or=Ct.getPixels();if(ot.activeTexture.set(yt.TEXTURE1),ot.pixelStoreUnpackPremultiplyAlpha.set(!1),I.demTexture=I.demTexture||De.getTileTexture(nr),I.demTexture){const Wr=I.demTexture;Wr.update(or,{premultiply:!1}),Wr.bind(yt.NEAREST,yt.CLAMP_TO_EDGE)}else I.demTexture=new u(ot,or,yt.RGBA,{premultiply:!1}),I.demTexture.bind(yt.NEAREST,yt.CLAMP_TO_EDGE);ot.activeTexture.set(yt.TEXTURE0);let Fr=I.fbo;if(!Fr){const Wr=new u(ot,{width:Wt,height:Wt,data:null},yt.RGBA);Wr.bind(yt.LINEAR,yt.CLAMP_TO_EDGE),Fr=I.fbo=ot.createFramebuffer(Wt,Wt,!0,!1),Fr.colorAttachment.set(Wr.texture)}ot.bindFramebuffer.set(Fr.framebuffer),ot.viewport.set([0,0,Wt,Wt]),De.useProgram("hillshadePrepare").draw(ot,yt.TRIANGLES,Te,Se,Ie,oo.disabled,((Wr,je)=>{const Ze=je.stride,at=t.H();return t.aP(at,0,t.X,-t.X,0,0,1),t.J(at,at,[0,-t.X,0]),{u_matrix:at,u_image:1,u_dimension:[Ze,Ze],u_zoom:Wr.overscaledZ,u_unpack:je.getUnpackVector()}})(I.tileID,Ct),null,ne.id,De.rasterBoundsBuffer,De.quadTriangleIndexBuffer,De.rasterBoundsSegments),I.needsHillshadePrepare=!1}}function Sc(De,I,ne,Te,Se,Ie){const ot=Te.paint.get("raster-fade-duration");if(!Ie&&ot>0){const yt=i.now(),Ct=(yt-De.timeAdded)/ot,Wt=I?(yt-I.timeAdded)/ot:-1,nr=ne.getSource(),or=Se.coveringZoomLevel({tileSize:nr.tileSize,roundZoom:nr.roundZoom}),Fr=!I||Math.abs(I.tileID.overscaledZ-or)>Math.abs(De.tileID.overscaledZ-or),Wr=Fr&&De.refreshedUponExpiration?1:t.ac(Fr?Ct:1-Wt,0,1);return De.refreshedUponExpiration&&Ct>=1&&(De.refreshedUponExpiration=!1),I?{opacity:1,mix:1-Wr}:{opacity:Wr,mix:0}}return{opacity:1,mix:0}}const ef=new t.aM(1,0,0,1),ps=new t.aM(0,1,0,1),Vc=new t.aM(0,0,1,1),Zf=new t.aM(1,0,1,1),mf=new t.aM(0,1,1,1);function Mc(De,I,ne,Te){tu(De,0,I+ne/2,De.transform.width,ne,Te)}function _f(De,I,ne,Te){tu(De,I-ne/2,0,ne,De.transform.height,Te)}function tu(De,I,ne,Te,Se,Ie){const ot=De.context,yt=ot.gl;yt.enable(yt.SCISSOR_TEST),yt.scissor(I*De.pixelRatio,ne*De.pixelRatio,Te*De.pixelRatio,Se*De.pixelRatio),ot.clear({color:Ie}),yt.disable(yt.SCISSOR_TEST)}function xf(De,I,ne){const Te=De.context,Se=Te.gl,Ie=ne.posMatrix,ot=De.useProgram("debug"),yt=Eo.disabled,Ct=is.disabled,Wt=De.colorModeForRenderPass(),nr="$debug",or=De.style.map.terrain&&De.style.map.terrain.getTerrainData(ne);Te.activeTexture.set(Se.TEXTURE0);const Fr=I.getTileByID(ne.key).latestRawTileData,Wr=Math.floor((Fr&&Fr.byteLength||0)/1024),je=I.getTile(ne).tileSize,Ze=512/Math.min(je,512)*(ne.overscaledZ/De.transform.zoom)*.5;let at=ne.canonical.toString();ne.overscaledZ!==ne.canonical.z&&(at+=` => ${ne.overscaledZ}`),function(lt,Tt){lt.initDebugOverlayCanvas();const gt=lt.debugOverlayCanvas,Et=lt.context.gl,Yt=lt.debugOverlayCanvas.getContext("2d");Yt.clearRect(0,0,gt.width,gt.height),Yt.shadowColor="white",Yt.shadowBlur=2,Yt.lineWidth=1.5,Yt.strokeStyle="white",Yt.textBaseline="top",Yt.font="bold 36px Open Sans, sans-serif",Yt.fillText(Tt,5,5),Yt.strokeText(Tt,5,5),lt.debugOverlayTexture.update(gt),lt.debugOverlayTexture.bind(Et.LINEAR,Et.CLAMP_TO_EDGE)}(De,`${at} ${Wr}kB`),ot.draw(Te,Se.TRIANGLES,yt,Ct,Bs.alphaBlended,oo.disabled,yi(Ie,t.aM.transparent,Ze),null,nr,De.debugBuffer,De.quadTriangleIndexBuffer,De.debugSegments),ot.draw(Te,Se.LINE_STRIP,yt,Ct,Wt,oo.disabled,yi(Ie,t.aM.red),or,nr,De.debugBuffer,De.tileBorderIndexBuffer,De.debugSegments)}function Fl(De,I,ne){const Te=De.context,Se=Te.gl,Ie=De.colorModeForRenderPass(),ot=new Eo(Se.LEQUAL,Eo.ReadWrite,De.depthRangeFor3D),yt=De.useProgram("terrain"),Ct=I.getTerrainMesh();Te.bindFramebuffer.set(null),Te.viewport.set([0,0,De.width,De.height]);for(const Wt of ne){const nr=De.renderToTexture.getTexture(Wt),or=I.getTerrainData(Wt.tileID);Te.activeTexture.set(Se.TEXTURE0),Se.bindTexture(Se.TEXTURE_2D,nr.texture);const Fr=De.transform.calculatePosMatrix(Wt.tileID.toUnwrapped()),Wr=I.getMeshFrameDelta(De.transform.zoom),je=De.transform.calculateFogMatrix(Wt.tileID.toUnwrapped()),Ze=mr(Fr,Wr,je,De.style.sky,De.transform.pitch);yt.draw(Te,Se.TRIANGLES,ot,is.disabled,Ie,oo.backCCW,Ze,or,"terrain",Ct.vertexBuffer,Ct.indexBuffer,Ct.segments)}}class ru{constructor(I,ne,Te){this.vertexBuffer=I,this.indexBuffer=ne,this.segments=Te}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Uu{constructor(I,ne){this.context=new Gf(I),this.transform=ne,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=St.maxUnderzooming+St.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new kr}resize(I,ne,Te){if(this.width=Math.floor(I*Te),this.height=Math.floor(ne*Te),this.pixelRatio=Te,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const Se of this.style._order)this.style._layers[Se].resize()}setup(){const I=this.context,ne=new t.aX;ne.emplaceBack(0,0),ne.emplaceBack(t.X,0),ne.emplaceBack(0,t.X),ne.emplaceBack(t.X,t.X),this.tileExtentBuffer=I.createVertexBuffer(ne,Zr.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);const Te=new t.aX;Te.emplaceBack(0,0),Te.emplaceBack(t.X,0),Te.emplaceBack(0,t.X),Te.emplaceBack(t.X,t.X),this.debugBuffer=I.createVertexBuffer(Te,Zr.members),this.debugSegments=t.a0.simpleSegment(0,0,4,5);const Se=new t.$;Se.emplaceBack(0,0,0,0),Se.emplaceBack(t.X,0,t.X,0),Se.emplaceBack(0,t.X,0,t.X),Se.emplaceBack(t.X,t.X,t.X,t.X),this.rasterBoundsBuffer=I.createVertexBuffer(Se,qe.members),this.rasterBoundsSegments=t.a0.simpleSegment(0,0,4,2);const Ie=new t.aX;Ie.emplaceBack(0,0),Ie.emplaceBack(1,0),Ie.emplaceBack(0,1),Ie.emplaceBack(1,1),this.viewportBuffer=I.createVertexBuffer(Ie,Zr.members),this.viewportSegments=t.a0.simpleSegment(0,0,4,2);const ot=new t.aZ;ot.emplaceBack(0),ot.emplaceBack(1),ot.emplaceBack(3),ot.emplaceBack(2),ot.emplaceBack(0),this.tileBorderIndexBuffer=I.createIndexBuffer(ot);const yt=new t.aY;yt.emplaceBack(0,1,2),yt.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=I.createIndexBuffer(yt);const Ct=this.context.gl;this.stencilClearMode=new is({func:Ct.ALWAYS,mask:0},0,255,Ct.ZERO,Ct.ZERO,Ct.ZERO)}clearStencil(){const I=this.context,ne=I.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const Te=t.H();t.aP(Te,0,this.width,this.height,0,0,1),t.K(Te,Te,[ne.drawingBufferWidth,ne.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(I,ne.TRIANGLES,Eo.disabled,this.stencilClearMode,Bs.disabled,oo.disabled,Ci(Te),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(I,ne){if(this.currentStencilSource===I.source||!I.isTileClipped()||!ne||!ne.length)return;this.currentStencilSource=I.source;const Te=this.context,Se=Te.gl;this.nextStencilID+ne.length>256&&this.clearStencil(),Te.setColorMode(Bs.disabled),Te.setDepthMode(Eo.disabled);const Ie=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const ot of ne){const yt=this._tileClippingMaskIDs[ot.key]=this.nextStencilID++,Ct=this.style.map.terrain&&this.style.map.terrain.getTerrainData(ot);Ie.draw(Te,Se.TRIANGLES,Eo.disabled,new is({func:Se.ALWAYS,mask:0},yt,255,Se.KEEP,Se.KEEP,Se.REPLACE),Bs.disabled,oo.disabled,Ci(ot.posMatrix),Ct,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const I=this.nextStencilID++,ne=this.context.gl;return new is({func:ne.NOTEQUAL,mask:255},I,255,ne.KEEP,ne.KEEP,ne.REPLACE)}stencilModeForClipping(I){const ne=this.context.gl;return new is({func:ne.EQUAL,mask:255},this._tileClippingMaskIDs[I.key],0,ne.KEEP,ne.KEEP,ne.REPLACE)}stencilConfigForOverlap(I){const ne=this.context.gl,Te=I.sort((ot,yt)=>yt.overscaledZ-ot.overscaledZ),Se=Te[Te.length-1].overscaledZ,Ie=Te[0].overscaledZ-Se+1;if(Ie>1){this.currentStencilSource=void 0,this.nextStencilID+Ie>256&&this.clearStencil();const ot={};for(let yt=0;yt({u_sky_color:lt.properties.get("sky-color"),u_horizon_color:lt.properties.get("horizon-color"),u_horizon:(Tt.height/2+Tt.getHorizon())*gt,u_sky_horizon_blend:lt.properties.get("sky-horizon-blend")*Tt.height/2*gt}))(Wt,Ct.style.map.transform,Ct.pixelRatio),Wr=new Eo(or.LEQUAL,Eo.ReadWrite,[0,1]),je=is.disabled,Ze=Ct.colorModeForRenderPass(),at=Ct.useProgram("sky");if(!Wt.mesh){const lt=new t.aX;lt.emplaceBack(-1,-1),lt.emplaceBack(1,-1),lt.emplaceBack(1,1),lt.emplaceBack(-1,1);const Tt=new t.aY;Tt.emplaceBack(0,1,2),Tt.emplaceBack(0,2,3),Wt.mesh=new ru(nr.createVertexBuffer(lt,Zr.members),nr.createIndexBuffer(Tt),t.a0.simpleSegment(0,0,lt.length,Tt.length))}at.draw(nr,or.TRIANGLES,Wr,je,Ze,oo.disabled,Fr,void 0,"sky",Wt.mesh.vertexBuffer,Wt.mesh.indexBuffer,Wt.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=ne.showOverdrawInspector,this.depthRangeFor3D=[0,1-(I._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=Te.length-1;this.currentLayer>=0;this.currentLayer--){const Ct=this.style._layers[Te[this.currentLayer]],Wt=Se[Ct.source],nr=Ie[Ct.source];this._renderTileClippingMasks(Ct,nr),this.renderLayer(this,Wt,Ct,nr)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerat.source&&!at.isHidden(nr)?[Wt.sourceCaches[at.source]]:[]),Wr=Fr.filter(at=>at.getSource().type==="vector"),je=Fr.filter(at=>at.getSource().type!=="vector"),Ze=at=>{(!or||or.getSource().maxzoomZe(at)),or||je.forEach(at=>Ze(at)),or}(this.style,this.transform.zoom);Ct&&function(Wt,nr,or){for(let Fr=0;Fr0),Se&&(t.b0(ne,Te),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(Ie,ot){const yt=Ie.context,Ct=yt.gl,Wt=Bs.unblended,nr=new Eo(Ct.LEQUAL,Eo.ReadWrite,[0,1]),or=ot.getTerrainMesh(),Fr=ot.sourceCache.getRenderableTiles(),Wr=Ie.useProgram("terrainDepth");yt.bindFramebuffer.set(ot.getFramebuffer("depth").framebuffer),yt.viewport.set([0,0,Ie.width/devicePixelRatio,Ie.height/devicePixelRatio]),yt.clear({color:t.aM.transparent,depth:1});for(const je of Fr){const Ze=ot.getTerrainData(je.tileID),at={u_matrix:Ie.transform.calculatePosMatrix(je.tileID.toUnwrapped()),u_ele_delta:ot.getMeshFrameDelta(Ie.transform.zoom)};Wr.draw(yt,Ct.TRIANGLES,nr,is.disabled,Wt,oo.backCCW,at,Ze,"terrain",or.vertexBuffer,or.indexBuffer,or.segments)}yt.bindFramebuffer.set(null),yt.viewport.set([0,0,Ie.width,Ie.height])}(this,this.style.map.terrain),function(Ie,ot){const yt=Ie.context,Ct=yt.gl,Wt=Bs.unblended,nr=new Eo(Ct.LEQUAL,Eo.ReadWrite,[0,1]),or=ot.getTerrainMesh(),Fr=ot.getCoordsTexture(),Wr=ot.sourceCache.getRenderableTiles(),je=Ie.useProgram("terrainCoords");yt.bindFramebuffer.set(ot.getFramebuffer("coords").framebuffer),yt.viewport.set([0,0,Ie.width/devicePixelRatio,Ie.height/devicePixelRatio]),yt.clear({color:t.aM.transparent,depth:1}),ot.coordsIndex=[];for(const Ze of Wr){const at=ot.getTerrainData(Ze.tileID);yt.activeTexture.set(Ct.TEXTURE0),Ct.bindTexture(Ct.TEXTURE_2D,Fr.texture);const lt={u_matrix:Ie.transform.calculatePosMatrix(Ze.tileID.toUnwrapped()),u_terrain_coords_id:(255-ot.coordsIndex.length)/255,u_texture:0,u_ele_delta:ot.getMeshFrameDelta(Ie.transform.zoom)};je.draw(yt,Ct.TRIANGLES,nr,is.disabled,Wt,oo.backCCW,lt,at,"terrain",or.vertexBuffer,or.indexBuffer,or.segments),ot.coordsIndex.push(Ze.tileID.key)}yt.bindFramebuffer.set(null),yt.viewport.set([0,0,Ie.width,Ie.height])}(this,this.style.map.terrain))}renderLayer(I,ne,Te,Se){if(!Te.isHidden(this.transform.zoom)&&(Te.type==="background"||Te.type==="custom"||(Se||[]).length))switch(this.id=Te.id,Te.type){case"symbol":(function(Ie,ot,yt,Ct,Wt){if(Ie.renderPass!=="translucent")return;const nr=is.disabled,or=Ie.colorModeForRenderPass();(yt._unevaluatedLayout.hasValue("text-variable-anchor")||yt._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(Fr,Wr,je,Ze,at,lt,Tt,gt,Et){const Yt=Wr.transform,rr=Oa(),sr=at==="map",Sr=lt==="map";for(const Nr of Fr){const Qr=Ze.getTile(Nr),ia=Qr.getBucket(je);if(!ia||!ia.text||!ia.text.segments.get().length)continue;const _a=t.ag(ia.textSizeData,Yt.zoom),za=da(Qr,1,Wr.transform.zoom),nn=fr(Nr.posMatrix,Sr,sr,Wr.transform,za),en=je.layout.get("icon-text-fit")!=="none"&&ia.hasIconData();if(_a){const ln=Math.pow(2,Yt.zoom-Qr.tileID.overscaledZ),Nn=Wr.style.map.terrain?(ii,Gi)=>Wr.style.map.terrain.getElevation(Nr,ii,Gi):null,pi=rr.translatePosition(Yt,Qr,Tt,gt);gc(ia,sr,Sr,Et,Yt,nn,Nr.posMatrix,ln,_a,en,rr,pi,Nr.toUnwrapped(),Nn)}}}(Ct,Ie,yt,ot,yt.layout.get("text-rotation-alignment"),yt.layout.get("text-pitch-alignment"),yt.paint.get("text-translate"),yt.paint.get("text-translate-anchor"),Wt),yt.paint.get("icon-opacity").constantOr(1)!==0&&yf(Ie,ot,yt,Ct,!1,yt.paint.get("icon-translate"),yt.paint.get("icon-translate-anchor"),yt.layout.get("icon-rotation-alignment"),yt.layout.get("icon-pitch-alignment"),yt.layout.get("icon-keep-upright"),nr,or),yt.paint.get("text-opacity").constantOr(1)!==0&&yf(Ie,ot,yt,Ct,!0,yt.paint.get("text-translate"),yt.paint.get("text-translate-anchor"),yt.layout.get("text-rotation-alignment"),yt.layout.get("text-pitch-alignment"),yt.layout.get("text-keep-upright"),nr,or),ot.map.showCollisionBoxes&&(xu(Ie,ot,yt,Ct,!0),xu(Ie,ot,yt,Ct,!1))})(I,ne,Te,Se,this.style.placement.variableOffsets);break;case"circle":(function(Ie,ot,yt,Ct){if(Ie.renderPass!=="translucent")return;const Wt=yt.paint.get("circle-opacity"),nr=yt.paint.get("circle-stroke-width"),or=yt.paint.get("circle-stroke-opacity"),Fr=!yt.layout.get("circle-sort-key").isConstant();if(Wt.constantOr(1)===0&&(nr.constantOr(1)===0||or.constantOr(1)===0))return;const Wr=Ie.context,je=Wr.gl,Ze=Ie.depthModeForSublayer(0,Eo.ReadOnly),at=is.disabled,lt=Ie.colorModeForRenderPass(),Tt=[];for(let gt=0;gtgt.sortKey-Et.sortKey);for(const gt of Tt){const{programConfiguration:Et,program:Yt,layoutVertexBuffer:rr,indexBuffer:sr,uniformValues:Sr,terrainData:Nr}=gt.state;Yt.draw(Wr,je.TRIANGLES,Ze,at,lt,oo.disabled,Sr,Nr,yt.id,rr,sr,gt.segments,yt.paint,Ie.transform.zoom,Et)}})(I,ne,Te,Se);break;case"heatmap":(function(Ie,ot,yt,Ct){if(yt.paint.get("heatmap-opacity")===0)return;const Wt=Ie.context;if(Ie.style.map.terrain){for(const nr of Ct){const or=ot.getTile(nr);ot.hasRenderableParent(nr)||(Ie.renderPass==="offscreen"?Uc(Ie,or,yt,nr):Ie.renderPass==="translucent"&&$u(Ie,yt,nr))}Wt.viewport.set([0,0,Ie.width,Ie.height])}else Ie.renderPass==="offscreen"?function(nr,or,Fr,Wr){const je=nr.context,Ze=je.gl,at=is.disabled,lt=new Bs([Ze.ONE,Ze.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(Tt,gt,Et){const Yt=Tt.gl;Tt.activeTexture.set(Yt.TEXTURE1),Tt.viewport.set([0,0,gt.width/4,gt.height/4]);let rr=Et.heatmapFbos.get(t.aU);rr?(Yt.bindTexture(Yt.TEXTURE_2D,rr.colorAttachment.get()),Tt.bindFramebuffer.set(rr.framebuffer)):(rr=jc(Tt,gt.width/4,gt.height/4),Et.heatmapFbos.set(t.aU,rr))})(je,nr,Fr),je.clear({color:t.aM.transparent});for(let Tt=0;Tt20&&nr.texParameterf(nr.TEXTURE_2D,Wt.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,Wt.extTextureFilterAnisotropicMax);const ia=Ie.style.map.terrain&&Ie.style.map.terrain.getTerrainData(Tt),_a=ia?Tt:null,za=_a?_a.posMatrix:Ie.transform.calculatePosMatrix(Tt.toUnwrapped(),lt),nn=Ao(za,Nr||[0,0],Sr||1,sr,yt);or instanceof et?Fr.draw(Wt,nr.TRIANGLES,gt,is.disabled,Wr,oo.disabled,nn,ia,yt.id,or.boundsBuffer,Ie.quadTriangleIndexBuffer,or.boundsSegments):Fr.draw(Wt,nr.TRIANGLES,gt,je[Tt.overscaledZ],Wr,oo.disabled,nn,ia,yt.id,Ie.rasterBoundsBuffer,Ie.quadTriangleIndexBuffer,Ie.rasterBoundsSegments)}})(I,ne,Te,Se);break;case"background":(function(Ie,ot,yt,Ct){const Wt=yt.paint.get("background-color"),nr=yt.paint.get("background-opacity");if(nr===0)return;const or=Ie.context,Fr=or.gl,Wr=Ie.transform,je=Wr.tileSize,Ze=yt.paint.get("background-pattern");if(Ie.isPatternMissing(Ze))return;const at=!Ze&&Wt.a===1&&nr===1&&Ie.opaquePassEnabledForLayer()?"opaque":"translucent";if(Ie.renderPass!==at)return;const lt=is.disabled,Tt=Ie.depthModeForSublayer(0,at==="opaque"?Eo.ReadWrite:Eo.ReadOnly),gt=Ie.colorModeForRenderPass(),Et=Ie.useProgram(Ze?"backgroundPattern":"background"),Yt=Ct||Wr.coveringTiles({tileSize:je,terrain:Ie.style.map.terrain});Ze&&(or.activeTexture.set(Fr.TEXTURE0),Ie.imageManager.bind(Ie.context));const rr=yt.getCrossfadeParameters();for(const sr of Yt){const Sr=Ct?sr.posMatrix:Ie.transform.calculatePosMatrix(sr.toUnwrapped()),Nr=Ze?as(Sr,nr,Ie,Ze,{tileID:sr,tileSize:je},rr):bs(Sr,nr,Wt),Qr=Ie.style.map.terrain&&Ie.style.map.terrain.getTerrainData(sr);Et.draw(or,Fr.TRIANGLES,Tt,lt,gt,oo.disabled,Nr,Qr,yt.id,Ie.tileExtentBuffer,Ie.quadTriangleIndexBuffer,Ie.tileExtentSegments)}})(I,0,Te,Se);break;case"custom":(function(Ie,ot,yt){const Ct=Ie.context,Wt=yt.implementation;if(Ie.renderPass==="offscreen"){const nr=Wt.prerender;nr&&(Ie.setCustomLayerDefaults(),Ct.setColorMode(Ie.colorModeForRenderPass()),nr.call(Wt,Ct.gl,Ie.transform.customLayerMatrix()),Ct.setDirty(),Ie.setBaseState())}else if(Ie.renderPass==="translucent"){Ie.setCustomLayerDefaults(),Ct.setColorMode(Ie.colorModeForRenderPass()),Ct.setStencilMode(is.disabled);const nr=Wt.renderingMode==="3d"?new Eo(Ie.context.gl.LEQUAL,Eo.ReadWrite,Ie.depthRangeFor3D):Ie.depthModeForSublayer(0,Eo.ReadOnly);Ct.setDepthMode(nr),Wt.render(Ct.gl,Ie.transform.customLayerMatrix(),{farZ:Ie.transform.farZ,nearZ:Ie.transform.nearZ,fov:Ie.transform._fov,modelViewProjectionMatrix:Ie.transform.modelViewProjectionMatrix,projectionMatrix:Ie.transform.projectionMatrix}),Ct.setDirty(),Ie.setBaseState(),Ct.bindFramebuffer.set(null)}})(I,0,Te)}}translatePosMatrix(I,ne,Te,Se,Ie){if(!Te[0]&&!Te[1])return I;const ot=Ie?Se==="map"?this.transform.angle:0:Se==="viewport"?-this.transform.angle:0;if(ot){const Wt=Math.sin(ot),nr=Math.cos(ot);Te=[Te[0]*nr-Te[1]*Wt,Te[0]*Wt+Te[1]*nr]}const yt=[Ie?Te[0]:da(ne,Te[0],this.transform.zoom),Ie?Te[1]:da(ne,Te[1],this.transform.zoom),0],Ct=new Float32Array(16);return t.J(Ct,I,yt),Ct}saveTileTexture(I){const ne=this._tileTextures[I.size[0]];ne?ne.push(I):this._tileTextures[I.size[0]]=[I]}getTileTexture(I){const ne=this._tileTextures[I];return ne&&ne.length>0?ne.pop():null}isPatternMissing(I){if(!I)return!1;if(!I.from||!I.to)return!0;const ne=this.imageManager.getPattern(I.from.toString()),Te=this.imageManager.getPattern(I.to.toString());return!ne||!Te}useProgram(I,ne){this.cache=this.cache||{};const Te=I+(ne?ne.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[Te]||(this.cache[Te]=new oa(this.context,Jr[I],ne,fs[I],this._showOverdrawInspector,this.style.map.terrain)),this.cache[Te]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const 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)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new u(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:I,drawingBufferHeight:ne}=this.context.gl;return this.width!==I||this.height!==ne}}class $s{constructor(I,ne){this.points=I,this.planes=ne}static fromInvProjectionMatrix(I,ne,Te){const Se=Math.pow(2,Te),Ie=[[-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(yt=>{const Ct=1/(yt=t.af([],yt,I))[3]/ne*Se;return t.b1(yt,yt,[Ct,Ct,1/yt[3],Ct])}),ot=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(yt=>{const Ct=function(Fr,Wr){var je=Wr[0],Ze=Wr[1],at=Wr[2],lt=je*je+Ze*Ze+at*at;return lt>0&&(lt=1/Math.sqrt(lt)),Fr[0]=Wr[0]*lt,Fr[1]=Wr[1]*lt,Fr[2]=Wr[2]*lt,Fr}([],function(Fr,Wr,je){var Ze=Wr[0],at=Wr[1],lt=Wr[2],Tt=je[0],gt=je[1],Et=je[2];return Fr[0]=at*Et-lt*gt,Fr[1]=lt*Tt-Ze*Et,Fr[2]=Ze*gt-at*Tt,Fr}([],M([],Ie[yt[0]],Ie[yt[1]]),M([],Ie[yt[2]],Ie[yt[1]]))),Wt=-((nr=Ct)[0]*(or=Ie[yt[1]])[0]+nr[1]*or[1]+nr[2]*or[2]);var nr,or;return Ct.concat(Wt)});return new $s(Ie,ot)}}class Qu{constructor(I,ne){this.min=I,this.max=ne,this.center=function(Te,Se,Ie){return Te[0]=.5*Se[0],Te[1]=.5*Se[1],Te[2]=.5*Se[2],Te}([],function(Te,Se,Ie){return Te[0]=Se[0]+Ie[0],Te[1]=Se[1]+Ie[1],Te[2]=Se[2]+Ie[2],Te}([],this.min,this.max))}quadrant(I){const ne=[I%2==0,I<2],Te=b(this.min),Se=b(this.max);for(let Ie=0;Ie=0&&ot++;if(ot===0)return 0;ot!==ne.length&&(Te=!1)}if(Te)return 2;for(let Se=0;Se<3;Se++){let Ie=Number.MAX_VALUE,ot=-Number.MAX_VALUE;for(let yt=0;ytthis.max[Se]-this.min[Se])return 0}return 1}}class Tu{constructor(I=0,ne=0,Te=0,Se=0){if(isNaN(I)||I<0||isNaN(ne)||ne<0||isNaN(Te)||Te<0||isNaN(Se)||Se<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=I,this.bottom=ne,this.left=Te,this.right=Se}interpolate(I,ne,Te){return ne.top!=null&&I.top!=null&&(this.top=t.y.number(I.top,ne.top,Te)),ne.bottom!=null&&I.bottom!=null&&(this.bottom=t.y.number(I.bottom,ne.bottom,Te)),ne.left!=null&&I.left!=null&&(this.left=t.y.number(I.left,ne.left,Te)),ne.right!=null&&I.right!=null&&(this.right=t.y.number(I.right,ne.right,Te)),this}getCenter(I,ne){const Te=t.ac((this.left+I-this.right)/2,0,I),Se=t.ac((this.top+ne-this.bottom)/2,0,ne);return new t.P(Te,Se)}equals(I){return this.top===I.top&&this.bottom===I.bottom&&this.left===I.left&&this.right===I.right}clone(){return new Tu(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const au=85.051129;class Ns{constructor(I,ne,Te,Se,Ie){this.tileSize=512,this._renderWorldCopies=Ie===void 0||!!Ie,this._minZoom=I||0,this._maxZoom=ne||22,this._minPitch=Te??0,this._maxPitch=Se??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Tu,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const I=new Ns(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return I.apply(this),I}apply(I){this.tileSize=I.tileSize,this.latRange=I.latRange,this.lngRange=I.lngRange,this.width=I.width,this.height=I.height,this._center=I._center,this._elevation=I._elevation,this.minElevationForCurrentTile=I.minElevationForCurrentTile,this.zoom=I.zoom,this.angle=I.angle,this._fov=I._fov,this._pitch=I._pitch,this._unmodified=I._unmodified,this._edgeInsets=I._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(I){this._minZoom!==I&&(this._minZoom=I,this.zoom=Math.max(this.zoom,I))}get maxZoom(){return this._maxZoom}set maxZoom(I){this._maxZoom!==I&&(this._maxZoom=I,this.zoom=Math.min(this.zoom,I))}get minPitch(){return this._minPitch}set minPitch(I){this._minPitch!==I&&(this._minPitch=I,this.pitch=Math.max(this.pitch,I))}get maxPitch(){return this._maxPitch}set maxPitch(I){this._maxPitch!==I&&(this._maxPitch=I,this.pitch=Math.min(this.pitch,I))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(I){I===void 0?I=!0:I===null&&(I=!1),this._renderWorldCopies=I}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(I){const ne=-t.b3(I,-180,180)*Math.PI/180;this.angle!==ne&&(this._unmodified=!1,this.angle=ne,this._calcMatrices(),this.rotationMatrix=function(){var Te=new t.A(4);return t.A!=Float32Array&&(Te[1]=0,Te[2]=0),Te[0]=1,Te[3]=1,Te}(),function(Te,Se,Ie){var ot=Se[0],yt=Se[1],Ct=Se[2],Wt=Se[3],nr=Math.sin(Ie),or=Math.cos(Ie);Te[0]=ot*or+Ct*nr,Te[1]=yt*or+Wt*nr,Te[2]=ot*-nr+Ct*or,Te[3]=yt*-nr+Wt*or}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(I){const ne=t.ac(I,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==ne&&(this._unmodified=!1,this._pitch=ne,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(I){I=Math.max(.01,Math.min(60,I)),this._fov!==I&&(this._unmodified=!1,this._fov=I/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(I){const ne=Math.min(Math.max(I,this.minZoom),this.maxZoom);this._zoom!==ne&&(this._unmodified=!1,this._zoom=ne,this.tileZoom=Math.max(0,Math.floor(ne)),this.scale=this.zoomScale(ne),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(I){I.lat===this._center.lat&&I.lng===this._center.lng||(this._unmodified=!1,this._center=I,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(I){I!==this._elevation&&(this._elevation=I,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(I){this._edgeInsets.equals(I)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,I,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(I){return this._edgeInsets.equals(I)}interpolatePadding(I,ne,Te){this._unmodified=!1,this._edgeInsets.interpolate(I,ne,Te),this._constrain(),this._calcMatrices()}coveringZoomLevel(I){const ne=(I.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/I.tileSize));return Math.max(0,ne)}getVisibleUnwrappedCoordinates(I){const ne=[new t.b4(0,I)];if(this._renderWorldCopies){const Te=this.pointCoordinate(new t.P(0,0)),Se=this.pointCoordinate(new t.P(this.width,0)),Ie=this.pointCoordinate(new t.P(this.width,this.height)),ot=this.pointCoordinate(new t.P(0,this.height)),yt=Math.floor(Math.min(Te.x,Se.x,Ie.x,ot.x)),Ct=Math.floor(Math.max(Te.x,Se.x,Ie.x,ot.x)),Wt=1;for(let nr=yt-Wt;nr<=Ct+Wt;nr++)nr!==0&&ne.push(new t.b4(nr,I))}return ne}coveringTiles(I){var ne,Te;let Se=this.coveringZoomLevel(I);const Ie=Se;if(I.minzoom!==void 0&&SeI.maxzoom&&(Se=I.maxzoom);const ot=this.pointCoordinate(this.getCameraPoint()),yt=t.Z.fromLngLat(this.center),Ct=Math.pow(2,Se),Wt=[Ct*ot.x,Ct*ot.y,0],nr=[Ct*yt.x,Ct*yt.y,0],or=$s.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,Se);let Fr=I.minzoom||0;!I.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(Fr=Se);const Wr=I.terrain?2/Math.min(this.tileSize,I.tileSize)*this.tileSize:3,je=gt=>({aabb:new Qu([gt*Ct,0,0],[(gt+1)*Ct,Ct,0]),zoom:0,x:0,y:0,wrap:gt,fullyVisible:!1}),Ze=[],at=[],lt=Se,Tt=I.reparseOverscaled?Ie:Se;if(this._renderWorldCopies)for(let gt=1;gt<=3;gt++)Ze.push(je(-gt)),Ze.push(je(gt));for(Ze.push(je(0));Ze.length>0;){const gt=Ze.pop(),Et=gt.x,Yt=gt.y;let rr=gt.fullyVisible;if(!rr){const ia=gt.aabb.intersects(or);if(ia===0)continue;rr=ia===2}const sr=I.terrain?Wt:nr,Sr=gt.aabb.distanceX(sr),Nr=gt.aabb.distanceY(sr),Qr=Math.max(Math.abs(Sr),Math.abs(Nr));if(gt.zoom===lt||Qr>Wr+(1<=Fr){const ia=lt-gt.zoom,_a=Wt[0]-.5-(Et<>1),nn=gt.zoom+1;let en=gt.aabb.quadrant(ia);if(I.terrain){const ln=new t.S(nn,gt.wrap,nn,_a,za),Nn=I.terrain.getMinMaxElevation(ln),pi=(ne=Nn.minElevation)!==null&&ne!==void 0?ne:this.elevation,ii=(Te=Nn.maxElevation)!==null&&Te!==void 0?Te:this.elevation;en=new Qu([en.min[0],en.min[1],pi],[en.max[0],en.max[1],ii])}Ze.push({aabb:en,zoom:nn,x:_a,y:za,wrap:gt.wrap,fullyVisible:rr})}}return at.sort((gt,Et)=>gt.distanceSq-Et.distanceSq).map(gt=>gt.tileID)}resize(I,ne){this.width=I,this.height=ne,this.pixelsToGLUnits=[2/I,-2/ne],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(I){return Math.pow(2,I)}scaleZoom(I){return Math.log(I)/Math.LN2}project(I){const ne=t.ac(I.lat,-85.051129,au);return new t.P(t.O(I.lng)*this.worldSize,t.Q(ne)*this.worldSize)}unproject(I){return new t.Z(I.x/this.worldSize,I.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(I){const ne=this.elevation,Te=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,Se=this.pointLocation(this.centerPoint,I),Ie=I.getElevationForLngLatZoom(Se,this.tileZoom);if(!(this.elevation-Ie))return;const ot=Te+ne-Ie,yt=Math.cos(this._pitch)*this.cameraToCenterDistance/ot/t.b5(1,Se.lat),Ct=this.scaleZoom(yt/this.tileSize);this._elevation=Ie,this._center=Se,this.zoom=Ct}setLocationAtPoint(I,ne){const Te=this.pointCoordinate(ne),Se=this.pointCoordinate(this.centerPoint),Ie=this.locationCoordinate(I),ot=new t.Z(Ie.x-(Te.x-Se.x),Ie.y-(Te.y-Se.y));this.center=this.coordinateLocation(ot),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(I,ne){return ne?this.coordinatePoint(this.locationCoordinate(I),ne.getElevationForLngLatZoom(I,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(I))}pointLocation(I,ne){return this.coordinateLocation(this.pointCoordinate(I,ne))}locationCoordinate(I){return t.Z.fromLngLat(I)}coordinateLocation(I){return I&&I.toLngLat()}pointCoordinate(I,ne){if(ne){const Fr=ne.pointCoordinate(I);if(Fr!=null)return Fr}const Te=[I.x,I.y,0,1],Se=[I.x,I.y,1,1];t.af(Te,Te,this.pixelMatrixInverse),t.af(Se,Se,this.pixelMatrixInverse);const Ie=Te[3],ot=Se[3],yt=Te[1]/Ie,Ct=Se[1]/ot,Wt=Te[2]/Ie,nr=Se[2]/ot,or=Wt===nr?0:(0-Wt)/(nr-Wt);return new t.Z(t.y.number(Te[0]/Ie,Se[0]/ot,or)/this.worldSize,t.y.number(yt,Ct,or)/this.worldSize)}coordinatePoint(I,ne=0,Te=this.pixelMatrix){const Se=[I.x*this.worldSize,I.y*this.worldSize,ne,1];return t.af(Se,Se,Te),new t.P(Se[0]/Se[3],Se[1]/Se[3])}getBounds(){const I=Math.max(0,this.height/2-this.getHorizon());return new ie().extend(this.pointLocation(new t.P(0,I))).extend(this.pointLocation(new t.P(this.width,I))).extend(this.pointLocation(new t.P(this.width,this.height))).extend(this.pointLocation(new t.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new ie([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(I){I?(this.lngRange=[I.getWest(),I.getEast()],this.latRange=[I.getSouth(),I.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,au])}calculateTileMatrix(I){const ne=I.canonical,Te=this.worldSize/this.zoomScale(ne.z),Se=ne.x+Math.pow(2,ne.z)*I.wrap,Ie=t.an(new Float64Array(16));return t.J(Ie,Ie,[Se*Te,ne.y*Te,0]),t.K(Ie,Ie,[Te/t.X,Te/t.X,1]),Ie}calculatePosMatrix(I,ne=!1){const Te=I.key,Se=ne?this._alignedPosMatrixCache:this._posMatrixCache;if(Se[Te])return Se[Te];const Ie=this.calculateTileMatrix(I);return t.L(Ie,ne?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,Ie),Se[Te]=new Float32Array(Ie),Se[Te]}calculateFogMatrix(I){const ne=I.key,Te=this._fogMatrixCache;if(Te[ne])return Te[ne];const Se=this.calculateTileMatrix(I);return t.L(Se,this.fogMatrix,Se),Te[ne]=new Float32Array(Se),Te[ne]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(I,ne){ne=t.ac(+ne,this.minZoom,this.maxZoom);const Te={center:new t.N(I.lng,I.lat),zoom:ne};let Se=this.lngRange;if(!this._renderWorldCopies&&Se===null){const gt=179.9999999999;Se=[-gt,gt]}const Ie=this.tileSize*this.zoomScale(Te.zoom);let ot=0,yt=Ie,Ct=0,Wt=Ie,nr=0,or=0;const{x:Fr,y:Wr}=this.size;if(this.latRange){const gt=this.latRange;ot=t.Q(gt[1])*Ie,yt=t.Q(gt[0])*Ie,yt-otyt&&(lt=yt-gt)}if(Se){const gt=(Ct+Wt)/2;let Et=je;this._renderWorldCopies&&(Et=t.b3(je,gt-Ie/2,gt+Ie/2));const Yt=Fr/2;Et-YtWt&&(at=Wt-Yt)}if(at!==void 0||lt!==void 0){const gt=new t.P(at??je,lt??Ze);Te.center=this.unproject.call({worldSize:Ie},gt).wrap()}return Te}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const I=this._unmodified,{center:ne,zoom:Te}=this.getConstrained(this.center,this.zoom);this.center=ne,this.zoom=Te,this._unmodified=I,this._constraining=!1}_calcMatrices(){if(!this.height)return;const I=this.centerOffset,ne=this.point.x,Te=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b5(1,this.center.lat)*this.worldSize;let Se=t.an(new Float64Array(16));t.K(Se,Se,[this.width/2,-this.height/2,1]),t.J(Se,Se,[1,-1,0]),this.labelPlaneMatrix=Se,Se=t.an(new Float64Array(16)),t.K(Se,Se,[1,-1,1]),t.J(Se,Se,[-1,-1,0]),t.K(Se,Se,[2/this.width,2/this.height,1]),this.glCoordMatrix=Se;const Ie=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),ot=Math.min(this.elevation,this.minElevationForCurrentTile),yt=Ie-ot*this._pixelPerMeter/Math.cos(this._pitch),Ct=ot<0?yt:Ie,Wt=Math.PI/2+this._pitch,nr=this._fov*(.5+I.y/this.height),or=Math.sin(nr)*Ct/Math.sin(t.ac(Math.PI-Wt-nr,.01,Math.PI-.01)),Fr=this.getHorizon(),Wr=2*Math.atan(Fr/this.cameraToCenterDistance)*(.5+I.y/(2*Fr)),je=Math.sin(Wr)*Ct/Math.sin(t.ac(Math.PI-Wt-Wr,.01,Math.PI-.01)),Ze=Math.min(or,je);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Ze+Ct),this.nearZ=this.height/50,Se=new Float64Array(16),t.b6(Se,this._fov,this.width/this.height,this.nearZ,this.farZ),Se[8]=2*-I.x/this.width,Se[9]=2*I.y/this.height,this.projectionMatrix=t.ae(Se),t.K(Se,Se,[1,-1,1]),t.J(Se,Se,[0,0,-this.cameraToCenterDistance]),t.b7(Se,Se,this._pitch),t.ad(Se,Se,this.angle),t.J(Se,Se,[-ne,-Te,0]),this.mercatorMatrix=t.K([],Se,[this.worldSize,this.worldSize,this.worldSize]),t.K(Se,Se,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.L(new Float64Array(16),this.labelPlaneMatrix,Se),t.J(Se,Se,[0,0,-this.elevation]),this.modelViewProjectionMatrix=Se,this.invModelViewProjectionMatrix=t.as([],Se),this.fogMatrix=new Float64Array(16),t.b6(this.fogMatrix,this._fov,this.width/this.height,Ie,this.farZ),this.fogMatrix[8]=2*-I.x/this.width,this.fogMatrix[9]=2*I.y/this.height,t.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),t.b7(this.fogMatrix,this.fogMatrix,this._pitch),t.ad(this.fogMatrix,this.fogMatrix,this.angle),t.J(this.fogMatrix,this.fogMatrix,[-ne,-Te,0]),t.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=t.L(new Float64Array(16),this.labelPlaneMatrix,Se);const at=this.width%2/2,lt=this.height%2/2,Tt=Math.cos(this.angle),gt=Math.sin(this.angle),Et=ne-Math.round(ne)+Tt*at+gt*lt,Yt=Te-Math.round(Te)+Tt*lt+gt*at,rr=new Float64Array(Se);if(t.J(rr,rr,[Et>.5?Et-1:Et,Yt>.5?Yt-1:Yt,0]),this.alignedModelViewProjectionMatrix=rr,Se=t.as(new Float64Array(16),this.pixelMatrix),!Se)throw new Error("failed to invert matrix");this.pixelMatrixInverse=Se,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const I=this.pointCoordinate(new t.P(0,0)),ne=[I.x*this.worldSize,I.y*this.worldSize,0,1];return t.af(ne,ne,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const I=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,I))}getCameraQueryGeometry(I){const ne=this.getCameraPoint();if(I.length===1)return[I[0],ne];{let Te=ne.x,Se=ne.y,Ie=ne.x,ot=ne.y;for(const yt of I)Te=Math.min(Te,yt.x),Se=Math.min(Se,yt.y),Ie=Math.max(Ie,yt.x),ot=Math.max(ot,yt.y);return[new t.P(Te,Se),new t.P(Ie,Se),new t.P(Ie,ot),new t.P(Te,ot),new t.P(Te,Se)]}}lngLatToCameraDepth(I,ne){const Te=this.locationCoordinate(I),Se=[Te.x*this.worldSize,Te.y*this.worldSize,ne,1];return t.af(Se,Se,this.modelViewProjectionMatrix),Se[2]/Se[3]}}function yc(De,I){let ne,Te=!1,Se=null,Ie=null;const ot=()=>{Se=null,Te&&(De.apply(Ie,ne),Se=setTimeout(ot,I),Te=!1)};return(...yt)=>(Te=!0,Ie=this,ne=yt,Se||ot(),Se)}class Pu{constructor(I){this._getCurrentHash=()=>{const ne=window.location.hash.replace("#","");if(this._hashName){let Te;return ne.split("&").map(Se=>Se.split("=")).forEach(Se=>{Se[0]===this._hashName&&(Te=Se)}),(Te&&Te[1]||"").split("/")}return ne.split("/")},this._onHashChange=()=>{const ne=this._getCurrentHash();if(ne.length>=3&&!ne.some(Te=>isNaN(Te))){const Te=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(ne[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+ne[2],+ne[1]],zoom:+ne[0],bearing:Te,pitch:+(ne[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const ne=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,ne)},this._removeHash=()=>{const ne=this._getCurrentHash();if(ne.length===0)return;const Te=ne.join("/");let Se=Te;Se.split("&").length>0&&(Se=Se.split("&")[0]),this._hashName&&(Se=`${this._hashName}=${Te}`);let Ie=window.location.hash.replace(Se,"");Ie.startsWith("#&")?Ie=Ie.slice(0,1)+Ie.slice(2):Ie==="#"&&(Ie="");let ot=window.location.href.replace(/(#.+)?$/,Ie);ot=ot.replace("&&","&"),window.history.replaceState(window.history.state,null,ot)},this._updateHash=yc(this._updateHashUnthrottled,300),this._hashName=I&&encodeURIComponent(I)}addTo(I){return this._map=I,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(I){const ne=this._map.getCenter(),Te=Math.round(100*this._map.getZoom())/100,Se=Math.ceil((Te*Math.LN2+Math.log(512/360/.5))/Math.LN10),Ie=Math.pow(10,Se),ot=Math.round(ne.lng*Ie)/Ie,yt=Math.round(ne.lat*Ie)/Ie,Ct=this._map.getBearing(),Wt=this._map.getPitch();let nr="";if(nr+=I?`/${ot}/${yt}/${Te}`:`${Te}/${yt}/${ot}`,(Ct||Wt)&&(nr+="/"+Math.round(10*Ct)/10),Wt&&(nr+=`/${Math.round(Wt)}`),this._hashName){const or=this._hashName;let Fr=!1;const Wr=window.location.hash.slice(1).split("&").map(je=>{const Ze=je.split("=")[0];return Ze===or?(Fr=!0,`${Ze}=${nr}`):je}).filter(je=>je);return Fr||Wr.push(`${or}=${nr}`),`#${Wr.join("&")}`}return`#${nr}`}}const ec={linearity:.3,easing:t.b8(0,0,.3,1)},Ec=t.e({deceleration:2500,maxSpeed:1400},ec),Cf=t.e({deceleration:20,maxSpeed:1400},ec),nh=t.e({deceleration:1e3,maxSpeed:360},ec),lc=t.e({deceleration:1e3,maxSpeed:90},ec);class kc{constructor(I){this._map=I,this.clear()}clear(){this._inertiaBuffer=[]}record(I){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:i.now(),settings:I})}_drainInertiaBuffer(){const I=this._inertiaBuffer,ne=i.now();for(;I.length>0&&ne-I[0].time>160;)I.shift()}_onMoveEnd(I){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const ne={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:Ie}of this._inertiaBuffer)ne.zoom+=Ie.zoomDelta||0,ne.bearing+=Ie.bearingDelta||0,ne.pitch+=Ie.pitchDelta||0,Ie.panDelta&&ne.pan._add(Ie.panDelta),Ie.around&&(ne.around=Ie.around),Ie.pinchAround&&(ne.pinchAround=Ie.pinchAround);const Te=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,Se={};if(ne.pan.mag()){const Ie=tf(ne.pan.mag(),Te,t.e({},Ec,I||{}));Se.offset=ne.pan.mult(Ie.amount/ne.pan.mag()),Se.center=this._map.transform.center,nu(Se,Ie)}if(ne.zoom){const Ie=tf(ne.zoom,Te,Cf);Se.zoom=this._map.transform.zoom+Ie.amount,nu(Se,Ie)}if(ne.bearing){const Ie=tf(ne.bearing,Te,nh);Se.bearing=this._map.transform.bearing+t.ac(Ie.amount,-179,179),nu(Se,Ie)}if(ne.pitch){const Ie=tf(ne.pitch,Te,lc);Se.pitch=this._map.transform.pitch+Ie.amount,nu(Se,Ie)}if(Se.zoom||Se.bearing){const Ie=ne.pinchAround===void 0?ne.around:ne.pinchAround;Se.around=Ie?this._map.unproject(Ie):this._map.getCenter()}return this.clear(),t.e(Se,{noMoveStart:!0})}}function nu(De,I){(!De.duration||De.durationne.unproject(Ct)),yt=Ie.reduce((Ct,Wt,nr,or)=>Ct.add(Wt.div(or.length)),new t.P(0,0));super(I,{points:Ie,point:yt,lngLats:ot,lngLat:ne.unproject(yt),originalEvent:Te}),this._defaultPrevented=!1}}class rf extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(I,ne,Te){super(I,{originalEvent:Te}),this._defaultPrevented=!1}}class mc{constructor(I,ne){this._map=I,this._clickTolerance=ne.clickTolerance}reset(){delete this._mousedownPos}wheel(I){return this._firePreventable(new rf(I.type,this._map,I))}mousedown(I,ne){return this._mousedownPos=ne,this._firePreventable(new Cl(I.type,this._map,I))}mouseup(I){this._map.fire(new Cl(I.type,this._map,I))}click(I,ne){this._mousedownPos&&this._mousedownPos.dist(ne)>=this._clickTolerance||this._map.fire(new Cl(I.type,this._map,I))}dblclick(I){return this._firePreventable(new Cl(I.type,this._map,I))}mouseover(I){this._map.fire(new Cl(I.type,this._map,I))}mouseout(I){this._map.fire(new Cl(I.type,this._map,I))}touchstart(I){return this._firePreventable(new uc(I.type,this._map,I))}touchmove(I){this._map.fire(new uc(I.type,this._map,I))}touchend(I){this._map.fire(new uc(I.type,this._map,I))}touchcancel(I){this._map.fire(new uc(I.type,this._map,I))}_firePreventable(I){if(this._map.fire(I),I.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Us{constructor(I){this._map=I}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(I){this._map.fire(new Cl(I.type,this._map,I))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Cl("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(I){this._delayContextMenu?this._contextMenuEvent=I:this._ignoreContextMenu||this._map.fire(new Cl(I.type,this._map,I)),this._map.listens("contextmenu")&&I.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class vu{constructor(I){this._map=I}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(I){return this.transform.pointLocation(t.P.convert(I),this._map.terrain)}}class du{constructor(I,ne){this._map=I,this._tr=new vu(I),this._el=I.getCanvasContainer(),this._container=I.getContainer(),this._clickTolerance=ne.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(I,ne){this.isEnabled()&&I.shiftKey&&I.button===0&&(n.disableDrag(),this._startPos=this._lastPos=ne,this._active=!0)}mousemoveWindow(I,ne){if(!this._active)return;const Te=ne;if(this._lastPos.equals(Te)||!this._box&&Te.dist(this._startPos)Ie.fitScreenCoordinates(Te,Se,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",I)}keydown(I){this._active&&I.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",I))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(n.remove(this._box),this._box=null),n.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(I,ne){return this._map.fire(new t.k(I,{originalEvent:ne}))}}function af(De,I){if(De.length!==I.length)throw new Error(`The number of touches and points are not equal - touches ${De.length}, points ${I.length}`);const ne={};for(let Te=0;Tethis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=I.timeStamp),Te.length===this.numTouches&&(this.centroid=function(Se){const Ie=new t.P(0,0);for(const ot of Se)Ie._add(ot);return Ie.div(Se.length)}(ne),this.touches=af(Te,ne)))}touchmove(I,ne,Te){if(this.aborted||!this.centroid)return;const Se=af(Te,ne);for(const Ie in this.touches){const ot=Se[Ie];(!ot||ot.dist(this.touches[Ie])>30)&&(this.aborted=!0)}}touchend(I,ne,Te){if((!this.centroid||I.timeStamp-this.startTime>500)&&(this.aborted=!0),Te.length===0){const Se=!this.aborted&&this.centroid;if(this.reset(),Se)return Se}}}class _c{constructor(I){this.singleTap=new Rs(I),this.numTaps=I.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(I,ne,Te){this.singleTap.touchstart(I,ne,Te)}touchmove(I,ne,Te){this.singleTap.touchmove(I,ne,Te)}touchend(I,ne,Te){const Se=this.singleTap.touchend(I,ne,Te);if(Se){const Ie=I.timeStamp-this.lastTime<500,ot=!this.lastTap||this.lastTap.dist(Se)<30;if(Ie&&ot||this.reset(),this.count++,this.lastTime=I.timeStamp,this.lastTap=Se,this.count===this.numTaps)return this.reset(),Se}}}class ju{constructor(I){this._tr=new vu(I),this._zoomIn=new _c({numTouches:1,numTaps:2}),this._zoomOut=new _c({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(I,ne,Te){this._zoomIn.touchstart(I,ne,Te),this._zoomOut.touchstart(I,ne,Te)}touchmove(I,ne,Te){this._zoomIn.touchmove(I,ne,Te),this._zoomOut.touchmove(I,ne,Te)}touchend(I,ne,Te){const Se=this._zoomIn.touchend(I,ne,Te),Ie=this._zoomOut.touchend(I,ne,Te),ot=this._tr;return Se?(this._active=!0,I.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:yt=>yt.easeTo({duration:300,zoom:ot.zoom+1,around:ot.unproject(Se)},{originalEvent:I})}):Ie?(this._active=!0,I.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:yt=>yt.easeTo({duration:300,zoom:ot.zoom-1,around:ot.unproject(Ie)},{originalEvent:I})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class iu{constructor(I){this._enabled=!!I.enable,this._moveStateManager=I.moveStateManager,this._clickTolerance=I.clickTolerance||1,this._moveFunction=I.move,this._activateOnStart=!!I.activateOnStart,I.assignEvents(this),this.reset()}reset(I){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(I)}_move(...I){const ne=this._moveFunction(...I);if(ne.bearingDelta||ne.pitchDelta||ne.around||ne.panDelta)return this._active=!0,ne}dragStart(I,ne){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(I)&&(this._moveStateManager.startMove(I),this._lastPoint=ne.length?ne[0]:ne,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(I,ne){if(!this.isEnabled())return;const Te=this._lastPoint;if(!Te)return;if(I.preventDefault(),!this._moveStateManager.isValidMoveEvent(I))return void this.reset(I);const Se=ne.length?ne[0]:ne;return!this._moved&&Se.dist(Te){De.mousedown=De.dragStart,De.mousemoveWindow=De.dragMove,De.mouseup=De.dragEnd,De.contextmenu=I=>{I.preventDefault()}},xl=({enable:De,clickTolerance:I,bearingDegreesPerPixelMoved:ne=.8})=>{const Te=new Iu({checkCorrectEvent:Se=>n.mouseButton(Se)===0&&Se.ctrlKey||n.mouseButton(Se)===2});return new iu({clickTolerance:I,move:(Se,Ie)=>({bearingDelta:(Ie.x-Se.x)*ne}),moveStateManager:Te,enable:De,assignEvents:Lf})},nf=({enable:De,clickTolerance:I,pitchDegreesPerPixelMoved:ne=-.5})=>{const Te=new Iu({checkCorrectEvent:Se=>n.mouseButton(Se)===0&&Se.ctrlKey||n.mouseButton(Se)===2});return new iu({clickTolerance:I,move:(Se,Ie)=>({pitchDelta:(Ie.y-Se.y)*ne}),moveStateManager:Te,enable:De,assignEvents:Lf})};class ou{constructor(I,ne){this._clickTolerance=I.clickTolerance||1,this._map=ne,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(I){return I<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(I,ne,Te){return this._calculateTransform(I,ne,Te)}touchmove(I,ne,Te){if(this._active){if(!this._shouldBePrevented(Te.length))return I.preventDefault(),this._calculateTransform(I,ne,Te);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",I)}}touchend(I,ne,Te){this._calculateTransform(I,ne,Te),this._active&&this._shouldBePrevented(Te.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(I,ne,Te){Te.length>0&&(this._active=!0);const Se=af(Te,ne),Ie=new t.P(0,0),ot=new t.P(0,0);let yt=0;for(const Wt in Se){const nr=Se[Wt],or=this._touches[Wt];or&&(Ie._add(nr),ot._add(nr.sub(or)),yt++,Se[Wt]=nr)}if(this._touches=Se,this._shouldBePrevented(yt)||!ot.mag())return;const Ct=ot.div(yt);return this._sum._add(Ct),this._sum.mag()Math.abs(De.x)}class Cc extends Ru{constructor(I){super(),this._currentTouchCount=0,this._map=I}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(I,ne,Te){super.touchstart(I,ne,Te),this._currentTouchCount=Te.length}_start(I){this._lastPoints=I,Su(I[0].sub(I[1]))&&(this._valid=!1)}_move(I,ne,Te){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const Se=I[0].sub(this._lastPoints[0]),Ie=I[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(Se,Ie,Te.timeStamp),this._valid?(this._lastPoints=I,this._active=!0,{pitchDelta:(Se.y+Ie.y)/2*-.5}):void 0}gestureBeginsVertically(I,ne,Te){if(this._valid!==void 0)return this._valid;const Se=I.mag()>=2,Ie=ne.mag()>=2;if(!Se&&!Ie)return;if(!Se||!Ie)return this._firstMove===void 0&&(this._firstMove=Te),Te-this._firstMove<100&&void 0;const ot=I.y>0==ne.y>0;return Su(I)&&Su(ne)&&ot}}const Ht={panStep:100,bearingStep:15,pitchStep:10};class ur{constructor(I){this._tr=new vu(I);const ne=Ht;this._panStep=ne.panStep,this._bearingStep=ne.bearingStep,this._pitchStep=ne.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(I){if(I.altKey||I.ctrlKey||I.metaKey)return;let ne=0,Te=0,Se=0,Ie=0,ot=0;switch(I.keyCode){case 61:case 107:case 171:case 187:ne=1;break;case 189:case 109:case 173:ne=-1;break;case 37:I.shiftKey?Te=-1:(I.preventDefault(),Ie=-1);break;case 39:I.shiftKey?Te=1:(I.preventDefault(),Ie=1);break;case 38:I.shiftKey?Se=1:(I.preventDefault(),ot=-1);break;case 40:I.shiftKey?Se=-1:(I.preventDefault(),ot=1);break;default:return}return this._rotationDisabled&&(Te=0,Se=0),{cameraAnimation:yt=>{const Ct=this._tr;yt.easeTo({duration:300,easeId:"keyboardHandler",easing:qr,zoom:ne?Math.round(Ct.zoom)+ne*(I.shiftKey?2:1):Ct.zoom,bearing:Ct.bearing+Te*this._bearingStep,pitch:Ct.pitch+Se*this._pitchStep,offset:[-Ie*this._panStep,-ot*this._panStep],center:Ct.center},{originalEvent:I})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function qr(De){return De*(2-De)}const Or=4.000244140625;class ua{constructor(I,ne){this._onTimeout=Te=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(Te)},this._map=I,this._tr=new vu(I),this._triggerRenderFrame=ne,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(I){this._defaultZoomRate=I}setWheelZoomRate(I){this._wheelZoomRate=I}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(I){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!I&&I.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(I){return!!this._map.cooperativeGestures.isEnabled()&&!(I.ctrlKey||this._map.cooperativeGestures.isBypassed(I))}wheel(I){if(!this.isEnabled())return;if(this._shouldBePrevented(I))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",I);let ne=I.deltaMode===WheelEvent.DOM_DELTA_LINE?40*I.deltaY:I.deltaY;const Te=i.now(),Se=Te-(this._lastWheelEventTime||0);this._lastWheelEventTime=Te,ne!==0&&ne%Or==0?this._type="wheel":ne!==0&&Math.abs(ne)<4?this._type="trackpad":Se>400?(this._type=null,this._lastValue=ne,this._timeout=setTimeout(this._onTimeout,40,I)):this._type||(this._type=Math.abs(Se*ne)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,ne+=this._lastValue)),I.shiftKey&&ne&&(ne/=4),this._type&&(this._lastWheelEvent=I,this._delta-=ne,this._active||this._start(I)),I.preventDefault()}_start(I){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const ne=n.mousePos(this._map.getCanvas(),I),Te=this._tr;this._around=ne.y>Te.transform.height/2-Te.transform.getHorizon()?t.N.convert(this._aroundCenter?Te.center:Te.unproject(ne)):t.N.convert(Te.center),this._aroundPoint=Te.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const I=this._tr.transform;if(this._delta!==0){const Ct=this._type==="wheel"&&Math.abs(this._delta)>Or?this._wheelZoomRate:this._defaultZoomRate;let Wt=2/(1+Math.exp(-Math.abs(this._delta*Ct)));this._delta<0&&Wt!==0&&(Wt=1/Wt);const nr=typeof this._targetZoom=="number"?I.zoomScale(this._targetZoom):I.scale;this._targetZoom=Math.min(I.maxZoom,Math.max(I.minZoom,I.scaleZoom(nr*Wt))),this._type==="wheel"&&(this._startZoom=I.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const ne=typeof this._targetZoom=="number"?this._targetZoom:I.zoom,Te=this._startZoom,Se=this._easing;let Ie,ot=!1;const yt=i.now()-this._lastWheelEventTime;if(this._type==="wheel"&&Te&&Se&&yt){const Ct=Math.min(yt/200,1),Wt=Se(Ct);Ie=t.y.number(Te,ne,Wt),Ct<1?this._frameId||(this._frameId=!0):ot=!0}else Ie=ne,ot=!0;return this._active=!0,ot&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!ot,zoomDelta:Ie-I.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(I){let ne=t.b9;if(this._prevEase){const Te=this._prevEase,Se=(i.now()-Te.start)/Te.duration,Ie=Te.easing(Se+.01)-Te.easing(Se),ot=.27/Math.sqrt(Ie*Ie+1e-4)*.01,yt=Math.sqrt(.0729-ot*ot);ne=t.b8(ot,yt,.25,1)}return this._prevEase={start:i.now(),duration:I,easing:ne},ne}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Fa{constructor(I,ne){this._clickZoom=I,this._tapZoom=ne}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class ja{constructor(I){this._tr=new vu(I),this.reset()}reset(){this._active=!1}dblclick(I,ne){return I.preventDefault(),{cameraAnimation:Te=>{Te.easeTo({duration:300,zoom:this._tr.zoom+(I.shiftKey?-1:1),around:this._tr.unproject(ne)},{originalEvent:I})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class sn{constructor(){this._tap=new _c({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(I,ne,Te){if(!this._swipePoint)if(this._tapTime){const Se=ne[0],Ie=I.timeStamp-this._tapTime<500,ot=this._tapPoint.dist(Se)<30;Ie&&ot?Te.length>0&&(this._swipePoint=Se,this._swipeTouch=Te[0].identifier):this.reset()}else this._tap.touchstart(I,ne,Te)}touchmove(I,ne,Te){if(this._tapTime){if(this._swipePoint){if(Te[0].identifier!==this._swipeTouch)return;const Se=ne[0],Ie=Se.y-this._swipePoint.y;return this._swipePoint=Se,I.preventDefault(),this._active=!0,{zoomDelta:Ie/128}}}else this._tap.touchmove(I,ne,Te)}touchend(I,ne,Te){if(this._tapTime)this._swipePoint&&Te.length===0&&this.reset();else{const Se=this._tap.touchend(I,ne,Te);Se&&(this._tapTime=I.timeStamp,this._tapPoint=Se)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gn{constructor(I,ne,Te){this._el=I,this._mousePan=ne,this._touchPan=Te}enable(I){this._inertiaOptions=I||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class kn{constructor(I,ne,Te){this._pitchWithRotate=I.pitchWithRotate,this._mouseRotate=ne,this._mousePitch=Te}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Ja{constructor(I,ne,Te,Se){this._el=I,this._touchZoom=ne,this._touchRotate=Te,this._tapDragZoom=Se,this._rotationDisabled=!1,this._enabled=!0}enable(I){this._touchZoom.enable(I),this._rotationDisabled||this._touchRotate.enable(I),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class _n{constructor(I,ne){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=I,this._options=ne,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const I=this._map.getCanvasContainer();I.classList.add("maplibregl-cooperative-gestures"),this._container=n.create("div","maplibregl-cooperative-gesture-screen",I);let ne=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(ne=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const Te=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),Se=document.createElement("div");Se.className="maplibregl-desktop-message",Se.textContent=ne,this._container.appendChild(Se);const Ie=document.createElement("div");Ie.className="maplibregl-mobile-message",Ie.textContent=Te,this._container.appendChild(Ie),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(n.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(I){return I[this._bypassKey]}notifyGestureBlocked(I,ne){this._enabled&&(this._map.fire(new t.k("cooperativegestureprevented",{gestureType:I,originalEvent:ne})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const on=De=>De.zoom||De.drag||De.pitch||De.rotate;class Wa extends t.k{}function On(De){return De.panDelta&&De.panDelta.mag()||De.zoomDelta||De.bearingDelta||De.pitchDelta}class zi{constructor(I,ne){this.handleWindowEvent=Se=>{this.handleEvent(Se,`${Se.type}Window`)},this.handleEvent=(Se,Ie)=>{if(Se.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const ot=Se.type==="renderFrame"?void 0:Se,yt={needsRenderFrame:!1},Ct={},Wt={},nr=Se.touches,or=nr?this._getMapTouches(nr):void 0,Fr=or?n.touchPos(this._map.getCanvas(),or):n.mousePos(this._map.getCanvas(),Se);for(const{handlerName:Ze,handler:at,allowed:lt}of this._handlers){if(!at.isEnabled())continue;let Tt;this._blockedByActive(Wt,lt,Ze)?at.reset():at[Ie||Se.type]&&(Tt=at[Ie||Se.type](Se,Fr,or),this.mergeHandlerResult(yt,Ct,Tt,Ze,ot),Tt&&Tt.needsRenderFrame&&this._triggerRenderFrame()),(Tt||at.isActive())&&(Wt[Ze]=at)}const Wr={};for(const Ze in this._previousActiveHandlers)Wt[Ze]||(Wr[Ze]=ot);this._previousActiveHandlers=Wt,(Object.keys(Wr).length||On(yt))&&(this._changes.push([yt,Ct,Wr]),this._triggerRenderFrame()),(Object.keys(Wt).length||On(yt))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:je}=yt;je&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],je(this._map))},this._map=I,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new kc(I),this._bearingSnap=ne.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(ne);const Te=this._el;this._listeners=[[Te,"touchstart",{passive:!0}],[Te,"touchmove",{passive:!1}],[Te,"touchend",void 0],[Te,"touchcancel",void 0],[Te,"mousedown",void 0],[Te,"mousemove",void 0],[Te,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[Te,"mouseover",void 0],[Te,"mouseout",void 0],[Te,"dblclick",void 0],[Te,"click",void 0],[Te,"keydown",{capture:!1}],[Te,"keyup",void 0],[Te,"wheel",{passive:!1}],[Te,"contextmenu",void 0],[window,"blur",void 0]];for(const[Se,Ie,ot]of this._listeners)n.addEventListener(Se,Ie,Se===document?this.handleWindowEvent:this.handleEvent,ot)}destroy(){for(const[I,ne,Te]of this._listeners)n.removeEventListener(I,ne,I===document?this.handleWindowEvent:this.handleEvent,Te)}_addDefaultHandlers(I){const ne=this._map,Te=ne.getCanvasContainer();this._add("mapEvent",new mc(ne,I));const Se=ne.boxZoom=new du(ne,I);this._add("boxZoom",Se),I.interactive&&I.boxZoom&&Se.enable();const Ie=ne.cooperativeGestures=new _n(ne,I.cooperativeGestures);this._add("cooperativeGestures",Ie),I.cooperativeGestures&&Ie.enable();const ot=new ju(ne),yt=new ja(ne);ne.doubleClickZoom=new Fa(yt,ot),this._add("tapZoom",ot),this._add("clickZoom",yt),I.interactive&&I.doubleClickZoom&&ne.doubleClickZoom.enable();const Ct=new sn;this._add("tapDragZoom",Ct);const Wt=ne.touchPitch=new Cc(ne);this._add("touchPitch",Wt),I.interactive&&I.touchPitch&&ne.touchPitch.enable(I.touchPitch);const nr=xl(I),or=nf(I);ne.dragRotate=new kn(I,nr,or),this._add("mouseRotate",nr,["mousePitch"]),this._add("mousePitch",or,["mouseRotate"]),I.interactive&&I.dragRotate&&ne.dragRotate.enable();const Fr=(({enable:Tt,clickTolerance:gt})=>{const Et=new Iu({checkCorrectEvent:Yt=>n.mouseButton(Yt)===0&&!Yt.ctrlKey});return new iu({clickTolerance:gt,move:(Yt,rr)=>({around:rr,panDelta:rr.sub(Yt)}),activateOnStart:!0,moveStateManager:Et,enable:Tt,assignEvents:Lf})})(I),Wr=new ou(I,ne);ne.dragPan=new gn(Te,Fr,Wr),this._add("mousePan",Fr),this._add("touchPan",Wr,["touchZoom","touchRotate"]),I.interactive&&I.dragPan&&ne.dragPan.enable(I.dragPan);const je=new tc,Ze=new Ol;ne.touchZoomRotate=new Ja(Te,Ze,je,Ct),this._add("touchRotate",je,["touchPan","touchZoom"]),this._add("touchZoom",Ze,["touchPan","touchRotate"]),I.interactive&&I.touchZoomRotate&&ne.touchZoomRotate.enable(I.touchZoomRotate);const at=ne.scrollZoom=new ua(ne,()=>this._triggerRenderFrame());this._add("scrollZoom",at,["mousePan"]),I.interactive&&I.scrollZoom&&ne.scrollZoom.enable(I.scrollZoom);const lt=ne.keyboard=new ur(ne);this._add("keyboard",lt),I.interactive&&I.keyboard&&ne.keyboard.enable(),this._add("blockableMapEvent",new Us(ne))}_add(I,ne,Te){this._handlers.push({handlerName:I,handler:ne,allowed:Te}),this._handlersById[I]=ne}stop(I){if(!this._updatingCamera){for(const{handler:ne}of this._handlers)ne.reset();this._inertia.clear(),this._fireEvents({},{},I),this._changes=[]}}isActive(){for(const{handler:I}of this._handlers)if(I.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!on(this._eventsInProgress)||this.isZooming()}_blockedByActive(I,ne,Te){for(const Se in I)if(Se!==Te&&(!ne||ne.indexOf(Se)<0))return!0;return!1}_getMapTouches(I){const ne=[];for(const Te of I)this._el.contains(Te.target)&&ne.push(Te);return ne}mergeHandlerResult(I,ne,Te,Se,Ie){if(!Te)return;t.e(I,Te);const ot={handlerName:Se,originalEvent:Te.originalEvent||Ie};Te.zoomDelta!==void 0&&(ne.zoom=ot),Te.panDelta!==void 0&&(ne.drag=ot),Te.pitchDelta!==void 0&&(ne.pitch=ot),Te.bearingDelta!==void 0&&(ne.rotate=ot)}_applyChanges(){const I={},ne={},Te={};for(const[Se,Ie,ot]of this._changes)Se.panDelta&&(I.panDelta=(I.panDelta||new t.P(0,0))._add(Se.panDelta)),Se.zoomDelta&&(I.zoomDelta=(I.zoomDelta||0)+Se.zoomDelta),Se.bearingDelta&&(I.bearingDelta=(I.bearingDelta||0)+Se.bearingDelta),Se.pitchDelta&&(I.pitchDelta=(I.pitchDelta||0)+Se.pitchDelta),Se.around!==void 0&&(I.around=Se.around),Se.pinchAround!==void 0&&(I.pinchAround=Se.pinchAround),Se.noInertia&&(I.noInertia=Se.noInertia),t.e(ne,Ie),t.e(Te,ot);this._updateMapTransform(I,ne,Te),this._changes=[]}_updateMapTransform(I,ne,Te){const Se=this._map,Ie=Se._getTransformForUpdate(),ot=Se.terrain;if(!(On(I)||ot&&this._terrainMovement))return this._fireEvents(ne,Te,!0);let{panDelta:yt,zoomDelta:Ct,bearingDelta:Wt,pitchDelta:nr,around:or,pinchAround:Fr}=I;Fr!==void 0&&(or=Fr),Se._stop(!0),or=or||Se.transform.centerPoint;const Wr=Ie.pointLocation(yt?or.sub(yt):or);Wt&&(Ie.bearing+=Wt),nr&&(Ie.pitch+=nr),Ct&&(Ie.zoom+=Ct),ot?this._terrainMovement||!ne.drag&&!ne.zoom?ne.drag&&this._terrainMovement?Ie.center=Ie.pointLocation(Ie.centerPoint.sub(yt)):Ie.setLocationAtPoint(Wr,or):(this._terrainMovement=!0,this._map._elevationFreeze=!0,Ie.setLocationAtPoint(Wr,or)):Ie.setLocationAtPoint(Wr,or),Se._applyUpdatedTransform(Ie),this._map._update(),I.noInertia||this._inertia.record(I),this._fireEvents(ne,Te,!0)}_fireEvents(I,ne,Te){const Se=on(this._eventsInProgress),Ie=on(I),ot={};for(const or in I){const{originalEvent:Fr}=I[or];this._eventsInProgress[or]||(ot[`${or}start`]=Fr),this._eventsInProgress[or]=I[or]}!Se&&Ie&&this._fireEvent("movestart",Ie.originalEvent);for(const or in ot)this._fireEvent(or,ot[or]);Ie&&this._fireEvent("move",Ie.originalEvent);for(const or in I){const{originalEvent:Fr}=I[or];this._fireEvent(or,Fr)}const yt={};let Ct;for(const or in this._eventsInProgress){const{handlerName:Fr,originalEvent:Wr}=this._eventsInProgress[or];this._handlersById[Fr].isActive()||(delete this._eventsInProgress[or],Ct=ne[Fr]||Wr,yt[`${or}end`]=Ct)}for(const or in yt)this._fireEvent(or,yt[or]);const Wt=on(this._eventsInProgress),nr=(Se||Ie)&&!Wt;if(nr&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const or=this._map._getTransformForUpdate();or.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(or)}if(Te&&nr){this._updatingCamera=!0;const or=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Fr=Wr=>Wr!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Wa("renderFrame",{timeStamp:I})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class ki extends t.E{constructor(I,ne){super(),this._renderFrameCallback=()=>{const Te=Math.min((i.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(Te)),Te<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=I,this._bearingSnap=ne.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new t.N(this.transform.center.lng,this.transform.center.lat)}setCenter(I,ne){return this.jumpTo({center:I},ne)}panBy(I,ne,Te){return I=t.P.convert(I).mult(-1),this.panTo(this.transform.center,t.e({offset:I},ne),Te)}panTo(I,ne,Te){return this.easeTo(t.e({center:I},ne),Te)}getZoom(){return this.transform.zoom}setZoom(I,ne){return this.jumpTo({zoom:I},ne),this}zoomTo(I,ne,Te){return this.easeTo(t.e({zoom:I},ne),Te)}zoomIn(I,ne){return this.zoomTo(this.getZoom()+1,I,ne),this}zoomOut(I,ne){return this.zoomTo(this.getZoom()-1,I,ne),this}getBearing(){return this.transform.bearing}setBearing(I,ne){return this.jumpTo({bearing:I},ne),this}getPadding(){return this.transform.padding}setPadding(I,ne){return this.jumpTo({padding:I},ne),this}rotateTo(I,ne,Te){return this.easeTo(t.e({bearing:I},ne),Te)}resetNorth(I,ne){return this.rotateTo(0,t.e({duration:1e3},I),ne),this}resetNorthPitch(I,ne){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},I),ne),this}snapToNorth(I,ne){return Math.abs(this.getBearing()){if(this._zooming&&(Se.zoom=t.y.number(Ie,at,sr)),this._rotating&&(Se.bearing=t.y.number(ot,Wt,sr)),this._pitching&&(Se.pitch=t.y.number(yt,nr,sr)),this._padding&&(Se.interpolatePadding(Ct,or,sr),Wr=Se.centerPoint.add(Fr)),this.terrain&&!I.freezeElevation&&this._updateElevation(sr),Et)Se.setLocationAtPoint(Et,Yt);else{const Sr=Se.zoomScale(Se.zoom-Ie),Nr=at>Ie?Math.min(2,gt):Math.max(.5,gt),Qr=Math.pow(Nr,1-sr),ia=Se.unproject(lt.add(Tt.mult(sr*Qr)).mult(Sr));Se.setLocationAtPoint(Se.renderWorldCopies?ia.wrap():ia,Wr)}this._applyUpdatedTransform(Se),this._fireMoveEvents(ne)},sr=>{this.terrain&&I.freezeElevation&&this._finalizeElevation(),this._afterEase(ne,sr)},I),this}_prepareEase(I,ne,Te={}){this._moving=!0,ne||Te.moving||this.fire(new t.k("movestart",I)),this._zooming&&!Te.zooming&&this.fire(new t.k("zoomstart",I)),this._rotating&&!Te.rotating&&this.fire(new t.k("rotatestart",I)),this._pitching&&!Te.pitching&&this.fire(new t.k("pitchstart",I))}_prepareElevation(I){this._elevationCenter=I,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(I,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(I){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const ne=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(I<1&&ne!==this._elevationTarget){const Te=this._elevationTarget-this._elevationStart;this._elevationStart+=I*(Te-(ne-(Te*I+this._elevationStart))/(1-I)),this._elevationTarget=ne}this.transform.elevation=t.y.number(this._elevationStart,this._elevationTarget,I)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(I){const ne=I.getCameraPosition(),Te=this.terrain.getElevationForLngLatZoom(ne.lngLat,I.zoom);if(ne.altitudethis._elevateCameraIfInsideTerrain(Se)),this.transformCameraUpdate&&ne.push(Se=>this.transformCameraUpdate(Se)),!ne.length)return;const Te=I.clone();for(const Se of ne){const Ie=Te.clone(),{center:ot,zoom:yt,pitch:Ct,bearing:Wt,elevation:nr}=Se(Ie);ot&&(Ie.center=ot),yt!==void 0&&(Ie.zoom=yt),Ct!==void 0&&(Ie.pitch=Ct),Wt!==void 0&&(Ie.bearing=Wt),nr!==void 0&&(Ie.elevation=nr),Te.apply(Ie)}this.transform.apply(Te)}_fireMoveEvents(I){this.fire(new t.k("move",I)),this._zooming&&this.fire(new t.k("zoom",I)),this._rotating&&this.fire(new t.k("rotate",I)),this._pitching&&this.fire(new t.k("pitch",I))}_afterEase(I,ne){if(this._easeId&&ne&&this._easeId===ne)return;delete this._easeId;const Te=this._zooming,Se=this._rotating,Ie=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,Te&&this.fire(new t.k("zoomend",I)),Se&&this.fire(new t.k("rotateend",I)),Ie&&this.fire(new t.k("pitchend",I)),this.fire(new t.k("moveend",I))}flyTo(I,ne){var Te;if(!I.essential&&i.prefersReducedMotion){const ln=t.M(I,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ln,ne)}this.stop(),I=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},I);const Se=this._getTransformForUpdate(),Ie=Se.zoom,ot=Se.bearing,yt=Se.pitch,Ct=Se.padding,Wt="bearing"in I?this._normalizeBearing(I.bearing,ot):ot,nr="pitch"in I?+I.pitch:yt,or="padding"in I?I.padding:Se.padding,Fr=t.P.convert(I.offset);let Wr=Se.centerPoint.add(Fr);const je=Se.pointLocation(Wr),{center:Ze,zoom:at}=Se.getConstrained(t.N.convert(I.center||je),(Te=I.zoom)!==null&&Te!==void 0?Te:Ie);this._normalizeCenter(Ze,Se);const lt=Se.zoomScale(at-Ie),Tt=Se.project(je),gt=Se.project(Ze).sub(Tt);let Et=I.curve;const Yt=Math.max(Se.width,Se.height),rr=Yt/lt,sr=gt.mag();if("minZoom"in I){const ln=t.ac(Math.min(I.minZoom,Ie,at),Se.minZoom,Se.maxZoom),Nn=Yt/Se.zoomScale(ln-Ie);Et=Math.sqrt(Nn/sr*2)}const Sr=Et*Et;function Nr(ln){const Nn=(rr*rr-Yt*Yt+(ln?-1:1)*Sr*Sr*sr*sr)/(2*(ln?rr:Yt)*Sr*sr);return Math.log(Math.sqrt(Nn*Nn+1)-Nn)}function Qr(ln){return(Math.exp(ln)-Math.exp(-ln))/2}function ia(ln){return(Math.exp(ln)+Math.exp(-ln))/2}const _a=Nr(!1);let za=function(ln){return ia(_a)/ia(_a+Et*ln)},nn=function(ln){return Yt*((ia(_a)*(Qr(Nn=_a+Et*ln)/ia(Nn))-Qr(_a))/Sr)/sr;var Nn},en=(Nr(!0)-_a)/Et;if(Math.abs(sr)<1e-6||!isFinite(en)){if(Math.abs(Yt-rr)<1e-6)return this.easeTo(I,ne);const ln=rr0,za=Nn=>Math.exp(ln*Et*Nn)}return I.duration="duration"in I?+I.duration:1e3*en/("screenSpeed"in I?+I.screenSpeed/Et:+I.speed),I.maxDuration&&I.duration>I.maxDuration&&(I.duration=0),this._zooming=!0,this._rotating=ot!==Wt,this._pitching=nr!==yt,this._padding=!Se.isPaddingEqual(or),this._prepareEase(ne,!1),this.terrain&&this._prepareElevation(Ze),this._ease(ln=>{const Nn=ln*en,pi=1/za(Nn);Se.zoom=ln===1?at:Ie+Se.scaleZoom(pi),this._rotating&&(Se.bearing=t.y.number(ot,Wt,ln)),this._pitching&&(Se.pitch=t.y.number(yt,nr,ln)),this._padding&&(Se.interpolatePadding(Ct,or,ln),Wr=Se.centerPoint.add(Fr)),this.terrain&&!I.freezeElevation&&this._updateElevation(ln);const ii=ln===1?Ze:Se.unproject(Tt.add(gt.mult(nn(Nn))).mult(pi));Se.setLocationAtPoint(Se.renderWorldCopies?ii.wrap():ii,Wr),this._applyUpdatedTransform(Se),this._fireMoveEvents(ne)},()=>{this.terrain&&I.freezeElevation&&this._finalizeElevation(),this._afterEase(ne)},I),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(I,ne){var Te;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const Se=this._onEaseEnd;delete this._onEaseEnd,Se.call(this,ne)}return I||(Te=this.handlers)===null||Te===void 0||Te.stop(!1),this}_ease(I,ne,Te){Te.animate===!1||Te.duration===0?(I(1),ne()):(this._easeStart=i.now(),this._easeOptions=Te,this._onEaseFrame=I,this._onEaseEnd=ne,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(I,ne){I=t.b3(I,-180,180);const Te=Math.abs(I-ne);return Math.abs(I-360-ne)180?-360:Te<-180?360:0}queryTerrainElevation(I){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(I),this.transform.tileZoom)-this.transform.elevation:null}}const ji={compact:!0,customAttribution:'MapLibre'};class Ni{constructor(I=ji){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=ne=>{!ne||ne.sourceDataType!=="metadata"&&ne.sourceDataType!=="visibility"&&ne.dataType!=="style"&&ne.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=I}getDefaultPosition(){return"bottom-right"}onAdd(I){return this._map=I,this._compact=this.options.compact,this._container=n.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=n.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=n.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){n.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(I,ne){const Te=this._map._getUIString(`AttributionControl.${ne}`);I.title=Te,I.setAttribute("aria-label",Te)}_updateAttributions(){if(!this._map.style)return;let I=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?I=I.concat(this.options.customAttribution.map(Se=>typeof Se!="string"?"":Se)):typeof this.options.customAttribution=="string"&&I.push(this.options.customAttribution)),this._map.style.stylesheet){const Se=this._map.style.stylesheet;this.styleOwner=Se.owner,this.styleId=Se.id}const ne=this._map.style.sourceCaches;for(const Se in ne){const Ie=ne[Se];if(Ie.used||Ie.usedForTerrain){const ot=Ie.getSource();ot.attribution&&I.indexOf(ot.attribution)<0&&I.push(ot.attribution)}}I=I.filter(Se=>String(Se).trim()),I.sort((Se,Ie)=>Se.length-Ie.length),I=I.filter((Se,Ie)=>{for(let ot=Ie+1;ot=0)return!1;return!0});const Te=I.join(" | ");Te!==this._attribHTML&&(this._attribHTML=Te,I.length?(this._innerContainer.innerHTML=Te,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Bn{constructor(I={}){this._updateCompact=()=>{const ne=this._container.children;if(ne.length){const Te=ne[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&Te.classList.add("maplibregl-compact"):Te.classList.remove("maplibregl-compact")}},this.options=I}getDefaultPosition(){return"bottom-left"}onAdd(I){this._map=I,this._compact=this.options&&this.options.compact,this._container=n.create("div","maplibregl-ctrl");const ne=n.create("a","maplibregl-ctrl-logo");return ne.target="_blank",ne.rel="noopener nofollow",ne.href="https://maplibre.org/",ne.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),ne.setAttribute("rel","noopener nofollow"),this._container.appendChild(ne),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){n.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class An{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(I){const ne=++this._id;return this._queue.push({callback:I,id:ne,cancelled:!1}),ne}remove(I){const ne=this._currentlyRunning,Te=ne?this._queue.concat(ne):this._queue;for(const Se of Te)if(Se.id===I)return void(Se.cancelled=!0)}run(I=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const ne=this._currentlyRunning=this._queue;this._queue=[];for(const Te of ne)if(!Te.cancelled&&(Te.callback(I),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ki=t.Y([{name:"a_pos3d",type:"Int16",components:3}]);class ko extends t.E{constructor(I){super(),this.sourceCache=I,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,I.usedForTerrain=!0,I.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(I,ne){this.sourceCache.update(I,ne),this._renderableTilesKeys=[];const Te={};for(const Se of I.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:ne}))Te[Se.key]=!0,this._renderableTilesKeys.push(Se.key),this._tiles[Se.key]||(Se.posMatrix=new Float64Array(16),t.aP(Se.posMatrix,0,t.X,0,t.X,0,1),this._tiles[Se.key]=new rt(Se,this.tileSize));for(const Se in this._tiles)Te[Se]||delete this._tiles[Se]}freeRtt(I){for(const ne in this._tiles){const Te=this._tiles[ne];(!I||Te.tileID.equals(I)||Te.tileID.isChildOf(I)||I.isChildOf(Te.tileID))&&(Te.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(I=>this.getTileByID(I))}getTileByID(I){return this._tiles[I]}getTerrainCoords(I){const ne={};for(const Te of this._renderableTilesKeys){const Se=this._tiles[Te].tileID;if(Se.canonical.equals(I.canonical)){const Ie=I.clone();Ie.posMatrix=new Float64Array(16),t.aP(Ie.posMatrix,0,t.X,0,t.X,0,1),ne[Te]=Ie}else if(Se.canonical.isChildOf(I.canonical)){const Ie=I.clone();Ie.posMatrix=new Float64Array(16);const ot=Se.canonical.z-I.canonical.z,yt=Se.canonical.x-(Se.canonical.x>>ot<>ot<>ot;t.aP(Ie.posMatrix,0,Wt,0,Wt,0,1),t.J(Ie.posMatrix,Ie.posMatrix,[-yt*Wt,-Ct*Wt,0]),ne[Te]=Ie}else if(I.canonical.isChildOf(Se.canonical)){const Ie=I.clone();Ie.posMatrix=new Float64Array(16);const ot=I.canonical.z-Se.canonical.z,yt=I.canonical.x-(I.canonical.x>>ot<>ot<>ot;t.aP(Ie.posMatrix,0,t.X,0,t.X,0,1),t.J(Ie.posMatrix,Ie.posMatrix,[yt*Wt,Ct*Wt,0]),t.K(Ie.posMatrix,Ie.posMatrix,[1/2**ot,1/2**ot,0]),ne[Te]=Ie}}return ne}getSourceTile(I,ne){const Te=this.sourceCache._source;let Se=I.overscaledZ-this.deltaZoom;if(Se>Te.maxzoom&&(Se=Te.maxzoom),Se=Te.minzoom&&(!Ie||!Ie.dem);)Ie=this.sourceCache.getTileByID(I.scaledTo(Se--).key);return Ie}tilesAfterTime(I=Date.now()){return Object.values(this._tiles).filter(ne=>ne.timeAdded>=I)}}class $o{constructor(I,ne,Te){this.painter=I,this.sourceCache=new ko(ne),this.options=Te,this.exaggeration=typeof Te.exaggeration=="number"?Te.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(I,ne,Te,Se=t.X){var Ie;if(!(ne>=0&&ne=0&&TeI.canonical.z&&(I.canonical.z>=Se?Ie=I.canonical.z-Se:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const ot=I.canonical.x-(I.canonical.x>>Ie<>Ie<>8<<4|Ie>>8,ne[ot+3]=0;const Te=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(ne.buffer)),Se=new u(I,Te,I.gl.RGBA,{premultiply:!1});return Se.bind(I.gl.NEAREST,I.gl.CLAMP_TO_EDGE),this._coordsTexture=Se,Se}pointCoordinate(I){this.painter.maybeDrawDepthAndCoords(!0);const ne=new Uint8Array(4),Te=this.painter.context,Se=Te.gl,Ie=Math.round(I.x*this.painter.pixelRatio/devicePixelRatio),ot=Math.round(I.y*this.painter.pixelRatio/devicePixelRatio),yt=Math.round(this.painter.height/devicePixelRatio);Te.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),Se.readPixels(Ie,yt-ot-1,1,1,Se.RGBA,Se.UNSIGNED_BYTE,ne),Te.bindFramebuffer.set(null);const Ct=ne[0]+(ne[2]>>4<<8),Wt=ne[1]+((15&ne[2])<<8),nr=this.coordsIndex[255-ne[3]],or=nr&&this.sourceCache.getTileByID(nr);if(!or)return null;const Fr=this._coordsTextureSize,Wr=(1<I.id!==ne),this._recentlyUsed.push(I.id)}stampObject(I){I.stamp=++this._stamp}getOrCreateFreeObject(){for(const ne of this._recentlyUsed)if(!this._objects[ne].inUse)return this._objects[ne];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const I=this._createObject(this._objects.length);return this._objects.push(I),I}freeObject(I){I.inUse=!1}freeAllObjects(){for(const I of this._objects)this.freeObject(I)}isFull(){return!(this._objects.length!I.inUse)===!1}}const os={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class As{constructor(I,ne){this.painter=I,this.terrain=ne,this.pool=new Ls(I.context,30,ne.sourceCache.tileSize*ne.qualityFactor)}destruct(){this.pool.destruct()}getTexture(I){return this.pool.getObjectForId(I.rtt[this._stacks.length-1].id).texture}prepareForRender(I,ne){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=I._order.filter(Te=>!I._layers[Te].isHidden(ne)),this._coordsDescendingInv={};for(const Te in I.sourceCaches){this._coordsDescendingInv[Te]={};const Se=I.sourceCaches[Te].getVisibleCoordinates();for(const Ie of Se){const ot=this.terrain.sourceCache.getTerrainCoords(Ie);for(const yt in ot)this._coordsDescendingInv[Te][yt]||(this._coordsDescendingInv[Te][yt]=[]),this._coordsDescendingInv[Te][yt].push(ot[yt])}}this._coordsDescendingInvStr={};for(const Te of I._order){const Se=I._layers[Te],Ie=Se.source;if(os[Se.type]&&!this._coordsDescendingInvStr[Ie]){this._coordsDescendingInvStr[Ie]={};for(const ot in this._coordsDescendingInv[Ie])this._coordsDescendingInvStr[Ie][ot]=this._coordsDescendingInv[Ie][ot].map(yt=>yt.key).sort().join()}}for(const Te of this._renderableTiles)for(const Se in this._coordsDescendingInvStr){const Ie=this._coordsDescendingInvStr[Se][Te.tileID.key];Ie&&Ie!==Te.rttCoords[Se]&&(Te.rtt=[])}}renderLayer(I){if(I.isHidden(this.painter.transform.zoom))return!1;const ne=I.type,Te=this.painter,Se=this._renderableLayerIds[this._renderableLayerIds.length-1]===I.id;if(os[ne]&&(this._prevType&&os[this._prevType]||this._stacks.push([]),this._prevType=ne,this._stacks[this._stacks.length-1].push(I.id),!Se))return!0;if(os[this._prevType]||os[ne]&&Se){this._prevType=ne;const Ie=this._stacks.length-1,ot=this._stacks[Ie]||[];for(const yt of this._renderableTiles){if(this.pool.isFull()&&(Fl(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(yt),yt.rtt[Ie]){const Wt=this.pool.getObjectForId(yt.rtt[Ie].id);if(Wt.stamp===yt.rtt[Ie].stamp){this.pool.useObject(Wt);continue}}const Ct=this.pool.getOrCreateFreeObject();this.pool.useObject(Ct),this.pool.stampObject(Ct),yt.rtt[Ie]={id:Ct.id,stamp:Ct.stamp},Te.context.bindFramebuffer.set(Ct.fbo.framebuffer),Te.context.clear({color:t.aM.transparent,stencil:0}),Te.currentStencilSource=void 0;for(let Wt=0;Wt{De.touchstart=De.dragStart,De.touchmoveWindow=De.dragMove,De.touchend=De.dragEnd},fi={showCompass:!0,showZoom:!0,visualizePitch:!1};class ao{constructor(I,ne,Te=!1){this.mousedown=ot=>{this.startMouse(t.e({},ot,{ctrlKey:!0,preventDefault:()=>ot.preventDefault()}),n.mousePos(this.element,ot)),n.addEventListener(window,"mousemove",this.mousemove),n.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=ot=>{this.moveMouse(ot,n.mousePos(this.element,ot))},this.mouseup=ot=>{this.mouseRotate.dragEnd(ot),this.mousePitch&&this.mousePitch.dragEnd(ot),this.offTemp()},this.touchstart=ot=>{ot.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=n.touchPos(this.element,ot.targetTouches)[0],this.startTouch(ot,this._startPos),n.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.addEventListener(window,"touchend",this.touchend))},this.touchmove=ot=>{ot.targetTouches.length!==1?this.reset():(this._lastPos=n.touchPos(this.element,ot.targetTouches)[0],this.moveTouch(ot,this._lastPos))},this.touchend=ot=>{ot.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const Se=I.dragRotate._mouseRotate.getClickTolerance(),Ie=I.dragRotate._mousePitch.getClickTolerance();this.element=ne,this.mouseRotate=xl({clickTolerance:Se,enable:!0}),this.touchRotate=(({enable:ot,clickTolerance:yt,bearingDegreesPerPixelMoved:Ct=.8})=>{const Wt=new bc;return new iu({clickTolerance:yt,move:(nr,or)=>({bearingDelta:(or.x-nr.x)*Ct}),moveStateManager:Wt,enable:ot,assignEvents:Ss})})({clickTolerance:Se,enable:!0}),this.map=I,Te&&(this.mousePitch=nf({clickTolerance:Ie,enable:!0}),this.touchPitch=(({enable:ot,clickTolerance:yt,pitchDegreesPerPixelMoved:Ct=-.5})=>{const Wt=new bc;return new iu({clickTolerance:yt,move:(nr,or)=>({pitchDelta:(or.y-nr.y)*Ct}),moveStateManager:Wt,enable:ot,assignEvents:Ss})})({clickTolerance:Ie,enable:!0})),n.addEventListener(ne,"mousedown",this.mousedown),n.addEventListener(ne,"touchstart",this.touchstart,{passive:!1}),n.addEventListener(ne,"touchcancel",this.reset)}startMouse(I,ne){this.mouseRotate.dragStart(I,ne),this.mousePitch&&this.mousePitch.dragStart(I,ne),n.disableDrag()}startTouch(I,ne){this.touchRotate.dragStart(I,ne),this.touchPitch&&this.touchPitch.dragStart(I,ne),n.disableDrag()}moveMouse(I,ne){const Te=this.map,{bearingDelta:Se}=this.mouseRotate.dragMove(I,ne)||{};if(Se&&Te.setBearing(Te.getBearing()+Se),this.mousePitch){const{pitchDelta:Ie}=this.mousePitch.dragMove(I,ne)||{};Ie&&Te.setPitch(Te.getPitch()+Ie)}}moveTouch(I,ne){const Te=this.map,{bearingDelta:Se}=this.touchRotate.dragMove(I,ne)||{};if(Se&&Te.setBearing(Te.getBearing()+Se),this.touchPitch){const{pitchDelta:Ie}=this.touchPitch.dragMove(I,ne)||{};Ie&&Te.setPitch(Te.getPitch()+Ie)}}off(){const I=this.element;n.removeEventListener(I,"mousedown",this.mousedown),n.removeEventListener(I,"touchstart",this.touchstart,{passive:!1}),n.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.removeEventListener(window,"touchend",this.touchend),n.removeEventListener(I,"touchcancel",this.reset),this.offTemp()}offTemp(){n.enableDrag(),n.removeEventListener(window,"mousemove",this.mousemove),n.removeEventListener(window,"mouseup",this.mouseup),n.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),n.removeEventListener(window,"touchend",this.touchend)}}let gs;function Jo(De,I,ne){const Te=new t.N(De.lng,De.lat);if(De=new t.N(De.lng,De.lat),I){const Se=new t.N(De.lng-360,De.lat),Ie=new t.N(De.lng+360,De.lat),ot=ne.locationPoint(De).distSqr(I);ne.locationPoint(Se).distSqr(I)180;){const Se=ne.locationPoint(De);if(Se.x>=0&&Se.y>=0&&Se.x<=ne.width&&Se.y<=ne.height)break;De.lng>ne.center.lng?De.lng-=360:De.lng+=360}return De.lng!==Te.lng&&ne.locationPoint(De).y>ne.height/2-ne.getHorizon()?De:Te}const Bl={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function jl(De,I,ne){const Te=De.classList;for(const Se in Bl)Te.remove(`maplibregl-${ne}-anchor-${Se}`);Te.add(`maplibregl-${ne}-anchor-${I}`)}class Vl extends t.E{constructor(I){if(super(),this._onKeyPress=ne=>{const Te=ne.code,Se=ne.charCode||ne.keyCode;Te!=="Space"&&Te!=="Enter"&&Se!==32&&Se!==13||this.togglePopup()},this._onMapClick=ne=>{const Te=ne.originalEvent.target,Se=this._element;this._popup&&(Te===Se||Se.contains(Te))&&this.togglePopup()},this._update=ne=>{var Te;if(!this._map)return;const Se=this._map.loaded()&&!this._map.isMoving();((ne==null?void 0:ne.type)==="terrain"||(ne==null?void 0:ne.type)==="render"&&!Se)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Jo(this._lngLat,this._flatPos,this._map.transform):(Te=this._lngLat)===null||Te===void 0?void 0:Te.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let Ie="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?Ie=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(Ie=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let ot="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?ot="rotateX(0deg)":this._pitchAlignment==="map"&&(ot=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||ne&&ne.type!=="moveend"||(this._pos=this._pos.round()),n.setTransform(this._element,`${Bl[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${ot} ${Ie}`),i.frameAsync(new AbortController).then(()=>{this._updateOpacity(ne&&ne.type==="moveend")}).catch(()=>{})},this._onMove=ne=>{if(!this._isDragging){const Te=this._clickTolerance||this._map._clickTolerance;this._isDragging=ne.point.dist(this._pointerdownPos)>=Te}this._isDragging&&(this._pos=ne.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new t.k("dragstart"))),this.fire(new t.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new t.k("dragend")),this._state="inactive"},this._addDragHandler=ne=>{this._element.contains(ne.originalEvent.target)&&(ne.preventDefault(),this._positionDelta=ne.point.sub(this._pos).add(this._offset),this._pointerdownPos=ne.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=I&&I.anchor||"center",this._color=I&&I.color||"#3FB1CE",this._scale=I&&I.scale||1,this._draggable=I&&I.draggable||!1,this._clickTolerance=I&&I.clickTolerance||0,this._subpixelPositioning=I&&I.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=I&&I.rotation||0,this._rotationAlignment=I&&I.rotationAlignment||"auto",this._pitchAlignment=I&&I.pitchAlignment&&I.pitchAlignment!=="auto"?I.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(I==null?void 0:I.opacity,I==null?void 0:I.opacityWhenCovered),I&&I.element)this._element=I.element,this._offset=t.P.convert(I&&I.offset||[0,0]);else{this._defaultMarker=!0,this._element=n.create("div");const ne=n.createNS("http://www.w3.org/2000/svg","svg"),Te=41,Se=27;ne.setAttributeNS(null,"display","block"),ne.setAttributeNS(null,"height",`${Te}px`),ne.setAttributeNS(null,"width",`${Se}px`),ne.setAttributeNS(null,"viewBox",`0 0 ${Se} ${Te}`);const Ie=n.createNS("http://www.w3.org/2000/svg","g");Ie.setAttributeNS(null,"stroke","none"),Ie.setAttributeNS(null,"stroke-width","1"),Ie.setAttributeNS(null,"fill","none"),Ie.setAttributeNS(null,"fill-rule","evenodd");const ot=n.createNS("http://www.w3.org/2000/svg","g");ot.setAttributeNS(null,"fill-rule","nonzero");const yt=n.createNS("http://www.w3.org/2000/svg","g");yt.setAttributeNS(null,"transform","translate(3.0, 29.0)"),yt.setAttributeNS(null,"fill","#000000");const Ct=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const lt of Ct){const Tt=n.createNS("http://www.w3.org/2000/svg","ellipse");Tt.setAttributeNS(null,"opacity","0.04"),Tt.setAttributeNS(null,"cx","10.5"),Tt.setAttributeNS(null,"cy","5.80029008"),Tt.setAttributeNS(null,"rx",lt.rx),Tt.setAttributeNS(null,"ry",lt.ry),yt.appendChild(Tt)}const Wt=n.createNS("http://www.w3.org/2000/svg","g");Wt.setAttributeNS(null,"fill",this._color);const nr=n.createNS("http://www.w3.org/2000/svg","path");nr.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),Wt.appendChild(nr);const or=n.createNS("http://www.w3.org/2000/svg","g");or.setAttributeNS(null,"opacity","0.25"),or.setAttributeNS(null,"fill","#000000");const Fr=n.createNS("http://www.w3.org/2000/svg","path");Fr.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),or.appendChild(Fr);const Wr=n.createNS("http://www.w3.org/2000/svg","g");Wr.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Wr.setAttributeNS(null,"fill","#FFFFFF");const je=n.createNS("http://www.w3.org/2000/svg","g");je.setAttributeNS(null,"transform","translate(8.0, 8.0)");const Ze=n.createNS("http://www.w3.org/2000/svg","circle");Ze.setAttributeNS(null,"fill","#000000"),Ze.setAttributeNS(null,"opacity","0.25"),Ze.setAttributeNS(null,"cx","5.5"),Ze.setAttributeNS(null,"cy","5.5"),Ze.setAttributeNS(null,"r","5.4999962");const at=n.createNS("http://www.w3.org/2000/svg","circle");at.setAttributeNS(null,"fill","#FFFFFF"),at.setAttributeNS(null,"cx","5.5"),at.setAttributeNS(null,"cy","5.5"),at.setAttributeNS(null,"r","5.4999962"),je.appendChild(Ze),je.appendChild(at),ot.appendChild(yt),ot.appendChild(Wt),ot.appendChild(or),ot.appendChild(Wr),ot.appendChild(je),ne.appendChild(ot),ne.setAttributeNS(null,"height",Te*this._scale+"px"),ne.setAttributeNS(null,"width",Se*this._scale+"px"),this._element.appendChild(ne),this._offset=t.P.convert(I&&I.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",ne=>{ne.preventDefault()}),this._element.addEventListener("mousedown",ne=>{ne.preventDefault()}),jl(this._element,this._anchor,"marker"),I&&I.className)for(const ne of I.className.split(" "))this._element.classList.add(ne);this._popup=null}addTo(I){return this.remove(),this._map=I,this._element.setAttribute("aria-label",I._getUIString("Marker.Title")),I.getCanvasContainer().appendChild(this._element),I.on("move",this._update),I.on("moveend",this._update),I.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),n.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(I){return this._lngLat=t.N.convert(I),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(I){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),I){if(!("offset"in I.options)){const Se=Math.abs(13.5)/Math.SQRT2;I.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[Se,-1*(38.1-13.5+Se)],"bottom-right":[-Se,-1*(38.1-13.5+Se)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=I,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(I){return this._subpixelPositioning=I,this}getPopup(){return this._popup}togglePopup(){const I=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:I?(I.isOpen()?I.remove():(I.setLngLat(this._lngLat),I.addTo(this._map)),this):this}_updateOpacity(I=!1){var ne,Te;if(!(!((ne=this._map)===null||ne===void 0)&&ne.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(I)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const Se=this._map,Ie=Se.terrain.depthAtPoint(this._pos),ot=Se.terrain.getElevationForLngLatZoom(this._lngLat,Se.transform.tileZoom);if(Se.transform.lngLatToCameraDepth(this._lngLat,ot)-Ie<.006)return void(this._element.style.opacity=this._opacity);const yt=-this._offset.y/Se.transform._pixelPerMeter,Ct=Math.sin(Se.getPitch()*Math.PI/180)*yt,Wt=Se.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),nr=Se.transform.lngLatToCameraDepth(this._lngLat,ot+Ct)-Wt>.006;!((Te=this._popup)===null||Te===void 0)&&Te.isOpen()&&nr&&this._popup.remove(),this._element.style.opacity=nr?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(I){return this._offset=t.P.convert(I),this._update(),this}addClassName(I){this._element.classList.add(I)}removeClassName(I){this._element.classList.remove(I)}toggleClassName(I){return this._element.classList.toggle(I)}setDraggable(I){return this._draggable=!!I,this._map&&(I?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(I){return this._rotation=I||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(I){return this._rotationAlignment=I||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(I){return this._pitchAlignment=I&&I!=="auto"?I:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(I,ne){return I===void 0&&ne===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),I!==void 0&&(this._opacity=I),ne!==void 0&&(this._opacityWhenCovered=ne),this._map&&this._updateOpacity(!0),this}}const cc={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let ql=0,Vu=!1;const ol={maxWidth:100,unit:"metric"};function rc(De,I,ne){const Te=ne&&ne.maxWidth||100,Se=De._container.clientHeight/2,Ie=De.unproject([0,Se]),ot=De.unproject([Te,Se]),yt=Ie.distanceTo(ot);if(ne&&ne.unit==="imperial"){const Ct=3.2808*yt;Ct>5280?Vi(I,Te,Ct/5280,De._getUIString("ScaleControl.Miles")):Vi(I,Te,Ct,De._getUIString("ScaleControl.Feet"))}else ne&&ne.unit==="nautical"?Vi(I,Te,yt/1852,De._getUIString("ScaleControl.NauticalMiles")):yt>=1e3?Vi(I,Te,yt/1e3,De._getUIString("ScaleControl.Kilometers")):Vi(I,Te,yt,De._getUIString("ScaleControl.Meters"))}function Vi(De,I,ne,Te){const Se=function(Ie){const ot=Math.pow(10,`${Math.floor(Ie)}`.length-1);let yt=Ie/ot;return yt=yt>=10?10:yt>=5?5:yt>=3?3:yt>=2?2:yt>=1?1:function(Ct){const Wt=Math.pow(10,Math.ceil(-Math.log(Ct)/Math.LN10));return Math.round(Ct*Wt)/Wt}(yt),ot*yt}(ne);De.style.width=I*(Se/ne)+"px",De.innerHTML=`${Se} ${Te}`}const eo={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},qu=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Du(De){if(De){if(typeof De=="number"){const I=Math.round(Math.abs(De)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,De),"top-left":new t.P(I,I),"top-right":new t.P(-I,I),bottom:new t.P(0,-De),"bottom-left":new t.P(I,-I),"bottom-right":new t.P(-I,-I),left:new t.P(De,0),right:new t.P(-De,0)}}if(De instanceof t.P||Array.isArray(De)){const I=t.P.convert(De);return{center:I,top:I,"top-left":I,"top-right":I,bottom:I,"bottom-left":I,"bottom-right":I,left:I,right:I}}return{center:t.P.convert(De.center||[0,0]),top:t.P.convert(De.top||[0,0]),"top-left":t.P.convert(De["top-left"]||[0,0]),"top-right":t.P.convert(De["top-right"]||[0,0]),bottom:t.P.convert(De.bottom||[0,0]),"bottom-left":t.P.convert(De["bottom-left"]||[0,0]),"bottom-right":t.P.convert(De["bottom-right"]||[0,0]),left:t.P.convert(De.left||[0,0]),right:t.P.convert(De.right||[0,0])}}return Du(new t.P(0,0))}const wc=r;e.AJAXError=t.bh,e.Evented=t.E,e.LngLat=t.N,e.MercatorCoordinate=t.Z,e.Point=t.P,e.addProtocol=t.bi,e.config=t.a,e.removeProtocol=t.bj,e.AttributionControl=Ni,e.BoxZoomHandler=du,e.CanvasSource=Ke,e.CooperativeGesturesHandler=_n,e.DoubleClickZoomHandler=Fa,e.DragPanHandler=gn,e.DragRotateHandler=kn,e.EdgeInsets=Tu,e.FullscreenControl=class extends t.E{constructor(De={}){super(),this._onFullscreenChange=()=>{var I;let ne=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((I=ne==null?void 0:ne.shadowRoot)===null||I===void 0)&&I.fullscreenElement;)ne=ne.shadowRoot.fullscreenElement;ne===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,De&&De.container&&(De.container instanceof HTMLElement?this._container=De.container:t.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(De){return this._map=De,this._container||(this._container=this._map.getContainer()),this._controlContainer=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){n.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const De=this._fullscreenButton=n.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);n.create("span","maplibregl-ctrl-icon",De).setAttribute("aria-hidden","true"),De.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const De=this._getTitle();this._fullscreenButton.setAttribute("aria-label",De),this._fullscreenButton.title=De}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new t.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},e.GeoJSONSource=Ce,e.GeolocateControl=class extends t.E{constructor(De){super(),this._onSuccess=I=>{if(this._map){if(this._isOutOfMapMaxBounds(I))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",I)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=I,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(I),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(I),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",I)),this._finish()}},this._updateCamera=I=>{const ne=new t.N(I.coords.longitude,I.coords.latitude),Te=I.coords.accuracy,Se=this._map.getBearing(),Ie=t.e({bearing:Se},this.options.fitBoundsOptions),ot=ie.fromLngLat(ne,Te);this._map.fitBounds(ot,Ie,{geolocateSource:!0})},this._updateMarker=I=>{if(I){const ne=new t.N(I.coords.longitude,I.coords.latitude);this._accuracyCircleMarker.setLngLat(ne).addTo(this._map),this._userLocationDotMarker.setLngLat(ne).addTo(this._map),this._accuracy=I.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=I=>{if(this._map){if(this.options.trackUserLocation)if(I.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const ne=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=ne,this._geolocateButton.setAttribute("aria-label",ne),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(I.code===3&&Vu)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",I)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",I=>I.preventDefault()),this._geolocateButton=n.create("button","maplibregl-ctrl-geolocate",this._container),n.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=I=>{if(this._map){if(I===!1){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");const ne=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=ne,this._geolocateButton.setAttribute("aria-label",ne)}else{const ne=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=ne,this._geolocateButton.setAttribute("aria-label",ne)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=n.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Vl({element:this._dotElement}),this._circleElement=n.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Vl({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",ne=>{ne.geolocateSource||this._watchState!=="ACTIVE_LOCK"||ne.originalEvent&&ne.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new t.k("trackuserlocationend")),this.fire(new t.k("userlocationlostfocus")))})}},this.options=t.e({},cc,De)}onAdd(De){return this._map=De,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return t._(this,arguments,void 0,function*(I=!1){if(gs!==void 0&&!I)return gs;if(window.navigator.permissions===void 0)return gs=!!window.navigator.geolocation,gs;try{gs=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{gs=!!window.navigator.geolocation}return gs})}().then(I=>this._finishSetupUI(I)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),n.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ql=0,Vu=!1}_isOutOfMapMaxBounds(De){const I=this._map.getMaxBounds(),ne=De.coords;return I&&(ne.longitudeI.getEast()||ne.latitudeI.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const De=this._map.getBounds(),I=De.getSouthEast(),ne=De.getNorthEast(),Te=I.distanceTo(ne),Se=Math.ceil(this._accuracy/(Te/this._map._container.clientHeight)*2);this._circleElement.style.width=`${Se}px`,this._circleElement.style.height=`${Se}px`}trigger(){if(!this._setup)return t.w("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 t.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ql--,Vu=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new t.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.k("trackuserlocationstart")),this.fire(new t.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let De;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ql++,ql>1?(De={maximumAge:6e5,timeout:0},Vu=!0):(De=this.options.positionOptions,Vu=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,De)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},e.Hash=Pu,e.ImageSource=et,e.KeyboardHandler=ur,e.LngLatBounds=ie,e.LogoControl=Bn,e.Map=class extends ki{constructor(De){t.bf.mark(t.bg.create);const I=Object.assign(Object.assign({},Qs),De);if(I.minZoom!=null&&I.maxZoom!=null&&I.minZoom>I.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(I.minPitch!=null&&I.maxPitch!=null&&I.minPitch>I.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(I.minPitch!=null&&I.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(I.maxPitch!=null&&I.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Ns(I.minZoom,I.maxZoom,I.minPitch,I.maxPitch,I.renderWorldCopies),{bearingSnap:I.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new An,this._controls=[],this._mapId=t.a4(),this._contextLost=ne=>{ne.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:ne}))},this._contextRestored=ne=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:ne}))},this._onMapScroll=ne=>{if(ne.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=I.interactive,this._maxTileCacheSize=I.maxTileCacheSize,this._maxTileCacheZoomLevels=I.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=I.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=I.preserveDrawingBuffer===!0,this._antialias=I.antialias===!0,this._trackResize=I.trackResize===!0,this._bearingSnap=I.bearingSnap,this._refreshExpiredTiles=I.refreshExpiredTiles===!0,this._fadeDuration=I.fadeDuration,this._crossSourceCollisions=I.crossSourceCollisions===!0,this._collectResourceTiming=I.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},jo),I.locale),this._clickTolerance=I.clickTolerance,this._overridePixelRatio=I.pixelRatio,this._maxCanvasSize=I.maxCanvasSize,this.transformCameraUpdate=I.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=I.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=l.addThrottleControl(()=>this.isMoving()),this._requestManager=new y(I.transformRequest),typeof I.container=="string"){if(this._container=document.getElementById(I.container),!this._container)throw new Error(`Container '${I.container}' not found.`)}else{if(!(I.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=I.container}if(I.maxBounds&&this.setMaxBounds(I.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let ne=!1;const Te=yc(Se=>{this._trackResize&&!this._removed&&(this.resize(Se),this.redraw())},50);this._resizeObserver=new ResizeObserver(Se=>{ne?Te(Se):ne=!0}),this._resizeObserver.observe(this._container)}this.handlers=new zi(this,I),this._hash=I.hash&&new Pu(typeof I.hash=="string"&&I.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:I.center,zoom:I.zoom,bearing:I.bearing,pitch:I.pitch}),I.bounds&&(this.resize(),this.fitBounds(I.bounds,t.e({},I.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=I.localIdeographFontFamily,this._validateStyle=I.validateStyle,I.style&&this.setStyle(I.style,{localIdeographFontFamily:I.localIdeographFontFamily}),I.attributionControl&&this.addControl(new Ni(typeof I.attributionControl=="boolean"?void 0:I.attributionControl)),I.maplibreLogo&&this.addControl(new Bn,I.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",ne=>{this._update(ne.dataType==="style"),this.fire(new t.k(`${ne.dataType}data`,ne))}),this.on("dataloading",ne=>{this.fire(new t.k(`${ne.dataType}dataloading`,ne))}),this.on("dataabort",ne=>{this.fire(new t.k("sourcedataabort",ne))})}_getMapId(){return this._mapId}addControl(De,I){if(I===void 0&&(I=De.getDefaultPosition?De.getDefaultPosition():"top-right"),!De||!De.onAdd)return this.fire(new t.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const ne=De.onAdd(this);this._controls.push(De);const Te=this._controlPositions[I];return I.indexOf("bottom")!==-1?Te.insertBefore(ne,Te.firstChild):Te.appendChild(ne),this}removeControl(De){if(!De||!De.onRemove)return this.fire(new t.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const I=this._controls.indexOf(De);return I>-1&&this._controls.splice(I,1),De.onRemove(this),this}hasControl(De){return this._controls.indexOf(De)>-1}calculateCameraOptionsFromTo(De,I,ne,Te){return Te==null&&this.terrain&&(Te=this.terrain.getElevationForLngLatZoom(ne,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(De,I,ne,Te)}resize(De){var I;const ne=this._containerDimensions(),Te=ne[0],Se=ne[1],Ie=this._getClampedPixelRatio(Te,Se);if(this._resizeCanvas(Te,Se,Ie),this.painter.resize(Te,Se,Ie),this.painter.overLimit()){const yt=this.painter.context.gl;this._maxCanvasSize=[yt.drawingBufferWidth,yt.drawingBufferHeight];const Ct=this._getClampedPixelRatio(Te,Se);this._resizeCanvas(Te,Se,Ct),this.painter.resize(Te,Se,Ct)}this.transform.resize(Te,Se),(I=this._requestedCameraState)===null||I===void 0||I.resize(Te,Se);const ot=!this._moving;return ot&&(this.stop(),this.fire(new t.k("movestart",De)).fire(new t.k("move",De))),this.fire(new t.k("resize",De)),ot&&this.fire(new t.k("moveend",De)),this}_getClampedPixelRatio(De,I){const{0:ne,1:Te}=this._maxCanvasSize,Se=this.getPixelRatio(),Ie=De*Se,ot=I*Se;return Math.min(Ie>ne?ne/Ie:1,ot>Te?Te/ot:1)*Se}getPixelRatio(){var De;return(De=this._overridePixelRatio)!==null&&De!==void 0?De:devicePixelRatio}setPixelRatio(De){this._overridePixelRatio=De,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(De){return this.transform.setMaxBounds(ie.convert(De)),this._update()}setMinZoom(De){if((De=De??-2)>=-2&&De<=this.transform.maxZoom)return this.transform.minZoom=De,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=De,this._update(),this.getZoom()>De&&this.setZoom(De),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(De){if((De=De??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(De>=0&&De<=this.transform.maxPitch)return this.transform.minPitch=De,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(De>=this.transform.minPitch)return this.transform.maxPitch=De,this._update(),this.getPitch()>De&&this.setPitch(De),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(De){return this.transform.renderWorldCopies=De,this._update()}project(De){return this.transform.locationPoint(t.N.convert(De),this.style&&this.terrain)}unproject(De){return this.transform.pointLocation(t.P.convert(De),this.terrain)}isMoving(){var De;return this._moving||((De=this.handlers)===null||De===void 0?void 0:De.isMoving())}isZooming(){var De;return this._zooming||((De=this.handlers)===null||De===void 0?void 0:De.isZooming())}isRotating(){var De;return this._rotating||((De=this.handlers)===null||De===void 0?void 0:De.isRotating())}_createDelegatedListener(De,I,ne){if(De==="mouseenter"||De==="mouseover"){let Te=!1;return{layers:I,listener:ne,delegates:{mousemove:Ie=>{const ot=I.filter(Ct=>this.getLayer(Ct)),yt=ot.length!==0?this.queryRenderedFeatures(Ie.point,{layers:ot}):[];yt.length?Te||(Te=!0,ne.call(this,new Cl(De,this,Ie.originalEvent,{features:yt}))):Te=!1},mouseout:()=>{Te=!1}}}}if(De==="mouseleave"||De==="mouseout"){let Te=!1;return{layers:I,listener:ne,delegates:{mousemove:ot=>{const yt=I.filter(Ct=>this.getLayer(Ct));(yt.length!==0?this.queryRenderedFeatures(ot.point,{layers:yt}):[]).length?Te=!0:Te&&(Te=!1,ne.call(this,new Cl(De,this,ot.originalEvent)))},mouseout:ot=>{Te&&(Te=!1,ne.call(this,new Cl(De,this,ot.originalEvent)))}}}}{const Te=Se=>{const Ie=I.filter(yt=>this.getLayer(yt)),ot=Ie.length!==0?this.queryRenderedFeatures(Se.point,{layers:Ie}):[];ot.length&&(Se.features=ot,ne.call(this,Se),delete Se.features)};return{layers:I,listener:ne,delegates:{[De]:Te}}}}_saveDelegatedListener(De,I){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[De]=this._delegatedListeners[De]||[],this._delegatedListeners[De].push(I)}_removeDelegatedListener(De,I,ne){if(!this._delegatedListeners||!this._delegatedListeners[De])return;const Te=this._delegatedListeners[De];for(let Se=0;SeI.includes(ot))){for(const ot in Ie.delegates)this.off(ot,Ie.delegates[ot]);return void Te.splice(Se,1)}}}on(De,I,ne){if(ne===void 0)return super.on(De,I);const Te=this._createDelegatedListener(De,typeof I=="string"?[I]:I,ne);this._saveDelegatedListener(De,Te);for(const Se in Te.delegates)this.on(Se,Te.delegates[Se]);return this}once(De,I,ne){if(ne===void 0)return super.once(De,I);const Te=typeof I=="string"?[I]:I,Se=this._createDelegatedListener(De,Te,ne);for(const Ie in Se.delegates){const ot=Se.delegates[Ie];Se.delegates[Ie]=(...yt)=>{this._removeDelegatedListener(De,Te,ne),ot(...yt)}}this._saveDelegatedListener(De,Se);for(const Ie in Se.delegates)this.once(Ie,Se.delegates[Ie]);return this}off(De,I,ne){return ne===void 0?super.off(De,I):(this._removeDelegatedListener(De,typeof I=="string"?[I]:I,ne),this)}queryRenderedFeatures(De,I){if(!this.style)return[];let ne;const Te=De instanceof t.P||Array.isArray(De),Se=Te?De:[[0,0],[this.transform.width,this.transform.height]];if(I=I||(Te?{}:De)||{},Se instanceof t.P||typeof Se[0]=="number")ne=[t.P.convert(Se)];else{const Ie=t.P.convert(Se[0]),ot=t.P.convert(Se[1]);ne=[Ie,new t.P(ot.x,Ie.y),ot,new t.P(Ie.x,ot.y),Ie]}return this.style.queryRenderedFeatures(ne,I,this.transform)}querySourceFeatures(De,I){return this.style.querySourceFeatures(De,I)}setStyle(De,I){return(I=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},I)).diff!==!1&&I.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&De?(this._diffStyle(De,I),this):(this._localIdeographFontFamily=I.localIdeographFontFamily,this._updateStyle(De,I))}setTransformRequest(De){return this._requestManager.setTransformRequest(De),this}_getUIString(De){const I=this._locale[De];if(I==null)throw new Error(`Missing UI string '${De}'`);return I}_updateStyle(De,I){if(I.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(De,I));const ne=this.style&&I.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!De)),De?(this.style=new Hr(this,I||{}),this.style.setEventedParent(this,{style:this.style}),typeof De=="string"?this.style.loadURL(De,I,ne):this.style.loadJSON(De,I,ne),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Hr(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(De,I){if(typeof De=="string"){const ne=this._requestManager.transformRequest(De,"Style");t.h(ne,new AbortController).then(Te=>{this._updateDiff(Te.data,I)}).catch(Te=>{Te&&this.fire(new t.j(Te))})}else typeof De=="object"&&this._updateDiff(De,I)}_updateDiff(De,I){try{this.style.setState(De,I)&&this._update(!0)}catch(ne){t.w(`Unable to perform style diff: ${ne.message||ne.error||ne}. Rebuilding the style from scratch.`),this._updateStyle(De,I)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w("There is no style added to the map.")}addSource(De,I){return this._lazyInitEmptyStyle(),this.style.addSource(De,I),this._update(!0)}isSourceLoaded(De){const I=this.style&&this.style.sourceCaches[De];if(I!==void 0)return I.loaded();this.fire(new t.j(new Error(`There is no source with ID '${De}'`)))}setTerrain(De){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),De){const I=this.style.sourceCaches[De.source];if(!I)throw new Error(`cannot load terrain, because there exists no source with ID: ${De.source}`);this.terrain===null&&I.reload();for(const ne in this.style._layers){const Te=this.style._layers[ne];Te.type==="hillshade"&&Te.source===De.source&&t.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new $o(this.painter,I,De),this.painter.renderToTexture=new As(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=ne=>{ne.dataType==="style"?this.terrain.sourceCache.freeRtt():ne.dataType==="source"&&ne.tile&&(ne.sourceId!==De.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(ne.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new t.k("terrain",{terrain:De})),this}getTerrain(){var De,I;return(I=(De=this.terrain)===null||De===void 0?void 0:De.options)!==null&&I!==void 0?I:null}areTilesLoaded(){const De=this.style&&this.style.sourceCaches;for(const I in De){const ne=De[I]._tiles;for(const Te in ne){const Se=ne[Te];if(Se.state!=="loaded"&&Se.state!=="errored")return!1}}return!0}removeSource(De){return this.style.removeSource(De),this._update(!0)}getSource(De){return this.style.getSource(De)}addImage(De,I,ne={}){const{pixelRatio:Te=1,sdf:Se=!1,stretchX:Ie,stretchY:ot,content:yt,textFitWidth:Ct,textFitHeight:Wt}=ne;if(this._lazyInitEmptyStyle(),!(I instanceof HTMLImageElement||t.b(I))){if(I.width===void 0||I.height===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:nr,height:or,data:Fr}=I,Wr=I;return this.style.addImage(De,{data:new t.R({width:nr,height:or},new Uint8Array(Fr)),pixelRatio:Te,stretchX:Ie,stretchY:ot,content:yt,textFitWidth:Ct,textFitHeight:Wt,sdf:Se,version:0,userImage:Wr}),Wr.onAdd&&Wr.onAdd(this,De),this}}{const{width:nr,height:or,data:Fr}=i.getImageData(I);this.style.addImage(De,{data:new t.R({width:nr,height:or},Fr),pixelRatio:Te,stretchX:Ie,stretchY:ot,content:yt,textFitWidth:Ct,textFitHeight:Wt,sdf:Se,version:0})}}updateImage(De,I){const ne=this.style.getImage(De);if(!ne)return this.fire(new t.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const Te=I instanceof HTMLImageElement||t.b(I)?i.getImageData(I):I,{width:Se,height:Ie,data:ot}=Te;if(Se===void 0||Ie===void 0)return this.fire(new t.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(Se!==ne.data.width||Ie!==ne.data.height)return this.fire(new t.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const yt=!(I instanceof HTMLImageElement||t.b(I));return ne.data.replace(ot,yt),this.style.updateImage(De,ne),this}getImage(De){return this.style.getImage(De)}hasImage(De){return De?!!this.style.getImage(De):(this.fire(new t.j(new Error("Missing required image id"))),!1)}removeImage(De){this.style.removeImage(De)}loadImage(De){return l.getImage(this._requestManager.transformRequest(De,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(De,I){return this._lazyInitEmptyStyle(),this.style.addLayer(De,I),this._update(!0)}moveLayer(De,I){return this.style.moveLayer(De,I),this._update(!0)}removeLayer(De){return this.style.removeLayer(De),this._update(!0)}getLayer(De){return this.style.getLayer(De)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(De,I,ne){return this.style.setLayerZoomRange(De,I,ne),this._update(!0)}setFilter(De,I,ne={}){return this.style.setFilter(De,I,ne),this._update(!0)}getFilter(De){return this.style.getFilter(De)}setPaintProperty(De,I,ne,Te={}){return this.style.setPaintProperty(De,I,ne,Te),this._update(!0)}getPaintProperty(De,I){return this.style.getPaintProperty(De,I)}setLayoutProperty(De,I,ne,Te={}){return this.style.setLayoutProperty(De,I,ne,Te),this._update(!0)}getLayoutProperty(De,I){return this.style.getLayoutProperty(De,I)}setGlyphs(De,I={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(De,I),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(De,I,ne={}){return this._lazyInitEmptyStyle(),this.style.addSprite(De,I,ne,Te=>{Te||this._update(!0)}),this}removeSprite(De){return this._lazyInitEmptyStyle(),this.style.removeSprite(De),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(De,I={}){return this._lazyInitEmptyStyle(),this.style.setSprite(De,I,ne=>{ne||this._update(!0)}),this}setLight(De,I={}){return this._lazyInitEmptyStyle(),this.style.setLight(De,I),this._update(!0)}getLight(){return this.style.getLight()}setSky(De){return this._lazyInitEmptyStyle(),this.style.setSky(De),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(De,I){return this.style.setFeatureState(De,I),this._update()}removeFeatureState(De,I){return this.style.removeFeatureState(De,I),this._update()}getFeatureState(De){return this.style.getFeatureState(De)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let De=0,I=0;return this._container&&(De=this._container.clientWidth||400,I=this._container.clientHeight||300),[De,I]}_setupContainer(){const De=this._container;De.classList.add("maplibregl-map");const I=this._canvasContainer=n.create("div","maplibregl-canvas-container",De);this._interactive&&I.classList.add("maplibregl-interactive"),this._canvas=n.create("canvas","maplibregl-canvas",I),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const ne=this._containerDimensions(),Te=this._getClampedPixelRatio(ne[0],ne[1]);this._resizeCanvas(ne[0],ne[1],Te);const Se=this._controlContainer=n.create("div","maplibregl-control-container",De),Ie=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(ot=>{Ie[ot]=n.create("div",`maplibregl-ctrl-${ot} `,Se)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(De,I,ne){this._canvas.width=Math.floor(ne*De),this._canvas.height=Math.floor(ne*I),this._canvas.style.width=`${De}px`,this._canvas.style.height=`${I}px`}_setupPainter(){const De={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let I=null;this._canvas.addEventListener("webglcontextcreationerror",Te=>{I={requestedAttributes:De},Te&&(I.statusMessage=Te.statusMessage,I.type=Te.type)},{once:!0});const ne=this._canvas.getContext("webgl2",De)||this._canvas.getContext("webgl",De);if(!ne){const Te="Failed to initialize WebGL";throw I?(I.message=Te,new Error(JSON.stringify(I))):new Error(Te)}this.painter=new Uu(ne,this.transform),s.testSupport(ne)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(De){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||De,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(De){return this._update(),this._renderTaskQueue.add(De)}_cancelRenderFrame(De){this._renderTaskQueue.remove(De)}_render(De){const I=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(De),this._removed)return;let ne=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const Se=this.transform.zoom,Ie=i.now();this.style.zoomHistory.update(Se,Ie);const ot=new t.z(Se,{now:Ie,fadeDuration:I,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),yt=ot.crossFadingFactor();yt===1&&yt===this._crossFadingFactor||(ne=!0,this._crossFadingFactor=yt),this.style.update(ot)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,I,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:I,showPadding:this.showPadding}),this.fire(new t.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,t.bf.mark(t.bg.load),this.fire(new t.k("load"))),this.style&&(this.style.hasTransitions()||ne)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const Te=this._sourcesDirty||this._styleDirty||this._placementDirty;return Te||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||Te||(this._fullyLoaded=!0,t.bf.mark(t.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var De;this._hash&&this._hash.remove();for(const ne of this._controls)ne.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),l.removeThrottleControl(this._imageQueueHandle),(De=this._resizeObserver)===null||De===void 0||De.disconnect();const I=this.painter.context.gl.getExtension("WEBGL_lose_context");I!=null&&I.loseContext&&I.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),n.remove(this._canvasContainer),n.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),t.bf.clearMetrics(),this._removed=!0,this.fire(new t.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,i.frameAsync(this._frameRequest).then(De=>{t.bf.frame(De),this._frameRequest=null,this._render(De)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(De){this._showTileBoundaries!==De&&(this._showTileBoundaries=De,this._update())}get showPadding(){return!!this._showPadding}set showPadding(De){this._showPadding!==De&&(this._showPadding=De,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(De){this._showCollisionBoxes!==De&&(this._showCollisionBoxes=De,De?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(De){this._showOverdrawInspector!==De&&(this._showOverdrawInspector=De,this._update())}get repaint(){return!!this._repaint}set repaint(De){this._repaint!==De&&(this._repaint=De,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(De){this._vertices=De,this._update()}get version(){return il}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=Cl,e.MapTouchEvent=uc,e.MapWheelEvent=rf,e.Marker=Vl,e.NavigationControl=class{constructor(De){this._updateZoomButtons=()=>{const I=this._map.getZoom(),ne=I===this._map.getMaxZoom(),Te=I===this._map.getMinZoom();this._zoomInButton.disabled=ne,this._zoomOutButton.disabled=Te,this._zoomInButton.setAttribute("aria-disabled",ne.toString()),this._zoomOutButton.setAttribute("aria-disabled",Te.toString())},this._rotateCompassArrow=()=>{const I=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=I},this._setButtonTitle=(I,ne)=>{const Te=this._map._getUIString(`NavigationControl.${ne}`);I.title=Te,I.setAttribute("aria-label",Te)},this.options=t.e({},fi,De),this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",I=>I.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",I=>this._map.zoomIn({},{originalEvent:I})),n.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",I=>this._map.zoomOut({},{originalEvent:I})),n.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",I=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:I}):this._map.resetNorth({},{originalEvent:I})}),this._compassIcon=n.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(De){return this._map=De,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new ao(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){n.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(De,I){const ne=n.create("button",De,this._container);return ne.type="button",ne.addEventListener("click",I),ne}},e.Popup=class extends t.E{constructor(De){super(),this.remove=()=>(this._content&&n.remove(this._content),this._container&&(n.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),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new t.k("close"))),this),this._onMouseUp=I=>{this._update(I.point)},this._onMouseMove=I=>{this._update(I.point)},this._onDrag=I=>{this._update(I.point)},this._update=I=>{var ne;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=n.create("div","maplibregl-popup",this._map.getContainer()),this._tip=n.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const yt of this.options.className.split(" "))this._container.classList.add(yt);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Jo(this._lngLat,this._flatPos,this._map.transform):(ne=this._lngLat)===null||ne===void 0?void 0:ne.wrap(),this._trackPointer&&!I)return;const Te=this._flatPos=this._pos=this._trackPointer&&I?I:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&I?I:this._map.transform.locationPoint(this._lngLat));let Se=this.options.anchor;const Ie=Du(this.options.offset);if(!Se){const yt=this._container.offsetWidth,Ct=this._container.offsetHeight;let Wt;Wt=Te.y+Ie.bottom.ythis._map.transform.height-Ct?["bottom"]:[],Te.xthis._map.transform.width-yt/2&&Wt.push("right"),Se=Wt.length===0?"bottom":Wt.join("-")}let ot=Te.add(Ie[Se]);this.options.subpixelPositioning||(ot=ot.round()),n.setTransform(this._container,`${Bl[Se]} translate(${ot.x}px,${ot.y}px)`),jl(this._container,Se,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(eo),De)}addTo(De){return this._map&&this.remove(),this._map=De,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new t.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(De){return this._lngLat=t.N.convert(De),this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=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("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(De){return this.setDOMContent(document.createTextNode(De))}setHTML(De){const I=document.createDocumentFragment(),ne=document.createElement("body");let Te;for(ne.innerHTML=De;Te=ne.firstChild,Te;)I.appendChild(Te);return this.setDOMContent(I)}getMaxWidth(){var De;return(De=this._container)===null||De===void 0?void 0:De.style.maxWidth}setMaxWidth(De){return this.options.maxWidth=De,this._update(),this}setDOMContent(De){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=n.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(De),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(De){return this._container&&this._container.classList.add(De),this}removeClassName(De){return this._container&&this._container.classList.remove(De),this}setOffset(De){return this.options.offset=De,this._update(),this}toggleClassName(De){if(this._container)return this._container.classList.toggle(De)}setSubpixelPositioning(De){this.options.subpixelPositioning=De}_createCloseButton(){this.options.closeButton&&(this._closeButton=n.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const De=this._container.querySelector(qu);De&&De.focus()}},e.RasterDEMTileSource=Fe,e.RasterTileSource=Ae,e.ScaleControl=class{constructor(De){this._onMove=()=>{rc(this._map,this._container,this.options)},this.setUnit=I=>{this.options.unit=I,rc(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},ol),De)}getDefaultPosition(){return"bottom-left"}onAdd(De){return this._map=De,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-scale",De.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){n.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},e.ScrollZoomHandler=ua,e.Style=Hr,e.TerrainControl=class{constructor(De){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=De}onAdd(De){return this._map=De,this._container=n.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=n.create("button","maplibregl-ctrl-terrain",this._container),n.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){n.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=Cc,e.TwoFingersTouchRotateHandler=tc,e.TwoFingersTouchZoomHandler=Ol,e.TwoFingersTouchZoomRotateHandler=Ja,e.VectorTileSource=we,e.VideoSource=Qe,e.addSourceType=(De,I)=>t._(void 0,void 0,void 0,function*(){if(Me(De))throw new Error(`A source type called "${De}" already exists.`);((ne,Te)=>{Xe[ne]=Te})(De,I)}),e.clearPrewarmedResources=function(){const De=le;De&&(De.isPreloaded()&&De.numActive()===1?(De.release(Q),le=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()"))},e.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return $e().getRTLTextPluginStatus()},e.getVersion=function(){return wc},e.getWorkerCount=function(){return ue.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(De){return X().broadcast("IS",De)},e.prewarm=function(){J().acquire(Q)},e.setMaxParallelImageRequests=function(De){t.a.MAX_PARALLEL_IMAGE_REQUESTS=De},e.setRTLTextPlugin=function(De,I){return $e().setRTLTextPlugin(De,I)},e.setWorkerCount=function(De){ue.workerCount=De},e.setWorkerUrl=function(De){t.a.WORKER_URL=De}});var E=d;return E})}}),_R=He({"src/plots/map/layers.js"(Y,G){var d=Gr(),x=yl().sanitizeHTML,A=HT(),E=up();function e(i,n){this.subplot=i,this.uid=i.uid+"-"+n,this.index=n,this.idSource="source-"+this.uid,this.idLayer=E.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var t=e.prototype;t.update=function(n){this.visible?this.needsNewImage(n)?this.updateImage(n):this.needsNewSource(n)?(this.removeLayer(),this.updateSource(n),this.updateLayer(n)):this.needsNewLayer(n)?this.updateLayer(n):this.updateStyle(n):(this.updateSource(n),this.updateLayer(n)),this.visible=r(n)},t.needsNewImage=function(i){var n=this.subplot.map;return n.getSource(this.idSource)&&this.sourceType==="image"&&i.sourcetype==="image"&&(this.source!==i.source||JSON.stringify(this.coordinates)!==JSON.stringify(i.coordinates))},t.needsNewSource=function(i){return this.sourceType!==i.sourcetype||JSON.stringify(this.source)!==JSON.stringify(i.source)||this.layerType!==i.type},t.needsNewLayer=function(i){return this.layerType!==i.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},t.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},t.updateImage=function(i){var n=this.subplot.map;n.getSource(this.idSource).updateImage({url:i.source,coordinates:i.coordinates});var s=this.findFollowingMapLayerId(this.lookupBelow());s!==null&&this.subplot.map.moveLayer(this.idLayer,s)},t.updateSource=function(i){var n=this.subplot.map;if(n.getSource(this.idSource)&&n.removeSource(this.idSource),this.sourceType=i.sourcetype,this.source=i.source,!!r(i)){var s=a(i);n.addSource(this.idSource,s)}},t.findFollowingMapLayerId=function(i){if(i==="traces")for(var n=this.subplot.getMapLayers(),s=0;s0){for(var s=0;s0}function o(i){var n={},s={};switch(i.type){case"circle":d.extendFlat(s,{"circle-radius":i.circle.radius,"circle-color":i.color,"circle-opacity":i.opacity});break;case"line":d.extendFlat(s,{"line-width":i.line.width,"line-color":i.color,"line-opacity":i.opacity,"line-dasharray":i.line.dash});break;case"fill":d.extendFlat(s,{"fill-color":i.color,"fill-outline-color":i.fill.outlinecolor,"fill-opacity":i.opacity});break;case"symbol":var c=i.symbol,f=A(c.textposition,c.iconsize);d.extendFlat(n,{"icon-image":c.icon+"-15","icon-size":c.iconsize/10,"text-field":c.text,"text-size":c.textfont.size,"text-anchor":f.anchor,"text-offset":f.offset,"symbol-placement":c.placement}),d.extendFlat(s,{"icon-color":i.color,"text-color":c.textfont.color,"text-opacity":i.opacity});break;case"raster":d.extendFlat(s,{"raster-fade-duration":0,"raster-opacity":i.opacity});break}return{layout:n,paint:s}}function a(i){var n=i.sourcetype,s=i.source,c={type:n},f;return n==="geojson"?f="data":n==="vector"?f=typeof s=="string"?"url":"tiles":n==="raster"?(f="tiles",c.tileSize=256):n==="image"&&(f="url",c.coordinates=i.coordinates),c[f]=s,i.sourceattribution&&(c.attribution=x(i.sourceattribution)),c}G.exports=function(n,s,c){var f=new e(n,s);return f.update(c),f}}}),xR=He({"src/plots/map/map.js"(Y,G){var d=mR(),x=Gr(),A=ip(),E=Ei(),e=io(),t=fh(),r=Wu(),o=bv(),a=o.drawMode,i=o.selectMode,n=dc().prepSelect,s=dc().clearOutline,c=dc().clearSelectionsCache,f=dc().selectOnClick,v=up(),h=_R();function T(_,w){this.id=w,this.gd=_;var p=_._fullLayout,u=_._context;this.container=p._glcontainer.node(),this.isStatic=u.staticPlot,this.uid=p._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(p),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var l=T.prototype;l.plot=function(_,w,p){var u=this,g;u.map?g=new Promise(function(m,R){u.updateMap(_,w,m,R)}):g=new Promise(function(m,R){u.createMap(_,w,m,R)}),p.push(g)},l.createMap=function(_,w,p,u){var g=this,m=w[g.id],R=g.styleObj=b(m.style),P=m.bounds,z=P?[[P.west,P.south],[P.east,P.north]]:null,F=g.map=new d.Map({container:g.div,style:R.style,center:M(m.center),zoom:m.zoom,bearing:m.bearing,pitch:m.pitch,maxBounds:z,interactive:!g.isStatic,preserveDrawingBuffer:g.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new d.AttributionControl({compact:!0})),B={};F.on("styleimagemissing",function(L){var N=L.id;if(!B[N]&&N.includes("-15")){B[N]=!0;var U=new Image(15,15);U.onload=function(){F.addImage(N,U)},U.crossOrigin="Anonymous",U.src="https://unpkg.com/maki@2.1.0/icons/"+N+".svg"}}),F.setTransformRequest(function(L){return L=L.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),L=L.replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold"),L=L.replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular"),{url:L}}),F._canvas.style.left="0px",F._canvas.style.top="0px",g.rejectOnError(u),g.isStatic||g.initFx(_,w);var O=[];O.push(new Promise(function(L){F.once("load",L)})),O=O.concat(A.fetchTraceGeoData(_)),Promise.all(O).then(function(){g.fillBelowLookup(_,w),g.updateData(_),g.updateLayout(w),g.resolveOnRender(p)}).catch(u)},l.updateMap=function(_,w,p,u){var g=this,m=g.map,R=w[this.id];g.rejectOnError(u);var P=[],z=b(R.style);JSON.stringify(g.styleObj)!==JSON.stringify(z)&&(g.styleObj=z,m.setStyle(z.style),g.traceHash={},P.push(new Promise(function(F){m.once("styledata",F)}))),P=P.concat(A.fetchTraceGeoData(_)),Promise.all(P).then(function(){g.fillBelowLookup(_,w),g.updateData(_),g.updateLayout(w),g.resolveOnRender(p)}).catch(u)},l.fillBelowLookup=function(_,w){var p=w[this.id],u=p.layers,g,m,R=this.belowLookup={},P=!1;for(g=0;g<_.length;g++){var z=_[g][0].trace,F=z._module;typeof z.below=="string"?m=z.below:F.getBelow&&(m=F.getBelow(z,this)),m===""&&(P=!0),R["trace-"+z.uid]=m||""}for(g=0;g1)for(g=0;g-1&&f(z.originalEvent,u,[p.xaxis],[p.yaxis],p.id,P),F.indexOf("event")>-1&&r.click(u,z.originalEvent)}}},l.updateFx=function(_){var w=this,p=w.map,u=w.gd;if(w.isStatic)return;function g(z){var F=w.map.unproject(z);return[F.lng,F.lat]}var m=_.dragmode,R;R=function(z,F){if(F.isRect){var B=z.range={};B[w.id]=[g([F.xmin,F.ymin]),g([F.xmax,F.ymax])]}else{var O=z.lassoPoints={};O[w.id]=F.map(g)}};var P=w.dragOptions;w.dragOptions=x.extendDeep(P||{},{dragmode:_.dragmode,element:w.div,gd:u,plotinfo:{id:w.id,domain:_[w.id].domain,xaxis:w.xaxis,yaxis:w.yaxis,fillRangeItems:R},xaxes:[w.xaxis],yaxes:[w.yaxis],subplot:w.id}),p.off("click",w.onClickInPanHandler),i(m)||a(m)?(p.dragPan.disable(),p.on("zoomstart",w.clearOutline),w.dragOptions.prepFn=function(z,F,B){n(z,F,B,w.dragOptions,m)},t.init(w.dragOptions)):(p.dragPan.enable(),p.off("zoomstart",w.clearOutline),w.div.onmousedown=null,w.div.ontouchstart=null,w.div.removeEventListener("touchstart",w.div._ontouchstart),w.onClickInPanHandler=w.onClickInPanFn(w.dragOptions),p.on("click",w.onClickInPanHandler))},l.updateFramework=function(_){var w=_[this.id].domain,p=_._size,u=this.div.style;u.width=p.w*(w.x[1]-w.x[0])+"px",u.height=p.h*(w.y[1]-w.y[0])+"px",u.left=p.l+w.x[0]*p.w+"px",u.top=p.t+(1-w.y[1])*p.h+"px",this.xaxis._offset=p.l+w.x[0]*p.w,this.xaxis._length=p.w*(w.x[1]-w.x[0]),this.yaxis._offset=p.t+(1-w.y[1])*p.h,this.yaxis._length=p.h*(w.y[1]-w.y[0])},l.updateLayers=function(_){var w=_[this.id],p=w.layers,u=this.layerList,g;if(p.length!==u.length){for(g=0;gp/2){var u=S.split("|").join("
");_.text(u).attr("data-unformatted",u).call(r.convertToTspans,i),w=t.bBox(_.node())}_.attr("transform",d(-3,-w.height+8)),M.insert("rect",".static-attribution").attr({x:-w.width-6,y:-w.height-3,width:w.width+6,height:w.height+3,fill:"rgba(255, 255, 255, 0.75)"});var g=1;w.width+6>p&&(g=p/(w.width+6));var m=[c.l+c.w*h.x[1],c.t+c.h*(1-h.y[0])];M.attr("transform",d(m[0],m[1])+x(g))}},Y.updateFx=function(i){for(var n=i._fullLayout,s=n._subplots[a],c=0;c=0;o--)t.removeLayer(r[o][1])},e.dispose=function(){var t=this.subplot.map;this._removeLayers(),t.removeSource(this.sourceId)},G.exports=function(r,o){var a=o[0].trace,i=new E(r,a.uid),n=i.sourceId,s=d(o),c=i.below=r.belowLookup["trace-"+a.uid];return r.map.addSource(n,{type:"geojson",data:s.geojson}),i._addLayers(s,c),o[0].trace._glTrace=i,i}}}),MR=He({"src/traces/choroplethmap/index.js"(Y,G){G.exports={attributes:GT(),supplyDefaults:AR(),colorbar:Zd(),calc:G_(),plot:SR(),hoverPoints:Z_(),eventData:X_(),selectPoints:Y_(),styleOnSelect:function(d,x){if(x){var A=x[0].trace;A._glTrace.updateOnSelect(x)}},getBelow:function(d,x){for(var A=x.getMapLayers(),E=A.length-2;E>=0;E--){var e=A[E].id;if(typeof e=="string"&&e.indexOf("water")===0){for(var t=E+1;t0?+h[f]:0),c.push({type:"Feature",geometry:{type:"Point",coordinates:b},properties:S})}}var _=E.extractOpts(a),w=_.reversescale?E.flipScale(_.colorscale):_.colorscale,p=w[0][1],u=A.opacity(p)<1?p:A.addOpacity(p,0),g=["interpolate",["linear"],["heatmap-density"],0,u];for(f=1;f=0;r--)e.removeLayer(t[r][1])},E.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},G.exports=function(t,r){var o=r[0].trace,a=new A(t,o.uid),i=a.sourceId,n=d(r),s=a.below=t.belowLookup["trace-"+o.uid];return t.map.addSource(i,{type:"geojson",data:n.geojson}),a._addLayers(n,s),a}}}),IR=He({"src/traces/densitymap/hover.js"(Y,G){var d=io(),x=fx().hoverPoints,A=fx().getExtraText;G.exports=function(e,t,r){var o=x(e,t,r);if(o){var a=o[0],i=a.cd,n=i[0].trace,s=i[a.index];if(delete a.color,"z"in s){var c=a.subplot.mockAxis;a.z=s.z,a.zLabel=d.tickText(c,c.c2l(s.z),"hover").text}return a.extraText=A(n,s,i[0].t.labels),[a]}}}}),RR=He({"src/traces/densitymap/event_data.js"(Y,G){G.exports=function(x,A){return x.lon=A.lon,x.lat=A.lat,x.z=A.z,x}}}),DR=He({"src/traces/densitymap/index.js"(Y,G){G.exports={attributes:ZT(),supplyDefaults:kR(),colorbar:Zd(),formatLabels:qT(),calc:CR(),plot:PR(),hoverPoints:IR(),eventData:RR(),getBelow:function(d,x){for(var A=x.getMapLayers(),E=0;E0;){l=b[b.length-1];var S=x[l];if(r[l]=0&&a[l].push(o[_])}r[l]=M}else{if(e[l]===E[l]){for(var w=[],p=[],u=0,M=y.length-1;M>=0;--M){var g=y[M];if(t[g]=!1,w.push(g),p.push(a[g]),u+=a[g].length,o[g]=s.length,g===l){y.length=M;break}}s.push(w);for(var m=new Array(u),M=0;M_&&(_=n.source[y]),n.target[y]>_&&(_=n.target[y]);var w=_+1;a.node._count=w;var p,u=a.node.groups,g={};for(y=0;y0&&e(B,w)&&e(O,w)&&!(g.hasOwnProperty(B)&&g.hasOwnProperty(O)&&g[B]===g[O])){g.hasOwnProperty(O)&&(O=g[O]),g.hasOwnProperty(B)&&(B=g[B]),B=+B,O=+O,h[B]=h[O]=!0;var L="";n.label&&n.label[y]&&(L=n.label[y]);var N=null;L&&T.hasOwnProperty(L)&&(N=T[L]),s.push({pointNumber:y,label:L,color:c?n.color[y]:n.color,hovercolor:f?n.hovercolor[y]:n.hovercolor,customdata:v?n.customdata[y]:n.customdata,concentrationscale:N,source:B,target:O,value:+F}),z.source.push(B),z.target.push(O)}}var U=w+u.length,Z=E(i.color),Q=E(i.customdata),ue=[];for(y=0;yw-1,childrenNodes:[],pointNumber:y,label:oe,color:Z?i.color[y]:i.color,customdata:Q?i.customdata[y]:i.customdata})}var le=!1;return o(U,z.source,z.target)&&(le=!0),{circular:le,links:s,nodes:ue,groups:u,groupLookup:g}}function o(a,i,n){for(var s=x.init2dArray(a,0),c=0;c1})}G.exports=function(i,n){var s=r(n);return A({circular:s.circular,_nodes:s.nodes,_links:s.links,_groups:s.groups,_groupLookup:s.groupLookup})}}}),BR=He({"node_modules/d3-quadtree/dist/d3-quadtree.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y):(d=d||self,x(d.d3=d.d3||{}))})(Y,function(d){function x(w){var p=+this._x.call(null,w),u=+this._y.call(null,w);return A(this.cover(p,u),p,u,w)}function A(w,p,u,g){if(isNaN(p)||isNaN(u))return w;var m,R=w._root,P={data:g},z=w._x0,F=w._y0,B=w._x1,O=w._y1,L,N,U,Z,Q,ue,oe,le;if(!R)return w._root=P,w;for(;R.length;)if((Q=p>=(L=(z+B)/2))?z=L:B=L,(ue=u>=(N=(F+O)/2))?F=N:O=N,m=R,!(R=R[oe=ue<<1|Q]))return m[oe]=P,w;if(U=+w._x.call(null,R.data),Z=+w._y.call(null,R.data),p===U&&u===Z)return P.next=R,m?m[oe]=P:w._root=P,w;do m=m?m[oe]=new Array(4):w._root=new Array(4),(Q=p>=(L=(z+B)/2))?z=L:B=L,(ue=u>=(N=(F+O)/2))?F=N:O=N;while((oe=ue<<1|Q)===(le=(Z>=N)<<1|U>=L));return m[le]=R,m[oe]=P,w}function E(w){var p,u,g=w.length,m,R,P=new Array(g),z=new Array(g),F=1/0,B=1/0,O=-1/0,L=-1/0;for(u=0;uO&&(O=m),RL&&(L=R));if(F>O||B>L)return this;for(this.cover(F,B).cover(O,L),u=0;uw||w>=m||g>p||p>=R;)switch(B=(pO||(z=Z.y0)>L||(F=Z.x1)=oe)<<1|w>=ue)&&(Z=N[N.length-1],N[N.length-1]=N[N.length-1-Q],N[N.length-1-Q]=Z)}else{var le=w-+this._x.call(null,U.data),j=p-+this._y.call(null,U.data),J=le*le+j*j;if(J=(N=(P+F)/2))?P=N:F=N,(Q=L>=(U=(z+B)/2))?z=U:B=U,p=u,!(u=u[ue=Q<<1|Z]))return this;if(!u.length)break;(p[ue+1&3]||p[ue+2&3]||p[ue+3&3])&&(g=p,oe=ue)}for(;u.data!==w;)if(m=u,!(u=u.next))return this;return(R=u.next)&&delete u.next,m?(R?m.next=R:delete m.next,this):p?(R?p[ue]=R:delete p[ue],(u=p[0]||p[1]||p[2]||p[3])&&u===(p[3]||p[2]||p[1]||p[0])&&!u.length&&(g?g[oe]=u:this._root=u),this):(this._root=R,this)}function n(w){for(var p=0,u=w.length;p=h.length)return l!=null&&_.sort(l),y!=null?y(_):_;for(var g=-1,m=_.length,R=h[w++],P,z,F=E(),B,O=p();++gh.length)return _;var p,u=T[w-1];return y!=null&&w>=h.length?p=_.entries():(p=[],_.each(function(g,m){p.push({key:m,values:M(g,w)})})),u!=null?p.sort(function(g,m){return u(g.key,m.key)}):p}return b={object:function(_){return S(_,0,t,r)},map:function(_){return S(_,0,o,a)},entries:function(_){return M(S(_,0,o,a),0)},key:function(_){return h.push(_),b},sortKeys:function(_){return T[h.length-1]=_,b},sortValues:function(_){return l=_,b},rollup:function(_){return y=_,b}}}function t(){return{}}function r(h,T,l){h[T]=l}function o(){return E()}function a(h,T,l){h.set(T,l)}function i(){}var n=E.prototype;i.prototype=s.prototype={constructor:i,has:n.has,add:function(h){return h+="",this[x+h]=h,this},remove:n.remove,clear:n.clear,values:n.keys,size:n.size,empty:n.empty,each:n.each};function s(h,T){var l=new i;if(h instanceof i)h.each(function(S){l.add(S)});else if(h){var y=-1,b=h.length;if(T==null)for(;++y=0&&(n=i.slice(s+1),i=i.slice(0,s)),i&&!a.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:n}})}E.prototype=A.prototype={constructor:E,on:function(o,a){var i=this._,n=e(o+"",i),s,c=-1,f=n.length;if(arguments.length<2){for(;++c0)for(var i=new Array(s),n=0,s,c;n=0&&w._call.call(null,p),w=w._next;--x}function l(){a=(o=n.now())+i,x=A=0;try{T()}finally{x=0,b(),a=0}}function y(){var w=n.now(),p=w-o;p>e&&(i-=p,o=w)}function b(){for(var w,p=t,u,g=1/0;p;)p._call?(g>p._time&&(g=p._time),w=p,p=p._next):(u=p._next,p._next=null,p=w?w._next=u:t=u);r=w,S(g)}function S(w){if(!x){A&&(A=clearTimeout(A));var p=w-a;p>24?(w<1/0&&(A=setTimeout(l,w-n.now()-i)),E&&(E=clearInterval(E))):(E||(o=n.now(),E=setInterval(y,e)),x=1,s(l))}}function M(w,p,u){var g=new v;return p=p==null?0:+p,g.restart(function(m){g.stop(),w(m+p)},p,u),g}function _(w,p,u){var g=new v,m=p;return p==null?(g.restart(w,p,u),g):(p=+p,u=u==null?c():+u,g.restart(function R(P){P+=m,g.restart(R,m+=p,u),w(P)},p,u),g)}d.interval=_,d.now=c,d.timeout=M,d.timer=h,d.timerFlush=T,Object.defineProperty(d,"__esModule",{value:!0})})}}),jR=He({"node_modules/d3-force/dist/d3-force.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y,BR(),vx(),NR(),UR()):x(d.d3=d.d3||{},d.d3,d.d3,d.d3,d.d3)})(Y,function(d,x,A,E,e){function t(w,p){var u;w==null&&(w=0),p==null&&(p=0);function g(){var m,R=u.length,P,z=0,F=0;for(m=0;mL.index){var ae=N-re.x-re.vx,ie=U-re.y-re.vy,fe=ae*ae+ie*ie;feN+q||$U+q||XF.r&&(F.r=F[B].r)}function z(){if(p){var F,B=p.length,O;for(u=new Array(B),F=0;F1?(Q==null?z.remove(Z):z.set(Z,U(Q)),p):z.get(Z)},find:function(Z,Q,ue){var oe=0,le=w.length,j,J,$,X,re;for(ue==null?ue=1/0:ue*=ue,oe=0;oe1?(B.on(Z,Q),p):B.on(Z)}}}function b(){var w,p,u,g=r(-30),m,R=1,P=1/0,z=.81;function F(N){var U,Z=w.length,Q=x.quadtree(w,v,h).visitAfter(O);for(u=N,U=0;U=P)return;(N.data!==p||N.next)&&(ue===0&&(ue=o(),j+=ue*ue),oe===0&&(oe=o(),j+=oe*oe),jE)if(!(Math.abs(l*v-h*T)>E)||!s)this._+="L"+(this._x1=o)+","+(this._y1=a);else{var b=i-c,S=n-f,M=v*v+h*h,_=b*b+S*S,w=Math.sqrt(M),p=Math.sqrt(y),u=s*Math.tan((x-Math.acos((M+y-_)/(2*w*p)))/2),g=u/p,m=u/w;Math.abs(g-1)>E&&(this._+="L"+(o+g*T)+","+(a+g*l)),this._+="A"+s+","+s+",0,0,"+ +(l*b>T*S)+","+(this._x1=o+m*v)+","+(this._y1=a+m*h)}},arc:function(o,a,i,n,s,c){o=+o,a=+a,i=+i,c=!!c;var f=i*Math.cos(n),v=i*Math.sin(n),h=o+f,T=a+v,l=1^c,y=c?n-s:s-n;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+h+","+T:(Math.abs(this._x1-h)>E||Math.abs(this._y1-T)>E)&&(this._+="L"+h+","+T),i&&(y<0&&(y=y%A+A),y>e?this._+="A"+i+","+i+",0,1,"+l+","+(o-f)+","+(a-v)+"A"+i+","+i+",0,1,"+l+","+(this._x1=h)+","+(this._y1=T):y>E&&(this._+="A"+i+","+i+",0,"+ +(y>=x)+","+l+","+(this._x1=o+i*Math.cos(s))+","+(this._y1=a+i*Math.sin(s))))},rect:function(o,a,i,n){this._+="M"+(this._x0=this._x1=+o)+","+(this._y0=this._y1=+a)+"h"+ +i+"v"+ +n+"h"+-i+"Z"},toString:function(){return this._}},d.path=r,Object.defineProperty(d,"__esModule",{value:!0})})}}),KT=He({"node_modules/d3-shape/dist/d3-shape.js"(Y,G){(function(d,x){typeof Y=="object"&&typeof G<"u"?x(Y,VR()):(d=d||self,x(d.d3=d.d3||{},d.d3))})(Y,function(d,x){function A(wt){return function(){return wt}}var E=Math.abs,e=Math.atan2,t=Math.cos,r=Math.max,o=Math.min,a=Math.sin,i=Math.sqrt,n=1e-12,s=Math.PI,c=s/2,f=2*s;function v(wt){return wt>1?0:wt<-1?s:Math.acos(wt)}function h(wt){return wt>=1?c:wt<=-1?-c:Math.asin(wt)}function T(wt){return wt.innerRadius}function l(wt){return wt.outerRadius}function y(wt){return wt.startAngle}function b(wt){return wt.endAngle}function S(wt){return wt&&wt.padAngle}function M(wt,Qt,mr,$r,oa,Sa,ya,ra){var pa=mr-wt,pn=$r-Qt,Ga=ya-oa,qn=ra-Sa,Vn=qn*pa-Ga*pn;if(!(Vn*Vnbs*bs+as*as&&(xi=So,Ao=Ro),{cx:xi,cy:Ao,x01:-Ga,y01:-qn,x11:xi*(oa/Wo-1),y11:Ao*(oa/Wo-1)}}function w(){var wt=T,Qt=l,mr=A(0),$r=null,oa=y,Sa=b,ya=S,ra=null;function pa(){var pn,Ga,qn=+wt.apply(this,arguments),Vn=+Qt.apply(this,arguments),di=oa.apply(this,arguments)-c,yi=Sa.apply(this,arguments)-c,Ci=E(yi-di),ci=yi>di;if(ra||(ra=pn=x.path()),Vnn))ra.moveTo(0,0);else if(Ci>f-n)ra.moveTo(Vn*t(di),Vn*a(di)),ra.arc(0,0,Vn,di,yi,!ci),qn>n&&(ra.moveTo(qn*t(yi),qn*a(yi)),ra.arc(0,0,qn,yi,di,ci));else{var ei=di,mi=yi,uo=di,Lo=yi,Wo=Ci,li=Ci,Ii=ya.apply(this,arguments)/2,xi=Ii>n&&($r?+$r.apply(this,arguments):i(qn*qn+Vn*Vn)),Ao=o(E(Vn-qn)/2,+mr.apply(this,arguments)),So=Ao,Ro=Ao,Li,Yi;if(xi>n){var bs=h(xi/qn*a(Ii)),as=h(xi/Vn*a(Ii));(Wo-=bs*2)>n?(bs*=ci?1:-1,uo+=bs,Lo-=bs):(Wo=0,uo=Lo=(di+yi)/2),(li-=as*2)>n?(as*=ci?1:-1,ei+=as,mi-=as):(li=0,ei=mi=(di+yi)/2)}var fs=Vn*t(ei),Co=Vn*a(ei),Qa=qn*t(Lo),Jn=qn*a(Lo);if(Ao>n){var Os=Vn*t(mi),ds=Vn*a(mi),Ui=qn*t(uo),ms=qn*a(uo),Mo;if(Cin?Ro>n?(Li=_(Ui,ms,fs,Co,Vn,Ro,ci),Yi=_(Os,ds,Qa,Jn,Vn,Ro,ci),ra.moveTo(Li.cx+Li.x01,Li.cy+Li.y01),Ron)||!(Wo>n)?ra.lineTo(Qa,Jn):So>n?(Li=_(Qa,Jn,Os,ds,qn,-So,ci),Yi=_(fs,Co,Ui,ms,qn,-So,ci),ra.lineTo(Li.cx+Li.x01,Li.cy+Li.y01),So=Vn;--di)ra.point(mi[di],uo[di]);ra.lineEnd(),ra.areaEnd()}ci&&(mi[qn]=+wt(Ci,qn,Ga),uo[qn]=+mr(Ci,qn,Ga),ra.point(Qt?+Qt(Ci,qn,Ga):mi[qn],$r?+$r(Ci,qn,Ga):uo[qn]))}if(ei)return ra=null,ei+""||null}function pn(){return R().defined(oa).curve(ya).context(Sa)}return pa.x=function(Ga){return arguments.length?(wt=typeof Ga=="function"?Ga:A(+Ga),Qt=null,pa):wt},pa.x0=function(Ga){return arguments.length?(wt=typeof Ga=="function"?Ga:A(+Ga),pa):wt},pa.x1=function(Ga){return arguments.length?(Qt=Ga==null?null:typeof Ga=="function"?Ga:A(+Ga),pa):Qt},pa.y=function(Ga){return arguments.length?(mr=typeof Ga=="function"?Ga:A(+Ga),$r=null,pa):mr},pa.y0=function(Ga){return arguments.length?(mr=typeof Ga=="function"?Ga:A(+Ga),pa):mr},pa.y1=function(Ga){return arguments.length?($r=Ga==null?null:typeof Ga=="function"?Ga:A(+Ga),pa):$r},pa.lineX0=pa.lineY0=function(){return pn().x(wt).y(mr)},pa.lineY1=function(){return pn().x(wt).y($r)},pa.lineX1=function(){return pn().x(Qt).y(mr)},pa.defined=function(Ga){return arguments.length?(oa=typeof Ga=="function"?Ga:A(!!Ga),pa):oa},pa.curve=function(Ga){return arguments.length?(ya=Ga,Sa!=null&&(ra=ya(Sa)),pa):ya},pa.context=function(Ga){return arguments.length?(Ga==null?Sa=ra=null:ra=ya(Sa=Ga),pa):Sa},pa}function z(wt,Qt){return Qtwt?1:Qt>=wt?0:NaN}function F(wt){return wt}function B(){var wt=F,Qt=z,mr=null,$r=A(0),oa=A(f),Sa=A(0);function ya(ra){var pa,pn=ra.length,Ga,qn,Vn=0,di=new Array(pn),yi=new Array(pn),Ci=+$r.apply(this,arguments),ci=Math.min(f,Math.max(-f,oa.apply(this,arguments)-Ci)),ei,mi=Math.min(Math.abs(ci)/pn,Sa.apply(this,arguments)),uo=mi*(ci<0?-1:1),Lo;for(pa=0;pa0&&(Vn+=Lo);for(Qt!=null?di.sort(function(Wo,li){return Qt(yi[Wo],yi[li])}):mr!=null&&di.sort(function(Wo,li){return mr(ra[Wo],ra[li])}),pa=0,qn=Vn?(ci-pn*uo)/Vn:0;pa0?Lo*qn:0)+uo,yi[Ga]={data:ra[Ga],index:pa,value:Lo,startAngle:Ci,endAngle:ei,padAngle:mi};return yi}return ya.value=function(ra){return arguments.length?(wt=typeof ra=="function"?ra:A(+ra),ya):wt},ya.sortValues=function(ra){return arguments.length?(Qt=ra,mr=null,ya):Qt},ya.sort=function(ra){return arguments.length?(mr=ra,Qt=null,ya):mr},ya.startAngle=function(ra){return arguments.length?($r=typeof ra=="function"?ra:A(+ra),ya):$r},ya.endAngle=function(ra){return arguments.length?(oa=typeof ra=="function"?ra:A(+ra),ya):oa},ya.padAngle=function(ra){return arguments.length?(Sa=typeof ra=="function"?ra:A(+ra),ya):Sa},ya}var O=N(u);function L(wt){this._curve=wt}L.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(wt,Qt){this._curve.point(Qt*Math.sin(wt),Qt*-Math.cos(wt))}};function N(wt){function Qt(mr){return new L(wt(mr))}return Qt._curve=wt,Qt}function U(wt){var Qt=wt.curve;return wt.angle=wt.x,delete wt.x,wt.radius=wt.y,delete wt.y,wt.curve=function(mr){return arguments.length?Qt(N(mr)):Qt()._curve},wt}function Z(){return U(R().curve(O))}function Q(){var wt=P().curve(O),Qt=wt.curve,mr=wt.lineX0,$r=wt.lineX1,oa=wt.lineY0,Sa=wt.lineY1;return wt.angle=wt.x,delete wt.x,wt.startAngle=wt.x0,delete wt.x0,wt.endAngle=wt.x1,delete wt.x1,wt.radius=wt.y,delete wt.y,wt.innerRadius=wt.y0,delete wt.y0,wt.outerRadius=wt.y1,delete wt.y1,wt.lineStartAngle=function(){return U(mr())},delete wt.lineX0,wt.lineEndAngle=function(){return U($r())},delete wt.lineX1,wt.lineInnerRadius=function(){return U(oa())},delete wt.lineY0,wt.lineOuterRadius=function(){return U(Sa())},delete wt.lineY1,wt.curve=function(ya){return arguments.length?Qt(N(ya)):Qt()._curve},wt}function ue(wt,Qt){return[(Qt=+Qt)*Math.cos(wt-=Math.PI/2),Qt*Math.sin(wt)]}var oe=Array.prototype.slice;function le(wt){return wt.source}function j(wt){return wt.target}function J(wt){var Qt=le,mr=j,$r=g,oa=m,Sa=null;function ya(){var ra,pa=oe.call(arguments),pn=Qt.apply(this,pa),Ga=mr.apply(this,pa);if(Sa||(Sa=ra=x.path()),wt(Sa,+$r.apply(this,(pa[0]=pn,pa)),+oa.apply(this,pa),+$r.apply(this,(pa[0]=Ga,pa)),+oa.apply(this,pa)),ra)return Sa=null,ra+""||null}return ya.source=function(ra){return arguments.length?(Qt=ra,ya):Qt},ya.target=function(ra){return arguments.length?(mr=ra,ya):mr},ya.x=function(ra){return arguments.length?($r=typeof ra=="function"?ra:A(+ra),ya):$r},ya.y=function(ra){return arguments.length?(oa=typeof ra=="function"?ra:A(+ra),ya):oa},ya.context=function(ra){return arguments.length?(Sa=ra??null,ya):Sa},ya}function $(wt,Qt,mr,$r,oa){wt.moveTo(Qt,mr),wt.bezierCurveTo(Qt=(Qt+$r)/2,mr,Qt,oa,$r,oa)}function X(wt,Qt,mr,$r,oa){wt.moveTo(Qt,mr),wt.bezierCurveTo(Qt,mr=(mr+oa)/2,$r,mr,$r,oa)}function re(wt,Qt,mr,$r,oa){var Sa=ue(Qt,mr),ya=ue(Qt,mr=(mr+oa)/2),ra=ue($r,mr),pa=ue($r,oa);wt.moveTo(Sa[0],Sa[1]),wt.bezierCurveTo(ya[0],ya[1],ra[0],ra[1],pa[0],pa[1])}function ee(){return J($)}function q(){return J(X)}function ae(){var wt=J(re);return wt.angle=wt.x,delete wt.x,wt.radius=wt.y,delete wt.y,wt}var ie={draw:function(wt,Qt){var mr=Math.sqrt(Qt/s);wt.moveTo(mr,0),wt.arc(0,0,mr,0,f)}},fe={draw:function(wt,Qt){var mr=Math.sqrt(Qt/5)/2;wt.moveTo(-3*mr,-mr),wt.lineTo(-mr,-mr),wt.lineTo(-mr,-3*mr),wt.lineTo(mr,-3*mr),wt.lineTo(mr,-mr),wt.lineTo(3*mr,-mr),wt.lineTo(3*mr,mr),wt.lineTo(mr,mr),wt.lineTo(mr,3*mr),wt.lineTo(-mr,3*mr),wt.lineTo(-mr,mr),wt.lineTo(-3*mr,mr),wt.closePath()}},we=Math.sqrt(1/3),Ae=we*2,Fe={draw:function(wt,Qt){var mr=Math.sqrt(Qt/Ae),$r=mr*we;wt.moveTo(0,-mr),wt.lineTo($r,0),wt.lineTo(0,mr),wt.lineTo(-$r,0),wt.closePath()}},Ce=.8908130915292852,qe=Math.sin(s/10)/Math.sin(7*s/10),et=Math.sin(f/10)*qe,Qe=-Math.cos(f/10)*qe,Ke={draw:function(wt,Qt){var mr=Math.sqrt(Qt*Ce),$r=et*mr,oa=Qe*mr;wt.moveTo(0,-mr),wt.lineTo($r,oa);for(var Sa=1;Sa<5;++Sa){var ya=f*Sa/5,ra=Math.cos(ya),pa=Math.sin(ya);wt.lineTo(pa*mr,-ra*mr),wt.lineTo(ra*$r-pa*oa,pa*$r+ra*oa)}wt.closePath()}},Xe={draw:function(wt,Qt){var mr=Math.sqrt(Qt),$r=-mr/2;wt.rect($r,$r,mr,mr)}},Me=Math.sqrt(3),xe={draw:function(wt,Qt){var mr=-Math.sqrt(Qt/(Me*3));wt.moveTo(0,mr*2),wt.lineTo(-Me*mr,-mr),wt.lineTo(Me*mr,-mr),wt.closePath()}},ce=-.5,Re=Math.sqrt(3)/2,$e=1/Math.sqrt(12),rt=($e/2+1)*3,Je={draw:function(wt,Qt){var mr=Math.sqrt(Qt/rt),$r=mr/2,oa=mr*$e,Sa=$r,ya=mr*$e+mr,ra=-Sa,pa=ya;wt.moveTo($r,oa),wt.lineTo(Sa,ya),wt.lineTo(ra,pa),wt.lineTo(ce*$r-Re*oa,Re*$r+ce*oa),wt.lineTo(ce*Sa-Re*ya,Re*Sa+ce*ya),wt.lineTo(ce*ra-Re*pa,Re*ra+ce*pa),wt.lineTo(ce*$r+Re*oa,ce*oa-Re*$r),wt.lineTo(ce*Sa+Re*ya,ce*ya-Re*Sa),wt.lineTo(ce*ra+Re*pa,ce*pa-Re*ra),wt.closePath()}},At=[ie,fe,Fe,Xe,Ke,xe,Je];function St(){var wt=A(ie),Qt=A(64),mr=null;function $r(){var oa;if(mr||(mr=oa=x.path()),wt.apply(this,arguments).draw(mr,+Qt.apply(this,arguments)),oa)return mr=null,oa+""||null}return $r.type=function(oa){return arguments.length?(wt=typeof oa=="function"?oa:A(oa),$r):wt},$r.size=function(oa){return arguments.length?(Qt=typeof oa=="function"?oa:A(+oa),$r):Qt},$r.context=function(oa){return arguments.length?(mr=oa??null,$r):mr},$r}function Rt(){}function Ut(wt,Qt,mr){wt._context.bezierCurveTo((2*wt._x0+wt._x1)/3,(2*wt._y0+wt._y1)/3,(wt._x0+2*wt._x1)/3,(wt._y0+2*wt._y1)/3,(wt._x0+4*wt._x1+Qt)/6,(wt._y0+4*wt._y1+mr)/6)}function ir(wt){this._context=wt}ir.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:Ut(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(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1,this._line?this._context.lineTo(wt,Qt):this._context.moveTo(wt,Qt);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:Ut(this,wt,Qt);break}this._x0=this._x1,this._x1=wt,this._y0=this._y1,this._y1=Qt}};function ar(wt){return new ir(wt)}function Mr(wt){this._context=wt}Mr.prototype={areaStart:Rt,areaEnd:Rt,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(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1,this._x2=wt,this._y2=Qt;break;case 1:this._point=2,this._x3=wt,this._y3=Qt;break;case 2:this._point=3,this._x4=wt,this._y4=Qt,this._context.moveTo((this._x0+4*this._x1+wt)/6,(this._y0+4*this._y1+Qt)/6);break;default:Ut(this,wt,Qt);break}this._x0=this._x1,this._x1=wt,this._y0=this._y1,this._y1=Qt}};function fr(wt){return new Mr(wt)}function dr(wt){this._context=wt}dr.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(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var mr=(this._x0+4*this._x1+wt)/6,$r=(this._y0+4*this._y1+Qt)/6;this._line?this._context.lineTo(mr,$r):this._context.moveTo(mr,$r);break;case 3:this._point=4;default:Ut(this,wt,Qt);break}this._x0=this._x1,this._x1=wt,this._y0=this._y1,this._y1=Qt}};function pt(wt){return new dr(wt)}function ze(wt,Qt){this._basis=new ir(wt),this._beta=Qt}ze.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var wt=this._x,Qt=this._y,mr=wt.length-1;if(mr>0)for(var $r=wt[0],oa=Qt[0],Sa=wt[mr]-$r,ya=Qt[mr]-oa,ra=-1,pa;++ra<=mr;)pa=ra/mr,this._basis.point(this._beta*wt[ra]+(1-this._beta)*($r+pa*Sa),this._beta*Qt[ra]+(1-this._beta)*(oa+pa*ya));this._x=this._y=null,this._basis.lineEnd()},point:function(wt,Qt){this._x.push(+wt),this._y.push(+Qt)}};var Ge=function wt(Qt){function mr($r){return Qt===1?new ir($r):new ze($r,Qt)}return mr.beta=function($r){return wt(+$r)},mr}(.85);function Oe(wt,Qt,mr){wt._context.bezierCurveTo(wt._x1+wt._k*(wt._x2-wt._x0),wt._y1+wt._k*(wt._y2-wt._y0),wt._x2+wt._k*(wt._x1-Qt),wt._y2+wt._k*(wt._y1-mr),wt._x2,wt._y2)}function ve(wt,Qt){this._context=wt,this._k=(1-Qt)/6}ve.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:Oe(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1,this._line?this._context.lineTo(wt,Qt):this._context.moveTo(wt,Qt);break;case 1:this._point=2,this._x1=wt,this._y1=Qt;break;case 2:this._point=3;default:Oe(this,wt,Qt);break}this._x0=this._x1,this._x1=this._x2,this._x2=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var ge=function wt(Qt){function mr($r){return new ve($r,Qt)}return mr.tension=function($r){return wt(+$r)},mr}(0);function be(wt,Qt){this._context=wt,this._k=(1-Qt)/6}be.prototype={areaStart:Rt,areaEnd:Rt,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(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1,this._x3=wt,this._y3=Qt;break;case 1:this._point=2,this._context.moveTo(this._x4=wt,this._y4=Qt);break;case 2:this._point=3,this._x5=wt,this._y5=Qt;break;default:Oe(this,wt,Qt);break}this._x0=this._x1,this._x1=this._x2,this._x2=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var Pe=function wt(Qt){function mr($r){return new be($r,Qt)}return mr.tension=function($r){return wt(+$r)},mr}(0);function We(wt,Qt){this._context=wt,this._k=(1-Qt)/6}We.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(wt,Qt){switch(wt=+wt,Qt=+Qt,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:Oe(this,wt,Qt);break}this._x0=this._x1,this._x1=this._x2,this._x2=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var ct=function wt(Qt){function mr($r){return new We($r,Qt)}return mr.tension=function($r){return wt(+$r)},mr}(0);function _t(wt,Qt,mr){var $r=wt._x1,oa=wt._y1,Sa=wt._x2,ya=wt._y2;if(wt._l01_a>n){var ra=2*wt._l01_2a+3*wt._l01_a*wt._l12_a+wt._l12_2a,pa=3*wt._l01_a*(wt._l01_a+wt._l12_a);$r=($r*ra-wt._x0*wt._l12_2a+wt._x2*wt._l01_2a)/pa,oa=(oa*ra-wt._y0*wt._l12_2a+wt._y2*wt._l01_2a)/pa}if(wt._l23_a>n){var pn=2*wt._l23_2a+3*wt._l23_a*wt._l12_a+wt._l12_2a,Ga=3*wt._l23_a*(wt._l23_a+wt._l12_a);Sa=(Sa*pn+wt._x1*wt._l23_2a-Qt*wt._l12_2a)/Ga,ya=(ya*pn+wt._y1*wt._l23_2a-mr*wt._l12_2a)/Ga}wt._context.bezierCurveTo($r,oa,Sa,ya,wt._x2,wt._y2)}function Mt(wt,Qt){this._context=wt,this._alpha=Qt}Mt.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(wt,Qt){if(wt=+wt,Qt=+Qt,this._point){var mr=this._x2-wt,$r=this._y2-Qt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(mr*mr+$r*$r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(wt,Qt):this._context.moveTo(wt,Qt);break;case 1:this._point=2;break;case 2:this._point=3;default:_t(this,wt,Qt);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=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var Nt=function wt(Qt){function mr($r){return Qt?new Mt($r,Qt):new ve($r,0)}return mr.alpha=function($r){return wt(+$r)},mr}(.5);function Bt(wt,Qt){this._context=wt,this._alpha=Qt}Bt.prototype={areaStart:Rt,areaEnd:Rt,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(wt,Qt){if(wt=+wt,Qt=+Qt,this._point){var mr=this._x2-wt,$r=this._y2-Qt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(mr*mr+$r*$r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=wt,this._y3=Qt;break;case 1:this._point=2,this._context.moveTo(this._x4=wt,this._y4=Qt);break;case 2:this._point=3,this._x5=wt,this._y5=Qt;break;default:_t(this,wt,Qt);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=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var qt=function wt(Qt){function mr($r){return Qt?new Bt($r,Qt):new be($r,0)}return mr.alpha=function($r){return wt(+$r)},mr}(.5);function Zt(wt,Qt){this._context=wt,this._alpha=Qt}Zt.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(wt,Qt){if(wt=+wt,Qt=+Qt,this._point){var mr=this._x2-wt,$r=this._y2-Qt;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(mr*mr+$r*$r,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:_t(this,wt,Qt);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=wt,this._y0=this._y1,this._y1=this._y2,this._y2=Qt}};var lr=function wt(Qt){function mr($r){return Qt?new Zt($r,Qt):new We($r,0)}return mr.alpha=function($r){return wt(+$r)},mr}(.5);function ta(wt){this._context=wt}ta.prototype={areaStart:Rt,areaEnd:Rt,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(wt,Qt){wt=+wt,Qt=+Qt,this._point?this._context.lineTo(wt,Qt):(this._point=1,this._context.moveTo(wt,Qt))}};function da(wt){return new ta(wt)}function wa(wt){return wt<0?-1:1}function ma(wt,Qt,mr){var $r=wt._x1-wt._x0,oa=Qt-wt._x1,Sa=(wt._y1-wt._y0)/($r||oa<0&&-0),ya=(mr-wt._y1)/(oa||$r<0&&-0),ra=(Sa*oa+ya*$r)/($r+oa);return(wa(Sa)+wa(ya))*Math.min(Math.abs(Sa),Math.abs(ya),.5*Math.abs(ra))||0}function Ia(wt,Qt){var mr=wt._x1-wt._x0;return mr?(3*(wt._y1-wt._y0)/mr-Qt)/2:Qt}function va(wt,Qt,mr){var $r=wt._x0,oa=wt._y0,Sa=wt._x1,ya=wt._y1,ra=(Sa-$r)/3;wt._context.bezierCurveTo($r+ra,oa+ra*Qt,Sa-ra,ya-ra*mr,Sa,ya)}function La(wt){this._context=wt}La.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:va(this,this._t0,Ia(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(wt,Qt){var mr=NaN;if(wt=+wt,Qt=+Qt,!(wt===this._x1&&Qt===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(wt,Qt):this._context.moveTo(wt,Qt);break;case 1:this._point=2;break;case 2:this._point=3,va(this,Ia(this,mr=ma(this,wt,Qt)),mr);break;default:va(this,this._t0,mr=ma(this,wt,Qt));break}this._x0=this._x1,this._x1=wt,this._y0=this._y1,this._y1=Qt,this._t0=mr}}};function Ka(wt){this._context=new Vt(wt)}(Ka.prototype=Object.create(La.prototype)).point=function(wt,Qt){La.prototype.point.call(this,Qt,wt)};function Vt(wt){this._context=wt}Vt.prototype={moveTo:function(wt,Qt){this._context.moveTo(Qt,wt)},closePath:function(){this._context.closePath()},lineTo:function(wt,Qt){this._context.lineTo(Qt,wt)},bezierCurveTo:function(wt,Qt,mr,$r,oa,Sa){this._context.bezierCurveTo(Qt,wt,$r,mr,Sa,oa)}};function Lt(wt){return new La(wt)}function jt(wt){return new Ka(wt)}function Ot(wt){this._context=wt}Ot.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var wt=this._x,Qt=this._y,mr=wt.length;if(mr)if(this._line?this._context.lineTo(wt[0],Qt[0]):this._context.moveTo(wt[0],Qt[0]),mr===2)this._context.lineTo(wt[1],Qt[1]);else for(var $r=gr(wt),oa=gr(Qt),Sa=0,ya=1;ya=0;--Qt)oa[Qt]=(ya[Qt]-oa[Qt+1])/Sa[Qt];for(Sa[mr-1]=(wt[mr]+oa[mr-1])/2,Qt=0;Qt=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(wt,Qt){switch(wt=+wt,Qt=+Qt,this._point){case 0:this._point=1,this._line?this._context.lineTo(wt,Qt):this._context.moveTo(wt,Qt);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,Qt),this._context.lineTo(wt,Qt);else{var mr=this._x*(1-this._t)+wt*this._t;this._context.lineTo(mr,this._y),this._context.lineTo(mr,Qt)}break}}this._x=wt,this._y=Qt}};function Ur(wt){return new na(wt,.5)}function ga(wt){return new na(wt,0)}function Aa(wt){return new na(wt,1)}function Pa(wt,Qt){if((ya=wt.length)>1)for(var mr=1,$r,oa,Sa=wt[Qt[0]],ya,ra=Sa.length;mr=0;)mr[Qt]=Qt;return mr}function Oa(wt,Qt){return wt[Qt]}function dt(){var wt=A([]),Qt=sa,mr=Pa,$r=Oa;function oa(Sa){var ya=wt.apply(this,arguments),ra,pa=Sa.length,pn=ya.length,Ga=new Array(pn),qn;for(ra=0;ra0){for(var mr,$r,oa=0,Sa=wt[0].length,ya;oa0)for(var mr,$r=0,oa,Sa,ya,ra,pa,pn=wt[Qt[0]].length;$r0?(oa[0]=ya,oa[1]=ya+=Sa):Sa<0?(oa[1]=ra,oa[0]=ra+=Sa):(oa[0]=0,oa[1]=Sa)}function Er(wt,Qt){if((oa=wt.length)>0){for(var mr=0,$r=wt[Qt[0]],oa,Sa=$r.length;mr0)||!((Sa=(oa=wt[Qt[0]]).length)>0))){for(var mr=0,$r=1,oa,Sa,ya;$rSa&&(Sa=oa,mr=Qt);return mr}function zr(wt){var Qt=wt.map(Pr);return sa(wt).sort(function(mr,$r){return Qt[mr]-Qt[$r]})}function Pr(wt){for(var Qt=0,mr=-1,$r=wt.length,oa;++mr<$r;)(oa=+wt[mr][1])&&(Qt+=oa);return Qt}function Hr(wt){return zr(wt).reverse()}function Zr(wt){var Qt=wt.length,mr,$r,oa=wt.map(Pr),Sa=yr(wt),ya=0,ra=0,pa=[],pn=[];for(mr=0;mr0;--re)ae(X*=.99),ie(),q(X),ie();function ee(){var fe=x.max($,function(Fe){return Fe.length}),we=U*(R-g)/(fe-1);z>we&&(z=we);var Ae=x.min($,function(Fe){return(R-g-(Fe.length-1)*z)/x.sum(Fe,f)});$.forEach(function(Fe){Fe.forEach(function(Ce,qe){Ce.y1=(Ce.y0=qe)+Ce.value*Ae})}),J.links.forEach(function(Fe){Fe.width=Fe.value*Ae})}function q(fe){$.forEach(function(we){we.forEach(function(Ae){if(Ae.targetLinks.length){var Fe=(x.sum(Ae.targetLinks,h)/x.sum(Ae.targetLinks,f)-v(Ae))*fe;Ae.y0+=Fe,Ae.y1+=Fe}})})}function ae(fe){$.slice().reverse().forEach(function(we){we.forEach(function(Ae){if(Ae.sourceLinks.length){var Fe=(x.sum(Ae.sourceLinks,T)/x.sum(Ae.sourceLinks,f)-v(Ae))*fe;Ae.y0+=Fe,Ae.y1+=Fe}})})}function ie(){$.forEach(function(fe){var we,Ae,Fe=g,Ce=fe.length,qe;for(fe.sort(c),qe=0;qe0&&(we.y0+=Ae,we.y1+=Ae),Fe=we.y1+z;if(Ae=Fe-z-R,Ae>0)for(Fe=we.y0-=Ae,we.y1-=Ae,qe=Ce-2;qe>=0;--qe)we=fe[qe],Ae=we.y1+z-Fe,Ae>0&&(we.y0-=Ae,we.y1-=Ae),Fe=we.y0})}}function j(J){J.nodes.forEach(function($){$.sourceLinks.sort(s),$.targetLinks.sort(n)}),J.nodes.forEach(function($){var X=$.y0,re=X;$.sourceLinks.forEach(function(ee){ee.y0=X+ee.width/2,X+=ee.width}),$.targetLinks.forEach(function(ee){ee.y1=re+ee.width/2,re+=ee.width})})}return Z};function _(u){return[u.source.x1,u.y0]}function w(u){return[u.target.x0,u.y1]}var p=function(){return E.linkHorizontal().source(_).target(w)};d.sankey=M,d.sankeyCenter=a,d.sankeyLeft=t,d.sankeyRight=r,d.sankeyJustify=o,d.sankeyLinkHorizontal=p,Object.defineProperty(d,"__esModule",{value:!0})})}}),HR=He({"node_modules/elementary-circuits-directed-graph/johnson.js"(Y,G){var d=YT();G.exports=function(A,E){var e=[],t=[],r=[],o={},a=[],i;function n(S){r[S]=!1,o.hasOwnProperty(S)&&Object.keys(o[S]).forEach(function(M){delete o[S][M],r[M]&&n(M)})}function s(S){var M=!1;t.push(S),r[S]=!0;var _,w;for(_=0;_=S})}function v(S){f(S);for(var M=A,_=d(M),w=_.components.filter(function(z){return z.length>1}),p=1/0,u,g=0;g"u"?"undefined":s(ve))!=="object"&&(ve=Ge.source=_(ze,ve)),(typeof ge>"u"?"undefined":s(ge))!=="object"&&(ge=Ge.target=_(ze,ge)),ve.sourceLinks.push(Ge),ge.targetLinks.push(Ge)}),pt}function Ut(pt){pt.nodes.forEach(function(ze){ze.partOfCycle=!1,ze.value=Math.max(x.sum(ze.sourceLinks,h),x.sum(ze.targetLinks,h)),ze.sourceLinks.forEach(function(Ge){Ge.circular&&(ze.partOfCycle=!0,ze.circularLinkType=Ge.circularLinkType)}),ze.targetLinks.forEach(function(Ge){Ge.circular&&(ze.partOfCycle=!0,ze.circularLinkType=Ge.circularLinkType)})})}function ir(pt){var ze=0,Ge=0,Oe=0,ve=0,ge=x.max(pt.nodes,function(be){return be.column});return pt.links.forEach(function(be){be.circular&&(be.circularLinkType=="top"?ze=ze+be.width:Ge=Ge+be.width,be.target.column==0&&(ve=ve+be.width),be.source.column==ge&&(Oe=Oe+be.width))}),ze=ze>0?ze+p+u:ze,Ge=Ge>0?Ge+p+u:Ge,Oe=Oe>0?Oe+p+u:Oe,ve=ve>0?ve+p+u:ve,{top:ze,bottom:Ge,left:ve,right:Oe}}function ar(pt,ze){var Ge=x.max(pt.nodes,function(ct){return ct.column}),Oe=et-Ce,ve=Qe-qe,ge=Oe+ze.right+ze.left,be=ve+ze.top+ze.bottom,Pe=Oe/ge,We=ve/be;return Ce=Ce*Pe+ze.left,et=ze.right==0?et:et*Pe,qe=qe*We+ze.top,Qe=Qe*We,pt.nodes.forEach(function(ct){ct.x0=Ce+ct.column*((et-Ce-Ke)/Ge),ct.x1=ct.x0+Ke}),We}function Mr(pt){var ze,Ge,Oe;for(ze=pt.nodes,Ge=[],Oe=0;ze.length;++Oe,ze=Ge,Ge=[])ze.forEach(function(ve){ve.depth=Oe,ve.sourceLinks.forEach(function(ge){Ge.indexOf(ge.target)<0&&!ge.circular&&Ge.push(ge.target)})});for(ze=pt.nodes,Ge=[],Oe=0;ze.length;++Oe,ze=Ge,Ge=[])ze.forEach(function(ve){ve.height=Oe,ve.targetLinks.forEach(function(ge){Ge.indexOf(ge.source)<0&&!ge.circular&&Ge.push(ge.source)})});pt.nodes.forEach(function(ve){ve.column=Math.floor(xe.call(null,ve,Oe))})}function fr(pt,ze,Ge){var Oe=A.nest().key(function(ct){return ct.column}).sortKeys(x.ascending).entries(pt.nodes).map(function(ct){return ct.values});be(Ge),We();for(var ve=1,ge=ze;ge>0;--ge)Pe(ve*=.99,Ge),We();function be(ct){if(Je){var _t=1/0;Oe.forEach(function(qt){var Zt=Qe*Je/(qt.length+1);_t=Zt<_t?Zt:_t}),Xe=_t}var Mt=x.min(Oe,function(qt){return(Qe-qe-(qt.length-1)*Xe)/x.sum(qt,h)});Mt=Mt*g,pt.links.forEach(function(qt){qt.width=qt.value*Mt});var Nt=ir(pt),Bt=ar(pt,Nt);Mt=Mt*Bt,pt.links.forEach(function(qt){qt.width=qt.value*Mt}),Oe.forEach(function(qt){var Zt=qt.length;qt.forEach(function(lr,ta){lr.depth==Oe.length-1&&Zt==1||lr.depth==0&&Zt==1?(lr.y0=Qe/2-lr.value*Mt,lr.y1=lr.y0+lr.value*Mt):lr.partOfCycle?B(lr,ct)==0?(lr.y0=Qe/2+ta,lr.y1=lr.y0+lr.value*Mt):lr.circularLinkType=="top"?(lr.y0=qe+ta,lr.y1=lr.y0+lr.value*Mt):(lr.y0=Qe-lr.value*Mt-ta,lr.y1=lr.y0+lr.value*Mt):Nt.top==0||Nt.bottom==0?(lr.y0=(Qe-qe)/Zt*ta,lr.y1=lr.y0+lr.value*Mt):(lr.y0=(Qe-qe)/2-Zt/2+ta,lr.y1=lr.y0+lr.value*Mt)})})}function Pe(ct,_t){var Mt=Oe.length;Oe.forEach(function(Nt){var Bt=Nt.length,qt=Nt[0].depth;Nt.forEach(function(Zt){var lr;if((Zt.sourceLinks.length||Zt.targetLinks.length)&&!(Zt.partOfCycle&&B(Zt,_t)>0))if(qt==0&&Bt==1)lr=Zt.y1-Zt.y0,Zt.y0=Qe/2-lr/2,Zt.y1=Qe/2+lr/2;else if(qt==Mt-1&&Bt==1)lr=Zt.y1-Zt.y0,Zt.y0=Qe/2-lr/2,Zt.y1=Qe/2+lr/2;else{var ta=0,da=x.mean(Zt.sourceLinks,y),wa=x.mean(Zt.targetLinks,l);da&&wa?ta=(da+wa)/2:ta=da||wa;var ma=(ta-T(Zt))*ct;Zt.y0+=ma,Zt.y1+=ma}})})}function We(){Oe.forEach(function(ct){var _t,Mt,Nt=qe,Bt=ct.length,qt;for(ct.sort(v),qt=0;qt0&&(_t.y0+=Mt,_t.y1+=Mt),Nt=_t.y1+Xe;if(Mt=Nt-Xe-Qe,Mt>0)for(Nt=_t.y0-=Mt,_t.y1-=Mt,qt=Bt-2;qt>=0;--qt)_t=ct[qt],Mt=_t.y1+Xe-Nt,Mt>0&&(_t.y0-=Mt,_t.y1-=Mt),Nt=_t.y0})}}function dr(pt){pt.nodes.forEach(function(ze){ze.sourceLinks.sort(f),ze.targetLinks.sort(c)}),pt.nodes.forEach(function(ze){var Ge=ze.y0,Oe=Ge,ve=ze.y1,ge=ve;ze.sourceLinks.forEach(function(be){be.circular?(be.y0=ve-be.width/2,ve=ve-be.width):(be.y0=Ge+be.width/2,Ge+=be.width)}),ze.targetLinks.forEach(function(be){be.circular?(be.y1=ge-be.width/2,ge=ge-be.width):(be.y1=Oe+be.width/2,Oe+=be.width)})})}return St}function R(Ce,qe,et){var Qe=0;if(et===null){for(var Ke=[],Xe=0;Xeqe.source.column)}function B(Ce,qe){var et=0;Ce.sourceLinks.forEach(function(Ke){et=Ke.circular&&!Ae(Ke,qe)?et+1:et});var Qe=0;return Ce.targetLinks.forEach(function(Ke){Qe=Ke.circular&&!Ae(Ke,qe)?Qe+1:Qe}),et+Qe}function O(Ce){var qe=Ce.source.sourceLinks,et=0;qe.forEach(function(Xe){et=Xe.circular?et+1:et});var Qe=Ce.target.targetLinks,Ke=0;return Qe.forEach(function(Xe){Ke=Xe.circular?Ke+1:Ke}),!(et>1||Ke>1)}function L(Ce,qe,et){return Ce.sort(Z),Ce.forEach(function(Qe,Ke){var Xe=0;if(Ae(Qe,et)&&O(Qe))Qe.circularPathData.verticalBuffer=Xe+Qe.width/2;else{var Me=0;for(Me;MeXe?xe:Xe}Qe.circularPathData.verticalBuffer=Xe+Qe.width/2}}),Ce}function N(Ce,qe,et,Qe){var Ke=5,Xe=x.min(Ce.links,function(ce){return ce.source.y0});Ce.links.forEach(function(ce){ce.circular&&(ce.circularPathData={})});var Me=Ce.links.filter(function(ce){return ce.circularLinkType=="top"});L(Me,qe,Qe);var xe=Ce.links.filter(function(ce){return ce.circularLinkType=="bottom"});L(xe,qe,Qe),Ce.links.forEach(function(ce){if(ce.circular){if(ce.circularPathData.arcRadius=ce.width+u,ce.circularPathData.leftNodeBuffer=Ke,ce.circularPathData.rightNodeBuffer=Ke,ce.circularPathData.sourceWidth=ce.source.x1-ce.source.x0,ce.circularPathData.sourceX=ce.source.x0+ce.circularPathData.sourceWidth,ce.circularPathData.targetX=ce.target.x0,ce.circularPathData.sourceY=ce.y0,ce.circularPathData.targetY=ce.y1,Ae(ce,Qe)&&O(ce))ce.circularPathData.leftSmallArcRadius=u+ce.width/2,ce.circularPathData.leftLargeArcRadius=u+ce.width/2,ce.circularPathData.rightSmallArcRadius=u+ce.width/2,ce.circularPathData.rightLargeArcRadius=u+ce.width/2,ce.circularLinkType=="bottom"?(ce.circularPathData.verticalFullExtent=ce.source.y1+p+ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.rightLargeArcRadius):(ce.circularPathData.verticalFullExtent=ce.source.y0-p-ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.rightLargeArcRadius);else{var Re=ce.source.column,$e=ce.circularLinkType,rt=Ce.links.filter(function(St){return St.source.column==Re&&St.circularLinkType==$e});ce.circularLinkType=="bottom"?rt.sort(ue):rt.sort(Q);var Je=0;rt.forEach(function(St,Rt){St.circularLinkID==ce.circularLinkID&&(ce.circularPathData.leftSmallArcRadius=u+ce.width/2+Je,ce.circularPathData.leftLargeArcRadius=u+ce.width/2+Rt*qe+Je),Je=Je+St.width}),Re=ce.target.column,rt=Ce.links.filter(function(St){return St.target.column==Re&&St.circularLinkType==$e}),ce.circularLinkType=="bottom"?rt.sort(le):rt.sort(oe),Je=0,rt.forEach(function(St,Rt){St.circularLinkID==ce.circularLinkID&&(ce.circularPathData.rightSmallArcRadius=u+ce.width/2+Je,ce.circularPathData.rightLargeArcRadius=u+ce.width/2+Rt*qe+Je),Je=Je+St.width}),ce.circularLinkType=="bottom"?(ce.circularPathData.verticalFullExtent=Math.max(et,ce.source.y1,ce.target.y1)+p+ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent-ce.circularPathData.rightLargeArcRadius):(ce.circularPathData.verticalFullExtent=Xe-p-ce.circularPathData.verticalBuffer,ce.circularPathData.verticalLeftInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.leftLargeArcRadius,ce.circularPathData.verticalRightInnerExtent=ce.circularPathData.verticalFullExtent+ce.circularPathData.rightLargeArcRadius)}ce.circularPathData.leftInnerExtent=ce.circularPathData.sourceX+ce.circularPathData.leftNodeBuffer,ce.circularPathData.rightInnerExtent=ce.circularPathData.targetX-ce.circularPathData.rightNodeBuffer,ce.circularPathData.leftFullExtent=ce.circularPathData.sourceX+ce.circularPathData.leftLargeArcRadius+ce.circularPathData.leftNodeBuffer,ce.circularPathData.rightFullExtent=ce.circularPathData.targetX-ce.circularPathData.rightLargeArcRadius-ce.circularPathData.rightNodeBuffer}if(ce.circular)ce.path=U(ce);else{var At=E.linkHorizontal().source(function(St){var Rt=St.source.x0+(St.source.x1-St.source.x0),Ut=St.y0;return[Rt,Ut]}).target(function(St){var Rt=St.target.x0,Ut=St.y1;return[Rt,Ut]});ce.path=At(ce)}})}function U(Ce){var qe="";return Ce.circularLinkType=="top"?qe="M"+Ce.circularPathData.sourceX+" "+Ce.circularPathData.sourceY+" L"+Ce.circularPathData.leftInnerExtent+" "+Ce.circularPathData.sourceY+" A"+Ce.circularPathData.leftLargeArcRadius+" "+Ce.circularPathData.leftSmallArcRadius+" 0 0 0 "+Ce.circularPathData.leftFullExtent+" "+(Ce.circularPathData.sourceY-Ce.circularPathData.leftSmallArcRadius)+" L"+Ce.circularPathData.leftFullExtent+" "+Ce.circularPathData.verticalLeftInnerExtent+" A"+Ce.circularPathData.leftLargeArcRadius+" "+Ce.circularPathData.leftLargeArcRadius+" 0 0 0 "+Ce.circularPathData.leftInnerExtent+" "+Ce.circularPathData.verticalFullExtent+" L"+Ce.circularPathData.rightInnerExtent+" "+Ce.circularPathData.verticalFullExtent+" A"+Ce.circularPathData.rightLargeArcRadius+" "+Ce.circularPathData.rightLargeArcRadius+" 0 0 0 "+Ce.circularPathData.rightFullExtent+" "+Ce.circularPathData.verticalRightInnerExtent+" L"+Ce.circularPathData.rightFullExtent+" "+(Ce.circularPathData.targetY-Ce.circularPathData.rightSmallArcRadius)+" A"+Ce.circularPathData.rightLargeArcRadius+" "+Ce.circularPathData.rightSmallArcRadius+" 0 0 0 "+Ce.circularPathData.rightInnerExtent+" "+Ce.circularPathData.targetY+" L"+Ce.circularPathData.targetX+" "+Ce.circularPathData.targetY:qe="M"+Ce.circularPathData.sourceX+" "+Ce.circularPathData.sourceY+" L"+Ce.circularPathData.leftInnerExtent+" "+Ce.circularPathData.sourceY+" A"+Ce.circularPathData.leftLargeArcRadius+" "+Ce.circularPathData.leftSmallArcRadius+" 0 0 1 "+Ce.circularPathData.leftFullExtent+" "+(Ce.circularPathData.sourceY+Ce.circularPathData.leftSmallArcRadius)+" L"+Ce.circularPathData.leftFullExtent+" "+Ce.circularPathData.verticalLeftInnerExtent+" A"+Ce.circularPathData.leftLargeArcRadius+" "+Ce.circularPathData.leftLargeArcRadius+" 0 0 1 "+Ce.circularPathData.leftInnerExtent+" "+Ce.circularPathData.verticalFullExtent+" L"+Ce.circularPathData.rightInnerExtent+" "+Ce.circularPathData.verticalFullExtent+" A"+Ce.circularPathData.rightLargeArcRadius+" "+Ce.circularPathData.rightLargeArcRadius+" 0 0 1 "+Ce.circularPathData.rightFullExtent+" "+Ce.circularPathData.verticalRightInnerExtent+" L"+Ce.circularPathData.rightFullExtent+" "+(Ce.circularPathData.targetY+Ce.circularPathData.rightSmallArcRadius)+" A"+Ce.circularPathData.rightLargeArcRadius+" "+Ce.circularPathData.rightSmallArcRadius+" 0 0 1 "+Ce.circularPathData.rightInnerExtent+" "+Ce.circularPathData.targetY+" L"+Ce.circularPathData.targetX+" "+Ce.circularPathData.targetY,qe}function Z(Ce,qe){return j(Ce)==j(qe)?Ce.circularLinkType=="bottom"?ue(Ce,qe):Q(Ce,qe):j(qe)-j(Ce)}function Q(Ce,qe){return Ce.y0-qe.y0}function ue(Ce,qe){return qe.y0-Ce.y0}function oe(Ce,qe){return Ce.y1-qe.y1}function le(Ce,qe){return qe.y1-Ce.y1}function j(Ce){return Ce.target.column-Ce.source.column}function J(Ce){return Ce.target.x0-Ce.source.x1}function $(Ce,qe){var et=z(Ce),Qe=J(qe)/Math.tan(et),Ke=we(Ce)=="up"?Ce.y1+Qe:Ce.y1-Qe;return Ke}function X(Ce,qe){var et=z(Ce),Qe=J(qe)/Math.tan(et),Ke=we(Ce)=="up"?Ce.y1-Qe:Ce.y1+Qe;return Ke}function re(Ce,qe,et,Qe){Ce.links.forEach(function(Ke){if(!Ke.circular&&Ke.target.column-Ke.source.column>1){var Xe=Ke.source.column+1,Me=Ke.target.column-1,xe=1,ce=Me-Xe+1;for(xe=1;Xe<=Me;Xe++,xe++)Ce.nodes.forEach(function(Re){if(Re.column==Xe){var $e=xe/(ce+1),rt=Math.pow(1-$e,3),Je=3*$e*Math.pow(1-$e,2),At=3*Math.pow($e,2)*(1-$e),St=Math.pow($e,3),Rt=rt*Ke.y0+Je*Ke.y0+At*Ke.y1+St*Ke.y1,Ut=Rt-Ke.width/2,ir=Rt+Ke.width/2,ar;Ut>Re.y0&&UtRe.y0&&irRe.y1&&q(Mr,ar,qe,et)})):UtRe.y1&&(ar=ir-Re.y0+10,Re=q(Re,ar,qe,et),Ce.nodes.forEach(function(Mr){w(Mr,Qe)==w(Re,Qe)||Mr.column!=Re.column||Mr.y0Re.y1&&q(Mr,ar,qe,et)}))}})}})}function ee(Ce,qe){return Ce.y0>qe.y0&&Ce.y0qe.y0&&Ce.y1qe.y1}function q(Ce,qe,et,Qe){return Ce.y0+qe>=et&&Ce.y1+qe<=Qe&&(Ce.y0=Ce.y0+qe,Ce.y1=Ce.y1+qe,Ce.targetLinks.forEach(function(Ke){Ke.y1=Ke.y1+qe}),Ce.sourceLinks.forEach(function(Ke){Ke.y0=Ke.y0+qe})),Ce}function ae(Ce,qe,et,Qe){Ce.nodes.forEach(function(Ke){Qe&&Ke.y+(Ke.y1-Ke.y0)>qe&&(Ke.y=Ke.y-(Ke.y+(Ke.y1-Ke.y0)-qe));var Xe=Ce.links.filter(function(ce){return w(ce.source,et)==w(Ke,et)}),Me=Xe.length;Me>1&&Xe.sort(function(ce,Re){if(!ce.circular&&!Re.circular){if(ce.target.column==Re.target.column)return ce.y1-Re.y1;if(fe(ce,Re)){if(ce.target.column>Re.target.column){var $e=X(Re,ce);return ce.y1-$e}if(Re.target.column>ce.target.column){var rt=X(ce,Re);return rt-Re.y1}}else return ce.y1-Re.y1}if(ce.circular&&!Re.circular)return ce.circularLinkType=="top"?-1:1;if(Re.circular&&!ce.circular)return Re.circularLinkType=="top"?1:-1;if(ce.circular&&Re.circular)return ce.circularLinkType===Re.circularLinkType&&ce.circularLinkType=="top"?ce.target.column===Re.target.column?ce.target.y1-Re.target.y1:Re.target.column-ce.target.column:ce.circularLinkType===Re.circularLinkType&&ce.circularLinkType=="bottom"?ce.target.column===Re.target.column?Re.target.y1-ce.target.y1:ce.target.column-Re.target.column:ce.circularLinkType=="top"?-1:1});var xe=Ke.y0;Xe.forEach(function(ce){ce.y0=xe+ce.width/2,xe=xe+ce.width}),Xe.forEach(function(ce,Re){if(ce.circularLinkType=="bottom"){var $e=Re+1,rt=0;for($e;$e1&&Ke.sort(function(xe,ce){if(!xe.circular&&!ce.circular){if(xe.source.column==ce.source.column)return xe.y0-ce.y0;if(fe(xe,ce)){if(ce.source.column0?"up":"down"}function Ae(Ce,qe){return w(Ce.source,qe)==w(Ce.target,qe)}function Fe(Ce,qe,et){var Qe=Ce.nodes,Ke=Ce.links,Xe=!1,Me=!1;if(Ke.forEach(function(Je){Je.circularLinkType=="top"?Xe=!0:Je.circularLinkType=="bottom"&&(Me=!0)}),Xe==!1||Me==!1){var xe=x.min(Qe,function(Je){return Je.y0}),ce=x.max(Qe,function(Je){return Je.y1}),Re=ce-xe,$e=et-qe,rt=$e/Re;Qe.forEach(function(Je){var At=(Je.y1-Je.y0)*rt;Je.y0=(Je.y0-xe)*rt,Je.y1=Je.y0+At}),Ke.forEach(function(Je){Je.y0=(Je.y0-xe)*rt,Je.y1=(Je.y1-xe)*rt,Je.width=Je.width*rt})}}d.sankeyCircular=m,d.sankeyCenter=i,d.sankeyLeft=r,d.sankeyRight=o,d.sankeyJustify=a,Object.defineProperty(d,"__esModule",{value:!0})})}}),JT=He({"src/traces/sankey/constants.js"(Y,G){G.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"}}}}),WR=He({"src/traces/sankey/render.js"(Y,G){var d=jR(),x=(Gp(),Go(tp)).interpolateNumber,A=Qn(),E=qR(),e=GR(),t=JT(),r=Mf(),o=Ai(),a=vo(),i=Gr(),n=i.strTranslate,s=i.strRotate,c=Wv(),f=c.keyFun,v=c.repeat,h=c.unwrap,T=yl(),l=Ei(),y=df(),b=y.CAP_SHIFT,S=y.LINE_SPACING,M=3;function _($,X,re){var ee=h(X),q=ee.trace,ae=q.domain,ie=q.orientation==="h",fe=q.node.pad,we=q.node.thickness,Ae={justify:E.sankeyJustify,left:E.sankeyLeft,right:E.sankeyRight,center:E.sankeyCenter}[q.node.align],Fe=$.width*(ae.x[1]-ae.x[0]),Ce=$.height*(ae.y[1]-ae.y[0]),qe=ee._nodes,et=ee._links,Qe=ee.circular,Ke;Qe?Ke=e.sankeyCircular().circularLinkGap(0):Ke=E.sankey(),Ke.iterations(t.sankeyIterations).size(ie?[Fe,Ce]:[Ce,Fe]).nodeWidth(we).nodePadding(fe).nodeId(function(Mr){return Mr.pointNumber}).nodeAlign(Ae).nodes(qe).links(et);var Xe=Ke();Ke.nodePadding()=ze||(pt=ze-dr.y0,pt>1e-6&&(dr.y0+=pt,dr.y1+=pt)),ze=dr.y1+fe})}function Rt(Mr){var fr=Mr.map(function(ge,be){return{x0:ge.x0,index:be}}).sort(function(ge,be){return ge.x0-be.x0}),dr=[],pt=-1,ze,Ge=-1/0,Oe;for(Me=0;MeGe+we&&(pt+=1,ze=ve.x0),Ge=ve.x0,dr[pt]||(dr[pt]=[]),dr[pt].push(ve),Oe=ze-ve.x0,ve.x0+=Oe,ve.x1+=Oe}return dr}if(q.node.x.length&&q.node.y.length){for(Me=0;Me0?" L "+q.targetX+" "+q.targetY:"")+"Z"):(re="M "+(q.targetX-X)+" "+(q.targetY-ee)+" L "+(q.rightInnerExtent-X)+" "+(q.targetY-ee)+" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightSmallArcRadius+ee)+" 0 0 0 "+(q.rightFullExtent-ee-X)+" "+(q.targetY+q.rightSmallArcRadius)+" L "+(q.rightFullExtent-ee-X)+" "+q.verticalRightInnerExtent,ae&&ie?re+=" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightLargeArcRadius+ee)+" 0 0 0 "+(q.rightInnerExtent-ee-X)+" "+(q.verticalFullExtent+ee)+" L "+(q.rightFullExtent+ee-X-(q.rightLargeArcRadius-ee))+" "+(q.verticalFullExtent+ee)+" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightLargeArcRadius+ee)+" 0 0 0 "+(q.leftFullExtent+ee)+" "+q.verticalLeftInnerExtent:ae?re+=" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightSmallArcRadius-ee)+" 0 0 1 "+(q.rightFullExtent-X-ee-(q.rightLargeArcRadius-ee))+" "+(q.verticalFullExtent-ee)+" L "+(q.leftFullExtent+ee+(q.rightLargeArcRadius-ee))+" "+(q.verticalFullExtent-ee)+" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightSmallArcRadius-ee)+" 0 0 1 "+(q.leftFullExtent+ee)+" "+q.verticalLeftInnerExtent:re+=" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightLargeArcRadius+ee)+" 0 0 0 "+(q.rightInnerExtent-X)+" "+(q.verticalFullExtent+ee)+" L "+q.leftInnerExtent+" "+(q.verticalFullExtent+ee)+" A "+(q.leftLargeArcRadius+ee)+" "+(q.leftLargeArcRadius+ee)+" 0 0 0 "+(q.leftFullExtent+ee)+" "+q.verticalLeftInnerExtent,re+=" L "+(q.leftFullExtent+ee)+" "+(q.sourceY+q.leftSmallArcRadius)+" A "+(q.leftLargeArcRadius+ee)+" "+(q.leftSmallArcRadius+ee)+" 0 0 0 "+q.leftInnerExtent+" "+(q.sourceY-ee)+" L "+q.sourceX+" "+(q.sourceY-ee)+" L "+q.sourceX+" "+(q.sourceY+ee)+" L "+q.leftInnerExtent+" "+(q.sourceY+ee)+" A "+(q.leftLargeArcRadius-ee)+" "+(q.leftSmallArcRadius-ee)+" 0 0 1 "+(q.leftFullExtent-ee)+" "+(q.sourceY+q.leftSmallArcRadius)+" L "+(q.leftFullExtent-ee)+" "+q.verticalLeftInnerExtent,ae&&ie?re+=" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightSmallArcRadius-ee)+" 0 0 1 "+(q.leftFullExtent-ee-(q.rightLargeArcRadius-ee))+" "+(q.verticalFullExtent-ee)+" L "+(q.rightFullExtent+ee-X+(q.rightLargeArcRadius-ee))+" "+(q.verticalFullExtent-ee)+" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightSmallArcRadius-ee)+" 0 0 1 "+(q.rightFullExtent+ee-X)+" "+q.verticalRightInnerExtent:ae?re+=" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightLargeArcRadius+ee)+" 0 0 0 "+(q.leftFullExtent+ee)+" "+(q.verticalFullExtent+ee)+" L "+(q.rightFullExtent-X-ee)+" "+(q.verticalFullExtent+ee)+" A "+(q.rightLargeArcRadius+ee)+" "+(q.rightLargeArcRadius+ee)+" 0 0 0 "+(q.rightFullExtent+ee-X)+" "+q.verticalRightInnerExtent:re+=" A "+(q.leftLargeArcRadius-ee)+" "+(q.leftLargeArcRadius-ee)+" 0 0 1 "+q.leftInnerExtent+" "+(q.verticalFullExtent-ee)+" L "+(q.rightInnerExtent-X)+" "+(q.verticalFullExtent-ee)+" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightLargeArcRadius-ee)+" 0 0 1 "+(q.rightFullExtent+ee-X)+" "+q.verticalRightInnerExtent,re+=" L "+(q.rightFullExtent+ee-X)+" "+(q.targetY+q.rightSmallArcRadius)+" A "+(q.rightLargeArcRadius-ee)+" "+(q.rightSmallArcRadius-ee)+" 0 0 1 "+(q.rightInnerExtent-X)+" "+(q.targetY+ee)+" L "+(q.targetX-X)+" "+(q.targetY+ee)+(X>0?" L "+q.targetX+" "+q.targetY:"")+"Z"),re}function u(){var $=.5;function X(re){var ee=re.linkArrowLength;if(re.link.circular)return p(re.link,ee);var q=Math.abs((re.link.target.x0-re.link.source.x1)/2);ee>q&&(ee=q);var ae=re.link.source.x1,ie=re.link.target.x0-ee,fe=x(ae,ie),we=fe($),Ae=fe(1-$),Fe=re.link.y0-re.link.width/2,Ce=re.link.y0+re.link.width/2,qe=re.link.y1-re.link.width/2,et=re.link.y1+re.link.width/2,Qe="M"+ae+","+Fe,Ke="C"+we+","+Fe+" "+Ae+","+qe+" "+ie+","+qe,Xe="C"+Ae+","+et+" "+we+","+Ce+" "+ae+","+Ce,Me=ee>0?"L"+(ie+ee)+","+(qe+re.link.width/2):"";return Me+="L"+ie+","+et,Qe+Ke+Me+Xe+"Z"}return X}function g($,X){var re=r(X.color),ee=t.nodePadAcross,q=$.nodePad/2;X.dx=X.x1-X.x0,X.dy=X.y1-X.y0;var ae=X.dx,ie=Math.max(.5,X.dy),fe="node_"+X.pointNumber;return X.group&&(fe=i.randstr()),X.trace=$.trace,X.curveNumber=$.trace.index,{index:X.pointNumber,key:fe,partOfGroup:X.partOfGroup||!1,group:X.group,traceId:$.key,trace:$.trace,node:X,nodePad:$.nodePad,nodeLineColor:$.nodeLineColor,nodeLineWidth:$.nodeLineWidth,textFont:$.textFont,size:$.horizontal?$.height:$.width,visibleWidth:Math.ceil(ae),visibleHeight:ie,zoneX:-ee,zoneY:-q,zoneWidth:ae+2*ee,zoneHeight:ie+2*q,labelY:$.horizontal?X.dy/2+1:X.dx/2+1,left:X.originalLayer===1,sizeAcross:$.width,forceLayouts:$.forceLayouts,horizontal:$.horizontal,darkBackground:re.getBrightness()<=128,tinyColorHue:o.tinyRGB(re),tinyColorAlpha:re.getAlpha(),valueFormat:$.valueFormat,valueSuffix:$.valueSuffix,sankey:$.sankey,graph:$.graph,arrangement:$.arrangement,uniqueNodeLabelPathId:[$.guid,$.key,fe].join("_"),interactionState:$.interactionState,figure:$}}function m($){$.attr("transform",function(X){return n(X.node.x0.toFixed(3),X.node.y0.toFixed(3))})}function R($){$.call(m)}function P($,X){$.call(R),X.attr("d",u())}function z($){$.attr("width",function(X){return X.node.x1-X.node.x0}).attr("height",function(X){return X.visibleHeight})}function F($){return $.link.width>1||$.linkLineWidth>0}function B($){var X=n($.translateX,$.translateY);return X+($.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function O($,X,re){$.on(".basic",null).on("mouseover.basic",function(ee){!ee.interactionState.dragInProgress&&!ee.partOfGroup&&(re.hover(this,ee,X),ee.interactionState.hovered=[this,ee])}).on("mousemove.basic",function(ee){!ee.interactionState.dragInProgress&&!ee.partOfGroup&&(re.follow(this,ee),ee.interactionState.hovered=[this,ee])}).on("mouseout.basic",function(ee){!ee.interactionState.dragInProgress&&!ee.partOfGroup&&(re.unhover(this,ee,X),ee.interactionState.hovered=!1)}).on("click.basic",function(ee){ee.interactionState.hovered&&(re.unhover(this,ee,X),ee.interactionState.hovered=!1),!ee.interactionState.dragInProgress&&!ee.partOfGroup&&re.select(this,ee,X)})}function L($,X,re,ee){var q=A.behavior.drag().origin(function(ae){return{x:ae.node.x0+ae.visibleWidth/2,y:ae.node.y0+ae.visibleHeight/2}}).on("dragstart",function(ae){if(ae.arrangement!=="fixed"&&(i.ensureSingle(ee._fullLayout._infolayer,"g","dragcover",function(fe){ee._fullLayout._dragCover=fe}),i.raiseToTop(this),ae.interactionState.dragInProgress=ae.node,oe(ae.node),ae.interactionState.hovered&&(re.nodeEvents.unhover.apply(0,ae.interactionState.hovered),ae.interactionState.hovered=!1),ae.arrangement==="snap")){var ie=ae.traceId+"|"+ae.key;ae.forceLayouts[ie]?ae.forceLayouts[ie].alpha(1):N($,ie,ae),U($,X,ae,ie,ee)}}).on("drag",function(ae){if(ae.arrangement!=="fixed"){var ie=A.event.x,fe=A.event.y;ae.arrangement==="snap"?(ae.node.x0=ie-ae.visibleWidth/2,ae.node.x1=ie+ae.visibleWidth/2,ae.node.y0=fe-ae.visibleHeight/2,ae.node.y1=fe+ae.visibleHeight/2):(ae.arrangement==="freeform"&&(ae.node.x0=ie-ae.visibleWidth/2,ae.node.x1=ie+ae.visibleWidth/2),fe=Math.max(0,Math.min(ae.size-ae.visibleHeight/2,fe)),ae.node.y0=fe-ae.visibleHeight/2,ae.node.y1=fe+ae.visibleHeight/2),oe(ae.node),ae.arrangement!=="snap"&&(ae.sankey.update(ae.graph),P($.filter(le(ae)),X))}}).on("dragend",function(ae){if(ae.arrangement!=="fixed"){ae.interactionState.dragInProgress=!1;for(var ie=0;ie0)window.requestAnimationFrame(ae);else{var we=re.node.originalX;re.node.x0=we-re.visibleWidth/2,re.node.x1=we+re.visibleWidth/2,Q(re,q)}})}function Z($,X,re,ee){return function(){for(var ae=0,ie=0;ie0&&ee.forceLayouts[X].alpha(0)}}function Q($,X){for(var re=[],ee=[],q=0;q<$.graph.nodes.length;q++){var ae=($.graph.nodes[q].x0+$.graph.nodes[q].x1)/2,ie=($.graph.nodes[q].y0+$.graph.nodes[q].y1)/2;re.push(ae/$.figure.width),ee.push(ie/$.figure.height)}l.call("_guiRestyle",X,{"node.x":[re],"node.y":[ee]},$.trace.index).then(function(){X._fullLayout._dragCover&&X._fullLayout._dragCover.remove()})}function ue($){var X=[],re;for(re=0;re<$.length;re++)$[re].originalX=($[re].x0+$[re].x1)/2,$[re].originalY=($[re].y0+$[re].y1)/2,X.indexOf($[re].originalX)===-1&&X.push($[re].originalX);for(X.sort(function(ee,q){return ee-q}),re=0;re<$.length;re++)$[re].originalLayerIndex=X.indexOf($[re].originalX),$[re].originalLayer=$[re].originalLayerIndex/(X.length-1)}function oe($){$.lastDraggedX=$.x0+$.dx/2,$.lastDraggedY=$.y0+$.dy/2}function le($){return function(X){return X.node.originalX===$.node.originalX}}function j($){for(var X=0;X<$.length;X++)$[X].y=($[X].y0+$[X].y1)/2,$[X].x=($[X].x0+$[X].x1)/2}function J($){for(var X=0;X<$.length;X++)$[X].y0=$[X].y-$[X].dy/2,$[X].y1=$[X].y0+$[X].dy,$[X].x0=$[X].x-$[X].dx/2,$[X].x1=$[X].x0+$[X].dx}G.exports=function($,X,re,ee,q){var ae=$._context.staticPlot,ie=!1;i.ensureSingle($._fullLayout._infolayer,"g","first-render",function(){ie=!0});var fe=$._fullLayout._dragCover,we=re.filter(function(Xe){return h(Xe).trace.visible}).map(_.bind(null,ee)),Ae=X.selectAll("."+t.cn.sankey).data(we,f);Ae.exit().remove(),Ae.enter().append("g").classed(t.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events",ae?"none":"auto").attr("transform",B),Ae.each(function(Xe,Me){$._fullData[Me]._sankey=Xe;var xe="bgsankey-"+Xe.trace.uid+"-"+Me;i.ensureSingle($._fullLayout._draggers,"rect",xe),$._fullData[Me]._bgRect=A.select("."+xe),$._fullData[Me]._bgRect.style("pointer-events",ae?"none":"all").attr("width",Xe.width).attr("height",Xe.height).attr("x",Xe.translateX).attr("y",Xe.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})}),Ae.transition().ease(t.ease).duration(t.duration).attr("transform",B);var Fe=Ae.selectAll("."+t.cn.sankeyLinks).data(v,f);Fe.enter().append("g").classed(t.cn.sankeyLinks,!0).style("fill","none");var Ce=Fe.selectAll("."+t.cn.sankeyLink).data(function(Xe){var Me=Xe.graph.links;return Me.filter(function(xe){return xe.value}).map(w.bind(null,Xe))},f);Ce.enter().append("path").classed(t.cn.sankeyLink,!0).call(O,Ae,q.linkEvents),Ce.style("stroke",function(Xe){return F(Xe)?o.tinyRGB(r(Xe.linkLineColor)):Xe.tinyColorHue}).style("stroke-opacity",function(Xe){return F(Xe)?o.opacity(Xe.linkLineColor):Xe.tinyColorAlpha}).style("fill",function(Xe){return Xe.tinyColorHue}).style("fill-opacity",function(Xe){return Xe.tinyColorAlpha}).style("stroke-width",function(Xe){return F(Xe)?Xe.linkLineWidth:1}).attr("d",u()),Ce.style("opacity",function(){return $._context.staticPlot||ie||fe?1:0}).transition().ease(t.ease).duration(t.duration).style("opacity",1),Ce.exit().transition().ease(t.ease).duration(t.duration).style("opacity",0).remove();var qe=Ae.selectAll("."+t.cn.sankeyNodeSet).data(v,f);qe.enter().append("g").classed(t.cn.sankeyNodeSet,!0),qe.style("cursor",function(Xe){switch(Xe.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var et=qe.selectAll("."+t.cn.sankeyNode).data(function(Xe){var Me=Xe.graph.nodes;return ue(Me),Me.map(g.bind(null,Xe))},f);et.enter().append("g").classed(t.cn.sankeyNode,!0).call(m).style("opacity",function(Xe){return($._context.staticPlot||ie)&&!Xe.partOfGroup?1:0}),et.call(O,Ae,q.nodeEvents).call(L,Ce,q,$),et.transition().ease(t.ease).duration(t.duration).call(m).style("opacity",function(Xe){return Xe.partOfGroup?0:1}),et.exit().transition().ease(t.ease).duration(t.duration).style("opacity",0).remove();var Qe=et.selectAll("."+t.cn.nodeRect).data(v);Qe.enter().append("rect").classed(t.cn.nodeRect,!0).call(z),Qe.style("stroke-width",function(Xe){return Xe.nodeLineWidth}).style("stroke",function(Xe){return o.tinyRGB(r(Xe.nodeLineColor))}).style("stroke-opacity",function(Xe){return o.opacity(Xe.nodeLineColor)}).style("fill",function(Xe){return Xe.tinyColorHue}).style("fill-opacity",function(Xe){return Xe.tinyColorAlpha}),Qe.transition().ease(t.ease).duration(t.duration).call(z);var Ke=et.selectAll("."+t.cn.nodeLabel).data(v);Ke.enter().append("text").classed(t.cn.nodeLabel,!0).style("cursor","default"),Ke.attr("data-notex",1).text(function(Xe){return Xe.node.label}).each(function(Xe){var Me=A.select(this);a.font(Me,Xe.textFont),T.convertToTspans(Me,$)}).attr("text-anchor",function(Xe){return Xe.horizontal&&Xe.left?"end":"start"}).attr("transform",function(Xe){var Me=A.select(this),xe=T.lineCount(Me),ce=Xe.textFont.size*((xe-1)*S-b),Re=Xe.nodeLineWidth/2+M,$e=((Xe.horizontal?Xe.visibleHeight:Xe.visibleWidth)-ce)/2;Xe.horizontal&&(Xe.left?Re=-Re:Re+=Xe.visibleWidth);var rt=Xe.horizontal?"":"scale(-1,1)"+s(90);return n(Xe.horizontal?Re:$e,Xe.horizontal?$e:Re)+rt}),Ke.transition().ease(t.ease).duration(t.duration)}}}),$T=He({"src/traces/sankey/plot.js"(Y,G){var d=Qn(),x=Gr(),A=x.numberFormat,E=WR(),e=Wu(),t=Ai(),r=JT().cn,o=x._;function a(b){return b!==""}function i(b,S){return b.filter(function(M){return M.key===S.traceId})}function n(b,S){d.select(b).select("path").style("fill-opacity",S),d.select(b).select("rect").style("fill-opacity",S)}function s(b){d.select(b).select("text.name").style("fill","black")}function c(b){return function(S){return b.node.sourceLinks.indexOf(S.link)!==-1||b.node.targetLinks.indexOf(S.link)!==-1}}function f(b){return function(S){return S.node.sourceLinks.indexOf(b.link)!==-1||S.node.targetLinks.indexOf(b.link)!==-1}}function v(b,S,M){S&&M&&i(M,S).selectAll("."+r.sankeyLink).filter(c(S)).call(T.bind(0,S,M,!1))}function h(b,S,M){S&&M&&i(M,S).selectAll("."+r.sankeyLink).filter(c(S)).call(l.bind(0,S,M,!1))}function T(b,S,M,_){_.style("fill",function(w){if(!w.link.concentrationscale)return w.tinyColorHoverHue}).style("fill-opacity",function(w){if(!w.link.concentrationscale)return w.tinyColorHoverAlpha}),_.each(function(w){var p=w.link.label;p!==""&&i(S,b).selectAll("."+r.sankeyLink).filter(function(u){return u.link.label===p}).style("fill",function(u){if(!u.link.concentrationscale)return u.tinyColorHoverHue}).style("fill-opacity",function(u){if(!u.link.concentrationscale)return u.tinyColorHoverAlpha})}),M&&i(S,b).selectAll("."+r.sankeyNode).filter(f(b)).call(v)}function l(b,S,M,_){_.style("fill",function(w){return w.tinyColorHue}).style("fill-opacity",function(w){return w.tinyColorAlpha}),_.each(function(w){var p=w.link.label;p!==""&&i(S,b).selectAll("."+r.sankeyLink).filter(function(u){return u.link.label===p}).style("fill",function(u){return u.tinyColorHue}).style("fill-opacity",function(u){return u.tinyColorAlpha})}),M&&i(S,b).selectAll(r.sankeyNode).filter(f(b)).call(h)}function y(b,S){var M=b.hoverlabel||{},_=x.nestedProperty(M,S).get();return Array.isArray(_)?!1:_}G.exports=function(S,M){for(var _=S._fullLayout,w=_._paper,p=_._size,u=0;u"),color:y(j,"bgcolor")||t.addOpacity(ee.color,1),borderColor:y(j,"bordercolor"),fontFamily:y(j,"font.family"),fontSize:y(j,"font.size"),fontColor:y(j,"font.color"),fontWeight:y(j,"font.weight"),fontStyle:y(j,"font.style"),fontVariant:y(j,"font.variant"),fontTextcase:y(j,"font.textcase"),fontLineposition:y(j,"font.lineposition"),fontShadow:y(j,"font.shadow"),nameLength:y(j,"namelength"),textAlign:y(j,"align"),idealAlign:d.event.x"),color:y(j,"bgcolor")||le.tinyColorHue,borderColor:y(j,"bordercolor"),fontFamily:y(j,"font.family"),fontSize:y(j,"font.size"),fontColor:y(j,"font.color"),fontWeight:y(j,"font.weight"),fontStyle:y(j,"font.style"),fontVariant:y(j,"font.variant"),fontTextcase:y(j,"font.textcase"),fontLineposition:y(j,"font.lineposition"),fontShadow:y(j,"font.shadow"),nameLength:y(j,"namelength"),textAlign:y(j,"align"),idealAlign:"left",hovertemplate:j.hovertemplate,hovertemplateLabels:ae,eventData:[le.node]},{container:_._hoverlayer.node(),outerContainer:_._paper.node(),gd:S});n(we,.85),s(we)}}},ue=function(oe,le,j){S._fullLayout.hovermode!==!1&&(d.select(oe).call(h,le,j),le.node.trace.node.hoverinfo!=="skip"&&(le.node.fullData=le.node.trace,S.emit("plotly_unhover",{event:d.event,points:[le.node]})),e.loneUnhover(_._hoverlayer.node()))};E(S,w,M,{width:p.w,height:p.h,margin:{t:p.t,r:p.r,b:p.b,l:p.l}},{linkEvents:{hover:R,follow:L,unhover:N,select:m},nodeEvents:{hover:Z,follow:Q,unhover:ue,select:U}})}}}),ZR=He({"src/traces/sankey/base_plot.js"(Y){var G=hu().overrideAll,d=Uf().getModuleCalcData,x=$T(),A=Od(),E=xv(),e=fh(),t=dc().prepSelect,r=Gr(),o=Ei(),a="sankey";Y.name=a,Y.baseLayoutAttrOverrides=G({hoverlabel:A.hoverlabel},"plot","nested"),Y.plot=function(n){var s=d(n.calcdata,a)[0];x(n,s),Y.updateFx(n)},Y.clean=function(n,s,c,f){var v=f._has&&f._has(a),h=s._has&&s._has(a);v&&!h&&(f._paperdiv.selectAll(".sankey").remove(),f._paperdiv.selectAll(".bgsankey").remove())},Y.updateFx=function(n){for(var s=0;s0}G.exports=function(F,B,O,L){var N=F._fullLayout,U;b(O)&&L&&(U=L()),E.makeTraceGroups(N._indicatorlayer,B,"trace").each(function(Z){var Q=Z[0],ue=Q.trace,oe=d.select(this),le=ue._hasGauge,j=ue._isAngular,J=ue._isBullet,$=ue.domain,X={w:N._size.w*($.x[1]-$.x[0]),h:N._size.h*($.y[1]-$.y[0]),l:N._size.l+N._size.w*$.x[0],r:N._size.r+N._size.w*(1-$.x[1]),t:N._size.t+N._size.h*(1-$.y[1]),b:N._size.b+N._size.h*$.y[0]},re=X.l+X.w/2,ee=X.t+X.h/2,q=Math.min(X.w/2,X.h),ae=i.innerRadius*q,ie,fe,we,Ae=ue.align||"center";if(fe=ee,!le)ie=X.l+l[Ae]*X.w,we=function(ce){return g(ce,X.w,X.h)};else if(j&&(ie=re,fe=ee+q/2,we=function(ce){return m(ce,.9*ae)}),J){var Fe=i.bulletPadding,Ce=1-i.bulletNumberDomainSize+Fe;ie=X.l+(Ce+(1-Ce)*l[Ae])*X.w,we=function(ce){return g(ce,(i.bulletNumberDomainSize-Fe)*X.w,X.h)}}_(F,oe,Z,{numbersX:ie,numbersY:fe,numbersScaler:we,transitionOpts:O,onComplete:U});var qe,et;le&&(qe={range:ue.gauge.axis.range,color:ue.gauge.bgcolor,line:{color:ue.gauge.bordercolor,width:0},thickness:1},et={range:ue.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:ue.gauge.bordercolor,width:ue.gauge.borderwidth},thickness:1});var Qe=oe.selectAll("g.angular").data(j?Z:[]);Qe.exit().remove();var Ke=oe.selectAll("g.angularaxis").data(j?Z:[]);Ke.exit().remove(),j&&M(F,oe,Z,{radius:q,innerRadius:ae,gauge:Qe,layer:Ke,size:X,gaugeBg:qe,gaugeOutline:et,transitionOpts:O,onComplete:U});var Xe=oe.selectAll("g.bullet").data(J?Z:[]);Xe.exit().remove();var Me=oe.selectAll("g.bulletaxis").data(J?Z:[]);Me.exit().remove(),J&&S(F,oe,Z,{gauge:Xe,layer:Me,size:X,gaugeBg:qe,gaugeOutline:et,transitionOpts:O,onComplete:U});var xe=oe.selectAll("text.title").data(Z);xe.exit().remove(),xe.enter().append("text").classed("title",!0),xe.attr("text-anchor",function(){return J?T.right:T[ue.title.align]}).text(ue.title.text).call(a.font,ue.title.font).call(n.convertToTspans,F),xe.attr("transform",function(){var ce=X.l+X.w*l[ue.title.align],Re,$e=i.titlePadding,rt=a.bBox(xe.node());if(le){if(j)if(ue.gauge.axis.visible){var Je=a.bBox(Ke.node());Re=Je.top-$e-rt.bottom}else Re=X.t+X.h/2-q/2-rt.bottom-$e;J&&(Re=fe-(rt.top+rt.bottom)/2,ce=X.l-i.bulletPadding*X.w)}else Re=ue._numbersTop-$e-rt.bottom;return t(ce,Re)})})};function S(z,F,B,O){var L=B[0].trace,N=O.gauge,U=O.layer,Z=O.gaugeBg,Q=O.gaugeOutline,ue=O.size,oe=L.domain,le=O.transitionOpts,j=O.onComplete,J,$,X,re,ee;N.enter().append("g").classed("bullet",!0),N.attr("transform",t(ue.l,ue.t)),U.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),U.selectAll("g.xbulletaxistick,path,text").remove();var q=ue.h,ae=L.gauge.bar.thickness*q,ie=oe.x[0],fe=oe.x[0]+(oe.x[1]-oe.x[0])*(L._hasNumber||L._hasDelta?1-i.bulletNumberDomainSize:1);J=u(z,L.gauge.axis),J._id="xbulletaxis",J.domain=[ie,fe],J.setScale(),$=s.calcTicks(J),X=s.makeTransTickFn(J),re=s.getTickSigns(J)[2],ee=ue.t+ue.h,J.visible&&(s.drawTicks(z,J,{vals:J.ticks==="inside"?s.clipEnds(J,$):$,layer:U,path:s.makeTickPath(J,ee,re),transFn:X}),s.drawLabels(z,J,{vals:$,layer:U,transFn:X,labelFns:s.makeLabelFns(J,ee)}));function we(Ke){Ke.attr("width",function(Xe){return Math.max(0,J.c2p(Xe.range[1])-J.c2p(Xe.range[0]))}).attr("x",function(Xe){return J.c2p(Xe.range[0])}).attr("y",function(Xe){return .5*(1-Xe.thickness)*q}).attr("height",function(Xe){return Xe.thickness*q})}var Ae=[Z].concat(L.gauge.steps),Fe=N.selectAll("g.bg-bullet").data(Ae);Fe.enter().append("g").classed("bg-bullet",!0).append("rect"),Fe.select("rect").call(we).call(w),Fe.exit().remove();var Ce=N.selectAll("g.value-bullet").data([L.gauge.bar]);Ce.enter().append("g").classed("value-bullet",!0).append("rect"),Ce.select("rect").attr("height",ae).attr("y",(q-ae)/2).call(w),b(le)?Ce.select("rect").transition().duration(le.duration).ease(le.easing).each("end",function(){j&&j()}).each("interrupt",function(){j&&j()}).attr("width",Math.max(0,J.c2p(Math.min(L.gauge.axis.range[1],B[0].y)))):Ce.select("rect").attr("width",typeof B[0].y=="number"?Math.max(0,J.c2p(Math.min(L.gauge.axis.range[1],B[0].y))):0),Ce.exit().remove();var qe=B.filter(function(){return L.gauge.threshold.value||L.gauge.threshold.value===0}),et=N.selectAll("g.threshold-bullet").data(qe);et.enter().append("g").classed("threshold-bullet",!0).append("line"),et.select("line").attr("x1",J.c2p(L.gauge.threshold.value)).attr("x2",J.c2p(L.gauge.threshold.value)).attr("y1",(1-L.gauge.threshold.thickness)/2*q).attr("y2",(1-(1-L.gauge.threshold.thickness)/2)*q).call(h.stroke,L.gauge.threshold.line.color).style("stroke-width",L.gauge.threshold.line.width),et.exit().remove();var Qe=N.selectAll("g.gauge-outline").data([Q]);Qe.enter().append("g").classed("gauge-outline",!0).append("rect"),Qe.select("rect").call(we).call(w),Qe.exit().remove()}function M(z,F,B,O){var L=B[0].trace,N=O.size,U=O.radius,Z=O.innerRadius,Q=O.gaugeBg,ue=O.gaugeOutline,oe=[N.l+N.w/2,N.t+N.h/2+U/2],le=O.gauge,j=O.layer,J=O.transitionOpts,$=O.onComplete,X=Math.PI/2;function re(At){var St=L.gauge.axis.range[0],Rt=L.gauge.axis.range[1],Ut=(At-St)/(Rt-St)*Math.PI-X;return Ut<-X?-X:Ut>X?X:Ut}function ee(At){return d.svg.arc().innerRadius((Z+U)/2-At/2*(U-Z)).outerRadius((Z+U)/2+At/2*(U-Z)).startAngle(-X)}function q(At){At.attr("d",function(St){return ee(St.thickness).startAngle(re(St.range[0])).endAngle(re(St.range[1]))()})}var ae,ie,fe,we;le.enter().append("g").classed("angular",!0),le.attr("transform",t(oe[0],oe[1])),j.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),j.selectAll("g.xangularaxistick,path,text").remove(),ae=u(z,L.gauge.axis),ae.type="linear",ae.range=L.gauge.axis.range,ae._id="xangularaxis",ae.ticklabeloverflow="allow",ae.setScale();var Ae=function(At){return(ae.range[0]-At.x)/(ae.range[1]-ae.range[0])*Math.PI+Math.PI},Fe={},Ce=s.makeLabelFns(ae,0),qe=Ce.labelStandoff;Fe.xFn=function(At){var St=Ae(At);return Math.cos(St)*qe},Fe.yFn=function(At){var St=Ae(At),Rt=Math.sin(St)>0?.2:1;return-Math.sin(St)*(qe+At.fontSize*Rt)+Math.abs(Math.cos(St))*(At.fontSize*o)},Fe.anchorFn=function(At){var St=Ae(At),Rt=Math.cos(St);return Math.abs(Rt)<.1?"middle":Rt>0?"start":"end"},Fe.heightFn=function(At,St,Rt){var Ut=Ae(At);return-.5*(1+Math.sin(Ut))*Rt};var et=function(At){return t(oe[0]+U*Math.cos(At),oe[1]-U*Math.sin(At))};fe=function(At){return et(Ae(At))};var Qe=function(At){var St=Ae(At);return et(St)+"rotate("+-r(St)+")"};if(ie=s.calcTicks(ae),we=s.getTickSigns(ae)[2],ae.visible){we=ae.ticks==="inside"?-1:1;var Ke=(ae.linewidth||1)/2;s.drawTicks(z,ae,{vals:ie,layer:j,path:"M"+we*Ke+",0h"+we*ae.ticklen,transFn:Qe}),s.drawLabels(z,ae,{vals:ie,layer:j,transFn:fe,labelFns:Fe})}var Xe=[Q].concat(L.gauge.steps),Me=le.selectAll("g.bg-arc").data(Xe);Me.enter().append("g").classed("bg-arc",!0).append("path"),Me.select("path").call(q).call(w),Me.exit().remove();var xe=ee(L.gauge.bar.thickness),ce=le.selectAll("g.value-arc").data([L.gauge.bar]);ce.enter().append("g").classed("value-arc",!0).append("path");var Re=ce.select("path");b(J)?(Re.transition().duration(J.duration).ease(J.easing).each("end",function(){$&&$()}).each("interrupt",function(){$&&$()}).attrTween("d",p(xe,re(B[0].lastY),re(B[0].y))),L._lastValue=B[0].y):Re.attr("d",typeof B[0].y=="number"?xe.endAngle(re(B[0].y)):"M0,0Z"),Re.call(w),ce.exit().remove(),Xe=[];var $e=L.gauge.threshold.value;($e||$e===0)&&Xe.push({range:[$e,$e],color:L.gauge.threshold.color,line:{color:L.gauge.threshold.line.color,width:L.gauge.threshold.line.width},thickness:L.gauge.threshold.thickness});var rt=le.selectAll("g.threshold-arc").data(Xe);rt.enter().append("g").classed("threshold-arc",!0).append("path"),rt.select("path").call(q).call(w),rt.exit().remove();var Je=le.selectAll("g.gauge-outline").data([ue]);Je.enter().append("g").classed("gauge-outline",!0).append("path"),Je.select("path").call(q).call(w),Je.exit().remove()}function _(z,F,B,O){var L=B[0].trace,N=O.numbersX,U=O.numbersY,Z=L.align||"center",Q=T[Z],ue=O.transitionOpts,oe=O.onComplete,le=E.ensureSingle(F,"g","numbers"),j,J,$,X=[];L._hasNumber&&X.push("number"),L._hasDelta&&(X.push("delta"),L.delta.position==="left"&&X.reverse());var re=le.selectAll("text").data(X);re.enter().append("text"),re.attr("text-anchor",function(){return Q}).attr("class",function(et){return et}).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),re.exit().remove();function ee(et,Qe,Ke,Xe){if(et.match("s")&&Ke>=0!=Xe>=0&&!Qe(Ke).slice(-1).match(y)&&!Qe(Xe).slice(-1).match(y)){var Me=et.slice().replace("s","f").replace(/\d+/,function(ce){return parseInt(ce)-1}),xe=u(z,{tickformat:Me});return function(ce){return Math.abs(ce)<1?s.tickText(xe,ce).text:Qe(ce)}}else return Qe}function q(){var et=u(z,{tickformat:L.number.valueformat},L._range);et.setScale(),s.prepTicks(et);var Qe=function(ce){return s.tickText(et,ce).text},Ke=L.number.suffix,Xe=L.number.prefix,Me=le.select("text.number");function xe(){var ce=typeof B[0].y=="number"?Xe+Qe(B[0].y)+Ke:"-";Me.text(ce).call(a.font,L.number.font).call(n.convertToTspans,z)}return b(ue)?Me.transition().duration(ue.duration).ease(ue.easing).each("end",function(){xe(),oe&&oe()}).each("interrupt",function(){xe(),oe&&oe()}).attrTween("text",function(){var ce=d.select(this),Re=A(B[0].lastY,B[0].y);L._lastValue=B[0].y;var $e=ee(L.number.valueformat,Qe,B[0].lastY,B[0].y);return function(rt){ce.text(Xe+$e(Re(rt))+Ke)}}):xe(),j=R(Xe+Qe(B[0].y)+Ke,L.number.font,Q,z),Me}function ae(){var et=u(z,{tickformat:L.delta.valueformat},L._range);et.setScale(),s.prepTicks(et);var Qe=function(rt){return s.tickText(et,rt).text},Ke=L.delta.suffix,Xe=L.delta.prefix,Me=function(rt){var Je=L.delta.relative?rt.relativeDelta:rt.delta;return Je},xe=function(rt,Je){return rt===0||typeof rt!="number"||isNaN(rt)?"-":(rt>0?L.delta.increasing.symbol:L.delta.decreasing.symbol)+Xe+Je(rt)+Ke},ce=function(rt){return rt.delta>=0?L.delta.increasing.color:L.delta.decreasing.color};L._deltaLastValue===void 0&&(L._deltaLastValue=Me(B[0]));var Re=le.select("text.delta");Re.call(a.font,L.delta.font).call(h.fill,ce({delta:L._deltaLastValue}));function $e(){Re.text(xe(Me(B[0]),Qe)).call(h.fill,ce(B[0])).call(n.convertToTspans,z)}return b(ue)?Re.transition().duration(ue.duration).ease(ue.easing).tween("text",function(){var rt=d.select(this),Je=Me(B[0]),At=L._deltaLastValue,St=ee(L.delta.valueformat,Qe,At,Je),Rt=A(At,Je);return L._deltaLastValue=Je,function(Ut){rt.text(xe(Rt(Ut),St)),rt.call(h.fill,ce({delta:Rt(Ut)}))}}).each("end",function(){$e(),oe&&oe()}).each("interrupt",function(){$e(),oe&&oe()}):$e(),J=R(xe(Me(B[0]),Qe),L.delta.font,Q,z),Re}var ie=L.mode+L.align,fe;if(L._hasDelta&&(fe=ae(),ie+=L.delta.position+L.delta.font.size+L.delta.font.family+L.delta.valueformat,ie+=L.delta.increasing.symbol+L.delta.decreasing.symbol,$=J),L._hasNumber&&(q(),ie+=L.number.font.size+L.number.font.family+L.number.valueformat+L.number.suffix+L.number.prefix,$=j),L._hasDelta&&L._hasNumber){var we=[(j.left+j.right)/2,(j.top+j.bottom)/2],Ae=[(J.left+J.right)/2,(J.top+J.bottom)/2],Fe,Ce,qe=.75*L.delta.font.size;L.delta.position==="left"&&(Fe=P(L,"deltaPos",0,-1*(j.width*l[L.align]+J.width*(1-l[L.align])+qe),ie,Math.min),Ce=we[1]-Ae[1],$={width:j.width+J.width+qe,height:Math.max(j.height,J.height),left:J.left+Fe,right:j.right,top:Math.min(j.top,J.top+Ce),bottom:Math.max(j.bottom,J.bottom+Ce)}),L.delta.position==="right"&&(Fe=P(L,"deltaPos",0,j.width*(1-l[L.align])+J.width*l[L.align]+qe,ie,Math.max),Ce=we[1]-Ae[1],$={width:j.width+J.width+qe,height:Math.max(j.height,J.height),left:j.left,right:J.right+Fe,top:Math.min(j.top,J.top+Ce),bottom:Math.max(j.bottom,J.bottom+Ce)}),L.delta.position==="bottom"&&(Fe=null,Ce=J.height,$={width:Math.max(j.width,J.width),height:j.height+J.height,left:Math.min(j.left,J.left),right:Math.max(j.right,J.right),top:j.bottom-j.height,bottom:j.bottom+J.height}),L.delta.position==="top"&&(Fe=null,Ce=j.top,$={width:Math.max(j.width,J.width),height:j.height+J.height,left:Math.min(j.left,J.left),right:Math.max(j.right,J.right),top:j.bottom-j.height-J.height,bottom:j.bottom}),fe.attr({dx:Fe,dy:Ce})}(L._hasNumber||L._hasDelta)&&le.attr("transform",function(){var et=O.numbersScaler($);ie+=et[2];var Qe=P(L,"numbersScale",1,et[0],ie,Math.min),Ke;L._scaleNumbers||(Qe=1),L._isAngular?Ke=U-Qe*$.bottom:Ke=U-Qe*($.top+$.bottom)/2,L._numbersTop=Qe*$.top+Ke;var Xe=$[Z];Z==="center"&&(Xe=($.left+$.right)/2);var Me=N-Qe*Xe;return Me=P(L,"numbersTranslate",0,Me,ie,Math.max),t(Me,Ke)+e(Qe)})}function w(z){z.each(function(F){h.stroke(d.select(this),F.line.color)}).each(function(F){h.fill(d.select(this),F.color)}).style("stroke-width",function(F){return F.line.width})}function p(z,F,B){return function(){var O=x(F,B);return function(L){return z.endAngle(O(L))()}}}function u(z,F,B){var O=z._fullLayout,L=E.extendFlat({type:"linear",ticks:"outside",range:B,showline:!0},F),N={type:"linear",_id:"x"+F._id},U={letter:"x",font:O.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function Z(Q,ue){return E.coerce(L,N,v,Q,ue)}return c(L,N,Z,U,O),f(L,N,Z,U),N}function g(z,F,B){var O=Math.min(F/z.width,B/z.height);return[O,z,F+"x"+B]}function m(z,F){var B=Math.sqrt(z.width/2*(z.width/2)+z.height*z.height),O=F/B;return[O,z,F]}function R(z,F,B,O){var L=document.createElementNS("http://www.w3.org/2000/svg","text"),N=d.select(L);return N.text(z).attr("x",0).attr("y",0).attr("text-anchor",B).attr("data-unformatted",z).call(n.convertToTspans,O).call(a.font,F),a.bBox(N.node())}function P(z,F,B,O,L,N){var U="_cache"+F;z[U]&&z[U].key===L||(z[U]={key:L,value:B});var Z=E.aggNums(N,null,[z[U].value,O],2);return z[U].value=Z,Z}}}),tD=He({"src/traces/indicator/index.js"(Y,G){G.exports={moduleType:"trace",name:"indicator",basePlotModule:JR(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:QT(),supplyDefaults:$R().supplyDefaults,calc:QR().calc,plot:eD(),meta:{}}}}),rD=He({"lib/indicator.js"(Y,G){G.exports=tD()}}),tA=He({"src/traces/table/attributes.js"(Y,G){var d=Lp(),x=ho().extendFlat,A=hu().overrideAll,E=Yl(),e=mu().attributes,t=Gu().descriptionOnlyNumbers;G.exports=A({domain:e({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:x({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:x({},E({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:t("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:x({},d.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:x({},E({arrayOk:!0}))}},"calc","from-root")}}),aD=He({"src/traces/table/defaults.js"(Y,G){var d=Gr(),x=tA(),A=mu().defaults;function E(e,t){for(var r=e.columnorder||[],o=e.header.values.length,a=r.slice(0,o),i=a.slice().sort(function(c,f){return c-f}),n=a.map(function(c){return i.indexOf(c)}),s=n.length;s",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"}}}}),iD=He({"src/traces/table/data_preparation_helper.js"(Y,G){var d=rA(),x=ho().extendFlat,A=Hi(),E=ch().isTypedArray,e=ch().isArrayOrTypedArray;G.exports=function(v,h){var T=o(h.cells.values),l=function(Q){return Q.slice(h.header.values.length,Q.length)},y=o(h.header.values);y.length&&!y[0].length&&(y[0]=[""],y=o(y));var b=y.concat(l(T).map(function(){return a((y[0]||[""]).length)})),S=h.domain,M=Math.floor(v._fullLayout._size.w*(S.x[1]-S.x[0])),_=Math.floor(v._fullLayout._size.h*(S.y[1]-S.y[0])),w=h.header.values.length?b[0].map(function(){return h.header.height}):[d.emptyHeaderHeight],p=T.length?T[0].map(function(){return h.cells.height}):[],u=w.reduce(r,0),g=_-u,m=g+d.uplift,R=s(p,m),P=s(w,u),z=n(P,[]),F=n(R,z),B={},O=h._fullInput.columnorder;e(O)&&(O=Array.from(O)),O=O.concat(l(T.map(function(Q,ue){return ue})));var L=b.map(function(Q,ue){var oe=e(h.columnwidth)?h.columnwidth[Math.min(ue,h.columnwidth.length-1)]:h.columnwidth;return A(oe)?Number(oe):1}),N=L.reduce(r,0);L=L.map(function(Q){return Q/N*M});var U=Math.max(t(h.header.line.width),t(h.cells.line.width)),Z={key:h.uid+v._context.staticPlot,translateX:S.x[0]*v._fullLayout._size.w,translateY:v._fullLayout._size.h*(1-S.y[1]),size:v._fullLayout._size,width:M,maxLineWidth:U,height:_,columnOrder:O,groupHeight:_,rowBlocks:F,headerRowBlocks:z,scrollY:0,cells:x({},h.cells,{values:T}),headerCells:x({},h.header,{values:b}),gdColumns:b.map(function(Q){return Q[0]}),gdColumnsOriginalOrder:b.map(function(Q){return Q[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:b.map(function(Q,ue){var oe=B[Q];B[Q]=(oe||0)+1;var le=Q+"__"+B[Q];return{key:le,label:Q,specIndex:ue,xIndex:O[ue],xScale:i,x:void 0,calcdata:void 0,columnWidth:L[ue]}})};return Z.columns.forEach(function(Q){Q.calcdata=Z,Q.x=i(Q)}),Z};function t(f){if(e(f)){for(var v=0,h=0;h=v||_===f.length-1)&&(h[l]=b,b.key=M++,b.firstRowIndex=S,b.lastRowIndex=_,b=c(),l+=y,S=_+1,y=0);return h}function c(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}}}),oD=He({"src/traces/table/data_split_helpers.js"(Y){var G=ho().extendFlat;Y.splitToPanels=function(x){var A=[0,0],E=G({},x,{key:"header",type:"header",page:0,prevPages:A,currentRepaint:[null,null],dragHandle:!0,values:x.calcdata.headerCells.values[x.specIndex],rowBlocks:x.calcdata.headerRowBlocks,calcdata:G({},x.calcdata,{cells:x.calcdata.headerCells})}),e=G({},x,{key:"cells1",type:"cells",page:0,prevPages:A,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks}),t=G({},x,{key:"cells2",type:"cells",page:1,prevPages:A,currentRepaint:[null,null],dragHandle:!1,values:x.calcdata.cells.values[x.specIndex],rowBlocks:x.calcdata.rowBlocks});return[e,t,E]},Y.splitToCells=function(x){var A=d(x);return(x.values||[]).slice(A[0],A[1]).map(function(E,e){var t=typeof E=="string"&&E.match(/[<$&> ]/)?"_keybuster_"+Math.random():"";return{keyWithinBlock:e+t,key:A[0]+e,column:x,calcdata:x.calcdata,page:x.page,rowBlocks:x.rowBlocks,value:E}})};function d(x){var A=x.rowBlocks[x.page],E=A?A.rows[0].rowIndex:0,e=A?E+A.rows.length:0;return[E,e]}}}),aA=He({"src/traces/table/plot.js"(Y,G){var d=rA(),x=Qn(),A=Gr(),E=A.numberFormat,e=Wv(),t=vo(),r=yl(),o=Gr().raiseToTop,a=Gr().strTranslate,i=Gr().cancelTransition,n=iD(),s=oD(),c=Ai();G.exports=function(ie,fe){var we=!ie._context.staticPlot,Ae=ie._fullLayout._paper.selectAll("."+d.cn.table).data(fe.map(function(Je){var At=e.unwrap(Je),St=At.trace;return n(ie,St)}),e.keyFun);Ae.exit().remove(),Ae.enter().append("g").classed(d.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),Ae.attr("width",function(Je){return Je.width+Je.size.l+Je.size.r}).attr("height",function(Je){return Je.height+Je.size.t+Je.size.b}).attr("transform",function(Je){return a(Je.translateX,Je.translateY)});var Fe=Ae.selectAll("."+d.cn.tableControlView).data(e.repeat,e.keyFun),Ce=Fe.enter().append("g").classed(d.cn.tableControlView,!0).style("box-sizing","content-box");if(we){var qe="onwheel"in document?"wheel":"mousewheel";Ce.on("mousemove",function(Je){Fe.filter(function(At){return Je===At}).call(l,ie)}).on(qe,function(Je){if(!Je.scrollbarState.wheeling){Je.scrollbarState.wheeling=!0;var At=Je.scrollY+x.event.deltaY,St=Q(ie,Fe,null,At)(Je);St||(x.event.stopPropagation(),x.event.preventDefault()),Je.scrollbarState.wheeling=!1}}).call(l,ie,!0)}Fe.attr("transform",function(Je){return a(Je.size.l,Je.size.t)});var et=Fe.selectAll("."+d.cn.scrollBackground).data(e.repeat,e.keyFun);et.enter().append("rect").classed(d.cn.scrollBackground,!0).attr("fill","none"),et.attr("width",function(Je){return Je.width}).attr("height",function(Je){return Je.height}),Fe.each(function(Je){t.setClipUrl(x.select(this),v(ie,Je),ie)});var Qe=Fe.selectAll("."+d.cn.yColumn).data(function(Je){return Je.columns},e.keyFun);Qe.enter().append("g").classed(d.cn.yColumn,!0),Qe.exit().remove(),Qe.attr("transform",function(Je){return a(Je.x,0)}),we&&Qe.call(x.behavior.drag().origin(function(Je){var At=x.select(this);return B(At,Je,-d.uplift),o(this),Je.calcdata.columnDragInProgress=!0,l(Fe.filter(function(St){return Je.calcdata.key===St.key}),ie),Je}).on("drag",function(Je){var At=x.select(this),St=function(ir){return(Je===ir?x.event.x:ir.x)+ir.columnWidth/2};Je.x=Math.max(-d.overdrag,Math.min(Je.calcdata.width+d.overdrag-Je.columnWidth,x.event.x));var Rt=T(Qe).filter(function(ir){return ir.calcdata.key===Je.calcdata.key}),Ut=Rt.sort(function(ir,ar){return St(ir)-St(ar)});Ut.forEach(function(ir,ar){ir.xIndex=ar,ir.x=Je===ir?ir.x:ir.xScale(ir)}),Qe.filter(function(ir){return Je!==ir}).transition().ease(d.transitionEase).duration(d.transitionDuration).attr("transform",function(ir){return a(ir.x,0)}),At.call(i).attr("transform",a(Je.x,-d.uplift))}).on("dragend",function(Je){var At=x.select(this),St=Je.calcdata;Je.x=Je.xScale(Je),Je.calcdata.columnDragInProgress=!1,B(At,Je,0),z(ie,St,St.columns.map(function(Rt){return Rt.xIndex}))})),Qe.each(function(Je){t.setClipUrl(x.select(this),h(ie,Je),ie)});var Ke=Qe.selectAll("."+d.cn.columnBlock).data(s.splitToPanels,e.keyFun);Ke.enter().append("g").classed(d.cn.columnBlock,!0).attr("id",function(Je){return Je.key}),Ke.style("cursor",function(Je){return Je.dragHandle?"ew-resize":Je.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"});var Xe=Ke.filter(L),Me=Ke.filter(O);we&&Me.call(x.behavior.drag().origin(function(Je){return x.event.stopPropagation(),Je}).on("drag",Q(ie,Fe,-1)).on("dragend",function(){})),y(ie,Fe,Xe,Ke),y(ie,Fe,Me,Ke);var xe=Fe.selectAll("."+d.cn.scrollAreaClip).data(e.repeat,e.keyFun);xe.enter().append("clipPath").classed(d.cn.scrollAreaClip,!0).attr("id",function(Je){return v(ie,Je)});var ce=xe.selectAll("."+d.cn.scrollAreaClipRect).data(e.repeat,e.keyFun);ce.enter().append("rect").classed(d.cn.scrollAreaClipRect,!0).attr("x",-d.overdrag).attr("y",-d.uplift).attr("fill","none"),ce.attr("width",function(Je){return Je.width+2*d.overdrag}).attr("height",function(Je){return Je.height+d.uplift});var Re=Qe.selectAll("."+d.cn.columnBoundary).data(e.repeat,e.keyFun);Re.enter().append("g").classed(d.cn.columnBoundary,!0);var $e=Qe.selectAll("."+d.cn.columnBoundaryClippath).data(e.repeat,e.keyFun);$e.enter().append("clipPath").classed(d.cn.columnBoundaryClippath,!0),$e.attr("id",function(Je){return h(ie,Je)});var rt=$e.selectAll("."+d.cn.columnBoundaryRect).data(e.repeat,e.keyFun);rt.enter().append("rect").classed(d.cn.columnBoundaryRect,!0).attr("fill","none"),rt.attr("width",function(Je){return Je.columnWidth+2*f(Je)}).attr("height",function(Je){return Je.calcdata.height+2*f(Je)+d.uplift}).attr("x",function(Je){return-f(Je)}).attr("y",function(Je){return-f(Je)}),Z(null,Me,Fe)};function f(ae){return Math.ceil(ae.calcdata.maxLineWidth/2)}function v(ae,ie){return"clip"+ae._fullLayout._uid+"_scrollAreaBottomClip_"+ie.key}function h(ae,ie){return"clip"+ae._fullLayout._uid+"_columnBoundaryClippath_"+ie.calcdata.key+"_"+ie.specIndex}function T(ae){return[].concat.apply([],ae.map(function(ie){return ie})).map(function(ie){return ie.__data__})}function l(ae,ie,fe){function we(Qe){var Ke=Qe.rowBlocks;return $(Ke,Ke.length-1)+(Ke.length?X(Ke[Ke.length-1],1/0):1)}var Ae=ae.selectAll("."+d.cn.scrollbarKit).data(e.repeat,e.keyFun);Ae.enter().append("g").classed(d.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),Ae.each(function(Qe){var Ke=Qe.scrollbarState;Ke.totalHeight=we(Qe),Ke.scrollableAreaHeight=Qe.groupHeight-N(Qe),Ke.currentlyVisibleHeight=Math.min(Ke.totalHeight,Ke.scrollableAreaHeight),Ke.ratio=Ke.currentlyVisibleHeight/Ke.totalHeight,Ke.barLength=Math.max(Ke.ratio*Ke.currentlyVisibleHeight,d.goldenRatio*d.scrollbarWidth),Ke.barWiggleRoom=Ke.currentlyVisibleHeight-Ke.barLength,Ke.wiggleRoom=Math.max(0,Ke.totalHeight-Ke.scrollableAreaHeight),Ke.topY=Ke.barWiggleRoom===0?0:Qe.scrollY/Ke.wiggleRoom*Ke.barWiggleRoom,Ke.bottomY=Ke.topY+Ke.barLength,Ke.dragMultiplier=Ke.wiggleRoom/Ke.barWiggleRoom}).attr("transform",function(Qe){var Ke=Qe.width+d.scrollbarWidth/2+d.scrollbarOffset;return a(Ke,N(Qe))});var Fe=Ae.selectAll("."+d.cn.scrollbar).data(e.repeat,e.keyFun);Fe.enter().append("g").classed(d.cn.scrollbar,!0);var Ce=Fe.selectAll("."+d.cn.scrollbarSlider).data(e.repeat,e.keyFun);Ce.enter().append("g").classed(d.cn.scrollbarSlider,!0),Ce.attr("transform",function(Qe){return a(0,Qe.scrollbarState.topY||0)});var qe=Ce.selectAll("."+d.cn.scrollbarGlyph).data(e.repeat,e.keyFun);qe.enter().append("line").classed(d.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",d.scrollbarWidth).attr("stroke-linecap","round").attr("y1",d.scrollbarWidth/2),qe.attr("y2",function(Qe){return Qe.scrollbarState.barLength-d.scrollbarWidth/2}).attr("stroke-opacity",function(Qe){return Qe.columnDragInProgress||!Qe.scrollbarState.barWiggleRoom||fe?0:.4}),qe.transition().delay(0).duration(0),qe.transition().delay(d.scrollbarHideDelay).duration(d.scrollbarHideDuration).attr("stroke-opacity",0);var et=Fe.selectAll("."+d.cn.scrollbarCaptureZone).data(e.repeat,e.keyFun);et.enter().append("line").classed(d.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",d.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",function(Qe){var Ke=x.event.y,Xe=this.getBoundingClientRect(),Me=Qe.scrollbarState,xe=Ke-Xe.top,ce=x.scale.linear().domain([0,Me.scrollableAreaHeight]).range([0,Me.totalHeight]).clamp(!0);Me.topY<=xe&&xe<=Me.bottomY||Q(ie,ae,null,ce(xe-Me.barLength/2))(Qe)}).call(x.behavior.drag().origin(function(Qe){return x.event.stopPropagation(),Qe.scrollbarState.scrollbarScrollInProgress=!0,Qe}).on("drag",Q(ie,ae)).on("dragend",function(){})),et.attr("y2",function(Qe){return Qe.scrollbarState.scrollableAreaHeight}),ie._context.staticPlot&&(qe.remove(),et.remove())}function y(ae,ie,fe,we){var Ae=b(fe),Fe=S(Ae);p(Fe);var Ce=M(Fe);g(Ce);var qe=w(Fe),et=_(qe);u(et),m(et,ie,we,ae),J(Fe)}function b(ae){var ie=ae.selectAll("."+d.cn.columnCells).data(e.repeat,e.keyFun);return ie.enter().append("g").classed(d.cn.columnCells,!0),ie.exit().remove(),ie}function S(ae){var ie=ae.selectAll("."+d.cn.columnCell).data(s.splitToCells,function(fe){return fe.keyWithinBlock});return ie.enter().append("g").classed(d.cn.columnCell,!0),ie.exit().remove(),ie}function M(ae){var ie=ae.selectAll("."+d.cn.cellRect).data(e.repeat,function(fe){return fe.keyWithinBlock});return ie.enter().append("rect").classed(d.cn.cellRect,!0),ie}function _(ae){var ie=ae.selectAll("."+d.cn.cellText).data(e.repeat,function(fe){return fe.keyWithinBlock});return ie.enter().append("text").classed(d.cn.cellText,!0).style("cursor",function(){return"auto"}).on("mousedown",function(){x.event.stopPropagation()}),ie}function w(ae){var ie=ae.selectAll("."+d.cn.cellTextHolder).data(e.repeat,function(fe){return fe.keyWithinBlock});return ie.enter().append("g").classed(d.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),ie}function p(ae){ae.each(function(ie,fe){var we=ie.calcdata.cells.font,Ae=ie.column.specIndex,Fe={size:F(we.size,Ae,fe),color:F(we.color,Ae,fe),family:F(we.family,Ae,fe),weight:F(we.weight,Ae,fe),style:F(we.style,Ae,fe),variant:F(we.variant,Ae,fe),textcase:F(we.textcase,Ae,fe),lineposition:F(we.lineposition,Ae,fe),shadow:F(we.shadow,Ae,fe)};ie.rowNumber=ie.key,ie.align=F(ie.calcdata.cells.align,Ae,fe),ie.cellBorderWidth=F(ie.calcdata.cells.line.width,Ae,fe),ie.font=Fe})}function u(ae){ae.each(function(ie){t.font(x.select(this),ie.font)})}function g(ae){ae.attr("width",function(ie){return ie.column.columnWidth}).attr("stroke-width",function(ie){return ie.cellBorderWidth}).each(function(ie){var fe=x.select(this);c.stroke(fe,F(ie.calcdata.cells.line.color,ie.column.specIndex,ie.rowNumber)),c.fill(fe,F(ie.calcdata.cells.fill.color,ie.column.specIndex,ie.rowNumber))})}function m(ae,ie,fe,we){ae.text(function(Ae){var Fe=Ae.column.specIndex,Ce=Ae.rowNumber,qe=Ae.value,et=typeof qe=="string",Qe=et&&qe.match(/
/i),Ke=!et||Qe;Ae.mayHaveMarkup=et&&qe.match(/[<&>]/);var Xe=R(qe);Ae.latex=Xe;var Me=Xe?"":F(Ae.calcdata.cells.prefix,Fe,Ce)||"",xe=Xe?"":F(Ae.calcdata.cells.suffix,Fe,Ce)||"",ce=Xe?null:F(Ae.calcdata.cells.format,Fe,Ce)||null,Re=Me+(ce?E(ce)(Ae.value):Ae.value)+xe,$e;Ae.wrappingNeeded=!Ae.wrapped&&!Ke&&!Xe&&($e=P(Re)),Ae.cellHeightMayIncrease=Qe||Xe||Ae.mayHaveMarkup||($e===void 0?P(Re):$e),Ae.needsConvertToTspans=Ae.mayHaveMarkup||Ae.wrappingNeeded||Ae.latex;var rt;if(Ae.wrappingNeeded){var Je=d.wrapSplitCharacter===" "?Re.replace(/Ae&&we.push(Fe),Ae+=et}return we}function Z(ae,ie,fe){var we=T(ie)[0];if(we!==void 0){var Ae=we.rowBlocks,Fe=we.calcdata,Ce=$(Ae,Ae.length),qe=we.calcdata.groupHeight-N(we),et=Fe.scrollY=Math.max(0,Math.min(Ce-qe,Fe.scrollY)),Qe=U(Ae,et,qe);Qe.length===1&&(Qe[0]===Ae.length-1?Qe.unshift(Qe[0]-1):Qe.push(Qe[0]+1)),Qe[0]%2&&Qe.reverse(),ie.each(function(Ke,Xe){Ke.page=Qe[Xe],Ke.scrollY=et}),ie.attr("transform",function(Ke){var Xe=$(Ke.rowBlocks,Ke.page)-Ke.scrollY;return a(0,Xe)}),ae&&(ue(ae,fe,ie,Qe,we.prevPages,we,0),ue(ae,fe,ie,Qe,we.prevPages,we,1),l(fe,ae))}}function Q(ae,ie,fe,we){return function(Fe){var Ce=Fe.calcdata?Fe.calcdata:Fe,qe=ie.filter(function(Xe){return Ce.key===Xe.key}),et=fe||Ce.scrollbarState.dragMultiplier,Qe=Ce.scrollY;Ce.scrollY=we===void 0?Ce.scrollY+et*x.event.dy:we;var Ke=qe.selectAll("."+d.cn.yColumn).selectAll("."+d.cn.columnBlock).filter(O);return Z(ae,Ke,qe),Ce.scrollY===Qe}}function ue(ae,ie,fe,we,Ae,Fe,Ce){var qe=we[Ce]!==Ae[Ce];qe&&(clearTimeout(Fe.currentRepaint[Ce]),Fe.currentRepaint[Ce]=setTimeout(function(){var et=fe.filter(function(Qe,Ke){return Ke===Ce&&we[Ke]!==Ae[Ke]});y(ae,ie,et,fe),Ae[Ce]=we[Ce]}))}function oe(ae,ie,fe,we){return function(){var Fe=x.select(ie.parentNode);Fe.each(function(Ce){var qe=Ce.fragments;Fe.selectAll("tspan.line").each(function(Re,$e){qe[$e].width=this.getComputedTextLength()});var et=qe[qe.length-1].width,Qe=qe.slice(0,-1),Ke=[],Xe,Me,xe=0,ce=Ce.column.columnWidth-2*d.cellPad;for(Ce.value="";Qe.length;)Xe=Qe.shift(),Me=Xe.width+et,xe+Me>ce&&(Ce.value+=Ke.join(d.wrapSpacer)+d.lineBreaker,Ke=[],xe=0),Ke.push(Xe.text),xe+=Me;xe&&(Ce.value+=Ke.join(d.wrapSpacer)),Ce.wrapped=!0}),Fe.selectAll("tspan.line").remove(),m(Fe.select("."+d.cn.cellText),fe,ae,we),x.select(ie.parentNode.parentNode).call(J)}}function le(ae,ie,fe,we,Ae){return function(){if(!Ae.settledY){var Ce=x.select(ie.parentNode),qe=ee(Ae),et=Ae.key-qe.firstRowIndex,Qe=qe.rows[et].rowHeight,Ke=Ae.cellHeightMayIncrease?ie.parentNode.getBoundingClientRect().height+2*d.cellPad:Qe,Xe=Math.max(Ke,Qe),Me=Xe-qe.rows[et].rowHeight;Me&&(qe.rows[et].rowHeight=Xe,ae.selectAll("."+d.cn.columnCell).call(J),Z(null,ae.filter(O),0),l(fe,we,!0)),Ce.attr("transform",function(){var xe=this,ce=xe.parentNode,Re=ce.getBoundingClientRect(),$e=x.select(xe.parentNode).select("."+d.cn.cellRect).node().getBoundingClientRect(),rt=xe.transform.baseVal.consolidate(),Je=$e.top-Re.top+(rt?rt.matrix.f:d.cellPad);return a(j(Ae,x.select(xe.parentNode).select("."+d.cn.cellTextHolder).node().getBoundingClientRect().width),Je)}),Ae.settledY=!0}}}function j(ae,ie){switch(ae.align){case"left":return d.cellPad;case"right":return ae.column.columnWidth-(ie||0)-d.cellPad;case"center":return(ae.column.columnWidth-(ie||0))/2;default:return d.cellPad}}function J(ae){ae.attr("transform",function(ie){var fe=ie.rowBlocks[0].auxiliaryBlocks.reduce(function(Ce,qe){return Ce+X(qe,1/0)},0),we=ee(ie),Ae=X(we,ie.key),Fe=Ae+fe;return a(0,Fe)}).selectAll("."+d.cn.cellRect).attr("height",function(ie){return q(ee(ie),ie.key).rowHeight})}function $(ae,ie){for(var fe=0,we=ie-1;we>=0;we--)fe+=re(ae[we]);return fe}function X(ae,ie){for(var fe=0,we=0;weE.length&&(A=A.slice(0,E.length)):A=[],t=0;t90&&(v-=180,i=-i),{angle:v,flip:i,p:x.c2p(e,A,E),offsetMultplier:n}}}}),gD=He({"src/traces/carpet/plot.js"(Y,G){var d=Qn(),x=vo(),A=nA(),E=iA(),e=pD(),t=yl(),r=Gr(),o=r.strRotate,a=r.strTranslate,i=df();G.exports=function(y,b,S,M){var _=y._context.staticPlot,w=b.xaxis,p=b.yaxis,u=y._fullLayout,g=u._clips;r.makeTraceGroups(M,S,"trace").each(function(m){var R=d.select(this),P=m[0],z=P.trace,F=z.aaxis,B=z.baxis,O=r.ensureSingle(R,"g","minorlayer"),L=r.ensureSingle(R,"g","majorlayer"),N=r.ensureSingle(R,"g","boundarylayer"),U=r.ensureSingle(R,"g","labellayer");R.style("opacity",z.opacity),s(w,p,L,F,"a",F._gridlines,!0),s(w,p,L,B,"b",B._gridlines,!0),s(w,p,O,F,"a",F._minorgridlines,!0),s(w,p,O,B,"b",B._minorgridlines,!0),s(w,p,N,F,"a-boundary",F._boundarylines,_),s(w,p,N,B,"b-boundary",B._boundarylines,_);var Z=c(y,w,p,z,P,U,F._labels,"a-label"),Q=c(y,w,p,z,P,U,B._labels,"b-label");f(y,U,z,P,w,p,Z,Q),n(z,P,g,w,p)})};function n(l,y,b,S,M){var _,w,p,u,g=b.select("#"+l._clipPathId);g.size()||(g=b.append("clipPath").classed("carpetclip",!0));var m=r.ensureSingle(g,"path","carpetboundary"),R=y.clipsegments,P=[];for(u=0;u0?"start":"end","data-notex":1}).call(x.font,R.font).text(R.text).call(t.convertToTspans,l),L=x.bBox(this);O.attr("transform",a(z.p[0],z.p[1])+o(z.angle)+a(R.axis.labelpadding*B,L.height*.3)),g=Math.max(g,L.width+R.axis.labelpadding)}),u.exit().remove(),m.maxExtent=g,m}function f(l,y,b,S,M,_,w,p){var u,g,m,R,P=r.aggNums(Math.min,null,b.a),z=r.aggNums(Math.max,null,b.a),F=r.aggNums(Math.min,null,b.b),B=r.aggNums(Math.max,null,b.b);u=.5*(P+z),g=F,m=b.ab2xy(u,g,!0),R=b.dxyda_rough(u,g),w.angle===void 0&&r.extendFlat(w,e(b,M,_,m,b.dxydb_rough(u,g))),T(l,y,b,S,m,R,b.aaxis,M,_,w,"a-title"),u=P,g=.5*(F+B),m=b.ab2xy(u,g,!0),R=b.dxydb_rough(u,g),p.angle===void 0&&r.extendFlat(p,e(b,M,_,m,b.dxyda_rough(u,g))),T(l,y,b,S,m,R,b.baxis,M,_,p,"b-title")}var v=i.LINE_SPACING,h=(1-i.MID_SHIFT)/v+1;function T(l,y,b,S,M,_,w,p,u,g,m){var R=[];w.title.text&&R.push(w.title.text);var P=y.selectAll("text."+m).data(R),z=g.maxExtent;P.enter().append("text").classed(m,!0),P.each(function(){var F=e(b,p,u,M,_);["start","both"].indexOf(w.showticklabels)===-1&&(z=0);var B=w.title.font.size;z+=B+w.title.offset;var O=g.angle+(g.flip<0?180:0),L=(O-F.angle+450)%360,N=L>90&&L<270,U=d.select(this);U.text(w.title.text).call(t.convertToTspans,l),N&&(z=(-t.lineCount(U)+h)*v*B-z),U.attr("transform",a(F.p[0],F.p[1])+o(F.angle)+a(0,z)).attr("text-anchor","middle").call(x.font,w.title.font)}),P.exit().remove()}}}),yD=He({"src/traces/carpet/cheater_basis.js"(Y,G){var d=Gr().isArrayOrTypedArray;G.exports=function(x,A,E){var e,t,r,o,a,i,n=[],s=d(x)?x.length:x,c=d(A)?A.length:A,f=d(x)?x:null,v=d(A)?A:null;f&&(r=(f.length-1)/(f[f.length-1]-f[0])/(s-1)),v&&(o=(v.length-1)/(v[v.length-1]-v[0])/(c-1));var h,T=1/0,l=-1/0;for(t=0;t=10)return null;for(var e=1/0,t=-1/0,r=A.length,o=0;o0&&(X=E.dxydi([],Z-1,ue,0,oe),ae.push(le[0]+X[0]/3),ie.push(le[1]+X[1]/3),re=E.dxydi([],Z-1,ue,1,oe),ae.push($[0]-re[0]/3),ie.push($[1]-re[1]/3)),ae.push($[0]),ie.push($[1]),le=$;else for(Z=E.a2i(U),j=Math.floor(Math.max(0,Math.min(F-2,Z))),J=Z-j,fe.length=F,fe.crossLength=B,fe.xy=function(we){return E.evalxy([],Z,we)},fe.dxy=function(we,Ae){return E.dxydj([],j,we,J,Ae)},Q=0;Q0&&(ee=E.dxydj([],j,Q-1,J,0),ae.push(le[0]+ee[0]/3),ie.push(le[1]+ee[1]/3),q=E.dxydj([],j,Q-1,J,1),ae.push($[0]-q[0]/3),ie.push($[1]-q[1]/3)),ae.push($[0]),ie.push($[1]),le=$;return fe.axisLetter=e,fe.axis=M,fe.crossAxis=g,fe.value=U,fe.constvar=t,fe.index=f,fe.x=ae,fe.y=ie,fe.smoothing=g.smoothing,fe}function N(U){var Z,Q,ue,oe,le,j=[],J=[],$={};if($.length=S.length,$.crossLength=u.length,e==="b")for(ue=Math.max(0,Math.min(B-2,U)),le=Math.min(1,Math.max(0,U-ue)),$.xy=function(X){return E.evalxy([],X,U)},$.dxy=function(X,re){return E.dxydi([],X,ue,re,le)},Z=0;ZS.length-1)&&_.push(x(N(o),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(f=s;fS.length-1)&&!(T<0||T>S.length-1))for(l=S[a],y=S[T],r=0;rS[S.length-1])&&w.push(x(L(h),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash})));M.startline&&p.push(x(N(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&p.push(x(N(S.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(i=5e-15,n=[Math.floor((S[S.length-1]-M.tick0)/M.dtick*(1+i)),Math.ceil((S[0]-M.tick0)/M.dtick/(1+i))].sort(function(U,Z){return U-Z}),s=n[0],c=n[1],f=s;f<=c;f++)v=M.tick0+M.dtick*f,_.push(x(L(v),{color:M.gridcolor,width:M.gridwidth,dash:M.griddash}));for(f=s-1;fS[S.length-1])&&w.push(x(L(h),{color:M.minorgridcolor,width:M.minorgridwidth,dash:M.minorgriddash}));M.startline&&p.push(x(L(S[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&p.push(x(L(S[S.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}}}),xD=He({"src/traces/carpet/calc_labels.js"(Y,G){var d=io(),x=ho().extendFlat;G.exports=function(E,e){var t,r,o,a,i,n=e._labels=[],s=e._gridlines;for(t=0;t=0;t--)r[s-t]=x[c][t],o[s-t]=A[c][t];for(a.push({x:r,y:o,bicubic:i}),t=c,r=[],o=[];t>=0;t--)r[c-t]=x[t][0],o[c-t]=A[t][0];return a.push({x:r,y:o,bicubic:n}),a}}}),wD=He({"src/traces/carpet/smooth_fill_2d_array.js"(Y,G){var d=Gr();G.exports=function(A,E,e){var t,r,o,a=[],i=[],n=A[0].length,s=A.length;function c(Q,ue){var oe=0,le,j=0;return Q>0&&(le=A[ue][Q-1])!==void 0&&(j++,oe+=le),Q0&&(le=A[ue-1][Q])!==void 0&&(j++,oe+=le),ue0&&r0&&tu);return d.log("Smoother converged to",g,"after",R,"iterations"),A}}}),TD=He({"src/traces/carpet/constants.js"(Y,G){G.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),AD=He({"src/traces/carpet/catmull_rom.js"(Y,G){var d=.5;G.exports=function(A,E,e,t){var r=A[0]-E[0],o=A[1]-E[1],a=e[0]-E[0],i=e[1]-E[1],n=Math.pow(r*r+o*o,d/2),s=Math.pow(a*a+i*i,d/2),c=(s*s*r-n*n*a)*t,f=(s*s*o-n*n*i)*t,v=s*(n+s)*3,h=n*(n+s)*3;return[[E[0]+(v&&c/v),E[1]+(v&&f/v)],[E[0]-(h&&c/h),E[1]-(h&&f/h)]]}}}),SD=He({"src/traces/carpet/compute_control_points.js"(Y,G){var d=AD(),x=Gr().ensureArray;function A(E,e,t){var r=-.5*t[0]+1.5*e[0],o=-.5*t[1]+1.5*e[1];return[(2*r+E[0])/3,(2*o+E[1])/3]}G.exports=function(e,t,r,o,a,i){var n,s,c,f,v,h,T,l,y,b,S=r[0].length,M=r.length,_=a?3*S-2:S,w=i?3*M-2:M;for(e=x(e,w),t=x(t,w),c=0;cv&&_T&&wh||wl},o.setScale=function(){var _=o._x,w=o._y,p=A(o._xctrl,o._yctrl,_,w,c.smoothing,f.smoothing);o._xctrl=p[0],o._yctrl=p[1],o.evalxy=E([o._xctrl,o._yctrl],n,s,c.smoothing,f.smoothing),o.dxydi=e([o._xctrl,o._yctrl],c.smoothing,f.smoothing),o.dxydj=t([o._xctrl,o._yctrl],c.smoothing,f.smoothing)},o.i2a=function(_){var w=Math.max(0,Math.floor(_[0]),n-2),p=_[0]-w;return(1-p)*a[w]+p*a[w+1]},o.j2b=function(_){var w=Math.max(0,Math.floor(_[1]),n-2),p=_[1]-w;return(1-p)*i[w]+p*i[w+1]},o.ij2ab=function(_){return[o.i2a(_[0]),o.j2b(_[1])]},o.a2i=function(_){var w=Math.max(0,Math.min(x(_,a),n-2)),p=a[w],u=a[w+1];return Math.max(0,Math.min(n-1,w+(_-p)/(u-p)))},o.b2j=function(_){var w=Math.max(0,Math.min(x(_,i),s-2)),p=i[w],u=i[w+1];return Math.max(0,Math.min(s-1,w+(_-p)/(u-p)))},o.ab2ij=function(_){return[o.a2i(_[0]),o.b2j(_[1])]},o.i2c=function(_,w){return o.evalxy([],_,w)},o.ab2xy=function(_,w,p){if(!p&&(_a[n-1]|wi[s-1]))return[!1,!1];var u=o.a2i(_),g=o.b2j(w),m=o.evalxy([],u,g);if(p){var R=0,P=0,z=[],F,B,O,L;_a[n-1]?(F=n-2,B=1,R=(_-a[n-1])/(a[n-1]-a[n-2])):(F=Math.max(0,Math.min(n-2,Math.floor(u))),B=u-F),wi[s-1]?(O=s-2,L=1,P=(w-i[s-1])/(i[s-1]-i[s-2])):(O=Math.max(0,Math.min(s-2,Math.floor(g))),L=g-O),R&&(o.dxydi(z,F,O,B,L),m[0]+=z[0]*R,m[1]+=z[1]*R),P&&(o.dxydj(z,F,O,B,L),m[0]+=z[0]*P,m[1]+=z[1]*P)}return m},o.c2p=function(_,w,p){return[w.c2p(_[0]),p.c2p(_[1])]},o.p2x=function(_,w,p){return[w.p2c(_[0]),p.p2c(_[1])]},o.dadi=function(_){var w=Math.max(0,Math.min(a.length-2,_));return a[w+1]-a[w]},o.dbdj=function(_){var w=Math.max(0,Math.min(i.length-2,_));return i[w+1]-i[w]},o.dxyda=function(_,w,p,u){var g=o.dxydi(null,_,w,p,u),m=o.dadi(_,p);return[g[0]/m,g[1]/m]},o.dxydb=function(_,w,p,u){var g=o.dxydj(null,_,w,p,u),m=o.dbdj(w,u);return[g[0]/m,g[1]/m]},o.dxyda_rough=function(_,w,p){var u=y*(p||.1),g=o.ab2xy(_+u,w,!0),m=o.ab2xy(_-u,w,!0);return[(g[0]-m[0])*.5/u,(g[1]-m[1])*.5/u]},o.dxydb_rough=function(_,w,p){var u=b*(p||.1),g=o.ab2xy(_,w+u,!0),m=o.ab2xy(_,w-u,!0);return[(g[0]-m[0])*.5/u,(g[1]-m[1])*.5/u]},o.dpdx=function(_){return _._m},o.dpdy=function(_){return _._m}}}}),LD=He({"src/traces/carpet/calc.js"(Y,G){var d=io(),x=Gr().isArray1D,A=yD(),E=mD(),e=_D(),t=xD(),r=bD(),o=I1(),a=wD(),i=P1(),n=CD();G.exports=function(c,f){var v=d.getFromId(c,f.xaxis),h=d.getFromId(c,f.yaxis),T=f.aaxis,l=f.baxis,y=f.x,b=f.y,S=[];y&&x(y)&&S.push("x"),b&&x(b)&&S.push("y"),S.length&&i(f,T,l,"a","b",S);var M=f._a=f._a||f.a,_=f._b=f._b||f.b;y=f._x||f.x,b=f._y||f.y;var w={};if(f._cheater){var p=T.cheatertype==="index"?M.length:M,u=l.cheatertype==="index"?_.length:_;y=A(p,u,f.cheaterslope)}f._x=y=o(y),f._y=b=o(b),a(y,M,_),a(b,M,_),n(f),f.setScale();var g=E(y),m=E(b),R=.5*(g[1]-g[0]),P=.5*(g[1]+g[0]),z=.5*(m[1]-m[0]),F=.5*(m[1]+m[0]),B=1.3;return g=[P-R*B,P+R*B],m=[F-z*B,F+z*B],f._extremes[v._id]=d.findExtremes(v,g,{padded:!0}),f._extremes[h._id]=d.findExtremes(h,m,{padded:!0}),e(f,"a","b"),e(f,"b","a"),t(f,T),t(f,l),w.clipsegments=r(f._xctrl,f._yctrl,T,l),w.x=y,w.y=b,w.a=M,w.b=_,[w]}}}),PD=He({"src/traces/carpet/index.js"(Y,G){G.exports={attributes:dx(),supplyDefaults:dD(),plot:gD(),calc:LD(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Bc(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),ID=He({"lib/carpet.js"(Y,G){G.exports=PD()}}),oA=He({"src/traces/scattercarpet/attributes.js"(Y,G){var d=wv(),x=Zu(),A=cl(),E=Yo().hovertemplateAttrs,e=Yo().texttemplateAttrs,t=kl(),r=ho().extendFlat,o=x.marker,a=x.line,i=o.line;G.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:r({},x.mode,{dflt:"markers"}),text:r({},x.text,{}),texttemplate:e({editType:"plot"},{keys:["a","b","text"]}),hovertext:r({},x.hovertext,{}),line:{color:a.color,width:a.width,dash:a.dash,backoff:a.backoff,shape:r({},a.shape,{values:["linear","spline"]}),smoothing:a.smoothing,editType:"calc"},connectgaps:x.connectgaps,fill:r({},x.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:d(),marker:r({symbol:o.symbol,opacity:o.opacity,maxdisplayed:o.maxdisplayed,angle:o.angle,angleref:o.angleref,standoff:o.standoff,size:o.size,sizeref:o.sizeref,sizemin:o.sizemin,sizemode:o.sizemode,line:r({width:i.width,editType:"calc"},t("marker.line")),gradient:o.gradient,editType:"calc"},t("marker")),textfont:x.textfont,textposition:x.textposition,selected:x.selected,unselected:x.unselected,hoverinfo:r({},A.hoverinfo,{flags:["a","b","text","name"]}),hoveron:x.hoveron,hovertemplate:E(),zorder:x.zorder}}}),RD=He({"src/traces/scattercarpet/defaults.js"(Y,G){var d=Gr(),x=jv(),A=Rl(),E=Kh(),e=nv(),t=V0(),r=iv(),o=Av(),a=oA();G.exports=function(n,s,c,f){function v(M,_){return d.coerce(n,s,a,M,_)}v("carpet"),s.xaxis="x",s.yaxis="y";var h=v("a"),T=v("b"),l=Math.min(h.length,T.length);if(!l){s.visible=!1;return}s._length=l,v("text"),v("texttemplate"),v("hovertext");var y=l0?w=M.labelprefix.replace(/ = $/,""):w=M._hovertitle,l.push(w+": "+_.toFixed(3)+M.labelsuffix)}if(!v.hovertemplate){var b=f.hi||v.hoverinfo,S=b.split("+");S.indexOf("all")!==-1&&(S=["a","b","text"]),S.indexOf("a")!==-1&&y(h.aaxis,f.a),S.indexOf("b")!==-1&&y(h.baxis,f.b),l.push("y: "+a.yLabel),S.indexOf("text")!==-1&&x(f,v,l),a.extraText=l.join("
")}return o}}}),BD=He({"src/traces/scattercarpet/event_data.js"(Y,G){G.exports=function(x,A,E,e,t){var r=e[t];return x.a=r.a,x.b=r.b,x.y=r.y,x}}}),ND=He({"src/traces/scattercarpet/index.js"(Y,G){G.exports={attributes:oA(),supplyDefaults:RD(),colorbar:ah(),formatLabels:DD(),calc:zD(),plot:FD(),style:Ih().style,styleOnSelect:Ih().styleOnSelect,hoverPoints:OD(),selectPoints:W0(),eventData:BD(),moduleType:"trace",name:"scattercarpet",basePlotModule:Bc(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),UD=He({"lib/scattercarpet.js"(Y,G){G.exports=ND()}}),sA=He({"src/traces/contourcarpet/attributes.js"(Y,G){var d=Y0(),x=fy(),A=kl(),E=ho().extendFlat,e=x.contours;G.exports=E({carpet:{valType:"string",editType:"calc"},z:d.z,a:d.x,a0:d.x0,da:d.dx,b:d.y,b0:d.y0,db:d.dy,text:d.text,hovertext:d.hovertext,transpose:d.transpose,atype:d.xtype,btype:d.ytype,fillcolor:x.fillcolor,autocontour:x.autocontour,ncontours:x.ncontours,contours:{type:e.type,start:e.start,end:e.end,size:e.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:e.showlines,showlabels:e.showlabels,labelfont:e.labelfont,labelformat:e.labelformat,operation:e.operation,value:e.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:x.line.color,width:x.line.width,dash:x.line.dash,smoothing:x.line.smoothing,editType:"plot"},zorder:x.zorder},A("",{cLetter:"z",autoColorDflt:!1}))}}),lA=He({"src/traces/contourcarpet/defaults.js"(Y,G){var d=Gr(),x=L1(),A=sA(),E=Fw(),e=H1(),t=G1();G.exports=function(o,a,i,n){function s(h,T){return d.coerce(o,a,A,h,T)}function c(h){return d.coerce2(o,a,A,h)}if(s("carpet"),o.a&&o.b){var f=x(o,a,s,n,"a","b");if(!f){a.visible=!1;return}s("text");var v=s("contours.type")==="constraint";v?E(o,a,s,n,i,{hasHover:!1}):(e(o,a,s,c),t(o,a,s,n,{hasHover:!1}))}else a._defaultColor=i,a._length=null;s("zorder")}}}),jD=He({"src/traces/contourcarpet/calc.js"(Y,G){var d=Sh(),x=Gr(),A=P1(),E=I1(),e=R1(),t=D1(),r=xw(),o=lA(),a=px(),i=Ew();G.exports=function(c,f){var v=f._carpetTrace=a(c,f);if(!(!v||!v.visible||v.visible==="legendonly")){if(!f.a||!f.b){var h=c.data[v.index],T=c.data[f.index];T.a||(T.a=h.a),T.b||(T.b=h.b),o(T,f,f._defaultColor,c._fullLayout)}var l=n(c,f);return i(f,f._z),l}};function n(s,c){var f=c._carpetTrace,v=f.aaxis,h=f.baxis,T,l,y,b,S,M,_;v._minDtick=0,h._minDtick=0,x.isArray1D(c.z)&&A(c,v,h,"a","b",["z"]),T=c._a=c._a||c.a,b=c._b=c._b||c.b,T=T?v.makeCalcdata(c,"_a"):[],b=b?h.makeCalcdata(c,"_b"):[],l=c.a0||0,y=c.da||1,S=c.b0||0,M=c.db||1,_=c._z=E(c._z||c.z,c.transpose),c._emptypoints=t(_),e(_,c._emptypoints);var w=x.maxRowLength(_),p=c.xtype==="scaled"?"":T,u=r(c,p,l,y,w,v),g=c.ytype==="scaled"?"":b,m=r(c,g,S,M,_.length,h),R={a:u,b:m,z:_};return c.contours.type==="levels"&&c.contours.coloring!=="none"&&d(s,c,{vals:_,containerStr:"",cLetter:"z"}),[R]}}}),VD=He({"src/traces/carpet/axis_aligned_line.js"(Y,G){var d=Gr().isArrayOrTypedArray;G.exports=function(x,A,E,e){var t,r,o,a,i,n,s,c,f,v,h,T,l,y=d(E)?"a":"b",b=y==="a"?x.aaxis:x.baxis,S=b.smoothing,M=y==="a"?x.a2i:x.b2j,_=y==="a"?E:e,w=y==="a"?e:E,p=y==="a"?A.a.length:A.b.length,u=y==="a"?A.b.length:A.a.length,g=Math.floor(y==="a"?x.b2j(w):x.a2i(w)),m=y==="a"?function(ue){return x.evalxy([],ue,g)}:function(ue){return x.evalxy([],g,ue)};S&&(o=Math.max(0,Math.min(u-2,g)),a=g-o,r=y==="a"?function(ue,oe){return x.dxydi([],ue,o,oe,a)}:function(ue,oe){return x.dxydj([],o,ue,a,oe)});var R=M(_[0]),P=M(_[1]),z=R0?Math.floor:Math.ceil,O=z>0?Math.ceil:Math.floor,L=z>0?Math.min:Math.max,N=z>0?Math.max:Math.min,U=B(R+F),Z=O(P-F);s=m(R);var Q=[[s]];for(t=U;t*z=0;fe--)q=N.clipsegments[fe],ae=x([],q.x,R.c2p),ie=x([],q.y,P.c2p),ae.reverse(),ie.reverse(),we.push(A(ae,ie,q.bicubic));var Ae="M"+we.join("L")+"Z";S(F,N.clipsegments,R,P,oe,j),M(O,F,R,P,ee,$,J,L,N,j,Ae),h(F,ue,p,B,Q,u,L),E.setClipUrl(F,L._clipPathId,p)})};function v(w,p){var u,g,m,R,P,z,F,B,O;for(u=0;uue&&(g.max=ue),g.len=g.max-g.min}function l(w,p,u){var g=w.getPointAtLength(p),m=w.getPointAtLength(u),R=m.x-g.x,P=m.y-g.y,z=Math.sqrt(R*R+P*P);return[R/z,P/z]}function y(w){var p=Math.sqrt(w[0]*w[0]+w[1]*w[1]);return[w[0]/p,w[1]/p]}function b(w,p){var u=Math.abs(w[0]*p[0]+w[1]*p[1]),g=Math.sqrt(1-u*u);return g/u}function S(w,p,u,g,m,R){var P,z,F,B,O=e.ensureSingle(w,"g","contourbg"),L=O.selectAll("path").data(R==="fill"&&!m?[0]:[]);L.enter().append("path"),L.exit().remove();var N=[];for(B=0;B=0&&(U=ae,Q=ue):Math.abs(N[1]-U[1])=0&&(U=ae,Q=ue):e.log("endpt to newendpt is not vert. or horz.",N,U,ae)}if(Q>=0)break;B+=ee(N,U),N=U}if(Q===p.edgepaths.length){e.log("unclosed perimeter path");break}F=Q,L=O.indexOf(F)===-1,L&&(F=O[0],B+=ee(N,U)+"Z",N=null)}for(F=0;F_):M=z>m,_=z;var F=v(m,R,P,z);F.pos=g,F.yc=(m+z)/2,F.i=u,F.dir=M?"increasing":"decreasing",F.x=F.pos,F.y=[P,R],w&&(F.orig_p=s[u]),b&&(F.tx=n.text[u]),S&&(F.htx=n.hovertext[u]),p.push(F)}else p.push({pos:g,empty:!0})}return n._extremes[f._id]=A.findExtremes(f,d.concat(l,T),{padded:!0}),p.length&&(p[0].t={labels:{open:x(i,"open:")+" ",high:x(i,"high:")+" ",low:x(i,"low:")+" ",close:x(i,"close:")+" "}}),p}function a(i,n,s){var c=s._minDiff;if(!c){var f=i._fullData,v=[];c=1/0;var h;for(h=0;h"+y.labels[z]+d.hoverLabelText(T,F,l.yhoverformat)):(O=x.extendFlat({},S),O.y0=O.y1=B,O.yLabelVal=F,O.yLabel=y.labels[z]+d.hoverLabelText(T,F,l.yhoverformat),O.name="",b.push(O),R[F]=O)}return b}function n(s,c,f,v){var h=s.cd,T=s.ya,l=h[0].trace,y=h[0].t,b=a(s,c,f,v);if(!b)return[];var S=b.index,M=h[S],_=b.index=M.i,w=M.dir;function p(F){return y.labels[F]+d.hoverLabelText(T,l[F][_],l.yhoverformat)}var u=M.hi||l.hoverinfo,g=u.split("+"),m=u==="all",R=m||g.indexOf("y")!==-1,P=m||g.indexOf("text")!==-1,z=R?[p("open"),p("high"),p("low"),p("close")+" "+r[w]]:[];return P&&e(M,l,z),b.extraText=z.join("
"),b.y0=b.y1=T.c2p(M.yc,!0),[b]}G.exports={hoverPoints:o,hoverSplit:i,hoverOnPoints:n}}}),hA=He({"src/traces/ohlc/select.js"(Y,G){G.exports=function(x,A){var E=x.cd,e=x.xaxis,t=x.yaxis,r=[],o,a=E[0].t.bPos||0;if(A===!1)for(o=0;oc?function(l){return l<=0}:function(l){return l>=0};a.c2g=function(l){var y=a.c2l(l)-s;return(T(y)?y:0)+h},a.g2c=function(l){return a.l2c(l+s-h)},a.g2p=function(l){return l*v},a.c2p=function(l){return a.g2p(a.c2g(l))}}}function t(a,i){return i==="degrees"?A(a):a}function r(a,i){return i==="degrees"?E(a):a}function o(a,i){var n=a.type;if(n==="linear"){var s=a.d2c,c=a.c2d;a.d2c=function(f,v){return t(s(f),v)},a.c2d=function(f,v){return c(r(f,v))}}a.makeCalcdata=function(f,v){var h=f[v],T=f._length,l,y,b=function(p){return a.d2c(p,f.thetaunit)};if(h)for(l=new Array(T),y=0;y0?p:1/0},M=A(b,S),_=d.mod(M+1,b.length);return[b[M],b[_]]}function v(y){return Math.abs(y)>1e-10?y:0}function h(y,b,S){b=b||0,S=S||0;for(var M=y.length,_=new Array(M),w=0;w0?1:0}function x(r){var o=r[0],a=r[1];if(!isFinite(o)||!isFinite(a))return[1,0];var i=(o+1)*(o+1)+a*a;return[(o*o+a*a-1)/i,2*a/i]}function A(r,o){var a=o[0],i=o[1];return[a*r.radius+r.cx,-i*r.radius+r.cy]}function E(r,o){return o*r.radius}function e(r,o,a,i){var n=A(r,x([a,o])),s=n[0],c=n[1],f=A(r,x([i,o])),v=f[0],h=f[1];if(o===0)return["M"+s+","+c,"L"+v+","+h].join(" ");var T=E(r,1/Math.abs(o));return["M"+s+","+c,"A"+T+","+T+" 0 0,"+(o<0?1:0)+" "+v+","+h].join(" ")}function t(r,o,a,i){var n=E(r,1/(o+1)),s=A(r,x([o,a])),c=s[0],f=s[1],v=A(r,x([o,i])),h=v[0],T=v[1];if(d(a)!==d(i)){var l=A(r,x([o,0])),y=l[0],b=l[1];return["M"+c+","+f,"A"+n+","+n+" 0 0,"+(0et?(Qe=ie,Ke=ie*et,xe=(fe-Ke)/X.h/2,Xe=[q[0],q[1]],Me=[ae[0]+xe,ae[1]-xe]):(Qe=fe/et,Ke=fe,xe=(ie-Qe)/X.w/2,Xe=[q[0]+xe,q[1]-xe],Me=[ae[0],ae[1]]),J.xLength2=Qe,J.yLength2=Ke,J.xDomain2=Xe,J.yDomain2=Me;var ce=J.xOffset2=X.l+X.w*Xe[0],Re=J.yOffset2=X.t+X.h*(1-Me[1]),$e=J.radius=Qe/Fe,rt=J.innerRadius=J.getHole(j)*$e,Je=J.cx=ce-$e*Ae[0],At=J.cy=Re+$e*Ae[3],St=J.cxx=Je-ce,Rt=J.cyy=At-Re,Ut=re.side,ir;Ut==="counterclockwise"?(ir=Ut,Ut="top"):Ut==="clockwise"&&(ir=Ut,Ut="bottom"),J.radialAxis=J.mockAxis(le,j,re,{_id:"x",side:Ut,_trueSide:ir,domain:[rt/X.w,$e/X.w]}),J.angularAxis=J.mockAxis(le,j,ee,{side:"right",domain:[0,Math.PI],autorange:!1}),J.doAutoRange(le,j),J.updateAngularAxis(le,j),J.updateRadialAxis(le,j),J.updateRadialAxisTitle(le,j),J.xaxis=J.mockCartesianAxis(le,j,{_id:"x",domain:Xe}),J.yaxis=J.mockCartesianAxis(le,j,{_id:"y",domain:Me});var ar=J.pathSubplot();J.clipPaths.forTraces.select("path").attr("d",ar).attr("transform",t(St,Rt)),$.frontplot.attr("transform",t(ce,Re)).call(o.setClipUrl,J._hasClipOnAxisFalse?null:J.clipIds.forTraces,J.gd),$.bg.attr("d",ar).attr("transform",t(Je,At)).call(r.fill,j.bgcolor)},U.mockAxis=function(le,j,J,$){var X=E.extendFlat({},J,$);return s(X,j,le),X},U.mockCartesianAxis=function(le,j,J){var $=this,X=$.isSmith,re=J._id,ee=E.extendFlat({type:"linear"},J);n(ee,le);var q={x:[0,2],y:[1,3]};return ee.setRange=function(){var ae=$.sectorBBox,ie=q[re],fe=$.radialAxis._rl,we=(fe[1]-fe[0])/(1-$.getHole(j));ee.range=[ae[ie[0]]*we,ae[ie[1]]*we]},ee.isPtWithinRange=re==="x"&&!X?function(ae){return $.isPtInside(ae)}:function(){return!0},ee.setRange(),ee.setScale(),ee},U.doAutoRange=function(le,j){var J=this,$=J.gd,X=J.radialAxis,re=J.getRadial(j);c($,X);var ee=X.range;if(re.range=ee.slice(),re._input.range=ee.slice(),X._rl=[X.r2l(ee[0],null,"gregorian"),X.r2l(ee[1],null,"gregorian")],X.minallowed!==void 0){var q=X.r2l(X.minallowed);X._rl[0]>X._rl[1]?X._rl[1]=Math.max(X._rl[1],q):X._rl[0]=Math.max(X._rl[0],q)}if(X.maxallowed!==void 0){var ae=X.r2l(X.maxallowed);X._rl[0]90&&fe<=270&&(we.tickangle=180);var Ce=Fe?function($e){var rt=z(J,m([$e.x,0]));return t(rt[0]-q,rt[1]-ae)}:function($e){return t(we.l2p($e.x)+ee,0)},qe=Fe?function($e){return P(J,$e.x,-1/0,1/0)}:function($e){return J.pathArc(we.r2p($e.x)+ee)},et=Z(ie);if(J.radialTickLayout!==et&&(X["radial-axis"].selectAll(".xtick").remove(),J.radialTickLayout=et),Ae){we.setScale();var Qe=0,Ke=Fe?(we.tickvals||[]).filter(function($e){return $e>=0}).map(function($e){return i.tickText(we,$e,!0,!1)}):i.calcTicks(we),Xe=Fe?Ke:i.clipEnds(we,Ke),Me=i.getTickSigns(we)[2];Fe&&((we.ticks==="top"&&we.side==="bottom"||we.ticks==="bottom"&&we.side==="top")&&(Me=-Me),we.ticks==="top"&&we.side==="top"&&(Qe=-we.ticklen),we.ticks==="bottom"&&we.side==="bottom"&&(Qe=we.ticklen)),i.drawTicks($,we,{vals:Ke,layer:X["radial-axis"],path:i.makeTickPath(we,0,Me),transFn:Ce,crisp:!1}),i.drawGrid($,we,{vals:Xe,layer:X["radial-grid"],path:qe,transFn:E.noop,crisp:!1}),i.drawLabels($,we,{vals:Ke,layer:X["radial-axis"],transFn:Ce,labelFns:i.makeLabelFns(we,Qe)})}var xe=J.radialAxisAngle=J.vangles?L(ue(O(ie.angle),J.vangles)):ie.angle,ce=t(q,ae),Re=ce+e(-xe);oe(X["radial-axis"],Ae&&(ie.showticklabels||ie.ticks),{transform:Re}),oe(X["radial-grid"],Ae&&ie.showgrid,{transform:Fe?"":ce}),oe(X["radial-line"].select("line"),Ae&&ie.showline,{x1:Fe?-re:ee,y1:0,x2:re,y2:0,transform:Re}).attr("stroke-width",ie.linewidth).call(r.stroke,ie.linecolor)},U.updateRadialAxisTitle=function(le,j,J){if(!this.isSmith){var $=this,X=$.gd,re=$.radius,ee=$.cx,q=$.cy,ae=$.getRadial(j),ie=$.id+"title",fe=0;if(ae.title){var we=o.bBox($.layers["radial-axis"].node()).height,Ae=ae.title.font.size,Fe=ae.side;fe=Fe==="top"?Ae:Fe==="counterclockwise"?-(we+Ae*.4):we+Ae*.8}var Ce=J!==void 0?J:$.radialAxisAngle,qe=O(Ce),et=Math.cos(qe),Qe=Math.sin(qe),Ke=ee+re/2*et+fe*Qe,Xe=q-re/2*Qe+fe*et;$.layers["radial-axis-title"]=T.draw(X,ie,{propContainer:ae,propName:$.id+".radialaxis.title",placeholder:F(X,"Click to enter radial axis title"),attributes:{x:Ke,y:Xe,"text-anchor":"middle"},transform:{rotate:-Ce}})}},U.updateAngularAxis=function(le,j){var J=this,$=J.gd,X=J.layers,re=J.radius,ee=J.innerRadius,q=J.cx,ae=J.cy,ie=J.getAngular(j),fe=J.angularAxis,we=J.isSmith;we||(J.fillViewInitialKey("angularaxis.rotation",ie.rotation),fe.setGeometry(),fe.setScale());var Ae=we?function(rt){var Je=z(J,m([0,rt.x]));return Math.atan2(Je[0]-q,Je[1]-ae)-Math.PI/2}:function(rt){return fe.t2g(rt.x)};fe.type==="linear"&&fe.thetaunit==="radians"&&(fe.tick0=L(fe.tick0),fe.dtick=L(fe.dtick));var Fe=function(rt){return t(q+re*Math.cos(rt),ae-re*Math.sin(rt))},Ce=we?function(rt){var Je=z(J,m([0,rt.x]));return t(Je[0],Je[1])}:function(rt){return Fe(Ae(rt))},qe=we?function(rt){var Je=z(J,m([0,rt.x])),At=Math.atan2(Je[0]-q,Je[1]-ae)-Math.PI/2;return t(Je[0],Je[1])+e(-L(At))}:function(rt){var Je=Ae(rt);return Fe(Je)+e(-L(Je))},et=we?function(rt){return R(J,rt.x,0,1/0)}:function(rt){var Je=Ae(rt),At=Math.cos(Je),St=Math.sin(Je);return"M"+[q+ee*At,ae-ee*St]+"L"+[q+re*At,ae-re*St]},Qe=i.makeLabelFns(fe,0),Ke=Qe.labelStandoff,Xe={};Xe.xFn=function(rt){var Je=Ae(rt);return Math.cos(Je)*Ke},Xe.yFn=function(rt){var Je=Ae(rt),At=Math.sin(Je)>0?.2:1;return-Math.sin(Je)*(Ke+rt.fontSize*At)+Math.abs(Math.cos(Je))*(rt.fontSize*w)},Xe.anchorFn=function(rt){var Je=Ae(rt),At=Math.cos(Je);return Math.abs(At)<.1?"middle":At>0?"start":"end"},Xe.heightFn=function(rt,Je,At){var St=Ae(rt);return-.5*(1+Math.sin(St))*At};var Me=Z(ie);J.angularTickLayout!==Me&&(X["angular-axis"].selectAll("."+fe._id+"tick").remove(),J.angularTickLayout=Me);var xe=we?[1/0].concat(fe.tickvals||[]).map(function(rt){return i.tickText(fe,rt,!0,!1)}):i.calcTicks(fe);we&&(xe[0].text="∞",xe[0].fontSize*=1.75);var ce;if(j.gridshape==="linear"?(ce=xe.map(Ae),E.angleDelta(ce[0],ce[1])<0&&(ce=ce.slice().reverse())):ce=null,J.vangles=ce,fe.type==="category"&&(xe=xe.filter(function(rt){return E.isAngleInsideSector(Ae(rt),J.sectorInRad)})),fe.visible){var Re=fe.ticks==="inside"?-1:1,$e=(fe.linewidth||1)/2;i.drawTicks($,fe,{vals:xe,layer:X["angular-axis"],path:"M"+Re*$e+",0h"+Re*fe.ticklen,transFn:qe,crisp:!1}),i.drawGrid($,fe,{vals:xe,layer:X["angular-grid"],path:et,transFn:E.noop,crisp:!1}),i.drawLabels($,fe,{vals:xe,layer:X["angular-axis"],repositionOnUpdate:!0,transFn:Ce,labelFns:Xe})}oe(X["angular-line"].select("path"),ie.showline,{d:J.pathSubplot(),transform:t(q,ae)}).attr("stroke-width",ie.linewidth).call(r.stroke,ie.linecolor)},U.updateFx=function(le,j){if(!this.gd._context.staticPlot){var J=!this.isSmith;J&&(this.updateAngularDrag(le),this.updateRadialDrag(le,j,0),this.updateRadialDrag(le,j,1)),this.updateHoverAndMainDrag(le)}},U.updateHoverAndMainDrag=function(le){var j=this,J=j.isSmith,$=j.gd,X=j.layers,re=le._zoomlayer,ee=p.MINZOOM,q=p.OFFEDGE,ae=j.radius,ie=j.innerRadius,fe=j.cx,we=j.cy,Ae=j.cxx,Fe=j.cyy,Ce=j.sectorInRad,qe=j.vangles,et=j.radialAxis,Qe=u.clampTiny,Ke=u.findXYatLength,Xe=u.findEnclosingVertexAngles,Me=p.cornerHalfWidth,xe=p.cornerLen/2,ce,Re,$e=f.makeDragger(X,"path","maindrag",le.dragmode===!1?"none":"crosshair");d.select($e).attr("d",j.pathSubplot()).attr("transform",t(fe,we)),$e.onmousemove=function(qt){h.hover($,qt,j.id),$._fullLayout._lasthover=$e,$._fullLayout._hoversubplot=j.id},$e.onmouseout=function(qt){$._dragging||v.unhover($,qt)};var rt={element:$e,gd:$,subplot:j.id,plotinfo:{id:j.id,xaxis:j.xaxis,yaxis:j.yaxis},xaxes:[j.xaxis],yaxes:[j.yaxis]},Je,At,St,Rt,Ut,ir,ar,Mr,fr;function dr(qt,Zt){return Math.sqrt(qt*qt+Zt*Zt)}function pt(qt,Zt){return dr(qt-Ae,Zt-Fe)}function ze(qt,Zt){return Math.atan2(Fe-Zt,qt-Ae)}function Ge(qt,Zt){return[qt*Math.cos(Zt),qt*Math.sin(-Zt)]}function Oe(qt,Zt){if(qt===0)return j.pathSector(2*Me);var lr=xe/qt,ta=Zt-lr,da=Zt+lr,wa=Math.max(0,Math.min(qt,ae)),ma=wa-Me,Ia=wa+Me;return"M"+Ge(ma,ta)+"A"+[ma,ma]+" 0,0,0 "+Ge(ma,da)+"L"+Ge(Ia,da)+"A"+[Ia,Ia]+" 0,0,1 "+Ge(Ia,ta)+"Z"}function ve(qt,Zt,lr){if(qt===0)return j.pathSector(2*Me);var ta=Ge(qt,Zt),da=Ge(qt,lr),wa=Qe((ta[0]+da[0])/2),ma=Qe((ta[1]+da[1])/2),Ia,va;if(wa&&ma){var La=ma/wa,Ka=-1/La,Vt=Ke(Me,La,wa,ma);Ia=Ke(xe,Ka,Vt[0][0],Vt[0][1]),va=Ke(xe,Ka,Vt[1][0],Vt[1][1])}else{var Lt,jt;ma?(Lt=xe,jt=Me):(Lt=Me,jt=xe),Ia=[[wa-Lt,ma-jt],[wa+Lt,ma-jt]],va=[[wa-Lt,ma+jt],[wa+Lt,ma+jt]]}return"M"+Ia.join("L")+"L"+va.reverse().join("L")+"Z"}function ge(){St=null,Rt=null,Ut=j.pathSubplot(),ir=!1;var qt=$._fullLayout[j.id];ar=x(qt.bgcolor).getLuminance(),Mr=f.makeZoombox(re,ar,fe,we,Ut),Mr.attr("fill-rule","evenodd"),fr=f.makeCorners(re,fe,we),b($)}function be(qt,Zt){return Zt=Math.max(Math.min(Zt,ae),ie),qtee?(qt-1&&qt===1&&y(Zt,$,[j.xaxis],[j.yaxis],j.id,rt),lr.indexOf("event")>-1&&h.click($,Zt,j.id)}rt.prepFn=function(qt,Zt,lr){var ta=$._fullLayout.dragmode,da=$e.getBoundingClientRect();$._fullLayout._calcInverseTransform($);var wa=$._fullLayout._invTransform;ce=$._fullLayout._invScaleX,Re=$._fullLayout._invScaleY;var ma=E.apply3DTransform(wa)(Zt-da.left,lr-da.top);if(Je=ma[0],At=ma[1],qe){var Ia=u.findPolygonOffset(ae,Ce[0],Ce[1],qe);Je+=Ae+Ia[0],At+=Fe+Ia[1]}switch(ta){case"zoom":rt.clickFn=Bt,J||(qe?rt.moveFn=_t:rt.moveFn=We,rt.doneFn=Mt,ge());break;case"select":case"lasso":l(qt,Zt,lr,rt,ta);break}},v.init(rt)},U.updateRadialDrag=function(le,j,J){var $=this,X=$.gd,re=$.layers,ee=$.radius,q=$.innerRadius,ae=$.cx,ie=$.cy,fe=$.radialAxis,we=p.radialDragBoxSize,Ae=we/2;if(!fe.visible)return;var Fe=O($.radialAxisAngle),Ce=fe._rl,qe=Ce[0],et=Ce[1],Qe=Ce[J],Ke=.75*(Ce[1]-Ce[0])/(1-$.getHole(j))/ee,Xe,Me,xe;J?(Xe=ae+(ee+Ae)*Math.cos(Fe),Me=ie-(ee+Ae)*Math.sin(Fe),xe="radialdrag"):(Xe=ae+(q-Ae)*Math.cos(Fe),Me=ie-(q-Ae)*Math.sin(Fe),xe="radialdrag-inner");var ce=f.makeRectDragger(re,xe,"crosshair",-Ae,-Ae,we,we),Re={element:ce,gd:X};le.dragmode===!1&&(Re.dragmode=!1),oe(d.select(ce),fe.visible&&q0!=(J?Je>qe:Je=90||X>90&&re>=450?Fe=1:q<=0&&ie<=0?Fe=0:Fe=Math.max(q,ie),X<=180&&re>=180||X>180&&re>=540?fe=-1:ee>=0&&ae>=0?fe=0:fe=Math.min(ee,ae),X<=270&&re>=270||X>270&&re>=630?we=-1:q>=0&&ie>=0?we=0:we=Math.min(q,ie),re>=360?Ae=1:ee<=0&&ae<=0?Ae=0:Ae=Math.max(ee,ae),[fe,we,Ae,Fe]}function ue(le,j){var J=function(X){return E.angleDist(le,X)},$=E.findIndexOfMin(j,J);return j[$]}function oe(le,j,J){return j?(le.attr("display",null),le.attr(J)):le&&le.attr("display","none"),le}}}),yA=He({"src/plots/polar/layout_attributes.js"(Y,G){var d=Xc(),x=jf(),A=mu().attributes,E=Gr().extendFlat,e=hu().overrideAll,t=e({color:x.color,showline:E({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:E({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({tickmode:x.minor.tickmode,nticks:x.nticks,tick0:x.tick0,dtick:x.dtick,tickvals:x.tickvals,ticktext:x.ticktext,ticks:x.ticks,ticklen:x.ticklen,tickwidth:x.tickwidth,tickcolor:x.tickcolor,ticklabelstep:x.ticklabelstep,showticklabels:x.showticklabels,labelalias:x.labelalias,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,showexponent:x.showexponent,exponentformat:x.exponentformat,minexponent:x.minexponent,separatethousands:x.separatethousands,tickfont:x.tickfont,tickangle:x.tickangle,tickformat:x.tickformat,tickformatstops:x.tickformatstops,layer:x.layer},"plot","from-root"),o={visible:E({},x.visible,{dflt:!0}),type:E({},x.type,{values:["-","linear","log","date","category"]}),autotypenumbers:x.autotypenumbers,autorangeoptions:{minallowed:x.autorangeoptions.minallowed,maxallowed:x.autorangeoptions.maxallowed,clipmin:x.autorangeoptions.clipmin,clipmax:x.autorangeoptions.clipmax,include:x.autorangeoptions.include,editType:"plot"},autorange:E({},x.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:E({},x.minallowed,{editType:"plot"}),maxallowed:E({},x.maxallowed,{editType:"plot"}),range:E({},x.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:x.categoryorder,categoryarray:x.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:x.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:E({},x.title.text,{editType:"plot",dflt:""}),font:E({},x.title.font,{editType:"plot"}),editType:"plot"},hoverformat:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(o,t,r);var a={visible:E({},x.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:x.autotypenumbers,categoryorder:x.categoryorder,categoryarray:x.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:x.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};E(a,t,r),G.exports={domain:A({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:d.background},radialaxis:o,angularaxis:a,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),tz=He({"src/plots/polar/layout_defaults.js"(Y,G){var d=Gr(),x=Ai(),A=Gs(),E=Xd(),e=Uf().getSubplotData,t=Ep(),r=O0(),o=Vd(),a=qd(),i=p1(),n=ay(),s=Sb(),c=N0(),f=yA(),v=dA(),h=yx(),T=h.axisNames;function l(b,S,M,_){var w=M("bgcolor");_.bgColor=x.combine(w,_.paper_bgcolor);var p=M("sector");M("hole");var u=e(_.fullData,h.name,_.id),g=_.layoutOut,m;function R(we,Ae){return M(m+"."+we,Ae)}for(var P=0;P")}}G.exports={hoverPoints:x,makeHoverPointText:A}}}),nz=He({"src/traces/scatterpolar/index.js"(Y,G){G.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:_x(),categories:["polar","symbols","showLegend","scatter-like"],attributes:$y(),supplyDefaults:xx().supplyDefaults,colorbar:ah(),formatLabels:bx(),calc:rz(),plot:az(),style:Ih().style,styleOnSelect:Ih().styleOnSelect,hoverPoints:wx().hoverPoints,selectPoints:W0(),meta:{}}}}),iz=He({"lib/scatterpolar.js"(Y,G){G.exports=nz()}}),mA=He({"src/traces/scatterpolargl/attributes.js"(Y,G){var d=$y(),x=qy(),A=Yo().texttemplateAttrs;G.exports={mode:d.mode,r:d.r,theta:d.theta,r0:d.r0,dr:d.dr,theta0:d.theta0,dtheta:d.dtheta,thetaunit:d.thetaunit,text:d.text,texttemplate:A({editType:"plot"},{keys:["r","theta","text"]}),hovertext:d.hovertext,hovertemplate:d.hovertemplate,line:{color:x.line.color,width:x.line.width,dash:x.line.dash,editType:"calc"},connectgaps:x.connectgaps,marker:x.marker,fill:x.fill,fillcolor:x.fillcolor,textposition:x.textposition,textfont:x.textfont,hoverinfo:d.hoverinfo,selected:d.selected,unselected:d.unselected}}}),oz=He({"src/traces/scatterpolargl/defaults.js"(Y,G){var d=Gr(),x=Rl(),A=xx().handleRThetaDefaults,E=Kh(),e=nv(),t=iv(),r=Av(),o=jv().PTS_LINESONLY,a=mA();G.exports=function(n,s,c,f){function v(T,l){return d.coerce(n,s,a,T,l)}var h=A(n,s,f,v);if(!h){s.visible=!1;return}v("thetaunit"),v("mode",h=r&&(_.marker.cluster=y.tree),_.marker&&(_.markerSel.positions=_.markerUnsel.positions=_.marker.positions=g),_.line&&g.length>1&&t.extendFlat(_.line,e.linePositions(i,l,g)),_.text&&(t.extendFlat(_.text,{positions:g},e.textPosition(i,l,_.text,_.marker)),t.extendFlat(_.textSel,{positions:g},e.textPosition(i,l,_.text,_.markerSel)),t.extendFlat(_.textUnsel,{positions:g},e.textPosition(i,l,_.text,_.markerUnsel))),_.fill&&!v.fill2d&&(v.fill2d=!0),_.marker&&!v.scatter2d&&(v.scatter2d=!0),_.line&&!v.line2d&&(v.line2d=!0),_.text&&!v.glText&&(v.glText=!0),v.lineOptions.push(_.line),v.fillOptions.push(_.fill),v.markerOptions.push(_.marker),v.markerSelectedOptions.push(_.markerSel),v.markerUnselectedOptions.push(_.markerUnsel),v.textOptions.push(_.text),v.textSelectedOptions.push(_.textSel),v.textUnselectedOptions.push(_.textUnsel),v.selectBatch.push([]),v.unselectBatch.push([]),y.x=m,y.y=R,y.rawx=m,y.rawy=R,y.r=S,y.theta=M,y.positions=g,y._scene=v,y.index=v.count,v.count++}}),A(i,n,s)}},G.exports.reglPrecompiled=o}}),hz=He({"src/traces/scatterpolargl/index.js"(Y,G){var d=cz();d.plot=fz(),G.exports=d}}),vz=He({"lib/scatterpolargl.js"(Y,G){G.exports=hz()}}),_A=He({"src/traces/barpolar/attributes.js"(Y,G){var d=Yo().hovertemplateAttrs,x=ho().extendFlat,A=$y(),E=qv();G.exports={r:A.r,theta:A.theta,r0:A.r0,dr:A.dr,theta0:A.theta0,dtheta:A.dtheta,thetaunit:A.thetaunit,base:x({},E.base,{}),offset:x({},E.offset,{}),width:x({},E.width,{}),text:x({},E.text,{}),hovertext:x({},E.hovertext,{}),marker:e(),hoverinfo:A.hoverinfo,hovertemplate:d(),selected:E.selected,unselected:E.unselected};function e(){var t=x({},E.marker);return delete t.cornerradius,t}}}),xA=He({"src/traces/barpolar/layout_attributes.js"(Y,G){G.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),dz=He({"src/traces/barpolar/defaults.js"(Y,G){var d=Gr(),x=xx().handleRThetaDefaults,A=A1(),E=_A();G.exports=function(t,r,o,a){function i(s,c){return d.coerce(t,r,E,s,c)}var n=x(t,r,a,i);if(!n){r.visible=!1;return}i("thetaunit"),i("base"),i("offset"),i("width"),i("text"),i("hovertext"),i("hovertemplate"),A(t,r,i,o,a),d.coerceSelectionMarkerOpacity(r,i)}}}),pz=He({"src/traces/barpolar/layout_defaults.js"(Y,G){var d=Gr(),x=xA();G.exports=function(A,E,e){var t={},r;function o(n,s){return d.coerce(A[r]||{},E[r],x,n,s)}for(var a=0;a0?(f=s,v=c):(f=c,v=s);var h=e.findEnclosingVertexAngles(f,r.vangles)[0],T=e.findEnclosingVertexAngles(v,r.vangles)[1],l=[h,(f+v)/2,T];return e.pathPolygonAnnulus(i,n,f,v,l,o,a)}:function(i,n,s,c){return A.pathAnnulus(i,n,s,c,o,a)}}}}),yz=He({"src/traces/barpolar/hover.js"(Y,G){var d=Wu(),x=Gr(),A=Z0().getTraceColor,E=x.fillText,e=wx().makeHoverPointText,t=mx().isPtInsidePolygon;G.exports=function(o,a,i){var n=o.cd,s=n[0].trace,c=o.subplot,f=c.radialAxis,v=c.angularAxis,h=c.vangles,T=h?t:x.isPtInsideSector,l=o.maxHoverDistance,y=v._period||2*Math.PI,b=Math.abs(f.g2p(Math.sqrt(a*a+i*i))),S=Math.atan2(i,a);f.range[0]>f.range[1]&&(S+=Math.PI);var M=function(u){return T(b,S,[u.rp0,u.rp1],[u.thetag0,u.thetag1],h)?l+Math.min(1,Math.abs(u.thetag1-u.thetag0)/y)-1+(u.rp1-b)/(u.rp1-u.rp0)-1:1/0};if(d.getClosest(n,M,o),o.index!==!1){var _=o.index,w=n[_];o.x0=o.x1=w.ct[0],o.y0=o.y1=w.ct[1];var p=x.extendFlat({},w,{r:w.s,theta:w.p});return E(w,s,o),e(p,s,c,o),o.hovertemplate=s.hovertemplate,o.color=A(s,w),o.xLabelVal=o.yLabelVal=void 0,w.s<0&&(o.idealAlign="left"),[o]}}}}),mz=He({"src/traces/barpolar/index.js"(Y,G){G.exports={moduleType:"trace",name:"barpolar",basePlotModule:_x(),categories:["polar","bar","showLegend"],attributes:_A(),layoutAttributes:xA(),supplyDefaults:dz(),supplyLayoutDefaults:pz(),calc:bA().calc,crossTraceCalc:bA().crossTraceCalc,plot:gz(),colorbar:ah(),formatLabels:bx(),style:uv().style,styleOnSelect:uv().styleOnSelect,hoverPoints:yz(),selectPoints:X0(),meta:{}}}}),_z=He({"lib/barpolar.js"(Y,G){G.exports=mz()}}),wA=He({"src/plots/smith/constants.js"(Y,G){G.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),TA=He({"src/plots/smith/layout_attributes.js"(Y,G){var d=Xc(),x=jf(),A=mu().attributes,E=Gr().extendFlat,e=hu().overrideAll,t=e({color:x.color,showline:E({},x.showline,{dflt:!0}),linecolor:x.linecolor,linewidth:x.linewidth,showgrid:E({},x.showgrid,{dflt:!0}),gridcolor:x.gridcolor,gridwidth:x.gridwidth,griddash:x.griddash},"plot","from-root"),r=e({ticklen:x.ticklen,tickwidth:E({},x.tickwidth,{dflt:2}),tickcolor:x.tickcolor,showticklabels:x.showticklabels,labelalias:x.labelalias,showtickprefix:x.showtickprefix,tickprefix:x.tickprefix,showticksuffix:x.showticksuffix,ticksuffix:x.ticksuffix,tickfont:x.tickfont,tickformat:x.tickformat,hoverformat:x.hoverformat,layer:x.layer},"plot","from-root"),o=E({visible:E({},x.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:E({},x.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},t,r),a=E({visible:E({},x.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:x.ticks,editType:"calc"},t,r);G.exports={domain:A({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:d.background},realaxis:o,imaginaryaxis:a,editType:"calc"}}}),xz=He({"src/plots/smith/layout_defaults.js"(Y,G){var d=Gr(),x=Ai(),A=Gs(),E=Xd(),e=Uf().getSubplotData,t=qd(),r=Vd(),o=ay(),a=Uv(),i=TA(),n=wA(),s=n.axisNames,c=v(function(h){return d.isTypedArray(h)&&(h=Array.from(h)),h.slice().reverse().map(function(T){return-T}).concat([0]).concat(h)},String);function f(h,T,l,y){var b=l("bgcolor");y.bgColor=x.combine(b,y.paper_bgcolor);var S=e(y.fullData,n.name,y.id),M=y.layoutOut,_;function w(U,Z){return l(_+"."+U,Z)}for(var p=0;p")}}G.exports={hoverPoints:x,makeHoverPointText:A}}}),Ez=He({"src/traces/scattersmith/index.js"(Y,G){G.exports={moduleType:"trace",name:"scattersmith",basePlotModule:bz(),categories:["smith","symbols","showLegend","scatter-like"],attributes:AA(),supplyDefaults:wz(),colorbar:ah(),formatLabels:Tz(),calc:Az(),plot:Sz(),style:Ih().style,styleOnSelect:Ih().styleOnSelect,hoverPoints:Mz().hoverPoints,selectPoints:W0(),meta:{}}}}),kz=He({"lib/scattersmith.js"(Y,G){G.exports=Ez()}}),vh=He({"node_modules/world-calendars/dist/main.js"(Y,G){var d=Yc();function x(){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={}}d(x.prototype,{instance:function(o,a){o=(o||"gregorian").toLowerCase(),a=a||"";var i=this._localCals[o+"-"+a];if(!i&&this.calendars[o]&&(i=new this.calendars[o](a),this._localCals[o+"-"+a]=i),!i)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,o);return i},newDate:function(o,a,i,n,s){return n=(o!=null&&o.year?o.calendar():typeof n=="string"?this.instance(n,s):n)||this.instance(),n.newDate(o,a,i)},substituteDigits:function(o){return function(a){return(a+"").replace(/[0-9]/g,function(i){return o[i]})}},substituteChineseDigits:function(o,a){return function(i){for(var n="",s=0;i>0;){var c=i%10;n=(c===0?"":o[c]+a[s])+n,s++,i=Math.floor(i/10)}return n.indexOf(o[1]+a[1])===0&&(n=n.substr(1)),n||o[0]}}});function A(o,a,i,n){if(this._calendar=o,this._year=a,this._month=i,this._day=n,this._calendar._validateLevel===0&&!this._calendar.isValid(this._year,this._month,this._day))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function E(o,a){return o=""+o,"000000".substring(0,a-o.length)+o}d(A.prototype,{newDate:function(o,a,i){return this._calendar.newDate(o??this,a,i)},year:function(o){return arguments.length===0?this._year:this.set(o,"y")},month:function(o){return arguments.length===0?this._month:this.set(o,"m")},day:function(o){return arguments.length===0?this._day:this.set(o,"d")},date:function(o,a,i){if(!this._calendar.isValid(o,a,i))throw(r.local.invalidDate||r.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=o,this._month=a,this._day=i,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(o,a){return this._calendar.add(this,o,a)},set:function(o,a){return this._calendar.set(this,o,a)},compareTo:function(o){if(this._calendar.name!==o._calendar.name)throw(r.local.differentCalendars||r.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,o._calendar.local.name);var a=this._year!==o._year?this._year-o._year:this._month!==o._month?this.monthOfYear()-o.monthOfYear():this._day-o._day;return a===0?0:a<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(o){return this._calendar.fromJD(o)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(o){return this._calendar.fromJSDate(o)},toString:function(){return(this.year()<0?"-":"")+E(Math.abs(this.year()),4)+"-"+E(this.month(),2)+"-"+E(this.day(),2)}});function e(){this.shortYearCutoff="+10"}d(e.prototype,{_validateLevel:0,newDate:function(o,a,i){return o==null?this.today():(o.year&&(this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),i=o.day(),a=o.month(),o=o.year()),new A(this,o,a,i))},today:function(){return this.fromJSDate(new Date)},epoch:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return a.year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return(a.year()<0?"-":"")+E(Math.abs(a.year()),4)},monthsInYear:function(o){return this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear),12},monthOfYear:function(o,a){var i=this._validate(o,a,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth);return(i.month()+this.monthsInYear(i)-this.firstMonth)%this.monthsInYear(i)+this.minMonth},fromMonthOfYear:function(o,a){var i=(a+this.firstMonth-2*this.minMonth)%this.monthsInYear(o)+this.minMonth;return this._validate(o,i,this.minDay,r.local.invalidMonth||r.regionalOptions[""].invalidMonth),i},daysInYear:function(o){var a=this._validate(o,this.minMonth,this.minDay,r.local.invalidYear||r.regionalOptions[""].invalidYear);return this.leapYear(a)?366:365},dayOfYear:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(o,a,i){return this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),{}},add:function(o,a,i){return this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate),this._correctAdd(o,this._add(o,a,i),a,i)},_add:function(o,a,i){if(this._validateLevel++,i==="d"||i==="w"){var n=o.toJD()+a*(i==="w"?this.daysInWeek():1),s=o.calendar().fromJD(n);return this._validateLevel--,[s.year(),s.month(),s.day()]}try{var c=o.year()+(i==="y"?a:0),f=o.monthOfYear()+(i==="m"?a:0),s=o.day(),v=function(l){for(;fy-1+l.minMonth;)c++,f-=y,y=l.monthsInYear(c)};i==="y"?(o.month()!==this.fromMonthOfYear(c,f)&&(f=this.newDate(c,o.month(),this.minDay).monthOfYear()),f=Math.min(f,this.monthsInYear(c)),s=Math.min(s,this.daysInMonth(c,this.fromMonthOfYear(c,f)))):i==="m"&&(v(this),s=Math.min(s,this.daysInMonth(c,this.fromMonthOfYear(c,f))));var h=[c,this.fromMonthOfYear(c,f),s];return this._validateLevel--,h}catch(T){throw this._validateLevel--,T}},_correctAdd:function(o,a,i,n){if(!this.hasYearZero&&(n==="y"||n==="m")&&(a[0]===0||o.year()>0!=a[0]>0)){var s={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],c=i<0?-1:1;a=this._add(o,i*s[0]+c*s[1],s[2])}return o.date(a[0],a[1],a[2])},set:function(o,a,i){this._validate(o,this.minMonth,this.minDay,r.local.invalidDate||r.regionalOptions[""].invalidDate);var n=i==="y"?a:o.year(),s=i==="m"?a:o.month(),c=i==="d"?a:o.day();return(i==="y"||i==="m")&&(c=Math.min(c,this.daysInMonth(n,s))),o.date(n,s,c)},isValid:function(o,a,i){this._validateLevel++;var n=this.hasYearZero||o!==0;if(n){var s=this.newDate(o,a,this.minDay);n=a>=this.minMonth&&a-this.minMonth=this.minDay&&i-this.minDay13.5?13:1),T=s-(h>2.5?4716:4715);return T<=0&&T--,this.newDate(T,h,v)},toJSDate:function(o,a,i){var n=this._validate(o,a,i,r.local.invalidDate||r.regionalOptions[""].invalidDate),s=new Date(n.year(),n.month()-1,n.day());return s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0),s.setHours(s.getHours()>12?s.getHours()+2:0),s},fromJSDate:function(o){return this.newDate(o.getFullYear(),o.getMonth()+1,o.getDate())}});var r=G.exports=new x;r.cdate=A,r.baseCalendar=e,r.calendars.gregorian=t}}),Cz=He({"node_modules/world-calendars/dist/plus.js"(){var Y=Yc(),G=vh();Y(G.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"}),G.local=G.regionalOptions[""],Y(G.cdate.prototype,{formatDate:function(d,x){return typeof d!="string"&&(x=d,d=""),this._calendar.formatDate(d||"",this,x)}}),Y(G.baseCalendar.prototype,{UNIX_EPOCH:G.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:24*60*60,TICKS_EPOCH:G.instance().jdEpoch,TICKS_PER_DAY:24*60*60*1e7,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(d,x,A){if(typeof d!="string"&&(A=x,x=d,d=""),!x)return"";if(x.calendar()!==this)throw G.local.invalidFormat||G.regionalOptions[""].invalidFormat;d=d||this.local.dateFormat,A=A||{};var E=A.dayNamesShort||this.local.dayNamesShort,e=A.dayNames||this.local.dayNames,t=A.monthNumbers||this.local.monthNumbers,r=A.monthNamesShort||this.local.monthNamesShort,o=A.monthNames||this.local.monthNames;A.calculateWeek||this.local.calculateWeek;for(var a=function(b,S){for(var M=1;y+M1},i=function(b,S,M,_){var w=""+S;if(a(b,_))for(;w.length1},y=function(R,P){var z=l(R,P),F=[2,3,z?4:2,z?4:2,10,11,20]["oyYJ@!".indexOf(R)+1],B=new RegExp("^-?\\d{1,"+F+"}"),O=x.substring(p).match(B);if(!O)throw(G.local.missingNumberAt||G.regionalOptions[""].missingNumberAt).replace(/\{0\}/,p);return p+=O[0].length,parseInt(O[0],10)},b=this,S=function(){if(typeof o=="function"){l("m");var R=o.call(b,x.substring(p));return p+=R.length,R}return y("m")},M=function(R,P,z,F){for(var B=l(R,F)?z:P,O=0;O-1){c=1,f=v;for(var m=this.daysInMonth(s,c);f>m;m=this.daysInMonth(s,c))c++,f-=m}return n>-1?this.fromJD(n):this.newDate(s,c,f)},determineDate:function(d,x,A,E,e){A&&typeof A!="object"&&(e=E,E=A,A=null),typeof E!="string"&&(e=E,E="");var t=this,r=function(o){try{return t.parseDate(E,o,e)}catch{}o=o.toLowerCase();for(var a=(o.match(/^c/)&&A?A.newDate():null)||t.today(),i=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,n=i.exec(o);n;)a.add(parseInt(n[1],10),n[2]||"d"),n=i.exec(o);return a};return x=x?x.newDate():null,d=d==null?x:typeof d=="string"?r(d):typeof d=="number"?isNaN(d)||d===1/0||d===-1/0?x:t.today().add(d,"d"):t.newDate(d),d}})}}),Lz=He({"node_modules/world-calendars/dist/calendars/chinese.js"(){var Y=vh(),G=Yc(),d=Y.instance();function x(n){this.local=this.regionalOptions[n||""]||this.regionalOptions[""]}x.prototype=new Y.baseCalendar,G(x.prototype,{name:"Chinese",jdEpoch:17214255e-1,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(n,s){if(typeof n=="string"){var c=n.match(E);return c?c[0]:""}var f=this._validateYear(n),v=n.month(),h=""+this.toChineseMonth(f,v);return s&&h.length<2&&(h="0"+h),this.isIntercalaryMonth(f,v)&&(h+="i"),h},monthNames:function(n){if(typeof n=="string"){var s=n.match(e);return s?s[0]:""}var c=this._validateYear(n),f=n.month(),v=this.toChineseMonth(c,f),h=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"][v-1];return this.isIntercalaryMonth(c,f)&&(h="闰"+h),h},monthNamesShort:function(n){if(typeof n=="string"){var s=n.match(t);return s?s[0]:""}var c=this._validateYear(n),f=n.month(),v=this.toChineseMonth(c,f),h=["一","二","三","四","五","六","七","八","九","十","十一","十二"][v-1];return this.isIntercalaryMonth(c,f)&&(h="闰"+h),h},parseMonth:function(n,s){n=this._validateYear(n);var c=parseInt(s),f;if(isNaN(c))s[0]==="闰"&&(f=!0,s=s.substring(1)),s[s.length-1]==="月"&&(s=s.substring(0,s.length-1)),c=1+["一","二","三","四","五","六","七","八","九","十","十一","十二"].indexOf(s);else{var v=s[s.length-1];f=v==="i"||v==="I"}var h=this.toMonthIndex(n,c,f);return h},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(n,s){if(n.year&&(n=n.year()),typeof n!="number"||n<1888||n>2111)throw s.replace(/\{0\}/,this.local.name);return n},toMonthIndex:function(n,s,c){var f=this.intercalaryMonth(n),v=c&&s!==f;if(v||s<1||s>12)throw Y.local.invalidMonth.replace(/\{0\}/,this.local.name);var h;return f?!c&&s<=f?h=s-1:h=s:h=s-1,h},toChineseMonth:function(n,s){n.year&&(n=n.year(),s=n.month());var c=this.intercalaryMonth(n),f=c?12:11;if(s<0||s>f)throw Y.local.invalidMonth.replace(/\{0\}/,this.local.name);var v;return c?s>13;return c},isIntercalaryMonth:function(n,s){n.year&&(n=n.year(),s=n.month());var c=this.intercalaryMonth(n);return!!c&&c===s},leapYear:function(n){return this.intercalaryMonth(n)!==0},weekOfYear:function(n,s,c){var f=this._validateYear(n,Y.local.invalidyear),v=o[f-o[0]],h=v>>9&4095,T=v>>5&15,l=v&31,y;y=d.newDate(h,T,l),y.add(4-(y.dayOfWeek()||7),"d");var b=this.toJD(n,s,c)-y.toJD();return 1+Math.floor(b/7)},monthsInYear:function(n){return this.leapYear(n)?13:12},daysInMonth:function(n,s){n.year&&(s=n.month(),n=n.year()),n=this._validateYear(n);var c=r[n-r[0]],f=c>>13,v=f?12:11;if(s>v)throw Y.local.invalidMonth.replace(/\{0\}/,this.local.name);var h=c&1<<12-s?30:29;return h},weekDay:function(n,s,c){return(this.dayOfWeek(n,s,c)||7)<6},toJD:function(n,s,c){var f=this._validate(n,h,c,Y.local.invalidDate);n=this._validateYear(f.year()),s=f.month(),c=f.day();var v=this.isIntercalaryMonth(n,s),h=this.toChineseMonth(n,s),T=i(n,h,c,v);return d.toJD(T.year,T.month,T.day)},fromJD:function(n){var s=d.fromJD(n),c=a(s.year(),s.month(),s.day()),f=this.toMonthIndex(c.year,c.month,c.isIntercalary);return this.newDate(c.year,f,c.day)},fromString:function(n){var s=n.match(A),c=this._validateYear(+s[1]),f=+s[2],v=!!s[3],h=this.toMonthIndex(c,f,v),T=+s[4];return this.newDate(c,h,T)},add:function(n,s,c){var f=n.year(),v=n.month(),h=this.isIntercalaryMonth(f,v),T=this.toChineseMonth(f,v),l=Object.getPrototypeOf(x.prototype).add.call(this,n,s,c);if(c==="y"){var y=l.year(),b=l.month(),S=this.isIntercalaryMonth(y,T),M=h&&S?this.toMonthIndex(y,T,!0):this.toMonthIndex(y,T,!1);M!==b&&l.month(M)}return l}});var A=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,E=/^\d?\d[iI]?/m,e=/^闰?十?[一二三四五六七八九]?月/m,t=/^闰?十?[一二三四五六七八九]?/m;Y.calendars.chinese=x;var r=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],o=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904];function a(n,s,c,f){var v,h;if(typeof n=="object")v=n,h=s||{};else{var T=typeof n=="number"&&n>=1888&&n<=2111;if(!T)throw new Error("Solar year outside range 1888-2111");var l=typeof s=="number"&&s>=1&&s<=12;if(!l)throw new Error("Solar month outside range 1 - 12");var y=typeof c=="number"&&c>=1&&c<=31;if(!y)throw new Error("Solar day outside range 1 - 31");v={year:n,month:s,day:c},h={}}var b=o[v.year-o[0]],S=v.year<<9|v.month<<5|v.day;h.year=S>=b?v.year:v.year-1,b=o[h.year-o[0]];var M=b>>9&4095,_=b>>5&15,w=b&31,p,u=new Date(M,_-1,w),g=new Date(v.year,v.month-1,v.day);p=Math.round((g-u)/(24*3600*1e3));var m=r[h.year-r[0]],R;for(R=0;R<13;R++){var P=m&1<<12-R?30:29;if(p>13;return!z||R=1888&&n<=2111;if(!l)throw new Error("Lunar year outside range 1888-2111");var y=typeof s=="number"&&s>=1&&s<=12;if(!y)throw new Error("Lunar month outside range 1 - 12");var b=typeof c=="number"&&c>=1&&c<=30;if(!b)throw new Error("Lunar day outside range 1 - 30");var S;typeof f=="object"?(S=!1,h=f):(S=!!f,h={}),T={year:n,month:s,day:c,isIntercalary:S}}var M;M=T.day-1;var _=r[T.year-r[0]],w=_>>13,p;w&&(T.month>w||T.isIntercalary)?p=T.month:p=T.month-1;for(var u=0;u>9&4095,P=m>>5&15,z=m&31,F=new Date(R,P-1,z+M);return h.year=F.getFullYear(),h.month=1+F.getMonth(),h.day=F.getDate(),h}}}),Pz=He({"node_modules/world-calendars/dist/calendars/coptic.js"(){var Y=vh(),G=Yc();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.prototype,{name:"Coptic",jdEpoch:18250295e-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:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(E){var A=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),E=A.year()+(A.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear||Y.regionalOptions[""].invalidYear),13},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return(this.dayOfWeek(x,A,E)||7)<6},toJD:function(x,A,E){var e=this._validate(x,A,E,Y.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var A=Math.floor(x)+.5-this.jdEpoch,E=Math.floor((A-Math.floor((A+366)/1461))/365)+1;E<=0&&E--,A=Math.floor(x)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(A/30)+1,t=A-(e-1)*30+1;return this.newDate(E,e,t)}}),Y.calendars.coptic=d}}),Iz=He({"node_modules/world-calendars/dist/calendars/discworld.js"(){var Y=vh(),G=Yc();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.prototype,{name:"Discworld",jdEpoch:17214255e-1,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(A){return this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear),!1},monthsInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear),13},daysInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear),400},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/8)+1},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);return(t.day()+1)%8},weekDay:function(A,E,e){var t=this.dayOfWeek(A,E,e);return t>=2&&t<=6},extraInfo:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);return{century:x[Math.floor((t.year()-1)/100)+1]||""}},toJD:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);return A=t.year()+(t.year()<0?1:0),E=t.month(),e=t.day(),e+(E>1?16:0)+(E>2?(E-2)*32:0)+(A-1)*400+this.jdEpoch-1},fromJD:function(A){A=Math.floor(A+.5)-Math.floor(this.jdEpoch)-1;var E=Math.floor(A/400)+1;A-=(E-1)*400,A+=A>15?16:0;var e=Math.floor(A/32)+1,t=A-(e-1)*32+1;return this.newDate(E<=0?E-1:E,e,t)}});var x={20:"Fruitbat",21:"Anchovy"};Y.calendars.discworld=d}}),Rz=He({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var Y=vh(),G=Yc();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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(E){var A=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),E=A.year()+(A.year()<0?1:0);return E%4===3||E%4===-1},monthsInYear:function(x){return this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear||Y.regionalOptions[""].invalidYear),13},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===13&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return(this.dayOfWeek(x,A,E)||7)<6},toJD:function(x,A,E){var e=this._validate(x,A,E,Y.local.invalidDate);return x=e.year(),x<0&&x++,e.day()+(e.month()-1)*30+(x-1)*365+Math.floor(x/4)+this.jdEpoch-1},fromJD:function(x){var A=Math.floor(x)+.5-this.jdEpoch,E=Math.floor((A-Math.floor((A+366)/1461))/365)+1;E<=0&&E--,A=Math.floor(x)+.5-this.newDate(E,1,1).toJD();var e=Math.floor(A/30)+1,t=A-(e-1)*30+1;return this.newDate(E,e,t)}}),Y.calendars.ethiopian=d}}),Dz=He({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var Y=vh(),G=Yc();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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(A){var E=this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear);return this._leapYear(E.year())},_leapYear:function(A){return A=A<0?A+1:A,x(A*7+1,19)<7},monthsInYear:function(A){return this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear),this._leapYear(A.year?A.year():A)?13:12},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear);return A=E.year(),this.toJD(A===-1?1:A+1,7,1)-this.toJD(A,7,1)},daysInMonth:function(A,E){return A.year&&(E=A.month(),A=A.year()),this._validate(A,E,this.minDay,Y.local.invalidMonth),E===12&&this.leapYear(A)||E===8&&x(this.daysInYear(A),10)===5?30:E===9&&x(this.daysInYear(A),10)===3?29:this.daysPerMonth[E-1]},weekDay:function(A,E,e){return this.dayOfWeek(A,E,e)!==6},extraInfo:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);return{yearType:(this.leapYear(t)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(t)%10-3]}},toJD:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);A=t.year(),E=t.month(),e=t.day();var r=A<=0?A+1:A,o=this.jdEpoch+this._delay1(r)+this._delay2(r)+e+1;if(E<7){for(var a=7;a<=this.monthsInYear(A);a++)o+=this.daysInMonth(A,a);for(var a=1;a=this.toJD(E===-1?1:E+1,7,1);)E++;for(var e=Athis.toJD(E,e,this.daysInMonth(E,e));)e++;var t=A-this.toJD(E,e,1)+1;return this.newDate(E,e,t)}});function x(A,E){return A-E*Math.floor(A/E)}Y.calendars.hebrew=d}}),zz=He({"node_modules/world-calendars/dist/calendars/islamic.js"(){var Y=vh(),G=Yc();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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īs","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(x){var A=this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear);return(A.year()*11+14)%30<11},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){return this.leapYear(x)?355:354},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===12&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return this.dayOfWeek(x,A,E)!==5},toJD:function(x,A,E){var e=this._validate(x,A,E,Y.local.invalidDate);return x=e.year(),A=e.month(),E=e.day(),x=x<=0?x+1:x,E+Math.ceil(29.5*(A-1))+(x-1)*354+Math.floor((3+11*x)/30)+this.jdEpoch-1},fromJD:function(x){x=Math.floor(x)+.5;var A=Math.floor((30*(x-this.jdEpoch)+10646)/10631);A=A<=0?A-1:A;var E=Math.min(12,Math.ceil((x-29-this.toJD(A,1,1))/29.5)+1),e=x-this.toJD(A,E,1)+1;return this.newDate(A,E,e)}}),Y.calendars.islamic=d}}),Fz=He({"node_modules/world-calendars/dist/calendars/julian.js"(){var Y=vh(),G=Yc();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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(E){var A=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),E=A.year()<0?A.year()+1:A.year();return E%4===0},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(4-(e.dayOfWeek()||7),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInMonth:function(x,A){var E=this._validate(x,A,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[E.month()-1]+(E.month()===2&&this.leapYear(E.year())?1:0)},weekDay:function(x,A,E){return(this.dayOfWeek(x,A,E)||7)<6},toJD:function(x,A,E){var e=this._validate(x,A,E,Y.local.invalidDate);return x=e.year(),A=e.month(),E=e.day(),x<0&&x++,A<=2&&(x--,A+=12),Math.floor(365.25*(x+4716))+Math.floor(30.6001*(A+1))+E-1524.5},fromJD:function(x){var A=Math.floor(x+.5),E=A+1524,e=Math.floor((E-122.1)/365.25),t=Math.floor(365.25*e),r=Math.floor((E-t)/30.6001),o=r-Math.floor(r<14?1:13),a=e-Math.floor(o>2?4716:4715),i=E-t-Math.floor(30.6001*r);return a<=0&&a--,this.newDate(a,o,i)}}),Y.calendars.julian=d}}),Oz=He({"node_modules/world-calendars/dist/calendars/mayan.js"(){var Y=vh(),G=Yc();function d(E){this.local=this.regionalOptions[E||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(E){return this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),!1},formatYear:function(E){var e=this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear);E=e.year();var t=Math.floor(E/400);E=E%400,E+=E<0?400:0;var r=Math.floor(E/20);return t+"."+r+"."+E%20},forYear:function(E){if(E=E.split("."),E.length<3)throw"Invalid Mayan year";for(var e=0,t=0;t19||t>0&&r<0)throw"Invalid Mayan year";e=e*20+r}return e},monthsInYear:function(E){return this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),18},weekOfYear:function(E,e,t){return this._validate(E,e,t,Y.local.invalidDate),0},daysInYear:function(E){return this._validate(E,this.minMonth,this.minDay,Y.local.invalidYear),360},daysInMonth:function(E,e){return this._validate(E,e,this.minDay,Y.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(E,e,t){var r=this._validate(E,e,t,Y.local.invalidDate);return r.day()},weekDay:function(E,e,t){return this._validate(E,e,t,Y.local.invalidDate),!0},extraInfo:function(E,e,t){var r=this._validate(E,e,t,Y.local.invalidDate),o=r.toJD(),a=this._toHaab(o),i=this._toTzolkin(o);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[i[0]-1],tzolkinDay:i[0],tzolkinTrecena:i[1]}},_toHaab:function(E){E-=this.jdEpoch;var e=x(E+8+17*20,365);return[Math.floor(e/20)+1,x(e,20)]},_toTzolkin:function(E){return E-=this.jdEpoch,[A(E+20,20),A(E+4,13)]},toJD:function(E,e,t){var r=this._validate(E,e,t,Y.local.invalidDate);return r.day()+r.month()*20+r.year()*360+this.jdEpoch},fromJD:function(E){E=Math.floor(E)+.5-this.jdEpoch;var e=Math.floor(E/360);E=E%360,E+=E<0?360:0;var t=Math.floor(E/20),r=E%20;return this.newDate(e,t,r)}});function x(E,e){return E-e*Math.floor(E/e)}function A(E,e){return x(E-1,e)+1}Y.calendars.mayan=d}}),Bz=He({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var Y=vh(),G=Yc();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar;var x=Y.instance("gregorian");G(d.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(A){var E=this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear||Y.regionalOptions[""].invalidYear);return x.leapYear(E.year()+(E.year()<1?1:0)+1469)},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(1-(t.dayOfWeek()||7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return(this.dayOfWeek(A,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Y.local.invalidMonth),r=t.year();r<0&&r++;for(var o=t.day(),a=1;a=this.toJD(E+1,1,1);)E++;for(var e=A-Math.floor(this.toJD(E,1,1)+.5)+1,t=1;e>this.daysInMonth(E,t);)e-=this.daysInMonth(E,t),t++;return this.newDate(E,t,e)}}),Y.calendars.nanakshahi=d}}),Nz=He({"node_modules/world-calendars/dist/calendars/nepali.js"(){var Y=vh(),G=Yc();function d(x){this.local=this.regionalOptions[x||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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(x){return this.daysInYear(x)!==this.daysPerYear},weekOfYear:function(x,A,E){var e=this.newDate(x,A,E);return e.add(-e.dayOfWeek(),"d"),Math.floor((e.dayOfYear()-1)/7)+1},daysInYear:function(x){var A=this._validate(x,this.minMonth,this.minDay,Y.local.invalidYear);if(x=A.year(),typeof this.NEPALI_CALENDAR_DATA[x]>"u")return this.daysPerYear;for(var E=0,e=this.minMonth;e<=12;e++)E+=this.NEPALI_CALENDAR_DATA[x][e];return E},daysInMonth:function(x,A){return x.year&&(A=x.month(),x=x.year()),this._validate(x,A,this.minDay,Y.local.invalidMonth),typeof this.NEPALI_CALENDAR_DATA[x]>"u"?this.daysPerMonth[A-1]:this.NEPALI_CALENDAR_DATA[x][A]},weekDay:function(x,A,E){return this.dayOfWeek(x,A,E)!==6},toJD:function(x,A,E){var e=this._validate(x,A,E,Y.local.invalidDate);x=e.year(),A=e.month(),E=e.day();var t=Y.instance(),r=0,o=A,a=x;this._createMissingCalendarData(x);var i=x-(o>9||o===9&&E>=this.NEPALI_CALENDAR_DATA[a][0]?56:57);for(A!==9&&(r=E,o--);o!==9;)o<=0&&(o=12,a--),r+=this.NEPALI_CALENDAR_DATA[a][o],o--;return A===9?(r+=E-this.NEPALI_CALENDAR_DATA[a][0],r<0&&(r+=t.daysInYear(i))):r+=this.NEPALI_CALENDAR_DATA[a][9]-this.NEPALI_CALENDAR_DATA[a][0],t.newDate(i,1,1).add(r,"d").toJD()},fromJD:function(x){var A=Y.instance(),E=A.fromJD(x),e=E.year(),t=E.dayOfYear(),r=e+56;this._createMissingCalendarData(r);for(var o=9,a=this.NEPALI_CALENDAR_DATA[r][0],i=this.NEPALI_CALENDAR_DATA[r][o]-a+1;t>i;)o++,o>12&&(o=1,r++),i+=this.NEPALI_CALENDAR_DATA[r][o];var n=this.NEPALI_CALENDAR_DATA[r][o]-(i-t);return this.newDate(r,o,n)},_createMissingCalendarData:function(x){var A=this.daysPerMonth.slice(0);A.unshift(17);for(var E=x-1;E"u"&&(this.NEPALI_CALENDAR_DATA[E]=A)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),Y.calendars.nepali=d}}),Uz=He({"node_modules/world-calendars/dist/calendars/persian.js"(){var Y=vh(),G=Yc();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.prototype,{name:"Persian",jdEpoch:19483205e-1,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Chæharshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Chæ","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear);return((E.year()-(E.year()>0?474:473))%2820+474+38)*682%2816<682},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-((t.dayOfWeek()+1)%7),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===12&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return this.dayOfWeek(A,E,e)!==5},toJD:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate);A=t.year(),E=t.month(),e=t.day();var r=A-(A>=0?474:473),o=474+x(r,2820);return e+(E<=7?(E-1)*31:(E-1)*30+6)+Math.floor((o*682-110)/2816)+(o-1)*365+Math.floor(r/2820)*1029983+this.jdEpoch-1},fromJD:function(A){A=Math.floor(A)+.5;var E=A-this.toJD(475,1,1),e=Math.floor(E/1029983),t=x(E,1029983),r=2820;if(t!==1029982){var o=Math.floor(t/366),a=x(t,366);r=Math.floor((2134*o+2816*a+2815)/1028522)+o+1}var i=r+2820*e+474;i=i<=0?i-1:i;var n=A-this.toJD(i,1,1)+1,s=n<=186?Math.ceil(n/31):Math.ceil((n-6)/30),c=A-this.toJD(i,s,1)+1;return this.newDate(i,s,c)}});function x(A,E){return A-E*Math.floor(A/E)}Y.calendars.persian=d,Y.calendars.jalali=d}}),jz=He({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var Y=vh(),G=Yc(),d=Y.instance();function x(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}x.prototype=new Y.baseCalendar,G(x.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(e){var E=this._validate(e,this.minMonth,this.minDay,Y.local.invalidYear),e=this._t2gYear(E.year());return d.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,Y.local.invalidYear),r=this._t2gYear(t.year());return d.weekOfYear(r,t.month(),t.day())},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return(this.dayOfWeek(A,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Y.local.invalidDate),r=this._t2gYear(t.year());return d.toJD(r,t.month(),t.day())},fromJD:function(A){var E=d.fromJD(A),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(A){return A+this.yearsOffset+(A>=-this.yearsOffset&&A<=-1?1:0)},_g2tYear:function(A){return A-this.yearsOffset-(A>=1&&A<=this.yearsOffset?1:0)}}),Y.calendars.taiwan=x}}),Vz=He({"node_modules/world-calendars/dist/calendars/thai.js"(){var Y=vh(),G=Yc(),d=Y.instance();function x(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}x.prototype=new Y.baseCalendar,G(x.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(e){var E=this._validate(e,this.minMonth,this.minDay,Y.local.invalidYear),e=this._t2gYear(E.year());return d.leapYear(e)},weekOfYear:function(r,E,e){var t=this._validate(r,this.minMonth,this.minDay,Y.local.invalidYear),r=this._t2gYear(t.year());return d.weekOfYear(r,t.month(),t.day())},daysInMonth:function(A,E){var e=this._validate(A,E,this.minDay,Y.local.invalidMonth);return this.daysPerMonth[e.month()-1]+(e.month()===2&&this.leapYear(e.year())?1:0)},weekDay:function(A,E,e){return(this.dayOfWeek(A,E,e)||7)<6},toJD:function(r,E,e){var t=this._validate(r,E,e,Y.local.invalidDate),r=this._t2gYear(t.year());return d.toJD(r,t.month(),t.day())},fromJD:function(A){var E=d.fromJD(A),e=this._g2tYear(E.year());return this.newDate(e,E.month(),E.day())},_t2gYear:function(A){return A-this.yearsOffset-(A>=1&&A<=this.yearsOffset?1:0)},_g2tYear:function(A){return A+this.yearsOffset+(A>=-this.yearsOffset&&A<=-1?1:0)}}),Y.calendars.thai=x}}),qz=He({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var Y=vh(),G=Yc();function d(A){this.local=this.regionalOptions[A||""]||this.regionalOptions[""]}d.prototype=new Y.baseCalendar,G(d.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āthā’","Yawm al-Arba‘ā’","Yawm al-Khamīs","Yawm al-Jum‘a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(A){var E=this._validate(A,this.minMonth,this.minDay,Y.local.invalidYear);return this.daysInYear(E.year())===355},weekOfYear:function(A,E,e){var t=this.newDate(A,E,e);return t.add(-t.dayOfWeek(),"d"),Math.floor((t.dayOfYear()-1)/7)+1},daysInYear:function(A){for(var E=0,e=1;e<=12;e++)E+=this.daysInMonth(A,e);return E},daysInMonth:function(A,E){for(var e=this._validate(A,E,this.minDay,Y.local.invalidMonth),t=e.toJD()-24e5+.5,r=0,o=0;ot)return x[r]-x[r-1];r++}return 30},weekDay:function(A,E,e){return this.dayOfWeek(A,E,e)!==5},toJD:function(A,E,e){var t=this._validate(A,E,e,Y.local.invalidDate),r=12*(t.year()-1)+t.month()-15292,o=t.day()+x[r-1]-1;return o+24e5-.5},fromJD:function(A){for(var E=A-24e5+.5,e=0,t=0;tE);t++)e++;var r=e+15292,o=Math.floor((r-1)/12),a=o+1,i=r-12*o,n=E-x[e-1]+1;return this.newDate(a,i,n)},isValid:function(A,E,e){var t=Y.baseCalendar.prototype.isValid.apply(this,arguments);return t&&(A=A.year!=null?A.year:A,t=A>=1276&&A<=1500),t},_validate:function(A,E,e,t){var r=Y.baseCalendar.prototype._validate.apply(this,arguments);if(r.year<1276||r.year>1500)throw t.replace(/\{0\}/,this.local.name);return r}}),Y.calendars.ummalqura=d;var x=[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]}}),Hz=He({"src/components/calendars/calendars.js"(Y,G){G.exports=vh(),Cz(),Lz(),Pz(),Iz(),Rz(),Dz(),zz(),Fz(),Oz(),Bz(),Nz(),Uz(),jz(),Vz(),qz()}}),Gz=He({"src/components/calendars/index.js"(Y,G){var d=Hz(),x=Gr(),A=lo(),E=A.EPOCHJD,e=A.ONEDAY,t={valType:"enumerated",values:x.sortObjectKeys(d.calendars),editType:"calc",dflt:"gregorian"},r=function(_,w,p,u){var g={};return g[p]=t,x.coerce(_,w,g,p,u)},o=function(_,w,p,u){for(var g=0;g + * @license MIT + *//*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *//*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + *//*! + * pad-left + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT license. + *//*! + * repeat-string + * + * Copyright (c) 2014-2015, Jon Schlinkert. + * Licensed under the MIT License. + *//*! Bundled license information: + +native-promise-only/lib/npo.src.js: + (*! Native Promise Only + v0.8.1 (c) Kyle Simpson + MIT License: http://getify.mit-license.org + *) + +polybooljs/index.js: + (* + * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc + * @license MIT + * @preserve Project Home: https://github.com/voidqk/polybooljs + *) + +ieee754/index.js: + (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) + +buffer/index.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) + +safe-buffer/index.js: + (*! safe-buffer. MIT License. Feross Aboukhadijeh *) + +assert/build/internal/util/comparisons.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) + +object-assign/index.js: + (* + object-assign + (c) Sindre Sorhus + @license MIT + *) + +maplibre-gl/dist/maplibre-gl.js: + (** + * MapLibre GL JS + * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt + *) +*/return window.Plotly=Ch,Ch})}(Wm)),Wm.exports}var $A;function U8(){return $A||($A=1,function(uh){Object.defineProperty(uh,"__esModule",{value:!0}),uh.default=void 0;var Th=qs(O8()),Ch=qs(N8());function qs(Zh){return Zh&&Zh.__esModule?Zh:{default:Zh}}var vf=(0,Th.default)(Ch.default),Wh=vf;uh.default=Wh}(lb)),lb}var j8=U8();const V8=P8(j8),G8=({orgId:uh,runId:Th})=>{const[Ch,qs]=Gm.useState(!0),[vf,Wh]=Gm.useState(null),[Zh,wp]=Gm.useState([]);return Gm.useEffect(()=>{(async()=>{try{const Bh=await R8.getRunEvents(uh,Th),Nv={};Bh.forEach(mv=>{const Nh=mv.data,Sf=Nh.step||Nh.global_step;Sf!==void 0&&Object.entries(Nh).forEach(([av,ks])=>{av!=="step"&&av!=="global_step"&&(typeof ks=="number"||typeof ks=="string"&&!isNaN(Number(ks)))&&(Nv[av]||(Nv[av]=[]),Nv[av].push({step:Number(Sf),value:Number(ks)}))})});const rv=[];for(const[mv,Nh]of Object.entries(Nv))Nh.length>1&&(Nh.sort((Sf,av)=>Sf.step-av.step),rv.push({title:mv,x:Nh.map(Sf=>Sf.step),y:Nh.map(Sf=>Sf.value)}));wp(rv),qs(!1)}catch(Bh){console.error("Error fetching events:",Bh),Wh(Bh instanceof Error?Bh.message:"Error fetching metrics"),qs(!1)}})()},[uh,Th]),Ch?yv.jsx(C0,{sx:{display:"flex",justifyContent:"center",p:3},children:yv.jsx(I8,{})}):vf?yv.jsx(C0,{sx:{p:2},children:yv.jsxs(nb,{color:"error",children:["Error loading metrics: ",vf]})}):Zh.length===0?yv.jsx(C0,{sx:{p:2},children:yv.jsx(nb,{children:"No metrics data available for plotting"})}):yv.jsxs(C0,{children:[yv.jsx(nb,{variant:"h6",sx:{mb:2},children:"Metrics:"}),yv.jsx(C0,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(500px, 1fr))",gap:3},children:Zh.map((Lh,Bh)=>yv.jsx(C0,{sx:{minHeight:400},children:yv.jsx(V8,{data:[{x:Lh.x,y:Lh.y,type:"scatter",mode:"lines+markers",name:Lh.title,line:{color:"#1f77b4",width:2},marker:{size:6}}],layout:{title:{text:Lh.title,y:.95,x:.05,xanchor:"left",yanchor:"top",font:{size:16,color:"#333"}},xaxis:{title:"step",showgrid:!0,gridcolor:"#E1E5EA",zeroline:!1},yaxis:{title:Lh.title,showgrid:!0,gridcolor:"#E1E5EA",zeroline:!1},autosize:!0,margin:{t:60,r:30,l:60,b:50},plot_bgcolor:"white",paper_bgcolor:"white",showlegend:!0,legend:{x:1,y:1,xanchor:"right",yanchor:"top",bgcolor:"rgba(255, 255, 255, 0.8)",bordercolor:"#E1E5EA",borderwidth:1}},style:{width:"100%",height:"100%"},config:{responsive:!0,displayModeBar:!0,displaylogo:!1,modeBarButtonsToAdd:["toImage"],modeBarButtonsToRemove:["select2d","lasso2d"],toImageButtonOptions:{format:"png",filename:`${Lh.title}_${Th}`,height:800,width:1200,scale:2}}})},Bh))})]})};export{G8 as MetricsPlots}; diff --git a/openweights/dashboard/backend/static/assets/browser-CHCO931n.js b/openweights/dashboard/backend/static/assets/browser-CHCO931n.js new file mode 100644 index 0000000..93f2ec4 --- /dev/null +++ b/openweights/dashboard/backend/static/assets/browser-CHCO931n.js @@ -0,0 +1 @@ +import{g as o}from"./index-CmfXCDny.js";var r,e;function t(){return e||(e=1,r=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}),r}var s=t();const n=o(s),w=Object.freeze(Object.defineProperty({__proto__:null,default:n},Symbol.toStringTag,{value:"Module"}));export{w as b}; diff --git a/openweights/dashboard/backend/static/assets/browser-DG1xBqer.js b/openweights/dashboard/backend/static/assets/browser-DG1xBqer.js new file mode 100644 index 0000000..47c9b39 --- /dev/null +++ b/openweights/dashboard/backend/static/assets/browser-DG1xBqer.js @@ -0,0 +1 @@ +import{g as o}from"./index-CL2BTY-B.js";var r,e;function t(){return e||(e=1,r=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}),r}var s=t();const n=o(s),w=Object.freeze(Object.defineProperty({__proto__:null,default:n},Symbol.toStringTag,{value:"Module"}));export{w as b}; diff --git a/openweights/dashboard/backend/static/assets/browser-tfbTCamV.js b/openweights/dashboard/backend/static/assets/browser-tfbTCamV.js new file mode 100644 index 0000000..a244df4 --- /dev/null +++ b/openweights/dashboard/backend/static/assets/browser-tfbTCamV.js @@ -0,0 +1 @@ +import{g as o}from"./index-KCoSzXrZ.js";var r,e;function t(){return e||(e=1,r=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}),r}var s=t();const n=o(s),w=Object.freeze(Object.defineProperty({__proto__:null,default:n},Symbol.toStringTag,{value:"Module"}));export{w as b}; diff --git a/openweights/dashboard/backend/static/assets/index-CL2BTY-B.js b/openweights/dashboard/backend/static/assets/index-CL2BTY-B.js new file mode 100644 index 0000000..6415c1c --- /dev/null +++ b/openweights/dashboard/backend/static/assets/index-CL2BTY-B.js @@ -0,0 +1,179 @@ +function OS(e,t){for(var n=0;no[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function o(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function Ut(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Jr(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function o(){return this instanceof o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,i.get?i:{enumerable:!0,get:function(){return e[o]}})}),n}var Rp={exports:{}},za={},Ep={exports:{}},Ye={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var py;function IS(){if(py)return Ye;py=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),v=Symbol.iterator;function w(B){return B===null||typeof B!="object"?null:(B=v&&B[v]||B["@@iterator"],typeof B=="function"?B:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},y=Object.assign,k={};function C(B,ee,me){this.props=B,this.context=ee,this.refs=k,this.updater=me||S}C.prototype.isReactComponent={},C.prototype.setState=function(B,ee){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,ee,"setState")},C.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function R(){}R.prototype=C.prototype;function O(B,ee,me){this.props=B,this.context=ee,this.refs=k,this.updater=me||S}var $=O.prototype=new R;$.constructor=O,y($,C.prototype),$.isPureReactComponent=!0;var j=Array.isArray,P=Object.prototype.hasOwnProperty,I={current:null},E={key:!0,ref:!0,__self:!0,__source:!0};function L(B,ee,me){var fe,ve={},re=null,ge=null;if(ee!=null)for(fe in ee.ref!==void 0&&(ge=ee.ref),ee.key!==void 0&&(re=""+ee.key),ee)P.call(ee,fe)&&!E.hasOwnProperty(fe)&&(ve[fe]=ee[fe]);var Q=arguments.length-2;if(Q===1)ve.children=me;else if(1>>1,ee=F[B];if(0>>1;Bi(ve,oe))rei(ge,ve)?(F[B]=ge,F[re]=oe,B=re):(F[B]=ve,F[fe]=oe,B=fe);else if(rei(ge,oe))F[B]=ge,F[re]=oe,B=re;else break e}}return Y}function i(F,Y){var oe=F.sortIndex-Y.sortIndex;return oe!==0?oe:F.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var d=[],p=[],h=1,v=null,w=3,S=!1,y=!1,k=!1,C=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function $(F){for(var Y=n(p);Y!==null;){if(Y.callback===null)o(p);else if(Y.startTime<=F)o(p),Y.sortIndex=Y.expirationTime,t(d,Y);else break;Y=n(p)}}function j(F){if(k=!1,$(F),!y)if(n(d)!==null)y=!0,X(P);else{var Y=n(p);Y!==null&&q(j,Y.startTime-F)}}function P(F,Y){y=!1,k&&(k=!1,R(L),L=-1),S=!0;var oe=w;try{for($(Y),v=n(d);v!==null&&(!(v.expirationTime>Y)||F&&!V());){var B=v.callback;if(typeof B=="function"){v.callback=null,w=v.priorityLevel;var ee=B(v.expirationTime<=Y);Y=e.unstable_now(),typeof ee=="function"?v.callback=ee:v===n(d)&&o(d),$(Y)}else o(d);v=n(d)}if(v!==null)var me=!0;else{var fe=n(p);fe!==null&&q(j,fe.startTime-Y),me=!1}return me}finally{v=null,w=oe,S=!1}}var I=!1,E=null,L=-1,A=5,N=-1;function V(){return!(e.unstable_now()-NF||125B?(F.sortIndex=oe,t(p,F),n(d)===null&&F===n(p)&&(k?(R(L),L=-1):k=!0,q(j,oe-B))):(F.sortIndex=ee,t(d,F),y||S||(y=!0,X(P))),F},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(F){var Y=w;return function(){var oe=w;w=Y;try{return F.apply(this,arguments)}finally{w=oe}}}}($p)),$p}var yy;function MS(){return yy||(yy=1,Tp.exports=AS()),Tp.exports}/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var xy;function NS(){if(xy)return Nn;xy=1;var e=id(),t=MS();function n(r){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+r,l=1;l"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,p=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},v={};function w(r){return d.call(v,r)?!0:d.call(h,r)?!1:p.test(r)?v[r]=!0:(h[r]=!0,!1)}function S(r,s,l,f){if(l!==null&&l.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return f?!1:l!==null?!l.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function y(r,s,l,f){if(s===null||typeof s>"u"||S(r,s,l,f))return!0;if(f)return!1;if(l!==null)switch(l.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function k(r,s,l,f,g,b,T){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=f,this.attributeNamespace=g,this.mustUseProperty=l,this.propertyName=r,this.type=s,this.sanitizeURL=b,this.removeEmptyString=T}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){C[r]=new k(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var s=r[0];C[s]=new k(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){C[r]=new k(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){C[r]=new k(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){C[r]=new k(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){C[r]=new k(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){C[r]=new k(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){C[r]=new k(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){C[r]=new k(r,5,!1,r.toLowerCase(),null,!1,!1)});var R=/[\-:]([a-z])/g;function O(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var s=r.replace(R,O);C[s]=new k(s,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var s=r.replace(R,O);C[s]=new k(s,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var s=r.replace(R,O);C[s]=new k(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){C[r]=new k(r,1,!1,r.toLowerCase(),null,!1,!1)}),C.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){C[r]=new k(r,1,!1,r.toLowerCase(),null,!0,!0)});function $(r,s,l,f){var g=C.hasOwnProperty(s)?C[s]:null;(g!==null?g.type!==0:f||!(2M||g[T]!==b[M]){var D=` +`+g[T].replace(" at new "," at ");return r.displayName&&D.includes("")&&(D=D.replace("",r.displayName)),D}while(1<=T&&0<=M);break}}}finally{me=!1,Error.prepareStackTrace=l}return(r=r?r.displayName||r.name:"")?ee(r):""}function ve(r){switch(r.tag){case 5:return ee(r.type);case 16:return ee("Lazy");case 13:return ee("Suspense");case 19:return ee("SuspenseList");case 0:case 2:case 15:return r=fe(r.type,!1),r;case 11:return r=fe(r.type.render,!1),r;case 1:return r=fe(r.type,!0),r;default:return""}}function re(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case E:return"Fragment";case I:return"Portal";case A:return"Profiler";case L:return"StrictMode";case z:return"Suspense";case G:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case V:return(r.displayName||"Context")+".Consumer";case N:return(r._context.displayName||"Context")+".Provider";case W:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case H:return s=r.displayName||null,s!==null?s:re(r.type)||"Memo";case X:s=r._payload,r=r._init;try{return re(r(s))}catch{}}return null}function ge(r){var s=r.type;switch(r.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=s.render,r=r.displayName||r.name||"",s.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return re(s);case 8:return s===L?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function Q(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function ie(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function $e(r){var s=ie(r)?"checked":"value",l=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),f=""+r[s];if(!r.hasOwnProperty(s)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var g=l.get,b=l.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return g.call(this)},set:function(T){f=""+T,b.call(this,T)}}),Object.defineProperty(r,s,{enumerable:l.enumerable}),{getValue:function(){return f},setValue:function(T){f=""+T},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function Pe(r){r._valueTracker||(r._valueTracker=$e(r))}function Ne(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var l=s.getValue(),f="";return r&&(f=ie(r)?r.checked?"true":"false":r.value),r=f,r!==l?(s.setValue(r),!0):!1}function Ce(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Be(r,s){var l=s.checked;return oe({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??r._wrapperState.initialChecked})}function De(r,s){var l=s.defaultValue==null?"":s.defaultValue,f=s.checked!=null?s.checked:s.defaultChecked;l=Q(s.value!=null?s.value:l),r._wrapperState={initialChecked:f,initialValue:l,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function yt(r,s){s=s.checked,s!=null&&$(r,"checked",s,!1)}function nt(r,s){yt(r,s);var l=Q(s.value),f=s.type;if(l!=null)f==="number"?(l===0&&r.value===""||r.value!=l)&&(r.value=""+l):r.value!==""+l&&(r.value=""+l);else if(f==="submit"||f==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?Pt(r,s.type,l):s.hasOwnProperty("defaultValue")&&Pt(r,s.type,Q(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function it(r,s,l){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var f=s.type;if(!(f!=="submit"&&f!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+r._wrapperState.initialValue,l||s===r.value||(r.value=s),r.defaultValue=s}l=r.name,l!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,l!==""&&(r.name=l)}function Pt(r,s,l){(s!=="number"||Ce(r.ownerDocument)!==r)&&(l==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+l&&(r.defaultValue=""+l))}var Qe=Array.isArray;function We(r,s,l,f){if(r=r.options,s){s={};for(var g=0;g"+s.valueOf().toString()+"",s=Ke.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function pt(r,s){if(s){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=s;return}}r.textContent=s}var Ht={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Sn=["Webkit","ms","Moz","O"];Object.keys(Ht).forEach(function(r){Sn.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),Ht[s]=Ht[r]})});function Le(r,s,l){return s==null||typeof s=="boolean"||s===""?"":l||typeof s!="number"||s===0||Ht.hasOwnProperty(r)&&Ht[r]?(""+s).trim():s+"px"}function et(r,s){r=r.style;for(var l in s)if(s.hasOwnProperty(l)){var f=l.indexOf("--")===0,g=Le(l,s[l],f);l==="float"&&(l="cssFloat"),f?r.setProperty(l,g):r[l]=g}}var he=oe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Re(r,s){if(s){if(he[r]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(n(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(n(61))}if(s.style!=null&&typeof s.style!="object")throw Error(n(62))}}function Ve(r,s){if(r.indexOf("-")===-1)return typeof s.is=="string";switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Xe=null;function mt(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Bt=null,Yt=null,kn=null;function jn(r){if(r=Sa(r)){if(typeof Bt!="function")throw Error(n(280));var s=r.stateNode;s&&(s=Lc(s),Bt(r.stateNode,r.type,s))}}function Qr(r){Yt?kn?kn.push(r):kn=[r]:Yt=r}function ra(){if(Yt){var r=Yt,s=kn;if(kn=Yt=null,jn(r),s)for(r=0;r>>=0,r===0?32:31-(Gw(r)/Jw|0)|0}var gc=64,vc=4194304;function sa(r){switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function yc(r,s){var l=r.pendingLanes;if(l===0)return 0;var f=0,g=r.suspendedLanes,b=r.pingedLanes,T=l&268435455;if(T!==0){var M=T&~g;M!==0?f=sa(M):(b&=T,b!==0&&(f=sa(b)))}else T=l&~g,T!==0?f=sa(T):b!==0&&(f=sa(b));if(f===0)return 0;if(s!==0&&s!==f&&!(s&g)&&(g=f&-f,b=s&-s,g>=b||g===16&&(b&4194240)!==0))return s;if(f&4&&(f|=l&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=f;0l;l++)s.push(r);return s}function ia(r,s,l){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-xr(s),r[s]=l}function Zw(r,s){var l=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s,s=r.entanglements;var f=r.eventTimes;for(r=r.expirationTimes;0=ha),ig=" ",ag=!1;function lg(r,s){switch(r){case"keyup":return EC.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cg(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ws=!1;function TC(r,s){switch(r){case"compositionend":return cg(s);case"keypress":return s.which!==32?null:(ag=!0,ig);case"textInput":return r=s.data,r===ig&&ag?null:r;default:return null}}function $C(r,s){if(Ws)return r==="compositionend"||!sf&&lg(r,s)?(r=eg(),Sc=Zd=wo=null,Ws=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:l,offset:s-r};r=f}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=gg(l)}}function yg(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?yg(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function xg(){for(var r=window,s=Ce();s instanceof r.HTMLIFrameElement;){try{var l=typeof s.contentWindow.location.href=="string"}catch{l=!1}if(l)r=s.contentWindow;else break;s=Ce(r.document)}return s}function cf(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}function BC(r){var s=xg(),l=r.focusedElem,f=r.selectionRange;if(s!==l&&l&&l.ownerDocument&&yg(l.ownerDocument.documentElement,l)){if(f!==null&&cf(l)){if(s=f.start,r=f.end,r===void 0&&(r=s),"selectionStart"in l)l.selectionStart=s,l.selectionEnd=Math.min(r,l.value.length);else if(r=(s=l.ownerDocument||document)&&s.defaultView||window,r.getSelection){r=r.getSelection();var g=l.textContent.length,b=Math.min(f.start,g);f=f.end===void 0?b:Math.min(f.end,g),!r.extend&&b>f&&(g=f,f=b,b=g),g=vg(l,b);var T=vg(l,f);g&&T&&(r.rangeCount!==1||r.anchorNode!==g.node||r.anchorOffset!==g.offset||r.focusNode!==T.node||r.focusOffset!==T.offset)&&(s=s.createRange(),s.setStart(g.node,g.offset),r.removeAllRanges(),b>f?(r.addRange(s),r.extend(T.node,T.offset)):(s.setEnd(T.node,T.offset),r.addRange(s)))}}for(s=[],r=l;r=r.parentNode;)r.nodeType===1&&s.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l=document.documentMode,Hs=null,uf=null,ya=null,df=!1;function bg(r,s,l){var f=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;df||Hs==null||Hs!==Ce(f)||(f=Hs,"selectionStart"in f&&cf(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),ya&&va(ya,f)||(ya=f,f=jc(uf,"onSelect"),0Js||(r.current=Sf[Js],Sf[Js]=null,Js--)}function gt(r,s){Js++,Sf[Js]=r.current,r.current=s}var _o={},hn=ko(_o),On=ko(!1),os=_o;function Xs(r,s){var l=r.type.contextTypes;if(!l)return _o;var f=r.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===s)return f.__reactInternalMemoizedMaskedChildContext;var g={},b;for(b in l)g[b]=s[b];return f&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=g),g}function In(r){return r=r.childContextTypes,r!=null}function Ac(){bt(On),bt(hn)}function Ag(r,s,l){if(hn.current!==_o)throw Error(n(168));gt(hn,s),gt(On,l)}function Mg(r,s,l){var f=r.stateNode;if(s=s.childContextTypes,typeof f.getChildContext!="function")return l;f=f.getChildContext();for(var g in f)if(!(g in s))throw Error(n(108,ge(r)||"Unknown",g));return oe({},l,f)}function Mc(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||_o,os=hn.current,gt(hn,r),gt(On,On.current),!0}function Ng(r,s,l){var f=r.stateNode;if(!f)throw Error(n(169));l?(r=Mg(r,s,os),f.__reactInternalMemoizedMergedChildContext=r,bt(On),bt(hn),gt(hn,r)):bt(On),gt(On,l)}var no=null,Nc=!1,kf=!1;function zg(r){no===null?no=[r]:no.push(r)}function YC(r){Nc=!0,zg(r)}function Ro(){if(!kf&&no!==null){kf=!0;var r=0,s=ft;try{var l=no;for(ft=1;r>=T,g-=T,ro=1<<32-xr(s)+g|l<Fe?(nn=Me,Me=null):nn=Me.sibling;var ot=ae(K,Me,J[Fe],pe);if(ot===null){Me===null&&(Me=nn);break}r&&Me&&ot.alternate===null&&s(K,Me),U=b(ot,U,Fe),Ae===null?Oe=ot:Ae.sibling=ot,Ae=ot,Me=nn}if(Fe===J.length)return l(K,Me),kt&&is(K,Fe),Oe;if(Me===null){for(;FeFe?(nn=Me,Me=null):nn=Me.sibling;var Ao=ae(K,Me,ot.value,pe);if(Ao===null){Me===null&&(Me=nn);break}r&&Me&&Ao.alternate===null&&s(K,Me),U=b(Ao,U,Fe),Ae===null?Oe=Ao:Ae.sibling=Ao,Ae=Ao,Me=nn}if(ot.done)return l(K,Me),kt&&is(K,Fe),Oe;if(Me===null){for(;!ot.done;Fe++,ot=J.next())ot=de(K,ot.value,pe),ot!==null&&(U=b(ot,U,Fe),Ae===null?Oe=ot:Ae.sibling=ot,Ae=ot);return kt&&is(K,Fe),Oe}for(Me=f(K,Me);!ot.done;Fe++,ot=J.next())ot=xe(Me,K,Fe,ot.value,pe),ot!==null&&(r&&ot.alternate!==null&&Me.delete(ot.key===null?Fe:ot.key),U=b(ot,U,Fe),Ae===null?Oe=ot:Ae.sibling=ot,Ae=ot);return r&&Me.forEach(function(jS){return s(K,jS)}),kt&&is(K,Fe),Oe}function Ft(K,U,J,pe){if(typeof J=="object"&&J!==null&&J.type===E&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case P:e:{for(var Oe=J.key,Ae=U;Ae!==null;){if(Ae.key===Oe){if(Oe=J.type,Oe===E){if(Ae.tag===7){l(K,Ae.sibling),U=g(Ae,J.props.children),U.return=K,K=U;break e}}else if(Ae.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===X&&Hg(Oe)===Ae.type){l(K,Ae.sibling),U=g(Ae,J.props),U.ref=ka(K,Ae,J),U.return=K,K=U;break e}l(K,Ae);break}else s(K,Ae);Ae=Ae.sibling}J.type===E?(U=hs(J.props.children,K.mode,pe,J.key),U.return=K,K=U):(pe=du(J.type,J.key,J.props,null,K.mode,pe),pe.ref=ka(K,U,J),pe.return=K,K=pe)}return T(K);case I:e:{for(Ae=J.key;U!==null;){if(U.key===Ae)if(U.tag===4&&U.stateNode.containerInfo===J.containerInfo&&U.stateNode.implementation===J.implementation){l(K,U.sibling),U=g(U,J.children||[]),U.return=K,K=U;break e}else{l(K,U);break}else s(K,U);U=U.sibling}U=wp(J,K.mode,pe),U.return=K,K=U}return T(K);case X:return Ae=J._init,Ft(K,U,Ae(J._payload),pe)}if(Qe(J))return Te(K,U,J,pe);if(Y(J))return je(K,U,J,pe);Fc(K,J)}return typeof J=="string"&&J!==""||typeof J=="number"?(J=""+J,U!==null&&U.tag===6?(l(K,U.sibling),U=g(U,J),U.return=K,K=U):(l(K,U),U=bp(J,K.mode,pe),U.return=K,K=U),T(K)):l(K,U)}return Ft}var ei=Vg(!0),qg=Vg(!1),Uc=ko(null),Wc=null,ti=null,$f=null;function jf(){$f=ti=Wc=null}function Of(r){var s=Uc.current;bt(Uc),r._currentValue=s}function If(r,s,l){for(;r!==null;){var f=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,f!==null&&(f.childLanes|=s)):f!==null&&(f.childLanes&s)!==s&&(f.childLanes|=s),r===l)break;r=r.return}}function ni(r,s){Wc=r,$f=ti=null,r=r.dependencies,r!==null&&r.firstContext!==null&&(r.lanes&s&&(Ln=!0),r.firstContext=null)}function ar(r){var s=r._currentValue;if($f!==r)if(r={context:r,memoizedValue:s,next:null},ti===null){if(Wc===null)throw Error(n(308));ti=r,Wc.dependencies={lanes:0,firstContext:r}}else ti=ti.next=r;return s}var as=null;function Lf(r){as===null?as=[r]:as.push(r)}function Kg(r,s,l,f){var g=s.interleaved;return g===null?(l.next=l,Lf(s)):(l.next=g.next,g.next=l),s.interleaved=l,so(r,f)}function so(r,s){r.lanes|=s;var l=r.alternate;for(l!==null&&(l.lanes|=s),l=r,r=r.return;r!==null;)r.childLanes|=s,l=r.alternate,l!==null&&(l.childLanes|=s),l=r,r=r.return;return l.tag===3?l.stateNode:null}var Eo=!1;function Af(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Gg(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function io(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function Po(r,s,l){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,rt&2){var g=f.pending;return g===null?s.next=s:(s.next=g.next,g.next=s),f.pending=s,so(r,l)}return g=f.interleaved,g===null?(s.next=s,Lf(f)):(s.next=g.next,g.next=s),f.interleaved=s,so(r,l)}function Hc(r,s,l){if(s=s.updateQueue,s!==null&&(s=s.shared,(l&4194240)!==0)){var f=s.lanes;f&=r.pendingLanes,l|=f,s.lanes=l,Gd(r,l)}}function Jg(r,s){var l=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,l===f)){var g=null,b=null;if(l=l.firstBaseUpdate,l!==null){do{var T={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};b===null?g=b=T:b=b.next=T,l=l.next}while(l!==null);b===null?g=b=s:b=b.next=s}else g=b=s;l={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:b,shared:f.shared,effects:f.effects},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=s:r.next=s,l.lastBaseUpdate=s}function Vc(r,s,l,f){var g=r.updateQueue;Eo=!1;var b=g.firstBaseUpdate,T=g.lastBaseUpdate,M=g.shared.pending;if(M!==null){g.shared.pending=null;var D=M,Z=D.next;D.next=null,T===null?b=Z:T.next=Z,T=D;var ce=r.alternate;ce!==null&&(ce=ce.updateQueue,M=ce.lastBaseUpdate,M!==T&&(M===null?ce.firstBaseUpdate=Z:M.next=Z,ce.lastBaseUpdate=D))}if(b!==null){var de=g.baseState;T=0,ce=Z=D=null,M=b;do{var ae=M.lane,xe=M.eventTime;if((f&ae)===ae){ce!==null&&(ce=ce.next={eventTime:xe,lane:0,tag:M.tag,payload:M.payload,callback:M.callback,next:null});e:{var Te=r,je=M;switch(ae=s,xe=l,je.tag){case 1:if(Te=je.payload,typeof Te=="function"){de=Te.call(xe,de,ae);break e}de=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=je.payload,ae=typeof Te=="function"?Te.call(xe,de,ae):Te,ae==null)break e;de=oe({},de,ae);break e;case 2:Eo=!0}}M.callback!==null&&M.lane!==0&&(r.flags|=64,ae=g.effects,ae===null?g.effects=[M]:ae.push(M))}else xe={eventTime:xe,lane:ae,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ce===null?(Z=ce=xe,D=de):ce=ce.next=xe,T|=ae;if(M=M.next,M===null){if(M=g.shared.pending,M===null)break;ae=M,M=ae.next,ae.next=null,g.lastBaseUpdate=ae,g.shared.pending=null}}while(!0);if(ce===null&&(D=de),g.baseState=D,g.firstBaseUpdate=Z,g.lastBaseUpdate=ce,s=g.shared.interleaved,s!==null){g=s;do T|=g.lane,g=g.next;while(g!==s)}else b===null&&(g.shared.lanes=0);us|=T,r.lanes=T,r.memoizedState=de}}function Xg(r,s,l){if(r=s.effects,s.effects=null,r!==null)for(s=0;sl?l:4,r(!0);var f=Df.transition;Df.transition={};try{r(!1),s()}finally{ft=l,Df.transition=f}}function mv(){return lr().memoizedState}function tS(r,s,l){var f=Oo(r);if(l={lane:f,action:l,hasEagerState:!1,eagerState:null,next:null},gv(r))vv(s,l);else if(l=Kg(r,s,l,f),l!==null){var g=Rn();_r(l,r,f,g),yv(l,s,f)}}function nS(r,s,l){var f=Oo(r),g={lane:f,action:l,hasEagerState:!1,eagerState:null,next:null};if(gv(r))vv(s,g);else{var b=r.alternate;if(r.lanes===0&&(b===null||b.lanes===0)&&(b=s.lastRenderedReducer,b!==null))try{var T=s.lastRenderedState,M=b(T,l);if(g.hasEagerState=!0,g.eagerState=M,br(M,T)){var D=s.interleaved;D===null?(g.next=g,Lf(s)):(g.next=D.next,D.next=g),s.interleaved=g;return}}catch{}finally{}l=Kg(r,s,g,f),l!==null&&(g=Rn(),_r(l,r,f,g),yv(l,s,f))}}function gv(r){var s=r.alternate;return r===$t||s!==null&&s===$t}function vv(r,s){Pa=Gc=!0;var l=r.pending;l===null?s.next=s:(s.next=l.next,l.next=s),r.pending=s}function yv(r,s,l){if(l&4194240){var f=s.lanes;f&=r.pendingLanes,l|=f,s.lanes=l,Gd(r,l)}}var Yc={readContext:ar,useCallback:mn,useContext:mn,useEffect:mn,useImperativeHandle:mn,useInsertionEffect:mn,useLayoutEffect:mn,useMemo:mn,useReducer:mn,useRef:mn,useState:mn,useDebugValue:mn,useDeferredValue:mn,useTransition:mn,useMutableSource:mn,useSyncExternalStore:mn,useId:mn,unstable_isNewReconciler:!1},rS={readContext:ar,useCallback:function(r,s){return Br().memoizedState=[r,s===void 0?null:s],r},useContext:ar,useEffect:av,useImperativeHandle:function(r,s,l){return l=l!=null?l.concat([r]):null,Jc(4194308,4,uv.bind(null,s,r),l)},useLayoutEffect:function(r,s){return Jc(4194308,4,r,s)},useInsertionEffect:function(r,s){return Jc(4,2,r,s)},useMemo:function(r,s){var l=Br();return s=s===void 0?null:s,r=r(),l.memoizedState=[r,s],r},useReducer:function(r,s,l){var f=Br();return s=l!==void 0?l(s):s,f.memoizedState=f.baseState=s,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:s},f.queue=r,r=r.dispatch=tS.bind(null,$t,r),[f.memoizedState,r]},useRef:function(r){var s=Br();return r={current:r},s.memoizedState=r},useState:sv,useDebugValue:Kf,useDeferredValue:function(r){return Br().memoizedState=r},useTransition:function(){var r=sv(!1),s=r[0];return r=eS.bind(null,r[1]),Br().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,l){var f=$t,g=Br();if(kt){if(l===void 0)throw Error(n(407));l=l()}else{if(l=s(),tn===null)throw Error(n(349));cs&30||ev(f,s,l)}g.memoizedState=l;var b={value:l,getSnapshot:s};return g.queue=b,av(nv.bind(null,f,b,r),[r]),f.flags|=2048,ja(9,tv.bind(null,f,b,l,s),void 0,null),l},useId:function(){var r=Br(),s=tn.identifierPrefix;if(kt){var l=oo,f=ro;l=(f&~(1<<32-xr(f)-1)).toString(32)+l,s=":"+s+"R"+l,l=Ta++,0<\/script>",r=r.removeChild(r.firstChild)):typeof f.is=="string"?r=T.createElement(l,{is:f.is}):(r=T.createElement(l),l==="select"&&(T=r,f.multiple?T.multiple=!0:f.size&&(T.size=f.size))):r=T.createElementNS(r,l),r[Nr]=s,r[Ca]=f,zv(r,s,!1,!1),s.stateNode=r;e:{switch(T=Ve(l,f),l){case"dialog":xt("cancel",r),xt("close",r),g=f;break;case"iframe":case"object":case"embed":xt("load",r),g=f;break;case"video":case"audio":for(g=0;gai&&(s.flags|=128,f=!0,Oa(b,!1),s.lanes=4194304)}else{if(!f)if(r=qc(T),r!==null){if(s.flags|=128,f=!0,l=r.updateQueue,l!==null&&(s.updateQueue=l,s.flags|=4),Oa(b,!0),b.tail===null&&b.tailMode==="hidden"&&!T.alternate&&!kt)return gn(s),null}else 2*Dt()-b.renderingStartTime>ai&&l!==1073741824&&(s.flags|=128,f=!0,Oa(b,!1),s.lanes=4194304);b.isBackwards?(T.sibling=s.child,s.child=T):(l=b.last,l!==null?l.sibling=T:s.child=T,b.last=T)}return b.tail!==null?(s=b.tail,b.rendering=s,b.tail=s.sibling,b.renderingStartTime=Dt(),s.sibling=null,l=Tt.current,gt(Tt,f?l&1|2:l&1),s):(gn(s),null);case 22:case 23:return vp(),f=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==f&&(s.flags|=8192),f&&s.mode&1?Yn&1073741824&&(gn(s),s.subtreeFlags&6&&(s.flags|=8192)):gn(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function dS(r,s){switch(Rf(s),s.tag){case 1:return In(s.type)&&Ac(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return ri(),bt(On),bt(hn),Bf(),r=s.flags,r&65536&&!(r&128)?(s.flags=r&-65537|128,s):null;case 5:return Nf(s),null;case 13:if(bt(Tt),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));Zs()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return bt(Tt),null;case 4:return ri(),null;case 10:return Of(s.type._context),null;case 22:case 23:return vp(),null;case 24:return null;default:return null}}var tu=!1,vn=!1,fS=typeof WeakSet=="function"?WeakSet:Set,ke=null;function si(r,s){var l=r.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(f){It(r,s,f)}else l.current=null}function sp(r,s,l){try{l()}catch(f){It(r,s,f)}}var Fv=!1;function pS(r,s){if(vf=wc,r=xg(),cf(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var f=l.getSelection&&l.getSelection();if(f&&f.rangeCount!==0){l=f.anchorNode;var g=f.anchorOffset,b=f.focusNode;f=f.focusOffset;try{l.nodeType,b.nodeType}catch{l=null;break e}var T=0,M=-1,D=-1,Z=0,ce=0,de=r,ae=null;t:for(;;){for(var xe;de!==l||g!==0&&de.nodeType!==3||(M=T+g),de!==b||f!==0&&de.nodeType!==3||(D=T+f),de.nodeType===3&&(T+=de.nodeValue.length),(xe=de.firstChild)!==null;)ae=de,de=xe;for(;;){if(de===r)break t;if(ae===l&&++Z===g&&(M=T),ae===b&&++ce===f&&(D=T),(xe=de.nextSibling)!==null)break;de=ae,ae=de.parentNode}de=xe}l=M===-1||D===-1?null:{start:M,end:D}}else l=null}l=l||{start:0,end:0}}else l=null;for(yf={focusedElem:r,selectionRange:l},wc=!1,ke=s;ke!==null;)if(s=ke,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,ke=r;else for(;ke!==null;){s=ke;try{var Te=s.alternate;if(s.flags&1024)switch(s.tag){case 0:case 11:case 15:break;case 1:if(Te!==null){var je=Te.memoizedProps,Ft=Te.memoizedState,K=s.stateNode,U=K.getSnapshotBeforeUpdate(s.elementType===s.type?je:Cr(s.type,je),Ft);K.__reactInternalSnapshotBeforeUpdate=U}break;case 3:var J=s.stateNode.containerInfo;J.nodeType===1?J.textContent="":J.nodeType===9&&J.documentElement&&J.removeChild(J.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(pe){It(s,s.return,pe)}if(r=s.sibling,r!==null){r.return=s.return,ke=r;break}ke=s.return}return Te=Fv,Fv=!1,Te}function Ia(r,s,l){var f=s.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var g=f=f.next;do{if((g.tag&r)===r){var b=g.destroy;g.destroy=void 0,b!==void 0&&sp(s,l,b)}g=g.next}while(g!==f)}}function nu(r,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var l=s=s.next;do{if((l.tag&r)===r){var f=l.create;l.destroy=f()}l=l.next}while(l!==s)}}function ip(r){var s=r.ref;if(s!==null){var l=r.stateNode;switch(r.tag){case 5:r=l;break;default:r=l}typeof s=="function"?s(r):s.current=r}}function Uv(r){var s=r.alternate;s!==null&&(r.alternate=null,Uv(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[Nr],delete s[Ca],delete s[Cf],delete s[JC],delete s[XC])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function Wv(r){return r.tag===5||r.tag===3||r.tag===4}function Hv(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Wv(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function ap(r,s,l){var f=r.tag;if(f===5||f===6)r=r.stateNode,s?l.nodeType===8?l.parentNode.insertBefore(r,s):l.insertBefore(r,s):(l.nodeType===8?(s=l.parentNode,s.insertBefore(r,l)):(s=l,s.appendChild(r)),l=l._reactRootContainer,l!=null||s.onclick!==null||(s.onclick=Ic));else if(f!==4&&(r=r.child,r!==null))for(ap(r,s,l),r=r.sibling;r!==null;)ap(r,s,l),r=r.sibling}function lp(r,s,l){var f=r.tag;if(f===5||f===6)r=r.stateNode,s?l.insertBefore(r,s):l.appendChild(r);else if(f!==4&&(r=r.child,r!==null))for(lp(r,s,l),r=r.sibling;r!==null;)lp(r,s,l),r=r.sibling}var an=null,Sr=!1;function To(r,s,l){for(l=l.child;l!==null;)Vv(r,s,l),l=l.sibling}function Vv(r,s,l){if(Mr&&typeof Mr.onCommitFiberUnmount=="function")try{Mr.onCommitFiberUnmount(mc,l)}catch{}switch(l.tag){case 5:vn||si(l,s);case 6:var f=an,g=Sr;an=null,To(r,s,l),an=f,Sr=g,an!==null&&(Sr?(r=an,l=l.stateNode,r.nodeType===8?r.parentNode.removeChild(l):r.removeChild(l)):an.removeChild(l.stateNode));break;case 18:an!==null&&(Sr?(r=an,l=l.stateNode,r.nodeType===8?wf(r.parentNode,l):r.nodeType===1&&wf(r,l),da(r)):wf(an,l.stateNode));break;case 4:f=an,g=Sr,an=l.stateNode.containerInfo,Sr=!0,To(r,s,l),an=f,Sr=g;break;case 0:case 11:case 14:case 15:if(!vn&&(f=l.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){g=f=f.next;do{var b=g,T=b.destroy;b=b.tag,T!==void 0&&(b&2||b&4)&&sp(l,s,T),g=g.next}while(g!==f)}To(r,s,l);break;case 1:if(!vn&&(si(l,s),f=l.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=l.memoizedProps,f.state=l.memoizedState,f.componentWillUnmount()}catch(M){It(l,s,M)}To(r,s,l);break;case 21:To(r,s,l);break;case 22:l.mode&1?(vn=(f=vn)||l.memoizedState!==null,To(r,s,l),vn=f):To(r,s,l);break;default:To(r,s,l)}}function qv(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var l=r.stateNode;l===null&&(l=r.stateNode=new fS),s.forEach(function(f){var g=CS.bind(null,r,f);l.has(f)||(l.add(f),f.then(g,g))})}}function kr(r,s){var l=s.deletions;if(l!==null)for(var f=0;fg&&(g=T),f&=~b}if(f=g,f=Dt()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*mS(f/1960))-f,10r?16:r,jo===null)var f=!1;else{if(r=jo,jo=null,au=0,rt&6)throw Error(n(331));var g=rt;for(rt|=4,ke=r.current;ke!==null;){var b=ke,T=b.child;if(ke.flags&16){var M=b.deletions;if(M!==null){for(var D=0;DDt()-dp?fs(r,0):up|=l),Mn(r,s)}function sy(r,s){s===0&&(r.mode&1?(s=vc,vc<<=1,!(vc&130023424)&&(vc=4194304)):s=1);var l=Rn();r=so(r,s),r!==null&&(ia(r,s,l),Mn(r,l))}function wS(r){var s=r.memoizedState,l=0;s!==null&&(l=s.retryLane),sy(r,l)}function CS(r,s){var l=0;switch(r.tag){case 13:var f=r.stateNode,g=r.memoizedState;g!==null&&(l=g.retryLane);break;case 19:f=r.stateNode;break;default:throw Error(n(314))}f!==null&&f.delete(s),sy(r,l)}var iy;iy=function(r,s,l){if(r!==null)if(r.memoizedProps!==s.pendingProps||On.current)Ln=!0;else{if(!(r.lanes&l)&&!(s.flags&128))return Ln=!1,cS(r,s,l);Ln=!!(r.flags&131072)}else Ln=!1,kt&&s.flags&1048576&&Bg(s,Bc,s.index);switch(s.lanes=0,s.tag){case 2:var f=s.type;eu(r,s),r=s.pendingProps;var g=Xs(s,hn.current);ni(s,l),g=Uf(null,s,f,r,g,l);var b=Wf();return s.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,In(f)?(b=!0,Mc(s)):b=!1,s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Af(s),g.updater=Qc,s.stateNode=g,g._reactInternals=s,Jf(s,f,r,l),s=Zf(null,s,f,!0,b,l)):(s.tag=0,kt&&b&&_f(s),_n(null,s,g,l),s=s.child),s;case 16:f=s.elementType;e:{switch(eu(r,s),r=s.pendingProps,g=f._init,f=g(f._payload),s.type=f,g=s.tag=kS(f),r=Cr(f,r),g){case 0:s=Qf(null,s,f,r,l);break e;case 1:s=Ov(null,s,f,r,l);break e;case 11:s=Ev(null,s,f,r,l);break e;case 14:s=Pv(null,s,f,Cr(f.type,r),l);break e}throw Error(n(306,f,""))}return s;case 0:return f=s.type,g=s.pendingProps,g=s.elementType===f?g:Cr(f,g),Qf(r,s,f,g,l);case 1:return f=s.type,g=s.pendingProps,g=s.elementType===f?g:Cr(f,g),Ov(r,s,f,g,l);case 3:e:{if(Iv(s),r===null)throw Error(n(387));f=s.pendingProps,b=s.memoizedState,g=b.element,Gg(r,s),Vc(s,f,null,l);var T=s.memoizedState;if(f=T.element,b.isDehydrated)if(b={element:f,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},s.updateQueue.baseState=b,s.memoizedState=b,s.flags&256){g=oi(Error(n(423)),s),s=Lv(r,s,f,l,g);break e}else if(f!==g){g=oi(Error(n(424)),s),s=Lv(r,s,f,l,g);break e}else for(Xn=So(s.stateNode.containerInfo.firstChild),Jn=s,kt=!0,wr=null,l=qg(s,null,f,l),s.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Zs(),f===g){s=ao(r,s,l);break e}_n(r,s,f,l)}s=s.child}return s;case 5:return Yg(s),r===null&&Pf(s),f=s.type,g=s.pendingProps,b=r!==null?r.memoizedProps:null,T=g.children,xf(f,g)?T=null:b!==null&&xf(f,b)&&(s.flags|=32),jv(r,s),_n(r,s,T,l),s.child;case 6:return r===null&&Pf(s),null;case 13:return Av(r,s,l);case 4:return Mf(s,s.stateNode.containerInfo),f=s.pendingProps,r===null?s.child=ei(s,null,f,l):_n(r,s,f,l),s.child;case 11:return f=s.type,g=s.pendingProps,g=s.elementType===f?g:Cr(f,g),Ev(r,s,f,g,l);case 7:return _n(r,s,s.pendingProps,l),s.child;case 8:return _n(r,s,s.pendingProps.children,l),s.child;case 12:return _n(r,s,s.pendingProps.children,l),s.child;case 10:e:{if(f=s.type._context,g=s.pendingProps,b=s.memoizedProps,T=g.value,gt(Uc,f._currentValue),f._currentValue=T,b!==null)if(br(b.value,T)){if(b.children===g.children&&!On.current){s=ao(r,s,l);break e}}else for(b=s.child,b!==null&&(b.return=s);b!==null;){var M=b.dependencies;if(M!==null){T=b.child;for(var D=M.firstContext;D!==null;){if(D.context===f){if(b.tag===1){D=io(-1,l&-l),D.tag=2;var Z=b.updateQueue;if(Z!==null){Z=Z.shared;var ce=Z.pending;ce===null?D.next=D:(D.next=ce.next,ce.next=D),Z.pending=D}}b.lanes|=l,D=b.alternate,D!==null&&(D.lanes|=l),If(b.return,l,s),M.lanes|=l;break}D=D.next}}else if(b.tag===10)T=b.type===s.type?null:b.child;else if(b.tag===18){if(T=b.return,T===null)throw Error(n(341));T.lanes|=l,M=T.alternate,M!==null&&(M.lanes|=l),If(T,l,s),T=b.sibling}else T=b.child;if(T!==null)T.return=b;else for(T=b;T!==null;){if(T===s){T=null;break}if(b=T.sibling,b!==null){b.return=T.return,T=b;break}T=T.return}b=T}_n(r,s,g.children,l),s=s.child}return s;case 9:return g=s.type,f=s.pendingProps.children,ni(s,l),g=ar(g),f=f(g),s.flags|=1,_n(r,s,f,l),s.child;case 14:return f=s.type,g=Cr(f,s.pendingProps),g=Cr(f.type,g),Pv(r,s,f,g,l);case 15:return Tv(r,s,s.type,s.pendingProps,l);case 17:return f=s.type,g=s.pendingProps,g=s.elementType===f?g:Cr(f,g),eu(r,s),s.tag=1,In(f)?(r=!0,Mc(s)):r=!1,ni(s,l),bv(s,f,g),Jf(s,f,g,l),Zf(null,s,f,!0,r,l);case 19:return Nv(r,s,l);case 22:return $v(r,s,l)}throw Error(n(156,s.tag))};function ay(r,s){return pn(r,s)}function SS(r,s,l,f){this.tag=r,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ur(r,s,l,f){return new SS(r,s,l,f)}function xp(r){return r=r.prototype,!(!r||!r.isReactComponent)}function kS(r){if(typeof r=="function")return xp(r)?1:0;if(r!=null){if(r=r.$$typeof,r===W)return 11;if(r===H)return 14}return 2}function Lo(r,s){var l=r.alternate;return l===null?(l=ur(r.tag,s,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=s,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&14680064,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,s=r.dependencies,l.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l}function du(r,s,l,f,g,b){var T=2;if(f=r,typeof r=="function")xp(r)&&(T=1);else if(typeof r=="string")T=5;else e:switch(r){case E:return hs(l.children,g,b,s);case L:T=8,g|=8;break;case A:return r=ur(12,l,s,g|2),r.elementType=A,r.lanes=b,r;case z:return r=ur(13,l,s,g),r.elementType=z,r.lanes=b,r;case G:return r=ur(19,l,s,g),r.elementType=G,r.lanes=b,r;case q:return fu(l,g,b,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case N:T=10;break e;case V:T=9;break e;case W:T=11;break e;case H:T=14;break e;case X:T=16,f=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=ur(T,l,s,g),s.elementType=r,s.type=f,s.lanes=b,s}function hs(r,s,l,f){return r=ur(7,r,f,s),r.lanes=l,r}function fu(r,s,l,f){return r=ur(22,r,f,s),r.elementType=q,r.lanes=l,r.stateNode={isHidden:!1},r}function bp(r,s,l){return r=ur(6,r,null,s),r.lanes=l,r}function wp(r,s,l){return s=ur(4,r.children!==null?r.children:[],r.key,s),s.lanes=l,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function _S(r,s,l,f,g){this.tag=s,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Kd(0),this.expirationTimes=Kd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kd(0),this.identifierPrefix=f,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Cp(r,s,l,f,g,b,T,M,D){return r=new _S(r,s,l,M,D),s===1?(s=1,b===!0&&(s|=8)):s=0,b=ur(3,null,null,s),r.current=b,b.stateNode=r,b.memoizedState={element:f,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},Af(b),r}function RS(r,s,l){var f=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Pp.exports=NS(),Pp.exports}var wy;function zS(){if(wy)return xu;wy=1;var e=vb();return xu.createRoot=e.createRoot,xu.hydrateRoot=e.hydrateRoot,xu}var BS=zS(),x=id();const Hr=Ut(x),fh=OS({__proto__:null,default:Hr},[x]);var Ba={},Cy;function DS(){if(Cy)return Ba;Cy=1,Object.defineProperty(Ba,"__esModule",{value:!0}),Ba.parse=c,Ba.serialize=p;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,o=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,a=(()=>{const w=function(){};return w.prototype=Object.create(null),w})();function c(w,S){const y=new a,k=w.length;if(k<2)return y;const C=(S==null?void 0:S.decode)||h;let R=0;do{const O=w.indexOf("=",R);if(O===-1)break;const $=w.indexOf(";",R),j=$===-1?k:$;if(O>j){R=w.lastIndexOf(";",O-1)+1;continue}const P=u(w,R,O),I=d(w,O,P),E=w.slice(P,I);if(y[E]===void 0){let L=u(w,O+1,j),A=d(w,j,L);const N=C(w.slice(L,A));y[E]=N}R=j+1}while(Ry;){const k=w.charCodeAt(--S);if(k!==32&&k!==9)return S+1}return y}function p(w,S,y){const k=(y==null?void 0:y.encode)||encodeURIComponent;if(!e.test(w))throw new TypeError(`argument name is invalid: ${w}`);const C=k(S);if(!t.test(C))throw new TypeError(`argument val is invalid: ${S}`);let R=w+"="+C;if(!y)return R;if(y.maxAge!==void 0){if(!Number.isInteger(y.maxAge))throw new TypeError(`option maxAge is invalid: ${y.maxAge}`);R+="; Max-Age="+y.maxAge}if(y.domain){if(!n.test(y.domain))throw new TypeError(`option domain is invalid: ${y.domain}`);R+="; Domain="+y.domain}if(y.path){if(!o.test(y.path))throw new TypeError(`option path is invalid: ${y.path}`);R+="; Path="+y.path}if(y.expires){if(!v(y.expires)||!Number.isFinite(y.expires.valueOf()))throw new TypeError(`option expires is invalid: ${y.expires}`);R+="; Expires="+y.expires.toUTCString()}if(y.httpOnly&&(R+="; HttpOnly"),y.secure&&(R+="; Secure"),y.partitioned&&(R+="; Partitioned"),y.priority)switch(typeof y.priority=="string"?y.priority.toLowerCase():void 0){case"low":R+="; Priority=Low";break;case"medium":R+="; Priority=Medium";break;case"high":R+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${y.priority}`)}if(y.sameSite)switch(typeof y.sameSite=="string"?y.sameSite.toLowerCase():y.sameSite){case!0:case"strict":R+="; SameSite=Strict";break;case"lax":R+="; SameSite=Lax";break;case"none":R+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${y.sameSite}`)}return R}function h(w){if(w.indexOf("%")===-1)return w;try{return decodeURIComponent(w)}catch{return w}}function v(w){return i.call(w)==="[object Date]"}return Ba}DS();/** + * react-router v7.0.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */var Sy="popstate";function FS(e={}){function t(o,i){let{pathname:a,search:c,hash:u}=o.location;return ph("",{pathname:a,search:c,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(o,i){return typeof i=="string"?i:jl(i)}return WS(t,n,null,e)}function Et(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function mo(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function US(){return Math.random().toString(36).substring(2,10)}function ky(e,t){return{usr:e.state,key:e.key,idx:t}}function ph(e,t,n=null,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?qi(t):t,state:n,key:t&&t.key||o||US()}}function jl({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function qi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let o=e.indexOf("?");o>=0&&(t.search=e.substring(o),e=e.substring(0,o)),e&&(t.pathname=e)}return t}function WS(e,t,n,o={}){let{window:i=document.defaultView,v5Compat:a=!1}=o,c=i.history,u="POP",d=null,p=h();p==null&&(p=0,c.replaceState({...c.state,idx:p},""));function h(){return(c.state||{idx:null}).idx}function v(){u="POP";let C=h(),R=C==null?null:C-p;p=C,d&&d({action:u,location:k.location,delta:R})}function w(C,R){u="PUSH";let O=ph(k.location,C,R);p=h()+1;let $=ky(O,p),j=k.createHref(O);try{c.pushState($,"",j)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(j)}a&&d&&d({action:u,location:k.location,delta:1})}function S(C,R){u="REPLACE";let O=ph(k.location,C,R);p=h();let $=ky(O,p),j=k.createHref(O);c.replaceState($,"",j),a&&d&&d({action:u,location:k.location,delta:0})}function y(C){let R=i.location.origin!=="null"?i.location.origin:i.location.href,O=typeof C=="string"?C:jl(C);return O=O.replace(/ $/,"%20"),Et(R,`No window.location.(origin|href) available to create URL for href: ${O}`),new URL(O,R)}let k={get action(){return u},get location(){return e(i,c)},listen(C){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(Sy,v),d=C,()=>{i.removeEventListener(Sy,v),d=null}},createHref(C){return t(i,C)},createURL:y,encodeLocation(C){let R=y(C);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:w,replace:S,go(C){return c.go(C)}};return k}function yb(e,t,n="/"){return HS(e,t,n,!1)}function HS(e,t,n,o){let i=typeof t=="string"?qi(t):t,a=Go(i.pathname||"/",n);if(a==null)return null;let c=xb(e);VS(c);let u=null;for(let d=0;u==null&&d{let d={relativePath:u===void 0?a.path||"":u,caseSensitive:a.caseSensitive===!0,childrenIndex:c,route:a};d.relativePath.startsWith("/")&&(Et(d.relativePath.startsWith(o),`Absolute route path "${d.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(o.length));let p=fo([o,d.relativePath]),h=n.concat(d);a.children&&a.children.length>0&&(Et(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),xb(a.children,t,h,p)),!(a.path==null&&!a.index)&&t.push({path:p,score:QS(p,a.index),routesMeta:h})};return e.forEach((a,c)=>{var u;if(a.path===""||!((u=a.path)!=null&&u.includes("?")))i(a,c);else for(let d of bb(a.path))i(a,c,d)}),t}function bb(e){let t=e.split("/");if(t.length===0)return[];let[n,...o]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(o.length===0)return i?[a,""]:[a];let c=bb(o.join("/")),u=[];return u.push(...c.map(d=>d===""?a:[a,d].join("/"))),i&&u.push(...c),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function VS(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:ZS(t.routesMeta.map(o=>o.childrenIndex),n.routesMeta.map(o=>o.childrenIndex)))}var qS=/^:[\w-]+$/,KS=3,GS=2,JS=1,XS=10,YS=-2,_y=e=>e==="*";function QS(e,t){let n=e.split("/"),o=n.length;return n.some(_y)&&(o+=YS),t&&(o+=GS),n.filter(i=>!_y(i)).reduce((i,a)=>i+(qS.test(a)?KS:a===""?JS:XS),o)}function ZS(e,t){return e.length===t.length&&e.slice(0,-1).every((o,i)=>o===t[i])?e[e.length-1]-t[t.length-1]:0}function ek(e,t,n=!1){let{routesMeta:o}=e,i={},a="/",c=[];for(let u=0;u{if(h==="*"){let y=u[w]||"";c=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const S=u[w];return v&&!S?p[h]=void 0:p[h]=(S||"").replace(/%2F/g,"/"),p},{}),pathname:a,pathnameBase:c,pattern:e}}function tk(e,t=!1,n=!0){mo(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let o=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,d)=>(o.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(o.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),o]}function nk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return mo(!1,`The URL path "${e}" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Go(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,o=e.charAt(n);return o&&o!=="/"?null:e.slice(n)||"/"}function rk(e,t="/"){let{pathname:n,search:o="",hash:i=""}=typeof e=="string"?qi(e):e;return{pathname:n?n.startsWith("/")?n:ok(n,t):t,search:ak(o),hash:lk(i)}}function ok(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function jp(e,t,n,o){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function sk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Hh(e){let t=sk(e);return t.map((n,o)=>o===t.length-1?n.pathname:n.pathnameBase)}function Vh(e,t,n,o=!1){let i;typeof e=="string"?i=qi(e):(i={...e},Et(!i.pathname||!i.pathname.includes("?"),jp("?","pathname","search",i)),Et(!i.pathname||!i.pathname.includes("#"),jp("#","pathname","hash",i)),Et(!i.search||!i.search.includes("#"),jp("#","search","hash",i)));let a=e===""||i.pathname==="",c=a?"/":i.pathname,u;if(c==null)u=n;else{let v=t.length-1;if(!o&&c.startsWith("..")){let w=c.split("/");for(;w[0]==="..";)w.shift(),v-=1;i.pathname=w.join("/")}u=v>=0?t[v]:"/"}let d=rk(i,u),p=c&&c!=="/"&&c.endsWith("/"),h=(a||c===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(p||h)&&(d.pathname+="/"),d}var fo=e=>e.join("/").replace(/\/\/+/g,"/"),ik=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ak=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,lk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function ck(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var wb=["POST","PUT","PATCH","DELETE"];new Set(wb);var uk=["GET",...wb];new Set(uk);var Ki=x.createContext(null);Ki.displayName="DataRouter";var ad=x.createContext(null);ad.displayName="DataRouterState";var Cb=x.createContext({isTransitioning:!1});Cb.displayName="ViewTransition";var dk=x.createContext(new Map);dk.displayName="Fetchers";var fk=x.createContext(null);fk.displayName="Await";var Tr=x.createContext(null);Tr.displayName="Navigation";var Wl=x.createContext(null);Wl.displayName="Location";var $r=x.createContext({outlet:null,matches:[],isDataRoute:!1});$r.displayName="Route";var qh=x.createContext(null);qh.displayName="RouteError";function pk(e,{relative:t}={}){Et(Gi(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:o}=x.useContext(Tr),{hash:i,pathname:a,search:c}=Hl(e,{relative:t}),u=a;return n!=="/"&&(u=a==="/"?n:fo([n,a])),o.createHref({pathname:u,search:c,hash:i})}function Gi(){return x.useContext(Wl)!=null}function jr(){return Et(Gi(),"useLocation() may be used only in the context of a component."),x.useContext(Wl).location}var Sb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function kb(e){x.useContext(Tr).static||x.useLayoutEffect(e)}function go(){let{isDataRoute:e}=x.useContext($r);return e?Rk():hk()}function hk(){Et(Gi(),"useNavigate() may be used only in the context of a component.");let e=x.useContext(Ki),{basename:t,navigator:n}=x.useContext(Tr),{matches:o}=x.useContext($r),{pathname:i}=jr(),a=JSON.stringify(Hh(o)),c=x.useRef(!1);return kb(()=>{c.current=!0}),x.useCallback((d,p={})=>{if(mo(c.current,Sb),!c.current)return;if(typeof d=="number"){n.go(d);return}let h=Vh(d,JSON.parse(a),i,p.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:fo([t,h.pathname])),(p.replace?n.replace:n.push)(h,p.state,p)},[t,n,a,i,e])}x.createContext(null);function Ls(){let{matches:e}=x.useContext($r),t=e[e.length-1];return t?t.params:{}}function Hl(e,{relative:t}={}){let{matches:n}=x.useContext($r),{pathname:o}=jr(),i=JSON.stringify(Hh(n));return x.useMemo(()=>Vh(e,JSON.parse(i),o,t==="path"),[e,i,o,t])}function mk(e,t){return _b(e,t)}function _b(e,t,n,o){var k;Et(Gi(),"useRoutes() may be used only in the context of a component.");let{navigator:i}=x.useContext(Tr),{matches:a}=x.useContext($r),c=a[a.length-1],u=c?c.params:{};c&&c.pathname;let d=c?c.pathnameBase:"/";c&&c.route;let p=jr(),h;if(t){let C=typeof t=="string"?qi(t):t;Et(d==="/"||((k=C.pathname)==null?void 0:k.startsWith(d)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${C.pathname}" was given in the \`location\` prop.`),h=C}else h=p;let v=h.pathname||"/",w=v;if(d!=="/"){let C=d.replace(/^\//,"").split("/");w="/"+v.replace(/^\//,"").split("/").slice(C.length).join("/")}let S=yb(e,{pathname:w}),y=bk(S&&S.map(C=>Object.assign({},C,{params:Object.assign({},u,C.params),pathname:fo([d,i.encodeLocation?i.encodeLocation(C.pathname).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?d:fo([d,i.encodeLocation?i.encodeLocation(C.pathnameBase).pathname:C.pathnameBase])})),a,n,o);return t&&y?x.createElement(Wl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...h},navigationType:"POP"}},y):y}function gk(){let e=_k(),t=ck(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:i},n):null,null)}var vk=x.createElement(gk,null),yk=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?x.createElement($r.Provider,{value:this.props.routeContext},x.createElement(qh.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function xk({routeContext:e,match:t,children:n}){let o=x.useContext(Ki);return o&&o.static&&o.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement($r.Provider,{value:e},n)}function bk(e,t=[],n=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,a=n==null?void 0:n.errors;if(a!=null){let d=i.findIndex(p=>p.route.id&&(a==null?void 0:a[p.route.id])!==void 0);Et(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),i=i.slice(0,Math.min(i.length,d+1))}let c=!1,u=-1;if(n)for(let d=0;d=0?i=i.slice(0,u+1):i=[i[0]];break}}}return i.reduceRight((d,p,h)=>{let v,w=!1,S=null,y=null;n&&(v=a&&p.route.id?a[p.route.id]:void 0,S=p.route.errorElement||vk,c&&(u<0&&h===0?(Ek("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,y=null):u===h&&(w=!0,y=p.route.hydrateFallbackElement||null)));let k=t.concat(i.slice(0,h+1)),C=()=>{let R;return v?R=S:w?R=y:p.route.Component?R=x.createElement(p.route.Component,null):p.route.element?R=p.route.element:R=d,x.createElement(xk,{match:p,routeContext:{outlet:d,matches:k,isDataRoute:n!=null},children:R})};return n&&(p.route.ErrorBoundary||p.route.errorElement||h===0)?x.createElement(yk,{location:n.location,revalidation:n.revalidation,component:S,error:v,children:C(),routeContext:{outlet:null,matches:k,isDataRoute:!0}}):C()},null)}function Kh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function wk(e){let t=x.useContext(Ki);return Et(t,Kh(e)),t}function Ck(e){let t=x.useContext(ad);return Et(t,Kh(e)),t}function Sk(e){let t=x.useContext($r);return Et(t,Kh(e)),t}function Gh(e){let t=Sk(e),n=t.matches[t.matches.length-1];return Et(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function kk(){return Gh("useRouteId")}function _k(){var o;let e=x.useContext(qh),t=Ck("useRouteError"),n=Gh("useRouteError");return e!==void 0?e:(o=t.errors)==null?void 0:o[n]}function Rk(){let{router:e}=wk("useNavigate"),t=Gh("useNavigate"),n=x.useRef(!1);return kb(()=>{n.current=!0}),x.useCallback(async(i,a={})=>{mo(n.current,Sb),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...a}))},[e,t])}var Ry={};function Ek(e,t,n){Ry[e]||(Ry[e]=!0,mo(!1,n))}x.memo(Pk);function Pk({routes:e,future:t,state:n}){return _b(e,void 0,n,t)}function bl({to:e,replace:t,state:n,relative:o}){Et(Gi()," may be used only in the context of a component.");let{static:i}=x.useContext(Tr);mo(!i," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:a}=x.useContext($r),{pathname:c}=jr(),u=go(),d=Vh(e,Hh(a),c,o==="path"),p=JSON.stringify(d);return x.useEffect(()=>{u(JSON.parse(p),{replace:t,state:n,relative:o})},[u,p,o,t,n]),null}function dr(e){Et(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function Tk({basename:e="/",children:t=null,location:n,navigationType:o="POP",navigator:i,static:a=!1}){Et(!Gi(),"You cannot render a inside another . You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=x.useMemo(()=>({basename:c,navigator:i,static:a,future:{}}),[c,i,a]);typeof n=="string"&&(n=qi(n));let{pathname:d="/",search:p="",hash:h="",state:v=null,key:w="default"}=n,S=x.useMemo(()=>{let y=Go(d,c);return y==null?null:{location:{pathname:y,search:p,hash:h,state:v,key:w},navigationType:o}},[c,d,p,h,v,w,o]);return mo(S!=null,` is not able to match the URL "${d}${p}${h}" because it does not start with the basename, so the won't render anything.`),S==null?null:x.createElement(Tr.Provider,{value:u},x.createElement(Wl.Provider,{children:t,value:S}))}function Rb({children:e,location:t}){return mk(hh(e),t)}function hh(e,t=[]){let n=[];return x.Children.forEach(e,(o,i)=>{if(!x.isValidElement(o))return;let a=[...t,i];if(o.type===x.Fragment){n.push.apply(n,hh(o.props.children,a));return}Et(o.type===dr,`[${typeof o.type=="string"?o.type:o.type.name}] is not a component. All component children of must be a or `),Et(!o.props.index||!o.props.children,"An index route cannot have child routes.");let c={id:o.props.id||a.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(c.children=hh(o.props.children,a)),n.push(c)}),n}var Nu="get",zu="application/x-www-form-urlencoded";function ld(e){return e!=null&&typeof e.tagName=="string"}function $k(e){return ld(e)&&e.tagName.toLowerCase()==="button"}function jk(e){return ld(e)&&e.tagName.toLowerCase()==="form"}function Ok(e){return ld(e)&&e.tagName.toLowerCase()==="input"}function Ik(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Lk(e,t){return e.button===0&&(!t||t==="_self")&&!Ik(e)}var bu=null;function Ak(){if(bu===null)try{new FormData(document.createElement("form"),0),bu=!1}catch{bu=!0}return bu}var Mk=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Op(e){return e!=null&&!Mk.has(e)?(mo(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${zu}"`),null):e}function Nk(e,t){let n,o,i,a,c;if(jk(e)){let u=e.getAttribute("action");o=u?Go(u,t):null,n=e.getAttribute("method")||Nu,i=Op(e.getAttribute("enctype"))||zu,a=new FormData(e)}else if($k(e)||Ok(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a